function _mergeNamespaces(be,M){for(var V=0;VH[te]})}}}return Object.freeze(Object.defineProperty(be,Symbol.toStringTag,{value:"Module"}))}(function(){const M=document.createElement("link").relList;if(M&&M.supports&&M.supports("modulepreload"))return;for(const te of document.querySelectorAll('link[rel="modulepreload"]'))H(te);new MutationObserver(te=>{for(const ve of te)if(ve.type==="childList")for(const fe of ve.addedNodes)fe.tagName==="LINK"&&fe.rel==="modulepreload"&&H(fe)}).observe(document,{childList:!0,subtree:!0});function V(te){const ve={};return te.integrity&&(ve.integrity=te.integrity),te.referrerPolicy&&(ve.referrerPolicy=te.referrerPolicy),te.crossOrigin==="use-credentials"?ve.credentials="include":te.crossOrigin==="anonymous"?ve.credentials="omit":ve.credentials="same-origin",ve}function H(te){if(te.ep)return;te.ep=!0;const ve=V(te);fetch(te.href,ve)}})();function dispatchCallback(be,M){be&&be(M)}function reverseDictionary(be){return Object.fromEntries(Object.entries(be).map(([M,V])=>[V,M]))}function escapeRegExp(be){return be.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Callable=class{constructor(){let be=function(...M){return be._call(...M)};return Object.setPrototypeOf(be,new.target.prototype)}_call(...be){throw Error("Must implement _call method in subclass")}};function isTypedArray(be){return be?.prototype?.__proto__?.constructor?.name==="TypedArray"}function isIntegralNumber(be){return Number.isInteger(be)||typeof be=="bigint"}function exists(be){return be!=null}function calculateDimensions(be){const M=[];let V=be;for(;Array.isArray(V);)M.push(V.length),V=V[0];return M}function pop(be,M,V=void 0){const H=be[M];if(H!==void 0)return delete be[M],H;if(V===void 0)throw Error(`Key ${M} does not exist in object.`);return V}function mergeArrays(...be){return Array.prototype.concat.apply([],be)}function product(...be){return be.reduce((M,V)=>M.flatMap(H=>V.map(te=>[H,te])))}function calculateReflectOffset(be,M){return Math.abs((be+M)%(2*M)-M)}const sharp={},ONNX_NODE=Object.freeze(Object.defineProperty({__proto__:null,default:sharp},Symbol.toStringTag,{value:"Module"}));var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(be){return be&&be.__esModule&&Object.prototype.hasOwnProperty.call(be,"default")?be.default:be}function getAugmentedNamespace(be){if(be.__esModule)return be;var M=be.default;if(typeof M=="function"){var V=function H(){return this instanceof H?Reflect.construct(M,arguments,this.constructor):M.apply(this,arguments)};V.prototype=M.prototype}else V={};return Object.defineProperty(V,"__esModule",{value:!0}),Object.keys(be).forEach(function(H){var te=Object.getOwnPropertyDescriptor(be,H);Object.defineProperty(V,H,te.get?te:{enumerable:!0,get:function(){return be[H]}})}),V}var ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(be,M,V)=>{if(M&&typeof M.init=="function"&&typeof M.createSessionHandler=="function"){const H=backends[be];if(H===void 0)backends[be]={backend:M,priority:V};else{if(H.priority>V)return;if(H.priority===V&&H.backend!==M)throw new Error(`cannot register backend "${be}" using priority ${V}`)}if(V>=0){const te=backendsSortedByPriority.indexOf(be);te!==-1&&backendsSortedByPriority.splice(te,1);for(let ve=0;ve{const M=be.length===0?backendsSortedByPriority:be,V=[];for(const H of M){const te=backends[H];if(te){if(te.initialized)return te.backend;if(te.aborted)continue;const ve=!!te.initPromise;try{return ve||(te.initPromise=te.backend.init()),await te.initPromise,te.initialized=!0,te.backend}catch(fe){ve||V.push({name:H,err:fe}),te.aborted=!0}finally{delete te.initPromise}}}throw new Error(`no available backend found. ERR: ${V.map(H=>`[${H.name}] ${H.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(M){if(M!==void 0){if(typeof M!="string"||["verbose","info","warning","error","fatal"].indexOf(M)===-1)throw new Error(`Unsupported logging level: ${M}`);this.logLevelInternal=M}}get logLevel(){return this.logLevelInternal}}const env$2=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=be=>{let M=1;for(let V=0;V{const $=document.createElement("canvas"),F=$.getContext("2d");if(!M||!F)return Me();const he=new Image;he.crossOrigin="Anonymous",he.src=M,he.onload=()=>{$.width=he.width,$.height=he.height,F.drawImage(he,0,0,$.width,$.height);const we=F.getImageData(0,0,$.width,$.height);if(V!==void 0){if(V.height!==void 0&&V.height!==$.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(Re.height=$.height,V.width!==void 0&&V.width!==$.width)throw new Error("Image input config width doesn't match ImageBitmap width");Re.width=$.width}else Re.height=$.height,Re.width=$.width;Ce(K0.bufferToTensor(we.data,Re))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(Ee!==void 0)return K0.bufferToTensor(Ee,Re);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(M){var V,H;const te=document.createElement("canvas").getContext("2d");let ve;if(te!=null){const fe=this.dims[3],Ee=this.dims[2],Re=this.dims[1],Ce=M!==void 0&&M.format!==void 0?M.format:"RGB",Me=M!==void 0&&((V=M.norm)===null||V===void 0?void 0:V.mean)!==void 0?M.norm.mean:255,$=M!==void 0&&((H=M.norm)===null||H===void 0?void 0:H.bias)!==void 0?M.norm.bias:0,F=Ee*fe;if(M!==void 0){if(M.height!==void 0&&M.height!==Ee)throw new Error("Image output config height doesn't match tensor height");if(M.width!==void 0&&M.width!==fe)throw new Error("Image output config width doesn't match tensor width");if(M.format!==void 0&&Re===4&&M.format!=="RGBA"||Re===3&&M.format!=="RGB"&&M.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const he=4;let we=0,He=1,ut=2,tt=3,_e=0,Gt=F,Qt=F*2,ir=-1;Ce==="RGBA"?(_e=0,Gt=F,Qt=F*2,ir=F*3):Ce==="RGB"?(_e=0,Gt=F,Qt=F*2):Ce==="RBG"&&(_e=0,Qt=F,Gt=F*2),ve=te.createImageData(fe,Ee);for(let Lr=0;Lr"u")throw new Error(`input '${Ce}' is missing in 'feeds'.`);if(fe)for(const Ce of this.outputNames)te[Ce]=null;const Ee=await this.handler.run(M,te,ve),Re={};for(const Ce in Ee)Object.hasOwnProperty.call(Ee,Ce)&&(Re[Ce]=new Tensor$1(Ee[Ce].type,Ee[Ce].data,Ee[Ce].dims));return Re}static async create(M,V,H,te){let ve,fe={};if(typeof M=="string"){if(ve=M,typeof V=="object"&&V!==null)fe=V;else if(typeof V<"u")throw new TypeError("'options' must be an object.")}else if(M instanceof Uint8Array){if(ve=M,typeof V=="object"&&V!==null)fe=V;else if(typeof V<"u")throw new TypeError("'options' must be an object.")}else if(M instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&M instanceof SharedArrayBuffer){const $=M;let F=0,he=M.byteLength;if(typeof V=="object"&&V!==null)fe=V;else if(typeof V=="number"){if(F=V,!Number.isSafeInteger(F))throw new RangeError("'byteOffset' must be an integer.");if(F<0||F>=$.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${$.byteLength}).`);if(he=M.byteLength-F,typeof H=="number"){if(he=H,!Number.isSafeInteger(he))throw new RangeError("'byteLength' must be an integer.");if(he<=0||F+he>$.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${$.byteLength-F}].`);if(typeof te=="object"&&te!==null)fe=te;else if(typeof te<"u")throw new TypeError("'options' must be an object.")}else if(typeof H<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof V<"u")throw new TypeError("'options' must be an object.");ve=new Uint8Array($,F,he)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const Re=(fe.executionProviders||[]).map($=>typeof $=="string"?$:$.name),Me=await(await resolveBackend(Re)).createSessionHandler(ve,fe);return new HS(Me)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession$1=InferenceSession$2,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:InferenceSession$1,Tensor:Tensor$1,env:env$2,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(lib);/*! * ONNX Runtime Web v1.14.0 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */(function(module,exports$1){(function(be,M){module.exports=M(require$$0$1)})(self,__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(be,M,V)=>{var H,te=(H=(H=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(ve){function fe(){return ji.buffer!=Qo&&Hl(ji.buffer),Sl}function Ee(){return ji.buffer!=Qo&&Hl(ji.buffer),Hs}function Re(){return ji.buffer!=Qo&&Hl(ji.buffer),Rl}function Ce(){return ji.buffer!=Qo&&Hl(ji.buffer),bs}function Me(){return ji.buffer!=Qo&&Hl(ji.buffer),po}var $,F,he;ve=ve||{},$||($=ve!==void 0?ve:{}),$.ready=new Promise(function(Zr,Ln){F=Zr,he=Ln});var we,He,ut,tt,_e,Gt,Qt=Object.assign({},$),ir="./this.program",Lr=(Zr,Ln)=>{throw Ln},jr=typeof window=="object",tn=typeof importScripts=="function",mr=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Ir=$.ENVIRONMENT_IS_PTHREAD||!1,On="";function ba(Zr){return $.locateFile?$.locateFile(Zr,On):On+Zr}if(mr){let Zr;On=tn?V(908).dirname(On)+"/":"//",Gt=()=>{_e||(tt=V(1384),_e=V(908))},we=function(Ln,ia){return Gt(),Ln=_e.normalize(Ln),tt.readFileSync(Ln,ia?void 0:"utf8")},ut=Ln=>((Ln=we(Ln,!0)).buffer||(Ln=new Uint8Array(Ln)),Ln),He=(Ln,ia,Oa)=>{Gt(),Ln=_e.normalize(Ln),tt.readFile(Ln,function(Di,Xi){Di?Oa(Di):ia(Xi.buffer)})},1{if(Hh())throw process.exitCode=Ln,ia;ia instanceof pp||pa("exiting due to exception: "+ia),process.exit(Ln)},$.inspect=function(){return"[Emscripten Module object]"};try{Zr=V(9925)}catch(Ln){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),Ln}V.g.Worker=Zr.Worker}else(jr||tn)&&(tn?On=self.location.href:typeof document<"u"&&document.currentScript&&(On=document.currentScript.src),H&&(On=H),On=On.indexOf("blob:")!==0?On.substr(0,On.replace(/[?#].*/,"").lastIndexOf("/")+1):"",mr||(we=Zr=>{var Ln=new XMLHttpRequest;return Ln.open("GET",Zr,!1),Ln.send(null),Ln.responseText},tn&&(ut=Zr=>{var Ln=new XMLHttpRequest;return Ln.open("GET",Zr,!1),Ln.responseType="arraybuffer",Ln.send(null),new Uint8Array(Ln.response)}),He=(Zr,Ln,ia)=>{var Oa=new XMLHttpRequest;Oa.open("GET",Zr,!0),Oa.responseType="arraybuffer",Oa.onload=()=>{Oa.status==200||Oa.status==0&&Oa.response?Ln(Oa.response):ia()},Oa.onerror=ia,Oa.send(null)}));mr&&typeof performance>"u"&&(V.g.performance=V(6953).performance);var ra=console.log.bind(console),jn=console.warn.bind(console);mr&&(Gt(),ra=Zr=>tt.writeSync(1,Zr+` `),jn=Zr=>tt.writeSync(2,Zr+` `));var qn,Un=$.print||ra,pa=$.printErr||jn;Object.assign($,Qt),Qt=null,$.thisProgram&&(ir=$.thisProgram),$.quit&&(Lr=$.quit),$.wasmBinary&&(qn=$.wasmBinary);var lo=$.noExitRuntime||!1;typeof WebAssembly!="object"&&qu("no native wasm support detected");var ji,Fo,Qo,Sl,Hs,Rl,bs,po,es=!1,ef=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function wf(Zr,Ln,ia){var Oa=(Ln>>>=0)+ia;for(ia=Ln;Zr[ia]&&!(ia>=Oa);)++ia;if(16(Di=(240&Di)==224?(15&Di)<<12|Xi<<6|ko:(7&Di)<<18|Xi<<12|ko<<6|63&Zr[Ln++])?Oa+=String.fromCharCode(Di):(Di-=65536,Oa+=String.fromCharCode(55296|Di>>10,56320|1023&Di))}}else Oa+=String.fromCharCode(Di)}return Oa}function Qu(Zr,Ln){return(Zr>>>=0)?wf(Ee(),Zr,Ln):""}function Zs(Zr,Ln,ia,Oa){if(!(0>>=0;Oa=ia+Oa-1;for(var Xi=0;Xi=ko&&(ko=65536+((1023&ko)<<10)|1023&Zr.charCodeAt(++Xi)),127>=ko){if(ia>=Oa)break;Ln[ia++>>>0]=ko}else{if(2047>=ko){if(ia+1>=Oa)break;Ln[ia++>>>0]=192|ko>>6}else{if(65535>=ko){if(ia+2>=Oa)break;Ln[ia++>>>0]=224|ko>>12}else{if(ia+3>=Oa)break;Ln[ia++>>>0]=240|ko>>18,Ln[ia++>>>0]=128|ko>>12&63}Ln[ia++>>>0]=128|ko>>6&63}Ln[ia++>>>0]=128|63&ko}}return Ln[ia>>>0]=0,ia-Di}function jc(Zr){for(var Ln=0,ia=0;ia=Oa?Ln++:2047>=Oa?Ln+=2:55296<=Oa&&57343>=Oa?(Ln+=4,++ia):Ln+=3}return Ln}function Hl(Zr){Qo=Zr,$.HEAP8=Sl=new Int8Array(Zr),$.HEAP16=new Int16Array(Zr),$.HEAP32=Rl=new Int32Array(Zr),$.HEAPU8=Hs=new Uint8Array(Zr),$.HEAPU16=new Uint16Array(Zr),$.HEAPU32=bs=new Uint32Array(Zr),$.HEAPF32=new Float32Array(Zr),$.HEAPF64=po=new Float64Array(Zr)}Ir&&(Qo=$.buffer);var so=$.INITIAL_MEMORY||16777216;if(Ir)ji=$.wasmMemory,Qo=$.buffer;else if($.wasmMemory)ji=$.wasmMemory;else if(!((ji=new WebAssembly.Memory({initial:so/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw pa("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),mr&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");ji&&(Qo=ji.buffer),so=Qo.byteLength,Hl(Qo);var Of,ch=[],_d=[],bd=[],op=[];function Hh(){return lo||!1}function xd(){var Zr=$.preRun.shift();ch.unshift(Zr)}var Tf,Cd=0,sp=null;function qu(Zr){throw Ir?postMessage({cmd:"onAbort",arg:Zr}):$.onAbort&&$.onAbort(Zr),pa(Zr="Aborted("+Zr+")"),es=!0,Zr=new WebAssembly.RuntimeError(Zr+". Build with -sASSERTIONS for more info."),he(Zr),Zr}function Sv(){return Tf.startsWith("data:application/octet-stream;base64,")}function Mv(){var Zr=Tf;try{if(Zr==Tf&&qn)return new Uint8Array(qn);if(ut)return ut(Zr);throw"both async and sync fetching of the wasm failed"}catch(Ln){qu(Ln)}}Tf="ort-wasm-threaded.wasm",Sv()||(Tf=ba(Tf));var J0={};function pp(Zr){this.name="ExitStatus",this.message="Program terminated with exit("+Zr+")",this.status=Zr}function Ev(Zr){(Zr=Jl.Vb[Zr])||qu(),Jl.mc(Zr)}function kv(Zr){var Ln=Jl.Cc();if(!Ln)return 6;Jl.ac.push(Ln),Jl.Vb[Zr.Ub]=Ln,Ln.Ub=Zr.Ub;var ia={cmd:"run",start_routine:Zr.Ic,arg:Zr.zc,pthread_ptr:Zr.Ub};return Ln.$b=()=>{ia.time=performance.now(),Ln.postMessage(ia,Zr.Nc)},Ln.loaded&&(Ln.$b(),delete Ln.$b),0}function Qh(Zr){if(Ir)return Ss(1,1,Zr);Hh()||(Jl.oc(),$.onExit&&$.onExit(Zr),es=!0),Lr(Zr,new pp(Zr))}function tv(Zr,Ln){if(!Ln&&Ir)throw em(Zr),"unwind";Hh()||Ir||(sg(),Ip(bd),xy(0),ig[1].length&&og(1,10),ig[2].length&&og(2,10),Jl.oc()),Qh(Zr)}var Jl={Yb:[],ac:[],qc:[],Vb:{},fc:function(){Ir&&Jl.Ec()},Pc:function(){},Ec:function(){Jl.receiveObjectTransfer=Jl.Gc,Jl.threadInitTLS=Jl.pc,Jl.setExitStatus=Jl.nc,lo=!1},nc:function(){},oc:function(){for(var Zr of Object.values(Jl.Vb))Jl.mc(Zr);for(Zr of Jl.Yb)Zr.terminate();Jl.Yb=[]},mc:function(Zr){var Ln=Zr.Ub;delete Jl.Vb[Ln],Jl.Yb.push(Zr),Jl.ac.splice(Jl.ac.indexOf(Zr),1),Zr.Ub=0,gp(Ln)},Gc:function(){},pc:function(){Jl.qc.forEach(Zr=>Zr())},Fc:function(Zr,Ln){Zr.onmessage=ia=>{var Oa=(ia=ia.data).cmd;if(Zr.Ub&&(Jl.Bc=Zr.Ub),ia.targetThread&&ia.targetThread!=y0()){var Di=Jl.Vb[ia.Qc];Di?Di.postMessage(ia,ia.transferList):pa('Internal error! Worker sent a message "'+Oa+'" to target pthread '+ia.targetThread+", but that thread no longer exists!")}else Oa==="processProxyingQueue"?si(ia.queue):Oa==="spawnThread"?kv(ia):Oa==="cleanupThread"?Ev(ia.thread):Oa==="killThread"?(ia=ia.thread,Oa=Jl.Vb[ia],delete Jl.Vb[ia],Oa.terminate(),gp(ia),Jl.ac.splice(Jl.ac.indexOf(Oa),1),Oa.Ub=0):Oa==="cancelThread"?Jl.Vb[ia.thread].postMessage({cmd:"cancel"}):Oa==="loaded"?(Zr.loaded=!0,Ln&&Ln(Zr),Zr.$b&&(Zr.$b(),delete Zr.$b)):Oa==="print"?Un("Thread "+ia.threadId+": "+ia.text):Oa==="printErr"?pa("Thread "+ia.threadId+": "+ia.text):Oa==="alert"?alert("Thread "+ia.threadId+": "+ia.text):ia.target==="setimmediate"?Zr.postMessage(ia):Oa==="onAbort"?$.onAbort&&$.onAbort(ia.arg):Oa&&pa("worker sent an unknown command "+Oa);Jl.Bc=void 0},Zr.onerror=ia=>{throw pa("worker sent an error! "+ia.filename+":"+ia.lineno+": "+ia.message),ia},mr&&(Zr.on("message",function(ia){Zr.onmessage({data:ia})}),Zr.on("error",function(ia){Zr.onerror(ia)}),Zr.on("detachedExit",function(){})),Zr.postMessage({cmd:"load",urlOrBlob:$.mainScriptUrlOrBlob||H,wasmMemory:ji,wasmModule:Fo})},yc:function(){var Zr=ba("ort-wasm-threaded.worker.js");Jl.Yb.push(new Worker(Zr))},Cc:function(){return Jl.Yb.length==0&&(Jl.yc(),Jl.Fc(Jl.Yb[0])),Jl.Yb.pop()}};function Ip(Zr){for(;0>2>>>0];Zr=Re()[Zr+48>>2>>>0],wy(Ln,Ln-Zr),Ol(Ln)};var vp=[];function pc(Zr){var Ln=vp[Zr];return Ln||(Zr>=vp.length&&(vp.length=Zr+1),vp[Zr]=Ln=Of.get(Zr)),Ln}$.invokeEntryPoint=function(Zr,Ln){Zr=pc(Zr)(Ln),Hh()?Jl.nc(Zr):rm(Zr)};var rv,h0,nv=[],hu=0,Ql=0;function iu(Zr){this.Zb=Zr,this.Sb=Zr-24,this.xc=function(Ln){Ce()[this.Sb+4>>2>>>0]=Ln},this.bc=function(){return Ce()[this.Sb+4>>2>>>0]},this.wc=function(Ln){Ce()[this.Sb+8>>2>>>0]=Ln},this.Dc=function(){return Ce()[this.Sb+8>>2>>>0]},this.rc=function(){Re()[this.Sb>>2>>>0]=0},this.hc=function(Ln){Ln=Ln?1:0,fe()[this.Sb+12>>0>>>0]=Ln},this.uc=function(){return fe()[this.Sb+12>>0>>>0]!=0},this.ic=function(Ln){Ln=Ln?1:0,fe()[this.Sb+13>>0>>>0]=Ln},this.kc=function(){return fe()[this.Sb+13>>0>>>0]!=0},this.fc=function(Ln,ia){this.cc(0),this.xc(Ln),this.wc(ia),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(Re(),this.Sb>>2,1)},this.Hc=function(){return Atomics.sub(Re(),this.Sb>>2,1)===1},this.cc=function(Ln){Ce()[this.Sb+16>>2>>>0]=Ln},this.tc=function(){return Ce()[this.Sb+16>>2>>>0]},this.vc=function(){if(ed(this.bc()))return Ce()[this.Zb>>2>>>0];var Ln=this.tc();return Ln!==0?Ln:this.Zb}}function d0(Zr){return Lv(new iu(Zr).Sb)}function av(Zr,Ln,ia,Oa){return Ir?Ss(3,1,Zr,Ln,ia,Oa):p0(Zr,Ln,ia,Oa)}function p0(Zr,Ln,ia,Oa){if(typeof SharedArrayBuffer>"u")return pa("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var Di=[];return Ir&&Di.length===0?av(Zr,Ln,ia,Oa):(Zr={Ic:ia,Ub:Zr,zc:Oa,Nc:Di},Ir?(Zr.Oc="spawnThread",postMessage(Zr,Di),0):kv(Zr))}function v0(Zr,Ln,ia){return Ir?Ss(4,1,Zr,Ln,ia):0}function m0(Zr,Ln){if(Ir)return Ss(5,1,Zr,Ln)}function g0(Zr,Ln){if(Ir)return Ss(6,1,Zr,Ln)}function Cv(Zr,Ln,ia){if(Ir)return Ss(7,1,Zr,Ln,ia)}function iv(Zr,Ln,ia){return Ir?Ss(8,1,Zr,Ln,ia):0}function Dp(Zr,Ln){if(Ir)return Ss(9,1,Zr,Ln)}function Rp(Zr,Ln,ia){if(Ir)return Ss(10,1,Zr,Ln,ia)}function nc(Zr,Ln,ia,Oa){if(Ir)return Ss(11,1,Zr,Ln,ia,Oa)}function Qf(Zr,Ln,ia,Oa){if(Ir)return Ss(12,1,Zr,Ln,ia,Oa)}function Pv(Zr,Ln,ia,Oa){if(Ir)return Ss(13,1,Zr,Ln,ia,Oa)}function fu(Zr){if(Ir)return Ss(14,1,Zr)}function Vn(Zr,Ln){if(Ir)return Ss(15,1,Zr,Ln)}function La(Zr,Ln,ia){if(Ir)return Ss(16,1,Zr,Ln,ia)}function si(Zr){Atomics.store(Re(),Zr>>2,1),y0()&&cf(Zr),Atomics.compareExchange(Re(),Zr>>2,1,0)}function Pi(Zr){return Ce()[Zr>>>2]+4294967296*Re()[Zr+4>>>2]}function Bi(Zr,Ln,ia,Oa,Di,Xi){return Ir?Ss(17,1,Zr,Ln,ia,Oa,Di,Xi):-52}function Qi(Zr,Ln,ia,Oa,Di,Xi){if(Ir)return Ss(18,1,Zr,Ln,ia,Oa,Di,Xi)}function bi(Zr){var Ln=jc(Zr)+1,ia=Op(Ln);return ia&&Zs(Zr,fe(),ia,Ln),ia}function pl(Zr,Ln,ia){function Oa(bu){return(bu=bu.toTimeString().match(/\(([A-Za-z ]+)\)$/))?bu[1]:"GMT"}if(Ir)return Ss(19,1,Zr,Ln,ia);var Di=new Date().getFullYear(),Xi=new Date(Di,0,1),ko=new Date(Di,6,1);Di=Xi.getTimezoneOffset();var Ho=ko.getTimezoneOffset(),Ps=Math.max(Di,Ho);Re()[Zr>>2>>>0]=60*Ps,Re()[Ln>>2>>>0]=+(Di!=Ho),Zr=Oa(Xi),Ln=Oa(ko),Zr=bi(Zr),Ln=bi(Ln),Ho>2>>>0]=Zr,Ce()[ia+4>>2>>>0]=Ln):(Ce()[ia>>2>>>0]=Ln,Ce()[ia+4>>2>>>0]=Zr)}function Ss(Zr,Ln){var ia=arguments.length-2,Oa=arguments;return Q0(()=>{for(var Di=eh(8*ia),Xi=Di>>3,ko=0;ko>>0]=Ho}return Sh(Zr,ia,Di,Ln)})}$.executeNotifiedProxyingQueue=si,h0=mr?()=>{var Zr=process.hrtime();return 1e3*Zr[0]+Zr[1]/1e6}:Ir?()=>performance.now()-$.__performance_now_clock_drift:()=>performance.now();var vu,ec=[],$h={};function Lh(){if(!vu){var Zr,Ln={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ir||"./this.program"};for(Zr in $h)$h[Zr]===void 0?delete Ln[Zr]:Ln[Zr]=$h[Zr];var ia=[];for(Zr in Ln)ia.push(Zr+"="+Ln[Zr]);vu=ia}return vu}function Ki(Zr,Ln){if(Ir)return Ss(20,1,Zr,Ln);var ia=0;return Lh().forEach(function(Oa,Di){var Xi=Ln+ia;for(Di=Ce()[Zr+4*Di>>2>>>0]=Xi,Xi=0;Xi>0>>>0]=Oa.charCodeAt(Xi);fe()[Di>>0>>>0]=0,ia+=Oa.length+1}),0}function Yu(Zr,Ln){if(Ir)return Ss(21,1,Zr,Ln);var ia=Lh();Ce()[Zr>>2>>>0]=ia.length;var Oa=0;return ia.forEach(function(Di){Oa+=Di.length+1}),Ce()[Ln>>2>>>0]=Oa,0}function tf(Zr){return Ir?Ss(22,1,Zr):52}function Wd(Zr,Ln,ia,Oa){return Ir?Ss(23,1,Zr,Ln,ia,Oa):52}function mp(Zr,Ln,ia,Oa,Di){return Ir?Ss(24,1,Zr,Ln,ia,Oa,Di):70}var ig=[null,[],[]];function og(Zr,Ln){var ia=ig[Zr];Ln===0||Ln===10?((Zr===1?Un:pa)(wf(ia,0)),ia.length=0):ia.push(Ln)}function gy(Zr,Ln,ia,Oa){if(Ir)return Ss(25,1,Zr,Ln,ia,Oa);for(var Di=0,Xi=0;Xi>2>>>0],Ho=Ce()[Ln+4>>2>>>0];Ln+=8;for(var Ps=0;Ps>>0]);Di+=Ho}return Ce()[Oa>>2>>>0]=Di,0}var wd=0;function tm(Zr){return Zr%4==0&&(Zr%100!=0||Zr%400==0)}var yy=[31,29,31,30,31,30,31,31,30,31,30,31],_y=[31,28,31,30,31,30,31,31,30,31,30,31];function kn(Zr,Ln,ia,Oa){function Di(ri,Su,Sc){for(ri=typeof ri=="number"?ri.toString():ri||"";ri.lengthTd?-1:0qd-ri.getDate())){ri.setDate(ri.getDate()+Su);break}Su-=qd-ri.getDate()+1,ri.setDate(1),11>Sc?ri.setMonth(Sc+1):(ri.setMonth(0),ri.setFullYear(ri.getFullYear()+1))}return Sc=new Date(ri.getFullYear()+1,0,4),Su=Ho(new Date(ri.getFullYear(),0,4)),Sc=Ho(Sc),0>=ko(Su,ri)?0>=ko(Sc,ri)?ri.getFullYear()+1:ri.getFullYear():ri.getFullYear()-1}var bu=Re()[Oa+40>>2>>>0];for(var rc in Oa={Lc:Re()[Oa>>2>>>0],Kc:Re()[Oa+4>>2>>>0],dc:Re()[Oa+8>>2>>>0],jc:Re()[Oa+12>>2>>>0],ec:Re()[Oa+16>>2>>>0],Xb:Re()[Oa+20>>2>>>0],Tb:Re()[Oa+24>>2>>>0],Wb:Re()[Oa+28>>2>>>0],Rc:Re()[Oa+32>>2>>>0],Jc:Re()[Oa+36>>2>>>0],Mc:bu?Qu(bu):""},ia=Qu(ia),bu={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})ia=ia.replace(new RegExp(rc,"g"),bu[rc]);var Vd="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Yd="January February March April May June July August September October November December".split(" ");for(rc in bu={"%a":function(ri){return Vd[ri.Tb].substring(0,3)},"%A":function(ri){return Vd[ri.Tb]},"%b":function(ri){return Yd[ri.ec].substring(0,3)},"%B":function(ri){return Yd[ri.ec]},"%C":function(ri){return Xi((ri.Xb+1900)/100|0,2)},"%d":function(ri){return Xi(ri.jc,2)},"%e":function(ri){return Di(ri.jc,2," ")},"%g":function(ri){return Ps(ri).toString().substring(2)},"%G":function(ri){return Ps(ri)},"%H":function(ri){return Xi(ri.dc,2)},"%I":function(ri){return(ri=ri.dc)==0?ri=12:12ri.dc?"AM":"PM"},"%S":function(ri){return Xi(ri.Lc,2)},"%t":function(){return" "},"%u":function(ri){return ri.Tb||7},"%U":function(ri){return Xi(Math.floor((ri.Wb+7-ri.Tb)/7),2)},"%V":function(ri){var Su=Math.floor((ri.Wb+7-(ri.Tb+6)%7)/7);if(2>=(ri.Tb+371-ri.Wb-2)%7&&Su++,Su)Su==53&&((Sc=(ri.Tb+371-ri.Wb)%7)==4||Sc==3&&tm(ri.Xb)||(Su=1));else{Su=52;var Sc=(ri.Tb+7-ri.Wb-1)%7;(Sc==4||Sc==5&&tm(ri.Xb%400-1))&&Su++}return Xi(Su,2)},"%w":function(ri){return ri.Tb},"%W":function(ri){return Xi(Math.floor((ri.Wb+7-(ri.Tb+6)%7)/7),2)},"%y":function(ri){return(ri.Xb+1900).toString().substring(2)},"%Y":function(ri){return ri.Xb+1900},"%z":function(ri){var Su=0<=(ri=ri.Jc);return ri=Math.abs(ri)/60,(Su?"+":"-")+("0000"+(ri/60*100+ri%60)).slice(-4)},"%Z":function(ri){return ri.Mc},"%%":function(){return"%"}},ia=ia.replace(/%%/g,"\0\0"),bu)ia.includes(rc)&&(ia=ia.replace(new RegExp(rc,"g"),bu[rc](Oa)));return rc=function(ri){var Su=Array(jc(ri)+1);return Zs(ri,Su,0,Su.length),Su}(ia=ia.replace(/\0\0/g,"%")),rc.length>Ln?0:(function(ri,Su){fe().set(ri,Su>>>0)}(rc,Zr),rc.length-1)}Jl.fc();var g_=[null,Qh,em,av,v0,m0,g0,Cv,iv,Dp,Rp,nc,Qf,Pv,fu,Vn,La,Bi,Qi,pl,Ki,Yu,tf,Wd,mp,gy],by={b:function(Zr){return Op(Zr+24)+24},n:function(Zr){return(Zr=new iu(Zr)).uc()||(Zr.hc(!0),hu--),Zr.ic(!1),nv.push(Zr),Zr.sc(),Zr.vc()},ma:function(Zr){throw pa("Unexpected exception thrown, this is not properly supported - aborting"),es=!0,Zr},x:function(){xl(0);var Zr=nv.pop();if(Zr.Hc()&&!Zr.kc()){var Ln=Zr.Dc();Ln&&pc(Ln)(Zr.Zb),d0(Zr.Zb)}Ql=0},e:function(){var Zr=Ql;if(!Zr)return wd=0;var Ln=new iu(Zr);Ln.cc(Zr);var ia=Ln.bc();if(!ia)return wd=0,Zr;for(var Oa=Array.prototype.slice.call(arguments),Di=0;Disi(Oa));else if(Ir)postMessage({targetThread:Zr,cmd:"processProxyingQueue",queue:Oa});else{if(!(Zr=Jl.Vb[Zr]))return;Zr.postMessage({cmd:"processProxyingQueue",queue:Oa})}return 1},Ea:function(){return-1},Pa:function(Zr,Ln){Zr=new Date(1e3*Pi(Zr)),Re()[Ln>>2>>>0]=Zr.getUTCSeconds(),Re()[Ln+4>>2>>>0]=Zr.getUTCMinutes(),Re()[Ln+8>>2>>>0]=Zr.getUTCHours(),Re()[Ln+12>>2>>>0]=Zr.getUTCDate(),Re()[Ln+16>>2>>>0]=Zr.getUTCMonth(),Re()[Ln+20>>2>>>0]=Zr.getUTCFullYear()-1900,Re()[Ln+24>>2>>>0]=Zr.getUTCDay(),Zr=(Zr.getTime()-Date.UTC(Zr.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,Re()[Ln+28>>2>>>0]=Zr},Qa:function(Zr,Ln){Zr=new Date(1e3*Pi(Zr)),Re()[Ln>>2>>>0]=Zr.getSeconds(),Re()[Ln+4>>2>>>0]=Zr.getMinutes(),Re()[Ln+8>>2>>>0]=Zr.getHours(),Re()[Ln+12>>2>>>0]=Zr.getDate(),Re()[Ln+16>>2>>>0]=Zr.getMonth(),Re()[Ln+20>>2>>>0]=Zr.getFullYear()-1900,Re()[Ln+24>>2>>>0]=Zr.getDay();var ia=new Date(Zr.getFullYear(),0,1),Oa=(Zr.getTime()-ia.getTime())/864e5|0;Re()[Ln+28>>2>>>0]=Oa,Re()[Ln+36>>2>>>0]=-60*Zr.getTimezoneOffset(),Oa=new Date(Zr.getFullYear(),6,1).getTimezoneOffset(),Zr=0|(Oa!=(ia=ia.getTimezoneOffset())&&Zr.getTimezoneOffset()==Math.min(ia,Oa)),Re()[Ln+32>>2>>>0]=Zr},Ra:function(Zr){var Ln=new Date(Re()[Zr+20>>2>>>0]+1900,Re()[Zr+16>>2>>>0],Re()[Zr+12>>2>>>0],Re()[Zr+8>>2>>>0],Re()[Zr+4>>2>>>0],Re()[Zr>>2>>>0],0),ia=Re()[Zr+32>>2>>>0],Oa=Ln.getTimezoneOffset(),Di=new Date(Ln.getFullYear(),0,1),Xi=new Date(Ln.getFullYear(),6,1).getTimezoneOffset(),ko=Di.getTimezoneOffset(),Ho=Math.min(ko,Xi);return 0>ia?Re()[Zr+32>>2>>>0]=+(Xi!=ko&&Ho==Oa):0>2>>>0]=Ln.getDay(),ia=(Ln.getTime()-Di.getTime())/864e5|0,Re()[Zr+28>>2>>>0]=ia,Re()[Zr>>2>>>0]=Ln.getSeconds(),Re()[Zr+4>>2>>>0]=Ln.getMinutes(),Re()[Zr+8>>2>>>0]=Ln.getHours(),Re()[Zr+12>>2>>>0]=Ln.getDate(),Re()[Zr+16>>2>>>0]=Ln.getMonth(),Ln.getTime()/1e3|0},Aa:Bi,Ba:Qi,Sa:function Zr(Ln,ia,Oa){Zr.Ac||(Zr.Ac=!0,pl(Ln,ia,Oa))},y:function(){qu("")},U:function(){if(!mr&&!tn){var Zr="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";rv||(rv={}),rv[Zr]||(rv[Zr]=1,mr&&(Zr="warning: "+Zr),pa(Zr))}},ra:function(){return 4294901760},B:h0,Ia:function(Zr,Ln,ia){Ee().copyWithin(Zr>>>0,Ln>>>0,Ln+ia>>>0)},F:function(){return mr?V(3993).cpus().length:navigator.hardwareConcurrency},Da:function(Zr,Ln,ia){ec.length=Ln,ia>>=3;for(var Oa=0;Oa>>0];return(0>Zr?J0[-Zr-1]:g_[Zr]).apply(null,ec)},qa:function(Zr){var Ln=Ee().length;if((Zr>>>=0)<=Ln||4294901760=ia;ia*=2){var Oa=Ln*(1+.2/ia);Oa=Math.min(Oa,Zr+100663296);var Di=Math;Oa=Math.max(Zr,Oa),Di=Di.min.call(Di,4294901760,Oa+(65536-Oa%65536)%65536);e:{try{ji.grow(Di-Qo.byteLength+65535>>>16),Hl(ji.buffer);var Xi=1;break e}catch{}Xi=void 0}if(Xi)return!0}return!1},Na:function(){throw"unwind"},Ga:Ki,Ha:Yu,J:tv,I:tf,S:Wd,ga:mp,R:gy,d:function(){return wd},na:function Zr(Ln,ia){Zr.lc||(Zr.lc=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var Di=new Uint8Array(1);return()=>(crypto.getRandomValues(Di),Di[0])}if(mr)try{var Xi=V(Object(function(){var ko=new Error("Cannot find module 'crypto'");throw ko.code="MODULE_NOT_FOUND",ko}()));return()=>Xi.randomBytes(1)[0]}catch{}return()=>qu("randomDevice")}());for(var Oa=0;Oa>0>>>0]=Zr.lc();return 0},ia:function(Zr,Ln,ia){var Oa=Fs();try{return pc(Zr)(Ln,ia)}catch(Di){if(Ol(Oa),Di!==Di+0)throw Di;xl(1,0)}},ja:function(Zr,Ln,ia){var Oa=Fs();try{return pc(Zr)(Ln,ia)}catch(Di){if(Ol(Oa),Di!==Di+0)throw Di;xl(1,0)}},K:function(Zr){var Ln=Fs();try{return pc(Zr)()}catch(ia){if(Ol(Ln),ia!==ia+0)throw ia;xl(1,0)}},f:function(Zr,Ln){var ia=Fs();try{return pc(Zr)(Ln)}catch(Oa){if(Ol(ia),Oa!==Oa+0)throw Oa;xl(1,0)}},P:function(Zr,Ln,ia){var Oa=Fs();try{return pc(Zr)(Ln,ia)}catch(Di){if(Ol(Oa),Di!==Di+0)throw Di;xl(1,0)}},Q:function(Zr,Ln,ia){var Oa=Fs();try{return pc(Zr)(Ln,ia)}catch(Di){if(Ol(Oa),Di!==Di+0)throw Di;xl(1,0)}},k:function(Zr,Ln,ia){var Oa=Fs();try{return pc(Zr)(Ln,ia)}catch(Di){if(Ol(Oa),Di!==Di+0)throw Di;xl(1,0)}},p:function(Zr,Ln,ia,Oa){var Di=Fs();try{return pc(Zr)(Ln,ia,Oa)}catch(Xi){if(Ol(Di),Xi!==Xi+0)throw Xi;xl(1,0)}},q:function(Zr,Ln,ia,Oa,Di){var Xi=Fs();try{return pc(Zr)(Ln,ia,Oa,Di)}catch(ko){if(Ol(Xi),ko!==ko+0)throw ko;xl(1,0)}},N:function(Zr,Ln,ia,Oa,Di,Xi){var ko=Fs();try{return pc(Zr)(Ln,ia,Oa,Di,Xi)}catch(Ho){if(Ol(ko),Ho!==Ho+0)throw Ho;xl(1,0)}},s:function(Zr,Ln,ia,Oa,Di,Xi){var ko=Fs();try{return pc(Zr)(Ln,ia,Oa,Di,Xi)}catch(Ho){if(Ol(ko),Ho!==Ho+0)throw Ho;xl(1,0)}},w:function(Zr,Ln,ia,Oa,Di,Xi,ko){var Ho=Fs();try{return pc(Zr)(Ln,ia,Oa,Di,Xi,ko)}catch(Ps){if(Ol(Ho),Ps!==Ps+0)throw Ps;xl(1,0)}},L:function(Zr,Ln,ia,Oa,Di,Xi,ko,Ho){var Ps=Fs();try{return pc(Zr)(Ln,ia,Oa,Di,Xi,ko,Ho)}catch(bu){if(Ol(Ps),bu!==bu+0)throw bu;xl(1,0)}},E:function(Zr,Ln,ia,Oa,Di,Xi,ko,Ho,Ps,bu,rc,Vd){var Yd=Fs();try{return pc(Zr)(Ln,ia,Oa,Di,Xi,ko,Ho,Ps,bu,rc,Vd)}catch(ri){if(Ol(Yd),ri!==ri+0)throw ri;xl(1,0)}},aa:function(Zr,Ln,ia,Oa,Di,Xi,ko,Ho){var Ps=Fs();try{return Dv(Zr,Ln,ia,Oa,Di,Xi,ko,Ho)}catch(bu){if(Ol(Ps),bu!==bu+0)throw bu;xl(1,0)}},_:function(Zr,Ln,ia,Oa,Di,Xi,ko){var Ho=Fs();try{return Ih(Zr,Ln,ia,Oa,Di,Xi,ko)}catch(Ps){if(Ol(Ho),Ps!==Ps+0)throw Ps;xl(1,0)}},Z:function(Zr,Ln,ia,Oa,Di){var Xi=Fs();try{return fg(Zr,Ln,ia,Oa,Di)}catch(ko){if(Ol(Xi),ko!==ko+0)throw ko;xl(1,0)}},ca:function(Zr,Ln,ia,Oa){var Di=Fs();try{return cg(Zr,Ln,ia,Oa)}catch(Xi){if(Ol(Di),Xi!==Xi+0)throw Xi;xl(1,0)}},$:function(Zr){var Ln=Fs();try{return ff(Zr)}catch(ia){if(Ol(Ln),ia!==ia+0)throw ia;xl(1,0)}},ba:function(Zr,Ln){var ia=Fs();try{return ov(Zr,Ln)}catch(Oa){if(Ol(ia),Oa!==Oa+0)throw Oa;xl(1,0)}},Y:function(Zr,Ln,ia){var Oa=Fs();try{return nm(Zr,Ln,ia)}catch(Di){if(Ol(Oa),Di!==Di+0)throw Di;xl(1,0)}},g:function(Zr){var Ln=Fs();try{pc(Zr)()}catch(ia){if(Ol(Ln),ia!==ia+0)throw ia;xl(1,0)}},r:function(Zr,Ln){var ia=Fs();try{pc(Zr)(Ln)}catch(Oa){if(Ol(ia),Oa!==Oa+0)throw Oa;xl(1,0)}},i:function(Zr,Ln,ia){var Oa=Fs();try{pc(Zr)(Ln,ia)}catch(Di){if(Ol(Oa),Di!==Di+0)throw Di;xl(1,0)}},ha:function(Zr,Ln,ia,Oa){var Di=Fs();try{pc(Zr)(Ln,ia,Oa)}catch(Xi){if(Ol(Di),Xi!==Xi+0)throw Xi;xl(1,0)}},m:function(Zr,Ln,ia,Oa){var Di=Fs();try{pc(Zr)(Ln,ia,Oa)}catch(Xi){if(Ol(Di),Xi!==Xi+0)throw Xi;xl(1,0)}},v:function(Zr,Ln,ia,Oa,Di){var Xi=Fs();try{pc(Zr)(Ln,ia,Oa,Di)}catch(ko){if(Ol(Xi),ko!==ko+0)throw ko;xl(1,0)}},u:function(Zr,Ln,ia,Oa,Di,Xi){var ko=Fs();try{pc(Zr)(Ln,ia,Oa,Di,Xi)}catch(Ho){if(Ol(ko),Ho!==Ho+0)throw Ho;xl(1,0)}},O:function(Zr,Ln,ia,Oa,Di,Xi,ko){var Ho=Fs();try{pc(Zr)(Ln,ia,Oa,Di,Xi,ko)}catch(Ps){if(Ol(Ho),Ps!==Ps+0)throw Ps;xl(1,0)}},A:function(Zr,Ln,ia,Oa,Di,Xi,ko,Ho){var Ps=Fs();try{pc(Zr)(Ln,ia,Oa,Di,Xi,ko,Ho)}catch(bu){if(Ol(Ps),bu!==bu+0)throw bu;xl(1,0)}},ka:function(Zr,Ln,ia,Oa,Di,Xi,ko,Ho,Ps){var bu=Fs();try{pc(Zr)(Ln,ia,Oa,Di,Xi,ko,Ho,Ps)}catch(rc){if(Ol(bu),rc!==rc+0)throw rc;xl(1,0)}},C:function(Zr,Ln,ia,Oa,Di,Xi,ko,Ho,Ps,bu,rc){var Vd=Fs();try{pc(Zr)(Ln,ia,Oa,Di,Xi,ko,Ho,Ps,bu,rc)}catch(Yd){if(Ol(Vd),Yd!==Yd+0)throw Yd;xl(1,0)}},D:function(Zr,Ln,ia,Oa,Di,Xi,ko,Ho,Ps,bu,rc,Vd,Yd,ri,Su,Sc){var qd=Fs();try{pc(Zr)(Ln,ia,Oa,Di,Xi,ko,Ho,Ps,bu,rc,Vd,Yd,ri,Su,Sc)}catch(Td){if(Ol(qd),Td!==Td+0)throw Td;xl(1,0)}},fa:function(Zr,Ln,ia,Oa,Di,Xi,ko,Ho){var Ps=Fs();try{tc(Zr,Ln,ia,Oa,Di,Xi,ko,Ho)}catch(bu){if(Ol(Ps),bu!==bu+0)throw bu;xl(1,0)}},da:function(Zr,Ln,ia,Oa,Di,Xi,ko,Ho,Ps,bu,rc,Vd){var Yd=Fs();try{ug(Zr,Ln,ia,Oa,Di,Xi,ko,Ho,Ps,bu,rc,Vd)}catch(ri){if(Ol(Yd),ri!==ri+0)throw ri;xl(1,0)}},ea:function(Zr,Ln,ia,Oa,Di,Xi){var ko=Fs();try{lg(Zr,Ln,ia,Oa,Di,Xi)}catch(Ho){if(Ol(ko),Ho!==Ho+0)throw Ho;xl(1,0)}},o:function(Zr){return Zr},a:ji||$.wasmMemory,G:function(Zr){wd=Zr},la:kn,z:function(Zr,Ln,ia,Oa){return kn(Zr,Ln,ia,Oa)}};(function(){function Zr(Di,Xi){$.asm=Di.exports,Jl.qc.push($.asm.sb),Of=$.asm.ub,_d.unshift($.asm.Va),Fo=Xi,Ir||(Cd--,$.monitorRunDependencies&&$.monitorRunDependencies(Cd),Cd==0&&sp&&(Di=sp,sp=null,Di()))}function Ln(Di){Zr(Di.instance,Di.module)}function ia(Di){return function(){if(!qn&&(jr||tn)){if(typeof fetch=="function"&&!Tf.startsWith("file://"))return fetch(Tf,{credentials:"same-origin"}).then(function(Xi){if(!Xi.ok)throw"failed to load wasm binary file at '"+Tf+"'";return Xi.arrayBuffer()}).catch(function(){return Mv()});if(He)return new Promise(function(Xi,ko){He(Tf,function(Ho){Xi(new Uint8Array(Ho))},ko)})}return Promise.resolve().then(function(){return Mv()})}().then(function(Xi){return WebAssembly.instantiate(Xi,Oa)}).then(function(Xi){return Xi}).then(Di,function(Xi){pa("failed to asynchronously prepare wasm: "+Xi),qu(Xi)})}var Oa={a:by};if(Ir||(Cd++,$.monitorRunDependencies&&$.monitorRunDependencies(Cd)),$.instantiateWasm)try{return $.instantiateWasm(Oa,Zr)}catch(Di){return pa("Module.instantiateWasm callback failed with error: "+Di),!1}(qn||typeof WebAssembly.instantiateStreaming!="function"||Sv()||Tf.startsWith("file://")||mr||typeof fetch!="function"?ia(Ln):fetch(Tf,{credentials:"same-origin"}).then(function(Di){return WebAssembly.instantiateStreaming(Di,Oa).then(Ln,function(Xi){return pa("wasm streaming compile failed: "+Xi),pa("falling back to ArrayBuffer instantiation"),ia(Ln)})})).catch(he)})(),$.___wasm_call_ctors=function(){return($.___wasm_call_ctors=$.asm.Va).apply(null,arguments)},$._OrtInit=function(){return($._OrtInit=$.asm.Wa).apply(null,arguments)},$._OrtCreateSessionOptions=function(){return($._OrtCreateSessionOptions=$.asm.Xa).apply(null,arguments)},$._OrtAppendExecutionProvider=function(){return($._OrtAppendExecutionProvider=$.asm.Ya).apply(null,arguments)},$._OrtAddSessionConfigEntry=function(){return($._OrtAddSessionConfigEntry=$.asm.Za).apply(null,arguments)},$._OrtReleaseSessionOptions=function(){return($._OrtReleaseSessionOptions=$.asm._a).apply(null,arguments)},$._OrtCreateSession=function(){return($._OrtCreateSession=$.asm.$a).apply(null,arguments)},$._OrtReleaseSession=function(){return($._OrtReleaseSession=$.asm.ab).apply(null,arguments)},$._OrtGetInputCount=function(){return($._OrtGetInputCount=$.asm.bb).apply(null,arguments)},$._OrtGetOutputCount=function(){return($._OrtGetOutputCount=$.asm.cb).apply(null,arguments)},$._OrtGetInputName=function(){return($._OrtGetInputName=$.asm.db).apply(null,arguments)},$._OrtGetOutputName=function(){return($._OrtGetOutputName=$.asm.eb).apply(null,arguments)},$._OrtFree=function(){return($._OrtFree=$.asm.fb).apply(null,arguments)},$._OrtCreateTensor=function(){return($._OrtCreateTensor=$.asm.gb).apply(null,arguments)},$._OrtGetTensorData=function(){return($._OrtGetTensorData=$.asm.hb).apply(null,arguments)},$._OrtReleaseTensor=function(){return($._OrtReleaseTensor=$.asm.ib).apply(null,arguments)},$._OrtCreateRunOptions=function(){return($._OrtCreateRunOptions=$.asm.jb).apply(null,arguments)},$._OrtAddRunConfigEntry=function(){return($._OrtAddRunConfigEntry=$.asm.kb).apply(null,arguments)},$._OrtReleaseRunOptions=function(){return($._OrtReleaseRunOptions=$.asm.lb).apply(null,arguments)},$._OrtRun=function(){return($._OrtRun=$.asm.mb).apply(null,arguments)},$._OrtEndProfiling=function(){return($._OrtEndProfiling=$.asm.nb).apply(null,arguments)};var y0=$._pthread_self=function(){return(y0=$._pthread_self=$.asm.ob).apply(null,arguments)},Op=$._malloc=function(){return(Op=$._malloc=$.asm.pb).apply(null,arguments)},Lv=$._free=function(){return(Lv=$._free=$.asm.qb).apply(null,arguments)},xy=$._fflush=function(){return(xy=$._fflush=$.asm.rb).apply(null,arguments)};$.__emscripten_tls_init=function(){return($.__emscripten_tls_init=$.asm.sb).apply(null,arguments)};var sg=$.___funcs_on_exit=function(){return(sg=$.___funcs_on_exit=$.asm.tb).apply(null,arguments)},Iv=$.__emscripten_thread_init=function(){return(Iv=$.__emscripten_thread_init=$.asm.vb).apply(null,arguments)};$.__emscripten_thread_crashed=function(){return($.__emscripten_thread_crashed=$.asm.wb).apply(null,arguments)};var ou,Sh=$._emscripten_run_in_main_runtime_thread_js=function(){return(Sh=$._emscripten_run_in_main_runtime_thread_js=$.asm.xb).apply(null,arguments)},cf=$.__emscripten_proxy_execute_task_queue=function(){return(cf=$.__emscripten_proxy_execute_task_queue=$.asm.yb).apply(null,arguments)},gp=$.__emscripten_thread_free_data=function(){return(gp=$.__emscripten_thread_free_data=$.asm.zb).apply(null,arguments)},rm=$.__emscripten_thread_exit=function(){return(rm=$.__emscripten_thread_exit=$.asm.Ab).apply(null,arguments)},xl=$._setThrew=function(){return(xl=$._setThrew=$.asm.Bb).apply(null,arguments)},wy=$._emscripten_stack_set_limits=function(){return(wy=$._emscripten_stack_set_limits=$.asm.Cb).apply(null,arguments)},Fs=$.stackSave=function(){return(Fs=$.stackSave=$.asm.Db).apply(null,arguments)},Ol=$.stackRestore=function(){return(Ol=$.stackRestore=$.asm.Eb).apply(null,arguments)},eh=$.stackAlloc=function(){return(eh=$.stackAlloc=$.asm.Fb).apply(null,arguments)},Au=$.___cxa_can_catch=function(){return(Au=$.___cxa_can_catch=$.asm.Gb).apply(null,arguments)},ed=$.___cxa_is_pointer_type=function(){return(ed=$.___cxa_is_pointer_type=$.asm.Hb).apply(null,arguments)},ff=$.dynCall_j=function(){return(ff=$.dynCall_j=$.asm.Ib).apply(null,arguments)},Ih=$.dynCall_iiiiij=function(){return(Ih=$.dynCall_iiiiij=$.asm.Jb).apply(null,arguments)},nm=$.dynCall_jii=function(){return(nm=$.dynCall_jii=$.asm.Kb).apply(null,arguments)},tc=$.dynCall_viiiiij=function(){return(tc=$.dynCall_viiiiij=$.asm.Lb).apply(null,arguments)},lg=$.dynCall_vjji=function(){return(lg=$.dynCall_vjji=$.asm.Mb).apply(null,arguments)},ug=$.dynCall_viiijjjii=function(){return(ug=$.dynCall_viiijjjii=$.asm.Nb).apply(null,arguments)},cg=$.dynCall_iij=function(){return(cg=$.dynCall_iij=$.asm.Ob).apply(null,arguments)},ov=$.dynCall_ji=function(){return(ov=$.dynCall_ji=$.asm.Pb).apply(null,arguments)},Dv=$.dynCall_iiiiiij=function(){return(Dv=$.dynCall_iiiiiij=$.asm.Qb).apply(null,arguments)},fg=$.dynCall_iiij=function(){return(fg=$.dynCall_iiij=$.asm.Rb).apply(null,arguments)};function Wh(){function Zr(){if(!ou&&(ou=!0,$.calledRun=!0,!es)&&(Ir||Ip(_d),F($),$.onRuntimeInitialized&&$.onRuntimeInitialized(),!Ir)){if($.postRun)for(typeof $.postRun=="function"&&($.postRun=[$.postRun]);$.postRun.length;){var Ln=$.postRun.shift();op.unshift(Ln)}Ip(op)}}if(!(0{var H,te=(H=(H=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(ve){var fe,Ee,Re;ve=ve||{},fe||(fe=ve!==void 0?ve:{}),fe.ready=new Promise(function(Vn,La){Ee=Vn,Re=La});var Ce,Me,$,F,he,we,He=Object.assign({},fe),ut="./this.program",tt=(Vn,La)=>{throw La},_e=typeof window=="object",Gt=typeof importScripts=="function",Qt=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",ir="";Qt?(ir=Gt?V(908).dirname(ir)+"/":"//",we=()=>{he||(F=V(1384),he=V(908))},Ce=function(Vn,La){return we(),Vn=he.normalize(Vn),F.readFileSync(Vn,La?void 0:"utf8")},$=Vn=>((Vn=Ce(Vn,!0)).buffer||(Vn=new Uint8Array(Vn)),Vn),Me=(Vn,La,si)=>{we(),Vn=he.normalize(Vn),F.readFile(Vn,function(Pi,Bi){Pi?si(Pi):La(Bi.buffer)})},1{if(mr||0{var La=new XMLHttpRequest;return La.open("GET",Vn,!1),La.send(null),La.responseText},Gt&&($=Vn=>{var La=new XMLHttpRequest;return La.open("GET",Vn,!1),La.responseType="arraybuffer",La.send(null),new Uint8Array(La.response)}),Me=(Vn,La,si)=>{var Pi=new XMLHttpRequest;Pi.open("GET",Vn,!0),Pi.responseType="arraybuffer",Pi.onload=()=>{Pi.status==200||Pi.status==0&&Pi.response?La(Pi.response):si()},Pi.onerror=si,Pi.send(null)});var Lr,jr=fe.print||console.log.bind(console),tn=fe.printErr||console.warn.bind(console);Object.assign(fe,He),He=null,fe.thisProgram&&(ut=fe.thisProgram),fe.quit&&(tt=fe.quit),fe.wasmBinary&&(Lr=fe.wasmBinary);var mr=fe.noExitRuntime||!1;typeof WebAssembly!="object"&&Hl("no native wasm support detected");var Ir,On,ba,ra,jn,qn,Un=!1,pa=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function lo(Vn,La,si){var Pi=(La>>>=0)+si;for(si=La;Vn[si]&&!(si>=Pi);)++si;if(16(Bi=(240&Bi)==224?(15&Bi)<<12|Qi<<6|bi:(7&Bi)<<18|Qi<<12|bi<<6|63&Vn[La++])?Pi+=String.fromCharCode(Bi):(Bi-=65536,Pi+=String.fromCharCode(55296|Bi>>10,56320|1023&Bi))}}else Pi+=String.fromCharCode(Bi)}return Pi}function ji(Vn,La){return(Vn>>>=0)?lo(ra,Vn,La):""}function Fo(Vn,La,si,Pi){if(!(0>>=0;Pi=si+Pi-1;for(var Qi=0;Qi=bi&&(bi=65536+((1023&bi)<<10)|1023&Vn.charCodeAt(++Qi)),127>=bi){if(si>=Pi)break;La[si++>>>0]=bi}else{if(2047>=bi){if(si+1>=Pi)break;La[si++>>>0]=192|bi>>6}else{if(65535>=bi){if(si+2>=Pi)break;La[si++>>>0]=224|bi>>12}else{if(si+3>=Pi)break;La[si++>>>0]=240|bi>>18,La[si++>>>0]=128|bi>>12&63}La[si++>>>0]=128|bi>>6&63}La[si++>>>0]=128|63&bi}}return La[si>>>0]=0,si-Bi}function Qo(Vn){for(var La=0,si=0;si=Pi?La++:2047>=Pi?La+=2:55296<=Pi&&57343>=Pi?(La+=4,++si):La+=3}return La}function Sl(){var Vn=Ir.buffer;On=Vn,fe.HEAP8=ba=new Int8Array(Vn),fe.HEAP16=new Int16Array(Vn),fe.HEAP32=jn=new Int32Array(Vn),fe.HEAPU8=ra=new Uint8Array(Vn),fe.HEAPU16=new Uint16Array(Vn),fe.HEAPU32=qn=new Uint32Array(Vn),fe.HEAPF32=new Float32Array(Vn),fe.HEAPF64=new Float64Array(Vn)}var Hs,Rl=[],bs=[],po=[],es=[],ef=0;function wf(){var Vn=fe.preRun.shift();Rl.unshift(Vn)}var Qu,Zs=0,jc=null;function Hl(Vn){throw fe.onAbort&&fe.onAbort(Vn),tn(Vn="Aborted("+Vn+")"),Un=!0,Vn=new WebAssembly.RuntimeError(Vn+". Build with -sASSERTIONS for more info."),Re(Vn),Vn}function so(){return Qu.startsWith("data:application/octet-stream;base64,")}if(Qu="ort-wasm.wasm",!so()){var Of=Qu;Qu=fe.locateFile?fe.locateFile(Of,ir):ir+Of}function ch(){var Vn=Qu;try{if(Vn==Qu&&Lr)return new Uint8Array(Lr);if($)return $(Vn);throw"both async and sync fetching of the wasm failed"}catch(La){Hl(La)}}function _d(Vn){this.name="ExitStatus",this.message="Program terminated with exit("+Vn+")",this.status=Vn}function bd(Vn){for(;0>2>>>0]=La},this.Eb=function(){return qn[this.zb+4>>2>>>0]},this.Sb=function(La){qn[this.zb+8>>2>>>0]=La},this.Wb=function(){return qn[this.zb+8>>2>>>0]},this.Tb=function(){jn[this.zb>>2>>>0]=0},this.Ib=function(La){ba[this.zb+12>>0>>>0]=La?1:0},this.Pb=function(){return ba[this.zb+12>>0>>>0]!=0},this.Jb=function(La){ba[this.zb+13>>0>>>0]=La?1:0},this.Lb=function(){return ba[this.zb+13>>0>>>0]!=0},this.Rb=function(La,si){this.Fb(0),this.Ub(La),this.Sb(si),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){jn[this.zb>>2>>>0]+=1},this.Xb=function(){var La=jn[this.zb>>2>>>0];return jn[this.zb>>2>>>0]=La-1,La===1},this.Fb=function(La){qn[this.zb+16>>2>>>0]=La},this.Ob=function(){return qn[this.zb+16>>2>>>0]},this.Qb=function(){if(p0(this.Eb()))return qn[this.Db>>2>>>0];var La=this.Ob();return La!==0?La:this.Db}}function Cd(Vn){return rv(new Tf(Vn).zb)}var sp=[];function qu(Vn){var La=sp[Vn];return La||(Vn>=sp.length&&(sp.length=Vn+1),sp[Vn]=La=Hs.get(Vn)),La}function Sv(Vn){var La=Qo(Vn)+1,si=pc(La);return si&&Fo(Vn,ba,si,La),si}var Mv={};function J0(){if(!pp){var Vn,La={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ut||"./this.program"};for(Vn in Mv)Mv[Vn]===void 0?delete La[Vn]:La[Vn]=Mv[Vn];var si=[];for(Vn in La)si.push(Vn+"="+La[Vn]);pp=si}return pp}var pp,Ev=[null,[],[]];function kv(Vn,La){var si=Ev[Vn];La===0||La===10?((Vn===1?jr:tn)(lo(si,0)),si.length=0):si.push(La)}var Qh=0;function tv(Vn){return Vn%4==0&&(Vn%100!=0||Vn%400==0)}var Jl=[31,29,31,30,31,30,31,31,30,31,30,31],Ip=[31,28,31,30,31,30,31,31,30,31,30,31];function Q0(Vn,La,si,Pi){function Bi(Ki,Yu,tf){for(Ki=typeof Ki=="number"?Ki.toString():Ki||"";Ki.lengthmp?-1:0Wd-Ki.getDate())){Ki.setDate(Ki.getDate()+Yu);break}Yu-=Wd-Ki.getDate()+1,Ki.setDate(1),11>tf?Ki.setMonth(tf+1):(Ki.setMonth(0),Ki.setFullYear(Ki.getFullYear()+1))}return tf=new Date(Ki.getFullYear()+1,0,4),Yu=pl(new Date(Ki.getFullYear(),0,4)),tf=pl(tf),0>=bi(Yu,Ki)?0>=bi(tf,Ki)?Ki.getFullYear()+1:Ki.getFullYear():Ki.getFullYear()-1}var vu=jn[Pi+40>>2>>>0];for(var ec in Pi={$b:jn[Pi>>2>>>0],Zb:jn[Pi+4>>2>>>0],Gb:jn[Pi+8>>2>>>0],Kb:jn[Pi+12>>2>>>0],Hb:jn[Pi+16>>2>>>0],Cb:jn[Pi+20>>2>>>0],Ab:jn[Pi+24>>2>>>0],Bb:jn[Pi+28>>2>>>0],bc:jn[Pi+32>>2>>>0],Yb:jn[Pi+36>>2>>>0],ac:vu?ji(vu):""},si=ji(si),vu={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})si=si.replace(new RegExp(ec,"g"),vu[ec]);var $h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Lh="January February March April May June July August September October November December".split(" ");for(ec in vu={"%a":function(Ki){return $h[Ki.Ab].substring(0,3)},"%A":function(Ki){return $h[Ki.Ab]},"%b":function(Ki){return Lh[Ki.Hb].substring(0,3)},"%B":function(Ki){return Lh[Ki.Hb]},"%C":function(Ki){return Qi((Ki.Cb+1900)/100|0,2)},"%d":function(Ki){return Qi(Ki.Kb,2)},"%e":function(Ki){return Bi(Ki.Kb,2," ")},"%g":function(Ki){return Ss(Ki).toString().substring(2)},"%G":function(Ki){return Ss(Ki)},"%H":function(Ki){return Qi(Ki.Gb,2)},"%I":function(Ki){return(Ki=Ki.Gb)==0?Ki=12:12Ki.Gb?"AM":"PM"},"%S":function(Ki){return Qi(Ki.$b,2)},"%t":function(){return" "},"%u":function(Ki){return Ki.Ab||7},"%U":function(Ki){return Qi(Math.floor((Ki.Bb+7-Ki.Ab)/7),2)},"%V":function(Ki){var Yu=Math.floor((Ki.Bb+7-(Ki.Ab+6)%7)/7);if(2>=(Ki.Ab+371-Ki.Bb-2)%7&&Yu++,Yu)Yu==53&&((tf=(Ki.Ab+371-Ki.Bb)%7)==4||tf==3&&tv(Ki.Cb)||(Yu=1));else{Yu=52;var tf=(Ki.Ab+7-Ki.Bb-1)%7;(tf==4||tf==5&&tv(Ki.Cb%400-1))&&Yu++}return Qi(Yu,2)},"%w":function(Ki){return Ki.Ab},"%W":function(Ki){return Qi(Math.floor((Ki.Bb+7-(Ki.Ab+6)%7)/7),2)},"%y":function(Ki){return(Ki.Cb+1900).toString().substring(2)},"%Y":function(Ki){return Ki.Cb+1900},"%z":function(Ki){var Yu=0<=(Ki=Ki.Yb);return Ki=Math.abs(Ki)/60,(Yu?"+":"-")+("0000"+(Ki/60*100+Ki%60)).slice(-4)},"%Z":function(Ki){return Ki.ac},"%%":function(){return"%"}},si=si.replace(/%%/g,"\0\0"),vu)si.includes(ec)&&(si=si.replace(new RegExp(ec,"g"),vu[ec](Pi)));return ec=function(Ki){var Yu=Array(Qo(Ki)+1);return Fo(Ki,Yu,0,Yu.length),Yu}(si=si.replace(/\0\0/g,"%")),ec.length>La?0:(ba.set(ec,Vn>>>0),ec.length-1)}var em={a:function(Vn){return pc(Vn+24)+24},m:function(Vn){return(Vn=new Tf(Vn)).Pb()||(Vn.Ib(!0),Hh--),Vn.Jb(!1),op.push(Vn),Vn.Nb(),Vn.Qb()},ia:function(Vn){throw tn("Unexpected exception thrown, this is not properly supported - aborting"),Un=!0,Vn},w:function(){hu(0);var Vn=op.pop();if(Vn.Xb()&&!Vn.Lb()){var La=Vn.Wb();La&&qu(La)(Vn.Db),Cd(Vn.Db)}xd=0},d:function(){var Vn=xd;if(!Vn)return Qh=0;var La=new Tf(Vn);La.Fb(Vn);var si=La.Eb();if(!si)return Qh=0,Vn;for(var Pi=Array.prototype.slice.call(arguments),Bi=0;Bi>>2]+4294967296*jn[Vn+4>>>2])),jn[La>>2>>>0]=Vn.getUTCSeconds(),jn[La+4>>2>>>0]=Vn.getUTCMinutes(),jn[La+8>>2>>>0]=Vn.getUTCHours(),jn[La+12>>2>>>0]=Vn.getUTCDate(),jn[La+16>>2>>>0]=Vn.getUTCMonth(),jn[La+20>>2>>>0]=Vn.getUTCFullYear()-1900,jn[La+24>>2>>>0]=Vn.getUTCDay(),jn[La+28>>2>>>0]=(Vn.getTime()-Date.UTC(Vn.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(Vn,La){Vn=new Date(1e3*(qn[Vn>>>2]+4294967296*jn[Vn+4>>>2])),jn[La>>2>>>0]=Vn.getSeconds(),jn[La+4>>2>>>0]=Vn.getMinutes(),jn[La+8>>2>>>0]=Vn.getHours(),jn[La+12>>2>>>0]=Vn.getDate(),jn[La+16>>2>>>0]=Vn.getMonth(),jn[La+20>>2>>>0]=Vn.getFullYear()-1900,jn[La+24>>2>>>0]=Vn.getDay();var si=new Date(Vn.getFullYear(),0,1);jn[La+28>>2>>>0]=(Vn.getTime()-si.getTime())/864e5|0,jn[La+36>>2>>>0]=-60*Vn.getTimezoneOffset();var Pi=new Date(Vn.getFullYear(),6,1).getTimezoneOffset();si=si.getTimezoneOffset(),jn[La+32>>2>>>0]=0|(Pi!=si&&Vn.getTimezoneOffset()==Math.min(si,Pi))},Fa:function(Vn){var La=new Date(jn[Vn+20>>2>>>0]+1900,jn[Vn+16>>2>>>0],jn[Vn+12>>2>>>0],jn[Vn+8>>2>>>0],jn[Vn+4>>2>>>0],jn[Vn>>2>>>0],0),si=jn[Vn+32>>2>>>0],Pi=La.getTimezoneOffset(),Bi=new Date(La.getFullYear(),0,1),Qi=new Date(La.getFullYear(),6,1).getTimezoneOffset(),bi=Bi.getTimezoneOffset(),pl=Math.min(bi,Qi);return 0>si?jn[Vn+32>>2>>>0]=+(Qi!=bi&&pl==Pi):0>2>>>0]=La.getDay(),jn[Vn+28>>2>>>0]=(La.getTime()-Bi.getTime())/864e5|0,jn[Vn>>2>>>0]=La.getSeconds(),jn[Vn+4>>2>>>0]=La.getMinutes(),jn[Vn+8>>2>>>0]=La.getHours(),jn[Vn+12>>2>>>0]=La.getDate(),jn[Vn+16>>2>>>0]=La.getMonth(),La.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function Vn(La,si,Pi){Vn.Vb||(Vn.Vb=!0,function(Bi,Qi,bi){function pl(Lh){return(Lh=Lh.toTimeString().match(/\(([A-Za-z ]+)\)$/))?Lh[1]:"GMT"}var Ss=new Date().getFullYear(),vu=new Date(Ss,0,1),ec=new Date(Ss,6,1);Ss=vu.getTimezoneOffset();var $h=ec.getTimezoneOffset();jn[Bi>>2>>>0]=60*Math.max(Ss,$h),jn[Qi>>2>>>0]=+(Ss!=$h),Bi=pl(vu),Qi=pl(ec),Bi=Sv(Bi),Qi=Sv(Qi),$h>2>>>0]=Bi,qn[bi+4>>2>>>0]=Qi):(qn[bi>>2>>>0]=Qi,qn[bi+4>>2>>>0]=Bi)}(La,si,Pi))},B:function(){Hl("")},ma:function(){return 4294901760},I:Qt?()=>{var Vn=process.hrtime();return 1e3*Vn[0]+Vn[1]/1e6}:()=>performance.now(),xa:function(Vn,La,si){ra.copyWithin(Vn>>>0,La>>>0,La+si>>>0)},G:function(Vn){var La=ra.length;if(4294901760<(Vn>>>=0))return!1;for(var si=1;4>=si;si*=2){var Pi=La*(1+.2/si);Pi=Math.min(Pi,Vn+100663296);var Bi=Math;Pi=Math.max(Vn,Pi),Bi=Bi.min.call(Bi,4294901760,Pi+(65536-Pi%65536)%65536);e:{try{Ir.grow(Bi-On.byteLength+65535>>>16),Sl();var Qi=1;break e}catch{}Qi=void 0}if(Qi)return!0}return!1},va:function(Vn,La){var si=0;return J0().forEach(function(Pi,Bi){var Qi=La+si;for(Bi=qn[Vn+4*Bi>>2>>>0]=Qi,Qi=0;Qi>0>>>0]=Pi.charCodeAt(Qi);ba[Bi>>0>>>0]=0,si+=Pi.length+1}),0},wa:function(Vn,La){var si=J0();qn[Vn>>2>>>0]=si.length;var Pi=0;return si.forEach(function(Bi){Pi+=Bi.length+1}),qn[La>>2>>>0]=Pi,0},ba:function(Vn){mr||0>2>>>0],pl=qn[La+4>>2>>>0];La+=8;for(var Ss=0;Ss>>0]);Bi+=pl}return qn[Pi>>2>>>0]=Bi,0},c:function(){return Qh},ja:function Vn(La,si){Vn.Mb||(Vn.Mb=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var Bi=new Uint8Array(1);return()=>(crypto.getRandomValues(Bi),Bi[0])}if(Qt)try{var Qi=V(Object(function(){var bi=new Error("Cannot find module 'crypto'");throw bi.code="MODULE_NOT_FOUND",bi}()));return()=>Qi.randomBytes(1)[0]}catch{}return()=>Hl("randomDevice")}());for(var Pi=0;Pi>0>>>0]=Vn.Mb();return 0},ea:function(Vn,La,si){var Pi=Ql();try{return qu(Vn)(La,si)}catch(Bi){if(iu(Pi),Bi!==Bi+0)throw Bi;hu(1,0)}},fa:function(Vn,La,si){var Pi=Ql();try{return qu(Vn)(La,si)}catch(Bi){if(iu(Pi),Bi!==Bi+0)throw Bi;hu(1,0)}},J:function(Vn){var La=Ql();try{return qu(Vn)()}catch(si){if(iu(La),si!==si+0)throw si;hu(1,0)}},e:function(Vn,La){var si=Ql();try{return qu(Vn)(La)}catch(Pi){if(iu(si),Pi!==Pi+0)throw Pi;hu(1,0)}},N:function(Vn,La,si){var Pi=Ql();try{return qu(Vn)(La,si)}catch(Bi){if(iu(Pi),Bi!==Bi+0)throw Bi;hu(1,0)}},O:function(Vn,La,si){var Pi=Ql();try{return qu(Vn)(La,si)}catch(Bi){if(iu(Pi),Bi!==Bi+0)throw Bi;hu(1,0)}},j:function(Vn,La,si){var Pi=Ql();try{return qu(Vn)(La,si)}catch(Bi){if(iu(Pi),Bi!==Bi+0)throw Bi;hu(1,0)}},o:function(Vn,La,si,Pi){var Bi=Ql();try{return qu(Vn)(La,si,Pi)}catch(Qi){if(iu(Bi),Qi!==Qi+0)throw Qi;hu(1,0)}},p:function(Vn,La,si,Pi,Bi){var Qi=Ql();try{return qu(Vn)(La,si,Pi,Bi)}catch(bi){if(iu(Qi),bi!==bi+0)throw bi;hu(1,0)}},M:function(Vn,La,si,Pi,Bi,Qi){var bi=Ql();try{return qu(Vn)(La,si,Pi,Bi,Qi)}catch(pl){if(iu(bi),pl!==pl+0)throw pl;hu(1,0)}},r:function(Vn,La,si,Pi,Bi,Qi){var bi=Ql();try{return qu(Vn)(La,si,Pi,Bi,Qi)}catch(pl){if(iu(bi),pl!==pl+0)throw pl;hu(1,0)}},v:function(Vn,La,si,Pi,Bi,Qi,bi){var pl=Ql();try{return qu(Vn)(La,si,Pi,Bi,Qi,bi)}catch(Ss){if(iu(pl),Ss!==Ss+0)throw Ss;hu(1,0)}},K:function(Vn,La,si,Pi,Bi,Qi,bi,pl){var Ss=Ql();try{return qu(Vn)(La,si,Pi,Bi,Qi,bi,pl)}catch(vu){if(iu(Ss),vu!==vu+0)throw vu;hu(1,0)}},D:function(Vn,La,si,Pi,Bi,Qi,bi,pl,Ss,vu,ec,$h){var Lh=Ql();try{return qu(Vn)(La,si,Pi,Bi,Qi,bi,pl,Ss,vu,ec,$h)}catch(Ki){if(iu(Lh),Ki!==Ki+0)throw Ki;hu(1,0)}},X:function(Vn,La,si,Pi,Bi,Qi,bi,pl){var Ss=Ql();try{return Qf(Vn,La,si,Pi,Bi,Qi,bi,pl)}catch(vu){if(iu(Ss),vu!==vu+0)throw vu;hu(1,0)}},V:function(Vn,La,si,Pi,Bi,Qi,bi){var pl=Ql();try{return m0(Vn,La,si,Pi,Bi,Qi,bi)}catch(Ss){if(iu(pl),Ss!==Ss+0)throw Ss;hu(1,0)}},U:function(Vn,La,si,Pi,Bi){var Qi=Ql();try{return Pv(Vn,La,si,Pi,Bi)}catch(bi){if(iu(Qi),bi!==bi+0)throw bi;hu(1,0)}},Z:function(Vn,La,si,Pi){var Bi=Ql();try{return Rp(Vn,La,si,Pi)}catch(Qi){if(iu(Bi),Qi!==Qi+0)throw Qi;hu(1,0)}},W:function(Vn){var La=Ql();try{return v0(Vn)}catch(si){if(iu(La),si!==si+0)throw si;hu(1,0)}},Y:function(Vn,La){var si=Ql();try{return nc(Vn,La)}catch(Pi){if(iu(si),Pi!==Pi+0)throw Pi;hu(1,0)}},T:function(Vn,La,si){var Pi=Ql();try{return g0(Vn,La,si)}catch(Bi){if(iu(Pi),Bi!==Bi+0)throw Bi;hu(1,0)}},f:function(Vn){var La=Ql();try{qu(Vn)()}catch(si){if(iu(La),si!==si+0)throw si;hu(1,0)}},q:function(Vn,La){var si=Ql();try{qu(Vn)(La)}catch(Pi){if(iu(si),Pi!==Pi+0)throw Pi;hu(1,0)}},h:function(Vn,La,si){var Pi=Ql();try{qu(Vn)(La,si)}catch(Bi){if(iu(Pi),Bi!==Bi+0)throw Bi;hu(1,0)}},da:function(Vn,La,si,Pi){var Bi=Ql();try{qu(Vn)(La,si,Pi)}catch(Qi){if(iu(Bi),Qi!==Qi+0)throw Qi;hu(1,0)}},l:function(Vn,La,si,Pi){var Bi=Ql();try{qu(Vn)(La,si,Pi)}catch(Qi){if(iu(Bi),Qi!==Qi+0)throw Qi;hu(1,0)}},t:function(Vn,La,si,Pi,Bi){var Qi=Ql();try{qu(Vn)(La,si,Pi,Bi)}catch(bi){if(iu(Qi),bi!==bi+0)throw bi;hu(1,0)}},u:function(Vn,La,si,Pi,Bi,Qi){var bi=Ql();try{qu(Vn)(La,si,Pi,Bi,Qi)}catch(pl){if(iu(bi),pl!==pl+0)throw pl;hu(1,0)}},x:function(Vn,La,si,Pi,Bi,Qi,bi){var pl=Ql();try{qu(Vn)(La,si,Pi,Bi,Qi,bi)}catch(Ss){if(iu(pl),Ss!==Ss+0)throw Ss;hu(1,0)}},z:function(Vn,La,si,Pi,Bi,Qi,bi,pl){var Ss=Ql();try{qu(Vn)(La,si,Pi,Bi,Qi,bi,pl)}catch(vu){if(iu(Ss),vu!==vu+0)throw vu;hu(1,0)}},ga:function(Vn,La,si,Pi,Bi,Qi,bi,pl,Ss){var vu=Ql();try{qu(Vn)(La,si,Pi,Bi,Qi,bi,pl,Ss)}catch(ec){if(iu(vu),ec!==ec+0)throw ec;hu(1,0)}},A:function(Vn,La,si,Pi,Bi,Qi,bi,pl,Ss,vu,ec){var $h=Ql();try{qu(Vn)(La,si,Pi,Bi,Qi,bi,pl,Ss,vu,ec)}catch(Lh){if(iu($h),Lh!==Lh+0)throw Lh;hu(1,0)}},C:function(Vn,La,si,Pi,Bi,Qi,bi,pl,Ss,vu,ec,$h,Lh,Ki,Yu,tf){var Wd=Ql();try{qu(Vn)(La,si,Pi,Bi,Qi,bi,pl,Ss,vu,ec,$h,Lh,Ki,Yu,tf)}catch(mp){if(iu(Wd),mp!==mp+0)throw mp;hu(1,0)}},aa:function(Vn,La,si,Pi,Bi,Qi,bi,pl){var Ss=Ql();try{Cv(Vn,La,si,Pi,Bi,Qi,bi,pl)}catch(vu){if(iu(Ss),vu!==vu+0)throw vu;hu(1,0)}},_:function(Vn,La,si,Pi,Bi,Qi,bi,pl,Ss,vu,ec,$h){var Lh=Ql();try{Dp(Vn,La,si,Pi,Bi,Qi,bi,pl,Ss,vu,ec,$h)}catch(Ki){if(iu(Lh),Ki!==Ki+0)throw Ki;hu(1,0)}},$:function(Vn,La,si,Pi,Bi,Qi){var bi=Ql();try{iv(Vn,La,si,Pi,Bi,Qi)}catch(pl){if(iu(bi),pl!==pl+0)throw pl;hu(1,0)}},n:function(Vn){return Vn},F:function(Vn){Qh=Vn},ha:Q0,y:function(Vn,La,si,Pi){return Q0(Vn,La,si,Pi)}};(function(){function Vn(Bi){fe.asm=Bi.exports,Ir=fe.asm.Ka,Sl(),Hs=fe.asm.ib,bs.unshift(fe.asm.La),Zs--,fe.monitorRunDependencies&&fe.monitorRunDependencies(Zs),Zs==0&&jc&&(Bi=jc,jc=null,Bi())}function La(Bi){Vn(Bi.instance)}function si(Bi){return function(){if(!Lr&&(_e||Gt)){if(typeof fetch=="function"&&!Qu.startsWith("file://"))return fetch(Qu,{credentials:"same-origin"}).then(function(Qi){if(!Qi.ok)throw"failed to load wasm binary file at '"+Qu+"'";return Qi.arrayBuffer()}).catch(function(){return ch()});if(Me)return new Promise(function(Qi,bi){Me(Qu,function(pl){Qi(new Uint8Array(pl))},bi)})}return Promise.resolve().then(function(){return ch()})}().then(function(Qi){return WebAssembly.instantiate(Qi,Pi)}).then(function(Qi){return Qi}).then(Bi,function(Qi){tn("failed to asynchronously prepare wasm: "+Qi),Hl(Qi)})}var Pi={a:em};if(Zs++,fe.monitorRunDependencies&&fe.monitorRunDependencies(Zs),fe.instantiateWasm)try{return fe.instantiateWasm(Pi,Vn)}catch(Bi){return tn("Module.instantiateWasm callback failed with error: "+Bi),!1}(Lr||typeof WebAssembly.instantiateStreaming!="function"||so()||Qu.startsWith("file://")||Qt||typeof fetch!="function"?si(La):fetch(Qu,{credentials:"same-origin"}).then(function(Bi){return WebAssembly.instantiateStreaming(Bi,Pi).then(La,function(Qi){return tn("wasm streaming compile failed: "+Qi),tn("falling back to ArrayBuffer instantiation"),si(La)})})).catch(Re)})(),fe.___wasm_call_ctors=function(){return(fe.___wasm_call_ctors=fe.asm.La).apply(null,arguments)},fe._OrtInit=function(){return(fe._OrtInit=fe.asm.Ma).apply(null,arguments)},fe._OrtCreateSessionOptions=function(){return(fe._OrtCreateSessionOptions=fe.asm.Na).apply(null,arguments)},fe._OrtAppendExecutionProvider=function(){return(fe._OrtAppendExecutionProvider=fe.asm.Oa).apply(null,arguments)},fe._OrtAddSessionConfigEntry=function(){return(fe._OrtAddSessionConfigEntry=fe.asm.Pa).apply(null,arguments)},fe._OrtReleaseSessionOptions=function(){return(fe._OrtReleaseSessionOptions=fe.asm.Qa).apply(null,arguments)},fe._OrtCreateSession=function(){return(fe._OrtCreateSession=fe.asm.Ra).apply(null,arguments)},fe._OrtReleaseSession=function(){return(fe._OrtReleaseSession=fe.asm.Sa).apply(null,arguments)},fe._OrtGetInputCount=function(){return(fe._OrtGetInputCount=fe.asm.Ta).apply(null,arguments)},fe._OrtGetOutputCount=function(){return(fe._OrtGetOutputCount=fe.asm.Ua).apply(null,arguments)},fe._OrtGetInputName=function(){return(fe._OrtGetInputName=fe.asm.Va).apply(null,arguments)},fe._OrtGetOutputName=function(){return(fe._OrtGetOutputName=fe.asm.Wa).apply(null,arguments)},fe._OrtFree=function(){return(fe._OrtFree=fe.asm.Xa).apply(null,arguments)},fe._OrtCreateTensor=function(){return(fe._OrtCreateTensor=fe.asm.Ya).apply(null,arguments)},fe._OrtGetTensorData=function(){return(fe._OrtGetTensorData=fe.asm.Za).apply(null,arguments)},fe._OrtReleaseTensor=function(){return(fe._OrtReleaseTensor=fe.asm._a).apply(null,arguments)},fe._OrtCreateRunOptions=function(){return(fe._OrtCreateRunOptions=fe.asm.$a).apply(null,arguments)},fe._OrtAddRunConfigEntry=function(){return(fe._OrtAddRunConfigEntry=fe.asm.ab).apply(null,arguments)},fe._OrtReleaseRunOptions=function(){return(fe._OrtReleaseRunOptions=fe.asm.bb).apply(null,arguments)},fe._OrtRun=function(){return(fe._OrtRun=fe.asm.cb).apply(null,arguments)},fe._OrtEndProfiling=function(){return(fe._OrtEndProfiling=fe.asm.db).apply(null,arguments)};var vp,pc=fe._malloc=function(){return(pc=fe._malloc=fe.asm.eb).apply(null,arguments)},rv=fe._free=function(){return(rv=fe._free=fe.asm.fb).apply(null,arguments)},h0=fe._fflush=function(){return(h0=fe._fflush=fe.asm.gb).apply(null,arguments)},nv=fe.___funcs_on_exit=function(){return(nv=fe.___funcs_on_exit=fe.asm.hb).apply(null,arguments)},hu=fe._setThrew=function(){return(hu=fe._setThrew=fe.asm.jb).apply(null,arguments)},Ql=fe.stackSave=function(){return(Ql=fe.stackSave=fe.asm.kb).apply(null,arguments)},iu=fe.stackRestore=function(){return(iu=fe.stackRestore=fe.asm.lb).apply(null,arguments)},d0=fe.stackAlloc=function(){return(d0=fe.stackAlloc=fe.asm.mb).apply(null,arguments)},av=fe.___cxa_can_catch=function(){return(av=fe.___cxa_can_catch=fe.asm.nb).apply(null,arguments)},p0=fe.___cxa_is_pointer_type=function(){return(p0=fe.___cxa_is_pointer_type=fe.asm.ob).apply(null,arguments)},v0=fe.dynCall_j=function(){return(v0=fe.dynCall_j=fe.asm.pb).apply(null,arguments)},m0=fe.dynCall_iiiiij=function(){return(m0=fe.dynCall_iiiiij=fe.asm.qb).apply(null,arguments)},g0=fe.dynCall_jii=function(){return(g0=fe.dynCall_jii=fe.asm.rb).apply(null,arguments)},Cv=fe.dynCall_viiiiij=function(){return(Cv=fe.dynCall_viiiiij=fe.asm.sb).apply(null,arguments)},iv=fe.dynCall_vjji=function(){return(iv=fe.dynCall_vjji=fe.asm.tb).apply(null,arguments)},Dp=fe.dynCall_viiijjjii=function(){return(Dp=fe.dynCall_viiijjjii=fe.asm.ub).apply(null,arguments)},Rp=fe.dynCall_iij=function(){return(Rp=fe.dynCall_iij=fe.asm.vb).apply(null,arguments)},nc=fe.dynCall_ji=function(){return(nc=fe.dynCall_ji=fe.asm.wb).apply(null,arguments)},Qf=fe.dynCall_iiiiiij=function(){return(Qf=fe.dynCall_iiiiiij=fe.asm.xb).apply(null,arguments)},Pv=fe.dynCall_iiij=function(){return(Pv=fe.dynCall_iiij=fe.asm.yb).apply(null,arguments)};function fu(){function Vn(){if(!vp&&(vp=!0,fe.calledRun=!0,!Un)){if(bd(bs),Ee(fe),fe.onRuntimeInitialized&&fe.onRuntimeInitialized(),fe.postRun)for(typeof fe.postRun=="function"&&(fe.postRun=[fe.postRun]);fe.postRun.length;){var La=fe.postRun.shift();es.unshift(La)}bd(es)}}if(!(0{be.exports=function(M,V){for(var H=new Array(arguments.length-1),te=0,ve=2,fe=!0;ve{var V=M;V.length=function(Ee){var Re=Ee.length;if(!Re)return 0;for(var Ce=0;--Re%4>1&&Ee.charAt(Re)==="=";)++Ce;return Math.ceil(3*Ee.length)/4-Ce};for(var H=new Array(64),te=new Array(123),ve=0;ve<64;)te[H[ve]=ve<26?ve+65:ve<52?ve+71:ve<62?ve-4:ve-59|43]=ve++;V.encode=function(Ee,Re,Ce){for(var Me,$=null,F=[],he=0,we=0;Re>2],Me=(3&He)<<4,we=1;break;case 1:F[he++]=H[Me|He>>4],Me=(15&He)<<2,we=2;break;case 2:F[he++]=H[Me|He>>6],F[he++]=H[63&He],we=0}he>8191&&(($||($=[])).push(String.fromCharCode.apply(String,F)),he=0)}return we&&(F[he++]=H[Me],F[he++]=61,we===1&&(F[he++]=61)),$?(he&&$.push(String.fromCharCode.apply(String,F.slice(0,he))),$.join("")):String.fromCharCode.apply(String,F.slice(0,he))};var fe="invalid encoding";V.decode=function(Ee,Re,Ce){for(var Me,$=Ce,F=0,he=0;he1)break;if((we=te[we])===void 0)throw Error(fe);switch(F){case 0:Me=we,F=1;break;case 1:Re[Ce++]=Me<<2|(48&we)>>4,Me=we,F=2;break;case 2:Re[Ce++]=(15&Me)<<4|(60&we)>>2,Me=we,F=3;break;case 3:Re[Ce++]=(3&Me)<<6|we,F=0}}if(F===1)throw Error(fe);return Ce-$},V.test=function(Ee){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(Ee)}},9211:be=>{function M(){this._listeners={}}be.exports=M,M.prototype.on=function(V,H,te){return(this._listeners[V]||(this._listeners[V]=[])).push({fn:H,ctx:te||this}),this},M.prototype.off=function(V,H){if(V===void 0)this._listeners={};else if(H===void 0)this._listeners[V]=[];else for(var te=this._listeners[V],ve=0;ve{function M(fe){return typeof Float32Array<"u"?function(){var Ee=new Float32Array([-0]),Re=new Uint8Array(Ee.buffer),Ce=Re[3]===128;function Me(we,He,ut){Ee[0]=we,He[ut]=Re[0],He[ut+1]=Re[1],He[ut+2]=Re[2],He[ut+3]=Re[3]}function $(we,He,ut){Ee[0]=we,He[ut]=Re[3],He[ut+1]=Re[2],He[ut+2]=Re[1],He[ut+3]=Re[0]}function F(we,He){return Re[0]=we[He],Re[1]=we[He+1],Re[2]=we[He+2],Re[3]=we[He+3],Ee[0]}function he(we,He){return Re[3]=we[He],Re[2]=we[He+1],Re[1]=we[He+2],Re[0]=we[He+3],Ee[0]}fe.writeFloatLE=Ce?Me:$,fe.writeFloatBE=Ce?$:Me,fe.readFloatLE=Ce?F:he,fe.readFloatBE=Ce?he:F}():function(){function Ee(Ce,Me,$,F){var he=Me<0?1:0;if(he&&(Me=-Me),Me===0)Ce(1/Me>0?0:2147483648,$,F);else if(isNaN(Me))Ce(2143289344,$,F);else if(Me>34028234663852886e22)Ce((he<<31|2139095040)>>>0,$,F);else if(Me<11754943508222875e-54)Ce((he<<31|Math.round(Me/1401298464324817e-60))>>>0,$,F);else{var we=Math.floor(Math.log(Me)/Math.LN2);Ce((he<<31|we+127<<23|8388607&Math.round(Me*Math.pow(2,-we)*8388608))>>>0,$,F)}}function Re(Ce,Me,$){var F=Ce(Me,$),he=2*(F>>31)+1,we=F>>>23&255,He=8388607&F;return we===255?He?NaN:he*(1/0):we===0?1401298464324817e-60*he*He:he*Math.pow(2,we-150)*(He+8388608)}fe.writeFloatLE=Ee.bind(null,V),fe.writeFloatBE=Ee.bind(null,H),fe.readFloatLE=Re.bind(null,te),fe.readFloatBE=Re.bind(null,ve)}(),typeof Float64Array<"u"?function(){var Ee=new Float64Array([-0]),Re=new Uint8Array(Ee.buffer),Ce=Re[7]===128;function Me(we,He,ut){Ee[0]=we,He[ut]=Re[0],He[ut+1]=Re[1],He[ut+2]=Re[2],He[ut+3]=Re[3],He[ut+4]=Re[4],He[ut+5]=Re[5],He[ut+6]=Re[6],He[ut+7]=Re[7]}function $(we,He,ut){Ee[0]=we,He[ut]=Re[7],He[ut+1]=Re[6],He[ut+2]=Re[5],He[ut+3]=Re[4],He[ut+4]=Re[3],He[ut+5]=Re[2],He[ut+6]=Re[1],He[ut+7]=Re[0]}function F(we,He){return Re[0]=we[He],Re[1]=we[He+1],Re[2]=we[He+2],Re[3]=we[He+3],Re[4]=we[He+4],Re[5]=we[He+5],Re[6]=we[He+6],Re[7]=we[He+7],Ee[0]}function he(we,He){return Re[7]=we[He],Re[6]=we[He+1],Re[5]=we[He+2],Re[4]=we[He+3],Re[3]=we[He+4],Re[2]=we[He+5],Re[1]=we[He+6],Re[0]=we[He+7],Ee[0]}fe.writeDoubleLE=Ce?Me:$,fe.writeDoubleBE=Ce?$:Me,fe.readDoubleLE=Ce?F:he,fe.readDoubleBE=Ce?he:F}():function(){function Ee(Ce,Me,$,F,he,we){var He=F<0?1:0;if(He&&(F=-F),F===0)Ce(0,he,we+Me),Ce(1/F>0?0:2147483648,he,we+$);else if(isNaN(F))Ce(0,he,we+Me),Ce(2146959360,he,we+$);else if(F>17976931348623157e292)Ce(0,he,we+Me),Ce((He<<31|2146435072)>>>0,he,we+$);else{var ut;if(F<22250738585072014e-324)Ce((ut=F/5e-324)>>>0,he,we+Me),Ce((He<<31|ut/4294967296)>>>0,he,we+$);else{var tt=Math.floor(Math.log(F)/Math.LN2);tt===1024&&(tt=1023),Ce(4503599627370496*(ut=F*Math.pow(2,-tt))>>>0,he,we+Me),Ce((He<<31|tt+1023<<20|1048576*ut&1048575)>>>0,he,we+$)}}}function Re(Ce,Me,$,F,he){var we=Ce(F,he+Me),He=Ce(F,he+$),ut=2*(He>>31)+1,tt=He>>>20&2047,_e=4294967296*(1048575&He)+we;return tt===2047?_e?NaN:ut*(1/0):tt===0?5e-324*ut*_e:ut*Math.pow(2,tt-1075)*(_e+4503599627370496)}fe.writeDoubleLE=Ee.bind(null,V,0,4),fe.writeDoubleBE=Ee.bind(null,H,4,0),fe.readDoubleLE=Re.bind(null,te,0,4),fe.readDoubleBE=Re.bind(null,ve,4,0)}(),fe}function V(fe,Ee,Re){Ee[Re]=255&fe,Ee[Re+1]=fe>>>8&255,Ee[Re+2]=fe>>>16&255,Ee[Re+3]=fe>>>24}function H(fe,Ee,Re){Ee[Re]=fe>>>24,Ee[Re+1]=fe>>>16&255,Ee[Re+2]=fe>>>8&255,Ee[Re+3]=255&fe}function te(fe,Ee){return(fe[Ee]|fe[Ee+1]<<8|fe[Ee+2]<<16|fe[Ee+3]<<24)>>>0}function ve(fe,Ee){return(fe[Ee]<<24|fe[Ee+1]<<16|fe[Ee+2]<<8|fe[Ee+3])>>>0}be.exports=M(M)},7199:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(be){}return null}module.exports=inquire},6662:be=>{be.exports=function(M,V,H){var te=H||8192,ve=te>>>1,fe=null,Ee=te;return function(Re){if(Re<1||Re>ve)return M(Re);Ee+Re>te&&(fe=M(te),Ee=0);var Ce=V.call(fe,Ee,Ee+=Re);return 7&Ee&&(Ee=1+(7|Ee)),Ce}}},4997:(be,M)=>{var V=M;V.length=function(H){for(var te=0,ve=0,fe=0;fe191&&fe<224?Re[Ce++]=(31&fe)<<6|63&H[te++]:fe>239&&fe<365?(fe=((7&fe)<<18|(63&H[te++])<<12|(63&H[te++])<<6|63&H[te++])-65536,Re[Ce++]=55296+(fe>>10),Re[Ce++]=56320+(1023&fe)):Re[Ce++]=(15&fe)<<12|(63&H[te++])<<6|63&H[te++],Ce>8191&&((Ee||(Ee=[])).push(String.fromCharCode.apply(String,Re)),Ce=0);return Ee?(Ce&&Ee.push(String.fromCharCode.apply(String,Re.slice(0,Ce))),Ee.join("")):String.fromCharCode.apply(String,Re.slice(0,Ce))},V.write=function(H,te,ve){for(var fe,Ee,Re=ve,Ce=0;Ce>6|192,te[ve++]=63&fe|128):(64512&fe)==55296&&(64512&(Ee=H.charCodeAt(Ce+1)))==56320?(fe=65536+((1023&fe)<<10)+(1023&Ee),++Ce,te[ve++]=fe>>18|240,te[ve++]=fe>>12&63|128,te[ve++]=fe>>6&63|128,te[ve++]=63&fe|128):(te[ve++]=fe>>12|224,te[ve++]=fe>>6&63|128,te[ve++]=63&fe|128);return ve-Re}},3442:(be,M)=>{M.__esModule=!0;var V=function(){function H(te){if(!te)throw new TypeError("Invalid argument; `value` has no value.");this.value=H.EMPTY,te&&H.isGuid(te)&&(this.value=te)}return H.isGuid=function(te){var ve=te.toString();return te&&(te instanceof H||H.validator.test(ve))},H.create=function(){return new H([H.gen(2),H.gen(1),H.gen(1),H.gen(1),H.gen(3)].join("-"))},H.createEmpty=function(){return new H("emptyguid")},H.parse=function(te){return new H(te)},H.raw=function(){return[H.gen(2),H.gen(1),H.gen(1),H.gen(1),H.gen(3)].join("-")},H.gen=function(te){for(var ve="",fe=0;fe{be.exports=V;var M=null;try{M=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function V(mr,Ir,On){this.low=0|mr,this.high=0|Ir,this.unsigned=!!On}function H(mr){return(mr&&mr.__isLong__)===!0}V.prototype.__isLong__,Object.defineProperty(V.prototype,"__isLong__",{value:!0}),V.isLong=H;var te={},ve={};function fe(mr,Ir){var On,ba,ra;return Ir?(ra=0<=(mr>>>=0)&&mr<256)&&(ba=ve[mr])?ba:(On=Re(mr,(0|mr)<0?-1:0,!0),ra&&(ve[mr]=On),On):(ra=-128<=(mr|=0)&&mr<128)&&(ba=te[mr])?ba:(On=Re(mr,mr<0?-1:0,!1),ra&&(te[mr]=On),On)}function Ee(mr,Ir){if(isNaN(mr))return Ir?tt:ut;if(Ir){if(mr<0)return tt;if(mr>=he)return Lr}else{if(mr<=-we)return jr;if(mr+1>=we)return ir}return mr<0?Ee(-mr,Ir).neg():Re(mr%F|0,mr/F|0,Ir)}function Re(mr,Ir,On){return new V(mr,Ir,On)}V.fromInt=fe,V.fromNumber=Ee,V.fromBits=Re;var Ce=Math.pow;function Me(mr,Ir,On){if(mr.length===0)throw Error("empty string");if(mr==="NaN"||mr==="Infinity"||mr==="+Infinity"||mr==="-Infinity")return ut;if(typeof Ir=="number"?(On=Ir,Ir=!1):Ir=!!Ir,(On=On||10)<2||360)throw Error("interior hyphen");if(ba===0)return Me(mr.substring(1),Ir,On).neg();for(var ra=Ee(Ce(On,8)),jn=ut,qn=0;qn>>0:this.low},tn.toNumber=function(){return this.unsigned?(this.high>>>0)*F+(this.low>>>0):this.high*F+(this.low>>>0)},tn.toString=function(mr){if((mr=mr||10)<2||36>>0).toString(mr);if((jn=Un).isZero())return pa+qn;for(;pa.length<6;)pa="0"+pa;qn=""+pa+qn}},tn.getHighBits=function(){return this.high},tn.getHighBitsUnsigned=function(){return this.high>>>0},tn.getLowBits=function(){return this.low},tn.getLowBitsUnsigned=function(){return this.low>>>0},tn.getNumBitsAbs=function(){if(this.isNegative())return this.eq(jr)?64:this.neg().getNumBitsAbs();for(var mr=this.high!=0?this.high:this.low,Ir=31;Ir>0&&!(mr&1<=0},tn.isOdd=function(){return(1&this.low)==1},tn.isEven=function(){return(1&this.low)==0},tn.equals=function(mr){return H(mr)||(mr=$(mr)),(this.unsigned===mr.unsigned||this.high>>>31!=1||mr.high>>>31!=1)&&this.high===mr.high&&this.low===mr.low},tn.eq=tn.equals,tn.notEquals=function(mr){return!this.eq(mr)},tn.neq=tn.notEquals,tn.ne=tn.notEquals,tn.lessThan=function(mr){return this.comp(mr)<0},tn.lt=tn.lessThan,tn.lessThanOrEqual=function(mr){return this.comp(mr)<=0},tn.lte=tn.lessThanOrEqual,tn.le=tn.lessThanOrEqual,tn.greaterThan=function(mr){return this.comp(mr)>0},tn.gt=tn.greaterThan,tn.greaterThanOrEqual=function(mr){return this.comp(mr)>=0},tn.gte=tn.greaterThanOrEqual,tn.ge=tn.greaterThanOrEqual,tn.compare=function(mr){if(H(mr)||(mr=$(mr)),this.eq(mr))return 0;var Ir=this.isNegative(),On=mr.isNegative();return Ir&&!On?-1:!Ir&&On?1:this.unsigned?mr.high>>>0>this.high>>>0||mr.high===this.high&&mr.low>>>0>this.low>>>0?-1:1:this.sub(mr).isNegative()?-1:1},tn.comp=tn.compare,tn.negate=function(){return!this.unsigned&&this.eq(jr)?jr:this.not().add(_e)},tn.neg=tn.negate,tn.add=function(mr){H(mr)||(mr=$(mr));var Ir=this.high>>>16,On=65535&this.high,ba=this.low>>>16,ra=65535&this.low,jn=mr.high>>>16,qn=65535&mr.high,Un=mr.low>>>16,pa=0,lo=0,ji=0,Fo=0;return ji+=(Fo+=ra+(65535&mr.low))>>>16,lo+=(ji+=ba+Un)>>>16,pa+=(lo+=On+qn)>>>16,pa+=Ir+jn,Re((ji&=65535)<<16|(Fo&=65535),(pa&=65535)<<16|(lo&=65535),this.unsigned)},tn.subtract=function(mr){return H(mr)||(mr=$(mr)),this.add(mr.neg())},tn.sub=tn.subtract,tn.multiply=function(mr){if(this.isZero())return ut;if(H(mr)||(mr=$(mr)),M)return Re(M.mul(this.low,this.high,mr.low,mr.high),M.get_high(),this.unsigned);if(mr.isZero())return ut;if(this.eq(jr))return mr.isOdd()?jr:ut;if(mr.eq(jr))return this.isOdd()?jr:ut;if(this.isNegative())return mr.isNegative()?this.neg().mul(mr.neg()):this.neg().mul(mr).neg();if(mr.isNegative())return this.mul(mr.neg()).neg();if(this.lt(He)&&mr.lt(He))return Ee(this.toNumber()*mr.toNumber(),this.unsigned);var Ir=this.high>>>16,On=65535&this.high,ba=this.low>>>16,ra=65535&this.low,jn=mr.high>>>16,qn=65535&mr.high,Un=mr.low>>>16,pa=65535&mr.low,lo=0,ji=0,Fo=0,Qo=0;return Fo+=(Qo+=ra*pa)>>>16,ji+=(Fo+=ba*pa)>>>16,Fo&=65535,ji+=(Fo+=ra*Un)>>>16,lo+=(ji+=On*pa)>>>16,ji&=65535,lo+=(ji+=ba*Un)>>>16,ji&=65535,lo+=(ji+=ra*qn)>>>16,lo+=Ir*pa+On*Un+ba*qn+ra*jn,Re((Fo&=65535)<<16|(Qo&=65535),(lo&=65535)<<16|(ji&=65535),this.unsigned)},tn.mul=tn.multiply,tn.divide=function(mr){if(H(mr)||(mr=$(mr)),mr.isZero())throw Error("division by zero");var Ir,On,ba;if(M)return this.unsigned||this.high!==-2147483648||mr.low!==-1||mr.high!==-1?Re((this.unsigned?M.div_u:M.div_s)(this.low,this.high,mr.low,mr.high),M.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?tt:ut;if(this.unsigned){if(mr.unsigned||(mr=mr.toUnsigned()),mr.gt(this))return tt;if(mr.gt(this.shru(1)))return Gt;ba=tt}else{if(this.eq(jr))return mr.eq(_e)||mr.eq(Qt)?jr:mr.eq(jr)?_e:(Ir=this.shr(1).div(mr).shl(1)).eq(ut)?mr.isNegative()?_e:Qt:(On=this.sub(mr.mul(Ir)),ba=Ir.add(On.div(mr)));if(mr.eq(jr))return this.unsigned?tt:ut;if(this.isNegative())return mr.isNegative()?this.neg().div(mr.neg()):this.neg().div(mr).neg();if(mr.isNegative())return this.div(mr.neg()).neg();ba=ut}for(On=this;On.gte(mr);){Ir=Math.max(1,Math.floor(On.toNumber()/mr.toNumber()));for(var ra=Math.ceil(Math.log(Ir)/Math.LN2),jn=ra<=48?1:Ce(2,ra-48),qn=Ee(Ir),Un=qn.mul(mr);Un.isNegative()||Un.gt(On);)Un=(qn=Ee(Ir-=jn,this.unsigned)).mul(mr);qn.isZero()&&(qn=_e),ba=ba.add(qn),On=On.sub(Un)}return ba},tn.div=tn.divide,tn.modulo=function(mr){return H(mr)||(mr=$(mr)),M?Re((this.unsigned?M.rem_u:M.rem_s)(this.low,this.high,mr.low,mr.high),M.get_high(),this.unsigned):this.sub(this.div(mr).mul(mr))},tn.mod=tn.modulo,tn.rem=tn.modulo,tn.not=function(){return Re(~this.low,~this.high,this.unsigned)},tn.and=function(mr){return H(mr)||(mr=$(mr)),Re(this.low&mr.low,this.high&mr.high,this.unsigned)},tn.or=function(mr){return H(mr)||(mr=$(mr)),Re(this.low|mr.low,this.high|mr.high,this.unsigned)},tn.xor=function(mr){return H(mr)||(mr=$(mr)),Re(this.low^mr.low,this.high^mr.high,this.unsigned)},tn.shiftLeft=function(mr){return H(mr)&&(mr=mr.toInt()),(mr&=63)==0?this:mr<32?Re(this.low<>>32-mr,this.unsigned):Re(0,this.low<>>mr|this.high<<32-mr,this.high>>mr,this.unsigned):Re(this.high>>mr-32,this.high>=0?0:-1,this.unsigned)},tn.shr=tn.shiftRight,tn.shiftRightUnsigned=function(mr){if(H(mr)&&(mr=mr.toInt()),(mr&=63)==0)return this;var Ir=this.high;return mr<32?Re(this.low>>>mr|Ir<<32-mr,Ir>>>mr,this.unsigned):Re(mr===32?Ir:Ir>>>mr-32,0,this.unsigned)},tn.shru=tn.shiftRightUnsigned,tn.shr_u=tn.shiftRightUnsigned,tn.toSigned=function(){return this.unsigned?Re(this.low,this.high,!1):this},tn.toUnsigned=function(){return this.unsigned?this:Re(this.low,this.high,!0)},tn.toBytes=function(mr){return mr?this.toBytesLE():this.toBytesBE()},tn.toBytesLE=function(){var mr=this.high,Ir=this.low;return[255&Ir,Ir>>>8&255,Ir>>>16&255,Ir>>>24,255&mr,mr>>>8&255,mr>>>16&255,mr>>>24]},tn.toBytesBE=function(){var mr=this.high,Ir=this.low;return[mr>>>24,mr>>>16&255,mr>>>8&255,255&mr,Ir>>>24,Ir>>>16&255,Ir>>>8&255,255&Ir]},V.fromBytes=function(mr,Ir,On){return On?V.fromBytesLE(mr,Ir):V.fromBytesBE(mr,Ir)},V.fromBytesLE=function(mr,Ir){return new V(mr[0]|mr[1]<<8|mr[2]<<16|mr[3]<<24,mr[4]|mr[5]<<8|mr[6]<<16|mr[7]<<24,Ir)},V.fromBytesBE=function(mr,Ir){return new V(mr[4]<<24|mr[5]<<16|mr[6]<<8|mr[7],mr[0]<<24|mr[1]<<16|mr[2]<<8|mr[3],Ir)}},1446:(be,M,V)=>{var H,te,ve,fe=V(2100),Ee=fe.Reader,Re=fe.Writer,Ce=fe.util,Me=fe.roots.default||(fe.roots.default={});Me.onnx=((ve={}).Version=(H={},(te=Object.create(H))[H[0]="_START_VERSION"]=0,te[H[1]="IR_VERSION_2017_10_10"]=1,te[H[2]="IR_VERSION_2017_10_30"]=2,te[H[3]="IR_VERSION_2017_11_3"]=3,te[H[4]="IR_VERSION_2019_1_22"]=4,te[H[5]="IR_VERSION"]=5,te),ve.AttributeProto=function(){function $(F){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],F)for(var he=Object.keys(F),we=0;we>>3){case 1:He.name=F.string();break;case 21:He.refAttrName=F.string();break;case 13:He.docString=F.string();break;case 20:He.type=F.int32();break;case 2:He.f=F.float();break;case 3:He.i=F.int64();break;case 4:He.s=F.bytes();break;case 5:He.t=Me.onnx.TensorProto.decode(F,F.uint32());break;case 6:He.g=Me.onnx.GraphProto.decode(F,F.uint32());break;case 7:if(He.floats&&He.floats.length||(He.floats=[]),(7&ut)==2)for(var tt=F.uint32()+F.pos;F.pos>>0,F.i.high>>>0).toNumber())),F.s!=null&&(typeof F.s=="string"?Ce.base64.decode(F.s,he.s=Ce.newBuffer(Ce.base64.length(F.s)),0):F.s.length&&(he.s=F.s)),F.t!=null){if(typeof F.t!="object")throw TypeError(".onnx.AttributeProto.t: object expected");he.t=Me.onnx.TensorProto.fromObject(F.t)}if(F.g!=null){if(typeof F.g!="object")throw TypeError(".onnx.AttributeProto.g: object expected");he.g=Me.onnx.GraphProto.fromObject(F.g)}if(F.floats){if(!Array.isArray(F.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");he.floats=[];for(var we=0;we>>0,F.ints[we].high>>>0).toNumber())}if(F.strings){if(!Array.isArray(F.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(he.strings=[],we=0;we>>0,F.i.high>>>0).toNumber():F.i),F.s!=null&&F.hasOwnProperty("s")&&(we.s=he.bytes===String?Ce.base64.encode(F.s,0,F.s.length):he.bytes===Array?Array.prototype.slice.call(F.s):F.s),F.t!=null&&F.hasOwnProperty("t")&&(we.t=Me.onnx.TensorProto.toObject(F.t,he)),F.g!=null&&F.hasOwnProperty("g")&&(we.g=Me.onnx.GraphProto.toObject(F.g,he)),F.floats&&F.floats.length){we.floats=[];for(var ut=0;ut>>0,F.ints[ut].high>>>0).toNumber():F.ints[ut];if(F.strings&&F.strings.length)for(we.strings=[],ut=0;ut>>3){case 1:He.name=F.string();break;case 2:He.type=Me.onnx.TypeProto.decode(F,F.uint32());break;case 3:He.docString=F.string();break;default:F.skipType(7&ut)}}return He},$.decodeDelimited=function(F){return F instanceof Ee||(F=new Ee(F)),this.decode(F,F.uint32())},$.verify=function(F){if(typeof F!="object"||F===null)return"object expected";if(F.name!=null&&F.hasOwnProperty("name")&&!Ce.isString(F.name))return"name: string expected";if(F.type!=null&&F.hasOwnProperty("type")){var he=Me.onnx.TypeProto.verify(F.type);if(he)return"type."+he}return F.docString!=null&&F.hasOwnProperty("docString")&&!Ce.isString(F.docString)?"docString: string expected":null},$.fromObject=function(F){if(F instanceof Me.onnx.ValueInfoProto)return F;var he=new Me.onnx.ValueInfoProto;if(F.name!=null&&(he.name=String(F.name)),F.type!=null){if(typeof F.type!="object")throw TypeError(".onnx.ValueInfoProto.type: object expected");he.type=Me.onnx.TypeProto.fromObject(F.type)}return F.docString!=null&&(he.docString=String(F.docString)),he},$.toObject=function(F,he){he||(he={});var we={};return he.defaults&&(we.name="",we.type=null,we.docString=""),F.name!=null&&F.hasOwnProperty("name")&&(we.name=F.name),F.type!=null&&F.hasOwnProperty("type")&&(we.type=Me.onnx.TypeProto.toObject(F.type,he)),F.docString!=null&&F.hasOwnProperty("docString")&&(we.docString=F.docString),we},$.prototype.toJSON=function(){return this.constructor.toObject(this,fe.util.toJSONOptions)},$}(),ve.NodeProto=function(){function $(F){if(this.input=[],this.output=[],this.attribute=[],F)for(var he=Object.keys(F),we=0;we>>3){case 1:He.input&&He.input.length||(He.input=[]),He.input.push(F.string());break;case 2:He.output&&He.output.length||(He.output=[]),He.output.push(F.string());break;case 3:He.name=F.string();break;case 4:He.opType=F.string();break;case 7:He.domain=F.string();break;case 5:He.attribute&&He.attribute.length||(He.attribute=[]),He.attribute.push(Me.onnx.AttributeProto.decode(F,F.uint32()));break;case 6:He.docString=F.string();break;default:F.skipType(7&ut)}}return He},$.decodeDelimited=function(F){return F instanceof Ee||(F=new Ee(F)),this.decode(F,F.uint32())},$.verify=function(F){if(typeof F!="object"||F===null)return"object expected";if(F.input!=null&&F.hasOwnProperty("input")){if(!Array.isArray(F.input))return"input: array expected";for(var he=0;he>>3){case 1:He.irVersion=F.int64();break;case 8:He.opsetImport&&He.opsetImport.length||(He.opsetImport=[]),He.opsetImport.push(Me.onnx.OperatorSetIdProto.decode(F,F.uint32()));break;case 2:He.producerName=F.string();break;case 3:He.producerVersion=F.string();break;case 4:He.domain=F.string();break;case 5:He.modelVersion=F.int64();break;case 6:He.docString=F.string();break;case 7:He.graph=Me.onnx.GraphProto.decode(F,F.uint32());break;case 14:He.metadataProps&&He.metadataProps.length||(He.metadataProps=[]),He.metadataProps.push(Me.onnx.StringStringEntryProto.decode(F,F.uint32()));break;default:F.skipType(7&ut)}}return He},$.decodeDelimited=function(F){return F instanceof Ee||(F=new Ee(F)),this.decode(F,F.uint32())},$.verify=function(F){if(typeof F!="object"||F===null)return"object expected";if(F.irVersion!=null&&F.hasOwnProperty("irVersion")&&!(Ce.isInteger(F.irVersion)||F.irVersion&&Ce.isInteger(F.irVersion.low)&&Ce.isInteger(F.irVersion.high)))return"irVersion: integer|Long expected";if(F.opsetImport!=null&&F.hasOwnProperty("opsetImport")){if(!Array.isArray(F.opsetImport))return"opsetImport: array expected";for(var he=0;he>>0,F.irVersion.high>>>0).toNumber())),F.opsetImport){if(!Array.isArray(F.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");he.opsetImport=[];for(var we=0;we>>0,F.modelVersion.high>>>0).toNumber())),F.docString!=null&&(he.docString=String(F.docString)),F.graph!=null){if(typeof F.graph!="object")throw TypeError(".onnx.ModelProto.graph: object expected");he.graph=Me.onnx.GraphProto.fromObject(F.graph)}if(F.metadataProps){if(!Array.isArray(F.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(he.metadataProps=[],we=0;we>>0,F.irVersion.high>>>0).toNumber():F.irVersion),F.producerName!=null&&F.hasOwnProperty("producerName")&&(we.producerName=F.producerName),F.producerVersion!=null&&F.hasOwnProperty("producerVersion")&&(we.producerVersion=F.producerVersion),F.domain!=null&&F.hasOwnProperty("domain")&&(we.domain=F.domain),F.modelVersion!=null&&F.hasOwnProperty("modelVersion")&&(typeof F.modelVersion=="number"?we.modelVersion=he.longs===String?String(F.modelVersion):F.modelVersion:we.modelVersion=he.longs===String?Ce.Long.prototype.toString.call(F.modelVersion):he.longs===Number?new Ce.LongBits(F.modelVersion.low>>>0,F.modelVersion.high>>>0).toNumber():F.modelVersion),F.docString!=null&&F.hasOwnProperty("docString")&&(we.docString=F.docString),F.graph!=null&&F.hasOwnProperty("graph")&&(we.graph=Me.onnx.GraphProto.toObject(F.graph,he)),F.opsetImport&&F.opsetImport.length){we.opsetImport=[];for(var ut=0;ut>>3){case 1:He.key=F.string();break;case 2:He.value=F.string();break;default:F.skipType(7&ut)}}return He},$.decodeDelimited=function(F){return F instanceof Ee||(F=new Ee(F)),this.decode(F,F.uint32())},$.verify=function(F){return typeof F!="object"||F===null?"object expected":F.key!=null&&F.hasOwnProperty("key")&&!Ce.isString(F.key)?"key: string expected":F.value!=null&&F.hasOwnProperty("value")&&!Ce.isString(F.value)?"value: string expected":null},$.fromObject=function(F){if(F instanceof Me.onnx.StringStringEntryProto)return F;var he=new Me.onnx.StringStringEntryProto;return F.key!=null&&(he.key=String(F.key)),F.value!=null&&(he.value=String(F.value)),he},$.toObject=function(F,he){he||(he={});var we={};return he.defaults&&(we.key="",we.value=""),F.key!=null&&F.hasOwnProperty("key")&&(we.key=F.key),F.value!=null&&F.hasOwnProperty("value")&&(we.value=F.value),we},$.prototype.toJSON=function(){return this.constructor.toObject(this,fe.util.toJSONOptions)},$}(),ve.TensorAnnotation=function(){function $(F){if(this.quantParameterTensorNames=[],F)for(var he=Object.keys(F),we=0;we>>3){case 1:He.tensorName=F.string();break;case 2:He.quantParameterTensorNames&&He.quantParameterTensorNames.length||(He.quantParameterTensorNames=[]),He.quantParameterTensorNames.push(Me.onnx.StringStringEntryProto.decode(F,F.uint32()));break;default:F.skipType(7&ut)}}return He},$.decodeDelimited=function(F){return F instanceof Ee||(F=new Ee(F)),this.decode(F,F.uint32())},$.verify=function(F){if(typeof F!="object"||F===null)return"object expected";if(F.tensorName!=null&&F.hasOwnProperty("tensorName")&&!Ce.isString(F.tensorName))return"tensorName: string expected";if(F.quantParameterTensorNames!=null&&F.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(F.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var he=0;he>>3){case 1:He.node&&He.node.length||(He.node=[]),He.node.push(Me.onnx.NodeProto.decode(F,F.uint32()));break;case 2:He.name=F.string();break;case 5:He.initializer&&He.initializer.length||(He.initializer=[]),He.initializer.push(Me.onnx.TensorProto.decode(F,F.uint32()));break;case 10:He.docString=F.string();break;case 11:He.input&&He.input.length||(He.input=[]),He.input.push(Me.onnx.ValueInfoProto.decode(F,F.uint32()));break;case 12:He.output&&He.output.length||(He.output=[]),He.output.push(Me.onnx.ValueInfoProto.decode(F,F.uint32()));break;case 13:He.valueInfo&&He.valueInfo.length||(He.valueInfo=[]),He.valueInfo.push(Me.onnx.ValueInfoProto.decode(F,F.uint32()));break;case 14:He.quantizationAnnotation&&He.quantizationAnnotation.length||(He.quantizationAnnotation=[]),He.quantizationAnnotation.push(Me.onnx.TensorAnnotation.decode(F,F.uint32()));break;default:F.skipType(7&ut)}}return He},$.decodeDelimited=function(F){return F instanceof Ee||(F=new Ee(F)),this.decode(F,F.uint32())},$.verify=function(F){if(typeof F!="object"||F===null)return"object expected";if(F.node!=null&&F.hasOwnProperty("node")){if(!Array.isArray(F.node))return"node: array expected";for(var he=0;he>>3){case 1:if(He.dims&&He.dims.length||(He.dims=[]),(7&ut)==2)for(var tt=F.uint32()+F.pos;F.pos>>0,F.dims[we].high>>>0).toNumber())}if(F.dataType!=null&&(he.dataType=0|F.dataType),F.segment!=null){if(typeof F.segment!="object")throw TypeError(".onnx.TensorProto.segment: object expected");he.segment=Me.onnx.TensorProto.Segment.fromObject(F.segment)}if(F.floatData){if(!Array.isArray(F.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(he.floatData=[],we=0;we>>0,F.int64Data[we].high>>>0).toNumber())}if(F.name!=null&&(he.name=String(F.name)),F.docString!=null&&(he.docString=String(F.docString)),F.rawData!=null&&(typeof F.rawData=="string"?Ce.base64.decode(F.rawData,he.rawData=Ce.newBuffer(Ce.base64.length(F.rawData)),0):F.rawData.length&&(he.rawData=F.rawData)),F.externalData){if(!Array.isArray(F.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(he.externalData=[],we=0;we>>0,F.uint64Data[we].high>>>0).toNumber(!0))}return he},$.toObject=function(F,he){he||(he={});var we={};if((he.arrays||he.defaults)&&(we.dims=[],we.floatData=[],we.int32Data=[],we.stringData=[],we.int64Data=[],we.doubleData=[],we.uint64Data=[],we.externalData=[]),he.defaults&&(we.dataType=0,we.segment=null,we.name="",he.bytes===String?we.rawData="":(we.rawData=[],he.bytes!==Array&&(we.rawData=Ce.newBuffer(we.rawData))),we.docString="",we.dataLocation=he.enums===String?"DEFAULT":0),F.dims&&F.dims.length){we.dims=[];for(var He=0;He>>0,F.dims[He].high>>>0).toNumber():F.dims[He]}if(F.dataType!=null&&F.hasOwnProperty("dataType")&&(we.dataType=F.dataType),F.segment!=null&&F.hasOwnProperty("segment")&&(we.segment=Me.onnx.TensorProto.Segment.toObject(F.segment,he)),F.floatData&&F.floatData.length)for(we.floatData=[],He=0;He>>0,F.int64Data[He].high>>>0).toNumber():F.int64Data[He];if(F.name!=null&&F.hasOwnProperty("name")&&(we.name=F.name),F.rawData!=null&&F.hasOwnProperty("rawData")&&(we.rawData=he.bytes===String?Ce.base64.encode(F.rawData,0,F.rawData.length):he.bytes===Array?Array.prototype.slice.call(F.rawData):F.rawData),F.doubleData&&F.doubleData.length)for(we.doubleData=[],He=0;He>>0,F.uint64Data[He].high>>>0).toNumber(!0):F.uint64Data[He];if(F.docString!=null&&F.hasOwnProperty("docString")&&(we.docString=F.docString),F.externalData&&F.externalData.length)for(we.externalData=[],He=0;He>>3){case 1:ut.begin=he.int64();break;case 2:ut.end=he.int64();break;default:he.skipType(7&tt)}}return ut},F.decodeDelimited=function(he){return he instanceof Ee||(he=new Ee(he)),this.decode(he,he.uint32())},F.verify=function(he){return typeof he!="object"||he===null?"object expected":he.begin!=null&&he.hasOwnProperty("begin")&&!(Ce.isInteger(he.begin)||he.begin&&Ce.isInteger(he.begin.low)&&Ce.isInteger(he.begin.high))?"begin: integer|Long expected":he.end!=null&&he.hasOwnProperty("end")&&!(Ce.isInteger(he.end)||he.end&&Ce.isInteger(he.end.low)&&Ce.isInteger(he.end.high))?"end: integer|Long expected":null},F.fromObject=function(he){if(he instanceof Me.onnx.TensorProto.Segment)return he;var we=new Me.onnx.TensorProto.Segment;return he.begin!=null&&(Ce.Long?(we.begin=Ce.Long.fromValue(he.begin)).unsigned=!1:typeof he.begin=="string"?we.begin=parseInt(he.begin,10):typeof he.begin=="number"?we.begin=he.begin:typeof he.begin=="object"&&(we.begin=new Ce.LongBits(he.begin.low>>>0,he.begin.high>>>0).toNumber())),he.end!=null&&(Ce.Long?(we.end=Ce.Long.fromValue(he.end)).unsigned=!1:typeof he.end=="string"?we.end=parseInt(he.end,10):typeof he.end=="number"?we.end=he.end:typeof he.end=="object"&&(we.end=new Ce.LongBits(he.end.low>>>0,he.end.high>>>0).toNumber())),we},F.toObject=function(he,we){we||(we={});var He={};if(we.defaults){if(Ce.Long){var ut=new Ce.Long(0,0,!1);He.begin=we.longs===String?ut.toString():we.longs===Number?ut.toNumber():ut}else He.begin=we.longs===String?"0":0;Ce.Long?(ut=new Ce.Long(0,0,!1),He.end=we.longs===String?ut.toString():we.longs===Number?ut.toNumber():ut):He.end=we.longs===String?"0":0}return he.begin!=null&&he.hasOwnProperty("begin")&&(typeof he.begin=="number"?He.begin=we.longs===String?String(he.begin):he.begin:He.begin=we.longs===String?Ce.Long.prototype.toString.call(he.begin):we.longs===Number?new Ce.LongBits(he.begin.low>>>0,he.begin.high>>>0).toNumber():he.begin),he.end!=null&&he.hasOwnProperty("end")&&(typeof he.end=="number"?He.end=we.longs===String?String(he.end):he.end:He.end=we.longs===String?Ce.Long.prototype.toString.call(he.end):we.longs===Number?new Ce.LongBits(he.end.low>>>0,he.end.high>>>0).toNumber():he.end),He},F.prototype.toJSON=function(){return this.constructor.toObject(this,fe.util.toJSONOptions)},F}(),$.DataLocation=function(){var F={},he=Object.create(F);return he[F[0]="DEFAULT"]=0,he[F[1]="EXTERNAL"]=1,he}(),$}(),ve.TensorShapeProto=function(){function $(F){if(this.dim=[],F)for(var he=Object.keys(F),we=0;we>>3==1?(He.dim&&He.dim.length||(He.dim=[]),He.dim.push(Me.onnx.TensorShapeProto.Dimension.decode(F,F.uint32()))):F.skipType(7&ut)}return He},$.decodeDelimited=function(F){return F instanceof Ee||(F=new Ee(F)),this.decode(F,F.uint32())},$.verify=function(F){if(typeof F!="object"||F===null)return"object expected";if(F.dim!=null&&F.hasOwnProperty("dim")){if(!Array.isArray(F.dim))return"dim: array expected";for(var he=0;he>>3){case 1:tt.dimValue=we.int64();break;case 2:tt.dimParam=we.string();break;case 3:tt.denotation=we.string();break;default:we.skipType(7&_e)}}return tt},F.decodeDelimited=function(we){return we instanceof Ee||(we=new Ee(we)),this.decode(we,we.uint32())},F.verify=function(we){if(typeof we!="object"||we===null)return"object expected";var He={};if(we.dimValue!=null&&we.hasOwnProperty("dimValue")&&(He.value=1,!(Ce.isInteger(we.dimValue)||we.dimValue&&Ce.isInteger(we.dimValue.low)&&Ce.isInteger(we.dimValue.high))))return"dimValue: integer|Long expected";if(we.dimParam!=null&&we.hasOwnProperty("dimParam")){if(He.value===1)return"value: multiple values";if(He.value=1,!Ce.isString(we.dimParam))return"dimParam: string expected"}return we.denotation!=null&&we.hasOwnProperty("denotation")&&!Ce.isString(we.denotation)?"denotation: string expected":null},F.fromObject=function(we){if(we instanceof Me.onnx.TensorShapeProto.Dimension)return we;var He=new Me.onnx.TensorShapeProto.Dimension;return we.dimValue!=null&&(Ce.Long?(He.dimValue=Ce.Long.fromValue(we.dimValue)).unsigned=!1:typeof we.dimValue=="string"?He.dimValue=parseInt(we.dimValue,10):typeof we.dimValue=="number"?He.dimValue=we.dimValue:typeof we.dimValue=="object"&&(He.dimValue=new Ce.LongBits(we.dimValue.low>>>0,we.dimValue.high>>>0).toNumber())),we.dimParam!=null&&(He.dimParam=String(we.dimParam)),we.denotation!=null&&(He.denotation=String(we.denotation)),He},F.toObject=function(we,He){He||(He={});var ut={};return He.defaults&&(ut.denotation=""),we.dimValue!=null&&we.hasOwnProperty("dimValue")&&(typeof we.dimValue=="number"?ut.dimValue=He.longs===String?String(we.dimValue):we.dimValue:ut.dimValue=He.longs===String?Ce.Long.prototype.toString.call(we.dimValue):He.longs===Number?new Ce.LongBits(we.dimValue.low>>>0,we.dimValue.high>>>0).toNumber():we.dimValue,He.oneofs&&(ut.value="dimValue")),we.dimParam!=null&&we.hasOwnProperty("dimParam")&&(ut.dimParam=we.dimParam,He.oneofs&&(ut.value="dimParam")),we.denotation!=null&&we.hasOwnProperty("denotation")&&(ut.denotation=we.denotation),ut},F.prototype.toJSON=function(){return this.constructor.toObject(this,fe.util.toJSONOptions)},F}(),$}(),ve.TypeProto=function(){function $(he){if(he)for(var we=Object.keys(he),He=0;He>>3){case 1:ut.tensorType=Me.onnx.TypeProto.Tensor.decode(he,he.uint32());break;case 6:ut.denotation=he.string();break;default:he.skipType(7&tt)}}return ut},$.decodeDelimited=function(he){return he instanceof Ee||(he=new Ee(he)),this.decode(he,he.uint32())},$.verify=function(he){if(typeof he!="object"||he===null)return"object expected";if(he.tensorType!=null&&he.hasOwnProperty("tensorType")){var we=Me.onnx.TypeProto.Tensor.verify(he.tensorType);if(we)return"tensorType."+we}return he.denotation!=null&&he.hasOwnProperty("denotation")&&!Ce.isString(he.denotation)?"denotation: string expected":null},$.fromObject=function(he){if(he instanceof Me.onnx.TypeProto)return he;var we=new Me.onnx.TypeProto;if(he.tensorType!=null){if(typeof he.tensorType!="object")throw TypeError(".onnx.TypeProto.tensorType: object expected");we.tensorType=Me.onnx.TypeProto.Tensor.fromObject(he.tensorType)}return he.denotation!=null&&(we.denotation=String(he.denotation)),we},$.toObject=function(he,we){we||(we={});var He={};return we.defaults&&(He.denotation=""),he.tensorType!=null&&he.hasOwnProperty("tensorType")&&(He.tensorType=Me.onnx.TypeProto.Tensor.toObject(he.tensorType,we),we.oneofs&&(He.value="tensorType")),he.denotation!=null&&he.hasOwnProperty("denotation")&&(He.denotation=he.denotation),He},$.prototype.toJSON=function(){return this.constructor.toObject(this,fe.util.toJSONOptions)},$.Tensor=function(){function he(we){if(we)for(var He=Object.keys(we),ut=0;ut>>3){case 1:tt.elemType=we.int32();break;case 2:tt.shape=Me.onnx.TensorShapeProto.decode(we,we.uint32());break;default:we.skipType(7&_e)}}return tt},he.decodeDelimited=function(we){return we instanceof Ee||(we=new Ee(we)),this.decode(we,we.uint32())},he.verify=function(we){if(typeof we!="object"||we===null)return"object expected";if(we.elemType!=null&&we.hasOwnProperty("elemType")&&!Ce.isInteger(we.elemType))return"elemType: integer expected";if(we.shape!=null&&we.hasOwnProperty("shape")){var He=Me.onnx.TensorShapeProto.verify(we.shape);if(He)return"shape."+He}return null},he.fromObject=function(we){if(we instanceof Me.onnx.TypeProto.Tensor)return we;var He=new Me.onnx.TypeProto.Tensor;if(we.elemType!=null&&(He.elemType=0|we.elemType),we.shape!=null){if(typeof we.shape!="object")throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");He.shape=Me.onnx.TensorShapeProto.fromObject(we.shape)}return He},he.toObject=function(we,He){He||(He={});var ut={};return He.defaults&&(ut.elemType=0,ut.shape=null),we.elemType!=null&&we.hasOwnProperty("elemType")&&(ut.elemType=we.elemType),we.shape!=null&&we.hasOwnProperty("shape")&&(ut.shape=Me.onnx.TensorShapeProto.toObject(we.shape,He)),ut},he.prototype.toJSON=function(){return this.constructor.toObject(this,fe.util.toJSONOptions)},he}(),$}(),ve.OperatorSetIdProto=function(){function $(F){if(F)for(var he=Object.keys(F),we=0;we>>3){case 1:He.domain=F.string();break;case 2:He.version=F.int64();break;default:F.skipType(7&ut)}}return He},$.decodeDelimited=function(F){return F instanceof Ee||(F=new Ee(F)),this.decode(F,F.uint32())},$.verify=function(F){return typeof F!="object"||F===null?"object expected":F.domain!=null&&F.hasOwnProperty("domain")&&!Ce.isString(F.domain)?"domain: string expected":F.version!=null&&F.hasOwnProperty("version")&&!(Ce.isInteger(F.version)||F.version&&Ce.isInteger(F.version.low)&&Ce.isInteger(F.version.high))?"version: integer|Long expected":null},$.fromObject=function(F){if(F instanceof Me.onnx.OperatorSetIdProto)return F;var he=new Me.onnx.OperatorSetIdProto;return F.domain!=null&&(he.domain=String(F.domain)),F.version!=null&&(Ce.Long?(he.version=Ce.Long.fromValue(F.version)).unsigned=!1:typeof F.version=="string"?he.version=parseInt(F.version,10):typeof F.version=="number"?he.version=F.version:typeof F.version=="object"&&(he.version=new Ce.LongBits(F.version.low>>>0,F.version.high>>>0).toNumber())),he},$.toObject=function(F,he){he||(he={});var we={};if(he.defaults)if(we.domain="",Ce.Long){var He=new Ce.Long(0,0,!1);we.version=he.longs===String?He.toString():he.longs===Number?He.toNumber():He}else we.version=he.longs===String?"0":0;return F.domain!=null&&F.hasOwnProperty("domain")&&(we.domain=F.domain),F.version!=null&&F.hasOwnProperty("version")&&(typeof F.version=="number"?we.version=he.longs===String?String(F.version):F.version:we.version=he.longs===String?Ce.Long.prototype.toString.call(F.version):he.longs===Number?new Ce.LongBits(F.version.low>>>0,F.version.high>>>0).toNumber():F.version),we},$.prototype.toJSON=function(){return this.constructor.toObject(this,fe.util.toJSONOptions)},$}(),ve),be.exports=Me},2100:(be,M,V)=>{be.exports=V(9482)},9482:(be,M,V)=>{var H=M;function te(){H.util._configure(),H.Writer._configure(H.BufferWriter),H.Reader._configure(H.BufferReader)}H.build="minimal",H.Writer=V(1173),H.BufferWriter=V(3155),H.Reader=V(1408),H.BufferReader=V(593),H.util=V(9693),H.rpc=V(5994),H.roots=V(5054),H.configure=te,te()},1408:(be,M,V)=>{be.exports=Re;var H,te=V(9693),ve=te.LongBits,fe=te.utf8;function Ee(He,ut){return RangeError("index out of range: "+He.pos+" + "+(ut||1)+" > "+He.len)}function Re(He){this.buf=He,this.pos=0,this.len=He.length}var Ce,Me=typeof Uint8Array<"u"?function(He){if(He instanceof Uint8Array||Array.isArray(He))return new Re(He);throw Error("illegal buffer")}:function(He){if(Array.isArray(He))return new Re(He);throw Error("illegal buffer")},$=function(){return te.Buffer?function(He){return(Re.create=function(ut){return te.Buffer.isBuffer(ut)?new H(ut):Me(ut)})(He)}:Me};function F(){var He=new ve(0,0),ut=0;if(!(this.len-this.pos>4)){for(;ut<3;++ut){if(this.pos>=this.len)throw Ee(this);if(He.lo=(He.lo|(127&this.buf[this.pos])<<7*ut)>>>0,this.buf[this.pos++]<128)return He}return He.lo=(He.lo|(127&this.buf[this.pos++])<<7*ut)>>>0,He}for(;ut<4;++ut)if(He.lo=(He.lo|(127&this.buf[this.pos])<<7*ut)>>>0,this.buf[this.pos++]<128)return He;if(He.lo=(He.lo|(127&this.buf[this.pos])<<28)>>>0,He.hi=(He.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return He;if(ut=0,this.len-this.pos>4){for(;ut<5;++ut)if(He.hi=(He.hi|(127&this.buf[this.pos])<<7*ut+3)>>>0,this.buf[this.pos++]<128)return He}else for(;ut<5;++ut){if(this.pos>=this.len)throw Ee(this);if(He.hi=(He.hi|(127&this.buf[this.pos])<<7*ut+3)>>>0,this.buf[this.pos++]<128)return He}throw Error("invalid varint encoding")}function he(He,ut){return(He[ut-4]|He[ut-3]<<8|He[ut-2]<<16|He[ut-1]<<24)>>>0}function we(){if(this.pos+8>this.len)throw Ee(this,8);return new ve(he(this.buf,this.pos+=4),he(this.buf,this.pos+=4))}Re.create=$(),Re.prototype._slice=te.Array.prototype.subarray||te.Array.prototype.slice,Re.prototype.uint32=(Ce=4294967295,function(){if(Ce=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(Ce=(Ce|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(Ce=(Ce|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(Ce=(Ce|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(Ce=(Ce|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return Ce;if((this.pos+=5)>this.len)throw this.pos=this.len,Ee(this,10);return Ce}),Re.prototype.int32=function(){return 0|this.uint32()},Re.prototype.sint32=function(){var He=this.uint32();return He>>>1^-(1&He)|0},Re.prototype.bool=function(){return this.uint32()!==0},Re.prototype.fixed32=function(){if(this.pos+4>this.len)throw Ee(this,4);return he(this.buf,this.pos+=4)},Re.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Ee(this,4);return 0|he(this.buf,this.pos+=4)},Re.prototype.float=function(){if(this.pos+4>this.len)throw Ee(this,4);var He=te.float.readFloatLE(this.buf,this.pos);return this.pos+=4,He},Re.prototype.double=function(){if(this.pos+8>this.len)throw Ee(this,4);var He=te.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,He},Re.prototype.bytes=function(){var He=this.uint32(),ut=this.pos,tt=this.pos+He;if(tt>this.len)throw Ee(this,He);return this.pos+=He,Array.isArray(this.buf)?this.buf.slice(ut,tt):ut===tt?new this.buf.constructor(0):this._slice.call(this.buf,ut,tt)},Re.prototype.string=function(){var He=this.bytes();return fe.read(He,0,He.length)},Re.prototype.skip=function(He){if(typeof He=="number"){if(this.pos+He>this.len)throw Ee(this,He);this.pos+=He}else do if(this.pos>=this.len)throw Ee(this);while(128&this.buf[this.pos++]);return this},Re.prototype.skipType=function(He){switch(He){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(He=7&this.uint32())!=4;)this.skipType(He);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+He+" at offset "+this.pos)}return this},Re._configure=function(He){H=He,Re.create=$(),H._configure();var ut=te.Long?"toLong":"toNumber";te.merge(Re.prototype,{int64:function(){return F.call(this)[ut](!1)},uint64:function(){return F.call(this)[ut](!0)},sint64:function(){return F.call(this).zzDecode()[ut](!1)},fixed64:function(){return we.call(this)[ut](!0)},sfixed64:function(){return we.call(this)[ut](!1)}})}},593:(be,M,V)=>{be.exports=ve;var H=V(1408);(ve.prototype=Object.create(H.prototype)).constructor=ve;var te=V(9693);function ve(fe){H.call(this,fe)}ve._configure=function(){te.Buffer&&(ve.prototype._slice=te.Buffer.prototype.slice)},ve.prototype.string=function(){var fe=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+fe,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+fe,this.len))},ve._configure()},5054:be=>{be.exports={}},5994:(be,M,V)=>{M.Service=V(7948)},7948:(be,M,V)=>{be.exports=te;var H=V(9693);function te(ve,fe,Ee){if(typeof ve!="function")throw TypeError("rpcImpl must be a function");H.EventEmitter.call(this),this.rpcImpl=ve,this.requestDelimited=!!fe,this.responseDelimited=!!Ee}(te.prototype=Object.create(H.EventEmitter.prototype)).constructor=te,te.prototype.rpcCall=function ve(fe,Ee,Re,Ce,Me){if(!Ce)throw TypeError("request must be specified");var $=this;if(!Me)return H.asPromise(ve,$,fe,Ee,Re,Ce);if($.rpcImpl)try{return $.rpcImpl(fe,Ee[$.requestDelimited?"encodeDelimited":"encode"](Ce).finish(),function(F,he){if(F)return $.emit("error",F,fe),Me(F);if(he!==null){if(!(he instanceof Re))try{he=Re[$.responseDelimited?"decodeDelimited":"decode"](he)}catch(we){return $.emit("error",we,fe),Me(we)}return $.emit("data",he,fe),Me(null,he)}$.end(!0)})}catch(F){return $.emit("error",F,fe),void setTimeout(function(){Me(F)},0)}else setTimeout(function(){Me(Error("already ended"))},0)},te.prototype.end=function(ve){return this.rpcImpl&&(ve||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(be,M,V)=>{be.exports=te;var H=V(9693);function te(Re,Ce){this.lo=Re>>>0,this.hi=Ce>>>0}var ve=te.zero=new te(0,0);ve.toNumber=function(){return 0},ve.zzEncode=ve.zzDecode=function(){return this},ve.length=function(){return 1};var fe=te.zeroHash="\0\0\0\0\0\0\0\0";te.fromNumber=function(Re){if(Re===0)return ve;var Ce=Re<0;Ce&&(Re=-Re);var Me=Re>>>0,$=(Re-Me)/4294967296>>>0;return Ce&&($=~$>>>0,Me=~Me>>>0,++Me>4294967295&&(Me=0,++$>4294967295&&($=0))),new te(Me,$)},te.from=function(Re){if(typeof Re=="number")return te.fromNumber(Re);if(H.isString(Re)){if(!H.Long)return te.fromNumber(parseInt(Re,10));Re=H.Long.fromString(Re)}return Re.low||Re.high?new te(Re.low>>>0,Re.high>>>0):ve},te.prototype.toNumber=function(Re){if(!Re&&this.hi>>>31){var Ce=1+~this.lo>>>0,Me=~this.hi>>>0;return Ce||(Me=Me+1>>>0),-(Ce+4294967296*Me)}return this.lo+4294967296*this.hi},te.prototype.toLong=function(Re){return H.Long?new H.Long(0|this.lo,0|this.hi,!!Re):{low:0|this.lo,high:0|this.hi,unsigned:!!Re}};var Ee=String.prototype.charCodeAt;te.fromHash=function(Re){return Re===fe?ve:new te((Ee.call(Re,0)|Ee.call(Re,1)<<8|Ee.call(Re,2)<<16|Ee.call(Re,3)<<24)>>>0,(Ee.call(Re,4)|Ee.call(Re,5)<<8|Ee.call(Re,6)<<16|Ee.call(Re,7)<<24)>>>0)},te.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},te.prototype.zzEncode=function(){var Re=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^Re)>>>0,this.lo=(this.lo<<1^Re)>>>0,this},te.prototype.zzDecode=function(){var Re=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^Re)>>>0,this.hi=(this.hi>>>1^Re)>>>0,this},te.prototype.length=function(){var Re=this.lo,Ce=(this.lo>>>28|this.hi<<4)>>>0,Me=this.hi>>>24;return Me===0?Ce===0?Re<16384?Re<128?1:2:Re<2097152?3:4:Ce<16384?Ce<128?5:6:Ce<2097152?7:8:Me<128?9:10}},9693:function(be,M,V){var H=M;function te(fe,Ee,Re){for(var Ce=Object.keys(Ee),Me=0;Me0)},H.Buffer=function(){try{var fe=H.inquire("buffer").Buffer;return fe.prototype.utf8Write?fe:null}catch{return null}}(),H._Buffer_from=null,H._Buffer_allocUnsafe=null,H.newBuffer=function(fe){return typeof fe=="number"?H.Buffer?H._Buffer_allocUnsafe(fe):new H.Array(fe):H.Buffer?H._Buffer_from(fe):typeof Uint8Array>"u"?fe:new Uint8Array(fe)},H.Array=typeof Uint8Array<"u"?Uint8Array:Array,H.Long=H.global.dcodeIO&&H.global.dcodeIO.Long||H.global.Long||H.inquire("long"),H.key2Re=/^true|false|0|1$/,H.key32Re=/^-?(?:0|[1-9][0-9]*)$/,H.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,H.longToHash=function(fe){return fe?H.LongBits.from(fe).toHash():H.LongBits.zeroHash},H.longFromHash=function(fe,Ee){var Re=H.LongBits.fromHash(fe);return H.Long?H.Long.fromBits(Re.lo,Re.hi,Ee):Re.toNumber(!!Ee)},H.merge=te,H.lcFirst=function(fe){return fe.charAt(0).toLowerCase()+fe.substring(1)},H.newError=ve,H.ProtocolError=ve("ProtocolError"),H.oneOfGetter=function(fe){for(var Ee={},Re=0;Re-1;--Me)if(Ee[Ce[Me]]===1&&this[Ce[Me]]!==void 0&&this[Ce[Me]]!==null)return Ce[Me]}},H.oneOfSetter=function(fe){return function(Ee){for(var Re=0;Re{be.exports=$;var H,te=V(9693),ve=te.LongBits,fe=te.base64,Ee=te.utf8;function Re(_e,Gt,Qt){this.fn=_e,this.len=Gt,this.next=void 0,this.val=Qt}function Ce(){}function Me(_e){this.head=_e.head,this.tail=_e.tail,this.len=_e.len,this.next=_e.states}function $(){this.len=0,this.head=new Re(Ce,0,0),this.tail=this.head,this.states=null}var F=function(){return te.Buffer?function(){return($.create=function(){return new H})()}:function(){return new $}};function he(_e,Gt,Qt){Gt[Qt]=255&_e}function we(_e,Gt){this.len=_e,this.next=void 0,this.val=Gt}function He(_e,Gt,Qt){for(;_e.hi;)Gt[Qt++]=127&_e.lo|128,_e.lo=(_e.lo>>>7|_e.hi<<25)>>>0,_e.hi>>>=7;for(;_e.lo>127;)Gt[Qt++]=127&_e.lo|128,_e.lo=_e.lo>>>7;Gt[Qt++]=_e.lo}function ut(_e,Gt,Qt){Gt[Qt]=255&_e,Gt[Qt+1]=_e>>>8&255,Gt[Qt+2]=_e>>>16&255,Gt[Qt+3]=_e>>>24}$.create=F(),$.alloc=function(_e){return new te.Array(_e)},te.Array!==Array&&($.alloc=te.pool($.alloc,te.Array.prototype.subarray)),$.prototype._push=function(_e,Gt,Qt){return this.tail=this.tail.next=new Re(_e,Gt,Qt),this.len+=Gt,this},we.prototype=Object.create(Re.prototype),we.prototype.fn=function(_e,Gt,Qt){for(;_e>127;)Gt[Qt++]=127&_e|128,_e>>>=7;Gt[Qt]=_e},$.prototype.uint32=function(_e){return this.len+=(this.tail=this.tail.next=new we((_e>>>=0)<128?1:_e<16384?2:_e<2097152?3:_e<268435456?4:5,_e)).len,this},$.prototype.int32=function(_e){return _e<0?this._push(He,10,ve.fromNumber(_e)):this.uint32(_e)},$.prototype.sint32=function(_e){return this.uint32((_e<<1^_e>>31)>>>0)},$.prototype.uint64=function(_e){var Gt=ve.from(_e);return this._push(He,Gt.length(),Gt)},$.prototype.int64=$.prototype.uint64,$.prototype.sint64=function(_e){var Gt=ve.from(_e).zzEncode();return this._push(He,Gt.length(),Gt)},$.prototype.bool=function(_e){return this._push(he,1,_e?1:0)},$.prototype.fixed32=function(_e){return this._push(ut,4,_e>>>0)},$.prototype.sfixed32=$.prototype.fixed32,$.prototype.fixed64=function(_e){var Gt=ve.from(_e);return this._push(ut,4,Gt.lo)._push(ut,4,Gt.hi)},$.prototype.sfixed64=$.prototype.fixed64,$.prototype.float=function(_e){return this._push(te.float.writeFloatLE,4,_e)},$.prototype.double=function(_e){return this._push(te.float.writeDoubleLE,8,_e)};var tt=te.Array.prototype.set?function(_e,Gt,Qt){Gt.set(_e,Qt)}:function(_e,Gt,Qt){for(var ir=0;ir<_e.length;++ir)Gt[Qt+ir]=_e[ir]};$.prototype.bytes=function(_e){var Gt=_e.length>>>0;if(!Gt)return this._push(he,1,0);if(te.isString(_e)){var Qt=$.alloc(Gt=fe.length(_e));fe.decode(_e,Qt,0),_e=Qt}return this.uint32(Gt)._push(tt,Gt,_e)},$.prototype.string=function(_e){var Gt=Ee.length(_e);return Gt?this.uint32(Gt)._push(Ee.write,Gt,_e):this._push(he,1,0)},$.prototype.fork=function(){return this.states=new Me(this),this.head=this.tail=new Re(Ce,0,0),this.len=0,this},$.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Re(Ce,0,0),this.len=0),this},$.prototype.ldelim=function(){var _e=this.head,Gt=this.tail,Qt=this.len;return this.reset().uint32(Qt),Qt&&(this.tail.next=_e.next,this.tail=Gt,this.len+=Qt),this},$.prototype.finish=function(){for(var _e=this.head.next,Gt=this.constructor.alloc(this.len),Qt=0;_e;)_e.fn(_e.val,Gt,Qt),Qt+=_e.len,_e=_e.next;return Gt},$._configure=function(_e){H=_e,$.create=F(),H._configure()}},3155:(be,M,V)=>{be.exports=ve;var H=V(1173);(ve.prototype=Object.create(H.prototype)).constructor=ve;var te=V(9693);function ve(){H.call(this)}function fe(Ee,Re,Ce){Ee.length<40?te.utf8.write(Ee,Re,Ce):Re.utf8Write?Re.utf8Write(Ee,Ce):Re.write(Ee,Ce)}ve._configure=function(){ve.alloc=te._Buffer_allocUnsafe,ve.writeBytesBuffer=te.Buffer&&te.Buffer.prototype instanceof Uint8Array&&te.Buffer.prototype.set.name==="set"?function(Ee,Re,Ce){Re.set(Ee,Ce)}:function(Ee,Re,Ce){if(Ee.copy)Ee.copy(Re,Ce,0,Ee.length);else for(var Me=0;Me>>0;return this.uint32(Re),Re&&this._push(ve.writeBytesBuffer,Re,Ee),this},ve.prototype.string=function(Ee){var Re=te.Buffer.byteLength(Ee);return this.uint32(Re),Re&&this._push(fe,Re,Ee),this},ve._configure()},7714:(be,M,V)=>{M.R=void 0;const H=V(6919),te=V(7448);M.R=new class{async init(){}async createSessionHandler(ve,fe){const Ee=new H.Session(fe);return await Ee.loadModel(ve),new te.OnnxjsSessionHandler(Ee)}}},4200:(be,M,V)=>{M.c8=M.rX=void 0;const H=V(1670),te=V(5381),ve=V(2157),fe=V(2306);M.rX=()=>{if((typeof H.env.wasm.initTimeout!="number"||H.env.wasm.initTimeout<0)&&(H.env.wasm.initTimeout=0),typeof H.env.wasm.simd!="boolean"&&(H.env.wasm.simd=!0),typeof H.env.wasm.proxy!="boolean"&&(H.env.wasm.proxy=!1),typeof H.env.wasm.numThreads!="number"||!Number.isInteger(H.env.wasm.numThreads)||H.env.wasm.numThreads<=0){const Ee=typeof navigator>"u"?(0,te.cpus)().length:navigator.hardwareConcurrency;H.env.wasm.numThreads=Math.min(4,Math.ceil((Ee||1)/2))}},M.c8=new class{async init(){(0,M.rX)(),await(0,ve.initWasm)()}async createSessionHandler(Ee,Re){const Ce=new fe.OnnxruntimeWebAssemblySessionHandler;return await Ce.loadModel(Ee,Re),Promise.resolve(Ce)}}},6018:function(be,M,V){var H=this&&this.__createBinding||(Object.create?function(fe,Ee,Re,Ce){Ce===void 0&&(Ce=Re);var Me=Object.getOwnPropertyDescriptor(Ee,Re);Me&&!("get"in Me?!Ee.__esModule:Me.writable||Me.configurable)||(Me={enumerable:!0,get:function(){return Ee[Re]}}),Object.defineProperty(fe,Ce,Me)}:function(fe,Ee,Re,Ce){Ce===void 0&&(Ce=Re),fe[Ce]=Ee[Re]}),te=this&&this.__exportStar||function(fe,Ee){for(var Re in fe)Re==="default"||Object.prototype.hasOwnProperty.call(Ee,Re)||H(Ee,fe,Re)};Object.defineProperty(M,"__esModule",{value:!0}),te(V(1670),M);const ve=V(1670);{const fe=V(7714).R;(0,ve.registerBackend)("webgl",fe,-10)}{const fe=V(4200).c8;(0,ve.registerBackend)("cpu",fe,10),(0,ve.registerBackend)("wasm",fe,10),(0,ve.registerBackend)("xnnpack",fe,9)}},246:(be,M)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.createAttributeWithCacheKey=void 0;class V{constructor(te){Object.assign(this,te)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map(te=>`${this[te]}`).join(";")),this._cacheKey}}M.createAttributeWithCacheKey=H=>new V(H)},7778:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.Attribute=void 0;const H=V(1446),te=V(9395),ve=V(9162),fe=V(2517);var Ee=te.onnxruntime.experimental.fbs;class Re{constructor(Me){if(this._attributes=new Map,Me!=null){for(const $ of Me)$ instanceof H.onnx.AttributeProto?this._attributes.set($.name,[Re.getValue($),Re.getType($)]):$ instanceof Ee.Attribute&&this._attributes.set($.name(),[Re.getValue($),Re.getType($)]);if(this._attributes.sizeve.Tensor.fromProto(he));if(Me instanceof Ee.Attribute)return F.map(he=>ve.Tensor.fromOrtTensor(he))}if($===H.onnx.AttributeProto.AttributeType.STRING&&Me instanceof H.onnx.AttributeProto){const he=F;return(0,fe.decodeUtf8String)(he)}return $===H.onnx.AttributeProto.AttributeType.STRINGS&&Me instanceof H.onnx.AttributeProto?F.map(fe.decodeUtf8String):F}static getValueNoCheck(Me){return Me instanceof H.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(Me):this.getValueNoCheckFromOrtFormat(Me)}static getValueNoCheckFromOnnxFormat(Me){switch(Me.type){case H.onnx.AttributeProto.AttributeType.FLOAT:return Me.f;case H.onnx.AttributeProto.AttributeType.INT:return Me.i;case H.onnx.AttributeProto.AttributeType.STRING:return Me.s;case H.onnx.AttributeProto.AttributeType.TENSOR:return Me.t;case H.onnx.AttributeProto.AttributeType.GRAPH:return Me.g;case H.onnx.AttributeProto.AttributeType.FLOATS:return Me.floats;case H.onnx.AttributeProto.AttributeType.INTS:return Me.ints;case H.onnx.AttributeProto.AttributeType.STRINGS:return Me.strings;case H.onnx.AttributeProto.AttributeType.TENSORS:return Me.tensors;case H.onnx.AttributeProto.AttributeType.GRAPHS:return Me.graphs;default:throw new Error(`unsupported attribute type: ${H.onnx.AttributeProto.AttributeType[Me.type]}`)}}static getValueNoCheckFromOrtFormat(Me){switch(Me.type()){case Ee.AttributeType.FLOAT:return Me.f();case Ee.AttributeType.INT:return Me.i();case Ee.AttributeType.STRING:return Me.s();case Ee.AttributeType.TENSOR:return Me.t();case Ee.AttributeType.GRAPH:return Me.g();case Ee.AttributeType.FLOATS:return Me.floatsArray();case Ee.AttributeType.INTS:{const $=[];for(let F=0;F{Object.defineProperty(M,"__esModule",{value:!0}),M.resolveBackend=M.backend=void 0;const H=V(5038),te=new Map;async function ve(fe){const Ee=M.backend;if(Ee[fe]!==void 0&&function(Re){const Ce=Re;return"initialize"in Ce&&typeof Ce.initialize=="function"&&"createSessionHandler"in Ce&&typeof Ce.createSessionHandler=="function"&&"dispose"in Ce&&typeof Ce.dispose=="function"}(Ee[fe])){const Re=Ee[fe];let Ce=Re.initialize();if(typeof Ce=="object"&&"then"in Ce&&(Ce=await Ce),Ce)return te.set(fe,Re),Re}}M.backend={webgl:new H.WebGLBackend},M.resolveBackend=async function fe(Ee){if(!Ee)return fe(["webgl"]);{const Re=typeof Ee=="string"?[Ee]:Ee;for(const Ce of Re){const Me=te.get(Ce);if(Me)return Me;const $=await ve(Ce);if($)return $}}throw new Error("no available backend to use")}},5038:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.WebGLBackend=void 0;const H=V(1670),te=V(6231),ve=V(6416),fe=V(7305);M.WebGLBackend=class{get contextId(){return H.env.webgl.contextId}set contextId(Ee){H.env.webgl.contextId=Ee}get matmulMaxBatchSize(){return H.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(Ee){H.env.webgl.matmulMaxBatchSize=Ee}get textureCacheMode(){return H.env.webgl.textureCacheMode}set textureCacheMode(Ee){H.env.webgl.textureCacheMode=Ee}get pack(){return H.env.webgl.pack}set pack(Ee){H.env.webgl.pack=Ee}get async(){return H.env.webgl.async}set async(Ee){H.env.webgl.async=Ee}initialize(){try{return this.glContext=(0,fe.createWebGLContext)(this.contextId),typeof this.matmulMaxBatchSize!="number"&&(this.matmulMaxBatchSize=16),typeof this.textureCacheMode!="string"&&(this.textureCacheMode="full"),typeof this.pack!="boolean"&&(this.pack=!1),typeof this.async!="boolean"&&(this.async=!1),te.Logger.setWithEnv(H.env),te.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(Ee){return te.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${Ee}`),!1}}createSessionHandler(Ee){return new ve.WebGLSessionHandler(this,Ee)}dispose(){this.glContext.dispose()}}},5107:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.CoordsGlslLib=void 0;const H=V(2517),te=V(8520),ve=V(5060),fe=V(7859),Ee=V(9390);class Re extends te.GlslLib{constructor(Me){super(Me)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new te.GlslLibRoutine(` vec2 offsetToCoords(int offset, int width, int height) { int t = offset / width; int s = offset - t*width; vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height); return coords; } `)}}coordsToOffset(){return{coordsToOffset:new te.GlslLibRoutine(` int coordsToOffset(vec2 coords, int width, int height) { float s = coords.s * float(width); float t = coords.t * float(height); int offset = int(t) * width + int(s); return offset; } `)}}getOutputSamplingSnippet(){const Me=this.context.outputTextureLayout;return Me.isPacked?this.getPackedOutputSamplingSnippet(Me):this.getUnpackedOutputSamplingSnippet(Me)}getPackedOutputSamplingSnippet(Me){const $=Me.unpackedShape,F=[Me.width,Me.height],he={},we="getOutputCoords";switch($.length){case 0:he[we]=this.getOutputScalarCoords();break;case 1:he[we]=this.getOutputPacked1DCoords($,F);break;case 2:he[we]=this.getOutputPacked2DCoords($,F);break;case 3:he[we]=this.getOutputPacked3DCoords($,F);break;default:he[we]=this.getOutputPackedNDCoords($,F)}const He=` void setOutput(vec4 val) { ${(0,ve.getGlsl)(this.context.glContext.version).output} = val; } `;return he.floatTextureSetRGBA=new te.GlslLibRoutine(He),he}getUnpackedOutputSamplingSnippet(Me){const $=Me.unpackedShape,F=[Me.width,Me.height],he={},we="getOutputCoords";switch($.length){case 0:he[we]=this.getOutputScalarCoords();break;case 1:he[we]=this.getOutputUnpacked1DCoords($,F);break;case 2:he[we]=this.getOutputUnpacked2DCoords($,F);break;case 3:he[we]=this.getOutputUnpacked3DCoords($,F);break;case 4:he[we]=this.getOutputUnpacked4DCoords($,F);break;case 5:he[we]=this.getOutputUnpacked5DCoords($,F);break;case 6:he[we]=this.getOutputUnpacked6DCoords($,F);break;default:throw new Error(`Unsupported output dimensionality: ${$.length}`)}const He=` void setOutput(float val) { ${(0,ve.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0); } `;return he.floatTextureSetR=new te.GlslLibRoutine(He),he}getOutputScalarCoords(){return new te.GlslLibRoutine(` int getOutputCoords() { return 0; } `)}getOutputPacked1DCoords(Me,$){const F=$;let he="";return F[0]===1?(he=` int getOutputCoords() { return 2 * int(TexCoords.y * ${F[1]}.0); } `,new te.GlslLibRoutine(he)):F[1]===1?(he=` int getOutputCoords() { return 2 * int(TexCoords.x * ${F[0]}.0); } `,new te.GlslLibRoutine(he)):(he=` int getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${F[0]}, ${F[1]})); return 2 * (resTexRC.y * ${F[0]} + resTexRC.x); } `,new te.GlslLibRoutine(he))}getOutputPacked2DCoords(Me,$){let F="";if(H.ArrayUtil.arraysEqual(Me,$))return F=` ivec2 getOutputCoords() { return 2 * ivec2(TexCoords.xy * vec2(${$[0]}, ${$[1]})); } `,new te.GlslLibRoutine(F);const he=$,we=Math.ceil(Me[1]/2);return F=` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${he[0]}, ${he[1]})); int index = resTexRC.y * ${he[0]} + resTexRC.x; // reverse r and c order for packed texture int r = imod(index, ${we}) * 2; int c = 2 * (index / ${we}); return ivec2(r, c); } `,new te.GlslLibRoutine(F)}getOutputPacked3DCoords(Me,$){const F=[$[0],$[1]],he=Math.ceil(Me[2]/2),we=he*Math.ceil(Me[1]/2),He=` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${F[0]}, ${F[1]})); int index = resTexRC.y * ${F[0]} + resTexRC.x; int b = index / ${we}; index -= b * ${we}; // reverse r and c order for packed texture int r = imod(index, ${he}) * 2; int c = 2 * (index / ${he}); return ivec3(b, r, c); } `;return new te.GlslLibRoutine(He)}getOutputPackedNDCoords(Me,$){const F=[$[0],$[1]],he=Math.ceil(Me[Me.length-1]/2),we=he*Math.ceil(Me[Me.length-2]/2);let He=we,ut="",tt="b, r, c";for(let Gt=2;Gt=0;--tt)we[tt]=we[tt+1]*Me[tt+1];const He=["r","c","d"],ut=we.map((tt,_e)=>`int ${He[_e]} = index / ${tt}; ${_e===we.length-1?`int ${He[_e+1]} = index - ${He[_e]} * ${tt}`:`index -= ${He[_e]} * ${tt}`};`).join("");return F=` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${$[0]}, ${$[1]})); int index = resTexRC.y * ${$[0]} + resTexRC.x; ${ut} return ivec3(r, c, d); } `,new te.GlslLibRoutine(F)}getOutputUnpacked4DCoords(Me,$){let F="";const he=Me.length;let we=null;he<2&&(we=[]),we=new Array(he-1),we[he-2]=Me[he-1];for(let tt=he-3;tt>=0;--tt)we[tt]=we[tt+1]*Me[tt+1];const He=["r","c","d","d2"],ut=we.map((tt,_e)=>`int ${He[_e]} = index / ${tt}; ${_e===we.length-1?`int ${He[_e+1]} = index - ${He[_e]} * ${tt}`:`index -= ${He[_e]} * ${tt}`};`).join("");return F=` ivec4 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${$[0]}, ${$[1]})); int index = resTexRC.y * ${$[0]} + resTexRC.x; ${ut} return ivec4(r, c, d, d2); } `,new te.GlslLibRoutine(F)}getOutputUnpacked5DCoords(Me,$){let F="";const he=Me.length;let we=null;he<2&&(we=[]),we=new Array(he-1),we[he-2]=Me[he-1];for(let tt=he-3;tt>=0;--tt)we[tt]=we[tt+1]*Me[tt+1];const He=["r","c","d","d2","d3"],ut=we.map((tt,_e)=>`int ${He[_e]} = index / ${tt}; ${_e===we.length-1?`int ${He[_e+1]} = index - ${He[_e]} * ${tt}`:`index -= ${He[_e]} * ${tt}`};`).join("");return F=` ivec5 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${$[0]}, ${$[1]})); int index = resTexRC.y * ${$[0]} + resTexRC.x; ${ut} return ivec5(r, c, d, d2, d3); } `,new te.GlslLibRoutine(F)}getOutputUnpacked6DCoords(Me,$){let F="";const he=Me.length;let we=null;he<2&&(we=[]),we=new Array(he-1),we[he-2]=Me[he-1];for(let tt=he-3;tt>=0;--tt)we[tt]=we[tt+1]*Me[tt+1];const He=["r","c","d","d2","d3","d4"],ut=we.map((tt,_e)=>`int ${He[_e]} = index / ${tt}; ${_e===we.length-1?`int ${He[_e+1]} = index - ${He[_e]} * ${tt}`:`index -= ${He[_e]} * ${tt}`};`).join("");return F=` ivec6 getOutputCoords() { ivec2 resTexRC = ivec2(TexCoords.xy * vec2(${$[0]}, ${$[1]})); int index = resTexRC.y * ${$[0]} + resTexRC.x; ${ut} return ivec6(r, c, d, d2, d3, d4); } `,new te.GlslLibRoutine(F)}getCommonUtilFuncs(){const Me={};let $="uvFromFlat";Me[$]=new te.GlslLibRoutine(` vec2 uvFromFlat(int texNumR, int texNumC, int index) { int texC = index / texNumR; int texR = index - texC * texNumR; // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to // v. return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC); } `),$="packedUVfrom1D",Me[$]=new te.GlslLibRoutine(` vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { int texelIndex = index / 2; int texR = texelIndex / texNumC; int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } `),$="packedUVfrom2D",Me[$]=new te.GlslLibRoutine(` vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) { int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); int texR = texelIndex / texNumC; int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } `),$="packedUVfrom3D",Me[$]=new te.GlslLibRoutine(` vec2 packedUVfrom3D(int texNumR, int texNumC, int texelsInBatch, int texelsInLogicalRow, int b, int row, int col) { int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2); int texR = index / texNumC; int texC = index - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } `),$="sampleTexture";const F=(0,ve.getGlsl)(this.context.glContext.version);return Me[$]=new te.GlslLibRoutine(` float sampleTexture(sampler2D textureSampler, vec2 uv) { return ${F.texture2D}(textureSampler, uv).r; }`),Me}getInputsSamplingSnippets(){const Me={},$=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((F,he)=>{const we=this.context.inputTextureLayouts[he],He=(0,Ee.generateShaderFuncNameFromInputSamplerName)(F);we.isPacked?Me[He]=this.getPackedSamplerFromInput(He,F,we):Me[He]=this.getUnpackedSamplerFromInput(He,F,we);const ut=(0,Ee.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(F);we.unpackedShape.length<=$.unpackedShape.length&&(we.isPacked?Me[ut]=this.getPackedSamplerAtOutputCoords(ut,we,$,F):Me[ut]=this.getUnpackedSamplerAtOutputCoords(ut,we,$,F))}),Me}getPackedSamplerAtOutputCoords(Me,$,F,he){const we=$.unpackedShape,He=F.unpackedShape,ut=he,tt=(0,Ee.generateShaderFuncNameFromInputSamplerName)(ut),_e=we.length,Gt=He.length,Qt=H.BroadcastUtil.getBroadcastDims(we,He),ir=(0,Ee.getCoordsDataType)(Gt),Lr=Gt-_e;let jr;const tn=(0,Ee.getGlChannels)();jr=_e===0?"":Gt<2&&Qt.length>=1?"coords = 0;":Qt.map(jn=>`coords.${tn[jn+Lr]} = 0;`).join(` `);let mr="";mr=Gt<2&&_e>0?"coords":we.map((jn,qn)=>`coords.${tn[qn+Lr]}`).join(", ");let Ir="return outputValue;";const On=H.ShapeUtil.size(we)===1,ba=H.ShapeUtil.size(He)===1;if(_e!==1||On||ba){if(On&&!ba)Ir=Gt===1?` return vec4(outputValue.x, outputValue.x, 0., 0.); `:` return vec4(outputValue.x); `;else if(Qt.length){const jn=_e-2,qn=_e-1;Qt.indexOf(jn)>-1&&Qt.indexOf(qn)>-1?Ir="return vec4(outputValue.x);":Qt.indexOf(jn)>-1?Ir="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":Qt.indexOf(qn)>-1&&(Ir="return vec4(outputValue.xx, outputValue.zz);")}}else Ir=` return vec4(outputValue.xy, outputValue.xy); `;const ra=` vec4 ${Me}() { ${ir} coords = getOutputCoords(); int lastDim = coords.${tn[Gt-1]}; coords.${tn[Gt-1]} = coords.${tn[Gt-2]}; coords.${tn[Gt-2]} = lastDim; ${jr} vec4 outputValue = ${tt}(${mr}); ${Ir} } `;return new te.GlslLibRoutine(ra,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(Me,$,F,he){const we=[F.width,F.height],He=[$.width,$.height],ut=$.unpackedShape.length,tt=F.unpackedShape.length,_e=$.unpackedShape,Gt=F.unpackedShape,Qt=(0,Ee.generateShaderFuncNameFromInputSamplerName)(he);if(ut===tt&&H.ArrayUtil.arraysEqual(He,we)){const ba=` float ${Me}() { return sampleTexture(${he}, TexCoords); } `;return new te.GlslLibRoutine(ba,["coordinates.sampleTexture"])}const ir=(0,Ee.getCoordsDataType)(tt),Lr=H.BroadcastUtil.getBroadcastDims(_e,Gt),jr=tt-ut;let tn;const mr=(0,Ee.getGlChannels)();tn=ut===0?"":tt<2&&Lr.length>=1?"coords = 0;":Lr.map(ba=>`coords.${mr[ba+jr]} = 0;`).join(` `);let Ir="";Ir=tt<2&&ut>0?"coords":$.unpackedShape.map((ba,ra)=>`coords.${mr[ra+jr]}`).join(", ");const On=` float ${Me}() { ${ir} coords = getOutputCoords(); ${tn} return ${Qt}(${Ir}); } `;return new te.GlslLibRoutine(On,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(Me,$,F){switch(F.unpackedShape.length){case 0:return this.getPackedSamplerScalar(Me,$);case 1:return this.getPackedSampler1D(Me,$,F);case 2:return this.getPackedSampler2D(Me,$,F);case 3:return this.getPackedSampler3D(Me,$,F);default:return this.getPackedSamplerND(Me,$,F)}}getUnpackedSamplerFromInput(Me,$,F){const he=F.unpackedShape;switch(he.length){case 0:return this.getUnpackedSamplerScalar(Me,$,F);case 1:return this.getUnpackedSampler1D(Me,$,F);case 2:return this.getUnpackedSampler2D(Me,$,F);case 3:return this.getUnpackedSampler3D(Me,$,F);case 4:return this.getUnpackedSampler4D(Me,$,F);case 5:return this.getUnpackedSampler5D(Me,$,F);case 6:return this.getUnpackedSampler6D(Me,$,F);default:throw new Error(`Unsupported dimension ${he.length}-D`)}}getPackedSamplerScalar(Me,$){const F=` vec4 ${Me}() { return ${(0,ve.getGlsl)(this.context.glContext.version).texture2D}(${$}, halfCR); } `;return new te.GlslLibRoutine(F)}getPackedSampler1D(Me,$,F){const he=[F.width,F.height],we=[he[1],he[0]],He=(0,ve.getGlsl)(this.context.glContext.version),ut=`vec4 ${Me}(int index) { vec2 uv = packedUVfrom1D( ${we[0]}, ${we[1]}, index); return ${He.texture2D}(${$}, uv); }`;return new te.GlslLibRoutine(ut,["coordinates.packedUVfrom1D"])}getPackedSampler2D(Me,$,F){const he=F.unpackedShape,we=[F.width,F.height],He=(0,ve.getGlsl)(this.context.glContext.version),ut=we[0],tt=we[1];if(we!=null&&H.ArrayUtil.arraysEqual(he,we)){const ir=`vec4 ${Me}(int row, int col) { vec2 uv = (vec2(col, row) + halfCR) / vec2(${tt}.0, ${ut}.0); return ${He.texture2D}(${$}, uv); }`;return new te.GlslLibRoutine(ir)}const _e=we,Gt=Math.ceil(he[1]/2),Qt=`vec4 ${Me}(int row, int col) { vec2 uv = packedUVfrom2D(${_e[1]}, ${_e[0]}, ${Gt}, row, col); return ${He.texture2D}(${$}, uv); }`;return new te.GlslLibRoutine(Qt,["coordinates.packedUVfrom2D"])}getPackedSampler3D(Me,$,F){const he=F.unpackedShape,we=[F.width,F.height],He=[we[0],we[1]],ut=(0,ve.getGlsl)(this.context.glContext.version);if(he[0]===1){const ir=he.slice(1),Lr=[1,2],jr=(0,Ee.squeezeInputShape)(he,ir),tn=["b","row","col"],mr=JSON.parse(JSON.stringify(F));mr.unpackedShape=jr;const Ir=this.getPackedSamplerFromInput(Me,$,mr),On=`${Ir.routineBody} vec4 ${Me}(int b, int row, int col) { return ${Me}(${(0,Ee.getSqueezedParams)(tn,Lr)}); } `;return new te.GlslLibRoutine(On,Ir.dependencies)}const tt=He[0],_e=He[1],Gt=Math.ceil(he[2]/2),Qt=`vec4 ${Me}(int b, int row, int col) { vec2 uv = packedUVfrom3D( ${_e}, ${tt}, ${Gt*Math.ceil(he[1]/2)}, ${Gt}, b, row, col); return ${ut.texture2D}(${$}, uv);}`;return new te.GlslLibRoutine(Qt,["coordinates.packedUVfrom3D"])}getPackedSamplerND(Me,$,F){const he=F.unpackedShape,we=he.length,He=[F.width,F.height],ut=(0,ve.getGlsl)(this.context.glContext.version),tt=[He[0],He[1]],_e=tt[1],Gt=tt[0],Qt=Math.ceil(he[we-1]/2);let ir=Qt*Math.ceil(he[we-2]/2),Lr="int b, int row, int col",jr=`b * ${ir} + (row / 2) * ${Qt} + (col / 2)`;for(let mr=2;mr{const he=this.context.inputTextureLayouts[F],we=(he.unpackedShape.length>0?he.unpackedShape:he.shape).length;let He=`_${$}`;Me[He]=new te.GlslLibRoutine(this.getValueFromSingle($,we,he.width,he.height,!1),[`shapeUtils.indicesToOffset${He}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),He+="_T",Me[He]=new te.GlslLibRoutine(this.getValueFromSingle($,we,he.width,he.height,!0),[`shapeUtils.indicesToOffset${He}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])}),Me}getValueFromSingle(Me,$,F,he,we){let He=`_${Me}`;return we&&(He+="_T"),` float ${He}(int m[${$}]) { int offset = indicesToOffset${He}(m); vec2 coords = offsetToCoords(offset, ${F}, ${he}); float value = getColorAsFloat(${(0,ve.getGlsl)(this.context.glContext.version).texture2D}(${Me}, coords)); return value; } `}getPackedValueFrom(Me,$,F,he,we){let He=`_${Me}_Pack`;return we&&(He+="_T"),` vec4 ${He}(int m[${$}]) { int offset = indicesToOffset_${Me}(m); vec2 coords = offsetToCoords(offset, ${F}, ${he}); return ${(0,ve.getGlsl)(this.context.glContext.version).texture2D}(${Me}, coords); } `}}M.CoordsGlslLib=Re},8520:(be,M)=>{var V;Object.defineProperty(M,"__esModule",{value:!0}),M.TopologicalSortGlslRoutines=M.GlslLibRoutineNode=M.GlslLibRoutine=M.GlslLib=M.GlslContext=M.FunctionType=void 0,(V=M.FunctionType||(M.FunctionType={}))[V.ValueBased=0]="ValueBased",V[V.Positional=1]="Positional",M.GlslContext=class{constructor(H,te,ve,fe){this.glContext=H,this.programInfo=te,this.inputTextureLayouts=ve,this.outputTextureLayout=fe}},M.GlslLib=class{constructor(H){this.context=H}},M.GlslLibRoutine=class{constructor(H,te){this.routineBody=H,this.dependencies=te}},M.GlslLibRoutineNode=class{constructor(H,te,ve){this.name=H,this.dependencies=ve||[],te&&(this.routineBody=te)}addDependency(H){H&&this.dependencies.push(H)}},M.TopologicalSortGlslRoutines=class{static returnOrderedNodes(H){if(!H||H.length===0)return[];if(H.length===1)return H;const te=new Set,ve=new Set,fe=new Array;return this.createOrderedNodes(H,te,ve,fe),fe}static createOrderedNodes(H,te,ve,fe){for(let Ee=0;Ee0)for(let Re=0;Re{Object.defineProperty(M,"__esModule",{value:!0}),M.EncodingGlslLib=void 0;const H=V(8520);class te extends H.GlslLib{constructor(fe){super(fe)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new H.GlslLibRoutine(`highp vec4 encode(highp float f) { return vec4(f, 0.0, 0.0, 0.0); } `)}}decodeFloat32(){return{decode:new H.GlslLibRoutine(`highp float decode(highp vec4 rgba) { return rgba.r; } `)}}encodeUint8(){const fe=te.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new H.GlslLibRoutine(` highp vec4 encode(highp float f) { highp float F = abs(f); highp float Sign = step(0.0,-f); highp float Exponent = floor(log2(F)); highp float Mantissa = (exp2(- Exponent) * F); Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa)); highp vec4 rgba; rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0)); rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0); rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0))); rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0))); ${fe} rgba = rgba / 255.0; // values need to be normalized to [0,1] return rgba; } `)}}decodeUint8(){const fe=te.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new H.GlslLibRoutine(` highp float decode(highp vec4 rgba) { rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255] ${fe} highp float Sign = 1.0 - step(128.0,rgba[0])*2.0; highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0; highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000); highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 )); return Result; } `)}}static isLittleEndian(){const fe=new ArrayBuffer(4),Ee=new Uint32Array(fe),Re=new Uint8Array(fe);if(Ee[0]=3735928559,Re[0]===239)return!0;if(Re[0]===222)return!1;throw new Error("unknown endianness")}}M.EncodingGlslLib=te},9894:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.FragColorGlslLib=void 0;const H=V(8520),te=V(5060);class ve extends H.GlslLib{constructor(Ee){super(Ee)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const Ee=(0,te.getGlsl)(this.context.glContext.version);return{setFragColor:new H.GlslLibRoutine(` void setFragColor(float value) { ${Ee.output} = encode(value); } `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new H.GlslLibRoutine(` float getColorAsFloat(vec4 color) { return decode(color); } `,["encoding.decode"])}}}M.FragColorGlslLib=ve},2848:(be,M)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.replaceInlines=void 0;const V=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;M.replaceInlines=function(H){const te={};let ve;for(;(ve=V.exec(H))!==null;){const fe=ve[3].split(",").map(Ee=>{const Re=Ee.trim().split(" ");return Re&&Re.length===2?{type:Re[0],name:Re[1]}:null}).filter(Ee=>Ee!==null);te[ve[2]]={params:fe,body:ve[4]}}for(const fe in te){const Ee="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",fe),Re=new RegExp(Ee,"gm");for(;(ve=Re.exec(H))!==null;){const Ce=ve[1],Me=ve[2],$=ve[3].split(","),F=Ce?`${Ce} ${Me};`:"";let he=te[fe].body,we="";te[fe].params.forEach((ut,tt)=>{ut&&(we+=`${ut.type} ${ut.name} = ${$[tt]}; `)}),he=`${we} ${he}`,he=he.replace("return",`${Me} = `);const He=` ${F} { ${he} } `;H=H.replace(ve[0],He)}}return H.replace(V,"")}},8879:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.GlslPreprocessor=void 0;const H=V(8520),te=V(2848),ve=V(5483),fe=V(5060);M.GlslPreprocessor=class{constructor(Ee,Re,Ce,Me){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new H.GlslContext(Ee,Re,Ce,Me),Object.keys(ve.glslRegistry).forEach(F=>{const he=new ve.glslRegistry[F](this.context);this.libs[F]=he});const $=this.glslLibRoutineDependencyGraph;for(const F in this.libs){const he=this.libs[F].getFunctions();for(const we in he){const He=F+"."+we;let ut;$[He]?(ut=$[He],ut.routineBody=he[we].routineBody):(ut=new H.GlslLibRoutineNode(He,he[we].routineBody),$[He]=ut);const tt=he[we].dependencies;if(tt)for(let _e=0;_e{const Me=Ce.split(".")[1];Ee.indexOf(Me)!==-1&&Re.push(this.glslLibRoutineDependencyGraph[Ce])}),H.TopologicalSortGlslRoutines.returnOrderedNodes(Re)}getUniforms(Ee,Re){const Ce=[];if(Ee)for(const Me of Ee)Ce.push(`uniform sampler2D ${Me};`);if(Re)for(const Me of Re)Ce.push(`uniform ${Me.type} ${Me.name}${Me.arrayLength?`[${Me.arrayLength}]`:""};`);return Ce.join(` `)}}},5483:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.glslRegistry=void 0;const H=V(5107),te=V(7341),ve=V(9894),fe=V(2655),Ee=V(3891);M.glslRegistry={encoding:te.EncodingGlslLib,fragcolor:ve.FragColorGlslLib,vec:Ee.VecGlslLib,shapeUtils:fe.ShapeUtilsGlslLib,coordinates:H.CoordsGlslLib}},2655:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.ShapeUtilsGlslLib=void 0;const H=V(8520);class te extends H.GlslLib{constructor(fe){super(fe)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const fe=this.context.outputTextureLayout.shape.length,Ee={};return this.context.programInfo.inputNames.forEach((Re,Ce)=>{const Me=this.context.inputTextureLayouts[Ce].unpackedShape;if(Me.length<=fe){const $=Me.length,F=fe-$,he=`bcastIndices_${Re}`;let we="";for(let ut=0;ut<$;++ut)we+=` realIndices[${ut}] = int( mod(float(bcastedIndices[${F+ut}]), ${Me[ut]}.0) ); `;const He=` void ${he} (int bcastedIndices[${fe}], out int realIndices[${$}]) { ${we} } `;Ee[he]=new H.GlslLibRoutine(He)}}),Ee}bcastMatmulIndex(){const fe=this.context.outputTextureLayout.shape.length,Ee={};return this.context.programInfo.inputNames.forEach((Re,Ce)=>{const Me=this.context.inputTextureLayouts[Ce].shape;if(!(Me.length<2||Me.length>fe)){const $=Me.length,F=fe-$,he=`bcastMatmulIndices_${Re}`;let we="";for(let ut=0;ut<$-2;++ut)we+=` realIndices[${ut}] = int( mod(float(bcastedIndices[${F+ut}]), ${Me[ut]}.0) ); `;const He=` void ${he}(int bcastedIndices[${fe}], out int realIndices[${$}]) { ${we} realIndices[${$-1}] = bcastedIndices[${fe-1}]; realIndices[${$-2}] = bcastedIndices[${fe-2}]; } `;Ee[he]=new H.GlslLibRoutine(He)}}),Ee}indicesToOffset(){const fe={};return this.context.programInfo.inputNames.forEach((Ee,Re)=>{const Ce=this.context.inputTextureLayouts[Re].shape,Me=this.context.inputTextureLayouts[Re].strides,$=Ce.length;let F=`indicesToOffset_${Ee}`;fe[F]=new H.GlslLibRoutine(te.indexToOffsetSingle(F,$,Me)),F=`indicesToOffset_${Ee}_T`,fe[F]=new H.GlslLibRoutine(te.indexToOffsetSingle(F,$,Me.slice().reverse()))}),fe}static indexToOffsetSingle(fe,Ee,Re){let Ce="";for(let Me=Ee-1;Me>=0;--Me)Ce+=` offset += indices[${Me}] * ${Re[Me]}; `;return` int ${fe}(int indices[${Ee}]) { int offset = 0; ${Ce} return offset; } `}offsetToIndices(){const fe={};return this.context.programInfo.inputNames.forEach((Ee,Re)=>{const Ce=this.context.inputTextureLayouts[Re].shape,Me=this.context.inputTextureLayouts[Re].strides,$=Ce.length;let F=`offsetToIndices_${Ee}`;fe[F]=new H.GlslLibRoutine(te.offsetToIndicesSingle(F,$,Me)),F=`offsetToIndices_${Ee}_T`,fe[F]=new H.GlslLibRoutine(te.offsetToIndicesSingle(F,$,Me.slice().reverse()))}),fe}static offsetToIndicesSingle(fe,Ee,Re){const Ce=[];for(let Me=0;Me{const Ce=this.context.inputTextureLayouts[Re].shape,Me=Ce.length,$=`incrementIndices_${Ee}`;let F="";for(let we=0;we= 0; --i) { if(i > axis) continue; indices[i] += 1; if(indices[i] < shape[i]) { break; } indices[i] = 0; } } `;fe[$]=new H.GlslLibRoutine(he)}),fe}}M.ShapeUtilsGlslLib=te},5060:(be,M)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.getDefaultFragShaderMain=M.getFragShaderPreamble=M.getVertexShaderSource=M.getGlsl=void 0;const V={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},H={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function te(ve){return ve===1?V:H}M.getGlsl=te,M.getVertexShaderSource=function(ve){const fe=te(ve);return`${fe.version} precision highp float; ${fe.attribute} vec3 position; ${fe.attribute} vec2 textureCoord; ${fe.varyingVertex} vec2 TexCoords; void main() { gl_Position = vec4(position, 1.0); TexCoords = textureCoord; }`},M.getFragShaderPreamble=function(ve){const fe=te(ve);return`${fe.version} precision highp float; precision highp int; precision highp sampler2D; ${fe.varyingFrag} vec2 TexCoords; ${fe.outputDeclaration} const vec2 halfCR = vec2(0.5, 0.5); // Custom vector types to handle higher dimenalities. struct ivec5 { int x; int y; int z; int w; int u; }; struct ivec6 { int x; int y; int z; int w; int u; int v; }; int imod(int x, int y) { return x - y * (x / y); } `},M.getDefaultFragShaderMain=function(ve,fe){return` void main() { int indices[${fe}]; toVec(TexCoords, indices); vec4 result = vec4(process(indices)); ${te(ve).output} = result; } `}},3891:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.VecGlslLib=void 0;const H=V(8520);class te extends H.GlslLib{constructor(fe){super(fe)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const fe=this.context.outputTextureLayout.shape.length,Ee={add:"+=",sub:"-=",mul:"*=",div:"/="},Re={};for(const Ce in Ee){const Me=`${Ce}Vec`;let $="";for(let he=0;he{Object.defineProperty(M,"__esModule",{value:!0}),M.WebGLInferenceHandler=void 0;const H=V(6231),te=V(9162),ve=V(2517),fe=V(2403),Ee=V(7019),Re=V(8710),Ce=V(5611),Me=V(4057),$=V(2039);M.WebGLInferenceHandler=class{constructor(F){this.session=F,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(F,he){return(0,Me.calculateTextureWidthAndHeight)(this.session.layoutStrategy,F,he)}executeProgram(F,he){if(he.length{const Lr=ir.map(tn=>`${tn.unpackedShape.join(",")};${tn.width}x${tn.height}`).join("_");let jr=Qt.name;return Qt.cacheHint&&(jr+="["+Qt.cacheHint+"]"),jr+=":"+Lr,jr})(F,we);let ut=this.session.programManager.getArtifact(He);const tt=ut?ut.programInfo:typeof F.get=="function"?F.get():F,_e=(0,Me.createTextureLayoutFromTextureType)(this.session.layoutStrategy,tt.output.dims,tt.output.textureType),Gt=this.createTextureData(_e,tt.output.type);return ut||(ut=this.session.programManager.build(tt,we,Gt),this.session.programManager.setArtifact(He,ut)),this.runProgram(ut,we,Gt),Gt}run(F,he){return this.executeProgram(F,he).tensor}runProgram(F,he,we){for(let He=0;Hethis.readTexture(tt),async _e=>this.readTextureAsync(tt),void 0,ut),texture:we});return this.setTextureData(tt.tensor.dataId,tt,F.isPacked),tt}getTextureData(F,he=!1){return this.session.isInitializer(F)?this.session.getTextureData(F,he):he?this.packedTextureDataCache.get(F):this.unpackedTextureDataCache.get(F)}setTextureData(F,he,we=!1){this.session.isInitializer(F)?this.session.setTextureData(F,he,we):(we?this.packedTextureDataCache:this.unpackedTextureDataCache).set(F,he)}isTextureLayoutCached(F,he=!1){return!!this.getTextureData(F.dataId,he)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(F=>this.session.textureManager.releaseTexture(F)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(F=>this.session.textureManager.releaseTexture(F)),this.unpackedTextureDataCache=new Map}readTexture(F){return F.isPacked?this.readTexture(this.unpack(F)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(F,F.tensor.type,F.channels):this.session.textureManager.readUint8TextureAsFloat((0,Re.encodeAsUint8)(this,F))}async readTextureAsync(F){return F.isPacked?this.readTextureAsync(this.unpack(F)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(F,F.tensor.type,F.channels):this.session.textureManager.readUint8TextureAsFloat((0,Re.encodeAsUint8)(this,F))}pack(F){return this.executeProgram((0,fe.createPackProgramInfoLoader)(this,F.tensor),[F.tensor])}unpack(F){return this.executeProgram((0,Ce.createUnpackProgramInfoLoader)(this,F.tensor),[F.tensor])}}},1640:function(be,M,V){var H=this&&this.__createBinding||(Object.create?function(ji,Fo,Qo,Sl){Sl===void 0&&(Sl=Qo);var Hs=Object.getOwnPropertyDescriptor(Fo,Qo);Hs&&!("get"in Hs?!Fo.__esModule:Hs.writable||Hs.configurable)||(Hs={enumerable:!0,get:function(){return Fo[Qo]}}),Object.defineProperty(ji,Sl,Hs)}:function(ji,Fo,Qo,Sl){Sl===void 0&&(Sl=Qo),ji[Sl]=Fo[Qo]}),te=this&&this.__setModuleDefault||(Object.create?function(ji,Fo){Object.defineProperty(ji,"default",{enumerable:!0,value:Fo})}:function(ji,Fo){ji.default=Fo}),ve=this&&this.__importStar||function(ji){if(ji&&ji.__esModule)return ji;var Fo={};if(ji!=null)for(var Qo in ji)Qo!=="default"&&Object.prototype.hasOwnProperty.call(ji,Qo)&&H(Fo,ji,Qo);return te(Fo,ji),Fo};Object.defineProperty(M,"__esModule",{value:!0}),M.WEBGL_OP_RESOLVE_RULES=void 0;const fe=V(2898),Ee=ve(V(7839)),Re=V(4196),Ce=V(2069),Me=V(8138),$=V(9663),F=V(5193),he=V(7992),we=V(1253),He=V(4776),ut=V(6572),tt=V(3346),_e=V(5623),Gt=V(2870),Qt=V(2143),ir=V(4939),Lr=V(718),jr=V(2268),tn=V(8117),mr=V(2278),Ir=V(5524),On=V(5975),ba=V(3933),ra=V(6558),jn=V(5723),qn=V(3738),Un=ve(V(4909)),pa=V(8428),lo=V(9793);M.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",Un.abs],["Acos","","7+",Un.acos],["Add","","7+",Ee.add],["And","","7+",Ee.and],["Asin","","7+",Un.asin],["Atan","","7+",Un.atan],["AveragePool","","7+",Qt.averagePool,Qt.parseAveragePoolAttributes],["BatchNormalization","","7+",fe.batchNormalization,fe.parseBatchNormalizationAttributes],["Cast","","6+",Re.cast,Re.parseCastAttributes],["Ceil","","6+",Un.ceil],["Clip","","6-10",Un.clip,Un.parseClipAttributes],["Clip","","11+",Un.clipV11],["Concat","","4+",Ce.concat,Ce.parseConcatAttributes],["Conv","","1+",Me.conv,Me.parseConvAttributes],["ConvTranspose","","1+",$.convTranspose,$.parseConvTransposeAttributes],["Cos","","7+",Un.cos],["Div","","7+",Ee.div],["Dropout","","7+",Un.identity],["DepthToSpace","","1+",F.depthToSpace,F.parseDepthToSpaceAttributes],["Equal","","7+",Ee.equal],["Elu","","6+",Un.elu,Un.parseEluAttributes],["Exp","","6+",Un.exp],["Flatten","","1+",he.flatten,he.parseFlattenAttributes],["Floor","","6+",Un.floor],["FusedConv","com.microsoft","1+",Me.conv,Me.parseConvAttributes],["Gather","","1+",we.gather,we.parseGatherAttributes],["Gemm","","7-10",He.gemm,He.parseGemmAttributesV7],["Gemm","","11+",He.gemm,He.parseGemmAttributesV11],["GlobalAveragePool","","1+",Qt.globalAveragePool,Qt.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",Qt.globalMaxPool],["Greater","","7+",Ee.greater],["Identity","","1+",Un.identity],["ImageScaler","","1+",ut.imageScaler,ut.parseImageScalerAttributes],["InstanceNormalization","","6+",tt.instanceNormalization,tt.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",Un.leakyRelu,Un.parseLeakyReluAttributes],["Less","","7+",Ee.less],["Log","","6+",Un.log],["MatMul","","1+",_e.matMul,_e.parseMatMulAttributes],["MaxPool","","1+",Qt.maxPool,Qt.parseMaxPoolAttributes],["Mul","","7+",Ee.mul],["Neg","","6+",Un.neg],["Not","","1+",Un.not],["Or","","7+",Ee.or],["Pad","","2-10",Gt.padV2,Gt.parsePadAttributesV2],["Pad","","11+",Gt.padV11,Gt.parsePadAttributesV11],["Pow","","7+",Ee.pow],["PRelu","","7+",Ee.pRelu],["ReduceLogSum","","1+",ir.reduceLogSum,ir.parseReduceAttributes],["ReduceMax","","1+",ir.reduceMax,ir.parseReduceAttributes],["ReduceMean","","1+",ir.reduceMean,ir.parseReduceAttributes],["ReduceMin","","1+",ir.reduceMin,ir.parseReduceAttributes],["ReduceProd","","1+",ir.reduceProd,ir.parseReduceAttributes],["ReduceSum","","1-12",ir.reduceSum,ir.parseReduceAttributes],["ReduceSumSquare","","1+",ir.reduceLogSumSquare,ir.parseReduceAttributes],["Relu","","6+",Un.relu],["Reshape","","5+",Lr.reshape],["Resize","","10",jr.resize,jr.parseResizeAttributesV10],["Resize","","11+",jr.resize,jr.parseResizeAttributesV11],["Shape","","1+",tn.shape],["Sigmoid","","6+",Un.sigmoid],["Sin","","7+",Un.sin],["Slice","","10+",mr.sliceV10],["Slice","","1-9",mr.slice,mr.parseSliceAttributes],["Softmax","","1-12",Ir.softmax,Ir.parseSoftmaxAttributes],["Softmax","","13+",Ir.softmaxV13,Ir.parseSoftmaxAttributesV13],["Split","","2-12",On.split,On.parseSplitAttributes],["Sqrt","","6+",Un.sqrt],["Squeeze","","1-12",ba.squeeze,ba.parseSqueezeAttributes],["Squeeze","","13+",ba.squeezeV13],["Sub","","7+",Ee.sub],["Sum","","6+",ra.sum],["Tan","","7+",Un.tan],["Tanh","","6+",Un.tanh],["Tile","","6+",jn.tile],["Transpose","","1+",qn.transpose,qn.parseTransposeAttributes],["Upsample","","7-8",lo.upsample,lo.parseUpsampleAttributesV7],["Upsample","","9",lo.upsample,lo.parseUpsampleAttributesV9],["Unsqueeze","","1-12",pa.unsqueeze,pa.parseUnsqueezeAttributes],["Unsqueeze","","13+",pa.unsqueezeV13],["Xor","","7+",Ee.xor]]},2898:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseBatchNormalizationAttributes=M.batchNormalization=void 0;const H=V(246),te=V(5060),ve=V(2039),fe={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[ve.TextureType.unpacked,ve.TextureType.unpacked,ve.TextureType.unpacked,ve.TextureType.unpacked,ve.TextureType.unpacked]};M.batchNormalization=(Ce,Me,$)=>(Re(Me),[Ce.run(Object.assign(Object.assign({},fe),{cacheHint:$.cacheKey,get:()=>Ee(Ce,Me,$)}),Me)]),M.parseBatchNormalizationAttributes=Ce=>{const Me=Ce.attributes.getFloat("epsilon",1e-5),$=Ce.attributes.getFloat("momentum",.9),F=Ce.attributes.getInt("spatial",1);return(0,H.createAttributeWithCacheKey)({epsilon:Me,momentum:$,spatial:F})};const Ee=(Ce,Me,$)=>{const F=(0,te.getGlsl)(Ce.session.backend.glContext.version),he=Me[0].dims.length,[we,He]=Ce.calculateTextureWidthAndHeight(Me[1].dims,ve.TextureType.unpacked),ut=` float process(int[${he}] indices) { vec2 position = offsetToCoords(indices[1], ${we}, ${He}); float scale = getColorAsFloat(${F.texture2D}(Scale, position)); float mean = getColorAsFloat(${F.texture2D}(Mean, position)); float variance = getColorAsFloat(${F.texture2D}(Variance, position)); float b = getColorAsFloat(${F.texture2D}(B, position)); return scale * ( (_A(indices) - mean) / sqrt(variance + float(${$.epsilon})) ) + b; }`;return Object.assign(Object.assign({},fe),{output:{dims:Me[0].dims,type:Me[0].type,textureType:ve.TextureType.unpacked},shaderSource:ut})},Re=Ce=>{if(!Ce||Ce.length!==5)throw new Error("BatchNormalization requires 5 inputs.");const Me=Ce[0],$=Ce[1],F=Ce[2],he=Ce[3],we=Ce[4];if(Me.dims.length<3||$.dims.length!==1||F.dims.length!==1||he.dims.length!==1||we.dims.length!==1)throw new Error("invalid input shape.");if($.dims[0]!==Me.dims[1]||F.dims[0]!==Me.dims[1]||he.dims[0]!==Me.dims[1]||we.dims[0]!==Me.dims[1])throw new Error("invalid input shape.");if(Me.type!=="float32"&&Me.type!=="float64"||$.type!=="float32"&&$.type!=="float64"||F.type!=="float32"&&F.type!=="float64"||he.type!=="float32"&&he.type!=="float64"||we.type!=="float32"&&we.type!=="float64")throw new Error("invalid input tensor types.")}},7839:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.xor=M.sub=M.pRelu=M.pow=M.or=M.mul=M.less=M.greater=M.equal=M.div=M.and=M.add=M.glslPRelu=M.glslPow=M.glslXor=M.glslOr=M.glslAnd=M.glslLess=M.glslGreater=M.glslEqual=M.glslSub=M.glslMul=M.glslDiv=M.glslAdd=void 0;const H=V(2517),te=V(8520),ve=V(5060),fe=V(2039);function Ee(){const ir="add_";return{body:` float ${ir}(float a, float b) { return a + b; } vec4 ${ir}(vec4 v1, vec4 v2) { return v1 + v2; } `,name:ir,type:te.FunctionType.ValueBased}}function Re(){const ir="div_";return{body:` float ${ir}(float a, float b) { return a / b; } vec4 ${ir}(vec4 v1, vec4 v2) { return v1 / v2; } `,name:ir,type:te.FunctionType.ValueBased}}function Ce(){const ir="mul_";return{body:` float ${ir}(float a, float b) { return a * b; } vec4 ${ir}(vec4 v1, vec4 v2) { return v1 * v2; } `,name:ir,type:te.FunctionType.ValueBased}}function Me(){const ir="sub_";return{body:` float ${ir}(float a, float b) { return a - b; } vec4 ${ir}(vec4 v1, vec4 v2) { return v1 - v2; } `,name:ir,type:te.FunctionType.ValueBased}}function $(){const ir="equal_";return{body:` float ${ir}(float a, float b) { return float(a == b); } vec4 ${ir}(vec4 v1, vec4 v2) { return vec4(equal(v1, v2)); } `,name:ir,type:te.FunctionType.ValueBased}}function F(){const ir="greater_";return{body:` float ${ir}(float a, float b) { return float(a > b); } vec4 ${ir}(vec4 v1, vec4 v2) { return vec4( v1.r > v2.r , v1.g > v2.g, v1.b > v2.b, v1.a > v2.a ); } `,name:ir,type:te.FunctionType.ValueBased}}function he(){const ir="less_";return{body:` float ${ir}(float a, float b) { return float(a < b); } vec4 ${ir}(vec4 v1, vec4 v2) { return vec4( v1.r < v2.r , v1.g < v2.g, v1.b < v2.b, v1.a < v2.a ); } `,name:ir,type:te.FunctionType.ValueBased}}function we(){const ir="and_";return{body:` float ${ir}(float a, float b) { return float( bool(a) && bool(b) ); } vec4 ${ir}(vec4 v1, vec4 v2) { bvec4 b1 = bvec4(v1); bvec4 b2 = bvec4(v2); return vec4( b1.r && b2.r , b1.g && b2.g, b1.b && b2.b, b1.a && b2.a ); } `,name:ir,type:te.FunctionType.ValueBased}}function He(){const ir="or_";return{body:` float ${ir}(float a, float b) { return float( bool(a) || bool(b) ); } vec4 ${ir}(vec4 v1, vec4 v2) { bvec4 b1 = bvec4(v1); bvec4 b2 = bvec4(v2); return vec4( b1.r || b2.r , b1.g || b2.g, b1.b || b2.b, b1.a || b2.a ); } `,name:ir,type:te.FunctionType.ValueBased}}function ut(){const ir="xor_";return{body:` float ${ir}(float a, float b) { return float( bool(a) ^^ bool(b) ); } vec4 ${ir}(vec4 v1, vec4 v2) { bvec4 b1 = bvec4(v1); bvec4 b2 = bvec4(v2); return vec4( b1.r ^^ b2.r , b1.g ^^ b2.g, b1.b ^^ b2.b, b1.a ^^ b2.a ); } `,name:ir,type:te.FunctionType.ValueBased}}function tt(){return function(ir){const Lr=`${ir}_`;return{body:` float ${Lr}(float a, float b) { return ${ir}(a, b); } vec4 ${Lr}(vec4 v1, vec4 v2) { return ${ir}(v1, v2); } `,name:Lr,type:te.FunctionType.ValueBased}}("pow")}function _e(){const ir="prelu_";return{body:` float ${ir}(float a, float b) { return a < 0.0 ? a * b: a; } vec4 ${ir}(vec4 v1, vec4 v2) { return vec4( v1.r < 0.0 ? v1.r * v2.r: v1.r, v1.g < 0.0 ? v1.g * v2.g: v1.g, v1.b < 0.0 ? v1.b * v2.b: v1.b, v1.a < 0.0 ? v1.a * v2.a: v1.a ); } `,name:ir,type:te.FunctionType.ValueBased}}M.glslAdd=Ee,M.glslDiv=Re,M.glslMul=Ce,M.glslSub=Me,M.glslEqual=$,M.glslGreater=F,M.glslLess=he,M.glslAnd=we,M.glslOr=He,M.glslXor=ut,M.glslPow=tt,M.glslPRelu=_e;const Gt=(ir,Lr,jr,tn=Lr[0].type,mr)=>{const Ir=ir.session.pack?fe.TextureType.packed:fe.TextureType.unpacked;return{name:jr.name,inputNames:["A","B"],inputTypes:[Ir,Ir],cacheHint:mr,get:()=>Qt(ir,Lr,jr,tn)}},Qt=(ir,Lr,jr,tn=Lr[0].type)=>{const mr=ir.session.pack?fe.TextureType.packed:fe.TextureType.unpacked,Ir=!H.ShapeUtil.areEqual(Lr[0].dims,Lr[1].dims);let On=Lr[0].dims;const ba=ir.session.pack;if(Ir){const qn=H.BroadcastUtil.calcShape(Lr[0].dims,Lr[1].dims,!1);if(!qn)throw new Error("Can't perform binary op on the given tensors");On=qn;const Un=On.length,pa=Lr[0].dims.length!==0?Lr[0].dims.length:1,lo=Lr[1].dims.length!==0?Lr[1].dims.length:1,ji=Lr[0].dims.length!==0?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",Fo=Lr[1].dims.length!==0?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",Qo=(0,ve.getGlsl)(ir.session.backend.glContext.version),Sl=ba?` ${jr.body} void main() { vec4 a = getAAtOutCoords(); vec4 b = getBAtOutCoords(); vec4 result = ${jr.name}(a, b); ${Qo.output} = result; }`:` ${jr.body} float process(int indices[${Un}]) { int aindices[${pa}]; int bindices[${lo}]; ${ji} ${Fo} return ${jr.name}(_A(aindices), _B(bindices)); }`;return{name:jr.name,inputNames:["A","B"],inputTypes:[mr,mr],output:{dims:On,type:tn,textureType:mr},shaderSource:Sl,hasMain:ba}}const ra=(0,ve.getGlsl)(ir.session.backend.glContext.version),jn=` ${jr.body} void main() { vec4 v1 = ${ra.texture2D}(A, TexCoords); vec4 v2 = ${ra.texture2D}(B, TexCoords); vec4 result = ${jr.name}(v1, v2); ${ra.output} = result; } `;return{name:jr.name,inputNames:["A","B"],inputTypes:[mr,mr],output:{dims:Lr[0].dims,type:tn,textureType:mr},shaderSource:jn,hasMain:!0}};M.add=(ir,Lr)=>[ir.run(Gt(ir,Lr,Ee()),Lr)],M.and=(ir,Lr)=>[ir.run(Gt(ir,Lr,we(),"bool"),Lr)],M.div=(ir,Lr)=>[ir.run(Gt(ir,Lr,Re()),Lr)],M.equal=(ir,Lr)=>[ir.run(Gt(ir,Lr,$(),"bool"),Lr)],M.greater=(ir,Lr)=>[ir.run(Gt(ir,Lr,F(),"bool"),Lr)],M.less=(ir,Lr)=>[ir.run(Gt(ir,Lr,he(),"bool"),Lr)],M.mul=(ir,Lr)=>[ir.run(Gt(ir,Lr,Ce()),Lr)],M.or=(ir,Lr)=>[ir.run(Gt(ir,Lr,He(),"bool"),Lr)],M.pow=(ir,Lr)=>[ir.run(Gt(ir,Lr,tt()),Lr)],M.pRelu=(ir,Lr)=>[ir.run(Gt(ir,Lr,_e()),Lr)],M.sub=(ir,Lr)=>[ir.run(Gt(ir,Lr,Me()),Lr)],M.xor=(ir,Lr)=>[ir.run(Gt(ir,Lr,ut(),"bool"),Lr)]},4196:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseCastAttributes=M.cast=void 0;const H=V(2517);M.cast=(ve,fe,Ee)=>(te(fe),[ve.cast(fe[0],Ee)]),M.parseCastAttributes=ve=>H.ProtoUtil.tensorDataTypeFromProto(ve.attributes.getInt("to"));const te=ve=>{if(!ve||ve.length!==1)throw new Error("Cast requires 1 input.");if(ve[0].type==="string")throw new Error("Invalid input type.")}},1163:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.createPackedConcatProgramInfoLoader=void 0;const H=V(5060),te=V(2039),ve=V(9390),fe=V(2827);M.createPackedConcatProgramInfoLoader=(Re,Ce,Me)=>{const $=(F=Ce.length,he=Me.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:F},(we,He)=>`X${He}`),inputTypes:Array(F).fill(te.TextureType.packed),cacheHint:he});var F,he;return Object.assign(Object.assign({},$),{get:()=>((we,He,ut,tt)=>{const _e=ut[0].dims.slice();if(tt>=_e.length||tt<-1*_e.length)throw new Error("axis specified for concat doesn't match input dimensionality");tt<0&&(tt=_e.length+tt);const Gt=_e.slice(0);for(let ji=1;jiji.dims),mr=(0,ve.getGlChannels)(Qt),Ir=new Array(tn.length-1);Ir[0]=tn[0][tt];for(let ji=1;ji= ${Ir[ji-1]}) { return getChannel( getX${ji}(${Ee(mr,On,Fo)}), vec2(${Ee(ba,On,Fo)})); }`}const qn=Ir.length,Un=Ir[Ir.length-1];jn+=` return getChannel( getX${qn}(${Ee(mr,On,Un)}), vec2(${Ee(ba,On,Un)}));`;const pa=(0,H.getGlsl)(we.session.backend.glContext.version),lo=` ${jr} float getValue(${mr.map(ji=>"int "+ji)}) { ${jn} } void main() { ${Lr} coords = getOutputCoords(); int lastDim = coords.${mr[Qt-1]}; coords.${mr[Qt-1]} = coords.${mr[Qt-2]}; coords.${mr[Qt-2]} = lastDim; vec4 result = vec4(getValue(${ir}), 0., 0., 0.); ${ir[Qt-1]} = ${ir[Qt-1]} + 1; if (${ir[Qt-1]} < ${Gt[Qt-1]}) { result.g = getValue(${ir}); } ${ir[Qt-2]} = ${ir[Qt-2]} + 1; if (${ir[Qt-2]} < ${Gt[Qt-2]}) { result.a = getValue(${ir}); } ${ir[Qt-1]} = ${ir[Qt-1]} - 1; if (${ir[Qt-2]} < ${Gt[Qt-2]} && ${ir[Qt-1]} < ${Gt[Qt-1]}) { result.b = getValue(${ir}); } ${pa.output} = result; } `;return Object.assign(Object.assign({},He),{output:{dims:Gt,type:ut[0].type,textureType:te.TextureType.packed},shaderSource:lo,hasMain:!0})})(Re,$,Ce,Me.axis)})};const Ee=(Re,Ce,Me)=>{const $=Re.indexOf(Ce);return Re.map((F,he)=>he===$?`${F} - ${Me}`:F).join()}},2069:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseConcatAttributes=M.concat=void 0;const H=V(246),te=V(2039),ve=V(1163);M.concat=(F,he,we)=>($(he),F.session.pack&&he[0].dims.length>1?[F.run((0,ve.createPackedConcatProgramInfoLoader)(F,he,we),he)]:[F.run(fe(F,he,we),he)]);const fe=(F,he,we)=>{const He=(ut=he.length,tt=we.cacheKey,{name:"Concat",inputNames:Array.from({length:ut},(_e,Gt)=>`X${Gt}`),inputTypes:Array(ut).fill(te.TextureType.unpacked),cacheHint:tt});var ut,tt;return Object.assign(Object.assign({},He),{get:()=>((_e,Gt,Qt,ir)=>{const Lr=Qt[0].dims.slice();if(ir>=Lr.length||ir<-1*Lr.length)throw new Error("axis specified for concat doesn't match input dimensionality");ir<0&&(ir=Lr.length+ir);const jr=Lr.slice(0);for(let ra=1;ra`int getTextureWhereDataResides(int index) { ${F.map((he,we)=>`if(index<${he}) {return ${we};} `).join("")} }`,Re=F=>Ee(F),Ce=(F,he)=>{const we=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${he}]) {`];for(let He=0;He{const he=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let we=0;we(0,H.createAttributeWithCacheKey)({axis:F.attributes.getInt("axis")});const $=F=>{if(!F||F.length<1)throw new Error("too few inputs");const he=F[0].type,we=F[0].dims.length;if(he==="string")throw new Error("string tensor is not supported yet");for(const He of F){if(He.type!==he)throw new Error("input tensors should be one type");if(He.dims.length!==we)throw new Error("input tensors should have the same shape")}}},4770:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.createUnpackedGroupedConvProgramInfoLoader=void 0;const H=V(6231),te=V(5060),ve=V(2039),fe=V(8138),Ee=V(2823);M.createUnpackedGroupedConvProgramInfoLoader=(Re,Ce,Me)=>{const $=(F=Ce.length>2,he=Me.cacheKey,{name:"GroupedConv",inputNames:F?["X","W","Bias"]:["X","W"],inputTypes:F?[ve.TextureType.unpacked,ve.TextureType.unpacked,ve.TextureType.unpacked]:[ve.TextureType.unpacked,ve.TextureType.unpacked],cacheHint:he});var F,he;return Object.assign(Object.assign({},$),{get:()=>((we,He,ut,tt)=>{const _e=He.length>2?"value += getBias(output_channel);":"",Gt=He[0].dims.slice(),Qt=He[1].dims.slice(),ir=Qt[0]/tt.group;H.Logger.verbose("GroupedConv",`autpPad:${tt.autoPad}, dilations:${tt.dilations}, group:${tt.group}, kernelShape:${tt.kernelShape}, pads:${tt.pads}, strides:${tt.strides}`);const Lr=(0,fe.calculateOutputShape)(Gt,Qt,tt.dilations,tt.pads,tt.strides),jr=(0,te.getGlsl)(we.session.backend.glContext.version),{activationFunction:tn,applyActivation:mr}=(0,Ee.getActivationSnippet)(tt),Ir=` const ivec2 strides = ivec2(${tt.strides[0]}, ${tt.strides[1]}); const ivec2 pads = ivec2(${tt.pads[0]}, ${tt.pads[1]}); ${tn} void main() { ivec4 coords = getOutputCoords(); int batch = coords.x; int output_channel = coords.y; ivec2 xRCCorner = coords.zw * strides - pads; int group_id = output_channel / ${ir}; float value = 0.0; for (int wInChannel = 0; wInChannel < ${Qt[1]}; wInChannel++) { int input_channel = group_id * ${Qt[1]} + wInChannel; for (int wHeight = 0; wHeight < ${Qt[2]}; wHeight++) { int xHeight = xRCCorner.x + wHeight * ${tt.dilations[0]}; if (xHeight < 0 || xHeight >= ${Gt[2]}) { continue; } for (int wWidth = 0; wWidth < ${Qt[3]}; wWidth++) { int xWidth = xRCCorner.y + wWidth * ${tt.dilations[1]}; if (xWidth < 0 || xWidth >= ${Gt[3]}) { continue; } float xVal = getX(batch, input_channel, xWidth, xHeight); float wVal = getW(output_channel, wInChannel, wWidth, wHeight); value += xVal*wVal; } } } ${_e} ${mr} ${jr.output} = vec4(value, .0, .0, .0); } `;return Object.assign(Object.assign({},ut),{output:{dims:Lr,type:He[0].type,textureType:ve.TextureType.unpacked},shaderSource:Ir,hasMain:!0})})(Re,Ce,$,Me)})}},1386:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.conv2DPacked=M.conv2DPackedPointwise=void 0;const H=V(8138),te=V(8555),ve=V(708);M.conv2DPackedPointwise=(fe,Ee,Re)=>{const Ce=Ee[0].dims,Me=Ee[1].dims,$=(0,H.calculateOutputShape)(Ce,Me,Re.dilations,Re.pads,Re.strides),F=fe.reshapePacked(Ee[0],[Ce[1],Ce[2]*Ce[3]]),he=fe.reshapePacked(Ee[1],[Me[0],Me[1]]),we=Ee.length>2?[he,F,Ee[2]]:[he,F],He=fe.run((0,ve.createPackedMatmulProgramInfoLoader)(fe,we,Re),we);return fe.reshapePacked(He,$)},M.conv2DPacked=(fe,Ee,Re)=>{const Ce=Ee[0].dims,Me=Ee[1].dims,$=(0,H.calculateOutputShape)(Ce,Me,Re.dilations,Re.pads,Re.strides),F=fe.run((0,te.createPackedIm2ColProgramInfoLoader)(fe,Ee[0],Ee[1],$,Re),[Ee[0]]),he=fe.reshapePacked(Ee[1],[Me[0],Me[1]*Me[2]*Me[3]]),we=Ee.length===3?[he,F,Ee[2]]:[he,F],He=fe.run((0,ve.createPackedMatmulProgramInfoLoader)(fe,we,Re),we);return fe.reshapePacked(He,$)}},9663:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseConvTransposeAttributes=M.convTranspose=void 0;const H=V(246),te=V(5060),ve=V(2039),fe=V(2823),Ee=(he,we,He,ut,tt,_e)=>(he-1)*we+He+(ut-1)*tt+1-_e,Re=(he,we,He,ut,tt)=>{const _e=Math.floor(he/2);we==="SAME_UPPER"?(He[ut]=_e,He[tt]=he-_e):we==="SAME_LOWER"&&(He[ut]=he-_e,He[tt]=_e)};M.convTranspose=(he,we,He)=>(F(we,He),Ce(he,we,He));const Ce=(he,we,He)=>{const ut=$(He,we);return[Me(he,we,ut)]},Me=(he,we,He)=>he.run(((ut,tt,_e)=>{const Gt=(Qt=tt.length>2,ir=_e.cacheKey,{name:"ConvTranspose",inputNames:Qt?["X","W","B"]:["X","W"],inputTypes:Qt?[ve.TextureType.unpacked,ve.TextureType.unpacked,ve.TextureType.unpacked]:[ve.TextureType.unpacked,ve.TextureType.unpacked],cacheHint:ir});var Qt,ir;return Object.assign(Object.assign({},Gt),{get:()=>((Lr,jr,tn,mr)=>{const Ir=jr.length>2?"getB(output_channel)":"0.0",On=jr[0].dims,ba=jr[1].dims,ra=ba[1],jn=ba[0]/mr.group,qn=[jr[0].dims[0],jr[1].dims[1]*mr.group,...mr.outputShape],Un=(0,te.getGlsl)(Lr.session.backend.glContext.version),{activationFunction:pa,applyActivation:lo}=(0,fe.getActivationSnippet)(mr),ji=` const ivec2 strides = ivec2(${mr.strides[0]}, ${mr.strides[1]}); const ivec2 pads = ivec2(${mr.pads[0]}, ${mr.pads[1]}); ${pa} void main() { ivec4 coords = getOutputCoords(); int batch = coords.x; int output_channel = coords.y; ivec2 loc = coords.zw + pads; int group_id = output_channel / ${ra}; int wOutChannel = output_channel - group_id * ${ra}; float value = ${Ir}; for (int inChannelOffset = 0; inChannelOffset < ${jn}; inChannelOffset++) { int input_channel = group_id * ${jn} + inChannelOffset; for (int wWOff = 0; wWOff < ${ba[2]}; wWOff++) { for (int wHOff = 0; wHOff < ${ba[3]}; wHOff++) { ivec2 wOff = ivec2(wWOff * ${mr.dilations[0]}, wHOff * ${mr.dilations[1]}); ivec2 wLoc = loc - wOff; ivec2 wLocIn = wLoc / strides; if ( wLocIn * strides == wLoc && wLocIn.x >= 0 && wLocIn.x < ${On[2]} && wLocIn.y >= 0 && wLocIn.y < ${On[3]} ) { float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x); float wVal = getW(input_channel, wOutChannel, wHOff, wWOff); value += xVal * wVal; } } } } ${lo} ${Un.output} = vec4(value, .0, .0, .0); } `;return Object.assign(Object.assign({},tn),{output:{dims:qn,type:jr[0].type,textureType:ve.TextureType.unpacked},shaderSource:ji,hasMain:!0})})(ut,tt,Gt,_e)})})(he,we,He),we),$=(he,we)=>{const He=he.kernelShape.slice();if(he.kernelShape.length===0)for(let Gt=2;Gt{const On=Gt.length-2,ba=Ir.length===0;for(let ra=0;ra{const we=he.attributes,He=(0,fe.parseInternalActivationAttributes)(we),ut=we.getString("auto_pad","NOTSET"),tt=we.getInts("dilations",[1,1]),_e=we.getInt("group",1),Gt=we.getInts("kernel_shape",[]),Qt=we.getInts("output_padding",[0,0]),ir=we.getInts("output_shape",[]),Lr=we.getInts("pads",[0,0,0,0]),jr=we.getInts("strides",[1,1]);return(0,H.createAttributeWithCacheKey)(Object.assign({autoPad:ut,dilations:tt,group:_e,kernelShape:Gt,outputPadding:Qt,outputShape:ir,pads:Lr,strides:jr},He))};const F=(he,we)=>{if(!he||he.length!==2&&he.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(he[0].dims.length!==4||he[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");if(he[0].dims[1]!==he[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const He=he[1].dims[1]*we.group;if(he.length===3&&(he[2].dims.length!==1||he[2].dims[0]!==He))throw new Error("invalid bias");const ut=he[0].dims.length-2;if(we.dilations.length!==ut)throw new Error(`dilations should be ${ut}D`);if(we.strides.length!==ut)throw new Error(`strides should be ${ut}D`);if(we.pads.length!==2*ut)throw new Error(`pads should be ${2*ut}D`);if(we.outputPadding.length!==ut)throw new Error(`output_padding should be ${ut}D`);if(we.kernelShape.length!==0&&we.kernelShape.length!==he[1].dims.length-2)throw new Error("invalid kernel shape");if(we.outputShape.length!==0&&we.outputShape.length!==he[0].dims.length-2)throw new Error("invalid output shape");if(he[0].type!=="float32"||he[1].type!=="float32")throw new Error("ConvTranspose input(X,W) should be float tensor");if(he.length===3&&he[2].type!=="float32")throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseConvAttributes=M.conv=M.calculateOutputShape=void 0;const H=V(246),te=V(2517),ve=V(4770),fe=V(1386),Ee=V(9828),Re=V(2823),Ce=V(3248),Me=V(5623);M.calculateOutputShape=(ut,tt,_e,Gt,Qt)=>{const ir=ut[0],Lr=ut.slice(2),jr=Lr.length,tn=tt[0],mr=tt.slice(2).map((On,ba)=>On+(On-1)*(_e[ba]-1)),Ir=Lr.map((On,ba)=>On+Gt[ba]+Gt[ba+jr]).map((On,ba)=>Math.floor((On-mr[ba]+Qt[ba])/Qt[ba]));return[ir,tn].concat(...Ir)},M.conv=(ut,tt,_e)=>(He(tt,_e),$(ut,tt,_e));const $=(ut,tt,_e)=>{const Gt=we(_e,tt),Qt=ut.session.pack,ir=Gt.kernelShape[0]===1&&Gt.kernelShape[1]===1;return Gt.group>1?[ut.run((0,ve.createUnpackedGroupedConvProgramInfoLoader)(ut,tt,Gt),tt)]:ir&&Qt?[F(ut,tt,Gt)]:Qt&&tt[0].dims.length===4&&tt[0].dims[0]===1&&!ir?[(0,fe.conv2DPacked)(ut,tt,Gt)]:[he(ut,tt,Gt)]},F=(ut,tt,_e)=>{const Gt=tt[0].dims,Qt=tt[1].dims,ir=(0,M.calculateOutputShape)(Gt,Qt,_e.dilations,_e.pads,_e.strides),Lr=ut.reshapeUnpacked(tt[0],[Gt[1],Gt[2]*Gt[3]]),jr=ut.reshapeUnpacked(tt[1],[Qt[0],Qt[1]]),tn=tt.length>2?[jr,Lr,tt[2]]:[jr,Lr],mr=ut.run((0,Me.createMatmulProgramInfoLoader)(tn,_e),tn);return ut.reshapeUnpacked(mr,ir)},he=(ut,tt,_e)=>{const Gt=tt[0].dims,Qt=tt[1].dims,ir=(0,M.calculateOutputShape)(Gt,Qt,_e.dilations,_e.pads,_e.strides),Lr=ut.run((0,Ce.createIm2ColProgramInfoLoader)(ut,tt[0],tt[1],ir,_e),[tt[0]]),jr=tt.length===3?[Lr,tt[1],tt[2]]:[Lr,tt[1]];return ut.run((0,Ee.createDotProductProgramInfoLoader)(ut,tt,ir,_e),jr)},we=(ut,tt)=>{const _e=ut.kernelShape.slice();if(ut.kernelShape.length===0)for(let ir=2;ir{const tt=ut.attributes,_e=(0,Re.parseInternalActivationAttributes)(tt),Gt=tt.getString("auto_pad","NOTSET"),Qt=tt.getInts("dilations",[1,1]),ir=tt.getInt("group",1),Lr=tt.getInts("kernel_shape",[]),jr=tt.getInts("pads",[0,0,0,0]),tn=tt.getInts("strides",[1,1]);return(0,H.createAttributeWithCacheKey)(Object.assign({autoPad:Gt,dilations:Qt,group:ir,kernelShape:Lr,pads:jr,strides:tn},_e))};const He=(ut,tt)=>{if(!ut||ut.length!==2&&ut.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(ut[0].dims.length!==4||ut[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");if(ut[0].dims[1]!==ut[1].dims[1]*tt.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(ut.length===3&&(ut[2].dims.length!==1||ut[1].dims[0]!==ut[2].dims[0]))throw new Error("invalid bias");const _e=ut[0].dims.length-2;if(tt.dilations.length!==_e)throw new Error(`dilations should be ${_e}D`);if(tt.strides.length!==_e)throw new Error(`strides should be ${_e}D`);if(tt.pads.length!==2*_e)throw new Error(`pads should be ${2*_e}D`);if(tt.kernelShape.length!==0&&tt.kernelShape.length!==ut[1].dims.length-2)throw new Error("invalid kernel shape");if(ut[0].type!=="float32"||ut[1].type!=="float32")throw new Error("Conv input(X,W) should be float tensor");if(ut.length===3&&ut[2].type!=="float32")throw new Error("Conv input(bias) should be float tensor")}},5193:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseDepthToSpaceAttributes=M.depthToSpace=void 0;const H=V(3738);M.depthToSpace=(ve,fe,Ee)=>{te(fe);const Re=Ee.blocksize,Ce=Re*Re,Me=Ee.mode==="DCR"?[0,3,4,1,5,2]:[0,1,4,2,5,3],$=Ee.mode==="DCR"?[fe[0].dims[0],Re,Re,fe[0].dims[1]/Ce,fe[0].dims[2],fe[0].dims[3]]:[fe[0].dims[0],fe[0].dims[1]/Ce,Re,Re,fe[0].dims[2],fe[0].dims[3]],F=ve.reshapeUnpacked(fe[0],$),he={perm:Me,cacheKey:`${Me}`},[we]=(0,H.transpose)(ve,[F],he),He=[fe[0].dims[0],fe[0].dims[1]/Ce,fe[0].dims[2]*Re,fe[0].dims[3]*Re];return[ve.reshapeUnpacked(we,He)]},M.parseDepthToSpaceAttributes=ve=>{const fe=ve.attributes.getInt("blocksize");if(fe<1)throw new Error(`blocksize must be >= 1, but got : ${fe} for DepthToSpace`);const Ee=ve.attributes.getString("mode","DCR");if(Ee!=="DCR"&&Ee!=="CRD")throw new Error(`unrecognized mode: ${Ee} for DepthToSpace`);return{mode:Ee,blocksize:fe}};const te=ve=>{if(ve.length!==1)throw new Error(`DepthToSpace expect 1 inputs, but got ${ve.length}`);if(ve[0].type==="string"||ve[0].dims.length!==4)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.createDotProductProgramInfoLoader=void 0;const H=V(2517),te=V(5060),ve=V(2039),fe=V(2823),Ee=V(3248);M.createDotProductProgramInfoLoader=(Re,Ce,Me,$)=>{const F=((he,we)=>({name:"ConvDotProduct",inputNames:he?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:he?[ve.TextureType.unpacked,ve.TextureType.packedLastDimension,ve.TextureType.unpacked]:[ve.TextureType.unpacked,ve.TextureType.packedLastDimension],cacheKey:we.activationCacheKey}))(Ce.length>2,$);return Object.assign(Object.assign({},F),{get:()=>((he,we,He,ut,tt)=>{const _e=He[0].dims,Gt=He[1].dims,Qt=[Gt[0],Math.ceil(_e[1]*Gt[2]*Gt[3]/4)],ir=(0,Ee.calculateIm2ColDims)(_e,Gt,ut),[Lr,jr]=he.calculateTextureWidthAndHeight(Qt,ve.TextureType.packedLastDimension),tn=H.ShapeUtil.computeStrides(ir),[mr,Ir]=he.calculateTextureWidthAndHeight(ir,ve.TextureType.packedLastDimension),On=ut.length,ba=He.length<3?"0.0":"_B(b)",ra=Math.ceil(_e[1]*Gt[2]*Gt[3]/4),{activationFunction:jn,applyActivation:qn}=(0,fe.getActivationSnippet)(tt),Un=(0,te.getGlsl)(he.session.backend.glContext.version),pa=` ${jn} float process(int indices[${On}]) { int b[1]; b[0] = indices[1]; int im2col[4]; im2col[0] = indices[0]; im2col[1] = indices[2]; im2col[2] = indices[3]; int im2colOffset = im2col[0] * ${tn[0]} + im2col[1] * ${tn[1]} + im2col[2] * ${tn[2]}; int kernelOffset = indices[1] * ${Qt[1]}; float value = ${ba}; for (int i = 0; i < ${ra}; ++i) { vec2 im2colCoords = offsetToCoords(im2colOffset, ${mr}, ${Ir}); vec2 kernelCoords = offsetToCoords(kernelOffset, ${Lr}, ${jr}); value += dot(${Un.texture2D}(Im2Col, im2colCoords), ${Un.texture2D}(K, kernelCoords)); ++im2colOffset; ++kernelOffset; } ${qn} return value; }`;return Object.assign(Object.assign({},we),{output:{dims:ut,type:He[0].type,textureType:ve.TextureType.unpacked},shaderSource:pa})})(Re,F,Ce,Me,$)})}},7992:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseFlattenAttributes=M.flatten=void 0;const H=V(2517);M.flatten=(ve,fe,Ee)=>{te(fe,Ee);const Re=H.ShapeUtil.flattenShape(fe[0].dims,Ee);return[ve.reshapeUnpacked(fe[0],Re)]},M.parseFlattenAttributes=ve=>ve.attributes.getInt("axis",1);const te=(ve,fe)=>{if(!ve||ve.length!==1)throw new Error("Flatten requires 1 input.");const Ee=ve[0].dims.length;if(Ee===0)throw new Error("scalar tensor is not supported.");if(fe<-Ee||fe>Ee)throw new Error("Invalid axis");if(ve[0].type==="string")throw new Error("string tensor is not supported.")}},2823:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseInternalActivationAttributes=M.getActivationSnippet=void 0;const H=V(2517),te=V(4909);M.getActivationSnippet=function(ve){let fe;switch(ve.activation){case"Relu":fe=(0,te.glslRelu)();break;case"Sigmoid":fe=(0,te.glslSigmoid)();break;case"Clip":fe=(0,te.glslClip)(ve.clipMin,ve.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const Ee=fe.name;return{activationFunction:fe.body,applyActivation:`value = ${Ee}_(value);`}},M.parseInternalActivationAttributes=ve=>{const fe=ve.getString("activation","");if(fe==="Clip"){const[Ee,Re]=ve.getFloats("activation_params",[H.MIN_CLIP,H.MAX_CLIP]);return{activation:fe,clipMax:Re,clipMin:Ee,activationCacheKey:`${fe}:${Ee},${Re}`}}return{activation:fe,activationCacheKey:fe}}},1253:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseGatherAttributes=M.gather=void 0;const H=V(246),te=V(782),ve=V(2517),fe=V(2039);M.gather=(Me,$,F)=>(Ce($,F.axis),[Me.run(Re(Me,$,F),$)]),M.parseGatherAttributes=Me=>(0,H.createAttributeWithCacheKey)({axis:Me.attributes.getInt("axis",0)});const Ee={name:"Gather",inputNames:["A","B"],inputTypes:[fe.TextureType.unpacked,fe.TextureType.unpacked]},Re=(Me,$,F)=>{const he=Object.assign(Object.assign({},Ee),{cacheHint:F.cacheKey});return Object.assign(Object.assign({},he),{get:()=>((we,He,ut,tt)=>{const _e=ut[0].dims.slice(),Gt=ut[1].dims.slice(),Qt=new Array(_e.length+Gt.length-1);tt=ve.ShapeUtil.normalizeAxis(tt,_e.length);const ir=[];for(let jr=0;jr{if(!Me||Me.length!==2)throw new Error("Gather requires 2 inputs.");const F=Me[0].dims.length;if(F<1)throw new Error("Invalid input shape.");if($<-F||$>F-1)throw new Error("Invalid axis.");if(te.NUMBER_TYPES.indexOf(Me[0].type)===-1)throw new Error("Invaid input type.");if(Me[1].type!=="int32"&&Me[1].type!=="int16")throw new Error("Invaid input type.")}},4776:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseGemmAttributesV11=M.parseGemmAttributesV7=M.gemm=void 0;const H=V(246),te=V(2517),ve=V(2039);M.gemm=(Me,$,F)=>(Ce($,F),[Me.run(Ee($,F),$)]);const fe=(Me,$)=>{const F=Me.attributes.getInt("transA",0)!==0,he=Me.attributes.getInt("transB",0)!==0,we=Me.attributes.getFloat("alpha",1),He=Me.attributes.getFloat("beta",1);return(0,H.createAttributeWithCacheKey)({transA:F,transB:he,alpha:we,beta:He,isOptionalC:$})};M.parseGemmAttributesV7=Me=>fe(Me,!1),M.parseGemmAttributesV11=Me=>fe(Me,!0);const Ee=(Me,$)=>{const F={name:"Gemm",inputNames:Me.length===3?["A","B","C"]:["A","B"],inputTypes:Me.length===3?[ve.TextureType.unpacked,ve.TextureType.unpacked,ve.TextureType.unpacked]:[ve.TextureType.unpacked,ve.TextureType.unpacked],key:$.cacheKey};return Object.assign(Object.assign({},F),{get:()=>Re(F,Me,$)})},Re=(Me,$,F)=>{const he=$[0].dims.slice(),we=$[1].dims.slice(),[He,ut]=te.GemmUtil.getShapeOfGemmResult(he,F.transA,we,F.transB,$.length===3?$[2].dims:void 0),tt=[He,ut];if(!tt)throw new Error("Can't use gemm on the given tensors");let _e=he[he.length-1],Gt="";F.transA&&(_e=he[0]),F.transA&&F.transB?Gt="value += _A_T(a) * _B_T(b);":F.transA&&!F.transB?Gt="value += _A_T(a) * _B(b);":!F.transA&&F.transB?Gt="value += _A(a) * _B_T(b);":F.transA||F.transB||(Gt="value += _A(a) * _B(b);");const Qt=tt.length,ir=` float process(int indices[${Qt}]) { int a[${Qt}]; int b[${Qt}]; ${$.length===3?`int c[${$[2].dims.length}];`:""} copyVec(indices, a); copyVec(indices, b); ${$.length===3?"bcastIndices_C(indices, c);":""} float value = 0.0; for (int k=0; k<${_e}; ++k) { a[${Qt-1}] = k; b[${Qt-2}] = k; ${Gt} } value = value * alpha; ${$.length===3?"value += beta * _C(c);":""} return value; }`;return Object.assign(Object.assign({},Me),{output:{dims:tt,type:$[0].type,textureType:ve.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:F.alpha},{name:"beta",type:"float",data:F.beta}],shaderSource:ir})},Ce=(Me,$)=>{if(!Me)throw new Error("Input is missing");if($.isOptionalC&&(Me.length<2||Me.length>3))throw new Error("Invaid input shape.");if(!$.isOptionalC&&Me.length!==3)throw new Error("Gemm requires 3 inputs");if(Me.length===3&&Me[2].dims.length!==1&&Me[2].dims.length!==2)throw new Error("Invalid input shape of C");if(Me[0].type!=="float32"&&Me[0].type!=="float64"||Me[1].type!=="float32"&&Me[1].type!=="float64"||Me.length===3&&Me[2].type!=="float32"&&Me[2].type!=="float64")throw new Error("Invalid input type.");if(Me[0].type!==Me[1].type||Me.length===3&&Me[0].type!==Me[2].type)throw new Error("Input types are mismatched")}},8555:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.createPackedIm2ColProgramInfoLoader=void 0;const H=V(5060),te=V(2039),ve=V(2827);M.createPackedIm2ColProgramInfoLoader=(fe,Ee,Re,Ce,Me)=>{const $=(F=Me.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[te.TextureType.packed],cacheHint:F});var F;return Object.assign(Object.assign({},$),{get:()=>((he,we,He,ut,tt,_e)=>{const Gt=He.dims,Qt=ut.dims,ir=tt.length,Lr=[Qt[1]*Qt[2]*Qt[3],tt[2]*tt[3]],jr=Qt[2]*Qt[3],tn=(0,ve.unpackFromChannel)(),mr=(0,H.getGlsl)(he.session.backend.glContext.version);let Ir="";for(let ba=0;ba<=1;ba++)for(let ra=0;ra<=1;ra++)Ir+=` blockIndex = rc.x + ${ra}; pos = rc.y + ${ba}; if(blockIndex < ${Lr[1]} && pos < ${Lr[0]}) { offsetY = int(blockIndex / (${tt[ir-1]})) * ${_e.strides[0]} - ${_e.pads[0]}; d0 = offsetY + ${_e.dilations[0]} * (imod(pos, ${jr}) / ${Qt[2]}); if(d0 < ${Gt[2]} && d0 >= 0) { offsetX = imod(blockIndex, ${tt[ir-1]}) * ${_e.strides[1]} - ${_e.pads[1]}; d1 = offsetX + ${_e.dilations[1]} * imod(imod(pos, ${jr}), ${Qt[2]}); if(d1 < ${Gt[3]} && d1 >= 0) { ch = int(float(pos)/ ${jr}.); innerDims = vec2(d0, d1); result[${2*ba+ra}] = getChannel( getA(0, ch, int(innerDims.x), int(innerDims.y)), innerDims); } } } `;const On=` ${tn} void main() { ivec2 rc = getOutputCoords(); vec4 result = vec4(0.0); int blockIndex, pos, offsetY, d0, offsetX, d1, ch; vec2 innerDims; ${Ir} ${mr.output} = result; } `;return Object.assign(Object.assign({},we),{output:{dims:Lr,type:He.type,textureType:te.TextureType.packed},shaderSource:On,hasMain:!0})})(fe,$,Ee,Re,Ce,Me)})}},3248:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.calculateIm2ColDims=M.createIm2ColProgramInfoLoader=void 0;const H=V(2039);M.createIm2ColProgramInfoLoader=(te,ve,fe,Ee,Re)=>{const Ce=(Me=Re.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[H.TextureType.unpacked],cacheHint:Me});var Me;return Object.assign(Object.assign({},Ce),{get:()=>(($,F,he,we,He,ut)=>{const tt=he.dims,_e=we.dims,Gt=He.length,Qt=(0,M.calculateIm2ColDims)(tt,_e,He,4),ir=` const int XC = ${tt[1]}; const int XH = ${tt[2]}; const int XW = ${tt[3]}; const int KH = ${ut.kernelShape[0]}; const int KW = ${ut.kernelShape[1]}; const int dilationH = ${ut.dilations[0]}; const int dilationW = ${ut.dilations[1]}; const int strideH = ${ut.strides[0]}; const int strideW = ${ut.strides[1]}; const int padH = ${ut.pads[0]}; const int padW = ${ut.pads[1]}; const int KHKW = KH*KW; const int XCKHKW = XC * KHKW; const int outputChannels = 4; vec4 process(int indices[${Gt}]) { int b = indices[0]; // batch size int oh = indices[1] * strideH - padH; //output height int ow = indices[2] * strideW - padW; //output width int p = indices[3] * outputChannels; //patch vec4 value = vec4(0.0); for(int i=0; i < outputChannels; ++i) { if(p < XCKHKW) { int patchC = p / KHKW; int patchH = (p - patchC*KHKW) / KW; int patchW = (p - patchC*KHKW) - patchH * KW; int xh2 = oh + patchH * dilationH; int xw2 = ow + patchW * dilationW; int x[${tt.length}]; x[0] = b; x[1] = patchC; x[2] = xh2; x[3] = xw2; if(xh2 >= 0 && xh2 < XH && xw2 >= 0 && xw2 < XW) { value[i] = _X(x); } } ++p; } return value; } `;return Object.assign(Object.assign({},F),{output:{dims:Qt,type:he.type,textureType:H.TextureType.packedLastDimension},shaderSource:ir})})(0,Ce,ve,fe,Ee,Re)})},M.calculateIm2ColDims=(te,ve,fe,Ee=4)=>[fe[0],fe[2],fe[3],Math.ceil(te[1]*ve[2]*ve[3]/Ee)]},6572:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseImageScalerAttributes=M.imageScaler=void 0;const H=V(246),te=V(2039);M.imageScaler=(Ce,Me,$)=>(Re(Me),[Ce.run(fe(Ce,Me,$),Me)]),M.parseImageScalerAttributes=Ce=>{const Me=Ce.attributes.getFloat("scale"),$=Ce.attributes.getFloats("bias");return(0,H.createAttributeWithCacheKey)({scale:Me,bias:$})};const ve={name:"ImageScaler",inputNames:["X"],inputTypes:[te.TextureType.unpacked]},fe=(Ce,Me,$)=>{const F=Object.assign(Object.assign({},ve),{cacheHint:$.cacheKey});return Object.assign(Object.assign({},F),{get:()=>((he,we,He,ut)=>{const tt=He[0].dims.slice(),_e=tt.length,Gt=` ${Ee(ut.bias.length)} float process(int indices[${_e}]) { return _X(indices) * scale + getBias(bias, indices[1]); }`;return Object.assign(Object.assign({},we),{output:{dims:tt,type:He[0].type,textureType:te.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:ut.bias.length,data:ut.bias},{name:"scale",type:"float",data:ut.scale}],shaderSource:Gt})})(0,F,Me,$)})},Ee=Ce=>{const Me=[`float getBias(float bias[${Ce}], int channel) {`];for(let $=0;${if(!Ce||Ce.length!==1)throw new Error("ImageScaler requires 1 input.");if(Ce[0].dims.length!==4)throw new Error("Invalid input shape.");if(Ce[0].type!=="float32"&&Ce[0].type!=="float64")throw new Error("Invalid input type.")}},3346:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseInstanceNormalizationAttributes=M.instanceNormalization=void 0;const H=V(5060),te=V(2039);M.instanceNormalization=(Me,$,F)=>{Ce($);const he=Me.run(fe($[0]),$);return[Me.run(Re(Me,$[0],F,he.dims),[$[0],he,$[1],$[2]])]},M.parseInstanceNormalizationAttributes=Me=>Me.attributes.getFloat("epsilon",1e-5);const ve={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[te.TextureType.unpacked]},fe=Me=>Object.assign(Object.assign({},ve),{get:()=>(($,F)=>{const he=F.dims.slice(),we=he[1],He=he[2]*he[3],ut=[he[0],we],tt=` vec4 process(int[2] indices) { vec4 v = vec4(0.0); int a[4]; a[0] = indices[0]; a[1] = indices[1]; float temp = 0.0; for(int a2=0; a2<${he[2]}; a2++) { a[2] = a2; for(int a3=0; a3<${he[3]}; a3++) { a[3] = a3; float x = _X(a); temp += x; } } float mean = temp / float(${He}); temp = 0.0; for(int a2=0; a2<${he[2]}; a2++) { a[2] = a2; for(int a3=0; a3<${he[3]}; a3++) { a[3] = a3; float x = _X(a); temp += (x - mean) * (x - mean); } } v.r = mean; v.g = temp / float(${He}); return v; }`;return Object.assign(Object.assign({},$),{output:{dims:ut,type:F.type,textureType:te.TextureType.packedLastDimension},shaderSource:tt})})(ve,Me)}),Ee={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[te.TextureType.unpacked,te.TextureType.packedLastDimension,te.TextureType.unpacked,te.TextureType.unpacked]},Re=(Me,$,F,he)=>{const we=Object.assign(Object.assign({},Ee),{cacheHint:`${F}`});return Object.assign(Object.assign({},we),{get:()=>((He,ut,tt,_e,Gt)=>{const Qt=(0,H.getGlsl)(He.session.backend.glContext.version),[ir,Lr]=He.calculateTextureWidthAndHeight(Gt,te.TextureType.packedLastDimension),[jr,tn]=[ir/4,Lr],mr=` vec4 get_MeanAndVariance(int[2] mv) { int offset = indicesToOffset_MeanAndVariance(mv); vec2 coords = offsetToCoords(offset, ${jr}, ${tn}); return ${Qt.texture2D}(MeanAndVariance, coords); } float process(int[4] indices) { int mv[2]; mv[0] = indices[0]; mv[1] = indices[1]; vec4 mean_and_variance = get_MeanAndVariance(mv); float mean = mean_and_variance.r; float variance = mean_and_variance.g; int sb[1]; sb[0] = indices[1]; float scale = _Scale(sb); float b = _B(sb); return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b; }`;return Object.assign(Object.assign({},ut),{output:{dims:tt.dims,type:tt.type,textureType:te.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:_e}],shaderSource:mr})})(Me,we,$,F,he)})},Ce=Me=>{if(!Me||Me.length!==3)throw new Error("InstanceNormalization requires 3 inputs.");const $=Me[0],F=Me[1],he=Me[2];if($.dims.length<3||F.dims.length!==1||he.dims.length!==1)throw new Error("Invalid input shape.");if(F.dims[0]!==$.dims[1]||he.dims[0]!==$.dims[1])throw new Error("Input shapes are mismatched.");if($.type!=="float32"&&$.type!=="float64"||F.type!=="float32"&&F.type!=="float64"||he.type!=="float32"&&he.type!=="float64")throw new Error("Invalid input type.");if(Me[0].dims.length!==4)throw new Error("Only support 4-D input shape.")}},708:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.createPackedMatmulProgramInfoLoader=void 0;const H=V(2517),te=V(5060),ve=V(2039),fe=V(9390),Ee=V(2823),Re=V(5623);M.createPackedMatmulProgramInfoLoader=(Ce,Me,$)=>{const F=(he=Me.length>2,we=$.activationCacheKey,{name:"MatMul (packed)",inputNames:he?["A","B","Bias"]:["A","B"],inputTypes:he?[ve.TextureType.packed,ve.TextureType.packed,ve.TextureType.packed]:[ve.TextureType.packed,ve.TextureType.packed],cacheHint:we});var he,we;return Object.assign(Object.assign({},F),{get:()=>((He,ut,tt,_e)=>{const Gt=tt.length>2,Qt=Gt?"value += getBiasForMatmul();":"",ir=tt[0].dims,Lr=tt[1].dims,jr=H.BroadcastUtil.calcShape(ir,Lr,!0),tn=!H.ShapeUtil.areEqual(tt[0].dims,tt[1].dims);if(!jr)throw new Error("Can't use matmul on the given tensors");const mr=ir[ir.length-1],Ir=Math.ceil(mr/2),On=ir.length,ba=Lr.length,ra=(0,te.getGlsl)(He.session.backend.glContext.version),jn=(0,fe.getCoordsDataType)(jr.length),qn=jr.length,Un=(0,fe.getGlChannels)(),{activationFunction:pa,applyActivation:lo}=(0,Ee.getActivationSnippet)(_e),ji=Gt?`${(0,Re.getBiasForMatmul)(jn,Un,tt[2].dims,jr,!0)}`:"",Fo=tn?`${function(Rl,bs,po,es){let ef=[],wf=[];const Qu=po[0].dims,Zs=po[1].dims,jc=Qu.length,Hl=Zs.length,so=es.length,Of=so-jc,ch=so-Hl;ef=Qu.map((Tf,Cd)=>`coords.${bs[Cd+Of]}`),ef[jc-1]="i*2",ef.join(", "),wf=Zs.map((Tf,Cd)=>`coords.${bs[Cd+ch]}`),wf[Hl-2]="i*2",wf.join(", ");const _d=H.BroadcastUtil.getBroadcastDims(Qu,es),bd=H.BroadcastUtil.getBroadcastDims(Zs,es),op=_d.map(Tf=>`coords.${bs[Tf+Of]} = 0;`).join(` `),Hh=bd.map(Tf=>`coords.${bs[Tf+ch]} = 0;`).join(` `),xd=`int lastDim = coords.${bs[so-1]}; coords.${bs[so-1]} = coords.${bs[so-2]}; coords.${bs[so-2]} = lastDim;`;return` vec4 getAAtOutCoordsMatmul(int i) { ${Rl} coords = getOutputCoords(); ${xd} ${op} vec4 outputValue = getA(${ef}); return outputValue; } vec4 getBAtOutCoordsMatmul(int i) { ${Rl} coords = getOutputCoords(); ${xd} ${Hh} vec4 outputValue = getB(${wf}); return outputValue; }`}(jn,Un,tt,jr)}`:"",Qo=tn?"getAAtOutCoordsMatmul(i)":`getA(${function(Rl,bs){let po="";for(let es=0;es{Object.defineProperty(M,"__esModule",{value:!0}),M.getBiasForMatmul=M.createMatmulProgramInfoLoader=M.parseMatMulAttributes=M.matMul=void 0;const H=V(2517),te=V(2039),ve=V(9390),fe=V(2823),Ee=V(708);function Re($,F){const he=(we=$.length>2,He=F.activationCacheKey,{name:"MatMul",inputNames:we?["A","B","Bias"]:["A","B"],inputTypes:we?[te.TextureType.unpacked,te.TextureType.unpacked,te.TextureType.unpacked]:[te.TextureType.unpacked,te.TextureType.unpacked],cacheHint:He});var we,He;return Object.assign(Object.assign({},he),{get:()=>function(ut,tt,_e){const Gt=tt[0].dims,Qt=tt[1].dims,ir=H.BroadcastUtil.calcShape(Gt,Qt,!0);if(!ir)throw new Error("Can't use matmul on the given tensors");const Lr=(0,ve.getCoordsDataType)(ir.length),jr=(0,ve.getGlChannels)(),{activationFunction:tn,applyActivation:mr}=(0,fe.getActivationSnippet)(_e),Ir=tt.length>2,On=Ir?"value += getBiasForMatmul();":"",ba=Ir?`${Me(Lr,jr,tt[2].dims,ir,!1)}`:"",ra=ir.length,jn=Gt.length,qn=Qt.length,Un=` ${tn} ${ba} float process(int indices[${ra}]) { int a[${jn}]; int b[${qn}]; bcastMatmulIndices_A(indices, a); bcastMatmulIndices_B(indices, b); float value; for (int k=0; k<${Gt[Gt.length-1]}; ++k) { a[${jn-1}] = k; b[${qn-2}] = k; value += _A(a) * _B(b); } ${On} ${mr} return value; }`;return Object.assign(Object.assign({},ut),{output:{dims:ir,type:tt[0].type,textureType:te.TextureType.unpacked},shaderSource:Un})}(he,$,F)})}M.matMul=($,F,he)=>(Ce(F),$.session.pack?[$.run((0,Ee.createPackedMatmulProgramInfoLoader)($,F,he),F)]:[$.run(Re(F,he),F)]),M.parseMatMulAttributes=$=>(0,fe.parseInternalActivationAttributes)($.attributes),M.createMatmulProgramInfoLoader=Re;const Ce=$=>{if(!$||$.length!==2)throw new Error("MatMul requires 2 inputs.");if($[0].dims[$[0].dims.length-1]!==$[1].dims[$[1].dims.length-2])throw new Error("shared dimension does not match.");if($[0].type!=="float32"&&$[0].type!=="float64"||$[1].type!=="float32"&&$[1].type!=="float64")throw new Error("inputs should be float type");if($[0].type!==$[1].type)throw new Error("inputs types should match")};function Me($,F,he,we,He){let ut="";const tt=he.length,_e=we.length,Gt=_e-tt;ut=_e<2&&tt>0?"coords":he.map((Lr,jr)=>`coords.${F[jr+Gt]}`).join(", ");const Qt=H.BroadcastUtil.getBroadcastDims(he,we).map(Lr=>`coords.${F[Lr+Gt]} = 0;`).join(` `);let ir="vec4(outputValue.xx, outputValue.yy)";return H.ShapeUtil.size(he)===1&&(ir="vec4(outputValue.x)"),He?` vec4 getBiasForMatmul() { ${$} coords = getOutputCoords(); ${Qt} vec4 outputValue = getBias(${ut}); return ${ir}; }`:` float getBiasForMatmul() { ${$} coords = getOutputCoords(); ${Qt} return getBias(coords.x); }`}M.getBiasForMatmul=Me},2403:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.createPackProgramInfoLoader=void 0;const H=V(5060),te=V(2039),ve=V(9390),fe=V(2827),Ee={name:"pack",inputNames:["A"],inputTypes:[te.TextureType.unpackedReversed]};M.createPackProgramInfoLoader=(Re,Ce)=>Object.assign(Object.assign({},Ee),{get:()=>((Me,$)=>{const F=(0,H.getGlsl)(Me.session.backend.glContext.version),he=$.dims,we=he.length,He=$.dims.length,ut=(0,ve.getCoordsDataType)(He),tt=(0,fe.getChannels)("rc",He),_e=(Gt=He,Qt=tt,ir=he[he.length-2],Lr=he[he.length-1],Gt===0||Gt===1?"":` int r = ${Qt[Gt-2]}; int c = ${Qt[Gt-1]}; int rp1 = ${Qt[Gt-2]} + 1; int cp1 = ${Qt[Gt-1]} + 1; bool rEdge = rp1 >= ${Lr}; bool cEdge = cp1 >= ${ir}; `);var Gt,Qt,ir,Lr;let jr;jr=we===0?[1,1]:we===1?[he[0],1]:[he[He-1],he[He-2]];const tn=function(On,ba,ra){if(On===0)return"false";if(On===1)return`rc > ${ba[0]}`;let jn="";for(let qn=On-2;qn= ${ba[qn-On+2]}`,qn= ${On[0]} ? 0. : getA(rc + 1), 0, 0`;let jn="";if(ra>2)for(let qn=0;qn{Object.defineProperty(M,"__esModule",{value:!0}),M.unpackFromChannel=M.getChannels=M.getVecChannels=void 0;const H=V(9390);function te(ve,fe){return(0,H.getGlChannels)(fe).map(Ee=>`${ve}.${Ee}`)}M.getVecChannels=te,M.getChannels=function(ve,fe){return fe===1?[ve]:te(ve,fe)},M.unpackFromChannel=function(){return` float getChannel(vec4 frag, int dim) { int modCoord = imod(dim, 2); return modCoord == 0 ? frag.r : frag.g; } float getChannel(vec4 frag, vec2 innerDims) { vec2 modCoord = mod(innerDims, 2.); return modCoord.x == 0. ? (modCoord.y == 0. ? frag.r : frag.g) : (modCoord.y == 0. ? frag.b : frag.a); } `}},2870:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parsePadAttributesV11=M.padV11=M.parsePadAttributesV2=M.padV2=void 0;const H=V(246),te=V(2517),ve=V(5060),fe=V(2039),Ee={name:"Pad",inputNames:["A"],inputTypes:[fe.TextureType.unpacked]};M.padV2=(ut,tt,_e)=>(Me(tt),[ut.run(Object.assign(Object.assign({},Ee),{cacheHint:_e.cacheKey,get:()=>Ce(ut,tt[0],_e)}),tt)]),M.parsePadAttributesV2=ut=>{const tt=ut.attributes.getString("mode","constant"),_e=ut.attributes.getFloat("value",0),Gt=ut.attributes.getInts("pads");return(0,H.createAttributeWithCacheKey)({mode:tt,value:_e,pads:Gt})},M.padV11=(ut,tt,_e)=>{$(tt);const Gt=Re(ut,tt,_e);return(0,M.padV2)(ut,[tt[0]],Gt)},M.parsePadAttributesV11=ut=>ut.attributes.getString("mode","constant");const Re=(ut,tt,_e)=>{if(!ut.session.isInitializer(tt[1].dataId)||tt.length>=3&&!ut.session.isInitializer(tt[2].dataId))throw new Error("dynamic pad attributes are not allowed");const Gt=Array.from(tt[1].integerData),Qt=tt.length>=3?tt[2].floatData[0]:0;return(0,H.createAttributeWithCacheKey)({mode:_e,pads:Gt,value:Qt})},Ce=(ut,tt,_e)=>{const Gt=te.ShapeUtil.padShape(tt.dims.slice(),_e.pads),Qt=Gt.length,ir=` ${F(ut,tt,_e)} float process(int[${Qt}] indices) { return padA(indices); }`;return{name:"Pad",inputNames:["A"],inputTypes:[fe.TextureType.unpacked],output:{dims:Gt,type:tt.type,textureType:fe.TextureType.unpacked},shaderSource:ir}},Me=ut=>{if(!ut||ut.length!==1)throw new Error("Pad requires 1 input");if(ut[0].type!=="float32"&&ut[0].type!=="float64")throw new Error("Invalid input type.")},$=ut=>{if(!ut||ut.length!==2&&ut.length!==3)throw new Error("Pad requires 2 or 3 inputs");if(ut[1].type!=="int32")throw new Error("Invalid input type.");if(ut.length>=3&&ut[2].type==="string")throw new Error("Invalid input type.")},F=(ut,tt,_e)=>{const Gt=(0,ve.getGlsl)(ut.session.backend.glContext.version),[Qt,ir]=ut.calculateTextureWidthAndHeight(tt.dims,fe.TextureType.unpacked),Lr=te.ShapeUtil.computeStrides(tt.dims);switch(_e.mode){case"constant":return he(Gt,tt.dims,Lr,Qt,ir,_e.pads,_e.value);case"reflect":return we(Gt,tt.dims,Lr,Qt,ir,_e.pads);case"edge":return He(Gt,tt.dims,Lr,Qt,ir,_e.pads);default:throw new Error("Invalid mode")}},he=(ut,tt,_e,Gt,Qt,ir,Lr)=>{const jr=tt.length;let tn="";for(let mr=jr-1;mr>=0;--mr)tn+=` k = m[${mr}] - ${ir[mr]}; if (k < 0) return constant; if (k >= ${tt[mr]}) return constant; offset += k * ${_e[mr]}; `;return` float padA(int m[${jr}]) { const float constant = float(${Lr}); int offset = 0; int k = 0; ${tn} vec2 coords = offsetToCoords(offset, ${Gt}, ${Qt}); float value = getColorAsFloat(${ut.texture2D}(A, coords)); return value; } `},we=(ut,tt,_e,Gt,Qt,ir)=>{const Lr=tt.length;let jr="";for(let tn=Lr-1;tn>=0;--tn)jr+=` k = m[${tn}] - ${ir[tn]}; if (k < 0) { k = -k; } { const int _2n_1 = ${2*(tt[tn]-1)}; k = int( mod( float(k), float(_2n_1) ) ) ; if(k >= ${tt[tn]}) { k = _2n_1 - k; } } offset += k * ${_e[tn]}; `;return` float padA(int m[${Lr}]) { int offset = 0; int k = 0; ${jr} vec2 coords = offsetToCoords(offset, ${Gt}, ${Qt}); float value = getColorAsFloat(${ut.texture2D}(A, coords)); return value; } `},He=(ut,tt,_e,Gt,Qt,ir)=>{const Lr=tt.length;let jr="";for(let tn=Lr-1;tn>=0;--tn)jr+=` k = m[${tn}] - ${ir[tn]}; if (k < 0) k = 0; if (k >= ${tt[tn]}) k = ${tt[tn]-1}; offset += k * ${_e[tn]}; `;return` float padA(int m[${Lr}]) { int offset = 0; int k = 0; ${jr} vec2 coords = offsetToCoords(offset, ${Gt}, ${Qt}); float value = getColorAsFloat(${ut.texture2D}(A, coords)); return value; } `}},2143:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.globalMaxPool=M.parseMaxPoolAttributes=M.maxPool=M.parseGlobalAveragePoolAttributes=M.globalAveragePool=M.parseAveragePoolAttributes=M.averagePool=void 0;const H=V(246),te=V(2517),ve=V(2039);M.averagePool=(He,ut,tt)=>{$(ut);const _e={name:"AveragePool",inputNames:["X"],inputTypes:[ve.TextureType.unpacked],cacheHint:tt.cacheKey};return[He.run(Object.assign(Object.assign({},_e),{get:()=>fe(ut,_e,!1,tt)}),ut)]},M.parseAveragePoolAttributes=He=>{const ut=He.attributes.getString("auto_pad","NOTSET"),tt=He.attributes.getInt("ceil_mode",0),_e=He.attributes.getInt("count_include_pad",0)!==0,Gt=He.attributes.getInts("kernel_shape"),Qt=He.attributes.getInts("strides",[]),ir=He.attributes.getInts("pads",[]);if(tt!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,H.createAttributeWithCacheKey)({autoPad:ut,ceilMode:tt,countIncludePad:_e,kernelShape:Gt,strides:Qt,pads:ir})};const fe=(He,ut,tt,_e)=>{const[Gt,Qt]=Re(He,_e,tt),ir=te.ShapeUtil.size(Gt.kernelShape);let Lr="";Gt.countIncludePad?Lr+=`value /= float(${ir});`:Lr+=`value /= float(${ir} - pad);`;const jr=` ${F(He[0].dims,Gt,"value += _X(x);",Lr,"0.0")} `;return Object.assign(Object.assign({},ut),{output:{dims:Qt,type:He[0].type,textureType:ve.TextureType.unpacked},shaderSource:jr})};M.globalAveragePool=(He,ut,tt)=>{$(ut);const _e={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[ve.TextureType.unpacked],cacheHint:`${tt.countIncludePad}`};return[He.run(Object.assign(Object.assign({},_e),{get:()=>fe(ut,_e,!0,tt)}),ut)]},M.parseGlobalAveragePoolAttributes=He=>{const ut=He.attributes.getInt("count_include_pad",0)!==0;return(0,H.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:ut,kernelShape:[],strides:[],pads:[]})},M.maxPool=(He,ut,tt)=>{$(ut);const _e={name:"MaxPool",inputNames:["X"],inputTypes:[ve.TextureType.unpacked],cacheHint:tt.cacheKey};return[He.run(Object.assign(Object.assign({},_e),{get:()=>Ee(ut,_e,!1,tt)}),ut)]},M.parseMaxPoolAttributes=He=>{const ut=He.attributes.getString("auto_pad","NOTSET"),tt=He.attributes.getInt("ceil_mode",0),_e=He.attributes.getInts("kernel_shape"),Gt=He.attributes.getInts("strides",[]),Qt=He.attributes.getInts("pads",[]),ir=He.attributes.getInt("storage_order",0),Lr=He.attributes.getInts("dilations",[]);if(ir!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(tt!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,H.createAttributeWithCacheKey)({autoPad:ut,ceilMode:tt,countIncludePad:!1,kernelShape:_e,strides:Gt,pads:Qt,storageOrder:ir,dilations:Lr})};const Ee=(He,ut,tt,_e)=>{const[Gt,Qt]=Re(He,_e,tt),ir=` ${F(He[0].dims,Gt,` value = max(_X(x), value); `,"","-1e5")} `;return Object.assign(Object.assign({},ut),{output:{dims:Qt,type:He[0].type,textureType:ve.TextureType.unpacked},shaderSource:ir})},Re=(He,ut,tt)=>{const _e=He[0].dims.slice(),Gt=Object.hasOwnProperty.call(ut,"dilations"),Qt=ut.kernelShape.slice(),ir=ut.strides.slice(),Lr=Gt?ut.dilations.slice():[],jr=ut.pads.slice();te.PoolConvUtil.adjustPoolAttributes(tt,_e,Qt,ir,Lr,jr);const tn=te.PoolConvUtil.computePoolOutputShape(tt,_e,ir,Lr,Qt,jr,ut.autoPad),mr=Object.assign({},ut);return Gt?Object.assign(mr,{kernelShape:Qt,strides:ir,pads:jr,dilations:Lr,cacheKey:ut.cacheKey}):Object.assign(mr,{kernelShape:Qt,strides:ir,pads:jr,cacheKey:ut.cacheKey}),[mr,tn]},Ce={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},Me={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[ve.TextureType.unpacked]};M.globalMaxPool=(He,ut)=>($(ut),[He.run(Object.assign(Object.assign({},Me),{get:()=>Ee(ut,Me,!0,Ce)}),ut)]);const $=He=>{if(!He||He.length!==1)throw new Error("Pool ops requires 1 input.");if(He[0].type!=="float32"&&He[0].type!=="float64")throw new Error("Invalid input type.")},F=(He,ut,tt,_e,Gt)=>{const Qt=He.length;if(ut.kernelShape.length<=2){const ir=ut.kernelShape[ut.kernelShape.length-1],Lr=ut.strides[ut.strides.length-1],jr=ut.pads[ut.pads.length/2-1],tn=ut.pads[ut.pads.length-1],mr=He[Qt-1];let Ir="",On="",ba="";if(Ir=jr+tn!==0?` for (int i = 0; i < ${ir}; i++) { x[${Qt} - 1] = indices[${Qt} - 1] * ${Lr} - ${jr} + i; if (x[${Qt} - 1] < 0 || x[${Qt} - 1] >= ${mr}) { pad++; continue; } ${tt} }`:` for (int i = 0; i < ${ir}; i++) { x[${Qt} - 1] = indices[${Qt} - 1] * ${Lr} - ${jr} + i; ${tt} }`,ut.kernelShape.length===2){const ra=ut.kernelShape[ut.kernelShape.length-2],jn=ut.strides[ut.strides.length-2],qn=ut.pads[ut.pads.length/2-2],Un=ut.pads[ut.pads.length-2],pa=He[Qt-2];On=qn+Un!==0?` for (int j = 0; j < ${ra}; j++) { x[${Qt} - 2] = indices[${Qt} - 2] * ${jn} - ${qn} + j; if (x[${Qt} - 2] < 0 || x[${Qt} - 2] >= ${pa}) { pad+= ${ir}; continue; } `:` for (int j = 0; j < ${ra}; j++) { x[${Qt} - 2] = indices[${Qt} - 2] * ${jn} - ${qn} + j; `,ba=` } `}return` float process(int indices[${Qt}]) { int x[${Qt}]; copyVec(indices, x); float value = ${Gt}; int pad = 0; ${On} ${Ir} ${ba} ${_e} return value; } `}{const ir=te.ShapeUtil.size(ut.kernelShape),Lr=te.ShapeUtil.computeStrides(ut.kernelShape),jr=Lr.length,tn=ut.pads.length,mr=we(jr),Ir=he(He,"inputDims"),On=he(ut.pads,"pads"),ba=he(Lr,"kernelStrides"),ra=he(ut.strides,"strides");let jn="";return jn=ut.pads.reduce((qn,Un)=>qn+Un)?` if (x[j] >= inputDims[j] || x[j] < 0) { pad++; isPad = true; break; } } if (!isPad) { ${tt} }`:` } ${tt} `,` ${mr} float process(int indices[${Qt}]) { int x[${Qt}]; copyVec(indices, x); int offset[${jr}]; int pads[${tn}]; int inputDims[${Qt}]; int kernelStrides[${jr}]; int strides[${jr}]; ${On} ${Ir} ${ra} ${ba} float value = ${Gt}; int pad = 0; bool isPad = false; for (int i = 0; i < ${ir}; i++) { offsetToIndices(i, kernelStrides, offset); isPad = false; for (int j = ${Qt} - ${jr}; j < ${Qt}; j++) { x[j] = indices[j] * strides[j - ${Qt} + ${jr}] + offset[j - ${Qt} + ${jr}] - pads[j - 2]; ${jn} } ${_e} return value; } `}},he=(He,ut)=>{let tt="";for(let _e=0;_e` void offsetToIndices(int offset, int[${He}] strides, out int[${He}] indices) { if (${He} == 0) { return; } for (int i = 0; i < ${He} - 1; ++i) { indices[i] = offset / strides[i]; offset -= indices[i] * strides[i]; } indices[${He} - 1] = offset; }`},4939:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.reduceLogSumSquare=M.reduceLogSum=M.reduceProd=M.reduceMin=M.reduceMax=M.reduceMean=M.reduceSum=M.parseReduceAttributes=void 0;const H=V(246),te=V(782),ve=V(2517),fe=V(2039),Ee=(Me,$,F,he,we)=>{Ce($);const He={name:he,inputNames:["A"],inputTypes:[fe.TextureType.unpacked]};return[Me.run(Object.assign(Object.assign({},He),{cacheHint:F.cacheKey,get:()=>Re(Me,$,F,he,we,He)}),$)]};M.parseReduceAttributes=Me=>{const $=Me.attributes.getInts("axes",[]),F=Me.attributes.getInt("keepdims",1)===1;return(0,H.createAttributeWithCacheKey)({axes:$,keepDims:F})};const Re=(Me,$,F,he,we,He)=>{const ut=[],tt=$[0].dims.length||1,_e=[],Gt=ve.ShapeUtil.normalizeAxes(F.axes,$[0].dims.length),Qt=we($,Gt);let ir=Qt[1];for(let jr=0;jr<$[0].dims.length;jr++)Gt.indexOf(jr)>=0||Gt.length===0?(F.keepDims&&ut.push(1),ir=` for(int j${jr} = 0; j${jr} < ${$[0].dims[jr]}; j${jr}++) { inputIdx[${jr}] = j${jr}; ${ir} }`):(_e.push(`inputIdx[${jr}] = outputIdx[${ut.length}];`),ut.push($[0].dims[jr]));const Lr=` float process(int outputIdx[${ut.length||1}]) { float value; // final result int inputIdx[${tt}]; // addressing input data ${_e.join(` `)} ${Qt[0]} // init ops for reduce max/min ${ir} ${Qt[2]} // final computation for reduce mean return value; }`;return Object.assign(Object.assign({},He),{output:{dims:ut,type:$[0].type,textureType:fe.TextureType.unpacked},shaderSource:Lr})},Ce=Me=>{if(!Me||Me.length!==1)throw new Error("Reduce op requires 1 input.");if(te.NUMBER_TYPES.indexOf(Me[0].type)===-1)throw new Error("Invalid input type.")};M.reduceSum=(Me,$,F)=>Ee(Me,$,F,"ReduceSum",()=>["value = 0.0;","value += _A(inputIdx);",""]),M.reduceMean=(Me,$,F)=>Ee(Me,$,F,"ReduceMean",(he,we)=>{let He=1;for(let ut=0;ut=0||we.length===0)&&(He*=he[0].dims[ut]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${He}.;`]}),M.reduceMax=(Me,$,F)=>Ee(Me,$,F,"ReduceMax",(he,we)=>{const He=[];for(let ut=0;ut=0||we.length===0)&&He.push(`inputIdx[${ut}] = 0;`);return[`${He.join(` `)} value = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]}),M.reduceMin=(Me,$,F)=>Ee(Me,$,F,"ReduceMin",(he,we)=>{const He=[];for(let ut=0;ut=0||we.length===0)&&He.push(`inputIdx[${ut}] = 0;`);return[`${He.join(` `)} value = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]}),M.reduceProd=(Me,$,F)=>Ee(Me,$,F,"ReduceProd",()=>["value = 1.0;","value *= _A(inputIdx);",""]),M.reduceLogSum=(Me,$,F)=>Ee(Me,$,F,"ReduceLogSum",()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"]),M.reduceLogSumSquare=(Me,$,F)=>Ee(Me,$,F,"ReduceLogSumSquare",()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""])},7019:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.isReshapeCheap=M.processDims3D=M.createPackedReshape3DProgramInfoLoader=void 0;const H=V(2517),te=V(5060),ve=V(2039),fe=V(2827);M.createPackedReshape3DProgramInfoLoader=(Ee,Re,Ce)=>{const Me=($=>({name:"Reshape (packed)",inputTypes:[ve.TextureType.packed],inputNames:["A"],cacheHint:`${$}`}))(Ce);return Object.assign(Object.assign({},Me),{get:()=>(($,F,he,we)=>{const He=F.dims,ut=we;let tt="";for(let Qt=0;Qt<4;Qt++){let ir="";switch(Qt){case 0:ir="outputCoords = rc;";break;case 1:ir="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:ir="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:ir="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}tt+=` ${ir} ${Qt>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""} int flattenedIndex = getFlattenedIndex(outputCoords); ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex); vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z)); result[${Qt}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims); ${Qt>0?"}":""} `}const _e=(0,te.getGlsl)($.session.backend.glContext.version),Gt=` ${function(Qt){const ir=H.ShapeUtil.computeStrides(Qt),Lr=["b","r","c"],jr="index";return` ivec3 inputCoordsFromReshapedOutCoords(int index) { ${ir.map((tn,mr)=>`int ${Lr[mr]} = ${jr} / ${tn}; ${mr===ir.length-1?`int ${Lr[mr+1]} = ${jr} - ${Lr[mr]} * ${tn}`:`index -= ${Lr[mr]} * ${tn}`};`).join("")} return ivec3(b, r, c); } `}(He)} ${function(Qt){const ir=H.ShapeUtil.computeStrides(Qt);return` int getFlattenedIndex(ivec3 coords) { // reverse y, z order return coords.x * ${ir[0]} + coords.z * ${ir[1]} + coords.y; } `}(ut)} ${(0,fe.unpackFromChannel)()} void main() { ivec3 rc = getOutputCoords(); vec4 result = vec4(0.0); ivec3 outputCoords; int rows = ${ut[2]}; int cols = ${ut[1]}; ${tt} ${_e.output} = result; } `;return Object.assign(Object.assign({},he),{output:{dims:ut,type:F.type,textureType:ve.TextureType.packed},shaderSource:Gt,hasMain:!0})})(Ee,Re,Me,Ce)})},M.processDims3D=function(Ee){if(Ee.length===0)return[1,1,1];let Re=1;for(let Ce=0;Ce1?Ee[Ee.length-2]:1,Ee[Ee.length-1]]},M.isReshapeCheap=function(Ee,Re){let Ce=!1;return Ce=Ee.length===0||Re.length===0||(Ee.length<2||Re.length<2?Ee[Ee.length-1]===Re[Re.length-1]:Ee[Ee.length-1]===Re[Re.length-1]&&Ee[Ee.length-2]===Re[Re.length-2]),Ce}},718:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.reshape=void 0;const H=V(2517);M.reshape=(te,ve)=>{const fe=H.ShapeUtil.calculateReshapedDims(ve[0].dims,ve[1].integerData);return te.session.pack?[te.reshapePacked(ve[0],fe)]:[te.reshapeUnpacked(ve[0],fe)]}},2268:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseResizeAttributesV11=M.parseResizeAttributesV10=M.resize=void 0;const H=V(5060),te=V(2039),ve=V(9390),fe=V(2827),Ee=V(9793),Re={name:"Resize",inputNames:["A"],inputTypes:[te.TextureType.packed]};M.resize=(he,we,He)=>((0,Ee.validateInputs)(we,He),[he.run(Object.assign(Object.assign({},Re),{cacheHint:He.cacheKey,get:()=>Ce(he,we,He)}),we)]),M.parseResizeAttributesV10=he=>(0,Ee.parseUpsampleAttributes)(he,10),M.parseResizeAttributesV11=he=>(0,Ee.parseUpsampleAttributes)(he,11);const Ce=(he,we,He)=>{const ut=(0,H.getGlsl)(he.session.backend.glContext.version),[tt,_e]=Me(we,He);if(tt.every(jn=>jn===1)&&He.coordinateTransformMode!=="tf_crop_and_resize")return Object.assign(Object.assign({},Re),{output:{dims:_e,type:we[0].type,textureType:te.TextureType.packed},hasMain:!0,shaderSource:`void main() { vec4 v = ${ut.texture2D}(X, TexCoords); ${ut.output} = v; }`});const Gt=_e.length;if(Gt<2)throw new Error(`output dimension should be at least 2, but got ${Gt}`);const Qt=_e[Gt-2],ir=_e[Gt-1],Lr=we[0].dims;if(Gt!==Lr.length)throw new Error(`output dimension should match input ${Lr.length}, but got ${Gt}`);const jr=Lr[Gt-2],tn=Lr[Gt-1],mr=tt[Gt-2],Ir=tt[Gt-1];let On="";if(He.mode!=="linear")throw new Error(`resize (packed) does not support mode: '${He.mode}'`);switch(He.coordinateTransformMode){case"asymmetric":On=` vec4 getSourceFracIndex(ivec4 coords) { return vec4(coords) / scaleWHWH; } `;break;case"half_pixel":On=` vec4 getSourceFracIndex(ivec4 coords) { return (vec4(coords) + 0.5) / scaleWHWH - 0.5; } `;break;case"pytorch_half_pixel":On=` vec4 getSourceFracIndex(ivec4 coords) { vec4 fcoords = vec4(coords); return vec4( ${ir}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0, ${Qt}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0, ${ir}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0, ${Qt}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0 ); } `;break;case"align_corners":On=` vec4 getSourceFracIndex(ivec4 coords) { vec4 resized = vec4(${ir}.0 - 1.0, ${Qt}.0 - 1.0, ${ir}.0 - 1.0, ${Qt}.0 - 1.0); vec4 original = vec4(${tn}.0 - 1.0, ${jr}.0 - 1.0, ${tn}.0 - 1.0, ${jr}.0 - 1.0); vec4 new_scale = original / resized; return vec4(coords) * new_scale; } `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${He.coordinateTransformMode}'`)}const ba=(0,ve.getCoordsDataType)(Gt),ra=` const vec2 inputWH = vec2(${jr}.0, ${tn}.0); const vec4 scaleWHWH = vec4(float(${mr}), float(${Ir}), float(${mr}), float(${Ir})); ${(0,fe.unpackFromChannel)()} ${On} float getAValue(int x10, int r, int c, int d) { return getChannel(getA(x10, r, c, d), vec2(c, d)); } void main() { ${ba} rc = getOutputCoords(); int batch = rc[0]; int depth = rc[1]; // retrieve the 4 coordinates that is used in the 4 packed output values. ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1); // calculate the source index in fraction vec4 sourceFrac = getSourceFracIndex(coords); // get the lower and upper bound of the 4 values that will be packed into one texel. ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy))); ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw))); ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy))); ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw))); bool hasNextRow = rc.w < ${Qt-1}; bool hasNextCol = rc.z < ${ir-1}; // pack x00, x01, x10, x11's top-left corner into one vec4 structure vec4 topLeft = vec4( getAValue(batch, depth, x00.x, x00.y), hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0, hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0, (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0); // pack x00, x01, x10, x11's top-right corner into one vec4 structure vec4 topRight = vec4( getAValue(batch, depth, x00.x, x00.w), hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0, hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0, (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0); // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure vec4 bottomLeft = vec4( getAValue(batch, depth, x00.z, x00.y), hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0, hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0, (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0); // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure vec4 bottomRight = vec4( getAValue(batch, depth, x00.z, x00.w), hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0, hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0, (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0); // calculate the interpolation fraction on u and v direction vec4 frac = vec4(sourceFrac) - floor(sourceFrac); vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0)); vec4 top = mix(topLeft, topRight, clampFrac.ywyw); vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw); vec4 newValue = mix(top, bottom, clampFrac.xxzz); ${ut.output} = vec4(newValue); } `;return Object.assign(Object.assign({},Re),{output:{dims:_e,type:we[0].type,textureType:te.TextureType.packed},hasMain:!0,shaderSource:ra})},Me=(he,we)=>{const He=he[0].dims;let ut,tt=we.scales;if(tt.length===0){const Gt=he[we.scalesInputIdx];if(Gt&&Gt.size!==0){if(he[we.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");tt=$(Gt,we.mode,we.isResize)}else{const Qt=he[we.sizesInputIdx];if(!Qt||Qt.size===0)throw new Error("Either scales or sizes MUST be provided as input.");ut=Array.from(Qt.integerData),tt=F(ut,He,we.mode,we.isResize)}}else if(he[we.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const _e=ut||He.map((Gt,Qt)=>Math.floor(Gt*tt[Qt]));return[tt,_e]},$=(he,we,He)=>{const ut=Array.from(he.floatData);return(0,Ee.scalesValidation)(ut,we,He),ut},F=(he,we,He,ut)=>{const tt=we.length,_e=new Array(tt);for(let Gt=0,Qt=tt;Gt{Object.defineProperty(M,"__esModule",{value:!0}),M.shape=void 0;const H=V(9162);M.shape=(ve,fe)=>(te(fe),[new H.Tensor([fe[0].dims.length],"int32",void 0,void 0,new Int32Array(fe[0].dims))]);const te=ve=>{if(!ve||ve.length!==1)throw new Error("Shape requires 1 input.")}},2278:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.sliceV10=M.parseSliceAttributes=M.slice=void 0;const H=V(246),te=V(782),ve=V(2517),fe=V(2039),Ee={name:"Slice",inputNames:["A"],inputTypes:[fe.TextureType.unpacked]};M.slice=(F,he,we)=>(Ce(he),[F.run(Object.assign(Object.assign({},Ee),{cacheHint:we.cacheKey,get:()=>Re(F,he[0],we)}),he)]),M.parseSliceAttributes=F=>{const he=F.attributes.getInts("starts"),we=F.attributes.getInts("ends"),He=F.attributes.getInts("axes",[]);return(0,H.createAttributeWithCacheKey)({starts:he,ends:we,axes:He})};const Re=(F,he,we)=>{const He=we.axes.length===0?he.dims.slice(0).map((Lr,jr)=>jr):we.axes,ut=ve.ShapeUtil.normalizeAxes(He,he.dims.length),tt=we.starts.map((Lr,jr)=>Lr>he.dims[ut[jr]]-1?he.dims[ut[jr]]:ve.ShapeUtil.normalizeAxis(Lr,he.dims[ut[jr]])),_e=we.ends.map((Lr,jr)=>Lr>he.dims[ut[jr]]-1?he.dims[ut[jr]]:ve.ShapeUtil.normalizeAxis(Lr,he.dims[ut[jr]])),Gt=he.dims.slice(),Qt=[];for(let Lr=0;Lr0&&Qt.push(`outputIdx[${ut[Lr]}] += ${tt[Lr]};`);const ir=` float process(int outputIdx[${Gt.length}]) { ${Qt.join(` `)} return _A(outputIdx); }`;return Object.assign(Object.assign({},Ee),{output:{dims:Gt,type:he.type,textureType:fe.TextureType.unpacked},shaderSource:ir})},Ce=F=>{if(!F||F.length!==1)throw new Error("Slice requires 1 input.");if(te.NUMBER_TYPES.indexOf(F[0].type)===-1)throw new Error("Invalid input type.")};M.sliceV10=(F,he)=>{$(he);const we=Me(F,he);return[F.run(Object.assign(Object.assign({},Ee),{cacheHint:we.cacheKey,get:()=>Re(F,he[0],we)}),[he[0]])]};const Me=(F,he)=>{if(!F.session.isInitializer(he[1].dataId)||!F.session.isInitializer(he[2].dataId)||he.length>=4&&!F.session.isInitializer(he[3].dataId)||he.length>=5&&!F.session.isInitializer(he[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(he.length>=5&&he[4].integerData.some(tt=>tt!==1))throw new Error("currently non-1 steps is not supported for Slice");const we=Array.from(he[1].integerData),He=Array.from(he[2].integerData),ut=he.length>=4?Array.from(he[3].integerData):[];return{starts:we,ends:He,axes:ut,cacheKey:`${ut};${we};${He}`}},$=F=>{if(!F||F.length<3||F.length>5)throw new Error("Invalid input number.");if(F[1].type!=="int32"||F[1].dims.length!==1)throw new Error("Invalid input type.");if(F[2].type!=="int32"||F[2].dims.length!==1)throw new Error("Invalid input type.");if(F.length>=4&&(F[3].type!=="int32"||F[3].dims.length!==1))throw new Error("Invalid input type.");if(F.length>=5&&(F[4].type!=="int32"||F[4].dims.length!==1))throw new Error("Invalid input type.")}},5524:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.softmaxV13=M.parseSoftmaxAttributesV13=M.parseSoftmaxAttributes=M.softmax=void 0;const H=V(246),te=V(2517),ve=V(5060),fe=V(2039),Ee=V(3738),Re={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[fe.TextureType.unpacked]},Ce={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[fe.TextureType.unpacked,fe.TextureType.unpacked]},Me={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[fe.TextureType.unpacked,fe.TextureType.unpacked,fe.TextureType.unpacked]};M.softmax=(ut,tt,_e)=>{He(tt);const Gt=tt[0].dims.slice(),Qt=te.ShapeUtil.normalizeAxis(_e.axis,Gt.length),ir=te.ShapeUtil.sizeToDimension(Gt,Qt),Lr=te.ShapeUtil.sizeFromDimension(Gt,Qt);return $(ut,tt,_e,ir,Lr)},M.parseSoftmaxAttributes=ut=>(0,H.createAttributeWithCacheKey)({axis:ut.attributes.getInt("axis",1)}),M.parseSoftmaxAttributesV13=ut=>(0,H.createAttributeWithCacheKey)({axis:ut.attributes.getInt("axis",-1)}),M.softmaxV13=(ut,tt,_e)=>{He(tt);const Gt=tt[0].dims.slice(),Qt=te.ShapeUtil.normalizeAxis(_e.axis,Gt.length),ir=Gt.length,Lr=Qt!==ir-1,jr=[];let tn,mr=[],Ir=[];Lr&&(mr=Array.from({length:ir}).map((jn,qn)=>qn),mr[Qt]=ir-1,mr[ir-1]=Qt,mr.map(jn=>jr.push(Gt[jn])),tn=(0,H.createAttributeWithCacheKey)({perm:mr}),Ir=(0,Ee.transpose)(ut,tt,tn));const On=Lr?te.ShapeUtil.sizeToDimension(jr,ir-1):te.ShapeUtil.sizeToDimension(Gt,ir-1),ba=Lr?te.ShapeUtil.sizeFromDimension(jr,ir-1):te.ShapeUtil.sizeFromDimension(Gt,ir-1),ra=$(ut,Lr?Ir:tt,_e,On,ba);return Lr?(0,Ee.transpose)(ut,ra,tn):ra};const $=(ut,tt,_e,Gt,Qt)=>{const ir=F(ut,tt[0],Gt,Qt,[Gt]),Lr=ut.run(Object.assign(Object.assign({},Re),{cacheHint:_e.cacheKey,get:()=>ir}),tt),jr=he(ut,tt[0],Gt,Qt,ir.output.dims,[Gt]),tn=ut.run(Object.assign(Object.assign({},Ce),{cacheHint:_e.cacheKey,get:()=>jr}),[tt[0],Lr]),mr=we(ut,tt[0],Gt,Qt,ir.output.dims,jr.output.dims);return[ut.run(Object.assign(Object.assign({},Me),{cacheHint:_e.cacheKey,get:()=>mr}),[tt[0],Lr,tn])]},F=(ut,tt,_e,Gt,Qt)=>{const[ir,Lr]=ut.calculateTextureWidthAndHeight(tt.dims,fe.TextureType.unpacked),jr=Qt.length;if(_e<1||Gt<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(Qt.length!==1)throw new Error("Dimensionality of the output should be 1");if(Qt[0]!==_e)throw new Error("Shape of the output should be equal to logical row count");const tn=(0,ve.getGlsl)(ut.session.backend.glContext.version),mr=` float process(int[${jr}] indices) { int logical_row_start_offset = indices[0] * ${Gt}; float max = getColorAsFloat(${tn.texture2D}(A, offsetToCoords(logical_row_start_offset, ${ir}, ${Lr} ))); for(int i=1; i<${Gt}; ++i) { float current = getColorAsFloat(${tn.texture2D}(A, offsetToCoords(logical_row_start_offset + i, ${ir}, ${Lr}))); if(current > max) max = current; } return max; }`;return Object.assign(Object.assign({},Re),{output:{dims:Qt,type:tt.type,textureType:fe.TextureType.unpacked},shaderSource:mr})},he=(ut,tt,_e,Gt,Qt,ir)=>{const[Lr,jr]=ut.calculateTextureWidthAndHeight(tt.dims,fe.TextureType.unpacked),tn=ir.length;if(_e<1||Gt<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(ir.length!==1)throw new Error("Dimensionality of the output should be 1");if(ir[0]!==_e)throw new Error("Shape of the output should be equal to logical row count");if(Qt.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if(Qt[0]!==_e)throw new Error("Shape of the intermediate results should be equal to logical row count");const mr=` float process(int[${tn}] indices) { int logical_row_start_offset = indices[0] * ${Gt}; float norm_factor = 0.0; float max = _Max(indices); for(int i=0; i<${Gt}; ++i) { norm_factor += exp(getColorAsFloat(${(0,ve.getGlsl)(ut.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i, ${Lr}, ${jr}))) - max); } return norm_factor; }`;return Object.assign(Object.assign({},Ce),{output:{dims:ir,type:tt.type,textureType:fe.TextureType.unpacked},shaderSource:mr})},we=(ut,tt,_e,Gt,Qt,ir)=>{const[Lr,jr]=ut.calculateTextureWidthAndHeight(tt.dims,fe.TextureType.unpacked),tn=tt.dims.length;if(_e<1||Gt<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(Qt.length!==1||ir.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if(Qt[0]!==_e||ir[0]!==_e)throw new Error("Shape of the intermediate results should be equal to logical row count");const mr=` float process(int[${tn}] indices) { // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords) int offset = coordsToOffset(TexCoords, ${Lr}, ${jr}); //determine the logical row for this index int logical_row_index[1]; logical_row_index[0] = offset / ${Gt}; float norm_factor = _Norm(logical_row_index); // avoid possible division by 0 // if norm_facor is 0, all elements are zero // if so, return 0 if(norm_factor == 0.0) return 0.0; return exp(_A(indices) - _Max(logical_row_index)) / norm_factor; }`;return Object.assign(Object.assign({},Me),{output:{dims:tt.dims,type:tt.type,textureType:fe.TextureType.unpacked},shaderSource:mr})},He=ut=>{if(!ut||ut.length!==1)throw new Error("Softmax requires 1 input.");if(ut[0].type!=="float32"&&ut[0].type!=="float64")throw new Error("Invalid input type")}},5975:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseSplitAttributes=M.split=void 0;const H=V(246),te=V(2517),ve=V(2039),fe={name:"Split",inputNames:["A"],inputTypes:[ve.TextureType.unpacked]};M.split=(Me,$,F)=>{Ce($);const he=te.ShapeUtil.normalizeAxis(F.axis,$[0].dims.length),we=Ee(Me,$,he,F),He=[];for(let ut=0;utRe(Me,$[0],F,he,ut)}),$));return He},M.parseSplitAttributes=Me=>{const $=Me.attributes.getInt("axis",0),F=Me.attributes.getInts("split",[]),he=Me.outputs.length;return(0,H.createAttributeWithCacheKey)({axis:$,split:F,numOutputs:he})};const Ee=(Me,$,F,he)=>{const[,we]=te.SplitUtil.splitShape($[0].dims,F,he.split,he.numOutputs);return we.length},Re=(Me,$,F,he,we)=>{const[He,ut]=te.SplitUtil.splitShape($.dims,he,F.split,F.numOutputs),tt=ut[we],_e=He[we],Gt=` float process(int indices[${_e.length}]) { indices[${he}] += ${tt}; return _A(indices); } `;return Object.assign(Object.assign({},fe),{cacheHint:`${F.cacheKey}:${we}`,output:{dims:_e,type:$.type,textureType:ve.TextureType.unpacked},shaderSource:Gt})},Ce=Me=>{if(!Me||Me.length!==1)throw new Error("Split requires one input.");if(Me[0].type!=="int8"&&Me[0].type!=="uint8"&&Me[0].type!=="int16"&&Me[0].type!=="uint16"&&Me[0].type!=="int32"&&Me[0].type!=="uint32"&&Me[0].type!=="float32"&&Me[0].type!=="float64"&&Me[0].type!=="bool")throw new Error("Invalid input type.")}},3933:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseSqueezeAttributes=M.squeezeV13=M.squeeze=void 0;const H=V(2517);M.squeeze=(fe,Ee,Re)=>{te(Ee);const Ce=H.ShapeUtil.squeezeShape(Ee[0].dims,Re);return[fe.reshapeUnpacked(Ee[0],Ce)]},M.squeezeV13=(fe,Ee)=>(ve(Ee),(0,M.squeeze)(fe,[Ee[0]],Array.from(Ee[1].integerData))),M.parseSqueezeAttributes=fe=>fe.attributes.getInts("axes");const te=fe=>{if(!fe||fe.length!==1)throw new Error("Squeeze requires 1 input.");if(fe[0].type==="string")throw new Error("invalid input tensor types.")},ve=fe=>{if(!fe||fe.length!==2)throw new Error("Squeeze requires 2 inputs.");if(fe[1].type!=="int32")throw new Error("Invalid input type.")}},6558:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.sum=void 0;const H=V(5060),te=V(2039);M.sum=(Ee,Re)=>{fe(Re);const Ce={name:"Sum",inputNames:Re.map((Me,$)=>`X${$}`),inputTypes:new Array(Re.length).fill(te.TextureType.unpacked)};return[Ee.run(Object.assign(Object.assign({},Ce),{get:()=>ve(Ee,Re,Ce)}),Re)]};const ve=(Ee,Re,Ce)=>{const Me=(0,H.getGlsl)(Ee.session.backend.glContext.version),$=Re[0].dims.slice(),F=` void main() { vec4 result = ${Re.map((he,we)=>`${Me.texture2D}(X${we},TexCoords)`).join(" + ")}; ${Me.output} = result; } `;return Object.assign(Object.assign({},Ce),{output:{dims:$,type:Re[0].type,textureType:te.TextureType.unpacked},hasMain:!0,shaderSource:F})},fe=Ee=>{if(!Ee||Ee.length===0)throw new Error("Sum requires inputs.");const Re=Ee[0].dims.length;for(let Ce=1;Ce{Object.defineProperty(M,"__esModule",{value:!0}),M.tile=void 0;const H=V(782),te=V(2039);M.tile=(Ee,Re)=>{fe(Re);const Ce={name:"Tile",inputNames:["A"],inputTypes:[te.TextureType.unpacked]};return[Ee.run(Object.assign(Object.assign({},Ce),{get:()=>ve(Ee,Re,Ce)}),Re)]};const ve=(Ee,Re,Ce)=>{const Me=Re[0].dims.slice(),$=new Array(Me.length),F=[];for(let He=0;He{if(!Ee||Ee.length!==2)throw new Error("Tile requires 2 input.");if(Ee[1].dims.length!==1)throw new Error("The second input shape must 1 dimension.");if(Ee[1].dims[0]!==Ee[0].dims.length)throw new Error("Invalid input shape.");if(H.NUMBER_TYPES.indexOf(Ee[0].type)===-1)throw new Error("Invalid input type.");if(Ee[1].type!=="int32"&&Ee[1].type!=="int16")throw new Error("Invalid repeat type.")}},3738:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseTransposeAttributes=M.transpose=void 0;const H=V(246),te=V(2517),ve=V(2039),fe={name:"Transpose",inputNames:["A"],inputTypes:[ve.TextureType.unpacked]};M.transpose=(F,he,we)=>($(he),[F.run(Object.assign(Object.assign({},fe),{cacheHint:we.cacheKey,get:()=>Ee(F,he[0],we.perm)}),he)]),M.parseTransposeAttributes=F=>(0,H.createAttributeWithCacheKey)({perm:F.attributes.getInts("perm",[])});const Ee=(F,he,we)=>{const He=he.dims;we=Re(He,we);const ut=Ce(He,we),tt=He.length,_e=` ${Me("perm",we,tt)} float process(int indices[${tt}]) { int a[${tt}]; perm(a, indices); return _A(a); }`;return Object.assign(Object.assign({},fe),{output:{dims:ut,type:he.type,textureType:ve.TextureType.unpacked},shaderSource:_e})},Re=(F,he)=>(he&&he.length!==F.length&&(he=[...F.keys()].reverse()),he),Ce=(F,he)=>(he=Re(F,he),te.ShapeUtil.sortBasedOnPerm(F,he)),Me=(F,he,we)=>{const He=[];He.push(`void ${F}(out int a[${we}], int src[${we}]) {`);for(let ut=0;ut{if(!F||F.length!==1)throw new Error("Transpose requires 1 input.");if(F[0].type!=="float32"&&F[0].type!=="float64")throw new Error("input should be float tensor")}},8710:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.encodeAsUint8=void 0;const H=V(5060),te=V(2039);M.encodeAsUint8=(ve,fe)=>{const Ee=fe.shape,Re=(0,H.getGlsl)(ve.session.backend.glContext.version),Ce=` const float FLOAT_MAX = 1.70141184e38; const float FLOAT_MIN = 1.17549435e-38; bool isNaN(float val) { return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true; } highp vec4 encodeAsUint8(highp float v) { if (isNaN(v)) { return vec4(255, 255, 255, 255); } highp float av = abs(v); if(av < FLOAT_MIN) { return vec4(0.0, 0.0, 0.0, 0.0); } else if(v > FLOAT_MAX) { return vec4(0.0, 0.0, 128.0, 127.0) / 255.0; } else if(v < -FLOAT_MAX) { return vec4(0.0, 0.0, 128.0, 255.0) / 255.0; } highp vec4 c = vec4(0,0,0,0); highp float e = floor(log2(av)); highp float m = exp2(fract(log2(av))) - 1.0; c[2] = floor(128.0 * m); m -= c[2] / 128.0; c[1] = floor(32768.0 * m); m -= c[1] / 32768.0; c[0] = floor(8388608.0 * m); highp float ebias = e + 127.0; c[3] = floor(ebias / 2.0); ebias -= c[3] * 2.0; c[2] += floor(ebias) * 128.0; c[3] += 128.0 * step(0.0, -v); return c / 255.0; } void main() { float value = ${Re.texture2D}(X,TexCoords).r; ${Re.output} = encodeAsUint8(value); }`,Me={name:"Uint8Encode",inputTypes:[te.TextureType.unpacked],inputNames:["X"],output:{dims:Ee,type:fe.tensor.type,textureType:te.TextureType.downloadUint8AsFloat},shaderSource:Ce,hasMain:!0};return ve.executeProgram(Me,[fe.tensor])}},4909:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.tanh=M.tan=M.sqrt=M.sin=M.sigmoid=M.relu=M.not=M.neg=M.log=M.parseLeakyReluAttributes=M.leakyRelu=M.identity=M.floor=M.exp=M.parseEluAttributes=M.elu=M.cos=M.ceil=M.clipV11=M.parseClipAttributes=M.clip=M.atan=M.asin=M.acos=M.abs=M.glslTanh=M.glslTan=M.glslSqrt=M.glslSigmoid=M.glslRelu=M.glslSin=M.glslNot=M.glslNeg=M.glslLog=M.glslLeakyRelu=M.glslIdentity=M.glslClip=M.glslFloor=M.glslExp=M.glslElu=M.glslCos=M.glslCeil=M.glslAtan=M.glslAsin=M.glslAcos=M.glslAbs=void 0;const H=V(246),te=V(2517),ve=V(8520),fe=V(5060),Ee=V(2039);function Re(){return ra("abs")}function Ce(){return ra("acos")}function Me(){return ra("asin")}function $(){return ra("atan")}function F(){return ra("ceil")}function he(){return ra("cos")}function we(Un){const pa="elu";return{body:` const float alpha = float(${Un}); float ${pa}_(float a) { return a >= 0.0 ? a: (exp(a) - 1.0) * alpha; } vec4 ${pa}_(vec4 v) { return vec4(${pa}_(v.x), ${pa}_(v.y), ${pa}_(v.z), ${pa}_(v.w)); } `,name:pa,type:ve.FunctionType.ValueBased}}function He(){return ra("exp")}function ut(){return ra("floor")}function tt(Un,pa){const lo="clip";return{body:` const float min = float(${Un}); const float max = float(${pa}); float ${lo}_(float a) { return clamp(a, min, max); } vec4 ${lo}_(vec4 v) { return clamp(v, min, max); } `,name:lo,type:ve.FunctionType.ValueBased}}function _e(){const Un="indentity";return{body:` float ${Un}_(float a) { return a; } vec4 ${Un}_(vec4 v) { return v; } `,name:Un,type:ve.FunctionType.ValueBased}}function Gt(Un){const pa="leakyRelu";return{body:` const float alpha = float(${Un}); float ${pa}_(float a) { return a < 0.0 ? a * alpha : a; } vec4 ${pa}_(vec4 v) { return vec4(${pa}_(v.x), ${pa}_(v.y), ${pa}_(v.z), ${pa}_(v.w)); } `,name:pa,type:ve.FunctionType.ValueBased}}function Qt(){return ra("log")}function ir(){const Un="neg";return{body:` float ${Un}_(float a) { return -a; } vec4 ${Un}_(vec4 v) { return -v; } `,name:Un,type:ve.FunctionType.ValueBased}}function Lr(){const Un="not";return{body:` float ${Un}_(float a) { return float( ! bool(a) ); } bool ${Un}_(bool a) { return !a; } vec4 ${Un}_(vec4 v) { return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w)); } bvec4 ${Un}_(bvec4 v) { return bvec4(!v.x, !v.y, !v.z, !v.w); } `,name:Un,type:ve.FunctionType.ValueBased}}function jr(){return ra("sin")}function tn(){const Un="relu";return{body:` float ${Un}_(float a) { return max( a, 0.0 ); } vec4 ${Un}_(vec4 v) { return max( v, 0.0 ); } `,name:Un,type:ve.FunctionType.ValueBased}}function mr(){const Un="sigmoid";return{body:` float ${Un}_(float a) { return 1.0 / (1.0 + exp(-a)); } vec4 ${Un}_(vec4 v) { return 1.0 / (1.0 + exp(-v)); } `,name:Un,type:ve.FunctionType.ValueBased}}function Ir(){return ra("sqrt")}function On(){return ra("tan")}function ba(){const Un="tanh";return{body:` float ${Un}_(float a) { a = clamp(a, -10., 10.); a = exp(2.*a); return (a - 1.) / (a + 1.); } vec4 ${Un}_(vec4 v) { v = clamp(v, -10., 10.); v = exp(2.*v); return (v - 1.) / (v + 1.); } `,name:Un,type:ve.FunctionType.ValueBased}}function ra(Un){return{body:` float ${Un}_(float a) { return ${Un}(a); } vec4 ${Un}_(vec4 v) { return ${Un}(v); } `,name:Un,type:ve.FunctionType.ValueBased}}M.glslAbs=Re,M.glslAcos=Ce,M.glslAsin=Me,M.glslAtan=$,M.glslCeil=F,M.glslCos=he,M.glslElu=we,M.glslExp=He,M.glslFloor=ut,M.glslClip=tt,M.glslIdentity=_e,M.glslLeakyRelu=Gt,M.glslLog=Qt,M.glslNeg=ir,M.glslNot=Lr,M.glslSin=jr,M.glslRelu=tn,M.glslSigmoid=mr,M.glslSqrt=Ir,M.glslTan=On,M.glslTanh=ba;const jn=(Un,pa,lo,ji)=>{const Fo=Un.session.pack?Ee.TextureType.packed:Ee.TextureType.unpacked,Qo={name:lo.name,inputTypes:[Fo],inputNames:["A"],cacheHint:ji};return Object.assign(Object.assign({},Qo),{get:()=>((Sl,Hs,Rl,bs)=>{const po=Sl.session.pack?Ee.TextureType.packed:Ee.TextureType.unpacked,es=(0,fe.getGlsl)(Sl.session.backend.glContext.version);return Object.assign(Object.assign({},Hs),{output:{dims:Rl.dims,type:Rl.type,textureType:po},shaderSource:` ${bs.body} void main() { vec4 v = ${es.texture2D}(A, TexCoords); v = ${bs.name}_(v); ${es.output} = v; } `,hasMain:!0})})(Un,Qo,pa,lo)})};M.abs=(Un,pa)=>[Un.run(jn(Un,pa[0],Re()),pa)],M.acos=(Un,pa)=>[Un.run(jn(Un,pa[0],Ce()),pa)],M.asin=(Un,pa)=>[Un.run(jn(Un,pa[0],Me()),pa)],M.atan=(Un,pa)=>[Un.run(jn(Un,pa[0],$()),pa)],M.clip=(Un,pa,lo)=>[Un.run(jn(Un,pa[0],tt(lo.min,lo.max),lo.cacheKey),pa)],M.parseClipAttributes=Un=>(0,H.createAttributeWithCacheKey)({min:Un.attributes.getFloat("min",te.MIN_CLIP),max:Un.attributes.getFloat("max",te.MAX_CLIP)}),M.clipV11=(Un,pa)=>{const lo=qn(Un,pa);return(0,M.clip)(Un,[pa[0]],lo)};const qn=(Un,pa)=>{if(pa.length>=3&&(!Un.session.isInitializer(pa[1].dataId)||!Un.session.isInitializer(pa[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const lo=pa.length>=3?pa[1].numberData[0]:te.MIN_CLIP,ji=pa.length>=3?pa[2].numberData[0]:te.MAX_CLIP;return(0,H.createAttributeWithCacheKey)({min:lo,max:ji})};M.ceil=(Un,pa)=>[Un.run(jn(Un,pa[0],F()),pa)],M.cos=(Un,pa)=>[Un.run(jn(Un,pa[0],he()),pa)],M.elu=(Un,pa,lo)=>[Un.run(jn(Un,pa[0],we(lo.alpha),lo.cacheKey),pa)],M.parseEluAttributes=Un=>(0,H.createAttributeWithCacheKey)({alpha:Un.attributes.getFloat("alpha",1)}),M.exp=(Un,pa)=>[Un.run(jn(Un,pa[0],He()),pa)],M.floor=(Un,pa)=>[Un.run(jn(Un,pa[0],ut()),pa)],M.identity=(Un,pa)=>[Un.run(jn(Un,pa[0],_e()),pa)],M.leakyRelu=(Un,pa,lo)=>[Un.run(jn(Un,pa[0],Gt(lo.alpha),lo.cacheKey),pa)],M.parseLeakyReluAttributes=Un=>(0,H.createAttributeWithCacheKey)({alpha:Un.attributes.getFloat("alpha",.01)}),M.log=(Un,pa)=>[Un.run(jn(Un,pa[0],Qt()),pa)],M.neg=(Un,pa)=>[Un.run(jn(Un,pa[0],ir()),pa)],M.not=(Un,pa)=>[Un.run(jn(Un,pa[0],Lr()),pa)],M.relu=(Un,pa)=>[Un.run(jn(Un,pa[0],tn()),pa)],M.sigmoid=(Un,pa)=>[Un.run(jn(Un,pa[0],mr()),pa)],M.sin=(Un,pa)=>[Un.run(jn(Un,pa[0],jr()),pa)],M.sqrt=(Un,pa)=>[Un.run(jn(Un,pa[0],Ir()),pa)],M.tan=(Un,pa)=>[Un.run(jn(Un,pa[0],On()),pa)],M.tanh=(Un,pa)=>[Un.run(jn(Un,pa[0],ba()),pa)]},5611:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.createUnpackProgramInfoLoader=M.createUnpackProgramInfo=void 0;const H=V(5060),te=V(2039),ve=V(9390),fe=V(2827),Ee={name:"unpack",inputNames:["A"],inputTypes:[te.TextureType.packed]};M.createUnpackProgramInfo=(Re,Ce)=>{const Me=Ce.dims.length,$=(0,fe.getChannels)("rc",Me),F=$.slice(-2),he=(0,ve.getCoordsDataType)(Me),we=(0,fe.unpackFromChannel)(),He=Ce.dims.length===0?"":function(_e,Gt){if(_e===1)return"rc";let Qt="";for(let ir=0;ir<_e;ir++)Qt+=Gt[ir],ir<_e-1&&(Qt+=",");return Qt}(Me,$),ut=Me<=1?"rc":`vec2(${F.join(",")})`,tt=` ${we} void main() { ${he} rc = getOutputCoords(); // Sample the texture with the coords to get the rgba channel value. vec4 packedInput = getA(${He}); ${(0,H.getGlsl)(Re.session.backend.glContext.version).output} = vec4(getChannel(packedInput, ${ut}), 0, 0, 0); } `;return Object.assign(Object.assign({},Ee),{hasMain:!0,output:{dims:Ce.dims,type:Ce.type,textureType:te.TextureType.unpacked},shaderSource:tt})},M.createUnpackProgramInfoLoader=(Re,Ce)=>Object.assign(Object.assign({},Ee),{get:()=>(0,M.createUnpackProgramInfo)(Re,Ce)})},8428:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.parseUnsqueezeAttributes=M.unsqueezeV13=M.unsqueeze=void 0;const H=V(2517);M.unsqueeze=(fe,Ee,Re)=>{te(Ee);const Ce=H.ShapeUtil.unsqueezeShape(Ee[0].dims,Re);return[fe.reshapeUnpacked(Ee[0],Ce)]},M.unsqueezeV13=(fe,Ee)=>(ve(Ee),(0,M.unsqueeze)(fe,[Ee[0]],Array.from(Ee[1].integerData))),M.parseUnsqueezeAttributes=fe=>fe.attributes.getInts("axes");const te=fe=>{if(!fe||fe.length!==1)throw new Error("Unsqueeze requires 1 input.");if(fe[0].type==="string")throw new Error("invalid input tensor types.")},ve=fe=>{if(!fe||fe.length!==2)throw new Error("Unsqueeze requires 2 inputs.");if(fe[1].type!=="int32")throw new Error("Invalid input type.")}},9793:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.scalesValidation=M.validateInputs=M.parseUpsampleAttributes=M.parseUpsampleAttributesV9=M.parseUpsampleAttributesV7=M.upsample=void 0;const H=V(246),te=V(5060),ve=V(2039),fe={name:"Upsample",inputNames:["X"],inputTypes:[ve.TextureType.unpacked]};M.upsample=(Re,Ce,Me)=>((0,M.validateInputs)(Ce,Me),[Re.run(Object.assign(Object.assign({},fe),{cacheHint:Me.cacheKey,get:()=>Ee(Re,Ce,Me)}),Ce)]),M.parseUpsampleAttributesV7=Re=>(0,M.parseUpsampleAttributes)(Re,7),M.parseUpsampleAttributesV9=Re=>(0,M.parseUpsampleAttributes)(Re,9),M.parseUpsampleAttributes=(Re,Ce)=>{const Me=Ce>=10,$=Re.attributes.getString("mode","nearest");if($!=="nearest"&&$!=="linear"&&(Ce<11||$!=="cubic"))throw new Error(`unrecognized mode: ${$}`);let F=[];Ce<9&&(F=Re.attributes.getFloats("scales"),(0,M.scalesValidation)(F,$,Me));const he=Re.attributes.getFloat("extrapolation_value",0),we=Ce>10?Re.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(we)===-1)throw new Error(`coordinate_transform_mode '${we}' is not supported`);const He=we==="tf_crop_and_resize",ut=He,tt=$==="nearest"&&Ce>=11?Re.attributes.getString("nearest_mode","round_prefer_floor"):"";if(["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(tt)===-1)throw new Error(`nearest_mode '${tt}' is not supported`);const _e=Re.attributes.getFloat("cubic_coeff_a",-.75),Gt=Re.attributes.getInt("exclude_outside",0)!==0;if(Gt&&$!=="cubic")throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const Qt=Ce<11||$==="nearest"&&we==="asymmetric"&&tt==="floor";let ir=0,Lr=0,jr=0;return Ce>10?Re.inputs.length>2?(ir=1,Lr=2,jr=3):(Lr=1,jr=2):Ce===9&&(Lr=1),(0,H.createAttributeWithCacheKey)({opset:Ce,isResize:Me,mode:$,scales:F,extrapolationValue:he,coordinateTransformMode:we,useExtrapolation:ut,needRoiInput:He,nearestMode:tt,cubicCoefficientA:_e,excludeOutside:Gt,useNearest2xOptimization:Qt,roiInputIdx:ir,scalesInputIdx:Lr,sizesInputIdx:jr})};const Ee=(Re,Ce,Me)=>{const $=(0,te.getGlsl)(Re.session.backend.glContext.version),[F,he]=Re.calculateTextureWidthAndHeight(Ce[0].dims,ve.TextureType.unpacked),we=Ce[0].dims.map((jr,tn)=>Math.floor(jr*Me.scales[tn])),[He,ut]=Re.calculateTextureWidthAndHeight(we,ve.TextureType.unpacked),tt=we.length,_e=new Array(tt),Gt=new Array(tt);let Qt=` int output_pitches[${tt}]; int input_pitches[${tt}]; `;for(let jr=tt-1;jr>=0;jr--)_e[jr]=jr===tt-1?1:_e[jr+1]*we[jr+1],Gt[jr]=jr===tt-1?1:Gt[jr+1]*Ce[0].dims[jr+1],Qt+=` output_pitches[${jr}] = ${_e[jr]}; input_pitches[${jr}] = ${Gt[jr]}; `;const ir=` float getInputFloat(int index) { vec2 coords = offsetToCoords(index, ${F}, ${he}); float value = getColorAsFloat(${$.texture2D}(X, coords)); return value; } `,Lr=Me.mode==="nearest"?` ${ir} float process(int indices[${tt}]) { int input_index = 0; int output_index = coordsToOffset(TexCoords, ${He}, ${ut}); ${Qt} int d, m; for (int dim = 0; dim < ${tt}; ++dim) { d = output_index / output_pitches[dim]; m = output_index - d * output_pitches[dim]; output_index = m; if (scales[dim] != 1 && d > 0) { int d2 = d / scales[dim]; m = d - d2 * scales[dim]; d = d2; } input_index += input_pitches[dim] * d; } return getInputFloat(input_index); }`:tt===4?` ${ir} float process(int indices[4]) { int input_index = 0; int output_index = coordsToOffset(TexCoords, ${He}, ${ut}); ${Qt} int m; int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3; index_of_dim0 = output_index / output_pitches[0]; m = output_index - index_of_dim0 * output_pitches[0]; index_of_dim1 = m / output_pitches[1]; m = m - index_of_dim1 * output_pitches[1]; index_of_dim2 = m / output_pitches[2]; m = m - index_of_dim2 * output_pitches[2]; index_of_dim3 = m; int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset; index_of_input_dim2 = index_of_dim2 / scales[2]; y_offset = index_of_dim2 - index_of_input_dim2 * scales[2]; index_of_input_dim3 = index_of_dim3 / scales[3]; x_offset = index_of_dim3 - index_of_input_dim3 * scales[3]; input_index = index_of_dim0 * input_pitches[0] + index_of_dim1 * input_pitches[1] + index_of_input_dim2 * input_pitches[2] + index_of_input_dim3; float x00 = getInputFloat(input_index); float x10, x01, x11; bool end_of_dim2 = false; if (index_of_input_dim2 == (${Ce[0].dims[2]} - 1)) { // It's the end in dimension 2 x01 = x00; end_of_dim2 = true; } else { x01 = getInputFloat(input_index + input_pitches[2]); } if (index_of_input_dim3 == (input_pitches[2] - 1)) { // It's the end in dimension 3 x10 = x00; x11 = x01; } else { x10 = getInputFloat(input_index + 1); x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1); } float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]); float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]); return y0 + float(x_offset) * (y1 - y0) / float(scales[3]); }`:` ${ir} float process(int indices[2]) { int input_index = 0; int output_index = coordsToOffset(TexCoords, ${He}, ${ut}); ${Qt} int m; int index_of_dim0, index_of_dim1; index_of_dim0 = output_index / output_pitches[0]; m = output_index - index_of_dim0 * output_pitches[0]; index_of_dim1 = m; int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset; index_of_input_dim0 = index_of_dim0 / scales[0]; y_offset = index_of_dim0 - index_of_input_dim0 * scales[0]; index_of_input_dim1 = index_of_dim1 / scales[1]; x_offset = index_of_dim1 - index_of_input_dim1 * scales[1]; input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1; float x00 = getInputFloat(input_index); float x10, x01, x11; bool end_of_dim0 = false; if (index_of_input_dim0 == (${Ce[0].dims[0]} - 1)) { // It's the end in dimension 0 x01 = x00; end_of_dim0 = true; } else { x01 = getInputFloat(input_index + input_pitches[0]); } if (index_of_input_dim1 == (input_pitches[0] - 1)) { // It's the end in dimension 1 x10 = x00; x11 = x01; } else { x10 = getInputFloat(input_index + 1); x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1); } float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]); float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]); return y0 + float(x_offset) * (y1 - y0) / float(scales[1]); }`;return Object.assign(Object.assign({},fe),{output:{dims:we,type:Ce[0].type,textureType:ve.TextureType.unpacked},shaderSource:Lr,variables:[{name:"scales",type:"int",arrayLength:Me.scales.length,data:Me.scales.map(jr=>Math.ceil(jr))}]})};M.validateInputs=(Re,Ce)=>{if(!Re||Ce.opset<9&&Re.length!==1||Ce.opset>=9&&Ce.opset<11&&Re.length!==2||Ce.opset>=11&&Re.length<2)throw new Error("invalid inputs.");if(Ce.scales.length>0&&Re[0].dims.length!==Ce.scales.length)throw new Error("Invalid input shape.");if(Re[0].type==="string")throw new Error("Invalid input tensor types.")},M.scalesValidation=(Re,Ce,Me)=>{if(Me){for(const $ of Re)if($<=0)throw new Error("Scale value should be greater than 0.")}else for(const $ of Re)if($<1)throw new Error("Scale value should be greater than or equal to 1.");if(!(Ce!=="linear"&&Ce!=="cubic"||Re.length===2||Re.length===4&&Re[0]===1&&Re[1]===1))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${Me?"Resize":"Upsample"} opeartor.`)}},1958:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.ProgramManager=void 0;const H=V(1670),te=V(6231),ve=V(8879),fe=V(5060);M.ProgramManager=class{constructor(Ee,Re,Ce){this.profiler=Ee,this.glContext=Re,this.textureLayoutStrategy=Ce,this.repo=new Map,this.attributesBound=!1}getArtifact(Ee){return this.repo.get(Ee)}setArtifact(Ee,Re){this.repo.set(Ee,Re)}run(Ee,Re,Ce){var Me;this.profiler.event("op",`ProgramManager.run ${(Me=Ee.programInfo.name)!==null&&Me!==void 0?Me:"unknown kernel"}`,()=>{var $;const F=this.glContext.gl,he=Ee.program;F.useProgram(he);try{this.bindOutput(Ce),this.attributesBound||this.bindAttributes(Ee.attribLocations),this.bindUniforms(Ee.uniformLocations,($=Ee.programInfo.variables)!==null&&$!==void 0?$:[],Re)}catch(we){throw te.Logger.error("ProgramManager",Ee.programInfo.shaderSource),we}this.profiler.event("backend","GlContext.draw()",()=>{this.glContext.draw()})},this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach(Ee=>this.glContext.deleteProgram(Ee.program))}build(Ee,Re,Ce){return this.profiler.event("backend","ProgramManager.build",()=>{const Me=new ve.GlslPreprocessor(this.glContext,Ee,Re,Ce),$=Me.preprocess(),F=this.compile($);return{programInfo:Ee,program:F,uniformLocations:this.getUniformLocations(F,Me.context.programInfo.inputNames,Me.context.programInfo.variables),attribLocations:this.getAttribLocations(F)}})}compile(Ee){if(!this.vertexShader){te.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const Me=(0,fe.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(Me,this.glContext.gl.VERTEX_SHADER)}H.env.debug&&te.Logger.verbose("ProrgramManager",`FragShader: ${Ee} `);const Re=this.glContext.compileShader(Ee,this.glContext.gl.FRAGMENT_SHADER),Ce=this.glContext.createProgram(this.vertexShader,Re);return this.glContext.deleteShader(Re),Ce}bindOutput(Ee){const Re=Ee.width,Ce=Ee.height;te.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${Re}/${Ce}, shape=${Ee.shape}, type=${Ee.tensor.type}`),this.glContext.attachFramebuffer(Ee.texture,Re,Ce)}bindAttributes(Ee){const Re=Ee.position,Ce=Ee.textureCoord;this.glContext.setVertexAttributes(Re,Ce),this.attributesBound=!0}bindUniforms(Ee,Re,Ce){var Me;const $=this.glContext.gl;let F=0;for(const{name:he,type:we,location:He,arrayLength:ut}of Ee){const tt=(Me=Re.find(_e=>_e.name===he))===null||Me===void 0?void 0:Me.data;if(we!=="sampler2D"&&!tt)throw new Error(`variable '${he}' does not have data defined in program info`);switch(we){case"sampler2D":this.bindTexture(Ce[F],He,F),F++;break;case"float":ut?$.uniform1fv(He,tt):$.uniform1f(He,tt);break;case"int":ut?$.uniform1iv(He,tt):$.uniform1i(He,tt);break;default:throw new Error(`Uniform not implemented: ${we}`)}}}bindTexture(Ee,Re,Ce){this.glContext.bindTextureToUniform(Ee.texture,Ce,Re)}getAttribLocations(Ee){return{position:this.getAttribLocation(Ee,"position"),textureCoord:this.getAttribLocation(Ee,"textureCoord")}}getUniformLocations(Ee,Re,Ce){const Me=[];if(Re)for(const $ of Re)Me.push({name:$,type:"sampler2D",location:this.getUniformLocation(Ee,$)});if(Ce)for(const $ of Ce)Me.push(Object.assign(Object.assign({},$),{location:this.getUniformLocation(Ee,$.name)}));return Me}getUniformLocation(Ee,Re){const Ce=this.glContext.gl.getUniformLocation(Ee,Re);if(Ce===null)throw new Error(`Uniform ${Re} not found.`);return Ce}getAttribLocation(Ee,Re){return this.glContext.gl.getAttribLocation(Ee,Re)}}},6416:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.WebGLSessionHandler=void 0;const H=V(6231),te=V(1047),ve=V(8316),fe=V(1640),Ee=V(1958),Re=V(7859),Ce=V(5702);M.WebGLSessionHandler=class{constructor(Me,$){this.backend=Me,this.context=$,this.layoutStrategy=new Re.PreferLogicalStrategy(Me.glContext.maxTextureSize),this.programManager=new Ee.ProgramManager(this.context.profiler,Me.glContext,this.layoutStrategy),this.textureManager=new Ce.TextureManager(Me.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:Me.textureCacheMode==="full"}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=Me.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new ve.WebGLInferenceHandler(this)}onGraphInitialized(Me){const $=Me.getValues().filter(F=>F.from===-1&&F.tensor).map(F=>F.tensor.dataId);this.initializers=new Set($)}isInitializer(Me){return!!this.initializers&&this.initializers.has(Me)}addInitializer(Me){this.initializers.add(Me)}getTextureData(Me,$){return $?this.packedTextureDataCache.get(Me):this.unpackedTextureDataCache.get(Me)}setTextureData(Me,$,F=!1){H.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),F?this.packedTextureDataCache.set(Me,$):this.unpackedTextureDataCache.set(Me,$)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(Me=>this.textureManager.releaseTexture(Me,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(Me=>this.textureManager.releaseTexture(Me,!0)),this.unpackedTextureDataCache=new Map}resolve(Me,$,F){const he=(0,te.resolveOperator)(Me,$,fe.WEBGL_OP_RESOLVE_RULES);return{impl:he.opImpl,context:he.opInit?he.opInit(Me,F):Me}}}},7769:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.Uint8DataEncoder=M.RGBAFloatDataEncoder=M.RedFloat32DataEncoder=void 0;const H=V(6231);M.RedFloat32DataEncoder=class{constructor(te,ve=1){if(ve===1)this.internalFormat=te.R32F,this.format=te.RED,this.textureType=te.FLOAT,this.channelSize=ve;else{if(ve!==4)throw new Error(`Invalid number of channels: ${ve}`);this.internalFormat=te.RGBA32F,this.format=te.RGBA,this.textureType=te.FLOAT,this.channelSize=ve}}encode(te,ve){let fe,Ee;return te.constructor!==Float32Array&&(H.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),Ee=new Float32Array(te)),ve*this.channelSize>te.length?(H.Logger.warning("Encoder","Source data too small. Allocating larger array"),Ee=te,fe=this.allocate(ve*this.channelSize),Ee.forEach((Re,Ce)=>fe[Ce]=Re)):(Ee=te,fe=Ee),fe}allocate(te){return new Float32Array(4*te)}decode(te,ve){return this.channelSize===1?te.filter((fe,Ee)=>Ee%4==0).subarray(0,ve):te.subarray(0,ve)}},M.RGBAFloatDataEncoder=class{constructor(te,ve=1,fe){if(ve!==1&&ve!==4)throw new Error(`Invalid number of channels: ${ve}`);this.internalFormat=te.RGBA,this.format=te.RGBA,this.channelSize=ve,this.textureType=fe||te.FLOAT}encode(te,ve){let fe=te;return this.channelSize===1&&(H.Logger.verbose("Encoder","Exploding into a larger array"),fe=this.allocate(ve),te.forEach((Ee,Re)=>fe[4*Re]=Ee)),fe}allocate(te){return new Float32Array(4*te)}decode(te,ve){return this.channelSize===1?te.filter((fe,Ee)=>Ee%4==0).subarray(0,ve):te.subarray(0,ve)}},M.Uint8DataEncoder=class{constructor(te,ve=1){if(this.channelSize=4,ve===1)this.internalFormat=te.ALPHA,this.format=te.ALPHA,this.textureType=te.UNSIGNED_BYTE,this.channelSize=ve;else{if(ve!==4)throw new Error(`Invalid number of channels: ${ve}`);this.internalFormat=te.RGBA,this.format=te.RGBA,this.textureType=te.UNSIGNED_BYTE,this.channelSize=ve}}encode(te,ve){return new Uint8Array(te.buffer,te.byteOffset,te.byteLength)}allocate(te){return new Uint8Array(te*this.channelSize)}decode(te,ve){if(te instanceof Uint8Array)return te.subarray(0,ve);throw new Error(`Invalid array type: ${te.constructor}`)}}},7859:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.getBatchDim=M.sizeToSquarishShape=M.getRowsCols=M.sizeFromShape=M.isInt=M.parseAxisParam=M.squeezeShape=M.PreferLogicalStrategy=M.AlwaysKeepOriginalSizeStrategy=void 0;const H=V(6231),te=V(2517);function ve(Me,$){const F=[],he=[],we=$!=null&&Array.isArray($)&&$.length===0,He=$==null||we?null:fe($,Me).sort();let ut=0;for(let tt=0;tttt)&&Me[tt]===1&&(F.push(Me[tt]),he.push(tt)),He[ut]<=tt&&ut++}Me[tt]!==1&&(F.push(Me[tt]),he.push(tt))}return{newShape:F,keptDims:he}}function fe(Me,$){const F=$.length;return Me=Me==null?$.map((he,we)=>we):[].concat(Me),(0,te.assert)(Me.every(he=>he>=-F&&he`All values in axis param must be in range [-${F}, ${F}) but got axis ${Me}`),(0,te.assert)(Me.every(Ee),()=>`All values in axis param must be integers but got axis ${Me}`),Me.map(he=>he<0?F+he:he)}function Ee(Me){return Me%1==0}function Re(Me){if(Me.length===0)return 1;let $=Me[0];for(let F=1;F=Me.length?1:Me.slice($.breakAxis).reduce((tt,_e)=>tt*_e),ut=$.breakAxis<=0?1:Me.slice(0,$.breakAxis).reduce((tt,_e)=>tt*_e);if(!(He>F||ut>F))return[He,ut];H.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${Me}, breakAxis:${$.breakAxis}`)}const he=Me.reduce((He,ut)=>He*ut);let we=Math.floor(Math.sqrt(he));for(;we=F||he%we!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${Me}`);return[we,he/we]}},M.PreferLogicalStrategy=class{constructor(Me){this.maxTextureSize=Me}computeTextureWH(Me,$){const F=this.computeTexture(Me,$);return $&&$.isPacked&&(F[0]/=2,F[1]/=2),$&&$.reverseWH?[F[1],F[0]]:F}computeTexture(Me,$){const F=$&&$.isPacked;if(Me.length===0)return F?[2,2]:[1,1];let he=this.maxTextureSize;if($&&$.breakAxis!==void 0){const ut=$.breakAxis>=Me.length?1:Me.slice($.breakAxis).reduce((_e,Gt)=>_e*Gt),tt=$.breakAxis<=0?1:Me.slice(0,$.breakAxis).reduce((_e,Gt)=>_e*Gt);if(!(ut>he||tt>he))return[ut,tt];H.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${Me}, breakAxis:${$.breakAxis}`)}let we=Me.slice(0);F&&(he*=2,we=we.map((ut,tt)=>tt>=we.length-2?we[tt]%2==0?we[tt]:we[tt]+1:we[tt]),we.length===1&&(we=[2,we[0]])),we.length!==2&&(we=ve(we).newShape);const He=Re(we);return we.length<=1&&He<=he?[1,He]:we.length===2&&we[0]<=he&&we[1]<=he?we:we.length===3&&we[0]*we[1]<=he&&we[2]<=he?[we[0]*we[1],we[2]]:we.length===3&&we[0]<=he&&we[1]*we[2]<=he?[we[0],we[1]*we[2]]:we.length===4&&we[0]*we[1]*we[2]<=he&&we[3]<=he?[we[0]*we[1]*we[2],we[3]]:we.length===4&&we[0]<=he&&we[1]*we[2]*we[3]<=he?[we[0],we[1]*we[2]*we[3]]:F?Ce(He/4).map(ut=>2*ut):Ce(He)}},M.squeezeShape=ve,M.parseAxisParam=fe,M.isInt=Ee,M.sizeFromShape=Re,M.getRowsCols=function(Me){if(Me.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[Me.length>1?Me[Me.length-2]:1,Me[Me.length-1]]},M.sizeToSquarishShape=Ce,M.getBatchDim=function(Me,$=2){return Re(Me.slice(0,Me.length-$))}},4057:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.createTextureLayoutFromShape=M.calculateTextureWidthAndHeight=M.createTextureLayoutFromTextureType=void 0;const H=V(2517),te=V(2039);M.createTextureLayoutFromTextureType=(ve,fe,Ee)=>{const Re=Ee===te.TextureType.unpacked||Ee===te.TextureType.unpackedReversed?1:4,Ce=Ee===te.TextureType.packed,Me=Ee===te.TextureType.unpackedReversed||Ee===te.TextureType.packed,$=Ee===te.TextureType.packedLastDimension?fe.length-1:void 0,F=Ee===te.TextureType.packedLastDimension?fe.map((he,we)=>we===fe.length-1?4*he:he):void 0;return(0,M.createTextureLayoutFromShape)(ve,fe,Re,F,{isPacked:Ce,reverseWH:Me,breakAxis:$})},M.calculateTextureWidthAndHeight=(ve,fe,Ee)=>{const Re=(0,M.createTextureLayoutFromTextureType)(ve,fe,Ee);return[Re.width,Re.height]},M.createTextureLayoutFromShape=(ve,fe,Ee=1,Re,Ce)=>{const Me=!(!Ce||!Ce.isPacked),[$,F]=ve.computeTextureWH(Me&&Re||fe,Ce),he=fe.length;let we=fe.slice(0);if(he===0&&(we=[1]),Ee===1)Re=fe;else if(Me){if(Ee!==4)throw new Error("a packed texture must be 4-channel");Re=fe,he>0&&(we[he-1]=Math.ceil(we[he-1]/2)),he>1&&(we[he-2]=Math.ceil(we[he-2]/2))}else if(!Re)throw new Error("Unpacked shape is needed when using channels > 1");return{width:$,height:F,channels:Ee,isPacked:Me,shape:we,strides:H.ShapeUtil.computeStrides(we),unpackedShape:Re,reversedWH:Ce&&Ce.reverseWH}}},5702:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.TextureManager=void 0;const H=V(6231);M.TextureManager=class{constructor(te,ve,fe,Ee){this.glContext=te,this.layoutStrategy=ve,this.profiler=fe,this.config=Ee,this.pendingRead=new Map,Ee.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(te,ve,fe,Ee){const Re=this.toEncoderType(te),Ce=this.glContext.getEncoder(Re,ve.channels||1,Ee);if(ve.isPacked&&Ee===1)throw new Error("not implemented");const Me=ve.width,$=ve.height;let F,he;if(this.config.reuseTextures){F=`${Me}x${$}_${Ce.format}_${Ce.internalFormat}_${Ce.textureType}`,he=this.inUseTextures.get(F),he||(he=[],this.inUseTextures.set(F,he));const He=this.idleTextures.get(F);if(He&&He.length>0){const ut=He.pop();return he.push(ut),Ee===1&&this.glContext.updateTexture(ut,Me,$,Ce,this.toTextureData(te,fe)),ut}}H.Logger.verbose("TextureManager",`Creating new texture of size ${ve.width}x${ve.height}`);const we=this.glContext.allocateTexture(Me,$,Ce,this.toTextureData(te,fe));return this.config.reuseTextures&&(he.push(we),this.textureLookup.set(we,F)),we}readTexture(te,ve,fe){return fe||(fe=1),this.profiler.event("backend","TextureManager.readTexture",()=>{const Ee=te.shape.reduce((Ce,Me)=>Ce*Me)*fe,Re=this.glContext.readTexture(te.texture,te.width,te.height,Ee,this.toEncoderType(ve),fe);return this.toTensorData(ve,Re)})}async readTextureAsync(te,ve,fe){const Ee=te.tensor.dataId;if(fe||(fe=1),this.pendingRead.has(Ee)){const Re=this.pendingRead.get(Ee);return new Promise(Ce=>Re?.push(Ce))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(Ee,[]);const Re=te.shape.reduce((F,he)=>F*he)*fe;await this.glContext.createAndWaitForFence();const Ce=this.glContext.readTexture(te.texture,te.width,te.height,Re,this.toEncoderType(ve),fe),Me=this.toTensorData(ve,Ce),$=this.pendingRead.get(Ee);return this.pendingRead.delete(Ee),$?.forEach(F=>F(Me)),Me})}readUint8TextureAsFloat(te){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{const ve=te.shape.reduce((Ee,Re)=>Ee*Re),fe=this.glContext.readTexture(te.texture,te.width,te.height,4*ve,"byte",4);return new Float32Array(fe.buffer,fe.byteOffset,ve)})}releaseTexture(te,ve){let fe;if(this.config.reuseTextures&&(fe=this.textureLookup.get(te.texture),fe)){ve&&this.textureLookup.delete(fe);const Ee=this.inUseTextures.get(fe);if(Ee){const Re=Ee.indexOf(te.texture);if(Re!==-1){Ee.splice(Re,1);let Ce=this.idleTextures.get(fe);Ce||(Ce=[],this.idleTextures.set(fe,Ce)),Ce.push(te.texture)}}}fe&&!ve||(H.Logger.verbose("TextureManager",`Deleting texture of size ${te.width}x${te.height}`),this.glContext.deleteTexture(te.texture))}toTensorData(te,ve){switch(te){case"int16":return ve instanceof Int16Array?ve:Int16Array.from(ve);case"int32":return ve instanceof Int32Array?ve:Int32Array.from(ve);case"int8":return ve instanceof Int8Array?ve:Int8Array.from(ve);case"uint16":return ve instanceof Uint16Array?ve:Uint16Array.from(ve);case"uint32":return ve instanceof Uint32Array?ve:Uint32Array.from(ve);case"uint8":case"bool":return ve instanceof Uint8Array?ve:Uint8Array.from(ve);case"float32":return ve instanceof Float32Array?ve:Float32Array.from(ve);case"float64":return ve instanceof Float64Array?ve:Float64Array.from(ve);default:throw new Error(`TensorData type ${te} is not supported`)}}toTextureData(te,ve){if(ve)return ve instanceof Float32Array?ve:new Float32Array(ve)}toEncoderType(te){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(be,M)=>{var V;Object.defineProperty(M,"__esModule",{value:!0}),M.TextureType=void 0,(V=M.TextureType||(M.TextureType={}))[V.unpacked=0]="unpacked",V[V.unpackedReversed=1]="unpackedReversed",V[V.packed=2]="packed",V[V.downloadUint8AsFloat=3]="downloadUint8AsFloat",V[V.packedLastDimension=4]="packedLastDimension"},9390:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.getGlChannels=M.getCoordsDataType=M.getSqueezedParams=M.squeezeInputShape=M.generateShaderFuncNameFromInputSamplerNameAtOutCoords=M.generateShaderFuncNameFromInputSamplerName=M.repeatedTry=M.getPackedShape=void 0;const H=V(2517);M.getPackedShape=function(te){const ve=te.length;return te.slice(0,ve-1).concat(te[ve-1]/4)},M.repeatedTry=async function(te,ve=Ee=>0,fe){return new Promise((Ee,Re)=>{let Ce=0;const Me=()=>{if(te())return void Ee();Ce++;const $=ve(Ce);fe!=null&&Ce>=fe?Re():setTimeout(Me,$)};Me()})},M.generateShaderFuncNameFromInputSamplerName=function(te){return(0,H.assert)(te!==void 0&&te.length!==0,()=>"empty string found for sampler name"),"get"+te.charAt(0).toUpperCase()+te.slice(1)},M.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(te){return(0,H.assert)(te!==void 0&&te.length!==0,()=>"empty string found for sampler name"),"get"+te.charAt(0).toUpperCase()+te.slice(1)+"AtOutCoords"},M.squeezeInputShape=function(te,ve){let fe=JSON.parse(JSON.stringify(te));return fe=ve,fe},M.getSqueezedParams=function(te,ve){return ve.map(fe=>te[fe]).join(", ")},M.getCoordsDataType=function(te){if(te<=1)return"int";if(te===2)return"ivec2";if(te===3)return"ivec3";if(te===4)return"ivec4";if(te===5)return"ivec5";if(te===6)return"ivec6";throw Error(`GPU for rank ${te} is not yet supported`)},M.getGlChannels=function(te=6){return["x","y","z","w","u","v"].slice(0,te)}},7305:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.createNewWebGLContext=M.createWebGLContext=void 0;const H=V(6231),te=V(1713),ve={};function fe(Ee){const Re=function(){if(typeof document>"u"){if(typeof OffscreenCanvas>"u")throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const $=document.createElement("canvas");return $.width=1,$.height=1,$}();let Ce;const Me={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!Ee||Ee==="webgl2")&&(Ce=Re.getContext("webgl2",Me),Ce))try{return new te.WebGLContext(Ce,2)}catch($){H.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${$}`)}if((!Ee||Ee==="webgl")&&(Ce=Re.getContext("webgl",Me)||Re.getContext("experimental-webgl",Me),Ce))try{return new te.WebGLContext(Ce,1)}catch($){H.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${$}`)}throw new Error("WebGL is not supported")}M.createWebGLContext=function Ee(Re){let Ce;Re&&Re!=="webgl2"||!("webgl2"in ve)?Re&&Re!=="webgl"||!("webgl"in ve)||(Ce=ve.webgl):Ce=ve.webgl2,Ce=Ce||fe(Re),Re=Re||Ce.version===1?"webgl":"webgl2";const Me=Ce.gl;return ve[Re]=Ce,Me.isContextLost()?(delete ve[Re],Ee(Re)):(Me.disable(Me.DEPTH_TEST),Me.disable(Me.STENCIL_TEST),Me.disable(Me.BLEND),Me.disable(Me.DITHER),Me.disable(Me.POLYGON_OFFSET_FILL),Me.disable(Me.SAMPLE_COVERAGE),Me.enable(Me.SCISSOR_TEST),Me.enable(Me.CULL_FACE),Me.cullFace(Me.BACK),Ce)},M.createNewWebGLContext=fe},1713:function(be,M,V){var H=this&&this.__createBinding||(Object.create?function(Me,$,F,he){he===void 0&&(he=F);var we=Object.getOwnPropertyDescriptor($,F);we&&!("get"in we?!$.__esModule:we.writable||we.configurable)||(we={enumerable:!0,get:function(){return $[F]}}),Object.defineProperty(Me,he,we)}:function(Me,$,F,he){he===void 0&&(he=F),Me[he]=$[F]}),te=this&&this.__setModuleDefault||(Object.create?function(Me,$){Object.defineProperty(Me,"default",{enumerable:!0,value:$})}:function(Me,$){Me.default=$}),ve=this&&this.__importStar||function(Me){if(Me&&Me.__esModule)return Me;var $={};if(Me!=null)for(var F in Me)F!=="default"&&Object.prototype.hasOwnProperty.call(Me,F)&&H($,Me,F);return te($,Me),$};Object.defineProperty(M,"__esModule",{value:!0}),M.WebGLContext=M.linearSearchLastTrue=void 0;const fe=V(1670),Ee=ve(V(7769)),Re=V(9390);function Ce(Me){let $=0;for(;$this.isTimerResultAvailable(Me)),this.getTimerResult(Me)}async createAndWaitForFence(){const Me=this.createFence(this.gl);return this.pollFence(Me)}createFence(Me){let $;const F=Me,he=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);return Me.flush(),$=he===null?()=>!0:()=>{const we=F.clientWaitSync(he,0,0);return we===F.ALREADY_SIGNALED||we===F.CONDITION_SATISFIED},{query:he,isFencePassed:$}}async pollFence(Me){return new Promise($=>{this.addItemToPoll(()=>Me.isFencePassed(),()=>$())})}pollItems(){const Me=Ce(this.itemsToPoll.map($=>$.isDoneFn));for(let $=0;$<=Me;++$){const{resolveFn:F}=this.itemsToPoll[$];F()}this.itemsToPoll=this.itemsToPoll.slice(Me+1)}async addItemToPoll(Me,$){this.itemsToPoll.push({isDoneFn:Me,resolveFn:$}),this.itemsToPoll.length>1||await(0,Re.repeatedTry)(()=>(this.pollItems(),this.itemsToPoll.length===0))}}},1036:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.ExecutionPlan=void 0;const H=V(6231);class te{constructor(fe,Ee){this.op=fe,this.node=Ee}}M.ExecutionPlan=class{constructor(ve,fe,Ee){this.graph=ve,this.profiler=Ee,this.initialize(fe)}initialize(ve){this.profiler.event("session","ExecutionPlan.initialize",()=>{const fe=this.graph.getNodes();if(fe.length!==ve.length)throw new Error("The size of nodes and OPs do not match.");this._ops=ve.map((Ee,Re)=>new te(Ee,fe[Re])),this.reset(),this._starter=[],this._ops.forEach((Ee,Re)=>{let Ce=!0;for(const Me of Ee.node.inputs)if(!this._values[Me]&&this.graph.getInputIndices().indexOf(Me)===-1){Ce=!1;break}Ce&&this._starter.push(Re)})})}reset(){this._values=this.graph.getValues().map(ve=>ve.tensor)}async execute(ve,fe){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();const Ee=ve.createInferenceHandler(),Re=this.graph.getInputIndices();if(fe.length!==Re.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${fe.length} expected: ${Re.length}`);fe.forEach((we,He)=>{const ut=Re[He];this._values[ut]=we});const Ce=this._starter.slice(0),Me=this.graph.getValues(),$=this.graph.getNodes();let F=0;for(;Fthis._values[Qt]);if(ut.indexOf(void 0)!==-1)throw new Error(`unresolved input detected: op: ${He.node}`);const tt=ut;H.Logger.verbose("ExecPlan",`Runing op:${He.node.name} (${tt.map((Qt,ir)=>`'${He.node.inputs[ir]}': ${Qt.type}[${Qt.dims.join(",")}]`).join(", ")})`);const _e=await this.profiler.event("node",He.node.name,async()=>He.op.impl(Ee,tt,He.op.context));if(_e.length!==He.node.outputs.length)throw new Error("the size of output does not match model definition.");_e.forEach((Qt,ir)=>{const Lr=He.node.outputs[ir];if(this._values[Lr])throw new Error(`output [${Lr}] already has value: op:${He.node.name}`);this._values[Lr]=Qt});const Gt=new Set;_e.forEach((Qt,ir)=>{const Lr=He.node.outputs[ir];for(const jr of Me[Lr].to){const tn=$[jr];let mr=!0;for(const Ir of tn.inputs)if(!this._values[Ir]){mr=!1;break}mr&&Gt.add(jr)}}),Ce.push(...Gt)}const he=[];for(let we=0;we{Object.defineProperty(M,"__esModule",{value:!0}),M.Graph=void 0;const H=V(1446),te=V(7778),ve=V(9395),fe=V(9162),Ee=V(2517);var Re=ve.onnxruntime.experimental.fbs;M.Graph={from:(F,he)=>new $(F,he)};class Ce{constructor(he){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,he&&(this.type=Ee.ProtoUtil.tensorValueTypeFromProto(he.type.tensorType))}get from(){return this._from}get to(){return this._to}}class Me{constructor(he,we){he instanceof H.onnx.NodeProto?(this.name=he.name,this.opType=he.opType,this.attributes=new te.Attribute(he.attribute)):he instanceof Re.Node&&(this.name=we??he.name(),this.opType=he.opType(),this.attributes=new te.Attribute(Ee.ProtoUtil.tensorAttributesFromORTFormat(he))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class ${constructor(he,we){if(!he)throw new TypeError("graph is empty");this.buildGraph(he),this.transformGraph(we),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(he){if(he instanceof H.onnx.GraphProto)this.buildGraphFromOnnxFormat(he);else{if(!(he instanceof Re.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(he)}}buildGraphFromOnnxFormat(he){const we=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const He=new Map;if(!he.input)throw new Error("missing information in graph: input");const ut=[];for(const tt of he.input){if(we.has(tt.name))throw new Error(`duplicated input name: ${tt.name}`);const _e=this._allData.push(new Ce(tt))-1;we.set(tt.name,_e),ut.push(tt.name)}if(!he.initializer)throw new Error("missing information in graph: initializer");for(const tt of he.initializer){let _e=we.get(tt.name);if(_e===void 0){const Gt=new Ce;Gt.type={shape:{dims:Ee.ProtoUtil.tensorDimsFromProto(tt.dims)},tensorType:Ee.ProtoUtil.tensorDataTypeFromProto(tt.dataType)},_e=this._allData.push(Gt)-1,we.set(tt.name,_e)}this._allData[_e]._from=-1,this._allData[_e].tensor=fe.Tensor.fromProto(tt)}for(let tt=0;tt{this._allData[ut]._to.forEach(tt=>{he.add(tt)})});const we=Array.from(he),He=new Array(this._nodes.length).fill("white");for(;we.length>0;){const ut=we.pop();He[ut]==="gray"?He[ut]="black":(we.push(ut),He[ut]="gray",this._nodes[ut].outputs.forEach(tt=>{const _e=this._allData[tt];if(_e.tensor!==void 0)throw new Error("node outputs should not be initialized");if(_e._from!==ut)throw new Error("from property of the Value object doesn't match index of Node being processed");_e._to.forEach(Gt=>{if(He[Gt]==="gray")throw new Error("model graph is cyclic");He[Gt]==="white"&&we.push(Gt)})}))}}transformGraph(he){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),he&&he.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let he=0;for(let we=0;we0&&(this._nodes[we].inputs.forEach(He=>{const ut=this._allData[He]._to.indexOf(we+he);ut!==-1&&(this._allData[He]._to[ut]=we)}),this._nodes[we].outputs.forEach(He=>{this._allData[He]._from&&this._allData[He]._from===we+he&&(this._allData[He]._from=we)})):(he++,this._nodes[we].outputs.forEach(He=>{this._allData[He]._from=-2}),this._nodes.splice(we,1),we--);he=0;for(let we=0;we0){let He=-1;this._allData[we].from!==void 0&&this._allData[we].from!==-1?(He=this._nodes[this._allData[we].from].outputs.indexOf(we+he),He!==-1&&(this._nodes[this._allData[we].from].outputs[He]=we)):(He=this._allInputIndices.indexOf(we+he),He!==-1&&(this._allInputIndices[He]=we)),this._allData[we].to.forEach(ut=>{He=this._nodes[ut].inputs.indexOf(we+he),He!==-1&&(this._nodes[ut].inputs[He]=we)}),this._allData[we].to.length===0&&(He=this._allOutputIndices.indexOf(we+he),He!==-1&&(this._allOutputIndices[He]=we))}}else he++,this._allData.splice(we,1),we--}deleteNode(he){const we=this._nodes[he];if(we.outputs.length>1){for(let Qt=1;Qt0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ")}we.executeNode=!1;const He=we.inputs[0],ut=we.outputs[0],tt=this._allData[ut].to,_e=this._allData[He].to.indexOf(he);if(_e===-1)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[He].to.splice(_e,1),this._allData[ut]._to=[];const Gt=this._allOutputIndices.indexOf(ut);if(Gt!==-1&&(this._allOutputIndices[Gt]=He),tt&&tt.length>0)for(const Qt of tt){const ir=this._nodes[Qt].inputs.indexOf(ut);if(ir===-1)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[Qt].inputs[ir]=He,this._allData[He].to.push(Qt)}}removeAllDropoutNodes(){let he=0;for(const we of this._nodes){if(we.opType==="Dropout"){if(we.inputs.length!==1)throw new Error("Dropout nodes should only contain one input. ");if(we.outputs.length!==1&&we.outputs.length!==2)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(we.outputs.length===2&&this._allData[we.outputs[1]]._to.length!==0)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(he)}he++}}removeAllIdentityNodes(){let he=0;for(const we of this._nodes)we.opType==="Identity"&&this.deleteNode(he),he++}isActivation(he){switch(he.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const he of this._nodes)if(he.opType==="Conv"){const we=this._allData[he.outputs[0]]._to;if(we.length===1&&this.isActivation(this._nodes[we[0]])){const He=this._nodes[we[0]];if(He.opType==="Clip")if(He.inputs.length===1)try{he.attributes.set("activation_params","floats",[He.attributes.getFloat("min"),He.attributes.getFloat("max")])}catch{he.attributes.set("activation_params","floats",[Ee.MIN_CLIP,Ee.MAX_CLIP])}else{if(!(He.inputs.length>=3&&this._allData[He.inputs[1]].tensor!==void 0&&this._allData[He.inputs[2]].tensor!==void 0))continue;he.attributes.set("activation_params","floats",[this._allData[He.inputs[1]].tensor.floatData[0],this._allData[He.inputs[2]].tensor.floatData[0]])}he.attributes.set("activation","string",He.opType),this.deleteNode(we[0])}}}}},6231:(be,M)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.now=M.Profiler=M.Logger=void 0;const V={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},H={none:new class{log(Me,$,F){}},console:new class{log(Me,$,F){console.log(`${this.color(Me)} ${F?"\x1B[35m"+F+"\x1B[0m ":""}${$}`)}color(Me){switch(Me){case"verbose":return"\x1B[34;40mv\x1B[0m";case"info":return"\x1B[32mi\x1B[0m";case"warning":return"\x1B[30;43mw\x1B[0m";case"error":return"\x1B[31;40me\x1B[0m";case"fatal":return"\x1B[101mf\x1B[0m";default:throw new Error(`unsupported severity: ${Me}`)}}}},te={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let ve={"":te};function fe(Me,$,F,he){if($===void 0)return we=Me,{verbose:fe.verbose.bind(null,we),info:fe.info.bind(null,we),warning:fe.warning.bind(null,we),error:fe.error.bind(null,we),fatal:fe.fatal.bind(null,we)};if(F===void 0)Ee(Me,$);else if(typeof F=="number"&&he===void 0)Ee(Me,$);else if(typeof F=="string"&&he===void 0)Ee(Me,F,0,$);else{if(typeof F!="string"||typeof he!="number")throw new TypeError("input is valid");Ee(Me,F,0,$)}var we}function Ee(Me,$,F,he){const we=ve[he||""]||ve[""];V[Me]{ut.then(async Gt=>{we&&await we.end(),tt(Gt)},async Gt=>{we&&await we.end(),_e(Gt)})});if(!He&&we){const tt=we.end();if(tt&&typeof tt.then=="function")return new Promise((_e,Gt)=>{tt.then(()=>{_e(ut)},Qt=>{Gt(Qt)})})}return ut}begin(Me,$,F){if(!this._started)throw new Error("profiler is not started yet");if(F===void 0){const he=(0,M.now)();return this.flush(he),new Re(Me,$,he,we=>this.endSync(we))}{const he=F.beginTimer();return new Re(Me,$,0,async we=>this.end(we),he,F)}}async end(Me){const $=await Me.checkTimer();this._timingEvents.length=this._flushBatchSize||Me-this._flushTime>=this._flushIntervalInMilliseconds){for(const $=this._flushPointer;this._flushPointer<$+this._flushBatchSize&&this._flushPointerperformance.now():Date.now},2644:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.Model=void 0;const H=V(5686),te=V(1446),ve=V(7070),fe=V(9395),Ee=V(2517);var Re=fe.onnxruntime.experimental.fbs;M.Model=class{constructor(){}load(Ce,Me,$){if(!$)try{return void this.loadFromOnnxFormat(Ce,Me)}catch(F){if($!==void 0)throw F}this.loadFromOrtFormat(Ce,Me)}loadFromOnnxFormat(Ce,Me){const $=te.onnx.ModelProto.decode(Ce);if(Ee.LongUtil.longToNumber($.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=$.opsetImport.map(F=>({domain:F.domain,version:Ee.LongUtil.longToNumber(F.version)})),this._graph=ve.Graph.from($.graph,Me)}loadFromOrtFormat(Ce,Me){const $=new H.flatbuffers.ByteBuffer(Ce),F=Re.InferenceSession.getRootAsInferenceSession($).model();if(Ee.LongUtil.longToNumber(F.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let he=0;he{Object.defineProperty(M,"__esModule",{value:!0}),M.FLOAT_TYPES=M.INT_TYPES=M.NUMBER_TYPES=void 0,M.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],M.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],M.FLOAT_TYPES=["float32","float64"]},1047:(be,M)=>{function V(H,te){if(te.endsWith("+")){const ve=Number.parseInt(te.substring(0,te.length-1),10);return!isNaN(ve)&&ve<=H}if(te.split("-").length===2){const ve=te.split("-"),fe=Number.parseInt(ve[0],10),Ee=Number.parseInt(ve[1],10);return!isNaN(fe)&&!isNaN(Ee)&&fe<=H&&H<=Ee}return Number.parseInt(te,10)===H}Object.defineProperty(M,"__esModule",{value:!0}),M.resolveOperator=void 0,M.resolveOperator=function(H,te,ve){for(const fe of ve){const Ee=fe[0],Re=fe[1],Ce=fe[2],Me=fe[3],$=fe[4];if(H.opType===Ee){for(const F of te)if((F.domain===Re||F.domain==="ai.onnx"&&Re==="")&&V(F.version,Ce))return{opImpl:Me,opInit:$}}}throw new TypeError(`cannot resolve operator '${H.opType}' with opsets: ${te.map(fe=>`${fe.domain||"ai.onnx"} v${fe.version}`).join(", ")}`)}},9395:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.onnxruntime=void 0;const H=V(5686);var te,ve;te=M.onnxruntime||(M.onnxruntime={}),function(fe){(function(Ee){Ee[Ee.UNDEFINED=0]="UNDEFINED",Ee[Ee.FLOAT=1]="FLOAT",Ee[Ee.INT=2]="INT",Ee[Ee.STRING=3]="STRING",Ee[Ee.TENSOR=4]="TENSOR",Ee[Ee.GRAPH=5]="GRAPH",Ee[Ee.FLOATS=6]="FLOATS",Ee[Ee.INTS=7]="INTS",Ee[Ee.STRINGS=8]="STRINGS",Ee[Ee.TENSORS=9]="TENSORS",Ee[Ee.GRAPHS=10]="GRAPHS",Ee[Ee.SPARSE_TENSOR=11]="SPARSE_TENSOR",Ee[Ee.SPARSE_TENSORS=12]="SPARSE_TENSORS"})(fe.AttributeType||(fe.AttributeType={}))}((ve=te.experimental||(te.experimental={})).fbs||(ve.fbs={})),function(fe){(function(Ee){(function(Re){(function(Ce){Ce[Ce.UNKNOWN=0]="UNKNOWN",Ce[Ce.VALUE=1]="VALUE",Ce[Ce.PARAM=2]="PARAM"})(Re.DimensionValueType||(Re.DimensionValueType={}))})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){(function(Ce){Ce[Ce.UNDEFINED=0]="UNDEFINED",Ce[Ce.FLOAT=1]="FLOAT",Ce[Ce.UINT8=2]="UINT8",Ce[Ce.INT8=3]="INT8",Ce[Ce.UINT16=4]="UINT16",Ce[Ce.INT16=5]="INT16",Ce[Ce.INT32=6]="INT32",Ce[Ce.INT64=7]="INT64",Ce[Ce.STRING=8]="STRING",Ce[Ce.BOOL=9]="BOOL",Ce[Ce.FLOAT16=10]="FLOAT16",Ce[Ce.DOUBLE=11]="DOUBLE",Ce[Ce.UINT32=12]="UINT32",Ce[Ce.UINT64=13]="UINT64",Ce[Ce.COMPLEX64=14]="COMPLEX64",Ce[Ce.COMPLEX128=15]="COMPLEX128",Ce[Ce.BFLOAT16=16]="BFLOAT16"})(Re.TensorDataType||(Re.TensorDataType={}))})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){(function(Ce){Ce[Ce.Primitive=0]="Primitive",Ce[Ce.Fused=1]="Fused"})(Re.NodeType||(Re.NodeType={}))})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){(function(Ce){Ce[Ce.NONE=0]="NONE",Ce[Ce.tensor_type=1]="tensor_type",Ce[Ce.sequence_type=2]="sequence_type",Ce[Ce.map_type=3]="map_type"})(Re.TypeInfoValue||(Re.TypeInfoValue={}))})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsShape($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsShape($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}dim($,F){let he=this.bb.__offset(this.bb_pos,4);return he?(F||new fe.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}dimLength(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.__vector_len(this.bb_pos+$):0}static startShape($){$.startObject(1)}static addDim($,F){$.addFieldOffset(0,F,0)}static createDimVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startDimVector($,F){$.startVector(4,F,4)}static endShape($){return $.endObject()}static createShape($,F){return Ce.startShape($),Ce.addDim($,F),Ce.endShape($)}}Re.Shape=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsDimension($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsDimension($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}value($){let F=this.bb.__offset(this.bb_pos,4);return F?($||new fe.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}denotation($){let F=this.bb.__offset(this.bb_pos,6);return F?this.bb.__string(this.bb_pos+F,$):null}static startDimension($){$.startObject(2)}static addValue($,F){$.addFieldOffset(0,F,0)}static addDenotation($,F){$.addFieldOffset(1,F,0)}static endDimension($){return $.endObject()}static createDimension($,F,he){return Ce.startDimension($),Ce.addValue($,F),Ce.addDenotation($,he),Ce.endDimension($)}}Re.Dimension=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsDimensionValue($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsDimensionValue($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}dimType(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.readInt8(this.bb_pos+$):fe.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.readInt64(this.bb_pos+$):this.bb.createLong(0,0)}dimParam($){let F=this.bb.__offset(this.bb_pos,8);return F?this.bb.__string(this.bb_pos+F,$):null}static startDimensionValue($){$.startObject(3)}static addDimType($,F){$.addFieldInt8(0,F,fe.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue($,F){$.addFieldInt64(1,F,$.createLong(0,0))}static addDimParam($,F){$.addFieldOffset(2,F,0)}static endDimensionValue($){return $.endObject()}static createDimensionValue($,F,he,we){return Ce.startDimensionValue($),Ce.addDimType($,F),Ce.addDimValue($,he),Ce.addDimParam($,we),Ce.endDimensionValue($)}}Re.DimensionValue=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsTensorTypeAndShape($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsTensorTypeAndShape($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}elemType(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.readInt32(this.bb_pos+$):fe.experimental.fbs.TensorDataType.UNDEFINED}shape($){let F=this.bb.__offset(this.bb_pos,6);return F?($||new fe.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}static startTensorTypeAndShape($){$.startObject(2)}static addElemType($,F){$.addFieldInt32(0,F,fe.experimental.fbs.TensorDataType.UNDEFINED)}static addShape($,F){$.addFieldOffset(1,F,0)}static endTensorTypeAndShape($){return $.endObject()}static createTensorTypeAndShape($,F,he){return Ce.startTensorTypeAndShape($),Ce.addElemType($,F),Ce.addShape($,he),Ce.endTensorTypeAndShape($)}}Re.TensorTypeAndShape=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsMapType($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsMapType($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}keyType(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.readInt32(this.bb_pos+$):fe.experimental.fbs.TensorDataType.UNDEFINED}valueType($){let F=this.bb.__offset(this.bb_pos,6);return F?($||new fe.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}static startMapType($){$.startObject(2)}static addKeyType($,F){$.addFieldInt32(0,F,fe.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType($,F){$.addFieldOffset(1,F,0)}static endMapType($){return $.endObject()}static createMapType($,F,he){return Ce.startMapType($),Ce.addKeyType($,F),Ce.addValueType($,he),Ce.endMapType($)}}Re.MapType=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsSequenceType($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsSequenceType($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}elemType($){let F=this.bb.__offset(this.bb_pos,4);return F?($||new fe.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}static startSequenceType($){$.startObject(1)}static addElemType($,F){$.addFieldOffset(0,F,0)}static endSequenceType($){return $.endObject()}static createSequenceType($,F){return Ce.startSequenceType($),Ce.addElemType($,F),Ce.endSequenceType($)}}Re.SequenceType=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(Ee.fbs||(Ee.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(Re,Ce){return this.bb_pos=Re,this.bb=Ce,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(Re,Ce,Me,$){return Re.prep(4,12),Re.writeInt32($),Re.writeInt32(Me),Re.writeInt32(Ce),Re.offset()}}})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsNodeEdge($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsNodeEdge($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}nodeIndex(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.readUint32(this.bb_pos+$):0}inputEdges($,F){let he=this.bb.__offset(this.bb_pos,6);return he?(F||new fe.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+he)+12*$,this.bb):null}inputEdgesLength(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.__vector_len(this.bb_pos+$):0}outputEdges($,F){let he=this.bb.__offset(this.bb_pos,8);return he?(F||new fe.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+he)+12*$,this.bb):null}outputEdgesLength(){let $=this.bb.__offset(this.bb_pos,8);return $?this.bb.__vector_len(this.bb_pos+$):0}static startNodeEdge($){$.startObject(3)}static addNodeIndex($,F){$.addFieldInt32(0,F,0)}static addInputEdges($,F){$.addFieldOffset(1,F,0)}static startInputEdgesVector($,F){$.startVector(12,F,4)}static addOutputEdges($,F){$.addFieldOffset(2,F,0)}static startOutputEdgesVector($,F){$.startVector(12,F,4)}static endNodeEdge($){return $.endObject()}static createNodeEdge($,F,he,we){return Ce.startNodeEdge($),Ce.addNodeIndex($,F),Ce.addInputEdges($,he),Ce.addOutputEdges($,we),Ce.endNodeEdge($)}}Re.NodeEdge=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsNode($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsNode($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}name($){let F=this.bb.__offset(this.bb_pos,4);return F?this.bb.__string(this.bb_pos+F,$):null}docString($){let F=this.bb.__offset(this.bb_pos,6);return F?this.bb.__string(this.bb_pos+F,$):null}domain($){let F=this.bb.__offset(this.bb_pos,8);return F?this.bb.__string(this.bb_pos+F,$):null}sinceVersion(){let $=this.bb.__offset(this.bb_pos,10);return $?this.bb.readInt32(this.bb_pos+$):0}index(){let $=this.bb.__offset(this.bb_pos,12);return $?this.bb.readUint32(this.bb_pos+$):0}opType($){let F=this.bb.__offset(this.bb_pos,14);return F?this.bb.__string(this.bb_pos+F,$):null}type(){let $=this.bb.__offset(this.bb_pos,16);return $?this.bb.readInt32(this.bb_pos+$):fe.experimental.fbs.NodeType.Primitive}executionProviderType($){let F=this.bb.__offset(this.bb_pos,18);return F?this.bb.__string(this.bb_pos+F,$):null}inputs($,F){let he=this.bb.__offset(this.bb_pos,20);return he?this.bb.__string(this.bb.__vector(this.bb_pos+he)+4*$,F):null}inputsLength(){let $=this.bb.__offset(this.bb_pos,20);return $?this.bb.__vector_len(this.bb_pos+$):0}outputs($,F){let he=this.bb.__offset(this.bb_pos,22);return he?this.bb.__string(this.bb.__vector(this.bb_pos+he)+4*$,F):null}outputsLength(){let $=this.bb.__offset(this.bb_pos,22);return $?this.bb.__vector_len(this.bb_pos+$):0}attributes($,F){let he=this.bb.__offset(this.bb_pos,24);return he?(F||new fe.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}attributesLength(){let $=this.bb.__offset(this.bb_pos,24);return $?this.bb.__vector_len(this.bb_pos+$):0}inputArgCounts($){let F=this.bb.__offset(this.bb_pos,26);return F?this.bb.readInt32(this.bb.__vector(this.bb_pos+F)+4*$):0}inputArgCountsLength(){let $=this.bb.__offset(this.bb_pos,26);return $?this.bb.__vector_len(this.bb_pos+$):0}inputArgCountsArray(){let $=this.bb.__offset(this.bb_pos,26);return $?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+$),this.bb.__vector_len(this.bb_pos+$)):null}implicitInputs($,F){let he=this.bb.__offset(this.bb_pos,28);return he?this.bb.__string(this.bb.__vector(this.bb_pos+he)+4*$,F):null}implicitInputsLength(){let $=this.bb.__offset(this.bb_pos,28);return $?this.bb.__vector_len(this.bb_pos+$):0}static startNode($){$.startObject(13)}static addName($,F){$.addFieldOffset(0,F,0)}static addDocString($,F){$.addFieldOffset(1,F,0)}static addDomain($,F){$.addFieldOffset(2,F,0)}static addSinceVersion($,F){$.addFieldInt32(3,F,0)}static addIndex($,F){$.addFieldInt32(4,F,0)}static addOpType($,F){$.addFieldOffset(5,F,0)}static addType($,F){$.addFieldInt32(6,F,fe.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType($,F){$.addFieldOffset(7,F,0)}static addInputs($,F){$.addFieldOffset(8,F,0)}static createInputsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startInputsVector($,F){$.startVector(4,F,4)}static addOutputs($,F){$.addFieldOffset(9,F,0)}static createOutputsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startOutputsVector($,F){$.startVector(4,F,4)}static addAttributes($,F){$.addFieldOffset(10,F,0)}static createAttributesVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startAttributesVector($,F){$.startVector(4,F,4)}static addInputArgCounts($,F){$.addFieldOffset(11,F,0)}static createInputArgCountsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addInt32(F[he]);return $.endVector()}static startInputArgCountsVector($,F){$.startVector(4,F,4)}static addImplicitInputs($,F){$.addFieldOffset(12,F,0)}static createImplicitInputsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startImplicitInputsVector($,F){$.startVector(4,F,4)}static endNode($){return $.endObject()}static createNode($,F,he,we,He,ut,tt,_e,Gt,Qt,ir,Lr,jr,tn){return Ce.startNode($),Ce.addName($,F),Ce.addDocString($,he),Ce.addDomain($,we),Ce.addSinceVersion($,He),Ce.addIndex($,ut),Ce.addOpType($,tt),Ce.addType($,_e),Ce.addExecutionProviderType($,Gt),Ce.addInputs($,Qt),Ce.addOutputs($,ir),Ce.addAttributes($,Lr),Ce.addInputArgCounts($,jr),Ce.addImplicitInputs($,tn),Ce.endNode($)}}Re.Node=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsValueInfo($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsValueInfo($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}name($){let F=this.bb.__offset(this.bb_pos,4);return F?this.bb.__string(this.bb_pos+F,$):null}docString($){let F=this.bb.__offset(this.bb_pos,6);return F?this.bb.__string(this.bb_pos+F,$):null}type($){let F=this.bb.__offset(this.bb_pos,8);return F?($||new fe.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}static startValueInfo($){$.startObject(3)}static addName($,F){$.addFieldOffset(0,F,0)}static addDocString($,F){$.addFieldOffset(1,F,0)}static addType($,F){$.addFieldOffset(2,F,0)}static endValueInfo($){return $.endObject()}static createValueInfo($,F,he,we){return Ce.startValueInfo($),Ce.addName($,F),Ce.addDocString($,he),Ce.addType($,we),Ce.endValueInfo($)}}Re.ValueInfo=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsTypeInfo($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsTypeInfo($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}denotation($){let F=this.bb.__offset(this.bb_pos,4);return F?this.bb.__string(this.bb_pos+F,$):null}valueType(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.readUint8(this.bb_pos+$):fe.experimental.fbs.TypeInfoValue.NONE}value($){let F=this.bb.__offset(this.bb_pos,8);return F?this.bb.__union($,this.bb_pos+F):null}static startTypeInfo($){$.startObject(3)}static addDenotation($,F){$.addFieldOffset(0,F,0)}static addValueType($,F){$.addFieldInt8(1,F,fe.experimental.fbs.TypeInfoValue.NONE)}static addValue($,F){$.addFieldOffset(2,F,0)}static endTypeInfo($){return $.endObject()}static createTypeInfo($,F,he,we){return Ce.startTypeInfo($),Ce.addDenotation($,F),Ce.addValueType($,he),Ce.addValue($,we),Ce.endTypeInfo($)}}Re.TypeInfo=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsOperatorSetId($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsOperatorSetId($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}domain($){let F=this.bb.__offset(this.bb_pos,4);return F?this.bb.__string(this.bb_pos+F,$):null}version(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.readInt64(this.bb_pos+$):this.bb.createLong(0,0)}static startOperatorSetId($){$.startObject(2)}static addDomain($,F){$.addFieldOffset(0,F,0)}static addVersion($,F){$.addFieldInt64(1,F,$.createLong(0,0))}static endOperatorSetId($){return $.endObject()}static createOperatorSetId($,F,he){return Ce.startOperatorSetId($),Ce.addDomain($,F),Ce.addVersion($,he),Ce.endOperatorSetId($)}}Re.OperatorSetId=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsTensor($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsTensor($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}name($){let F=this.bb.__offset(this.bb_pos,4);return F?this.bb.__string(this.bb_pos+F,$):null}docString($){let F=this.bb.__offset(this.bb_pos,6);return F?this.bb.__string(this.bb_pos+F,$):null}dims($){let F=this.bb.__offset(this.bb_pos,8);return F?this.bb.readInt64(this.bb.__vector(this.bb_pos+F)+8*$):this.bb.createLong(0,0)}dimsLength(){let $=this.bb.__offset(this.bb_pos,8);return $?this.bb.__vector_len(this.bb_pos+$):0}dataType(){let $=this.bb.__offset(this.bb_pos,10);return $?this.bb.readInt32(this.bb_pos+$):fe.experimental.fbs.TensorDataType.UNDEFINED}rawData($){let F=this.bb.__offset(this.bb_pos,12);return F?this.bb.readUint8(this.bb.__vector(this.bb_pos+F)+$):0}rawDataLength(){let $=this.bb.__offset(this.bb_pos,12);return $?this.bb.__vector_len(this.bb_pos+$):0}rawDataArray(){let $=this.bb.__offset(this.bb_pos,12);return $?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+$),this.bb.__vector_len(this.bb_pos+$)):null}stringData($,F){let he=this.bb.__offset(this.bb_pos,14);return he?this.bb.__string(this.bb.__vector(this.bb_pos+he)+4*$,F):null}stringDataLength(){let $=this.bb.__offset(this.bb_pos,14);return $?this.bb.__vector_len(this.bb_pos+$):0}static startTensor($){$.startObject(6)}static addName($,F){$.addFieldOffset(0,F,0)}static addDocString($,F){$.addFieldOffset(1,F,0)}static addDims($,F){$.addFieldOffset(2,F,0)}static createDimsVector($,F){$.startVector(8,F.length,8);for(let he=F.length-1;he>=0;he--)$.addInt64(F[he]);return $.endVector()}static startDimsVector($,F){$.startVector(8,F,8)}static addDataType($,F){$.addFieldInt32(3,F,fe.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData($,F){$.addFieldOffset(4,F,0)}static createRawDataVector($,F){$.startVector(1,F.length,1);for(let he=F.length-1;he>=0;he--)$.addInt8(F[he]);return $.endVector()}static startRawDataVector($,F){$.startVector(1,F,1)}static addStringData($,F){$.addFieldOffset(5,F,0)}static createStringDataVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startStringDataVector($,F){$.startVector(4,F,4)}static endTensor($){return $.endObject()}static createTensor($,F,he,we,He,ut,tt){return Ce.startTensor($),Ce.addName($,F),Ce.addDocString($,he),Ce.addDims($,we),Ce.addDataType($,He),Ce.addRawData($,ut),Ce.addStringData($,tt),Ce.endTensor($)}}Re.Tensor=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsSparseTensor($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsSparseTensor($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}values($){let F=this.bb.__offset(this.bb_pos,4);return F?($||new fe.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}indices($){let F=this.bb.__offset(this.bb_pos,6);return F?($||new fe.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}dims($){let F=this.bb.__offset(this.bb_pos,8);return F?this.bb.readInt64(this.bb.__vector(this.bb_pos+F)+8*$):this.bb.createLong(0,0)}dimsLength(){let $=this.bb.__offset(this.bb_pos,8);return $?this.bb.__vector_len(this.bb_pos+$):0}static startSparseTensor($){$.startObject(3)}static addValues($,F){$.addFieldOffset(0,F,0)}static addIndices($,F){$.addFieldOffset(1,F,0)}static addDims($,F){$.addFieldOffset(2,F,0)}static createDimsVector($,F){$.startVector(8,F.length,8);for(let he=F.length-1;he>=0;he--)$.addInt64(F[he]);return $.endVector()}static startDimsVector($,F){$.startVector(8,F,8)}static endSparseTensor($){return $.endObject()}static createSparseTensor($,F,he,we){return Ce.startSparseTensor($),Ce.addValues($,F),Ce.addIndices($,he),Ce.addDims($,we),Ce.endSparseTensor($)}}Re.SparseTensor=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsAttribute($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsAttribute($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}name($){let F=this.bb.__offset(this.bb_pos,4);return F?this.bb.__string(this.bb_pos+F,$):null}docString($){let F=this.bb.__offset(this.bb_pos,6);return F?this.bb.__string(this.bb_pos+F,$):null}type(){let $=this.bb.__offset(this.bb_pos,8);return $?this.bb.readInt32(this.bb_pos+$):fe.experimental.fbs.AttributeType.UNDEFINED}f(){let $=this.bb.__offset(this.bb_pos,10);return $?this.bb.readFloat32(this.bb_pos+$):0}i(){let $=this.bb.__offset(this.bb_pos,12);return $?this.bb.readInt64(this.bb_pos+$):this.bb.createLong(0,0)}s($){let F=this.bb.__offset(this.bb_pos,14);return F?this.bb.__string(this.bb_pos+F,$):null}t($){let F=this.bb.__offset(this.bb_pos,16);return F?($||new fe.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}g($){let F=this.bb.__offset(this.bb_pos,18);return F?($||new fe.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}floats($){let F=this.bb.__offset(this.bb_pos,20);return F?this.bb.readFloat32(this.bb.__vector(this.bb_pos+F)+4*$):0}floatsLength(){let $=this.bb.__offset(this.bb_pos,20);return $?this.bb.__vector_len(this.bb_pos+$):0}floatsArray(){let $=this.bb.__offset(this.bb_pos,20);return $?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+$),this.bb.__vector_len(this.bb_pos+$)):null}ints($){let F=this.bb.__offset(this.bb_pos,22);return F?this.bb.readInt64(this.bb.__vector(this.bb_pos+F)+8*$):this.bb.createLong(0,0)}intsLength(){let $=this.bb.__offset(this.bb_pos,22);return $?this.bb.__vector_len(this.bb_pos+$):0}strings($,F){let he=this.bb.__offset(this.bb_pos,24);return he?this.bb.__string(this.bb.__vector(this.bb_pos+he)+4*$,F):null}stringsLength(){let $=this.bb.__offset(this.bb_pos,24);return $?this.bb.__vector_len(this.bb_pos+$):0}tensors($,F){let he=this.bb.__offset(this.bb_pos,26);return he?(F||new fe.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}tensorsLength(){let $=this.bb.__offset(this.bb_pos,26);return $?this.bb.__vector_len(this.bb_pos+$):0}graphs($,F){let he=this.bb.__offset(this.bb_pos,28);return he?(F||new fe.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}graphsLength(){let $=this.bb.__offset(this.bb_pos,28);return $?this.bb.__vector_len(this.bb_pos+$):0}static startAttribute($){$.startObject(13)}static addName($,F){$.addFieldOffset(0,F,0)}static addDocString($,F){$.addFieldOffset(1,F,0)}static addType($,F){$.addFieldInt32(2,F,fe.experimental.fbs.AttributeType.UNDEFINED)}static addF($,F){$.addFieldFloat32(3,F,0)}static addI($,F){$.addFieldInt64(4,F,$.createLong(0,0))}static addS($,F){$.addFieldOffset(5,F,0)}static addT($,F){$.addFieldOffset(6,F,0)}static addG($,F){$.addFieldOffset(7,F,0)}static addFloats($,F){$.addFieldOffset(8,F,0)}static createFloatsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addFloat32(F[he]);return $.endVector()}static startFloatsVector($,F){$.startVector(4,F,4)}static addInts($,F){$.addFieldOffset(9,F,0)}static createIntsVector($,F){$.startVector(8,F.length,8);for(let he=F.length-1;he>=0;he--)$.addInt64(F[he]);return $.endVector()}static startIntsVector($,F){$.startVector(8,F,8)}static addStrings($,F){$.addFieldOffset(10,F,0)}static createStringsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startStringsVector($,F){$.startVector(4,F,4)}static addTensors($,F){$.addFieldOffset(11,F,0)}static createTensorsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startTensorsVector($,F){$.startVector(4,F,4)}static addGraphs($,F){$.addFieldOffset(12,F,0)}static createGraphsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startGraphsVector($,F){$.startVector(4,F,4)}static endAttribute($){return $.endObject()}static createAttribute($,F,he,we,He,ut,tt,_e,Gt,Qt,ir,Lr,jr,tn){return Ce.startAttribute($),Ce.addName($,F),Ce.addDocString($,he),Ce.addType($,we),Ce.addF($,He),Ce.addI($,ut),Ce.addS($,tt),Ce.addT($,_e),Ce.addG($,Gt),Ce.addFloats($,Qt),Ce.addInts($,ir),Ce.addStrings($,Lr),Ce.addTensors($,jr),Ce.addGraphs($,tn),Ce.endAttribute($)}}Re.Attribute=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsGraph($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsGraph($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}initializers($,F){let he=this.bb.__offset(this.bb_pos,4);return he?(F||new fe.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}initializersLength(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.__vector_len(this.bb_pos+$):0}nodeArgs($,F){let he=this.bb.__offset(this.bb_pos,6);return he?(F||new fe.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}nodeArgsLength(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.__vector_len(this.bb_pos+$):0}nodes($,F){let he=this.bb.__offset(this.bb_pos,8);return he?(F||new fe.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}nodesLength(){let $=this.bb.__offset(this.bb_pos,8);return $?this.bb.__vector_len(this.bb_pos+$):0}maxNodeIndex(){let $=this.bb.__offset(this.bb_pos,10);return $?this.bb.readUint32(this.bb_pos+$):0}nodeEdges($,F){let he=this.bb.__offset(this.bb_pos,12);return he?(F||new fe.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}nodeEdgesLength(){let $=this.bb.__offset(this.bb_pos,12);return $?this.bb.__vector_len(this.bb_pos+$):0}inputs($,F){let he=this.bb.__offset(this.bb_pos,14);return he?this.bb.__string(this.bb.__vector(this.bb_pos+he)+4*$,F):null}inputsLength(){let $=this.bb.__offset(this.bb_pos,14);return $?this.bb.__vector_len(this.bb_pos+$):0}outputs($,F){let he=this.bb.__offset(this.bb_pos,16);return he?this.bb.__string(this.bb.__vector(this.bb_pos+he)+4*$,F):null}outputsLength(){let $=this.bb.__offset(this.bb_pos,16);return $?this.bb.__vector_len(this.bb_pos+$):0}sparseInitializers($,F){let he=this.bb.__offset(this.bb_pos,18);return he?(F||new fe.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}sparseInitializersLength(){let $=this.bb.__offset(this.bb_pos,18);return $?this.bb.__vector_len(this.bb_pos+$):0}static startGraph($){$.startObject(8)}static addInitializers($,F){$.addFieldOffset(0,F,0)}static createInitializersVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startInitializersVector($,F){$.startVector(4,F,4)}static addNodeArgs($,F){$.addFieldOffset(1,F,0)}static createNodeArgsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startNodeArgsVector($,F){$.startVector(4,F,4)}static addNodes($,F){$.addFieldOffset(2,F,0)}static createNodesVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startNodesVector($,F){$.startVector(4,F,4)}static addMaxNodeIndex($,F){$.addFieldInt32(3,F,0)}static addNodeEdges($,F){$.addFieldOffset(4,F,0)}static createNodeEdgesVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startNodeEdgesVector($,F){$.startVector(4,F,4)}static addInputs($,F){$.addFieldOffset(5,F,0)}static createInputsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startInputsVector($,F){$.startVector(4,F,4)}static addOutputs($,F){$.addFieldOffset(6,F,0)}static createOutputsVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startOutputsVector($,F){$.startVector(4,F,4)}static addSparseInitializers($,F){$.addFieldOffset(7,F,0)}static createSparseInitializersVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startSparseInitializersVector($,F){$.startVector(4,F,4)}static endGraph($){return $.endObject()}static createGraph($,F,he,we,He,ut,tt,_e,Gt){return Ce.startGraph($),Ce.addInitializers($,F),Ce.addNodeArgs($,he),Ce.addNodes($,we),Ce.addMaxNodeIndex($,He),Ce.addNodeEdges($,ut),Ce.addInputs($,tt),Ce.addOutputs($,_e),Ce.addSparseInitializers($,Gt),Ce.endGraph($)}}Re.Graph=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsModel($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsModel($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}irVersion(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.readInt64(this.bb_pos+$):this.bb.createLong(0,0)}opsetImport($,F){let he=this.bb.__offset(this.bb_pos,6);return he?(F||new fe.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}opsetImportLength(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.__vector_len(this.bb_pos+$):0}producerName($){let F=this.bb.__offset(this.bb_pos,8);return F?this.bb.__string(this.bb_pos+F,$):null}producerVersion($){let F=this.bb.__offset(this.bb_pos,10);return F?this.bb.__string(this.bb_pos+F,$):null}domain($){let F=this.bb.__offset(this.bb_pos,12);return F?this.bb.__string(this.bb_pos+F,$):null}modelVersion(){let $=this.bb.__offset(this.bb_pos,14);return $?this.bb.readInt64(this.bb_pos+$):this.bb.createLong(0,0)}docString($){let F=this.bb.__offset(this.bb_pos,16);return F?this.bb.__string(this.bb_pos+F,$):null}graph($){let F=this.bb.__offset(this.bb_pos,18);return F?($||new fe.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}graphDocString($){let F=this.bb.__offset(this.bb_pos,20);return F?this.bb.__string(this.bb_pos+F,$):null}static startModel($){$.startObject(9)}static addIrVersion($,F){$.addFieldInt64(0,F,$.createLong(0,0))}static addOpsetImport($,F){$.addFieldOffset(1,F,0)}static createOpsetImportVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startOpsetImportVector($,F){$.startVector(4,F,4)}static addProducerName($,F){$.addFieldOffset(2,F,0)}static addProducerVersion($,F){$.addFieldOffset(3,F,0)}static addDomain($,F){$.addFieldOffset(4,F,0)}static addModelVersion($,F){$.addFieldInt64(5,F,$.createLong(0,0))}static addDocString($,F){$.addFieldOffset(6,F,0)}static addGraph($,F){$.addFieldOffset(7,F,0)}static addGraphDocString($,F){$.addFieldOffset(8,F,0)}static endModel($){return $.endObject()}static createModel($,F,he,we,He,ut,tt,_e,Gt,Qt){return Ce.startModel($),Ce.addIrVersion($,F),Ce.addOpsetImport($,he),Ce.addProducerName($,we),Ce.addProducerVersion($,He),Ce.addDomain($,ut),Ce.addModelVersion($,tt),Ce.addDocString($,_e),Ce.addGraph($,Gt),Ce.addGraphDocString($,Qt),Ce.endModel($)}}Re.Model=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsKernelCreateInfos($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsKernelCreateInfos($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}nodeIndices($){let F=this.bb.__offset(this.bb_pos,4);return F?this.bb.readUint32(this.bb.__vector(this.bb_pos+F)+4*$):0}nodeIndicesLength(){let $=this.bb.__offset(this.bb_pos,4);return $?this.bb.__vector_len(this.bb_pos+$):0}nodeIndicesArray(){let $=this.bb.__offset(this.bb_pos,4);return $?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+$),this.bb.__vector_len(this.bb_pos+$)):null}kernelDefHashes($){let F=this.bb.__offset(this.bb_pos,6);return F?this.bb.readUint64(this.bb.__vector(this.bb_pos+F)+8*$):this.bb.createLong(0,0)}kernelDefHashesLength(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.__vector_len(this.bb_pos+$):0}static startKernelCreateInfos($){$.startObject(2)}static addNodeIndices($,F){$.addFieldOffset(0,F,0)}static createNodeIndicesVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addInt32(F[he]);return $.endVector()}static startNodeIndicesVector($,F){$.startVector(4,F,4)}static addKernelDefHashes($,F){$.addFieldOffset(1,F,0)}static createKernelDefHashesVector($,F){$.startVector(8,F.length,8);for(let he=F.length-1;he>=0;he--)$.addInt64(F[he]);return $.endVector()}static startKernelDefHashesVector($,F){$.startVector(8,F,8)}static endKernelCreateInfos($){return $.endObject()}static createKernelCreateInfos($,F,he){return Ce.startKernelCreateInfos($),Ce.addNodeIndices($,F),Ce.addKernelDefHashes($,he),Ce.endKernelCreateInfos($)}}Re.KernelCreateInfos=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsSubGraphSessionState($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsSubGraphSessionState($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}graphId($){let F=this.bb.__offset(this.bb_pos,4);return F?this.bb.__string(this.bb_pos+F,$):null}sessionState($){let F=this.bb.__offset(this.bb_pos,6);return F?($||new fe.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}static startSubGraphSessionState($){$.startObject(2)}static addGraphId($,F){$.addFieldOffset(0,F,0)}static addSessionState($,F){$.addFieldOffset(1,F,0)}static endSubGraphSessionState($){let F=$.endObject();return $.requiredField(F,4),F}static createSubGraphSessionState($,F,he){return Ce.startSubGraphSessionState($),Ce.addGraphId($,F),Ce.addSessionState($,he),Ce.endSubGraphSessionState($)}}Re.SubGraphSessionState=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsSessionState($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsSessionState($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}kernels($){let F=this.bb.__offset(this.bb_pos,4);return F?($||new fe.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}subGraphSessionStates($,F){let he=this.bb.__offset(this.bb_pos,6);return he?(F||new fe.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+he)+4*$),this.bb):null}subGraphSessionStatesLength(){let $=this.bb.__offset(this.bb_pos,6);return $?this.bb.__vector_len(this.bb_pos+$):0}static startSessionState($){$.startObject(2)}static addKernels($,F){$.addFieldOffset(0,F,0)}static addSubGraphSessionStates($,F){$.addFieldOffset(1,F,0)}static createSubGraphSessionStatesVector($,F){$.startVector(4,F.length,4);for(let he=F.length-1;he>=0;he--)$.addOffset(F[he]);return $.endVector()}static startSubGraphSessionStatesVector($,F){$.startVector(4,F,4)}static endSessionState($){return $.endObject()}static createSessionState($,F,he){return Ce.startSessionState($),Ce.addKernels($,F),Ce.addSubGraphSessionStates($,he),Ce.endSessionState($)}}Re.SessionState=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={})),function(fe){(function(Ee){(function(Re){class Ce{constructor(){this.bb=null,this.bb_pos=0}__init($,F){return this.bb_pos=$,this.bb=F,this}static getRootAsInferenceSession($,F){return(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static getSizePrefixedRootAsInferenceSession($,F){return $.setPosition($.position()+H.flatbuffers.SIZE_PREFIX_LENGTH),(F||new Ce).__init($.readInt32($.position())+$.position(),$)}static bufferHasIdentifier($){return $.__has_identifier("ORTM")}ortVersion($){let F=this.bb.__offset(this.bb_pos,4);return F?this.bb.__string(this.bb_pos+F,$):null}model($){let F=this.bb.__offset(this.bb_pos,6);return F?($||new fe.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}sessionState($){let F=this.bb.__offset(this.bb_pos,8);return F?($||new fe.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+F),this.bb):null}static startInferenceSession($){$.startObject(3)}static addOrtVersion($,F){$.addFieldOffset(0,F,0)}static addModel($,F){$.addFieldOffset(1,F,0)}static addSessionState($,F){$.addFieldOffset(2,F,0)}static endInferenceSession($){return $.endObject()}static finishInferenceSessionBuffer($,F){$.finish(F,"ORTM")}static finishSizePrefixedInferenceSessionBuffer($,F){$.finish(F,"ORTM",!0)}static createInferenceSession($,F,he,we){return Ce.startInferenceSession($),Ce.addOrtVersion($,F),Ce.addModel($,he),Ce.addSessionState($,we),Ce.endInferenceSession($)}}Re.InferenceSession=Ce})(Ee.fbs||(Ee.fbs={}))})(fe.experimental||(fe.experimental={}))}(M.onnxruntime||(M.onnxruntime={}))},7448:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.OnnxjsSessionHandler=void 0;const H=V(1670),te=V(9162);M.OnnxjsSessionHandler=class{constructor(ve){this.session=ve,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(ve,fe,Ee){const Re=new Map;for(const $ in ve)if(Object.hasOwnProperty.call(ve,$)){const F=ve[$];Re.set($,new te.Tensor(F.dims,F.type,void 0,void 0,F.data))}const Ce=await this.session.run(Re),Me={};return Ce.forEach(($,F)=>{Me[F]=new H.Tensor($.type,$.data,$.dims)}),Me}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.Session=void 0;const H=V(7067),te=V(1296),ve=V(7091),fe=V(1036),Ee=V(6231),Re=V(2644);M.Session=class{constructor(Ce={}){this._initialized=!1,this.backendHint=Ce.backendHint,this.profiler=Ee.Profiler.create(Ce.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(Ce,Me,$){await this.profiler.event("session","Session.loadModel",async()=>{const F=await(0,ve.resolveBackend)(this.backendHint);if(this.sessionHandler=F.createSessionHandler(this.context),this._model=new Re.Model,typeof Ce=="string"){const he=Ce.endsWith(".ort");if(typeof fetch>"u"){const we=await(0,te.promisify)(H.readFile)(Ce);this.initialize(we,he)}else{const we=await fetch(Ce),He=await we.arrayBuffer();this.initialize(new Uint8Array(He),he)}}else if(ArrayBuffer.isView(Ce))this.initialize(Ce);else{const he=new Uint8Array(Ce,Me||0,$||Ce.byteLength);this.initialize(he)}})}initialize(Ce,Me){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{const $=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(Ce,$,Me),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new fe.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(Ce){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{const Me=this.normalizeAndValidateInputs(Ce),$=await this._executionPlan.execute(this.sessionHandler,Me);return this.createOutput($)})}normalizeAndValidateInputs(Ce){const Me=this._model.graph.getInputNames();if(Array.isArray(Ce)){if(Ce.length!==Me.length)throw new Error(`incorrect input array length: expected ${Me.length} but got ${Ce.length}`)}else{if(Ce.size!==Me.length)throw new Error(`incorrect input map size: expected ${Me.length} but got ${Ce.size}`);const $=new Array(Ce.size);let F=0;for(let he=0;hetypeof tn=="string")))throw new TypeError("cache should be a string array");jr&&(this.cache=new Array(Lr))}else{if(Qt!==void 0){const tn=F(tt);if(!(Qt instanceof tn))throw new TypeError(`cache should be type ${tn.name}`)}if(jr){const tn=new ArrayBuffer(Lr*function(mr){switch(mr){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error(`cannot calculate sizeof() on type ${mr}`)}}(tt));this.cache=function(mr,Ir){return new(F(Ir))(mr)}(tn,tt)}}}static fromProto(ut){if(!ut)throw new Error("cannot construct Value from an empty tensor");const tt=Re.ProtoUtil.tensorDataTypeFromProto(ut.dataType),_e=Re.ProtoUtil.tensorDimsFromProto(ut.dims),Gt=new Me(_e,tt);if(tt==="string")ut.stringData.forEach((Qt,ir)=>{Gt.data[ir]=(0,Re.decodeUtf8String)(Qt)});else if(ut.rawData&&typeof ut.rawData.byteLength=="number"&&ut.rawData.byteLength>0){const Qt=Gt.data,ir=new DataView(ut.rawData.buffer,ut.rawData.byteOffset,ut.rawData.byteLength),Lr=$(ut.dataType),jr=ut.rawData.byteLength/Lr;if(ut.rawData.byteLength%Lr!=0)throw new Error("invalid buffer length");if(Qt.length!==jr)throw new Error("buffer length mismatch");for(let tn=0;tn0){const Qt=Gt.data,ir=new DataView(ut.rawDataArray().buffer,ut.rawDataArray().byteOffset,ut.rawDataLength()),Lr=$(ut.dataType()),jr=ut.rawDataLength()/Lr;if(ut.rawDataLength()%Lr!=0)throw new Error("invalid buffer length");if(Qt.length!==jr)throw new Error("buffer length mismatch");for(let tn=0;tn1&&Ir>1)return;jr[Lr-tn]=Math.max(mr,Ir)}return jr}static index(tt,_e){const Gt=new Array(_e.length);return Ce.fillIndex(tt,_e,Gt),Gt}static fillIndex(tt,_e,Gt){const Qt=tt.length-_e.length;for(let ir=0;ir<_e.length;ir++)Gt[ir]=tt[Qt+ir]%_e[ir]}static calc(tt,_e,Gt,Qt,ir){const Lr=Ce.calcShape(tt.dims,_e.dims);if(Lr){if(Qt&&!F.areEqual(Lr,tt.dims))return;const jr=F.size(Lr),tn=Qt?tt:new Ee.Tensor(Lr,ir||tt.type);if(Lr.length===0)tn.set([],Gt(tt.get([]),_e.get([])));else{const mr=new Array(Lr.length),Ir=new Array(tt.dims.length),On=new Array(_e.dims.length);let ba,ra=0,jn=0,qn=!1,Un=!1;tt.dims.length===0&&(ra=tt.get([]),qn=!0),_e.dims.length===0&&(jn=_e.get([]),Un=!0);for(let pa=0;pa=0;lo--)mr[lo]=ba%Lr[lo],ba=Math.floor(ba/Lr[lo]);qn||(Ce.fillIndex(mr,tt.dims,Ir),ra=tt.get(Ir)),Un||(Ce.fillIndex(mr,_e.dims,On),jn=_e.get(On)),tn.set(mr,Gt(ra,jn))}}return tn}}static isValidBroadcast(tt,_e){const Gt=tt.length,Qt=_e.length;if(Gt>Qt)return!1;for(let ir=1;ir<=Gt;ir++)if(tt[Gt-ir]!==1&&tt[Gt-ir]!==_e[Qt-ir])return!1;return!0}static getBroadcastDims(tt,_e){const Gt=tt.length,Qt=[];for(let ir=0;ir1&&jr===1&&Qt.unshift(Lr)}return Qt}}M.BroadcastUtil=Ce,M.arrayCopyHelper=function(ut,tt,_e,Gt,Qt){if(Gt<0||Gt>=tt.length)throw new Error("sourceIndex out of bounds");if(_e<0||_e>=ut.length)throw new Error("targetIndex out of bounds");if(Gt+Qt>tt.length)throw new Error("source indices to be copied are outside bounds");if(_e+Qt>ut.length)throw new Error("target array is too small to hold result");for(let ir=0;irve.default.isLong(_e)?_e.toNumber():_e)}static tensorValueTypeFromProto(tt){return{tensorType:Me.tensorDataTypeFromProto(tt.elemType),shape:{dims:Me.tensorDimsFromProto(tt.shape.dim.map(_e=>_e.dimValue))}}}static tensorDimsFromORTFormat(tt){const _e=[];for(let Gt=0;Gttt.length)throw new Error(`invalid dimension of ${_e} for sizeFromDimension as Tensor has ${tt.length} dimensions.`);return F.getSizeFromDimensionRange(tt,_e,tt.length)}static sizeToDimension(tt,_e){if(_e<0||_e>tt.length)throw new Error(`invalid dimension of ${_e} for sizeToDimension as Tensor has ${tt.length} dimensions.`);return F.getSizeFromDimensionRange(tt,0,_e)}static getSizeFromDimensionRange(tt,_e,Gt){let Qt=1;for(let ir=_e;ir=0;--Qt)Gt[Qt]=Gt[Qt+1]*tt[Qt+1];return Gt}static transpose(tt){return tt.slice().reverse()}static indicesToOffset(tt,_e,Gt){Gt===void 0&&(Gt=tt.length);let Qt=0;for(let ir=0;ir=_e)throw new Error("unsupported axis for this operation.");return tt<0?tt+_e:tt}static normalizeAxes(tt,_e){return tt.map(Gt=>this.normalizeAxis(Gt,_e))}static incrementIndex(tt,_e,Gt){if(_e.length===0||tt.length===0)throw new Error("Index incrementing unsupported for scalar Tensor");if(Gt===void 0)Gt=_e.length;else if(Gt<=0||Gt>_e.length)throw new Error("Incorrect axis to increment on");for(let Qt=Gt-1;Qt>=0&&(tt[Qt]++,!(tt[Qt]<_e[Qt]));--Qt)tt[Qt]=0}static calculateReshapedDims(tt,_e){if(_e.length===0){if(tt.length===0||F.size(tt)===1)return[];throw new Error("cannot reshape to a scalar Tensor")}const Gt=_e.length,Qt=new Array(Gt);let ir=-1,Lr=1;for(let tn=0;tn=tt.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");Qt[tn]=tt[tn]}else Qt[tn]=_e[tn];Lr*=Qt[tn]}}const jr=F.size(tt);if(ir!==-1){if(jr%Lr!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${tt}] Output shape: [${_e}]`);Qt[ir]=jr/Lr}else if(Lr!==jr)throw new Error("reshapedDims and originalDims don't have matching sizes");return Qt}static sortBasedOnPerm(tt,_e){return _e?_e.map(Gt=>tt[Gt]):tt.slice().reverse()}static padShape(tt,_e){const Gt=tt.length;return tt.map((Qt,ir)=>Qt+_e[ir]+_e[ir+Gt])}static areEqual(tt,_e){return tt.length===_e.length&&tt.every((Gt,Qt)=>Gt===_e[Qt])}static validateDimsAndCalcSize(tt){if(tt.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let _e=1;for(const Gt of tt){if(!Number.isInteger(Gt))throw new TypeError(`Invalid shape: ${Gt} is not an integer`);if(Gt<0||Gt>2147483647)throw new TypeError(`Invalid shape: length ${Gt} is not allowed`);_e*=Gt}return _e}static flattenShape(tt,_e){_e<0&&(_e+=tt.length);const Gt=tt.reduce((ir,Lr)=>ir*Lr,1),Qt=tt.slice(_e).reduce((ir,Lr)=>ir*Lr,1);return[Gt/Qt,Qt]}static squeezeShape(tt,_e){const Gt=new Array;_e=F.normalizeAxes(_e,tt.length);for(let Qt=0;Qt=0;if(ir&&tt[Qt]!==1)throw new Error("squeeze an axis of size different than 1");(_e.length===0&&tt[Qt]>1||_e.length>0&&!ir)&&Gt.push(tt[Qt])}return Gt}static unsqueezeShape(tt,_e){const Gt=new Array(tt.length+_e.length);Gt.fill(0);for(let ir=0;ir<_e.length;ir++){const Lr=F.normalizeAxis(_e[ir],Gt.length);if(Lr>=Gt.length)throw new Error("'axes' has an out of range axis");if(Gt[Lr]!==0)throw new Error("'axes' has a duplicate axis");Gt[Lr]=1}let Qt=0;for(let ir=0;ir=tt.length)throw new Error("sourceIndex out of bounds");if(_e<0||_e>=ut.length)throw new Error("targetIndex out of bounds");if(Gt+Qt>tt.length)throw new Error("source indices to be copied are outside bounds");if(_e+Qt>ut.length)throw new Error("target array is too small to hold result");for(let ir=0;ir=tt.length)throw new Error("sourceIndex out of bounds");if(_e<0||_e>=ut.length)throw new Error("targetIndex out of bounds");if(Gt+Qt>tt.length)throw new Error("source indices to be copied are outside bounds");if(_e+Qt>ut.length)throw new Error("target array is too small to hold result");for(let Lr=0;Lr=tt.length)throw new Error("sourceIndex out of bounds");if(_e<0||_e>=ut.length)throw new Error("targetIndex out of bounds");if(Gt+Qt>tt.length)throw new Error("source indices to be copied are outside bounds");if(_e+Qt>ut.length)throw new Error("target array is too small to hold result");for(let Lr=0;Lr=tt.length)throw new Error("sourceIndex out of bounds");if(_e<0||_e>=ut.length)throw new Error("targetIndex out of bounds");if(Gt+Qt>tt.length)throw new Error("source indices to be copied are outside bounds");if(_e+Qt>ut.length)throw new Error("target array is too small to hold result");for(let ir=0;ir_e.push(jn));const jr=we.calcReduceShape(Lr,_e,!0),tn=F.size(jr),mr=new Ee.Tensor(jr,tt.type),Ir=F.computeStrides(jr),On=F.computeStrides(Lr),ba=new Array(Lr.length);for(let ra=0;ra=_e.length)return Lr(tt[ir]);const mr=_e[Qt],Ir=mr>=Gt.length?1:F.size(Gt.slice(mr+1));for(let On=0;Onir!==0)}}M.ReduceUtil=we;class He{static adjustPoolAttributes(tt,_e,Gt,Qt,ir,Lr){if(!tt&&Gt.length!==_e.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(tt)for(let jr=0;jr<_e.length-2;jr++)jr>=Gt.length?Gt.push(_e[jr+2]):Gt[jr]=_e[jr+2];for(let jr=0;jr=Gt[jr]||Lr[jr+Gt.length]>=Gt[jr])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(tt,_e,Gt,Qt,ir,Lr){if(Lr){if(ir.length!==2*(tt.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(_e.length!==tt.length-2)throw new Error("length of strides should be the length of data dimensions");if(Qt.length!==tt.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let jr=0;jr{Object.defineProperty(M,"__esModule",{value:!0}),M.iterateExtraOptions=void 0,M.iterateExtraOptions=(V,H,te,ve)=>{if(typeof V=="object"&&V!==null){if(te.has(V))throw new Error("Circular reference in options");te.add(V)}Object.entries(V).forEach(([fe,Ee])=>{const Re=H?H+fe:fe;if(typeof Ee=="object")(0,M.iterateExtraOptions)(Ee,Re+".",te,ve);else if(typeof Ee=="string"||typeof Ee=="number")ve(Re,Ee.toString());else{if(typeof Ee!="boolean")throw new Error("Can't handle extra config type: "+typeof Ee);ve(Re,Ee?"1":"0")}})}},2157:function(be,M,V){var H,te=this&&this.__createBinding||(Object.create?function(Ir,On,ba,ra){ra===void 0&&(ra=ba);var jn=Object.getOwnPropertyDescriptor(On,ba);jn&&!("get"in jn?!On.__esModule:jn.writable||jn.configurable)||(jn={enumerable:!0,get:function(){return On[ba]}}),Object.defineProperty(Ir,ra,jn)}:function(Ir,On,ba,ra){ra===void 0&&(ra=ba),Ir[ra]=On[ba]}),ve=this&&this.__setModuleDefault||(Object.create?function(Ir,On){Object.defineProperty(Ir,"default",{enumerable:!0,value:On})}:function(Ir,On){Ir.default=On}),fe=this&&this.__importStar||function(Ir){if(Ir&&Ir.__esModule)return Ir;var On={};if(Ir!=null)for(var ba in Ir)ba!=="default"&&Object.prototype.hasOwnProperty.call(Ir,ba)&&te(On,Ir,ba);return ve(On,Ir),On};Object.defineProperty(M,"__esModule",{value:!0}),M.endProfiling=M.run=M.releaseSession=M.createSession=M.createSessionFinalize=M.createSessionAllocate=M.initOrt=M.initWasm=void 0;const Ee=V(1670),Re=fe(V(349)),Ce=V(6361),Me=()=>!!Ee.env.wasm.proxy&&typeof document<"u";let $,F,he,we=!1,He=!1,ut=!1;const tt=[],_e=[],Gt=[],Qt=[],ir=[],Lr=[],jr=()=>{if(we||!He||ut||!$)throw new Error("worker not ready")},tn=Ir=>{switch(Ir.data.type){case"init-wasm":we=!1,Ir.data.err?(ut=!0,F[1](Ir.data.err)):(He=!0,F[0]());break;case"init-ort":Ir.data.err?he[1](Ir.data.err):he[0]();break;case"create_allocate":Ir.data.err?tt.shift()[1](Ir.data.err):tt.shift()[0](Ir.data.out);break;case"create_finalize":Ir.data.err?_e.shift()[1](Ir.data.err):_e.shift()[0](Ir.data.out);break;case"create":Ir.data.err?Gt.shift()[1](Ir.data.err):Gt.shift()[0](Ir.data.out);break;case"release":Ir.data.err?Qt.shift()[1](Ir.data.err):Qt.shift()[0]();break;case"run":Ir.data.err?ir.shift()[1](Ir.data.err):ir.shift()[0](Ir.data.out);break;case"end-profiling":Ir.data.err?Lr.shift()[1](Ir.data.err):Lr.shift()[0]()}},mr=typeof document<"u"?(H=document?.currentScript)===null||H===void 0?void 0:H.src:void 0;M.initWasm=async()=>{if(Me()){if(He)return;if(we)throw new Error("multiple calls to 'initWasm()' detected.");if(ut)throw new Error("previous call to 'initWasm()' failed.");return we=!0,Ee.env.wasm.wasmPaths===void 0&&mr&&mr.indexOf("blob:")!==0&&(Ee.env.wasm.wasmPaths=mr.substr(0,+mr.lastIndexOf("/")+1)),new Promise((Ir,On)=>{$?.terminate(),$=V(9710).Z(),$.onmessage=tn,F=[Ir,On];const ba={type:"init-wasm",in:Ee.env.wasm};$.postMessage(ba)})}return(0,Ce.initializeWebAssembly)(Ee.env.wasm)},M.initOrt=async(Ir,On)=>{if(Me())return jr(),new Promise((ba,ra)=>{he=[ba,ra];const jn={type:"init-ort",in:{numThreads:Ir,loggingLevel:On}};$.postMessage(jn)});Re.initOrt(Ir,On)},M.createSessionAllocate=async Ir=>Me()?(jr(),new Promise((On,ba)=>{tt.push([On,ba]);const ra={type:"create_allocate",in:{model:Ir}};$.postMessage(ra,[Ir.buffer])})):Re.createSessionAllocate(Ir),M.createSessionFinalize=async(Ir,On)=>Me()?(jr(),new Promise((ba,ra)=>{_e.push([ba,ra]);const jn={type:"create_finalize",in:{modeldata:Ir,options:On}};$.postMessage(jn)})):Re.createSessionFinalize(Ir,On),M.createSession=async(Ir,On)=>Me()?(jr(),new Promise((ba,ra)=>{Gt.push([ba,ra]);const jn={type:"create",in:{model:Ir,options:On}};$.postMessage(jn,[Ir.buffer])})):Re.createSession(Ir,On),M.releaseSession=async Ir=>{if(Me())return jr(),new Promise((On,ba)=>{Qt.push([On,ba]);const ra={type:"release",in:Ir};$.postMessage(ra)});Re.releaseSession(Ir)},M.run=async(Ir,On,ba,ra,jn)=>Me()?(jr(),new Promise((qn,Un)=>{ir.push([qn,Un]);const pa={type:"run",in:{sessionId:Ir,inputIndices:On,inputs:ba,outputIndices:ra,options:jn}};$.postMessage(pa,Re.extractTransferableBuffers(ba))})):Re.run(Ir,On,ba,ra,jn),M.endProfiling=async Ir=>{if(Me())return jr(),new Promise((On,ba)=>{Lr.push([On,ba]);const ra={type:"end-profiling",in:Ir};$.postMessage(ra)});Re.endProfiling(Ir)}},586:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.setRunOptions=void 0;const H=V(7967),te=V(4983),ve=V(6361);M.setRunOptions=fe=>{const Ee=(0,ve.getInstance)();let Re=0;const Ce=[],Me=fe||{};try{if(fe?.logSeverityLevel===void 0)Me.logSeverityLevel=2;else if(typeof fe.logSeverityLevel!="number"||!Number.isInteger(fe.logSeverityLevel)||fe.logSeverityLevel<0||fe.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${fe.logSeverityLevel}`);if(fe?.logVerbosityLevel===void 0)Me.logVerbosityLevel=0;else if(typeof fe.logVerbosityLevel!="number"||!Number.isInteger(fe.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${fe.logVerbosityLevel}`);fe?.terminate===void 0&&(Me.terminate=!1);let $=0;if(fe?.tag!==void 0&&($=(0,te.allocWasmString)(fe.tag,Ce)),Re=Ee._OrtCreateRunOptions(Me.logSeverityLevel,Me.logVerbosityLevel,!!Me.terminate,$),Re===0)throw new Error("Can't create run options");return fe?.extra!==void 0&&(0,H.iterateExtraOptions)(fe.extra,"",new WeakSet,(F,he)=>{const we=(0,te.allocWasmString)(F,Ce),He=(0,te.allocWasmString)(he,Ce);if(Ee._OrtAddRunConfigEntry(Re,we,He)!==0)throw new Error(`Can't set a run config entry: ${F} - ${he}`)}),[Re,Ce]}catch($){throw Re!==0&&Ee._OrtReleaseRunOptions(Re),Ce.forEach(Ee._free),$}}},2306:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.OnnxruntimeWebAssemblySessionHandler=void 0;const H=V(2806),te=V(1670),ve=V(2850),fe=V(2157);let Ee;M.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(Re){const Ce=await fetch(Re),Me=await Ce.arrayBuffer();return(0,fe.createSessionAllocate)(new Uint8Array(Me))}async loadModel(Re,Ce){if(Ee||(await(0,fe.initOrt)(te.env.wasm.numThreads,(Me=>{switch(Me){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${Me}`)}})(te.env.logLevel)),Ee=!0),typeof Re=="string")if(typeof fetch>"u"){const Me=await(0,ve.promisify)(H.readFile)(Re);[this.sessionId,this.inputNames,this.outputNames]=await(0,fe.createSession)(Me,Ce)}else{const Me=await this.createSessionAllocate(Re);[this.sessionId,this.inputNames,this.outputNames]=await(0,fe.createSessionFinalize)(Me,Ce)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,fe.createSession)(Re,Ce)}async dispose(){return(0,fe.releaseSession)(this.sessionId)}async run(Re,Ce,Me){const $=[],F=[];Object.entries(Re).forEach(ut=>{const tt=ut[0],_e=ut[1],Gt=this.inputNames.indexOf(tt);if(Gt===-1)throw new Error(`invalid input '${tt}'`);$.push(_e),F.push(Gt)});const he=[];Object.entries(Ce).forEach(ut=>{const tt=ut[0],_e=this.outputNames.indexOf(tt);if(_e===-1)throw new Error(`invalid output '${tt}'`);he.push(_e)});const we=await(0,fe.run)(this.sessionId,F,$.map(ut=>[ut.type,ut.dims,ut.data]),he,Me),He={};for(let ut=0;ut{Object.defineProperty(M,"__esModule",{value:!0}),M.setSessionOptions=void 0;const H=V(7967),te=V(4983),ve=V(6361);M.setSessionOptions=fe=>{const Ee=(0,ve.getInstance)();let Re=0;const Ce=[],Me=fe||{};($=>{$.extra||($.extra={}),$.extra.session||($.extra.session={});const F=$.extra.session;F.use_ort_model_bytes_directly||(F.use_ort_model_bytes_directly="1")})(Me);try{fe?.graphOptimizationLevel===void 0&&(Me.graphOptimizationLevel="all");const $=(we=>{switch(we){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${we}`)}})(Me.graphOptimizationLevel);fe?.enableCpuMemArena===void 0&&(Me.enableCpuMemArena=!0),fe?.enableMemPattern===void 0&&(Me.enableMemPattern=!0),fe?.executionMode===void 0&&(Me.executionMode="sequential");const F=(we=>{switch(we){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${we}`)}})(Me.executionMode);let he=0;if(fe?.logId!==void 0&&(he=(0,te.allocWasmString)(fe.logId,Ce)),fe?.logSeverityLevel===void 0)Me.logSeverityLevel=2;else if(typeof fe.logSeverityLevel!="number"||!Number.isInteger(fe.logSeverityLevel)||fe.logSeverityLevel<0||fe.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${fe.logSeverityLevel}`);if(fe?.logVerbosityLevel===void 0)Me.logVerbosityLevel=0;else if(typeof fe.logVerbosityLevel!="number"||!Number.isInteger(fe.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${fe.logVerbosityLevel}`);if(fe?.enableProfiling===void 0&&(Me.enableProfiling=!1),Re=Ee._OrtCreateSessionOptions($,!!Me.enableCpuMemArena,!!Me.enableMemPattern,F,!!Me.enableProfiling,0,he,Me.logSeverityLevel,Me.logVerbosityLevel),Re===0)throw new Error("Can't create session options");return fe?.executionProviders&&((we,He,ut)=>{for(const tt of He){let _e=typeof tt=="string"?tt:tt.name;switch(_e){case"xnnpack":_e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${_e}`)}const Gt=(0,te.allocWasmString)(_e,ut);if((0,ve.getInstance)()._OrtAppendExecutionProvider(we,Gt)!==0)throw new Error(`Can't append execution provider: ${_e}`)}})(Re,fe.executionProviders,Ce),fe?.extra!==void 0&&(0,H.iterateExtraOptions)(fe.extra,"",new WeakSet,(we,He)=>{const ut=(0,te.allocWasmString)(we,Ce),tt=(0,te.allocWasmString)(He,Ce);if(Ee._OrtAddSessionConfigEntry(Re,ut,tt)!==0)throw new Error(`Can't set a session config entry: ${we} - ${He}`)}),[Re,Ce]}catch($){throw Re!==0&&Ee._OrtReleaseSessionOptions(Re),Ce.forEach(Ee._free),$}}},4983:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.allocWasmString=void 0;const H=V(6361);M.allocWasmString=(te,ve)=>{const fe=(0,H.getInstance)(),Ee=fe.lengthBytesUTF8(te)+1,Re=fe._malloc(Ee);return fe.stringToUTF8(te,Re,Ee),ve.push(Re),Re}},349:(be,M,V)=>{Object.defineProperty(M,"__esModule",{value:!0}),M.extractTransferableBuffers=M.endProfiling=M.run=M.releaseSession=M.createSession=M.createSessionFinalize=M.createSessionAllocate=M.initOrt=void 0;const H=V(586),te=V(4919),ve=V(4983),fe=V(6361);M.initOrt=($,F)=>{const he=(0,fe.getInstance)()._OrtInit($,F);if(he!==0)throw new Error(`Can't initialize onnxruntime. error code = ${he}`)};const Ee=new Map;M.createSessionAllocate=$=>{const F=(0,fe.getInstance)(),he=F._malloc($.byteLength);return F.HEAPU8.set($,he),[he,$.byteLength]},M.createSessionFinalize=($,F)=>{const he=(0,fe.getInstance)();let we=0,He=0,ut=[];try{if([He,ut]=(0,te.setSessionOptions)(F),we=he._OrtCreateSession($[0],$[1],He),we===0)throw new Error("Can't create a session")}finally{he._free($[0]),he._OrtReleaseSessionOptions(He),ut.forEach(he._free)}const tt=he._OrtGetInputCount(we),_e=he._OrtGetOutputCount(we),Gt=[],Qt=[],ir=[],Lr=[];for(let jr=0;jr{const he=(0,M.createSessionAllocate)($);return(0,M.createSessionFinalize)(he,F)},M.releaseSession=$=>{const F=(0,fe.getInstance)(),he=Ee.get($);if(!he)throw new Error("invalid session id");const we=he[0],He=he[1],ut=he[2];He.forEach(F._OrtFree),ut.forEach(F._OrtFree),F._OrtReleaseSession(we),Ee.delete($)};const Re=$=>{switch($){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${$}`)}},Ce=$=>{switch($){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${$}`)}},Me=$=>{switch($){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${$}`)}};M.run=($,F,he,we,He)=>{const ut=(0,fe.getInstance)(),tt=Ee.get($);if(!tt)throw new Error("invalid session id");const _e=tt[0],Gt=tt[1],Qt=tt[2],ir=F.length,Lr=we.length;let jr=0,tn=[];const mr=[],Ir=[];try{[jr,tn]=(0,H.setRunOptions)(He);for(let Un=0;Unut.HEAP32[Rl++]=po);const bs=ut._OrtCreateTensor(Re(pa),Fo,Qo,Hs,lo.length);if(bs===0)throw new Error("Can't create a tensor");mr.push(bs)}finally{ut.stackRestore(Sl)}}const On=ut.stackSave(),ba=ut.stackAlloc(4*ir),ra=ut.stackAlloc(4*ir),jn=ut.stackAlloc(4*Lr),qn=ut.stackAlloc(4*Lr);try{let Un=ba/4,pa=ra/4,lo=jn/4,ji=qn/4;for(let Sl=0;Slso*Of);if(po=Ce(wf),po==="string"){const so=[];let Of=es/4;for(let ch=0;ch{const F=(0,fe.getInstance)(),he=Ee.get($);if(!he)throw new Error("invalid session id");const we=he[0],He=F._OrtEndProfiling(we);if(He===0)throw new Error("Can't get an profile file name");F._OrtFree(He)},M.extractTransferableBuffers=$=>{const F=[];for(const he of $){const we=he[2];!Array.isArray(we)&&we.buffer&&F.push(we.buffer)}return F}},6361:function(be,M,V){var H=this&&this.__createBinding||(Object.create?function(He,ut,tt,_e){_e===void 0&&(_e=tt);var Gt=Object.getOwnPropertyDescriptor(ut,tt);Gt&&!("get"in Gt?!ut.__esModule:Gt.writable||Gt.configurable)||(Gt={enumerable:!0,get:function(){return ut[tt]}}),Object.defineProperty(He,_e,Gt)}:function(He,ut,tt,_e){_e===void 0&&(_e=tt),He[_e]=ut[tt]}),te=this&&this.__setModuleDefault||(Object.create?function(He,ut){Object.defineProperty(He,"default",{enumerable:!0,value:ut})}:function(He,ut){He.default=ut}),ve=this&&this.__importStar||function(He){if(He&&He.__esModule)return He;var ut={};if(He!=null)for(var tt in He)tt!=="default"&&Object.prototype.hasOwnProperty.call(He,tt)&&H(ut,He,tt);return te(ut,He),ut},fe=this&&this.__importDefault||function(He){return He&&He.__esModule?He:{default:He}};Object.defineProperty(M,"__esModule",{value:!0}),M.dispose=M.getInstance=M.initializeWebAssembly=void 0;const Ee=ve(V(6449)),Re=fe(V(932)),Ce=V(3474);let Me,$=!1,F=!1,he=!1;const we=(He,ut)=>ut?He?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":He?"ort-wasm-simd.wasm":"ort-wasm.wasm";M.initializeWebAssembly=async He=>{if($)return Promise.resolve();if(F)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(he)throw new Error("previous call to 'initializeWebAssembly()' failed.");F=!0;const ut=He.initTimeout,tt=He.numThreads,_e=He.simd,Gt=tt>1&&(()=>{try{return typeof SharedArrayBuffer<"u"&&(typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch{return!1}})(),Qt=_e&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}})(),ir=typeof He.wasmPaths=="string"?He.wasmPaths:void 0,Lr=we(!1,Gt),jr=we(Qt,Gt),tn=typeof He.wasmPaths=="object"?He.wasmPaths[jr]:void 0;let mr=!1;const Ir=[];if(ut>0&&Ir.push(new Promise(On=>{setTimeout(()=>{mr=!0,On()},ut)})),Ir.push(new Promise((On,ba)=>{const ra=Gt?Ce:Re.default,jn={locateFile:(qn,Un)=>Gt&&qn.endsWith(".worker.js")&&typeof Blob<"u"?URL.createObjectURL(new Blob([V(4154)],{type:"text/javascript"})):qn===Lr?tn??(ir??Un)+jr:Un+qn};if(Gt)if(typeof Blob>"u")jn.mainScriptUrlOrBlob=Ee.join("/","ort-wasm-threaded.js");else{const qn=`var ortWasmThreaded=(function(){var _scriptDir;return ${ra.toString()}})();`;jn.mainScriptUrlOrBlob=new Blob([qn],{type:"text/javascript"})}ra(jn).then(qn=>{F=!1,$=!0,Me=qn,On()},qn=>{F=!1,he=!0,ba(qn)})})),await Promise.race(Ir),mr)throw new Error(`WebAssembly backend initializing failed due to timeout: ${ut}ms`)},M.getInstance=()=>{if($&&Me)return Me;throw new Error("WebAssembly is not initialized yet.")},M.dispose=()=>{var He;!$||F||he||(F=!0,(He=Me.PThread)===null||He===void 0||He.terminateAllThreads(),Me=void 0,F=!1,$=!1,he=!0)}},9710:(be,M,V)=>{V.d(M,{Z:()=>ve});var H=V(477),te=V.n(H);function ve(){return te()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;azt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(_||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;tp.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;tt*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:be=>{be.exports=function(M,V,H,te){var ve=self||window;try{try{var fe;try{fe=new ve.Blob([M])}catch{(fe=new(ve.BlobBuilder||ve.WebKitBlobBuilder||ve.MozBlobBuilder||ve.MSBlobBuilder)).append(M),fe=fe.getBlob()}var Ee=ve.URL||ve.webkitURL,Re=Ee.createObjectURL(fe),Ce=new ve[V](Re,H);return Ee.revokeObjectURL(Re),Ce}catch{return new ve[V]("data:application/javascript,".concat(encodeURIComponent(M)),H)}}catch{if(!te)throw Error("Inline worker is not supported");return new ve[V](te,H)}}},4154:be=>{be.exports=`"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}}; `},1670:be=>{be.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(be,M,V)=>{V.r(M),V.d(M,{flatbuffers:()=>H});var H={};H.Offset,H.Table,H.SIZEOF_SHORT=2,H.SIZEOF_INT=4,H.FILE_IDENTIFIER_LENGTH=4,H.SIZE_PREFIX_LENGTH=4,H.Encoding={UTF8_BYTES:1,UTF16_STRING:2},H.int32=new Int32Array(2),H.float32=new Float32Array(H.int32.buffer),H.float64=new Float64Array(H.int32.buffer),H.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,H.Long=function(te,ve){this.low=0|te,this.high=0|ve},H.Long.create=function(te,ve){return te==0&&ve==0?H.Long.ZERO:new H.Long(te,ve)},H.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},H.Long.prototype.equals=function(te){return this.low==te.low&&this.high==te.high},H.Long.ZERO=new H.Long(0,0),H.Builder=function(te){if(te)ve=te;else var ve=1024;this.bb=H.ByteBuffer.allocate(ve),this.space=ve,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},H.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},H.Builder.prototype.forceDefaults=function(te){this.force_defaults=te},H.Builder.prototype.dataBuffer=function(){return this.bb},H.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},H.Builder.prototype.prep=function(te,ve){te>this.minalign&&(this.minalign=te);for(var fe=1+~(this.bb.capacity()-this.space+ve)&te-1;this.space=0&&this.vtable[ve]==0;ve--);for(var fe=ve+1;ve>=0;ve--)this.addInt16(this.vtable[ve]!=0?te-this.vtable[ve]:0);this.addInt16(te-this.object_start);var Ee=(fe+2)*H.SIZEOF_SHORT;this.addInt16(Ee);var Re=0,Ce=this.space;e:for(ve=0;ve=0;Ce--)this.writeInt8(Re.charCodeAt(Ce))}this.prep(this.minalign,H.SIZEOF_INT+Ee),this.addOffset(te),Ee&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},H.Builder.prototype.finishSizePrefixed=function(te,ve){this.finish(te,ve,!0)},H.Builder.prototype.requiredField=function(te,ve){var fe=this.bb.capacity()-te,Ee=fe-this.bb.readInt32(fe);if(this.bb.readInt16(Ee+ve)==0)throw new Error("FlatBuffers: field "+ve+" must be set")},H.Builder.prototype.startVector=function(te,ve,fe){this.notNested(),this.vector_num_elems=ve,this.prep(H.SIZEOF_INT,te*ve),this.prep(fe,te*ve)},H.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},H.Builder.prototype.createString=function(te){if(te instanceof Uint8Array)var ve=te;else{ve=[];for(var fe=0;fe=56320?Re:(Re<<10)+te.charCodeAt(fe++)+-56613888)<128?ve.push(Ee):(Ee<2048?ve.push(Ee>>6&31|192):(Ee<65536?ve.push(Ee>>12&15|224):ve.push(Ee>>18&7|240,Ee>>12&63|128),ve.push(Ee>>6&63|128)),ve.push(63&Ee|128))}}this.addInt8(0),this.startVector(1,ve.length,1),this.bb.setPosition(this.space-=ve.length),fe=0;for(var Ce=this.space,Me=this.bb.bytes();fe>24},H.ByteBuffer.prototype.readUint8=function(te){return this.bytes_[te]},H.ByteBuffer.prototype.readInt16=function(te){return this.readUint16(te)<<16>>16},H.ByteBuffer.prototype.readUint16=function(te){return this.bytes_[te]|this.bytes_[te+1]<<8},H.ByteBuffer.prototype.readInt32=function(te){return this.bytes_[te]|this.bytes_[te+1]<<8|this.bytes_[te+2]<<16|this.bytes_[te+3]<<24},H.ByteBuffer.prototype.readUint32=function(te){return this.readInt32(te)>>>0},H.ByteBuffer.prototype.readInt64=function(te){return new H.Long(this.readInt32(te),this.readInt32(te+4))},H.ByteBuffer.prototype.readUint64=function(te){return new H.Long(this.readUint32(te),this.readUint32(te+4))},H.ByteBuffer.prototype.readFloat32=function(te){return H.int32[0]=this.readInt32(te),H.float32[0]},H.ByteBuffer.prototype.readFloat64=function(te){return H.int32[H.isLittleEndian?0:1]=this.readInt32(te),H.int32[H.isLittleEndian?1:0]=this.readInt32(te+4),H.float64[0]},H.ByteBuffer.prototype.writeInt8=function(te,ve){this.bytes_[te]=ve},H.ByteBuffer.prototype.writeUint8=function(te,ve){this.bytes_[te]=ve},H.ByteBuffer.prototype.writeInt16=function(te,ve){this.bytes_[te]=ve,this.bytes_[te+1]=ve>>8},H.ByteBuffer.prototype.writeUint16=function(te,ve){this.bytes_[te]=ve,this.bytes_[te+1]=ve>>8},H.ByteBuffer.prototype.writeInt32=function(te,ve){this.bytes_[te]=ve,this.bytes_[te+1]=ve>>8,this.bytes_[te+2]=ve>>16,this.bytes_[te+3]=ve>>24},H.ByteBuffer.prototype.writeUint32=function(te,ve){this.bytes_[te]=ve,this.bytes_[te+1]=ve>>8,this.bytes_[te+2]=ve>>16,this.bytes_[te+3]=ve>>24},H.ByteBuffer.prototype.writeInt64=function(te,ve){this.writeInt32(te,ve.low),this.writeInt32(te+4,ve.high)},H.ByteBuffer.prototype.writeUint64=function(te,ve){this.writeUint32(te,ve.low),this.writeUint32(te+4,ve.high)},H.ByteBuffer.prototype.writeFloat32=function(te,ve){H.float32[0]=ve,this.writeInt32(te,H.int32[0])},H.ByteBuffer.prototype.writeFloat64=function(te,ve){H.float64[0]=ve,this.writeInt32(te,H.int32[H.isLittleEndian?0:1]),this.writeInt32(te+4,H.int32[H.isLittleEndian?1:0])},H.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&Ce)))}return Ee},H.ByteBuffer.prototype.__indirect=function(te){return te+this.readInt32(te)},H.ByteBuffer.prototype.__vector=function(te){return te+this.readInt32(te)+H.SIZEOF_INT},H.ByteBuffer.prototype.__vector_len=function(te){return this.readInt32(te+this.readInt32(te))},H.ByteBuffer.prototype.__has_identifier=function(te){if(te.length!=H.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+H.FILE_IDENTIFIER_LENGTH);for(var ve=0;ve{var M=be&&be.__esModule?()=>be.default:()=>be;return __webpack_require__.d(M,{a:M}),M},__webpack_require__.d=(be,M)=>{for(var V in M)__webpack_require__.o(M,V)&&!__webpack_require__.o(be,V)&&Object.defineProperty(be,V,{enumerable:!0,get:M[V]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(be,M)=>Object.prototype.hasOwnProperty.call(be,M),__webpack_require__.r=be=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(be,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(be,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})())})(ortWeb_min);var ortWeb_minExports=ortWeb_min.exports;const ortWeb_min_default=getDefaultExportFromCjs(ortWeb_minExports),ONNX_WEB=_mergeNamespaces({__proto__:null,default:ortWeb_min_default},[ortWeb_minExports]);let ONNX;const executionProviders=["wasm"];typeof process<"u"&&process?.release?.name==="node"?(ONNX=sharp??ONNX_NODE,executionProviders.unshift("cpu")):(ONNX=ortWeb_min_default??ONNX_WEB,typeof navigator<"u"&&/iP(hone|od|ad).+16_4.+AppleWebKit/.test(navigator.userAgent)&&(ONNX.env.wasm.simd=!1));const{env:onnx_env}=ONNX,VERSION="2.17.2",WEB_CACHE_AVAILABLE=typeof self<"u"&&"caches"in self,FS_AVAILABLE=!isEmpty(sharp),PATH_AVAILABLE=!isEmpty(sharp),RUNNING_LOCALLY=FS_AVAILABLE&&PATH_AVAILABLE,__dirname$1=RUNNING_LOCALLY?sharp.dirname(sharp.dirname(sharp.fileURLToPath(import.meta.url))):"./",DEFAULT_CACHE_DIR=RUNNING_LOCALLY?sharp.join(__dirname$1,"/.cache/"):null,DEFAULT_LOCAL_MODEL_PATH="/models/",localModelPath=RUNNING_LOCALLY?sharp.join(__dirname$1,DEFAULT_LOCAL_MODEL_PATH):DEFAULT_LOCAL_MODEL_PATH;onnx_env?.wasm&&(onnx_env.wasm.wasmPaths=RUNNING_LOCALLY?sharp.join(__dirname$1,"/dist/"):`https://cdn.jsdelivr.net/npm/@xenova/transformers@${VERSION}/dist/`);const env$1={backends:{onnx:onnx_env},version:VERSION,remoteHost:"https://huggingface.co/",remotePathTemplate:"{model}/resolve/{revision}/",allowLocalModels:!0,localModelPath,useFS:FS_AVAILABLE,useBrowserCache:WEB_CACHE_AVAILABLE,useFSCache:FS_AVAILABLE,cacheDir:DEFAULT_CACHE_DIR};function isEmpty(be){return Object.keys(be).length===0}var define_process_env_default={};class FileResponse{_CONTENT_TYPE_MAP={txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"};constructor(M){if(this.filePath=M,this.headers=new Headers,this.exists=sharp.existsSync(M),this.exists){this.status=200,this.statusText="OK";let V=sharp.statSync(M);this.headers.set("content-length",V.size.toString()),this.updateContentType();let H=this;this.body=new ReadableStream({start(te){H.arrayBuffer().then(ve=>{te.enqueue(new Uint8Array(ve)),te.close()})}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){const M=this.filePath.toString().split(".").pop().toLowerCase();this.headers.set("content-type",this._CONTENT_TYPE_MAP[M]??"application/octet-stream")}clone(){let M=new FileResponse(this.filePath);return M.exists=this.exists,M.status=this.status,M.statusText=this.statusText,M.headers=new Headers(this.headers),M}async arrayBuffer(){return(await sharp.promises.readFile(this.filePath)).buffer}async blob(){const M=await sharp.promises.readFile(this.filePath);return new Blob([M],{type:this.headers.get("content-type")})}async text(){return await sharp.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}function isValidUrl(be,M=null,V=null){let H;try{H=new URL(be)}catch{return!1}return!(M&&!M.includes(H.protocol)||V&&!V.includes(H.hostname))}async function getFile(be){if(env$1.useFS&&!isValidUrl(be,["http:","https:","blob:"]))return new FileResponse(be);if(typeof process<"u"&&process?.release?.name==="node"){const M=!!define_process_env_default?.TESTING_REMOTELY,V=env$1.version,H=new Headers;if(H.set("User-Agent",`transformers.js/${V}; is_ci/${M};`),isValidUrl(be,["http:","https:"],["huggingface.co","hf.co"])){const ve=define_process_env_default?.HF_TOKEN??define_process_env_default?.HF_ACCESS_TOKEN;ve&&H.set("Authorization",`Bearer ${ve}`)}return fetch(be,{headers:H})}else return fetch(be)}const ERROR_MAPPING={400:"Bad request error occurred while trying to load file",401:"Unauthorized access to file",403:"Forbidden access to file",404:"Could not locate file",408:"Request timeout error occurred while trying to load file",500:"Internal server error error occurred while trying to load file",502:"Bad gateway error occurred while trying to load file",503:"Service unavailable error occurred while trying to load file",504:"Gateway timeout error occurred while trying to load file"};function handleError(be,M,V){if(!V)return null;const H=ERROR_MAPPING[be]??`Error (${be}) occurred while trying to load file`;throw Error(`${H}: "${M}".`)}class FileCache{constructor(M){this.path=M}async match(M){let V=sharp.join(this.path,M),H=new FileResponse(V);if(H.exists)return H}async put(M,V){const H=Buffer.from(await V.arrayBuffer());let te=sharp.join(this.path,M);try{await sharp.promises.mkdir(sharp.dirname(te),{recursive:!0}),await sharp.promises.writeFile(te,H)}catch(ve){console.warn("An error occurred while writing the file to cache:",ve)}}}async function tryCache(be,...M){for(let V of M)try{let H=await be.match(V);if(H)return H}catch{continue}}async function getModelFile(be,M,V=!0,H={}){if(!env$1.allowLocalModels&&H.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");dispatchCallback(H.progress_callback,{status:"initiate",name:be,file:M});let te;if(!te&&env$1.useBrowserCache){if(typeof caches>"u")throw Error("Browser cache is not available in this environment.");try{te=await caches.open("transformers-cache")}catch(tt){console.warn("An error occurred while opening the browser cache:",tt)}}!te&&env$1.useFSCache&&(te=new FileCache(H.cache_dir??env$1.cacheDir));const ve=H.revision??"main";let fe=pathJoin(be,M),Ee=pathJoin(env$1.localModelPath,fe),Re=pathJoin(env$1.remoteHost,env$1.remotePathTemplate.replaceAll("{model}",be).replaceAll("{revision}",encodeURIComponent(ve)),M),Ce=ve==="main"?fe:pathJoin(be,ve,M),Me,$=te instanceof FileCache?Ce:Re,F=!1,he;te&&(he=await tryCache(te,Ee,$));const we=he!==void 0;if(he===void 0){if(env$1.allowLocalModels)if(isValidUrl(fe,["http:","https:"])){if(H.local_files_only)throw new Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${fe}.`)}else try{he=await getFile(Ee),Me=Ee}catch(_e){console.warn(`Unable to load from local path "${Ee}": "${_e}"`)}if(he===void 0||he.status===404){if(H.local_files_only){if(V)throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${Ee}".`);return null}if(he=await getFile(Re),he.status!==200)return handleError(he.status,Re,V);Me=$}F=te&&typeof Response<"u"&&he instanceof Response&&he.status===200}dispatchCallback(H.progress_callback,{status:"download",name:be,file:M});const He={status:"progress",name:be,file:M};let ut;return H.progress_callback?we&&typeof navigator<"u"&&/firefox/i.test(navigator.userAgent)?(ut=new Uint8Array(await he.arrayBuffer()),dispatchCallback(H.progress_callback,{...He,progress:100,loaded:ut.length,total:ut.length})):ut=await readResponse(he,tt=>{dispatchCallback(H.progress_callback,{...He,...tt})}):ut=new Uint8Array(await he.arrayBuffer()),F&&Me&&await te.match(Me)===void 0&&await te.put(Me,new Response(ut,{headers:he.headers})).catch(tt=>{console.warn(`Unable to add response to browser cache: ${tt}.`)}),dispatchCallback(H.progress_callback,{status:"done",name:be,file:M}),ut}async function getModelJSON(be,M,V=!0,H={}){let te=await getModelFile(be,M,V,H);if(te===null)return{};let fe=new TextDecoder("utf-8").decode(te);return JSON.parse(fe)}async function readResponse(be,M){const V=be.headers.get("Content-Length");V===null&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let H=parseInt(V??"0"),te=new Uint8Array(H),ve=0;const fe=be.body.getReader();async function Ee(){const{done:Re,value:Ce}=await fe.read();if(Re)return;let Me=ve+Ce.length;if(Me>H){H=Me;let F=new Uint8Array(H);F.set(te),te=F}te.set(Ce,ve),ve=Me;const $=ve/H*100;return M({progress:$,loaded:ve,total:H}),Ee()}return await Ee(),te}function pathJoin(...be){return be=be.map((M,V)=>(V&&(M=M.replace(new RegExp("^/"),"")),V!==be.length-1&&(M=M.replace(new RegExp("/$"),"")),M)),be.join("/")}function interpolate_data(be,[M,V,H],[te,ve],fe="bilinear",Ee=!1){const Re=ve/H,Ce=te/V,Me=new be.constructor(te*ve*M),$=V*H,F=te*ve;for(let he=0;he=0;--Ee)te[Ee]=Re,H[Ee]=M[V[Ee]],Re*=H[Ee];const ve=V.map((Ee,Re)=>te[V.indexOf(Re)]),fe=new be.constructor(be.length);for(let Ee=0;Ee=0;--Ce)Re+=Me%M[Ce]*ve[Ce],Me=Math.floor(Me/M[Ce]);fe[Re]=be[Ee]}return[fe,H]}function softmax(be){const M=max$1(be)[0],V=be.map(ve=>Math.exp(ve-M)),H=V.reduce((ve,fe)=>ve+fe,0);return V.map(ve=>ve/H)}function log_softmax(be){return softmax(be).map(H=>Math.log(H))}function getTopItems(be,M=0){return be=Array.from(be).map((V,H)=>[H,V]).sort((V,H)=>H[1]-V[1]),M!==null&&M>0&&(be=be.slice(0,M)),be}function min$1(be){if(be.length===0)throw Error("Array must not be empty");let M=be[0],V=0;for(let H=1;HM&&(M=be[H],V=H);return[Number(M),V]}function isPowerOfTwo(be){return be>0&&(be&be-1)===0}class P2FFT{constructor(M){if(this.size=M|0,this.size<=1||!isPowerOfTwo(this.size))throw new Error("FFT size must be a power of two larger than 1");this._csize=M<<1,this.table=new Float64Array(this.size*2);for(let H=0;HH;H<<=1)++V;this._width=V%2===0?V-1:V,this._bitrev=new Int32Array(1<>>te&3)<>>1);for(let te=0;te>>1]=M[te];return H}toComplexArray(M,V){const H=V||this.createComplexArray();for(let te=0;te>>1],H[te+1]=0;return H}transform(M,V){if(M===V)throw new Error("Input and output buffers must be different");this._transform4(M,V,1)}realTransform(M,V){if(M===V)throw new Error("Input and output buffers must be different");this._realTransform4(M,V,1)}inverseTransform(M,V){if(M===V)throw new Error("Input and output buffers must be different");this._transform4(M,V,-1);for(let H=0;H>=2;fe>=2;fe>>=2){Ee=te/fe<<1;const F=Ee>>>2;for(Re=0;Re>>1,fe>>>1)}else for(Re=0,Ce=0;Re>>1,fe>>>1,H)}const $=this.table;for(fe>>=2;fe>=2;fe>>=2){Ee=te/fe<<1;const he=Ee>>>1,we=he>>>1,He=we>>>1;for(Re=0;Re>>1;for(let he=2;he>1;++Me){const $=(Me+1-M)**2/2,F=Math.sqrt(Re**2+Ce**2)**$,he=$*Math.atan2(Ce,Re),we=2*Me;ve[we]=F*Math.cos(he),ve[we+1]=F*Math.sin(he),fe[we]=ve[we],fe[we+1]=-ve[we+1]}this._slicedChirpBuffer=ve.subarray(V,H),this._f=new P2FFT(te>>1),this._f.transform(this._chirpBuffer,fe)}_transform(M,V,H){const te=this._buffer1,ve=this._buffer2,fe=this._outBuffer1,Ee=this._outBuffer2,Re=this._chirpBuffer,Ce=this._slicedChirpBuffer,Me=this._a;if(H)for(let $=0;$>1,we=V[he];te[$]=we*Ce[$],te[F]=we*Ce[F]}else for(let $=0;$=be.length&&(Re=2*(be.length-1)-Re),H[fe++]=be[Re]}H.sort(),V[ve]=H[te]}return V}function round(be,M){const V=Math.pow(10,M);return Math.round(be*V)/V}function bankers_round(be){const M=Math.round(be);return Math.abs(be)%1===.5?M%2===0?M:M-1:M}const DataTypeMap=Object.freeze({float32:Float32Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array}),ONNXTensor$1=ONNX.Tensor;class Tensor{dims;type;data;size;constructor(...M){return M[0]instanceof ONNXTensor$1?Object.assign(this,M[0]):Object.assign(this,new ONNXTensor$1(M[0],M[1],M[2])),new Proxy(this,{get:(V,H)=>{if(typeof H=="string"){let te=Number(H);if(Number.isInteger(te))return V._getitem(te)}return V[H]},set:(V,H,te)=>V[H]=te})}*[Symbol.iterator](){const[M,...V]=this.dims;if(V.length>0){const H=V.reduce((te,ve)=>te*ve);for(let te=0;te0){const te=H.reduce((ve,fe)=>ve*fe);return this._subarray(M,te,H)}else return new Tensor(this.type,[this.data[M]],H)}indexOf(M){for(let V=0;VCe[1])throw new Error(`Invalid slice: ${Ce}`);let Me=[Math.max(Ce[0],0),Math.min(Ce[1],this.dims[Re])];H.push(Me),V.push(Me[1]-Me[0])}else throw new Error(`Invalid slice: ${Ce}`)}let te=H.map(([Re,Ce])=>Ce-Re),ve=te.reduce((Re,Ce)=>Re*Ce),fe=new this.data.constructor(ve);const Ee=this.stride();for(let Re=0;Re=0;--Me){const F=te[Me];Ce+=($%F+H[Me][0])*Ee[Me],$=Math.floor($/F)}fe[Re]=this.data[Ce]}return new Tensor(this.type,fe,V)}permute(...M){return permute(this,M)}transpose(...M){return this.permute(...M)}sum(M=null,V=!1){return this.norm(1,M,V)}norm(M="fro",V=null,H=!1){if(M==="fro")M=2;else if(typeof M=="string")throw Error(`Unsupported norm: ${M}`);if(V===null){let fe=this.data.reduce((Ee,Re)=>Ee+Re**M,0)**(1/M);return new Tensor(this.type,[fe],[])}V=safeIndex(V,this.dims.length);const te=this.dims.slice();te[V]=1;const ve=new this.data.constructor(this.data.length/this.dims[V]);for(let fe=0;fe=0;--Re){const $=this.dims[Re];if(Re!==V){const F=Ce%$;Ee+=F*Me,Me*=te[Re]}Ce=Math.floor(Ce/$)}ve[Ee]+=this.data[fe]**M}if(M!==1)for(let fe=0;fe=0;--fe){const Ce=this.dims[fe];if(fe!==V){const Me=Ee%Ce;ve+=Me*Re,Re*=this.dims[fe]}Ee=Math.floor(Ee/Ce)}this.data[te]/=H.data[ve]}return this}normalize(M=2,V=1){return this.clone().normalize_(M,V)}stride(){return dimsToStride(this.dims)}squeeze(M=null){return new Tensor(this.type,this.data,calc_squeeze_dims(this.dims,M))}squeeze_(M=null){return this.dims=calc_squeeze_dims(this.dims,M),this}unsqueeze(M=null){return new Tensor(this.type,this.data,calc_unsqueeze_dims(this.dims,M))}unsqueeze_(M=null){return this.dims=calc_unsqueeze_dims(this.dims,M),this}flatten_(M=0,V=-1){V=(V+this.dims.length)%this.dims.length;let H=this.dims.slice(0,M),te=this.dims.slice(M,V+1),ve=this.dims.slice(V+1);return this.dims=[...H,te.reduce((fe,Ee)=>fe*Ee,1),...ve],this}flatten(M=0,V=-1){return this.clone().flatten_(M,V)}view(...M){let V=-1;for(let H=0;Hfe!==V?te*ve:te,1);M[V]=this.data.length/H}return new Tensor(this.type,this.data,M)}neg_(){for(let M=0;Mve*fe);if(V!==H)throw Error(`cannot reshape array of size ${V} into shape (${M})`);let te=be;for(let ve=M.length-1;ve>=0;ve--)te=te.reduce((fe,Ee)=>{let Re=fe[fe.length-1];return Re.lengthV!==1):typeof M=="number"?be[M]===1&&be.splice(M,1):Array.isArray(M)&&(be=be.filter((V,H)=>V!==1||!M.includes(H))),be}function calc_unsqueeze_dims(be,M){return M=safeIndex(M,be.length+1),be=be.slice(),be.splice(M,0,1),be}function safeIndex(be,M,V=null){if(be<-M||be>=M)throw new Error(`IndexError: index ${be} is out of bounds for dimension${V===null?"":" "+V} with size ${M}`);return be<0&&(be=(be%M+M)%M),be}function cat(be,M=0){M=safeIndex(M,be[0].dims.length);const V=be[0].dims.slice();V[M]=be.reduce((fe,Ee)=>fe+Ee.dims[M],0);const H=V.reduce((fe,Ee)=>fe*Ee,1),te=new be[0].data.constructor(H),ve=be[0].type;if(M===0){let fe=0;for(let Ee of be)te.set(Ee.data,fe),fe+=Ee.data.length}else{let fe=0;for(let Ee=0;Ee=0;--$){const we=Re.dims[$];let He=F%we;$===M&&(He+=fe),Me+=He*he,he*=V[$],F=Math.floor(F/we)}te[Me]=Re.data[Ce]}fe+=Re.dims[M]}}return new Tensor(ve,te,V)}function stack(be,M=0){return cat(be.map(V=>V.unsqueeze(M)),M)}function std_mean(be,M=null,V=1,H=!1){if(M===null){const Ce=be.data.reduce((he,we)=>he+we,0)/be.data.length,Me=Math.sqrt(be.data.reduce((he,we)=>he+(we-Ce)**2,0)/(be.data.length-V)),$=new Tensor(be.type,[Ce],[]);return[new Tensor(be.type,[Me],[]),$]}M=safeIndex(M,be.dims.length);const te=mean(be,M,H),ve=be.dims.slice();ve[M]=1;const fe=new be.data.constructor(be.data.length/be.dims[M]);for(let Re=0;Re=0;--Me){const he=be.dims[Me];if(Me!==M){const we=$%he;Ce+=we*F,F*=ve[Me]}$=Math.floor($/he)}fe[Ce]+=(be.data[Re]-te.data[Ce])**2}for(let Re=0;Refe+Ee,0);return new Tensor(be.type,[ve/be.data.length],[])}M=safeIndex(M,be.dims.length);const H=be.dims.slice();H[M]=1;const te=new be.data.constructor(be.data.length/be.dims[M]);for(let ve=0;ve=0;--Ee){const Me=be.dims[Ee];if(Ee!==M){const $=Re%Me;fe+=$*Ce,Ce*=H[Ee]}Re=Math.floor(Re/Me)}te[fe]+=be.data[ve]}if(be.dims[M]!==1)for(let ve=0;ve0||Ee>0;)switch(Re.push(fe-1),Ce.push(Ee-1),ve[fe][Ee].item()){case 0:--fe,--Ee;break;case 1:--fe;break;case 2:--Ee;break;default:throw new Error(`Internal error in dynamic time warping. Unexpected trace[${fe}, ${Ee}]. Please file a bug report.`)}return Re.reverse(),Ce.reverse(),[Re,Ce]}function dimsToStride(be){const M=new Array(be.length);for(let V=be.length-1,H=1;V>=0;--V)M[V]=H,H*=be[V];return M}function ones(be){const M=be.reduce((V,H)=>V*H,1);return new Tensor("int64",new BigInt64Array(M).fill(1n),be)}function ones_like(be){return ones(be.dims)}function quantize_embeddings(be,M){if(be.dims.length!==2)throw new Error("The tensor must have 2 dimensions");if(be.dims.at(-1)%8!==0)throw new Error("The last dimension of the tensor must be a multiple of 8");if(!["binary","ubinary"].includes(M))throw new Error("The precision must be either 'binary' or 'ubinary'");const V=M==="binary",H=V?"int8":"uint8",te=V?Int8Array:Uint8Array,ve=be.data,fe=new te(ve.length/8);for(let Ee=0;Ee0?1:0,Ce=Math.floor(Ee/8),Me=Ee%8;fe[Ce]|=Re<<7-Me,V&&Me===0&&(fe[Ce]-=128)}return new Tensor(H,fe,[be.dims[0],be.dims[1]/8])}class PriorityQueue{constructor(M=(V,H)=>V>H){this._heap=[],this._comparator=M}get size(){return this._heap.length}isEmpty(){return this.size===0}peek(){return this._heap[0]}push(...M){return this.extend(M)}extend(M){for(const V of M)this._heap.push(V),this._siftUp();return this.size}pop(){const M=this.peek(),V=this.size-1;return V>0&&this._swap(0,V),this._heap.pop(),this._siftDown(),M}replace(M){const V=this.peek();return this._heap[0]=M,this._siftDown(),V}_parent(M){return(M+1>>>1)-1}_left(M){return(M<<1)+1}_right(M){return M+1<<1}_greater(M,V){return this._comparator(this._heap[M],this._heap[V])}_swap(M,V){const H=this._heap[M];this._heap[M]=this._heap[V],this._heap[V]=H}_siftUp(){let M=this.size-1;for(;M>0&&this._greater(M,this._parent(M));)this._swap(M,this._parent(M)),M=this._parent(M)}_siftDown(){let M=0;for(;this._left(M)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);const te=new TokenLatticeNode(this.bosTokenId,0,0,0,0),ve=new TokenLatticeNode(this.eosTokenId,1,this.len,0,0);this.nodes.push(te.clone()),this.nodes.push(ve.clone()),this.beginNodes[this.len].push(ve),this.endNodes[0].push(te)}insert(M,V,H,te){const ve=this.nodes.length,fe=new TokenLatticeNode(te,ve,M,V,H);this.beginNodes[M].push(fe),this.endNodes[M+V].push(fe),this.nodes.push(fe)}viterbi(){const M=this.len;let V=0;for(;V<=M;){if(this.beginNodes[V].length==0)return[];for(let Ee of this.beginNodes[V]){Ee.prev=null;let Re=0,Ce=null;for(let Me of this.endNodes[V]){const $=Me.backtraceScore+Ee.score;(Ce===null||$>Re)&&(Ce=Me.clone(),Re=$)}if(Ce!==null)Ee.prev=Ce,Ee.backtraceScore=Re;else return[]}++V}const H=[],ve=this.beginNodes[M][0].prev;if(ve===null)return[];let fe=ve.clone();for(;fe.prev!==null;)H.push(fe.clone()),fe=fe.clone().prev.clone();return H.reverse(),H}piece(M){return this.sentence.slice(M.pos,M.pos+M.length)}tokens(){return this.viterbi().map(V=>this.piece(V))}tokenIds(){return this.viterbi().map(V=>V.tokenId)}}class TokenLatticeNode{constructor(M,V,H,te,ve){this.tokenId=M,this.nodeId=V,this.pos=H,this.length=te,this.score=ve,this.prev=null,this.backtraceScore=0}clone(){const M=new TokenLatticeNode(this.tokenId,this.nodeId,this.pos,this.length,this.score);return M.prev=this.prev,M.backtraceScore=this.backtraceScore,M}}var TOKEN_TYPES=Object.freeze({Text:"Text",NumericLiteral:"NumericLiteral",BooleanLiteral:"BooleanLiteral",StringLiteral:"StringLiteral",Identifier:"Identifier",Equals:"Equals",OpenParen:"OpenParen",CloseParen:"CloseParen",OpenStatement:"OpenStatement",CloseStatement:"CloseStatement",OpenExpression:"OpenExpression",CloseExpression:"CloseExpression",OpenSquareBracket:"OpenSquareBracket",CloseSquareBracket:"CloseSquareBracket",OpenCurlyBracket:"OpenCurlyBracket",CloseCurlyBracket:"CloseCurlyBracket",Comma:"Comma",Dot:"Dot",Colon:"Colon",Pipe:"Pipe",CallOperator:"CallOperator",AdditiveBinaryOperator:"AdditiveBinaryOperator",MultiplicativeBinaryOperator:"MultiplicativeBinaryOperator",ComparisonBinaryOperator:"ComparisonBinaryOperator",UnaryOperator:"UnaryOperator",Set:"Set",If:"If",For:"For",In:"In",Is:"Is",NotIn:"NotIn",Else:"Else",EndIf:"EndIf",ElseIf:"ElseIf",EndFor:"EndFor",And:"And",Or:"Or",Not:"UnaryOperator"}),KEYWORDS=Object.freeze({set:TOKEN_TYPES.Set,for:TOKEN_TYPES.For,in:TOKEN_TYPES.In,is:TOKEN_TYPES.Is,if:TOKEN_TYPES.If,else:TOKEN_TYPES.Else,endif:TOKEN_TYPES.EndIf,elif:TOKEN_TYPES.ElseIf,endfor:TOKEN_TYPES.EndFor,and:TOKEN_TYPES.And,or:TOKEN_TYPES.Or,not:TOKEN_TYPES.Not,"not in":TOKEN_TYPES.NotIn,true:TOKEN_TYPES.BooleanLiteral,false:TOKEN_TYPES.BooleanLiteral}),Token=class{constructor(be,M){this.value=be,this.type=M}};function isWord(be){return/\w/.test(be)}function isInteger(be){return/[0-9]/.test(be)}var ORDERED_MAPPING_TABLE=[["{%",TOKEN_TYPES.OpenStatement],["%}",TOKEN_TYPES.CloseStatement],["{{",TOKEN_TYPES.OpenExpression],["}}",TOKEN_TYPES.CloseExpression],["(",TOKEN_TYPES.OpenParen],[")",TOKEN_TYPES.CloseParen],["{",TOKEN_TYPES.OpenCurlyBracket],["}",TOKEN_TYPES.CloseCurlyBracket],["[",TOKEN_TYPES.OpenSquareBracket],["]",TOKEN_TYPES.CloseSquareBracket],[",",TOKEN_TYPES.Comma],[".",TOKEN_TYPES.Dot],[":",TOKEN_TYPES.Colon],["|",TOKEN_TYPES.Pipe],["<=",TOKEN_TYPES.ComparisonBinaryOperator],[">=",TOKEN_TYPES.ComparisonBinaryOperator],["==",TOKEN_TYPES.ComparisonBinaryOperator],["!=",TOKEN_TYPES.ComparisonBinaryOperator],["<",TOKEN_TYPES.ComparisonBinaryOperator],[">",TOKEN_TYPES.ComparisonBinaryOperator],["+",TOKEN_TYPES.AdditiveBinaryOperator],["-",TOKEN_TYPES.AdditiveBinaryOperator],["*",TOKEN_TYPES.MultiplicativeBinaryOperator],["/",TOKEN_TYPES.MultiplicativeBinaryOperator],["%",TOKEN_TYPES.MultiplicativeBinaryOperator],["=",TOKEN_TYPES.Equals]],ESCAPE_CHARACTERS=new Map([["n",` `],["t"," "],["r","\r"],["b","\b"],["f","\f"],["v","\v"],["'","'"],['"','"'],["\\","\\"]]);function preprocess(be,M={}){return be.endsWith(` `)&&(be=be.slice(0,-1)),be=be.replace(/{#.*?#}/gs,"{##}"),M.lstrip_blocks&&(be=be.replace(/^[ \t]*({[#%])/gm,"$1")),M.trim_blocks&&(be=be.replace(/([#%]})\n/g,"$1")),be.replace(/{##}/g,"").replace(/-%}\s*/g,"%}").replace(/\s*{%-/g,"{%").replace(/-}}\s*/g,"}}").replace(/\s*{{-/g,"{{")}function tokenize(be,M={}){const V=[],H=preprocess(be,M);let te=0;const ve=fe=>{let Ee="";for(;fe(H[te]);){if(H[te]==="\\"){if(++te,te>=H.length)throw new SyntaxError("Unexpected end of input");const Re=H[te++],Ce=ESCAPE_CHARACTERS.get(Re);if(Ce===void 0)throw new SyntaxError(`Unexpected escaped character: ${Re}`);Ee+=Ce;continue}if(Ee+=H[te++],te>=H.length)throw new SyntaxError("Unexpected end of input")}return Ee};e:for(;te0){V.push(new Token(Re,TOKEN_TYPES.Text));continue}}ve(Re=>/\s/.test(Re));const Ee=H[te];if(Ee==="-"||Ee==="+"){const Re=V.at(-1)?.type;if(Re===TOKEN_TYPES.Text||Re===void 0)throw new SyntaxError(`Unexpected character: ${Ee}`);switch(Re){case TOKEN_TYPES.Identifier:case TOKEN_TYPES.NumericLiteral:case TOKEN_TYPES.BooleanLiteral:case TOKEN_TYPES.StringLiteral:case TOKEN_TYPES.CloseParen:case TOKEN_TYPES.CloseSquareBracket:break;default:{++te;const Ce=ve(isInteger);V.push(new Token(`${Ee}${Ce}`,Ce.length>0?TOKEN_TYPES.NumericLiteral:TOKEN_TYPES.UnaryOperator));continue}}}for(const[Re,Ce]of ORDERED_MAPPING_TABLE)if(H.slice(te,te+Re.length)===Re){V.push(new Token(Re,Ce)),te+=Re.length;continue e}if(Ee==="'"||Ee==='"'){++te;const Re=ve(Ce=>Ce!==Ee);V.push(new Token(Re,TOKEN_TYPES.StringLiteral)),++te;continue}if(isInteger(Ee)){const Re=ve(isInteger);V.push(new Token(Re,TOKEN_TYPES.NumericLiteral));continue}if(isWord(Ee)){const Re=ve(isWord),Ce=Object.hasOwn(KEYWORDS,Re)?KEYWORDS[Re]:TOKEN_TYPES.Identifier;Ce===TOKEN_TYPES.In&&V.at(-1)?.type===TOKEN_TYPES.Not?(V.pop(),V.push(new Token("not in",TOKEN_TYPES.NotIn))):V.push(new Token(Re,Ce));continue}throw new SyntaxError(`Unexpected character: ${Ee}`)}return V}var Statement=class{type="Statement"},Program=class extends Statement{constructor(be){super(),this.body=be}type="Program"},If=class extends Statement{constructor(be,M,V){super(),this.test=be,this.body=M,this.alternate=V}type="If"},For=class extends Statement{constructor(be,M,V){super(),this.loopvar=be,this.iterable=M,this.body=V}type="For"},SetStatement=class extends Statement{constructor(be,M){super(),this.assignee=be,this.value=M}type="Set"},Expression=class extends Statement{type="Expression"},MemberExpression=class extends Expression{constructor(be,M,V){super(),this.object=be,this.property=M,this.computed=V}type="MemberExpression"},CallExpression=class extends Expression{constructor(be,M){super(),this.callee=be,this.args=M}type="CallExpression"},Identifier=class extends Expression{constructor(be){super(),this.value=be}type="Identifier"},Literal=class extends Expression{constructor(be){super(),this.value=be}type="Literal"},NumericLiteral=class extends Literal{type="NumericLiteral"},StringLiteral=class extends Literal{type="StringLiteral"},BooleanLiteral=class extends Literal{type="BooleanLiteral"},ArrayLiteral=class extends Literal{type="ArrayLiteral"},TupleLiteral=class extends Literal{type="TupleLiteral"},ObjectLiteral=class extends Literal{type="ObjectLiteral"},BinaryExpression=class extends Expression{constructor(be,M,V){super(),this.operator=be,this.left=M,this.right=V}type="BinaryExpression"},FilterExpression=class extends Expression{constructor(be,M){super(),this.operand=be,this.filter=M}type="FilterExpression"},TestExpression=class extends Expression{constructor(be,M,V){super(),this.operand=be,this.negate=M,this.test=V}type="TestExpression"},UnaryExpression=class extends Expression{constructor(be,M){super(),this.operator=be,this.argument=M}type="UnaryExpression"},SliceExpression=class extends Expression{constructor(be=void 0,M=void 0,V=void 0){super(),this.start=be,this.stop=M,this.step=V}type="SliceExpression"},KeywordArgumentExpression=class extends Expression{constructor(be,M){super(),this.key=be,this.value=M}type="KeywordArgumentExpression"};function parse(be){const M=new Program([]);let V=0;function H(qn,Un){const pa=be[V++];if(!pa||pa.type!==qn)throw new Error(`Parser Error: ${Un}. ${pa.type} !== ${qn}.`);return pa}function te(){switch(be[V].type){case TOKEN_TYPES.Text:return Ee();case TOKEN_TYPES.OpenStatement:return Re();case TOKEN_TYPES.OpenExpression:return Ce();default:throw new SyntaxError(`Unexpected token type: ${be[V].type}`)}}function ve(...qn){return V+qn.length<=be.length&&qn.some((Un,pa)=>Un!==be[V+pa].type)}function fe(...qn){return V+qn.length<=be.length&&qn.every((Un,pa)=>Un===be[V+pa].type)}function Ee(){return new StringLiteral(H(TOKEN_TYPES.Text,"Expected text token").value)}function Re(){H(TOKEN_TYPES.OpenStatement,"Expected opening statement token");let qn;switch(be[V].type){case TOKEN_TYPES.Set:++V,qn=Me(),H(TOKEN_TYPES.CloseStatement,"Expected closing statement token");break;case TOKEN_TYPES.If:++V,qn=$(),H(TOKEN_TYPES.OpenStatement,"Expected {% token"),H(TOKEN_TYPES.EndIf,"Expected endif token"),H(TOKEN_TYPES.CloseStatement,"Expected %} token");break;case TOKEN_TYPES.For:++V,qn=he(),H(TOKEN_TYPES.OpenStatement,"Expected {% token"),H(TOKEN_TYPES.EndFor,"Expected endfor token"),H(TOKEN_TYPES.CloseStatement,"Expected %} token");break;default:throw new SyntaxError(`Unknown statement type: ${be[V].type}`)}return qn}function Ce(){H(TOKEN_TYPES.OpenExpression,"Expected opening expression token");const qn=we();return H(TOKEN_TYPES.CloseExpression,"Expected closing expression token"),qn}function Me(){const qn=we();if(fe(TOKEN_TYPES.Equals)){++V;const Un=Me();return new SetStatement(qn,Un)}return qn}function $(){const qn=we();H(TOKEN_TYPES.CloseStatement,"Expected closing statement token");const Un=[],pa=[];for(;!(be[V]?.type===TOKEN_TYPES.OpenStatement&&(be[V+1]?.type===TOKEN_TYPES.ElseIf||be[V+1]?.type===TOKEN_TYPES.Else||be[V+1]?.type===TOKEN_TYPES.EndIf));)Un.push(te());if(be[V]?.type===TOKEN_TYPES.OpenStatement&&be[V+1]?.type!==TOKEN_TYPES.EndIf)if(++V,fe(TOKEN_TYPES.ElseIf))H(TOKEN_TYPES.ElseIf,"Expected elseif token"),pa.push($());else for(H(TOKEN_TYPES.Else,"Expected else token"),H(TOKEN_TYPES.CloseStatement,"Expected closing statement token");!(be[V]?.type===TOKEN_TYPES.OpenStatement&&be[V+1]?.type===TOKEN_TYPES.EndIf);)pa.push(te());return new If(qn,Un,pa)}function F(qn=!1){const Un=qn?jn:we,pa=[Un()],lo=fe(TOKEN_TYPES.Comma);for(;lo&&(++V,pa.push(Un()),!!fe(TOKEN_TYPES.Comma)););return lo?new TupleLiteral(pa):pa[0]}function he(){const qn=F(!0);if(!(qn instanceof Identifier||qn instanceof TupleLiteral))throw new SyntaxError(`Expected identifier/tuple for the loop variable, got ${qn.type} instead`);H(TOKEN_TYPES.In,"Expected `in` keyword following loop variable");const Un=we();H(TOKEN_TYPES.CloseStatement,"Expected closing statement token");const pa=[];for(;ve(TOKEN_TYPES.OpenStatement,TOKEN_TYPES.EndFor);)pa.push(te());return new For(qn,Un,pa)}function we(){return He()}function He(){const qn=ut();if(fe(TOKEN_TYPES.If)){++V;const Un=ut();H(TOKEN_TYPES.Else,"Expected else token");const pa=ut();return new If(Un,[qn],[pa])}return qn}function ut(){let qn=tt();for(;fe(TOKEN_TYPES.Or);){const Un=be[V];++V;const pa=tt();qn=new BinaryExpression(Un,qn,pa)}return qn}function tt(){let qn=_e();for(;fe(TOKEN_TYPES.And);){const Un=be[V];++V;const pa=_e();qn=new BinaryExpression(Un,qn,pa)}return qn}function _e(){let qn;for(;fe(TOKEN_TYPES.Not);){const Un=be[V];++V;const pa=_e();qn=new UnaryExpression(Un,pa)}return qn??Gt()}function Gt(){let qn=Qt();for(;fe(TOKEN_TYPES.ComparisonBinaryOperator)||fe(TOKEN_TYPES.In)||fe(TOKEN_TYPES.NotIn);){const Un=be[V];++V;const pa=Qt();qn=new BinaryExpression(Un,qn,pa)}return qn}function Qt(){let qn=On();for(;fe(TOKEN_TYPES.AdditiveBinaryOperator);){const Un=be[V];++V;const pa=On();qn=new BinaryExpression(Un,qn,pa)}return qn}function ir(){const qn=Ir();return fe(TOKEN_TYPES.OpenParen)?Lr(qn):qn}function Lr(qn){let Un=new CallExpression(qn,jr());return fe(TOKEN_TYPES.OpenParen)&&(Un=Lr(Un)),Un}function jr(){H(TOKEN_TYPES.OpenParen,"Expected opening parenthesis for arguments list");const qn=tn();return H(TOKEN_TYPES.CloseParen,"Expected closing parenthesis for arguments list"),qn}function tn(){const qn=[];for(;!fe(TOKEN_TYPES.CloseParen);){let Un=we();if(fe(TOKEN_TYPES.Equals)){if(++V,!(Un instanceof Identifier))throw new SyntaxError("Expected identifier for keyword argument");const pa=we();Un=new KeywordArgumentExpression(Un,pa)}qn.push(Un),fe(TOKEN_TYPES.Comma)&&++V}return qn}function mr(){const qn=[];let Un=!1;for(;!fe(TOKEN_TYPES.CloseSquareBracket);)fe(TOKEN_TYPES.Colon)?(qn.push(void 0),++V,Un=!0):(qn.push(we()),fe(TOKEN_TYPES.Colon)&&(++V,Un=!0));if(qn.length===0)throw new SyntaxError("Expected at least one argument for member/slice expression");if(Un){if(qn.length>3)throw new SyntaxError("Expected 0-3 arguments for slice expression");return new SliceExpression(...qn)}return qn[0]}function Ir(){let qn=jn();for(;fe(TOKEN_TYPES.Dot)||fe(TOKEN_TYPES.OpenSquareBracket);){const Un=be[V];++V;let pa;const lo=Un.type!==TOKEN_TYPES.Dot;if(lo)pa=mr(),H(TOKEN_TYPES.CloseSquareBracket,"Expected closing square bracket");else if(pa=jn(),pa.type!=="Identifier")throw new SyntaxError("Expected identifier following dot operator");qn=new MemberExpression(qn,pa,lo)}return qn}function On(){let qn=ba();for(;fe(TOKEN_TYPES.MultiplicativeBinaryOperator);){const Un=be[V];++V;const pa=ba();qn=new BinaryExpression(Un,qn,pa)}return qn}function ba(){let qn=ra();for(;fe(TOKEN_TYPES.Is);){++V;const Un=fe(TOKEN_TYPES.Not);Un&&++V;let pa=jn();if(pa instanceof BooleanLiteral&&(pa=new Identifier(pa.value.toString())),!(pa instanceof Identifier))throw new SyntaxError("Expected identifier for the test");qn=new TestExpression(qn,Un,pa)}return qn}function ra(){let qn=ir();for(;fe(TOKEN_TYPES.Pipe);){++V;let Un=jn();if(!(Un instanceof Identifier))throw new SyntaxError("Expected identifier for the filter");fe(TOKEN_TYPES.OpenParen)&&(Un=Lr(Un)),qn=new FilterExpression(qn,Un)}return qn}function jn(){const qn=be[V];switch(qn.type){case TOKEN_TYPES.NumericLiteral:return++V,new NumericLiteral(Number(qn.value));case TOKEN_TYPES.StringLiteral:return++V,new StringLiteral(qn.value);case TOKEN_TYPES.BooleanLiteral:return++V,new BooleanLiteral(qn.value==="true");case TOKEN_TYPES.Identifier:return++V,new Identifier(qn.value);case TOKEN_TYPES.OpenParen:{++V;const Un=F();if(be[V].type!==TOKEN_TYPES.CloseParen)throw new SyntaxError(`Expected closing parenthesis, got ${be[V].type} instead`);return++V,Un}case TOKEN_TYPES.OpenSquareBracket:{++V;const Un=[];for(;!fe(TOKEN_TYPES.CloseSquareBracket);)Un.push(we()),fe(TOKEN_TYPES.Comma)&&++V;return++V,new ArrayLiteral(Un)}case TOKEN_TYPES.OpenCurlyBracket:{++V;const Un=new Map;for(;!fe(TOKEN_TYPES.CloseCurlyBracket);){const pa=we();H(TOKEN_TYPES.Colon,"Expected colon between key and value in object literal");const lo=we();Un.set(pa,lo),fe(TOKEN_TYPES.Comma)&&++V}return++V,new ObjectLiteral(Un)}default:throw new SyntaxError(`Unexpected token: ${qn.type}`)}}for(;V=0?(M=(M??=0)<0?Math.max(be.length+M,0):Math.min(M,be.length),V=(V??=be.length)<0?Math.max(be.length+V,0):Math.min(V,be.length)):(M=(M??=be.length-1)<0?Math.max(be.length+M,-1):Math.min(M,be.length-1),V=(V??=-1)<-1?Math.max(be.length+V,-1):Math.min(V,be.length-1));const ve=[];for(let fe=M;te*feM.toUpperCase())}var RuntimeValue=class{type="RuntimeValue";value;builtins=new Map;constructor(be=void 0){this.value=be}__bool__(){return new BooleanValue(!!this.value)}},NumericValue=class extends RuntimeValue{type="NumericValue"},StringValue=class extends RuntimeValue{type="StringValue";builtins=new Map([["upper",new FunctionValue(()=>new StringValue(this.value.toUpperCase()))],["lower",new FunctionValue(()=>new StringValue(this.value.toLowerCase()))],["strip",new FunctionValue(()=>new StringValue(this.value.trim()))],["title",new FunctionValue(()=>new StringValue(titleCase(this.value)))],["length",new NumericValue(this.value.length)]])},BooleanValue=class extends RuntimeValue{type="BooleanValue"},ObjectValue=class extends RuntimeValue{type="ObjectValue";__bool__(){return new BooleanValue(this.value.size>0)}builtins=new Map([["get",new FunctionValue(([be,M])=>{if(!(be instanceof StringValue))throw new Error(`Object key must be a string: got ${be.type}`);return this.value.get(be.value)??M??new NullValue})],["items",new FunctionValue(()=>new ArrayValue(Array.from(this.value.entries()).map(([be,M])=>new ArrayValue([new StringValue(be),M]))))]])},ArrayValue=class extends RuntimeValue{type="ArrayValue";builtins=new Map([["length",new NumericValue(this.value.length)]]);__bool__(){return new BooleanValue(this.value.length>0)}},TupleValue=class extends ArrayValue{type="TupleValue"},FunctionValue=class extends RuntimeValue{type="FunctionValue"},NullValue=class extends RuntimeValue{type="NullValue"},UndefinedValue=class extends RuntimeValue{type="UndefinedValue"},Environment=class{constructor(be){this.parent=be}variables=new Map([["namespace",new FunctionValue(be=>{if(be.length===0)return new ObjectValue(new Map);if(be.length!==1||!(be[0]instanceof ObjectValue))throw new Error("`namespace` expects either zero arguments or a single object argument");return be[0]})]]);tests=new Map([["boolean",be=>be.type==="BooleanValue"],["callable",be=>be instanceof FunctionValue],["odd",be=>{if(be.type!=="NumericValue")throw new Error(`Cannot apply test "odd" to type: ${be.type}`);return be.value%2!==0}],["even",be=>{if(be.type!=="NumericValue")throw new Error(`Cannot apply test "even" to type: ${be.type}`);return be.value%2===0}],["false",be=>be.type==="BooleanValue"&&!be.value],["true",be=>be.type==="BooleanValue"&&be.value],["number",be=>be.type==="NumericValue"],["integer",be=>be.type==="NumericValue"&&Number.isInteger(be.value)],["iterable",be=>be instanceof ArrayValue||be instanceof StringValue],["lower",be=>{const M=be.value;return be.type==="StringValue"&&M===M.toLowerCase()}],["upper",be=>{const M=be.value;return be.type==="StringValue"&&M===M.toUpperCase()}],["none",be=>be.type==="NullValue"],["defined",be=>be.type!=="UndefinedValue"],["undefined",be=>be.type==="UndefinedValue"],["equalto",(be,M)=>be.value===M.value]]);set(be,M){return this.declareVariable(be,convertToRuntimeValues(M))}declareVariable(be,M){if(this.variables.has(be))throw new SyntaxError(`Variable already declared: ${be}`);return this.variables.set(be,M),M}setVariable(be,M){return this.variables.set(be,M),M}resolve(be){if(this.variables.has(be))return this;if(this.parent)return this.parent.resolve(be);throw new Error(`Unknown variable: ${be}`)}lookupVariable(be){try{return this.resolve(be).variables.get(be)??new UndefinedValue}catch{return new UndefinedValue}}},Interpreter=class{global;constructor(be){this.global=be??new Environment}run(be){return this.evaluate(be,this.global)}evaluateBinaryExpression(be,M){const V=this.evaluate(be.left,M);switch(be.operator.value){case"and":return V.__bool__().value?this.evaluate(be.right,M):V;case"or":return V.__bool__().value?V:this.evaluate(be.right,M)}const H=this.evaluate(be.right,M);switch(be.operator.value){case"==":return new BooleanValue(V.value==H.value);case"!=":return new BooleanValue(V.value!=H.value)}if(V instanceof UndefinedValue||H instanceof UndefinedValue)throw new Error("Cannot perform operation on undefined values");if(V instanceof NullValue||H instanceof NullValue)throw new Error("Cannot perform operation on null values");if(V instanceof NumericValue&&H instanceof NumericValue)switch(be.operator.value){case"+":return new NumericValue(V.value+H.value);case"-":return new NumericValue(V.value-H.value);case"*":return new NumericValue(V.value*H.value);case"/":return new NumericValue(V.value/H.value);case"%":return new NumericValue(V.value%H.value);case"<":return new BooleanValue(V.value":return new BooleanValue(V.value>H.value);case">=":return new BooleanValue(V.value>=H.value);case"<=":return new BooleanValue(V.value<=H.value)}else if(V instanceof ArrayValue&&H instanceof ArrayValue)switch(be.operator.value){case"+":return new ArrayValue(V.value.concat(H.value))}else if(H instanceof ArrayValue){const te=H.value.find(ve=>ve.value===V.value)!==void 0;switch(be.operator.value){case"in":return new BooleanValue(te);case"not in":return new BooleanValue(!te)}}if(V instanceof StringValue||H instanceof StringValue)switch(be.operator.value){case"+":return new StringValue(V.value.toString()+H.value.toString())}if(V instanceof StringValue&&H instanceof StringValue)switch(be.operator.value){case"in":return new BooleanValue(H.value.includes(V.value));case"not in":return new BooleanValue(!H.value.includes(V.value))}if(V instanceof StringValue&&H instanceof ObjectValue)switch(be.operator.value){case"in":return new BooleanValue(H.value.has(V.value));case"not in":return new BooleanValue(!H.value.has(V.value))}throw new SyntaxError(`Unknown operator "${be.operator.value}" between ${V.type} and ${H.type}`)}evaluateFilterExpression(be,M){const V=this.evaluate(be.operand,M);if(be.filter.type==="Identifier"){const H=be.filter;if(V instanceof ArrayValue)switch(H.value){case"list":return V;case"first":return V.value[0];case"last":return V.value[V.value.length-1];case"length":return new NumericValue(V.value.length);case"reverse":return new ArrayValue(V.value.reverse());case"sort":return new ArrayValue(V.value.sort((te,ve)=>{if(te.type!==ve.type)throw new Error(`Cannot compare different types: ${te.type} and ${ve.type}`);switch(te.type){case"NumericValue":return te.value-ve.value;case"StringValue":return te.value.localeCompare(ve.value);default:throw new Error(`Cannot compare type: ${te.type}`)}}));default:throw new Error(`Unknown ArrayValue filter: ${H.value}`)}else if(V instanceof StringValue)switch(H.value){case"length":return new NumericValue(V.value.length);case"upper":return new StringValue(V.value.toUpperCase());case"lower":return new StringValue(V.value.toLowerCase());case"title":return new StringValue(titleCase(V.value));case"capitalize":return new StringValue(V.value.charAt(0).toUpperCase()+V.value.slice(1));case"trim":return new StringValue(V.value.trim());default:throw new Error(`Unknown StringValue filter: ${H.value}`)}else if(V instanceof NumericValue)switch(H.value){case"abs":return new NumericValue(Math.abs(V.value));default:throw new Error(`Unknown NumericValue filter: ${H.value}`)}else if(V instanceof ObjectValue)switch(H.value){case"items":return new ArrayValue(Array.from(V.value.entries()).map(([te,ve])=>new ArrayValue([new StringValue(te),ve])));case"length":return new NumericValue(V.value.size);default:throw new Error(`Unknown ObjectValue filter: ${H.value}`)}throw new Error(`Cannot apply filter "${H.value}" to type: ${V.type}`)}else if(be.filter.type==="CallExpression"){const H=be.filter;if(H.callee.type!=="Identifier")throw new Error(`Unknown filter: ${H.callee.type}`);const te=H.callee.value;if(V instanceof ArrayValue){switch(te){case"selectattr":{if(V.value.some(Me=>!(Me instanceof ObjectValue)))throw new Error("`selectattr` can only be applied to array of objects");if(H.args.some(Me=>Me.type!=="StringLiteral"))throw new Error("arguments of `selectattr` must be strings");const[ve,fe,Ee]=H.args.map(Me=>this.evaluate(Me,M));let Re;if(fe){const Me=M.tests.get(fe.value);if(!Me)throw new Error(`Unknown test: ${fe.value}`);Re=Me}else Re=(...Me)=>Me[0].__bool__().value;const Ce=V.value.filter(Me=>{const $=Me.value.get(ve.value);return $?Re($,Ee):!1});return new ArrayValue(Ce)}}throw new Error(`Unknown ArrayValue filter: ${te}`)}else throw new Error(`Cannot apply filter "${te}" to type: ${V.type}`)}throw new Error(`Unknown filter: ${be.filter.type}`)}evaluateTestExpression(be,M){const V=this.evaluate(be.operand,M),H=M.tests.get(be.test.value);if(!H)throw new Error(`Unknown test: ${be.test.value}`);const te=H(V);return new BooleanValue(be.negate?!te:te)}evaluateUnaryExpression(be,M){const V=this.evaluate(be.argument,M);switch(be.operator.value){case"not":return new BooleanValue(!V.value);default:throw new SyntaxError(`Unknown operator: ${be.operator.value}`)}}evalProgram(be,M){return this.evaluateBlock(be.body,M)}evaluateBlock(be,M){let V="";for(const H of be){const te=this.evaluate(H,M);te.type!=="NullValue"&&te.type!=="UndefinedValue"&&(V+=te.value)}return new StringValue(V)}evaluateIdentifier(be,M){return M.lookupVariable(be.value)}evaluateCallExpression(be,M){const V=[],H=new Map;for(const ve of be.args)if(ve.type==="KeywordArgumentExpression"){const fe=ve;H.set(fe.key.value,this.evaluate(fe.value,M))}else V.push(this.evaluate(ve,M));H.size>0&&V.push(new ObjectValue(H));const te=this.evaluate(be.callee,M);if(te.type!=="FunctionValue")throw new Error(`Cannot call something that is not a function: got ${te.type}`);return te.value(V,M)}evaluateSliceExpression(be,M,V){if(!(be instanceof ArrayValue||be instanceof StringValue))throw new Error("Slice object must be an array or string");const H=this.evaluate(M.start,V),te=this.evaluate(M.stop,V),ve=this.evaluate(M.step,V);if(!(H instanceof NumericValue||H instanceof UndefinedValue))throw new Error("Slice start must be numeric or undefined");if(!(te instanceof NumericValue||te instanceof UndefinedValue))throw new Error("Slice stop must be numeric or undefined");if(!(ve instanceof NumericValue||ve instanceof UndefinedValue))throw new Error("Slice step must be numeric or undefined");return be instanceof ArrayValue?new ArrayValue(slice(be.value,H.value,te.value,ve.value)):new StringValue(slice(Array.from(be.value),H.value,te.value,ve.value).join(""))}evaluateMemberExpression(be,M){const V=this.evaluate(be.object,M);let H;if(be.computed){if(be.property.type==="SliceExpression")return this.evaluateSliceExpression(V,be.property,M);H=this.evaluate(be.property,M)}else H=new StringValue(be.property.value);let te;if(V instanceof ObjectValue){if(!(H instanceof StringValue))throw new Error(`Cannot access property with non-string: got ${H.type}`);te=V.value.get(H.value)??V.builtins.get(H.value)}else if(V instanceof ArrayValue||V instanceof StringValue)if(H instanceof NumericValue)te=V.value.at(H.value),V instanceof StringValue&&(te=new StringValue(V.value.at(H.value)));else if(H instanceof StringValue)te=V.builtins.get(H.value);else throw new Error(`Cannot access property with non-string/non-number: got ${H.type}`);else{if(!(H instanceof StringValue))throw new Error(`Cannot access property with non-string: got ${H.type}`);te=V.builtins.get(H.value)}return te instanceof RuntimeValue?te:new UndefinedValue}evaluateSet(be,M){const V=this.evaluate(be.value,M);if(be.assignee.type==="Identifier"){const H=be.assignee.value;M.setVariable(H,V)}else if(be.assignee.type==="MemberExpression"){const H=be.assignee,te=this.evaluate(H.object,M);if(!(te instanceof ObjectValue))throw new Error("Cannot assign to member of non-object");if(H.property.type!=="Identifier")throw new Error("Cannot assign to member with non-identifier property");te.value.set(H.property.value,V)}else throw new Error(`Invalid LHS inside assignment expression: ${JSON.stringify(be.assignee)}`);return new NullValue}evaluateIf(be,M){const V=this.evaluate(be.test,M);return this.evaluateBlock(V.__bool__().value?be.body:be.alternate,M)}evaluateFor(be,M){const V=new Environment(M),H=this.evaluate(be.iterable,V);if(!(H instanceof ArrayValue))throw new Error(`Expected iterable type in for loop: got ${H.type}`);let te="";for(let ve=0;ve0?H.value[ve-1]:new UndefinedValue],["nextitem",veMe.value.length?"few":"many"} items to unpack`);for(let $=0;$this.evaluate(V,M)));case"TupleLiteral":return new TupleValue(be.value.map(V=>this.evaluate(V,M)));case"ObjectLiteral":{const V=new Map;for(const[H,te]of be.value){const ve=this.evaluate(H,M);if(!(ve instanceof StringValue))throw new Error(`Object keys must be strings: got ${ve.type}`);V.set(ve.value,this.evaluate(te,M))}return new ObjectValue(V)}case"Identifier":return this.evaluateIdentifier(be,M);case"CallExpression":return this.evaluateCallExpression(be,M);case"MemberExpression":return this.evaluateMemberExpression(be,M);case"UnaryExpression":return this.evaluateUnaryExpression(be,M);case"BinaryExpression":return this.evaluateBinaryExpression(be,M);case"FilterExpression":return this.evaluateFilterExpression(be,M);case"TestExpression":return this.evaluateTestExpression(be,M);default:throw new SyntaxError(`Unknown node type: ${be.type}`)}}};function convertToRuntimeValues(be){switch(typeof be){case"number":return new NumericValue(be);case"string":return new StringValue(be);case"boolean":return new BooleanValue(be);case"object":return be===null?new NullValue:Array.isArray(be)?new ArrayValue(be.map(convertToRuntimeValues)):new ObjectValue(new Map(Object.entries(be).map(([M,V])=>[M,convertToRuntimeValues(V)])));case"function":return new FunctionValue((M,V)=>{const H=be(...M.map(te=>te.value))??null;return convertToRuntimeValues(H)});default:throw new Error(`Cannot convert to runtime value: ${be}`)}}var Template=class{parsed;constructor(be){const M=tokenize(be,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=parse(M)}render(be){const M=new Environment;M.set("false",!1),M.set("true",!0),M.set("raise_exception",te=>{throw new Error(te)}),M.set("range",range$1);for(const[te,ve]of Object.entries(be))M.set(te,ve);return new Interpreter(M).run(this.parsed).value}};async function loadTokenizer(be,M){const V=await Promise.all([getModelJSON(be,"tokenizer.json",!0,M),getModelJSON(be,"tokenizer_config.json",!0,M)]);return M.legacy!==null&&(V[1].legacy=M.legacy),V}function regexSplit(be,M){const V=[];let H=0;for(const te of be.matchAll(M)){const ve=te[0];H0&&V.push(ve),H=te.index+ve.length}return Hthis.tokens_to_ids.get(V)??this.unk_token_id)}convert_ids_to_tokens(M){return M.map(V=>this.vocab[V]??this.unk_token)}}class WordPieceTokenizer extends TokenizerModel{constructor(M){super(M),this.tokens_to_ids=objectToMap(M.vocab),this.unk_token_id=this.tokens_to_ids.get(M.unk_token),this.unk_token=M.unk_token,this.max_input_chars_per_word=M.max_input_chars_per_word??100,this.vocab=new Array(this.tokens_to_ids.size);for(const[V,H]of this.tokens_to_ids)this.vocab[H]=V}encode(M){const V=[];for(const H of M){const te=[...H];if(te.length>this.max_input_chars_per_word){V.push(this.unk_token);continue}let ve=!1,fe=0;const Ee=[];for(;fe0&&(Me=this.config.continuing_subword_prefix+Me),this.tokens_to_ids.has(Me)){Ce=Me;break}--Re}if(Ce===null){ve=!0;break}Ee.push(Ce),fe=Re}ve?V.push(this.unk_token):V.push(...Ee)}return V}}class Unigram extends TokenizerModel{constructor(M,V){super(M);const H=M.vocab.length;this.vocab=new Array(H),this.scores=new Array(H);for(let te=0;te[te,ve])),this.bosToken=" ",this.bosTokenId=this.tokens_to_ids.get(this.bosToken),this.eosToken=V.eos_token,this.eosTokenId=this.tokens_to_ids.get(this.eosToken),this.unkToken=this.vocab[this.unk_token_id],this.minScore=min$1(this.scores)[0],this.unkScore=this.minScore-10,this.scores[this.unk_token_id]=this.unkScore,this.trie=new CharTrie,this.trie.extend(this.vocab),this.fuse_unk=!0}populateNodes(M){const V=M.sentence,H=V.length;let te=0;for(;te{const be=[...Array.from({length:94},(te,ve)=>ve+33),...Array.from({length:12},(te,ve)=>ve+161),...Array.from({length:82},(te,ve)=>ve+174)],M=be.slice();let V=0;for(let te=0;te<256;++te)be.includes(te)||(be.push(te),M.push(256+V),V+=1);const H=M.map(te=>String.fromCharCode(te));return Object.fromEntries(be.map((te,ve)=>[te,H[ve]]))})(),UNICODE_TO_BYTES=reverseDictionary(BYTES_TO_UNICODE);class BPE extends TokenizerModel{constructor(M){super(M),this.BPE_SPLIT_TOKEN=" ",this.tokens_to_ids=objectToMap(M.vocab),this.unk_token_id=this.tokens_to_ids.get(M.unk_token),this.unk_token=M.unk_token,this.vocab=new Array(this.tokens_to_ids.size);for(const[V,H]of this.tokens_to_ids)this.vocab[H]=V;this.bpe_ranks=new Map(M.merges.map((V,H)=>[V,H])),this.merges=M.merges.map(V=>V.split(this.BPE_SPLIT_TOKEN)),this.end_of_word_suffix=M.end_of_word_suffix,this.continuing_subword_suffix=M.continuing_subword_suffix??null,this.byte_fallback=this.config.byte_fallback??!1,this.byte_fallback&&(this.text_encoder=new TextEncoder),this.ignore_merges=this.config.ignore_merges??!1,this.cache=new Map}bpe(M){if(M.length===0)return[];const V=this.cache.get(M);if(V!==void 0)return V;const H=Array.from(M);this.end_of_word_suffix&&(H[H.length-1]+=this.end_of_word_suffix);let te=[];if(H.length>1){const ve=new PriorityQueue((Re,Ce)=>Re.score`<0x${fe.toString(16).toUpperCase().padStart(2,"0")}>`)):V.push(this.unk_token)}return V}}class LegacyTokenizerModel extends TokenizerModel{constructor(M,V){super(M),this.tokens_to_ids=objectToMap(V.target_lang?M.vocab[V.target_lang]:M.vocab),this.bos_token=V.bos_token,this.bos_token_id=this.tokens_to_ids.get(this.bos_token),this.eos_token=V.eos_token,this.eos_token_id=this.tokens_to_ids.get(this.eos_token),this.pad_token=V.pad_token,this.pad_token_id=this.tokens_to_ids.get(this.pad_token),this.unk_token=V.unk_token,this.unk_token_id=this.tokens_to_ids.get(this.unk_token),this.vocab=new Array(this.tokens_to_ids.size);for(const[H,te]of this.tokens_to_ids)this.vocab[te]=H}encode(M){return M}}class Normalizer extends Callable{constructor(M){super(),this.config=M}static fromConfig(M){if(M===null)return null;switch(M.type){case"BertNormalizer":return new BertNormalizer(M);case"Precompiled":return new Precompiled(M);case"Sequence":return new NormalizerSequence(M);case"Replace":return new Replace(M);case"NFC":return new NFC(M);case"NFKC":return new NFKC(M);case"NFKD":return new NFKD(M);case"Strip":return new StripNormalizer(M);case"StripAccents":return new StripAccents(M);case"Lowercase":return new Lowercase(M);case"Prepend":return new Prepend(M);default:throw new Error(`Unknown Normalizer type: ${M.type}`)}}normalize(M){throw Error("normalize should be implemented in subclass.")}_call(M){return this.normalize(M)}}class Replace extends Normalizer{normalize(M){const V=createPattern(this.config.pattern);return V===null?M:M.replaceAll(V,this.config.content)}}class NFC extends Normalizer{normalize(M){return M=M.normalize("NFC"),M}}class NFKC extends Normalizer{normalize(M){return M=M.normalize("NFKC"),M}}class NFKD extends Normalizer{normalize(M){return M=M.normalize("NFKD"),M}}class StripNormalizer extends Normalizer{normalize(M){return this.config.strip_left&&this.config.strip_right?M=M.trim():(this.config.strip_left&&(M=M.trimStart()),this.config.strip_right&&(M=M.trimEnd())),M}}class StripAccents extends Normalizer{normalize(M){return M=remove_accents(M),M}}class Lowercase extends Normalizer{normalize(M){return M=M.toLowerCase(),M}}class Prepend extends Normalizer{normalize(M){return M=this.config.prepend+M,M}}class NormalizerSequence extends Normalizer{constructor(M){super(M),this.normalizers=M.normalizers.map(V=>Normalizer.fromConfig(V))}normalize(M){return this.normalizers.reduce((V,H)=>H.normalize(V),M)}}class BertNormalizer extends Normalizer{_tokenize_chinese_chars(M){const V=[];for(let H=0;H=19968&&M<=40959||M>=13312&&M<=19903||M>=131072&&M<=173791||M>=173824&&M<=177983||M>=177984&&M<=178207||M>=178208&&M<=183983||M>=63744&&M<=64255||M>=194560&&M<=195103}stripAccents(M){return M.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}_is_control(M){switch(M){case" ":case` `:case"\r":return!1;default:return/^\p{Cc}|\p{Cf}|\p{Co}|\p{Cs}$/u.test(M)}}_clean_text(M){const V=[];for(const H of M){const te=H.charCodeAt(0);te===0||te===65533||this._is_control(H)||(/^\s$/.test(H)?V.push(" "):V.push(H))}return V.join("")}normalize(M){return this.config.clean_text&&(M=this._clean_text(M)),this.config.handle_chinese_chars&&(M=this._tokenize_chinese_chars(M)),this.config.lowercase?(M=M.toLowerCase(),this.config.strip_accents!==!1&&(M=this.stripAccents(M))):this.config.strip_accents&&(M=this.stripAccents(M)),M}}class PreTokenizer extends Callable{static fromConfig(M){if(M===null)return null;switch(M.type){case"BertPreTokenizer":return new BertPreTokenizer(M);case"Sequence":return new PreTokenizerSequence(M);case"Whitespace":return new WhitespacePreTokenizer(M);case"WhitespaceSplit":return new WhitespaceSplit(M);case"Metaspace":return new MetaspacePreTokenizer(M);case"ByteLevel":return new ByteLevelPreTokenizer(M);case"Split":return new SplitPreTokenizer(M);case"Punctuation":return new PunctuationPreTokenizer(M);case"Digits":return new DigitsPreTokenizer(M);case"Replace":return new ReplacePreTokenizer(M);default:throw new Error(`Unknown PreTokenizer type: ${M.type}`)}}pre_tokenize_text(M,V){throw Error("pre_tokenize_text should be implemented in subclass.")}pre_tokenize(M,V){return(Array.isArray(M)?M.map(H=>this.pre_tokenize_text(H,V)):this.pre_tokenize_text(M,V)).flat()}_call(M,V){return this.pre_tokenize(M,V)}}class BertPreTokenizer extends PreTokenizer{constructor(M){super(),this.pattern=new RegExp(`[^\\s${PUNCTUATION_REGEX}]+|[${PUNCTUATION_REGEX}]`,"gu")}pre_tokenize_text(M,V){return M.trim().match(this.pattern)||[]}}class ByteLevelPreTokenizer extends PreTokenizer{constructor(M){super(),this.config=M,this.add_prefix_space=this.config.add_prefix_space,this.trim_offsets=this.config.trim_offsets,this.use_regex=this.config.use_regex??!0,this.pattern=/'s|'t|'re|'ve|'m|'ll|'d| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+/gu,this.byte_encoder=BYTES_TO_UNICODE,this.text_encoder=new TextEncoder}pre_tokenize_text(M,V){return this.add_prefix_space&&!M.startsWith(" ")&&(M=" "+M),(this.use_regex?M.match(this.pattern)||[]:[M]).map(te=>Array.from(this.text_encoder.encode(te),ve=>this.byte_encoder[ve]).join(""))}}class SplitPreTokenizer extends PreTokenizer{constructor(M){super(),this.config=M,this.pattern=createPattern(this.config.pattern,this.config.invert)}pre_tokenize_text(M,V){return this.pattern===null?[]:this.config.invert?M.match(this.pattern)||[]:regexSplit(M,this.pattern)}}class PunctuationPreTokenizer extends PreTokenizer{constructor(M){super(),this.config=M,this.pattern=new RegExp(`[^${PUNCTUATION_REGEX}]+|[${PUNCTUATION_REGEX}]+`,"gu")}pre_tokenize_text(M,V){return M.match(this.pattern)||[]}}class DigitsPreTokenizer extends PreTokenizer{constructor(M){super(),this.config=M;const V=`[^\\d]+|\\d${this.config.individual_digits?"":"+"}`;this.pattern=new RegExp(V,"gu")}pre_tokenize_text(M,V){return M.match(this.pattern)||[]}}class PostProcessor extends Callable{constructor(M){super(),this.config=M}static fromConfig(M){if(M===null)return null;switch(M.type){case"TemplateProcessing":return new TemplateProcessing(M);case"ByteLevel":return new ByteLevelPostProcessor(M);case"RobertaProcessing":return new RobertaProcessing(M);case"BertProcessing":return new BertProcessing(M);case"Sequence":return new PostProcessorSequence(M);default:throw new Error(`Unknown PostProcessor type: ${M.type}`)}}post_process(M,...V){throw Error("post_process should be implemented in subclass.")}_call(M,...V){return this.post_process(M,...V)}}class BertProcessing extends PostProcessor{constructor(M){super(M),this.cls=M.cls[0],this.sep=M.sep[0]}post_process(M,V=null,{add_special_tokens:H=!0}={}){H&&(M=mergeArrays([this.cls],M,[this.sep]));let te=new Array(M.length).fill(0);if(V!==null){const ve=H&&this instanceof RobertaProcessing?[this.sep]:[],fe=H?[this.sep]:[];M=mergeArrays(M,ve,V,fe),te=mergeArrays(te,new Array(V.length+ve.length+fe.length).fill(1))}return{tokens:M,token_type_ids:te}}}class RobertaProcessing extends BertProcessing{}class TemplateProcessing extends PostProcessor{constructor(M){super(M),this.single=M.single,this.pair=M.pair}post_process(M,V=null,{add_special_tokens:H=!0}={}){const te=V===null?this.single:this.pair;let ve=[],fe=[];for(const Ee of te)"SpecialToken"in Ee?H&&(ve.push(Ee.SpecialToken.id),fe.push(Ee.SpecialToken.type_id)):"Sequence"in Ee&&(Ee.Sequence.id==="A"?(ve=mergeArrays(ve,M),fe=mergeArrays(fe,new Array(M.length).fill(Ee.Sequence.type_id))):Ee.Sequence.id==="B"&&(ve=mergeArrays(ve,V),fe=mergeArrays(fe,new Array(V.length).fill(Ee.Sequence.type_id))));return{tokens:ve,token_type_ids:fe}}}class ByteLevelPostProcessor extends PostProcessor{post_process(M,V=null){return V&&(M=mergeArrays(M,V)),{tokens:M}}}class PostProcessorSequence extends PostProcessor{constructor(M){super(M),this.processors=M.processors.map(V=>PostProcessor.fromConfig(V))}post_process(M,V=null,H={}){let te;for(const ve of this.processors)if(ve instanceof ByteLevelPostProcessor)M=ve.post_process(M).tokens,V&&(V=ve.post_process(V).tokens);else{const fe=ve.post_process(M,V,H);M=fe.tokens,te=fe.token_type_ids}return{tokens:M,token_type_ids:te}}}class Decoder extends Callable{constructor(M){super(),this.config=M,this.added_tokens=[],this.end_of_word_suffix=null,this.trim_offsets=M.trim_offsets}static fromConfig(M){if(M===null)return null;switch(M.type){case"WordPiece":return new WordPieceDecoder(M);case"Metaspace":return new MetaspaceDecoder(M);case"ByteLevel":return new ByteLevelDecoder(M);case"Replace":return new ReplaceDecoder(M);case"ByteFallback":return new ByteFallback(M);case"Fuse":return new FuseDecoder(M);case"Strip":return new StripDecoder(M);case"Sequence":return new DecoderSequence(M);case"CTC":return new CTCDecoder(M);case"BPEDecoder":return new BPEDecoder(M);default:throw new Error(`Unknown Decoder type: ${M.type}`)}}_call(M){return this.decode(M)}decode(M){return this.decode_chain(M).join("")}decode_chain(M){throw Error("`decode_chain` should be implemented in subclass.")}}class ReplaceDecoder extends Decoder{decode_chain(M){const V=createPattern(this.config.pattern);return V===null?M:M.map(H=>H.replaceAll(V,this.config.content))}}class ByteFallback extends Decoder{constructor(M){super(M),this.text_decoder=new TextDecoder}decode_chain(M){const V=[];let H=[];for(const te of M){let ve=null;if(te.length===6&&te.startsWith("<0x")&&te.endsWith(">")){const fe=parseInt(te.slice(3,5),16);isNaN(fe)||(ve=fe)}if(ve!==null)H.push(ve);else{if(H.length>0){const fe=this.text_decoder.decode(Uint8Array.from(H));V.push(fe),H=[]}V.push(te)}}if(H.length>0){const te=this.text_decoder.decode(Uint8Array.from(H));V.push(te),H=[]}return V}}class FuseDecoder extends Decoder{decode_chain(M){return[M.join("")]}}class StripDecoder extends Decoder{constructor(M){super(M),this.content=this.config.content,this.start=this.config.start,this.stop=this.config.stop}decode_chain(M){return M.map(V=>{let H=0;for(let ve=0;ve(H!==0&&(V.startsWith(this.config.prefix)?V=V.replace(this.config.prefix,""):V=" "+V),this.cleanup&&(V=clean_up_tokenization(V)),V))}}class ByteLevelDecoder extends Decoder{constructor(M){super(M),this.byte_decoder=UNICODE_TO_BYTES,this.text_decoder=new TextDecoder("utf-8",{fatal:!1,ignoreBOM:!0}),this.end_of_word_suffix=null}convert_tokens_to_string(M){const V=M.join(""),H=new Uint8Array([...V].map(ve=>this.byte_decoder[ve]));return this.text_decoder.decode(H)}decode_chain(M){const V=[];let H=[];for(const te of M)this.added_tokens.find(ve=>ve.content===te)!==void 0?(H.length>0&&(V.push(this.convert_tokens_to_string(H)),H=[]),V.push(te)):H.push(te);return H.length>0&&V.push(this.convert_tokens_to_string(H)),V}}class CTCDecoder extends Decoder{constructor(M){super(M),this.pad_token=this.config.pad_token,this.word_delimiter_token=this.config.word_delimiter_token,this.cleanup=this.config.cleanup}convert_tokens_to_string(M){if(M.length===0)return"";const V=[M[0]];for(let ve=1;veve!==this.pad_token).join("");return this.cleanup&&(te=clean_up_tokenization(te).replaceAll(this.word_delimiter_token," ").trim()),te}decode_chain(M){return[this.convert_tokens_to_string(M)]}}class DecoderSequence extends Decoder{constructor(M){super(M),this.decoders=M.decoders.map(V=>Decoder.fromConfig(V))}decode_chain(M){return this.decoders.reduce((V,H)=>H.decode_chain(V),M)}}class BPEDecoder extends Decoder{constructor(M){super(M),this.suffix=this.config.suffix}decode_chain(M){return M.map((V,H)=>V.replaceAll(this.suffix,H===M.length-1?"":" "))}}class VitsDecoder extends Decoder{decode_chain(M){let V="";for(let H=1;HH.normalize("NFKC")).join("~"):M=M.normalize("NFKC"),M}}class PreTokenizerSequence extends PreTokenizer{constructor(M){super(),this.tokenizers=M.pretokenizers.map(V=>PreTokenizer.fromConfig(V))}pre_tokenize_text(M,V){return this.tokenizers.reduce((H,te)=>te.pre_tokenize(H,V),[M])}}class WhitespacePreTokenizer extends PreTokenizer{constructor(M){super()}pre_tokenize_text(M,V){return M.match(/\w+|[^\w\s]+/g)||[]}}class WhitespaceSplit extends PreTokenizer{constructor(M){super()}pre_tokenize_text(M,V){return whitespace_split(M)}}class ReplacePreTokenizer extends PreTokenizer{constructor(M){super(),this.config=M,this.pattern=createPattern(this.config.pattern),this.content=this.config.content}pre_tokenize_text(M,V){return this.pattern===null?[M]:[M.replaceAll(this.pattern,this.config.content)]}}const SPECIAL_TOKEN_ATTRIBUTES=["bos_token","eos_token","unk_token","sep_token","pad_token","cls_token","mask_token"];function padHelper(be,M,V,H){for(const te of Object.keys(be)){const ve=M-be[te].length,fe=V(te),Ee=new Array(ve).fill(fe);be[te]=H==="right"?mergeArrays(be[te],Ee):mergeArrays(Ee,be[te])}}function truncateHelper(be,M){for(const V of Object.keys(be))be[V].length=M}class PreTrainedTokenizer extends Callable{return_token_type_ids=!1;_default_chat_template=`{% for message in messages %}{{'<|im_start|>' + message['role'] + ' ' + message['content'] + '<|im_end|>' + ' '}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant ' }}{% endif %}`;constructor(M,V){super(),this._tokenizer_config=V,this.normalizer=Normalizer.fromConfig(M.normalizer),this.pre_tokenizer=PreTokenizer.fromConfig(M.pre_tokenizer),this.model=TokenizerModel.fromConfig(M.model,V),this.post_processor=PostProcessor.fromConfig(M.post_processor),this.decoder=Decoder.fromConfig(M.decoder),this.special_tokens=[],this.all_special_ids=[],this.added_tokens=[];for(const H of M.added_tokens){const te=new AddedToken(H);this.added_tokens.push(te),this.model.tokens_to_ids.set(te.content,te.id),this.model.vocab[te.id]=te.content,te.special&&(this.special_tokens.push(te.content),this.all_special_ids.push(te.id))}if(this.additional_special_tokens=V.additional_special_tokens??[],this.special_tokens.push(...this.additional_special_tokens),this.special_tokens=[...new Set(this.special_tokens)],this.decoder&&(this.decoder.added_tokens=this.added_tokens,this.decoder.end_of_word_suffix=this.model.end_of_word_suffix),this.added_tokens_regex=this.added_tokens.length>0?new RegExp(this.added_tokens.map(H=>`${H.lstrip?"\\s*":""}(${escapeRegExp(H.content)})${H.rstrip?"\\s*":""}`).join("|")):null,this.mask_token=this.getToken("mask_token"),this.mask_token_id=this.model.tokens_to_ids.get(this.mask_token),this.pad_token=this.getToken("pad_token","eos_token"),this.pad_token_id=this.model.tokens_to_ids.get(this.pad_token),this.sep_token=this.getToken("sep_token"),this.sep_token_id=this.model.tokens_to_ids.get(this.sep_token),this.unk_token=this.getToken("unk_token"),this.unk_token_id=this.model.tokens_to_ids.get(this.unk_token),this.model_max_length=V.model_max_length,this.remove_space=V.remove_space,this.clean_up_tokenization_spaces=V.clean_up_tokenization_spaces??!0,this.do_lowercase_and_remove_accent=V.do_lowercase_and_remove_accent??!1,this.padding_side="right",this.legacy=!1,this.chat_template=V.chat_template??null,Array.isArray(this.chat_template)){const H=Object.create(null);for(const{name:te,template:ve}of this.chat_template){if(typeof te!="string"||typeof ve!="string")throw new Error('Chat template must be a list of objects with "name" and "template" properties');H[te]=ve}this.chat_template=H}this._compiled_template_cache=new Map}getToken(...M){for(const V of M){const H=this._tokenizer_config[V];if(H)if(typeof H=="object"){if(H.__type==="AddedToken")return H.content;throw Error(`Unknown token: ${H}`)}else return H}return null}static async from_pretrained(M,{progress_callback:V=null,config:H=null,cache_dir:te=null,local_files_only:ve=!1,revision:fe="main",legacy:Ee=null}={}){const Re=await loadTokenizer(M,{progress_callback:V,cache_dir:te,local_files_only:ve,revision:fe,legacy:Ee});return new this(...Re)}_call(M,{text_pair:V=null,add_special_tokens:H=!0,padding:te=!1,truncation:ve=null,max_length:fe=null,return_tensor:Ee=!0,return_token_type_ids:Re=null}={}){const Ce=Array.isArray(M);let Me;if(Ce){if(M.length===0)throw Error("text array must be non-empty");if(V!==null){if(Array.isArray(V)){if(M.length!==V.length)throw Error("text and text_pair must have the same length")}else throw Error("text_pair must also be an array");Me=M.map((F,he)=>this._encode_plus(F,V[he],{add_special_tokens:H,return_token_type_ids:Re}))}else Me=M.map(F=>this._encode_plus(F,null,{add_special_tokens:H,return_token_type_ids:Re}))}else{if(M==null)throw Error("text may not be null or undefined");if(Array.isArray(V))throw Error("When specifying `text_pair`, since `text` is a string, `text_pair` must also be a string (i.e., not an array).");Me=[this._encode_plus(M,V,{add_special_tokens:H,return_token_type_ids:Re})]}if(fe===null?te==="max_length"?fe=this.model_max_length:fe=max$1(Me.map(F=>F.input_ids.length))[0]:ve||console.warn("Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation=true` to explicitly truncate examples to max length."),fe=Math.min(fe,this.model_max_length),te||ve)for(let F=0;Ffe?ve&&truncateHelper(Me[F],fe):te&&padHelper(Me[F],fe,he=>he==="input_ids"?this.pad_token_id:0,this.padding_side));const $={};if(Ee){if(!(te&&ve)&&Me.some(he=>{for(const we of Object.keys(he))if(he[we].length!==Me[0][we]?.length)return!0;return!1}))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=true' and 'truncation=true' to have batched tensors with the same length.");const F=[Me.length,Me[0].input_ids.length];for(const he of Object.keys(Me[0]))$[he]=new Tensor("int64",BigInt64Array.from(Me.flatMap(we=>we[he]).map(BigInt)),F)}else{for(const F of Object.keys(Me[0]))$[F]=Me.map(he=>he[F]);if(!Ce)for(const F of Object.keys($))$[F]=$[F][0]}return $}_encode_text(M){return M===null?null:(this.added_tokens_regex?M.split(this.added_tokens_regex).filter(te=>te):[M]).map((te,ve)=>{if(this.added_tokens.find(Ee=>Ee.content===te)!==void 0)return te;{if(this.remove_space===!0&&(te=te.trim().split(/\s+/).join(" ")),this.do_lowercase_and_remove_accent&&(te=lowercase_and_remove_accent(te)),this.normalizer!==null&&(te=this.normalizer(te)),te.length===0)return[];const Ee=this.pre_tokenizer!==null?this.pre_tokenizer(te,{section_index:ve}):[te];return this.model(Ee)}}).flat()}_encode_plus(M,V=null,{add_special_tokens:H=!0,return_token_type_ids:te=null}={}){const ve=this._encode_text(M),fe=this._encode_text(V),Ee=this.post_processor?this.post_processor(ve,fe,{add_special_tokens:H}):{tokens:mergeArrays(ve??[],fe??[])},Re=this.model.convert_tokens_to_ids(Ee.tokens),Ce={input_ids:Re,attention_mask:new Array(Re.length).fill(1)};return(te??this.return_token_type_ids)&&Ee.token_type_ids&&(Ce.token_type_ids=Ee.token_type_ids),Ce}encode(M,V=null,{add_special_tokens:H=!0,return_token_type_ids:te=null}={}){const{input_ids:ve}=this._encode_plus(M,V,{add_special_tokens:H,return_token_type_ids:te});return ve}batch_decode(M,V={}){return M instanceof Tensor&&(M=M.tolist()),M.map(H=>this.decode(H,V))}decode(M,V={}){if(M instanceof Tensor&&(M=prepareTensorForDecode(M)),!Array.isArray(M)||M.length===0||!isIntegralNumber(M[0]))throw Error("token_ids must be a non-empty array of integers.");return this.decode_single(M,V)}decode_single(M,{skip_special_tokens:V=!1,clean_up_tokenization_spaces:H=null}){let te=this.model.convert_ids_to_tokens(M);V&&(te=te.filter(fe=>!this.special_tokens.includes(fe)));let ve=this.decoder?this.decoder(te):te.join(" ");return this.decoder&&this.decoder.end_of_word_suffix&&(ve=ve.replaceAll(this.decoder.end_of_word_suffix," "),V&&(ve=ve.trim())),(H??this.clean_up_tokenization_spaces)&&(ve=clean_up_tokenization(ve)),ve}get default_chat_template(){return this._warned_about_chat_template||(console.warn("No chat template is defined for this tokenizer - using a default chat template that implements the ChatML format. If the default is not appropriate for your model, please set `tokenizer.chat_template` to an appropriate template. See https://huggingface.co/docs/transformers/main/chat_templating for more information."),this._warned_about_chat_template=!0),this._default_chat_template}apply_chat_template(M,{chat_template:V=null,add_generation_prompt:H=!1,tokenize:te=!0,padding:ve=!1,truncation:fe=!1,max_length:Ee=null,return_tensor:Re=!0,tokenizer_kwargs:Ce={},...Me}={}){if(this.chat_template&&typeof this.chat_template=="object"||this.chat_template===null&&this.default_chat_template&&typeof this.default_chat_template=="object"){const we=this.chat_template??this.default_chat_template;if(V!==null&&Object.hasOwn(we,V))V=we[V];else if(V===null&&"default"in we)V=we.default;else if(V===null)throw Error(`This model has multiple chat templates with no default specified! Please either pass a chat template or the name of the template you wish to use to the 'chat_template' argument. Available template names are ${Object.keys(we).sort()}.`)}else V??=this.chat_template??this.default_chat_template;if(typeof V!="string")throw Error(`chat_template must be a string, but got ${typeof V}`);let $=this._compiled_template_cache.get(V);$===void 0&&($=new Template(V),this._compiled_template_cache.set(V,$));const F=Object.create(null);for(const we of SPECIAL_TOKEN_ATTRIBUTES){const He=this.getToken(we);He&&(F[we]=He)}const he=$.render({messages:M,add_generation_prompt:H,...F,...Me});return te?this._call(he,{add_special_tokens:!1,padding:ve,truncation:fe,max_length:Ee,return_tensor:Re,...Ce}).input_ids:he}}class BertTokenizer extends PreTrainedTokenizer{return_token_type_ids=!0}class AlbertTokenizer extends PreTrainedTokenizer{return_token_type_ids=!0}class MobileBertTokenizer extends PreTrainedTokenizer{return_token_type_ids=!0}class SqueezeBertTokenizer extends PreTrainedTokenizer{return_token_type_ids=!0}class DebertaTokenizer extends PreTrainedTokenizer{return_token_type_ids=!0}class DebertaV2Tokenizer extends PreTrainedTokenizer{return_token_type_ids=!0}class HerbertTokenizer extends PreTrainedTokenizer{return_token_type_ids=!0}class ConvBertTokenizer extends PreTrainedTokenizer{return_token_type_ids=!0}class RoFormerTokenizer extends PreTrainedTokenizer{return_token_type_ids=!0}class DistilBertTokenizer extends PreTrainedTokenizer{}class CamembertTokenizer extends PreTrainedTokenizer{}class XLMTokenizer extends PreTrainedTokenizer{return_token_type_ids=!0;constructor(M,V){super(M,V),console.warn('WARNING: `XLMTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}}class ElectraTokenizer extends PreTrainedTokenizer{return_token_type_ids=!0}class T5Tokenizer extends PreTrainedTokenizer{}class GPT2Tokenizer extends PreTrainedTokenizer{_default_chat_template='{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}'}class BartTokenizer extends PreTrainedTokenizer{}class MBartTokenizer extends PreTrainedTokenizer{constructor(M,V){super(M,V),this.languageRegex=/^[a-z]{2}_[A-Z]{2}$/,this.language_codes=this.special_tokens.filter(H=>this.languageRegex.test(H)),this.lang_to_token=H=>H}_build_translation_inputs(M,V,H){return _build_translation_inputs(this,M,V,H)}}class MBart50Tokenizer extends MBartTokenizer{}class RobertaTokenizer extends PreTrainedTokenizer{}class BloomTokenizer extends GPT2Tokenizer{constructor(M,V){const H=".,!?…。,、।۔،",te=M.pre_tokenizer?.pretokenizers[0]?.pattern;te&&te.Regex===` ?[^(\\s|[${H}])]+`&&(te.Regex=` ?[^\\s${H}]+`),super(M,V)}}const SPIECE_UNDERLINE="▁";class LlamaTokenizer extends PreTrainedTokenizer{_default_chat_template=`{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% elif USE_DEFAULT_PROMPT == true and not '<>' in messages[0]['content'] %}{% set loop_messages = messages %}{% set system_message = 'DEFAULT_SYSTEM_MESSAGE' %}{% else %}{% set loop_messages = messages %}{% set system_message = false %}{% endif %}{% for message in loop_messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if loop.index0 == 0 and system_message != false %}{% set content = '<> ' + system_message + ' <> ' + message['content'] %}{% else %}{% set content = message['content'] %}{% endif %}{% if message['role'] == 'user' %}{{ bos_token + '[INST] ' + content.strip() + ' [/INST]' }}{% elif message['role'] == 'system' %}{{ '<> ' + content.strip() + ' <> ' }}{% elif message['role'] == 'assistant' %}{{ ' ' + content.strip() + ' ' + eos_token }}{% endif %}{% endfor %}`;DEFAULT_SYSTEM_PROMPT=`You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.`;constructor(M,V){super(M,V),this.use_default_system_prompt=V.use_default_system_prompt??!1,this.legacy=V.legacy??!0,this.legacy||(this.normalizer=null,this.pre_tokenizer=new MetaspacePreTokenizer({replacement:SPIECE_UNDERLINE,add_prefix_space:!0,prepend_scheme:"first"}))}_encode_text(M){if(M===null)return null;if(this.legacy||M.length===0)return super._encode_text(M);let V=super._encode_text(SPIECE_UNDERLINE+M.replaceAll(SPIECE_UNDERLINE," "));return V.length>1&&V[0]===SPIECE_UNDERLINE&&this.special_tokens.includes(V[1])&&(V=V.slice(1)),V}get default_chat_template(){return super.default_chat_template.replaceAll("USE_DEFAULT_PROMPT",this.use_default_system_prompt?"true":"false").replaceAll("DEFAULT_SYSTEM_MESSAGE",this.DEFAULT_SYSTEM_PROMPT.replaceAll(` `,"\\n").replaceAll("'","\\'"))}}class CodeLlamaTokenizer extends LlamaTokenizer{}class XLMRobertaTokenizer extends PreTrainedTokenizer{}class MPNetTokenizer extends PreTrainedTokenizer{}class FalconTokenizer extends PreTrainedTokenizer{}class GPTNeoXTokenizer extends PreTrainedTokenizer{}class EsmTokenizer extends PreTrainedTokenizer{}class Qwen2Tokenizer extends PreTrainedTokenizer{}class GemmaTokenizer extends PreTrainedTokenizer{_default_chat_template=`{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if (message['role'] == 'assistant') %}{% set role = 'model' %}{% else %}{% set role = message['role'] %}{% endif %}{{ '' + role + ' ' + message['content'] | trim + ' ' }}{% endfor %}{% if add_generation_prompt %}{{'model '}}{% endif %}`}class Grok1Tokenizer extends PreTrainedTokenizer{}function _build_translation_inputs(be,M,V,H){if(!("language_codes"in be)||!Array.isArray(be.language_codes))throw new Error("Tokenizer must have `language_codes` attribute set and it should be an array of language ids.");if(!("languageRegex"in be)||!(be.languageRegex instanceof RegExp))throw new Error("Tokenizer must have `languageRegex` attribute set and it should be a regular expression.");if(!("lang_to_token"in be)||typeof be.lang_to_token!="function")throw new Error("Tokenizer must have `lang_to_token` attribute set and it should be a function.");const te=H.src_lang,ve=H.tgt_lang;if(!be.language_codes.includes(ve))throw new Error(`Target language code "${ve}" is not valid. Must be one of: {${be.language_codes.join(", ")}}`);if(te!==void 0){if(!be.language_codes.includes(te))throw new Error(`Source language code "${te}" is not valid. Must be one of: {${be.language_codes.join(", ")}}`);for(const fe of be.post_processor.config.single)if("SpecialToken"in fe&&be.languageRegex.test(fe.SpecialToken.id)){fe.SpecialToken.id=be.lang_to_token(te);break}}return H.forced_bos_token_id=be.model.convert_tokens_to_ids([be.lang_to_token(ve)])[0],be._call(M,V)}class NllbTokenizer extends PreTrainedTokenizer{constructor(M,V){super(M,V),this.languageRegex=/^[a-z]{3}_[A-Z][a-z]{3}$/,this.language_codes=this.special_tokens.filter(H=>this.languageRegex.test(H)),this.lang_to_token=H=>H}_build_translation_inputs(M,V,H){return _build_translation_inputs(this,M,V,H)}}class M2M100Tokenizer extends PreTrainedTokenizer{constructor(M,V){super(M,V),this.languageRegex=/^__[a-z]{2,3}__$/,this.language_codes=this.special_tokens.filter(H=>this.languageRegex.test(H)).map(H=>H.slice(2,-2)),this.lang_to_token=H=>`__${H}__`}_build_translation_inputs(M,V,H){return _build_translation_inputs(this,M,V,H)}}const WHISPER_LANGUAGES=[["en","english"],["zh","chinese"],["de","german"],["es","spanish"],["ru","russian"],["ko","korean"],["fr","french"],["ja","japanese"],["pt","portuguese"],["tr","turkish"],["pl","polish"],["ca","catalan"],["nl","dutch"],["ar","arabic"],["sv","swedish"],["it","italian"],["id","indonesian"],["hi","hindi"],["fi","finnish"],["vi","vietnamese"],["he","hebrew"],["uk","ukrainian"],["el","greek"],["ms","malay"],["cs","czech"],["ro","romanian"],["da","danish"],["hu","hungarian"],["ta","tamil"],["no","norwegian"],["th","thai"],["ur","urdu"],["hr","croatian"],["bg","bulgarian"],["lt","lithuanian"],["la","latin"],["mi","maori"],["ml","malayalam"],["cy","welsh"],["sk","slovak"],["te","telugu"],["fa","persian"],["lv","latvian"],["bn","bengali"],["sr","serbian"],["az","azerbaijani"],["sl","slovenian"],["kn","kannada"],["et","estonian"],["mk","macedonian"],["br","breton"],["eu","basque"],["is","icelandic"],["hy","armenian"],["ne","nepali"],["mn","mongolian"],["bs","bosnian"],["kk","kazakh"],["sq","albanian"],["sw","swahili"],["gl","galician"],["mr","marathi"],["pa","punjabi"],["si","sinhala"],["km","khmer"],["sn","shona"],["yo","yoruba"],["so","somali"],["af","afrikaans"],["oc","occitan"],["ka","georgian"],["be","belarusian"],["tg","tajik"],["sd","sindhi"],["gu","gujarati"],["am","amharic"],["yi","yiddish"],["lo","lao"],["uz","uzbek"],["fo","faroese"],["ht","haitian creole"],["ps","pashto"],["tk","turkmen"],["nn","nynorsk"],["mt","maltese"],["sa","sanskrit"],["lb","luxembourgish"],["my","myanmar"],["bo","tibetan"],["tl","tagalog"],["mg","malagasy"],["as","assamese"],["tt","tatar"],["haw","hawaiian"],["ln","lingala"],["ha","hausa"],["ba","bashkir"],["jw","javanese"],["su","sundanese"]],WHISPER_LANGUAGE_MAPPING=new Map(WHISPER_LANGUAGES),WHISPER_TO_LANGUAGE_CODE_MAPPING=new Map([...WHISPER_LANGUAGES.map(([be,M])=>[M,be]),["burmese","my"],["valencian","ca"],["flemish","nl"],["haitian","ht"],["letzeburgesch","lb"],["pushto","ps"],["panjabi","pa"],["moldavian","ro"],["moldovan","ro"],["sinhalese","si"],["castilian","es"]]);class WhisperTokenizer extends PreTrainedTokenizer{_default_chat_template='{% for message in messages %}" "{{ message.content }}{{ eos_token }}" "{% endfor %}';_decode_asr(M,{return_timestamps:V=!1,return_language:H=!1,time_precision:te=null,force_full_sequences:ve=!0}={}){if(te===null)throw Error("Must specify time_precision");let fe=null;const Ee=V==="word";function Re(){return{language:fe,timestamp:[null,null],text:""}}const Ce=[];let Me=Re(),$=0;const F=this.model.convert_tokens_to_ids(["<|notimestamps|>"])[0]+1;let he=[],we=[],He=!1,ut=null;const tt=new Set(this.all_special_ids);for(const Qt of M){const ir=Qt.tokens,Lr=Ee?Qt.token_timestamps:null;let jr=null,tn=F;if("stride"in Qt){const[On,ba,ra]=Qt.stride;if($-=ba,ut=On-ra,ba&&(tn=ba/te+F),ra)for(let jn=ir.length-1;jn>=0;--jn){const qn=ir[jn];if(qn>=F){if(jr!==null&&(qn-F)*te=F){const ra=(ba-F)*te+$,jn=round(ra,2);if(jr!==null&&ba>=jr)He=!0;else if(He||he.length>0&&ba0?(he.push(mr),Ee&&we.push(Ir)):he.every(On=>On.length===0)&&(Me=Re(),he=[],mr=[],we=[],Ir=[])}if(he.length>0){if(ve&&V)throw new Error("Whisper did not predict an ending timestamp, which can happen if audio is cut off in the middle of a word. Also make sure WhisperTimeStampLogitsProcessor was used during generation.");const[Qt,ir]=this.findLongestCommonSequence(he,we),Lr=this.decode(Qt);Me.text=Lr,Ee&&(Me.words=this.collateWordTimestamps(Qt,ir,fe)),Ce.push(Me)}let _e=Object.create(null);const Gt=Ce.map(Qt=>Qt.text).join("");if(V||H){for(let Qt=0;Qt0;let Ee=fe?[]:null,Re=fe?V[0]:null;for(let Ce=1;Cejn===On[qn]).length,ra=ba/Qt+ir;ba>1&&ra>$&&($=ra,F=[Lr,jr,mr,Ir])}const[we,He,ut,tt]=F,_e=Math.floor((He+we)/2),Gt=Math.floor((tt+ut)/2);ve.push(...H.slice(0,_e)),H=Me.slice(Gt),te=H.length,fe&&(Ee.push(...Re.slice(0,_e)),Re=V[Ce].slice(Gt))}return ve.push(...H),fe?(Ee.push(...Re),[ve,Ee]):[ve,[]]}collateWordTimestamps(M,V,H){const[te,ve,fe]=this.combineTokensIntoWords(M,H),Ee=[];for(let Re=0;Re=te){const Ee=round((fe-te)*H,2);ve.push(`<|${Ee}|>`),ve.push([])}else ve[ve.length-1].push(fe);return ve=ve.map(fe=>typeof fe=="string"?fe:super.decode(fe,V)),ve.join("")}splitTokensOnUnicode(M){const V=this.decode(M,{decode_with_timestamps:!0}),H="�",te=[],ve=[],fe=[];let Ee=[],Re=[],Ce=0;for(let Me=0;Me=this.model.tokens_to_ids.get("<|endoftext|>"),we=Me.startsWith(" "),He=Me.trim(),ut=Re.test(He);if(he||we||ut||ve.length===0)ve.push(Me),fe.push($),Ee.push(F);else{const tt=ve.length-1;ve[tt]+=Me,fe[tt].push(...$),Ee[tt].push(...F)}}return[ve,fe,Ee]}mergePunctuations(M,V,H,te,ve){const fe=structuredClone(M),Ee=structuredClone(V),Re=structuredClone(H);let Ce=fe.length-2,Me=fe.length-1;for(;Ce>=0;)fe[Ce].startsWith(" ")&&te.includes(fe[Ce].trim())?(fe[Me]=fe[Ce]+fe[Me],Ee[Me]=mergeArrays(Ee[Ce],Ee[Me]),Re[Me]=mergeArrays(Re[Ce],Re[Me]),fe[Ce]="",Ee[Ce]=[],Re[Ce]=[]):Me=Ce,--Ce;for(Ce=0,Me=1;Me$),Ee.filter($=>$.length>0),Re.filter($=>$.length>0)]}get_decoder_prompt_ids({language:M=null,task:V=null,no_timestamps:H=!0}={}){const te=[];if(M){M=M.toLowerCase();let ve=WHISPER_TO_LANGUAGE_CODE_MAPPING.get(M);if(ve===void 0)if(WHISPER_LANGUAGE_MAPPING.has(M))ve=M;else{const Re=M.length===2?WHISPER_LANGUAGE_MAPPING.keys():WHISPER_LANGUAGE_MAPPING.values();throw new Error(`Language "${M}" is not supported. Must be one of: ${JSON.stringify(Re)}`)}const fe=this.model.tokens_to_ids.get(`<|${ve}|>`);if(fe===void 0)throw new Error(`Unable to find language "${ve}" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`);te.push(fe)}else te.push(null);if(V){if(V=V.toLowerCase(),V!=="transcribe"&&V!=="translate")throw new Error(`Task "${V}" is not supported. Must be one of: ["transcribe", "translate"]`);const ve=this.model.tokens_to_ids.get(`<|${V}|>`);if(ve===void 0)throw new Error(`Unable to find task "${V}" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.`);te.push(ve)}else te.push(null);if(H){const ve=this.model.tokens_to_ids.get("<|notimestamps|>");if(ve===void 0)throw new Error('Unable to find "<|notimestamps|>" in model vocabulary. Please report this issue at https://github.com/xenova/transformers.js/issues/new/choose.');te.push(ve)}return te.map((ve,fe)=>[fe+1,ve]).filter(ve=>ve[1]!==null)}}class CodeGenTokenizer extends PreTrainedTokenizer{}class CLIPTokenizer extends PreTrainedTokenizer{}class SiglipTokenizer extends PreTrainedTokenizer{}class MarianTokenizer extends PreTrainedTokenizer{constructor(M,V){super(M,V),this.languageRegex=/^(>>\w+<<)\s*/g,this.supported_language_codes=this.model.vocab.filter(H=>this.languageRegex.test(H)),console.warn('WARNING: `MarianTokenizer` is not yet supported by Hugging Face\'s "fast" tokenizers library. Therefore, you may experience slightly inaccurate results.')}_encode_text(M){if(M===null)return null;const[V,...H]=M.trim().split(this.languageRegex);if(H.length===0)return super._encode_text(V);if(H.length===2){const[te,ve]=H;return this.supported_language_codes.includes(te)||console.warn(`Unsupported language code "${te}" detected, which may lead to unexpected behavior. Should be one of: ${JSON.stringify(this.supported_language_codes)}`),mergeArrays([te],super._encode_text(ve))}}}class Wav2Vec2CTCTokenizer extends PreTrainedTokenizer{}class BlenderbotTokenizer extends PreTrainedTokenizer{_default_chat_template="{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}"}class BlenderbotSmallTokenizer extends BlenderbotTokenizer{}class SpeechT5Tokenizer extends PreTrainedTokenizer{}class NougatTokenizer extends PreTrainedTokenizer{}class VitsTokenizer extends PreTrainedTokenizer{constructor(M,V){super(M,V),this.decoder=new VitsDecoder({})}}class CohereTokenizer extends PreTrainedTokenizer{}class AutoTokenizer{static TOKENIZER_CLASS_MAPPING={T5Tokenizer,DistilBertTokenizer,CamembertTokenizer,DebertaTokenizer,DebertaV2Tokenizer,BertTokenizer,HerbertTokenizer,ConvBertTokenizer,RoFormerTokenizer,XLMTokenizer,ElectraTokenizer,MobileBertTokenizer,SqueezeBertTokenizer,AlbertTokenizer,GPT2Tokenizer,BartTokenizer,MBartTokenizer,MBart50Tokenizer,RobertaTokenizer,WhisperTokenizer,CodeGenTokenizer,CLIPTokenizer,SiglipTokenizer,MarianTokenizer,BloomTokenizer,NllbTokenizer,M2M100Tokenizer,LlamaTokenizer,CodeLlamaTokenizer,XLMRobertaTokenizer,MPNetTokenizer,FalconTokenizer,GPTNeoXTokenizer,EsmTokenizer,Wav2Vec2CTCTokenizer,BlenderbotTokenizer,BlenderbotSmallTokenizer,SpeechT5Tokenizer,NougatTokenizer,VitsTokenizer,Qwen2Tokenizer,GemmaTokenizer,Grok1Tokenizer,CohereTokenizer,PreTrainedTokenizer};static async from_pretrained(M,{quantized:V=!0,progress_callback:H=null,config:te=null,cache_dir:ve=null,local_files_only:fe=!1,revision:Ee="main",legacy:Re=null}={}){const[Ce,Me]=await loadTokenizer(M,{progress_callback:H,cache_dir:ve,local_files_only:fe,revision:Ee,legacy:Re}),$=Me.tokenizer_class?.replace(/Fast$/,"")??"PreTrainedTokenizer";let F=this.TOKENIZER_CLASS_MAPPING[$];return F||(console.warn(`Unknown tokenizer class "${$}", attempting to construct from base class.`),F=PreTrainedTokenizer),new F(Ce,Me)}}async function loadConfig(be,M){return await getModelJSON(be,"config.json",!0,M)}class PretrainedConfig{constructor(M){this.model_type=null,this.is_encoder_decoder=!1,Object.assign(this,M)}static async from_pretrained(M,{progress_callback:V=null,config:H=null,cache_dir:te=null,local_files_only:ve=!1,revision:fe="main"}={}){let Ee=H??await loadConfig(M,{progress_callback:V,cache_dir:te,local_files_only:ve,revision:fe});return new this(Ee)}}class AutoConfig{static async from_pretrained(...M){return PretrainedConfig.from_pretrained(...M)}}class LogitsProcessorList extends Callable{constructor(){super(),this.processors=[]}push(M){this.processors.push(M)}extend(M){this.processors.push(...M)}_call(M,V){for(let H of V)this.processors.forEach(te=>te(M,H))}[Symbol.iterator](){return this.processors.values()}}class LogitsProcessor extends Callable{_call(M,V){throw Error("`_call` should be implemented in a subclass")}}class ForceTokensLogitsProcessor extends LogitsProcessor{constructor(M){super(),this.force_token_map=Object.fromEntries(M??[])}_call(M,V){let H=this.force_token_map[M.length];return exists(H)&&(V.data.fill(-1/0),V.data[H]=0),V}}class ForcedBOSTokenLogitsProcessor extends LogitsProcessor{constructor(M){super(),this.bos_token_id=M}_call(M,V){return M.length===1&&(V.data.fill(-1/0),V.data[this.bos_token_id]=0),V}}class ForcedEOSTokenLogitsProcessor extends LogitsProcessor{constructor(M,V){super(),this.max_length=M,this.forced_eos_token_id=V}_call(M,V){}}class SuppressTokensAtBeginLogitsProcessor extends LogitsProcessor{constructor(M,V){super(),this.begin_suppress_tokens=M,this.begin_index=V}_call(M,V){if(M.length===this.begin_index)for(let H of this.begin_suppress_tokens)V.data[H]=-1/0;return V}}class WhisperTimeStampLogitsProcessor extends LogitsProcessor{constructor(M){super(),this.eos_token_id=M.eos_token_id,this.no_timestamps_token_id=M.no_timestamps_token_id,this.timestamp_begin=this.no_timestamps_token_id+1,this.begin_index=(M.forced_decoder_ids||[]).length+2,M.forced_decoder_ids.slice(-1)[0][1]===this.no_timestamps_token_id&&(this.begin_index-=1),this.max_initial_timestamp_index=M.max_initial_timestamp_index}_call(M,V){const H=V.data;if(H[this.no_timestamps_token_id]=-1/0,M.length===this.begin_index-1)return H.fill(-1/0),H[this.timestamp_begin]=0,V;const te=M.slice(this.begin_index),ve=te.length>=1&&te[te.length-1]>=this.timestamp_begin,fe=te.length<2||te[te.length-2]>=this.timestamp_begin;if(ve&&(fe?H.subarray(this.timestamp_begin).fill(-1/0):H.subarray(0,this.eos_token_id).fill(-1/0)),M.length===this.begin_index&&this.max_initial_timestamp_index!==null){const Me=this.timestamp_begin+this.max_initial_timestamp_index;H.subarray(Me+1).fill(-1/0)}const Ee=log_softmax(H),Re=Math.log(Ee.subarray(this.timestamp_begin).map(Math.exp).reduce((Me,$)=>Me+$)),Ce=max$1(Ee.subarray(0,this.timestamp_begin))[0];return Re>Ce&&H.subarray(0,this.timestamp_begin).fill(-1/0),V}}class NoRepeatNGramLogitsProcessor extends LogitsProcessor{constructor(M){super(),this.no_repeat_ngram_size=M}getNgrams(M){const V=M.length,H=[];for(let ve=0;ve0&&(te=te.map(ve=>ve/this.generation_config.temperature)),te}randomSelect(M){let V=M.reduce((te,ve)=>te+ve,0),H=Math.random()*V;for(let te=0;te1)return new BeamSearchSampler(M);if(M.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${M.num_return_sequences}.`);return new GreedySampler(M)}}class GreedySampler extends Sampler{sample(M,V=-1){let H=this.getLogits(M,V);return[[max$1(H)[1],0]]}}class MultinomialSampler extends Sampler{sample(M,V=-1){let H=M.dims.at(-1);this.generation_config.top_k>0&&(H=Math.min(this.generation_config.top_k,H));const te=this.getLogits(M,V),ve=getTopItems(te,H),fe=softmax(ve.map(Ee=>Ee[1]));return Array.from({length:this.generation_config.num_beams},()=>{const Ee=this.randomSelect(fe);return[ve[Ee][0],Math.log(fe[Ee])]})}}class BeamSearchSampler extends Sampler{sample(M,V=-1){let H=M.dims.at(-1);this.generation_config.top_k>0&&(H=Math.min(this.generation_config.top_k,H));const te=this.getLogits(M,V),ve=getTopItems(te,H),fe=softmax(ve.map(Ee=>Ee[1]));return Array.from({length:this.generation_config.num_beams},(Ee,Re)=>[ve[Re][0],Math.log(fe[Re])])}}const{InferenceSession,Tensor:ONNXTensor,env}=ONNX,MODEL_TYPES={EncoderOnly:0,EncoderDecoder:1,Seq2Seq:2,Vision2Seq:3,DecoderOnly:4,MaskGeneration:5},MODEL_TYPE_MAPPING=new Map,MODEL_NAME_TO_CLASS_MAPPING=new Map,MODEL_CLASS_TO_NAME_MAPPING=new Map;async function constructSession(be,M,V){let H=`onnx/${M}${V.quantized?"_quantized":""}.onnx`,te=await getModelFile(be,H,!0,V);try{return await InferenceSession.create(te,{executionProviders})}catch(ve){if(executionProviders.length===1&&executionProviders[0]==="wasm")throw ve;return console.warn(ve),console.warn("Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. "),await InferenceSession.create(te,{executionProviders:["wasm"]})}}function validateInputs(be,M){const V=Object.create(null),H=[];for(const fe of be.inputNames){const Ee=M[fe];if(!(Ee instanceof Tensor)){H.push(fe);continue}V[fe]=env.wasm.proxy?Ee.clone():Ee}if(H.length>0)throw new Error(`An error occurred during model execution: "Missing the following inputs: ${H.join(", ")}.`);const te=Object.keys(M).length,ve=be.inputNames.length;if(te>ve){let fe=Object.keys(M).filter(Ee=>!be.inputNames.includes(Ee));console.warn(`WARNING: Too many inputs were provided (${te} > ${ve}). The following inputs will be ignored: "${fe.join(", ")}".`)}return V}async function sessionRun(be,M){const V=validateInputs(be,M);try{let H=await be.run(V);return H=replaceTensors(H),H}catch(H){throw console.error(`An error occurred during model execution: "${H}".`),console.error("Inputs given to model:",V),H}}function replaceTensors(be){for(let M in be)be[M]instanceof ONNXTensor?be[M]=new Tensor(be[M]):typeof be[M]=="object"&&replaceTensors(be[M]);return be}function toI64Tensor(be){if(be instanceof Tensor)return be;if(be.length===0)throw Error("items must be non-empty");if(Array.isArray(be[0])){if(be.some(M=>M.length!==be[0].length))throw Error("Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' and/or 'truncation=True' to have batched tensors with the same length.");return new Tensor("int64",BigInt64Array.from(be.flat().map(M=>BigInt(M))),[be.length,be[0].length])}else return new Tensor("int64",BigInt64Array.from(be.map(M=>BigInt(M))),[1,be.length])}function prepareAttentionMask(be,M){let V=be.config.pad_token_id??null,H=be.config.eos_token_id??null;isIntegralNumber(H)&&(H=[H]);let te=M.indexOf(V)!==-1,ve=H===null||!H.includes(V);if(te&&ve){let fe=BigInt64Array.from(M.data.map(Ee=>Ee!=V));return new Tensor("int64",fe,M.dims)}else return ones_like(M)}function preparePositionIds(be,M,V){if(!be.inputNames.includes("position_ids"))return;const H=new BigInt64Array(M.attention_mask.data.length);for(let te=0;te0&&te.push(new NoRepeatNGramLogitsProcessor(M.no_repeat_ngram_size)),M.bad_words_ids!==null&&te.push(new NoBadWordsLogitsProcessor(M.bad_words_ids,M.eos_token_id)),M.min_length!==null&&M.eos_token_id!==null&&M.min_length>0&&te.push(new MinLengthLogitsProcessor(M.min_length,M.eos_token_id)),M.min_new_tokens!==null&&M.eos_token_id!==null&&M.min_new_tokens>0&&te.push(new MinNewTokensLengthLogitsProcessor(V,M.min_new_tokens,M.eos_token_id)),M.forced_bos_token_id!==null&&te.push(new ForcedBOSTokenLogitsProcessor(M.forced_bos_token_id)),M.forced_eos_token_id!==null&&te.push(new ForcedEOSTokenLogitsProcessor(M.max_length,M.forced_eos_token_id)),M.begin_suppress_tokens!==null){let ve=V>1||M.forced_bos_token_id===null?V:V+1;M.forced_decoder_ids!==null&&(ve+=M.forced_decoder_ids[M.forced_decoder_ids.length-1][0]),te.push(new SuppressTokensAtBeginLogitsProcessor(M.begin_suppress_tokens,ve))}return M.forced_decoder_ids!==null&&te.push(new ForceTokensLogitsProcessor(M.forced_decoder_ids)),H!==null&&te.extend(H),te}_get_generation_config(M){let V=new GenerationConfig(this.config);return"generation_config"in this&&Object.assign(V,this.generation_config),M!==null&&Object.assign(V,M),V}async generate(M,V=null,H=null,{inputs_attention_mask:te=null}={}){if(!this.can_generate){let ut=`The current model class (${MODEL_CLASS_TO_NAME_MAPPING.get(this.constructor)}) is not compatible with \`.generate()\`, as it doesn't have a language model head.`;const tt=this.config.model_type,_e=MODEL_WITH_LM_HEAD_MAPPING_NAMES.get(tt)??MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES.get(tt)??MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES.get(tt)??MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES.get(tt);throw _e&&(ut+=` Please use the following class instead: '${_e[0]}'`),Error(ut)}if(!(M instanceof Tensor)&&!isTypedArray(M)&&!Array.isArray(M))throw Error(`\`inputs\` must be a Tensor, TypedArray, or Array, but is "${M.constructor.name}".`);let ve;if(this.config.is_encoder_decoder)ve=0;else if(ve=M instanceof Tensor?M.dims.at(-1):M.length,ve===0)throw Error("Must supply a non-empty array of input token ids.");V=this._get_generation_config(V),H=H??new LogitsProcessorList,H=this._get_logits_processor(V,ve,H);let fe=V.eos_token_id;fe!==null&&!Array.isArray(fe)&&(fe=[fe]);let Ee=1;const Re=Ee+(V.max_new_tokens??1/0),Ce=Number.isInteger(V.max_length)&&(V.max_new_tokens??null)===null;let Me=Sampler.getSampler(V),$=this.getStartBeams(M,V,Ee,te);for(;$.some(He=>!He.done)&&Ee=V.max_length){ut.done=!0,He.push(ut);continue}let tt=await this.runBeam(ut);V.output_attentions&&this.addAttentionsToBeam(ut,tt),V.output_scores;let _e=tt.logits.slice(null,-1,null);H(ut.output_token_ids,_e);let Gt=Me(_e);for(let[Qt,ir]of Gt){let Lr={...ut};this.updateBeam(Lr,Qt),Lr.score+=ir,fe&&fe.includes(Qt)&&(Lr.done=!0),He.push(Lr)}}++Ee,He=this.groupBeams(He).map(ut=>ut.sort((tt,_e)=>_e.score-tt.score).slice(0,V.num_beams)),$=He.flat(),V.callback_function&&V.callback_function($)}const F=this.groupBeams($),he=He=>F.map(ut=>V.num_return_sequences>1?ut.slice(0,V.num_return_sequences).map(tt=>tt[He]):[ut[0][He]]).flat(),we=he("output_token_ids");if(V.return_dict_in_generate){const He=he("decoder_attentions"),ut=he("cross_attentions");return{sequences:we,decoder_attentions:He,cross_attentions:ut}}else return we}addAttentionsToBeam(M,V){if(this.config.is_encoder_decoder){if(!V.cross_attentions||V.cross_attentions.length===0)throw Error("`output_attentions` is true, but the model did not produce cross-attentions. This is most likely because the model was not exported with `output_attentions=True`.");M.cross_attentions||(M.cross_attentions=[]),M.cross_attentions.push(V.cross_attentions)}if(!V.decoder_attentions||V.decoder_attentions.length===0)throw Error("`output_attentions` is true, but the model did not produce decoder-attentions. This is most likely because the model was not exported with `output_attentions=True`.");M.decoder_attentions||(M.decoder_attentions=[]),M.decoder_attentions.push(V.decoder_attentions)}groupBeams(M){const V=Object.create(null);for(const H of M)V[H.id]===void 0?V[H.id]=[H]:V[H.id].push(H);return Object.values(V)}getPastKeyValues(M,V){const H=Object.create(null);for(const te in M)if(te.startsWith("present")){let ve=te.replace("present","past_key_values");V&&te.includes("encoder")?H[ve]=V[ve]:H[ve]=M[te]}return H}getAttentions(M){const V=Object.create(null);for(const H of["cross_attentions","decoder_attentions"]){const te=[];for(const ve in M)if(ve.startsWith(H)){const fe=ve.split(".").pop();te[fe]=M[ve]}V[H]=te}return V}addPastKeyValues(M,V){if(V)Object.assign(M,V);else if(this.config.is_encoder_decoder&&(this.add_encoder_pkv??!0)){let te=[1,this.num_encoder_heads,0,this.encoder_dim_kv],ve=[1,this.num_decoder_heads,0,this.decoder_dim_kv];for(let fe=0;fe{let Me=Array.from({length:this.config.decoder_layers},(ut,tt)=>cat(Ce.map(_e=>_e[tt]),2)),$=stack(V.map(([ut,tt])=>H?Me[ut].slice(null,tt,null,[0,H]):Me[ut].slice(null,tt)));$=$.transpose(1,0,2,3);let[F,he]=std_mean($,-2,0,!0),we=$.clone();for(let ut=0;ut$[tt+1]-$[tt]),we=mergeArrays([1],he).map(ut=>!!ut),He=[];for(let ut=0;utte*ve,1);M.input_labels=new Tensor("int64",new BigInt64Array(H).fill(1n),V)}return await sessionRun(this.prompt_encoder_mask_decoder,{input_points:M.input_points,input_labels:M.input_labels,image_embeddings:M.image_embeddings,image_positional_embeddings:M.image_positional_embeddings})}async _call(M){return new SamImageSegmentationOutput(await super._call(M))}}class SamImageSegmentationOutput extends ModelOutput{constructor({iou_scores:M,pred_masks:V}){super(),this.iou_scores=M,this.pred_masks=V}}class MarianPreTrainedModel extends PreTrainedModel{}class MarianModel extends MarianPreTrainedModel{}class MarianMTModel extends MarianPreTrainedModel{constructor(M,V,H,te){super(M,V),this.decoder_merged_session=H,this.generation_config=te,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class M2M100PreTrainedModel extends PreTrainedModel{}class M2M100Model extends M2M100PreTrainedModel{}class M2M100ForConditionalGeneration extends M2M100PreTrainedModel{constructor(M,V,H,te){super(M,V),this.decoder_merged_session=H,this.generation_config=te,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.d_model/this.num_encoder_heads}}class Wav2Vec2PreTrainedModel extends PreTrainedModel{}class Wav2Vec2Model extends Wav2Vec2PreTrainedModel{}class Wav2Vec2ForCTC extends Wav2Vec2PreTrainedModel{async _call(M){return new CausalLMOutput(await super._call(M))}}class Wav2Vec2ForSequenceClassification extends Wav2Vec2PreTrainedModel{async _call(M){return new SequenceClassifierOutput(await super._call(M))}}class Wav2Vec2ForAudioFrameClassification extends Wav2Vec2PreTrainedModel{async _call(M){return new TokenClassifierOutput(await super._call(M))}}class UniSpeechPreTrainedModel extends PreTrainedModel{}class UniSpeechModel extends UniSpeechPreTrainedModel{}class UniSpeechForCTC extends UniSpeechPreTrainedModel{async _call(M){return new CausalLMOutput(await super._call(M))}}class UniSpeechForSequenceClassification extends UniSpeechPreTrainedModel{async _call(M){return new SequenceClassifierOutput(await super._call(M))}}class UniSpeechSatPreTrainedModel extends PreTrainedModel{}class UniSpeechSatModel extends UniSpeechSatPreTrainedModel{}class UniSpeechSatForCTC extends UniSpeechSatPreTrainedModel{async _call(M){return new CausalLMOutput(await super._call(M))}}class UniSpeechSatForSequenceClassification extends UniSpeechSatPreTrainedModel{async _call(M){return new SequenceClassifierOutput(await super._call(M))}}class UniSpeechSatForAudioFrameClassification extends UniSpeechSatPreTrainedModel{async _call(M){return new TokenClassifierOutput(await super._call(M))}}class Wav2Vec2BertPreTrainedModel extends PreTrainedModel{}class Wav2Vec2BertModel extends Wav2Vec2BertPreTrainedModel{}class Wav2Vec2BertForCTC extends Wav2Vec2BertPreTrainedModel{async _call(M){return new CausalLMOutput(await super._call(M))}}class Wav2Vec2BertForSequenceClassification extends Wav2Vec2BertPreTrainedModel{async _call(M){return new SequenceClassifierOutput(await super._call(M))}}class HubertModel extends Wav2Vec2PreTrainedModel{}class HubertForCTC extends Wav2Vec2PreTrainedModel{async _call(M){return new CausalLMOutput(await super._call(M))}}class HubertForSequenceClassification extends Wav2Vec2PreTrainedModel{async _call(M){return new SequenceClassifierOutput(await super._call(M))}}class WavLMPreTrainedModel extends PreTrainedModel{}class WavLMModel extends WavLMPreTrainedModel{}class WavLMForCTC extends WavLMPreTrainedModel{async _call(M){return new CausalLMOutput(await super._call(M))}}class WavLMForSequenceClassification extends WavLMPreTrainedModel{async _call(M){return new SequenceClassifierOutput(await super._call(M))}}class WavLMForXVector extends WavLMPreTrainedModel{async _call(M){return new XVectorOutput(await super._call(M))}}class WavLMForAudioFrameClassification extends WavLMPreTrainedModel{async _call(M){return new TokenClassifierOutput(await super._call(M))}}class SpeechT5PreTrainedModel extends PreTrainedModel{}class SpeechT5ForSpeechToText extends SpeechT5PreTrainedModel{}class SpeechT5ForTextToSpeech extends SpeechT5PreTrainedModel{constructor(M,V,H,te){super(M,V),this.decoder_merged_session=H,this.generation_config=te,this.num_decoder_layers=this.config.decoder_layers,this.num_decoder_heads=this.config.decoder_attention_heads,this.decoder_dim_kv=this.config.hidden_size/this.num_decoder_heads,this.num_encoder_layers=this.config.encoder_layers,this.num_encoder_heads=this.config.encoder_attention_heads,this.encoder_dim_kv=this.config.hidden_size/this.num_encoder_heads}async generate_speech(M,V,{threshold:H=.5,minlenratio:te=0,maxlenratio:ve=20,vocoder:fe=null}={}){const Ee={input_ids:M},{encoder_outputs:Re,encoder_attention_mask:Ce}=await encoderForward(this,Ee),Me=Re.dims[1]/this.config.reduction_factor,$=Math.floor(Me*ve),F=Math.floor(Me*te),he=this.config.num_mel_bins;let we=[],He=null,ut=null,tt=0;for(;;){++tt;const Qt=boolTensor(!!ut);let ir;ut?ir=ut.output_sequence_out:ir=new Tensor("float32",new Float32Array(he),[1,1,he]);let Lr={use_cache_branch:Qt,output_sequence:ir,encoder_attention_mask:Ce,speaker_embeddings:V,encoder_hidden_states:Re};this.addPastKeyValues(Lr,He),ut=await sessionRun(this.decoder_merged_session,Lr),He=this.getPastKeyValues(ut,He);const{prob:jr,spectrum:tn}=ut;if(we.push(tn),tt>=F&&(Array.from(jr.data).filter(mr=>mr>=H).length>0||tt>=$))break}const _e=cat(we),{waveform:Gt}=await sessionRun(fe.session,{spectrogram:_e});return{spectrogram:_e,waveform:Gt}}}class SpeechT5HifiGan extends PreTrainedModel{main_input_name="spectrogram"}class TrOCRPreTrainedModel extends PreTrainedModel{constructor(M,V,H){super(M,V),this.generation_config=H,this.config.pad_token_id=this.config.eos_token_id,this.num_encoder_layers=this.num_decoder_layers=this.config.decoder_layers,this.num_encoder_heads=this.num_decoder_heads=this.config.decoder_attention_heads,this.encoder_dim_kv=this.decoder_dim_kv=this.config.d_model/this.num_decoder_heads}}class TrOCRForCausalLM extends TrOCRPreTrainedModel{}class MistralPreTrainedModel extends PreTrainedModel{constructor(M,V,H){super(M,V),this.generation_config=H,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class MistralModel extends MistralPreTrainedModel{}class MistralForCausalLM extends MistralPreTrainedModel{}class Starcoder2PreTrainedModel extends PreTrainedModel{constructor(M,V,H){super(M,V),this.generation_config=H,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_key_value_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class Starcoder2Model extends Starcoder2PreTrainedModel{}class Starcoder2ForCausalLM extends Starcoder2PreTrainedModel{}class FalconPreTrainedModel extends PreTrainedModel{constructor(M,V,H){super(M,V),this.generation_config=H,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.config.num_attention_heads}}class FalconModel extends FalconPreTrainedModel{}class FalconForCausalLM extends FalconPreTrainedModel{}class ClapPreTrainedModel extends PreTrainedModel{}class ClapModel extends ClapPreTrainedModel{}class ClapTextModelWithProjection extends ClapPreTrainedModel{static async from_pretrained(M,V={}){return V.model_file_name??="text_model",super.from_pretrained(M,V)}}class ClapAudioModelWithProjection extends ClapPreTrainedModel{static async from_pretrained(M,V={}){return V.model_file_name??="audio_model",super.from_pretrained(M,V)}}class VitsPreTrainedModel extends PreTrainedModel{}class VitsModel extends VitsPreTrainedModel{async _call(M){return new VitsModelOutput(await super._call(M))}}class SegformerPreTrainedModel extends PreTrainedModel{}class SegformerForImageClassification extends SegformerPreTrainedModel{}class SegformerForSemanticSegmentation extends SegformerPreTrainedModel{}class StableLmPreTrainedModel extends PreTrainedModel{constructor(M,V,H){super(M,V),this.generation_config=H,this.config.pad_token_id=this.config.eos_token_id,this.num_heads=this.config.num_attention_heads,this.num_layers=this.config.num_hidden_layers,this.dim_kv=this.config.hidden_size/this.num_heads}}class StableLmForCausalLM extends StableLmPreTrainedModel{}class EfficientNetPreTrainedModel extends PreTrainedModel{}class EfficientNetModel extends EfficientNetPreTrainedModel{}class EfficientNetForImageClassification extends EfficientNetPreTrainedModel{async _call(M){return new SequenceClassifierOutput(await super._call(M))}}class PretrainedMixin{static MODEL_CLASS_MAPPINGS=null;static BASE_IF_FAIL=!1;static async from_pretrained(M,{quantized:V=!0,progress_callback:H=null,config:te=null,cache_dir:ve=null,local_files_only:fe=!1,revision:Ee="main",model_file_name:Re=null}={}){let Ce={quantized:V,progress_callback:H,config:te,cache_dir:ve,local_files_only:fe,revision:Ee,model_file_name:Re};if(te=await AutoConfig.from_pretrained(M,Ce),Ce.config||(Ce.config=te),!this.MODEL_CLASS_MAPPINGS)throw new Error("`MODEL_CLASS_MAPPINGS` not implemented for this type of `AutoClass`: "+this.name);for(let Me of this.MODEL_CLASS_MAPPINGS){const $=Me.get(te.model_type);if($)return await $[1].from_pretrained(M,Ce)}if(this.BASE_IF_FAIL)return console.warn(`Unknown model class "${te.model_type}", attempting to construct from base class.`),await PreTrainedModel.from_pretrained(M,Ce);throw Error(`Unsupported model type: ${te.model_type}`)}}const MODEL_MAPPING_NAMES_ENCODER_ONLY=new Map([["bert",["BertModel",BertModel]],["nomic_bert",["NomicBertModel",NomicBertModel]],["roformer",["RoFormerModel",RoFormerModel]],["electra",["ElectraModel",ElectraModel]],["esm",["EsmModel",EsmModel]],["convbert",["ConvBertModel",ConvBertModel]],["camembert",["CamembertModel",CamembertModel]],["deberta",["DebertaModel",DebertaModel]],["deberta-v2",["DebertaV2Model",DebertaV2Model]],["mpnet",["MPNetModel",MPNetModel]],["albert",["AlbertModel",AlbertModel]],["distilbert",["DistilBertModel",DistilBertModel]],["roberta",["RobertaModel",RobertaModel]],["xlm",["XLMModel",XLMModel]],["xlm-roberta",["XLMRobertaModel",XLMRobertaModel]],["clap",["ClapModel",ClapModel]],["clip",["CLIPModel",CLIPModel]],["clipseg",["CLIPSegModel",CLIPSegModel]],["chinese_clip",["ChineseCLIPModel",ChineseCLIPModel]],["siglip",["SiglipModel",SiglipModel]],["mobilebert",["MobileBertModel",MobileBertModel]],["squeezebert",["SqueezeBertModel",SqueezeBertModel]],["wav2vec2",["Wav2Vec2Model",Wav2Vec2Model]],["wav2vec2-bert",["Wav2Vec2BertModel",Wav2Vec2BertModel]],["unispeech",["UniSpeechModel",UniSpeechModel]],["unispeech-sat",["UniSpeechSatModel",UniSpeechSatModel]],["hubert",["HubertModel",HubertModel]],["wavlm",["WavLMModel",WavLMModel]],["audio-spectrogram-transformer",["ASTModel",ASTModel]],["vits",["VitsModel",VitsModel]],["detr",["DetrModel",DetrModel]],["table-transformer",["TableTransformerModel",TableTransformerModel]],["vit",["ViTModel",ViTModel]],["fastvit",["FastViTModel",FastViTModel]],["mobilevit",["MobileViTModel",MobileViTModel]],["mobilevitv2",["MobileViTV2Model",MobileViTV2Model]],["owlvit",["OwlViTModel",OwlViTModel]],["owlv2",["Owlv2Model",Owlv2Model]],["beit",["BeitModel",BeitModel]],["deit",["DeiTModel",DeiTModel]],["convnext",["ConvNextModel",ConvNextModel]],["convnextv2",["ConvNextV2Model",ConvNextV2Model]],["dinov2",["Dinov2Model",Dinov2Model]],["resnet",["ResNetModel",ResNetModel]],["swin",["SwinModel",SwinModel]],["swin2sr",["Swin2SRModel",Swin2SRModel]],["donut-swin",["DonutSwinModel",DonutSwinModel]],["yolos",["YolosModel",YolosModel]],["dpt",["DPTModel",DPTModel]],["glpn",["GLPNModel",GLPNModel]],["hifigan",["SpeechT5HifiGan",SpeechT5HifiGan]],["efficientnet",["EfficientNetModel",EfficientNetModel]]]),MODEL_MAPPING_NAMES_ENCODER_DECODER=new Map([["t5",["T5Model",T5Model]],["longt5",["LongT5Model",LongT5Model]],["mt5",["MT5Model",MT5Model]],["bart",["BartModel",BartModel]],["mbart",["MBartModel",MBartModel]],["marian",["MarianModel",MarianModel]],["whisper",["WhisperModel",WhisperModel]],["m2m_100",["M2M100Model",M2M100Model]],["blenderbot",["BlenderbotModel",BlenderbotModel]],["blenderbot-small",["BlenderbotSmallModel",BlenderbotSmallModel]]]),MODEL_MAPPING_NAMES_DECODER_ONLY=new Map([["bloom",["BloomModel",BloomModel]],["gpt2",["GPT2Model",GPT2Model]],["gptj",["GPTJModel",GPTJModel]],["gpt_bigcode",["GPTBigCodeModel",GPTBigCodeModel]],["gpt_neo",["GPTNeoModel",GPTNeoModel]],["gpt_neox",["GPTNeoXModel",GPTNeoXModel]],["codegen",["CodeGenModel",CodeGenModel]],["llama",["LlamaModel",LlamaModel]],["qwen2",["Qwen2Model",Qwen2Model]],["phi",["PhiModel",PhiModel]],["mpt",["MptModel",MptModel]],["opt",["OPTModel",OPTModel]],["mistral",["MistralModel",MistralModel]],["starcoder2",["Starcoder2Model",Starcoder2Model]],["falcon",["FalconModel",FalconModel]]]),MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES=new Map([["speecht5",["SpeechT5ForSpeechToText",SpeechT5ForSpeechToText]],["whisper",["WhisperForConditionalGeneration",WhisperForConditionalGeneration]]]),MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES=new Map([["speecht5",["SpeechT5ForTextToSpeech",SpeechT5ForTextToSpeech]]]),MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES=new Map([["vits",["VitsModel",VitsModel]]]),MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES=new Map([["bert",["BertForSequenceClassification",BertForSequenceClassification]],["roformer",["RoFormerForSequenceClassification",RoFormerForSequenceClassification]],["electra",["ElectraForSequenceClassification",ElectraForSequenceClassification]],["esm",["EsmForSequenceClassification",EsmForSequenceClassification]],["convbert",["ConvBertForSequenceClassification",ConvBertForSequenceClassification]],["camembert",["CamembertForSequenceClassification",CamembertForSequenceClassification]],["deberta",["DebertaForSequenceClassification",DebertaForSequenceClassification]],["deberta-v2",["DebertaV2ForSequenceClassification",DebertaV2ForSequenceClassification]],["mpnet",["MPNetForSequenceClassification",MPNetForSequenceClassification]],["albert",["AlbertForSequenceClassification",AlbertForSequenceClassification]],["distilbert",["DistilBertForSequenceClassification",DistilBertForSequenceClassification]],["roberta",["RobertaForSequenceClassification",RobertaForSequenceClassification]],["xlm",["XLMForSequenceClassification",XLMForSequenceClassification]],["xlm-roberta",["XLMRobertaForSequenceClassification",XLMRobertaForSequenceClassification]],["bart",["BartForSequenceClassification",BartForSequenceClassification]],["mbart",["MBartForSequenceClassification",MBartForSequenceClassification]],["mobilebert",["MobileBertForSequenceClassification",MobileBertForSequenceClassification]],["squeezebert",["SqueezeBertForSequenceClassification",SqueezeBertForSequenceClassification]]]),MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES=new Map([["bert",["BertForTokenClassification",BertForTokenClassification]],["roformer",["RoFormerForTokenClassification",RoFormerForTokenClassification]],["electra",["ElectraForTokenClassification",ElectraForTokenClassification]],["esm",["EsmForTokenClassification",EsmForTokenClassification]],["convbert",["ConvBertForTokenClassification",ConvBertForTokenClassification]],["camembert",["CamembertForTokenClassification",CamembertForTokenClassification]],["deberta",["DebertaForTokenClassification",DebertaForTokenClassification]],["deberta-v2",["DebertaV2ForTokenClassification",DebertaV2ForTokenClassification]],["mpnet",["MPNetForTokenClassification",MPNetForTokenClassification]],["distilbert",["DistilBertForTokenClassification",DistilBertForTokenClassification]],["roberta",["RobertaForTokenClassification",RobertaForTokenClassification]],["xlm",["XLMForTokenClassification",XLMForTokenClassification]],["xlm-roberta",["XLMRobertaForTokenClassification",XLMRobertaForTokenClassification]]]),MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES=new Map([["t5",["T5ForConditionalGeneration",T5ForConditionalGeneration]],["longt5",["LongT5ForConditionalGeneration",LongT5ForConditionalGeneration]],["mt5",["MT5ForConditionalGeneration",MT5ForConditionalGeneration]],["bart",["BartForConditionalGeneration",BartForConditionalGeneration]],["mbart",["MBartForConditionalGeneration",MBartForConditionalGeneration]],["marian",["MarianMTModel",MarianMTModel]],["m2m_100",["M2M100ForConditionalGeneration",M2M100ForConditionalGeneration]],["blenderbot",["BlenderbotForConditionalGeneration",BlenderbotForConditionalGeneration]],["blenderbot-small",["BlenderbotSmallForConditionalGeneration",BlenderbotSmallForConditionalGeneration]]]),MODEL_WITH_LM_HEAD_MAPPING_NAMES=new Map([["bloom",["BloomForCausalLM",BloomForCausalLM]],["gpt2",["GPT2LMHeadModel",GPT2LMHeadModel]],["gptj",["GPTJForCausalLM",GPTJForCausalLM]],["gpt_bigcode",["GPTBigCodeForCausalLM",GPTBigCodeForCausalLM]],["gpt_neo",["GPTNeoForCausalLM",GPTNeoForCausalLM]],["gpt_neox",["GPTNeoXForCausalLM",GPTNeoXForCausalLM]],["codegen",["CodeGenForCausalLM",CodeGenForCausalLM]],["llama",["LlamaForCausalLM",LlamaForCausalLM]],["qwen2",["Qwen2ForCausalLM",Qwen2ForCausalLM]],["phi",["PhiForCausalLM",PhiForCausalLM]],["mpt",["MptForCausalLM",MptForCausalLM]],["opt",["OPTForCausalLM",OPTForCausalLM]],["mbart",["MBartForCausalLM",MBartForCausalLM]],["mistral",["MistralForCausalLM",MistralForCausalLM]],["starcoder2",["Starcoder2ForCausalLM",Starcoder2ForCausalLM]],["falcon",["FalconForCausalLM",FalconForCausalLM]],["trocr",["TrOCRForCausalLM",TrOCRForCausalLM]],["stablelm",["StableLmForCausalLM",StableLmForCausalLM]]]),MODEL_FOR_MASKED_LM_MAPPING_NAMES=new Map([["bert",["BertForMaskedLM",BertForMaskedLM]],["roformer",["RoFormerForMaskedLM",RoFormerForMaskedLM]],["electra",["ElectraForMaskedLM",ElectraForMaskedLM]],["esm",["EsmForMaskedLM",EsmForMaskedLM]],["convbert",["ConvBertForMaskedLM",ConvBertForMaskedLM]],["camembert",["CamembertForMaskedLM",CamembertForMaskedLM]],["deberta",["DebertaForMaskedLM",DebertaForMaskedLM]],["deberta-v2",["DebertaV2ForMaskedLM",DebertaV2ForMaskedLM]],["mpnet",["MPNetForMaskedLM",MPNetForMaskedLM]],["albert",["AlbertForMaskedLM",AlbertForMaskedLM]],["distilbert",["DistilBertForMaskedLM",DistilBertForMaskedLM]],["roberta",["RobertaForMaskedLM",RobertaForMaskedLM]],["xlm",["XLMWithLMHeadModel",XLMWithLMHeadModel]],["xlm-roberta",["XLMRobertaForMaskedLM",XLMRobertaForMaskedLM]],["mobilebert",["MobileBertForMaskedLM",MobileBertForMaskedLM]],["squeezebert",["SqueezeBertForMaskedLM",SqueezeBertForMaskedLM]]]),MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES=new Map([["bert",["BertForQuestionAnswering",BertForQuestionAnswering]],["roformer",["RoFormerForQuestionAnswering",RoFormerForQuestionAnswering]],["electra",["ElectraForQuestionAnswering",ElectraForQuestionAnswering]],["convbert",["ConvBertForQuestionAnswering",ConvBertForQuestionAnswering]],["camembert",["CamembertForQuestionAnswering",CamembertForQuestionAnswering]],["deberta",["DebertaForQuestionAnswering",DebertaForQuestionAnswering]],["deberta-v2",["DebertaV2ForQuestionAnswering",DebertaV2ForQuestionAnswering]],["mpnet",["MPNetForQuestionAnswering",MPNetForQuestionAnswering]],["albert",["AlbertForQuestionAnswering",AlbertForQuestionAnswering]],["distilbert",["DistilBertForQuestionAnswering",DistilBertForQuestionAnswering]],["roberta",["RobertaForQuestionAnswering",RobertaForQuestionAnswering]],["xlm",["XLMForQuestionAnswering",XLMForQuestionAnswering]],["xlm-roberta",["XLMRobertaForQuestionAnswering",XLMRobertaForQuestionAnswering]],["mobilebert",["MobileBertForQuestionAnswering",MobileBertForQuestionAnswering]],["squeezebert",["SqueezeBertForQuestionAnswering",SqueezeBertForQuestionAnswering]]]),MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",VisionEncoderDecoderModel]]]),MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES=new Map([["vision-encoder-decoder",["VisionEncoderDecoderModel",VisionEncoderDecoderModel]]]),MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES=new Map([["vit",["ViTForImageClassification",ViTForImageClassification]],["fastvit",["FastViTForImageClassification",FastViTForImageClassification]],["mobilevit",["MobileViTForImageClassification",MobileViTForImageClassification]],["mobilevitv2",["MobileViTV2ForImageClassification",MobileViTV2ForImageClassification]],["beit",["BeitForImageClassification",BeitForImageClassification]],["deit",["DeiTForImageClassification",DeiTForImageClassification]],["convnext",["ConvNextForImageClassification",ConvNextForImageClassification]],["convnextv2",["ConvNextV2ForImageClassification",ConvNextV2ForImageClassification]],["dinov2",["Dinov2ForImageClassification",Dinov2ForImageClassification]],["resnet",["ResNetForImageClassification",ResNetForImageClassification]],["swin",["SwinForImageClassification",SwinForImageClassification]],["segformer",["SegformerForImageClassification",SegformerForImageClassification]],["efficientnet",["EfficientNetForImageClassification",EfficientNetForImageClassification]]]),MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES=new Map([["detr",["DetrForObjectDetection",DetrForObjectDetection]],["table-transformer",["TableTransformerForObjectDetection",TableTransformerForObjectDetection]],["yolos",["YolosForObjectDetection",YolosForObjectDetection]]]),MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES=new Map([["owlvit",["OwlViTForObjectDetection",OwlViTForObjectDetection]],["owlv2",["Owlv2ForObjectDetection",Owlv2ForObjectDetection]]]),MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES=new Map([["detr",["DetrForSegmentation",DetrForSegmentation]],["clipseg",["CLIPSegForImageSegmentation",CLIPSegForImageSegmentation]]]),MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES=new Map([["segformer",["SegformerForSemanticSegmentation",SegformerForSemanticSegmentation]]]),MODEL_FOR_MASK_GENERATION_MAPPING_NAMES=new Map([["sam",["SamModel",SamModel]]]),MODEL_FOR_CTC_MAPPING_NAMES=new Map([["wav2vec2",["Wav2Vec2ForCTC",Wav2Vec2ForCTC]],["wav2vec2-bert",["Wav2Vec2BertForCTC",Wav2Vec2BertForCTC]],["unispeech",["UniSpeechForCTC",UniSpeechForCTC]],["unispeech-sat",["UniSpeechSatForCTC",UniSpeechSatForCTC]],["wavlm",["WavLMForCTC",WavLMForCTC]],["hubert",["HubertForCTC",HubertForCTC]]]),MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES=new Map([["wav2vec2",["Wav2Vec2ForSequenceClassification",Wav2Vec2ForSequenceClassification]],["wav2vec2-bert",["Wav2Vec2BertForSequenceClassification",Wav2Vec2BertForSequenceClassification]],["unispeech",["UniSpeechForSequenceClassification",UniSpeechForSequenceClassification]],["unispeech-sat",["UniSpeechSatForSequenceClassification",UniSpeechSatForSequenceClassification]],["wavlm",["WavLMForSequenceClassification",WavLMForSequenceClassification]],["hubert",["HubertForSequenceClassification",HubertForSequenceClassification]],["audio-spectrogram-transformer",["ASTForAudioClassification",ASTForAudioClassification]]]),MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES=new Map([["wavlm",["WavLMForXVector",WavLMForXVector]]]),MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES=new Map([["unispeech-sat",["UniSpeechSatForAudioFrameClassification",UniSpeechSatForAudioFrameClassification]],["wavlm",["WavLMForAudioFrameClassification",WavLMForAudioFrameClassification]],["wav2vec2",["Wav2Vec2ForAudioFrameClassification",Wav2Vec2ForAudioFrameClassification]]]),MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES=new Map([["vitmatte",["VitMatteForImageMatting",VitMatteForImageMatting]]]),MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES=new Map([["swin2sr",["Swin2SRForImageSuperResolution",Swin2SRForImageSuperResolution]]]),MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES=new Map([["dpt",["DPTForDepthEstimation",DPTForDepthEstimation]],["depth_anything",["DepthAnythingForDepthEstimation",DepthAnythingForDepthEstimation]],["glpn",["GLPNForDepthEstimation",GLPNForDepthEstimation]]]),MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES=new Map([["clip",["CLIPVisionModelWithProjection",CLIPVisionModelWithProjection]],["siglip",["SiglipVisionModel",SiglipVisionModel]]]),MODEL_CLASS_TYPE_MAPPING=[[MODEL_MAPPING_NAMES_ENCODER_ONLY,MODEL_TYPES.EncoderOnly],[MODEL_MAPPING_NAMES_ENCODER_DECODER,MODEL_TYPES.EncoderDecoder],[MODEL_MAPPING_NAMES_DECODER_ONLY,MODEL_TYPES.DecoderOnly],[MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES,MODEL_TYPES.Seq2Seq],[MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES,MODEL_TYPES.Seq2Seq],[MODEL_WITH_LM_HEAD_MAPPING_NAMES,MODEL_TYPES.DecoderOnly],[MODEL_FOR_MASKED_LM_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES,MODEL_TYPES.Vision2Seq],[MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_IMAGE_MATTING_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_MASK_GENERATION_MAPPING_NAMES,MODEL_TYPES.MaskGeneration],[MODEL_FOR_CTC_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES,MODEL_TYPES.Seq2Seq],[MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_AUDIO_XVECTOR_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_AUDIO_FRAME_CLASSIFICATION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly],[MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES,MODEL_TYPES.EncoderOnly]];for(const[be,M]of MODEL_CLASS_TYPE_MAPPING)for(const[V,H]of be.values())MODEL_TYPE_MAPPING.set(V,M),MODEL_CLASS_TO_NAME_MAPPING.set(H,V),MODEL_NAME_TO_CLASS_MAPPING.set(V,H);const CUSTOM_MAPPING=[["CLIPTextModelWithProjection",CLIPTextModelWithProjection,MODEL_TYPES.EncoderOnly],["SiglipTextModel",SiglipTextModel,MODEL_TYPES.EncoderOnly],["ClapTextModelWithProjection",ClapTextModelWithProjection,MODEL_TYPES.EncoderOnly],["ClapAudioModelWithProjection",ClapAudioModelWithProjection,MODEL_TYPES.EncoderOnly]];for(const[be,M,V]of CUSTOM_MAPPING)MODEL_TYPE_MAPPING.set(be,V),MODEL_CLASS_TO_NAME_MAPPING.set(M,be),MODEL_NAME_TO_CLASS_MAPPING.set(be,M);class AutoModel extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=MODEL_CLASS_TYPE_MAPPING.map(M=>M[0]);static BASE_IF_FAIL=!0}class AutoModelForSequenceClassification extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING_NAMES]}class AutoModelForTokenClassification extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING_NAMES]}class AutoModelForSeq2SeqLM extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES]}class AutoModelForSpeechSeq2Seq extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING_NAMES]}class AutoModelForTextToSpectrogram extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_TEXT_TO_SPECTROGRAM_MAPPING_NAMES]}class AutoModelForTextToWaveform extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_TEXT_TO_WAVEFORM_MAPPING_NAMES]}class AutoModelForCausalLM extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_WITH_LM_HEAD_MAPPING_NAMES]}class AutoModelForMaskedLM extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_MASKED_LM_MAPPING_NAMES]}class AutoModelForQuestionAnswering extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_QUESTION_ANSWERING_MAPPING_NAMES]}class AutoModelForVision2Seq extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_VISION_2_SEQ_MAPPING_NAMES]}class AutoModelForImageClassification extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING_NAMES]}class AutoModelForImageSegmentation extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_IMAGE_SEGMENTATION_MAPPING_NAMES]}class AutoModelForSemanticSegmentation extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING_NAMES]}class AutoModelForObjectDetection extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_OBJECT_DETECTION_MAPPING_NAMES]}class AutoModelForZeroShotObjectDetection extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_ZERO_SHOT_OBJECT_DETECTION_MAPPING_NAMES]}class AutoModelForCTC extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_CTC_MAPPING_NAMES]}class AutoModelForAudioClassification extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING_NAMES]}class AutoModelForDocumentQuestionAnswering extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_DOCUMENT_QUESTION_ANSWERING_MAPPING_NAMES]}class AutoModelForImageToImage extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_IMAGE_TO_IMAGE_MAPPING_NAMES]}class AutoModelForDepthEstimation extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_DEPTH_ESTIMATION_MAPPING_NAMES]}class AutoModelForImageFeatureExtraction extends PretrainedMixin{static MODEL_CLASS_MAPPINGS=[MODEL_FOR_IMAGE_FEATURE_EXTRACTION_MAPPING_NAMES]}class Seq2SeqLMOutput extends ModelOutput{constructor({logits:M,past_key_values:V,encoder_outputs:H,decoder_attentions:te=null,cross_attentions:ve=null}){super(),this.logits=M,this.past_key_values=V,this.encoder_outputs=H,this.decoder_attentions=te,this.cross_attentions=ve}}class SequenceClassifierOutput extends ModelOutput{constructor({logits:M}){super(),this.logits=M}}class XVectorOutput extends ModelOutput{constructor({logits:M,embeddings:V}){super(),this.logits=M,this.embeddings=V}}class TokenClassifierOutput extends ModelOutput{constructor({logits:M}){super(),this.logits=M}}class MaskedLMOutput extends ModelOutput{constructor({logits:M}){super(),this.logits=M}}class QuestionAnsweringModelOutput extends ModelOutput{constructor({start_logits:M,end_logits:V}){super(),this.start_logits=M,this.end_logits=V}}class CausalLMOutput extends ModelOutput{constructor({logits:M}){super(),this.logits=M}}class ImageMattingOutput extends ModelOutput{constructor({alphas:M}){super(),this.alphas=M}}class VitsModelOutput extends ModelOutput{constructor({waveform:M,spectrogram:V}){super(),this.waveform=M,this.spectrogram=V}}const BROWSER_ENV=typeof self<"u",WEBWORKER_ENV=BROWSER_ENV&&self.constructor.name==="DedicatedWorkerGlobalScope";let createCanvasFunction,ImageDataClass,loadImageFunction;if(BROWSER_ENV)createCanvasFunction=(be,M)=>{if(!self.OffscreenCanvas)throw new Error("OffscreenCanvas not supported by this browser.");return new self.OffscreenCanvas(be,M)},loadImageFunction=self.createImageBitmap,ImageDataClass=self.ImageData;else if(sharp)loadImageFunction=async be=>{const V=(await be.metadata()).channels;let{data:H,info:te}=await be.rotate().raw().toBuffer({resolveWithObject:!0});const ve=new RawImage(new Uint8ClampedArray(H),te.width,te.height,te.channels);return V!==void 0&&V!==te.channels&&ve.convert(V),ve};else throw new Error("Unable to load image processing library.");const RESAMPLING_MAPPING={0:"nearest",1:"lanczos",2:"bilinear",3:"bicubic",4:"box",5:"hamming"},CONTENT_TYPE_MAP=new Map([["png","image/png"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["gif","image/gif"]]);class RawImage{constructor(M,V,H,te){this.data=M,this.width=V,this.height=H,this.channels=te}get size(){return[this.width,this.height]}static async read(M){if(M instanceof RawImage)return M;if(typeof M=="string"||M instanceof URL)return await this.fromURL(M);throw new Error(`Unsupported input type: ${typeof M}`)}static async fromURL(M){let V=await getFile(M);if(V.status!==200)throw new Error(`Unable to read image from "${M}" (${V.status} ${V.statusText})`);let H=await V.blob();return this.fromBlob(H)}static async fromBlob(M){if(BROWSER_ENV){let V=await loadImageFunction(M);const H=createCanvasFunction(V.width,V.height).getContext("2d");return H.drawImage(V,0,0),new this(H.getImageData(0,0,V.width,V.height).data,V.width,V.height,4)}else{let V=sharp(await M.arrayBuffer());return await loadImageFunction(V)}}static fromTensor(M,V="CHW"){if(M.dims.length!==3)throw new Error(`Tensor should have 3 dimensions, but has ${M.dims.length} dimensions.`);if(V==="CHW")M=M.transpose(1,2,0);else if(V!=="HWC")throw new Error(`Unsupported channel format: ${V}`);if(!(M.data instanceof Uint8ClampedArray||M.data instanceof Uint8Array))throw new Error(`Unsupported tensor type: ${M.type}`);switch(M.dims[2]){case 1:case 2:case 3:case 4:return new RawImage(M.data,M.dims[1],M.dims[0],M.dims[2]);default:throw new Error(`Unsupported number of channels: ${M.dims[2]}`)}}grayscale(){if(this.channels===1)return this;let M=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let V=0,H=0;V=0?Re=H:Me=-H,te>=0?Ce=te:$=-te,Ee.drawImage(fe,Re,Ce,M,V,Me,$,M,V),new RawImage(Ee.getImageData(0,0,M,V).data,M,V,4).convert(ve)}else{let ve=this.toSharp();if(H>=0&&te>=0)ve=ve.extract({left:Math.floor(H),top:Math.floor(te),width:M,height:V});else if(H<=0&&te<=0){let fe=Math.floor(-te),Ee=Math.floor(-H);ve=ve.extend({top:fe,left:Ee,right:M-this.width-Ee,bottom:V-this.height-fe})}else{let fe=[0,0],Ee=0;te<0?(fe[0]=Math.floor(-te),fe[1]=V-this.height-fe[0]):Ee=Math.floor(te);let Re=[0,0],Ce=0;H<0?(Re[0]=Math.floor(-H),Re[1]=M-this.width-Re[0]):Ce=Math.floor(H),ve=ve.extend({top:fe[0],bottom:fe[1],left:Re[0],right:Re[1]}).extract({left:Ce,top:Ee,width:M,height:V})}return await loadImageFunction(ve)}}async toBlob(M="image/png",V=1){if(!BROWSER_ENV)throw new Error("toBlob() is only supported in browser environments.");return await this.toCanvas().convertToBlob({type:M,quality:V})}toTensor(M="CHW"){let V=new Tensor("uint8",new Uint8Array(this.data),[this.height,this.width,this.channels]);if(M!=="HWC")if(M==="CHW")V=V.permute(2,0,1);else throw new Error(`Unsupported channel format: ${M}`);return V}toCanvas(){if(!BROWSER_ENV)throw new Error("toCanvas() is only supported in browser environments.");let M=this.clone().rgba(),V=createCanvasFunction(M.width,M.height),H=new ImageDataClass(M.data,M.width,M.height);return V.getContext("2d").putImageData(H,0,0),V}_update(M,V,H,te=null){return this.data=M,this.width=V,this.height=H,te!==null&&(this.channels=te),this}clone(){return new RawImage(this.data.slice(),this.width,this.height,this.channels)}convert(M){if(this.channels===M)return this;switch(M){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw new Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(M){if(BROWSER_ENV){if(WEBWORKER_ENV)throw new Error("Unable to save an image from a Web Worker.");const V=M.split(".").pop().toLowerCase(),H=CONTENT_TYPE_MAP.get(V)??"image/png",te=await this.toBlob(H),ve=URL.createObjectURL(te),fe=document.createElement("a");fe.href=ve,fe.download=M,fe.click(),fe.remove()}else{if(env$1.useFS)return await this.toSharp().toFile(M);throw new Error("Unable to save the image because filesystem is disabled in this environment.")}}toSharp(){if(BROWSER_ENV)throw new Error("toSharp() is only supported in server-side environments.");return sharp(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}async function read_audio(be,M){if(typeof AudioContext>"u")throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");const V=await(await getFile(be)).arrayBuffer(),H=new AudioContext({sampleRate:M});typeof M>"u"&&console.warn(`No sampling rate provided, using default of ${H.sampleRate}Hz.`);const te=await H.decodeAudioData(V);let ve;if(te.numberOfChannels===2){const fe=Math.sqrt(2),Ee=te.getChannelData(0),Re=te.getChannelData(1);ve=new Float32Array(Ee.length);for(let Ce=0;Ce2595*Math.log10(1+be/700),kaldi:be=>1127*Math.log(1+be/700),slaney:(be,M=1e3,V=15,H=27/Math.log(6.4))=>be>=M?V+Math.log(be/M)*H:3*be/200};function hertz_to_mel(be,M="htk"){const V=HERTZ_TO_MEL_MAPPING[M];if(!V)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof be=="number"?V(be):be.map(H=>V(H))}const MEL_TO_HERTZ_MAPPING={htk:be=>700*(10**(be/2595)-1),kaldi:be=>700*(Math.exp(be/1127)-1),slaney:(be,M=1e3,V=15,H=Math.log(6.4)/27)=>be>=V?M*Math.exp(H*(be-V)):200*be/3};function mel_to_hertz(be,M="htk"){const V=MEL_TO_HERTZ_MAPPING[M];if(!V)throw new Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return typeof be=="number"?V(be):be.map(H=>V(H))}function _create_triangular_filter_bank(be,M){const V=Float64Array.from({length:M.length-1},(fe,Ee)=>M[Ee+1]-M[Ee]),H=Array.from({length:be.length},()=>new Array(M.length));for(let fe=0;fenew Array(be.length));for(let fe=0;febe+H*ve)}function mel_filter_bank(be,M,V,H,te,ve=null,fe="htk",Ee=!1){if(ve!==null&&ve!=="slaney")throw new Error('norm must be one of null or "slaney"');const Re=hertz_to_mel(V,fe),Ce=hertz_to_mel(H,fe),Me=linspace(Re,Ce,M+2);let $=mel_to_hertz(Me,fe),F;if(Ee){const we=te/(be*2);F=hertz_to_mel(Float64Array.from({length:be},(He,ut)=>ut*we),fe),$=Me}else F=linspace(0,Math.floor(te/2),be);const he=_create_triangular_filter_bank(F,$);if(ve!==null&&ve==="slaney")for(let we=0;wete)throw Error(`frame_length (${V}) may not be larger than fft_length (${te})`);if(Qt!==V)throw new Error(`Length of the window (${Qt}) must equal frame_length (${V})`);if(H<=0)throw new Error("hop_length must be greater than zero");if(ve===null&&Me!==null)throw new Error("You have provided `mel_filters` but `power` is `None`. Mel spectrogram computation is not yet supported for complex-valued spectrogram. Specify `power` to fix this issue.");if(fe){if(Ee!=="reflect")throw new Error(`pad_mode="${Ee}" not implemented yet.`);const Un=Math.floor((te-1)/2)+1;be=padReflect(be,Un,Un)}const ir=Math.floor(1+Math.floor((be.length-V)/H)),Lr=Re?Math.floor(te/2)+1:te;let jr=ir,tn=ir;tt!==null&&(tt>ir?_e&&(tn=tt):tn=jr=tt);const mr=new FFT(te),Ir=new Float64Array(te),On=new Float64Array(mr.outputBufferSize),ba=new Array(jr);for(let Un=0;Un=1;--ji)Ir[ji]-=Ce*Ir[ji-1];Ir[0]*=1-Ce}for(let ji=0;jiMath.pow(Ee,.85));break;default:throw new Error(`Unknown window type ${M}.`)}if(V&&(fe=fe.subarray(0,be)),H===null)return fe;if(be>H)throw new Error(`Length of the window (${be}) may not be larger than frame_length (${H})`);return fe}function center_to_corners_format([be,M,V,H]){return[be-V/2,M-H/2,be+V/2,M+H/2]}function post_process_object_detection(be,M=.5,V=null,H=!1){const te=be.logits,ve=be.pred_boxes,[fe,Ee,Re]=te.dims;if(V!==null&&V.length!==fe)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");let Ce=[];for(let Me=0;MeM&&tt.push(Gt)}else{let Gt=max$1(ut.data)[1];if(Gt===Re-1)continue;tt.push(Gt),_e=softmax(ut.data)}for(const Gt of tt){let Qt=we[He].data;Qt=center_to_corners_format(Qt),$!==null&&(Qt=Qt.map((ir,Lr)=>ir*$[(Lr+1)%2])),F.boxes.push(Qt),F.classes.push(Gt),F.scores.push(_e[Gt])}}Ce.push(F)}return Ce}function validate_audio_inputs(be,M){if(!(be instanceof Float32Array||be instanceof Float64Array))throw new Error(`${M} expects input to be a Float32Array or a Float64Array, but got ${be?.constructor?.name??typeof be} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}function constraint_to_multiple_of(be,M,V=0,H=null){const te=be/M;let ve=bankers_round(te)*M;return H!==null&&ve>H&&(ve=Math.floor(te)*M),veve?Ce=Math.floor(ve*Re/te):ve>te&&(Re=Math.floor(te*Ce/ve)),await M.resize(Ce,Re,{resample:H}))}async crop_margin(M,V=200){const H=M.clone().grayscale(),te=min$1(H.data)[0],fe=max$1(H.data)[0]-te;if(fe===0)return M;const Ee=V/255;let Re=H.width,Ce=H.height,Me=0,$=0;for(let F=0;Fthis.preprocess(ve)));return{pixel_values:stack(H.map(ve=>ve.pixel_values),0),original_sizes:H.map(ve=>ve.original_size),reshaped_input_sizes:H.map(ve=>ve.reshaped_input_size)}}}class SegformerFeatureExtractor extends ImageFeatureExtractor{post_process_semantic_segmentation(M,V=null){const H=M.logits,te=H.dims[0];if(V!==null&&V.length!==te)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");const ve=[];for(let fe=0;feF[_e]&&(F[_e]=tt[_e],$.data[_e]=ut)}const he=new Array(Re.dims[0]),we=$.data;for(let ut=0;utut!==void 0);ve.push({segmentation:$,labels:He})}return ve}}class DPTFeatureExtractor extends ImageFeatureExtractor{}class DPTImageProcessor extends DPTFeatureExtractor{}class BitImageProcessor extends ImageFeatureExtractor{}class GLPNFeatureExtractor extends ImageFeatureExtractor{}class CLIPFeatureExtractor extends ImageFeatureExtractor{}class ChineseCLIPFeatureExtractor extends ImageFeatureExtractor{}class SiglipImageProcessor extends ImageFeatureExtractor{}class ConvNextFeatureExtractor extends ImageFeatureExtractor{constructor(M){super(M),this.crop_pct=this.config.crop_pct??224/256}async resize(M){const V=this.size?.shortest_edge;if(V===void 0)throw new Error("Size dictionary must contain 'shortest_edge' key.");if(V<384){const H=Math.floor(V/this.crop_pct),[te,ve]=this.get_resize_output_image_size(M,{shortest_edge:H});M=await M.resize(te,ve,{resample:this.resample}),M=await M.center_crop(V,V)}else M=await M.resize(V,V,{resample:this.resample});return M}}class ConvNextImageProcessor extends ConvNextFeatureExtractor{}class ViTFeatureExtractor extends ImageFeatureExtractor{}class ViTImageProcessor extends ImageFeatureExtractor{}class EfficientNetImageProcessor extends ImageFeatureExtractor{constructor(M){super(M),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(V=>V*V))}}class MobileViTFeatureExtractor extends ImageFeatureExtractor{}class MobileViTImageProcessor extends MobileViTFeatureExtractor{}class OwlViTFeatureExtractor extends ImageFeatureExtractor{post_process_object_detection(...M){return post_process_object_detection(...M)}}class Owlv2ImageProcessor extends OwlViTFeatureExtractor{}class DeiTFeatureExtractor extends ImageFeatureExtractor{}class BeitFeatureExtractor extends ImageFeatureExtractor{}class DonutFeatureExtractor extends ImageFeatureExtractor{pad_image(M,V,H,te={}){const[ve,fe,Ee]=V;let Re=this.image_mean;Array.isArray(this.image_mean)||(Re=new Array(Ee).fill(Re));let Ce=this.image_std;Array.isArray(Ce)||(Ce=new Array(Ee).fill(Re));const Me=Re.map(($,F)=>-$/Ce[F]);return super.pad_image(M,V,H,{center:!0,constant_values:Me,...te})}}class NougatImageProcessor extends DonutFeatureExtractor{}class DetrFeatureExtractor extends ImageFeatureExtractor{async _call(M){const V=await super._call(M),H=[V.pixel_values.dims[0],64,64],te=new Tensor("int64",new BigInt64Array(H.reduce((ve,fe)=>ve*fe)).fill(1n),H);return{...V,pixel_mask:te}}post_process_object_detection(...M){return post_process_object_detection(...M)}remove_low_and_no_objects(M,V,H,te){let ve=[],fe=[],Ee=[];for(let Re=0;ReH&&(ve.push(Me),fe.push(he),Ee.push($))}return[ve,fe,Ee]}check_segment_validity(M,V,H,te=.5,ve=.8){let fe=[],Ee=0,Re=0;for(let Me=0;Me=te&&++Re;let Ce=Ee>0&&Re>0;return Ce&&(Ce=Ee/Re>ve),[Ce,fe]}compute_segments(M,V,H,te,ve,fe=null,Ee=null){let[Re,Ce]=Ee??M[0].dims,Me=new Tensor("int32",new Int32Array(Re*Ce),[Re,Ce]),$=[];if(Ee!==null)for(let He=0;Hehe[tt]&&(F[tt]=He,he[tt]=M[He].data[tt])}let we=0;for(let He=0;Hete!==V.dims[ve]))throw Error(`The first ${H.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new Tensor("int64",M.flat(1/0).map(BigInt),H)}async _call(M,V=null,H=null){const te=await super._call(M);if(V&&(te.input_points=this.reshape_input_points(V,te.original_sizes,te.reshaped_input_sizes)),H){if(!te.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");te.input_labels=this.add_input_labels(H,te.input_points)}return te}post_process_masks(M,V,H,{mask_threshold:te=0,binarize:ve=!0,pad_size:fe=null}={}){const Ee=[];fe=fe??this.pad_size;const Re=[fe.height,fe.width];for(let Ce=0;Cete&&(tt[_e]=1);ut=new Tensor("bool",tt,ut.dims)}he.push(ut)}Ee.push(stack(he))}return Ee}}class Swin2SRImageProcessor extends ImageFeatureExtractor{pad_image(M,V,H,te={}){const[ve,fe,Ee]=V;return super.pad_image(M,V,{width:fe+(H-fe%H)%H,height:ve+(H-ve%H)%H},{mode:"symmetric",center:!1,constant_values:-1,...te})}}class VitMatteImageProcessor extends ImageFeatureExtractor{async _call(M,V){Array.isArray(M)||(M=[M]),Array.isArray(V)||(V=[V]);const H=await Promise.all(M.map(fe=>this.preprocess(fe))),te=await Promise.all(V.map(fe=>this.preprocess(fe,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:stack(H.map((fe,Ee)=>cat([fe.pixel_values,te[Ee].pixel_values],0)),0),original_sizes:H.map(fe=>fe.original_size),reshaped_input_sizes:H.map(fe=>fe.reshaped_input_size)}}}class WhisperFeatureExtractor extends FeatureExtractor{constructor(M){super(M),this.config.mel_filters??=mel_filter_bank(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,"slaney","slaney"),this.window=window_function(this.config.n_fft,"hann")}_extract_fbank_features(M){const{data:V,dims:H}=spectrogram(M,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:"log10",max_num_frames:this.config.nb_max_frames}),te=max$1(V)[0];for(let ve=0;vethis.config.n_samples?(console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),V=M.slice(0,this.config.n_samples)):(V=new Float32Array(this.config.n_samples),V.set(M));const{data:H,dims:te}=this._extract_fbank_features(V);return{input_features:new Tensor("float32",H,[1,...te])}}}class Wav2Vec2FeatureExtractor extends FeatureExtractor{_zero_mean_unit_var_norm(M){const H=M.reduce((ve,fe)=>ve+fe,0)/M.length,te=M.reduce((ve,fe)=>ve+(fe-H)**2,0)/M.length;return M.map(ve=>(ve-H)/Math.sqrt(te+1e-7))}async _call(M){validate_audio_inputs(M,"Wav2Vec2FeatureExtractor"),M instanceof Float64Array&&(M=new Float32Array(M));let V=M;this.config.do_normalize&&(V=this._zero_mean_unit_var_norm(V));const H=[1,V.length];return{input_values:new Tensor("float32",V,H),attention_mask:new Tensor("int64",new BigInt64Array(V.length).fill(1n),H)}}}class SeamlessM4TFeatureExtractor extends FeatureExtractor{constructor(M){super(M);const V=this.config.sampling_rate,H=mel_filter_bank(256,this.config.num_mel_bins,20,Math.floor(V/2),V,null,"kaldi",!0);for(let te=0;teH*32768),spectrogram(M,this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:V,transpose:!0})}async _call(M,{padding:V=!0,pad_to_multiple_of:H=2,do_normalize_per_mel_bins:te=!0,return_attention_mask:ve=!0}={}){validate_audio_inputs(M,"SeamlessM4TFeatureExtractor");let fe=this._extract_fbank_features(M,this.config.max_length);if(te){const[we,He]=fe.dims;for(let ut=0;ut0){const tt=new Float32Array(He*(we+ut));tt.set(fe.data),tt.fill(this.config.padding_value,fe.data.length);const _e=we+ut;fe={data:tt,dims:[_e,He]},ve&&(Ee=new Tensor("int64",new BigInt64Array(_e),[1,_e]),Ee.data.fill(1n,0,we))}}const[Re,Ce]=fe.dims,Me=this.config.stride;if(Re%Me!==0)throw new Error(`The number of frames (${Re}) must be a multiple of the stride (${Me}).`);const F=new Tensor("float32",fe.data,fe.dims).view(1,Math.floor(Re/Me),Ce*Me),he={input_features:F};if(ve){const we=F.dims[1],He=new Tensor("int64",new BigInt64Array(we),[1,we]);if(Ee)for(let ut=1,tt=0;ut0)if(H==="rand_trunc"){fe=!0;const Re=Math.floor(Math.random()*(Ee+1));M=M.subarray(Re,Re+V),ve=this._extract_fbank_features(M,this.mel_filters_slaney,this.config.nb_max_samples),ve.dims=[1,...ve.dims]}else throw new Error(`Truncation strategy "${H}" not implemented`);else{if(Ee<0){let Re=new Float64Array(V);if(Re.set(M),te==="repeat")for(let Ce=M.length;CeRawImage.read(M)))}async function prepareAudios(be,M){return Array.isArray(be)||(be=[be]),await Promise.all(be.map(V=>typeof V=="string"||V instanceof URL?read_audio(V,M):V instanceof Float64Array?new Float32Array(V):V))}function get_bounding_box(be,M){M&&(be=be.map(fe=>fe|0));const[V,H,te,ve]=be;return{xmin:V,ymin:H,xmax:te,ymax:ve}}class Pipeline extends Callable{constructor({task:M,model:V,tokenizer:H=null,processor:te=null}){super(),this.task=M,this.model=V,this.tokenizer=H,this.processor=te}async dispose(){await this.model.dispose()}}class TextClassificationPipeline extends Pipeline{constructor(M){super(M)}async _call(M,{topk:V=1}={}){const H=this.tokenizer(M,{padding:!0,truncation:!0}),te=await this.model(H),ve=this.model.config.problem_type==="multi_label_classification"?Re=>Re.sigmoid().data:Re=>softmax(Re.data),fe=this.model.config.id2label,Ee=[];for(const Re of te.logits){const Ce=ve(Re),$=getTopItems(Ce,V).map(F=>({label:fe[F[0]],score:F[1]}));V===1?Ee.push(...$):Ee.push($)}return Array.isArray(M)||V===1?Ee:Ee[0]}}class TokenClassificationPipeline extends Pipeline{constructor(M){super(M)}async _call(M,{ignore_labels:V=["O"]}={}){const H=Array.isArray(M),te=this.tokenizer(H?M:[M],{padding:!0,truncation:!0}),fe=(await this.model(te)).logits,Ee=this.model.config.id2label,Re=[];for(let Ce=0;Ce[he,we]).filter(he=>he[1]>Ce),$=Array.from(softmax(ve.end_logits[Ee].data)).map((he,we)=>[he,we]).filter(he=>he[1]>Ce),F=product(Me,$).filter(he=>he[0][1]<=he[1][1]).map(he=>[he[0][1],he[1][1],he[0][0]*he[1][0]]).sort((he,we)=>we[2]-he[2]);for(let he=0;he{const he=[...Ee];return he[Re]=F[0],{score:F[1],token:F[0],token_str:this.tokenizer.model.vocab[F[0]],sequence:this.tokenizer.decode(he,{skip_special_tokens:!0})}}))}return Array.isArray(M)?ve:ve[0]}}class Text2TextGenerationPipeline extends Pipeline{_key="generated_text";constructor(M){super(M)}async _call(M,V={}){Array.isArray(M)||(M=[M]),this.model.config.prefix&&(M=M.map(Re=>this.model.config.prefix+Re));const H=this.model.config.task_specific_params;H&&H[this.task]&&H[this.task].prefix&&(M=M.map(Re=>H[this.task].prefix+Re));const te=this.tokenizer,ve={padding:!0,truncation:!0};let fe;this instanceof TranslationPipeline&&"_build_translation_inputs"in te?fe=te._build_translation_inputs(M,ve,V).input_ids:fe=te(M,ve).input_ids;const Ee=await this.model.generate(fe,V);return te.batch_decode(Ee,{skip_special_tokens:!0}).map(Re=>({[this._key]:Re}))}}class SummarizationPipeline extends Text2TextGenerationPipeline{_key="summary_text";constructor(M){super(M)}}class TranslationPipeline extends Text2TextGenerationPipeline{_key="translation_text";constructor(M){super(M)}}function isChat(be){return Array.isArray(be)&&be.every(M=>"role"in M&&"content"in M)}class TextGenerationPipeline extends Pipeline{constructor(M){super(M)}async _call(M,V={}){let H=!1,te=!1,ve;if(typeof M=="string")ve=M=[M];else if(Array.isArray(M)&&M.every(we=>typeof we=="string"))H=!0,ve=M;else{if(isChat(M))M=[M];else if(Array.isArray(M)&&M.every(isChat))H=!0;else throw new Error("Input must be a string, an array of strings, a Chat, or an array of Chats");te=!0,ve=M.map(we=>this.tokenizer.apply_chat_template(we,{tokenize:!1,add_generation_prompt:!0}))}const fe=V.add_special_tokens??!1,Ee=te?!1:V.return_full_text??!0;this.tokenizer.padding_side="left";const{input_ids:Re,attention_mask:Ce}=this.tokenizer(ve,{add_special_tokens:fe,padding:!0,truncation:!0}),Me=await this.model.generate(Re,V,null,{inputs_attention_mask:Ce});let $=this.tokenizer.batch_decode(Me,{skip_special_tokens:!0}),F;!Ee&&Re.dims.at(-1)>0&&(F=this.tokenizer.batch_decode(Re,{skip_special_tokens:!0}).map(we=>we.length));const he=Array.from({length:M.length},we=>[]);for(let we=0;we<$.length;++we){const He=Math.floor(we/Me.length*M.length);F&&($[we]=$[we].slice(F[He])),he[He].push({generated_text:te?[...M[He],{role:"assistant",content:$[we]}]:$[we]})}return!H&&he.length===1?he[0]:he}}class ZeroShotClassificationPipeline extends Pipeline{constructor(M){super(M),this.label2id=Object.fromEntries(Object.entries(this.model.config.label2id).map(([V,H])=>[V.toLowerCase(),H])),this.entailment_id=this.label2id.entailment,this.entailment_id===void 0&&(console.warn("Could not find 'entailment' in label2id mapping. Using 2 as entailment_id."),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,this.contradiction_id===void 0&&(console.warn("Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id."),this.contradiction_id=0)}async _call(M,V,{hypothesis_template:H="This example is {}.",multi_label:te=!1}={}){const ve=Array.isArray(M);ve||(M=[M]),Array.isArray(V)||(V=[V]);const fe=V.map(Ce=>H.replace("{}",Ce)),Ee=te||V.length===1,Re=[];for(const Ce of M){const Me=[];for(const he of fe){const we=this.tokenizer(Ce,{text_pair:he,padding:!0,truncation:!0}),He=await this.model(we);Ee?Me.push([He.logits.data[this.contradiction_id],He.logits.data[this.entailment_id]]):Me.push(He.logits.data[this.entailment_id])}const F=(Ee?Me.map(he=>softmax(he)[1]):softmax(Me)).map((he,we)=>[he,we]).sort((he,we)=>we[0]-he[0]);Re.push({sequence:Ce,labels:F.map(he=>V[he[1]]),scores:F.map(he=>he[0])})}return ve?Re:Re[0]}}class FeatureExtractionPipeline extends Pipeline{constructor(M){super(M)}async _call(M,{pooling:V="none",normalize:H=!1,quantize:te=!1,precision:ve="binary"}={}){const fe=this.tokenizer(M,{padding:!0,truncation:!0}),Ee=await this.model(fe);let Re=Ee.last_hidden_state??Ee.logits??Ee.token_embeddings;if(V!=="none")if(V==="mean")Re=mean_pooling(Re,fe.attention_mask);else if(V==="cls")Re=Re.slice(null,0);else throw Error(`Pooling method '${V}' not supported.`);return H&&(Re=Re.normalize(2,-1)),te&&(Re=quantize_embeddings(Re,ve)),Re}}class ImageFeatureExtractionPipeline extends Pipeline{constructor(M){super(M)}async _call(M,{pool:V=null}={}){const H=await prepareImages(M),{pixel_values:te}=await this.processor(H),ve=await this.model({pixel_values:te});let fe;if(V){if(!("pooler_output"in ve))throw Error("No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.");fe=ve.pooler_output}else fe=ve.last_hidden_state??ve.logits??ve.image_embeds;return fe}}class AudioClassificationPipeline extends Pipeline{constructor(M){super(M)}async _call(M,{topk:V=null}={}){const H=!Array.isArray(M),te=this.processor.feature_extractor.config.sampling_rate,ve=await prepareAudios(M,te),fe=this.model.config.id2label,Ee=[];for(const Re of ve){const Ce=await this.processor(Re),$=(await this.model(Ce)).logits[0],he=getTopItems(softmax($.data),V).map(we=>({label:fe[we[0]],score:we[1]}));V===1?Ee.push(...he):Ee.push(he)}return!H||V===1?Ee:Ee[0]}}class ZeroShotAudioClassificationPipeline extends Pipeline{constructor(M){super(M)}async _call(M,V,{hypothesis_template:H="This is a sound of {}."}={}){const te=!Array.isArray(M);te&&(M=[M]);const ve=V.map(Me=>H.replace("{}",Me)),fe=this.tokenizer(ve,{padding:!0,truncation:!0}),Ee=this.processor.feature_extractor.config.sampling_rate,Re=await prepareAudios(M,Ee),Ce=[];for(const Me of Re){const $=await this.processor(Me),F=await this.model({...fe,...$}),he=softmax(F.logits_per_audio.data);Ce.push([...he].map((we,He)=>({score:we,label:V[He]})))}return te?Ce[0]:Ce}}class AutomaticSpeechRecognitionPipeline extends Pipeline{constructor(M){super(M)}async _call(M,V={}){switch(this.model.config.model_type){case"whisper":return this._call_whisper(M,V);case"wav2vec2":case"wav2vec2-bert":case"unispeech":case"unispeech-sat":case"hubert":return this._call_wav2vec2(M,V);default:throw new Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(M,V={}){V.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),V.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');const H=!Array.isArray(M);H&&(M=[M]);const te=this.processor.feature_extractor.config.sampling_rate,ve=await prepareAudios(M,te),fe=[];for(const Ee of ve){const Re=await this.processor(Ee),Me=(await this.model(Re)).logits[0],$=[];for(const he of Me)$.push(max$1(he.data)[1]);const F=this.tokenizer.decode($);fe.push({text:F})}return H?fe[0]:fe}async _call_whisper(M,V={}){const H=V.return_timestamps??!1,te=V.chunk_length_s??0,ve=V.chunk_callback??null,fe=V.force_full_sequences??!1;let Ee=V.stride_length_s??null;H==="word"&&(V.return_token_timestamps=!0);const Re=pop(V,"language",null),Ce=pop(V,"task",null);if(Re||Ce||H){if(V.forced_decoder_ids)throw new Error("Cannot specify `language`/`task`/`return_timestamps` and `forced_decoder_ids` at the same time.");const ut=this.tokenizer.get_decoder_prompt_ids({language:Re,task:Ce,no_timestamps:!H});ut.length>0&&(V.forced_decoder_ids=ut)}const Me=!Array.isArray(M);Me&&(M=[M]);const $=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,F=this.processor.feature_extractor.config.hop_length,he=this.processor.feature_extractor.config.sampling_rate,we=await prepareAudios(M,he),He=[];for(const ut of we){let tt=[];if(te>0){if(Ee===null)Ee=te/6;else if(te<=Ee)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");const Qt=he*te,ir=he*Ee,Lr=Qt-2*ir;let jr=0;for(;jr=ut.length;tt.push({stride:[tn.length,Ir?0:ir,On?0:ir],input_features:mr.input_features,is_last:On}),jr+=Lr}}else tt=[{stride:[ut.length,0,0],input_features:(await this.processor(ut)).input_features,is_last:!0}];for(const Qt of tt){V.num_frames=Math.floor(Qt.stride[0]/F);const ir=await this.model.generate(Qt.input_features,V);H==="word"?(Qt.tokens=ir.sequences[0],Qt.token_timestamps=ir.token_timestamps.tolist()[0].map(Lr=>round(Lr,2))):Qt.tokens=ir[0],Qt.stride=Qt.stride.map(Lr=>Lr/he),ve!==null&&ve(Qt)}const[_e,Gt]=this.tokenizer._decode_asr(tt,{time_precision:$,return_timestamps:H,force_full_sequences:fe});He.push({text:_e,...Gt})}return Me?He[0]:He}}class ImageToTextPipeline extends Pipeline{constructor(M){super(M)}async _call(M,V={}){const H=Array.isArray(M),te=await prepareImages(M),{pixel_values:ve}=await this.processor(te),fe=[];for(const Ee of ve){Ee.dims=[1,...Ee.dims];const Re=await this.model.generate(Ee,V),Ce=this.tokenizer.batch_decode(Re,{skip_special_tokens:!0}).map(Me=>({generated_text:Me.trim()}));fe.push(Ce)}return H?fe:fe[0]}}class ImageClassificationPipeline extends Pipeline{constructor(M){super(M)}async _call(M,{topk:V=1}={}){const H=Array.isArray(M),te=await prepareImages(M),{pixel_values:ve}=await this.processor(te),fe=await this.model({pixel_values:ve}),Ee=this.model.config.id2label,Re=[];for(const Ce of fe.logits){const $=getTopItems(softmax(Ce.data),V).map(F=>({label:Ee[F[0]],score:F[1]}));V===1?Re.push(...$):Re.push($)}return H||V===1?Re:Re[0]}}class ImageSegmentationPipeline extends Pipeline{constructor(M){super(M),this.subtasks_mapping={panoptic:"post_process_panoptic_segmentation",instance:"post_process_instance_segmentation",semantic:"post_process_semantic_segmentation"}}async _call(M,{threshold:V=.5,mask_threshold:H=.5,overlap_mask_area_threshold:te=.8,label_ids_to_fuse:ve=null,target_sizes:fe=null,subtask:Ee=null}={}){if(Array.isArray(M)&&M.length!==1)throw Error("Image segmentation pipeline currently only supports a batch size of 1.");const Ce=await prepareImages(M),Me=Ce.map(tt=>[tt.height,tt.width]),{pixel_values:$,pixel_mask:F}=await this.processor(Ce),he=await this.model({pixel_values:$,pixel_mask:F});let we=null;if(Ee!==null)we=this.subtasks_mapping[Ee];else for(let[tt,_e]of Object.entries(this.subtasks_mapping))if(_e in this.processor.feature_extractor){we=this.processor.feature_extractor[_e].bind(this.processor.feature_extractor),Ee=tt;break}const He=this.model.config.id2label,ut=[];if(Ee==="panoptic"||Ee==="instance"){const tt=we(he,V,H,te,ve,fe??Me)[0],_e=tt.segmentation;for(const Gt of tt.segments_info){const Qt=new Uint8ClampedArray(_e.data.length);for(let Lr=0;Lr<_e.data.length;++Lr)_e.data[Lr]===Gt.id&&(Qt[Lr]=255);const ir=new RawImage(Qt,_e.dims[1],_e.dims[0],1);ut.push({score:Gt.score,label:He[Gt.label_id],mask:ir})}}else if(Ee==="semantic"){const{segmentation:tt,labels:_e}=we(he,fe??Me)[0];for(const Gt of _e){const Qt=new Uint8ClampedArray(tt.data.length);for(let Lr=0;LrH.replace("{}",F)),Ee=this.tokenizer(fe,{padding:this.model.config.model_type==="siglip"?"max_length":!0,truncation:!0}),{pixel_values:Re}=await this.processor(ve),Ce=await this.model({...Ee,pixel_values:Re}),Me=this.model.config.model_type==="siglip"?F=>F.sigmoid().data:F=>softmax(F.data),$=[];for(const F of Ce.logits_per_image){const we=[...Me(F)].map((He,ut)=>({score:He,label:V[ut]}));we.sort((He,ut)=>ut.score-He.score),$.push(we)}return te?$:$[0]}}class ObjectDetectionPipeline extends Pipeline{constructor(M){super(M)}async _call(M,{threshold:V=.9,percentage:H=!1}={}){const te=Array.isArray(M);if(te&&M.length!==1)throw Error("Object detection pipeline currently only supports a batch size of 1.");const ve=await prepareImages(M),fe=H?null:ve.map(he=>[he.height,he.width]),{pixel_values:Ee,pixel_mask:Re}=await this.processor(ve),Ce=await this.model({pixel_values:Ee,pixel_mask:Re}),Me=this.processor.feature_extractor.post_process_object_detection(Ce,V,fe),$=this.model.config.id2label,F=Me.map(he=>he.boxes.map((we,He)=>({score:he.scores[He],label:$[he.classes[He]],box:get_bounding_box(we,!H)})));return te?F:F[0]}}class ZeroShotObjectDetectionPipeline extends Pipeline{constructor(M){super(M)}async _call(M,V,{threshold:H=.1,topk:te=null,percentage:ve=!1}={}){const fe=Array.isArray(M),Ee=await prepareImages(M),Re=this.tokenizer(V,{padding:!0,truncation:!0}),Ce=await this.processor(Ee),Me=[];for(let $=0;$({score:ut.scores[Gt],label:V[ut.classes[Gt]],box:get_bounding_box(_e,!ve)})).sort((_e,Gt)=>Gt.score-_e.score);te!==null&&(tt=tt.slice(0,te)),Me.push(tt)}return fe?Me:Me[0]}}class DocumentQuestionAnsweringPipeline extends Pipeline{constructor(M){super(M)}async _call(M,V,H={}){const te=(await prepareImages(M))[0],{pixel_values:ve}=await this.processor(te),fe=`${V}`,Ee=this.tokenizer(fe,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,Re=await this.model.generate(ve,{...H,decoder_input_ids:Ee,max_length:this.model.config.decoder.max_position_embeddings}),Me=this.tokenizer.batch_decode(Re)[0].match(/(.*?)<\/s_answer>/);let $=null;return Me&&Me.length>=2&&($=Me[1].trim()),[{answer:$}]}}class TextToAudioPipeline extends Pipeline{DEFAULT_VOCODER_ID="Xenova/speecht5_hifigan";constructor(M){super(M),this.vocoder=M.vocoder??null}async _call(M,{speaker_embeddings:V=null}={}){return this.processor?this._call_text_to_spectrogram(M,{speaker_embeddings:V}):this._call_text_to_waveform(M)}async _call_text_to_waveform(M){const V=this.tokenizer(M,{padding:!0,truncation:!0}),{waveform:H}=await this.model(V),te=this.model.config.sampling_rate;return{audio:H.data,sampling_rate:te}}async _call_text_to_spectrogram(M,{speaker_embeddings:V}){if(this.vocoder||(console.log("No vocoder specified, using default HifiGan vocoder."),this.vocoder=await AutoModel.from_pretrained(this.DEFAULT_VOCODER_ID,{quantized:!1})),(typeof V=="string"||V instanceof URL)&&(V=new Float32Array(await(await fetch(V)).arrayBuffer())),V instanceof Float32Array)V=new Tensor("float32",V,[1,V.length]);else if(!(V instanceof Tensor))throw new Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");const{input_ids:H}=this.tokenizer(M,{padding:!0,truncation:!0}),{waveform:te}=await this.model.generate_speech(H,V,{vocoder:this.vocoder}),ve=this.processor.feature_extractor.config.sampling_rate;return{audio:te.data,sampling_rate:ve}}}class ImageToImagePipeline extends Pipeline{constructor(M){super(M)}async _call(M){const V=await prepareImages(M),H=await this.processor(V),te=await this.model(H),ve=[];for(const fe of te.reconstruction){const Ee=fe.squeeze().clamp_(0,1).mul_(255).round_().to("uint8");ve.push(RawImage.fromTensor(Ee))}return ve.length>1?ve:ve[0]}}class DepthEstimationPipeline extends Pipeline{constructor(M){super(M)}async _call(M){const V=await prepareImages(M),H=await this.processor(V),{predicted_depth:te}=await this.model(H),ve=[];for(let fe=0;fe1?ve:ve[0]}}const SUPPORTED_TASKS=Object.freeze({"text-classification":{tokenizer:AutoTokenizer,pipeline:TextClassificationPipeline,model:AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-finetuned-sst-2-english"},type:"text"},"token-classification":{tokenizer:AutoTokenizer,pipeline:TokenClassificationPipeline,model:AutoModelForTokenClassification,default:{model:"Xenova/bert-base-multilingual-cased-ner-hrl"},type:"text"},"question-answering":{tokenizer:AutoTokenizer,pipeline:QuestionAnsweringPipeline,model:AutoModelForQuestionAnswering,default:{model:"Xenova/distilbert-base-cased-distilled-squad"},type:"text"},"fill-mask":{tokenizer:AutoTokenizer,pipeline:FillMaskPipeline,model:AutoModelForMaskedLM,default:{model:"Xenova/bert-base-uncased"},type:"text"},summarization:{tokenizer:AutoTokenizer,pipeline:SummarizationPipeline,model:AutoModelForSeq2SeqLM,default:{model:"Xenova/distilbart-cnn-6-6"},type:"text"},translation:{tokenizer:AutoTokenizer,pipeline:TranslationPipeline,model:AutoModelForSeq2SeqLM,default:{model:"Xenova/t5-small"},type:"text"},"text2text-generation":{tokenizer:AutoTokenizer,pipeline:Text2TextGenerationPipeline,model:AutoModelForSeq2SeqLM,default:{model:"Xenova/flan-t5-small"},type:"text"},"text-generation":{tokenizer:AutoTokenizer,pipeline:TextGenerationPipeline,model:AutoModelForCausalLM,default:{model:"Xenova/gpt2"},type:"text"},"zero-shot-classification":{tokenizer:AutoTokenizer,pipeline:ZeroShotClassificationPipeline,model:AutoModelForSequenceClassification,default:{model:"Xenova/distilbert-base-uncased-mnli"},type:"text"},"audio-classification":{pipeline:AudioClassificationPipeline,model:AutoModelForAudioClassification,processor:AutoProcessor,default:{model:"Xenova/wav2vec2-base-superb-ks"},type:"audio"},"zero-shot-audio-classification":{tokenizer:AutoTokenizer,pipeline:ZeroShotAudioClassificationPipeline,model:AutoModel,processor:AutoProcessor,default:{model:"Xenova/clap-htsat-unfused"},type:"multimodal"},"automatic-speech-recognition":{tokenizer:AutoTokenizer,pipeline:AutomaticSpeechRecognitionPipeline,model:[AutoModelForSpeechSeq2Seq,AutoModelForCTC],processor:AutoProcessor,default:{model:"Xenova/whisper-tiny.en"},type:"multimodal"},"text-to-audio":{tokenizer:AutoTokenizer,pipeline:TextToAudioPipeline,model:[AutoModelForTextToWaveform,AutoModelForTextToSpectrogram],processor:[AutoProcessor,null],default:{model:"Xenova/speecht5_tts"},type:"text"},"image-to-text":{tokenizer:AutoTokenizer,pipeline:ImageToTextPipeline,model:AutoModelForVision2Seq,processor:AutoProcessor,default:{model:"Xenova/vit-gpt2-image-captioning"},type:"multimodal"},"image-classification":{pipeline:ImageClassificationPipeline,model:AutoModelForImageClassification,processor:AutoProcessor,default:{model:"Xenova/vit-base-patch16-224"},type:"multimodal"},"image-segmentation":{pipeline:ImageSegmentationPipeline,model:[AutoModelForImageSegmentation,AutoModelForSemanticSegmentation],processor:AutoProcessor,default:{model:"Xenova/detr-resnet-50-panoptic"},type:"multimodal"},"zero-shot-image-classification":{tokenizer:AutoTokenizer,pipeline:ZeroShotImageClassificationPipeline,model:AutoModel,processor:AutoProcessor,default:{model:"Xenova/clip-vit-base-patch32"},type:"multimodal"},"object-detection":{pipeline:ObjectDetectionPipeline,model:AutoModelForObjectDetection,processor:AutoProcessor,default:{model:"Xenova/detr-resnet-50"},type:"multimodal"},"zero-shot-object-detection":{tokenizer:AutoTokenizer,pipeline:ZeroShotObjectDetectionPipeline,model:AutoModelForZeroShotObjectDetection,processor:AutoProcessor,default:{model:"Xenova/owlvit-base-patch32"},type:"multimodal"},"document-question-answering":{tokenizer:AutoTokenizer,pipeline:DocumentQuestionAnsweringPipeline,model:AutoModelForDocumentQuestionAnswering,processor:AutoProcessor,default:{model:"Xenova/donut-base-finetuned-docvqa"},type:"multimodal"},"image-to-image":{pipeline:ImageToImagePipeline,model:AutoModelForImageToImage,processor:AutoProcessor,default:{model:"Xenova/swin2SR-classical-sr-x2-64"},type:"image"},"depth-estimation":{pipeline:DepthEstimationPipeline,model:AutoModelForDepthEstimation,processor:AutoProcessor,default:{model:"Xenova/dpt-large"},type:"image"},"feature-extraction":{tokenizer:AutoTokenizer,pipeline:FeatureExtractionPipeline,model:AutoModel,default:{model:"Xenova/all-MiniLM-L6-v2"},type:"text"},"image-feature-extraction":{processor:AutoProcessor,pipeline:ImageFeatureExtractionPipeline,model:[AutoModelForImageFeatureExtraction,AutoModel],default:{model:"Xenova/vit-base-patch16-224-in21k"},type:"image"}}),TASK_ALIASES=Object.freeze({"sentiment-analysis":"text-classification",ner:"token-classification",asr:"automatic-speech-recognition","text-to-speech":"text-to-audio",embeddings:"feature-extraction"});async function pipeline(be,M=null,{quantized:V=!0,progress_callback:H=null,config:te=null,cache_dir:ve=null,local_files_only:fe=!1,revision:Ee="main",model_file_name:Re=null}={}){be=TASK_ALIASES[be]??be;const Ce=SUPPORTED_TASKS[be.split("_",1)[0]];if(!Ce)throw Error(`Unsupported pipeline: ${be}. Must be one of [${Object.keys(SUPPORTED_TASKS)}]`);M||(M=Ce.default.model,console.log(`No model specified. Using default model: "${M}".`));const Me={quantized:V,progress_callback:H,config:te,cache_dir:ve,local_files_only:fe,revision:Ee,model_file_name:Re},$=new Map([["tokenizer",Ce.tokenizer],["model",Ce.model],["processor",Ce.processor]]),F=await loadItems($,M,Me);F.task=be,dispatchCallback(H,{status:"ready",task:be,model:M});const he=Ce.pipeline;return new he(F)}async function loadItems(be,M,V){const H=Object.create(null),te=[];for(let[ve,fe]of be.entries()){if(!fe)continue;let Ee;Array.isArray(fe)?Ee=new Promise(async(Re,Ce)=>{let Me;for(let $ of fe){if($===null){Re(null);return}try{Re(await $.from_pretrained(M,V));return}catch(F){Me=F}}Ce(Me)}):Ee=fe.from_pretrained(M,V),H[ve]=Ee,te.push(Ee)}await Promise.all(te);for(let[ve,fe]of Object.entries(H))H[ve]=await fe;return H}var plotly={exports:{}};(function(be){var M={};(function(V,H){be.exports?be.exports=H():V.moduleName=H()})(typeof self<"u"?self:commonjsGlobal,()=>{var V=(()=>{var H=Object.create,te=Object.defineProperty,ve=Object.defineProperties,fe=Object.getOwnPropertyDescriptor,Ee=Object.getOwnPropertyDescriptors,Re=Object.getOwnPropertyNames,Ce=Object.getOwnPropertySymbols,Me=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,he=(ee,X,h)=>X in ee?te(ee,X,{enumerable:!0,configurable:!0,writable:!0,value:h}):ee[X]=h,we=(ee,X)=>{for(var h in X||(X={}))$.call(X,h)&&he(ee,h,X[h]);if(Ce)for(var h of Ce(X))F.call(X,h)&&he(ee,h,X[h]);return ee},He=(ee,X)=>ve(ee,Ee(X)),ut=(ee,X)=>{var h={};for(var x in ee)$.call(ee,x)&&X.indexOf(x)<0&&(h[x]=ee[x]);if(ee!=null&&Ce)for(var x of Ce(ee))X.indexOf(x)<0&&F.call(ee,x)&&(h[x]=ee[x]);return h},tt=(ee,X)=>function(){return ee&&(X=(0,ee[Re(ee)[0]])(ee=0)),X},_e=(ee,X)=>function(){return X||(0,ee[Re(ee)[0]])((X={exports:{}}).exports,X),X.exports},Gt=(ee,X)=>{for(var h in X)te(ee,h,{get:X[h],enumerable:!0})},Qt=(ee,X,h,x)=>{if(X&&typeof X=="object"||typeof X=="function")for(let S of Re(X))!$.call(ee,S)&&S!==h&&te(ee,S,{get:()=>X[S],enumerable:!(x=fe(X,S))||x.enumerable});return ee},ir=(ee,X,h)=>(h=ee!=null?H(Me(ee)):{},Qt(te(h,"default",{value:ee,enumerable:!0}),ee)),Lr=ee=>Qt(te({},"__esModule",{value:!0}),ee),jr=_e({"src/version.js"(ee){ee.version="3.3.1"}}),tn=_e({"node_modules/native-promise-only/lib/npo.src.js"(ee,X){(function(x,S,k){S[x]=S[x]||k(),typeof X<"u"&&X.exports&&(X.exports=S[x])})("Promise",typeof window<"u"?window:ee,function(){var x,S,k,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(g){return setImmediate(g)}:setTimeout;try{Object.defineProperty({},"x",{}),x=function(g,b,A,E){return Object.defineProperty(g,b,{value:A,writable:!0,configurable:E!==!1})}}catch{x=function(b,A,E){return b[A]=E,b}}k=function(){var g,b,A;function E(_,w){this.fn=_,this.self=w,this.next=void 0}return{add:function(w,m){A=new E(w,m),b?b.next=A:g=A,b=A,A=void 0},drain:function(){var w=g;for(g=b=S=void 0;w;)w.fn.call(w.self),w=w.next}}}();function r(l,g){k.add(l,g),S||(S=t(k.drain))}function o(l){var g,b=typeof l;return l!=null&&(b=="object"||b=="function")&&(g=l.then),typeof g=="function"?g:!1}function n(){for(var l=0;l0&&r(n,b))}catch(A){s.call(new c(b),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,b,A){for(var E=0;EYe?1:ke>=Ye?0:NaN}h.descending=function(ke,Ye){return Yeke?1:Ye>=ke?0:NaN},h.min=function(ke,Ye){var pt=-1,Lt=ke.length,Rt,jt;if(arguments.length===1){for(;++pt=jt){Rt=jt;break}for(;++ptjt&&(Rt=jt)}else{for(;++pt=jt){Rt=jt;break}for(;++ptjt&&(Rt=jt)}return Rt},h.max=function(ke,Ye){var pt=-1,Lt=ke.length,Rt,jt;if(arguments.length===1){for(;++pt=jt){Rt=jt;break}for(;++ptRt&&(Rt=jt)}else{for(;++pt=jt){Rt=jt;break}for(;++ptRt&&(Rt=jt)}return Rt},h.extent=function(ke,Ye){var pt=-1,Lt=ke.length,Rt,jt,cr;if(arguments.length===1){for(;++pt=jt){Rt=cr=jt;break}for(;++ptjt&&(Rt=jt),cr=jt){Rt=cr=jt;break}for(;++ptjt&&(Rt=jt),cr1)return cr/(kr-1)},h.deviation=function(){var ke=h.variance.apply(this,arguments);return ke&&Math.sqrt(ke)};function v(ke){return{left:function(Ye,pt,Lt,Rt){for(arguments.length<3&&(Lt=0),arguments.length<4&&(Rt=Ye.length);Lt>>1;ke(Ye[jt],pt)<0?Lt=jt+1:Rt=jt}return Lt},right:function(Ye,pt,Lt,Rt){for(arguments.length<3&&(Lt=0),arguments.length<4&&(Rt=Ye.length);Lt>>1;ke(Ye[jt],pt)>0?Rt=jt:Lt=jt+1}return Lt}}}var p=v(s);h.bisectLeft=p.left,h.bisect=h.bisectRight=p.right,h.bisector=function(ke){return v(ke.length===1?function(Ye,pt){return s(ke(Ye),pt)}:ke)},h.shuffle=function(ke,Ye,pt){(Lt=arguments.length)<3&&(pt=ke.length,Lt<2&&(Ye=0));for(var Lt=pt-Ye,Rt,jt;Lt;)jt=Math.random()*Lt--|0,Rt=ke[Lt+Ye],ke[Lt+Ye]=ke[jt+Ye],ke[jt+Ye]=Rt;return ke},h.permute=function(ke,Ye){for(var pt=Ye.length,Lt=new Array(pt);pt--;)Lt[pt]=ke[Ye[pt]];return Lt},h.pairs=function(ke){for(var Ye=0,pt=ke.length-1,Lt=ke[0],Rt=new Array(pt<0?0:pt);Ye=0;)for(cr=ke[Ye],pt=cr.length;--pt>=0;)jt[--Rt]=cr[pt];return jt};var l=Math.abs;h.range=function(ke,Ye,pt){if(arguments.length<3&&(pt=1,arguments.length<2&&(Ye=ke,ke=0)),(Ye-ke)/pt===1/0)throw new Error("infinite range");var Lt=[],Rt=g(l(pt)),jt=-1,cr;if(ke*=Rt,Ye*=Rt,pt*=Rt,pt<0)for(;(cr=ke+pt*++jt)>Ye;)Lt.push(cr/Rt);else for(;(cr=ke+pt*++jt)=Ye.length)return Rt?Rt.call(ke,kr):Lt?kr.sort(Lt):kr;for(var nn=-1,wn=kr.length,Rn=Ye[on++],Nn,qa,Yn,ha=new A,xa;++nn=Ye.length)return ur;var on=[],nn=pt[kr++];return ur.forEach(function(wn,Rn){on.push({key:wn,values:cr(Rn,kr)})}),nn?on.sort(function(wn,Rn){return nn(wn.key,Rn.key)}):on}return ke.map=function(ur,kr){return jt(kr,ur,0)},ke.entries=function(ur){return cr(jt(h.map,ur,0),0)},ke.key=function(ur){return Ye.push(ur),ke},ke.sortKeys=function(ur){return pt[Ye.length-1]=ur,ke},ke.sortValues=function(ur){return Lt=ur,ke},ke.rollup=function(ur){return Rt=ur,ke},ke},h.set=function(ke){var Ye=new z;if(ke)for(var pt=0,Lt=ke.length;pt=0&&(Lt=ke.slice(pt+1),ke=ke.slice(0,pt)),ke)return arguments.length<2?this[ke].on(Lt):this[ke].on(Lt,Ye);if(arguments.length===2){if(Ye==null)for(ke in this)this.hasOwnProperty(ke)&&this[ke].on(Lt,null);return this}};function J(ke){var Ye=[],pt=new A;function Lt(){for(var Rt=Ye,jt=-1,cr=Rt.length,ur;++jt=0&&(pt=ke.slice(0,Ye))!=="xmlns"&&(ke=ke.slice(Ye+1)),Te.hasOwnProperty(pt)?{space:Te[pt],local:ke}:ke}},ie.attr=function(ke,Ye){if(arguments.length<2){if(typeof ke=="string"){var pt=this.node();return ke=h.ns.qualify(ke),ke.local?pt.getAttributeNS(ke.space,ke.local):pt.getAttribute(ke)}for(Ye in ke)this.each(Fe(Ye,ke[Ye]));return this}return this.each(Fe(ke,Ye))};function Fe(ke,Ye){ke=h.ns.qualify(ke);function pt(){this.removeAttribute(ke)}function Lt(){this.removeAttributeNS(ke.space,ke.local)}function Rt(){this.setAttribute(ke,Ye)}function jt(){this.setAttributeNS(ke.space,ke.local,Ye)}function cr(){var kr=Ye.apply(this,arguments);kr==null?this.removeAttribute(ke):this.setAttribute(ke,kr)}function ur(){var kr=Ye.apply(this,arguments);kr==null?this.removeAttributeNS(ke.space,ke.local):this.setAttributeNS(ke.space,ke.local,kr)}return Ye==null?ke.local?Lt:pt:typeof Ye=="function"?ke.local?ur:cr:ke.local?jt:Rt}function Ve(ke){return ke.trim().replace(/\s+/g," ")}ie.classed=function(ke,Ye){if(arguments.length<2){if(typeof ke=="string"){var pt=this.node(),Lt=(ke=We(ke)).length,Rt=-1;if(Ye=pt.classList){for(;++Rt=0;)(jt=pt[Lt])&&(Rt&&Rt!==jt.nextSibling&&Rt.parentNode.insertBefore(jt,Rt),Rt=jt);return this},ie.sort=function(ke){ke=Ke.apply(this,arguments);for(var Ye=-1,pt=this.length;++Ye=Ye&&(Ye=Rt+1);!(kr=cr[Ye])&&++Ye0&&(ke=ke.slice(0,Rt));var cr=lr.get(ke);cr&&(ke=cr,jt=Nr);function ur(){var nn=this[Lt];nn&&(this.removeEventListener(ke,nn,nn.$),delete this[Lt])}function kr(){var nn=jt(Ye,S(arguments));ur.call(this),this.addEventListener(ke,this[Lt]=nn,nn.$=pt),nn._=Ye}function on(){var nn=new RegExp("^__on([^.]+)"+h.requote(ke)+"$"),wn;for(var Rn in this)if(wn=Rn.match(nn)){var Nn=this[Rn];this.removeEventListener(wn[1],Nn,Nn.$),delete this[Rn]}}return Rt?Ye?kr:ur:Ye?j:on}var lr=h.map({mouseenter:"mouseover",mouseleave:"mouseout"});k&&lr.forEach(function(ke){"on"+ke in k&&lr.remove(ke)});function dr(ke,Ye){return function(pt){var Lt=h.event;h.event=pt,Ye[0]=this.__data__;try{ke.apply(this,Ye)}finally{h.event=Lt}}}function Nr(ke,Ye){var pt=dr(ke,Ye);return function(Lt){var Rt=this,jt=Lt.relatedTarget;(!jt||jt!==Rt&&!(jt.compareDocumentPosition(Rt)&8))&&pt.call(Rt,Lt)}}var Fr,ln=0;function zr(ke){var Ye=".dragsuppress-"+ ++ln,pt="click"+Ye,Lt=h.select(t(ke)).on("touchmove"+Ye,oe).on("dragstart"+Ye,oe).on("selectstart"+Ye,oe);if(Fr==null&&(Fr="onselectstart"in ke?!1:B(ke.style,"userSelect")),Fr){var Rt=e(ke).style,jt=Rt[Fr];Rt[Fr]="none"}return function(cr){if(Lt.on(Ye,null),Fr&&(Rt[Fr]=jt),cr){var ur=function(){Lt.on(pt,null)};Lt.on(pt,function(){oe(),ur()},!0),setTimeout(ur,0)}}}h.mouse=function(ke){return Ot(ke,ye())};var Xr=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ot(ke,Ye){Ye.changedTouches&&(Ye=Ye.changedTouches[0]);var pt=ke.ownerSVGElement||ke;if(pt.createSVGPoint){var Lt=pt.createSVGPoint();if(Xr<0){var Rt=t(ke);if(Rt.scrollX||Rt.scrollY){pt=h.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var jt=pt[0][0].getScreenCTM();Xr=!(jt.f||jt.e),pt.remove()}}return Xr?(Lt.x=Ye.pageX,Lt.y=Ye.pageY):(Lt.x=Ye.clientX,Lt.y=Ye.clientY),Lt=Lt.matrixTransform(ke.getScreenCTM().inverse()),[Lt.x,Lt.y]}var cr=ke.getBoundingClientRect();return[Ye.clientX-cr.left-ke.clientLeft,Ye.clientY-cr.top-ke.clientTop]}h.touch=function(ke,Ye,pt){if(arguments.length<3&&(pt=Ye,Ye=ye().changedTouches),Ye){for(var Lt=0,Rt=Ye.length,jt;Lt1?at:ke<-1?-at:Math.asin(ke)}function or(ke){return((ke=Math.exp(ke))-1/ke)/2}function Cr(ke){return((ke=Math.exp(ke))+1/ke)/2}function Sr(ke){return((ke=Math.exp(2*ke))-1)/(ke+1)}var Tr=Math.SQRT2,Yr=2,Fn=4;h.interpolateZoom=function(ke,Ye){var pt=ke[0],Lt=ke[1],Rt=ke[2],jt=Ye[0],cr=Ye[1],ur=Ye[2],kr=jt-pt,on=cr-Lt,nn=kr*kr+on*on,wn,Rn;if(nn0&&(ho=ho.transition().duration(cr)),ho.call(Ha.event)}function xo(){ha&&ha.domain(Yn.range().map(function(ho){return(ho-ke.x)/ke.k}).map(Yn.invert)),Ba&&Ba.domain(xa.range().map(function(ho){return(ho-ke.y)/ke.k}).map(xa.invert))}function Mo(ho){ur++||ho({type:"zoomstart"})}function Gs(ho){xo(),ho({type:"zoom",scale:ke.k,translate:[ke.x,ke.y]})}function Po(ho){--ur||(ho({type:"zoomend"}),pt=null)}function os(){var ho=this,ks=qa.of(ho,arguments),Ys=0,ql=h.select(t(ho)).on(on,bl).on(nn,Gl),Pl=_a(h.mouse(ho)),fc=zr(ho);Fa.call(ho),Mo(ks);function bl(){Ys=1,Vi(h.mouse(ho),Pl),Gs(ks)}function Gl(){ql.on(on,null).on(nn,null),fc(Ys),Po(ks)}}function Js(){var ho=this,ks=qa.of(ho,arguments),Ys={},ql=0,Pl,fc=".zoom-"+h.event.changedTouches[0].identifier,bl="touchmove"+fc,Gl="touchend"+fc,Lc=[],Tu=h.select(ho),St=zr(ho);Dr(),Mo(ks),Tu.on(kr,null).on(Rn,Dr);function Er(){var En=h.touches(ho);return Pl=ke.k,En.forEach(function(Sn){Sn.identifier in Ys&&(Ys[Sn.identifier]=_a(Sn))}),En}function Dr(){var En=h.event.target;h.select(En).on(bl,Bn).on(Gl,Aa),Lc.push(En);for(var Sn=h.event.changedTouches,Ya=0,$a=Sn.length;Ya<$a;++Ya)Ys[Sn[Ya].identifier]=null;var Wa=Er(),oi=Date.now();if(Wa.length===1){if(oi-Nn<500){var Hi=Wa[0];Zi(ho,Hi,Ys[Hi.identifier],Math.floor(Math.log(ke.k)/Math.LN2)+1),oe()}Nn=oi}else if(Wa.length>1){var Hi=Wa[0],Ci=Wa[1],ai=Hi[0]-Ci[0],Pa=Hi[1]-Ci[1];ql=ai*ai+Pa*Pa}}function Bn(){var En=h.touches(ho),Sn,Ya,$a,Wa;Fa.call(ho);for(var oi=0,Hi=En.length;oi1?1:Ye,pt=pt<0?0:pt>1?1:pt,Rt=pt<=.5?pt*(1+Ye):pt+Ye-pt*Ye,Lt=2*pt-Rt;function jt(ur){return ur>360?ur-=360:ur<0&&(ur+=360),ur<60?Lt+(Rt-Lt)*ur/60:ur<180?Rt:ur<240?Lt+(Rt-Lt)*(240-ur)/60:Lt}function cr(ur){return Math.round(jt(ur)*255)}return new Mi(cr(ke+120),cr(ke),cr(ke-120))}h.hcl=gr;function gr(ke,Ye,pt){return this instanceof gr?(this.h=+ke,this.c=+Ye,void(this.l=+pt)):arguments.length<2?ke instanceof gr?new gr(ke.h,ke.c,ke.l):ke instanceof _r?Ma(ke.l,ke.a,ke.b):Ma((ke=Gr((ke=h.rgb(ke)).r,ke.g,ke.b)).l,ke.a,ke.b):new gr(ke,Ye,pt)}var Kt=gr.prototype=new ma;Kt.brighter=function(ke){return new gr(this.h,this.c,Math.min(100,this.l+rn*(arguments.length?ke:1)))},Kt.darker=function(ke){return new gr(this.h,this.c,Math.max(0,this.l-rn*(arguments.length?ke:1)))},Kt.rgb=function(){return vr(this.h,this.c,this.l).rgb()};function vr(ke,Ye,pt){return isNaN(ke)&&(ke=0),isNaN(Ye)&&(Ye=0),new _r(pt,Math.cos(ke*=ft)*Ye,Math.sin(ke)*Ye)}h.lab=_r;function _r(ke,Ye,pt){return this instanceof _r?(this.l=+ke,this.a=+Ye,void(this.b=+pt)):arguments.length<2?ke instanceof _r?new _r(ke.l,ke.a,ke.b):ke instanceof gr?vr(ke.h,ke.c,ke.l):Gr((ke=Mi(ke)).r,ke.g,ke.b):new _r(ke,Ye,pt)}var rn=18,gn=.95047,Mn=1,In=1.08883,fa=_r.prototype=new ma;fa.brighter=function(ke){return new _r(Math.min(100,this.l+rn*(arguments.length?ke:1)),this.a,this.b)},fa.darker=function(ke){return new _r(Math.max(0,this.l-rn*(arguments.length?ke:1)),this.a,this.b)},fa.rgb=function(){return Ca(this.l,this.a,this.b)};function Ca(ke,Ye,pt){var Lt=(ke+16)/116,Rt=Lt+Ye/500,jt=Lt-pt/200;return Rt=Da(Rt)*gn,Lt=Da(Lt)*Mn,jt=Da(jt)*In,new Mi(na(3.2404542*Rt-1.5371385*Lt-.4985314*jt),na(-.969266*Rt+1.8760108*Lt+.041556*jt),na(.0556434*Rt-.2040259*Lt+1.0572252*jt))}function Ma(ke,Ye,pt){return ke>0?new gr(Math.atan2(pt,Ye)*Bt,Math.sqrt(Ye*Ye+pt*pt),ke):new gr(NaN,NaN,ke)}function Da(ke){return ke>.206893034?ke*ke*ke:(ke-4/29)/7.787037}function Va(ke){return ke>.008856?Math.pow(ke,1/3):7.787037*ke+4/29}function na(ke){return Math.round(255*(ke<=.00304?12.92*ke:1.055*Math.pow(ke,1/2.4)-.055))}h.rgb=Mi;function Mi(ke,Ye,pt){return this instanceof Mi?(this.r=~~ke,this.g=~~Ye,void(this.b=~~pt)):arguments.length<2?ke instanceof Mi?new Mi(ke.r,ke.g,ke.b):Kr(""+ke,Mi,ti):new Mi(ke,Ye,pt)}function Oi(ke){return new Mi(ke>>16,ke>>8&255,ke&255)}function Vt(ke){return Oi(ke)+""}var Ct=Mi.prototype=new ma;Ct.brighter=function(ke){ke=Math.pow(.7,arguments.length?ke:1);var Ye=this.r,pt=this.g,Lt=this.b,Rt=30;return!Ye&&!pt&&!Lt?new Mi(Rt,Rt,Rt):(Ye&&Ye>4,Lt=Lt>>4|Lt,Rt=kr&240,Rt=Rt>>4|Rt,jt=kr&15,jt=jt<<4|jt):ke.length===7&&(Lt=(kr&16711680)>>16,Rt=(kr&65280)>>8,jt=kr&255)),Ye(Lt,Rt,jt))}function Qr(ke,Ye,pt){var Lt=Math.min(ke/=255,Ye/=255,pt/=255),Rt=Math.max(ke,Ye,pt),jt=Rt-Lt,cr,ur,kr=(Rt+Lt)/2;return jt?(ur=kr<.5?jt/(Rt+Lt):jt/(2-Rt-Lt),ke==Rt?cr=(Ye-pt)/jt+(Ye0&&kr<1?0:cr),new Jn(cr,ur,kr)}function Gr(ke,Ye,pt){ke=Jr(ke),Ye=Jr(Ye),pt=Jr(pt);var Lt=Va((.4124564*ke+.3575761*Ye+.1804375*pt)/gn),Rt=Va((.2126729*ke+.7151522*Ye+.072175*pt)/Mn),jt=Va((.0193339*ke+.119192*Ye+.9503041*pt)/In);return _r(116*Rt-16,500*(Lt-Rt),200*(Rt-jt))}function Jr(ke){return(ke/=255)<=.04045?ke/12.92:Math.pow((ke+.055)/1.055,2.4)}function yn(ke){var Ye=parseFloat(ke);return ke.charAt(ke.length-1)==="%"?Math.round(Ye*2.55):Ye}var cn=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});cn.forEach(function(ke,Ye){cn.set(ke,Oi(Ye))});function Dt(ke){return typeof ke=="function"?ke:function(){return ke}}h.functor=Dt,h.xhr=yr(N);function yr(ke){return function(Ye,pt,Lt){return arguments.length===2&&typeof pt=="function"&&(Lt=pt,pt=null),Hr(Ye,pt,ke,Lt)}}function Hr(ke,Ye,pt,Lt){var Rt={},jt=h.dispatch("beforesend","progress","load","error"),cr={},ur=new XMLHttpRequest,kr=null;self.XDomainRequest&&!("withCredentials"in ur)&&/^(http(s)?:)?\/\//.test(ke)&&(ur=new XDomainRequest),"onload"in ur?ur.onload=ur.onerror=on:ur.onreadystatechange=function(){ur.readyState>3&&on()};function on(){var nn=ur.status,wn;if(!nn&&Hn(ur)||nn>=200&&nn<300||nn===304){try{wn=pt.call(Rt,ur)}catch(Rn){jt.error.call(Rt,Rn);return}jt.load.call(Rt,wn)}else jt.error.call(Rt,ur)}return ur.onprogress=function(nn){var wn=h.event;h.event=nn;try{jt.progress.call(Rt,ur)}finally{h.event=wn}},Rt.header=function(nn,wn){return nn=(nn+"").toLowerCase(),arguments.length<2?cr[nn]:(wn==null?delete cr[nn]:cr[nn]=wn+"",Rt)},Rt.mimeType=function(nn){return arguments.length?(Ye=nn==null?null:nn+"",Rt):Ye},Rt.responseType=function(nn){return arguments.length?(kr=nn,Rt):kr},Rt.response=function(nn){return pt=nn,Rt},["get","post"].forEach(function(nn){Rt[nn]=function(){return Rt.send.apply(Rt,[nn].concat(S(arguments)))}}),Rt.send=function(nn,wn,Rn){if(arguments.length===2&&typeof wn=="function"&&(Rn=wn,wn=null),ur.open(nn,ke,!0),Ye!=null&&!("accept"in cr)&&(cr.accept=Ye+",*/*"),ur.setRequestHeader)for(var Nn in cr)ur.setRequestHeader(Nn,cr[Nn]);return Ye!=null&&ur.overrideMimeType&&ur.overrideMimeType(Ye),kr!=null&&(ur.responseType=kr),Rn!=null&&Rt.on("error",Rn).on("load",function(qa){Rn(null,qa)}),jt.beforesend.call(Rt,ur),ur.send(wn??null),Rt},Rt.abort=function(){return ur.abort(),Rt},h.rebind(Rt,jt,"on"),Lt==null?Rt:Rt.get(_n(Lt))}function _n(ke){return ke.length===1?function(Ye,pt){ke(Ye==null?pt:null)}:ke}function Hn(ke){var Ye=ke.responseType;return Ye&&Ye!=="text"?ke.response:ke.responseText}h.dsv=function(ke,Ye){var pt=new RegExp('["'+ke+` ]`),Lt=ke.charCodeAt(0);function Rt(on,nn,wn){arguments.length<3&&(wn=nn,nn=null);var Rn=Hr(on,Ye,nn==null?jt:cr(nn),wn);return Rn.row=function(Nn){return arguments.length?Rn.response((nn=Nn)==null?jt:cr(Nn)):nn},Rn}function jt(on){return Rt.parse(on.responseText)}function cr(on){return function(nn){return Rt.parse(nn.responseText,on)}}Rt.parse=function(on,nn){var wn;return Rt.parseRows(on,function(Rn,Nn){if(wn)return wn(Rn,Nn-1);var qa=function(Yn){for(var ha={},xa=Rn.length,Ba=0;Ba=qa)return Rn;if(Ba)return Ba=!1,wn;var gi=Yn;if(on.charCodeAt(gi)===34){for(var to=gi;to++24?(isFinite(Ye)&&(clearTimeout($n),$n=setTimeout(Fi,Ye)),bn=0):(bn=1,ki(Fi))}h.timer.flush=function(){Ji(),fo()};function Ji(){for(var ke=Date.now(),Ye=ea;Ye;)ke>=Ye.t&&Ye.c(ke-Ye.t)&&(Ye.c=null),Ye=Ye.n;return ke}function fo(){for(var ke,Ye=ea,pt=1/0;Ye;)Ye.c?(Ye.t=0;--ur)Yn.push(Rt[on[wn[ur]][2]]);for(ur=+Nn;ur1&&Nt(ke[pt[Lt-2]],ke[pt[Lt-1]],ke[Rt])<=0;)--Lt;pt[Lt++]=Rt}return pt.slice(0,Lt)}function ts(ke,Ye){return ke[0]-Ye[0]||ke[1]-Ye[1]}h.geom.polygon=function(ke){return W(ke,jo),ke};var jo=h.geom.polygon.prototype=[];jo.area=function(){for(var ke=-1,Ye=this.length,pt,Lt=this[Ye-1],Rt=0;++kect)ur=ur.L;else if(cr=Ye-uo(ur,pt),cr>ct){if(!ur.R){Lt=ur;break}ur=ur.R}else{jt>-ct?(Lt=ur.P,Rt=ur):cr>-ct?(Lt=ur,Rt=ur.N):Lt=Rt=ur;break}var kr=nl(ke);if(Ns.insert(Lt,kr),!(!Lt&&!Rt)){if(Lt===Rt){al(Lt),Rt=nl(Lt.site),Ns.insert(kr,Rt),kr.edge=Rt.edge=Bl(Lt.site,kr.site),qs(Lt),qs(Rt);return}if(!Rt){kr.edge=Bl(Lt.site,kr.site);return}al(Lt),al(Rt);var on=Lt.site,nn=on.x,wn=on.y,Rn=ke.x-nn,Nn=ke.y-wn,qa=Rt.site,Yn=qa.x-nn,ha=qa.y-wn,xa=2*(Rn*ha-Nn*Yn),Ba=Rn*Rn+Nn*Nn,Ha=Yn*Yn+ha*ha,_a={x:(ha*Ba-Nn*Ha)/xa+nn,y:(Rn*Ha-Yn*Ba)/xa+wn};Lo(Rt.edge,on,qa,_a),kr.edge=Bl(on,ke,null,_a),Rt.edge=Bl(ke,qa,null,_a),qs(Lt),qs(Rt)}}function Ai(ke,Ye){var pt=ke.site,Lt=pt.x,Rt=pt.y,jt=Rt-Ye;if(!jt)return Lt;var cr=ke.P;if(!cr)return-1/0;pt=cr.site;var ur=pt.x,kr=pt.y,on=kr-Ye;if(!on)return ur;var nn=ur-Lt,wn=1/jt-1/on,Rn=nn/on;return wn?(-Rn+Math.sqrt(Rn*Rn-2*wn*(nn*nn/(-2*on)-kr+on/2+Rt-jt/2)))/wn+Lt:(Lt+ur)/2}function uo(ke,Ye){var pt=ke.N;if(pt)return Ai(pt,Ye);var Lt=ke.site;return Lt.y===Ye?Lt.x:1/0}function Tl(ke){this.site=ke,this.edges=[]}Tl.prototype.prepare=function(){for(var ke=this.edges,Ye=ke.length,pt;Ye--;)pt=ke[Ye].edge,(!pt.b||!pt.a)&&ke.splice(Ye,1);return ke.sort(Ro),ke.length};function Cs(ke){for(var Ye=ke[0][0],pt=ke[1][0],Lt=ke[0][1],Rt=ke[1][1],jt,cr,ur,kr,on=Vs,nn=on.length,wn,Rn,Nn,qa,Yn,ha;nn--;)if(wn=on[nn],!(!wn||!wn.prepare()))for(Nn=wn.edges,qa=Nn.length,Rn=0;Rnct||l(kr-cr)>ct)&&(Nn.splice(Rn,0,new tu(Ul(wn.site,ha,l(ur-Ye)ct?{x:Ye,y:l(jt-Ye)ct?{x:l(cr-Rt)ct?{x:pt,y:l(jt-pt)ct?{x:l(cr-Lt)=-Ue)){var Rn=kr*kr+on*on,Nn=nn*nn+ha*ha,qa=(ha*Rn-on*Nn)/wn,Yn=(kr*Nn-nn*Rn)/wn,ha=Yn+ur,xa=yo.pop()||new El;xa.arc=ke,xa.site=Rt,xa.x=qa+cr,xa.y=ha+Math.sqrt(qa*qa+Yn*Yn),xa.cy=ha,ke.circle=xa;for(var Ba=null,Ha=$o._;Ha;)if(xa.y0)){if(Yn/=Nn,Nn<0){if(Yn0){if(Yn>Rn)return;Yn>wn&&(wn=Yn)}if(Yn=pt-ur,!(!Nn&&Yn<0)){if(Yn/=Nn,Nn<0){if(Yn>Rn)return;Yn>wn&&(wn=Yn)}else if(Nn>0){if(Yn0)){if(Yn/=qa,qa<0){if(Yn0){if(Yn>Rn)return;Yn>wn&&(wn=Yn)}if(Yn=Lt-kr,!(!qa&&Yn<0)){if(Yn/=qa,qa<0){if(Yn>Rn)return;Yn>wn&&(wn=Yn)}else if(qa>0){if(Yn0&&(Rt.a={x:ur+wn*Nn,y:kr+wn*qa}),Rn<1&&(Rt.b={x:ur+Rn*Nn,y:kr+Rn*qa}),Rt}}}}}}function io(ke){for(var Ye=No,pt=mu(ke[0][0],ke[0][1],ke[1][0],ke[1][1]),Lt=Ye.length,Rt;Lt--;)Rt=Ye[Lt],(!vs(Rt,ke)||!pt(Rt)||l(Rt.a.x-Rt.b.x)=jt)return;if(nn>Rn){if(!Lt)Lt={x:qa,y:cr};else if(Lt.y>=ur)return;pt={x:qa,y:ur}}else{if(!Lt)Lt={x:qa,y:ur};else if(Lt.y1)if(nn>Rn){if(!Lt)Lt={x:(cr-xa)/ha,y:cr};else if(Lt.y>=ur)return;pt={x:(ur-xa)/ha,y:ur}}else{if(!Lt)Lt={x:(ur-xa)/ha,y:ur};else if(Lt.y=jt)return;pt={x:jt,y:ha*jt+xa}}else{if(!Lt)Lt={x:jt,y:ha*jt+xa};else if(Lt.x=nn&&xa.x<=Rn&&xa.y>=wn&&xa.y<=Nn?[[nn,Nn],[Rn,Nn],[Rn,wn],[nn,wn]]:[];Ba.point=kr[Yn]}),on}function ur(kr){return kr.map(function(on,nn){return{x:Math.round(Lt(on,nn)/ct)*ct,y:Math.round(Rt(on,nn)/ct)*ct,i:nn}})}return cr.links=function(kr){return Ou(ur(kr)).edges.filter(function(on){return on.l&&on.r}).map(function(on){return{source:kr[on.l.i],target:kr[on.r.i]}})},cr.triangles=function(kr){var on=[];return Ou(ur(kr)).cells.forEach(function(nn,wn){for(var Rn=nn.site,Nn=nn.edges.sort(Ro),qa=-1,Yn=Nn.length,ha,xa=Nn[Yn-1].edge,Ba=xa.l===Rn?xa.r:xa.l;++qaHa&&(Ha=nn.x),nn.y>_a&&(_a=nn.y),Nn.push(nn.x),qa.push(nn.y);else for(Yn=0;YnHa&&(Ha=gi),to>_a&&(_a=to),Nn.push(gi),qa.push(to)}var Vi=Ha-xa,Zi=_a-Ba;Vi>Zi?_a=Ba+Vi:Ha=xa+Zi;function xo(Po,os,Js,Eu,Yl,ho,ks,Ys){if(!(isNaN(Js)||isNaN(Eu)))if(Po.leaf){var ql=Po.x,Pl=Po.y;if(ql!=null)if(l(ql-Js)+l(Pl-Eu)<.01)Mo(Po,os,Js,Eu,Yl,ho,ks,Ys);else{var fc=Po.point;Po.x=Po.y=Po.point=null,Mo(Po,fc,ql,Pl,Yl,ho,ks,Ys),Mo(Po,os,Js,Eu,Yl,ho,ks,Ys)}else Po.x=Js,Po.y=Eu,Po.point=os}else Mo(Po,os,Js,Eu,Yl,ho,ks,Ys)}function Mo(Po,os,Js,Eu,Yl,ho,ks,Ys){var ql=(Yl+ks)*.5,Pl=(ho+Ys)*.5,fc=Js>=ql,bl=Eu>=Pl,Gl=bl<<1|fc;Po.leaf=!1,Po=Po.nodes[Gl]||(Po.nodes[Gl]=ml()),fc?Yl=ql:ks=ql,bl?ho=Pl:Ys=Pl,xo(Po,os,Js,Eu,Yl,ho,ks,Ys)}var Gs=ml();if(Gs.add=function(Po){xo(Gs,Po,+wn(Po,++Yn),+Rn(Po,Yn),xa,Ba,Ha,_a)},Gs.visit=function(Po){vc(Po,Gs,xa,Ba,Ha,_a)},Gs.find=function(Po){return nh(Gs,Po[0],Po[1],xa,Ba,Ha,_a)},Yn=-1,Ye==null){for(;++Ynjt||Rn>cr||Nn=gi,Zi=pt>=to,xo=Zi<<1|Vi,Mo=xo+4;xopt&&(jt=Ye.slice(pt,jt),ur[cr]?ur[cr]+=jt:ur[++cr]=jt),(Lt=Lt[0])===(Rt=Rt[0])?ur[cr]?ur[cr]+=Rt:ur[++cr]=Rt:(ur[++cr]=null,kr.push({i:cr,x:Hu(Lt,Rt)})),pt=Fu.lastIndex;return pt=0&&!(Lt=h.interpolators[pt](ke,Ye)););return Lt}h.interpolators=[function(ke,Ye){var pt=typeof Ye;return(pt==="string"?cn.has(Ye.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Ye)?Gu:Rc:Ye instanceof ma?Gu:Array.isArray(Ye)?kl:pt==="object"&&isNaN(Ye)?zu:Hu)(ke,Ye)}],h.interpolateArray=kl;function kl(ke,Ye){var pt=[],Lt=[],Rt=ke.length,jt=Ye.length,cr=Math.min(ke.length,Ye.length),ur;for(ur=0;ur=0?ke.slice(0,Ye):ke,Lt=Ye>=0?ke.slice(Ye+1):"in";return pt=lc.get(pt)||rf,Lt=df.get(Lt)||N,ru(Lt(pt.apply(null,x.call(arguments,1))))};function ru(ke){return function(Ye){return Ye<=0?0:Ye>=1?1:ke(Ye)}}function Rh(ke){return function(Ye){return 1-ke(1-Ye)}}function Rs(ke){return function(Ye){return .5*(Ye<.5?ke(2*Ye):2-ke(2-2*Ye))}}function Yh(ke){return ke*ke}function ul(ke){return ke*ke*ke}function Do(ke){if(ke<=0)return 0;if(ke>=1)return 1;var Ye=ke*ke,pt=Ye*ke;return 4*(ke<.5?pt:3*(ke-Ye)+pt-.75)}function kf(ke){return function(Ye){return Math.pow(Ye,ke)}}function Oc(ke){return 1-Math.cos(ke*at)}function Cu(ke){return Math.pow(2,10*(ke-1))}function ah(ke){return 1-Math.sqrt(1-ke*ke)}function pf(ke,Ye){var pt;return arguments.length<2&&(Ye=.45),arguments.length?pt=Ye/Pe*Math.asin(1/ke):(ke=1,pt=Ye/4),function(Lt){return 1+ke*Math.pow(2,-10*Lt)*Math.sin((Lt-pt)*Pe/Ye)}}function Nf(ke){return ke||(ke=1.70158),function(Ye){return Ye*Ye*((ke+1)*Ye-ke)}}function Nu(ke){return ke<1/2.75?7.5625*ke*ke:ke<2/2.75?7.5625*(ke-=1.5/2.75)*ke+.75:ke<2.5/2.75?7.5625*(ke-=2.25/2.75)*ke+.9375:7.5625*(ke-=2.625/2.75)*ke+.984375}h.interpolateHcl=Eh;function Eh(ke,Ye){ke=h.hcl(ke),Ye=h.hcl(Ye);var pt=ke.h,Lt=ke.c,Rt=ke.l,jt=Ye.h-pt,cr=Ye.c-Lt,ur=Ye.l-Rt;return isNaN(cr)&&(cr=0,Lt=isNaN(Lt)?Ye.c:Lt),isNaN(jt)?(jt=0,pt=isNaN(pt)?Ye.h:pt):jt>180?jt-=360:jt<-180&&(jt+=360),function(kr){return vr(pt+jt*kr,Lt+cr*kr,Rt+ur*kr)+""}}h.interpolateHsl=fh;function fh(ke,Ye){ke=h.hsl(ke),Ye=h.hsl(Ye);var pt=ke.h,Lt=ke.s,Rt=ke.l,jt=Ye.h-pt,cr=Ye.s-Lt,ur=Ye.l-Rt;return isNaN(cr)&&(cr=0,Lt=isNaN(Lt)?Ye.s:Lt),isNaN(jt)?(jt=0,pt=isNaN(pt)?Ye.h:pt):jt>180?jt-=360:jt<-180&&(jt+=360),function(kr){return ti(pt+jt*kr,Lt+cr*kr,Rt+ur*kr)+""}}h.interpolateLab=Bf;function Bf(ke,Ye){ke=h.lab(ke),Ye=h.lab(Ye);var pt=ke.l,Lt=ke.a,Rt=ke.b,jt=Ye.l-pt,cr=Ye.a-Lt,ur=Ye.b-Rt;return function(kr){return Ca(pt+jt*kr,Lt+cr*kr,Rt+ur*kr)+""}}h.interpolateRound=vf;function vf(ke,Ye){return Ye-=ke,function(pt){return Math.round(ke+Ye*pt)}}h.transform=function(ke){var Ye=k.createElementNS(h.ns.prefix.svg,"g");return(h.transform=function(pt){if(pt!=null){Ye.setAttribute("transform",pt);var Lt=Ye.transform.baseVal.consolidate()}return new ih(Lt?Lt.matrix:nf)})(ke)};function ih(ke){var Ye=[ke.a,ke.b],pt=[ke.c,ke.d],Lt=zc(Ye),Rt=oh(Ye,pt),jt=zc(hh(pt,Ye,-Rt))||0;Ye[0]*pt[1]180?Ye+=360:Ye-ke>180&&(ke+=360),Lt.push({i:pt.push(Gc(pt)+"rotate(",null,")")-2,x:Hu(ke,Ye)})):Ye&&pt.push(Gc(pt)+"rotate("+Ye+")")}function sh(ke,Ye,pt,Lt){ke!==Ye?Lt.push({i:pt.push(Gc(pt)+"skewX(",null,")")-2,x:Hu(ke,Ye)}):Ye&&pt.push(Gc(pt)+"skewX("+Ye+")")}function Dl(ke,Ye,pt,Lt){if(ke[0]!==Ye[0]||ke[1]!==Ye[1]){var Rt=pt.push(Gc(pt)+"scale(",null,",",null,")");Lt.push({i:Rt-4,x:Hu(ke[0],Ye[0])},{i:Rt-2,x:Hu(ke[1],Ye[1])})}else(Ye[0]!==1||Ye[1]!==1)&&pt.push(Gc(pt)+"scale("+Ye+")")}function $f(ke,Ye){var pt=[],Lt=[];return ke=h.transform(ke),Ye=h.transform(Ye),Bu(ke.translate,Ye.translate,pt,Lt),Af(ke.rotate,Ye.rotate,pt,Lt),sh(ke.skew,Ye.skew,pt,Lt),Dl(ke.scale,Ye.scale,pt,Lt),ke=Ye=null,function(Rt){for(var jt=-1,cr=Lt.length,ur;++jt0?jt=_a:(pt.c=null,pt.t=NaN,pt=null,Ye.end({type:"end",alpha:jt=0})):_a>0&&(Ye.start({type:"start",alpha:jt=_a}),pt=Ua(ke.tick)),ke):jt},ke.start=function(){var _a,gi=Nn.length,to=qa.length,Vi=Lt[0],Zi=Lt[1],xo,Mo;for(_a=0;_a=0;)jt.push(nn=on[kr]),nn.parent=ur,nn.depth=ur.depth+1;pt&&(ur.value=0),ur.children=on}else pt&&(ur.value=+pt.call(Lt,ur,ur.depth)||0),delete ur.children;return Hc(Rt,function(wn){var Rn,Nn;ke&&(Rn=wn.children)&&Rn.sort(ke),pt&&(Nn=wn.parent)&&(Nn.value+=wn.value)}),cr}return Lt.sort=function(Rt){return arguments.length?(ke=Rt,Lt):ke},Lt.children=function(Rt){return arguments.length?(Ye=Rt,Lt):Ye},Lt.value=function(Rt){return arguments.length?(pt=Rt,Lt):pt},Lt.revalue=function(Rt){return pt&&(Cf(Rt,function(jt){jt.children&&(jt.value=0)}),Hc(Rt,function(jt){var cr;jt.children||(jt.value=+pt.call(Lt,jt,jt.depth)||0),(cr=jt.parent)&&(cr.value+=jt.value)})),Rt},Lt};function nu(ke,Ye){return h.rebind(ke,Ye,"sort","children","value"),ke.nodes=ke,ke.links=td,ke}function Cf(ke,Ye){for(var pt=[ke];(ke=pt.pop())!=null;)if(Ye(ke),(Rt=ke.children)&&(Lt=Rt.length))for(var Lt,Rt;--Lt>=0;)pt.push(Rt[Lt])}function Hc(ke,Ye){for(var pt=[ke],Lt=[];(ke=pt.pop())!=null;)if(Lt.push(ke),(cr=ke.children)&&(jt=cr.length))for(var Rt=-1,jt,cr;++RtRt&&(Rt=ur),Lt.push(ur)}for(cr=0;crLt&&(pt=Ye,Lt=Rt);return pt}function _c(ke){return ke.reduce(Fc,0)}function Fc(ke,Ye){return ke+Ye[1]}h.layout.histogram=function(){var ke=!0,Ye=Number,pt=jf,Lt=lh;function Rt(jt,Rn){for(var ur=[],kr=jt.map(Ye,this),on=pt.call(this,kr,Rn),nn=Lt.call(this,on,kr,Rn),wn,Rn=-1,Nn=kr.length,qa=nn.length-1,Yn=ke?1:1/Nn,ha;++Rn0)for(Rn=-1;++Rn=on[0]&&ha<=on[1]&&(wn=ur[h.bisect(nn,ha,1,qa)-1],wn.y+=Yn,wn.push(jt[Rn]));return ur}return Rt.value=function(jt){return arguments.length?(Ye=jt,Rt):Ye},Rt.range=function(jt){return arguments.length?(pt=Dt(jt),Rt):pt},Rt.bins=function(jt){return arguments.length?(Lt=typeof jt=="number"?function(cr){return eu(cr,jt)}:Dt(jt),Rt):Lt},Rt.frequency=function(jt){return arguments.length?(ke=!!jt,Rt):ke},Rt};function lh(ke,Ye){return eu(ke,Math.ceil(Math.log(Ye.length)/Math.LN2+1))}function eu(ke,Ye){for(var pt=-1,Lt=+ke[0],Rt=(ke[1]-Lt)/Ye,jt=[];++pt<=Ye;)jt[pt]=Rt*pt+Lt;return jt}function jf(ke){return[h.min(ke),h.max(ke)]}h.layout.pack=function(){var ke=h.layout.hierarchy().sort(yf),Ye=0,pt=[1,1],Lt;function Rt(jt,cr){var ur=ke.call(this,jt,cr),kr=ur[0],on=pt[0],nn=pt[1],wn=Lt==null?Math.sqrt:typeof Lt=="function"?Lt:function(){return Lt};if(kr.x=kr.y=0,Hc(kr,function(Nn){Nn.r=+wn(Nn.value)}),Hc(kr,qf),Ye){var Rn=Ye*(Lt?1:Math.max(2*kr.r/on,2*kr.r/nn))/2;Hc(kr,function(Nn){Nn.r+=Rn}),Hc(kr,qf),Hc(kr,function(Nn){Nn.r-=Rn})}return gh(kr,on/2,nn/2,Lt?1:1/Math.max(2*kr.r/on,2*kr.r/nn)),ur}return Rt.size=function(jt){return arguments.length?(pt=jt,Rt):pt},Rt.radius=function(jt){return arguments.length?(Lt=jt==null||typeof jt=="function"?jt:+jt,Rt):Lt},Rt.padding=function(jt){return arguments.length?(Ye=+jt,Rt):Ye},nu(Rt,ke)};function yf(ke,Ye){return ke.value-Ye.value}function kc(ke,Ye){var pt=ke._pack_next;ke._pack_next=Ye,Ye._pack_prev=ke,Ye._pack_next=pt,pt._pack_prev=Ye}function Vf(ke,Ye){ke._pack_next=Ye,Ye._pack_prev=ke}function $c(ke,Ye){var pt=Ye.x-ke.x,Lt=Ye.y-ke.y,Rt=ke.r+Ye.r;return .999*Rt*Rt>pt*pt+Lt*Lt}function qf(ke){if(!(Ye=ke.children)||!(Rn=Ye.length))return;var Ye,pt=1/0,Lt=-1/0,Rt=1/0,jt=-1/0,cr,ur,kr,on,nn,wn,Rn;function Nn(_a){pt=Math.min(_a.x-_a.r,pt),Lt=Math.max(_a.x+_a.r,Lt),Rt=Math.min(_a.y-_a.r,Rt),jt=Math.max(_a.y+_a.r,jt)}if(Ye.forEach(Fh),cr=Ye[0],cr.x=-cr.r,cr.y=0,Nn(cr),Rn>1&&(ur=Ye[1],ur.x=ur.r,ur.y=0,Nn(ur),Rn>2))for(kr=Ye[2],Cc(cr,ur,kr),Nn(kr),kc(cr,kr),cr._pack_prev=kr,kc(kr,ur),ur=cr._pack_next,on=3;onha.x&&(ha=gi),gi.depth>xa.depth&&(xa=gi)});var Ba=Ye(Yn,ha)/2-Yn.x,Ha=pt[0]/(ha.x+Ye(ha,Yn)/2+Ba),_a=pt[1]/(xa.depth||1);Cf(Nn,function(gi){gi.x=(gi.x+Ba)*Ha,gi.y=gi.depth*_a})}return Rn}function jt(nn){for(var wn={A:null,children:[nn]},Rn=[wn],Nn;(Nn=Rn.pop())!=null;)for(var qa=Nn.children,Yn,ha=0,xa=qa.length;ha0&&(uc(_f(Yn,nn,Rn),nn,gi),xa+=gi,Ba+=gi),Ha+=Yn.m,xa+=Nn.m,_a+=ha.m,Ba+=qa.m;Yn&&!gu(qa)&&(qa.t=Yn,qa.m+=Ha-Ba),Nn&&!Wc(ha)&&(ha.t=Nn,ha.m+=xa-_a,Rn=nn)}return Rn}function on(nn){nn.x*=pt[0],nn.y=nn.depth*pt[1]}return Rt.separation=function(nn){return arguments.length?(Ye=nn,Rt):Ye},Rt.size=function(nn){return arguments.length?(Lt=(pt=nn)==null?on:null,Rt):Lt?null:pt},Rt.nodeSize=function(nn){return arguments.length?(Lt=(pt=nn)==null?null:on,Rt):Lt?pt:null},nu(Rt,ke)};function of(ke,Ye){return ke.parent==Ye.parent?1:2}function Wc(ke){var Ye=ke.children;return Ye.length?Ye[0]:ke.t}function gu(ke){var Ye=ke.children,pt;return(pt=Ye.length)?Ye[pt-1]:ke.t}function uc(ke,Ye,pt){var Lt=pt/(Ye.i-ke.i);Ye.c-=Lt,Ye.s+=pt,ke.c+=Lt,Ye.z+=pt,Ye.m+=pt}function lu(ke){for(var Ye=0,pt=0,Lt=ke.children,Rt=Lt.length,jt;--Rt>=0;)jt=Lt[Rt],jt.z+=Ye,jt.m+=Ye,Ye+=jt.s+(pt+=jt.c)}function _f(ke,Ye,pt){return ke.a.parent===Ye.parent?ke.a:pt}h.layout.cluster=function(){var ke=h.layout.hierarchy().sort(null).value(null),Ye=of,pt=[1,1],Lt=!1;function Rt(jt,cr){var ur=ke.call(this,jt,cr),kr=ur[0],on,nn=0;Hc(kr,function(Yn){var ha=Yn.children;ha&&ha.length?(Yn.x=uh(ha),Yn.y=Yc(ha)):(Yn.x=on?nn+=Ye(Yn,on):0,Yn.y=0,on=Yn)});var wn=br(kr),Rn=qr(kr),Nn=wn.x-Ye(wn,Rn)/2,qa=Rn.x+Ye(Rn,wn)/2;return Hc(kr,Lt?function(Yn){Yn.x=(Yn.x-kr.x)*pt[0],Yn.y=(kr.y-Yn.y)*pt[1]}:function(Yn){Yn.x=(Yn.x-Nn)/(qa-Nn)*pt[0],Yn.y=(1-(kr.y?Yn.y/kr.y:1))*pt[1]}),ur}return Rt.separation=function(jt){return arguments.length?(Ye=jt,Rt):Ye},Rt.size=function(jt){return arguments.length?(Lt=(pt=jt)==null,Rt):Lt?null:pt},Rt.nodeSize=function(jt){return arguments.length?(Lt=(pt=jt)!=null,Rt):Lt?pt:null},nu(Rt,ke)};function Yc(ke){return 1+h.max(ke,function(Ye){return Ye.y})}function uh(ke){return ke.reduce(function(Ye,pt){return Ye+pt.x},0)/ke.length}function br(ke){var Ye=ke.children;return Ye&&Ye.length?br(Ye[0]):ke}function qr(ke){var Ye=ke.children,pt;return Ye&&(pt=Ye.length)?qr(Ye[pt-1]):ke}h.layout.treemap=function(){var ke=h.layout.hierarchy(),Ye=Math.round,pt=[1,1],Lt=null,Rt=An,jt=!1,cr,ur="squarify",kr=.5*(1+Math.sqrt(5));function on(Yn,ha){for(var xa=-1,Ba=Yn.length,Ha,_a;++xa0;)Ba.push(_a=Ha[Zi-1]),Ba.area+=_a.area,ur!=="squarify"||(to=Rn(Ba,Vi))<=gi?(Ha.pop(),gi=to):(Ba.area-=Ba.pop().area,Nn(Ba,Vi,xa,!1),Vi=Math.min(xa.dx,xa.dy),Ba.length=Ba.area=0,gi=1/0);Ba.length&&(Nn(Ba,Vi,xa,!0),Ba.length=Ba.area=0),ha.forEach(nn)}}function wn(Yn){var ha=Yn.children;if(ha&&ha.length){var xa=Rt(Yn),Ba=ha.slice(),Ha,_a=[];for(on(Ba,xa.dx*xa.dy/Yn.value),_a.area=0;Ha=Ba.pop();)_a.push(Ha),_a.area+=Ha.area,Ha.z!=null&&(Nn(_a,Ha.z?xa.dx:xa.dy,xa,!Ba.length),_a.length=_a.area=0);ha.forEach(wn)}}function Rn(Yn,ha){for(var xa=Yn.area,Ba,Ha=0,_a=1/0,gi=-1,to=Yn.length;++giHa&&(Ha=Ba));return xa*=xa,ha*=ha,xa?Math.max(ha*Ha*kr/xa,xa/(ha*_a*kr)):1/0}function Nn(Yn,ha,xa,Ba){var Ha=-1,_a=Yn.length,gi=xa.x,to=xa.y,Vi=ha?Ye(Yn.area/ha):0,Zi;if(ha==xa.dx){for((Ba||Vi>xa.dy)&&(Vi=xa.dy);++Ha<_a;)Zi=Yn[Ha],Zi.x=gi,Zi.y=to,Zi.dy=Vi,gi+=Zi.dx=Math.min(xa.x+xa.dx-gi,Vi?Ye(Zi.area/Vi):0);Zi.z=!0,Zi.dx+=xa.x+xa.dx-gi,xa.y+=Vi,xa.dy-=Vi}else{for((Ba||Vi>xa.dx)&&(Vi=xa.dx);++Ha<_a;)Zi=Yn[Ha],Zi.x=gi,Zi.y=to,Zi.dx=Vi,to+=Zi.dy=Math.min(xa.y+xa.dy-to,Vi?Ye(Zi.area/Vi):0);Zi.z=!1,Zi.dy+=xa.y+xa.dy-to,xa.x+=Vi,xa.dx-=Vi}}function qa(Yn){var ha=cr||ke(Yn),xa=ha[0];return xa.x=xa.y=0,xa.value?(xa.dx=pt[0],xa.dy=pt[1]):xa.dx=xa.dy=0,cr&&ke.revalue(xa),on([xa],xa.dx*xa.dy/xa.value),(cr?wn:nn)(xa),jt&&(cr=ha),ha}return qa.size=function(Yn){return arguments.length?(pt=Yn,qa):pt},qa.padding=function(Yn){if(!arguments.length)return Lt;function ha(Ha){var _a=Yn.call(qa,Ha,Ha.depth);return _a==null?An(Ha):vn(Ha,typeof _a=="number"?[_a,_a,_a,_a]:_a)}function xa(Ha){return vn(Ha,Yn)}var Ba;return Rt=(Lt=Yn)==null?An:(Ba=typeof Yn)=="function"?ha:(Ba==="number"&&(Yn=[Yn,Yn,Yn,Yn]),xa),qa},qa.round=function(Yn){return arguments.length?(Ye=Yn?Math.round:Number,qa):Ye!=Number},qa.sticky=function(Yn){return arguments.length?(jt=Yn,cr=null,qa):jt},qa.ratio=function(Yn){return arguments.length?(kr=Yn,qa):kr},qa.mode=function(Yn){return arguments.length?(ur=Yn+"",qa):ur},nu(qa,ke)};function An(ke){return{x:ke.x,y:ke.y,dx:ke.dx,dy:ke.dy}}function vn(ke,Ye){var pt=ke.x+Ye[3],Lt=ke.y+Ye[0],Rt=ke.dx-Ye[1]-Ye[3],jt=ke.dy-Ye[0]-Ye[2];return Rt<0&&(pt+=Rt/2,Rt=0),jt<0&&(Lt+=jt/2,jt=0),{x:pt,y:Lt,dx:Rt,dy:jt}}h.random={normal:function(ke,Ye){var pt=arguments.length;return pt<2&&(Ye=1),pt<1&&(ke=0),function(){var Lt,Rt,jt;do Lt=Math.random()*2-1,Rt=Math.random()*2-1,jt=Lt*Lt+Rt*Rt;while(!jt||jt>1);return ke+Ye*Lt*Math.sqrt(-2*Math.log(jt)/jt)}},logNormal:function(){var ke=h.random.normal.apply(h,arguments);return function(){return Math.exp(ke())}},bates:function(ke){var Ye=h.random.irwinHall(ke);return function(){return Ye()/ke}},irwinHall:function(ke){return function(){for(var Ye=0,pt=0;pt2?ni:Ra,on=Lt?dh:Oh;return Rt=kr(ke,Ye,on,pt),jt=kr(Ye,ke,on,Bs),ur}function ur(kr){return Rt(kr)}return ur.invert=function(kr){return jt(kr)},ur.domain=function(kr){return arguments.length?(ke=kr.map(Number),cr()):ke},ur.range=function(kr){return arguments.length?(Ye=kr,cr()):Ye},ur.rangeRound=function(kr){return ur.range(kr).interpolate(vf)},ur.clamp=function(kr){return arguments.length?(Lt=kr,cr()):Lt},ur.interpolate=function(kr){return arguments.length?(pt=kr,cr()):pt},ur.ticks=function(kr){return zo(ke,kr)},ur.tickFormat=function(kr,on){return d3_scale_linearTickFormat(ke,kr,on)},ur.nice=function(kr){return Ja(ke,kr),cr()},ur.copy=function(){return Ii(ke,Ye,pt,Lt)},cr()}function hi(ke,Ye){return h.rebind(ke,Ye,"range","rangeRound","interpolate","clamp")}function Ja(ke,Ye){return pi(ke,xi(eo(ke,Ye)[2])),pi(ke,xi(eo(ke,Ye)[2])),ke}function eo(ke,Ye){Ye==null&&(Ye=10);var pt=Xn(ke),Lt=pt[1]-pt[0],Rt=Math.pow(10,Math.floor(Math.log(Lt/Ye)/Math.LN10)),jt=Ye/Lt*Rt;return jt<=.15?Rt*=10:jt<=.35?Rt*=5:jt<=.75&&(Rt*=2),pt[0]=Math.ceil(pt[0]/Rt)*Rt,pt[1]=Math.floor(pt[1]/Rt)*Rt+Rt*.5,pt[2]=Rt,pt}function zo(ke,Ye){return h.range.apply(h,eo(ke,Ye))}h.scale.log=function(){return Io(h.scale.linear().domain([0,1]),10,!0,[1,10])};function Io(ke,Ye,pt,Lt){function Rt(ur){return(pt?Math.log(ur<0?0:ur):-Math.log(ur>0?0:-ur))/Math.log(Ye)}function jt(ur){return pt?Math.pow(Ye,ur):-Math.pow(Ye,-ur)}function cr(ur){return ke(Rt(ur))}return cr.invert=function(ur){return jt(ke.invert(ur))},cr.domain=function(ur){return arguments.length?(pt=ur[0]>=0,ke.domain((Lt=ur.map(Number)).map(Rt)),cr):Lt},cr.base=function(ur){return arguments.length?(Ye=+ur,ke.domain(Lt.map(Rt)),cr):Ye},cr.nice=function(){var ur=pi(Lt.map(Rt),pt?Math:Vo);return ke.domain(ur),Lt=ur.map(jt),cr},cr.ticks=function(){var ur=Xn(Lt),kr=[],on=ur[0],nn=ur[1],wn=Math.floor(Rt(on)),Rn=Math.ceil(Rt(nn)),Nn=Ye%1?2:Ye;if(isFinite(Rn-wn)){if(pt){for(;wn0;qa--)kr.push(jt(wn)*qa);for(wn=0;kr[wn]nn;Rn--);kr=kr.slice(wn,Rn)}return kr},cr.copy=function(){return Io(ke.copy(),Ye,pt,Lt)},hi(cr,ke)}var Vo={floor:function(ke){return-Math.ceil(-ke)},ceil:function(ke){return-Math.floor(-ke)}};h.scale.pow=function(){return Bo(h.scale.linear(),1,[0,1])};function Bo(ke,Ye,pt){var Lt=ro(Ye),Rt=ro(1/Ye);function jt(cr){return ke(Lt(cr))}return jt.invert=function(cr){return Rt(ke.invert(cr))},jt.domain=function(cr){return arguments.length?(ke.domain((pt=cr.map(Number)).map(Lt)),jt):pt},jt.ticks=function(cr){return zo(pt,cr)},jt.tickFormat=function(cr,ur){return d3_scale_linearTickFormat(pt,cr,ur)},jt.nice=function(cr){return jt.domain(Ja(pt,cr))},jt.exponent=function(cr){return arguments.length?(Lt=ro(Ye=cr),Rt=ro(1/Ye),ke.domain(pt.map(Lt)),jt):Ye},jt.copy=function(){return Bo(ke.copy(),Ye,pt)},hi(jt,ke)}function ro(ke){return function(Ye){return Ye<0?-Math.pow(-Ye,ke):Math.pow(Ye,ke)}}h.scale.sqrt=function(){return h.scale.pow().exponent(.5)},h.scale.ordinal=function(){return Ni([],{t:"range",a:[[]]})};function Ni(ke,Ye){var pt,Lt,Rt;function jt(ur){return Lt[((pt.get(ur)||(Ye.t==="range"?pt.set(ur,ke.push(ur)):NaN))-1)%Lt.length]}function cr(ur,kr){return h.range(ke.length).map(function(on){return ur+kr*on})}return jt.domain=function(ur){if(!arguments.length)return ke;ke=[],pt=new A;for(var kr=-1,on=ur.length,nn;++kr0?pt[jt-1]:ke[0],jtRn?0:1;if(nn=Be)return kr(nn,qa)+(on?kr(on,1-qa):"")+"Z";var Yn,ha,xa,Ba,Ha=0,_a=0,gi,to,Vi,Zi,xo,Mo,Gs,Po,os=[];if((Ba=(+cr.apply(this,arguments)||0)/2)&&(xa=Lt===Fl?Math.sqrt(on*on+nn*nn):+Lt.apply(this,arguments),qa||(_a*=-1),nn&&(_a=Ht(xa/nn*Math.sin(Ba))),on&&(Ha=Ht(xa/on*Math.sin(Ba)))),nn){gi=nn*Math.cos(wn+_a),to=nn*Math.sin(wn+_a),Vi=nn*Math.cos(Rn-_a),Zi=nn*Math.sin(Rn-_a);var Js=Math.abs(Rn-wn-2*_a)<=Ie?0:1;if(_a&&oc(gi,to,Vi,Zi)===qa^Js){var Eu=(wn+Rn)/2;gi=nn*Math.cos(Eu),to=nn*Math.sin(Eu),Vi=Zi=null}}else gi=to=0;if(on){xo=on*Math.cos(Rn-Ha),Mo=on*Math.sin(Rn-Ha),Gs=on*Math.cos(wn+Ha),Po=on*Math.sin(wn+Ha);var Yl=Math.abs(wn-Rn+2*Ha)<=Ie?0:1;if(Ha&&oc(xo,Mo,Gs,Po)===1-qa^Yl){var ho=(wn+Rn)/2;xo=on*Math.cos(ho),Mo=on*Math.sin(ho),Gs=Po=null}}else xo=Mo=0;if(Nn>ct&&(Yn=Math.min(Math.abs(nn-on)/2,+pt.apply(this,arguments)))>.001){ha=on0?0:1}function cc(ke,Ye,pt,Lt,Rt){var jt=ke[0]-Ye[0],cr=ke[1]-Ye[1],ur=(Rt?Lt:-Lt)/Math.sqrt(jt*jt+cr*cr),kr=ur*cr,on=-ur*jt,nn=ke[0]+kr,wn=ke[1]+on,Rn=Ye[0]+kr,Nn=Ye[1]+on,qa=(nn+Rn)/2,Yn=(wn+Nn)/2,ha=Rn-nn,xa=Nn-wn,Ba=ha*ha+xa*xa,Ha=pt-Lt,_a=nn*Nn-Rn*wn,gi=(xa<0?-1:1)*Math.sqrt(Math.max(0,Ha*Ha*Ba-_a*_a)),to=(_a*xa-ha*gi)/Ba,Vi=(-_a*ha-xa*gi)/Ba,Zi=(_a*xa+ha*gi)/Ba,xo=(-_a*ha+xa*gi)/Ba,Mo=to-qa,Gs=Vi-Yn,Po=Zi-qa,os=xo-Yn;return Mo*Mo+Gs*Gs>Po*Po+os*os&&(to=Zi,Vi=xo),[[to-kr,Vi-on],[to*pt/Ha,Vi*pt/Ha]]}function Sf(){return!0}function sc(ke){var Ye=co,pt=So,Lt=Sf,Rt=wu,jt=Rt.key,cr=.7;function ur(kr){var on=[],nn=[],wn=-1,Rn=kr.length,Nn,qa=Dt(Ye),Yn=Dt(pt);function ha(){on.push("M",Rt(ke(nn),cr))}for(;++wn1?ke.join("L"):ke+"Z"}function lf(ke){return ke.join("L")+"Z"}function qo(ke){for(var Ye=0,pt=ke.length,Lt=ke[0],Rt=[Lt[0],",",Lt[1]];++Ye1&&Rt.push("H",Lt[0]),Rt.join("")}function as(ke){for(var Ye=0,pt=ke.length,Lt=ke[0],Rt=[Lt[0],",",Lt[1]];++Ye1){ur=Ye[1],jt=ke[kr],kr++,Lt+="C"+(Rt[0]+cr[0])+","+(Rt[1]+cr[1])+","+(jt[0]-ur[0])+","+(jt[1]-ur[1])+","+jt[0]+","+jt[1];for(var on=2;on9&&(jt=pt*3/Math.sqrt(jt),cr[ur]=jt*Lt,cr[ur+1]=jt*Rt));for(ur=-1;++ur<=kr;)jt=(ke[Math.min(kr,ur+1)][0]-ke[Math.max(0,ur-1)][0])/(6*(1+cr[ur]*cr[ur])),Ye.push([jt||0,cr[ur]*jt||0]);return Ye}function dt(ke){return ke.length<3?wu(ke):ke[0]+I(ke,ot(ke))}h.svg.line.radial=function(){var ke=sc(Tt);return ke.radius=ke.x,delete ke.x,ke.angle=ke.y,delete ke.y,ke};function Tt(ke){for(var Ye,pt=-1,Lt=ke.length,Rt,jt;++ptIe)+",1 "+wn}function on(nn,wn,Rn,Nn){return"Q 0,0 "+Nn}return jt.radius=function(nn){return arguments.length?(pt=Dt(nn),jt):pt},jt.source=function(nn){return arguments.length?(ke=Dt(nn),jt):ke},jt.target=function(nn){return arguments.length?(Ye=Dt(nn),jt):Ye},jt.startAngle=function(nn){return arguments.length?(Lt=Dt(nn),jt):Lt},jt.endAngle=function(nn){return arguments.length?(Rt=Dt(nn),jt):Rt},jt};function Xt(ke){return ke.radius}h.svg.diagonal=function(){var ke=qt,Ye=zt,pt=Mr;function Lt(Rt,jt){var cr=ke.call(this,Rt,jt),ur=Ye.call(this,Rt,jt),kr=(cr.y+ur.y)/2,on=[cr,{x:cr.x,y:kr},{x:ur.x,y:kr},ur];return on=on.map(pt),"M"+on[0]+"C"+on[1]+" "+on[2]+" "+on[3]}return Lt.source=function(Rt){return arguments.length?(ke=Dt(Rt),Lt):ke},Lt.target=function(Rt){return arguments.length?(Ye=Dt(Rt),Lt):Ye},Lt.projection=function(Rt){return arguments.length?(pt=Rt,Lt):pt},Lt};function Mr(ke){return[ke.x,ke.y]}h.svg.diagonal.radial=function(){var ke=h.svg.diagonal(),Ye=Mr,pt=ke.projection;return ke.projection=function(Lt){return arguments.length?pt(Rr(Ye=Lt)):Ye},ke};function Rr(ke){return function(){var Ye=ke.apply(this,arguments),pt=Ye[0],Lt=Ye[1]-at;return[pt*Math.cos(Lt),pt*Math.sin(Lt)]}}h.svg.symbol=function(){var ke=an,Ye=Vr;function pt(Lt,Rt){return(zn.get(ke.call(this,Lt,Rt))||mn)(Ye.call(this,Lt,Rt))}return pt.type=function(Lt){return arguments.length?(ke=Dt(Lt),pt):ke},pt.size=function(Lt){return arguments.length?(Ye=Dt(Lt),pt):Ye},pt};function Vr(){return 64}function an(){return"circle"}function mn(ke){var Ye=Math.sqrt(ke/Ie);return"M0,"+Ye+"A"+Ye+","+Ye+" 0 1,1 0,"+-Ye+"A"+Ye+","+Ye+" 0 1,1 0,"+Ye+"Z"}var zn=h.map({circle:mn,cross:function(ke){var Ye=Math.sqrt(ke/5)/2;return"M"+-3*Ye+","+-Ye+"H"+-Ye+"V"+-3*Ye+"H"+Ye+"V"+-Ye+"H"+3*Ye+"V"+Ye+"H"+Ye+"V"+3*Ye+"H"+-Ye+"V"+Ye+"H"+-3*Ye+"Z"},diamond:function(ke){var Ye=Math.sqrt(ke/(2*oa)),pt=Ye*oa;return"M0,"+-Ye+"L"+pt+",0 0,"+Ye+" "+-pt+",0Z"},square:function(ke){var Ye=Math.sqrt(ke)/2;return"M"+-Ye+","+-Ye+"L"+Ye+","+-Ye+" "+Ye+","+Ye+" "+-Ye+","+Ye+"Z"},"triangle-down":function(ke){var Ye=Math.sqrt(ke/Gn),pt=Ye*Gn/2;return"M0,"+pt+"L"+Ye+","+-pt+" "+-Ye+","+-pt+"Z"},"triangle-up":function(ke){var Ye=Math.sqrt(ke/Gn),pt=Ye*Gn/2;return"M0,"+-pt+"L"+Ye+","+pt+" "+-Ye+","+pt+"Z"}});h.svg.symbolTypes=zn.keys();var Gn=Math.sqrt(3),oa=Math.tan(30*ft);ie.transition=function(ke){for(var Ye=To||++no,pt=Ws(ke),Lt=[],Rt,jt,cr=go||{time:Date.now(),ease:Do,delay:0,duration:250},ur=-1,kr=this.length;++ur0;)wn[--Ba].call(ke,xa);if(ha>=1)return cr.event&&cr.event.end.call(ke,ke.__data__,Ye),--jt.count?delete jt[Lt]:delete ke[pt],1}cr||(ur=Rt.time,kr=Ua(Rn,0,ur),cr=jt[Lt]={tween:new A,time:ur,timer:kr,delay:Rt.delay,duration:Rt.duration,ease:Rt.ease,index:Ye},Rt=null,++jt.count)}h.svg.axis=function(){var ke=h.scale.linear(),Ye=Qs,pt=6,Lt=6,Rt=3,jt=[10],cr=null,ur;function kr(on){on.each(function(){var nn=h.select(this),wn=this.__chart__||ke,Rn=this.__chart__=ke.copy(),Nn=cr??(Rn.ticks?Rn.ticks.apply(Rn,jt):Rn.domain()),qa=ur??(Rn.tickFormat?Rn.tickFormat.apply(Rn,jt):N),Yn=nn.selectAll(".tick").data(Nn,Rn),ha=Yn.enter().insert("g",".domain").attr("class","tick").style("opacity",ct),xa=h.transition(Yn.exit()).style("opacity",ct).remove(),Ba=h.transition(Yn.order()).style("opacity",1),Ha=Math.max(pt,0)+Rt,_a,gi=Na(Rn),to=nn.selectAll(".domain").data([0]),Vi=(to.enter().append("path").attr("class","domain"),h.transition(to));ha.append("line"),ha.append("text");var Zi=ha.select("line"),xo=Ba.select("line"),Mo=Yn.select("text").text(qa),Gs=ha.select("text"),Po=Ba.select("text"),os=Ye==="top"||Ye==="left"?-1:1,Js,Eu,Yl,ho;if(Ye==="bottom"||Ye==="top"?(_a=Kl,Js="x",Yl="y",Eu="x2",ho="y2",Mo.attr("dy",os<0?"0em":".71em").style("text-anchor","middle"),Vi.attr("d","M"+gi[0]+","+os*Lt+"V0H"+gi[1]+"V"+os*Lt)):(_a=Ms,Js="y",Yl="x",Eu="y2",ho="x2",Mo.attr("dy",".32em").style("text-anchor",os<0?"end":"start"),Vi.attr("d","M"+os*Lt+","+gi[0]+"H0V"+gi[1]+"H"+os*Lt)),Zi.attr(ho,os*pt),Gs.attr(Yl,os*Ha),xo.attr(Eu,0).attr(ho,os*pt),Po.attr(Js,0).attr(Yl,os*Ha),Rn.rangeBand){var ks=Rn,Ys=ks.rangeBand()/2;wn=Rn=function(ql){return ks(ql)+Ys}}else wn.rangeBand?wn=Rn:xa.call(_a,Rn,wn);ha.call(_a,wn,Rn),Ba.call(_a,Rn,Rn)})}return kr.scale=function(on){return arguments.length?(ke=on,kr):ke},kr.orient=function(on){return arguments.length?(Ye=on in uu?on+"":Qs,kr):Ye},kr.ticks=function(){return arguments.length?(jt=S(arguments),kr):jt},kr.tickValues=function(on){return arguments.length?(cr=on,kr):cr},kr.tickFormat=function(on){return arguments.length?(ur=on,kr):ur},kr.tickSize=function(on){var nn=arguments.length;return nn?(pt=+on,Lt=+arguments[nn-1],kr):pt},kr.innerTickSize=function(on){return arguments.length?(pt=+on,kr):pt},kr.outerTickSize=function(on){return arguments.length?(Lt=+on,kr):Lt},kr.tickPadding=function(on){return arguments.length?(Rt=+on,kr):Rt},kr.tickSubdivide=function(){return arguments.length&&kr},kr};var Qs="bottom",uu={top:1,right:1,bottom:1,left:1};function Kl(ke,Ye,pt){ke.attr("transform",function(Lt){var Rt=Ye(Lt);return"translate("+(isFinite(Rt)?Rt:pt(Lt))+",0)"})}function Ms(ke,Ye,pt){ke.attr("transform",function(Lt){var Rt=Ye(Lt);return"translate(0,"+(isFinite(Rt)?Rt:pt(Lt))+")"})}h.svg.brush=function(){var ke=pe(nn,"brushstart","brush","brushend"),Ye=null,pt=null,Lt=[0,0],Rt=[0,0],jt,cr,ur=!0,kr=!0,on=Mu[0];function nn(Yn){Yn.each(function(){var ha=h.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",qa).on("touchstart.brush",qa),xa=ha.selectAll(".background").data([0]);xa.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),ha.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Ba=ha.selectAll(".resize").data(on,N);Ba.exit().remove(),Ba.enter().append("g").attr("class",function(to){return"resize "+to}).style("cursor",function(to){return Es[to]}).append("rect").attr("x",function(to){return/[ew]$/.test(to)?-3:null}).attr("y",function(to){return/^[ns]/.test(to)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Ba.style("display",nn.empty()?"none":null);var Ha=h.transition(ha),_a=h.transition(xa),gi;Ye&&(gi=Na(Ye),_a.attr("x",gi[0]).attr("width",gi[1]-gi[0]),Rn(Ha)),pt&&(gi=Na(pt),_a.attr("y",gi[0]).attr("height",gi[1]-gi[0]),Nn(Ha)),wn(Ha)})}nn.event=function(Yn){Yn.each(function(){var ha=ke.of(this,arguments),xa={x:Lt,y:Rt,i:jt,j:cr},Ba=this.__chart__||xa;this.__chart__=xa,To?h.select(this).transition().each("start.brush",function(){jt=Ba.i,cr=Ba.j,Lt=Ba.x,Rt=Ba.y,ha({type:"brushstart"})}).tween("brush:brush",function(){var Ha=kl(Lt,xa.x),_a=kl(Rt,xa.y);return jt=cr=null,function(gi){Lt=xa.x=Ha(gi),Rt=xa.y=_a(gi),ha({type:"brush",mode:"resize"})}}).each("end.brush",function(){jt=xa.i,cr=xa.j,ha({type:"brush",mode:"resize"}),ha({type:"brushend"})}):(ha({type:"brushstart"}),ha({type:"brush",mode:"resize"}),ha({type:"brushend"}))})};function wn(Yn){Yn.selectAll(".resize").attr("transform",function(ha){return"translate("+Lt[+/e$/.test(ha)]+","+Rt[+/^s/.test(ha)]+")"})}function Rn(Yn){Yn.select(".extent").attr("x",Lt[0]),Yn.selectAll(".extent,.n>rect,.s>rect").attr("width",Lt[1]-Lt[0])}function Nn(Yn){Yn.select(".extent").attr("y",Rt[0]),Yn.selectAll(".extent,.e>rect,.w>rect").attr("height",Rt[1]-Rt[0])}function qa(){var Yn=this,ha=h.select(h.event.target),xa=ke.of(Yn,arguments),Ba=h.select(Yn),Ha=ha.datum(),_a=!/^(n|s)$/.test(Ha)&&Ye,gi=!/^(e|w)$/.test(Ha)&&pt,to=ha.classed("extent"),Vi=zr(Yn),Zi,xo=h.mouse(Yn),Mo,Gs=h.select(t(Yn)).on("keydown.brush",Js).on("keyup.brush",Eu);if(h.event.changedTouches?Gs.on("touchmove.brush",Yl).on("touchend.brush",ks):Gs.on("mousemove.brush",Yl).on("mouseup.brush",ks),Ba.interrupt().selectAll("*").interrupt(),to)xo[0]=Lt[0]-xo[0],xo[1]=Rt[0]-xo[1];else if(Ha){var Po=+/w$/.test(Ha),os=+/^n/.test(Ha);Mo=[Lt[1-Po]-xo[0],Rt[1-os]-xo[1]],xo[0]=Lt[Po],xo[1]=Rt[os]}else h.event.altKey&&(Zi=xo.slice());Ba.style("pointer-events","none").selectAll(".resize").style("display",null),h.select("body").style("cursor",ha.style("cursor")),xa({type:"brushstart"}),Yl();function Js(){h.event.keyCode==32&&(to||(Zi=null,xo[0]-=Lt[1],xo[1]-=Rt[1],to=2),oe())}function Eu(){h.event.keyCode==32&&to==2&&(xo[0]+=Lt[1],xo[1]+=Rt[1],to=0,oe())}function Yl(){var Ys=h.mouse(Yn),ql=!1;Mo&&(Ys[0]+=Mo[0],Ys[1]+=Mo[1]),to||(h.event.altKey?(Zi||(Zi=[(Lt[0]+Lt[1])/2,(Rt[0]+Rt[1])/2]),xo[0]=Lt[+(Ys[0]0))return dr;do dr.push(Nr=new Date(+$t)),Ke($t,lr),Ae($t);while(Nr<$t&&$t=Yt)for(;Ae(Yt),!$t(Yt);)Yt.setTime(Yt-1)},function(Yt,lr){if(Yt>=Yt)if(lr<0)for(;++lr<=0;)for(;Ke(Yt,-1),!$t(Yt););else for(;--lr>=0;)for(;Ke(Yt,1),!$t(Yt););})},_t&&(vt.count=function($t,Yt){return x.setTime(+$t),S.setTime(+Yt),Ae(x),Ae(S),Math.floor(_t(x,S))},vt.every=function($t){return $t=Math.floor($t),!isFinite($t)||!($t>0)?null:$t>1?vt.filter(wt?function(Yt){return wt(Yt)%$t===0}:function(Yt){return vt.count(0,Yt)%$t===0}):vt}),vt}var e=k(function(){},function(Ae,Ke){Ae.setTime(+Ae+Ke)},function(Ae,Ke){return Ke-Ae});e.every=function(Ae){return Ae=Math.floor(Ae),!isFinite(Ae)||!(Ae>0)?null:Ae>1?k(function(Ke){Ke.setTime(Math.floor(Ke/Ae)*Ae)},function(Ke,_t){Ke.setTime(+Ke+_t*Ae)},function(Ke,_t){return(_t-Ke)/Ae}):e};var t=e.range,r=1e3,o=6e4,n=36e5,i=864e5,a=6048e5,s=k(function(Ae){Ae.setTime(Ae-Ae.getMilliseconds())},function(Ae,Ke){Ae.setTime(+Ae+Ke*r)},function(Ae,Ke){return(Ke-Ae)/r},function(Ae){return Ae.getUTCSeconds()}),f=s.range,c=k(function(Ae){Ae.setTime(Ae-Ae.getMilliseconds()-Ae.getSeconds()*r)},function(Ae,Ke){Ae.setTime(+Ae+Ke*o)},function(Ae,Ke){return(Ke-Ae)/o},function(Ae){return Ae.getMinutes()}),v=c.range,p=k(function(Ae){Ae.setTime(Ae-Ae.getMilliseconds()-Ae.getSeconds()*r-Ae.getMinutes()*o)},function(Ae,Ke){Ae.setTime(+Ae+Ke*n)},function(Ae,Ke){return(Ke-Ae)/n},function(Ae){return Ae.getHours()}),T=p.range,l=k(function(Ae){Ae.setHours(0,0,0,0)},function(Ae,Ke){Ae.setDate(Ae.getDate()+Ke)},function(Ae,Ke){return(Ke-Ae-(Ke.getTimezoneOffset()-Ae.getTimezoneOffset())*o)/i},function(Ae){return Ae.getDate()-1}),g=l.range;function b(Ae){return k(function(Ke){Ke.setDate(Ke.getDate()-(Ke.getDay()+7-Ae)%7),Ke.setHours(0,0,0,0)},function(Ke,_t){Ke.setDate(Ke.getDate()+_t*7)},function(Ke,_t){return(_t-Ke-(_t.getTimezoneOffset()-Ke.getTimezoneOffset())*o)/a})}var A=b(0),E=b(1),_=b(2),w=b(3),m=b(4),u=b(5),d=b(6),y=A.range,R=E.range,L=_.range,z=w.range,N=m.range,U=u.range,B=d.range,D=k(function(Ae){Ae.setDate(1),Ae.setHours(0,0,0,0)},function(Ae,Ke){Ae.setMonth(Ae.getMonth()+Ke)},function(Ae,Ke){return Ke.getMonth()-Ae.getMonth()+(Ke.getFullYear()-Ae.getFullYear())*12},function(Ae){return Ae.getMonth()}),j=D.range,q=k(function(Ae){Ae.setMonth(0,1),Ae.setHours(0,0,0,0)},function(Ae,Ke){Ae.setFullYear(Ae.getFullYear()+Ke)},function(Ae,Ke){return Ke.getFullYear()-Ae.getFullYear()},function(Ae){return Ae.getFullYear()});q.every=function(Ae){return!isFinite(Ae=Math.floor(Ae))||!(Ae>0)?null:k(function(Ke){Ke.setFullYear(Math.floor(Ke.getFullYear()/Ae)*Ae),Ke.setMonth(0,1),Ke.setHours(0,0,0,0)},function(Ke,_t){Ke.setFullYear(Ke.getFullYear()+_t*Ae)})};var J=q.range,oe=k(function(Ae){Ae.setUTCSeconds(0,0)},function(Ae,Ke){Ae.setTime(+Ae+Ke*o)},function(Ae,Ke){return(Ke-Ae)/o},function(Ae){return Ae.getUTCMinutes()}),ye=oe.range,pe=k(function(Ae){Ae.setUTCMinutes(0,0,0)},function(Ae,Ke){Ae.setTime(+Ae+Ke*n)},function(Ae,Ke){return(Ke-Ae)/n},function(Ae){return Ae.getUTCHours()}),ge=pe.range,W=k(function(Ae){Ae.setUTCHours(0,0,0,0)},function(Ae,Ke){Ae.setUTCDate(Ae.getUTCDate()+Ke)},function(Ae,Ke){return(Ke-Ae)/i},function(Ae){return Ae.getUTCDate()-1}),ae=W.range;function se(Ae){return k(function(Ke){Ke.setUTCDate(Ke.getUTCDate()-(Ke.getUTCDay()+7-Ae)%7),Ke.setUTCHours(0,0,0,0)},function(Ke,_t){Ke.setUTCDate(Ke.getUTCDate()+_t*7)},function(Ke,_t){return(_t-Ke)/a})}var Q=se(0),me=se(1),ie=se(2),Y=se(3),le=se(4),ue=se(5),Te=se(6),Fe=Q.range,Ve=me.range,Xe=ie.range,We=Y.range,it=le.range,yt=ue.range,bt=Te.range,mt=k(function(Ae){Ae.setUTCDate(1),Ae.setUTCHours(0,0,0,0)},function(Ae,Ke){Ae.setUTCMonth(Ae.getUTCMonth()+Ke)},function(Ae,Ke){return Ke.getUTCMonth()-Ae.getUTCMonth()+(Ke.getUTCFullYear()-Ae.getUTCFullYear())*12},function(Ae){return Ae.getUTCMonth()}),ht=mt.range,qe=k(function(Ae){Ae.setUTCMonth(0,1),Ae.setUTCHours(0,0,0,0)},function(Ae,Ke){Ae.setUTCFullYear(Ae.getUTCFullYear()+Ke)},function(Ae,Ke){return Ke.getUTCFullYear()-Ae.getUTCFullYear()},function(Ae){return Ae.getUTCFullYear()});qe.every=function(Ae){return!isFinite(Ae=Math.floor(Ae))||!(Ae>0)?null:k(function(Ke){Ke.setUTCFullYear(Math.floor(Ke.getUTCFullYear()/Ae)*Ae),Ke.setUTCMonth(0,1),Ke.setUTCHours(0,0,0,0)},function(Ke,_t){Ke.setUTCFullYear(Ke.getUTCFullYear()+_t*Ae)})};var ze=qe.range;h.timeDay=l,h.timeDays=g,h.timeFriday=u,h.timeFridays=U,h.timeHour=p,h.timeHours=T,h.timeInterval=k,h.timeMillisecond=e,h.timeMilliseconds=t,h.timeMinute=c,h.timeMinutes=v,h.timeMonday=E,h.timeMondays=R,h.timeMonth=D,h.timeMonths=j,h.timeSaturday=d,h.timeSaturdays=B,h.timeSecond=s,h.timeSeconds=f,h.timeSunday=A,h.timeSundays=y,h.timeThursday=m,h.timeThursdays=N,h.timeTuesday=_,h.timeTuesdays=L,h.timeWednesday=w,h.timeWednesdays=z,h.timeWeek=A,h.timeWeeks=y,h.timeYear=q,h.timeYears=J,h.utcDay=W,h.utcDays=ae,h.utcFriday=ue,h.utcFridays=yt,h.utcHour=pe,h.utcHours=ge,h.utcMillisecond=e,h.utcMilliseconds=t,h.utcMinute=oe,h.utcMinutes=ye,h.utcMonday=me,h.utcMondays=Ve,h.utcMonth=mt,h.utcMonths=ht,h.utcSaturday=Te,h.utcSaturdays=bt,h.utcSecond=s,h.utcSeconds=f,h.utcSunday=Q,h.utcSundays=Fe,h.utcThursday=le,h.utcThursdays=it,h.utcTuesday=ie,h.utcTuesdays=Xe,h.utcWednesday=Y,h.utcWednesdays=We,h.utcWeek=Q,h.utcWeeks=Fe,h.utcYear=qe,h.utcYears=ze,Object.defineProperty(h,"__esModule",{value:!0})})}}),On=_e({"node_modules/d3-time-format/dist/d3-time-format.js"(ee,X){(function(h,x){typeof ee=="object"&&typeof X<"u"?x(ee,Ir()):(h=h||self,x(h.d3=h.d3||{},h.d3))})(ee,function(h,x){function S(Qe){if(0<=Qe.y&&Qe.y<100){var ct=new Date(-1,Qe.m,Qe.d,Qe.H,Qe.M,Qe.S,Qe.L);return ct.setFullYear(Qe.y),ct}return new Date(Qe.y,Qe.m,Qe.d,Qe.H,Qe.M,Qe.S,Qe.L)}function k(Qe){if(0<=Qe.y&&Qe.y<100){var ct=new Date(Date.UTC(-1,Qe.m,Qe.d,Qe.H,Qe.M,Qe.S,Qe.L));return ct.setUTCFullYear(Qe.y),ct}return new Date(Date.UTC(Qe.y,Qe.m,Qe.d,Qe.H,Qe.M,Qe.S,Qe.L))}function e(Qe,ct,Ue){return{y:Qe,m:ct,d:Ue,H:0,M:0,S:0,L:0}}function t(Qe){var ct=Qe.dateTime,Ue=Qe.date,Ie=Qe.time,Pe=Qe.periods,Be=Qe.days,at=Qe.shortDays,ft=Qe.months,Bt=Qe.shortMonths,Nt=f(Pe),Ht=c(Pe),or=f(Be),Cr=c(Be),Sr=f(at),Tr=c(at),Yr=f(ft),Fn=c(ft),ua=f(Bt),ta=c(Bt),va={a:Ca,A:Ma,b:Da,B:Va,c:null,d:D,e:D,f:ye,H:j,I:q,j:J,L:oe,m:pe,M:ge,p:na,q:Mi,Q:Yt,s:lr,S:W,u:ae,U:se,V:Q,w:me,W:ie,x:null,X:null,y:Y,Y:le,Z:ue,"%":$t},ma={a:Oi,A:Vt,b:Ct,B:Br,c:null,d:Te,e:Te,f:it,H:Fe,I:Ve,j:Xe,L:We,m:yt,M:bt,p:Kr,q:Qr,Q:Yt,s:lr,S:mt,u:ht,U:qe,V:ze,w:Ae,W:Ke,x:null,X:null,y:_t,Y:wt,Z:vt,"%":$t},Jn={a:vr,A:_r,b:rn,B:gn,c:Mn,d:m,e:m,f:z,H:d,I:d,j:u,L,m:w,M:y,p:Kt,q:_,Q:U,s:B,S:R,u:p,U:T,V:l,w:v,W:g,x:In,X:fa,y:A,Y:b,Z:E,"%":N};va.x=ja(Ue,va),va.X=ja(Ie,va),va.c=ja(ct,va),ma.x=ja(Ue,ma),ma.X=ja(Ie,ma),ma.c=ja(ct,ma);function ja(Gr,Jr){return function(yn){var cn=[],Dt=-1,yr=0,Hr=Gr.length,_n,Hn,ea;for(yn instanceof Date||(yn=new Date(+yn));++Dt53)return null;"w"in cn||(cn.w=1),"Z"in cn?(yr=k(e(cn.y,0,1)),Hr=yr.getUTCDay(),yr=Hr>4||Hr===0?x.utcMonday.ceil(yr):x.utcMonday(yr),yr=x.utcDay.offset(yr,(cn.V-1)*7),cn.y=yr.getUTCFullYear(),cn.m=yr.getUTCMonth(),cn.d=yr.getUTCDate()+(cn.w+6)%7):(yr=S(e(cn.y,0,1)),Hr=yr.getDay(),yr=Hr>4||Hr===0?x.timeMonday.ceil(yr):x.timeMonday(yr),yr=x.timeDay.offset(yr,(cn.V-1)*7),cn.y=yr.getFullYear(),cn.m=yr.getMonth(),cn.d=yr.getDate()+(cn.w+6)%7)}else("W"in cn||"U"in cn)&&("w"in cn||(cn.w="u"in cn?cn.u%7:"W"in cn?1:0),Hr="Z"in cn?k(e(cn.y,0,1)).getUTCDay():S(e(cn.y,0,1)).getDay(),cn.m=0,cn.d="W"in cn?(cn.w+6)%7+cn.W*7-(Hr+5)%7:cn.w+cn.U*7-(Hr+6)%7);return"Z"in cn?(cn.H+=cn.Z/100|0,cn.M+=cn.Z%100,k(cn)):S(cn)}}function gr(Gr,Jr,yn,cn){for(var Dt=0,yr=Jr.length,Hr=yn.length,_n,Hn;Dt=Hr)return-1;if(_n=Jr.charCodeAt(Dt++),_n===37){if(_n=Jr.charAt(Dt++),Hn=Jn[_n in r?Jr.charAt(Dt++):_n],!Hn||(cn=Hn(Gr,yn,cn))<0)return-1}else if(_n!=yn.charCodeAt(cn++))return-1}return cn}function Kt(Gr,Jr,yn){var cn=Nt.exec(Jr.slice(yn));return cn?(Gr.p=Ht[cn[0].toLowerCase()],yn+cn[0].length):-1}function vr(Gr,Jr,yn){var cn=Sr.exec(Jr.slice(yn));return cn?(Gr.w=Tr[cn[0].toLowerCase()],yn+cn[0].length):-1}function _r(Gr,Jr,yn){var cn=or.exec(Jr.slice(yn));return cn?(Gr.w=Cr[cn[0].toLowerCase()],yn+cn[0].length):-1}function rn(Gr,Jr,yn){var cn=ua.exec(Jr.slice(yn));return cn?(Gr.m=ta[cn[0].toLowerCase()],yn+cn[0].length):-1}function gn(Gr,Jr,yn){var cn=Yr.exec(Jr.slice(yn));return cn?(Gr.m=Fn[cn[0].toLowerCase()],yn+cn[0].length):-1}function Mn(Gr,Jr,yn){return gr(Gr,ct,Jr,yn)}function In(Gr,Jr,yn){return gr(Gr,Ue,Jr,yn)}function fa(Gr,Jr,yn){return gr(Gr,Ie,Jr,yn)}function Ca(Gr){return at[Gr.getDay()]}function Ma(Gr){return Be[Gr.getDay()]}function Da(Gr){return Bt[Gr.getMonth()]}function Va(Gr){return ft[Gr.getMonth()]}function na(Gr){return Pe[+(Gr.getHours()>=12)]}function Mi(Gr){return 1+~~(Gr.getMonth()/3)}function Oi(Gr){return at[Gr.getUTCDay()]}function Vt(Gr){return Be[Gr.getUTCDay()]}function Ct(Gr){return Bt[Gr.getUTCMonth()]}function Br(Gr){return ft[Gr.getUTCMonth()]}function Kr(Gr){return Pe[+(Gr.getUTCHours()>=12)]}function Qr(Gr){return 1+~~(Gr.getUTCMonth()/3)}return{format:function(Gr){var Jr=ja(Gr+="",va);return Jr.toString=function(){return Gr},Jr},parse:function(Gr){var Jr=ti(Gr+="",!1);return Jr.toString=function(){return Gr},Jr},utcFormat:function(Gr){var Jr=ja(Gr+="",ma);return Jr.toString=function(){return Gr},Jr},utcParse:function(Gr){var Jr=ti(Gr+="",!0);return Jr.toString=function(){return Gr},Jr}}}var r={"-":"",_:" ",0:"0"},o=/^\s*\d+/,n=/^%/,i=/[\\^$*+?|[\]().{}]/g;function a(Qe,ct,Ue){var Ie=Qe<0?"-":"",Pe=(Ie?-Qe:Qe)+"",Be=Pe.length;return Ie+(Be68?1900:2e3),Ue+Ie[0].length):-1}function E(Qe,ct,Ue){var Ie=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(ct.slice(Ue,Ue+6));return Ie?(Qe.Z=Ie[1]?0:-(Ie[2]+(Ie[3]||"00")),Ue+Ie[0].length):-1}function _(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue,Ue+1));return Ie?(Qe.q=Ie[0]*3-3,Ue+Ie[0].length):-1}function w(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue,Ue+2));return Ie?(Qe.m=Ie[0]-1,Ue+Ie[0].length):-1}function m(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue,Ue+2));return Ie?(Qe.d=+Ie[0],Ue+Ie[0].length):-1}function u(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue,Ue+3));return Ie?(Qe.m=0,Qe.d=+Ie[0],Ue+Ie[0].length):-1}function d(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue,Ue+2));return Ie?(Qe.H=+Ie[0],Ue+Ie[0].length):-1}function y(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue,Ue+2));return Ie?(Qe.M=+Ie[0],Ue+Ie[0].length):-1}function R(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue,Ue+2));return Ie?(Qe.S=+Ie[0],Ue+Ie[0].length):-1}function L(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue,Ue+3));return Ie?(Qe.L=+Ie[0],Ue+Ie[0].length):-1}function z(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue,Ue+6));return Ie?(Qe.L=Math.floor(Ie[0]/1e3),Ue+Ie[0].length):-1}function N(Qe,ct,Ue){var Ie=n.exec(ct.slice(Ue,Ue+1));return Ie?Ue+Ie[0].length:-1}function U(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue));return Ie?(Qe.Q=+Ie[0],Ue+Ie[0].length):-1}function B(Qe,ct,Ue){var Ie=o.exec(ct.slice(Ue));return Ie?(Qe.s=+Ie[0],Ue+Ie[0].length):-1}function D(Qe,ct){return a(Qe.getDate(),ct,2)}function j(Qe,ct){return a(Qe.getHours(),ct,2)}function q(Qe,ct){return a(Qe.getHours()%12||12,ct,2)}function J(Qe,ct){return a(1+x.timeDay.count(x.timeYear(Qe),Qe),ct,3)}function oe(Qe,ct){return a(Qe.getMilliseconds(),ct,3)}function ye(Qe,ct){return oe(Qe,ct)+"000"}function pe(Qe,ct){return a(Qe.getMonth()+1,ct,2)}function ge(Qe,ct){return a(Qe.getMinutes(),ct,2)}function W(Qe,ct){return a(Qe.getSeconds(),ct,2)}function ae(Qe){var ct=Qe.getDay();return ct===0?7:ct}function se(Qe,ct){return a(x.timeSunday.count(x.timeYear(Qe)-1,Qe),ct,2)}function Q(Qe,ct){var Ue=Qe.getDay();return Qe=Ue>=4||Ue===0?x.timeThursday(Qe):x.timeThursday.ceil(Qe),a(x.timeThursday.count(x.timeYear(Qe),Qe)+(x.timeYear(Qe).getDay()===4),ct,2)}function me(Qe){return Qe.getDay()}function ie(Qe,ct){return a(x.timeMonday.count(x.timeYear(Qe)-1,Qe),ct,2)}function Y(Qe,ct){return a(Qe.getFullYear()%100,ct,2)}function le(Qe,ct){return a(Qe.getFullYear()%1e4,ct,4)}function ue(Qe){var ct=Qe.getTimezoneOffset();return(ct>0?"-":(ct*=-1,"+"))+a(ct/60|0,"0",2)+a(ct%60,"0",2)}function Te(Qe,ct){return a(Qe.getUTCDate(),ct,2)}function Fe(Qe,ct){return a(Qe.getUTCHours(),ct,2)}function Ve(Qe,ct){return a(Qe.getUTCHours()%12||12,ct,2)}function Xe(Qe,ct){return a(1+x.utcDay.count(x.utcYear(Qe),Qe),ct,3)}function We(Qe,ct){return a(Qe.getUTCMilliseconds(),ct,3)}function it(Qe,ct){return We(Qe,ct)+"000"}function yt(Qe,ct){return a(Qe.getUTCMonth()+1,ct,2)}function bt(Qe,ct){return a(Qe.getUTCMinutes(),ct,2)}function mt(Qe,ct){return a(Qe.getUTCSeconds(),ct,2)}function ht(Qe){var ct=Qe.getUTCDay();return ct===0?7:ct}function qe(Qe,ct){return a(x.utcSunday.count(x.utcYear(Qe)-1,Qe),ct,2)}function ze(Qe,ct){var Ue=Qe.getUTCDay();return Qe=Ue>=4||Ue===0?x.utcThursday(Qe):x.utcThursday.ceil(Qe),a(x.utcThursday.count(x.utcYear(Qe),Qe)+(x.utcYear(Qe).getUTCDay()===4),ct,2)}function Ae(Qe){return Qe.getUTCDay()}function Ke(Qe,ct){return a(x.utcMonday.count(x.utcYear(Qe)-1,Qe),ct,2)}function _t(Qe,ct){return a(Qe.getUTCFullYear()%100,ct,2)}function wt(Qe,ct){return a(Qe.getUTCFullYear()%1e4,ct,4)}function vt(){return"+0000"}function $t(){return"%"}function Yt(Qe){return+Qe}function lr(Qe){return Math.floor(+Qe/1e3)}var dr;Nr({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 Nr(Qe){return dr=t(Qe),h.timeFormat=dr.format,h.timeParse=dr.parse,h.utcFormat=dr.utcFormat,h.utcParse=dr.utcParse,dr}var Fr="%Y-%m-%dT%H:%M:%S.%LZ";function ln(Qe){return Qe.toISOString()}var zr=Date.prototype.toISOString?ln:h.utcFormat(Fr);function Xr(Qe){var ct=new Date(Qe);return isNaN(ct)?null:ct}var Ot=+new Date("2000-01-01T00:00:00.000Z")?Xr:h.utcParse(Fr);h.isoFormat=zr,h.isoParse=Ot,h.timeFormatDefaultLocale=Nr,h.timeFormatLocale=t,Object.defineProperty(h,"__esModule",{value:!0})})}}),ba=_e({"node_modules/d3-format/dist/d3-format.js"(ee,X){(function(h,x){typeof ee=="object"&&typeof X<"u"?x(ee):(h=typeof globalThis<"u"?globalThis:h||self,x(h.d3=h.d3||{}))})(ee,function(h){function x(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,d=w.slice(0,u);return[d.length>1?d[0]+d.slice(2):d,+w.slice(u+1)]}function k(w){return w=S(Math.abs(w)),w?w[1]:NaN}function e(w,m){return function(u,d){for(var y=u.length,R=[],L=0,z=w[0],N=0;y>0&&z>0&&(N+z+1>d&&(z=Math.max(1,d-N)),R.push(u.substring(y-=z,y+z)),!((N+=z+1)>d));)z=w[L=(L+1)%w.length];return R.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,d=-1,y;u0&&(d=0);break}return d>0?w.slice(0,d)+w.slice(y+1):w}var a;function s(w,m){var u=S(w,m);if(!u)return w+"";var d=u[0],y=u[1],R=y-(a=Math.max(-8,Math.min(8,Math.floor(y/3)))*3)+1,L=d.length;return R===L?d:R>L?d+new Array(R-L+1).join("0"):R>0?d.slice(0,R)+"."+d.slice(R):"0."+new Array(1-R).join("0")+S(w,Math.max(0,m+R-1))[0]}function f(w,m){var u=S(w,m);if(!u)return w+"";var d=u[0],y=u[1];return y<0?"0."+new Array(-y).join("0")+d:d.length>y+1?d.slice(0,y+1)+"."+d.slice(y+1):d+new Array(y-d.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:x,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 v(w){return w}var p=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?v:e(p.call(w.grouping,Number),w.thousands+""),u=w.currency===void 0?"":w.currency[0]+"",d=w.currency===void 0?"":w.currency[1]+"",y=w.decimal===void 0?".":w.decimal+"",R=w.numerals===void 0?v:t(p.call(w.numerals,String)),L=w.percent===void 0?"%":w.percent+"",z=w.minus===void 0?"-":w.minus+"",N=w.nan===void 0?"NaN":w.nan+"";function U(D){D=o(D);var j=D.fill,q=D.align,J=D.sign,oe=D.symbol,ye=D.zero,pe=D.width,ge=D.comma,W=D.precision,ae=D.trim,se=D.type;se==="n"?(ge=!0,se="g"):c[se]||(W===void 0&&(W=12),ae=!0,se="g"),(ye||j==="0"&&q==="=")&&(ye=!0,j="0",q="=");var Q=oe==="$"?u:oe==="#"&&/[boxX]/.test(se)?"0"+se.toLowerCase():"",me=oe==="$"?d:/[%p]/.test(se)?L:"",ie=c[se],Y=/[defgprs%]/.test(se);W=W===void 0?6:/[gprs]/.test(se)?Math.max(1,Math.min(21,W)):Math.max(0,Math.min(20,W));function le(ue){var Te=Q,Fe=me,Ve,Xe,We;if(se==="c")Fe=ie(ue)+Fe,ue="";else{ue=+ue;var it=ue<0||1/ue<0;if(ue=isNaN(ue)?N:ie(Math.abs(ue),W),ae&&(ue=i(ue)),it&&+ue==0&&J!=="+"&&(it=!1),Te=(it?J==="("?J:z:J==="-"||J==="("?"":J)+Te,Fe=(se==="s"?T[8+a/3]:"")+Fe+(it&&J==="("?")":""),Y){for(Ve=-1,Xe=ue.length;++VeWe||We>57){Fe=(We===46?y+ue.slice(Ve+1):ue.slice(Ve))+Fe,ue=ue.slice(0,Ve);break}}}ge&&!ye&&(ue=m(ue,1/0));var yt=Te.length+ue.length+Fe.length,bt=yt>1)+Te+ue+Fe+bt.slice(yt);break;default:ue=bt+Te+ue+Fe;break}return R(ue)}return le.toString=function(){return D+""},le}function B(D,j){var q=U((D=o(D),D.type="f",D)),J=Math.max(-8,Math.min(8,Math.floor(k(j)/3)))*3,oe=Math.pow(10,-J),ye=T[8+J/3];return function(pe){return q(oe*pe)+ye}}return{format:U,formatPrefix:B}}var g;b({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function b(w){return g=l(w),h.format=g.format,h.formatPrefix=g.formatPrefix,g}function A(w){return Math.max(0,-k(Math.abs(w)))}function E(w,m){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(k(m)/3)))*3-k(Math.abs(w)))}function _(w,m){return w=Math.abs(w),m=Math.abs(m)-w,Math.max(0,k(m)-k(w))+1}h.FormatSpecifier=n,h.formatDefaultLocale=b,h.formatLocale=l,h.formatSpecifier=o,h.precisionFixed=A,h.precisionPrefix=E,h.precisionRound=_,Object.defineProperty(h,"__esModule",{value:!0})})}}),ra=_e({"node_modules/is-string-blank/index.js"(ee,X){X.exports=function(h){for(var x=h.length,S,k=0;k13)&&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}}}),jn=_e({"node_modules/fast-isnumeric/index.js"(ee,X){var h=ra();X.exports=function(x){var S=typeof x;if(S==="string"){var k=x;if(x=+x,x===0&&h(k))return!1}else if(S!=="number")return!1;return x-x<1}}}),qn=_e({"src/constants/numerical.js"(ee,X){X.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:"−"}}}),Un=_e({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(ee,X){(function(h,x){typeof ee=="object"&&typeof X<"u"?x(ee):(h=typeof globalThis<"u"?globalThis:h||self,x(h["base64-arraybuffer"]={}))})(ee,function(h){for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S=typeof Uint8Array>"u"?[]:new Uint8Array(256),k=0;k>2],a+=x[(o[n]&3)<<4|o[n+1]>>4],a+=x[(o[n+1]&15)<<2|o[n+2]>>6],a+=x[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,v;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);var p=new ArrayBuffer(o),T=new Uint8Array(p);for(i=0;i>4,T[a++]=(f&15)<<4|c>>2,T[a++]=(c&3)<<6|v&63;return p};h.decode=t,h.encode=e,Object.defineProperty(h,"__esModule",{value:!0})})}}),pa=_e({"src/lib/is_plain_object.js"(ee,X){X.exports=function(x){return window&&window.process&&window.process.versions?Object.prototype.toString.call(x)==="[object Object]":Object.prototype.toString.call(x)==="[object Object]"&&Object.getPrototypeOf(x).hasOwnProperty("hasOwnProperty")}}}),lo=_e({"src/lib/array.js"(ee){var X=Un().decode,h=pa(),x=Array.isArray,S=ArrayBuffer,k=DataView;function e(s){return S.isView(s)&&!(s instanceof k)}ee.isTypedArray=e;function t(s){return x(s)||e(s)}ee.isArrayOrTypedArray=t;function r(s){return!t(s[0])}ee.isArray1D=r,ee.ensureArray=function(s,f){return x(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}ee.isArrayBuffer=n,ee.decodeTypedArraySpec=function(s){var f=[],c=i(s),v=c.dtype,p=o[v];if(!p)throw new Error('Error in dtype: "'+v+'"');var T=p.BYTES_PER_ELEMENT,l=c.bdata;n(l)||(l=X(l));var g=c.shape===void 0?[l.byteLength/T]:(""+c.shape).split(",");g.reverse();var b=g.length,A,E,_=+g[0],w=T*_,m=0;if(b===1)f=new p(l);else if(b===2)for(A=+g[1],E=0;E2)return p[A]=p[A]|e,g.set(b,null);if(l){for(f=A;f0)return Math.log(S)/Math.LN10;var e=Math.log(Math.min(k[0],k[1]))/Math.LN10;return h(e)||(e=Math.log(Math.max(k[0],k[1]))/Math.LN10-6),e}}}),Hs=_e({"src/lib/relink_private.js"(ee,X){var h=lo().isArrayOrTypedArray,x=pa();X.exports=function S(k,e){for(var t in e){var r=e[t],o=k[t];if(o!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in k)continue;k[t]=r}else if(h(r)&&h(o)&&x(r[0])){if(t==="customdata"||t==="ids")continue;for(var n=Math.min(r.length,o.length),i=0;ik/2?S-Math.round(S/k)*k:S}X.exports={mod:h,modHalf:x}}}),bs=_e({"node_modules/tinycolor2/tinycolor.js"(ee,X){(function(h){var x=/^\s+/,S=/\s+$/,k=0,e=h.round,t=h.min,r=h.max,o=h.random;function n(Y,le){if(Y=Y||"",le=le||{},Y instanceof n)return Y;if(!(this instanceof n))return new n(Y,le);var ue=i(Y);this._originalInput=Y,this._r=ue.r,this._g=ue.g,this._b=ue.b,this._a=ue.a,this._roundA=e(100*this._a)/100,this._format=le.format||ue.format,this._gradientType=le.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=ue.ok,this._tc_id=k++}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 Y=this.toRgb();return(Y.r*299+Y.g*587+Y.b*114)/1e3},getLuminance:function(){var Y=this.toRgb(),le,ue,Te,Fe,Ve,Xe;return le=Y.r/255,ue=Y.g/255,Te=Y.b/255,le<=.03928?Fe=le/12.92:Fe=h.pow((le+.055)/1.055,2.4),ue<=.03928?Ve=ue/12.92:Ve=h.pow((ue+.055)/1.055,2.4),Te<=.03928?Xe=Te/12.92:Xe=h.pow((Te+.055)/1.055,2.4),.2126*Fe+.7152*Ve+.0722*Xe},setAlpha:function(Y){return this._a=D(Y),this._roundA=e(100*this._a)/100,this},toHsv:function(){var Y=c(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,v:Y.v,a:this._a}},toHsvString:function(){var Y=c(this._r,this._g,this._b),le=e(Y.h*360),ue=e(Y.s*100),Te=e(Y.v*100);return this._a==1?"hsv("+le+", "+ue+"%, "+Te+"%)":"hsva("+le+", "+ue+"%, "+Te+"%, "+this._roundA+")"},toHsl:function(){var Y=s(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,l:Y.l,a:this._a}},toHslString:function(){var Y=s(this._r,this._g,this._b),le=e(Y.h*360),ue=e(Y.s*100),Te=e(Y.l*100);return this._a==1?"hsl("+le+", "+ue+"%, "+Te+"%)":"hsla("+le+", "+ue+"%, "+Te+"%, "+this._roundA+")"},toHex:function(Y){return p(this._r,this._g,this._b,Y)},toHexString:function(Y){return"#"+this.toHex(Y)},toHex8:function(Y){return T(this._r,this._g,this._b,this._a,Y)},toHex8String:function(Y){return"#"+this.toHex8(Y)},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(j(this._r,255)*100)+"%",g:e(j(this._g,255)*100)+"%",b:e(j(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+e(j(this._r,255)*100)+"%, "+e(j(this._g,255)*100)+"%, "+e(j(this._b,255)*100)+"%)":"rgba("+e(j(this._r,255)*100)+"%, "+e(j(this._g,255)*100)+"%, "+e(j(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:U[p(this._r,this._g,this._b,!0)]||!1},toFilter:function(Y){var le="#"+l(this._r,this._g,this._b,this._a),ue=le,Te=this._gradientType?"GradientType = 1, ":"";if(Y){var Fe=n(Y);ue="#"+l(Fe._r,Fe._g,Fe._b,Fe._a)}return"progid:DXImageTransform.Microsoft.gradient("+Te+"startColorstr="+le+",endColorstr="+ue+")"},toString:function(Y){var le=!!Y;Y=Y||this._format;var ue=!1,Te=this._a<1&&this._a>=0,Fe=!le&&Te&&(Y==="hex"||Y==="hex6"||Y==="hex3"||Y==="hex4"||Y==="hex8"||Y==="name");return Fe?Y==="name"&&this._a===0?this.toName():this.toRgbString():(Y==="rgb"&&(ue=this.toRgbString()),Y==="prgb"&&(ue=this.toPercentageRgbString()),(Y==="hex"||Y==="hex6")&&(ue=this.toHexString()),Y==="hex3"&&(ue=this.toHexString(!0)),Y==="hex4"&&(ue=this.toHex8String(!0)),Y==="hex8"&&(ue=this.toHex8String()),Y==="name"&&(ue=this.toName()),Y==="hsl"&&(ue=this.toHslString()),Y==="hsv"&&(ue=this.toHsvString()),ue||this.toHexString())},clone:function(){return n(this.toString())},_applyModification:function(Y,le){var ue=Y.apply(null,[this].concat([].slice.call(le)));return this._r=ue._r,this._g=ue._g,this._b=ue._b,this.setAlpha(ue._a),this},lighten:function(){return this._applyModification(E,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(b,arguments)},greyscale:function(){return this._applyModification(A,arguments)},spin:function(){return this._applyModification(m,arguments)},_applyCombination:function(Y,le){return Y.apply(null,[this].concat([].slice.call(le)))},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(R,arguments)},triad:function(){return this._applyCombination(d,arguments)},tetrad:function(){return this._applyCombination(y,arguments)}},n.fromRatio=function(Y,le){if(typeof Y=="object"){var ue={};for(var Te in Y)Y.hasOwnProperty(Te)&&(Te==="a"?ue[Te]=Y[Te]:ue[Te]=ge(Y[Te]));Y=ue}return n(Y,le)};function i(Y){var le={r:0,g:0,b:0},ue=1,Te=null,Fe=null,Ve=null,Xe=!1,We=!1;return typeof Y=="string"&&(Y=me(Y)),typeof Y=="object"&&(Q(Y.r)&&Q(Y.g)&&Q(Y.b)?(le=a(Y.r,Y.g,Y.b),Xe=!0,We=String(Y.r).substr(-1)==="%"?"prgb":"rgb"):Q(Y.h)&&Q(Y.s)&&Q(Y.v)?(Te=ge(Y.s),Fe=ge(Y.v),le=v(Y.h,Te,Fe),Xe=!0,We="hsv"):Q(Y.h)&&Q(Y.s)&&Q(Y.l)&&(Te=ge(Y.s),Ve=ge(Y.l),le=f(Y.h,Te,Ve),Xe=!0,We="hsl"),Y.hasOwnProperty("a")&&(ue=Y.a)),ue=D(ue),{ok:Xe,format:Y.format||We,r:t(255,r(le.r,0)),g:t(255,r(le.g,0)),b:t(255,r(le.b,0)),a:ue}}function a(Y,le,ue){return{r:j(Y,255)*255,g:j(le,255)*255,b:j(ue,255)*255}}function s(Y,le,ue){Y=j(Y,255),le=j(le,255),ue=j(ue,255);var Te=r(Y,le,ue),Fe=t(Y,le,ue),Ve,Xe,We=(Te+Fe)/2;if(Te==Fe)Ve=Xe=0;else{var it=Te-Fe;switch(Xe=We>.5?it/(2-Te-Fe):it/(Te+Fe),Te){case Y:Ve=(le-ue)/it+(le1&&(mt-=1),mt<1/6?yt+(bt-yt)*6*mt:mt<1/2?bt:mt<2/3?yt+(bt-yt)*(2/3-mt)*6:yt}if(le===0)Te=Fe=Ve=ue;else{var We=ue<.5?ue*(1+le):ue+le-ue*le,it=2*ue-We;Te=Xe(it,We,Y+1/3),Fe=Xe(it,We,Y),Ve=Xe(it,We,Y-1/3)}return{r:Te*255,g:Fe*255,b:Ve*255}}function c(Y,le,ue){Y=j(Y,255),le=j(le,255),ue=j(ue,255);var Te=r(Y,le,ue),Fe=t(Y,le,ue),Ve,Xe,We=Te,it=Te-Fe;if(Xe=Te===0?0:it/Te,Te==Fe)Ve=0;else{switch(Te){case Y:Ve=(le-ue)/it+(le>1)+720)%360;--le;)Te.h=(Te.h+Fe)%360,Ve.push(n(Te));return Ve}function z(Y,le){le=le||6;for(var ue=n(Y).toHsv(),Te=ue.h,Fe=ue.s,Ve=ue.v,Xe=[],We=1/le;le--;)Xe.push(n({h:Te,s:Fe,v:Ve})),Ve=(Ve+We)%1;return Xe}n.mix=function(Y,le,ue){ue=ue===0?0:ue||50;var Te=n(Y).toRgb(),Fe=n(le).toRgb(),Ve=ue/100,Xe={r:(Fe.r-Te.r)*Ve+Te.r,g:(Fe.g-Te.g)*Ve+Te.g,b:(Fe.b-Te.b)*Ve+Te.b,a:(Fe.a-Te.a)*Ve+Te.a};return n(Xe)},n.readability=function(Y,le){var ue=n(Y),Te=n(le);return(h.max(ue.getLuminance(),Te.getLuminance())+.05)/(h.min(ue.getLuminance(),Te.getLuminance())+.05)},n.isReadable=function(Y,le,ue){var Te=n.readability(Y,le),Fe,Ve;switch(Ve=!1,Fe=ie(ue),Fe.level+Fe.size){case"AAsmall":case"AAAlarge":Ve=Te>=4.5;break;case"AAlarge":Ve=Te>=3;break;case"AAAsmall":Ve=Te>=7;break}return Ve},n.mostReadable=function(Y,le,ue){var Te=null,Fe=0,Ve,Xe,We,it;ue=ue||{},Xe=ue.includeFallbackColors,We=ue.level,it=ue.size;for(var yt=0;ytFe&&(Fe=Ve,Te=n(le[yt]));return n.isReadable(Y,Te,{level:We,size:it})||!Xe?Te:(ue.includeFallbackColors=!1,n.mostReadable(Y,["#fff","#000"],ue))};var N=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"},U=n.hexNames=B(N);function B(Y){var le={};for(var ue in Y)Y.hasOwnProperty(ue)&&(le[Y[ue]]=ue);return le}function D(Y){return Y=parseFloat(Y),(isNaN(Y)||Y<0||Y>1)&&(Y=1),Y}function j(Y,le){oe(Y)&&(Y="100%");var ue=ye(Y);return Y=t(le,r(0,parseFloat(Y))),ue&&(Y=parseInt(Y*le,10)/100),h.abs(Y-le)<1e-6?1:Y%le/parseFloat(le)}function q(Y){return t(1,r(0,Y))}function J(Y){return parseInt(Y,16)}function oe(Y){return typeof Y=="string"&&Y.indexOf(".")!=-1&&parseFloat(Y)===1}function ye(Y){return typeof Y=="string"&&Y.indexOf("%")!=-1}function pe(Y){return Y.length==1?"0"+Y:""+Y}function ge(Y){return Y<=1&&(Y=Y*100+"%"),Y}function W(Y){return h.round(parseFloat(Y)*255).toString(16)}function ae(Y){return J(Y)/255}var se=function(){var Y="[-\\+]?\\d+%?",le="[-\\+]?\\d*\\.\\d+%?",ue="(?:"+le+")|(?:"+Y+")",Te="[\\s|\\(]+("+ue+")[,|\\s]+("+ue+")[,|\\s]+("+ue+")\\s*\\)?",Fe="[\\s|\\(]+("+ue+")[,|\\s]+("+ue+")[,|\\s]+("+ue+")[,|\\s]+("+ue+")\\s*\\)?";return{CSS_UNIT:new RegExp(ue),rgb:new RegExp("rgb"+Te),rgba:new RegExp("rgba"+Fe),hsl:new RegExp("hsl"+Te),hsla:new RegExp("hsla"+Fe),hsv:new RegExp("hsv"+Te),hsva:new RegExp("hsva"+Fe),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 Q(Y){return!!se.CSS_UNIT.exec(Y)}function me(Y){Y=Y.replace(x,"").replace(S,"").toLowerCase();var le=!1;if(N[Y])Y=N[Y],le=!0;else if(Y=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ue;return(ue=se.rgb.exec(Y))?{r:ue[1],g:ue[2],b:ue[3]}:(ue=se.rgba.exec(Y))?{r:ue[1],g:ue[2],b:ue[3],a:ue[4]}:(ue=se.hsl.exec(Y))?{h:ue[1],s:ue[2],l:ue[3]}:(ue=se.hsla.exec(Y))?{h:ue[1],s:ue[2],l:ue[3],a:ue[4]}:(ue=se.hsv.exec(Y))?{h:ue[1],s:ue[2],v:ue[3]}:(ue=se.hsva.exec(Y))?{h:ue[1],s:ue[2],v:ue[3],a:ue[4]}:(ue=se.hex8.exec(Y))?{r:J(ue[1]),g:J(ue[2]),b:J(ue[3]),a:ae(ue[4]),format:le?"name":"hex8"}:(ue=se.hex6.exec(Y))?{r:J(ue[1]),g:J(ue[2]),b:J(ue[3]),format:le?"name":"hex"}:(ue=se.hex4.exec(Y))?{r:J(ue[1]+""+ue[1]),g:J(ue[2]+""+ue[2]),b:J(ue[3]+""+ue[3]),a:ae(ue[4]+""+ue[4]),format:le?"name":"hex8"}:(ue=se.hex3.exec(Y))?{r:J(ue[1]+""+ue[1]),g:J(ue[2]+""+ue[2]),b:J(ue[3]+""+ue[3]),format:le?"name":"hex"}:!1}function ie(Y){var le,ue;return Y=Y||{level:"AA",size:"small"},le=(Y.level||"AA").toUpperCase(),ue=(Y.size||"small").toLowerCase(),le!=="AA"&&le!=="AAA"&&(le="AA"),ue!=="small"&&ue!=="large"&&(ue="small"),{level:le,size:ue}}typeof X<"u"&&X.exports?X.exports=n:window.tinycolor=n})(Math)}}),po=_e({"src/lib/extend.js"(ee){var X=pa(),h=Array.isArray;function x(k,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 v=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return f?"rgba("+v+", "+s[3]+")":"rgb("+v+")"}}}),Of=_e({"src/constants/interactions.js"(ee,X){X.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),ch=_e({"src/lib/regex.js"(ee){ee.counter=function(X,h,x,S){var k=(h||"")+(x?"":"$"),e=S===!1?"":"^";return X==="xy"?new RegExp(e+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+k):new RegExp(e+X+"([2-9]|[1-9][0-9]+)?"+k)}}}),_d=_e({"src/lib/coerce.js"(ee){var X=jn(),h=bs(),x=po().extendFlat,S=Zs(),k=jc(),e=so(),t=Of().DESELECTDIM,r=ji(),o=ch().counter,n=Rl().modHalf,i=lo().isArrayOrTypedArray,a=lo().isTypedArraySpec,s=lo().decodeTypedArraySpec;ee.valObjectMeta={data_array:{coerceFunction:function(c,v,p){v.set(i(c)?c:a(c)?s(c):p)}},enumerated:{coerceFunction:function(c,v,p,T){T.coerceNumber&&(c=+c),T.values.indexOf(c)===-1?v.set(p):v.set(c)},validateFunction:function(c,v){v.coerceNumber&&(c=+c);for(var p=v.values,T=0;Tg===!0||g===!1;l(c)||T.arrayOk&&Array.isArray(c)&&c.length>0&&c.every(l)?v.set(c):v.set(p)}},number:{coerceFunction:function(c,v,p,T){a(c)&&(c=s(c)),!X(c)||T.min!==void 0&&cT.max?v.set(p):v.set(+c)}},integer:{coerceFunction:function(c,v,p,T){if((T.extras||[]).indexOf(c)!==-1){v.set(c);return}a(c)&&(c=s(c)),c%1||!X(c)||T.min!==void 0&&cT.max?v.set(p):v.set(+c)}},string:{coerceFunction:function(c,v,p,T){if(typeof c!="string"){var l=typeof c=="number";T.strict===!0||!l?v.set(p):v.set(String(c))}else T.noBlank&&!c?v.set(p):v.set(c)}},color:{coerceFunction:function(c,v,p){a(c)&&(c=s(c)),h(c).isValid()?v.set(c):v.set(p)}},colorlist:{coerceFunction:function(c,v,p){function T(l){return h(l).isValid()}!Array.isArray(c)||!c.length?v.set(p):c.every(T)?v.set(c):v.set(p)}},colorscale:{coerceFunction:function(c,v,p){v.set(k.get(c,p))}},angle:{coerceFunction:function(c,v,p){a(c)&&(c=s(c)),c==="auto"?v.set("auto"):X(c)?v.set(n(+c,360)):v.set(p)}},subplotid:{coerceFunction:function(c,v,p,T){var l=T.regex||o(p);const g=b=>typeof b=="string"&&l.test(b);g(c)||T.arrayOk&&i(c)&&c.length>0&&c.every(g)?v.set(c):v.set(p)},validateFunction:function(c,v){var p=v.dflt;return c===p?!0:typeof c!="string"?!1:!!o(p).test(c)}},flaglist:{coerceFunction:function(c,v,p,T){if((T.extras||[]).indexOf(c)!==-1){v.set(c);return}if(typeof c!="string"){v.set(p);return}for(var l=c.split("+"),g=0;g/g),c=0;c1){var e=["LOG:"];for(k=0;k1){var t=[];for(k=0;k"),"long")}},S.warn=function(){var k;if(h.logging>0){var e=["WARN:"];for(k=0;k0){var t=[];for(k=0;k"),"stick")}},S.error=function(){var k;if(h.logging>0){var e=["ERROR:"];for(k=0;k0){var t=[];for(k=0;k"),"stick")}}}}),xd=_e({"src/lib/noop.js"(ee,X){X.exports=function(){}}}),Tf=_e({"src/lib/push_unique.js"(ee,X){X.exports=function(x,S){if(S instanceof RegExp){for(var k=S.toString(),e=0;ewe({valType:"string",dflt:"",editType:k},e!==!1?{arrayOk:!0}:{}),ee.texttemplateAttrs=({editType:k="calc",arrayOk:e}={},t={})=>we({valType:"string",dflt:"",editType:k},e!==!1?{arrayOk:!0}:{}),ee.shapeTexttemplateAttrs=({editType:k="arraydraw",newshape:e}={},t={})=>({valType:"string",dflt:"",editType:k}),ee.templatefallbackAttrs=({editType:k="none"}={})=>({valType:"any",dflt:"-",editType:k})}}),Vn=_e({"src/components/shapes/label_texttemplate.js"(ee,X){function h(g,b){return b?b.d2l(g):g}function x(g,b){return b?b.l2d(g):g}function S(g){return g.x0}function k(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,b){return h(g.x1,b)+o(g)-h(g.x0,b)-r(g)}function s(g,b,A){return h(g.y1,A)+i(g)-h(g.y0,A)-n(g)}function f(g,b){return Math.abs(a(g,b))}function c(g,b,A){return Math.abs(s(g,b,A))}function v(g,b,A){return g.type!=="line"?void 0:Math.sqrt(Math.pow(a(g,b),2)+Math.pow(s(g,b,A),2))}function p(g,b){return x((h(g.x1,b)+o(g)+h(g.x0,b)+r(g))/2,b)}function T(g,b,A){return x((h(g.y1,A)+i(g)+h(g.y0,A)+n(g))/2,A)}function l(g,b,A){return g.type!=="line"?void 0:s(g,b,A)/a(g,b)}X.exports={x0:S,x1:k,y0:e,y1:t,slope:l,dx:a,dy:s,width:f,height:c,length:v,xcenter:p,ycenter:T}}}),La=_e({"src/components/shapes/draw_newshape/attributes.js"(ee,X){var h=nc().overrideAll,x=Zs(),S=es(),k=Qf().dash,e=po().extendFlat,{shapeTexttemplateAttrs:t,templatefallbackAttrs:r}=fu(),o=Vn();X.exports=h({newshape:{visible:e({},x.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:e({},x.legend,{}),legendgroup:e({},x.legendgroup,{}),legendgrouptitle:{text:e({},x.legendgrouptitle.text,{}),font:S({})},legendrank:e({},x.legendrank,{}),legendwidth:e({},x.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:e({},k,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:e({},x.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:t({newshape:!0},{keys:Object.keys(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")}}),si=_e({"src/components/selections/draw_newselection/attributes.js"(ee,X){var h=Qf().dash,x=po().extendFlat;X.exports={newselection:{mode:{valType:"enumerated",values:["immediate","gradual"],dflt:"immediate",editType:"none"},line:{color:{valType:"color",editType:"none"},width:{valType:"number",min:1,dflt:1,editType:"none"},dash:x({},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"}}}}),Pi=_e({"src/plots/pad_attributes.js"(ee,X){X.exports=function(h){var x=h.editType;return{t:{valType:"number",dflt:0,editType:x},r:{valType:"number",dflt:0,editType:x},b:{valType:"number",dflt:0,editType:x},l:{valType:"number",dflt:0,editType:x},editType:x}}}}),Bi=_e({"src/plots/layout_attributes.js"(ee,X){var h=es(),x=Rp(),S=Hl(),k=La(),e=si(),t=Pi(),r=po().extendFlat,o=h({editType:"calc"});o.family.dflt='"Open Sans", verdana, arial, sans-serif',o.size.dflt=12,o.color.dflt=S.defaultLine,X.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:k.newshape,activeshape:k.activeshape,newselection:e.newselection,activeselection:e.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:r({},x.transition,{editType:"none"})}}}),Qi=_e({"node_modules/maplibre-gl/dist/maplibre-gl.css"(){(function(){if(!document.getElementById("696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97")){var ee=document.createElement("style");ee.id="696e55e75aaafa12d45b3ff634eadc8348f9c3015fc94984dac1ff824773eb97",ee.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(ee)}})()}}),bi=_e({"src/registry.js"(ee){var X=Hh(),h=xd(),x=Tf(),S=pa(),k=Dp().addStyleRule,e=po(),t=Zs(),r=Bi(),o=e.extendFlat,n=e.extendDeepAll;ee.modules={},ee.allCategories={},ee.allTypes=[],ee.subplotsRegistry={},ee.componentsRegistry={},ee.layoutArrayContainers=[],ee.layoutArrayRegexes=[],ee.traceLayoutAttributes={},ee.localeRegistry={},ee.apiMethodRegistry={},ee.collectableSubplotTypes=null,ee.register=function(b){if(ee.collectableSubplotTypes=null,b)b&&!Array.isArray(b)&&(b=[b]);else throw new Error("No argument passed to Plotly.register.");for(var A=0;A=l&&N<=g?N:e}if(typeof N!="string"&&typeof N!="number")return e;N=String(N);var q=p(U),J=N.charAt(0);q&&(J==="G"||J==="g")&&(N=N.slice(1),U="");var oe=q&&U.slice(0,7)==="chinese",ye=N.match(oe?c:f);if(!ye)return e;var pe=ye[1],ge=ye[3]||"1",W=Number(ye[5]||1),ae=Number(ye[7]||0),se=Number(ye[9]||0),Q=Number(ye[11]||0);if(q){if(pe.length===2)return e;pe=Number(pe);var me;try{var ie=a.getComponentMethod("calendars","getCal")(U);if(oe){var Y=ge.charAt(ge.length-1)==="i";ge=parseInt(ge,10),me=ie.newDate(pe,ie.toMonthIndex(pe,ge,Y),W)}else me=ie.newDate(pe,Number(ge),W)}catch{return e}return me?(me.toJD()-i)*t+ae*r+se*o+Q*n:e}pe.length===2?pe=(Number(pe)+2e3-v)%100+v:pe=Number(pe),ge-=1;var le=new Date(Date.UTC(2e3,ge,W,ae,se));return le.setUTCFullYear(pe),le.getUTCMonth()!==ge||le.getUTCDate()!==W?e:le.getTime()+Q*n},l=ee.MIN_MS=ee.dateTime2ms("-9999"),g=ee.MAX_MS=ee.dateTime2ms("9999-12-31 23:59:59.9999"),ee.isDateTime=function(N,U){return ee.dateTime2ms(N,U)!==e};function b(N,U){return String(N+Math.pow(10,U)).slice(1)}var A=90*t,E=3*r,_=5*o;ee.ms2DateTime=function(N,U,B){if(typeof N!="number"||!(N>=l&&N<=g))return e;U||(U=0);var D=Math.floor(S(N+.05,1)*10),j=Math.round(N-D/10),q,J,oe,ye,pe,ge;if(p(B)){var W=Math.floor(j/t)+i,ae=Math.floor(S(N,t));try{q=a.getComponentMethod("calendars","getCal")(B).fromJD(W).formatDate("yyyy-mm-dd")}catch{q=s("G%Y-%m-%d")(new Date(j))}if(q.charAt(0)==="-")for(;q.length<11;)q="-0"+q.slice(1);else for(;q.length<10;)q="0"+q;J=U=l+t&&N<=g-t))return e;var U=Math.floor(S(N+.05,1)*10),B=new Date(Math.round(N-U/10)),D=X("%Y-%m-%d")(B),j=B.getHours(),q=B.getMinutes(),J=B.getSeconds(),oe=B.getUTCMilliseconds()*10+U;return w(D,j,q,J,oe)};function w(N,U,B,D,j){if((U||B||D||j)&&(N+=" "+b(U,2)+":"+b(B,2),(D||j)&&(N+=":"+b(D,2),j))){for(var q=4;j%10===0;)q-=1,j/=10;N+="."+b(j,q)}return N}ee.cleanDate=function(N,U,B){if(N===e)return U;if(ee.isJSDate(N)||typeof N=="number"&&isFinite(N)){if(p(B))return x.error("JS Dates and milliseconds are incompatible with world calendars",N),U;if(N=ee.ms2DateTimeLocal(+N),!N&&U!==void 0)return U}else if(!ee.isDateTime(N,B))return x.error("unrecognized date",N),U;return N};var m=/%\d?f/g,u=/%h/g,d={1:"1",2:"1",3:"2",4:"2"};function y(N,U,B,D){N=N.replace(m,function(q){var J=Math.min(+q.charAt(1)||6,6),oe=(U/1e3%1+2).toFixed(J).slice(2).replace(/0+$/,"")||"0";return oe});var j=new Date(Math.floor(U+.05));if(N=N.replace(u,function(){return d[B("%q")(j)]}),p(D))try{N=a.getComponentMethod("calendars","worldCalFmt")(N,U,D)}catch{return"Invalid"}return B(N)(j)}var R=[59,59.9,59.99,59.999,59.9999];function L(N,U){var B=S(N+.05,t),D=b(Math.floor(B/r),2)+":"+b(S(Math.floor(B/o),60),2);if(U!=="M"){h(U)||(U=0);var j=Math.min(S(N/n,60),R[U]),q=(100+j).toFixed(U).slice(1);U>0&&(q=q.replace(/0+$/,"").replace(/[\.]$/,"")),D+=":"+q}return D}ee.formatDate=function(N,U,B,D,j,q){if(j=p(j)&&j,!U)if(B==="y")U=q.year;else if(B==="m")U=q.month;else if(B==="d")U=q.dayMonth+` `+q.year;else return L(N,B)+` `+y(q.dayMonthYear,N,D,j);return y(U,N,D,j)};var z=3*t;ee.incrementMonth=function(N,U,B){B=p(B)&&B;var D=S(N,t);if(N=Math.round(N-D),B)try{var j=Math.round(N/t)+i,q=a.getComponentMethod("calendars","getCal")(B),J=q.fromJD(j);return U%12?q.add(J,U,"m"):q.add(J,U/12,"y"),(J.toJD()-i)*t+D}catch{x.error("invalid ms "+N+" in calendar "+B)}var oe=new Date(N+z);return oe.setUTCMonth(oe.getUTCMonth()+U)+D-z},ee.findExactDates=function(N,U){for(var B=0,D=0,j=0,q=0,J,oe,ye=p(U)&&a.getComponentMethod("calendars","getCal")(U),pe=0;pe1?(i[f-1]-i[0])/(f-1):1,p,T;for(v>=0?T=a?e:t:T=a?o:r,n+=v*k*(a?-1:1)*(v>=0?1:-1);s90&&h.log("Long binary search..."),s-1};function e(n,i){return ni}function o(n,i){return n>=i}ee.sorterAsc=function(n,i){return n-i},ee.sorterDes=function(n,i){return i-n},ee.distinctVals=function(n){var i=n.slice();i.sort(ee.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=[],v,p=0;p<=a;p++){var T=i[p],l=T-v;v===void 0?(c.push(T),v=T):l>f&&(s=Math.min(s,l),c.push(T),v=T)}return{vals:c,minDiff:s}},ee.roundUp=function(n,i,a){for(var s=0,f=i.length-1,c,v=0,p=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()},ee.findIndexOfMin=function(n,i){i=i||x;for(var a=1/0,s,f=0;fk.length)&&(e=k.length),X(S)||(S=!1),h(k[0])){for(r=new Array(e),t=0;tx.length-1)return x[x.length-1];var k=S%1;return k*x[Math.ceil(S)]+(1-k)*x[Math.floor(S)]}}}),Lh=_e({"src/lib/angles.js"(ee,X){var h=Rl(),x=h.mod,S=h.modHalf,k=Math.PI,e=2*k;function t(T){return T/180*k}function r(T){return T/k*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,b;l[0]b&&(b+=e);var A=x(T,e),E=A+e;return A>=g&&A<=b||E>=g&&E<=b}function s(T,l,g,b){if(!a(l,b))return!1;var A,E;return g[0]=A&&T<=E}function f(T,l,g,b,A,E,_){A=A||0,E=E||0;var w=o([g,b]),m,u,d,y,R;w?(m=0,u=k,d=e):g1/3&&h.x<2/3},ee.isRightAnchor=function(h){return h.xanchor==="right"||h.xanchor==="auto"&&h.x>=2/3},ee.isTopAnchor=function(h){return h.yanchor==="top"||h.yanchor==="auto"&&h.y>=2/3},ee.isMiddleAnchor=function(h){return h.yanchor==="middle"||h.yanchor==="auto"&&h.y>1/3&&h.y<2/3},ee.isBottomAnchor=function(h){return h.yanchor==="bottom"||h.yanchor==="auto"&&h.y<=1/3}}}),Yu=_e({"src/lib/geometry2d.js"(ee){var X=Rl().mod;ee.segmentsIntersect=h;function h(t,r,o,n,i,a,s,f){var c=o-t,v=i-t,p=s-i,T=n-r,l=a-r,g=f-a,b=c*g-p*T;if(b===0)return null;var A=(v*g-p*l)/b,E=(v*T-c*l)/b;return E<0||E>1||A<0||A>1?null:{x:t+c*A,y:r+T*A}}ee.segmentDistance=function(r,o,n,i,a,s,f,c){if(h(r,o,n,i,a,s,f,c))return 0;var v=n-r,p=i-o,T=f-a,l=c-s,g=v*v+p*p,b=T*T+l*l,A=Math.min(x(v,p,g,a-r,s-o),x(v,p,g,f-r,c-o),x(T,l,b,r-a,o-s),x(T,l,b,n-a,i-s));return Math.sqrt(A)};function x(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,k,e;ee.getTextLocation=function(r,o,n,i){if((r!==k||i!==e)&&(S={},k=r,e=i),S[n])return S[n];var a=r.getPointAtLength(X(n-i/2,o)),s=r.getPointAtLength(X(n+i/2,o)),f=Math.atan((s.y-a.y)/(s.x-a.x)),c=r.getPointAtLength(X(n,o)),v=(c.x*4+a.x+s.x)/6,p=(c.y*4+a.y+s.y)/6,T={x:v,y:p,theta:f};return S[n]=T,T},ee.clearLocationCache=function(){k=null},ee.getVisibleSegment=function(r,o,n){var i=o.left,a=o.right,s=o.top,f=o.bottom,c=0,v=r.getTotalLength(),p=v,T,l;function g(A){var E=r.getPointAtLength(A);A===0?T=E:A===v&&(l=E);var _=E.xa?E.x-a:0,w=E.yf?E.y-f:0;return Math.sqrt(_*_+w*w)}for(var b=g(c);b;){if(c+=b+n,c>p)return;b=g(c)}for(b=g(p);b;){if(p-=b+n,c>p)return;b=g(p)}return{min:c,max:p,len:p-c,total:v,isClosed:c===0&&p===v&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},ee.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,v=0,p=0,T=a,l,g,b;v0?T=l:p=l,v++}return g}}}),tf=_e({"src/lib/throttle.js"(ee){var X={};ee.throttle=function(S,k,e){var t=X[S],r=Date.now();if(!t){for(var o in X)X[o].tst.ts+k){n();return}t.timer=setTimeout(function(){n(),t.timer=null},k)},ee.done=function(x){var S=X[x];return!S||!S.timer?Promise.resolve():new Promise(function(k){var e=S.onDone;S.onDone=function(){e&&e(),k(),S.onDone=null}})},ee.clear=function(x){if(x)h(X[x]),delete X[x];else for(var S in X)ee.clear(S)};function h(x){x&&x.timer!==null&&(clearTimeout(x.timer),x.timer=null)}}}),Wd=_e({"src/lib/clear_responsive.js"(ee,X){X.exports=function(x){x._responsiveChartHandler&&(window.removeEventListener("resize",x._responsiveChartHandler),delete x._responsiveChartHandler)}}}),mp=_e({"node_modules/is-mobile/index.js"(ee,X){X.exports=k,X.exports.isMobile=k,X.exports.default=k;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,x=/CrOS/,S=/android|ipad|playbook|silk/i;function k(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)&&!x.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}}}),ig=_e({"src/lib/preserve_drawing_buffer.js"(ee,X){var h=jn(),x=mp();X.exports=function(e){var t;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:t=S(),typeof t!="string")return!0;var r=x({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 k;return typeof navigator<"u"&&(k=navigator.userAgent),k&&k.headers&&typeof k.headers["user-agent"]=="string"&&(k=k.headers["user-agent"]),k}}}),og=_e({"src/lib/make_trace_groups.js"(ee,X){var h=mr();X.exports=function(S,k,e){var t=S.selectAll("g."+e.replace(/\s/g,".")).data(k,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}}}),gy=_e({"src/lib/localize.js"(ee,X){var h=bi();X.exports=function(S,k){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[k];if(i)return i}r=h.localeRegistry}var a=e.split("-")[0];if(a===e)break;e=a}return k}}}),wd=_e({"src/lib/filter_unique.js"(ee,X){X.exports=function(x){for(var S={},k=[],e=0,t=0;t1?(k*x+k*S)/k:x+S,t=String(e).length;if(t>16){var r=String(S).length,o=String(x).length;if(t>=o+r){var n=parseFloat(e).toPrecision(12);n.indexOf("e+")===-1&&(e=+n)}}return e}}}),_y=_e({"src/lib/clean_number.js"(ee,X){var h=jn(),x=qn().BADNUM,S=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;X.exports=function(e){return typeof e=="string"&&(e=e.replace(S,"")),h(e)?Number(e):x}}}),kn=_e({"src/lib/index.js"(ee,X){var h=mr(),x=On().utcFormat,S=ba().format,k=jn(),e=qn(),t=e.FP_SAFE,r=-t,o=e.BADNUM,n=X.exports={};n.adjustFormat=function(Y){return!Y||/^\d[.]\df/.test(Y)||/[.]\d%/.test(Y)?Y:Y==="0.f"?"~f":/^\d%/.test(Y)?"~%":/^\ds/.test(Y)?"~s":!/^[~,.0$]/.test(Y)&&/[&fps]/.test(Y)?"~"+Y:Y};var i={};n.warnBadFormat=function(ie){var Y=String(ie);i[Y]||(i[Y]=1,n.warn('encountered bad format: "'+Y+'"'))},n.noFormat=function(ie){return String(ie)},n.numberFormat=function(ie){var Y;try{Y=S(n.adjustFormat(ie))}catch{return n.warnBadFormat(ie),n.noFormat}return Y},n.nestedProperty=ji(),n.keyedContainer=Fo(),n.relativeAttr=Qo(),n.isPlainObject=pa(),n.toLogRange=Sl(),n.relinkPrivateKeys=Hs();var a=lo();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=Rl();n.mod=s.mod,n.modHalf=s.modHalf;var f=_d();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=pl();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 v=vu();n.findBin=v.findBin,n.sorterAsc=v.sorterAsc,n.sorterDes=v.sorterDes,n.distinctVals=v.distinctVals,n.roundUp=v.roundUp,n.sort=v.sort,n.findIndexOfMin=v.findIndexOfMin,n.sortObjectKeys=ec();var p=$h();n.aggNums=p.aggNums,n.len=p.len,n.mean=p.mean,n.geometricMean=p.geometricMean,n.median=p.median,n.midRange=p.midRange,n.variance=p.variance,n.stdev=p.stdev,n.interp=p.interp;var T=iv();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=Lh();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=Ki();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 b=Yu();n.segmentsIntersect=b.segmentsIntersect,n.segmentDistance=b.segmentDistance,n.getTextLocation=b.getTextLocation,n.clearLocationCache=b.clearLocationCache,n.getVisibleSegment=b.getVisibleSegment,n.findPointOnPath=b.findPointOnPath;var A=po();n.extendFlat=A.extendFlat,n.extendDeep=A.extendDeep,n.extendDeepAll=A.extendDeepAll,n.extendDeepNoArrays=A.extendDeepNoArrays;var E=Hh();n.log=E.log,n.warn=E.warn,n.error=E.error;var _=ch();n.counterRegex=_.counter;var w=tf();n.throttle=w.throttle,n.throttleDone=w.done,n.clearThrottle=w.clear;var m=Dp();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=Wd(),n.preserveDrawingBuffer=ig(),n.makeTraceGroups=og(),n._=gy(),n.notifier=op(),n.filterUnique=wd(),n.filterVisible=tm(),n.pushUnique=Tf(),n.increment=yy(),n.cleanNumber=_y(),n.ensureNumber=function(Y){return k(Y)?(Y=Number(Y),Y>t||Y=Y?!1:k(ie)&&ie>=0&&ie%1===0},n.noop=xd(),n.identity=Ss(),n.repeat=function(ie,Y){for(var le=new Array(Y),ue=0;uele?Math.max(le,Math.min(Y,ie)):Math.max(Y,Math.min(le,ie))},n.bBoxIntersect=function(ie,Y,le){return le=le||0,ie.left<=Y.right+le&&Y.left<=ie.right+le&&ie.top<=Y.bottom+le&&Y.top<=ie.bottom+le},n.simpleMap=function(ie,Y,le,ue,Te){for(var Fe=ie.length,Ve=new Array(Fe),Xe=0;Xe=Math.pow(2,le)?Te>10?(n.warn("randstr failed uniqueness"),Ve):ie(Y,le,ue,(Te||0)+1):Ve},n.OptionControl=function(ie,Y){ie||(ie={}),Y||(Y="opt");var le={};return le.optionList=[],le._newoption=function(ue){ue[Y]=ie,le[ue.name]=ue,le.optionList.push(ue)},le["_"+Y]=ie,le},n.smooth=function(ie,Y){if(Y=Math.round(Y)||0,Y<2)return ie;var le=ie.length,ue=2*le,Te=2*Y-1,Fe=new Array(Te),Ve=new Array(le),Xe,We,it,yt;for(Xe=0;Xe=ue&&(it-=ue*Math.floor(it/ue)),it<0?it=-1-it:it>=le&&(it=ue-1-it),yt+=ie[it]*Fe[We];Ve[Xe]=yt}return Ve},n.syncOrAsync=function(ie,Y,le){var ue,Te;function Fe(){return n.syncOrAsync(ie,Y,le)}for(;ie.length;)if(Te=ie.splice(0,1)[0],ue=Te(Y),ue&&ue.then)return ue.then(Fe);return le&&le(Y)},n.stripTrailingSlash=function(ie){return ie.slice(-1)==="/"?ie.slice(0,-1):ie},n.noneOrAll=function(ie,Y,le){if(ie){var ue=!1,Te=!0,Fe,Ve;for(Fe=0;Fe0?Te:0})},n.fillArray=function(ie,Y,le,ue){if(ue=ue||n.identity,n.isArrayOrTypedArray(ie))for(var Te=0;TeL.test(window.navigator.userAgent);var z=/Firefox\/(\d+)\.\d+/;n.getFirefoxVersion=function(){var ie=z.exec(window.navigator.userAgent);if(ie&&ie.length===2){var Y=parseInt(ie[1]);if(!isNaN(Y))return Y}return null},n.isD3Selection=function(ie){return ie instanceof h.selection},n.ensureSingle=function(ie,Y,le,ue){var Te=ie.select(Y+(le?"."+le:""));if(Te.size())return Te;var Fe=ie.append(Y);return le&&Fe.classed(le,!0),ue&&Fe.call(ue),Fe},n.ensureSingleById=function(ie,Y,le,ue){var Te=ie.select(Y+"#"+le);if(Te.size())return Te;var Fe=ie.append(Y).attr("id",le);return ue&&Fe.call(ue),Fe},n.objectFromPath=function(ie,Y){for(var le=ie.split("."),ue,Te=ue={},Fe=0;Fe1?Te+Ve[1]:"";if(Fe&&(Ve.length>1||Xe.length>4||le))for(;ue.test(Xe);)Xe=Xe.replace(ue,"$1"+Fe+"$2");return Xe+We},n.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var D=/^\w*$/;n.templateString=function(ie,Y){var le={};return ie.replace(n.TEMPLATE_STRING_REGEX,function(ue,Te){var Fe;return D.test(Te)?Fe=Y[Te]:(le[Te]=le[Te]||n.nestedProperty(Y,Te).get,Fe=le[Te](!0)),Fe!==void 0?Fe:""})};var j={max:10,count:0,name:"hovertemplate"};n.hovertemplateString=ie=>ge(He(we({},ie),{opts:j}));var q={max:10,count:0,name:"texttemplate"};n.texttemplateString=ie=>ge(He(we({},ie),{opts:q}));var J=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function oe(ie){var Y=ie.match(J);return Y?{key:Y[1],op:Y[2],number:Number(Y[3])}:{key:ie,op:null,number:null}}var ye={max:10,count:0,name:"texttemplate",parseMultDiv:!0};n.texttemplateStringForShapes=ie=>ge(He(we({},ie),{opts:ye}));var pe=/^[:|\|]/;function ge({data:ie=[],locale:Y,fallback:le,labels:ue={},opts:Te,template:Fe}){return Fe.replace(n.TEMPLATE_STRING_REGEX,(Ve,Xe,We)=>{const it=["xother","yother"].includes(Xe),yt=["_xother","_yother"].includes(Xe),bt=["_xother_","_yother_"].includes(Xe),mt=["xother_","yother_"].includes(Xe),ht=it||yt||mt||bt;(yt||bt)&&(Xe=Xe.substring(1)),(mt||bt)&&(Xe=Xe.substring(0,Xe.length-1));let qe=null,ze=null;if(Te.parseMultDiv){var Ae=oe(Xe);Xe=Ae.key,qe=Ae.op,ze=Ae.number}let Ke;if(ht){if(ue[Xe]===void 0)return"";Ke=ue[Xe]}else for(const $t of ie)if($t){if($t.hasOwnProperty(Xe)){Ke=$t[Xe];break}if(D.test(Xe)||(Ke=n.nestedProperty($t,Xe).get(!0)),Ke!==void 0)break}if(Ke===void 0){const{count:$t,max:Yt,name:lr}=Te,dr=le===!1?Ve:le;return $t=W&&Ve<=ae,it=Xe>=W&&Xe<=ae;if(We&&(ue=10*ue+Ve-W),it&&(Te=10*Te+Xe-W),!We||!it){if(ue!==Te)return ue-Te;if(Ve!==Xe)return Ve-Xe}}return Te-ue};var se=2e9;n.seedPseudoRandom=function(){se=2e9},n.pseudoRandom=function(){var ie=se;return se=(69069*se+1)%4294967296,Math.abs(se-ie)<429496729?n.pseudoRandom():se/4294967296},n.fillText=function(ie,Y,le){var ue=Array.isArray(le)?function(Ve){le.push(Ve)}:function(Ve){le.text=Ve},Te=n.extractOption(ie,Y,"htx","hovertext");if(n.isValidTextValue(Te))return ue(Te);var Fe=n.extractOption(ie,Y,"tx","text");if(n.isValidTextValue(Fe))return ue(Fe)},n.isValidTextValue=function(ie){return ie||ie===0},n.formatPercent=function(ie,Y){Y=Y||0;for(var le=(Math.round(100*ie*Math.pow(10,Y))*Math.pow(.1,Y)).toFixed(Y)+"%",ue=0;ue1&&(it=1):it=0,n.strTranslate(Te-it*(le+Ve),Fe-it*(ue+Xe))+n.strScale(it)+(We?"rotate("+We+(Y?"":" "+le+" "+ue)+")":"")},n.setTransormAndDisplay=function(ie,Y){ie.attr("transform",n.getTextTransform(Y)),ie.style("display",Y.scale?null:"none")},n.ensureUniformFontSize=function(ie,Y){var le=n.extendFlat({},Y);return le.size=Math.max(Y.size,ie._fullLayout.uniformtext.minsize||0),le},n.join2=function(ie,Y,le){var ue=ie.length;return ue>1?ie.slice(0,-1).join(Y)+le+ie[ue-1]:ie.join(Y)},n.bigFont=function(ie){return Math.round(1.2*ie)};var Q=n.getFirefoxVersion(),me=Q!==null&&Q<86;n.getPositionFromD3Event=function(){return me?[h.event.layerX,h.event.layerY]:[h.event.offsetX,h.event.offsetY]}}}),g_=_e({"build/plotcss.js"(){var ee=kn(),X={"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(x in X)h=x.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),ee.addStyleRule(h,X[x]);var h,x}}),by=_e({"node_modules/is-browser/client.js"(ee,X){X.exports=!0}}),y0=_e({"node_modules/has-hover/index.js"(ee,X){var h=by(),x;typeof window.matchMedia=="function"?x=!window.matchMedia("(hover: none)").matches:x=h,X.exports=x}}),Op=_e({"node_modules/events/events.js"(ee,X){var h=typeof Reflect=="object"?Reflect:null,x=h&&typeof h.apply=="function"?h.apply:function(E,_,w){return Function.prototype.apply.call(E,_,w)},S;h&&typeof h.ownKeys=="function"?S=h.ownKeys:Object.getOwnPropertySymbols?S=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:S=function(E){return Object.getOwnPropertyNames(E)};function k(A){console&&console.warn&&console.warn(A)}var e=Number.isNaN||function(E){return E!==E};function t(){t.init.call(this)}X.exports=t,X.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(E){if(typeof E!="number"||E<0||e(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function n(A){return A._maxListeners===void 0?t.defaultMaxListeners:A._maxListeners}t.prototype.getMaxListeners=function(){return n(this)},t.prototype.emit=function(E){for(var _=[],w=1;w0&&(d=_[0]),d instanceof Error)throw d;var y=new Error("Unhandled error."+(d?" ("+d.message+")":""));throw y.context=d,y}var R=u[E];if(R===void 0)return!1;if(typeof R=="function")x(R,this,_);else for(var L=R.length,z=v(R,L),w=0;w0&&d.length>m&&!d.warned){d.warned=!0;var y=new Error("Possible EventEmitter memory leak detected. "+d.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");y.name="MaxListenersExceededWarning",y.emitter=A,y.type=E,y.count=d.length,k(y)}return A}t.prototype.addListener=function(E,_){return i(this,E,_,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(E,_){return i(this,E,_,!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,E,_){var w={fired:!1,wrapFn:void 0,target:A,type:E,listener:_},m=a.bind(w);return m.listener=_,w.wrapFn=m,m}t.prototype.once=function(E,_){return o(_),this.on(E,s(this,E,_)),this},t.prototype.prependOnceListener=function(E,_){return o(_),this.prependListener(E,s(this,E,_)),this},t.prototype.removeListener=function(E,_){var w,m,u,d,y;if(o(_),m=this._events,m===void 0)return this;if(w=m[E],w===void 0)return this;if(w===_||w.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete m[E],m.removeListener&&this.emit("removeListener",E,w.listener||_));else if(typeof w!="function"){for(u=-1,d=w.length-1;d>=0;d--)if(w[d]===_||w[d].listener===_){y=w[d].listener,u=d;break}if(u<0)return this;u===0?w.shift():p(w,u),w.length===1&&(m[E]=w[0]),m.removeListener!==void 0&&this.emit("removeListener",E,y||_)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(E){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[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete w[E]),this;if(arguments.length===0){var u=Object.keys(w),d;for(m=0;m=0;m--)this.removeListener(E,_[m]);return this};function f(A,E,_){var w=A._events;if(w===void 0)return[];var m=w[E];return m===void 0?[]:typeof m=="function"?_?[m.listener||m]:[m]:_?T(m):v(m,m.length)}t.prototype.listeners=function(E){return f(this,E,!0)},t.prototype.rawListeners=function(E){return f(this,E,!1)},t.listenerCount=function(A,E){return typeof A.listenerCount=="function"?A.listenerCount(E):c.call(A,E)},t.prototype.listenerCount=c;function c(A){var E=this._events;if(E!==void 0){var _=E[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 v(A,E){for(var _=new Array(E),w=0;w{},{passive:!0}),S},triggerHandler:function(S,k,e){var t,r=S._ev;if(!r)return;var o=r._events[k];if(!o)return;function n(a){if(a.listener){if(r.removeListener(k,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;ix.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},k.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},k.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},k.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=D.length)return!1;if(L.dimensions===2){if(N++,z.length===N)return L;var j=z[N];if(!b(j))return!1;L=D[B][j]}else L=D[B]}else L=D}}return L}function b(L){return L===Math.round(L)&&L>=0}function A(L){var z,N;z=X.modules[L]._module,N=z.basePlotModule;var U={};U.type=null;var B=o({},x),D=o({},z.attributes);ee.crawl(D,function(J,oe,ye,pe,ge){a(B,ge).set(void 0),J===void 0&&a(D,ge).set(void 0)}),o(U,B),X.traceIs(L,"noOpacity")&&delete U.opacity,X.traceIs(L,"showLegend")||(delete U.showlegend,delete U.legendgroup),X.traceIs(L,"noHover")&&(delete U.hoverinfo,delete U.hoverlabel),z.selectPoints||delete U.selectedpoints,o(U,D),N.attributes&&o(U,N.attributes),U.type=L;var j={meta:z.meta||{},categories:z.categories||{},animatable:!!z.animatable,type:L,attributes:w(U)};if(z.layoutAttributes){var q={};o(q,z.layoutAttributes),j.layoutAttributes=w(q)}return z.animatable||ee.crawl(j,function(J){ee.isValObject(J)&&"anim"in J&&delete J.anim}),j}function E(){var L={},z,N;o(L,S);for(z in X.subplotsRegistry)if(N=X.subplotsRegistry[z],!!N.layoutAttributes)if(Array.isArray(N.attr))for(var U=0;U=n&&(o._input||{})._templateitemname;a&&(i=n);var s=r+"["+i+"]",f;function c(){f={},a&&(f[s]={},f[s][x]=a)}c();function v(g,b){f[g]=b}function p(g,b){a?X.nestedProperty(f[s],g).set(b):f[s+"."+g]=b}function T(){var g=f;return c(),g}function l(g,b){g&&p(g,b);var A=T();for(var E in A)X.nestedProperty(t,E).set(A[E])}return{modifyBase:v,modifyItem:p,getUpdateObj:T,applyUpdate:l}}}}),Sh=_e({"src/plots/cartesian/constants.js"(ee,X){var h=ch().counter;X.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=_e({"src/plots/cartesian/axis_ids.js"(ee){var X=bi(),h=Sh();ee.id2name=function(k){if(!(typeof k!="string"||!k.match(h.AX_ID_PATTERN))){var e=k.split(" ")[0].slice(1);return e==="1"&&(e=""),k.charAt(0)+"axis"+e}},ee.name2id=function(k){if(k.match(h.AX_NAME_PATTERN)){var e=k.slice(5);return e==="1"&&(e=""),k.charAt(0)+e}},ee.cleanId=function(k,e,t){var r=/( domain)$/.test(k);if(!(typeof k!="string"||!k.match(h.AX_ID_PATTERN))&&!(e&&k.charAt(0)!==e)&&!(r&&!t)){var o=k.split(" ")[0].slice(1).replace(/^0+/,"");return o==="1"&&(o=""),k.charAt(0)+o+(r&&t?" domain":"")}},ee.list=function(S,k,e){var t=S._fullLayout;if(!t)return[];var r=ee.listIds(S,k),o=new Array(r.length),n;for(n=0;nt?1:-1:+(S.slice(1)||1)-+(k.slice(1)||1)},ee.ref2id=function(S){return/^[xyz]/.test(S)?S.split(" ")[0]:!1};function x(S,k){if(k&&k.length){for(var e=0;e0?".":"")+a;h.isPlainObject(s)?t(s,o,f,i+1):o(f,a,s)}})}}}),Fs=_e({"src/plots/plots.js"(ee,X){var h=mr(),x=On().timeFormatLocale,S=ba().formatLocale,k=jn(),e=Un(),t=bi(),r=Iv(),o=ou(),n=kn(),i=so(),a=qn().BADNUM,s=cf(),f=gp().clearOutline,c=rm(),v=Rp(),p=sg(),T=xl().getModuleCalcData,l=n.relinkPrivateKeys,g=n._,b=X.exports={};n.extendFlat(b,t),b.attributes=Zs(),b.attributes.type.values=b.allTypes,b.fontAttrs=es(),b.layoutAttributes=Bi();var A=wy();b.executeAPICommand=A.executeAPICommand,b.computeAPICommandBindings=A.computeAPICommandBindings,b.manageCommandObserver=A.manageCommandObserver,b.hasSimpleAPICommandBindings=A.hasSimpleAPICommandBindings,b.redrawText=function(W){return W=n.getGraphDiv(W),new Promise(function(ae){setTimeout(function(){W._fullLayout&&(t.getComponentMethod("annotations","draw")(W),t.getComponentMethod("legend","draw")(W),t.getComponentMethod("colorbar","draw")(W),ae(b.previousPromises(W)))},300)})},b.resize=function(W){W=n.getGraphDiv(W);var ae,se=new Promise(function(Q,me){(!W||n.isHidden(W))&&me(new Error("Resize must be passed a displayed plot div element.")),W._redrawTimer&&clearTimeout(W._redrawTimer),W._resolveResize&&(ae=W._resolveResize),W._resolveResize=Q,W._redrawTimer=setTimeout(function(){if(!W.layout||W.layout.width&&W.layout.height||n.isHidden(W)){Q(W);return}delete W.layout.width,delete W.layout.height;var ie=W.changed;W.autoplay=!0,t.call("relayout",W,{autosize:!0}).then(function(){W.changed=ie,W._resolveResize===Q&&(delete W._resolveResize,Q(W))})},100)});return ae&&ae(se),se},b.previousPromises=function(W){if((W._promises||[]).length)return Promise.all(W._promises).then(function(){W._promises=[]})},b.addLinks=function(W){if(!(!W._context.showLink&&!W._context.showSources)){var ae=W._fullLayout,se=n.ensureSingle(ae._paper,"text","js-plot-link-container",function(ue){ue.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:i.defaultLine,"pointer-events":"all"}).each(function(){var Te=h.select(this);Te.append("tspan").classed("js-link-to-tool",!0),Te.append("tspan").classed("js-link-spacer",!0),Te.append("tspan").classed("js-sourcelinks",!0)})}),Q=se.node(),me={y:ae._paper.attr("height")-9};document.body.contains(Q)&&Q.getComputedTextLength()>=ae.width-20?(me["text-anchor"]="start",me.x=5):(me["text-anchor"]="end",me.x=ae._paper.attr("width")-7),se.attr(me);var ie=se.select(".js-link-to-tool"),Y=se.select(".js-link-spacer"),le=se.select(".js-sourcelinks");W._context.showSources&&W._context.showSources(W),W._context.showLink&&E(W,ie),Y.text(ie.text()&&le.text()?" - ":"")}};function E(W,ae){ae.text("");var se=ae.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(W._context.linkText+" »");if(W._context.sendData)se.on("click",function(){b.sendDataToCloud(W)});else{var Q=window.location.pathname.split("/"),me=window.location.search;se.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+Q[2].split(".")[0]+"/"+Q[1]+me})}}b.sendDataToCloud=function(W){var ae=(window.PLOTLYENV||{}).BASE_URL||W._context.plotlyServerURL;if(ae){W.emit("plotly_beforeexport");var se=h.select(W).append("div").attr("id","hiddenform").style("display","none"),Q=se.append("form").attr({action:ae+"/external",method:"post",target:"_blank"}),me=Q.append("input").attr({type:"text",name:"data"});return me.node().value=b.graphJson(W,!1,"keepdata"),Q.node().submit(),se.remove(),W.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];b.supplyDefaults=function(W,ae){var se=ae&&ae.skipUpdateCalc,Q=W._fullLayout||{};if(Q._skipDefaults){delete Q._skipDefaults;return}var me=W._fullLayout={},ie=W.layout||{},Y=W._fullData||[],le=W._fullData=[],ue=W.data||[],Te=W.calcdata||[],Fe=W._context||{},Ve;W._transitionData||b.createTransitionData(W),me._dfltTitle={plot:g(W,"Click to enter Plot title"),subtitle:g(W,"Click to enter Plot subtitle"),x:g(W,"Click to enter X axis title"),y:g(W,"Click to enter Y axis title"),colorbar:g(W,"Click to enter Colorscale title"),annotation:g(W,"new text")},me._traceWord=g(W,"trace");var Xe=d(W,_);if(me._mapboxAccessToken=Fe.mapboxAccessToken,Q._initialAutoSizeIsDone){var We=Q.width,it=Q.height;b.supplyLayoutGlobalDefaults(ie,me,Xe),ie.width||(me.width=We),ie.height||(me.height=it),b.sanitizeMargins(me)}else{b.supplyLayoutGlobalDefaults(ie,me,Xe);var yt=!ie.width||!ie.height,bt=me.autosize,mt=Fe.autosizable,ht=yt&&(bt||mt);ht?b.plotAutoSize(W,ie,me):yt&&b.sanitizeMargins(me),!bt&&yt&&(ie.width=me.width,ie.height=me.height)}me._d3locale=y(Xe,me.separators),me._extraFormat=d(W,w),me._initialAutoSizeIsDone=!0,me._dataLength=ue.length,me._modules=[],me._visibleModules=[],me._basePlotModules=[];var qe=me._subplots=u(),ze=me._splomAxes={x:{},y:{}},Ae=me._splomSubplots={};me._splomGridDflt={},me._scatterStackOpts={},me._firstScatter={},me._alignmentOpts={},me._colorAxes={},me._requestRangeslider={},me._traceUids=m(Y,ue),b.supplyDataDefaults(ue,le,ie,me);var Ke=Object.keys(ze.x),_t=Object.keys(ze.y);if(Ke.length>1&&_t.length>1){for(t.getComponentMethod("grid","sizeDefaults")(ie,me),Ve=0;Ve15&&_t.length>15&&me.shapes.length===0&&me.images.length===0,b.linkSubplots(le,me,Y,Q),b.cleanPlot(le,me,Y,Q);var lr=!!(Q._has&&Q._has("cartesian")),dr=!!(me._has&&me._has("cartesian")),Nr=lr,Fr=dr;Nr&&!Fr?Q._bgLayer.remove():Fr&&!Nr&&(me._shouldCreateBgLayer=!0),Q._zoomlayer&&!W._dragging&&f({_fullLayout:Q}),R(le,me),l(me,Q),t.getComponentMethod("colorscale","crossTraceDefaults")(le,me),me._preGUI||(me._preGUI={}),me._tracePreGUI||(me._tracePreGUI={});var ln=me._tracePreGUI,zr={},Xr;for(Xr in ln)zr[Xr]="old";for(Ve=0;Ve0){var Fe=1-2*ie;Y=Math.round(Fe*Y),le=Math.round(Fe*le)}}var Ve=b.layoutAttributes.width.min,Xe=b.layoutAttributes.height.min;Y1,it=!se.height&&Math.abs(Q.height-le)>1;(it||We)&&(We&&(Q.width=Y),it&&(Q.height=le)),ae._initialAutoSize||(ae._initialAutoSize={width:Y,height:le}),b.sanitizeMargins(Q)},b.supplyLayoutModuleDefaults=function(W,ae,se,Q){var me=t.componentsRegistry,ie=ae._basePlotModules,Y,le,ue,Te=t.subplotsRegistry.cartesian;for(Y in me)ue=me[Y],ue.includeBasePlot&&ue.includeBasePlot(W,ae);ie.length||ie.push(Te),ae._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(W,ae),Te.finalizeSubplots(W,ae));for(var Fe in ae._subplots)ae._subplots[Fe].sort(n.subplotSort);for(le=0;le1&&(se.l/=bt,se.r/=bt)}if(Xe){var mt=(se.t+se.b)/Xe;mt>1&&(se.t/=mt,se.b/=mt)}var ht=se.xl!==void 0?se.xl:se.x,qe=se.xr!==void 0?se.xr:se.x,ze=se.yt!==void 0?se.yt:se.y,Ae=se.yb!==void 0?se.yb:se.y;We[ae]={l:{val:ht,size:se.l+yt},r:{val:qe,size:se.r+yt},b:{val:Ae,size:se.b+yt},t:{val:ze,size:se.t+yt}},it[ae]=1}if(!Q._replotting)return b.doAutoMargin(W)}};function D(W){if("_redrawFromAutoMarginCount"in W._fullLayout)return!1;var ae=s.list(W,"",!0);for(var se in ae)if(ae[se].autoshift||ae[se].shift)return!0;return!1}b.doAutoMargin=function(W){var ae=W._fullLayout,se=ae.width,Q=ae.height;ae._size||(ae._size={}),N(ae);var me=ae._size,ie=ae.margin,Y={t:0,b:0,l:0,r:0},le=n.extendFlat({},me),ue=ie.l,Te=ie.r,Fe=ie.t,Ve=ie.b,Xe=ae._pushmargin,We=ae._pushmarginIds,it=ae.minreducedwidth,yt=ae.minreducedheight;if(ie.autoexpand!==!1){for(var bt in Xe)We[bt]||delete Xe[bt];var mt=W._fullLayout._reservedMargin;for(var ht in mt)for(var qe in mt[ht]){var ze=mt[ht][qe];Y[qe]=Math.max(Y[qe],ze)}Xe.base={l:{val:0,size:ue},r:{val:1,size:Te},t:{val:1,size:Fe},b:{val:0,size:Ve}};for(var Ae in Y){var Ke=0;for(var _t in Xe)_t!=="base"&&k(Xe[_t][Ae].size)&&(Ke=Xe[_t][Ae].size>Ke?Xe[_t][Ae].size:Ke);var wt=Math.max(0,ie[Ae]-Ke);Y[Ae]=Math.max(0,Y[Ae]-wt)}for(var vt in Xe){var $t=Xe[vt].l||{},Yt=Xe[vt].b||{},lr=$t.val,dr=$t.size,Nr=Yt.val,Fr=Yt.size,ln=se-Y.r-Y.l,zr=Q-Y.t-Y.b;for(var Xr in Xe){if(k(dr)&&Xe[Xr].r){var Ot=Xe[Xr].r.val,Qe=Xe[Xr].r.size;if(Ot>lr){var ct=(dr*Ot+(Qe-ln)*lr)/(Ot-lr),Ue=(Qe*(1-lr)+(dr-ln)*(1-Ot))/(Ot-lr);ct+Ue>ue+Te&&(ue=ct,Te=Ue)}}if(k(Fr)&&Xe[Xr].t){var Ie=Xe[Xr].t.val,Pe=Xe[Xr].t.size;if(Ie>Nr){var Be=(Fr*Ie+(Pe-zr)*Nr)/(Ie-Nr),at=(Pe*(1-Nr)+(Fr-zr)*(1-Ie))/(Ie-Nr);Be+at>Ve+Fe&&(Ve=Be,Fe=at)}}}}}var ft=n.constrain(se-ie.l-ie.r,U,it),Bt=n.constrain(Q-ie.t-ie.b,B,yt),Nt=Math.max(0,se-ft),Ht=Math.max(0,Q-Bt);if(Nt){var or=(ue+Te)/Nt;or>1&&(ue/=or,Te/=or)}if(Ht){var Cr=(Ve+Fe)/Ht;Cr>1&&(Ve/=Cr,Fe/=Cr)}if(me.l=Math.round(ue)+Y.l,me.r=Math.round(Te)+Y.r,me.t=Math.round(Fe)+Y.t,me.b=Math.round(Ve)+Y.b,me.p=Math.round(ie.pad),me.w=Math.round(se)-me.l-me.r,me.h=Math.round(Q)-me.t-me.b,!ae._replotting&&(b.didMarginChange(le,me)||D(W))){"_redrawFromAutoMarginCount"in ae?ae._redrawFromAutoMarginCount++:ae._redrawFromAutoMarginCount=1;var Sr=3*(1+Object.keys(We).length);if(ae._redrawFromAutoMarginCount1)return!0}return!1},b.graphJson=function(W,ae,se,Q,me,ie){(me&&ae&&!W._fullData||me&&!ae&&!W._fullLayout)&&b.supplyDefaults(W);var Y=me?W._fullData:W.data,le=me?W._fullLayout:W.layout,ue=(W._transitionData||{})._frames;function Te(Xe,We){if(typeof Xe=="function")return We?"_function_":null;if(n.isPlainObject(Xe)){var it={},yt;return Object.keys(Xe).sort().forEach(function(qe){if(["_","["].indexOf(qe.charAt(0))===-1){if(typeof Xe[qe]=="function"){We&&(it[qe]="_function");return}if(se==="keepdata"){if(qe.slice(-3)==="src")return}else if(se==="keepstream"){if(yt=Xe[qe+"src"],typeof yt=="string"&&yt.indexOf(":")>0&&!n.isPlainObject(Xe.stream))return}else if(se!=="keepall"&&(yt=Xe[qe+"src"],typeof yt=="string"&&yt.indexOf(":")>0))return;it[qe]=Te(Xe[qe],We)}}),it}var bt=Array.isArray(Xe),mt=n.isTypedArray(Xe);if((bt||mt)&&Xe.dtype&&Xe.shape){var ht=Xe.bdata;return Te({dtype:Xe.dtype,shape:Xe.shape,bdata:n.isArrayBuffer(ht)?e.encode(ht):ht},We)}return bt?Xe.map(function(qe){return Te(qe,We)}):mt?n.simpleMap(Xe,n.identity):n.isJSDate(Xe)?n.ms2DateTimeLocal(+Xe):Xe}var Fe={data:(Y||[]).map(function(Xe){var We=Te(Xe);return ae&&delete We.fit,We})};if(!ae&&(Fe.layout=Te(le),me)){var Ve=le._size;Fe.layout.computed={margin:{b:Ve.b,l:Ve.l,r:Ve.r,t:Ve.t}}}return ue&&(Fe.frames=Te(ue)),ie&&(Fe.config=Te(W._context,!0)),Q==="object"?Fe:JSON.stringify(Fe)},b.modifyFrames=function(W,ae){var se,Q,me,ie=W._transitionData._frames,Y=W._transitionData._frameHash;for(se=0;se0&&(W._transitioningWithDuration=!0),W._transitionData._interruptCallbacks.push(function(){Q=!0}),se.redraw&&W._transitionData._interruptCallbacks.push(function(){return t.call("redraw",W)}),W._transitionData._interruptCallbacks.push(function(){W.emit("plotly_transitioninterrupted",[])});var Xe=0,We=0;function it(){return Xe++,function(){We++,!Q&&We===Xe&&le(Ve)}}se.runFn(it),setTimeout(it())})}function le(Ve){if(W._transitionData)return ie(W._transitionData._interruptCallbacks),Promise.resolve().then(function(){if(se.redraw)return t.call("redraw",W)}).then(function(){W._transitioning=!1,W._transitioningWithDuration=!1,W.emit("plotly_transitioned",[])}).then(Ve)}function ue(){if(W._transitionData)return W._transitioning=!1,me(W._transitionData._interruptCallbacks)}var Te=[b.previousPromises,ue,se.prepareFn,b.rehover,b.reselect,Y],Fe=n.syncOrAsync(Te,W);return(!Fe||!Fe.then)&&(Fe=Promise.resolve()),Fe.then(function(){return W})}b.doCalcdata=function(W,ae){var se=s.list(W),Q=W._fullData,me=W._fullLayout,ie,Y,le,ue,Te=new Array(Q.length),Fe=(W.calcdata||[]).slice();for(W.calcdata=Te,me._numBoxes=0,me._numViolins=0,me._violinScaleGroupStats={},W._hmpixcount=0,W._hmlumcount=0,me._piecolormap={},me._sunburstcolormap={},me._treemapcolormap={},me._iciclecolormap={},me._funnelareacolormap={},le=0;le=0;ue--)if(Ae[ue].enabled){ie._indexToPoints=Ae[ue]._indexToPoints;break}Y&&Y.calc&&(ze=Y.calc(W,ie))}(!Array.isArray(ze)||!ze[0])&&(ze=[{x:a,y:a}]),ze[0].t||(ze[0].t={}),ze[0].trace=ie,Te[ht]=ze}}for(pe(se,Q,me),le=0;lele||We>ue)&&(ie.style("overflow","hidden"),Ve=ie.node().getBoundingClientRect(),Xe=Ve.width,We=Ve.height);var it=+B.attr("x"),yt=+B.attr("y"),bt=W||B.node().getBoundingClientRect().height,mt=-bt/4;if(ye[0]==="y")Y.attr({transform:"rotate("+[-90,it,yt]+")"+x(-Xe/2,mt-We/2)});else if(ye[0]==="l")yt=mt-We/2;else if(ye[0]==="a"&&ye.indexOf("atitle")!==0)it=0,yt=mt;else{var ht=B.attr("text-anchor");it=it-Xe*(ht==="middle"?.5:ht==="end"?1:0),yt=yt+mt-We/2}ie.attr({x:it,y:yt}),j&&j.call(B,Y),ge(Y)})})):pe(),B};var t=/(<|<|<)/g,r=/(>|>|>)/g;function o(B){return B.replace(t,"\\lt ").replace(r,"\\gt ")}var n=[["$","$"],["\\(","\\)"]];function i(B,D,j){var q=parseInt((MathJax.version||"").split(".")[0]);if(q!==2&&q!==3){h.warn("No MathJax version:",MathJax.version);return}var J,oe,ye,pe,ge=function(){return oe=h.extendDeepAll({},MathJax.Hub.config),ye=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:n},displayAlign:"left"})},W=function(){oe=h.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=n},ae=function(){if(J=MathJax.Hub.config.menuSettings.renderer,J!=="SVG")return MathJax.Hub.setRenderer("SVG")},se=function(){J=MathJax.config.startup.output,J!=="svg"&&(MathJax.config.startup.output="svg")},Q=function(){var Te="math-output-"+h.randstr({},64);pe=X.select("body").append("div").attr({id:Te}).style({visibility:"hidden",position:"absolute","font-size":D.fontSize+"px"}).text(o(B));var Fe=pe.node();return q===2?MathJax.Hub.Typeset(Fe):MathJax.typeset([Fe])},me=function(){var Te=pe.select(q===2?".MathJax_SVG":".MathJax"),Fe=!Te.empty()&&pe.select("svg").node();if(!Fe)h.log("There was an error in the tex syntax.",B),j();else{var Ve=Fe.getBoundingClientRect(),Xe;q===2?Xe=X.select("body").select("#MathJax_SVG_glyphs"):Xe=Te.select("defs"),j(Te,Xe,Ve)}pe.remove()},ie=function(){if(J!=="SVG")return MathJax.Hub.setRenderer(J)},Y=function(){J!=="svg"&&(MathJax.config.startup.output=J)},le=function(){return ye!==void 0&&(MathJax.Hub.processSectionDelay=ye),MathJax.Hub.Config(oe)},ue=function(){MathJax.config=oe};q===2?MathJax.Hub.Queue(ge,ae,Q,me,ie,le):q===3&&(W(),se(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){Q(),me(),Y(),ue()}))}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="​",v=["http:","https:","mailto:","",void 0,":"],p=ee.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,g=//i;ee.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,A=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,E=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,_=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function w(B,D){if(!B)return null;var j=B.match(D),q=j&&(j[3]||j[4]);return q&&y(q)}var m=/(^|;)\s*color:/;ee.plainText=function(B,D){D=D||{};for(var j=D.len!==void 0&&D.len!==-1?D.len:1/0,q=D.allowedTags!==void 0?D.allowedTags:["br"],J="...",oe=J.length,ye=B.split(T),pe=[],ge="",W=0,ae=0;aeoe?pe.push(se.slice(0,Math.max(0,Y-oe))+J):pe.push(se.slice(0,Y));break}ge=""}}return pe.join("")};var u={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},d=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function y(B){return B.replace(d,function(D,j){var q;return j.charAt(0)==="#"?q=R(j.charAt(1)==="x"?parseInt(j.slice(2),16):parseInt(j.slice(1),10)):q=u[j],q||D})}ee.convertEntities=y;function R(B){if(!(B>1114111)){var D=String.fromCodePoint;if(D)return D(B);var j=String.fromCharCode;return B<=65535?j(B):j((B>>10)+55232,B%1024+56320)}}function L(B,D){D=D.replace(p," ");var j=!1,q=[],J,oe=-1;function ye(){oe++;var We=document.createElementNS(S.svg,"tspan");X.select(We).attr({class:"line",dy:oe*k+"em"}),B.appendChild(We),J=We;var it=q;if(q=[{node:We}],it.length>1)for(var yt=1;yt.",D);return}var it=q.pop();We!==it.type&&h.log("Start tag <"+it.type+"> doesnt match end tag <"+We+">. Pretending it did match.",D),J=q[q.length-1].node}var ae=g.test(D);ae?ye():(J=B,q=[{node:B}]);for(var se=D.split(T),Q=0;Q=0;g--,b++){var A=p[g];l[b]=[1-A[0],A[1]]}return l}function f(p,T){T=T||{};for(var l=p.domain,g=p.range,b=g.length,A=new Array(b),E=0;Ep-c?c=p-(v-p):v-p=0?g=o.colorscale.sequential:g=o.colorscale.sequentialminus,s._sync("colorscale",g)}}}}),Ho=_e({"src/components/colorscale/index.js"(ee,X){var h=jc(),x=ed();X.exports={moduleType:"component",name:"colorscale",attributes:tc(),layoutAttributes:lg(),supplyLayoutDefaults:Di(),handleDefaults:Oa(),crossTraceDefaults:Xi(),calc:ko(),scales:h.scales,defaultScale:h.defaultScale,getScale:h.get,isValidScale:h.isValid,hasColorscale:x.hasColorscale,extractOpts:x.extractOpts,extractScale:x.extractScale,flipScale:x.flipScale,makeColorScaleFunc:x.makeColorScaleFunc,makeColorScaleFuncFromTrace:x.makeColorScaleFuncFromTrace}}}),Ps=_e({"src/traces/scatter/subtypes.js"(ee,X){var h=kn(),x=lo().isTypedArraySpec;X.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 k=S.marker;return h.isPlainObject(k)&&(h.isArrayOrTypedArray(k.size)||x(k.size))}}}}),bu=_e({"src/traces/scatter/make_bubble_size_func.js"(ee,X){var h=jn();X.exports=function(S,k){k||(k=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/k);return h(i)&&i>0?Math.max(i,r):0}}}}),rc=_e({"src/components/fx/helpers.js"(ee){var X=kn();ee.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},ee.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&&(ze=100,qe=qe.replace("-open","")),qe.indexOf("-dot")>0&&(ze+=200,qe=qe.replace("-dot","")),qe=l.symbolNames.indexOf(qe),qe>=0&&(qe+=ze)}return qe%100>=m||qe>=400?0:Math.floor(Math.max(qe,0))};function d(qe,ze,Ae,Ke){var _t=qe%100;return l.symbolFuncs[_t](ze,Ae,Ke)+(qe>=200?u:"")}var y=S("~f"),R={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(qe,ze,Ae,Ke,_t,wt){var vt=R[Ke];return L(qe,ze,Ae,vt.type,_t,wt,vt.start,vt.stop,!1,vt.reversed)};function L(qe,ze,Ae,Ke,_t,wt,vt,$t,Yt,lr){var dr=_t.length,Nr;Ke==="linear"?Nr={node:"linearGradient",attrs:{x1:vt.x,y1:vt.y,x2:$t.x,y2:$t.y,gradientUnits:Yt?"userSpaceOnUse":"objectBoundingBox"},reversed:lr}:Ke==="radial"&&(Nr={node:"radialGradient",reversed:lr});for(var Fr=new Array(dr),ln=0;ln=0&&qe.i===void 0&&(qe.i=wt.i),ze.style("opacity",Ke.selectedOpacityFn?Ke.selectedOpacityFn(qe):qe.mo===void 0?vt.opacity:qe.mo),Ke.ms2mrc){var Yt;qe.ms==="various"||vt.size==="various"?Yt=3:Yt=Ke.ms2mrc(qe.ms),qe.mrc=Yt,Ke.selectedSizeFn&&(Yt=qe.mrc=Ke.selectedSizeFn(qe));var lr=l.symbolNumber(qe.mx||vt.symbol)||0;qe.om=lr%200>=100;var dr=ht(qe,Ae),Nr=le(qe,Ae);ze.attr("d",d(lr,Yt,dr,Nr))}var Fr=!1,ln,zr,Xr;if(qe.so)Xr=$t.outlierwidth,zr=$t.outliercolor,ln=vt.outliercolor;else{var Ot=($t||{}).width;Xr=(qe.mlw+1||Ot+1||(qe.trace?(qe.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in qe?zr=qe.mlcc=Ke.lineScale(qe.mlc):x.isArrayOrTypedArray($t.color)?zr=r.defaultLine:zr=$t.color,x.isArrayOrTypedArray(vt.color)&&(ln=r.defaultLine,Fr=!0),"mc"in qe?ln=qe.mcc=Ke.markerScale(qe.mc):ln=vt.color||vt.colors||"rgba(0,0,0,0)",Ke.selectedColorFn&&(ln=Ke.selectedColorFn(qe))}if(qe.om)ze.call(r.stroke,ln).style({"stroke-width":(Xr||1)+"px",fill:"none"});else{ze.style("stroke-width",(qe.isBlank?0:Xr)+"px");var Qe=vt.gradient,ct=qe.mgt;ct?Fr=!0:ct=Qe&&Qe.type,x.isArrayOrTypedArray(ct)&&(ct=ct[0],R[ct]||(ct=0));var Ue=vt.pattern,Ie=l.getPatternAttr,Pe=Ue&&(Ie(Ue.shape,qe.i,"")||Ie(Ue.path,qe.i,""));if(ct&&ct!=="none"){var Be=qe.mgc;Be?Fr=!0:Be=Qe.color;var at=Ae.uid;Fr&&(at+="-"+qe.i),l.gradient(ze,_t,at,ct,[[0,Be],[1,ln]],"fill")}else if(Pe){var ft=!1,Bt=Ue.fgcolor;!Bt&&wt&&wt.color&&(Bt=wt.color,ft=!0);var Nt=Ie(Bt,qe.i,wt&&wt.color||null),Ht=Ie(Ue.bgcolor,qe.i,null),or=Ue.fgopacity,Cr=Ie(Ue.size,qe.i,8),Sr=Ie(Ue.solidity,qe.i,.3);ft=ft||qe.mcc||x.isArrayOrTypedArray(Ue.shape)||x.isArrayOrTypedArray(Ue.path)||x.isArrayOrTypedArray(Ue.bgcolor)||x.isArrayOrTypedArray(Ue.fgcolor)||x.isArrayOrTypedArray(Ue.size)||x.isArrayOrTypedArray(Ue.solidity);var Tr=Ae.uid;ft&&(Tr+="-"+qe.i),l.pattern(ze,"point",_t,Tr,Pe,Cr,Sr,qe.mcc,Ue.fillmode,Ht,Nt,or)}else x.isArrayOrTypedArray(ln)?r.fill(ze,ln[qe.i]):r.fill(ze,ln);Xr&&r.stroke(ze,zr)}},l.makePointStyleFns=function(qe){var ze={},Ae=qe.marker;return ze.markerScale=l.tryColorscale(Ae,""),ze.lineScale=l.tryColorscale(Ae,"line"),t.traceIs(qe,"symbols")&&(ze.ms2mrc=v.isBubble(qe)?p(qe):function(){return(Ae.size||6)/2}),qe.selectedpoints&&x.extendFlat(ze,l.makeSelectedPointStyleFns(qe)),ze},l.makeSelectedPointStyleFns=function(qe){var ze={},Ae=qe.selected||{},Ke=qe.unselected||{},_t=qe.marker||{},wt=Ae.marker||{},vt=Ke.marker||{},$t=_t.opacity,Yt=wt.opacity,lr=vt.opacity,dr=Yt!==void 0,Nr=lr!==void 0;(x.isArrayOrTypedArray($t)||dr||Nr)&&(ze.selectedOpacityFn=function(Ie){var Pe=Ie.mo===void 0?_t.opacity:Ie.mo;return Ie.selected?dr?Yt:Pe:Nr?lr:c*Pe});var Fr=_t.color,ln=wt.color,zr=vt.color;(ln||zr)&&(ze.selectedColorFn=function(Ie){var Pe=Ie.mcc||Fr;return Ie.selected?ln||Pe:zr||Pe});var Xr=_t.size,Ot=wt.size,Qe=vt.size,ct=Ot!==void 0,Ue=Qe!==void 0;return t.traceIs(qe,"symbols")&&(ct||Ue)&&(ze.selectedSizeFn=function(Ie){var Pe=Ie.mrc||Xr/2;return Ie.selected?ct?Ot/2:Pe:Ue?Qe/2:Pe}),ze},l.makeSelectedTextStyleFns=function(qe){var ze={},Ae=qe.selected||{},Ke=qe.unselected||{},_t=qe.textfont||{},wt=Ae.textfont||{},vt=Ke.textfont||{},$t=_t.color,Yt=wt.color,lr=vt.color;return ze.selectedTextColorFn=function(dr){var Nr=dr.tc||$t;return dr.selected?Yt||Nr:lr||(Yt?Nr:r.addOpacity(Nr,c))},ze},l.selectedPointStyle=function(qe,ze){if(!(!qe.size()||!ze.selectedpoints)){var Ae=l.makeSelectedPointStyleFns(ze),Ke=ze.marker||{},_t=[];Ae.selectedOpacityFn&&_t.push(function(wt,vt){wt.style("opacity",Ae.selectedOpacityFn(vt))}),Ae.selectedColorFn&&_t.push(function(wt,vt){r.fill(wt,Ae.selectedColorFn(vt))}),Ae.selectedSizeFn&&_t.push(function(wt,vt){var $t=vt.mx||Ke.symbol||0,Yt=Ae.selectedSizeFn(vt);wt.attr("d",d(l.symbolNumber($t),Yt,ht(vt,ze),le(vt,ze))),vt.mrc2=Yt}),_t.length&&qe.each(function(wt){for(var vt=h.select(this),$t=0;$t<_t.length;$t++)_t[$t](vt,wt)})}},l.tryColorscale=function(qe,ze){var Ae=ze?x.nestedProperty(qe,ze).get():qe;if(Ae){var Ke=Ae.color;if((Ae.colorscale||Ae._colorAx)&&x.isArrayOrTypedArray(Ke))return o.makeColorScaleFuncFromTrace(Ae)}return x.identity};var z={start:1,end:-1,middle:0,bottom:1,top:-1};function N(qe,ze,Ae,Ke,_t){var wt=h.select(qe.node().parentNode),vt=ze.indexOf("top")!==-1?"top":ze.indexOf("bottom")!==-1?"bottom":"middle",$t=ze.indexOf("left")!==-1?"end":ze.indexOf("right")!==-1?"start":"middle",Yt=Ke?Ke/.8+1:0,lr=(i.lineCount(qe)-1)*f+1,dr=z[$t]*Yt,Nr=Ae*.75+z[vt]*Yt+(z[vt]-1)*lr*Ae/2;qe.attr("text-anchor",$t),_t||wt.attr("transform",n(dr,Nr))}function U(qe,ze){var Ae=qe.ts||ze.textfont.size;return k(Ae)&&Ae>0?Ae:0}l.textPointStyle=function(qe,ze,Ae){if(qe.size()){var Ke;if(ze.selectedpoints){var _t=l.makeSelectedTextStyleFns(ze);Ke=_t.selectedTextColorFn}var wt=ze.texttemplate,vt=Ae._fullLayout;qe.each(function($t){var Yt=h.select(this),lr=wt?x.extractOption($t,ze,"txt","texttemplate"):x.extractOption($t,ze,"tx","text");if(!lr&&lr!==0){Yt.remove();return}if(wt){var dr=ze._module.formatLabels,Nr=dr?dr($t,ze,vt):{},Fr={};T(Fr,ze,$t.i),lr=x.texttemplateString({data:[Fr,$t,ze._meta],fallback:ze.texttemplatefallback,labels:Nr,locale:vt._d3locale,template:lr})}var ln=$t.tp||ze.textposition,zr=U($t,ze),Xr=Ke?Ke($t):$t.tc||ze.textfont.color;Yt.call(l.font,{family:$t.tf||ze.textfont.family,weight:$t.tw||ze.textfont.weight,style:$t.ty||ze.textfont.style,variant:$t.tv||ze.textfont.variant,textcase:$t.tC||ze.textfont.textcase,lineposition:$t.tE||ze.textfont.lineposition,shadow:$t.tS||ze.textfont.shadow,size:zr,color:Xr}).text(lr).call(i.convertToTspans,Ae).call(N,ln,zr,$t.mrc)})}},l.selectedTextStyle=function(qe,ze){if(!(!qe.size()||!ze.selectedpoints)){var Ae=l.makeSelectedTextStyleFns(ze);qe.each(function(Ke){var _t=h.select(this),wt=Ae.selectedTextColorFn(Ke),vt=Ke.tp||ze.textposition,$t=U(Ke,ze);r.fill(_t,wt);var Yt=t.traceIs(ze,"bar-like");N(_t,vt,$t,Ke.mrc2||Ke.mrc,Yt)})}};var B=.5;l.smoothopen=function(qe,ze){if(qe.length<3)return"M"+qe.join("L");var Ae="M"+qe[0],Ke=[],_t;for(_t=1;_t=Yt||Ie>=dr&&Ie<=Yt)&&(Pe<=Nr&&Pe>=lr||Pe>=Nr&&Pe<=lr)&&(qe=[Ie,Pe])}return qe}l.applyBackoff=W,l.makeTester=function(){var qe=x.ensureSingleById(h.select("body"),"svg","js-plotly-tester",function(Ae){Ae.attr(a.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),ze=x.ensureSingle(qe,"path","js-reference-point",function(Ae){Ae.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=qe,l.testref=ze},l.savedBBoxes={};var ae=0,se=1e4;l.bBox=function(qe,ze,Ae){Ae||(Ae=Q(qe));var Ke;if(Ae){if(Ke=l.savedBBoxes[Ae],Ke)return x.extendFlat({},Ke)}else if(qe.childNodes.length===1){var _t=qe.childNodes[0];if(Ae=Q(_t),Ae){var wt=+_t.getAttribute("x")||0,vt=+_t.getAttribute("y")||0,$t=_t.getAttribute("transform");if(!$t){var Yt=l.bBox(_t,!1,Ae);return wt&&(Yt.left+=wt,Yt.right+=wt),vt&&(Yt.top+=vt,Yt.bottom+=vt),Yt}if(Ae+="~"+wt+"~"+vt+"~"+$t,Ke=l.savedBBoxes[Ae],Ke)return x.extendFlat({},Ke)}}var lr,dr;ze?lr=qe:(dr=l.tester.node(),lr=qe.cloneNode(!0),dr.appendChild(lr)),h.select(lr).attr("transform",null).call(i.positionText,0,0);var Nr=lr.getBoundingClientRect(),Fr=l.testref.node().getBoundingClientRect();ze||dr.removeChild(lr);var ln={height:Nr.height,width:Nr.width,left:Nr.left-Fr.left,top:Nr.top-Fr.top,right:Nr.right-Fr.left,bottom:Nr.bottom-Fr.top};return ae>=se&&(l.savedBBoxes={},ae=0),Ae&&(l.savedBBoxes[Ae]=ln),ae++,x.extendFlat({},ln)};function Q(qe){var ze=qe.getAttribute("data-unformatted");if(ze!==null)return ze+qe.getAttribute("data-math")+qe.getAttribute("text-anchor")+qe.getAttribute("style")}l.setClipUrl=function(qe,ze,Ae){qe.attr("clip-path",me(ze,Ae))};function me(qe,ze){if(!qe)return null;var Ae=ze._context,Ke=Ae._exportedPlot?"":Ae._baseUrl||"";return Ke?"url('"+Ke+"#"+qe+"')":"url(#"+qe+")"}l.getTranslate=function(qe){var ze=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,Ae=qe.attr?"attr":"getAttribute",Ke=qe[Ae]("transform")||"",_t=Ke.replace(ze,function(wt,vt,$t){return[vt,$t].join(" ")}).split(" ");return{x:+_t[0]||0,y:+_t[1]||0}},l.setTranslate=function(qe,ze,Ae){var Ke=/(\btranslate\(.*?\);?)/,_t=qe.attr?"attr":"getAttribute",wt=qe.attr?"attr":"setAttribute",vt=qe[_t]("transform")||"";return ze=ze||0,Ae=Ae||0,vt=vt.replace(Ke,"").trim(),vt+=n(ze,Ae),vt=vt.trim(),qe[wt]("transform",vt),vt},l.getScale=function(qe){var ze=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,Ae=qe.attr?"attr":"getAttribute",Ke=qe[Ae]("transform")||"",_t=Ke.replace(ze,function(wt,vt,$t){return[vt,$t].join(" ")}).split(" ");return{x:+_t[0]||1,y:+_t[1]||1}},l.setScale=function(qe,ze,Ae){var Ke=/(\bscale\(.*?\);?)/,_t=qe.attr?"attr":"getAttribute",wt=qe.attr?"attr":"setAttribute",vt=qe[_t]("transform")||"";return ze=ze||1,Ae=Ae||1,vt=vt.replace(Ke,"").trim(),vt+="scale("+ze+","+Ae+")",vt=vt.trim(),qe[wt]("transform",vt),vt};var ie=/\s*sc.*/;l.setPointGroupScale=function(qe,ze,Ae){if(ze=ze||1,Ae=Ae||1,!!qe){var Ke=ze===1&&Ae===1?"":"scale("+ze+","+Ae+")";qe.each(function(){var _t=(this.getAttribute("transform")||"").replace(ie,"");_t+=Ke,_t=_t.trim(),this.setAttribute("transform",_t)})}};var Y=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(qe,ze,Ae){qe&&qe.each(function(){var Ke,_t=h.select(this),wt=_t.select("text");if(wt.node()){var vt=parseFloat(wt.attr("x")||0),$t=parseFloat(wt.attr("y")||0),Yt=(_t.attr("transform")||"").match(Y);ze===1&&Ae===1?Ke=[]:Ke=[n(vt,$t),"scale("+ze+","+Ae+")",n(-vt,-$t)],Yt&&Ke.push(Yt),_t.attr("transform",Ke.join(""))}})};function le(qe,ze){var Ae;return qe&&(Ae=qe.mf),Ae===void 0&&(Ae=ze.marker&&ze.marker.standoff||0),!ze._geo&&!ze._xA?-Ae:Ae}l.getMarkerStandoff=le;var ue=Math.atan2,Te=Math.cos,Fe=Math.sin;function Ve(qe,ze){var Ae=ze[0],Ke=ze[1];return[Ae*Te(qe)-Ke*Fe(qe),Ae*Fe(qe)+Ke*Te(qe)]}var Xe,We,it,yt,bt,mt;function ht(qe,ze){var Ae=qe.ma;Ae===void 0&&(Ae=ze.marker.angle,(!Ae||x.isArrayOrTypedArray(Ae))&&(Ae=0));var Ke,_t,wt=ze.marker.angleref;if(wt==="previous"||wt==="north"){if(ze._geo){var vt=ze._geo.project(qe.lonlat);Ke=vt[0],_t=vt[1]}else{var $t=ze._xA,Yt=ze._yA;if($t&&Yt)Ke=$t.c2p(qe.x),_t=Yt.c2p(qe.y);else return 90}if(ze._geo){var lr=qe.lonlat[0],dr=qe.lonlat[1],Nr=ze._geo.project([lr,dr+1e-5]),Fr=ze._geo.project([lr+1e-5,dr]),ln=ue(Fr[1]-_t,Fr[0]-Ke),zr=ue(Nr[1]-_t,Nr[0]-Ke),Xr;if(wt==="north")Xr=Ae/180*Math.PI;else if(wt==="previous"){var Ot=lr/180*Math.PI,Qe=dr/180*Math.PI,ct=Xe/180*Math.PI,Ue=We/180*Math.PI,Ie=ct-Ot,Pe=Te(Ue)*Fe(Ie),Be=Fe(Ue)*Te(Qe)-Te(Ue)*Fe(Qe)*Te(Ie);Xr=-ue(Pe,Be)-Math.PI,Xe=lr,We=dr}var at=Ve(ln,[Te(Xr),0]),ft=Ve(zr,[Fe(Xr),0]);Ae=ue(at[1]+ft[1],at[0]+ft[0])/Math.PI*180,wt==="previous"&&!(mt===ze.uid&&qe.i===bt+1)&&(Ae=null)}if(wt==="previous"&&!ze._geo)if(mt===ze.uid&&qe.i===bt+1&&k(Ke)&&k(_t)){var Bt=Ke-it,Nt=_t-yt,Ht=ze.line&&ze.line.shape||"",or=Ht.slice(Ht.length-1);or==="h"&&(Nt=0),or==="v"&&(Bt=0),Ae+=ue(Nt,Bt)/Math.PI*180+90}else Ae=null}return it=Ke,yt=_t,bt=qe.i,mt=ze.uid,Ae}l.getMarkerAngle=ht}}),Su=_e({"src/components/titles/index.js"(ee,X){var h=mr(),x=jn(),S=Fs(),k=bi(),e=kn(),t=e.strTranslate,r=ri(),o=so(),n=Au(),i=Of(),a=eh().OPPOSITE_SIDE,s=/ [XY][0-9]* /,f=1.6,c=1.6;function v(p,T,l){var g=p._fullLayout,b=l.propContainer,A=l.propName,E=l.placeholder,_=l.traceIndex,w=l.avoid||{},m=l.attributes,u=l.transform,d=l.containerGroup,y=1,R=b.title,L=(R&&R.text?R.text:"").trim(),z=!1,N=R&&R.font?R.font:{},U=N.family,B=N.size,D=N.color,j=N.weight,q=N.style,J=N.variant,oe=N.textcase,ye=N.lineposition,pe=N.shadow,ge=l.subtitlePropName,W=!!ge,ae=l.subtitlePlaceholder,se=(b.title||{}).subtitle||{text:"",font:{}},Q=(se.text||"").trim(),me=!1,ie=1,Y=se.font,le=Y.family,ue=Y.size,Te=Y.color,Fe=Y.weight,Ve=Y.style,Xe=Y.variant,We=Y.textcase,it=Y.lineposition,yt=Y.shadow,bt;A==="title.text"?bt="titleText":A.indexOf("axis")!==-1?bt="axisTitleText":A.indexOf("colorbar")!==-1&&(bt="colorbarTitleText");var mt=p._context.edits[bt];function ht(Fr,ln){return Fr===void 0||ln===void 0?!1:Fr.replace(s," % ")===ln.replace(s," % ")}L===""?y=0:ht(L,E)&&(mt||(L=""),y=.2,z=!0),W&&(Q===""?ie=0:ht(Q,ae)&&(mt||(Q=""),ie=.2,me=!0)),l._meta?L=e.templateString(L,l._meta):g._meta&&(L=e.templateString(L,g._meta));var qe=L||Q||mt,ze;d||(d=e.ensureSingle(g._infolayer,"g","g-"+T),ze=g._hColorbarMoveTitle);var Ae=d.selectAll("text."+T).data(qe?[0]:[]);Ae.enter().append("text"),Ae.text(L).attr("class",T),Ae.exit().remove();var Ke=null,_t=T+"-subtitle",wt=Q||mt;if(W&&(Ke=d.selectAll("text."+_t).data(wt?[0]:[]),Ke.enter().append("text"),Ke.text(Q).attr("class",_t),Ke.exit().remove()),!qe)return d;function vt(Fr,ln){e.syncOrAsync([$t,Yt],{title:Fr,subtitle:ln})}function $t(Fr){var ln=Fr.title,zr=Fr.subtitle,Xr;!u&&ze&&(u={}),u?(Xr="",u.rotate&&(Xr+="rotate("+[u.rotate,m.x,m.y]+")"),(u.offset||ze)&&(Xr+=t(0,(u.offset||0)-(ze||0)))):Xr=null,ln.attr("transform",Xr);function Ot(Be){if(Be){var at=h.select(Be.node().parentNode).select("."+_t);if(!at.empty()){var ft=Be.node().getBBox();if(ft.height){var Bt=ft.y+ft.height+f*ue;at.attr("y",Bt)}}}}if(ln.style("opacity",y*o.opacity(D)).call(r.font,{color:o.rgb(D),size:h.round(B,2),family:U,weight:j,style:q,variant:J,textcase:oe,shadow:pe,lineposition:ye}).attr(m).call(n.convertToTspans,p,Ot),zr&&!zr.empty()){var Qe=d.select("."+T+"-math-group"),ct=ln.node().getBBox(),Ue=Qe.node()?Qe.node().getBBox():void 0,Ie=Ue?Ue.y+Ue.height+f*ue:ct.y+ct.height+c*ue,Pe=e.extendFlat({},m,{y:Ie});zr.attr("transform",Xr),zr.style("opacity",ie*o.opacity(Te)).call(r.font,{color:o.rgb(Te),size:h.round(ue,2),family:le,weight:Fe,style:Ve,variant:Xe,textcase:We,shadow:yt,lineposition:it}).attr(Pe).call(n.convertToTspans,p)}return S.previousPromises(p)}function Yt(Fr){var ln=Fr.title,zr=h.select(ln.node().parentNode);if(w&&w.selection&&w.side&&L){zr.attr("transform",null);var Xr=a[w.side],Ot=w.side==="left"||w.side==="top"?-1:1,Qe=x(w.pad)?w.pad:2,ct=r.bBox(zr.node()),Ue={t:0,b:0,l:0,r:0},Ie=p._fullLayout._reservedMargin;for(var Pe in Ie)for(var Be in Ie[Pe]){var at=Ie[Pe][Be];Ue[Be]=Math.max(Ue[Be],at)}var ft={left:Ue.l,top:Ue.t,right:g.width-Ue.r,bottom:g.height-Ue.b},Bt=w.maxShift||Ot*(ft[w.side]-ct[w.side]),Nt=0;if(Bt<0)Nt=Bt;else{var Ht=w.offsetLeft||0,or=w.offsetTop||0;ct.left-=Ht,ct.right-=Ht,ct.top-=or,ct.bottom-=or,w.selection.each(function(){var Sr=r.bBox(this);e.bBoxIntersect(ct,Sr,Qe)&&(Nt=Math.max(Nt,Ot*(Sr[w.side]-ct[Xr])+Qe))}),Nt=Math.min(Bt,Nt),b._titleScoot=Math.abs(Nt)}if(Nt>0||Bt<0){var Cr={left:[-Nt,0],right:[Nt,0],top:[0,-Nt],bottom:[0,Nt]}[w.side];zr.attr("transform",t(Cr[0],Cr[1]))}}}Ae.call(vt,Ke);function lr(Fr,ln){Fr.text(ln).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(mt&&(L?Ae.on(".opacity",null):(lr(Ae,E),z=!0),Ae.call(n.makeEditable,{gd:p}).on("edit",function(Fr){_!==void 0?k.call("_guiRestyle",p,A,Fr,_):k.call("_guiRelayout",p,A,Fr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(vt)}).on("input",function(Fr){this.text(Fr||" ").call(n.positionText,m.x,m.y)}),W)){if(W&&!L){var dr=Ae.node().getBBox(),Nr=dr.y+dr.height+c*ue;Ke.attr("y",Nr)}Q?Ke.on(".opacity",null):(lr(Ke,ae),me=!0),Ke.call(n.makeEditable,{gd:p}).on("edit",function(Fr){k.call("_guiRelayout",p,"title.subtitle.text",Fr)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(vt)}).on("input",function(Fr){this.text(Fr||" ").call(n.positionText,Ke.attr("x"),Ke.attr("y"))})}return Ae.classed("js-placeholder",z),Ke&&!Ke.empty()&&Ke.classed("js-placeholder",me),d}X.exports={draw:v,SUBTITLE_PADDING_EM:c,SUBTITLE_PADDING_MATHJAX_EM:f}}}),Sc=_e({"src/plots/cartesian/set_convert.js"(ee,X){var h=mr(),x=On().utcFormat,S=kn(),k=S.numberFormat,e=jn(),t=S.cleanNumber,r=S.ms2DateTime,o=S.dateTime2ms,n=S.ensureNumber,i=S.isArrayOrTypedArray,a=qn(),s=a.FP_SAFE,f=a.BADNUM,c=a.LOG_CLIP,v=a.ONEWEEK,p=a.ONEDAY,T=a.ONEHOUR,l=a.ONEMIN,g=a.ONESEC,b=cf(),A=Sh(),E=A.HOUR_PATTERN,_=A.WEEKDAY_PATTERN;function w(u){return Math.pow(10,u)}function m(u){return u!=null}X.exports=function(d,y){y=y||{};var R=d._id||"x",L=R.charAt(0);function z(Q,me){if(Q>0)return Math.log(Q)/Math.LN10;if(Q<=0&&me&&d.range&&d.range.length===2){var ie=d.range[0],Y=d.range[1];return .5*(ie+Y-2*c*Math.abs(ie-Y))}else return f}function N(Q,me,ie,Y){if((Y||{}).msUTC&&e(Q))return+Q;var le=o(Q,ie||d.calendar);if(le===f)if(e(Q)){Q=+Q;var ue=Math.floor(S.mod(Q+.05,1)*10),Te=Math.round(Q-ue/10);le=o(new Date(Te))+ue/10}else return f;return le}function U(Q,me,ie){return r(Q,me,ie||d.calendar)}function B(Q){return d._categories[Math.round(Q)]}function D(Q){if(m(Q)){if(d._categoriesMap===void 0&&(d._categoriesMap={}),d._categoriesMap[Q]!==void 0)return d._categoriesMap[Q];d._categories.push(typeof Q=="number"?String(Q):Q);var me=d._categories.length-1;return d._categoriesMap[Q]=me,me}return f}function j(Q,me){for(var ie=new Array(me),Y=0;Yd.range[1]&&(ie=!ie);for(var Y=ie?-1:1,le=Y*Q,ue=0,Te=0;TeVe)ue=Te+1;else{ue=le<(Fe+Ve)/2?Te:Te+1;break}}var Xe=d._B[ue]||0;return isFinite(Xe)?ye(Q,d._m2,Xe):0},W=function(Q){var me=d._rangebreaks.length;if(!me)return pe(Q,d._m,d._b);for(var ie=0,Y=0;Yd._rangebreaks[Y].pmax&&(ie=Y+1);return pe(Q,d._m2,d._B[ie])}}d.c2l=d.type==="log"?z:n,d.l2c=d.type==="log"?w:n,d.l2p=ge,d.p2l=W,d.c2p=d.type==="log"?function(Q,me){return ge(z(Q,me))}:ge,d.p2c=d.type==="log"?function(Q){return w(W(Q))}:W,["linear","-"].indexOf(d.type)!==-1?(d.d2r=d.r2d=d.d2c=d.r2c=d.d2l=d.r2l=t,d.c2d=d.c2r=d.l2d=d.l2r=n,d.d2p=d.r2p=function(Q){return d.l2p(t(Q))},d.p2d=d.p2r=W,d.cleanPos=n):d.type==="log"?(d.d2r=d.d2l=function(Q,me){return z(t(Q),me)},d.r2d=d.r2c=function(Q){return w(t(Q))},d.d2c=d.r2l=t,d.c2d=d.l2r=n,d.c2r=z,d.l2d=w,d.d2p=function(Q,me){return d.l2p(d.d2r(Q,me))},d.p2d=function(Q){return w(W(Q))},d.r2p=function(Q){return d.l2p(t(Q))},d.p2r=W,d.cleanPos=n):d.type==="date"?(d.d2r=d.r2d=S.identity,d.d2c=d.r2c=d.d2l=d.r2l=N,d.c2d=d.c2r=d.l2d=d.l2r=U,d.d2p=d.r2p=function(Q,me,ie){return d.l2p(N(Q,0,ie))},d.p2d=d.p2r=function(Q,me,ie){return U(W(Q),me,ie)},d.cleanPos=function(Q){return S.cleanDate(Q,f,d.calendar)}):d.type==="category"?(d.d2c=d.d2l=D,d.r2d=d.c2d=d.l2d=B,d.d2r=d.d2l_noadd=J,d.r2c=function(Q){var me=oe(Q);return me!==void 0?me:d.fraction2r(.5)},d.l2r=d.c2r=n,d.r2l=oe,d.d2p=function(Q){return d.l2p(d.r2c(Q))},d.p2d=function(Q){return B(W(Q))},d.r2p=d.d2p,d.p2r=W,d.cleanPos=function(Q){return typeof Q=="string"&&Q!==""?Q:n(Q)}):d.type==="multicategory"&&(d.r2d=d.c2d=d.l2d=B,d.d2r=d.d2l_noadd=J,d.r2c=function(Q){var me=J(Q);return me!==void 0?me:d.fraction2r(.5)},d.r2c_just_indices=q,d.l2r=d.c2r=n,d.r2l=J,d.d2p=function(Q){return d.l2p(d.r2c(Q))},d.p2d=function(Q){return B(W(Q))},d.r2p=d.d2p,d.p2r=W,d.cleanPos=function(Q){return Array.isArray(Q)||typeof Q=="string"&&Q!==""?Q:n(Q)},d.setupMultiCategory=function(Q){var me=d._traceIndices,ie,Y,le=d._matchGroup;if(le&&d._categories.length===0){for(var ue in le)if(ue!==R){var Te=y[b.id2name(ue)];me=me.concat(Te._traceIndices)}}var Fe=[[0,{}],[0,{}]],Ve=[];for(ie=0;ieTe[1]&&(Y[ue?0:1]=ie),Y[0]===Y[1]){var Fe=d.l2r(me),Ve=d.l2r(ie);if(me!==void 0){var Xe=Fe+1;ie!==void 0&&(Xe=Math.min(Xe,Ve)),Y[ue?1:0]=Xe}if(ie!==void 0){var We=Ve+1;me!==void 0&&(We=Math.max(We,Fe)),Y[ue?0:1]=We}}}},d.cleanRange=function(Q,me){d._cleanRange(Q,me),d.limitRange(Q)},d._cleanRange=function(Q,me){me||(me={}),Q||(Q="range");var ie=S.nestedProperty(d,Q).get(),Y,le;if(d.type==="date"?le=S.dfltRange(d.calendar):L==="y"?le=A.DFLTRANGEY:d._name==="realaxis"?le=[0,1]:le=me.dfltRange||A.DFLTRANGEX,le=le.slice(),(d.rangemode==="tozero"||d.rangemode==="nonnegative")&&(le[0]=0),!ie||ie.length!==2){S.nestedProperty(d,Q).set(le);return}var ue=ie[0]===null,Te=ie[1]===null;for(d.type==="date"&&!d.autorange&&(ie[0]=S.cleanDate(ie[0],f,d.calendar),ie[1]=S.cleanDate(ie[1],f,d.calendar)),Y=0;Y<2;Y++)if(d.type==="date"){if(!S.isDateTime(ie[Y],d.calendar)){d[Q]=le;break}if(d.r2l(ie[0])===d.r2l(ie[1])){var Fe=S.constrain(d.r2l(ie[0]),S.MIN_MS+1e3,S.MAX_MS-1e3);ie[0]=d.l2r(Fe-1e3),ie[1]=d.l2r(Fe+1e3);break}}else{if(!e(ie[Y]))if(!(ue||Te)&&e(ie[1-Y]))ie[Y]=ie[1-Y]*(Y?10:.1);else{d[Q]=le;break}if(ie[Y]<-s?ie[Y]=-s:ie[Y]>s&&(ie[Y]=s),ie[0]===ie[1]){var Ve=Math.max(1,Math.abs(ie[0]*1e-6));ie[0]-=Ve,ie[1]+=Ve}}},d.setScale=function(Q){var me=y._size;if(d.overlaying){var ie=b.getFromId({_fullLayout:y},d.overlaying);d.domain=ie.domain}var Y=Q&&d._r?"_r":"range",le=d.calendar;d.cleanRange(Y);var ue=d.r2l(d[Y][0],le),Te=d.r2l(d[Y][1],le),Fe=L==="y";if(Fe?(d._offset=me.t+(1-d.domain[1])*me.h,d._length=me.h*(d.domain[1]-d.domain[0]),d._m=d._length/(ue-Te),d._b=-d._m*Te):(d._offset=me.l+d.domain[0]*me.w,d._length=me.w*(d.domain[1]-d.domain[0]),d._m=d._length/(Te-ue),d._b=-d._m*ue),d._rangebreaks=[],d._lBreaks=0,d._m2=0,d._B=[],d.rangebreaks){var Ve,Xe;if(d._rangebreaks=d.locateBreaks(Math.min(ue,Te),Math.max(ue,Te)),d._rangebreaks.length){for(Ve=0;VeTe&&(We=!We),We&&d._rangebreaks.reverse();var it=We?-1:1;for(d._m2=it*d._length/(Math.abs(Te-ue)-d._lBreaks),d._B.push(-d._m2*(Fe?Te:ue)),Ve=0;Vele&&(le+=7,uele&&(le+=24,ue=Y&&ue=Y&&Q=vt.min&&(Aevt.max&&(vt.max=Ke),_t=!1)}_t&&Te.push({min:Ae,max:Ke})}};for(ie=0;ieg*2}function a(c){return Math.max(1,(c-1)/1e3)}function s(c,v){for(var p=c.length,T=a(p),l=0,g=0,b={},A=0;Al*2}function f(c){return k(c[0])&&k(c[1])}}}),Td=_e({"src/plots/cartesian/autorange.js"(ee,X){var h=mr(),x=jn(),S=kn(),k=qn().FP_SAFE,e=bi(),t=ri(),r=cf(),o=r.getFromId,n=r.isLinked;X.exports={applyAutorangeOptions:d,getAutoRange:i,makePadFn:s,doAutoRange:p,findExtremes:T,concatExtremes:v};function i(y,R){var L,z,N=[],U=y._fullLayout,B=s(U,R,0),D=s(U,R,1),j=v(y,R),q=j.min,J=j.max;if(q.length===0||J.length===0)return S.simpleMap(R.range,R.r2l);var oe=q[0].val,ye=J[0].val;for(L=1;L0&&(Ve=me-B(le)-D(ue),Ve>ie?Xe/Ve>Y&&(Te=le,Fe=ue,Y=Xe/Ve):Xe/me>Y&&(Te={val:le.val,nopad:1},Fe={val:ue.val,nopad:1},Y=Xe/me));function We(ht,qe){return Math.max(ht,D(qe))}if(oe===ye){var it=oe-1,yt=oe+1;if(se)if(oe===0)N=[0,1];else{var bt=(oe>0?J:q).reduce(We,0),mt=oe/(1-Math.min(.5,bt/me));N=oe>0?[0,mt]:[mt,0]}else Q?N=[Math.max(0,it),Math.max(1,yt)]:N=[it,yt]}else se?(Te.val>=0&&(Te={val:0,nopad:1}),Fe.val<=0&&(Fe={val:0,nopad:1})):Q&&(Te.val-Y*B(Te)<0&&(Te={val:0,nopad:1}),Fe.val<=0&&(Fe={val:1,nopad:1})),Y=(Fe.val-Te.val-a(R,le.val,ue.val))/(me-B(Te)-D(Fe)),N=[Te.val-Y*B(Te),Fe.val+Y*D(Fe)];return N=d(N,R),R.limitRange&&R.limitRange(),ge&&N.reverse(),S.simpleMap(N,R.l2r||Number)}function a(y,R,L){var z=0;if(y.rangebreaks)for(var N=y.locateBreaks(R,L),U=0;U0?L.ppadplus:L.ppadminus)||L.ppad||0),le=ie((y._m>0?L.ppadminus:L.ppadplus)||L.ppad||0),ue=ie(L.vpadplus||L.vpad),Te=ie(L.vpadminus||L.vpad);if(!q){if(Q=1/0,me=-1/0,j)for(oe=0;oe0&&(Q=ye),ye>me&&ye-k&&(Q=ye),ye>me&&ye=Xe;oe--)Ve(oe);return{min:z,max:N,opts:L}}function l(y,R,L,z){b(y,R,L,z,E)}function g(y,R,L,z){b(y,R,L,z,_)}function b(y,R,L,z,N){for(var U=z.tozero,B=z.extrapad,D=!0,j=0;j=L&&(q.extrapad||!B)){D=!1;break}else N(R,q.val)&&q.pad<=L&&(B||!q.extrapad)&&(y.splice(j,1),j--)}if(D){var J=U&&R===0;y.push({val:R,pad:J?0:L,extrapad:J?!1:B})}}function A(y){return x(y)&&Math.abs(y)=R}function w(y,R){var L=R.autorangeoptions;return L&&L.minallowed!==void 0&&u(R,L.minallowed,L.maxallowed)?L.minallowed:L&&L.clipmin!==void 0&&u(R,L.clipmin,L.clipmax)?Math.max(y,R.d2l(L.clipmin)):y}function m(y,R){var L=R.autorangeoptions;return L&&L.maxallowed!==void 0&&u(R,L.minallowed,L.maxallowed)?L.maxallowed:L&&L.clipmax!==void 0&&u(R,L.clipmin,L.clipmax)?Math.min(y,R.d2l(L.clipmax)):y}function u(y,R,L){return R!==void 0&&L!==void 0?(R=y.d2l(R),L=y.d2l(L),R=j&&(U=j,L=j),B<=j&&(B=j,z=j)}}return L=w(L,R),z=m(z,R),[L,z]}}}),xs=_e({"src/plots/cartesian/axes.js"(ee,X){var h=mr(),x=jn(),S=Fs(),k=bi(),e=kn(),t=e.strTranslate,r=Au(),o=Su(),n=so(),i=ri(),a=Ih(),s=cg(),f=qn(),c=f.ONEMAXYEAR,v=f.ONEAVGYEAR,p=f.ONEMINYEAR,T=f.ONEMAXQUARTER,l=f.ONEAVGQUARTER,g=f.ONEMINQUARTER,b=f.ONEMAXMONTH,A=f.ONEAVGMONTH,E=f.ONEMINMONTH,_=f.ONEWEEK,w=f.ONEDAY,m=w/2,u=f.ONEHOUR,d=f.ONEMIN,y=f.ONESEC,R=f.ONEMILLI,L=f.ONEMICROSEC,z=f.MINUS_SIGN,N=f.BADNUM,U={K:"zeroline"},B={K:"gridline",L:"path"},D={K:"minor-gridline",L:"path"},j={K:"tick",L:"path"},q={K:"tick",L:"text"},J={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},oe=eh(),ye=oe.MID_SHIFT,pe=oe.CAP_SHIFT,ge=oe.LINE_SPACING,W=oe.OPPOSITE_SIDE,ae=3,se=X.exports={};se.setConvert=Sc();var Q=qd(),me=cf(),ie=me.idSort,Y=me.isLinked;se.id2name=me.id2name,se.name2id=me.name2id,se.cleanId=me.cleanId,se.list=me.list,se.listIds=me.listIds,se.getFromId=me.getFromId,se.getFromTrace=me.getFromTrace;var le=Td();se.getAutoRange=le.getAutoRange,se.findExtremes=le.findExtremes;var ue=1e-4;function Te(Vt){var Ct=(Vt[1]-Vt[0])*ue;return[Vt[0]-Ct,Vt[1]+Ct]}se.coerceRef=function(Vt,Ct,Br,Kr,Qr,Gr){var Jr=Kr.charAt(Kr.length-1),yn=Br._fullLayout._subplots[Jr+"axis"],cn=Kr+"ref",Dt={};return Qr||(Qr=yn[0]||(typeof Gr=="string"?Gr:Gr[0])),Gr||(Gr=Qr),yn=yn.concat(yn.map(function(yr){return yr+" domain"})),Dt[cn]={valType:"enumerated",values:yn.concat(Gr?typeof Gr=="string"?[Gr]:Gr:[]),dflt:Qr},e.coerce(Vt,Ct,Dt,cn)},se.getRefType=function(Vt){return Vt===void 0?Vt:Vt==="paper"?"paper":Vt==="pixel"?"pixel":/( domain)$/.test(Vt)?"domain":"range"},se.coercePosition=function(Vt,Ct,Br,Kr,Qr,Gr){var Jr,yn,cn=se.getRefType(Kr);if(cn!=="range")Jr=e.ensureNumber,yn=Br(Qr,Gr);else{var Dt=se.getFromId(Ct,Kr);Gr=Dt.fraction2r(Gr),yn=Br(Qr,Gr),Jr=Dt.cleanPos}Vt[Qr]=Jr(yn)},se.cleanPosition=function(Vt,Ct,Br){var Kr=Br==="paper"||Br==="pixel"?e.ensureNumber:se.getFromId(Ct,Br).cleanPos;return Kr(Vt)},se.redrawComponents=function(Vt,Ct){Ct=Ct||se.listIds(Vt);var Br=Vt._fullLayout;function Kr(Qr,Gr,Jr,yn){for(var cn=k.getComponentMethod(Qr,Gr),Dt={},yr=0;yr2e-6||((Br-Vt._forceTick0)/Vt._minDtick%1+1.000001)%1>2e-6)&&(Vt._minDtick=0))},se.saveRangeInitial=function(Vt,Ct){for(var Br=se.list(Vt,"",!0),Kr=!1,Qr=0;QrHr*.3||Dt(Kr)||Dt(Qr))){var _n=Br.dtick/2;Vt+=Vt+_nJr){var yn=Number(Br.slice(1));Gr.exactYears>Jr&&yn%12===0?Vt=se.tickIncrement(Vt,"M6","reverse")+w*1.5:Gr.exactMonths>Jr?Vt=se.tickIncrement(Vt,"M1","reverse")+w*15.5:Vt-=m;var cn=se.tickIncrement(Vt,Br);if(cn<=Kr)return cn}return Vt}se.prepMinorTicks=function(Vt,Ct,Br){if(!Ct.minor.dtick){delete Vt.dtick;var Kr=Ct.dtick&&x(Ct._tmin),Qr;if(Kr){var Gr=se.tickIncrement(Ct._tmin,Ct.dtick,!0);Qr=[Ct._tmin,Gr*.99+Ct._tmin*.01]}else{var Jr=e.simpleMap(Ct.range,Ct.r2l);Qr=[Jr[0],.8*Jr[0]+.2*Jr[1]]}if(Vt.range=e.simpleMap(Qr,Ct.l2r),Vt._isMinor=!0,se.prepTicks(Vt,Br),Kr){var yn=x(Ct.dtick),cn=x(Vt.dtick),Dt=yn?Ct.dtick:+Ct.dtick.substring(1),yr=cn?Vt.dtick:+Vt.dtick.substring(1);yn&&cn?yt(Dt,yr)?Dt===2*_&&yr===2*w&&(Vt.dtick=_):Dt===2*_&&yr===3*w?Vt.dtick=_:Dt===_&&!(Ct._input.minor||{}).nticks?Vt.dtick=w:bt(Dt/yr,2.5)?Vt.dtick=Dt/2:Vt.dtick=Dt:String(Ct.dtick).charAt(0)==="M"?cn?Vt.dtick="M1":yt(Dt,yr)?Dt>=12&&yr===2&&(Vt.dtick="M3"):Vt.dtick=Ct.dtick:String(Vt.dtick).charAt(0)==="L"?String(Ct.dtick).charAt(0)==="L"?yt(Dt,yr)||(Vt.dtick=bt(Dt/yr,2.5)?Ct.dtick/2:Ct.dtick):Vt.dtick="D1":Vt.dtick==="D2"&&+Ct.dtick>1&&(Vt.dtick=1)}Vt.range=Ct.range}Ct.minor._tick0Init===void 0&&(Vt.tick0=Ct.tick0)};function yt(Vt,Ct){return Math.abs((Vt/Ct+.5)%1-.5)<.001}function bt(Vt,Ct){return Math.abs(Vt/Ct-1)<.001}se.prepTicks=function(Vt,Ct){var Br=e.simpleMap(Vt.range,Vt.r2l,void 0,void 0,Ct);if(Vt.tickmode==="auto"||!Vt.dtick){var Kr=Vt.nticks,Qr;Kr||(Vt.type==="category"||Vt.type==="multicategory"?(Qr=Vt.tickfont?e.bigFont(Vt.tickfont.size||12):15,Kr=Vt._length/Qr):(Qr=Vt._id.charAt(0)==="y"?40:80,Kr=e.constrain(Vt._length/Qr,4,9)+1),Vt._name==="radialaxis"&&(Kr*=2)),Vt.minor&&Vt.minor.tickmode!=="array"||Vt.tickmode==="array"&&(Kr*=100),Vt._roughDTick=Math.abs(Br[1]-Br[0])/Kr,se.autoTicks(Vt,Vt._roughDTick),Vt._minDtick>0&&Vt.dtick0?(Gr=Kr-1,Jr=Kr):(Gr=Kr,Jr=Kr);var yn=Vt[Gr].value,cn=Vt[Jr].value,Dt=Math.abs(cn-yn),yr=Br||Dt,Hr=0;yr>=p?Dt>=p&&Dt<=c?Hr=Dt:Hr=v:Br===l&&yr>=g?Dt>=g&&Dt<=T?Hr=Dt:Hr=l:yr>=E?Dt>=E&&Dt<=b?Hr=Dt:Hr=A:Br===_&&yr>=_?Hr=_:yr>=w?Hr=w:Br===m&&yr>=m?Hr=m:Br===u&&yr>=u&&(Hr=u);var _n;Hr>=Dt&&(Hr=Dt,_n=!0);var Hn=Qr+Hr;if(Ct.rangebreaks&&Hr>0){for(var ea=84,Qn=0,bn=0;bn_&&(Hr=Dt)}(Hr>0||Kr===0)&&(Vt[Kr].periodX=Qr+Hr/2)}}se.calcTicks=function(Ct,Br){for(var Kr=Ct.type,Qr=Ct.calendar,Gr=Ct.ticklabelstep,Jr=Ct.ticklabelmode==="period",yn=Ct.range[0]>Ct.range[1],cn=!Ct.ticklabelindex||e.isArrayOrTypedArray(Ct.ticklabelindex)?Ct.ticklabelindex:[Ct.ticklabelindex],Dt=e.simpleMap(Ct.range,Ct.r2l,void 0,void 0,Br),yr=Dt[1]=(Ua?0:1);Fi--){var Ji=!Fi;Fi?(Ct._dtickInit=Ct.dtick,Ct._tick0Init=Ct.tick0):(Ct.minor._dtickInit=Ct.minor.dtick,Ct.minor._tick0Init=Ct.minor.tick0);var fo=Fi?Ct:e.extendFlat({},Ct,Ct.minor);if(Ji?se.prepMinorTicks(fo,Ct,Br):se.prepTicks(fo,Br),fo.tickmode==="array"){Fi?(bn=[],ea=Ke(Ct,!Ji)):($n=[],Qn=Ke(Ct,!Ji));continue}if(fo.tickmode==="sync"){bn=[],ea=Ae(Ct);continue}var co=Te(Dt),So=co[0],wi=co[1],ts=x(fo.dtick),jo=Kr==="log"&&!(ts||fo.dtick.charAt(0)==="L"),js=se.tickFirst(fo,Br);if(Fi){if(Ct._tmin=js,js=wi:Zo<=wi;Zo=se.tickIncrement(Zo,Ns,yr,Qr)){if(Fi&&No++,fo.rangebreaks&&!yr){if(Zo=_n)break}if(bn.length>Hn||Zo===us)break;us=Zo;var rl={value:Zo};Fi?(jo&&Zo!==(Zo|0)&&(rl.simpleLabel=!0),Gr>1&&No%Gr&&(rl.skipLabel=!0),bn.push(rl)):(rl.minor=!0,$n.push(rl))}}if(!$n||$n.length<2)cn=!1;else{var cs=($n[1].value-$n[0].value)*(yn?-1:1);Oi(cs,Ct.tickformat)||(cn=!1)}if(!cn)ki=bn;else{var $o=bn.concat($n);Jr&&bn.length&&($o=$o.slice(1)),$o=$o.sort(function(Lo,tu){return Lo.value-tu.value}).filter(function(Lo,tu,su){return tu===0||Lo.value!==su[tu-1].value});var yo=$o.map(function(Lo,tu){return Lo.minor===void 0&&!Lo.skipLabel?tu:null}).filter(function(Lo){return Lo!==null});yo.forEach(function(Lo){cn.map(function(tu){var su=Lo+tu;su>=0&&su<$o.length&&e.pushUnique(ki,$o[su])})})}if(Ua){var fs=Ct.minor.ticks==="inside"&&Ct.ticks==="outside"||Ct.minor.ticks==="outside"&&Ct.ticks==="inside";if(!fs){for(var nl=bn.map(function(Lo){return Lo.value}),wl=[],Ml=0;Ml<$n.length;Ml++){var Ts=$n[Ml],Ai=Ts.value;if(nl.indexOf(Ai)===-1){for(var uo=!1,Tl=0;!uo&&Tl-1;Cs--){if(bn[Cs].drop){bn.splice(Cs,1);continue}bn[Cs].value=Ma(bn[Cs].value,Ct);var al=Ct.c2p(bn[Cs].value);(Ro?qs>al-El:qs_n||Ds_n&&(su.periodX=_n),DsQr&&_nv)Ct/=v,Kr=Qr(10),Vt.dtick="M"+12*Nr(Ct,Kr,_t);else if(Gr>A)Ct/=A,Vt.dtick="M"+Nr(Ct,1,wt);else if(Gr>w){if(Vt.dtick=Nr(Ct,w,Vt._hasDayOfWeekBreaks?[1,2,7,14]:$t),!Br){var Jr=se.getTickFormat(Vt),yn=Vt.ticklabelmode==="period";yn&&(Vt._rawTick0=Vt.tick0),/%[uVW]/.test(Jr)?Vt.tick0=e.dateTick0(Vt.calendar,2):Vt.tick0=e.dateTick0(Vt.calendar,1),yn&&(Vt._dowTick0=Vt.tick0)}}else Gr>u?Vt.dtick=Nr(Ct,u,wt):Gr>d?Vt.dtick=Nr(Ct,d,vt):Gr>y?Vt.dtick=Nr(Ct,y,vt):(Kr=Qr(10),Vt.dtick=Nr(Ct,Kr,_t))}else if(Vt.type==="log"){Vt.tick0=0;var cn=e.simpleMap(Vt.range,Vt.r2l);if(Vt._isMinor&&(Ct*=1.5),Ct>.7)Vt.dtick=Math.ceil(Ct);else if(Math.abs(cn[1]-cn[0])<1){var Dt=1.5*Math.abs((cn[1]-cn[0])/Ct);Ct=Math.abs(Math.pow(10,cn[1])-Math.pow(10,cn[0]))/Dt,Kr=Qr(10),Vt.dtick="L"+Nr(Ct,Kr,_t)}else Vt.dtick=Ct>.3?"D2":"D1"}else Vt.type==="category"||Vt.type==="multicategory"?(Vt.tick0=0,Vt.dtick=Math.ceil(Math.max(Ct,1))):Ca(Vt)?(Vt.tick0=0,Kr=1,Vt.dtick=Nr(Ct,Kr,dr)):(Vt.tick0=0,Kr=Qr(10),Vt.dtick=Nr(Ct,Kr,_t));if(Vt.dtick===0&&(Vt.dtick=1),!x(Vt.dtick)&&typeof Vt.dtick!="string"){var yr=Vt.dtick;throw Vt.dtick=1,"ax.dtick error: "+String(yr)}};function Fr(Vt){var Ct=Vt.dtick;if(Vt._tickexponent=0,!x(Ct)&&typeof Ct!="string"&&(Ct=1),(Vt.type==="category"||Vt.type==="multicategory")&&(Vt._tickround=null),Vt.type==="date"){var Br=Vt.r2l(Vt.tick0),Kr=Vt.l2r(Br).replace(/(^-|i)/g,""),Qr=Kr.length;if(String(Ct).charAt(0)==="M")Qr>10||Kr.slice(5)!=="01-01"?Vt._tickround="d":Vt._tickround=+Ct.slice(1)%12===0?"y":"m";else if(Ct>=w&&Qr<=10||Ct>=w*15)Vt._tickround="d";else if(Ct>=d&&Qr<=16||Ct>=u)Vt._tickround="M";else if(Ct>=y&&Qr<=19||Ct>=d)Vt._tickround="S";else{var Gr=Vt.l2r(Br+Ct).replace(/^-/,"").length;Vt._tickround=Math.max(Qr,Gr)-20,Vt._tickround<0&&(Vt._tickround=4)}}else if(x(Ct)||Ct.charAt(0)==="L"){var Jr=Vt.range.map(Vt.r2d||Number);x(Ct)||(Ct=Number(Ct.slice(1))),Vt._tickround=2-Math.floor(Math.log(Ct)/Math.LN10+.01);var yn=Math.max(Math.abs(Jr[0]),Math.abs(Jr[1])),cn=Math.floor(Math.log(yn)/Math.LN10+.01),Dt=Vt.minexponent===void 0?3:Vt.minexponent;Math.abs(cn)>Dt&&(at(Vt.exponentformat)&&Vt.exponentformat!=="SI extended"&&!ft(cn)||at(Vt.exponentformat)&&Vt.exponentformat==="SI extended"&&!Bt(cn)?Vt._tickexponent=3*Math.round((cn-1)/3):Vt._tickexponent=cn)}else Vt._tickround=null}se.tickIncrement=function(Vt,Ct,Br,Kr){var Qr=Br?-1:1;if(x(Ct))return e.increment(Vt,Qr*Ct);var Gr=Ct.charAt(0),Jr=Qr*Number(Ct.slice(1));if(Gr==="M")return e.incrementMonth(Vt,Jr,Kr);if(Gr==="L")return Math.log(Math.pow(10,Vt)+Jr)/Math.LN10;if(Gr==="D"){var yn=Ct==="D2"?lr:Yt,cn=Vt+Qr*.01,Dt=e.roundUp(e.mod(cn,1),yn,Br);return Math.floor(cn)+Math.log(h.round(Math.pow(10,Dt),1))/Math.LN10}throw"unrecognized dtick "+String(Ct)},se.tickFirst=function(Vt,Ct){var Br=Vt.r2l||Number,Kr=e.simpleMap(Vt.range,Br,void 0,void 0,Ct),Qr=Kr[1]=0&&$n<=Vt._length?bn:null};if(Gr&&e.isArrayOrTypedArray(Vt.ticktext)){var Hr=e.simpleMap(Vt.range,Vt.r2l),_n=(Math.abs(Hr[1]-Hr[0])-(Vt._lBreaks||0))/1e4;for(Dt=0;Dt"+yn;else{var Dt=Da(Vt),yr=Vt._trueSide||Vt.side;(!Dt&&yr==="top"||Dt&&yr==="bottom")&&(Jr+="
")}Ct.text=Jr}function Xr(Vt,Ct,Br,Kr,Qr){var Gr=Vt.dtick,Jr=Ct.x,yn=Vt.tickformat,cn=typeof Gr=="string"&&Gr.charAt(0);if(Qr==="never"&&(Qr=""),Kr&&cn!=="L"&&(Gr="L3",cn="L"),yn||cn==="L")Ct.text=Ht(Math.pow(10,Jr),Vt,Qr,Kr);else if(x(Gr)||cn==="D"&&(Vt.minorloglabels==="complete"||e.mod(Jr+.01,1)<.1)){Vt.minorloglabels==="complete"&&!(e.mod(Jr+.01,1)<.1)&&(Ct.fontSize*=.75);var Dt=Math.pow(10,Jr).toExponential(0),yr=Dt.split("e"),Hr=+yr[1],_n=Math.abs(Hr),Hn=Vt.exponentformat;Hn==="power"||at(Hn)&&Hn!=="SI extended"&&ft(Hr)||at(Hn)&&Hn==="SI extended"&&Bt(Hr)?(Ct.text=yr[0],_n>0&&(Ct.text+="x10"),Ct.text==="1x10"&&(Ct.text="10"),Hr!==0&&Hr!==1&&(Ct.text+=""+(Hr>0?"":z)+_n+""),Ct.fontSize*=1.25):(Hn==="e"||Hn==="E")&&_n>2?Ct.text=yr[0]+Hn+(Hr>0?"+":z)+_n:(Ct.text=Ht(Math.pow(10,Jr),Vt,"","fakehover"),Gr==="D1"&&Vt._id.charAt(0)==="y"&&(Ct.dy-=Ct.fontSize/6))}else if(cn==="D")Ct.text=Vt.minorloglabels==="none"?"":String(Math.round(Math.pow(10,e.mod(Jr,1)))),Ct.fontSize*=.75;else throw"unrecognized dtick "+String(Gr);if(Vt.dtick==="D1"){var ea=String(Ct.text).charAt(0);(ea==="0"||ea==="1")&&(Vt._id.charAt(0)==="y"?Ct.dx-=Ct.fontSize/4:(Ct.dy+=Ct.fontSize/2,Ct.dx+=(Vt.range[1]>Vt.range[0]?1:-1)*Ct.fontSize*(Jr<0?.5:.25)))}}function Ot(Vt,Ct){var Br=Vt._categories[Math.round(Ct.x)];Br===void 0&&(Br=""),Ct.text=String(Br)}function Qe(Vt,Ct,Br){var Kr=Math.round(Ct.x),Qr=Vt._categories[Kr]||[],Gr=Qr[1]===void 0?"":String(Qr[1]),Jr=Qr[0]===void 0?"":String(Qr[0]);Br?Ct.text=Jr+" - "+Gr:(Ct.text=Gr,Ct.text2=Jr)}function ct(Vt,Ct,Br,Kr,Qr){Qr==="never"?Qr="":Vt.showexponent==="all"&&Math.abs(Ct.x/Vt.dtick)<1e-6&&(Qr="hide"),Ct.text=Ht(Ct.x,Vt,Qr,Kr)}function Ue(Vt,Ct,Br,Kr,Qr){if(Vt.thetaunit==="radians"&&!Br){var Gr=Ct.x/180;if(Gr===0)Ct.text="0";else{var Jr=Ie(Gr);if(Jr[1]>=100)Ct.text=Ht(e.deg2rad(Ct.x),Vt,Qr,Kr);else{var yn=Ct.x<0;Jr[1]===1?Jr[0]===1?Ct.text="π":Ct.text=Jr[0]+"π":Ct.text=["",Jr[0],"","⁄","",Jr[1],"","π"].join(""),yn&&(Ct.text=z+Ct.text)}}}else Ct.text=Ht(Ct.x,Vt,Qr,Kr)}function Ie(Vt){function Ct(yn,cn){return Math.abs(yn-cn)<=1e-6}function Br(yn,cn){return Ct(cn,0)?yn:Br(cn,yn%cn)}function Kr(yn){for(var cn=1;!Ct(Math.round(yn*cn)/cn,yn);)cn*=10;return cn}var Qr=Kr(Vt),Gr=Vt*Qr,Jr=Math.abs(Br(Gr,Qr));return[Math.round(Gr/Jr),Math.round(Qr/Jr)]}var Pe=["f","p","n","μ","m","","k","M","G","T"],Be=["q","r","y","z","a",...Pe,"P","E","Z","Y","R","Q"],at=Vt=>["SI","SI extended","B"].includes(Vt);function ft(Vt){return Vt>14||Vt<-15}function Bt(Vt){return Vt>32||Vt<-30}function Nt(Vt,Ct){return at(Ct)?!!(Ct==="SI extended"&&Bt(Vt)||Ct!=="SI extended"&&ft(Vt)):!1}function Ht(Vt,Ct,Br,Kr){var Qr=Vt<0,Gr=Ct._tickround,Jr=Br||Ct.exponentformat||"B",yn=Ct._tickexponent,cn=se.getTickFormat(Ct),Dt=Ct.separatethousands;if(Kr){var yr={exponentformat:Jr,minexponent:Ct.minexponent,dtick:Ct.showexponent==="none"?Ct.dtick:x(Vt)&&Math.abs(Vt)||1,range:Ct.showexponent==="none"?Ct.range.map(Ct.r2d):[0,Vt||1]};Fr(yr),Gr=(Number(yr._tickround)||0)+4,yn=yr._tickexponent,Ct.hoverformat&&(cn=Ct.hoverformat)}if(cn)return Ct._numFormat(cn)(Vt).replace(/-/g,z);var Hr=Math.pow(10,-Gr)/2;if(Jr==="none"&&(yn=0),Vt=Math.abs(Vt),Vt"+ea+"":Jr==="B"&&yn===9?Vt+="B":at(Jr)&&(Vt+=Jr==="SI extended"?Be[yn/3+10]:Pe[yn/3+5])}return Qr?z+Vt:Vt}se.getTickFormat=function(Vt){var Ct;function Br(cn){return typeof cn!="string"?cn:Number(cn.replace("M",""))*A}function Kr(cn,Dt){var yr=["L","D"];if(typeof cn==typeof Dt){if(typeof cn=="number")return cn-Dt;var Hr=yr.indexOf(cn.charAt(0)),_n=yr.indexOf(Dt.charAt(0));return Hr===_n?Number(cn.replace(/(L|D)/g,""))-Number(Dt.replace(/(L|D)/g,"")):Hr-_n}else return typeof cn=="number"?1:-1}function Qr(cn,Dt,yr){var Hr=yr||function(ea){return ea},_n=Dt[0],Hn=Dt[1];return(!_n&&typeof _n!="number"||Hr(_n)<=Hr(cn))&&(!Hn&&typeof Hn!="number"||Hr(Hn)>=Hr(cn))}function Gr(cn,Dt){var yr=Dt[0]===null,Hr=Dt[1]===null,_n=Kr(cn,Dt[0])>=0,Hn=Kr(cn,Dt[1])<=0;return(yr||_n)&&(Hr||Hn)}var Jr,yn;if(Vt.tickformatstops&&Vt.tickformatstops.length>0)switch(Vt.type){case"date":case"linear":{for(Ct=0;Ct=0&&Qr.unshift(Qr.splice(yr,1).shift())}});var yn={false:{left:0,right:0}};return e.syncOrAsync(Qr.map(function(cn){return function(){if(cn){var Dt=se.getFromId(Vt,cn);Br||(Br={}),Br.axShifts=yn,Br.overlayingShiftedAx=Jr;var yr=se.drawOne(Vt,Dt,Br);return Dt._shiftPusher&&na(Dt,Dt._fullDepth||0,yn,!0),Dt._r=Dt.range.slice(),Dt._rl=e.simpleMap(Dt._r,Dt.r2l),yr}}}))},se.drawOne=function(Vt,Ct,Br){Br=Br||{};var Kr=Br.axShifts||{},Qr=Br.overlayingShiftedAx||[],Gr,Jr,yn;Ct.setScale();var cn=Vt._fullLayout,Dt=Ct._id,yr=Dt.charAt(0),Hr=se.counterLetter(Dt),_n=cn._plots[Ct._mainSubplot],Hn=Ct.zerolinelayer==="above traces";if(!_n)return;if(Ct._shiftPusher=Ct.autoshift||Qr.indexOf(Ct._id)!==-1||Qr.indexOf(Ct.overlaying)!==-1,Ct._shiftPusher&Ct.anchor==="free"){var ea=Ct.linewidth/2||0;Ct.ticks==="inside"&&(ea+=Ct.ticklen),na(Ct,ea,Kr,!0),na(Ct,Ct.shift||0,Kr,!1)}(Br.skipTitle!==!0||Ct._shift===void 0)&&(Ct._shift=Mi(Ct,Kr));var Qn=_n[yr+"axislayer"],bn=Ct._mainLinePosition,$n=bn+=Ct._shift,ki=Ct._mainMirrorPosition,Ua=Ct._vals=se.calcTicks(Ct),Fi=[Ct.mirror,$n,ki].join("_");for(Gr=0;Gr0?Ds.bottom-tu:0,su))));var Ou=0,qc=0;if(Ct._shiftPusher&&(Ou=Math.max(su,Ds.height>0?Ul==="l"?tu-Ds.left:Ds.right-tu:0),Ct.title.text!==cn._dfltTitle[yr]&&(qc=(Ct._titleStandoff||0)+(Ct._titleScoot||0),Ul==="l"&&(qc+=ma(Ct))),Ct._fullDepth=Math.max(Ou,qc)),Ct.automargin){vl={x:0,y:0,r:0,l:0,t:0,b:0};var Mc=[0,1],Dc=typeof Ct._shift=="number"?Ct._shift:0;if(yr==="x"){if(Ul==="b"?vl[Ul]=Ct._depth:(vl[Ul]=Ct._depth=Math.max(Ds.width>0?tu-Ds.top:0,su),Mc.reverse()),Ds.width>0){var rh=Ds.right-(Ct._offset+Ct._length);rh>0&&(vl.xr=1,vl.r=rh);var Hf=Ct._offset-Ds.left;Hf>0&&(vl.xl=0,vl.l=Hf)}}else if(Ul==="l"?(Ct._depth=Math.max(Ds.height>0?tu-Ds.left:0,su),vl[Ul]=Ct._depth-Dc):(Ct._depth=Math.max(Ds.height>0?Ds.right-tu:0,su),vl[Ul]=Ct._depth+Dc,Mc.reverse()),Ds.height>0){var ml=Ds.bottom-(Ct._offset+Ct._length);ml>0&&(vl.yb=0,vl.b=ml);var vc=Ct._offset-Ds.top;vc>0&&(vl.yt=1,vl.t=vc)}vl[Hr]=Ct.anchor==="free"?Ct.position:Ct._anchorAxis.domain[Mc[0]],Ct.title.text!==cn._dfltTitle[yr]&&(vl[Ul]+=ma(Ct)+(Ct.title.standoff||0)),Ct.mirror&&Ct.anchor!=="free"&&(Il={x:0,y:0,r:0,l:0,t:0,b:0},Il[Lo]=Ct.linewidth,Ct.mirror&&Ct.mirror!==!0&&(Il[Lo]+=su),Ct.mirror===!0||Ct.mirror==="ticks"?Il[Hr]=Ct._anchorAxis.domain[Mc[1]]:(Ct.mirror==="all"||Ct.mirror==="allticks")&&(Il[Hr]=[Ct._counterDomainMin,Ct._counterDomainMax][Mc[1]]))}Bl&&(zl=k.getComponentMethod("rangeslider","autoMarginOpts")(Vt,Ct)),typeof Ct.automargin=="string"&&(or(vl,Ct.automargin),or(Il,Ct.automargin)),S.autoMargin(Vt,vr(Ct),vl),S.autoMargin(Vt,_r(Ct),Il),S.autoMargin(Vt,rn(Ct),zl)}),e.syncOrAsync(vs)}};function or(Vt,Ct){if(Vt){var Br=Object.keys(J).reduce(function(Kr,Qr){return Ct.indexOf(Qr)!==-1&&J[Qr].forEach(function(Gr){Kr[Gr]=1}),Kr},{});Object.keys(Vt).forEach(function(Kr){Br[Kr]||(Kr.length===1?Vt[Kr]=0:delete Vt[Kr])})}}function Cr(Vt,Ct){var Br=[],Kr,Qr=function(Gr,Jr){var yn=Gr.xbnd[Jr];yn!==null&&Br.push(e.extendFlat({},Gr,{x:yn}))};if(Ct.length){for(Kr=0;KrVt.range[1],yn=Vt.ticklabelposition&&Vt.ticklabelposition.indexOf("inside")!==-1,cn=!yn;if(Br){var Dt=Jr?-1:1;Br=Br*Dt}if(Kr){var yr=Vt.side,Hr=yn&&(yr==="top"||yr==="left")||cn&&(yr==="bottom"||yr==="right")?1:-1;Kr=Kr*Hr}return Vt._id.charAt(0)==="x"?function(_n){return t(Qr+Vt._offset+Vt.l2p(Fn(_n))+Br,Gr+Kr)}:function(_n){return t(Gr+Kr,Qr+Vt._offset+Vt.l2p(Fn(_n))+Br)}};function Fn(Vt){return Vt.periodX!==void 0?Vt.periodX:Vt.x}function ua(Vt){var Ct=Vt.ticklabelposition||"",Br=Vt.tickson||"",Kr=function(ea){return Ct.indexOf(ea)!==-1},Qr=Kr("top"),Gr=Kr("left"),Jr=Kr("right"),yn=Kr("bottom"),cn=Kr("inside"),Dt=Br!=="boundaries"&&(yn||Gr||Qr||Jr);if(!Dt&&!cn)return[0,0];var yr=Vt.side,Hr=Dt?(Vt.tickwidth||0)/2:0,_n=ae,Hn=Vt.tickfont?Vt.tickfont.size:12;return(yn||Qr)&&(Hr+=Hn*pe,_n+=(Vt.linewidth||0)/2),(Gr||Jr)&&(Hr+=(Vt.linewidth||0)/2,_n+=ae),cn&&yr==="top"&&(_n-=Hn*(1-pe)),(Gr||Qr)&&(Hr=-Hr),(yr==="bottom"||yr==="right")&&(_n=-_n),[Dt?Hr:0,cn?_n:0]}se.makeTickPath=function(Vt,Ct,Br,Kr){Kr||(Kr={});var Qr=Kr.minor;if(Qr&&!Vt.minor)return"";var Gr=Kr.len!==void 0?Kr.len:Qr?Vt.minor.ticklen:Vt.ticklen,Jr=Vt._id.charAt(0),yn=(Vt.linewidth||1)/2;return Jr==="x"?"M0,"+(Ct+yn*Br)+"v"+Gr*Br:"M"+(Ct+yn*Br)+",0h"+Gr*Br},se.makeLabelFns=function(Vt,Ct,Br){var Kr=Vt.ticklabelposition||"",Qr=Vt.tickson||"",Gr=function(us){return Kr.indexOf(us)!==-1},Jr=Gr("top"),yn=Gr("left"),cn=Gr("right"),Dt=Gr("bottom"),yr=Qr!=="boundaries"&&(Dt||yn||Jr||cn),Hr=Gr("inside"),_n=Kr==="inside"&&Vt.ticks==="inside"||!Hr&&Vt.ticks==="outside"&&Qr!=="boundaries",Hn=0,ea=0,Qn=_n?Vt.ticklen:0;if(Hr?Qn*=-1:yr&&(Qn=0),_n&&(Hn+=Qn,Br)){var bn=e.deg2rad(Br);Hn=Qn*Math.cos(bn)+1,ea=Qn*Math.sin(bn)}Vt.showticklabels&&(_n||Vt.showline)&&(Hn+=.2*Vt.tickfont.size),Hn+=(Vt.linewidth||1)/2*(Hr?-1:1);var $n={labelStandoff:Hn,labelShift:ea},ki,Ua,Fi,Ji,fo=0,co=Vt.side,So=Vt._id.charAt(0),wi=Vt.tickangle,ts;if(So==="x")ts=!Hr&&co==="bottom"||Hr&&co==="top",Ji=ts?1:-1,Hr&&(Ji*=-1),ki=ea*Ji,Ua=Ct+Hn*Ji,Fi=ts?1:-.2,Math.abs(wi)===90&&(Hr?Fi+=ye:wi===-90&&co==="bottom"?Fi=pe:wi===90&&co==="top"?Fi=ye:Fi=.5,fo=ye/2*(wi/90)),$n.xFn=function(us){return us.dx+ki+fo*us.fontSize},$n.yFn=function(us){return us.dy+Ua+us.fontSize*Fi},$n.anchorFn=function(us,Zo){if(yr){if(yn)return"end";if(cn)return"start"}return!x(Zo)||Zo===0||Zo===180?"middle":Zo*Ji<0!==Hr?"end":"start"},$n.heightFn=function(us,Zo,No){return Zo<-60||Zo>60?-.5*No:Vt.side==="top"!==Hr?-No:0};else if(So==="y"){if(ts=!Hr&&co==="left"||Hr&&co==="right",Ji=ts?1:-1,Hr&&(Ji*=-1),ki=Hn,Ua=ea*Ji,Fi=0,!Hr&&Math.abs(wi)===90&&(wi===-90&&co==="left"||wi===90&&co==="right"?Fi=pe:Fi=.5),Hr){var jo=x(wi)?+wi:0;if(jo!==0){var js=e.deg2rad(jo);fo=Math.abs(Math.sin(js))*pe*Ji,Fi=0}}$n.xFn=function(us){return us.dx+Ct-(ki+us.fontSize*Fi)*Ji+fo*us.fontSize},$n.yFn=function(us){return us.dy+Ua+us.fontSize*ye},$n.anchorFn=function(us,Zo){return x(Zo)&&Math.abs(Zo)===90?"middle":ts?"end":"start"},$n.heightFn=function(us,Zo,No){return Vt.side==="right"&&(Zo*=-1),Zo<-30?-No:Zo<30?-.5*No:0}}return $n};function ta(Vt){return[Vt.text,Vt.x,Vt.axInfo,Vt.font,Vt.fontSize,Vt.fontColor].join("_")}se.drawTicks=function(Vt,Ct,Br){Br=Br||{};var Kr=Ct._id+"tick",Qr=[].concat(Ct.minor&&Ct.minor.ticks?Br.vals.filter(function(Jr){return Jr.minor&&!Jr.noTick}):[]).concat(Ct.ticks?Br.vals.filter(function(Jr){return!Jr.minor&&!Jr.noTick}):[]),Gr=Br.layer.selectAll("path."+Kr).data(Qr,ta);Gr.exit().remove(),Gr.enter().append("path").classed(Kr,1).classed("ticks",1).classed("crisp",Br.crisp!==!1).each(function(Jr){return n.stroke(h.select(this),Jr.minor?Ct.minor.tickcolor:Ct.tickcolor)}).style("stroke-width",function(Jr){return i.crispRound(Vt,Jr.minor?Ct.minor.tickwidth:Ct.tickwidth,1)+"px"}).attr("d",Br.path).style("display",null),Va(Ct,[j]),Gr.attr("transform",Br.transFn)},se.drawGrid=function(Vt,Ct,Br){if(Br=Br||{},Ct.tickmode!=="sync"){var Kr=Ct._id+"grid",Qr=Ct.minor&&Ct.minor.showgrid,Gr=Qr?Br.vals.filter(function($n){return $n.minor}):[],Jr=Ct.showgrid?Br.vals.filter(function($n){return!$n.minor}):[],yn=Br.counterAxis;if(yn&&se.shouldShowZeroLine(Vt,Ct,yn))for(var cn=Ct.tickmode==="array",Dt=0;Dt=0;ea--){var Qn=ea?_n:Hn;if(Qn){var bn=Qn.selectAll("path."+Kr).data(ea?Jr:Gr,ta);bn.exit().remove(),bn.enter().append("path").classed(Kr,1).classed("crisp",Br.crisp!==!1),bn.attr("transform",Br.transFn).attr("d",Br.path).each(function($n){return n.stroke(h.select(this),$n.minor?Ct.minor.gridcolor:Ct.gridcolor||"#ddd")}).style("stroke-dasharray",function($n){return i.dashStyle($n.minor?Ct.minor.griddash:Ct.griddash,$n.minor?Ct.minor.gridwidth:Ct.gridwidth)}).style("stroke-width",function($n){return($n.minor?Hr:Ct._gw)+"px"}).style("display",null),typeof Br.path=="function"&&bn.attr("d",Br.path)}}Va(Ct,[B,D])}},se.drawZeroLine=function(Vt,Ct,Br){Br=Br||Br;var Kr=Ct._id+"zl",Qr=se.shouldShowZeroLine(Vt,Ct,Br.counterAxis),Gr=Br.layer.selectAll("path."+Kr).data(Qr?[{x:0,id:Ct._id}]:[]);Gr.exit().remove(),Gr.enter().append("path").classed(Kr,1).classed("zl",1).classed("crisp",Br.crisp!==!1).each(function(){Br.layer.selectAll("path").sort(function(Jr,yn){return ie(Jr.id,yn.id)})}),Gr.attr("transform",Br.transFn).attr("d",Br.path).call(n.stroke,Ct.zerolinecolor||n.defaultLine).style("stroke-width",i.crispRound(Vt,Ct.zerolinewidth,Ct._gw||1)+"px").style("display",null),Va(Ct,[U])},se.drawLabels=function(Vt,Ct,Br){Br=Br||{};var Kr=Vt._fullLayout,Qr=Ct._id,Gr=Ct.zerolinelayer==="above traces",Jr=Br.cls||Qr+"tick",yn=Br.vals.filter(function(cs){return cs.text}),cn=Br.labelFns,Dt=Br.secondary?0:Ct.tickangle,yr=(Ct._prevTickAngles||{})[Jr],Hr=Br.layer.selectAll("g."+Jr).data(Ct.showticklabels?yn:[],ta),_n=[];Hr.enter().append("g").classed(Jr,1).append("text").attr("text-anchor","middle").each(function(cs){var $o=h.select(this),yo=Vt._promises.length;$o.call(r.positionText,cn.xFn(cs),cn.yFn(cs)).call(i.font,{family:cs.font,size:cs.fontSize,color:cs.fontColor,weight:cs.fontWeight,style:cs.fontStyle,variant:cs.fontVariant,textcase:cs.fontTextcase,lineposition:cs.fontLineposition,shadow:cs.fontShadow}).text(cs.text).call(r.convertToTspans,Vt),Vt._promises[yo]?_n.push(Vt._promises.pop().then(function(){Hn($o,Dt)})):Hn($o,Dt)}),Va(Ct,[q]),Hr.exit().remove(),Br.repositionOnUpdate&&Hr.each(function(cs){h.select(this).select("text").call(r.positionText,cn.xFn(cs),cn.yFn(cs))});function Hn(cs,$o){cs.each(function(yo){var fs=h.select(this),nl=fs.select(".text-math-group"),wl=cn.anchorFn(yo,$o),Ml=Br.transFn.call(fs.node(),yo)+(x($o)&&+$o!=0?" rotate("+$o+","+cn.xFn(yo)+","+(cn.yFn(yo)-yo.fontSize/2)+")":""),Ts=r.lineCount(fs),Ai=ge*yo.fontSize,uo=cn.heightFn(yo,x($o)?+$o:0,(Ts-1)*Ai);if(uo&&(Ml+=t(0,uo)),nl.empty()){var Tl=fs.select("text");Tl.attr({transform:Ml,"text-anchor":wl}),Tl.style("display",null),Ct._adjustTickLabelsOverflow&&Ct._adjustTickLabelsOverflow()}else{var Cs=i.bBox(nl.node()).width,Ro=Cs*{end:-.5,start:.5}[wl];nl.attr("transform",Ml+t(Ro,0))}})}Ct._adjustTickLabelsOverflow=function(){var cs=Ct.ticklabeloverflow;if(!(!cs||cs==="allow")){var $o=cs.indexOf("hide")!==-1,yo=Ct._id.charAt(0)==="x",fs=0,nl=yo?Vt._fullLayout.width:Vt._fullLayout.height;if(cs.indexOf("domain")!==-1){var wl=e.simpleMap(Ct.range,Ct.r2l);fs=Ct.l2p(wl[0])+Ct._offset,nl=Ct.l2p(wl[1])+Ct._offset}var Ml=Math.min(fs,nl),Ts=Math.max(fs,nl),Ai=Ct.side,uo=1/0,Tl=-1/0;Hr.each(function(qs){var al=h.select(this),mu=al.select(".text-math-group");if(mu.empty()){var io=i.bBox(al.node()),vs=0;yo?(io.right>Ts||io.leftTs||io.top+(Ct.tickangle?0:qs.fontSize/4)Ct["_visibleLabelMin_"+wl._id]?al.style("display","none"):Ts.K==="tick"&&!Ml&&al.node().style.display!=="none"&&al.style("display",null)})})})})},Hn(Hr,yr+1?yr:Dt);function ea(){return _n.length&&Promise.all(_n)}var Qn=null;function bn(){if(Hn(Hr,Dt),yn.length&&Ct.autotickangles&&(Ct.type!=="log"||String(Ct.dtick).charAt(0)!=="D")){Qn=Ct.autotickangles[0];var cs=0,$o=[],yo,fs=1;Hr.each(function(vl){cs=Math.max(cs,vl.fontSize);var Il=Ct.l2p(vl.x),zl=Kt(this),Ou=i.bBox(zl.node());fs=Math.max(fs,r.lineCount(zl)),$o.push({top:0,bottom:10,height:10,left:Il-Ou.width/2,right:Il+Ou.width/2+2,width:Ou.width+2})});var nl=(Ct.tickson==="boundaries"||Ct.showdividers)&&!Br.secondary,wl=yn.length,Ml=Math.abs((yn[wl-1].x-yn[0].x)*Ct._m)/(wl-1),Ts=nl?Ml/2:Ml,Ai=nl?Ct.ticklen:cs*1.25*fs,uo=Math.sqrt(Math.pow(Ts,2)+Math.pow(Ai,2)),Tl=Ts/uo,Cs=Ct.autotickangles.map(function(vl){return vl*Math.PI/180}),Ro=Cs.find(function(vl){return Math.abs(Math.cos(vl))<=Tl});Ro===void 0&&(Ro=Cs.reduce(function(vl,Il){return Math.abs(Math.cos(vl))Vs*No&&(js=No,wi[So]=ts[So]=us[So])}var Ns=Math.abs(js-jo);Ns-Ji>0?(Ns-=Ji,Ji*=1+Ji/Ns):Ji=0,Ct._id.charAt(0)!=="y"&&(Ji=-Ji),wi[co]=Ua.p2r(Ua.r2p(ts[co])+fo*Ji),Ua.autorange==="min"||Ua.autorange==="max reversed"?(wi[0]=null,Ua._rangeInitial0=void 0,Ua._rangeInitial1=void 0):(Ua.autorange==="max"||Ua.autorange==="min reversed")&&(wi[1]=null,Ua._rangeInitial0=void 0,Ua._rangeInitial1=void 0),Kr._insideTickLabelsUpdaterange[Ua._name+".range"]=wi}var rl=e.syncOrAsync($n);return rl&&rl.then&&Vt._promises.push(rl),rl};function va(Vt,Ct,Br){var Kr=Ct._id+"divider",Qr=Br.vals,Gr=Br.layer.selectAll("path."+Kr).data(Qr,ta);Gr.exit().remove(),Gr.enter().insert("path",":first-child").classed(Kr,1).classed("crisp",1).call(n.stroke,Ct.dividercolor).style("stroke-width",i.crispRound(Vt,Ct.dividerwidth,1)+"px"),Gr.attr("transform",Br.transFn).attr("d",Br.path)}se.getPxPosition=function(Vt,Ct){var Br=Vt._fullLayout._size,Kr=Ct._id.charAt(0),Qr=Ct.side,Gr;if(Ct.anchor!=="free"?Gr=Ct._anchorAxis:Kr==="x"?Gr={_offset:Br.t+(1-(Ct.position||0))*Br.h,_length:0}:Kr==="y"&&(Gr={_offset:Br.l+(Ct.position||0)*Br.w+Ct._shift,_length:0}),Qr==="top"||Qr==="left")return Gr._offset;if(Qr==="bottom"||Qr==="right")return Gr._offset+Gr._length};function ma(Vt){var Ct=Vt.title.font.size,Br=(Vt.title.text.match(r.BR_TAG_ALL)||[]).length;return Vt.title.hasOwnProperty("standoff")?Ct*(pe+Br*ge):Br?Ct*(Br+1)*ge:Ct}function Jn(Vt,Ct){var Br=Vt._fullLayout,Kr=Ct._id,Qr=Kr.charAt(0),Gr=Ct.title.font.size,Jr,yn=(Ct.title.text.match(r.BR_TAG_ALL)||[]).length;if(Ct.title.hasOwnProperty("standoff"))Ct.side==="bottom"||Ct.side==="right"?Jr=Ct._depth+Ct.title.standoff+Gr*pe:(Ct.side==="top"||Ct.side==="left")&&(Jr=Ct._depth+Ct.title.standoff+Gr*(ye+yn*ge));else{var cn=Da(Ct);if(Ct.type==="multicategory")Jr=Ct._depth;else{var Dt=1.5*Gr;cn&&(Dt=.5*Gr,Ct.ticks==="outside"&&(Dt+=Ct.ticklen)),Jr=10+Dt+(Ct.linewidth?Ct.linewidth-1:0)}cn||(Qr==="x"?Jr+=Ct.side==="top"?Gr*(Ct.showticklabels?1:0):Gr*(Ct.showticklabels?1.5:.5):Jr+=Ct.side==="right"?Gr*(Ct.showticklabels?1:.5):Gr*(Ct.showticklabels?.5:0))}var yr=se.getPxPosition(Vt,Ct),Hr,_n,Hn;Qr==="x"?(_n=Ct._offset+Ct._length/2,Hn=Ct.side==="top"?yr-Jr:yr+Jr):(Hn=Ct._offset+Ct._length/2,_n=Ct.side==="right"?yr+Jr:yr-Jr,Hr={rotate:"-90",offset:0});var ea;if(Ct.type!=="multicategory"){var Qn=Ct._selections[Ct._id+"tick"];if(ea={selection:Qn,side:Ct.side},Qn&&Qn.node()&&Qn.node().parentNode){var bn=i.getTranslate(Qn.node().parentNode);ea.offsetLeft=bn.x,ea.offsetTop=bn.y}Ct.title.hasOwnProperty("standoff")&&(ea.pad=0)}return Ct._titleStandoff=Jr,o.draw(Vt,Kr+"title",{propContainer:Ct,propName:Ct._name+".title.text",placeholder:Br._dfltTitle[Qr],avoid:ea,transform:Hr,attributes:{x:_n,y:Hn,"text-anchor":"middle"}})}se.shouldShowZeroLine=function(Vt,Ct,Br){var Kr=e.simpleMap(Ct.range,Ct.r2l);return Kr[0]*Kr[1]<=0&&Ct.zeroline&&(Ct.type==="linear"||Ct.type==="-")&&!(Ct.rangebreaks&&Ct.maskBreaks(0)===N)&&(ja(Ct,0)||!ti(Vt,Ct,Br,Kr)||gr(Vt,Ct))},se.clipEnds=function(Vt,Ct){return Ct.filter(function(Br){return ja(Vt,Br.x)})};function ja(Vt,Ct){var Br=Vt.l2p(Ct);return Br>1&&Br1)for(Qr=1;Qr=Qr.min&&Vt=L:/%L/.test(Ct)?Vt>=R:/%[SX]/.test(Ct)?Vt>=y:/%M/.test(Ct)?Vt>=d:/%[HI]/.test(Ct)?Vt>=u:/%p/.test(Ct)?Vt>=m:/%[Aadejuwx]/.test(Ct)?Vt>=w:/%[UVW]/.test(Ct)?Vt>=_:/%[Bbm]/.test(Ct)?Vt>=E:/%[q]/.test(Ct)?Vt>=g:/%[Yy]/.test(Ct)?Vt>=p:!0}}}),bw=_e({"src/plots/cartesian/autorange_options_defaults.js"(ee,X){X.exports=function(x,S,k){var e,t;if(k){var r=S==="reversed"||S==="min reversed"||S==="max reversed";e=k[r?1:0],t=k[r?0:1]}var o=x("autorangeoptions.minallowed",t===null?e:void 0),n=x("autorangeoptions.maxallowed",e===null?t:void 0);o===void 0&&x("autorangeoptions.clipmin"),n===void 0&&x("autorangeoptions.clipmax"),x("autorangeoptions.include")}}}),xw=_e({"src/plots/cartesian/range_defaults.js"(ee,X){var h=bw();X.exports=function(S,k,e,t){var r=k._template||{},o=k.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)&&(k.insiderange=!1,i=void 0),i&&(n=e("range",i)))}var a=k.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 k.range,k.autorange=!0,f=!0),f||(a=k.getAutorangeDflt(n,t),s=e("autorange",a)),s&&(h(e,s,n),(o==="linear"||o==="-")&&e("rangemode")),k.cleanRange()}}}),WS=_e({"node_modules/mouse-event-offset/index.js"(ee,X){var h={left:0,top:0};X.exports=x;function x(k,e,t){e=e||k.currentTarget||k.srcElement,Array.isArray(t)||(t=[0,0]);var r=k.clientX||0,o=k.clientY||0,n=S(e);return t[0]=r-n.left,t[1]=o-n.top,t}function S(k){return k===window||k===document||k===document.body?h:k.getBoundingClientRect()}}}),y_=_e({"node_modules/has-passive-events/index.js"(ee,X){var h=by();function x(){var S=!1;try{var k=Object.defineProperty({},"passive",{get:function(){S=!0}});window.addEventListener("test",null,k),window.removeEventListener("test",null,k)}catch{S=!1}return S}X.exports=h&&x()}}),YS=_e({"src/components/dragelement/align.js"(ee,X){X.exports=function(x,S,k,e,t){var r=(x-k)/(e-k),o=r+S/(e-k),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}}}),XS=_e({"src/components/dragelement/cursor.js"(ee,X){var h=kn(),x=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];X.exports=function(k,e,t,r){return t==="left"?k=0:t==="center"?k=1:t==="right"?k=2:k=h.constrain(Math.floor(k*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=h.constrain(Math.floor(e*3),0,2),x[e][k]}}}),ZS=_e({"src/components/dragelement/unhover.js"(ee,X){var h=Lv(),x=tf(),S=Dp().getGraphDiv,k=ef(),e=X.exports={};e.wrapped=function(t,r,o){t=S(t),t._fullLayout&&x.clear(t._fullLayout._uid+k.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}))}}}),Pd=_e({"src/components/dragelement/index.js"(ee,X){var h=WS(),x=y0(),S=y_(),k=kn().removeElement,e=Sh(),t=X.exports={};t.align=YS(),t.getCursor=XS();var r=ZS();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(a){var s=a.gd,f=1,c=s._context.doubleClickDelay,v=a.element,p,T,l,g,b,A,E,_;s._mouseDownTime||(s._mouseDownTime=0),v.style.pointerEvents="all",v.onmousedown=u,S?(v._ontouchstart&&v.removeEventListener("touchstart",v._ontouchstart),v._ontouchstart=u,v.addEventListener("touchstart",u,{passive:!1})):v.ontouchstart=u;function w(R,L,z){return Math.abs(R)"u"&&typeof R.clientY>"u"&&(R.clientX=p,R.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===E?L=A:(L={target:E,srcElement:E,toElement:E},Object.keys(A).concat(Object.keys(A.__proto__)).forEach(z=>{var N=A[z];!L[z]&&typeof N!="function"&&(L[z]=N)})),a.clickFn&&a.clickFn(f,L),_||E.dispatchEvent(new MouseEvent("click",R))}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)}}}),zp=_e({"src/lib/setcursor.js"(ee,X){X.exports=function(x,S){(x.attr("class")||"").split(" ").forEach(function(k){k.indexOf("cursor-")===0&&x.classed(k,!1)}),S&&x.classed("cursor-"+S,!0)}}}),KS=_e({"src/lib/override_cursor.js"(ee,X){var h=zp(),x="data-savedcursor",S="!!";X.exports=function(e,t){var r=e.attr(x);if(t){if(!r){for(var o=(e.attr("class")||"").split(" "),n=0;nW.legend.length)for(var Q=W.legend.length;Q(n==="legend"?1:0));if(L===!1&&(a[n]=void 0),!(L===!1&&!f.uirevision)&&(v("uirevision",a.uirevision),L!==!1)){v("borderwidth");var z=v("orientation"),N=v("yref"),U=v("xref"),B=z==="h",D=N==="paper",j=U==="paper",q,J,oe,ye="left";B?(q=0,h.getComponentMethod("rangeslider","isVisible")(i.xaxis)?D?(J=1.1,oe="bottom"):(J=1,oe="top"):D?(J=-.1,oe="top"):(J=0,oe="bottom")):(J=1,oe="auto",j?q=1.02:(q=1,ye="right")),x.coerce(f,c,{x:{valType:"number",editType:"legend",min:j?-2:0,max:j?3:1,dflt:q}},"x"),x.coerce(f,c,{y:{valType:"number",editType:"legend",min:D?-2:0,max:D?3:1,dflt:J}},"y"),v("traceorder",w),r.isGrouped(a[n])&&v("tracegroupgap"),v("entrywidth"),v("entrywidthmode"),v("indentation"),v("itemsizing"),v("itemwidth"),v("itemclick"),v("itemdoubleclick"),v("groupclick"),v("xanchor",ye),v("yanchor",oe),v("maxheight"),v("valign"),x.noneOrAll(f,c,["x","y"]);var pe=v("title.text");if(pe){v("title.side",B?"left":"top");var ge=x.extendFlat({},p,{size:x.bigFont(p.size)});x.coerceFont(v,"title.font",ge)}}}X.exports=function(i,a,s){var f,c=s.slice(),v=a.shapes;if(v)for(f=0;fz&&(L=z)}y[p][0]._groupMinRank=L,y[p][0]._preGroupSort=p}var N=function(J,oe){return J[0]._groupMinRank-oe[0]._groupMinRank||J[0]._preGroupSort-oe[0]._preGroupSort},U=function(J,oe){return J.trace.legendrank-oe.trace.legendrank||J._preSort-oe._preSort};for(y.forEach(function(J,oe){J[0]._preGroupSort=oe}),y.sort(N),p=0;p0)me=ae.width;else return 0;return m?Q:Math.min(me,se)};A.each(function(W){var ae=h.select(this),se=S.ensureSingle(ae,"g","layers");se.style("opacity",W[0].trace.opacity);var Q=_.indentation,me=_.valign,ie=W[0].lineHeight,Y=W[0].height;if(me==="middle"&&Q===0||!ie||!Y)se.attr("transform",null);else{var le={top:1,bottom:-1}[me],ue=le*(.5*(ie-Y+3))||0,Te=_.indentation;se.attr("transform",k(Te,ue))}var Fe=se.selectAll("g.legendfill").data([W]);Fe.enter().append("g").classed("legendfill",!0);var Ve=se.selectAll("g.legendlines").data([W]);Ve.enter().append("g").classed("legendlines",!0);var Xe=se.selectAll("g.legendsymbols").data([W]);Xe.enter().append("g").classed("legendsymbols",!0),Xe.selectAll("g.legendpoints").data([W]).enter().append("g").classed("legendpoints",!0)}).each(ge).each(N).each(B).each(U).each(j).each(ye).each(oe).each(L).each(z).each(q).each(J);function L(W){var ae=l(W),se=ae.showFill,Q=ae.showLine,me=ae.showGradientLine,ie=ae.showGradientFill,Y=ae.anyFill,le=ae.anyLine,ue=W[0],Te=ue.trace,Fe,Ve,Xe=r(Te),We=Xe.colorscale,it=Xe.reversescale,yt=function(Ke){if(Ke.size())if(se)e.fillGroupStyle(Ke,E,!0);else{var _t="legendfill-"+Te.uid;e.gradient(Ke,E,_t,T(it),We,"fill")}},bt=function(Ke){if(Ke.size()){var _t="legendline-"+Te.uid;e.lineGroupStyle(Ke),e.gradient(Ke,E,_t,T(it),We,"stroke")}},mt=o.hasMarkers(Te)||!Y?"M5,0":le?"M5,-2":"M5,-3",ht=h.select(this),qe=ht.select(".legendfill").selectAll("path").data(se||ie?[W]:[]);if(qe.enter().append("path").classed("js-fill",!0),qe.exit().remove(),qe.attr("d",mt+"h"+u+"v6h-"+u+"z").call(yt),Q||me){var ze=R(void 0,Te.line,v,f);Ve=S.minExtend(Te,{line:{width:ze}}),Fe=[S.minExtend(ue,{trace:Ve})]}var Ae=ht.select(".legendlines").selectAll("path").data(Q||me?[Fe]:[]);Ae.enter().append("path").classed("js-line",!0),Ae.exit().remove(),Ae.attr("d",mt+(me?"l"+u+",0.0001":"h"+u)).call(Q?e.lineGroupStyle:bt)}function z(W){var ae=l(W),se=ae.anyFill,Q=ae.anyLine,me=ae.showLine,ie=ae.showMarker,Y=W[0],le=Y.trace,ue=!ie&&!Q&&!se&&o.hasText(le),Te,Fe;function Ve(qe,ze,Ae,Ke){var _t=S.nestedProperty(le,qe).get(),wt=S.isArrayOrTypedArray(_t)&&ze?ze(_t):_t;if(m&&wt&&Ke!==void 0&&(wt=Ke),Ae){if(wtAe[1])return Ae[1]}return wt}function Xe(qe){return Y._distinct&&Y.index&&qe[Y.index]?qe[Y.index]:qe[0]}if(ie||ue||me){var We={},it={};if(ie){We.mc=Ve("marker.color",Xe),We.mx=Ve("marker.symbol",Xe),We.mo=Ve("marker.opacity",S.mean,[.2,1]),We.mlc=Ve("marker.line.color",Xe),We.mlw=Ve("marker.line.width",S.mean,[0,5],c),it.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var yt=Ve("marker.size",S.mean,[2,16],s);We.ms=yt,it.marker.size=yt}me&&(it.line={width:Ve("line.width",Xe,[0,10],f)}),ue&&(We.tx="Aa",We.tp=Ve("textposition",Xe),We.ts=10,We.tc=Ve("textfont.color",Xe),We.tf=Ve("textfont.family",Xe),We.tw=Ve("textfont.weight",Xe),We.ty=Ve("textfont.style",Xe),We.tv=Ve("textfont.variant",Xe),We.tC=Ve("textfont.textcase",Xe),We.tE=Ve("textfont.lineposition",Xe),We.tS=Ve("textfont.shadow",Xe)),Te=[S.minExtend(Y,We)],Fe=S.minExtend(le,it),Fe.selectedpoints=null,Fe.texttemplate=null}var bt=h.select(this).select("g.legendpoints"),mt=bt.selectAll("path.scatterpts").data(ie?Te:[]);mt.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",y),mt.exit().remove(),mt.call(e.pointStyle,Fe,E),ie&&(Te[0].mrc=3);var ht=bt.selectAll("g.pointtext").data(ue?Te:[]);ht.enter().append("g").classed("pointtext",!0).append("text").attr("transform",y),ht.exit().remove(),ht.selectAll("text").call(e.textPointStyle,Fe,E)}function N(W){var ae=W[0].trace,se=ae.type==="waterfall";if(W[0]._distinct&&se){var Q=W[0].trace[W[0].dir].marker;return W[0].mc=Q.color,W[0].mlw=Q.line.width,W[0].mlc=Q.line.color,D(W,this,"waterfall")}var me=[];ae.visible&&se&&(me=W[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var ie=h.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(me);ie.enter().append("path").classed("legendwaterfall",!0).attr("transform",y).style("stroke-miterlimit",1),ie.exit().remove(),ie.each(function(Y){var le=h.select(this),ue=ae[Y[0]].marker,Te=R(void 0,ue.line,p,c);le.attr("d",Y[1]).style("stroke-width",Te+"px").call(t.fill,ue.color),Te&&le.call(t.stroke,ue.line.color)})}function U(W){D(W,this)}function B(W){D(W,this,"funnel")}function D(W,ae,se){var Q=W[0].trace,me=Q.marker||{},ie=me.line||{},Y=me.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",le=se?Q.visible&&Q.type===se:x.traceIs(Q,"bar"),ue=h.select(ae).select("g.legendpoints").selectAll("path.legend"+se).data(le?[W]:[]);ue.enter().append("path").classed("legend"+se,!0).attr("d",Y).attr("transform",y),ue.exit().remove(),ue.each(function(Te){var Fe=h.select(this),Ve=Te[0],Xe=R(Ve.mlw,me.line,p,c);Fe.style("stroke-width",Xe+"px");var We=Ve.mcc;if(!_._inHover&&"mc"in Ve){var it=r(me),yt=it.mid;yt===void 0&&(yt=(it.max+it.min)/2),We=e.tryColorscale(me,"")(yt)}var bt=We||Ve.mc||me.color,mt=me.pattern,ht=e.getPatternAttr,qe=mt&&(ht(mt.shape,0,"")||ht(mt.path,0,""));if(qe){var ze=ht(mt.bgcolor,0,null),Ae=ht(mt.fgcolor,0,null),Ke=mt.fgopacity,_t=g(mt.size,8,10),wt=g(mt.solidity,.5,1),vt="legend-"+Q.uid;Fe.call(e.pattern,"legend",E,vt,qe,_t,wt,We,mt.fillmode,ze,Ae,Ke)}else Fe.call(t.fill,bt);Xe&&t.stroke(Fe,Ve.mlc||ie.color)})}function j(W){var ae=W[0].trace,se=h.select(this).select("g.legendpoints").selectAll("path.legendbox").data(ae.visible&&x.traceIs(ae,"box-violin")?[W]:[]);se.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",y),se.exit().remove(),se.each(function(){var Q=h.select(this);if((ae.boxpoints==="all"||ae.points==="all")&&t.opacity(ae.fillcolor)===0&&t.opacity((ae.line||{}).color)===0){var me=S.minExtend(ae,{marker:{size:m?s:S.constrain(ae.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});se.call(e.pointStyle,me,E)}else{var ie=R(void 0,ae.line,p,c);Q.style("stroke-width",ie+"px").call(t.fill,ae.fillcolor),ie&&t.stroke(Q,ae.line.color)}})}function q(W){var ae=W[0].trace,se=h.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(ae.visible&&ae.type==="candlestick"?[W,W]:[]);se.enter().append("path").classed("legendcandle",!0).attr("d",function(Q,me){return me?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",y).style("stroke-miterlimit",1),se.exit().remove(),se.each(function(Q,me){var ie=h.select(this),Y=ae[me?"increasing":"decreasing"],le=R(void 0,Y.line,p,c);ie.style("stroke-width",le+"px").call(t.fill,Y.fillcolor),le&&t.stroke(ie,Y.line.color)})}function J(W){var ae=W[0].trace,se=h.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(ae.visible&&ae.type==="ohlc"?[W,W]:[]);se.enter().append("path").classed("legendohlc",!0).attr("d",function(Q,me){return me?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",y).style("stroke-miterlimit",1),se.exit().remove(),se.each(function(Q,me){var ie=h.select(this),Y=ae[me?"increasing":"decreasing"],le=R(void 0,Y.line,p,c);ie.style("fill","none").call(e.dashLine,Y.line.dash,le),le&&t.stroke(ie,Y.line.color)})}function oe(W){pe(W,this,"pie")}function ye(W){pe(W,this,"funnelarea")}function pe(W,ae,se){var Q=W[0],me=Q.trace,ie=se?me.visible&&me.type===se:x.traceIs(me,se),Y=h.select(ae).select("g.legendpoints").selectAll("path.legend"+se).data(ie?[W]:[]);if(Y.enter().append("path").classed("legend"+se,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",y),Y.exit().remove(),Y.size()){var le=me.marker||{},ue=R(i(le.line.width,Q.pts),le.line,p,c),Te="pieLike",Fe=S.minExtend(me,{marker:{line:{width:ue}}},Te),Ve=S.minExtend(Q,{trace:Fe},Te);n(Y,Ve,Fe,E)}}function ge(W){var ae=W[0].trace,se,Q=[];if(ae.visible)switch(ae.type){case"histogram2d":case"heatmap":Q=[["M-15,-2V4H15V-2Z"]],se=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":Q=[["M-6,-6V6H6V-6Z"]],se=!0;break;case"densitymapbox":case"densitymap":Q=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],se="radial";break;case"cone":Q=[["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"]],se=!1;break;case"streamtube":Q=[["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"]],se=!1;break;case"surface":Q=[["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"]],se=!0;break;case"mesh3d":Q=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],se=!1;break;case"volume":Q=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],se=!0;break;case"isosurface":Q=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],se=!1;break}var me=h.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(Q);me.enter().append("path").classed("legend3dandfriends",!0).attr("transform",y).style("stroke-miterlimit",1),me.exit().remove(),me.each(function(ie,Y){var le=h.select(this),ue=r(ae),Te=ue.colorscale,Fe=ue.reversescale,Ve=function(yt){if(yt.size()){var bt="legendfill-"+ae.uid;e.gradient(yt,E,bt,T(Fe,se==="radial"),Te,"fill")}},Xe;if(Te){if(!se){var it=Te.length;Xe=Y===0?Te[Fe?it-1:0][1]:Y===1?Te[Fe?0:it-1][1]:Te[Math.floor((it-1)/2)][1]}}else{var We=ae.vertexcolor||ae.facecolor||ae.color;Xe=S.isArrayOrTypedArray(We)?We[Y]||We[0]:We}le.attr("d",ie[0]),Xe?le.call(t.fill,Xe):le.call(Ve)})}};function T(b,A){var E=A?"radial":"horizontal";return E+(b?"":"reversed")}function l(b){var A=b[0].trace,E=A.contours,_=o.hasLines(A),w=o.hasMarkers(A),m=A.visible&&A.fill&&A.fill!=="none",u=!1,d=!1;if(E){var y=E.coloring;y==="lines"?u=!0:_=y==="none"||y==="heatmap"||E.showlines,E.type==="constraint"?m=E._operation!=="=":(y==="fill"||y==="heatmap")&&(d=!0)}return{showMarker:w,showLine:_,showFill:m,showGradientLine:u,showGradientFill:d,anyLine:_||u,anyFill:m||d}}function g(b,A,E){return b&&S.isArrayOrTypedArray(b)?A:b>E?E:b}}}),Mw=_e({"src/components/legend/draw.js"(ee,X){var h=mr(),x=kn(),S=Fs(),k=bi(),e=Lv(),t=Pd(),r=ri(),o=so(),n=Au(),i=JS(),a=Aw(),s=eh(),f=s.LINE_SPACING,c=s.FROM_TL,v=s.FROM_BR,p=QS(),T=Sw(),l=__(),g=1,b=/^legend[0-9]*$/;X.exports=function(q,J){if(J)E(q,J);else{var oe=q._fullLayout,ye=oe._legends,pe=oe._infolayer.selectAll('[class^="legend"]');pe.each(function(){var se=h.select(this),Q=se.attr("class"),me=Q.split(" ")[0];me.match(b)&&ye.indexOf(me)===-1&&se.remove()});for(var ge=0;ge1)}var le=oe.hiddenlabels||[];if(!W&&(!oe.showlegend||!ae.length))return ge.selectAll("."+ye).remove(),oe._topdefs.select("#"+pe).remove(),S.autoMargin(j,ye);var ue=x.ensureSingle(ge,"g",ye,function(mt){W||mt.attr("pointer-events","all")}),Te=x.ensureSingleById(oe._topdefs,"clipPath",pe,function(mt){mt.append("rect")}),Fe=x.ensureSingle(ue,"rect","bg",function(mt){mt.attr("shape-rendering","crispEdges")});Fe.call(o.stroke,J.bordercolor).call(o.fill,J.bgcolor).style("stroke-width",J.borderwidth+"px");var Ve=x.ensureSingle(ue,"g","scrollbox"),Xe=J.title;J._titleWidth=0,J._titleHeight=0;var We;Xe.text?(We=x.ensureSingle(Ve,"text",ye+"titletext"),We.attr("text-anchor","start").call(r.font,Xe.font).text(Xe.text),y(We,Ve,j,J,g)):Ve.selectAll("."+ye+"titletext").remove();var it=x.ensureSingle(ue,"rect","scrollbar",function(mt){mt.attr(a.scrollBarEnterAttrs).call(o.fill,a.scrollBarColor)}),yt=Ve.selectAll("g.groups").data(ae);yt.enter().append("g").attr("class","groups"),yt.exit().remove();var bt=yt.selectAll("g.traces").data(x.identity);bt.enter().append("g").attr("class","traces"),bt.exit().remove(),bt.style("opacity",function(mt){var ht=mt[0].trace;return k.traceIs(ht,"pie-like")?le.indexOf(mt[0].label)!==-1?.5:1:ht.visible==="legendonly"?.5:1}).each(function(){h.select(this).call(m,j,J)}).call(T,j,J).each(function(){W||h.select(this).call(d,j,ye)}),x.syncOrAsync([S.previousPromises,function(){return z(j,yt,bt,J)},function(){var mt=oe._size,ht=J.borderwidth,qe=J.xref==="paper",ze=J.yref==="paper";if(Xe.text&&A(We,J,ht),!W){var Ae,Ke;qe?Ae=mt.l+mt.w*J.x-c[U(J)]*J._width:Ae=oe.width*J.x-c[U(J)]*J._width,ze?Ke=mt.t+mt.h*(1-J.y)-c[B(J)]*J._effHeight:Ke=oe.height*(1-J.y)-c[B(J)]*J._effHeight;var _t=N(j,ye,Ae,Ke);if(_t)return;if(oe.margin.autoexpand){var wt=Ae,vt=Ke;Ae=qe?x.constrain(Ae,0,oe.width-J._width):wt,Ke=ze?x.constrain(Ke,0,oe.height-J._effHeight):vt,Ae!==wt&&x.log("Constrain "+ye+".x to make legend fit inside graph"),Ke!==vt&&x.log("Constrain "+ye+".y to make legend fit inside graph")}r.setTranslate(ue,Ae,Ke)}if(it.on(".drag",null),ue.on("wheel",null),W||J._height<=J._maxHeight||j._context.staticPlot){var $t=J._effHeight;W&&($t=J._height),Fe.attr({width:J._width-ht,height:$t-ht,x:ht/2,y:ht/2}),r.setTranslate(Ve,0,0),Te.select("rect").attr({width:J._width-2*ht,height:$t-2*ht,x:ht,y:ht}),r.setClipUrl(Ve,pe,j),r.setRect(it,0,0,0,0),delete J._scrollY}else{var Yt=Math.max(a.scrollBarMinHeight,J._effHeight*J._effHeight/J._height),lr=J._effHeight-Yt-2*a.scrollBarMargin,dr=J._height-J._effHeight,Nr=lr/dr,Fr=Math.min(J._scrollY||0,dr);Fe.attr({width:J._width-2*ht+a.scrollBarWidth+a.scrollBarMargin,height:J._effHeight-ht,x:ht/2,y:ht/2}),Te.select("rect").attr({width:J._width-2*ht+a.scrollBarWidth+a.scrollBarMargin,height:J._effHeight-2*ht,x:ht,y:ht+Fr}),r.setClipUrl(Ve,pe,j),Ie(Fr,Yt,Nr),ue.on("wheel",function(){Fr=x.constrain(J._scrollY+h.event.deltaY/dr*lr,0,dr),Ie(Fr,Yt,Nr),Fr!==0&&Fr!==dr&&h.event.preventDefault()});var ln,zr,Xr,Ot=function(Bt,Nt,Ht){var or=(Ht-Nt)/Nr+Bt;return x.constrain(or,0,dr)},Qe=function(Bt,Nt,Ht){var or=(Nt-Ht)/Nr+Bt;return x.constrain(or,0,dr)},ct=h.behavior.drag().on("dragstart",function(){var Bt=h.event.sourceEvent;Bt.type==="touchstart"?ln=Bt.changedTouches[0].clientY:ln=Bt.clientY,Xr=Fr}).on("drag",function(){var Bt=h.event.sourceEvent;Bt.buttons===2||Bt.ctrlKey||(Bt.type==="touchmove"?zr=Bt.changedTouches[0].clientY:zr=Bt.clientY,Fr=Ot(Xr,ln,zr),Ie(Fr,Yt,Nr))});it.call(ct);var Ue=h.behavior.drag().on("dragstart",function(){var Bt=h.event.sourceEvent;Bt.type==="touchstart"&&(ln=Bt.changedTouches[0].clientY,Xr=Fr)}).on("drag",function(){var Bt=h.event.sourceEvent;Bt.type==="touchmove"&&(zr=Bt.changedTouches[0].clientY,Fr=Qe(Xr,ln,zr),Ie(Fr,Yt,Nr))});Ve.call(Ue)}function Ie(Bt,Nt,Ht){J._scrollY=j._fullLayout[ye]._scrollY=Bt,r.setTranslate(Ve,0,-Bt),r.setRect(it,J._width,a.scrollBarMargin+Bt*Ht,a.scrollBarWidth,Nt),Te.select("rect").attr("y",ht+Bt)}if(j._context.edits.legendPosition){var Pe,Be,at,ft;ue.classed("cursor-move",!0),t.init({element:ue.node(),gd:j,prepFn:function(Bt){if(Bt.target!==it.node()){var Nt=r.getTranslate(ue);at=Nt.x,ft=Nt.y}},moveFn:function(Bt,Nt){if(at!==void 0&&ft!==void 0){var Ht=at+Bt,or=ft+Nt;r.setTranslate(ue,Ht,or),Pe=t.align(Ht,J._width,mt.l,mt.l+mt.w,J.xanchor),Be=t.align(or+J._height,-J._height,mt.t+mt.h,mt.t,J.yanchor)}},doneFn:function(){if(Pe!==void 0&&Be!==void 0){var Bt={};Bt[ye+".x"]=Pe,Bt[ye+".y"]=Be,k.call("_guiRelayout",j,Bt)}},clickFn:function(Bt,Nt){var Ht=ge.selectAll("g.traces").filter(function(){var or=this.getBoundingClientRect();return Nt.clientX>=or.left&&Nt.clientX<=or.right&&Nt.clientY>=or.top&&Nt.clientY<=or.bottom});Ht.size()>0&&w(j,ue,Ht,Bt,Nt)}})}}],j)}}function _(j,q,J){var oe=j[0],ye=oe.width,pe=q.entrywidthmode,ge=oe.trace.legendwidth||q.entrywidth;return pe==="fraction"?q._maxWidth*ge:J+(ge||ye)}function w(j,q,J,oe,ye){var pe=J.data()[0][0].trace,ge={event:ye,node:J.node(),curveNumber:pe.index,expandedIndex:pe.index,data:j.data,layout:j.layout,frames:j._transitionData._frames,config:j._context,fullData:j._fullData,fullLayout:j._fullLayout};pe._group&&(ge.group=pe._group),k.traceIs(pe,"pie-like")&&(ge.label=J.datum()[0].label);var W=e.triggerHandler(j,"plotly_legendclick",ge);if(oe===1){if(W===!1)return;q._clickTimeout=setTimeout(function(){j._fullLayout&&i(J,j,oe)},j._context.doubleClickDelay)}else if(oe===2){q._clickTimeout&&clearTimeout(q._clickTimeout),j._legendMouseDownTime=0;var ae=e.triggerHandler(j,"plotly_legenddoubleclick",ge);ae!==!1&&W!==!1&&i(J,j,oe)}}function m(j,q,J){var oe=D(J),ye=j.data()[0][0],pe=ye.trace,ge=k.traceIs(pe,"pie-like"),W=!J._inHover&&q._context.edits.legendText&&!ge,ae=J._maxNameLength,se,Q;ye.groupTitle?(se=ye.groupTitle.text,Q=ye.groupTitle.font):(Q=J.font,J.entries?se=ye.text:(se=ge?ye.label:pe.name,pe._meta&&(se=x.templateString(se,pe._meta))));var me=x.ensureSingle(j,"text",oe+"text");me.attr("text-anchor","start").call(r.font,Q).text(W?u(se,ae):se);var ie=J.indentation+J.itemwidth+a.itemGap*2;n.positionText(me,ie,0),W?me.call(n.makeEditable,{gd:q,text:se}).call(y,j,q,J).on("edit",function(Y){this.text(u(Y,ae)).call(y,j,q,J);var le=ye.trace._fullInput||{},ue={};return ue.name=Y,le._isShape?k.call("_guiRelayout",q,"shapes["+pe.index+"].name",ue.name):k.call("_guiRestyle",q,ue,pe.index)}):y(me,j,q,J)}function u(j,q){var J=Math.max(4,q);if(j&&j.trim().length>=J/2)return j;j=j||"";for(var oe=J-j.length;oe>0;oe--)j+=" ";return j}function d(j,q,J){var oe=q._context.doubleClickDelay,ye,pe=1,ge=x.ensureSingle(j,"rect",J+"toggle",function(W){q._context.staticPlot||W.style("cursor","pointer").attr("pointer-events","all"),W.call(o.fill,"rgba(0,0,0,0)")});q._context.staticPlot||(ge.on("mousedown",function(){ye=new Date().getTime(),ye-q._legendMouseDownTimeoe&&(pe=Math.max(pe-1,1)),w(q,W,j,pe,h.event)}}))}function y(j,q,J,oe,ye){oe._inHover&&j.attr("data-notex",!0),n.convertToTspans(j,J,function(){R(q,J,oe,ye)})}function R(j,q,J,oe){var ye=j.data()[0][0],pe=ye&&ye.trace.showlegend;if(Array.isArray(pe)&&(pe=pe[ye.i]!==!1),!J._inHover&&ye&&!pe){j.remove();return}var ge=j.select("g[class*=math-group]"),W=ge.node(),ae=D(J);J||(J=q._fullLayout[ae]);var se=J.borderwidth,Q;oe===g?Q=J.title.font:ye.groupTitle?Q=ye.groupTitle.font:Q=J.font;var me=Q.size*f,ie,Y;if(W){var le=r.bBox(W);ie=le.height,Y=le.width,oe===g?r.setTranslate(ge,se,se+ie*.75):r.setTranslate(ge,0,ie*.25)}else{var ue="."+ae+(oe===g?"title":"")+"text",Te=j.select(ue),Fe=n.lineCount(Te),Ve=Te.node();if(ie=me*Fe,Y=Ve?r.bBox(Ve).width:0,oe===g)J.title.side==="left"&&(Y+=a.itemGap*2),n.positionText(Te,se+a.titlePad,se+me);else{var Xe=a.itemGap*2+J.indentation+J.itemwidth;ye.groupTitle&&(Xe=a.itemGap,Y-=J.indentation+J.itemwidth),n.positionText(Te,Xe,-me*((Fe-1)/2-.3))}}oe===g?(J._titleWidth=Y,J._titleHeight=ie):(ye.lineHeight=me,ye.height=Math.max(ie,16)+3,ye.width=Y)}function L(j){var q=0,J=0,oe=j.title.side;return oe&&(oe.indexOf("left")!==-1&&(q=j._titleWidth),oe.indexOf("top")!==-1&&(J=j._titleHeight)),[q,J]}function z(j,q,J,oe){var ye=j._fullLayout,pe=D(oe);oe||(oe=ye[pe]);var ge=ye._size,W=l.isVertical(oe),ae=l.isGrouped(oe),se=oe.entrywidthmode==="fraction",Q=oe.borderwidth,me=2*Q,ie=a.itemGap,Y=oe.indentation+oe.itemwidth+ie*2,le=2*(Q+ie),ue=B(oe),Te=oe.y<0||oe.y===0&&ue==="top",Fe=oe.y>1||oe.y===1&&ue==="bottom",Ve=oe.tracegroupgap,Xe={};const{orientation:We,yref:it}=oe;let{maxheight:yt}=oe;const bt=Te||Fe||We!=="v"||it!=="paper";yt||(yt=bt?.5:1);const mt=bt?ye.height:ge.h;oe._maxHeight=Math.max(yt>1?yt:yt*mt,30);var ht=0;oe._width=0,oe._height=0;var qe=L(oe);if(W)J.each(function(Ie){var Pe=Ie[0].height;r.setTranslate(this,Q+qe[0],Q+qe[1]+oe._height+Pe/2+ie),oe._height+=Pe,oe._width=Math.max(oe._width,Ie[0].width)}),ht=Y+oe._width,oe._width+=ie+Y+me,oe._height+=le,ae&&(q.each(function(Ie,Pe){r.setTranslate(this,0,Pe*oe.tracegroupgap)}),oe._height+=(oe._lgroupsLength-1)*oe.tracegroupgap);else{var ze=U(oe),Ae=oe.x<0||oe.x===0&&ze==="right",Ke=oe.x>1||oe.x===1&&ze==="left",_t=Fe||Te,wt=ye.width/2;oe._maxWidth=Math.max(Ae?_t&&ze==="left"?ge.l+ge.w:wt:Ke?_t&&ze==="right"?ge.r+ge.w:wt:ge.w,2*Y);var vt=0,$t=0;J.each(function(Ie){var Pe=_(Ie,oe,Y);vt=Math.max(vt,Pe),$t+=Pe}),ht=null;var Yt=0;if(ae){var lr=0,dr=0,Nr=0;q.each(function(){var Ie=0,Pe=0;h.select(this).selectAll("g.traces").each(function(at){var ft=_(at,oe,Y),Bt=at[0].height;r.setTranslate(this,qe[0],qe[1]+Q+ie+Bt/2+Pe),Pe+=Bt,Ie=Math.max(Ie,ft),Xe[at[0].trace.legendgroup]=Ie});var Be=Ie+ie;dr>0&&Be+Q+dr>oe._maxWidth?(Yt=Math.max(Yt,dr),dr=0,Nr+=lr+Ve,lr=Pe):lr=Math.max(lr,Pe),r.setTranslate(this,dr,Nr),dr+=Be}),oe._width=Math.max(Yt,dr)+Q,oe._height=Nr+lr+le}else{var Fr=J.size(),ln=$t+me+(Fr-1)*ie=oe._maxWidth&&(Yt=Math.max(Yt,Qe),Xr=0,Ot+=zr,oe._height+=zr,zr=0),r.setTranslate(this,qe[0]+Q+Xr,qe[1]+Q+Ot+Pe/2+ie),Qe=Xr+Be+ie,Xr+=at,zr=Math.max(zr,Pe)}),ln?(oe._width=Xr+me,oe._height=zr+le):(oe._width=Math.max(Yt,Qe)+me,oe._height+=zr+le)}}oe._width=Math.ceil(Math.max(oe._width+qe[0],oe._titleWidth+2*(Q+a.titlePad))),oe._height=Math.ceil(Math.max(oe._height+qe[1],oe._titleHeight+2*(Q+a.itemGap))),oe._effHeight=Math.min(oe._height,oe._maxHeight);var ct=j._context.edits,Ue=ct.legendText||ct.legendPosition;J.each(function(Ie){var Pe=h.select(this).select("."+pe+"toggle"),Be=Ie[0].height,at=Ie[0].trace.legendgroup,ft=_(Ie,oe,Y);ae&&at!==""&&(ft=Xe[at]);var Bt=Ue?Y:ht||ft;!W&&!se&&(Bt+=ie/2),r.setRect(Pe,0,-Be/2,Bt,Be)})}function N(j,q,J,oe){var ye=j._fullLayout,pe=ye[q],ge=U(pe),W=B(pe),ae=pe.xref==="paper",se=pe.yref==="paper";j._fullLayout._reservedMargin[q]={};var Q=pe.y<.5?"b":"t",me=pe.x<.5?"l":"r",ie={r:ye.width-J,l:J+pe._width,b:ye.height-oe,t:oe+pe._effHeight};if(ae&&se)return S.autoMargin(j,q,{x:pe.x,y:pe.y,l:pe._width*c[ge],r:pe._width*v[ge],b:pe._effHeight*v[W],t:pe._effHeight*c[W]});ae?j._fullLayout._reservedMargin[q][Q]=ie[Q]:se||pe.orientation==="v"?j._fullLayout._reservedMargin[q][me]=ie[me]:j._fullLayout._reservedMargin[q][Q]=ie[Q]}function U(j){return x.isRightAnchor(j)?"right":x.isCenterAnchor(j)?"center":"left"}function B(j){return x.isBottomAnchor(j)?"bottom":x.isMiddleAnchor(j)?"middle":"top"}function D(j){return j._id||"legend"}}}),Ew=_e({"src/components/fx/hover.js"(ee){var X=mr(),h=jn(),x=bs(),S=kn(),k=S.pushUnique,e=S.strTranslate,t=S.strRotate,r=Lv(),o=Au(),n=KS(),i=ri(),a=so(),s=Pd(),f=xs(),c=Sh().zindexSeparator,v=bi(),p=rc(),T=ef(),l=Tw(),g=Mw(),b=T.YANGLE,A=Math.PI*b/180,E=1/Math.sin(A),_=Math.cos(A),w=Math.sin(A),m=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,d={box:!0,ohlc:!0,violin:!0,candlestick:!0},y={scatter:!0,scattergl:!0,splom:!0};function R(Y,le){return Y.distance-le.distance}ee.hover=function(le,ue,Te,Fe){le=S.getGraphDiv(le);var Ve=ue.target;S.throttle(le._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){L(le,ue,Te,Fe,Ve)})},ee.loneHover=function(le,ue){var Te=!0;Array.isArray(le)||(Te=!1,le=[le]);var Fe=ue.gd,Ve=Q(Fe),Xe=me(Fe),We=le.map(function(Ke){var _t=Ke._x0||Ke.x0||Ke.x||0,wt=Ke._x1||Ke.x1||Ke.x||0,vt=Ke._y0||Ke.y0||Ke.y||0,$t=Ke._y1||Ke.y1||Ke.y||0,Yt=Ke.eventData;if(Yt){var lr=Math.min(_t,wt),dr=Math.max(_t,wt),Nr=Math.min(vt,$t),Fr=Math.max(vt,$t),ln=Ke.trace;if(v.traceIs(ln,"gl3d")){var zr=Fe._fullLayout[ln.scene]._scene.container,Xr=zr.offsetLeft,Ot=zr.offsetTop;lr+=Xr,dr+=Xr,Nr+=Ot,Fr+=Ot}Yt.bbox={x0:lr+Xe,x1:dr+Xe,y0:Nr+Ve,y1:Fr+Ve},ue.inOut_bbox&&ue.inOut_bbox.push(Yt.bbox)}else Yt=!1;return{color:Ke.color||a.defaultLine,x0:Ke.x0||Ke.x||0,x1:Ke.x1||Ke.x||0,y0:Ke.y0||Ke.y||0,y1:Ke.y1||Ke.y||0,xLabel:Ke.xLabel,yLabel:Ke.yLabel,zLabel:Ke.zLabel,text:Ke.text,name:Ke.name,idealAlign:Ke.idealAlign,borderColor:Ke.borderColor,fontFamily:Ke.fontFamily,fontSize:Ke.fontSize,fontColor:Ke.fontColor,fontWeight:Ke.fontWeight,fontStyle:Ke.fontStyle,fontVariant:Ke.fontVariant,nameLength:Ke.nameLength,textAlign:Ke.textAlign,trace:Ke.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Ke.hovertemplate||!1,hovertemplateLabels:Ke.hovertemplateLabels||!1,eventData:Yt}}),it=!1,yt=U(We,{gd:Fe,hovermode:"closest",rotateLabels:it,bgColor:ue.bgColor||a.background,container:X.select(ue.container),outerContainer:ue.outerContainer||ue.container}),bt=yt.hoverLabels,mt=5,ht=0,qe=0;bt.sort(function(Ke,_t){return Ke.y0-_t.y0}).each(function(Ke,_t){var wt=Ke.y0-Ke.by/2;wt-mtdr[0]._length||ma<0||ma>Nr[0]._length)return s.unhoverRaw(Y,le)}if(le.pointerX=va+dr[0]._offset,le.pointerY=ma+Nr[0]._offset,"xval"in le?Ue=p.flat(Ve,le.xval):Ue=p.p2c(dr,va),"yval"in le?Ie=p.flat(Ve,le.yval):Ie=p.p2c(Nr,ma),!h(Ue[0])||!h(Ie[0]))return S.warn("Fx.hover failed",le,Y),s.unhoverRaw(Y,le)}var ti=1/0;function gr(wi,ts){for(Be=0;BeTr&&(Qe.splice(0,Tr),ti=Qe[0].distance),mt&&Ot!==0&&Qe.length===0){Sr.distance=Ot,Sr.index=!1;var No=ft._module.hoverPoints(Sr,or,Cr,"closest",{hoverLayer:We._hoverlayer});if(No&&(No=No.filter(function(yo){return yo.spikeDistance<=Ot})),No&&No.length){var Vs,Ns=No.filter(function(yo){return yo.xa.showspikes&&yo.xa.spikesnap!=="hovered data"});if(Ns.length){var rl=Ns[0];h(rl.x0)&&h(rl.y0)&&(Vs=vr(rl),(!Yr.vLinePoint||Yr.vLinePoint.spikeDistance>Vs.spikeDistance)&&(Yr.vLinePoint=Vs))}var cs=No.filter(function(yo){return yo.ya.showspikes&&yo.ya.spikesnap!=="hovered data"});if(cs.length){var $o=cs[0];h($o.x0)&&h($o.y0)&&(Vs=vr($o),(!Yr.hLinePoint||Yr.hLinePoint.spikeDistance>Vs.spikeDistance)&&(Yr.hLinePoint=Vs))}}}}}gr();function Kt(wi,ts,jo){for(var js=null,us=1/0,Zo,No=0;Nowi.trace.index===na.trace.index):Qe=[na];var Mi=Qe.length,Oi=se("x",na,We),Vt=se("y",na,We);gr(Oi,Vt);var Ct=[],Br={},Kr=0,Qr=function(wi){var ts=d[wi.trace.type]?z(wi):wi.trace.index;if(!Br[ts])Kr++,Br[ts]=Kr,Ct.push(wi);else{var jo=Br[ts]-1,js=Ct[jo];jo>0&&Math.abs(wi.distance)Mi-1;Gr--)Qr(Qe[Gr]);Qe=Ct,gn()}var Jr=Y._hoverdata,yn=[],cn=Q(Y),Dt=me(Y);for(const wi of Qe){var yr=p.makeEventData(wi,wi.trace,wi.cd);if(wi.hovertemplate!==!1){var Hr=!1;wi.cd[wi.index]&&wi.cd[wi.index].ht&&(Hr=wi.cd[wi.index].ht),wi.hovertemplate=Hr||wi.trace.hovertemplate||!1}if(wi.xa&&wi.ya){var _n=wi.x0+wi.xa._offset,Hn=wi.x1+wi.xa._offset,ea=wi.y0+wi.ya._offset,Qn=wi.y1+wi.ya._offset,bn=Math.min(_n,Hn),$n=Math.max(_n,Hn),ki=Math.min(ea,Qn),Ua=Math.max(ea,Qn);yr.bbox={x0:bn+Dt,x1:$n+Dt,y0:ki+cn,y1:Ua+cn}}wi.eventData=[yr],yn.push(yr)}Y._hoverdata=yn;var Fi=ht==="y"&&(ct.length>1||Qe.length>1)||ht==="closest"&&Fn&&Qe.length>1,Ji=a.combine(We.plot_bgcolor||a.background,We.paper_bgcolor),fo=U(Qe,{gd:Y,hovermode:ht,rotateLabels:Fi,bgColor:Ji,container:We._hoverlayer,outerContainer:We._paper.node(),commonLabelOpts:We.hoverlabel,hoverdistance:We.hoverdistance}),co=fo.hoverLabels;if(p.isUnifiedHover(ht)||(D(co,Fi,We,fo.commonLabelBoundingBox),J(co,Fi,We._invScaleX,We._invScaleY)),Fe&&Fe.tagName){var So=v.getComponentMethod("annotations","hasClickToShow")(Y,yn);n(X.select(Fe),So?"pointer":"")}!Fe||Te||!pe(Y,le,Jr)||(Jr&&Y.emit("plotly_unhover",{event:le,points:Jr}),Y.emit("plotly_hover",{event:le,points:Y._hoverdata,xaxes:dr,yaxes:Nr,xvals:Ue,yvals:Ie}))}function z(Y){return[Y.trace.index,Y.index,Y.x0,Y.y0,Y.name,Y.attr,Y.xa?Y.xa._id:"",Y.ya?Y.ya._id:""].join(",")}var N=/([\s\S]*)<\/extra>/;function U(Y,le){var ue=le.gd,Te=ue._fullLayout,Fe=le.hovermode,Ve=le.rotateLabels,Xe=le.bgColor,We=le.container,it=le.outerContainer,yt=le.commonLabelOpts||{};if(Y.length===0)return[[]];var bt=le.fontFamily||T.HOVERFONT,mt=le.fontSize||T.HOVERFONTSIZE,ht=le.fontWeight||Te.font.weight,qe=le.fontStyle||Te.font.style,ze=le.fontVariant||Te.font.variant,Ae=le.fontTextcase||Te.font.textcase,Ke=le.fontLineposition||Te.font.lineposition,_t=le.fontShadow||Te.font.shadow,wt=Y[0],vt=wt.xa,$t=wt.ya,Yt=Fe.charAt(0),lr=Yt+"Label",dr=wt[lr];if(dr===void 0&&vt.type==="multicategory")for(var Nr=0;NrTe.width-Dt&&(yr=Te.width-Dt),Mi.attr("d","M"+(Jr-yr)+",0L"+(Jr-yr+m)+","+cn+m+"H"+Dt+"v"+cn+(u*2+Gr.height)+"H"+-Dt+"V"+cn+m+"H"+(Jr-yr-m)+"Z"),Jr=yr,Be.minX=Jr-Dt,Be.maxX=Jr+Dt,vt.side==="top"?(Be.minY=yn-(u*2+Gr.height),Be.maxY=yn-u):(Be.minY=yn+u,Be.maxY=yn+(u*2+Gr.height))}else{var Hr,_n,Hn;$t.side==="right"?(Hr="start",_n=1,Hn="",Jr=vt._offset+vt._length):(Hr="end",_n=-1,Hn="-",Jr=vt._offset),yn=$t._offset+(wt.y0+wt.y1)/2,Oi.attr("text-anchor",Hr),Mi.attr("d","M0,0L"+Hn+m+","+m+"V"+(u+Gr.height/2)+"h"+Hn+(u*2+Gr.width)+"V-"+(u+Gr.height/2)+"H"+Hn+m+"V-"+m+"Z"),Be.minY=yn-(u+Gr.height/2),Be.maxY=yn+(u+Gr.height/2),$t.side==="right"?(Be.minX=Jr+m,Be.maxX=Jr+m+(u*2+Gr.width)):(Be.minX=Jr-m-(u*2+Gr.width),Be.maxX=Jr-m);var ea=Gr.height/2,Qn=ln-Gr.top-ea,bn="clip"+Te._uid+"commonlabel"+$t._id,$n;if(JrMi.hoverinfo!=="none");if(na.length===0)return[];var at=Te.hoverlabel,ft=at.font,Bt=na[0],Nt=((Fe==="x unified"?Bt.xa:Bt.ya).unifiedhovertitle||{}).text,Ht=Nt?S.hovertemplateString({data:Fe==="x unified"?[{xa:Bt.xa,x:Bt.xVal}]:[{ya:Bt.ya,y:Bt.yVal}],fallback:Bt.trace.hovertemplatefallback,locale:Te._d3locale,template:Nt}):dr,or={showlegend:!0,legend:{title:{text:Ht,font:ft},font:ft,bgcolor:at.bgcolor,bordercolor:at.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:Te.legend?Te.legend.traceorder:void 0,orientation:"v"}},Cr={font:ft};l(or,Cr,ue._fullData);var Sr=Cr.legend;Sr.entries=[];for(var Tr=0;Tr=0?Ma=Mn:In+ja=0?Ma=In:fa+ja=0?Da=rn:gn+ti=0?Da=gn:Ca+ti=0,(na.idealAlign==="top"||!Fi)&&Ji?(Hn-=Qn/2,na.anchor="end"):Fi?(Hn+=Qn/2,na.anchor="start"):na.anchor="middle",na.crossPos=Hn;else{if(na.pos=Hn,Fi=_n+ea/2+Ua<=zr,Ji=_n-ea/2-Ua>=0,(na.idealAlign==="left"||!Fi)&&Ji)_n-=ea/2,na.anchor="end";else if(Fi)_n+=ea/2,na.anchor="start";else{na.anchor="middle";var fo=Ua/2,co=_n+fo-zr,So=_n-fo;co>0&&(_n-=co),So<0&&(_n+=-So)}na.crossPos=_n}yn.attr("text-anchor",na.anchor),Dt&&cn.attr("text-anchor",na.anchor),Mi.attr("transform",e(_n,Hn)+(Ve?t(b):""))}),{hoverLabels:Va,commonLabelBoundingBox:Be}}function B(Y,le,ue,Te,Fe,Ve){var Xe,We,it="",yt="";Y.nameOverride!==void 0&&(Y.name=Y.nameOverride),Y.name&&(Y.trace._meta&&(Y.name=S.templateString(Y.name,Y.trace._meta)),it=W(Y.name,Y.nameLength));var bt=ue.charAt(0),mt=bt==="x"?"y":"x";Y.zLabel!==void 0?(Y.xLabel!==void 0&&(yt+="x: "+Y.xLabel+"
"),Y.yLabel!==void 0&&(yt+="y: "+Y.yLabel+"
"),Y.trace.type!=="choropleth"&&Y.trace.type!=="choroplethmapbox"&&Y.trace.type!=="choroplethmap"&&(yt+=(yt?"z: ":"")+Y.zLabel)):le&&Y[bt+"Label"]===Fe?yt=Y[mt+"Label"]||"":Y.xLabel===void 0?Y.yLabel!==void 0&&Y.trace.type!=="scattercarpet"&&(yt=Y.yLabel):Y.yLabel===void 0?yt=Y.xLabel:yt="("+Y.xLabel+", "+Y.yLabel+")",(Y.text||Y.text===0)&&!Array.isArray(Y.text)&&(yt+=(yt?"
":"")+Y.text),Y.extraText!==void 0&&(yt+=(yt?"
":"")+Y.extraText),Ve&&yt===""&&!Y.hovertemplate&&(it===""&&Ve.remove(),yt=it),(We=(Xe=Y.trace)==null?void 0:Xe.hoverlabel)!=null&&We.split&&(Y.hovertemplate="");const{hovertemplate:ht=!1}=Y;if(ht){const qe=Y.hovertemplateLabels||Y;Y[bt+"Label"]!==Fe&&(qe[bt+"other"]=qe[bt+"Val"],qe[bt+"otherLabel"]=qe[bt+"Label"]),yt=S.hovertemplateString({data:[Y.eventData[0]||{},Y.trace._meta],fallback:Y.trace.hovertemplatefallback,labels:qe,locale:Te._d3locale,template:ht}),yt=yt.replace(N,(ze,Ae)=>(it=W(Ae,Y.nameLength),""))}return[yt,it]}function D(Y,le,ue,Te){var Fe=le?"xa":"ya",Ve=le?"ya":"xa",Xe=0,We=1,it=Y.size(),yt=new Array(it),bt=0,mt=Te.minX,ht=Te.maxX,qe=Te.minY,ze=Te.maxY,Ae=function(Ue){return Ue*ue._invScaleX},Ke=function(Ue){return Ue*ue._invScaleY};Y.each(function(Ue){var Ie=Ue[Fe],Pe=Ue[Ve],Be=Ie._id.charAt(0)==="x",at=Ie.range;bt===0&&at&&at[0]>at[1]!==Be&&(We=-1);var ft=0,Bt=Be?ue.width:ue.height;if(ue.hovermode==="x"||ue.hovermode==="y"){var Nt=j(Ue,le),Ht=Ue.anchor,or=Ht==="end"?-1:1,Cr,Sr;if(Ht==="middle")Cr=Ue.crossPos+(Be?Ke(Nt.y-Ue.by/2):Ae(Ue.bx/2+Ue.tx2width/2)),Sr=Cr+(Be?Ke(Ue.by):Ae(Ue.bx));else if(Be)Cr=Ue.crossPos+Ke(m+Nt.y)-Ke(Ue.by/2-m),Sr=Cr+Ke(Ue.by);else{var Tr=Ae(or*m+Nt.x),Yr=Tr+Ae(or*Ue.bx);Cr=Ue.crossPos+Math.min(Tr,Yr),Sr=Ue.crossPos+Math.max(Tr,Yr)}Be?qe!==void 0&&ze!==void 0&&Math.min(Sr,ze)-Math.max(Cr,qe)>1&&(Pe.side==="left"?(ft=Pe._mainLinePosition,Bt=ue.width):Bt=Pe._mainLinePosition):mt!==void 0&&ht!==void 0&&Math.min(Sr,ht)-Math.max(Cr,mt)>1&&(Pe.side==="top"?(ft=Pe._mainLinePosition,Bt=ue.height):Bt=Pe._mainLinePosition)}yt[bt++]=[{datum:Ue,traceIndex:Ue.trace.index,dp:0,pos:Ue.pos,posref:Ue.posref,size:Ue.by*(Be?E:1)/2,pmin:ft,pmax:Bt}]}),yt.sort(function(Ue,Ie){return Ue[0].posref-Ie[0].posref||We*(Ie[0].traceIndex-Ue[0].traceIndex)});var _t,wt,vt,$t,Yt,lr,dr;function Nr(Ue){var Ie=Ue[0],Pe=Ue[Ue.length-1];if(wt=Ie.pmin-Ie.pos-Ie.dp+Ie.size,vt=Pe.pos+Pe.dp+Pe.size-Ie.pmax,wt>.01){for(Yt=Ue.length-1;Yt>=0;Yt--)Ue[Yt].dp+=wt;_t=!1}if(!(vt<.01)){if(wt<-.01){for(Yt=Ue.length-1;Yt>=0;Yt--)Ue[Yt].dp-=vt;_t=!1}if(_t){var Be=0;for($t=0;$tIe.pmax&&Be++;for($t=Ue.length-1;$t>=0&&!(Be<=0);$t--)lr=Ue[$t],lr.pos>Ie.pmax-1&&(lr.del=!0,Be--);for($t=0;$t=0;Yt--)Ue[Yt].dp-=vt;for($t=Ue.length-1;$t>=0&&!(Be<=0);$t--)lr=Ue[$t],lr.pos+lr.dp+lr.size>Ie.pmax&&(lr.del=!0,Be--)}}}for(;!_t&&Xe<=it;){for(Xe++,_t=!0,$t=0;$t.01){for(Yt=ln.length-1;Yt>=0;Yt--)ln[Yt].dp+=wt;for(Fr.push.apply(Fr,ln),yt.splice($t+1,1),dr=0,Yt=Fr.length-1;Yt>=0;Yt--)dr+=Fr[Yt].dp;for(vt=dr/Fr.length,Yt=Fr.length-1;Yt>=0;Yt--)Fr[Yt].dp-=vt;_t=!1}else $t++}yt.forEach(Nr)}for($t=yt.length-1;$t>=0;$t--){var Ot=yt[$t];for(Yt=Ot.length-1;Yt>=0;Yt--){var Qe=Ot[Yt],ct=Qe.datum;ct.offset=Qe.dp,ct.del=Qe.del}}}function j(Y,le){var ue=0,Te=Y.offset;return le&&(Te*=-w,ue=Y.offset*_),{x:ue,y:Te}}function q(Y){var le={start:1,end:-1,middle:0}[Y.anchor],ue=le*(m+u),Te=ue+le*(Y.txwidth+u),Fe=Y.anchor==="middle";return Fe&&(ue-=Y.tx2width/2,Te+=Y.txwidth/2+u),{alignShift:le,textShiftX:ue,text2ShiftX:Te}}function J(Y,le,ue,Te){var Fe=function(Xe){return Xe*ue},Ve=function(Xe){return Xe*Te};Y.each(function(Xe){var We=X.select(this);if(Xe.del)return We.remove();var it=We.select("text.nums"),yt=Xe.anchor,bt=yt==="end"?-1:1,mt=q(Xe),ht=j(Xe,le),qe=ht.x,ze=ht.y,Ae=yt==="middle",Ke="hoverlabel"in Xe.trace?Xe.trace.hoverlabel.showarrow:!0,_t;Ae?_t="M-"+Fe(Xe.bx/2+Xe.tx2width/2)+","+Ve(ze-Xe.by/2)+"h"+Fe(Xe.bx)+"v"+Ve(Xe.by)+"h-"+Fe(Xe.bx)+"Z":Ke?_t="M0,0L"+Fe(bt*m+qe)+","+Ve(m+ze)+"v"+Ve(Xe.by/2-m)+"h"+Fe(bt*Xe.bx)+"v-"+Ve(Xe.by)+"H"+Fe(bt*m+qe)+"V"+Ve(ze-m)+"Z":_t="M"+Fe(bt*m+qe)+","+Ve(ze-Xe.by/2)+"h"+Fe(bt*Xe.bx)+"v"+Ve(Xe.by)+"h"+Fe(-bt*Xe.bx)+"Z",We.select("path").attr("d",_t);var wt=qe+mt.textShiftX,vt=ze+Xe.ty0-Xe.by/2+u,$t=Xe.textAlign||"auto";$t!=="auto"&&($t==="left"&&yt!=="start"?(it.attr("text-anchor","start"),wt=Ae?-Xe.bx/2-Xe.tx2width/2+u:-Xe.bx-u):$t==="right"&&yt!=="end"&&(it.attr("text-anchor","end"),wt=Ae?Xe.bx/2-Xe.tx2width/2-u:Xe.bx+u)),it.call(o.positionText,Fe(wt),Ve(vt)),Xe.tx2width&&(We.select("text.name").call(o.positionText,Fe(mt.text2ShiftX+mt.alignShift*u+qe),Ve(ze+Xe.ty0-Xe.by/2+u)),We.select("rect").call(i.setRect,Fe(mt.text2ShiftX+(mt.alignShift-1)*Xe.tx2width/2+qe),Ve(ze-Xe.by/2-1),Fe(Xe.tx2width),Ve(Xe.by+2)))})}function oe(Y,le){var ue=Y.index,Te=Y.trace||{},Fe=Y.cd[0],Ve=Y.cd[ue]||{};function Xe(ht){return ht||h(ht)&&ht===0}var We=Array.isArray(ue)?function(ht,qe){var ze=S.castOption(Fe,ue,ht);return Xe(ze)?ze:S.extractOption({},Te,"",qe)}:function(ht,qe){return S.extractOption(Ve,Te,ht,qe)};function it(ht,qe,ze){var Ae=We(qe,ze);Xe(Ae)&&(Y[ht]=Ae)}if(it("hoverinfo","hi","hoverinfo"),it("bgcolor","hbg","hoverlabel.bgcolor"),it("borderColor","hbc","hoverlabel.bordercolor"),it("fontFamily","htf","hoverlabel.font.family"),it("fontSize","hts","hoverlabel.font.size"),it("fontColor","htc","hoverlabel.font.color"),it("fontWeight","htw","hoverlabel.font.weight"),it("fontStyle","hty","hoverlabel.font.style"),it("fontVariant","htv","hoverlabel.font.variant"),it("nameLength","hnl","hoverlabel.namelength"),it("textAlign","hta","hoverlabel.align"),Y.posref=le==="y"||le==="closest"&&Te.orientation==="h"?Y.xa._offset+(Y.x0+Y.x1)/2:Y.ya._offset+(Y.y0+Y.y1)/2,Y.x0=S.constrain(Y.x0,0,Y.xa._length),Y.x1=S.constrain(Y.x1,0,Y.xa._length),Y.y0=S.constrain(Y.y0,0,Y.ya._length),Y.y1=S.constrain(Y.y1,0,Y.ya._length),Y.xLabelVal!==void 0&&(Y.xLabel="xLabel"in Y?Y.xLabel:f.hoverLabelText(Y.xa,Y.xLabelVal,Te.xhoverformat),Y.xVal=Y.xa.c2d(Y.xLabelVal)),Y.yLabelVal!==void 0&&(Y.yLabel="yLabel"in Y?Y.yLabel:f.hoverLabelText(Y.ya,Y.yLabelVal,Te.yhoverformat),Y.yVal=Y.ya.c2d(Y.yLabelVal)),Y.zLabelVal!==void 0&&Y.zLabel===void 0&&(Y.zLabel=String(Y.zLabelVal)),!isNaN(Y.xerr)&&!(Y.xa.type==="log"&&Y.xerr<=0)){var yt=f.tickText(Y.xa,Y.xa.c2l(Y.xerr),"hover").text;Y.xerrneg!==void 0?Y.xLabel+=" +"+yt+" / -"+f.tickText(Y.xa,Y.xa.c2l(Y.xerrneg),"hover").text:Y.xLabel+=" ± "+yt,le==="x"&&(Y.distance+=1)}if(!isNaN(Y.yerr)&&!(Y.ya.type==="log"&&Y.yerr<=0)){var bt=f.tickText(Y.ya,Y.ya.c2l(Y.yerr),"hover").text;Y.yerrneg!==void 0?Y.yLabel+=" +"+bt+" / -"+f.tickText(Y.ya,Y.ya.c2l(Y.yerrneg),"hover").text:Y.yLabel+=" ± "+bt,le==="y"&&(Y.distance+=1)}var mt=Y.hoverinfo||Y.trace.hoverinfo;return mt&&mt!=="all"&&(mt=Array.isArray(mt)?mt:mt.split("+"),mt.indexOf("x")===-1&&(Y.xLabel=void 0),mt.indexOf("y")===-1&&(Y.yLabel=void 0),mt.indexOf("z")===-1&&(Y.zLabel=void 0),mt.indexOf("text")===-1&&(Y.text=void 0),mt.indexOf("name")===-1&&(Y.name=void 0)),Y}function ye(Y,le,ue){var Te=ue.container,Fe=ue.fullLayout,Ve=Fe._size,Xe=ue.event,We=!!le.hLinePoint,it=!!le.vLinePoint,yt,bt;if(Te.selectAll(".spikeline").remove(),!!(it||We)){var mt=a.combine(Fe.plot_bgcolor,Fe.paper_bgcolor);if(We){var ht=le.hLinePoint,qe,ze;yt=ht&&ht.xa,bt=ht&&ht.ya;var Ae=bt.spikesnap;Ae==="cursor"?(qe=Xe.pointerX,ze=Xe.pointerY):(qe=yt._offset+ht.x,ze=bt._offset+ht.y);var Ke=x.readability(ht.color,mt)<1.5?a.contrast(mt):ht.color,_t=bt.spikemode,wt=bt.spikethickness,vt=bt.spikecolor||Ke,$t=f.getPxPosition(Y,bt),Yt,lr;if(_t.indexOf("toaxis")!==-1||_t.indexOf("across")!==-1){if(_t.indexOf("toaxis")!==-1&&(Yt=$t,lr=qe),_t.indexOf("across")!==-1){var dr=bt._counterDomainMin,Nr=bt._counterDomainMax;bt.anchor==="free"&&(dr=Math.min(dr,bt.position),Nr=Math.max(Nr,bt.position)),Yt=Ve.l+dr*Ve.w,lr=Ve.l+Nr*Ve.w}Te.insert("line",":first-child").attr({x1:Yt,x2:lr,y1:ze,y2:ze,"stroke-width":wt,stroke:vt,"stroke-dasharray":i.dashStyle(bt.spikedash,wt)}).classed("spikeline",!0).classed("crisp",!0),Te.insert("line",":first-child").attr({x1:Yt,x2:lr,y1:ze,y2:ze,"stroke-width":wt+2,stroke:mt}).classed("spikeline",!0).classed("crisp",!0)}_t.indexOf("marker")!==-1&&Te.insert("circle",":first-child").attr({cx:$t+(bt.side!=="right"?wt:-wt),cy:ze,r:wt,fill:vt}).classed("spikeline",!0)}if(it){var Fr=le.vLinePoint,ln,zr;yt=Fr&&Fr.xa,bt=Fr&&Fr.ya;var Xr=yt.spikesnap;Xr==="cursor"?(ln=Xe.pointerX,zr=Xe.pointerY):(ln=yt._offset+Fr.x,zr=bt._offset+Fr.y);var Ot=x.readability(Fr.color,mt)<1.5?a.contrast(mt):Fr.color,Qe=yt.spikemode,ct=yt.spikethickness,Ue=yt.spikecolor||Ot,Ie=f.getPxPosition(Y,yt),Pe,Be;if(Qe.indexOf("toaxis")!==-1||Qe.indexOf("across")!==-1){if(Qe.indexOf("toaxis")!==-1&&(Pe=Ie,Be=zr),Qe.indexOf("across")!==-1){var at=yt._counterDomainMin,ft=yt._counterDomainMax;yt.anchor==="free"&&(at=Math.min(at,yt.position),ft=Math.max(ft,yt.position)),Pe=Ve.t+(1-ft)*Ve.h,Be=Ve.t+(1-at)*Ve.h}Te.insert("line",":first-child").attr({x1:ln,x2:ln,y1:Pe,y2:Be,"stroke-width":ct,stroke:Ue,"stroke-dasharray":i.dashStyle(yt.spikedash,ct)}).classed("spikeline",!0).classed("crisp",!0),Te.insert("line",":first-child").attr({x1:ln,x2:ln,y1:Pe,y2:Be,"stroke-width":ct+2,stroke:mt}).classed("spikeline",!0).classed("crisp",!0)}Qe.indexOf("marker")!==-1&&Te.insert("circle",":first-child").attr({cx:ln,cy:Ie-(yt.side!=="top"?ct:-ct),r:ct,fill:Ue}).classed("spikeline",!0)}}}function pe(Y,le,ue){if(!ue||ue.length!==Y._hoverdata.length)return!0;for(var Te=ue.length-1;Te>=0;Te--){var Fe=ue[Te],Ve=Y._hoverdata[Te];if(Fe.curveNumber!==Ve.curveNumber||String(Fe.pointNumber)!==String(Ve.pointNumber)||String(Fe.pointNumbers)!==String(Ve.pointNumbers)||Fe.binNumber!==Ve.binNumber)return!0}return!1}function ge(Y,le){return!0}function W(Y,le){return o.plainText(Y||"",{len:le,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function ae(Y,le){for(var ue=le.charAt(0),Te=[],Fe=[],Ve=[],Xe=0;XeY.offsetTop+Y.clientTop,me=Y=>Y.offsetLeft+Y.clientLeft;function ie(Y,le){var ue=Y._fullLayout,Te=le.getBoundingClientRect(),Fe=Te.left,Ve=Te.top,Xe=Fe+Te.width,We=Ve+Te.height,it=S.apply3DTransform(ue._invTransform)(Fe,Ve),yt=S.apply3DTransform(ue._invTransform)(Xe,We),bt=it[0],mt=it[1],ht=yt[0],qe=yt[1];return{x:bt,y:mt,width:ht-bt,height:qe-mt,top:Math.min(mt,qe),left:Math.min(bt,ht),right:Math.max(bt,ht),bottom:Math.max(mt,qe)}}}}),Ty=_e({"src/components/fx/hoverlabel_defaults.js"(ee,X){var h=kn(),x=so(),S=rc().isUnifiedHover;X.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=x.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)}}}),tM=_e({"src/components/fx/layout_global_defaults.js"(ee,X){var h=kn(),x=Ty(),S=wf();X.exports=function(e,t){function r(o,n){return h.coerce(e,t,S,o,n)}x(e,t,r)}}}),rM=_e({"src/components/fx/defaults.js"(ee,X){var h=kn(),x=Qu(),S=Ty();X.exports=function(e,t,r,o){function n(a,s){return h.coerce(e,t,x,a,s)}var i=h.extendFlat({},o.hoverlabel);t.hovertemplate&&(i.namelength=-1),S(e,t,n,i)}}}),kw=_e({"src/components/fx/hovermode_defaults.js"(ee,X){var h=kn(),x=wf();X.exports=function(k,e){function t(r,o){return e[r]!==void 0?e[r]:h.coerce(k,e,x,r,o)}return t("clickmode"),t("hoversubplots"),t("hovermode")}}}),nM=_e({"src/components/fx/layout_defaults.js"(ee,X){var h=kn(),x=wf(),S=kw(),k=Ty();X.exports=function(t,r){function o(v,p){return h.coerce(t,r,x,v,p)}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"),k(t,r,o),h.coerceFont(o,"hoverlabel.grouptitlefont",r.hoverlabel.font)}}}),aM=_e({"src/components/fx/calc.js"(ee,X){var h=kn(),x=bi();X.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("")}}}}),x_=_e({"src/components/shapes/draw_newshape/constants.js"(ee,X){var h=32;X.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)}}}),w_=_e({"src/components/selections/helpers.js"(ee,X){var h=kn().strTranslate;function x(t,r){switch(t.type){case"log":return t.p2d(r);case"date":return t.p2r(r,0,t.calendar);default:return t.p2r(r)}}function 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 k(t){var r=t._id.charAt(0)==="y"?1:0;return function(o){return x(t,o[r])}}function e(t){return h(t.xaxis._offset,t.yaxis._offset)}X.exports={p2r:x,r2p:S,axValue:k,getTransform:e}}}),b0=_e({"src/components/shapes/draw_newshape/helpers.js"(ee){var X=Vd(),h=x_(),x=h.CIRCLE_SIDES,S=h.SQRT2,k=w_(),e=k.p2r,t=k.r2p,r=[0,3,4,5,6,1,2],o=[0,3,4,1,2];ee.writePaths=function(a){var s=a.length;if(!s)return"M0,0Z";for(var f="",c=0;c0&&gl&&(b="X"),b});return c>l&&(g=g.replace(/[\s,]*X.*/,""),h.log("Ignoring extra params in segment "+f)),v+g})}function k(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}}}),Pw=_e({"src/components/shapes/display_labels.js"(ee,X){var h=kn(),x=xs(),S=Au(),k=ri(),e=b0().readPaths,t=x0(),r=t.getPathString,o=Vn(),n=eh().FROM_TL;X.exports=function(f,c,v,p){if(p.selectAll(".shape-label").remove(),!!(v.label.text||v.label.texttemplate)){var T;if(v.label.texttemplate){var l={};if(v.type!=="path"){var g=x.getFromId(f,v.xref),b=x.getFromId(f,v.yref);for(var A in o){var E=o[A](v,g,b);E!==void 0&&(l[A]=E)}}T=h.texttemplateStringForShapes({data:[l],fallback:v.label.texttemplatefallback,locale:f._fullLayout._d3locale,template:v.label.texttemplate})}else T=v.label.text;var _={"data-index":c},w=v.label.font,m={"data-notex":1},u=p.append("g").attr(_).classed("shape-label",!0),d=u.append("text").attr(m).classed("shape-label-text",!0).text(T),y,R,L,z;if(v.path){var N=r(f,v),U=e(N,f);y=1/0,L=1/0,R=-1/0,z=-1/0;for(var B=0;B=s?p=f-v:p=v-f,-180/Math.PI*Math.atan2(p,T)}function a(s,f,c,v,p,T,l){var g=p.label.textposition,b=p.label.textangle,A=p.label.padding,E=p.type,_=Math.PI/180*T,w=Math.sin(_),m=Math.cos(_),u=p.label.xanchor,d=p.label.yanchor,y,R,L,z;if(E==="line"){g==="start"?(y=s,R=f):g==="end"?(y=c,R=v):(y=(s+c)/2,R=(f+v)/2),u==="auto"&&(g==="start"?b==="auto"?c>s?u="left":cs?u="right":cs?u="right":cs?u="left":c1&&!(mt.length===2&&mt[1][0]==="Z")&&(W===0&&(mt[0][0]="M"),y[ge]=mt,U(),B())}}function Te(mt,ht){if(mt===2){ge=+ht.srcElement.getAttribute("data-i"),W=+ht.srcElement.getAttribute("data-j");var qe=y[ge];!T(qe)&&!l(qe)&&ue()}}function Fe(mt){ye=[];for(var ht=0;htU&&at>B&&!Ie.shiftKey?s.getCursor(ft/Be,1-Bt/at):"move";f(y,Nt),Yt=Nt.split("-")[0]}}function Fr(Ie){l(d)||(D&&(ae=Ae(R.xanchor)),j&&(se=Ke(R.yanchor)),R.type==="path"?Ve=R.path:(ye=D?R.x0:Ae(R.x0),pe=j?R.y0:Ke(R.y0),ge=D?R.x1:Ae(R.x1),W=j?R.y1:Ke(R.y1)),yeW?(Q=pe,le="y0",me=W,ue="y1"):(Q=W,le="y1",me=pe,ue="y0"),Nr(Ie),Qe(z,R),Ue(y,R,d),$t.moveFn=Yt==="move"?Xr:Ot,$t.altKey=Ie.altKey)}function ln(){l(d)||(f(y),ct(z),A(y,d,R),x.call("_guiRelayout",d,N.getUpdateObj()))}function zr(){l(d)||ct(z)}function Xr(Ie,Pe){if(R.type==="path"){var Be=function(Bt){return Bt},at=Be,ft=Be;D?oe("xanchor",R.xanchor=_t(ae+Ie)):(at=function(Nt){return _t(Ae(Nt)+Ie)},We&&We.type==="date"&&(at=v.encodeDate(at))),j?oe("yanchor",R.yanchor=wt(se+Pe)):(ft=function(Nt){return wt(Ke(Nt)+Pe)},yt&&yt.type==="date"&&(ft=v.encodeDate(ft))),oe("path",R.path=_(Ve,at,ft))}else D?oe("xanchor",R.xanchor=_t(ae+Ie)):(oe("x0",R.x0=_t(ye+Ie)),oe("x1",R.x1=_t(ge+Ie))),j?oe("yanchor",R.yanchor=wt(se+Pe)):(oe("y0",R.y0=wt(pe+Pe)),oe("y1",R.y1=wt(W+Pe)));y.attr("d",p(d,R)),Qe(z,R),r(d,L,R,Xe)}function Ot(Ie,Pe){if(J){var Be=function(Jn){return Jn},at=Be,ft=Be;D?oe("xanchor",R.xanchor=_t(ae+Ie)):(at=function(ja){return _t(Ae(ja)+Ie)},We&&We.type==="date"&&(at=v.encodeDate(at))),j?oe("yanchor",R.yanchor=wt(se+Pe)):(ft=function(ja){return wt(Ke(ja)+Pe)},yt&&yt.type==="date"&&(ft=v.encodeDate(ft))),oe("path",R.path=_(Ve,at,ft))}else if(q){if(Yt==="resize-over-start-point"){var Bt=ye+Ie,Nt=j?pe-Pe:pe+Pe;oe("x0",R.x0=D?Bt:_t(Bt)),oe("y0",R.y0=j?Nt:wt(Nt))}else if(Yt==="resize-over-end-point"){var Ht=ge+Ie,or=j?W-Pe:W+Pe;oe("x1",R.x1=D?Ht:_t(Ht)),oe("y1",R.y1=j?or:wt(or))}}else{var Cr=function(Jn){return Yt.indexOf(Jn)!==-1},Sr=Cr("n"),Tr=Cr("s"),Yr=Cr("w"),Fn=Cr("e"),ua=Sr?Q+Pe:Q,ta=Tr?me+Pe:me,va=Yr?ie+Ie:ie,ma=Fn?Y+Ie:Y;j&&(Sr&&(ua=Q-Pe),Tr&&(ta=me-Pe)),(!j&&ta-ua>B||j&&ua-ta>B)&&(oe(le,R[le]=j?ua:wt(ua)),oe(ue,R[ue]=j?ta:wt(ta))),ma-va>U&&(oe(Te,R[Te]=D?va:_t(va)),oe(Fe,R[Fe]=D?ma:_t(ma)))}y.attr("d",p(d,R)),Qe(z,R),r(d,L,R,Xe)}function Qe(Ie,Pe){(D||j)&&Be();function Be(){var at=Pe.type!=="path",ft=Ie.selectAll(".visual-cue").data([0]),Bt=1;ft.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":Bt}).classed("visual-cue",!0);var Nt=Ae(D?Pe.xanchor:S.midRange(at?[Pe.x0,Pe.x1]:v.extractPathCoords(Pe.path,c.paramIsX))),Ht=Ke(j?Pe.yanchor:S.midRange(at?[Pe.y0,Pe.y1]:v.extractPathCoords(Pe.path,c.paramIsY)));if(Nt=v.roundPositionForSharpStrokeRendering(Nt,Bt),Ht=v.roundPositionForSharpStrokeRendering(Ht,Bt),D&&j){var or="M"+(Nt-1-Bt)+","+(Ht-1-Bt)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";ft.attr("d",or)}else if(D){var Cr="M"+(Nt-1-Bt)+","+(Ht-9-Bt)+"v18 h2 v-18 Z";ft.attr("d",Cr)}else{var Sr="M"+(Nt-9-Bt)+","+(Ht-1-Bt)+"h18 v2 h-18 Z";ft.attr("d",Sr)}}}function ct(Ie){Ie.selectAll(".visual-cue").remove()}function Ue(Ie,Pe,Be){var at=Pe.xref,ft=Pe.yref,Bt=k.getFromId(Be,at),Nt=k.getFromId(Be,ft),Ht="";at!=="paper"&&!Bt.autorange&&(Ht+=at),ft!=="paper"&&!Nt.autorange&&(Ht+=ft),i.setClipUrl(Ie,Ht?"clip"+Be._fullLayout._uid+Ht:null,Be)}}function _(d,y,R){return d.replace(c.segmentRE,function(L){var z=0,N=L.charAt(0),U=c.paramIsX[N],B=c.paramIsY[N],D=c.numParams[N],j=L.slice(1).replace(c.paramRE,function(q){return z>=D||(U[z]?q=y(q):B[z]&&(q=R(q)),z++),q});return N+j})}function w(d,y){if(g(d)){var R=y.node(),L=+R.getAttribute("data-index");if(L>=0){if(L===d._fullLayout._activeShapeIndex){m(d);return}d._fullLayout._activeShapeIndex=L,d._fullLayout._deactivateShape=m,T(d)}}}function m(d){if(g(d)){var y=d._fullLayout._activeShapeIndex;y>=0&&(o(d),delete d._fullLayout._activeShapeIndex,T(d))}}function u(d){if(g(d)){o(d);var y=d._fullLayout._activeShapeIndex,R=(d.layout||{}).shapes||[];if(y1?(pe=["toggleHover"],ge=["resetViews"]):u?(ye=["zoomInGeo","zoomOutGeo"],pe=["hoverClosestGeo"],ge=["resetGeo"]):m?(pe=["hoverClosest3d"],ge=["resetCameraDefault3d","resetCameraLastSave3d"]):L?(ye=["zoomInMapbox","zoomOutMapbox"],pe=["toggleHover"],ge=["resetViewMapbox"]):z?(ye=["zoomInMap","zoomOutMap"],pe=["toggleHover"],ge=["resetViewMap"]):d?pe=["hoverClosestPie"]:B?(pe=["hoverClosestCartesian","hoverCompareCartesian"],ge=["resetViewSankey"]):pe=["toggleHover"],w&&pe.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||j)&&(pe=[]),w&&!D&&(ye=["zoomIn2d","zoomOut2d","autoScale2d"],ge[0]!=="resetViews"&&(ge=["resetScale2d"])),m?W=["zoom3d","pan3d","orbitRotation","tableRotation"]:w&&!D||R?W=["zoom2d","pan2d"]:L||z||u?W=["pan2d"]:N&&(W=["zoom2d"]),a(T)&&W.push("select2d","lasso2d");var ae=[],se=function(Y){ae.indexOf(Y)===-1&&pe.indexOf(Y)!==-1&&ae.push(Y)};if(Array.isArray(E)){for(var Q=[],me=0;meb?T.slice(b):l.slice(g))+A}function f(v,p){for(var T=p._size,l=T.h/T.w,g={},b=Object.keys(v),A=0;At*R&&!U)){for(b=0;bW&&uepe&&(pe=ue);var Fe=(pe-ye)/(2*ge);u/=Fe,ye=_.l2r(ye),pe=_.l2r(pe),_.range=_._input.range=q=B[1]||J[1]<=B[0])&&oe[0]D[0])return!0}return!1}function A(B){var D=B._fullLayout,j=D._size,q=j.p,J=i.list(B,"",!0),oe,ye,pe,ge,W,ae;if(D._paperdiv.style({width:B._context.responsive&&D.autosize&&!B._context._hasZeroWidth&&!B.layout.width?"100%":D.width+"px",height:B._context.responsive&&D.autosize&&!B._context._hasZeroHeight&&!B.layout.height?"100%":D.height+"px"}).selectAll(".main-svg").call(r.setSize,D.width,D.height),B._context.setBackground(B,D.paper_bgcolor),ee.drawMainTitle(B),n.manage(B),!D._has("cartesian"))return x.previousPromises(B);function se(Ue,Ie,Pe){var Be=Ue._lw/2;if(Ue._id.charAt(0)==="x"){if(Ie){if(Pe==="top")return Ie._offset-q-Be}else return j.t+j.h*(1-(Ue.position||0))+Be%1;return Ie._offset+Ie._length+q+Be}if(Ie){if(Pe==="right")return Ie._offset+Ie._length+q+Be}else return j.l+j.w*(Ue.position||0)+Be%1;return Ie._offset-q-Be}for(oe=0;oe0){y(B,oe,W,ge),pe.attr({x:ye,y:oe,"text-anchor":q,dy:z(D.yanchor)}).call(k.positionText,ye,oe);var ae=(D.text.match(k.BR_TAG_ALL)||[]).length;if(ae){var se=a.LINE_SPACING*ae+a.MID_SHIFT;D.y===0&&(se=-se),pe.selectAll(".line").each(function(){var le=+this.getAttribute("dy").slice(0,-2)-se+"em";this.setAttribute("dy",le)})}var Q=X.select(B).selectAll(".gtitle-subtitle");if(Q.node()){var me=pe.node().getBBox(),ie=me.y+me.height,Y=ie+o.SUBTITLE_PADDING_EM*D.subtitle.font.size;Q.attr({x:ye,y:Y,"text-anchor":q,dy:z(D.yanchor)}).call(k.positionText,ye,Y)}}}};function m(B,D,j,q,J){var oe=D.yref==="paper"?B._fullLayout._size.h:B._fullLayout.height,ye=S.isTopAnchor(D)?q:q-J,pe=j==="b"?oe-ye:ye;return S.isTopAnchor(D)&&j==="t"||S.isBottomAnchor(D)&&j==="b"?!1:pe.5?"t":"b",ye=B._fullLayout.margin[oe],pe=0;return D.yref==="paper"?pe=j+D.pad.t+D.pad.b:D.yref==="container"&&(pe=u(oe,q,J,B._fullLayout.height,j)+D.pad.t+D.pad.b),pe>ye?pe:0}function y(B,D,j,q){var J="title.automargin",oe=B._fullLayout.title,ye=oe.y>.5?"t":"b",pe={x:oe.x,y:oe.y,t:0,b:0},ge={};oe.yref==="paper"&&m(B,oe,ye,D,q)?pe[ye]=j:oe.yref==="container"&&(ge[ye]=j,B._fullLayout._reservedMargin[J]=ge),x.allowAutoMargin(B,J),x.autoMargin(B,J,pe)}function R(B,D){var j=B.title,q=B._size,J=0;switch(D===p?J=j.pad.l:D===l&&(J=-j.pad.r),j.xref){case"paper":return q.l+q.w*j.x+J;case"container":default:return B.width*j.x+J}}function L(B,D){var j=B.title,q=B._size,J=0;if(D==="0em"||!D?J=-j.pad.b:D===a.CAP_SHIFT+"em"&&(J=j.pad.t),j.y==="auto")return q.t/2;switch(j.yref){case"paper":return q.t+q.h-q.h*j.y+J;case"container":default:return B.height-B.height*j.y+J}}function z(B){return B==="top"?a.CAP_SHIFT+.3+"em":B==="bottom"?"-0.3em":a.MID_SHIFT+"em"}function N(B){var D=B.title,j=T;return S.isRightAnchor(D)?j=l:S.isLeftAnchor(D)&&(j=p),j}function U(B){var D=B.title,j="0em";return S.isTopAnchor(D)?j=a.CAP_SHIFT+"em":S.isMiddleAnchor(D)&&(j=a.MID_SHIFT+"em"),j}ee.doTraceStyle=function(B){var D=B.calcdata,j=[],q;for(q=0;q=0;N--){var U=E.append("path").attr(w).style("opacity",N?.1:m).call(k.stroke,d).call(k.fill,u).call(e.dashLine,N?"solid":R,N?4+y:y);if(s(U,p,g),L){var B=t(p.layout,"selections",g);U.style({cursor:"move"});var D={element:U.node(),plotinfo:b,gd:p,editHelpers:B,isActiveSelection:!0},j=h(_,p);x(j,U,D)}else U.style("pointer-events",N?"all":"none");z[N]=U}var q=z[0],J=z[1];J.node().addEventListener("click",function(){return f(p,q)})}}function s(p,T,l){var g=l.xref+l.yref;e.setClipUrl(p,"clip"+T._fullLayout._uid+g,T)}function f(p,T){if(i(p)){var l=T.node(),g=+l.getAttribute("data-index");if(g>=0){if(g===p._fullLayout._activeSelectionIndex){v(p);return}p._fullLayout._activeSelectionIndex=g,p._fullLayout._deactivateSelection=v,n(p)}}}function c(p){if(i(p)){var T=p._fullLayout.selections.length-1;p._fullLayout._activeSelectionIndex=T,p._fullLayout._deactivateSelection=v,n(p)}}function v(p){if(i(p)){var T=p._fullLayout._activeSelectionIndex;T>=0&&(S(p),delete p._fullLayout._activeSelectionIndex,n(p))}}}}),uM=_e({"node_modules/polybooljs/lib/build-log.js"(ee,X){function h(){var x,S=0,k=!1;function e(t,r){return x.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),x}return x={list:[],segmentId:function(){return 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===k?x:(k=t,e("vert",{x:t}))},log:function(t){return typeof t!="string"&&(t=JSON.stringify(t,!1," ")),e("log",{txt:t})},reset:function(){return e("reset")},selected:function(t){return e("selected",{segs:t})},chainStart:function(t){return e("chain_start",{seg:t})},chainRemoveHead:function(t,r){return e("chain_rem_head",{index:t,pt:r})},chainRemoveTail:function(t,r){return e("chain_rem_tail",{index:t,pt:r})},chainNew:function(t,r){return e("chain_new",{pt1:t,pt2:r})},chainMatch:function(t){return e("chain_match",{index:t})},chainClose:function(t){return e("chain_close",{index:t})},chainAddHead:function(t,r){return e("chain_add_head",{index:t,pt:r})},chainAddTail:function(t,r){return e("chain_add_tail",{index:t,pt:r})},chainConnect:function(t,r){return e("chain_con",{index1:t,index2:r})},chainReverse:function(t){return e("chain_rev",{index:t})},chainJoin:function(t,r){return e("chain_join",{index1:t,index2:r})},done:function(){return e("done")}},x}X.exports=h}}),cM=_e({"node_modules/polybooljs/lib/epsilon.js"(ee,X){function h(x){typeof x!="number"&&(x=1e-10);var S={epsilon:function(k){return typeof k=="number"&&(x=k),x},pointAboveOrOnLine:function(k,e,t){var r=e[0],o=e[1],n=t[0],i=t[1],a=k[0],s=k[1];return(n-r)*(s-o)-(i-o)*(a-r)>=-x},pointBetween:function(k,e,t){var r=k[1]-e[1],o=t[0]-e[0],n=k[0]-e[0],i=t[1]-e[1],a=n*o+r*i;if(a-x)},pointsSameX:function(k,e){return Math.abs(k[0]-e[0])x!=n-r>x&&(o-s)*(r-f)/(n-f)+s-t>x&&(i=!i),o=s,n=f}return i}};return S}X.exports=h}}),fM=_e({"node_modules/polybooljs/lib/linked-list.js"(ee,X){var h={create:function(){var x={root:{root:!0,next:null},exists:function(S){return!(S===null||S===x.root)},isEmpty:function(){return x.root.next===null},getHead:function(){return x.root.next},insertBefore:function(S,k){for(var e=x.root,t=x.root.next;t!==null;){if(k(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 k=x.root,e=x.root.next;e!==null&&!S(e);)k=e,e=e.next;return{before:k===x.root?null:k,after:e,insert:function(t){return t.prev=k,t.next=e,k.next=t,e!==null&&(e.prev=t),t}}}};return x},node:function(x){return x.prev=null,x.next=null,x.remove=function(){x.prev.next=x.next,x.next&&(x.next.prev=x.prev),x.prev=null,x.next=null},x}};X.exports=h}}),hM=_e({"node_modules/polybooljs/lib/intersecter.js"(ee,X){var h=fM();function x(S,k,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,b,A,E){var _=k.pointsCompare(l,A);return _!==0?_:k.pointsSame(g,E)?0:T!==b?T?1:-1:k.pointAboveOrOnLine(g,b?A:E,b?E:A)?1:-1}function i(T,l){o.insertBefore(T,function(g){var b=n(T.isStart,T.pt,l,g.isStart,g.pt,g.other.pt);return b<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 b=h.node({isStart:!1,pt:l.end,seg:l,primary:g,other:T,status:null});T.other=b,i(b,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 v(T,l){var g=r(l,T.seg.end,T.seg);return c(T,l),f(g,T.primary)}function p(T,l){var g=h.create();function b(U,B){var D=U.seg.start,j=U.seg.end,q=B.seg.start,J=B.seg.end;return k.pointsCollinear(D,q,J)?k.pointsCollinear(j,q,J)||k.pointAboveOrOnLine(j,q,J)?1:-1:k.pointAboveOrOnLine(D,q,J)?1:-1}function A(U){return g.findTransition(function(B){var D=b(U,B.ev);return D>0})}function E(U,B){var D=U.seg,j=B.seg,q=D.start,J=D.end,oe=j.start,ye=j.end;e&&e.checkIntersection(D,j);var pe=k.linesIntersect(q,J,oe,ye);if(pe===!1){if(!k.pointsCollinear(q,J,oe)||k.pointsSame(q,ye)||k.pointsSame(J,oe))return!1;var ge=k.pointsSame(q,oe),W=k.pointsSame(J,ye);if(ge&&W)return B;var ae=!ge&&k.pointBetween(q,oe,ye),se=!W&&k.pointBetween(J,oe,ye);if(ge)return se?v(B,J):v(U,ye),B;ae&&(W||(se?v(B,J):v(U,ye)),v(B,q))}else pe.alongA===0&&(pe.alongB===-1?v(U,oe):pe.alongB===0?v(U,pe.pt):pe.alongB===1&&v(U,ye)),pe.alongB===0&&(pe.alongA===-1?v(B,q):pe.alongA===0?v(B,pe.pt):pe.alongA===1&&v(B,J));return!1}for(var _=[];!o.isEmpty();){var w=o.getHead();if(e&&e.vert(w.pt[0]),w.isStart){let U=function(){if(u){var B=E(w,u);if(B)return B}return d?E(w,d):!1};e&&e.segmentNew(w.seg,w.primary);var m=A(w),u=m.before?m.before.ev:null,d=m.after?m.after.ev:null;e&&e.tempStatus(w.seg,u?u.seg:!1,d?d.seg:!1);var y=U();if(y){if(S){var R;w.seg.myFill.below===null?R=!0:R=w.seg.myFill.above!==w.seg.myFill.below,R&&(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 R;w.seg.myFill.below===null?R=!0:R=w.seg.myFill.above!==w.seg.myFill.below,d?w.seg.myFill.below=d.seg.myFill.above:w.seg.myFill.below=T,R?w.seg.myFill.above=!w.seg.myFill.below:w.seg.myFill.above=w.seg.myFill.below}else if(w.seg.otherFill===null){var L;d?w.primary===d.primary?L=d.seg.otherFill.above:L=d.seg.myFill.above:L=w.primary?l:T,w.seg.otherFill={above:L,below:L}}e&&e.status(w.seg,u?u.seg:!1,d?d.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)&&E(z.prev.ev,z.next.ev),e&&e.statusRemove(z.ev.seg),z.remove(),!w.primary){var N=w.seg.myFill;w.seg.myFill=w.seg.otherFill,w.seg.otherFill=N}_.push(w.seg)}o.getHead().remove()}return e&&e.done(),_}return S?{addRegion:function(T){for(var l,g=T[T.length-1],b=0;br!=v>r&&t<(c-s)*(r-f)/(v-f)+s;p&&(o=!o)}return o}}}),Ey=_e({"src/lib/polygon.js"(ee,X){var h=iv().dot,x=qn().BADNUM,S=X.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===x||Ai||g&&f(l))}function v(l,g){var b=l[0],A=l[1];if(b===x||bo||A===x||Ai)return!1;var E=t.length,_=t[0][0],w=t[0][1],m=0,u,d,y,R,L;for(u=1;uMath.max(d,_)||A>Math.max(y,w)))if(Aa||Math.abs(h(v,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 v=c+1;v1){var a=e.pop();i(a)}return{addPt:i,raw:e,filtered:r}}}}),yM=_e({"src/components/selections/constants.js"(ee,X){X.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),_M=_e({"src/components/selections/select.js"(ee,X){var h=mM(),x=gM(),S=bi(),k=ri().dashStyle,e=so(),t=zf(),r=rc().makeEventData,o=Fp(),n=o.freeMode,i=o.rectMode,a=o.drawMode,s=o.openMode,f=o.selectMode,c=x0(),v=Sy(),p=A_(),T=gp().clearOutline,l=b0(),g=l.handleEllipse,b=l.readPaths,A=T_().newShapes,E=Cw(),_=zw().activateLastSelection,w=kn(),m=w.sorterAsc,u=Ey(),d=tf(),y=cf().getFromId,R=Ay(),L=My().redrawReglTraces,z=yM(),N=z.MINSELECT,U=u.filter,B=u.tester,D=w_(),j=D.p2r,q=D.axValue,J=D.getTransform;function oe(Qe){return Qe.subplot!==void 0}function ye(Qe,ct,Ue,Ie,Pe){var Be=!oe(Ie),at=n(Pe),ft=i(Pe),Bt=s(Pe),Nt=a(Pe),Ht=f(Pe),or=Pe==="drawline",Cr=Pe==="drawcircle",Sr=or||Cr,Tr=Ie.gd,Yr=Tr._fullLayout,Fn=Ht&&Yr.newselection.mode==="immediate"&&Be,ua=Yr._zoomlayer,ta=Ie.element.getBoundingClientRect(),va=Ie.plotinfo,ma=J(va),Jn=ct-ta.left,ja=Ue-ta.top;Yr._calcInverseTransform(Tr);var ti=w.apply3DTransform(Yr._invTransform)(Jn,ja);Jn=ti[0],ja=ti[1];var gr=Yr._invScaleX,Kt=Yr._invScaleY,vr=Jn,_r=ja,rn="M"+Jn+","+ja,gn=Ie.xaxes[0],Mn=Ie.yaxes[0],In=gn._length,fa=Mn._length,Ca=Qe.altKey&&!(a(Pe)&&Bt),Ma,Da,Va,na,Mi,Oi,Vt;Q(Qe,Tr,Ie),at&&(Ma=U([[Jn,ja]],z.BENDPX));var Ct=ua.selectAll("path.select-outline-"+va.id).data([1]),Br=Nt?Yr.newshape:Yr.newselection;Nt&&(Ie.hasText=Br.label.text||Br.label.texttemplate);var Kr=Nt&&!Bt?Br.fillcolor:"rgba(0,0,0,0)",Qr=Br.line.color||(Be?e.contrast(Tr._fullLayout.plot_bgcolor):"#7f7f7f");Ct.enter().append("path").attr("class","select-outline select-outline-"+va.id).style({opacity:Nt?Br.opacity/2:1,"stroke-dasharray":k(Br.line.dash,Br.line.width),"stroke-width":Br.line.width+"px","shape-rendering":"crispEdges"}).call(e.stroke,Qr).call(e.fill,Kr).attr("fill-rule","evenodd").classed("cursor-move",!!Nt).attr("transform",ma).attr("d",rn+"Z");var Gr=ua.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",ma).attr("d","M0,0Z");if(Nt&&Ie.hasText){var Jr=ua.select(".label-temp");Jr.empty()&&(Jr=ua.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var yn=Yr._uid+z.SELECTID,cn=[],Dt=ue(Tr,Ie.xaxes,Ie.yaxes,Ie.subplot);Fn&&!Qe.shiftKey&&(Ie._clearSubplotSelections=function(){if(Be){var Hr=gn._id,_n=Mn._id;wt(Tr,Hr,_n,Dt);for(var Hn=(Tr.layout||{}).selections||[],ea=[],Qn=!1,bn=0;bn=0){Tr._fullLayout._deactivateShape(Tr);return}if(!Nt){var Hn=Yr.clickmode;d.done(yn).then(function(){if(d.clear(yn),Hr===2){for(Ct.remove(),Mi=0;Mi-1&&pe(_n,Tr,Ie.xaxes,Ie.yaxes,Ie.subplot,Ie,Ct),Hn==="event"&&Xr(Tr,void 0);t.click(Tr,_n,va.id)}).catch(w.error)}},Ie.doneFn=function(){Gr.remove(),d.done(yn).then(function(){d.clear(yn),!Fn&&na&&Ie.selectionDefs&&(na.subtract=Ca,Ie.selectionDefs.push(na),Ie.mergedPolygons.length=0,[].push.apply(Ie.mergedPolygons,Va)),(Fn||Nt)&&Y(Ie,Fn),Ie.doneFnCompleted&&Ie.doneFnCompleted(cn),Ht&&Xr(Tr,Vt)}).catch(w.error)}}function pe(Qe,ct,Ue,Ie,Pe,Be,at){var ft=ct._hoverdata,Bt=ct._fullLayout,Nt=Bt.clickmode,Ht=Nt.indexOf("event")>-1,or=[],Cr,Sr,Tr,Yr,Fn,ua,ta,va,ma,Jn;if(Fe(ft)){Q(Qe,ct,Be),Cr=ue(ct,Ue,Ie,Pe);var ja=Ve(ft,Cr),ti=ja.pointNumbers.length>0;if(ti?We(Cr,ja):it(Cr)&&(ta=Xe(ja))){for(at&&at.remove(),Jn=0;Jn=0}function ie(Qe){return Qe._fullLayout._activeSelectionIndex>=0}function Y(Qe,ct){var Ue=Qe.dragmode,Ie=Qe.plotinfo,Pe=Qe.gd;me(Pe)&&Pe._fullLayout._deactivateShape(Pe),ie(Pe)&&Pe._fullLayout._deactivateSelection(Pe);var Be=Pe._fullLayout,at=Be._zoomlayer,ft=a(Ue),Bt=f(Ue);if(ft||Bt){var Nt=at.selectAll(".select-outline-"+Ie.id);if(Nt&&Pe._fullLayout._outlining){var Ht;ft&&(Ht=A(Nt,Qe)),Ht&&S.call("_guiRelayout",Pe,{shapes:Ht});var or;Bt&&!oe(Qe)&&(or=E(Nt,Qe)),or&&(Pe._fullLayout._noEmitSelectedAtStart=!0,S.call("_guiRelayout",Pe,{selections:or}).then(function(){ct&&_(Pe)})),Pe._fullLayout._outlining=!1}}Ie.selection={},Ie.selection.selectionDefs=Qe.selectionDefs=[],Ie.selection.mergedPolygons=Qe.mergedPolygons=[]}function le(Qe){return Qe._id}function ue(Qe,ct,Ue,Ie){if(!Qe.calcdata)return[];var Pe=[],Be=ct.map(le),at=Ue.map(le),ft,Bt,Nt;for(Nt=0;Nt0,Be=Pe?Ie[0]:Ue;return ct.selectedpoints?ct.selectedpoints.indexOf(Be)>-1:!1}function We(Qe,ct){var Ue=[],Ie,Pe,Be,at;for(at=0;at0&&Ue.push(Ie);if(Ue.length===1&&(Be=Ue[0]===ct.searchInfo,Be&&(Pe=ct.searchInfo.cd[0].trace,Pe.selectedpoints.length===ct.pointNumbers.length))){for(at=0;at1||(ct+=Ie.selectedpoints.length,ct>1)))return!1;return ct===1}function yt(Qe,ct,Ue){var Ie;for(Ie=0;Ie-1&&ct;if(!at&&ct){var Hr=$t(Qe,!0);if(Hr.length){var _n=Hr[0].xref,Hn=Hr[0].yref;if(_n&&Hn){var ea=dr(Hr),Qn=Fr([y(Qe,_n,"x"),y(Qe,Hn,"y")]);Qn(cn,ea)}}Qe._fullLayout._noEmitSelectedAtStart?Qe._fullLayout._noEmitSelectedAtStart=!1:yr&&Xr(Qe,cn),Cr._reselect=!1}if(!at&&Cr._deselect){var bn=Cr._deselect;ft=bn.xref,Bt=bn.yref,_t(ft,Bt,Ht)||wt(Qe,ft,Bt,Ie),yr&&(cn.points.length?Xr(Qe,cn):Ot(Qe)),Cr._deselect=!1}return{eventData:cn,selectionTesters:Ue}}function Ke(Qe){var ct=Qe.calcdata;if(ct)for(var Ue=0;Ue=0){Kr._fullLayout._deactivateShape(Kr);return}var Qr=Kr._fullLayout.clickmode;if(ae(Kr),Ct===2&&!qe&&Da(),ht)Qr.indexOf("select")>-1&&m(Br,Kr,wt,vt,Fe.id,Ht),Qr.indexOf("event")>-1&&a.click(Kr,Br,Fe.id);else if(Ct===1&&qe){var Gr=yt?Ae:ze,Jr=yt==="s"||bt==="w"?0:1,yn=Gr._name+".range["+Jr+"]",cn=D(Gr,Jr),Dt="left",yr="middle";if(Gr.fixedrange)return;yt?(yr=yt==="n"?"top":"bottom",Gr.side==="right"&&(Dt="right")):bt==="e"&&(Dt="right"),Kr._context.showAxisRangeEntryBoxes&&h.select(Nt).call(o.makeEditable,{gd:Kr,immediate:!0,background:Kr._fullLayout.paper_bgcolor,text:String(cn),fill:Gr.tickfont?Gr.tickfont.color:"#444",horizontalAlign:Dt,verticalAlign:yr}).on("edit",function(Hr){var _n=Gr.d2r(Hr);_n!==void 0&&t.call("_guiRelayout",Kr,yn,_n)})}}c.init(Ht);var Sr,Tr,Yr,Fn,ua,ta,va,ma,Jn,ja;function ti(Ct,Br,Kr){var Qr=Nt.getBoundingClientRect();Sr=Br-Qr.left,Tr=Kr-Qr.top,Te._fullLayout._calcInverseTransform(Te);var Gr=x.apply3DTransform(Te._fullLayout._invTransform)(Sr,Tr);Sr=Gr[0],Tr=Gr[1],Yr={l:Sr,r:Sr,w:0,t:Tr,b:Tr,h:0},Fn=Te._hmpixcount?Te._hmlumcount/Te._hmpixcount:k(Te._fullLayout.plot_bgcolor).getLuminance(),ua="M0,0H"+lr+"V"+dr+"H0V0",ta=!1,va="xy",ja=!1,ma=ye(mt,Fn,$t,Yt,ua),Jn=pe(mt,$t,Yt)}function gr(Ct,Br){if(Te._transitioningWithDuration)return!1;var Kr=Math.max(0,Math.min(lr,Be*Ct+Sr)),Qr=Math.max(0,Math.min(dr,at*Br+Tr)),Gr=Math.abs(Kr-Sr),Jr=Math.abs(Qr-Tr);Yr.l=Math.min(Sr,Kr),Yr.r=Math.max(Sr,Kr),Yr.t=Math.min(Tr,Qr),Yr.b=Math.max(Tr,Qr);function yn(){va="",Yr.r=Yr.l,Yr.t=Yr.b,Jn.attr("d","M0,0Z")}if(Nr.isSubplotConstrained)Gr>R||Jr>R?(va="xy",Gr/lr>Jr/dr?(Jr=Gr*dr/lr,Tr>Qr?Yr.t=Tr-Jr:Yr.b=Tr+Jr):(Gr=Jr*lr/dr,Sr>Kr?Yr.l=Sr-Gr:Yr.r=Sr+Gr),Jn.attr("d",ie(Yr))):yn();else if(Fr.isSubplotConstrained)if(Gr>R||Jr>R){va="xy";var cn=Math.min(Yr.l/lr,(dr-Yr.b)/dr),Dt=Math.max(Yr.r/lr,(dr-Yr.t)/dr);Yr.l=cn*lr,Yr.r=Dt*lr,Yr.b=(1-cn)*dr,Yr.t=(1-Dt)*dr,Jn.attr("d",ie(Yr))}else yn();else!zr||Jr0){var Hr;if(Fr.isSubplotConstrained||!ln&&zr.length===1){for(Hr=0;Hr1&&(yn.maxallowed!==void 0&&Ot===(yn.range[0]1&&(cn.maxallowed!==void 0&&Qe===(cn.range[0]=0?Math.min(Te,.9):1/(1/Math.max(Te,-.3)+3.222))}function oe(Te,Fe,Ve){return Te?Te==="nsew"?Ve?"":Fe==="pan"?"move":"crosshair":Te.toLowerCase()+"-resize":"pointer"}function ye(Te,Fe,Ve,Xe,We){return Te.append("path").attr("class","zoombox").style({fill:Fe>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Ve,Xe)).attr("d",We+"Z")}function pe(Te,Fe,Ve){return Te.append("path").attr("class","zoombox-corners").style({fill:n.background,stroke:n.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(Fe,Ve)).attr("d","M0,0Z")}function ge(Te,Fe,Ve,Xe,We,it){Te.attr("d",Xe+"M"+Ve.l+","+Ve.t+"v"+Ve.h+"h"+Ve.w+"v-"+Ve.h+"h-"+Ve.w+"Z"),W(Te,Fe,We,it)}function W(Te,Fe,Ve,Xe){Ve||(Te.transition().style("fill",Xe>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),Fe.transition().style("opacity",1).duration(200))}function ae(Te){h.select(Te).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function se(Te){L&&Te.data&&Te._context.showTips&&(x.notifier(x._(Te,"Double-click to zoom back out"),"long"),L=!1)}function Q(Te,Fe){return"M"+(Te.l-.5)+","+(Fe-R-.5)+"h-3v"+(2*R+1)+"h3ZM"+(Te.r+.5)+","+(Fe-R-.5)+"h3v"+(2*R+1)+"h-3Z"}function me(Te,Fe){return"M"+(Fe-R-.5)+","+(Te.t-.5)+"v-3h"+(2*R+1)+"v3ZM"+(Fe-R-.5)+","+(Te.b+.5)+"v3h"+(2*R+1)+"v-3Z"}function ie(Te){var Fe=Math.floor(Math.min(Te.b-Te.t,Te.r-Te.l,R)/2);return"M"+(Te.l-3.5)+","+(Te.t-.5+Fe)+"h3v"+-Fe+"h"+Fe+"v-3h-"+(Fe+3)+"ZM"+(Te.r+3.5)+","+(Te.t-.5+Fe)+"h-3v"+-Fe+"h"+-Fe+"v-3h"+(Fe+3)+"ZM"+(Te.r+3.5)+","+(Te.b+.5-Fe)+"h-3v"+Fe+"h"+-Fe+"v3h"+(Fe+3)+"ZM"+(Te.l-3.5)+","+(Te.b+.5-Fe)+"h3v"+Fe+"h"+Fe+"v3h-"+(Fe+3)+"Z"}function Y(Te,Fe,Ve,Xe,We){for(var it=!1,yt={},bt={},mt,ht,qe,ze,Ae=(We||{}).xaHash,Ke=(We||{}).yaHash,_t=0;_t1&&x.warn("Full array edits are incompatible with other edits",f);var b=i[""][""];if(t(b))n.set(null);else if(Array.isArray(b))n.set(b);else return x.warn("Unrecognized full array edit value",f,b),!0;return T?!1:(c(l,g),v(o),!0)}var A=Object.keys(i).map(Number).sort(S),E=n.get(),_=E||[],w=s(g,f).get(),m=[],u=-1,d=_.length,y,R,L,z,N,U,B,D;for(y=0;y_.length-(B?0:1)){x.warn("index out of range",f,L);continue}if(U!==void 0)N.length>1&&x.warn("Insertion & removal are incompatible with edits to the same index.",f,L),t(U)?m.push(L):B?(U==="add"&&(U={}),_.splice(L,0,U),w&&w.splice(L,0,{})):x.warn("Unrecognized full object edit value",f,L,U),u===-1&&(u=L);else for(R=0;R=0;y--)_.splice(m[y],1),w&&w.splice(m[y],1);if(_.length?E||n.set(_):n.set(null),T)return!1;if(c(l,g),p!==h){var j;if(u===-1)j=A;else{for(d=Math.max(_.length,d),j=[],y=0;y=u));y++)j.push(L);for(y=u;y0&&x.log("Clearing previous rejected promises from queue."),l._promises=[]},ee.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 b=(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&&ee.cleanLayout(l.template.layout),l};function i(l,g){var b=l[g],A=g.charAt(0);b&&b!=="paper"&&(l[g]=t(b,A,!0))}ee.cleanData=function(l){for(var g=0;g0)return l.slice(0,g)}ee.hasParent=function(l,g){for(var b=p(g);b;){if(b in l)return!0;b=p(b)}return!1},ee.clearAxisTypes=function(l,g,b){for(var A=0;A{const b=(...A)=>A.every(E=>x.isPlainObject(E))||A.every(E=>Array.isArray(E));if([l,g].every(A=>Array.isArray(A))){if(l.length!==g.length)return!1;for(let A=0;Ax.isPlainObject(A))){if(Object.keys(l).length!==Object.keys(g).length)return!1;for(const A in l){if(A.startsWith("_"))continue;const E=l[A],_=g[A];if(E!==_&&!(b(E,_)?T(E,_):!1))return!1}return!0}return!1};ee.collectionsAreEqual=T}}),M_=_e({"src/plot_api/plot_api.js"(ee){var X=mr(),h=jn(),x=y0(),S=kn(),k=S.nestedProperty,e=Lv(),t=xy(),r=bi(),o=Iv(),n=Fs(),i=xs(),a=xw(),s=Ih(),f=ri(),c=so(),v=Uw().initInteractions,p=Ol(),T=th().clearOutline,l=bd().dfltConfig,g=TM(),b=AM(),A=My(),E=nc(),_=Sh().AX_NAME_PATTERN,w=0,m=5;function u(Ue,Ie,Pe,Be){var at;if(Ue=S.getGraphDiv(Ue),e.init(Ue),S.isPlainObject(Ie)){var ft=Ie;Ie=ft.data,Pe=ft.layout,Be=ft.config,at=ft.frames}var Bt=e.triggerHandler(Ue,"plotly_beforeplot",[Ie,Pe,Be]);if(Bt===!1)return Promise.reject();!Ie&&!Pe&&!S.isPlotDiv(Ue)&&S.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",Ue);function Nt(){if(at)return ee.addFrames(Ue,at)}z(Ue,Be),Pe||(Pe={}),X.select(Ue).classed("js-plotly-plot",!0),f.makeTester(),Array.isArray(Ue._promises)||(Ue._promises=[]);var Ht=(Ue.data||[]).length===0&&Array.isArray(Ie);Array.isArray(Ie)&&(b.cleanData(Ie),Ht?Ue.data=Ie:Ue.data.push.apply(Ue.data,Ie),Ue.empty=!1),(!Ue.layout||Ht)&&(Ue.layout=b.cleanLayout(Pe)),n.supplyDefaults(Ue);var or=Ue._fullLayout,Cr=or._has("cartesian");or._replotting=!0,(Ht||or._shouldCreateBgLayer)&&(ct(Ue),or._shouldCreateBgLayer&&delete or._shouldCreateBgLayer),f.initGradients(Ue),f.initPatterns(Ue),Ht&&i.saveShowSpikeInitial(Ue);var Sr=!Ue.calcdata||Ue.calcdata.length!==(Ue._fullData||[]).length;Sr&&n.doCalcdata(Ue);for(var Tr=0;Tr=Ue.data.length||at<-Ue.data.length)throw new Error(Pe+" must be valid indices for gd.data.");if(Ie.indexOf(at,Be+1)>-1||at>=0&&Ie.indexOf(-Ue.data.length+at)>-1||at<0&&Ie.indexOf(Ue.data.length+at)>-1)throw new Error("each index in "+Pe+" must be unique.")}}function j(Ue,Ie,Pe){if(!Array.isArray(Ue.data))throw new Error("gd.data must be an array.");if(typeof Ie>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(Ie)||(Ie=[Ie]),D(Ue,Ie,"currentIndices"),typeof Pe<"u"&&!Array.isArray(Pe)&&(Pe=[Pe]),typeof Pe<"u"&&D(Ue,Pe,"newIndices"),typeof Pe<"u"&&Ie.length!==Pe.length)throw new Error("current and new indices must be of equal length.")}function q(Ue,Ie,Pe){var Be,at;if(!Array.isArray(Ue.data))throw new Error("gd.data must be an array.");if(typeof Ie>"u")throw new Error("traces must be defined.");for(Array.isArray(Ie)||(Ie=[Ie]),Be=0;Be"u")throw new Error("indices must be an integer or array of integers");D(Ue,Pe,"indices");for(var ft in Ie){if(!Array.isArray(Ie[ft])||Ie[ft].length!==Pe.length)throw new Error("attribute "+ft+" must be an array of length equal to indices array length");if(at&&(!(ft in Be)||!Array.isArray(Be[ft])||Be[ft].length!==Ie[ft].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 oe(Ue,Ie,Pe,Be){var at=S.isPlainObject(Be),ft=[],Bt,Nt,Ht,or,Cr;Array.isArray(Pe)||(Pe=[Pe]),Pe=B(Pe,Ue.data.length-1);for(var Sr in Ie)for(var Tr=0;Tr=0&&Cr=0&&Cr"u")return or=ee.redraw(Ue),t.add(Ue,at,Bt,ft,Nt),or;Array.isArray(Pe)||(Pe=[Pe]);try{j(Ue,Be,Pe)}catch(Cr){throw Ue.data.splice(Ue.data.length-Ie.length,Ie.length),Cr}return t.startSequence(Ue),t.add(Ue,at,Bt,ft,Nt),or=ee.moveTraces(Ue,Be,Pe),t.stopSequence(Ue),or}function se(Ue,Ie){Ue=S.getGraphDiv(Ue);var Pe=[],Be=ee.addTraces,at=se,ft=[Ue,Pe,Ie],Bt=[Ue,Ie],Nt,Ht;if(typeof Ie>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(Ie)||(Ie=[Ie]),D(Ue,Ie,"indices"),Ie=B(Ie,Ue.data.length-1),Ie.sort(S.sorterDes),Nt=0;Nt"u")for(Pe=[],or=0;or0&&typeof vr.parts[gn]!="string";)gn--;var Mn=vr.parts[gn],In=vr.parts[gn-1]+"."+Mn,fa=vr.parts.slice(0,gn).join("."),Ca=k(Ue.layout,fa).get(),Ma=k(Be,fa).get(),Da=vr.get();if(_r!==void 0){va[Kt]=_r,ma[Kt]=Mn==="reverse"?_r:ie(Da);var Va=o.getLayoutValObject(Be,vr.parts);if(Va&&Va.impliedEdits&&_r!==null)for(var na in Va.impliedEdits)Jn(S.relativeAttr(Kt,na),Va.impliedEdits[na]);if(["width","height"].indexOf(Kt)!==-1)if(_r){Jn("autosize",null);var Mi=Kt==="height"?"width":"height";Jn(Mi,Be[Mi])}else Be[Kt]=Ue._initialAutoSize[Kt];else if(Kt==="autosize")Jn("width",_r?null:Be.width),Jn("height",_r?null:Be.height);else if(In.match(We))gr(In),k(Be,fa+"._inputRange").set(null);else if(In.match(it)){gr(In),k(Be,fa+"._inputRange").set(null);var Oi=k(Be,fa).get();Oi._inputDomain&&(Oi._input.domain=Oi._inputDomain.slice())}else In.match(yt)&&k(Be,fa+"._inputDomain").set(null);if(Mn==="type"){ti=Ca;var Vt=Ma.type==="linear"&&_r==="log",Ct=Ma.type==="log"&&_r==="linear";if(Vt||Ct){if(!ti||!ti.range)Jn(fa+".autorange",!0);else if(Ma.autorange)Vt&&(ti.range=ti.range[1]>ti.range[0]?[1,2]:[2,1]);else{var Br=ti.range[0],Kr=ti.range[1];Vt?(Br<=0&&Kr<=0&&Jn(fa+".autorange",!0),Br<=0?Br=Kr/1e6:Kr<=0&&(Kr=Br/1e6),Jn(fa+".range[0]",Math.log(Br)/Math.LN10),Jn(fa+".range[1]",Math.log(Kr)/Math.LN10)):(Jn(fa+".range[0]",Math.pow(10,Br)),Jn(fa+".range[1]",Math.pow(10,Kr)))}Array.isArray(Be._subplots.polar)&&Be._subplots.polar.length&&Be[vr.parts[0]]&&vr.parts[1]==="radialaxis"&&delete Be[vr.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(Ue,Ma,_r,Jn),r.getComponentMethod("images","convertCoords")(Ue,Ma,_r,Jn)}else Jn(fa+".autorange",!0),Jn(fa+".range",null);k(Be,fa+"._inputRange").set(null)}else if(Mn.match(_)){var Qr=k(Be,Kt).get(),Gr=(_r||{}).type;(!Gr||Gr==="-")&&(Gr="linear"),r.getComponentMethod("annotations","convertCoords")(Ue,Qr,Gr,Jn),r.getComponentMethod("images","convertCoords")(Ue,Qr,Gr,Jn)}var Jr=g.containerArrayMatch(Kt);if(Jr){Cr=Jr.array,Sr=Jr.index;var yn=Jr.property,cn=Va||{editType:"calc"};Sr!==""&&yn===""&&(g.isAddVal(_r)?ma[Kt]=null:g.isRemoveVal(_r)?ma[Kt]=(k(Pe,Cr).get()||[])[Sr]:S.warn("unrecognized full object value",Ie)),E.update(ta,cn),or[Cr]||(or[Cr]={});var Dt=or[Cr][Sr];Dt||(Dt=or[Cr][Sr]={}),Dt[yn]=_r,delete Ie[Kt]}else Mn==="reverse"?(Ca.range?Ca.range.reverse():(Jn(fa+".autorange",!0),Ca.range=[1,0]),Ma.autorange?ta.calc=!0:ta.plot=!0):(Kt==="dragmode"&&(_r===!1&&Da!==!1||_r!==!1&&Da===!1)||Be._has("scatter-like")&&Be._has("regl")&&Kt==="dragmode"&&(_r==="lasso"||_r==="select")&&!(Da==="lasso"||Da==="select")?ta.plot=!0:Va?E.update(ta,Va):ta.calc=!0,vr.set(_r))}}for(Cr in or){var yr=g.applyContainerArrayChanges(Ue,ft(Pe,Cr),or[Cr],ta,ft);yr||(ta.plot=!0)}for(var Hr in ja){ti=i.getFromId(Ue,Hr);var _n=ti&&ti._constraintGroup;if(_n){ta.calc=!0;for(var Hn in _n)ja[Hn]||(i.getFromId(Ue,Hn)._constraintShrinkable=!0)}}(mt(Ue)||Ie.height||Ie.width)&&(ta.plot=!0);var ea=Be.shapes;for(Sr=0;Sr1;)if(Be.pop(),Pe=k(Ie,Be.join(".")+".uirevision").get(),Pe!==void 0)return Pe;return Ie.uirevision}function wt(Ue,Ie){for(var Pe=0;Pe[fa,Ue._ev.listeners(fa)]);ft=ee.newPlot(Ue,Ie,Pe,Be).then(()=>{for(const[fa,Ca]of In)Ca.forEach(Ma=>Ue.on(fa,Ma));return ee.react(Ue,Ie,Pe,Be)})}else{Ue.data=Ie||[],b.cleanData(Ue.data),Ue.layout=Pe||{},b.cleanLayout(Ue.layout),Yt(Ue.data,Ue.layout,Nt,Ht),n.supplyDefaults(Ue,{skipUpdateCalc:!0});var Sr=Ue._fullData,Tr=Ue._fullLayout,Yr=Tr.datarevision===void 0,Fn=Tr.transition,ua=Nr(Ue,Ht,Tr,Yr,Fn),ta=ua.newDataRevision,va=dr(Ue,Nt,Sr,Yr,Fn,ta);if(mt(Ue)&&(ua.layoutReplot=!0),va.calc||ua.calc){Ue.calcdata=void 0;for(var ma=Object.getOwnPropertyNames(Tr),Jn=0;Jn(Cr||Ue.emit("plotly_react",{config:Be,data:Ie,layout:Pe}),Ue))}function dr(Ue,Ie,Pe,Be,at,ft){var Bt=Ie.length===Pe.length;if(!at&&!Bt)return{fullReplot:!0,calc:!0};var Nt=E.traceFlags();Nt.arrays={},Nt.nChanges=0,Nt.nChangesAnim=0;var Ht,or;function Cr(Yr){var Fn=o.getTraceValObject(or,Yr);return!or._module.animatable&&Fn.anim&&(Fn.anim=!1),Fn}var Sr={getValObject:Cr,flags:Nt,immutable:Be,transition:at,newDataRevision:ft,gd:Ue},Tr={};for(Ht=0;Ht=at.length?at[0]:at[or]:at}function Nt(or){return Array.isArray(ft)?or>=ft.length?ft[0]:ft[or]:ft}function Ht(or,Cr){var Sr=0;return function(){if(or&&++Sr===Cr)return or()}}return new Promise(function(or,Cr){function Sr(){if(Be._frameQueue.length!==0){for(;Be._frameQueue.length;){var Mn=Be._frameQueue.pop();Mn.onInterrupt&&Mn.onInterrupt()}Ue.emit("plotly_animationinterrupted",[])}}function Tr(Mn){if(Mn.length!==0){for(var In=0;InBe._timeToNext&&Fn()};Mn()}var ta=0;function va(Mn){return Array.isArray(at)?ta>=at.length?Mn.transitionOpts=at[ta]:Mn.transitionOpts=at[0]:Mn.transitionOpts=at,ta++,Mn}var ma,Jn,ja=[],ti=Ie==null,gr=Array.isArray(Ie),Kt=!ti&&!gr&&S.isPlainObject(Ie);if(Kt)ja.push({type:"object",data:va(S.extendFlat({},Ie))});else if(ti||["string","number"].indexOf(typeof Ie)!==-1)for(ma=0;ma0&&rnrn)&&gn.push(Jn);ja=gn}}ja.length>0?Tr(ja):(Ue.emit("plotly_animated"),or())})}function zr(Ue,Ie,Pe){if(Ue=S.getGraphDiv(Ue),Ie==null)return Promise.resolve();if(!S.isPlotDiv(Ue))throw new Error("This element is not a Plotly plot: "+Ue+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Be,at,ft,Bt,Nt=Ue._transitionData._frames,Ht=Ue._transitionData._frameHash;if(!Array.isArray(Ie))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+Ie);var or=Nt.length+Ie.length*2,Cr=[],Sr={};for(Be=Ie.length-1;Be>=0;Be--)if(S.isPlainObject(Ie[Be])){var Tr=Ie[Be].name,Yr=(Ht[Tr]||Sr[Tr]||{}).name,Fn=Ie[Be].name,ua=Ht[Yr]||Sr[Yr];Yr&&Fn&&typeof Fn=="number"&&ua&&wvr.index?-1:Kt.index=0;Be--){if(at=Cr[Be].frame,typeof at.name=="number"&&S.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!at.name)for(;Ht[at.name="frame "+Ue._transitionData._counter++];);if(Ht[at.name]){for(ft=0;ft=0;Pe--)Be=Ie[Pe],ft.push({type:"delete",index:Be}),Bt.unshift({type:"insert",index:Be,value:at[Be]});var Nt=n.modifyFrames,Ht=n.modifyFrames,or=[Ue,Bt],Cr=[Ue,ft];return t&&t.add(Ue,Nt,or,Ht,Cr),n.modifyFrames(Ue,ft)}function Ot(Ue){Ue=S.getGraphDiv(Ue);var Ie=Ue._fullLayout||{},Pe=Ue._fullData||[];return n.cleanPlot([],{},Pe,Ie),n.purge(Ue),e.purge(Ue),Ie._container&&Ie._container.remove(),delete Ue._context,Ue}function Qe(Ue){var Ie=Ue._fullLayout,Pe=Ue.getBoundingClientRect();if(!S.equalDomRects(Pe,Ie._lastBBox)){var Be=Ie._invTransform=S.inverseTransformMatrix(S.getFullTransformMatrix(Ue));Ie._invScaleX=Math.sqrt(Be[0][0]*Be[0][0]+Be[0][1]*Be[0][1]+Be[0][2]*Be[0][2]),Ie._invScaleY=Math.sqrt(Be[1][0]*Be[1][0]+Be[1][1]*Be[1][1]+Be[1][2]*Be[1][2]),Ie._lastBBox=Pe}}function ct(Ue){var Ie=X.select(Ue),Pe=Ue._fullLayout;if(Pe._calcInverseTransform=Qe,Pe._calcInverseTransform(Ue),Pe._container=Ie.selectAll(".plot-container").data([0]),Pe._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),Pe._paperdiv=Pe._container.selectAll(".svg-container").data([0]),Pe._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),Pe._glcontainer=Pe._paperdiv.selectAll(".gl-container").data([{}]),Pe._glcontainer.enter().append("div").classed("gl-container",!0),Pe._paperdiv.selectAll(".main-svg").remove(),Pe._paperdiv.select(".modebar-container").remove(),Pe._paper=Pe._paperdiv.insert("svg",":first-child").classed("main-svg",!0),Pe._toppaper=Pe._paperdiv.append("svg").classed("main-svg",!0),Pe._modebardiv=Pe._paperdiv.append("div"),delete Pe._modeBar,Pe._hoverpaper=Pe._paperdiv.append("svg").classed("main-svg",!0),!Pe._uid){var Be={};X.selectAll("defs").each(function(){this.id&&(Be[this.id.split("-")[1]]=1)}),Pe._uid=S.randstr(Be)}Pe._paperdiv.selectAll(".main-svg").attr(p.svgAttrs),Pe._defs=Pe._paper.append("defs").attr("id","defs-"+Pe._uid),Pe._clips=Pe._defs.append("g").classed("clips",!0),Pe._topdefs=Pe._toppaper.append("defs").attr("id","topdefs-"+Pe._uid),Pe._topclips=Pe._topdefs.append("g").classed("clips",!0),Pe._bgLayer=Pe._paper.append("g").classed("bglayer",!0),Pe._draggers=Pe._paper.append("g").classed("draglayer",!0);var at=Pe._paper.append("g").classed("layer-below",!0);Pe._imageLowerLayer=at.append("g").classed("imagelayer",!0),Pe._shapeLowerLayer=at.append("g").classed("shapelayer",!0),Pe._cartesianlayer=Pe._paper.append("g").classed("cartesianlayer",!0),Pe._polarlayer=Pe._paper.append("g").classed("polarlayer",!0),Pe._smithlayer=Pe._paper.append("g").classed("smithlayer",!0),Pe._ternarylayer=Pe._paper.append("g").classed("ternarylayer",!0),Pe._geolayer=Pe._paper.append("g").classed("geolayer",!0),Pe._funnelarealayer=Pe._paper.append("g").classed("funnelarealayer",!0),Pe._pielayer=Pe._paper.append("g").classed("pielayer",!0),Pe._iciclelayer=Pe._paper.append("g").classed("iciclelayer",!0),Pe._treemaplayer=Pe._paper.append("g").classed("treemaplayer",!0),Pe._sunburstlayer=Pe._paper.append("g").classed("sunburstlayer",!0),Pe._indicatorlayer=Pe._toppaper.append("g").classed("indicatorlayer",!0),Pe._glimages=Pe._paper.append("g").classed("glimages",!0);var ft=Pe._toppaper.append("g").classed("layer-above",!0);Pe._imageUpperLayer=ft.append("g").classed("imagelayer",!0),Pe._shapeUpperLayer=ft.append("g").classed("shapelayer",!0),Pe._selectionLayer=Pe._toppaper.append("g").classed("selectionlayer",!0),Pe._infolayer=Pe._toppaper.append("g").classed("infolayer",!0),Pe._menulayer=Pe._toppaper.append("g").classed("menulayer",!0),Pe._zoomlayer=Pe._toppaper.append("g").classed("zoomlayer",!0),Pe._hoverlayer=Pe._hoverpaper.append("g").classed("hoverlayer",!0),Pe._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),Ue.emit("plotly_framework")}ee.animate=ln,ee.addFrames=zr,ee.deleteFrames=Xr,ee.addTraces=ae,ee.deleteTraces=se,ee.extendTraces=ge,ee.moveTraces=Q,ee.prependTraces=W,ee.newPlot=U,ee._doPlot=u,ee.purge=Ot,ee.react=lr,ee.redraw=N,ee.relayout=Fe,ee.restyle=me,ee.setPlotConfig=y,ee.update=ht,ee._guiRelayout=qe(Fe),ee._guiRestyle=qe(me),ee._guiUpdate=qe(ht),ee._storeDirectGUIEdit=ue}}),Rv=_e({"src/snapshot/helpers.js"(ee){var X=bi();ee.getDelay=function(S){return S._has&&(S._has("gl3d")||S._has("mapbox")||S._has("map"))?500:0},ee.getRedrawFunc=function(S){return function(){X.getComponentMethod("colorbar","draw")(S)}},ee.encodeSVG=function(S){return"data:image/svg+xml,"+encodeURIComponent(S)},ee.encodeJSON=function(S){return"data:application/json,"+encodeURIComponent(S)};var h=window.URL||window.webkitURL;ee.createObjectURL=function(S){return h.createObjectURL(S)},ee.revokeObjectURL=function(S){return h.revokeObjectURL(S)},ee.createBlob=function(S,k){if(k==="svg")return new window.Blob([S],{type:"image/svg+xml;charset=utf-8"});if(k==="full-json")return new window.Blob([S],{type:"application/json;charset=utf-8"});var e=x(window.atob(S));return new window.Blob([e],{type:"image/"+k})},ee.octetStream=function(S){document.location.href="data:application/octet-stream"+S};function x(S){for(var k=S.length,e=new ArrayBuffer(k),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,"&")}X.exports=function(i,a,s){var f=i._fullLayout,c=f._paper,v=f._toppaper,p=f.width,T=f.height,l;c.insert("rect",":first-child").call(x.setRect,0,0,p,T).call(S.fill,f.paper_bgcolor);var g=f._basePlotModules||[];for(l=0;l1&&E.push(s("object","layout"))),x.supplyDefaults(_);for(var u=_._fullData,d=w.length,y=0;yR.length&&A.push(s("unused",E,d.concat(R.length)));var D=R.length,j=Array.isArray(B);j&&(D=Math.min(D,B.length));var q,J,oe,ye,pe;if(L.dimensions===2)for(J=0;JR[J].length&&A.push(s("unused",E,d.concat(J,R[J].length)));var ge=R[J].length;for(q=0;q<(j?Math.min(ge,B[J].length):ge);q++)oe=j?B[J][q]:B,ye=y[J][q],pe=R[J][q],h.validate(ye,oe)?pe!==ye&&pe!==+ye&&A.push(s("dynamic",E,d.concat(J,q),ye,pe)):A.push(s("value",E,d.concat(J,q),ye))}else A.push(s("array",E,d.concat(J),y[J]));else for(J=0;JN?A.push({code:"unused",traceType:y,templateCount:z,dataCount:N}):N>z&&A.push({code:"reused",traceType:y,templateCount:z,dataCount:N})}}function U(B,D){for(var j in B)if(j.charAt(0)!=="_"){var q=B[j],J=s(B,j,D);h(q)?(Array.isArray(B)&&q._template===!1&&q.templateitemname&&A.push({code:"missing",path:J,templateitemname:q.templateitemname}),U(q,J)):Array.isArray(q)&&f(q)&&U(q,J)}}if(U({data:_,layout:E},""),A.length)return A.map(c)};function f(v){for(var p=0;p=0;c--){var v=e[c];if(v.type==="scatter"&&v.xaxis===s.xaxis&&v.yaxis===s.yaxis){v.opacity=void 0;break}}}}}}}),LM=_e({"src/traces/scatter/layout_defaults.js"(ee,X){var h=kn(),x=rm();X.exports=function(S,k){function e(r,o){return h.coerce(S,k,x,r,o)}var t=k.barmode==="group";k.scattermode==="group"&&e("scattergap",t?k.bargap:.2)}}}),jp=_e({"src/plots/cartesian/align_period.js"(ee,X){var h=jn(),x=kn(),S=x.dateTime2ms,k=x.incrementMonth,e=qn(),t=e.ONEAVGMONTH;X.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 v=+f.substring(1);if(v>0&&Math.round(v)===v)c=v;else return{vals:a}}for(var p=n.calendar,T=s==="start",l=s==="end",g=o[i+"period0"],b=S(g,p)||0,A=[],E=[],_=[],w=a.length,m=0;mu;)R=k(R,-c,p);for(;R<=u;)R=k(R,c,p);y=k(R,-c,p)}else{for(d=Math.round((u-b)/f),R=b+d*f;R>u;)R-=f;for(;R<=u;)R+=f;y=R-f}A[m]=T?y:l?R:(y+R)/2,E[m]=y,_[m]=R}return{vals:A,starts:E,ends:_}}}}),xp=_e({"src/traces/scatter/colorscale_calc.js"(ee,X){var h=ed().hasColorscale,x=ko(),S=Ps();X.exports=function(e,t){S.hasLines(t)&&h(t,"line")&&x(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),S.hasMarkers(t)&&(h(t,"marker")&&x(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),h(t,"marker.line")&&x(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),lv=_e({"src/traces/scatter/arrays_to_calcdata.js"(ee,X){var h=kn();X.exports=function(S,k){for(var e=0;eU&&y[D].gap;)D--;for(q=y[D].s,B=y.length-1;B>D;B--)y[B].s=q;for(;Uj+B||!h(D))}for(var J=0;Jz[p]&&p0?e:t)/(p._m*g*(p._m>0?e:t)))),or*=1e3}if(Cr===S){if(l&&(Cr=p.c2p(Ht.y,!0)),Cr===S)return!1;Cr*=1e3}return[or,Cr]}function le(Nt,Ht,or,Cr){var Sr=or-Nt,Tr=Cr-Ht,Yr=.5-Nt,Fn=.5-Ht,ua=Sr*Sr+Tr*Tr,ta=Sr*Yr+Tr*Fn;if(ta>0&&ta1||Math.abs(Yr.y-or[0][1])>1)&&(Yr=[Yr.x,Yr.y],Cr&&Ve(Yr,Nt)it||Nt[1]bt)return[n(Nt[0],We,it),n(Nt[1],yt,bt)]}function $t(Nt,Ht){if(Nt[0]===Ht[0]&&(Nt[0]===We||Nt[0]===it)||Nt[1]===Ht[1]&&(Nt[1]===yt||Nt[1]===bt))return!0}function Yt(Nt,Ht){var or=[],Cr=vt(Nt),Sr=vt(Ht);return Cr&&Sr&&$t(Cr,Sr)||(Cr&&or.push(Cr),Sr&&or.push(Sr)),or}function lr(Nt,Ht,or){return function(Cr,Sr){var Tr=vt(Cr),Yr=vt(Sr),Fn=[];if(Tr&&Yr&&$t(Tr,Yr))return Fn;Tr&&Fn.push(Tr),Yr&&Fn.push(Yr);var ua=2*r.constrain((Cr[Nt]+Sr[Nt])/2,Ht,or)-((Tr||Cr)[Nt]+(Yr||Sr)[Nt]);if(ua){var ta;Tr&&Yr?ta=ua>0==Tr[Nt]>Yr[Nt]?Tr:Yr:ta=Tr||Yr,ta[Nt]+=ua}return Fn}}var dr;m==="linear"||m==="spline"?dr=wt:m==="hv"||m==="vh"?dr=Yt:m==="hvh"?dr=lr(0,We,it):m==="vhv"&&(dr=lr(1,yt,bt));function Nr(Nt,Ht){var or=Ht[0]-Nt[0],Cr=(Ht[1]-Nt[1])/or,Sr=(Nt[1]*Ht[0]-Ht[1]*Nt[0])/or;return Sr>0?[Cr>0?We:it,bt]:[Cr>0?it:We,yt]}function Fr(Nt){var Ht=Nt[0],or=Nt[1],Cr=Ht===z[N-1][0],Sr=or===z[N-1][1];if(!(Cr&&Sr))if(N>1){var Tr=Ht===z[N-2][0],Yr=or===z[N-2][1];Cr&&(Ht===We||Ht===it)&&Tr?Yr?N--:z[N-1]=Nt:Sr&&(or===yt||or===bt)&&Yr?Tr?N--:z[N-1]=Nt:z[N++]=Nt}else z[N++]=Nt}function ln(Nt){z[N-1][0]!==Nt[0]&&z[N-1][1]!==Nt[1]&&Fr([ze,Ae]),Fr(Nt),Ke=null,ze=Ae=0}var zr=r.isArrayOrTypedArray(E);function Xr(Nt){if(Nt&&A&&(Nt.i=U,Nt.d=s,Nt.trace=c,Nt.marker=zr?E[Nt.i]:E,Nt.backoff=A),ue=Nt[0]/g,Te=Nt[1]/b,ht=Nt[0]it?it:0,qe=Nt[1]bt?bt:0,ht||qe){if(!N)z[N++]=[ht||Nt[0],qe||Nt[1]];else if(Ke){var Ht=dr(Ke,Nt);Ht.length>1&&(ln(Ht[0]),z[N++]=Ht[1])}else _t=dr(z[N-1],Nt)[0],z[N++]=_t;var or=z[N-1];ht&&qe&&(or[0]!==ht||or[1]!==qe)?(Ke&&(ze!==ht&&Ae!==qe?Fr(ze&&Ae?Nr(Ke,Nt):[ze||ht,Ae||qe]):ze&&Ae&&Fr([ze,Ae])),Fr([ht,qe])):ze-ht&&Ae-qe&&Fr([ht||ze,qe||Ae]),Ke=Nt,ze=ht,Ae=qe}else Ke&&ln(dr(Ke,Nt)[0]),z[N++]=Nt}for(U=0;UFe(J,Ot))break;D=J,se=pe[0]*ye[0]+pe[1]*ye[1],se>W?(W=se,j=J,oe=!1):se=s.length||!J)break;Xr(J),B=J}}Ke&&Fr([ze||Ke[0],Ae||Ke[1]]),y.push(z.slice(0,N))}var Qe=m.slice(m.length-1);if(A&&Qe!=="h"&&Qe!=="v"){for(var ct=!1,Ue=-1,Ie=[],Pe=0;Pe=0?i=v:(i=v=c,c++),i0,m=n(v,p,T);if(A=l.selectAll("g.trace").data(m,function(d){return d[0].trace.uid}),A.enter().append("g").attr("class",function(d){return"trace scatter trace"+d[0].trace.uid}).style("stroke-miterlimit",2),A.order(),a(v,A,p),w){b&&(E=b());var u=h.transition().duration(g.duration).ease(g.easing).each("end",function(){E&&E()}).each("interrupt",function(){E&&E()});u.each(function(){l.selectAll("g.trace").each(function(d,y){s(v,y,p,d,m,this,g)})})}else A.each(function(d,y){s(v,y,p,d,m,this,g)});_&&A.exit().remove(),l.selectAll("path:not([d])").remove()};function a(c,v,p){v.each(function(T){var l=k(h.select(this),"g","fills");t.setClipUrl(l,p.layerClipId,c);var g=T[0].trace,b=[];g._ownfill&&b.push("_ownFill"),g._nexttrace&&b.push("_nextFill");var A=l.selectAll("g").data(b,e);A.enter().append("g"),A.exit().each(function(E){g[E]=null}).remove(),A.order().each(function(E){g[E]=k(h.select(this),"path","js-fill")})})}function s(c,v,p,T,l,g,b){var A=c._context.staticPlot,E;f(c,v,p,T,l);var _=!!b&&b.duration>0;function w(Fr){return _?Fr.transition():Fr}var m=p.xaxis,u=p.yaxis,d=T[0].trace,y=d.line,R=h.select(g),L=k(R,"g","errorbars"),z=k(R,"g","lines"),N=k(R,"g","points"),U=k(R,"g","text");if(x.getComponentMethod("errorbars","plot")(c,L,p,b),d.visible!==!0)return;w(R).style("opacity",d.opacity);var B,D,j=d.fill.charAt(d.fill.length-1);j!=="x"&&j!=="y"&&(j="");var q,J;j==="y"?(q=1,J=u.c2p(0,!0)):j==="x"&&(q=0,J=m.c2p(0,!0)),T[0][p.isRangePlot?"nodeRangePlot3":"node3"]=R;var oe="",ye=[],pe=d._prevtrace,ge=null,W=null;pe&&(oe=pe._prevRevpath||"",D=pe._nextFill,ye=pe._ownPolygons,ge=pe._fillsegments,W=pe._fillElement);var ae,se,Q="",me="",ie,Y,le,ue,Te,Fe,Ve=[];d._polygons=[];var Xe=[],We=[],it=S.noop;if(B=d._ownFill,r.hasLines(d)||d.fill!=="none"){D&&D.datum(T),["hv","vh","hvh","vhv"].indexOf(y.shape)!==-1?(ie=t.steps(y.shape),Y=t.steps(y.shape.split("").reverse().join(""))):y.shape==="spline"?ie=Y=function(Fr){var ln=Fr[Fr.length-1];return Fr.length>1&&Fr[0][0]===ln[0]&&Fr[0][1]===ln[1]?t.smoothclosed(Fr.slice(1),y.smoothing):t.smoothopen(Fr,y.smoothing)}:ie=Y=function(Fr){return"M"+Fr.join("L")},le=function(Fr){return Y(Fr.reverse())},We=o(T,{xaxis:m,yaxis:u,trace:d,connectGaps:d.connectgaps,baseTolerance:Math.max(y.width||1,3)/4,shape:y.shape,backoff:y.backoff,simplify:y.simplify,fill:d.fill}),Xe=new Array(We.length);var yt=0;for(E=0;E=A[0]&&R.x<=A[1]&&R.y>=E[0]&&R.y<=E[1]}),u=Math.ceil(m.length/w),d=0;l.forEach(function(R,L){var z=R[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&L=Math.min(pe,ge)&&p<=Math.max(pe,ge)?0:1/0}var W=Math.max(3,ye.mrc||0),ae=1-1/W,se=Math.abs(c.c2p(ye.x)-p);return se=Math.min(pe,ge)&&T<=Math.max(pe,ge)?0:1/0}var W=Math.max(3,ye.mrc||0),ae=1-1/W,se=Math.abs(v.c2p(ye.y)-T);return seme!=Xe>=me&&(Te=le[Y-1][0],Fe=le[Y][0],Xe-Ve&&(ue=Te+(Fe-Te)*(me-Ve)/(Xe-Ve),W=Math.min(W,ue),ae=Math.max(ae,ue)));return W=Math.max(W,0),ae=Math.min(ae,c._length),{x0:W,x1:ae,y0:me,y1:me}}if(g.indexOf("fills")!==-1&&f._fillElement){var q=D(f._fillElement)&&!D(f._fillExclusionElement);if(q){var J=j(f._polygons);J===null&&(J={x0:l[0],x1:l[0],y0:l[1],y1:l[1]});var oe=e.defaultLine;return e.opacity(f.fillcolor)?oe=f.fillcolor:e.opacity((f.line||{}).color)&&(oe=f.line.color),h.extendFlat(o,{distance:o.maxHoverDistance,x0:J.x0,x1:J.x1,y0:J.y0,y1:J.y1,color:oe,hovertemplate:!1}),delete o.index,f.text&&!h.isArrayOrTypedArray(f.text)?o.text=String(f.text):o.text=f.name,[o]}}}}}),yg=_e({"src/traces/scatter/select.js"(ee,X){var h=Ps();X.exports=function(S,k){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(k===!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}}}),P_=_e({"src/plots/cartesian/category_order_defaults.js"(ee,X){var h=lo().isTypedArraySpec;function x(S,k){var e=k.dataAttr||S._id.charAt(0),t={},r,o,n;if(k.axData)r=k.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=x(e,r).sort(),a==="category ascending"?e._initialCategories=s:a==="category descending"&&(e._initialCategories=s.reverse()))}}}}),Py=_e({"src/plots/cartesian/line_grid_defaults.js"(ee,X){var h=bs().mix,x=Hl(),S=kn();X.exports=function(e,t,r,o){o=o||{};var n=o.dfltColor;function i(d,y){return S.coerce2(e,t,o.attributes,d,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||x.lightFraction).toRgbString(),v=i("gridcolor",c),p=i("gridwidth"),T=i("griddash"),l=r("showgrid",o.showGrid||!!v||!!p||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var g=h(t.gridcolor,o.bgColor,67).toRgbString(),b=i("minor.gridcolor",g),A=i("minor.gridwidth",t.gridwidth||1),E=i("minor.griddash",t.griddash||"solid"),_=r("minor.showgrid",!!b||!!A||!!E);_||(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)}}}}),Ly=_e({"src/plots/cartesian/axis_defaults.js"(ee,X){var h=jn(),x=bi(),S=kn(),k=ou(),e=Wh(),t=Ih(),r=ov(),o=Dv(),n=Zr(),i=Ln(),a=P_(),s=Py(),f=xw(),c=Sc(),v=Sh().WEEKDAY_PATTERN,p=Sh().HOUR_PATTERN;X.exports=function(A,E,_,w,m){var u=w.letter,d=w.font||{},y=w.splomStash||{},R=_("visible",!w.visibleDflt),L=E._template||{},z=E.type||L.type||"-",N;if(z==="date"){var U=x.getComponentMethod("calendars","handleDefaults");U(A,E,"calendar",w.calendar),w.noTicklabelmode||(N=_("ticklabelmode"))}!w.noTicklabelindex&&(z==="date"||z==="linear")&&_("ticklabelindex");var B="";(!w.noTicklabelposition||z==="multicategory")&&(B=S.coerce(A,E,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:N==="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(E,m),f(A,E,_,w),a(A,E,_,w),w.noHover||(z!=="category"&&_("hoverformat"),w.noUnifiedhovertitle||_("unifiedhovertitle.text"));var D=_("color"),j=D!==t.color.dflt?D:d.color,q=y.label||m._dfltTitle[u];if(i(A,E,_,z,w),!R)return E;_("title.text",q),S.coerceFont(_,"title.font",d,{overrideDflt:{size:S.bigFont(d.size),color:j}}),r(A,E,_,z);var J=w.hasMinor;if(J&&(k.newContainer(E,"minor"),r(A,E,_,z,{isMinor:!0})),n(A,E,_,z,w),o(A,E,_,w),J){var oe=w.isMinor;w.isMinor=!0,o(A,E,_,w),w.isMinor=oe}s(A,E,_,{dfltColor:D,bgColor:w.bgColor,showGrid:w.showGrid,hasMinor:J,attributes:t}),J&&!E.minor.ticks&&!E.minor.showgrid&&delete E.minor,(E.showline||E.ticks)&&_("mirror");var ye=z==="multicategory";if(!w.noTickson&&(z==="category"||ye)&&(E.ticks||E.showgrid)&&(ye?(_("tickson","boundaries"),delete E.ticklabelposition):_("tickson")),ye){var pe=_("showdividers");pe&&(_("dividercolor"),_("dividerwidth"))}if(z==="date")if(e(A,E,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!E.rangebreaks.length)delete E.rangebreaks;else{for(var ge=0;ge=2){var u="",d,y;if(m.length===2){for(d=0;d<2;d++)if(y=g(m[d]),y){u=v;break}}var R=_("pattern",u);if(R===v)for(d=0;d<2;d++)y=g(m[d]),y&&(A.bounds[d]=m[d]=y-1);if(R)for(d=0;d<2;d++)switch(y=m[d],R){case v:if(!h(y)){A.enabled=!1;return}if(y=+y,y!==Math.floor(y)||y<0||y>=7){A.enabled=!1;return}A.bounds[d]=m[d]=y;break;case p:if(!h(y)){A.enabled=!1;return}if(y=+y,y<0||y>24){A.enabled=!1;return}A.bounds[d]=m[d]=y;break}if(E.autorange===!1){var L=E.range;if(L[0]L[1]){A.enabled=!1;return}}else if(m[0]>L[0]&&m[1]_[1]-1/4096&&(e.domain=c),x.noneOrAll(k.domain,e.domain,c),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),OM=_e({"src/plots/cartesian/layout_defaults.js"(ee,X){var h=kn(),x=so(),S=rc().isUnifiedHover,k=kw(),e=ou(),t=Bi(),r=Ih(),o=$w(),n=Ly(),i=am(),a=L_(),s=cf(),f=s.id2name,c=s.name2id,v=Sh().AX_ID_PATTERN,p=bi(),T=p.traceIs,l=p.getComponentMethod;function g(b,A,E){Array.isArray(b[A])?b[A].push(E):b[A]=[E]}X.exports=function(A,E,_){var w=E.autotypenumbers,m={},u={},d={},y={},R={},L={},z={},N={},U={},B={},D,j;for(D=0;D<_.length;D++){var q=_[D];if(T(q,"cartesian")){var J;if(q.xaxis)J=f(q.xaxis),g(m,J,q);else if(q.xaxes)for(j=0;j rect").call(k.setTranslate,0,0).call(k.setScale,1,1),E.plot.call(k.setTranslate,_._offset,w._offset).call(k.setScale,1,1);var m=E.plot.selectAll(".scatterlayer .trace");m.selectAll(".point").call(k.setPointGroupScale,1,1),m.selectAll(".textpoint").call(k.setTextPointsScale,1,1),m.call(k.hideOutsideRangePoints,E)}function f(E,_){var w=E.plotinfo,m=w.xaxis,u=w.yaxis,d=m._length,y=u._length,R=!!E.xr1,L=!!E.yr1,z=[];if(R){var N=S.simpleMap(E.xr0,m.r2l),U=S.simpleMap(E.xr1,m.r2l),B=N[1]-N[0],D=U[1]-U[0];z[0]=(N[0]*(1-_)+_*U[0]-N[0])/(N[1]-N[0])*d,z[2]=d*(1-_+_*D/B),m.range[0]=m.l2r(N[0]*(1-_)+_*U[0]),m.range[1]=m.l2r(N[1]*(1-_)+_*U[1])}else z[0]=0,z[2]=d;if(L){var j=S.simpleMap(E.yr0,u.r2l),q=S.simpleMap(E.yr1,u.r2l),J=j[1]-j[0],oe=q[1]-q[0];z[1]=(j[1]*(1-_)+_*q[1]-j[1])/(j[0]-j[1])*y,z[3]=y*(1-_+_*oe/J),u.range[0]=m.l2r(j[0]*(1-_)+_*q[0]),u.range[1]=u.l2r(j[1]*(1-_)+_*q[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 ye=R?d/z[2]:1,pe=L?y/z[3]:1,ge=R?z[0]:0,W=L?z[1]:0,ae=R?z[0]/z[2]*d:0,se=L?z[1]/z[3]*y:0,Q=m._offset-ae,me=u._offset-se;w.clipRect.call(k.setTranslate,ge,W).call(k.setScale,1/ye,1/pe),w.plot.call(k.setTranslate,Q,me).call(k.setScale,ye,pe),k.setPointGroupScale(w.zoomScalePts,1/ye,1/pe),k.setTextPointsScale(w.zoomScaleTxt,1/ye,1/pe)}var c;i&&(c=i());function v(){for(var E={},_=0;_n.duration?(v(),g=window.cancelAnimationFrame(A)):g=window.requestAnimationFrame(A)}return T=Date.now(),g=window.requestAnimationFrame(A),Promise.resolve()}}}),Mh=_e({"src/plots/cartesian/index.js"(ee){var X=mr(),h=bi(),x=kn(),S=Fs(),k=ri(),e=xl().getModuleCalcData,t=cf(),r=Sh(),o=Ol(),n=x.ensureSingle;function i(T,l,g){return x.ensureSingle(T,l,g,function(b){b.datum(g)})}var a=r.zindexSeparator;ee.name="cartesian",ee.attr=["xaxis","yaxis"],ee.idRoot=["x","y"],ee.idRegex=r.idRegex,ee.attrRegex=r.attrRegex,ee.attributes=RM(),ee.layoutAttributes=Ih(),ee.supplyLayoutDefaults=OM(),ee.transitionAxes=zM(),ee.finalizeSubplots=function(T,l){var g=l._subplots,b=g.xaxis,A=g.yaxis,E=g.cartesian,_=E,w={},m={},u,d,y;for(u=0;u<_.length;u++){var R=_[u].split("y");w[R[0]]=1,m["y"+R[1]]=1}for(u=0;u0){var L=R.id;if(L.indexOf(a)!==-1)continue;L+=a+(u+1),R=x.extendFlat({},R,{id:L,plot:A._cartesianlayer.selectAll(".subplot").select("."+L)})}for(var z=[],N,U=0;U<_.length;U++){var B=_[U],D=B[0].trace;d===(D.zorder||0)&&D.xaxis+D.yaxis===y&&((l.indexOf(D.index)!==-1||D.carpet)&&(N&&N[0].trace.xaxis+N[0].trace.yaxis===y&&["tonextx","tonexty","tonext"].indexOf(D.fill)!==-1&&z.indexOf(N)===-1&&z.push(N),z.push(B)),N=B)}s(T,R,z,g,b)}}};function s(T,l,g,b,A){for(var E=r.traceLayerClasses,_=T._fullLayout,w=_._zindices,m=_._modules,u,d,y,R=[],L=[],z=0;z1&&(J+=a+q),j.push(w+J),_=0;_1,y=l.mainplotinfo;if(!l.mainplot||d)if(u)l.xlines=n(b,"path","xlines-above"),l.ylines=n(b,"path","ylines-above"),l.xaxislayer=n(b,"g","xaxislayer-above"),l.yaxislayer=n(b,"g","yaxislayer-above");else{if(!_){var R=n(b,"g","layer-subplot");l.shapelayer=n(R,"g","shapelayer"),l.imagelayer=n(R,"g","imagelayer"),y&&d?(l.minorGridlayer=y.minorGridlayer,l.gridlayer=y.gridlayer,l.zerolinelayer=y.zerolinelayer):(l.minorGridlayer=n(b,"g","minor-gridlayer"),l.gridlayer=n(b,"g","gridlayer"),l.zerolinelayer=n(b,"g","zerolinelayer"));var L=n(b,"g","layer-between");l.shapelayerBetween=n(L,"g","shapelayer"),l.imagelayerBetween=n(L,"g","imagelayer"),n(b,"path","xlines-below"),n(b,"path","ylines-below"),l.overlinesBelow=n(b,"g","overlines-below"),n(b,"g","xaxislayer-below"),n(b,"g","yaxislayer-below"),l.overaxesBelow=n(b,"g","overaxes-below")}l.overplot=n(b,"g","overplot"),l.plot=n(l.overplot,"g",A),y&&d?l.zerolinelayerAbove=y.zerolinelayerAbove:l.zerolinelayerAbove=n(b,"g","zerolinelayer-above"),_||(l.xlines=n(b,"path","xlines-above"),l.ylines=n(b,"path","ylines-above"),l.overlinesAbove=n(b,"g","overlines-above"),n(b,"g","xaxislayer-above"),n(b,"g","yaxislayer-above"),l.overaxesAbove=n(b,"g","overaxes-above"),l.xlines=b.select(".xlines-"+w),l.ylines=b.select(".ylines-"+m),l.xaxislayer=b.select(".xaxislayer-"+w),l.yaxislayer=b.select(".yaxislayer-"+m))}else{var z=y.plotgroup,N=A+"-x",U=A+"-y";l.minorGridlayer=y.minorGridlayer,l.gridlayer=y.gridlayer,l.zerolinelayer=y.zerolinelayer,l.zerolinelayerAbove=y.zerolinelayerAbove,n(y.overlinesBelow,"path",N),n(y.overlinesBelow,"path",U),n(y.overaxesBelow,"g",N),n(y.overaxesBelow,"g",U),l.plot=n(y.overplot,"g",A),n(y.overlinesAbove,"path",N),n(y.overlinesAbove,"path",U),n(y.overaxesAbove,"g",N),n(y.overaxesAbove,"g",U),l.xlines=z.select(".overlines-"+w).select("."+N),l.ylines=z.select(".overlines-"+m).select("."+U),l.xaxislayer=z.select(".overaxes-"+w).select("."+N),l.yaxislayer=z.select(".overaxes-"+m).select("."+U)}_||(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 v(T,l){if(T){var g={};T.each(function(m){var u=m[0],d=X.select(this);d.remove(),p(u,l),g[u]=!0});for(var b in l._plots)for(var A=l._plots[b],E=A.overlays||[],_=0;_=0,l=i.indexOf("end")>=0,g=f.backoff*v+a.standoff,b=c.backoff*p+a.startstandoff,A,E,_,w;if(s.nodeName==="line"){A={x:+n.attr("x1"),y:+n.attr("y1")},E={x:+n.attr("x2"),y:+n.attr("y2")};var m=A.x-E.x,u=A.y-E.y;if(_=Math.atan2(u,m),w=_+Math.PI,g&&b&&g+b>Math.sqrt(m*m+u*u)){J();return}if(g){if(g*g>m*m+u*u){J();return}var d=g*Math.cos(_),y=g*Math.sin(_);E.x+=d,E.y+=y,n.attr({x2:E.x,y2:E.y})}if(b){if(b*b>m*m+u*u){J();return}var R=b*Math.cos(_),L=b*Math.sin(_);A.x-=R,A.y-=L,n.attr({x1:A.x,y1:A.y})}}else if(s.nodeName==="path"){var z=s.getTotalLength(),N="";if(z2/3?Jn="right":Jn="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[Jn]}for(var _t=!1,wt=["x","y"],vt=0;vt1)&&(lr===Yt?(ft=dr.r2fraction(b["a"+$t]),(ft<0||ft>1)&&(_t=!0)):_t=!0),ct=dr._offset+dr.r2p(b[$t]),Pe=.5}else{var Bt=at==="domain";$t==="x"?(Ie=b[$t],ct=Bt?dr._offset+dr._length*Ie:ct=u.l+u.w*Ie):(Ie=1-b[$t],ct=Bt?dr._offset+dr._length*Ie:ct=u.t+u.h*Ie),Pe=b.showarrow?.5:Ie}if(b.showarrow){Qe.head=ct;var Nt=b["a"+$t];if(Be=Fr*Ke(.5,b.xanchor)-ln*Ke(.5,b.yanchor),lr===Yt){var Ht=t.getRefType(lr);Ht==="domain"?($t==="y"&&(Nt=1-Nt),Qe.tail=dr._offset+dr._length*Nt):Ht==="paper"?$t==="y"?(Nt=1-Nt,Qe.tail=u.t+u.h*Nt):Qe.tail=u.l+u.w*Nt:Qe.tail=dr._offset+dr.r2p(Nt),Ue=Be}else Qe.tail=ct+Nt,Ue=Be+Nt;Qe.text=Qe.tail+Be;var or=m[$t==="x"?"width":"height"];if(Yt==="paper"&&(Qe.head=k.constrain(Qe.head,1,or-1)),lr==="pixel"){var Cr=-Math.max(Qe.tail-3,Qe.text),Sr=Math.min(Qe.tail+3,Qe.text)-or;Cr>0?(Qe.tail+=Cr,Qe.text+=Cr):Sr>0&&(Qe.tail-=Sr,Qe.text-=Sr)}Qe.tail+=Ot,Qe.head+=Ot}else Be=zr*Ke(Pe,Xr),Ue=Be,Qe.text=ct+Be;Qe.text+=Ot,Be+=Ot,Ue+=Ot,b["_"+$t+"padplus"]=zr/2+Ue,b["_"+$t+"padminus"]=zr/2-Ue,b["_"+$t+"size"]=zr,b["_"+$t+"shift"]=Be}if(_t){ge.remove();return}var Tr=0,Yr=0;if(b.align!=="left"&&(Tr=(ht-bt)*(b.align==="center"?.5:1)),b.valign!=="top"&&(Yr=(qe-mt)*(b.valign==="middle"?.5:1)),it)We.select("svg").attr({x:se+Tr-1,y:se+Yr}).call(o.setClipUrl,me?B:null,g);else{var Fn=se+Yr-yt.top,ua=se+Tr-yt.left;ue.call(i.positionText,ua,Fn).call(o.setClipUrl,me?B:null,g)}ie.select("rect").call(o.setRect,se,se,ht,qe),Q.call(o.setRect,W/2,W/2,ze-W,Ae-W),ge.call(o.setTranslate,Math.round(D.x.text-ze/2),Math.round(D.y.text-Ae/2)),J.attr({transform:"rotate("+j+","+D.x.text+","+D.y.text+")"});var ta=function(ma,Jn){q.selectAll(".annotation-arrow-g").remove();var ja=D.x.head,ti=D.y.head,gr=D.x.tail+ma,Kt=D.y.tail+Jn,vr=D.x.text+ma,_r=D.y.text+Jn,rn=k.rotationXYMatrix(j,vr,_r),gn=k.apply2DTransform(rn),Mn=k.apply2DTransform2(rn),In=+Q.attr("width"),fa=+Q.attr("height"),Ca=vr-.5*In,Ma=Ca+In,Da=_r-.5*fa,Va=Da+fa,na=[[Ca,Da,Ca,Va],[Ca,Va,Ma,Va],[Ma,Va,Ma,Da],[Ma,Da,Ca,Da]].map(Mn);if(!na.reduce(function(Dt,yr){return Dt^!!k.segmentsIntersect(ja,ti,ja+1e6,ti+1e6,yr[0],yr[1],yr[2],yr[3])},!1)){na.forEach(function(Dt){var yr=k.segmentsIntersect(gr,Kt,ja,ti,Dt[0],Dt[1],Dt[2],Dt[3]);yr&&(gr=yr.x,Kt=yr.y)});var Mi=b.arrowwidth,Oi=b.arrowcolor,Vt=b.arrowside,Ct=q.append("g").style({opacity:r.opacity(Oi)}).classed("annotation-arrow-g",!0),Br=Ct.append("path").attr("d","M"+gr+","+Kt+"L"+ja+","+ti).style("stroke-width",Mi+"px").call(r.stroke,r.rgb(Oi));if(c(Br,Vt,b),d.annotationPosition&&Br.node().parentNode&&!E){var Kr=ja,Qr=ti;if(b.standoff){var Gr=Math.sqrt(Math.pow(ja-gr,2)+Math.pow(ti-Kt,2));Kr+=b.standoff*(gr-ja)/Gr,Qr+=b.standoff*(Kt-ti)/Gr}var Jr=Ct.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(gr-Kr)+","+(Kt-Qr),transform:e(Kr,Qr)}).style("stroke-width",Mi+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),yn,cn;s.init({element:Jr.node(),gd:g,prepFn:function(){var Dt=o.getTranslate(ge);yn=Dt.x,cn=Dt.y,_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0)},moveFn:function(Dt,yr){var Hr=gn(yn,cn),_n=Hr[0]+Dt,Hn=Hr[1]+yr;ge.call(o.setTranslate,_n,Hn),N("x",T(_,Dt,"x",u,b)),N("y",T(w,yr,"y",u,b)),b.axref===b.xref&&N("ax",T(_,Dt,"ax",u,b)),b.ayref===b.yref&&N("ay",T(w,yr,"ay",u,b)),Ct.attr("transform",e(Dt,yr)),J.attr({transform:"rotate("+j+","+_n+","+Hn+")"})},doneFn:function(){x.call("_guiRelayout",g,U());var Dt=document.querySelector(".js-notes-box-panel");Dt&&Dt.redraw(Dt.selectedObj)}})}}};if(b.showarrow&&ta(0,0),oe){var va;s.init({element:ge.node(),gd:g,prepFn:function(){va=J.attr("transform")},moveFn:function(ma,Jn){var ja="pointer";if(b.showarrow)b.axref===b.xref?N("ax",T(_,ma,"ax",u,b)):N("ax",b.ax+ma),b.ayref===b.yref?N("ay",T(w,Jn,"ay",u.w,b)):N("ay",b.ay+Jn),ta(ma,Jn);else{if(E)return;var ti,gr;if(_)ti=T(_,ma,"x",u,b);else{var Kt=b._xsize/u.w,vr=b.x+(b._xshift-b.xshift)/u.w-Kt/2;ti=s.align(vr+ma/u.w,Kt,0,1,b.xanchor)}if(w)gr=T(w,Jn,"y",u,b);else{var _r=b._ysize/u.h,rn=b.y-(b._yshift+b.yshift)/u.h-_r/2;gr=s.align(rn-Jn/u.h,_r,0,1,b.yanchor)}N("x",ti),N("y",gr),(!_||!w)&&(ja=s.getCursor(_?.5:ti,w?.5:gr,b.xanchor,b.yanchor))}J.attr({transform:e(ma,Jn)+va}),a(ge,ja)},clickFn:function(ma,Jn){b.captureevents&&g.emit("plotly_clickannotation",pe(Jn))},doneFn:function(){a(ge),x.call("_guiRelayout",g,U());var ma=document.querySelector(".js-notes-box-panel");ma&&ma.redraw(ma.selectedObj)}})}}d.annotationText?ue.call(i.makeEditable,{delegate:ge,gd:g}).call(Te).on("edit",function(Ve){b.text=Ve,this.call(Te),N("text",Ve),_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0),x.call("_guiRelayout",g,U())}):ue.call(Te)}}}),BM=_e({"src/components/annotations/click.js"(ee,X){var h=kn(),x=bi(),S=ou().arrayEditor;X.exports={hasClickToShow:k,onClick:e};function k(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,v,p;if(a.length||s.length){for(v=0;v1){a=!0;break}}a?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+n+'"]').remove():(i._pdata=x(e.glplot.cameraParams,[t.xaxis.r2l(i.x)*r[0],t.yaxis.r2l(i.y)*r[1],t.zaxis.r2l(i.z)*r[2]]),h(e.graphDiv,i,n,e.id,i._xa,i._ya))}}}}),WM=_e({"src/components/annotations3d/index.js"(ee,X){var h=bi(),x=kn();X.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:D_()}}},layoutAttributes:D_(),handleDefaults:GM(),includeBasePlot:S,convert:HM(),draw:$M()};function S(k,e){var t=h.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,o=Object.keys(k),n=0;n0?l+v:v;return{ppad:v,ppadplus:p?b:A,ppadminus:p?A:b}}else return{ppad:v}}function o(n,i,a){var s=n._id.charAt(0)==="x"?"x":"y",f=n.type==="category"||n.type==="multicategory",c,v,p=0,T=0,l=f?n.r2c:n.d2c,g=i[s+"sizemode"]==="scaled";if(g?(c=i[s+"0"],v=i[s+"1"],f&&(p=i[s+"0shift"],T=i[s+"1shift"])):(c=i[s+"anchor"],v=i[s+"anchor"]),c!==void 0)return[l(c)+p,l(v)+T];if(i.path){var b=1/0,A=-1/0,E=i.path.match(S.segmentRE),_,w,m,u,d;for(n.type==="date"&&(l=k.decodeDate(l)),_=0;_A&&(A=d)));if(A>=b)return[b,A]}}}}),KM=_e({"src/components/shapes/index.js"(ee,X){var h=S_();X.exports={moduleType:"component",name:"shapes",layoutAttributes:Xw(),supplyLayoutDefaults:YM(),supplyDrawNewShapeDefaults:XM(),includeBasePlot:Cy()("shapes"),calcAutorange:ZM(),draw:h.draw,drawOne:h.drawOne}}}),Zw=_e({"src/components/images/attributes.js"(ee,X){var h=Sh(),x=ou().templatedArray;ky(),X.exports=x("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",h.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",h.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),JM=_e({"src/components/images/defaults.js"(ee,X){var h=kn(),x=xs(),S=Wh(),k=Zw(),e="images";X.exports=function(o,n){var i={name:e,handleItemDefaults:t};S(o,n,i)};function t(r,o,n){function i(g,b){return h.coerce(r,o,k,g,b)}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"],v=0;v<2;v++){var p=c[v],T=x.coerceRef(r,o,f,p,"paper",void 0);if(T!=="paper"){var l=x.getFromId(f,T);l._imgIndices.push(o._index)}x.coercePosition(o,f,i,T,p,0)}return o}}}),QM=_e({"src/components/images/draw.js"(ee,X){var h=mr(),x=ri(),S=xs(),k=cf(),e=Ol();X.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"))}}}),nE=_e({"src/components/updatemenus/scrollbox.js"(ee,X){X.exports=e;var h=mr(),x=so(),S=ri(),k=kn();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,v=this.position.t,p=this.position.h,T=this.position.direction,l=T==="down",g=T==="left",b=T==="right",A=T==="up",E=c,_=p,w,m,u,d;!l&&!g&&!b&&!A&&(this.position.direction="down",l=!0);var y=l||A;y?(w=f,m=w+E,l?(u=v,d=Math.min(u+_,s),_=d-u):(d=v+_,u=Math.max(d-_,0),_=d-u)):(u=v,d=u+_,g?(m=f+E,w=Math.max(m-E,0),E=m-w):(w=f,m=Math.min(w+E,a),E=m-w)),this._box={l:w,t:u,w:E,h:_};var R=c>E,L=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,N=f,U=v+p;U+z>s&&(U=s-z);var B=this.container.selectAll("rect.scrollbar-horizontal").data(R?[0]:[]);B.exit().on(".drag",null).remove(),B.enter().append("rect").classed("scrollbar-horizontal",!0).call(x.fill,e.barColor),R?(this.hbar=B.attr({rx:e.barRadius,ry:e.barRadius,x:N,y:U,width:L,height:z}),this._hbarXMin=N+L/2,this._hbarTranslateMax=E-L):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var D=p>_,j=e.barWidth+2*e.barPad,q=e.barLength+2*e.barPad,J=f+c,oe=v;J+j>a&&(J=a-j);var ye=this.container.selectAll("rect.scrollbar-vertical").data(D?[0]:[]);ye.exit().on(".drag",null).remove(),ye.enter().append("rect").classed("scrollbar-vertical",!0).call(x.fill,e.barColor),D?(this.vbar=ye.attr({rx:e.barRadius,ry:e.barRadius,x:J,y:oe,width:j,height:q}),this._vbarYMin=oe+q/2,this._vbarTranslateMax=_-q):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var pe=this.id,ge=w-.5,W=D?m+j+.5:m+.5,ae=u-.5,se=R?d+z+.5:d+.5,Q=i._topdefs.selectAll("#"+pe).data(R||D?[0]:[]);if(Q.exit().remove(),Q.enter().append("clipPath").attr("id",pe).append("rect"),R||D?(this._clipRect=Q.select("rect").attr({x:Math.floor(ge),y:Math.floor(ae),width:Math.ceil(W)-Math.floor(ge),height:Math.ceil(se)-Math.floor(ae)}),this.container.call(S.setClipUrl,pe,this.gd),this.bg.attr({x:f,y:v,width:c,height:p})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(S.setClipUrl,null),delete this._clipRect),R||D){var me=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(me);var ie=h.behavior.drag().on("dragstart",function(){h.event.sourceEvent.preventDefault(),h.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));R&&this.hbar.on(".drag",null).call(ie),D&&this.vbar.on(".drag",null).call(ie)}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=k.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,v=c+this._vbarTranslateMax,p=k.constrain(h.event.y,c,v),T=(p-c)/(v-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=k.constrain(r||0,0,n),o=k.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)}}}}),aE=_e({"src/components/updatemenus/draw.js"(ee,X){var h=mr(),x=Fs(),S=so(),k=ri(),e=kn(),t=Au(),r=ou().arrayEditor,o=eh().LINE_SPACING,n=R_(),i=nE();X.exports=function(L){var z=L._fullLayout,N=e.filterVisible(z[n.name]);function U(pe){x.autoMargin(L,u(pe))}var B=z._menulayer.selectAll("g."+n.containerClassName).data(N.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(U)}).remove(),N.length!==0){var D=B.selectAll("g."+n.headerGroupClassName).data(N,a);D.enter().append("g").classed(n.headerGroupClassName,!0);for(var j=e.ensureSingle(B,"g",n.dropdownButtonGroupClassName,function(pe){pe.style("pointer-events","all")}),q=0;q0?[0]:[]);J.enter().append("g").classed(n.containerClassName,!0).style("cursor",D?null:"ew-resize");function oe(W){W._commandObserver&&(W._commandObserver.remove(),delete W._commandObserver),x.autoMargin(B,c(W))}if(J.exit().each(function(){h.select(this).selectAll("g."+n.groupClassName).each(oe)}).remove(),q.length!==0){var ye=J.selectAll("g."+n.groupClassName).data(q,p);ye.enter().append("g").classed(n.groupClassName,!0),ye.exit().each(oe).remove();for(var pe=0;pe0&&(ye=ye.transition().duration(B.transition.duration).ease(B.transition.easing)),ye.attr("transform",t(oe-n.gripWidth*.5,B._dims.currentValueTotalHeight))}}function R(U,B){var D=U._dims;return D.inputAreaStart+n.stepInset+(D.inputAreaLength-2*n.stepInset)*Math.min(1,Math.max(0,B))}function L(U,B){var D=U._dims;return Math.min(1,Math.max(0,(B-n.stepInset-D.inputAreaStart)/(D.inputAreaLength-2*n.stepInset-2*D.inputAreaStart)))}function z(U,B,D){var j=D._dims,q=e.ensureSingle(U,"rect",n.railTouchRectClass,function(J){J.call(m,B,U,D).style("pointer-events","all")});q.attr({width:j.inputAreaLength,height:Math.max(j.inputAreaWidth,n.tickOffset+D.ticklen+j.labelHeight)}).call(S.fill,D.bgcolor).attr("opacity",0),k.setTranslate(q,0,j.currentValueTotalHeight)}function N(U,B){var D=B._dims,j=D.inputAreaLength-n.railInset*2,q=e.ensureSingle(U,"rect",n.railRectClass);q.attr({width:j,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"),k.setTranslate(q,n.railInset,(D.inputAreaWidth-n.railWidth)*.5+D.currentValueTotalHeight)}}}),lE=_e({"src/components/sliders/index.js"(ee,X){var h=Iy();X.exports={moduleType:"component",name:h.name,layoutAttributes:Jw(),supplyLayoutDefaults:oE(),draw:sE()}}}),O_=_e({"src/components/rangeslider/attributes.js"(ee,X){var h=Hl();X.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"}}}),Qw=_e({"src/components/rangeslider/oppaxis_attributes.js"(ee,X){X.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"}}}),z_=_e({"src/components/rangeslider/constants.js"(ee,X){X.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}}}),uE=_e({"src/components/rangeslider/helpers.js"(ee){var X=cf(),h=Au(),x=z_(),S=eh().LINE_SPACING,k=x.name;function e(t){var r=t&&t[k];return r&&r.visible}ee.isVisible=e,ee.makeData=function(t){for(var r=X.list({_fullLayout:t},"x",!0),o=t.margin,n=[],i=0;i=bt.max)it=Te[yt+1];else if(We=bt.pmax)it=Te[yt+1];else if(We0?m.touches[0].clientX:0}function v(m,u,d,y){if(u._context.staticPlot)return;var R=m.select("rect."+f.slideBoxClassName).node(),L=m.select("rect."+f.grabAreaMinClassName).node(),z=m.select("rect."+f.grabAreaMaxClassName).node();function N(){var U=h.event,B=U.target,D=c(U),j=D-m.node().getBoundingClientRect().left,q=y.d2p(d._rl[0]),J=y.d2p(d._rl[1]),oe=a.coverSlip();this.addEventListener("touchmove",ye),this.addEventListener("touchend",pe),oe.addEventListener("mousemove",ye),oe.addEventListener("mouseup",pe);function ye(ge){var W=c(ge),ae=+W-D,se,Q,me;switch(B){case R:if(me="ew-resize",q+ae>d._length||J+ae<0)return;se=q+ae,Q=J+ae;break;case L:if(me="col-resize",q+ae>d._length)return;se=q+ae,Q=J;break;case z:if(me="col-resize",J+ae<0)return;se=q,Q=J+ae;break;default:me="ew-resize",se=j,Q=j+ae;break}if(Q0);if(g){var b=o(a,s,f);T("x",b[0]),T("y",b[1]),h.noneOrAll(i,a,["x","y"]),T("xanchor"),T("yanchor"),h.coerceFont(T,"font",s.font);var A=T("bgcolor");T("activecolor",x.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 v=c("visible");if(v){var p=c("step");p!=="all"&&(f&&f!=="gregorian"&&(p==="month"||p==="year")?i.stepmode="backward":c("stepmode"),c("count")),c("label")}}function o(n,i,a){for(var s=a.filter(function(p){return i[p].anchor===n._id}),f=0,c=0;c1)){delete f.grid;return}if(!T&&!l&&!g){var d=w("pattern")==="independent";d&&(T=!0)}_._hasSubplotGrid=T;var y=w("roworder"),R=y==="top to bottom",L=T?.2:.1,z=T?.3:.1,N,U;b&&f._splomGridDflt&&(N=f._splomGridDflt.xside,U=f._splomGridDflt.yside),_._domains={x:n("x",w,L,N,u),y:n("y",w,z,U,m,R)}}function n(s,f,c,v,p,T){var l=f(s+"gap",c),g=f("domain."+s);f(s+"side",v);for(var b=new Array(p),A=g[0],E=(g[1]-A)/(p-l),_=E*(1-l),w=0;w0,v=r._context.staticPlot;o.each(function(p){var T=p[0].trace,l=T.error_x||{},g=T.error_y||{},b;T.ids&&(b=function(w){return w.id});var A=k.hasMarkers(T)&&T.marker.maxdisplayed>0;!g.visible&&!l.visible&&(p=[]);var E=h.select(this).selectAll("g.errorbar").data(p,b);if(E.exit().remove(),!!p.length){l.visible||E.selectAll("path.xerror").remove(),g.visible||E.selectAll("path.yerror").remove(),E.style("opacity",1);var _=E.enter().append("g").classed("errorbar",!0);c&&_.style("opacity",0).transition().duration(i.duration).style("opacity",1),S.setClipUrl(E,n.layerClipId,r),E.each(function(w){var m=h.select(this),u=e(w,s,f);if(!(A&&!w.vis)){var d,y=m.select("path.yerror");if(g.visible&&x(u.x)&&x(u.yh)&&x(u.ys)){var R=g.width;d="M"+(u.x-R)+","+u.yh+"h"+2*R+"m-"+R+",0V"+u.ys,u.noYS||(d+="m-"+R+",0h"+2*R),a=!y.size(),a?y=m.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("yerror",!0):c&&(y=y.transition().duration(i.duration).ease(i.easing)),y.attr("d",d)}else y.remove();var L=m.select("path.xerror");if(l.visible&&x(u.y)&&x(u.xh)&&x(u.xs)){var z=(l.copy_ystyle?g:l).width;d="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(d+="m0,-"+z+"v"+2*z),a=!L.size(),a?L=m.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("xerror",!0):c&&(L=L.transition().duration(i.duration).ease(i.easing)),L.attr("d",d)}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),x(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),x(n.xs)||(n.noXS=!0,n.xs=r.c2p(t.xs,!0))),n}}}),xE=_e({"src/components/errorbars/style.js"(ee,X){var h=mr(),x=so();X.exports=function(k){k.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(x.stroke,r.color),o.copy_ystyle&&(o=r),n.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(x.stroke,o.color)})}}}),wE=_e({"src/components/errorbars/index.js"(ee,X){var h=kn(),x=nc().overrideAll,S=r2(),k={error_x:h.extendFlat({},S),error_y:h.extendFlat({},S)};delete k.error_x.copy_zstyle,delete k.error_y.copy_zstyle,delete k.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,X.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:k,bar:k,histogram:k,scatter3d:x(e,"calc","nested"),scattergl:x(k,"calc","nested")}},supplyDefaults:yE(),calc:_E(),makeComputeError:n2(),plot:bE(),style:xE(),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))}}}),TE=_e({"src/components/colorbar/constants.js"(ee,X){X.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"}}}}),AE=_e({"src/components/colorbar/draw.js"(ee,X){var h=mr(),x=bs(),S=Fs(),k=bi(),e=xs(),t=Pd(),r=kn(),o=r.strTranslate,n=po().extendFlat,i=zp(),a=ri(),s=so(),f=Su(),c=Au(),v=ed().flipScale,p=Ly(),T=L_(),l=Ih(),g=eh(),b=g.LINE_SPACING,A=g.FROM_TL,E=g.FROM_BR,_=TE().cn;function w(L){var z=L._fullLayout,N=z._infolayer.selectAll("g."+_.colorbar).data(m(L),function(U){return U._id});N.enter().append("g").attr("class",function(U){return U._id}).classed(_.colorbar,!0),N.each(function(U){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(j){j.classed(_.crisp,!0)}),r.ensureSingle(B,"g",_.cbtitleunshift,function(j){j.append("g").classed(_.cbtitle,!0)}),r.ensureSingle(B,"rect",_.cboutline);var D=u(B,U,L);D&&D.then&&(L._promises||[]).push(D),L._context.edits.colorbarPosition&&d(B,U,L)}),N.exit().each(function(U){S.autoMargin(L,U._id)}).remove(),N.order()}function m(L){var z=L._fullLayout,N=L.calcdata,U=[],B,D,j,q;function J(Y){return n(Y,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function oe(){typeof q.calc=="function"?q.calc(L,j,B):(B._fillgradient=D.reversescale?v(D.colorscale):D.colorscale,B._zrange=[D[q.min],D[q.max]])}for(var ye=0;ye1){var Qe=Math.pow(10,Math.floor(Math.log(Ot)/Math.LN10));zr*=Qe*r.roundUp(Ot/Qe,[2,5,10]),(Math.abs(yt.start)/yt.size+1e-6)%1<2e-6&&(Fr.tick0=0)}Fr.dtick=zr}Fr.domain=U?[dr+ae/le.h,dr+Ke-ae/le.h]:[dr+W/le.w,dr+Ke-W/le.w],Fr.setScale(),L.attr("transform",o(Math.round(le.l),Math.round(le.t)));var ct=L.select("."+_.cbtitleunshift).attr("transform",o(-Math.round(le.l),-Math.round(le.t))),Ue=Fr.ticklabelposition,Ie=Fr.title.font.size,Pe=L.select("."+_.cbaxis),Be,at=0,ft=0;function Bt(Sr,Tr){var Yr={propContainer:Fr,propName:z._propPrefix+"title.text",traceIndex:z._traceIndex,_meta:z._meta,placeholder:Y._dfltTitle.colorbar,containerGroup:L.select("."+_.cbtitle)},Fn=Sr.charAt(0)==="h"?Sr.slice(1):"h"+Sr;L.selectAll("."+Fn+",."+Fn+"-math-group").remove(),f.draw(N,Sr,n(Yr,Tr||{}))}function Nt(){if(U&&ln||!U&&!ln){var Sr,Tr;Ve==="top"&&(Sr=W+le.l+_t*se,Tr=ae+le.t+wt*(1-dr-Ke)+3+Ie*.75),Ve==="bottom"&&(Sr=W+le.l+_t*se,Tr=ae+le.t+wt*(1-dr)-3-Ie*.25),Ve==="right"&&(Tr=ae+le.t+wt*Q+3+Ie*.75,Sr=W+le.l+_t*dr),Bt(Fr._id+"title",{attributes:{x:Sr,y:Tr,"text-anchor":U?"start":"middle"}})}}function Ht(){if(U&&!ln||!U&&ln){var Sr=Fr.position||0,Tr=Fr._offset+Fr._length/2,Yr,Fn;if(Ve==="right")Fn=Tr,Yr=le.l+_t*Sr+10+Ie*(Fr.showticklabels?1:.5);else if(Yr=Tr,Ve==="bottom"&&(Fn=le.t+wt*Sr+10+(Ue.indexOf("inside")===-1?Fr.tickfont.size:0)+(Fr.ticks!=="inside"&&z.ticklen||0)),Ve==="top"){var ua=Fe.text.split("
").length;Fn=le.t+wt*Sr+10-qe-b*Ie*ua}Bt((U?"h":"v")+Fr._id+"title",{avoid:{selection:h.select(N).selectAll("g."+Fr._id+"tick"),side:Ve,offsetTop:U?0:le.t,offsetLeft:U?le.l:0,maxShift:U?Y.width:Y.height},attributes:{x:Yr,y:Fn,"text-anchor":"middle"},transform:{rotate:U?-90:0,offset:0}})}}function or(){if(!U&&!ln||U&&ln){var Sr=L.select("."+_.cbtitle),Tr=Sr.select("text"),Yr=[-J/2,J/2],Fn=Sr.select(".h"+Fr._id+"title-math-group").node(),ua=15.6;Tr.node()&&(ua=parseInt(Tr.node().style.fontSize,10)*b);var ta;if(Fn?(ta=a.bBox(Fn),ft=ta.width,at=ta.height,at>ua&&(Yr[1]-=(at-ua)/2)):Tr.node()&&!Tr.classed(_.jsPlaceholder)&&(ta=a.bBox(Tr.node()),ft=ta.width,at=ta.height),U){if(at){if(at+=5,Ve==="top")Fr.domain[1]-=at/le.h,Yr[1]*=-1;else{Fr.domain[0]+=at/le.h;var va=c.lineCount(Tr);Yr[1]+=(1-va)*ua}Sr.attr("transform",o(Yr[0],Yr[1])),Fr.setScale()}}else ft&&(Ve==="right"&&(Fr.domain[0]+=(ft+Ie/2)/le.w),Sr.attr("transform",o(Yr[0],Yr[1])),Fr.setScale())}L.selectAll("."+_.cbfills+",."+_.cblines).attr("transform",U?o(0,Math.round(le.h*(1-Fr.domain[1]))):o(Math.round(le.w*Fr.domain[0]),0)),Pe.attr("transform",U?o(0,Math.round(-le.t)):o(Math.round(-le.l),0));var ma=L.select("."+_.cbfills).selectAll("rect."+_.cbfill).attr("style","").data(mt);ma.enter().append("rect").classed(_.cbfill,!0).attr("style",""),ma.exit().remove();var Jn=Xe.map(Fr.c2p).map(Math.round).sort(function(vr,_r){return vr-_r});ma.each(function(vr,_r){var rn=[_r===0?Xe[0]:(mt[_r]+mt[_r-1])/2,_r===mt.length-1?Xe[1]:(mt[_r]+mt[_r+1])/2].map(Fr.c2p).map(Math.round);U&&(rn[1]=r.constrain(rn[1]+(rn[1]>rn[0])?1:-1,Jn[0],Jn[1]));var gn=h.select(this).attr(U?"x":"y",vt).attr(U?"y":"x",h.min(rn)).attr(U?"width":"height",Math.max(qe,2)).attr(U?"height":"width",Math.max(h.max(rn)-h.min(rn),2));if(z._fillgradient)a.gradient(gn,N,z._id,U?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var Mn=it(vr).replace("e-","");gn.attr("fill",x(Mn).toHexString())}});var ja=L.select("."+_.cblines).selectAll("path."+_.cbline).data(Te.color&&Te.width?ht:[]);ja.enter().append("path").classed(_.cbline,!0),ja.exit().remove(),ja.each(function(vr){var _r=vt,rn=Math.round(Fr.c2p(vr))+Te.width/2%1;h.select(this).attr("d","M"+(U?_r+","+rn:rn+","+_r)+(U?"h":"v")+qe).call(a.lineGroupStyle,Te.width,We(vr),Te.dash)}),Pe.selectAll("g."+Fr._id+"tick,path").remove();var ti=vt+qe+(J||0)/2-(z.ticks==="outside"?1:0),gr=e.calcTicks(Fr),Kt=e.getTickSigns(Fr)[2];return e.drawTicks(N,Fr,{vals:Fr.ticks==="inside"?e.clipEnds(Fr,gr):gr,layer:Pe,path:e.makeTickPath(Fr,ti,Kt),transFn:e.makeTransTickFn(Fr)}),e.drawLabels(N,Fr,{vals:gr,layer:Pe,transFn:e.makeTransTickLabelFn(Fr),labelFns:e.makeLabelFns(Fr,ti)})}function Cr(){var Sr,Tr=qe+J/2;Ue.indexOf("inside")===-1&&(Sr=a.bBox(Pe.node()),Tr+=U?Sr.width:Sr.height),Be=ct.select("text");var Yr=0,Fn=U&&Ve==="top",ua=!U&&Ve==="right",ta=0;if(Be.node()&&!Be.classed(_.jsPlaceholder)){var va,ma=ct.select(".h"+Fr._id+"title-math-group").node();ma&&(U&&ln||!U&&!ln)?(Sr=a.bBox(ma),Yr=Sr.width,va=Sr.height):(Sr=a.bBox(ct.node()),Yr=Sr.right-le.l-(U?vt:Nr),va=Sr.bottom-le.t-(U?Nr:vt),!U&&Ve==="top"&&(Tr+=Sr.height,ta=Sr.height)),ua&&(Be.attr("transform",o(Yr/2+Ie/2,0)),Yr*=2),Tr=Math.max(Tr,U?Yr:va)}var Jn=(U?W:ae)*2+Tr+oe+J/2,ja=0;!U&&Fe.text&&ge==="bottom"&&Q<=0&&(ja=Jn/2,Jn+=ja,ta+=ja),Y._hColorbarMoveTitle=ja,Y._hColorbarMoveCBTitle=ta;var ti=oe+J,gr=(U?vt:Nr)-ti/2-(U?W:0),Kt=(U?Nr:vt)-(U?Ae:ae+ta-ja);L.select("."+_.cbbg).attr("x",gr).attr("y",Kt).attr(U?"width":"height",Math.max(Jn-ja,2)).attr(U?"height":"width",Math.max(Ae+ti,2)).call(s.fill,ye).call(s.stroke,z.bordercolor).style("stroke-width",oe);var vr=ua?Math.max(Yr-10,0):0;L.selectAll("."+_.cboutline).attr("x",(U?vt:Nr+W)+vr).attr("y",(U?Nr+ae-Ae:vt)+(Fn?at:0)).attr(U?"width":"height",Math.max(qe,2)).attr(U?"height":"width",Math.max(Ae-(U?2*ae+at:2*W+vr),2)).call(s.stroke,z.outlinecolor).style({fill:"none","stroke-width":J});var _r=U?$t*Jn:0,rn=U?0:(1-Yt)*Jn-ta;if(_r=ie?le.l-_r:-_r,rn=me?le.t-rn:-rn,L.attr("transform",o(_r,rn)),!U&&(oe||x(ye).getAlpha()&&!x.equals(Y.paper_bgcolor,ye))){var gn=Pe.selectAll("text"),Mn=gn[0].length,In=L.select("."+_.cbbg).node(),fa=a.bBox(In),Ca=a.getTranslate(L),Ma=2;gn.each(function(Qr,Gr){var Jr=0,yn=Mn-1;if(Gr===Jr||Gr===yn){var cn=a.bBox(this),Dt=a.getTranslate(this),yr;if(Gr===yn){var Hr=cn.right+Dt.x,_n=fa.right+Ca.x+Nr-oe-Ma+se;yr=_n-Hr,yr>0&&(yr=0)}else if(Gr===Jr){var Hn=cn.left+Dt.x,ea=fa.left+Ca.x+Nr+oe+Ma;yr=ea-Hn,yr<0&&(yr=0)}yr&&(Mn<3?this.setAttribute("transform","translate("+yr+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var Da={},Va=A[pe],na=E[pe],Mi=A[ge],Oi=E[ge],Vt=Jn-qe;U?(D==="pixels"?(Da.y=Q,Da.t=Ae*Mi,Da.b=Ae*Oi):(Da.t=Da.b=0,Da.yt=Q+B*Mi,Da.yb=Q-B*Oi),q==="pixels"?(Da.x=se,Da.l=Jn*Va,Da.r=Jn*na):(Da.l=Vt*Va,Da.r=Vt*na,Da.xl=se-j*Va,Da.xr=se+j*na)):(D==="pixels"?(Da.x=se,Da.l=Ae*Va,Da.r=Ae*na):(Da.l=Da.r=0,Da.xl=se+B*Va,Da.xr=se-B*na),q==="pixels"?(Da.y=1-Q,Da.t=Jn*Mi,Da.b=Jn*Oi):(Da.t=Vt*Mi,Da.b=Vt*Oi,Da.yt=Q-j*Mi,Da.yb=Q+j*Oi));var Ct=z.y<.5?"b":"t",Br=z.x<.5?"l":"r";N._fullLayout._reservedMargin[z._id]={};var Kr={r:Y.width-gr-_r,l:gr+Da.r,b:Y.height-Kt-rn,t:Kt+Da.b};ie&&me?S.autoMargin(N,z._id,Da):ie?N._fullLayout._reservedMargin[z._id][Ct]=Kr[Ct]:me||U?N._fullLayout._reservedMargin[z._id][Br]=Kr[Br]:N._fullLayout._reservedMargin[z._id][Ct]=Kr[Ct]}return r.syncOrAsync([S.previousPromises,Nt,or,Ht,S.previousPromises,Cr],N)}function d(L,z,N){var U=z.orientation==="v",B=N._fullLayout,D=B._size,j,q,J;t.init({element:L.node(),gd:N,prepFn:function(){j=L.attr("transform"),i(L)},moveFn:function(oe,ye){L.attr("transform",j+o(oe,ye)),q=t.align((U?z._uFrac:z._vFrac)+oe/D.w,U?z._thickFrac:z._lenFrac,0,1,z.xanchor),J=t.align((U?z._vFrac:1-z._uFrac)-ye/D.h,U?z._lenFrac:z._thickFrac,0,1,z.yanchor);var pe=t.getCursor(q,J,z.xanchor,z.yanchor);i(L,pe)},doneFn:function(){if(i(L),q!==void 0&&J!==void 0){var oe={};oe[z._propPrefix+"x"]=q,oe[z._propPrefix+"y"]=J,z._traceIndex!==void 0?k.call("_guiRestyle",N,oe,z._traceIndex):k.call("_guiRelayout",N,oe)}}})}function y(L,z,N){var U=z._levels,B=[],D=[],j,q,J=U.end+U.size/100,oe=U.size,ye=1.001*N[0]-.001*N[1],pe=1.001*N[1]-.001*N[0];for(q=0;q<1e5&&(j=U.start+q*oe,!(oe>0?j>=J:j<=J));q++)j>ye&&j0?j>=J:j<=J));q++)j>N[0]&&j-1}X.exports=function(o,n){var i,a=o.data,s=o.layout,f=k([],a),c=k({},s,e(n.tileClass)),v=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 p=Object.keys(c);for(i=0;i=0)return v}else if(typeof v=="string"&&(v=v.trim(),v.slice(-1)==="%"&&h(v.slice(0,-1))&&(v=+v.slice(0,-1),v>=0)))return v+"%"}function c(v,p,T,l,g,b){b=b||{};var A=b.moduleHasSelected!==!1,E=b.moduleHasUnselected!==!1,_=b.moduleHasConstrain!==!1,w=b.moduleHasCliponaxis!==!1,m=b.moduleHasTextangle!==!1,u=b.moduleHasInsideanchor!==!1,d=!!b.hasPathbar,y=Array.isArray(g)||g==="auto",R=y||g==="inside",L=y||g==="outside";if(R||L){var z=i(l,"textfont",T.font),N=x.extendFlat({},z),U=v.textfont&&v.textfont.color,B=!U;if(B&&delete N.color,i(l,"insidetextfont",N),d){var D=x.extendFlat({},z);B&&delete D.color,i(l,"pathbar.textfont",D)}L&&i(l,"outsidetextfont",z),A&&l("selected.textfont.color"),E&&l("unselected.textfont.color"),_&&l("constraintext"),w&&l("cliponaxis"),m&&l("textangle"),l("texttemplate"),l("texttemplatefallback")}R&&u&&l("insidetextanchor")}X.exports={supplyDefaults:a,crossTraceDefaults:s,handleText:c,validateCornerradius:f}}}),i2=_e({"src/traces/bar/layout_defaults.js"(ee,X){var h=bi(),x=xs(),S=kn(),k=N_(),e=up().validateCornerradius;X.exports=function(t,r,o){function n(A,E){return S.coerce(t,r,k,A,E)}for(var i=!1,a=!1,s=!1,f={},c=n("barmode"),v=c==="group",p=0;p0&&!f[l]&&(s=!0),f[l]=!0),T.visible&&T.type==="histogram"){var g=x.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 b=n("barcornerradius");r.barcornerradius=e(b)}}}),Dy=_e({"src/traces/bar/arrays_to_calcdata.js"(ee,X){var h=kn();X.exports=function(S,k){for(var e=0;er;if(!o)return k}return e!==void 0?e:S.dflt},ee.coerceColor=function(S,k,e){return h(k).isValid()?k:e!==void 0?e:S.dflt},ee.coerceEnumerated=function(S,k,e){return S.coerceNumber&&(k=+k),S.values.indexOf(k)!==-1?k:e!==void 0?e:S.dflt},ee.getValue=function(S,k){var e;return x(S)?k1||d.bargap===0&&d.bargroupgap===0&&!y[0].trace.marker.line.width)&&h.select(this).attr("shape-rendering","crispEdges")}),m.selectAll("g.points").each(function(y){var R=h.select(this),L=y[0].trace;f(R,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(d){var y=h.select(this),R=k.ensureUniformFontSize(u,l(y,d,m,u));S.font(y,R)})}function v(w,m,u){var d=m[0].trace;d.selectedpoints?p(u,d,w):(f(u,d,w),e.getComponentMethod("errorbars","style")(u))}function p(w,m,u){S.selectedPointStyle(w.selectAll("path"),m),T(w.selectAll("text"),m,u)}function T(w,m,u){w.each(function(d){var y=h.select(this),R;if(d.selected){R=k.ensureUniformFontSize(u,l(y,d,m,u));var L=m.selected.textfont&&m.selected.textfont.color;L&&(R.color=L),S.font(y,R)}else S.selectedTextStyle(y,m)})}function l(w,m,u,d){var y=d._fullLayout.font,R=u.textfont;if(w.classed("bartext-inside")){var L=_(m,u);R=b(u,m.i,y,L)}else w.classed("bartext-outside")&&(R=A(u,m.i,y));return R}function g(w,m,u){return E(o,w.textfont,m,u)}function b(w,m,u,d){var y=g(w,m,u),R=w._input.textfont===void 0||w._input.textfont.color===void 0||Array.isArray(w.textfont.color)&&w.textfont.color[m]===void 0;return R&&(y={color:x.contrast(d),family:y.family,size:y.size,weight:y.weight,style:y.style,variant:y.variant,textcase:y.textcase,lineposition:y.lineposition,shadow:y.shadow}),E(n,w.insidetextfont,m,y)}function A(w,m,u){var d=g(w,m,u);return E(i,w.outsidetextfont,m,d)}function E(w,m,u,d){m=m||{};var y=a.getValue(m.family,u),R=a.getValue(m.size,u),L=a.getValue(m.color,u),z=a.getValue(m.weight,u),N=a.getValue(m.style,u),U=a.getValue(m.variant,u),B=a.getValue(m.textcase,u),D=a.getValue(m.lineposition,u),j=a.getValue(m.shadow,u);return{family:a.coerceString(w.family,y,d.family),size:a.coerceNumber(w.size,R,d.size),color:a.coerceColor(w.color,L,d.color),weight:a.coerceString(w.weight,z,d.weight),style:a.coerceString(w.style,N,d.style),variant:a.coerceString(w.variant,U,d.variant),textcase:a.coerceString(w.variant,B,d.textcase),lineposition:a.coerceString(w.variant,D,d.lineposition),shadow:a.coerceString(w.variant,j,d.shadow)}}function _(w,m){return m.type==="waterfall"?m[w.dir].marker.color:w.mcc||w.mc||m.marker.color}X.exports={style:s,styleTextPoints:c,styleOnSelect:v,getInsideTextFont:b,getOutsideTextFont:A,getBarColor:_,resizeText:t}}}),um=_e({"src/traces/bar/plot.js"(ee,X){var h=mr(),x=jn(),S=kn(),k=Au(),e=so(),t=ri(),r=bi(),o=xs().tickText,n=Ld(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=Ap(),f=U_(),c=lm(),v=uv(),p=v.text,T=v.textposition,l=rc().appendArrayPointValue,g=c.TEXTPAD;function b(oe){return oe.id}function A(oe){if(oe.ids)return b}function E(oe){return(oe>0)-(oe<0)}function _(oe,ye){return oe0}function d(oe,ye,pe,ge,W,ae){var se=ye.xaxis,Q=ye.yaxis,me=oe._fullLayout,ie=oe._context.staticPlot;W||(W={mode:me.barmode,norm:me.barmode,gap:me.bargap,groupgap:me.bargroupgap},a("bar",me));var Y=S.makeTraceGroups(ge,pe,"trace bars").each(function(le){var ue=h.select(this),Te=le[0].trace,Fe=le[0].t,Ve=Te.type==="waterfall",Xe=Te.type==="funnel",We=Te.type==="histogram",it=Te.type==="bar",yt=it||Xe,bt=0;Ve&&Te.connector.visible&&Te.connector.mode==="between"&&(bt=Te.connector.line.width/2);var mt=Te.orientation==="h",ht=u(W),qe=S.ensureSingle(ue,"g","points"),ze=A(Te),Ae=qe.selectAll("g.point").data(S.identity,ze);Ae.enter().append("g").classed("point",!0),Ae.exit().remove(),Ae.each(function(_t,wt){var vt=h.select(this),$t=w(_t,se,Q,mt),Yt=$t[0][0],lr=$t[0][1],dr=$t[1][0],Nr=$t[1][1],Fr=(mt?lr-Yt:Nr-dr)===0;Fr&&yt&&f.getLineWidth(Te,_t)&&(Fr=!1),Fr||(Fr=!x(Yt)||!x(lr)||!x(dr)||!x(Nr)),_t.isBlank=Fr,Fr&&(mt?lr=Yt:Nr=dr),bt&&!Fr&&(mt?(Yt-=_(Yt,lr)*bt,lr+=_(Yt,lr)*bt):(dr-=_(dr,Nr)*bt,Nr+=_(dr,Nr)*bt));var ln,zr;if(Te.type==="waterfall"){if(!Fr){var Xr=Te[_t.dir].marker;ln=Xr.line.width,zr=Xr.color}}else ln=f.getLineWidth(Te,_t),zr=_t.mc||Te.marker.color;function Ot(ti){var gr=h.round(ln/2%1,2);return W.gap===0&&W.groupgap===0?h.round(Math.round(ti)-gr,2):ti}function Qe(ti,gr,Kt){return Kt&&ti===gr?ti:Math.abs(ti-gr)>=2?Ot(ti):ti>gr?Math.ceil(ti):Math.floor(ti)}var ct=e.opacity(zr),Ue=ct<1||ln>.01?Ot:Qe;oe._context.staticPlot||(Yt=Ue(Yt,lr,mt),lr=Ue(lr,Yt,mt),dr=Ue(dr,Nr,!mt),Nr=Ue(Nr,dr,!mt));var Ie=mt?se.c2p:Q.c2p,Pe;_t.s0>0?Pe=_t._sMax:_t.s0<0?Pe=_t._sMin:Pe=_t.s1>0?_t._sMax:_t._sMin;function Be(ti,gr){if(!ti)return 0;var Kt=Math.abs(mt?Nr-dr:lr-Yt),vr=Math.abs(mt?lr-Yt:Nr-dr),_r=Ue(Math.abs(Ie(Pe,!0)-Ie(0,!0))),rn=_t.hasB?Math.min(Kt/2,vr/2):Math.min(Kt/2,_r),gn;if(gr==="%"){var Mn=Math.min(50,ti);gn=Kt*(Mn/100)}else gn=ti;return Ue(Math.max(Math.min(gn,rn),0))}var at=it||We?Be(Fe.cornerradiusvalue,Fe.cornerradiusform):0,ft,Bt,Nt="M"+Yt+","+dr+"V"+Nr+"H"+lr+"V"+dr+"Z",Ht=0;if(at&&_t.s){var or=E(_t.s0)===0||E(_t.s)===E(_t.s0)?_t.s1:_t.s0;if(Ht=Ue(_t.hasB?0:Math.abs(Ie(Pe,!0)-Ie(or,!0))),Ht0?Math.sqrt(Ht*(2*at-Ht)):0,ua=Cr>0?Math.max:Math.min;ft="M"+Yt+","+dr+"V"+(Nr-Yr*Sr)+"H"+ua(lr-(at-Ht)*Cr,Yt)+"A "+at+","+at+" 0 0 "+Tr+" "+lr+","+(Nr-at*Sr-Fn)+"V"+(dr+at*Sr+Fn)+"A "+at+","+at+" 0 0 "+Tr+" "+ua(lr-(at-Ht)*Cr,Yt)+","+(dr+Yr*Sr)+"Z"}else if(_t.hasB)ft="M"+(Yt+at*Cr)+","+dr+"A "+at+","+at+" 0 0 "+Tr+" "+Yt+","+(dr+at*Sr)+"V"+(Nr-at*Sr)+"A "+at+","+at+" 0 0 "+Tr+" "+(Yt+at*Cr)+","+Nr+"H"+(lr-at*Cr)+"A "+at+","+at+" 0 0 "+Tr+" "+lr+","+(Nr-at*Sr)+"V"+(dr+at*Sr)+"A "+at+","+at+" 0 0 "+Tr+" "+(lr-at*Cr)+","+dr+"Z";else{Bt=Math.abs(Nr-dr)+Ht;var ta=Bt0?Math.sqrt(Ht*(2*at-Ht)):0,ma=Sr>0?Math.max:Math.min;ft="M"+(Yt+ta*Cr)+","+dr+"V"+ma(Nr-(at-Ht)*Sr,dr)+"A "+at+","+at+" 0 0 "+Tr+" "+(Yt+at*Cr-va)+","+Nr+"H"+(lr-at*Cr+va)+"A "+at+","+at+" 0 0 "+Tr+" "+(lr-ta*Cr)+","+ma(Nr-(at-Ht)*Sr,dr)+"V"+dr+"Z"}}else ft=Nt}else ft=Nt;var Jn=m(S.ensureSingle(vt,"path"),me,W,ae);if(Jn.style("vector-effect",ie?"none":"non-scaling-stroke").attr("d",isNaN((lr-Yt)*(Nr-dr))||Fr&&oe._context.staticPlot?"M0,0Z":ft).call(t.setClipUrl,ye.layerClipId,oe),!me.uniformtext.mode&&ht){var ja=t.makePointStyleFns(Te);t.singlePointStyle(_t,Jn,Te,ja,oe)}y(oe,ye,vt,le,wt,Yt,lr,dr,Nr,at,Ht,W,ae),ye.layerClipId&&t.hideOutsideRangePoint(_t,vt.select("text"),se,Q,Te.xcalendar,Te.ycalendar)});var Ke=Te.cliponaxis===!1;t.setClipUrl(ue,Ke?null:ye.layerClipId,oe)});r.getComponentMethod("errorbars","plot")(oe,Y,ye,W)}function y(oe,ye,pe,ge,W,ae,se,Q,me,ie,Y,le,ue){var Te=ye.xaxis,Fe=ye.yaxis,Ve=oe._fullLayout,Xe;function We(Bt,Nt,Ht){var or=S.ensureSingle(Bt,"text").text(Nt).attr({class:"bartext bartext-"+Xe,"text-anchor":"middle","data-notex":1}).call(t.font,Ht).call(k.convertToTspans,oe);return or}var it=ge[0].trace,yt=it.orientation==="h",bt=D(Ve,ge,W,Te,Fe);Xe=j(it,W);var mt=le.mode==="stack"||le.mode==="relative",ht=ge[W],qe=!mt||ht._outmost,ze=ht.hasB,Ae=ie&&ie-Y>g;if(!bt||Xe==="none"||(ht.isBlank||ae===se||Q===me)&&(Xe==="auto"||Xe==="inside")){pe.select("text").remove();return}var Ke=Ve.font,_t=s.getBarColor(ge[W],it),wt=s.getInsideTextFont(it,W,Ke,_t),vt=s.getOutsideTextFont(it,W,Ke),$t=it.insidetextanchor||"end",Yt=pe.datum();yt?Te.type==="log"&&Yt.s0<=0&&(Te.range[0]0&&Ot>0,Ue;Ae?ze?Ue=R(Nr-2*ie,Fr,Xr,Ot,yt)||R(Nr,Fr-2*ie,Xr,Ot,yt):yt?Ue=R(Nr-(ie-Y),Fr,Xr,Ot,yt)||R(Nr,Fr-2*(ie-Y),Xr,Ot,yt):Ue=R(Nr,Fr-(ie-Y),Xr,Ot,yt)||R(Nr-2*(ie-Y),Fr,Xr,Ot,yt):Ue=R(Nr,Fr,Xr,Ot,yt),ct&&Ue?Xe="inside":(Xe="outside",ln.remove(),ln=null)}else Xe="inside";if(!ln){Qe=S.ensureUniformFontSize(oe,Xe==="outside"?vt:wt),ln=We(pe,bt,Qe);var Ie=ln.attr("transform");if(ln.attr("transform",""),zr=t.bBox(ln.node()),Xr=zr.width,Ot=zr.height,ln.attr("transform",Ie),Xr<=0||Ot<=0){ln.remove();return}}var Pe=it.textangle,Be,at;Xe==="outside"?(at=it.constraintext==="both"||it.constraintext==="outside",Be=B(ae,se,Q,me,zr,{isHorizontal:yt,constrained:at,angle:Pe})):(at=it.constraintext==="both"||it.constraintext==="inside",Be=N(ae,se,Q,me,zr,{isHorizontal:yt,constrained:at,angle:Pe,anchor:$t,hasB:ze,r:ie,overhead:Y})),Be.fontSize=Qe.size,i(it.type==="histogram"?"bar":it.type,Be,Ve),ht.transform=Be;var ft=m(ln,Ve,le,ue);S.setTransormAndDisplay(ft,Be)}function R(oe,ye,pe,ge,W){if(oe<0||ye<0)return!1;var ae=pe<=oe&&ge<=ye,se=pe<=ye&&ge<=oe,Q=W?oe>=pe*(ye/ge):ye>=ge*(oe/pe);return ae||se||Q}function L(oe){return oe==="auto"?0:oe}function z(oe,ye){var pe=Math.PI/180*ye,ge=Math.abs(Math.sin(pe)),W=Math.abs(Math.cos(pe));return{x:oe.width*W+oe.height*ge,y:oe.width*ge+oe.height*W}}function N(oe,ye,pe,ge,W,ae){var se=!!ae.isHorizontal,Q=!!ae.constrained,me=ae.angle||0,ie=ae.anchor,Y=ie==="end",le=ie==="start",ue=ae.leftToRight||0,Te=(ue+1)/2,Fe=1-Te,Ve=ae.hasB,Xe=ae.r,We=ae.overhead,it=W.width,yt=W.height,bt=Math.abs(ye-oe),mt=Math.abs(ge-pe),ht=bt>2*g&&mt>2*g?g:0;bt-=2*ht,mt-=2*ht;var qe=L(me);me==="auto"&&!(it<=bt&&yt<=mt)&&(it>bt||yt>mt)&&(!(it>mt||yt>bt)||itg){var _t=U(oe,ye,pe,ge,ze,Xe,We,se,Ve);Ae=_t.scale,Ke=_t.pad}else Ae=1,Q&&(Ae=Math.min(1,bt/ze.x,mt/ze.y)),Ke=0;var wt=W.left*Fe+W.right*Te,vt=(W.top+W.bottom)/2,$t=(oe+g)*Fe+(ye-g)*Te,Yt=(pe+ge)/2,lr=0,dr=0;if(le||Y){var Nr=(se?ze.x:ze.y)/2;Xe&&(Y||Ve)&&(ht+=Ke);var Fr=se?_(oe,ye):_(pe,ge);se?le?($t=oe+Fr*ht,lr=-Fr*Nr):($t=ye-Fr*ht,lr=Fr*Nr):le?(Yt=pe+Fr*ht,dr=-Fr*Nr):(Yt=ge-Fr*ht,dr=Fr*Nr)}return{textX:wt,textY:vt,targetX:$t,targetY:Yt,anchorX:lr,anchorY:dr,scale:Ae,rotate:qe}}function U(oe,ye,pe,ge,W,ae,se,Q,me){var ie=Math.max(0,Math.abs(ye-oe)-2*g),Y=Math.max(0,Math.abs(ge-pe)-2*g),le=ae-g,ue=se?le-Math.sqrt(le*le-(le-se)*(le-se)):le,Te=me?le*2:Q?le-se:2*ue,Fe=me?le*2:Q?2*ue:le-se,Ve,Xe,We,it,yt;return W.y/W.x>=Y/(ie-Te)?it=Y/W.y:W.y/W.x<=(Y-Fe)/ie?it=ie/W.x:!me&&Q?(Ve=W.x*W.x+W.y*W.y/4,Xe=-2*W.x*(ie-le)-W.y*(Y/2-le),We=(ie-le)*(ie-le)+(Y/2-le)*(Y/2-le)-le*le,it=(-Xe+Math.sqrt(Xe*Xe-4*Ve*We))/(2*Ve)):me?(Ve=(W.x*W.x+W.y*W.y)/4,Xe=-W.x*(ie/2-le)-W.y*(Y/2-le),We=(ie/2-le)*(ie/2-le)+(Y/2-le)*(Y/2-le)-le*le,it=(-Xe+Math.sqrt(Xe*Xe-4*Ve*We))/(2*Ve)):(Ve=W.x*W.x/4+W.y*W.y,Xe=-W.x*(ie/2-le)-2*W.y*(Y-le),We=(ie/2-le)*(ie/2-le)+(Y-le)*(Y-le)-le*le,it=(-Xe+Math.sqrt(Xe*Xe-4*Ve*We))/(2*Ve)),it=Math.min(1,it),Q?yt=Math.max(0,le-Math.sqrt(Math.max(0,le*le-(le-(Y-W.y*it)/2)*(le-(Y-W.y*it)/2)))-se):yt=Math.max(0,le-Math.sqrt(Math.max(0,le*le-(le-(ie-W.x*it)/2)*(le-(ie-W.x*it)/2)))-se),{scale:it,pad:yt}}function B(oe,ye,pe,ge,W,ae){var se=!!ae.isHorizontal,Q=!!ae.constrained,me=ae.angle||0,ie=W.width,Y=W.height,le=Math.abs(ye-oe),ue=Math.abs(ge-pe),Te;se?Te=ue>2*g?g:0:Te=le>2*g?g:0;var Fe=1;Q&&(Fe=se?Math.min(1,ue/Y):Math.min(1,le/ie));var Ve=L(me),Xe=z(W,Ve),We=(se?Xe.x:Xe.y)/2,it=(W.left+W.right)/2,yt=(W.top+W.bottom)/2,bt=(oe+ye)/2,mt=(pe+ge)/2,ht=0,qe=0,ze=se?_(ye,oe):_(pe,ge);return se?(bt=ye-ze*Te,ht=ze*We):(mt=ge+ze*Te,qe=-ze*We),{textX:it,textY:yt,targetX:bt,targetY:mt,anchorX:ht,anchorY:qe,scale:Fe,rotate:Ve}}function D(oe,ye,pe,ge,W){var ae=ye[0].trace,se=ae.texttemplate,Q;return se?Q=q(oe,ye,pe,ge,W):ae.textinfo?Q=J(ye,pe,ge,W):Q=f.getValue(ae.text,pe),f.coerceString(p,Q)}function j(oe,ye){var pe=f.getValue(oe.textposition,ye);return f.coerceEnumerated(T,pe)}function q(oe,ye,pe,ge,W){var ae=ye[0].trace,se=S.castOption(ae,pe,"texttemplate");if(!se)return"";var Q=ae.type==="histogram",me=ae.type==="waterfall",ie=ae.type==="funnel",Y=ae.orientation==="h",le,ue,Te,Fe;Y?(le="y",ue=W,Te="x",Fe=ge):(le="x",ue=ge,Te="y",Fe=W);function Ve(ht){return o(ue,ue.c2l(ht),!0).text}function Xe(ht){return o(Fe,Fe.c2l(ht),!0).text}var We=ye[pe],it={};it.label=We.p,it.labelLabel=it[le+"Label"]=Ve(We.p);var yt=S.castOption(ae,We.i,"text");(yt===0||yt)&&(it.text=yt),it.value=We.s,it.valueLabel=it[Te+"Label"]=Xe(We.s);var bt={};l(bt,ae,We.i),(Q||bt.x===void 0)&&(bt.x=Y?it.value:it.label),(Q||bt.y===void 0)&&(bt.y=Y?it.label:it.value),(Q||bt.xLabel===void 0)&&(bt.xLabel=Y?it.valueLabel:it.labelLabel),(Q||bt.yLabel===void 0)&&(bt.yLabel=Y?it.labelLabel:it.valueLabel),me&&(it.delta=+We.rawS||We.s,it.deltaLabel=Xe(it.delta),it.final=We.v,it.finalLabel=Xe(it.final),it.initial=it.final-it.delta,it.initialLabel=Xe(it.initial)),ie&&(it.value=We.s,it.valueLabel=Xe(it.value),it.percentInitial=We.begR,it.percentInitialLabel=S.formatPercent(We.begR),it.percentPrevious=We.difR,it.percentPreviousLabel=S.formatPercent(We.difR),it.percentTotal=We.sumR,it.percenTotalLabel=S.formatPercent(We.sumR));var mt=S.castOption(ae,We.i,"customdata");return mt&&(it.customdata=mt),S.texttemplateString({data:[bt,it,ae._meta],fallback:ae.texttemplatefallback,labels:it,locale:oe._d3locale,template:se})}function J(oe,ye,pe,ge){var W=oe[0].trace,ae=W.orientation==="h",se=W.type==="waterfall",Q=W.type==="funnel";function me(mt){var ht=ae?ge:pe;return o(ht,mt,!0).text}function ie(mt){var ht=ae?pe:ge;return o(ht,+mt,!0).text}var Y=W.textinfo,le=oe[ye],ue=Y.split("+"),Te=[],Fe,Ve=function(mt){return ue.indexOf(mt)!==-1};if(Ve("label")&&Te.push(me(oe[ye].p)),Ve("text")&&(Fe=S.castOption(W,le.i,"text"),(Fe===0||Fe)&&Te.push(Fe)),se){var Xe=+le.rawS||le.s,We=le.v,it=We-Xe;Ve("initial")&&Te.push(ie(it)),Ve("delta")&&Te.push(ie(Xe)),Ve("final")&&Te.push(ie(We))}if(Q){Ve("value")&&Te.push(ie(le.s));var yt=0;Ve("percent initial")&&yt++,Ve("percent previous")&&yt++,Ve("percent total")&&yt++;var bt=yt>1;Ve("percent initial")&&(Fe=S.formatPercent(le.begR),bt&&(Fe+=" of initial"),Te.push(Fe)),Ve("percent previous")&&(Fe=S.formatPercent(le.difR),bt&&(Fe+=" of previous"),Te.push(Fe)),Ve("percent total")&&(Fe=S.formatPercent(le.sumR),bt&&(Fe+=" of total"),Te.push(Fe))}return Te.join("
")}X.exports={plot:d,toMoveInsideBar:N}}}),_g=_e({"src/traces/bar/hover.js"(ee,X){var h=zf(),x=bi(),S=so(),k=kn().fillText,e=U_().getLineWidth,t=xs().hoverLabelText,r=qn().BADNUM;function o(a,s,f,c,v){var p=n(a,s,f,c,v);if(p){var T=p.cd,l=T[0].trace,g=T[p.index];return p.color=i(l,g),x.getComponentMethod("errorbars","hoverInfo")(g,l,p),[p]}}function n(a,s,f,c,v){var p=a.cd,T=p[0].trace,l=p[0].t,g=c==="closest",b=T.type==="waterfall",A=a.maxHoverDistance,E=a.maxSpikeDistance,_,w,m,u,d,y,R;T.orientation==="h"?(_=f,w=s,m="y",u="x",d=ge,y=oe):(_=s,w=f,m="x",u="y",y=ge,d=oe);var L=T[m+"period"],z=g||L;function N(Fe){return B(Fe,-1)}function U(Fe){return B(Fe,1)}function B(Fe,Ve){var Xe=Fe.w;return Fe[m]+Ve*Xe/2}function D(Fe){return Fe[m+"End"]-Fe[m+"Start"]}var j=g?N:L?function(Fe){return Fe.p-D(Fe)/2}:function(Fe){return Math.min(N(Fe),Fe.p-l.bardelta/2)},q=g?U:L?function(Fe){return Fe.p+D(Fe)/2}:function(Fe){return Math.max(U(Fe),Fe.p+l.bardelta/2)};function J(Fe,Ve,Xe){return v.finiteRange&&(Xe=0),h.inbox(Fe-_,Ve-_,Xe+Math.min(1,Math.abs(Ve-Fe)/R)-1)}function oe(Fe){return J(j(Fe),q(Fe),A)}function ye(Fe){return J(N(Fe),U(Fe),E)}function pe(Fe){var Ve=Fe[u];if(b){var Xe=Math.abs(Fe.rawS)||0;w>0?Ve+=Xe:w<0&&(Ve-=Xe)}return Ve}function ge(Fe){var Ve=w,Xe=Fe.b,We=pe(Fe);return h.inbox(Xe-Ve,We-Ve,A+(We-Ve)/(We-Xe)-1)}function W(Fe){var Ve=w,Xe=Fe.b,We=pe(Fe);return h.inbox(Xe-Ve,We-Ve,E+(We-Ve)/(We-Xe)-1)}var ae=a[m+"a"],se=a[u+"a"];R=Math.abs(ae.r2c(ae.range[1])-ae.r2c(ae.range[0]));function Q(Fe){return(d(Fe)+y(Fe))/2}var me=h.getDistanceFunction(c,d,y,Q);if(h.getClosest(p,me,a),a.index!==!1&&p[a.index].p!==r){z||(j=function(Fe){return Math.min(N(Fe),Fe.p-l.bargroupwidth/2)},q=function(Fe){return Math.max(U(Fe),Fe.p+l.bargroupwidth/2)});var ie=a.index,Y=p[ie],le=T.base?Y.b+Y.s:Y.s;a[u+"0"]=a[u+"1"]=se.c2p(Y[u],!0),a[u+"LabelVal"]=le;var ue=l.extents[l.extents.round(Y.p)];a[m+"0"]=ae.c2p(g?j(Y):ue[0],!0),a[m+"1"]=ae.c2p(g?q(Y):ue[1],!0);var Te=Y.orig_p!==void 0;return a[m+"LabelVal"]=Te?Y.orig_p:Y.p,a.labelLabel=t(ae,a[m+"LabelVal"],T[m+"hoverformat"]),a.valueLabel=t(se,a[u+"LabelVal"],T[u+"hoverformat"]),a.baseLabel=t(se,Y.b,T[u+"hoverformat"]),a.spikeDistance=(W(Y)+ye(Y))/2,a[m+"Spike"]=ae.c2p(Y.p,!0),k(Y,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,v=e(a,s);if(S.opacity(f))return f;if(S.opacity(c)&&v)return c}X.exports={hoverPoints:o,hoverOnBars:n,getTraceColor:i}}}),RE=_e({"src/traces/bar/event_data.js"(ee,X){X.exports=function(x,S,k){return x.x="xVal"in S?S.xVal:S.x,x.y="yVal"in S?S.yVal:S.y,S.xa&&(x.xaxis=S.xa),S.ya&&(x.yaxis=S.ya),k.orientation==="h"?(x.label=x.y,x.value=x.x):(x.label=x.x,x.value=x.y),x}}}),bg=_e({"src/traces/bar/select.js"(ee,X){X.exports=function(S,k){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(k===!1)for(s=0;s0?(L="v",m>0?z=Math.min(d,u):z=Math.min(u)):m>0?(L="h",z=Math.min(d)):z=0;if(!z){f.visible=!1;return}f._length=z;var j=c("orientation",L);f._hasPreCompStats?j==="v"&&m===0?(c("x0",0),c("dx",1)):j==="h"&&w===0&&(c("y0",0),c("dy",1)):j==="v"&&m===0?c("x0"):j==="h"&&w===0&&c("y0");var q=x.getComponentMethod("calendars","handleTraceDefaults");q(s,f,["x","y"],v)}function i(s,f,c,v){var p=v.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 b=c(p+"points",g);b?(c("jitter",b==="all"?.3:0),c("pointpos",b==="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"),b==="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,v;function p(b){return h.coerce(v._input,v,r,b)}for(var T=0;Tpe.uf};if(E._hasPreCompStats){var ie=E[z],Y=function(Fr){return L.d2c((E[Fr]||[])[y])},le=1/0,ue=-1/0;for(y=0;y=pe.q1&&pe.q3>=pe.med){var Fe=Y("lowerfence");pe.lf=Fe!==e&&Fe<=pe.q1?Fe:v(pe,W,ae);var Ve=Y("upperfence");pe.uf=Ve!==e&&Ve>=pe.q3?Ve:p(pe,W,ae);var Xe=Y("mean");pe.mean=Xe!==e?Xe:ae?k.mean(W,ae):(pe.q1+pe.q3)/2;var We=Y("sd");pe.sd=Xe!==e&&We>=0?We:ae?k.stdev(W,ae,pe.mean):pe.q3-pe.q1,pe.lo=T(pe),pe.uo=l(pe);var it=Y("notchspan");it=it!==e&&it>0?it:g(pe,ae),pe.ln=pe.med-it,pe.un=pe.med+it;var yt=pe.lf,bt=pe.uf;E.boxpoints&&W.length&&(yt=Math.min(yt,W[0]),bt=Math.max(bt,W[ae-1])),E.notched&&(yt=Math.min(yt,pe.ln),bt=Math.max(bt,pe.un)),pe.min=yt,pe.max=bt}else{k.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+pe.q1,"median = "+pe.med,"q3 = "+pe.q3].join(` `));var mt;pe.med!==e?mt=pe.med:pe.q1!==e?pe.q3!==e?mt=(pe.q1+pe.q3)/2:mt=pe.q1:pe.q3!==e?mt=pe.q3:mt=0,pe.med=mt,pe.q1=pe.q3=mt,pe.lf=pe.uf=mt,pe.mean=pe.sd=mt,pe.ln=pe.un=mt,pe.min=pe.max=mt}le=Math.min(le,pe.min),ue=Math.max(ue,pe.max),pe.pts2=ge.filter(me),u.push(pe)}}E._extremes[L._id]=x.findExtremes(L,[le,ue],{padded:!0})}else{var ht=L.makeCalcdata(E,z),qe=o(oe,ye),ze=oe.length,Ae=n(ze);for(y=0;y=0&&Ke0){if(pe={},pe.pos=pe[U]=oe[y],ge=pe.pts=Ae[y].sort(f),W=pe[z]=ge.map(c),ae=W.length,pe.min=W[0],pe.max=W[ae-1],pe.mean=k.mean(W,ae),pe.sd=k.stdev(W,ae,pe.mean)*E.sdmultiple,pe.med=k.interp(W,.5),ae%2&&($t||Yt)){var lr,dr;$t?(lr=W.slice(0,ae/2),dr=W.slice(ae/2+1)):Yt&&(lr=W.slice(0,ae/2+1),dr=W.slice(ae/2)),pe.q1=k.interp(lr,.5),pe.q3=k.interp(dr,.5)}else pe.q1=k.interp(W,.25),pe.q3=k.interp(W,.75);pe.lf=v(pe,W,ae),pe.uf=p(pe,W,ae),pe.lo=T(pe),pe.uo=l(pe);var Nr=g(pe,ae);pe.ln=pe.med-Nr,pe.un=pe.med+Nr,_t=Math.min(_t,pe.ln),wt=Math.max(wt,pe.un),pe.pts2=ge.filter(me),u.push(pe)}E.notched&&k.isTypedArray(ht)&&(ht=Array.from(ht)),E._extremes[L._id]=x.findExtremes(L,E.notched?ht.concat([_t,wt]):ht,{padded:!0})}return s(u,E),u.length>0?(u[0].t={num:_[d],dPos:ye,posLetter:U,valLetter:z,labels:{med:t(A,"median:"),min:t(A,"min:"),q1:t(A,"q1:"),q3:t(A,"q3:"),max:t(A,"max:"),mean:E.boxmean==="sd"||E.sizemode==="sd"?t(A,"mean ± σ:").replace("σ",E.sdmultiple===1?"σ":E.sdmultiple+"σ"):t(A,"mean:"),lf:t(A,"lower fence:"),uf:t(A,"upper fence:")}},_[d]++,u):[{t:{empty:!0}}]};function r(b,A,E,_){var w=A in b,m=A+"0"in b,u="d"+A in b;if(w||m&&u){var d=E.makeCalcdata(b,A),y=S(b,E,A,d).vals;return[y,d]}var R;m?R=b[A+"0"]:"name"in b&&(E.type==="category"||h(b.name)&&["linear","log"].indexOf(E.type)!==-1||k.isDateTime(b.name)&&E.type==="date")?R=b.name:R=_;for(var L=E.type==="multicategory"?E.r2c_just_indices(R):E.d2c(R,0,b[A+"calendar"]),z=b._length,N=new Array(z),U=0;U1,m=1-s[r+"gap"],u=1-s[r+"groupgap"];for(v=0;v0;if(L==="positive"?(pe=z*(R?1:.5),ae=W,ge=ae=U):L==="negative"?(pe=ae=U,ge=z*(R?1:.5),se=W):(pe=ge=z,ae=se=W),ue){var Te=d.pointpos,Fe=d.jitter,Ve=d.marker.size/2,Xe=0;Te+Fe>=0&&(Xe=W*(Te+Fe),Xe>pe?(le=!0,ie=Ve,Q=Xe):Xe>ae&&(ie=Ve,Q=pe)),Xe<=pe&&(Q=pe);var We=0;Te-Fe<=0&&(We=-W*(Te-Fe),We>ge?(le=!0,Y=Ve,me=We):We>se&&(Y=Ve,me=ge)),We<=ge&&(me=ge)}else Q=pe,me=ge;var it=new Array(T.length);for(p=0;pE.lo&&(j.so=!0)}return w});A.enter().append("path").classed("point",!0),A.exit().remove(),A.call(S.translatePoints,c,v)}function n(i,a,s,f){var c=a.val,v=a.pos,p=!!v.rangebreaks,T=f.bPos,l=f.bPosPxOffset||0,g=s.boxmean||(s.meanline||{}).visible,b,A;Array.isArray(f.bdPos)?(b=f.bdPos[0],A=f.bdPos[1]):(b=f.bdPos,A=f.bdPos);var E=i.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?x.identity:[]);E.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),E.exit().remove(),E.each(function(_){var w=v.c2l(_.pos+T,!0),m=v.l2p(w-b)+l,u=v.l2p(w+A)+l,d=p?(m+u)/2:v.l2p(w)+l,y=c.c2p(_.mean,!0),R=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"+R+","+d+"L"+y+","+m+"L"+L+","+d+"Z":"")):h.select(this).attr("d","M"+m+","+y+"H"+u+(g==="sd"?"m0,0L"+d+","+R+"L"+m+","+y+"L"+d+","+L+"Z":""))})}X.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:o,plotBoxMean:n}}}),G_=_e({"src/traces/box/style.js"(ee,X){var h=mr(),x=so(),S=ri();function k(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,b){T.style("stroke-width",l+"px").call(x.stroke,g).call(x.fill,b)}var v=a.selectAll("path.box");if(s.type==="candlestick")v.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(v,f,s.line.color,s.fillcolor),a.selectAll("path.mean").style({"stroke-width":f,"stroke-dasharray":2*f+"px,"+f+"px"}).call(x.stroke,s.line.color);var p=a.selectAll("path.point");S.pointStyle(p,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)}X.exports={style:k,styleOnSelect:e}}}),s2=_e({"src/traces/box/hover.js"(ee,X){var h=xs(),x=kn(),S=zf(),k=so(),e=x.fillText;function t(n,i,a,s){var f=n.cd,c=f[0].trace,v=c.hoveron,p=[],T;return v.indexOf("boxes")!==-1&&(p=p.concat(r(n,i,a,s))),v.indexOf("points")!==-1&&(T=o(n,i,a)),s==="closest"?T?[T]:p:(T&&p.push(T),p)}function r(n,i,a,s){var f=n.cd,c=n.xa,v=n.ya,p=f[0].trace,T=f[0].t,l=p.type==="violin",g,b,A,E,_,w,m,u,d,y,R,L=T.bdPos,z,N,U=T.wHover,B=function(We){return A.c2l(We.pos)+T.bPos-A.c2l(w)};l&&p.side!=="both"?(p.side==="positive"&&(d=function(We){var it=B(We);return S.inbox(it,it+U,y)},z=L,N=0),p.side==="negative"&&(d=function(We){var it=B(We);return S.inbox(it-U,it,y)},z=0,N=L)):(d=function(We){var it=B(We);return S.inbox(it-U,it+U,y)},z=N=L);var D;l?D=function(We){return S.inbox(We.span[0]-_,We.span[1]-_,y)}:D=function(We){return S.inbox(We.min-_,We.max-_,y)},p.orientation==="h"?(_=i,w=a,m=D,u=d,g="y",A=v,b="x",E=c):(_=a,w=i,m=d,u=D,g="x",A=c,b="y",E=v);var j=Math.min(1,L/Math.abs(A.r2c(A.range[1])-A.r2c(A.range[0])));y=n.maxHoverDistance-j,R=n.maxSpikeDistance-j;function q(We){return(m(We)+u(We))/2}var J=S.getDistanceFunction(s,m,u,q);if(S.getClosest(f,J,n),n.index===!1)return[];var oe=f[n.index],ye=p.line.color,pe=(p.marker||{}).color;k.opacity(ye)&&p.line.width?n.color=ye:k.opacity(pe)&&p.boxpoints?n.color=pe:n.color=p.fillcolor,n[g+"0"]=A.c2p(oe.pos+T.bPos-N,!0),n[g+"1"]=A.c2p(oe.pos+T.bPos+z,!0),n[g+"LabelVal"]=oe.orig_p!==void 0?oe.orig_p:oe.pos;var ge=g+"Spike";n.spikeDistance=q(oe)*R/y,n[ge]=A.c2p(oe.pos,!0);var W=p.boxmean||p.sizemode==="sd"||(p.meanline||{}).visible,ae=p.boxpoints||p.points,se=ae&&W?["max","uf","q3","med","mean","q1","lf","min"]:ae&&!W?["max","uf","q3","med","q1","lf","min"]:!ae&&W?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],Q=E.range[1]0&&(o=!0);for(var s=0;st){var r=t-k[x];return k[x]=t,r}}else return k[x]=t,t;return 0},max:function(x,S,k,e){var t=e[S];if(h(t))if(t=Number(t),h(k[x])){if(k[x]m&&mk){var y=u===x?1:6,R=u===x?"M12":"M1";return function(L,z){var N=T.c2d(L,x,l),U=N.indexOf("-",y);U>0&&(N=N.slice(0,U));var B=T.d2c(N,0,l);if(Br?f>k?f>x*1.1?x:f>S*1.1?S:k:f>e?e:f>t?t:r:Math.pow(10,Math.floor(Math.log(f)/Math.LN10))}function a(f,c,v,p,T,l){if(p&&f>k){var g=s(c,T,l),b=s(v,T,l),A=f===x?0:1;return g[A]!==b[A]}return Math.floor(v/f)-Math.floor(c/f)>.1}function s(f,c,v){var p=c.c2d(f,x,v).split("-");return p[0]===""&&(p.unshift(),p[0]="-"+p[0]),p}}}),p2=_e({"src/traces/histogram/calc.js"(ee,X){var h=jn(),x=kn(),S=bi(),k=xs(),{hasColorscale:e}=ed(),t=ko(),r=Dy(),o=c2(),n=f2(),i=h2(),a=d2();function s(T,l){var g=[],b=[],A=l.orientation==="h",E=k.getFromId(T,A?l.yaxis:l.xaxis),_=A?"y":"x",w={x:"y",y:"x"}[_],m=l[_+"calendar"],u=l.cumulative,d,y=f(T,l,E,_),R=y[0],L=y[1],z=typeof R.size=="string",N=[],U=z?N:R,B=[],D=[],j=[],q=0,J=l.histnorm,oe=l.histfunc,ye=J.indexOf("density")!==-1,pe,ge,W;u.enabled&&ye&&(J=J.replace(/ ?density$/,""),ye=!1);var ae=oe==="max"||oe==="min",se=ae?null:0,Q=o.count,me=n[J],ie=!1,Y=function(Ke){return E.r2c(Ke,0,m)},le;for(x.isArrayOrTypedArray(l[w])&&oe!=="count"&&(le=l[w],ie=oe==="avg",Q=o[oe]),d=Y(R.start),ge=Y(R.end)+(d-k.tickIncrement(d,R.size,!1,m))/1e6;d=0&&W=qe;d--)if(b[d]){ze=d;break}for(d=qe;d<=ze;d++)if(h(g[d])&&h(b[d])){var Ae={p:g[d],s:b[d],b:0};u.enabled||(Ae.pts=j[d],Ve?Ae.ph0=Ae.ph1=j[d].length?L[j[d][0]]:g[d]:(l._computePh=!0,Ae.ph0=bt(N[d]),Ae.ph1=bt(N[d+1],!0))),ht.push(Ae)}return ht.length===1&&(ht[0].width1=k.tickIncrement(ht[0].p,R.size,!1,m)-ht[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(ht,l),x.isArrayOrTypedArray(l.selectedpoints)&&x.tagSelected(ht,l,it),ht}function f(T,l,g,b,A){var E=b+"bins",_=T._fullLayout,w=l["_"+b+"bingroup"],m=_._histogramBinOpts[w],u=_.barmode==="overlay",d,y,R,L,z,N,U,B=function(yt){return g.r2c(yt,0,L)},D=function(yt){return g.c2r(yt,0,L)},j=g.type==="date"?function(yt){return yt||yt===0?x.cleanDate(yt,null,L):null}:function(yt){return h(yt)?Number(yt):null};function q(yt,bt,mt){bt[yt+"Found"]?(bt[yt]=j(bt[yt]),bt[yt]===null&&(bt[yt]=mt[yt])):(N[yt]=bt[yt]=mt[yt],x.nestedProperty(y[0],E+"."+yt).set(mt[yt]))}if(l["_"+b+"autoBinFinished"])delete l["_"+b+"autoBinFinished"];else{y=m.traces;var J=[],oe=!0,ye=!1,pe=!1;for(d=0;d"u"){if(A)return[W,z,!0];W=c(T,l,g,b,E)}U=R.cumulative||{},U.enabled&&U.currentbin!=="include"&&(U.direction==="decreasing"?W.start=D(k.tickIncrement(B(W.start),W.size,!0,L)):W.end=D(k.tickIncrement(B(W.end),W.size,!1,L))),m.size=W.size,m.sizeFound||(N.size=W.size,x.nestedProperty(y[0],E+".size").set(W.size)),q("start",m,W),q("end",m,W)}z=l["_"+b+"pos0"],delete l["_"+b+"pos0"];var se=l._input[E]||{},Q=x.extendFlat({},m),me=m.start,ie=g.r2l(se.start),Y=ie!==void 0;if((m.startFound||Y)&&ie!==g.r2l(me)){var le=Y?ie:x.aggNums(Math.min,null,z),ue={type:g.type==="category"||g.type==="multicategory"?"linear":g.type,r2l:g.r2l,dtick:m.size,tick0:me,calendar:L,range:[le,k.tickIncrement(le,m.size,!1,L)].map(g.l2r)},Te=k.tickFirst(ue);Te>g.r2l(le)&&(Te=k.tickIncrement(Te,m.size,!0,L)),Q.start=g.l2r(Te),Y||x.nestedProperty(l,E+".start").set(Q.start)}var Fe=m.end,Ve=g.r2l(se.end),Xe=Ve!==void 0;if((m.endFound||Xe)&&Ve!==g.r2l(Fe)){var We=Xe?Ve:x.aggNums(Math.max,null,z);Q.end=g.l2r(We),Xe||x.nestedProperty(l,E+".start").set(Q.end)}var it="autobin"+b;return l._input[it]===!1&&(l._input[E]=x.extendFlat({},l[E]||{}),delete l._input[it],delete l[it]),[Q,z]}function c(T,l,g,b,A){var E=T._fullLayout,_=v(T,l),w=!1,m=1/0,u=[l],d,y,R;for(d=0;d<_.length;d++)if(y=_[d],y===l)w=!0;else if(!w)R=E._histogramBinOpts[y["_"+b+"bingroup"]],m=Math.min(m,R.size||y[A].size);else{var L=f(T,y,g,b,!0),z=L[0],N=L[2];y["_"+b+"autoBinFinished"]=1,y["_"+b+"pos0"]=L[1],N?u.push(y):m=Math.min(m,z.size)}var U=new Array(u.length);for(d=0;d=0;b--)w(b);else if(l==="increasing"){for(b=1;b=0;b--)T[b]+=T[b+1];g==="exclude"&&(T.push(0),T.shift())}}X.exports={calc:s,calcAllAutoBins:f}}}),jE=_e({"src/traces/histogram2d/calc.js"(ee,X){var h=kn(),x=xs(),S=c2(),k=f2(),e=h2(),t=d2(),r=p2().calcAllAutoBins;X.exports=function(s,f){var c=x.getFromId(s,f.xaxis),v=x.getFromId(s,f.yaxis),p=f.xcalendar,T=f.ycalendar,l=function(Qe){return c.r2c(Qe,0,p)},g=function(Qe){return v.r2c(Qe,0,T)},b=function(Qe){return c.c2r(Qe,0,p)},A=function(Qe){return v.c2r(Qe,0,T)},E,_,w,m,u=r(s,f,c,"x"),d=u[0],y=u[1],R=r(s,f,v,"y"),L=R[0],z=R[1],N=f._length;y.length>N&&y.splice(N,y.length-N),z.length>N&&z.splice(N,z.length-N);var U=[],B=[],D=[],j=typeof d.size=="string",q=typeof L.size=="string",J=[],oe=[],ye=j?J:d,pe=q?oe:L,ge=0,W=[],ae=[],se=f.histnorm,Q=f.histfunc,me=se.indexOf("density")!==-1,ie=Q==="max"||Q==="min",Y=ie?null:0,le=S.count,ue=k[se],Te=!1,Fe=[],Ve=[],Xe="z"in f?f.z:"marker"in f&&Array.isArray(f.marker.color)?f.marker.color:"";Xe&&Q!=="count"&&(Te=Q==="avg",le=S[Q]);var We=d.size,it=l(d.start),yt=l(d.end)+(it-x.tickIncrement(it,We,!1,p))/1e6;for(E=it;E=0&&w=0&&m<_t&&(ge+=le(w,E,U[m],Xe,W[m]),ae[m][w].push(E),$t&&(lr[w]===void 0?lr[w]=Xr:lr[w]!==Xr&&($t=!1)),Yt&&(dr[m]===void 0?dr[m]=Ot:dr[m]!==Ot&&(Yt=!1)),Nr=Math.min(Nr,Xr-J[w]),Fr=Math.min(Fr,J[w+1]-Xr),ln=Math.min(ln,Ot-oe[m]),zr=Math.min(zr,oe[m+1]-Ot))}if(Te)for(m=0;m<_t;m++)ge+=e(U[m],W[m]);if(ue)for(m=0;m<_t;m++)ue(U[m],ge,Fe,Ve[m]);return{x:y,xRanges:i(J,$t&&lr,Nr,Fr,c,p),x0:ht,dx:mt,y:z,yRanges:i(oe,Yt&&dr,ln,zr,v,T),y0:vt,dy:wt,z:U,pts:ae}};function o(a,s,f,c){var v=new Array(a),p;if(c)for(p=0;px;i++)n=e(r,o,k(n));return n>x&&h.log("interp2d didn't converge quickly",n),r};function e(t,r,o){var n=0,i,a,s,f,c,v,p,T,l,g,b,A,E;for(f=0;fA&&(n=Math.max(n,Math.abs(t[a][s]-b)/(E-A))))}return n}}}),X_=_e({"src/traces/heatmap/find_empties.js"(ee,X){var h=kn().maxRowLength;X.exports=function(S){var k=[],e={},t=[],r=S[0],o=[],n=[0,0,0],i=h(S),a,s,f,c,v,p,T,l;for(s=0;s=0;v--)c=t[v],s=c[0],f=c[1],p=((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,p&&(T[c]=[s,f,p],t.splice(v,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(c in T)e[c]=T[c],k.push(T[c])}return k.sort(function(g,b){return b[2]-g[2]})}}}),v2=_e({"src/traces/heatmap/make_bound_array.js"(ee,X){var h=bi(),x=kn().isArrayOrTypedArray;X.exports=function(k,e,t,r,o,n){var i=[],a=h.traceIs(k,"contour"),s=h.traceIs(k,"histogram"),f,c,v,p=x(e)&&e.length>1;if(p&&!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)],v=1;v1){var se=(ae[ae.length-1]-ae[0])/(ae.length-1),Q=Math.abs(se/100);for(N=0;NQ)return!1}return!0}T._islinear=!1,l.type==="log"||g.type==="log"?E==="fast"&&D("log axis found"):j(_)?j(d)?T._islinear=!0:E==="fast"&&D("y scale is not linear"):E==="fast"&&D("x scale is not linear");var q=x.maxRowLength(z),J=T.xtype==="scaled"?"":_,oe=a(T,J,w,m,q,l),ye=T.ytype==="scaled"?"":d,pe=a(T,ye,y,R,z.length,g);T._extremes[l._id]=S.findExtremes(l,oe),T._extremes[g._id]=S.findExtremes(g,pe);var ge={x:oe,y:pe,z,text:T._text||T.text,hovertext:T._hovertext||T.hovertext};if(T.xperiodalignment&&u&&(ge.orig_x=u),T.yperiodalignment&&L&&(ge.orig_y=L),J&&J.length===oe.length-1&&(ge.xCenter=J),ye&&ye.length===pe.length-1&&(ge.yCenter=ye),A&&(ge.xRanges=U.xRanges,ge.yRanges=U.yRanges,ge.pts=U.pts),b||t(p,T,{vals:z,cLetter:"z"}),b&&T.contours&&T.contours.coloring==="heatmap"){var W={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};ge.xfill=a(W,J,w,m,q,l),ge.yfill=a(W,ye,y,R,z.length,g)}return[ge]};function f(v){for(var p=[],T=v.length,l=0;l0;)me=d.c2p(j[ue]),ue--;for(me0;)le=y.c2p(q[ue]),ue--;le=d._length||me<=0||Y>=y._length||le<=0;if(yt){var bt=L.selectAll("image").data([]);bt.exit().remove(),g(L);return}var mt,ht;Ve==="fast"?(mt=W,ht=ge):(mt=We,ht=it);var qe=document.createElement("canvas");qe.width=mt,qe.height=ht;var ze=qe.getContext("2d",{willReadFrequently:!0}),Ae=a(N,{noNumericCheck:!0,returnArray:!0}),Ke,_t;Ve==="fast"?(Ke=ae?function($n){return W-1-$n}:t.identity,_t=se?function($n){return ge-1-$n}:t.identity):(Ke=function($n){return t.constrain(Math.round(d.c2p(j[$n])-Q),0,We)},_t=function($n){return t.constrain(Math.round(y.c2p(q[$n])-Y),0,it)});var wt=_t(0),vt=[wt,wt],$t=ae?0:1,Yt=se?0:1,lr=0,dr=0,Nr=0,Fr=0,ln,zr,Xr,Ot,Qe;function ct($n,ki){if($n!==void 0){var Ua=Ae($n);return Ua[0]=Math.round(Ua[0]),Ua[1]=Math.round(Ua[1]),Ua[2]=Math.round(Ua[2]),lr+=ki,dr+=Ua[0]*ki,Nr+=Ua[1]*ki,Fr+=Ua[2]*ki,Ua}return[0,0,0,0]}function Ue($n,ki,Ua,Fi){var Ji=$n[Ua.bin0];if(Ji===void 0)return ct(void 0,1);var fo=$n[Ua.bin1],co=ki[Ua.bin0],So=ki[Ua.bin1],wi=fo-Ji||0,ts=co-Ji||0,jo;return fo===void 0?So===void 0?jo=0:co===void 0?jo=2*(So-Ji):jo=(2*So-co-Ji)*2/3:So===void 0?co===void 0?jo=0:jo=(2*Ji-fo-co)*2/3:co===void 0?jo=(2*So-fo-Ji)*2/3:jo=So+Ji-fo-co,ct(Ji+Ua.frac*wi+Fi.frac*(ts+Ua.frac*jo))}if(Ve!=="default"){var Ie=0,Pe;try{Pe=new Uint8Array(mt*ht*4)}catch{Pe=new Array(mt*ht*4)}if(Ve==="smooth"){var Be=J||j,at=oe||q,ft=new Array(Be.length),Bt=new Array(at.length),Nt=new Array(We),Ht=J?A:b,or=oe?A:b,Cr,Sr,Tr;for(ue=0;ueCa||Ca>y._length))for(Te=gn;TeDa||Da>d._length)){var Va=o({x:Ma,y:fa},N,_._fullLayout);Va.x=Ma,Va.y=fa;var na=z.z[ue][Te];na===void 0?(Va.z="",Va.zLabel=""):(Va.z=na,Va.zLabel=e.tickText(gr,na,"hover").text);var Mi=z.text&&z.text[ue]&&z.text[ue][Te];(Mi===void 0||Mi===!1)&&(Mi=""),Va.text=Mi;var Oi=t.texttemplateString({data:[Va,N._meta],fallback:N.texttemplatefallback,labels:Va,locale:_._fullLayout._d3locale,template:ja});if(Oi){var Vt=Oi.split("
"),Ct=Vt.length,Br=0;for(Fe=0;Fe=g[0].length||R<0||R>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:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),Ny=_e({"src/traces/contour/attributes.js"(ee,X){var h=xg(),x=Ff(),S=ff(),k=S.axisHoverFormat,e=S.descriptionOnlyNumbers,t=tc(),r=Qf().dash,o=es(),n=po().extendFlat,i=ab(),a=i.COMPARISON_OPS2,s=i.INTERVAL_OPS,f=x.line;X.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:x.xperiod0,yperiod0:x.yperiod0,xperiodalignment:h.xperiodalignment,yperiodalignment:h.yperiodalignment,text:h.text,hovertext:h.hovertext,transpose:h.transpose,xtype:h.xtype,ytype:h.ytype,xhoverformat:k("x"),yhoverformat:k("y"),zhoverformat:k("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:x.zorder},t("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),b2=_e({"src/traces/histogram2dcontour/attributes.js"(ee,X){var h=nb(),x=Ny(),S=tc(),k=ff().axisHoverFormat,e=po().extendFlat;X.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:x.autocontour,ncontours:x.ncontours,contours:x.contours,line:{color:x.line.color,width:e({},x.line.width,{dflt:.5}),dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},xhoverformat:k("x"),yhoverformat:k("y"),zhoverformat:k("z",1),hovertemplate:h.hovertemplate,hovertemplatefallback:h.hovertemplatefallback,texttemplate:x.texttemplate,texttemplatefallback:x.texttemplatefallback,textfont:x.textfont},S("",{cLetter:"z",editTypeOverride:"calc"}))}}),ib=_e({"src/traces/contour/contours_defaults.js"(ee,X){X.exports=function(x,S,k,e){var t=e("contours.start"),r=e("contours.end"),o=t===!1||r===!1,n=k("contours.size"),i;o?i=S.autocontour=!0:i=k("autocontour",!1),(i||!n)&&k("ncontours")}}}),x2=_e({"src/traces/contour/label_defaults.js"(ee,X){var h=kn();X.exports=function(S,k,e,t){t||(t={});var r=S("contours.showlabels");if(r){var o=k.font;h.coerceFont(S,"contours.labelfont",o,{overrideDflt:{color:e}}),S("contours.labelformat")}t.hasHover!==!1&&S("zhoverformat")}}}),ob=_e({"src/traces/contour/style_defaults.js"(ee,X){var h=Oa(),x=x2();X.exports=function(k,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"&&(k.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,h(k,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),x(t,r,a,o)}}}),QE=_e({"src/traces/histogram2dcontour/defaults.js"(ee,X){var h=kn(),x=_2(),S=ib(),k=ob(),e=Fy(),t=b2();X.exports=function(o,n,i,a){function s(c,v){return h.coerce(o,n,t,c,v)}function f(c){return h.coerce2(o,n,t,c)}x(o,n,s,a),n.visible!==!1&&(S(o,n,s,f),k(o,n,s,a),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),s("hovertemplatefallback"),n.contours&&n.contours.coloring==="heatmap"&&e(s,a))}}}),w2=_e({"src/traces/contour/set_contours.js"(ee,X){var h=xs(),x=kn();X.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,n=e.zmax;(e.zauto||o===void 0)&&(o=x.aggNums(Math.min,null,t)),(e.zauto||n===void 0)&&(n=x.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={}),x.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(k,e,t){var r={type:"linear",range:[k,e]};return h.autoTicks(r,(e-k)/(t||15)),r}}}),By=_e({"src/traces/contour/end_plus.js"(ee,X){X.exports=function(x){return x.end+x.size/1e6}}}),T2=_e({"src/traces/contour/calc.js"(ee,X){var h=Ho(),x=Z_(),S=w2(),k=By();X.exports=function(t,r){var o=x(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=k(i),v=i.size||1,p=Math.floor((c-f)/v)+1;isFinite(v)||(v=1,p=1);var T=f-v/2,l=T+p*v;s=[T,l]}else s=n;return h.calc(t,r,{vals:s,cLetter:"z"}),o}}}),Uy=_e({"src/traces/contour/constants.js"(ee,X){X.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}}}}),A2=_e({"src/traces/contour/make_crossings.js"(ee,X){var h=Uy();X.exports=function(k){var e=k[0].z,t=e.length,r=e[0].length,o=t===2||r===2,n,i,a,s,f,c,v,p,T;for(i=0;iS?0:1)+(k[0][1]>S?0:2)+(k[1][1]>S?0:4)+(k[1][0]>S?0:8);if(e===5||e===10){var t=(k[0][0]+k[0][1]+k[1][0]+k[1][1])/4;return S>t?e===5?713:1114:e===5?104:208}return e===15?0:e}}}),S2=_e({"src/traces/contour/find_all_paths.js"(ee,X){var h=kn(),x=Uy();X.exports=function(n,i,a){var s,f,c,v,p;for(i=i||.01,a=a||.01,c=0;c20?(c=x.CHOOSESADDLE[c][(v[0]||v[1])<0?0:1],o.crossings[f]=x.SADDLEREMAINDER[c]):delete o.crossings[f],v=x.NEWDELTA[c],!v){h.log("Found bad marching index:",c,n,o.level);break}p.push(r(o,n,v)),n[0]+=v[0],n[1]+=v[1],f=n.join(","),S(p[p.length-1],p[p.length-2],a,s)&&p.pop();var E=v[0]&&(n[0]<0||n[0]>l-2)||v[1]&&(n[1]<0||n[1]>T-2),_=n[0]===g[0]&&n[1]===g[1]&&v[0]===b[0]&&v[1]===b[1];if(_||i&&E)break;c=o.crossings[f]}A===1e4&&h.log("Infinite loop in contour?");var w=S(p[0],p[p.length-1],a,s),m=0,u=.2*o.smoothing,d=[],y=0,R,L,z,N,U,B,D,j,q,J,oe;for(A=1;A=y;A--)if(R=d[A],R=y&&R+d[L]j&&q--,o.edgepaths[q]=oe.concat(p,J));break}W||(o.edgepaths[j]=p.concat(J))}for(j=0;j20&&n?o===208||o===1114?a=i[0]===0?1:-1:s=i[1]===0?1:-1:x.BOTTOMSTART.indexOf(o)!==-1?s=1:x.LEFTSTART.indexOf(o)!==-1?a=1:x.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,v=o.yaxis;if(i[1]){var p=(o.level-f)/(o.z[s][a+1]-f),T=(p!==1?(1-p)*c.c2l(o.x[a]):0)+(p!==0?p*c.c2l(o.x[a+1]):0);return[c.c2p(c.l2c(T),!0),v.c2p(o.y[s],!0),a+p,s]}else{var l=(o.level-f)/(o.z[s+1][a]-f),g=(l!==1?(1-l)*v.c2l(o.y[s]):0)+(l!==0?l*v.c2l(o.y[s+1]):0);return[c.c2p(o.x[a],!0),v.c2p(v.l2c(g),!0),a,s+l]}}}}),e5=_e({"src/traces/contour/constraint_mapping.js"(ee,X){var h=ab(),x=jn();X.exports={"[]":k("[]"),"][":k("]["),">":e(">"),"<":e("<"),"=":e("=")};function S(t,r){var o=Array.isArray(r),n;function i(a){return x(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 k(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}}}}}),M2=_e({"src/traces/contour/empty_pathinfo.js"(ee,X){var h=kn(),x=e5(),S=By();X.exports=function(e,t,r){for(var o=e.type==="constraint"?x[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}}}),E2=_e({"src/traces/contour/convert_to_constraints.js"(ee,X){var h=kn();X.exports=function(S,k){var e,t,r,o=function(a){return a.reverse()},n=function(a){return a};switch(k){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}}}}),sb=_e({"src/traces/contour/plot.js"(ee){var X=mr(),h=kn(),x=ri(),S=Ho(),k=Au(),e=xs(),t=Sc(),r=J_(),o=A2(),n=S2(),i=M2(),a=E2(),s=k2(),f=Uy(),c=f.LABELOPTIMIZER;ee.plot=function(_,w,m,u){var d=w.xaxis,y=w.yaxis;h.makeTraceGroups(u,m,"contour").each(function(R){var L=X.select(this),z=R[0],N=z.trace,U=z.x,B=z.y,D=N.contours,j=i(D,w,z),q=h.ensureSingle(L,"g","heatmapcoloring"),J=[];D.coloring==="heatmap"&&(J=[R]),r(_,w,J,q),o(j),n(j);var oe=d.c2p(U[0],!0),ye=d.c2p(U[U.length-1],!0),pe=y.c2p(B[0],!0),ge=y.c2p(B[B.length-1],!0),W=[[oe,ge],[ye,ge],[ye,pe],[oe,pe]],ae=j;D.type==="constraint"&&(ae=a(j,D._operation)),v(L,W,D),p(L,ae,W,D),l(L,j,_,z,D),b(L,w,_,z,W)})};function v(E,_,w){var m=h.ensureSingle(E,"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 p(E,_,w,m){var u=m.coloring==="fill"||m.type==="constraint"&&m._operation!=="=",d="M"+w.join("L")+"Z";u&&s(_,m);var y=h.ensureSingle(E,"g","contourfill"),R=y.selectAll("path").data(u?_:[]);R.enter().append("path"),R.exit().remove(),R.each(function(L){var z=(L.prefixBoundary?d:"")+T(L,w);z?X.select(this).attr("d",z).style("stroke","none"):X.select(this).remove()})}function T(E,_){var w="",m=0,u=E.edgepaths.map(function(oe,ye){return ye}),d=!0,y,R,L,z,N,U;function B(oe){return Math.abs(oe[1]-_[0][1])<.01}function D(oe){return Math.abs(oe[1]-_[2][1])<.01}function j(oe){return Math.abs(oe[0]-_[0][0])<.01}function q(oe){return Math.abs(oe[0]-_[2][0])<.01}for(;u.length;){for(U=x.smoothopen(E.edgepaths[m],E.smoothing),w+=d?U:U.replace(/^M/,"L"),u.splice(u.indexOf(m),1),y=E.edgepaths[m][E.edgepaths[m].length-1],z=-1,L=0;L<4;L++){if(!y){h.log("Missing end?",m,E);break}for(B(y)&&!q(y)?R=_[1]:j(y)?R=_[0]:D(y)?R=_[3]:q(y)&&(R=_[2]),N=0;N=0&&(R=J,z=N):Math.abs(y[1]-R[1])<.01?Math.abs(y[1]-J[1])<.01&&(J[0]-y[0])*(R[0]-J[0])>=0&&(R=J,z=N):h.log("endpt to newendpt is not vert. or horz.",y,R,J)}if(y=R,z>=0)break;w+="L"+R}if(z===E.edgepaths.length){h.log("unclosed perimeter path");break}m=z,d=u.indexOf(m)===-1,d&&(m=u[0],w+="Z")}for(m=0;mc.MAXCOST*2)break;B&&(R/=2),y=z-R/2,L=y+R*1.5}if(U<=c.MAXCOST)return N};function g(E,_,w,m){var u=_.width/2,d=_.height/2,y=E.x,R=E.y,L=E.theta,z=Math.cos(L)*u,N=Math.sin(L)*u,U=(y>m.center?m.right-y:y-m.left)/(z+Math.abs(Math.sin(L)*d)),B=(R>m.middle?m.bottom-R:R-m.top)/(Math.abs(N)+Math.cos(L)*d);if(U<1||B<1)return 1/0;var D=c.EDGECOST*(1/(U-1)+1/(B-1));D+=c.ANGLECOST*L*L;for(var j=y-z,q=R-N,J=y+z,oe=R+N,ye=0;ye=b)&&(r<=g&&(r=g),o>=b&&(o=b),i=Math.floor((o-r)/n)+1,a=0),l=0;lg&&(v.unshift(g),p.unshift(p[0])),v[v.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))}}}),n5=_e({"src/traces/contour/defaults.js"(ee,X){var h=kn(),x=H_(),S=Bp(),k=L2(),e=ib(),t=ob(),r=Fy(),o=Ny();X.exports=function(i,a,s,f){function c(l,g){return h.coerce(i,a,o,l,g)}function v(l){return h.coerce2(i,a,o,l)}var p=x(i,a,c,f);if(!p){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?k(i,a,c,f,s):(e(i,a,c,v),t(i,a,c,f)),a.contours&&a.contours.coloring==="heatmap"&&r(c,f),c("zorder")}}}),a5=_e({"src/traces/contour/index.js"(ee,X){X.exports={attributes:Ny(),supplyDefaults:n5(),calc:T2(),plot:sb().plot,style:lb(),colorbar:ub(),hoverPoints:P2(),moduleType:"trace",name:"contour",basePlotModule:Mh(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),i5=_e({"lib/contour.js"(ee,X){X.exports=a5()}}),I2=_e({"src/traces/scatterternary/attributes.js"(ee,X){var{hovertemplateAttrs:h,texttemplateAttrs:x,templatefallbackAttrs:S}=fu(),k=Np(),e=Ff(),t=Zs(),r=tc(),o=Qf().dash,n=po().extendFlat,i=e.marker,a=e.line,s=i.line;X.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:x({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:k(),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()}}}),o5=_e({"src/traces/scatterternary/defaults.js"(ee,X){var h=kn(),x=sv(),S=Ps(),k=lp(),e=yp(),t=pg(),r=_p(),o=Up(),n=I2();X.exports=function(a,s,f,c){function v(E,_){return h.coerce(a,s,n,E,_)}var p=v("a"),T=v("b"),l=v("c"),g;if(p?(g=p.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,v("sum"),v("text"),v("hovertext"),s.hoveron!=="fills"&&(v("hovertemplate"),v("hovertemplatefallback"));var b=g"),o.hovertemplate=c.hovertemplate,r}}}),f5=_e({"src/traces/scatterternary/event_data.js"(ee,X){X.exports=function(x,S,k,e,t){if(S.xa&&(x.xaxis=S.xa),S.ya&&(x.yaxis=S.ya),e[t]){var r=e[t];x.a=r.a,x.b=r.b,x.c=r.c}else x.a=S.a,x.b=S.b,x.c=S.c;return x}}}),h5=_e({"src/plots/ternary/ternary.js"(ee,X){var h=mr(),x=bs(),S=bi(),k=kn(),e=k.strTranslate,t=k._,r=so(),o=ri(),n=Sc(),i=po().extendFlat,a=Fs(),s=xs(),f=Pd(),c=zf(),v=Fp(),p=v.freeMode,T=v.rectMode,l=Su(),g=th().prepSelect,b=th().selectOnClick,A=th().clearOutline,E=th().clearSelectionsCache,_=Sh();function w(D,j){this.id=D.id,this.graphDiv=D.graphDiv,this.init(j),this.makeFramework(j),this.updateFx(j),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}X.exports=w;var m=w.prototype;m.init=function(D){this.container=D._ternarylayer,this.defs=D._defs,this.layoutId=D._uid,this.traceHash={},this.layers={}},m.plot=function(D,j){var q=this,J=j[q.id],oe=j._size;q._hasClipOnAxisFalse=!1;for(var ye=0;yeu*ae?(Te=ae,ue=Te*u):(ue=W,Te=ue/u),Fe=pe*ue/W,Ve=ge*Te/ae,Y=j.l+j.w*oe-ue/2,le=j.t+j.h*(1-ye)-Te/2,q.x0=Y,q.y0=le,q.w=ue,q.h=Te,q.sum=se,q.xaxis={type:"linear",range:[Q+2*ie-se,se-Q-2*me],domain:[oe-Fe/2,oe+Fe/2],_id:"x"},n(q.xaxis,q.graphDiv._fullLayout),q.xaxis.setScale(),q.xaxis.isPtWithinRange=function(Ke){return Ke.a>=q.aaxis.range[0]&&Ke.a<=q.aaxis.range[1]&&Ke.b>=q.baxis.range[1]&&Ke.b<=q.baxis.range[0]&&Ke.c>=q.caxis.range[1]&&Ke.c<=q.caxis.range[0]},q.yaxis={type:"linear",range:[Q,se-me-ie],domain:[ye-Ve/2,ye+Ve/2],_id:"y"},n(q.yaxis,q.graphDiv._fullLayout),q.yaxis.setScale(),q.yaxis.isPtWithinRange=function(){return!0};var Xe=q.yaxis.domain[0],We=q.aaxis=i({},D.aaxis,{range:[Q,se-me-ie],side:"left",tickangle:(+D.aaxis.tickangle||0)-30,domain:[Xe,Xe+Ve*u],anchor:"free",position:0,_id:"y",_length:ue});n(We,q.graphDiv._fullLayout),We.setScale();var it=q.baxis=i({},D.baxis,{range:[se-Q-ie,me],side:"bottom",domain:q.xaxis.domain,anchor:"free",position:0,_id:"x",_length:ue});n(it,q.graphDiv._fullLayout),it.setScale();var yt=q.caxis=i({},D.caxis,{range:[se-Q-me,ie],side:"right",tickangle:(+D.caxis.tickangle||0)+30,domain:[Xe,Xe+Ve*u],anchor:"free",position:0,_id:"y",_length:ue});n(yt,q.graphDiv._fullLayout),yt.setScale();var bt="M"+Y+","+(le+Te)+"h"+ue+"l-"+ue/2+",-"+Te+"Z";q.clipDef.select("path").attr("d",bt),q.layers.plotbg.select("path").attr("d",bt);var mt="M0,"+Te+"h"+ue+"l-"+ue/2+",-"+Te+"Z";q.clipDefRelative.select("path").attr("d",mt);var ht=e(Y,le);q.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",ht),q.clipDefRelative.select("path").attr("transform",null);var qe=e(Y-it._offset,le+Te);q.layers.baxis.attr("transform",qe),q.layers.bgrid.attr("transform",qe);var ze=e(Y+ue/2,le)+"rotate(30)"+e(0,-We._offset);q.layers.aaxis.attr("transform",ze),q.layers.agrid.attr("transform",ze);var Ae=e(Y+ue/2,le)+"rotate(-30)"+e(0,-yt._offset);q.layers.caxis.attr("transform",Ae),q.layers.cgrid.attr("transform",Ae),q.drawAxes(!0),q.layers.aline.select("path").attr("d",We.showline?"M"+Y+","+(le+Te)+"l"+ue/2+",-"+Te:"M0,0").call(r.stroke,We.linecolor||"#000").style("stroke-width",(We.linewidth||0)+"px"),q.layers.bline.select("path").attr("d",it.showline?"M"+Y+","+(le+Te)+"h"+ue:"M0,0").call(r.stroke,it.linecolor||"#000").style("stroke-width",(it.linewidth||0)+"px"),q.layers.cline.select("path").attr("d",yt.showline?"M"+(Y+ue/2)+","+le+"l"+ue/2+","+Te:"M0,0").call(r.stroke,yt.linecolor||"#000").style("stroke-width",(yt.linewidth||0)+"px"),q.graphDiv._context.staticPlot||q.initInteractions(),o.setClipUrl(q.layers.frontplot,q._hasClipOnAxisFalse?null:q.clipId,q.graphDiv)},m.drawAxes=function(D){var j=this,q=j.graphDiv,J=j.id.slice(7)+"title",oe=j.layers,ye=j.aaxis,pe=j.baxis,ge=j.caxis;if(j.drawAx(ye),j.drawAx(pe),j.drawAx(ge),D){var W=Math.max(ye.showticklabels?ye.tickfont.size/2:0,(ge.showticklabels?ge.tickfont.size*.75:0)+(ge.ticks==="outside"?ge.ticklen*.87:0)),ae=(pe.showticklabels?pe.tickfont.size:0)+(pe.ticks==="outside"?pe.ticklen:0)+3;oe["a-title"]=l.draw(q,"a"+J,{propContainer:ye,propName:j.id+".aaxis.title.text",placeholder:t(q,"Click to enter Component A title"),attributes:{x:j.x0+j.w/2,y:j.y0-ye.title.font.size/3-W,"text-anchor":"middle"}}),oe["b-title"]=l.draw(q,"b"+J,{propContainer:pe,propName:j.id+".baxis.title.text",placeholder:t(q,"Click to enter Component B title"),attributes:{x:j.x0-ae,y:j.y0+j.h+pe.title.font.size*.83+ae,"text-anchor":"middle"}}),oe["c-title"]=l.draw(q,"c"+J,{propContainer:ge,propName:j.id+".caxis.title.text",placeholder:t(q,"Click to enter Component C title"),attributes:{x:j.x0+j.w+ae,y:j.y0+j.h+ge.title.font.size*.83+ae,"text-anchor":"middle"}})}},m.drawAx=function(D){var j=this,q=j.graphDiv,J=D._name,oe=J.charAt(0),ye=D._id,pe=j.layers[J],ge=30,W=oe+"tickLayout",ae=d(D);j[W]!==ae&&(pe.selectAll("."+ye+"tick").remove(),j[W]=ae),D.setScale();var se=s.calcTicks(D),Q=s.clipEnds(D,se),me=s.makeTransTickFn(D),ie=s.getTickSigns(D)[2],Y=k.deg2rad(ge),le=ie*(D.linewidth||1)/2,ue=ie*D.ticklen,Te=j.w,Fe=j.h,Ve=oe==="b"?"M0,"+le+"l"+Math.sin(Y)*ue+","+Math.cos(Y)*ue:"M"+le+",0l"+Math.cos(Y)*ue+","+-Math.sin(Y)*ue,Xe={a:"M0,0l"+Fe+",-"+Te/2,b:"M0,0l-"+Te/2+",-"+Fe,c:"M0,0l-"+Fe+","+Te/2}[oe];s.drawTicks(q,D,{vals:D.ticks==="inside"?Q:se,layer:pe,path:Ve,transFn:me,crisp:!1}),s.drawGrid(q,D,{vals:Q,layer:j.layers[oe+"grid"],path:Xe,transFn:me,crisp:!1}),s.drawLabels(q,D,{vals:se,layer:pe,transFn:me,labelFns:s.makeLabelFns(D,0,ge)})};function d(D){return D.ticks+String(D.ticklen)+String(D.showticklabels)}var y=_.MINZOOM/2+.87,R="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",N="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",U=!0;m.clearOutline=function(){E(this.dragOptions),A(this.dragOptions.gd)},m.initInteractions=function(){var D=this,j=D.layers.plotbg.select("path").node(),q=D.graphDiv,J=q._fullLayout._zoomlayer,oe,ye;this.dragOptions={element:j,gd:q,plotinfo:{id:D.id,domain:q._fullLayout[D.id].domain,xaxis:D.xaxis,yaxis:D.yaxis},subplot:D.id,prepFn:function(qe,ze,Ae){D.dragOptions.xaxes=[D.xaxis],D.dragOptions.yaxes=[D.yaxis],oe=q._fullLayout._invScaleX,ye=q._fullLayout._invScaleY;var Ke=D.dragOptions.dragmode=q._fullLayout.dragmode;p(Ke)?D.dragOptions.minDrag=1:D.dragOptions.minDrag=void 0,Ke==="zoom"?(D.dragOptions.moveFn=it,D.dragOptions.clickFn=Te,D.dragOptions.doneFn=yt,Fe(qe,ze,Ae)):Ke==="pan"?(D.dragOptions.moveFn=mt,D.dragOptions.clickFn=Te,D.dragOptions.doneFn=ht,bt(),D.clearOutline(q)):(T(Ke)||p(Ke))&&g(qe,ze,Ae,D.dragOptions,Ke)}};var pe,ge,W,ae,se,Q,me,ie,Y,le;function ue(qe){var ze={};return ze[D.id+".aaxis.min"]=qe.a,ze[D.id+".baxis.min"]=qe.b,ze[D.id+".caxis.min"]=qe.c,ze}function Te(qe,ze){var Ae=q._fullLayout.clickmode;B(q),qe===2&&(q.emit("plotly_doubleclick",null),S.call("_guiRelayout",q,ue({a:0,b:0,c:0}))),Ae.indexOf("select")>-1&&qe===1&&b(ze,q,[D.xaxis],[D.yaxis],D.id,D.dragOptions),Ae.indexOf("event")>-1&&c.click(q,ze,D.id)}function Fe(qe,ze,Ae){var Ke=j.getBoundingClientRect();pe=ze-Ke.left,ge=Ae-Ke.top,q._fullLayout._calcInverseTransform(q);var _t=q._fullLayout._invTransform,wt=k.apply3DTransform(_t)(pe,ge);pe=wt[0],ge=wt[1],W={a:D.aaxis.range[0],b:D.baxis.range[1],c:D.caxis.range[1]},se=W,ae=D.aaxis.range[1]-W.a,Q=x(D.graphDiv._fullLayout[D.id].bgcolor).getLuminance(),me="M0,"+D.h+"L"+D.w/2+", 0L"+D.w+","+D.h+"Z",ie=!1,Y=J.append("path").attr("class","zoombox").attr("transform",e(D.x0,D.y0)).style({fill:Q>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",me),le=J.append("path").attr("class","zoombox-corners").attr("transform",e(D.x0,D.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),D.clearOutline(q)}function Ve(qe,ze){return 1-ze/D.h}function Xe(qe,ze){return 1-(qe+(D.h-ze)/Math.sqrt(3))/D.w}function We(qe,ze){return(qe-(D.h-ze)/Math.sqrt(3))/D.w}function it(qe,ze){var Ae=pe+qe*oe,Ke=ge+ze*ye,_t=Math.max(0,Math.min(1,Ve(pe,ge),Ve(Ae,Ke))),wt=Math.max(0,Math.min(1,Xe(pe,ge),Xe(Ae,Ke))),vt=Math.max(0,Math.min(1,We(pe,ge),We(Ae,Ke))),$t=(_t/2+vt)*D.w,Yt=(1-_t/2-wt)*D.w,lr=($t+Yt)/2,dr=Yt-$t,Nr=(1-_t)*D.h,Fr=Nr-dr/u;dr<_.MINZOOM?(se=W,Y.attr("d",me),le.attr("d","M0,0Z")):(se={a:W.a+_t*ae,b:W.b+wt*ae,c:W.c+vt*ae},Y.attr("d",me+"M"+$t+","+Nr+"H"+Yt+"L"+lr+","+Fr+"L"+$t+","+Nr+"Z"),le.attr("d","M"+pe+","+ge+N+"M"+$t+","+Nr+R+"M"+Yt+","+Nr+L+"M"+lr+","+Fr+z)),ie||(Y.transition().style("fill",Q>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),le.transition().style("opacity",1).duration(200),ie=!0),q.emit("plotly_relayouting",ue(se))}function yt(){B(q),se!==W&&(S.call("_guiRelayout",q,ue(se)),U&&q.data&&q._context.showTips&&(k.notifier(t(q,"Double-click to zoom back out"),"long"),U=!1))}function bt(){W={a:D.aaxis.range[0],b:D.baxis.range[1],c:D.caxis.range[1]},se=W}function mt(qe,ze){var Ae=qe/D.xaxis._m,Ke=ze/D.yaxis._m;se={a:W.a-Ke,b:W.b+(Ae+Ke)/2,c:W.c-(Ae-Ke)/2};var _t=[se.a,se.b,se.c].sort(k.sorterAsc),wt={a:_t.indexOf(se.a),b:_t.indexOf(se.b),c:_t.indexOf(se.c)};_t[0]<0&&(_t[1]+_t[0]/2<0?(_t[2]+=_t[0]+_t[1],_t[0]=_t[1]=0):(_t[2]+=_t[0]/2,_t[1]+=_t[0]/2,_t[0]=0),se={a:_t[wt.a],b:_t[wt.b],c:_t[wt.c]},ze=(W.a-se.a)*D.yaxis._m,qe=(W.c-se.c-W.b+se.b)*D.xaxis._m);var vt=e(D.x0+qe,D.y0+ze);D.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",vt);var $t=e(-qe,-ze);D.clipDefRelative.select("path").attr("transform",$t),D.aaxis.range=[se.a,D.sum-se.b-se.c],D.baxis.range=[D.sum-se.a-se.c,se.b],D.caxis.range=[D.sum-se.a-se.b,se.c],D.drawAxes(!1),D._hasClipOnAxisFalse&&D.plotContainer.select(".scatterlayer").selectAll(".trace").call(o.hideOutsideRangePoints,D),q.emit("plotly_relayouting",ue(se))}function ht(){S.call("_guiRelayout",q,ue(se))}j.onmousemove=function(qe){c.hover(q,qe,D.id),q._fullLayout._lasthover=j,q._fullLayout._hoversubplot=D.id},j.onmouseout=function(qe){q._dragging||f.unhover(q,qe)},f.init(this.dragOptions)};function B(D){h.select(D).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),D2=_e({"src/plots/ternary/layout_attributes.js"(ee,X){var h=Hl(),x=hf().attributes,S=Ih(),k=nc().overrideAll,e=po().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=X.exports=k({domain:x({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"}}}),T0=_e({"src/plots/subplot_defaults.js"(ee,X){var h=kn(),x=ou(),S=hf().defaults;X.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,v=c&&f[0].replace(/\d+$/,""),p,T;function l(E,_){return h.coerce(p,T,i,E,_)}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,v,p,T){var l=i[v._name];function g(d,y){return S.coerce(c,v,l,d,y)}g("uirevision",T.uirevision),v.type="linear";var b=g("color"),A=b!==l.color.dflt?b:p.font.color,E=v._name,_=E.charAt(0).toUpperCase(),w="Component "+_,m=g("title.text",w);v._hovertitle=m===w?m:_,S.coerceFont(g,"title.font",p.font,{overrideDflt:{size:S.bigFont(p.font.size),color:A}}),g("min"),o(c,v,g,"linear"),t(c,v,g,"linear"),e(c,v,g,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(c,v,g,{outerTicks:!0});var u=g("showticklabels");u&&(S.coerceFont(g,"tickfont",p.font,{overrideDflt:{color:A}}),g("tickangle"),g("tickformat")),n(c,v,g,{dfltColor:b,bgColor:p.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),g("hoverformat"),g("layer")}}}),p5=_e({"src/plots/ternary/index.js"(ee){var X=h5(),h=xl().getSubplotCalcData,x=kn().counterRegex,S="ternary";ee.name=S;var k=ee.attr="subplot";ee.idRoot=S,ee.idRegex=ee.attrRegex=x(S);var e=ee.attributes={};e[k]={valType:"subplotid",dflt:"ternary",editType:"calc"},ee.layoutAttributes=D2(),ee.supplyLayoutDefaults=d5(),ee.plot=function(r){for(var o=r._fullLayout,n=r.calcdata,i=o._subplots[S],a=0;a0){var E=r.xa,_=r.ya,w,m,u,d,y;c.orientation==="h"?(y=o,w="y",u=_,m="x",d=E):(y=n,w="x",u=E,m="y",d=_);var R=f[r.index];if(y>=R.span[0]&&y<=R.span[1]){var L=x.extendFlat({},r),z=d.c2p(y,!0),N=e.getKdeValue(R,c,y),U=e.getPositionOnKdePath(R,c,z),B=u._offset,D=u._length;L[w+"0"]=U[0],L[w+"1"]=U[1],L[m+"0"]=L[m+"1"]=z,L[m+"Label"]=m+": "+S.hoverLabelText(d,y,c[m+"hoverformat"])+", "+f[0].t.labels.kde+" "+N.toFixed(3);for(var j=0,q=0;q path").each(function(p){if(!p.isBlank){var T=v.marker;h.select(this).call(S.fill,p.mc||T.color).call(S.stroke,p.mlc||T.line.color).call(x.dashLine,T.line.dash,p.mlw||T.line.width).style("opacity",v.selectedpoints&&!p.selected?k:1)}}),r(c,v,n),c.selectAll(".regions").each(function(){h.select(this).selectAll("path").style("stroke-width",0).call(S.fill,v.connector.fillcolor)}),c.selectAll(".lines").each(function(){var p=v.connector.line;x.lineGroupStyle(h.select(this).selectAll("path"),p.width,p.color,p.dash)})})}X.exports={style:o}}}),D5=_e({"src/traces/funnel/hover.js"(ee,X){var h=so().opacity,x=_g().hoverOnBars,S=kn().formatPercent;X.exports=function(t,r,o,n,i){var a=x(t,r,o,n,i);if(a){var s=a.cd,f=s[0].trace,c=f.orientation==="h",v=a.index,p=s[v],T=c?"x":"y";a[T+"LabelVal"]=p.s,a.percentInitial=p.begR,a.percentInitialLabel=S(p.begR,1),a.percentPrevious=p.difR,a.percentPreviousLabel=S(p.difR,1),a.percentTotal=p.sumR,a.percentTotalLabel=S(p.sumR,1);var l=p.hi||f.hoverinfo,g=[];if(l&&l!=="none"&&l!=="skip"){var b=l==="all",A=l.split("+"),E=function(_){return b||A.indexOf(_)!==-1};E("percent initial")&&g.push(a.percentInitialLabel+" of initial"),E("percent previous")&&g.push(a.percentPreviousLabel+" of previous"),E("percent total")&&g.push(a.percentTotalLabel+" of total")}return a.extraText=g.join("
"),a.color=k(f,p),[a]}};function k(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}}}),R5=_e({"src/traces/funnel/event_data.js"(ee,X){X.exports=function(x,S){return x.x="xVal"in S?S.xVal:S.x,x.y="yVal"in S?S.yVal:S.y,"percentInitial"in S&&(x.percentInitial=S.percentInitial),"percentPrevious"in S&&(x.percentPrevious=S.percentPrevious),"percentTotal"in S&&(x.percentTotal=S.percentTotal),S.xa&&(x.xaxis=S.xa),S.ya&&(x.yaxis=S.ya),x}}}),O5=_e({"src/traces/funnel/index.js"(ee,X){X.exports={attributes:z2(),layoutAttributes:F2(),supplyDefaults:N2().supplyDefaults,crossTraceDefaults:N2().crossTraceDefaults,supplyLayoutDefaults:E5(),calc:C5(),crossTraceCalc:P5(),plot:L5(),style:I5().style,hoverPoints:D5(),eventData:R5(),selectPoints:bg(),moduleType:"trace",name:"funnel",basePlotModule:Mh(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),z5=_e({"lib/funnel.js"(ee,X){X.exports=O5()}}),F5=_e({"src/traces/waterfall/constants.js"(ee,X){X.exports={eventDataKeys:["initial","delta","final"]}}}),B2=_e({"src/traces/waterfall/attributes.js"(ee,X){var h=uv(),x=Ff().line,S=Zs(),k=ff().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=fu(),o=F5(),n=po().extendFlat,i=so();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"}}X.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:k("x"),yhoverformat:k("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({},x.color,{dflt:i.defaultLine}),width:n({},x.width,{editType:"plot"}),dash:x.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:h.offsetgroup,alignmentgroup:h.alignmentgroup,zorder:h.zorder}}}),U2=_e({"src/traces/waterfall/layout_attributes.js"(ee,X){X.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"}}}}),wg=_e({"src/constants/delta.js"(ee,X){X.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),j2=_e({"src/traces/waterfall/defaults.js"(ee,X){var h=kn(),x=om(),S=up().handleText,k=dg(),e=Bp(),t=B2(),r=so(),o=wg(),n=o.INCREASING.COLOR,i=o.DECREASING.COLOR,a="#4499FF";function s(v,p,T){v(p+".marker.color",T),v(p+".marker.line.color",r.defaultLine),v(p+".marker.line.width")}function f(v,p,T,l){function g(w,m){return h.coerce(v,p,t,w,m)}var b=k(v,p,l,g);if(!b){p.visible=!1;return}e(v,p,l,g),g("xhoverformat"),g("yhoverformat"),g("measure"),g("orientation",p.x&&!p.y?"h":"v"),g("base"),g("offset"),g("width"),g("text"),g("hovertext"),g("hovertemplate"),g("hovertemplatefallback");var A=g("textposition");S(v,p,l,g,A,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),p.textposition!=="none"&&(g("texttemplate"),g("texttemplatefallback"),p.texttemplate||g("textinfo")),s(g,"increasing",n),s(g,"decreasing",i),s(g,"totals",a);var E=g("connector.visible");if(E){g("connector.mode");var _=g("connector.line.width");_&&(g("connector.line.color"),g("connector.line.dash"))}g("zorder")}function c(v,p){var T,l;function g(A){return h.coerce(l._input,l,t,A)}if(p.waterfallmode==="group")for(var b=0;b0&&(g?y+="M"+u[0]+","+d[1]+"V"+d[0]:y+="M"+u[1]+","+d[0]+"H"+u[0]),b!=="between"&&(_.isSum||w path").each(function(p){if(!p.isBlank){var T=v[p.dir].marker;h.select(this).call(S.fill,T.color).call(S.stroke,T.line.color).call(x.dashLine,T.line.dash,T.line.width).style("opacity",v.selectedpoints&&!p.selected?k:1)}}),r(c,v,n),c.selectAll(".lines").each(function(){var p=v.connector.line;x.lineGroupStyle(h.select(this).selectAll("path"),p.width,p.color,p.dash)})})}X.exports={style:o}}}),q5=_e({"src/traces/waterfall/hover.js"(ee,X){var h=xs().hoverLabelText,x=so().opacity,S=_g().hoverOnBars,k=wg(),e={increasing:k.INCREASING.SYMBOL,decreasing:k.DECREASING.SYMBOL};X.exports=function(o,n,i,a,s){var f=S(o,n,i,a,s);if(!f)return;var c=f.cd,v=c[0].trace,p=v.orientation==="h",T=p?"x":"y",l=p?o.xa:o.ya;function g(R){return h(l,R,v[T+"hoverformat"])}var b=f.index,A=c[b],E=A.isSum?A.b+A.s:A.rawS;f.initial=A.b+A.s-E,f.delta=E,f.final=f.initial+f.delta;var _=g(Math.abs(f.delta));f.deltaLabel=E<0?"("+_+")":_,f.finalLabel=g(f.final),f.initialLabel=g(f.initial);var w=A.hi||v.hoverinfo,m=[];if(w&&w!=="none"&&w!=="skip"){var u=w==="all",d=w.split("+"),y=function(R){return u||d.indexOf(R)!==-1};A.isSum||(y("final")&&(p?!y("x"):!y("y"))&&m.push(f.finalLabel),y("delta")&&(E<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(v,A),[f]};function t(r,o){var n=r[o.dir].marker,i=n.color,a=n.line.color,s=n.line.width;if(x(i))return i;if(x(a)&&s)return a}}}),G5=_e({"src/traces/waterfall/event_data.js"(ee,X){X.exports=function(x,S){return x.x="xVal"in S?S.xVal:S.x,x.y="yVal"in S?S.yVal:S.y,"initial"in S&&(x.initial=S.initial),"delta"in S&&(x.delta=S.delta),"final"in S&&(x.final=S.final),S.xa&&(x.xaxis=S.xa),S.ya&&(x.yaxis=S.ya),x}}}),H5=_e({"src/traces/waterfall/index.js"(ee,X){X.exports={attributes:B2(),layoutAttributes:U2(),supplyDefaults:j2().supplyDefaults,crossTraceDefaults:j2().crossTraceDefaults,supplyLayoutDefaults:N5(),calc:B5(),crossTraceCalc:U5(),plot:j5(),style:V5().style,hoverPoints:q5(),eventData:G5(),selectPoints:bg(),moduleType:"trace",name:"waterfall",basePlotModule:Mh(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),$5=_e({"lib/waterfall.js"(ee,X){X.exports=H5()}}),Tg=_e({"src/traces/image/constants.js"(ee,X){X.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 x=h.slice(0,3);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(h){var x=h.slice(0,4);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["°","%","%",""]}}}}}),V2=_e({"src/traces/image/attributes.js"(ee,X){var h=Zs(),x=Ff().zorder,{hovertemplateAttrs:S,templatefallbackAttrs:k}=fu(),e=po().extendFlat,t=Tg().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 v=f.indexOf("=");v===-1&&(v=c);var p=v===c?0:4-v%4;return[v,p]}function r(f){var c=t(f),v=c[0],p=c[1];return(v+p)*3/4-p}function o(f,c,v){return(c+v)*3/4-v}function n(f){var c,v=t(f),p=v[0],T=v[1],l=new x(o(f,p,T)),g=0,b=T>0?p-4:p,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 X[f>>18&63]+X[f>>12&63]+X[f>>6&63]+X[f&63]}function a(f,c,v){for(var p,T=[],l=c;lb?b:g+l));return p===1?(c=f[v-1],T.push(X[c>>2]+X[c<<4&63]+"==")):p===2&&(c=(f[v-2]<<8)+f[v-1],T.push(X[c>>10]+X[c>>4&63]+X[c<<2&63]+"=")),T.join("")}}}),X5=_e({"node_modules/ieee754/index.js"(ee){ee.read=function(X,h,x,S,k){var e,t,r=k*8-S-1,o=(1<>1,i=-7,a=x?k-1:0,s=x?-1:1,f=X[h+a];for(a+=s,e=f&(1<<-i)-1,f>>=-i,i+=r;i>0;e=e*256+X[h+a],a+=s,i-=8);for(t=e&(1<<-i)-1,e>>=-i,i+=S;i>0;t=t*256+X[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)},ee.write=function(X,h,x,S,k,e){var t,r,o,n=e*8-k-1,i=(1<>1,s=k===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=S?0:e-1,c=S?1:-1,v=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,k),t=t+a):(r=h*Math.pow(2,a-1)*Math.pow(2,k),t=0));k>=8;X[x+f]=r&255,f+=c,r/=256,k-=8);for(t=t<0;X[x+f]=t&255,f+=c,t/=256,n-=8);X[x+f-c]|=v*128}}}),cm=_e({"node_modules/buffer/index.js"(ee){var X=Y5(),h=X5(),x=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ee.Buffer=t,ee.SlowBuffer=T,ee.INSPECT_MAX_BYTES=50;var S=2147483647;ee.kMaxLength=S,t.TYPED_ARRAY_SUPPORT=k(),!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 k(){try{const qe=new Uint8Array(1),ze={foo:function(){return 42}};return Object.setPrototypeOf(ze,Uint8Array.prototype),Object.setPrototypeOf(qe,ze),qe.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(qe){if(qe>S)throw new RangeError('The value "'+qe+'" is invalid for option "size"');const ze=new Uint8Array(qe);return Object.setPrototypeOf(ze,t.prototype),ze}function t(qe,ze,Ae){if(typeof qe=="number"){if(typeof ze=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(qe)}return r(qe,ze,Ae)}t.poolSize=8192;function r(qe,ze,Ae){if(typeof qe=="string")return a(qe,ze);if(ArrayBuffer.isView(qe))return f(qe);if(qe==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof qe);if(it(qe,ArrayBuffer)||qe&&it(qe.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(it(qe,SharedArrayBuffer)||qe&&it(qe.buffer,SharedArrayBuffer)))return c(qe,ze,Ae);if(typeof qe=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Ke=qe.valueOf&&qe.valueOf();if(Ke!=null&&Ke!==qe)return t.from(Ke,ze,Ae);const _t=v(qe);if(_t)return _t;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof qe[Symbol.toPrimitive]=="function")return t.from(qe[Symbol.toPrimitive]("string"),ze,Ae);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof qe)}t.from=function(qe,ze,Ae){return r(qe,ze,Ae)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function o(qe){if(typeof qe!="number")throw new TypeError('"size" argument must be of type number');if(qe<0)throw new RangeError('The value "'+qe+'" is invalid for option "size"')}function n(qe,ze,Ae){return o(qe),qe<=0?e(qe):ze!==void 0?typeof Ae=="string"?e(qe).fill(ze,Ae):e(qe).fill(ze):e(qe)}t.alloc=function(qe,ze,Ae){return n(qe,ze,Ae)};function i(qe){return o(qe),e(qe<0?0:p(qe)|0)}t.allocUnsafe=function(qe){return i(qe)},t.allocUnsafeSlow=function(qe){return i(qe)};function a(qe,ze){if((typeof ze!="string"||ze==="")&&(ze="utf8"),!t.isEncoding(ze))throw new TypeError("Unknown encoding: "+ze);const Ae=l(qe,ze)|0;let Ke=e(Ae);const _t=Ke.write(qe,ze);return _t!==Ae&&(Ke=Ke.slice(0,_t)),Ke}function s(qe){const ze=qe.length<0?0:p(qe.length)|0,Ae=e(ze);for(let Ke=0;Ke=S)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+S.toString(16)+" bytes");return qe|0}function T(qe){return+qe!=qe&&(qe=0),t.alloc(+qe)}t.isBuffer=function(ze){return ze!=null&&ze._isBuffer===!0&&ze!==t.prototype},t.compare=function(ze,Ae){if(it(ze,Uint8Array)&&(ze=t.from(ze,ze.offset,ze.byteLength)),it(Ae,Uint8Array)&&(Ae=t.from(Ae,Ae.offset,Ae.byteLength)),!t.isBuffer(ze)||!t.isBuffer(Ae))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ze===Ae)return 0;let Ke=ze.length,_t=Ae.length;for(let wt=0,vt=Math.min(Ke,_t);wt_t.length?(t.isBuffer(vt)||(vt=t.from(vt)),vt.copy(_t,wt)):Uint8Array.prototype.set.call(_t,vt,wt);else if(t.isBuffer(vt))vt.copy(_t,wt);else throw new TypeError('"list" argument must be an Array of Buffers');wt+=vt.length}return _t};function l(qe,ze){if(t.isBuffer(qe))return qe.length;if(ArrayBuffer.isView(qe)||it(qe,ArrayBuffer))return qe.byteLength;if(typeof qe!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof qe);const Ae=qe.length,Ke=arguments.length>2&&arguments[2]===!0;if(!Ke&&Ae===0)return 0;let _t=!1;for(;;)switch(ze){case"ascii":case"latin1":case"binary":return Ae;case"utf8":case"utf-8":return Te(qe).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ae*2;case"hex":return Ae>>>1;case"base64":return Xe(qe).length;default:if(_t)return Ke?-1:Te(qe).length;ze=(""+ze).toLowerCase(),_t=!0}}t.byteLength=l;function g(qe,ze,Ae){let Ke=!1;if((ze===void 0||ze<0)&&(ze=0),ze>this.length||((Ae===void 0||Ae>this.length)&&(Ae=this.length),Ae<=0)||(Ae>>>=0,ze>>>=0,Ae<=ze))return"";for(qe||(qe="utf8");;)switch(qe){case"hex":return B(this,ze,Ae);case"utf8":case"utf-8":return R(this,ze,Ae);case"ascii":return N(this,ze,Ae);case"latin1":case"binary":return U(this,ze,Ae);case"base64":return y(this,ze,Ae);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,ze,Ae);default:if(Ke)throw new TypeError("Unknown encoding: "+qe);qe=(qe+"").toLowerCase(),Ke=!0}}t.prototype._isBuffer=!0;function b(qe,ze,Ae){const Ke=qe[ze];qe[ze]=qe[Ae],qe[Ae]=Ke}t.prototype.swap16=function(){const ze=this.length;if(ze%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Ae=0;AeAe&&(ze+=" ... "),""},x&&(t.prototype[x]=t.prototype.inspect),t.prototype.compare=function(ze,Ae,Ke,_t,wt){if(it(ze,Uint8Array)&&(ze=t.from(ze,ze.offset,ze.byteLength)),!t.isBuffer(ze))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof ze);if(Ae===void 0&&(Ae=0),Ke===void 0&&(Ke=ze?ze.length:0),_t===void 0&&(_t=0),wt===void 0&&(wt=this.length),Ae<0||Ke>ze.length||_t<0||wt>this.length)throw new RangeError("out of range index");if(_t>=wt&&Ae>=Ke)return 0;if(_t>=wt)return-1;if(Ae>=Ke)return 1;if(Ae>>>=0,Ke>>>=0,_t>>>=0,wt>>>=0,this===ze)return 0;let vt=wt-_t,$t=Ke-Ae;const Yt=Math.min(vt,$t),lr=this.slice(_t,wt),dr=ze.slice(Ae,Ke);for(let Nr=0;Nr2147483647?Ae=2147483647:Ae<-2147483648&&(Ae=-2147483648),Ae=+Ae,yt(Ae)&&(Ae=_t?0:qe.length-1),Ae<0&&(Ae=qe.length+Ae),Ae>=qe.length){if(_t)return-1;Ae=qe.length-1}else if(Ae<0)if(_t)Ae=0;else return-1;if(typeof ze=="string"&&(ze=t.from(ze,Ke)),t.isBuffer(ze))return ze.length===0?-1:E(qe,ze,Ae,Ke,_t);if(typeof ze=="number")return ze=ze&255,typeof Uint8Array.prototype.indexOf=="function"?_t?Uint8Array.prototype.indexOf.call(qe,ze,Ae):Uint8Array.prototype.lastIndexOf.call(qe,ze,Ae):E(qe,[ze],Ae,Ke,_t);throw new TypeError("val must be string, number or Buffer")}function E(qe,ze,Ae,Ke,_t){let wt=1,vt=qe.length,$t=ze.length;if(Ke!==void 0&&(Ke=String(Ke).toLowerCase(),Ke==="ucs2"||Ke==="ucs-2"||Ke==="utf16le"||Ke==="utf-16le")){if(qe.length<2||ze.length<2)return-1;wt=2,vt/=2,$t/=2,Ae/=2}function Yt(dr,Nr){return wt===1?dr[Nr]:dr.readUInt16BE(Nr*wt)}let lr;if(_t){let dr=-1;for(lr=Ae;lrvt&&(Ae=vt-$t),lr=Ae;lr>=0;lr--){let dr=!0;for(let Nr=0;Nr<$t;Nr++)if(Yt(qe,lr+Nr)!==Yt(ze,Nr)){dr=!1;break}if(dr)return lr}return-1}t.prototype.includes=function(ze,Ae,Ke){return this.indexOf(ze,Ae,Ke)!==-1},t.prototype.indexOf=function(ze,Ae,Ke){return A(this,ze,Ae,Ke,!0)},t.prototype.lastIndexOf=function(ze,Ae,Ke){return A(this,ze,Ae,Ke,!1)};function _(qe,ze,Ae,Ke){Ae=Number(Ae)||0;const _t=qe.length-Ae;Ke?(Ke=Number(Ke),Ke>_t&&(Ke=_t)):Ke=_t;const wt=ze.length;Ke>wt/2&&(Ke=wt/2);let vt;for(vt=0;vt>>0,isFinite(Ke)?(Ke=Ke>>>0,_t===void 0&&(_t="utf8")):(_t=Ke,Ke=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const wt=this.length-Ae;if((Ke===void 0||Ke>wt)&&(Ke=wt),ze.length>0&&(Ke<0||Ae<0)||Ae>this.length)throw new RangeError("Attempt to write outside buffer bounds");_t||(_t="utf8");let vt=!1;for(;;)switch(_t){case"hex":return _(this,ze,Ae,Ke);case"utf8":case"utf-8":return w(this,ze,Ae,Ke);case"ascii":case"latin1":case"binary":return m(this,ze,Ae,Ke);case"base64":return u(this,ze,Ae,Ke);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,ze,Ae,Ke);default:if(vt)throw new TypeError("Unknown encoding: "+_t);_t=(""+_t).toLowerCase(),vt=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function y(qe,ze,Ae){return ze===0&&Ae===qe.length?X.fromByteArray(qe):X.fromByteArray(qe.slice(ze,Ae))}function R(qe,ze,Ae){Ae=Math.min(qe.length,Ae);const Ke=[];let _t=ze;for(;_t239?4:wt>223?3:wt>191?2:1;if(_t+$t<=Ae){let Yt,lr,dr,Nr;switch($t){case 1:wt<128&&(vt=wt);break;case 2:Yt=qe[_t+1],(Yt&192)===128&&(Nr=(wt&31)<<6|Yt&63,Nr>127&&(vt=Nr));break;case 3:Yt=qe[_t+1],lr=qe[_t+2],(Yt&192)===128&&(lr&192)===128&&(Nr=(wt&15)<<12|(Yt&63)<<6|lr&63,Nr>2047&&(Nr<55296||Nr>57343)&&(vt=Nr));break;case 4:Yt=qe[_t+1],lr=qe[_t+2],dr=qe[_t+3],(Yt&192)===128&&(lr&192)===128&&(dr&192)===128&&(Nr=(wt&15)<<18|(Yt&63)<<12|(lr&63)<<6|dr&63,Nr>65535&&Nr<1114112&&(vt=Nr))}}vt===null?(vt=65533,$t=1):vt>65535&&(vt-=65536,Ke.push(vt>>>10&1023|55296),vt=56320|vt&1023),Ke.push(vt),_t+=$t}return z(Ke)}var L=4096;function z(qe){const ze=qe.length;if(ze<=L)return String.fromCharCode.apply(String,qe);let Ae="",Ke=0;for(;KeKe)&&(Ae=Ke);let _t="";for(let wt=ze;wtKe&&(ze=Ke),Ae<0?(Ae+=Ke,Ae<0&&(Ae=0)):Ae>Ke&&(Ae=Ke),AeAe)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(ze,Ae,Ke){ze=ze>>>0,Ae=Ae>>>0,Ke||j(ze,Ae,this.length);let _t=this[ze],wt=1,vt=0;for(;++vt>>0,Ae=Ae>>>0,Ke||j(ze,Ae,this.length);let _t=this[ze+--Ae],wt=1;for(;Ae>0&&(wt*=256);)_t+=this[ze+--Ae]*wt;return _t},t.prototype.readUint8=t.prototype.readUInt8=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,1,this.length),this[ze]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,2,this.length),this[ze]|this[ze+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,2,this.length),this[ze]<<8|this[ze+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,4,this.length),(this[ze]|this[ze+1]<<8|this[ze+2]<<16)+this[ze+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,4,this.length),this[ze]*16777216+(this[ze+1]<<16|this[ze+2]<<8|this[ze+3])},t.prototype.readBigUInt64LE=mt(function(ze){ze=ze>>>0,ie(ze,"offset");const Ae=this[ze],Ke=this[ze+7];(Ae===void 0||Ke===void 0)&&Y(ze,this.length-8);const _t=Ae+this[++ze]*2**8+this[++ze]*2**16+this[++ze]*2**24,wt=this[++ze]+this[++ze]*2**8+this[++ze]*2**16+Ke*2**24;return BigInt(_t)+(BigInt(wt)<>>0,ie(ze,"offset");const Ae=this[ze],Ke=this[ze+7];(Ae===void 0||Ke===void 0)&&Y(ze,this.length-8);const _t=Ae*2**24+this[++ze]*2**16+this[++ze]*2**8+this[++ze],wt=this[++ze]*2**24+this[++ze]*2**16+this[++ze]*2**8+Ke;return(BigInt(_t)<>>0,Ae=Ae>>>0,Ke||j(ze,Ae,this.length);let _t=this[ze],wt=1,vt=0;for(;++vt=wt&&(_t-=Math.pow(2,8*Ae)),_t},t.prototype.readIntBE=function(ze,Ae,Ke){ze=ze>>>0,Ae=Ae>>>0,Ke||j(ze,Ae,this.length);let _t=Ae,wt=1,vt=this[ze+--_t];for(;_t>0&&(wt*=256);)vt+=this[ze+--_t]*wt;return wt*=128,vt>=wt&&(vt-=Math.pow(2,8*Ae)),vt},t.prototype.readInt8=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,1,this.length),this[ze]&128?(255-this[ze]+1)*-1:this[ze]},t.prototype.readInt16LE=function(ze,Ae){ze=ze>>>0,Ae||j(ze,2,this.length);const Ke=this[ze]|this[ze+1]<<8;return Ke&32768?Ke|4294901760:Ke},t.prototype.readInt16BE=function(ze,Ae){ze=ze>>>0,Ae||j(ze,2,this.length);const Ke=this[ze+1]|this[ze]<<8;return Ke&32768?Ke|4294901760:Ke},t.prototype.readInt32LE=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,4,this.length),this[ze]|this[ze+1]<<8|this[ze+2]<<16|this[ze+3]<<24},t.prototype.readInt32BE=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,4,this.length),this[ze]<<24|this[ze+1]<<16|this[ze+2]<<8|this[ze+3]},t.prototype.readBigInt64LE=mt(function(ze){ze=ze>>>0,ie(ze,"offset");const Ae=this[ze],Ke=this[ze+7];(Ae===void 0||Ke===void 0)&&Y(ze,this.length-8);const _t=this[ze+4]+this[ze+5]*2**8+this[ze+6]*2**16+(Ke<<24);return(BigInt(_t)<>>0,ie(ze,"offset");const Ae=this[ze],Ke=this[ze+7];(Ae===void 0||Ke===void 0)&&Y(ze,this.length-8);const _t=(Ae<<24)+this[++ze]*2**16+this[++ze]*2**8+this[++ze];return(BigInt(_t)<>>0,Ae||j(ze,4,this.length),h.read(this,ze,!0,23,4)},t.prototype.readFloatBE=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,4,this.length),h.read(this,ze,!1,23,4)},t.prototype.readDoubleLE=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,8,this.length),h.read(this,ze,!0,52,8)},t.prototype.readDoubleBE=function(ze,Ae){return ze=ze>>>0,Ae||j(ze,8,this.length),h.read(this,ze,!1,52,8)};function q(qe,ze,Ae,Ke,_t,wt){if(!t.isBuffer(qe))throw new TypeError('"buffer" argument must be a Buffer instance');if(ze>_t||zeqe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(ze,Ae,Ke,_t){if(ze=+ze,Ae=Ae>>>0,Ke=Ke>>>0,!_t){const $t=Math.pow(2,8*Ke)-1;q(this,ze,Ae,Ke,$t,0)}let wt=1,vt=0;for(this[Ae]=ze&255;++vt>>0,Ke=Ke>>>0,!_t){const $t=Math.pow(2,8*Ke)-1;q(this,ze,Ae,Ke,$t,0)}let wt=Ke-1,vt=1;for(this[Ae+wt]=ze&255;--wt>=0&&(vt*=256);)this[Ae+wt]=ze/vt&255;return Ae+Ke},t.prototype.writeUint8=t.prototype.writeUInt8=function(ze,Ae,Ke){return ze=+ze,Ae=Ae>>>0,Ke||q(this,ze,Ae,1,255,0),this[Ae]=ze&255,Ae+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(ze,Ae,Ke){return ze=+ze,Ae=Ae>>>0,Ke||q(this,ze,Ae,2,65535,0),this[Ae]=ze&255,this[Ae+1]=ze>>>8,Ae+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(ze,Ae,Ke){return ze=+ze,Ae=Ae>>>0,Ke||q(this,ze,Ae,2,65535,0),this[Ae]=ze>>>8,this[Ae+1]=ze&255,Ae+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(ze,Ae,Ke){return ze=+ze,Ae=Ae>>>0,Ke||q(this,ze,Ae,4,4294967295,0),this[Ae+3]=ze>>>24,this[Ae+2]=ze>>>16,this[Ae+1]=ze>>>8,this[Ae]=ze&255,Ae+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(ze,Ae,Ke){return ze=+ze,Ae=Ae>>>0,Ke||q(this,ze,Ae,4,4294967295,0),this[Ae]=ze>>>24,this[Ae+1]=ze>>>16,this[Ae+2]=ze>>>8,this[Ae+3]=ze&255,Ae+4};function J(qe,ze,Ae,Ke,_t){me(ze,Ke,_t,qe,Ae,7);let wt=Number(ze&BigInt(4294967295));qe[Ae++]=wt,wt=wt>>8,qe[Ae++]=wt,wt=wt>>8,qe[Ae++]=wt,wt=wt>>8,qe[Ae++]=wt;let vt=Number(ze>>BigInt(32)&BigInt(4294967295));return qe[Ae++]=vt,vt=vt>>8,qe[Ae++]=vt,vt=vt>>8,qe[Ae++]=vt,vt=vt>>8,qe[Ae++]=vt,Ae}function oe(qe,ze,Ae,Ke,_t){me(ze,Ke,_t,qe,Ae,7);let wt=Number(ze&BigInt(4294967295));qe[Ae+7]=wt,wt=wt>>8,qe[Ae+6]=wt,wt=wt>>8,qe[Ae+5]=wt,wt=wt>>8,qe[Ae+4]=wt;let vt=Number(ze>>BigInt(32)&BigInt(4294967295));return qe[Ae+3]=vt,vt=vt>>8,qe[Ae+2]=vt,vt=vt>>8,qe[Ae+1]=vt,vt=vt>>8,qe[Ae]=vt,Ae+8}t.prototype.writeBigUInt64LE=mt(function(ze,Ae=0){return J(this,ze,Ae,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=mt(function(ze,Ae=0){return oe(this,ze,Ae,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(ze,Ae,Ke,_t){if(ze=+ze,Ae=Ae>>>0,!_t){const Yt=Math.pow(2,8*Ke-1);q(this,ze,Ae,Ke,Yt-1,-Yt)}let wt=0,vt=1,$t=0;for(this[Ae]=ze&255;++wt>0)-$t&255;return Ae+Ke},t.prototype.writeIntBE=function(ze,Ae,Ke,_t){if(ze=+ze,Ae=Ae>>>0,!_t){const Yt=Math.pow(2,8*Ke-1);q(this,ze,Ae,Ke,Yt-1,-Yt)}let wt=Ke-1,vt=1,$t=0;for(this[Ae+wt]=ze&255;--wt>=0&&(vt*=256);)ze<0&&$t===0&&this[Ae+wt+1]!==0&&($t=1),this[Ae+wt]=(ze/vt>>0)-$t&255;return Ae+Ke},t.prototype.writeInt8=function(ze,Ae,Ke){return ze=+ze,Ae=Ae>>>0,Ke||q(this,ze,Ae,1,127,-128),ze<0&&(ze=255+ze+1),this[Ae]=ze&255,Ae+1},t.prototype.writeInt16LE=function(ze,Ae,Ke){return ze=+ze,Ae=Ae>>>0,Ke||q(this,ze,Ae,2,32767,-32768),this[Ae]=ze&255,this[Ae+1]=ze>>>8,Ae+2},t.prototype.writeInt16BE=function(ze,Ae,Ke){return ze=+ze,Ae=Ae>>>0,Ke||q(this,ze,Ae,2,32767,-32768),this[Ae]=ze>>>8,this[Ae+1]=ze&255,Ae+2},t.prototype.writeInt32LE=function(ze,Ae,Ke){return ze=+ze,Ae=Ae>>>0,Ke||q(this,ze,Ae,4,2147483647,-2147483648),this[Ae]=ze&255,this[Ae+1]=ze>>>8,this[Ae+2]=ze>>>16,this[Ae+3]=ze>>>24,Ae+4},t.prototype.writeInt32BE=function(ze,Ae,Ke){return ze=+ze,Ae=Ae>>>0,Ke||q(this,ze,Ae,4,2147483647,-2147483648),ze<0&&(ze=4294967295+ze+1),this[Ae]=ze>>>24,this[Ae+1]=ze>>>16,this[Ae+2]=ze>>>8,this[Ae+3]=ze&255,Ae+4},t.prototype.writeBigInt64LE=mt(function(ze,Ae=0){return J(this,ze,Ae,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=mt(function(ze,Ae=0){return oe(this,ze,Ae,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ye(qe,ze,Ae,Ke,_t,wt){if(Ae+Ke>qe.length)throw new RangeError("Index out of range");if(Ae<0)throw new RangeError("Index out of range")}function pe(qe,ze,Ae,Ke,_t){return ze=+ze,Ae=Ae>>>0,_t||ye(qe,ze,Ae,4),h.write(qe,ze,Ae,Ke,23,4),Ae+4}t.prototype.writeFloatLE=function(ze,Ae,Ke){return pe(this,ze,Ae,!0,Ke)},t.prototype.writeFloatBE=function(ze,Ae,Ke){return pe(this,ze,Ae,!1,Ke)};function ge(qe,ze,Ae,Ke,_t){return ze=+ze,Ae=Ae>>>0,_t||ye(qe,ze,Ae,8),h.write(qe,ze,Ae,Ke,52,8),Ae+8}t.prototype.writeDoubleLE=function(ze,Ae,Ke){return ge(this,ze,Ae,!0,Ke)},t.prototype.writeDoubleBE=function(ze,Ae,Ke){return ge(this,ze,Ae,!1,Ke)},t.prototype.copy=function(ze,Ae,Ke,_t){if(!t.isBuffer(ze))throw new TypeError("argument should be a Buffer");if(Ke||(Ke=0),!_t&&_t!==0&&(_t=this.length),Ae>=ze.length&&(Ae=ze.length),Ae||(Ae=0),_t>0&&_t=this.length)throw new RangeError("Index out of range");if(_t<0)throw new RangeError("sourceEnd out of bounds");_t>this.length&&(_t=this.length),ze.length-Ae<_t-Ke&&(_t=ze.length-Ae+Ke);const wt=_t-Ke;return this===ze&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Ae,Ke,_t):Uint8Array.prototype.set.call(ze,this.subarray(Ke,_t),Ae),wt},t.prototype.fill=function(ze,Ae,Ke,_t){if(typeof ze=="string"){if(typeof Ae=="string"?(_t=Ae,Ae=0,Ke=this.length):typeof Ke=="string"&&(_t=Ke,Ke=this.length),_t!==void 0&&typeof _t!="string")throw new TypeError("encoding must be a string");if(typeof _t=="string"&&!t.isEncoding(_t))throw new TypeError("Unknown encoding: "+_t);if(ze.length===1){const vt=ze.charCodeAt(0);(_t==="utf8"&&vt<128||_t==="latin1")&&(ze=vt)}}else typeof ze=="number"?ze=ze&255:typeof ze=="boolean"&&(ze=Number(ze));if(Ae<0||this.length>>0,Ke=Ke===void 0?this.length:Ke>>>0,ze||(ze=0);let wt;if(typeof ze=="number")for(wt=Ae;wt2**32?_t=se(String(Ae)):typeof Ae=="bigint"&&(_t=String(Ae),(Ae>BigInt(2)**BigInt(32)||Ae<-(BigInt(2)**BigInt(32)))&&(_t=se(_t)),_t+="n"),Ke+=` It must be ${ze}. Received ${_t}`,Ke},RangeError);function se(qe){let ze="",Ae=qe.length;const Ke=qe[0]==="-"?1:0;for(;Ae>=Ke+4;Ae-=3)ze=`_${qe.slice(Ae-3,Ae)}${ze}`;return`${qe.slice(0,Ae)}${ze}`}function Q(qe,ze,Ae){ie(ze,"offset"),(qe[ze]===void 0||qe[ze+Ae]===void 0)&&Y(ze,qe.length-(Ae+1))}function me(qe,ze,Ae,Ke,_t,wt){if(qe>Ae||qe= 0${vt} and < 2${vt} ** ${(wt+1)*8}${vt}`:$t=`>= -(2${vt} ** ${(wt+1)*8-1}${vt}) and < 2 ** ${(wt+1)*8-1}${vt}`,new W.ERR_OUT_OF_RANGE("value",$t,qe)}Q(Ke,_t,wt)}function ie(qe,ze){if(typeof qe!="number")throw new W.ERR_INVALID_ARG_TYPE(ze,"number",qe)}function Y(qe,ze,Ae){throw Math.floor(qe)!==qe?(ie(qe,Ae),new W.ERR_OUT_OF_RANGE("offset","an integer",qe)):ze<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${ze}`,qe)}var le=/[^+/0-9A-Za-z-_]/g;function ue(qe){if(qe=qe.split("=")[0],qe=qe.trim().replace(le,""),qe.length<2)return"";for(;qe.length%4!==0;)qe=qe+"=";return qe}function Te(qe,ze){ze=ze||1/0;let Ae;const Ke=qe.length;let _t=null;const wt=[];for(let vt=0;vt55295&&Ae<57344){if(!_t){if(Ae>56319){(ze-=3)>-1&&wt.push(239,191,189);continue}else if(vt+1===Ke){(ze-=3)>-1&&wt.push(239,191,189);continue}_t=Ae;continue}if(Ae<56320){(ze-=3)>-1&&wt.push(239,191,189),_t=Ae;continue}Ae=(_t-55296<<10|Ae-56320)+65536}else _t&&(ze-=3)>-1&&wt.push(239,191,189);if(_t=null,Ae<128){if((ze-=1)<0)break;wt.push(Ae)}else if(Ae<2048){if((ze-=2)<0)break;wt.push(Ae>>6|192,Ae&63|128)}else if(Ae<65536){if((ze-=3)<0)break;wt.push(Ae>>12|224,Ae>>6&63|128,Ae&63|128)}else if(Ae<1114112){if((ze-=4)<0)break;wt.push(Ae>>18|240,Ae>>12&63|128,Ae>>6&63|128,Ae&63|128)}else throw new Error("Invalid code point")}return wt}function Fe(qe){const ze=[];for(let Ae=0;Ae>8,_t=Ae%256,wt.push(_t),wt.push(Ke);return wt}function Xe(qe){return X.toByteArray(ue(qe))}function We(qe,ze,Ae,Ke){let _t;for(_t=0;_t=ze.length||_t>=qe.length);++_t)ze[_t+Ae]=qe[_t];return _t}function it(qe,ze){return qe instanceof ze||qe!=null&&qe.constructor!=null&&qe.constructor.name!=null&&qe.constructor.name===ze.name}function yt(qe){return qe!==qe}var bt=function(){const qe="0123456789abcdef",ze=new Array(256);for(let Ae=0;Ae<16;++Ae){const Ke=Ae*16;for(let _t=0;_t<16;++_t)ze[Ke+_t]=qe[Ae]+qe[_t]}return ze}();function mt(qe){return typeof BigInt>"u"?ht:qe}function ht(){throw new Error("BigInt not supported")}}}),fb=_e({"node_modules/has-symbols/shams.js"(ee,X){X.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var x={},S=Symbol("test"),k=Object(S);if(typeof S=="string"||Object.prototype.toString.call(S)!=="[object Symbol]"||Object.prototype.toString.call(k)!=="[object Symbol]")return!1;var e=42;x[S]=e;for(var t in x)return!1;if(typeof Object.keys=="function"&&Object.keys(x).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(x).length!==0)return!1;var r=Object.getOwnPropertySymbols(x);if(r.length!==1||r[0]!==S||!Object.prototype.propertyIsEnumerable.call(x,S))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(x,S);if(o.value!==e||o.enumerable!==!0)return!1}return!0}}}),jy=_e({"node_modules/has-tostringtag/shams.js"(ee,X){var h=fb();X.exports=function(){return h()&&!!Symbol.toStringTag}}}),G2=_e({"node_modules/es-object-atoms/index.js"(ee,X){X.exports=Object}}),Z5=_e({"node_modules/es-errors/index.js"(ee,X){X.exports=Error}}),K5=_e({"node_modules/es-errors/eval.js"(ee,X){X.exports=EvalError}}),J5=_e({"node_modules/es-errors/range.js"(ee,X){X.exports=RangeError}}),Q5=_e({"node_modules/es-errors/ref.js"(ee,X){X.exports=ReferenceError}}),H2=_e({"node_modules/es-errors/syntax.js"(ee,X){X.exports=SyntaxError}}),Ag=_e({"node_modules/es-errors/type.js"(ee,X){X.exports=TypeError}}),ek=_e({"node_modules/es-errors/uri.js"(ee,X){X.exports=URIError}}),tk=_e({"node_modules/math-intrinsics/abs.js"(ee,X){X.exports=Math.abs}}),rk=_e({"node_modules/math-intrinsics/floor.js"(ee,X){X.exports=Math.floor}}),nk=_e({"node_modules/math-intrinsics/max.js"(ee,X){X.exports=Math.max}}),ak=_e({"node_modules/math-intrinsics/min.js"(ee,X){X.exports=Math.min}}),ik=_e({"node_modules/math-intrinsics/pow.js"(ee,X){X.exports=Math.pow}}),ok=_e({"node_modules/math-intrinsics/round.js"(ee,X){X.exports=Math.round}}),sk=_e({"node_modules/math-intrinsics/isNaN.js"(ee,X){X.exports=Number.isNaN||function(x){return x!==x}}}),lk=_e({"node_modules/math-intrinsics/sign.js"(ee,X){var h=sk();X.exports=function(S){return h(S)||S===0?S:S<0?-1:1}}}),uk=_e({"node_modules/gopd/gOPD.js"(ee,X){X.exports=Object.getOwnPropertyDescriptor}}),fm=_e({"node_modules/gopd/index.js"(ee,X){var h=uk();if(h)try{h([],"length")}catch{h=null}X.exports=h}}),Vy=_e({"node_modules/es-define-property/index.js"(ee,X){var h=Object.defineProperty||!1;if(h)try{h({},"a",{value:1})}catch{h=!1}X.exports=h}}),ck=_e({"node_modules/has-symbols/index.js"(ee,X){var h=typeof Symbol<"u"&&Symbol,x=fb();X.exports=function(){return typeof h!="function"||typeof Symbol!="function"||typeof h("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:x()}}}),$2=_e({"node_modules/get-proto/Reflect.getPrototypeOf.js"(ee,X){X.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}}),W2=_e({"node_modules/get-proto/Object.getPrototypeOf.js"(ee,X){var h=G2();X.exports=h.getPrototypeOf||null}}),fk=_e({"node_modules/function-bind/implementation.js"(ee,X){var h="Function.prototype.bind called on incompatible ",x=Object.prototype.toString,S=Math.max,k="[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%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%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%":k,"%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%":R,"%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%":x,"%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%":E,"%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%":d,"%Object.defineProperty%":b,"%Object.getPrototypeOf%":m,"%Math.abs%":i,"%Math.floor%":a,"%Math.max%":s,"%Math.min%":f,"%Math.pow%":c,"%Math.round%":v,"%Math.sign%":p,"%Reflect.getPrototypeOf%":u};if(w)try{null.error}catch(Q){N=w(w(Q)),z["%Error.prototype%"]=N}var N,U=function Q(me){var ie;if(me==="%AsyncFunction%")ie=l("async function () {}");else if(me==="%GeneratorFunction%")ie=l("function* () {}");else if(me==="%AsyncGeneratorFunction%")ie=l("async function* () {}");else if(me==="%AsyncGenerator%"){var Y=Q("%AsyncGeneratorFunction%");Y&&(ie=Y.prototype)}else if(me==="%AsyncIteratorPrototype%"){var le=Q("%AsyncGenerator%");le&&w&&(ie=w(le.prototype))}return z[me]=ie,ie},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"]},D=Sg(),j=gk(),q=D.call(y,Array.prototype.concat),J=D.call(d,Array.prototype.splice),oe=D.call(y,String.prototype.replace),ye=D.call(y,String.prototype.slice),pe=D.call(y,RegExp.prototype.exec),ge=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,ae=function(me){var ie=ye(me,0,1),Y=ye(me,-1);if(ie==="%"&&Y!=="%")throw new r("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&ie!=="%")throw new r("invalid intrinsic syntax, expected opening `%`");var le=[];return oe(me,ge,function(ue,Te,Fe,Ve){le[le.length]=Fe?oe(Ve,W,"$1"):Te||ue}),le},se=function(me,ie){var Y=me,le;if(j(B,Y)&&(le=B[Y],Y="%"+le[0]+"%"),j(z,Y)){var ue=z[Y];if(ue===R&&(ue=U(Y)),typeof ue>"u"&&!ie)throw new o("intrinsic "+me+" exists, but is not available. Please file an issue!");return{alias:le,name:Y,value:ue}}throw new r("intrinsic "+me+" does not exist!")};X.exports=function(me,ie){if(typeof me!="string"||me.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ie!="boolean")throw new o('"allowMissing" argument must be a boolean');if(pe(/^%?[^%]*%?$/,me)===null)throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=ae(me),le=Y.length>0?Y[0]:"",ue=se("%"+le+"%",ie),Te=ue.name,Fe=ue.value,Ve=!1,Xe=ue.alias;Xe&&(le=Xe[0],J(Y,q([0,1],Xe)));for(var We=1,it=!0;We=Y.length){var ht=g(Fe,yt);it=!!ht,it&&"get"in ht&&!("originalValue"in ht.get)?Fe=ht.get:Fe=Fe[yt]}else it=j(Fe,yt),Fe=Fe[yt];it&&!Ve&&(z[Te]=Fe)}}return Fe}}}),yk=_e({"node_modules/define-data-property/index.js"(ee,X){var h=Vy(),x=H2(),S=Ag(),k=fm();X.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=!!k&&k(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 x("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),X2=_e({"node_modules/has-property-descriptors/index.js"(ee,X){var h=Vy(),x=function(){return!!h};x.hasArrayLengthDefineBug=function(){if(!h)return null;try{return h([],"length",{value:1}).length!==1}catch{return!0}},X.exports=x}}),_k=_e({"node_modules/set-function-length/index.js"(ee,X){var h=db(),x=yk(),S=X2()(),k=fm(),e=Ag(),t=h("%Math.floor%");X.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&&k){var f=k(o,"length");f&&!f.configurable&&(a=!1),f&&!f.writable&&(s=!1)}return(a||s||!i)&&(S?x(o,"length",n,!0,!0):x(o,"length",n)),o}}}),qy=_e({"node_modules/call-bind/index.js"(ee,X){var h=Sg(),x=db(),S=_k(),k=Ag(),e=x("%Function.prototype.apply%"),t=x("%Function.prototype.call%"),r=x("%Reflect.apply%",!0)||h.call(t,e),o=Vy(),n=x("%Math.max%");X.exports=function(s){if(typeof s!="function")throw new k("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(X.exports,"apply",{value:i}):X.exports.apply=i}}),Mg=_e({"node_modules/call-bind/callBound.js"(ee,X){var h=db(),x=qy(),S=x(h("String.prototype.indexOf"));X.exports=function(e,t){var r=h(e,!!t);return typeof r=="function"&&S(e,".prototype.")>-1?x(r):r}}}),bk=_e({"node_modules/is-arguments/index.js"(ee,X){var h=jy()(),x=Mg(),S=x("Object.prototype.toString"),k=function(o){return h&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:S(o)==="[object Arguments]"},e=function(o){return k(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 k(arguments)}();k.isLegacyArguments=e,X.exports=t?k:e}}),xk=_e({"node_modules/is-generator-function/index.js"(ee,X){var h=Object.prototype.toString,x=Function.prototype.toString,S=/^\s*(?:function)?\*/,k=jy()(),e=Object.getPrototypeOf,t=function(){if(!k)return!1;try{return Function("return function*() {}")()}catch{}},r;X.exports=function(n){if(typeof n!="function")return!1;if(S.test(x.call(n)))return!0;if(!k){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}}}),wk=_e({"node_modules/is-callable/index.js"(ee,X){var h=Function.prototype.toString,x=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,S,k;if(typeof x=="function"&&typeof Object.defineProperty=="function")try{S=Object.defineProperty({},"length",{get:function(){throw k}}),k={},x(function(){throw 42},null,S)}catch(g){g!==k&&(x=null)}else x=null;var e=/^\s*class\b/,t=function(b){try{var A=h.call(b);return e.test(A)}catch{return!1}},r=function(b){try{return t(b)?!1:(h.call(b),!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]",v=typeof Symbol=="function"&&!!Symbol.toStringTag,p=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,o.call(l)===o.call(document.all)&&(T=function(b){if((p||!b)&&(typeof b>"u"||typeof b=="object"))try{var A=o.call(b);return(A===s||A===f||A===c||A===n)&&b("")==null}catch{}return!1}));var l;X.exports=x?function(b){if(T(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;try{x(b,null,S)}catch(A){if(A!==k)return!1}return!t(b)&&r(b)}:function(b){if(T(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(v)return r(b);if(t(b))return!1;var A=o.call(b);return A!==i&&A!==a&&!/^\[object HTML/.test(A)?!1:r(b)}}}),Z2=_e({"node_modules/for-each/index.js"(ee,X){var h=wk(),x=Object.prototype.toString,S=Object.prototype.hasOwnProperty,k=function(n,i,a){for(var s=0,f=n.length;s=3&&(s=a),x.call(n)==="[object Array]"?k(n,i,s):typeof n=="string"?e(n,i,s):t(n,i,s)};X.exports=r}}),K2=_e({"node_modules/available-typed-arrays/index.js"(ee,X){var h=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],x=typeof globalThis>"u"?window:globalThis;X.exports=function(){for(var k=[],e=0;e"u"?window:globalThis,n=x(),i=k("String.prototype.slice"),a=Object.getPrototypeOf,s=k("Array.prototype.indexOf",!0)||function(T,l){for(var g=0;g-1?l:l!=="Object"?!1:v(T)}return e?c(T):null}}}),Ak=_e({"node_modules/is-typed-array/index.js"(ee,X){var h=Z2(),x=K2(),S=Mg(),k=S("Object.prototype.toString"),e=jy()(),t=fm(),r=typeof globalThis>"u"?window:globalThis,o=x(),n=S("Array.prototype.indexOf",!0)||function(v,p){for(var T=0;T-1}return t?f(v):!1}}}),J2=_e({"node_modules/util/support/types.js"(ee){var X=bk(),h=xk(),x=Tk(),S=Ak();function k(Ve){return Ve.call.bind(Ve)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=k(Object.prototype.toString),o=k(Number.prototype.valueOf),n=k(String.prototype.valueOf),i=k(Boolean.prototype.valueOf);e&&(a=k(BigInt.prototype.valueOf));var a;t&&(s=k(Symbol.prototype.valueOf));var s;function f(Ve,Xe){if(typeof Ve!="object")return!1;try{return Xe(Ve),!0}catch{return!1}}ee.isArgumentsObject=X,ee.isGeneratorFunction=h,ee.isTypedArray=S;function c(Ve){return typeof Promise<"u"&&Ve instanceof Promise||Ve!==null&&typeof Ve=="object"&&typeof Ve.then=="function"&&typeof Ve.catch=="function"}ee.isPromise=c;function v(Ve){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ve):S(Ve)||J(Ve)}ee.isArrayBufferView=v;function p(Ve){return x(Ve)==="Uint8Array"}ee.isUint8Array=p;function T(Ve){return x(Ve)==="Uint8ClampedArray"}ee.isUint8ClampedArray=T;function l(Ve){return x(Ve)==="Uint16Array"}ee.isUint16Array=l;function g(Ve){return x(Ve)==="Uint32Array"}ee.isUint32Array=g;function b(Ve){return x(Ve)==="Int8Array"}ee.isInt8Array=b;function A(Ve){return x(Ve)==="Int16Array"}ee.isInt16Array=A;function E(Ve){return x(Ve)==="Int32Array"}ee.isInt32Array=E;function _(Ve){return x(Ve)==="Float32Array"}ee.isFloat32Array=_;function w(Ve){return x(Ve)==="Float64Array"}ee.isFloat64Array=w;function m(Ve){return x(Ve)==="BigInt64Array"}ee.isBigInt64Array=m;function u(Ve){return x(Ve)==="BigUint64Array"}ee.isBigUint64Array=u;function d(Ve){return r(Ve)==="[object Map]"}d.working=typeof Map<"u"&&d(new Map);function y(Ve){return typeof Map>"u"?!1:d.working?d(Ve):Ve instanceof Map}ee.isMap=y;function R(Ve){return r(Ve)==="[object Set]"}R.working=typeof Set<"u"&&R(new Set);function L(Ve){return typeof Set>"u"?!1:R.working?R(Ve):Ve instanceof Set}ee.isSet=L;function z(Ve){return r(Ve)==="[object WeakMap]"}z.working=typeof WeakMap<"u"&&z(new WeakMap);function N(Ve){return typeof WeakMap>"u"?!1:z.working?z(Ve):Ve instanceof WeakMap}ee.isWeakMap=N;function U(Ve){return r(Ve)==="[object WeakSet]"}U.working=typeof WeakSet<"u"&&U(new WeakSet);function B(Ve){return U(Ve)}ee.isWeakSet=B;function D(Ve){return r(Ve)==="[object ArrayBuffer]"}D.working=typeof ArrayBuffer<"u"&&D(new ArrayBuffer);function j(Ve){return typeof ArrayBuffer>"u"?!1:D.working?D(Ve):Ve instanceof ArrayBuffer}ee.isArrayBuffer=j;function q(Ve){return r(Ve)==="[object DataView]"}q.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&q(new DataView(new ArrayBuffer(1),0,1));function J(Ve){return typeof DataView>"u"?!1:q.working?q(Ve):Ve instanceof DataView}ee.isDataView=J;var oe=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ye(Ve){return r(Ve)==="[object SharedArrayBuffer]"}function pe(Ve){return typeof oe>"u"?!1:(typeof ye.working>"u"&&(ye.working=ye(new oe)),ye.working?ye(Ve):Ve instanceof oe)}ee.isSharedArrayBuffer=pe;function ge(Ve){return r(Ve)==="[object AsyncFunction]"}ee.isAsyncFunction=ge;function W(Ve){return r(Ve)==="[object Map Iterator]"}ee.isMapIterator=W;function ae(Ve){return r(Ve)==="[object Set Iterator]"}ee.isSetIterator=ae;function se(Ve){return r(Ve)==="[object Generator]"}ee.isGeneratorObject=se;function Q(Ve){return r(Ve)==="[object WebAssembly.Module]"}ee.isWebAssemblyCompiledModule=Q;function me(Ve){return f(Ve,o)}ee.isNumberObject=me;function ie(Ve){return f(Ve,n)}ee.isStringObject=ie;function Y(Ve){return f(Ve,i)}ee.isBooleanObject=Y;function le(Ve){return e&&f(Ve,a)}ee.isBigIntObject=le;function ue(Ve){return t&&f(Ve,s)}ee.isSymbolObject=ue;function Te(Ve){return me(Ve)||ie(Ve)||Y(Ve)||le(Ve)||ue(Ve)}ee.isBoxedPrimitive=Te;function Fe(Ve){return typeof Uint8Array<"u"&&(j(Ve)||pe(Ve))}ee.isAnyArrayBuffer=Fe,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Ve){Object.defineProperty(ee,Ve,{enumerable:!1,value:function(){throw new Error(Ve+" is not supported in userland")}})})}}),Q2=_e({"node_modules/util/support/isBufferBrowser.js"(ee,X){X.exports=function(x){return x&&typeof x=="object"&&typeof x.copy=="function"&&typeof x.fill=="function"&&typeof x.readUInt8=="function"}}}),eT=_e({"(disabled):node_modules/util/util.js"(ee){var X=Object.getOwnPropertyDescriptors||function(J){for(var oe=Object.keys(J),ye={},pe=0;pe=pe)return ae;switch(ae){case"%s":return String(ye[oe++]);case"%d":return Number(ye[oe++]);case"%j":try{return JSON.stringify(ye[oe++])}catch{return"[Circular]"}default:return ae}}),W=ye[oe];oe"u")return function(){return ee.deprecate(q,J).apply(this,arguments)};var oe=!1;function ye(){if(!oe){if(process.throwDeprecation)throw new Error(J);process.traceDeprecation?console.trace(J):console.error(J),oe=!0}return q.apply(this,arguments)}return ye};var x={},S=/^$/;k="false",k=k.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+k+"$","i");var k;ee.debuglog=function(q){if(q=q.toUpperCase(),!x[q])if(S.test(q)){var J=process.pid;x[q]=function(){var oe=ee.format.apply(ee,arguments);console.error("%s %d: %s",q,J,oe)}}else x[q]=function(){};return x[q]};function e(q,J){var oe={seen:[],stylize:r};return arguments.length>=3&&(oe.depth=arguments[2]),arguments.length>=4&&(oe.colors=arguments[3]),p(J)?oe.showHidden=J:J&&ee._extend(oe,J),E(oe.showHidden)&&(oe.showHidden=!1),E(oe.depth)&&(oe.depth=2),E(oe.colors)&&(oe.colors=!1),E(oe.customInspect)&&(oe.customInspect=!0),oe.colors&&(oe.stylize=t),n(oe,q,oe.depth)}ee.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(q,J){var oe=e.styles[J];return oe?"\x1B["+e.colors[oe][0]+"m"+q+"\x1B["+e.colors[oe][1]+"m":q}function r(q,J){return q}function o(q){var J={};return q.forEach(function(oe,ye){J[oe]=!0}),J}function n(q,J,oe){if(q.customInspect&&J&&d(J.inspect)&&J.inspect!==ee.inspect&&!(J.constructor&&J.constructor.prototype===J)){var ye=J.inspect(oe,q);return b(ye)||(ye=n(q,ye,oe)),ye}var pe=i(q,J);if(pe)return pe;var ge=Object.keys(J),W=o(ge);if(q.showHidden&&(ge=Object.getOwnPropertyNames(J)),u(J)&&(ge.indexOf("message")>=0||ge.indexOf("description")>=0))return a(J);if(ge.length===0){if(d(J)){var ae=J.name?": "+J.name:"";return q.stylize("[Function"+ae+"]","special")}if(_(J))return q.stylize(RegExp.prototype.toString.call(J),"regexp");if(m(J))return q.stylize(Date.prototype.toString.call(J),"date");if(u(J))return a(J)}var se="",Q=!1,me=["{","}"];if(v(J)&&(Q=!0,me=["[","]"]),d(J)){var ie=J.name?": "+J.name:"";se=" [Function"+ie+"]"}if(_(J)&&(se=" "+RegExp.prototype.toString.call(J)),m(J)&&(se=" "+Date.prototype.toUTCString.call(J)),u(J)&&(se=" "+a(J)),ge.length===0&&(!Q||J.length==0))return me[0]+se+me[1];if(oe<0)return _(J)?q.stylize(RegExp.prototype.toString.call(J),"regexp"):q.stylize("[Object]","special");q.seen.push(J);var Y;return Q?Y=s(q,J,oe,W,ge):Y=ge.map(function(le){return f(q,J,oe,W,le,Q)}),q.seen.pop(),c(Y,se,me)}function i(q,J){if(E(J))return q.stylize("undefined","undefined");if(b(J)){var oe="'"+JSON.stringify(J).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return q.stylize(oe,"string")}if(g(J))return q.stylize(""+J,"number");if(p(J))return q.stylize(""+J,"boolean");if(T(J))return q.stylize("null","null")}function a(q){return"["+Error.prototype.toString.call(q)+"]"}function s(q,J,oe,ye,pe){for(var ge=[],W=0,ae=J.length;W-1&&(ge?ae=ae.split(` `).map(function(Q){return" "+Q}).join(` `).slice(2):ae=` `+ae.split(` `).map(function(Q){return" "+Q}).join(` `))):ae=q.stylize("[Circular]","special")),E(W)){if(ge&&pe.match(/^\d+$/))return ae;W=JSON.stringify(""+pe),W.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(W=W.slice(1,-1),W=q.stylize(W,"name")):(W=W.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),W=q.stylize(W,"string"))}return W+": "+ae}function c(q,J,oe){var ye=q.reduce(function(pe,ge){return ge.indexOf(` `)>=0,pe+ge.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ye>60?oe[0]+(J===""?"":J+` `)+" "+q.join(`, `)+" "+oe[1]:oe[0]+J+" "+q.join(", ")+" "+oe[1]}ee.types=J2();function v(q){return Array.isArray(q)}ee.isArray=v;function p(q){return typeof q=="boolean"}ee.isBoolean=p;function T(q){return q===null}ee.isNull=T;function l(q){return q==null}ee.isNullOrUndefined=l;function g(q){return typeof q=="number"}ee.isNumber=g;function b(q){return typeof q=="string"}ee.isString=b;function A(q){return typeof q=="symbol"}ee.isSymbol=A;function E(q){return q===void 0}ee.isUndefined=E;function _(q){return w(q)&&R(q)==="[object RegExp]"}ee.isRegExp=_,ee.types.isRegExp=_;function w(q){return typeof q=="object"&&q!==null}ee.isObject=w;function m(q){return w(q)&&R(q)==="[object Date]"}ee.isDate=m,ee.types.isDate=m;function u(q){return w(q)&&(R(q)==="[object Error]"||q instanceof Error)}ee.isError=u,ee.types.isNativeError=u;function d(q){return typeof q=="function"}ee.isFunction=d;function y(q){return q===null||typeof q=="boolean"||typeof q=="number"||typeof q=="string"||typeof q=="symbol"||typeof q>"u"}ee.isPrimitive=y,ee.isBuffer=Q2();function R(q){return Object.prototype.toString.call(q)}function L(q){return q<10?"0"+q.toString(10):q.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var q=new Date,J=[L(q.getHours()),L(q.getMinutes()),L(q.getSeconds())].join(":");return[q.getDate(),z[q.getMonth()],J].join(" ")}ee.log=function(){console.log("%s - %s",N(),ee.format.apply(ee,arguments))},ee.inherits=Ov(),ee._extend=function(q,J){if(!J||!w(J))return q;for(var oe=Object.keys(J),ye=oe.length;ye--;)q[oe[ye]]=J[oe[ye]];return q};function U(q,J){return Object.prototype.hasOwnProperty.call(q,J)}var B=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;ee.promisify=function(J){if(typeof J!="function")throw new TypeError('The "original" argument must be of type Function');if(B&&J[B]){var oe=J[B];if(typeof oe!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(oe,B,{value:oe,enumerable:!1,writable:!1,configurable:!0}),oe}function oe(){for(var ye,pe,ge=new Promise(function(se,Q){ye=se,pe=Q}),W=[],ae=0;ae0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(v){var p={data:v,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var v=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,v}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(v){if(this.length===0)return"";for(var p=this.head,T=""+p.data;p=p.next;)T+=v+p.data;return T}},{key:"concat",value:function(v){if(this.length===0)return o.alloc(0);for(var p=o.allocUnsafe(v>>>0),T=this.head,l=0;T;)s(T.data,p,l),l+=T.data.length,T=T.next;return p}},{key:"consume",value:function(v,p){var T;return vg.length?g.length:v;if(b===g.length?l+=g:l+=g.slice(0,v),v-=b,v===0){b===g.length?(++T,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=g.slice(b));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(v){var p=o.allocUnsafe(v),T=this.head,l=1;for(T.data.copy(p),v-=T.data.length;T=T.next;){var g=T.data,b=v>g.length?g.length:v;if(g.copy(p,p.length-v,0,b),v-=b,v===0){b===g.length?(++l,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=g.slice(b));break}++l}return this.length-=l,p}},{key:a,value:function(v,p){return i(this,x({},p,{depth:0,customInspect:!1}))}}]),f}()}}),tT=_e({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(ee,X){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(x,n,s)):process.nextTick(x,n,s):o?(process.nextTick(S,n),o(s)):process.nextTick(S,n)}),this)}function x(r,o){e(r,o),S(r)}function S(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function k(){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)}X.exports={destroy:h,undestroy:k,errorOrDestroy:t}}}),hm=_e({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(ee,X){function h(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.__proto__=n}var x={};function S(o,n,i){i||(i=Error);function a(f,c,v){return typeof n=="string"?n:n(f,c,v)}var s=function(f){h(c,f);function c(v,p,T){return f.call(this,a(v,p,T))||this}return c}(i);s.prototype.name=i.name,s.prototype.code=o,x[o]=s}function k(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(k(n,"type"));else{var f=r(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(f," ").concat(a," ").concat(k(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"),X.exports.codes=x}}),rT=_e({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(ee,X){var h=hm().codes.ERR_INVALID_OPT_VALUE;function x(k,e,t){return k.highWaterMark!=null?k.highWaterMark:e?k[t]:null}function S(k,e,t,r){var o=x(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 k.objectMode?16:16*1024}X.exports={getHighWaterMark:S}}}),Mk=_e({"node_modules/util-deprecate/browser.js"(ee,X){X.exports=h;function h(S,k){if(x("noDeprecation"))return S;var e=!1;function t(){if(!e){if(x("throwDeprecation"))throw new Error(k);x("traceDeprecation")?console.trace(k):console.warn(k),e=!0}return S.apply(this,arguments)}return t}function x(S){try{if(!window.localStorage)return!1}catch{return!1}var k=window.localStorage[S];return k==null?!1:String(k).toLowerCase()==="true"}}}),nT=_e({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(ee,X){X.exports=m;function h(W){var ae=this;this.next=null,this.entry=null,this.finish=function(){ge(ae,W)}}var x;m.WritableState=_;var S={deprecate:Mk()},k=q2(),e=cm().Buffer,t=window.Uint8Array||function(){};function r(W){return e.from(W)}function o(W){return e.isBuffer(W)||W instanceof t}var n=tT(),i=rT(),a=i.getHighWaterMark,s=hm().codes,f=s.ERR_INVALID_ARG_TYPE,c=s.ERR_METHOD_NOT_IMPLEMENTED,v=s.ERR_MULTIPLE_CALLBACK,p=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,g=s.ERR_STREAM_WRITE_AFTER_END,b=s.ERR_UNKNOWN_ENCODING,A=n.errorOrDestroy;Ov()(m,k);function E(){}function _(W,ae,se){x=x||dm(),W=W||{},typeof se!="boolean"&&(se=ae instanceof x),this.objectMode=!!W.objectMode,se&&(this.objectMode=this.objectMode||!!W.writableObjectMode),this.highWaterMark=a(this,W,"writableHighWaterMark",se),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Q=W.decodeStrings===!1;this.decodeStrings=!Q,this.defaultEncoding=W.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(me){U(ae,me)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=W.emitClose!==!1,this.autoDestroy=!!W.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new h(this)}_.prototype.getBuffer=function(){for(var ae=this.bufferedRequest,se=[];ae;)se.push(ae),ae=ae.next;return se},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(ae){return w.call(this,ae)?!0:this!==m?!1:ae&&ae._writableState instanceof _}})):w=function(ae){return ae instanceof this};function m(W){x=x||dm();var ae=this instanceof x;if(!ae&&!w.call(m,this))return new m(W);this._writableState=new _(W,this,ae),this.writable=!0,W&&(typeof W.write=="function"&&(this._write=W.write),typeof W.writev=="function"&&(this._writev=W.writev),typeof W.destroy=="function"&&(this._destroy=W.destroy),typeof W.final=="function"&&(this._final=W.final)),k.call(this)}m.prototype.pipe=function(){A(this,new p)};function u(W,ae){var se=new g;A(W,se),process.nextTick(ae,se)}function d(W,ae,se,Q){var me;return se===null?me=new l:typeof se!="string"&&!ae.objectMode&&(me=new f("chunk",["string","Buffer"],se)),me?(A(W,me),process.nextTick(Q,me),!1):!0}m.prototype.write=function(W,ae,se){var Q=this._writableState,me=!1,ie=!Q.objectMode&&o(W);return ie&&!e.isBuffer(W)&&(W=r(W)),typeof ae=="function"&&(se=ae,ae=null),ie?ae="buffer":ae||(ae=Q.defaultEncoding),typeof se!="function"&&(se=E),Q.ending?u(this,se):(ie||d(this,Q,W,se))&&(Q.pendingcb++,me=R(this,Q,ie,W,ae,se)),me},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var W=this._writableState;W.corked&&(W.corked--,!W.writing&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&j(this,W))},m.prototype.setDefaultEncoding=function(ae){if(typeof ae=="string"&&(ae=ae.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((ae+"").toLowerCase())>-1))throw new b(ae);return this._writableState.defaultEncoding=ae,this},Object.defineProperty(m.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function y(W,ae,se){return!W.objectMode&&W.decodeStrings!==!1&&typeof ae=="string"&&(ae=e.from(ae,se)),ae}Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function R(W,ae,se,Q,me,ie){if(!se){var Y=y(ae,Q,me);Q!==Y&&(se=!0,me="buffer",Q=Y)}var le=ae.objectMode?1:Q.length;ae.length+=le;var ue=ae.length>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function t(T,l,g){var b=l.length-1;if(b=0?(A>0&&(T.lastNeed=A-1),A):--b=0?(A>0&&(T.lastNeed=A-2),A):--b=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 b=T.length-(g-this.lastNeed);return T.copy(this.lastChar,0,b),T.toString("utf8",l,b)}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 b=g.charCodeAt(g.length-1);if(b>=55296&&b<=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 v(T){return T.toString(this.encoding)}function p(T){return T&&T.length?this.write(T):""}}}),pb=_e({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(ee,X){var h=hm().codes.ERR_STREAM_PREMATURE_CLOSE;function x(t){var r=!1;return function(){if(!r){r=!0;for(var o=arguments.length,n=new Array(o),i=0;i0)if(typeof Y!="string"&&!Fe.objectMode&&Object.getPrototypeOf(Y)!==k.prototype&&(Y=t(Y)),ue)Fe.endEmitted?E(ie,new l):y(ie,Fe,Y,!0);else if(Fe.ended)E(ie,new p);else{if(Fe.destroyed)return!1;Fe.reading=!1,Fe.decoder&&!le?(Y=Fe.decoder.write(Y),Fe.objectMode||Y.length!==0?y(ie,Fe,Y,!1):j(ie,Fe)):y(ie,Fe,Y,!1)}else ue||(Fe.reading=!1,j(ie,Fe))}return!Fe.ended&&(Fe.length=L?ie=L:(ie--,ie|=ie>>>1,ie|=ie>>>2,ie|=ie>>>4,ie|=ie>>>8,ie|=ie>>>16,ie++),ie}function N(ie,Y){return ie<=0||Y.length===0&&Y.ended?0:Y.objectMode?1:ie!==ie?Y.flowing&&Y.length?Y.buffer.head.data.length:Y.length:(ie>Y.highWaterMark&&(Y.highWaterMark=z(ie)),ie<=Y.length?ie:Y.ended?Y.length:(Y.needReadable=!0,0))}u.prototype.read=function(ie){n("read",ie),ie=parseInt(ie,10);var Y=this._readableState,le=ie;if(ie!==0&&(Y.emittedReadable=!1),ie===0&&Y.needReadable&&((Y.highWaterMark!==0?Y.length>=Y.highWaterMark:Y.length>0)||Y.ended))return n("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended?se(this):B(this),null;if(ie=N(ie,Y),ie===0&&Y.ended)return Y.length===0&&se(this),null;var ue=Y.needReadable;n("need readable",ue),(Y.length===0||Y.length-ie0?Te=ae(ie,Y):Te=null,Te===null?(Y.needReadable=Y.length<=Y.highWaterMark,ie=0):(Y.length-=ie,Y.awaitDrain=0),Y.length===0&&(Y.ended||(Y.needReadable=!0),le!==ie&&Y.ended&&se(this)),Te!==null&&this.emit("data",Te),Te};function U(ie,Y){if(n("onEofChunk"),!Y.ended){if(Y.decoder){var le=Y.decoder.end();le&&le.length&&(Y.buffer.push(le),Y.length+=Y.objectMode?1:le.length)}Y.ended=!0,Y.sync?B(ie):(Y.needReadable=!1,Y.emittedReadable||(Y.emittedReadable=!0,D(ie)))}}function B(ie){var Y=ie._readableState;n("emitReadable",Y.needReadable,Y.emittedReadable),Y.needReadable=!1,Y.emittedReadable||(n("emitReadable",Y.flowing),Y.emittedReadable=!0,process.nextTick(D,ie))}function D(ie){var Y=ie._readableState;n("emitReadable_",Y.destroyed,Y.length,Y.ended),!Y.destroyed&&(Y.length||Y.ended)&&(ie.emit("readable"),Y.emittedReadable=!1),Y.needReadable=!Y.flowing&&!Y.ended&&Y.length<=Y.highWaterMark,W(ie)}function j(ie,Y){Y.readingMore||(Y.readingMore=!0,process.nextTick(q,ie,Y))}function q(ie,Y){for(;!Y.reading&&!Y.ended&&(Y.length1&&me(ue.pipes,ie)!==-1)&&!it&&(n("false write response, pause",ue.awaitDrain),ue.awaitDrain++),le.pause())}function mt(Ae){n("onerror",Ae),ze(),ie.removeListener("error",mt),x(ie,"error")===0&&E(ie,Ae)}w(ie,"error",mt);function ht(){ie.removeListener("finish",qe),ze()}ie.once("close",ht);function qe(){n("onfinish"),ie.removeListener("close",ht),ze()}ie.once("finish",qe);function ze(){n("unpipe"),le.unpipe(ie)}return ie.emit("pipe",le),ue.flowing||(n("pipe resume"),le.resume()),ie};function J(ie){return function(){var le=ie._readableState;n("pipeOnDrain",le.awaitDrain),le.awaitDrain&&le.awaitDrain--,le.awaitDrain===0&&x(ie,"data")&&(le.flowing=!0,W(ie))}}u.prototype.unpipe=function(ie){var Y=this._readableState,le={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1)return ie&&ie!==Y.pipes?this:(ie||(ie=Y.pipes),Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,ie&&ie.emit("unpipe",this,le),this);if(!ie){var ue=Y.pipes,Te=Y.pipesCount;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var Fe=0;Fe0,ue.flowing!==!1&&this.resume()):ie==="readable"&&!ue.endEmitted&&!ue.readableListening&&(ue.readableListening=ue.needReadable=!0,ue.flowing=!1,ue.emittedReadable=!1,n("on readable",ue.length,ue.reading),ue.length?B(this):ue.reading||process.nextTick(ye,this)),le},u.prototype.addListener=u.prototype.on,u.prototype.removeListener=function(ie,Y){var le=S.prototype.removeListener.call(this,ie,Y);return ie==="readable"&&process.nextTick(oe,this),le},u.prototype.removeAllListeners=function(ie){var Y=S.prototype.removeAllListeners.apply(this,arguments);return(ie==="readable"||ie===void 0)&&process.nextTick(oe,this),Y};function oe(ie){var Y=ie._readableState;Y.readableListening=ie.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused?Y.flowing=!0:ie.listenerCount("data")>0&&ie.resume()}function ye(ie){n("readable nexttick read 0"),ie.read(0)}u.prototype.resume=function(){var ie=this._readableState;return ie.flowing||(n("resume"),ie.flowing=!ie.readableListening,pe(this,ie)),ie.paused=!1,this};function pe(ie,Y){Y.resumeScheduled||(Y.resumeScheduled=!0,process.nextTick(ge,ie,Y))}function ge(ie,Y){n("resume",Y.reading),Y.reading||ie.read(0),Y.resumeScheduled=!1,ie.emit("resume"),W(ie),Y.flowing&&!Y.reading&&ie.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 W(ie){var Y=ie._readableState;for(n("flow",Y.flowing);Y.flowing&&ie.read()!==null;);}u.prototype.wrap=function(ie){var Y=this,le=this._readableState,ue=!1;ie.on("end",function(){if(n("wrapped end"),le.decoder&&!le.ended){var Ve=le.decoder.end();Ve&&Ve.length&&Y.push(Ve)}Y.push(null)}),ie.on("data",function(Ve){if(n("wrapped data"),le.decoder&&(Ve=le.decoder.write(Ve)),!(le.objectMode&&Ve==null)&&!(!le.objectMode&&(!Ve||!Ve.length))){var Xe=Y.push(Ve);Xe||(ue=!0,ie.pause())}});for(var Te in ie)this[Te]===void 0&&typeof ie[Te]=="function"&&(this[Te]=function(Xe){return function(){return ie[Xe].apply(ie,arguments)}}(Te));for(var Fe=0;Fe<_.length;Fe++)ie.on(_[Fe],this.emit.bind(this,_[Fe]));return this._read=function(Ve){n("wrapped _read",Ve),ue&&(ue=!1,ie.resume())},this},typeof Symbol=="function"&&(u.prototype[Symbol.asyncIterator]=function(){return b===void 0&&(b=kk()),b(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(Y){this._readableState&&(this._readableState.flowing=Y)}}),u._fromList=ae,Object.defineProperty(u.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ae(ie,Y){if(Y.length===0)return null;var le;return Y.objectMode?le=Y.buffer.shift():!ie||ie>=Y.length?(Y.decoder?le=Y.buffer.join(""):Y.buffer.length===1?le=Y.buffer.first():le=Y.buffer.concat(Y.length),Y.buffer.clear()):le=Y.buffer.consume(ie,Y.decoder),le}function se(ie){var Y=ie._readableState;n("endReadable",Y.endEmitted),Y.endEmitted||(Y.ended=!0,process.nextTick(Q,Y,ie))}function Q(ie,Y){if(n("endReadableNT",ie.endEmitted,ie.length),!ie.endEmitted&&ie.length===0&&(ie.endEmitted=!0,Y.readable=!1,Y.emit("end"),ie.autoDestroy)){var le=Y._writableState;(!le||le.autoDestroy&&le.finished)&&Y.destroy()}}typeof Symbol=="function"&&(u.from=function(ie,Y){return A===void 0&&(A=Ck()),A(u,ie,Y)});function me(ie,Y){for(var le=0,ue=ie.length;le0;return o(g,A,E,function(_){T||(T=_),_&&l.forEach(n),!A&&(l.forEach(n),p(T))})});return c.reduce(i)}X.exports=s}}),Ik=_e({"node_modules/stream-browserify/index.js"(ee,X){X.exports=S;var h=Op().EventEmitter,x=Ov();x(S,h),S.Readable=iT(),S.Writable=nT(),S.Duplex=dm(),S.Transform=oT(),S.PassThrough=Pk(),S.finished=pb(),S.pipeline=Lk(),S.Stream=S;function S(){h.call(this)}S.prototype.pipe=function(k,e){var t=this;function r(c){k.writable&&k.write(c)===!1&&t.pause&&t.pause()}t.on("data",r);function o(){t.readable&&t.resume&&t.resume()}k.on("drain",o),!k._isStdio&&(!e||e.end!==!1)&&(t.on("end",i),t.on("close",a));var n=!1;function i(){n||(n=!0,k.end())}function a(){n||(n=!0,typeof k.destroy=="function"&&k.destroy())}function s(c){if(f(),h.listenerCount(this,"error")===0)throw c}t.on("error",s),k.on("error",s);function f(){t.removeListener("data",r),k.removeListener("drain",o),t.removeListener("end",i),t.removeListener("close",a),t.removeListener("error",s),k.removeListener("error",s),t.removeListener("end",f),t.removeListener("close",f),k.removeListener("close",f)}return t.on("end",f),t.on("close",f),k.on("close",f),k.emit("pipe",t),k}}}),Eg=_e({"node_modules/util/util.js"(ee){var X=Object.getOwnPropertyDescriptors||function(J){for(var oe=Object.keys(J),ye={},pe=0;pe=pe)return ae;switch(ae){case"%s":return String(ye[oe++]);case"%d":return Number(ye[oe++]);case"%j":try{return JSON.stringify(ye[oe++])}catch{return"[Circular]"}default:return ae}}),W=ye[oe];oe"u")return function(){return ee.deprecate(q,J).apply(this,arguments)};var oe=!1;function ye(){if(!oe){if(process.throwDeprecation)throw new Error(J);process.traceDeprecation?console.trace(J):console.error(J),oe=!0}return q.apply(this,arguments)}return ye};var x={},S=/^$/;k="false",k=k.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),S=new RegExp("^"+k+"$","i");var k;ee.debuglog=function(q){if(q=q.toUpperCase(),!x[q])if(S.test(q)){var J=process.pid;x[q]=function(){var oe=ee.format.apply(ee,arguments);console.error("%s %d: %s",q,J,oe)}}else x[q]=function(){};return x[q]};function e(q,J){var oe={seen:[],stylize:r};return arguments.length>=3&&(oe.depth=arguments[2]),arguments.length>=4&&(oe.colors=arguments[3]),p(J)?oe.showHidden=J:J&&ee._extend(oe,J),E(oe.showHidden)&&(oe.showHidden=!1),E(oe.depth)&&(oe.depth=2),E(oe.colors)&&(oe.colors=!1),E(oe.customInspect)&&(oe.customInspect=!0),oe.colors&&(oe.stylize=t),n(oe,q,oe.depth)}ee.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(q,J){var oe=e.styles[J];return oe?"\x1B["+e.colors[oe][0]+"m"+q+"\x1B["+e.colors[oe][1]+"m":q}function r(q,J){return q}function o(q){var J={};return q.forEach(function(oe,ye){J[oe]=!0}),J}function n(q,J,oe){if(q.customInspect&&J&&d(J.inspect)&&J.inspect!==ee.inspect&&!(J.constructor&&J.constructor.prototype===J)){var ye=J.inspect(oe,q);return b(ye)||(ye=n(q,ye,oe)),ye}var pe=i(q,J);if(pe)return pe;var ge=Object.keys(J),W=o(ge);if(q.showHidden&&(ge=Object.getOwnPropertyNames(J)),u(J)&&(ge.indexOf("message")>=0||ge.indexOf("description")>=0))return a(J);if(ge.length===0){if(d(J)){var ae=J.name?": "+J.name:"";return q.stylize("[Function"+ae+"]","special")}if(_(J))return q.stylize(RegExp.prototype.toString.call(J),"regexp");if(m(J))return q.stylize(Date.prototype.toString.call(J),"date");if(u(J))return a(J)}var se="",Q=!1,me=["{","}"];if(v(J)&&(Q=!0,me=["[","]"]),d(J)){var ie=J.name?": "+J.name:"";se=" [Function"+ie+"]"}if(_(J)&&(se=" "+RegExp.prototype.toString.call(J)),m(J)&&(se=" "+Date.prototype.toUTCString.call(J)),u(J)&&(se=" "+a(J)),ge.length===0&&(!Q||J.length==0))return me[0]+se+me[1];if(oe<0)return _(J)?q.stylize(RegExp.prototype.toString.call(J),"regexp"):q.stylize("[Object]","special");q.seen.push(J);var Y;return Q?Y=s(q,J,oe,W,ge):Y=ge.map(function(le){return f(q,J,oe,W,le,Q)}),q.seen.pop(),c(Y,se,me)}function i(q,J){if(E(J))return q.stylize("undefined","undefined");if(b(J)){var oe="'"+JSON.stringify(J).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return q.stylize(oe,"string")}if(g(J))return q.stylize(""+J,"number");if(p(J))return q.stylize(""+J,"boolean");if(T(J))return q.stylize("null","null")}function a(q){return"["+Error.prototype.toString.call(q)+"]"}function s(q,J,oe,ye,pe){for(var ge=[],W=0,ae=J.length;W-1&&(ge?ae=ae.split(` `).map(function(Q){return" "+Q}).join(` `).slice(2):ae=` `+ae.split(` `).map(function(Q){return" "+Q}).join(` `))):ae=q.stylize("[Circular]","special")),E(W)){if(ge&&pe.match(/^\d+$/))return ae;W=JSON.stringify(""+pe),W.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(W=W.slice(1,-1),W=q.stylize(W,"name")):(W=W.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),W=q.stylize(W,"string"))}return W+": "+ae}function c(q,J,oe){var ye=q.reduce(function(pe,ge){return ge.indexOf(` `)>=0,pe+ge.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ye>60?oe[0]+(J===""?"":J+` `)+" "+q.join(`, `)+" "+oe[1]:oe[0]+J+" "+q.join(", ")+" "+oe[1]}ee.types=J2();function v(q){return Array.isArray(q)}ee.isArray=v;function p(q){return typeof q=="boolean"}ee.isBoolean=p;function T(q){return q===null}ee.isNull=T;function l(q){return q==null}ee.isNullOrUndefined=l;function g(q){return typeof q=="number"}ee.isNumber=g;function b(q){return typeof q=="string"}ee.isString=b;function A(q){return typeof q=="symbol"}ee.isSymbol=A;function E(q){return q===void 0}ee.isUndefined=E;function _(q){return w(q)&&R(q)==="[object RegExp]"}ee.isRegExp=_,ee.types.isRegExp=_;function w(q){return typeof q=="object"&&q!==null}ee.isObject=w;function m(q){return w(q)&&R(q)==="[object Date]"}ee.isDate=m,ee.types.isDate=m;function u(q){return w(q)&&(R(q)==="[object Error]"||q instanceof Error)}ee.isError=u,ee.types.isNativeError=u;function d(q){return typeof q=="function"}ee.isFunction=d;function y(q){return q===null||typeof q=="boolean"||typeof q=="number"||typeof q=="string"||typeof q=="symbol"||typeof q>"u"}ee.isPrimitive=y,ee.isBuffer=Q2();function R(q){return Object.prototype.toString.call(q)}function L(q){return q<10?"0"+q.toString(10):q.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var q=new Date,J=[L(q.getHours()),L(q.getMinutes()),L(q.getSeconds())].join(":");return[q.getDate(),z[q.getMonth()],J].join(" ")}ee.log=function(){console.log("%s - %s",N(),ee.format.apply(ee,arguments))},ee.inherits=Ov(),ee._extend=function(q,J){if(!J||!w(J))return q;for(var oe=Object.keys(J),ye=oe.length;ye--;)q[oe[ye]]=J[oe[ye]];return q};function U(q,J){return Object.prototype.hasOwnProperty.call(q,J)}var B=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;ee.promisify=function(J){if(typeof J!="function")throw new TypeError('The "original" argument must be of type Function');if(B&&J[B]){var oe=J[B];if(typeof oe!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(oe,B,{value:oe,enumerable:!1,writable:!1,configurable:!0}),oe}function oe(){for(var ye,pe,ge=new Promise(function(se,Q){ye=se,pe=Q}),W=[],ae=0;ae"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,b,A){A||(A=Error);function E(w,m,u){return typeof b=="string"?b:b(w,m,u)}var _=function(w){k(u,w);var m=t(u);function u(d,y,R){var L;return S(this,u),L=m.call(this,E(d,y,R)),L.code=g,L}return x(u)}(A);a[g]=_}function v(g,b){if(Array.isArray(g)){var A=g.length;return g=g.map(function(E){return String(E)}),A>2?"one of ".concat(b," ").concat(g.slice(0,A-1).join(", "),", or ")+g[A-1]:A===2?"one of ".concat(b," ").concat(g[0]," or ").concat(g[1]):"of ".concat(b," ").concat(g[0])}else return"of ".concat(b," ").concat(String(g))}function p(g,b,A){return g.substr(0,b.length)===b}function T(g,b,A){return(A===void 0||A>g.length)&&(A=g.length),g.substring(A-b.length,A)===b}function l(g,b,A){return typeof A!="number"&&(A=0),A+b.length>g.length?!1:g.indexOf(b,A)!==-1}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(g,b,A){s===void 0&&(s=Hy()),s(typeof g=="string","'name' must be a string");var E;typeof b=="string"&&p(b,"not ")?(E="must not be",b=b.replace(/^not /,"")):E="must be";var _;if(T(g," argument"))_="The ".concat(g," ").concat(E," ").concat(v(b,"type"));else{var w=l(g,".")?"property":"argument";_='The "'.concat(g,'" ').concat(w," ").concat(E," ").concat(v(b,"type"))}return _+=". Received type ".concat(h(A)),_},TypeError),c("ERR_INVALID_ARG_VALUE",function(g,b){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";f===void 0&&(f=Eg());var E=f.inspect(b);return E.length>128&&(E="".concat(E.slice(0,128),"...")),"The argument '".concat(g,"' ").concat(A,". Received ").concat(E)},TypeError),c("ERR_INVALID_RETURN_VALUE",function(g,b,A){var E;return A&&A.constructor&&A.constructor.name?E="instance of ".concat(A.constructor.name):E="type ".concat(h(A)),"Expected ".concat(g,' to be returned from the "').concat(b,'"')+" function but got ".concat(E,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var g=arguments.length,b=new Array(g),A=0;A0,"At least one arg needs to be specified");var E="The ",_=b.length;switch(b=b.map(function(w){return'"'.concat(w,'"')}),_){case 1:E+="".concat(b[0]," argument");break;case 2:E+="".concat(b[0]," and ").concat(b[1]," arguments");break;default:E+=b.slice(0,_-1).join(", "),E+=", and ".concat(b[_-1]," arguments");break}return"".concat(E," must be specified")},TypeError),X.exports.codes=a}}),Dk=_e({"node_modules/assert/build/internal/assert/assertion_error.js"(ee,X){function h(j,q){var J=Object.keys(j);if(Object.getOwnPropertySymbols){var oe=Object.getOwnPropertySymbols(j);q&&(oe=oe.filter(function(ye){return Object.getOwnPropertyDescriptor(j,ye).enumerable})),J.push.apply(J,oe)}return J}function x(j){for(var q=1;q"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 p(j){return Function.toString.call(j).indexOf("[native code]")!==-1}function T(j,q){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(oe,ye){return oe.__proto__=ye,oe},T(j,q)}function l(j){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(J){return J.__proto__||Object.getPrototypeOf(J)},l(j)}function g(j){"@babel/helpers - typeof";return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q},g(j)}var b=Eg(),A=b.inspect,E=sT(),_=E.codes.ERR_INVALID_ARG_TYPE;function w(j,q,J){return(J===void 0||J>j.length)&&(J=j.length),j.substring(J-q.length,J)===q}function m(j,q){if(q=Math.floor(q),j.length==0||q==0)return"";var J=j.length*q;for(q=Math.floor(Math.log(q)/Math.log(2));q;)j+=j,q--;return j+=j.substring(0,J-j.length),j}var u="",d="",y="",R="",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 N(j){var q=Object.keys(j),J=Object.create(Object.getPrototypeOf(j));return q.forEach(function(oe){J[oe]=j[oe]}),Object.defineProperty(J,"message",{value:j.message}),J}function U(j){return A(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function B(j,q,J){var oe="",ye="",pe=0,ge="",W=!1,ae=U(j),se=ae.split(` `),Q=U(q).split(` `),me=0,ie="";if(J==="strictEqual"&&g(j)==="object"&&g(q)==="object"&&j!==null&&q!==null&&(J="strictEqualObject"),se.length===1&&Q.length===1&&se[0]!==Q[0]){var Y=se[0].length+Q[0].length;if(Y<=z){if((g(j)!=="object"||j===null)&&(g(q)!=="object"||q===null)&&(j!==0||q!==0))return"".concat(L[J],` `)+"".concat(se[0]," !== ").concat(Q[0],` `)}else if(J!=="strictEqualObject"){var le=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(Y2&&(ie=` `.concat(m(" ",me),"^"),me=0)}}}for(var ue=se[se.length-1],Te=Q[Q.length-1];ue===Te&&(me++<2?ge=` `.concat(ue).concat(ge):oe=ue,se.pop(),Q.pop(),!(se.length===0||Q.length===0));)ue=se[se.length-1],Te=Q[Q.length-1];var Fe=Math.max(se.length,Q.length);if(Fe===0){var Ve=ae.split(` `);if(Ve.length>30)for(Ve[26]="".concat(u,"...").concat(R);Ve.length>27;)Ve.pop();return"".concat(L.notIdentical,` `).concat(Ve.join(` `),` `)}me>3&&(ge=` `.concat(u,"...").concat(R).concat(ge),W=!0),oe!==""&&(ge=` `.concat(oe).concat(ge),oe="");var Xe=0,We=L[J]+` `.concat(d,"+ actual").concat(R," ").concat(y,"- expected").concat(R),it=" ".concat(u,"...").concat(R," Lines skipped");for(me=0;me1&&me>2&&(yt>4?(ye+=` `.concat(u,"...").concat(R),W=!0):yt>3&&(ye+=` `.concat(Q[me-2]),Xe++),ye+=` `.concat(Q[me-1]),Xe++),pe=me,oe+=` `.concat(y,"-").concat(R," ").concat(Q[me]),Xe++;else if(Q.length1&&me>2&&(yt>4?(ye+=` `.concat(u,"...").concat(R),W=!0):yt>3&&(ye+=` `.concat(se[me-2]),Xe++),ye+=` `.concat(se[me-1]),Xe++),pe=me,ye+=` `.concat(d,"+").concat(R," ").concat(se[me]),Xe++;else{var bt=Q[me],mt=se[me],ht=mt!==bt&&(!w(mt,",")||mt.slice(0,-1)!==bt);ht&&w(bt,",")&&bt.slice(0,-1)===mt&&(ht=!1,mt+=","),ht?(yt>1&&me>2&&(yt>4?(ye+=` `.concat(u,"...").concat(R),W=!0):yt>3&&(ye+=` `.concat(se[me-2]),Xe++),ye+=` `.concat(se[me-1]),Xe++),pe=me,ye+=` `.concat(d,"+").concat(R," ").concat(mt),oe+=` `.concat(y,"-").concat(R," ").concat(bt),Xe+=2):(ye+=oe,oe="",(yt===1||me===0)&&(ye+=` `.concat(mt),Xe++))}if(Xe>20&&me30)for(Y[26]="".concat(u,"...").concat(R);Y.length>27;)Y.pop();Y.length===1?pe=J.call(this,"".concat(ie," ").concat(Y[0])):pe=J.call(this,"".concat(ie,` `).concat(Y.join(` `),` `))}else{var le=U(se),ue="",Te=L[W];W==="notDeepEqual"||W==="notEqual"?(le="".concat(L[W],` `).concat(le),le.length>1024&&(le="".concat(le.slice(0,1021),"..."))):(ue="".concat(U(Q)),le.length>512&&(le="".concat(le.slice(0,509),"...")),ue.length>512&&(ue="".concat(ue.slice(0,509),"...")),W==="deepEqual"||W==="equal"?le="".concat(Te,` `).concat(le,` should equal `):ue=" ".concat(W," ").concat(ue)),pe=J.call(this,"".concat(le).concat(ue))}return Error.stackTraceLimit=me,pe.generatedMessage=!ge,Object.defineProperty(s(pe),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),pe.code="ERR_ASSERTION",pe.actual=se,pe.expected=Q,pe.operator=W,Error.captureStackTrace&&Error.captureStackTrace(s(pe),ae),pe.stack,pe.name="AssertionError",a(pe)}return t(oe,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:q,value:function(pe,ge){return A(this,x(x({},ge),{},{customInspect:!1,depth:0}))}}]),oe}(f(Error),A.custom);X.exports=D}}),lT=_e({"node_modules/object-keys/isArguments.js"(ee,X){var h=Object.prototype.toString;X.exports=function(S){var k=h.call(S),e=k==="[object Arguments]";return e||(e=k!=="[object Array]"&&S!==null&&typeof S=="object"&&typeof S.length=="number"&&S.length>=0&&h.call(S.callee)==="[object Function]"),e}}}),Rk=_e({"node_modules/object-keys/implementation.js"(ee,X){var h;Object.keys||(x=Object.prototype.hasOwnProperty,S=Object.prototype.toString,k=lT(),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]&&x.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 v=c!==null&&typeof c=="object",p=S.call(c)==="[object Function]",T=k(c),l=v&&S.call(c)==="[object String]",g=[];if(!v&&!p&&!T)throw new TypeError("Object.keys called on a non-object");var b=r&&p;if(l&&c.length>0&&!x.call(c,0))for(var A=0;A0)for(var E=0;E2?arguments[2]:{},c=h(s);x&&(c=k.call(c,Object.getOwnPropertySymbols(s)));for(var v=0;vht.length)&&(qe=ht.length);for(var ze=0,Ae=new Array(qe);ze10)return!0;for(var qe=0;qe57)return!0}return ht.length===10&&ht>=Math.pow(2,32)}function D(ht){return Object.keys(ht).filter(B).concat(s(ht).filter(Object.prototype.propertyIsEnumerable.bind(ht)))}function j(ht,qe){if(ht===qe)return 0;for(var ze=ht.length,Ae=qe.length,Ke=0,_t=Math.min(ze,Ae);Ke<_t;++Ke)if(ht[Ke]!==qe[Ke]){ze=ht[Ke],Ae=qe[Ke];break}return ze1?W-1:0),se=1;se1?W-1:0),se=1;se1?W-1:0),se=1;se1?W-1:0),se=1;se0)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*k;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*x;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>=k?Math.round(i/k)+"d":i>=S?Math.round(i/S)+"h":i>=x?Math.round(i/x)+"m":i>=h?Math.round(i/h)+"s":i+"ms"}function o(i){return n(i,k,"day")||n(i,S,"hour")||n(i,x,"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+)/)}ee.formatters.j=function(r){try{return JSON.stringify(r)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};function x(r){var o=this.useColors;if(r[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+r[0]+(o?"%c ":" ")+"+"+ee.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 k(r){try{r==null?ee.storage.removeItem("debug"):ee.storage.debug=r}catch{}}function e(){var r;try{r=ee.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=M.DEBUG),r}ee.enable(e());function t(){try{return window.localStorage}catch{}}}}),Hk=_e({"node_modules/stream-parser/index.js"(ee,X){var h=Hy(),x=Gk()("stream-parser");X.exports=r;var S=-1,k=0,e=1,t=2;function r(l){var g=l&&typeof l._transform=="function",b=l&&typeof l._write=="function";if(!g&&!b)throw new Error("must pass a Writable or Transform stream in");x("extending Parser into stream"),l._bytes=n,l._skipBytes=i,g&&(l._passthrough=a),g?l._transform=f:l._write=s}function o(l){x("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),x("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=k}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),x("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),x("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=g,this._parserState=t}function s(l,g,b){this._parserInit||o(this),x("write(%o bytes)",l.length),typeof g=="function"&&(b=g),p(this,l,null,b)}function f(l,g,b){this._parserInit||o(this),x("transform(%o bytes)",l.length),typeof g!="function"&&(g=this._parserOutput),p(this,l,g,b)}function c(l,g,b,A){return l._parserBytesLeft<=0?A(new Error("got data but not currently parsing anything")):g.length<=l._parserBytesLeft?function(){return v(l,g,b,A)}:function(){var E=g.slice(0,l._parserBytesLeft);return v(l,E,b,function(_){if(_)return A(_);if(g.length>E.length)return function(){return c(l,g.slice(E.length),b,A)}})}}function v(l,g,b,A){if(l._parserBytesLeft-=g.length,x("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===k?(l._parserBuffers.push(g),l._parserBuffered+=g.length):l._parserState===t&&b(g),l._parserBytesLeft===0){var E=l._parserCallback;if(E&&l._parserState===k&&l._parserBuffers.length>1&&(g=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==k&&(g=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=S,l._parserBuffers.splice(0),E){var _=[];g&&_.push(g),b&&_.push(b);var w=E.length>_.length;w&&_.push(T(A));var m=E.apply(l,_);if(!w||A===m)return A}}else return A}var p=T(c);function T(l){return function(){for(var g=l.apply(this,arguments);typeof g=="function";)g=g();return g}}}}),Vc=_e({"node_modules/probe-image-size/lib/common.js"(ee){var X=Ik().Transform,h=Hk();function x(){X.call(this,{readableObjectMode:!0})}x.prototype=Object.create(X.prototype),x.prototype.constructor=x,h(x.prototype),ee.ParserStream=x,ee.sliceEq=function(k,e,t){for(var r=e,o=0;o>4&15,c=a[4]&15,v=a[5]>>4&15,p=h(a,6),T=8,l=0;lp.width||v.width===p.width&&v.height>p.height?v:p}),f=a.reduce(function(v,p){return v.height>p.height||v.height===p.height&&v.width>p.width?v:p}),c;return s.width>f.height||s.width===f.height&&s.height>f.width?c=s:c=f,c}X.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(p){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(p.type==="imir"&&(p.value===0?c=l[c]:(c=l[c],c=T[c],c=T[c])),p.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,k)}},S.prototype.read_uint16=function(k){var e=this.input;if(k+2>e.length)throw h("unexpected EOF","EBADDATA");return this.big_endian?e[k]*256+e[k+1]:e[k]+e[k+1]*256},S.prototype.read_uint32=function(k){var e=this.input;if(k+4>e.length)throw h("unexpected EOF","EBADDATA");return this.big_endian?e[k]*16777216+e[k+1]*65536+e[k+2]*256+e[k+3]:e[k]+e[k+1]*256+e[k+2]*65536+e[k+3]*16777216},S.prototype.is_subifd_link=function(k,e){return k===0&&e===34665||k===0&&e===34853||k===34665&&e===40965},S.prototype.exif_format_length=function(k){switch(k){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(k,e){var t;switch(k){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(k,e,t){var r=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw h("unexpected EOF","EBADDATA");for(var p=[],T=c,l=0;l0&&(this.ifds_to_read.push({id:n,offset:p[0]}),v=!0);var b={is_big_endian:this.big_endian,ifd:k,tag:n,format:i,count:a,entry_offset:e+this.start,data_length:f,data_offset:c+this.start,value:p,is_subifd_link:v};if(t(b)===!1){this.aborted=!0;return}e+=12}k===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},X.exports.ExifParser=S,X.exports.get_orientation=function(k){var e=0;try{return new S(k,0,k.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}}}}),Wk=_e({"node_modules/probe-image-size/lib/parse_sync/avif.js"(ee,X){var h=Vc().str2arr,x=Vc().sliceEq,S=Vc().readUInt32BE,k=$k(),e=mb(),t=h("ftyp");X.exports=function(r){if(x(r,4,t)){var o=k.unbox(r,0);if(o){var n=k.getMimeType(o.data);if(n){for(var i,a=o.end;;){var s=k.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=k.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 v=S(r,f.exif_location.offset),p=r.slice(f.exif_location.offset+v+4,f.exif_location.offset+f.exif_location.length),T=e.get_orientation(p);T>0&&(c.orientation=T)}return c}}}}}}}}),Yk=_e({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(ee,X){var h=Vc().str2arr,x=Vc().sliceEq,S=Vc().readUInt16LE,k=h("BM");X.exports=function(e){if(!(e.length<26)&&x(e,0,k))return{width:S(e,18),height:S(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),Xk=_e({"node_modules/probe-image-size/lib/parse_sync/gif.js"(ee,X){var h=Vc().str2arr,x=Vc().sliceEq,S=Vc().readUInt16LE,k=h("GIF87a"),e=h("GIF89a");X.exports=function(t){if(!(t.length<10)&&!(!x(t,0,k)&&!x(t,0,e)))return{width:S(t,6),height:S(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),Zk=_e({"node_modules/probe-image-size/lib/parse_sync/ico.js"(ee,X){var h=Vc().readUInt16LE,x=0,S=1,k=16;X.exports=function(e){var t=h(e,0),r=h(e,2),o=h(e,4);if(!(t!==x||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"}}}}}),Kk=_e({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(ee,X){var h=Vc().readUInt16BE,x=Vc().str2arr,S=Vc().sliceEq,k=mb(),e=x("Exif\0\0");X.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=k.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}}}}),Jk=_e({"node_modules/probe-image-size/lib/parse_sync/png.js"(ee,X){var h=Vc().str2arr,x=Vc().sliceEq,S=Vc().readUInt32BE,k=h(`‰PNG\r  `),e=h("IHDR");X.exports=function(t){if(!(t.length<24)&&x(t,0,k)&&x(t,12,e))return{width:S(t,16),height:S(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),Qk=_e({"node_modules/probe-image-size/lib/parse_sync/psd.js"(ee,X){var h=Vc().str2arr,x=Vc().sliceEq,S=Vc().readUInt32BE,k=h("8BPS\0");X.exports=function(e){if(!(e.length<22)&&x(e,0,k))return{width:S(e,18),height:S(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),eC=_e({"node_modules/probe-image-size/lib/parse_sync/svg.js"(ee,X){function h(s){return s===32||s===9||s===13||s===10}function x(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),v=s.match(o);return{width:f&&(f[1]||f[2]),height:c&&(c[1]||c[2]),viewbox:v&&(v[1]||v[2])}}function a(s){return n.test(s)?s.match(n)[0]:"px"}X.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):p==="VP8L"&&T>=9?f=f||n(a,s+8):p==="VP8X"&&T>=10?f=f||i(a,s+8):p==="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}}}}}),nC=_e({"node_modules/probe-image-size/lib/parsers_sync.js"(ee,X){X.exports={avif:Wk(),bmp:Yk(),gif:Xk(),ico:Zk(),jpeg:Kk(),png:Jk(),psd:Qk(),svg:eC(),tiff:tC(),webp:rC()}}}),aC=_e({"node_modules/probe-image-size/sync.js"(ee,X){var h=nC();function x(S){for(var k=Object.keys(h),e=0;e0;)R=f.c2p(E+U*u),U--;for(U=0;z===void 0&&U0;)N=c.c2p(_+U*d),U--;if(RW[0];if(ae||se){var Q=y+D/2,me=z+j/2;pe+="transform:"+S(Q+"px",me+"px")+"scale("+(ae?-1:1)+","+(se?-1:1)+")"+S(-Q+"px",-me+"px")+";"}}ye.attr("style",pe);var ie=new Promise(function(Y){if(g._hasZ)Y();else if(g._hasSource)if(g._canvas&&g._canvas.el.width===w&&g._canvas.el.height===m&&g._canvas.source===g.source)Y();else{var le=document.createElement("canvas");le.width=w,le.height=m;var ue=le.getContext("2d",{willReadFrequently:!0});g._image=g._image||new Image;var Te=g._image;Te.onload=function(){ue.drawImage(Te,0,0),g._canvas={el:le,source:g.source},Y()},Te.setAttribute("src",g.source)}}).then(function(){var Y,le;if(g._hasZ)le=oe(function(Fe,Ve){var Xe=A[Ve][Fe];return x.isTypedArray(Xe)&&(Xe=Array.from(Xe)),Xe}),Y=le.toDataURL("image/png");else if(g._hasSource)if(b)Y=g.source;else{var ue=g._canvas.el.getContext("2d",{willReadFrequently:!0}),Te=ue.getImageData(0,0,w,m).data;le=oe(function(Fe,Ve){var Xe=4*(Ve*w+Fe);return[Te[Xe],Te[Xe+1],Te[Xe+2],Te[Xe+3]]}),Y=le.toDataURL("image/png")}ye.attr({"xlink:href":Y,height:j,width:D,x:y,y:z})});n._promises.push(ie)})}}}),lC=_e({"src/traces/image/style.js"(ee,X){var h=mr();X.exports=function(S){h.select(S).selectAll(".im image").style("opacity",function(k){return k[0].trace.opacity})}}}),uC=_e({"src/traces/image/hover.js"(ee,X){var h=zf(),x=kn(),S=x.isArrayOrTypedArray,k=Tg();X.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),v;if(i._hasZ?v=n.z[c][f]:i._hasSource&&(v=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(f,c,1,1).data),!!v){var p=n.hi||i.hoverinfo,T;if(p){var l=p.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var g=k.colormodel[i.colormodel],b=g.colormodel||i.colormodel,A=b.length,E=i._scaler(v),_=g.suffix,w=[];(i.hovertemplate||T)&&(w.push("["+[E[0]+_[0],E[1]+_[1],E[2]+_[2]].join(", ")),A===4&&w.push(", "+E[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=b.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),d=n.x0+(f+.5)*i.dx,y=n.y0+(c+.5)*i.dy,R="["+v.slice(0,i.colormodel.length).join(", ")+"]";return[x.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:E,xVal:d,xLabelVal:d,yVal:y,yLabelVal:y,zLabelVal:R,text:m,hovertemplateLabels:{zLabel:R,colorLabel:w,"color[0]Label":E[0]+_[0],"color[1]Label":E[1]+_[1],"color[2]Label":E[2]+_[2],"color[3]Label":E[3]+_[3]}})]}}}}}),cC=_e({"src/traces/image/event_data.js"(ee,X){X.exports=function(x,S){return"xVal"in S&&(x.x=S.xVal),"yVal"in S&&(x.y=S.yVal),S.xa&&(x.xaxis=S.xa),S.ya&&(x.yaxis=S.ya),x.color=S.color,x.colormodel=S.trace.colormodel,x.z||(x.z=S.color),x}}}),fC=_e({"src/traces/image/index.js"(ee,X){X.exports={attributes:V2(),supplyDefaults:W5(),calc:oC(),plot:sC(),style:lC(),hoverPoints:uC(),eventData:cC(),moduleType:"trace",name:"image",basePlotModule:Mh(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),hC=_e({"lib/image.js"(ee,X){X.exports=fC()}}),pm=_e({"src/traces/pie/attributes.js"(ee,X){var h=Zs(),x=hf().attributes,S=es(),k=Hl(),{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=fu(),o=po().extendFlat,n=Qf().pattern,i=S({editType:"plot",arrayOk:!0,colorEditType:"plot"});X.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:k.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:x({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),vm=_e({"src/traces/pie/defaults.js"(ee,X){var h=jn(),x=kn(),S=pm(),k=hf().defaults,e=up().handleText,t=kn().coercePattern;function r(i,a){var s=x.isArrayOrTypedArray(i),f=x.isArrayOrTypedArray(a),c=Math.min(s?i.length:1/0,f?a.length:1/0);if(isFinite(c)||(c=0),c&&f){for(var v,p=0;p0){v=!0;break}}v||(c=0)}return{hasLabels:s,hasValues:f,len:c}}function o(i,a,s,f,c){var v=f("marker.line.width");v&&f("marker.line.color",c?void 0:s.paper_bgcolor);var p=f("marker.colors");t(f,"marker.pattern",p),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,R){return x.coerce(i,a,S,y,R)}var v=c("labels"),p=c("values"),T=r(v,p),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"),b=c("texttemplate");c("texttemplatefallback");var A;if(b||(A=c("textinfo",x.isArrayOrTypedArray(g)?"text+percent":"percent")),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),b||A&&A!=="none"){var E=c("textposition");e(i,a,f,c,E,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var _=Array.isArray(E)||E==="auto",w=_||E==="outside";w&&c("automargin"),(E==="inside"||E==="auto"||Array.isArray(E))&&c("insidetextorientation")}else A==="none"&&c("textposition","none");k(a,f,c);var m=c("hole"),u=c("title.text");if(u){var d=c("title.position",m?"middle center":"top center");!m&&d==="middle center"&&(a.title.position="top center"),x.coerceFont(c,"title.font",f.font)}c("sort"),c("direction"),c("rotation"),c("pull")}X.exports={handleLabelsAndValues:r,handleMarkerDefaults:o,supplyDefaults:n}}}),gb=_e({"src/traces/pie/layout_attributes.js"(ee,X){X.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),dC=_e({"src/traces/pie/layout_defaults.js"(ee,X){var h=kn(),x=gb();X.exports=function(k,e){function t(r,o){return h.coerce(k,e,x,r,o)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),kg=_e({"src/traces/pie/calc.js"(ee,X){var h=jn(),x=bs(),S=so(),k={};function e(n,i){var a=[],s=n._fullLayout,f=s.hiddenlabels||[],c=i.labels,v=i.marker.colors||[],p=i.values,T=i._length,l=i._hasValues&&T,g,b;if(i.dlabel)for(c=new Array(T),g=0;g=0});var R=i.type==="funnelarea"?w:i.sort;return R&&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=x(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"],v=s["_"+a+"colormap"];s["extend"+a+"colors"]&&(c=o(c,k));for(var p=0,T=0;T0&&(_t+=Yt*Ae.pxmid[0],wt+=Yt*Ae.pxmid[1])}Ae.cxFinal=_t,Ae.cyFinal=wt;function lr(Ot,Qe,ct,Ue){var Ie=Ue*(Qe[0]-Ot[0]),Pe=Ue*(Qe[1]-Ot[1]);return"a"+Ue*Te.r+","+Ue*Te.r+" 0 "+Ae.largeArc+(ct?" 1 ":" 0 ")+Ie+","+Pe}var dr=Fe.hole;if(Ae.v===Te.vTotal){var Nr="M"+(_t+Ae.px0[0])+","+(wt+Ae.px0[1])+lr(Ae.px0,Ae.pxmid,!0,1)+lr(Ae.pxmid,Ae.px0,!0,1)+"Z";dr?$t.attr("d","M"+(_t+dr*Ae.px0[0])+","+(wt+dr*Ae.px0[1])+lr(Ae.px0,Ae.pxmid,!1,dr)+lr(Ae.pxmid,Ae.px0,!1,dr)+"Z"+Nr):$t.attr("d",Nr)}else{var Fr=lr(Ae.px0,Ae.px1,!0,1);if(dr){var ln=1-dr;$t.attr("d","M"+(_t+dr*Ae.px1[0])+","+(wt+dr*Ae.px1[1])+lr(Ae.px1,Ae.px0,!1,dr)+"l"+ln*Ae.px0[0]+","+ln*Ae.px0[1]+Fr+"Z")}else $t.attr("d","M"+_t+","+wt+"l"+Ae.px0[0]+","+Ae.px0[1]+Fr+"Z")}ge(ae,Ae,Te);var zr=c.castOption(Fe.textposition,Ae.pts),Xr=vt.selectAll("g.slicetext").data(Ae.text&&zr!=="none"?[0]:[]);Xr.enter().append("g").classed("slicetext",!0),Xr.exit().remove(),Xr.each(function(){var Ot=t.ensureSingle(h.select(this),"text","",function(ft){ft.attr("data-notex",1)}),Qe=t.ensureUniformFontSize(ae,zr==="outside"?b(Fe,Ae,me.font):A(Fe,Ae,me.font));Ot.text(Ae.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(e.font,Qe).call(n.convertToTspans,ae);var ct=e.bBox(Ot.node()),Ue;if(zr==="outside")Ue=z(ct,Ae);else if(Ue=_(ct,Ae,Te),zr==="auto"&&Ue.scale<1){var Ie=t.ensureUniformFontSize(ae,Fe.outsidetextfont);Ot.call(e.font,Ie),ct=e.bBox(Ot.node()),Ue=z(ct,Ae)}var Pe=Ue.textPosAngle,Be=Pe===void 0?Ae.pxmid:pe(Te.r,Pe);if(Ue.targetX=_t+Be[0]*Ue.rCenter+(Ue.x||0),Ue.targetY=wt+Be[1]*Ue.rCenter+(Ue.y||0),W(Ue,ct),Ue.outside){var at=Ue.targetY;Ae.yLabelMin=at-ct.height/2,Ae.yLabelMid=at,Ae.yLabelMax=at+ct.height/2,Ae.labelExtraX=0,Ae.labelExtraY=0,We=!0}Ue.fontSize=Qe.size,a(Fe.type,Ue,me),le[Ke].transform=Ue,t.setTransormAndDisplay(Ot,Ue)})});var it=h.select(this).selectAll("g.titletext").data(Fe.title.text?[0]:[]);if(it.enter().append("g").classed("titletext",!0),it.exit().remove(),it.each(function(){var Ae=t.ensureSingle(h.select(this),"text","",function(wt){wt.attr("data-notex",1)}),Ke=Fe.title.text;Fe._meta&&(Ke=t.templateString(Ke,Fe._meta)),Ae.text(Ke).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(e.font,Fe.title.font).call(n.convertToTspans,ae);var _t;Fe.title.position==="middle center"?_t=N(Te):_t=U(Te,ie),Ae.attr("transform",o(_t.x,_t.y)+r(Math.min(1,_t.scale))+o(_t.tx,_t.ty))}),We&&q(Xe,Fe),l(Ve,Fe),We&&Fe.automargin){var yt=e.bBox(ue.node()),bt=Fe.domain,mt=ie.w*(bt.x[1]-bt.x[0]),ht=ie.h*(bt.y[1]-bt.y[0]),qe=(.5*mt-Te.r)/ie.w,ze=(.5*ht-Te.r)/ie.h;x.autoMargin(ae,"pie."+Fe.uid+".automargin",{xl:bt.x[0]-qe,xr:bt.x[1]+qe,yb:bt.y[0]-ze,yt:bt.y[1]+ze,l:Math.max(Te.cx-Te.r-yt.left,0),r:Math.max(yt.right-(Te.cx+Te.r),0),b:Math.max(yt.bottom-(Te.cy+Te.r),0),t:Math.max(Te.cy-Te.r-yt.top,0),pad:5})}})});setTimeout(function(){Y.selectAll("tspan").each(function(){var le=h.select(this);le.attr("dy")&&le.attr("dy",le.attr("dy"))})},0)}function l(ae,se){ae.each(function(Q){var me=h.select(this);if(!Q.labelExtraX&&!Q.labelExtraY){me.select("path.textline").remove();return}var ie=me.select("g.slicetext text");Q.transform.targetX+=Q.labelExtraX,Q.transform.targetY+=Q.labelExtraY,t.setTransormAndDisplay(ie,Q.transform);var Y=Q.cxFinal+Q.pxmid[0],le=Q.cyFinal+Q.pxmid[1],ue="M"+Y+","+le,Te=(Q.yLabelMax-Q.yLabelMin)*(Q.pxmid[0]<0?-1:1)/4;if(Q.labelExtraX){var Fe=Q.labelExtraX*Q.pxmid[1]/Q.pxmid[0],Ve=Q.yLabelMid+Q.labelExtraY-(Q.cyFinal+Q.pxmid[1]);Math.abs(Fe)>Math.abs(Ve)?ue+="l"+Ve*Q.pxmid[0]/Q.pxmid[1]+","+Ve+"H"+(Y+Q.labelExtraX+Te):ue+="l"+Q.labelExtraX+","+Fe+"v"+(Ve-Fe)+"h"+Te}else ue+="V"+(Q.yLabelMid+Q.labelExtraY)+"h"+Te;t.ensureSingle(me,"path","textline").call(k.stroke,se.outsidetextfont.color).attr({"stroke-width":Math.min(2,se.outsidetextfont.size/8),d:ue,fill:"none"})})}function g(ae,se,Q){var me=Q[0],ie=me.cx,Y=me.cy,le=me.trace,ue=le.type==="funnelarea";"_hasHoverLabel"in le||(le._hasHoverLabel=!1),"_hasHoverEvent"in le||(le._hasHoverEvent=!1),ae.on("mouseover",function(Te){var Fe=se._fullLayout,Ve=se._fullData[le.index];if(!(se._dragging||Fe.hovermode===!1)){var Xe=Ve.hoverinfo;if(Array.isArray(Xe)&&(Xe=S.castHoverinfo({hoverinfo:[c.castOption(Xe,Te.pts)],_module:le._module},Fe,0)),Xe==="all"&&(Xe="label+text+value+percent+name"),Ve.hovertemplate||Xe!=="none"&&Xe!=="skip"&&Xe){var We=Te.rInscribed||0,it=ie+Te.pxmid[0]*(1-We),yt=Y+Te.pxmid[1]*(1-We),bt=Fe.separators,mt=[];if(Xe&&Xe.indexOf("label")!==-1&&mt.push(Te.label),Te.text=c.castOption(Ve.hovertext||Ve.text,Te.pts),Xe&&Xe.indexOf("text")!==-1){var ht=Te.text;t.isValidTextValue(ht)&&mt.push(ht)}Te.value=Te.v,Te.valueLabel=c.formatPieValue(Te.v,bt),Xe&&Xe.indexOf("value")!==-1&&mt.push(Te.valueLabel),Te.percent=Te.v/me.vTotal,Te.percentLabel=c.formatPiePercent(Te.percent,bt),Xe&&Xe.indexOf("percent")!==-1&&mt.push(Te.percentLabel);var qe=Ve.hoverlabel,ze=qe.font,Ae=[];S.loneHover({trace:le,x0:it-We*me.r,x1:it+We*me.r,y:yt,_x0:ue?ie+Te.TL[0]:it-We*me.r,_x1:ue?ie+Te.TR[0]:it+We*me.r,_y0:ue?Y+Te.TL[1]:yt-We*me.r,_y1:ue?Y+Te.BL[1]:yt+We*me.r,text:mt.join("
"),name:Ve.hovertemplate||Xe.indexOf("name")!==-1?Ve.name:void 0,idealAlign:Te.pxmid[0]<0?"left":"right",color:c.castOption(qe.bgcolor,Te.pts)||Te.color,borderColor:c.castOption(qe.bordercolor,Te.pts),fontFamily:c.castOption(ze.family,Te.pts),fontSize:c.castOption(ze.size,Te.pts),fontColor:c.castOption(ze.color,Te.pts),nameLength:c.castOption(qe.namelength,Te.pts),textAlign:c.castOption(qe.align,Te.pts),hovertemplate:c.castOption(Ve.hovertemplate,Te.pts),hovertemplateLabels:Te,eventData:[v(Te,Ve)]},{container:Fe._hoverlayer.node(),outerContainer:Fe._paper.node(),gd:se,inOut_bbox:Ae}),Te.bbox=Ae[0],le._hasHoverLabel=!0}le._hasHoverEvent=!0,se.emit("plotly_hover",{points:[v(Te,Ve)],event:h.event})}}),ae.on("mouseout",function(Te){var Fe=se._fullLayout,Ve=se._fullData[le.index],Xe=h.select(this).datum();le._hasHoverEvent&&(Te.originalEvent=h.event,se.emit("plotly_unhover",{points:[v(Xe,Ve)],event:h.event}),le._hasHoverEvent=!1),le._hasHoverLabel&&(S.loneUnhover(Fe._hoverlayer.node()),le._hasHoverLabel=!1)}),ae.on("click",function(Te){var Fe=se._fullLayout,Ve=se._fullData[le.index];se._dragging||Fe.hovermode===!1||(se._hoverdata=[v(Te,Ve)],S.click(se,h.event))})}function b(ae,se,Q){var me=c.castOption(ae.outsidetextfont.color,se.pts)||c.castOption(ae.textfont.color,se.pts)||Q.color,ie=c.castOption(ae.outsidetextfont.family,se.pts)||c.castOption(ae.textfont.family,se.pts)||Q.family,Y=c.castOption(ae.outsidetextfont.size,se.pts)||c.castOption(ae.textfont.size,se.pts)||Q.size,le=c.castOption(ae.outsidetextfont.weight,se.pts)||c.castOption(ae.textfont.weight,se.pts)||Q.weight,ue=c.castOption(ae.outsidetextfont.style,se.pts)||c.castOption(ae.textfont.style,se.pts)||Q.style,Te=c.castOption(ae.outsidetextfont.variant,se.pts)||c.castOption(ae.textfont.variant,se.pts)||Q.variant,Fe=c.castOption(ae.outsidetextfont.textcase,se.pts)||c.castOption(ae.textfont.textcase,se.pts)||Q.textcase,Ve=c.castOption(ae.outsidetextfont.lineposition,se.pts)||c.castOption(ae.textfont.lineposition,se.pts)||Q.lineposition,Xe=c.castOption(ae.outsidetextfont.shadow,se.pts)||c.castOption(ae.textfont.shadow,se.pts)||Q.shadow;return{color:me,family:ie,size:Y,weight:le,style:ue,variant:Te,textcase:Fe,lineposition:Ve,shadow:Xe}}function A(ae,se,Q){var me=c.castOption(ae.insidetextfont.color,se.pts);!me&&ae._input.textfont&&(me=c.castOption(ae._input.textfont.color,se.pts));var ie=c.castOption(ae.insidetextfont.family,se.pts)||c.castOption(ae.textfont.family,se.pts)||Q.family,Y=c.castOption(ae.insidetextfont.size,se.pts)||c.castOption(ae.textfont.size,se.pts)||Q.size,le=c.castOption(ae.insidetextfont.weight,se.pts)||c.castOption(ae.textfont.weight,se.pts)||Q.weight,ue=c.castOption(ae.insidetextfont.style,se.pts)||c.castOption(ae.textfont.style,se.pts)||Q.style,Te=c.castOption(ae.insidetextfont.variant,se.pts)||c.castOption(ae.textfont.variant,se.pts)||Q.variant,Fe=c.castOption(ae.insidetextfont.textcase,se.pts)||c.castOption(ae.textfont.textcase,se.pts)||Q.textcase,Ve=c.castOption(ae.insidetextfont.lineposition,se.pts)||c.castOption(ae.textfont.lineposition,se.pts)||Q.lineposition,Xe=c.castOption(ae.insidetextfont.shadow,se.pts)||c.castOption(ae.textfont.shadow,se.pts)||Q.shadow;return{color:me||k.contrast(se.color),family:ie,size:Y,weight:le,style:ue,variant:Te,textcase:Fe,lineposition:Ve,shadow:Xe}}function E(ae,se){for(var Q,me,ie=0;ie=-4;qe-=2)ht(Math.PI*qe,"tan");for(qe=4;qe>=-4;qe-=2)ht(Math.PI*(qe+1),"tan")}if(Xe||it){for(qe=4;qe>=-4;qe-=2)ht(Math.PI*(qe+1.5),"rad");for(qe=4;qe>=-4;qe-=2)ht(Math.PI*(qe+.5),"rad")}}if(ue||yt||Xe){var ze=Math.sqrt(ae.width*ae.width+ae.height*ae.height);if(mt={scale:ie*me*2/ze,rCenter:1-ie,rotate:0},mt.textPosAngle=(se.startangle+se.stopangle)/2,mt.scale>=1)return mt;bt.push(mt)}(yt||it)&&(mt=m(ae,me,le,Te,Fe),mt.textPosAngle=(se.startangle+se.stopangle)/2,bt.push(mt)),(yt||We)&&(mt=u(ae,me,le,Te,Fe),mt.textPosAngle=(se.startangle+se.stopangle)/2,bt.push(mt));for(var Ae=0,Ke=0,_t=0;_t=1)break}return bt[Ae]}function w(ae,se){var Q=ae.startangle,me=ae.stopangle;return Q>se&&se>me||Q0?1:-1)/2,y:Y/(1+Q*Q/(me*me)),outside:!0}}function N(ae){var se=Math.sqrt(ae.titleBox.width*ae.titleBox.width+ae.titleBox.height*ae.titleBox.height);return{x:ae.cx,y:ae.cy,scale:ae.trace.hole*ae.r*2/se,tx:0,ty:-ae.titleBox.height/2+ae.trace.title.font.size}}function U(ae,se){var Q=1,me=1,ie,Y=ae.trace,le={x:ae.cx,y:ae.cy},ue={tx:0,ty:0};ue.ty+=Y.title.font.size,ie=j(Y),Y.title.position.indexOf("top")!==-1?(le.y-=(1+ie)*ae.r,ue.ty-=ae.titleBox.height):Y.title.position.indexOf("bottom")!==-1&&(le.y+=(1+ie)*ae.r);var Te=B(ae.r,ae.trace.aspectratio),Fe=se.w*(Y.domain.x[1]-Y.domain.x[0])/2;return Y.title.position.indexOf("left")!==-1?(Fe=Fe+Te,le.x-=(1+ie)*Te,ue.tx+=ae.titleBox.width/2):Y.title.position.indexOf("center")!==-1?Fe*=2:Y.title.position.indexOf("right")!==-1&&(Fe=Fe+Te,le.x+=(1+ie)*Te,ue.tx-=ae.titleBox.width/2),Q=Fe/ae.titleBox.width,me=D(ae,se)/ae.titleBox.height,{x:le.x,y:le.y,scale:Math.min(Q,me),tx:ue.tx,ty:ue.ty}}function B(ae,se){return ae/(se===void 0?1:se)}function D(ae,se){var Q=ae.trace,me=se.h*(Q.domain.y[1]-Q.domain.y[0]);return Math.min(ae.titleBox.height,me/2)}function j(ae){var se=ae.pull;if(!se)return 0;var Q;if(t.isArrayOrTypedArray(se))for(se=0,Q=0;Qse&&(se=ae.pull[Q]);return se}function q(ae,se){var Q,me,ie,Y,le,ue,Te,Fe,Ve,Xe,We,it,yt;function bt(ze,Ae){return ze.pxmid[1]-Ae.pxmid[1]}function mt(ze,Ae){return Ae.pxmid[1]-ze.pxmid[1]}function ht(ze,Ae){Ae||(Ae={});var Ke=Ae.labelExtraY+(me?Ae.yLabelMax:Ae.yLabelMin),_t=me?ze.yLabelMin:ze.yLabelMax,wt=me?ze.yLabelMax:ze.yLabelMin,vt=ze.cyFinal+le(ze.px0[1],ze.px1[1]),$t=Ke-_t,Yt,lr,dr,Nr,Fr,ln;if($t*Te>0&&(ze.labelExtraY=$t),!!t.isArrayOrTypedArray(se.pull))for(lr=0;lr=(c.castOption(se.pull,dr.pts)||0))&&((ze.pxmid[1]-dr.pxmid[1])*Te>0?(Nr=dr.cyFinal+le(dr.px0[1],dr.px1[1]),$t=Nr-_t-ze.labelExtraY,$t*Te>0&&(ze.labelExtraY+=$t)):(wt+ze.labelExtraY-vt)*Te>0&&(Yt=3*ue*Math.abs(lr-Xe.indexOf(ze)),Fr=dr.cxFinal+Y(dr.px0[0],dr.px1[0]),ln=Fr+Yt-(ze.cxFinal+ze.pxmid[0])-ze.labelExtraX,ln*ue>0&&(ze.labelExtraX+=ln)))}for(me=0;me<2;me++)for(ie=me?bt:mt,le=me?Math.max:Math.min,Te=me?1:-1,Q=0;Q<2;Q++){for(Y=Q?Math.max:Math.min,ue=Q?1:-1,Fe=ae[me][Q],Fe.sort(ie),Ve=ae[1-me][Q],Xe=Ve.concat(Fe),it=[],We=0;We1?(Fe=Q.r,Ve=Fe/ie.aspectratio):(Ve=Q.r,Fe=Ve*ie.aspectratio),Fe*=(1+ie.baseratio)/2,Te=Fe*Ve}le=Math.min(le,Te/Q.vTotal)}for(me=0;mese.vTotal/2?1:0,Fe.halfangle=Math.PI*Math.min(Fe.v/se.vTotal,.5),Fe.ring=1-me.hole,Fe.rInscribed=L(Fe,se))}function pe(ae,se){return[ae*Math.sin(se),-ae*Math.cos(se)]}function ge(ae,se,Q){var me=ae._fullLayout,ie=Q.trace,Y=ie.texttemplate,le=ie.textinfo;if(!Y&&le&&le!=="none"){var ue=le.split("+"),Te=function(Ae){return ue.indexOf(Ae)!==-1},Fe=Te("label"),Ve=Te("text"),Xe=Te("value"),We=Te("percent"),it=me.separators,yt;if(yt=Fe?[se.label]:[],Ve){var bt=c.getFirstFilled(ie.text,se.pts);p(bt)&&yt.push(bt)}Xe&&yt.push(c.formatPieValue(se.v,it)),We&&yt.push(c.formatPiePercent(se.v/Q.vTotal,it)),se.text=yt.join("
")}function mt(Ae){return{label:Ae.label,value:Ae.v,valueLabel:c.formatPieValue(Ae.v,me.separators),percent:Ae.v/Q.vTotal,percentLabel:c.formatPiePercent(Ae.v/Q.vTotal,me.separators),color:Ae.color,text:Ae.text,customdata:t.castOption(ie,Ae.i,"customdata")}}if(Y){var ht=t.castOption(ie,se.i,"texttemplate");if(!ht)se.text="";else{var qe=mt(se),ze=c.getFirstFilled(ie.text,se.pts);(p(ze)||ze==="")&&(qe.text=ze),se.text=t.texttemplateString({data:[qe,ie._meta],fallback:ie.texttemplatefallback,labels:qe,locale:ae._fullLayout._d3locale,template:ht})}}}function W(ae,se){var Q=ae.rotate*Math.PI/180,me=Math.cos(Q),ie=Math.sin(Q),Y=(se.left+se.right)/2,le=(se.top+se.bottom)/2;ae.textX=Y*me-le*ie,ae.textY=Y*ie+le*me,ae.noCenter=!0}X.exports={plot:T,formatSliceLabel:ge,transformInsideText:_,determineInsideTextFont:A,positionTitleOutside:U,prerenderTitles:E,layoutAreas:J,attachFxHandlers:g,computeTransform:W}}}),vC=_e({"src/traces/pie/style.js"(ee,X){var h=mr(),x=hg(),S=Ld().resizeText;X.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(x,a,n,e)})})}}}),mC=_e({"src/traces/pie/base_plot.js"(ee){var X=Fs();ee.name="pie",ee.plot=function(h,x,S,k){X.plotBasePlot(ee.name,h,x,S,k)},ee.clean=function(h,x,S,k){X.cleanBasePlot(ee.name,h,x,S,k)}}}),gC=_e({"src/traces/pie/index.js"(ee,X){X.exports={attributes:pm(),supplyDefaults:vm().supplyDefaults,supplyLayoutDefaults:dC(),layoutAttributes:gb(),calc:kg().calc,crossTraceCalc:kg().crossTraceCalc,plot:yb().plot,style:vC(),styleOne:hg(),moduleType:"trace",name:"pie",basePlotModule:mC(),categories:["pie-like","pie","showLegend"],meta:{}}}}),yC=_e({"lib/pie.js"(ee,X){X.exports=gC()}}),_C=_e({"src/traces/sunburst/base_plot.js"(ee){var X=Fs();ee.name="sunburst",ee.plot=function(h,x,S,k){X.plotBasePlot(ee.name,h,x,S,k)},ee.clean=function(h,x,S,k){X.cleanBasePlot(ee.name,h,x,S,k)}}}),dT=_e({"src/traces/sunburst/constants.js"(ee,X){X.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),$y=_e({"src/traces/sunburst/attributes.js"(ee,X){var h=Zs(),{hovertemplateAttrs:x,texttemplateAttrs:S,templatefallbackAttrs:k}=fu(),e=tc(),t=hf().attributes,r=pm(),o=dT(),n=po().extendFlat,i=Qf().pattern;X.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:k({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:x({},{keys:o.eventDataKeys}),hovertemplatefallback:k(),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"})}}}),pT=_e({"src/traces/sunburst/layout_attributes.js"(ee,X){X.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),bC=_e({"src/traces/sunburst/defaults.js"(ee,X){var h=kn(),x=$y(),S=hf().defaults,k=up().handleText,e=vm().handleMarkerDefaults,t=Ho(),r=t.hasColorscale,o=t.handleDefaults;X.exports=function(i,a,s,f){function c(A,E){return h.coerce(i,a,x,A,E)}var v=c("labels"),p=c("parents");if(!v||!v.length||!p||!p.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 b="auto";k(i,a,f,c,b,{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}}}),xC=_e({"src/traces/sunburst/layout_defaults.js"(ee,X){var h=kn(),x=pT();X.exports=function(k,e){function t(r,o){return h.coerce(k,e,x,r,o)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),Wy=_e({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(ee,X){(function(h,x){typeof ee=="object"&&typeof X<"u"?x(ee):(h=h||self,x(h.d3=h.d3||{}))})(ee,function(h){function x(Ue,Ie){return Ue.parent===Ie.parent?1:2}function S(Ue){return Ue.reduce(k,0)/Ue.length}function k(Ue,Ie){return Ue+Ie.x}function e(Ue){return 1+Ue.reduce(t,0)}function t(Ue,Ie){return Math.max(Ue,Ie.y)}function r(Ue){for(var Ie;Ie=Ue.children;)Ue=Ie[0];return Ue}function o(Ue){for(var Ie;Ie=Ue.children;)Ue=Ie[Ie.length-1];return Ue}function n(){var Ue=x,Ie=1,Pe=1,Be=!1;function at(ft){var Bt,Nt=0;ft.eachAfter(function(Tr){var Yr=Tr.children;Yr?(Tr.x=S(Yr),Tr.y=e(Yr)):(Tr.x=Bt?Nt+=Ue(Tr,Bt):0,Tr.y=0,Bt=Tr)});var Ht=r(ft),or=o(ft),Cr=Ht.x-Ue(Ht,or)/2,Sr=or.x+Ue(or,Ht)/2;return ft.eachAfter(Be?function(Tr){Tr.x=(Tr.x-ft.x)*Ie,Tr.y=(ft.y-Tr.y)*Pe}:function(Tr){Tr.x=(Tr.x-Cr)/(Sr-Cr)*Ie,Tr.y=(1-(ft.y?Tr.y/ft.y:1))*Pe})}return at.separation=function(ft){return arguments.length?(Ue=ft,at):Ue},at.size=function(ft){return arguments.length?(Be=!1,Ie=+ft[0],Pe=+ft[1],at):Be?null:[Ie,Pe]},at.nodeSize=function(ft){return arguments.length?(Be=!0,Ie=+ft[0],Pe=+ft[1],at):Be?[Ie,Pe]:null},at}function i(Ue){var Ie=0,Pe=Ue.children,Be=Pe&&Pe.length;if(!Be)Ie=1;else for(;--Be>=0;)Ie+=Pe[Be].value;Ue.value=Ie}function a(){return this.eachAfter(i)}function s(Ue){var Ie=this,Pe,Be=[Ie],at,ft,Bt;do for(Pe=Be.reverse(),Be=[];Ie=Pe.pop();)if(Ue(Ie),at=Ie.children,at)for(ft=0,Bt=at.length;ft=0;--at)Pe.push(Be[at]);return this}function c(Ue){for(var Ie=this,Pe=[Ie],Be=[],at,ft,Bt;Ie=Pe.pop();)if(Be.push(Ie),at=Ie.children,at)for(ft=0,Bt=at.length;ft=0;)Pe+=Be[at].value;Ie.value=Pe})}function p(Ue){return this.eachBefore(function(Ie){Ie.children&&Ie.children.sort(Ue)})}function T(Ue){for(var Ie=this,Pe=l(Ie,Ue),Be=[Ie];Ie!==Pe;)Ie=Ie.parent,Be.push(Ie);for(var at=Be.length;Ue!==Pe;)Be.splice(at,0,Ue),Ue=Ue.parent;return Be}function l(Ue,Ie){if(Ue===Ie)return Ue;var Pe=Ue.ancestors(),Be=Ie.ancestors(),at=null;for(Ue=Pe.pop(),Ie=Be.pop();Ue===Ie;)at=Ue,Ue=Pe.pop(),Ie=Be.pop();return at}function g(){for(var Ue=this,Ie=[Ue];Ue=Ue.parent;)Ie.push(Ue);return Ie}function b(){var Ue=[];return this.each(function(Ie){Ue.push(Ie)}),Ue}function A(){var Ue=[];return this.eachBefore(function(Ie){Ie.children||Ue.push(Ie)}),Ue}function E(){var Ue=this,Ie=[];return Ue.each(function(Pe){Pe!==Ue&&Ie.push({source:Pe.parent,target:Pe})}),Ie}function _(Ue,Ie){var Pe=new y(Ue),Be=+Ue.value&&(Pe.value=Ue.value),at,ft=[Pe],Bt,Nt,Ht,or;for(Ie==null&&(Ie=m);at=ft.pop();)if(Be&&(at.value=+at.data.value),(Nt=Ie(at.data))&&(or=Nt.length))for(at.children=new Array(or),Ht=or-1;Ht>=0;--Ht)ft.push(Bt=at.children[Ht]=new y(Nt[Ht])),Bt.parent=at,Bt.depth=at.depth+1;return Pe.eachBefore(d)}function w(){return _(this).eachBefore(u)}function m(Ue){return Ue.children}function u(Ue){Ue.data=Ue.data.data}function d(Ue){var Ie=0;do Ue.height=Ie;while((Ue=Ue.parent)&&Ue.height<++Ie)}function y(Ue){this.data=Ue,this.depth=this.height=0,this.parent=null}y.prototype=_.prototype={constructor:y,count:a,each:s,eachAfter:c,eachBefore:f,sum:v,sort:p,path:T,ancestors:g,descendants:b,leaves:A,links:E,copy:w};var R=Array.prototype.slice;function L(Ue){for(var Ie=Ue.length,Pe,Be;Ie;)Be=Math.random()*Ie--|0,Pe=Ue[Ie],Ue[Ie]=Ue[Be],Ue[Be]=Pe;return Ue}function z(Ue){for(var Ie=0,Pe=(Ue=L(R.call(Ue))).length,Be=[],at,ft;Ie0&&Pe*Pe>Be*Be+at*at}function D(Ue,Ie){for(var Pe=0;PeHt?(at=(or+Ht-ft)/(2*or),Nt=Math.sqrt(Math.max(0,Ht/or-at*at)),Pe.x=Ue.x-at*Be-Nt*Bt,Pe.y=Ue.y-at*Bt+Nt*Be):(at=(or+ft-Ht)/(2*or),Nt=Math.sqrt(Math.max(0,ft/or-at*at)),Pe.x=Ie.x+at*Be-Nt*Bt,Pe.y=Ie.y+at*Bt+Nt*Be)):(Pe.x=Ie.x+Pe.r,Pe.y=Ie.y)}function pe(Ue,Ie){var Pe=Ue.r+Ie.r-1e-6,Be=Ie.x-Ue.x,at=Ie.y-Ue.y;return Pe>0&&Pe*Pe>Be*Be+at*at}function ge(Ue){var Ie=Ue._,Pe=Ue.next._,Be=Ie.r+Pe.r,at=(Ie.x*Pe.r+Pe.x*Ie.r)/Be,ft=(Ie.y*Pe.r+Pe.y*Ie.r)/Be;return at*at+ft*ft}function W(Ue){this._=Ue,this.next=null,this.previous=null}function ae(Ue){if(!(at=Ue.length))return 0;var Ie,Pe,Be,at,ft,Bt,Nt,Ht,or,Cr,Sr;if(Ie=Ue[0],Ie.x=0,Ie.y=0,!(at>1))return Ie.r;if(Pe=Ue[1],Ie.x=-Pe.r,Pe.x=Ie.r,Pe.y=0,!(at>2))return Ie.r+Pe.r;ye(Pe,Ie,Be=Ue[2]),Ie=new W(Ie),Pe=new W(Pe),Be=new W(Be),Ie.next=Be.previous=Pe,Pe.next=Ie.previous=Be,Be.next=Pe.previous=Ie;e:for(Nt=3;Nt0)throw new Error("cycle");return Nt}return Pe.id=function(Be){return arguments.length?(Ue=me(Be),Pe):Ue},Pe.parentId=function(Be){return arguments.length?(Ie=me(Be),Pe):Ie},Pe}function Ae(Ue,Ie){return Ue.parent===Ie.parent?1:2}function Ke(Ue){var Ie=Ue.children;return Ie?Ie[0]:Ue.t}function _t(Ue){var Ie=Ue.children;return Ie?Ie[Ie.length-1]:Ue.t}function wt(Ue,Ie,Pe){var Be=Pe/(Ie.i-Ue.i);Ie.c-=Be,Ie.s+=Pe,Ue.c+=Be,Ie.z+=Pe,Ie.m+=Pe}function vt(Ue){for(var Ie=0,Pe=0,Be=Ue.children,at=Be.length,ft;--at>=0;)ft=Be[at],ft.z+=Ie,ft.m+=Ie,Ie+=ft.s+(Pe+=ft.c)}function $t(Ue,Ie,Pe){return Ue.a.parent===Ie.parent?Ue.a:Pe}function Yt(Ue,Ie){this._=Ue,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=Ie}Yt.prototype=Object.create(y.prototype);function lr(Ue){for(var Ie=new Yt(Ue,0),Pe,Be=[Ie],at,ft,Bt,Nt;Pe=Be.pop();)if(ft=Pe._.children)for(Pe.children=new Array(Nt=ft.length),Bt=Nt-1;Bt>=0;--Bt)Be.push(at=Pe.children[Bt]=new Yt(ft[Bt],Bt)),at.parent=Pe;return(Ie.parent=new Yt(null,0)).children=[Ie],Ie}function dr(){var Ue=Ae,Ie=1,Pe=1,Be=null;function at(or){var Cr=lr(or);if(Cr.eachAfter(ft),Cr.parent.m=-Cr.z,Cr.eachBefore(Bt),Be)or.eachBefore(Ht);else{var Sr=or,Tr=or,Yr=or;or.eachBefore(function(ma){ma.xTr.x&&(Tr=ma),ma.depth>Yr.depth&&(Yr=ma)});var Fn=Sr===Tr?1:Ue(Sr,Tr)/2,ua=Fn-Sr.x,ta=Ie/(Tr.x+Fn+ua),va=Pe/(Yr.depth||1);or.eachBefore(function(ma){ma.x=(ma.x+ua)*ta,ma.y=ma.depth*va})}return or}function ft(or){var Cr=or.children,Sr=or.parent.children,Tr=or.i?Sr[or.i-1]:null;if(Cr){vt(or);var Yr=(Cr[0].z+Cr[Cr.length-1].z)/2;Tr?(or.z=Tr.z+Ue(or._,Tr._),or.m=or.z-Yr):or.z=Yr}else Tr&&(or.z=Tr.z+Ue(or._,Tr._));or.parent.A=Nt(or,Tr,or.parent.A||Sr[0])}function Bt(or){or._.x=or.z+or.parent.m,or.m+=or.parent.m}function Nt(or,Cr,Sr){if(Cr){for(var Tr=or,Yr=or,Fn=Cr,ua=Tr.parent.children[0],ta=Tr.m,va=Yr.m,ma=Fn.m,Jn=ua.m,ja;Fn=_t(Fn),Tr=Ke(Tr),Fn&&Tr;)ua=Ke(ua),Yr=_t(Yr),Yr.a=or,ja=Fn.z+ma-Tr.z-ta+Ue(Fn._,Tr._),ja>0&&(wt($t(Fn,or,Sr),or,ja),ta+=ja,va+=ja),ma+=Fn.m,ta+=Tr.m,Jn+=ua.m,va+=Yr.m;Fn&&!_t(Yr)&&(Yr.t=Fn,Yr.m+=ma-va),Tr&&!Ke(ua)&&(ua.t=Tr,ua.m+=ta-Jn,Sr=or)}return Sr}function Ht(or){or.x*=Ie,or.y=or.depth*Pe}return at.separation=function(or){return arguments.length?(Ue=or,at):Ue},at.size=function(or){return arguments.length?(Be=!1,Ie=+or[0],Pe=+or[1],at):Be?null:[Ie,Pe]},at.nodeSize=function(or){return arguments.length?(Be=!0,Ie=+or[0],Pe=+or[1],at):Be?[Ie,Pe]:null},at}function Nr(Ue,Ie,Pe,Be,at){for(var ft=Ue.children,Bt,Nt=-1,Ht=ft.length,or=Ue.value&&(at-Pe)/Ue.value;++Ntma&&(ma=or),gr=ta*ta*ti,Jn=Math.max(ma/gr,gr/va),Jn>ja){ta-=or;break}ja=Jn}Bt.push(Ht={value:ta,dice:Yr1?Be:1)},Pe}(Fr);function Xr(){var Ue=zr,Ie=!1,Pe=1,Be=1,at=[0],ft=ie,Bt=ie,Nt=ie,Ht=ie,or=ie;function Cr(Tr){return Tr.x0=Tr.y0=0,Tr.x1=Pe,Tr.y1=Be,Tr.eachBefore(Sr),at=[0],Ie&&Tr.eachBefore(Xe),Tr}function Sr(Tr){var Yr=at[Tr.depth],Fn=Tr.x0+Yr,ua=Tr.y0+Yr,ta=Tr.x1-Yr,va=Tr.y1-Yr;ta=Tr-1){var ma=ft[Sr];ma.x0=Fn,ma.y0=ua,ma.x1=ta,ma.y1=va;return}for(var Jn=or[Sr],ja=Yr/2+Jn,ti=Sr+1,gr=Tr-1;ti>>1;or[Kt]va-ua){var rn=(Fn*_r+ta*vr)/Yr;Cr(Sr,ti,vr,Fn,ua,rn,va),Cr(ti,Tr,_r,rn,ua,ta,va)}else{var gn=(ua*_r+va*vr)/Yr;Cr(Sr,ti,vr,Fn,ua,ta,gn),Cr(ti,Tr,_r,Fn,gn,ta,va)}}}function Qe(Ue,Ie,Pe,Be,at){(Ue.depth&1?Nr:We)(Ue,Ie,Pe,Be,at)}var ct=function Ue(Ie){function Pe(Be,at,ft,Bt,Nt){if((Ht=Be._squarify)&&Ht.ratio===Ie)for(var Ht,or,Cr,Sr,Tr=-1,Yr,Fn=Ht.length,ua=Be.value;++Tr1?Be:1)},Pe}(Fr);h.cluster=n,h.hierarchy=_,h.pack=ue,h.packEnclose=z,h.packSiblings=se,h.partition=it,h.stratify=ze,h.tree=dr,h.treemap=Xr,h.treemapBinary=Ot,h.treemapDice=We,h.treemapResquarify=ct,h.treemapSlice=Nr,h.treemapSliceDice=Qe,h.treemapSquarify=zr,Object.defineProperty(h,"__esModule",{value:!0})})}}),Yy=_e({"src/traces/sunburst/calc.js"(ee){var X=Wy(),h=jn(),x=kn(),S=Ho().makeColorScaleFuncFromTrace,k=kg().makePullColorFn,e=kg().generateExtendedColors,t=Ho().calc,r=qn().ALMOST_EQUAL,o={},n={},i={};ee.calc=function(s,f){var c=s._fullLayout,v=f.ids,p=x.isArrayOrTypedArray(v),T=f.labels,l=f.parents,g=f.values,b=x.isArrayOrTypedArray(g),A=[],E={},_={},w=function(se,Q){E[se]?E[se].push(Q):E[se]=[Q],_[Q]=1},m=function(se){return se||typeof se=="number"},u=function(se){return!b||h(g[se])&&g[se]>=0},d,y,R;p?(d=Math.min(v.length,l.length),y=function(se){return m(v[se])&&u(se)},R=function(se){return String(v[se])}):(d=Math.min(T.length,l.length),y=function(se){return m(T[se])&&u(se)},R=function(se){return String(T[se])}),b&&(d=Math.min(d,g.length));for(var L=0;L1){for(var j=x.randstr(),q=0;q>8&15|X>>4&240,X>>4&15|X&240,(X&15)<<4|X&15,1):h===8?Xy(X>>24&255,X>>16&255,X>>8&255,(X&255)/255):h===4?Xy(X>>12&15|X>>8&240,X>>8&15|X>>4&240,X>>4&15|X&240,((X&15)<<4|X&15)/255):null):(X=AT.exec(ee))?new ld(X[1],X[2],X[3],1):(X=ST.exec(ee))?new ld(X[1]*255/100,X[2]*255/100,X[3]*255/100,1):(X=MT.exec(ee))?Xy(X[1],X[2],X[3],X[4]):(X=ET.exec(ee))?Xy(X[1]*255/100,X[2]*255/100,X[3]*255/100,X[4]):(X=kT.exec(ee))?bT(X[1],X[2]/100,X[3]/100,1):(X=CT.exec(ee))?bT(X[1],X[2]/100,X[3]/100,X[4]):Tb.hasOwnProperty(ee)?gT(Tb[ee]):ee==="transparent"?new ld(NaN,NaN,NaN,0):null}function gT(ee){return new ld(ee>>16&255,ee>>8&255,ee&255,1)}function Xy(ee,X,h,x){return x<=0&&(ee=X=h=NaN),new ld(ee,X,h,x)}function bb(ee){return ee instanceof zv||(ee=Pg(ee)),ee?(ee=ee.rgb(),new ld(ee.r,ee.g,ee.b,ee.opacity)):new ld}function Zy(ee,X,h,x){return arguments.length===1?bb(ee):new ld(ee,X,h,x??1)}function ld(ee,X,h,x){this.r=+ee,this.g=+X,this.b=+h,this.opacity=+x}function yT(){return`#${S0(this.r)}${S0(this.g)}${S0(this.b)}`}function AC(){return`#${S0(this.r)}${S0(this.g)}${S0(this.b)}${S0((isNaN(this.opacity)?1:this.opacity)*255)}`}function _T(){const ee=Ky(this.opacity);return`${ee===1?"rgb(":"rgba("}${A0(this.r)}, ${A0(this.g)}, ${A0(this.b)}${ee===1?")":`, ${ee})`}`}function Ky(ee){return isNaN(ee)?1:Math.max(0,Math.min(1,ee))}function A0(ee){return Math.max(0,Math.min(255,Math.round(ee)||0))}function S0(ee){return ee=A0(ee),(ee<16?"0":"")+ee.toString(16)}function bT(ee,X,h,x){return x<=0?ee=X=h=NaN:h<=0||h>=1?ee=X=NaN:X<=0&&(ee=NaN),new Sp(ee,X,h,x)}function xT(ee){if(ee instanceof Sp)return new Sp(ee.h,ee.s,ee.l,ee.opacity);if(ee instanceof zv||(ee=Pg(ee)),!ee)return new Sp;if(ee instanceof Sp)return ee;ee=ee.rgb();var X=ee.r/255,h=ee.g/255,x=ee.b/255,S=Math.min(X,h,x),k=Math.max(X,h,x),e=NaN,t=k-S,r=(k+S)/2;return t?(X===k?e=(h-x)/t+(h0&&r<1?0:e,new Sp(e,t,r,ee.opacity)}function xb(ee,X,h,x){return arguments.length===1?xT(ee):new Sp(ee,X,h,x??1)}function Sp(ee,X,h,x){this.h=+ee,this.s=+X,this.l=+h,this.opacity=+x}function wT(ee){return ee=(ee||0)%360,ee<0?ee+360:ee}function Jy(ee){return Math.max(0,Math.min(1,ee||0))}function wb(ee,X,h){return(ee<60?X+(h-X)*ee/60:ee<180?h:ee<240?X+(h-X)*(240-ee)/60:X)*255}var Fv,M0,E0,gm,Mp,TT,AT,ST,MT,ET,kT,CT,Tb,Ab=tt({"node_modules/d3-color/src/color.js"(){_b(),Fv=.7,M0=1/Fv,E0="\\s*([+-]?\\d+)\\s*",gm="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",TT=/^#([0-9a-f]{3,8})$/,AT=new RegExp(`^rgb\\(${E0},${E0},${E0}\\)$`),ST=new RegExp(`^rgb\\(${Mp},${Mp},${Mp}\\)$`),MT=new RegExp(`^rgba\\(${E0},${E0},${E0},${gm}\\)$`),ET=new RegExp(`^rgba\\(${Mp},${Mp},${Mp},${gm}\\)$`),kT=new RegExp(`^hsl\\(${gm},${Mp},${Mp}\\)$`),CT=new RegExp(`^hsla\\(${gm},${Mp},${Mp},${gm}\\)$`),Tb={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},mm(zv,Pg,{copy(ee){return Object.assign(new this.constructor,this,ee)},displayable(){return this.rgb().displayable()},hex:vT,formatHex:vT,formatHex8:wC,formatHsl:TC,formatRgb:mT,toString:mT}),mm(ld,Zy,Cg(zv,{brighter(ee){return ee=ee==null?M0:Math.pow(M0,ee),new ld(this.r*ee,this.g*ee,this.b*ee,this.opacity)},darker(ee){return ee=ee==null?Fv:Math.pow(Fv,ee),new ld(this.r*ee,this.g*ee,this.b*ee,this.opacity)},rgb(){return this},clamp(){return new ld(A0(this.r),A0(this.g),A0(this.b),Ky(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:yT,formatHex:yT,formatHex8:AC,formatRgb:_T,toString:_T})),mm(Sp,xb,Cg(zv,{brighter(ee){return ee=ee==null?M0:Math.pow(M0,ee),new Sp(this.h,this.s,this.l*ee,this.opacity)},darker(ee){return ee=ee==null?Fv:Math.pow(Fv,ee),new Sp(this.h,this.s,this.l*ee,this.opacity)},rgb(){var ee=this.h%360+(this.h<0)*360,X=isNaN(ee)||isNaN(this.s)?0:this.s,h=this.l,x=h+(h<.5?h:1-h)*X,S=2*h-x;return new ld(wb(ee>=240?ee-240:ee+120,S,x),wb(ee,S,x),wb(ee<120?ee+240:ee-120,S,x),this.opacity)},clamp(){return new Sp(wT(this.h),Jy(this.s),Jy(this.l),Ky(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 ee=Ky(this.opacity);return`${ee===1?"hsl(":"hsla("}${wT(this.h)}, ${Jy(this.s)*100}%, ${Jy(this.l)*100}%${ee===1?")":`, ${ee})`}`}}))}}),Sb,Mb,PT=tt({"node_modules/d3-color/src/math.js"(){Sb=Math.PI/180,Mb=180/Math.PI}});function LT(ee){if(ee instanceof Vp)return new Vp(ee.l,ee.a,ee.b,ee.opacity);if(ee instanceof cv)return IT(ee);ee instanceof ld||(ee=bb(ee));var X=Lb(ee.r),h=Lb(ee.g),x=Lb(ee.b),S=kb((.2225045*X+.7168786*h+.0606169*x)/Rb),k,e;return X===h&&h===x?k=e=S:(k=kb((.4360747*X+.3850649*h+.1430804*x)/Db),e=kb((.0139322*X+.0971045*h+.7141733*x)/Ob)),new Vp(116*S-16,500*(k-S),200*(S-e),ee.opacity)}function Eb(ee,X,h,x){return arguments.length===1?LT(ee):new Vp(ee,X,h,x??1)}function Vp(ee,X,h,x){this.l=+ee,this.a=+X,this.b=+h,this.opacity=+x}function kb(ee){return ee>DT?Math.pow(ee,.3333333333333333):ee/Fb+zb}function Cb(ee){return ee>k0?ee*ee*ee:Fb*(ee-zb)}function Pb(ee){return 255*(ee<=.0031308?12.92*ee:1.055*Math.pow(ee,.4166666666666667)-.055)}function Lb(ee){return(ee/=255)<=.04045?ee/12.92:Math.pow((ee+.055)/1.055,2.4)}function SC(ee){if(ee instanceof cv)return new cv(ee.h,ee.c,ee.l,ee.opacity);if(ee instanceof Vp||(ee=LT(ee)),ee.a===0&&ee.b===0)return new cv(NaN,0=1?(h=1,X-1):Math.floor(h*X),S=ee[x],k=ee[x+1],e=x>0?ee[x-1]:2*S-k,t=x()=>ee}});function BT(ee,X){return function(h){return ee+h*X}}function CC(ee,X,h){return ee=Math.pow(ee,h),X=Math.pow(X,h)-ee,h=1/h,function(x){return Math.pow(ee+x*X,h)}}function t1(ee,X){var h=X-ee;return h?BT(ee,h>180||h<-180?h-360*Math.round(h/360):h):Dg(isNaN(ee)?X:ee)}function PC(ee){return(ee=+ee)==1?ud:function(X,h){return h-X?CC(X,h,ee):Dg(isNaN(X)?h:X)}}function ud(ee,X){var h=X-ee;return h?BT(ee,h):Dg(isNaN(ee)?X:ee)}var bm=tt({"node_modules/d3-interpolate/src/color.js"(){NT()}});function UT(ee){return function(X){var h=X.length,x=new Array(h),S=new Array(h),k=new Array(h),e,t;for(e=0;eh&&(k=X.slice(h,k),t[e]?t[e]+=k:t[++e]=k),(x=x[0])===(S=S[0])?t[e]?t[e]+=S:t[++e]=S:(t[++e]=null,r.push({i:e,x:qp(x,S)})),h=i1.lastIndex;return h180?n+=360:n-o>180&&(o+=360),a.push({i:i.push(S(i)+"rotate(",null,x)-2,x:qp(o,n)})):n&&i.push(S(i)+"rotate("+n+x)}function t(o,n,i,a){o!==n?a.push({i:i.push(S(i)+"skewX(",null,x)-2,x:qp(o,n)}):n&&i.push(S(i)+"skewX("+n+x)}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:qp(o,i)},{i:c-2,x:qp(n,a)})}else(i!==1||a!==1)&&s.push(S(s)+"scale("+i+","+a+")")}return function(o,n){var i=[],a=[];return o=ee(o),n=ee(n),k(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,v;++fo1,interpolateArray:()=>LC,interpolateBasis:()=>OT,interpolateBasisClosed:()=>zT,interpolateCubehelix:()=>d3,interpolateCubehelixLong:()=>p3,interpolateDate:()=>WT,interpolateDiscrete:()=>RC,interpolateHcl:()=>c3,interpolateHclLong:()=>f3,interpolateHsl:()=>s3,interpolateHslLong:()=>l3,interpolateHue:()=>zC,interpolateLab:()=>XC,interpolateNumber:()=>qp,interpolateNumberArray:()=>Gb,interpolateObject:()=>XT,interpolateRgb:()=>r1,interpolateRgbBasis:()=>jT,interpolateRgbBasisClosed:()=>VT,interpolateRound:()=>NC,interpolateString:()=>KT,interpolateTransformCss:()=>t3,interpolateTransformSvg:()=>r3,interpolateZoom:()=>i3,piecewise:()=>QC,quantize:()=>t6});var xm=tt({"node_modules/d3-interpolate/src/index.js"(){s1(),$T(),qb(),FT(),YT(),OC(),FC(),n1(),Hb(),ZT(),BC(),JT(),GC(),WC(),qT(),YC(),ZC(),KC(),JC(),e6(),r6()}}),Wb=_e({"src/traces/sunburst/fill_one.js"(ee,X){var h=ri(),x=so();X.exports=function(k,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(k,t,r,e)}else x.fill(k,a)}}}),v3=_e({"src/traces/sunburst/style.js"(ee,X){var h=mr(),x=so(),S=kn(),k=Ld().resizeText,e=Wb();function t(o){var n=o._fullLayout._sunburstlayer.selectAll(".trace");k(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,v=S.castOption(i,c,"marker.line.color")||x.defaultLine,p=S.castOption(i,c,"marker.line.width")||0;o.call(e,n,i,a).style("stroke-width",p).call(x.stroke,v).style("opacity",f?i.leaf.opacity:null)}X.exports={style:t,styleOne:r}}}),Nv=_e({"src/traces/sunburst/helpers.js"(ee){var X=kn(),h=so(),x=zp(),S=_0();ee.findEntryWithLevel=function(r,o){var n;return o&&r.eachAfter(function(i){if(ee.getPtId(i)===o)return n=i.copy()}),n||r},ee.findEntryWithChild=function(r,o){var n;return r.eachAfter(function(i){for(var a=i.children||[],s=0;s0)},ee.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},ee.isHeader=function(r,o){return!(ee.isLeaf(r)||r.depth===o._maxDepth-1)};function t(r){return r.data.data.pid}ee.getParent=function(r,o){return ee.findEntryWithLevel(r,t(o))},ee.listPath=function(r,o){var n=r.parent;if(!n)return[];var i=o?[n.data[o]]:[n];return ee.listPath(n,o).concat(i)},ee.getPath=function(r){return ee.listPath(r,"label").join("/")+"/"},ee.formatValue=S.formatPieValue,ee.formatPercent=function(r,o){var n=X.formatPercent(r,0);return n==="0%"&&(n=S.formatPiePercent(r,o)),n}}}),c1=_e({"src/traces/sunburst/fx.js"(ee,X){var h=mr(),x=bi(),S=rc().appendArrayPointValue,k=zf(),e=kn(),t=Lv(),r=Nv(),o=_0(),n=o.formatPieValue;X.exports=function(s,f,c,v,p){var T=v[0],l=T.trace,g=T.hierarchy,b=l.type==="sunburst",A=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var E=function(m){var u=c._fullLayout;if(!(c._dragging||u.hovermode===!1)){var d=c._fullData[l.index],y=m.data.data,R=y.i,L=r.isHierarchyRoot(m),z=r.getParent(g,m),N=r.getValue(m),U=function(le){return e.castOption(d,R,le)},B=U("hovertemplate"),D=k.castHoverinfo(d,u,R),j=u.separators,q;if(B||D&&D!=="none"&&D!=="skip"){var J,oe;b&&(J=T.cx+m.pxmid[0]*(1-m.rInscribed),oe=T.cy+m.pxmid[1]*(1-m.rInscribed)),A&&(J=m._hoverX,oe=m._hoverY);var ye={},pe=[],ge=[],W=function(le){return pe.indexOf(le)!==-1};D&&(pe=D==="all"?d._module.attributes.hoverinfo.flags:D.split("+")),ye.label=y.label,W("label")&&ye.label&&ge.push(ye.label),y.hasOwnProperty("v")&&(ye.value=y.v,ye.valueLabel=n(ye.value,j),W("value")&&ge.push(ye.valueLabel)),ye.currentPath=m.currentPath=r.getPath(m.data),W("current path")&&!L&&ge.push(ye.currentPath);var ae,se=[],Q=function(){se.indexOf(ae)===-1&&(ge.push(ae),se.push(ae))};ye.percentParent=m.percentParent=N/r.getValue(z),ye.parent=m.parentString=r.getPtLabel(z),W("percent parent")&&(ae=r.formatPercent(ye.percentParent,j)+" of "+ye.parent,Q()),ye.percentEntry=m.percentEntry=N/r.getValue(f),ye.entry=m.entry=r.getPtLabel(f),W("percent entry")&&!L&&!m.onPathbar&&(ae=r.formatPercent(ye.percentEntry,j)+" of "+ye.entry,Q()),ye.percentRoot=m.percentRoot=N/r.getValue(g),ye.root=m.root=r.getPtLabel(g),W("percent root")&&!L&&(ae=r.formatPercent(ye.percentRoot,j)+" of "+ye.root,Q()),ye.text=U("hovertext")||U("text"),W("text")&&(ae=ye.text,e.isValidTextValue(ae)&&ge.push(ae)),q=[i(m,d,p.eventDataKeys)];var me={trace:d,y:oe,_x0:m._x0,_x1:m._x1,_y0:m._y0,_y1:m._y1,text:ge.join("
"),name:B||W("name")?d.name:void 0,color:U("hoverlabel.bgcolor")||y.color,borderColor:U("hoverlabel.bordercolor"),fontFamily:U("hoverlabel.font.family"),fontSize:U("hoverlabel.font.size"),fontColor:U("hoverlabel.font.color"),fontWeight:U("hoverlabel.font.weight"),fontStyle:U("hoverlabel.font.style"),fontVariant:U("hoverlabel.font.variant"),nameLength:U("hoverlabel.namelength"),textAlign:U("hoverlabel.align"),hovertemplate:B,hovertemplateLabels:ye,eventData:q};b&&(me.x0=J-m.rInscribed*m.rpx1,me.x1=J+m.rInscribed*m.rpx1,me.idealAlign=m.pxmid[0]<0?"left":"right"),A&&(me.x=J,me.idealAlign=J<0?"left":"right");var ie=[];k.loneHover(me,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:c,inOut_bbox:ie}),q[0].bbox=ie[0],l._hasHoverLabel=!0}if(A){var Y=s.select("path.surface");p.styleOne(Y,m,d,c,{hovered:!0})}l._hasHoverEvent=!0,c.emit("plotly_hover",{points:q||[i(m,d,p.eventDataKeys)],event:h.event})}},_=function(m){var u=c._fullLayout,d=c._fullData[l.index],y=h.select(this).datum();if(l._hasHoverEvent&&(m.originalEvent=h.event,c.emit("plotly_unhover",{points:[i(y,d,p.eventDataKeys)],event:h.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(k.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),A){var R=s.select("path.surface");p.styleOne(R,y,d,c,{hovered:!1})}},w=function(m){var u=c._fullLayout,d=c._fullData[l.index],y=b&&(r.isHierarchyRoot(m)||r.isLeaf(m)),R=r.getPtId(m),L=r.isEntry(m)?r.findEntryWithChild(g,R):r.findEntryWithLevel(g,R),z=r.getPtId(L),N={points:[i(m,d,p.eventDataKeys)],event:h.event};y||(N.nextLevel=z);var U=t.triggerHandler(c,"plotly_"+l.type+"click",N);if(U!==!1&&u.hovermode&&(c._hoverdata=[i(m,d,p.eventDataKeys)],k.click(c,h.event)),!y&&U!==!1&&!c._dragging&&!c._transitioning){x.call("_storeDirectGUIEdit",d,u._tracePreGUI[d.uid],{level:d.level});var B={data:[{level:z}],traces:[l.index]},D={frame:{redraw:!1,duration:p.transitionTime},transition:{duration:p.transitionTime,easing:p.transitionEasing},mode:"immediate",fromcurrent:!0};k.loneUnhover(u._hoverlayer.node()),x.call("animate",c,B,D)}};s.on("mouseover",E),s.on("mouseout",_),s.on("click",w)};function i(a,s,f){for(var c=a.data.data,v={curveNumber:s.index,pointNumber:c.i,data:s._input,fullData:s},p=0;pwt.x1?2*Math.PI:0)+le;vt=Ae.rpx1it?2*Math.PI:0)+le;_t={x0:vt,x1:vt}}else _t={rpx0:pe,rpx1:pe},k.extendFlat(_t,ze(Ae));else _t={rpx0:0,rpx1:0};else _t={x0:le,x1:le};return x(_t,wt)}function qe(Ae){var Ke=se[T.getPtId(Ae)],_t,wt=Ae.transform;if(Ke)_t=Ke;else if(_t={rpx1:Ae.rpx1,transform:{textPosAngle:wt.textPosAngle,scale:0,rotate:wt.rotate,rCenter:wt.rCenter,x:wt.x,y:wt.y}},ae)if(Ae.parent)if(it){var vt=Ae.x1>it?2*Math.PI:0;_t.x0=_t.x1=vt}else k.extendFlat(_t,ze(Ae));else _t.x0=_t.x1=le;else _t.x0=_t.x1=le;var $t=x(_t.transform.textPosAngle,Ae.transform.textPosAngle),Yt=x(_t.rpx1,Ae.rpx1),lr=x(_t.x0,Ae.x0),dr=x(_t.x1,Ae.x1),Nr=x(_t.transform.scale,wt.scale),Fr=x(_t.transform.rotate,wt.rotate),ln=wt.rCenter===0?3:_t.transform.rCenter===0?1/3:1,zr=x(_t.transform.rCenter,wt.rCenter),Xr=function(Ot){return zr(Math.pow(Ot,ln))};return function(Ot){var Qe=Yt(Ot);lr(Ot),dr(Ot);var ct=Xr(Ot),Ue=$t(Ot),Ie={rpx1:Qe,transform:{textPosAngle:Ue,rCenter:ct,x:wt.x,y:wt.y}};return r(U.type,wt,y),{transform:{targetX:Xe(Ie),targetY:We(Ie),scale:Nr(Ot),rotate:Fr(Ot),rCenter:ct}}}}function ze(Ae){var Ke=Ae.parent,_t=se[T.getPtId(Ke)],wt={};if(_t){var vt=Ke.children,$t=vt.indexOf(Ae),Yt=vt.length,lr=x(_t.x0,_t.x1);wt.x0=lr($t/Yt),wt.x1=lr($t/Yt)}else wt.x0=wt.x1=0;return wt}}function g(_){return h.partition().size([2*Math.PI,_.height+1])(_)}ee.formatSliceLabel=function(_,w,m,u,d){var y=m.texttemplate,R=m.textinfo;if(!y&&(!R||R==="none"))return"";var L=d.separators,z=u[0],N=_.data.data,U=z.hierarchy,B=T.isHierarchyRoot(_),D=T.getParent(U,_),j=T.getValue(_);if(!y){var q=R.split("+"),J=function(ie){return q.indexOf(ie)!==-1},oe=[],ye;if(J("label")&&N.label&&oe.push(N.label),N.hasOwnProperty("v")&&J("value")&&oe.push(T.formatValue(N.v,L)),!B){J("current path")&&oe.push(T.getPath(_.data));var pe=0;J("percent parent")&&pe++,J("percent entry")&&pe++,J("percent root")&&pe++;var ge=pe>1;if(pe){var W,ae=function(ie){ye=T.formatPercent(W,L),ge&&(ye+=" of "+ie),oe.push(ye)};J("percent parent")&&!B&&(W=j/T.getValue(D),ae("parent")),J("percent entry")&&(W=j/T.getValue(w),ae("entry")),J("percent root")&&(W=j/T.getValue(U),ae("root"))}}return J("text")&&(ye=k.castOption(m,N.i,"text"),k.isValidTextValue(ye)&&oe.push(ye)),oe.join("
")}var se=k.castOption(m,N.i,"texttemplate");if(!se)return"";var Q={};N.label&&(Q.label=N.label),N.hasOwnProperty("v")&&(Q.value=N.v,Q.valueLabel=T.formatValue(N.v,L)),Q.currentPath=T.getPath(_.data),B||(Q.percentParent=j/T.getValue(D),Q.percentParentLabel=T.formatPercent(Q.percentParent,L),Q.parent=T.getPtLabel(D)),Q.percentEntry=j/T.getValue(w),Q.percentEntryLabel=T.formatPercent(Q.percentEntry,L),Q.entry=T.getPtLabel(w),Q.percentRoot=j/T.getValue(U),Q.percentRootLabel=T.formatPercent(Q.percentRoot,L),Q.root=T.getPtLabel(U),N.hasOwnProperty("color")&&(Q.color=N.color);var me=k.castOption(m,N.i,"text");return(k.isValidTextValue(me)||me==="")&&(Q.text=me),Q.customdata=k.castOption(m,N.i,"customdata"),k.texttemplateString({data:[Q,m._meta],fallback:m.texttemplatefallback,labels:Q,locale:d._d3locale,template:se})};function b(_){return _.rpx0===0&&k.isFullCircle([_.x0,_.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(_.halfangle)),_.ring/2))}function A(_){return E(_.rpx1,_.transform.textPosAngle)}function E(_,w){return[_*Math.sin(w),-_*Math.cos(w)]}}}),n6=_e({"src/traces/sunburst/index.js"(ee,X){X.exports={moduleType:"trace",name:"sunburst",basePlotModule:_C(),categories:[],animatable:!0,attributes:$y(),layoutAttributes:pT(),supplyDefaults:bC(),supplyLayoutDefaults:xC(),calc:Yy().calc,crossTraceCalc:Yy().crossTraceCalc,plot:Yb().plot,style:v3().style,colorbar:Ad(),meta:{}}}}),a6=_e({"lib/sunburst.js"(ee,X){X.exports=n6()}}),i6=_e({"src/traces/treemap/base_plot.js"(ee){var X=Fs();ee.name="treemap",ee.plot=function(h,x,S,k){X.plotBasePlot(ee.name,h,x,S,k)},ee.clean=function(h,x,S,k){X.cleanBasePlot(ee.name,h,x,S,k)}}}),wm=_e({"src/traces/treemap/constants.js"(ee,X){X.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),Xb=_e({"src/traces/treemap/attributes.js"(ee,X){var{hovertemplateAttrs:h,texttemplateAttrs:x,templatefallbackAttrs:S}=fu(),k=tc(),e=hf().attributes,t=pm(),r=$y(),o=wm(),n=po().extendFlat,i=Qf().pattern;X.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"},k("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:x({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"})}}}),m3=_e({"src/traces/treemap/layout_attributes.js"(ee,X){X.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),o6=_e({"src/traces/treemap/defaults.js"(ee,X){var h=kn(),x=Xb(),S=so(),k=hf().defaults,e=up().handleText,t=lm().TEXTPAD,r=vm().handleMarkerDefaults,o=Ho(),n=o.hasColorscale,i=o.handleDefaults;X.exports=function(s,f,c,v){function p(d,y){return h.coerce(s,f,x,d,y)}var T=p("labels"),l=p("parents");if(!T||!T.length||!l||!l.length){f.visible=!1;return}var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth");var b=p("tiling.packing");b==="squarify"&&p("tiling.squarifyratio"),p("tiling.flip"),p("tiling.pad");var A=p("text");p("texttemplate"),p("texttemplatefallback"),f.texttemplate||p("textinfo",h.isArrayOrTypedArray(A)?"text+label":"label"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback");var E=p("pathbar.visible"),_="auto";e(s,f,v,p,_,{hasPathbar:E,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition");var w=f.textposition.indexOf("bottom")!==-1;r(s,f,v,p);var m=f._hasColorscale=n(s,"marker","colors")||(s.marker||{}).coloraxis;m?i(s,f,v,p,{prefix:"marker.",cLetter:"c"}):p("marker.depthfade",!(f.marker.colors||[]).length);var u=f.textfont.size*2;p("marker.pad.t",w?u/4:u),p("marker.pad.l",u/4),p("marker.pad.r",u/4),p("marker.pad.b",w?u:u/4),p("marker.cornerradius"),f._hovered={marker:{line:{width:2,color:S.contrast(v.paper_bgcolor)}}},E&&(p("pathbar.thickness",f.pathbar.textfont.size+2*t),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),k(f,v,p),f._length=null}}}),s6=_e({"src/traces/treemap/layout_defaults.js"(ee,X){var h=kn(),x=m3();X.exports=function(k,e){function t(r,o){return h.coerce(k,e,x,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),g3=_e({"src/traces/treemap/calc.js"(ee){var X=Yy();ee.calc=function(h,x){return X.calc(h,x)},ee.crossTraceCalc=function(h){return X._runCrossTraceCalc("treemap",h)}}}),y3=_e({"src/traces/treemap/flip_tree.js"(ee,X){X.exports=function h(x,S,k){var e;k.swapXY&&(e=x.x0,x.x0=x.y0,x.y0=e,e=x.x1,x.x1=x.y1,x.y1=e),k.flipX&&(e=x.x0,x.x0=S[0]-x.x1,x.x1=S[0]-e),k.flipY&&(e=x.y0,x.y0=S[1]-x.y1,x.y1=S[1]-e);var t=x.children;if(t)for(var r=0;r0)for(var u=0;u").join(" ")||"";var ge=x.ensureSingle(ye,"g","slicetext"),W=x.ensureSingle(ge,"text","",function(se){se.attr("data-notex",1)}),ae=x.ensureUniformFontSize(s,o.determineTextFont(U,oe,z.font,{onPathbar:!0}));W.text(oe._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(S.font,ae).call(k.convertToTspans,s),oe.textBB=S.bBox(W.node()),oe.transform=_(oe,{fontSize:ae.size,onPathbar:!0}),oe.transform.fontSize=ae.size,m?W.transition().attrTween("transform",function(se){var Q=y(se,i,R,[l,g]);return function(me){return w(Q(me))}}):W.attr("transform",w(oe))})}}}),u6=_e({"src/traces/treemap/plot_one.js"(ee,X){var h=mr(),x=(xm(),Lr(P0)).interpolate,S=Nv(),k=kn(),e=lm().TEXTPAD,t=um(),r=t.toMoveInsideBar,o=Ld(),n=o.recordMinTextSize,i=wm(),a=l6();function s(f){return S.isHierarchyRoot(f)?"":S.getPtId(f)}X.exports=function(c,v,p,T,l){var g=c._fullLayout,b=v[0],A=b.trace,E=A.type,_=E==="icicle",w=b.hierarchy,m=S.findEntryWithLevel(w,A.level),u=h.select(p),d=u.selectAll("g.pathbar"),y=u.selectAll("g.slice");if(!m){d.remove(),y.remove();return}var R=S.isHierarchyRoot(m),L=!g.uniformtext.mode&&S.hasTransition(T),z=S.getMaxDepth(A),N=function(zr){return zr.data.depth-m.data.depth-1?j+oe:-(J+oe):0,pe={x0:q,x1:q,y0:ye,y1:ye+J},ge=function(zr,Xr,Ot){var Qe=A.tiling.pad,ct=function(Be){return Be-Qe<=Xr.x0},Ue=function(Be){return Be+Qe>=Xr.x1},Ie=function(Be){return Be-Qe<=Xr.y0},Pe=function(Be){return Be+Qe>=Xr.y1};return zr.x0===Xr.x0&&zr.x1===Xr.x1&&zr.y0===Xr.y0&&zr.y1===Xr.y1?{x0:zr.x0,x1:zr.x1,y0:zr.y0,y1:zr.y1}:{x0:ct(zr.x0-Qe)?0:Ue(zr.x0-Qe)?Ot[0]:zr.x0,x1:ct(zr.x1+Qe)?0:Ue(zr.x1+Qe)?Ot[0]:zr.x1,y0:Ie(zr.y0-Qe)?0:Pe(zr.y0-Qe)?Ot[1]:zr.y0,y1:Ie(zr.y1+Qe)?0:Pe(zr.y1+Qe)?Ot[1]:zr.y1}},W=null,ae={},se={},Q=null,me=function(zr,Xr){return Xr?ae[s(zr)]:se[s(zr)]},ie=function(zr,Xr,Ot,Qe){if(Xr)return ae[s(w)]||pe;var ct=se[A.level]||Ot;return N(zr)?ge(zr,ct,Qe):{}};b.hasMultipleRoots&&R&&z++,A._maxDepth=z,A._backgroundColor=g.paper_bgcolor,A._entryDepth=m.data.depth,A._atRootLevel=R;var Y=-D/2+U.l+U.w*(B.x[1]+B.x[0])/2,le=-j/2+U.t+U.h*(1-(B.y[1]+B.y[0])/2),ue=function(zr){return Y+zr},Te=function(zr){return le+zr},Fe=Te(0),Ve=ue(0),Xe=function(zr){return Ve+zr},We=function(zr){return Fe+zr};function it(zr,Xr){return zr+","+Xr}var yt=Xe(0),bt=function(zr){zr.x=Math.max(yt,zr.x)},mt=A.pathbar.edgeshape,ht=function(zr){var Xr=Xe(Math.max(Math.min(zr.x0,zr.x0),0)),Ot=Xe(Math.min(Math.max(zr.x1,zr.x1),q)),Qe=We(zr.y0),ct=We(zr.y1),Ue=J/2,Ie={},Pe={};Ie.x=Xr,Pe.x=Ot,Ie.y=Pe.y=(Qe+ct)/2;var Be={x:Xr,y:Qe},at={x:Ot,y:Qe},ft={x:Ot,y:ct},Bt={x:Xr,y:ct};return mt===">"?(Be.x-=Ue,at.x-=Ue,ft.x-=Ue,Bt.x-=Ue):mt==="/"?(ft.x-=Ue,Bt.x-=Ue,Ie.x-=Ue/2,Pe.x-=Ue/2):mt==="\\"?(Be.x-=Ue,at.x-=Ue,Ie.x-=Ue/2,Pe.x-=Ue/2):mt==="<"&&(Ie.x-=Ue,Pe.x-=Ue),bt(Be),bt(Bt),bt(Ie),bt(at),bt(ft),bt(Pe),"M"+it(Be.x,Be.y)+"L"+it(at.x,at.y)+"L"+it(Pe.x,Pe.y)+"L"+it(ft.x,ft.y)+"L"+it(Bt.x,Bt.y)+"L"+it(Ie.x,Ie.y)+"Z"},qe=A[_?"tiling":"marker"].pad,ze=function(zr){return A.textposition.indexOf(zr)!==-1},Ae=ze("top"),Ke=ze("left"),_t=ze("right"),wt=ze("bottom"),vt=function(zr){var Xr=ue(zr.x0),Ot=ue(zr.x1),Qe=Te(zr.y0),ct=Te(zr.y1),Ue=Ot-Xr,Ie=ct-Qe;if(!Ue||!Ie)return"";var Pe=A.marker.cornerradius||0,Be=Math.min(Pe,Ue/2,Ie/2);Be&&zr.data&&zr.data.data&&zr.data.data.label&&(Ae&&(Be=Math.min(Be,qe.t)),Ke&&(Be=Math.min(Be,qe.l)),_t&&(Be=Math.min(Be,qe.r)),wt&&(Be=Math.min(Be,qe.b)));var at=function(ft,Bt){return Be?"a"+it(Be,Be)+" 0 0 1 "+it(ft,Bt):""};return"M"+it(Xr,Qe+Be)+at(Be,-Be)+"L"+it(Ot-Be,Qe)+at(Be,Be)+"L"+it(Ot,ct-Be)+at(-Be,Be)+"L"+it(Xr+Be,ct)+at(-Be,-Be)+"Z"},$t=function(zr,Xr){var Ot=zr.x0,Qe=zr.x1,ct=zr.y0,Ue=zr.y1,Ie=zr.textBB,Pe=Ae||Xr.isHeader&&!wt,Be=Pe?"start":wt?"end":"middle",at=ze("right"),ft=ze("left")||Xr.onPathbar,Bt=ft?-1:at?1:0;if(Xr.isHeader){if(Ot+=(_?qe:qe.l)-e,Qe-=(_?qe:qe.r)-e,Ot>=Qe){var Nt=(Ot+Qe)/2;Ot=Nt,Qe=Nt}var Ht;wt?(Ht=Ue-(_?qe:qe.b),ct-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}}),ye=oe.descendants(),pe=1/0,ge=-1/0;ye.forEach(function(me){var ie=me.depth;ie>=B._maxDepth?(me.x0=me.x1=(me.x0+me.x1)/2,me.y0=me.y1=(me.y0+me.y1)/2):(pe=Math.min(pe,ie),ge=Math.max(ge,ie))}),p=p.data(ye,o.getPtId),B._maxVisibleLayers=isFinite(ge)?ge-pe+1:0,p.enter().append("g").classed("slice",!0),u(p,a,L,[l,g],E),p.order();var W=null;if(m&&R){var ae=o.getPtId(R);p.each(function(me){W===null&&o.getPtId(me)===ae&&(W={x0:me.x0,x1:me.x1,y0:me.y0,y1:me.y1})})}var se=function(){return W||{x0:0,x1:l,y0:0,y1:g}},Q=p;return m&&(Q=Q.transition().each("end",function(){var me=h.select(this);o.setSliceCursor(me,f,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),Q.each(function(me){var ie=o.isHeader(me,B);me._x0=b(me.x0),me._x1=b(me.x1),me._y0=A(me.y0),me._y1=A(me.y1),me._hoverX=b(me.x1-B.marker.pad.r),me._hoverY=A(q?me.y1-B.marker.pad.b/2:me.y0+B.marker.pad.t/2);var Y=h.select(this),le=x.ensureSingle(Y,"path","surface",function(We){We.style("pointer-events",z?"none":"all")});m?le.transition().attrTween("d",function(We){var it=d(We,a,se(),[l,g]);return function(yt){return E(it(yt))}}):le.attr("d",E),Y.call(n,v,f,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,f,{isTransitioning:f._transitioning}),le.call(t,me,B,f,{hovered:!1}),me.x0===me.x1||me.y0===me.y1?me._text="":ie?me._text=J?"":o.getPtLabel(me)||"":me._text=i(me,v,B,c,N)||"";var ue=x.ensureSingle(Y,"g","slicetext"),Te=x.ensureSingle(ue,"text","",function(We){We.attr("data-notex",1)}),Fe=x.ensureUniformFontSize(f,o.determineTextFont(B,me,N.font)),Ve=me._text||" ",Xe=ie&&Ve.indexOf("
")===-1;Te.text(Ve).classed("slicetext",!0).attr("text-anchor",j?"end":D||Xe?"start":"middle").call(S.font,Fe).call(k.convertToTspans,f),me.textBB=S.bBox(Te.node()),me.transform=_(me,{fontSize:Fe.size,isHeader:ie}),me.transform.fontSize=Fe.size,m?Te.transition().attrTween("transform",function(We){var it=y(We,a,se(),[l,g]);return function(yt){return w(it(yt))}}):Te.attr("transform",w(me))}),W}}}),f6=_e({"src/traces/treemap/plot.js"(ee,X){var h=b3(),x=c6();X.exports=function(k,e,t,r){return h(k,e,t,r,{type:"treemap",drawDescendants:x})}}}),h6=_e({"src/traces/treemap/index.js"(ee,X){X.exports={moduleType:"trace",name:"treemap",basePlotModule:i6(),categories:[],animatable:!0,attributes:Xb(),layoutAttributes:m3(),supplyDefaults:o6(),supplyLayoutDefaults:s6(),calc:g3().calc,crossTraceCalc:g3().crossTraceCalc,plot:f6(),style:Zb().style,colorbar:Ad(),meta:{}}}}),d6=_e({"lib/treemap.js"(ee,X){X.exports=h6()}}),p6=_e({"src/traces/icicle/base_plot.js"(ee){var X=Fs();ee.name="icicle",ee.plot=function(h,x,S,k){X.plotBasePlot(ee.name,h,x,S,k)},ee.clean=function(h,x,S,k){X.cleanBasePlot(ee.name,h,x,S,k)}}}),x3=_e({"src/traces/icicle/attributes.js"(ee,X){var{hovertemplateAttrs:h,texttemplateAttrs:x,templatefallbackAttrs:S}=fu(),k=tc(),e=hf().attributes,t=pm(),r=$y(),o=Xb(),n=wm(),i=po().extendFlat,a=Qf().pattern;X.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"},k("marker",{colorAttr:"colors",anim:!1})),leaf:r.leaf,pathbar:o.pathbar,text:t.text,textinfo:r.textinfo,texttemplate:x({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"})}}}),w3=_e({"src/traces/icicle/layout_attributes.js"(ee,X){X.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),v6=_e({"src/traces/icicle/defaults.js"(ee,X){var h=kn(),x=x3(),S=so(),k=hf().defaults,e=up().handleText,t=lm().TEXTPAD,r=vm().handleMarkerDefaults,o=Ho(),n=o.hasColorscale,i=o.handleDefaults;X.exports=function(s,f,c,v){function p(w,m){return h.coerce(s,f,x,w,m)}var T=p("labels"),l=p("parents");if(!T||!T.length||!l||!l.length){f.visible=!1;return}var g=p("values");g&&g.length?p("branchvalues"):p("count"),p("level"),p("maxdepth"),p("tiling.orientation"),p("tiling.flip"),p("tiling.pad");var b=p("text");p("texttemplate"),p("texttemplatefallback"),f.texttemplate||p("textinfo",h.isArrayOrTypedArray(b)?"text+label":"label"),p("hovertext"),p("hovertemplate"),p("hovertemplatefallback");var A=p("pathbar.visible"),E="auto";e(s,f,v,p,E,{hasPathbar:A,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),p("textposition"),r(s,f,v,p);var _=f._hasColorscale=n(s,"marker","colors")||(s.marker||{}).coloraxis;_&&i(s,f,v,p,{prefix:"marker.",cLetter:"c"}),p("leaf.opacity",_?1:.7),f._hovered={marker:{line:{width:2,color:S.contrast(v.paper_bgcolor)}}},A&&(p("pathbar.thickness",f.pathbar.textfont.size+2*t),p("pathbar.side"),p("pathbar.edgeshape")),p("sort"),p("root.color"),k(f,v,p),f._length=null}}}),m6=_e({"src/traces/icicle/layout_defaults.js"(ee,X){var h=kn(),x=w3();X.exports=function(k,e){function t(r,o){return h.coerce(k,e,x,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),T3=_e({"src/traces/icicle/calc.js"(ee){var X=Yy();ee.calc=function(h,x){return X.calc(h,x)},ee.crossTraceCalc=function(h){return X._runCrossTraceCalc("icicle",h)}}}),g6=_e({"src/traces/icicle/partition.js"(ee,X){var h=Wy(),x=y3();X.exports=function(k,e,t){var r=t.flipX,o=t.flipY,n=t.orientation==="h",i=t.maxDepth,a=e[0],s=e[1];i&&(a=(k.height+1)*e[0]/Math.min(k.height+1,i),s=(k.height+1)*e[1]/Math.min(k.height+1,i));var f=h.partition().padding(t.pad.inner).size(n?[e[1],a]:[e[0],s])(k);return(n||r||o)&&x(f,e,{swapXY:n,flipX:r,flipY:o}),f}}}),A3=_e({"src/traces/icicle/style.js"(ee,X){var h=mr(),x=so(),S=kn(),k=Ld().resizeText,e=Wb();function t(o){var n=o._fullLayout._iciclelayer.selectAll(".trace");k(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,v=S.castOption(i,c,"marker.line.color")||x.defaultLine,p=S.castOption(i,c,"marker.line.width")||0;o.call(e,n,i,a).style("stroke-width",p).call(x.stroke,v).style("opacity",f?i.leaf.opacity:null)}X.exports={style:t,styleOne:r}}}),y6=_e({"src/traces/icicle/draw_descendants.js"(ee,X){var h=mr(),x=kn(),S=ri(),k=Au(),e=g6(),t=A3().styleOne,r=wm(),o=Nv(),n=c1(),i=Yb().formatSliceLabel,a=!1;X.exports=function(f,c,v,p,T){var l=T.width,g=T.height,b=T.viewX,A=T.viewY,E=T.pathSlice,_=T.toMoveInsideSlice,w=T.strTransform,m=T.hasTransition,u=T.handleSlicesExit,d=T.makeUpdateSliceInterpolator,y=T.makeUpdateTextInterpolator,R=T.prevEntry,L={},z=f._context.staticPlot,N=f._fullLayout,U=c[0],B=U.trace,D=B.textposition.indexOf("left")!==-1,j=B.textposition.indexOf("right")!==-1,q=B.textposition.indexOf("bottom")!==-1,J=e(v,[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}),oe=J.descendants(),ye=1/0,pe=-1/0;oe.forEach(function(Q){var me=Q.depth;me>=B._maxDepth?(Q.x0=Q.x1=(Q.x0+Q.x1)/2,Q.y0=Q.y1=(Q.y0+Q.y1)/2):(ye=Math.min(ye,me),pe=Math.max(pe,me))}),p=p.data(oe,o.getPtId),B._maxVisibleLayers=isFinite(pe)?pe-ye+1:0,p.enter().append("g").classed("slice",!0),u(p,a,L,[l,g],E),p.order();var ge=null;if(m&&R){var W=o.getPtId(R);p.each(function(Q){ge===null&&o.getPtId(Q)===W&&(ge={x0:Q.x0,x1:Q.x1,y0:Q.y0,y1:Q.y1})})}var ae=function(){return ge||{x0:0,x1:l,y0:0,y1:g}},se=p;return m&&(se=se.transition().each("end",function(){var Q=h.select(this);o.setSliceCursor(Q,f,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),se.each(function(Q){Q._x0=b(Q.x0),Q._x1=b(Q.x1),Q._y0=A(Q.y0),Q._y1=A(Q.y1),Q._hoverX=b(Q.x1-B.tiling.pad),Q._hoverY=A(q?Q.y1-B.tiling.pad/2:Q.y0+B.tiling.pad/2);var me=h.select(this),ie=x.ensureSingle(me,"path","surface",function(Te){Te.style("pointer-events",z?"none":"all")});m?ie.transition().attrTween("d",function(Te){var Fe=d(Te,a,ae(),[l,g],{orientation:B.tiling.orientation,flipX:B.tiling.flip.indexOf("x")>-1,flipY:B.tiling.flip.indexOf("y")>-1});return function(Ve){return E(Fe(Ve))}}):ie.attr("d",E),me.call(n,v,f,c,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,f,{isTransitioning:f._transitioning}),ie.call(t,Q,B,f,{hovered:!1}),Q.x0===Q.x1||Q.y0===Q.y1?Q._text="":Q._text=i(Q,v,B,c,N)||"";var Y=x.ensureSingle(me,"g","slicetext"),le=x.ensureSingle(Y,"text","",function(Te){Te.attr("data-notex",1)}),ue=x.ensureUniformFontSize(f,o.determineTextFont(B,Q,N.font));le.text(Q._text||" ").classed("slicetext",!0).attr("text-anchor",j?"end":D?"start":"middle").call(S.font,ue).call(k.convertToTspans,f),Q.textBB=S.bBox(le.node()),Q.transform=_(Q,{fontSize:ue.size}),Q.transform.fontSize=ue.size,m?le.transition().attrTween("transform",function(Te){var Fe=y(Te,a,ae(),[l,g]);return function(Ve){return w(Fe(Ve))}}):le.attr("transform",w(Q))}),ge}}}),_6=_e({"src/traces/icicle/plot.js"(ee,X){var h=b3(),x=y6();X.exports=function(k,e,t,r){return h(k,e,t,r,{type:"icicle",drawDescendants:x})}}}),b6=_e({"src/traces/icicle/index.js"(ee,X){X.exports={moduleType:"trace",name:"icicle",basePlotModule:p6(),categories:[],animatable:!0,attributes:x3(),layoutAttributes:w3(),supplyDefaults:v6(),supplyLayoutDefaults:m6(),calc:T3().calc,crossTraceCalc:T3().crossTraceCalc,plot:_6(),style:A3().style,colorbar:Ad(),meta:{}}}}),x6=_e({"lib/icicle.js"(ee,X){X.exports=b6()}}),w6=_e({"src/traces/funnelarea/base_plot.js"(ee){var X=Fs();ee.name="funnelarea",ee.plot=function(h,x,S,k){X.plotBasePlot(ee.name,h,x,S,k)},ee.clean=function(h,x,S,k){X.cleanBasePlot(ee.name,h,x,S,k)}}}),S3=_e({"src/traces/funnelarea/attributes.js"(ee,X){var h=pm(),x=Zs(),S=hf().attributes,{hovertemplateAttrs:k,texttemplateAttrs:e,templatefallbackAttrs:t}=fu(),r=po().extendFlat;X.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({},x.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:k({},{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"}}}}),M3=_e({"src/traces/funnelarea/layout_attributes.js"(ee,X){var h=gb().hiddenlabels;X.exports={hiddenlabels:h,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),T6=_e({"src/traces/funnelarea/defaults.js"(ee,X){var h=kn(),x=S3(),S=hf().defaults,k=up().handleText,e=vm().handleLabelsAndValues,t=vm().handleMarkerDefaults;X.exports=function(o,n,i,a){function s(E,_){return h.coerce(o,n,x,E,_)}var f=s("labels"),c=s("values"),v=e(f,c),p=v.len;if(n._hasLabels=v.hasLabels,n._hasValues=v.hasValues,!n._hasLabels&&n._hasValues&&(s("label0"),s("dlabel")),!p){n.visible=!1;return}n._length=p,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 b=s("textposition");k(o,n,a,s,b,{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")}}}),A6=_e({"src/traces/funnelarea/layout_defaults.js"(ee,X){var h=kn(),x=M3();X.exports=function(k,e){function t(r,o){return h.coerce(k,e,x,r,o)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),E3=_e({"src/traces/funnelarea/calc.js"(ee,X){var h=kg();function x(k,e){return h.calc(k,e)}function S(k){h.crossTraceCalc(k,{type:"funnelarea"})}X.exports={calc:x,crossTraceCalc:S}}}),S6=_e({"src/traces/funnelarea/plot.js"(ee,X){var h=mr(),x=ri(),S=kn(),k=S.strScale,e=S.strTranslate,t=Au(),r=um(),o=r.toMoveInsideBar,n=Ld(),i=n.recordMinTextSize,a=n.clearMinTextSize,s=_0(),f=yb(),c=f.attachFxHandlers,v=f.determineInsideTextFont,p=f.layoutAreas,T=f.prerenderTitles,l=f.positionTitleOutside,g=f.formatSliceLabel;X.exports=function(w,m){var u=w._context.staticPlot,d=w._fullLayout;a("funnelarea",d),T(m,w),p(m,d._size),S.makeTraceGroups(d._funnelarealayer,m,"trace").each(function(y){var R=h.select(this),L=y[0],z=L.trace;E(y),R.each(function(){var N=h.select(this).selectAll("g.slice").data(y);N.enter().append("g").classed("slice",!0),N.exit().remove(),N.each(function(B,D){if(B.hidden){h.select(this).selectAll("path,g").remove();return}B.pointNumber=B.i,B.curveNumber=z.index;var j=L.cx,q=L.cy,J=h.select(this),oe=J.selectAll("path.surface").data([B]);oe.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),J.call(c,w,y);var ye="M"+(j+B.TR[0])+","+(q+B.TR[1])+b(B.TR,B.BR)+b(B.BR,B.BL)+b(B.BL,B.TL)+"Z";oe.attr("d",ye),g(w,B,L);var pe=s.castOption(z.textposition,B.pts),ge=J.selectAll("g.slicetext").data(B.text&&pe!=="none"?[0]:[]);ge.enter().append("g").classed("slicetext",!0),ge.exit().remove(),ge.each(function(){var W=S.ensureSingle(h.select(this),"text","",function(ue){ue.attr("data-notex",1)}),ae=S.ensureUniformFontSize(w,v(z,B,d.font));W.text(B.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(x.font,ae).call(t.convertToTspans,w);var se=x.bBox(W.node()),Q,me,ie,Y=Math.min(B.BL[1],B.BR[1])+q,le=Math.max(B.TL[1],B.TR[1])+q;me=Math.max(B.TL[0],B.BL[0])+j,ie=Math.min(B.TR[0],B.BR[0])+j,Q=o(me,ie,Y,le,se,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),Q.fontSize=ae.size,i(z.type,Q,d),y[D].transform=Q,S.setTransormAndDisplay(W,Q)})});var U=h.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);U.enter().append("g").classed("titletext",!0),U.exit().remove(),U.each(function(){var B=S.ensureSingle(h.select(this),"text","",function(q){q.attr("data-notex",1)}),D=z.title.text;z._meta&&(D=S.templateString(D,z._meta)),B.text(D).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(x.font,z.title.font).call(t.convertToTspans,w);var j=l(L,d._size);B.attr("transform",e(j.x,j.y)+k(Math.min(1,j.scale))+e(j.tx,j.ty))})})})};function b(_,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 E(_){if(!_.length)return;var w=_[0],m=w.trace,u=m.aspectratio,d=m.baseratio;d>.999&&(d=.999);var y=Math.pow(d,2),R=w.vTotal,L=R*y/(1-y),z=R,N=L/R;function U(){var Te=Math.sqrt(N);return{x:Te,y:-Te}}function B(){var Te=U();return[Te.x,Te.y]}var D,j=[];j.push(B());var q,J;for(q=_.length-1;q>-1;q--)if(J=_[q],!J.hidden){var oe=J.v/z;N+=oe,j.push(B())}var ye=1/0,pe=-1/0;for(q=0;q-1;q--)if(J=_[q],!J.hidden){Y+=1;var le=j[Y][0],ue=j[Y][1];J.TL=[-le,ue],J.TR=[le,ue],J.BL=me,J.BR=ie,J.pxmid=A(J.TR,J.BR),me=J.TL,ie=J.TR}}}}),M6=_e({"src/traces/funnelarea/style.js"(ee,X){var h=mr(),x=hg(),S=Ld().resizeText;X.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(x,a,n,e)})})}}}),E6=_e({"src/traces/funnelarea/index.js"(ee,X){X.exports={moduleType:"trace",name:"funnelarea",basePlotModule:w6(),categories:["pie-like","funnelarea","showLegend"],attributes:S3(),layoutAttributes:M3(),supplyDefaults:T6(),supplyLayoutDefaults:A6(),calc:E3().calc,crossTraceCalc:E3().crossTraceCalc,plot:S6(),style:M6(),styleOne:hg(),meta:{}}}}),k6=_e({"lib/funnelarea.js"(ee,X){X.exports=E6()}}),cd=_e({"stackgl_modules/index.js"(ee,X){(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,v=Math.sin(i),p=Math.cos(i);return r[0]=a+c*v+f*p,r[1]=o[1],r[2]=s+c*p-f*v,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){v[0]in f||(f[v[0]]=[]),f=f[v[0]];for(var p=1;p=0;--D){var ae=U[D];j=ae[0];var se=z[j],Q=se[0],me=se[1],ie=L[Q],Y=L[me];if((ie[0]-Y[0]||ie[1]-Y[1])<0){var le=Q;Q=me,me=le}se[0]=Q;var ue=se[1]=ae[1],Te;for(B&&(Te=se[2]);D>0&&U[D-1][0]===j;){var ae=U[--D],Fe=ae[1];B?z.push([ue,Fe,Te]):z.push([ue,Fe]),ue=Fe}B?z.push([ue,me,Te]):z.push([ue,me])}return q}function _(L,z,N){for(var U=z.length,B=new o(U),D=[],j=0;jz[2]?1:0)}function u(L,z,N){if(L.length!==0){if(z)for(var U=0;U0||j.length>0}function R(L,z,N){var U;if(N){U=z;for(var B=new Array(z.length),D=0;D 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 v=o(getComputedStyle(f).getPropertyValue(c));return v[0]*s(v[1],f)}function a(f,c){var v=document.createElement("div");v.style["font-size"]="128"+f,c.appendChild(v);var p=i(v,"font-size")/128;return c.removeChild(v),p}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 E=A===2?f:A===3?c:A===4?v:A===5?p:T;return A<6?E(o[A]):E(o)}function a(){return[[0]]}function s(A,E){return[[E[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 v(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 p(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,E,_,w,m,u,d,y){return function(L,z){switch(L.length){case 0:return A(L,z);case 1:return E(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 N=d[L.length];return N||(N=d[L.length]=y(L.length)),N(L,z)}}function b(){for(;l.length1e-6?(g=Math.acos(b),A=Math.sin(g),E=Math.sin((1-i)*g)/A,_=Math.sin(i*g)/A):(E=1-i,_=i),r[0]=E*a+_*v,r[1]=E*s+_*p,r[2]=E*f+_*T,r[3]=E*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; }`]),v=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; }`]),p=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:v,fragment:p,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:p,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:b,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),v=o.mallocInt32(s),p=o.mallocInt32(s),T=o.mallocInt32(s),l=o.mallocInt32(s),g=o.mallocDouble(s*8);function b(d){var y=n.nextPow2(d);f.length>>1;i(g,se);for(var Q=0,me=0,pe=0;pe=a)ie=ie-a|0,A(v,p,me--,ie);else if(ie>=0)A(f,c,Q--,ie);else if(ie<=-a){ie=-ie-a|0;for(var Y=0;Y>>1;i(g,se);for(var Q=0,me=0,ie=0,pe=0;pe>1===g[2*pe+3]>>1&&(le=2,pe+=1),Y<0){for(var ue=-(Y>>1)-1,Te=0;Te>1)-1;le===0?A(f,c,Q--,ue):le===1?A(v,p,me--,ue):le===2&&A(T,l,ie--,ue)}}}function m(d,y,R,L,z,N,U,B,D,j,q,J){var oe=0,ye=2*d,pe=y,ge=y+d,W=1,ae=1;L?ae=a:W=a;for(var se=z;se>>1;i(g,Y);for(var le=0,se=0;se=a?(Te=!L,Q-=a):(Te=!!L,Q-=1),Te)E(f,c,le++,Q);else{var Fe=J[Q],Ve=ye*Q,Xe=q[Ve+y+1],We=q[Ve+y+1+d];e:for(var it=0;it>>1;i(g,Q);for(var me=0,ge=0;ge=a)f[me++]=W-a;else{W-=1;var Y=q[W],le=oe*W,ue=j[le+y+1],Te=j[le+y+1+d];e:for(var Fe=0;Fe=0;--Fe)if(f[Fe]===W){for(var it=Fe+1;it 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 v=o(c,i,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v.attributes.normal.location=2,v},t.createPickShader=function(c){var v=o(c,i,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v.attributes.normal.location=2,v},t.createContourShader=function(c){var v=o(c,s,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v},t.createPickContourShader=function(c){var v=o(c,s,f,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v}},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(v,p){var T=p+a,l=String(T).length,g=o(T,c-l);return g+s+v}).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 v=0;v<2;++v){var p=a[v],T=s[v],l=Math.min(p,T),g=Math.max(p,T),b=f[v],A=c[v],E=Math.min(b,A),_=Math.max(b,A);if(_0&&p>0||v<0&&p<0)return!1;var T=o(f,a,s),l=o(c,a,s);return T>0&&l>0||T<0&&l<0?!1:v===0&&p===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),v=o.lo(s);return f>s==s>0?v===i?(c+=1,v=0):v+=1:v===0?(v=i,c-=1):v-=1,o.pack(v,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); }`]),v=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],p={vertex:i,fragment:f,attributes:v},T={vertex:a,fragment:f,attributes:v},l={vertex:s,fragment:f,attributes:v},g={vertex:i,fragment:c,attributes:v},b={vertex:a,fragment:c,attributes:v},A={vertex:s,fragment:c,attributes:v};function E(_,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 E(_,p)},t.createOrtho=function(_){return E(_,T)},t.createProject=function(_){return E(_,l)},t.createPickPerspective=function(_){return E(_,g)},t.createPickOrtho=function(_){return E(_,b)},t.createPickProject=function(_){return E(_,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 v=Math.min(a[0][1],a[1][1]),p=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 pl?v-l:p-l}var g,b;a[0][1]s[1][0])f=s[1],c=s[0];else return n(s,a);var v,p;if(a[0][0]a[1][0])v=a[1],p=a[0];else return-n(a,s);var T=o(f,c,p),l=o(f,c,v);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(p,v,c),l=o(p,v,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]-p[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[j]:D)}function z(B){var D=A(B);return D?R in D:d.indexOf(B)>=0}function N(B,D){var j,q=A(B);return q?q[R]=D:(j=d.indexOf(B),j>=0?y[j]=D:(j=d.length,y[j]=D,d[j]=B)),this}function U(B){var D=A(B),j,q;return D?R in D&&delete D[R]:(j=d.indexOf(B),j<0?!1:(q=d.length-1,d[j]=void 0,y[j]=y[q],d[j]=d[q],d.length=q,y.length=q,!0))}return Object.create(u.prototype,{get___:{value:E(L)},has___:{value:E(z)},set___:{value:E(N)},delete___:{value:E(U)}})};u.prototype=Object.create(Object.prototype,{get:{value:function(y,R){return this.get___(y,R)},writable:!0,configurable:!0},has:{value:function(y){return this.has___(y)},writable:!0,configurable:!0},set:{value:function(y,R){return this.set___(y,R)},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 d(){this instanceof u||w();var y=new n,R=void 0,L=!1;function z(D,j){return R?y.has(D)?y.get(D):R.get___(D,j):y.get(D,j)}function N(D){return y.has(D)||(R?R.has___(D):!1)}var U;o?U=function(D,j){return y.set(D,j),y.has(D)||(R||(R=new u),R.set(D,j)),this}:U=function(D,j){if(L)try{y.set(D,j)}catch{R||(R=new u),R.set___(D,j)}else y.set(D,j);return this};function B(D){var j=!!y.delete(D);return R&&R.delete___(D)||j}return Object.create(u.prototype,{get___:{value:E(z)},has___:{value:E(N)},set___:{value:E(U)},delete___:{value:E(B)},permitHostObjects___:{value:E(function(D){if(D===r)L=!0;else throw new Error("bogus call to permitHostObjects___")})}})}d.prototype=u.prototype,e.exports=d,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,v=[],p=0;p>1,b=s[2*g+1];if(b===p)return g;p>1,b=s[2*g+1];if(b===p)return g;p>1,b=s[2*g+1];if(b===p)return g;p 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(p){return n(p,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); } `]),v=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(p){return n(p,c,v,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 v=c.DATA,p=c.BUFFER;t.free=function(B){if(i.isBuffer(B))p[o.log2(B.length)].push(B);else{if(Object.prototype.toString.call(B)!=="[object ArrayBuffer]"&&(B=B.buffer),!B)return;var D=B.length||B.byteLength,j=o.log2(D)|0;v[j].push(B)}};function T(U){if(U){var B=U.length||U.byteLength,D=o.log2(B);v[D].push(U)}}function l(U){T(U.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){p[o.log2(B.length)].push(B)},t.malloc=function(B,D){if(D===void 0||D==="arraybuffer")return g(B);switch(D){case"uint8":return b(B);case"uint16":return A(B);case"uint32":return E(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 d(B);case"uint8_clamped":return y(B);case"bigint64":return L(B);case"biguint64":return R(B);case"buffer":return N(B);case"data":case"dataview":return z(B);default:return null}return null};function g(B){var B=o.nextPow2(B),D=o.log2(B),j=v[D];return j.length>0?j.pop():new ArrayBuffer(B)}t.mallocArrayBuffer=g;function b(U){return new Uint8Array(g(U),0,U)}t.mallocUint8=b;function A(U){return new Uint16Array(g(2*U),0,U)}t.mallocUint16=A;function E(U){return new Uint32Array(g(4*U),0,U)}t.mallocUint32=E;function _(U){return new Int8Array(g(U),0,U)}t.mallocInt8=_;function w(U){return new Int16Array(g(2*U),0,U)}t.mallocInt16=w;function m(U){return new Int32Array(g(4*U),0,U)}t.mallocInt32=m;function u(U){return new Float32Array(g(4*U),0,U)}t.mallocFloat32=t.mallocFloat=u;function d(U){return new Float64Array(g(8*U),0,U)}t.mallocFloat64=t.mallocDouble=d;function y(U){return a?new Uint8ClampedArray(g(U),0,U):b(U)}t.mallocUint8Clamped=y;function R(U){return s?new BigUint64Array(g(8*U),0,U):null}t.mallocBigUint64=R;function L(U){return f?new BigInt64Array(g(8*U),0,U):null}t.mallocBigInt64=L;function z(U){return new DataView(g(U),0,U)}t.mallocDataView=z;function N(U){U=o.nextPow2(U);var B=o.log2(U),D=p[B];return D.length>0?D.pop():new i(U)}t.mallocBuffer=N,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,v[B].length=0,p[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,N=f(u[z],d);N<=0?(N===0&&(L=z),y=z+1):N>0&&(R=z-1)}return L}t.findCell=T;function l(u,d){for(var y=new Array(u.length),R=0,L=y.length;R=u.length||f(u[oe],z)!==0););}return y}t.incidence=l;function g(u,d){if(!d)return l(p(A(u,0)),u);for(var y=new Array(d),R=0;R>>D&1&&B.push(L[D]);d.push(B)}return v(d)}t.explode=b;function A(u,d){if(d<0)return[];for(var y=[],R=(1<0}_=_.filter(w);for(var m=_.length,u=new Array(m),d=new Array(m),E=0;E0;){var le=me.pop(),ue=oe[le];f(ue,function(We,it){return We-it});var Te=ue.length,Fe=ie[le],Ve;if(Fe===0){var U=_[le];Ve=[U]}for(var E=0;E=0)&&(ie[Xe]=Fe^1,me.push(Xe),Fe===0)){var U=_[Xe];Q(U)||(U.reverse(),Ve.push(U))}}Fe===0&&Y.push(Ve)}return Y}},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 v=0;v1)for(var g=0;g1&&N.drawBuffersWEBGL(n[z]);var q=d.getExtension("WEBGL_depth_texture");q?U?m.depth=l(d,R,L,q.UNSIGNED_INT_24_8_WEBGL,d.DEPTH_STENCIL,d.DEPTH_STENCIL_ATTACHMENT):B&&(m.depth=l(d,R,L,d.UNSIGNED_SHORT,d.DEPTH_COMPONENT,d.DEPTH_ATTACHMENT)):B&&U?m._depth_rb=g(d,R,L,d.DEPTH_STENCIL,d.DEPTH_STENCIL_ATTACHMENT):B?m._depth_rb=g(d,R,L,d.DEPTH_COMPONENT16,d.DEPTH_ATTACHMENT):U&&(m._depth_rb=g(d,R,L,d.STENCIL_INDEX,d.STENCIL_ATTACHMENT));var J=d.checkFramebufferStatus(d.FRAMEBUFFER);if(J!==d.FRAMEBUFFER_COMPLETE){m._destroyed=!0,d.bindFramebuffer(d.FRAMEBUFFER,null),d.deleteFramebuffer(m.handle),m.handle=null,m.depth&&(m.depth.dispose(),m.depth=null),m._depth_rb&&(d.deleteRenderbuffer(m._depth_rb),m._depth_rb=null);for(var j=0;jR||d<0||d>R)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");m._shape[0]=u,m._shape[1]=d;for(var L=c(y),z=0;zL||d<0||d>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(R){if(z>m.getParameter(R.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 N=m.UNSIGNED_BYTE,U=m.getExtension("OES_texture_float");if(y.float&&z>0){if(!U)throw new Error("gl-fbo: Context does not support floating point textures");N=m.FLOAT}else y.preferFloat&&z>0&&U&&(N=m.FLOAT);var B=!0;"depth"in y&&(B=!!y.depth);var D=!1;return"stencil"in y&&(D=!!y.stencil),new A(m,u,d,N,z,B,D,R)}},2272:function(e,t,r){var o=r(2646)[4];r(2478),e.exports=i;function n(a,s,f,c,v,p){var T=s.opposite(c,v);if(!(T<0)){if(v0;){for(var g=f.pop(),p=f.pop(),b=-1,A=-1,T=v[p],_=1;_=0||(s.flip(p,g),n(a,s,f,b,p,A),n(a,s,f,p,A,b),n(a,s,f,A,g,b),n(a,s,f,g,b,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],v=o[3],p=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-p*i,r[1]=f*a-T*i,r[2]=c*a-l*i,r[3]=v*a-g*i,r[8]=s*i+p*a,r[9]=f*i+T*a,r[10]=c*i+l*a,r[11]=v*i+g*a,r}},2419:function(e){e.exports=t;function t(r){for(var o=1,n=1;nA-b?i(f,c,v,p,T,l,g,b,A,E,_):a(f,c,v,p,T,l,g,b,A,E,_)}return s}function o(){function i(v,p,T,l,g,b,A,E,_,w,m){for(var u=2*v,d=l,y=u*l;dw-_?l?i(v,p,T,g,b,A,E,_,w,m,u):a(v,p,T,g,b,A,E,_,w,m,u):l?s(v,p,T,g,b,A,E,_,w,m,u):f(v,p,T,g,b,A,E,_,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,v,p){for(var T=p+1;v<=p;){var l=v+p>>>1,g=s[l],b=c!==void 0?c(g,f):g-f;b>=0?(T=l,p=l-1):v=l+1}return T}function r(s,f,c,v,p){for(var T=p+1;v<=p;){var l=v+p>>>1,g=s[l],b=c!==void 0?c(g,f):g-f;b>0?(T=l,p=l-1):v=l+1}return T}function o(s,f,c,v,p){for(var T=v-1;v<=p;){var l=v+p>>>1,g=s[l],b=c!==void 0?c(g,f):g-f;b<0?(T=l,v=l+1):p=l-1}return T}function n(s,f,c,v,p){for(var T=v-1;v<=p;){var l=v+p>>>1,g=s[l],b=c!==void 0?c(g,f):g-f;b<=0?(T=l,v=l+1):p=l-1}return T}function i(s,f,c,v,p){for(;v<=p;){var T=v+p>>>1,l=s[T],g=c!==void 0?c(l,f):l-f;if(g===0)return T;g<=0?v=T+1:p=T-1}return-1}function a(s,f,c,v,p,T){return typeof c=="function"?T(s,f,c,v===void 0?0:v|0,p===void 0?s.length-1:p|0):T(s,f,void 0,c===void 0?0:c|0,v===void 0?s.length-1:v|0)}e.exports={ge:function(s,f,c,v,p){return a(s,f,c,v,p,t)},gt:function(s,f,c,v,p){return a(s,f,c,v,p,r)},lt:function(s,f,c,v,p){return a(s,f,c,v,p,o)},le:function(s,f,c,v,p){return a(s,f,c,v,p,n)},eq:function(s,f,c,v,p){return a(s,f,c,v,p,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=p;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 v(T,l,g){return l in T?T[l]:g}function p(T,l,g){Array.isArray(l)?(g=g||{},l=l||[]):(g=l||{},l=[]);var b=!!v(g,"delaunay",!0),A=!!v(g,"interior",!0),E=!!v(g,"exterior",!0),_=!!v(g,"infinity",!1);if(!A&&!E||T.length===0)return[];var w=o(T,l);if(b||A!==E||_){for(var m=n(T.length,c(l)),u=0;u0){if(ye=1,W[se++]=v(m[R],b,A,E),R+=q,_>0)for(oe=1,L=m[R],Q=W[se]=v(L,b,A,E),Y=W[se+me],Te=W[se+le],Xe=W[se+Fe],(Q!==Y||Q!==Te||Q!==Xe)&&(N=m[R+z],B=m[R+U],j=m[R+D],f(oe,ye,L,N,B,j,Q,Y,Te,Xe,b,A,E),We=ae[se]=pe++),se+=1,R+=q,oe=2;oe<_;++oe)L=m[R],Q=W[se]=v(L,b,A,E),Y=W[se+me],Te=W[se+le],Xe=W[se+Fe],(Q!==Y||Q!==Te||Q!==Xe)&&(N=m[R+z],B=m[R+U],j=m[R+D],f(oe,ye,L,N,B,j,Q,Y,Te,Xe,b,A,E),We=ae[se]=pe++,Xe!==Y&&c(ae[se+me],We,j,N,Xe,Y,b,A,E)),se+=1,R+=q;for(R+=J,se=0,it=me,me=ie,ie=it,it=le,le=ue,ue=it,it=Fe,Fe=Ve,Ve=it,ye=2;ye0)for(oe=1,L=m[R],Q=W[se]=v(L,b,A,E),Y=W[se+me],Te=W[se+le],Xe=W[se+Fe],(Q!==Y||Q!==Te||Q!==Xe)&&(N=m[R+z],B=m[R+U],j=m[R+D],f(oe,ye,L,N,B,j,Q,Y,Te,Xe,b,A,E),We=ae[se]=pe++,Xe!==Te&&c(ae[se+le],We,B,j,Te,Xe,b,A,E)),se+=1,R+=q,oe=2;oe<_;++oe)L=m[R],Q=W[se]=v(L,b,A,E),Y=W[se+me],Te=W[se+le],Xe=W[se+Fe],(Q!==Y||Q!==Te||Q!==Xe)&&(N=m[R+z],B=m[R+U],j=m[R+D],f(oe,ye,L,N,B,j,Q,Y,Te,Xe,b,A,E),We=ae[se]=pe++,Xe!==Te&&c(ae[se+le],We,B,j,Te,Xe,b,A,E),Xe!==Y&&c(ae[se+me],We,j,N,Xe,Y,b,A,E)),se+=1,R+=q;ye&1&&(se=0),it=me,me=ie,ie=it,it=le,le=ue,ue=it,it=Fe,Fe=Ve,Ve=it,R+=J}}T(ae),T(W)}},"false,1,0":function(f,c,v,p,T){return function(g,b,A,E){var _=g.shape[0]|0,w=g.shape[1]|0,m=g.data,u=g.offset|0,d=g.stride[0]|0,y=g.stride[1]|0,R=u,L,z=-d|0,N=0,U=-y|0,B=0,D=-d-y|0,j=0,q=y|0,J=d-y*w|0,oe=0,ye=0,pe=0,ge=2*w|0,W=p(ge),ae=p(ge),se=0,Q=0,me=-1,ie=-1,Y=0,le=-w|0,ue=w|0,Te=0,Fe=-w-1|0,Ve=w-1|0,Xe=0,We=0,it=0;for(ye=0;ye0){if(oe=1,W[se++]=v(m[R],b,A,E),R+=q,w>0)for(ye=1,L=m[R],Q=W[se]=v(L,b,A,E),Te=W[se+le],Y=W[se+me],Xe=W[se+Fe],(Q!==Te||Q!==Y||Q!==Xe)&&(N=m[R+z],B=m[R+U],j=m[R+D],f(oe,ye,L,N,B,j,Q,Te,Y,Xe,b,A,E),We=ae[se]=pe++),se+=1,R+=q,ye=2;ye0)for(ye=1,L=m[R],Q=W[se]=v(L,b,A,E),Te=W[se+le],Y=W[se+me],Xe=W[se+Fe],(Q!==Te||Q!==Y||Q!==Xe)&&(N=m[R+z],B=m[R+U],j=m[R+D],f(oe,ye,L,N,B,j,Q,Te,Y,Xe,b,A,E),We=ae[se]=pe++,Xe!==Te&&c(ae[se+le],We,j,N,Xe,Te,b,A,E)),se+=1,R+=q,ye=2;ye 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(v),g=0;g=0?l[g]=!0:l[g]=!1;return i(s.vertex,s.cell,s.phase,p,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]&&(R[0]=-R[0]),l[0][2]>l[2][0]&&(R[1]=-R[1]),l[1][0]>l[0][1]&&(R[2]=-R[2]),!0};function b(_,w,m){var u=w[0],d=w[1],y=w[2],R=w[3];return _[0]=m[0]*u+m[4]*d+m[8]*y+m[12]*R,_[1]=m[1]*u+m[5]*d+m[9]*y+m[13]*R,_[2]=m[2]*u+m[6]*d+m[10]*y+m[14]*R,_[3]=m[3]*u+m[7]*d+m[11]*y+m[15]*R,_}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 E(_,w,m,u,d){_[0]=w[0]*u+m[0]*d,_[1]=w[1]*u+m[1]*d,_[2]=w[2]*u+m[2]*d}},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]&&(b+=1);l[g]=b}}return f}function s(f,c){try{return o(f,!0)}catch{var v=n(f);if(v.length<=c)return[];var p=i(f,v),T=o(p,!0);return a(T,v)}}},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,b,A,E){this.gl=l,this.type=g,this.handle=b,this.length=A,this.usage=E}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,b,A,E,_){var w=E.length*E.BYTES_PER_ELEMENT;if(_<0)return l.bufferData(g,E,A),w;if(w+_>b)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(g,_,E),b}function v(l,g){for(var b=o.malloc(l.length,g),A=l.length,E=0;E=0;--A){if(g[A]!==b)return!1;b*=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 b=l.dtype;if(a.indexOf(b)<0&&(b="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var A=gl.getExtension("OES_element_index_uint");A&&b!=="uint16"?b="uint32":b="uint16"}if(b===l.dtype&&p(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 E=o.malloc(l.size,b),_=i(E,l.shape);n.assign(_,l),g<0?this.length=c(this.gl,this.type,this.length,this.usage,E,g):this.length=c(this.gl,this.type,this.length,this.usage,E.subarray(0,l.size),g),o.free(E)}}else if(Array.isArray(l)){var w;this.type===this.gl.ELEMENT_ARRAY_BUFFER?w=v(l,"uint16"):w=v(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,b,A){if(b=b||l.ARRAY_BUFFER,A=A||l.DYNAMIC_DRAW,b!==l.ARRAY_BUFFER&&b!==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 E=l.createBuffer(),_=new s(l,b,E,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,E,_,w){return function(u){return w(A(_(u[0][0],u[1][1]),_(-u[0][1],u[1][0])))}}function c(A,E,_,w){return function(u){return w(A(E(A(_(u[1][1],u[2][2]),_(-u[1][2],u[2][1])),u[0][0]),A(E(A(_(u[1][0],u[2][2]),_(-u[1][2],u[2][0])),-u[0][1]),E(A(_(u[1][0],u[2][1]),_(-u[1][1],u[2][0])),u[0][2]))))}}function v(A,E,_,w){return function(u){return w(A(A(E(A(E(A(_(u[2][2],u[3][3]),_(-u[2][3],u[3][2])),u[1][1]),A(E(A(_(u[2][1],u[3][3]),_(-u[2][3],u[3][1])),-u[1][2]),E(A(_(u[2][1],u[3][2]),_(-u[2][2],u[3][1])),u[1][3]))),u[0][0]),E(A(E(A(_(u[2][2],u[3][3]),_(-u[2][3],u[3][2])),u[1][0]),A(E(A(_(u[2][0],u[3][3]),_(-u[2][3],u[3][0])),-u[1][2]),E(A(_(u[2][0],u[3][2]),_(-u[2][2],u[3][0])),u[1][3]))),-u[0][1])),A(E(A(E(A(_(u[2][1],u[3][3]),_(-u[2][3],u[3][1])),u[1][0]),A(E(A(_(u[2][0],u[3][3]),_(-u[2][3],u[3][0])),-u[1][1]),E(A(_(u[2][0],u[3][1]),_(-u[2][1],u[3][0])),u[1][3]))),u[0][2]),E(A(E(A(_(u[2][1],u[3][2]),_(-u[2][2],u[3][1])),u[1][0]),A(E(A(_(u[2][0],u[3][2]),_(-u[2][2],u[3][0])),-u[1][1]),E(A(_(u[2][0],u[3][1]),_(-u[2][1],u[3][0])),u[1][2]))),-u[0][3]))))}}function p(A,E,_,w){return function(u){return w(A(A(E(A(A(E(A(E(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][2]),A(E(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),-u[2][3]),E(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][4]))),u[1][1]),E(A(E(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][1]),A(E(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][3]),E(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][4]))),-u[1][2])),A(E(A(E(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][1]),A(E(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][2]),E(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][4]))),u[1][3]),E(A(E(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][1]),A(E(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),-u[2][2]),E(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][3]))),-u[1][4]))),u[0][0]),E(A(A(E(A(E(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][2]),A(E(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),-u[2][3]),E(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][4]))),u[1][0]),E(A(E(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][0]),A(E(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][3]),E(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),u[2][4]))),-u[1][2])),A(E(A(E(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][0]),A(E(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][2]),E(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][4]))),u[1][3]),E(A(E(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][0]),A(E(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][2]),E(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][3]))),-u[1][4]))),-u[0][1])),A(E(A(A(E(A(E(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][1]),A(E(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][3]),E(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][4]))),u[1][0]),E(A(E(A(_(u[3][3],u[4][4]),_(-u[3][4],u[4][3])),u[2][0]),A(E(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][3]),E(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),u[2][4]))),-u[1][1])),A(E(A(E(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),u[2][0]),A(E(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][1]),E(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][4]))),u[1][3]),E(A(E(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][0]),A(E(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][1]),E(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][3]))),-u[1][4]))),u[0][2]),A(E(A(A(E(A(E(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][1]),A(E(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),-u[2][2]),E(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][4]))),u[1][0]),E(A(E(A(_(u[3][2],u[4][4]),_(-u[3][4],u[4][2])),u[2][0]),A(E(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][2]),E(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][4]))),-u[1][1])),A(E(A(E(A(_(u[3][1],u[4][4]),_(-u[3][4],u[4][1])),u[2][0]),A(E(A(_(u[3][0],u[4][4]),_(-u[3][4],u[4][0])),-u[2][1]),E(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][4]))),u[1][2]),E(A(E(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][0]),A(E(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),-u[2][1]),E(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][2]))),-u[1][4]))),-u[0][3]),E(A(A(E(A(E(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][1]),A(E(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),-u[2][2]),E(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][3]))),u[1][0]),E(A(E(A(_(u[3][2],u[4][3]),_(-u[3][3],u[4][2])),u[2][0]),A(E(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][2]),E(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),u[2][3]))),-u[1][1])),A(E(A(E(A(_(u[3][1],u[4][3]),_(-u[3][3],u[4][1])),u[2][0]),A(E(A(_(u[3][0],u[4][3]),_(-u[3][3],u[4][0])),-u[2][1]),E(A(_(u[3][0],u[4][1]),_(-u[3][1],u[4][0])),u[2][3]))),u[1][2]),E(A(E(A(_(u[3][1],u[4][2]),_(-u[3][2],u[4][1])),u[2][0]),A(E(A(_(u[3][0],u[4][2]),_(-u[3][2],u[4][0])),-u[2][1]),E(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 E=A===2?f:A===3?c:A===4?v:A===5?p:void 0;return E(n,i,o,a)}var l=[function(){return[0]},function(E){return[E[0][0]]}];function g(A,E,_,w,m,u,d,y){return function(L){switch(L.length){case 0:return A(L);case 1:return E(L);case 2:return _(L);case 3:return w(L);case 4:return m(L);case 5:return u(L)}var z=d[L.length];return z||(z=d[L.length]=y(L.length)),z(L)}}function b(){for(;l.length0){y=c[z][u][0],L=z;break}R=y[L^1];for(var N=0;N<2;++N)for(var U=c[N][u],B=0;B0&&(y=D,R=j,L=N)}return d||y&&l(y,L),R}function b(m,u){var d=c[u][m][0],y=[m];l(d,u);for(var R=d[u^1];;){for(;R!==m;)y.push(R),R=g(y[y.length-2],R,!1);if(c[0][m].length+c[1][m].length===0)break;var L=y[y.length-1],z=m,N=y[1],U=g(L,z,!0);if(o(a[L],a[z],a[N],a[U])<0)break;y.push(m),R=g(L,z)}return y}function A(m,u){return u[1]===u[u.length-1]}for(var v=0;v0;){c[0][v].length;var w=b(v,E);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(p),l=v.length;l>1&&o(i[v[l-2]],i[v[l-1]],T)>=0;)l-=1,v.pop();v.push(p)}for(var g=new Array(v.length+c.length-2),b=0,s=0,A=c.length;s0;--E)g[b++]=v[E];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(v,p,T,l){var g=o(p,T,l);if(g===0){var b=n(o(v,p,T)),A=n(o(v,p,l));if(b===A){if(b===0){var E=f(v,p,T),_=f(v,p,l);return E===_?0:E?1:-1}return 0}else{if(A===0)return b>0||f(v,p,l)?-1:1;if(b===0)return A>0||f(v,p,T)?1:-1}return n(A-b)}var w=o(v,p,T);if(w>0)return g>0&&o(v,p,l)>0?1:-1;if(w<0)return g>0||o(v,p,l)>0?1:-1;var m=o(v,p,l);return m>0||f(v,p,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 N;U=L+z}else if(L<0){if(z>=0)return N;U=-(L+z)}else return N;var B=c*U;return N>=B||N<=-B?N:b(d,y,R)},function(d,y,R,L){var z=d[0]-L[0],N=y[0]-L[0],U=R[0]-L[0],B=d[1]-L[1],D=y[1]-L[1],j=R[1]-L[1],q=d[2]-L[2],J=y[2]-L[2],oe=R[2]-L[2],ye=N*j,pe=U*D,ge=U*B,W=z*j,ae=z*D,se=N*B,Q=q*(ye-pe)+J*(ge-W)+oe*(ae-se),me=(Math.abs(ye)+Math.abs(pe))*Math.abs(q)+(Math.abs(ge)+Math.abs(W))*Math.abs(J)+(Math.abs(ae)+Math.abs(se))*Math.abs(oe),ie=v*me;return Q>ie||-Q>ie?Q:A(d,y,R,L)}];function _(u){var d=E[u.length];return d||(d=E[u.length]=g(u.length)),d.apply(void 0,u)}function w(u,d,y,R,L,z,N){return function(B,D,j,q,J){switch(arguments.length){case 0:case 1:return 0;case 2:return R(B,D);case 3:return L(B,D,j);case 4:return z(B,D,j,q);case 5:return N(B,D,j,q,J)}for(var oe=new Array(arguments.length),ye=0;ye4)throw new n("","Invalid data type");switch(q.charAt(0)){case"b":case"i":f["uniform"+J+"iv"](p[z],N);break;case"v":f["uniform"+J+"fv"](p[z],N);break;default:throw new n("","Unrecognized data type for vector "+name+": "+q)}}else if(q.indexOf("mat")===0&&q.length===4){if(J=q.charCodeAt(q.length-1)-48,J<2||J>4)throw new n("","Invalid uniform dimension type for matrix "+name+": "+q);f["uniformMatrix"+J+"fv"](p[z],!1,N);break}else throw new n("","Unknown uniform data type for "+name+": "+q)}}}}}function g(w,m){if(typeof m!="object")return[[w,m]];var u=[];for(var d in m){var y=m[d],R=w;parseInt(d)+""===d?R+="["+d+"]":R+="."+d,typeof y=="object"?u.push.apply(u,g(R,y)):u.push([R,y])}return u}function b(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 d=E(u);Object.defineProperty(w,m,{get:i(d),set:l(u),enumerable:!0,configurable:!1})}else p[u]?Object.defineProperty(w,m,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):w[m]=b(v[u].type)}function E(w){var m;if(Array.isArray(w)){m=new Array(w.length);for(var u=0;u=0!=m>=0&&p.push(b[0]+.5+.5*(w+m)/(w-m))}v+=_,++b[0]}}}function r(){return t()}var o=r;function n(s){var f={};return function(v,p,T){var l=v.dtype,g=v.order,b=[l,g.join()].join(),A=f[b];return A||(f[b]=A=s([l,g])),A(v.shape.slice(0),v.data,v.stride,v.offset|0,p,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=d;function s(y,R,L,z,N){this.mid=y,this.left=R,this.right=L,this.leftPoints=z,this.rightPoints=N,this.count=(R?R.count:0)+(L?L.count:0)+z.length}var f=s.prototype;function c(y,R){y.mid=R.mid,y.left=R.left,y.right=R.right,y.leftPoints=R.leftPoints,y.rightPoints=R.rightPoints,y.count=R.count}function v(y,R){var L=w(R);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 p(y,R){var L=y.intervals([]);L.push(R),v(y,L)}function T(y,R){var L=y.intervals([]),z=L.indexOf(R);return z<0?n:(L.splice(z,1),v(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 R=this.count-this.leftPoints.length;if(this.count+=1,y[1]3*(R+1)?p(this,y):this.left.insert(y):this.left=w([y]);else if(y[0]>this.mid)this.right?4*(this.right.count+1)>3*(R+1)?p(this,y):this.right.insert(y):this.right=w([y]);else{var L=o.ge(this.leftPoints,y,E),z=o.ge(this.rightPoints,y,_);this.leftPoints.splice(L,0,y),this.rightPoints.splice(z,0,y)}},f.remove=function(y){var R=this.count-this.leftPoints;if(y[1]3*(R-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 N=this.left?this.left.count:0;if(4*N>3*(R-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 U=this,B=this.left;B.right;)U=B,B=B.right;if(U===this)B.right=this.right;else{var D=this.left,z=this.right;U.count-=B.count,U.right=B.left,B.left=D,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 D=o.ge(this.leftPoints,y,E);D=0&&y[z][1]>=R;--z){var N=L(y[z]);if(N)return N}}function b(y,R){for(var L=0;Lthis.mid){if(this.right){var L=this.right.queryPoint(y,R);if(L)return L}return g(this.rightPoints,y,R)}else return b(this.leftPoints,R)},f.queryInterval=function(y,R,L){if(ythis.mid&&this.right){var z=this.right.queryInterval(y,R,L);if(z)return z}return Rthis.mid?g(this.rightPoints,y,L):b(this.leftPoints,L)};function A(y,R){return y-R}function E(y,R){var L=y[0]-R[0];return L||y[1]-R[1]}function _(y,R){var L=y[1]-R[1];return L||y[0]-R[0]}function w(y){if(y.length===0)return null;for(var R=[],L=0;L>1],N=[],U=[],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)?b+=g:(n.number.test(_.type)&&(!d||_.sign)?(y=d?"+":"-",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):"",b+=_.align?y+g+w:m==="0"?y+w+g:w+y+g)}return b}var f=Object.create(null);function c(v){if(f[v])return f[v];for(var p=v,T,l=[],g=0;p;){if((T=n.text.exec(p))!==null)l.push(T[0]);else if((T=n.modulo.exec(p))!==null)l.push("%");else if((T=n.placeholder.exec(p))!==null){if(T[2]){g|=1;var b=[],A=T[2],E=[];if((E=n.key.exec(A))!==null)for(b.push(E[1]);(A=A.substring(E[0].length))!=="";)if((E=n.key_access.exec(A))!==null)b.push(E[1]);else if((E=n.index_access.exec(A))!==null)b.push(E[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");T[2]=b}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");p=p.substring(T[0].length)}return f[v]=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("lov&&T[w+c]>E;--_,w-=g){for(var m=w,u=w+g,d=0;d>>1,E=2*f,_=A,w=T[E*A+c];g=R?(_=y,w=R):d>=z?(_=u,w=d):(_=L,w=z):R>=z?(_=y,w=R):z>=d?(_=u,w=d):(_=L,w=z);for(var B=E*(b-1),D=E*_,N=0;Nthis.buffer.length){n.free(this.buffer);for(var b=this.buffer=n.mallocUint8(a(g*l*4)),A=0;A_|0},vertex:function(b,A,E,_,w,m,u,d,y,R,L,z,N){var U=(u<<0)+(d<<1)+(y<<2)+(R<<3)|0;if(!(U===0||U===15))switch(U){case 0:L.push([b-.5,A-.5]);break;case 1:L.push([b-.25-.25*(_+E-2*N)/(E-_),A-.25-.25*(w+E-2*N)/(E-w)]);break;case 2:L.push([b-.75-.25*(-_-E+2*N)/(_-E),A-.25-.25*(m+_-2*N)/(_-m)]);break;case 3:L.push([b-.5,A-.5-.5*(w+E+m+_-4*N)/(E-w+_-m)]);break;case 4:L.push([b-.25-.25*(m+w-2*N)/(w-m),A-.75-.25*(-w-E+2*N)/(w-E)]);break;case 5:L.push([b-.5-.5*(_+E+m+w-4*N)/(E-_+w-m),A-.5]);break;case 6:L.push([b-.5-.25*(-_-E+m+w)/(_-E+w-m),A-.5-.25*(-w-E+m+_)/(w-E+_-m)]);break;case 7:L.push([b-.75-.25*(m+w-2*N)/(w-m),A-.75-.25*(m+_-2*N)/(_-m)]);break;case 8:L.push([b-.75-.25*(-m-w+2*N)/(m-w),A-.75-.25*(-m-_+2*N)/(m-_)]);break;case 9:L.push([b-.5-.25*(_+E+-m-w)/(E-_+m-w),A-.5-.25*(w+E+-m-_)/(E-w+m-_)]);break;case 10:L.push([b-.5-.5*(-_-E+-m-w+4*N)/(_-E+m-w),A-.5]);break;case 11:L.push([b-.25-.25*(-m-w+2*N)/(m-w),A-.75-.25*(w+E-2*N)/(E-w)]);break;case 12:L.push([b-.5,A-.5-.5*(-w-E+-m-_+4*N)/(w-E+m-_)]);break;case 13:L.push([b-.75-.25*(_+E-2*N)/(E-_),A-.25-.25*(-m-_+2*N)/(m-_)]);break;case 14:L.push([b-.25-.25*(-_-E+2*N)/(_-E),A-.25-.25*(-w-E+2*N)/(w-E)]);break;case 15:L.push([b-.5,A-.5]);break}},cell:function(b,A,E,_,w,m,u,d,y){w?d.push([b,A]):d.push([A,b])}});return function(g,b){var A=[],E=[];return l(g,A,E,b),{positions:A,cells:E}}}};function a(v,p){var T=v.length+"d",l=i[T];if(l)return l(o,v,p)}function s(v,p){for(var T=n(v,p),l=T.length,g=new Array(l),b=new Array(l),A=0;A>1,T=-7,l=n?a-1:0,g=n?-1:1,b=r[o+l];for(l+=g,s=b&(1<<-T)-1,b>>=-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-p;else{if(s===v)return f?NaN:(b?-1:1)*(1/0);f=f+Math.pow(2,i),s=s-p}return(b?-1:1)*f*Math.pow(2,s-i)},t.write=function(r,o,n,i,a,s){var f,c,v,p=s*8-a-1,T=(1<>1,g=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=i?0:s-1,A=i?1:-1,E=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*(v=Math.pow(2,-f))<1&&(f--,v*=2),f+l>=1?o+=g/v:o+=g*Math.pow(2,1-l),o*v>=2&&(f++,v/=2),f+l>=T?(c=0,f=T):f+l>=1?(c=(o*v-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+b]=c&255,b+=A,c/=256,a-=8);for(f=f<0;r[n+b]=f&255,b+=A,f/=256,p-=8);r[n+b-A]|=E*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,v=DataView;function p(z){return c.isView(z)&&!(z instanceof v)}function T(z){return Array.isArray(z)||p(z)}function l(z,N){return z[0]=N[0],z[1]=N[1],z[2]=N[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 b=g.prototype;b.update=function(z){z=z||{};function N(Q,me,ie){if(ie in z){var Y=z[ie],le=this[ie],ue;(Q?T(Y)&&T(Y[0]):T(Y))?this[ie]=ue=[me(Y[0]),me(Y[1]),me(Y[2])]:this[ie]=ue=[me(Y),me(Y),me(Y)];for(var Te=0;Te<3;++Te)if(ue[Te]!==le[Te])return!0}return!1}var U=N.bind(this,!1,Number),B=N.bind(this,!1,Boolean),D=N.bind(this,!1,String),j=N.bind(this,!0,function(Q){if(T(Q)){if(Q.length===3)return[+Q[0],+Q[1],+Q[2],1];if(Q.length===4)return[+Q[0],+Q[1],+Q[2],+Q[3]]}return[0,0,0,1]}),q,J=!1,oe=!1;if("bounds"in z)for(var ye=z.bounds,pe=0;pe<2;++pe)for(var ge=0;ge<3;++ge)ye[pe][ge]!==this.bounds[pe][ge]&&(oe=!0),this.bounds[pe][ge]=ye[pe][ge];if("ticks"in z){q=z.ticks,J=!0,this.autoTicks=!1;for(var pe=0;pe<3;++pe)this.tickSpacing[pe]=0}else U("tickSpacing")&&(this.autoTicks=!0,oe=!0);if(this._firstInit&&("ticks"in z||"tickSpacing"in z||(this.autoTicks=!0),oe=!0,J=!0,this._firstInit=!1),oe&&this.autoTicks&&(q=s.create(this.bounds,this.tickSpacing),J=!0),J){for(var pe=0;pe<3;++pe)q[pe].sort(function(me,ie){return me.x-ie.x});s.equal(q,this.ticks)?J=!1:this.ticks=q}B("tickEnable"),D("tickFont")&&(J=!0),D("tickFontStyle")&&(J=!0),D("tickFontWeight")&&(J=!0),D("tickFontVariant")&&(J=!0),U("tickSize"),U("tickAngle"),U("tickPad"),j("tickColor");var W=D("labels");D("labelFont")&&(W=!0),D("labelFontStyle")&&(W=!0),D("labelFontWeight")&&(W=!0),D("labelFontVariant")&&(W=!0),B("labelEnable"),U("labelSize"),U("labelPad"),j("labelColor"),B("lineEnable"),B("lineMirror"),U("lineWidth"),j("lineColor"),B("lineTickEnable"),B("lineTickMirror"),U("lineTickLength"),U("lineTickWidth"),j("lineTickColor"),B("gridEnable"),U("gridWidth"),j("gridColor"),B("zeroEnable"),j("zeroLineColor"),U("zeroLineWidth"),B("backgroundEnable"),j("backgroundColor");var ae=[{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]}],se=[{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&&(W||J)&&this._text.update(this.bounds,this.labels,ae,this.ticks,se):this._text=o(this.gl,this.bounds,this.labels,ae,this.ticks,se),this._lines&&J&&(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 E=[new A,new A,new A];function _(z,N,U,B,D){for(var j=z.primalOffset,q=z.primalMinor,J=z.mirrorOffset,oe=z.mirrorMinor,ye=B[N],pe=0;pe<3;++pe)if(N!==pe){var ge=j,W=J,ae=q,se=oe;ye&1<0?(ae[pe]=-1,se[pe]=0):(ae[pe]=0,se[pe]=1)}}var w=[0,0,0],m={model:f,view:f,projection:f,_ortho:!1};b.isOpaque=function(){return!0},b.isTransparent=function(){return!1},b.drawTransparent=function(z){};var u=0,d=[0,0,0],y=[0,0,0],R=[0,0,0];b.draw=function(z){z=z||m;for(var ie=this.gl,N=z.model||f,U=z.view||f,B=z.projection||f,D=this.bounds,j=z._ortho||!1,q=a(N,U,B,D,j),J=q.cubeEdges,oe=q.axis,ye=U[12],pe=U[13],ge=U[14],W=U[15],ae=j?2:1,se=ae*this.pixelRatio*(B[3]*ye+B[7]*pe+B[11]*ge+B[15]*W)/ie.drawingBufferHeight,Q=0;Q<3;++Q)this.lastCubeProps.cubeEdges[Q]=J[Q],this.lastCubeProps.axis[Q]=oe[Q];for(var me=E,Q=0;Q<3;++Q)_(E[Q],Q,this.bounds,J,oe);for(var ie=this.gl,Y=w,Q=0;Q<3;++Q)this.backgroundEnable[Q]?Y[Q]=oe[Q]:Y[Q]=0;this._background.draw(N,U,B,D,Y,this.backgroundColor),this._lines.bind(N,U,B,this);for(var Q=0;Q<3;++Q){var le=[0,0,0];oe[Q]>0?le[Q]=D[1][Q]:le[Q]=D[0][Q];for(var ue=0;ue<2;++ue){var Te=(Q+1+ue)%3,Fe=(Q+1+(ue^1))%3;this.gridEnable[Te]&&this._lines.drawGrid(Te,Fe,this.bounds,le,this.gridColor[Te],this.gridWidth[Te]*this.pixelRatio)}for(var ue=0;ue<2;++ue){var Te=(Q+1+ue)%3,Fe=(Q+1+(ue^1))%3;this.zeroEnable[Fe]&&Math.min(D[0][Fe],D[1][Fe])<=0&&Math.max(D[0][Fe],D[1][Fe])>=0&&this._lines.drawZero(Te,Fe,this.bounds,le,this.zeroLineColor[Fe],this.zeroLineWidth[Fe]*this.pixelRatio)}}for(var Q=0;Q<3;++Q){this.lineEnable[Q]&&this._lines.drawAxisLine(Q,this.bounds,me[Q].primalOffset,this.lineColor[Q],this.lineWidth[Q]*this.pixelRatio),this.lineMirror[Q]&&this._lines.drawAxisLine(Q,this.bounds,me[Q].mirrorOffset,this.lineColor[Q],this.lineWidth[Q]*this.pixelRatio);for(var Ve=l(d,me[Q].primalMinor),Xe=l(y,me[Q].mirrorMinor),We=this.lineTickLength,ue=0;ue<3;++ue){var it=se/N[5*ue];Ve[ue]*=We[ue]*it,Xe[ue]*=We[ue]*it}this.lineTickEnable[Q]&&this._lines.drawAxisTicks(Q,me[Q].primalOffset,Ve,this.lineTickColor[Q],this.lineTickWidth[Q]*this.pixelRatio),this.lineTickMirror[Q]&&this._lines.drawAxisTicks(Q,me[Q].mirrorOffset,Xe,this.lineTickColor[Q],this.lineTickWidth[Q]*this.pixelRatio)}this._lines.unbind(),this._text.bind(N,U,B,this.pixelRatio);var yt,bt=.5,mt,ht;function qe(vt){ht=[0,0,0],ht[vt]=1}function ze(vt,$t,Yt){var lr=(vt+1)%3,dr=(vt+2)%3,Nr=$t[lr],Fr=$t[dr],ln=Yt[lr],zr=Yt[dr];if(Nr>0&&zr>0){qe(lr);return}else if(Nr>0&&zr<0){qe(lr);return}else if(Nr<0&&zr>0){qe(lr);return}else if(Nr<0&&zr<0){qe(lr);return}else if(Fr>0&&ln>0){qe(dr);return}else if(Fr>0&&ln<0){qe(dr);return}else if(Fr<0&&ln>0){qe(dr);return}else if(Fr<0&&ln<0){qe(dr);return}}for(var Q=0;Q<3;++Q){for(var Ae=me[Q].primalMinor,Ke=me[Q].mirrorMinor,_t=l(R,me[Q].primalOffset),ue=0;ue<3;++ue)this.lineTickEnable[Q]&&(_t[ue]+=se*Ae[ue]*Math.max(this.lineTickLength[ue],0)/N[5*ue]);var wt=[0,0,0];if(wt[Q]=1,this.tickEnable[Q]){this.tickAngle[Q]===-3600?(this.tickAngle[Q]=0,this.tickAlign[Q]="auto"):this.tickAlign[Q]=-1,mt=1,yt=[this.tickAlign[Q],bt,mt],yt[0]==="auto"?yt[0]=u:yt[0]=parseInt(""+yt[0]),ht=[0,0,0],ze(Q,Ae,Ke);for(var ue=0;ue<3;++ue)_t[ue]+=se*Ae[ue]*this.tickPad[ue]/N[5*ue];this._text.drawTicks(Q,this.tickSize[Q],this.tickAngle[Q],_t,this.tickColor[Q],wt,ht,yt)}if(this.labelEnable[Q]){mt=0,ht=[0,0,0],this.labels[Q].length>4&&(qe(Q),mt=1),yt=[this.labelAlign[Q],bt,mt],yt[0]==="auto"?yt[0]=u:yt[0]=parseInt(""+yt[0]);for(var ue=0;ue<3;++ue)_t[ue]+=se*Ae[ue]*this.labelPad[ue]/N[5*ue];_t[Q]+=.5*(D[0][Q]+D[1][Q]),this._text.drawLabel(Q,this.labelSize[Q],this.labelAngle[Q],_t,this.labelColor[Q],[0,0,0],ht,yt)}}this._text.unbind()},b.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,N){var U=new g(z);return U.update(N),U}},3840:function(e){e.exports=E;var t=0,r=1;function o(_,w,m,u,d,y){this._color=_,this.key=w,this.value=m,this.left=u,this.right=d,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,d=[],y=[];u;){var R=m(_,u.key);d.push(u),y.push(R),R<=0?u=u.left:u=u.right}d.push(new o(t,_,w,null,null,1));for(var L=d.length-2;L>=0;--L){var u=d[L];y[L]<=0?d[L]=new o(u._color,u.key,u.value,d[L+1],u.right,u._count+1):d[L]=new o(u._color,u.key,u.value,u.left,d[L+1],u._count+1)}for(var L=d.length-1;L>1;--L){var z=d[L-1],u=d[L];if(z._color===r||u._color===r)break;var N=d[L-2];if(N.left===z)if(z.left===u){var U=N.right;if(U&&U._color===t)z._color=r,N.right=i(r,U),N._color=t,L-=1;else{if(N._color=t,N.left=z.right,z._color=r,z.right=N,d[L-2]=z,d[L-1]=u,a(N),a(z),L>=3){var B=d[L-3];B.left===N?B.left=z:B.right=z}break}}else{var U=N.right;if(U&&U._color===t)z._color=r,N.right=i(r,U),N._color=t,L-=1;else{if(z.right=u.left,N._color=t,N.left=u.right,u._color=r,u.left=z,u.right=N,d[L-2]=u,d[L-1]=z,a(N),a(z),a(u),L>=3){var B=d[L-3];B.left===N?B.left=u:B.right=u}break}}else if(z.right===u){var U=N.left;if(U&&U._color===t)z._color=r,N.left=i(r,U),N._color=t,L-=1;else{if(N._color=t,N.right=z.left,z._color=r,z.left=N,d[L-2]=z,d[L-1]=u,a(N),a(z),L>=3){var B=d[L-3];B.right===N?B.right=z:B.left=z}break}}else{var U=N.left;if(U&&U._color===t)z._color=r,N.left=i(r,U),N._color=t,L-=1;else{if(z.left=u.right,N._color=t,N.right=u.left,u._color=r,u.right=z,u.left=N,d[L-2]=u,d[L-1]=z,a(N),a(z),a(u),L>=3){var B=d[L-3];B.right===N?B.right=u:B.left=u}break}}}return d[0]._color=r,new s(m,d[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 v(_,w,m,u){var d=w(_,u.key);if(d<=0){if(u.left){var y=v(_,w,m,u.left);if(y)return y}var y=m(u.key,u.value);if(y)return y}if(u.right)return v(_,w,m,u.right)}function p(_,w,m,u,d){var y=m(_,d.key),R=m(w,d.key),L;if(y<=0&&(d.left&&(L=p(_,w,m,u,d.left),L)||R>0&&(L=u(d.key,d.value),L)))return L;if(R>0&&d.right)return p(_,w,m,u,d.right)}f.forEach=function(w,m,u){if(this.root)switch(arguments.length){case 1:return c(w,this.root);case 2:return v(m,this._compare,w,this.root);case 3:return this._compare(m,u)>=0?void 0:p(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=[],d=0;m;){var y=w(_,m.key);u.push(m),y<=0&&(d=u.length),y<=0?m=m.left:m=m.right}return u.length=d,new T(this,u)},f.gt=function(_){for(var w=this._compare,m=this.root,u=[],d=0;m;){var y=w(_,m.key);u.push(m),y<0&&(d=u.length),y<0?m=m.left:m=m.right}return u.length=d,new T(this,u)},f.lt=function(_){for(var w=this._compare,m=this.root,u=[],d=0;m;){var y=w(_,m.key);u.push(m),y>0&&(d=u.length),y<=0?m=m.left:m=m.right}return u.length=d,new T(this,u)},f.le=function(_){for(var w=this._compare,m=this.root,u=[],d=0;m;){var y=w(_,m.key);u.push(m),y>=0&&(d=u.length),y<0?m=m.left:m=m.right}return u.length=d,new T(this,u)},f.find=function(_){for(var w=this._compare,m=this.root,u=[];m;){var d=w(_,m.key);if(u.push(m),d===0)return new T(this,u);d<=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 b(_){for(var w,m,u,d,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),d=u.right=n(u.right),m.right=u.left,u.left=m,u.right=d,u._color=m._color,w._color=r,m._color=r,d._color=r,a(m),a(u),y>1){var R=_[y-2];R.left===m?R.left=u:R.right=u}_[y-1]=u;return}else if(u.left&&u.left._color===t){if(u=m.right=n(u),d=u.left=n(u.left),m.right=d.left,u.left=d.right,d.left=m,d.right=u,d._color=m._color,m._color=r,u._color=r,w._color=r,a(m),a(u),a(d),y>1){var R=_[y-2];R.left===m?R.left=d:R.right=d}_[y-1]=d;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 R=_[y-2];R.left===m?R.left=u:R.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),d=u.left=n(u.left),m.left=u.right,u.right=m,u.left=d,u._color=m._color,w._color=r,m._color=r,d._color=r,a(m),a(u),y>1){var R=_[y-2];R.right===m?R.right=u:R.left=u}_[y-1]=u;return}else if(u.right&&u.right._color===t){if(u=m.left=n(u),d=u.right=n(u.right),m.left=d.right,u.right=d.left,d.right=m,d.left=u,d._color=m._color,m._color=r,u._color=r,w._color=r,a(m),a(u),a(d),y>1){var R=_[y-2];R.right===m?R.right=d:R.left=d}_[y-1]=d;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 R=_[y-2];R.right===m?R.right=u:R.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 d=w.length;for(m=m.left;m.right;)w.push(m),m=m.right;var y=w[d-1];w.push(new o(m._color,y.key,y.value,m.left,m.right,m._count)),w[d-1].key=m.key,w[d-1].value=m.value;for(var u=w.length-2;u>=d;--u)m=w[u],w[u]=new o(m._color,m.key,m.value,m.left,w[u+1],m._count);w[d-1].left=w[d]}if(m=w[w.length-1],m._color===t){var R=w[w.length-2];R.left===m?R.left=null:R.right===m&&(R.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 d=w.length-2;d>=0;--d)u=w[d],u.left===w[d+1]?m[d]=new o(u._color,u.key,u.value,m[d+1],u.right,u._count):m[d]=new o(u._color,u.key,u.value,u.left,m[d+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 E(_){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),v=1/(i-a),p=1/(s-f);return r[0]=-2*c,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*v,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*p,r[11]=0,r[12]=(o+n)*c,r[13]=(a+i)*v,r[14]=(f+s)*p,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],v=n[2],p=n[3],T=p*i+c*s-v*a,l=p*a+v*i-f*s,g=p*s+f*a-c*i,b=-f*i-c*a-v*s;return r[0]=T*p+b*-f+l*-v-g*-c,r[1]=l*p+b*-c+g*-f-T*-v,r[2]=g*p+b*-v+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,v,p){var T=o+s+p;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(f-v)/l,r[1]=.5*(c-i)/l,r[2]=.5*(n-s)/l,r[3]=.5*l}else{var g=Math.max(o,s,p),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-v)/l):s>=g?(r[0]=.5*(n+a)/l,r[1]=.5*l,r[2]=.5*(v+f)/l,r[3]=.5*(c-i)/l):(r[0]=.5*(i+c)/l,r[1]=.5*(f+v)/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),v=r(351),p=r(4772),T=r(4040),l=r(799),g=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:w,createCamera:o};function b(){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,d){var y=null;try{y=u.getContext("webgl",d),y||(y=u.getContext("experimental-webgl",d))}catch{return null}return y}function E(u){var d=Math.round(Math.log(Math.abs(u))/Math.log(10));if(d<0){var y=Math.round(Math.pow(10,-d));return Math.ceil(u*y)/y}else if(d>0){var y=Math.round(Math.pow(10,d));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 d=u.canvas;if(!d)if(d=document.createElement("canvas"),u.container){var y=u.container;y.appendChild(d)}else document.body.appendChild(d);var R=u.gl;if(R||(u.glOptions&&(g=!!u.glOptions.preserveDrawingBuffer),R=A(d,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:g})),!R)throw new Error("webgl not supported");var L=u.bounds||[[-10,-10,-10],[10,10,10]],z=new b,N=f(R,R.drawingBufferWidth,R.drawingBufferHeight,{preferFloat:!g}),U=l(R),B=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,D={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},j=u.axes||{},q=n(R,j);q.enable=!j.disable;var J=u.spikes||{},oe=a(R,J),ye=[],pe=[],ge=[],W=[],ae=!0,ie=!0,se=new Array(16),Q=new Array(16),me={view:null,projection:se,model:Q,_ortho:!1},ie=!0,Y=[R.drawingBufferWidth,R.drawingBufferHeight],le=u.cameraObject||o(d,D),ue={gl:R,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:d,selection:z,camera:le,axes:q,axesPixels:null,spikes:oe,bounds:L,objects:ye,shape:Y,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:me,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(ht){this.aspect[0]=ht.x,this.aspect[1]=ht.y,this.aspect[2]=ht.z,ie=!0},setBounds:function(ht,qe){this.bounds[0][ht]=qe.min,this.bounds[1][ht]=qe.max},setClearColor:function(ht){this.clearColor=ht},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)}},Te=[R.drawingBufferWidth/ue.pixelRatio|0,R.drawingBufferHeight/ue.pixelRatio|0];function Fe(){if(!ue._stopped&&ue.autoResize){var ht=d.parentNode,qe=1,ze=1;ht&&ht!==document.body?(qe=ht.clientWidth,ze=ht.clientHeight):(qe=window.innerWidth,ze=window.innerHeight);var Ae=Math.ceil(qe*ue.pixelRatio)|0,Ke=Math.ceil(ze*ue.pixelRatio)|0;if(Ae!==d.width||Ke!==d.height){d.width=Ae,d.height=Ke;var _t=d.style;_t.position=_t.position||"absolute",_t.left="0px",_t.top="0px",_t.width=qe+"px",_t.height=ze+"px",ae=!0}}}ue.autoResize&&Fe(),window.addEventListener("resize",Fe);function Ve(){for(var ht=ye.length,qe=W.length,ze=0;ze0&&ge[qe-1]===0;)ge.pop(),W.pop().dispose()}ue.update=function(ht){ue._stopped||(ae=!0,ie=!0)},ue.add=function(ht){ue._stopped||(ht.axes=q,ye.push(ht),pe.push(-1),ae=!0,ie=!0,Ve())},ue.remove=function(ht){if(!ue._stopped){var qe=ye.indexOf(ht);qe<0||(ye.splice(qe,1),pe.pop(),ae=!0,ie=!0,Ve())}},ue.dispose=function(){if(!ue._stopped&&(ue._stopped=!0,window.removeEventListener("resize",Fe),d.removeEventListener("webglcontextlost",Xe),ue.mouseListener.enabled=!1,!ue.contextLost)){q.dispose(),oe.dispose();for(var ht=0;htz.distance)continue;for(var Yt=0;Ytp;){var m=l[w-2],u=l[w-1];if(ml[T+1]:!0}function c(p,T,l,g){p*=2;var b=g[p];return b>1,_=E-g,w=E+g,m=b,u=_,d=E,y=w,R=A,L=p+1,z=T-1,N=0;f(m,u,l)&&(N=m,m=u,u=N),f(y,R,l)&&(N=y,y=R,R=N),f(m,d,l)&&(N=m,m=d,d=N),f(u,d,l)&&(N=u,u=d,d=N),f(m,y,l)&&(N=m,m=y,y=N),f(d,y,l)&&(N=d,d=y,y=N),f(u,R,l)&&(N=u,u=R,R=N),f(u,d,l)&&(N=u,u=d,d=N),f(y,R,l)&&(N=y,y=R,R=N);for(var U=l[2*u],B=l[2*u+1],D=l[2*y],j=l[2*y+1],q=2*m,J=2*d,oe=2*R,ye=2*b,pe=2*E,ge=2*A,W=0;W<2;++W){var ae=l[q+W],se=l[J+W],Q=l[oe+W];l[ye+W]=ae,l[pe+W]=se,l[ge+W]=Q}i(_,p,l),i(w,T,l);for(var me=L;me<=z;++me)if(c(me,U,B,l))me!==L&&n(me,L,l),++L;else if(!c(me,D,j,l))for(;;)if(c(z,D,j,l)){c(z,U,B,l)?(a(me,L,z,l),++L,--z):(n(me,z,l),--z);break}else{if(--z0)if(b[0]!==E[1][0])A=g,g=g.right;else{var u=v(g.right,b);if(u)return u;g=g.left}else{if(b[0]!==E[1][0])return g;var u=v(g.right,b);if(u)return u;g=g.left}}return A}f.castUp=function(g){var b=o.le(this.coordinates,g[0]);if(b<0)return-1;this.slabs[b];var A=v(this.slabs[b],g),E=-1;if(A&&(E=A.value),this.coordinates[b]===g[0]){var _=null;if(A&&(_=A.key),b>0){var w=v(this.slabs[b-1],g);w&&(_?a(w.key,_)>0&&(_=w.key,E=w.value):(E=w.value,_=w.key))}var m=this.horizontal[b];if(m.length>0){var u=o.ge(m,g[1],c);if(u=m.length)return E;d=m[u]}}if(d.start)if(_){var y=i(_[0],_[1],[g[0],d.y]);_[0][0]>_[1][0]&&(y=-y),y>0&&(E=d.index)}else E=d.index;else d.y!==g[1]&&(E=d.index)}}}return E};function p(g,b,A,E){this.y=g,this.index=b,this.start=A,this.closed=E}function T(g,b,A,E){this.x=g,this.segment=b,this.create=A,this.index=E}function l(g){for(var b=g.length,A=2*b,E=new Array(A),_=0;_Math.abs(u))l.rotate(R,0,0,-m*d*Math.PI*_.rotateSpeed/window.innerWidth);else if(!_._ortho){var L=-_.zoomSpeed*y*u/window.innerHeight*(R-l.lastT())/20;l.pan(R,0,0,b*(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,b,A){this.gl=l,this.buffer=g,this.vao=b,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],v=[0,0,0],p=[0,0];f.isTransparent=function(){return!1},f.drawTransparent=function(l){},f.draw=function(l){var g=this.gl,b=this.vao,A=this.shader;b.bind(),A.bind();var E=l.model||a,_=l.view||a,w=l.projection||a,m;this.axes&&(m=this.axes.lastCubeProps.axis);for(var u=c,d=v,y=0;y<3;++y)m&&m[y]<0?(u[y]=this.bounds[0][y],d[y]=this.bounds[1][y]):(u[y]=this.bounds[1][y],d[y]=this.bounds[0][y]);p[0]=g.drawingBufferWidth,p[1]=g.drawingBufferHeight,A.uniforms.model=E,A.uniforms.view=_,A.uniforms.projection=w,A.uniforms.coordinates=[this.position,u,d],A.uniforms.colors=this.colors,A.uniforms.screenShape=p;for(var y=0;y<3;++y)A.uniforms.lineWidth=this.lineWidth[y]*this.pixelRatio,this.enabled[y]&&(b.draw(g.TRIANGLES,6,6*y),this.drawSides[y]&&b.draw(g.TRIANGLES,12,18+12*y));b.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 b=[];function A(u,d,y,R,L,z){var N=[u,d,y,0,0,0,1];N[R+3]=1,N[R]=L,b.push.apply(b,N),N[6]=-1,b.push.apply(b,N),N[R]=z,b.push.apply(b,N),b.push.apply(b,N),N[6]=1,b.push.apply(b,N),N[R]=L,b.push.apply(b,N)}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 E=o(l,b),_=n(l,[{type:l.FLOAT,buffer:E,size:3,offset:0,stride:28},{type:l.FLOAT,buffer:E,size:3,offset:12,stride:28},{type:l.FLOAT,buffer:E,size:1,offset:24,stride:28}]),w=i(l);w.attributes.position.location=0,w.attributes.color.location=1,w.attributes.weight.location=2;var m=new s(l,E,_,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]+v*n[l]+p*i[l]+T*a[l];return f}return c*o+v*n+p*i[l]+T*a}function r(o,n,i,a,s,f){var c=s-1,v=s*s,p=c*c,T=(1+2*s)*p,l=s*p,g=v*(3-2*s),b=v*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]+b*a[A];return f}return T*o+l*n+g*i+b*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(Ie,Pe){if(!(Ie instanceof Pe))throw new TypeError("Cannot call a class as a function")}function n(Ie,Pe){for(var Be=0;Bew)throw new RangeError('The value "'+Ie+'" is invalid for option "size"');var Pe=new Uint8Array(Ie);return Object.setPrototypeOf(Pe,d.prototype),Pe}function d(Ie,Pe,Be){if(typeof Ie=="number"){if(typeof Pe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z(Ie)}return y(Ie,Pe,Be)}d.poolSize=8192;function y(Ie,Pe,Be){if(typeof Ie=="string")return N(Ie,Pe);if(ArrayBuffer.isView(Ie))return B(Ie);if(Ie==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+b(Ie));if(Xr(Ie,ArrayBuffer)||Ie&&Xr(Ie.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Xr(Ie,SharedArrayBuffer)||Ie&&Xr(Ie.buffer,SharedArrayBuffer)))return D(Ie,Pe,Be);if(typeof Ie=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var at=Ie.valueOf&&Ie.valueOf();if(at!=null&&at!==Ie)return d.from(at,Pe,Be);var ft=j(Ie);if(ft)return ft;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Ie[Symbol.toPrimitive]=="function")return d.from(Ie[Symbol.toPrimitive]("string"),Pe,Be);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+b(Ie))}d.from=function(Ie,Pe,Be){return y(Ie,Pe,Be)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function R(Ie){if(typeof Ie!="number")throw new TypeError('"size" argument must be of type number');if(Ie<0)throw new RangeError('The value "'+Ie+'" is invalid for option "size"')}function L(Ie,Pe,Be){return R(Ie),Ie<=0?u(Ie):Pe!==void 0?typeof Be=="string"?u(Ie).fill(Pe,Be):u(Ie).fill(Pe):u(Ie)}d.alloc=function(Ie,Pe,Be){return L(Ie,Pe,Be)};function z(Ie){return R(Ie),u(Ie<0?0:q(Ie)|0)}d.allocUnsafe=function(Ie){return z(Ie)},d.allocUnsafeSlow=function(Ie){return z(Ie)};function N(Ie,Pe){if((typeof Pe!="string"||Pe==="")&&(Pe="utf8"),!d.isEncoding(Pe))throw new TypeError("Unknown encoding: "+Pe);var Be=J(Ie,Pe)|0,at=u(Be),ft=at.write(Ie,Pe);return ft!==Be&&(at=at.slice(0,ft)),at}function U(Ie){for(var Pe=Ie.length<0?0:q(Ie.length)|0,Be=u(Pe),at=0;at=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return Ie|0}d.isBuffer=function(Pe){return Pe!=null&&Pe._isBuffer===!0&&Pe!==d.prototype},d.compare=function(Pe,Be){if(Xr(Pe,Uint8Array)&&(Pe=d.from(Pe,Pe.offset,Pe.byteLength)),Xr(Be,Uint8Array)&&(Be=d.from(Be,Be.offset,Be.byteLength)),!d.isBuffer(Pe)||!d.isBuffer(Be))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Pe===Be)return 0;for(var at=Pe.length,ft=Be.length,Bt=0,Nt=Math.min(at,ft);Btft.length?(d.isBuffer(Nt)||(Nt=d.from(Nt)),Nt.copy(ft,Bt)):Uint8Array.prototype.set.call(ft,Nt,Bt);else if(d.isBuffer(Nt))Nt.copy(ft,Bt);else throw new TypeError('"list" argument must be an Array of Buffers');Bt+=Nt.length}return ft};function J(Ie,Pe){if(d.isBuffer(Ie))return Ie.length;if(ArrayBuffer.isView(Ie)||Xr(Ie,ArrayBuffer))return Ie.byteLength;if(typeof Ie!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+b(Ie));var Be=Ie.length,at=arguments.length>2&&arguments[2]===!0;if(!at&&Be===0)return 0;for(var ft=!1;;)switch(Pe){case"ascii":case"latin1":case"binary":return Be;case"utf8":case"utf-8":return dr(Ie).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Be*2;case"hex":return Be>>>1;case"base64":return ln(Ie).length;default:if(ft)return at?-1:dr(Ie).length;Pe=(""+Pe).toLowerCase(),ft=!0}}d.byteLength=J;function oe(Ie,Pe,Be){var at=!1;if((Pe===void 0||Pe<0)&&(Pe=0),Pe>this.length||((Be===void 0||Be>this.length)&&(Be=this.length),Be<=0)||(Be>>>=0,Pe>>>=0,Be<=Pe))return"";for(Ie||(Ie="utf8");;)switch(Ie){case"hex":return Ve(this,Pe,Be);case"utf8":case"utf-8":return Y(this,Pe,Be);case"ascii":return Te(this,Pe,Be);case"latin1":case"binary":return Fe(this,Pe,Be);case"base64":return ie(this,Pe,Be);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xe(this,Pe,Be);default:if(at)throw new TypeError("Unknown encoding: "+Ie);Ie=(Ie+"").toLowerCase(),at=!0}}d.prototype._isBuffer=!0;function ye(Ie,Pe,Be){var at=Ie[Pe];Ie[Pe]=Ie[Be],Ie[Be]=at}d.prototype.swap16=function(){var Pe=this.length;if(Pe%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var Be=0;BeBe&&(Pe+=" ... "),""},_&&(d.prototype[_]=d.prototype.inspect),d.prototype.compare=function(Pe,Be,at,ft,Bt){if(Xr(Pe,Uint8Array)&&(Pe=d.from(Pe,Pe.offset,Pe.byteLength)),!d.isBuffer(Pe))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+b(Pe));if(Be===void 0&&(Be=0),at===void 0&&(at=Pe?Pe.length:0),ft===void 0&&(ft=0),Bt===void 0&&(Bt=this.length),Be<0||at>Pe.length||ft<0||Bt>this.length)throw new RangeError("out of range index");if(ft>=Bt&&Be>=at)return 0;if(ft>=Bt)return-1;if(Be>=at)return 1;if(Be>>>=0,at>>>=0,ft>>>=0,Bt>>>=0,this===Pe)return 0;for(var Nt=Bt-ft,Ht=at-Be,or=Math.min(Nt,Ht),Cr=this.slice(ft,Bt),Sr=Pe.slice(Be,at),Tr=0;Tr2147483647?Be=2147483647:Be<-2147483648&&(Be=-2147483648),Be=+Be,Ot(Be)&&(Be=ft?0:Ie.length-1),Be<0&&(Be=Ie.length+Be),Be>=Ie.length){if(ft)return-1;Be=Ie.length-1}else if(Be<0)if(ft)Be=0;else return-1;if(typeof Pe=="string"&&(Pe=d.from(Pe,at)),d.isBuffer(Pe))return Pe.length===0?-1:ge(Ie,Pe,Be,at,ft);if(typeof Pe=="number")return Pe=Pe&255,typeof Uint8Array.prototype.indexOf=="function"?ft?Uint8Array.prototype.indexOf.call(Ie,Pe,Be):Uint8Array.prototype.lastIndexOf.call(Ie,Pe,Be):ge(Ie,[Pe],Be,at,ft);throw new TypeError("val must be string, number or Buffer")}function ge(Ie,Pe,Be,at,ft){var Bt=1,Nt=Ie.length,Ht=Pe.length;if(at!==void 0&&(at=String(at).toLowerCase(),at==="ucs2"||at==="ucs-2"||at==="utf16le"||at==="utf-16le")){if(Ie.length<2||Pe.length<2)return-1;Bt=2,Nt/=2,Ht/=2,Be/=2}function or(Fn,ua){return Bt===1?Fn[ua]:Fn.readUInt16BE(ua*Bt)}var Cr;if(ft){var Sr=-1;for(Cr=Be;CrNt&&(Be=Nt-Ht),Cr=Be;Cr>=0;Cr--){for(var Tr=!0,Yr=0;Yrft&&(at=ft)):at=ft;var Bt=Pe.length;at>Bt/2&&(at=Bt/2);var Nt;for(Nt=0;Nt>>0,isFinite(at)?(at=at>>>0,ft===void 0&&(ft="utf8")):(ft=at,at=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Bt=this.length-Be;if((at===void 0||at>Bt)&&(at=Bt),Pe.length>0&&(at<0||Be<0)||Be>this.length)throw new RangeError("Attempt to write outside buffer bounds");ft||(ft="utf8");for(var Nt=!1;;)switch(ft){case"hex":return W(this,Pe,Be,at);case"utf8":case"utf-8":return ae(this,Pe,Be,at);case"ascii":case"latin1":case"binary":return se(this,Pe,Be,at);case"base64":return Q(this,Pe,Be,at);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return me(this,Pe,Be,at);default:if(Nt)throw new TypeError("Unknown encoding: "+ft);ft=(""+ft).toLowerCase(),Nt=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(Ie,Pe,Be){return Pe===0&&Be===Ie.length?A.fromByteArray(Ie):A.fromByteArray(Ie.slice(Pe,Be))}function Y(Ie,Pe,Be){Be=Math.min(Ie.length,Be);for(var at=[],ft=Pe;ft239?4:Bt>223?3:Bt>191?2:1;if(ft+Ht<=Be){var or=void 0,Cr=void 0,Sr=void 0,Tr=void 0;switch(Ht){case 1:Bt<128&&(Nt=Bt);break;case 2:or=Ie[ft+1],(or&192)===128&&(Tr=(Bt&31)<<6|or&63,Tr>127&&(Nt=Tr));break;case 3:or=Ie[ft+1],Cr=Ie[ft+2],(or&192)===128&&(Cr&192)===128&&(Tr=(Bt&15)<<12|(or&63)<<6|Cr&63,Tr>2047&&(Tr<55296||Tr>57343)&&(Nt=Tr));break;case 4:or=Ie[ft+1],Cr=Ie[ft+2],Sr=Ie[ft+3],(or&192)===128&&(Cr&192)===128&&(Sr&192)===128&&(Tr=(Bt&15)<<18|(or&63)<<12|(Cr&63)<<6|Sr&63,Tr>65535&&Tr<1114112&&(Nt=Tr))}}Nt===null?(Nt=65533,Ht=1):Nt>65535&&(Nt-=65536,at.push(Nt>>>10&1023|55296),Nt=56320|Nt&1023),at.push(Nt),ft+=Ht}return ue(at)}var le=4096;function ue(Ie){var Pe=Ie.length;if(Pe<=le)return String.fromCharCode.apply(String,Ie);for(var Be="",at=0;atat)&&(Be=at);for(var ft="",Bt=Pe;Btat&&(Pe=at),Be<0?(Be+=at,Be<0&&(Be=0)):Be>at&&(Be=at),BeBe)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(Pe,Be,at){Pe=Pe>>>0,Be=Be>>>0,at||We(Pe,Be,this.length);for(var ft=this[Pe],Bt=1,Nt=0;++Nt>>0,Be=Be>>>0,at||We(Pe,Be,this.length);for(var ft=this[Pe+--Be],Bt=1;Be>0&&(Bt*=256);)ft+=this[Pe+--Be]*Bt;return ft},d.prototype.readUint8=d.prototype.readUInt8=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,1,this.length),this[Pe]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,2,this.length),this[Pe]|this[Pe+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,2,this.length),this[Pe]<<8|this[Pe+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,4,this.length),(this[Pe]|this[Pe+1]<<8|this[Pe+2]<<16)+this[Pe+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,4,this.length),this[Pe]*16777216+(this[Pe+1]<<16|this[Pe+2]<<8|this[Pe+3])},d.prototype.readBigUInt64LE=ct(function(Pe){Pe=Pe>>>0,vt(Pe,"offset");var Be=this[Pe],at=this[Pe+7];(Be===void 0||at===void 0)&&$t(Pe,this.length-8);var ft=Be+this[++Pe]*Math.pow(2,8)+this[++Pe]*Math.pow(2,16)+this[++Pe]*Math.pow(2,24),Bt=this[++Pe]+this[++Pe]*Math.pow(2,8)+this[++Pe]*Math.pow(2,16)+at*Math.pow(2,24);return BigInt(ft)+(BigInt(Bt)<>>0,vt(Pe,"offset");var Be=this[Pe],at=this[Pe+7];(Be===void 0||at===void 0)&&$t(Pe,this.length-8);var ft=Be*Math.pow(2,24)+this[++Pe]*Math.pow(2,16)+this[++Pe]*Math.pow(2,8)+this[++Pe],Bt=this[++Pe]*Math.pow(2,24)+this[++Pe]*Math.pow(2,16)+this[++Pe]*Math.pow(2,8)+at;return(BigInt(ft)<>>0,Be=Be>>>0,at||We(Pe,Be,this.length);for(var ft=this[Pe],Bt=1,Nt=0;++Nt=Bt&&(ft-=Math.pow(2,8*Be)),ft},d.prototype.readIntBE=function(Pe,Be,at){Pe=Pe>>>0,Be=Be>>>0,at||We(Pe,Be,this.length);for(var ft=Be,Bt=1,Nt=this[Pe+--ft];ft>0&&(Bt*=256);)Nt+=this[Pe+--ft]*Bt;return Bt*=128,Nt>=Bt&&(Nt-=Math.pow(2,8*Be)),Nt},d.prototype.readInt8=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,1,this.length),this[Pe]&128?(255-this[Pe]+1)*-1:this[Pe]},d.prototype.readInt16LE=function(Pe,Be){Pe=Pe>>>0,Be||We(Pe,2,this.length);var at=this[Pe]|this[Pe+1]<<8;return at&32768?at|4294901760:at},d.prototype.readInt16BE=function(Pe,Be){Pe=Pe>>>0,Be||We(Pe,2,this.length);var at=this[Pe+1]|this[Pe]<<8;return at&32768?at|4294901760:at},d.prototype.readInt32LE=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,4,this.length),this[Pe]|this[Pe+1]<<8|this[Pe+2]<<16|this[Pe+3]<<24},d.prototype.readInt32BE=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,4,this.length),this[Pe]<<24|this[Pe+1]<<16|this[Pe+2]<<8|this[Pe+3]},d.prototype.readBigInt64LE=ct(function(Pe){Pe=Pe>>>0,vt(Pe,"offset");var Be=this[Pe],at=this[Pe+7];(Be===void 0||at===void 0)&&$t(Pe,this.length-8);var ft=this[Pe+4]+this[Pe+5]*Math.pow(2,8)+this[Pe+6]*Math.pow(2,16)+(at<<24);return(BigInt(ft)<>>0,vt(Pe,"offset");var Be=this[Pe],at=this[Pe+7];(Be===void 0||at===void 0)&&$t(Pe,this.length-8);var ft=(Be<<24)+this[++Pe]*Math.pow(2,16)+this[++Pe]*Math.pow(2,8)+this[++Pe];return(BigInt(ft)<>>0,Be||We(Pe,4,this.length),E.read(this,Pe,!0,23,4)},d.prototype.readFloatBE=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,4,this.length),E.read(this,Pe,!1,23,4)},d.prototype.readDoubleLE=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,8,this.length),E.read(this,Pe,!0,52,8)},d.prototype.readDoubleBE=function(Pe,Be){return Pe=Pe>>>0,Be||We(Pe,8,this.length),E.read(this,Pe,!1,52,8)};function it(Ie,Pe,Be,at,ft,Bt){if(!d.isBuffer(Ie))throw new TypeError('"buffer" argument must be a Buffer instance');if(Pe>ft||PeIe.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(Pe,Be,at,ft){if(Pe=+Pe,Be=Be>>>0,at=at>>>0,!ft){var Bt=Math.pow(2,8*at)-1;it(this,Pe,Be,at,Bt,0)}var Nt=1,Ht=0;for(this[Be]=Pe&255;++Ht>>0,at=at>>>0,!ft){var Bt=Math.pow(2,8*at)-1;it(this,Pe,Be,at,Bt,0)}var Nt=at-1,Ht=1;for(this[Be+Nt]=Pe&255;--Nt>=0&&(Ht*=256);)this[Be+Nt]=Pe/Ht&255;return Be+at},d.prototype.writeUint8=d.prototype.writeUInt8=function(Pe,Be,at){return Pe=+Pe,Be=Be>>>0,at||it(this,Pe,Be,1,255,0),this[Be]=Pe&255,Be+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(Pe,Be,at){return Pe=+Pe,Be=Be>>>0,at||it(this,Pe,Be,2,65535,0),this[Be]=Pe&255,this[Be+1]=Pe>>>8,Be+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(Pe,Be,at){return Pe=+Pe,Be=Be>>>0,at||it(this,Pe,Be,2,65535,0),this[Be]=Pe>>>8,this[Be+1]=Pe&255,Be+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(Pe,Be,at){return Pe=+Pe,Be=Be>>>0,at||it(this,Pe,Be,4,4294967295,0),this[Be+3]=Pe>>>24,this[Be+2]=Pe>>>16,this[Be+1]=Pe>>>8,this[Be]=Pe&255,Be+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(Pe,Be,at){return Pe=+Pe,Be=Be>>>0,at||it(this,Pe,Be,4,4294967295,0),this[Be]=Pe>>>24,this[Be+1]=Pe>>>16,this[Be+2]=Pe>>>8,this[Be+3]=Pe&255,Be+4};function yt(Ie,Pe,Be,at,ft){wt(Pe,at,ft,Ie,Be,7);var Bt=Number(Pe&BigInt(4294967295));Ie[Be++]=Bt,Bt=Bt>>8,Ie[Be++]=Bt,Bt=Bt>>8,Ie[Be++]=Bt,Bt=Bt>>8,Ie[Be++]=Bt;var Nt=Number(Pe>>BigInt(32)&BigInt(4294967295));return Ie[Be++]=Nt,Nt=Nt>>8,Ie[Be++]=Nt,Nt=Nt>>8,Ie[Be++]=Nt,Nt=Nt>>8,Ie[Be++]=Nt,Be}function bt(Ie,Pe,Be,at,ft){wt(Pe,at,ft,Ie,Be,7);var Bt=Number(Pe&BigInt(4294967295));Ie[Be+7]=Bt,Bt=Bt>>8,Ie[Be+6]=Bt,Bt=Bt>>8,Ie[Be+5]=Bt,Bt=Bt>>8,Ie[Be+4]=Bt;var Nt=Number(Pe>>BigInt(32)&BigInt(4294967295));return Ie[Be+3]=Nt,Nt=Nt>>8,Ie[Be+2]=Nt,Nt=Nt>>8,Ie[Be+1]=Nt,Nt=Nt>>8,Ie[Be]=Nt,Be+8}d.prototype.writeBigUInt64LE=ct(function(Pe){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return yt(this,Pe,Be,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=ct(function(Pe){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return bt(this,Pe,Be,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(Pe,Be,at,ft){if(Pe=+Pe,Be=Be>>>0,!ft){var Bt=Math.pow(2,8*at-1);it(this,Pe,Be,at,Bt-1,-Bt)}var Nt=0,Ht=1,or=0;for(this[Be]=Pe&255;++Nt>0)-or&255;return Be+at},d.prototype.writeIntBE=function(Pe,Be,at,ft){if(Pe=+Pe,Be=Be>>>0,!ft){var Bt=Math.pow(2,8*at-1);it(this,Pe,Be,at,Bt-1,-Bt)}var Nt=at-1,Ht=1,or=0;for(this[Be+Nt]=Pe&255;--Nt>=0&&(Ht*=256);)Pe<0&&or===0&&this[Be+Nt+1]!==0&&(or=1),this[Be+Nt]=(Pe/Ht>>0)-or&255;return Be+at},d.prototype.writeInt8=function(Pe,Be,at){return Pe=+Pe,Be=Be>>>0,at||it(this,Pe,Be,1,127,-128),Pe<0&&(Pe=255+Pe+1),this[Be]=Pe&255,Be+1},d.prototype.writeInt16LE=function(Pe,Be,at){return Pe=+Pe,Be=Be>>>0,at||it(this,Pe,Be,2,32767,-32768),this[Be]=Pe&255,this[Be+1]=Pe>>>8,Be+2},d.prototype.writeInt16BE=function(Pe,Be,at){return Pe=+Pe,Be=Be>>>0,at||it(this,Pe,Be,2,32767,-32768),this[Be]=Pe>>>8,this[Be+1]=Pe&255,Be+2},d.prototype.writeInt32LE=function(Pe,Be,at){return Pe=+Pe,Be=Be>>>0,at||it(this,Pe,Be,4,2147483647,-2147483648),this[Be]=Pe&255,this[Be+1]=Pe>>>8,this[Be+2]=Pe>>>16,this[Be+3]=Pe>>>24,Be+4},d.prototype.writeInt32BE=function(Pe,Be,at){return Pe=+Pe,Be=Be>>>0,at||it(this,Pe,Be,4,2147483647,-2147483648),Pe<0&&(Pe=4294967295+Pe+1),this[Be]=Pe>>>24,this[Be+1]=Pe>>>16,this[Be+2]=Pe>>>8,this[Be+3]=Pe&255,Be+4},d.prototype.writeBigInt64LE=ct(function(Pe){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return yt(this,Pe,Be,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=ct(function(Pe){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return bt(this,Pe,Be,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function mt(Ie,Pe,Be,at,ft,Bt){if(Be+at>Ie.length)throw new RangeError("Index out of range");if(Be<0)throw new RangeError("Index out of range")}function ht(Ie,Pe,Be,at,ft){return Pe=+Pe,Be=Be>>>0,ft||mt(Ie,Pe,Be,4),E.write(Ie,Pe,Be,at,23,4),Be+4}d.prototype.writeFloatLE=function(Pe,Be,at){return ht(this,Pe,Be,!0,at)},d.prototype.writeFloatBE=function(Pe,Be,at){return ht(this,Pe,Be,!1,at)};function qe(Ie,Pe,Be,at,ft){return Pe=+Pe,Be=Be>>>0,ft||mt(Ie,Pe,Be,8),E.write(Ie,Pe,Be,at,52,8),Be+8}d.prototype.writeDoubleLE=function(Pe,Be,at){return qe(this,Pe,Be,!0,at)},d.prototype.writeDoubleBE=function(Pe,Be,at){return qe(this,Pe,Be,!1,at)},d.prototype.copy=function(Pe,Be,at,ft){if(!d.isBuffer(Pe))throw new TypeError("argument should be a Buffer");if(at||(at=0),!ft&&ft!==0&&(ft=this.length),Be>=Pe.length&&(Be=Pe.length),Be||(Be=0),ft>0&&ft=this.length)throw new RangeError("Index out of range");if(ft<0)throw new RangeError("sourceEnd out of bounds");ft>this.length&&(ft=this.length),Pe.length-Be>>0,at=at===void 0?this.length:at>>>0,Pe||(Pe=0);var Nt;if(typeof Pe=="number")for(Nt=Be;NtMath.pow(2,32)?ft=Ke(String(Be)):typeof Be=="bigint"&&(ft=String(Be),(Be>Math.pow(BigInt(2),BigInt(32))||Be<-Math.pow(BigInt(2),BigInt(32)))&&(ft=Ke(ft)),ft+="n"),at+=" It must be ".concat(Pe,". Received ").concat(ft),at},RangeError);function Ke(Ie){for(var Pe="",Be=Ie.length,at=Ie[0]==="-"?1:0;Be>=at+4;Be-=3)Pe="_".concat(Ie.slice(Be-3,Be)).concat(Pe);return"".concat(Ie.slice(0,Be)).concat(Pe)}function _t(Ie,Pe,Be){vt(Pe,"offset"),(Ie[Pe]===void 0||Ie[Pe+Be]===void 0)&&$t(Pe,Ie.length-(Be+1))}function wt(Ie,Pe,Be,at,ft,Bt){if(Ie>Be||Ie= 0".concat(Nt," and < 2").concat(Nt," ** ").concat((Bt+1)*8).concat(Nt):Ht=">= -(2".concat(Nt," ** ").concat((Bt+1)*8-1).concat(Nt,") and < 2 ** ")+"".concat((Bt+1)*8-1).concat(Nt),new ze.ERR_OUT_OF_RANGE("value",Ht,Ie)}_t(at,ft,Bt)}function vt(Ie,Pe){if(typeof Ie!="number")throw new ze.ERR_INVALID_ARG_TYPE(Pe,"number",Ie)}function $t(Ie,Pe,Be){throw Math.floor(Ie)!==Ie?(vt(Ie,Be),new ze.ERR_OUT_OF_RANGE("offset","an integer",Ie)):Pe<0?new ze.ERR_BUFFER_OUT_OF_BOUNDS:new ze.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(Pe),Ie)}var Yt=/[^+/0-9A-Za-z-_]/g;function lr(Ie){if(Ie=Ie.split("=")[0],Ie=Ie.trim().replace(Yt,""),Ie.length<2)return"";for(;Ie.length%4!==0;)Ie=Ie+"=";return Ie}function dr(Ie,Pe){Pe=Pe||1/0;for(var Be,at=Ie.length,ft=null,Bt=[],Nt=0;Nt55295&&Be<57344){if(!ft){if(Be>56319){(Pe-=3)>-1&&Bt.push(239,191,189);continue}else if(Nt+1===at){(Pe-=3)>-1&&Bt.push(239,191,189);continue}ft=Be;continue}if(Be<56320){(Pe-=3)>-1&&Bt.push(239,191,189),ft=Be;continue}Be=(ft-55296<<10|Be-56320)+65536}else ft&&(Pe-=3)>-1&&Bt.push(239,191,189);if(ft=null,Be<128){if((Pe-=1)<0)break;Bt.push(Be)}else if(Be<2048){if((Pe-=2)<0)break;Bt.push(Be>>6|192,Be&63|128)}else if(Be<65536){if((Pe-=3)<0)break;Bt.push(Be>>12|224,Be>>6&63|128,Be&63|128)}else if(Be<1114112){if((Pe-=4)<0)break;Bt.push(Be>>18|240,Be>>12&63|128,Be>>6&63|128,Be&63|128)}else throw new Error("Invalid code point")}return Bt}function Nr(Ie){for(var Pe=[],Be=0;Be>8,ft=Be%256,Bt.push(ft),Bt.push(at);return Bt}function ln(Ie){return A.toByteArray(lr(Ie))}function zr(Ie,Pe,Be,at){var ft;for(ft=0;ft=Pe.length||ft>=Ie.length);++ft)Pe[ft+Be]=Ie[ft];return ft}function Xr(Ie,Pe){return Ie instanceof Pe||Ie!=null&&Ie.constructor!=null&&Ie.constructor.name!=null&&Ie.constructor.name===Pe.name}function Ot(Ie){return Ie!==Ie}var Qe=function(){for(var Ie="0123456789abcdef",Pe=new Array(256),Be=0;Be<16;++Be)for(var at=Be*16,ft=0;ft<16;++ft)Pe[at+ft]=Ie[Be]+Ie[ft];return Pe}();function ct(Ie){return typeof BigInt>"u"?Ue:Ie}function Ue(){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 v(b,A,E,_){this.gl=b,this.shader=A,this.buffer=E,this.vao=_,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var p=v.prototype,T=[0,0];p.bind=function(b,A,E,_){this.vao.bind(),this.shader.bind();var w=this.shader.uniforms;w.model=b,w.view=A,w.projection=E,w.pixelScale=_,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},p.unbind=function(){this.vao.unbind()},p.update=function(b,A,E,_,w){var m=[];function u(j,q,J,oe,ye,pe){var ge=[J.style,J.weight,J.variant,J.family].join("_"),W=f[ge];W||(W=f[ge]={});var ae=W[q];ae||(ae=W[q]=l(q,{triangles:!0,font:J.family,fontStyle:J.style,fontWeight:J.weight,fontVariant:J.variant,textAlign:"center",textBaseline:"middle",lineSpacing:ye,styletags:pe}));for(var se=(oe||12)/12,Q=ae.positions,me=ae.cells,ie=0,Y=me.length;ie=0;--ue){var Te=Q[le[ue]];m.push(se*Te[0],-se*Te[1],j)}}for(var d=[0,0,0],y=[0,0,0],R=[0,0,0],L=[0,0,0],z=1.25,N={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},U=0;U<3;++U){R[U]=m.length/c|0,u(.5*(b[0][U]+b[1][U]),A[U],E[U],12,z,N),L[U]=(m.length/c|0)-R[U],d[U]=m.length/c|0;for(var B=0;B<_[U].length;++B)if(_[U][B].text){var D={family:_[U][B].font||w[U].family,style:w[U].fontStyle||w[U].style,weight:w[U].fontWeight||w[U].weight,variant:w[U].fontVariant||w[U].variant};u(_[U][B].x,_[U][B].text,D,_[U][B].fontSize||12,z,N)}y[U]=(m.length/c|0)-d[U]}this.buffer.update(m),this.tickOffset=d,this.tickCount=y,this.labelOffset=R,this.labelCount=L},p.drawTicks=function(b,A,E,_,w,m,u,d){this.tickCount[b]&&(this.shader.uniforms.axis=m,this.shader.uniforms.color=w,this.shader.uniforms.angle=E,this.shader.uniforms.scale=A,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=d,this.vao.draw(this.gl.TRIANGLES,this.tickCount[b],this.tickOffset[b]))},p.drawLabel=function(b,A,E,_,w,m,u,d){this.labelCount[b]&&(this.shader.uniforms.axis=m,this.shader.uniforms.color=w,this.shader.uniforms.angle=E,this.shader.uniforms.scale=A,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=d,this.vao.draw(this.gl.TRIANGLES,this.labelCount[b],this.labelOffset[b]))},p.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(b,A){try{return i(b,A)}catch(E){return console.warn('error vectorizing text:"'+b+'" error:',E),{cells:[],positions:[]}}}function g(b,A,E,_,w,m){var u=o(b),d=n(b,[{buffer:u,size:3}]),y=a(b);y.attributes.position.location=0;var R=new v(b,y,u,d);return R.update(A,E,_,w,m),R}},5023:function(e,t,r){var o=r(2478);e.exports=c;function n(v,p,T,l,g,b,A){this.cells=v,this.neighbor=p,this.flags=l,this.constraint=T,this.active=g,this.next=b,this.boundary=A}var i=n.prototype;function a(v,p){return v[0]-p[0]||v[1]-p[1]||v[2]-p[2]}i.locate=function(){var v=[0,0,0];return function(p,T,l){var g=p,b=T,A=l;return T0||A.length>0;){for(;b.length>0;){var u=b.pop();if(E[u]!==-g){E[u]=g,_[u];for(var d=0;d<3;++d){var y=m[3*u+d];y>=0&&E[y]===0&&(w[3*u+d]?A.push(y):(b.push(y),E[y]=g))}}}var R=A;A=b,b=R,A.length=0,g=-g}var L=f(_,E,p);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(b){return function(A,E){var _=b[A];return _?!!_.queryPoint(E,s):!1}}function c(b){for(var A={},E=0;E0&&A[_]===E[0])w=b[_-1];else return 1;for(var m=1;w;){var u=w.key,d=o(E,u[0],u[1]);if(u[0][0]0)m=-1,w=w.right;else return 0;else if(d>0)w=w.left;else if(d<0)m=1,w=w.right;else return 0}return m}}function p(b){return 1}function T(b){return function(E){return b(E[0],E[1])?0:1}}function l(b,A){return function(_){return b(_[0],_[1])?0:A(_)}}function g(b){for(var A=b.length,E=[],_=[],w=0;w"u"?r(606):WeakMap,a=new i,s=0;function f(A,E,_,w,m,u,d){this.id=A,this.src=E,this.type=_,this.shader=w,this.count=u,this.programs=[],this.cache=d}f.prototype.dispose=function(){if(--this.count===0){for(var A=this.cache,E=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(v,p){var T=n(o(v,p),[p[p.length-1]]);return T[T.length-1]}function a(v,p,T,l){var g=l-p,b=-p/g;b<0?b=0:b>1&&(b=1);for(var A=1-b,E=v.length,_=new Array(E),w=0;w0||g>0&&_<0){var w=a(b,_,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(v,p){for(var T=[],l=i(v[v.length-1],p),g=v[v.length-1],b=v[0],A=0;A0||l>0&&E<0)&&T.push(a(g,E,b,l)),E>=0&&T.push(b.slice()),l=E}return T}function c(v,p){for(var T=[],l=i(v[v.length-1],p),g=v[v.length-1],b=v[0],A=0;A0||l>0&&E<0)&&T.push(a(g,E,b,l)),E<=0&&T.push(b.slice()),l=E}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,v=o-c,p=t*n,T=p-n,l=p-T,g=n-l,b=a-c*l,A=b-v*l,E=A-c*g,_=v*g-E;return i?(i[0]=_,i[1]=a,i):[_,a]}},5298:function(e,t){var r={"float64,2,1,0":function(){return function(v,p,T,l,g){var b=v[0],A=v[1],E=v[2],_=T[0],w=T[1],m=T[2];l|=0;var u=0,d=0,y=0,R=m,L=w-E*m,z=_-A*w;for(y=0;y0;){B<64?(_=B,B=0):(_=64,B-=64);for(var D=v[1]|0;D>0;){D<64?(w=D,D=0):(w=64,D-=64),l=N+B*u+D*d,A=U+B*R+D*L;var j=0,q=0,J=0,oe=y,ye=u-m*y,pe=d-_*u,ge=z,W=R-m*z,ae=L-_*R;for(J=0;J0;){L<64?(_=L,L=0):(_=64,L-=64);for(var z=v[0]|0;z>0;){z<64?(E=z,z=0):(E=64,z-=64),l=y+L*m+z*w,A=R+L*d+z*u;var N=0,U=0,B=m,D=w-_*m,j=d,q=u-_*d;for(U=0;U0;){U<64?(w=U,U=0):(w=64,U-=64);for(var B=v[0]|0;B>0;){B<64?(E=B,B=0):(E=64,B-=64);for(var D=v[1]|0;D>0;){D<64?(_=D,D=0):(_=64,D-=64),l=z+U*d+B*m+D*u,A=N+U*L+B*y+D*R;var j=0,q=0,J=0,oe=d,ye=m-w*d,pe=u-E*m,ge=L,W=y-w*L,ae=R-E*y;for(J=0;J<_;++J){for(q=0;q=0}}(),i.removeTriangle=function(f,c,v){var p=this.stars;a(p[f],c,v),a(p[c],v,f),a(p[v],f,c)},i.addTriangle=function(f,c,v){var p=this.stars;p[f].push(c,v),p[c].push(v,f),p[v].push(f,c)},i.opposite=function(f,c){for(var v=this.stars[c],p=1,T=v.length;p0;){var l=v.pop();f[l]=!1;for(var g=s[l],p=0;p0){for(var ge=0;ge<24;++ge)L.push(L[L.length-12]);B+=2,oe=!0}continue e}D[0][y]=Math.min(D[0][y],ye[y],pe[y]),D[1][y]=Math.max(D[1][y],ye[y],pe[y])}var W,ae;Array.isArray(q[0])?(W=q.length>d-1?q[d-1]:q.length>0?q[q.length-1]:[0,0,0,1],ae=q.length>d?q[d]:q.length>0?q[q.length-1]:[0,0,0,1]):W=ae=q,W.length===3&&(W=[W[0],W[1],W[2],1]),ae.length===3&&(ae=[ae[0],ae[1],ae[2],1]),!this.hasAlpha&&W[3]<1&&(this.hasAlpha=!0);var se;Array.isArray(J)?se=J.length>d-1?J[d-1]:J.length>0?J[J.length-1]:[0,0,0,1]:se=J;var Q=U;if(U+=b(ye,pe),oe){for(y=0;y<2;++y)L.push(ye[0],ye[1],ye[2],pe[0],pe[1],pe[2],Q,se,W[0],W[1],W[2],W[3]);B+=2,oe=!1}L.push(ye[0],ye[1],ye[2],pe[0],pe[1],pe[2],Q,se,W[0],W[1],W[2],W[3],ye[0],ye[1],ye[2],pe[0],pe[1],pe[2],Q,-se,W[0],W[1],W[2],W[3],pe[0],pe[1],pe[2],ye[0],ye[1],ye[2],U,-se,ae[0],ae[1],ae[2],ae[3],pe[0],pe[1],pe[2],ye[0],ye[1],ye[2],U,se,ae[0],ae[1],ae[2],ae[3]),B+=4}}if(this.buffer.update(L),z.push(U),N.push(j[j.length-1].slice()),this.bounds=D,this.vertexCount=B,this.points=N,this.arcLength=z,"dashes"in u){var me=u.dashes,ie=me.slice();for(ie.unshift(0),d=1;dr[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,v=0;v0){var l=s[c-1];if(o(p,l)===0&&i(l)!==T){c-=1;continue}}s[c++]=p}}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;Ke=qe.slice(0,1).join("")}return ie(Ke),oe+=Ke.length,D=D.slice(Ke.length),D.length}while(!0)}function yt(){return/[^a-fA-F0-9]/.test(U)?(ie(D.join("")),N=f,L):(D.push(U),B=U,L+1)}function bt(){return U==="."||/[eE]/.test(U)?(D.push(U),N=b,B=U,L+1):U==="x"&&D.length===1&&D[0]==="0"?(N=u,D.push(U),B=U,L+1):/[^\d]/.test(U)?(ie(D.join("")),N=f,L):(D.push(U),B=U,L+1)}function mt(){return U==="f"&&(D.push(U),B=U,L+=1),/[eE]/.test(U)||(U==="-"||U==="+")&&/[eE]/.test(B)?(D.push(U),B=U,L+1):/[^\d]/.test(U)?(ie(D.join("")),N=f,L):(D.push(U),B=U,L+1)}function ht(){if(/[^\d\w_]/.test(U)){var qe=D.join("");return me[qe]?N=_:Q[qe]?N=E:N=A,ie(D.join("")),N=f,L}return D.push(U),B=U,L+1}}},5878:function(e,t,r){e.exports=a;var o=r(3250),n=r(2014);function i(s,f,c){var v=Math.abs(o(s,f,c)),p=Math.sqrt(Math.pow(f[0]-c[0],2)+Math.pow(f[1]-c[1],2));return v/p}function a(s,f,c){for(var v=f.length,p=s.length,T=new Array(v),l=new Array(v),g=new Array(v),b=new Array(v),A=0;A>1:(ge>>1)-1}function R(ge){for(var W=d(ge);;){var ae=W,se=2*ge+1,Q=2*(ge+1),me=ge;if(se0;){var ae=y(ge);if(ae>=0){var se=d(ae);if(W0){var ge=B[0];return u(0,q-1),q-=1,R(0),ge}return-1}function N(ge,W){var ae=B[ge];return g[ae]===W?ge:(g[ae]=-1/0,L(ge),z(),g[ae]=W,q+=1,L(q-1))}function U(ge){if(!b[ge]){b[ge]=!0;var W=T[ge],ae=l[ge];T[ae]>=0&&(T[ae]=W),l[W]>=0&&(l[W]=ae),D[W]>=0&&N(D[W],m(W)),D[ae]>=0&&N(D[ae],m(ae))}}for(var B=[],D=new Array(v),A=0;A>1;A>=0;--A)R(A);for(;;){var J=z();if(J<0||g[J]>c)break;U(J)}for(var oe=[],A=0;A=0&&ae>=0&&W!==ae){var se=D[W],Q=D[ae];se!==Q&&pe.push([se,Q])}}),n.unique(n.normalize(pe)),{positions:oe,edges:pe}}},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],v=n[2];return r[0]=a*v-s*c,r[1]=s*f-i*v,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),v=0;v2&&d[1]>2&&w(u.pick(-1,-1).lo(1,1).hi(d[0]-2,d[1]-2),m.pick(-1,-1,0).lo(1,1).hi(d[0]-2,d[1]-2),m.pick(-1,-1,1).lo(1,1).hi(d[0]-2,d[1]-2)),d[1]>2&&(_(u.pick(0,-1).lo(1).hi(d[1]-2),m.pick(0,-1,1).lo(1).hi(d[1]-2)),E(m.pick(0,-1,0).lo(1).hi(d[1]-2))),d[1]>2&&(_(u.pick(d[0]-1,-1).lo(1).hi(d[1]-2),m.pick(d[0]-1,-1,1).lo(1).hi(d[1]-2)),E(m.pick(d[0]-1,-1,0).lo(1).hi(d[1]-2))),d[0]>2&&(_(u.pick(-1,0).lo(1).hi(d[0]-2),m.pick(-1,0,0).lo(1).hi(d[0]-2)),E(m.pick(-1,0,1).lo(1).hi(d[0]-2))),d[0]>2&&(_(u.pick(-1,d[1]-1).lo(1).hi(d[0]-2),m.pick(-1,d[1]-1,0).lo(1).hi(d[0]-2)),E(m.pick(-1,d[1]-1,1).lo(1).hi(d[0]-2))),m.set(0,0,0,0),m.set(0,0,1,0),m.set(d[0]-1,0,0,0),m.set(d[0]-1,0,1,0),m.set(0,d[1]-1,0,0),m.set(0,d[1]-1,1,0),m.set(d[0]-1,d[1]-1,0,0),m.set(d[0]-1,d[1]-1,1,0),m}}function b(A){var E=A.join(),d=v[E];if(d)return d;for(var _=A.length,w=[p,T],m=1;m<=_;++m)w.push(l(m));var u=g,d=u.apply(void 0,w);return v[E]=d,d}e.exports=function(E,_,w){if(Array.isArray(w)||(typeof w=="string"?w=o(_.dimension,w):w=o(_.dimension,"clamp")),_.size===0)return E;if(_.dimension===0)return E.set(0),E;var m=b(w);return m(E,_)}},6204:function(e){e.exports=t;function t(r){var o,n,i,a=r.length,s=0;for(o=0;ov&&(v=o.length(L)),y&&!d){var z=2*o.distance(E,R)/(o.length(_)+o.length(L));z?(m=Math.min(m,z),u=!1):u=!0}u||(E=R,_=L),w.push(L)}var N=[p,l,b],U=[T,g,A];a&&(a[0]=N,a[1]=U),v===0&&(v=1);var B=1/v;isFinite(m)||(m=1),c.vectorScale=m;var D=i.coneSize||(d?1:.5);i.absoluteConeSize&&(D=i.absoluteConeSize*B),c.coneScale=D;for(var y=0,j=0;yoe&&(U|=1<oe){U|=1<c[L][1])&&(me=L);for(var ie=-1,L=0;L<3;++L){var Y=me^1<c[le][0]&&(le=Y)}}var ue=b;ue[0]=ue[1]=ue[2]=0,ue[o.log2(ie^me)]=me&ie,ue[o.log2(me^le)]=me≤var Te=le^7;Te===U||Te===Q?(Te=ie^7,ue[o.log2(le^Te)]=Te&le):ue[o.log2(ie^Te)]=Te&ie;for(var Fe=A,Ve=U,j=0;j<3;++j)Ve&1<=0&&(c=s.length-f-1);var v=Math.pow(10,c),p=Math.round(i*a*v),T=p+"";if(T.indexOf("e")>=0)return T;var l=p/v,g=p%v;p<0?(l=-Math.ceil(l)|0,g=-g|0):(l=Math.floor(l)|0,g=g|0);var b=""+l;if(p<0&&(b="-"+b),c){for(var A=""+g;A.length=i[0][f];--v)c.push({x:v*a[f],text:r(a[f],v)});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;fE+1)throw new Error(b+" 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],v=g.map(function(R){return Math.round(R.index*E)}),_[0]=Math.min(Math.max(_[0],0),1),_[1]=Math.min(Math.max(_[1],0),1);var m=g.map(function(R,L){var z=g[L].index,N=g[L].rgb.slice();return N.length===4&&N[3]>=0&&N[3]<=1||(N[3]=_[0]+(_[1]-_[0])*z),N}),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,v=a+a,p=s+s,T=i*c,l=i*v,g=i*p,b=a*v,A=a*p,E=s*p,_=f*c,w=f*v,m=f*p;return r[0]=1-(b+E),r[1]=l+m,r[2]=g-w,r[3]=0,r[4]=l-m,r[5]=1-(T+E),r[6]=A+_,r[7]=0,r[8]=g+w,r[9]=A-_,r[10]=1-(T+b),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],v=o[5],p=o[6],T=o[7],l=o[8],g=o[9],b=o[10],A=o[11],E=o[12],_=o[13],w=o[14],m=o[15],u=n[0],d=n[1],y=n[2],R=n[3];return r[0]=u*i+d*c+y*l+R*E,r[1]=u*a+d*v+y*g+R*_,r[2]=u*s+d*p+y*b+R*w,r[3]=u*f+d*T+y*A+R*m,u=n[4],d=n[5],y=n[6],R=n[7],r[4]=u*i+d*c+y*l+R*E,r[5]=u*a+d*v+y*g+R*_,r[6]=u*s+d*p+y*b+R*w,r[7]=u*f+d*T+y*A+R*m,u=n[8],d=n[9],y=n[10],R=n[11],r[8]=u*i+d*c+y*l+R*E,r[9]=u*a+d*v+y*g+R*_,r[10]=u*s+d*p+y*b+R*w,r[11]=u*f+d*T+y*A+R*m,u=n[12],d=n[13],y=n[14],R=n[15],r[12]=u*i+d*c+y*l+R*E,r[13]=u*a+d*v+y*g+R*_,r[14]=u*s+d*p+y*b+R*w,r[15]=u*f+d*T+y*A+R*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],v=i[0]+i[1];if(l=c+n[2]-(v+i[2]),l)return l;var p=f(n[0],n[1]),T=f(i[0],i[1]),l=f(p,n[2])-f(T,i[2]);return l||f(p+n[2],c)-f(T+i[2],v);default:var g=n.slice(0);g.sort();var b=i.slice(0);b.sort();for(var A=0;A0?D:j},s.min=function(D,j){return D.cmp(j)<0?D:j},s.prototype._init=function(D,j,q){if(typeof D=="number")return this._initNumber(D,j,q);if(typeof D=="object")return this._initArray(D,j,q);j==="hex"&&(j=16),i(j===(j|0)&&j>=2&&j<=36),D=D.toString().replace(/\s+/g,"");var J=0;D[0]==="-"&&(J++,this.negative=1),J=0;J-=3)ye=D[J]|D[J-1]<<8|D[J-2]<<16,this.words[oe]|=ye<>>26-pe&67108863,pe+=24,pe>=26&&(pe-=26,oe++);else if(q==="le")for(J=0,oe=0;J>>26-pe&67108863,pe+=24,pe>=26&&(pe-=26,oe++);return this.strip()};function c(B,D){var j=B.charCodeAt(D);return j>=65&&j<=70?j-55:j>=97&&j<=102?j-87:j-48&15}function v(B,D,j){var q=c(B,j);return j-1>=D&&(q|=c(B,j-1)<<4),q}s.prototype._parseHex=function(D,j,q){this.length=Math.ceil((D.length-j)/6),this.words=new Array(this.length);for(var J=0;J=j;J-=2)pe=v(D,j,J)<=18?(oe-=18,ye+=1,this.words[ye]|=pe>>>26):oe+=8;else{var ge=D.length-j;for(J=ge%2===0?j+1:j;J=18?(oe-=18,ye+=1,this.words[ye]|=pe>>>26):oe+=8}this.strip()};function p(B,D,j,q){for(var J=0,oe=Math.min(B.length,j),ye=D;ye=49?J+=pe-49+10:pe>=17?J+=pe-17+10:J+=pe}return J}s.prototype._parseBase=function(D,j,q){this.words=[0],this.length=1;for(var J=0,oe=1;oe<=67108863;oe*=j)J++;J--,oe=oe/j|0;for(var ye=D.length-q,pe=ye%J,ge=Math.min(ye,ye-pe)+q,W=0,ae=q;ae1&&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(D,j){D=D||10,j=j|0||1;var q;if(D===16||D==="hex"){q="";for(var J=0,oe=0,ye=0;ye>>24-J&16777215,oe!==0||ye!==this.length-1?q=T[6-ge.length]+ge+q:q=ge+q,J+=2,J>=26&&(J-=26,ye--)}for(oe!==0&&(q=oe.toString(16)+q);q.length%j!==0;)q="0"+q;return this.negative!==0&&(q="-"+q),q}if(D===(D|0)&&D>=2&&D<=36){var W=l[D],ae=g[D];q="";var se=this.clone();for(se.negative=0;!se.isZero();){var Q=se.modn(ae).toString(D);se=se.idivn(ae),se.isZero()?q=Q+q:q=T[W-Q.length]+Q+q}for(this.isZero()&&(q="0"+q);q.length%j!==0;)q="0"+q;return this.negative!==0&&(q="-"+q),q}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var D=this.words[0];return this.length===2?D+=this.words[1]*67108864:this.length===3&&this.words[2]===1?D+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-D:D},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(D,j){return i(typeof f<"u"),this.toArrayLike(f,D,j)},s.prototype.toArray=function(D,j){return this.toArrayLike(Array,D,j)},s.prototype.toArrayLike=function(D,j,q){var J=this.byteLength(),oe=q||Math.max(1,J);i(J<=oe,"byte array longer than desired length"),i(oe>0,"Requested array length <= 0"),this.strip();var ye=j==="le",pe=new D(oe),ge,W,ae=this.clone();if(ye){for(W=0;!ae.isZero();W++)ge=ae.andln(255),ae.iushrn(8),pe[W]=ge;for(;W=4096&&(q+=13,j>>>=13),j>=64&&(q+=7,j>>>=7),j>=8&&(q+=4,j>>>=4),j>=2&&(q+=2,j>>>=2),q+j},s.prototype._zeroBits=function(D){if(D===0)return 26;var j=D,q=0;return j&8191||(q+=13,j>>>=13),j&127||(q+=7,j>>>=7),j&15||(q+=4,j>>>=4),j&3||(q+=2,j>>>=2),j&1||q++,q},s.prototype.bitLength=function(){var D=this.words[this.length-1],j=this._countBits(D);return(this.length-1)*26+j};function b(B){for(var D=new Array(B.bitLength()),j=0;j>>J}return D}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var D=0,j=0;jD.length?this.clone().ior(D):D.clone().ior(this)},s.prototype.uor=function(D){return this.length>D.length?this.clone().iuor(D):D.clone().iuor(this)},s.prototype.iuand=function(D){var j;this.length>D.length?j=D:j=this;for(var q=0;qD.length?this.clone().iand(D):D.clone().iand(this)},s.prototype.uand=function(D){return this.length>D.length?this.clone().iuand(D):D.clone().iuand(this)},s.prototype.iuxor=function(D){var j,q;this.length>D.length?(j=this,q=D):(j=D,q=this);for(var J=0;JD.length?this.clone().ixor(D):D.clone().ixor(this)},s.prototype.uxor=function(D){return this.length>D.length?this.clone().iuxor(D):D.clone().iuxor(this)},s.prototype.inotn=function(D){i(typeof D=="number"&&D>=0);var j=Math.ceil(D/26)|0,q=D%26;this._expand(j),q>0&&j--;for(var J=0;J0&&(this.words[J]=~this.words[J]&67108863>>26-q),this.strip()},s.prototype.notn=function(D){return this.clone().inotn(D)},s.prototype.setn=function(D,j){i(typeof D=="number"&&D>=0);var q=D/26|0,J=D%26;return this._expand(q+1),j?this.words[q]=this.words[q]|1<D.length?(q=this,J=D):(q=D,J=this);for(var oe=0,ye=0;ye>>26;for(;oe!==0&&ye>>26;if(this.length=q.length,oe!==0)this.words[this.length]=oe,this.length++;else if(q!==this)for(;yeD.length?this.clone().iadd(D):D.clone().iadd(this)},s.prototype.isub=function(D){if(D.negative!==0){D.negative=0;var j=this.iadd(D);return D.negative=1,j._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(D),this.negative=1,this._normSign();var q=this.cmp(D);if(q===0)return this.negative=0,this.length=1,this.words[0]=0,this;var J,oe;q>0?(J=this,oe=D):(J=D,oe=this);for(var ye=0,pe=0;pe>26,this.words[pe]=j&67108863;for(;ye!==0&&pe>26,this.words[pe]=j&67108863;if(ye===0&&pe>>26,se=ge&67108863,Q=Math.min(W,D.length-1),me=Math.max(0,W-B.length+1);me<=Q;me++){var ie=W-me|0;J=B.words[ie]|0,oe=D.words[me]|0,ye=J*oe+se,ae+=ye/67108864|0,se=ye&67108863}j.words[W]=se|0,ge=ae|0}return ge!==0?j.words[W]=ge|0:j.length--,j.strip()}var E=function(D,j,q){var J=D.words,oe=j.words,ye=q.words,pe=0,ge,W,ae,se=J[0]|0,Q=se&8191,me=se>>>13,ie=J[1]|0,Y=ie&8191,le=ie>>>13,ue=J[2]|0,Te=ue&8191,Fe=ue>>>13,Ve=J[3]|0,Xe=Ve&8191,We=Ve>>>13,it=J[4]|0,yt=it&8191,bt=it>>>13,mt=J[5]|0,ht=mt&8191,qe=mt>>>13,ze=J[6]|0,Ae=ze&8191,Ke=ze>>>13,_t=J[7]|0,wt=_t&8191,vt=_t>>>13,$t=J[8]|0,Yt=$t&8191,lr=$t>>>13,dr=J[9]|0,Nr=dr&8191,Fr=dr>>>13,ln=oe[0]|0,zr=ln&8191,Xr=ln>>>13,Ot=oe[1]|0,Qe=Ot&8191,ct=Ot>>>13,Ue=oe[2]|0,Ie=Ue&8191,Pe=Ue>>>13,Be=oe[3]|0,at=Be&8191,ft=Be>>>13,Bt=oe[4]|0,Nt=Bt&8191,Ht=Bt>>>13,or=oe[5]|0,Cr=or&8191,Sr=or>>>13,Tr=oe[6]|0,Yr=Tr&8191,Fn=Tr>>>13,ua=oe[7]|0,ta=ua&8191,va=ua>>>13,ma=oe[8]|0,Jn=ma&8191,ja=ma>>>13,ti=oe[9]|0,gr=ti&8191,Kt=ti>>>13;q.negative=D.negative^j.negative,q.length=19,ge=Math.imul(Q,zr),W=Math.imul(Q,Xr),W=W+Math.imul(me,zr)|0,ae=Math.imul(me,Xr);var vr=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(vr>>>26)|0,vr&=67108863,ge=Math.imul(Y,zr),W=Math.imul(Y,Xr),W=W+Math.imul(le,zr)|0,ae=Math.imul(le,Xr),ge=ge+Math.imul(Q,Qe)|0,W=W+Math.imul(Q,ct)|0,W=W+Math.imul(me,Qe)|0,ae=ae+Math.imul(me,ct)|0;var _r=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(_r>>>26)|0,_r&=67108863,ge=Math.imul(Te,zr),W=Math.imul(Te,Xr),W=W+Math.imul(Fe,zr)|0,ae=Math.imul(Fe,Xr),ge=ge+Math.imul(Y,Qe)|0,W=W+Math.imul(Y,ct)|0,W=W+Math.imul(le,Qe)|0,ae=ae+Math.imul(le,ct)|0,ge=ge+Math.imul(Q,Ie)|0,W=W+Math.imul(Q,Pe)|0,W=W+Math.imul(me,Ie)|0,ae=ae+Math.imul(me,Pe)|0;var rn=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(rn>>>26)|0,rn&=67108863,ge=Math.imul(Xe,zr),W=Math.imul(Xe,Xr),W=W+Math.imul(We,zr)|0,ae=Math.imul(We,Xr),ge=ge+Math.imul(Te,Qe)|0,W=W+Math.imul(Te,ct)|0,W=W+Math.imul(Fe,Qe)|0,ae=ae+Math.imul(Fe,ct)|0,ge=ge+Math.imul(Y,Ie)|0,W=W+Math.imul(Y,Pe)|0,W=W+Math.imul(le,Ie)|0,ae=ae+Math.imul(le,Pe)|0,ge=ge+Math.imul(Q,at)|0,W=W+Math.imul(Q,ft)|0,W=W+Math.imul(me,at)|0,ae=ae+Math.imul(me,ft)|0;var gn=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(gn>>>26)|0,gn&=67108863,ge=Math.imul(yt,zr),W=Math.imul(yt,Xr),W=W+Math.imul(bt,zr)|0,ae=Math.imul(bt,Xr),ge=ge+Math.imul(Xe,Qe)|0,W=W+Math.imul(Xe,ct)|0,W=W+Math.imul(We,Qe)|0,ae=ae+Math.imul(We,ct)|0,ge=ge+Math.imul(Te,Ie)|0,W=W+Math.imul(Te,Pe)|0,W=W+Math.imul(Fe,Ie)|0,ae=ae+Math.imul(Fe,Pe)|0,ge=ge+Math.imul(Y,at)|0,W=W+Math.imul(Y,ft)|0,W=W+Math.imul(le,at)|0,ae=ae+Math.imul(le,ft)|0,ge=ge+Math.imul(Q,Nt)|0,W=W+Math.imul(Q,Ht)|0,W=W+Math.imul(me,Nt)|0,ae=ae+Math.imul(me,Ht)|0;var Mn=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Mn>>>26)|0,Mn&=67108863,ge=Math.imul(ht,zr),W=Math.imul(ht,Xr),W=W+Math.imul(qe,zr)|0,ae=Math.imul(qe,Xr),ge=ge+Math.imul(yt,Qe)|0,W=W+Math.imul(yt,ct)|0,W=W+Math.imul(bt,Qe)|0,ae=ae+Math.imul(bt,ct)|0,ge=ge+Math.imul(Xe,Ie)|0,W=W+Math.imul(Xe,Pe)|0,W=W+Math.imul(We,Ie)|0,ae=ae+Math.imul(We,Pe)|0,ge=ge+Math.imul(Te,at)|0,W=W+Math.imul(Te,ft)|0,W=W+Math.imul(Fe,at)|0,ae=ae+Math.imul(Fe,ft)|0,ge=ge+Math.imul(Y,Nt)|0,W=W+Math.imul(Y,Ht)|0,W=W+Math.imul(le,Nt)|0,ae=ae+Math.imul(le,Ht)|0,ge=ge+Math.imul(Q,Cr)|0,W=W+Math.imul(Q,Sr)|0,W=W+Math.imul(me,Cr)|0,ae=ae+Math.imul(me,Sr)|0;var In=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(In>>>26)|0,In&=67108863,ge=Math.imul(Ae,zr),W=Math.imul(Ae,Xr),W=W+Math.imul(Ke,zr)|0,ae=Math.imul(Ke,Xr),ge=ge+Math.imul(ht,Qe)|0,W=W+Math.imul(ht,ct)|0,W=W+Math.imul(qe,Qe)|0,ae=ae+Math.imul(qe,ct)|0,ge=ge+Math.imul(yt,Ie)|0,W=W+Math.imul(yt,Pe)|0,W=W+Math.imul(bt,Ie)|0,ae=ae+Math.imul(bt,Pe)|0,ge=ge+Math.imul(Xe,at)|0,W=W+Math.imul(Xe,ft)|0,W=W+Math.imul(We,at)|0,ae=ae+Math.imul(We,ft)|0,ge=ge+Math.imul(Te,Nt)|0,W=W+Math.imul(Te,Ht)|0,W=W+Math.imul(Fe,Nt)|0,ae=ae+Math.imul(Fe,Ht)|0,ge=ge+Math.imul(Y,Cr)|0,W=W+Math.imul(Y,Sr)|0,W=W+Math.imul(le,Cr)|0,ae=ae+Math.imul(le,Sr)|0,ge=ge+Math.imul(Q,Yr)|0,W=W+Math.imul(Q,Fn)|0,W=W+Math.imul(me,Yr)|0,ae=ae+Math.imul(me,Fn)|0;var fa=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(fa>>>26)|0,fa&=67108863,ge=Math.imul(wt,zr),W=Math.imul(wt,Xr),W=W+Math.imul(vt,zr)|0,ae=Math.imul(vt,Xr),ge=ge+Math.imul(Ae,Qe)|0,W=W+Math.imul(Ae,ct)|0,W=W+Math.imul(Ke,Qe)|0,ae=ae+Math.imul(Ke,ct)|0,ge=ge+Math.imul(ht,Ie)|0,W=W+Math.imul(ht,Pe)|0,W=W+Math.imul(qe,Ie)|0,ae=ae+Math.imul(qe,Pe)|0,ge=ge+Math.imul(yt,at)|0,W=W+Math.imul(yt,ft)|0,W=W+Math.imul(bt,at)|0,ae=ae+Math.imul(bt,ft)|0,ge=ge+Math.imul(Xe,Nt)|0,W=W+Math.imul(Xe,Ht)|0,W=W+Math.imul(We,Nt)|0,ae=ae+Math.imul(We,Ht)|0,ge=ge+Math.imul(Te,Cr)|0,W=W+Math.imul(Te,Sr)|0,W=W+Math.imul(Fe,Cr)|0,ae=ae+Math.imul(Fe,Sr)|0,ge=ge+Math.imul(Y,Yr)|0,W=W+Math.imul(Y,Fn)|0,W=W+Math.imul(le,Yr)|0,ae=ae+Math.imul(le,Fn)|0,ge=ge+Math.imul(Q,ta)|0,W=W+Math.imul(Q,va)|0,W=W+Math.imul(me,ta)|0,ae=ae+Math.imul(me,va)|0;var Ca=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,ge=Math.imul(Yt,zr),W=Math.imul(Yt,Xr),W=W+Math.imul(lr,zr)|0,ae=Math.imul(lr,Xr),ge=ge+Math.imul(wt,Qe)|0,W=W+Math.imul(wt,ct)|0,W=W+Math.imul(vt,Qe)|0,ae=ae+Math.imul(vt,ct)|0,ge=ge+Math.imul(Ae,Ie)|0,W=W+Math.imul(Ae,Pe)|0,W=W+Math.imul(Ke,Ie)|0,ae=ae+Math.imul(Ke,Pe)|0,ge=ge+Math.imul(ht,at)|0,W=W+Math.imul(ht,ft)|0,W=W+Math.imul(qe,at)|0,ae=ae+Math.imul(qe,ft)|0,ge=ge+Math.imul(yt,Nt)|0,W=W+Math.imul(yt,Ht)|0,W=W+Math.imul(bt,Nt)|0,ae=ae+Math.imul(bt,Ht)|0,ge=ge+Math.imul(Xe,Cr)|0,W=W+Math.imul(Xe,Sr)|0,W=W+Math.imul(We,Cr)|0,ae=ae+Math.imul(We,Sr)|0,ge=ge+Math.imul(Te,Yr)|0,W=W+Math.imul(Te,Fn)|0,W=W+Math.imul(Fe,Yr)|0,ae=ae+Math.imul(Fe,Fn)|0,ge=ge+Math.imul(Y,ta)|0,W=W+Math.imul(Y,va)|0,W=W+Math.imul(le,ta)|0,ae=ae+Math.imul(le,va)|0,ge=ge+Math.imul(Q,Jn)|0,W=W+Math.imul(Q,ja)|0,W=W+Math.imul(me,Jn)|0,ae=ae+Math.imul(me,ja)|0;var Ma=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Ma>>>26)|0,Ma&=67108863,ge=Math.imul(Nr,zr),W=Math.imul(Nr,Xr),W=W+Math.imul(Fr,zr)|0,ae=Math.imul(Fr,Xr),ge=ge+Math.imul(Yt,Qe)|0,W=W+Math.imul(Yt,ct)|0,W=W+Math.imul(lr,Qe)|0,ae=ae+Math.imul(lr,ct)|0,ge=ge+Math.imul(wt,Ie)|0,W=W+Math.imul(wt,Pe)|0,W=W+Math.imul(vt,Ie)|0,ae=ae+Math.imul(vt,Pe)|0,ge=ge+Math.imul(Ae,at)|0,W=W+Math.imul(Ae,ft)|0,W=W+Math.imul(Ke,at)|0,ae=ae+Math.imul(Ke,ft)|0,ge=ge+Math.imul(ht,Nt)|0,W=W+Math.imul(ht,Ht)|0,W=W+Math.imul(qe,Nt)|0,ae=ae+Math.imul(qe,Ht)|0,ge=ge+Math.imul(yt,Cr)|0,W=W+Math.imul(yt,Sr)|0,W=W+Math.imul(bt,Cr)|0,ae=ae+Math.imul(bt,Sr)|0,ge=ge+Math.imul(Xe,Yr)|0,W=W+Math.imul(Xe,Fn)|0,W=W+Math.imul(We,Yr)|0,ae=ae+Math.imul(We,Fn)|0,ge=ge+Math.imul(Te,ta)|0,W=W+Math.imul(Te,va)|0,W=W+Math.imul(Fe,ta)|0,ae=ae+Math.imul(Fe,va)|0,ge=ge+Math.imul(Y,Jn)|0,W=W+Math.imul(Y,ja)|0,W=W+Math.imul(le,Jn)|0,ae=ae+Math.imul(le,ja)|0,ge=ge+Math.imul(Q,gr)|0,W=W+Math.imul(Q,Kt)|0,W=W+Math.imul(me,gr)|0,ae=ae+Math.imul(me,Kt)|0;var Da=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Da>>>26)|0,Da&=67108863,ge=Math.imul(Nr,Qe),W=Math.imul(Nr,ct),W=W+Math.imul(Fr,Qe)|0,ae=Math.imul(Fr,ct),ge=ge+Math.imul(Yt,Ie)|0,W=W+Math.imul(Yt,Pe)|0,W=W+Math.imul(lr,Ie)|0,ae=ae+Math.imul(lr,Pe)|0,ge=ge+Math.imul(wt,at)|0,W=W+Math.imul(wt,ft)|0,W=W+Math.imul(vt,at)|0,ae=ae+Math.imul(vt,ft)|0,ge=ge+Math.imul(Ae,Nt)|0,W=W+Math.imul(Ae,Ht)|0,W=W+Math.imul(Ke,Nt)|0,ae=ae+Math.imul(Ke,Ht)|0,ge=ge+Math.imul(ht,Cr)|0,W=W+Math.imul(ht,Sr)|0,W=W+Math.imul(qe,Cr)|0,ae=ae+Math.imul(qe,Sr)|0,ge=ge+Math.imul(yt,Yr)|0,W=W+Math.imul(yt,Fn)|0,W=W+Math.imul(bt,Yr)|0,ae=ae+Math.imul(bt,Fn)|0,ge=ge+Math.imul(Xe,ta)|0,W=W+Math.imul(Xe,va)|0,W=W+Math.imul(We,ta)|0,ae=ae+Math.imul(We,va)|0,ge=ge+Math.imul(Te,Jn)|0,W=W+Math.imul(Te,ja)|0,W=W+Math.imul(Fe,Jn)|0,ae=ae+Math.imul(Fe,ja)|0,ge=ge+Math.imul(Y,gr)|0,W=W+Math.imul(Y,Kt)|0,W=W+Math.imul(le,gr)|0,ae=ae+Math.imul(le,Kt)|0;var Va=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Va>>>26)|0,Va&=67108863,ge=Math.imul(Nr,Ie),W=Math.imul(Nr,Pe),W=W+Math.imul(Fr,Ie)|0,ae=Math.imul(Fr,Pe),ge=ge+Math.imul(Yt,at)|0,W=W+Math.imul(Yt,ft)|0,W=W+Math.imul(lr,at)|0,ae=ae+Math.imul(lr,ft)|0,ge=ge+Math.imul(wt,Nt)|0,W=W+Math.imul(wt,Ht)|0,W=W+Math.imul(vt,Nt)|0,ae=ae+Math.imul(vt,Ht)|0,ge=ge+Math.imul(Ae,Cr)|0,W=W+Math.imul(Ae,Sr)|0,W=W+Math.imul(Ke,Cr)|0,ae=ae+Math.imul(Ke,Sr)|0,ge=ge+Math.imul(ht,Yr)|0,W=W+Math.imul(ht,Fn)|0,W=W+Math.imul(qe,Yr)|0,ae=ae+Math.imul(qe,Fn)|0,ge=ge+Math.imul(yt,ta)|0,W=W+Math.imul(yt,va)|0,W=W+Math.imul(bt,ta)|0,ae=ae+Math.imul(bt,va)|0,ge=ge+Math.imul(Xe,Jn)|0,W=W+Math.imul(Xe,ja)|0,W=W+Math.imul(We,Jn)|0,ae=ae+Math.imul(We,ja)|0,ge=ge+Math.imul(Te,gr)|0,W=W+Math.imul(Te,Kt)|0,W=W+Math.imul(Fe,gr)|0,ae=ae+Math.imul(Fe,Kt)|0;var na=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(na>>>26)|0,na&=67108863,ge=Math.imul(Nr,at),W=Math.imul(Nr,ft),W=W+Math.imul(Fr,at)|0,ae=Math.imul(Fr,ft),ge=ge+Math.imul(Yt,Nt)|0,W=W+Math.imul(Yt,Ht)|0,W=W+Math.imul(lr,Nt)|0,ae=ae+Math.imul(lr,Ht)|0,ge=ge+Math.imul(wt,Cr)|0,W=W+Math.imul(wt,Sr)|0,W=W+Math.imul(vt,Cr)|0,ae=ae+Math.imul(vt,Sr)|0,ge=ge+Math.imul(Ae,Yr)|0,W=W+Math.imul(Ae,Fn)|0,W=W+Math.imul(Ke,Yr)|0,ae=ae+Math.imul(Ke,Fn)|0,ge=ge+Math.imul(ht,ta)|0,W=W+Math.imul(ht,va)|0,W=W+Math.imul(qe,ta)|0,ae=ae+Math.imul(qe,va)|0,ge=ge+Math.imul(yt,Jn)|0,W=W+Math.imul(yt,ja)|0,W=W+Math.imul(bt,Jn)|0,ae=ae+Math.imul(bt,ja)|0,ge=ge+Math.imul(Xe,gr)|0,W=W+Math.imul(Xe,Kt)|0,W=W+Math.imul(We,gr)|0,ae=ae+Math.imul(We,Kt)|0;var Mi=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,ge=Math.imul(Nr,Nt),W=Math.imul(Nr,Ht),W=W+Math.imul(Fr,Nt)|0,ae=Math.imul(Fr,Ht),ge=ge+Math.imul(Yt,Cr)|0,W=W+Math.imul(Yt,Sr)|0,W=W+Math.imul(lr,Cr)|0,ae=ae+Math.imul(lr,Sr)|0,ge=ge+Math.imul(wt,Yr)|0,W=W+Math.imul(wt,Fn)|0,W=W+Math.imul(vt,Yr)|0,ae=ae+Math.imul(vt,Fn)|0,ge=ge+Math.imul(Ae,ta)|0,W=W+Math.imul(Ae,va)|0,W=W+Math.imul(Ke,ta)|0,ae=ae+Math.imul(Ke,va)|0,ge=ge+Math.imul(ht,Jn)|0,W=W+Math.imul(ht,ja)|0,W=W+Math.imul(qe,Jn)|0,ae=ae+Math.imul(qe,ja)|0,ge=ge+Math.imul(yt,gr)|0,W=W+Math.imul(yt,Kt)|0,W=W+Math.imul(bt,gr)|0,ae=ae+Math.imul(bt,Kt)|0;var Oi=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,ge=Math.imul(Nr,Cr),W=Math.imul(Nr,Sr),W=W+Math.imul(Fr,Cr)|0,ae=Math.imul(Fr,Sr),ge=ge+Math.imul(Yt,Yr)|0,W=W+Math.imul(Yt,Fn)|0,W=W+Math.imul(lr,Yr)|0,ae=ae+Math.imul(lr,Fn)|0,ge=ge+Math.imul(wt,ta)|0,W=W+Math.imul(wt,va)|0,W=W+Math.imul(vt,ta)|0,ae=ae+Math.imul(vt,va)|0,ge=ge+Math.imul(Ae,Jn)|0,W=W+Math.imul(Ae,ja)|0,W=W+Math.imul(Ke,Jn)|0,ae=ae+Math.imul(Ke,ja)|0,ge=ge+Math.imul(ht,gr)|0,W=W+Math.imul(ht,Kt)|0,W=W+Math.imul(qe,gr)|0,ae=ae+Math.imul(qe,Kt)|0;var Vt=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,ge=Math.imul(Nr,Yr),W=Math.imul(Nr,Fn),W=W+Math.imul(Fr,Yr)|0,ae=Math.imul(Fr,Fn),ge=ge+Math.imul(Yt,ta)|0,W=W+Math.imul(Yt,va)|0,W=W+Math.imul(lr,ta)|0,ae=ae+Math.imul(lr,va)|0,ge=ge+Math.imul(wt,Jn)|0,W=W+Math.imul(wt,ja)|0,W=W+Math.imul(vt,Jn)|0,ae=ae+Math.imul(vt,ja)|0,ge=ge+Math.imul(Ae,gr)|0,W=W+Math.imul(Ae,Kt)|0,W=W+Math.imul(Ke,gr)|0,ae=ae+Math.imul(Ke,Kt)|0;var Ct=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,ge=Math.imul(Nr,ta),W=Math.imul(Nr,va),W=W+Math.imul(Fr,ta)|0,ae=Math.imul(Fr,va),ge=ge+Math.imul(Yt,Jn)|0,W=W+Math.imul(Yt,ja)|0,W=W+Math.imul(lr,Jn)|0,ae=ae+Math.imul(lr,ja)|0,ge=ge+Math.imul(wt,gr)|0,W=W+Math.imul(wt,Kt)|0,W=W+Math.imul(vt,gr)|0,ae=ae+Math.imul(vt,Kt)|0;var Br=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Br>>>26)|0,Br&=67108863,ge=Math.imul(Nr,Jn),W=Math.imul(Nr,ja),W=W+Math.imul(Fr,Jn)|0,ae=Math.imul(Fr,ja),ge=ge+Math.imul(Yt,gr)|0,W=W+Math.imul(Yt,Kt)|0,W=W+Math.imul(lr,gr)|0,ae=ae+Math.imul(lr,Kt)|0;var Kr=(pe+ge|0)+((W&8191)<<13)|0;pe=(ae+(W>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,ge=Math.imul(Nr,gr),W=Math.imul(Nr,Kt),W=W+Math.imul(Fr,gr)|0,ae=Math.imul(Fr,Kt);var Qr=(pe+ge|0)+((W&8191)<<13)|0;return pe=(ae+(W>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,ye[0]=vr,ye[1]=_r,ye[2]=rn,ye[3]=gn,ye[4]=Mn,ye[5]=In,ye[6]=fa,ye[7]=Ca,ye[8]=Ma,ye[9]=Da,ye[10]=Va,ye[11]=na,ye[12]=Mi,ye[13]=Oi,ye[14]=Vt,ye[15]=Ct,ye[16]=Br,ye[17]=Kr,ye[18]=Qr,pe!==0&&(ye[19]=pe,q.length++),q};Math.imul||(E=A);function _(B,D,j){j.negative=D.negative^B.negative,j.length=B.length+D.length;for(var q=0,J=0,oe=0;oe>>26)|0,J+=ye>>>26,ye&=67108863}j.words[oe]=pe,q=ye,ye=J}return q!==0?j.words[oe]=q:j.length--,j.strip()}function w(B,D,j){var q=new m;return q.mulp(B,D,j)}s.prototype.mulTo=function(D,j){var q,J=this.length+D.length;return this.length===10&&D.length===10?q=E(this,D,j):J<63?q=A(this,D,j):J<1024?q=_(this,D,j):q=w(this,D,j),q};function m(B,D){this.x=B,this.y=D}m.prototype.makeRBT=function(D){for(var j=new Array(D),q=s.prototype._countBits(D)-1,J=0;J>=1;return J},m.prototype.permute=function(D,j,q,J,oe,ye){for(var pe=0;pe>>1)oe++;return 1<>>13,q[2*ye+1]=oe&8191,oe=oe>>>13;for(ye=2*j;ye>=26,j+=J/67108864|0,j+=oe>>>26,this.words[q]=oe&67108863}return j!==0&&(this.words[q]=j,this.length++),this},s.prototype.muln=function(D){return this.clone().imuln(D)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(D){var j=b(D);if(j.length===0)return new s(1);for(var q=this,J=0;J=0);var j=D%26,q=(D-j)/26,J=67108863>>>26-j<<26-j,oe;if(j!==0){var ye=0;for(oe=0;oe>>26-j}ye&&(this.words[oe]=ye,this.length++)}if(q!==0){for(oe=this.length-1;oe>=0;oe--)this.words[oe+q]=this.words[oe];for(oe=0;oe=0);var J;j?J=(j-j%26)/26:J=0;var oe=D%26,ye=Math.min((D-oe)/26,this.length),pe=67108863^67108863>>>oe<ye)for(this.length-=ye,W=0;W=0&&(ae!==0||W>=J);W--){var se=this.words[W]|0;this.words[W]=ae<<26-oe|se>>>oe,ae=se&pe}return ge&&ae!==0&&(ge.words[ge.length++]=ae),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(D,j,q){return i(this.negative===0),this.iushrn(D,j,q)},s.prototype.shln=function(D){return this.clone().ishln(D)},s.prototype.ushln=function(D){return this.clone().iushln(D)},s.prototype.shrn=function(D){return this.clone().ishrn(D)},s.prototype.ushrn=function(D){return this.clone().iushrn(D)},s.prototype.testn=function(D){i(typeof D=="number"&&D>=0);var j=D%26,q=(D-j)/26,J=1<=0);var j=D%26,q=(D-j)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=q)return this;if(j!==0&&q++,this.length=Math.min(q,this.length),j!==0){var J=67108863^67108863>>>j<=67108864;j++)this.words[j]-=67108864,j===this.length-1?this.words[j+1]=1:this.words[j+1]++;return this.length=Math.max(this.length,j+1),this},s.prototype.isubn=function(D){if(i(typeof D=="number"),i(D<67108864),D<0)return this.iaddn(-D);if(this.negative!==0)return this.negative=0,this.iaddn(D),this.negative=1,this;if(this.words[0]-=D,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var j=0;j>26)-(ge/67108864|0),this.words[oe+q]=ye&67108863}for(;oe>26,this.words[oe+q]=ye&67108863;if(pe===0)return this.strip();for(i(pe===-1),pe=0,oe=0;oe>26,this.words[oe]=ye&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(D,j){var q=this.length-D.length,J=this.clone(),oe=D,ye=oe.words[oe.length-1]|0,pe=this._countBits(ye);q=26-pe,q!==0&&(oe=oe.ushln(q),J.iushln(q),ye=oe.words[oe.length-1]|0);var ge=J.length-oe.length,W;if(j!=="mod"){W=new s(null),W.length=ge+1,W.words=new Array(W.length);for(var ae=0;ae=0;Q--){var me=(J.words[oe.length+Q]|0)*67108864+(J.words[oe.length+Q-1]|0);for(me=Math.min(me/ye|0,67108863),J._ishlnsubmul(oe,me,Q);J.negative!==0;)me--,J.negative=0,J._ishlnsubmul(oe,1,Q),J.isZero()||(J.negative^=1);W&&(W.words[Q]=me)}return W&&W.strip(),J.strip(),j!=="div"&&q!==0&&J.iushrn(q),{div:W||null,mod:J}},s.prototype.divmod=function(D,j,q){if(i(!D.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var J,oe,ye;return this.negative!==0&&D.negative===0?(ye=this.neg().divmod(D,j),j!=="mod"&&(J=ye.div.neg()),j!=="div"&&(oe=ye.mod.neg(),q&&oe.negative!==0&&oe.iadd(D)),{div:J,mod:oe}):this.negative===0&&D.negative!==0?(ye=this.divmod(D.neg(),j),j!=="mod"&&(J=ye.div.neg()),{div:J,mod:ye.mod}):this.negative&D.negative?(ye=this.neg().divmod(D.neg(),j),j!=="div"&&(oe=ye.mod.neg(),q&&oe.negative!==0&&oe.isub(D)),{div:ye.div,mod:oe}):D.length>this.length||this.cmp(D)<0?{div:new s(0),mod:this}:D.length===1?j==="div"?{div:this.divn(D.words[0]),mod:null}:j==="mod"?{div:null,mod:new s(this.modn(D.words[0]))}:{div:this.divn(D.words[0]),mod:new s(this.modn(D.words[0]))}:this._wordDiv(D,j)},s.prototype.div=function(D){return this.divmod(D,"div",!1).div},s.prototype.mod=function(D){return this.divmod(D,"mod",!1).mod},s.prototype.umod=function(D){return this.divmod(D,"mod",!0).mod},s.prototype.divRound=function(D){var j=this.divmod(D);if(j.mod.isZero())return j.div;var q=j.div.negative!==0?j.mod.isub(D):j.mod,J=D.ushrn(1),oe=D.andln(1),ye=q.cmp(J);return ye<0||oe===1&&ye===0?j.div:j.div.negative!==0?j.div.isubn(1):j.div.iaddn(1)},s.prototype.modn=function(D){i(D<=67108863);for(var j=(1<<26)%D,q=0,J=this.length-1;J>=0;J--)q=(j*q+(this.words[J]|0))%D;return q},s.prototype.idivn=function(D){i(D<=67108863);for(var j=0,q=this.length-1;q>=0;q--){var J=(this.words[q]|0)+j*67108864;this.words[q]=J/D|0,j=J%D}return this.strip()},s.prototype.divn=function(D){return this.clone().idivn(D)},s.prototype.egcd=function(D){i(D.negative===0),i(!D.isZero());var j=this,q=D.clone();j.negative!==0?j=j.umod(D):j=j.clone();for(var J=new s(1),oe=new s(0),ye=new s(0),pe=new s(1),ge=0;j.isEven()&&q.isEven();)j.iushrn(1),q.iushrn(1),++ge;for(var W=q.clone(),ae=j.clone();!j.isZero();){for(var se=0,Q=1;!(j.words[0]&Q)&&se<26;++se,Q<<=1);if(se>0)for(j.iushrn(se);se-- >0;)(J.isOdd()||oe.isOdd())&&(J.iadd(W),oe.isub(ae)),J.iushrn(1),oe.iushrn(1);for(var me=0,ie=1;!(q.words[0]&ie)&&me<26;++me,ie<<=1);if(me>0)for(q.iushrn(me);me-- >0;)(ye.isOdd()||pe.isOdd())&&(ye.iadd(W),pe.isub(ae)),ye.iushrn(1),pe.iushrn(1);j.cmp(q)>=0?(j.isub(q),J.isub(ye),oe.isub(pe)):(q.isub(j),ye.isub(J),pe.isub(oe))}return{a:ye,b:pe,gcd:q.iushln(ge)}},s.prototype._invmp=function(D){i(D.negative===0),i(!D.isZero());var j=this,q=D.clone();j.negative!==0?j=j.umod(D):j=j.clone();for(var J=new s(1),oe=new s(0),ye=q.clone();j.cmpn(1)>0&&q.cmpn(1)>0;){for(var pe=0,ge=1;!(j.words[0]&ge)&&pe<26;++pe,ge<<=1);if(pe>0)for(j.iushrn(pe);pe-- >0;)J.isOdd()&&J.iadd(ye),J.iushrn(1);for(var W=0,ae=1;!(q.words[0]&ae)&&W<26;++W,ae<<=1);if(W>0)for(q.iushrn(W);W-- >0;)oe.isOdd()&&oe.iadd(ye),oe.iushrn(1);j.cmp(q)>=0?(j.isub(q),J.isub(oe)):(q.isub(j),oe.isub(J))}var se;return j.cmpn(1)===0?se=J:se=oe,se.cmpn(0)<0&&se.iadd(D),se},s.prototype.gcd=function(D){if(this.isZero())return D.abs();if(D.isZero())return this.abs();var j=this.clone(),q=D.clone();j.negative=0,q.negative=0;for(var J=0;j.isEven()&&q.isEven();J++)j.iushrn(1),q.iushrn(1);do{for(;j.isEven();)j.iushrn(1);for(;q.isEven();)q.iushrn(1);var oe=j.cmp(q);if(oe<0){var ye=j;j=q,q=ye}else if(oe===0||q.cmpn(1)===0)break;j.isub(q)}while(!0);return q.iushln(J)},s.prototype.invm=function(D){return this.egcd(D).a.umod(D)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(D){return this.words[0]&D},s.prototype.bincn=function(D){i(typeof D=="number");var j=D%26,q=(D-j)/26,J=1<>>26,pe&=67108863,this.words[ye]=pe}return oe!==0&&(this.words[ye]=oe,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(D){var j=D<0;if(this.negative!==0&&!j)return-1;if(this.negative===0&&j)return 1;this.strip();var q;if(this.length>1)q=1;else{j&&(D=-D),i(D<=67108863,"Number is too big");var J=this.words[0]|0;q=J===D?0:JD.length)return 1;if(this.length=0;q--){var J=this.words[q]|0,oe=D.words[q]|0;if(J!==oe){Joe&&(j=1);break}}return j},s.prototype.gtn=function(D){return this.cmpn(D)===1},s.prototype.gt=function(D){return this.cmp(D)===1},s.prototype.gten=function(D){return this.cmpn(D)>=0},s.prototype.gte=function(D){return this.cmp(D)>=0},s.prototype.ltn=function(D){return this.cmpn(D)===-1},s.prototype.lt=function(D){return this.cmp(D)===-1},s.prototype.lten=function(D){return this.cmpn(D)<=0},s.prototype.lte=function(D){return this.cmp(D)<=0},s.prototype.eqn=function(D){return this.cmpn(D)===0},s.prototype.eq=function(D){return this.cmp(D)===0},s.red=function(D){return new N(D)},s.prototype.toRed=function(D){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),D.convertTo(this)._forceRed(D)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(D){return this.red=D,this},s.prototype.forceRed=function(D){return i(!this.red,"Already a number in reduction context"),this._forceRed(D)},s.prototype.redAdd=function(D){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,D)},s.prototype.redIAdd=function(D){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,D)},s.prototype.redSub=function(D){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,D)},s.prototype.redISub=function(D){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,D)},s.prototype.redShl=function(D){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,D)},s.prototype.redMul=function(D){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,D),this.red.mul(this,D)},s.prototype.redIMul=function(D){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,D),this.red.imul(this,D)},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(D){return i(this.red&&!D.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,D)};var u={k256:null,p224:null,p192:null,p25519:null};function d(B,D){this.name=B,this.p=new s(D,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}d.prototype._tmp=function(){var D=new s(null);return D.words=new Array(Math.ceil(this.n/13)),D},d.prototype.ireduce=function(D){var j=D,q;do this.split(j,this.tmp),j=this.imulK(j),j=j.iadd(this.tmp),q=j.bitLength();while(q>this.n);var J=q0?j.isub(this.p):j.strip!==void 0?j.strip():j._strip(),j},d.prototype.split=function(D,j){D.iushrn(this.n,0,j)},d.prototype.imulK=function(D){return D.imul(this.k)};function y(){d.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(y,d),y.prototype.split=function(D,j){for(var q=4194303,J=Math.min(D.length,9),oe=0;oe>>22,ye=pe}ye>>>=22,D.words[oe-10]=ye,ye===0&&D.length>10?D.length-=10:D.length-=9},y.prototype.imulK=function(D){D.words[D.length]=0,D.words[D.length+1]=0,D.length+=2;for(var j=0,q=0;q>>=26,D.words[q]=oe,j=J}return j!==0&&(D.words[D.length++]=j),D},s._prime=function(D){if(u[D])return u[D];var j;if(D==="k256")j=new y;else if(D==="p224")j=new R;else if(D==="p192")j=new L;else if(D==="p25519")j=new z;else throw new Error("Unknown prime "+D);return u[D]=j,j};function N(B){if(typeof B=="string"){var D=s._prime(B);this.m=D.p,this.prime=D}else i(B.gtn(1),"modulus must be greater than 1"),this.m=B,this.prime=null}N.prototype._verify1=function(D){i(D.negative===0,"red works only with positives"),i(D.red,"red works only with red numbers")},N.prototype._verify2=function(D,j){i((D.negative|j.negative)===0,"red works only with positives"),i(D.red&&D.red===j.red,"red works only with red numbers")},N.prototype.imod=function(D){return this.prime?this.prime.ireduce(D)._forceRed(this):D.umod(this.m)._forceRed(this)},N.prototype.neg=function(D){return D.isZero()?D.clone():this.m.sub(D)._forceRed(this)},N.prototype.add=function(D,j){this._verify2(D,j);var q=D.add(j);return q.cmp(this.m)>=0&&q.isub(this.m),q._forceRed(this)},N.prototype.iadd=function(D,j){this._verify2(D,j);var q=D.iadd(j);return q.cmp(this.m)>=0&&q.isub(this.m),q},N.prototype.sub=function(D,j){this._verify2(D,j);var q=D.sub(j);return q.cmpn(0)<0&&q.iadd(this.m),q._forceRed(this)},N.prototype.isub=function(D,j){this._verify2(D,j);var q=D.isub(j);return q.cmpn(0)<0&&q.iadd(this.m),q},N.prototype.shl=function(D,j){return this._verify1(D),this.imod(D.ushln(j))},N.prototype.imul=function(D,j){return this._verify2(D,j),this.imod(D.imul(j))},N.prototype.mul=function(D,j){return this._verify2(D,j),this.imod(D.mul(j))},N.prototype.isqr=function(D){return this.imul(D,D.clone())},N.prototype.sqr=function(D){return this.mul(D,D)},N.prototype.sqrt=function(D){if(D.isZero())return D.clone();var j=this.m.andln(3);if(i(j%2===1),j===3){var q=this.m.add(new s(1)).iushrn(2);return this.pow(D,q)}for(var J=this.m.subn(1),oe=0;!J.isZero()&&J.andln(1)===0;)oe++,J.iushrn(1);i(!J.isZero());var ye=new s(1).toRed(this),pe=ye.redNeg(),ge=this.m.subn(1).iushrn(1),W=this.m.bitLength();for(W=new s(2*W*W).toRed(this);this.pow(W,ge).cmp(pe)!==0;)W.redIAdd(pe);for(var ae=this.pow(W,J),se=this.pow(D,J.addn(1).iushrn(1)),Q=this.pow(D,J),me=oe;Q.cmp(ye)!==0;){for(var ie=Q,Y=0;ie.cmp(ye)!==0;Y++)ie=ie.redSqr();i(Y=0;oe--){for(var ae=j.words[oe],se=W-1;se>=0;se--){var Q=ae>>se&1;if(ye!==J[0]&&(ye=this.sqr(ye)),Q===0&&pe===0){ge=0;continue}pe<<=1,pe|=Q,ge++,!(ge!==q&&(oe!==0||se!==0))&&(ye=this.mul(ye,J[pe]),ge=0,pe=0)}W=26}return ye},N.prototype.convertTo=function(D){var j=D.umod(this.m);return j===D?j.clone():j},N.prototype.convertFrom=function(D){var j=D.clone();return j.red=null,j},s.mont=function(D){return new U(D)};function U(B){N.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(U,N),U.prototype.convertTo=function(D){return this.imod(D.ushln(this.shift))},U.prototype.convertFrom=function(D){var j=this.imod(D.mul(this.rinv));return j.red=null,j},U.prototype.imul=function(D,j){if(D.isZero()||j.isZero())return D.words[0]=0,D.length=1,D;var q=D.imul(j),J=q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),oe=q.isub(J).iushrn(this.shift),ye=oe;return oe.cmp(this.m)>=0?ye=oe.isub(this.m):oe.cmpn(0)<0&&(ye=oe.iadd(this.m)),ye._forceRed(this)},U.prototype.mul=function(D,j){if(D.isZero()||j.isZero())return new s(0)._forceRed(this);var q=D.mul(j),J=q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),oe=q.isub(J).iushrn(this.shift),ye=oe;return oe.cmp(this.m)>=0?ye=oe.isub(this.m):oe.cmpn(0)<0&&(ye=oe.iadd(this.m)),ye._forceRed(this)},U.prototype.invm=function(D){var j=this.imod(D._invmp(this.m).mul(this.r2));return j._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,b){for(var A=0;A>>1;if(!(m<=0)){var u,d=o.mallocDouble(2*m*_),y=o.mallocInt32(_);if(_=s(g,m,d,y),_>0){if(m===1&&E)n.init(_),u=n.sweepComplete(m,A,0,_,d,y,0,_,d,y);else{var R=o.mallocDouble(2*m*w),L=o.mallocInt32(w);w=s(b,m,R,L),w>0&&(n.init(_+w),m===1?u=n.sweepBipartite(m,A,0,_,d,y,0,w,R,L):u=i(m,A,E,_,d,y,w,R,L),o.free(R),o.free(L))}o.free(d),o.free(y)}return u}}}var c;function v(g,b){c.push([g,b])}function p(g){return c=[],f(g,g,v,!0),c}function T(g,b){return c=[],f(g,b,v,!1),c}function l(g,b,A){switch(arguments.length){case 1:return p(g);case 2:return typeof b=="function"?f(g,g,b,!0):T(g,b);case 3:return f(g,b,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,v=Math.sin(i),p=Math.cos(i);return r[0]=o[0],r[1]=a+f*p-c*v,r[2]=s+f*v+c*p,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,v=f-c;v&&(r[--i]=n,n=v)}for(var p=0,a=i;a=p0)&&!(p1>=hi)"),b=v("lo===p0"),A=v("lo0;){ae-=1;var me=ae*m,ie=y[me],Y=y[me+1],le=y[me+2],ue=y[me+3],Te=y[me+4],Fe=y[me+5],Ve=ae*u,Xe=R[Ve],We=R[Ve+1],it=Fe&1,yt=!!(Fe&16),bt=oe,mt=ye,ht=ge,qe=W;if(it&&(bt=ge,mt=W,ht=oe,qe=ye),!(Fe&2&&(le=A(D,ie,Y,le,bt,mt,We),Y>=le))&&!(Fe&4&&(Y=E(D,ie,Y,le,bt,mt,Xe),Y>=le))){var ze=le-Y,Ae=Te-ue;if(yt){if(D*ze*(ze+Ae)"u"?r(1538):WeakMap,n=r(2762),i=r(8116),a=new o;function s(f){var c=a.get(f),v=c&&(c._triangleBuffer.handle||c._triangleBuffer.buffer);if(!v||!f.isBuffer(v)){var p=n(f,new Float32Array([-1,-1,-1,4,4,-1]));c=i(f,[{buffer:p,type:f.FLOAT,size:2}]),c._triangleBuffer=p,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,v,p){return o.identity(a),o.fromRotationTranslation(a,p,s),a[3]=v[0],a[7]=v[1],a[11]=v[2],a[15]=v[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),v=r(6760),p=r(7608),T=r(9618),l=r(6729),g=r(7765),b=r(1888),A=r(840),E=r(7626),_=A.meshShader,w=A.wireShader,m=A.pointShader,u=A.pickShader,d=A.pointPickShader,y=A.contourShader,R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function L(ge,W,ae,se,Q,me,ie,Y,le,ue,Te,Fe,Ve,Xe,We,it,yt,bt,mt,ht,qe,ze,Ae,Ke,_t,wt,vt){this.gl=ge,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=W,this.dirty=!0,this.triShader=ae,this.lineShader=se,this.pointShader=Q,this.pickShader=me,this.pointPickShader=ie,this.contourShader=Y,this.trianglePositions=le,this.triangleColors=Te,this.triangleNormals=Ve,this.triangleUVs=Fe,this.triangleIds=ue,this.triangleVAO=Xe,this.triangleCount=0,this.lineWidth=1,this.edgePositions=We,this.edgeColors=yt,this.edgeUVs=bt,this.edgeIds=it,this.edgeVAO=mt,this.edgeCount=0,this.pointPositions=ht,this.pointColors=ze,this.pointUVs=Ae,this.pointSizes=Ke,this.pointIds=qe,this.pointVAO=_t,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=wt,this.contourVAO=vt,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=R,this._view=R,this._projection=R,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(ge){this.pickId=ge};function N(ge,W){if(!W||!W.length)return 1;for(var ae=0;aege&&ae>0){var se=(W[ae][0]-ge)/(W[ae][0]-W[ae-1][0]);return W[ae][1]*(1-se)+se*W[ae-1][1]}}return 1}function U(ge,W){for(var ae=l({colormap:ge,nshades:256,format:"rgba"}),se=new Uint8Array(256*4),Q=0;Q<256;++Q){for(var me=ae[Q],ie=0;ie<3;++ie)se[4*Q+ie]=me[ie];W?se[4*Q+3]=255*N(Q/255,W):se[4*Q+3]=255*me[3]}return T(se,[256,256,4],[4,0,1])}function B(ge){for(var W=ge.length,ae=new Array(W),se=0;se0){var Ve=this.triShader;Ve.bind(),Ve.uniforms=Y,this.triangleVAO.bind(),W.drawArrays(W.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Ve=this.lineShader;Ve.bind(),Ve.uniforms=Y,this.edgeVAO.bind(),W.lineWidth(this.lineWidth*this.pixelRatio),W.drawArrays(W.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Ve=this.pointShader;Ve.bind(),Ve.uniforms=Y,this.pointVAO.bind(),W.drawArrays(W.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Ve=this.contourShader;Ve.bind(),Ve.uniforms=Y,this.contourVAO.bind(),W.drawArrays(W.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(ge){ge=ge||{};for(var W=this.gl,ae=ge.model||R,se=ge.view||R,Q=ge.projection||R,me=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],ie=0;ie<3;++ie)me[0][ie]=Math.max(me[0][ie],this.clipBounds[0][ie]),me[1][ie]=Math.min(me[1][ie],this.clipBounds[1][ie]);this._model=[].slice.call(ae),this._view=[].slice.call(se),this._projection=[].slice.call(Q),this._resolution=[W.drawingBufferWidth,W.drawingBufferHeight];var Y={model:ae,view:se,projection:Q,clipBounds:me,pickId:this.pickId/255},le=this.pickShader;if(le.bind(),le.uniforms=Y,this.triangleCount>0&&(this.triangleVAO.bind(),W.drawArrays(W.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),W.lineWidth(this.lineWidth*this.pixelRatio),W.drawArrays(W.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var le=this.pointPickShader;le.bind(),le.uniforms=Y,this.pointVAO.bind(),W.drawArrays(W.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(ge){if(!ge||ge.id!==this.pickId)return null;for(var W=ge.value[0]+256*ge.value[1]+65536*ge.value[2],ae=this.cells[W],se=this.positions,Q=new Array(ae.length),me=0;meMath.max(_,w)?m[2]=1:_>Math.max(E,w)?m[0]=1:m[1]=1;for(var u=0,d=0,y=0;y<3;++y)u+=A[y]*A[y],d+=m[y]*A[y];for(var y=0;y<3;++y)m[y]-=d/u*A[y];return s(m,m),m}function T(A,E,_,w,m,u,d,y){this.center=o(_),this.up=o(w),this.right=o(m),this.radius=o([u]),this.angle=o([d,y]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(A,E),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var R=0;R<16;++R)this.computedMatrix[R]=.5;this.recalcMatrix(0)}var l=T.prototype;l.setDistanceLimits=function(A,E){A>0?A=Math.log(A):A=-1/0,E>0?E=Math.log(E):E=1/0,E=Math.max(E,A),this.radius.bounds[0][0]=A,this.radius.bounds[1][0]=E},l.getDistanceLimits=function(A){var E=this.radius.bounds[0];return A?(A[0]=Math.exp(E[0][0]),A[1]=Math.exp(E[1][0]),A):[Math.exp(E[0][0]),Math.exp(E[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 E=this.computedUp,_=this.computedRight,w=0,m=0,u=0;u<3;++u)m+=E[u]*_[u],w+=E[u]*E[u];for(var d=Math.sqrt(w),y=0,u=0;u<3;++u)_[u]-=E[u]*m/w,y+=_[u]*_[u],E[u]/=d;for(var R=Math.sqrt(y),u=0;u<3;++u)_[u]/=R;var L=this.computedToward;a(L,E,_),s(L,L);for(var z=Math.exp(this.computedRadius[0]),N=this.computedAngle[0],U=this.computedAngle[1],B=Math.cos(N),D=Math.sin(N),j=Math.cos(U),q=Math.sin(U),J=this.computedCenter,oe=B*j,ye=D*j,pe=q,ge=-B*q,W=-D*q,ae=j,se=this.computedEye,Q=this.computedMatrix,u=0;u<3;++u){var me=oe*_[u]+ye*L[u]+pe*E[u];Q[4*u+1]=ge*_[u]+W*L[u]+ae*E[u],Q[4*u+2]=me,Q[4*u+3]=0}var ie=Q[1],Y=Q[5],le=Q[9],ue=Q[2],Te=Q[6],Fe=Q[10],Ve=Y*Fe-le*Te,Xe=le*ue-ie*Fe,We=ie*Te-Y*ue,it=c(Ve,Xe,We);Ve/=it,Xe/=it,We/=it,Q[0]=Ve,Q[4]=Xe,Q[8]=We;for(var u=0;u<3;++u)se[u]=J[u]+Q[2+4*u]*z;for(var u=0;u<3;++u){for(var y=0,yt=0;yt<3;++yt)y+=Q[u+4*yt]*se[yt];Q[12+u]=-y}Q[15]=1},l.getMatrix=function(A,E){this.recalcMatrix(A);var _=this.computedMatrix;if(E){for(var w=0;w<16;++w)E[w]=_[w];return E}return _};var g=[0,0,0];l.rotate=function(A,E,_,w){if(this.angle.move(A,E,_),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,d=this.computedRight,y=this.computedToward,R=0;R<3;++R)m[4*R]=u[R],m[4*R+1]=d[R],m[4*R+2]=y[R];i(m,m,w,g);for(var R=0;R<3;++R)u[R]=m[4*R],d[R]=m[4*R+1];this.up.set(A,u[0],u[1],u[2]),this.right.set(A,d[0],d[1],d[2])}},l.pan=function(A,E,_,w){E=E||0,_=_||0,w=w||0,this.recalcMatrix(A);var m=this.computedMatrix;Math.exp(this.computedRadius[0]);var u=m[1],d=m[5],y=m[9],R=c(u,d,y);u/=R,d/=R,y/=R;var L=m[0],z=m[4],N=m[8],U=L*u+z*d+N*y;L-=u*U,z-=d*U,N-=y*U;var B=c(L,z,N);L/=B,z/=B,N/=B;var D=L*E+u*_,j=z*E+d*_,q=N*E+y*_;this.center.move(A,D,j,q);var J=Math.exp(this.computedRadius[0]);J=Math.max(1e-4,J+w),this.radius.set(A,Math.log(J))},l.translate=function(A,E,_,w){this.center.move(A,E||0,_||0,w||0)},l.setMatrix=function(A,E,_,w){var m=1;typeof _=="number"&&(m=_|0),(m<0||m>3)&&(m=1);var u=(m+2)%3;E||(this.recalcMatrix(A),E=this.computedMatrix);var d=E[m],y=E[m+4],R=E[m+8];if(w){var z=Math.abs(d),N=Math.abs(y),U=Math.abs(R),B=Math.max(z,N,U);z===B?(d=d<0?-1:1,y=R=0):U===B?(R=R<0?-1:1,d=y=0):(y=y<0?-1:1,d=R=0)}else{var L=c(d,y,R);d/=L,y/=L,R/=L}var D=E[u],j=E[u+4],q=E[u+8],J=D*d+j*y+q*R;D-=d*J,j-=y*J,q-=R*J;var oe=c(D,j,q);D/=oe,j/=oe,q/=oe;var ye=y*q-R*j,pe=R*D-d*q,ge=d*j-y*D,W=c(ye,pe,ge);ye/=W,pe/=W,ge/=W,this.center.jump(A,qe,ze,Ae),this.radius.idle(A),this.up.jump(A,d,y,R),this.right.jump(A,D,j,q);var ae,se;if(m===2){var Q=E[1],me=E[5],ie=E[9],Y=Q*D+me*j+ie*q,le=Q*ye+me*pe+ie*ge;Ve<0?ae=-Math.PI/2:ae=Math.PI/2,se=Math.atan2(le,Y)}else{var ue=E[2],Te=E[6],Fe=E[10],Ve=ue*d+Te*y+Fe*R,Xe=ue*D+Te*j+Fe*q,We=ue*ye+Te*pe+Fe*ge;ae=Math.asin(v(Ve)),se=Math.atan2(We,Xe)}this.angle.jump(A,se,ae),this.recalcMatrix(A);var it=E[2],yt=E[6],bt=E[10],mt=this.computedMatrix;n(mt,E);var ht=mt[15],qe=mt[12]/ht,ze=mt[13]/ht,Ae=mt[14]/ht,Ke=Math.exp(this.computedRadius[0]);this.center.jump(A,qe-it*Ke,ze-yt*Ke,Ae-bt*Ke)},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,E){E>0&&this.radius.set(A,Math.log(E))},l.lookAt=function(A,E,_,w){this.recalcMatrix(A),E=E||this.computedEye,_=_||this.computedCenter,w=w||this.computedUp;var m=w[0],u=w[1],d=w[2],y=c(m,u,d);if(!(y<1e-6)){m/=y,u/=y,d/=y;var R=E[0]-_[0],L=E[1]-_[1],z=E[2]-_[2],N=c(R,L,z);if(!(N<1e-6)){R/=N,L/=N,z/=N;var U=this.computedRight,B=U[0],D=U[1],j=U[2],q=m*B+u*D+d*j;B-=q*m,D-=q*u,j-=q*d;var J=c(B,D,j);if(!(J<.01&&(B=u*z-d*L,D=d*R-m*z,j=m*L-u*R,J=c(B,D,j),J<1e-6))){B/=J,D/=J,j/=J,this.up.set(A,m,u,d),this.right.set(A,B,D,j),this.center.set(A,_[0],_[1],_[2]),this.radius.set(A,Math.log(N));var oe=u*j-d*D,ye=d*B-m*j,pe=m*D-u*B,ge=c(oe,ye,pe);oe/=ge,ye/=ge,pe/=ge;var W=m*R+u*L+d*z,ae=B*R+D*L+j*z,se=oe*R+ye*L+pe*z,Q=Math.asin(v(W)),me=Math.atan2(se,ae),ie=this.angle._state,Y=ie[ie.length-1],le=ie[ie.length-2];Y=Y%(2*Math.PI);var ue=Math.abs(Y+2*Math.PI-me),Te=Math.abs(Y-me),Fe=Math.abs(Y-2*Math.PI-me);ue 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,v=a+a,p=n*f,T=i*f,l=i*c,g=a*f,b=a*c,A=a*v,E=s*f,_=s*c,w=s*v;return r[0]=1-l-A,r[1]=T+w,r[2]=g-_,r[3]=0,r[4]=T-w,r[5]=1-p-A,r[6]=b+E,r[7]=0,r[8]=g+_,r[9]=b-E,r[10]=1-p-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(),v=T();e.exports=p;function p(b,A,E,_){if(a(A)===0||a(E)===0)return!1;var w=i(A,f.translate,f.scale,f.skew,f.perspective,f.quaternion),m=i(E,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!w||!m?!1:(o(v.translate,f.translate,c.translate,_),o(v.skew,f.skew,c.skew,_),o(v.scale,f.scale,c.scale,_),o(v.perspective,f.perspective,c.perspective,_),s(v.quaternion,f.quaternion,c.quaternion,_),n(b,v.translate,v.scale,v.skew,v.perspective,v.quaternion),!0)}function T(){return{translate:l(),scale:l(1),skew:l(),perspective:g(),quaternion:g()}}function l(b){return[b||0,b||0,b||0]}function g(){return[0,0,0,1]}},7507:function(e,t){t.byteLength=c,t.toByteArray=p,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 E=b.indexOf("=");E===-1&&(E=A);var _=E===A?0:4-E%4;return[E,_]}function c(b){var A=f(b),E=A[0],_=A[1];return(E+_)*3/4-_}function v(b,A,E){return(A+E)*3/4-E}function p(b){var A,E=f(b),_=E[0],w=E[1],m=new n(v(b,_,w)),u=0,d=w>0?_-4:_,y;for(y=0;y>16&255,m[u++]=A>>8&255,m[u++]=A&255;return w===2&&(A=o[b.charCodeAt(y)]<<2|o[b.charCodeAt(y+1)]>>4,m[u++]=A&255),w===1&&(A=o[b.charCodeAt(y)]<<10|o[b.charCodeAt(y+1)]<<4|o[b.charCodeAt(y+2)]>>2,m[u++]=A>>8&255,m[u++]=A&255),m}function T(b){return r[b>>18&63]+r[b>>12&63]+r[b>>6&63]+r[b&63]}function l(b,A,E){for(var _,w=[],m=A;md?d:u+m));return _===1?(A=b[E-1],w.push(r[A>>2]+r[A<<4&63]+"==")):_===2&&(A=(b[E-2]<<8)+b[E-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,v,p,T){this.location=s,this.dimension=f,this.a=c,this.b=v,this.c=p,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+=d[E]}return Math.abs(y-1)>.001?null:[_,f(v,d),d]}},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(p){switch(p){case"uint32":return[o.mallocUint32,o.freeUint32];default:return null}}var i={"uint32,1,0":function(p,T){return function(g,b,A,E,_,w,m,u,d,y,R){var L,z,N,U=g*_+E,B,D=p(u),j,q,J,oe;for(L=g+1;L<=b;++L){for(z=L,U+=_,N=U,j=0,q=U,B=0;Bg;){j=0,q=N-_;t:for(B=0;Boe)break t;q+=y,j+=R}for(j=N,q=N-_,B=0;B>1,D=B-z,j=B+z,q=N,J=D,oe=B,ye=j,pe=U,ge=b+1,W=A-1,ae=!0,se,Q,me,ie,Y,le,ue,Te,Fe,Ve=0,Xe=0,We=0,it,yt,bt,mt,ht,qe,ze,Ae,Ke,_t,wt,vt,$t,Yt,lr,dr,Nr=d,Fr=T(Nr),ln=T(Nr);yt=w*q,bt=w*J,dr=_;e:for(it=0;it0){Q=q,q=J,J=Q;break e}if(We<0)break e;dr+=R}yt=w*ye,bt=w*pe,dr=_;e:for(it=0;it0){Q=ye,ye=pe,pe=Q;break e}if(We<0)break e;dr+=R}yt=w*q,bt=w*oe,dr=_;e:for(it=0;it0){Q=q,q=oe,oe=Q;break e}if(We<0)break e;dr+=R}yt=w*J,bt=w*oe,dr=_;e:for(it=0;it0){Q=J,J=oe,oe=Q;break e}if(We<0)break e;dr+=R}yt=w*q,bt=w*ye,dr=_;e:for(it=0;it0){Q=q,q=ye,ye=Q;break e}if(We<0)break e;dr+=R}yt=w*oe,bt=w*ye,dr=_;e:for(it=0;it0){Q=oe,oe=ye,ye=Q;break e}if(We<0)break e;dr+=R}yt=w*J,bt=w*pe,dr=_;e:for(it=0;it0){Q=J,J=pe,pe=Q;break e}if(We<0)break e;dr+=R}yt=w*J,bt=w*oe,dr=_;e:for(it=0;it0){Q=J,J=oe,oe=Q;break e}if(We<0)break e;dr+=R}yt=w*ye,bt=w*pe,dr=_;e:for(it=0;it0){Q=ye,ye=pe,pe=Q;break e}if(We<0)break e;dr+=R}for(yt=w*q,bt=w*J,mt=w*oe,ht=w*ye,qe=w*pe,ze=w*N,Ae=w*B,Ke=w*U,lr=0,dr=_,it=0;it0)W--;else if(We<0){for(yt=w*le,bt=w*ge,mt=w*W,dr=_,it=0;it0)for(;;){ue=_+W*w,lr=0;e:for(it=0;it0){if(--WU){e:for(;;){for(ue=_+ge*w,lr=0,dr=_,it=0;it1&&g?A(l,g[0],g[1]):A(l)}var c={"uint32,1,0":function(p,T){return function(l){var g=l.data,b=l.offset|0,A=l.shape,E=l.stride,_=E[0]|0,w=A[0]|0,m=E[1]|0,u=A[1]|0,d=m,y=m,R=1;w<=32?p(0,w-1,g,b,_,m,w,u,d,y,R):T(0,w-1,g,b,_,m,w,u,d,y,R)}}};function v(p,T){var l=[T,p].join(","),g=c[l],b=a(p,T),A=f(p,T,b);return g(b,A)}e.exports=v},7642:function(e,t,r){var o=r(8954),n=r(1682);e.exports=f;function i(c,v){this.point=c,this.index=v}function a(c,v){for(var p=c.point,T=v.point,l=p.length,g=0;g=2)return!1;N[B]=D}return!0}):z=z.filter(function(N){for(var U=0;U<=T;++U){var B=d[N[U]];if(B<0)return!1;N[U]=B}return!0}),T&1)for(var b=0;b",j="",q=D.length,J=j.length,oe=N[0]===g||N[0]===E,ye=0,pe=-J;ye>-1&&(ye=U.indexOf(D,ye),!(ye===-1||(pe=U.indexOf(j,ye+q),pe===-1)||pe<=ye));){for(var ge=ye;ge=pe)B[ge]=null,U=U.substr(0,ge)+" "+U.substr(ge+1);else if(B[ge]!==null){var W=B[ge].indexOf(N[0]);W===-1?B[ge]+=N:oe&&(B[ge]=B[ge].substr(0,W+1)+(1+parseInt(B[ge][W+1]))+B[ge].substr(W+2))}var ae=ye+q,se=U.substr(ae,pe-ae),Q=se.indexOf(D);Q!==-1?ye=Q:ye=pe+J}return B}function m(z,N,U){for(var B=N.textAlign||"start",D=N.textBaseline||"alphabetic",j=[1<<30,1<<30],q=[0,0],J=z.length,oe=0;oe/g,` `):U=U.replace(/\/g," ");var q="",J=[];for(Y=0;Y-1?parseInt(Ae[1+wt]):0,Yt=vt>-1?parseInt(Ke[1+vt]):0;$t!==Yt&&(_t=_t.replace(We(),"?px "),Te*=Math.pow(.75,Yt-$t),_t=_t.replace("?px ",We())),ue+=.25*W*(Yt-$t)}if(j.superscripts===!0){var lr=Ae.indexOf(g),dr=Ke.indexOf(g),Nr=lr>-1?parseInt(Ae[1+lr]):0,Fr=dr>-1?parseInt(Ke[1+dr]):0;Nr!==Fr&&(_t=_t.replace(We(),"?px "),Te*=Math.pow(.75,Fr-Nr),_t=_t.replace("?px ",We())),ue-=.25*W*(Fr-Nr)}if(j.bolds===!0){var ln=Ae.indexOf(v)>-1,zr=Ke.indexOf(v)>-1;!ln&&zr&&(Xr?_t=_t.replace("italic ","italic bold "):_t="bold "+_t),ln&&!zr&&(_t=_t.replace("bold ",""))}if(j.italics===!0){var Xr=Ae.indexOf(T)>-1,Ot=Ke.indexOf(T)>-1;!Xr&&Ot&&(_t="italic "+_t),Xr&&!Ot&&(_t=_t.replace("italic ",""))}N.font=_t}for(ie=0;ie0&&(D=B.size),B.lineSpacing&&B.lineSpacing>0&&(j=B.lineSpacing),B.styletags&&B.styletags.breaklines&&(q.breaklines=!!B.styletags.breaklines),B.styletags&&B.styletags.bolds&&(q.bolds=!!B.styletags.bolds),B.styletags&&B.styletags.italics&&(q.italics=!!B.styletags.italics),B.styletags&&B.styletags.subscripts&&(q.subscripts=!!B.styletags.subscripts),B.styletags&&B.styletags.superscripts&&(q.superscripts=!!B.styletags.superscripts)),U.font=[B.fontStyle,B.fontVariant,B.fontWeight,D+"px",B.font].filter(function(oe){return oe}).join(" "),U.textAlign="start",U.textBaseline="alphabetic",U.direction="ltr";var J=u(N,U,z,D,j,q);return R(J,B,D)}},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 b=g.length,A=0,E=0;E"u"&&(E=s(g));var _=g.length;if(_===0||E<1)return{cells:[],vertexIds:[],vertexWeights:[]};var w=f(b,+A),m=c(g,E),u=v(m,b,w,+A),d=p(m,b.length|0),y=a(E)(g,m.data,d,w),R=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(d),{cells:y,vertexIds:R,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(d){a=[d.LINEAR,d.NEAREST_MIPMAP_LINEAR,d.LINEAR_MIPMAP_NEAREST,d.LINEAR_MIPMAP_NEAREST],s=[d.NEAREST,d.LINEAR,d.NEAREST_MIPMAP_NEAREST,d.NEAREST_MIPMAP_LINEAR,d.LINEAR_MIPMAP_NEAREST,d.LINEAR_MIPMAP_LINEAR],f=[d.REPEAT,d.CLAMP_TO_EDGE,d.MIRRORED_REPEAT]}function v(d){return typeof HTMLCanvasElement<"u"&&d instanceof HTMLCanvasElement||typeof HTMLImageElement<"u"&&d instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&d instanceof HTMLVideoElement||typeof ImageData<"u"&&d instanceof ImageData}var p=function(d,y){n.muls(d,y,255)};function T(d,y,R){var L=d.gl,z=L.getParameter(L.MAX_TEXTURE_SIZE);if(y<0||y>z||R<0||R>z)throw new Error("gl-texture2d: Invalid texture size");return d._shape=[y,R],d.bind(),L.texImage2D(L.TEXTURE_2D,0,d.format,y,R,0,d.format,d.type,null),d._mipLevels=[0],d}function l(d,y,R,L,z,N){this.gl=d,this.handle=y,this.format=z,this.type=N,this._shape=[R,L],this._mipLevels=[0],this._magFilter=d.NEAREST,this._minFilter=d.NEAREST,this._wrapS=d.CLAMP_TO_EDGE,this._wrapT=d.CLAMP_TO_EDGE,this._anisoSamples=1;var U=this,B=[this._wrapS,this._wrapT];Object.defineProperties(B,[{get:function(){return U._wrapS},set:function(j){return U.wrapS=j}},{get:function(){return U._wrapT},set:function(j){return U.wrapT=j}}]),this._wrapVector=B;var D=[this._shape[0],this._shape[1]];Object.defineProperties(D,[{get:function(){return U._shape[0]},set:function(j){return U.width=j}},{get:function(){return U._shape[1]},set:function(j){return U.height=j}}]),this._shapeVector=D}var g=l.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(d){this.bind();var y=this.gl;if(this.type===y.FLOAT&&a.indexOf(d)>=0&&(y.getExtension("OES_texture_float_linear")||(d=y.NEAREST)),s.indexOf(d)<0)throw new Error("gl-texture2d: Unknown filter mode "+d);return y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MIN_FILTER,d),this._minFilter=d}},magFilter:{get:function(){return this._magFilter},set:function(d){this.bind();var y=this.gl;if(this.type===y.FLOAT&&a.indexOf(d)>=0&&(y.getExtension("OES_texture_float_linear")||(d=y.NEAREST)),s.indexOf(d)<0)throw new Error("gl-texture2d: Unknown filter mode "+d);return y.texParameteri(y.TEXTURE_2D,y.TEXTURE_MAG_FILTER,d),this._magFilter=d}},mipSamples:{get:function(){return this._anisoSamples},set:function(d){var y=this._anisoSamples;if(this._anisoSamples=Math.max(d,1)|0,y!==this._anisoSamples){var R=this.gl.getExtension("EXT_texture_filter_anisotropic");R&&this.gl.texParameterf(this.gl.TEXTURE_2D,R.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(d){if(this.bind(),f.indexOf(d)<0)throw new Error("gl-texture2d: Unknown wrap mode "+d);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,d),this._wrapS=d}},wrapT:{get:function(){return this._wrapT},set:function(d){if(this.bind(),f.indexOf(d)<0)throw new Error("gl-texture2d: Unknown wrap mode "+d);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,d),this._wrapT=d}},wrap:{get:function(){return this._wrapVector},set:function(d){if(Array.isArray(d)||(d=[d,d]),d.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(d[y])<0)throw new Error("gl-texture2d: Unknown wrap mode "+d);this._wrapS=d[0],this._wrapT=d[1];var R=this.gl;return this.bind(),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,this._wrapS),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,this._wrapT),d}},shape:{get:function(){return this._shapeVector},set:function(d){if(!Array.isArray(d))d=[d|0,d|0];else if(d.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,d[0]|0,d[1]|0),[d[0]|0,d[1]|0]}},width:{get:function(){return this._shape[0]},set:function(d){return d=d|0,T(this,d,this._shape[1]),d}},height:{get:function(){return this._shape[1]},set:function(d){return d=d|0,T(this,this._shape[0],d),d}}}),g.bind=function(d){var y=this.gl;return d!==void 0&&y.activeTexture(y.TEXTURE0+(d|0)),y.bindTexture(y.TEXTURE_2D,this.handle),d!==void 0?d|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 d=Math.min(this._shape[0],this._shape[1]),y=0;d>0;++y,d>>>=1)this._mipLevels.indexOf(y)<0&&this._mipLevels.push(y)},g.setPixels=function(d,y,R,L){var z=this.gl;this.bind(),Array.isArray(y)?(L=R,R=y[1]|0,y=y[0]|0):(y=y||0,R=R||0),L=L||0;var N=v(d)?d:d.raw;if(N){var U=this._mipLevels.indexOf(L)<0;U?(z.texImage2D(z.TEXTURE_2D,0,this.format,this.format,this.type,N),this._mipLevels.push(L)):z.texSubImage2D(z.TEXTURE_2D,L,y,R,this.format,this.type,N)}else if(d.shape&&d.stride&&d.data){if(d.shape.length<2||y+d.shape[1]>this._shape[1]>>>L||R+d.shape[0]>this._shape[0]>>>L||y<0||R<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");A(z,y,R,L,this.format,this.type,this._mipLevels,d)}else throw new Error("gl-texture2d: Unsupported data type")};function b(d,y){return d.length===3?y[2]===1&&y[1]===d[0]*d[2]&&y[0]===d[2]:y[0]===1&&y[1]===d[0]}function A(d,y,R,L,z,N,U,B){var D=B.dtype,j=B.shape.slice();if(j.length<2||j.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var q=0,J=0,oe=b(j,B.stride.slice());if(D==="float32"?q=d.FLOAT:D==="float64"?(q=d.FLOAT,oe=!1,D="float32"):D==="uint8"?q=d.UNSIGNED_BYTE:(q=d.UNSIGNED_BYTE,oe=!1,D="uint8"),j.length===2)J=d.LUMINANCE,j=[j[0],j[1],1],B=o(B.data,j,[B.stride[0],B.stride[1],1],B.offset);else if(j.length===3){if(j[2]===1)J=d.ALPHA;else if(j[2]===2)J=d.LUMINANCE_ALPHA;else if(j[2]===3)J=d.RGB;else if(j[2]===4)J=d.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");j[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((J===d.LUMINANCE||J===d.ALPHA)&&(z===d.LUMINANCE||z===d.ALPHA)&&(J=z),J!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var ye=B.size,pe=U.indexOf(L)<0;if(pe&&U.push(L),q===N&&oe)B.offset===0&&B.data.length===ye?pe?d.texImage2D(d.TEXTURE_2D,L,z,j[0],j[1],0,z,N,B.data):d.texSubImage2D(d.TEXTURE_2D,L,y,R,j[0],j[1],z,N,B.data):pe?d.texImage2D(d.TEXTURE_2D,L,z,j[0],j[1],0,z,N,B.data.subarray(B.offset,B.offset+ye)):d.texSubImage2D(d.TEXTURE_2D,L,y,R,j[0],j[1],z,N,B.data.subarray(B.offset,B.offset+ye));else{var ge;N===d.FLOAT?ge=i.mallocFloat32(ye):ge=i.mallocUint8(ye);var W=o(ge,j,[j[2],j[2]*j[0],1]);q===d.FLOAT&&N===d.UNSIGNED_BYTE?p(W,B):n.assign(W,B),pe?d.texImage2D(d.TEXTURE_2D,L,z,j[0],j[1],0,z,N,ge.subarray(0,ye)):d.texSubImage2D(d.TEXTURE_2D,L,y,R,j[0],j[1],z,N,ge.subarray(0,ye)),N===d.FLOAT?i.freeFloat32(ge):i.freeUint8(ge)}}function E(d){var y=d.createTexture();return d.bindTexture(d.TEXTURE_2D,y),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),y}function _(d,y,R,L,z){var N=d.getParameter(d.MAX_TEXTURE_SIZE);if(y<0||y>N||R<0||R>N)throw new Error("gl-texture2d: Invalid texture shape");if(z===d.FLOAT&&!d.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var U=E(d);return d.texImage2D(d.TEXTURE_2D,0,L,y,R,0,L,z,null),new l(d,U,y,R,L,z)}function w(d,y,R,L,z,N){var U=E(d);return d.texImage2D(d.TEXTURE_2D,0,z,z,N,y),new l(d,U,R,L,z,N)}function m(d,y){var R=y.dtype,L=y.shape.slice(),z=d.getParameter(d.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 N=b(L,y.stride.slice()),U=0;R==="float32"?U=d.FLOAT:R==="float64"?(U=d.FLOAT,N=!1,R="float32"):R==="uint8"?U=d.UNSIGNED_BYTE:(U=d.UNSIGNED_BYTE,N=!1,R="uint8");var B=0;if(L.length===2)B=d.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=d.ALPHA;else if(L[2]===2)B=d.LUMINANCE_ALPHA;else if(L[2]===3)B=d.RGB;else if(L[2]===4)B=d.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");U===d.FLOAT&&!d.getExtension("OES_texture_float")&&(U=d.UNSIGNED_BYTE,N=!1);var D,j,q=y.size;if(N)y.offset===0&&y.data.length===q?D=y.data:D=y.data.subarray(y.offset,y.offset+q);else{var J=[L[2],L[2]*L[0],1];j=i.malloc(q,R);var oe=o(j,L,J,0);(R==="float32"||R==="float64")&&U===d.UNSIGNED_BYTE?p(oe,y):n.assign(oe,y),D=j.subarray(0,q)}var ye=E(d);return d.texImage2D(d.TEXTURE_2D,0,B,L[0],L[1],0,B,U,D),N||i.free(j),new l(d,ye,L[0],L[1],B,U)}function u(d){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(a||c(d),typeof arguments[1]=="number")return _(d,arguments[1],arguments[2],arguments[3]||d.RGBA,arguments[4]||d.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return _(d,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||d.RGBA,arguments[3]||d.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var y=arguments[1],R=v(y)?y:y.raw;if(R)return w(d,R,y.width|0,y.height|0,arguments[2]||d.RGBA,arguments[3]||d.UNSIGNED_BYTE);if(y.shape&&y.data&&y.stride)return m(d,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(b,A,E,_){for(var w=b.points,m=b.velocities,u=b.divergences,d=[],y=[],R=[],L=[],z=[],N=[],U=0,B=0,D=n.create(),j=n.create(),q=8,J=0;J0)for(var ge=0;geA)return _-1}return _},c=function(b,A,E){return bE?E:b},v=function(b,A,E){var _=A.vectors,w=A.meshgrid,m=b[0],u=b[1],d=b[2],y=w[0].length,R=w[1].length,L=w[2].length,z=f(w[0],m),N=f(w[1],u),U=f(w[2],d),B=z+1,D=N+1,j=U+1;if(z=c(z,0,y-1),B=c(B,0,y-1),N=c(N,0,R-1),D=c(D,0,R-1),U=c(U,0,L-1),j=c(j,0,L-1),z<0||N<0||U<0||B>y-1||D>R-1||j>L-1)return o.create();var q=w[0][z],J=w[0][B],oe=w[1][N],ye=w[1][D],pe=w[2][U],ge=w[2][j],W=(m-q)/(J-q),ae=(u-oe)/(ye-oe),se=(d-pe)/(ge-pe);isFinite(W)||(W=.5),isFinite(ae)||(ae=.5),isFinite(se)||(se=.5);var Q,me,ie,Y,le,ue;switch(E.reversedX&&(z=y-1-z,B=y-1-B),E.reversedY&&(N=R-1-N,D=R-1-D),E.reversedZ&&(U=L-1-U,j=L-1-j),E.filled){case 5:le=U,ue=j,ie=N*L,Y=D*L,Q=z*L*R,me=B*L*R;break;case 4:le=U,ue=j,Q=z*L,me=B*L,ie=N*L*y,Y=D*L*y;break;case 3:ie=N,Y=D,le=U*R,ue=j*R,Q=z*R*L,me=B*R*L;break;case 2:ie=N,Y=D,Q=z*R,me=B*R,le=U*R*y,ue=j*R*y;break;case 1:Q=z,me=B,le=U*y,ue=j*y,ie=N*y*L,Y=D*y*L;break;default:Q=z,me=B,ie=N*y,Y=D*y,le=U*y*R,ue=j*y*R;break}var Te=_[Q+ie+le],Fe=_[Q+ie+ue],Ve=_[Q+Y+le],Xe=_[Q+Y+ue],We=_[me+ie+le],it=_[me+ie+ue],yt=_[me+Y+le],bt=_[me+Y+ue],mt=o.create(),ht=o.create(),qe=o.create(),ze=o.create();o.lerp(mt,Te,We,W),o.lerp(ht,Fe,it,W),o.lerp(qe,Ve,yt,W),o.lerp(ze,Xe,bt,W);var Ae=o.create(),Ke=o.create();o.lerp(Ae,mt,qe,ae),o.lerp(Ke,ht,ze,ae);var _t=o.create();return o.lerp(_t,Ae,Ke,se),_t},p=function(b){var A=1/0;b.sort(function(m,u){return m-u});for(var E=b.length,_=1;_B||btD||mtj)},J=o.distance(A[0],A[1]),oe=10*J/_,ye=oe*oe,pe=1,ge=0,W=E.length;W>1&&(pe=T(E));for(var ae=0;aege&&(ge=Te),le.push(Te),L.push({points:Q,velocities:me,divergences:le});for(var Fe=0;Fe<_*100&&Q.length<_&&q(se);){Fe++;var Ve=o.clone(ie),Xe=o.squaredLength(Ve);if(Xe===0)break;if(Xe>ye&&o.scale(Ve,Ve,oe/Math.sqrt(Xe)),o.add(Ve,Ve,se),ie=y(Ve),o.squaredDistance(Y,Ve)-ye>-1e-4*ye){Q.push(Ve),Y=Ve,me.push(ie);var ue=R(Ve,ie),Te=o.length(ue);isFinite(Te)&&Te>ge&&(ge=Te),le.push(Te)}se=Ve}}var We=s(L,b.colormap,ge,pe);return m?We.tubeScale=m:(ge===0&&(ge=1),We.tubeScale=w*.5*pe/ge),We};var l=r(6740),g=r(6405).createMesh;e.exports.createTubeMesh=function(b,A){return g(b,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(v,p){if(o(v))return p?f(v,c(p)):[v[0].clone(),v[1].clone()];var T=0,l,g;if(n(v))l=v.clone();else if(typeof v=="string")l=a(v);else{if(v===0)return[i(0),i(1)];if(v===Math.floor(v))l=i(v);else{for(;v!==Math.floor(v);)v=v*Math.pow(2,256),T-=256;l=i(v)}}if(o(p))l.mul(p[1]),g=p[0].clone();else if(n(p))g=p.clone();else if(typeof p=="string")g=a(p);else if(!p)g=i(1);else if(p===Math.floor(p))g=i(p);else{for(;p!==Math.floor(p);)p=p*Math.pow(2,256),T+=256;g=i(p)}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(v){return t[v]}function o(v,p,T,l,g,b,A){for(var E=2*v,_=E*T,w=_,m=T,u=p,d=v+p,y=T;l>y;++y,_+=E){var R=g[_+u];if(R===A)if(m===y)m+=1,w+=E;else{for(var L=0;E>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var N=b[y];b[y]=b[m],b[m++]=N}}return m}function n(v,p,T,l,g,b,A){for(var E=2*v,_=E*T,w=_,m=T,u=p,d=v+p,y=T;l>y;++y,_+=E){var R=g[_+u];if(RL;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var N=b[y];b[y]=b[m],b[m++]=N}}return m}function i(v,p,T,l,g,b,A){for(var E=2*v,_=E*T,w=_,m=T,u=p,d=v+p,y=T;l>y;++y,_+=E){var R=g[_+d];if(R<=A)if(m===y)m+=1,w+=E;else{for(var L=0;E>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var N=b[y];b[y]=b[m],b[m++]=N}}return m}function a(v,p,T,l,g,b,A){for(var E=2*v,_=E*T,w=_,m=T,u=p,d=v+p,y=T;l>y;++y,_+=E){var R=g[_+d];if(R<=A)if(m===y)m+=1,w+=E;else{for(var L=0;E>L;++L){var z=g[_+L];g[_+L]=g[w],g[w++]=z}var N=b[y];b[y]=b[m],b[m++]=N}}return m}function s(v,p,T,l,g,b,A){for(var E=2*v,_=E*T,w=_,m=T,u=p,d=v+p,y=T;l>y;++y,_+=E){var R=g[_+u],L=g[_+d];if(R<=A&&A<=L)if(m===y)m+=1,w+=E;else{for(var z=0;E>z;++z){var N=g[_+z];g[_+z]=g[w],g[w++]=N}var U=b[y];b[y]=b[m],b[m++]=U}}return m}function f(v,p,T,l,g,b,A){for(var E=2*v,_=E*T,w=_,m=T,u=p,d=v+p,y=T;l>y;++y,_+=E){var R=g[_+u],L=g[_+d];if(Rz;++z){var N=g[_+z];g[_+z]=g[w],g[w++]=N}var U=b[y];b[y]=b[m],b[m++]=U}}return m}function c(v,p,T,l,g,b,A,E){for(var _=2*v,w=_*T,m=w,u=T,d=p,y=v+p,R=T;l>R;++R,w+=_){var L=g[w+d],z=g[w+y];if(!(L>=A)&&!(E>=z))if(u===R)u+=1,m+=_;else{for(var N=0;_>N;++N){var U=g[w+N];g[w+N]=g[m],g[m++]=U}var B=b[R];b[R]=b[u],b[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,v){var p=s.createVertexArray?new i(s):s.getExtension("OES_vertex_array_object"),T;return p?T=o(s,p):T=n(s),T.update(f,c,v),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]),v=o(f[0],f[1],f[2]);n(c,c),n(v,v);var p=i(c,v);return p>1?0:Math.acos(p)}},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,v=c+f;return v?[v,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,v=0,p=0,T=Math.abs,l=o[v],g=T(l),b=n[p],A=T(b),E,_;g=a?(E=l,v+=1,vc)for(var R=f[l],L=1/Math.sqrt(m*d),y=0;y<3;++y){var z=(y+1)%3,N=(y+2)%3;R[y]+=L*(u[z]*w[N]-u[N]*w[z])}}for(var v=0;vc)for(var L=1/Math.sqrt(U),y=0;y<3;++y)R[y]*=L;else for(var y=0;y<3;++y)R[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,v=0;vc?E=1/Math.sqrt(E):E=0;for(var l=0;l<3;++l)A[l]*=E;f[v]=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),v=r(5964),p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,l=DataView;function g(Q){return T.isView(Q)&&!(Q instanceof l)}function b(Q){return Array.isArray(Q)||g(Q)}e.exports=se;function A(Q,me){var ie=Q[0],Y=Q[1],le=Q[2],ue=Q[3];return Q[0]=me[0]*ie+me[4]*Y+me[8]*le+me[12]*ue,Q[1]=me[1]*ie+me[5]*Y+me[9]*le+me[13]*ue,Q[2]=me[2]*ie+me[6]*Y+me[10]*le+me[14]*ue,Q[3]=me[3]*ie+me[7]*Y+me[11]*le+me[15]*ue,Q}function E(Q,me,ie,Y){return A(Y,Y),A(Y,Y),A(Y,Y)}function _(Q,me){this.index=Q,this.dataCoordinate=this.position=me}function w(Q){return Q===!0||Q>1?1:Q}function m(Q,me,ie,Y,le,ue,Te,Fe,Ve,Xe,We,it){this.gl=Q,this.pixelRatio=1,this.shader=me,this.orthoShader=ie,this.projectShader=Y,this.pointBuffer=le,this.colorBuffer=ue,this.glyphBuffer=Te,this.idBuffer=Fe,this.vao=Ve,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=Xe,this.pickOrthoShader=We,this.pickProjectShader=it,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(Q){this.pickId=Q},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var Q=0;Q<3;++Q)if(this.axesProject[Q]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var Q=0;Q<3;++Q)if(this.axesProject[Q]&&!this.projectHasAlpha)return!0;return!1};var d=[0,0],y=[0,0,0],R=[0,0,0],L=[0,0,0,1],z=[0,0,0,1],N=p.slice(),U=[0,0,0],B=[[0,0,0],[0,0,0]];function D(Q){return Q[0]=Q[1]=Q[2]=0,Q}function j(Q,me){return Q[0]=me[0],Q[1]=me[1],Q[2]=me[2],Q[3]=1,Q}function q(Q,me,ie,Y){return Q[0]=me[0],Q[1]=me[1],Q[2]=me[2],Q[ie]=Y,Q}function J(Q){for(var me=B,ie=0;ie<2;++ie)for(var Y=0;Y<3;++Y)me[ie][Y]=Math.max(Math.min(Q[ie][Y],1e8),-1e8);return me}function oe(Q,me,ie,Y){var le=me.axesProject,ue=me.gl,Te=Q.uniforms,Fe=ie.model||p,Ve=ie.view||p,Xe=ie.projection||p,We=me.axesBounds,it=J(me.clipBounds),yt;me.axes&&me.axes.lastCubeProps?yt=me.axes.lastCubeProps.axis:yt=[1,1,1],d[0]=2/ue.drawingBufferWidth,d[1]=2/ue.drawingBufferHeight,Q.bind(),Te.view=Ve,Te.projection=Xe,Te.screenSize=d,Te.highlightId=me.highlightId,Te.highlightScale=me.highlightScale,Te.clipBounds=it,Te.pickGroup=me.pickId/255,Te.pixelRatio=Y;for(var bt=0;bt<3;++bt)if(le[bt]){Te.scale=me.projectScale[bt],Te.opacity=me.projectOpacity[bt];for(var mt=N,ht=0;ht<16;++ht)mt[ht]=0;for(var ht=0;ht<4;++ht)mt[5*ht]=1;mt[5*bt]=0,yt[bt]<0?mt[12+bt]=We[0][bt]:mt[12+bt]=We[1][bt],s(mt,Fe,mt),Te.model=mt;var qe=(bt+1)%3,ze=(bt+2)%3,Ae=D(y),Ke=D(R);Ae[qe]=1,Ke[ze]=1;var _t=E(Xe,Ve,Fe,j(L,Ae)),wt=E(Xe,Ve,Fe,j(z,Ke));if(Math.abs(_t[1])>Math.abs(wt[1])){var vt=_t;_t=wt,wt=vt,vt=Ae,Ae=Ke,Ke=vt;var $t=qe;qe=ze,ze=$t}_t[0]<0&&(Ae[qe]=-1),wt[1]>0&&(Ke[ze]=-1);for(var Yt=0,lr=0,ht=0;ht<4;++ht)Yt+=Math.pow(Fe[4*qe+ht],2),lr+=Math.pow(Fe[4*ze+ht],2);Ae[qe]/=Math.sqrt(Yt),Ke[ze]/=Math.sqrt(lr),Te.axes[0]=Ae,Te.axes[1]=Ke,Te.fragClipBounds[0]=q(U,it[0],bt,-1e8),Te.fragClipBounds[1]=q(U,it[1],bt,1e8),me.vao.bind(),me.vao.draw(ue.TRIANGLES,me.vertexCount),me.lineWidth>0&&(ue.lineWidth(me.lineWidth*Y),me.vao.draw(ue.LINES,me.lineVertexCount,me.vertexCount)),me.vao.unbind()}}var ye=[-1e8,-1e8,-1e8],pe=[1e8,1e8,1e8],ge=[ye,pe];function W(Q,me,ie,Y,le,ue,Te){var Fe=ie.gl;if((ue===ie.projectHasAlpha||Te)&&oe(me,ie,Y,le),ue===ie.hasAlpha||Te){Q.bind();var Ve=Q.uniforms;Ve.model=Y.model||p,Ve.view=Y.view||p,Ve.projection=Y.projection||p,d[0]=2/Fe.drawingBufferWidth,d[1]=2/Fe.drawingBufferHeight,Ve.screenSize=d,Ve.highlightId=ie.highlightId,Ve.highlightScale=ie.highlightScale,Ve.fragClipBounds=ge,Ve.clipBounds=ie.axes.bounds,Ve.opacity=ie.opacity,Ve.pickGroup=ie.pickId/255,Ve.pixelRatio=le,ie.vao.bind(),ie.vao.draw(Fe.TRIANGLES,ie.vertexCount),ie.lineWidth>0&&(Fe.lineWidth(ie.lineWidth*le),ie.vao.draw(Fe.LINES,ie.lineVertexCount,ie.vertexCount)),ie.vao.unbind()}}u.draw=function(Q){var me=this.useOrtho?this.orthoShader:this.shader;W(me,this.projectShader,this,Q,this.pixelRatio,!1,!1)},u.drawTransparent=function(Q){var me=this.useOrtho?this.orthoShader:this.shader;W(me,this.projectShader,this,Q,this.pixelRatio,!0,!1)},u.drawPick=function(Q){var me=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;W(me,this.pickProjectShader,this,Q,1,!0,!0)},u.pick=function(Q){if(!Q||Q.id!==this.pickId)return null;var me=Q.value[2]+(Q.value[1]<<8)+(Q.value[0]<<16);if(me>=this.pointCount||me<0)return null;var ie=this.points[me],Y=this._selectResult;Y.index=me;for(var le=0;le<3;++le)Y.position[le]=Y.dataCoordinate[le]=ie[le];return Y},u.highlight=function(Q){if(!Q)this.highlightId=[1,1,1,1];else{var me=Q.index,ie=me&255,Y=me>>8&255,le=me>>16&255;this.highlightId=[ie/255,Y/255,le/255,0]}};function ae(Q,me,ie,Y){var le;b(Q)?me0){var Xr=0,Ot=ze,Qe=[0,0,0,1],ct=[0,0,0,1],Ue=b(yt)&&b(yt[0]),Ie=b(ht)&&b(ht[0]);e:for(var Y=0;Y0?1-lr[0][0]:Ht<0?1+lr[1][0]:1,or*=or>0?1-lr[0][1]:or<0?1+lr[1][1]:1;for(var Cr=[Ht,or],ua=$t.cells||[],ta=$t.positions||[],wt=0;wt=a?(E=l,v+=1,v0?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,v=Math.sin(i),p=Math.cos(i);return r[0]=a+f*p-c*v,r[1]=s+f*v+c*p,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(v,p,T,l,g,b){this._gl=v,this._wrapper=p,this._index=T,this._locations=l,this._dimension=g,this._constFunc=b}var i=n.prototype;i.pointer=function(p,T,l,g){var b=this,A=b._gl,E=b._locations[b._index];A.vertexAttribPointer(E,b._dimension,p||A.FLOAT,!!T,l||0,g||0),A.enableVertexAttribArray(E)},i.set=function(v,p,T,l){return this._constFunc(this._locations[this._index],v,p,T,l)},Object.defineProperty(i,"location",{get:function(){return this._locations[this._index]},set:function(v){return v!==this._locations[this._index]&&(this._locations[this._index]=v|0,this._wrapper.program=null),v|0}});var a=[function(v,p,T){return T.length===void 0?v.vertexAttrib1f(p,T):v.vertexAttrib1fv(p,T)},function(v,p,T,l){return T.length===void 0?v.vertexAttrib2f(p,T,l):v.vertexAttrib2fv(p,T)},function(v,p,T,l,g){return T.length===void 0?v.vertexAttrib3f(p,T,l,g):v.vertexAttrib3fv(p,T)},function(v,p,T,l,g,b){return T.length===void 0?v.vertexAttrib4f(p,T,l,g,b):v.vertexAttrib4fv(p,T)}];function s(v,p,T,l,g,b,A){var E=a[g],_=new n(v,p,T,l,g,E);Object.defineProperty(b,A,{set:function(w){return v.disableVertexAttribArray(l[T]),E(v,l[T],w),w},get:function(){return _},enumerable:!0})}function f(v,p,T,l,g,b,A){for(var E=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(v,p,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(v,p,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(E,_,w,m,u){this.a=E,this.b=_,this.idx=w,this.lowerIds=m,this.upperIds=u}function c(E,_,w,m){this.a=E,this.b=_,this.type=w,this.idx=m}function v(E,_){var w=E.a[0]-_.a[0]||E.a[1]-_.a[1]||E.type-_.type;return w||E.type!==i&&(w=n(E.a,E.b,_.b),w)?w:E.idx-_.idx}function p(E,_){return n(E.a,E.b,_)}function T(E,_,w,m,u){for(var d=o.lt(_,m,p),y=o.gt(_,m,p),R=d;R1&&n(w[z[U-2]],w[z[U-1]],m)>0;)E.push([z[U-1],z[U-2],u]),U-=1;z.length=U,z.push(u);for(var N=L.upperIds,U=N.length;U>1&&n(w[N[U-2]],w[N[U-1]],m)<0;)E.push([N[U-2],N[U-1],u]),U-=1;N.length=U,N.push(u)}}function l(E,_){var w;return E.a[0]<_.a[0]?w=n(E.a,E.b,_.a):w=n(_.b,_.a,E.a),w||(_.b[0]L[0]&&u.push(new c(L,R,s,d),new c(R,L,a,d))}u.sort(v);for(var z=u[0].a[0]-(1+Math.abs(u[0].a[0]))*Math.pow(2,-52),N=[new f([z,1],[z,0],-1,[],[])],U=[],d=0,B=u.length;d0;){g=m.pop();for(var u=g.adjacent,d=0;d<=A;++d){var y=u[d];if(!(!y.boundary||y.lastVisited<=-E)){for(var R=y.vertices,L=0;L<=A;++L){var z=R[L];z<0?_[L]=b:_[L]=w[z]}var N=this.orient();if(N>0)return y;y.lastVisited=-E,N===0&&m.push(y)}}}return null},T.walk=function(g,b){var A=this.vertices.length-1,E=this.dimension,_=this.vertices,w=this.tuple,m=b?this.interior.length*Math.random()|0:this.interior.length-1,u=this.interior[m];e:for(;!u.boundary;){for(var d=u.vertices,y=u.adjacent,R=0;R<=E;++R)w[R]=_[d[R]];u.lastVisited=A;for(var R=0;R<=E;++R){var L=y[R];if(!(L.lastVisited>=A)){var z=w[R];w[R]=g;var N=this.orient();if(w[R]=z,N<0){u=L;continue e}else L.boundary?L.lastVisited=-A:L.lastVisited=A}}return}return u},T.addPeaks=function(g,b){var A=this.vertices.length-1,E=this.dimension,_=this.vertices,w=this.tuple,m=this.interior,u=this.simplices,d=[b];b.lastVisited=A,b.vertices[b.vertices.indexOf(-1)]=A,b.boundary=!1,m.push(b);for(var y=[];d.length>0;){var b=d.pop(),R=b.vertices,L=b.adjacent,z=R.indexOf(A);if(!(z<0)){for(var N=0;N<=E;++N)if(N!==z){var U=L[N];if(!(!U.boundary||U.lastVisited>=A)){var B=U.vertices;if(U.lastVisited!==-A){for(var D=0,j=0;j<=E;++j)B[j]<0?(D=j,w[j]=g):w[j]=_[B[j]];var q=this.orient();if(q>0){B[D]=A,U.boundary=!1,m.push(U),d.push(U),U.lastVisited=A;continue}else U.lastVisited=-A}var J=U.adjacent,oe=R.slice(),ye=L.slice(),pe=new i(oe,ye,!0);u.push(pe);var ge=J.indexOf(b);if(!(ge<0)){J[ge]=pe,ye[z]=U,oe[N]=-1,ye[N]=b,L[N]=pe,pe.flip();for(var j=0;j<=E;++j){var W=oe[j];if(!(W<0||W===A)){for(var ae=new Array(E-1),se=0,Q=0;Q<=E;++Q){var me=oe[Q];me<0||Q===j||(ae[se++]=me)}y.push(new a(ae,pe,j))}}}}}}}y.sort(s);for(var N=0;N+1=0?m[d++]=u[R]:y=R&1;if(y===(g&1)){var L=m[0];m[0]=m[1],m[1]=L}b.push(m)}}return b};function l(g,b){var A=g.length;if(A===0)throw new Error("Must have at least d+1 points");var E=g[0].length;if(A<=E)throw new Error("Must input at least d+1 points");var _=g.slice(0,E+1),w=o.apply(void 0,_);if(w===0)throw new Error("Input not in general position");for(var m=new Array(E+1),u=0;u<=E;++u)m[u]=u;w<0&&(m[0]=1,m[1]=0);for(var d=new i(m,new Array(E+1),!1),y=d.adjacent,R=new Array(E+2),u=0;u<=E;++u){for(var L=m.slice(),z=0;z<=E;++z)z===u&&(L[z]=-1);var N=L[0];L[0]=L[1],L[1]=N;var U=new i(L,new Array(E+1),!0);y[u]=U,R[u]=U}R[E+1]=d;for(var u=0;u<=E;++u)for(var L=y[u].vertices,B=y[u].adjacent,z=0;z<=E;++z){var D=L[z];if(D<0){B[z]=d;continue}for(var j=0;j<=E;++j)y[j].vertices.indexOf(D)<0&&(B[z]=y[j])}for(var q=new p(E,_,R),J=!!b,u=E+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=v({colormap:w,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),d=0;d<256;++d){for(var y=m[d],R=0;R<3;++R)u[4*d+R]=y[R];u[4*d+3]=y[3]*255}return c(u,[256,256,4],[4,0,1])}function b(w){for(var m=w.length,u=new Array(m),d=0;d0){var j=this.triShader;j.bind(),j.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||p,d=w.view||p,y=w.projection||p,R=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],L=0;L<3;++L)R[0][L]=Math.max(R[0][L],this.clipBounds[0][L]),R[1][L]=Math.min(R[1][L],this.clipBounds[1][L]);this._model=[].slice.call(u),this._view=[].slice.call(d),this._projection=[].slice.call(y),this._resolution=[m.drawingBufferWidth,m.drawingBufferHeight];var z={model:u,view:d,projection:y,clipBounds:R,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},N=this.pickShader;N.bind(),N.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],d=this.positions[u[1]].slice(0,3),y={position:d,dataCoordinate:d,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 E(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 d=u.shaders;arguments.length===1&&(m=w,w=m.gl);var y=A(w,d),R=E(w,d),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),N=n(w),U=n(w),B=n(w),D=n(w),j=i(w,[{buffer:z,type:w.FLOAT,size:4},{buffer:D,type:w.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:U,type:w.FLOAT,size:4},{buffer:B,type:w.FLOAT,size:2},{buffer:N,type:w.FLOAT,size:4}]),q=new T(w,L,y,R,z,N,D,U,B,j,u.traceType||"cone");return q.update(m),q}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,b,A){this.gl=l,this.shader=A,this.buffer=g,this.vao=b,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,b=this.shader.uniforms;this.shader.bind();var A=b.view=l.view||a,E=b.projection=l.projection||a;b.model=l.model||a,b.clipBounds=this.clipBounds,b.opacity=this.opacity;var _=A[12],w=A[13],m=A[14],u=A[15],d=l._ortho||!1,y=d?2:1,R=y*this.pixelRatio*(E[3]*_+E[7]*w+E[11]*m+E[15]*u)/g.drawingBufferHeight;this.vao.bind();for(var L=0;L<3;++L)g.lineWidth(this.lineWidth[L]*this.pixelRatio),b.capSize=this.capSize[L]*R,this.lineCount[L]&&g.drawArrays(g.LINES,this.lineOffset[L],this.lineCount[L]);this.vao.unbind()};function c(l,g){for(var b=0;b<3;++b)l[0][b]=Math.min(l[0][b],g[b]),l[1][b]=Math.max(l[1][b],g[b])}var v=function(){for(var l=new Array(3),g=0;g<3;++g){for(var b=[],A=1;A<=2;++A)for(var E=-1;E<=1;E+=2){var _=(A+g)%3,w=[0,0,0];w[_]=E,b.push(w)}l[g]=b}return l}();function p(l,g,b,A){for(var E=v[A],_=0;_0){var z=d.slice();z[m]+=R[1][m],E.push(d[0],d[1],d[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+p(E,z,L,m)}}}this.lineCount[m]=w-this.lineOffset[m]}this.buffer.update(E)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(l){var g=l.gl,b=o(g),A=n(g,[{buffer:b,type:g.FLOAT,size:3,offset:0,stride:40},{buffer:b,type:g.FLOAT,size:4,offset:12,stride:40},{buffer:b,type:g.FLOAT,size:3,offset:28,stride:40}]),E=i(g);E.attributes.position.location=0,E.attributes.color.location=1,E.attributes.offset.location=2;var _=new s(g,b,A,E);return _.update(l),_}},9215:function(e,t,r){e.exports=c;var o=r(4769),n=r(2478);function i(v,p,T){return Math.min(p,Math.max(v,T))}function a(v,p,T){this.dimension=v.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var l=0;l=T-1)for(var w=b.length-1,u=v-p[T-1],m=0;m=T-1){var _=b.length-1;v-p[T-1];for(var w=0;w=0;--T)if(v[--p])return!1;return!0},s.jump=function(v){var p=this.lastT(),T=this.dimension;if(!(v0;--m)l.push(i(E[m-1],_[m-1],arguments[m])),g.push(0)}},s.push=function(v){var p=this.lastT(),T=this.dimension;if(!(v1e-6?1/A:0;this._time.push(v);for(var u=T;u>0;--u){var d=i(_[u-1],w[u-1],arguments[u]);l.push(d),g.push((d-l[b++])*m)}}},s.set=function(v){var p=this.dimension;if(!(v0;--E)T.push(i(b[E-1],A[E-1],arguments[E])),l.push(0)}},s.move=function(v){var p=this.lastT(),T=this.dimension;if(!(v<=p||arguments.length!==T+1)){var l=this._state,g=this._velocity,b=l.length-this.dimension,A=this.bounds,E=A[0],_=A[1],w=v-p,m=w>1e-6?1/w:0;this._time.push(v);for(var u=T;u>0;--u){var d=arguments[u];l.push(i(E[u-1],_[u-1],l[b++]+d)),g.push(d*m)}}},s.idle=function(v){var p=this.lastT();if(!(v=0;--m)l.push(i(E[m],_[m],l[b]+w*g[b])),g.push(0),b+=1}};function f(v){for(var p=new Array(v),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=p?(u=1,y=p+2*g+A):(u=-g/p,y=g*u+A)):(u=0,b>=0?(d=0,y=A):-b>=l?(d=1,y=l+2*b+A):(d=-b/l,y=b*d+A));else if(d<0)d=0,g>=0?(u=0,y=A):-g>=p?(u=1,y=p+2*g+A):(u=-g/p,y=g*u+A);else{var R=1/m;u*=R,d*=R,y=u*(p*u+T*d+2*g)+d*(T*u+l*d+2*b)+A}else{var L,z,N,U;u<0?(L=T+g,z=l+b,z>L?(N=z-L,U=p-2*T+l,N>=U?(u=1,d=0,y=p+2*g+A):(u=N/U,d=1-u,y=u*(p*u+T*d+2*g)+d*(T*u+l*d+2*b)+A)):(u=0,z<=0?(d=1,y=l+2*b+A):b>=0?(d=0,y=A):(d=-b/l,y=b*d+A))):d<0?(L=T+b,z=p+g,z>L?(N=z-L,U=p-2*T+l,N>=U?(d=1,u=0,y=l+2*b+A):(d=N/U,u=1-d,y=u*(p*u+T*d+2*g)+d*(T*u+l*d+2*b)+A)):(d=0,z<=0?(u=1,y=p+2*g+A):g>=0?(u=0,y=A):(u=-g/p,y=g*u+A))):(N=l+b-T-g,N<=0?(u=0,d=1,y=l+2*b+A):(U=p-2*T+l,N>=U?(u=1,d=0,y=p+2*g+A):(u=N/U,d=1-u,y=u*(p*u+T*d+2*g)+d*(T*u+l*d+2*b)+A)))}for(var B=1-u-d,v=0;vb)for(l=b;lg)for(l=g;l=0){for(var B=U.type.charAt(U.type.length-1)|0,D=new Array(B),j=0;j=0;)q+=1;z[N]=q}var J=new Array(b.length);function oe(){_.program=a.program(w,_._vref,_._fref,L,z);for(var ye=0;yeie&&le>0){var ue=(Y[le][0]-ie)/(Y[le][0]-Y[le-1][0]);return Y[le][1]*(1-ue)+ue*Y[le-1][1]}}return 1}var j=[0,0,0],q={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 J(ie,Y){var le,ue,Te,Fe=Y.axes&&Y.axes.lastCubeProps.axis||j,Ve=Y.showSurface,Xe=Y.showContour;for(le=0;le<3;++le)for(Ve=Ve||Y.surfaceProject[le],ue=0;ue<3;++ue)Xe=Xe||Y.contourProject[le][ue];for(le=0;le<3;++le){var We=q.projections[le];for(ue=0;ue<16;++ue)We[ue]=0;for(ue=0;ue<4;++ue)We[5*ue]=1;We[5*le]=0,We[12+le]=Y.axesBounds[+(Fe[le]>0)][le],l(We,ie.model,We);var it=q.clipBounds[le];for(Te=0;Te<2;++Te)for(ue=0;ue<3;++ue)it[Te][ue]=ie.clipBounds[Te][ue];it[0][le]=-1e8,it[1][le]=1e8}return q.showSurface=Ve,q.showContour=Xe,q}var oe={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},ye=y.slice(),pe=[1,0,0,0,1,0,0,0,1];function ge(ie,Y){ie=ie||{};var le=this.gl;le.disable(le.CULL_FACE),this._colorMap.bind(0);var ue=oe;ue.model=ie.model||y,ue.view=ie.view||y,ue.projection=ie.projection||y,ue.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],ue.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],ue.objectOffset=this.objectOffset,ue.contourColor=this.contourColor[0],ue.inverseModel=g(ue.inverseModel,ue.model);for(var Te=0;Te<2;++Te)for(var Fe=ue.clipBounds[Te],Ve=0;Ve<3;++Ve)Fe[Ve]=Math.min(Math.max(this.clipBounds[Te][Ve],-1e8),1e8);ue.kambient=this.ambientLight,ue.kdiffuse=this.diffuseLight,ue.kspecular=this.specularLight,ue.roughness=this.roughness,ue.fresnel=this.fresnel,ue.opacity=this.opacity,ue.height=0,ue.permutation=pe,ue.vertexColor=this.vertexColor;var Xe=ye;for(l(Xe,ue.view,ue.model),l(Xe,ue.projection,Xe),g(Xe,Xe),Te=0;Te<3;++Te)ue.eyePosition[Te]=Xe[12+Te]/Xe[15];var We=Xe[15];for(Te=0;Te<3;++Te)We+=this.lightPosition[Te]*Xe[4*Te+3];for(Te=0;Te<3;++Te){var it=Xe[12+Te];for(Ve=0;Ve<3;++Ve)it+=Xe[4*Ve+Te]*this.lightPosition[Ve];ue.lightPosition[Te]=it/We}var yt=J(ue,this);if(yt.showSurface){for(this._shader.bind(),this._shader.uniforms=ue,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(le.TRIANGLES,this._vertexCount),Te=0;Te<3;++Te)!this.surfaceProject[Te]||!this.vertexCount||(this._shader.uniforms.model=yt.projections[Te],this._shader.uniforms.clipBounds=yt.clipBounds[Te],this._vao.draw(le.TRIANGLES,this._vertexCount));this._vao.unbind()}if(yt.showContour){var bt=this._contourShader;ue.kambient=1,ue.kdiffuse=0,ue.kspecular=0,ue.opacity=1,bt.bind(),bt.uniforms=ue;var mt=this._contourVAO;for(mt.bind(),Te=0;Te<3;++Te)for(bt.uniforms.permutation=L[Te],le.lineWidth(this.contourWidth[Te]*this.pixelRatio),Ve=0;Ve>4)/16)/255,Te=Math.floor(ue),Fe=ue-Te,Ve=Y[1]*(ie.value[1]+(ie.value[2]&15)/16)/255,Xe=Math.floor(Ve),We=Ve-Xe;Te+=1,Xe+=1;var it=le.position;it[0]=it[1]=it[2]=0;for(var yt=0;yt<2;++yt)for(var bt=yt?Fe:1-Fe,mt=0;mt<2;++mt)for(var ht=mt?We:1-We,qe=Te+yt,ze=Xe+mt,Ae=bt*ht,Ke=0;Ke<3;++Ke)it[Ke]+=this._field[Ke].get(qe,ze)*Ae;for(var _t=this._pickResult.level,wt=0;wt<3;++wt)if(_t[wt]=b.le(this.contourLevels[wt],it[wt]),_t[wt]<0)this.contourLevels[wt].length>0&&(_t[wt]=0);else if(_t[wt]Math.abs($t-it[wt])&&(_t[wt]+=1)}for(le.index[0]=Fe<.5?Te:Te+1,le.index[1]=We<.5?Xe:Xe+1,le.uv[0]=ue/Y[0],le.uv[1]=Ve/Y[1],Ke=0;Ke<3;++Ke)le.dataCoordinate[Ke]=this._field[Ke].get(le.index[0],le.index[1]);return le},B.padField=function(ie,Y){var le=Y.shape.slice(),ue=ie.shape.slice();c.assign(ie.lo(1,1).hi(le[0],le[1]),Y),c.assign(ie.lo(1).hi(le[0],1),Y.hi(le[0],1)),c.assign(ie.lo(1,ue[1]-1).hi(le[0],1),Y.lo(0,le[1]-1).hi(le[0],1)),c.assign(ie.lo(0,1).hi(1,le[1]),Y.hi(1)),c.assign(ie.lo(ue[0]-1,1).hi(1,le[1]),Y.lo(le[0]-1)),ie.set(0,0,Y.get(0,0)),ie.set(0,ue[1]-1,Y.get(0,le[1]-1)),ie.set(ue[0]-1,0,Y.get(le[0]-1,0)),ie.set(ue[0]-1,ue[1]-1,Y.get(le[0]-1,le[1]-1))};function ae(ie,Y){return Array.isArray(ie)?[Y(ie[0]),Y(ie[1]),Y(ie[2])]:[Y(ie),Y(ie),Y(ie)]}function se(ie){return Array.isArray(ie)?ie.length===3?[ie[0],ie[1],ie[2],1]:[ie[0],ie[1],ie[2],ie[3]]:[0,0,0,1]}function Q(ie){if(Array.isArray(ie)){if(Array.isArray(ie))return[se(ie[0]),se(ie[1]),se(ie[2])];var Y=se(ie);return[Y.slice(),Y.slice(),Y.slice()]}}B.update=function(ie){ie=ie||{},this.objectOffset=ie.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in ie&&(this.contourWidth=ae(ie.contourWidth,Number)),"showContour"in ie&&(this.showContour=ae(ie.showContour,Boolean)),"showSurface"in ie&&(this.showSurface=!!ie.showSurface),"contourTint"in ie&&(this.contourTint=ae(ie.contourTint,Boolean)),"contourColor"in ie&&(this.contourColor=Q(ie.contourColor)),"contourProject"in ie&&(this.contourProject=ae(ie.contourProject,function(Va){return ae(Va,Boolean)})),"surfaceProject"in ie&&(this.surfaceProject=ie.surfaceProject),"dynamicColor"in ie&&(this.dynamicColor=Q(ie.dynamicColor)),"dynamicTint"in ie&&(this.dynamicTint=ae(ie.dynamicTint,Number)),"dynamicWidth"in ie&&(this.dynamicWidth=ae(ie.dynamicWidth,Number)),"opacity"in ie&&(this.opacity=ie.opacity),"opacityscale"in ie&&(this.opacityscale=ie.opacityscale),"colorBounds"in ie&&(this.colorBounds=ie.colorBounds),"vertexColor"in ie&&(this.vertexColor=ie.vertexColor?1:0),"colormap"in ie&&this._colorMap.setPixels(this.genColormap(ie.colormap,this.opacityscale));var Y=ie.field||ie.coords&&ie.coords[2]||null,le=!1;if(Y||(this._field[2].shape[0]||this._field[2].shape[2]?Y=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):Y=this._field[2].hi(0,0)),"field"in ie||"coords"in ie){var ue=(Y.shape[0]+2)*(Y.shape[1]+2);ue>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(o.nextPow2(ue))),this._field[2]=p(this._field[2].data,[Y.shape[0]+2,Y.shape[1]+2]),this.padField(this._field[2],Y),this.shape=Y.shape.slice();for(var Te=this.shape,Fe=0;Fe<2;++Fe)this._field[2].size>this._field[Fe].data.length&&(s.freeFloat(this._field[Fe].data),this._field[Fe].data=s.mallocFloat(this._field[2].size)),this._field[Fe]=p(this._field[Fe].data,[Te[0]+2,Te[1]+2]);if(ie.coords){var Ve=ie.coords;if(!Array.isArray(Ve)||Ve.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(Fe=0;Fe<2;++Fe){var Xe=Ve[Fe];for(mt=0;mt<2;++mt)if(Xe.shape[mt]!==Te[mt])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[Fe],Xe)}}else if(ie.ticks){var We=ie.ticks;if(!Array.isArray(We)||We.length!==2)throw new Error("gl-surface: invalid ticks");for(Fe=0;Fe<2;++Fe){var it=We[Fe];if((Array.isArray(it)||it.length)&&(it=p(it)),it.shape[0]!==Te[Fe])throw new Error("gl-surface: invalid tick length");var yt=p(it.data,Te);yt.stride[Fe]=it.stride[0],yt.stride[Fe^1]=0,this.padField(this._field[Fe],yt)}}else{for(Fe=0;Fe<2;++Fe){var bt=[0,0];bt[Fe]=1,this._field[Fe]=p(this._field[Fe].data,[Te[0]+2,Te[1]+2],bt,0)}this._field[0].set(0,0,0);for(var mt=0;mt0){for(var Ma=0;Ma<5;++Ma)Sr.pop();Ue-=1}continue e}}}ua.push(Ue)}this._contourOffsets[Tr]=Fn,this._contourCounts[Tr]=ua}var Da=s.mallocFloat(Sr.length);for(Fe=0;Fe=0&&(m=_|0,w+=d*m,u-=m),new b(this.data,u,d,w)},A.step=function(_){var w=this.shape[0],m=this.stride[0],u=this.offset,d=0,y=Math.ceil;return typeof _=="number"&&(d=_|0,d<0?(u+=m*(w-1),w=y(-w/d)):w=y(w/d),m*=d),new b(this.data,w,m,u)},A.transpose=function(_){_=_===void 0?0:_|0;var w=this.shape,m=this.stride;return new b(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 d=l[w.length+1];return d(this.data,w,m,u)},function(_,w,m,u){return new b(_,w[0],m[0],u)}},2:function(T,l,g){function b(E,_,w,m,u,d){this.data=E,this.shape=[_,w],this.stride=[m,u],this.offset=d|0}var A=b.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 b(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,d=this.shape[0],y=this.shape[1],R=this.stride[0],L=this.stride[1];return typeof _=="number"&&_>=0&&(u=_|0,m+=R*u,d-=u),typeof w=="number"&&w>=0&&(u=w|0,m+=L*u,y-=u),new b(this.data,d,y,R,L,m)},A.step=function(_,w){var m=this.shape[0],u=this.shape[1],d=this.stride[0],y=this.stride[1],R=this.offset,L=0,z=Math.ceil;return typeof _=="number"&&(L=_|0,L<0?(R+=d*(m-1),m=z(-m/L)):m=z(m/L),d*=L),typeof w=="number"&&(L=w|0,L<0?(R+=y*(u-1),u=z(-u/L)):u=z(u/L),y*=L),new b(this.data,m,u,d,y,R)},A.transpose=function(_,w){_=_===void 0?0:_|0,w=w===void 0?1:w|0;var m=this.shape,u=this.stride;return new b(this.data,m[_],m[w],u[_],u[w],this.offset)},A.pick=function(_,w){var m=[],u=[],d=this.offset;typeof _=="number"&&_>=0?d=d+this.stride[0]*_|0:(m.push(this.shape[0]),u.push(this.stride[0])),typeof w=="number"&&w>=0?d=d+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,d)},function(_,w,m,u){return new b(_,w[0],w[1],m[0],m[1],u)}},3:function(T,l,g){function b(E,_,w,m,u,d,y,R){this.data=E,this.shape=[_,w,m],this.stride=[u,d,y],this.offset=R|0}var A=b.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 b(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,d=0,y=this.shape[0],R=this.shape[1],L=this.shape[2],z=this.stride[0],N=this.stride[1],U=this.stride[2];return typeof _=="number"&&_>=0&&(d=_|0,u+=z*d,y-=d),typeof w=="number"&&w>=0&&(d=w|0,u+=N*d,R-=d),typeof m=="number"&&m>=0&&(d=m|0,u+=U*d,L-=d),new b(this.data,y,R,L,z,N,U,u)},A.step=function(_,w,m){var u=this.shape[0],d=this.shape[1],y=this.shape[2],R=this.stride[0],L=this.stride[1],z=this.stride[2],N=this.offset,U=0,B=Math.ceil;return typeof _=="number"&&(U=_|0,U<0?(N+=R*(u-1),u=B(-u/U)):u=B(u/U),R*=U),typeof w=="number"&&(U=w|0,U<0?(N+=L*(d-1),d=B(-d/U)):d=B(d/U),L*=U),typeof m=="number"&&(U=m|0,U<0?(N+=z*(y-1),y=B(-y/U)):y=B(y/U),z*=U),new b(this.data,u,d,y,R,L,z,N)},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,d=this.stride;return new b(this.data,u[_],u[w],u[m],d[_],d[w],d[m],this.offset)},A.pick=function(_,w,m){var u=[],d=[],y=this.offset;typeof _=="number"&&_>=0?y=y+this.stride[0]*_|0:(u.push(this.shape[0]),d.push(this.stride[0])),typeof w=="number"&&w>=0?y=y+this.stride[1]*w|0:(u.push(this.shape[1]),d.push(this.stride[1])),typeof m=="number"&&m>=0?y=y+this.stride[2]*m|0:(u.push(this.shape[2]),d.push(this.stride[2]));var R=l[u.length+1];return R(this.data,u,d,y)},function(_,w,m,u){return new b(_,w[0],w[1],w[2],m[0],m[1],m[2],u)}},4:function(T,l,g){function b(E,_,w,m,u,d,y,R,L,z){this.data=E,this.shape=[_,w,m,u],this.stride=[d,y,R,L],this.offset=z|0}var A=b.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,d){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u,d):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*m+this.stride[3]*u]=d},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 b(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 d=this.offset,y=0,R=this.shape[0],L=this.shape[1],z=this.shape[2],N=this.shape[3],U=this.stride[0],B=this.stride[1],D=this.stride[2],j=this.stride[3];return typeof _=="number"&&_>=0&&(y=_|0,d+=U*y,R-=y),typeof w=="number"&&w>=0&&(y=w|0,d+=B*y,L-=y),typeof m=="number"&&m>=0&&(y=m|0,d+=D*y,z-=y),typeof u=="number"&&u>=0&&(y=u|0,d+=j*y,N-=y),new b(this.data,R,L,z,N,U,B,D,j,d)},A.step=function(_,w,m,u){var d=this.shape[0],y=this.shape[1],R=this.shape[2],L=this.shape[3],z=this.stride[0],N=this.stride[1],U=this.stride[2],B=this.stride[3],D=this.offset,j=0,q=Math.ceil;return typeof _=="number"&&(j=_|0,j<0?(D+=z*(d-1),d=q(-d/j)):d=q(d/j),z*=j),typeof w=="number"&&(j=w|0,j<0?(D+=N*(y-1),y=q(-y/j)):y=q(y/j),N*=j),typeof m=="number"&&(j=m|0,j<0?(D+=U*(R-1),R=q(-R/j)):R=q(R/j),U*=j),typeof u=="number"&&(j=u|0,j<0?(D+=B*(L-1),L=q(-L/j)):L=q(L/j),B*=j),new b(this.data,d,y,R,L,z,N,U,B,D)},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 d=this.shape,y=this.stride;return new b(this.data,d[_],d[w],d[m],d[u],y[_],y[w],y[m],y[u],this.offset)},A.pick=function(_,w,m,u){var d=[],y=[],R=this.offset;typeof _=="number"&&_>=0?R=R+this.stride[0]*_|0:(d.push(this.shape[0]),y.push(this.stride[0])),typeof w=="number"&&w>=0?R=R+this.stride[1]*w|0:(d.push(this.shape[1]),y.push(this.stride[1])),typeof m=="number"&&m>=0?R=R+this.stride[2]*m|0:(d.push(this.shape[2]),y.push(this.stride[2])),typeof u=="number"&&u>=0?R=R+this.stride[3]*u|0:(d.push(this.shape[3]),y.push(this.stride[3]));var L=l[d.length+1];return L(this.data,d,y,R)},function(_,w,m,u){return new b(_,w[0],w[1],w[2],w[3],m[0],m[1],m[2],m[3],u)}},5:function(l,g,b){function A(_,w,m,u,d,y,R,L,z,N,U,B){this.data=_,this.shape=[w,m,u,d,y],this.stride=[R,L,z,N,U],this.offset=B|0}var E=A.prototype;return E.dtype=l,E.dimension=5,Object.defineProperty(E,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(E,"order",{get:b}),E.set=function(w,m,u,d,y,R){return l==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*d+this.stride[4]*y,R):this.data[this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*d+this.stride[4]*y]=R},E.get=function(w,m,u,d,y){return l==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*d+this.stride[4]*y):this.data[this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*d+this.stride[4]*y]},E.index=function(w,m,u,d,y){return this.offset+this.stride[0]*w+this.stride[1]*m+this.stride[2]*u+this.stride[3]*d+this.stride[4]*y},E.hi=function(w,m,u,d,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 d!="number"||d<0?this.shape[3]:d|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)},E.lo=function(w,m,u,d,y){var R=this.offset,L=0,z=this.shape[0],N=this.shape[1],U=this.shape[2],B=this.shape[3],D=this.shape[4],j=this.stride[0],q=this.stride[1],J=this.stride[2],oe=this.stride[3],ye=this.stride[4];return typeof w=="number"&&w>=0&&(L=w|0,R+=j*L,z-=L),typeof m=="number"&&m>=0&&(L=m|0,R+=q*L,N-=L),typeof u=="number"&&u>=0&&(L=u|0,R+=J*L,U-=L),typeof d=="number"&&d>=0&&(L=d|0,R+=oe*L,B-=L),typeof y=="number"&&y>=0&&(L=y|0,R+=ye*L,D-=L),new A(this.data,z,N,U,B,D,j,q,J,oe,ye,R)},E.step=function(w,m,u,d,y){var R=this.shape[0],L=this.shape[1],z=this.shape[2],N=this.shape[3],U=this.shape[4],B=this.stride[0],D=this.stride[1],j=this.stride[2],q=this.stride[3],J=this.stride[4],oe=this.offset,ye=0,pe=Math.ceil;return typeof w=="number"&&(ye=w|0,ye<0?(oe+=B*(R-1),R=pe(-R/ye)):R=pe(R/ye),B*=ye),typeof m=="number"&&(ye=m|0,ye<0?(oe+=D*(L-1),L=pe(-L/ye)):L=pe(L/ye),D*=ye),typeof u=="number"&&(ye=u|0,ye<0?(oe+=j*(z-1),z=pe(-z/ye)):z=pe(z/ye),j*=ye),typeof d=="number"&&(ye=d|0,ye<0?(oe+=q*(N-1),N=pe(-N/ye)):N=pe(N/ye),q*=ye),typeof y=="number"&&(ye=y|0,ye<0?(oe+=J*(U-1),U=pe(-U/ye)):U=pe(U/ye),J*=ye),new A(this.data,R,L,z,N,U,B,D,j,q,J,oe)},E.transpose=function(w,m,u,d,y){w=w===void 0?0:w|0,m=m===void 0?1:m|0,u=u===void 0?2:u|0,d=d===void 0?3:d|0,y=y===void 0?4:y|0;var R=this.shape,L=this.stride;return new A(this.data,R[w],R[m],R[u],R[d],R[y],L[w],L[m],L[u],L[d],L[y],this.offset)},E.pick=function(w,m,u,d,y){var R=[],L=[],z=this.offset;typeof w=="number"&&w>=0?z=z+this.stride[0]*w|0:(R.push(this.shape[0]),L.push(this.stride[0])),typeof m=="number"&&m>=0?z=z+this.stride[1]*m|0:(R.push(this.shape[1]),L.push(this.stride[1])),typeof u=="number"&&u>=0?z=z+this.stride[2]*u|0:(R.push(this.shape[2]),L.push(this.stride[2])),typeof d=="number"&&d>=0?z=z+this.stride[3]*d|0:(R.push(this.shape[3]),L.push(this.stride[3])),typeof y=="number"&&y>=0?z=z+this.stride[4]*y|0:(R.push(this.shape[4]),L.push(this.stride[4]));var N=g[R.length+1];return N(this.data,R,L,z)},function(w,m,u,d){return new A(w,m[0],m[1],m[2],m[3],m[4],u[0],u[1],u[2],u[3],u[4],d)}}};function f(T,l){var g=l===-1?"T":String(l),b=s[g];return l===-1?b(T):l===0?b(T,v[T][0]):b(T,v[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 v={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function p(T,l,g,b){if(T===void 0){var u=v.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 E=A-1,_=1;E>=0;--E)g[E]=_,_*=l[E]}if(b===void 0){b=0;for(var E=0;E1e-6?(g[0]=A/m,g[1]=E/m,g[2]=_/m,g[3]=w/m):(g[0]=g[1]=g[2]=0,g[3]=1)}function p(g,b,A){this.radius=o([A]),this.center=o(b),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=p.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 b=this.computedRotation;v(b,b);var A=this.computedMatrix;i(A,b);var E=this.computedCenter,_=this.computedEye,w=this.computedUp,m=Math.exp(this.computedRadius[0]);_[0]=E[0]+m*A[2],_[1]=E[1]+m*A[6],_[2]=E[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 d=0,y=0;y<3;++y)d+=A[u+4*y]*_[y];A[12+u]=-d}},T.getMatrix=function(g,b){this.recalcMatrix(g);var A=this.computedMatrix;if(b){for(var E=0;E<16;++E)b[E]=A[E];return b}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,b,A,E){b=b||0,A=A||0,E=E||0,this.recalcMatrix(g);var _=this.computedMatrix,w=_[1],m=_[5],u=_[9],d=f(w,m,u);w/=d,m/=d,u/=d;var y=_[0],R=_[4],L=_[8],z=y*w+R*m+L*u;y-=w*z,R-=m*z,L-=u*z;var N=f(y,R,L);y/=N,R/=N,L/=N,_[2],_[6],_[10];var U=y*b+w*A,B=R*b+m*A,D=L*b+u*A;this.center.move(g,U,B,D);var j=Math.exp(this.computedRadius[0]);j=Math.max(1e-4,j+E),this.radius.set(g,Math.log(j))},T.rotate=function(g,b,A,E){this.recalcMatrix(g),b=b||0,A=A||0;var _=this.computedMatrix,w=_[0],m=_[4],u=_[8],d=_[1],y=_[5],R=_[9],L=_[2],z=_[6],N=_[10],U=b*w+A*d,B=b*m+A*y,D=b*u+A*R,j=-(z*D-N*B),q=-(N*U-L*D),J=-(L*B-z*U),oe=Math.sqrt(Math.max(0,1-Math.pow(j,2)-Math.pow(q,2)-Math.pow(J,2))),ye=c(j,q,J,oe);ye>1e-6?(j/=ye,q/=ye,J/=ye,oe/=ye):(j=q=J=0,oe=1);var pe=this.computedRotation,ge=pe[0],W=pe[1],ae=pe[2],se=pe[3],Q=ge*oe+se*j+W*J-ae*q,me=W*oe+se*q+ae*j-ge*J,ie=ae*oe+se*J+ge*q-W*j,Y=se*oe-ge*j-W*q-ae*J;if(E){j=L,q=z,J=N;var le=Math.sin(E)/f(j,q,J);j*=le,q*=le,J*=le,oe=Math.cos(b),Q=Q*oe+Y*j+me*J-ie*q,me=me*oe+Y*q+ie*j-Q*J,ie=ie*oe+Y*J+Q*q-me*j,Y=Y*oe-Q*j-me*q-ie*J}var ue=c(Q,me,ie,Y);ue>1e-6?(Q/=ue,me/=ue,ie/=ue,Y/=ue):(Q=me=ie=0,Y=1),this.rotation.set(g,Q,me,ie,Y)},T.lookAt=function(g,b,A,E){this.recalcMatrix(g),A=A||this.computedCenter,b=b||this.computedEye,E=E||this.computedUp;var _=this.computedMatrix;n(_,b,A,E);var w=this.computedRotation;s(w,_[0],_[1],_[2],_[4],_[5],_[6],_[8],_[9],_[10]),v(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]-b[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,b,A,E){this.center.move(g,b||0,A||0,E||0)},T.setMatrix=function(g,b){var A=this.computedRotation;s(A,b[0],b[1],b[2],b[4],b[5],b[6],b[8],b[9],b[10]),v(A,A),this.rotation.set(g,A[0],A[1],A[2],A[3]);var E=this.computedMatrix;a(E,b);var _=E[15];if(Math.abs(_)>1e-6){var w=E[12]/_,m=E[13]/_,u=E[14]/_;this.recalcMatrix(g);var d=Math.exp(this.computedRadius[0]);this.center.set(g,w-E[2]*d,m-E[6]*d,u-E[10]*d),this.radius.idle(g)}else this.center.idle(g),this.radius.idle(g)},T.setDistance=function(g,b){b>0&&this.radius.set(g,Math.log(b))},T.setDistanceLimits=function(g,b){g>0?g=Math.log(g):g=-1/0,b>0?b=Math.log(b):b=1/0,b=Math.max(b,g),this.radius.bounds[0][0]=g,this.radius.bounds[1][0]=b},T.getDistanceLimits=function(g){var b=this.radius.bounds;return g?(g[0]=Math.exp(b[0][0]),g[1]=Math.exp(b[1][0]),g):[Math.exp(b[0][0]),Math.exp(b[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 b=this.lastT(),A=g.center;A&&this.center.set(b,A[0],A[1],A[2]);var E=g.rotation;E&&this.rotation.set(b,E[0],E[1],E[2],E[3]);var _=g.distance;_&&_>0&&this.radius.set(b,Math.log(_)),this.setDistanceLimits(g.zoomMin,g.zoomMax)};function l(g){g=g||{};var b=g.center||[0,0,0],A=g.rotation||[0,0,0,1],E=g.radius||1;b=[].slice.call(b,0,3),A=[].slice.call(A,0,4),v(A,A);var _=new p(A,b,Math.log(E));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,v=1;Array.isArray(c);)f.push(c.length),v*=c.length,c=c[0];return f.length===0?o():(s||(s=o(new Float64Array(v),f)),n(s,a),s)}}},x={};function S(e){var t=x[e];if(t!==void 0)return t.exports;var r=x[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 k=S(1964);X.exports=k})()}}),k3=_e({"node_modules/color-name/index.js"(ee,X){X.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]}}}),C6=_e({"node_modules/color-normalize/node_modules/color-parse/index.js"(ee,X){var h=k3();X.exports=S;var x={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function S(k){var e,t=[],r=1,o;if(typeof k=="string")if(k=k.toLowerCase(),h[k])t=h[k].slice(),o="rgb";else if(k==="transparent")r=0,o="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(k)){var n=k.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(k)){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(p,T){if(/%$/.test(p))return T===i?parseFloat(p)/100:n==="rgb"?parseFloat(p)*255/100:parseFloat(p);if(n[T]==="h"){if(/deg$/.test(p))return parseFloat(p);if(x[p]!==void 0)return x[p]}return parseFloat(p)}),s===n&&t.push(1),r=f||t[i]===void 0?1:t[i],t=t.slice(0,i)}else k.length>10&&/[0-9](?:\s|\/)/.test(k)&&(t=k.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),o=k.match(/([a-z])/ig).join("").toLowerCase());else isNaN(k)?Array.isArray(k)||k.length?(t=[k[0],k[1],k[2]],o="rgb",r=k.length===4?k[3]:1):k instanceof Object&&(k.r!=null||k.red!=null||k.R!=null?(o="rgb",t=[k.r||k.red||k.R||0,k.g||k.green||k.G||0,k.b||k.blue||k.B||0]):(o="hsl",t=[k.h||k.hue||k.H||0,k.s||k.saturation||k.S||0,k.l||k.lightness||k.L||k.b||k.brightness]),r=k.a||k.alpha||k.opacity||1,k.opacity!=null&&(r/=100)):(o="rgb",t=[k>>>16,(k&65280)>>>8,k&255]);return{space:o,values:t,alpha:r}}}}),P6=_e({"node_modules/color-normalize/node_modules/color-rgba/index.js"(ee,X){var h=C6();X.exports=function(k){Array.isArray(k)&&k.raw&&(k=String.raw.apply(null,arguments));var e,t=h(k);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=x(e)),e.push(Math.min(Math.max(t.alpha,0),1)),e};function x(S){var k=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=k+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}}}),f1=_e({"node_modules/clamp/index.js"(ee,X){X.exports=h;function h(x,S,k){return Sk?k:x:xS?S:x}}}),Kb=_e({"node_modules/dtype/index.js"(ee,X){X.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}}}}),L0=_e({"node_modules/color-normalize/index.js"(ee,X){var h=P6(),x=f1(),S=Kb();X.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),k(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]=x(Math.floor(t[0]*255),0,255),n[1]=x(Math.floor(t[1]*255),0,255),n[2]=x(Math.floor(t[2]*255),0,255),n[3]=t[3]==null?255:x(Math.floor(t[3]*255),0,255)),n)};function k(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))}}}),Bv=_e({"src/lib/str2rgbarray.js"(ee,X){var h=L0();function x(S){return S?h(S):[0,0,0,1]}X.exports=x}}),Uv=_e({"src/lib/gl_format_color.js"(ee,X){var h=jn(),x=bs(),S=L0(),k=Ho(),e=Hl().defaultLine,t=lo().isArrayOrTypedArray,r=S(e),o=1;function n(c,v){var p=c;return p[3]*=v,p}function i(c){if(h(c))return r;var v=S(c);return v.length?v:r}function a(c){return h(c)?c:o}function s(c,v,p){var T=c.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),g=t(v),b=k.extractOpts(c),A=[],E,_,w,m,u;if(b.colorscale!==void 0?E=k.makeColorScaleFuncFromTrace(c):E=i,l?_=function(y,R){return y[R]===void 0?r:S(E(y[R]))}:_=i,g?w=function(y,R){return y[R]===void 0?o:a(y[R])}:w=a,l||g)for(var d=0;d0){var p=o.c2l(c);o._lowerLogErrorBound||(o._lowerLogErrorBound=p),o._lowerErrorBound=Math.min(o._lowerLogErrorBound,p)}}else i[a]=[-s[0]*r,s[1]*r]}return i}function S(e){for(var t=0;t-1?-1:R.indexOf("right")>-1?1:0}function b(R){return R==null?0:R.indexOf("top")>-1?-1:R.indexOf("bottom")>-1?1:0}function A(R){var L=0,z=0,N=[L,z];if(Array.isArray(R))for(var U=0;U=0){var J=T(j.position,j.delaunayColor,j.delaunayAxis);J.opacity=R.opacity,this.delaunayMesh?this.delaunayMesh.update(J):(J.gl=L,this.delaunayMesh=k(J),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)},p.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(R,L){var z=new v(R,L.uid);return z.update(L),z}X.exports=y}}),P3=_e({"src/traces/scatter3d/attributes.js"(ee,X){var h=Ff(),x=es(),S=tc(),k=ff().axisHoverFormat,{hovertemplateAttrs:e,texttemplateAttrs:t,templatefallbackAttrs:r}=fu(),o=Zs(),n=C3(),i=Jb(),a=po().extendFlat,s=nc().overrideAll,f=ec(),c=h.line,v=h.marker,p=v.line,T=a({width:c.width,dash:{valType:"enumerated",values:f(n),dflt:"solid"}},S("line"));function l(b){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=X.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:k("x"),yhoverformat:k("y"),zhoverformat:k("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({},v.size,{dflt:8}),sizeref:v.sizeref,sizemin:v.sizemin,sizemode:v.sizemode,opacity:a({},v.opacity,{arrayOk:!1}),colorbar:v.colorbar,line:a({width:a({},p.width,{arrayOk:!1})},S("marker.line"))},S("marker")),textposition:a({},h.textposition,{dflt:"top center"}),textfont:x({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"}}),D6=_e({"src/traces/scatter3d/defaults.js"(ee,X){var h=bi(),x=kn(),S=Ps(),k=lp(),e=yp(),t=_p(),r=P3();X.exports=function(i,a,s,f){function c(E,_){return x.coerce(i,a,r,E,_)}var v=o(i,a,c,f);if(!v){a.visible=!1;return}c("text"),c("hovertext"),c("hovertemplate"),c("hovertemplatefallback"),c("xhoverformat"),c("yhoverformat"),c("zhoverformat"),c("mode"),S.hasMarkers(a)&&k(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 p=(a.line||{}).color,T=(a.marker||{}).color;c("surfaceaxis")>=0&&c("surfacecolor",p||T);for(var l=["x","y","z"],g=0;g<3;++g){var b="projection."+l[g];c(b+".show")&&(c(b+".opacity"),c(b+".scale"))}var A=h.getComponentMethod("errorbars","supplyDefaults");A(i,a,p||T||s,{axis:"z"}),A(i,a,p||T||s,{axis:"y",inherit:"z"}),A(i,a,p||T||s,{axis:"x",inherit:"z"})};function o(n,i,a,s){var f=0,c=a("x"),v=a("y"),p=a("z"),T=h.getComponentMethod("calendars","handleTraceDefaults");return T(n,i,["x","y","z"],s),c&&v&&p&&(f=Math.min(c.length,v.length,p.length),i._length=i._xlength=i._ylength=i._zlength=f),f}}}),R6=_e({"src/traces/scatter3d/calc.js"(ee,X){var h=lv(),x=xp();X.exports=function(k,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return h(t,e),x(k,e),t}}}),O6=_e({"node_modules/get-canvas-context/index.js"(ee,X){X.exports=h;function h(x,S){if(typeof x!="string")throw new TypeError("must specify type string");if(S=S||{},typeof document>"u"&&!S.canvas)return null;var k=S.canvas||document.createElement("canvas");typeof S.width=="number"&&(k.width=S.width),typeof S.height=="number"&&(k.height=S.height);var e=S,t;try{var r=[x];x.indexOf("webgl")===0&&r.push("experimental-"+x);for(var o=0;o/g," "));i[a]=v,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 p=0;p<2;++p)r.bounds[p][a]=t.glplot.bounds[p][a]}t.contourLevels=k(i)}}}),U6=_e({"src/plots/gl3d/scene.js"(ee,X){var h=cd().gl_plot3d,x=h.createCamera,S=h.createScene,k=z6(),e=y_(),t=bi(),r=kn(),o=r.preserveDrawingBuffer(),n=xs(),i=zf(),a=Bv(),s=L3(),f=Yw(),c=F6(),v=N6(),p=B6(),T=Td().applyAutorangeOptions,l,g,b=!1;function A(z,N){var U=document.createElement("div"),B=z.container;this.graphDiv=z.graphDiv;var D=document.createElementNS("http://www.w3.org/2000/svg","svg");D.style.position="absolute",D.style.top=D.style.left="0px",D.style.width=D.style.height="100%",D.style["z-index"]=20,D.style["pointer-events"]="none",U.appendChild(D),this.svgContainer=D,U.id=z.id,U.style.position="absolute",U.style.top=U.style.left="0px",U.style.width=U.style.height="100%",B.appendChild(U),this.fullLayout=N,this.id=z.id||"scene",this.fullSceneLayout=N[this.id],this.plotArgs=[[],{},{}],this.axesOptions=c(N,N[this.id]),this.spikeOptions=v(N[this.id]),this.container=U,this.staticMode=!!z.staticPlot,this.pixelRatio=this.pixelRatio||z.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=t.getComponentMethod("annotations3d","convert"),this.drawAnnotations=t.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var E=A.prototype;E.prepareOptions=function(){var z=this,N={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=k({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!g))throw new Error("error creating static canvas/context for image server");N.gl=g,N.canvas=l}return N};var _=!0;E.tryCreatePlot=function(){var z=this,N=z.prepareOptions(),U=!0;try{z.glplot=S(N)}catch{if(z.staticMode||!_||o)U=!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=N.glOptions.preserveDrawingBuffer=!0,z.glplot=S(N)}catch{o=N.glOptions.preserveDrawingBuffer=!1,U=!1}}}return _=!1,U},E.initializeGLCamera=function(){var z=this,N=z.fullSceneLayout.camera,U=N.projection.type==="orthographic";z.camera=x(z.container,{center:[N.center.x,N.center.y,N.center.z],eye:[N.eye.x,N.eye.y,N.eye.z],up:[N.up.x,N.up.y,N.up.z],_ortho:U,zoomMin:.01,zoomMax:100,mode:"orbit"})},E.initializeGLPlot=function(){var z=this;z.initializeGLCamera();var N=z.tryCreatePlot();if(!N)return s(z);z.traces={},z.make4thDimension();var U=z.graphDiv,B=U.layout,D=function(){var q={};return z.isCameraChanged(B)&&(q[z.id+".camera"]=z.getCamera()),z.isAspectChanged(B)&&(q[z.id+".aspectratio"]=z.glplot.getAspectratio(),B[z.id].aspectmode!=="manual"&&(z.fullSceneLayout.aspectmode=B[z.id].aspectmode=q[z.id+".aspectmode"]="manual")),q},j=function(q){if(q.fullSceneLayout.dragmode!==!1){var J=D();q.saveLayout(B),q.graphDiv.emit("plotly_relayout",J)}};return z.glplot.canvas&&(z.glplot.canvas.addEventListener("mouseup",function(){j(z)}),z.glplot.canvas.addEventListener("touchstart",function(){b=!0}),z.glplot.canvas.addEventListener("wheel",function(q){if(U._context._scrollZoom.gl3d){if(z.camera._ortho){var J=q.deltaX>q.deltaY?1.1:.9090909090909091,oe=z.glplot.getAspectratio();z.glplot.setAspectratio({x:J*oe.x,y:J*oe.y,z:J*oe.z})}j(z)}},e?{passive:!1}:!1),z.glplot.canvas.addEventListener("mousemove",function(){if(z.fullSceneLayout.dragmode!==!1&&z.camera.mouseListener.buttons!==0){var q=D();z.graphDiv.emit("plotly_relayouting",q)}}),z.staticMode||z.glplot.canvas.addEventListener("webglcontextlost",function(q){U&&U.emit&&U.emit("plotly_webglcontextlost",{event:q,layer:z.id})},!1)),z.glplot.oncontextloss=function(){z.recoverContext()},z.glplot.onrender=function(){z.render()},!0},E.render=function(){var z=this,N=z.graphDiv,U,B=z.svgContainer,D=z.container.getBoundingClientRect();N._fullLayout._calcInverseTransform(N);var j=N._fullLayout._invScaleX,q=N._fullLayout._invScaleY,J=D.width*j,oe=D.height*q;B.setAttributeNS(null,"viewBox","0 0 "+J+" "+oe),B.setAttributeNS(null,"width",J),B.setAttributeNS(null,"height",oe),p(z),z.glplot.axes.update(z.axesOptions);for(var ye=Object.keys(z.traces),pe=null,ge=z.glplot.selection,W=0;W")):U.type==="isosurface"||U.type==="volume"?(ie.valueLabel=n.hoverLabelText(z._mockAxis,z._mockAxis.d2l(ge.traceCoordinate[3]),U.valuehoverformat),Fe.push("value: "+ie.valueLabel),ge.textLabel&&Fe.push(ge.textLabel),Te=Fe.join("
")):Te=ge.textLabel;var Ve={x:ge.traceCoordinate[0],y:ge.traceCoordinate[1],z:ge.traceCoordinate[2],data:Q._input,fullData:Q,curveNumber:Q.index,pointNumber:me};i.appendArrayPointValue(Ve,Q,me),U._module.eventData&&(Ve=Q._module.eventData(Ve,ge,Q,{},me));var Xe={points:[Ve]};if(z.fullSceneLayout.hovermode){var We=[];i.loneHover({trace:Q,x:(.5+.5*se[0]/se[3])*J,y:(.5-.5*se[1]/se[3])*oe,xLabel:ie.xLabel,yLabel:ie.yLabel,zLabel:ie.zLabel,text:Te,name:pe.name,color:i.castHoverOption(Q,me,"bgcolor")||pe.color,borderColor:i.castHoverOption(Q,me,"bordercolor"),fontFamily:i.castHoverOption(Q,me,"font.family"),fontSize:i.castHoverOption(Q,me,"font.size"),fontColor:i.castHoverOption(Q,me,"font.color"),nameLength:i.castHoverOption(Q,me,"namelength"),textAlign:i.castHoverOption(Q,me,"align"),hovertemplate:r.castOption(Q,me,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Ve,ie),eventData:[Ve]},{container:B,gd:N,inOut_bbox:We}),Ve.bbox=We[0]}ge.distance<5&&(ge.buttons||b)?N.emit("plotly_click",Xe):N.emit("plotly_hover",Xe),this.oldEventData=Xe}else i.loneUnhover(B),this.oldEventData&&N.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;z.drawAnnotations(z)},E.recoverContext=function(){var z=this;z.glplot.dispose();var N=function(){if(z.glplot.gl.isContextLost()){requestAnimationFrame(N);return}if(!z.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}z.plot.apply(z,z.plotArgs)};requestAnimationFrame(N)};var w=["xaxis","yaxis","zaxis"];function m(z,N,U){for(var B=z.fullSceneLayout,D=0;D<3;D++){var j=w[D],q=j.charAt(0),J=B[j],oe=N[q],ye=N[q+"calendar"],pe=N["_"+q+"length"];if(!r.isArrayOrTypedArray(oe))U[0][D]=Math.min(U[0][D],0),U[1][D]=Math.max(U[1][D],pe-1);else for(var ge,W=0;W<(pe||oe.length);W++)if(r.isArrayOrTypedArray(oe[W]))for(var ae=0;aeQ[1][q])Q[0][q]=-1,Q[1][q]=1;else{var it=Q[1][q]-Q[0][q];Q[0][q]-=it/32,Q[1][q]+=it/32}if(ie=[Q[0][q],Q[1][q]],ie=T(ie,oe),Q[0][q]=ie[0],Q[1][q]=ie[1],oe.isReversed()){var yt=Q[0][q];Q[0][q]=Q[1][q],Q[1][q]=yt}}else ie=oe.range,Q[0][q]=oe.r2l(ie[0]),Q[1][q]=oe.r2l(ie[1]);Q[0][q]===Q[1][q]&&(Q[0][q]-=1,Q[1][q]+=1),oe.range=[Q[0][q],Q[1][q]],oe.limitRange(),B.glplot.setBounds(q,{min:oe.range[0]*ae[q],max:oe.range[1]*ae[q]})}var bt,mt=pe.aspectmode;if(mt==="cube")bt=[1,1,1];else if(mt==="manual"){var ht=pe.aspectratio;bt=[ht.x,ht.y,ht.z]}else if(mt==="auto"||mt==="data"){var qe=[1,1,1];for(q=0;q<3;++q){oe=pe[w[q]],ye=oe.type;var ze=me[ye];qe[q]=Math.pow(ze.acc,1/ze.count)/ae[q]}mt==="data"||Math.max.apply(null,qe)/Math.min.apply(null,qe)<=4?bt=qe:bt=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");pe.aspectratio.x=ge.aspectratio.x=bt[0],pe.aspectratio.y=ge.aspectratio.y=bt[1],pe.aspectratio.z=ge.aspectratio.z=bt[2],B.glplot.setAspectratio(pe.aspectratio),B.viewInitial.aspectratio||(B.viewInitial.aspectratio={x:pe.aspectratio.x,y:pe.aspectratio.y,z:pe.aspectratio.z}),B.viewInitial.aspectmode||(B.viewInitial.aspectmode=pe.aspectmode);var Ae=pe.domain||null,Ke=N._size||null;if(Ae&&Ke){var _t=B.container.style;_t.position="absolute",_t.left=Ke.l+Ae.x[0]*Ke.w+"px",_t.top=Ke.t+(1-Ae.y[1])*Ke.h+"px",_t.width=Ke.w*(Ae.x[1]-Ae.x[0])+"px",_t.height=Ke.h*(Ae.y[1]-Ae.y[0])+"px"}B.glplot.redraw()}},E.destroy=function(){var z=this;z.glplot&&(z.camera.mouseListener.enabled=!1,z.container.removeEventListener("wheel",z.camera.wheelListener),z.camera=null,z.glplot.dispose(),z.container.parentNode.removeChild(z.container),z.glplot=null)};function d(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"}}}E.getCamera=function(){var z=this;return z.camera.view.recalcMatrix(z.camera.view.lastT()),y(z.camera)},E.setViewport=function(z){var N=this,U=z.camera;N.camera.lookAt.apply(this,d(U)),N.glplot.setAspectratio(z.aspectratio);var B=U.projection.type==="orthographic",D=N.camera._ortho;B!==D&&(N.glplot.redraw(),N.glplot.clearRGBA(),N.glplot.dispose(),N.initializeGLPlot())},E.isCameraChanged=function(z){var N=this,U=N.getCamera(),B=r.nestedProperty(z,N.id+".camera"),D=B.get();function j(ye,pe,ge,W){var ae=["up","center","eye"],se=["x","y","z"];return pe[ae[ge]]&&ye[ae[ge]][se[W]]===pe[ae[ge]][se[W]]}var q=!1;if(D===void 0)q=!0;else{for(var J=0;J<3;J++)for(var oe=0;oe<3;oe++)if(!j(U,D,J,oe)){q=!0;break}(!D.projection||U.projection&&U.projection.type!==D.projection.type)&&(q=!0)}return q},E.isAspectChanged=function(z){var N=this,U=N.glplot.getAspectratio(),B=r.nestedProperty(z,N.id+".aspectratio"),D=B.get();return D===void 0||D.x!==U.x||D.y!==U.y||D.z!==U.z},E.saveLayout=function(z){var N=this,U=N.fullLayout,B,D,j,q,J,oe,ye=N.isCameraChanged(z),pe=N.isAspectChanged(z),ge=ye||pe;if(ge){var W={};if(ye&&(B=N.getCamera(),D=r.nestedProperty(z,N.id+".camera"),j=D.get(),W[N.id+".camera"]=j),pe&&(q=N.glplot.getAspectratio(),J=r.nestedProperty(z,N.id+".aspectratio"),oe=J.get(),W[N.id+".aspectratio"]=oe),t.call("_storeDirectGUIEdit",z,U._preGUI,W),ye){D.set(B);var ae=r.nestedProperty(U,N.id+".camera");ae.set(B)}if(pe){J.set(q);var se=r.nestedProperty(U,N.id+".aspectratio");se.set(q),N.glplot.redraw()}}return ge},E.updateFx=function(z,N){var U=this,B=U.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 D=U.graphDiv,j=D._fullLayout,q=U.fullSceneLayout.camera,J=q.up.x,oe=q.up.y,ye=q.up.z;if(ye/Math.sqrt(J*J+oe*oe+ye*ye)<.999){var pe=U.id+".camera.up",ge={x:0,y:0,z:1},W={};W[pe]=ge;var ae=D.layout;t.call("_storeDirectGUIEdit",ae,j._preGUI,W),q.up=ge,r.nestedProperty(ae,pe).set(ge)}}else B.keyBindingMode=z;U.fullSceneLayout.hovermode=N};function R(z,N,U){for(var B=0,D=U-1;B0)for(var J=255/q,oe=0;oe<3;++oe)z[j+oe]=Math.min(J*z[j+oe],255)}}E.toImage=function(z){var N=this;z||(z="png"),N.staticMode&&N.container.appendChild(l),N.glplot.redraw();var U=N.glplot.gl,B=U.drawingBufferWidth,D=U.drawingBufferHeight;U.bindFramebuffer(U.FRAMEBUFFER,null);var j=new Uint8Array(B*D*4);U.readPixels(0,0,B,D,U.RGBA,U.UNSIGNED_BYTE,j),R(j,B,D),L(j,B,D);var q=document.createElement("canvas");q.width=B,q.height=D;var J=q.getContext("2d",{willReadFrequently:!0}),oe=J.createImageData(B,D);oe.data.set(j),J.putImageData(oe,0,0);var ye;switch(z){case"jpeg":ye=q.toDataURL("image/jpeg");break;case"webp":ye=q.toDataURL("image/webp");break;default:ye=q.toDataURL("image/png")}return N.staticMode&&N.container.removeChild(l),ye},E.setConvert=function(){for(var z=this,N=0;N<3;N++){var U=z.fullSceneLayout[w[N]];n.setConvert(U,z.fullLayout),U.setScale=r.noop}},E.make4thDimension=function(){var z=this,N=z.graphDiv,U=N._fullLayout;z._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},n.setConvert(z._mockAxis,U)},X.exports=A}}),j6=_e({"src/plots/gl3d/layout/attributes.js"(ee,X){X.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),I3=_e({"src/plots/gl3d/layout/axis_attributes.js"(ee,X){var h=so(),x=Ih(),S=po().extendFlat,k=nc().overrideAll;X.exports=k({visible:x.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:x.color,categoryorder:x.categoryorder,categoryarray:x.categoryarray,title:{text:x.title.text,font:x.title.font},type:S({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorange:x.autorange,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},rangemode:x.rangemode,minallowed:x.minallowed,maxallowed:x.maxallowed,range:S({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,mirror:x.mirror,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,tickfont:x.tickfont,tickangle:x.tickangle,tickprefix:x.tickprefix,showtickprefix:x.showtickprefix,ticksuffix:x.ticksuffix,showticksuffix:x.showticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickformat:x.tickformat,tickformatstops:x.tickformatstops,hoverformat:x.hoverformat,showline:x.showline,linecolor:x.linecolor,linewidth:x.linewidth,showgrid:x.showgrid,gridcolor:S({},x.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:x.gridwidth,zeroline:x.zeroline,zerolinecolor:x.zerolinecolor,zerolinewidth:x.zerolinewidth},"plot","from-root")}}),D3=_e({"src/plots/gl3d/layout/layout_attributes.js"(ee,X){var h=I3(),x=hf().attributes,S=po().extendFlat,k=kn().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"}}X.exports={_arrayAttrRegexps:[k("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:x({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis: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"}}}),V6=_e({"src/plots/gl3d/layout/axis_defaults.js"(ee,X){var h=bs().mix,x=kn(),S=ou(),k=I3(),e=$w(),t=Ly(),r=["xaxis","yaxis","zaxis"],o=100*136/187;X.exports=function(i,a,s){var f,c;function v(l,g){return x.coerce(f,c,k,l,g)}for(var p=0;p1;function v(p){if(!c){var T=h.validate(a[p],t[p]);if(T)return a[p]}}k(a,s,f,{type:o,attributes:t,handleDefaults:n,fullLayout:s,font:s.font,fullData:f,getDfltFromLayout:v,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function n(i,a,s,f){for(var c=s("bgcolor"),v=x.combine(c,f.paper_bgcolor),p=["up","center","eye"],T=0;T.999)&&(E="turntable")}else E="turntable";s("dragmode",E),s("hovermode",f.getDfltFromLayout("hovermode"))}}}),I0=_e({"src/plots/gl3d/index.js"(ee){var X=nc().overrideAll,h=wf(),x=U6(),S=xl().getSubplotData,k=kn(),e=Ol(),t="gl3d",r="scene";ee.name=t,ee.attr=r,ee.idRoot=r,ee.idRegex=ee.attrRegex=k.counterRegex("scene"),ee.attributes=j6(),ee.layoutAttributes=D3(),ee.baseLayoutAttrOverrides=X({hoverlabel:h.hoverlabel},"plot","nested"),ee.supplyLayoutDefaults=q6(),ee.plot=function(n){for(var i=n._fullLayout,a=n._fullData,s=i._subplots[t],f=0;f0){R=f[L];break}return R}function T(d,y){if(!(d<1||y<1)){for(var R=v(d),L=v(y),z=1,N=0;NA;)L--,L/=p(L),L++,L1?z:1};function E(d,y,R){var L=R[8]+R[2]*y[0]+R[5]*y[1];return d[0]=(R[6]+R[0]*y[0]+R[3]*y[1])/L,d[1]=(R[7]+R[1]*y[0]+R[4]*y[1])/L,d}function _(d,y,R){return w(d,y,E,R),d}function w(d,y,R,L){for(var z=[0,0],N=d.shape[0],U=d.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];zoe&&(this.minValues[j]=oe),this.maxValues[j]f&&(o.isomin=null,o.isomax=null);var c=a("x"),v=a("y"),p=a("z"),T=a("value");if(!c||!c.length||!v||!v.length||!p||!p.length||!T||!T.length){o.visible=!1;return}var l=x.getComponentMethod("calendars","handleTraceDefaults");l(r,o,["x","y","z"],i),a("valuehoverformat"),["x","y","z"].forEach(function(E){a(E+"hoverformat");var _="caps."+E,w=a(_+".show");w&&a(_+".fill");var m="slices."+E,u=a(m+".show");u&&(a(m+".fill"),a(m+".locations"))});var g=a("spaceframe.show");g&&a("spaceframe.fill");var b=a("surface.show");b&&(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(E){a(E)}),k(r,o,i,a,{prefix:"",cLetter:"c"}),o._length=null}X.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),ex=_e({"src/traces/streamtube/calc.js"(ee,X){var h=kn(),x=ko();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=k(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,v=1/0,p;for(p=0;p1&&(u=o[a-1],y=n[a-1],L=i[a-1]),s=0;su?"-":"+")+"x"),A=A.replace("y",(d>y?"-":"+")+"y"),A=A.replace("z",(R>L?"-":"+")+"z");var B=function(){a=0,z=[],N=[],U=[]};(!a||a0;v--){var p=Math.min(c[v],c[v-1]),T=Math.max(c[v],c[v-1]);if(T>p&&p-1}function le(Ot,Qe){return Ot===null?Qe:Ot}function ue(Ot,Qe,ct){ye();var Ue=[Qe],Ie=[ct];if(Q>=1)Ue=[Qe],Ie=[ct];else if(Q>0){var Pe=ie(Qe,ct);Ue=Pe.xyzv,Ie=Pe.abc}for(var Be=0;Be-1?ct[ft]:oe(Bt,Nt,Ht);Cr>-1?at[ft]=Cr:at[ft]=ge(Bt,Nt,Ht,le(Ot,or))}W(at[0],at[1],at[2])}}function Te(Ot,Qe,ct){var Ue=function(Ie,Pe,Be){ue(Ot,[Qe[Ie],Qe[Pe],Qe[Be]],[ct[Ie],ct[Pe],ct[Be]])};Ue(0,1,2),Ue(2,3,0)}function Fe(Ot,Qe,ct){var Ue=function(Ie,Pe,Be){ue(Ot,[Qe[Ie],Qe[Pe],Qe[Be]],[ct[Ie],ct[Pe],ct[Be]])};Ue(0,1,2),Ue(3,0,1),Ue(2,3,0),Ue(1,2,3)}function Ve(Ot,Qe,ct,Ue){var Ie=Ot[3];IeUe&&(Ie=Ue);for(var Pe=(Ot[3]-Ie)/(Ot[3]-Qe[3]+1e-9),Be=[],at=0;at<4;at++)Be[at]=(1-Pe)*Ot[at]+Pe*Qe[at];return Be}function Xe(Ot,Qe,ct){return Ot>=Qe&&Ot<=ct}function We(Ot){var Qe=.001*(B-U);return Ot>=U-Qe&&Ot<=B+Qe}function it(Ot){for(var Qe=[],ct=0;ct<4;ct++){var Ue=Ot[ct];Qe.push([f._x[Ue],f._y[Ue],f._z[Ue],f._value[Ue]])}return Qe}var yt=3;function bt(Ot,Qe,ct,Ue,Ie,Pe){Pe||(Pe=1),ct=[-1,-1,-1];var Be=!1,at=[Xe(Qe[0][3],Ue,Ie),Xe(Qe[1][3],Ue,Ie),Xe(Qe[2][3],Ue,Ie)];if(!at[0]&&!at[1]&&!at[2])return!1;var ft=function(Nt,Ht,or){return We(Ht[0][3])&&We(Ht[1][3])&&We(Ht[2][3])?(ue(Nt,Ht,or),!0):Peat?[z,Pe]:[Pe,N];lr(Qe,ft[0],ft[1])}}var Bt=[[Math.min(U,N),Math.max(U,N)],[Math.min(z,B),Math.max(z,B)]];["x","y","z"].forEach(function(Nt){for(var Ht=[],or=0;or0&&(ua.push(ma.id),Nt==="x"?ta.push([ma.distRatio,0,0]):Nt==="y"?ta.push([0,ma.distRatio,0]):ta.push([0,0,ma.distRatio]))}else Nt==="x"?Fn=ln(1,u-1):Nt==="y"?Fn=ln(1,d-1):Fn=ln(1,y-1);ua.length>0&&(Nt==="x"?Ht[Cr]=dr(Ot,ua,Sr,Tr,ta,Ht[Cr]):Nt==="y"?Ht[Cr]=Nr(Ot,ua,Sr,Tr,ta,Ht[Cr]):Ht[Cr]=Fr(Ot,ua,Sr,Tr,ta,Ht[Cr]),Cr++),Fn.length>0&&(Nt==="x"?Ht[Cr]=_t(Ot,Fn,Sr,Tr,Ht[Cr]):Nt==="y"?Ht[Cr]=wt(Ot,Fn,Sr,Tr,Ht[Cr]):Ht[Cr]=vt(Ot,Fn,Sr,Tr,Ht[Cr]),Cr++)}var Jn=f.caps[Nt];Jn.show&&Jn.fill&&(me(Jn.fill),Nt==="x"?Ht[Cr]=_t(Ot,[0,u-1],Sr,Tr,Ht[Cr]):Nt==="y"?Ht[Cr]=wt(Ot,[0,d-1],Sr,Tr,Ht[Cr]):Ht[Cr]=vt(Ot,[0,y-1],Sr,Tr,Ht[Cr]),Cr++)}}),b===0&&pe(),f._meshX=D,f._meshY=j,f._meshZ=q,f._meshIntensity=J,f._Xs=_,f._Ys=w,f._Zs=m}return Xr(),f}function s(f,c){var v=f.glplot.gl,p=h({gl:v}),T=new o(f,p,c.uid);return p._trace=T,T.update(c),f.glplot.add(p),T}X.exports={findNearestOnAxis:r,generateIsoMeshes:a,createIsosurfaceTrace:s}}}),Z6=_e({"src/traces/isosurface/index.js"(ee,X){X.exports={attributes:Qb(),supplyDefaults:O3().supplyDefaults,calc:z3(),colorbar:{min:"cmin",max:"cmax"},plot:tx().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:I0(),categories:["gl3d","showLegend"],meta:{}}}}),K6=_e({"lib/isosurface.js"(ee,X){X.exports=Z6()}}),F3=_e({"src/traces/volume/attributes.js"(ee,X){var h=tc(),x=Qb(),S=h1(),k=Zs(),e=po().extendFlat,t=nc().overrideAll,r=X.exports=t(e({x:x.x,y:x.y,z:x.z,value:x.value,isomin:x.isomin,isomax:x.isomax,surface:x.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:x.slices,caps:x.caps,text:x.text,hovertext:x.hovertext,xhoverformat:x.xhoverformat,yhoverformat:x.yhoverformat,zhoverformat:x.zhoverformat,valuehoverformat:x.valuehoverformat,hovertemplate:x.hovertemplate,hovertemplatefallback:x.hovertemplatefallback},h("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:x.colorbar,opacity:x.opacity,opacityscale:S.opacityscale,lightposition:x.lightposition,lighting:x.lighting,flatshading:x.flatshading,contour:x.contour,hoverinfo:e({},k.hoverinfo),showlegend:e({},k.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}}),J6=_e({"src/traces/volume/defaults.js"(ee,X){var h=kn(),x=F3(),S=O3().supplyIsoDefaults,k=R3().opacityscaleDefaults;X.exports=function(t,r,o,n){function i(a,s){return h.coerce(t,r,x,a,s)}S(t,r,o,n,i),k(t,r,n,i)}}}),Q6=_e({"src/traces/volume/convert.js"(ee,X){var h=cd().gl_mesh3d,x=Uv().parseColorScale,S=kn().isArrayOrTypedArray,k=Bv(),e=Ho().extractOpts,t=Og(),r=tx().findNearestOnAxis,o=tx().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],v=this.data._meshY[f],p=this.data._meshZ[f],T=this.data._Ys.length,l=this.data._Zs.length,g=r(c,this.data._Xs).id,b=r(v,this.data._Ys).id,A=r(p,this.data._Zs).id,E=s.index=A+l*b+l*T*g;s.traceCoordinate=[this.data._meshX[E],this.data._meshY[E],this.data._meshZ[E],this.data._value[E]];var _=this.data.hovertext||this.data.text;return S(_)&&_[E]!==void 0?s.textLabel=_[E]:_&&(s.textLabel=_),!0}},i.update=function(s){var f=this.scene,c=f.fullSceneLayout;this.data=o(s);function v(b,A,E,_){return A.map(function(w){return b.d2l(w,0,_)*E})}var p=t(v(c.xaxis,s._meshX,f.dataScale[0],s.xcalendar),v(c.yaxis,s._meshY,f.dataScale[1],s.ycalendar),v(c.zaxis,s._meshZ,f.dataScale[2],s.zcalendar)),T=t(s._meshI,s._meshJ,s._meshK),l={positions:p,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:k(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=x(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,v=h({gl:c}),p=new n(s,v,f.uid);return v._trace=p,p.update(f),s.glplot.add(v),p}X.exports=a}}),eP=_e({"src/traces/volume/index.js"(ee,X){X.exports={attributes:F3(),supplyDefaults:J6(),calc:z3(),colorbar:{min:"cmin",max:"cmax"},plot:Q6(),moduleType:"trace",name:"volume",basePlotModule:I0(),categories:["gl3d","showLegend"],meta:{}}}}),tP=_e({"lib/volume.js"(ee,X){X.exports=eP()}}),rP=_e({"src/traces/mesh3d/defaults.js"(ee,X){var h=bi(),x=kn(),S=Oa(),k=Rg();X.exports=function(t,r,o,n){function i(v,p){return x.coerce(t,r,k,v,p)}function a(v){var p=v.map(function(T){var l=i(T);return l&&x.isArrayOrTypedArray(l)?l:null});return p.every(function(T){return T&&T.length===p[0].length})&&p}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(v){i(v)});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}}}),nP=_e({"src/traces/mesh3d/calc.js"(ee,X){var h=ko();X.exports=function(S,k){k.intensity&&h(S,k,{vals:k.intensity,containerStr:"",cLetter:"c"})}}}),aP=_e({"src/traces/mesh3d/convert.js"(ee,X){var h=cd().gl_mesh3d,x=cd().delaunay_triangulate,S=cd().alpha_shape,k=cd().convex_hull,e=Uv().parseColorScale,t=kn().isArrayOrTypedArray,r=Bv(),o=Ho().extractOpts,n=Og();function i(l,g,b){this.scene=l,this.uid=b,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 b=this.data.hovertext||this.data.text;return t(b)&&b[g]!==void 0?l.textLabel=b[g]:b&&(l.textLabel=b),!0}};function s(l){for(var g=[],b=l.length,A=0;A=g-.5)return!1;return!0}a.update=function(l){var g=this.scene,b=g.fullSceneLayout;this.data=l;var A=l.x.length,E=n(f(b.xaxis,l.x,g.dataScale[0],l.xcalendar),f(b.yaxis,l.y,g.dataScale[1],l.ycalendar),f(b.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||!p(l.i,A)||!p(l.j,A)||!p(l.k,A))return;_=n(c(l.i),c(l.j),c(l.k))}else l.alphahull===0?_=k(E):l.alphahull>0?_=S(l.alphahull,E):_=v(l.delaunayaxis,E);var w={positions:E,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 b=l.glplot.gl,A=h({gl:b}),E=new i(l,A,g.uid);return A._trace=E,E.update(g),l.glplot.add(A),E}X.exports=T}}),iP=_e({"src/traces/mesh3d/index.js"(ee,X){X.exports={attributes:Rg(),supplyDefaults:rP(),calc:nP(),colorbar:{min:"cmin",max:"cmax"},plot:aP(),moduleType:"trace",name:"mesh3d",basePlotModule:I0(),categories:["gl3d","showLegend"],meta:{}}}}),oP=_e({"lib/mesh3d.js"(ee,X){X.exports=iP()}}),N3=_e({"src/traces/cone/attributes.js"(ee,X){var h=tc(),x=ff().axisHoverFormat,{hovertemplateAttrs:S,templatefallbackAttrs:k}=fu(),e=Rg(),t=Zs(),r=po().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:k({editType:"calc"}),uhoverformat:x("u",1),vhoverformat:x("v",1),whoverformat:x("w",1),xhoverformat:x("x"),yhoverformat:x("y"),zhoverformat:x("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"}),X.exports=o}}),sP=_e({"src/traces/cone/defaults.js"(ee,X){var h=kn(),x=Oa(),S=N3();X.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"),v=n("z");if(!i||!i.length||!a||!a.length||!s||!s.length||!f||!f.length||!c||!c.length||!v||!v.length){t.visible=!1;return}var p=n("sizemode");n("sizeref",p==="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"),x(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}}}),lP=_e({"src/traces/cone/calc.js"(ee,X){var h=ko();X.exports=function(S,k){for(var e=k.u,t=k.v,r=k.w,o=Math.min(k.x.length,k.y.length,k.z.length,e.length,t.length,r.length),n=-1/0,i=1/0,a=0;a2?p=c.slice(1,v-1):v===2?p=[(c[0]+c[1])/2]:p=c,p}function a(c){var v=c.length;return v===1?[.5,.5]:[c[1]-c[0],c[v-1]-c[v-2]]}function s(c,v){var p=c.fullSceneLayout,T=c.dataScale,l=v._len,g={};function b(ge,W){var ae=p[W],se=T[r[W]];return S.simpleMap(ge,function(Q){return ae.d2l(Q)*se})}if(g.vectors=t(b(v._u,"xaxis"),b(v._v,"yaxis"),b(v._w,"zaxis"),l),!l)return{positions:[],cells:[]};var A=b(v._Xs,"xaxis"),E=b(v._Ys,"yaxis"),_=b(v._Zs,"zaxis");g.meshgrid=[A,E,_],g.gridFill=v._gridFill;var w=v._slen;if(w)g.startingPositions=t(b(v._startsX,"xaxis"),b(v._startsY,"yaxis"),b(v._startsZ,"zaxis"));else{for(var m=E[0],u=i(A),d=i(_),y=new Array(u.length*d.length),R=0,L=0;Lm&&(m=R[0]),R[1]u&&(u=R[1])}function y(R){switch(R.type){case"GeometryCollection":R.geometries.forEach(y);break;case"Point":d(R.coordinates);break;case"MultiPoint":R.coordinates.forEach(d);break}}b.arcs.forEach(function(R){for(var L=-1,z=R.length,N;++Lm&&(m=N[0]),N[1]u&&(u=N[1])});for(E in b.objects)y(b.objects[E]);return[_,w,m,u]}function e(b,A){for(var E,_=b.length,w=_-A;w<--_;)E=b[w],b[w++]=b[_],b[_]=E}function t(b,A){return typeof A=="string"&&(A=b.objects[A]),A.type==="GeometryCollection"?{type:"FeatureCollection",features:A.geometries.map(function(E){return r(b,E)})}:r(b,A)}function r(b,A){var E=A.id,_=A.bbox,w=A.properties==null?{}:A.properties,m=o(b,A);return E==null&&_==null?{type:"Feature",properties:w,geometry:m}:_==null?{type:"Feature",id:E,properties:w,geometry:m}:{type:"Feature",id:E,bbox:_,properties:w,geometry:m}}function o(b,A){var E=S(b.transform),_=b.arcs;function w(L,z){z.length&&z.pop();for(var N=_[L<0?~L:L],U=0,B=N.length;U1)_=s(b,A,E);else for(w=0,_=new Array(m=b.arcs.length);w1)for(var z=1,N=d(R[0]),U,B;zN&&(B=R[0],R[0]=R[z],R[z]=B,N=U);return R}).filter(function(y){return y.length>0})}}function p(b,A){for(var E=0,_=b.length;E<_;){var w=E+_>>>1;b[w]=2))throw new Error("n must be ≥2");y=b.bbox||k(b);var E=y[0],_=y[1],w=y[2],m=y[3],u;A={scale:[w-E?(w-E)/(u-1):1,m-_?(m-_)/(u-1):1],translate:[E,_]}}else y=b.bbox;var d=l(A),y,R,L=b.objects,z={};function N(D){return d(D)}function U(D){var j;switch(D.type){case"GeometryCollection":j={type:"GeometryCollection",geometries:D.geometries.map(U)};break;case"Point":j={type:"Point",coordinates:N(D.coordinates)};break;case"MultiPoint":j={type:"MultiPoint",coordinates:D.coordinates.map(N)};break;default:return D}return D.id!=null&&(j.id=D.id),D.bbox!=null&&(j.bbox=D.bbox),D.properties!=null&&(j.properties=D.properties),j}function B(D){var j=0,q=1,J=D.length,oe,ye=new Array(J);for(ye[0]=d(D[0],0);++j0&&(k.push(e),e=[])}return e.length>0&&k.push(e),k},ee.makeLine=function(h){return h.length===1?{type:"LineString",coordinates:h[0]}:{type:"MultiLineString",coordinates:h}},ee.makePolygon=function(h){if(h.length===1)return{type:"Polygon",coordinates:h};for(var x=new Array(h.length),S=0;Se(U,z)),N)}function r(L,z,N={}){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 D=0;Dr(U,z)),N)}function n(L,z,N={}){if(L.length<2)throw new Error("coordinates must be an array of two or more positions");return S({type:"LineString",coordinates:L},z,N)}function i(L,z,N={}){return a(L.map(U=>n(U,z)),N)}function a(L,z={}){const N={type:"FeatureCollection"};return z.id&&(N.id=z.id),z.bbox&&(N.bbox=z.bbox),N.features=L,N}function s(L,z,N={}){return S({type:"MultiLineString",coordinates:L},z,N)}function f(L,z,N={}){return S({type:"MultiPoint",coordinates:L},z,N)}function c(L,z,N={}){return S({type:"MultiPolygon",coordinates:L},z,N)}function v(L,z,N={}){return S({type:"GeometryCollection",geometries:L},z,N)}function p(L,z=0){if(z&&!(z>=0))throw new Error("precision must be a positive number");const N=Math.pow(10,z||0);return Math.round(L*N)/N}function T(L,z="kilometers"){const N=h[z];if(!N)throw new Error(z+" units is invalid");return L*N}function l(L,z="kilometers"){const N=h[z];if(!N)throw new Error(z+" units is invalid");return L/N}function g(L,z){return E(l(L,z))}function b(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 E(L){return L%(2*Math.PI)*180/Math.PI}function _(L){return L%360*Math.PI/180}function w(L,z="kilometers",N="kilometers"){if(!(L>=0))throw new Error("length must be a positive number");return T(l(L,z),N)}function m(L,z="meters",N="kilometers"){if(!(L>=0))throw new Error("area must be a positive number");const U=x[z];if(!U)throw new Error("invalid original units");const B=x[N];if(!B)throw new Error("invalid final units");return L/U*B}function u(L){return!isNaN(L)&&L!==null&&!Array.isArray(L)}function d(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 R(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")}ee.areaFactors=x,ee.azimuthToBearing=A,ee.bearingToAzimuth=b,ee.convertArea=m,ee.convertLength=w,ee.degreesToRadians=_,ee.earthRadius=X,ee.factors=h,ee.feature=S,ee.featureCollection=a,ee.geometry=k,ee.geometryCollection=v,ee.isNumber=u,ee.isObject=d,ee.lengthToDegrees=g,ee.lengthToRadians=l,ee.lineString=n,ee.lineStrings=i,ee.multiLineString=s,ee.multiPoint=f,ee.multiPolygon=c,ee.point=e,ee.points=t,ee.polygon=r,ee.polygons=o,ee.radiansToDegrees=E,ee.radiansToLength=T,ee.round=p,ee.validateBBox=y,ee.validateId=R}}),ix=_e({"node_modules/@turf/meta/dist/cjs/index.cjs"(ee){Object.defineProperty(ee,"__esModule",{value:!0});var X=ax();function h(l,g,b){if(l!==null)for(var A,E,_,w,m,u,d,y=0,R=0,L,z=l.type,N=z==="FeatureCollection",U=z==="Feature",B=N?l.features.length:1,D=0;Du||N>d||U>y){m=R,u=A,d=N,y=U,_=0;return}var B=X.lineString.call(void 0,[m,R],b.properties);if(g(B,A,E,U,_)===!1)return!1;_++,m=R})===!1)return!1}}})}function f(l,g,b){var A=b,E=!1;return s(l,function(_,w,m,u,d){E===!1&&b===void 0?A=_:A=g(A,_,w,m,u,d),E=!0}),A}function c(l,g){if(!l)throw new Error("geojson is required");i(l,function(b,A,E){if(b.geometry!==null){var _=b.geometry.type,w=b.geometry.coordinates;switch(_){case"LineString":if(g(b,A,E,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 k(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],p=f[0]*t,T=c[1]*t,l=v[0]*t;a+=(l-p)*Math.sin(T),s++}return a*e}var o=x;ee.area=x,ee.default=o}}),bP=_e({"node_modules/@turf/centroid/dist/cjs/index.cjs"(ee){Object.defineProperty(ee,"__esModule",{value:!0});var X=ax(),h=ix();function x(k,e={}){let t=0,r=0,o=0;return h.coordEach.call(void 0,k,function(n){t+=n[0],r+=n[1],o++},!0),X.point.call(void 0,[t/o,r/o],e.properties)}var S=x;ee.centroid=x,ee.default=S}}),xP=_e({"node_modules/@turf/bbox/dist/cjs/index.cjs"(ee){Object.defineProperty(ee,"__esModule",{value:!0});var X=ix();function h(S,k={}){if(S.bbox!=null&&k.recompute!==!0)return S.bbox;const e=[1/0,1/0,-1/0,-1/0];return X.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[N+1][0]<0)return N;return null}switch(w==="RUS"||w==="FJI"?u=function(z){var N;if(L(z)===null)N=z;else for(N=new Array(z.length),R=0;RN?U[B++]=[z[R][0]+360,z[R][1]]:R===N?(U[B++]=z[R],U[B++]=[z[R][0],-90]):U[B++]=z[R];var D=i.tester(U);D.pts.pop(),m.push(D)}:u=function(z){m.push(i.tester(z))},E.type){case"MultiPolygon":for(d=0;d<_.length;d++)for(y=0;y<_[d].length;y++)u(_[d][y]);break;case"Polygon":for(d=0;d<_.length;d++)u(_[d]);break}return m}function p(A){var E=A.geojson,_=window.PlotlyGeoAssets||{},w=typeof E=="string"?_[E]:E;return o(w)?w:(r.error("Oops ... something went wrong when fetching "+E),!1)}function T(A){var E=A[0].trace,_=p(E);if(!_)return!1;var w={},m=[],u;for(u=0;u0?D.properties.ct=l(D):D.properties.ct=[NaN,NaN],U.fIn=z,U.fOut=D,m.push(D)}else r.log(["Location",U.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete w[N]}switch(_.type){case"FeatureCollection":var R=_.features;for(u=0;um&&(m=y,_=d)}else _=E;return k(_).geometry.coordinates}function g(A){var E=window.PlotlyGeoAssets||{},_=[];function w(R){return new Promise(function(L,z){h.json(R,function(N,U){if(N){delete E[R];var B=N.status===404?'GeoJSON at URL "'+R+'" does not exist.':"Unexpected error while fetching from "+R;return z(new Error(B))}return E[R]=U,L(U)})})}function m(R){return new Promise(function(L,z){var N=0,U=setInterval(function(){if(E[R]&&E[R]!=="pending")return clearInterval(U),L(E[R]);if(N>100)return clearInterval(U),z("Unexpected error while fetching from "+R);N++},50)})}for(var u=0;u")}}}),TP=_e({"src/traces/scattergeo/event_data.js"(ee,X){X.exports=function(x,S,k,e,t){x.lon=S.lon,x.lat=S.lat,x.location=S.loc?S.loc:null;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x}}}),AP=_e({"src/traces/scattergeo/select.js"(ee,X){var h=Ps(),x=qn().BADNUM;X.exports=function(k,e){var t=k.cd,r=k.xaxis,o=k.yaxis,n=[],i=t[0].trace,a,s,f,c,v,p=!h.hasMarkers(i)&&!h.hasText(i);if(p)return[];if(e===!1)for(v=0;vQ?1:se>=Q?0:NaN}function S(se){return se.length===1&&(se=k(se)),{left:function(Q,me,ie,Y){for(ie==null&&(ie=0),Y==null&&(Y=Q.length);ie>>1;se(Q[le],me)<0?ie=le+1:Y=le}return ie},right:function(Q,me,ie,Y){for(ie==null&&(ie=0),Y==null&&(Y=Q.length);ie>>1;se(Q[le],me)>0?Y=le:ie=le+1}return ie}}}function k(se){return function(Q,me){return x(se(Q),me)}}var e=S(x),t=e.right,r=e.left;function o(se,Q){Q==null&&(Q=n);for(var me=0,ie=se.length-1,Y=se[0],le=new Array(ie<0?0:ie);mese?1:Q>=se?0:NaN}function s(se){return se===null?NaN:+se}function f(se,Q){var me=se.length,ie=0,Y=-1,le=0,ue,Te,Fe=0;if(Q==null)for(;++Y1)return Fe/(ie-1)}function c(se,Q){var me=f(se,Q);return me&&Math.sqrt(me)}function v(se,Q){var me=se.length,ie=-1,Y,le,ue;if(Q==null){for(;++ie=Y)for(le=ue=Y;++ieY&&(le=Y),ue=Y)for(le=ue=Y;++ieY&&(le=Y),ue0)return[se];if((ie=Q0)for(se=Math.ceil(se/Te),Q=Math.floor(Q/Te),ue=new Array(le=Math.ceil(Q-se+1));++Y=0?(le>=E?10:le>=_?5:le>=w?2:1)*Math.pow(10,Y):-Math.pow(10,-Y)/(le>=E?10:le>=_?5:le>=w?2:1)}function d(se,Q,me){var ie=Math.abs(Q-se)/Math.max(0,me),Y=Math.pow(10,Math.floor(Math.log(ie)/Math.LN10)),le=ie/Y;return le>=E?Y*=10:le>=_?Y*=5:le>=w&&(Y*=2),QWe;)it.pop(),--yt;var bt=new Array(yt+1),mt;for(le=0;le<=yt;++le)mt=bt[le]=[],mt.x0=le>0?it[le-1]:Xe,mt.x1=le=1)return+me(se[ie-1],ie-1,se);var ie,Y=(ie-1)*Q,le=Math.floor(Y),ue=+me(se[le],le,se),Te=+me(se[le+1],le+1,se);return ue+(Te-ue)*(Y-le)}}function z(se,Q,me){return se=l.call(se,s).sort(x),Math.ceil((me-Q)/(2*(L(se,.75)-L(se,.25))*Math.pow(se.length,-1/3)))}function N(se,Q,me){return Math.ceil((me-Q)/(3.5*c(se)*Math.pow(se.length,-1/3)))}function U(se,Q){var me=se.length,ie=-1,Y,le;if(Q==null){for(;++ie=Y)for(le=Y;++iele&&(le=Y)}else for(;++ie=Y)for(le=Y;++iele&&(le=Y);return le}function B(se,Q){var me=se.length,ie=me,Y=-1,le,ue=0;if(Q==null)for(;++Y=0;)for(ue=se[Q],me=ue.length;--me>=0;)le[--Y]=ue[me];return le}function q(se,Q){var me=se.length,ie=-1,Y,le;if(Q==null){for(;++ie=Y)for(le=Y;++ieY&&(le=Y)}else for(;++ie=Y)for(le=Y;++ieY&&(le=Y);return le}function J(se,Q){for(var me=Q.length,ie=new Array(me);me--;)ie[me]=se[Q[me]];return ie}function oe(se,Q){if(me=se.length){var me,ie=0,Y=0,le,ue=se[Y];for(Q==null&&(Q=x);++ie0?1:br<0?-1:0},m=Math.sqrt,u=Math.tan;function d(br){return br>1?0:br<-1?n:Math.acos(br)}function y(br){return br>1?i:br<-1?-i:Math.asin(br)}function R(br){return(br=_(br/2))*br}function L(){}function z(br,qr){br&&U.hasOwnProperty(br.type)&&U[br.type](br,qr)}var N={Feature:function(br,qr){z(br.geometry,qr)},FeatureCollection:function(br,qr){for(var An=br.features,vn=-1,Xn=An.length;++vn=0?1:-1,Xn=vn*An,Na=l(qr),Ra=_(qr),pi=W*Ra,xi=ge*Na+pi*l(Xn),$i=pi*vn*_(Xn);q.add(T($i,xi)),pe=br,ge=Na,W=Ra}function Y(br){return J.reset(),j(br,ae),J*2}function le(br){return[T(br[1],br[0]),y(br[2])]}function ue(br){var qr=br[0],An=br[1],vn=l(An);return[vn*l(qr),vn*_(qr),_(An)]}function Te(br,qr){return br[0]*qr[0]+br[1]*qr[1]+br[2]*qr[2]}function Fe(br,qr){return[br[1]*qr[2]-br[2]*qr[1],br[2]*qr[0]-br[0]*qr[2],br[0]*qr[1]-br[1]*qr[0]]}function Ve(br,qr){br[0]+=qr[0],br[1]+=qr[1],br[2]+=qr[2]}function Xe(br,qr){return[br[0]*qr,br[1]*qr,br[2]*qr]}function We(br){var qr=m(br[0]*br[0]+br[1]*br[1]+br[2]*br[2]);br[0]/=qr,br[1]/=qr,br[2]/=qr}var it,yt,bt,mt,ht,qe,ze,Ae,Ke=S(),_t,wt,vt={point:$t,lineStart:lr,lineEnd:dr,polygonStart:function(){vt.point=Nr,vt.lineStart=Fr,vt.lineEnd=ln,Ke.reset(),ae.polygonStart()},polygonEnd:function(){ae.polygonEnd(),vt.point=$t,vt.lineStart=lr,vt.lineEnd=dr,q<0?(it=-(bt=180),yt=-(mt=90)):Ke>r?mt=90:Ke<-r&&(yt=-90),wt[0]=it,wt[1]=bt},sphere:function(){it=-(bt=180),yt=-(mt=90)}};function $t(br,qr){_t.push(wt=[it=br,bt=br]),qrmt&&(mt=qr)}function Yt(br,qr){var An=ue([br*c,qr*c]);if(Ae){var vn=Fe(Ae,An),Xn=[vn[1],-vn[0],0],Na=Fe(Xn,vn);We(Na),Na=le(Na);var Ra=br-ht,pi=Ra>0?1:-1,xi=Na[0]*f*pi,$i,ni=v(Ra)>180;ni^(pi*htmt&&(mt=$i)):(xi=(xi+360)%360-180,ni^(pi*htmt&&(mt=qr))),ni?brzr(it,bt)&&(bt=br):zr(br,bt)>zr(it,bt)&&(it=br):bt>=it?(brbt&&(bt=br)):br>ht?zr(it,br)>zr(it,bt)&&(bt=br):zr(br,bt)>zr(it,bt)&&(it=br)}else _t.push(wt=[it=br,bt=br]);qrmt&&(mt=qr),Ae=An,ht=br}function lr(){vt.point=Yt}function dr(){wt[0]=it,wt[1]=bt,vt.point=$t,Ae=null}function Nr(br,qr){if(Ae){var An=br-ht;Ke.add(v(An)>180?An+(An>0?360:-360):An)}else qe=br,ze=qr;ae.point(br,qr),Yt(br,qr)}function Fr(){ae.lineStart()}function ln(){Nr(qe,ze),ae.lineEnd(),v(Ke)>r&&(it=-(bt=180)),wt[0]=it,wt[1]=bt,Ae=null}function zr(br,qr){return(qr-=br)<0?qr+360:qr}function Xr(br,qr){return br[0]-qr[0]}function Ot(br,qr){return br[0]<=br[1]?br[0]<=qr&&qr<=br[1]:qrzr(vn[0],vn[1])&&(vn[1]=Xn[1]),zr(Xn[0],vn[1])>zr(vn[0],vn[1])&&(vn[0]=Xn[0])):Na.push(vn=Xn);for(Ra=-1/0,An=Na.length-1,qr=0,vn=Na[An];qr<=An;vn=Xn,++qr)Xn=Na[qr],(pi=zr(vn[1],Xn[0]))>Ra&&(Ra=pi,it=Xn[0],bt=vn[1])}return _t=wt=null,it===1/0||yt===1/0?[[NaN,NaN],[NaN,NaN]]:[[it,yt],[bt,mt]]}var ct,Ue,Ie,Pe,Be,at,ft,Bt,Nt,Ht,or,Cr,Sr,Tr,Yr,Fn,ua={sphere:L,point:ta,lineStart:ma,lineEnd:ti,polygonStart:function(){ua.lineStart=gr,ua.lineEnd=Kt},polygonEnd:function(){ua.lineStart=ma,ua.lineEnd=ti}};function ta(br,qr){br*=c,qr*=c;var An=l(qr);va(An*l(br),An*_(br),_(qr))}function va(br,qr,An){++ct,Ie+=(br-Ie)/ct,Pe+=(qr-Pe)/ct,Be+=(An-Be)/ct}function ma(){ua.point=Jn}function Jn(br,qr){br*=c,qr*=c;var An=l(qr);Tr=An*l(br),Yr=An*_(br),Fn=_(qr),ua.point=ja,va(Tr,Yr,Fn)}function ja(br,qr){br*=c,qr*=c;var An=l(qr),vn=An*l(br),Xn=An*_(br),Na=_(qr),Ra=T(m((Ra=Yr*Na-Fn*Xn)*Ra+(Ra=Fn*vn-Tr*Na)*Ra+(Ra=Tr*Xn-Yr*vn)*Ra),Tr*vn+Yr*Xn+Fn*Na);Ue+=Ra,at+=Ra*(Tr+(Tr=vn)),ft+=Ra*(Yr+(Yr=Xn)),Bt+=Ra*(Fn+(Fn=Na)),va(Tr,Yr,Fn)}function ti(){ua.point=ta}function gr(){ua.point=vr}function Kt(){_r(Cr,Sr),ua.point=ta}function vr(br,qr){Cr=br,Sr=qr,br*=c,qr*=c,ua.point=_r;var An=l(qr);Tr=An*l(br),Yr=An*_(br),Fn=_(qr),va(Tr,Yr,Fn)}function _r(br,qr){br*=c,qr*=c;var An=l(qr),vn=An*l(br),Xn=An*_(br),Na=_(qr),Ra=Yr*Na-Fn*Xn,pi=Fn*vn-Tr*Na,xi=Tr*Xn-Yr*vn,$i=m(Ra*Ra+pi*pi+xi*xi),ni=y($i),Ii=$i&&-ni/$i;Nt+=Ii*Ra,Ht+=Ii*pi,or+=Ii*xi,Ue+=ni,at+=ni*(Tr+(Tr=vn)),ft+=ni*(Yr+(Yr=Xn)),Bt+=ni*(Fn+(Fn=Na)),va(Tr,Yr,Fn)}function rn(br){ct=Ue=Ie=Pe=Be=at=ft=Bt=Nt=Ht=or=0,j(br,ua);var qr=Nt,An=Ht,vn=or,Xn=qr*qr+An*An+vn*vn;return Xnn?br+Math.round(-br/s)*s:br,qr]}In.invert=In;function fa(br,qr,An){return(br%=s)?qr||An?Mn(Ma(br),Da(qr,An)):Ma(br):qr||An?Da(qr,An):In}function Ca(br){return function(qr,An){return qr+=br,[qr>n?qr-s:qr<-n?qr+s:qr,An]}}function Ma(br){var qr=Ca(br);return qr.invert=Ca(-br),qr}function Da(br,qr){var An=l(br),vn=_(br),Xn=l(qr),Na=_(qr);function Ra(pi,xi){var $i=l(xi),ni=l(pi)*$i,Ii=_(pi)*$i,hi=_(xi),Ja=hi*An+ni*vn;return[T(Ii*Xn-Ja*Na,ni*An-hi*vn),y(Ja*Xn+Ii*Na)]}return Ra.invert=function(pi,xi){var $i=l(xi),ni=l(pi)*$i,Ii=_(pi)*$i,hi=_(xi),Ja=hi*Xn-Ii*Na;return[T(Ii*Xn+hi*Na,ni*An+Ja*vn),y(Ja*An-ni*vn)]},Ra}function Va(br){br=fa(br[0]*c,br[1]*c,br.length>2?br[2]*c:0);function qr(An){return An=br(An[0]*c,An[1]*c),An[0]*=f,An[1]*=f,An}return qr.invert=function(An){return An=br.invert(An[0]*c,An[1]*c),An[0]*=f,An[1]*=f,An},qr}function na(br,qr,An,vn,Xn,Na){if(An){var Ra=l(qr),pi=_(qr),xi=vn*An;Xn==null?(Xn=qr+vn*s,Na=qr-xi/2):(Xn=Mi(Ra,Xn),Na=Mi(Ra,Na),(vn>0?XnNa)&&(Xn+=vn*s));for(var $i,ni=Xn;vn>0?ni>Na:ni1&&br.push(br.pop().concat(br.shift()))},result:function(){var An=br;return br=[],qr=null,An}}}function Ct(br,qr){return v(br[0]-qr[0])=0;--pi)Xn.point((Ii=ni[pi])[0],Ii[1]);else vn(hi.x,hi.p.x,-1,Xn);hi=hi.p}hi=hi.o,ni=hi.z,Ja=!Ja}while(!hi.v);Xn.lineEnd()}}}function Qr(br){if(qr=br.length){for(var qr,An=0,vn=br[0],Xn;++An=0?1:-1,_l=jl*yl,Vl=_l>n,Ks=zo*ns;if(Gr.add(T(Ks*jl*_(_l),Io*Os+Ks*l(_l))),Ra+=Vl?yl+jl*s:yl,Vl^Ja>=An^ro>=An){var xu=Fe(ue(hi),ue(Bo));We(xu);var yu=Fe(Na,xu);We(yu);var Fl=(Vl^yl>=0?-1:1)*y(yu[2]);(vn>Fl||vn===Fl&&(xu[0]||xu[1]))&&(pi+=Vl^yl>=0?1:-1)}}return(Ra<-r||Ra0){for(xi||(Xn.polygonStart(),xi=!0),Xn.lineStart(),Os=0;Os1&&Ni&2&&ns.push(ns.pop().concat(ns.shift())),ni.push(ns.filter(Dt))}}return hi}}function Dt(br){return br.length>1}function yr(br,qr){return((br=br.x)[0]<0?br[1]-i-r:i-br[1])-((qr=qr.x)[0]<0?qr[1]-i-r:i-qr[1])}var Hr=cn(function(){return!0},_n,ea,[-n,-i]);function _n(br){var qr=NaN,An=NaN,vn=NaN,Xn;return{lineStart:function(){br.lineStart(),Xn=1},point:function(Na,Ra){var pi=Na>0?n:-n,xi=v(Na-qr);v(xi-n)0?i:-i),br.point(vn,An),br.lineEnd(),br.lineStart(),br.point(pi,An),br.point(Na,An),Xn=0):vn!==pi&&xi>=n&&(v(qr-vn)r?p((_(qr)*(Na=l(vn))*_(An)-_(vn)*(Xn=l(qr))*_(br))/(Xn*Na*Ra)):(qr+vn)/2}function ea(br,qr,An,vn){var Xn;if(br==null)Xn=An*i,vn.point(-n,Xn),vn.point(0,Xn),vn.point(n,Xn),vn.point(n,0),vn.point(n,-Xn),vn.point(0,-Xn),vn.point(-n,-Xn),vn.point(-n,0),vn.point(-n,Xn);else if(v(br[0]-qr[0])>r){var Na=br[0]0,Xn=v(qr)>r;function Na(ni,Ii,hi,Ja){na(Ja,br,An,hi,ni,Ii)}function Ra(ni,Ii){return l(ni)*l(Ii)>qr}function pi(ni){var Ii,hi,Ja,eo,zo;return{lineStart:function(){eo=Ja=!1,zo=1},point:function(Io,Vo){var Bo=[Io,Vo],ro,Ni=Ra(Io,Vo),ns=vn?Ni?0:$i(Io,Vo):Ni?$i(Io+(Io<0?n:-n),Vo):0;if(!Ii&&(eo=Ja=Ni)&&ni.lineStart(),Ni!==Ja&&(ro=xi(Ii,Bo),(!ro||Ct(Ii,ro)||Ct(Bo,ro))&&(Bo[2]=1)),Ni!==Ja)zo=0,Ni?(ni.lineStart(),ro=xi(Bo,Ii),ni.point(ro[0],ro[1])):(ro=xi(Ii,Bo),ni.point(ro[0],ro[1],2),ni.lineEnd()),Ii=ro;else if(Xn&&Ii&&vn^Ni){var Os;!(ns&hi)&&(Os=xi(Bo,Ii,!0))&&(zo=0,vn?(ni.lineStart(),ni.point(Os[0][0],Os[0][1]),ni.point(Os[1][0],Os[1][1]),ni.lineEnd()):(ni.point(Os[1][0],Os[1][1]),ni.lineEnd(),ni.lineStart(),ni.point(Os[0][0],Os[0][1],3)))}Ni&&(!Ii||!Ct(Ii,Bo))&&ni.point(Bo[0],Bo[1]),Ii=Bo,Ja=Ni,hi=ns},lineEnd:function(){Ja&&ni.lineEnd(),Ii=null},clean:function(){return zo|(eo&&Ja)<<1}}}function xi(ni,Ii,hi){var Ja=ue(ni),eo=ue(Ii),zo=[1,0,0],Io=Fe(Ja,eo),Vo=Te(Io,Io),Bo=Io[0],ro=Vo-Bo*Bo;if(!ro)return!hi&∋var Ni=qr*Vo/ro,ns=-qr*Bo/ro,Os=Fe(zo,Io),yl=Xe(zo,Ni),jl=Xe(Io,ns);Ve(yl,jl);var _l=Os,Vl=Te(yl,_l),Ks=Te(_l,_l),xu=Vl*Vl-Ks*(Te(yl,yl)-1);if(!(xu<0)){var yu=m(xu),Fl=Xe(_l,(-Vl-yu)/Ks);if(Ve(Fl,yl),Fl=le(Fl),!hi)return Fl;var bo=ni[0],ms=Ii[0],Cl=ni[1],cl=Ii[1],ic;ms0^Fl[1]<(v(Fl[0]-bo)n^(bo<=Fl[0]&&Fl[0]<=ms)){var sc=Xe(_l,(-Vl+yu)/Ks);return Ve(sc,yl),[Fl,le(sc)]}}}function $i(ni,Ii){var hi=vn?br:n-br,Ja=0;return ni<-hi?Ja|=1:ni>hi&&(Ja|=2),Ii<-hi?Ja|=4:Ii>hi&&(Ja|=8),Ja}return cn(Ra,pi,Na,vn?[0,-br]:[-n,br-n])}function bn(br,qr,An,vn,Xn,Na){var Ra=br[0],pi=br[1],xi=qr[0],$i=qr[1],ni=0,Ii=1,hi=xi-Ra,Ja=$i-pi,eo;if(eo=An-Ra,!(!hi&&eo>0)){if(eo/=hi,hi<0){if(eo0){if(eo>Ii)return;eo>ni&&(ni=eo)}if(eo=Xn-Ra,!(!hi&&eo<0)){if(eo/=hi,hi<0){if(eo>Ii)return;eo>ni&&(ni=eo)}else if(hi>0){if(eo0)){if(eo/=Ja,Ja<0){if(eo0){if(eo>Ii)return;eo>ni&&(ni=eo)}if(eo=Na-pi,!(!Ja&&eo<0)){if(eo/=Ja,Ja<0){if(eo>Ii)return;eo>ni&&(ni=eo)}else if(Ja>0){if(eo0&&(br[0]=Ra+ni*hi,br[1]=pi+ni*Ja),Ii<1&&(qr[0]=Ra+Ii*hi,qr[1]=pi+Ii*Ja),!0}}}}}var $n=1e9,ki=-$n;function Ua(br,qr,An,vn){function Xn($i,ni){return br<=$i&&$i<=An&&qr<=ni&&ni<=vn}function Na($i,ni,Ii,hi){var Ja=0,eo=0;if($i==null||(Ja=Ra($i,Ii))!==(eo=Ra(ni,Ii))||xi($i,ni)<0^Ii>0)do hi.point(Ja===0||Ja===3?br:An,Ja>1?vn:qr);while((Ja=(Ja+Ii+4)%4)!==eo);else hi.point(ni[0],ni[1])}function Ra($i,ni){return v($i[0]-br)0?0:3:v($i[0]-An)0?2:1:v($i[1]-qr)0?1:0:ni>0?3:2}function pi($i,ni){return xi($i.x,ni.x)}function xi($i,ni){var Ii=Ra($i,1),hi=Ra(ni,1);return Ii!==hi?Ii-hi:Ii===0?ni[1]-$i[1]:Ii===1?$i[0]-ni[0]:Ii===2?$i[1]-ni[1]:ni[0]-$i[0]}return function($i){var ni=$i,Ii=Vt(),hi,Ja,eo,zo,Io,Vo,Bo,ro,Ni,ns,Os,yl={point:jl,lineStart:xu,lineEnd:yu,polygonStart:Vl,polygonEnd:Ks};function jl(bo,ms){Xn(bo,ms)&&ni.point(bo,ms)}function _l(){for(var bo=0,ms=0,Cl=Ja.length;msvn&&(sf-Sf)*(vn-sc)>(wu-sc)*(br-Sf)&&++bo:wu<=vn&&(sf-Sf)*(vn-sc)<(wu-sc)*(br-Sf)&&--bo;return bo}function Vl(){ni=Ii,hi=[],Ja=[],Os=!0}function Ks(){var bo=_l(),ms=Os&&bo,Cl=(hi=x.merge(hi)).length;(ms||Cl)&&($i.polygonStart(),ms&&($i.lineStart(),Na(null,null,1,$i),$i.lineEnd()),Cl&&Kr(hi,pi,bo,Na,$i),$i.polygonEnd()),ni=$i,hi=Ja=eo=null}function xu(){yl.point=Fl,Ja&&Ja.push(eo=[]),ns=!0,Ni=!1,Bo=ro=NaN}function yu(){hi&&(Fl(zo,Io),Vo&&Ni&&Ii.rejoin(),hi.push(Ii.result())),yl.point=jl,Ni&&ni.lineEnd()}function Fl(bo,ms){var Cl=Xn(bo,ms);if(Ja&&eo.push([bo,ms]),ns)zo=bo,Io=ms,Vo=Cl,ns=!1,Cl&&(ni.lineStart(),ni.point(bo,ms));else if(Cl&&Ni)ni.point(bo,ms);else{var cl=[Bo=Math.max(ki,Math.min($n,Bo)),ro=Math.max(ki,Math.min($n,ro))],ic=[bo=Math.max(ki,Math.min($n,bo)),ms=Math.max(ki,Math.min($n,ms))];bn(cl,ic,br,qr,An,vn)?(Ni||(ni.lineStart(),ni.point(cl[0],cl[1])),ni.point(ic[0],ic[1]),Cl||ni.lineEnd(),Os=!1):Cl&&(ni.lineStart(),ni.point(bo,ms),Os=!1)}Bo=bo,ro=ms,Ni=Cl}return yl}}function Fi(){var br=0,qr=0,An=960,vn=500,Xn,Na,Ra;return Ra={stream:function(pi){return Xn&&Na===pi?Xn:Xn=Ua(br,qr,An,vn)(Na=pi)},extent:function(pi){return arguments.length?(br=+pi[0][0],qr=+pi[0][1],An=+pi[1][0],vn=+pi[1][1],Xn=Na=null,Ra):[[br,qr],[An,vn]]}}}var Ji=S(),fo,co,So,wi={sphere:L,point:L,lineStart:ts,lineEnd:L,polygonStart:L,polygonEnd:L};function ts(){wi.point=js,wi.lineEnd=jo}function jo(){wi.point=wi.lineEnd=L}function js(br,qr){br*=c,qr*=c,fo=br,co=_(qr),So=l(qr),wi.point=us}function us(br,qr){br*=c,qr*=c;var An=_(qr),vn=l(qr),Xn=v(br-fo),Na=l(Xn),Ra=_(Xn),pi=vn*Ra,xi=So*An-co*vn*Na,$i=co*An+So*vn*Na;Ji.add(T(m(pi*pi+xi*xi),$i)),fo=br,co=An,So=vn}function Zo(br){return Ji.reset(),j(br,wi),+Ji}var No=[null,null],Vs={type:"LineString",coordinates:No};function Ns(br,qr){return No[0]=br,No[1]=qr,Zo(Vs)}var rl={Feature:function(br,qr){return $o(br.geometry,qr)},FeatureCollection:function(br,qr){for(var An=br.features,vn=-1,Xn=An.length;++vn0&&(Xn=Ns(br[Na],br[Na-1]),Xn>0&&An<=Xn&&vn<=Xn&&(An+vn-Xn)*(1-Math.pow((An-vn)/Xn,2))r}).map(hi)).concat(x.range(g(Na/$i)*$i,Xn,$i).filter(function(ro){return v(ro%Ii)>r}).map(Ja))}return Vo.lines=function(){return Bo().map(function(ro){return{type:"LineString",coordinates:ro}})},Vo.outline=function(){return{type:"Polygon",coordinates:[eo(vn).concat(zo(Ra).slice(1),eo(An).reverse().slice(1),zo(pi).reverse().slice(1))]}},Vo.extent=function(ro){return arguments.length?Vo.extentMajor(ro).extentMinor(ro):Vo.extentMinor()},Vo.extentMajor=function(ro){return arguments.length?(vn=+ro[0][0],An=+ro[1][0],pi=+ro[0][1],Ra=+ro[1][1],vn>An&&(ro=vn,vn=An,An=ro),pi>Ra&&(ro=pi,pi=Ra,Ra=ro),Vo.precision(Io)):[[vn,pi],[An,Ra]]},Vo.extentMinor=function(ro){return arguments.length?(qr=+ro[0][0],br=+ro[1][0],Na=+ro[0][1],Xn=+ro[1][1],qr>br&&(ro=qr,qr=br,br=ro),Na>Xn&&(ro=Na,Na=Xn,Xn=ro),Vo.precision(Io)):[[qr,Na],[br,Xn]]},Vo.step=function(ro){return arguments.length?Vo.stepMajor(ro).stepMinor(ro):Vo.stepMinor()},Vo.stepMajor=function(ro){return arguments.length?(ni=+ro[0],Ii=+ro[1],Vo):[ni,Ii]},Vo.stepMinor=function(ro){return arguments.length?(xi=+ro[0],$i=+ro[1],Vo):[xi,$i]},Vo.precision=function(ro){return arguments.length?(Io=+ro,hi=Ai(Na,Xn,90),Ja=uo(qr,br,Io),eo=Ai(pi,Ra,90),zo=uo(vn,An,Io),Vo):Io},Vo.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function Cs(){return Tl()()}function Ro(br,qr){var An=br[0]*c,vn=br[1]*c,Xn=qr[0]*c,Na=qr[1]*c,Ra=l(vn),pi=_(vn),xi=l(Na),$i=_(Na),ni=Ra*l(An),Ii=Ra*_(An),hi=xi*l(Xn),Ja=xi*_(Xn),eo=2*y(m(R(Na-vn)+Ra*xi*R(Xn-An))),zo=_(eo),Io=eo?function(Vo){var Bo=_(Vo*=eo)/zo,ro=_(eo-Vo)/zo,Ni=ro*ni+Bo*hi,ns=ro*Ii+Bo*Ja,Os=ro*pi+Bo*$i;return[T(ns,Ni)*f,T(Os,m(Ni*Ni+ns*ns))*f]}:function(){return[An*f,vn*f]};return Io.distance=eo,Io}function El(br){return br}var qs=S(),al=S(),mu,io,vs,rs,Bl={point:L,lineStart:L,lineEnd:L,polygonStart:function(){Bl.lineStart=Ul,Bl.lineEnd=su},polygonEnd:function(){Bl.lineStart=Bl.lineEnd=Bl.point=L,qs.add(v(al)),al.reset()},result:function(){var br=qs/2;return qs.reset(),br}};function Ul(){Bl.point=Lo}function Lo(br,qr){Bl.point=tu,mu=vs=br,io=rs=qr}function tu(br,qr){al.add(rs*br-vs*qr),vs=br,rs=qr}function su(){tu(mu,io)}var Ds=1/0,vl=Ds,Il=-Ds,zl=Il,Ou={point:qc,lineStart:L,lineEnd:L,polygonStart:L,polygonEnd:L,result:function(){var br=[[Ds,vl],[Il,zl]];return Il=zl=-(vl=Ds=1/0),br}};function qc(br,qr){brIl&&(Il=br),qrzl&&(zl=qr)}var Mc=0,Dc=0,rh=0,Hf=0,ml=0,vc=0,nh=0,Gu=0,zu=0,Hu,Rc,$l,Fu,Bs={point:kl,lineStart:rf,lineEnd:ru,polygonStart:function(){Bs.lineStart=Rh,Bs.lineEnd=Rs},polygonEnd:function(){Bs.point=kl,Bs.lineStart=rf,Bs.lineEnd=ru},result:function(){var br=zu?[nh/zu,Gu/zu]:vc?[Hf/vc,ml/vc]:rh?[Mc/rh,Dc/rh]:[NaN,NaN];return Mc=Dc=rh=Hf=ml=vc=nh=Gu=zu=0,br}};function kl(br,qr){Mc+=br,Dc+=qr,++rh}function rf(){Bs.point=lc}function lc(br,qr){Bs.point=df,kl($l=br,Fu=qr)}function df(br,qr){var An=br-$l,vn=qr-Fu,Xn=m(An*An+vn*vn);Hf+=Xn*($l+br)/2,ml+=Xn*(Fu+qr)/2,vc+=Xn,kl($l=br,Fu=qr)}function ru(){Bs.point=kl}function Rh(){Bs.point=Yh}function Rs(){ul(Hu,Rc)}function Yh(br,qr){Bs.point=ul,kl(Hu=$l=br,Rc=Fu=qr)}function ul(br,qr){var An=br-$l,vn=qr-Fu,Xn=m(An*An+vn*vn);Hf+=Xn*($l+br)/2,ml+=Xn*(Fu+qr)/2,vc+=Xn,Xn=Fu*br-$l*qr,nh+=Xn*($l+br),Gu+=Xn*(Fu+qr),zu+=Xn*3,kl($l=br,Fu=qr)}function Do(br){this._context=br}Do.prototype={_radius:4.5,pointRadius:function(br){return this._radius=br,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(br,qr){switch(this._point){case 0:{this._context.moveTo(br,qr),this._point=1;break}case 1:{this._context.lineTo(br,qr);break}default:{this._context.moveTo(br+this._radius,qr),this._context.arc(br,qr,this._radius,0,s);break}}},result:L};var kf=S(),Oc,Cu,ah,pf,Nf,Nu={point:L,lineStart:function(){Nu.point=Eh},lineEnd:function(){Oc&&fh(Cu,ah),Nu.point=L},polygonStart:function(){Oc=!0},polygonEnd:function(){Oc=null},result:function(){var br=+kf;return kf.reset(),br}};function Eh(br,qr){Nu.point=fh,Cu=pf=br,ah=Nf=qr}function fh(br,qr){pf-=br,Nf-=qr,kf.add(m(pf*pf+Nf*Nf)),pf=br,Nf=qr}function Bf(){this._string=[]}Bf.prototype={_radius:4.5,_circle:vf(4.5),pointRadius:function(br){return(br=+br)!==this._radius&&(this._radius=br,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(br,qr){switch(this._point){case 0:{this._string.push("M",br,",",qr),this._point=1;break}case 1:{this._string.push("L",br,",",qr);break}default:{this._circle==null&&(this._circle=vf(this._radius)),this._string.push("M",br,",",qr,this._circle);break}}},result:function(){if(this._string.length){var br=this._string.join("");return this._string=[],br}else return null}};function vf(br){return"m0,"+br+"a"+br+","+br+" 0 1,1 0,"+-2*br+"a"+br+","+br+" 0 1,1 0,"+2*br+"z"}function ih(br,qr){var An=4.5,vn,Xn;function Na(Ra){return Ra&&(typeof An=="function"&&Xn.pointRadius(+An.apply(this,arguments)),j(Ra,vn(Xn))),Xn.result()}return Na.area=function(Ra){return j(Ra,vn(Bl)),Bl.result()},Na.measure=function(Ra){return j(Ra,vn(Nu)),Nu.result()},Na.bounds=function(Ra){return j(Ra,vn(Ou)),Ou.result()},Na.centroid=function(Ra){return j(Ra,vn(Bs)),Bs.result()},Na.projection=function(Ra){return arguments.length?(vn=Ra==null?(br=null,El):(br=Ra).stream,Na):br},Na.context=function(Ra){return arguments.length?(Xn=Ra==null?(qr=null,new Bf):new Do(qr=Ra),typeof An!="function"&&Xn.pointRadius(An),Na):qr},Na.pointRadius=function(Ra){return arguments.length?(An=typeof Ra=="function"?Ra:(Xn.pointRadius(+Ra),+Ra),Na):An},Na.projection(br).context(qr)}function oh(br){return{stream:zc(br)}}function zc(br){return function(qr){var An=new hh;for(var vn in br)An[vn]=br[vn];return An.stream=qr,An}}function hh(){}hh.prototype={constructor:hh,point:function(br,qr){this.stream.point(br,qr)},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 nf(br,qr,An){var vn=br.clipExtent&&br.clipExtent();return br.scale(150).translate([0,0]),vn!=null&&br.clipExtent(null),j(An,br.stream(Ou)),qr(Ou.result()),vn!=null&&br.clipExtent(vn),br}function Gc(br,qr,An){return nf(br,function(vn){var Xn=qr[1][0]-qr[0][0],Na=qr[1][1]-qr[0][1],Ra=Math.min(Xn/(vn[1][0]-vn[0][0]),Na/(vn[1][1]-vn[0][1])),pi=+qr[0][0]+(Xn-Ra*(vn[1][0]+vn[0][0]))/2,xi=+qr[0][1]+(Na-Ra*(vn[1][1]+vn[0][1]))/2;br.scale(150*Ra).translate([pi,xi])},An)}function Bu(br,qr,An){return Gc(br,[[0,0],qr],An)}function Af(br,qr,An){return nf(br,function(vn){var Xn=+qr,Na=Xn/(vn[1][0]-vn[0][0]),Ra=(Xn-Na*(vn[1][0]+vn[0][0]))/2,pi=-Na*vn[0][1];br.scale(150*Na).translate([Ra,pi])},An)}function sh(br,qr,An){return nf(br,function(vn){var Xn=+qr,Na=Xn/(vn[1][1]-vn[0][1]),Ra=-Na*vn[0][0],pi=(Xn-Na*(vn[1][1]+vn[0][1]))/2;br.scale(150*Na).translate([Ra,pi])},An)}var Dl=16,$f=l(30*c);function Oh(br,qr){return+qr?Uf(br,qr):dh(br)}function dh(br){return zc({point:function(qr,An){qr=br(qr,An),this.stream.point(qr[0],qr[1])}})}function Uf(br,qr){function An(vn,Xn,Na,Ra,pi,xi,$i,ni,Ii,hi,Ja,eo,zo,Io){var Vo=$i-vn,Bo=ni-Xn,ro=Vo*Vo+Bo*Bo;if(ro>4*qr&&zo--){var Ni=Ra+hi,ns=pi+Ja,Os=xi+eo,yl=m(Ni*Ni+ns*ns+Os*Os),jl=y(Os/=yl),_l=v(v(Os)-1)qr||v((Vo*yu+Bo*Fl)/ro-.5)>.3||Ra*hi+pi*Ja+xi*eo<$f)&&(An(vn,Xn,Na,Ra,pi,xi,Ks,xu,_l,Ni/=yl,ns/=yl,Os,zo,Io),Io.point(Ks,xu),An(Ks,xu,_l,Ni,ns,Os,$i,ni,Ii,hi,Ja,eo,zo,Io))}}return function(vn){var Xn,Na,Ra,pi,xi,$i,ni,Ii,hi,Ja,eo,zo,Io={point:Vo,lineStart:Bo,lineEnd:Ni,polygonStart:function(){vn.polygonStart(),Io.lineStart=ns},polygonEnd:function(){vn.polygonEnd(),Io.lineStart=Bo}};function Vo(jl,_l){jl=br(jl,_l),vn.point(jl[0],jl[1])}function Bo(){Ii=NaN,Io.point=ro,vn.lineStart()}function ro(jl,_l){var Vl=ue([jl,_l]),Ks=br(jl,_l);An(Ii,hi,ni,Ja,eo,zo,Ii=Ks[0],hi=Ks[1],ni=jl,Ja=Vl[0],eo=Vl[1],zo=Vl[2],Dl,vn),vn.point(Ii,hi)}function Ni(){Io.point=Vo,vn.lineEnd()}function ns(){Bo(),Io.point=Os,Io.lineEnd=yl}function Os(jl,_l){ro(Xn=jl,_l),Na=Ii,Ra=hi,pi=Ja,xi=eo,$i=zo,Io.point=ro}function yl(){An(Ii,hi,ni,Ja,eo,zo,Na,Ra,Xn,pi,xi,$i,Dl,vn),Io.lineEnd=Ni,Ni()}return Io}}var ph=zc({point:function(br,qr){this.stream.point(br*c,qr*c)}});function mc(br){return zc({point:function(qr,An){var vn=br(qr,An);return this.stream.point(vn[0],vn[1])}})}function vh(br,qr,An,vn,Xn){function Na(Ra,pi){return Ra*=vn,pi*=Xn,[qr+br*Ra,An-br*pi]}return Na.invert=function(Ra,pi){return[(Ra-qr)/br*vn,(An-pi)/br*Xn]},Na}function du(br,qr,An,vn,Xn,Na){var Ra=l(Na),pi=_(Na),xi=Ra*br,$i=pi*br,ni=Ra/br,Ii=pi/br,hi=(pi*An-Ra*qr)/br,Ja=(pi*qr+Ra*An)/br;function eo(zo,Io){return zo*=vn,Io*=Xn,[xi*zo-$i*Io+qr,An-$i*zo-xi*Io]}return eo.invert=function(zo,Io){return[vn*(ni*zo-Ii*Io+hi),Xn*(Ja-Ii*zo-ni*Io)]},eo}function gc(br){return mf(function(){return br})()}function mf(br){var qr,An=150,vn=480,Xn=250,Na=0,Ra=0,pi=0,xi=0,$i=0,ni,Ii=0,hi=1,Ja=1,eo=null,zo=Hr,Io=null,Vo,Bo,ro,Ni=El,ns=.5,Os,yl,jl,_l,Vl;function Ks(bo){return jl(bo[0]*c,bo[1]*c)}function xu(bo){return bo=jl.invert(bo[0],bo[1]),bo&&[bo[0]*f,bo[1]*f]}Ks.stream=function(bo){return _l&&Vl===bo?_l:_l=ph(mc(ni)(zo(Os(Ni(Vl=bo)))))},Ks.preclip=function(bo){return arguments.length?(zo=bo,eo=void 0,Fl()):zo},Ks.postclip=function(bo){return arguments.length?(Ni=bo,Io=Vo=Bo=ro=null,Fl()):Ni},Ks.clipAngle=function(bo){return arguments.length?(zo=+bo?Qn(eo=bo*c):(eo=null,Hr),Fl()):eo*f},Ks.clipExtent=function(bo){return arguments.length?(Ni=bo==null?(Io=Vo=Bo=ro=null,El):Ua(Io=+bo[0][0],Vo=+bo[0][1],Bo=+bo[1][0],ro=+bo[1][1]),Fl()):Io==null?null:[[Io,Vo],[Bo,ro]]},Ks.scale=function(bo){return arguments.length?(An=+bo,yu()):An},Ks.translate=function(bo){return arguments.length?(vn=+bo[0],Xn=+bo[1],yu()):[vn,Xn]},Ks.center=function(bo){return arguments.length?(Na=bo[0]%360*c,Ra=bo[1]%360*c,yu()):[Na*f,Ra*f]},Ks.rotate=function(bo){return arguments.length?(pi=bo[0]%360*c,xi=bo[1]%360*c,$i=bo.length>2?bo[2]%360*c:0,yu()):[pi*f,xi*f,$i*f]},Ks.angle=function(bo){return arguments.length?(Ii=bo%360*c,yu()):Ii*f},Ks.reflectX=function(bo){return arguments.length?(hi=bo?-1:1,yu()):hi<0},Ks.reflectY=function(bo){return arguments.length?(Ja=bo?-1:1,yu()):Ja<0},Ks.precision=function(bo){return arguments.length?(Os=Oh(yl,ns=bo*bo),Fl()):m(ns)},Ks.fitExtent=function(bo,ms){return Gc(Ks,bo,ms)},Ks.fitSize=function(bo,ms){return Bu(Ks,bo,ms)},Ks.fitWidth=function(bo,ms){return Af(Ks,bo,ms)},Ks.fitHeight=function(bo,ms){return sh(Ks,bo,ms)};function yu(){var bo=du(An,0,0,hi,Ja,Ii).apply(null,qr(Na,Ra)),ms=(Ii?du:vh)(An,vn-bo[0],Xn-bo[1],hi,Ja,Ii);return ni=fa(pi,xi,$i),yl=Mn(qr,ms),jl=Mn(ni,yl),Os=Oh(yl,ns),Fl()}function Fl(){return _l=Vl=null,Ks}return function(){return qr=br.apply(this,arguments),Ks.invert=qr.invert&&xu,yu()}}function Wl(br){var qr=0,An=n/3,vn=mf(br),Xn=vn(qr,An);return Xn.parallels=function(Na){return arguments.length?vn(qr=Na[0]*c,An=Na[1]*c):[qr*f,An*f]},Xn}function af(br){var qr=l(br);function An(vn,Xn){return[vn*qr,_(Xn)/qr]}return An.invert=function(vn,Xn){return[vn/qr,y(Xn*qr)]},An}function ac(br,qr){var An=_(br),vn=(An+_(qr))/2;if(v(vn)=.12&&Io<.234&&zo>=-.425&&zo<-.214?Xn:Io>=.166&&Io<.234&&zo>=-.214&&zo<-.115?Ra:An).invert(hi)},ni.stream=function(hi){return br&&qr===hi?br:br=Cf([An.stream(qr=hi),Xn.stream(hi),Ra.stream(hi)])},ni.precision=function(hi){return arguments.length?(An.precision(hi),Xn.precision(hi),Ra.precision(hi),Ii()):An.precision()},ni.scale=function(hi){return arguments.length?(An.scale(hi),Xn.scale(hi*.35),Ra.scale(hi),ni.translate(An.translate())):An.scale()},ni.translate=function(hi){if(!arguments.length)return An.translate();var Ja=An.scale(),eo=+hi[0],zo=+hi[1];return vn=An.translate(hi).clipExtent([[eo-.455*Ja,zo-.238*Ja],[eo+.455*Ja,zo+.238*Ja]]).stream($i),Na=Xn.translate([eo-.307*Ja,zo+.201*Ja]).clipExtent([[eo-.425*Ja+r,zo+.12*Ja+r],[eo-.214*Ja-r,zo+.234*Ja-r]]).stream($i),pi=Ra.translate([eo-.205*Ja,zo+.212*Ja]).clipExtent([[eo-.214*Ja+r,zo+.166*Ja+r],[eo-.115*Ja-r,zo+.234*Ja-r]]).stream($i),Ii()},ni.fitExtent=function(hi,Ja){return Gc(ni,hi,Ja)},ni.fitSize=function(hi,Ja){return Bu(ni,hi,Ja)},ni.fitWidth=function(hi,Ja){return Af(ni,hi,Ja)},ni.fitHeight=function(hi,Ja){return sh(ni,hi,Ja)};function Ii(){return br=qr=null,ni}return ni.scale(1070)}function gf(br){return function(qr,An){var vn=l(qr),Xn=l(An),Na=br(vn*Xn);return[Na*Xn*_(qr),Na*_(An)]}}function Wf(br){return function(qr,An){var vn=m(qr*qr+An*An),Xn=br(vn),Na=_(Xn),Ra=l(Xn);return[T(qr*Na,vn*Ra),y(vn&&An*Na/vn)]}}var zh=gf(function(br){return m(2/(1+br))});zh.invert=Wf(function(br){return 2*y(br/2)});function td(){return gc(zh).scale(124.75).clipAngle(180-.001)}var Pf=gf(function(br){return(br=d(br))&&br/_(br)});Pf.invert=Wf(function(br){return br});function Yf(){return gc(Pf).scale(79.4188).clipAngle(180-.001)}function Ec(br,qr){return[br,A(u((i+qr)/2))]}Ec.invert=function(br,qr){return[br,2*p(b(qr))-i]};function Xf(){return $u(Ec).scale(961/s)}function $u(br){var qr=gc(br),An=qr.center,vn=qr.scale,Xn=qr.translate,Na=qr.clipExtent,Ra=null,pi,xi,$i;qr.scale=function(Ii){return arguments.length?(vn(Ii),ni()):vn()},qr.translate=function(Ii){return arguments.length?(Xn(Ii),ni()):Xn()},qr.center=function(Ii){return arguments.length?(An(Ii),ni()):An()},qr.clipExtent=function(Ii){return arguments.length?(Ii==null?Ra=pi=xi=$i=null:(Ra=+Ii[0][0],pi=+Ii[0][1],xi=+Ii[1][0],$i=+Ii[1][1]),ni()):Ra==null?null:[[Ra,pi],[xi,$i]]};function ni(){var Ii=n*vn(),hi=qr(Va(qr.rotate()).invert([0,0]));return Na(Ra==null?[[hi[0]-Ii,hi[1]-Ii],[hi[0]+Ii,hi[1]+Ii]]:br===Ec?[[Math.max(hi[0]-Ii,Ra),pi],[Math.min(hi[0]+Ii,xi),$i]]:[[Ra,Math.max(hi[1]-Ii,pi)],[xi,Math.min(hi[1]+Ii,$i)]])}return ni()}function Lf(br){return u((i+br)/2)}function mh(br,qr){var An=l(br),vn=br===qr?_(br):A(An/l(qr))/A(Lf(qr)/Lf(br)),Xn=An*E(Lf(br),vn)/vn;if(!vn)return Ec;function Na(Ra,pi){Xn>0?pi<-i+r&&(pi=-i+r):pi>i-r&&(pi=i-r);var xi=Xn/E(Lf(pi),vn);return[xi*_(vn*Ra),Xn-xi*l(vn*Ra)]}return Na.invert=function(Ra,pi){var xi=Xn-pi,$i=w(vn)*m(Ra*Ra+xi*xi),ni=T(Ra,v(xi))*w(xi);return xi*vn<0&&(ni-=n*w(Ra)*w(xi)),[ni/vn,2*p(E(Xn/$i,1/vn))-i]},Na}function Df(){return Wl(mh).scale(109.5).parallels([30,30])}function Zl(br,qr){return[br,qr]}Zl.invert=Zl;function _c(){return gc(Zl).scale(152.63)}function Fc(br,qr){var An=l(br),vn=br===qr?_(br):(An-l(qr))/(qr-br),Xn=An/vn+br;if(v(vn)r&&--vn>0);return[br/(.8707+(Na=An*An)*(-.131979+Na*(-.013791+Na*Na*Na*(.003971-.001529*Na)))),An]};function Wc(){return gc(of).scale(175.295)}function gu(br,qr){return[l(qr)*_(br),_(qr)]}gu.invert=Wf(y);function uc(){return gc(gu).scale(249.5).clipAngle(90+r)}function lu(br,qr){var An=l(qr),vn=1+l(br)*An;return[An*_(br)/vn,_(qr)/vn]}lu.invert=Wf(function(br){return 2*p(br)});function _f(){return gc(lu).scale(250).clipAngle(142)}function Yc(br,qr){return[A(u((i+qr)/2)),-br]}Yc.invert=function(br,qr){return[-qr,2*p(b(br))-i]};function uh(){var br=$u(Yc),qr=br.center,An=br.rotate;return br.center=function(vn){return arguments.length?qr([-vn[1],vn[0]]):(vn=qr(),[vn[1],-vn[0]])},br.rotate=function(vn){return arguments.length?An([vn[0],vn[1],vn.length>2?vn[2]+90:90]):(vn=An(),[vn[0],vn[1],vn[2]-90])},An([0,0,90]).scale(159.155)}h.geoAlbers=nu,h.geoAlbersUsa=Hc,h.geoArea=Y,h.geoAzimuthalEqualArea=td,h.geoAzimuthalEqualAreaRaw=zh,h.geoAzimuthalEquidistant=Yf,h.geoAzimuthalEquidistantRaw=Pf,h.geoBounds=Qe,h.geoCentroid=rn,h.geoCircle=Oi,h.geoClipAntimeridian=Hr,h.geoClipCircle=Qn,h.geoClipExtent=Fi,h.geoClipRectangle=Ua,h.geoConicConformal=Df,h.geoConicConformalRaw=mh,h.geoConicEqualArea=yc,h.geoConicEqualAreaRaw=ac,h.geoConicEquidistant=lh,h.geoConicEquidistantRaw=Fc,h.geoContains=Ts,h.geoDistance=Ns,h.geoEqualEarth=Fh,h.geoEqualEarthRaw=qf,h.geoEquirectangular=_c,h.geoEquirectangularRaw=Zl,h.geoGnomonic=gh,h.geoGnomonicRaw=Xu,h.geoGraticule=Tl,h.geoGraticule10=Cs,h.geoIdentity=Cc,h.geoInterpolate=Ro,h.geoLength=Zo,h.geoMercator=Xf,h.geoMercatorRaw=Ec,h.geoNaturalEarth1=Wc,h.geoNaturalEarth1Raw=of,h.geoOrthographic=uc,h.geoOrthographicRaw=gu,h.geoPath=ih,h.geoProjection=gc,h.geoProjectionMutator=mf,h.geoRotation=Va,h.geoStereographic=_f,h.geoStereographicRaw=lu,h.geoStream=j,h.geoTransform=oh,h.geoTransverseMercator=uh,h.geoTransverseMercatorRaw=Yc,Object.defineProperty(h,"__esModule",{value:!0})})}}),SP=_e({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(ee,X){(function(h,x){typeof ee=="object"&&typeof X<"u"?x(ee,q3(),p1()):x(h.d3=h.d3||{},h.d3,h.d3)})(ee,function(h,x,S){var k=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,v=Math.sign||function(ot){return ot>0?1:ot<0?-1:0},p=Math.sin,T=Math.tan,l=1e-6,g=1e-12,b=Math.PI,A=b/2,E=b/4,_=Math.SQRT1_2,w=N(2),m=N(b),u=b*2,d=180/b,y=b/180;function R(ot){return ot?ot/Math.sin(ot):1}function L(ot){return ot>1?A:ot<-1?-A:Math.asin(ot)}function z(ot){return ot>1?0:ot<-1?b:Math.acos(ot)}function N(ot){return ot>0?Math.sqrt(ot):0}function U(ot){return ot=o(2*ot),(ot-1)/(ot+1)}function B(ot){return(o(ot)-o(-ot))/2}function D(ot){return(o(ot)+o(-ot))/2}function j(ot){return i(ot+N(ot*ot+1))}function q(ot){return i(ot+N(ot*ot-1))}function J(ot){var dt=T(ot/2),Tt=2*i(r(ot/2))/(dt*dt);function Pt(qt,zt){var Xt=r(qt),Mr=r(zt),Rr=p(zt),Vr=Mr*Xt,an=-((1-Vr?i((1+Vr)/2)/(1-Vr):-.5)+Tt/(1+Vr));return[an*Mr*p(qt),an*Rr]}return Pt.invert=function(qt,zt){var Xt=N(qt*qt+zt*zt),Mr=-ot/2,Rr=50,Vr;if(!Xt)return[0,0];do{var an=Mr/2,mn=r(an),zn=p(an),Gn=zn/mn,oa=-i(k(mn));Mr-=Vr=(2/Gn*oa-Tt*Gn-Xt)/(-oa/(zn*zn)+1-Tt/(2*mn*mn))*(mn<0?.7:1)}while(k(Vr)>l&&--Rr>0);var Fa=p(Mr);return[t(qt*Fa,Xt*r(Mr)),L(zt*Fa/Xt)]},Pt}function oe(){var ot=A,dt=x.geoProjectionMutator(J),Tt=dt(ot);return Tt.radius=function(Pt){return arguments.length?dt(ot=Pt*y):ot*d},Tt.scale(179.976).clipAngle(147)}function ye(ot,dt){var Tt=r(dt),Pt=R(z(Tt*r(ot/=2)));return[2*Tt*p(ot)*Pt,p(dt)*Pt]}ye.invert=function(ot,dt){if(!(ot*ot+4*dt*dt>b*b+l)){var Tt=ot,Pt=dt,qt=25;do{var zt=p(Tt),Xt=p(Tt/2),Mr=r(Tt/2),Rr=p(Pt),Vr=r(Pt),an=p(2*Pt),mn=Rr*Rr,zn=Vr*Vr,Gn=Xt*Xt,oa=1-zn*Mr*Mr,Fa=oa?z(Vr*Mr)*N(vi=1/oa):vi=0,vi,li=2*Fa*Vr*Xt-ot,mi=Fa*Rr-dt,no=vi*(zn*Gn+Fa*Vr*Mr*mn),To=vi*(.5*zt*an-Fa*2*Rr*Xt),go=vi*.25*(an*Xt-Fa*Rr*zn*zt),Wo=vi*(mn*Mr+Fa*Gn*Vr),$s=To*go-Wo*no;if(!$s)break;var Ws=(mi*To-li*Wo)/$s,As=(li*go-mi*no)/$s;Tt-=Ws,Pt-=As}while((k(Ws)>l||k(As)>l)&&--qt>0);return[Tt,Pt]}};function pe(){return x.geoProjection(ye).scale(152.63)}function ge(ot){var dt=p(ot),Tt=r(ot),Pt=ot>=0?1:-1,qt=T(Pt*ot),zt=(1+dt-Tt)/2;function Xt(Mr,Rr){var Vr=r(Rr),an=r(Mr/=2);return[(1+Vr)*p(Mr),(Pt*Rr>-t(an,qt)-.001?0:-Pt*10)+zt+p(Rr)*Tt-(1+Vr)*dt*an]}return Xt.invert=function(Mr,Rr){var Vr=0,an=0,mn=50;do{var zn=r(Vr),Gn=p(Vr),oa=r(an),Fa=p(an),vi=1+oa,li=vi*Gn-Mr,mi=zt+Fa*Tt-vi*dt*zn-Rr,no=vi*zn/2,To=-Gn*Fa,go=dt*vi*Gn/2,Wo=Tt*oa+dt*zn*Fa,$s=To*go-Wo*no,Ws=(mi*To-li*Wo)/$s/2,As=(li*go-mi*no)/$s;k(As)>2&&(As/=2),Vr-=Ws,an-=As}while((k(Ws)>l||k(As)>l)&&--mn>0);return Pt*an>-t(r(Vr),qt)-.001?[Vr*2,an]:null},Xt}function W(){var ot=20*y,dt=ot>=0?1:-1,Tt=T(dt*ot),Pt=x.geoProjectionMutator(ge),qt=Pt(ot),zt=qt.stream;return qt.parallel=function(Xt){return arguments.length?(Tt=T((dt=(ot=Xt*y)>=0?1:-1)*ot),Pt(ot)):ot*d},qt.stream=function(Xt){var Mr=qt.rotate(),Rr=zt(Xt),Vr=(qt.rotate([0,0]),zt(Xt)),an=qt.precision();return qt.rotate(Mr),Rr.sphere=function(){Vr.polygonStart(),Vr.lineStart();for(var mn=dt*-180;dt*mn<180;mn+=dt*90)Vr.point(mn,dt*90);if(ot)for(;dt*(mn-=3*dt*an)>=-180;)Vr.point(mn,dt*-t(r(mn*y/2),Tt)*d);Vr.lineEnd(),Vr.polygonEnd()},Rr},qt.scale(218.695).center([0,28.0974])}function ae(ot,dt){var Tt=T(dt/2),Pt=N(1-Tt*Tt),qt=1+Pt*r(ot/=2),zt=p(ot)*Pt/qt,Xt=Tt/qt,Mr=zt*zt,Rr=Xt*Xt;return[4/3*zt*(3+Mr-3*Rr),4/3*Xt*(3+3*Mr-Rr)]}ae.invert=function(ot,dt){if(ot*=3/8,dt*=3/8,!ot&&k(dt)>1)return null;var Tt=ot*ot,Pt=dt*dt,qt=1+Tt+Pt,zt=N((qt-N(qt*qt-4*dt*dt))/2),Xt=L(zt)/3,Mr=zt?q(k(dt/zt))/3:j(k(ot))/3,Rr=r(Xt),Vr=D(Mr),an=Vr*Vr-Rr*Rr;return[v(ot)*2*t(B(Mr)*Rr,.25-an),v(dt)*2*t(Vr*p(Xt),.25+an)]};function se(){return x.geoProjection(ae).scale(66.1603)}var Q=N(8),me=i(1+w);function ie(ot,dt){var Tt=k(dt);return Ttg&&--Pt>0);return[ot/(r(Tt)*(Q-1/p(Tt))),v(dt)*Tt]};function Y(){return x.geoProjection(ie).scale(112.314)}function le(ot){var dt=2*b/ot;function Tt(Pt,qt){var zt=x.geoAzimuthalEquidistantRaw(Pt,qt);if(k(Pt)>A){var Xt=t(zt[1],zt[0]),Mr=N(zt[0]*zt[0]+zt[1]*zt[1]),Rr=dt*c((Xt-A)/dt)+A,Vr=t(p(Xt-=Rr),2-r(Xt));Xt=Rr+L(b/Mr*p(Vr))-Vr,zt[0]=Mr*r(Xt),zt[1]=Mr*p(Xt)}return zt}return Tt.invert=function(Pt,qt){var zt=N(Pt*Pt+qt*qt);if(zt>A){var Xt=t(qt,Pt),Mr=dt*c((Xt-A)/dt)+A,Rr=Xt>Mr?-1:1,Vr=zt*r(Mr-Xt),an=1/T(Rr*z((Vr-b)/N(b*(b-2*Vr)+zt*zt)));Xt=Mr+2*e((an+Rr*N(an*an-3))/3),Pt=zt*r(Xt),qt=zt*p(Xt)}return x.geoAzimuthalEquidistantRaw.invert(Pt,qt)},Tt}function ue(){var ot=5,dt=x.geoProjectionMutator(le),Tt=dt(ot),Pt=Tt.stream,qt=.01,zt=-r(qt*y),Xt=p(qt*y);return Tt.lobes=function(Mr){return arguments.length?dt(ot=+Mr):ot},Tt.stream=function(Mr){var Rr=Tt.rotate(),Vr=Pt(Mr),an=(Tt.rotate([0,0]),Pt(Mr));return Tt.rotate(Rr),Vr.sphere=function(){an.polygonStart(),an.lineStart();for(var mn=0,zn=360/ot,Gn=2*b/ot,oa=90-180/ot,Fa=A;mn0&&k(qt)>l);return Pt<0?NaN:Tt}function We(ot,dt,Tt){return dt===void 0&&(dt=40),Tt===void 0&&(Tt=g),function(Pt,qt,zt,Xt){var Mr,Rr,Vr;zt=zt===void 0?0:+zt,Xt=Xt===void 0?0:+Xt;for(var an=0;anMr){zt-=Rr/=2,Xt-=Vr/=2;continue}Mr=oa;var Fa=(zt>0?-1:1)*Tt,vi=(Xt>0?-1:1)*Tt,li=ot(zt+Fa,Xt),mi=ot(zt,Xt+vi),no=(li[0]-mn[0])/Fa,To=(li[1]-mn[1])/Fa,go=(mi[0]-mn[0])/vi,Wo=(mi[1]-mn[1])/vi,$s=Wo*no-To*go,Ws=(k($s)<.5?.5:1)/$s;if(Rr=(Gn*go-zn*Wo)*Ws,Vr=(zn*To-Gn*no)*Ws,zt+=Rr,Xt+=Vr,k(Rr)0&&(Mr[1]*=1+Rr/1.5*Mr[0]*Mr[0]),Mr}return Pt.invert=We(Pt),Pt}function yt(){return x.geoProjection(it()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function bt(ot,dt){var Tt=ot*p(dt),Pt=30,qt;do dt-=qt=(dt+p(dt)-Tt)/(1+r(dt));while(k(qt)>l&&--Pt>0);return dt/2}function mt(ot,dt,Tt){function Pt(qt,zt){return[ot*qt*r(zt=bt(Tt,zt)),dt*p(zt)]}return Pt.invert=function(qt,zt){return zt=L(zt/dt),[qt/(ot*r(zt)),L((2*zt+p(2*zt))/Tt)]},Pt}var ht=mt(w/A,w,b);function qe(){return x.geoProjection(ht).scale(169.529)}var ze=2.00276,Ae=1.11072;function Ke(ot,dt){var Tt=bt(b,dt);return[ze*ot/(1/r(dt)+Ae/r(Tt)),(dt+w*p(Tt))/ze]}Ke.invert=function(ot,dt){var Tt=ze*dt,Pt=dt<0?-E:E,qt=25,zt,Xt;do Xt=Tt-w*p(Pt),Pt-=zt=(p(2*Pt)+2*Pt-b*p(Xt))/(2*r(2*Pt)+2+b*r(Xt)*w*r(Pt));while(k(zt)>l&&--qt>0);return Xt=Tt-w*p(Pt),[ot*(1/r(Xt)+Ae/r(Pt))/ze,Xt]};function _t(){return x.geoProjection(Ke).scale(160.857)}function wt(ot){var dt=0,Tt=x.geoProjectionMutator(ot),Pt=Tt(dt);return Pt.parallel=function(qt){return arguments.length?Tt(dt=qt*y):dt*d},Pt}function vt(ot,dt){return[ot*r(dt),dt]}vt.invert=function(ot,dt){return[ot/r(dt),dt]};function $t(){return x.geoProjection(vt).scale(152.63)}function Yt(ot){if(!ot)return vt;var dt=1/T(ot);function Tt(Pt,qt){var zt=dt+ot-qt,Xt=zt&&Pt*r(qt)/zt;return[zt*p(Xt),dt-zt*r(Xt)]}return Tt.invert=function(Pt,qt){var zt=N(Pt*Pt+(qt=dt-qt)*qt),Xt=dt+ot-zt;return[zt/r(Xt)*t(Pt,qt),Xt]},Tt}function lr(){return wt(Yt).scale(123.082).center([0,26.1441]).parallel(45)}function dr(ot){function dt(Tt,Pt){var qt=A-Pt,zt=qt&&Tt*ot*p(qt)/qt;return[qt*p(zt)/ot,A-qt*r(zt)]}return dt.invert=function(Tt,Pt){var qt=Tt*ot,zt=A-Pt,Xt=N(qt*qt+zt*zt),Mr=t(qt,zt);return[(Xt?Xt/p(Xt):1)*Mr/ot,A-Xt]},dt}function Nr(){var ot=.5,dt=x.geoProjectionMutator(dr),Tt=dt(ot);return Tt.fraction=function(Pt){return arguments.length?dt(ot=+Pt):ot},Tt.scale(158.837)}var Fr=mt(1,4/b,b);function ln(){return x.geoProjection(Fr).scale(152.63)}function zr(ot,dt,Tt,Pt,qt,zt){var Xt=r(zt),Mr;if(k(ot)>1||k(zt)>1)Mr=z(Tt*qt+dt*Pt*Xt);else{var Rr=p(ot/2),Vr=p(zt/2);Mr=2*L(N(Rr*Rr+dt*Pt*Vr*Vr))}return k(Mr)>l?[Mr,t(Pt*p(zt),dt*qt-Tt*Pt*Xt)]:[0,0]}function Xr(ot,dt,Tt){return z((ot*ot+dt*dt-Tt*Tt)/(2*ot*dt))}function Ot(ot){return ot-2*b*n((ot+b)/(2*b))}function Qe(ot,dt,Tt){for(var Pt=[[ot[0],ot[1],p(ot[1]),r(ot[1])],[dt[0],dt[1],p(dt[1]),r(dt[1])],[Tt[0],Tt[1],p(Tt[1]),r(Tt[1])]],qt=Pt[2],zt,Xt=0;Xt<3;++Xt,qt=zt)zt=Pt[Xt],qt.v=zr(zt[1]-qt[1],qt[3],qt[2],zt[3],zt[2],zt[0]-qt[0]),qt.point=[0,0];var Mr=Xr(Pt[0].v[0],Pt[2].v[0],Pt[1].v[0]),Rr=Xr(Pt[0].v[0],Pt[1].v[0],Pt[2].v[0]),Vr=b-Mr;Pt[2].point[1]=0,Pt[0].point[0]=-(Pt[1].point[0]=Pt[0].v[0]/2);var an=[Pt[2].point[0]=Pt[0].point[0]+Pt[2].v[0]*r(Mr),2*(Pt[0].point[1]=Pt[1].point[1]=Pt[2].v[0]*p(Mr))];function mn(zn,Gn){var oa=p(Gn),Fa=r(Gn),vi=new Array(3),li;for(li=0;li<3;++li){var mi=Pt[li];if(vi[li]=zr(Gn-mi[1],mi[3],mi[2],Fa,oa,zn-mi[0]),!vi[li][0])return mi.point;vi[li][1]=Ot(vi[li][1]-mi.v[1])}var no=an.slice();for(li=0;li<3;++li){var To=li==2?0:li+1,go=Xr(Pt[li].v[0],vi[li][0],vi[To][0]);vi[li][1]<0&&(go=-go),li?li==1?(go=Rr-go,no[0]-=vi[li][0]*r(go),no[1]-=vi[li][0]*p(go)):(go=Vr-go,no[0]+=vi[li][0]*r(go),no[1]+=vi[li][0]*p(go)):(no[0]+=vi[li][0]*r(go),no[1]-=vi[li][0]*p(go))}return no[0]/=3,no[1]/=3,no}return mn}function ct(ot){return ot[0]*=y,ot[1]*=y,ot}function Ue(){return Ie([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function Ie(ot,dt,Tt){var Pt=x.geoCentroid({type:"MultiPoint",coordinates:[ot,dt,Tt]}),qt=[-Pt[0],-Pt[1]],zt=x.geoRotation(qt),Xt=Qe(ct(zt(ot)),ct(zt(dt)),ct(zt(Tt)));Xt.invert=We(Xt);var Mr=x.geoProjection(Xt).rotate(qt),Rr=Mr.center;return delete Mr.rotate,Mr.center=function(Vr){return arguments.length?Rr(zt(Vr)):zt.invert(Rr())},Mr.clipAngle(90)}function Pe(ot,dt){var Tt=N(1-p(dt));return[2/m*ot*Tt,m*(1-Tt)]}Pe.invert=function(ot,dt){var Tt=(Tt=dt/m-1)*Tt;return[Tt>0?ot*N(b/Tt)/2:0,L(1-Tt)]};function Be(){return x.geoProjection(Pe).scale(95.6464).center([0,30])}function at(ot){var dt=T(ot);function Tt(Pt,qt){return[Pt,(Pt?Pt/p(Pt):1)*(p(qt)*r(Pt)-dt*r(qt))]}return Tt.invert=dt?function(Pt,qt){Pt&&(qt*=p(Pt)/Pt);var zt=r(Pt);return[Pt,2*t(N(zt*zt+dt*dt-qt*qt)-zt,dt-qt)]}:function(Pt,qt){return[Pt,L(Pt?qt*T(Pt)/Pt:qt)]},Tt}function ft(){return wt(at).scale(249.828).clipAngle(90)}var Bt=N(3);function Nt(ot,dt){return[Bt*ot*(2*r(2*dt/3)-1)/m,Bt*m*p(dt/3)]}Nt.invert=function(ot,dt){var Tt=3*L(dt/(Bt*m));return[m*ot/(Bt*(2*r(2*Tt/3)-1)),Tt]};function Ht(){return x.geoProjection(Nt).scale(156.19)}function or(ot){var dt=r(ot);function Tt(Pt,qt){return[Pt*dt,p(qt)/dt]}return Tt.invert=function(Pt,qt){return[Pt/dt,L(qt*dt)]},Tt}function Cr(){return wt(or).parallel(38.58).scale(195.044)}function Sr(ot){var dt=r(ot);function Tt(Pt,qt){return[Pt*dt,(1+dt)*T(qt/2)]}return Tt.invert=function(Pt,qt){return[Pt/dt,e(qt/(1+dt))*2]},Tt}function Tr(){return wt(Sr).scale(124.75)}function Yr(ot,dt){var Tt=N(8/(3*b));return[Tt*ot*(1-k(dt)/b),Tt*dt]}Yr.invert=function(ot,dt){var Tt=N(8/(3*b)),Pt=dt/Tt;return[ot/(Tt*(1-k(Pt)/b)),Pt]};function Fn(){return x.geoProjection(Yr).scale(165.664)}function ua(ot,dt){var Tt=N(4-3*p(k(dt)));return[2/N(6*b)*ot*Tt,v(dt)*N(2*b/3)*(2-Tt)]}ua.invert=function(ot,dt){var Tt=2-k(dt)/N(2*b/3);return[ot*N(6*b)/(2*Tt),v(dt)*L((4-Tt*Tt)/3)]};function ta(){return x.geoProjection(ua).scale(165.664)}function va(ot,dt){var Tt=N(b*(4+b));return[2/Tt*ot*(1+N(1-4*dt*dt/(b*b))),4/Tt*dt]}va.invert=function(ot,dt){var Tt=N(b*(4+b))/2;return[ot*Tt/(1+N(1-dt*dt*(4+b)/(4*b))),dt*Tt/2]};function ma(){return x.geoProjection(va).scale(180.739)}function Jn(ot,dt){var Tt=(2+A)*p(dt);dt/=2;for(var Pt=0,qt=1/0;Pt<10&&k(qt)>l;Pt++){var zt=r(dt);dt-=qt=(dt+p(dt)*(zt+2)-Tt)/(2*zt*(1+zt))}return[2/N(b*(4+b))*ot*(1+r(dt)),2*N(b/(4+b))*p(dt)]}Jn.invert=function(ot,dt){var Tt=dt*N((4+b)/b)/2,Pt=L(Tt),qt=r(Pt);return[ot/(2/N(b*(4+b))*(1+qt)),L((Pt+Tt*(qt+2))/(2+A))]};function ja(){return x.geoProjection(Jn).scale(180.739)}function ti(ot,dt){return[ot*(1+r(dt))/N(2+b),2*dt/N(2+b)]}ti.invert=function(ot,dt){var Tt=N(2+b),Pt=dt*Tt/2;return[Tt*ot/(1+r(Pt)),Pt]};function gr(){return x.geoProjection(ti).scale(173.044)}function Kt(ot,dt){for(var Tt=(1+A)*p(dt),Pt=0,qt=1/0;Pt<10&&k(qt)>l;Pt++)dt-=qt=(dt+p(dt)-Tt)/(1+r(dt));return Tt=N(2+b),[ot*(1+r(dt))/Tt,2*dt/Tt]}Kt.invert=function(ot,dt){var Tt=1+A,Pt=N(Tt/2);return[ot*2*Pt/(1+r(dt*=Pt)),L((dt+p(dt))/Tt)]};function vr(){return x.geoProjection(Kt).scale(173.044)}var _r=3+2*w;function rn(ot,dt){var Tt=p(ot/=2),Pt=r(ot),qt=N(r(dt)),zt=r(dt/=2),Xt=p(dt)/(zt+w*Pt*qt),Mr=N(2/(1+Xt*Xt)),Rr=N((w*zt+(Pt+Tt)*qt)/(w*zt+(Pt-Tt)*qt));return[_r*(Mr*(Rr-1/Rr)-2*i(Rr)),_r*(Mr*Xt*(Rr+1/Rr)-2*e(Xt))]}rn.invert=function(ot,dt){if(!(zt=ae.invert(ot/1.2,dt*1.065)))return null;var Tt=zt[0],Pt=zt[1],qt=20,zt;ot/=_r,dt/=_r;do{var Xt=Tt/2,Mr=Pt/2,Rr=p(Xt),Vr=r(Xt),an=p(Mr),mn=r(Mr),zn=r(Pt),Gn=N(zn),oa=an/(mn+w*Vr*Gn),Fa=oa*oa,vi=N(2/(1+Fa)),li=w*mn+(Vr+Rr)*Gn,mi=w*mn+(Vr-Rr)*Gn,no=li/mi,To=N(no),go=To-1/To,Wo=To+1/To,$s=vi*go-2*i(To)-ot,Ws=vi*oa*Wo-2*e(oa)-dt,As=an&&_*Gn*Rr*Fa/an,Qs=(w*Vr*mn+Gn)/(2*(mn+w*Vr*Gn)*(mn+w*Vr*Gn)*Gn),uu=-.5*oa*vi*vi*vi,Kl=uu*As,Ms=uu*Qs,Es=(Es=2*mn+w*Gn*(Vr-Rr))*Es*To,Mu=(w*Vr*mn*Gn+zn)/Es,Wu=-(w*Rr*an)/(Gn*Es),xc=go*Kl-2*Mu/To+vi*(Mu+Mu/no),ke=go*Ms-2*Wu/To+vi*(Wu+Wu/no),Ye=oa*Wo*Kl-2*As/(1+Fa)+vi*Wo*As+vi*oa*(Mu-Mu/no),pt=oa*Wo*Ms-2*Qs/(1+Fa)+vi*Wo*Qs+vi*oa*(Wu-Wu/no),Lt=ke*Ye-pt*xc;if(!Lt)break;var Rt=(Ws*ke-$s*pt)/Lt,jt=($s*Ye-Ws*xc)/Lt;Tt-=Rt,Pt=a(-A,s(A,Pt-jt))}while((k(Rt)>l||k(jt)>l)&&--qt>0);return k(k(Pt)-A)Pt){var mn=N(an),zn=t(Vr,Rr),Gn=Tt*c(zn/Tt),oa=zn-Gn,Fa=ot*r(oa),vi=(ot*p(oa)-oa*p(Fa))/(A-Fa),li=Ct(oa,vi),mi=(b-ot)/Br(li,Fa,b);Rr=mn;var no=50,To;do Rr-=To=(ot+Br(li,Fa,Rr)*mi-mn)/(li(Rr)*mi);while(k(To)>l&&--no>0);Vr=oa*p(Rr),RrPt){var Rr=N(Mr),Vr=t(Xt,zt),an=Tt*c(Vr/Tt),mn=Vr-an;zt=Rr*r(mn),Xt=Rr*p(mn);for(var zn=zt-A,Gn=p(zt),oa=Xt/Gn,Fa=ztl||k(oa)>l)&&--Fa>0);return[mn,zn]},Rr}var Gr=Qr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Jr(){return x.geoProjection(Gr).scale(149.995)}var yn=Qr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function cn(){return x.geoProjection(yn).scale(153.93)}var Dt=Qr(5/6*b,-.62636,-.0344,0,1.3493,-.05524,0,.045);function yr(){return x.geoProjection(Dt).scale(130.945)}function Hr(ot,dt){var Tt=ot*ot,Pt=dt*dt;return[ot*(1-.162388*Pt)*(.87-952426e-9*Tt*Tt),dt*(1+Pt/12)]}Hr.invert=function(ot,dt){var Tt=ot,Pt=dt,qt=50,zt;do{var Xt=Pt*Pt;Pt-=zt=(Pt*(1+Xt/12)-dt)/(1+Xt/4)}while(k(zt)>l&&--qt>0);qt=50,ot/=1-.162388*Xt;do{var Mr=(Mr=Tt*Tt)*Mr;Tt-=zt=(Tt*(.87-952426e-9*Mr)-ot)/(.87-.00476213*Mr)}while(k(zt)>l&&--qt>0);return[Tt,Pt]};function _n(){return x.geoProjection(Hr).scale(131.747)}var Hn=Qr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function ea(){return x.geoProjection(Hn).scale(131.087)}function Qn(ot){var dt=ot(A,0)[0]-ot(-A,0)[0];function Tt(Pt,qt){var zt=Pt>0?-.5:.5,Xt=ot(Pt+zt*b,qt);return Xt[0]-=zt*dt,Xt}return ot.invert&&(Tt.invert=function(Pt,qt){var zt=Pt>0?-.5:.5,Xt=ot.invert(Pt+zt*dt,qt),Mr=Xt[0]-zt*b;return Mr<-b?Mr+=2*b:Mr>b&&(Mr-=2*b),Xt[0]=Mr,Xt}),Tt}function bn(ot,dt){var Tt=v(ot),Pt=v(dt),qt=r(dt),zt=r(ot)*qt,Xt=p(ot)*qt,Mr=p(Pt*dt);ot=k(t(Xt,Mr)),dt=L(zt),k(ot-A)>l&&(ot%=A);var Rr=$n(ot>b/4?A-ot:ot,dt);return ot>b/4&&(Mr=Rr[0],Rr[0]=-Rr[1],Rr[1]=-Mr),Rr[0]*=Tt,Rr[1]*=-Pt,Rr}bn.invert=function(ot,dt){k(ot)>1&&(ot=v(ot)*2-ot),k(dt)>1&&(dt=v(dt)*2-dt);var Tt=v(ot),Pt=v(dt),qt=-Tt*ot,zt=-Pt*dt,Xt=zt/qt<1,Mr=ki(Xt?zt:qt,Xt?qt:zt),Rr=Mr[0],Vr=Mr[1],an=r(Vr);return Xt&&(Rr=-A-Rr),[Tt*(t(p(Rr)*an,-p(Vr))+b),Pt*L(r(Rr)*an)]};function $n(ot,dt){if(dt===A)return[0,0];var Tt=p(dt),Pt=Tt*Tt,qt=Pt*Pt,zt=1+qt,Xt=1+3*qt,Mr=1-qt,Rr=L(1/N(zt)),Vr=Mr+Pt*zt*Rr,an=(1-Tt)/Vr,mn=N(an),zn=an*zt,Gn=N(zn),oa=mn*Mr,Fa,vi;if(ot===0)return[0,-(oa+Pt*Gn)];var li=r(dt),mi=1/li,no=2*Tt*li,To=(-3*Pt+Rr*Xt)*no,go=(-Vr*li-(1-Tt)*To)/(Vr*Vr),Wo=.5*go/mn,$s=Mr*Wo-2*Pt*mn*no,Ws=Pt*zt*go+an*Xt*no,As=-mi*no,Qs=-mi*Ws,uu=-2*mi*$s,Kl=4*ot/b,Ms;if(ot>.222*b||dt.175*b){if(Fa=(oa+Pt*N(zn*(1+qt)-oa*oa))/(1+qt),ot>b/4)return[Fa,Fa];var Es=Fa,Mu=.5*Fa;Fa=.5*(Mu+Es),vi=50;do{var Wu=N(zn-Fa*Fa),xc=Fa*(uu+As*Wu)+Qs*L(Fa/Gn)-Kl;if(!xc)break;xc<0?Mu=Fa:Es=Fa,Fa=.5*(Mu+Es)}while(k(Es-Mu)>l&&--vi>0)}else{Fa=l,vi=25;do{var ke=Fa*Fa,Ye=N(zn-ke),pt=uu+As*Ye,Lt=Fa*pt+Qs*L(Fa/Gn)-Kl,Rt=pt+(Qs-As*ke)/Ye;Fa-=Ms=Ye?Lt/Rt:0}while(k(Ms)>l&&--vi>0)}return[Fa,-oa-Pt*N(zn-Fa*Fa)]}function ki(ot,dt){for(var Tt=0,Pt=1,qt=.5,zt=50;;){var Xt=qt*qt,Mr=N(qt),Rr=L(1/N(1+Xt)),Vr=1-Xt+qt*(1+Xt)*Rr,an=(1-Mr)/Vr,mn=N(an),zn=an*(1+Xt),Gn=mn*(1-Xt),oa=zn-ot*ot,Fa=N(oa),vi=dt+Gn+qt*Fa;if(k(Pt-Tt)0?Tt=qt:Pt=qt,qt=.5*(Tt+Pt)}if(!zt)return null;var li=L(Mr),mi=r(li),no=1/mi,To=2*Mr*mi,go=(-3*qt+Rr*(1+3*Xt))*To,Wo=(-Vr*mi-(1-Mr)*go)/(Vr*Vr),$s=.5*Wo/mn,Ws=(1-Xt)*$s-2*qt*mn*To,As=-2*no*Ws,Qs=-no*To,uu=-no*(qt*(1+Xt)*Wo+an*(1+3*Xt)*To);return[b/4*(ot*(As+Qs*Fa)+uu*L(ot/N(zn))),li]}function Ua(){return x.geoProjection(Qn(bn)).scale(239.75)}function Fi(ot,dt,Tt){var Pt,qt,zt;return ot?(Pt=Ji(ot,Tt),dt?(qt=Ji(dt,1-Tt),zt=qt[1]*qt[1]+Tt*Pt[0]*Pt[0]*qt[0]*qt[0],[[Pt[0]*qt[2]/zt,Pt[1]*Pt[2]*qt[0]*qt[1]/zt],[Pt[1]*qt[1]/zt,-Pt[0]*Pt[2]*qt[0]*qt[2]/zt],[Pt[2]*qt[1]*qt[2]/zt,-Tt*Pt[0]*Pt[1]*qt[0]/zt]]):[[Pt[0],0],[Pt[1],0],[Pt[2],0]]):(qt=Ji(dt,1-Tt),[[0,qt[0]/qt[1]],[1/qt[1],0],[qt[2]/qt[1],0]])}function Ji(ot,dt){var Tt,Pt,qt,zt,Xt;if(dt=1-l)return Tt=(1-dt)/4,Pt=D(ot),zt=U(ot),qt=1/Pt,Xt=Pt*B(ot),[zt+Tt*(Xt-ot)/(Pt*Pt),qt-Tt*zt*qt*(Xt-ot),qt+Tt*zt*qt*(Xt+ot),2*e(o(ot))-A+Tt*(Xt-ot)/Pt];var Mr=[1,0,0,0,0,0,0,0,0],Rr=[N(dt),0,0,0,0,0,0,0,0],Vr=0;for(Pt=N(1-dt),Xt=1;k(Rr[Vr]/Mr[Vr])>l&&Vr<8;)Tt=Mr[Vr++],Rr[Vr]=(Tt-Pt)/2,Mr[Vr]=(Tt+Pt)/2,Pt=N(Tt*Pt),Xt*=2;qt=Xt*Mr[Vr]*ot;do zt=Rr[Vr]*p(Pt=qt)/Mr[Vr],qt=(L(zt)+qt)/2;while(--Vr);return[p(qt),zt=r(qt),zt/r(qt-Pt),qt]}function fo(ot,dt,Tt){var Pt=k(ot),qt=k(dt),zt=B(qt);if(Pt){var Xt=1/p(Pt),Mr=1/(T(Pt)*T(Pt)),Rr=-(Mr+Tt*(zt*zt*Xt*Xt)-1+Tt),Vr=(Tt-1)*Mr,an=(-Rr+N(Rr*Rr-4*Vr))/2;return[co(e(1/N(an)),Tt)*v(ot),co(e(N((an/Mr-1)/Tt)),1-Tt)*v(dt)]}return[0,co(e(zt),1-Tt)*v(dt)]}function co(ot,dt){if(!dt)return ot;if(dt===1)return i(T(ot/2+E));for(var Tt=1,Pt=N(1-dt),qt=N(dt),zt=0;k(qt)>l;zt++){if(ot%b){var Xt=e(Pt*T(ot)/Tt);Xt<0&&(Xt+=b),ot+=Xt+~~(ot/b)*b}else ot+=ot;qt=(Tt+Pt)/2,Pt=N(Tt*Pt),qt=((Tt=qt)-Pt)/2}return ot/(f(2,zt)*Tt)}function So(ot,dt){var Tt=(w-1)/(w+1),Pt=N(1-Tt*Tt),qt=co(A,Pt*Pt),zt=-1,Xt=i(T(b/4+k(dt)/2)),Mr=o(zt*Xt)/N(Tt),Rr=wi(Mr*r(zt*ot),Mr*p(zt*ot)),Vr=fo(Rr[0],Rr[1],Pt*Pt);return[-Vr[1],(dt>=0?1:-1)*(.5*qt-Vr[0])]}function wi(ot,dt){var Tt=ot*ot,Pt=dt+1,qt=1-Tt-dt*dt;return[.5*((ot>=0?A:-A)-t(qt,2*ot)),-.25*i(qt*qt+4*Tt)+.5*i(Pt*Pt+Tt)]}function ts(ot,dt){var Tt=dt[0]*dt[0]+dt[1]*dt[1];return[(ot[0]*dt[0]+ot[1]*dt[1])/Tt,(ot[1]*dt[0]-ot[0]*dt[1])/Tt]}So.invert=function(ot,dt){var Tt=(w-1)/(w+1),Pt=N(1-Tt*Tt),qt=co(A,Pt*Pt),zt=-1,Xt=Fi(.5*qt-dt,-ot,Pt*Pt),Mr=ts(Xt[0],Xt[1]),Rr=t(Mr[1],Mr[0])/zt;return[Rr,2*e(o(.5/zt*i(Tt*Mr[0]*Mr[0]+Tt*Mr[1]*Mr[1])))-A]};function jo(){return x.geoProjection(Qn(So)).scale(151.496)}function js(ot){var dt=p(ot),Tt=r(ot),Pt=us(ot);Pt.invert=us(-ot);function qt(zt,Xt){var Mr=Pt(zt,Xt);zt=Mr[0],Xt=Mr[1];var Rr=p(Xt),Vr=r(Xt),an=r(zt),mn=z(dt*Rr+Tt*Vr*an),zn=p(mn),Gn=k(zn)>l?mn/zn:1;return[Gn*Tt*p(zt),(k(zt)>A?Gn:-Gn)*(dt*Vr-Tt*Rr*an)]}return qt.invert=function(zt,Xt){var Mr=N(zt*zt+Xt*Xt),Rr=-p(Mr),Vr=r(Mr),an=Mr*Vr,mn=-Xt*Rr,zn=Mr*dt,Gn=N(an*an+mn*mn-zn*zn),oa=t(an*zn+mn*Gn,mn*zn-an*Gn),Fa=(Mr>A?-1:1)*t(zt*Rr,Mr*r(oa)*Vr+Xt*p(oa)*Rr);return Pt.invert(Fa,oa)},qt}function us(ot){var dt=p(ot),Tt=r(ot);return function(Pt,qt){var zt=r(qt),Xt=r(Pt)*zt,Mr=p(Pt)*zt,Rr=p(qt);return[t(Mr,Xt*Tt-Rr*dt),L(Rr*Tt+Xt*dt)]}}function Zo(){var ot=0,dt=x.geoProjectionMutator(js),Tt=dt(ot),Pt=Tt.rotate,qt=Tt.stream,zt=x.geoCircle();return Tt.parallel=function(Xt){if(!arguments.length)return ot*d;var Mr=Tt.rotate();return dt(ot=Xt*y).rotate(Mr)},Tt.rotate=function(Xt){return arguments.length?(Pt.call(Tt,[Xt[0],Xt[1]-ot*d]),zt.center([-Xt[0],-Xt[1]]),Tt):(Xt=Pt.call(Tt),Xt[1]+=ot*d,Xt)},Tt.stream=function(Xt){return Xt=qt(Xt),Xt.sphere=function(){Xt.polygonStart();var Mr=.01,Rr=zt.radius(90-Mr)().coordinates[0],Vr=Rr.length-1,an=-1,mn;for(Xt.lineStart();++an=0;)Xt.point((mn=Rr[an])[0],mn[1]);Xt.lineEnd(),Xt.polygonEnd()},Xt},Tt.scale(79.4187).parallel(45).clipAngle(180-.001)}var No=3,Vs=L(1-1/No)*d,Ns=or(0);function rl(ot){var dt=Vs*y,Tt=Pe(b,dt)[0]-Pe(-b,dt)[0],Pt=Ns(0,dt)[1],qt=Pe(0,dt)[1],zt=m-qt,Xt=u/ot,Mr=4/u,Rr=Pt+zt*zt*4/u;function Vr(an,mn){var zn,Gn=k(mn);if(Gn>dt){var oa=s(ot-1,a(0,n((an+b)/Xt)));an+=b*(ot-1)/ot-oa*Xt,zn=Pe(an,Gn),zn[0]=zn[0]*u/Tt-u*(ot-1)/(2*ot)+oa*u/ot,zn[1]=Pt+(zn[1]-qt)*4*zt/u,mn<0&&(zn[1]=-zn[1])}else zn=Ns(an,mn);return zn[0]*=Mr,zn[1]/=Rr,zn}return Vr.invert=function(an,mn){an/=Mr,mn*=Rr;var zn=k(mn);if(zn>Pt){var Gn=s(ot-1,a(0,n((an+b)/Xt)));an=(an+b*(ot-1)/ot-Gn*Xt)*Tt/u;var oa=Pe.invert(an,.25*(zn-Pt)*u/zt+qt);return oa[0]-=b*(ot-1)/ot-Gn*Xt,mn<0&&(oa[1]=-oa[1]),oa}return Ns.invert(an,mn)},Vr}function cs(ot,dt){return[ot,dt&1?90-l:Vs]}function $o(ot,dt){return[ot,dt&1?-90+l:-Vs]}function yo(ot){return[ot[0]*(1-l),ot[1]]}function fs(ot){var dt=[].concat(S.range(-180,180+ot/2,ot).map(cs),S.range(180,-180-ot/2,-ot).map($o));return{type:"Polygon",coordinates:[ot===180?dt.map(yo):dt]}}function nl(){var ot=4,dt=x.geoProjectionMutator(rl),Tt=dt(ot),Pt=Tt.stream;return Tt.lobes=function(qt){return arguments.length?dt(ot=+qt):ot},Tt.stream=function(qt){var zt=Tt.rotate(),Xt=Pt(qt),Mr=(Tt.rotate([0,0]),Pt(qt));return Tt.rotate(zt),Xt.sphere=function(){x.geoStream(fs(180/ot),Mr)},Xt},Tt.scale(239.75)}function wl(ot){var dt=1+ot,Tt=p(1/dt),Pt=L(Tt),qt=2*N(b/(zt=b+4*Pt*dt)),zt,Xt=.5*qt*(dt+N(ot*(2+ot))),Mr=ot*ot,Rr=dt*dt;function Vr(an,mn){var zn=1-p(mn),Gn,oa;if(zn&&zn<2){var Fa=A-mn,vi=25,li;do{var mi=p(Fa),no=r(Fa),To=Pt+t(mi,dt-no),go=1+Rr-2*dt*no;Fa-=li=(Fa-Mr*Pt-dt*mi+go*To-.5*zn*zt)/(2*dt*mi*To)}while(k(li)>g&&--vi>0);Gn=qt*N(go),oa=an*To/b}else Gn=qt*(ot+zn),oa=an*Pt/b;return[Gn*p(oa),Xt-Gn*r(oa)]}return Vr.invert=function(an,mn){var zn=an*an+(mn-=Xt)*mn,Gn=(1+Rr-zn/(qt*qt))/(2*dt),oa=z(Gn),Fa=p(oa),vi=Pt+t(Fa,dt-Gn);return[L(an/N(zn))*b/vi,L(1-2*(oa-Mr*Pt-dt*Fa+(1+Rr-2*dt*Gn)*vi)/zt)]},Vr}function Ml(){var ot=1,dt=x.geoProjectionMutator(wl),Tt=dt(ot);return Tt.ratio=function(Pt){return arguments.length?dt(ot=+Pt):ot},Tt.scale(167.774).center([0,18.67])}var Ts=.7109889596207567,Ai=.0528035274542;function uo(ot,dt){return dt>-Ts?(ot=ht(ot,dt),ot[1]+=Ai,ot):vt(ot,dt)}uo.invert=function(ot,dt){return dt>-Ts?ht.invert(ot,dt-Ai):vt.invert(ot,dt)};function Tl(){return x.geoProjection(uo).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function Cs(ot,dt){return k(dt)>Ts?(ot=ht(ot,dt),ot[1]-=dt>0?Ai:-Ai,ot):vt(ot,dt)}Cs.invert=function(ot,dt){return k(dt)>Ts?ht.invert(ot,dt+(dt>0?Ai:-Ai)):vt.invert(ot,dt)};function Ro(){return x.geoProjection(Cs).scale(152.63)}function El(ot,dt,Tt,Pt){var qt=N(4*b/(2*Tt+(1+ot-dt/2)*p(2*Tt)+(ot+dt)/2*p(4*Tt)+dt/2*p(6*Tt))),zt=N(Pt*p(Tt)*N((1+ot*r(2*Tt)+dt*r(4*Tt))/(1+ot+dt))),Xt=Tt*Rr(1);function Mr(mn){return N(1+ot*r(2*mn)+dt*r(4*mn))}function Rr(mn){var zn=mn*Tt;return(2*zn+(1+ot-dt/2)*p(2*zn)+(ot+dt)/2*p(4*zn)+dt/2*p(6*zn))/Tt}function Vr(mn){return Mr(mn)*p(mn)}var an=function(mn,zn){var Gn=Tt*Xe(Rr,Xt*p(zn)/Tt,zn/b);isNaN(Gn)&&(Gn=Tt*v(zn));var oa=qt*Mr(Gn);return[oa*zt*mn/b*r(Gn),oa/zt*p(Gn)]};return an.invert=function(mn,zn){var Gn=Xe(Vr,zn*zt/qt);return[mn*b/(r(Gn)*qt*zt*Mr(Gn)),L(Tt*Rr(Gn/Tt)/Xt)]},Tt===0&&(qt=N(Pt/b),an=function(mn,zn){return[mn*qt,p(zn)/qt]},an.invert=function(mn,zn){return[mn/qt,L(zn*qt)]}),an}function qs(){var ot=1,dt=0,Tt=45*y,Pt=2,qt=x.geoProjectionMutator(El),zt=qt(ot,dt,Tt,Pt);return zt.a=function(Xt){return arguments.length?qt(ot=+Xt,dt,Tt,Pt):ot},zt.b=function(Xt){return arguments.length?qt(ot,dt=+Xt,Tt,Pt):dt},zt.psiMax=function(Xt){return arguments.length?qt(ot,dt,Tt=+Xt*y,Pt):Tt*d},zt.ratio=function(Xt){return arguments.length?qt(ot,dt,Tt,Pt=+Xt):Pt},zt.scale(180.739)}function al(ot,dt,Tt,Pt,qt,zt,Xt,Mr,Rr,Vr,an){if(an.nanEncountered)return NaN;var mn,zn,Gn,oa,Fa,vi,li,mi,no,To;if(mn=Tt-dt,zn=ot(dt+mn*.25),Gn=ot(Tt-mn*.25),isNaN(zn)){an.nanEncountered=!0;return}if(isNaN(Gn)){an.nanEncountered=!0;return}return oa=mn*(Pt+4*zn+qt)/12,Fa=mn*(qt+4*Gn+zt)/12,vi=oa+Fa,To=(vi-Xt)/15,Vr>Rr?(an.maxDepthCount++,vi+To):Math.abs(To)>1;do Rr[vi]>Gn?Fa=vi:oa=vi,vi=oa+Fa>>1;while(vi>oa);var li=Rr[vi+1]-Rr[vi];return li&&(li=(Gn-Rr[vi+1])/li),(vi+1+li)/Xt}var mn=2*an(1)/b*zt/Tt,zn=function(Gn,oa){var Fa=an(k(p(oa))),vi=Pt(Fa)*Gn;return Fa/=mn,[vi,oa>=0?Fa:-Fa]};return zn.invert=function(Gn,oa){var Fa;return oa*=mn,k(oa)<1&&(Fa=v(oa)*L(qt(k(oa))*zt)),[Gn/Pt(k(oa)),Fa]},zn}function vs(){var ot=0,dt=2.5,Tt=1.183136,Pt=x.geoProjectionMutator(io),qt=Pt(ot,dt,Tt);return qt.alpha=function(zt){return arguments.length?Pt(ot=+zt,dt,Tt):ot},qt.k=function(zt){return arguments.length?Pt(ot,dt=+zt,Tt):dt},qt.gamma=function(zt){return arguments.length?Pt(ot,dt,Tt=+zt):Tt},qt.scale(152.63)}function rs(ot,dt){return k(ot[0]-dt[0])=0;--Rr)Tt=ot[1][Rr],Pt=Tt[0][0],qt=Tt[0][1],zt=Tt[1][1],Xt=Tt[2][0],Mr=Tt[2][1],dt.push(Bl([[Xt-l,Mr-l],[Xt-l,zt+l],[Pt+l,zt+l],[Pt+l,qt-l]],30));return{type:"Polygon",coordinates:[S.merge(dt)]}}function Lo(ot,dt,Tt){var Pt,qt;function zt(Rr,Vr){for(var an=Vr<0?-1:1,mn=dt[+(Vr<0)],zn=0,Gn=mn.length-1;znmn[zn][2][0];++zn);var oa=ot(Rr-mn[zn][1][0],Vr);return oa[0]+=ot(mn[zn][1][0],an*Vr>an*mn[zn][0][1]?mn[zn][0][1]:Vr)[0],oa}Tt?zt.invert=Tt(zt):ot.invert&&(zt.invert=function(Rr,Vr){for(var an=qt[+(Vr<0)],mn=dt[+(Vr<0)],zn=0,Gn=an.length;znoa&&(Fa=Gn,Gn=oa,oa=Fa),[[mn,Gn],[zn,oa]]})}),Xt):dt.map(function(Vr){return Vr.map(function(an){return[[an[0][0]*d,an[0][1]*d],[an[1][0]*d,an[1][1]*d],[an[2][0]*d,an[2][1]*d]]})})},dt!=null&&Xt.lobes(dt),Xt}var tu=[[[[-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 su(){return Lo(Ke,tu).scale(160.857)}var Ds=[[[[-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 vl(){return Lo(Cs,Ds).scale(152.63)}var Il=[[[[-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 zl(){return Lo(ht,Il).scale(169.529)}var Ou=[[[[-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 qc(){return Lo(ht,Ou).scale(169.529).rotate([20,0])}var Mc=[[[[-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 Dc(){return Lo(uo,Mc,We).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var rh=[[[[-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 Hf(){return Lo(vt,rh).scale(152.63).rotate([-20,0])}function ml(ot,dt){return[3/u*ot*N(b*b/3-dt*dt),dt]}ml.invert=function(ot,dt){return[u/3*ot/N(b*b/3-dt*dt),dt]};function vc(){return x.geoProjection(ml).scale(158.837)}function nh(ot){function dt(Tt,Pt){if(k(k(Pt)-A)2)return null;Tt/=2,Pt/=2;var zt=Tt*Tt,Xt=Pt*Pt,Mr=2*Pt/(1+zt+Xt);return Mr=f((1+Mr)/(1-Mr),1/ot),[t(2*Tt,1-zt-Xt)/ot,L((Mr-1)/(Mr+1))]},dt}function Gu(){var ot=.5,dt=x.geoProjectionMutator(nh),Tt=dt(ot);return Tt.spacing=function(Pt){return arguments.length?dt(ot=+Pt):ot},Tt.scale(124.75)}var zu=b/w;function Hu(ot,dt){return[ot*(1+N(r(dt)))/2,dt/(r(dt/2)*r(ot/6))]}Hu.invert=function(ot,dt){var Tt=k(ot),Pt=k(dt),qt=l,zt=A;Ptl||k(vi)>l)&&--qt>0);return qt&&[Tt,Pt]};function Fu(){return x.geoProjection($l).scale(139.98)}function Bs(ot,dt){return[p(ot)/r(dt),T(dt)*r(ot)]}Bs.invert=function(ot,dt){var Tt=ot*ot,Pt=dt*dt,qt=Pt+1,zt=Tt+qt,Xt=ot?_*N((zt-N(zt*zt-4*Tt))/Tt):1/N(qt);return[L(ot*Xt),v(dt)*z(Xt)]};function kl(){return x.geoProjection(Bs).scale(144.049).clipAngle(90-.001)}function rf(ot){var dt=r(ot),Tt=T(E+ot/2);function Pt(qt,zt){var Xt=zt-ot,Mr=k(Xt)=0;)an=ot[Vr],mn=an[0]+Mr*(Gn=mn)-Rr*zn,zn=an[1]+Mr*zn+Rr*Gn;return mn=Mr*(Gn=mn)-Rr*zn,zn=Mr*zn+Rr*Gn,[mn,zn]}return Tt.invert=function(Pt,qt){var zt=20,Xt=Pt,Mr=qt;do{for(var Rr=dt,Vr=ot[Rr],an=Vr[0],mn=Vr[1],zn=0,Gn=0,oa;--Rr>=0;)Vr=ot[Rr],zn=an+Xt*(oa=zn)-Mr*Gn,Gn=mn+Xt*Gn+Mr*oa,an=Vr[0]+Xt*(oa=an)-Mr*mn,mn=Vr[1]+Xt*mn+Mr*oa;zn=an+Xt*(oa=zn)-Mr*Gn,Gn=mn+Xt*Gn+Mr*oa,an=Xt*(oa=an)-Mr*mn-Pt,mn=Xt*mn+Mr*oa-qt;var Fa=zn*zn+Gn*Gn,vi,li;Xt-=vi=(an*zn+mn*Gn)/Fa,Mr-=li=(mn*zn-an*Gn)/Fa}while(k(vi)+k(li)>l*l&&--zt>0);if(zt){var mi=N(Xt*Xt+Mr*Mr),no=2*e(mi*.5),To=p(no);return[t(Xt*To,mi*r(no)),mi?L(Mr*To/mi):0]}},Tt}var Rs=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Yh=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],ul=[[.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]],kf=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Oc(){return Nu(Rs,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function Cu(){return Nu(Yh,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function ah(){return Nu(ul,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function pf(){return Nu(Do,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function Nf(){return Nu(kf,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Nu(ot,dt){var Tt=x.geoProjection(Rh(ot)).rotate(dt).clipAngle(90),Pt=x.geoRotation(dt),qt=Tt.center;return delete Tt.rotate,Tt.center=function(zt){return arguments.length?qt(Pt(zt)):Pt.invert(qt())},Tt}var Eh=N(6),fh=N(7);function Bf(ot,dt){var Tt=L(7*p(dt)/(3*Eh));return[Eh*ot*(2*r(2*Tt/3)-1)/fh,9*p(Tt/3)/fh]}Bf.invert=function(ot,dt){var Tt=3*L(dt*fh/9);return[ot*fh/(Eh*(2*r(2*Tt/3)-1)),L(p(Tt)*3*Eh/7)]};function vf(){return x.geoProjection(Bf).scale(164.859)}function ih(ot,dt){for(var Tt=(1+_)*p(dt),Pt=dt,qt=0,zt;qt<25&&(Pt-=zt=(p(Pt/2)+p(Pt)-Tt)/(.5*r(Pt/2)+r(Pt)),!(k(zt)g&&--Pt>0);return zt=Tt*Tt,Xt=zt*zt,Mr=zt*Xt,[ot/(.84719-.13063*zt+Mr*Mr*(-.04515+.05494*zt-.02326*Xt+.00331*Mr)),Tt]};function Gc(){return x.geoProjection(nf).scale(175.295)}function Bu(ot,dt){return[ot*(1+r(dt))/2,2*(dt-T(dt/2))]}Bu.invert=function(ot,dt){for(var Tt=dt/2,Pt=0,qt=1/0;Pt<10&&k(qt)>l;++Pt){var zt=r(dt/2);dt-=qt=(dt-T(dt/2)-Tt)/(1-.5/(zt*zt))}return[2*ot/(1+r(dt)),dt]};function Af(){return x.geoProjection(Bu).scale(152.63)}var sh=[[[[-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 Dl(){return Lo(Te(1/0),sh).rotate([20,0]).scale(152.63)}function $f(ot,dt){var Tt=p(dt),Pt=r(dt),qt=v(ot);if(ot===0||k(dt)===A)return[0,dt];if(dt===0)return[ot,0];if(k(ot)===A)return[ot*Pt,A*Tt];var zt=b/(2*ot)-2*ot/b,Xt=2*dt/b,Mr=(1-Xt*Xt)/(Tt-Xt),Rr=zt*zt,Vr=Mr*Mr,an=1+Rr/Vr,mn=1+Vr/Rr,zn=(zt*Tt/Mr-zt/2)/an,Gn=(Vr*Tt/Rr+Mr/2)/mn,oa=zn*zn+Pt*Pt/an,Fa=Gn*Gn-(Vr*Tt*Tt/Rr+Mr*Tt-1)/mn;return[A*(zn+N(oa)*qt),A*(Gn+N(Fa<0?0:Fa)*v(-dt*zt)*qt)]}$f.invert=function(ot,dt){ot/=A,dt/=A;var Tt=ot*ot,Pt=dt*dt,qt=Tt+Pt,zt=b*b;return[ot?(qt-1+N((1-qt)*(1-qt)+4*Tt))/(2*ot)*A:0,Xe(function(Xt){return qt*(b*p(Xt)-2*Xt)*b+4*Xt*Xt*(dt-p(Xt))+2*b*Xt-zt*dt},0)]};function Oh(){return x.geoProjection($f).scale(127.267)}var dh=1.0148,Uf=.23185,ph=-.14499,mc=.02406,vh=dh,du=5*Uf,gc=7*ph,mf=9*mc,Wl=1.790857183;function af(ot,dt){var Tt=dt*dt;return[ot,dt*(dh+Tt*Tt*(Uf+Tt*(ph+mc*Tt)))]}af.invert=function(ot,dt){dt>Wl?dt=Wl:dt<-Wl&&(dt=-Wl);var Tt=dt,Pt;do{var qt=Tt*Tt;Tt-=Pt=(Tt*(dh+qt*qt*(Uf+qt*(ph+mc*qt)))-dt)/(vh+qt*qt*(du+qt*(gc+mf*qt)))}while(k(Pt)>l);return[ot,Tt]};function ac(){return x.geoProjection(af).scale(139.319)}function yc(ot,dt){if(k(dt)l&&--qt>0);return Xt=T(Pt),[(k(dt)=0;)if(Pt=dt[Mr],Tt[0]===Pt[0]&&Tt[1]===Pt[1]){if(zt)return[zt,Tt];zt=Tt}}}function $u(ot){for(var dt=ot.length,Tt=[],Pt=ot[dt-1],qt=0;qt0?[-Pt[0],0]:[180-Pt[0],180])};var dt=Df.map(function(Tt){return{face:Tt,project:ot(Tt)}});return[-1,0,0,1,0,1,4,5].forEach(function(Tt,Pt){var qt=dt[Tt];qt&&(qt.children||(qt.children=[])).push(dt[Pt])}),Pf(dt[0],function(Tt,Pt){return dt[Tt<-b/2?Pt<0?6:4:Tt<0?Pt<0?2:0:TtPt^Gn>Pt&&Tt<(zn-Vr)*(Pt-an)/(Gn-an)+Vr&&(qt=!qt)}return qt}function Xu(ot,dt){var Tt=dt.stream,Pt;if(!Tt)throw new Error("invalid projection");switch(ot&&ot.type){case"Feature":Pt=Cc;break;case"FeatureCollection":Pt=gh;break;default:Pt=Wc;break}return Pt(ot,Tt)}function gh(ot,dt){return{type:"FeatureCollection",features:ot.features.map(function(Tt){return Cc(Tt,dt)})}}function Cc(ot,dt){return{type:"Feature",id:ot.id,properties:ot.properties,geometry:Wc(ot.geometry,dt)}}function of(ot,dt){return{type:"GeometryCollection",geometries:ot.geometries.map(function(Tt){return Wc(Tt,dt)})}}function Wc(ot,dt){if(!ot)return null;if(ot.type==="GeometryCollection")return of(ot,dt);var Tt;switch(ot.type){case"Point":Tt=lu;break;case"MultiPoint":Tt=lu;break;case"LineString":Tt=_f;break;case"MultiLineString":Tt=_f;break;case"Polygon":Tt=Yc;break;case"MultiPolygon":Tt=Yc;break;case"Sphere":Tt=Yc;break;default:return null}return x.geoStream(ot,dt(Tt)),Tt.result()}var gu=[],uc=[],lu={point:function(ot,dt){gu.push([ot,dt])},result:function(){var ot=gu.length?gu.length<2?{type:"Point",coordinates:gu[0]}:{type:"MultiPoint",coordinates:gu}:null;return gu=[],ot}},_f={lineStart:$c,point:function(ot,dt){gu.push([ot,dt])},lineEnd:function(){gu.length&&(uc.push(gu),gu=[])},result:function(){var ot=uc.length?uc.length<2?{type:"LineString",coordinates:uc[0]}:{type:"MultiLineString",coordinates:uc}:null;return uc=[],ot}},Yc={polygonStart:$c,lineStart:$c,point:function(ot,dt){gu.push([ot,dt])},lineEnd:function(){var ot=gu.length;if(ot){do gu.push(gu[0].slice());while(++ot<4);uc.push(gu),gu=[]}},polygonEnd:$c,result:function(){if(!uc.length)return null;var ot=[],dt=[];return uc.forEach(function(Tt){qf(Tt)?ot.push([Tt]):dt.push(Tt)}),dt.forEach(function(Tt){var Pt=Tt[0];ot.some(function(qt){if(Fh(qt[0],Pt))return qt.push(Tt),!0})||ot.push([Tt])}),uc=[],ot.length?ot.length>1?{type:"MultiPolygon",coordinates:ot}:{type:"Polygon",coordinates:ot[0]}:null}};function uh(ot){var dt=ot(A,0)[0]-ot(-A,0)[0];function Tt(Pt,qt){var zt=k(Pt)0?Pt-b:Pt+b,qt),Mr=(Xt[0]-Xt[1])*_,Rr=(Xt[0]+Xt[1])*_;if(zt)return[Mr,Rr];var Vr=dt*_,an=Mr>0^Rr>0?-1:1;return[an*Mr-v(Rr)*Vr,an*Rr-v(Mr)*Vr]}return ot.invert&&(Tt.invert=function(Pt,qt){var zt=(Pt+qt)*_,Xt=(qt-Pt)*_,Mr=k(zt)<.5*dt&&k(Xt)<.5*dt;if(!Mr){var Rr=dt*_,Vr=zt>0^Xt>0?-1:1,an=-Vr*Pt+(Xt>0?1:-1)*Rr,mn=-Vr*qt+(zt>0?1:-1)*Rr;zt=(-an-mn)*_,Xt=(an-mn)*_}var zn=ot.invert(zt,Xt);return Mr||(zn[0]+=zt>0?b:-b),zn}),x.geoProjection(Tt).rotate([-90,-90,45]).clipAngle(180-.001)}function br(){return uh(bn).scale(176.423)}function qr(){return uh(So).scale(111.48)}function An(ot,dt){if(!(0<=(dt=+dt)&&dt<=20))throw new Error("invalid digits");function Tt(Vr){var an=Vr.length,mn=2,zn=new Array(an);for(zn[0]=+Vr[0].toFixed(dt),zn[1]=+Vr[1].toFixed(dt);mn2||Gn[0]!=an[0]||Gn[1]!=an[1])&&(mn.push(Gn),an=Gn)}return mn.length===1&&Vr.length>1&&mn.push(Tt(Vr[Vr.length-1])),mn}function zt(Vr){return Vr.map(qt)}function Xt(Vr){if(Vr==null)return Vr;var an;switch(Vr.type){case"GeometryCollection":an={type:"GeometryCollection",geometries:Vr.geometries.map(Xt)};break;case"Point":an={type:"Point",coordinates:Tt(Vr.coordinates)};break;case"MultiPoint":an={type:Vr.type,coordinates:Pt(Vr.coordinates)};break;case"LineString":an={type:Vr.type,coordinates:qt(Vr.coordinates)};break;case"MultiLineString":case"Polygon":an={type:Vr.type,coordinates:zt(Vr.coordinates)};break;case"MultiPolygon":an={type:"MultiPolygon",coordinates:Vr.coordinates.map(zt)};break;default:return Vr}return Vr.bbox!=null&&(an.bbox=Vr.bbox),an}function Mr(Vr){var an={type:"Feature",properties:Vr.properties,geometry:Xt(Vr.geometry)};return Vr.id!=null&&(an.id=Vr.id),Vr.bbox!=null&&(an.bbox=Vr.bbox),an}if(ot!=null)switch(ot.type){case"Feature":return Mr(ot);case"FeatureCollection":{var Rr={type:"FeatureCollection",features:ot.features.map(Mr)};return ot.bbox!=null&&(Rr.bbox=ot.bbox),Rr}default:return Xt(ot)}return ot}function vn(ot){var dt=p(ot);function Tt(Pt,qt){var zt=dt?T(Pt*dt/2)/dt:Pt/2;if(!qt)return[2*zt,-ot];var Xt=2*e(zt*p(qt)),Mr=1/T(qt);return[p(Xt)*Mr,qt+(1-r(Xt))*Mr-ot]}return Tt.invert=function(Pt,qt){if(k(qt+=ot)l&&--Mr>0);var zn=Pt*(Vr=T(Xt)),Gn=T(k(qt)0?A:-A)*(Rr+qt*(an-Xt)/2+qt*qt*(an-2*Rr+Xt)/2)]}Ra.invert=function(ot,dt){var Tt=dt/A,Pt=Tt*90,qt=s(18,k(Pt/5)),zt=a(0,n(qt));do{var Xt=Na[zt][1],Mr=Na[zt+1][1],Rr=Na[s(19,zt+2)][1],Vr=Rr-Xt,an=Rr-2*Mr+Xt,mn=2*(k(Tt)-Mr)/Vr,zn=an/Vr,Gn=mn*(1-zn*mn*(1-2*zn*mn));if(Gn>=0||zt===1){Pt=(dt>=0?5:-5)*(Gn+qt);var oa=50,Fa;do qt=s(18,k(Pt)/5),zt=n(qt),Gn=qt-zt,Xt=Na[zt][1],Mr=Na[zt+1][1],Rr=Na[s(19,zt+2)][1],Pt-=(Fa=(dt>=0?A:-A)*(Mr+Gn*(Rr-Xt)/2+Gn*Gn*(Rr-2*Mr+Xt)/2)-dt)*d;while(k(Fa)>g&&--oa>0);break}}while(--zt>=0);var vi=Na[zt][0],li=Na[zt+1][0],mi=Na[s(19,zt+2)][0];return[ot/(li+Gn*(mi-vi)/2+Gn*Gn*(mi-2*li+vi)/2),Pt*y]};function pi(){return x.geoProjection(Ra).scale(152.63)}function xi(ot){function dt(Tt,Pt){var qt=r(Pt),zt=(ot-1)/(ot-qt*r(Tt));return[zt*qt*p(Tt),zt*p(Pt)]}return dt.invert=function(Tt,Pt){var qt=Tt*Tt+Pt*Pt,zt=N(qt),Xt=(ot-N(1-qt*(ot+1)/(ot-1)))/((ot-1)/zt+zt/(ot-1));return[t(Tt*Xt,zt*N(1-Xt*Xt)),zt?L(Pt*Xt/zt):0]},dt}function $i(ot,dt){var Tt=xi(ot);if(!dt)return Tt;var Pt=r(dt),qt=p(dt);function zt(Xt,Mr){var Rr=Tt(Xt,Mr),Vr=Rr[1],an=Vr*qt/(ot-1)+Pt;return[Rr[0]*Pt/an,Vr/an]}return zt.invert=function(Xt,Mr){var Rr=(ot-1)/(ot-1-Mr*qt);return Tt.invert(Rr*Xt,Rr*Mr*Pt)},zt}function ni(){var ot=2,dt=0,Tt=x.geoProjectionMutator($i),Pt=Tt(ot,dt);return Pt.distance=function(qt){return arguments.length?Tt(ot=+qt,dt):ot},Pt.tilt=function(qt){return arguments.length?Tt(ot,dt=qt*y):dt*d},Pt.scale(432.147).clipAngle(z(1/ot)*d-1e-6)}var Ii=1e-4,hi=1e4,Ja=-180,eo=Ja+Ii,zo=180,Io=zo-Ii,Vo=-90,Bo=Vo+Ii,ro=90,Ni=ro-Ii;function ns(ot){return ot.length>0}function Os(ot){return Math.floor(ot*hi)/hi}function yl(ot){return ot===Vo||ot===ro?[0,ot]:[Ja,Os(ot)]}function jl(ot){var dt=ot[0],Tt=ot[1],Pt=!1;return dt<=eo?(dt=Ja,Pt=!0):dt>=Io&&(dt=zo,Pt=!0),Tt<=Bo?(Tt=Vo,Pt=!0):Tt>=Ni&&(Tt=ro,Pt=!0),Pt?[dt,Tt]:ot}function _l(ot){return ot.map(jl)}function Vl(ot,dt,Tt){for(var Pt=0,qt=ot.length;Pt=Io||an<=Bo||an>=Ni){zt[Xt]=jl(Rr);for(var mn=Xt+1;mneo&&GnBo&&oa=Mr)break;Tt.push({index:-1,polygon:dt,ring:zt=zt.slice(mn-1)}),zt[0]=yl(zt[0][1]),Xt=-1,Mr=zt.length}}}}function Ks(ot){var dt,Tt=ot.length,Pt={},qt={},zt,Xt,Mr,Rr,Vr;for(dt=0;dt0?b-Mr:Mr)*d],Vr=x.geoProjection(ot(Xt)).rotate(Rr),an=x.geoRotation(Rr),mn=Vr.center;return delete Vr.rotate,Vr.center=function(zn){return arguments.length?mn(an(zn)):an.invert(mn())},Vr.clipAngle(90)}function cl(ot){var dt=r(ot);function Tt(Pt,qt){var zt=x.geoGnomonicRaw(Pt,qt);return zt[0]*=dt,zt}return Tt.invert=function(Pt,qt){return x.geoGnomonicRaw.invert(Pt/dt,qt)},Tt}function ic(){return oc([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function oc(ot,dt){return Cl(cl,ot,dt)}function cc(ot){if(!(ot*=2))return x.geoAzimuthalEquidistantRaw;var dt=-ot/2,Tt=-dt,Pt=ot*ot,qt=T(Tt),zt=.5/p(Tt);function Xt(Mr,Rr){var Vr=z(r(Rr)*r(Mr-dt)),an=z(r(Rr)*r(Mr-Tt)),mn=Rr<0?-1:1;return Vr*=Vr,an*=an,[(Vr-an)/(2*ot),mn*N(4*Pt*an-(Pt-Vr+an)*(Pt-Vr+an))/(2*ot)]}return Xt.invert=function(Mr,Rr){var Vr=Rr*Rr,an=r(N(Vr+(zn=Mr+dt)*zn)),mn=r(N(Vr+(zn=Mr+Tt)*zn)),zn,Gn;return[t(Gn=an-mn,zn=(an+mn)*qt),(Rr<0?-1:1)*z(N(zn*zn+Gn*Gn)*zt)]},Xt}function Sf(){return sc([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function sc(ot,dt){return Cl(cc,ot,dt)}function sf(ot,dt){if(k(dt)l&&--Mr>0);return[v(ot)*(N(qt*qt+4)+qt)*b/4,A*Xt]};function bc(){return x.geoProjection(Pc).scale(127.16)}function Je(ot,dt,Tt,Pt,qt){function zt(Xt,Mr){var Rr=Tt*p(Pt*Mr),Vr=N(1-Rr*Rr),an=N(2/(1+Vr*r(Xt*=qt)));return[ot*Vr*an*p(Xt),dt*Rr*an]}return zt.invert=function(Xt,Mr){var Rr=Xt/ot,Vr=Mr/dt,an=N(Rr*Rr+Vr*Vr),mn=2*L(an/2);return[t(Xt*T(mn),ot*an)/qt,an&&L(Mr*p(mn)/(dt*Tt*an))/Pt]},zt}function I(ot,dt,Tt,Pt){var qt=b/3;ot=a(ot,l),dt=a(dt,l),ot=s(ot,A),dt=s(dt,b-l),Tt=a(Tt,0),Tt=s(Tt,100-l),Pt=a(Pt,l);var zt=Tt/100+1,Xt=Pt/100,Mr=z(zt*r(qt))/qt,Rr=p(ot)/p(Mr*A),Vr=dt/b,an=N(Xt*p(ot/2)/p(dt/2)),mn=an/N(Vr*Rr*Mr),zn=1/(an*N(Vr*Rr*Mr));return Je(mn,zn,Rr,Mr,Vr)}function ce(){var ot=65*y,dt=60*y,Tt=20,Pt=200,qt=x.geoProjectionMutator(I),zt=qt(ot,dt,Tt,Pt);return zt.poleline=function(Xt){return arguments.length?qt(ot=+Xt*y,dt,Tt,Pt):ot*d},zt.parallels=function(Xt){return arguments.length?qt(ot,dt=+Xt*y,Tt,Pt):dt*d},zt.inflation=function(Xt){return arguments.length?qt(ot,dt,Tt=+Xt,Pt):Tt},zt.ratio=function(Xt){return arguments.length?qt(ot,dt,Tt,Pt=+Xt):Pt},zt.scale(163.775)}function Ne(){return ce().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var je=4*b+3*N(3),Ze=2*N(2*b*N(3)/je),kt=mt(Ze*N(3)/b,Ze,je/6);function Ft(){return x.geoProjection(kt).scale(176.84)}function tr(ot,dt){return[ot*N(1-3*dt*dt/(b*b)),dt]}tr.invert=function(ot,dt){return[ot/N(1-3*dt*dt/(b*b)),dt]};function xr(){return x.geoProjection(tr).scale(152.63)}function Or(ot,dt){var Tt=r(dt),Pt=r(ot)*Tt,qt=1-Pt,zt=r(ot=t(p(ot)*Tt,-p(dt))),Xt=p(ot);return Tt=N(1-Pt*Pt),[Xt*Tt-zt*qt,-zt*Tt-Xt*qt]}Or.invert=function(ot,dt){var Tt=(ot*ot+dt*dt)/-2,Pt=N(-Tt*(2+Tt)),qt=dt*Tt+ot*Pt,zt=ot*Tt-dt*Pt,Xt=N(zt*zt+qt*qt);return[t(Pt*qt,Xt*(1+Tt)),Xt?-L(Pt*zt/Xt):0]};function Ur(){return x.geoProjection(Or).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function hn(ot,dt){var Tt=ye(ot,dt);return[(Tt[0]+ot/A)/2,(Tt[1]+dt)/2]}hn.invert=function(ot,dt){var Tt=ot,Pt=dt,qt=25;do{var zt=r(Pt),Xt=p(Pt),Mr=p(2*Pt),Rr=Xt*Xt,Vr=zt*zt,an=p(Tt),mn=r(Tt/2),zn=p(Tt/2),Gn=zn*zn,oa=1-Vr*mn*mn,Fa=oa?z(zt*mn)*N(vi=1/oa):vi=0,vi,li=.5*(2*Fa*zt*zn+Tt/A)-ot,mi=.5*(Fa*Xt+Pt)-dt,no=.5*vi*(Vr*Gn+Fa*zt*mn*Rr)+.5/A,To=vi*(an*Mr/4-Fa*Xt*zn),go=.125*vi*(Mr*zn-Fa*Xt*Vr*an),Wo=.5*vi*(Rr*mn+Fa*Gn*zt)+.5,$s=To*go-Wo*no,Ws=(mi*To-li*Wo)/$s,As=(li*go-mi*no)/$s;Tt-=Ws,Pt-=As}while((k(Ws)>l||k(As)>l)&&--qt>0);return[Tt,Pt]};function Cn(){return x.geoProjection(hn).scale(158.837)}h.geoNaturalEarth=x.geoNaturalEarth1,h.geoNaturalEarthRaw=x.geoNaturalEarth1Raw,h.geoAiry=oe,h.geoAiryRaw=J,h.geoAitoff=pe,h.geoAitoffRaw=ye,h.geoArmadillo=W,h.geoArmadilloRaw=ge,h.geoAugust=se,h.geoAugustRaw=ae,h.geoBaker=Y,h.geoBakerRaw=ie,h.geoBerghaus=ue,h.geoBerghausRaw=le,h.geoBertin1953=yt,h.geoBertin1953Raw=it,h.geoBoggs=_t,h.geoBoggsRaw=Ke,h.geoBonne=lr,h.geoBonneRaw=Yt,h.geoBottomley=Nr,h.geoBottomleyRaw=dr,h.geoBromley=ln,h.geoBromleyRaw=Fr,h.geoChamberlin=Ie,h.geoChamberlinRaw=Qe,h.geoChamberlinAfrica=Ue,h.geoCollignon=Be,h.geoCollignonRaw=Pe,h.geoCraig=ft,h.geoCraigRaw=at,h.geoCraster=Ht,h.geoCrasterRaw=Nt,h.geoCylindricalEqualArea=Cr,h.geoCylindricalEqualAreaRaw=or,h.geoCylindricalStereographic=Tr,h.geoCylindricalStereographicRaw=Sr,h.geoEckert1=Fn,h.geoEckert1Raw=Yr,h.geoEckert2=ta,h.geoEckert2Raw=ua,h.geoEckert3=ma,h.geoEckert3Raw=va,h.geoEckert4=ja,h.geoEckert4Raw=Jn,h.geoEckert5=gr,h.geoEckert5Raw=ti,h.geoEckert6=vr,h.geoEckert6Raw=Kt,h.geoEisenlohr=gn,h.geoEisenlohrRaw=rn,h.geoFahey=fa,h.geoFaheyRaw=In,h.geoFoucaut=Ma,h.geoFoucautRaw=Ca,h.geoFoucautSinusoidal=Va,h.geoFoucautSinusoidalRaw=Da,h.geoGilbert=Oi,h.geoGingery=Kr,h.geoGingeryRaw=Vt,h.geoGinzburg4=Jr,h.geoGinzburg4Raw=Gr,h.geoGinzburg5=cn,h.geoGinzburg5Raw=yn,h.geoGinzburg6=yr,h.geoGinzburg6Raw=Dt,h.geoGinzburg8=_n,h.geoGinzburg8Raw=Hr,h.geoGinzburg9=ea,h.geoGinzburg9Raw=Hn,h.geoGringorten=Ua,h.geoGringortenRaw=bn,h.geoGuyou=jo,h.geoGuyouRaw=So,h.geoHammer=Ve,h.geoHammerRaw=Te,h.geoHammerRetroazimuthal=Zo,h.geoHammerRetroazimuthalRaw=js,h.geoHealpix=nl,h.geoHealpixRaw=rl,h.geoHill=Ml,h.geoHillRaw=wl,h.geoHomolosine=Ro,h.geoHomolosineRaw=Cs,h.geoHufnagel=qs,h.geoHufnagelRaw=El,h.geoHyperelliptical=vs,h.geoHyperellipticalRaw=io,h.geoInterrupt=Lo,h.geoInterruptedBoggs=su,h.geoInterruptedHomolosine=vl,h.geoInterruptedMollweide=zl,h.geoInterruptedMollweideHemispheres=qc,h.geoInterruptedSinuMollweide=Dc,h.geoInterruptedSinusoidal=Hf,h.geoKavrayskiy7=vc,h.geoKavrayskiy7Raw=ml,h.geoLagrange=Gu,h.geoLagrangeRaw=nh,h.geoLarrivee=Rc,h.geoLarriveeRaw=Hu,h.geoLaskowski=Fu,h.geoLaskowskiRaw=$l,h.geoLittrow=kl,h.geoLittrowRaw=Bs,h.geoLoximuthal=lc,h.geoLoximuthalRaw=rf,h.geoMiller=ru,h.geoMillerRaw=df,h.geoModifiedStereographic=Nu,h.geoModifiedStereographicRaw=Rh,h.geoModifiedStereographicAlaska=Oc,h.geoModifiedStereographicGs48=Cu,h.geoModifiedStereographicGs50=ah,h.geoModifiedStereographicMiller=pf,h.geoModifiedStereographicLee=Nf,h.geoMollweide=qe,h.geoMollweideRaw=ht,h.geoMtFlatPolarParabolic=vf,h.geoMtFlatPolarParabolicRaw=Bf,h.geoMtFlatPolarQuartic=oh,h.geoMtFlatPolarQuarticRaw=ih,h.geoMtFlatPolarSinusoidal=hh,h.geoMtFlatPolarSinusoidalRaw=zc,h.geoNaturalEarth2=Gc,h.geoNaturalEarth2Raw=nf,h.geoNellHammer=Af,h.geoNellHammerRaw=Bu,h.geoInterruptedQuarticAuthalic=Dl,h.geoNicolosi=Oh,h.geoNicolosiRaw=$f,h.geoPatterson=ac,h.geoPattersonRaw=af,h.geoPolyconic=nu,h.geoPolyconicRaw=yc,h.geoPolyhedral=Pf,h.geoPolyhedralButterfly=Zl,h.geoPolyhedralCollignon=lh,h.geoPolyhedralWaterman=eu,h.geoProject=Xu,h.geoGringortenQuincuncial=br,h.geoPeirceQuincuncial=qr,h.geoPierceQuincuncial=qr,h.geoQuantize=An,h.geoQuincuncial=uh,h.geoRectangularPolyconic=Xn,h.geoRectangularPolyconicRaw=vn,h.geoRobinson=pi,h.geoRobinsonRaw=Ra,h.geoSatellite=ni,h.geoSatelliteRaw=$i,h.geoSinuMollweide=Tl,h.geoSinuMollweideRaw=uo,h.geoSinusoidal=$t,h.geoSinusoidalRaw=vt,h.geoStitch=Fl,h.geoTimes=ms,h.geoTimesRaw=bo,h.geoTwoPointAzimuthal=oc,h.geoTwoPointAzimuthalRaw=cl,h.geoTwoPointAzimuthalUsa=ic,h.geoTwoPointEquidistant=sc,h.geoTwoPointEquidistantRaw=cc,h.geoTwoPointEquidistantUsa=Sf,h.geoVanDerGrinten=wu,h.geoVanDerGrintenRaw=sf,h.geoVanDerGrinten2=qo,h.geoVanDerGrinten2Raw=lf,h.geoVanDerGrinten3=uf,h.geoVanDerGrinten3Raw=as,h.geoVanDerGrinten4=bc,h.geoVanDerGrinten4Raw=Pc,h.geoWagner=ce,h.geoWagner7=Ne,h.geoWagnerRaw=I,h.geoWagner4=Ft,h.geoWagner4Raw=kt,h.geoWagner6=xr,h.geoWagner6Raw=tr,h.geoWiechel=Ur,h.geoWiechelRaw=Or,h.geoWinkel3=Cn,h.geoWinkel3Raw=hn,Object.defineProperty(h,"__esModule",{value:!0})})}}),MP=_e({"src/plots/geo/zoom.js"(ee,X){var h=mr(),x=kn(),S=bi(),k=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function o(d,y){var R=d.projection,L;return y._isScoped?L=a:y._isClipped?L=f:L=s,L(d,R)}X.exports=o;function n(d,y){return h.behavior.zoom().translate(y.translate()).scale(y.scale())}function i(d,y,R){var L=d.id,z=d.graphDiv,N=z.layout,U=N[L],B=z._fullLayout,D=B[L],j={},q={};function J(oe,ye){j[L+"."+oe]=x.nestedProperty(U,oe).get(),S.call("_storeDirectGUIEdit",N,B._preGUI,j);var pe=x.nestedProperty(D,oe);pe.get()!==ye&&(pe.set(ye),x.nestedProperty(U,oe).set(ye),q[L+"."+oe]=ye)}R(J),J("projection.scale",y.scale()/d.fitScale),J("fitbounds",!1),z.emit("plotly_relayout",q)}function a(d,y){var R=n(d,y);function L(){h.select(this).style(t)}function z(){y.scale(h.event.scale).translate(h.event.translate),d.render(!0);var B=y.invert(d.midPt);d.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/d.fitScale,"geo.center.lon":B[0],"geo.center.lat":B[1]})}function N(B){var D=y.invert(d.midPt);B("center.lon",D[0]),B("center.lat",D[1])}function U(){h.select(this).style(r),i(d,y,N)}return R.on("zoomstart",L).on("zoom",z).on("zoomend",U),R}function s(d,y){var R=n(d,y),L=2,z,N,U,B,D,j,q,J,oe;function ye(Q){return y.invert(Q)}function pe(Q){var me=ye(Q);if(!me)return!0;var ie=y(me);return Math.abs(ie[0]-Q[0])>L||Math.abs(ie[1]-Q[1])>L}function ge(){h.select(this).style(t),z=h.mouse(this),N=y.rotate(),U=y.translate(),B=N,D=ye(z)}function W(){if(j=h.mouse(this),pe(z)){R.scale(y.scale()),R.translate(y.translate());return}y.scale(h.event.scale),y.translate([U[0],h.event.translate[1]]),D?ye(j)&&(J=ye(j),q=[B[0]+(J[0]-D[0]),N[1],N[2]],y.rotate(q),B=q):(z=j,D=ye(z)),oe=!0,d.render(!0);var Q=y.rotate(),me=y.invert(d.midPt);d.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/d.fitScale,"geo.center.lon":me[0],"geo.center.lat":me[1],"geo.projection.rotation.lon":-Q[0]})}function ae(){h.select(this).style(r),oe&&i(d,y,se)}function se(Q){var me=y.rotate(),ie=y.invert(d.midPt);Q("projection.rotation.lon",-me[0]),Q("center.lon",ie[0]),Q("center.lat",ie[1])}return R.on("zoomstart",ge).on("zoom",W).on("zoomend",ae),R}function f(d,y){y.rotate(),y.scale();var R=n(d,y),L=u(R,"zoomstart","zoom","zoomend"),z=0,N=R.on,U;R.on("zoomstart",function(){h.select(this).style(t);var J=h.mouse(this),oe=y.rotate(),ye=oe,pe=y.translate(),ge=v(oe);U=c(y,J),N.call(R,"zoom",function(){var W=h.mouse(this);if(y.scale(h.event.scale),!U)J=W,U=c(y,J);else if(c(y,W)){y.rotate(oe).translate(pe);var ae=c(y,W),se=T(U,ae),Q=E(p(ge,se)),me=l(Q,U,ye);(!isFinite(me[0])||!isFinite(me[1])||!isFinite(me[2]))&&(me=ye),y.rotate(me),ye=me}D(L.of(this,arguments))}),B(L.of(this,arguments))}).on("zoomend",function(){h.select(this).style(r),N.call(R,"zoom",null),j(L.of(this,arguments)),i(d,y,q)}).on("zoom.redraw",function(){d.render(!0);var J=y.rotate();d.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":y.scale()/d.fitScale,"geo.projection.rotation.lon":-J[0],"geo.projection.rotation.lat":-J[1]})});function B(J){z++||J({type:"zoomstart"})}function D(J){J({type:"zoom"})}function j(J){--z||J({type:"zoomend"})}function q(J){var oe=y.rotate();J("projection.rotation.lon",-oe[0]),J("projection.rotation.lat",-oe[1])}return h.rebind(R,L,"on")}function c(d,y){var R=d.invert(y);return R&&isFinite(R[0])&&isFinite(R[1])&&_(R)}function v(d){var y=.5*d[0]*k,R=.5*d[1]*k,L=.5*d[2]*k,z=Math.sin(y),N=Math.cos(y),U=Math.sin(R),B=Math.cos(R),D=Math.sin(L),j=Math.cos(L);return[N*B*j+z*U*D,z*B*j-N*U*D,N*U*j+z*B*D,N*B*D-z*U*j]}function p(d,y){var R=d[0],L=d[1],z=d[2],N=d[3],U=y[0],B=y[1],D=y[2],j=y[3];return[R*U-L*B-z*D-N*j,R*B+L*U+z*j-N*D,R*D-L*j+z*U+N*B,R*j+L*D-z*B+N*U]}function T(d,y){if(!(!d||!y)){var R=m(d,y),L=Math.sqrt(w(R,R)),z=.5*Math.acos(Math.max(-1,Math.min(1,w(d,y)))),N=Math.sin(z)/L;return L&&[Math.cos(z),R[2]*N,-R[1]*N,R[0]*N]}}function l(d,y,R){var L=A(y,2,d[0]);L=A(L,1,d[1]),L=A(L,0,d[2]-R[2]);var z=y[0],N=y[1],U=y[2],B=L[0],D=L[1],j=L[2],q=Math.atan2(N,z)*e,J=Math.sqrt(z*z+N*N),oe,ye;Math.abs(D)>J?(ye=(D>0?90:-90)-q,oe=0):(ye=Math.asin(D/J)*e-q,oe=Math.sqrt(J*J-D*D));var pe=180-ye-2*q,ge=(Math.atan2(j,B)-Math.atan2(U,oe))*e,W=(Math.atan2(j,B)-Math.atan2(U,-oe))*e,ae=g(R[0],R[1],ye,ge),se=g(R[0],R[1],pe,W);return ae<=se?[ye,ge,R[2]]:[pe,W,R[2]]}function g(d,y,R,L){var z=b(R-d),N=b(L-y);return Math.sqrt(z*z+N*N)}function b(d){return(d%360+540)%360-180}function A(d,y,R){var L=R*k,z=d.slice(),N=y===0?1:0,U=y===2?1:2,B=Math.cos(L),D=Math.sin(L);return z[N]=d[N]*B-d[U]*D,z[U]=d[U]*B+d[N]*D,z}function E(d){return[Math.atan2(2*(d[0]*d[1]+d[2]*d[3]),1-2*(d[1]*d[1]+d[2]*d[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(d[0]*d[2]-d[3]*d[1]))))*e,Math.atan2(2*(d[0]*d[3]+d[1]*d[2]),1-2*(d[2]*d[2]+d[3]*d[3]))*e]}function _(d){var y=d[0]*k,R=d[1]*k,L=Math.cos(R);return[L*Math.cos(y),L*Math.sin(y),Math.sin(R)]}function w(d,y){for(var R=0,L=0,z=d.length;L0&&D._module.calcGeoJSON(B,L)}if(!z){var j=this.updateProjection(R,L);if(j)return;(!this.viewInitial||this.scope!==N.scope)&&this.saveViewInitial(N)}this.scope=N.scope,this.updateBaseLayers(L,N),this.updateDims(L,N),this.updateFx(L,N),s.generalUpdatePerTraceModule(this.graphDiv,this,R,N);var q=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=q.selectAll(".point"),this.dataPoints.text=q.selectAll("text"),this.dataPaths.line=q.selectAll(".js-line");var J=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=J.selectAll("path"),this._render()},m.updateProjection=function(R,L){var z=this.graphDiv,N=L[this.id],U=L._size,B=N.domain,D=N.projection,j=N.lonaxis,q=N.lataxis,J=j._ax,oe=q._ax,ye=this.projection=u(N),pe=[[U.l+U.w*B.x[0],U.t+U.h*(1-B.y[1])],[U.l+U.w*B.x[1],U.t+U.h*(1-B.y[0])]],ge=N.center||{},W=D.rotation||{},ae=j.range||[],se=q.range||[];if(N.fitbounds){J._length=pe[1][0]-pe[0][0],oe._length=pe[1][1]-pe[0][1],J.range=c(z,J),oe.range=c(z,oe);var Q=(J.range[0]+J.range[1])/2,me=(oe.range[0]+oe.range[1])/2;if(N._isScoped)ge={lon:Q,lat:me};else if(N._isClipped){ge={lon:Q,lat:me},W={lon:Q,lat:me,roll:W.roll};var ie=D.type,Y=b.lonaxisSpan[ie]/2||180,le=b.lataxisSpan[ie]/2||90;ae=[Q-Y,Q+Y],se=[me-le,me+le]}else ge={lon:Q,lat:me},W={lon:Q,lat:W.lat,roll:W.roll}}ye.center([ge.lon-W.lon,ge.lat-W.lat]).rotate([-W.lon,-W.lat,W.roll]).parallels(D.parallels);var ue=y(ae,se);ye.fitExtent(pe,ue);var Te=this.bounds=ye.getBounds(ue),Fe=this.fitScale=ye.scale(),Ve=ye.translate();if(N.fitbounds){var Xe=ye.getBounds(y(J.range,oe.range)),We=Math.min((Te[1][0]-Te[0][0])/(Xe[1][0]-Xe[0][0]),(Te[1][1]-Te[0][1])/(Xe[1][1]-Xe[0][1]));isFinite(We)?ye.scale(We*Fe):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else ye.scale(D.scale*Fe);var it=this.midPt=[(Te[0][0]+Te[1][0])/2,(Te[0][1]+Te[1][1])/2];if(ye.translate([Ve[0]+(it[0]-Ve[0]),Ve[1]+(it[1]-Ve[1])]).clipExtent(Te),N._isAlbersUsa){var yt=ye([ge.lon,ge.lat]),bt=ye.translate();ye.translate([bt[0]-(yt[0]-bt[0]),bt[1]-(yt[1]-bt[1])])}},m.updateBaseLayers=function(R,L){var z=this,N=z.topojson,U=z.layers,B=z.basePaths;function D(pe){return pe==="lonaxis"||pe==="lataxis"}function j(pe){return!!b.lineLayers[pe]}function q(pe){return!!b.fillLayers[pe]}var J=this.hasChoropleth?b.layersForChoropleth:b.layers,oe=J.filter(function(pe){return j(pe)||q(pe)?L["show"+pe]:D(pe)?L[pe].showgrid:!0}),ye=z.framework.selectAll(".layer").data(oe,String);ye.exit().each(function(pe){delete U[pe],delete B[pe],h.select(this).remove()}),ye.enter().append("g").attr("class",function(pe){return"layer "+pe}).each(function(pe){var ge=U[pe]=h.select(this);pe==="bg"?z.bgRect=ge.append("rect").style("pointer-events","all"):D(pe)?B[pe]=ge.append("path").style("fill","none"):pe==="backplot"?ge.append("g").classed("choroplethlayer",!0):pe==="frontplot"?ge.append("g").classed("scatterlayer",!0):j(pe)?B[pe]=ge.append("path").style("fill","none").style("stroke-miterlimit",2):q(pe)&&(B[pe]=ge.append("path").style("stroke","none"))}),ye.order(),ye.each(function(pe){var ge=B[pe],W=b.layerNameToAdjective[pe];pe==="frame"?ge.datum(b.sphereSVG):j(pe)||q(pe)?ge.datum(_(N,N.objects[pe])):D(pe)&&ge.datum(d(pe,L,R)).call(n.stroke,L[pe].gridcolor).call(i.dashLine,L[pe].griddash,L[pe].gridwidth),j(pe)?ge.call(n.stroke,L[W+"color"]).call(i.dashLine,"",L[W+"width"]):q(pe)&&ge.call(n.fill,L[W+"color"])})},m.updateDims=function(R,L){var z=this.bounds,N=(L.framewidth||0)/2,U=z[0][0]-N,B=z[0][1]-N,D=z[1][0]-U+N,j=z[1][1]-B+N;i.setRect(this.clipRect,U,B,D,j),this.bgRect.call(i.setRect,U,B,D,j).call(n.fill,L.bgcolor),this.xaxis._offset=U,this.xaxis._length=D,this.yaxis._offset=B,this.yaxis._length=j},m.updateFx=function(R,L){var z=this,N=z.graphDiv,U=z.bgRect,B=R.dragmode,D=R.clickmode;if(z.isStatic)return;function j(){var ye=z.viewInitial,pe={};for(var ge in ye)pe[z.id+"."+ge]=ye[ge];t.call("_guiRelayout",N,pe),N.emit("plotly_doubleclick",null)}function q(ye){return z.projection.invert([ye[0]+z.xaxis._offset,ye[1]+z.yaxis._offset])}var J=function(ye,pe){if(pe.isRect){var ge=ye.range={};ge[z.id]=[q([pe.xmin,pe.ymin]),q([pe.xmax,pe.ymax])]}else{var W=ye.lassoPoints={};W[z.id]=pe.map(q)}},oe={element:z.bgRect.node(),gd:N,plotinfo:{id:z.id,xaxis:z.xaxis,yaxis:z.yaxis,fillRangeItems:J},xaxes:[z.xaxis],yaxes:[z.yaxis],subplot:z.id,clickFn:function(ye){ye===2&&T(N)}};B==="pan"?(U.node().onmousedown=null,U.call(g(z,L)),U.on("dblclick.zoom",j),N._context._scrollZoom.geo||U.on("wheel.zoom",null)):(B==="select"||B==="lasso")&&(U.on(".zoom",null),oe.prepFn=function(ye,pe,ge){p(ye,pe,ge,oe,B)},v.init(oe)),U.on("mousemove",function(){var ye=z.projection.invert(r.getPositionFromD3Event());if(!ye)return v.unhover(N,h.event);z.xaxis.p2c=function(){return ye[0]},z.yaxis.p2c=function(){return ye[1]},a.hover(N,h.event,z.id)}),U.on("mouseout",function(){N._dragging||v.unhover(N,h.event)}),U.on("click",function(){B!=="select"&&B!=="lasso"&&(D.indexOf("select")>-1&&l(h.event,N,[z.xaxis],[z.yaxis],z.id,oe),D.indexOf("event")>-1&&a.click(N,h.event))})},m.makeFramework=function(){var R=this,L=R.graphDiv,z=L._fullLayout,N="clip"+z._uid+R.id;R.clipDef=z._clips.append("clipPath").attr("id",N),R.clipRect=R.clipDef.append("rect"),R.framework=h.select(R.container).append("g").attr("class","geo "+R.id).call(i.setClipUrl,N,L),R.project=function(U){var B=R.projection(U);return B?[B[0]-R.xaxis._offset,B[1]-R.yaxis._offset]:[null,null]},R.xaxis={_id:"x",c2p:function(U){return R.project(U)[0]}},R.yaxis={_id:"y",c2p:function(U){return R.project(U)[1]}},R.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(R.mockAxis,z)},m.saveViewInitial=function(R){var L=R.center||{},z=R.projection,N=z.rotation||{};this.viewInitial={fitbounds:R.fitbounds,"projection.scale":z.scale};var U;R._isScoped?U={"center.lon":L.lon,"center.lat":L.lat}:R._isClipped?U={"projection.rotation.lon":N.lon,"projection.rotation.lat":N.lat}:U={"center.lon":L.lon,"center.lat":L.lat,"projection.rotation.lon":N.lon},r.extendFlat(this.viewInitial,U)},m.render=function(R){this._hasMarkerAngles&&R?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},m._render=function(){var R=this.projection,L=R.getPath(),z;function N(B){var D=R(B.lonlat);return D?o(D[0],D[1]):null}function U(B){return R.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",U).attr("transform",N)};function u(R){var L=R.projection,z=L.type,N=b.projNames[z];N="geo"+r.titleCase(N);for(var U=x[N]||e[N],B=U(),D=R._isSatellite?Math.acos(1/L.distance)*180/Math.PI:R._isClipped?b.lonaxisSpan[z]/2:null,j=["center","rotate","parallels","clipExtent"],q=function(ye){return ye?B:[]},J=0;JW}else return!1},B.getPath=function(){return S().projection(B)},B.getBounds=function(ye){return B.getPath().bounds(ye)},B.precision(b.precision),R._isSatellite&&B.tilt(L.tilt).distance(L.distance),D&&B.clipAngle(D-b.clipPad),B}function d(R,L,z){var N=1e-6,U=2.5,B=L[R],D=b.scopeDefaults[L.scope],j,q,J;R==="lonaxis"?(j=D.lonaxisRange,q=D.lataxisRange,J=function(me,ie){return[me,ie]}):R==="lataxis"&&(j=D.lataxisRange,q=D.lonaxisRange,J=function(me,ie){return[ie,me]});var oe={type:"linear",range:[j[0],j[1]-N],tick0:B.tick0,dtick:B.dtick};f.setConvert(oe,z);var ye=f.calcTicks(oe);!L.isScoped&&R==="lonaxis"&&ye.pop();for(var pe=ye.length,ge=new Array(pe),W=0;W0&&U<0&&(U+=360);var j=(U-N)/4;return{type:"Polygon",coordinates:[[[N,B],[N,D],[N+j,D],[N+2*j,D],[N+3*j,D],[U,D],[U,B],[U-j,B],[U-2*j,B],[U-3*j,B],[N,B]]]}}}}),G3=_e({"src/plots/geo/layout_attributes.js"(ee,X){var h=Hl(),x=hf().attributes,S=Qf().dash,k=d1(),e=nc().overrideAll,t=ec(),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=X.exports=e({domain:x({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:t(k.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:t(k.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:k.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:k.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:k.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:k.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"}}}),kP=_e({"src/plots/geo/layout_defaults.js"(ee,X){var h=kn(),x=T0(),S=xl().getSubplotData,k=d1(),e=G3(),t=k.axesNames;X.exports=function(n,i,a){x(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(se){return se.index}),c=i("resolution"),v=i("scope"),p=k.scopeDefaults[v],T=i("projection.type",p.projType),l=n._isAlbersUsa=T==="albers usa";l&&(v=n.scope="usa");var g=n._isScoped=v!=="world",b=n._isSatellite=T==="satellite",A=n._isConic=T.indexOf("conic")!==-1||T==="albers",E=n._isClipped=!!k.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&&q<0&&(q+=360);var J=(j+q)/2,oe;if(!l){var ye=g?p.projRotate:[J,0,0];oe=i("projection.rotation.lon",ye[0]),i("projection.rotation.lat",ye[1]),i("projection.rotation.roll",ye[2]),m=i("showcoastlines",!g&&w),m&&(i("coastlinecolor"),i("coastlinewidth")),m=i("showocean",w?void 0:!1),m&&i("oceancolor")}var pe,ge;if(l?(pe=-96.6,ge=38.7):(pe=g?J:oe,ge=(D[0]+D[1])/2),i("center.lon",pe),i("center.lat",ge),b&&(i("projection.tilt"),i("projection.distance")),A){var W=p.projParallels||[0,60];i("projection.parallels",W)}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&&v!=="usa"&&w),m&&(i("countrycolor"),i("countrywidth")),(v==="usa"||v==="north america"&&c===50)&&(i("showsubunits",w),i("subunitcolor"),i("subunitwidth")),g||(m=i("showframe",w),m&&(i("framecolor"),i("framewidth"))),i("bgcolor");var ae=i("fitbounds");ae&&(delete n.projection.scale,g?(delete n.center.lon,delete n.center.lat):E?(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))}}}),H3=_e({"src/plots/geo/index.js"(ee,X){var h=xl().getSubplotCalcData,x=kn().counterRegex,S=EP(),k="geo",e=x(k),t={};t[k]={valType:"subplotid",dflt:k,editType:"calc"};function r(i){for(var a=i._fullLayout,s=i.calcdata,f=a._subplots[k],c=0;c")}}}}),ux=_e({"src/traces/choropleth/event_data.js"(ee,X){X.exports=function(x,S,k,e,t){x.location=S.location,x.z=S.z;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x.ct=r.ct,x}}}),cx=_e({"src/traces/choropleth/select.js"(ee,X){X.exports=function(x,S){var k=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,n,i,a,s;if(S===!1)for(o=0;o=Math.min(q,J)&&T<=Math.max(q,J)?0:1/0}if(L=Math.min(oe,ye)&&l<=Math.max(oe,ye)?0:1/0}U=Math.sqrt(L*L+z*z),u=b[R]}}}else for(R=b.length-1;R>-1;R--)m=b[R],d=v[m],y=p[m],L=f.c2p(d)-T,z=c.c2p(y)-l,N=Math.sqrt(L*L+z*z),N100},ee.isDotSymbol=function(h){return typeof h=="string"?X.DOT_RE.test(h):h>200}}}),RP=_e({"src/traces/scattergl/defaults.js"(ee,X){var h=kn(),x=bi(),S=hx(),k=v1(),e=sv(),t=Ps(),r=dg(),o=Bp(),n=lp(),i=yp(),a=Up(),s=_p();X.exports=function(c,v,p,T){function l(u,d){return h.coerce(c,v,k,u,d)}var g=c.marker?S.isOpenSymbol(c.marker.symbol):!1,b=t.isBubble(c),A=r(c,v,T,l);if(!A){v.visible=!1;return}o(c,v,T,l),l("xhoverformat"),l("yhoverformat");var E=A>>1,c=r[f],v=n!==void 0?n(c,o):c-o;v>=0?(s=f,a=f-1):i=f+1}return s}function x(r,o,n,i,a){for(var s=a+1;i<=a;){var f=i+a>>>1,c=r[f],v=n!==void 0?n(c,o):c-o;v>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],v=n!==void 0?n(c,o):c-o;v<0?(s=f,i=f+1):a=f-1}return s}function k(r,o,n,i,a){for(var s=i-1;i<=a;){var f=i+a>>>1,c=r[f],v=n!==void 0?n(c,o):c-o;v<=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)}X.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,x)},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,k)},eq:function(r,o,n,i,a){return t(r,o,n,i,a,e)}}}}),fv=_e({"node_modules/pick-by-alias/index.js"(ee,X){X.exports=function(k,e,t){var r={},o,n;if(typeof e=="string"&&(e=x(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?k={width:S[0],height:S[0],x:0,y:0}:S.length===2?k={width:S[0],height:S[1],x:0,y:0}:k={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"}),k={x:S.left||0,y:S.top||0},S.width==null?S.right?k.width=S.right-k.x:k.width=0:k.width=S.width,S.height==null?S.bottom?k.height=S.bottom-k.y:k.height=0:k.height=S.height),k}}}),Am=_e({"node_modules/array-bounds/index.js"(ee,X){X.exports=h;function h(x,S){if(!x||x.length==null)throw Error("Argument should be an array");S==null?S=1:S=Math.floor(S);for(var k=Array(S*2),e=0;et&&(t=x[o]),x[o]>>1,b;v.dtype||(v.dtype="array"),typeof v.dtype=="string"?b=new(n(v.dtype))(g):v.dtype&&(b=v.dtype,Array.isArray(b)&&(b.length=g));for(let L=0;Lp||D>a){for(let me=0;meue||J>Te||oe=pe||Y===le)return;let Fe=A[ie];le===void 0&&(le=Fe.length);for(let qe=Y;qe=U&&Ae<=D&&Ke>=B&&Ke<=j&&ge.push(ze)}let Ve=E[ie],Xe=Ve[Y*4+0],We=Ve[Y*4+1],it=Ve[Y*4+2],yt=Ve[Y*4+3],bt=ae(Ve,Y+1),mt=me*.5,ht=ie+1;W(se,Q,mt,ht,Xe,We||it||yt||bt),W(se,Q+mt,mt,ht,We,it||yt||bt),W(se+mt,Q,mt,ht,it,yt||bt),W(se+mt,Q+mt,mt,ht,yt,bt)}function ae(se,Q){let me=null,ie=0;for(;me===null;)if(me=se[Q*4+ie],ie++,ie>se.length)return null;return me}return ge}function y(L,z,N,U,B){let D=[];for(let j=0;j1&&(c=1),c<-1&&(c=-1),f*Math.acos(c)},t=function(n,i,a,s,f,c,v,p,T,l,g,b){var A=Math.pow(f,2),E=Math.pow(c,2),_=Math.pow(g,2),w=Math.pow(b,2),m=A*E-A*w-E*_;m<0&&(m=0),m/=A*w+E*_,m=Math.sqrt(m)*(v===p?-1:1);var u=m*f/c*b,d=m*-c/f*g,y=l*u-T*d+(n+a)/2,R=T*u+l*d+(i+s)/2,L=(g-u)/f,z=(b-d)/c,N=(-g-u)/f,U=(-b-d)/c,B=e(1,0,L,z),D=e(L,z,N,U);return p===0&&D>0&&(D-=x),p===1&&D<0&&(D+=x),[y,R,B,D]},r=function(n){var i=n.px,a=n.py,s=n.cx,f=n.cy,c=n.rx,v=n.ry,p=n.xAxisRotation,T=p===void 0?0:p,l=n.largeArcFlag,g=l===void 0?0:l,b=n.sweepFlag,A=b===void 0?0:b,E=[];if(c===0||v===0)return[];var _=Math.sin(T*x/360),w=Math.cos(T*x/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),v=Math.abs(v);var d=Math.pow(m,2)/Math.pow(c,2)+Math.pow(u,2)/Math.pow(v,2);d>1&&(c*=Math.sqrt(d),v*=Math.sqrt(d));var y=t(i,a,s,f,c,v,g,A,_,w,m,u),R=h(y,4),L=R[0],z=R[1],N=R[2],U=R[3],B=Math.abs(U)/(x/4);Math.abs(1-B)<1e-7&&(B=1);var D=Math.max(Math.ceil(B),1);U/=D;for(var j=0;j4?(o=l[l.length-4],n=l[l.length-3]):(o=c,n=v),r.push(l)}return r}function S(e,t,r,o){return["C",e,t,r,o,r,o]}function k(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]}}}),Y3=_e({"node_modules/is-svg-path/index.js"(ee,X){X.exports=function(x){return typeof x!="string"?!1:(x=x.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(x)&&/[\dz]$/i.test(x)&&x.length>4))}}}),qP=_e({"node_modules/svg-path-bounds/index.js"(ee,X){var h=Vd(),x=W3(),S=VP(),k=Y3(),e=Hy();X.exports=t;function t(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(e(k(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=x(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}}}),GP=_e({"node_modules/normalize-svg-path/index.js"(ee,X){var h=Math.PI,x=o(120);X.exports=S;function S(n){for(var i,a=[],s=0,f=0,c=0,v=0,p=null,T=null,l=0,g=0,b=0,A=n.length;b7&&(a.push(E.splice(0,7)),E.unshift("C"));break;case"S":var w=l,m=g;(i=="C"||i=="S")&&(w+=w-s,m+=m-f),E=["C",w,m,E[1],E[2],E[3],E[4]];break;case"T":i=="Q"||i=="T"?(p=l*2-p,T=g*2-T):(p=l,T=g),E=e(l,g,p,T,E[1],E[2]);break;case"Q":p=E[1],T=E[2],E=e(l,g,E[1],E[2],E[3],E[4]);break;case"L":E=k(l,g,E[1],E[2]);break;case"H":E=k(l,g,E[1],g);break;case"V":E=k(l,g,l,E[1]);break;case"Z":E=k(l,g,c,v);break}i=_,l=E[E.length-2],g=E[E.length-1],E.length>4?(s=E[E.length-4],f=E[E.length-3]):(s=l,f=g),a.push(E)}return a}function k(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,v,p,T,l){if(l)y=l[0],R=l[1],u=l[2],d=l[3];else{var g=r(n,i,-f);n=g.x,i=g.y,g=r(p,T,-f),p=g.x,T=g.y;var b=(n-p)/2,A=(i-T)/2,E=b*b/(a*a)+A*A/(s*s);E>1&&(E=Math.sqrt(E),a=E*a,s=E*s);var _=a*a,w=s*s,m=(c==v?-1:1)*Math.sqrt(Math.abs((_*w-_*A*A-w*b*b)/(_*A*A+w*b*b)));m==1/0&&(m=1);var u=m*a*A/s+(n+p)/2,d=m*-s*b/a+(i+T)/2,y=Math.asin(((i-d)/s).toFixed(9)),R=Math.asin(((T-d)/s).toFixed(9));y=nR&&(y=y-h*2),!v&&R>y&&(R=R-h*2)}if(Math.abs(R-y)>x){var L=R,z=p,N=T;R=y+x*(v&&R>y?1:-1),p=u+a*Math.cos(R),T=d+s*Math.sin(R);var U=t(p,T,a,s,f,0,v,z,N,[R,L,u,d])}var B=Math.tan((R-y)/4),D=4/3*a*B,j=4/3*s*B,q=[2*n-(n+D*Math.sin(y)),2*i-(i-j*Math.cos(y)),p+D*Math.sin(R),T-j*Math.cos(R),p,T];if(l)return q;U&&(q=q.concat(U));for(var J=0;J0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(p)),r.translate(f*.5,c*.5),r.scale(g,g),i()){var b=new Path2D(a);r.fill(b),p&&r.stroke(b)}else{var A=x(a);S(r,A),r.fill(),p&&r.stroke()}r.setTransform(1,0,0,1,0,0);var E=e(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:v*.5});return E}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}}}),Mm=_e({"src/traces/scattergl/convert.js"(ee,X){var h=jn(),x=WP(),S=L0(),k=bi(),e=kn(),t=e.isArrayOrTypedArray,r=ri(),o=cf(),n=Uv().formatColor,i=Ps(),a=bu(),s=hx(),f=O0(),c=Of().DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},p=rc().appendArrayPointValue;function T(U,B){var D,j={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},q=U._context.plotGlPixelRatio;if(B.visible!==!0)return j;if(i.hasText(B)&&(j.text=l(U,B),j.textSel=E(U,B,B.selected),j.textUnsel=E(U,B,B.unselected)),i.hasMarkers(B)&&(j.marker=b(U,B),j.markerSel=A(U,B,B.selected),j.markerUnsel=A(U,B,B.unselected),!B.unselected&&t(B.marker.opacity))){var J=B.marker.opacity;for(j.markerUnsel.opacity=new Array(J.length),D=0;D500?"bold":"normal":U}function b(U,B){var D=B._length,j=B.marker,q={},J,oe=t(j.symbol),ye=t(j.angle),pe=t(j.color),ge=t(j.line.color),W=t(j.opacity),ae=t(j.size),se=t(j.line.width),Q;if(oe||(Q=s.isOpenSymbol(j.symbol)),oe||pe||ge||W||ye){q.symbols=new Array(D),q.angles=new Array(D),q.colors=new Array(D),q.borderColors=new Array(D);var me=j.symbol,ie=j.angle,Y=n(j,j.opacity,D),le=n(j.line,j.opacity,D);if(!t(le[0])){var ue=le;for(le=Array(D),J=0;Jf.TOO_MANY_POINTS||i.hasMarkers(B)?"rect":"round";if(ge&&B.connectgaps){var ae=J[0],se=J[1];for(oe=0;oe1?pe[oe]:pe[0]:pe,Q=t(ge)?ge.length>1?ge[oe]:ge[0]:ge,me=v[se],ie=v[Q],Y=W?W/.8+1:0,le=-ie*Y-ie*.5;J.offset[oe]=[me*Y/ae,le/ae]}}return J}X.exports={style:T,markerStyle:b,markerSelection:A,linePositions:L,errorBarPositions:z,textPosition:N}}}),X3=_e({"src/traces/scattergl/scene_update.js"(ee,X){var h=kn();X.exports=function(S,k){var e=k._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 k._scene||(e=k._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,d={},y,R=A.makeCalcdata(g,"x"),L=E.makeCalcdata(g,"y"),z=e(g,A,"x",R),N=e(g,E,"y",L),U=z.vals,B=N.vals;g._x=U,g._y=B,g.xperiodalignment&&(g._origX=R,g._xStarts=z.starts,g._xEnds=z.ends),g.yperiodalignment&&(g._origY=L,g._yStarts=N.starts,g._yEnds=N.ends);var D=new Array(u),j=new Array(w);for(y=0;y1&&x.extendFlat(_.line,a.linePositions(T,g,b)),_.errorX||_.errorY){var w=a.errorBarPositions(T,g,b,A,E);_.errorX&&x.extendFlat(_.errorX,w.x),_.errorY&&x.extendFlat(_.errorY,w.y)}return _.text&&(x.extendFlat(_.text,{positions:b},a.textPosition(T,g,_.text,_.marker)),x.extendFlat(_.textSel,{positions:b},a.textPosition(T,g,_.text,_.markerSel)),x.extendFlat(_.textUnsel,{positions:b},a.textPosition(T,g,_.text,_.markerUnsel))),_}}}),Z3=_e({"src/traces/scattergl/edit_style.js"(ee,X){var h=kn(),x=so(),S=Of().DESELECTDIM;function k(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]||{},v=n.textUnselectedOptions[i]||{},p=h.extendFlat({},f),T,l;if(a.length||s.length){var g=c.color,b=v.color,A=f.color,E=h.isArrayOrTypedArray(A);for(p.color=new Array(r._length),T=0;T>>24,r=(k&16711680)>>>16,o=(k&65280)>>>8,n=k&255;return e===!1?[t,r,o,n]:[t/255,r/255,o/255,n/255]}}}),Dh=_e({"node_modules/object-assign/index.js"(ee,X){var h=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;function k(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}}X.exports=e()?Object.assign:function(t,r){for(var o,n=k(t),i,a=1;ad.length)&&(y=d.length);for(var R=0,L=new Array(y);R 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; } `]),pe.vert=p([`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; } `]),b&&(pe.frag=pe.frag.replace("smoothstep","smoothStep"),ye.frag=ye.frag.replace("smoothstep","smoothStep")),this.drawCircle=d(pe)}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 d=this,y=arguments.length,R=new Array(y),L=0;Lze)?ht.tree=c(mt,{bounds:vt}):ze&&ze.length&&(ht.tree=ze),ht.tree){var $t={primitive:"points",usage:"static",data:ht.tree,type:"uint32"};ht.elements?ht.elements($t):ht.elements=U.elements($t)}var Yt=A.float32(mt);Ae({data:Yt,usage:"dynamic"});var lr=A.fract32(mt,Yt);return Ke({data:lr,usage:"dynamic"}),_t({data:new Uint8Array(wt),type:"uint8",usage:"stream"}),mt}},{marker:function(mt,ht,qe){var ze=ht.activation;if(ze.forEach(function(lr){return lr&&lr.destroy&&lr.destroy()}),ze.length=0,!mt||typeof mt[0]=="number"){var Ae=d.addMarker(mt);ze[Ae]=!0}else{for(var Ke=[],_t=0,wt=Math.min(mt.length,ht.count);_t=0)return z;var N;if(d instanceof Uint8Array||d instanceof Uint8ClampedArray)N=d;else{N=new Uint8Array(d.length);for(var U=0,B=d.length;UL*4&&(this.tooManyColors=!0),this.updatePalette(R),z.length===1?z[0]:z},w.prototype.updatePalette=function(d){if(!this.tooManyColors){var y=this.maxColors,R=this.paletteTexture,L=Math.ceil(d.length*.25/y);if(L>1){d=d.slice();for(var z=d.length*.25%y;z80*D){ye=ge=U[0],pe=W=U[1];for(var me=D;mege&&(ge=ae),se>W&&(W=se);Q=Math.max(ge-ye,W-pe),Q=Q!==0?32767/Q:0}return k(J,oe,D,ye,pe,Q,0),oe}function x(U,B,D,j,q){var J,oe;if(q===N(U,B,D,j)>0)for(J=B;J=B;J-=j)oe=R(J,U[J],U[J+1],oe);return oe&&A(oe,oe.next)&&(L(oe),oe=oe.next),oe}function S(U,B){if(!U)return U;B||(B=U);var D=U,j;do if(j=!1,!D.steiner&&(A(D,D.next)||b(D.prev,D,D.next)===0)){if(L(D),D=B=D.prev,D===D.next)break;j=!0}else D=D.next;while(j||D!==B);return B}function k(U,B,D,j,q,J,oe){if(U){!oe&&J&&c(U,j,q,J);for(var ye=U,pe,ge;U.prev!==U.next;){if(pe=U.prev,ge=U.next,J?t(U,j,q,J):e(U)){B.push(pe.i/D|0),B.push(U.i/D|0),B.push(ge.i/D|0),L(U),U=ge.next,ye=ge.next;continue}if(U=ge,U===ye){oe?oe===1?(U=r(S(U),B,D),k(U,B,D,j,q,J,2)):oe===2&&o(U,B,D,j,q,J):k(S(U),B,D,j,q,J,1);break}}}}function e(U){var B=U.prev,D=U,j=U.next;if(b(B,D,j)>=0)return!1;for(var q=B.x,J=D.x,oe=j.x,ye=B.y,pe=D.y,ge=j.y,W=qJ?q>oe?q:oe:J>oe?J:oe,Q=ye>pe?ye>ge?ye:ge:pe>ge?pe:ge,me=j.next;me!==B;){if(me.x>=W&&me.x<=se&&me.y>=ae&&me.y<=Q&&l(q,ye,J,pe,oe,ge,me.x,me.y)&&b(me.prev,me,me.next)>=0)return!1;me=me.next}return!0}function t(U,B,D,j){var q=U.prev,J=U,oe=U.next;if(b(q,J,oe)>=0)return!1;for(var ye=q.x,pe=J.x,ge=oe.x,W=q.y,ae=J.y,se=oe.y,Q=yepe?ye>ge?ye:ge:pe>ge?pe:ge,Y=W>ae?W>se?W:se:ae>se?ae:se,le=p(Q,me,B,D,j),ue=p(ie,Y,B,D,j),Te=U.prevZ,Fe=U.nextZ;Te&&Te.z>=le&&Fe&&Fe.z<=ue;){if(Te.x>=Q&&Te.x<=ie&&Te.y>=me&&Te.y<=Y&&Te!==q&&Te!==oe&&l(ye,W,pe,ae,ge,se,Te.x,Te.y)&&b(Te.prev,Te,Te.next)>=0||(Te=Te.prevZ,Fe.x>=Q&&Fe.x<=ie&&Fe.y>=me&&Fe.y<=Y&&Fe!==q&&Fe!==oe&&l(ye,W,pe,ae,ge,se,Fe.x,Fe.y)&&b(Fe.prev,Fe,Fe.next)>=0))return!1;Fe=Fe.nextZ}for(;Te&&Te.z>=le;){if(Te.x>=Q&&Te.x<=ie&&Te.y>=me&&Te.y<=Y&&Te!==q&&Te!==oe&&l(ye,W,pe,ae,ge,se,Te.x,Te.y)&&b(Te.prev,Te,Te.next)>=0)return!1;Te=Te.prevZ}for(;Fe&&Fe.z<=ue;){if(Fe.x>=Q&&Fe.x<=ie&&Fe.y>=me&&Fe.y<=Y&&Fe!==q&&Fe!==oe&&l(ye,W,pe,ae,ge,se,Fe.x,Fe.y)&&b(Fe.prev,Fe,Fe.next)>=0)return!1;Fe=Fe.nextZ}return!0}function r(U,B,D){var j=U;do{var q=j.prev,J=j.next.next;!A(q,J)&&E(q,j,j.next,J)&&u(q,J)&&u(J,q)&&(B.push(q.i/D|0),B.push(j.i/D|0),B.push(J.i/D|0),L(j),L(j.next),j=U=J),j=j.next}while(j!==U);return S(j)}function o(U,B,D,j,q,J){var oe=U;do{for(var ye=oe.next.next;ye!==oe.prev;){if(oe.i!==ye.i&&g(oe,ye)){var pe=y(oe,ye);oe=S(oe,oe.next),pe=S(pe,pe.next),k(oe,B,D,j,q,J,0),k(pe,B,D,j,q,J,0);return}ye=ye.next}oe=oe.next}while(oe!==U)}function n(U,B,D,j){var q=[],J,oe,ye,pe,ge;for(J=0,oe=B.length;J=D.next.y&&D.next.y!==D.y){var ye=D.x+(q-D.y)*(D.next.x-D.x)/(D.next.y-D.y);if(ye<=j&&ye>J&&(J=ye,oe=D.x=D.x&&D.x>=ge&&j!==D.x&&l(qoe.x||D.x===oe.x&&f(oe,D)))&&(oe=D,ae=se)),D=D.next;while(D!==pe);return oe}function f(U,B){return b(U.prev,U,B.prev)<0&&b(B.next,U,U.next)<0}function c(U,B,D,j){var q=U;do q.z===0&&(q.z=p(q.x,q.y,B,D,j)),q.prevZ=q.prev,q.nextZ=q.next,q=q.next;while(q!==U);q.prevZ.nextZ=null,q.prevZ=null,v(q)}function v(U){var B,D,j,q,J,oe,ye,pe,ge=1;do{for(D=U,U=null,J=null,oe=0;D;){for(oe++,j=D,ye=0,B=0;B0||pe>0&&j;)ye!==0&&(pe===0||!j||D.z<=j.z)?(q=D,D=D.nextZ,ye--):(q=j,j=j.nextZ,pe--),J?J.nextZ=q:U=q,q.prevZ=J,J=q;D=j}J.nextZ=null,ge*=2}while(oe>1);return U}function p(U,B,D,j,q){return U=(U-D)*q|0,B=(B-j)*q|0,U=(U|U<<8)&16711935,U=(U|U<<4)&252645135,U=(U|U<<2)&858993459,U=(U|U<<1)&1431655765,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,U|B<<1}function T(U){var B=U,D=U;do(B.x=(U-oe)*(J-ye)&&(U-oe)*(j-ye)>=(D-oe)*(B-ye)&&(D-oe)*(J-ye)>=(q-oe)*(j-ye)}function g(U,B){return U.next.i!==B.i&&U.prev.i!==B.i&&!m(U,B)&&(u(U,B)&&u(B,U)&&d(U,B)&&(b(U.prev,U,B.prev)||b(U,B.prev,B))||A(U,B)&&b(U.prev,U,U.next)>0&&b(B.prev,B,B.next)>0)}function b(U,B,D){return(B.y-U.y)*(D.x-B.x)-(B.x-U.x)*(D.y-B.y)}function A(U,B){return U.x===B.x&&U.y===B.y}function E(U,B,D,j){var q=w(b(U,B,D)),J=w(b(U,B,j)),oe=w(b(D,j,U)),ye=w(b(D,j,B));return!!(q!==J&&oe!==ye||q===0&&_(U,D,B)||J===0&&_(U,j,B)||oe===0&&_(D,U,j)||ye===0&&_(D,B,j))}function _(U,B,D){return B.x<=Math.max(U.x,D.x)&&B.x>=Math.min(U.x,D.x)&&B.y<=Math.max(U.y,D.y)&&B.y>=Math.min(U.y,D.y)}function w(U){return U>0?1:U<0?-1:0}function m(U,B){var D=U;do{if(D.i!==U.i&&D.next.i!==U.i&&D.i!==B.i&&D.next.i!==B.i&&E(D,D.next,U,B))return!0;D=D.next}while(D!==U);return!1}function u(U,B){return b(U.prev,U,U.next)<0?b(U,B,U.next)>=0&&b(U,U.prev,B)>=0:b(U,B,U.prev)<0||b(U,U.next,B)<0}function d(U,B){var D=U,j=!1,q=(U.x+B.x)/2,J=(U.y+B.y)/2;do D.y>J!=D.next.y>J&&D.next.y!==D.y&&q<(D.next.x-D.x)*(J-D.y)/(D.next.y-D.y)+D.x&&(j=!j),D=D.next;while(D!==U);return j}function y(U,B){var D=new z(U.i,U.x,U.y),j=new z(B.i,B.x,B.y),q=U.next,J=B.prev;return U.next=B,B.prev=U,D.next=q,q.prev=D,j.next=D,D.prev=j,J.next=j,j.prev=J,j}function R(U,B,D,j){var q=new z(U,B,D);return j?(q.next=j.next,q.prev=j,j.next.prev=q,j.next=q):(q.prev=q,q.next=q),q}function L(U){U.next.prev=U.prev,U.prev.next=U.next,U.prevZ&&(U.prevZ.nextZ=U.nextZ),U.nextZ&&(U.nextZ.prevZ=U.prevZ)}function z(U,B,D){this.i=U,this.x=B,this.y=D,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}h.deviation=function(U,B,D,j){var q=B&&B.length,J=q?B[0]*D:U.length,oe=Math.abs(N(U,0,J,D));if(q)for(var ye=0,pe=B.length;ye0&&(j+=U[q-1].length,D.holes.push(j))}return D}}}),eL=_e({"node_modules/array-normalize/index.js"(ee,X){var h=Am();X.exports=x;function x(S,k,e){if(!S||S.length==null)throw Error("Argument should be an array");k==null&&(k=1),e==null&&(e=h(S,k));for(var t=0;t-1}}}),iA=_e({"node_modules/es5-ext/string/#/contains/index.js"(ee,X){X.exports=dL()()?String.prototype.contains:pL()}}),Vv=_e({"node_modules/d/index.js"(ee,X){var h=Em(),x=nA(),S=gx(),k=aA(),e=iA(),t=X.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(k(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)?x(o)?h(n)?x(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(k(s),f):f}}}),m1=_e({"node_modules/es5-ext/function/is-arguments.js"(ee,X){var h=Object.prototype.toString,x=h.call(function(){return arguments}());X.exports=function(S){return h.call(S)===x}}}),g1=_e({"node_modules/es5-ext/string/is-string.js"(ee,X){var h=Object.prototype.toString,x=h.call("");X.exports=function(S){return typeof S=="string"||S&&typeof S=="object"&&(S instanceof String||h.call(S)===x)||!1}}}),vL=_e({"node_modules/ext/global-this/is-implemented.js"(ee,X){X.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),mL=_e({"node_modules/ext/global-this/implementation.js"(ee,X){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`")};X.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__}}()}}),y1=_e({"node_modules/ext/global-this/index.js"(ee,X){X.exports=vL()()?globalThis:mL()}}),gL=_e({"node_modules/es6-symbol/is-implemented.js"(ee,X){var h=y1(),x={object:!0,symbol:!0};X.exports=function(){var S=h.Symbol,k;if(typeof S!="function")return!1;k=S("test symbol");try{String(k)}catch{return!1}return!(!x[typeof S.iterator]||!x[typeof S.toPrimitive]||!x[typeof S.toStringTag])}}}),yL=_e({"node_modules/es6-symbol/is-symbol.js"(ee,X){X.exports=function(h){return h?typeof h=="symbol"?!0:!h.constructor||h.constructor.name!=="Symbol"?!1:h[h.constructor.toStringTag]==="Symbol":!1}}}),oA=_e({"node_modules/es6-symbol/validate-symbol.js"(ee,X){var h=yL();X.exports=function(x){if(!h(x))throw new TypeError(x+" is not a symbol");return x}}}),_L=_e({"node_modules/es6-symbol/lib/private/generate-name.js"(ee,X){var h=Vv(),x=Object.create,S=Object.defineProperty,k=Object.prototype,e=x(null);X.exports=function(t){for(var r=0,o,n;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,o="@@"+t,S(k,o,h.gs(null,function(i){n||(n=!0,S(this,o,h(i)),n=!1)})),o}}}),bL=_e({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(ee,X){var h=Vv(),x=y1().Symbol;X.exports=function(S){return Object.defineProperties(S,{hasInstance:h("",x&&x.hasInstance||S("hasInstance")),isConcatSpreadable:h("",x&&x.isConcatSpreadable||S("isConcatSpreadable")),iterator:h("",x&&x.iterator||S("iterator")),match:h("",x&&x.match||S("match")),replace:h("",x&&x.replace||S("replace")),search:h("",x&&x.search||S("search")),species:h("",x&&x.species||S("species")),split:h("",x&&x.split||S("split")),toPrimitive:h("",x&&x.toPrimitive||S("toPrimitive")),toStringTag:h("",x&&x.toStringTag||S("toStringTag")),unscopables:h("",x&&x.unscopables||S("unscopables"))})}}}),xL=_e({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(ee,X){var h=Vv(),x=oA(),S=Object.create(null);X.exports=function(k){return Object.defineProperties(k,{for:h(function(e){return S[e]?S[e]:S[e]=k(String(e))}),keyFor:h(function(e){var t;x(e);for(t in S)if(S[t]===e)return t})})}}}),wL=_e({"node_modules/es6-symbol/polyfill.js"(ee,X){var h=Vv(),x=oA(),S=y1().Symbol,k=_L(),e=bL(),t=xL(),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)},X.exports=i=function f(c){var v;if(this instanceof f)throw new TypeError("Symbol is not a constructor");return s?S(c):(v=r(a.prototype),c=c===void 0?"":String(c),o(v,{__description__:h("",c),__name__:h("",k(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 ("+x(this).__description__+")"}),valueOf:h(function(){return x(this)})}),n(i.prototype,i.toPrimitive,h("",function(){var f=x(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]))}}),F0=_e({"node_modules/es6-symbol/index.js"(ee,X){X.exports=gL()()?y1().Symbol:wL()}}),TL=_e({"node_modules/es5-ext/array/#/clear.js"(ee,X){var h=jv();X.exports=function(){return h(this).length=0,this}}}),Ng=_e({"node_modules/es5-ext/object/valid-callable.js"(ee,X){X.exports=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h}}}),AL=_e({"node_modules/type/string/coerce.js"(ee,X){var h=Em(),x=mx(),S=Object.prototype.toString;X.exports=function(k){if(!h(k))return null;if(x(k)){var e=k.toString;if(typeof e!="function"||e===S)return null}try{return""+k}catch{return null}}}}),SL=_e({"node_modules/type/lib/safe-to-string.js"(ee,X){X.exports=function(h){try{return h.toString()}catch{try{return String(h)}catch{return null}}}}}),ML=_e({"node_modules/type/lib/to-short-string.js"(ee,X){var h=SL(),x=/[\n\r\u2028\u2029]/g;X.exports=function(S){var k=h(S);return k===null?"":(k.length>100&&(k=k.slice(0,99)+"…"),k=k.replace(x,function(e){switch(e){case` `:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),k)}}}),sA=_e({"node_modules/type/lib/resolve-exception.js"(ee,X){var h=Em(),x=mx(),S=AL(),k=ML(),e=function(t,r){return t.replace("%v",k(r))};X.exports=function(t,r,o){if(!x(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))}}}),EL=_e({"node_modules/type/value/ensure.js"(ee,X){var h=sA(),x=Em();X.exports=function(S){return x(S)?S:h(S,"Cannot use %v",arguments[1])}}}),kL=_e({"node_modules/type/plain-function/ensure.js"(ee,X){var h=sA(),x=nA();X.exports=function(S){return x(S)?S:h(S,"%v is not a plain function",arguments[1])}}}),CL=_e({"node_modules/es5-ext/array/from/is-implemented.js"(ee,X){X.exports=function(){var h=Array.from,x,S;return typeof h!="function"?!1:(x=["raz","dwa"],S=h(x),!!(S&&S!==x&&S[1]==="dwa"))}}}),PL=_e({"node_modules/es5-ext/function/is-function.js"(ee,X){var h=Object.prototype.toString,x=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);X.exports=function(S){return typeof S=="function"&&x(h.call(S))}}}),LL=_e({"node_modules/es5-ext/math/sign/is-implemented.js"(ee,X){X.exports=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1}}}),IL=_e({"node_modules/es5-ext/math/sign/shim.js"(ee,X){X.exports=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}}}),DL=_e({"node_modules/es5-ext/math/sign/index.js"(ee,X){X.exports=LL()()?Math.sign:IL()}}),RL=_e({"node_modules/es5-ext/number/to-integer.js"(ee,X){var h=DL(),x=Math.abs,S=Math.floor;X.exports=function(k){return isNaN(k)?0:(k=Number(k),k===0||!isFinite(k)?k:h(k)*S(x(k)))}}}),OL=_e({"node_modules/es5-ext/number/to-pos-integer.js"(ee,X){var h=RL(),x=Math.max;X.exports=function(S){return x(0,h(S))}}}),zL=_e({"node_modules/es5-ext/array/from/shim.js"(ee,X){var h=F0().iterator,x=m1(),S=PL(),k=OL(),e=Ng(),t=jv(),r=z0(),o=g1(),n=Array.isArray,i=Function.prototype.call,a={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;X.exports=function(f){var c=arguments[1],v=arguments[2],p,T,l,g,b,A,E,_,w,m;if(f=Object(t(f)),r(c)&&e(c),!this||this===Array||!S(this)){if(!c){if(x(f))return b=f.length,b!==1?Array.apply(null,f):(g=new Array(1),g[0]=f[0],g);if(n(f)){for(g=new Array(b=f.length),T=0;T=55296&&A<=56319&&(m+=f[++T])),m=c?i.call(c,v,m,l):m,p?(a.value=m,s(g,l,a)):g[l]=m,++l;b=l}}if(b===void 0)for(b=k(f.length),p&&(g=new p(b)),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}))}}),qL=_e({"node_modules/es6-iterator/array.js"(ee,X){var h=vx(),x=iA(),S=Vv(),k=F0(),e=lA(),t=Object.defineProperty,r;r=X.exports=function(o,n){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,o),n?x.call(n,"key+value")?n="key+value":x.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,k.toStringTag,S("c","Array Iterator"))}}),GL=_e({"node_modules/es6-iterator/string.js"(ee,X){var h=vx(),x=Vv(),S=F0(),k=lA(),e=Object.defineProperty,t;t=X.exports=function(r){if(!(this instanceof t))throw new TypeError("Constructor requires 'new'");r=String(r),k.call(this,r),e(this,"__length__",x("",r.length))},h&&h(t,k),delete t.prototype.constructor,t.prototype=Object.create(k.prototype,{_next:x(function(){if(this.__list__){if(this.__nextIndex__=55296&&n<=56319?o+this.__list__[this.__nextIndex__++]:o)})}),e(t.prototype,S.toStringTag,x("c","String Iterator"))}}),HL=_e({"node_modules/es6-iterator/is-iterable.js"(ee,X){var h=m1(),x=z0(),S=g1(),k=F0().iterator,e=Array.isArray;X.exports=function(t){return x(t)?e(t)||S(t)||h(t)?!0:typeof t[k]=="function":!1}}}),$L=_e({"node_modules/es6-iterator/valid-iterable.js"(ee,X){var h=HL();X.exports=function(x){if(!h(x))throw new TypeError(x+" is not iterable");return x}}}),uA=_e({"node_modules/es6-iterator/get.js"(ee,X){var h=m1(),x=g1(),S=qL(),k=GL(),e=$L(),t=F0().iterator;X.exports=function(r){return typeof e(r)[t]=="function"?r[t]():h(r)?new S(r):x(r)?new k(r):new S(r)}}}),WL=_e({"node_modules/es6-iterator/for-of.js"(ee,X){var h=m1(),x=Ng(),S=g1(),k=uA(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;X.exports=function(o,n){var i,a=arguments[2],s,f,c,v,p,T,l;if(e(o)||h(o)?i="array":S(o)?i="string":o=k(o),x(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(p=o.length,v=0;v=55296&&l<=56319&&(T+=o[++v])),t.call(n,a,T,f),!c);++v);return}for(s=o.next();!s.done;){if(t.call(n,a,s.value,f),c)return;s=o.next()}}}}),YL=_e({"node_modules/es6-weak-map/is-native-implemented.js"(ee,X){X.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}}),XL=_e({"node_modules/es6-weak-map/polyfill.js"(ee,X){var h=z0(),x=vx(),S=aL(),k=jv(),e=iL(),t=Vv(),r=uA(),o=WL(),n=F0().toStringTag,i=YL(),a=Array.isArray,s=Object.defineProperty,f=Object.prototype.hasOwnProperty,c=Object.getPrototypeOf,v;X.exports=v=function(){var p=arguments[0],T;if(!(this instanceof v))throw new TypeError("Constructor requires 'new'");return T=i&&x&&WeakMap!==v?x(new WeakMap,c(this)):this,h(p)&&(a(p)||(p=r(p))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),p&&o(p,function(l){k(l),T.set(l[0],l[1])}),T},i&&(x&&x(v,WeakMap),v.prototype=Object.create(WeakMap.prototype,{constructor:t(v)})),Object.defineProperties(v.prototype,{delete:t(function(p){return f.call(S(p),this.__weakMapData__)?(delete p[this.__weakMapData__],!0):!1}),get:t(function(p){if(f.call(S(p),this.__weakMapData__))return p[this.__weakMapData__]}),has:t(function(p){return f.call(S(p),this.__weakMapData__)}),set:t(function(p,T){return s(S(p),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(v.prototype,n,t("c","WeakMap"))}}),cA=_e({"node_modules/es6-weak-map/index.js"(ee,X){X.exports=tL()()?WeakMap:XL()}}),ZL=_e({"node_modules/array-find-index/index.js"(ee,X){X.exports=function(h,x,S){if(typeof Array.prototype.findIndex=="function")return h.findIndex(x,S);if(typeof x!="function")throw new TypeError("predicate must be a function");var k=Object(h),e=k.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; } `;X.exports=g;function g(b,A){if(!(this instanceof g))return new g(b,A);if(typeof b=="function"?(A||(A={}),A.regl=b):A=b,A.length&&(A.positions=A),b=A.regl,!b.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=b._gl,this.regl=b,this.passes=[],this.shaders=g.shaders.has(b)?g.shaders.get(b):g.shaders.set(b,g.createShaders(b)).get(b),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(b){let A=b.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),E={primitive:"triangle strip",instances:b.prop("count"),count:4,offset:0,uniforms:{miterMode:(u,d)=>d.join==="round"?2:1,miterLimit:b.prop("miterLimit"),scale:b.prop("scale"),scaleFract:b.prop("scaleFract"),translateFract:b.prop("translateFract"),translate:b.prop("translate"),thickness:b.prop("thickness"),dashTexture:b.prop("dashTexture"),opacity:b.prop("opacity"),pixelRatio:b.context("pixelRatio"),id:b.prop("id"),dashLength:b.prop("dashLength"),viewport:(u,d)=>[d.viewport.x,d.viewport.y,u.viewportWidth,u.viewportHeight],depth:b.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,d)=>!d.overlay},stencil:{enable:!1},scissor:{enable:!0,box:b.prop("viewport")},viewport:b.prop("viewport")},_=b(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:b.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:b.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},E)),w;try{w=b(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:b.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:b.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},E))}catch{w=_}return{fill:b({primitive:"triangle",elements:(u,d)=>d.triangles,offset:0,vert:v,frag:p,uniforms:{scale:b.prop("scale"),color:b.prop("fill"),scaleFract:b.prop("scaleFract"),translateFract:b.prop("translateFract"),translate:b.prop("translate"),opacity:b.prop("opacity"),pixelRatio:b.context("pixelRatio"),id:b.prop("id"),viewport:(u,d)=>[d.viewport.x,d.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:b.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:8}},blend:E.blend,depth:{enable:!1},scissor:E.scissor,stencil:E.stencil,viewport:E.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(...b){b.length&&this.update(...b),this.draw()},g.prototype.draw=function(...b){return(b.length?b:this.passes).forEach((A,E)=>{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(b){if(!b)return;b.length!=null?typeof b[0]=="number"&&(b=[{positions:b}]):Array.isArray(b)||(b=[b]);let{regl:A,gl:E}=this;if(b.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=k(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,mpe-ge),J=[],oe=0,ye=u.hole!=null?u.hole[0]:null;if(ye!=null){let pe=s(q,ge=>ge>=ye);q=q.slice(0,pe),q.push(ye)}for(let pe=0;pese-ye+(q[pe]-oe)),ae=t(ge,W);ae=ae.map(se=>se+oe+(se+oe{b.colorBuffer.destroy(),b.positionBuffer.destroy(),b.dashTexture.destroy()}),this.passes.length=0,this}}}),KL=_e({"node_modules/regl-error2d/index.js"(ee,X){var h=Am(),x=L0(),S=J3(),k=fv(),e=Dh(),t=Sm(),{float32:r,fract32:o}=px();X.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,v,p,T,l,g,b={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)}),v=a.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),p=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:(d,y)=>[y.viewport.x,y.viewport.y,d.viewportWidth,d.viewportHeight]},attributes:{color:{buffer:T,offset:(d,y)=>y.offset*4,divisor:1},position:{buffer:v,offset:(d,y)=>y.offset*8,divisor:1},positionFract:{buffer:p,offset:(d,y)=>y.offset*8,divisor:1},error:{buffer:l,offset:(d,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(E,{update:m,draw:_,destroy:u,regl:a,gl:f,canvas:f.canvas,groups:A}),E;function E(d){d?m(d):d===null&&u(),_()}function _(d){if(typeof d=="number")return w(d);d&&!Array.isArray(d)&&(d=[d]),a._refresh(),A.forEach((y,R)=>{if(y){if(d&&(d[R]?y.draw=!0:y.draw=!1),!y.draw){y.draw=!0;return}w(R)}})}function w(d){typeof d=="number"&&(d=A[d]),d!=null&&d&&d.count&&d.color&&d.opacity&&d.positions&&d.positions.length>1&&(d.scaleRatio=[d.scale[0]*d.viewport.width,d.scale[1]*d.viewport.height],c(d),d.after&&d.after(d))}function m(d){if(!d)return;d.length!=null?typeof d[0]=="number"&&(d=[{positions:d}]):Array.isArray(d)||(d=[d]);let y=0,R=0;if(E.groups=A=d.map((N,U)=>{let B=A[U];if(N)typeof N=="function"?N={after:N}:typeof N[0]=="number"&&(N={positions:N});else return B;return N=k(N,{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[U]=B={id:U,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},N=e({},b,N)),S(B,N,[{lineWidth:D=>+D*.5,capSize:D=>+D*.5,opacity:parseFloat,errors:D=>(D=t(D),R+=D.length,D),positions:(D,j)=>(D=t(D,"float64"),j.count=Math.floor(D.length/2),j.bounds=h(D,2),j.offset=y,y+=j.count,D)},{color:(D,j)=>{let q=j.count;if(D||(D="transparent"),!Array.isArray(D)||typeof D[0]=="number"){let oe=D;D=Array(q);for(let ye=0;ye{let J=j.bounds;return D||(D=J),j.scale=[1/(D[2]-D[0]),1/(D[3]-D[1])],j.translate=[-D[0],-D[1]],j.scaleFract=o(j.scale),j.translateFract=o(j.translate),D},viewport:D=>{let j;return Array.isArray(D)?j={x:D[0],y:D[1],width:D[2]-D[0],height:D[3]-D[1]}:D?(j={x:D.x||D.left||0,y:D.y||D.top||0},D.right?j.width=D.right-j.x:j.width=D.w||D.width||0,D.bottom?j.height=D.bottom-j.y:j.height=D.h||D.height||0):j={x:0,y:0,width:f.drawingBufferWidth,height:f.drawingBufferHeight},j}}]),B}),y||R){let N=A.reduce((j,q,J)=>j+(q?q.count:0),0),U=new Float64Array(N*2),B=new Uint8Array(N*4),D=new Float32Array(N*4);A.forEach((j,q)=>{if(!j)return;let{positions:J,count:oe,offset:ye,color:pe,errors:ge}=j;oe&&(B.set(pe,ye*4),D.set(ge,ye*4),U.set(J,ye*2))});var L=r(U);v(L);var z=o(U,L);p(z),T(B),l(D)}}function u(){v.destroy(),p.destroy(),T.destroy(),l.destroy(),g.destroy()}}}}),JL=_e({"node_modules/unquote/index.js"(ee,X){var h=/[\'\"]/;X.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):""}}}),hA=_e({"node_modules/css-global-keywords/index.json"(ee,X){X.exports=["inherit","initial","unset"]}}),dA=_e({"node_modules/css-system-font-keywords/index.json"(ee,X){X.exports=["caption","icon","menu","message-box","small-caption","status-bar"]}}),pA=_e({"node_modules/css-font-weight-keywords/index.json"(ee,X){X.exports=["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]}}),vA=_e({"node_modules/css-font-style-keywords/index.json"(ee,X){X.exports=["normal","italic","oblique"]}}),mA=_e({"node_modules/css-font-stretch-keywords/index.json"(ee,X){X.exports=["normal","condensed","semi-condensed","extra-condensed","ultra-condensed","expanded","semi-expanded","extra-expanded","ultra-expanded"]}}),QL=_e({"node_modules/parenthesis/index.js"(ee,X){function h(k,e){if(typeof k!="string")return[k];var t=[k];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 v(p,T,l){var g=t.push(p.slice(s[0].length,-s[1].length))-1;return c.push(g),o+g+o}t.forEach(function(p,T){for(var l,g=0;p!=l;)if(l=p,p=p.replace(f,v),g++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=p}),c=c.reverse(),t=t.map(function(p){return c.forEach(function(T){p=p.replace(new RegExp("(\\"+o+T+"\\"+o+")","g"),s[0]+"$1"+s[1])}),p})});var i=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(s,f,c){for(var v=[],p,T=0;p=i.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");v.push(s.slice(0,p.index)),v.push(a(f[p[1]],f)),s=s.slice(p.index+p[0].length)}return v.push(s),v}return n?t:a(t[0],t)}function x(k,e){if(e&&e.flat){var t=e&&e.escape||"___",r=k[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 "+k);o=r,r=r.replace(n,a)}return r}return k.reduce(function s(f,c){return Array.isArray(c)&&(c=c.reduce(s,"")),f+c},"");function a(s,f){if(k[f]==null)throw Error("Reference "+f+"is undefined");return k[f]}}function S(k,e){return Array.isArray(k)?x(k,e):h(k,e)}S.parse=h,S.stringify=x,X.exports=S}}),eI=_e({"node_modules/string-split-by/index.js"(ee,X){var h=QL();X.exports=function(S,k,e){if(S==null)throw Error("First argument should be a string");if(k==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(k);if(e.escape){for(var n=[],i=0;i1&&Er===Dr&&(Er==='"'||Er==="'"))return['"'+r(St.substr(1,St.length-2))+'"'];var Bn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(St);if(Bn)return o(St.substr(0,Bn.index)).concat(o(Bn[1])).concat(o(St.substr(Bn.index+Bn[0].length)));var Aa=St.split(".");if(Aa.length===1)return['"'+r(St)+'"'];for(var En=[],Sn=0;Sn"u"?1:window.devicePixelRatio,oi=!1,Hi={},Ci=function(pn){},ai=function(){};if(typeof Er=="string"?Dr=document.querySelector(Er):typeof Er=="object"&&(g(Er)?Dr=Er:b(Er)?(En=Er,Aa=En.canvas):("gl"in Er?En=Er.gl:"canvas"in Er?Aa=E(Er.canvas):"container"in Er&&(Bn=E(Er.container)),"attributes"in Er&&(Sn=Er.attributes),"extensions"in Er&&(Ya=A(Er.extensions)),"optionalExtensions"in Er&&($a=A(Er.optionalExtensions)),"onDone"in Er&&(Ci=Er.onDone),"profile"in Er&&(oi=!!Er.profile),"pixelRatio"in Er&&(Wa=+Er.pixelRatio),"cachedCode"in Er&&(Hi=Er.cachedCode))),Dr&&(Dr.nodeName.toLowerCase()==="canvas"?Aa=Dr:Bn=Dr),!En){if(!Aa){var Pa=T(Bn||document.body,Ci,Wa);if(!Pa)return null;Aa=Pa.canvas,ai=Pa.onDestroy}Sn.premultipliedAlpha===void 0&&(Sn.premultipliedAlpha=!0),En=l(Aa,Sn)}return En?{gl:En,canvas:Aa,container:Bn,extensions:Ya,optionalExtensions:$a,pixelRatio:Wa,profile:oi,cachedCode:Hi,onDone:Ci,onDestroy:ai}:(ai(),Ci("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(St,Er){var Dr={};function Bn(Sn){var Ya=Sn.toLowerCase(),$a;try{$a=Dr[Ya]=St.getExtension(Ya)}catch{}return!!$a}for(var Aa=0;Aa65535)<<4,St>>>=Er,Dr=(St>255)<<3,St>>>=Dr,Er|=Dr,Dr=(St>15)<<2,St>>>=Dr,Er|=Dr,Dr=(St>3)<<1,St>>>=Dr,Er|=Dr,Er|St>>1}function D(){var St=m(8,function(){return[]});function Er(En){var Sn=U(En),Ya=St[B(Sn)>>2];return Ya.length>0?Ya.pop():new ArrayBuffer(Sn)}function Dr(En){St[B(En.byteLength)>>2].push(En)}function Bn(En,Sn){var Ya=null;switch(En){case u:Ya=new Int8Array(Er(Sn),0,Sn);break;case d:Ya=new Uint8Array(Er(Sn),0,Sn);break;case y:Ya=new Int16Array(Er(2*Sn),0,Sn);break;case R:Ya=new Uint16Array(Er(2*Sn),0,Sn);break;case L:Ya=new Int32Array(Er(4*Sn),0,Sn);break;case z:Ya=new Uint32Array(Er(4*Sn),0,Sn);break;case N:Ya=new Float32Array(Er(4*Sn),0,Sn);break;default:return null}return Ya.length!==Sn?Ya.subarray(0,Sn):Ya}function Aa(En){Dr(En.buffer)}return{alloc:Er,free:Dr,allocType:Bn,freeType:Aa}}var j=D();j.zero=D();var q=3408,J=3410,oe=3411,ye=3412,pe=3413,ge=3414,W=3415,ae=33901,se=33902,Q=3379,me=3386,ie=34921,Y=36347,le=36348,ue=35661,Te=35660,Fe=34930,Ve=36349,Xe=34076,We=34024,it=7936,yt=7937,bt=7938,mt=35724,ht=34047,qe=36063,ze=34852,Ae=3553,Ke=34067,_t=34069,wt=33984,vt=6408,$t=5126,Yt=5121,lr=36160,dr=36053,Nr=36064,Fr=16384,ln=function(St,Er){var Dr=1;Er.ext_texture_filter_anisotropic&&(Dr=St.getParameter(ht));var Bn=1,Aa=1;Er.webgl_draw_buffers&&(Bn=St.getParameter(ze),Aa=St.getParameter(qe));var En=!!Er.oes_texture_float;if(En){var Sn=St.createTexture();St.bindTexture(Ae,Sn),St.texImage2D(Ae,0,vt,1,1,0,vt,$t,null);var Ya=St.createFramebuffer();if(St.bindFramebuffer(lr,Ya),St.framebufferTexture2D(lr,Nr,Ae,Sn,0),St.bindTexture(Ae,null),St.checkFramebufferStatus(lr)!==dr)En=!1;else{St.viewport(0,0,1,1),St.clearColor(1,0,0,1),St.clear(Fr);var $a=j.allocType($t,4);St.readPixels(0,0,1,1,vt,$t,$a),St.getError()?En=!1:(St.deleteFramebuffer(Ya),St.deleteTexture(Sn),En=$a[0]===1),j.freeType($a)}}var Wa=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),oi=!0;if(!Wa){var Hi=St.createTexture(),Ci=j.allocType(Yt,36);St.activeTexture(wt),St.bindTexture(Ke,Hi),St.texImage2D(_t,0,vt,3,3,0,vt,Yt,Ci),j.freeType(Ci),St.bindTexture(Ke,null),St.deleteTexture(Hi),oi=!St.getError()}return{colorBits:[St.getParameter(J),St.getParameter(oe),St.getParameter(ye),St.getParameter(pe)],depthBits:St.getParameter(ge),stencilBits:St.getParameter(W),subpixelBits:St.getParameter(q),extensions:Object.keys(Er).filter(function(ai){return!!Er[ai]}),maxAnisotropic:Dr,maxDrawbuffers:Bn,maxColorAttachments:Aa,pointSizeDims:St.getParameter(ae),lineWidthDims:St.getParameter(se),maxViewportDims:St.getParameter(me),maxCombinedTextureUnits:St.getParameter(ue),maxCubeMapSize:St.getParameter(Xe),maxRenderbufferSize:St.getParameter(We),maxTextureUnits:St.getParameter(Fe),maxTextureSize:St.getParameter(Q),maxAttributes:St.getParameter(ie),maxVertexUniforms:St.getParameter(Y),maxVertexTextureUnits:St.getParameter(Te),maxVaryingVectors:St.getParameter(le),maxFragmentUniforms:St.getParameter(Ve),glsl:St.getParameter(mt),renderer:St.getParameter(yt),vendor:St.getParameter(it),version:St.getParameter(bt),readFloat:En,npotTextureCube:oi}},zr=function(St){return St instanceof Uint8Array||St instanceof Uint16Array||St instanceof Uint32Array||St instanceof Int8Array||St instanceof Int16Array||St instanceof Int32Array||St instanceof Float32Array||St instanceof Float64Array||St instanceof Uint8ClampedArray};function Xr(St){return!!St&&typeof St=="object"&&Array.isArray(St.shape)&&Array.isArray(St.stride)&&typeof St.offset=="number"&&St.shape.length===St.stride.length&&(Array.isArray(St.data)||zr(St.data))}var Ot=function(St){return Object.keys(St).map(function(Er){return St[Er]})},Qe={shape:at,flatten:Be};function ct(St,Er,Dr){for(var Bn=0;Bn0){var Ui;if(Array.isArray(Zn[0])){Qa=Jn(Zn);for(var ya=1,sa=1;sa0){if(typeof ya[0]=="number"){var ui=j.allocType(ga.dtype,ya.length);rn(ui,ya),Qa(ui,yi),j.freeType(ui)}else if(Array.isArray(ya[0])||zr(ya[0])){Wn=Jn(ya);var Xa=ma(ya,Wn,ga.dtype);Qa(Xa,yi),j.freeType(Xa)}}}else if(Xr(ya)){Wn=ya.shape;var qi=ya.stride,Co=0,Li=0,Wi=0,ii=0;Wn.length===1?(Co=Wn[0],Li=1,Wi=qi[0],ii=0):Wn.length===2&&(Co=Wn[0],Li=Wn[1],Wi=qi[0],ii=qi[1]);var Ao=Array.isArray(ya.data)?ga.dtype:_r(ya.data),Uo=j.allocType(Ao,Co*Li);gn(Uo,ya.data,Co,Li,Wi,ii,ya.offset),Qa(Uo,yi),j.freeType(Uo)}return Ti}return da||Ti(pn),Ti._reglType="buffer",Ti._buffer=ga,Ti.subdata=Ui,Dr.profile&&(Ti.stats=ga.stats),Ti.destroy=function(){Ci(ga)},Ti}function Pa(){Ot(En).forEach(function(pn){pn.buffer=St.createBuffer(),St.bindBuffer(pn.type,pn.buffer),St.bufferData(pn.type,pn.persistentData||pn.byteLength,pn.usage)})}return Dr.profile&&(Er.getTotalBufferSize=function(){var pn=0;return Object.keys(En).forEach(function(Zn){pn+=En[Zn].stats.size}),pn}),{create:ai,createStream:$a,destroyStream:Wa,clear:function(){Ot(En).forEach(Ci),Ya.forEach(Ci)},getBuffer:function(pn){return pn&&pn._buffer instanceof Sn?pn._buffer:null},restore:Pa,_initBuffer:Hi}}var In=0,fa=0,Ca=1,Ma=1,Da=4,Va=4,na={points:In,point:fa,lines:Ca,line:Ma,triangles:Da,triangle:Va,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Mi=0,Oi=1,Vt=4,Ct=5120,Br=5121,Kr=5122,Qr=5123,Gr=5124,Jr=5125,yn=34963,cn=35040,Dt=35044;function yr(St,Er,Dr,Bn){var Aa={},En=0,Sn={uint8:Br,uint16:Qr};Er.oes_element_index_uint&&(Sn.uint32=Jr);function Ya(Pa){this.id=En++,Aa[this.id]=this,this.buffer=Pa,this.primType=Vt,this.vertCount=0,this.type=0}Ya.prototype.bind=function(){this.buffer.bind()};var $a=[];function Wa(Pa){var pn=$a.pop();return pn||(pn=new Ya(Dr.create(null,yn,!0,!1)._buffer)),Hi(pn,Pa,cn,-1,-1,0,0),pn}function oi(Pa){$a.push(Pa)}function Hi(Pa,pn,Zn,da,Ia,ga,Ti){Pa.buffer.bind();var Qa;if(pn){var Ui=Ti;!Ti&&(!zr(pn)||Xr(pn)&&!zr(pn.data))&&(Ui=Er.oes_element_index_uint?Jr:Qr),Dr._initBuffer(Pa.buffer,pn,Zn,Ui,3)}else St.bufferData(yn,ga,Zn),Pa.buffer.dtype=Qa||Br,Pa.buffer.usage=Zn,Pa.buffer.dimension=3,Pa.buffer.byteLength=ga;if(Qa=Ti,!Ti){switch(Pa.buffer.dtype){case Br:case Ct:Qa=Br;break;case Qr:case Kr:Qa=Qr;break;case Jr:case Gr:Qa=Jr;break}Pa.buffer.dtype=Qa}Pa.type=Qa;var ya=Ia;ya<0&&(ya=Pa.buffer.byteLength,Qa===Qr?ya>>=1:Qa===Jr&&(ya>>=2)),Pa.vertCount=ya;var sa=da;if(da<0){sa=Vt;var yi=Pa.buffer.dimension;yi===1&&(sa=Mi),yi===2&&(sa=Oi),yi===3&&(sa=Vt)}Pa.primType=sa}function Ci(Pa){Bn.elementsCount--,delete Aa[Pa.id],Pa.buffer.destroy(),Pa.buffer=null}function ai(Pa,pn){var Zn=Dr.create(null,yn,!0),da=new Ya(Zn._buffer);Bn.elementsCount++;function Ia(ga){if(!ga)Zn(),da.primType=Vt,da.vertCount=0,da.type=Br;else if(typeof ga=="number")Zn(ga),da.primType=Vt,da.vertCount=ga|0,da.type=Br;else{var Ti=null,Qa=Dt,Ui=-1,ya=-1,sa=0,yi=0;Array.isArray(ga)||zr(ga)||Xr(ga)?Ti=ga:("data"in ga&&(Ti=ga.data),"usage"in ga&&(Qa=va[ga.usage]),"primitive"in ga&&(Ui=na[ga.primitive]),"count"in ga&&(ya=ga.count|0),"type"in ga&&(yi=Sn[ga.type]),"length"in ga?sa=ga.length|0:(sa=ya,yi===Qr||yi===Kr?sa*=2:(yi===Jr||yi===Gr)&&(sa*=4))),Hi(da,Ti,Qa,Ui,ya,sa,yi)}return Ia}return Ia(Pa),Ia._reglType="elements",Ia._elements=da,Ia.subdata=function(ga,Ti){return Zn.subdata(ga,Ti),Ia},Ia.destroy=function(){Ci(da)},Ia}return{create:ai,createStream:Wa,destroyStream:oi,getElements:function(Pa){return typeof Pa=="function"&&Pa._elements instanceof Ya?Pa._elements:null},clear:function(){Ot(Aa).forEach(Ci)}}}var Hr=new Float32Array(1),_n=new Uint32Array(Hr.buffer),Hn=5123;function ea(St){for(var Er=j.allocType(Hn,St.length),Dr=0;Dr>>31<<15,En=(Bn<<1>>>24)-127,Sn=Bn>>13&1023;if(En<-24)Er[Dr]=Aa;else if(En<-14){var Ya=-14-En;Er[Dr]=Aa+(Sn+1024>>Ya)}else En>15?Er[Dr]=Aa+31744:Er[Dr]=Aa+(En+15<<10)+Sn}return Er}function Qn(St){return Array.isArray(St)||zr(St)}var bn=34467,$n=3553,ki=34067,Ua=34069,Fi=6408,Ji=6406,fo=6407,co=6409,So=6410,wi=32854,ts=32855,jo=36194,js=32819,us=32820,Zo=33635,No=34042,Vs=6402,Ns=34041,rl=35904,cs=35906,$o=36193,yo=33776,fs=33777,nl=33778,wl=33779,Ml=35986,Ts=35987,Ai=34798,uo=35840,Tl=35841,Cs=35842,Ro=35843,El=36196,qs=5121,al=5123,mu=5125,io=5126,vs=10242,rs=10243,Bl=10497,Ul=33071,Lo=33648,tu=10240,su=10241,Ds=9728,vl=9729,Il=9984,zl=9985,Ou=9986,qc=9987,Mc=33170,Dc=4352,rh=4353,Hf=4354,ml=34046,vc=3317,nh=37440,Gu=37441,zu=37443,Hu=37444,Rc=33984,$l=[Il,Ou,zl,qc],Fu=[0,co,So,fo,Fi],Bs={};Bs[co]=Bs[Ji]=Bs[Vs]=1,Bs[Ns]=Bs[So]=2,Bs[fo]=Bs[rl]=3,Bs[Fi]=Bs[cs]=4;function kl(St){return"[object "+St+"]"}var rf=kl("HTMLCanvasElement"),lc=kl("OffscreenCanvas"),df=kl("CanvasRenderingContext2D"),ru=kl("ImageBitmap"),Rh=kl("HTMLImageElement"),Rs=kl("HTMLVideoElement"),Yh=Object.keys(ft).concat([rf,lc,df,ru,Rh,Rs]),ul=[];ul[qs]=1,ul[io]=4,ul[$o]=2,ul[al]=2,ul[mu]=4;var Do=[];Do[wi]=2,Do[ts]=2,Do[jo]=2,Do[Ns]=4,Do[yo]=.5,Do[fs]=.5,Do[nl]=1,Do[wl]=1,Do[Ml]=.5,Do[Ts]=1,Do[Ai]=1,Do[uo]=.5,Do[Tl]=.25,Do[Cs]=.5,Do[Ro]=.25,Do[El]=.5;function kf(St){return Array.isArray(St)&&(St.length===0||typeof St[0]=="number")}function Oc(St){if(!Array.isArray(St))return!1;var Er=St.length;return!(Er===0||!Qn(St[0]))}function Cu(St){return Object.prototype.toString.call(St)}function ah(St){return Cu(St)===rf}function pf(St){return Cu(St)===lc}function Nf(St){return Cu(St)===df}function Nu(St){return Cu(St)===ru}function Eh(St){return Cu(St)===Rh}function fh(St){return Cu(St)===Rs}function Bf(St){if(!St)return!1;var Er=Cu(St);return Yh.indexOf(Er)>=0?!0:kf(St)||Oc(St)||Xr(St)}function vf(St){return ft[Object.prototype.toString.call(St)]|0}function ih(St,Er){var Dr=Er.length;switch(St.type){case qs:case al:case mu:case io:var Bn=j.allocType(St.type,Dr);Bn.set(Er),St.data=Bn;break;case $o:St.data=ea(Er);break}}function oh(St,Er){return j.allocType(St.type===$o?io:St.type,Er)}function zc(St,Er){St.type===$o?(St.data=ea(Er),j.freeType(Er)):St.data=Er}function hh(St,Er,Dr,Bn,Aa,En){for(var Sn=St.width,Ya=St.height,$a=St.channels,Wa=Sn*Ya*$a,oi=oh(St,Wa),Hi=0,Ci=0;Ci=1;)Ya+=Sn*$a*$a,$a/=2;return Ya}else return Sn*Dr*Bn}function Gc(St,Er,Dr,Bn,Aa,En,Sn){var Ya={"don't care":Dc,"dont care":Dc,nice:Hf,fast:rh},$a={repeat:Bl,clamp:Ul,mirror:Lo},Wa={nearest:Ds,linear:vl},oi=h({mipmap:qc,"nearest mipmap nearest":Il,"linear mipmap nearest":zl,"nearest mipmap linear":Ou,"linear mipmap linear":qc},Wa),Hi={none:0,browser:Hu},Ci={uint8:qs,rgba4:js,rgb565:Zo,"rgb5 a1":us},ai={alpha:Ji,luminance:co,"luminance alpha":So,rgb:fo,rgba:Fi,rgba4:wi,"rgb5 a1":ts,rgb565:jo},Pa={};Er.ext_srgb&&(ai.srgb=rl,ai.srgba=cs),Er.oes_texture_float&&(Ci.float32=Ci.float=io),Er.oes_texture_half_float&&(Ci.float16=Ci["half float"]=$o),Er.webgl_depth_texture&&(h(ai,{depth:Vs,"depth stencil":Ns}),h(Ci,{uint16:al,uint32:mu,"depth stencil":No})),Er.webgl_compressed_texture_s3tc&&h(Pa,{"rgb s3tc dxt1":yo,"rgba s3tc dxt1":fs,"rgba s3tc dxt3":nl,"rgba s3tc dxt5":wl}),Er.webgl_compressed_texture_atc&&h(Pa,{"rgb atc":Ml,"rgba atc explicit alpha":Ts,"rgba atc interpolated alpha":Ai}),Er.webgl_compressed_texture_pvrtc&&h(Pa,{"rgb pvrtc 4bppv1":uo,"rgb pvrtc 2bppv1":Tl,"rgba pvrtc 4bppv1":Cs,"rgba pvrtc 2bppv1":Ro}),Er.webgl_compressed_texture_etc1&&(Pa["rgb etc1"]=El);var pn=Array.prototype.slice.call(St.getParameter(bn));Object.keys(Pa).forEach(function(G){var xe=Pa[G];pn.indexOf(xe)>=0&&(ai[G]=xe)});var Zn=Object.keys(ai);Dr.textureFormats=Zn;var da=[];Object.keys(ai).forEach(function(G){var xe=ai[G];da[xe]=G});var Ia=[];Object.keys(Ci).forEach(function(G){var xe=Ci[G];Ia[xe]=G});var ga=[];Object.keys(Wa).forEach(function(G){var xe=Wa[G];ga[xe]=G});var Ti=[];Object.keys(oi).forEach(function(G){var xe=oi[G];Ti[xe]=G});var Qa=[];Object.keys($a).forEach(function(G){var xe=$a[G];Qa[xe]=G});var Ui=Zn.reduce(function(G,xe){var re=ai[xe];return re===co||re===Ji||re===co||re===So||re===Vs||re===Ns||Er.ext_srgb&&(re===rl||re===cs)?G[re]=re:re===ts||xe.indexOf("rgba")>=0?G[re]=Fi:G[re]=fo,G},{});function ya(){this.internalformat=Fi,this.format=Fi,this.type=qs,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Hu,this.width=0,this.height=0,this.channels=0}function sa(G,xe){G.internalformat=xe.internalformat,G.format=xe.format,G.type=xe.type,G.compressed=xe.compressed,G.premultiplyAlpha=xe.premultiplyAlpha,G.flipY=xe.flipY,G.unpackAlignment=xe.unpackAlignment,G.colorSpace=xe.colorSpace,G.width=xe.width,G.height=xe.height,G.channels=xe.channels}function yi(G,xe){if(!(typeof xe!="object"||!xe)){if("premultiplyAlpha"in xe&&(G.premultiplyAlpha=xe.premultiplyAlpha),"flipY"in xe&&(G.flipY=xe.flipY),"alignment"in xe&&(G.unpackAlignment=xe.alignment),"colorSpace"in xe&&(G.colorSpace=Hi[xe.colorSpace]),"type"in xe){var re=xe.type;G.type=Ci[re]}var Le=G.width,et=G.height,xt=G.channels,At=!1;"shape"in xe?(Le=xe.shape[0],et=xe.shape[1],xe.shape.length===3&&(xt=xe.shape[2],At=!0)):("radius"in xe&&(Le=et=xe.radius),"width"in xe&&(Le=xe.width),"height"in xe&&(et=xe.height),"channels"in xe&&(xt=xe.channels,At=!0)),G.width=Le|0,G.height=et|0,G.channels=xt|0;var lt=!1;if("format"in xe){var gt=xe.format,It=G.internalformat=ai[gt];G.format=Ui[It],gt in Ci&&("type"in xe||(G.type=Ci[gt])),gt in Pa&&(G.compressed=!0),lt=!0}!At&<?G.channels=Bs[G.format]:At&&!lt&&G.channels!==Fu[G.format]&&(G.format=G.internalformat=Fu[G.channels])}}function Wn(G){St.pixelStorei(nh,G.flipY),St.pixelStorei(Gu,G.premultiplyAlpha),St.pixelStorei(zu,G.colorSpace),St.pixelStorei(vc,G.unpackAlignment)}function ui(){ya.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Xa(G,xe){var re=null;if(Bf(xe)?re=xe:xe&&(yi(G,xe),"x"in xe&&(G.xOffset=xe.x|0),"y"in xe&&(G.yOffset=xe.y|0),Bf(xe.data)&&(re=xe.data)),xe.copy){var Le=Aa.viewportWidth,et=Aa.viewportHeight;G.width=G.width||Le-G.xOffset,G.height=G.height||et-G.yOffset,G.needsCopy=!0}else if(!re)G.width=G.width||1,G.height=G.height||1,G.channels=G.channels||4;else if(zr(re))G.channels=G.channels||4,G.data=re,!("type"in xe)&&G.type===qs&&(G.type=vf(re));else if(kf(re))G.channels=G.channels||4,ih(G,re),G.alignment=1,G.needsFree=!0;else if(Xr(re)){var xt=re.data;!Array.isArray(xt)&&G.type===qs&&(G.type=vf(xt));var At=re.shape,lt=re.stride,gt,It,ar,Jt,sr,pr;At.length===3?(ar=At[2],pr=lt[2]):(ar=1,pr=1),gt=At[0],It=At[1],Jt=lt[0],sr=lt[1],G.alignment=1,G.width=gt,G.height=It,G.channels=ar,G.format=G.internalformat=Fu[ar],G.needsFree=!0,hh(G,xt,Jt,sr,pr,re.offset)}else if(ah(re)||pf(re)||Nf(re))ah(re)||pf(re)?G.element=re:G.element=re.canvas,G.width=G.element.width,G.height=G.element.height,G.channels=4;else if(Nu(re))G.element=re,G.width=re.width,G.height=re.height,G.channels=4;else if(Eh(re))G.element=re,G.width=re.naturalWidth,G.height=re.naturalHeight,G.channels=4;else if(fh(re))G.element=re,G.width=re.videoWidth,G.height=re.videoHeight,G.channels=4;else if(Oc(re)){var fr=G.width||re[0].length,Wt=G.height||re.length,rr=G.channels;Qn(re[0][0])?rr=rr||re[0][0].length:rr=rr||1;for(var er=Qe.shape(re),$r=1,sn=0;sn>=et,re.height>>=et,Xa(re,Le[et]),G.mipmask|=1<=0&&!("faces"in xe)&&(G.genMipmaps=!0)}if("mag"in xe){var Le=xe.mag;G.magFilter=Wa[Le]}var et=G.wrapS,xt=G.wrapT;if("wrap"in xe){var At=xe.wrap;typeof At=="string"?et=xt=$a[At]:Array.isArray(At)&&(et=$a[At[0]],xt=$a[At[1]])}else{if("wrapS"in xe){var lt=xe.wrapS;et=$a[lt]}if("wrapT"in xe){var gt=xe.wrapT;xt=$a[gt]}}if(G.wrapS=et,G.wrapT=xt,"anisotropic"in xe&&(xe.anisotropic,G.anisotropic=xe.anisotropic),"mipmap"in xe){var It=!1;switch(typeof xe.mipmap){case"string":G.mipmapHint=Ya[xe.mipmap],G.genMipmaps=!0,It=!0;break;case"boolean":It=G.genMipmaps=xe.mipmap;break;case"object":G.genMipmaps=!1,It=!0;break}It&&!("min"in xe)&&(G.minFilter=Il)}}function Uu(G,xe){St.texParameteri(xe,su,G.minFilter),St.texParameteri(xe,tu,G.magFilter),St.texParameteri(xe,vs,G.wrapS),St.texParameteri(xe,rs,G.wrapT),Er.ext_texture_filter_anisotropic&&St.texParameteri(xe,ml,G.anisotropic),G.genMipmaps&&(St.hint(Mc,G.mipmapHint),St.generateMipmap(xe))}var Xc=0,Xl={},au=Dr.maxTextureUnits,mo=Array(au).map(function(){return null});function ju(G){ya.call(this),this.mipmask=0,this.internalformat=Fi,this.id=Xc++,this.refCount=1,this.target=G,this.texture=St.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new cu,Sn.profile&&(this.stats={size:0})}function zs(G){St.activeTexture(Rc),St.bindTexture(G.target,G.texture)}function Ll(){var G=mo[0];G?St.bindTexture(G.target,G.texture):St.bindTexture($n,null)}function Zu(G){var xe=G.texture,re=G.unit,Le=G.target;re>=0&&(St.activeTexture(Rc+re),St.bindTexture(Le,null),mo[re]=null),St.deleteTexture(xe),G.texture=null,G.params=null,G.pixels=null,G.refCount=0,delete Xl[G.id],En.textureCount--}h(ju.prototype,{bind:function(){var G=this;G.bindCount+=1;var xe=G.unit;if(xe<0){for(var re=0;re0)continue;Le.unit=-1}mo[re]=G,xe=re;break}Sn.profile&&En.maxTextureUnits>sr)-ar,pr.height=pr.height||(re.height>>sr)-Jt,zs(re),Co(pr,$n,ar,Jt,sr),Ll(),ii(pr),Le}function xt(At,lt){var gt=At|0,It=lt|0||gt;if(gt===re.width&&It===re.height)return Le;Le.width=re.width=gt,Le.height=re.height=It,zs(re);for(var ar=0;re.mipmask>>ar;++ar){var Jt=gt>>ar,sr=It>>ar;if(!Jt||!sr)break;St.texImage2D($n,ar,re.format,Jt,sr,0,re.format,re.type,null)}return Ll(),Sn.profile&&(re.stats.size=nf(re.internalformat,re.type,gt,It,!1,!1)),Le}return Le(G,xe),Le.subimage=et,Le.resize=xt,Le._reglType="texture2d",Le._texture=re,Sn.profile&&(Le.stats=re.stats),Le.destroy=function(){re.decRef()},Le}function Eo(G,xe,re,Le,et,xt){var At=new ju(ki);Xl[At.id]=At,En.cubeCount++;var lt=new Array(6);function gt(Jt,sr,pr,fr,Wt,rr){var er,$r=At.texInfo;for(cu.call($r),er=0;er<6;++er)lt[er]=_u();if(typeof Jt=="number"||!Jt){var sn=Jt|0||1;for(er=0;er<6;++er)Uo(lt[er],sn,sn)}else if(typeof Jt=="object")if(sr)Ko(lt[0],Jt),Ko(lt[1],sr),Ko(lt[2],pr),Ko(lt[3],fr),Ko(lt[4],Wt),Ko(lt[5],rr);else if(Pu($r,Jt),yi(At,Jt),"faces"in Jt){var xn=Jt.faces;for(er=0;er<6;++er)sa(lt[er],At),Ko(lt[er],xn[er])}else for(er=0;er<6;++er)Ko(lt[er],Jt);for(sa(At,lt[0]),$r.genMipmaps?At.mipmask=(lt[0].width<<1)-1:At.mipmask=lt[0].mipmask,At.internalformat=lt[0].internalformat,gt.width=lt[0].width,gt.height=lt[0].height,zs(At),er=0;er<6;++er)il(lt[er],Ua+er);for(Uu($r,ki),Ll(),Sn.profile&&(At.stats.size=nf(At.internalformat,At.type,gt.width,gt.height,$r.genMipmaps,!0)),gt.format=da[At.internalformat],gt.type=Ia[At.type],gt.mag=ga[$r.magFilter],gt.min=Ti[$r.minFilter],gt.wrapS=Qa[$r.wrapS],gt.wrapT=Qa[$r.wrapT],er=0;er<6;++er)Xs(lt[er]);return gt}function It(Jt,sr,pr,fr,Wt){var rr=pr|0,er=fr|0,$r=Wt|0,sn=Wi();return sa(sn,At),sn.width=0,sn.height=0,Xa(sn,sr),sn.width=sn.width||(At.width>>$r)-rr,sn.height=sn.height||(At.height>>$r)-er,zs(At),Co(sn,Ua+Jt,rr,er,$r),Ll(),ii(sn),gt}function ar(Jt){var sr=Jt|0;if(sr!==At.width){gt.width=At.width=sr,gt.height=At.height=sr,zs(At);for(var pr=0;pr<6;++pr)for(var fr=0;At.mipmask>>fr;++fr)St.texImage2D(Ua+pr,fr,At.format,sr>>fr,sr>>fr,0,At.format,At.type,null);return Ll(),Sn.profile&&(At.stats.size=nf(At.internalformat,At.type,gt.width,gt.height,!1,!0)),gt}}return gt(G,xe,re,Le,et,xt),gt.subimage=It,gt.resize=ar,gt._reglType="textureCube",gt._texture=At,Sn.profile&&(gt.stats=At.stats),gt.destroy=function(){At.decRef()},gt}function hs(){for(var G=0;G>Le,re.height>>Le,0,re.internalformat,re.type,null);else for(var et=0;et<6;++et)St.texImage2D(Ua+et,Le,re.internalformat,re.width>>Le,re.height>>Le,0,re.internalformat,re.type,null);Uu(re.texInfo,re.target)})}function De(){for(var G=0;G=0?_u=!0:$a.indexOf(Xs)>=0&&(_u=!1))),("depthTexture"in mo||"depthStencilTexture"in mo)&&(au=!!(mo.depthTexture||mo.depthStencilTexture)),"depth"in mo&&(typeof mo.depth=="boolean"?Ko=mo.depth:(Uu=mo.depth,il=!1)),"stencil"in mo&&(typeof mo.stencil=="boolean"?il=mo.stencil:(Xc=mo.stencil,Ko=!1)),"depthStencil"in mo&&(typeof mo.depthStencil=="boolean"?Ko=il=mo.depthStencil:(Xl=mo.depthStencil,Ko=!1,il=!1))}var zs=null,Ll=null,Zu=null,Ku=null;if(Array.isArray(Jo))zs=Jo.map(ai);else if(Jo)zs=[ai(Jo)];else for(zs=new Array(Pu),ii=0;ii0&&(Wi.depth=ui[0].depth,Wi.stencil=ui[0].stencil,Wi.depthStencil=ui[0].depthStencil),ui[Li]?ui[Li](Wi):ui[Li]=ya(Wi)}return h(Xa,{width:ii,height:ii,color:Xs})}function qi(Co){var Li,Wi=Co|0;if(Wi===Xa.width)return Xa;var ii=Xa.color;for(Li=0;Li=Ao.byteLength?Uo.subdata(Ao):(Uo.destroy(),sa.buffers[Li]=null)),sa.buffers[Li]||(Uo=sa.buffers[Li]=Aa.create(Wi,Df,!1,!0)),ii.buffer=Aa.getBuffer(Uo),ii.size=ii.buffer.dimension|0,ii.normalized=!1,ii.type=ii.buffer.dtype,ii.offset=0,ii.stride=0,ii.divisor=0,ii.state=1,qi[Li]=1}else Aa.getBuffer(Wi)?(ii.buffer=Aa.getBuffer(Wi),ii.size=ii.buffer.dimension|0,ii.normalized=!1,ii.type=ii.buffer.dtype,ii.offset=0,ii.stride=0,ii.divisor=0,ii.state=1):Aa.getBuffer(Wi.buffer)?(ii.buffer=Aa.getBuffer(Wi.buffer),ii.size=(+Wi.size||ii.buffer.dimension)|0,ii.normalized=!!Wi.normalized||!1,"type"in Wi?ii.type=Fn[Wi.type]:ii.type=ii.buffer.dtype,ii.offset=(Wi.offset||0)|0,ii.stride=(Wi.stride||0)|0,ii.divisor=(Wi.divisor||0)|0,ii.state=1):"x"in Wi&&(ii.x=+Wi.x||0,ii.y=+Wi.y||0,ii.z=+Wi.z||0,ii.w=+Wi.w||0,ii.state=2)}for(var Ko=0;Ko1)for(var Wn=0;Wnpn&&(pn=Zn.stats.uniformsCount)}),pn},Dr.getMaxAttributesCount=function(){var pn=0;return oi.forEach(function(Zn){Zn.stats.attributesCount>pn&&(pn=Zn.stats.attributesCount)}),pn});function Pa(){Aa={},En={};for(var pn=0;pn>>4&15)+Er.charAt(Bn&15);return Dr}function Wc(St){for(var Er="",Dr=-1,Bn,Aa;++Dr>>6&31,128|Bn&63):Bn<=65535?Er+=String.fromCharCode(224|Bn>>>12&15,128|Bn>>>6&63,128|Bn&63):Bn<=2097151&&(Er+=String.fromCharCode(240|Bn>>>18&7,128|Bn>>>12&63,128|Bn>>>6&63,128|Bn&63));return Er}function gu(St){for(var Er=Array(St.length>>2),Dr=0;Dr>5]|=(St.charCodeAt(Dr/8)&255)<<24-Dr%32;return Er}function uc(St){for(var Er="",Dr=0;Dr>5]>>>24-Dr%32&255);return Er}function lu(St,Er){return St>>>Er|St<<32-Er}function _f(St,Er){return St>>>Er}function Yc(St,Er,Dr){return St&Er^~St&Dr}function uh(St,Er,Dr){return St&Er^St&Dr^Er&Dr}function br(St){return lu(St,2)^lu(St,13)^lu(St,22)}function qr(St){return lu(St,6)^lu(St,11)^lu(St,25)}function An(St){return lu(St,7)^lu(St,18)^_f(St,3)}function vn(St){return lu(St,17)^lu(St,19)^_f(St,10)}var Xn=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 Na(St,Er){var Dr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Bn=new Array(64),Aa,En,Sn,Ya,$a,Wa,oi,Hi,Ci,ai,Pa,pn;for(St[Er>>5]|=128<<24-Er%32,St[(Er+64>>9<<4)+15]=Er,Ci=0;Ci>16)+(Er>>16)+(Dr>>16);return Bn<<16|Dr&65535}function pi(St){return Array.prototype.slice.call(St)}function xi(St){return pi(St).join("")}function $i(St){var Er=St&&St.cache,Dr=0,Bn=[],Aa=[],En=[];function Sn(Pa,pn){var Zn=pn&&pn.stable;if(!Zn){for(var da=0;da0&&(Pa.push(Ia,"="),Pa.push.apply(Pa,pi(arguments)),Pa.push(";")),Ia}return h(pn,{def:da,toString:function(){return xi([Zn.length>0?"var "+Zn.join(",")+";":"",xi(Pa)])}})}function $a(){var Pa=Ya(),pn=Ya(),Zn=Pa.toString,da=pn.toString;function Ia(ga,Ti){pn(ga,Ti,"=",Pa.def(ga,Ti),";")}return h(function(){Pa.apply(Pa,pi(arguments))},{def:Pa.def,entry:Pa,exit:pn,save:Ia,set:function(ga,Ti,Qa){Ia(ga,Ti),Pa(ga,Ti,"=",Qa,";")},toString:function(){return Zn()+da()}})}function Wa(){var Pa=xi(arguments),pn=$a(),Zn=$a(),da=pn.toString,Ia=Zn.toString;return h(pn,{then:function(){return pn.apply(pn,pi(arguments)),this},else:function(){return Zn.apply(Zn,pi(arguments)),this},toString:function(){var ga=Ia();return ga&&(ga="else{"+ga+"}"),xi(["if(",Pa,"){",da(),"}",ga])}})}var oi=Ya(),Hi={};function Ci(Pa,pn){var Zn=[];function da(){var Ui="a"+Zn.length;return Zn.push(Ui),Ui}pn=pn||0;for(var Ia=0;Ia":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},xa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ba={cw:Lt,ccw:Rt};function Ha(St){return Array.isArray(St)||zr(St)||Xr(St)}function _a(St){return St.sort(function(Er,Dr){return Er===bc?-1:Dr===bc?1:Er=1,Bn>=2,Er)}else if(Dr===Bo){var Aa=St.data;return new gi(Aa.thisDep,Aa.contextDep,Aa.propDep,Er)}else{if(Dr===ro)return new gi(!1,!1,!1,Er);if(Dr===Ni){for(var En=!1,Sn=!1,Ya=!1,$a=0;$a=1&&(Sn=!0),oi>=2&&(Ya=!0)}else Wa.type===Bo&&(En=En||Wa.data.thisDep,Sn=Sn||Wa.data.contextDep,Ya=Ya||Wa.data.propDep)}return new gi(En,Sn,Ya,Er)}else return new gi(Dr===Vo,Dr===Io,Dr===zo,Er)}}var xo=new gi(!1,!1,!1,function(){});function Mo(St,Er,Dr,Bn,Aa,En,Sn,Ya,$a,Wa,oi,Hi,Ci,ai,Pa,pn){var Zn=Wa.Record,da={add:32774,subtract:32778,"reverse subtract":32779};Dr.ext_blend_minmax&&(da.min=jt,da.max=cr);var Ia=Dr.angle_instanced_arrays,ga=Dr.webgl_draw_buffers,Ti=Dr.oes_vertex_array_object,Qa={dirty:!0,profile:pn.profile},Ui={},ya=[],sa={},yi={};function Wn(lt){return lt.replace(".","_")}function ui(lt,gt,It){var ar=Wn(lt);ya.push(lt),Ui[ar]=Qa[ar]=!!It,sa[ar]=gt}function Xa(lt,gt,It){var ar=Wn(lt);ya.push(lt),Array.isArray(It)?(Qa[ar]=It.slice(),Ui[ar]=It.slice()):Qa[ar]=Ui[ar]=It,yi[ar]=gt}function qi(lt){return!!isNaN(lt)}ui(ns,an),ui(Os,Vr),Xa(yl,"blendColor",[0,0,0,0]),Xa(jl,"blendEquationSeparate",[wn,wn]),Xa(_l,"blendFuncSeparate",[nn,on,nn,on]),ui(Vl,zn,!0),Xa(Ks,"depthFunc",Rn),Xa(xu,"depthRange",[0,1]),Xa(yu,"depthMask",!0),Xa(Fl,Fl,[!0,!0,!0,!0]),ui(bo,Rr),Xa(ms,"cullFace",pt),Xa(Cl,Cl,Rt),Xa(cl,cl,1),ui(ic,oa),Xa(oc,"polygonOffset",[0,0]),ui(cc,Fa),ui(Sf,vi),Xa(sc,"sampleCoverage",[1,!1]),ui(sf,mn),Xa(wu,"stencilMask",-1),Xa(lf,"stencilFunc",[ur,0,-1]),Xa(qo,"stencilOpSeparate",[Ye,kr,kr,kr]),Xa(as,"stencilOpSeparate",[pt,kr,kr,kr]),ui(uf,Gn),Xa(Pc,"scissor",[0,0,St.drawingBufferWidth,St.drawingBufferHeight]),Xa(bc,bc,[0,0,St.drawingBufferWidth,St.drawingBufferHeight]);var Co={gl:St,context:Ci,strings:Er,next:Ui,current:Qa,draw:Hi,elements:En,buffer:Aa,shader:oi,attributes:Wa.state,vao:Wa,uniforms:$a,framebuffer:Ya,extensions:Dr,timer:ai,isBufferArgs:Ha},Li={primTypes:na,compareFuncs:ha,blendFuncs:Yn,blendEquations:da,stencilOps:xa,glTypes:Fn,orientationType:Ba};ga&&(Li.backBuffer=[pt],Li.drawBuffer=m(Bn.maxDrawbuffers,function(lt){return lt===0?[0]:m(lt,function(gt){return qa+gt})}));var Wi=0;function ii(){var lt=$i({cache:Pa}),gt=lt.link,It=lt.global;lt.id=Wi++,lt.batchId="0";var ar=gt(Co),Jt=lt.shared={props:"a0"};Object.keys(Co).forEach(function(rr){Jt[rr]=It.def(ar,".",rr)});var sr=lt.next={},pr=lt.current={};Object.keys(yi).forEach(function(rr){Array.isArray(Qa[rr])&&(sr[rr]=It.def(Jt.next,".",rr),pr[rr]=It.def(Jt.current,".",rr))});var fr=lt.constants={};Object.keys(Li).forEach(function(rr){fr[rr]=It.def(JSON.stringify(Li[rr]))}),lt.invoke=function(rr,er){switch(er.type){case eo:var $r=["this",Jt.context,Jt.props,lt.batchId];return rr.def(gt(er.data),".call(",$r.slice(0,Math.max(er.data.length+1,4)),")");case zo:return rr.def(Jt.props,er.data);case Io:return rr.def(Jt.context,er.data);case Vo:return rr.def("this",er.data);case Bo:return er.data.append(lt,rr),er.data.ref;case ro:return er.data.toString();case Ni:return er.data.map(function(sn){return lt.invoke(rr,sn)})}},lt.attribCache={};var Wt={};return lt.scopeAttrib=function(rr){var er=Er.id(rr);if(er in Wt)return Wt[er];var $r=Wa.scope[er];$r||($r=Wa.scope[er]=new Zn);var sn=Wt[er]=gt($r);return sn},lt}function Ao(lt){var gt=lt.static,It=lt.dynamic,ar;if(Je in gt){var Jt=!!gt[Je];ar=Vi(function(pr,fr){return Jt}),ar.enable=Jt}else if(Je in It){var sr=It[Je];ar=Zi(sr,function(pr,fr){return pr.invoke(fr,sr)})}return ar}function Uo(lt,gt){var It=lt.static,ar=lt.dynamic;if(I in It){var Jt=It[I];return Jt?(Jt=Ya.getFramebuffer(Jt),Vi(function(pr,fr){var Wt=pr.link(Jt),rr=pr.shared;fr.set(rr.framebuffer,".next",Wt);var er=rr.context;return fr.set(er,"."+hn,Wt+".width"),fr.set(er,"."+Cn,Wt+".height"),Wt})):Vi(function(pr,fr){var Wt=pr.shared;fr.set(Wt.framebuffer,".next","null");var rr=Wt.context;return fr.set(rr,"."+hn,rr+"."+Pt),fr.set(rr,"."+Cn,rr+"."+qt),"null"})}else if(I in ar){var sr=ar[I];return Zi(sr,function(pr,fr){var Wt=pr.invoke(fr,sr),rr=pr.shared,er=rr.framebuffer,$r=fr.def(er,".getFramebuffer(",Wt,")");fr.set(er,".next",$r);var sn=rr.context;return fr.set(sn,"."+hn,$r+"?"+$r+".width:"+sn+"."+Pt),fr.set(sn,"."+Cn,$r+"?"+$r+".height:"+sn+"."+qt),$r})}else return null}function Ko(lt,gt,It){var ar=lt.static,Jt=lt.dynamic;function sr(Wt){if(Wt in ar){var rr=ar[Wt],er=!0,$r=rr.x|0,sn=rr.y|0,xn,wa;return"width"in rr?xn=rr.width|0:er=!1,"height"in rr?wa=rr.height|0:er=!1,new gi(!er&>&>.thisDep,!er&>&>.contextDep,!er&>&>.propDep,function(Ta,Ea){var Ga=Ta.shared.context,Sa=xn;"width"in rr||(Sa=Ea.def(Ga,".",hn,"-",$r));var Za=wa;return"height"in rr||(Za=Ea.def(Ga,".",Cn,"-",sn)),[$r,sn,Sa,Za]})}else if(Wt in Jt){var la=Jt[Wt],aa=Zi(la,function(Ta,Ea){var Ga=Ta.invoke(Ea,la),Sa=Ta.shared.context,Za=Ea.def(Ga,".x|0"),ci=Ea.def(Ga,".y|0"),Ri=Ea.def('"width" in ',Ga,"?",Ga,".width|0:","(",Sa,".",hn,"-",Za,")"),Yi=Ea.def('"height" in ',Ga,"?",Ga,".height|0:","(",Sa,".",Cn,"-",ci,")");return[Za,ci,Ri,Yi]});return gt&&(aa.thisDep=aa.thisDep||gt.thisDep,aa.contextDep=aa.contextDep||gt.contextDep,aa.propDep=aa.propDep||gt.propDep),aa}else return gt?new gi(gt.thisDep,gt.contextDep,gt.propDep,function(Ta,Ea){var Ga=Ta.shared.context;return[0,0,Ea.def(Ga,".",hn),Ea.def(Ga,".",Cn)]}):null}var pr=sr(bc);if(pr){var fr=pr;pr=new gi(pr.thisDep,pr.contextDep,pr.propDep,function(Wt,rr){var er=fr.append(Wt,rr),$r=Wt.shared.context;return rr.set($r,"."+ot,er[2]),rr.set($r,"."+dt,er[3]),er})}return{viewport:pr,scissor_box:sr(Pc)}}function il(lt,gt){var It=lt.static,ar=typeof It[Ne]=="string"&&typeof It[ce]=="string";if(ar){if(Object.keys(gt.dynamic).length>0)return null;var Jt=gt.static,sr=Object.keys(Jt);if(sr.length>0&&typeof Jt[sr[0]]=="number"){for(var pr=[],fr=0;fr"+Za+"?"+er+".constant["+Za+"]:0;"}).join(""),"}}else{","if(",xn,"(",er,".buffer)){",Ta,"=",wa,".createStream(",Xt,",",er,".buffer);","}else{",Ta,"=",wa,".getBuffer(",er,".buffer);","}",Ea,'="type" in ',er,"?",sn.glTypes,"[",er,".type]:",Ta,".dtype;",la.normalized,"=!!",er,".normalized;");function Ga(Sa){rr(la[Sa],"=",er,".",Sa,"|0;")}return Ga("size"),Ga("offset"),Ga("stride"),Ga("divisor"),rr("}}"),rr.exit("if(",la.isStream,"){",wa,".destroyStream(",Ta,");","}"),la}Jt[sr]=Zi(pr,fr)}),Jt}function Uu(lt){var gt=lt.static,It=lt.dynamic,ar={};return Object.keys(gt).forEach(function(Jt){var sr=gt[Jt];ar[Jt]=Vi(function(pr,fr){return typeof sr=="number"||typeof sr=="boolean"?""+sr:pr.link(sr)})}),Object.keys(It).forEach(function(Jt){var sr=It[Jt];ar[Jt]=Zi(sr,function(pr,fr){return pr.invoke(fr,sr)})}),ar}function Xc(lt,gt,It,ar,Jt){lt.static,lt.dynamic;var sr=il(lt,gt),pr=Uo(lt),fr=Ko(lt,pr),Wt=_u(lt),rr=Xs(lt),er=Jo(lt,Jt,sr);function $r(Ta){var Ea=fr[Ta];Ea&&(rr[Ta]=Ea)}$r(bc),$r(Wn(Pc));var sn=Object.keys(rr).length>0,xn={framebuffer:pr,draw:Wt,shader:er,state:rr,dirty:sn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(xn.profile=Ao(lt),xn.uniforms=cu(It),xn.drawVAO=xn.scopeVAO=Wt.vao,!xn.drawVAO&&er.program&&!sr&&Dr.angle_instanced_arrays&&Wt.static.elements){var wa=!0,la=er.program.attributes.map(function(Ta){var Ea=gt.static[Ta];return wa=wa&&!!Ea,Ea});if(wa&&la.length>0){var aa=Wa.getVAO(Wa.createVAO({attributes:la,elements:Wt.static.elements}));xn.drawVAO=new gi(null,null,null,function(Ta,Ea){return Ta.link(aa)}),xn.useVAO=!0}}return sr?xn.useVAO=!0:xn.attributes=Pu(gt),xn.context=Uu(ar),xn}function Xl(lt,gt,It){var ar=lt.shared,Jt=ar.context,sr=lt.scope();Object.keys(It).forEach(function(pr){gt.save(Jt,"."+pr);var fr=It[pr],Wt=fr.append(lt,gt);Array.isArray(Wt)?sr(Jt,".",pr,"=[",Wt.join(),"];"):sr(Jt,".",pr,"=",Wt,";")}),gt(sr)}function au(lt,gt,It,ar){var Jt=lt.shared,sr=Jt.gl,pr=Jt.framebuffer,fr;ga&&(fr=gt.def(Jt.extensions,".webgl_draw_buffers"));var Wt=lt.constants,rr=Wt.drawBuffer,er=Wt.backBuffer,$r;It?$r=It.append(lt,gt):$r=gt.def(pr,".next"),ar||gt("if(",$r,"!==",pr,".cur){"),gt("if(",$r,"){",sr,".bindFramebuffer(",Nn,",",$r,".framebuffer);"),ga&>(fr,".drawBuffersWEBGL(",rr,"[",$r,".colorAttachments.length]);"),gt("}else{",sr,".bindFramebuffer(",Nn,",null);"),ga&>(fr,".drawBuffersWEBGL(",er,");"),gt("}",pr,".cur=",$r,";"),ar||gt("}")}function mo(lt,gt,It){var ar=lt.shared,Jt=ar.gl,sr=lt.current,pr=lt.next,fr=ar.current,Wt=ar.next,rr=lt.cond(fr,".dirty");ya.forEach(function(er){var $r=Wn(er);if(!($r in It.state)){var sn,xn;if($r in pr){sn=pr[$r],xn=sr[$r];var wa=m(Qa[$r].length,function(aa){return rr.def(sn,"[",aa,"]")});rr(lt.cond(wa.map(function(aa,Ta){return aa+"!=="+xn+"["+Ta+"]"}).join("||")).then(Jt,".",yi[$r],"(",wa,");",wa.map(function(aa,Ta){return xn+"["+Ta+"]="+aa}).join(";"),";"))}else{sn=rr.def(Wt,".",$r);var la=lt.cond(sn,"!==",fr,".",$r);rr(la),$r in sa?la(lt.cond(sn).then(Jt,".enable(",sa[$r],");").else(Jt,".disable(",sa[$r],");"),fr,".",$r,"=",sn,";"):la(Jt,".",yi[$r],"(",sn,");",fr,".",$r,"=",sn,";")}}}),Object.keys(It.state).length===0&&rr(fr,".dirty=false;"),gt(rr)}function ju(lt,gt,It,ar){var Jt=lt.shared,sr=lt.current,pr=Jt.current,fr=Jt.gl,Wt;_a(Object.keys(It)).forEach(function(rr){var er=It[rr];if(!(ar&&!ar(er))){var $r=er.append(lt,gt);if(sa[rr]){var sn=sa[rr];to(er)?(Wt=lt.link($r,{stable:!0}),gt(lt.cond(Wt).then(fr,".enable(",sn,");").else(fr,".disable(",sn,");")),gt(pr,".",rr,"=",Wt,";")):(gt(lt.cond($r).then(fr,".enable(",sn,");").else(fr,".disable(",sn,");")),gt(pr,".",rr,"=",$r,";"))}else if(Qn($r)){var xn=sr[rr];gt(fr,".",yi[rr],"(",$r,");",$r.map(function(wa,la){return xn+"["+la+"]="+wa}).join(";"),";")}else to(er)?(Wt=lt.link($r,{stable:!0}),gt(fr,".",yi[rr],"(",Wt,");",pr,".",rr,"=",Wt,";")):gt(fr,".",yi[rr],"(",$r,");",pr,".",rr,"=",$r,";")}})}function zs(lt,gt){Ia&&(lt.instancing=gt.def(lt.shared.extensions,".angle_instanced_arrays"))}function Ll(lt,gt,It,ar,Jt){var sr=lt.shared,pr=lt.stats,fr=sr.current,Wt=sr.timer,rr=It.profile;function er(){return typeof performance>"u"?"Date.now()":"performance.now()"}var $r,sn;function xn(Ga){$r=gt.def(),Ga($r,"=",er(),";"),typeof Jt=="string"?Ga(pr,".count+=",Jt,";"):Ga(pr,".count++;"),ai&&(ar?(sn=gt.def(),Ga(sn,"=",Wt,".getNumPendingQueries();")):Ga(Wt,".beginQuery(",pr,");"))}function wa(Ga){Ga(pr,".cpuTime+=",er(),"-",$r,";"),ai&&(ar?Ga(Wt,".pushScopeStats(",sn,",",Wt,".getNumPendingQueries(),",pr,");"):Ga(Wt,".endQuery();"))}function la(Ga){var Sa=gt.def(fr,".profile");gt(fr,".profile=",Ga,";"),gt.exit(fr,".profile=",Sa,";")}var aa;if(rr){if(to(rr)){rr.enable?(xn(gt),wa(gt.exit),la("true")):la("false");return}aa=rr.append(lt,gt),la(aa)}else aa=gt.def(fr,".profile");var Ta=lt.block();xn(Ta),gt("if(",aa,"){",Ta,"}");var Ea=lt.block();wa(Ea),gt.exit("if(",aa,"){",Ea,"}")}function Zu(lt,gt,It,ar,Jt){var sr=lt.shared;function pr(Wt){switch(Wt){case mi:case Wo:case Qs:return 2;case no:case $s:case uu:return 3;case To:case Ws:case Kl:return 4;default:return 1}}function fr(Wt,rr,er){var $r=sr.gl,sn=gt.def(Wt,".location"),xn=gt.def(sr.attributes,"[",sn,"]"),wa=er.state,la=er.buffer,aa=[er.x,er.y,er.z,er.w],Ta=["buffer","normalized","offset","stride"];function Ea(){gt("if(!",xn,".buffer){",$r,".enableVertexAttribArray(",sn,");}");var Sa=er.type,Za;if(er.size?Za=gt.def(er.size,"||",rr):Za=rr,gt("if(",xn,".type!==",Sa,"||",xn,".size!==",Za,"||",Ta.map(function(Ri){return xn+"."+Ri+"!=="+er[Ri]}).join("||"),"){",$r,".bindBuffer(",Xt,",",la,".buffer);",$r,".vertexAttribPointer(",[sn,Za,Sa,er.normalized,er.stride,er.offset],");",xn,".type=",Sa,";",xn,".size=",Za,";",Ta.map(function(Ri){return xn+"."+Ri+"="+er[Ri]+";"}).join(""),"}"),Ia){var ci=er.divisor;gt("if(",xn,".divisor!==",ci,"){",lt.instancing,".vertexAttribDivisorANGLE(",[sn,ci],");",xn,".divisor=",ci,";}")}}function Ga(){gt("if(",xn,".buffer){",$r,".disableVertexAttribArray(",sn,");",xn,".buffer=null;","}if(",ni.map(function(Sa,Za){return xn+"."+Sa+"!=="+aa[Za]}).join("||"),"){",$r,".vertexAttrib4f(",sn,",",aa,");",ni.map(function(Sa,Za){return xn+"."+Sa+"="+aa[Za]+";"}).join(""),"}")}wa===hi?Ea():wa===Ja?Ga():(gt("if(",wa,"===",hi,"){"),Ea(),gt("}else{"),Ga(),gt("}"))}ar.forEach(function(Wt){var rr=Wt.name,er=It.attributes[rr],$r;if(er){if(!Jt(er))return;$r=er.append(lt,gt)}else{if(!Jt(xo))return;var sn=lt.scopeAttrib(rr);$r={},Object.keys(new Zn).forEach(function(xn){$r[xn]=gt.def(sn,".",xn)})}fr(lt.link(Wt),pr(Wt.info.type),$r)})}function Ku(lt,gt,It,ar,Jt,sr){for(var pr=lt.shared,fr=pr.gl,Wt,rr=0;rr1){for(var ys=[],ds=[],fl=0;fl>1)",la],");")}function ci(){It(aa,".drawArraysInstancedANGLE(",[sn,xn,wa,la],");")}er&&er!=="null"?Ea?Za():(It("if(",er,"){"),Za(),It("}else{"),ci(),It("}")):ci()}function Sa(){function Za(){It(sr+".drawElements("+[sn,wa,Ta,xn+"<<(("+Ta+"-"+Ii+")>>1)"]+");")}function ci(){It(sr+".drawArrays("+[sn,xn,wa]+");")}er&&er!=="null"?Ea?Za():(It("if(",er,"){"),Za(),It("}else{"),ci(),It("}")):ci()}Ia&&(typeof la!="number"||la>=0)?typeof la=="string"?(It("if(",la,">0){"),Ga(),It("}else if(",la,"<0){"),Sa(),It("}")):Ga():Sa()}function hs(lt,gt,It,ar,Jt){var sr=ii(),pr=sr.proc("body",Jt);return Ia&&(sr.instancing=pr.def(sr.shared.extensions,".angle_instanced_arrays")),lt(sr,pr,It,ar),sr.compile().body}function gs(lt,gt,It,ar){zs(lt,gt),It.useVAO?It.drawVAO?gt(lt.shared.vao,".setVAO(",It.drawVAO.append(lt,gt),");"):gt(lt.shared.vao,".setVAO(",lt.shared.vao,".targetVAO);"):(gt(lt.shared.vao,".setVAO(null);"),Zu(lt,gt,It,ar.attributes,function(){return!0})),Ku(lt,gt,It,ar.uniforms,function(){return!0},!1),Eo(lt,gt,gt,It)}function De(lt,gt){var It=lt.proc("draw",1);zs(lt,It),Xl(lt,It,gt.context),au(lt,It,gt.framebuffer),mo(lt,It,gt),ju(lt,It,gt.state),Ll(lt,It,gt,!1,!0);var ar=gt.shader.progVar.append(lt,It);if(It(lt.shared.gl,".useProgram(",ar,".program);"),gt.shader.program)gs(lt,It,gt,gt.shader.program);else{It(lt.shared.vao,".setVAO(null);");var Jt=lt.global.def("{}"),sr=It.def(ar,".id"),pr=It.def(Jt,"[",sr,"]");It(lt.cond(pr).then(pr,".call(this,a0);").else(pr,"=",Jt,"[",sr,"]=",lt.link(function(fr){return hs(gs,lt,gt,fr,1)}),"(",ar,");",pr,".call(this,a0);"))}Object.keys(gt.state).length>0&&It(lt.shared.current,".dirty=true;"),lt.shared.vao&&It(lt.shared.vao,".setVAO(null);")}function G(lt,gt,It,ar){lt.batchId="a1",zs(lt,gt);function Jt(){return!0}Zu(lt,gt,It,ar.attributes,Jt),Ku(lt,gt,It,ar.uniforms,Jt,!1),Eo(lt,gt,gt,It)}function xe(lt,gt,It,ar){zs(lt,gt);var Jt=It.contextDep,sr=gt.def(),pr="a0",fr="a1",Wt=gt.def();lt.shared.props=Wt,lt.batchId=sr;var rr=lt.scope(),er=lt.scope();gt(rr.entry,"for(",sr,"=0;",sr,"<",fr,";++",sr,"){",Wt,"=",pr,"[",sr,"];",er,"}",rr.exit);function $r(Ta){return Ta.contextDep&&Jt||Ta.propDep}function sn(Ta){return!$r(Ta)}if(It.needsContext&&Xl(lt,er,It.context),It.needsFramebuffer&&au(lt,er,It.framebuffer),ju(lt,er,It.state,$r),It.profile&&$r(It.profile)&&Ll(lt,er,It,!1,!0),ar)It.useVAO?It.drawVAO?$r(It.drawVAO)?er(lt.shared.vao,".setVAO(",It.drawVAO.append(lt,er),");"):rr(lt.shared.vao,".setVAO(",It.drawVAO.append(lt,rr),");"):rr(lt.shared.vao,".setVAO(",lt.shared.vao,".targetVAO);"):(rr(lt.shared.vao,".setVAO(null);"),Zu(lt,rr,It,ar.attributes,sn),Zu(lt,er,It,ar.attributes,$r)),Ku(lt,rr,It,ar.uniforms,sn,!1),Ku(lt,er,It,ar.uniforms,$r,!0),Eo(lt,rr,er,It);else{var xn=lt.global.def("{}"),wa=It.shader.progVar.append(lt,er),la=er.def(wa,".id"),aa=er.def(xn,"[",la,"]");er(lt.shared.gl,".useProgram(",wa,".program);","if(!",aa,"){",aa,"=",xn,"[",la,"]=",lt.link(function(Ta){return hs(G,lt,It,Ta,2)}),"(",wa,");}",aa,".call(this,a0[",sr,"],",sr,");")}}function re(lt,gt){var It=lt.proc("batch",2);lt.batchId="0",zs(lt,It);var ar=!1,Jt=!0;Object.keys(gt.context).forEach(function(xn){ar=ar||gt.context[xn].propDep}),ar||(Xl(lt,It,gt.context),Jt=!1);var sr=gt.framebuffer,pr=!1;sr?(sr.propDep?ar=pr=!0:sr.contextDep&&ar&&(pr=!0),pr||au(lt,It,sr)):au(lt,It,null),gt.state.viewport&>.state.viewport.propDep&&(ar=!0);function fr(xn){return xn.contextDep&&ar||xn.propDep}mo(lt,It,gt),ju(lt,It,gt.state,function(xn){return!fr(xn)}),(!gt.profile||!fr(gt.profile))&&Ll(lt,It,gt,!1,"a1"),gt.contextDep=ar,gt.needsContext=Jt,gt.needsFramebuffer=pr;var Wt=gt.shader.progVar;if(Wt.contextDep&&ar||Wt.propDep)xe(lt,It,gt,null);else{var rr=Wt.append(lt,It);if(It(lt.shared.gl,".useProgram(",rr,".program);"),gt.shader.program)xe(lt,It,gt,gt.shader.program);else{It(lt.shared.vao,".setVAO(null);");var er=lt.global.def("{}"),$r=It.def(rr,".id"),sn=It.def(er,"[",$r,"]");It(lt.cond(sn).then(sn,".call(this,a0,a1);").else(sn,"=",er,"[",$r,"]=",lt.link(function(xn){return hs(xe,lt,gt,xn,2)}),"(",rr,");",sn,".call(this,a0,a1);"))}}Object.keys(gt.state).length>0&&It(lt.shared.current,".dirty=true;"),lt.shared.vao&&It(lt.shared.vao,".setVAO(null);")}function Le(lt,gt){var It=lt.proc("scope",3);lt.batchId="a2";var ar=lt.shared,Jt=ar.current;if(Xl(lt,It,gt.context),gt.framebuffer&>.framebuffer.append(lt,It),_a(Object.keys(gt.state)).forEach(function(fr){var Wt=gt.state[fr],rr=Wt.append(lt,It);Qn(rr)?rr.forEach(function(er,$r){qi(er)?It.set(lt.next[fr],"["+$r+"]",er):It.set(lt.next[fr],"["+$r+"]",lt.link(er,{stable:!0}))}):to(Wt)?It.set(ar.next,"."+fr,lt.link(rr,{stable:!0})):It.set(ar.next,"."+fr,rr)}),Ll(lt,It,gt,!0,!0),[je,Ft,kt,tr,Ze].forEach(function(fr){var Wt=gt.draw[fr];if(Wt){var rr=Wt.append(lt,It);qi(rr)?It.set(ar.draw,"."+fr,rr):It.set(ar.draw,"."+fr,lt.link(rr),{stable:!0})}}),Object.keys(gt.uniforms).forEach(function(fr){var Wt=gt.uniforms[fr].append(lt,It);Array.isArray(Wt)&&(Wt="["+Wt.map(function(rr){return qi(rr)?rr:lt.link(rr,{stable:!0})})+"]"),It.set(ar.uniforms,"["+lt.link(Er.id(fr),{stable:!0})+"]",Wt)}),Object.keys(gt.attributes).forEach(function(fr){var Wt=gt.attributes[fr].append(lt,It),rr=lt.scopeAttrib(fr);Object.keys(new Zn).forEach(function(er){It.set(rr,"."+er,Wt[er])})}),gt.scopeVAO){var sr=gt.scopeVAO.append(lt,It);qi(sr)?It.set(ar.vao,".targetVAO",sr):It.set(ar.vao,".targetVAO",lt.link(sr,{stable:!0}))}function pr(fr){var Wt=gt.shader[fr];if(Wt){var rr=Wt.append(lt,It);qi(rr)?It.set(ar.shader,"."+fr,rr):It.set(ar.shader,"."+fr,lt.link(rr,{stable:!0}))}}pr(ce),pr(Ne),Object.keys(gt.state).length>0&&(It(Jt,".dirty=true;"),It.exit(Jt,".dirty=true;")),It("a1(",lt.shared.context,",a0,",lt.batchId,");")}function et(lt){if(!(typeof lt!="object"||Qn(lt))){for(var gt=Object.keys(lt),It=0;It=0;--Eo){var hs=qi[Eo];hs&&hs(ai,null,0)}Dr.flush(),Wa&&Wa.update()}function Uo(){!ii&&qi.length>0&&(ii=c.next(Ao))}function Ko(){ii&&(c.cancel(Ao),ii=null)}function il(Eo){Eo.preventDefault(),Ko(),Co.forEach(function(hs){hs()})}function Jo(Eo){Dr.getError(),Aa.restore(),Qa.restore(),da.restore(),Ui.restore(),ya.restore(),sa.restore(),ga.restore(),Wa&&Wa.restore(),yi.procs.refresh(),Uo(),Li.forEach(function(hs){hs()})}Xa&&(Xa.addEventListener(ql,il,!1),Xa.addEventListener(Pl,Jo,!1));function _u(){qi.length=0,Ko(),Xa&&(Xa.removeEventListener(ql,il),Xa.removeEventListener(Pl,Jo)),Qa.clear(),sa.clear(),ya.clear(),ga.clear(),Ui.clear(),Ia.clear(),da.clear(),Wa&&Wa.clear(),Wi.forEach(function(Eo){Eo()})}function Xs(Eo){function hs(Jt){var sr=h({},Jt);delete sr.uniforms,delete sr.attributes,delete sr.context,delete sr.vao,"stencil"in sr&&sr.stencil.op&&(sr.stencil.opBack=sr.stencil.opFront=sr.stencil.op,delete sr.stencil.op);function pr(fr){if(fr in sr){var Wt=sr[fr];delete sr[fr],Object.keys(Wt).forEach(function(rr){sr[fr+"."+rr]=Wt[rr]})}}return pr("blend"),pr("depth"),pr("cull"),pr("stencil"),pr("polygonOffset"),pr("scissor"),pr("sample"),"vao"in Jt&&(sr.vao=Jt.vao),sr}function gs(Jt,sr){var pr={},fr={};return Object.keys(Jt).forEach(function(Wt){var rr=Jt[Wt];if(f.isDynamic(rr)){fr[Wt]=f.unbox(rr,Wt);return}else if(sr&&Array.isArray(rr)){for(var er=0;er0)return At.call(this,It(Jt|0),Jt|0)}else if(Array.isArray(Jt)){if(Jt.length)return At.call(this,Jt,Jt.length)}else return xt.call(this,Jt)}return h(ar,{stats:Le,destroy:function(){et.destroy()}})}var cu=sa.setFBO=Xs({framebuffer:f.define.call(null,fc,"framebuffer")});function Pu(Eo,hs){var gs=0;yi.procs.poll();var De=hs.color;De&&(Dr.clearColor(+De[0]||0,+De[1]||0,+De[2]||0,+De[3]||0),gs|=Yl),"depth"in hs&&(Dr.clearDepth(+hs.depth),gs|=ho),"stencil"in hs&&(Dr.clearStencil(hs.stencil|0),gs|=ks),Dr.clear(gs)}function Uu(Eo){if("framebuffer"in Eo)if(Eo.framebuffer&&Eo.framebuffer_reglType==="framebufferCube")for(var hs=0;hs<6;++hs)cu(h({framebuffer:Eo.framebuffer.faces[hs]},Eo),Pu);else cu(Eo,Pu);else Pu(null,Eo)}function Xc(Eo){qi.push(Eo);function hs(){var gs=Lc(qi,Eo);function De(){var G=Lc(qi,De);qi[G]=qi[qi.length-1],qi.length-=1,qi.length<=0&&Ko()}qi[gs]=De}return Uo(),{cancel:hs}}function Xl(){var Eo=ui.viewport,hs=ui.scissor_box;Eo[0]=Eo[1]=hs[0]=hs[1]=0,ai.viewportWidth=ai.framebufferWidth=ai.drawingBufferWidth=Eo[2]=hs[2]=Dr.drawingBufferWidth,ai.viewportHeight=ai.framebufferHeight=ai.drawingBufferHeight=Eo[3]=hs[3]=Dr.drawingBufferHeight}function au(){ai.tick+=1,ai.time=ju(),Xl(),yi.procs.poll()}function mo(){Ui.refresh(),Xl(),yi.procs.refresh(),Wa&&Wa.update()}function ju(){return(v()-oi)/1e3}mo();function zs(Eo,hs){var gs;switch(Eo){case"frame":return Xc(hs);case"lost":gs=Co;break;case"restore":gs=Li;break;case"destroy":gs=Wi;break}return gs.push(hs),{cancel:function(){for(var De=0;De=0},read:Wn,destroy:_u,_gl:Dr,_refresh:mo,poll:function(){au(),Wa&&Wa.update()},now:ju,stats:Sn,getCachedCode:Ll,preloadCachedCode:Zu});return Er.onDone(null,Ku),Ku}return Tu})}}),iI=_e({"node_modules/gl-util/context.js"(ee,X){var h=fv();X.exports=function(o){if(o?typeof o=="string"&&(o={container:o}):o={},S(o)?o={container:o}:k(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),x(o))}else if(!o.canvas)if(typeof document<"u")o.container=document.body||document.documentElement,o.canvas=t(),o.container.appendChild(o.canvas),x(o);else throw Error("Not DOM environment. Use headless-gl.");return o.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(i){try{o.gl=o.canvas.getContext(i,o.attrs)}catch{}return o.gl}),o.gl};function x(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var o=r.container.getBoundingClientRect();r.canvas.width=r.width||o.right-o.left,r.canvas.height=r.height||o.bottom-o.top}}function S(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function k(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}}}),oI=_e({"node_modules/font-atlas/index.js"(ee,X){var h=yA(),x=[32,126];X.exports=S;function S(k){k=k||{};var e=k.shape?k.shape:k.canvas?[k.canvas.width,k.canvas.height]:[512,512],t=k.canvas||document.createElement("canvas"),r=k.font,o=typeof k.step=="number"?[k.step,k.step]:k.step||[32,32],n=k.chars||x;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,v=o[1]/2,a=0;ae[0]-o[0]/2&&(c=o[0]/2,v+=o[1]);return t}}}),_A=_e({"node_modules/bit-twiddle/twiddle.js"(ee){"use restrict";var X=32;ee.INT_BITS=X,ee.INT_MAX=2147483647,ee.INT_MIN=-1<0)-(S<0)},ee.abs=function(S){var k=S>>X-1;return(S^k)-k},ee.min=function(S,k){return k^(S^k)&-(S65535)<<4,S>>>=k,e=(S>255)<<3,S>>>=e,k|=e,e=(S>15)<<2,S>>>=e,k|=e,e=(S>3)<<1,S>>>=e,k|=e,k|S>>1},ee.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},ee.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 k=32;return S&=-S,S&&k--,S&65535&&(k-=16),S&16711935&&(k-=8),S&252645135&&(k-=4),S&858993459&&(k-=2),S&1431655765&&(k-=1),k}ee.countTrailingZeros=h,ee.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},ee.prevPow2=function(S){return S|=S>>>1,S|=S>>>2,S|=S>>>4,S|=S>>>8,S|=S>>>16,S-(S>>>1)},ee.parity=function(S){return S^=S>>>16,S^=S>>>8,S^=S>>>4,S&=15,27030>>>S&1};var x=new Array(256);(function(S){for(var k=0;k<256;++k){var e=k,t=k,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=e&1,--r;S[k]=t<>>8&255]<<16|x[S>>>16&255]<<8|x[S>>>24&255]},ee.interleave2=function(S,k){return S&=65535,S=(S|S<<8)&16711935,S=(S|S<<4)&252645135,S=(S|S<<2)&858993459,S=(S|S<<1)&1431655765,k&=65535,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,S|k<<1},ee.deinterleave2=function(S,k){return S=S>>>k&1431655765,S=(S|S>>>1)&858993459,S=(S|S>>>2)&252645135,S=(S|S>>>4)&16711935,S=(S|S>>>16)&65535,S<<16>>16},ee.interleave3=function(S,k,e){return S&=1023,S=(S|S<<16)&4278190335,S=(S|S<<8)&251719695,S=(S|S<<4)&3272356035,S=(S|S<<2)&1227133513,k&=1023,k=(k|k<<16)&4278190335,k=(k|k<<8)&251719695,k=(k|k<<4)&3272356035,k=(k|k<<2)&1227133513,S|=k<<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},ee.deinterleave3=function(S,k){return S=S>>>k&1227133513,S=(S|S>>>2)&3272356035,S=(S|S>>>4)&251719695,S=(S|S>>>8)&4278190335,S=(S|S>>>16)&1023,S<<22>>22},ee.nextCombination=function(S){var k=S|S-1;return k+1|(~k&-~k)-1>>>h(S)+1}}}),sI=_e({"node_modules/dup/dup.js"(ee,X){function h(k,e,t){var r=k[t]|0;if(r<=0)return[];var o=new Array(r),n;if(t===k.length-1)for(n=0;n"u"&&(e=0),typeof k){case"number":if(k>0)return x(k|0,e);break;case"object":if(typeof k.length=="number")return h(k,e,0);break}return[]}X.exports=S}}),lI=_e({"node_modules/typedarray-pool/pool.js"(ee){var X=_A(),h=sI(),x=cm().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",k=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;ee.free=function(u){if(x.isBuffer(u))o[X.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var d=u.length||u.byteLength,y=X.log2(d)|0;r[y].push(u)}};function n(m){if(m){var u=m.length||m.byteLength,d=X.log2(u);r[d].push(m)}}function i(m){n(m.buffer)}ee.freeUint8=ee.freeUint16=ee.freeUint32=ee.freeBigUint64=ee.freeInt8=ee.freeInt16=ee.freeInt32=ee.freeBigInt64=ee.freeFloat32=ee.freeFloat=ee.freeFloat64=ee.freeDouble=ee.freeUint8Clamped=ee.freeDataView=i,ee.freeArrayBuffer=n,ee.freeBuffer=function(u){o[X.log2(u.length)].push(u)},ee.malloc=function(u,d){if(d===void 0||d==="arraybuffer")return a(u);switch(d){case"uint8":return s(u);case"uint16":return f(u);case"uint32":return c(u);case"int8":return v(u);case"int16":return p(u);case"int32":return T(u);case"float":case"float32":return l(u);case"double":case"float64":return g(u);case"uint8_clamped":return b(u);case"bigint64":return E(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=X.nextPow2(u),d=X.log2(u),y=r[d];return y.length>0?y.pop():new ArrayBuffer(u)}ee.mallocArrayBuffer=a;function s(m){return new Uint8Array(a(m),0,m)}ee.mallocUint8=s;function f(m){return new Uint16Array(a(2*m),0,m)}ee.mallocUint16=f;function c(m){return new Uint32Array(a(4*m),0,m)}ee.mallocUint32=c;function v(m){return new Int8Array(a(m),0,m)}ee.mallocInt8=v;function p(m){return new Int16Array(a(2*m),0,m)}ee.mallocInt16=p;function T(m){return new Int32Array(a(4*m),0,m)}ee.mallocInt32=T;function l(m){return new Float32Array(a(4*m),0,m)}ee.mallocFloat32=ee.mallocFloat=l;function g(m){return new Float64Array(a(8*m),0,m)}ee.mallocFloat64=ee.mallocDouble=g;function b(m){return S?new Uint8ClampedArray(a(m),0,m):s(m)}ee.mallocUint8Clamped=b;function A(m){return k?new BigUint64Array(a(8*m),0,m):null}ee.mallocBigUint64=A;function E(m){return e?new BigInt64Array(a(8*m),0,m):null}ee.mallocBigInt64=E;function _(m){return new DataView(a(m),0,m)}ee.mallocDataView=_;function w(m){m=X.nextPow2(m);var u=X.log2(m),d=o[u];return d.length>0?d.pop():new x(m)}ee.mallocBuffer=w,ee.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=_e({"node_modules/is-plain-obj/index.js"(ee,X){var h=Object.prototype.toString;X.exports=function(x){var S;return h.call(x)==="[object Object]"&&(S=Object.getPrototypeOf(x),S===null||S===Object.getPrototypeOf({}))}}}),bA=_e({"node_modules/parse-unit/index.js"(ee,X){X.exports=function(x,S){S||(S=[0,""]),x=String(x);var k=parseFloat(x,10);return S[0]=k,S[1]=x.match(/[\d.\-\+]*\s*(.*)/)[1]||"",S}}}),cI=_e({"node_modules/to-px/topx.js"(ee,X){var h=bA();X.exports=e;var x=96;function S(t,r){var o=h(getComputedStyle(t).getPropertyValue(r));return o[0]*e(o[1],t)}function k(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 k(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 x;case"cm":return x/2.54;case"mm":return x/25.4;case"pt":return x/72;case"pc":return x/6}return 1}}}),fI=_e({"node_modules/detect-kerning/index.js"(ee,X){X.exports=k;var h=k.canvas=document.createElement("canvas"),x=h.getContext("2d"),S=e([32,126]);k.createPairs=e,k.ascii=S;function k(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),x.font=i+"px "+t;for(var s=0;si*a){var p=(v-c)/i;o[f]=p*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)}}}),dI=_e({"node_modules/gl-text/dist.js"(ee,X){var h=nI(),x=fv(),S=aI(),k=iI(),e=cA(),t=L0(),r=oI(),o=lI(),n=Fg(),i=uI(),a=bA(),s=cI(),f=fI(),c=Dh(),v=hI(),p=Sm(),T=_A(),l=T.nextPow2,g=new e,b=!1;document.body&&(A=document.body.appendChild(document.createElement("div")),A.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(A).fontStretch&&(b=!0),document.body.removeChild(A));var A,E=function(m){_(m)?(m={regl:m},this.gl=m.regl._gl):this.gl=k(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:{})};E.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,R){return[R.atlas.width,R.atlas.height]},atlasDim:function(y,R){return[R.atlas.cols,R.atlas.rows]},atlas:function(y,R){return R.atlas.texture},charStep:function(y,R){return R.atlas.step},em:function(y,R){return R.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; }`}),d={};return{regl:m,draw:u,atlas:d}},E.prototype.update=function(m){var u=this;if(typeof m=="string")m={text:m};else if(!m)return;m=x(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(Ae){return parseFloat(Ae)}):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=p(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=E.baseFontSize+"px sans-serif");var d=!1,y=!1;if(m.font&&(Array.isArray(m.font)?m.font:[m.font]).forEach(function(Ae,Ke){if(typeof Ae=="string")try{Ae=h.parse(Ae)}catch{Ae=h.parse(E.baseFontSize+"px "+Ae)}else{var _t=Ae.style,wt=Ae.weight,vt=Ae.stretch,$t=Ae.variant;Ae=h.parse(h.stringify(Ae)),_t&&(Ae.style=_t),wt&&(Ae.weight=wt),vt&&(Ae.stretch=vt),$t&&(Ae.variant=$t)}var Yt=h.stringify({size:E.baseFontSize,family:Ae.family,stretch:b?Ae.stretch:void 0,variant:Ae.variant,weight:Ae.weight,style:Ae.style}),lr=a(Ae.size),dr=Math.round(lr[0]*s(lr[1]));if(dr!==u.fontSize[Ke]&&(y=!0,u.fontSize[Ke]=dr),(!u.font[Ke]||Yt!=u.font[Ke].baseString)&&(d=!0,u.font[Ke]=E.fonts[Yt],!u.font[Ke])){var Nr=Ae.family.join(", "),Fr=[Ae.style];Ae.style!=Ae.variant&&Fr.push(Ae.variant),Ae.variant!=Ae.weight&&Fr.push(Ae.weight),b&&Ae.weight!=Ae.stretch&&Fr.push(Ae.stretch),u.font[Ke]={baseString:Yt,family:Nr,weight:Ae.weight,stretch:Ae.stretch,style:Ae.style,variant:Ae.variant,width:{},kerning:{},metrics:v(Nr,{origin:"top",fontSize:E.baseFontSize,fontStyle:Fr.join(" ")})},E.fonts[Yt]=u.font[Ke]}}),(d||y)&&this.font.forEach(function(Ae,Ke){var _t=h.stringify({size:u.fontSize[Ke],family:Ae.family,stretch:b?Ae.stretch:void 0,variant:Ae.variant,weight:Ae.weight,style:Ae.style});if(u.fontAtlas[Ke]=u.shader.atlas[_t],!u.fontAtlas[Ke]){var wt=Ae.metrics;u.shader.atlas[_t]=u.fontAtlas[Ke]={fontString:_t,step:Math.ceil(u.fontSize[Ke]*wt.bottom*.5)*2,em:u.fontSize[Ke],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 R=Array(m.position.length*.5),L=0;L2){for(var U=!m.position[0].length,B=o.mallocFloat(this.count*2),D=0,j=0;D1?u.align[Ke]:u.align[0]:u.align;if(typeof _t=="number")return _t;switch(_t){case"right":case"end":return-Ae;case"center":case"centre":case"middle":return-Ae*.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(Ae,Ke){var _t=(u.font[Ke]||u.font[0]).metrics,wt=0;return wt+=_t.bottom*.5,typeof Ae=="number"?wt+=Ae-_t.baseline:wt+=-_t[Ae],wt*=-1,wt})),m.color!=null)if(m.color||(m.color="transparent"),typeof m.color=="string"||!isNaN(m.color))this.color=t(m.color,"uint8");else{var Xe;if(typeof m.color[0]=="number"&&m.color.length>this.counts.length){var We=m.color.length;Xe=o.mallocUint8(We);for(var it=(m.color.subarray||m.color.slice).bind(m.color),yt=0;yt4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(ht){var qe=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(qe);for(var ze=0;ze1?this.counts[ze]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[ze]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(ze*4,ze*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[ze]:this.opacity,baseline:this.baselineOffset[ze]!=null?this.baselineOffset[ze]:this.baselineOffset[0],align:this.align?this.alignOffset[ze]!=null?this.alignOffset[ze]:this.alignOffset[0]:0,atlas:this.fontAtlas[ze]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(ze*2,ze*2+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]}},E.prototype.destroy=function(){},E.prototype.kerning=!0,E.prototype.position={constant:new Float32Array(2)},E.prototype.translate=null,E.prototype.scale=null,E.prototype.font=null,E.prototype.text="",E.prototype.positionOffset=[0,0],E.prototype.opacity=1,E.prototype.color=new Uint8Array([0,0,0,255]),E.prototype.alignOffset=[0,0],E.maxAtlasSize=1024,E.atlasCanvas=document.createElement("canvas"),E.atlasContext=E.atlasCanvas.getContext("2d",{alpha:!1}),E.baseFontSize=64,E.fonts={};function _(w){return typeof w=="function"&&w._gl&&w.prop&&w.texture&&w.buffer}X.exports=E}}),pI=_e({"node_modules/@plotly/regl/dist/regl.unchecked.js"(ee,X){(function(h,x){typeof ee=="object"&&typeof X<"u"?X.exports=x():h.createREGL=x()})(ee,function(){var h=function(St,Er){for(var Dr=Object.keys(Er),Bn=0;Bn1&&Er===Dr&&(Er==='"'||Er==="'"))return['"'+r(St.substr(1,St.length-2))+'"'];var Bn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(St);if(Bn)return o(St.substr(0,Bn.index)).concat(o(Bn[1])).concat(o(St.substr(Bn.index+Bn[0].length)));var Aa=St.split(".");if(Aa.length===1)return['"'+r(St)+'"'];for(var En=[],Sn=0;Sn"u"?1:window.devicePixelRatio,oi=!1,Hi={},Ci=function(pn){},ai=function(){};if(typeof Er=="string"?Dr=document.querySelector(Er):typeof Er=="object"&&(g(Er)?Dr=Er:b(Er)?(En=Er,Aa=En.canvas):("gl"in Er?En=Er.gl:"canvas"in Er?Aa=E(Er.canvas):"container"in Er&&(Bn=E(Er.container)),"attributes"in Er&&(Sn=Er.attributes),"extensions"in Er&&(Ya=A(Er.extensions)),"optionalExtensions"in Er&&($a=A(Er.optionalExtensions)),"onDone"in Er&&(Ci=Er.onDone),"profile"in Er&&(oi=!!Er.profile),"pixelRatio"in Er&&(Wa=+Er.pixelRatio),"cachedCode"in Er&&(Hi=Er.cachedCode))),Dr&&(Dr.nodeName.toLowerCase()==="canvas"?Aa=Dr:Bn=Dr),!En){if(!Aa){var Pa=T(Bn||document.body,Ci,Wa);if(!Pa)return null;Aa=Pa.canvas,ai=Pa.onDestroy}Sn.premultipliedAlpha===void 0&&(Sn.premultipliedAlpha=!0),En=l(Aa,Sn)}return En?{gl:En,canvas:Aa,container:Bn,extensions:Ya,optionalExtensions:$a,pixelRatio:Wa,profile:oi,cachedCode:Hi,onDone:Ci,onDestroy:ai}:(ai(),Ci("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(St,Er){var Dr={};function Bn(Sn){var Ya=Sn.toLowerCase(),$a;try{$a=Dr[Ya]=St.getExtension(Ya)}catch{}return!!$a}for(var Aa=0;Aa65535)<<4,St>>>=Er,Dr=(St>255)<<3,St>>>=Dr,Er|=Dr,Dr=(St>15)<<2,St>>>=Dr,Er|=Dr,Dr=(St>3)<<1,St>>>=Dr,Er|=Dr,Er|St>>1}function D(){var St=m(8,function(){return[]});function Er(En){var Sn=U(En),Ya=St[B(Sn)>>2];return Ya.length>0?Ya.pop():new ArrayBuffer(Sn)}function Dr(En){St[B(En.byteLength)>>2].push(En)}function Bn(En,Sn){var Ya=null;switch(En){case u:Ya=new Int8Array(Er(Sn),0,Sn);break;case d:Ya=new Uint8Array(Er(Sn),0,Sn);break;case y:Ya=new Int16Array(Er(2*Sn),0,Sn);break;case R:Ya=new Uint16Array(Er(2*Sn),0,Sn);break;case L:Ya=new Int32Array(Er(4*Sn),0,Sn);break;case z:Ya=new Uint32Array(Er(4*Sn),0,Sn);break;case N:Ya=new Float32Array(Er(4*Sn),0,Sn);break;default:return null}return Ya.length!==Sn?Ya.subarray(0,Sn):Ya}function Aa(En){Dr(En.buffer)}return{alloc:Er,free:Dr,allocType:Bn,freeType:Aa}}var j=D();j.zero=D();var q=3408,J=3410,oe=3411,ye=3412,pe=3413,ge=3414,W=3415,ae=33901,se=33902,Q=3379,me=3386,ie=34921,Y=36347,le=36348,ue=35661,Te=35660,Fe=34930,Ve=36349,Xe=34076,We=34024,it=7936,yt=7937,bt=7938,mt=35724,ht=34047,qe=36063,ze=34852,Ae=3553,Ke=34067,_t=34069,wt=33984,vt=6408,$t=5126,Yt=5121,lr=36160,dr=36053,Nr=36064,Fr=16384,ln=function(St,Er){var Dr=1;Er.ext_texture_filter_anisotropic&&(Dr=St.getParameter(ht));var Bn=1,Aa=1;Er.webgl_draw_buffers&&(Bn=St.getParameter(ze),Aa=St.getParameter(qe));var En=!!Er.oes_texture_float;if(En){var Sn=St.createTexture();St.bindTexture(Ae,Sn),St.texImage2D(Ae,0,vt,1,1,0,vt,$t,null);var Ya=St.createFramebuffer();if(St.bindFramebuffer(lr,Ya),St.framebufferTexture2D(lr,Nr,Ae,Sn,0),St.bindTexture(Ae,null),St.checkFramebufferStatus(lr)!==dr)En=!1;else{St.viewport(0,0,1,1),St.clearColor(1,0,0,1),St.clear(Fr);var $a=j.allocType($t,4);St.readPixels(0,0,1,1,vt,$t,$a),St.getError()?En=!1:(St.deleteFramebuffer(Ya),St.deleteTexture(Sn),En=$a[0]===1),j.freeType($a)}}var Wa=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),oi=!0;if(!Wa){var Hi=St.createTexture(),Ci=j.allocType(Yt,36);St.activeTexture(wt),St.bindTexture(Ke,Hi),St.texImage2D(_t,0,vt,3,3,0,vt,Yt,Ci),j.freeType(Ci),St.bindTexture(Ke,null),St.deleteTexture(Hi),oi=!St.getError()}return{colorBits:[St.getParameter(J),St.getParameter(oe),St.getParameter(ye),St.getParameter(pe)],depthBits:St.getParameter(ge),stencilBits:St.getParameter(W),subpixelBits:St.getParameter(q),extensions:Object.keys(Er).filter(function(ai){return!!Er[ai]}),maxAnisotropic:Dr,maxDrawbuffers:Bn,maxColorAttachments:Aa,pointSizeDims:St.getParameter(ae),lineWidthDims:St.getParameter(se),maxViewportDims:St.getParameter(me),maxCombinedTextureUnits:St.getParameter(ue),maxCubeMapSize:St.getParameter(Xe),maxRenderbufferSize:St.getParameter(We),maxTextureUnits:St.getParameter(Fe),maxTextureSize:St.getParameter(Q),maxAttributes:St.getParameter(ie),maxVertexUniforms:St.getParameter(Y),maxVertexTextureUnits:St.getParameter(Te),maxVaryingVectors:St.getParameter(le),maxFragmentUniforms:St.getParameter(Ve),glsl:St.getParameter(mt),renderer:St.getParameter(yt),vendor:St.getParameter(it),version:St.getParameter(bt),readFloat:En,npotTextureCube:oi}},zr=function(St){return St instanceof Uint8Array||St instanceof Uint16Array||St instanceof Uint32Array||St instanceof Int8Array||St instanceof Int16Array||St instanceof Int32Array||St instanceof Float32Array||St instanceof Float64Array||St instanceof Uint8ClampedArray};function Xr(St){return!!St&&typeof St=="object"&&Array.isArray(St.shape)&&Array.isArray(St.stride)&&typeof St.offset=="number"&&St.shape.length===St.stride.length&&(Array.isArray(St.data)||zr(St.data))}var Ot=function(St){return Object.keys(St).map(function(Er){return St[Er]})},Qe={shape:at,flatten:Be};function ct(St,Er,Dr){for(var Bn=0;Bn0){var Ui;if(Array.isArray(Zn[0])){Qa=Jn(Zn);for(var ya=1,sa=1;sa0){if(typeof ya[0]=="number"){var ui=j.allocType(ga.dtype,ya.length);rn(ui,ya),Qa(ui,yi),j.freeType(ui)}else if(Array.isArray(ya[0])||zr(ya[0])){Wn=Jn(ya);var Xa=ma(ya,Wn,ga.dtype);Qa(Xa,yi),j.freeType(Xa)}}}else if(Xr(ya)){Wn=ya.shape;var qi=ya.stride,Co=0,Li=0,Wi=0,ii=0;Wn.length===1?(Co=Wn[0],Li=1,Wi=qi[0],ii=0):Wn.length===2&&(Co=Wn[0],Li=Wn[1],Wi=qi[0],ii=qi[1]);var Ao=Array.isArray(ya.data)?ga.dtype:_r(ya.data),Uo=j.allocType(Ao,Co*Li);gn(Uo,ya.data,Co,Li,Wi,ii,ya.offset),Qa(Uo,yi),j.freeType(Uo)}return Ti}return da||Ti(pn),Ti._reglType="buffer",Ti._buffer=ga,Ti.subdata=Ui,Dr.profile&&(Ti.stats=ga.stats),Ti.destroy=function(){Ci(ga)},Ti}function Pa(){Ot(En).forEach(function(pn){pn.buffer=St.createBuffer(),St.bindBuffer(pn.type,pn.buffer),St.bufferData(pn.type,pn.persistentData||pn.byteLength,pn.usage)})}return Dr.profile&&(Er.getTotalBufferSize=function(){var pn=0;return Object.keys(En).forEach(function(Zn){pn+=En[Zn].stats.size}),pn}),{create:ai,createStream:$a,destroyStream:Wa,clear:function(){Ot(En).forEach(Ci),Ya.forEach(Ci)},getBuffer:function(pn){return pn&&pn._buffer instanceof Sn?pn._buffer:null},restore:Pa,_initBuffer:Hi}}var In=0,fa=0,Ca=1,Ma=1,Da=4,Va=4,na={points:In,point:fa,lines:Ca,line:Ma,triangles:Da,triangle:Va,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Mi=0,Oi=1,Vt=4,Ct=5120,Br=5121,Kr=5122,Qr=5123,Gr=5124,Jr=5125,yn=34963,cn=35040,Dt=35044;function yr(St,Er,Dr,Bn){var Aa={},En=0,Sn={uint8:Br,uint16:Qr};Er.oes_element_index_uint&&(Sn.uint32=Jr);function Ya(Pa){this.id=En++,Aa[this.id]=this,this.buffer=Pa,this.primType=Vt,this.vertCount=0,this.type=0}Ya.prototype.bind=function(){this.buffer.bind()};var $a=[];function Wa(Pa){var pn=$a.pop();return pn||(pn=new Ya(Dr.create(null,yn,!0,!1)._buffer)),Hi(pn,Pa,cn,-1,-1,0,0),pn}function oi(Pa){$a.push(Pa)}function Hi(Pa,pn,Zn,da,Ia,ga,Ti){Pa.buffer.bind();var Qa;if(pn){var Ui=Ti;!Ti&&(!zr(pn)||Xr(pn)&&!zr(pn.data))&&(Ui=Er.oes_element_index_uint?Jr:Qr),Dr._initBuffer(Pa.buffer,pn,Zn,Ui,3)}else St.bufferData(yn,ga,Zn),Pa.buffer.dtype=Qa||Br,Pa.buffer.usage=Zn,Pa.buffer.dimension=3,Pa.buffer.byteLength=ga;if(Qa=Ti,!Ti){switch(Pa.buffer.dtype){case Br:case Ct:Qa=Br;break;case Qr:case Kr:Qa=Qr;break;case Jr:case Gr:Qa=Jr;break}Pa.buffer.dtype=Qa}Pa.type=Qa;var ya=Ia;ya<0&&(ya=Pa.buffer.byteLength,Qa===Qr?ya>>=1:Qa===Jr&&(ya>>=2)),Pa.vertCount=ya;var sa=da;if(da<0){sa=Vt;var yi=Pa.buffer.dimension;yi===1&&(sa=Mi),yi===2&&(sa=Oi),yi===3&&(sa=Vt)}Pa.primType=sa}function Ci(Pa){Bn.elementsCount--,delete Aa[Pa.id],Pa.buffer.destroy(),Pa.buffer=null}function ai(Pa,pn){var Zn=Dr.create(null,yn,!0),da=new Ya(Zn._buffer);Bn.elementsCount++;function Ia(ga){if(!ga)Zn(),da.primType=Vt,da.vertCount=0,da.type=Br;else if(typeof ga=="number")Zn(ga),da.primType=Vt,da.vertCount=ga|0,da.type=Br;else{var Ti=null,Qa=Dt,Ui=-1,ya=-1,sa=0,yi=0;Array.isArray(ga)||zr(ga)||Xr(ga)?Ti=ga:("data"in ga&&(Ti=ga.data),"usage"in ga&&(Qa=va[ga.usage]),"primitive"in ga&&(Ui=na[ga.primitive]),"count"in ga&&(ya=ga.count|0),"type"in ga&&(yi=Sn[ga.type]),"length"in ga?sa=ga.length|0:(sa=ya,yi===Qr||yi===Kr?sa*=2:(yi===Jr||yi===Gr)&&(sa*=4))),Hi(da,Ti,Qa,Ui,ya,sa,yi)}return Ia}return Ia(Pa),Ia._reglType="elements",Ia._elements=da,Ia.subdata=function(ga,Ti){return Zn.subdata(ga,Ti),Ia},Ia.destroy=function(){Ci(da)},Ia}return{create:ai,createStream:Wa,destroyStream:oi,getElements:function(Pa){return typeof Pa=="function"&&Pa._elements instanceof Ya?Pa._elements:null},clear:function(){Ot(Aa).forEach(Ci)}}}var Hr=new Float32Array(1),_n=new Uint32Array(Hr.buffer),Hn=5123;function ea(St){for(var Er=j.allocType(Hn,St.length),Dr=0;Dr>>31<<15,En=(Bn<<1>>>24)-127,Sn=Bn>>13&1023;if(En<-24)Er[Dr]=Aa;else if(En<-14){var Ya=-14-En;Er[Dr]=Aa+(Sn+1024>>Ya)}else En>15?Er[Dr]=Aa+31744:Er[Dr]=Aa+(En+15<<10)+Sn}return Er}function Qn(St){return Array.isArray(St)||zr(St)}var bn=34467,$n=3553,ki=34067,Ua=34069,Fi=6408,Ji=6406,fo=6407,co=6409,So=6410,wi=32854,ts=32855,jo=36194,js=32819,us=32820,Zo=33635,No=34042,Vs=6402,Ns=34041,rl=35904,cs=35906,$o=36193,yo=33776,fs=33777,nl=33778,wl=33779,Ml=35986,Ts=35987,Ai=34798,uo=35840,Tl=35841,Cs=35842,Ro=35843,El=36196,qs=5121,al=5123,mu=5125,io=5126,vs=10242,rs=10243,Bl=10497,Ul=33071,Lo=33648,tu=10240,su=10241,Ds=9728,vl=9729,Il=9984,zl=9985,Ou=9986,qc=9987,Mc=33170,Dc=4352,rh=4353,Hf=4354,ml=34046,vc=3317,nh=37440,Gu=37441,zu=37443,Hu=37444,Rc=33984,$l=[Il,Ou,zl,qc],Fu=[0,co,So,fo,Fi],Bs={};Bs[co]=Bs[Ji]=Bs[Vs]=1,Bs[Ns]=Bs[So]=2,Bs[fo]=Bs[rl]=3,Bs[Fi]=Bs[cs]=4;function kl(St){return"[object "+St+"]"}var rf=kl("HTMLCanvasElement"),lc=kl("OffscreenCanvas"),df=kl("CanvasRenderingContext2D"),ru=kl("ImageBitmap"),Rh=kl("HTMLImageElement"),Rs=kl("HTMLVideoElement"),Yh=Object.keys(ft).concat([rf,lc,df,ru,Rh,Rs]),ul=[];ul[qs]=1,ul[io]=4,ul[$o]=2,ul[al]=2,ul[mu]=4;var Do=[];Do[wi]=2,Do[ts]=2,Do[jo]=2,Do[Ns]=4,Do[yo]=.5,Do[fs]=.5,Do[nl]=1,Do[wl]=1,Do[Ml]=.5,Do[Ts]=1,Do[Ai]=1,Do[uo]=.5,Do[Tl]=.25,Do[Cs]=.5,Do[Ro]=.25,Do[El]=.5;function kf(St){return Array.isArray(St)&&(St.length===0||typeof St[0]=="number")}function Oc(St){if(!Array.isArray(St))return!1;var Er=St.length;return!(Er===0||!Qn(St[0]))}function Cu(St){return Object.prototype.toString.call(St)}function ah(St){return Cu(St)===rf}function pf(St){return Cu(St)===lc}function Nf(St){return Cu(St)===df}function Nu(St){return Cu(St)===ru}function Eh(St){return Cu(St)===Rh}function fh(St){return Cu(St)===Rs}function Bf(St){if(!St)return!1;var Er=Cu(St);return Yh.indexOf(Er)>=0?!0:kf(St)||Oc(St)||Xr(St)}function vf(St){return ft[Object.prototype.toString.call(St)]|0}function ih(St,Er){var Dr=Er.length;switch(St.type){case qs:case al:case mu:case io:var Bn=j.allocType(St.type,Dr);Bn.set(Er),St.data=Bn;break;case $o:St.data=ea(Er);break}}function oh(St,Er){return j.allocType(St.type===$o?io:St.type,Er)}function zc(St,Er){St.type===$o?(St.data=ea(Er),j.freeType(Er)):St.data=Er}function hh(St,Er,Dr,Bn,Aa,En){for(var Sn=St.width,Ya=St.height,$a=St.channels,Wa=Sn*Ya*$a,oi=oh(St,Wa),Hi=0,Ci=0;Ci=1;)Ya+=Sn*$a*$a,$a/=2;return Ya}else return Sn*Dr*Bn}function Gc(St,Er,Dr,Bn,Aa,En,Sn){var Ya={"don't care":Dc,"dont care":Dc,nice:Hf,fast:rh},$a={repeat:Bl,clamp:Ul,mirror:Lo},Wa={nearest:Ds,linear:vl},oi=h({mipmap:qc,"nearest mipmap nearest":Il,"linear mipmap nearest":zl,"nearest mipmap linear":Ou,"linear mipmap linear":qc},Wa),Hi={none:0,browser:Hu},Ci={uint8:qs,rgba4:js,rgb565:Zo,"rgb5 a1":us},ai={alpha:Ji,luminance:co,"luminance alpha":So,rgb:fo,rgba:Fi,rgba4:wi,"rgb5 a1":ts,rgb565:jo},Pa={};Er.ext_srgb&&(ai.srgb=rl,ai.srgba=cs),Er.oes_texture_float&&(Ci.float32=Ci.float=io),Er.oes_texture_half_float&&(Ci.float16=Ci["half float"]=$o),Er.webgl_depth_texture&&(h(ai,{depth:Vs,"depth stencil":Ns}),h(Ci,{uint16:al,uint32:mu,"depth stencil":No})),Er.webgl_compressed_texture_s3tc&&h(Pa,{"rgb s3tc dxt1":yo,"rgba s3tc dxt1":fs,"rgba s3tc dxt3":nl,"rgba s3tc dxt5":wl}),Er.webgl_compressed_texture_atc&&h(Pa,{"rgb atc":Ml,"rgba atc explicit alpha":Ts,"rgba atc interpolated alpha":Ai}),Er.webgl_compressed_texture_pvrtc&&h(Pa,{"rgb pvrtc 4bppv1":uo,"rgb pvrtc 2bppv1":Tl,"rgba pvrtc 4bppv1":Cs,"rgba pvrtc 2bppv1":Ro}),Er.webgl_compressed_texture_etc1&&(Pa["rgb etc1"]=El);var pn=Array.prototype.slice.call(St.getParameter(bn));Object.keys(Pa).forEach(function(G){var xe=Pa[G];pn.indexOf(xe)>=0&&(ai[G]=xe)});var Zn=Object.keys(ai);Dr.textureFormats=Zn;var da=[];Object.keys(ai).forEach(function(G){var xe=ai[G];da[xe]=G});var Ia=[];Object.keys(Ci).forEach(function(G){var xe=Ci[G];Ia[xe]=G});var ga=[];Object.keys(Wa).forEach(function(G){var xe=Wa[G];ga[xe]=G});var Ti=[];Object.keys(oi).forEach(function(G){var xe=oi[G];Ti[xe]=G});var Qa=[];Object.keys($a).forEach(function(G){var xe=$a[G];Qa[xe]=G});var Ui=Zn.reduce(function(G,xe){var re=ai[xe];return re===co||re===Ji||re===co||re===So||re===Vs||re===Ns||Er.ext_srgb&&(re===rl||re===cs)?G[re]=re:re===ts||xe.indexOf("rgba")>=0?G[re]=Fi:G[re]=fo,G},{});function ya(){this.internalformat=Fi,this.format=Fi,this.type=qs,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Hu,this.width=0,this.height=0,this.channels=0}function sa(G,xe){G.internalformat=xe.internalformat,G.format=xe.format,G.type=xe.type,G.compressed=xe.compressed,G.premultiplyAlpha=xe.premultiplyAlpha,G.flipY=xe.flipY,G.unpackAlignment=xe.unpackAlignment,G.colorSpace=xe.colorSpace,G.width=xe.width,G.height=xe.height,G.channels=xe.channels}function yi(G,xe){if(!(typeof xe!="object"||!xe)){if("premultiplyAlpha"in xe&&(G.premultiplyAlpha=xe.premultiplyAlpha),"flipY"in xe&&(G.flipY=xe.flipY),"alignment"in xe&&(G.unpackAlignment=xe.alignment),"colorSpace"in xe&&(G.colorSpace=Hi[xe.colorSpace]),"type"in xe){var re=xe.type;G.type=Ci[re]}var Le=G.width,et=G.height,xt=G.channels,At=!1;"shape"in xe?(Le=xe.shape[0],et=xe.shape[1],xe.shape.length===3&&(xt=xe.shape[2],At=!0)):("radius"in xe&&(Le=et=xe.radius),"width"in xe&&(Le=xe.width),"height"in xe&&(et=xe.height),"channels"in xe&&(xt=xe.channels,At=!0)),G.width=Le|0,G.height=et|0,G.channels=xt|0;var lt=!1;if("format"in xe){var gt=xe.format,It=G.internalformat=ai[gt];G.format=Ui[It],gt in Ci&&("type"in xe||(G.type=Ci[gt])),gt in Pa&&(G.compressed=!0),lt=!0}!At&<?G.channels=Bs[G.format]:At&&!lt&&G.channels!==Fu[G.format]&&(G.format=G.internalformat=Fu[G.channels])}}function Wn(G){St.pixelStorei(nh,G.flipY),St.pixelStorei(Gu,G.premultiplyAlpha),St.pixelStorei(zu,G.colorSpace),St.pixelStorei(vc,G.unpackAlignment)}function ui(){ya.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Xa(G,xe){var re=null;if(Bf(xe)?re=xe:xe&&(yi(G,xe),"x"in xe&&(G.xOffset=xe.x|0),"y"in xe&&(G.yOffset=xe.y|0),Bf(xe.data)&&(re=xe.data)),xe.copy){var Le=Aa.viewportWidth,et=Aa.viewportHeight;G.width=G.width||Le-G.xOffset,G.height=G.height||et-G.yOffset,G.needsCopy=!0}else if(!re)G.width=G.width||1,G.height=G.height||1,G.channels=G.channels||4;else if(zr(re))G.channels=G.channels||4,G.data=re,!("type"in xe)&&G.type===qs&&(G.type=vf(re));else if(kf(re))G.channels=G.channels||4,ih(G,re),G.alignment=1,G.needsFree=!0;else if(Xr(re)){var xt=re.data;!Array.isArray(xt)&&G.type===qs&&(G.type=vf(xt));var At=re.shape,lt=re.stride,gt,It,ar,Jt,sr,pr;At.length===3?(ar=At[2],pr=lt[2]):(ar=1,pr=1),gt=At[0],It=At[1],Jt=lt[0],sr=lt[1],G.alignment=1,G.width=gt,G.height=It,G.channels=ar,G.format=G.internalformat=Fu[ar],G.needsFree=!0,hh(G,xt,Jt,sr,pr,re.offset)}else if(ah(re)||pf(re)||Nf(re))ah(re)||pf(re)?G.element=re:G.element=re.canvas,G.width=G.element.width,G.height=G.element.height,G.channels=4;else if(Nu(re))G.element=re,G.width=re.width,G.height=re.height,G.channels=4;else if(Eh(re))G.element=re,G.width=re.naturalWidth,G.height=re.naturalHeight,G.channels=4;else if(fh(re))G.element=re,G.width=re.videoWidth,G.height=re.videoHeight,G.channels=4;else if(Oc(re)){var fr=G.width||re[0].length,Wt=G.height||re.length,rr=G.channels;Qn(re[0][0])?rr=rr||re[0][0].length:rr=rr||1;for(var er=Qe.shape(re),$r=1,sn=0;sn>=et,re.height>>=et,Xa(re,Le[et]),G.mipmask|=1<=0&&!("faces"in xe)&&(G.genMipmaps=!0)}if("mag"in xe){var Le=xe.mag;G.magFilter=Wa[Le]}var et=G.wrapS,xt=G.wrapT;if("wrap"in xe){var At=xe.wrap;typeof At=="string"?et=xt=$a[At]:Array.isArray(At)&&(et=$a[At[0]],xt=$a[At[1]])}else{if("wrapS"in xe){var lt=xe.wrapS;et=$a[lt]}if("wrapT"in xe){var gt=xe.wrapT;xt=$a[gt]}}if(G.wrapS=et,G.wrapT=xt,"anisotropic"in xe&&(xe.anisotropic,G.anisotropic=xe.anisotropic),"mipmap"in xe){var It=!1;switch(typeof xe.mipmap){case"string":G.mipmapHint=Ya[xe.mipmap],G.genMipmaps=!0,It=!0;break;case"boolean":It=G.genMipmaps=xe.mipmap;break;case"object":G.genMipmaps=!1,It=!0;break}It&&!("min"in xe)&&(G.minFilter=Il)}}function Uu(G,xe){St.texParameteri(xe,su,G.minFilter),St.texParameteri(xe,tu,G.magFilter),St.texParameteri(xe,vs,G.wrapS),St.texParameteri(xe,rs,G.wrapT),Er.ext_texture_filter_anisotropic&&St.texParameteri(xe,ml,G.anisotropic),G.genMipmaps&&(St.hint(Mc,G.mipmapHint),St.generateMipmap(xe))}var Xc=0,Xl={},au=Dr.maxTextureUnits,mo=Array(au).map(function(){return null});function ju(G){ya.call(this),this.mipmask=0,this.internalformat=Fi,this.id=Xc++,this.refCount=1,this.target=G,this.texture=St.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new cu,Sn.profile&&(this.stats={size:0})}function zs(G){St.activeTexture(Rc),St.bindTexture(G.target,G.texture)}function Ll(){var G=mo[0];G?St.bindTexture(G.target,G.texture):St.bindTexture($n,null)}function Zu(G){var xe=G.texture,re=G.unit,Le=G.target;re>=0&&(St.activeTexture(Rc+re),St.bindTexture(Le,null),mo[re]=null),St.deleteTexture(xe),G.texture=null,G.params=null,G.pixels=null,G.refCount=0,delete Xl[G.id],En.textureCount--}h(ju.prototype,{bind:function(){var G=this;G.bindCount+=1;var xe=G.unit;if(xe<0){for(var re=0;re0)continue;Le.unit=-1}mo[re]=G,xe=re;break}Sn.profile&&En.maxTextureUnits>sr)-ar,pr.height=pr.height||(re.height>>sr)-Jt,zs(re),Co(pr,$n,ar,Jt,sr),Ll(),ii(pr),Le}function xt(At,lt){var gt=At|0,It=lt|0||gt;if(gt===re.width&&It===re.height)return Le;Le.width=re.width=gt,Le.height=re.height=It,zs(re);for(var ar=0;re.mipmask>>ar;++ar){var Jt=gt>>ar,sr=It>>ar;if(!Jt||!sr)break;St.texImage2D($n,ar,re.format,Jt,sr,0,re.format,re.type,null)}return Ll(),Sn.profile&&(re.stats.size=nf(re.internalformat,re.type,gt,It,!1,!1)),Le}return Le(G,xe),Le.subimage=et,Le.resize=xt,Le._reglType="texture2d",Le._texture=re,Sn.profile&&(Le.stats=re.stats),Le.destroy=function(){re.decRef()},Le}function Eo(G,xe,re,Le,et,xt){var At=new ju(ki);Xl[At.id]=At,En.cubeCount++;var lt=new Array(6);function gt(Jt,sr,pr,fr,Wt,rr){var er,$r=At.texInfo;for(cu.call($r),er=0;er<6;++er)lt[er]=_u();if(typeof Jt=="number"||!Jt){var sn=Jt|0||1;for(er=0;er<6;++er)Uo(lt[er],sn,sn)}else if(typeof Jt=="object")if(sr)Ko(lt[0],Jt),Ko(lt[1],sr),Ko(lt[2],pr),Ko(lt[3],fr),Ko(lt[4],Wt),Ko(lt[5],rr);else if(Pu($r,Jt),yi(At,Jt),"faces"in Jt){var xn=Jt.faces;for(er=0;er<6;++er)sa(lt[er],At),Ko(lt[er],xn[er])}else for(er=0;er<6;++er)Ko(lt[er],Jt);for(sa(At,lt[0]),$r.genMipmaps?At.mipmask=(lt[0].width<<1)-1:At.mipmask=lt[0].mipmask,At.internalformat=lt[0].internalformat,gt.width=lt[0].width,gt.height=lt[0].height,zs(At),er=0;er<6;++er)il(lt[er],Ua+er);for(Uu($r,ki),Ll(),Sn.profile&&(At.stats.size=nf(At.internalformat,At.type,gt.width,gt.height,$r.genMipmaps,!0)),gt.format=da[At.internalformat],gt.type=Ia[At.type],gt.mag=ga[$r.magFilter],gt.min=Ti[$r.minFilter],gt.wrapS=Qa[$r.wrapS],gt.wrapT=Qa[$r.wrapT],er=0;er<6;++er)Xs(lt[er]);return gt}function It(Jt,sr,pr,fr,Wt){var rr=pr|0,er=fr|0,$r=Wt|0,sn=Wi();return sa(sn,At),sn.width=0,sn.height=0,Xa(sn,sr),sn.width=sn.width||(At.width>>$r)-rr,sn.height=sn.height||(At.height>>$r)-er,zs(At),Co(sn,Ua+Jt,rr,er,$r),Ll(),ii(sn),gt}function ar(Jt){var sr=Jt|0;if(sr!==At.width){gt.width=At.width=sr,gt.height=At.height=sr,zs(At);for(var pr=0;pr<6;++pr)for(var fr=0;At.mipmask>>fr;++fr)St.texImage2D(Ua+pr,fr,At.format,sr>>fr,sr>>fr,0,At.format,At.type,null);return Ll(),Sn.profile&&(At.stats.size=nf(At.internalformat,At.type,gt.width,gt.height,!1,!0)),gt}}return gt(G,xe,re,Le,et,xt),gt.subimage=It,gt.resize=ar,gt._reglType="textureCube",gt._texture=At,Sn.profile&&(gt.stats=At.stats),gt.destroy=function(){At.decRef()},gt}function hs(){for(var G=0;G>Le,re.height>>Le,0,re.internalformat,re.type,null);else for(var et=0;et<6;++et)St.texImage2D(Ua+et,Le,re.internalformat,re.width>>Le,re.height>>Le,0,re.internalformat,re.type,null);Uu(re.texInfo,re.target)})}function De(){for(var G=0;G=0?_u=!0:$a.indexOf(Xs)>=0&&(_u=!1))),("depthTexture"in mo||"depthStencilTexture"in mo)&&(au=!!(mo.depthTexture||mo.depthStencilTexture)),"depth"in mo&&(typeof mo.depth=="boolean"?Ko=mo.depth:(Uu=mo.depth,il=!1)),"stencil"in mo&&(typeof mo.stencil=="boolean"?il=mo.stencil:(Xc=mo.stencil,Ko=!1)),"depthStencil"in mo&&(typeof mo.depthStencil=="boolean"?Ko=il=mo.depthStencil:(Xl=mo.depthStencil,Ko=!1,il=!1))}var zs=null,Ll=null,Zu=null,Ku=null;if(Array.isArray(Jo))zs=Jo.map(ai);else if(Jo)zs=[ai(Jo)];else for(zs=new Array(Pu),ii=0;ii0&&(Wi.depth=ui[0].depth,Wi.stencil=ui[0].stencil,Wi.depthStencil=ui[0].depthStencil),ui[Li]?ui[Li](Wi):ui[Li]=ya(Wi)}return h(Xa,{width:ii,height:ii,color:Xs})}function qi(Co){var Li,Wi=Co|0;if(Wi===Xa.width)return Xa;var ii=Xa.color;for(Li=0;Li=Ao.byteLength?Uo.subdata(Ao):(Uo.destroy(),sa.buffers[Li]=null)),sa.buffers[Li]||(Uo=sa.buffers[Li]=Aa.create(Wi,Df,!1,!0)),ii.buffer=Aa.getBuffer(Uo),ii.size=ii.buffer.dimension|0,ii.normalized=!1,ii.type=ii.buffer.dtype,ii.offset=0,ii.stride=0,ii.divisor=0,ii.state=1,qi[Li]=1}else Aa.getBuffer(Wi)?(ii.buffer=Aa.getBuffer(Wi),ii.size=ii.buffer.dimension|0,ii.normalized=!1,ii.type=ii.buffer.dtype,ii.offset=0,ii.stride=0,ii.divisor=0,ii.state=1):Aa.getBuffer(Wi.buffer)?(ii.buffer=Aa.getBuffer(Wi.buffer),ii.size=(+Wi.size||ii.buffer.dimension)|0,ii.normalized=!!Wi.normalized||!1,"type"in Wi?ii.type=Fn[Wi.type]:ii.type=ii.buffer.dtype,ii.offset=(Wi.offset||0)|0,ii.stride=(Wi.stride||0)|0,ii.divisor=(Wi.divisor||0)|0,ii.state=1):"x"in Wi&&(ii.x=+Wi.x||0,ii.y=+Wi.y||0,ii.z=+Wi.z||0,ii.w=+Wi.w||0,ii.state=2)}for(var Ko=0;Ko1)for(var Wn=0;Wnpn&&(pn=Zn.stats.uniformsCount)}),pn},Dr.getMaxAttributesCount=function(){var pn=0;return oi.forEach(function(Zn){Zn.stats.attributesCount>pn&&(pn=Zn.stats.attributesCount)}),pn});function Pa(){Aa={},En={};for(var pn=0;pn>>4&15)+Er.charAt(Bn&15);return Dr}function Wc(St){for(var Er="",Dr=-1,Bn,Aa;++Dr>>6&31,128|Bn&63):Bn<=65535?Er+=String.fromCharCode(224|Bn>>>12&15,128|Bn>>>6&63,128|Bn&63):Bn<=2097151&&(Er+=String.fromCharCode(240|Bn>>>18&7,128|Bn>>>12&63,128|Bn>>>6&63,128|Bn&63));return Er}function gu(St){for(var Er=Array(St.length>>2),Dr=0;Dr>5]|=(St.charCodeAt(Dr/8)&255)<<24-Dr%32;return Er}function uc(St){for(var Er="",Dr=0;Dr>5]>>>24-Dr%32&255);return Er}function lu(St,Er){return St>>>Er|St<<32-Er}function _f(St,Er){return St>>>Er}function Yc(St,Er,Dr){return St&Er^~St&Dr}function uh(St,Er,Dr){return St&Er^St&Dr^Er&Dr}function br(St){return lu(St,2)^lu(St,13)^lu(St,22)}function qr(St){return lu(St,6)^lu(St,11)^lu(St,25)}function An(St){return lu(St,7)^lu(St,18)^_f(St,3)}function vn(St){return lu(St,17)^lu(St,19)^_f(St,10)}var Xn=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 Na(St,Er){var Dr=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),Bn=new Array(64),Aa,En,Sn,Ya,$a,Wa,oi,Hi,Ci,ai,Pa,pn;for(St[Er>>5]|=128<<24-Er%32,St[(Er+64>>9<<4)+15]=Er,Ci=0;Ci>16)+(Er>>16)+(Dr>>16);return Bn<<16|Dr&65535}function pi(St){return Array.prototype.slice.call(St)}function xi(St){return pi(St).join("")}function $i(St){var Er=St&&St.cache,Dr=0,Bn=[],Aa=[],En=[];function Sn(Pa,pn){var Zn=pn&&pn.stable;if(!Zn){for(var da=0;da0&&(Pa.push(Ia,"="),Pa.push.apply(Pa,pi(arguments)),Pa.push(";")),Ia}return h(pn,{def:da,toString:function(){return xi([Zn.length>0?"var "+Zn.join(",")+";":"",xi(Pa)])}})}function $a(){var Pa=Ya(),pn=Ya(),Zn=Pa.toString,da=pn.toString;function Ia(ga,Ti){pn(ga,Ti,"=",Pa.def(ga,Ti),";")}return h(function(){Pa.apply(Pa,pi(arguments))},{def:Pa.def,entry:Pa,exit:pn,save:Ia,set:function(ga,Ti,Qa){Ia(ga,Ti),Pa(ga,Ti,"=",Qa,";")},toString:function(){return Zn()+da()}})}function Wa(){var Pa=xi(arguments),pn=$a(),Zn=$a(),da=pn.toString,Ia=Zn.toString;return h(pn,{then:function(){return pn.apply(pn,pi(arguments)),this},else:function(){return Zn.apply(Zn,pi(arguments)),this},toString:function(){var ga=Ia();return ga&&(ga="else{"+ga+"}"),xi(["if(",Pa,"){",da(),"}",ga])}})}var oi=Ya(),Hi={};function Ci(Pa,pn){var Zn=[];function da(){var Ui="a"+Zn.length;return Zn.push(Ui),Ui}pn=pn||0;for(var Ia=0;Ia":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},xa={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ba={cw:Lt,ccw:Rt};function Ha(St){return Array.isArray(St)||zr(St)||Xr(St)}function _a(St){return St.sort(function(Er,Dr){return Er===bc?-1:Dr===bc?1:Er=1,Bn>=2,Er)}else if(Dr===Bo){var Aa=St.data;return new gi(Aa.thisDep,Aa.contextDep,Aa.propDep,Er)}else{if(Dr===ro)return new gi(!1,!1,!1,Er);if(Dr===Ni){for(var En=!1,Sn=!1,Ya=!1,$a=0;$a=1&&(Sn=!0),oi>=2&&(Ya=!0)}else Wa.type===Bo&&(En=En||Wa.data.thisDep,Sn=Sn||Wa.data.contextDep,Ya=Ya||Wa.data.propDep)}return new gi(En,Sn,Ya,Er)}else return new gi(Dr===Vo,Dr===Io,Dr===zo,Er)}}var xo=new gi(!1,!1,!1,function(){});function Mo(St,Er,Dr,Bn,Aa,En,Sn,Ya,$a,Wa,oi,Hi,Ci,ai,Pa,pn){var Zn=Wa.Record,da={add:32774,subtract:32778,"reverse subtract":32779};Dr.ext_blend_minmax&&(da.min=jt,da.max=cr);var Ia=Dr.angle_instanced_arrays,ga=Dr.webgl_draw_buffers,Ti=Dr.oes_vertex_array_object,Qa={dirty:!0,profile:pn.profile},Ui={},ya=[],sa={},yi={};function Wn(lt){return lt.replace(".","_")}function ui(lt,gt,It){var ar=Wn(lt);ya.push(lt),Ui[ar]=Qa[ar]=!!It,sa[ar]=gt}function Xa(lt,gt,It){var ar=Wn(lt);ya.push(lt),Array.isArray(It)?(Qa[ar]=It.slice(),Ui[ar]=It.slice()):Qa[ar]=Ui[ar]=It,yi[ar]=gt}function qi(lt){return!!isNaN(lt)}ui(ns,an),ui(Os,Vr),Xa(yl,"blendColor",[0,0,0,0]),Xa(jl,"blendEquationSeparate",[wn,wn]),Xa(_l,"blendFuncSeparate",[nn,on,nn,on]),ui(Vl,zn,!0),Xa(Ks,"depthFunc",Rn),Xa(xu,"depthRange",[0,1]),Xa(yu,"depthMask",!0),Xa(Fl,Fl,[!0,!0,!0,!0]),ui(bo,Rr),Xa(ms,"cullFace",pt),Xa(Cl,Cl,Rt),Xa(cl,cl,1),ui(ic,oa),Xa(oc,"polygonOffset",[0,0]),ui(cc,Fa),ui(Sf,vi),Xa(sc,"sampleCoverage",[1,!1]),ui(sf,mn),Xa(wu,"stencilMask",-1),Xa(lf,"stencilFunc",[ur,0,-1]),Xa(qo,"stencilOpSeparate",[Ye,kr,kr,kr]),Xa(as,"stencilOpSeparate",[pt,kr,kr,kr]),ui(uf,Gn),Xa(Pc,"scissor",[0,0,St.drawingBufferWidth,St.drawingBufferHeight]),Xa(bc,bc,[0,0,St.drawingBufferWidth,St.drawingBufferHeight]);var Co={gl:St,context:Ci,strings:Er,next:Ui,current:Qa,draw:Hi,elements:En,buffer:Aa,shader:oi,attributes:Wa.state,vao:Wa,uniforms:$a,framebuffer:Ya,extensions:Dr,timer:ai,isBufferArgs:Ha},Li={primTypes:na,compareFuncs:ha,blendFuncs:Yn,blendEquations:da,stencilOps:xa,glTypes:Fn,orientationType:Ba};ga&&(Li.backBuffer=[pt],Li.drawBuffer=m(Bn.maxDrawbuffers,function(lt){return lt===0?[0]:m(lt,function(gt){return qa+gt})}));var Wi=0;function ii(){var lt=$i({cache:Pa}),gt=lt.link,It=lt.global;lt.id=Wi++,lt.batchId="0";var ar=gt(Co),Jt=lt.shared={props:"a0"};Object.keys(Co).forEach(function(rr){Jt[rr]=It.def(ar,".",rr)});var sr=lt.next={},pr=lt.current={};Object.keys(yi).forEach(function(rr){Array.isArray(Qa[rr])&&(sr[rr]=It.def(Jt.next,".",rr),pr[rr]=It.def(Jt.current,".",rr))});var fr=lt.constants={};Object.keys(Li).forEach(function(rr){fr[rr]=It.def(JSON.stringify(Li[rr]))}),lt.invoke=function(rr,er){switch(er.type){case eo:var $r=["this",Jt.context,Jt.props,lt.batchId];return rr.def(gt(er.data),".call(",$r.slice(0,Math.max(er.data.length+1,4)),")");case zo:return rr.def(Jt.props,er.data);case Io:return rr.def(Jt.context,er.data);case Vo:return rr.def("this",er.data);case Bo:return er.data.append(lt,rr),er.data.ref;case ro:return er.data.toString();case Ni:return er.data.map(function(sn){return lt.invoke(rr,sn)})}},lt.attribCache={};var Wt={};return lt.scopeAttrib=function(rr){var er=Er.id(rr);if(er in Wt)return Wt[er];var $r=Wa.scope[er];$r||($r=Wa.scope[er]=new Zn);var sn=Wt[er]=gt($r);return sn},lt}function Ao(lt){var gt=lt.static,It=lt.dynamic,ar;if(Je in gt){var Jt=!!gt[Je];ar=Vi(function(pr,fr){return Jt}),ar.enable=Jt}else if(Je in It){var sr=It[Je];ar=Zi(sr,function(pr,fr){return pr.invoke(fr,sr)})}return ar}function Uo(lt,gt){var It=lt.static,ar=lt.dynamic;if(I in It){var Jt=It[I];return Jt?(Jt=Ya.getFramebuffer(Jt),Vi(function(pr,fr){var Wt=pr.link(Jt),rr=pr.shared;fr.set(rr.framebuffer,".next",Wt);var er=rr.context;return fr.set(er,"."+hn,Wt+".width"),fr.set(er,"."+Cn,Wt+".height"),Wt})):Vi(function(pr,fr){var Wt=pr.shared;fr.set(Wt.framebuffer,".next","null");var rr=Wt.context;return fr.set(rr,"."+hn,rr+"."+Pt),fr.set(rr,"."+Cn,rr+"."+qt),"null"})}else if(I in ar){var sr=ar[I];return Zi(sr,function(pr,fr){var Wt=pr.invoke(fr,sr),rr=pr.shared,er=rr.framebuffer,$r=fr.def(er,".getFramebuffer(",Wt,")");fr.set(er,".next",$r);var sn=rr.context;return fr.set(sn,"."+hn,$r+"?"+$r+".width:"+sn+"."+Pt),fr.set(sn,"."+Cn,$r+"?"+$r+".height:"+sn+"."+qt),$r})}else return null}function Ko(lt,gt,It){var ar=lt.static,Jt=lt.dynamic;function sr(Wt){if(Wt in ar){var rr=ar[Wt],er=!0,$r=rr.x|0,sn=rr.y|0,xn,wa;return"width"in rr?xn=rr.width|0:er=!1,"height"in rr?wa=rr.height|0:er=!1,new gi(!er&>&>.thisDep,!er&>&>.contextDep,!er&>&>.propDep,function(Ta,Ea){var Ga=Ta.shared.context,Sa=xn;"width"in rr||(Sa=Ea.def(Ga,".",hn,"-",$r));var Za=wa;return"height"in rr||(Za=Ea.def(Ga,".",Cn,"-",sn)),[$r,sn,Sa,Za]})}else if(Wt in Jt){var la=Jt[Wt],aa=Zi(la,function(Ta,Ea){var Ga=Ta.invoke(Ea,la),Sa=Ta.shared.context,Za=Ea.def(Ga,".x|0"),ci=Ea.def(Ga,".y|0"),Ri=Ea.def('"width" in ',Ga,"?",Ga,".width|0:","(",Sa,".",hn,"-",Za,")"),Yi=Ea.def('"height" in ',Ga,"?",Ga,".height|0:","(",Sa,".",Cn,"-",ci,")");return[Za,ci,Ri,Yi]});return gt&&(aa.thisDep=aa.thisDep||gt.thisDep,aa.contextDep=aa.contextDep||gt.contextDep,aa.propDep=aa.propDep||gt.propDep),aa}else return gt?new gi(gt.thisDep,gt.contextDep,gt.propDep,function(Ta,Ea){var Ga=Ta.shared.context;return[0,0,Ea.def(Ga,".",hn),Ea.def(Ga,".",Cn)]}):null}var pr=sr(bc);if(pr){var fr=pr;pr=new gi(pr.thisDep,pr.contextDep,pr.propDep,function(Wt,rr){var er=fr.append(Wt,rr),$r=Wt.shared.context;return rr.set($r,"."+ot,er[2]),rr.set($r,"."+dt,er[3]),er})}return{viewport:pr,scissor_box:sr(Pc)}}function il(lt,gt){var It=lt.static,ar=typeof It[Ne]=="string"&&typeof It[ce]=="string";if(ar){if(Object.keys(gt.dynamic).length>0)return null;var Jt=gt.static,sr=Object.keys(Jt);if(sr.length>0&&typeof Jt[sr[0]]=="number"){for(var pr=[],fr=0;fr"+Za+"?"+er+".constant["+Za+"]:0;"}).join(""),"}}else{","if(",xn,"(",er,".buffer)){",Ta,"=",wa,".createStream(",Xt,",",er,".buffer);","}else{",Ta,"=",wa,".getBuffer(",er,".buffer);","}",Ea,'="type" in ',er,"?",sn.glTypes,"[",er,".type]:",Ta,".dtype;",la.normalized,"=!!",er,".normalized;");function Ga(Sa){rr(la[Sa],"=",er,".",Sa,"|0;")}return Ga("size"),Ga("offset"),Ga("stride"),Ga("divisor"),rr("}}"),rr.exit("if(",la.isStream,"){",wa,".destroyStream(",Ta,");","}"),la}Jt[sr]=Zi(pr,fr)}),Jt}function Uu(lt){var gt=lt.static,It=lt.dynamic,ar={};return Object.keys(gt).forEach(function(Jt){var sr=gt[Jt];ar[Jt]=Vi(function(pr,fr){return typeof sr=="number"||typeof sr=="boolean"?""+sr:pr.link(sr)})}),Object.keys(It).forEach(function(Jt){var sr=It[Jt];ar[Jt]=Zi(sr,function(pr,fr){return pr.invoke(fr,sr)})}),ar}function Xc(lt,gt,It,ar,Jt){lt.static,lt.dynamic;var sr=il(lt,gt),pr=Uo(lt),fr=Ko(lt,pr),Wt=_u(lt),rr=Xs(lt),er=Jo(lt,Jt,sr);function $r(Ta){var Ea=fr[Ta];Ea&&(rr[Ta]=Ea)}$r(bc),$r(Wn(Pc));var sn=Object.keys(rr).length>0,xn={framebuffer:pr,draw:Wt,shader:er,state:rr,dirty:sn,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(xn.profile=Ao(lt),xn.uniforms=cu(It),xn.drawVAO=xn.scopeVAO=Wt.vao,!xn.drawVAO&&er.program&&!sr&&Dr.angle_instanced_arrays&&Wt.static.elements){var wa=!0,la=er.program.attributes.map(function(Ta){var Ea=gt.static[Ta];return wa=wa&&!!Ea,Ea});if(wa&&la.length>0){var aa=Wa.getVAO(Wa.createVAO({attributes:la,elements:Wt.static.elements}));xn.drawVAO=new gi(null,null,null,function(Ta,Ea){return Ta.link(aa)}),xn.useVAO=!0}}return sr?xn.useVAO=!0:xn.attributes=Pu(gt),xn.context=Uu(ar),xn}function Xl(lt,gt,It){var ar=lt.shared,Jt=ar.context,sr=lt.scope();Object.keys(It).forEach(function(pr){gt.save(Jt,"."+pr);var fr=It[pr],Wt=fr.append(lt,gt);Array.isArray(Wt)?sr(Jt,".",pr,"=[",Wt.join(),"];"):sr(Jt,".",pr,"=",Wt,";")}),gt(sr)}function au(lt,gt,It,ar){var Jt=lt.shared,sr=Jt.gl,pr=Jt.framebuffer,fr;ga&&(fr=gt.def(Jt.extensions,".webgl_draw_buffers"));var Wt=lt.constants,rr=Wt.drawBuffer,er=Wt.backBuffer,$r;It?$r=It.append(lt,gt):$r=gt.def(pr,".next"),ar||gt("if(",$r,"!==",pr,".cur){"),gt("if(",$r,"){",sr,".bindFramebuffer(",Nn,",",$r,".framebuffer);"),ga&>(fr,".drawBuffersWEBGL(",rr,"[",$r,".colorAttachments.length]);"),gt("}else{",sr,".bindFramebuffer(",Nn,",null);"),ga&>(fr,".drawBuffersWEBGL(",er,");"),gt("}",pr,".cur=",$r,";"),ar||gt("}")}function mo(lt,gt,It){var ar=lt.shared,Jt=ar.gl,sr=lt.current,pr=lt.next,fr=ar.current,Wt=ar.next,rr=lt.cond(fr,".dirty");ya.forEach(function(er){var $r=Wn(er);if(!($r in It.state)){var sn,xn;if($r in pr){sn=pr[$r],xn=sr[$r];var wa=m(Qa[$r].length,function(aa){return rr.def(sn,"[",aa,"]")});rr(lt.cond(wa.map(function(aa,Ta){return aa+"!=="+xn+"["+Ta+"]"}).join("||")).then(Jt,".",yi[$r],"(",wa,");",wa.map(function(aa,Ta){return xn+"["+Ta+"]="+aa}).join(";"),";"))}else{sn=rr.def(Wt,".",$r);var la=lt.cond(sn,"!==",fr,".",$r);rr(la),$r in sa?la(lt.cond(sn).then(Jt,".enable(",sa[$r],");").else(Jt,".disable(",sa[$r],");"),fr,".",$r,"=",sn,";"):la(Jt,".",yi[$r],"(",sn,");",fr,".",$r,"=",sn,";")}}}),Object.keys(It.state).length===0&&rr(fr,".dirty=false;"),gt(rr)}function ju(lt,gt,It,ar){var Jt=lt.shared,sr=lt.current,pr=Jt.current,fr=Jt.gl,Wt;_a(Object.keys(It)).forEach(function(rr){var er=It[rr];if(!(ar&&!ar(er))){var $r=er.append(lt,gt);if(sa[rr]){var sn=sa[rr];to(er)?(Wt=lt.link($r,{stable:!0}),gt(lt.cond(Wt).then(fr,".enable(",sn,");").else(fr,".disable(",sn,");")),gt(pr,".",rr,"=",Wt,";")):(gt(lt.cond($r).then(fr,".enable(",sn,");").else(fr,".disable(",sn,");")),gt(pr,".",rr,"=",$r,";"))}else if(Qn($r)){var xn=sr[rr];gt(fr,".",yi[rr],"(",$r,");",$r.map(function(wa,la){return xn+"["+la+"]="+wa}).join(";"),";")}else to(er)?(Wt=lt.link($r,{stable:!0}),gt(fr,".",yi[rr],"(",Wt,");",pr,".",rr,"=",Wt,";")):gt(fr,".",yi[rr],"(",$r,");",pr,".",rr,"=",$r,";")}})}function zs(lt,gt){Ia&&(lt.instancing=gt.def(lt.shared.extensions,".angle_instanced_arrays"))}function Ll(lt,gt,It,ar,Jt){var sr=lt.shared,pr=lt.stats,fr=sr.current,Wt=sr.timer,rr=It.profile;function er(){return typeof performance>"u"?"Date.now()":"performance.now()"}var $r,sn;function xn(Ga){$r=gt.def(),Ga($r,"=",er(),";"),typeof Jt=="string"?Ga(pr,".count+=",Jt,";"):Ga(pr,".count++;"),ai&&(ar?(sn=gt.def(),Ga(sn,"=",Wt,".getNumPendingQueries();")):Ga(Wt,".beginQuery(",pr,");"))}function wa(Ga){Ga(pr,".cpuTime+=",er(),"-",$r,";"),ai&&(ar?Ga(Wt,".pushScopeStats(",sn,",",Wt,".getNumPendingQueries(),",pr,");"):Ga(Wt,".endQuery();"))}function la(Ga){var Sa=gt.def(fr,".profile");gt(fr,".profile=",Ga,";"),gt.exit(fr,".profile=",Sa,";")}var aa;if(rr){if(to(rr)){rr.enable?(xn(gt),wa(gt.exit),la("true")):la("false");return}aa=rr.append(lt,gt),la(aa)}else aa=gt.def(fr,".profile");var Ta=lt.block();xn(Ta),gt("if(",aa,"){",Ta,"}");var Ea=lt.block();wa(Ea),gt.exit("if(",aa,"){",Ea,"}")}function Zu(lt,gt,It,ar,Jt){var sr=lt.shared;function pr(Wt){switch(Wt){case mi:case Wo:case Qs:return 2;case no:case $s:case uu:return 3;case To:case Ws:case Kl:return 4;default:return 1}}function fr(Wt,rr,er){var $r=sr.gl,sn=gt.def(Wt,".location"),xn=gt.def(sr.attributes,"[",sn,"]"),wa=er.state,la=er.buffer,aa=[er.x,er.y,er.z,er.w],Ta=["buffer","normalized","offset","stride"];function Ea(){gt("if(!",xn,".buffer){",$r,".enableVertexAttribArray(",sn,");}");var Sa=er.type,Za;if(er.size?Za=gt.def(er.size,"||",rr):Za=rr,gt("if(",xn,".type!==",Sa,"||",xn,".size!==",Za,"||",Ta.map(function(Ri){return xn+"."+Ri+"!=="+er[Ri]}).join("||"),"){",$r,".bindBuffer(",Xt,",",la,".buffer);",$r,".vertexAttribPointer(",[sn,Za,Sa,er.normalized,er.stride,er.offset],");",xn,".type=",Sa,";",xn,".size=",Za,";",Ta.map(function(Ri){return xn+"."+Ri+"="+er[Ri]+";"}).join(""),"}"),Ia){var ci=er.divisor;gt("if(",xn,".divisor!==",ci,"){",lt.instancing,".vertexAttribDivisorANGLE(",[sn,ci],");",xn,".divisor=",ci,";}")}}function Ga(){gt("if(",xn,".buffer){",$r,".disableVertexAttribArray(",sn,");",xn,".buffer=null;","}if(",ni.map(function(Sa,Za){return xn+"."+Sa+"!=="+aa[Za]}).join("||"),"){",$r,".vertexAttrib4f(",sn,",",aa,");",ni.map(function(Sa,Za){return xn+"."+Sa+"="+aa[Za]+";"}).join(""),"}")}wa===hi?Ea():wa===Ja?Ga():(gt("if(",wa,"===",hi,"){"),Ea(),gt("}else{"),Ga(),gt("}"))}ar.forEach(function(Wt){var rr=Wt.name,er=It.attributes[rr],$r;if(er){if(!Jt(er))return;$r=er.append(lt,gt)}else{if(!Jt(xo))return;var sn=lt.scopeAttrib(rr);$r={},Object.keys(new Zn).forEach(function(xn){$r[xn]=gt.def(sn,".",xn)})}fr(lt.link(Wt),pr(Wt.info.type),$r)})}function Ku(lt,gt,It,ar,Jt,sr){for(var pr=lt.shared,fr=pr.gl,Wt,rr=0;rr1){for(var ys=[],ds=[],fl=0;fl>1)",la],");")}function ci(){It(aa,".drawArraysInstancedANGLE(",[sn,xn,wa,la],");")}er&&er!=="null"?Ea?Za():(It("if(",er,"){"),Za(),It("}else{"),ci(),It("}")):ci()}function Sa(){function Za(){It(sr+".drawElements("+[sn,wa,Ta,xn+"<<(("+Ta+"-"+Ii+")>>1)"]+");")}function ci(){It(sr+".drawArrays("+[sn,xn,wa]+");")}er&&er!=="null"?Ea?Za():(It("if(",er,"){"),Za(),It("}else{"),ci(),It("}")):ci()}Ia&&(typeof la!="number"||la>=0)?typeof la=="string"?(It("if(",la,">0){"),Ga(),It("}else if(",la,"<0){"),Sa(),It("}")):Ga():Sa()}function hs(lt,gt,It,ar,Jt){var sr=ii(),pr=sr.proc("body",Jt);return Ia&&(sr.instancing=pr.def(sr.shared.extensions,".angle_instanced_arrays")),lt(sr,pr,It,ar),sr.compile().body}function gs(lt,gt,It,ar){zs(lt,gt),It.useVAO?It.drawVAO?gt(lt.shared.vao,".setVAO(",It.drawVAO.append(lt,gt),");"):gt(lt.shared.vao,".setVAO(",lt.shared.vao,".targetVAO);"):(gt(lt.shared.vao,".setVAO(null);"),Zu(lt,gt,It,ar.attributes,function(){return!0})),Ku(lt,gt,It,ar.uniforms,function(){return!0},!1),Eo(lt,gt,gt,It)}function De(lt,gt){var It=lt.proc("draw",1);zs(lt,It),Xl(lt,It,gt.context),au(lt,It,gt.framebuffer),mo(lt,It,gt),ju(lt,It,gt.state),Ll(lt,It,gt,!1,!0);var ar=gt.shader.progVar.append(lt,It);if(It(lt.shared.gl,".useProgram(",ar,".program);"),gt.shader.program)gs(lt,It,gt,gt.shader.program);else{It(lt.shared.vao,".setVAO(null);");var Jt=lt.global.def("{}"),sr=It.def(ar,".id"),pr=It.def(Jt,"[",sr,"]");It(lt.cond(pr).then(pr,".call(this,a0);").else(pr,"=",Jt,"[",sr,"]=",lt.link(function(fr){return hs(gs,lt,gt,fr,1)}),"(",ar,");",pr,".call(this,a0);"))}Object.keys(gt.state).length>0&&It(lt.shared.current,".dirty=true;"),lt.shared.vao&&It(lt.shared.vao,".setVAO(null);")}function G(lt,gt,It,ar){lt.batchId="a1",zs(lt,gt);function Jt(){return!0}Zu(lt,gt,It,ar.attributes,Jt),Ku(lt,gt,It,ar.uniforms,Jt,!1),Eo(lt,gt,gt,It)}function xe(lt,gt,It,ar){zs(lt,gt);var Jt=It.contextDep,sr=gt.def(),pr="a0",fr="a1",Wt=gt.def();lt.shared.props=Wt,lt.batchId=sr;var rr=lt.scope(),er=lt.scope();gt(rr.entry,"for(",sr,"=0;",sr,"<",fr,";++",sr,"){",Wt,"=",pr,"[",sr,"];",er,"}",rr.exit);function $r(Ta){return Ta.contextDep&&Jt||Ta.propDep}function sn(Ta){return!$r(Ta)}if(It.needsContext&&Xl(lt,er,It.context),It.needsFramebuffer&&au(lt,er,It.framebuffer),ju(lt,er,It.state,$r),It.profile&&$r(It.profile)&&Ll(lt,er,It,!1,!0),ar)It.useVAO?It.drawVAO?$r(It.drawVAO)?er(lt.shared.vao,".setVAO(",It.drawVAO.append(lt,er),");"):rr(lt.shared.vao,".setVAO(",It.drawVAO.append(lt,rr),");"):rr(lt.shared.vao,".setVAO(",lt.shared.vao,".targetVAO);"):(rr(lt.shared.vao,".setVAO(null);"),Zu(lt,rr,It,ar.attributes,sn),Zu(lt,er,It,ar.attributes,$r)),Ku(lt,rr,It,ar.uniforms,sn,!1),Ku(lt,er,It,ar.uniforms,$r,!0),Eo(lt,rr,er,It);else{var xn=lt.global.def("{}"),wa=It.shader.progVar.append(lt,er),la=er.def(wa,".id"),aa=er.def(xn,"[",la,"]");er(lt.shared.gl,".useProgram(",wa,".program);","if(!",aa,"){",aa,"=",xn,"[",la,"]=",lt.link(function(Ta){return hs(G,lt,It,Ta,2)}),"(",wa,");}",aa,".call(this,a0[",sr,"],",sr,");")}}function re(lt,gt){var It=lt.proc("batch",2);lt.batchId="0",zs(lt,It);var ar=!1,Jt=!0;Object.keys(gt.context).forEach(function(xn){ar=ar||gt.context[xn].propDep}),ar||(Xl(lt,It,gt.context),Jt=!1);var sr=gt.framebuffer,pr=!1;sr?(sr.propDep?ar=pr=!0:sr.contextDep&&ar&&(pr=!0),pr||au(lt,It,sr)):au(lt,It,null),gt.state.viewport&>.state.viewport.propDep&&(ar=!0);function fr(xn){return xn.contextDep&&ar||xn.propDep}mo(lt,It,gt),ju(lt,It,gt.state,function(xn){return!fr(xn)}),(!gt.profile||!fr(gt.profile))&&Ll(lt,It,gt,!1,"a1"),gt.contextDep=ar,gt.needsContext=Jt,gt.needsFramebuffer=pr;var Wt=gt.shader.progVar;if(Wt.contextDep&&ar||Wt.propDep)xe(lt,It,gt,null);else{var rr=Wt.append(lt,It);if(It(lt.shared.gl,".useProgram(",rr,".program);"),gt.shader.program)xe(lt,It,gt,gt.shader.program);else{It(lt.shared.vao,".setVAO(null);");var er=lt.global.def("{}"),$r=It.def(rr,".id"),sn=It.def(er,"[",$r,"]");It(lt.cond(sn).then(sn,".call(this,a0,a1);").else(sn,"=",er,"[",$r,"]=",lt.link(function(xn){return hs(xe,lt,gt,xn,2)}),"(",rr,");",sn,".call(this,a0,a1);"))}}Object.keys(gt.state).length>0&&It(lt.shared.current,".dirty=true;"),lt.shared.vao&&It(lt.shared.vao,".setVAO(null);")}function Le(lt,gt){var It=lt.proc("scope",3);lt.batchId="a2";var ar=lt.shared,Jt=ar.current;if(Xl(lt,It,gt.context),gt.framebuffer&>.framebuffer.append(lt,It),_a(Object.keys(gt.state)).forEach(function(fr){var Wt=gt.state[fr],rr=Wt.append(lt,It);Qn(rr)?rr.forEach(function(er,$r){qi(er)?It.set(lt.next[fr],"["+$r+"]",er):It.set(lt.next[fr],"["+$r+"]",lt.link(er,{stable:!0}))}):to(Wt)?It.set(ar.next,"."+fr,lt.link(rr,{stable:!0})):It.set(ar.next,"."+fr,rr)}),Ll(lt,It,gt,!0,!0),[je,Ft,kt,tr,Ze].forEach(function(fr){var Wt=gt.draw[fr];if(Wt){var rr=Wt.append(lt,It);qi(rr)?It.set(ar.draw,"."+fr,rr):It.set(ar.draw,"."+fr,lt.link(rr),{stable:!0})}}),Object.keys(gt.uniforms).forEach(function(fr){var Wt=gt.uniforms[fr].append(lt,It);Array.isArray(Wt)&&(Wt="["+Wt.map(function(rr){return qi(rr)?rr:lt.link(rr,{stable:!0})})+"]"),It.set(ar.uniforms,"["+lt.link(Er.id(fr),{stable:!0})+"]",Wt)}),Object.keys(gt.attributes).forEach(function(fr){var Wt=gt.attributes[fr].append(lt,It),rr=lt.scopeAttrib(fr);Object.keys(new Zn).forEach(function(er){It.set(rr,"."+er,Wt[er])})}),gt.scopeVAO){var sr=gt.scopeVAO.append(lt,It);qi(sr)?It.set(ar.vao,".targetVAO",sr):It.set(ar.vao,".targetVAO",lt.link(sr,{stable:!0}))}function pr(fr){var Wt=gt.shader[fr];if(Wt){var rr=Wt.append(lt,It);qi(rr)?It.set(ar.shader,"."+fr,rr):It.set(ar.shader,"."+fr,lt.link(rr,{stable:!0}))}}pr(ce),pr(Ne),Object.keys(gt.state).length>0&&(It(Jt,".dirty=true;"),It.exit(Jt,".dirty=true;")),It("a1(",lt.shared.context,",a0,",lt.batchId,");")}function et(lt){if(!(typeof lt!="object"||Qn(lt))){for(var gt=Object.keys(lt),It=0;It=0;--Eo){var hs=qi[Eo];hs&&hs(ai,null,0)}Dr.flush(),Wa&&Wa.update()}function Uo(){!ii&&qi.length>0&&(ii=c.next(Ao))}function Ko(){ii&&(c.cancel(Ao),ii=null)}function il(Eo){Eo.preventDefault(),Ko(),Co.forEach(function(hs){hs()})}function Jo(Eo){Dr.getError(),Aa.restore(),Qa.restore(),da.restore(),Ui.restore(),ya.restore(),sa.restore(),ga.restore(),Wa&&Wa.restore(),yi.procs.refresh(),Uo(),Li.forEach(function(hs){hs()})}Xa&&(Xa.addEventListener(ql,il,!1),Xa.addEventListener(Pl,Jo,!1));function _u(){qi.length=0,Ko(),Xa&&(Xa.removeEventListener(ql,il),Xa.removeEventListener(Pl,Jo)),Qa.clear(),sa.clear(),ya.clear(),ga.clear(),Ui.clear(),Ia.clear(),da.clear(),Wa&&Wa.clear(),Wi.forEach(function(Eo){Eo()})}function Xs(Eo){function hs(Jt){var sr=h({},Jt);delete sr.uniforms,delete sr.attributes,delete sr.context,delete sr.vao,"stencil"in sr&&sr.stencil.op&&(sr.stencil.opBack=sr.stencil.opFront=sr.stencil.op,delete sr.stencil.op);function pr(fr){if(fr in sr){var Wt=sr[fr];delete sr[fr],Object.keys(Wt).forEach(function(rr){sr[fr+"."+rr]=Wt[rr]})}}return pr("blend"),pr("depth"),pr("cull"),pr("stencil"),pr("polygonOffset"),pr("scissor"),pr("sample"),"vao"in Jt&&(sr.vao=Jt.vao),sr}function gs(Jt,sr){var pr={},fr={};return Object.keys(Jt).forEach(function(Wt){var rr=Jt[Wt];if(f.isDynamic(rr)){fr[Wt]=f.unbox(rr,Wt);return}else if(sr&&Array.isArray(rr)){for(var er=0;er0)return At.call(this,It(Jt|0),Jt|0)}else if(Array.isArray(Jt)){if(Jt.length)return At.call(this,Jt,Jt.length)}else return xt.call(this,Jt)}return h(ar,{stats:Le,destroy:function(){et.destroy()}})}var cu=sa.setFBO=Xs({framebuffer:f.define.call(null,fc,"framebuffer")});function Pu(Eo,hs){var gs=0;yi.procs.poll();var De=hs.color;De&&(Dr.clearColor(+De[0]||0,+De[1]||0,+De[2]||0,+De[3]||0),gs|=Yl),"depth"in hs&&(Dr.clearDepth(+hs.depth),gs|=ho),"stencil"in hs&&(Dr.clearStencil(hs.stencil|0),gs|=ks),Dr.clear(gs)}function Uu(Eo){if("framebuffer"in Eo)if(Eo.framebuffer&&Eo.framebuffer_reglType==="framebufferCube")for(var hs=0;hs<6;++hs)cu(h({framebuffer:Eo.framebuffer.faces[hs]},Eo),Pu);else cu(Eo,Pu);else Pu(null,Eo)}function Xc(Eo){qi.push(Eo);function hs(){var gs=Lc(qi,Eo);function De(){var G=Lc(qi,De);qi[G]=qi[qi.length-1],qi.length-=1,qi.length<=0&&Ko()}qi[gs]=De}return Uo(),{cancel:hs}}function Xl(){var Eo=ui.viewport,hs=ui.scissor_box;Eo[0]=Eo[1]=hs[0]=hs[1]=0,ai.viewportWidth=ai.framebufferWidth=ai.drawingBufferWidth=Eo[2]=hs[2]=Dr.drawingBufferWidth,ai.viewportHeight=ai.framebufferHeight=ai.drawingBufferHeight=Eo[3]=hs[3]=Dr.drawingBufferHeight}function au(){ai.tick+=1,ai.time=ju(),Xl(),yi.procs.poll()}function mo(){Ui.refresh(),Xl(),yi.procs.refresh(),Wa&&Wa.update()}function ju(){return(v()-oi)/1e3}mo();function zs(Eo,hs){var gs;switch(Eo){case"frame":return Xc(hs);case"lost":gs=Co;break;case"restore":gs=Li;break;case"destroy":gs=Wi;break}return gs.push(hs),{cancel:function(){for(var De=0;De=0},read:Wn,destroy:_u,_gl:Dr,_refresh:mo,poll:function(){au(),Wa&&Wa.update()},now:ju,stats:Sn,getCachedCode:Ll,preloadCachedCode:Zu});return Er.onDone(null,Ku),Ku}return Tu})}}),yx=_e({"src/lib/prepare_regl.js"(ee,X){var h=L3(),x=pI();X.exports=function(k,e,t){var r=k._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=x({canvas:this,attributes:{antialias:!n.pick,preserveDrawingBuffer:!0},pixelRatio:k._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:t||{}})}catch{o=!1}n.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(i){k&&k.emit&&k.emit("plotly_webglcontextlost",{event:i,layer:n.key})},!1)}}),o||h({container:r._glcontainer.node()}),o}}}),xA=_e({"src/traces/scattergl/plot.js"(f,X){var h=Q3(),x=fA(),S=KL(),k=dI(),e=kn(),t=Fp().selectMode,r=yx(),o=Ps(),n=Hw(),i=Z3().styleTextSelection,a={};function s(c,v,p,T){var l=c._size,g=c.width*T,b=c.height*T,A=l.l*T,E=l.b*T,_=l.r*T,w=l.t*T,m=l.w*T,u=l.h*T;return[A+v.domain[0]*m,E+p.domain[0]*u,g-_-(1-v.domain[1])*m,b-w-(1-p.domain[1])*u]}var f=X.exports=function(v,p,T){if(T.length){var l=v._fullLayout,g=p._scene,b=p.xaxis,A=p.yaxis,E,_;if(g){var w=r(v,["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(v,p,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=x(u)),g.scatter2d===!0&&(g.scatter2d=h(u)),g.fill2d===!0&&(g.fill2d=x(u)),g.glText===!0)for(g.glText=new Array(m),E=0;Eg.glText.length){var d=m-g.glText.length;for(E=0;Eue&&(isNaN(le[Te])||isNaN(le[Te+1]));)Te-=2;Y.positions=le.slice(ue,Te+2)}return Y}),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(Y,le){var ue=T[le];if(!(!Y||!ue||!ue[0]||!ue[0].trace)){var Te=ue[0],Fe=Te.trace,Ve=Te.t,Xe=g.lineOptions[le],We,it,yt=[];Fe._ownfill&&yt.push(le),Fe._nexttrace&&yt.push(le+1),yt.length&&(g.fillOrder[le]=yt);var bt=[],mt=Xe&&Xe.positions||Ve.positions,ht,qe;if(Fe.fill==="tozeroy"){for(ht=0;htht&&isNaN(mt[qe+1]);)qe-=2;mt[ht+1]!==0&&(bt=[mt[ht],0]),bt=bt.concat(mt.slice(ht,qe+2)),mt[qe+1]!==0&&(bt=bt.concat([mt[qe],0]))}else if(Fe.fill==="tozerox"){for(ht=0;htht&&isNaN(mt[qe]);)qe-=2;mt[ht]!==0&&(bt=[0,mt[ht+1]]),bt=bt.concat(mt.slice(ht,qe+2)),mt[qe]!==0&&(bt=bt.concat([0,mt[qe+1]]))}else if(Fe.fill==="toself"||Fe.fill==="tonext"){for(bt=[],We=0,Y.splitNull=!0,it=0;it-1;for(E=0;Eb&&p||gi,y;for(d?y=p.sizeAvg||Math.max(p.size,3):y=S(f,v),A=0;A{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,k(()=>{this.dirty=!1})),this)},o.prototype.update=function(...s){if(!s.length)return;for(let v=0;vy||!p.lower&&d{f[T+g]=v})}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 v=s.id!=null?s.id:s,p=f,T=c;return v<<16|(p&255)<<8|T&255}function i(s,f,c){let v,p,T,l,g=s[f],b=s[c];return g.length>2?(g[0],g[2],v=g[1],p=g[3]):g.length?(v=g[0],p=g[1]):(g.x,v=g.y,g.x+g.width,p=g.y+g.height),b.length>2?(T=b[0],l=b[2],b[1],b[3]):b.length?(T=b[0],l=b[1]):(T=b.x,b.y,l=b.x+b.width,b.y+b.height),[T,v,l,p]}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]}}}}),AI=_e({"src/traces/splom/plot.js"(ee,X){var h=TI(),x=kn(),S=cf(),k=Fp().selectMode;X.exports=function(r,o,n){if(n.length)for(var i=0;i-1,U=k(p)||!!i.selectedpoints||N,B=!0;if(U){var D=i._length;if(i.selectedpoints){s.selectBatch=i.selectedpoints;var j=i.selectedpoints,q={};for(g=0;g=J[oe][0]&&q<=J[oe][1])return!0;return!1}function f(q){q.attr("x",-h.bar.captureWidth/2).attr("width",h.bar.captureWidth)}function c(q){q.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function v(q){if(!q.brush.filterSpecified)return"0,"+q.height;for(var J=p(q.brush.filter.getConsolidated(),q.height),oe=[0],ye,pe,ge,W=J.length?J[0][0]:null,ae=0;aeq[1]+oe||J=.9*q[1]+.1*q[0]?"n":J<=.9*q[0]+.1*q[1]?"s":"ns"}function l(){x.select(document.body).style("cursor",null)}function g(q){q.attr("stroke-dasharray",v)}function b(q,J){var oe=x.select(q).selectAll(".highlight, .highlight-shadow"),ye=J?oe.transition().duration(h.bar.snapDuration).each("end",J):oe;g(ye)}function A(q,J){var oe=q.brush,ye=oe.filterSpecified,pe=NaN,ge={},W;if(ye){var ae=q.height,se=oe.filter.getConsolidated(),Q=p(se,ae),me=NaN,ie=NaN,Y=NaN;for(W=0;W<=Q.length;W++){var le=Q[W];if(le&&le[0]<=J&&J<=le[1]){me=W;break}else if(ie=W?W-1:NaN,le&&le[0]>J){Y=W;break}}if(pe=me,isNaN(pe)&&(isNaN(ie)||isNaN(Y)?pe=isNaN(ie)?Y:ie:pe=J-Q[ie][1]=Xe[0]&&Ve<=Xe[1]){ge.clickableOrdinalRange=Xe;break}}}return ge}function E(q,J){x.event.sourceEvent.stopPropagation();var oe=J.height-x.mouse(q)[1]-2*h.verticalPadding,ye=J.unitToPaddedPx.invert(oe),pe=J.brush,ge=A(J,oe),W=ge.interval,ae=pe.svgBrush;if(ae.wasDragged=!1,ae.grabbingBar=ge.region==="ns",ae.grabbingBar){var se=W.map(J.unitToPaddedPx);ae.grabPoint=oe-se[0]-h.verticalPadding,ae.barLength=se[1]-se[0]}ae.clickableOrdinalRange=ge.clickableOrdinalRange,ae.stayingIntervals=J.multiselect&&pe.filterSpecified?pe.filter.getConsolidated():[],W&&(ae.stayingIntervals=ae.stayingIntervals.filter(function(Q){return Q[0]!==W[0]&&Q[1]!==W[1]})),ae.startExtent=ge.region?W[ge.region==="s"?1:0]:ye,J.parent.inBrushDrag=!0,ae.brushStartCallback()}function _(q,J){x.event.sourceEvent.stopPropagation();var oe=J.height-x.mouse(q)[1]-2*h.verticalPadding,ye=J.brush.svgBrush;ye.wasDragged=!0,ye._dragging=!0,ye.grabbingBar?ye.newExtent=[oe-ye.grabPoint,oe+ye.barLength-ye.grabPoint].map(J.unitToPaddedPx.invert):ye.newExtent=[ye.startExtent,J.unitToPaddedPx.invert(oe)].sort(e),J.brush.filterSpecified=!0,ye.extent=ye.stayingIntervals.concat([ye.newExtent]),ye.brushCallback(J),b(q.parentNode)}function w(q,J){var oe=J.brush,ye=oe.filter,pe=oe.svgBrush;pe._dragging||(m(q,J),_(q,J),J.brush.svgBrush.wasDragged=!1),pe._dragging=!1;var ge=x.event;ge.sourceEvent.stopPropagation();var W=pe.grabbingBar;if(pe.grabbingBar=!1,pe.grabLocation=void 0,J.parent.inBrushDrag=!1,l(),!pe.wasDragged){pe.wasDragged=void 0,pe.clickableOrdinalRange?oe.filterSpecified&&J.multiselect?pe.extent.push(pe.clickableOrdinalRange):(pe.extent=[pe.clickableOrdinalRange],oe.filterSpecified=!0):W?(pe.extent=pe.stayingIntervals,pe.extent.length===0&&z(oe)):z(oe),pe.brushCallback(J),b(q.parentNode),pe.brushEndCallback(oe.filterSpecified?ye.getConsolidated():[]);return}var ae=function(){ye.set(ye.getConsolidated())};if(J.ordinal){var se=J.unitTickvals;se[se.length-1]pe.newExtent[0];pe.extent=pe.stayingIntervals.concat(Q?[pe.newExtent]:[]),pe.extent.length||z(oe),pe.brushCallback(J),Q?b(q.parentNode,ae):(ae(),b(q.parentNode))}else ae();pe.brushEndCallback(oe.filterSpecified?ye.getConsolidated():[])}function m(q,J){var oe=J.height-x.mouse(q)[1]-2*h.verticalPadding,ye=A(J,oe),pe="crosshair";ye.clickableOrdinalRange?pe="pointer":ye.region&&(pe=ye.region+"-resize"),x.select(document.body).style("cursor",pe)}function u(q){q.on("mousemove",function(J){x.event.preventDefault(),J.parent.inBrushDrag||m(this,J)}).on("mouseleave",function(J){J.parent.inBrushDrag||l()}).call(x.behavior.drag().on("dragstart",function(J){E(this,J)}).on("drag",function(J){_(this,J)}).on("dragend",function(J){w(this,J)}))}function d(q,J){return q[0]-J[0]}function y(q,J,oe){var ye=oe._context.staticPlot,pe=q.selectAll(".background").data(k);pe.enter().append("rect").classed("background",!0).call(f).call(c).style("pointer-events",ye?"none":"auto").attr("transform",t(0,h.verticalPadding)),pe.call(u).attr("height",function(ae){return ae.height-h.verticalPadding});var ge=q.selectAll(".highlight-shadow").data(k);ge.enter().append("line").classed("highlight-shadow",!0).attr("x",-h.bar.width/2).attr("stroke-width",h.bar.width+h.bar.strokeWidth).attr("stroke",J).attr("opacity",h.bar.strokeOpacity).attr("stroke-linecap","butt"),ge.attr("y1",function(ae){return ae.height}).call(g);var W=q.selectAll(".highlight").data(k);W.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"),W.attr("y1",function(ae){return ae.height}).call(g)}function R(q,J,oe){var ye=q.selectAll("."+h.cn.axisBrush).data(k,S);ye.enter().append("g").classed(h.cn.axisBrush,!0),y(ye,J,oe)}function L(q){return q.svgBrush.extent.map(function(J){return J.slice()})}function z(q){q.filterSpecified=!1,q.svgBrush.extent=[[-1/0,1/0]]}function N(q){return function(oe){var ye=oe.brush,pe=L(ye),ge=pe.slice();ye.filter.set(ge),q()}}function U(q){for(var J=q.slice(),oe=[],ye,pe=J.shift();pe;){for(ye=pe.slice();(pe=J.shift())&&pe[0]<=ye[1];)ye[1]=Math.max(ye[1],pe[1]);oe.push(ye)}return oe.length===1&&oe[0][0]>oe[0][1]&&(oe=[]),oe}function B(){var q=[],J,oe;return{set:function(ye){q=ye.map(function(pe){return pe.slice().sort(e)}).sort(d),q.length===1&&q[0][0]===-1/0&&q[0][1]===1/0&&(q=[[0,-1]]),J=U(q),oe=q.reduce(function(pe,ge){return[Math.min(pe[0],ge[0]),Math.max(pe[1],ge[1])]},[1/0,-1/0])},get:function(){return q.slice()},getConsolidated:function(){return J},getBounds:function(){return oe}}}function D(q,J,oe,ye,pe,ge){var W=B();return W.set(oe),{filter:W,filterSpecified:J,svgBrush:{extent:[],brushStartCallback:ye,brushCallback:N(pe),brushEndCallback:ge}}}function j(q,J){if(Array.isArray(q[0])?(q=q.map(function(ye){return ye.sort(e)}),J.multiselect?q=U(q.sort(d)):q=[q[0]]):q=[q.sort(e)],J.tickvals){var oe=J.tickvals.slice().sort(e);if(q=q.map(function(ye){var pe=[a(0,oe,ye[0],[]),a(1,oe,ye[1],[])];if(pe[1]>pe[0])return pe}).filter(function(ye){return ye}),!q.length)return}return q.length>1?q:q[0]}X.exports={makeBrush:D,ensureAxisBrush:R,cleanRanges:j}}}),II=_e({"src/traces/parcoords/defaults.js"(ee,X){var h=kn(),x=ed().hasColorscale,S=Oa(),k=hf().defaults,e=Wh(),t=xs(),r=AA(),o=SA(),n=_1().maxDimensionCount,i=_x();function a(f,c,v,p,T){var l=T("line.color",v);if(x(f,"line")&&h.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),S(f,c,p,T,{prefix:"line.",cLetter:"c"}),l.length;c.line.color=v}return 1/0}function s(f,c,v,p){function T(E,_){return h.coerce(f,c,r.dimensions,E,_)}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 b=T("range");c._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:b},t.setConvert(c._ax,p.layout),T("multiselect");var A=T("constraintrange");A&&(c.constraintrange=o.cleanRanges(A,c))}}X.exports=function(c,v,p,T){function l(_,w){return h.coerce(c,v,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 b=e(c,v,{name:"dimensions",layout:T,handleItemDefaults:s}),A=a(c,v,p,T,l);k(v,T,l),(!Array.isArray(b)||!b.length)&&(v.visible=!1),i(v,b,"values",A);var E=h.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});h.coerceFont(l,"labelfont",E),h.coerceFont(l,"tickfont",E,{autoShadowDflt:!0}),h.coerceFont(l,"rangefont",E),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),DI=_e({"src/traces/parcoords/calc.js"(ee,X){var h=kn().isArrayOrTypedArray,x=Ho(),S=hv().wrap;X.exports=function(t,r){var o,n;return x.hasColorscale(r,"line")&&h(r.line.color)?(o=r.line.color,n=x.extractOpts(r.line).colorscale,x.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=k(r._length),n=[[0,r.line.color],[1,r.line.color]]),S({lineColor:o,cscale:n})};function k(e){for(var t=new Array(e),r=0;r>>16,(ee&65280)>>>8,ee&255],alpha:1};if(typeof ee=="number")return{space:"rgb",values:[ee>>>16,(ee&65280)>>>8,ee&255],alpha:1};if(ee=String(ee).toLowerCase(),bx.default[ee])S=bx.default[ee].slice(),e="rgb";else if(ee==="transparent")k=0,e="rgb",S=[0,0,0];else if(ee[0]==="#"){var t=ee.slice(1),r=t.length,o=r<=4;k=1,o?(S=[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)],r===4&&(k=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&&(k=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(x=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(ee)){var n=x[1];e=n.replace(/a$/,"");var i=e==="cmyk"?4:e==="gray"?1:3;S=x[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(xx[a]!==void 0)return xx[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)}),k=S.length>i?S.pop():1}else/[0-9](?:\s|\/|,)/.test(ee)&&(S=ee.match(/([0-9]+)/g).map(function(a){return parseFloat(a)}),e=((h=(X=ee.match(/([a-z])/ig))==null?void 0:X.join(""))==null?void 0:h.toLowerCase())||"rgb");return{space:e,values:S,alpha:k}}var bx,MA,xx,OI=tt({"node_modules/color-parse/index.js"(){bx=ir(k3()),MA=RI,xx={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),b1,EA=tt({"node_modules/color-space/rgb.js"(){b1={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),x1,zI=tt({"node_modules/color-space/hsl.js"(){EA(),x1={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(ee){var X=ee[0]/360,h=ee[1]/100,x=ee[2]/100,S,k,e,t,r,o=0;if(h===0)return r=x*255,[r,r,r];for(k=x<.5?x*(1+h):x+h-x*h,S=2*x-k,t=[0,0,0];o<3;)e=X+1/3*-(o-1),e<0?e++:e>1&&e--,r=6*e<1?S+(k-S)*6*e:2*e<1?k:3*e<2?S+(k-S)*(2/3-e)*6:S,t[o++]=r*255;return t}},b1.hsl=function(ee){var X=ee[0]/255,h=ee[1]/255,x=ee[2]/255,S=Math.min(X,h,x),k=Math.max(X,h,x),e=k-S,t,r,o;return k===S?t=0:X===k?t=(h-x)/e:h===k?t=2+(x-X)/e:x===k&&(t=4+(X-h)/e),t=Math.min(t*60,360),t<0&&(t+=360),o=(S+k)/2,k===S?r=0:o<=.5?r=e/(k+S):r=e/(2-k-S),[t,r*100,o*100]}}}),kA={};Gt(kA,{default:()=>FI});function FI(ee){Array.isArray(ee)&&ee.raw&&(ee=String.raw(...arguments)),ee instanceof Number&&(ee=+ee);var X,h=MA(ee);if(!h.space)return[];const x=h.space[0]==="h"?x1.min:b1.min,S=h.space[0]==="h"?x1.max:b1.max;return X=Array(3),X[0]=Math.min(Math.max(h.values[0],x[0]),S[0]),X[1]=Math.min(Math.max(h.values[1],x[1]),S[1]),X[2]=Math.min(Math.max(h.values[2],x[2]),S[2]),h.space[0]==="h"&&(X=x1.rgb(X)),X.push(Math.min(Math.max(h.alpha,0),1)),X}var NI=tt({"node_modules/color-rgba/index.js"(){OI(),EA(),zI()}}),CA=_e({"src/traces/parcoords/helpers.js"(ee){var X=kn().isTypedArray;ee.convertTypedArray=function(h){return X(h)?Array.prototype.slice.call(h):h},ee.isOrdinal=function(h){return!!h.tickvals},ee.isVisible=function(h){return h.visible||!("visible"in h)}}}),BI=_e({"src/traces/parcoords/lines.js"(ee,X){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(` `),x=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` `),S=_1().maxDimensionCount,k=kn(),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,d,y){var R=w._gl;R.enable(R.SCISSOR_TEST),R.scissor(m,u,d,y),w.clear({color:[0,0,0,0],depth:1})}function s(w,m,u,d,y,R){var L=R.key;function z(N){var U=Math.min(d,y-N*d);N===0&&(window.cancelAnimationFrame(u.currentRafs[L]),delete u.currentRafs[L],a(w,R.scissorX,R.scissorY,R.scissorWidth,R.viewBoxSize[1])),!u.clearOnly&&(R.count=2*U,R.offset=2*N*d,m(R),N*d+U>>8*m)%256/255}function p(w,m,u){for(var d=new Array(w*(S+4)),y=0,R=0;RWe&&(We=ie[Te].dim1.canvasX,Ve=Te);ue===0&&a(y,0,0,U.canvasWidth,U.canvasHeight);var it=W(u);for(Te=0;TeTe._length&&(ht=ht.slice(0,Te._length));var qe=Te.tickvals,ze;function Ae($t,Yt){return{val:$t,text:ze[Yt]}}function Ke($t,Yt){return $t.val-Yt.val}if(S(qe)&&qe.length){x.isTypedArray(qe)&&(qe=Array.from(qe)),ze=Te.ticktext,!S(ze)||!ze.length?ze=qe.map(k(Te.tickformat)):ze.length>qe.length?ze=ze.slice(0,qe.length):qe.length>ze.length&&(qe=qe.slice(0,ze.length));for(var _t=1;_t=Yt||Fr>=lr)return;var ln=vt.lineLayer.readPixel(Nr,lr-1-Fr),zr=ln[3]!==0,Xr=zr?ln[2]+256*(ln[1]+256*ln[0]):null,Ot={x:Nr,y:Fr,clientX:$t.clientX,clientY:$t.clientY,dataIndex:vt.model.key,curveNumber:Xr};Xr!==Ve&&(zr?ae.hover(Ot):ae.unhover&&ae.unhover(Ot),Ve=Xr)}}),Fe.style("opacity",function(vt){return vt.pick?0:1}),me.style("background","rgba(255, 255, 255, 0)");var We=me.selectAll("."+T.cn.parcoords).data(Te,f);We.exit().remove(),We.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),We.attr("transform",function(vt){return o(vt.model.translateX,vt.model.translateY)});var it=We.selectAll("."+T.cn.parcoordsControlView).data(c,f);it.enter().append("g").classed(T.cn.parcoordsControlView,!0),it.attr("transform",function(vt){return o(vt.model.pad.l,vt.model.pad.t)});var yt=it.selectAll("."+T.cn.yAxis).data(function(vt){return vt.dimensions},f);yt.enter().append("g").classed(T.cn.yAxis,!0),it.each(function(vt){j(yt,vt,Y)}),Fe.each(function(vt){if(vt.viewModel){!vt.lineLayer||ae?vt.lineLayer=g(this,vt):vt.lineLayer.update(vt),(vt.key||vt.key===0)&&(vt.viewModel[vt.key]=vt.lineLayer);var $t=!vt.context||ae;vt.lineLayer.render(vt.viewModel.panels,$t)}}),yt.attr("transform",function(vt){return o(vt.xScale(vt.xIndex),0)}),yt.call(h.behavior.drag().origin(function(vt){return vt}).on("drag",function(vt){var $t=vt.parent;ue.linePickActive(!1),vt.x=Math.max(-T.overdrag,Math.min(vt.model.width+T.overdrag,h.event.x)),vt.canvasX=vt.x*vt.model.canvasPixelRatio,yt.sort(function(Yt,lr){return Yt.x-lr.x}).each(function(Yt,lr){Yt.xIndex=lr,Yt.x=vt===Yt?Yt.x:Yt.xScale(Yt.xIndex),Yt.canvasX=Yt.x*Yt.model.canvasPixelRatio}),j(yt,$t,Y),yt.filter(function(Yt){return Math.abs(vt.xIndex-Yt.xIndex)!==0}).attr("transform",function(Yt){return o(Yt.xScale(Yt.xIndex),0)}),h.select(this).attr("transform",o(vt.x,0)),yt.each(function(Yt,lr,dr){dr===vt.parent.key&&($t.dimensions[lr]=Yt)}),$t.contextLayer&&$t.contextLayer.render($t.panels,!1,!L($t)),$t.focusLayer.render&&$t.focusLayer.render($t.panels)}).on("dragend",function(vt){var $t=vt.parent;vt.x=vt.xScale(vt.xIndex),vt.canvasX=vt.x*vt.model.canvasPixelRatio,j(yt,$t,Y),h.select(this).attr("transform",function(Yt){return o(Yt.x,0)}),$t.contextLayer&&$t.contextLayer.render($t.panels,!1,!L($t)),$t.focusLayer&&$t.focusLayer.render($t.panels),$t.pickLayer&&$t.pickLayer.render($t.panels,!0),ue.linePickActive(!0),ae&&ae.axesMoved&&ae.axesMoved($t.key,$t.dimensions.map(function(Yt){return Yt.crossfilterDimensionIndex}))})),yt.exit().remove();var bt=yt.selectAll("."+T.cn.axisOverlays).data(c,f);bt.enter().append("g").classed(T.cn.axisOverlays,!0),bt.selectAll("."+T.cn.axis).remove();var mt=bt.selectAll("."+T.cn.axis).data(c,f);mt.enter().append("g").classed(T.cn.axis,!0),mt.each(function(vt){var $t=vt.model.height/vt.model.tickDistance,Yt=vt.domainScale,lr=Yt.domain();h.select(this).call(h.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks($t,vt.tickFormat).tickValues(vt.ordinal?lr:null).tickFormat(function(dr){return p.isOrdinal(vt)?dr:J(vt.model.dimensions[vt.visibleIndex],dr)}).scale(Yt)),i.font(mt.selectAll("text"),vt.model.tickFont)}),mt.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),mt.selectAll("text").style("cursor","default");var ht=bt.selectAll("."+T.cn.axisHeading).data(c,f);ht.enter().append("g").classed(T.cn.axisHeading,!0);var qe=ht.selectAll("."+T.cn.axisTitle).data(c,f);qe.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",se?"none":"auto"),qe.text(function(vt){return vt.label}).each(function(vt){var $t=h.select(this);i.font($t,vt.model.labelFont),n.convertToTspans($t,pe)}).attr("transform",function(vt){var $t=D(vt.model.labelAngle,vt.model.labelSide),Yt=T.axisTitleOffset;return($t.dir>0?"":o(0,2*Yt+vt.model.height))+r($t.degrees)+o(-Yt*$t.dx,-Yt*$t.dy)}).attr("text-anchor",function(vt){var $t=D(vt.model.labelAngle,vt.model.labelSide),Yt=Math.abs($t.dx),lr=Math.abs($t.dy);return 2*Yt>lr?$t.dir*$t.dx<0?"start":"end":"middle"});var ze=bt.selectAll("."+T.cn.axisExtent).data(c,f);ze.enter().append("g").classed(T.cn.axisExtent,!0);var Ae=ze.selectAll("."+T.cn.axisExtentTop).data(c,f);Ae.enter().append("g").classed(T.cn.axisExtentTop,!0),Ae.attr("transform",o(0,-T.axisExtentOffset));var Ke=Ae.selectAll("."+T.cn.axisExtentTopText).data(c,f);Ke.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(U),Ke.text(function(vt){return oe(vt,!0)}).each(function(vt){i.font(h.select(this),vt.model.rangeFont)});var _t=ze.selectAll("."+T.cn.axisExtentBottom).data(c,f);_t.enter().append("g").classed(T.cn.axisExtentBottom,!0),_t.attr("transform",function(vt){return o(0,vt.model.height+T.axisExtentOffset)});var wt=_t.selectAll("."+T.cn.axisExtentBottomText).data(c,f);wt.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(U),wt.text(function(vt){return oe(vt,!1)}).each(function(vt){i.font(h.select(this),vt.model.rangeFont)}),l.ensureAxisBrush(bt,le,pe)}}}),PA=_e({"src/traces/parcoords/plot.js"(r,X){var h=UI(),x=yx(),S=CA().isVisible,k={};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=X.exports=function(n,i){var a=n._fullLayout,s=x(n,[],k);if(s){var f={},c={},v={},p={},T=a._size;i.forEach(function(E,_){var w=E[0].trace;v[_]=w.index;var m=p[_]=w.index;f[_]=n.data[m].dimensions,c[_]=n.data[m].dimensions.slice()});var l=function(E,_,w){var m=c[E][_],u=w.map(function(N){return N.slice()}),d="dimensions["+_+"].constraintrange",y=a._tracePreGUI[n._fullData[v[E]]._fullInput.uid];if(y[d]===void 0){var R=m.constraintrange;y[d]=R||null}var L=n._fullData[v[E]].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[d]=u,n.emit("plotly_restyle",[z,[p[E]]])},g=function(E){n.emit("plotly_hover",E)},b=function(E){n.emit("plotly_unhover",E)},A=function(E,_){var w=t(_,c[E].filter(S));f[E].sort(w),c[E].filter(function(m){return!S(m)}).sort(function(m){return c[E].indexOf(m)}).forEach(function(m){f[E].splice(f[E].indexOf(m),1),f[E].splice(c[E].indexOf(m),0,m)}),n.emit("plotly_restyle",[{dimensions:[f[E]]},[p[E]]])};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:b,axesMoved:A})}};r.reglPrecompiled=k}}),jI=_e({"src/traces/parcoords/base_plot.js"(ee){var X=mr(),h=xl().getModuleCalcData,x=PA(),S=Ol();ee.name="parcoords",ee.plot=function(k){var e=h(k.calcdata,"parcoords")[0];e.length&&x(k,e)},ee.clean=function(k,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())},ee.toSVG=function(k){var e=k._fullLayout._glimages,t=X.select(k).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(){X.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),VI=_e({"src/traces/parcoords/base_index.js"(ee,X){X.exports={attributes:AA(),supplyDefaults:II(),calc:DI(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:jI(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),qI=_e({"src/traces/parcoords/index.js"(ee,X){var h=VI();h.plot=PA(),X.exports=h}}),GI=_e({"lib/parcoords.js"(ee,X){X.exports=qI()}}),LA=_e({"src/traces/parcats/attributes.js"(ee,X){var h=po().extendFlat,x=Zs(),S=es(),k=tc(),{hovertemplateAttrs:e,templatefallbackAttrs:t}=fu(),r=hf().attributes,o=h({editType:"calc"},k("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"})});X.exports={domain:r({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:h({},x.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),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}}}),HI=_e({"src/traces/parcats/defaults.js"(ee,X){var h=kn(),x=ed().hasColorscale,S=Oa(),k=hf().defaults,e=Wh(),t=LA(),r=_x(),o=lo().isTypedArraySpec;function n(a,s,f,c,v){v("line.shape"),v("line.hovertemplate"),v("line.hovertemplatefallback");var p=v("line.color",c.colorway[0]);if(x(a,"line")&&h.isArrayOrTypedArray(p)){if(p.length)return v("line.colorscale"),S(a,s,c,v,{prefix:"line.",cLetter:"c"}),p.length;s.line.color=f}return 1/0}function i(a,s){function f(b,A){return h.coerce(a,s,t.dimensions,b,A)}var c=f("values"),v=f("visible");if(c&&c.length||(v=s.visible=!1),v){f("label"),f("displayindex",s._index);var p=a.categoryarray,T=h.isArrayOrTypedArray(p)&&p.length>0||o(p),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")}}X.exports=function(s,f,c,v){function p(b,A){return h.coerce(s,f,t,b,A)}var T=e(s,f,{name:"dimensions",handleItemDefaults:i}),l=n(s,f,c,v,p);k(f,v,p),(!Array.isArray(T)||!T.length)&&(f.visible=!1),r(f,T,"values",l),p("hoveron"),p("hovertemplate"),p("hovertemplatefallback"),p("arrangement"),p("bundlecolors"),p("sortpaths"),p("counts");var g=v.font;h.coerceFont(p,"labelfont",g,{overrideDflt:{size:Math.round(g.size)}}),h.coerceFont(p,"tickfont",g,{autoShadowDflt:!0,overrideDflt:{size:Math.round(g.size/1.2)}})}}}),$I=_e({"src/traces/parcats/calc.js"(ee,X){var h=hv().wrap,x=ed().hasColorscale,S=ko(),k=wd(),e=ri(),t=kn(),r=jn();X.exports=function(g,b){var A=t.filterVisible(b.dimensions);if(A.length===0)return[];var E=A.map(function(W){var ae;if(W.categoryorder==="trace")ae=null;else if(W.categoryorder==="array")ae=W.categoryarray;else{ae=k(W.values);for(var se=!0,Q=0;Q=l.length||g[l[b]]!==void 0)return!1;g[l[b]]=!0}return!0}}}),WI=_e({"src/traces/parcats/parcats.js"(ee,X){var h=mr(),x=(xm(),Lr(P0)).interpolateNumber,S=M_(),k=zf(),e=kn(),t=e.strTranslate,r=ri(),o=bs(),n=Au();function i(Q,me,ie,Y){var le=me._context.staticPlot,ue=Q.map(pe.bind(0,me,ie)),Te=Y.selectAll("g.parcatslayer").data([null]);Te.enter().append("g").attr("class","parcatslayer").style("pointer-events",le?"none":"all");var Fe=Te.selectAll("g.trace.parcats").data(ue,a),Ve=Fe.enter().append("g").attr("class","trace parcats");Fe.attr("transform",function(Ae){return t(Ae.x,Ae.y)}),Ve.append("g").attr("class","paths");var Xe=Fe.select("g.paths"),We=Xe.selectAll("path.path").data(function(Ae){return Ae.paths},a);We.attr("fill",function(Ae){return Ae.model.color});var it=We.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(Ae){return Ae.model.color}).attr("fill-opacity",0);g(it),We.attr("d",function(Ae){return Ae.svgD}),it.empty()||We.sort(f),We.exit().remove(),We.on("mouseover",c).on("mouseout",v).on("click",l),Ve.append("g").attr("class","dimensions");var yt=Fe.select("g.dimensions"),bt=yt.selectAll("g.dimension").data(function(Ae){return Ae.dimensions},a);bt.enter().append("g").attr("class","dimension"),bt.attr("transform",function(Ae){return t(Ae.x,0)}),bt.exit().remove();var mt=bt.selectAll("g.category").data(function(Ae){return Ae.categories},a),ht=mt.enter().append("g").attr("class","category");mt.attr("transform",function(Ae){return t(0,Ae.y)}),ht.append("rect").attr("class","catrect").attr("pointer-events","none"),mt.select("rect.catrect").attr("fill","none").attr("width",function(Ae){return Ae.width}).attr("height",function(Ae){return Ae.height}),E(ht);var qe=mt.selectAll("rect.bandrect").data(function(Ae){return Ae.bands},a);qe.each(function(){e.raiseToTop(this)}),qe.attr("fill",function(Ae){return Ae.color});var ze=qe.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(Ae){return Ae.color}).attr("fill-opacity",0);qe.attr("fill",function(Ae){return Ae.color}).attr("width",function(Ae){return Ae.width}).attr("height",function(Ae){return Ae.height}).attr("y",function(Ae){return Ae.y}).attr("cursor",function(Ae){return Ae.parcatsViewModel.arrangement==="fixed"?"default":Ae.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),w(ze),qe.exit().remove(),ht.append("text").attr("class","catlabel").attr("pointer-events","none"),mt.select("text.catlabel").attr("text-anchor",function(Ae){return s(Ae)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(Ae){return s(Ae)?Ae.width+5:-5}).attr("y",function(Ae){return Ae.height/2}).text(function(Ae){return Ae.model.categoryLabel}).each(function(Ae){r.font(h.select(this),Ae.parcatsViewModel.categorylabelfont),n.convertToTspans(h.select(this),me)}),ht.append("text").attr("class","dimlabel"),mt.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(Ae){return Ae.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(Ae){return Ae.width/2}).attr("y",-5).text(function(Ae,Ke){return Ke===0?Ae.parcatsViewModel.model.dimensions[Ae.model.dimensionInd].dimensionLabel:null}).each(function(Ae){r.font(h.select(this),Ae.parcatsViewModel.labelfont)}),mt.selectAll("rect.bandrect").on("mouseover",U).on("mouseout",B),mt.exit().remove(),bt.call(h.behavior.drag().origin(function(Ae){return{x:Ae.x,y:0}}).on("dragstart",D).on("drag",j).on("dragend",q)),Fe.each(function(Ae){Ae.traceSelection=h.select(this),Ae.pathSelection=h.select(this).selectAll("g.paths").selectAll("path.path"),Ae.dimensionSelection=h.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),Fe.exit().remove()}X.exports=function(Q,me,ie,Y){i(ie,Q,Y,me)};function a(Q){return Q.key}function s(Q){var me=Q.parcatsViewModel.dimensions.length,ie=Q.parcatsViewModel.dimensions[me-1].model.dimensionInd;return Q.model.dimensionInd===ie}function f(Q,me){return Q.model.rawColor>me.model.rawColor?1:Q.model.rawColor"),vt=h.mouse(le)[0];k.loneHover({trace:ue,x:mt-Fe.left+Ve.left,y:ht-Fe.top+Ve.top,text:wt,color:Q.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:qe,idealAlign:vt1&&Xe.displayInd===Ve.dimensions.length-1?(yt=Te.left,bt="left"):(yt=Te.left+Te.width,bt="right");var mt=Fe.model.count,ht=Fe.model.categoryLabel,qe=mt/Fe.parcatsViewModel.model.count,ze={countLabel:mt,categoryLabel:ht,probabilityLabel:qe.toFixed(3)},Ae=[];Fe.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&Ae.push(["Count:",ze.countLabel].join(" ")),Fe.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&Ae.push(["P("+ze.categoryLabel+"):",ze.probabilityLabel].join(" "));var Ke=Ae.join("
");return{trace:We,x:Y*(yt-me.left),y:le*(it-me.top),text:Ke,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:bt,hovertemplate:We.hovertemplate,hovertemplateLabels:ze,eventData:[{data:We._input,fullData:We,count:mt,category:ht,probability:qe}]}}function z(Q,me,ie){var Y=[];return h.select(ie.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var le=this;Y.push(L(Q,me,le))}),Y}function N(Q,me,ie){Q._fullLayout._calcInverseTransform(Q);var Y=Q._fullLayout._invScaleX,le=Q._fullLayout._invScaleY,ue=ie.getBoundingClientRect(),Te=h.select(ie).datum(),Fe=Te.categoryViewModel,Ve=Fe.parcatsViewModel,Xe=Ve.model.dimensions[Fe.model.dimensionInd],We=Ve.trace,it=ue.y+ue.height/2,yt,bt;Ve.dimensions.length>1&&Xe.displayInd===Ve.dimensions.length-1?(yt=ue.left,bt="left"):(yt=ue.left+ue.width,bt="right");var mt=Fe.model.categoryLabel,ht=Te.parcatsViewModel.model.count,qe=0;Te.categoryViewModel.bands.forEach(function(dr){dr.color===Te.color&&(qe+=dr.count)});var ze=Fe.model.count,Ae=0;Ve.pathSelection.each(function(dr){dr.model.color===Te.color&&(Ae+=dr.model.count)});var Ke=qe/ht,_t=qe/Ae,wt=qe/ze,vt={countLabel:qe,categoryLabel:mt,probabilityLabel:Ke.toFixed(3)},$t=[];Fe.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&$t.push(["Count:",vt.countLabel].join(" ")),Fe.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&($t.push("P(color ∩ "+mt+"): "+vt.probabilityLabel),$t.push("P("+mt+" | color): "+_t.toFixed(3)),$t.push("P(color | "+mt+"): "+wt.toFixed(3)));var Yt=$t.join("
"),lr=o.mostReadable(Te.color,["black","white"]);return{trace:We,x:Y*(yt-me.left),y:le*(it-me.top),text:Yt,color:Te.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:lr,fontSize:10,idealAlign:bt,hovertemplate:We.hovertemplate,hovertemplateLabels:vt,eventData:[{data:We._input,fullData:We,category:mt,count:ht,probability:Ke,categorycount:ze,colorcount:Ae,bandcolorcount:qe}]}}function U(Q){if(!Q.parcatsViewModel.dragDimension&&Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var me=h.mouse(this)[1];if(me<-1)return;var ie=Q.parcatsViewModel.graphDiv,Y=ie._fullLayout,le=Y._paperdiv.node().getBoundingClientRect(),ue=Q.parcatsViewModel.hoveron,Te=this;if(ue==="color"?(d(Te),R(Te,"plotly_hover",h.event)):(u(Te),y(Te,"plotly_hover",h.event)),Q.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var Fe;ue==="category"?Fe=L(ie,le,Te):ue==="color"?Fe=N(ie,le,Te):ue==="dimension"&&(Fe=z(ie,le,Te)),Fe&&k.loneHover(Fe,{container:Y._hoverlayer.node(),outerContainer:Y._paper.node(),gd:ie})}}}function B(Q){var me=Q.parcatsViewModel;if(!me.dragDimension&&(g(me.pathSelection),E(me.dimensionSelection.selectAll("g.category")),w(me.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),k.loneUnhover(me.graphDiv._fullLayout._hoverlayer.node()),me.pathSelection.sort(f),me.hoverinfoItems.indexOf("skip")===-1)){var ie=Q.parcatsViewModel.hoveron,Y=this;ie==="color"?R(Y,"plotly_unhover",h.event):y(Y,"plotly_unhover",h.event)}}function D(Q){Q.parcatsViewModel.arrangement!=="fixed"&&(Q.dragDimensionDisplayInd=Q.model.displayInd,Q.initialDragDimensionDisplayInds=Q.parcatsViewModel.model.dimensions.map(function(me){return me.displayInd}),Q.dragHasMoved=!1,Q.dragCategoryDisplayInd=null,h.select(this).selectAll("g.category").select("rect.catrect").each(function(me){var ie=h.mouse(this)[0],Y=h.mouse(this)[1];-2<=ie&&ie<=me.width+2&&-2<=Y&&Y<=me.height+2&&(Q.dragCategoryDisplayInd=me.model.displayInd,Q.initialDragCategoryDisplayInds=Q.model.categories.map(function(le){return le.displayInd}),me.model.dragY=me.y,e.raiseToTop(this.parentNode),h.select(this.parentNode).selectAll("rect.bandrect").each(function(le){le.yWe.y+We.height/2&&(ue.model.displayInd=We.model.displayInd,We.model.displayInd=Fe),Q.dragCategoryDisplayInd=ue.model.displayInd}if(Q.dragCategoryDisplayInd===null||Q.parcatsViewModel.arrangement==="freeform"){le.model.dragX=h.event.x;var it=Q.parcatsViewModel.dimensions[ie],yt=Q.parcatsViewModel.dimensions[Y];it!==void 0&&le.model.dragXyt.x&&(le.model.displayInd=yt.model.displayInd,yt.model.displayInd=Q.dragDimensionDisplayInd),Q.dragDimensionDisplayInd=le.model.displayInd}ae(Q.parcatsViewModel),W(Q.parcatsViewModel),ye(Q.parcatsViewModel),oe(Q.parcatsViewModel)}}function q(Q){if(Q.parcatsViewModel.arrangement!=="fixed"&&Q.dragDimensionDisplayInd!==null){h.select(this).selectAll("text").attr("font-weight","normal");var me={},ie=J(Q.parcatsViewModel),Y=Q.parcatsViewModel.model.dimensions.map(function(yt){return yt.displayInd}),le=Q.initialDragDimensionDisplayInds.some(function(yt,bt){return yt!==Y[bt]});le&&Y.forEach(function(yt,bt){var mt=Q.parcatsViewModel.model.dimensions[bt].containerInd;me["dimensions["+mt+"].displayindex"]=yt});var ue=!1;if(Q.dragCategoryDisplayInd!==null){var Te=Q.model.categories.map(function(yt){return yt.displayInd});if(ue=Q.initialDragCategoryDisplayInds.some(function(yt,bt){return yt!==Te[bt]}),ue){var Fe=Q.model.categories.slice().sort(function(yt,bt){return yt.displayInd-bt.displayInd}),Ve=Fe.map(function(yt){return yt.categoryValue}),Xe=Fe.map(function(yt){return yt.categoryLabel});me["dimensions["+Q.model.containerInd+"].categoryarray"]=[Ve],me["dimensions["+Q.model.containerInd+"].ticktext"]=[Xe],me["dimensions["+Q.model.containerInd+"].categoryorder"]="array"}}if(Q.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!Q.dragHasMoved&&Q.potentialClickBand&&(Q.parcatsViewModel.hoveron==="color"?R(Q.potentialClickBand,"plotly_click",h.event.sourceEvent):y(Q.potentialClickBand,"plotly_click",h.event.sourceEvent)),Q.model.dragX=null,Q.dragCategoryDisplayInd!==null){var We=Q.parcatsViewModel.dimensions[Q.dragDimensionDisplayInd].categories[Q.dragCategoryDisplayInd];We.model.dragY=null,Q.dragCategoryDisplayInd=null}Q.dragDimensionDisplayInd=null,Q.parcatsViewModel.dragDimension=null,Q.dragHasMoved=null,Q.potentialClickBand=null,ae(Q.parcatsViewModel),W(Q.parcatsViewModel);var it=h.transition().duration(300).ease("cubic-in-out");it.each(function(){ye(Q.parcatsViewModel,!0),oe(Q.parcatsViewModel,!0)}).each("end",function(){(le||ue)&&S.restyle(Q.parcatsViewModel.graphDiv,me,[ie])})}}function J(Q){for(var me,ie=Q.graphDiv._fullData,Y=0;Y=0;Ve--)Xe+="C"+Te[Ve]+","+(me[Ve+1]+Y)+" "+ue[Ve]+","+(me[Ve]+Y)+" "+(Q[Ve]+ie[Ve])+","+(me[Ve]+Y),Xe+="l-"+ie[Ve]+",0 ";return Xe+="Z",Xe}function W(Q){var me=Q.dimensions,ie=Q.model,Y=me.map(function(ln){return ln.categories.map(function(zr){return zr.y})}),le=Q.model.dimensions.map(function(ln){return ln.categories.map(function(zr){return zr.displayInd})}),ue=Q.model.dimensions.map(function(ln){return ln.displayInd}),Te=Q.dimensions.map(function(ln){return ln.model.dimensionInd}),Fe=me.map(function(ln){return ln.x}),Ve=me.map(function(ln){return ln.width}),Xe=[];for(var We in ie.paths)ie.paths.hasOwnProperty(We)&&Xe.push(ie.paths[We]);function it(ln){var zr=ln.categoryInds.map(function(Ot,Qe){return le[Qe][Ot]}),Xr=Te.map(function(Ot){return zr[Ot]});return Xr}Xe.sort(function(ln,zr){var Xr=it(ln),Ot=it(zr);return Q.sortpaths==="backward"&&(Xr.reverse(),Ot.reverse()),Xr.push(ln.valueInds[0]),Ot.push(zr.valueInds[0]),Q.bundlecolors&&(Xr.unshift(ln.rawColor),Ot.unshift(zr.rawColor)),XrOt?1:0});for(var yt=new Array(Xe.length),bt=me[0].model.count,mt=me[0].categories.map(function(ln){return ln.height}).reduce(function(ln,zr){return ln+zr}),ht=0;ht0?ze=mt*(qe.count/bt):ze=0;for(var Ae=new Array(Y.length),Ke=0;Ke1?Te=(Q.width-2*ie-Y)/(le-1):Te=0,Fe=ie,Ve=Fe+Te*ue;var Xe=[],We=Q.model.maxCats,it=me.categories.length,yt=8,bt=me.count,mt=Q.height-yt*(We-1),ht,qe,ze,Ae,Ke,_t=(We-it)*yt/2,wt=me.categories.map(function(vt){return{displayInd:vt.displayInd,categoryInd:vt.categoryInd}});for(wt.sort(function(vt,$t){return vt.displayInd-$t.displayInd}),Ke=0;Ke0?ht=qe.count/bt*mt:ht=0,ze={key:qe.valueInds[0],model:qe,width:Y,height:ht,y:qe.dragY!==null?qe.dragY:_t,bands:[],parcatsViewModel:Q},_t=_t+ht+yt,Xe.push(ze);return{key:me.dimensionInd,x:me.dragX!==null?me.dragX:Ve,y:0,width:Y,model:me,categories:Xe,parcatsViewModel:Q,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),IA=_e({"src/traces/parcats/plot.js"(ee,X){var h=WI();X.exports=function(S,k,e,t){var r=S._fullLayout,o=r._paper,n=r._size;h(S,o,k,{width:n.w,height:n.h,margin:{t:n.t,r:n.r,b:n.b,l:n.l}},e,t)}}}),YI=_e({"src/traces/parcats/base_plot.js"(ee){var X=xl().getModuleCalcData,h=IA(),x="parcats";ee.name=x,ee.plot=function(S,k,e,t){var r=X(S.calcdata,x);if(r.length){var o=r[0];h(S,o,e,t)}},ee.clean=function(S,k,e,t){var r=t._has&&t._has("parcats"),o=k._has&&k._has("parcats");r&&!o&&t._paperdiv.selectAll(".parcats").remove()}}}),XI=_e({"src/traces/parcats/index.js"(ee,X){X.exports={attributes:LA(),supplyDefaults:HI(),calc:$I(),plot:IA(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:YI(),categories:["noOpacity"],meta:{}}}}),ZI=_e({"lib/parcats.js"(ee,X){X.exports=XI()}}),qv=_e({"src/plots/mapbox/constants.js"(ee,X){var h=ec(),x="1.13.4",S='© OpenStreetMap contributors',k=['© 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:k,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:k,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);X.exports={requiredVersion:x,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:o,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+x+"."].join(` `),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join(` `),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",o.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join(` `),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join(` `),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":`content: ""; cursor: pointer; position: absolute; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;`,"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":`display:block; width: 21px; height: 21px; background-image: url('data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E')`}}}}),w1=_e({"src/plots/mapbox/layout_attributes.js"(ee,X){var h=kn(),x=so().defaultLine,S=hf().attributes,k=es(),e=Ff().textposition,t=nc().overrideAll,r=ou().templatedArray,o=qv(),n=k({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=X.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:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:h.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),wx=_e({"src/traces/scattermapbox/attributes.js"(ee,X){var{hovertemplateAttrs:h,texttemplateAttrs:x,templatefallbackAttrs:S}=fu(),k=Np(),e=Tm(),t=Ff(),r=w1(),o=Zs(),n=tc(),i=po().extendFlat,a=nc().overrideAll,s=w1(),f=e.line,c=e.marker;X.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:x({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:k(),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")}}),DA=_e({"src/traces/scattermapbox/constants.js"(ee,X){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"];X.exports={isSupportedFont:function(x){return h.indexOf(x)!==-1}}}}),KI=_e({"src/traces/scattermapbox/defaults.js"(ee,X){var h=kn(),x=Ps(),S=lp(),k=yp(),e=_p(),t=Up(),r=wx(),o=DA().isSupportedFont;X.exports=function(a,s,f,c){function v(d,y){return h.coerce(a,s,r,d,y)}function p(d,y){return h.coerce2(a,s,r,d,y)}var T=n(a,s,v);if(!T){s.visible=!1;return}if(v("text"),v("texttemplate"),v("texttemplatefallback"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),v("mode"),v("below"),x.hasMarkers(s)){S(a,s,f,c,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("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]))}x.hasLines(s)&&(k(a,s,f,c,v,{noDash:!0}),v("connectgaps"));var g=p("cluster.maxzoom"),b=p("cluster.step"),A=p("cluster.color",s.marker&&s.marker.color||f),E=p("cluster.size"),_=p("cluster.opacity"),w=g!==!1||b!==!1||A!==!1||E!==!1||_!==!1,m=v("cluster.enabled",w);if(m||x.hasText(s)){var u=c.font.family;e(a,s,c,v,{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}})}v("fill"),s.fill!=="none"&&t(a,s,f,v),h.coerceSelectionMarkerOpacity(s,v)};function n(i,a,s){var f=s("lon")||[],c=s("lat")||[],v=Math.min(f.length,c.length);return a._length=v,v}}}),RA=_e({"src/traces/scattermapbox/format_labels.js"(ee,X){var h=xs();X.exports=function(S,k,e){var t={},r=e[k.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}}}),OA=_e({"src/plots/mapbox/convert_text_opts.js"(ee,X){var h=kn();X.exports=function(S,k){var e=S.split(" "),t=e[0],r=e[1],o=h.isArrayOrTypedArray(k)?h.mean(k):k,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}}}}),JI=_e({"src/traces/scattermapbox/convert.js"(ee,X){var h=jn(),x=kn(),S=qn().BADNUM,k=D0(),e=Ho(),t=ri(),r=bu(),o=Ps(),n=DA().isSupportedFont,i=OA(),a=rc().appendArrayPointValue,s=Au().NEWLINES,f=Au().BR_TAG_ALL;X.exports=function(_,w){var m=w[0].trace,u=m.visible===!0&&m._length!==0,d=m.fill!=="none",y=o.hasLines(m),R=o.hasMarkers(m),L=o.hasText(m),z=R&&m.marker.symbol==="circle",N=R&&m.marker.symbol!=="circle",U=m.cluster&&m.cluster.enabled,B=c("fill"),D=c("line"),j=c("circle"),q=c("symbol"),J={fill:B,line:D,circle:j,symbol:q};if(!u)return J;var oe;if((d||y)&&(oe=k.calcTraceToLineCoords(w)),d&&(B.geojson=k.makePolygon(oe),B.layout.visibility="visible",x.extendFlat(B.paint,{"fill-color":m.fillcolor})),y&&(D.geojson=k.makeLine(oe),D.layout.visibility="visible",x.extendFlat(D.paint,{"line-width":m.line.width,"line-color":m.line.color,"line-opacity":m.opacity})),z){var ye=v(w);j.geojson=ye.geojson,j.layout.visibility="visible",U&&(j.filter=["!",["has","point_count"]],J.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":b(m.cluster.color,m.cluster.step),"circle-radius":b(m.cluster.size,m.cluster.step),"circle-opacity":b(m.cluster.opacity,m.cluster.step)}},J.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":A(m),"text-size":12}}),x.extendFlat(j.paint,{"circle-color":ye.mcc,"circle-radius":ye.mrc,"circle-opacity":ye.mo})}if(z&&U&&(j.filter=["!",["has","point_count"]]),(N||L)&&(q.geojson=p(w,_),x.extendFlat(q.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),N&&(x.extendFlat(q.layout,{"icon-size":m.marker.size/10}),"angle"in m.marker&&m.marker.angle!=="auto"&&x.extendFlat(q.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),q.layout["icon-allow-overlap"]=m.marker.allowoverlap,x.extendFlat(q.paint,{"icon-opacity":m.opacity*m.marker.opacity,"icon-color":m.marker.color})),L)){var pe=(m.marker||{}).size,ge=i(m.textposition,pe);x.extendFlat(q.layout,{"text-size":m.textfont.size,"text-anchor":ge.anchor,"text-offset":ge.offset,"text-font":A(m)}),x.extendFlat(q.paint,{"text-color":m.textfont.color,"text-opacity":m.opacity})}return J};function c(E){return{type:E,geojson:k.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function v(E){var _=E[0].trace,w=_.marker,m=_.selectedpoints,u=x.isArrayOrTypedArray(w.color),d=x.isArrayOrTypedArray(w.size),y=x.isArrayOrTypedArray(w.opacity),R;function L(pe){return _.opacity*pe}function z(pe){return pe/2}var N;u&&(e.hasColorscale(_,"marker")?N=e.makeColorScaleFuncFromTrace(w):N=x.identity);var U;d&&(U=r(_));var B;y&&(B=function(pe){var ge=h(pe)?+x.constrain(pe,0,1):0;return L(ge)});var D=[];for(R=0;R850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):d.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):d.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",d[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),y&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),n(R)||(R=w);var L=R.split(", ");return L}}}),QI=_e({"src/traces/scattermapbox/plot.js"(ee,X){var h=kn(),x=JI(),S=qv().traceLayerPrefix,k={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 R=d[y];a.removeLayer(p.layerIds[R])}u||a.removeSource(p.sourceIds.circle)}function g(u){for(var d=k.nonCluster,y=0;y=0;y--){var R=d[y];a.removeLayer(p.layerIds[R]),u||a.removeSource(p.sourceIds[R])}}function A(u){v?l(u):b(u)}function E(u){c?T(u):g(u)}function _(){for(var u=c?k.cluster:k.nonCluster,d=0;d=0;i--){var a=n[i];o.removeLayer(this.layerIds[a]),o.removeSource(this.sourceIds[a])}},X.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=x(o.gd,n),v=f.below=o.belowLookup["trace-"+i.uid],p,T,l;if(a)for(f.addSource("circle",c.circle,i.cluster),p=0;p=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),E=A*360,_=i-E;function w(U){var B=U.lonlat;if(B[0]===e||g&&T.indexOf(U.i+1)===-1)return 1/0;var D=x.modHalf(B[0],360),j=B[1],q=p.project([D,j]),J=q.x-c.c2p([_,j]),oe=q.y-v.c2p([D,a]),ye=Math.max(3,U.mrc||0);return Math.max(Math.sqrt(J*J+oe*oe)-ye,1-3/ye)}if(h.getClosest(s,w,n),n.index!==!1){var m=s[n.index],u=m.lonlat,d=[x.modHalf(u[0],360)+E,u[1]],y=c.c2p(d),R=v.c2p(d),L=m.mrc||1;n.x0=y-L,n.x1=y+L,n.y0=R-L,n.y1=R+L;var z={};z[f.subplot]={_subplot:p};var N=f._module.formatLabels(m,f,z);return n.lonLabel=N.lonLabel,n.latLabel=N.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,v=f.indexOf("lon")!==-1,p=f.indexOf("lat")!==-1,T=i.lonlat,l=[];function g(b){return b+"°"}return c||v&&p?l.push("("+g(T[1])+", "+g(T[0])+")"):v?l.push(a.lon+g(T[0])):p&&l.push(a.lat+g(T[1])),(c||f.indexOf("text")!==-1)&&k(i,n,l),l.join("
")}X.exports={hoverPoints:r,getExtraText:o}}}),eD=_e({"src/traces/scattermapbox/event_data.js"(ee,X){X.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x}}}),tD=_e({"src/traces/scattermapbox/select.js"(ee,X){var h=kn(),x=Ps(),S=qn().BADNUM;X.exports=function(e,t){var r=e.cd,o=e.xaxis,n=e.yaxis,i=[],a=r[0].trace,s;if(!x.hasMarkers(a))return[];if(t===!1)for(s=0;s"u"&&(P=1e-6);var Z,de,Oe,$e,nt;for(Oe=C,nt=0;nt<8;nt++){if($e=this.sampleCurveX(Oe)-C,Math.abs($e)de)return de;for(;Z$e?Z=Oe:de=Oe,Oe=(de-Z)*.5+Z}return Oe},n.prototype.solve=function(C,P){return this.sampleCurveY(this.solveCurveX(C,P))};var i=a;function a(C,P){this.x=C,this.y=P}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(C){return this.clone()._add(C)},sub:function(C){return this.clone()._sub(C)},multByPoint:function(C){return this.clone()._multByPoint(C)},divByPoint:function(C){return this.clone()._divByPoint(C)},mult:function(C){return this.clone()._mult(C)},div:function(C){return this.clone()._div(C)},rotate:function(C){return this.clone()._rotate(C)},rotateAround:function(C,P){return this.clone()._rotateAround(C,P)},matMult:function(C){return this.clone()._matMult(C)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(C){return this.x===C.x&&this.y===C.y},dist:function(C){return Math.sqrt(this.distSqr(C))},distSqr:function(C){var P=C.x-this.x,Z=C.y-this.y;return P*P+Z*Z},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(C){return Math.atan2(this.y-C.y,this.x-C.x)},angleWith:function(C){return this.angleWithSep(C.x,C.y)},angleWithSep:function(C,P){return Math.atan2(this.x*P-this.y*C,this.x*C+this.y*P)},_matMult:function(C){var P=C[0]*this.x+C[1]*this.y,Z=C[2]*this.x+C[3]*this.y;return this.x=P,this.y=Z,this},_add:function(C){return this.x+=C.x,this.y+=C.y,this},_sub:function(C){return this.x-=C.x,this.y-=C.y,this},_mult:function(C){return this.x*=C,this.y*=C,this},_div:function(C){return this.x/=C,this.y/=C,this},_multByPoint:function(C){return this.x*=C.x,this.y*=C.y,this},_divByPoint:function(C){return this.x/=C.x,this.y/=C.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var C=this.y;return this.y=this.x,this.x=-C,this},_rotate:function(C){var P=Math.cos(C),Z=Math.sin(C),de=P*this.x-Z*this.y,Oe=Z*this.x+P*this.y;return this.x=de,this.y=Oe,this},_rotateAround:function(C,P){var Z=Math.cos(C),de=Math.sin(C),Oe=P.x+Z*(this.x-P.x)-de*(this.y-P.y),$e=P.y+de*(this.x-P.x)+Z*(this.y-P.y);return this.x=Oe,this.y=$e,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(C){return C instanceof a?C:Array.isArray(C)?new a(C[0],C[1]):C};var s=typeof self<"u"?self:{};function f(C,P){if(Array.isArray(C)){if(!Array.isArray(P)||C.length!==P.length)return!1;for(var Z=0;Z=1)return 1;var P=C*C,Z=P*C;return 4*(C<.5?Z:3*(C-P)+Z-.75)}function p(C,P,Z,de){var Oe=new o(C,P,Z,de);return function($e){return Oe.solve($e)}}var T=p(.25,.1,.25,1);function l(C,P,Z){return Math.min(Z,Math.max(P,C))}function g(C,P,Z){var de=Z-P,Oe=((C-P)%de+de)%de+P;return Oe===P?Z:Oe}function b(C,P,Z){if(!C.length)return Z(null,[]);var de=C.length,Oe=new Array(C.length),$e=null;C.forEach(function(nt,Et){P(nt,function(Zt,hr){Zt&&($e=Zt),Oe[Et]=hr,--de===0&&Z($e,Oe)})})}function A(C){var P=[];for(var Z in C)P.push(C[Z]);return P}function E(C,P){var Z=[];for(var de in C)de in P||Z.push(de);return Z}function _(C){for(var P=[],Z=arguments.length-1;Z-- >0;)P[Z]=arguments[Z+1];for(var de=0,Oe=P;de>P/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,C)}return C()}function y(C){return C<=1?1:Math.pow(2,Math.ceil(Math.log(C)/Math.LN2))}function R(C){return C?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(C):!1}function L(C,P){C.forEach(function(Z){P[Z]&&(P[Z]=P[Z].bind(P))})}function z(C,P){return C.indexOf(P,C.length-P.length)!==-1}function N(C,P,Z){var de={};for(var Oe in C)de[Oe]=P.call(Z||this,C[Oe],Oe,C);return de}function U(C,P,Z){var de={};for(var Oe in C)P.call(Z||this,C[Oe],Oe,C)&&(de[Oe]=C[Oe]);return de}function B(C){return Array.isArray(C)?C.map(B):typeof C=="object"&&C?N(C,B):C}function D(C,P){for(var Z=0;Z=0)return!0;return!1}var j={};function q(C){j[C]||(typeof console<"u"&&console.warn(C),j[C]=!0)}function J(C,P,Z){return(Z.y-C.y)*(P.x-C.x)>(P.y-C.y)*(Z.x-C.x)}function oe(C){for(var P=0,Z=0,de=C.length,Oe=de-1,$e=void 0,nt=void 0;Z@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,Z={};if(C.replace(P,function(Oe,$e,nt,Et){var Zt=nt||Et;return Z[$e]=Zt?Zt.toLowerCase():!0,""}),Z["max-age"]){var de=parseInt(Z["max-age"],10);isNaN(de)?delete Z["max-age"]:Z["max-age"]=de}return Z}var W=null;function ae(C){if(W==null){var P=C.navigator?C.navigator.userAgent:null;W=!!C.safari||!!(P&&(/\b(iPad|iPhone|iPod)\b/.test(P)||P.match("Safari")&&!P.match("Chrome")))}return W}function se(C){try{var P=s[C];return P.setItem("_mapbox_test_",1),P.removeItem("_mapbox_test_"),!0}catch{return!1}}function Q(C){return s.btoa(encodeURIComponent(C).replace(/%([0-9A-F]{2})/g,function(P,Z){return String.fromCharCode(+("0x"+Z))}))}function me(C){return decodeURIComponent(s.atob(C).split("").map(function(P){return"%"+("00"+P.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ie=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),Y=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,le=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,ue,Te,Fe={now:ie,frame:function(P){var Z=Y(P);return{cancel:function(){return le(Z)}}},getImageData:function(P,Z){Z===void 0&&(Z=0);var de=s.document.createElement("canvas"),Oe=de.getContext("2d");if(!Oe)throw new Error("failed to create canvas 2d context");return de.width=P.width,de.height=P.height,Oe.drawImage(P,0,0,P.width,P.height),Oe.getImageData(-Z,-Z,P.width+2*Z,P.height+2*Z)},resolveURL:function(P){return ue||(ue=s.document.createElement("a")),ue.href=P,ue.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(Te==null&&(Te=s.matchMedia("(prefers-reduced-motion: reduce)")),Te.matches):!1}},Ve={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},Xe={supported:!1,testSupport:mt},We,it=!1,yt,bt=!1;s.document&&(yt=s.document.createElement("img"),yt.onload=function(){We&&ht(We),We=null,bt=!0},yt.onerror=function(){it=!0,We=null},yt.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function mt(C){it||!yt||(bt?ht(C):We=C)}function ht(C){var P=C.createTexture();C.bindTexture(C.TEXTURE_2D,P);try{if(C.texImage2D(C.TEXTURE_2D,0,C.RGBA,C.RGBA,C.UNSIGNED_BYTE,yt),C.isContextLost())return;Xe.supported=!0}catch{}C.deleteTexture(P),it=!0}var qe="01";function ze(){for(var C="1",P="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",Z="",de=0;de<10;de++)Z+=P[Math.floor(Math.random()*62)];var Oe=12*60*60*1e3,$e=[C,qe,Z].join(""),nt=Date.now()+Oe;return{token:$e,tokenExpiresAt:nt}}var Ae=function(P,Z){this._transformRequestFn=P,this._customAccessToken=Z,this._createSkuToken()};Ae.prototype._createSkuToken=function(){var P=ze();this._skuToken=P.token,this._skuTokenExpiresAt=P.tokenExpiresAt},Ae.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Ae.prototype.transformRequest=function(P,Z){return this._transformRequestFn?this._transformRequestFn(P,Z)||{url:P}:{url:P}},Ae.prototype.normalizeStyleURL=function(P,Z){if(!Ke(P))return P;var de=lr(P);return de.path="/styles/v1"+de.path,this._makeAPIURL(de,this._customAccessToken||Z)},Ae.prototype.normalizeGlyphsURL=function(P,Z){if(!Ke(P))return P;var de=lr(P);return de.path="/fonts/v1"+de.path,this._makeAPIURL(de,this._customAccessToken||Z)},Ae.prototype.normalizeSourceURL=function(P,Z){if(!Ke(P))return P;var de=lr(P);return de.path="/v4/"+de.authority+".json",de.params.push("secure"),this._makeAPIURL(de,this._customAccessToken||Z)},Ae.prototype.normalizeSpriteURL=function(P,Z,de,Oe){var $e=lr(P);return Ke(P)?($e.path="/styles/v1"+$e.path+"/sprite"+Z+de,this._makeAPIURL($e,this._customAccessToken||Oe)):($e.path+=""+Z+de,dr($e))},Ae.prototype.normalizeTileURL=function(P,Z){if(this._isSkuTokenExpired()&&this._createSkuToken(),P&&!Ke(P))return P;var de=lr(P),Oe=/(\.(png|jpg)\d*)(?=$)/,$e=/^.+\/v4\//,nt=Fe.devicePixelRatio>=2||Z===512?"@2x":"",Et=Xe.supported?".webp":"$1";de.path=de.path.replace(Oe,""+nt+Et),de.path=de.path.replace($e,"/"),de.path="/v4"+de.path;var Zt=this._customAccessToken||$t(de.params)||Ve.ACCESS_TOKEN;return Ve.REQUIRE_ACCESS_TOKEN&&Zt&&this._skuToken&&de.params.push("sku="+this._skuToken),this._makeAPIURL(de,Zt)},Ae.prototype.canonicalizeTileURL=function(P,Z){var de="/v4/",Oe=/\.[\w]+$/,$e=lr(P);if(!$e.path.match(/(^\/v4\/)/)||!$e.path.match(Oe))return P;var nt="mapbox://tiles/";nt+=$e.path.replace(de,"");var Et=$e.params;return Z&&(Et=Et.filter(function(Zt){return!Zt.match(/^access_token=/)})),Et.length&&(nt+="?"+Et.join("&")),nt},Ae.prototype.canonicalizeTileset=function(P,Z){for(var de=Z?Ke(Z):!1,Oe=[],$e=0,nt=P.tiles||[];$e=0&&P.params.splice($e,1)}if(Oe.path!=="/"&&(P.path=""+Oe.path+P.path),!Ve.REQUIRE_ACCESS_TOKEN)return dr(P);if(Z=Z||Ve.ACCESS_TOKEN,!Z)throw new Error("An API access token is required to use Mapbox GL. "+de);if(Z[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+de);return P.params=P.params.filter(function(nt){return nt.indexOf("access_token")===-1}),P.params.push("access_token="+Z),dr(P)};function Ke(C){return C.indexOf("mapbox:")===0}var _t=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function wt(C){return _t.test(C)}function vt(C){return C.indexOf("sku=")>0&&wt(C)}function $t(C){for(var P=0,Z=C;P=1&&s.localStorage.setItem(Z,JSON.stringify(this.eventData))}catch{q("Unable to write to LocalStorage")}},ln.prototype.processRequests=function(P){},ln.prototype.postEvent=function(P,Z,de,Oe){var $e=this;if(Ve.EVENTS_URL){var nt=lr(Ve.EVENTS_URL);nt.params.push("access_token="+(Oe||Ve.ACCESS_TOKEN||""));var Et={event:this.type,created:new Date(P).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:qe,userId:this.anonId},Zt=Z?_(Et,Z):Et,hr={url:dr(nt),headers:{"Content-Type":"text/plain"},body:JSON.stringify([Zt])};this.pendingRequest=In(hr,function(wr){$e.pendingRequest=null,de(wr),$e.saveEventData(),$e.processRequests(Oe)})}},ln.prototype.queueRequest=function(P,Z){this.queue.push(P),this.processRequests(Z)};var zr=function(C){function P(){C.call(this,"map.load"),this.success={},this.skuToken=""}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.postMapLoadEvent=function(de,Oe,$e,nt){this.skuToken=$e,(Ve.EVENTS_URL&&nt||Ve.ACCESS_TOKEN&&Array.isArray(de)&&de.some(function(Et){return Ke(Et)||wt(Et)}))&&this.queueRequest({id:Oe,timestamp:Date.now()},nt)},P.prototype.processRequests=function(de){var Oe=this;if(!(this.pendingRequest||this.queue.length===0)){var $e=this.queue.shift(),nt=$e.id,Et=$e.timestamp;nt&&this.success[nt]||(this.anonId||this.fetchEventData(),R(this.anonId)||(this.anonId=d()),this.postEvent(Et,{skuToken:this.skuToken},function(Zt){Zt||nt&&(Oe.success[nt]=!0)},de))}},P}(ln),Xr=function(C){function P(Z){C.call(this,"appUserTurnstile"),this._customAccessToken=Z}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.postTurnstileEvent=function(de,Oe){Ve.EVENTS_URL&&Ve.ACCESS_TOKEN&&Array.isArray(de)&&de.some(function($e){return Ke($e)||wt($e)})&&this.queueRequest(Date.now(),Oe)},P.prototype.processRequests=function(de){var Oe=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var $e=Fr(Ve.ACCESS_TOKEN),nt=$e?$e.u:Ve.ACCESS_TOKEN,Et=nt!==this.eventData.tokenU;R(this.anonId)||(this.anonId=d(),Et=!0);var Zt=this.queue.shift();if(this.eventData.lastSuccess){var hr=new Date(this.eventData.lastSuccess),wr=new Date(Zt),Wr=(Zt-this.eventData.lastSuccess)/(24*60*60*1e3);Et=Et||Wr>=1||Wr<-1||hr.getDate()!==wr.getDate()}else Et=!0;if(!Et)return this.processRequests();this.postEvent(Zt,{"enabled.telemetry":!1},function(dn){dn||(Oe.eventData.lastSuccess=Zt,Oe.eventData.tokenU=nt)},de)}},P}(ln),Ot=new Xr,Qe=Ot.postTurnstileEvent.bind(Ot),ct=new zr,Ue=ct.postMapLoadEvent.bind(ct),Ie="mapbox-tiles",Pe=500,Be=50,at=1e3*60*7,ft;function Bt(){s.caches&&!ft&&(ft=s.caches.open(Ie))}var Nt;function Ht(C,P){if(Nt===void 0)try{new Response(new ReadableStream),Nt=!0}catch{Nt=!1}Nt?P(C.body):C.blob().then(P)}function or(C,P,Z){if(Bt(),!!ft){var de={status:P.status,statusText:P.statusText,headers:new s.Headers};P.headers.forEach(function(nt,Et){return de.headers.set(Et,nt)});var Oe=ge(P.headers.get("Cache-Control")||"");if(!Oe["no-store"]){Oe["max-age"]&&de.headers.set("Expires",new Date(Z+Oe["max-age"]*1e3).toUTCString());var $e=new Date(de.headers.get("Expires")).getTime()-Z;$eDate.now()&&!Z["no-cache"]}var Yr=1/0;function Fn(C){Yr++,Yr>Be&&(C.getActor().send("enforceCacheSizeLimit",Pe),Yr=0)}function ua(C){Bt(),ft&&ft.then(function(P){P.keys().then(function(Z){for(var de=0;de=200&&Z.status<300||Z.status===0)&&Z.response!==null){var Oe=Z.response;if(C.type==="json")try{Oe=JSON.parse(Z.response)}catch($e){return P($e)}P(null,Oe,Z.getResponseHeader("Cache-Control"),Z.getResponseHeader("Expires"))}else P(new ti(Z.statusText,Z.status,C.url))},Z.send(C.body),{cancel:function(){return Z.abort()}}}var rn=function(C,P){if(!Kt(C.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return vr(C,P);if(pe()&&self.worker&&self.worker.actor){var Z=!0;return self.worker.actor.send("getResource",C,P,void 0,Z)}}return _r(C,P)},gn=function(C,P){return rn(_(C,{type:"json"}),P)},Mn=function(C,P){return rn(_(C,{type:"arrayBuffer"}),P)},In=function(C,P){return rn(_(C,{method:"POST"}),P)};function fa(C){var P=s.document.createElement("a");return P.href=C,P.protocol===s.document.location.protocol&&P.host===s.document.location.host}var Ca="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Ma(C,P,Z,de){var Oe=new s.Image,$e=s.URL;Oe.onload=function(){P(null,Oe),$e.revokeObjectURL(Oe.src),Oe.onload=null,s.requestAnimationFrame(function(){Oe.src=Ca})},Oe.onerror=function(){return P(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 nt=new s.Blob([new Uint8Array(C)],{type:"image/png"});Oe.cacheControl=Z,Oe.expires=de,Oe.src=C.byteLength?$e.createObjectURL(nt):Ca}function Da(C,P){var Z=new s.Blob([new Uint8Array(C)],{type:"image/png"});s.createImageBitmap(Z).then(function(de){P(null,de)}).catch(function(de){P(new Error("Could not load image because of "+de.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var Va,na,Mi=function(){Va=[],na=0};Mi();var Oi=function(C,P){if(Xe.supported&&(C.headers||(C.headers={}),C.headers.accept="image/webp,*/*"),na>=Ve.MAX_PARALLEL_IMAGE_REQUESTS){var Z={requestParameters:C,callback:P,cancelled:!1,cancel:function(){this.cancelled=!0}};return Va.push(Z),Z}na++;var de=!1,Oe=function(){if(!de)for(de=!0,na--;Va.length&&na0||this._oneTimeListeners&&this._oneTimeListeners[P]&&this._oneTimeListeners[P].length>0||this._eventedParent&&this._eventedParent.listens(P)},Gr.prototype.setEventedParent=function(P,Z){return this._eventedParent=P,this._eventedParentData=Z,this};var Jr=8,yn={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"}},cn={"*":{type:"source"}},Dt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],yr={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:"*"}},Hr={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:"*"}},_n={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:"*"}},Hn={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"}},ea={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"}}},Qn={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"}}},bn={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"}},$n=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],ki={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ua={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Fi={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ji={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},fo={"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"}},co={"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"}},So={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},wi={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ts={type:"array",value:"*"},jo={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},js={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},us={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Zo={type:"array",value:"*",minimum:1},No={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}},Vs=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Ns={"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"}},rl={"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"}},cs={"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"}},$o={"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"}},yo={"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"}},fs={"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"}},nl={"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"}},wl={"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"}},Ml={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Ts={"*":{type:"string"}},Ai={$version:Jr,$root:yn,sources:cn,source:Dt,source_vector:yr,source_raster:Hr,source_raster_dem:_n,source_geojson:Hn,source_video:ea,source_image:Qn,layer:bn,layout:$n,layout_background:ki,layout_fill:Ua,layout_circle:Fi,layout_heatmap:Ji,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:fo,layout_symbol:co,layout_raster:So,layout_hillshade:wi,filter:ts,filter_operator:jo,geometry_type:js,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:us,expression:Zo,light:No,paint:Vs,paint_fill:Ns,"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:rl,paint_circle:cs,paint_heatmap:$o,paint_symbol:yo,paint_raster:fs,paint_hillshade:nl,paint_background:wl,transition:Ml,"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:Ts},uo=function(P,Z,de,Oe){this.message=(P?P+": ":"")+de,Oe&&(this.identifier=Oe),Z!=null&&Z.__line__&&(this.line=Z.__line__)};function Tl(C){var P=C.key,Z=C.value;return Z?[new uo(P,Z,"constants have been deprecated as of v8")]:[]}function Cs(C){for(var P=[],Z=arguments.length-1;Z-- >0;)P[Z]=arguments[Z+1];for(var de=0,Oe=P;de":C.itemType.kind==="value"?"array":"array<"+P+">"}else return C.kind}var Ou=[mu,io,vs,rs,Bl,Ds,Ul,Il(Lo),vl];function qc(C,P){if(P.kind==="error")return null;if(C.kind==="array"){if(P.kind==="array"&&(P.N===0&&P.itemType.kind==="value"||!qc(C.itemType,P.itemType))&&(typeof C.N!="number"||C.N===P.N))return null}else{if(C.kind===P.kind)return null;if(C.kind==="value")for(var Z=0,de=Ou;Z255?255:hr}function Oe(hr){return hr<0?0:hr>1?1:hr}function $e(hr){return hr[hr.length-1]==="%"?de(parseFloat(hr)/100*255):de(parseInt(hr))}function nt(hr){return hr[hr.length-1]==="%"?Oe(parseFloat(hr)/100):Oe(parseFloat(hr))}function Et(hr,wr,Wr){return Wr<0?Wr+=1:Wr>1&&(Wr-=1),Wr*6<1?hr+(wr-hr)*Wr*6:Wr*2<1?wr:Wr*3<2?hr+(wr-hr)*(2/3-Wr)*6:hr}function Zt(hr){var wr=hr.replace(/ /g,"").toLowerCase();if(wr in Z)return Z[wr].slice();if(wr[0]==="#"){if(wr.length===4){var Wr=parseInt(wr.substr(1),16);return Wr>=0&&Wr<=4095?[(Wr&3840)>>4|(Wr&3840)>>8,Wr&240|(Wr&240)>>4,Wr&15|(Wr&15)<<4,1]:null}else if(wr.length===7){var Wr=parseInt(wr.substr(1),16);return Wr>=0&&Wr<=16777215?[(Wr&16711680)>>16,(Wr&65280)>>8,Wr&255,1]:null}return null}var dn=wr.indexOf("("),un=wr.indexOf(")");if(dn!==-1&&un+1===wr.length){var Pn=wr.substr(0,dn),ca=wr.substr(dn+1,un-(dn+1)).split(","),ei=1;switch(Pn){case"rgba":if(ca.length!==4)return null;ei=nt(ca.pop());case"rgb":return ca.length!==3?null:[$e(ca[0]),$e(ca[1]),$e(ca[2]),ei];case"hsla":if(ca.length!==4)return null;ei=nt(ca.pop());case"hsl":if(ca.length!==3)return null;var za=(parseFloat(ca[0])%360+360)%360/360,Ei=nt(ca[1]),fi=nt(ca[2]),Si=fi<=.5?fi*(Ei+1):fi+Ei-fi*Ei,zi=fi*2-Si;return[de(Et(zi,Si,za+1/3)*255),de(Et(zi,Si,za)*255),de(Et(zi,Si,za-1/3)*255),ei];default:return null}}return null}try{P.parseCSSColor=Zt}catch{}}),Hf=rh.parseCSSColor,ml=function(P,Z,de,Oe){Oe===void 0&&(Oe=1),this.r=P,this.g=Z,this.b=de,this.a=Oe};ml.parse=function(P){if(P){if(P instanceof ml)return P;if(typeof P=="string"){var Z=Hf(P);if(Z)return new ml(Z[0]/255*Z[3],Z[1]/255*Z[3],Z[2]/255*Z[3],Z[3])}}},ml.prototype.toString=function(){var P=this.toArray(),Z=P[0],de=P[1],Oe=P[2],$e=P[3];return"rgba("+Math.round(Z)+","+Math.round(de)+","+Math.round(Oe)+","+$e+")"},ml.prototype.toArray=function(){var P=this,Z=P.r,de=P.g,Oe=P.b,$e=P.a;return $e===0?[0,0,0,0]:[Z*255/$e,de*255/$e,Oe*255/$e,$e]},ml.black=new ml(0,0,0,1),ml.white=new ml(1,1,1,1),ml.transparent=new ml(0,0,0,0),ml.red=new ml(1,0,0,1);var vc=function(P,Z,de){P?this.sensitivity=Z?"variant":"case":this.sensitivity=Z?"accent":"base",this.locale=de,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};vc.prototype.compare=function(P,Z){return this.collator.compare(P,Z)},vc.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var nh=function(P,Z,de,Oe,$e){this.text=P,this.image=Z,this.scale=de,this.fontStack=Oe,this.textColor=$e},Gu=function(P){this.sections=P};Gu.fromString=function(P){return new Gu([new nh(P,null,null,null,null)])},Gu.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(P){return P.text.length!==0||P.image&&P.image.name.length!==0})},Gu.factory=function(P){return P instanceof Gu?P:Gu.fromString(P)},Gu.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(P){return P.text}).join("")},Gu.prototype.serialize=function(){for(var P=["format"],Z=0,de=this.sections;Z=0&&C<=255&&typeof P=="number"&&P>=0&&P<=255&&typeof Z=="number"&&Z>=0&&Z<=255)){var Oe=typeof de=="number"?[C,P,Z,de]:[C,P,Z];return"Invalid rgba value ["+Oe.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof de>"u"||typeof de=="number"&&de>=0&&de<=1?null:"Invalid rgba value ["+[C,P,Z,de].join(", ")+"]: 'a' must be between 0 and 1."}function Rc(C){if(C===null)return!0;if(typeof C=="string")return!0;if(typeof C=="boolean")return!0;if(typeof C=="number")return!0;if(C instanceof ml)return!0;if(C instanceof vc)return!0;if(C instanceof Gu)return!0;if(C instanceof zu)return!0;if(Array.isArray(C)){for(var P=0,Z=C;P2){var Et=P[1];if(typeof Et!="string"||!(Et in rf)||Et==="object")return Z.error('The item type argument of "array" must be one of string, number, boolean',1);nt=rf[Et],de++}else nt=Lo;var Zt;if(P.length>3){if(P[2]!==null&&(typeof P[2]!="number"||P[2]<0||P[2]!==Math.floor(P[2])))return Z.error('The length argument to "array" must be a positive integer literal',2);Zt=P[2],de++}Oe=Il(nt,Zt)}else Oe=rf[$e];for(var hr=[];de1)&&Z.push(Oe)}}return Z.concat(this.args.map(function($e){return $e.serialize()}))};var df=function(P){this.type=Ds,this.sections=P};df.parse=function(P,Z){if(P.length<2)return Z.error("Expected at least one argument.");var de=P[1];if(!Array.isArray(de)&&typeof de=="object")return Z.error("First argument must be an image or text section.");for(var Oe=[],$e=!1,nt=1;nt<=P.length-1;++nt){var Et=P[nt];if($e&&typeof Et=="object"&&!Array.isArray(Et)){$e=!1;var Zt=null;if(Et["font-scale"]&&(Zt=Z.parse(Et["font-scale"],1,io),!Zt))return null;var hr=null;if(Et["text-font"]&&(hr=Z.parse(Et["text-font"],1,Il(vs)),!hr))return null;var wr=null;if(Et["text-color"]&&(wr=Z.parse(Et["text-color"],1,Bl),!wr))return null;var Wr=Oe[Oe.length-1];Wr.scale=Zt,Wr.font=hr,Wr.textColor=wr}else{var dn=Z.parse(P[nt],1,Lo);if(!dn)return null;var un=dn.type.kind;if(un!=="string"&&un!=="value"&&un!=="null"&&un!=="resolvedImage")return Z.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");$e=!0,Oe.push({content:dn,scale:null,font:null,textColor:null})}}return new df(Oe)},df.prototype.evaluate=function(P){var Z=function(de){var Oe=de.content.evaluate(P);return $l(Oe)===vl?new nh("",Oe,null,null,null):new nh(Fu(Oe),null,de.scale?de.scale.evaluate(P):null,de.font?de.font.evaluate(P).join(","):null,de.textColor?de.textColor.evaluate(P):null)};return new Gu(this.sections.map(Z))},df.prototype.eachChild=function(P){for(var Z=0,de=this.sections;Z-1),de},ru.prototype.eachChild=function(P){P(this.input)},ru.prototype.outputDefined=function(){return!1},ru.prototype.serialize=function(){return["image",this.input.serialize()]};var Rh={"to-boolean":rs,"to-color":Bl,"to-number":io,"to-string":vs},Rs=function(P,Z){this.type=P,this.args=Z};Rs.parse=function(P,Z){if(P.length<2)return Z.error("Expected at least one argument.");var de=P[0];if((de==="to-boolean"||de==="to-string")&&P.length!==2)return Z.error("Expected one argument.");for(var Oe=Rh[de],$e=[],nt=1;nt4?de="Invalid rbga value "+JSON.stringify(Z)+": expected an array containing either three or four numeric values.":de=Hu(Z[0],Z[1],Z[2],Z[3]),!de))return new ml(Z[0]/255,Z[1]/255,Z[2]/255,Z[3])}throw new kl(de||"Could not parse color from value '"+(typeof Z=="string"?Z:String(JSON.stringify(Z)))+"'")}else if(this.type.kind==="number"){for(var Zt=null,hr=0,wr=this.args;hr=P[2]||C[1]<=P[1]||C[3]>=P[3])}function Eh(C,P){var Z=pf(C[0]),de=Nf(C[1]),Oe=Math.pow(2,P.z);return[Math.round(Z*Oe*Cu),Math.round(de*Oe*Cu)]}function fh(C,P,Z){var de=C[0]-P[0],Oe=C[1]-P[1],$e=C[0]-Z[0],nt=C[1]-Z[1];return de*nt-$e*Oe===0&&de*$e<=0&&Oe*nt<=0}function Bf(C,P,Z){return P[1]>C[1]!=Z[1]>C[1]&&C[0]<(Z[0]-P[0])*(C[1]-P[1])/(Z[1]-P[1])+P[0]}function vf(C,P){for(var Z=!1,de=0,Oe=P.length;de0&&Wr<0||wr<0&&Wr>0}function hh(C,P,Z,de){var Oe=[P[0]-C[0],P[1]-C[1]],$e=[de[0]-Z[0],de[1]-Z[1]];return oh($e,Oe)===0?!1:!!(zc(C,P,Z,de)&&zc(Z,de,C,P))}function nf(C,P,Z){for(var de=0,Oe=Z;deZ[2]){var Oe=de*.5,$e=C[0]-Z[0]>Oe?-de:Z[0]-C[0]>Oe?de:0;$e===0&&($e=C[0]-Z[2]>Oe?-de:Z[2]-C[0]>Oe?de:0),C[0]+=$e}ah(P,C)}function $f(C){C[0]=C[1]=1/0,C[2]=C[3]=-1/0}function Oh(C,P,Z,de){for(var Oe=Math.pow(2,de.z)*Cu,$e=[de.x*Cu,de.y*Cu],nt=[],Et=0,Zt=C;Et=0)return!1;var Z=!0;return C.eachChild(function(de){Z&&!gc(de,P)&&(Z=!1)}),Z}var mf=function(P,Z){this.type=Z.type,this.name=P,this.boundExpression=Z};mf.parse=function(P,Z){if(P.length!==2||typeof P[1]!="string")return Z.error("'var' expression requires exactly one string literal argument.");var de=P[1];return Z.scope.has(de)?new mf(de,Z.scope.get(de)):Z.error('Unknown variable "'+de+'". Make sure "'+de+'" has been bound in an enclosing "let" expression before using it.',1)},mf.prototype.evaluate=function(P){return this.boundExpression.evaluate(P)},mf.prototype.eachChild=function(){},mf.prototype.outputDefined=function(){return!1},mf.prototype.serialize=function(){return["var",this.name]};var Wl=function(P,Z,de,Oe,$e){Z===void 0&&(Z=[]),Oe===void 0&&(Oe=new al),$e===void 0&&($e=[]),this.registry=P,this.path=Z,this.key=Z.map(function(nt){return"["+nt+"]"}).join(""),this.scope=Oe,this.errors=$e,this.expectedType=de};Wl.prototype.parse=function(P,Z,de,Oe,$e){return $e===void 0&&($e={}),Z?this.concat(Z,de,Oe)._parse(P,$e):this._parse(P,$e)},Wl.prototype._parse=function(P,Z){(P===null||typeof P=="string"||typeof P=="boolean"||typeof P=="number")&&(P=["literal",P]);function de(wr,Wr,dn){return dn==="assert"?new lc(Wr,[wr]):dn==="coerce"?new Rs(Wr,[wr]):wr}if(Array.isArray(P)){if(P.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var Oe=P[0];if(typeof Oe!="string")return this.error("Expression name must be a string, but found "+typeof Oe+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var $e=this.registry[Oe];if($e){var nt=$e.parse(P,this);if(!nt)return null;if(this.expectedType){var Et=this.expectedType,Zt=nt.type;if((Et.kind==="string"||Et.kind==="number"||Et.kind==="boolean"||Et.kind==="object"||Et.kind==="array")&&Zt.kind==="value")nt=de(nt,Et,Z.typeAnnotation||"assert");else if((Et.kind==="color"||Et.kind==="formatted"||Et.kind==="resolvedImage")&&(Zt.kind==="value"||Zt.kind==="string"))nt=de(nt,Et,Z.typeAnnotation||"coerce");else if(this.checkSubtype(Et,Zt))return null}if(!(nt instanceof Bs)&&nt.type.kind!=="resolvedImage"&&af(nt)){var hr=new ul;try{nt=new Bs(nt.type,nt.evaluate(hr))}catch(wr){return this.error(wr.message),null}}return nt}return this.error('Unknown expression "'+Oe+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof P>"u"?this.error("'undefined' value invalid. Use null instead."):typeof P=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof P+" instead.")},Wl.prototype.concat=function(P,Z,de){var Oe=typeof P=="number"?this.path.concat(P):this.path,$e=de?this.scope.concat(de):this.scope;return new Wl(this.registry,Oe,Z||null,$e,this.errors)},Wl.prototype.error=function(P){for(var Z=[],de=arguments.length-1;de-- >0;)Z[de]=arguments[de+1];var Oe=""+this.key+Z.map(function($e){return"["+$e+"]"}).join("");this.errors.push(new qs(Oe,P))},Wl.prototype.checkSubtype=function(P,Z){var de=qc(P,Z);return de&&this.error(de),de};function af(C){if(C instanceof mf)return af(C.boundExpression);if(C instanceof Do&&C.name==="error")return!1;if(C instanceof Oc)return!1;if(C instanceof mc)return!1;var P=C instanceof Rs||C instanceof lc,Z=!0;return C.eachChild(function(de){P?Z=Z&&af(de):Z=Z&&de instanceof Bs}),Z?vh(C)&&gc(C,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function ac(C,P){for(var Z=C.length-1,de=0,Oe=Z,$e=0,nt,Et;de<=Oe;)if($e=Math.floor((de+Oe)/2),nt=C[$e],Et=C[$e+1],nt<=P){if($e===Z||PP)Oe=$e-1;else throw new kl("Input is not a number.");return 0}var yc=function(P,Z,de){this.type=P,this.input=Z,this.labels=[],this.outputs=[];for(var Oe=0,$e=de;Oe<$e.length;Oe+=1){var nt=$e[Oe],Et=nt[0],Zt=nt[1];this.labels.push(Et),this.outputs.push(Zt)}};yc.parse=function(P,Z){if(P.length-1<4)return Z.error("Expected at least 4 arguments, but found only "+(P.length-1)+".");if((P.length-1)%2!==0)return Z.error("Expected an even number of arguments.");var de=Z.parse(P[1],1,io);if(!de)return null;var Oe=[],$e=null;Z.expectedType&&Z.expectedType.kind!=="value"&&($e=Z.expectedType);for(var nt=1;nt=Et)return Z.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',hr);var Wr=Z.parse(Zt,wr,$e);if(!Wr)return null;$e=$e||Wr.type,Oe.push([Et,Wr])}return new yc($e,de,Oe)},yc.prototype.evaluate=function(P){var Z=this.labels,de=this.outputs;if(Z.length===1)return de[0].evaluate(P);var Oe=this.input.evaluate(P);if(Oe<=Z[0])return de[0].evaluate(P);var $e=Z.length;if(Oe>=Z[$e-1])return de[$e-1].evaluate(P);var nt=ac(Z,Oe);return de[nt].evaluate(P)},yc.prototype.eachChild=function(P){P(this.input);for(var Z=0,de=this.outputs;Z0&&P.push(this.labels[Z]),P.push(this.outputs[Z].serialize());return P};function nu(C,P,Z){return C*(1-Z)+P*Z}function Cf(C,P,Z){return new ml(nu(C.r,P.r,Z),nu(C.g,P.g,Z),nu(C.b,P.b,Z),nu(C.a,P.a,Z))}function Hc(C,P,Z){return C.map(function(de,Oe){return nu(de,P[Oe],Z)})}var gf=Object.freeze({__proto__:null,number:nu,color:Cf,array:Hc}),Wf=.95047,zh=1,td=1.08883,Pf=4/29,Yf=6/29,Ec=3*Yf*Yf,Xf=Yf*Yf*Yf,$u=Math.PI/180,Lf=180/Math.PI;function mh(C){return C>Xf?Math.pow(C,1/3):C/Ec+Pf}function Df(C){return C>Yf?C*C*C:Ec*(C-Pf)}function Zl(C){return 255*(C<=.0031308?12.92*C:1.055*Math.pow(C,1/2.4)-.055)}function _c(C){return C/=255,C<=.04045?C/12.92:Math.pow((C+.055)/1.055,2.4)}function Fc(C){var P=_c(C.r),Z=_c(C.g),de=_c(C.b),Oe=mh((.4124564*P+.3575761*Z+.1804375*de)/Wf),$e=mh((.2126729*P+.7151522*Z+.072175*de)/zh),nt=mh((.0193339*P+.119192*Z+.9503041*de)/td);return{l:116*$e-16,a:500*(Oe-$e),b:200*($e-nt),alpha:C.a}}function lh(C){var P=(C.l+16)/116,Z=isNaN(C.a)?P:P+C.a/500,de=isNaN(C.b)?P:P-C.b/200;return P=zh*Df(P),Z=Wf*Df(Z),de=td*Df(de),new ml(Zl(3.2404542*Z-1.5371385*P-.4985314*de),Zl(-.969266*Z+1.8760108*P+.041556*de),Zl(.0556434*Z-.2040259*P+1.0572252*de),C.alpha)}function eu(C,P,Z){return{l:nu(C.l,P.l,Z),a:nu(C.a,P.a,Z),b:nu(C.b,P.b,Z),alpha:nu(C.alpha,P.alpha,Z)}}function jf(C){var P=Fc(C),Z=P.l,de=P.a,Oe=P.b,$e=Math.atan2(Oe,de)*Lf;return{h:$e<0?$e+360:$e,c:Math.sqrt(de*de+Oe*Oe),l:Z,alpha:C.a}}function yf(C){var P=C.h*$u,Z=C.c,de=C.l;return lh({l:de,a:Math.cos(P)*Z,b:Math.sin(P)*Z,alpha:C.alpha})}function kc(C,P,Z){var de=P-C;return C+Z*(de>180||de<-180?de-360*Math.round(de/360):de)}function Vf(C,P,Z){return{h:kc(C.h,P.h,Z),c:nu(C.c,P.c,Z),l:nu(C.l,P.l,Z),alpha:nu(C.alpha,P.alpha,Z)}}var $c={forward:Fc,reverse:lh,interpolate:eu},qf={forward:jf,reverse:yf,interpolate:Vf},Fh=Object.freeze({__proto__:null,lab:$c,hcl:qf}),Xu=function(P,Z,de,Oe,$e){this.type=P,this.operator=Z,this.interpolation=de,this.input=Oe,this.labels=[],this.outputs=[];for(var nt=0,Et=$e;nt1}))return Z.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Oe={name:"cubic-bezier",controlPoints:Zt}}else return Z.error("Unknown interpolation type "+String(Oe[0]),1,0);if(P.length-1<4)return Z.error("Expected at least 4 arguments, but found only "+(P.length-1)+".");if((P.length-1)%2!==0)return Z.error("Expected an even number of arguments.");if($e=Z.parse($e,2,io),!$e)return null;var hr=[],wr=null;de==="interpolate-hcl"||de==="interpolate-lab"?wr=Bl:Z.expectedType&&Z.expectedType.kind!=="value"&&(wr=Z.expectedType);for(var Wr=0;Wr=dn)return Z.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Pn);var ei=Z.parse(un,ca,wr);if(!ei)return null;wr=wr||ei.type,hr.push([dn,ei])}return wr.kind!=="number"&&wr.kind!=="color"&&!(wr.kind==="array"&&wr.itemType.kind==="number"&&typeof wr.N=="number")?Z.error("Type "+zl(wr)+" is not interpolatable."):new Xu(wr,de,Oe,$e,hr)},Xu.prototype.evaluate=function(P){var Z=this.labels,de=this.outputs;if(Z.length===1)return de[0].evaluate(P);var Oe=this.input.evaluate(P);if(Oe<=Z[0])return de[0].evaluate(P);var $e=Z.length;if(Oe>=Z[$e-1])return de[$e-1].evaluate(P);var nt=ac(Z,Oe),Et=Z[nt],Zt=Z[nt+1],hr=Xu.interpolationFactor(this.interpolation,Oe,Et,Zt),wr=de[nt].evaluate(P),Wr=de[nt+1].evaluate(P);return this.operator==="interpolate"?gf[this.type.kind.toLowerCase()](wr,Wr,hr):this.operator==="interpolate-hcl"?qf.reverse(qf.interpolate(qf.forward(wr),qf.forward(Wr),hr)):$c.reverse($c.interpolate($c.forward(wr),$c.forward(Wr),hr))},Xu.prototype.eachChild=function(P){P(this.input);for(var Z=0,de=this.outputs;Z=de.length)throw new kl("Array index out of bounds: "+Z+" > "+(de.length-1)+".");if(Z!==Math.floor(Z))throw new kl("Array index must be an integer, but found "+Z+" instead.");return de[Z]},Wc.prototype.eachChild=function(P){P(this.index),P(this.input)},Wc.prototype.outputDefined=function(){return!1},Wc.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var gu=function(P,Z){this.type=rs,this.needle=P,this.haystack=Z};gu.parse=function(P,Z){if(P.length!==3)return Z.error("Expected 2 arguments, but found "+(P.length-1)+" instead.");var de=Z.parse(P[1],1,Lo),Oe=Z.parse(P[2],2,Lo);return!de||!Oe?null:Mc(de.type,[rs,vs,io,mu,Lo])?new gu(de,Oe):Z.error("Expected first argument to be of type boolean, string, number or null, but found "+zl(de.type)+" instead")},gu.prototype.evaluate=function(P){var Z=this.needle.evaluate(P),de=this.haystack.evaluate(P);if(!de)return!1;if(!Dc(Z,["boolean","string","number","null"]))throw new kl("Expected first argument to be of type boolean, string, number or null, but found "+zl($l(Z))+" instead.");if(!Dc(de,["string","array"]))throw new kl("Expected second argument to be of type array or string, but found "+zl($l(de))+" instead.");return de.indexOf(Z)>=0},gu.prototype.eachChild=function(P){P(this.needle),P(this.haystack)},gu.prototype.outputDefined=function(){return!0},gu.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var uc=function(P,Z,de){this.type=io,this.needle=P,this.haystack=Z,this.fromIndex=de};uc.parse=function(P,Z){if(P.length<=2||P.length>=5)return Z.error("Expected 3 or 4 arguments, but found "+(P.length-1)+" instead.");var de=Z.parse(P[1],1,Lo),Oe=Z.parse(P[2],2,Lo);if(!de||!Oe)return null;if(!Mc(de.type,[rs,vs,io,mu,Lo]))return Z.error("Expected first argument to be of type boolean, string, number or null, but found "+zl(de.type)+" instead");if(P.length===4){var $e=Z.parse(P[3],3,io);return $e?new uc(de,Oe,$e):null}else return new uc(de,Oe)},uc.prototype.evaluate=function(P){var Z=this.needle.evaluate(P),de=this.haystack.evaluate(P);if(!Dc(Z,["boolean","string","number","null"]))throw new kl("Expected first argument to be of type boolean, string, number or null, but found "+zl($l(Z))+" instead.");if(!Dc(de,["string","array"]))throw new kl("Expected second argument to be of type array or string, but found "+zl($l(de))+" instead.");if(this.fromIndex){var Oe=this.fromIndex.evaluate(P);return de.indexOf(Z,Oe)}return de.indexOf(Z)},uc.prototype.eachChild=function(P){P(this.needle),P(this.haystack),this.fromIndex&&P(this.fromIndex)},uc.prototype.outputDefined=function(){return!1},uc.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var P=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),P]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var lu=function(P,Z,de,Oe,$e,nt){this.inputType=P,this.type=Z,this.input=de,this.cases=Oe,this.outputs=$e,this.otherwise=nt};lu.parse=function(P,Z){if(P.length<5)return Z.error("Expected at least 4 arguments, but found only "+(P.length-1)+".");if(P.length%2!==1)return Z.error("Expected an even number of arguments.");var de,Oe;Z.expectedType&&Z.expectedType.kind!=="value"&&(Oe=Z.expectedType);for(var $e={},nt=[],Et=2;EtNumber.MAX_SAFE_INTEGER)return wr.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof un=="number"&&Math.floor(un)!==un)return wr.error("Numeric branch labels must be integer values.");if(!de)de=$l(un);else if(wr.checkSubtype(de,$l(un)))return null;if(typeof $e[String(un)]<"u")return wr.error("Branch labels must be unique.");$e[String(un)]=nt.length}var Pn=Z.parse(hr,Et,Oe);if(!Pn)return null;Oe=Oe||Pn.type,nt.push(Pn)}var ca=Z.parse(P[1],1,Lo);if(!ca)return null;var ei=Z.parse(P[P.length-1],P.length-1,Oe);return!ei||ca.type.kind!=="value"&&Z.concat(1).checkSubtype(de,ca.type)?null:new lu(de,Oe,ca,$e,nt,ei)},lu.prototype.evaluate=function(P){var Z=this.input.evaluate(P),de=$l(Z)===this.inputType&&this.outputs[this.cases[Z]]||this.otherwise;return de.evaluate(P)},lu.prototype.eachChild=function(P){P(this.input),this.outputs.forEach(P),P(this.otherwise)},lu.prototype.outputDefined=function(){return this.outputs.every(function(P){return P.outputDefined()})&&this.otherwise.outputDefined()},lu.prototype.serialize=function(){for(var P=this,Z=["match",this.input.serialize()],de=Object.keys(this.cases).sort(),Oe=[],$e={},nt=0,Et=de;nt=5)return Z.error("Expected 3 or 4 arguments, but found "+(P.length-1)+" instead.");var de=Z.parse(P[1],1,Lo),Oe=Z.parse(P[2],2,io);if(!de||!Oe)return null;if(!Mc(de.type,[Il(Lo),vs,Lo]))return Z.error("Expected first argument to be of type array or string, but found "+zl(de.type)+" instead");if(P.length===4){var $e=Z.parse(P[3],3,io);return $e?new Yc(de.type,de,Oe,$e):null}else return new Yc(de.type,de,Oe)},Yc.prototype.evaluate=function(P){var Z=this.input.evaluate(P),de=this.beginIndex.evaluate(P);if(!Dc(Z,["string","array"]))throw new kl("Expected first argument to be of type array or string, but found "+zl($l(Z))+" instead.");if(this.endIndex){var Oe=this.endIndex.evaluate(P);return Z.slice(de,Oe)}return Z.slice(de)},Yc.prototype.eachChild=function(P){P(this.input),P(this.beginIndex),this.endIndex&&P(this.endIndex)},Yc.prototype.outputDefined=function(){return!1},Yc.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var P=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),P]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};function uh(C,P){return C==="=="||C==="!="?P.kind==="boolean"||P.kind==="string"||P.kind==="number"||P.kind==="null"||P.kind==="value":P.kind==="string"||P.kind==="number"||P.kind==="value"}function br(C,P,Z){return P===Z}function qr(C,P,Z){return P!==Z}function An(C,P,Z){return PZ}function Xn(C,P,Z){return P<=Z}function Na(C,P,Z){return P>=Z}function Ra(C,P,Z,de){return de.compare(P,Z)===0}function pi(C,P,Z,de){return!Ra(C,P,Z,de)}function xi(C,P,Z,de){return de.compare(P,Z)<0}function $i(C,P,Z,de){return de.compare(P,Z)>0}function ni(C,P,Z,de){return de.compare(P,Z)<=0}function Ii(C,P,Z,de){return de.compare(P,Z)>=0}function hi(C,P,Z){var de=C!=="=="&&C!=="!=";return function(){function Oe($e,nt,Et){this.type=rs,this.lhs=$e,this.rhs=nt,this.collator=Et,this.hasUntypedArgument=$e.type.kind==="value"||nt.type.kind==="value"}return Oe.parse=function(nt,Et){if(nt.length!==3&&nt.length!==4)return Et.error("Expected two or three arguments.");var Zt=nt[0],hr=Et.parse(nt[1],1,Lo);if(!hr)return null;if(!uh(Zt,hr.type))return Et.concat(1).error('"'+Zt+`" comparisons are not supported for type '`+zl(hr.type)+"'.");var wr=Et.parse(nt[2],2,Lo);if(!wr)return null;if(!uh(Zt,wr.type))return Et.concat(2).error('"'+Zt+`" comparisons are not supported for type '`+zl(wr.type)+"'.");if(hr.type.kind!==wr.type.kind&&hr.type.kind!=="value"&&wr.type.kind!=="value")return Et.error("Cannot compare types '"+zl(hr.type)+"' and '"+zl(wr.type)+"'.");de&&(hr.type.kind==="value"&&wr.type.kind!=="value"?hr=new lc(wr.type,[hr]):hr.type.kind!=="value"&&wr.type.kind==="value"&&(wr=new lc(hr.type,[wr])));var Wr=null;if(nt.length===4){if(hr.type.kind!=="string"&&wr.type.kind!=="string"&&hr.type.kind!=="value"&&wr.type.kind!=="value")return Et.error("Cannot use collator to compare non-string types.");if(Wr=Et.parse(nt[3],3,su),!Wr)return null}return new Oe(hr,wr,Wr)},Oe.prototype.evaluate=function(nt){var Et=this.lhs.evaluate(nt),Zt=this.rhs.evaluate(nt);if(de&&this.hasUntypedArgument){var hr=$l(Et),wr=$l(Zt);if(hr.kind!==wr.kind||!(hr.kind==="string"||hr.kind==="number"))throw new kl('Expected arguments for "'+C+'" to be (string, string) or (number, number), but found ('+hr.kind+", "+wr.kind+") instead.")}if(this.collator&&!de&&this.hasUntypedArgument){var Wr=$l(Et),dn=$l(Zt);if(Wr.kind!=="string"||dn.kind!=="string")return P(nt,Et,Zt)}return this.collator?Z(nt,Et,Zt,this.collator.evaluate(nt)):P(nt,Et,Zt)},Oe.prototype.eachChild=function(nt){nt(this.lhs),nt(this.rhs),this.collator&&nt(this.collator)},Oe.prototype.outputDefined=function(){return!0},Oe.prototype.serialize=function(){var nt=[C];return this.eachChild(function(Et){nt.push(Et.serialize())}),nt},Oe}()}var Ja=hi("==",br,Ra),eo=hi("!=",qr,pi),zo=hi("<",An,xi),Io=hi(">",vn,$i),Vo=hi("<=",Xn,ni),Bo=hi(">=",Na,Ii),ro=function(P,Z,de,Oe,$e){this.type=vs,this.number=P,this.locale=Z,this.currency=de,this.minFractionDigits=Oe,this.maxFractionDigits=$e};ro.parse=function(P,Z){if(P.length!==3)return Z.error("Expected two arguments.");var de=Z.parse(P[1],1,io);if(!de)return null;var Oe=P[2];if(typeof Oe!="object"||Array.isArray(Oe))return Z.error("NumberFormat options argument must be an object.");var $e=null;if(Oe.locale&&($e=Z.parse(Oe.locale,1,vs),!$e))return null;var nt=null;if(Oe.currency&&(nt=Z.parse(Oe.currency,1,vs),!nt))return null;var Et=null;if(Oe["min-fraction-digits"]&&(Et=Z.parse(Oe["min-fraction-digits"],1,io),!Et))return null;var Zt=null;return Oe["max-fraction-digits"]&&(Zt=Z.parse(Oe["max-fraction-digits"],1,io),!Zt)?null:new ro(de,$e,nt,Et,Zt)},ro.prototype.evaluate=function(P){return new Intl.NumberFormat(this.locale?this.locale.evaluate(P):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(P):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(P):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(P):void 0}).format(this.number.evaluate(P))},ro.prototype.eachChild=function(P){P(this.number),this.locale&&P(this.locale),this.currency&&P(this.currency),this.minFractionDigits&&P(this.minFractionDigits),this.maxFractionDigits&&P(this.maxFractionDigits)},ro.prototype.outputDefined=function(){return!1},ro.prototype.serialize=function(){var P={};return this.locale&&(P.locale=this.locale.serialize()),this.currency&&(P.currency=this.currency.serialize()),this.minFractionDigits&&(P["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(P["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),P]};var Ni=function(P){this.type=io,this.input=P};Ni.parse=function(P,Z){if(P.length!==2)return Z.error("Expected 1 argument, but found "+(P.length-1)+" instead.");var de=Z.parse(P[1],1);return de?de.type.kind!=="array"&&de.type.kind!=="string"&&de.type.kind!=="value"?Z.error("Expected argument of type string or array, but found "+zl(de.type)+" instead."):new Ni(de):null},Ni.prototype.evaluate=function(P){var Z=this.input.evaluate(P);if(typeof Z=="string")return Z.length;if(Array.isArray(Z))return Z.length;throw new kl("Expected value to be of type string or array, but found "+zl($l(Z))+" instead.")},Ni.prototype.eachChild=function(P){P(this.input)},Ni.prototype.outputDefined=function(){return!1},Ni.prototype.serialize=function(){var P=["length"];return this.eachChild(function(Z){P.push(Z.serialize())}),P};var ns={"==":Ja,"!=":eo,">":Io,"<":zo,">=":Bo,"<=":Vo,array:lc,at:Wc,boolean:lc,case:_f,coalesce:Cc,collator:Oc,format:df,image:ru,in:gu,"index-of":uc,interpolate:Xu,"interpolate-hcl":Xu,"interpolate-lab":Xu,length:Ni,let:of,literal:Bs,match:lu,number:lc,"number-format":ro,object:lc,slice:Yc,step:yc,string:lc,"to-boolean":Rs,"to-color":Rs,"to-number":Rs,"to-string":Rs,var:mf,within:mc};function Os(C,P){var Z=P[0],de=P[1],Oe=P[2],$e=P[3];Z=Z.evaluate(C),de=de.evaluate(C),Oe=Oe.evaluate(C);var nt=$e?$e.evaluate(C):1,Et=Hu(Z,de,Oe,nt);if(Et)throw new kl(Et);return new ml(Z/255*nt,de/255*nt,Oe/255*nt,nt)}function yl(C,P){return C in P}function jl(C,P){var Z=P[C];return typeof Z>"u"?null:Z}function _l(C,P,Z,de){for(;Z<=de;){var Oe=Z+de>>1;if(P[Oe]===C)return!0;P[Oe]>C?de=Oe-1:Z=Oe+1}return!1}function Vl(C){return{type:C}}Do.register(ns,{error:[tu,[vs],function(C,P){var Z=P[0];throw new kl(Z.evaluate(C))}],typeof:[vs,[Lo],function(C,P){var Z=P[0];return zl($l(Z.evaluate(C)))}],"to-rgba":[Il(io,4),[Bl],function(C,P){var Z=P[0];return Z.evaluate(C).toArray()}],rgb:[Bl,[io,io,io],Os],rgba:[Bl,[io,io,io,io],Os],has:{type:rs,overloads:[[[vs],function(C,P){var Z=P[0];return yl(Z.evaluate(C),C.properties())}],[[vs,Ul],function(C,P){var Z=P[0],de=P[1];return yl(Z.evaluate(C),de.evaluate(C))}]]},get:{type:Lo,overloads:[[[vs],function(C,P){var Z=P[0];return jl(Z.evaluate(C),C.properties())}],[[vs,Ul],function(C,P){var Z=P[0],de=P[1];return jl(Z.evaluate(C),de.evaluate(C))}]]},"feature-state":[Lo,[vs],function(C,P){var Z=P[0];return jl(Z.evaluate(C),C.featureState||{})}],properties:[Ul,[],function(C){return C.properties()}],"geometry-type":[vs,[],function(C){return C.geometryType()}],id:[Lo,[],function(C){return C.id()}],zoom:[io,[],function(C){return C.globals.zoom}],"heatmap-density":[io,[],function(C){return C.globals.heatmapDensity||0}],"line-progress":[io,[],function(C){return C.globals.lineProgress||0}],accumulated:[Lo,[],function(C){return C.globals.accumulated===void 0?null:C.globals.accumulated}],"+":[io,Vl(io),function(C,P){for(var Z=0,de=0,Oe=P;de":[rs,[vs,Lo],function(C,P){var Z=P[0],de=P[1],Oe=C.properties()[Z.value],$e=de.value;return typeof Oe==typeof $e&&Oe>$e}],"filter-id->":[rs,[Lo],function(C,P){var Z=P[0],de=C.id(),Oe=Z.value;return typeof de==typeof Oe&&de>Oe}],"filter-<=":[rs,[vs,Lo],function(C,P){var Z=P[0],de=P[1],Oe=C.properties()[Z.value],$e=de.value;return typeof Oe==typeof $e&&Oe<=$e}],"filter-id-<=":[rs,[Lo],function(C,P){var Z=P[0],de=C.id(),Oe=Z.value;return typeof de==typeof Oe&&de<=Oe}],"filter->=":[rs,[vs,Lo],function(C,P){var Z=P[0],de=P[1],Oe=C.properties()[Z.value],$e=de.value;return typeof Oe==typeof $e&&Oe>=$e}],"filter-id->=":[rs,[Lo],function(C,P){var Z=P[0],de=C.id(),Oe=Z.value;return typeof de==typeof Oe&&de>=Oe}],"filter-has":[rs,[Lo],function(C,P){var Z=P[0];return Z.value in C.properties()}],"filter-has-id":[rs,[],function(C){return C.id()!==null&&C.id()!==void 0}],"filter-type-in":[rs,[Il(vs)],function(C,P){var Z=P[0];return Z.value.indexOf(C.geometryType())>=0}],"filter-id-in":[rs,[Il(Lo)],function(C,P){var Z=P[0];return Z.value.indexOf(C.id())>=0}],"filter-in-small":[rs,[vs,Il(Lo)],function(C,P){var Z=P[0],de=P[1];return de.value.indexOf(C.properties()[Z.value])>=0}],"filter-in-large":[rs,[vs,Il(Lo)],function(C,P){var Z=P[0],de=P[1];return _l(C.properties()[Z.value],de.value,0,de.value.length-1)}],all:{type:rs,overloads:[[[rs,rs],function(C,P){var Z=P[0],de=P[1];return Z.evaluate(C)&&de.evaluate(C)}],[Vl(rs),function(C,P){for(var Z=0,de=P;Z-1}function bo(C){return!!C.expression&&C.expression.interpolated}function ms(C){return C instanceof Number?"number":C instanceof String?"string":C instanceof Boolean?"boolean":Array.isArray(C)?"array":C===null?"null":typeof C}function Cl(C){return typeof C=="object"&&C!==null&&!Array.isArray(C)}function cl(C){return C}function ic(C,P){var Z=P.type==="color",de=C.stops&&typeof C.stops[0][0]=="object",Oe=de||C.property!==void 0,$e=de||!Oe,nt=C.type||(bo(P)?"exponential":"interval");if(Z&&(C=Cs({},C),C.stops&&(C.stops=C.stops.map(function(_o){return[_o[0],ml.parse(_o[1])]})),C.default?C.default=ml.parse(C.default):C.default=ml.parse(P.default)),C.colorSpace&&C.colorSpace!=="rgb"&&!Fh[C.colorSpace])throw new Error("Unknown color space: "+C.colorSpace);var Et,Zt,hr;if(nt==="exponential")Et=sc;else if(nt==="interval")Et=Sf;else if(nt==="categorical"){Et=cc,Zt=Object.create(null);for(var wr=0,Wr=C.stops;wr=C.stops[de-1][0])return C.stops[de-1][1];var Oe=ac(C.stops.map(function($e){return $e[0]}),Z);return C.stops[Oe][1]}function sc(C,P,Z){var de=C.base!==void 0?C.base:1;if(ms(Z)!=="number")return oc(C.default,P.default);var Oe=C.stops.length;if(Oe===1||Z<=C.stops[0][0])return C.stops[0][1];if(Z>=C.stops[Oe-1][0])return C.stops[Oe-1][1];var $e=ac(C.stops.map(function(Wr){return Wr[0]}),Z),nt=wu(Z,de,C.stops[$e][0],C.stops[$e+1][0]),Et=C.stops[$e][1],Zt=C.stops[$e+1][1],hr=gf[P.type]||cl;if(C.colorSpace&&C.colorSpace!=="rgb"){var wr=Fh[C.colorSpace];hr=function(Wr,dn){return wr.reverse(wr.interpolate(wr.forward(Wr),wr.forward(dn),nt))}}return typeof Et.evaluate=="function"?{evaluate:function(){for(var dn=[],un=arguments.length;un--;)dn[un]=arguments[un];var Pn=Et.evaluate.apply(void 0,dn),ca=Zt.evaluate.apply(void 0,dn);if(!(Pn===void 0||ca===void 0))return hr(Pn,ca,nt)}}:hr(Et,Zt,nt)}function sf(C,P,Z){return P.type==="color"?Z=ml.parse(Z):P.type==="formatted"?Z=Gu.fromString(Z.toString()):P.type==="resolvedImage"?Z=zu.fromString(Z.toString()):ms(Z)!==P.type&&(P.type!=="enum"||!P.values[Z])&&(Z=void 0),oc(Z,C.default,P.default)}function wu(C,P,Z,de){var Oe=de-Z,$e=C-Z;return Oe===0?0:P===1?$e/Oe:(Math.pow(P,$e)-1)/(Math.pow(P,Oe)-1)}var lf=function(P,Z){this.expression=P,this._warningHistory={},this._evaluator=new ul,this._defaultValue=Z?je(Z):null,this._enumValues=Z&&Z.type==="enum"?Z.values:null};lf.prototype.evaluateWithoutErrorHandling=function(P,Z,de,Oe,$e,nt){return this._evaluator.globals=P,this._evaluator.feature=Z,this._evaluator.featureState=de,this._evaluator.canonical=Oe,this._evaluator.availableImages=$e||null,this._evaluator.formattedSection=nt,this.expression.evaluate(this._evaluator)},lf.prototype.evaluate=function(P,Z,de,Oe,$e,nt){this._evaluator.globals=P,this._evaluator.feature=Z||null,this._evaluator.featureState=de||null,this._evaluator.canonical=Oe,this._evaluator.availableImages=$e||null,this._evaluator.formattedSection=nt||null;try{var Et=this.expression.evaluate(this._evaluator);if(Et==null||typeof Et=="number"&&Et!==Et)return this._defaultValue;if(this._enumValues&&!(Et in this._enumValues))throw new kl("Expected value to be one of "+Object.keys(this._enumValues).map(function(Zt){return JSON.stringify(Zt)}).join(", ")+", but found "+JSON.stringify(Et)+" instead.");return Et}catch(Zt){return this._warningHistory[Zt.message]||(this._warningHistory[Zt.message]=!0,typeof console<"u"&&console.warn(Zt.message)),this._defaultValue}};function qo(C){return Array.isArray(C)&&C.length>0&&typeof C[0]=="string"&&C[0]in ns}function as(C,P){var Z=new Wl(ns,[],P?Ne(P):void 0),de=Z.parse(C,void 0,void 0,void 0,P&&P.type==="string"?{typeAnnotation:"coerce"}:void 0);return de?Ks(new lf(de,P)):xu(Z.errors)}var uf=function(P,Z){this.kind=P,this._styleExpression=Z,this.isStateDependent=P!=="constant"&&!du(Z.expression)};uf.prototype.evaluateWithoutErrorHandling=function(P,Z,de,Oe,$e,nt){return this._styleExpression.evaluateWithoutErrorHandling(P,Z,de,Oe,$e,nt)},uf.prototype.evaluate=function(P,Z,de,Oe,$e,nt){return this._styleExpression.evaluate(P,Z,de,Oe,$e,nt)};var Pc=function(P,Z,de,Oe){this.kind=P,this.zoomStops=de,this._styleExpression=Z,this.isStateDependent=P!=="camera"&&!du(Z.expression),this.interpolationType=Oe};Pc.prototype.evaluateWithoutErrorHandling=function(P,Z,de,Oe,$e,nt){return this._styleExpression.evaluateWithoutErrorHandling(P,Z,de,Oe,$e,nt)},Pc.prototype.evaluate=function(P,Z,de,Oe,$e,nt){return this._styleExpression.evaluate(P,Z,de,Oe,$e,nt)},Pc.prototype.interpolationFactor=function(P,Z,de){return this.interpolationType?Xu.interpolationFactor(this.interpolationType,P,Z,de):0};function bc(C,P){if(C=as(C,P),C.result==="error")return C;var Z=C.value.expression,de=vh(Z);if(!de&&!yu(P))return xu([new qs("","data expressions not supported")]);var Oe=gc(Z,["zoom"]);if(!Oe&&!Fl(P))return xu([new qs("","zoom expressions not supported")]);var $e=ce(Z);if(!$e&&!Oe)return xu([new qs("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if($e instanceof qs)return xu([$e]);if($e instanceof Xu&&!bo(P))return xu([new qs("",'"interpolate" expressions cannot be used with this property')]);if(!$e)return Ks(de?new uf("constant",C.value):new uf("source",C.value));var nt=$e instanceof Xu?$e.interpolation:void 0;return Ks(de?new Pc("camera",C.value,$e.labels,nt):new Pc("composite",C.value,$e.labels,nt))}var Je=function(P,Z){this._parameters=P,this._specification=Z,Cs(this,ic(this._parameters,this._specification))};Je.deserialize=function(P){return new Je(P._parameters,P._specification)},Je.serialize=function(P){return{_parameters:P._parameters,_specification:P._specification}};function I(C,P){if(Cl(C))return new Je(C,P);if(qo(C)){var Z=bc(C,P);if(Z.result==="error")throw new Error(Z.value.map(function(Oe){return Oe.key+": "+Oe.message}).join(", "));return Z.value}else{var de=C;return typeof C=="string"&&P.type==="color"&&(de=ml.parse(C)),{kind:"constant",evaluate:function(){return de}}}}function ce(C){var P=null;if(C instanceof of)P=ce(C.result);else if(C instanceof Cc)for(var Z=0,de=C.args;Zde.maximum?[new uo(P,Z,Z+" is greater than the maximum value "+de.maximum)]:[]}function tr(C){var P=C.valueSpec,Z=Ro(C.value.type),de,Oe={},$e,nt,Et=Z!=="categorical"&&C.value.property===void 0,Zt=!Et,hr=ms(C.value.stops)==="array"&&ms(C.value.stops[0])==="array"&&ms(C.value.stops[0][0])==="object",wr=Ze({key:C.key,value:C.value,valueSpec:C.styleSpec.function,style:C.style,styleSpec:C.styleSpec,objectElementValidators:{stops:Wr,default:Pn}});return Z==="identity"&&Et&&wr.push(new uo(C.key,C.value,'missing required property "property"')),Z!=="identity"&&!C.value.stops&&wr.push(new uo(C.key,C.value,'missing required property "stops"')),Z==="exponential"&&C.valueSpec.expression&&!bo(C.valueSpec)&&wr.push(new uo(C.key,C.value,"exponential functions not supported")),C.styleSpec.$version>=8&&(Zt&&!yu(C.valueSpec)?wr.push(new uo(C.key,C.value,"property functions not supported")):Et&&!Fl(C.valueSpec)&&wr.push(new uo(C.key,C.value,"zoom functions not supported"))),(Z==="categorical"||hr)&&C.value.property===void 0&&wr.push(new uo(C.key,C.value,'"property" property is required')),wr;function Wr(ca){if(Z==="identity")return[new uo(ca.key,ca.value,'identity function may not have a "stops" property')];var ei=[],za=ca.value;return ei=ei.concat(kt({key:ca.key,value:za,valueSpec:ca.valueSpec,style:ca.style,styleSpec:ca.styleSpec,arrayElementValidator:dn})),ms(za)==="array"&&za.length===0&&ei.push(new uo(ca.key,za,"array must have at least one stop")),ei}function dn(ca){var ei=[],za=ca.value,Ei=ca.key;if(ms(za)!=="array")return[new uo(Ei,za,"array expected, "+ms(za)+" found")];if(za.length!==2)return[new uo(Ei,za,"array length 2 expected, length "+za.length+" found")];if(hr){if(ms(za[0])!=="object")return[new uo(Ei,za,"object expected, "+ms(za[0])+" found")];if(za[0].zoom===void 0)return[new uo(Ei,za,"object stop key must have zoom")];if(za[0].value===void 0)return[new uo(Ei,za,"object stop key must have value")];if(nt&&nt>Ro(za[0].zoom))return[new uo(Ei,za[0].zoom,"stop zoom values must appear in ascending order")];Ro(za[0].zoom)!==nt&&(nt=Ro(za[0].zoom),$e=void 0,Oe={}),ei=ei.concat(Ze({key:Ei+"[0]",value:za[0],valueSpec:{zoom:{}},style:ca.style,styleSpec:ca.styleSpec,objectElementValidators:{zoom:Ft,value:un}}))}else ei=ei.concat(un({key:Ei+"[0]",value:za[0],style:ca.style,styleSpec:ca.styleSpec},za));return qo(El(za[1]))?ei.concat([new uo(Ei+"[1]",za[1],"expressions are not allowed in function stops.")]):ei.concat(Ws({key:Ei+"[1]",value:za[1],valueSpec:P,style:ca.style,styleSpec:ca.styleSpec}))}function un(ca,ei){var za=ms(ca.value),Ei=Ro(ca.value),fi=ca.value!==null?ca.value:ei;if(!de)de=za;else if(za!==de)return[new uo(ca.key,fi,za+" stop domain type must match previous stop domain type "+de)];if(za!=="number"&&za!=="string"&&za!=="boolean")return[new uo(ca.key,fi,"stop domain value must be a number, string, or boolean")];if(za!=="number"&&Z!=="categorical"){var Si="number expected, "+za+" found";return yu(P)&&Z===void 0&&(Si+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new uo(ca.key,fi,Si)]}return Z==="categorical"&&za==="number"&&(!isFinite(Ei)||Math.floor(Ei)!==Ei)?[new uo(ca.key,fi,"integer expected, found "+Ei)]:Z!=="categorical"&&za==="number"&&$e!==void 0&&Ei<$e?[new uo(ca.key,fi,"stop domain values must appear in ascending order")]:($e=Ei,Z==="categorical"&&Ei in Oe?[new uo(ca.key,fi,"stop domain values must be unique")]:(Oe[Ei]=!0,[]))}function Pn(ca){return Ws({key:ca.key,value:ca.value,valueSpec:P,style:ca.style,styleSpec:ca.styleSpec})}}function xr(C){var P=(C.expressionContext==="property"?bc:as)(El(C.value),C.valueSpec);if(P.result==="error")return P.value.map(function(de){return new uo(""+C.key+de.key,C.value,de.message)});var Z=P.value.expression||P.value._styleExpression.expression;if(C.expressionContext==="property"&&C.propertyKey==="text-font"&&!Z.outputDefined())return[new uo(C.key,C.value,'Invalid data expression for "'+C.propertyKey+'". Output values must be contained as literals within the expression.')];if(C.expressionContext==="property"&&C.propertyType==="layout"&&!du(Z))return[new uo(C.key,C.value,'"feature-state" data expressions are not supported with layout properties.')];if(C.expressionContext==="filter"&&!du(Z))return[new uo(C.key,C.value,'"feature-state" data expressions are not supported with filters.')];if(C.expressionContext&&C.expressionContext.indexOf("cluster")===0){if(!gc(Z,["zoom","feature-state"]))return[new uo(C.key,C.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(C.expressionContext==="cluster-initial"&&!vh(Z))return[new uo(C.key,C.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Or(C){var P=C.value,Z=C.key,de=ms(P);return de!=="boolean"?[new uo(Z,P,"boolean expected, "+de+" found")]:[]}function Ur(C){var P=C.key,Z=C.value,de=ms(Z);return de!=="string"?[new uo(P,Z,"color expected, "+de+" found")]:Hf(Z)===null?[new uo(P,Z,'color expected, "'+Z+'" found')]:[]}function hn(C){var P=C.key,Z=C.value,de=C.valueSpec,Oe=[];return Array.isArray(de.values)?de.values.indexOf(Ro(Z))===-1&&Oe.push(new uo(P,Z,"expected one of ["+de.values.join(", ")+"], "+JSON.stringify(Z)+" found")):Object.keys(de.values).indexOf(Ro(Z))===-1&&Oe.push(new uo(P,Z,"expected one of ["+Object.keys(de.values).join(", ")+"], "+JSON.stringify(Z)+" found")),Oe}function Cn(C){if(C===!0||C===!1)return!0;if(!Array.isArray(C)||C.length===0)return!1;switch(C[0]){case"has":return C.length>=2&&C[1]!=="$id"&&C[1]!=="$type";case"in":return C.length>=3&&(typeof C[1]!="string"||Array.isArray(C[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return C.length!==3||Array.isArray(C[1])||Array.isArray(C[2]);case"any":case"all":for(var P=0,Z=C.slice(1);PP?1:0}function Pt(C){if(!Array.isArray(C))return!1;if(C[0]==="within")return!0;for(var P=1;P"||P==="<="||P===">="?zt(C[1],C[2],P):P==="any"?Xt(C.slice(1)):P==="all"?["all"].concat(C.slice(1).map(qt)):P==="none"?["all"].concat(C.slice(1).map(qt).map(Vr)):P==="in"?Mr(C[1],C.slice(2)):P==="!in"?Vr(Mr(C[1],C.slice(2))):P==="has"?Rr(C[1]):P==="!has"?Vr(Rr(C[1])):P==="within"?C:!0;return Z}function zt(C,P,Z){switch(C){case"$type":return["filter-type-"+Z,P];case"$id":return["filter-id-"+Z,P];default:return["filter-"+Z,C,P]}}function Xt(C){return["any"].concat(C.map(qt))}function Mr(C,P){if(P.length===0)return!1;switch(C){case"$type":return["filter-type-in",["literal",P]];case"$id":return["filter-id-in",["literal",P]];default:return P.length>200&&!P.some(function(Z){return typeof Z!=typeof P[0]})?["filter-in-large",C,["literal",P.sort(Tt)]]:["filter-in-small",C,["literal",P]]}}function Rr(C){switch(C){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",C]}}function Vr(C){return["!",C]}function an(C){return Cn(El(C.value))?xr(Cs({},C,{expressionContext:"filter",valueSpec:{value:"boolean"}})):mn(C)}function mn(C){var P=C.value,Z=C.key;if(ms(P)!=="array")return[new uo(Z,P,"array expected, "+ms(P)+" found")];var de=C.styleSpec,Oe,$e=[];if(P.length<1)return[new uo(Z,P,"filter array must have at least 1 element")];switch($e=$e.concat(hn({key:Z+"[0]",value:P[0],valueSpec:de.filter_operator,style:C.style,styleSpec:C.styleSpec})),Ro(P[0])){case"<":case"<=":case">":case">=":P.length>=2&&Ro(P[1])==="$type"&&$e.push(new uo(Z,P,'"$type" cannot be use with operator "'+P[0]+'"'));case"==":case"!=":P.length!==3&&$e.push(new uo(Z,P,'filter array for operator "'+P[0]+'" must have 3 elements'));case"in":case"!in":P.length>=2&&(Oe=ms(P[1]),Oe!=="string"&&$e.push(new uo(Z+"[1]",P[1],"string expected, "+Oe+" found")));for(var nt=2;nt=wr[un+0]&&de>=wr[un+1])?(nt[dn]=!0,$e.push(hr[dn])):nt[dn]=!1}}},pt.prototype._forEachCell=function(C,P,Z,de,Oe,$e,nt,Et){for(var Zt=this._convertToCellCoord(C),hr=this._convertToCellCoord(P),wr=this._convertToCellCoord(Z),Wr=this._convertToCellCoord(de),dn=Zt;dn<=wr;dn++)for(var un=hr;un<=Wr;un++){var Pn=this.d*un+dn;if(!(Et&&!Et(this._convertFromCellCoord(dn),this._convertFromCellCoord(un),this._convertFromCellCoord(dn+1),this._convertFromCellCoord(un+1)))&&Oe.call(this,C,P,Z,de,Pn,$e,nt,Et))return}},pt.prototype._convertFromCellCoord=function(C){return(C-this.padding)/this.scale},pt.prototype._convertToCellCoord=function(C){return Math.max(0,Math.min(this.d-1,Math.floor(C*this.scale)+this.padding))},pt.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var C=this.cells,P=Ye+this.cells.length+1+1,Z=0,de=0;de=0)){var Wr=C[wr];hr[wr]=jt[Zt].shallow.indexOf(wr)>=0?Wr:nn(Wr,P)}C instanceof Error&&(hr.message=C.message)}if(hr.$name)throw new Error("$name property is reserved for worker serialization logic.");return Zt!=="Object"&&(hr.$name=Zt),hr}throw new Error("can't serialize object of type "+typeof C)}function wn(C){if(C==null||typeof C=="boolean"||typeof C=="number"||typeof C=="string"||C instanceof Boolean||C instanceof Number||C instanceof String||C instanceof Date||C instanceof RegExp||kr(C)||on(C)||ArrayBuffer.isView(C)||C instanceof Lt)return C;if(Array.isArray(C))return C.map(wn);if(typeof C=="object"){var P=C.$name||"Object",Z=jt[P],de=Z.klass;if(!de)throw new Error("can't deserialize unregistered class "+P);if(de.deserialize)return de.deserialize(C);for(var Oe=Object.create(de.prototype),$e=0,nt=Object.keys(C);$e=0?Zt:wn(Zt)}}return Oe}throw new Error("can't deserialize object of type "+typeof C)}var Rn=function(){this.first=!0};Rn.prototype.update=function(P,Z){var de=Math.floor(P);return this.first?(this.first=!1,this.lastIntegerZoom=de,this.lastIntegerZoomTime=0,this.lastZoom=P,this.lastFloorZoom=de,!0):(this.lastFloorZoom>de?(this.lastIntegerZoom=de+1,this.lastIntegerZoomTime=Z):this.lastFloorZoom=128&&C<=255},Arabic:function(C){return C>=1536&&C<=1791},"Arabic Supplement":function(C){return C>=1872&&C<=1919},"Arabic Extended-A":function(C){return C>=2208&&C<=2303},"Hangul Jamo":function(C){return C>=4352&&C<=4607},"Unified Canadian Aboriginal Syllabics":function(C){return C>=5120&&C<=5759},Khmer:function(C){return C>=6016&&C<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(C){return C>=6320&&C<=6399},"General Punctuation":function(C){return C>=8192&&C<=8303},"Letterlike Symbols":function(C){return C>=8448&&C<=8527},"Number Forms":function(C){return C>=8528&&C<=8591},"Miscellaneous Technical":function(C){return C>=8960&&C<=9215},"Control Pictures":function(C){return C>=9216&&C<=9279},"Optical Character Recognition":function(C){return C>=9280&&C<=9311},"Enclosed Alphanumerics":function(C){return C>=9312&&C<=9471},"Geometric Shapes":function(C){return C>=9632&&C<=9727},"Miscellaneous Symbols":function(C){return C>=9728&&C<=9983},"Miscellaneous Symbols and Arrows":function(C){return C>=11008&&C<=11263},"CJK Radicals Supplement":function(C){return C>=11904&&C<=12031},"Kangxi Radicals":function(C){return C>=12032&&C<=12255},"Ideographic Description Characters":function(C){return C>=12272&&C<=12287},"CJK Symbols and Punctuation":function(C){return C>=12288&&C<=12351},Hiragana:function(C){return C>=12352&&C<=12447},Katakana:function(C){return C>=12448&&C<=12543},Bopomofo:function(C){return C>=12544&&C<=12591},"Hangul Compatibility Jamo":function(C){return C>=12592&&C<=12687},Kanbun:function(C){return C>=12688&&C<=12703},"Bopomofo Extended":function(C){return C>=12704&&C<=12735},"CJK Strokes":function(C){return C>=12736&&C<=12783},"Katakana Phonetic Extensions":function(C){return C>=12784&&C<=12799},"Enclosed CJK Letters and Months":function(C){return C>=12800&&C<=13055},"CJK Compatibility":function(C){return C>=13056&&C<=13311},"CJK Unified Ideographs Extension A":function(C){return C>=13312&&C<=19903},"Yijing Hexagram Symbols":function(C){return C>=19904&&C<=19967},"CJK Unified Ideographs":function(C){return C>=19968&&C<=40959},"Yi Syllables":function(C){return C>=40960&&C<=42127},"Yi Radicals":function(C){return C>=42128&&C<=42191},"Hangul Jamo Extended-A":function(C){return C>=43360&&C<=43391},"Hangul Syllables":function(C){return C>=44032&&C<=55215},"Hangul Jamo Extended-B":function(C){return C>=55216&&C<=55295},"Private Use Area":function(C){return C>=57344&&C<=63743},"CJK Compatibility Ideographs":function(C){return C>=63744&&C<=64255},"Arabic Presentation Forms-A":function(C){return C>=64336&&C<=65023},"Vertical Forms":function(C){return C>=65040&&C<=65055},"CJK Compatibility Forms":function(C){return C>=65072&&C<=65103},"Small Form Variants":function(C){return C>=65104&&C<=65135},"Arabic Presentation Forms-B":function(C){return C>=65136&&C<=65279},"Halfwidth and Fullwidth Forms":function(C){return C>=65280&&C<=65519}};function qa(C){for(var P=0,Z=C;P=65097&&C<=65103)||Nn["CJK Compatibility Ideographs"](C)||Nn["CJK Compatibility"](C)||Nn["CJK Radicals Supplement"](C)||Nn["CJK Strokes"](C)||Nn["CJK Symbols and Punctuation"](C)&&!(C>=12296&&C<=12305)&&!(C>=12308&&C<=12319)&&C!==12336||Nn["CJK Unified Ideographs Extension A"](C)||Nn["CJK Unified Ideographs"](C)||Nn["Enclosed CJK Letters and Months"](C)||Nn["Hangul Compatibility Jamo"](C)||Nn["Hangul Jamo Extended-A"](C)||Nn["Hangul Jamo Extended-B"](C)||Nn["Hangul Jamo"](C)||Nn["Hangul Syllables"](C)||Nn.Hiragana(C)||Nn["Ideographic Description Characters"](C)||Nn.Kanbun(C)||Nn["Kangxi Radicals"](C)||Nn["Katakana Phonetic Extensions"](C)||Nn.Katakana(C)&&C!==12540||Nn["Halfwidth and Fullwidth Forms"](C)&&C!==65288&&C!==65289&&C!==65293&&!(C>=65306&&C<=65310)&&C!==65339&&C!==65341&&C!==65343&&!(C>=65371&&C<=65503)&&C!==65507&&!(C>=65512&&C<=65519)||Nn["Small Form Variants"](C)&&!(C>=65112&&C<=65118)&&!(C>=65123&&C<=65126)||Nn["Unified Canadian Aboriginal Syllabics"](C)||Nn["Unified Canadian Aboriginal Syllabics Extended"](C)||Nn["Vertical Forms"](C)||Nn["Yijing Hexagram Symbols"](C)||Nn["Yi Syllables"](C)||Nn["Yi Radicals"](C))}function Ha(C){return!!(Nn["Latin-1 Supplement"](C)&&(C===167||C===169||C===174||C===177||C===188||C===189||C===190||C===215||C===247)||Nn["General Punctuation"](C)&&(C===8214||C===8224||C===8225||C===8240||C===8241||C===8251||C===8252||C===8258||C===8263||C===8264||C===8265||C===8273)||Nn["Letterlike Symbols"](C)||Nn["Number Forms"](C)||Nn["Miscellaneous Technical"](C)&&(C>=8960&&C<=8967||C>=8972&&C<=8991||C>=8996&&C<=9e3||C===9003||C>=9085&&C<=9114||C>=9150&&C<=9165||C===9167||C>=9169&&C<=9179||C>=9186&&C<=9215)||Nn["Control Pictures"](C)&&C!==9251||Nn["Optical Character Recognition"](C)||Nn["Enclosed Alphanumerics"](C)||Nn["Geometric Shapes"](C)||Nn["Miscellaneous Symbols"](C)&&!(C>=9754&&C<=9759)||Nn["Miscellaneous Symbols and Arrows"](C)&&(C>=11026&&C<=11055||C>=11088&&C<=11097||C>=11192&&C<=11243)||Nn["CJK Symbols and Punctuation"](C)||Nn.Katakana(C)||Nn["Private Use Area"](C)||Nn["CJK Compatibility Forms"](C)||Nn["Small Form Variants"](C)||Nn["Halfwidth and Fullwidth Forms"](C)||C===8734||C===8756||C===8757||C>=9984&&C<=10087||C>=10102&&C<=10131||C===65532||C===65533)}function _a(C){return!(Ba(C)||Ha(C))}function gi(C){return Nn.Arabic(C)||Nn["Arabic Supplement"](C)||Nn["Arabic Extended-A"](C)||Nn["Arabic Presentation Forms-A"](C)||Nn["Arabic Presentation Forms-B"](C)}function to(C){return C>=1424&&C<=2303||Nn["Arabic Presentation Forms-A"](C)||Nn["Arabic Presentation Forms-B"](C)}function Vi(C,P){return!(!P&&to(C)||C>=2304&&C<=3583||C>=3840&&C<=4255||Nn.Khmer(C))}function Zi(C){for(var P=0,Z=C;P-1&&(Po=Mo.error),Gs&&Gs(C)};function Eu(){Yl.fire(new Kr("pluginStateChange",{pluginStatus:Po,pluginURL:os}))}var Yl=new Gr,ho=function(){return Po},ks=function(C){return C({pluginStatus:Po,pluginURL:os}),Yl.on("pluginStateChange",C),C},Ys=function(C,P,Z){if(Z===void 0&&(Z=!1),Po===Mo.deferred||Po===Mo.loading||Po===Mo.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");os=Fe.resolveURL(C),Po=Mo.deferred,Gs=P,Eu(),Z||ql()},ql=function(){if(Po!==Mo.deferred||!os)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Po=Mo.loading,Eu(),os&&Mn({url:os},function(C){C?Js(C):(Po=Mo.loaded,Eu())})},Pl={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Po===Mo.loaded||Pl.applyArabicShaping!=null},isLoading:function(){return Po===Mo.loading},setState:function(P){Po=P.pluginStatus,os=P.pluginURL},isParsed:function(){return Pl.applyArabicShaping!=null&&Pl.processBidirectionalText!=null&&Pl.processStyledBidirectionalText!=null},getPluginURL:function(){return os}},fc=function(){!Pl.isLoading()&&!Pl.isLoaded()&&ho()==="deferred"&&ql()},bl=function(P,Z){this.zoom=P,Z?(this.now=Z.now,this.fadeDuration=Z.fadeDuration,this.zoomHistory=Z.zoomHistory,this.transition=Z.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Rn,this.transition={})};bl.prototype.isSupportedScript=function(P){return xo(P,Pl.isLoaded())},bl.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},bl.prototype.getCrossfadeParameters=function(){var P=this.zoom,Z=P-Math.floor(P),de=this.crossFadingFactor();return P>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:Z+(1-Z)*de}:{fromScale:.5,toScale:1,t:1-(1-de)*Z}};var Gl=function(P,Z){this.property=P,this.value=Z,this.expression=I(Z===void 0?P.specification.default:Z,P.specification)};Gl.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Gl.prototype.possiblyEvaluate=function(P,Z,de){return this.property.possiblyEvaluate(this,P,Z,de)};var Lc=function(P){this.property=P,this.value=new Gl(P,void 0)};Lc.prototype.transitioned=function(P,Z){return new St(this.property,this.value,Z,_({},P.transition,this.transition),P.now)},Lc.prototype.untransitioned=function(){return new St(this.property,this.value,null,{},0)};var Tu=function(P){this._properties=P,this._values=Object.create(P.defaultTransitionablePropertyValues)};Tu.prototype.getValue=function(P){return B(this._values[P].value.value)},Tu.prototype.setValue=function(P,Z){this._values.hasOwnProperty(P)||(this._values[P]=new Lc(this._values[P].property)),this._values[P].value=new Gl(this._values[P].property,Z===null?void 0:B(Z))},Tu.prototype.getTransition=function(P){return B(this._values[P].transition)},Tu.prototype.setTransition=function(P,Z){this._values.hasOwnProperty(P)||(this._values[P]=new Lc(this._values[P].property)),this._values[P].transition=B(Z)||void 0},Tu.prototype.serialize=function(){for(var P={},Z=0,de=Object.keys(this._values);Zthis.end)return this.prior=null,$e;if(this.value.isDataDriven())return this.prior=null,$e;if(Oent.zoomHistory.lastIntegerZoom?{from:de,to:Oe}:{from:$e,to:Oe}},P.prototype.interpolate=function(de){return de},P}(Sn),$a=function(P){this.specification=P};$a.prototype.possiblyEvaluate=function(P,Z,de,Oe){if(P.value!==void 0)if(P.expression.kind==="constant"){var $e=P.expression.evaluate(Z,null,{},de,Oe);return this._calculate($e,$e,$e,Z)}else return this._calculate(P.expression.evaluate(new bl(Math.floor(Z.zoom-1),Z)),P.expression.evaluate(new bl(Math.floor(Z.zoom),Z)),P.expression.evaluate(new bl(Math.floor(Z.zoom+1),Z)),Z)},$a.prototype._calculate=function(P,Z,de,Oe){var $e=Oe.zoom;return $e>Oe.zoomHistory.lastIntegerZoom?{from:P,to:Z}:{from:de,to:Z}},$a.prototype.interpolate=function(P){return P};var Wa=function(P){this.specification=P};Wa.prototype.possiblyEvaluate=function(P,Z,de,Oe){return!!P.expression.evaluate(Z,null,{},de,Oe)},Wa.prototype.interpolate=function(){return!1};var oi=function(P){this.properties=P,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var Z in P){var de=P[Z];de.specification.overridable&&this.overridableProperties.push(Z);var Oe=this.defaultPropertyValues[Z]=new Gl(de,void 0),$e=this.defaultTransitionablePropertyValues[Z]=new Lc(de);this.defaultTransitioningPropertyValues[Z]=$e.untransitioned(),this.defaultPossiblyEvaluatedValues[Z]=Oe.possiblyEvaluate({})}};cr("DataDrivenProperty",Sn),cr("DataConstantProperty",En),cr("CrossFadedDataDrivenProperty",Ya),cr("CrossFadedProperty",$a),cr("ColorRampProperty",Wa);var Hi="-transition",Ci=function(C){function P(Z,de){if(C.call(this),this.id=Z.id,this.type=Z.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},Z.type!=="custom"&&(Z=Z,this.metadata=Z.metadata,this.minzoom=Z.minzoom,this.maxzoom=Z.maxzoom,Z.type!=="background"&&(this.source=Z.source,this.sourceLayer=Z["source-layer"],this.filter=Z.filter),de.layout&&(this._unevaluatedLayout=new Dr(de.layout)),de.paint)){this._transitionablePaint=new Tu(de.paint);for(var Oe in Z.paint)this.setPaintProperty(Oe,Z.paint[Oe],{validate:!1});for(var $e in Z.layout)this.setLayoutProperty($e,Z.layout[$e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Aa(de.paint)}}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},P.prototype.getLayoutProperty=function(de){return de==="visibility"?this.visibility:this._unevaluatedLayout.getValue(de)},P.prototype.setLayoutProperty=function(de,Oe,$e){if($e===void 0&&($e={}),Oe!=null){var nt="layers."+this.id+".layout."+de;if(this._validate(Wu,nt,de,Oe,$e))return}if(de==="visibility"){this.visibility=Oe;return}this._unevaluatedLayout.setValue(de,Oe)},P.prototype.getPaintProperty=function(de){return z(de,Hi)?this._transitionablePaint.getTransition(de.slice(0,-Hi.length)):this._transitionablePaint.getValue(de)},P.prototype.setPaintProperty=function(de,Oe,$e){if($e===void 0&&($e={}),Oe!=null){var nt="layers."+this.id+".paint."+de;if(this._validate(Mu,nt,de,Oe,$e))return!1}if(z(de,Hi))return this._transitionablePaint.setTransition(de.slice(0,-Hi.length),Oe||void 0),!1;var Et=this._transitionablePaint._values[de],Zt=Et.property.specification["property-type"]==="cross-faded-data-driven",hr=Et.value.isDataDriven(),wr=Et.value;this._transitionablePaint.setValue(de,Oe),this._handleSpecialPaintPropertyUpdate(de);var Wr=this._transitionablePaint._values[de].value,dn=Wr.isDataDriven();return dn||hr||Zt||this._handleOverridablePaintPropertyUpdate(de,wr,Wr)},P.prototype._handleSpecialPaintPropertyUpdate=function(de){},P.prototype._handleOverridablePaintPropertyUpdate=function(de,Oe,$e){return!1},P.prototype.isHidden=function(de){return this.minzoom&&de=this.maxzoom?!0:this.visibility==="none"},P.prototype.updateTransitions=function(de){this._transitioningPaint=this._transitionablePaint.transitioned(de,this._transitioningPaint)},P.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},P.prototype.recalculate=function(de,Oe){de.getCrossfadeParameters&&(this._crossfadeParameters=de.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(de,void 0,Oe)),this.paint=this._transitioningPaint.possiblyEvaluate(de,void 0,Oe)},P.prototype.serialize=function(){var de={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&&(de.layout=de.layout||{},de.layout.visibility=this.visibility),U(de,function(Oe,$e){return Oe!==void 0&&!($e==="layout"&&!Object.keys(Oe).length)&&!($e==="paint"&&!Object.keys(Oe).length)})},P.prototype._validate=function(de,Oe,$e,nt,Et){return Et===void 0&&(Et={}),Et&&Et.validate===!1?!1:xc(this,de.call(Ms,{key:Oe,layerType:this.type,objectKey:$e,value:nt,styleSpec:Ai,style:{glyphs:!0,sprite:!0}}))},P.prototype.is3D=function(){return!1},P.prototype.isTileClipped=function(){return!1},P.prototype.hasOffscreenPass=function(){return!1},P.prototype.resize=function(){},P.prototype.isStateDependent=function(){for(var de in this.paint._values){var Oe=this.paint.get(de);if(!(!(Oe instanceof Bn)||!yu(Oe.property.specification))&&(Oe.value.kind==="source"||Oe.value.kind==="composite")&&Oe.value.isStateDependent)return!0}return!1},P}(Gr),ai={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Pa=function(P,Z){this._structArray=P,this._pos1=Z*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},pn=128,Zn=5,da=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};da.serialize=function(P,Z){return P._trim(),Z&&(P.isTransferred=!0,Z.push(P.arrayBuffer)),{length:P.length,arrayBuffer:P.arrayBuffer}},da.deserialize=function(P){var Z=Object.create(this.prototype);return Z.arrayBuffer=P.arrayBuffer,Z.length=P.length,Z.capacity=P.arrayBuffer.byteLength/Z.bytesPerElement,Z._refreshViews(),Z},da.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},da.prototype.clear=function(){this.length=0},da.prototype.resize=function(P){this.reserve(P),this.length=P},da.prototype.reserve=function(P){if(P>this.capacity){this.capacity=Math.max(P,Math.floor(this.capacity*Zn),pn),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var Z=this.uint8;this._refreshViews(),Z&&this.uint8.set(Z)}},da.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function Ia(C,P){P===void 0&&(P=1);var Z=0,de=0,Oe=C.map(function(nt){var Et=ga(nt.type),Zt=Z=Ti(Z,Math.max(P,Et)),hr=nt.components||1;return de=Math.max(de,Et),Z+=Et*hr,{name:nt.name,type:nt.type,components:hr,offset:Zt}}),$e=Ti(Z,Math.max(de,P));return{members:Oe,size:$e,alignment:P}}function ga(C){return ai[C].BYTES_PER_ELEMENT}function Ti(C,P){return Math.ceil(C/P)*P}var Qa=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe){var $e=this.length;return this.resize($e+1),this.emplace($e,de,Oe)},P.prototype.emplace=function(de,Oe,$e){var nt=de*2;return this.int16[nt+0]=Oe,this.int16[nt+1]=$e,de},P}(da);Qa.prototype.bytesPerElement=4,cr("StructArrayLayout2i4",Qa);var Ui=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e,nt){var Et=this.length;return this.resize(Et+1),this.emplace(Et,de,Oe,$e,nt)},P.prototype.emplace=function(de,Oe,$e,nt,Et){var Zt=de*4;return this.int16[Zt+0]=Oe,this.int16[Zt+1]=$e,this.int16[Zt+2]=nt,this.int16[Zt+3]=Et,de},P}(da);Ui.prototype.bytesPerElement=8,cr("StructArrayLayout4i8",Ui);var ya=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e,nt,Et,Zt){var hr=this.length;return this.resize(hr+1),this.emplace(hr,de,Oe,$e,nt,Et,Zt)},P.prototype.emplace=function(de,Oe,$e,nt,Et,Zt,hr){var wr=de*6;return this.int16[wr+0]=Oe,this.int16[wr+1]=$e,this.int16[wr+2]=nt,this.int16[wr+3]=Et,this.int16[wr+4]=Zt,this.int16[wr+5]=hr,de},P}(da);ya.prototype.bytesPerElement=12,cr("StructArrayLayout2i4i12",ya);var sa=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e,nt,Et,Zt){var hr=this.length;return this.resize(hr+1),this.emplace(hr,de,Oe,$e,nt,Et,Zt)},P.prototype.emplace=function(de,Oe,$e,nt,Et,Zt,hr){var wr=de*4,Wr=de*8;return this.int16[wr+0]=Oe,this.int16[wr+1]=$e,this.uint8[Wr+4]=nt,this.uint8[Wr+5]=Et,this.uint8[Wr+6]=Zt,this.uint8[Wr+7]=hr,de},P}(da);sa.prototype.bytesPerElement=8,cr("StructArrayLayout2i4ub8",sa);var yi=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe){var $e=this.length;return this.resize($e+1),this.emplace($e,de,Oe)},P.prototype.emplace=function(de,Oe,$e){var nt=de*2;return this.float32[nt+0]=Oe,this.float32[nt+1]=$e,de},P}(da);yi.prototype.bytesPerElement=8,cr("StructArrayLayout2f8",yi);var Wn=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn){var un=this.length;return this.resize(un+1),this.emplace(un,de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn)},P.prototype.emplace=function(de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn,un){var Pn=de*10;return this.uint16[Pn+0]=Oe,this.uint16[Pn+1]=$e,this.uint16[Pn+2]=nt,this.uint16[Pn+3]=Et,this.uint16[Pn+4]=Zt,this.uint16[Pn+5]=hr,this.uint16[Pn+6]=wr,this.uint16[Pn+7]=Wr,this.uint16[Pn+8]=dn,this.uint16[Pn+9]=un,de},P}(da);Wn.prototype.bytesPerElement=20,cr("StructArrayLayout10ui20",Wn);var ui=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn,un,Pn){var ca=this.length;return this.resize(ca+1),this.emplace(ca,de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn,un,Pn)},P.prototype.emplace=function(de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn,un,Pn,ca){var ei=de*12;return this.int16[ei+0]=Oe,this.int16[ei+1]=$e,this.int16[ei+2]=nt,this.int16[ei+3]=Et,this.uint16[ei+4]=Zt,this.uint16[ei+5]=hr,this.uint16[ei+6]=wr,this.uint16[ei+7]=Wr,this.int16[ei+8]=dn,this.int16[ei+9]=un,this.int16[ei+10]=Pn,this.int16[ei+11]=ca,de},P}(da);ui.prototype.bytesPerElement=24,cr("StructArrayLayout4i4ui4i24",ui);var Xa=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e){var nt=this.length;return this.resize(nt+1),this.emplace(nt,de,Oe,$e)},P.prototype.emplace=function(de,Oe,$e,nt){var Et=de*3;return this.float32[Et+0]=Oe,this.float32[Et+1]=$e,this.float32[Et+2]=nt,de},P}(da);Xa.prototype.bytesPerElement=12,cr("StructArrayLayout3f12",Xa);var qi=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de){var Oe=this.length;return this.resize(Oe+1),this.emplace(Oe,de)},P.prototype.emplace=function(de,Oe){var $e=de*1;return this.uint32[$e+0]=Oe,de},P}(da);qi.prototype.bytesPerElement=4,cr("StructArrayLayout1ul4",qi);var Co=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.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)},P.prototype.emplaceBack=function(de,Oe,$e,nt,Et,Zt,hr,wr,Wr){var dn=this.length;return this.resize(dn+1),this.emplace(dn,de,Oe,$e,nt,Et,Zt,hr,wr,Wr)},P.prototype.emplace=function(de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn){var un=de*10,Pn=de*5;return this.int16[un+0]=Oe,this.int16[un+1]=$e,this.int16[un+2]=nt,this.int16[un+3]=Et,this.int16[un+4]=Zt,this.int16[un+5]=hr,this.uint32[Pn+3]=wr,this.uint16[un+8]=Wr,this.uint16[un+9]=dn,de},P}(da);Co.prototype.bytesPerElement=20,cr("StructArrayLayout6i1ul2ui20",Co);var Li=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e,nt,Et,Zt){var hr=this.length;return this.resize(hr+1),this.emplace(hr,de,Oe,$e,nt,Et,Zt)},P.prototype.emplace=function(de,Oe,$e,nt,Et,Zt,hr){var wr=de*6;return this.int16[wr+0]=Oe,this.int16[wr+1]=$e,this.int16[wr+2]=nt,this.int16[wr+3]=Et,this.int16[wr+4]=Zt,this.int16[wr+5]=hr,de},P}(da);Li.prototype.bytesPerElement=12,cr("StructArrayLayout2i2i2i12",Li);var Wi=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e,nt,Et){var Zt=this.length;return this.resize(Zt+1),this.emplace(Zt,de,Oe,$e,nt,Et)},P.prototype.emplace=function(de,Oe,$e,nt,Et,Zt){var hr=de*4,wr=de*8;return this.float32[hr+0]=Oe,this.float32[hr+1]=$e,this.float32[hr+2]=nt,this.int16[wr+6]=Et,this.int16[wr+7]=Zt,de},P}(da);Wi.prototype.bytesPerElement=16,cr("StructArrayLayout2f1f2i16",Wi);var ii=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e,nt){var Et=this.length;return this.resize(Et+1),this.emplace(Et,de,Oe,$e,nt)},P.prototype.emplace=function(de,Oe,$e,nt,Et){var Zt=de*12,hr=de*3;return this.uint8[Zt+0]=Oe,this.uint8[Zt+1]=$e,this.float32[hr+1]=nt,this.float32[hr+2]=Et,de},P}(da);ii.prototype.bytesPerElement=12,cr("StructArrayLayout2ub2f12",ii);var Ao=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e){var nt=this.length;return this.resize(nt+1),this.emplace(nt,de,Oe,$e)},P.prototype.emplace=function(de,Oe,$e,nt){var Et=de*3;return this.uint16[Et+0]=Oe,this.uint16[Et+1]=$e,this.uint16[Et+2]=nt,de},P}(da);Ao.prototype.bytesPerElement=6,cr("StructArrayLayout3ui6",Ao);var Uo=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.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)},P.prototype.emplaceBack=function(de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn,un,Pn,ca,ei,za,Ei,fi){var Si=this.length;return this.resize(Si+1),this.emplace(Si,de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn,un,Pn,ca,ei,za,Ei,fi)},P.prototype.emplace=function(de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn,un,Pn,ca,ei,za,Ei,fi,Si){var zi=de*24,ao=de*12,wo=de*48;return this.int16[zi+0]=Oe,this.int16[zi+1]=$e,this.uint16[zi+2]=nt,this.uint16[zi+3]=Et,this.uint32[ao+2]=Zt,this.uint32[ao+3]=hr,this.uint32[ao+4]=wr,this.uint16[zi+10]=Wr,this.uint16[zi+11]=dn,this.uint16[zi+12]=un,this.float32[ao+7]=Pn,this.float32[ao+8]=ca,this.uint8[wo+36]=ei,this.uint8[wo+37]=za,this.uint8[wo+38]=Ei,this.uint32[ao+10]=fi,this.int16[zi+22]=Si,de},P}(da);Uo.prototype.bytesPerElement=48,cr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Uo);var Ko=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.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)},P.prototype.emplaceBack=function(de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn,un,Pn,ca,ei,za,Ei,fi,Si,zi,ao,wo,_o,ss,Oo,Xo,ll,ls,ps){var Nl=this.length;return this.resize(Nl+1),this.emplace(Nl,de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn,un,Pn,ca,ei,za,Ei,fi,Si,zi,ao,wo,_o,ss,Oo,Xo,ll,ls,ps)},P.prototype.emplace=function(de,Oe,$e,nt,Et,Zt,hr,wr,Wr,dn,un,Pn,ca,ei,za,Ei,fi,Si,zi,ao,wo,_o,ss,Oo,Xo,ll,ls,ps,Nl){var el=de*34,Iu=de*17;return this.int16[el+0]=Oe,this.int16[el+1]=$e,this.int16[el+2]=nt,this.int16[el+3]=Et,this.int16[el+4]=Zt,this.int16[el+5]=hr,this.int16[el+6]=wr,this.int16[el+7]=Wr,this.uint16[el+8]=dn,this.uint16[el+9]=un,this.uint16[el+10]=Pn,this.uint16[el+11]=ca,this.uint16[el+12]=ei,this.uint16[el+13]=za,this.uint16[el+14]=Ei,this.uint16[el+15]=fi,this.uint16[el+16]=Si,this.uint16[el+17]=zi,this.uint16[el+18]=ao,this.uint16[el+19]=wo,this.uint16[el+20]=_o,this.uint16[el+21]=ss,this.uint16[el+22]=Oo,this.uint32[Iu+12]=Xo,this.float32[Iu+13]=ll,this.float32[Iu+14]=ls,this.float32[Iu+15]=ps,this.float32[Iu+16]=Nl,de},P}(da);Ko.prototype.bytesPerElement=68,cr("StructArrayLayout8i15ui1ul4f68",Ko);var il=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de){var Oe=this.length;return this.resize(Oe+1),this.emplace(Oe,de)},P.prototype.emplace=function(de,Oe){var $e=de*1;return this.float32[$e+0]=Oe,de},P}(da);il.prototype.bytesPerElement=4,cr("StructArrayLayout1f4",il);var Jo=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e){var nt=this.length;return this.resize(nt+1),this.emplace(nt,de,Oe,$e)},P.prototype.emplace=function(de,Oe,$e,nt){var Et=de*3;return this.int16[Et+0]=Oe,this.int16[Et+1]=$e,this.int16[Et+2]=nt,de},P}(da);Jo.prototype.bytesPerElement=6,cr("StructArrayLayout3i6",Jo);var _u=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e){var nt=this.length;return this.resize(nt+1),this.emplace(nt,de,Oe,$e)},P.prototype.emplace=function(de,Oe,$e,nt){var Et=de*2,Zt=de*4;return this.uint32[Et+0]=Oe,this.uint16[Zt+2]=$e,this.uint16[Zt+3]=nt,de},P}(da);_u.prototype.bytesPerElement=8,cr("StructArrayLayout1ul2ui8",_u);var Xs=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe){var $e=this.length;return this.resize($e+1),this.emplace($e,de,Oe)},P.prototype.emplace=function(de,Oe,$e){var nt=de*2;return this.uint16[nt+0]=Oe,this.uint16[nt+1]=$e,de},P}(da);Xs.prototype.bytesPerElement=4,cr("StructArrayLayout2ui4",Xs);var cu=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de){var Oe=this.length;return this.resize(Oe+1),this.emplace(Oe,de)},P.prototype.emplace=function(de,Oe){var $e=de*1;return this.uint16[$e+0]=Oe,de},P}(da);cu.prototype.bytesPerElement=2,cr("StructArrayLayout1ui2",cu);var Pu=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},P.prototype.emplaceBack=function(de,Oe,$e,nt){var Et=this.length;return this.resize(Et+1),this.emplace(Et,de,Oe,$e,nt)},P.prototype.emplace=function(de,Oe,$e,nt,Et){var Zt=de*4;return this.float32[Zt+0]=Oe,this.float32[Zt+1]=$e,this.float32[Zt+2]=nt,this.float32[Zt+3]=Et,de},P}(da);Pu.prototype.bytesPerElement=16,cr("StructArrayLayout4f16",Pu);var Uu=function(C){function P(){C.apply(this,arguments)}C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P;var Z={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 Z.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},Z.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},Z.x1.get=function(){return this._structArray.int16[this._pos2+2]},Z.y1.get=function(){return this._structArray.int16[this._pos2+3]},Z.x2.get=function(){return this._structArray.int16[this._pos2+4]},Z.y2.get=function(){return this._structArray.int16[this._pos2+5]},Z.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},Z.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},Z.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},Z.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(P.prototype,Z),P}(Pa);Uu.prototype.size=20;var Xc=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.get=function(de){return new Uu(this,de)},P}(Co);cr("CollisionBoxArray",Xc);var Xl=function(C){function P(){C.apply(this,arguments)}C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P;var Z={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 Z.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},Z.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},Z.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},Z.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},Z.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},Z.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},Z.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},Z.segment.get=function(){return this._structArray.uint16[this._pos2+10]},Z.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},Z.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},Z.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},Z.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},Z.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},Z.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},Z.placedOrientation.set=function(de){this._structArray.uint8[this._pos1+37]=de},Z.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},Z.hidden.set=function(de){this._structArray.uint8[this._pos1+38]=de},Z.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},Z.crossTileID.set=function(de){this._structArray.uint32[this._pos4+10]=de},Z.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(P.prototype,Z),P}(Pa);Xl.prototype.size=48;var au=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.get=function(de){return new Xl(this,de)},P}(Uo);cr("PlacedSymbolArray",au);var mo=function(C){function P(){C.apply(this,arguments)}C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P;var Z={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 Z.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},Z.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},Z.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},Z.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},Z.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},Z.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},Z.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},Z.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},Z.key.get=function(){return this._structArray.uint16[this._pos2+8]},Z.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},Z.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},Z.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},Z.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},Z.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},Z.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},Z.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},Z.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},Z.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},Z.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},Z.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},Z.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},Z.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},Z.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},Z.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},Z.crossTileID.set=function(de){this._structArray.uint32[this._pos4+12]=de},Z.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},Z.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},Z.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},Z.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(P.prototype,Z),P}(Pa);mo.prototype.size=68;var ju=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.get=function(de){return new mo(this,de)},P}(Ko);cr("SymbolInstanceArray",ju);var zs=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.getoffsetX=function(de){return this.float32[de*1+0]},P}(il);cr("GlyphOffsetArray",zs);var Ll=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.getx=function(de){return this.int16[de*3+0]},P.prototype.gety=function(de){return this.int16[de*3+1]},P.prototype.gettileUnitDistanceFromAnchor=function(de){return this.int16[de*3+2]},P}(Jo);cr("SymbolLineVertexArray",Ll);var Zu=function(C){function P(){C.apply(this,arguments)}C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P;var Z={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return Z.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},Z.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},Z.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(P.prototype,Z),P}(Pa);Zu.prototype.size=8;var Ku=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.get=function(de){return new Zu(this,de)},P}(_u);cr("FeatureIndexArray",Ku);var Eo=Ia([{name:"a_pos",components:2,type:"Int16"}],4),hs=Eo.members,gs=function(P){P===void 0&&(P=[]),this.segments=P};gs.prototype.prepareSegment=function(P,Z,de,Oe){var $e=this.segments[this.segments.length-1];return P>gs.MAX_VERTEX_ARRAY_LENGTH&&q("Max vertices per segment is "+gs.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+P),(!$e||$e.vertexLength+P>gs.MAX_VERTEX_ARRAY_LENGTH||$e.sortKey!==Oe)&&($e={vertexOffset:Z.length,primitiveOffset:de.length,vertexLength:0,primitiveLength:0},Oe!==void 0&&($e.sortKey=Oe),this.segments.push($e)),$e},gs.prototype.get=function(){return this.segments},gs.prototype.destroy=function(){for(var P=0,Z=this.segments;P>>16)*Zt&65535)<<16)&4294967295,wr=wr<<15|wr>>>17,wr=(wr&65535)*hr+(((wr>>>16)*hr&65535)<<16)&4294967295,nt^=wr,nt=nt<<13|nt>>>19,Et=(nt&65535)*5+(((nt>>>16)*5&65535)<<16)&4294967295,nt=(Et&65535)+27492+(((Et>>>16)+58964&65535)<<16);switch(wr=0,Oe){case 3:wr^=(Z.charCodeAt(Wr+2)&255)<<16;case 2:wr^=(Z.charCodeAt(Wr+1)&255)<<8;case 1:wr^=Z.charCodeAt(Wr)&255,wr=(wr&65535)*Zt+(((wr>>>16)*Zt&65535)<<16)&4294967295,wr=wr<<15|wr>>>17,wr=(wr&65535)*hr+(((wr>>>16)*hr&65535)<<16)&4294967295,nt^=wr}return nt^=Z.length,nt^=nt>>>16,nt=(nt&65535)*2246822507+(((nt>>>16)*2246822507&65535)<<16)&4294967295,nt^=nt>>>13,nt=(nt&65535)*3266489909+(((nt>>>16)*3266489909&65535)<<16)&4294967295,nt^=nt>>>16,nt>>>0}C.exports=P}),re=t(function(C){function P(Z,de){for(var Oe=Z.length,$e=de^Oe,nt=0,Et;Oe>=4;)Et=Z.charCodeAt(nt)&255|(Z.charCodeAt(++nt)&255)<<8|(Z.charCodeAt(++nt)&255)<<16|(Z.charCodeAt(++nt)&255)<<24,Et=(Et&65535)*1540483477+(((Et>>>16)*1540483477&65535)<<16),Et^=Et>>>24,Et=(Et&65535)*1540483477+(((Et>>>16)*1540483477&65535)<<16),$e=($e&65535)*1540483477+((($e>>>16)*1540483477&65535)<<16)^Et,Oe-=4,++nt;switch(Oe){case 3:$e^=(Z.charCodeAt(nt+2)&255)<<16;case 2:$e^=(Z.charCodeAt(nt+1)&255)<<8;case 1:$e^=Z.charCodeAt(nt)&255,$e=($e&65535)*1540483477+((($e>>>16)*1540483477&65535)<<16)}return $e^=$e>>>13,$e=($e&65535)*1540483477+((($e>>>16)*1540483477&65535)<<16),$e^=$e>>>15,$e>>>0}C.exports=P}),Le=xe,et=xe,xt=re;Le.murmur3=et,Le.murmur2=xt;var At=function(){this.ids=[],this.positions=[],this.indexed=!1};At.prototype.add=function(P,Z,de,Oe){this.ids.push(gt(P)),this.positions.push(Z,de,Oe)},At.prototype.getPositions=function(P){for(var Z=gt(P),de=0,Oe=this.ids.length-1;de>1;this.ids[$e]>=Z?Oe=$e:de=$e+1}for(var nt=[];this.ids[de]===Z;){var Et=this.positions[3*de],Zt=this.positions[3*de+1],hr=this.positions[3*de+2];nt.push({index:Et,start:Zt,end:hr}),de++}return nt},At.serialize=function(P,Z){var de=new Float64Array(P.ids),Oe=new Uint32Array(P.positions);return It(de,Oe,0,de.length-1),Z&&Z.push(de.buffer,Oe.buffer),{ids:de,positions:Oe}},At.deserialize=function(P){var Z=new At;return Z.ids=P.ids,Z.positions=P.positions,Z.indexed=!0,Z};var lt=Math.pow(2,53)-1;function gt(C){var P=+C;return!isNaN(P)&&P<=lt?P:Le(String(C))}function It(C,P,Z,de){for(;Z>1],$e=Z-1,nt=de+1;;){do $e++;while(C[$e]Oe);if($e>=nt)break;ar(C,$e,nt),ar(P,3*$e,3*nt),ar(P,3*$e+1,3*nt+1),ar(P,3*$e+2,3*nt+2)}nt-Znt.x+1||Ztnt.y+1)&&q("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return Z}function dl(C,P){return{type:C.type,id:C.id,properties:C.properties,geometry:P?ol(C):[]}}function hl(C,P,Z,de,Oe){C.emplaceBack(P*2+(de+1)/2,Z*2+(Oe+1)/2)}var Vu=function(P){this.zoom=P.zoom,this.overscaling=P.overscaling,this.layers=P.layers,this.layerIds=this.layers.map(function(Z){return Z.id}),this.index=P.index,this.hasPattern=!1,this.layoutVertexArray=new Qa,this.indexArray=new Ao,this.segments=new gs,this.programConfigurations=new Sa(P.layers,P.zoom),this.stateDependentLayerIds=this.layers.filter(function(Z){return Z.isStateDependent()}).map(function(Z){return Z.id})};Vu.prototype.populate=function(P,Z,de){var Oe=this.layers[0],$e=[],nt=null;Oe.type==="circle"&&(nt=Oe.layout.get("circle-sort-key"));for(var Et=0,Zt=P;Et=Yi||dn<0||dn>=Yi)){var un=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,P.sortKey),Pn=un.vertexLength;hl(this.layoutVertexArray,Wr,dn,-1,-1),hl(this.layoutVertexArray,Wr,dn,1,-1),hl(this.layoutVertexArray,Wr,dn,1,1),hl(this.layoutVertexArray,Wr,dn,-1,1),this.indexArray.emplaceBack(Pn,Pn+1,Pn+2),this.indexArray.emplaceBack(Pn,Pn+3,Pn+2),un.vertexLength+=4,un.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,P,de,{},Oe)},cr("CircleBucket",Vu,{omit:["layers"]});function tl(C,P){for(var Z=0;Z=3){for(var $e=0;$e1){if(Rd(C,P))return!0;for(var de=0;de1?C.distSqr(Z):C.distSqr(Z.sub(P)._mult(Oe)._add(P))}function Zd(C,P){for(var Z=!1,de,Oe,$e,nt=0;ntP.y!=$e.y>P.y&&P.x<($e.x-Oe.x)*(P.y-Oe.y)/($e.y-Oe.y)+Oe.x&&(Z=!Z)}return Z}function nd(C,P){for(var Z=!1,de=0,Oe=C.length-1;deP.y!=nt.y>P.y&&P.x<(nt.x-$e.x)*(P.y-$e.y)/(nt.y-$e.y)+$e.x&&(Z=!Z)}return Z}function Kd(C,P,Z,de,Oe){for(var $e=0,nt=C;$e=Et.x&&Oe>=Et.y)return!0}var Zt=[new i(P,Z),new i(P,Oe),new i(de,Oe),new i(de,Z)];if(C.length>2)for(var hr=0,wr=Zt;hrOe.x&&P.x>Oe.x||C.yOe.y&&P.y>Oe.y)return!1;var $e=J(C,P,Z[0]);return $e!==J(C,P,Z[1])||$e!==J(C,P,Z[2])||$e!==J(C,P,Z[3])}function ad(C,P,Z){var de=P.paint.get(C).value;return de.kind==="constant"?de.value:Z.programConfigurations.get(P.id).getMaxValue(C)}function Od(C){return Math.sqrt(C[0]*C[0]+C[1]*C[1])}function Hd(C,P,Z,de,Oe){if(!P[0]&&!P[1])return C;var $e=i.convert(P)._mult(Oe);Z==="viewport"&&$e._rotate(-de);for(var nt=[],Et=0;Et0&&($e=1/Math.sqrt($e)),C[0]=P[0]*$e,C[1]=P[1]*$e,C[2]=P[2]*$e,C}function Nx(C,P){return C[0]*P[0]+C[1]*P[1]+C[2]*P[2]}function Bx(C,P,Z){var de=P[0],Oe=P[1],$e=P[2],nt=Z[0],Et=Z[1],Zt=Z[2];return C[0]=Oe*Zt-$e*Et,C[1]=$e*nt-de*Zt,C[2]=de*Et-Oe*nt,C}function Ux(C,P,Z){var de=P[0],Oe=P[1],$e=P[2];return C[0]=de*Z[0]+Oe*Z[3]+$e*Z[6],C[1]=de*Z[1]+Oe*Z[4]+$e*Z[7],C[2]=de*Z[2]+Oe*Z[5]+$e*Z[8],C}var jx=Yp;(function(){var C=Wp();return function(P,Z,de,Oe,$e,nt){var Et,Zt;for(Z||(Z=3),de||(de=0),Oe?Zt=Math.min(Oe*Z+de,P.length):Zt=P.length,Et=de;EtC.width||Oe.height>C.height||Z.x>C.width-Oe.width||Z.y>C.height-Oe.height)throw new RangeError("out of range source coordinates for image copy");if(Oe.width>P.width||Oe.height>P.height||de.x>P.width-Oe.width||de.y>P.height-Oe.height)throw new RangeError("out of range destination coordinates for image copy");for(var nt=C.data,Et=P.data,Zt=0;Zt80*Z){Et=hr=C[0],Zt=wr=C[1];for(var Pn=Z;Pnhr&&(hr=Wr),dn>wr&&(wr=dn);un=Math.max(hr-Et,wr-Zt),un=un!==0?1/un:0}return gv($e,nt,Z,Et,Zt,un),nt}function Vg(C,P,Z,de,Oe){var $e,nt;if(Oe===Yg(C,P,Z,de)>0)for($e=P;$e=P;$e-=de)nt=I1($e,C[$e],C[$e+1],nt);return nt&&Zv(nt,nt.next)&&(H0(nt),nt=nt.next),nt}function Pp(C,P){if(!C)return C;P||(P=C);var Z=C,de;do if(de=!1,!Z.steiner&&(Zv(Z,Z.next)||Rf(Z.prev,Z,Z.next)===0)){if(H0(Z),Z=P=Z.prev,Z===Z.next)break;de=!0}else Z=Z.next;while(de||Z!==P);return P}function gv(C,P,Z,de,Oe,$e,nt){if(C){!nt&&$e&&Gg(C,de,Oe,$e);for(var Et=C,Zt,hr;C.prev!==C.next;){if(Zt=C.prev,hr=C.next,$e?Yx(C,de,Oe,$e):qg(C)){P.push(Zt.i/Z),P.push(C.i/Z),P.push(hr.i/Z),H0(C),C=hr.next,Et=hr.next;continue}if(C=hr,C===Et){nt?nt===1?(C=Xx(Pp(C),P,Z),gv(C,P,Z,de,Oe,$e,2)):nt===2&&C1(C,P,Z,de,Oe,$e):gv(Pp(C),P,Z,de,Oe,$e,1);break}}}}function qg(C){var P=C.prev,Z=C,de=C.next;if(Rf(P,Z,de)>=0)return!1;for(var Oe=C.next.next;Oe!==C.prev;){if(Kp(P.x,P.y,Z.x,Z.y,de.x,de.y,Oe.x,Oe.y)&&Rf(Oe.prev,Oe,Oe.next)>=0)return!1;Oe=Oe.next}return!0}function Yx(C,P,Z,de){var Oe=C.prev,$e=C,nt=C.next;if(Rf(Oe,$e,nt)>=0)return!1;for(var Et=Oe.x<$e.x?Oe.x$e.x?Oe.x>nt.x?Oe.x:nt.x:$e.x>nt.x?$e.x:nt.x,wr=Oe.y>$e.y?Oe.y>nt.y?Oe.y:nt.y:$e.y>nt.y?$e.y:nt.y,Wr=Hg(Et,Zt,P,Z,de),dn=Hg(hr,wr,P,Z,de),un=C.prevZ,Pn=C.nextZ;un&&un.z>=Wr&&Pn&&Pn.z<=dn;){if(un!==C.prev&&un!==C.next&&Kp(Oe.x,Oe.y,$e.x,$e.y,nt.x,nt.y,un.x,un.y)&&Rf(un.prev,un,un.next)>=0||(un=un.prevZ,Pn!==C.prev&&Pn!==C.next&&Kp(Oe.x,Oe.y,$e.x,$e.y,nt.x,nt.y,Pn.x,Pn.y)&&Rf(Pn.prev,Pn,Pn.next)>=0))return!1;Pn=Pn.nextZ}for(;un&&un.z>=Wr;){if(un!==C.prev&&un!==C.next&&Kp(Oe.x,Oe.y,$e.x,$e.y,nt.x,nt.y,un.x,un.y)&&Rf(un.prev,un,un.next)>=0)return!1;un=un.prevZ}for(;Pn&&Pn.z<=dn;){if(Pn!==C.prev&&Pn!==C.next&&Kp(Oe.x,Oe.y,$e.x,$e.y,nt.x,nt.y,Pn.x,Pn.y)&&Rf(Pn.prev,Pn,Pn.next)>=0)return!1;Pn=Pn.nextZ}return!0}function Xx(C,P,Z){var de=C;do{var Oe=de.prev,$e=de.next.next;!Zv(Oe,$e)&&yv(Oe,de,de.next,$e)&&Kv(Oe,$e)&&Kv($e,Oe)&&(P.push(Oe.i/Z),P.push(de.i/Z),P.push($e.i/Z),H0(de),H0(de.next),de=C=$e),de=de.next}while(de!==C);return Pp(de)}function C1(C,P,Z,de,Oe,$e){var nt=C;do{for(var Et=nt.next.next;Et!==nt.prev;){if(nt.i!==Et.i&&Kx(nt,Et)){var Zt=Wg(nt,Et);nt=Pp(nt,nt.next),Zt=Pp(Zt,Zt.next),gv(nt,P,Z,de,Oe,$e),gv(Zt,P,Z,de,Oe,$e);return}Et=Et.next}nt=nt.next}while(nt!==C)}function P1(C,P,Z,de){var Oe=[],$e,nt,Et,Zt,hr;for($e=0,nt=P.length;$e=Z.next.y&&Z.next.y!==Z.y){var Et=Z.x+(Oe-Z.y)*(Z.next.x-Z.x)/(Z.next.y-Z.y);if(Et<=de&&Et>$e){if($e=Et,Et===de){if(Oe===Z.y)return Z;if(Oe===Z.next.y)return Z.next}nt=Z.x=Z.x&&Z.x>=hr&&de!==Z.x&&Kp(Oent.x||Z.x===nt.x&&L1(nt,Z)))&&(nt=Z,Wr=dn)),Z=Z.next;while(Z!==Zt);return nt}function L1(C,P){return Rf(C.prev,C,P.prev)<0&&Rf(P.next,C,C.next)<0}function Gg(C,P,Z,de){var Oe=C;do Oe.z===null&&(Oe.z=Hg(Oe.x,Oe.y,P,Z,de)),Oe.prevZ=Oe.prev,Oe.nextZ=Oe.next,Oe=Oe.next;while(Oe!==C);Oe.prevZ.nextZ=null,Oe.prevZ=null,Zx(Oe)}function Zx(C){var P,Z,de,Oe,$e,nt,Et,Zt,hr=1;do{for(Z=C,C=null,$e=null,nt=0;Z;){for(nt++,de=Z,Et=0,P=0;P0||Zt>0&&de;)Et!==0&&(Zt===0||!de||Z.z<=de.z)?(Oe=Z,Z=Z.nextZ,Et--):(Oe=de,de=de.nextZ,Zt--),$e?$e.nextZ=Oe:C=Oe,Oe.prevZ=$e,$e=Oe;Z=de}$e.nextZ=null,hr*=2}while(nt>1);return C}function Hg(C,P,Z,de,Oe){return C=32767*(C-Z)*Oe,P=32767*(P-de)*Oe,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,P=(P|P<<8)&16711935,P=(P|P<<4)&252645135,P=(P|P<<2)&858993459,P=(P|P<<1)&1431655765,C|P<<1}function Nm(C){var P=C,Z=C;do(P.x=0&&(C-nt)*(de-Et)-(Z-nt)*(P-Et)>=0&&(Z-nt)*($e-Et)-(Oe-nt)*(de-Et)>=0}function Kx(C,P){return C.next.i!==P.i&&C.prev.i!==P.i&&!$g(C,P)&&(Kv(C,P)&&Kv(P,C)&&Bm(C,P)&&(Rf(C.prev,C,P.prev)||Rf(C,P.prev,P))||Zv(C,P)&&Rf(C.prev,C,C.next)>0&&Rf(P.prev,P,P.next)>0)}function Rf(C,P,Z){return(P.y-C.y)*(Z.x-P.x)-(P.x-C.x)*(Z.y-P.y)}function Zv(C,P){return C.x===P.x&&C.y===P.y}function yv(C,P,Z,de){var Oe=G0(Rf(C,P,Z)),$e=G0(Rf(C,P,de)),nt=G0(Rf(Z,de,C)),Et=G0(Rf(Z,de,P));return!!(Oe!==$e&&nt!==Et||Oe===0&&q0(C,Z,P)||$e===0&&q0(C,de,P)||nt===0&&q0(Z,C,de)||Et===0&&q0(Z,P,de))}function q0(C,P,Z){return P.x<=Math.max(C.x,Z.x)&&P.x>=Math.min(C.x,Z.x)&&P.y<=Math.max(C.y,Z.y)&&P.y>=Math.min(C.y,Z.y)}function G0(C){return C>0?1:C<0?-1:0}function $g(C,P){var Z=C;do{if(Z.i!==C.i&&Z.next.i!==C.i&&Z.i!==P.i&&Z.next.i!==P.i&&yv(Z,Z.next,C,P))return!0;Z=Z.next}while(Z!==C);return!1}function Kv(C,P){return Rf(C.prev,C,C.next)<0?Rf(C,P,C.next)>=0&&Rf(C,C.prev,P)>=0:Rf(C,P,C.prev)<0||Rf(C,C.next,P)<0}function Bm(C,P){var Z=C,de=!1,Oe=(C.x+P.x)/2,$e=(C.y+P.y)/2;do Z.y>$e!=Z.next.y>$e&&Z.next.y!==Z.y&&Oe<(Z.next.x-Z.x)*($e-Z.y)/(Z.next.y-Z.y)+Z.x&&(de=!de),Z=Z.next;while(Z!==C);return de}function Wg(C,P){var Z=new Um(C.i,C.x,C.y),de=new Um(P.i,P.x,P.y),Oe=C.next,$e=P.prev;return C.next=P,P.prev=C,Z.next=Oe,Oe.prev=Z,de.next=Z,Z.prev=de,$e.next=de,de.prev=$e,de}function I1(C,P,Z,de){var Oe=new Um(C,P,Z);return de?(Oe.next=de.next,Oe.prev=de,de.next.prev=Oe,de.next=Oe):(Oe.prev=Oe,Oe.next=Oe),Oe}function H0(C){C.next.prev=C.prev,C.prev.next=C.next,C.prevZ&&(C.prevZ.nextZ=C.nextZ),C.nextZ&&(C.nextZ.prevZ=C.prevZ)}function Um(C,P,Z){this.i=C,this.x=P,this.y=Z,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}Fm.deviation=function(C,P,Z,de){var Oe=P&&P.length,$e=Oe?P[0]*Z:C.length,nt=Math.abs(Yg(C,0,$e,Z));if(Oe)for(var Et=0,Zt=P.length;Et0&&(de+=C[Oe-1].length,Z.holes.push(de))}return Z},zm.default=k1;function Jx(C,P,Z,de,Oe){D1(C,P,Z,de||C.length-1,Oe||Xg)}function D1(C,P,Z,de,Oe){for(;de>Z;){if(de-Z>600){var $e=de-Z+1,nt=P-Z+1,Et=Math.log($e),Zt=.5*Math.exp(2*Et/3),hr=.5*Math.sqrt(Et*Zt*($e-Zt)/$e)*(nt-$e/2<0?-1:1),wr=Math.max(Z,Math.floor(P-nt*Zt/$e+hr)),Wr=Math.min(de,Math.floor(P+($e-nt)*Zt/$e+hr));D1(C,P,wr,Wr,Oe)}var dn=C[P],un=Z,Pn=de;for($0(C,Z,P),Oe(C[de],dn)>0&&$0(C,Z,de);un0;)Pn--}Oe(C[Z],dn)===0?$0(C,Z,Pn):(Pn++,$0(C,Pn,de)),Pn<=P&&(Z=Pn+1),P<=Pn&&(de=Pn-1)}}function $0(C,P,Z){var de=C[P];C[P]=C[Z],C[Z]=de}function Xg(C,P){return CP?1:0}function fp(C,P){var Z=C.length;if(Z<=1)return[C];for(var de=[],Oe,$e,nt=0;nt1)for(var Zt=0;Zt>3}if(de--,Z===1||Z===2)Oe+=C.readSVarint(),$e+=C.readSVarint(),Z===1&&(Et&&nt.push(Et),Et=[]),Et.push(new i(Oe,$e));else if(Z===7)Et&&Et.push(Et[0].clone());else throw new Error("unknown command "+Z)}return Et&&nt.push(Et),nt},_v.prototype.bbox=function(){var C=this._pbf;C.pos=this._geometry;for(var P=C.readVarint()+C.pos,Z=1,de=0,Oe=0,$e=0,nt=1/0,Et=-1/0,Zt=1/0,hr=-1/0;C.pos>3}if(de--,Z===1||Z===2)Oe+=C.readSVarint(),$e+=C.readSVarint(),OeEt&&(Et=Oe),$ehr&&(hr=$e);else if(Z!==7)throw new Error("unknown command "+Z)}return[nt,Zt,Et,hr]},_v.prototype.toGeoJSON=function(C,P,Z){var de=this.extent*Math.pow(2,Z),Oe=this.extent*C,$e=this.extent*P,nt=this.loadGeometry(),Et=_v.types[this.type],Zt,hr;function wr(un){for(var Pn=0;Pn>3;P=de===1?C.readString():de===2?C.readFloat():de===3?C.readDouble():de===4?C.readVarint64():de===5?C.readVarint():de===6?C.readSVarint():de===7?C.readBoolean():null}return P}V1.prototype.feature=function(C){if(C<0||C>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[C];var P=this._pbf.readVarint()+this._pbf.pos;return new Jv(this._pbf,P,this.extent,this._keys,this._values)};var G1=H1;function H1(C,P){this.layers=C.readFields($1,{},P)}function $1(C,P,Z){if(C===3){var de=new Jg(Z,Z.readVarint()+Z.pos);de.length&&(P[de.name]=de)}}var W1=G1,Qx=Jv,ew=Jg,bv={VectorTile:W1,VectorTileFeature:Qx,VectorTileLayer:ew},Qv=bv.VectorTileFeature.types,Y1=500,e0=Math.pow(2,13);function t0(C,P,Z,de,Oe,$e,nt,Et){C.emplaceBack(P,Z,Math.floor(de*e0)*2+nt,Oe*e0*2,$e*e0*2,Math.round(Et))}var Nd=function(P){this.zoom=P.zoom,this.overscaling=P.overscaling,this.layers=P.layers,this.layerIds=this.layers.map(function(Z){return Z.id}),this.index=P.index,this.hasPattern=!1,this.layoutVertexArray=new ya,this.indexArray=new Ao,this.programConfigurations=new Sa(P.layers,P.zoom),this.segments=new gs,this.stateDependentLayerIds=this.layers.filter(function(Z){return Z.isStateDependent()}).map(function(Z){return Z.id})};Nd.prototype.populate=function(P,Z,de){this.features=[],this.hasPattern=jm("fill-extrusion",this.layers,Z);for(var Oe=0,$e=P;Oe<$e.length;Oe+=1){var nt=$e[Oe],Et=nt.feature,Zt=nt.id,hr=nt.index,wr=nt.sourceLayerIndex,Wr=this.layers[0]._featureFilter.needGeometry,dn=dl(Et,Wr);if(this.layers[0]._featureFilter.filter(new bl(this.zoom),dn,de)){var un={id:Zt,sourceLayerIndex:wr,index:hr,geometry:Wr?dn.geometry:ol(Et),properties:Et.properties,type:Et.type,patterns:{}};this.hasPattern?this.features.push(Vm("fill-extrusion",this.layers,un,this.zoom,Z)):this.addFeature(un,un.geometry,hr,de,{}),Z.featureIndex.insert(Et,un.geometry,hr,wr,this.index,!0)}}},Nd.prototype.addFeatures=function(P,Z,de){for(var Oe=0,$e=this.features;Oe<$e.length;Oe+=1){var nt=$e[Oe],Et=nt.geometry;this.addFeature(nt,Et,nt.index,Z,de)}},Nd.prototype.update=function(P,Z,de){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(P,Z,this.stateDependentLayers,de)},Nd.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Nd.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Nd.prototype.upload=function(P){this.uploaded||(this.layoutVertexBuffer=P.createVertexBuffer(this.layoutVertexArray,$d),this.indexBuffer=P.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(P),this.uploaded=!0},Nd.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Nd.prototype.addFeature=function(P,Z,de,Oe,$e){for(var nt=0,Et=fp(Z,Y1);nt=1){var Si=ei[Ei-1];if(!qm(fi,Si)){un.vertexLength+4>gs.MAX_VERTEX_ARRAY_LENGTH&&(un=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var zi=fi.sub(Si)._perp()._unit(),ao=Si.dist(fi);za+ao>32768&&(za=0),t0(this.layoutVertexArray,fi.x,fi.y,zi.x,zi.y,0,0,za),t0(this.layoutVertexArray,fi.x,fi.y,zi.x,zi.y,0,1,za),za+=ao,t0(this.layoutVertexArray,Si.x,Si.y,zi.x,zi.y,0,0,za),t0(this.layoutVertexArray,Si.x,Si.y,zi.x,zi.y,0,1,za);var wo=un.vertexLength;this.indexArray.emplaceBack(wo,wo+2,wo+1),this.indexArray.emplaceBack(wo+1,wo+2,wo+3),un.vertexLength+=4,un.primitiveLength+=2}}}}if(un.vertexLength+hr>gs.MAX_VERTEX_ARRAY_LENGTH&&(un=this.segments.prepareSegment(hr,this.layoutVertexArray,this.indexArray)),Qv[P.type]==="Polygon"){for(var _o=[],ss=[],Oo=un.vertexLength,Xo=0,ll=Zt;XoYi)||C.y===P.y&&(C.y<0||C.y>Yi)}function Gm(C){return C.every(function(P){return P.x<0})||C.every(function(P){return P.x>Yi})||C.every(function(P){return P.y<0})||C.every(function(P){return P.y>Yi})}var tw=new oi({"fill-extrusion-opacity":new En(Ai["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Sn(Ai["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new En(Ai["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new En(Ai["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ya(Ai["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Sn(Ai["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Sn(Ai["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new En(Ai["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),rw={paint:tw},nw=function(C){function P(Z){C.call(this,Z,rw)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.createBucket=function(de){return new Nd(de)},P.prototype.queryRadius=function(){return Od(this.paint.get("fill-extrusion-translate"))},P.prototype.is3D=function(){return!0},P.prototype.queryIntersectsFeature=function(de,Oe,$e,nt,Et,Zt,hr,wr){var Wr=Hd(de,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Zt.angle,hr),dn=this.paint.get("fill-extrusion-height").evaluate(Oe,$e),un=this.paint.get("fill-extrusion-base").evaluate(Oe,$e),Pn=X1(Wr,wr,Zt,0),ca=Qg(nt,un,dn,wr),ei=ca[0],za=ca[1];return Qp(ei,za,Pn)},P}(Ci);function hp(C,P){return C.x*P.x+C.y*P.y}function Bh(C,P){if(C.length===1){for(var Z=0,de=P[Z++],Oe;!Oe||de.equals(Oe);)if(Oe=P[Z++],!Oe)return 1/0;for(;Z=2&&P[hr-1].equals(P[hr-2]);)hr--;for(var wr=0;wr0;if(_o&&Ei>wr){var Oo=un.dist(Pn);if(Oo>2*Wr){var Xo=un.sub(un.sub(Pn)._mult(Wr/Oo)._round());this.updateDistance(Pn,Xo),this.addCurrentVertex(Xo,ei,0,0,dn),Pn=Xo}}var ll=Pn&&ca,ls=ll?de:Zt?"butt":Oe;if(ll&&ls==="round"&&(ao$e&&(ls="bevel"),ls==="bevel"&&(ao>2&&(ls="flipbevel"),ao<$e&&(ls="miter")),Pn&&this.updateDistance(Pn,un),ls==="miter")fi._mult(ao),this.addCurrentVertex(un,fi,0,0,dn);else if(ls==="flipbevel"){if(ao>100)fi=za.mult(-1);else{var ps=ao*ei.add(za).mag()/ei.sub(za).mag();fi._perp()._mult(ps*(ss?-1:1))}this.addCurrentVertex(un,fi,0,0,dn),this.addCurrentVertex(un,fi.mult(-1),0,0,dn)}else if(ls==="bevel"||ls==="fakeround"){var Nl=-Math.sqrt(ao*ao-1),el=ss?Nl:0,Iu=ss?0:Nl;if(Pn&&this.addCurrentVertex(un,ei,el,Iu,dn),ls==="fakeround")for(var Ac=Math.round(wo*180/Math.PI/ry),Du=1;Du2*Wr){var Ah=un.add(ca.sub(un)._mult(Wr/qh)._round());this.updateDistance(un,Ah),this.addCurrentVertex(Ah,za,0,0,dn),un=Ah}}}}},Zh.prototype.addCurrentVertex=function(P,Z,de,Oe,$e,nt){nt===void 0&&(nt=!1);var Et=Z.x+Z.y*de,Zt=Z.y-Z.x*de,hr=-Z.x+Z.y*Oe,wr=-Z.y-Z.x*Oe;this.addHalfVertex(P,Et,Zt,nt,!1,de,$e),this.addHalfVertex(P,hr,wr,nt,!0,-Oe,$e),this.distance>Hm/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(P,Z,de,Oe,$e,nt))},Zh.prototype.addHalfVertex=function(P,Z,de,Oe,$e,nt,Et){var Zt=P.x,hr=P.y,wr=this.lineClips?this.scaledDistance*(Hm-1):this.scaledDistance,Wr=wr*r0;if(this.layoutVertexArray.emplaceBack((Zt<<1)+(Oe?1:0),(hr<<1)+($e?1:0),Math.round(Q1*Z)+128,Math.round(Q1*de)+128,(nt===0?0:nt<0?-1:1)+1|(Wr&63)<<2,Wr>>6),this.lineClips){var dn=this.scaledDistance-this.lineClips.start,un=this.lineClips.end-this.lineClips.start,Pn=dn/un;this.layoutVertexArray2.emplaceBack(Pn,this.lineClipsArray.length)}var ca=Et.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ca),Et.primitiveLength++),$e?this.e2=ca:this.e1=ca},Zh.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Zh.prototype.updateDistance=function(P,Z){this.distance+=P.dist(Z),this.updateScaledDistance()},cr("LineBucket",Zh,{omit:["layers","patternFeatures"]});var ny=new oi({"line-cap":new En(Ai.layout_line["line-cap"]),"line-join":new Sn(Ai.layout_line["line-join"]),"line-miter-limit":new En(Ai.layout_line["line-miter-limit"]),"line-round-limit":new En(Ai.layout_line["line-round-limit"]),"line-sort-key":new Sn(Ai.layout_line["line-sort-key"])}),$m=new oi({"line-opacity":new Sn(Ai.paint_line["line-opacity"]),"line-color":new Sn(Ai.paint_line["line-color"]),"line-translate":new En(Ai.paint_line["line-translate"]),"line-translate-anchor":new En(Ai.paint_line["line-translate-anchor"]),"line-width":new Sn(Ai.paint_line["line-width"]),"line-gap-width":new Sn(Ai.paint_line["line-gap-width"]),"line-offset":new Sn(Ai.paint_line["line-offset"]),"line-blur":new Sn(Ai.paint_line["line-blur"]),"line-dasharray":new $a(Ai.paint_line["line-dasharray"]),"line-pattern":new Ya(Ai.paint_line["line-pattern"]),"line-gradient":new Wa(Ai.paint_line["line-gradient"])}),n0={paint:$m,layout:ny},ay=function(C){function P(){C.apply(this,arguments)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.possiblyEvaluate=function(de,Oe){return Oe=new bl(Math.floor(Oe.zoom),{now:Oe.now,fadeDuration:Oe.fadeDuration,zoomHistory:Oe.zoomHistory,transition:Oe.transition}),C.prototype.possiblyEvaluate.call(this,de,Oe)},P.prototype.evaluate=function(de,Oe,$e,nt){return Oe=_({},Oe,{zoom:Math.floor(Oe.zoom)}),C.prototype.evaluate.call(this,de,Oe,$e,nt)},P}(Sn),Wm=new ay(n0.paint.properties["line-width"].specification);Wm.useIntegerZoom=!0;var iy=function(C){function P(Z){C.call(this,Z,n0),this.gradientVersion=0}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype._handleSpecialPaintPropertyUpdate=function(de){if(de==="line-gradient"){var Oe=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=Oe._styleExpression.expression instanceof yc,this.gradientVersion=(this.gradientVersion+1)%c}},P.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},P.prototype.recalculate=function(de,Oe){C.prototype.recalculate.call(this,de,Oe),this.paint._values["line-floorwidth"]=Wm.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,de)},P.prototype.createBucket=function(de){return new Zh(de)},P.prototype.queryRadius=function(de){var Oe=de,$e=r_(ad("line-width",this,Oe),ad("line-gap-width",this,Oe)),nt=ad("line-offset",this,Oe);return $e/2+Math.abs(nt)+Od(this.paint.get("line-translate"))},P.prototype.queryIntersectsFeature=function(de,Oe,$e,nt,Et,Zt,hr){var wr=Hd(de,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Zt.angle,hr),Wr=hr/2*r_(this.paint.get("line-width").evaluate(Oe,$e),this.paint.get("line-gap-width").evaluate(Oe,$e)),dn=this.paint.get("line-offset").evaluate(Oe,$e);return dn&&(nt=K(nt,dn*hr)),Zf(wr,nt,Wr)},P.prototype.isTileClipped=function(){return!0},P}(Ci);function r_(C,P){return P>0?P+2*C:C}function K(C,P){for(var Z=[],de=new i(0,0),Oe=0;Oe":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Ar(C){for(var P="",Z=0;Z>1,wr=-7,Wr=Z?Oe-1:0,dn=Z?-1:1,un=C[P+Wr];for(Wr+=dn,$e=un&(1<<-wr)-1,un>>=-wr,wr+=Et;wr>0;$e=$e*256+C[P+Wr],Wr+=dn,wr-=8);for(nt=$e&(1<<-wr)-1,$e>>=-wr,wr+=de;wr>0;nt=nt*256+C[P+Wr],Wr+=dn,wr-=8);if($e===0)$e=1-hr;else{if($e===Zt)return nt?NaN:(un?-1:1)*(1/0);nt=nt+Math.pow(2,de),$e=$e-hr}return(un?-1:1)*nt*Math.pow(2,$e-de)},fn=function(C,P,Z,de,Oe,$e){var nt,Et,Zt,hr=$e*8-Oe-1,wr=(1<>1,dn=Oe===23?Math.pow(2,-24)-Math.pow(2,-77):0,un=de?0:$e-1,Pn=de?1:-1,ca=P<0||P===0&&1/P<0?1:0;for(P=Math.abs(P),isNaN(P)||P===1/0?(Et=isNaN(P)?1:0,nt=wr):(nt=Math.floor(Math.log(P)/Math.LN2),P*(Zt=Math.pow(2,-nt))<1&&(nt--,Zt*=2),nt+Wr>=1?P+=dn/Zt:P+=dn*Math.pow(2,1-Wr),P*Zt>=2&&(nt++,Zt/=2),nt+Wr>=wr?(Et=0,nt=wr):nt+Wr>=1?(Et=(P*Zt-1)*Math.pow(2,Oe),nt=nt+Wr):(Et=P*Math.pow(2,Wr-1)*Math.pow(2,Oe),nt=0));Oe>=8;C[Z+un]=Et&255,un+=Pn,Et/=256,Oe-=8);for(nt=nt<0;C[Z+un]=nt&255,un+=Pn,nt/=256,hr-=8);C[Z+un-Pn]|=ca*128},Tn={read:en,write:fn},Dn=Kn;function Kn(C){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(C)?C:new Uint8Array(C||0),this.pos=0,this.type=0,this.length=this.buf.length}Kn.Varint=0,Kn.Fixed64=1,Kn.Bytes=2,Kn.Fixed32=5;var ka=65536*65536,_i=1/ka,Ka=12,di=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Kn.prototype={destroy:function(){this.buf=null},readFields:function(C,P,Z){for(Z=Z||this.length;this.pos>3,$e=this.pos;this.type=de&7,C(Oe,P,this),this.pos===$e&&this.skip(de)}return P},readMessage:function(C,P){return this.readFields(C,P,this.readVarint()+this.pos)},readFixed32:function(){var C=Sd(this.buf,this.pos);return this.pos+=4,C},readSFixed32:function(){var C=bh(this.buf,this.pos);return this.pos+=4,C},readFixed64:function(){var C=Sd(this.buf,this.pos)+Sd(this.buf,this.pos+4)*ka;return this.pos+=8,C},readSFixed64:function(){var C=Sd(this.buf,this.pos)+bh(this.buf,this.pos+4)*ka;return this.pos+=8,C},readFloat:function(){var C=Tn.read(this.buf,this.pos,!0,23,4);return this.pos+=4,C},readDouble:function(){var C=Tn.read(this.buf,this.pos,!0,52,8);return this.pos+=8,C},readVarint:function(C){var P=this.buf,Z,de;return de=P[this.pos++],Z=de&127,de<128||(de=P[this.pos++],Z|=(de&127)<<7,de<128)||(de=P[this.pos++],Z|=(de&127)<<14,de<128)||(de=P[this.pos++],Z|=(de&127)<<21,de<128)?Z:(de=P[this.pos],Z|=(de&15)<<28,Gi(Z,C,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var C=this.readVarint();return C%2===1?(C+1)/-2:C/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var C=this.readVarint()+this.pos,P=this.pos;return this.pos=C,C-P>=Ka&&di?dd(this.buf,P,C):hd(this.buf,P,C)},readBytes:function(){var C=this.readVarint()+this.pos,P=this.buf.subarray(this.pos,C);return this.pos=C,P},readPackedVarint:function(C,P){if(this.type!==Kn.Bytes)return C.push(this.readVarint(P));var Z=vo(this);for(C=C||[];this.pos127;);else if(P===Kn.Bytes)this.pos=this.readVarint()+this.pos;else if(P===Kn.Fixed32)this.pos+=4;else if(P===Kn.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+P)},writeTag:function(C,P){this.writeVarint(C<<3|P)},realloc:function(C){for(var P=this.length||16;P268435455||C<0){sl(C,this);return}this.realloc(4),this.buf[this.pos++]=C&127|(C>127?128:0),!(C<=127)&&(this.buf[this.pos++]=(C>>>=7)&127|(C>127?128:0),!(C<=127)&&(this.buf[this.pos++]=(C>>>=7)&127|(C>127?128:0),!(C<=127)&&(this.buf[this.pos++]=C>>>7&127)))},writeSVarint:function(C){this.writeVarint(C<0?-C*2-1:C*2)},writeBoolean:function(C){this.writeVarint(!!C)},writeString:function(C){C=String(C),this.realloc(C.length*4),this.pos++;var P=this.pos;this.pos=pd(this.buf,C,this.pos);var Z=this.pos-P;Z>=128&&Ls(P,Z,this),this.pos=P-1,this.writeVarint(Z),this.pos+=Z},writeFloat:function(C){this.realloc(4),Tn.write(this.buf,C,this.pos,!0,23,4),this.pos+=4},writeDouble:function(C){this.realloc(8),Tn.write(this.buf,C,this.pos,!0,52,8),this.pos+=8},writeBytes:function(C){var P=C.length;this.writeVarint(P),this.realloc(P);for(var Z=0;Z=128&&Ls(Z,de,this),this.pos=Z-1,this.writeVarint(de),this.pos+=de},writeMessage:function(C,P,Z){this.writeTag(C,Kn.Bytes),this.writeRawMessage(P,Z)},writePackedVarint:function(C,P){P.length&&this.writeMessage(C,ws,P)},writePackedSVarint:function(C,P){P.length&&this.writeMessage(C,_s,P)},writePackedBoolean:function(C,P){P.length&&this.writeMessage(C,Is,P)},writePackedFloat:function(C,P){P.length&&this.writeMessage(C,oo,P)},writePackedDouble:function(C,P){P.length&&this.writeMessage(C,Us,P)},writePackedFixed32:function(C,P){P.length&&this.writeMessage(C,Al,P)},writePackedSFixed32:function(C,P){P.length&&this.writeMessage(C,Nc,P)},writePackedFixed64:function(C,P){P.length&&this.writeMessage(C,Ic,P)},writePackedSFixed64:function(C,P){P.length&&this.writeMessage(C,kh,P)},writeBytesField:function(C,P){this.writeTag(C,Kn.Bytes),this.writeBytes(P)},writeFixed32Field:function(C,P){this.writeTag(C,Kn.Fixed32),this.writeFixed32(P)},writeSFixed32Field:function(C,P){this.writeTag(C,Kn.Fixed32),this.writeSFixed32(P)},writeFixed64Field:function(C,P){this.writeTag(C,Kn.Fixed64),this.writeFixed64(P)},writeSFixed64Field:function(C,P){this.writeTag(C,Kn.Fixed64),this.writeSFixed64(P)},writeVarintField:function(C,P){this.writeTag(C,Kn.Varint),this.writeVarint(P)},writeSVarintField:function(C,P){this.writeTag(C,Kn.Varint),this.writeSVarint(P)},writeStringField:function(C,P){this.writeTag(C,Kn.Bytes),this.writeString(P)},writeFloatField:function(C,P){this.writeTag(C,Kn.Fixed32),this.writeFloat(P)},writeDoubleField:function(C,P){this.writeTag(C,Kn.Fixed64),this.writeDouble(P)},writeBooleanField:function(C,P){this.writeVarintField(C,!!P)}};function Gi(C,P,Z){var de=Z.buf,Oe,$e;if($e=de[Z.pos++],Oe=($e&112)>>4,$e<128||($e=de[Z.pos++],Oe|=($e&127)<<3,$e<128)||($e=de[Z.pos++],Oe|=($e&127)<<10,$e<128)||($e=de[Z.pos++],Oe|=($e&127)<<17,$e<128)||($e=de[Z.pos++],Oe|=($e&127)<<24,$e<128)||($e=de[Z.pos++],Oe|=($e&1)<<31,$e<128))return Yo(C,Oe,P);throw new Error("Expected varint not more than 10 bytes")}function vo(C){return C.type===Kn.Bytes?C.readVarint()+C.pos:C.pos+1}function Yo(C,P,Z){return Z?P*4294967296+(C>>>0):(P>>>0)*4294967296+(C>>>0)}function sl(C,P){var Z,de;if(C>=0?(Z=C%4294967296|0,de=C/4294967296|0):(Z=~(-C%4294967296),de=~(-C/4294967296),Z^4294967295?Z=Z+1|0:(Z=0,de=de+1|0)),C>=18446744073709552e3||C<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");P.realloc(10),is(Z,de,P),Go(de,P)}function is(C,P,Z){Z.buf[Z.pos++]=C&127|128,C>>>=7,Z.buf[Z.pos++]=C&127|128,C>>>=7,Z.buf[Z.pos++]=C&127|128,C>>>=7,Z.buf[Z.pos++]=C&127|128,C>>>=7,Z.buf[Z.pos]=C&127}function Go(C,P){var Z=(C&7)<<4;P.buf[P.pos++]|=Z|((C>>>=3)?128:0),C&&(P.buf[P.pos++]=C&127|((C>>>=7)?128:0),C&&(P.buf[P.pos++]=C&127|((C>>>=7)?128:0),C&&(P.buf[P.pos++]=C&127|((C>>>=7)?128:0),C&&(P.buf[P.pos++]=C&127|((C>>>=7)?128:0),C&&(P.buf[P.pos++]=C&127)))))}function Ls(C,P,Z){var de=P<=16383?1:P<=2097151?2:P<=268435455?3:Math.floor(Math.log(P)/(Math.LN2*7));Z.realloc(de);for(var Oe=Z.pos-1;Oe>=C;Oe--)Z.buf[Oe+de]=Z.buf[Oe]}function ws(C,P){for(var Z=0;Z>>8,C[Z+2]=P>>>16,C[Z+3]=P>>>24}function bh(C,P){return(C[P]|C[P+1]<<8|C[P+2]<<16)+(C[P+3]<<24)}function hd(C,P,Z){for(var de="",Oe=P;Oe239?4:$e>223?3:$e>191?2:1;if(Oe+Et>Z)break;var Zt,hr,wr;Et===1?$e<128&&(nt=$e):Et===2?(Zt=C[Oe+1],(Zt&192)===128&&(nt=($e&31)<<6|Zt&63,nt<=127&&(nt=null))):Et===3?(Zt=C[Oe+1],hr=C[Oe+2],(Zt&192)===128&&(hr&192)===128&&(nt=($e&15)<<12|(Zt&63)<<6|hr&63,(nt<=2047||nt>=55296&&nt<=57343)&&(nt=null))):Et===4&&(Zt=C[Oe+1],hr=C[Oe+2],wr=C[Oe+3],(Zt&192)===128&&(hr&192)===128&&(wr&192)===128&&(nt=($e&15)<<18|(Zt&63)<<12|(hr&63)<<6|wr&63,(nt<=65535||nt>=1114112)&&(nt=null))),nt===null?(nt=65533,Et=1):nt>65535&&(nt-=65536,de+=String.fromCharCode(nt>>>10&1023|55296),nt=56320|nt&1023),de+=String.fromCharCode(nt),Oe+=Et}return de}function dd(C,P,Z){return di.decode(C.subarray(P,Z))}function pd(C,P,Z){for(var de=0,Oe,$e;de55295&&Oe<57344)if($e)if(Oe<56320){C[Z++]=239,C[Z++]=191,C[Z++]=189,$e=Oe;continue}else Oe=$e-55296<<10|Oe-56320|65536,$e=null;else{Oe>56319||de+1===P.length?(C[Z++]=239,C[Z++]=191,C[Z++]=189):$e=Oe;continue}else $e&&(C[Z++]=239,C[Z++]=191,C[Z++]=189,$e=null);Oe<128?C[Z++]=Oe:(Oe<2048?C[Z++]=Oe>>6|192:(Oe<65536?C[Z++]=Oe>>12|224:(C[Z++]=Oe>>18|240,C[Z++]=Oe>>12&63|128),C[Z++]=Oe>>6&63|128),C[Z++]=Oe&63|128)}return Z}var Ef=3;function Ch(C,P,Z){C===1&&Z.readMessage(od,P)}function od(C,P,Z){if(C===3){var de=Z.readMessage(Kh,{}),Oe=de.id,$e=de.bitmap,nt=de.width,Et=de.height,Zt=de.left,hr=de.top,wr=de.advance;P.push({id:Oe,bitmap:new _h({width:nt+2*Ef,height:Et+2*Ef},$e),metrics:{width:nt,height:Et,left:Zt,top:hr,advance:wr}})}}function Kh(C,P,Z){C===1?P.id=Z.readVarint():C===2?P.bitmap=Z.readBytes():C===3?P.width=Z.readVarint():C===4?P.height=Z.readVarint():C===5?P.left=Z.readSVarint():C===6?P.top=Z.readSVarint():C===7&&(P.advance=Z.readVarint())}function vd(C){return new Dn(C).readFields(Ch,[])}var Uh=Ef;function Bd(C){for(var P=0,Z=0,de=0,Oe=C;de=0;un--){var Pn=Et[un];if(!(dn.w>Pn.w||dn.h>Pn.h)){if(dn.x=Pn.x,dn.y=Pn.y,hr=Math.max(hr,dn.y+dn.h),Zt=Math.max(Zt,dn.x+dn.w),dn.w===Pn.w&&dn.h===Pn.h){var ca=Et.pop();un=0&&Oe>=P&&Ud[this.text.charCodeAt(Oe)];Oe--)de--;this.text=this.text.substring(P,de),this.sectionIndex=this.sectionIndex.slice(P,de)},Bc.prototype.substring=function(P,Z){var de=new Bc;return de.text=this.text.substring(P,Z),de.sectionIndex=this.sectionIndex.slice(P,Z),de.sections=this.sections,de},Bc.prototype.toString=function(){return this.text},Bc.prototype.getMaxScale=function(){var P=this;return this.sectionIndex.reduce(function(Z,de){return Math.max(Z,P.sections[de].scale)},0)},Bc.prototype.addTextSection=function(P,Z){this.text+=P.text,this.sections.push(sd.forText(P.scale,P.fontStack||Z));for(var de=this.sections.length-1,Oe=0;Oe=rp?null:++this.imageSectionID:(this.imageSectionID=tp,this.imageSectionID)};function jh(C,P){for(var Z=[],de=C.text,Oe=0,$e=0,nt=P;$e=0,wr=0,Wr=0;Wr0&&Ah>ss&&(ss=Ah)}else{var Ru=Z[Xo.fontStack],ku=Ru&&Ru[ls];if(ku&&ku.rect)el=ku.rect,Nl=ku.metrics;else{var Uc=P[Xo.fontStack],Qc=Uc&&Uc[ls];if(!Qc)continue;Nl=Qc.metrics}ps=(zi-Xo.scale)*Pr}Du?(C.verticalizable=!0,_o.push({glyph:ls,imageName:Iu,x:dn,y:un+ps,vertical:Du,scale:Xo.scale,fontStack:Xo.fontStack,sectionIndex:ll,metrics:Nl,rect:el}),dn+=Ac*Xo.scale+hr):(_o.push({glyph:ls,imageName:Iu,x:dn,y:un+ps,vertical:Du,scale:Xo.scale,fontStack:Xo.fontStack,sectionIndex:ll,metrics:Nl,rect:el}),dn+=Nl.advance*Xo.scale+hr)}if(_o.length!==0){var gd=dn-hr;Pn=Math.max(gd,Pn),ow(_o,0,_o.length-1,ei,ss)}dn=0;var yd=$e*zi+ss;wo.lineOffset=Math.max(ss,ao),un+=yd,ca=Math.max(yd,ca),++za}var Gh=un-Jc,Md=fy(nt),Ed=Md.horizontalAlign,Ph=Md.verticalAlign;sw(C.positionedLines,ei,Ed,Ph,Pn,ca,$e,Gh,Oe.length),C.top+=-Ph*Gh,C.bottom=C.top+Gh,C.left+=-Ed*Pn,C.right=C.left+Pn}function ow(C,P,Z,de,Oe){if(!(!de&&!Oe))for(var $e=C[Z],nt=$e.metrics.advance*$e.scale,Et=(C[Z].x+nt)*de,Zt=P;Zt<=Z;Zt++)C[Zt].x-=Et,C[Zt].y+=Oe}function sw(C,P,Z,de,Oe,$e,nt,Et,Zt){var hr=(P-Z)*Oe,wr=0;$e!==nt?wr=-Et*de-Jc:wr=(-de*Zt+.5)*nt;for(var Wr=0,dn=C;Wr-Z/2;){if(nt--,nt<0)return!1;Et-=C[nt].dist($e),$e=C[nt]}Et+=C[nt].dist(C[nt+1]),nt++;for(var Zt=[],hr=0;Etde;)hr-=Zt.shift().angleDelta;if(hr>Oe)return!1;nt++,Et+=Wr.dist(dn)}return!0}function Jh(C){for(var P=0,Z=0;Zhr){var Pn=(hr-Zt)/un,ca=nu(Wr.x,dn.x,Pn),ei=nu(Wr.y,dn.y,Pn),za=new i0(ca,ei,dn.angleTo(Wr),wr);return za._round(),!nt||i_(C,za,Et,nt,P)?za:void 0}Zt+=un}}function xv(C,P,Z,de,Oe,$e,nt,Et,Zt){var hr=jd(de,$e,nt),wr=ev(de,Oe),Wr=wr*nt,dn=C[0].x===0||C[0].x===Zt||C[0].y===0||C[0].y===Zt;P-Wr

=0&&Si=0&&zi=0&&dn+hr<=wr){var ao=new i0(Si,zi,Ei,Pn);ao._round(),(!de||i_(C,ao,$e,de,Oe))&&un.push(ao)}}Wr+=za}return!Et&&!un.length&&!nt&&(un=ap(C,Wr/2,Z,de,Oe,$e,nt,!0,Zt)),un}function TS(C,P,Z,de,Oe){for(var $e=[],nt=0;nt=de&&Wr.x>=de)&&(wr.x>=de?wr=new i(de,wr.y+(Wr.y-wr.y)*((de-wr.x)/(Wr.x-wr.x)))._round():Wr.x>=de&&(Wr=new i(de,wr.y+(Wr.y-wr.y)*((de-wr.x)/(Wr.x-wr.x)))._round()),!(wr.y>=Oe&&Wr.y>=Oe)&&(wr.y>=Oe?wr=new i(wr.x+(Wr.x-wr.x)*((Oe-wr.y)/(Wr.y-wr.y)),Oe)._round():Wr.y>=Oe&&(Wr=new i(wr.x+(Wr.x-wr.x)*((Oe-wr.y)/(Wr.y-wr.y)),Oe)._round()),(!Zt||!wr.equals(Zt[Zt.length-1]))&&(Zt=[wr],$e.push(Zt)),Zt.push(Wr)))))}return $e}var Xm=Kc;function AS(C,P,Z,de){var Oe=[],$e=C.image,nt=$e.pixelRatio,Et=$e.paddedRect.w-2*Xm,Zt=$e.paddedRect.h-2*Xm,hr=C.right-C.left,wr=C.bottom-C.top,Wr=$e.stretchX||[[0,Et]],dn=$e.stretchY||[[0,Zt]],un=function(Ru,ku){return Ru+ku[1]-ku[0]},Pn=Wr.reduce(un,0),ca=dn.reduce(un,0),ei=Et-Pn,za=Zt-ca,Ei=0,fi=Pn,Si=0,zi=ca,ao=0,wo=ei,_o=0,ss=za;if($e.content&&de){var Oo=$e.content;Ei=o_(Wr,0,Oo[0]),Si=o_(dn,0,Oo[1]),fi=o_(Wr,Oo[0],Oo[2]),zi=o_(dn,Oo[1],Oo[3]),ao=Oo[0]-Ei,_o=Oo[1]-Si,wo=Oo[2]-Oo[0]-fi,ss=Oo[3]-Oo[1]-zi}var Xo=function(Ru,ku,Uc,Qc){var Gf=s_(Ru.stretch-Ei,fi,hr,C.left),Jf=l_(Ru.fixed-ao,wo,Ru.stretch,Pn),qh=s_(ku.stretch-Si,zi,wr,C.top),Ah=l_(ku.fixed-_o,ss,ku.stretch,ca),gd=s_(Uc.stretch-Ei,fi,hr,C.left),yd=l_(Uc.fixed-ao,wo,Uc.stretch,Pn),Gh=s_(Qc.stretch-Si,zi,wr,C.top),Md=l_(Qc.fixed-_o,ss,Qc.stretch,ca),Ed=new i(Gf,qh),Ph=new i(gd,qh),kd=new i(gd,Gh),ep=new i(Gf,Gh),Av=new i(Jf/nt,Ah/nt),u0=new i(yd/nt,Md/nt),c0=P*Math.PI/180;if(c0){var f0=Math.sin(c0),ng=Math.cos(c0),dp=[ng,-f0,f0,ng];Ed._matMult(dp),Ph._matMult(dp),ep._matMult(dp),kd._matMult(dp)}var p_=Ru.stretch+Ru.fixed,gw=Uc.stretch+Uc.fixed,v_=ku.stretch+ku.fixed,yw=Qc.stretch+Qc.fixed,ip={x:$e.paddedRect.x+Xm+p_,y:$e.paddedRect.y+Xm+v_,w:gw-p_,h:yw-v_},ag=wo/nt/hr,m_=ss/nt/wr;return{tl:Ed,tr:Ph,bl:ep,br:kd,tex:ip,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Av,pixelOffsetBR:u0,minFontScaleX:ag,minFontScaleY:m_,isSDF:Z}};if(!de||!$e.stretchX&&!$e.stretchY)Oe.push(Xo({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:Et+1},{fixed:0,stretch:Zt+1}));else for(var ll=SS(Wr,ei,Pn),ls=SS(dn,za,ca),ps=0;ps0&&(Pn=Math.max(10,Pn),this.circleDiameter=Pn)}else{var ca=nt.top*Et-Zt,ei=nt.bottom*Et+Zt,za=nt.left*Et-Zt,Ei=nt.right*Et+Zt,fi=nt.collisionPadding;if(fi&&(za-=fi[0]*Et,ca-=fi[1]*Et,Ei+=fi[2]*Et,ei+=fi[3]*Et),wr){var Si=new i(za,ca),zi=new i(Ei,ca),ao=new i(za,ei),wo=new i(Ei,ei),_o=wr*Math.PI/180;Si._rotate(_o),zi._rotate(_o),ao._rotate(_o),wo._rotate(_o),za=Math.min(Si.x,zi.x,ao.x,wo.x),Ei=Math.max(Si.x,zi.x,ao.x,wo.x),ca=Math.min(Si.y,zi.y,ao.y,wo.y),ei=Math.max(Si.y,zi.y,ao.y,wo.y)}P.emplaceBack(Z.x,Z.y,za,ca,Ei,ei,de,Oe,$e)}this.boxEndIndex=P.length},Zm=function(P,Z){if(P===void 0&&(P=[]),Z===void 0&&(Z=n8),this.data=P,this.length=this.data.length,this.compare=Z,this.length>0)for(var de=(this.length>>1)-1;de>=0;de--)this._down(de)};Zm.prototype.push=function(P){this.data.push(P),this.length++,this._up(this.length-1)},Zm.prototype.pop=function(){if(this.length!==0){var P=this.data[0],Z=this.data.pop();return this.length--,this.length>0&&(this.data[0]=Z,this._down(0)),P}},Zm.prototype.peek=function(){return this.data[0]},Zm.prototype._up=function(P){for(var Z=this,de=Z.data,Oe=Z.compare,$e=de[P];P>0;){var nt=P-1>>1,Et=de[nt];if(Oe($e,Et)>=0)break;de[P]=Et,P=nt}de[P]=$e},Zm.prototype._down=function(P){for(var Z=this,de=Z.data,Oe=Z.compare,$e=this.length>>1,nt=de[P];P<$e;){var Et=(P<<1)+1,Zt=de[Et],hr=Et+1;if(hr=0)break;de[P]=Zt,P=Et}de[P]=nt};function n8(C,P){return CP?1:0}function a8(C,P,Z){Z===void 0&&(Z=!1);for(var de=1/0,Oe=1/0,$e=-1/0,nt=-1/0,Et=C[0],Zt=0;Zt$e)&&($e=hr.x),(!Zt||hr.y>nt)&&(nt=hr.y)}var wr=$e-de,Wr=nt-Oe,dn=Math.min(wr,Wr),un=dn/2,Pn=new Zm([],i8);if(dn===0)return new i(de,Oe);for(var ca=de;ca<$e;ca+=dn)for(var ei=Oe;eiza.d||!za.d)&&(za=fi,Z&&console.log("found best %d after %d probes",Math.round(1e4*fi.d)/1e4,Ei)),!(fi.max-za.d<=P)&&(un=fi.h/2,Pn.push(new Km(fi.p.x-un,fi.p.y-un,un,C)),Pn.push(new Km(fi.p.x+un,fi.p.y-un,un,C)),Pn.push(new Km(fi.p.x-un,fi.p.y+un,un,C)),Pn.push(new Km(fi.p.x+un,fi.p.y+un,un,C)),Ei+=4)}return Z&&(console.log("num probes: "+Ei),console.log("best distance: "+za.d)),za.p}function i8(C,P){return P.max-C.max}function Km(C,P,Z,de){this.p=new i(C,P),this.h=Z,this.d=o8(this.p,de),this.max=this.d+this.h*Math.SQRT2}function o8(C,P){for(var Z=!1,de=1/0,Oe=0;OeC.y!=wr.y>C.y&&C.x<(wr.x-hr.x)*(C.y-hr.y)/(wr.y-hr.y)+hr.x&&(Z=!Z),de=Math.min(de,Ep(C,hr,wr))}return(Z?1:-1)*Math.sqrt(de)}function s8(C){for(var P=0,Z=0,de=0,Oe=C[0],$e=0,nt=Oe.length,Et=nt-1;$e=Yi||dp.y<0||dp.y>=Yi||c8(C,dp,ng,Z,de,Oe,ls,C.layers[0],C.collisionBoxArray,P.index,P.sourceLayerIndex,C.index,za,zi,_o,Zt,fi,ao,ss,un,P,$e,hr,wr,nt)};if(Oo==="line")for(var Nl=0,el=TS(P.geometry,0,0,Yi,Yi);Nl1){var qh=np(Jf,wo,Z.vertical||Pn,de,ca,Ei);qh&&ps(Jf,qh)}}else if(P.type==="Polygon")for(var Ah=0,gd=fp(P.geometry,0);Ahs0&&q(C.layerIds[0]+': Value for "text-size" is >= '+dy+'. Reduce your "text-size".')):ei.kind==="composite"&&(za=[xh*un.compositeTextSizes[0].evaluate(nt,{},Pn),xh*un.compositeTextSizes[1].evaluate(nt,{},Pn)],(za[0]>s0||za[1]>s0)&&q(C.layerIds[0]+': Value for "text-size" is >= '+dy+'. Reduce your "text-size".')),C.addSymbols(C.text,ca,za,Et,$e,nt,hr,P,Zt.lineStartIndex,Zt.lineLength,dn,Pn);for(var Ei=0,fi=wr;Eis0&&q(C.layerIds[0]+': Value for "icon-size" is >= '+dy+'. Reduce your "icon-size".')):Ed.kind==="composite"&&(Ph=[xh*zi.compositeIconSizes[0].evaluate(Si,{},wo),xh*zi.compositeIconSizes[1].evaluate(Si,{},wo)],(Ph[0]>s0||Ph[1]>s0)&&q(C.layerIds[0]+': Value for "icon-size" is >= '+dy+'. Reduce your "icon-size".')),C.addSymbols(C.icon,Gh,Ph,fi,Ei,Si,!1,P,Oo.lineStartIndex,Oo.lineLength,-1,wo),Du=C.icon.placedSymbolArray.length-1,Md&&(el=Md.length*4,C.addSymbols(C.icon,Md,Ph,fi,Ei,Si,bf.vertical,P,Oo.lineStartIndex,Oo.lineLength,-1,wo),Ru=C.icon.placedSymbolArray.length-1)}for(var kd in de.horizontal){var ep=de.horizontal[kd];if(!Xo){Uc=Le(ep.text);var Av=Et.layout.get("text-rotate").evaluate(Si,{},wo);Xo=new u_(Zt,P,hr,wr,Wr,ep,dn,un,Pn,Av)}var u0=ep.positionedLines.length===1;if(Iu+=ES(C,P,ep,$e,Et,Pn,Si,ca,Oo,de.vertical?bf.horizontal:bf.horizontalOnly,u0?Object.keys(de.horizontal):[kd],ku,Du,zi,wo),u0)break}de.vertical&&(Ac+=ES(C,P,de.vertical,$e,Et,Pn,Si,ca,Oo,bf.vertical,["vertical"],ku,Ru,zi,wo));var c0=Xo?Xo.boxStartIndex:C.collisionBoxArray.length,f0=Xo?Xo.boxEndIndex:C.collisionBoxArray.length,ng=ls?ls.boxStartIndex:C.collisionBoxArray.length,dp=ls?ls.boxEndIndex:C.collisionBoxArray.length,p_=ll?ll.boxStartIndex:C.collisionBoxArray.length,gw=ll?ll.boxEndIndex:C.collisionBoxArray.length,v_=ps?ps.boxStartIndex:C.collisionBoxArray.length,yw=ps?ps.boxEndIndex:C.collisionBoxArray.length,ip=-1,ag=function(my,GS){return my&&my.circleDiameter?Math.max(my.circleDiameter,GS):GS};ip=ag(Xo,ip),ip=ag(ls,ip),ip=ag(ll,ip),ip=ag(ps,ip);var m_=ip>-1?1:0;m_&&(ip*=_o/Pr),C.glyphOffsetArray.length>=Tc.MAX_GLYPHS&&q("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Si.sortKey!==void 0&&C.addToSortKeyRanges(C.symbolInstances.length,Si.sortKey),C.symbolInstances.emplaceBack(P.x,P.y,ku.right>=0?ku.right:-1,ku.center>=0?ku.center:-1,ku.left>=0?ku.left:-1,ku.vertical||-1,Du,Ru,Uc,c0,f0,ng,dp,p_,gw,v_,yw,hr,Iu,Ac,Nl,el,m_,0,dn,Qc,Gf,ip)}function f8(C,P,Z,de){var Oe=C.compareText;if(!(P in Oe))Oe[P]=[];else for(var $e=Oe[P],nt=$e.length-1;nt>=0;nt--)if(de.dist($e[nt])0)&&(nt.value.kind!=="constant"||nt.value.value.length>0),wr=Zt.value.kind!=="constant"||!!Zt.value.value||Object.keys(Zt.parameters).length>0,Wr=$e.get("symbol-sort-key");if(this.features=[],!(!hr&&!wr)){for(var dn=Z.iconDependencies,un=Z.glyphDependencies,Pn=Z.availableImages,ca=new bl(this.zoom),ei=0,za=P;ei=0;for(var Ac=0,Du=ss.sections;Ac=0;Zt--)nt[Zt]={x:Z[Zt].x,y:Z[Zt].y,tileUnitDistanceFromAnchor:$e},Zt>0&&($e+=Z[Zt-1].dist(Z[Zt]));for(var hr=0;hr0},Tc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Tc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Tc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Tc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Tc.prototype.addIndicesForPlacedSymbol=function(P,Z){for(var de=P.placedSymbolArray.get(Z),Oe=de.vertexStartIndex+de.numGlyphs*4,$e=de.vertexStartIndex;$e1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(P),this.sortedAngle=P,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var de=0,Oe=this.symbolInstanceIndexes;de=0&&hr.indexOf(Et)===Zt&&Z.addIndicesForPlacedSymbol(Z.text,Et)}),nt.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,nt.verticalPlacedTextSymbolIndex),nt.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,nt.placedIconSymbolIndex),nt.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,nt.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},cr("SymbolBucket",Tc,{omit:["layers","collisionBoxArray","features","compareText"]}),Tc.MAX_GLYPHS=65535,Tc.addDynamicAttributes=hw;function v8(C,P){return P.replace(/{([^{}]+)}/g,function(Z,de){return de in C?String(C[de]):""})}var m8=new oi({"symbol-placement":new En(Ai.layout_symbol["symbol-placement"]),"symbol-spacing":new En(Ai.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new En(Ai.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Sn(Ai.layout_symbol["symbol-sort-key"]),"symbol-z-order":new En(Ai.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new En(Ai.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new En(Ai.layout_symbol["icon-ignore-placement"]),"icon-optional":new En(Ai.layout_symbol["icon-optional"]),"icon-rotation-alignment":new En(Ai.layout_symbol["icon-rotation-alignment"]),"icon-size":new Sn(Ai.layout_symbol["icon-size"]),"icon-text-fit":new En(Ai.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new En(Ai.layout_symbol["icon-text-fit-padding"]),"icon-image":new Sn(Ai.layout_symbol["icon-image"]),"icon-rotate":new Sn(Ai.layout_symbol["icon-rotate"]),"icon-padding":new En(Ai.layout_symbol["icon-padding"]),"icon-keep-upright":new En(Ai.layout_symbol["icon-keep-upright"]),"icon-offset":new Sn(Ai.layout_symbol["icon-offset"]),"icon-anchor":new Sn(Ai.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new En(Ai.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new En(Ai.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new En(Ai.layout_symbol["text-rotation-alignment"]),"text-field":new Sn(Ai.layout_symbol["text-field"]),"text-font":new Sn(Ai.layout_symbol["text-font"]),"text-size":new Sn(Ai.layout_symbol["text-size"]),"text-max-width":new Sn(Ai.layout_symbol["text-max-width"]),"text-line-height":new En(Ai.layout_symbol["text-line-height"]),"text-letter-spacing":new Sn(Ai.layout_symbol["text-letter-spacing"]),"text-justify":new Sn(Ai.layout_symbol["text-justify"]),"text-radial-offset":new Sn(Ai.layout_symbol["text-radial-offset"]),"text-variable-anchor":new En(Ai.layout_symbol["text-variable-anchor"]),"text-anchor":new Sn(Ai.layout_symbol["text-anchor"]),"text-max-angle":new En(Ai.layout_symbol["text-max-angle"]),"text-writing-mode":new En(Ai.layout_symbol["text-writing-mode"]),"text-rotate":new Sn(Ai.layout_symbol["text-rotate"]),"text-padding":new En(Ai.layout_symbol["text-padding"]),"text-keep-upright":new En(Ai.layout_symbol["text-keep-upright"]),"text-transform":new Sn(Ai.layout_symbol["text-transform"]),"text-offset":new Sn(Ai.layout_symbol["text-offset"]),"text-allow-overlap":new En(Ai.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new En(Ai.layout_symbol["text-ignore-placement"]),"text-optional":new En(Ai.layout_symbol["text-optional"])}),g8=new oi({"icon-opacity":new Sn(Ai.paint_symbol["icon-opacity"]),"icon-color":new Sn(Ai.paint_symbol["icon-color"]),"icon-halo-color":new Sn(Ai.paint_symbol["icon-halo-color"]),"icon-halo-width":new Sn(Ai.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Sn(Ai.paint_symbol["icon-halo-blur"]),"icon-translate":new En(Ai.paint_symbol["icon-translate"]),"icon-translate-anchor":new En(Ai.paint_symbol["icon-translate-anchor"]),"text-opacity":new Sn(Ai.paint_symbol["text-opacity"]),"text-color":new Sn(Ai.paint_symbol["text-color"],{runtimeType:Bl,getOverride:function(C){return C.textColor},hasOverride:function(C){return!!C.textColor}}),"text-halo-color":new Sn(Ai.paint_symbol["text-halo-color"]),"text-halo-width":new Sn(Ai.paint_symbol["text-halo-width"]),"text-halo-blur":new Sn(Ai.paint_symbol["text-halo-blur"]),"text-translate":new En(Ai.paint_symbol["text-translate"]),"text-translate-anchor":new En(Ai.paint_symbol["text-translate-anchor"])}),dw={paint:g8,layout:m8},eg=function(P){this.type=P.property.overrides?P.property.overrides.runtimeType:mu,this.defaultValue=P};eg.prototype.evaluate=function(P){if(P.formattedSection){var Z=this.defaultValue.property.overrides;if(Z&&Z.hasOverride(P.formattedSection))return Z.getOverride(P.formattedSection)}return P.feature&&P.featureState?this.defaultValue.evaluate(P.feature,P.featureState):this.defaultValue.property.specification.default},eg.prototype.eachChild=function(P){if(!this.defaultValue.isConstant()){var Z=this.defaultValue.value;P(Z._styleExpression.expression)}},eg.prototype.outputDefined=function(){return!1},eg.prototype.serialize=function(){return null},cr("FormatSectionOverride",eg,{omit:["defaultValue"]});var y8=function(C){function P(Z){C.call(this,Z,dw)}return C&&(P.__proto__=C),P.prototype=Object.create(C&&C.prototype),P.prototype.constructor=P,P.prototype.recalculate=function(de,Oe){if(C.prototype.recalculate.call(this,de,Oe),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 $e=this.layout.get("text-writing-mode");if($e){for(var nt=[],Et=0,Zt=$e;Et",targetMapId:Oe,sourceMapId:nt.mapId})}}},tg.prototype.receive=function(P){var Z=P.data,de=Z.id;if(de&&!(Z.targetMapId&&this.mapId!==Z.targetMapId))if(Z.type===""){delete this.tasks[de];var Oe=this.cancelCallbacks[de];delete this.cancelCallbacks[de],Oe&&Oe()}else pe()||Z.mustQueue?(this.tasks[de]=Z,this.taskQueue.push(de),this.invoker.trigger()):this.processTask(de,Z)},tg.prototype.process=function(){if(this.taskQueue.length){var P=this.taskQueue.shift(),Z=this.tasks[P];delete this.tasks[P],this.taskQueue.length&&this.invoker.trigger(),Z&&this.processTask(P,Z)}},tg.prototype.processTask=function(P,Z){var de=this;if(Z.type===""){var Oe=this.callbacks[P];delete this.callbacks[P],Oe&&(Z.error?Oe(wn(Z.error)):Oe(null,wn(Z.data)))}else{var $e=!1,nt=ae(this.globalScope)?void 0:[],Et=Z.hasCallback?function(dn,un){$e=!0,delete de.cancelCallbacks[P],de.target.postMessage({id:P,type:"",sourceMapId:de.mapId,error:dn?nn(dn):null,data:nn(un,nt)},nt)}:function(dn){$e=!0},Zt=null,hr=wn(Z.data);if(this.parent[Z.type])Zt=this.parent[Z.type](Z.sourceMapId,hr,Et);else if(this.parent.getWorkerSource){var wr=Z.type.split("."),Wr=this.parent.getWorkerSource(Z.sourceMapId,wr[0],hr.source);Zt=Wr[wr[1]](hr,Et)}else Et(new Error("Could not find function "+Z.type));!$e&&Zt&&Zt.cancel&&(this.cancelCallbacks[P]=Zt.cancel)}},tg.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function C8(C,P,Z){P=Math.pow(2,Z)-P-1;var de=DS(C*256,P*256,Z),Oe=DS((C+1)*256,(P+1)*256,Z);return de[0]+","+de[1]+","+Oe[0]+","+Oe[1]}function DS(C,P,Z){var de=2*Math.PI*6378137/256/Math.pow(2,Z),Oe=C*de-2*Math.PI*6378137/2,$e=P*de-2*Math.PI*6378137/2;return[Oe,$e]}var wh=function(P,Z){P&&(Z?this.setSouthWest(P).setNorthEast(Z):P.length===4?this.setSouthWest([P[0],P[1]]).setNorthEast([P[2],P[3]]):this.setSouthWest(P[0]).setNorthEast(P[1]))};wh.prototype.setNorthEast=function(P){return this._ne=P instanceof xf?new xf(P.lng,P.lat):xf.convert(P),this},wh.prototype.setSouthWest=function(P){return this._sw=P instanceof xf?new xf(P.lng,P.lat):xf.convert(P),this},wh.prototype.extend=function(P){var Z=this._sw,de=this._ne,Oe,$e;if(P instanceof xf)Oe=P,$e=P;else if(P instanceof wh){if(Oe=P._sw,$e=P._ne,!Oe||!$e)return this}else{if(Array.isArray(P))if(P.length===4||P.every(Array.isArray)){var nt=P;return this.extend(wh.convert(nt))}else{var Et=P;return this.extend(xf.convert(Et))}return this}return!Z&&!de?(this._sw=new xf(Oe.lng,Oe.lat),this._ne=new xf($e.lng,$e.lat)):(Z.lng=Math.min(Oe.lng,Z.lng),Z.lat=Math.min(Oe.lat,Z.lat),de.lng=Math.max($e.lng,de.lng),de.lat=Math.max($e.lat,de.lat)),this},wh.prototype.getCenter=function(){return new xf((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},wh.prototype.getSouthWest=function(){return this._sw},wh.prototype.getNorthEast=function(){return this._ne},wh.prototype.getNorthWest=function(){return new xf(this.getWest(),this.getNorth())},wh.prototype.getSouthEast=function(){return new xf(this.getEast(),this.getSouth())},wh.prototype.getWest=function(){return this._sw.lng},wh.prototype.getSouth=function(){return this._sw.lat},wh.prototype.getEast=function(){return this._ne.lng},wh.prototype.getNorth=function(){return this._ne.lat},wh.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},wh.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},wh.prototype.isEmpty=function(){return!(this._sw&&this._ne)},wh.prototype.contains=function(P){var Z=xf.convert(P),de=Z.lng,Oe=Z.lat,$e=this._sw.lat<=Oe&&Oe<=this._ne.lat,nt=this._sw.lng<=de&&de<=this._ne.lng;return this._sw.lng>this._ne.lng&&(nt=this._sw.lng>=de&&de>=this._ne.lng),$e&&nt},wh.convert=function(P){return!P||P instanceof wh?P:new wh(P)};var RS=63710088e-1,xf=function(P,Z){if(isNaN(P)||isNaN(Z))throw new Error("Invalid LngLat object: ("+P+", "+Z+")");if(this.lng=+P,this.lat=+Z,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};xf.prototype.wrap=function(){return new xf(g(this.lng,-180,180),this.lat)},xf.prototype.toArray=function(){return[this.lng,this.lat]},xf.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},xf.prototype.distanceTo=function(P){var Z=Math.PI/180,de=this.lat*Z,Oe=P.lat*Z,$e=Math.sin(de)*Math.sin(Oe)+Math.cos(de)*Math.cos(Oe)*Math.cos((P.lng-this.lng)*Z),nt=RS*Math.acos(Math.min($e,1));return nt},xf.prototype.toBounds=function(P){P===void 0&&(P=0);var Z=40075017,de=360*P/Z,Oe=de/Math.cos(Math.PI/180*this.lat);return new wh(new xf(this.lng-Oe,this.lat-de),new xf(this.lng+Oe,this.lat+de))},xf.convert=function(P){if(P instanceof xf)return P;if(Array.isArray(P)&&(P.length===2||P.length===3))return new xf(Number(P[0]),Number(P[1]));if(!Array.isArray(P)&&typeof P=="object"&&P!==null)return new xf(Number("lng"in P?P.lng:P.lon),Number(P.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 OS=2*Math.PI*RS;function zS(C){return OS*Math.cos(C*Math.PI/180)}function FS(C){return(180+C)/360}function NS(C){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+C*Math.PI/360)))/360}function BS(C,P){return C/zS(P)}function P8(C){return C*360-180}function vw(C){var P=180-C*360;return 360/Math.PI*Math.atan(Math.exp(P*Math.PI/180))-90}function L8(C,P){return C*zS(vw(P))}function I8(C){return 1/Math.cos(C*Math.PI/180)}var X0=function(P,Z,de){de===void 0&&(de=0),this.x=+P,this.y=+Z,this.z=+de};X0.fromLngLat=function(P,Z){Z===void 0&&(Z=0);var de=xf.convert(P);return new X0(FS(de.lng),NS(de.lat),BS(Z,de.lat))},X0.prototype.toLngLat=function(){return new xf(P8(this.x),vw(this.y))},X0.prototype.toAltitude=function(){return L8(this.z,this.y)},X0.prototype.meterInMercatorCoordinateUnits=function(){return 1/OS*I8(vw(this.y))};var Z0=function(P,Z,de){this.z=P,this.x=Z,this.y=de,this.key=vy(0,P,P,Z,de)};Z0.prototype.equals=function(P){return this.z===P.z&&this.x===P.x&&this.y===P.y},Z0.prototype.url=function(P,Z){var de=C8(this.x,this.y,this.z),Oe=D8(this.z,this.x,this.y);return P[(this.x+this.y)%P.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(Z==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",Oe).replace("{bbox-epsg-3857}",de)},Z0.prototype.getTilePoint=function(P){var Z=Math.pow(2,this.z);return new i((P.x*Z-this.x)*Yi,(P.y*Z-this.y)*Yi)},Z0.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var US=function(P,Z){this.wrap=P,this.canonical=Z,this.key=vy(P,Z.z,Z.z,Z.x,Z.y)},Th=function(P,Z,de,Oe,$e){this.overscaledZ=P,this.wrap=Z,this.canonical=new Z0(de,+Oe,+$e),this.key=vy(Z,P,de,Oe,$e)};Th.prototype.equals=function(P){return this.overscaledZ===P.overscaledZ&&this.wrap===P.wrap&&this.canonical.equals(P.canonical)},Th.prototype.scaledTo=function(P){var Z=this.canonical.z-P;return P>this.canonical.z?new Th(P,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Th(P,this.wrap,P,this.canonical.x>>Z,this.canonical.y>>Z)},Th.prototype.calculateScaledKey=function(P,Z){var de=this.canonical.z-P;return P>this.canonical.z?vy(this.wrap*+Z,P,this.canonical.z,this.canonical.x,this.canonical.y):vy(this.wrap*+Z,P,P,this.canonical.x>>de,this.canonical.y>>de)},Th.prototype.isChildOf=function(P){if(P.wrap!==this.wrap)return!1;var Z=this.canonical.z-P.canonical.z;return P.overscaledZ===0||P.overscaledZ>Z&&P.canonical.y===this.canonical.y>>Z},Th.prototype.children=function(P){if(this.overscaledZ>=P)return[new Th(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var Z=this.canonical.z+1,de=this.canonical.x*2,Oe=this.canonical.y*2;return[new Th(Z,this.wrap,Z,de,Oe),new Th(Z,this.wrap,Z,de+1,Oe),new Th(Z,this.wrap,Z,de,Oe+1),new Th(Z,this.wrap,Z,de+1,Oe+1)]},Th.prototype.isLessThan=function(P){return this.wrapP.wrap?!1:this.overscaledZP.overscaledZ?!1:this.canonical.xP.canonical.x?!1:this.canonical.y0;$e--)Oe=1<<$e-1,de+=(P&Oe?1:0)+(Z&Oe?2:0);return de}cr("CanonicalTileID",Z0),cr("OverscaledTileID",Th,{omit:["posMatrix"]});var wv=function(P,Z,de){if(this.uid=P,Z.height!==Z.width)throw new RangeError("DEM tiles must be square");if(de&&de!=="mapbox"&&de!=="terrarium")return q('"'+de+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=Z.height;var Oe=this.dim=Z.height-2;this.data=new Uint32Array(Z.data.buffer),this.encoding=de||"mapbox";for(var $e=0;$e=this.dim+1||Z<-1||Z>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(Z+1)*this.stride+(P+1)},wv.prototype._unpackMapbox=function(P,Z,de){return(P*256*256+Z*256+de)/10-1e4},wv.prototype._unpackTerrarium=function(P,Z,de){return P*256+Z+de/256-32768},wv.prototype.getPixels=function(){return new Xh({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},wv.prototype.backfillBorder=function(P,Z,de){if(this.dim!==P.dim)throw new Error("dem dimension mismatch");var Oe=Z*this.dim,$e=Z*this.dim+this.dim,nt=de*this.dim,Et=de*this.dim+this.dim;switch(Z){case-1:Oe=$e-1;break;case 1:$e=Oe+1;break}switch(de){case-1:nt=Et-1;break;case 1:Et=nt+1;break}for(var Zt=-Z*this.dim,hr=-de*this.dim,wr=nt;wr=0&&Wr[3]>=0&&Zt.insert(Et,Wr[0],Wr[1],Wr[2],Wr[3])}},Tv.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new bv.VectorTile(new Dn(this.rawTileData)).layers,this.sourceLayerCoder=new h_(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Tv.prototype.query=function(P,Z,de,Oe){var $e=this;this.loadVTLayers();for(var nt=P.params||{},Et=Yi/P.tileSize/P.scale,Zt=dt(nt.filter),hr=P.queryGeometry,wr=P.queryPadding*Et,Wr=VS(hr),dn=this.grid.query(Wr.minX-wr,Wr.minY-wr,Wr.maxX+wr,Wr.maxY+wr),un=VS(P.cameraQueryGeometry),Pn=this.grid3D.query(un.minX-wr,un.minY-wr,un.maxX+wr,un.maxY+wr,function(ao,wo,_o,ss){return Kd(P.cameraQueryGeometry,ao-wr,wo-wr,_o+wr,ss+wr)}),ca=0,ei=Pn;caOe)$e=!1;else if(!Z)$e=!0;else if(this.expirationTime=Jr.maxzoom)&&Jr.visibility!=="none"){f(Gr,this.zoom,_r);var yn=Ca[Jr.id]=Jr.createBucket({index:fa.bucketLayerIDs.length,layers:Gr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Mi,sourceID:this.source});yn.populate(Oi,Ma,this.tileID.canonical),fa.bucketLayerIDs.push(Gr.map(function(bn){return bn.id}))}}}}var cn,Dt,yr,Hr,_n=e.mapObject(Ma.glyphDependencies,function(bn){return Object.keys(bn).map(Number)});Object.keys(_n).length?rn.send("getGlyphs",{uid:this.uid,stacks:_n},function(bn,$n){cn||(cn=bn,Dt=$n,Qn.call(Mn))}):Dt={};var Hn=Object.keys(Ma.iconDependencies);Hn.length?rn.send("getImages",{icons:Hn,source:this.source,tileID:this.tileID,type:"icons"},function(bn,$n){cn||(cn=bn,yr=$n,Qn.call(Mn))}):yr={};var ea=Object.keys(Ma.patternDependencies);ea.length?rn.send("getImages",{icons:ea,source:this.source,tileID:this.tileID,type:"patterns"},function(bn,$n){cn||(cn=bn,Hr=$n,Qn.call(Mn))}):Hr={},Qn.call(this);function Qn(){if(cn)return gn(cn);if(Dt&&yr&&Hr){var bn=new a(Dt),$n=new e.ImageAtlas(yr,Hr);for(var ki in Ca){var Ua=Ca[ki];Ua instanceof e.SymbolBucket?(f(Ua.layers,this.zoom,_r),e.performSymbolLayout(Ua,Dt,bn.positions,yr,$n.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ua.hasPattern&&(Ua instanceof e.LineBucket||Ua instanceof e.FillBucket||Ua instanceof e.FillExtrusionBucket)&&(f(Ua.layers,this.zoom,_r),Ua.addFeatures(Ma,this.tileID.canonical,$n.patternPositions))}this.status="done",gn(null,{buckets:e.values(Ca).filter(function(Fi){return!Fi.isEmpty()}),featureIndex:fa,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:bn.image,imageAtlas:$n,glyphMap:this.returnDependencies?Dt:null,iconMap:this.returnDependencies?yr:null,glyphPositions:this.returnDependencies?bn.positions:null})}}};function f(gr,Kt,vr){for(var _r=new e.EvaluationParameters(Kt),rn=0,gn=gr;rn=0!=!!Kt&&gr.reverse()}var E=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,_=function(Kt){this._feature=Kt,this.extent=e.EXTENT,this.type=Kt.type,this.properties=Kt.tags,"id"in Kt&&!isNaN(Kt.id)&&(this.id=parseInt(Kt.id,10))};_.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Kt=[],vr=0,_r=this._feature.geometry;vr<_r.length;vr+=1){var rn=_r[vr];Kt.push([new e.Point$1(rn[0],rn[1])])}return Kt}else{for(var gn=[],Mn=0,In=this._feature.geometry;Mn"u"&&(_r.push(In),fa=_r.length-1,gn[In]=fa),Kt.writeVarint(fa);var Ca=vr.properties[In],Ma=typeof Ca;Ma!=="string"&&Ma!=="boolean"&&Ma!=="number"&&(Ca=JSON.stringify(Ca));var Da=Ma+":"+Ca,Va=Mn[Da];typeof Va>"u"&&(rn.push(Ca),Va=rn.length-1,Mn[Da]=Va),Kt.writeVarint(Va)}}function oe(gr,Kt){return(Kt<<3)+(gr&7)}function ye(gr){return gr<<1^gr>>31}function pe(gr,Kt){for(var vr=gr.loadGeometry(),_r=gr.type,rn=0,gn=0,Mn=vr.length,In=0;In>1;ae(gr,Kt,Mn,_r,rn,gn%2),W(gr,Kt,vr,_r,Mn-1,gn+1),W(gr,Kt,vr,Mn+1,rn,gn+1)}}function ae(gr,Kt,vr,_r,rn,gn){for(;rn>_r;){if(rn-_r>600){var Mn=rn-_r+1,In=vr-_r+1,fa=Math.log(Mn),Ca=.5*Math.exp(2*fa/3),Ma=.5*Math.sqrt(fa*Ca*(Mn-Ca)/Mn)*(In-Mn/2<0?-1:1),Da=Math.max(_r,Math.floor(vr-In*Ca/Mn+Ma)),Va=Math.min(rn,Math.floor(vr+(Mn-In)*Ca/Mn+Ma));ae(gr,Kt,vr,Da,Va,gn)}var na=Kt[2*vr+gn],Mi=_r,Oi=rn;for(se(gr,Kt,_r,vr),Kt[2*rn+gn]>na&&se(gr,Kt,_r,rn);Mina;)Oi--}Kt[2*_r+gn]===na?se(gr,Kt,_r,Oi):(Oi++,se(gr,Kt,Oi,rn)),Oi<=vr&&(_r=Oi+1),vr<=Oi&&(rn=Oi-1)}}function se(gr,Kt,vr,_r){Q(gr,vr,_r),Q(Kt,2*vr,2*_r),Q(Kt,2*vr+1,2*_r+1)}function Q(gr,Kt,vr){var _r=gr[Kt];gr[Kt]=gr[vr],gr[vr]=_r}function me(gr,Kt,vr,_r,rn,gn,Mn){for(var In=[0,gr.length-1,0],fa=[],Ca,Ma;In.length;){var Da=In.pop(),Va=In.pop(),na=In.pop();if(Va-na<=Mn){for(var Mi=na;Mi<=Va;Mi++)Ca=Kt[2*Mi],Ma=Kt[2*Mi+1],Ca>=vr&&Ca<=rn&&Ma>=_r&&Ma<=gn&&fa.push(gr[Mi]);continue}var Oi=Math.floor((na+Va)/2);Ca=Kt[2*Oi],Ma=Kt[2*Oi+1],Ca>=vr&&Ca<=rn&&Ma>=_r&&Ma<=gn&&fa.push(gr[Oi]);var Vt=(Da+1)%2;(Da===0?vr<=Ca:_r<=Ma)&&(In.push(na),In.push(Oi-1),In.push(Vt)),(Da===0?rn>=Ca:gn>=Ma)&&(In.push(Oi+1),In.push(Va),In.push(Vt))}return fa}function ie(gr,Kt,vr,_r,rn,gn){for(var Mn=[0,gr.length-1,0],In=[],fa=rn*rn;Mn.length;){var Ca=Mn.pop(),Ma=Mn.pop(),Da=Mn.pop();if(Ma-Da<=gn){for(var Va=Da;Va<=Ma;Va++)Y(Kt[2*Va],Kt[2*Va+1],vr,_r)<=fa&&In.push(gr[Va]);continue}var na=Math.floor((Da+Ma)/2),Mi=Kt[2*na],Oi=Kt[2*na+1];Y(Mi,Oi,vr,_r)<=fa&&In.push(gr[na]);var Vt=(Ca+1)%2;(Ca===0?vr-rn<=Mi:_r-rn<=Oi)&&(Mn.push(Da),Mn.push(na-1),Mn.push(Vt)),(Ca===0?vr+rn>=Mi:_r+rn>=Oi)&&(Mn.push(na+1),Mn.push(Ma),Mn.push(Vt))}return In}function Y(gr,Kt,vr,_r){var rn=gr-vr,gn=Kt-_r;return rn*rn+gn*gn}var le=function(gr){return gr[0]},ue=function(gr){return gr[1]},Te=function(Kt,vr,_r,rn,gn){vr===void 0&&(vr=le),_r===void 0&&(_r=ue),rn===void 0&&(rn=64),gn===void 0&&(gn=Float64Array),this.nodeSize=rn,this.points=Kt;for(var Mn=Kt.length<65536?Uint16Array:Uint32Array,In=this.ids=new Mn(Kt.length),fa=this.coords=new gn(Kt.length*2),Ca=0;Ca=rn;Ma--){var Da=+Date.now();fa=this._cluster(fa,Ma),this.trees[Ma]=new Te(fa,Ae,Ke,Mn,Float32Array),_r&&console.log("z%d: %d clusters in %dms",Ma,fa.length,+Date.now()-Da)}return _r&&console.timeEnd("total time"),this},Ve.prototype.getClusters=function(Kt,vr){var _r=((Kt[0]+180)%360+360)%360-180,rn=Math.max(-90,Math.min(90,Kt[1])),gn=Kt[2]===180?180:((Kt[2]+180)%360+360)%360-180,Mn=Math.max(-90,Math.min(90,Kt[3]));if(Kt[2]-Kt[0]>=360)_r=-180,gn=180;else if(_r>gn){var In=this.getClusters([_r,rn,180,Mn],vr),fa=this.getClusters([-180,rn,gn,Mn],vr);return In.concat(fa)}for(var Ca=this.trees[this._limitZoom(vr)],Ma=Ca.range(bt(_r),mt(Mn),bt(gn),mt(rn)),Da=[],Va=0,na=Ma;Vavr&&(Oi+=Kr.numPoints||1)}if(Oi>=fa){for(var Qr=Da.x*Mi,Gr=Da.y*Mi,Jr=In&&Mi>1?this._map(Da,!0):null,yn=(Ma<<5)+(vr+1)+this.points.length,cn=0,Dt=na;cn1)for(var Hn=0,ea=na;Hn>5},Ve.prototype._getOriginZoom=function(Kt){return(Kt-this.points.length)%32},Ve.prototype._map=function(Kt,vr){if(Kt.numPoints)return vr?ze({},Kt.properties):Kt.properties;var _r=this.points[Kt.index].properties,rn=this.options.map(_r);return vr&&rn===_r?ze({},rn):rn};function Xe(gr,Kt,vr,_r,rn){return{x:gr,y:Kt,zoom:1/0,id:vr,parentId:-1,numPoints:_r,properties:rn}}function We(gr,Kt){var vr=gr.geometry.coordinates,_r=vr[0],rn=vr[1];return{x:bt(_r),y:mt(rn),zoom:1/0,index:Kt,parentId:-1}}function it(gr){return{type:"Feature",id:gr.id,properties:yt(gr),geometry:{type:"Point",coordinates:[ht(gr.x),qe(gr.y)]}}}function yt(gr){var Kt=gr.numPoints,vr=Kt>=1e4?Math.round(Kt/1e3)+"k":Kt>=1e3?Math.round(Kt/100)/10+"k":Kt;return ze(ze({},gr.properties),{cluster:!0,cluster_id:gr.id,point_count:Kt,point_count_abbreviated:vr})}function bt(gr){return gr/360+.5}function mt(gr){var Kt=Math.sin(gr*Math.PI/180),vr=.5-.25*Math.log((1+Kt)/(1-Kt))/Math.PI;return vr<0?0:vr>1?1:vr}function ht(gr){return(gr-.5)*360}function qe(gr){var Kt=(180-gr*360)*Math.PI/180;return 360*Math.atan(Math.exp(Kt))/Math.PI-90}function ze(gr,Kt){for(var vr in Kt)gr[vr]=Kt[vr];return gr}function Ae(gr){return gr.x}function Ke(gr){return gr.y}function _t(gr,Kt,vr,_r){for(var rn=_r,gn=vr-Kt>>1,Mn=vr-Kt,In,fa=gr[Kt],Ca=gr[Kt+1],Ma=gr[vr],Da=gr[vr+1],Va=Kt+3;Varn)In=Va,rn=na;else if(na===rn){var Mi=Math.abs(Va-gn);Mi_r&&(In-Kt>3&&_t(gr,Kt,In,_r),gr[In+2]=rn,vr-In>3&&_t(gr,In,vr,_r))}function wt(gr,Kt,vr,_r,rn,gn){var Mn=rn-vr,In=gn-_r;if(Mn!==0||In!==0){var fa=((gr-vr)*Mn+(Kt-_r)*In)/(Mn*Mn+In*In);fa>1?(vr=rn,_r=gn):fa>0&&(vr+=Mn*fa,_r+=In*fa)}return Mn=gr-vr,In=Kt-_r,Mn*Mn+In*In}function vt(gr,Kt,vr,_r){var rn={id:typeof gr>"u"?null:gr,type:Kt,geometry:vr,tags:_r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return $t(rn),rn}function $t(gr){var Kt=gr.geometry,vr=gr.type;if(vr==="Point"||vr==="MultiPoint"||vr==="LineString")Yt(gr,Kt);else if(vr==="Polygon"||vr==="MultiLineString")for(var _r=0;_r0&&(_r?Mn+=(rn*Ca-fa*gn)/2:Mn+=Math.sqrt(Math.pow(fa-rn,2)+Math.pow(Ca-gn,2))),rn=fa,gn=Ca}var Ma=Kt.length-3;Kt[2]=1,_t(Kt,0,Ma,vr),Kt[Ma+2]=1,Kt.size=Math.abs(Mn),Kt.start=0,Kt.end=Kt.size}function ln(gr,Kt,vr,_r){for(var rn=0;rn1?1:vr}function Ot(gr,Kt,vr,_r,rn,gn,Mn,In){if(vr/=Kt,_r/=Kt,gn>=vr&&Mn<_r)return gr;if(Mn=_r)return null;for(var fa=[],Ca=0;Ca=vr&&Mi<_r){fa.push(Ma);continue}else if(Mi=_r)continue;var Oi=[];if(Va==="Point"||Va==="MultiPoint")Qe(Da,Oi,vr,_r,rn);else if(Va==="LineString")ct(Da,Oi,vr,_r,rn,!1,In.lineMetrics);else if(Va==="MultiLineString")Ie(Da,Oi,vr,_r,rn,!1);else if(Va==="Polygon")Ie(Da,Oi,vr,_r,rn,!0);else if(Va==="MultiPolygon")for(var Vt=0;Vt=vr&&Mn<=_r&&(Kt.push(gr[gn]),Kt.push(gr[gn+1]),Kt.push(gr[gn+2]))}}function ct(gr,Kt,vr,_r,rn,gn,Mn){for(var In=Ue(gr),fa=rn===0?Be:at,Ca=gr.start,Ma,Da,Va=0;Vavr&&(Da=fa(In,na,Mi,Vt,Ct,vr),Mn&&(In.start=Ca+Ma*Da)):Br>_r?Kr<_r&&(Da=fa(In,na,Mi,Vt,Ct,_r),Mn&&(In.start=Ca+Ma*Da)):Pe(In,na,Mi,Oi),Kr=vr&&(Da=fa(In,na,Mi,Vt,Ct,vr),Qr=!0),Kr>_r&&Br<=_r&&(Da=fa(In,na,Mi,Vt,Ct,_r),Qr=!0),!gn&&Qr&&(Mn&&(In.end=Ca+Ma*Da),Kt.push(In),In=Ue(gr)),Mn&&(Ca+=Ma)}var Gr=gr.length-3;na=gr[Gr],Mi=gr[Gr+1],Oi=gr[Gr+2],Br=rn===0?na:Mi,Br>=vr&&Br<=_r&&Pe(In,na,Mi,Oi),Gr=In.length-3,gn&&Gr>=3&&(In[Gr]!==In[0]||In[Gr+1]!==In[1])&&Pe(In,In[0],In[1],In[2]),In.length&&Kt.push(In)}function Ue(gr){var Kt=[];return Kt.size=gr.size,Kt.start=gr.start,Kt.end=gr.end,Kt}function Ie(gr,Kt,vr,_r,rn,gn){for(var Mn=0;MnMn.maxX&&(Mn.maxX=Ma),Da>Mn.maxY&&(Mn.maxY=Da)}return Mn}function Sr(gr,Kt,vr,_r){var rn=Kt.geometry,gn=Kt.type,Mn=[];if(gn==="Point"||gn==="MultiPoint")for(var In=0;In0&&Kt.size<(rn?Mn:_r)){vr.numPoints+=Kt.length/3;return}for(var In=[],fa=0;faMn)&&(vr.numSimplified++,In.push(Kt[fa]),In.push(Kt[fa+1])),vr.numPoints++;rn&&Yr(In,gn),gr.push(In)}function Yr(gr,Kt){for(var vr=0,_r=0,rn=gr.length,gn=rn-2;_r0===Kt)for(_r=0,rn=gr.length;_r24)throw new Error("maxZoom should be in the 0-24 range");if(Kt.promoteId&&Kt.generateId)throw new Error("promoteId and generateId cannot be used together.");var _r=lr(gr,Kt);this.tiles={},this.tileCoords=[],vr&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Kt.indexMaxZoom,Kt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),_r=ft(_r,Kt),_r.length&&this.splitTile(_r,0,0,0),vr&&(_r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}ua.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},ua.prototype.splitTile=function(gr,Kt,vr,_r,rn,gn,Mn){for(var In=[gr,Kt,vr,_r],fa=this.options,Ca=fa.debug;In.length;){_r=In.pop(),vr=In.pop(),Kt=In.pop(),gr=In.pop();var Ma=1<1&&console.time("creation"),Va=this.tiles[Da]=Cr(gr,Kt,vr,_r,fa),this.tileCoords.push({z:Kt,x:vr,y:_r}),Ca)){Ca>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Kt,vr,_r,Va.numFeatures,Va.numPoints,Va.numSimplified),console.timeEnd("creation"));var na="z"+Kt;this.stats[na]=(this.stats[na]||0)+1,this.total++}if(Va.source=gr,rn){if(Kt===fa.maxZoom||Kt===rn)continue;var Mi=1<1&&console.time("clipping");var Oi=.5*fa.buffer/fa.extent,Vt=.5-Oi,Ct=.5+Oi,Br=1+Oi,Kr,Qr,Gr,Jr,yn,cn;Kr=Qr=Gr=Jr=null,yn=Ot(gr,Ma,vr-Oi,vr+Ct,0,Va.minX,Va.maxX,fa),cn=Ot(gr,Ma,vr+Vt,vr+Br,0,Va.minX,Va.maxX,fa),gr=null,yn&&(Kr=Ot(yn,Ma,_r-Oi,_r+Ct,1,Va.minY,Va.maxY,fa),Qr=Ot(yn,Ma,_r+Vt,_r+Br,1,Va.minY,Va.maxY,fa),yn=null),cn&&(Gr=Ot(cn,Ma,_r-Oi,_r+Ct,1,Va.minY,Va.maxY,fa),Jr=Ot(cn,Ma,_r+Vt,_r+Br,1,Va.minY,Va.maxY,fa),cn=null),Ca>1&&console.timeEnd("clipping"),In.push(Kr||[],Kt+1,vr*2,_r*2),In.push(Qr||[],Kt+1,vr*2,_r*2+1),In.push(Gr||[],Kt+1,vr*2+1,_r*2),In.push(Jr||[],Kt+1,vr*2+1,_r*2+1)}}},ua.prototype.getTile=function(gr,Kt,vr){var _r=this.options,rn=_r.extent,gn=_r.debug;if(gr<0||gr>24)return null;var Mn=1<1&&console.log("drilling down to z%d-%d-%d",gr,Kt,vr);for(var fa=gr,Ca=Kt,Ma=vr,Da;!Da&&fa>0;)fa--,Ca=Math.floor(Ca/2),Ma=Math.floor(Ma/2),Da=this.tiles[ta(fa,Ca,Ma)];return!Da||!Da.source?null:(gn>1&&console.log("found parent tile z%d-%d-%d",fa,Ca,Ma),gn>1&&console.time("drilling down"),this.splitTile(Da.source,fa,Ca,Ma,gr,Kt,vr),gn>1&&console.timeEnd("drilling down"),this.tiles[In]?Ht(this.tiles[In],rn):null)};function ta(gr,Kt,vr){return((1<=0?0:De.button},r.remove=function(De){De.parentNode&&De.parentNode.removeChild(De)};function p(De,G,xe){var re,Le,et,xt=e.browser.devicePixelRatio>1?"@2x":"",At=e.getJSON(G.transformRequest(G.normalizeSpriteURL(De,xt,".json"),e.ResourceType.SpriteJSON),function(It,ar){At=null,et||(et=It,re=ar,gt())}),lt=e.getImage(G.transformRequest(G.normalizeSpriteURL(De,xt,".png"),e.ResourceType.SpriteImage),function(It,ar){lt=null,et||(et=It,Le=ar,gt())});function gt(){if(et)xe(et);else if(re&&Le){var It=e.browser.getImageData(Le),ar={};for(var Jt in re){var sr=re[Jt],pr=sr.width,fr=sr.height,Wt=sr.x,rr=sr.y,er=sr.sdf,$r=sr.pixelRatio,sn=sr.stretchX,xn=sr.stretchY,wa=sr.content,la=new e.RGBAImage({width:pr,height:fr});e.RGBAImage.copy(It,la,{x:Wt,y:rr},{x:0,y:0},{width:pr,height:fr}),ar[Jt]={data:la,pixelRatio:$r,sdf:er,stretchX:sn,stretchY:xn,content:wa}}xe(null,ar)}}return{cancel:function(){At&&(At.cancel(),At=null),lt&&(lt.cancel(),lt=null)}}}function T(De){var G=De.userImage;if(G&&G.render){var xe=G.render();if(xe)return De.data.replace(new Uint8Array(G.data.buffer)),!0}return!1}var l=1,g=function(De){function G(){De.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 De&&(G.__proto__=De),G.prototype=Object.create(De&&De.prototype),G.prototype.constructor=G,G.prototype.isLoaded=function(){return this.loaded},G.prototype.setLoaded=function(re){if(this.loaded!==re&&(this.loaded=re,re)){for(var Le=0,et=this.requestors;Le=0?1.2:1))}w.prototype.draw=function(De){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(De,this.buffer,this.middle);for(var G=this.ctx.getImageData(0,0,this.size,this.size),xe=new Uint8ClampedArray(this.size*this.size),re=0;re65535){It(new Error("glyphs > 65535 not supported"));return}if(sr.ranges[fr]){It(null,{stack:ar,id:Jt,glyph:pr});return}var Wt=sr.requests[fr];Wt||(Wt=sr.requests[fr]=[],d.loadGlyphRange(ar,fr,re.url,re.requestManager,function(rr,er){if(er){for(var $r in er)re._doesCharSupportLocalGlyph(+$r)||(sr.glyphs[+$r]=er[+$r]);sr.ranges[fr]=!0}for(var sn=0,xn=Wt;sn1&&(gt=G[++lt]);var ar=Math.abs(It-gt.left),Jt=Math.abs(It-gt.right),sr=Math.min(ar,Jt),pr=void 0,fr=et/re*(Le+1);if(gt.isDash){var Wt=Le-Math.abs(fr);pr=Math.sqrt(sr*sr+Wt*Wt)}else pr=Le-Math.sqrt(sr*sr+fr*fr);this.data[At+It]=Math.max(0,Math.min(255,pr+128))}},N.prototype.addRegularDash=function(G){for(var xe=G.length-1;xe>=0;--xe){var re=G[xe],Le=G[xe+1];re.zeroLength?G.splice(xe,1):Le&&Le.isDash===re.isDash&&(Le.left=re.left,G.splice(xe,1))}var et=G[0],xt=G[G.length-1];et.isDash===xt.isDash&&(et.left=xt.left-this.width,xt.right=et.right+this.width);for(var At=this.width*this.nextRow,lt=0,gt=G[lt],It=0;It1&&(gt=G[++lt]);var ar=Math.abs(It-gt.left),Jt=Math.abs(It-gt.right),sr=Math.min(ar,Jt),pr=gt.isDash?sr:-sr;this.data[At+It]=Math.max(0,Math.min(255,pr+128))}},N.prototype.addDash=function(G,xe){var re=xe?7:0,Le=2*re+1;if(this.nextRow+Le>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var et=0,xt=0;xt=re.minX&&G.x=re.minY&&G.y0&&(It[new e.OverscaledTileID(re.overscaledZ,At,Le.z,xt,Le.y-1).key]={backfilled:!1},It[new e.OverscaledTileID(re.overscaledZ,re.wrap,Le.z,Le.x,Le.y-1).key]={backfilled:!1},It[new e.OverscaledTileID(re.overscaledZ,gt,Le.z,lt,Le.y-1).key]={backfilled:!1}),Le.y+10&&(et.resourceTiming=re._resourceTiming,re._resourceTiming=[]),re.fire(new e.Event("data",et))})},G.prototype.onAdd=function(re){this.map=re,this.load()},G.prototype.setData=function(re){var Le=this;return this._data=re,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(et){if(et){Le.fire(new e.ErrorEvent(et));return}var xt={dataType:"source",sourceDataType:"content"};Le._collectResourceTiming&&Le._resourceTiming&&Le._resourceTiming.length>0&&(xt.resourceTiming=Le._resourceTiming,Le._resourceTiming=[]),Le.fire(new e.Event("data",xt))}),this},G.prototype.getClusterExpansionZoom=function(re,Le){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:re,source:this.id},Le),this},G.prototype.getClusterChildren=function(re,Le){return this.actor.send("geojson.getClusterChildren",{clusterId:re,source:this.id},Le),this},G.prototype.getClusterLeaves=function(re,Le,et,xt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:re,limit:Le,offset:et},xt),this},G.prototype._updateWorkerData=function(re){var Le=this;this._loaded=!1;var et=e.extend({},this.workerOptions),xt=this._data;typeof xt=="string"?(et.request=this.map._requestManager.transformRequest(e.browser.resolveURL(xt),e.ResourceType.Source),et.request.collectResourceTiming=this._collectResourceTiming):et.data=JSON.stringify(xt),this.actor.send(this.type+".loadData",et,function(At,lt){Le._removed||lt&<.abandoned||(Le._loaded=!0,lt&<.resourceTiming&<.resourceTiming[Le.id]&&(Le._resourceTiming=lt.resourceTiming[Le.id].slice(0)),Le.actor.send(Le.type+".coalesce",{source:et.source},null),re(At))})},G.prototype.loaded=function(){return this._loaded},G.prototype.loadTile=function(re,Le){var et=this,xt=re.actor?"reloadTile":"loadTile";re.actor=this.actor;var At={type:this.type,uid:re.uid,tileID:re.tileID,zoom:re.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};re.request=this.actor.send(xt,At,function(lt,gt){return delete re.request,re.unloadVectorData(),re.aborted?Le(null):lt?Le(lt):(re.loadVectorData(gt,et.map.painter,xt==="reloadTile"),Le(null))})},G.prototype.abortTile=function(re){re.request&&(re.request.cancel(),delete re.request),re.aborted=!0},G.prototype.unloadTile=function(re){re.unloadVectorData(),this.actor.send("removeTile",{uid:re.uid,type:this.type,source:this.id})},G.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},G.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},G.prototype.hasTransition=function(){return!1},G}(e.Evented),ye=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),pe=function(De){function G(xe,re,Le,et){De.call(this),this.id=xe,this.dispatcher=Le,this.coordinates=re.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(et),this.options=re}return De&&(G.__proto__=De),G.prototype=Object.create(De&&De.prototype),G.prototype.constructor=G,G.prototype.load=function(re,Le){var et=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(xt,At){et._loaded=!0,xt?et.fire(new e.ErrorEvent(xt)):At&&(et.image=At,re&&(et.coordinates=re),Le&&Le(),et._finishLoading())})},G.prototype.loaded=function(){return this._loaded},G.prototype.updateImage=function(re){var Le=this;return!this.image||!re.url?this:(this.options.url=re.url,this.load(re.coordinates,function(){Le.texture=null}),this)},G.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},G.prototype.onAdd=function(re){this.map=re,this.load()},G.prototype.setCoordinates=function(re){var Le=this;this.coordinates=re;var et=re.map(e.MercatorCoordinate.fromLngLat);this.tileID=ge(et),this.minzoom=this.maxzoom=this.tileID.z;var xt=et.map(function(At){return Le.tileID.getTilePoint(At)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(xt[0].x,xt[0].y,0,0),this._boundsArray.emplaceBack(xt[1].x,xt[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(xt[3].x,xt[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(xt[2].x,xt[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},G.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var re=this.map.painter.context,Le=re.gl;this.boundsBuffer||(this.boundsBuffer=re.createVertexBuffer(this._boundsArray,ye.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(re,this.image,Le.RGBA),this.texture.bind(Le.LINEAR,Le.CLAMP_TO_EDGE));for(var et in this.tiles){var xt=this.tiles[et];xt.state!=="loaded"&&(xt.state="loaded",xt.texture=this.texture)}}},G.prototype.loadTile=function(re,Le){this.tileID&&this.tileID.equals(re.tileID.canonical)?(this.tiles[String(re.tileID.wrap)]=re,re.buckets={},Le(null)):(re.state="errored",Le(null))},G.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},G.prototype.hasTransition=function(){return!1},G}(e.Evented);function ge(De){for(var G=1/0,xe=1/0,re=-1/0,Le=-1/0,et=0,xt=De;etLe.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+Le.start(0)+" and "+Le.end(0)+"-second mark."))):this.video.currentTime=re}},G.prototype.getVideo=function(){return this.video},G.prototype.onAdd=function(re){this.map||(this.map=re,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},G.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var re=this.map.painter.context,Le=re.gl;this.boundsBuffer||(this.boundsBuffer=re.createVertexBuffer(this._boundsArray,ye.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(Le.LINEAR,Le.CLAMP_TO_EDGE),Le.texSubImage2D(Le.TEXTURE_2D,0,0,0,Le.RGBA,Le.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(re,this.video,Le.RGBA),this.texture.bind(Le.LINEAR,Le.CLAMP_TO_EDGE));for(var et in this.tiles){var xt=this.tiles[et];xt.state!=="loaded"&&(xt.state="loaded",xt.texture=this.texture)}}},G.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},G.prototype.hasTransition=function(){return this.video&&!this.video.paused},G}(pe),ae=function(De){function G(xe,re,Le,et){De.call(this,xe,re,Le,et),re.coordinates?(!Array.isArray(re.coordinates)||re.coordinates.length!==4||re.coordinates.some(function(xt){return!Array.isArray(xt)||xt.length!==2||xt.some(function(At){return typeof At!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+xe,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+xe,null,'missing required property "coordinates"'))),re.animate&&typeof re.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+xe,null,'optional "animate" property must be a boolean value'))),re.canvas?typeof re.canvas!="string"&&!(re.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+xe,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."+xe,null,'missing required property "canvas"'))),this.options=re,this.animate=re.animate!==void 0?re.animate:!0}return De&&(G.__proto__=De),G.prototype=Object.create(De&&De.prototype),G.prototype.constructor=G,G.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()},G.prototype.getCanvas=function(){return this.canvas},G.prototype.onAdd=function(re){this.map=re,this.load(),this.canvas&&this.animate&&this.play()},G.prototype.onRemove=function(){this.pause()},G.prototype.prepare=function(){var re=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,re=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,re=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var Le=this.map.painter.context,et=Le.gl;this.boundsBuffer||(this.boundsBuffer=Le.createVertexBuffer(this._boundsArray,ye.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(re||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(Le,this.canvas,et.RGBA,{premultiply:!0});for(var xt in this.tiles){var At=this.tiles[xt];At.state!=="loaded"&&(At.state="loaded",At.texture=this.texture)}}},G.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},G.prototype.hasTransition=function(){return this._playing},G.prototype._hasInvalidDimensions=function(){for(var re=0,Le=[this.canvas.width,this.canvas.height];rethis.max){var At=this._getAndRemoveByKey(this.order[0]);At&&this.onRemove(At)}return this},We.prototype.has=function(G){return G.wrapped().key in this.data},We.prototype.getAndRemove=function(G){return this.has(G)?this._getAndRemoveByKey(G.wrapped().key):null},We.prototype._getAndRemoveByKey=function(G){var xe=this.data[G].shift();return xe.timeout&&clearTimeout(xe.timeout),this.data[G].length===0&&delete this.data[G],this.order.splice(this.order.indexOf(G),1),xe.value},We.prototype.getByKey=function(G){var xe=this.data[G];return xe?xe[0].value:null},We.prototype.get=function(G){if(!this.has(G))return null;var xe=this.data[G.wrapped().key][0];return xe.value},We.prototype.remove=function(G,xe){if(!this.has(G))return this;var re=G.wrapped().key,Le=xe===void 0?0:this.data[re].indexOf(xe),et=this.data[re][Le];return this.data[re].splice(Le,1),et.timeout&&clearTimeout(et.timeout),this.data[re].length===0&&delete this.data[re],this.onRemove(et.value),this.order.splice(this.order.indexOf(re),1),this},We.prototype.setMaxSize=function(G){for(this.max=G;this.order.length>this.max;){var xe=this._getAndRemoveByKey(this.order[0]);xe&&this.onRemove(xe)}return this},We.prototype.filter=function(G){var xe=[];for(var re in this.data)for(var Le=0,et=this.data[re];Le1||(Math.abs(ar)>1&&(Math.abs(ar+sr)===1?ar+=sr:Math.abs(ar-sr)===1&&(ar-=sr)),!(!It.dem||!gt.dem)&&(gt.dem.backfillBorder(It.dem,ar,Jt),gt.neighboringTiles&>.neighboringTiles[pr]&&(gt.neighboringTiles[pr].backfilled=!0)))}},G.prototype.getTile=function(re){return this.getTileByID(re.key)},G.prototype.getTileByID=function(re){return this._tiles[re]},G.prototype._retainLoadedChildren=function(re,Le,et,xt){for(var At in this._tiles){var lt=this._tiles[At];if(!(xt[At]||!lt.hasData()||lt.tileID.overscaledZ<=Le||lt.tileID.overscaledZ>et)){for(var gt=lt.tileID;lt&<.tileID.overscaledZ>Le+1;){var It=lt.tileID.scaledTo(lt.tileID.overscaledZ-1);lt=this._tiles[It.key],lt&<.hasData()&&(gt=It)}for(var ar=gt;ar.overscaledZ>Le;)if(ar=ar.scaledTo(ar.overscaledZ-1),re[ar.key]){xt[gt.key]=gt;break}}}},G.prototype.findLoadedParent=function(re,Le){if(re.key in this._loadedParentTiles){var et=this._loadedParentTiles[re.key];return et&&et.tileID.overscaledZ>=Le?et:null}for(var xt=re.overscaledZ-1;xt>=Le;xt--){var At=re.scaledTo(xt),lt=this._getLoadedTile(At);if(lt)return lt}},G.prototype._getLoadedTile=function(re){var Le=this._tiles[re.key];if(Le&&Le.hasData())return Le;var et=this._cache.getByKey(re.wrapped().key);return et},G.prototype.updateCacheSize=function(re){var Le=Math.ceil(re.width/this._source.tileSize)+1,et=Math.ceil(re.height/this._source.tileSize)+1,xt=Le*et,At=5,lt=Math.floor(xt*At),gt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,lt):lt;this._cache.setMaxSize(gt)},G.prototype.handleWrapJump=function(re){var Le=this._prevLng===void 0?re:this._prevLng,et=re-Le,xt=et/360,At=Math.round(xt);if(this._prevLng=re,At){var lt={};for(var gt in this._tiles){var It=this._tiles[gt];It.tileID=It.tileID.unwrapTo(It.tileID.wrap+At),lt[It.tileID.key]=It}this._tiles=lt;for(var ar in this._timers)clearTimeout(this._timers[ar]),delete this._timers[ar];for(var Jt in this._tiles){var sr=this._tiles[Jt];this._setTileReloadTimer(Jt,sr)}}},G.prototype.update=function(re){var Le=this;if(this.transform=re,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(re),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var et;this.used?this._source.tileID?et=re.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(Ea){return new e.OverscaledTileID(Ea.canonical.z,Ea.wrap,Ea.canonical.z,Ea.canonical.x,Ea.canonical.y)}):(et=re.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(et=et.filter(function(Ea){return Le._source.hasTile(Ea)}))):et=[];var xt=re.coveringZoomLevel(this._source),At=Math.max(xt-G.maxOverzooming,this._source.minzoom),lt=Math.max(xt+G.maxUnderzooming,this._source.minzoom),gt=this._updateRetainedTiles(et,xt);if(fa(this._source.type)){for(var It={},ar={},Jt=Object.keys(gt),sr=0,pr=Jt;srthis._source.maxzoom){var er=Wt.children(this._source.maxzoom)[0],$r=this.getTile(er);if($r&&$r.hasData()){et[er.key]=er;continue}}else{var sn=Wt.children(this._source.maxzoom);if(et[sn[0].key]&&et[sn[1].key]&&et[sn[2].key]&&et[sn[3].key])continue}for(var xn=rr.wasRequested(),wa=Wt.overscaledZ-1;wa>=At;--wa){var la=Wt.scaledTo(wa);if(xt[la.key]||(xt[la.key]=!0,rr=this.getTile(la),!rr&&xn&&(rr=this._addTile(la)),rr&&(et[la.key]=la,xn=rr.wasRequested(),rr.hasData())))break}}}return et},G.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var re in this._tiles){for(var Le=[],et=void 0,xt=this._tiles[re].tileID;xt.overscaledZ>0;){if(xt.key in this._loadedParentTiles){et=this._loadedParentTiles[xt.key];break}Le.push(xt.key);var At=xt.scaledTo(xt.overscaledZ-1);if(et=this._getLoadedTile(At),et)break;xt=At}for(var lt=0,gt=Le;lt0)&&(Le.hasData()&&Le.state!=="reloading"?this._cache.add(Le.tileID,Le,Le.getExpiryTimeout()):(Le.aborted=!0,this._abortTile(Le),this._unloadTile(Le))))},G.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var re in this._tiles)this._removeTile(re);this._cache.reset()},G.prototype.tilesIn=function(re,Le,et){var xt=this,At=[],lt=this.transform;if(!lt)return At;for(var gt=et?lt.getCameraQueryGeometry(re):re,It=re.map(function(wa){return lt.pointCoordinate(wa)}),ar=gt.map(function(wa){return lt.pointCoordinate(wa)}),Jt=this.getIds(),sr=1/0,pr=1/0,fr=-1/0,Wt=-1/0,rr=0,er=ar;rr=0&&Ga[1].y+Ea>=0){var Sa=It.map(function(ci){return aa.getTilePoint(ci)}),Za=ar.map(function(ci){return aa.getTilePoint(ci)});At.push({tile:la,tileID:aa,queryGeometry:Sa,cameraQueryGeometry:Za,scale:Ta})}}},xn=0;xn=e.browser.now())return!0}return!1},G.prototype.setFeatureState=function(re,Le,et){re=re||"_geojsonTileLayer",this._state.updateState(re,Le,et)},G.prototype.removeFeatureState=function(re,Le,et){re=re||"_geojsonTileLayer",this._state.removeFeatureState(re,Le,et)},G.prototype.getFeatureState=function(re,Le){return re=re||"_geojsonTileLayer",this._state.getState(re,Le)},G.prototype.setDependencies=function(re,Le,et){var xt=this._tiles[re];xt&&xt.setDependencies(Le,et)},G.prototype.reloadTilesForDependencies=function(re,Le){for(var et in this._tiles){var xt=this._tiles[et];xt.hasDependency(re,Le)&&this._reloadTile(et,"reloading")}this._cache.filter(function(At){return!At.hasDependency(re,Le)})},G}(e.Evented);Mn.maxOverzooming=10,Mn.maxUnderzooming=3;function In(De,G){var xe=Math.abs(De.wrap*2)-+(De.wrap<0),re=Math.abs(G.wrap*2)-+(G.wrap<0);return De.overscaledZ-G.overscaledZ||re-xe||G.canonical.y-De.canonical.y||G.canonical.x-De.canonical.x}function fa(De){return De==="raster"||De==="image"||De==="video"}function Ca(){return new e.window.Worker(gs.workerUrl)}var Ma="mapboxgl_preloaded_worker_pool",Da=function(){this.active={}};Da.prototype.acquire=function(G){if(!this.workers)for(this.workers=[];this.workers.length0?(Le-xt)/At:0;return this.points[et].mult(1-lt).add(this.points[xe].mult(lt))};var bn=function(G,xe,re){var Le=this.boxCells=[],et=this.circleCells=[];this.xCellCount=Math.ceil(G/re),this.yCellCount=Math.ceil(xe/re);for(var xt=0;xtthis.width||Le<0||xe>this.height)return et?!1:[];var At=[];if(G<=0&&xe<=0&&this.width<=re&&this.height<=Le){if(et)return!0;for(var lt=0;lt0:At}},bn.prototype._queryCircle=function(G,xe,re,Le,et){var xt=G-re,At=G+re,lt=xe-re,gt=xe+re;if(At<0||xt>this.width||gt<0||lt>this.height)return Le?!1:[];var It=[],ar={hitTest:Le,circle:{x:G,y:xe,radius:re},seenUids:{box:{},circle:{}}};return this._forEachCell(xt,lt,At,gt,this._queryCellCircle,It,ar,et),Le?It.length>0:It},bn.prototype.query=function(G,xe,re,Le,et){return this._query(G,xe,re,Le,!1,et)},bn.prototype.hitTest=function(G,xe,re,Le,et){return this._query(G,xe,re,Le,!0,et)},bn.prototype.hitTestCircle=function(G,xe,re,Le){return this._queryCircle(G,xe,re,!0,Le)},bn.prototype._queryCell=function(G,xe,re,Le,et,xt,At,lt){var gt=At.seenUids,It=this.boxCells[et];if(It!==null)for(var ar=this.bboxes,Jt=0,sr=It;Jt=ar[fr+0]&&Le>=ar[fr+1]&&(!lt||lt(this.boxKeys[pr]))){if(At.hitTest)return xt.push(!0),!0;xt.push({key:this.boxKeys[pr],x1:ar[fr],y1:ar[fr+1],x2:ar[fr+2],y2:ar[fr+3]})}}}var Wt=this.circleCells[et];if(Wt!==null)for(var rr=this.circles,er=0,$r=Wt;er<$r.length;er+=1){var sn=$r[er];if(!gt.circle[sn]){gt.circle[sn]=!0;var xn=sn*3;if(this._circleAndRectCollide(rr[xn],rr[xn+1],rr[xn+2],G,xe,re,Le)&&(!lt||lt(this.circleKeys[sn]))){if(At.hitTest)return xt.push(!0),!0;var wa=rr[xn],la=rr[xn+1],aa=rr[xn+2];xt.push({key:this.circleKeys[sn],x1:wa-aa,y1:la-aa,x2:wa+aa,y2:la+aa})}}}},bn.prototype._queryCellCircle=function(G,xe,re,Le,et,xt,At,lt){var gt=At.circle,It=At.seenUids,ar=this.boxCells[et];if(ar!==null)for(var Jt=this.bboxes,sr=0,pr=ar;srAt*At+lt*lt},bn.prototype._circleAndRectCollide=function(G,xe,re,Le,et,xt,At){var lt=(xt-Le)/2,gt=Math.abs(G-(Le+lt));if(gt>lt+re)return!1;var It=(At-et)/2,ar=Math.abs(xe-(et+It));if(ar>It+re)return!1;if(gt<=lt||ar<=It)return!0;var Jt=gt-lt,sr=ar-It;return Jt*Jt+sr*sr<=re*re};function $n(De,G,xe,re,Le){var et=e.create();return G?(e.scale(et,et,[1/Le,1/Le,1]),xe||e.rotateZ(et,et,re.angle)):e.multiply(et,re.labelPlaneMatrix,De),et}function ki(De,G,xe,re,Le){if(G){var et=e.clone(De);return e.scale(et,et,[Le,Le,1]),xe||e.rotateZ(et,et,-re.angle),et}else return re.glCoordMatrix}function Ua(De,G){var xe=[De.x,De.y,0,1];Zo(xe,xe,G);var re=xe[3];return{point:new e.Point(xe[0]/re,xe[1]/re),signedDistanceFromCamera:re}}function Fi(De,G){return .5+.5*(De/G)}function Ji(De,G){var xe=De[0]/De[3],re=De[1]/De[3],Le=xe>=-G[0]&&xe<=G[0]&&re>=-G[1]&&re<=G[1];return Le}function fo(De,G,xe,re,Le,et,xt,At){var lt=re?De.textSizeData:De.iconSizeData,gt=e.evaluateSizeForZoom(lt,xe.transform.zoom),It=[256/xe.width*2+1,256/xe.height*2+1],ar=re?De.text.dynamicLayoutVertexArray:De.icon.dynamicLayoutVertexArray;ar.clear();for(var Jt=De.lineVertexArray,sr=re?De.text.placedSymbolArray:De.icon.placedSymbolArray,pr=xe.transform.width/xe.transform.height,fr=!1,Wt=0;Wtet)return{useVertical:!0}}return(De===e.WritingMode.vertical?G.yxe.x)?{needsFlipping:!0}:null}function wi(De,G,xe,re,Le,et,xt,At,lt,gt,It,ar,Jt,sr){var pr=G/24,fr=De.lineOffsetX*pr,Wt=De.lineOffsetY*pr,rr;if(De.numGlyphs>1){var er=De.glyphStartIndex+De.numGlyphs,$r=De.lineStartIndex,sn=De.lineStartIndex+De.lineLength,xn=co(pr,At,fr,Wt,xe,It,ar,De,lt,et,Jt);if(!xn)return{notEnoughRoom:!0};var wa=Ua(xn.first.point,xt).point,la=Ua(xn.last.point,xt).point;if(re&&!xe){var aa=So(De.writingMode,wa,la,sr);if(aa)return aa}rr=[xn.first];for(var Ta=De.glyphStartIndex+1;Ta0?Za.point:ts(ar,Sa,Ea,1,Le),Ri=So(De.writingMode,Ea,ci,sr);if(Ri)return Ri}var Yi=jo(pr*At.getoffsetX(De.glyphStartIndex),fr,Wt,xe,It,ar,De.segment,De.lineStartIndex,De.lineStartIndex+De.lineLength,lt,et,Jt);if(!Yi)return{notEnoughRoom:!0};rr=[Yi]}for(var ys=0,ds=rr;ys0?1:-1,pr=0;re&&(sr*=-1,pr=Math.PI),sr<0&&(pr+=Math.PI);for(var fr=sr>0?At+xt:At+xt+1,Wt=Le,rr=Le,er=0,$r=0,sn=Math.abs(Jt),xn=[];er+$r<=sn;){if(fr+=sr,fr=lt)return null;if(rr=Wt,xn.push(Wt),Wt=ar[fr],Wt===void 0){var wa=new e.Point(gt.getx(fr),gt.gety(fr)),la=Ua(wa,It);if(la.signedDistanceFromCamera>0)Wt=ar[fr]=la.point;else{var aa=fr-sr,Ta=er===0?et:new e.Point(gt.getx(aa),gt.gety(aa));Wt=ts(Ta,wa,rr,sn-er+1,It)}}er+=$r,$r=rr.dist(Wt)}var Ea=(sn-er)/$r,Ga=Wt.sub(rr),Sa=Ga.mult(Ea)._add(rr);Sa._add(Ga._unit()._perp()._mult(xe*sr));var Za=pr+Math.atan2(Wt.y-rr.y,Wt.x-rr.x);return xn.push(Sa),{point:Sa,angle:Za,path:xn}}var js=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function us(De,G){for(var xe=0;xe=1;fl--)ds.push(Yi.path[fl]);for(var ol=1;ol0){for(var tl=ds[0].clone(),pu=ds[0].clone(),Mf=1;Mf=Za.x&&pu.x<=ci.x&&tl.y>=Za.y&&pu.y<=ci.y?Vu=[ds]:pu.xci.x||pu.yci.y?Vu=[]:Vu=e.clipLine([ds],Za.x,Za.y,ci.x,ci.y)}for(var Zf=0,Dd=Vu;Zf=this.screenRightBoundary||Lethis.screenBottomBoundary},Vs.prototype.isInsideGrid=function(G,xe,re,Le){return re>=0&&G=0&&xe0){var sn;return this.prevPlacement&&this.prevPlacement.variableOffsets[Jt.crossTileID]&&this.prevPlacement.placements[Jt.crossTileID]&&this.prevPlacement.placements[Jt.crossTileID].text&&(sn=this.prevPlacement.variableOffsets[Jt.crossTileID].anchor),this.variableOffsets[Jt.crossTileID]={textOffset:Wt,width:re,height:Le,anchor:G,textBoxScale:et,prevAnchor:sn},this.markUsedJustification(sr,G,Jt,pr),sr.allowVerticalPlacement&&(this.markUsedOrientation(sr,pr,Jt),this.placedOrientations[Jt.crossTileID]=pr),{shift:rr,placedGlyphBoxes:er}}},Ts.prototype.placeLayerBucketPart=function(G,xe,re){var Le=this,et=G.parameters,xt=et.bucket,At=et.layout,lt=et.posMatrix,gt=et.textLabelPlaneMatrix,It=et.labelToScreenMatrix,ar=et.textPixelRatio,Jt=et.holdingForFade,sr=et.collisionBoxArray,pr=et.partiallyEvaluatedTextSize,fr=et.collisionGroup,Wt=At.get("text-optional"),rr=At.get("icon-optional"),er=At.get("text-allow-overlap"),$r=At.get("icon-allow-overlap"),sn=At.get("text-rotation-alignment")==="map",xn=At.get("text-pitch-alignment")==="map",wa=At.get("icon-text-fit")!=="none",la=At.get("symbol-z-order")==="viewport-y",aa=er&&($r||!xt.hasIconData()||rr),Ta=$r&&(er||!xt.hasTextData()||Wt);!xt.collisionArrays&&sr&&xt.deserializeCollisionBoxes(sr);var Ea=function(Yi,ys){if(!xe[Yi.crossTileID]){if(Jt){Le.placements[Yi.crossTileID]=new $o(!1,!1,!1);return}var ds=!1,fl=!1,ol=!0,dl=null,hl={box:null,offscreen:null},Vu={box:null},tl=null,pu=null,Mf=null,Zf=0,Dd=0,Rd=0;ys.textFeatureIndex?Zf=ys.textFeatureIndex:Yi.useRuntimeCollisionCircles&&(Zf=Yi.featureIndex),ys.verticalTextFeatureIndex&&(Dd=ys.verticalTextFeatureIndex);var rd=ys.textBox;if(rd){var Gd=function(Zc){var Ju=e.WritingMode.horizontal;if(xt.allowVerticalPlacement&&!Zc&&Le.prevPlacement){var id=Le.prevPlacement.placedOrientations[Yi.crossTileID];id&&(Le.placedOrientations[Yi.crossTileID]=id,Ju=id,Le.markUsedOrientation(xt,Ju,Yi))}return Ju},Ep=function(Zc,Ju){if(xt.allowVerticalPlacement&&Yi.numVerticalGlyphVertices>0&&ys.verticalTextBox)for(var id=0,mv=xt.writingModes;id0&&(fd=fd.filter(function(Zc){return Zc!==ad.anchor}),fd.unshift(ad.anchor))}var Od=function(Zc,Ju,id){for(var mv=Zc.x2-Zc.x1,$v=Zc.y2-Zc.y1,hc=Yi.textBoxScale,B0=wa&&!$r?Ju:null,Wp={box:[],offscreen:!1},km=er?fd.length*2:fd.length,Fd=0;Fd=fd.length,U0=Le.attemptAnchorPlacement(Yp,Zc,mv,$v,hc,sn,xn,ar,lt,fr,Cm,Yi,xt,id,B0);if(U0&&(Wp=U0.placedGlyphBoxes,Wp&&Wp.box&&Wp.box.length)){ds=!0,dl=U0.shift;break}}return Wp},Hd=function(){return Od(rd,ys.iconBox,e.WritingMode.horizontal)},zd=function(){var Zc=ys.verticalTextBox,Ju=hl&&hl.box&&hl.box.length;return xt.allowVerticalPlacement&&!Ju&&Yi.numVerticalGlyphVertices>0&&Zc?Od(Zc,ys.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};Ep(Hd,zd),hl&&(ds=hl.box,ol=hl.offscreen);var dv=Gd(hl&&hl.box);if(!ds&&Le.prevPlacement){var kp=Le.prevPlacement.variableOffsets[Yi.crossTileID];kp&&(Le.variableOffsets[Yi.crossTileID]=kp,Le.markUsedJustification(xt,kp.anchor,Yi,dv))}}else{var Zd=function(Zc,Ju){var id=Le.collisionIndex.placeCollisionBox(Zc,er,ar,lt,fr.predicate);return id&&id.box&&id.box.length&&(Le.markUsedOrientation(xt,Ju,Yi),Le.placedOrientations[Yi.crossTileID]=Ju),id},nd=function(){return Zd(rd,e.WritingMode.horizontal)},Kd=function(){var Zc=ys.verticalTextBox;return xt.allowVerticalPlacement&&Yi.numVerticalGlyphVertices>0&&Zc?Zd(Zc,e.WritingMode.vertical):{box:null,offscreen:null}};Ep(nd,Kd),Gd(hl&&hl.box&&hl.box.length)}}if(tl=hl,ds=tl&&tl.box&&tl.box.length>0,ol=tl&&tl.offscreen,Yi.useRuntimeCollisionCircles){var yh=xt.text.placedSymbolArray.get(Yi.centerJustifiedTextSymbolIndex),Cp=e.evaluateSizeForFeature(xt.textSizeData,pr,yh),pv=At.get("text-padding"),Nh=Yi.collisionCircleDiameter;pu=Le.collisionIndex.placeCollisionCircles(er,yh,xt.lineVertexArray,xt.glyphOffsetArray,Cp,lt,gt,It,re,xn,fr.predicate,Nh,pv),ds=er||pu.circles.length>0&&!pu.collisionDetected,ol=ol&&pu.offscreen}if(ys.iconFeatureIndex&&(Rd=ys.iconFeatureIndex),ys.iconBox){var Gp=function(Zc){var Ju=wa&&dl?Ml(Zc,dl.x,dl.y,sn,xn,Le.transform.angle):Zc;return Le.collisionIndex.placeCollisionBox(Ju,$r,ar,lt,fr.predicate)};Vu&&Vu.box&&Vu.box.length&&ys.verticalIconBox?(Mf=Gp(ys.verticalIconBox),fl=Mf.box.length>0):(Mf=Gp(ys.iconBox),fl=Mf.box.length>0),ol=ol&&Mf.offscreen}var Gv=Wt||Yi.numHorizontalGlyphVertices===0&&Yi.numVerticalGlyphVertices===0,Hv=rr||Yi.numIconVertices===0;if(!Gv&&!Hv?fl=ds=fl&&ds:Hv?Gv||(fl=fl&&ds):ds=fl&&ds,ds&&tl&&tl.box&&(Vu&&Vu.box&&Dd?Le.collisionIndex.insertCollisionBox(tl.box,At.get("text-ignore-placement"),xt.bucketInstanceId,Dd,fr.ID):Le.collisionIndex.insertCollisionBox(tl.box,At.get("text-ignore-placement"),xt.bucketInstanceId,Zf,fr.ID)),fl&&Mf&&Le.collisionIndex.insertCollisionBox(Mf.box,At.get("icon-ignore-placement"),xt.bucketInstanceId,Rd,fr.ID),pu&&(ds&&Le.collisionIndex.insertCollisionCircles(pu.circles,At.get("text-ignore-placement"),xt.bucketInstanceId,Zf,fr.ID),re)){var vv=xt.bucketInstanceId,Hp=Le.collisionCircleArrays[vv];Hp===void 0&&(Hp=Le.collisionCircleArrays[vv]=new yo);for(var $p=0;$p=0;--Sa){var Za=Ga[Sa];Ea(xt.symbolInstances.get(Za),xt.collisionArrays[Za])}else for(var ci=G.symbolInstanceStart;ci=0&&(xt>=0&&It!==xt?G.text.placedSymbolArray.get(It).crossTileID=0:G.text.placedSymbolArray.get(It).crossTileID=re.crossTileID)}},Ts.prototype.markUsedOrientation=function(G,xe,re){for(var Le=xe===e.WritingMode.horizontal||xe===e.WritingMode.horizontalOnly?xe:0,et=xe===e.WritingMode.vertical?xe:0,xt=[re.leftJustifiedTextSymbolIndex,re.centerJustifiedTextSymbolIndex,re.rightJustifiedTextSymbolIndex],At=0,lt=xt;At0||xn>0,Ea=$r.numIconVertices>0,Ga=Le.placedOrientations[$r.crossTileID],Sa=Ga===e.WritingMode.vertical,Za=Ga===e.WritingMode.horizontal||Ga===e.WritingMode.horizontalOnly;if(Ta){var ci=mu(aa.text),Ri=Sa?io:ci;pr(G.text,sn,Ri);var Yi=Za?io:ci;pr(G.text,xn,Yi);var ys=aa.text.isHidden();[$r.rightJustifiedTextSymbolIndex,$r.centerJustifiedTextSymbolIndex,$r.leftJustifiedTextSymbolIndex].forEach(function(Rd){Rd>=0&&(G.text.placedSymbolArray.get(Rd).hidden=ys||Sa?1:0)}),$r.verticalPlacedTextSymbolIndex>=0&&(G.text.placedSymbolArray.get($r.verticalPlacedTextSymbolIndex).hidden=ys||Za?1:0);var ds=Le.variableOffsets[$r.crossTileID];ds&&Le.markUsedJustification(G,ds.anchor,$r,Ga);var fl=Le.placedOrientations[$r.crossTileID];fl&&(Le.markUsedJustification(G,"left",$r,fl),Le.markUsedOrientation(G,fl,$r))}if(Ea){var ol=mu(aa.icon),dl=!(Jt&&$r.verticalPlacedIconSymbolIndex&&Sa);if($r.placedIconSymbolIndex>=0){var hl=dl?ol:io;pr(G.icon,$r.numIconVertices,hl),G.icon.placedSymbolArray.get($r.placedIconSymbolIndex).hidden=aa.icon.isHidden()}if($r.verticalPlacedIconSymbolIndex>=0){var Vu=dl?io:ol;pr(G.icon,$r.numVerticalIconVertices,Vu),G.icon.placedSymbolArray.get($r.verticalPlacedIconSymbolIndex).hidden=aa.icon.isHidden()}}if(G.hasIconCollisionBoxData()||G.hasTextCollisionBoxData()){var tl=G.collisionArrays[er];if(tl){var pu=new e.Point(0,0);if(tl.textBox||tl.verticalTextBox){var Mf=!0;if(gt){var Zf=Le.variableOffsets[wa];Zf?(pu=wl(Zf.anchor,Zf.width,Zf.height,Zf.textOffset,Zf.textBoxScale),It&&pu._rotate(ar?Le.transform.angle:-Le.transform.angle)):Mf=!1}tl.textBox&&Ai(G.textCollisionBox.collisionVertexArray,aa.text.placed,!Mf||Sa,pu.x,pu.y),tl.verticalTextBox&&Ai(G.textCollisionBox.collisionVertexArray,aa.text.placed,!Mf||Za,pu.x,pu.y)}var Dd=!!(!Za&&tl.verticalIconBox);tl.iconBox&&Ai(G.iconCollisionBox.collisionVertexArray,aa.icon.placed,Dd,Jt?pu.x:0,Jt?pu.y:0),tl.verticalIconBox&&Ai(G.iconCollisionBox.collisionVertexArray,aa.icon.placed,!Dd,Jt?pu.x:0,Jt?pu.y:0)}}},Wt=0;WtG},Ts.prototype.setStale=function(){this.stale=!0};function Ai(De,G,xe,re,Le){De.emplaceBack(G?1:0,xe?1:0,re||0,Le||0),De.emplaceBack(G?1:0,xe?1:0,re||0,Le||0),De.emplaceBack(G?1:0,xe?1:0,re||0,Le||0),De.emplaceBack(G?1:0,xe?1:0,re||0,Le||0)}var uo=Math.pow(2,25),Tl=Math.pow(2,24),Cs=Math.pow(2,17),Ro=Math.pow(2,16),El=Math.pow(2,9),qs=Math.pow(2,8),al=Math.pow(2,1);function mu(De){if(De.opacity===0&&!De.placed)return 0;if(De.opacity===1&&De.placed)return 4294967295;var G=De.placed?1:0,xe=Math.floor(De.opacity*127);return xe*uo+G*Tl+xe*Cs+G*Ro+xe*El+G*qs+xe*al+G}var io=0,vs=function(G){this._sortAcrossTiles=G.layout.get("symbol-z-order")!=="viewport-y"&&G.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};vs.prototype.continuePlacement=function(G,xe,re,Le,et){for(var xt=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var At=G[this._currentPlacementIndex],lt=xe[At],gt=this.placement.collisionIndex.transform.zoom;if(lt.type==="symbol"&&(!lt.minzoom||lt.minzoom<=gt)&&(!lt.maxzoom||lt.maxzoom>gt)){this._inProgressLayer||(this._inProgressLayer=new vs(lt));var It=this._inProgressLayer.continuePlacement(re[lt.source],this.placement,this._showCollisionBoxes,lt,xt);if(It)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},rs.prototype.commit=function(G){return this.placement.commit(G),this.placement};var Bl=512/e.EXTENT/2,Ul=function(G,xe,re){this.tileID=G,this.indexedSymbolInstances={},this.bucketInstanceId=re;for(var Le=0;LeG.overscaledZ)for(var gt in lt){var It=lt[gt];It.tileID.isChildOf(G)&&It.findMatches(xe.symbolInstances,G,xt)}else{var ar=G.scaledTo(Number(At)),Jt=lt[ar.key];Jt&&Jt.findMatches(xe.symbolInstances,G,xt)}}for(var sr=0;sr0)throw new Error("Unimplemented: "+xt.map(function(At){return At.command}).join(", ")+".");return et.forEach(function(At){At.command!=="setTransition"&&Le[At.command].apply(Le,At.args)}),this.stylesheet=re,!0},G.prototype.addImage=function(re,Le){if(this.getImage(re))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(re,Le),this._afterImageUpdated(re)},G.prototype.updateImage=function(re,Le){this.imageManager.updateImage(re,Le)},G.prototype.getImage=function(re){return this.imageManager.getImage(re)},G.prototype.removeImage=function(re){if(!this.getImage(re))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(re),this._afterImageUpdated(re)},G.prototype._afterImageUpdated=function(re){this._availableImages=this.imageManager.listImages(),this._changedImages[re]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},G.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},G.prototype.addSource=function(re,Le,et){var xt=this;if(et===void 0&&(et={}),this._checkLoaded(),this.sourceCaches[re]!==void 0)throw new Error("There is already a source with this ID");if(!Le.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(Le).join(", ")+".");var At=["vector","raster","geojson","video","image"],lt=At.indexOf(Le.type)>=0;if(!(lt&&this._validate(e.validateStyle.source,"sources."+re,Le,null,et))){this.map&&this.map._collectResourceTiming&&(Le.collectResourceTiming=!0);var gt=this.sourceCaches[re]=new Mn(re,Le,this.dispatcher);gt.style=this,gt.setEventedParent(this,function(){return{isSourceLoaded:xt.loaded(),source:gt.serialize(),sourceId:re}}),gt.onAdd(this.map),this._changed=!0}},G.prototype.removeSource=function(re){if(this._checkLoaded(),this.sourceCaches[re]===void 0)throw new Error("There is no source with this ID");for(var Le in this._layers)if(this._layers[Le].source===re)return this.fire(new e.ErrorEvent(new Error('Source "'+re+'" cannot be removed while layer "'+Le+'" is using it.')));var et=this.sourceCaches[re];delete this.sourceCaches[re],delete this._updatedSources[re],et.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:re})),et.setEventedParent(null),et.clearTiles(),et.onRemove&&et.onRemove(this.map),this._changed=!0},G.prototype.setGeoJSONSourceData=function(re,Le){this._checkLoaded();var et=this.sourceCaches[re].getSource();et.setData(Le),this._changed=!0},G.prototype.getSource=function(re){return this.sourceCaches[re]&&this.sourceCaches[re].getSource()},G.prototype.addLayer=function(re,Le,et){et===void 0&&(et={}),this._checkLoaded();var xt=re.id;if(this.getLayer(xt)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+xt+'" already exists on this map')));return}var At;if(re.type==="custom"){if(Ds(this,e.validateCustomStyleLayer(re)))return;At=e.createStyleLayer(re)}else{if(typeof re.source=="object"&&(this.addSource(xt,re.source),re=e.clone$1(re),re=e.extend(re,{source:xt})),this._validate(e.validateStyle.layer,"layers."+xt,re,{arrayIndex:-1},et))return;At=e.createStyleLayer(re),this._validateLayer(At),At.setEventedParent(this,{layer:{id:xt}}),this._serializedLayers[At.id]=At.serialize()}var lt=Le?this._order.indexOf(Le):this._order.length;if(Le&<===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+Le+'" does not exist on this map.')));return}if(this._order.splice(lt,0,xt),this._layerOrderChanged=!0,this._layers[xt]=At,this._removedLayers[xt]&&At.source&&At.type!=="custom"){var gt=this._removedLayers[xt];delete this._removedLayers[xt],gt.type!==At.type?this._updatedSources[At.source]="clear":(this._updatedSources[At.source]="reload",this.sourceCaches[At.source].pause())}this._updateLayer(At),At.onAdd&&At.onAdd(this.map)},G.prototype.moveLayer=function(re,Le){this._checkLoaded(),this._changed=!0;var et=this._layers[re];if(!et){this.fire(new e.ErrorEvent(new Error("The layer '"+re+"' does not exist in the map's style and cannot be moved.")));return}if(re!==Le){var xt=this._order.indexOf(re);this._order.splice(xt,1);var At=Le?this._order.indexOf(Le):this._order.length;if(Le&&At===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+Le+'" does not exist on this map.')));return}this._order.splice(At,0,re),this._layerOrderChanged=!0}},G.prototype.removeLayer=function(re){this._checkLoaded();var Le=this._layers[re];if(!Le){this.fire(new e.ErrorEvent(new Error("The layer '"+re+"' does not exist in the map's style and cannot be removed.")));return}Le.setEventedParent(null);var et=this._order.indexOf(re);this._order.splice(et,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[re]=Le,delete this._layers[re],delete this._serializedLayers[re],delete this._updatedLayers[re],delete this._updatedPaintProps[re],Le.onRemove&&Le.onRemove(this.map)},G.prototype.getLayer=function(re){return this._layers[re]},G.prototype.hasLayer=function(re){return re in this._layers},G.prototype.setLayerZoomRange=function(re,Le,et){this._checkLoaded();var xt=this.getLayer(re);if(!xt){this.fire(new e.ErrorEvent(new Error("The layer '"+re+"' does not exist in the map's style and cannot have zoom extent.")));return}xt.minzoom===Le&&xt.maxzoom===et||(Le!=null&&(xt.minzoom=Le),et!=null&&(xt.maxzoom=et),this._updateLayer(xt))},G.prototype.setFilter=function(re,Le,et){et===void 0&&(et={}),this._checkLoaded();var xt=this.getLayer(re);if(!xt){this.fire(new e.ErrorEvent(new Error("The layer '"+re+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(xt.filter,Le)){if(Le==null){xt.filter=void 0,this._updateLayer(xt);return}this._validate(e.validateStyle.filter,"layers."+xt.id+".filter",Le,null,et)||(xt.filter=e.clone$1(Le),this._updateLayer(xt))}},G.prototype.getFilter=function(re){return e.clone$1(this.getLayer(re).filter)},G.prototype.setLayoutProperty=function(re,Le,et,xt){xt===void 0&&(xt={}),this._checkLoaded();var At=this.getLayer(re);if(!At){this.fire(new e.ErrorEvent(new Error("The layer '"+re+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual(At.getLayoutProperty(Le),et)||(At.setLayoutProperty(Le,et,xt),this._updateLayer(At))},G.prototype.getLayoutProperty=function(re,Le){var et=this.getLayer(re);if(!et){this.fire(new e.ErrorEvent(new Error("The layer '"+re+"' does not exist in the map's style.")));return}return et.getLayoutProperty(Le)},G.prototype.setPaintProperty=function(re,Le,et,xt){xt===void 0&&(xt={}),this._checkLoaded();var At=this.getLayer(re);if(!At){this.fire(new e.ErrorEvent(new Error("The layer '"+re+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual(At.getPaintProperty(Le),et)){var lt=At.setPaintProperty(Le,et,xt);lt&&this._updateLayer(At),this._changed=!0,this._updatedPaintProps[re]=!0}},G.prototype.getPaintProperty=function(re,Le){return this.getLayer(re).getPaintProperty(Le)},G.prototype.setFeatureState=function(re,Le){this._checkLoaded();var et=re.source,xt=re.sourceLayer,At=this.sourceCaches[et];if(At===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+et+"' does not exist in the map's style.")));return}var lt=At.getSource().type;if(lt==="geojson"&&xt){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(lt==="vector"&&!xt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}re.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),At.setFeatureState(xt,re.id,Le)},G.prototype.removeFeatureState=function(re,Le){this._checkLoaded();var et=re.source,xt=this.sourceCaches[et];if(xt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+et+"' does not exist in the map's style.")));return}var At=xt.getSource().type,lt=At==="vector"?re.sourceLayer:void 0;if(At==="vector"&&!lt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(Le&&typeof re.id!="string"&&typeof re.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}xt.removeFeatureState(lt,re.id,Le)},G.prototype.getFeatureState=function(re){this._checkLoaded();var Le=re.source,et=re.sourceLayer,xt=this.sourceCaches[Le];if(xt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Le+"' does not exist in the map's style.")));return}var At=xt.getSource().type;if(At==="vector"&&!et){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return re.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),xt.getFeatureState(et,re.id)},G.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},G.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(re){return re.serialize()}),layers:this._serializeLayers(this._order)},function(re){return re!==void 0})},G.prototype._updateLayer=function(re){this._updatedLayers[re.id]=!0,re.source&&!this._updatedSources[re.source]&&this.sourceCaches[re.source].getSource().type!=="raster"&&(this._updatedSources[re.source]="reload",this.sourceCaches[re.source].pause()),this._changed=!0},G.prototype._flattenAndSortRenderedFeatures=function(re){for(var Le=this,et=function(Za){return Le._layers[Za].type==="fill-extrusion"},xt={},At=[],lt=this._order.length-1;lt>=0;lt--){var gt=this._order[lt];if(et(gt)){xt[gt]=lt;for(var It=0,ar=re;It=0;er--){var $r=this._order[er];if(et($r))for(var sn=At.length-1;sn>=0;sn--){var xn=At[sn].feature;if(xt[xn.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;}`,Nu=`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 }`,Eh=`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;}`,fh=`#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 }`,Bf="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;}",vf=`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 }`,ih="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;}",oh=`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 }`,zc=` #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);}`,hh=`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 }`,nf=` #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);}`,Gc=`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 }`,Bu=` #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;}`,Af=`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 }`,sh=` #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);}`,Dl=`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 }`,$f="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;}",Oh=`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 }`,dh=`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));}`,Uf=`#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 }`,ph=`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);}`,mc=`#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);}`,du=eu(Mc,Dc),gc=eu(rh,Hf),mf=eu(ml,vc),Wl=eu(nh,Gu),af=eu(zu,Hu),ac=eu(Rc,$l),yc=eu(Fu,Bs),nu=eu(kl,rf),Cf=eu(lc,df),Hc=eu(ru,Rh),gf=eu(Rs,Yh),Wf=eu(ul,Do),zh=eu(kf,Oc),td=eu(Cu,ah),Pf=eu(pf,Nf),Yf=eu(Nu,Eh),Ec=eu(fh,Bf),Xf=eu(vf,ih),$u=eu(oh,zc),Lf=eu(hh,nf),mh=eu(Gc,Bu),Df=eu(Af,sh),Zl=eu(Dl,$f),_c=eu(Oh,dh),Fc=eu(Uf,ph),lh=eu(mc,vh);function eu(De,G){var xe=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,re=G.match(/attribute ([\w]+) ([\w]+)/g),Le=De.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),et=G.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),xt=et?et.concat(Le):Le,At={};return De=De.replace(xe,function(lt,gt,It,ar,Jt){return At[Jt]=!0,gt==="define"?` #ifndef HAS_UNIFORM_u_`+Jt+` varying `+It+" "+ar+" "+Jt+`; #else uniform `+It+" "+ar+" u_"+Jt+`; #endif `:` #ifdef HAS_UNIFORM_u_`+Jt+` `+It+" "+ar+" "+Jt+" = u_"+Jt+`; #endif `}),G=G.replace(xe,function(lt,gt,It,ar,Jt){var sr=ar==="float"?"vec2":"vec4",pr=Jt.match(/color/)?"color":sr;return At[Jt]?gt==="define"?` #ifndef HAS_UNIFORM_u_`+Jt+` uniform lowp float u_`+Jt+`_t; attribute `+It+" "+sr+" a_"+Jt+`; varying `+It+" "+ar+" "+Jt+`; #else uniform `+It+" "+ar+" u_"+Jt+`; #endif `:pr==="vec4"?` #ifndef HAS_UNIFORM_u_`+Jt+` `+Jt+" = a_"+Jt+`; #else `+It+" "+ar+" "+Jt+" = u_"+Jt+`; #endif `:` #ifndef HAS_UNIFORM_u_`+Jt+` `+Jt+" = unpack_mix_"+pr+"(a_"+Jt+", u_"+Jt+`_t); #else `+It+" "+ar+" "+Jt+" = u_"+Jt+`; #endif `:gt==="define"?` #ifndef HAS_UNIFORM_u_`+Jt+` uniform lowp float u_`+Jt+`_t; attribute `+It+" "+sr+" a_"+Jt+`; #else uniform `+It+" "+ar+" u_"+Jt+`; #endif `:pr==="vec4"?` #ifndef HAS_UNIFORM_u_`+Jt+` `+It+" "+ar+" "+Jt+" = a_"+Jt+`; #else `+It+" "+ar+" "+Jt+" = u_"+Jt+`; #endif `:` #ifndef HAS_UNIFORM_u_`+Jt+` `+It+" "+ar+" "+Jt+" = unpack_mix_"+pr+"(a_"+Jt+", u_"+Jt+`_t); #else `+It+" "+ar+" "+Jt+" = u_"+Jt+`; #endif `}),{fragmentSource:De,vertexSource:G,staticAttributes:re,staticUniforms:xt}}var jf=Object.freeze({__proto__:null,prelude:du,background:gc,backgroundPattern:mf,circle:Wl,clippingMask:af,heatmap:ac,heatmapTexture:yc,collisionBox:nu,collisionCircle:Cf,debug:Hc,fill:gf,fillOutline:Wf,fillOutlinePattern:zh,fillPattern:td,fillExtrusion:Pf,fillExtrusionPattern:Yf,hillshadePrepare:Ec,hillshade:Xf,line:$u,lineGradient:Lf,linePattern:mh,lineSDF:Df,raster:Zl,symbolIcon:_c,symbolSDF:Fc,symbolTextAndIcon:lh}),yf=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};yf.prototype.bind=function(G,xe,re,Le,et,xt,At,lt){this.context=G;for(var gt=this.boundPaintVertexBuffers.length!==Le.length,It=0;!gt&&It>16,At>>16],u_pixel_coord_lower:[xt&65535,At&65535]}}function qf(De,G,xe,re){var Le=xe.imageManager.getPattern(De.from.toString()),et=xe.imageManager.getPattern(De.to.toString()),xt=xe.imageManager.getPixelSize(),At=xt.width,lt=xt.height,gt=Math.pow(2,re.tileID.overscaledZ),It=re.tileSize*Math.pow(2,xe.transform.tileZoom)/gt,ar=It*(re.tileID.canonical.x+re.tileID.wrap*gt),Jt=It*re.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Le.tl,u_pattern_br_a:Le.br,u_pattern_tl_b:et.tl,u_pattern_br_b:et.br,u_texsize:[At,lt],u_mix:G.t,u_pattern_size_a:Le.displaySize,u_pattern_size_b:et.displaySize,u_scale_a:G.fromScale,u_scale_b:G.toScale,u_tile_units_to_pixels:1/Ns(re,1,xe.transform.tileZoom),u_pixel_coord_upper:[ar>>16,Jt>>16],u_pixel_coord_lower:[ar&65535,Jt&65535]}}var Fh=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_lightpos:new e.Uniform3f(De,G.u_lightpos),u_lightintensity:new e.Uniform1f(De,G.u_lightintensity),u_lightcolor:new e.Uniform3f(De,G.u_lightcolor),u_vertical_gradient:new e.Uniform1f(De,G.u_vertical_gradient),u_opacity:new e.Uniform1f(De,G.u_opacity)}},Xu=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_lightpos:new e.Uniform3f(De,G.u_lightpos),u_lightintensity:new e.Uniform1f(De,G.u_lightintensity),u_lightcolor:new e.Uniform3f(De,G.u_lightcolor),u_vertical_gradient:new e.Uniform1f(De,G.u_vertical_gradient),u_height_factor:new e.Uniform1f(De,G.u_height_factor),u_image:new e.Uniform1i(De,G.u_image),u_texsize:new e.Uniform2f(De,G.u_texsize),u_pixel_coord_upper:new e.Uniform2f(De,G.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(De,G.u_pixel_coord_lower),u_scale:new e.Uniform3f(De,G.u_scale),u_fade:new e.Uniform1f(De,G.u_fade),u_opacity:new e.Uniform1f(De,G.u_opacity)}},gh=function(De,G,xe,re){var Le=G.style.light,et=Le.properties.get("position"),xt=[et.x,et.y,et.z],At=e.create$1();Le.properties.get("anchor")==="viewport"&&e.fromRotation(At,-G.transform.angle),e.transformMat3(xt,xt,At);var lt=Le.properties.get("color");return{u_matrix:De,u_lightpos:xt,u_lightintensity:Le.properties.get("intensity"),u_lightcolor:[lt.r,lt.g,lt.b],u_vertical_gradient:+xe,u_opacity:re}},Cc=function(De,G,xe,re,Le,et,xt){return e.extend(gh(De,G,xe,re),$c(et,G,xt),{u_height_factor:-Math.pow(2,Le.overscaledZ)/xt.tileSize/8})},of=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix)}},Wc=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_image:new e.Uniform1i(De,G.u_image),u_texsize:new e.Uniform2f(De,G.u_texsize),u_pixel_coord_upper:new e.Uniform2f(De,G.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(De,G.u_pixel_coord_lower),u_scale:new e.Uniform3f(De,G.u_scale),u_fade:new e.Uniform1f(De,G.u_fade)}},gu=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_world:new e.Uniform2f(De,G.u_world)}},uc=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_world:new e.Uniform2f(De,G.u_world),u_image:new e.Uniform1i(De,G.u_image),u_texsize:new e.Uniform2f(De,G.u_texsize),u_pixel_coord_upper:new e.Uniform2f(De,G.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(De,G.u_pixel_coord_lower),u_scale:new e.Uniform3f(De,G.u_scale),u_fade:new e.Uniform1f(De,G.u_fade)}},lu=function(De){return{u_matrix:De}},_f=function(De,G,xe,re){return e.extend(lu(De),$c(xe,G,re))},Yc=function(De,G){return{u_matrix:De,u_world:G}},uh=function(De,G,xe,re,Le){return e.extend(_f(De,G,xe,re),{u_world:Le})},br=function(De,G){return{u_camera_to_center_distance:new e.Uniform1f(De,G.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(De,G.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(De,G.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(De,G.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(De,G.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(De,G.u_matrix)}},qr=function(De,G,xe,re){var Le=De.transform,et,xt;if(re.paint.get("circle-pitch-alignment")==="map"){var At=Ns(xe,1,Le.zoom);et=!0,xt=[At,At]}else et=!1,xt=Le.pixelsToGLUnits;return{u_camera_to_center_distance:Le.cameraToCenterDistance,u_scale_with_map:+(re.paint.get("circle-pitch-scale")==="map"),u_matrix:De.translatePosMatrix(G.posMatrix,xe,re.paint.get("circle-translate"),re.paint.get("circle-translate-anchor")),u_pitch_with_map:+et,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:xt}},An=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_camera_to_center_distance:new e.Uniform1f(De,G.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(De,G.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(De,G.u_extrude_scale),u_overscale_factor:new e.Uniform1f(De,G.u_overscale_factor)}},vn=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_inv_matrix:new e.UniformMatrix4f(De,G.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(De,G.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(De,G.u_viewport_size)}},Xn=function(De,G,xe){var re=Ns(xe,1,G.zoom),Le=Math.pow(2,G.zoom-xe.tileID.overscaledZ),et=xe.tileID.overscaleFactor();return{u_matrix:De,u_camera_to_center_distance:G.cameraToCenterDistance,u_pixels_to_tile_units:re,u_extrude_scale:[G.pixelsToGLUnits[0]/(re*Le),G.pixelsToGLUnits[1]/(re*Le)],u_overscale_factor:et}},Na=function(De,G,xe){return{u_matrix:De,u_inv_matrix:G,u_camera_to_center_distance:xe.cameraToCenterDistance,u_viewport_size:[xe.width,xe.height]}},Ra=function(De,G){return{u_color:new e.UniformColor(De,G.u_color),u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_overlay:new e.Uniform1i(De,G.u_overlay),u_overlay_scale:new e.Uniform1f(De,G.u_overlay_scale)}},pi=function(De,G,xe){return xe===void 0&&(xe=1),{u_matrix:De,u_color:G,u_overlay:0,u_overlay_scale:xe}},xi=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix)}},$i=function(De){return{u_matrix:De}},ni=function(De,G){return{u_extrude_scale:new e.Uniform1f(De,G.u_extrude_scale),u_intensity:new e.Uniform1f(De,G.u_intensity),u_matrix:new e.UniformMatrix4f(De,G.u_matrix)}},Ii=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_world:new e.Uniform2f(De,G.u_world),u_image:new e.Uniform1i(De,G.u_image),u_color_ramp:new e.Uniform1i(De,G.u_color_ramp),u_opacity:new e.Uniform1f(De,G.u_opacity)}},hi=function(De,G,xe,re){return{u_matrix:De,u_extrude_scale:Ns(G,1,xe),u_intensity:re}},Ja=function(De,G,xe,re){var Le=e.create();e.ortho(Le,0,De.width,De.height,0,0,1);var et=De.context.gl;return{u_matrix:Le,u_world:[et.drawingBufferWidth,et.drawingBufferHeight],u_image:xe,u_color_ramp:re,u_opacity:G.paint.get("heatmap-opacity")}},eo=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_image:new e.Uniform1i(De,G.u_image),u_latrange:new e.Uniform2f(De,G.u_latrange),u_light:new e.Uniform2f(De,G.u_light),u_shadow:new e.UniformColor(De,G.u_shadow),u_highlight:new e.UniformColor(De,G.u_highlight),u_accent:new e.UniformColor(De,G.u_accent)}},zo=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_image:new e.Uniform1i(De,G.u_image),u_dimension:new e.Uniform2f(De,G.u_dimension),u_zoom:new e.Uniform1f(De,G.u_zoom),u_unpack:new e.Uniform4f(De,G.u_unpack)}},Io=function(De,G,xe){var re=xe.paint.get("hillshade-shadow-color"),Le=xe.paint.get("hillshade-highlight-color"),et=xe.paint.get("hillshade-accent-color"),xt=xe.paint.get("hillshade-illumination-direction")*(Math.PI/180);xe.paint.get("hillshade-illumination-anchor")==="viewport"&&(xt-=De.transform.angle);var At=!De.options.moving;return{u_matrix:De.transform.calculatePosMatrix(G.tileID.toUnwrapped(),At),u_image:0,u_latrange:Bo(De,G.tileID),u_light:[xe.paint.get("hillshade-exaggeration"),xt],u_shadow:re,u_highlight:Le,u_accent:et}},Vo=function(De,G){var xe=G.stride,re=e.create();return e.ortho(re,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(re,re,[0,-e.EXTENT,0]),{u_matrix:re,u_image:1,u_dimension:[xe,xe],u_zoom:De.overscaledZ,u_unpack:G.getUnpackVector()}};function Bo(De,G){var xe=Math.pow(2,G.canonical.z),re=G.canonical.y;return[new e.MercatorCoordinate(0,re/xe).toLngLat().lat,new e.MercatorCoordinate(0,(re+1)/xe).toLngLat().lat]}var ro=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_ratio:new e.Uniform1f(De,G.u_ratio),u_device_pixel_ratio:new e.Uniform1f(De,G.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(De,G.u_units_to_pixels)}},Ni=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_ratio:new e.Uniform1f(De,G.u_ratio),u_device_pixel_ratio:new e.Uniform1f(De,G.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(De,G.u_units_to_pixels),u_image:new e.Uniform1i(De,G.u_image),u_image_height:new e.Uniform1f(De,G.u_image_height)}},ns=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_texsize:new e.Uniform2f(De,G.u_texsize),u_ratio:new e.Uniform1f(De,G.u_ratio),u_device_pixel_ratio:new e.Uniform1f(De,G.u_device_pixel_ratio),u_image:new e.Uniform1i(De,G.u_image),u_units_to_pixels:new e.Uniform2f(De,G.u_units_to_pixels),u_scale:new e.Uniform3f(De,G.u_scale),u_fade:new e.Uniform1f(De,G.u_fade)}},Os=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_ratio:new e.Uniform1f(De,G.u_ratio),u_device_pixel_ratio:new e.Uniform1f(De,G.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(De,G.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(De,G.u_patternscale_a),u_patternscale_b:new e.Uniform2f(De,G.u_patternscale_b),u_sdfgamma:new e.Uniform1f(De,G.u_sdfgamma),u_image:new e.Uniform1i(De,G.u_image),u_tex_y_a:new e.Uniform1f(De,G.u_tex_y_a),u_tex_y_b:new e.Uniform1f(De,G.u_tex_y_b),u_mix:new e.Uniform1f(De,G.u_mix)}},yl=function(De,G,xe){var re=De.transform;return{u_matrix:xu(De,G,xe),u_ratio:1/Ns(G,1,re.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/re.pixelsToGLUnits[0],1/re.pixelsToGLUnits[1]]}},jl=function(De,G,xe,re){return e.extend(yl(De,G,xe),{u_image:0,u_image_height:re})},_l=function(De,G,xe,re){var Le=De.transform,et=Ks(G,Le);return{u_matrix:xu(De,G,xe),u_texsize:G.imageAtlasTexture.size,u_ratio:1/Ns(G,1,Le.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[et,re.fromScale,re.toScale],u_fade:re.t,u_units_to_pixels:[1/Le.pixelsToGLUnits[0],1/Le.pixelsToGLUnits[1]]}},Vl=function(De,G,xe,re,Le){var et=De.transform,xt=De.lineAtlas,At=Ks(G,et),lt=xe.layout.get("line-cap")==="round",gt=xt.getDash(re.from,lt),It=xt.getDash(re.to,lt),ar=gt.width*Le.fromScale,Jt=It.width*Le.toScale;return e.extend(yl(De,G,xe),{u_patternscale_a:[At/ar,-gt.height/2],u_patternscale_b:[At/Jt,-It.height/2],u_sdfgamma:xt.width/(Math.min(ar,Jt)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:gt.y,u_tex_y_b:It.y,u_mix:Le.t})};function Ks(De,G){return 1/Ns(De,1,G.tileZoom)}function xu(De,G,xe){return De.translatePosMatrix(G.tileID.posMatrix,G,xe.paint.get("line-translate"),xe.paint.get("line-translate-anchor"))}var yu=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_tl_parent:new e.Uniform2f(De,G.u_tl_parent),u_scale_parent:new e.Uniform1f(De,G.u_scale_parent),u_buffer_scale:new e.Uniform1f(De,G.u_buffer_scale),u_fade_t:new e.Uniform1f(De,G.u_fade_t),u_opacity:new e.Uniform1f(De,G.u_opacity),u_image0:new e.Uniform1i(De,G.u_image0),u_image1:new e.Uniform1i(De,G.u_image1),u_brightness_low:new e.Uniform1f(De,G.u_brightness_low),u_brightness_high:new e.Uniform1f(De,G.u_brightness_high),u_saturation_factor:new e.Uniform1f(De,G.u_saturation_factor),u_contrast_factor:new e.Uniform1f(De,G.u_contrast_factor),u_spin_weights:new e.Uniform3f(De,G.u_spin_weights)}},Fl=function(De,G,xe,re,Le){return{u_matrix:De,u_tl_parent:G,u_scale_parent:xe,u_buffer_scale:1,u_fade_t:re.mix,u_opacity:re.opacity*Le.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Le.paint.get("raster-brightness-min"),u_brightness_high:Le.paint.get("raster-brightness-max"),u_saturation_factor:Cl(Le.paint.get("raster-saturation")),u_contrast_factor:ms(Le.paint.get("raster-contrast")),u_spin_weights:bo(Le.paint.get("raster-hue-rotate"))}};function bo(De){De*=Math.PI/180;var G=Math.sin(De),xe=Math.cos(De);return[(2*xe+1)/3,(-Math.sqrt(3)*G-xe+1)/3,(Math.sqrt(3)*G-xe+1)/3]}function ms(De){return De>0?1/(1-De):1+De}function Cl(De){return De>0?1-1/(1.001-De):-De}var cl=function(De,G){return{u_is_size_zoom_constant:new e.Uniform1i(De,G.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(De,G.u_is_size_feature_constant),u_size_t:new e.Uniform1f(De,G.u_size_t),u_size:new e.Uniform1f(De,G.u_size),u_camera_to_center_distance:new e.Uniform1f(De,G.u_camera_to_center_distance),u_pitch:new e.Uniform1f(De,G.u_pitch),u_rotate_symbol:new e.Uniform1i(De,G.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(De,G.u_aspect_ratio),u_fade_change:new e.Uniform1f(De,G.u_fade_change),u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(De,G.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(De,G.u_coord_matrix),u_is_text:new e.Uniform1i(De,G.u_is_text),u_pitch_with_map:new e.Uniform1i(De,G.u_pitch_with_map),u_texsize:new e.Uniform2f(De,G.u_texsize),u_texture:new e.Uniform1i(De,G.u_texture)}},ic=function(De,G){return{u_is_size_zoom_constant:new e.Uniform1i(De,G.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(De,G.u_is_size_feature_constant),u_size_t:new e.Uniform1f(De,G.u_size_t),u_size:new e.Uniform1f(De,G.u_size),u_camera_to_center_distance:new e.Uniform1f(De,G.u_camera_to_center_distance),u_pitch:new e.Uniform1f(De,G.u_pitch),u_rotate_symbol:new e.Uniform1i(De,G.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(De,G.u_aspect_ratio),u_fade_change:new e.Uniform1f(De,G.u_fade_change),u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(De,G.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(De,G.u_coord_matrix),u_is_text:new e.Uniform1i(De,G.u_is_text),u_pitch_with_map:new e.Uniform1i(De,G.u_pitch_with_map),u_texsize:new e.Uniform2f(De,G.u_texsize),u_texture:new e.Uniform1i(De,G.u_texture),u_gamma_scale:new e.Uniform1f(De,G.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(De,G.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(De,G.u_is_halo)}},oc=function(De,G){return{u_is_size_zoom_constant:new e.Uniform1i(De,G.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(De,G.u_is_size_feature_constant),u_size_t:new e.Uniform1f(De,G.u_size_t),u_size:new e.Uniform1f(De,G.u_size),u_camera_to_center_distance:new e.Uniform1f(De,G.u_camera_to_center_distance),u_pitch:new e.Uniform1f(De,G.u_pitch),u_rotate_symbol:new e.Uniform1i(De,G.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(De,G.u_aspect_ratio),u_fade_change:new e.Uniform1f(De,G.u_fade_change),u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(De,G.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(De,G.u_coord_matrix),u_is_text:new e.Uniform1i(De,G.u_is_text),u_pitch_with_map:new e.Uniform1i(De,G.u_pitch_with_map),u_texsize:new e.Uniform2f(De,G.u_texsize),u_texsize_icon:new e.Uniform2f(De,G.u_texsize_icon),u_texture:new e.Uniform1i(De,G.u_texture),u_texture_icon:new e.Uniform1i(De,G.u_texture_icon),u_gamma_scale:new e.Uniform1f(De,G.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(De,G.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(De,G.u_is_halo)}},cc=function(De,G,xe,re,Le,et,xt,At,lt,gt){var It=Le.transform;return{u_is_size_zoom_constant:+(De==="constant"||De==="source"),u_is_size_feature_constant:+(De==="constant"||De==="camera"),u_size_t:G?G.uSizeT:0,u_size:G?G.uSize:0,u_camera_to_center_distance:It.cameraToCenterDistance,u_pitch:It.pitch/360*2*Math.PI,u_rotate_symbol:+xe,u_aspect_ratio:It.width/It.height,u_fade_change:Le.options.fadeDuration?Le.symbolFadeChange:1,u_matrix:et,u_label_plane_matrix:xt,u_coord_matrix:At,u_is_text:+lt,u_pitch_with_map:+re,u_texsize:gt,u_texture:0}},Sf=function(De,G,xe,re,Le,et,xt,At,lt,gt,It){var ar=Le.transform;return e.extend(cc(De,G,xe,re,Le,et,xt,At,lt,gt),{u_gamma_scale:re?Math.cos(ar._pitch)*ar.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:1})},sc=function(De,G,xe,re,Le,et,xt,At,lt,gt){return e.extend(Sf(De,G,xe,re,Le,et,xt,At,!0,lt),{u_texsize_icon:gt,u_texture_icon:1})},sf=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_opacity:new e.Uniform1f(De,G.u_opacity),u_color:new e.UniformColor(De,G.u_color)}},wu=function(De,G){return{u_matrix:new e.UniformMatrix4f(De,G.u_matrix),u_opacity:new e.Uniform1f(De,G.u_opacity),u_image:new e.Uniform1i(De,G.u_image),u_pattern_tl_a:new e.Uniform2f(De,G.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(De,G.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(De,G.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(De,G.u_pattern_br_b),u_texsize:new e.Uniform2f(De,G.u_texsize),u_mix:new e.Uniform1f(De,G.u_mix),u_pattern_size_a:new e.Uniform2f(De,G.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(De,G.u_pattern_size_b),u_scale_a:new e.Uniform1f(De,G.u_scale_a),u_scale_b:new e.Uniform1f(De,G.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(De,G.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(De,G.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(De,G.u_tile_units_to_pixels)}},lf=function(De,G,xe){return{u_matrix:De,u_opacity:G,u_color:xe}},qo=function(De,G,xe,re,Le,et){return e.extend(qf(re,et,xe,Le),{u_matrix:De,u_opacity:G})},as={fillExtrusion:Fh,fillExtrusionPattern:Xu,fill:of,fillPattern:Wc,fillOutline:gu,fillOutlinePattern:uc,circle:br,collisionBox:An,collisionCircle:vn,debug:Ra,clippingMask:xi,heatmap:ni,heatmapTexture:Ii,hillshade:eo,hillshadePrepare:zo,line:ro,lineGradient:Ni,linePattern:ns,lineSDF:Os,raster:yu,symbolIcon:cl,symbolSDF:ic,symbolTextAndIcon:oc,background:sf,backgroundPattern:wu},uf;function Pc(De,G,xe,re,Le,et,xt){for(var At=De.context,lt=At.gl,gt=De.useProgram("collisionBox"),It=[],ar=0,Jt=0,sr=0;sr0){var sn=e.create(),xn=rr;e.mul(sn,Wt.placementInvProjMatrix,De.transform.glCoordMatrix),e.mul(sn,sn,Wt.placementViewportMatrix),It.push({circleArray:$r,circleOffset:Jt,transform:xn,invTransform:sn}),ar+=$r.length/4,Jt=ar}er&>.draw(At,lt.LINES,ta.disabled,Jn.disabled,De.colorModeForRenderPass(),rn.disabled,Xn(rr,De.transform,fr),xe.id,er.layoutVertexBuffer,er.indexBuffer,er.segments,null,De.transform.zoom,null,null,er.collisionVertexBuffer)}}if(!(!xt||!It.length)){var wa=De.useProgram("collisionCircle"),la=new e.StructArrayLayout2f1f2i16;la.resize(ar*4),la._trim();for(var aa=0,Ta=0,Ea=It;Ta=0&&(pr[Wt.associatedIconIndex]={shiftedAnchor:Za,angle:ci})}}if(It){sr.clear();for(var Yi=De.icon.placedSymbolArray,ys=0;ys0){var xt=e.browser.now(),At=(xt-De.timeAdded)/et,lt=G?(xt-G.timeAdded)/et:-1,gt=xe.getSource(),It=Le.coveringZoomLevel({tileSize:gt.tileSize,roundZoom:gt.roundZoom}),ar=!G||Math.abs(G.tileID.overscaledZ-It)>Math.abs(De.tileID.overscaledZ-It),Jt=ar&&De.refreshedUponExpiration?1:e.clamp(ar?At:1-lt,0,1);return De.refreshedUponExpiration&&At>=1&&(De.refreshedUponExpiration=!1),G?{opacity:1,mix:1-Jt}:{opacity:Jt,mix:0}}else return{opacity:1,mix:0}}function Vr(De,G,xe){var re=xe.paint.get("background-color"),Le=xe.paint.get("background-opacity");if(Le!==0){var et=De.context,xt=et.gl,At=De.transform,lt=At.tileSize,gt=xe.paint.get("background-pattern");if(!De.isPatternMissing(gt)){var It=!gt&&re.a===1&&Le===1&&De.opaquePassEnabledForLayer()?"opaque":"translucent";if(De.renderPass===It){var ar=Jn.disabled,Jt=De.depthModeForSublayer(0,It==="opaque"?ta.ReadWrite:ta.ReadOnly),sr=De.colorModeForRenderPass(),pr=De.useProgram(gt?"backgroundPattern":"background"),fr=At.coveringTiles({tileSize:lt});gt&&(et.activeTexture.set(xt.TEXTURE0),De.imageManager.bind(De.context));for(var Wt=xe.getCrossfadeParameters(),rr=0,er=fr;rr "+xe.overscaledZ);var rr=Wt+" "+sr+"kb";Wo(De,rr),xt.draw(re,Le.TRIANGLES,At,lt,Kt.alphaBlended,rn.disabled,pi(et,e.Color.transparent,fr),It,De.debugBuffer,De.quadTriangleIndexBuffer,De.debugSegments)}function Wo(De,G){De.initDebugOverlayCanvas();var xe=De.debugOverlayCanvas,re=De.context.gl,Le=De.debugOverlayCanvas.getContext("2d");Le.clearRect(0,0,xe.width,xe.height),Le.shadowColor="white",Le.shadowBlur=2,Le.lineWidth=1.5,Le.strokeStyle="white",Le.textBaseline="top",Le.font="bold 36px Open Sans, sans-serif",Le.fillText(G,5,5),Le.strokeText(G,5,5),De.debugOverlayTexture.update(xe),De.debugOverlayTexture.bind(re.LINEAR,re.CLAMP_TO_EDGE)}function $s(De,G,xe){var re=De.context,Le=xe.implementation;if(De.renderPass==="offscreen"){var et=Le.prerender;et&&(De.setCustomLayerDefaults(),re.setColorMode(De.colorModeForRenderPass()),et.call(Le,re.gl,De.transform.customLayerMatrix()),re.setDirty(),De.setBaseState())}else if(De.renderPass==="translucent"){De.setCustomLayerDefaults(),re.setColorMode(De.colorModeForRenderPass()),re.setStencilMode(Jn.disabled);var xt=Le.renderingMode==="3d"?new ta(De.context.gl.LEQUAL,ta.ReadWrite,De.depthRangeFor3D):De.depthModeForSublayer(0,ta.ReadOnly);re.setDepthMode(xt),Le.render(re.gl,De.transform.customLayerMatrix()),re.setDirty(),De.setBaseState(),re.bindFramebuffer.set(null)}}var Ws={symbol:I,circle:tr,heatmap:xr,line:Cn,fill:ot,"fill-extrusion":Tt,hillshade:qt,raster:Mr,background:Vr,debug:To,custom:$s},As=function(G,xe){this.context=new gn(G),this.transform=xe,this._tileTextures={},this.setup(),this.numSublayers=Mn.maxUnderzooming+Mn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new su,this.gpuTimers={}};As.prototype.resize=function(G,xe){if(this.width=G*e.browser.devicePixelRatio,this.height=xe*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var re=0,Le=this.style._order;re256&&this.clearStencil(),re.setColorMode(Kt.disabled),re.setDepthMode(ta.disabled);var et=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var xt=0,At=xe;xt256&&this.clearStencil();var G=this.nextStencilID++,xe=this.context.gl;return new Jn({func:xe.NOTEQUAL,mask:255},G,255,xe.KEEP,xe.KEEP,xe.REPLACE)},As.prototype.stencilModeForClipping=function(G){var xe=this.context.gl;return new Jn({func:xe.EQUAL,mask:255},this._tileClippingMaskIDs[G.key],0,xe.KEEP,xe.KEEP,xe.REPLACE)},As.prototype.stencilConfigForOverlap=function(G){var xe,re=this.context.gl,Le=G.sort(function(gt,It){return It.overscaledZ-gt.overscaledZ}),et=Le[Le.length-1].overscaledZ,xt=Le[0].overscaledZ-et+1;if(xt>1){this.currentStencilSource=void 0,this.nextStencilID+xt>256&&this.clearStencil();for(var At={},lt=0;lt=0;this.currentLayer--){var sn=this.style._layers[Le[this.currentLayer]],xn=et[sn.source],wa=lt[sn.source];this._renderTileClippingMasks(sn,wa),this.renderLayer(this,xn,sn,wa)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?xe.pop():null},As.prototype.isPatternMissing=function(G){if(!G)return!1;if(!G.from||!G.to)return!0;var xe=this.imageManager.getPattern(G.from.toString()),re=this.imageManager.getPattern(G.to.toString());return!xe||!re},As.prototype.useProgram=function(G,xe){this.cache=this.cache||{};var re=""+G+(xe?xe.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[re]||(this.cache[re]=new Vf(this.context,G,jf[G],xe,as[G],this._showOverdrawInspector)),this.cache[re]},As.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()},As.prototype.setBaseState=function(){var G=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(G.FUNC_ADD)},As.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var G=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,G.RGBA)}},As.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Qs=function(G,xe){this.points=G,this.planes=xe};Qs.fromInvProjectionMatrix=function(G,xe,re){var Le=[[-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]],et=Math.pow(2,re),xt=Le.map(function(gt){return e.transformMat4([],gt,G)}).map(function(gt){return e.scale$1([],gt,1/gt[3]/xe*et)}),At=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],lt=At.map(function(gt){var It=e.sub([],xt[gt[0]],xt[gt[1]]),ar=e.sub([],xt[gt[2]],xt[gt[1]]),Jt=e.normalize([],e.cross([],It,ar)),sr=-e.dot(Jt,xt[gt[1]]);return Jt.concat(sr)});return new Qs(xt,lt)};var uu=function(G,xe){this.min=G,this.max=xe,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};uu.prototype.quadrant=function(G){for(var xe=[G%2===0,G<2],re=e.clone$2(this.min),Le=e.clone$2(this.max),et=0;et=0;if(xt===0)return 0;xt!==xe.length&&(re=!1)}if(re)return 2;for(var lt=0;lt<3;lt++){for(var gt=Number.MAX_VALUE,It=-Number.MAX_VALUE,ar=0;arthis.max[lt]-this.min[lt])return 0}return 1};var Kl=function(G,xe,re,Le){if(G===void 0&&(G=0),xe===void 0&&(xe=0),re===void 0&&(re=0),Le===void 0&&(Le=0),isNaN(G)||G<0||isNaN(xe)||xe<0||isNaN(re)||re<0||isNaN(Le)||Le<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=G,this.bottom=xe,this.left=re,this.right=Le};Kl.prototype.interpolate=function(G,xe,re){return xe.top!=null&&G.top!=null&&(this.top=e.number(G.top,xe.top,re)),xe.bottom!=null&&G.bottom!=null&&(this.bottom=e.number(G.bottom,xe.bottom,re)),xe.left!=null&&G.left!=null&&(this.left=e.number(G.left,xe.left,re)),xe.right!=null&&G.right!=null&&(this.right=e.number(G.right,xe.right,re)),this},Kl.prototype.getCenter=function(G,xe){var re=e.clamp((this.left+G-this.right)/2,0,G),Le=e.clamp((this.top+xe-this.bottom)/2,0,xe);return new e.Point(re,Le)},Kl.prototype.equals=function(G){return this.top===G.top&&this.bottom===G.bottom&&this.left===G.left&&this.right===G.right},Kl.prototype.clone=function(){return new Kl(this.top,this.bottom,this.left,this.right)},Kl.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Ms=function(G,xe,re,Le,et){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=et===void 0?!0:et,this._minZoom=G||0,this._maxZoom=xe||22,this._minPitch=re??0,this._maxPitch=Le??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 Kl,this._posMatrixCache={},this._alignedPosMatrixCache={}},Es={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}};Ms.prototype.clone=function(){var G=new Ms(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return G.tileSize=this.tileSize,G.latRange=this.latRange,G.width=this.width,G.height=this.height,G._center=this._center,G.zoom=this.zoom,G.angle=this.angle,G._fov=this._fov,G._pitch=this._pitch,G._unmodified=this._unmodified,G._edgeInsets=this._edgeInsets.clone(),G._calcMatrices(),G},Es.minZoom.get=function(){return this._minZoom},Es.minZoom.set=function(De){this._minZoom!==De&&(this._minZoom=De,this.zoom=Math.max(this.zoom,De))},Es.maxZoom.get=function(){return this._maxZoom},Es.maxZoom.set=function(De){this._maxZoom!==De&&(this._maxZoom=De,this.zoom=Math.min(this.zoom,De))},Es.minPitch.get=function(){return this._minPitch},Es.minPitch.set=function(De){this._minPitch!==De&&(this._minPitch=De,this.pitch=Math.max(this.pitch,De))},Es.maxPitch.get=function(){return this._maxPitch},Es.maxPitch.set=function(De){this._maxPitch!==De&&(this._maxPitch=De,this.pitch=Math.min(this.pitch,De))},Es.renderWorldCopies.get=function(){return this._renderWorldCopies},Es.renderWorldCopies.set=function(De){De===void 0?De=!0:De===null&&(De=!1),this._renderWorldCopies=De},Es.worldSize.get=function(){return this.tileSize*this.scale},Es.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Es.size.get=function(){return new e.Point(this.width,this.height)},Es.bearing.get=function(){return-this.angle/Math.PI*180},Es.bearing.set=function(De){var G=-e.wrap(De,-180,180)*Math.PI/180;this.angle!==G&&(this._unmodified=!1,this.angle=G,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Es.pitch.get=function(){return this._pitch/Math.PI*180},Es.pitch.set=function(De){var G=e.clamp(De,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==G&&(this._unmodified=!1,this._pitch=G,this._calcMatrices())},Es.fov.get=function(){return this._fov/Math.PI*180},Es.fov.set=function(De){De=Math.max(.01,Math.min(60,De)),this._fov!==De&&(this._unmodified=!1,this._fov=De/180*Math.PI,this._calcMatrices())},Es.zoom.get=function(){return this._zoom},Es.zoom.set=function(De){var G=Math.min(Math.max(De,this.minZoom),this.maxZoom);this._zoom!==G&&(this._unmodified=!1,this._zoom=G,this.scale=this.zoomScale(G),this.tileZoom=Math.floor(G),this.zoomFraction=G-this.tileZoom,this._constrain(),this._calcMatrices())},Es.center.get=function(){return this._center},Es.center.set=function(De){De.lat===this._center.lat&&De.lng===this._center.lng||(this._unmodified=!1,this._center=De,this._constrain(),this._calcMatrices())},Es.padding.get=function(){return this._edgeInsets.toJSON()},Es.padding.set=function(De){this._edgeInsets.equals(De)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,De,1),this._calcMatrices())},Es.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Ms.prototype.isPaddingEqual=function(G){return this._edgeInsets.equals(G)},Ms.prototype.interpolatePadding=function(G,xe,re){this._unmodified=!1,this._edgeInsets.interpolate(G,xe,re),this._constrain(),this._calcMatrices()},Ms.prototype.coveringZoomLevel=function(G){var xe=(G.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/G.tileSize));return Math.max(0,xe)},Ms.prototype.getVisibleUnwrappedCoordinates=function(G){var xe=[new e.UnwrappedTileID(0,G)];if(this._renderWorldCopies)for(var re=this.pointCoordinate(new e.Point(0,0)),Le=this.pointCoordinate(new e.Point(this.width,0)),et=this.pointCoordinate(new e.Point(this.width,this.height)),xt=this.pointCoordinate(new e.Point(0,this.height)),At=Math.floor(Math.min(re.x,Le.x,et.x,xt.x)),lt=Math.floor(Math.max(re.x,Le.x,et.x,xt.x)),gt=1,It=At-gt;It<=lt+gt;It++)It!==0&&xe.push(new e.UnwrappedTileID(It,G));return xe},Ms.prototype.coveringTiles=function(G){var xe=this.coveringZoomLevel(G),re=xe;if(G.minzoom!==void 0&&xeG.maxzoom&&(xe=G.maxzoom);var Le=e.MercatorCoordinate.fromLngLat(this.center),et=Math.pow(2,xe),xt=[et*Le.x,et*Le.y,0],At=Qs.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,xe),lt=G.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(lt=xe);var gt=3,It=function(Sa){return{aabb:new uu([Sa*et,0,0],[(Sa+1)*et,et,0]),zoom:0,x:0,y:0,wrap:Sa,fullyVisible:!1}},ar=[],Jt=[],sr=xe,pr=G.reparseOverscaled?re:xe;if(this._renderWorldCopies)for(var fr=1;fr<=3;fr++)ar.push(It(-fr)),ar.push(It(fr));for(ar.push(It(0));ar.length>0;){var Wt=ar.pop(),rr=Wt.x,er=Wt.y,$r=Wt.fullyVisible;if(!$r){var sn=Wt.aabb.intersects(At);if(sn===0)continue;$r=sn===2}var xn=Wt.aabb.distanceX(xt),wa=Wt.aabb.distanceY(xt),la=Math.max(Math.abs(xn),Math.abs(wa)),aa=gt+(1<aa&&Wt.zoom>=lt){Jt.push({tileID:new e.OverscaledTileID(Wt.zoom===sr?pr:Wt.zoom,Wt.wrap,Wt.zoom,rr,er),distanceSq:e.sqrLen([xt[0]-.5-rr,xt[1]-.5-er])});continue}for(var Ta=0;Ta<4;Ta++){var Ea=(rr<<1)+Ta%2,Ga=(er<<1)+(Ta>>1);ar.push({aabb:Wt.aabb.quadrant(Ta),zoom:Wt.zoom+1,x:Ea,y:Ga,wrap:Wt.wrap,fullyVisible:$r})}}return Jt.sort(function(Sa,Za){return Sa.distanceSq-Za.distanceSq}).map(function(Sa){return Sa.tileID})},Ms.prototype.resize=function(G,xe){this.width=G,this.height=xe,this.pixelsToGLUnits=[2/G,-2/xe],this._constrain(),this._calcMatrices()},Es.unmodified.get=function(){return this._unmodified},Ms.prototype.zoomScale=function(G){return Math.pow(2,G)},Ms.prototype.scaleZoom=function(G){return Math.log(G)/Math.LN2},Ms.prototype.project=function(G){var xe=e.clamp(G.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(G.lng)*this.worldSize,e.mercatorYfromLat(xe)*this.worldSize)},Ms.prototype.unproject=function(G){return new e.MercatorCoordinate(G.x/this.worldSize,G.y/this.worldSize).toLngLat()},Es.point.get=function(){return this.project(this.center)},Ms.prototype.setLocationAtPoint=function(G,xe){var re=this.pointCoordinate(xe),Le=this.pointCoordinate(this.centerPoint),et=this.locationCoordinate(G),xt=new e.MercatorCoordinate(et.x-(re.x-Le.x),et.y-(re.y-Le.y));this.center=this.coordinateLocation(xt),this._renderWorldCopies&&(this.center=this.center.wrap())},Ms.prototype.locationPoint=function(G){return this.coordinatePoint(this.locationCoordinate(G))},Ms.prototype.pointLocation=function(G){return this.coordinateLocation(this.pointCoordinate(G))},Ms.prototype.locationCoordinate=function(G){return e.MercatorCoordinate.fromLngLat(G)},Ms.prototype.coordinateLocation=function(G){return G.toLngLat()},Ms.prototype.pointCoordinate=function(G){var xe=0,re=[G.x,G.y,0,1],Le=[G.x,G.y,1,1];e.transformMat4(re,re,this.pixelMatrixInverse),e.transformMat4(Le,Le,this.pixelMatrixInverse);var et=re[3],xt=Le[3],At=re[0]/et,lt=Le[0]/xt,gt=re[1]/et,It=Le[1]/xt,ar=re[2]/et,Jt=Le[2]/xt,sr=ar===Jt?0:(xe-ar)/(Jt-ar);return new e.MercatorCoordinate(e.number(At,lt,sr)/this.worldSize,e.number(gt,It,sr)/this.worldSize)},Ms.prototype.coordinatePoint=function(G){var xe=[G.x*this.worldSize,G.y*this.worldSize,0,1];return e.transformMat4(xe,xe,this.pixelMatrix),new e.Point(xe[0]/xe[3],xe[1]/xe[3])},Ms.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)))},Ms.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]])},Ms.prototype.setMaxBounds=function(G){G?(this.lngRange=[G.getWest(),G.getEast()],this.latRange=[G.getSouth(),G.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Ms.prototype.calculatePosMatrix=function(G,xe){xe===void 0&&(xe=!1);var re=G.key,Le=xe?this._alignedPosMatrixCache:this._posMatrixCache;if(Le[re])return Le[re];var et=G.canonical,xt=this.worldSize/this.zoomScale(et.z),At=et.x+Math.pow(2,et.z)*G.wrap,lt=e.identity(new Float64Array(16));return e.translate(lt,lt,[At*xt,et.y*xt,0]),e.scale(lt,lt,[xt/e.EXTENT,xt/e.EXTENT,1]),e.multiply(lt,xe?this.alignedProjMatrix:this.projMatrix,lt),Le[re]=new Float32Array(lt),Le[re]},Ms.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Ms.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var G=-90,xe=90,re=-180,Le=180,et,xt,At,lt,gt=this.size,It=this._unmodified;if(this.latRange){var ar=this.latRange;G=e.mercatorYfromLat(ar[1])*this.worldSize,xe=e.mercatorYfromLat(ar[0])*this.worldSize,et=xe-Gxe&&(lt=xe-Wt)}if(this.lngRange){var rr=sr.x,er=gt.x/2;rr-erLe&&(At=Le-er)}(At!==void 0||lt!==void 0)&&(this.center=this.unproject(new e.Point(At!==void 0?At:sr.x,lt!==void 0?lt:sr.y))),this._unmodified=It,this._constraining=!1}},Ms.prototype._calcMatrices=function(){if(this.height){var G=this._fov/2,xe=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(G)*this.height;var re=Math.PI/2+this._pitch,Le=this._fov*(.5+xe.y/this.height),et=Math.sin(Le)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-re-Le,.01,Math.PI-.01)),xt=this.point,At=xt.x,lt=xt.y,gt=Math.cos(Math.PI/2-this._pitch)*et+this.cameraToCenterDistance,It=gt*1.01,ar=this.height/50,Jt=new Float64Array(16);e.perspective(Jt,this._fov,this.width/this.height,ar,It),Jt[8]=-xe.x*2/this.width,Jt[9]=xe.y*2/this.height,e.scale(Jt,Jt,[1,-1,1]),e.translate(Jt,Jt,[0,0,-this.cameraToCenterDistance]),e.rotateX(Jt,Jt,this._pitch),e.rotateZ(Jt,Jt,this.angle),e.translate(Jt,Jt,[-At,-lt,0]),this.mercatorMatrix=e.scale([],Jt,[this.worldSize,this.worldSize,this.worldSize]),e.scale(Jt,Jt,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Jt,this.invProjMatrix=e.invert([],this.projMatrix);var sr=this.width%2/2,pr=this.height%2/2,fr=Math.cos(this.angle),Wt=Math.sin(this.angle),rr=At-Math.round(At)+fr*sr+Wt*pr,er=lt-Math.round(lt)+fr*pr+Wt*sr,$r=new Float64Array(Jt);if(e.translate($r,$r,[rr>.5?rr-1:rr,er>.5?er-1:er,0]),this.alignedProjMatrix=$r,Jt=e.create(),e.scale(Jt,Jt,[this.width/2,-this.height/2,1]),e.translate(Jt,Jt,[1,-1,0]),this.labelPlaneMatrix=Jt,Jt=e.create(),e.scale(Jt,Jt,[1,-1,1]),e.translate(Jt,Jt,[-1,-1,0]),e.scale(Jt,Jt,[2/this.width,2/this.height,1]),this.glCoordMatrix=Jt,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Jt=e.invert(new Float64Array(16),this.pixelMatrix),!Jt)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Jt,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Ms.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var G=this.pointCoordinate(new e.Point(0,0)),xe=[G.x*this.worldSize,G.y*this.worldSize,0,1],re=e.transformMat4(xe,xe,this.pixelMatrix);return re[3]/this.cameraToCenterDistance},Ms.prototype.getCameraPoint=function(){var G=this._pitch,xe=Math.tan(G)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,xe))},Ms.prototype.getCameraQueryGeometry=function(G){var xe=this.getCameraPoint();if(G.length===1)return[G[0],xe];for(var re=xe.x,Le=xe.y,et=xe.x,xt=xe.y,At=0,lt=G;At=3&&!G.some(function(re){return isNaN(re)})){var xe=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(G[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+G[2],+G[1]],zoom:+G[0],bearing:xe,pitch:+(G[4]||0)}),!0}return!1},Wu.prototype._updateHashUnthrottled=function(){var G=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,G)}catch{}};var xc={linearity:.3,easing:e.bezier(0,0,.3,1)},ke=e.extend({deceleration:2500,maxSpeed:1400},xc),Ye=e.extend({deceleration:20,maxSpeed:1400},xc),pt=e.extend({deceleration:1e3,maxSpeed:360},xc),Lt=e.extend({deceleration:1e3,maxSpeed:90},xc),Rt=function(G){this._map=G,this.clear()};Rt.prototype.clear=function(){this._inertiaBuffer=[]},Rt.prototype.record=function(G){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:G})},Rt.prototype._drainInertiaBuffer=function(){for(var G=this._inertiaBuffer,xe=e.browser.now(),re=160;G.length>0&&xe-G[0].time>re;)G.shift()},Rt.prototype._onMoveEnd=function(G){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var xe={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},re=0,Le=this._inertiaBuffer;re=this._clickTolerance||this._map.fire(new ur(G.type,this._map,G))},nn.prototype.dblclick=function(G){return this._firePreventable(new ur(G.type,this._map,G))},nn.prototype.mouseover=function(G){this._map.fire(new ur(G.type,this._map,G))},nn.prototype.mouseout=function(G){this._map.fire(new ur(G.type,this._map,G))},nn.prototype.touchstart=function(G){return this._firePreventable(new kr(G.type,this._map,G))},nn.prototype.touchmove=function(G){this._map.fire(new kr(G.type,this._map,G))},nn.prototype.touchend=function(G){this._map.fire(new kr(G.type,this._map,G))},nn.prototype.touchcancel=function(G){this._map.fire(new kr(G.type,this._map,G))},nn.prototype._firePreventable=function(G){if(this._map.fire(G),G.defaultPrevented)return{}},nn.prototype.isEnabled=function(){return!0},nn.prototype.isActive=function(){return!1},nn.prototype.enable=function(){},nn.prototype.disable=function(){};var wn=function(G){this._map=G};wn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},wn.prototype.mousemove=function(G){this._map.fire(new ur(G.type,this._map,G))},wn.prototype.mousedown=function(){this._delayContextMenu=!0},wn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ur("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},wn.prototype.contextmenu=function(G){this._delayContextMenu?this._contextMenuEvent=G:this._map.fire(new ur(G.type,this._map,G)),this._map.listens("contextmenu")&&G.preventDefault()},wn.prototype.isEnabled=function(){return!0},wn.prototype.isActive=function(){return!1},wn.prototype.enable=function(){},wn.prototype.disable=function(){};var Rn=function(G,xe){this._map=G,this._el=G.getCanvasContainer(),this._container=G.getContainer(),this._clickTolerance=xe.clickTolerance||1};Rn.prototype.isEnabled=function(){return!!this._enabled},Rn.prototype.isActive=function(){return!!this._active},Rn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Rn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Rn.prototype.mousedown=function(G,xe){this.isEnabled()&&G.shiftKey&&G.button===0&&(r.disableDrag(),this._startPos=this._lastPos=xe,this._active=!0)},Rn.prototype.mousemoveWindow=function(G,xe){if(this._active){var re=xe;if(!(this._lastPos.equals(re)||!this._box&&re.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=G.timeStamp),re.length===this.numTouches&&(this.centroid=qa(xe),this.touches=Nn(re,xe)))},Ba.prototype.touchmove=function(G,xe,re){if(!(this.aborted||!this.centroid)){var Le=Nn(re,xe);for(var et in this.touches){var xt=this.touches[et],At=Le[et];(!At||At.dist(xt)>xa)&&(this.aborted=!0)}}},Ba.prototype.touchend=function(G,xe,re){if((!this.centroid||G.timeStamp-this.startTime>ha)&&(this.aborted=!0),re.length===0){var Le=!this.aborted&&this.centroid;if(this.reset(),Le)return Le}};var Ha=function(G){this.singleTap=new Ba(G),this.numTaps=G.numTaps,this.reset()};Ha.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Ha.prototype.touchstart=function(G,xe,re){this.singleTap.touchstart(G,xe,re)},Ha.prototype.touchmove=function(G,xe,re){this.singleTap.touchmove(G,xe,re)},Ha.prototype.touchend=function(G,xe,re){var Le=this.singleTap.touchend(G,xe,re);if(Le){var et=G.timeStamp-this.lastTime0&&(this._active=!0);var Le=Nn(re,xe),et=new e.Point(0,0),xt=new e.Point(0,0),At=0;for(var lt in Le){var gt=Le[lt],It=this._touches[lt];It&&(et._add(gt),xt._add(gt.sub(It)),At++,Le[lt]=gt)}if(this._touches=Le,!(AtMath.abs(De.x)}var bl=100,Gl=function(De){function G(){De.apply(this,arguments)}return De&&(G.__proto__=De),G.prototype=Object.create(De&&De.prototype),G.prototype.constructor=G,G.prototype.reset=function(){De.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},G.prototype._start=function(re){this._lastPoints=re,fc(re[0].sub(re[1]))&&(this._valid=!1)},G.prototype._move=function(re,Le,et){var xt=re[0].sub(this._lastPoints[0]),At=re[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(xt,At,et.timeStamp),!!this._valid){this._lastPoints=re,this._active=!0;var lt=(xt.y+At.y)/2,gt=-.5;return{pitchDelta:lt*gt}}},G.prototype.gestureBeginsVertically=function(re,Le,et){if(this._valid!==void 0)return this._valid;var xt=2,At=re.mag()>=xt,lt=Le.mag()>=xt;if(!(!At&&!lt)){if(!At||!lt)return this._firstMove===void 0&&(this._firstMove=et),et-this._firstMove0==Le.y>0;return fc(re)&&fc(Le)&>}},G}(Js),Lc={panStep:100,bearingStep:15,pitchStep:10},Tu=function(){var G=Lc;this._panStep=G.panStep,this._bearingStep=G.bearingStep,this._pitchStep=G.pitchStep,this._rotationDisabled=!1};Tu.prototype.reset=function(){this._active=!1},Tu.prototype.keydown=function(G){var xe=this;if(!(G.altKey||G.ctrlKey||G.metaKey)){var re=0,Le=0,et=0,xt=0,At=0;switch(G.keyCode){case 61:case 107:case 171:case 187:re=1;break;case 189:case 109:case 173:re=-1;break;case 37:G.shiftKey?Le=-1:(G.preventDefault(),xt=-1);break;case 39:G.shiftKey?Le=1:(G.preventDefault(),xt=1);break;case 38:G.shiftKey?et=1:(G.preventDefault(),At=-1);break;case 40:G.shiftKey?et=-1:(G.preventDefault(),At=1);break;default:return}return this._rotationDisabled&&(Le=0,et=0),{cameraAnimation:function(lt){var gt=lt.getZoom();lt.easeTo({duration:300,easeId:"keyboardHandler",easing:St,zoom:re?Math.round(gt)+re*(G.shiftKey?2:1):gt,bearing:lt.getBearing()+Le*xe._bearingStep,pitch:lt.getPitch()+et*xe._pitchStep,offset:[-xt*xe._panStep,-At*xe._panStep],center:lt.getCenter()},{originalEvent:G})}}}},Tu.prototype.enable=function(){this._enabled=!0},Tu.prototype.disable=function(){this._enabled=!1,this.reset()},Tu.prototype.isEnabled=function(){return this._enabled},Tu.prototype.isActive=function(){return this._active},Tu.prototype.disableRotation=function(){this._rotationDisabled=!0},Tu.prototype.enableRotation=function(){this._rotationDisabled=!1};function St(De){return De*(2-De)}var Er=4.000244140625,Dr=1/100,Bn=1/450,Aa=2,En=function(G,xe){this._map=G,this._el=G.getCanvasContainer(),this._handler=xe,this._delta=0,this._defaultZoomRate=Dr,this._wheelZoomRate=Bn,e.bindAll(["_onTimeout"],this)};En.prototype.setZoomRate=function(G){this._defaultZoomRate=G},En.prototype.setWheelZoomRate=function(G){this._wheelZoomRate=G},En.prototype.isEnabled=function(){return!!this._enabled},En.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},En.prototype.isZooming=function(){return!!this._zooming},En.prototype.enable=function(G){this.isEnabled()||(this._enabled=!0,this._aroundCenter=G&&G.around==="center")},En.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},En.prototype.wheel=function(G){if(this.isEnabled()){var xe=G.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?G.deltaY*40:G.deltaY,re=e.browser.now(),Le=re-(this._lastWheelEventTime||0);this._lastWheelEventTime=re,xe!==0&&xe%Er===0?this._type="wheel":xe!==0&&Math.abs(xe)<4?this._type="trackpad":Le>400?(this._type=null,this._lastValue=xe,this._timeout=setTimeout(this._onTimeout,40,G)):this._type||(this._type=Math.abs(Le*xe)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,xe+=this._lastValue)),G.shiftKey&&xe&&(xe=xe/4),this._type&&(this._lastWheelEvent=G,this._delta-=xe,this._active||this._start(G)),G.preventDefault()}},En.prototype._onTimeout=function(G){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(G)},En.prototype._start=function(G){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 xe=r.mousePos(this._el,G);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(xe)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},En.prototype.renderFrame=function(){var G=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var xe=this._map.transform;if(this._delta!==0){var re=this._type==="wheel"&&Math.abs(this._delta)>Er?this._wheelZoomRate:this._defaultZoomRate,Le=Aa/(1+Math.exp(-Math.abs(this._delta*re)));this._delta<0&&Le!==0&&(Le=1/Le);var et=typeof this._targetZoom=="number"?xe.zoomScale(this._targetZoom):xe.scale;this._targetZoom=Math.min(xe.maxZoom,Math.max(xe.minZoom,xe.scaleZoom(et*Le))),this._type==="wheel"&&(this._startZoom=xe.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var xt=typeof this._targetZoom=="number"?this._targetZoom:xe.zoom,At=this._startZoom,lt=this._easing,gt=!1,It;if(this._type==="wheel"&&At&<){var ar=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Jt=lt(ar);It=e.number(At,xt,Jt),ar<1?this._frameId||(this._frameId=!0):gt=!0}else It=xt,gt=!0;return this._active=!0,gt&&(this._active=!1,this._finishTimeout=setTimeout(function(){G._zooming=!1,G._handler._triggerRenderFrame(),delete G._targetZoom,delete G._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!gt,zoomDelta:It-xe.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},En.prototype._smoothOutEasing=function(G){var xe=e.ease;if(this._prevEase){var re=this._prevEase,Le=(e.browser.now()-re.start)/re.duration,et=re.easing(Le+.01)-re.easing(Le),xt=.27/Math.sqrt(et*et+1e-4)*.01,At=Math.sqrt(.27*.27-xt*xt);xe=e.bezier(xt,At,.25,1)}return this._prevEase={start:e.browser.now(),duration:G,easing:xe},xe},En.prototype.reset=function(){this._active=!1};var Sn=function(G,xe){this._clickZoom=G,this._tapZoom=xe};Sn.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Sn.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Sn.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Sn.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Ya=function(){this.reset()};Ya.prototype.reset=function(){this._active=!1},Ya.prototype.dblclick=function(G,xe){return G.preventDefault(),{cameraAnimation:function(re){re.easeTo({duration:300,zoom:re.getZoom()+(G.shiftKey?-1:1),around:re.unproject(xe)},{originalEvent:G})}}},Ya.prototype.enable=function(){this._enabled=!0},Ya.prototype.disable=function(){this._enabled=!1,this.reset()},Ya.prototype.isEnabled=function(){return this._enabled},Ya.prototype.isActive=function(){return this._active};var $a=function(){this._tap=new Ha({numTouches:1,numTaps:1}),this.reset()};$a.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},$a.prototype.touchstart=function(G,xe,re){this._swipePoint||(this._tapTime&&G.timeStamp-this._tapTime>Yn&&this.reset(),this._tapTime?re.length>0&&(this._swipePoint=xe[0],this._swipeTouch=re[0].identifier):this._tap.touchstart(G,xe,re))},$a.prototype.touchmove=function(G,xe,re){if(!this._tapTime)this._tap.touchmove(G,xe,re);else if(this._swipePoint){if(re[0].identifier!==this._swipeTouch)return;var Le=xe[0],et=Le.y-this._swipePoint.y;return this._swipePoint=Le,G.preventDefault(),this._active=!0,{zoomDelta:et/128}}},$a.prototype.touchend=function(G,xe,re){if(this._tapTime)this._swipePoint&&re.length===0&&this.reset();else{var Le=this._tap.touchend(G,xe,re);Le&&(this._tapTime=G.timeStamp)}},$a.prototype.touchcancel=function(){this.reset()},$a.prototype.enable=function(){this._enabled=!0},$a.prototype.disable=function(){this._enabled=!1,this.reset()},$a.prototype.isEnabled=function(){return this._enabled},$a.prototype.isActive=function(){return this._active};var Wa=function(G,xe,re){this._el=G,this._mousePan=xe,this._touchPan=re};Wa.prototype.enable=function(G){this._inertiaOptions=G||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Wa.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Wa.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Wa.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var oi=function(G,xe,re){this._pitchWithRotate=G.pitchWithRotate,this._mouseRotate=xe,this._mousePitch=re};oi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},oi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},oi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},oi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Hi=function(G,xe,re,Le){this._el=G,this._touchZoom=xe,this._touchRotate=re,this._tapDragZoom=Le,this._rotationDisabled=!1,this._enabled=!0};Hi.prototype.enable=function(G){this._touchZoom.enable(G),this._rotationDisabled||this._touchRotate.enable(G),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Hi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Hi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Hi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Hi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Hi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ci=function(De){return De.zoom||De.drag||De.pitch||De.rotate},ai=function(De){function G(){De.apply(this,arguments)}return De&&(G.__proto__=De),G.prototype=Object.create(De&&De.prototype),G.prototype.constructor=G,G}(e.Event);function Pa(De){return De.panDelta&&De.panDelta.mag()||De.zoomDelta||De.bearingDelta||De.pitchDelta}var pn=function(G,xe){this._map=G,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rt(G),this._bearingSnap=xe.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(xe),e.bindAll(["handleEvent","handleWindowEvent"],this);var re=this._el;this._listeners=[[re,"touchstart",{passive:!0}],[re,"touchmove",{passive:!1}],[re,"touchend",void 0],[re,"touchcancel",void 0],[re,"mousedown",void 0],[re,"mousemove",void 0],[re,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[re,"mouseover",void 0],[re,"mouseout",void 0],[re,"dblclick",void 0],[re,"click",void 0],[re,"keydown",{capture:!1}],[re,"keyup",void 0],[re,"wheel",{passive:!1}],[re,"contextmenu",void 0],[e.window,"blur",void 0]];for(var Le=0,et=this._listeners;LeAt?Math.min(2,xn):Math.max(.5,xn),Sa=Math.pow(Ga,1-Ta),Za=xt.unproject($r.add(sn.mult(Ta*Sa)).mult(Ea));xt.setLocationAtPoint(xt.renderWorldCopies?Za.wrap():Za,Wt)}et._fireMoveEvents(Le)},function(Ta){et._afterEase(Le,Ta)},re),this},G.prototype._prepareEase=function(re,Le,et){et===void 0&&(et={}),this._moving=!0,!Le&&!et.moving&&this.fire(new e.Event("movestart",re)),this._zooming&&!et.zooming&&this.fire(new e.Event("zoomstart",re)),this._rotating&&!et.rotating&&this.fire(new e.Event("rotatestart",re)),this._pitching&&!et.pitching&&this.fire(new e.Event("pitchstart",re))},G.prototype._fireMoveEvents=function(re){this.fire(new e.Event("move",re)),this._zooming&&this.fire(new e.Event("zoom",re)),this._rotating&&this.fire(new e.Event("rotate",re)),this._pitching&&this.fire(new e.Event("pitch",re))},G.prototype._afterEase=function(re,Le){if(!(this._easeId&&Le&&this._easeId===Le)){delete this._easeId;var et=this._zooming,xt=this._rotating,At=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,et&&this.fire(new e.Event("zoomend",re)),xt&&this.fire(new e.Event("rotateend",re)),At&&this.fire(new e.Event("pitchend",re)),this.fire(new e.Event("moveend",re))}},G.prototype.flyTo=function(re,Le){var et=this;if(!re.essential&&e.browser.prefersReducedMotion){var xt=e.pick(re,["center","zoom","bearing","pitch","around"]);return this.jumpTo(xt,Le)}this.stop(),re=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},re);var At=this.transform,lt=this.getZoom(),gt=this.getBearing(),It=this.getPitch(),ar=this.getPadding(),Jt="zoom"in re?e.clamp(+re.zoom,At.minZoom,At.maxZoom):lt,sr="bearing"in re?this._normalizeBearing(re.bearing,gt):gt,pr="pitch"in re?+re.pitch:It,fr="padding"in re?re.padding:At.padding,Wt=At.zoomScale(Jt-lt),rr=e.Point.convert(re.offset),er=At.centerPoint.add(rr),$r=At.pointLocation(er),sn=e.LngLat.convert(re.center||$r);this._normalizeCenter(sn);var xn=At.project($r),wa=At.project(sn).sub(xn),la=re.curve,aa=Math.max(At.width,At.height),Ta=aa/Wt,Ea=wa.mag();if("minZoom"in re){var Ga=e.clamp(Math.min(re.minZoom,lt,Jt),At.minZoom,At.maxZoom),Sa=aa/At.zoomScale(Ga-lt);la=Math.sqrt(Sa/Ea*2)}var Za=la*la;function ci(tl){var pu=(Ta*Ta-aa*aa+(tl?-1:1)*Za*Za*Ea*Ea)/(2*(tl?Ta:aa)*Za*Ea);return Math.log(Math.sqrt(pu*pu+1)-pu)}function Ri(tl){return(Math.exp(tl)-Math.exp(-tl))/2}function Yi(tl){return(Math.exp(tl)+Math.exp(-tl))/2}function ys(tl){return Ri(tl)/Yi(tl)}var ds=ci(0),fl=function(tl){return Yi(ds)/Yi(ds+la*tl)},ol=function(tl){return aa*((Yi(ds)*ys(ds+la*tl)-Ri(ds))/Za)/Ea},dl=(ci(1)-ds)/la;if(Math.abs(Ea)<1e-6||!isFinite(dl)){if(Math.abs(aa-Ta)<1e-6)return this.easeTo(re,Le);var hl=Tare.maxDuration&&(re.duration=0),this._zooming=!0,this._rotating=gt!==sr,this._pitching=pr!==It,this._padding=!At.isPaddingEqual(fr),this._prepareEase(Le,!1),this._ease(function(tl){var pu=tl*dl,Mf=1/fl(pu);At.zoom=tl===1?Jt:lt+At.scaleZoom(Mf),et._rotating&&(At.bearing=e.number(gt,sr,tl)),et._pitching&&(At.pitch=e.number(It,pr,tl)),et._padding&&(At.interpolatePadding(ar,fr,tl),er=At.centerPoint.add(rr));var Zf=tl===1?sn:At.unproject(xn.add(wa.mult(ol(pu))).mult(Mf));At.setLocationAtPoint(At.renderWorldCopies?Zf.wrap():Zf,er),et._fireMoveEvents(Le)},function(){return et._afterEase(Le)},re),this},G.prototype.isEasing=function(){return!!this._easeFrameId},G.prototype.stop=function(){return this._stop()},G.prototype._stop=function(re,Le){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var et=this._onEaseEnd;delete this._onEaseEnd,et.call(this,Le)}if(!re){var xt=this.handlers;xt&&xt.stop(!1)}return this},G.prototype._ease=function(re,Le,et){et.animate===!1||et.duration===0?(re(1),Le()):(this._easeStart=e.browser.now(),this._easeOptions=et,this._onEaseFrame=re,this._onEaseEnd=Le,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},G.prototype._renderFrameCallback=function(){var re=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(re)),re<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},G.prototype._normalizeBearing=function(re,Le){re=e.wrap(re,-180,180);var et=Math.abs(re-Le);return Math.abs(re-360-Le)180?-360:et<-180?360:0}},G}(e.Evented),da=function(G){G===void 0&&(G={}),this.options=G,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};da.prototype.getDefaultPosition=function(){return"bottom-right"},da.prototype.onAdd=function(G){var xe=this.options&&this.options.compact;return this._map=G,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"),xe&&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),xe===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},da.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},da.prototype._setElementTitle=function(G,xe){var re=this._map._getUIString("AttributionControl."+xe);G.title=re,G.setAttribute("aria-label",re)},da.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"))},da.prototype._updateEditLink=function(){var G=this._editLink;G||(G=this._editLink=this._container.querySelector(".mapbox-improve-map"));var xe=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(G){var re=xe.reduce(function(Le,et,xt){return et.value&&(Le+=et.key+"="+et.value+(xt=0)return!1;return!0});var At=G.join(" | ");At!==this._attribHTML&&(this._attribHTML=At,G.length?(this._innerContainer.innerHTML=At,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},da.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ia=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Ia.prototype.onAdd=function(G){this._map=G,this._container=r.create("div","mapboxgl-ctrl");var xe=r.create("a","mapboxgl-ctrl-logo");return xe.target="_blank",xe.rel="noopener nofollow",xe.href="https://www.mapbox.com/",xe.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),xe.setAttribute("rel","noopener nofollow"),this._container.appendChild(xe),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ia.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ia.prototype.getDefaultPosition=function(){return"bottom-left"},Ia.prototype._updateLogo=function(G){(!G||G.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},Ia.prototype._logoRequired=function(){if(this._map.style){var G=this._map.style.sourceCaches;for(var xe in G){var re=G[xe].getSource();if(re.mapbox_logo)return!0}return!1}},Ia.prototype._updateCompact=function(){var G=this._container.children;if(G.length){var xe=G[0];this._map.getCanvasContainer().offsetWidth<250?xe.classList.add("mapboxgl-compact"):xe.classList.remove("mapboxgl-compact")}};var ga=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};ga.prototype.add=function(G){var xe=++this._id,re=this._queue;return re.push({callback:G,id:xe,cancelled:!1}),xe},ga.prototype.remove=function(G){for(var xe=this._currentlyRunning,re=xe?this._queue.concat(xe):this._queue,Le=0,et=re;Lere.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(re.minPitch!=null&&re.maxPitch!=null&&re.minPitch>re.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(re.minPitch!=null&&re.minPitchui)throw new Error("maxPitch must be less than or equal to "+ui);var et=new Ms(re.minZoom,re.maxZoom,re.minPitch,re.maxPitch,re.renderWorldCopies);if(De.call(this,et,re),this._interactive=re.interactive,this._maxTileCacheSize=re.maxTileCacheSize,this._failIfMajorPerformanceCaveat=re.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=re.preserveDrawingBuffer,this._antialias=re.antialias,this._trackResize=re.trackResize,this._bearingSnap=re.bearingSnap,this._refreshExpiredTiles=re.refreshExpiredTiles,this._fadeDuration=re.fadeDuration,this._crossSourceCollisions=re.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=re.collectResourceTiming,this._renderTaskQueue=new ga,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Ti,re.locale),this._clickTolerance=re.clickTolerance,this._requestManager=new e.RequestManager(re.transformRequest,re.accessToken),typeof re.container=="string"){if(this._container=e.window.document.getElementById(re.container),!this._container)throw new Error("Container '"+re.container+"' not found.")}else if(re.container instanceof Ui)this._container=re.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(re.maxBounds&&this.setMaxBounds(re.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 Le._update(!1)}),this.on("moveend",function(){return Le._update(!1)}),this.on("zoom",function(){return Le._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 pn(this,re);var xt=typeof re.hash=="string"&&re.hash||void 0;this._hash=re.hash&&new Wu(xt).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:re.center,zoom:re.zoom,bearing:re.bearing,pitch:re.pitch}),re.bounds&&(this.resize(),this.fitBounds(re.bounds,e.extend({},re.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=re.localIdeographFontFamily,re.style&&this.setStyle(re.style,{localIdeographFontFamily:re.localIdeographFontFamily}),re.attributionControl&&this.addControl(new da({customAttribution:re.customAttribution})),this.addControl(new Ia,re.logoPosition),this.on("style.load",function(){Le.transform.unmodified&&Le.jumpTo(Le.style.stylesheet)}),this.on("data",function(At){Le._update(At.dataType==="style"),Le.fire(new e.Event(At.dataType+"data",At))}),this.on("dataloading",function(At){Le.fire(new e.Event(At.dataType+"dataloading",At))})}De&&(G.__proto__=De),G.prototype=Object.create(De&&De.prototype),G.prototype.constructor=G;var xe={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return G.prototype._getMapId=function(){return this._mapId},G.prototype.addControl=function(Le,et){if(et===void 0&&(Le.getDefaultPosition?et=Le.getDefaultPosition():et="top-right"),!Le||!Le.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 xt=Le.onAdd(this);this._controls.push(Le);var At=this._controlPositions[et];return et.indexOf("bottom")!==-1?At.insertBefore(xt,At.firstChild):At.appendChild(xt),this},G.prototype.removeControl=function(Le){if(!Le||!Le.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 et=this._controls.indexOf(Le);return et>-1&&this._controls.splice(et,1),Le.onRemove(this),this},G.prototype.hasControl=function(Le){return this._controls.indexOf(Le)>-1},G.prototype.resize=function(Le){var et=this._containerDimensions(),xt=et[0],At=et[1];this._resizeCanvas(xt,At),this.transform.resize(xt,At),this.painter.resize(xt,At);var lt=!this._moving;return lt&&(this.stop(),this.fire(new e.Event("movestart",Le)).fire(new e.Event("move",Le))),this.fire(new e.Event("resize",Le)),lt&&this.fire(new e.Event("moveend",Le)),this},G.prototype.getBounds=function(){return this.transform.getBounds()},G.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},G.prototype.setMaxBounds=function(Le){return this.transform.setMaxBounds(e.LngLatBounds.convert(Le)),this._update()},G.prototype.setMinZoom=function(Le){if(Le=Le??sa,Le>=sa&&Le<=this.transform.maxZoom)return this.transform.minZoom=Le,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Le,this._update(),this.getZoom()>Le&&this.setZoom(Le),this;throw new Error("maxZoom must be greater than the current minZoom")},G.prototype.getMaxZoom=function(){return this.transform.maxZoom},G.prototype.setMinPitch=function(Le){if(Le=Le??Wn,Le=Wn&&Le<=this.transform.maxPitch)return this.transform.minPitch=Le,this._update(),this.getPitch()ui)throw new Error("maxPitch must be less than or equal to "+ui);if(Le>=this.transform.minPitch)return this.transform.maxPitch=Le,this._update(),this.getPitch()>Le&&this.setPitch(Le),this;throw new Error("maxPitch must be greater than the current minPitch")},G.prototype.getMaxPitch=function(){return this.transform.maxPitch},G.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},G.prototype.setRenderWorldCopies=function(Le){return this.transform.renderWorldCopies=Le,this._update()},G.prototype.project=function(Le){return this.transform.locationPoint(e.LngLat.convert(Le))},G.prototype.unproject=function(Le){return this.transform.pointLocation(e.Point.convert(Le))},G.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},G.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},G.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},G.prototype._createDelegatedListener=function(Le,et,xt){var At=this,lt;if(Le==="mouseenter"||Le==="mouseover"){var gt=!1,It=function(Wt){var rr=At.getLayer(et)?At.queryRenderedFeatures(Wt.point,{layers:[et]}):[];rr.length?gt||(gt=!0,xt.call(At,new ur(Le,At,Wt.originalEvent,{features:rr}))):gt=!1},ar=function(){gt=!1};return{layer:et,listener:xt,delegates:{mousemove:It,mouseout:ar}}}else if(Le==="mouseleave"||Le==="mouseout"){var Jt=!1,sr=function(Wt){var rr=At.getLayer(et)?At.queryRenderedFeatures(Wt.point,{layers:[et]}):[];rr.length?Jt=!0:Jt&&(Jt=!1,xt.call(At,new ur(Le,At,Wt.originalEvent)))},pr=function(Wt){Jt&&(Jt=!1,xt.call(At,new ur(Le,At,Wt.originalEvent)))};return{layer:et,listener:xt,delegates:{mousemove:sr,mouseout:pr}}}else{var fr=function(Wt){var rr=At.getLayer(et)?At.queryRenderedFeatures(Wt.point,{layers:[et]}):[];rr.length&&(Wt.features=rr,xt.call(At,Wt),delete Wt.features)};return{layer:et,listener:xt,delegates:(lt={},lt[Le]=fr,lt)}}},G.prototype.on=function(Le,et,xt){if(xt===void 0)return De.prototype.on.call(this,Le,et);var At=this._createDelegatedListener(Le,et,xt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Le]=this._delegatedListeners[Le]||[],this._delegatedListeners[Le].push(At);for(var lt in At.delegates)this.on(lt,At.delegates[lt]);return this},G.prototype.once=function(Le,et,xt){if(xt===void 0)return De.prototype.once.call(this,Le,et);var At=this._createDelegatedListener(Le,et,xt);for(var lt in At.delegates)this.once(lt,At.delegates[lt]);return this},G.prototype.off=function(Le,et,xt){var At=this;if(xt===void 0)return De.prototype.off.call(this,Le,et);var lt=function(gt){for(var It=gt[Le],ar=0;ar180;){var xt=xe.locationPoint(De);if(xt.x>=0&&xt.y>=0&&xt.x<=xe.width&&xt.y<=xe.height)break;De.lng>xe.center.lng?De.lng-=360:De.lng+=360}return De}var Uo={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 Ko(De,G,xe){var re=De.classList;for(var Le in Uo)re.remove("mapboxgl-"+xe+"-anchor-"+Le);re.add("mapboxgl-"+xe+"-anchor-"+G)}var il=function(De){function G(xe,re){if(De.call(this),(xe instanceof e.window.HTMLElement||re)&&(xe=e.extend({element:xe},re)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=xe&&xe.anchor||"center",this._color=xe&&xe.color||"#3FB1CE",this._scale=xe&&xe.scale||1,this._draggable=xe&&xe.draggable||!1,this._clickTolerance=xe&&xe.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=xe&&xe.rotation||0,this._rotationAlignment=xe&&xe.rotationAlignment||"auto",this._pitchAlignment=xe&&xe.pitchAlignment&&xe.pitchAlignment!=="auto"?xe.pitchAlignment:this._rotationAlignment,!xe||!xe.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var Le=r.createNS("http://www.w3.org/2000/svg","svg"),et=41,xt=27;Le.setAttributeNS(null,"display","block"),Le.setAttributeNS(null,"height",et+"px"),Le.setAttributeNS(null,"width",xt+"px"),Le.setAttributeNS(null,"viewBox","0 0 "+xt+" "+et);var At=r.createNS("http://www.w3.org/2000/svg","g");At.setAttributeNS(null,"stroke","none"),At.setAttributeNS(null,"stroke-width","1"),At.setAttributeNS(null,"fill","none"),At.setAttributeNS(null,"fill-rule","evenodd");var lt=r.createNS("http://www.w3.org/2000/svg","g");lt.setAttributeNS(null,"fill-rule","nonzero");var gt=r.createNS("http://www.w3.org/2000/svg","g");gt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),gt.setAttributeNS(null,"fill","#000000");for(var It=[{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"}],ar=0,Jt=It;ar=Le}this._isDragging&&(this._pos=re.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")))},G.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"},G.prototype._addDragHandler=function(re){this._element.contains(re.originalEvent.target)&&(re.preventDefault(),this._positionDelta=re.point.sub(this._pos).add(this._offset),this._pointerdownPos=re.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))},G.prototype.setDraggable=function(re){return this._draggable=!!re,this._map&&(re?(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},G.prototype.isDraggable=function(){return this._draggable},G.prototype.setRotation=function(re){return this._rotation=re||0,this._update(),this},G.prototype.getRotation=function(){return this._rotation},G.prototype.setRotationAlignment=function(re){return this._rotationAlignment=re||"auto",this._update(),this},G.prototype.getRotationAlignment=function(){return this._rotationAlignment},G.prototype.setPitchAlignment=function(re){return this._pitchAlignment=re&&re!=="auto"?re:this._rotationAlignment,this._update(),this},G.prototype.getPitchAlignment=function(){return this._pitchAlignment},G}(e.Evented),Jo={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},_u;function Xs(De){_u!==void 0?De(_u):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(G){_u=G.state!=="denied",De(_u)}):(_u=!!e.window.navigator.geolocation,De(_u))}var cu=0,Pu=!1,Uu=function(De){function G(xe){De.call(this),this.options=e.extend({},Jo,xe),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return De&&(G.__proto__=De),G.prototype=Object.create(De&&De.prototype),G.prototype.constructor=G,G.prototype.onAdd=function(re){return this._map=re,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),Xs(this._setupUI),this._container},G.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,cu=0,Pu=!1},G.prototype._isOutOfMapMaxBounds=function(re){var Le=this._map.getMaxBounds(),et=re.coords;return Le&&(et.longitudeLe.getEast()||et.latitudeLe.getNorth())},G.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}},G.prototype._onSuccess=function(re){if(this._map){if(this._isOutOfMapMaxBounds(re)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",re)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=re,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(re),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(re),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",re)),this._finish()}},G.prototype._updateCamera=function(re){var Le=new e.LngLat(re.coords.longitude,re.coords.latitude),et=re.coords.accuracy,xt=this._map.getBearing(),At=e.extend({bearing:xt},this.options.fitBoundsOptions);this._map.fitBounds(Le.toBounds(et),At,{geolocateSource:!0})},G.prototype._updateMarker=function(re){if(re){var Le=new e.LngLat(re.coords.longitude,re.coords.latitude);this._accuracyCircleMarker.setLngLat(Le).addTo(this._map),this._userLocationDotMarker.setLngLat(Le).addTo(this._map),this._accuracy=re.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},G.prototype._updateCircleRadius=function(){var re=this._map._container.clientHeight/2,Le=this._map.unproject([0,re]),et=this._map.unproject([1,re]),xt=Le.distanceTo(et),At=Math.ceil(2*this._accuracy/xt);this._circleElement.style.width=At+"px",this._circleElement.style.height=At+"px"},G.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},G.prototype._onError=function(re){if(this._map){if(this.options.trackUserLocation)if(re.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 Le=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=Le,this._geolocateButton.setAttribute("aria-label",Le),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(re.code===3&&Pu)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",re)),this._finish()}},G.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},G.prototype._setupUI=function(re){var Le=this;if(this._container.addEventListener("contextmenu",function(At){return At.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",re===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var et=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=et,this._geolocateButton.setAttribute("aria-label",et)}else{var xt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=xt,this._geolocateButton.setAttribute("aria-label",xt)}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 il(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new il({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(At){var lt=At.originalEvent&&At.originalEvent.type==="resize";!At.geolocateSource&&Le._watchState==="ACTIVE_LOCK"&&!lt&&(Le._watchState="BACKGROUND",Le._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),Le._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),Le.fire(new e.Event("trackuserlocationend")))})},G.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":cu--,Pu=!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"),cu++;var re;cu>1?(re={maximumAge:6e5,timeout:0},Pu=!0):(re=this.options.positionOptions,Pu=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,re)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},G.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)},G}(e.Evented),Xc={maxWidth:100,unit:"metric"},Xl=function(G){this.options=e.extend({},Xc,G),e.bindAll(["_onMove","setUnit"],this)};Xl.prototype.getDefaultPosition=function(){return"bottom-left"},Xl.prototype._onMove=function(){au(this._map,this._container,this.options)},Xl.prototype.onAdd=function(G){return this._map=G,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",G.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Xl.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Xl.prototype.setUnit=function(G){this.options.unit=G,au(this._map,this._container,this.options)};function au(De,G,xe){var re=xe&&xe.maxWidth||100,Le=De._container.clientHeight/2,et=De.unproject([0,Le]),xt=De.unproject([re,Le]),At=et.distanceTo(xt);if(xe&&xe.unit==="imperial"){var lt=3.2808*At;if(lt>5280){var gt=lt/5280;mo(G,re,gt,De._getUIString("ScaleControl.Miles"))}else mo(G,re,lt,De._getUIString("ScaleControl.Feet"))}else if(xe&&xe.unit==="nautical"){var It=At/1852;mo(G,re,It,De._getUIString("ScaleControl.NauticalMiles"))}else At>=1e3?mo(G,re,At/1e3,De._getUIString("ScaleControl.Kilometers")):mo(G,re,At,De._getUIString("ScaleControl.Meters"))}function mo(De,G,xe,re){var Le=zs(xe),et=Le/xe;De.style.width=G*et+"px",De.innerHTML=Le+" "+re}function ju(De){var G=Math.pow(10,Math.ceil(-Math.log(De)/Math.LN10));return Math.round(De*G)/G}function zs(De){var G=Math.pow(10,(""+Math.floor(De)).length-1),xe=De/G;return xe=xe>=10?10:xe>=5?5:xe>=3?3:xe>=2?2:xe>=1?1:ju(xe),G*xe}var Ll=function(G){this._fullscreen=!1,G&&G.container&&(G.container instanceof e.window.HTMLElement?this._container=G.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")};Ll.prototype.onAdd=function(G){return this._map=G,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},Ll.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Ll.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Ll.prototype._setupUI=function(){var G=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",G).setAttribute("aria-hidden",!0),G.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Ll.prototype._updateTitle=function(){var G=this._getTitle();this._fullscreenButton.setAttribute("aria-label",G),this._fullscreenButton.title=G},Ll.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Ll.prototype._isFullscreen=function(){return this._fullscreen},Ll.prototype._changeIcon=function(){var G=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;G===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Ll.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 Zu={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Ku=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Eo=function(De){function G(xe){De.call(this),this.options=e.extend(Object.create(Zu),xe),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return De&&(G.__proto__=De),G.prototype=Object.create(De&&De.prototype),G.prototype.constructor=G,G.prototype.addTo=function(re){return this._map&&this.remove(),this._map=re,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},G.prototype.isOpen=function(){return!!this._map},G.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},G.prototype.getLngLat=function(){return this._lngLat},G.prototype.setLngLat=function(re){return this._lngLat=e.LngLat.convert(re),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},G.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},G.prototype.getElement=function(){return this._container},G.prototype.setText=function(re){return this.setDOMContent(e.window.document.createTextNode(re))},G.prototype.setHTML=function(re){var Le=e.window.document.createDocumentFragment(),et=e.window.document.createElement("body"),xt;for(et.innerHTML=re;xt=et.firstChild,!!xt;)Le.appendChild(xt);return this.setDOMContent(Le)},G.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},G.prototype.setMaxWidth=function(re){return this.options.maxWidth=re,this._update(),this},G.prototype.setDOMContent=function(re){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(re),this._createCloseButton(),this._update(),this._focusFirstElement(),this},G.prototype.addClassName=function(re){this._container&&this._container.classList.add(re)},G.prototype.removeClassName=function(re){this._container&&this._container.classList.remove(re)},G.prototype.setOffset=function(re){return this.options.offset=re,this._update(),this},G.prototype.toggleClassName=function(re){if(this._container)return this._container.classList.toggle(re)},G.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))},G.prototype._onMouseUp=function(re){this._update(re.point)},G.prototype._onMouseMove=function(re){this._update(re.point)},G.prototype._onDrag=function(re){this._update(re.point)},G.prototype._update=function(re){var Le=this,et=this._lngLat||this._trackPointer;if(!(!this._map||!et||!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(sr){return Le._container.classList.add(sr)}),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=Ao(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!re))){var xt=this._pos=this._trackPointer&&re?re:this._map.project(this._lngLat),At=this.options.anchor,lt=hs(this.options.offset);if(!At){var gt=this._container.offsetWidth,It=this._container.offsetHeight,ar;xt.y+lt.bottom.ythis._map.transform.height-It?ar=["bottom"]:ar=[],xt.xthis._map.transform.width-gt/2&&ar.push("right"),ar.length===0?At="bottom":At=ar.join("-")}var Jt=xt.add(lt[At]).round();r.setTransform(this._container,Uo[At]+" translate("+Jt.x+"px,"+Jt.y+"px)"),Ko(this._container,At,"popup")}},G.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var re=this._container.querySelector(Ku);re&&re.focus()}},G.prototype._onClose=function(){this.remove()},G}(e.Evented);function hs(De){if(De)if(typeof De=="number"){var G=Math.round(Math.sqrt(.5*Math.pow(De,2)));return{center:new e.Point(0,0),top:new e.Point(0,De),"top-left":new e.Point(G,G),"top-right":new e.Point(-G,G),bottom:new e.Point(0,-De),"bottom-left":new e.Point(G,-G),"bottom-right":new e.Point(-G,-G),left:new e.Point(De,0),right:new e.Point(-De,0)}}else if(De instanceof e.Point||Array.isArray(De)){var xe=e.Point.convert(De);return{center:xe,top:xe,"top-left":xe,"top-right":xe,bottom:xe,"bottom-left":xe,"bottom-right":xe,left:xe,right:xe}}else return{center:e.Point.convert(De.center||[0,0]),top:e.Point.convert(De.top||[0,0]),"top-left":e.Point.convert(De["top-left"]||[0,0]),"top-right":e.Point.convert(De["top-right"]||[0,0]),bottom:e.Point.convert(De.bottom||[0,0]),"bottom-left":e.Point.convert(De["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(De["bottom-right"]||[0,0]),left:e.Point.convert(De.left||[0,0]),right:e.Point.convert(De.right||[0,0])};else return hs(new e.Point(0,0))}var gs={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:qi,NavigationControl:Wi,GeolocateControl:Uu,AttributionControl:da,ScaleControl:Xl,FullscreenControl:Ll,Popup:Eo,Marker:il,Style:Ou,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Oi,clearPrewarmedResources:Vt,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(De){e.config.ACCESS_TOKEN=De},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(De){e.config.API_URL=De},get workerCount(){return Da.workerCount},set workerCount(De){Da.workerCount=De},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(De){e.config.MAX_PARALLEL_IMAGE_REQUESTS=De},clearStorage:function(G){e.clearTileCache(G)},workerUrl:""};return gs}),S})}}),rD=_e({"src/plots/mapbox/layers.js"(ee,X){var h=kn(),x=Au().sanitizeHTML,S=OA(),k=qv();function e(i,a){this.subplot=i,this.uid=i.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=k.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=x(i.sourceattribution)),f}X.exports=function(a,s,f){var c=new e(a,s);return c.update(f),c}}}),nD=_e({"src/plots/mapbox/mapbox.js"(ee,X){var h=zA(),x=kn(),S=R0(),k=bi(),e=xs(),t=Pd(),r=zf(),o=Fp(),n=o.drawMode,i=o.selectMode,a=th().prepSelect,s=th().clearOutline,f=th().clearSelectionsCache,c=th().selectOnClick,v=qv(),p=rD();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,d=w[u.id];u.map&&d.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var y;u.map?y=new Promise(function(R,L){u.updateMap(_,w,R,L)}):y=new Promise(function(R,L){u.createMap(_,w,R,L)}),m.push(y)},l.createMap=function(_,w,m,u){var d=this,y=w[d.id],R=d.styleObj=b(y.style,w);d.accessToken=y.accesstoken;var L=y.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,N=d.map=new h.Map({container:d.div,style:R.style,center:E(y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch,maxBounds:z,interactive:!d.isStatic,preserveDrawingBuffer:d.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new h.AttributionControl({compact:!0}));N._canvas.style.left="0px",N._canvas.style.top="0px",d.rejectOnError(u),d.isStatic||d.initFx(_,w);var U=[];U.push(new Promise(function(B){N.once("load",B)})),U=U.concat(S.fetchTraceGeoData(_)),Promise.all(U).then(function(){d.fillBelowLookup(_,w),d.updateData(_),d.updateLayout(w),d.resolveOnRender(m)}).catch(u)},l.updateMap=function(_,w,m,u){var d=this,y=d.map,R=w[this.id];d.rejectOnError(u);var L=[],z=b(R.style,w);JSON.stringify(d.styleObj)!==JSON.stringify(z)&&(d.styleObj=z,y.setStyle(z.style),d.traceHash={},L.push(new Promise(function(N){y.once("styledata",N)}))),L=L.concat(S.fetchTraceGeoData(_)),Promise.all(L).then(function(){d.fillBelowLookup(_,w),d.updateData(_),d.updateLayout(w),d.resolveOnRender(m)}).catch(u)},l.fillBelowLookup=function(_,w){var m=w[this.id],u=m.layers,d,y,R=this.belowLookup={},L=!1;for(d=0;d<_.length;d++){var z=_[d][0].trace,N=z._module;typeof z.below=="string"?y=z.below:N.getBelow&&(y=N.getBelow(z,this)),y===""&&(L=!0),R["trace-"+z.uid]=y||""}for(d=0;d1)for(d=0;d-1&&c(z.originalEvent,u,[m.xaxis],[m.yaxis],m.id,L),N.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 d(z){var N=w.map.unproject(z);return[N.lng,N.lat]}var y=_.dragmode,R;R=function(z,N){if(N.isRect){var U=z.range={};U[w.id]=[d([N.xmin,N.ymin]),d([N.xmax,N.ymax])]}else{var B=z.lassoPoints={};B[w.id]=N.map(d)}};var L=w.dragOptions;w.dragOptions=x.extendDeep(L||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:R},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,N,U){a(z,N,U,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,d;if(m.length!==u.length){for(d=0;dU/2){var B=R.split("|").join("
");z.text(B).attr("data-unformatted",B).call(o.convertToTspans,p),N=r.bBox(z.node())}z.attr("transform",x(-3,-N.height+8)),L.insert("rect",".static-attribution").attr({x:-N.width-6,y:-N.height-3,width:N.width+6,height:N.height+3,fill:"rgba(255, 255, 255, 0.75)"});var D=1;N.width+6>U&&(D=U/(N.width+6));var j=[g.l+g.w*E.x[1],g.t+g.h*(1-E.y[0])];L.attr("transform",x(j[0],j[1])+S(D))}};function c(p,T){var l=p._fullLayout,g=p._context;if(g.mapboxAccessToken==="")return"";for(var b=[],A=[],E=!1,_=!1,w=0;w1&&h.warn(a.multipleTokensErrorMsg),b[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 v(p){return typeof p=="string"&&(a.styleValuesMapbox.indexOf(p)!==-1||p.indexOf("mapbox://")===0||p.indexOf("stamen")===0)}ee.updateFx=function(p){for(var T=p._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)},X.exports=function(r,o){var n=o[0].trace,i=new k(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=_e({"src/traces/choroplethmapbox/index.js"(ee,X){X.exports={attributes:FA(),supplyDefaults:sD(),colorbar:w0(),calc:ox(),plot:lD(),hoverPoints:lx(),eventData:ux(),selectPoints:cx(),styleOnSelect:function(h,x){if(x){var S=x[0].trace;S._glTrace.updateOnSelect(x)}},getBelow:function(h,x){for(var S=x.getMapLayers(),k=S.length-2;k>=0;k--){var e=S[k].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=k+1;t0?+p[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:A})}}var _=k.extractOpts(n),w=_.reversescale?k.flipScale(_.colorscale):_.colorscale,m=w[0][1],u=S.opacity(m)<1?m:S.addOpacity(m,0),d=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c=0;r--)e.removeLayer(t[r][1])},k.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},X.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}}}),vD=_e({"src/traces/densitymapbox/hover.js"(ee,X){var h=xs(),x=Tx().hoverPoints,S=Tx().getExtraText;X.exports=function(e,t,r){var o=x(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]}}}}),mD=_e({"src/traces/densitymapbox/event_data.js"(ee,X){X.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x.z=S.z,x}}}),gD=_e({"src/traces/densitymapbox/index.js"(ee,X){X.exports={attributes:BA(),supplyDefaults:fD(),colorbar:w0(),formatLabels:RA(),calc:hD(),plot:pD(),hoverPoints:vD(),eventData:mD(),getBelow:function(h,x){for(var S=x.getMapLayers(),k=0;kESRI"},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"}}}),bD=_e({"src/plots/map/styles/arcgis-sat.js"(ee,X){X.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"}}]}}}),N0=_e({"src/plots/map/constants.js"(ee,X){var h=ec(),x=_D(),S=bD(),k='© 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":x,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:k,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);X.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."}}}),T1=_e({"src/plots/map/layout_attributes.js"(ee,X){var h=kn(),x=so().defaultLine,S=hf().attributes,k=es(),e=Ff().textposition,t=nc().overrideAll,r=ou().templatedArray,o=N0(),n=k({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});n.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=X.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:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:n,textposition:h.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),Sx=_e({"src/traces/scattermap/attributes.js"(ee,X){var{hovertemplateAttrs:h,texttemplateAttrs:x,templatefallbackAttrs:S}=fu(),k=Np(),e=Tm(),t=Ff(),r=T1(),o=Zs(),n=tc(),i=po().extendFlat,a=nc().overrideAll,s=T1(),f=e.line,c=e.marker;X.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:x({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:k(),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")}}),UA=_e({"src/traces/scattermap/constants.js"(ee,X){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"];X.exports={isSupportedFont:function(x){return h.indexOf(x)!==-1}}}}),xD=_e({"src/traces/scattermap/defaults.js"(ee,X){var h=kn(),x=Ps(),S=lp(),k=yp(),e=_p(),t=Up(),r=Sx(),o=UA().isSupportedFont;X.exports=function(a,s,f,c){function v(d,y){return h.coerce(a,s,r,d,y)}function p(d,y){return h.coerce2(a,s,r,d,y)}var T=n(a,s,v);if(!T){s.visible=!1;return}if(v("text"),v("texttemplate"),v("texttemplatefallback"),v("hovertext"),v("hovertemplate"),v("hovertemplatefallback"),v("mode"),v("below"),x.hasMarkers(s)){S(a,s,f,c,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("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]))}x.hasLines(s)&&(k(a,s,f,c,v,{noDash:!0}),v("connectgaps"));var g=p("cluster.maxzoom"),b=p("cluster.step"),A=p("cluster.color",s.marker&&s.marker.color||f),E=p("cluster.size"),_=p("cluster.opacity"),w=g!==!1||b!==!1||A!==!1||E!==!1||_!==!1,m=v("cluster.enabled",w);if(m||x.hasText(s)){var u=c.font.family;e(a,s,c,v,{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}})}v("fill"),s.fill!=="none"&&t(a,s,f,v),h.coerceSelectionMarkerOpacity(s,v)};function n(i,a,s){var f=s("lon")||[],c=s("lat")||[],v=Math.min(f.length,c.length);return a._length=v,v}}}),jA=_e({"src/traces/scattermap/format_labels.js"(ee,X){var h=xs();X.exports=function(S,k,e){var t={},r=e[k.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}}}),VA=_e({"src/plots/map/convert_text_opts.js"(ee,X){var h=kn();X.exports=function(S,k){var e=S.split(" "),t=e[0],r=e[1],o=h.isArrayOrTypedArray(k)?h.mean(k):k,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}}}}),wD=_e({"src/traces/scattermap/convert.js"(ee,X){var h=jn(),x=kn(),S=qn().BADNUM,k=D0(),e=Ho(),t=ri(),r=bu(),o=Ps(),n=UA().isSupportedFont,i=VA(),a=rc().appendArrayPointValue,s=Au().NEWLINES,f=Au().BR_TAG_ALL;X.exports=function(_,w){var m=w[0].trace,u=m.visible===!0&&m._length!==0,d=m.fill!=="none",y=o.hasLines(m),R=o.hasMarkers(m),L=o.hasText(m),z=R&&m.marker.symbol==="circle",N=R&&m.marker.symbol!=="circle",U=m.cluster&&m.cluster.enabled,B=c("fill"),D=c("line"),j=c("circle"),q=c("symbol"),J={fill:B,line:D,circle:j,symbol:q};if(!u)return J;var oe;if((d||y)&&(oe=k.calcTraceToLineCoords(w)),d&&(B.geojson=k.makePolygon(oe),B.layout.visibility="visible",x.extendFlat(B.paint,{"fill-color":m.fillcolor})),y&&(D.geojson=k.makeLine(oe),D.layout.visibility="visible",x.extendFlat(D.paint,{"line-width":m.line.width,"line-color":m.line.color,"line-opacity":m.opacity})),z){var ye=v(w);j.geojson=ye.geojson,j.layout.visibility="visible",U&&(j.filter=["!",["has","point_count"]],J.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":b(m.cluster.color,m.cluster.step),"circle-radius":b(m.cluster.size,m.cluster.step),"circle-opacity":b(m.cluster.opacity,m.cluster.step)}},J.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":A(m),"text-size":12}}),x.extendFlat(j.paint,{"circle-color":ye.mcc,"circle-radius":ye.mrc,"circle-opacity":ye.mo})}if(z&&U&&(j.filter=["!",["has","point_count"]]),(N||L)&&(q.geojson=p(w,_),x.extendFlat(q.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),N&&(x.extendFlat(q.layout,{"icon-size":m.marker.size/10}),"angle"in m.marker&&m.marker.angle!=="auto"&&x.extendFlat(q.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),q.layout["icon-allow-overlap"]=m.marker.allowoverlap,x.extendFlat(q.paint,{"icon-opacity":m.opacity*m.marker.opacity,"icon-color":m.marker.color})),L)){var pe=(m.marker||{}).size,ge=i(m.textposition,pe);x.extendFlat(q.layout,{"text-size":m.textfont.size,"text-anchor":ge.anchor,"text-offset":ge.offset,"text-font":A(m)}),x.extendFlat(q.paint,{"text-color":m.textfont.color,"text-opacity":m.opacity})}return J};function c(E){return{type:E,geojson:k.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function v(E){var _=E[0].trace,w=_.marker,m=_.selectedpoints,u=x.isArrayOrTypedArray(w.color),d=x.isArrayOrTypedArray(w.size),y=x.isArrayOrTypedArray(w.opacity),R;function L(pe){return _.opacity*pe}function z(pe){return pe/2}var N;u&&(e.hasColorscale(_,"marker")?N=e.makeColorScaleFuncFromTrace(w):N=x.identity);var U;d&&(U=r(_));var B;y&&(B=function(pe){var ge=h(pe)?+x.constrain(pe,0,1):0;return L(ge)});var D=[];for(R=0;R850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):d.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):d.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",d[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),y&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),n(R)||(R=w);var L=R.split(", ");return L}}}),TD=_e({"src/traces/scattermap/plot.js"(ee,X){var h=kn(),x=wD(),S=N0().traceLayerPrefix,k={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 R=d[y];a.removeLayer(p.layerIds[R])}u||a.removeSource(p.sourceIds.circle)}function g(u){for(var d=k.nonCluster,y=0;y=0;y--){var R=d[y];a.removeLayer(p.layerIds[R]),u||a.removeSource(p.sourceIds[R])}}function A(u){v?l(u):b(u)}function E(u){c?T(u):g(u)}function _(){for(var u=c?k.cluster:k.nonCluster,d=0;d=0;i--){var a=n[i];o.removeLayer(this.layerIds[a]),o.removeSource(this.sourceIds[a])}},X.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=x(o.gd,n),v=f.below=o.belowLookup["trace-"+i.uid],p,T,l;if(a)for(f.addSource("circle",c.circle,i.cluster),p=0;p=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),E=A*360,_=i-E;function w(U){var B=U.lonlat;if(B[0]===e||g&&T.indexOf(U.i+1)===-1)return 1/0;var D=x.modHalf(B[0],360),j=B[1],q=p.project([D,j]),J=q.x-c.c2p([_,j]),oe=q.y-v.c2p([D,a]),ye=Math.max(3,U.mrc||0);return Math.max(Math.sqrt(J*J+oe*oe)-ye,1-3/ye)}if(h.getClosest(s,w,n),n.index!==!1){var m=s[n.index],u=m.lonlat,d=[x.modHalf(u[0],360)+E,u[1]],y=c.c2p(d),R=v.c2p(d),L=m.mrc||1;n.x0=y-L,n.x1=y+L,n.y0=R-L,n.y1=R+L;var z={};z[f.subplot]={_subplot:p};var N=f._module.formatLabels(m,f,z);return n.lonLabel=N.lonLabel,n.latLabel=N.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,v=f.indexOf("lon")!==-1,p=f.indexOf("lat")!==-1,T=i.lonlat,l=[];function g(b){return b+"°"}return c||v&&p?l.push("("+g(T[1])+", "+g(T[0])+")"):v?l.push(a.lon+g(T[0])):p&&l.push(a.lat+g(T[1])),(c||f.indexOf("text")!==-1)&&k(i,n,l),l.join("
")}X.exports={hoverPoints:r,getExtraText:o}}}),AD=_e({"src/traces/scattermap/event_data.js"(ee,X){X.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x}}}),SD=_e({"src/traces/scattermap/select.js"(ee,X){var h=kn(),x=Ps(),S=qn().BADNUM;X.exports=function(e,t){var r=e.cd,o=e.xaxis,n=e.yaxis,i=[],a=r[0].trace,s;if(!x.hasMarkers(a))return[];if(t===!1)for(s=0;s1)return 1;for(var ne=K,Se=0;Se<8;Se++){var Ge=this.sampleCurveX(ne)-K;if(Math.abs(Ge)Ge?st=ne:Mt=ne,ne=.5*(Mt-st)+st;return ne},solve:function(K,O){return this.sampleCurveY(this.solveCurveX(K,O))}};var f=r(a);let c,v;function p(){return c==null&&(c=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),c}function T(){if(v==null&&(v=!1,p())){const O=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(O){for(let Se=0;Se<5*5;Se++){const Ge=4*Se;O.fillStyle=`rgb(${Ge},${Ge+1},${Ge+2})`,O.fillRect(Se%5,Math.floor(Se/5),1,1)}const ne=O.getImageData(0,0,5,5).data;for(let Se=0;Se<5*5*4;Se++)if(Se%4!=3&&ne[Se]!==Se){v=!0;break}}}return v||!1}function l(K,O,ne,Se){const Ge=new f(K,O,ne,Se);return rt=>Ge.solve(rt)}const g=l(.25,.1,.25,1);function b(K,O,ne){return Math.min(ne,Math.max(O,K))}function A(K,O,ne){const Se=ne-O,Ge=((K-O)%Se+Se)%Se+O;return Ge===O?ne:Ge}function E(K,...O){for(const ne of O)for(const Se in ne)K[Se]=ne[Se];return K}let _=1;function w(K,O,ne){const Se={};for(const Ge in K)Se[Ge]=O.call(this,K[Ge],Ge,K);return Se}function m(K,O,ne){const Se={};for(const Ge in K)O.call(this,K[Ge],Ge,K)&&(Se[Ge]=K[Ge]);return Se}function u(K){return Array.isArray(K)?K.map(u):typeof K=="object"&&K?w(K,u):K}const d={};function y(K){d[K]||(typeof console<"u"&&console.warn(K),d[K]=!0)}function R(K,O,ne){return(ne.y-K.y)*(O.x-K.x)>(O.y-K.y)*(ne.x-K.x)}function L(K){return typeof WorkerGlobalScope<"u"&&K!==void 0&&K instanceof WorkerGlobalScope}let z=null;function N(K){return typeof ImageBitmap<"u"&&K instanceof ImageBitmap}const U="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function B(K,O,ne,Se,Ge){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const rt=new VideoFrame(K,{timestamp:0});try{const st=rt?.format;if(!st||!st.startsWith("BGR")&&!st.startsWith("RGB"))throw new Error(`Unrecognized format ${st}`);const Mt=st.startsWith("BGR"),Ut=new Uint8ClampedArray(Se*Ge*4);if(yield rt.copyTo(Ut,function(nr,Ar,Pr,en,fn){const Tn=4*Math.max(-Ar,0),Dn=(Math.max(0,Pr)-Pr)*en*4+Tn,Kn=4*en,ka=Math.max(0,Ar),_i=Math.max(0,Pr);return{rect:{x:ka,y:_i,width:Math.min(nr.width,Ar+en)-ka,height:Math.min(nr.height,Pr+fn)-_i},layout:[{offset:Dn,stride:Kn}]}}(K,O,ne,Se,Ge)),Mt)for(let nr=0;nrL(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,ae=function(K,O){if(/:\/\//.test(K.url)&&!/^https?:|^file:/.test(K.url)){const Se=ye(K.url);if(Se)return Se(K,O);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:K,targetMapId:pe},O)}if(!(/^file:/.test(ne=K.url)||/^file:/.test(W())&&!/^\w+:/.test(ne))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(Se,Ge){return t(this,void 0,void 0,function*(){const rt=new Request(Se.url,{method:Se.method||"GET",body:Se.body,credentials:Se.credentials,headers:Se.headers,cache:Se.cache,referrer:W(),signal:Ge.signal});Se.type!=="json"||rt.headers.has("Accept")||rt.headers.set("Accept","application/json");const st=yield fetch(rt);if(!st.ok){const nr=yield st.blob();throw new ge(st.status,st.statusText,Se.url,nr)}let Mt;Mt=Se.type==="arrayBuffer"||Se.type==="image"?st.arrayBuffer():Se.type==="json"?st.json():st.text();const Ut=yield Mt;if(Ge.signal.aborted)throw J();return{data:Ut,cacheControl:st.headers.get("Cache-Control"),expires:st.headers.get("Expires")}})}(K,O);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:K,mustQueue:!0,targetMapId:pe},O)}var ne;return function(Se,Ge){return new Promise((rt,st)=>{var Mt;const Ut=new XMLHttpRequest;Ut.open(Se.method||"GET",Se.url,!0),Se.type!=="arrayBuffer"&&Se.type!=="image"||(Ut.responseType="arraybuffer");for(const nr in Se.headers)Ut.setRequestHeader(nr,Se.headers[nr]);Se.type==="json"&&(Ut.responseType="text",!((Mt=Se.headers)===null||Mt===void 0)&&Mt.Accept||Ut.setRequestHeader("Accept","application/json")),Ut.withCredentials=Se.credentials==="include",Ut.onerror=()=>{st(new Error(Ut.statusText))},Ut.onload=()=>{if(!Ge.signal.aborted)if((Ut.status>=200&&Ut.status<300||Ut.status===0)&&Ut.response!==null){let nr=Ut.response;if(Se.type==="json")try{nr=JSON.parse(Ut.response)}catch(Ar){return void st(Ar)}rt({data:nr,cacheControl:Ut.getResponseHeader("Cache-Control"),expires:Ut.getResponseHeader("Expires")})}else{const nr=new Blob([Ut.response],{type:Ut.getResponseHeader("Content-Type")});st(new ge(Ut.status,Ut.statusText,Se.url,nr))}},Ge.signal.addEventListener("abort",()=>{Ut.abort(),st(J())}),Ut.send(Se.body)})}(K,O)};function se(K){if(!K||K.indexOf("://")<=0||K.indexOf("data:image/")===0||K.indexOf("blob:")===0)return!0;const O=new URL(K),ne=window.location;return O.protocol===ne.protocol&&O.host===ne.host}function Q(K,O,ne){ne[K]&&ne[K].indexOf(O)!==-1||(ne[K]=ne[K]||[],ne[K].push(O))}function me(K,O,ne){if(ne&&ne[K]){const Se=ne[K].indexOf(O);Se!==-1&&ne[K].splice(Se,1)}}class ie{constructor(O,ne={}){E(this,ne),this.type=O}}class Y extends ie{constructor(O,ne={}){super("error",E({error:O},ne))}}class le{on(O,ne){return this._listeners=this._listeners||{},Q(O,ne,this._listeners),this}off(O,ne){return me(O,ne,this._listeners),me(O,ne,this._oneTimeListeners),this}once(O,ne){return ne?(this._oneTimeListeners=this._oneTimeListeners||{},Q(O,ne,this._oneTimeListeners),this):new Promise(Se=>this.once(O,Se))}fire(O,ne){typeof O=="string"&&(O=new ie(O,ne||{}));const Se=O.type;if(this.listens(Se)){O.target=this;const Ge=this._listeners&&this._listeners[Se]?this._listeners[Se].slice():[];for(const Mt of Ge)Mt.call(this,O);const rt=this._oneTimeListeners&&this._oneTimeListeners[Se]?this._oneTimeListeners[Se].slice():[];for(const Mt of rt)me(Se,Mt,this._oneTimeListeners),Mt.call(this,O);const st=this._eventedParent;st&&(E(O,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),st.fire(O))}else O instanceof Y&&console.error(O.error);return this}listens(O){return this._listeners&&this._listeners[O]&&this._listeners[O].length>0||this._oneTimeListeners&&this._oneTimeListeners[O]&&this._oneTimeListeners[O].length>0||this._eventedParent&&this._eventedParent.listens(O)}setEventedParent(O,ne){return this._eventedParent=O,this._eventedParentData=ne,this}}var ue={$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 Te=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Fe(K,O){const ne={};for(const Se in K)Se!=="ref"&&(ne[Se]=K[Se]);return Te.forEach(Se=>{Se in O&&(ne[Se]=O[Se])}),ne}function Ve(K,O){if(Array.isArray(K)){if(!Array.isArray(O)||K.length!==O.length)return!1;for(let ne=0;ne`:K.itemType.kind==="value"?"array":`array<${O}>`}return K.kind}const Ue=[wt,vt,$t,Yt,lr,ln,dr,Qe(Nr),zr,Xr,Ot];function Ie(K,O){if(O.kind==="error")return null;if(K.kind==="array"){if(O.kind==="array"&&(O.N===0&&O.itemType.kind==="value"||!Ie(K.itemType,O.itemType))&&(typeof K.N!="number"||K.N===O.N))return null}else{if(K.kind===O.kind)return null;if(K.kind==="value"){for(const ne of Ue)if(!Ie(ne,O))return null}}return`Expected ${ct(K)} but found ${ct(O)} instead.`}function Pe(K,O){return O.some(ne=>ne.kind===K.kind)}function Be(K,O){return O.some(ne=>ne==="null"?K===null:ne==="array"?Array.isArray(K):ne==="object"?K&&!Array.isArray(K)&&typeof K=="object":ne===typeof K)}function at(K,O){return K.kind==="array"&&O.kind==="array"?K.itemType.kind===O.itemType.kind&&typeof K.N=="number":K.kind===O.kind}const ft=.96422,Bt=.82521,Nt=4/29,Ht=6/29,or=3*Ht*Ht,Cr=Ht*Ht*Ht,Sr=Math.PI/180,Tr=180/Math.PI;function Yr(K){return(K%=360)<0&&(K+=360),K}function Fn([K,O,ne,Se]){let Ge,rt;const st=ta((.2225045*(K=ua(K))+.7168786*(O=ua(O))+.0606169*(ne=ua(ne)))/1);K===O&&O===ne?Ge=rt=st:(Ge=ta((.4360747*K+.3850649*O+.1430804*ne)/ft),rt=ta((.0139322*K+.0971045*O+.7141733*ne)/Bt));const Mt=116*st-16;return[Mt<0?0:Mt,500*(Ge-st),200*(st-rt),Se]}function ua(K){return K<=.04045?K/12.92:Math.pow((K+.055)/1.055,2.4)}function ta(K){return K>Cr?Math.pow(K,1/3):K/or+Nt}function va([K,O,ne,Se]){let Ge=(K+16)/116,rt=isNaN(O)?Ge:Ge+O/500,st=isNaN(ne)?Ge:Ge-ne/200;return Ge=1*Jn(Ge),rt=ft*Jn(rt),st=Bt*Jn(st),[ma(3.1338561*rt-1.6168667*Ge-.4906146*st),ma(-.9787684*rt+1.9161415*Ge+.033454*st),ma(.0719453*rt-.2289914*Ge+1.4052427*st),Se]}function ma(K){return(K=K<=.00304?12.92*K:1.055*Math.pow(K,1/2.4)-.055)<0?0:K>1?1:K}function Jn(K){return K>Ht?K*K*K:or*(K-Nt)}function ja(K){return parseInt(K.padEnd(2,K),16)/255}function ti(K,O){return gr(O?K/100:K,0,1)}function gr(K,O,ne){return Math.min(Math.max(O,K),ne)}function Kt(K){return!K.some(Number.isNaN)}const vr={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 _r{constructor(O,ne,Se,Ge=1,rt=!0){this.r=O,this.g=ne,this.b=Se,this.a=Ge,rt||(this.r*=Ge,this.g*=Ge,this.b*=Ge,Ge||this.overwriteGetter("rgb",[O,ne,Se,Ge]))}static parse(O){if(O instanceof _r)return O;if(typeof O!="string")return;const ne=function(Se){if((Se=Se.toLowerCase().trim())==="transparent")return[0,0,0,0];const Ge=vr[Se];if(Ge){const[st,Mt,Ut]=Ge;return[st/255,Mt/255,Ut/255,1]}if(Se.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(Se)){const st=Se.length<6?1:2;let Mt=1;return[ja(Se.slice(Mt,Mt+=st)),ja(Se.slice(Mt,Mt+=st)),ja(Se.slice(Mt,Mt+=st)),ja(Se.slice(Mt,Mt+st)||"ff")]}if(Se.startsWith("rgb")){const st=Se.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(st){const[Mt,Ut,nr,Ar,Pr,en,fn,Tn,Dn,Kn,ka,_i]=st,Ka=[Ar||" ",fn||" ",Kn].join("");if(Ka===" "||Ka===" /"||Ka===",,"||Ka===",,,"){const di=[nr,en,Dn].join(""),Gi=di==="%%%"?100:di===""?255:0;if(Gi){const vo=[gr(+Ut/Gi,0,1),gr(+Pr/Gi,0,1),gr(+Tn/Gi,0,1),ka?ti(+ka,_i):1];if(Kt(vo))return vo}}return}}const rt=Se.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(rt){const[st,Mt,Ut,nr,Ar,Pr,en,fn,Tn]=rt,Dn=[Ut||" ",Ar||" ",en].join("");if(Dn===" "||Dn===" /"||Dn===",,"||Dn===",,,"){const Kn=[+Mt,gr(+nr,0,100),gr(+Pr,0,100),fn?ti(+fn,Tn):1];if(Kt(Kn))return function([ka,_i,Ka,di]){function Gi(vo){const Yo=(vo+ka/30)%12,sl=_i*Math.min(Ka,1-Ka);return Ka-sl*Math.max(-1,Math.min(Yo-3,9-Yo,1))}return ka=Yr(ka),_i/=100,Ka/=100,[Gi(0),Gi(8),Gi(4),di]}(Kn)}}}(O);return ne?new _r(...ne,!1):void 0}get rgb(){const{r:O,g:ne,b:Se,a:Ge}=this,rt=Ge||1/0;return this.overwriteGetter("rgb",[O/rt,ne/rt,Se/rt,Ge])}get hcl(){return this.overwriteGetter("hcl",function(O){const[ne,Se,Ge,rt]=Fn(O),st=Math.sqrt(Se*Se+Ge*Ge);return[Math.round(1e4*st)?Yr(Math.atan2(Ge,Se)*Tr):NaN,st,ne,rt]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Fn(this.rgb))}overwriteGetter(O,ne){return Object.defineProperty(this,O,{value:ne}),ne}toString(){const[O,ne,Se,Ge]=this.rgb;return`rgba(${[O,ne,Se].map(rt=>Math.round(255*rt)).join(",")},${Ge})`}}_r.black=new _r(0,0,0,1),_r.white=new _r(1,1,1,1),_r.transparent=new _r(0,0,0,0),_r.red=new _r(1,0,0,1);class rn{constructor(O,ne,Se){this.sensitivity=O?ne?"variant":"case":ne?"accent":"base",this.locale=Se,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(O,ne){return this.collator.compare(O,ne)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class gn{constructor(O,ne,Se,Ge,rt){this.text=O,this.image=ne,this.scale=Se,this.fontStack=Ge,this.textColor=rt}}class Mn{constructor(O){this.sections=O}static fromString(O){return new Mn([new gn(O,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(O=>O.text.length!==0||O.image&&O.image.name.length!==0)}static factory(O){return O instanceof Mn?O:Mn.fromString(O)}toString(){return this.sections.length===0?"":this.sections.map(O=>O.text).join("")}}class In{constructor(O){this.values=O.slice()}static parse(O){if(O instanceof In)return O;if(typeof O=="number")return new In([O,O,O,O]);if(Array.isArray(O)&&!(O.length<1||O.length>4)){for(const ne of O)if(typeof ne!="number")return;switch(O.length){case 1:O=[O[0],O[0],O[0],O[0]];break;case 2:O=[O[0],O[1],O[0],O[1]];break;case 3:O=[O[0],O[1],O[2],O[1]]}return new In(O)}}toString(){return JSON.stringify(this.values)}}const fa=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ca{constructor(O){this.values=O.slice()}static parse(O){if(O instanceof Ca)return O;if(Array.isArray(O)&&!(O.length<1)&&O.length%2==0){for(let ne=0;ne=0&&K<=255&&typeof O=="number"&&O>=0&&O<=255&&typeof ne=="number"&&ne>=0&&ne<=255?Se===void 0||typeof Se=="number"&&Se>=0&&Se<=1?null:`Invalid rgba value [${[K,O,ne,Se].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof Se=="number"?[K,O,ne,Se]:[K,O,ne]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Va(K){if(K===null||typeof K=="string"||typeof K=="boolean"||typeof K=="number"||K instanceof _r||K instanceof rn||K instanceof Mn||K instanceof In||K instanceof Ca||K instanceof Ma)return!0;if(Array.isArray(K)){for(const O of K)if(!Va(O))return!1;return!0}if(typeof K=="object"){for(const O in K)if(!Va(K[O]))return!1;return!0}return!1}function na(K){if(K===null)return wt;if(typeof K=="string")return $t;if(typeof K=="boolean")return Yt;if(typeof K=="number")return vt;if(K instanceof _r)return lr;if(K instanceof rn)return Fr;if(K instanceof Mn)return ln;if(K instanceof In)return zr;if(K instanceof Ca)return Ot;if(K instanceof Ma)return Xr;if(Array.isArray(K)){const O=K.length;let ne;for(const Se of K){const Ge=na(Se);if(ne){if(ne===Ge)continue;ne=Nr;break}ne=Ge}return Qe(ne||Nr,O)}return dr}function Mi(K){const O=typeof K;return K===null?"":O==="string"||O==="number"||O==="boolean"?String(K):K instanceof _r||K instanceof Mn||K instanceof In||K instanceof Ca||K instanceof Ma?K.toString():JSON.stringify(K)}class Oi{constructor(O,ne){this.type=O,this.value=ne}static parse(O,ne){if(O.length!==2)return ne.error(`'literal' expression requires exactly one argument, but found ${O.length-1} instead.`);if(!Va(O[1]))return ne.error("invalid value");const Se=O[1];let Ge=na(Se);const rt=ne.expectedType;return Ge.kind!=="array"||Ge.N!==0||!rt||rt.kind!=="array"||typeof rt.N=="number"&&rt.N!==0||(Ge=rt),new Oi(Ge,Se)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Vt{constructor(O){this.name="ExpressionEvaluationError",this.message=O}toJSON(){return this.message}}const Ct={string:$t,number:vt,boolean:Yt,object:dr};class Br{constructor(O,ne){this.type=O,this.args=ne}static parse(O,ne){if(O.length<2)return ne.error("Expected at least one argument.");let Se,Ge=1;const rt=O[0];if(rt==="array"){let Mt,Ut;if(O.length>2){const nr=O[1];if(typeof nr!="string"||!(nr in Ct)||nr==="object")return ne.error('The item type argument of "array" must be one of string, number, boolean',1);Mt=Ct[nr],Ge++}else Mt=Nr;if(O.length>3){if(O[2]!==null&&(typeof O[2]!="number"||O[2]<0||O[2]!==Math.floor(O[2])))return ne.error('The length argument to "array" must be a positive integer literal',2);Ut=O[2],Ge++}Se=Qe(Mt,Ut)}else{if(!Ct[rt])throw new Error(`Types doesn't contain name = ${rt}`);Se=Ct[rt]}const st=[];for(;GeO.outputDefined())}}const Kr={"to-boolean":Yt,"to-color":lr,"to-number":vt,"to-string":$t};class Qr{constructor(O,ne){this.type=O,this.args=ne}static parse(O,ne){if(O.length<2)return ne.error("Expected at least one argument.");const Se=O[0];if(!Kr[Se])throw new Error(`Can't parse ${Se} as it is not part of the known types`);if((Se==="to-boolean"||Se==="to-string")&&O.length!==2)return ne.error("Expected one argument.");const Ge=Kr[Se],rt=[];for(let st=1;st4?`Invalid rbga value ${JSON.stringify(ne)}: expected an array containing either three or four numeric values.`:Da(ne[0],ne[1],ne[2],ne[3]),!Se))return new _r(ne[0]/255,ne[1]/255,ne[2]/255,ne[3])}throw new Vt(Se||`Could not parse color from value '${typeof ne=="string"?ne:JSON.stringify(ne)}'`)}case"padding":{let ne;for(const Se of this.args){ne=Se.evaluate(O);const Ge=In.parse(ne);if(Ge)return Ge}throw new Vt(`Could not parse padding from value '${typeof ne=="string"?ne:JSON.stringify(ne)}'`)}case"variableAnchorOffsetCollection":{let ne;for(const Se of this.args){ne=Se.evaluate(O);const Ge=Ca.parse(ne);if(Ge)return Ge}throw new Vt(`Could not parse variableAnchorOffsetCollection from value '${typeof ne=="string"?ne:JSON.stringify(ne)}'`)}case"number":{let ne=null;for(const Se of this.args){if(ne=Se.evaluate(O),ne===null)return 0;const Ge=Number(ne);if(!isNaN(Ge))return Ge}throw new Vt(`Could not convert ${JSON.stringify(ne)} to number.`)}case"formatted":return Mn.fromString(Mi(this.args[0].evaluate(O)));case"resolvedImage":return Ma.fromString(Mi(this.args[0].evaluate(O)));default:return Mi(this.args[0].evaluate(O))}}eachChild(O){this.args.forEach(O)}outputDefined(){return this.args.every(O=>O.outputDefined())}}const Gr=["Unknown","Point","LineString","Polygon"];class Jr{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"?Gr[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(O){let ne=this._parseColorCache[O];return ne||(ne=this._parseColorCache[O]=_r.parse(O)),ne}}class yn{constructor(O,ne,Se=[],Ge,rt=new _t,st=[]){this.registry=O,this.path=Se,this.key=Se.map(Mt=>`[${Mt}]`).join(""),this.scope=rt,this.errors=st,this.expectedType=Ge,this._isConstant=ne}parse(O,ne,Se,Ge,rt={}){return ne?this.concat(ne,Se,Ge)._parse(O,rt):this._parse(O,rt)}_parse(O,ne){function Se(Ge,rt,st){return st==="assert"?new Br(rt,[Ge]):st==="coerce"?new Qr(rt,[Ge]):Ge}if(O!==null&&typeof O!="string"&&typeof O!="boolean"&&typeof O!="number"||(O=["literal",O]),Array.isArray(O)){if(O.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const Ge=O[0];if(typeof Ge!="string")return this.error(`Expression name must be a string, but found ${typeof Ge} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const rt=this.registry[Ge];if(rt){let st=rt.parse(O,this);if(!st)return null;if(this.expectedType){const Mt=this.expectedType,Ut=st.type;if(Mt.kind!=="string"&&Mt.kind!=="number"&&Mt.kind!=="boolean"&&Mt.kind!=="object"&&Mt.kind!=="array"||Ut.kind!=="value")if(Mt.kind!=="color"&&Mt.kind!=="formatted"&&Mt.kind!=="resolvedImage"||Ut.kind!=="value"&&Ut.kind!=="string")if(Mt.kind!=="padding"||Ut.kind!=="value"&&Ut.kind!=="number"&&Ut.kind!=="array")if(Mt.kind!=="variableAnchorOffsetCollection"||Ut.kind!=="value"&&Ut.kind!=="array"){if(this.checkSubtype(Mt,Ut))return null}else st=Se(st,Mt,ne.typeAnnotation||"coerce");else st=Se(st,Mt,ne.typeAnnotation||"coerce");else st=Se(st,Mt,ne.typeAnnotation||"coerce");else st=Se(st,Mt,ne.typeAnnotation||"assert")}if(!(st instanceof Oi)&&st.type.kind!=="resolvedImage"&&this._isConstant(st)){const Mt=new Jr;try{st=new Oi(st.type,st.evaluate(Mt))}catch(Ut){return this.error(Ut.message),null}}return st}return this.error(`Unknown expression "${Ge}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(O===void 0?"'undefined' value invalid. Use null instead.":typeof O=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof O} instead.`)}concat(O,ne,Se){const Ge=typeof O=="number"?this.path.concat(O):this.path,rt=Se?this.scope.concat(Se):this.scope;return new yn(this.registry,this._isConstant,Ge,ne||null,rt,this.errors)}error(O,...ne){const Se=`${this.key}${ne.map(Ge=>`[${Ge}]`).join("")}`;this.errors.push(new Ke(Se,O))}checkSubtype(O,ne){const Se=Ie(O,ne);return Se&&this.error(Se),Se}}class cn{constructor(O,ne){this.type=ne.type,this.bindings=[].concat(O),this.result=ne}evaluate(O){return this.result.evaluate(O)}eachChild(O){for(const ne of this.bindings)O(ne[1]);O(this.result)}static parse(O,ne){if(O.length<4)return ne.error(`Expected at least 3 arguments, but found ${O.length-1} instead.`);const Se=[];for(let rt=1;rt=Se.length)throw new Vt(`Array index out of bounds: ${ne} > ${Se.length-1}.`);if(ne!==Math.floor(ne))throw new Vt(`Array index must be an integer, but found ${ne} instead.`);return Se[ne]}eachChild(O){O(this.index),O(this.input)}outputDefined(){return!1}}class Hr{constructor(O,ne){this.type=Yt,this.needle=O,this.haystack=ne}static parse(O,ne){if(O.length!==3)return ne.error(`Expected 2 arguments, but found ${O.length-1} instead.`);const Se=ne.parse(O[1],1,Nr),Ge=ne.parse(O[2],2,Nr);return Se&&Ge?Pe(Se.type,[Yt,$t,vt,wt,Nr])?new Hr(Se,Ge):ne.error(`Expected first argument to be of type boolean, string, number or null, but found ${ct(Se.type)} instead`):null}evaluate(O){const ne=this.needle.evaluate(O),Se=this.haystack.evaluate(O);if(!Se)return!1;if(!Be(ne,["boolean","string","number","null"]))throw new Vt(`Expected first argument to be of type boolean, string, number or null, but found ${ct(na(ne))} instead.`);if(!Be(Se,["string","array"]))throw new Vt(`Expected second argument to be of type array or string, but found ${ct(na(Se))} instead.`);return Se.indexOf(ne)>=0}eachChild(O){O(this.needle),O(this.haystack)}outputDefined(){return!0}}class _n{constructor(O,ne,Se){this.type=vt,this.needle=O,this.haystack=ne,this.fromIndex=Se}static parse(O,ne){if(O.length<=2||O.length>=5)return ne.error(`Expected 3 or 4 arguments, but found ${O.length-1} instead.`);const Se=ne.parse(O[1],1,Nr),Ge=ne.parse(O[2],2,Nr);if(!Se||!Ge)return null;if(!Pe(Se.type,[Yt,$t,vt,wt,Nr]))return ne.error(`Expected first argument to be of type boolean, string, number or null, but found ${ct(Se.type)} instead`);if(O.length===4){const rt=ne.parse(O[3],3,vt);return rt?new _n(Se,Ge,rt):null}return new _n(Se,Ge)}evaluate(O){const ne=this.needle.evaluate(O),Se=this.haystack.evaluate(O);if(!Be(ne,["boolean","string","number","null"]))throw new Vt(`Expected first argument to be of type boolean, string, number or null, but found ${ct(na(ne))} instead.`);let Ge;if(this.fromIndex&&(Ge=this.fromIndex.evaluate(O)),Be(Se,["string"])){const rt=Se.indexOf(ne,Ge);return rt===-1?-1:[...Se.slice(0,rt)].length}if(Be(Se,["array"]))return Se.indexOf(ne,Ge);throw new Vt(`Expected second argument to be of type array or string, but found ${ct(na(Se))} instead.`)}eachChild(O){O(this.needle),O(this.haystack),this.fromIndex&&O(this.fromIndex)}outputDefined(){return!1}}class Hn{constructor(O,ne,Se,Ge,rt,st){this.inputType=O,this.type=ne,this.input=Se,this.cases=Ge,this.outputs=rt,this.otherwise=st}static parse(O,ne){if(O.length<5)return ne.error(`Expected at least 4 arguments, but found only ${O.length-1}.`);if(O.length%2!=1)return ne.error("Expected an even number of arguments.");let Se,Ge;ne.expectedType&&ne.expectedType.kind!=="value"&&(Ge=ne.expectedType);const rt={},st=[];for(let nr=2;nrNumber.MAX_SAFE_INTEGER)return en.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof Tn=="number"&&Math.floor(Tn)!==Tn)return en.error("Numeric branch labels must be integer values.");if(Se){if(en.checkSubtype(Se,na(Tn)))return null}else Se=na(Tn);if(rt[String(Tn)]!==void 0)return en.error("Branch labels must be unique.");rt[String(Tn)]=st.length}const fn=ne.parse(Pr,nr,Ge);if(!fn)return null;Ge=Ge||fn.type,st.push(fn)}const Mt=ne.parse(O[1],1,Nr);if(!Mt)return null;const Ut=ne.parse(O[O.length-1],O.length-1,Ge);return Ut?Mt.type.kind!=="value"&&ne.concat(1).checkSubtype(Se,Mt.type)?null:new Hn(Se,Ge,Mt,rt,st,Ut):null}evaluate(O){const ne=this.input.evaluate(O);return(na(ne)===this.inputType&&this.outputs[this.cases[ne]]||this.otherwise).evaluate(O)}eachChild(O){O(this.input),this.outputs.forEach(O),O(this.otherwise)}outputDefined(){return this.outputs.every(O=>O.outputDefined())&&this.otherwise.outputDefined()}}class ea{constructor(O,ne,Se){this.type=O,this.branches=ne,this.otherwise=Se}static parse(O,ne){if(O.length<4)return ne.error(`Expected at least 3 arguments, but found only ${O.length-1}.`);if(O.length%2!=0)return ne.error("Expected an odd number of arguments.");let Se;ne.expectedType&&ne.expectedType.kind!=="value"&&(Se=ne.expectedType);const Ge=[];for(let st=1;stne.outputDefined())&&this.otherwise.outputDefined()}}class Qn{constructor(O,ne,Se,Ge){this.type=O,this.input=ne,this.beginIndex=Se,this.endIndex=Ge}static parse(O,ne){if(O.length<=2||O.length>=5)return ne.error(`Expected 3 or 4 arguments, but found ${O.length-1} instead.`);const Se=ne.parse(O[1],1,Nr),Ge=ne.parse(O[2],2,vt);if(!Se||!Ge)return null;if(!Pe(Se.type,[Qe(Nr),$t,Nr]))return ne.error(`Expected first argument to be of type array or string, but found ${ct(Se.type)} instead`);if(O.length===4){const rt=ne.parse(O[3],3,vt);return rt?new Qn(Se.type,Se,Ge,rt):null}return new Qn(Se.type,Se,Ge)}evaluate(O){const ne=this.input.evaluate(O),Se=this.beginIndex.evaluate(O);let Ge;if(this.endIndex&&(Ge=this.endIndex.evaluate(O)),Be(ne,["string"]))return[...ne].slice(Se,Ge).join("");if(Be(ne,["array"]))return ne.slice(Se,Ge);throw new Vt(`Expected first argument to be of type array or string, but found ${ct(na(ne))} instead.`)}eachChild(O){O(this.input),O(this.beginIndex),this.endIndex&&O(this.endIndex)}outputDefined(){return!1}}function bn(K,O){const ne=K.length-1;let Se,Ge,rt=0,st=ne,Mt=0;for(;rt<=st;)if(Mt=Math.floor((rt+st)/2),Se=K[Mt],Ge=K[Mt+1],Se<=O){if(Mt===ne||OO))throw new Vt("Input is not a number.");st=Mt-1}return 0}class $n{constructor(O,ne,Se){this.type=O,this.input=ne,this.labels=[],this.outputs=[];for(const[Ge,rt]of Se)this.labels.push(Ge),this.outputs.push(rt)}static parse(O,ne){if(O.length-1<4)return ne.error(`Expected at least 4 arguments, but found only ${O.length-1}.`);if((O.length-1)%2!=0)return ne.error("Expected an even number of arguments.");const Se=ne.parse(O[1],1,vt);if(!Se)return null;const Ge=[];let rt=null;ne.expectedType&&ne.expectedType.kind!=="value"&&(rt=ne.expectedType);for(let st=1;st=Mt)return ne.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',nr);const Pr=ne.parse(Ut,Ar,rt);if(!Pr)return null;rt=rt||Pr.type,Ge.push([Mt,Pr])}return new $n(rt,Se,Ge)}evaluate(O){const ne=this.labels,Se=this.outputs;if(ne.length===1)return Se[0].evaluate(O);const Ge=this.input.evaluate(O);if(Ge<=ne[0])return Se[0].evaluate(O);const rt=ne.length;return Ge>=ne[rt-1]?Se[rt-1].evaluate(O):Se[bn(ne,Ge)].evaluate(O)}eachChild(O){O(this.input);for(const ne of this.outputs)O(ne)}outputDefined(){return this.outputs.every(O=>O.outputDefined())}}function ki(K){return K&&K.__esModule&&Object.prototype.hasOwnProperty.call(K,"default")?K.default:K}var Ua=Fi;function Fi(K,O,ne,Se){this.cx=3*K,this.bx=3*(ne-K)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*O,this.by=3*(Se-O)-this.cy,this.ay=1-this.cy-this.by,this.p1x=K,this.p1y=O,this.p2x=ne,this.p2y=Se}Fi.prototype={sampleCurveX:function(K){return((this.ax*K+this.bx)*K+this.cx)*K},sampleCurveY:function(K){return((this.ay*K+this.by)*K+this.cy)*K},sampleCurveDerivativeX:function(K){return(3*this.ax*K+2*this.bx)*K+this.cx},solveCurveX:function(K,O){if(O===void 0&&(O=1e-6),K<0)return 0;if(K>1)return 1;for(var ne=K,Se=0;Se<8;Se++){var Ge=this.sampleCurveX(ne)-K;if(Math.abs(Ge)Ge?st=ne:Mt=ne,ne=.5*(Mt-st)+st;return ne},solve:function(K,O){return this.sampleCurveY(this.solveCurveX(K,O))}};var Ji=ki(Ua);function fo(K,O,ne){return K+ne*(O-K)}function co(K,O,ne){return K.map((Se,Ge)=>fo(Se,O[Ge],ne))}const So={number:fo,color:function(K,O,ne,Se="rgb"){switch(Se){case"rgb":{const[Ge,rt,st,Mt]=co(K.rgb,O.rgb,ne);return new _r(Ge,rt,st,Mt,!1)}case"hcl":{const[Ge,rt,st,Mt]=K.hcl,[Ut,nr,Ar,Pr]=O.hcl;let en,fn;if(isNaN(Ge)||isNaN(Ut))isNaN(Ge)?isNaN(Ut)?en=NaN:(en=Ut,st!==1&&st!==0||(fn=nr)):(en=Ge,Ar!==1&&Ar!==0||(fn=rt));else{let _i=Ut-Ge;Ut>Ge&&_i>180?_i-=360:Ut180&&(_i+=360),en=Ge+ne*_i}const[Tn,Dn,Kn,ka]=function([_i,Ka,di,Gi]){return _i=isNaN(_i)?0:_i*Sr,va([di,Math.cos(_i)*Ka,Math.sin(_i)*Ka,Gi])}([en,fn??fo(rt,nr,ne),fo(st,Ar,ne),fo(Mt,Pr,ne)]);return new _r(Tn,Dn,Kn,ka,!1)}case"lab":{const[Ge,rt,st,Mt]=va(co(K.lab,O.lab,ne));return new _r(Ge,rt,st,Mt,!1)}}},array:co,padding:function(K,O,ne){return new In(co(K.values,O.values,ne))},variableAnchorOffsetCollection:function(K,O,ne){const Se=K.values,Ge=O.values;if(Se.length!==Ge.length)throw new Vt(`Cannot interpolate values of different length. from: ${K.toString()}, to: ${O.toString()}`);const rt=[];for(let st=0;sttypeof Ar!="number"||Ar<0||Ar>1))return ne.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Ge={name:"cubic-bezier",controlPoints:nr}}}if(O.length-1<4)return ne.error(`Expected at least 4 arguments, but found only ${O.length-1}.`);if((O.length-1)%2!=0)return ne.error("Expected an even number of arguments.");if(rt=ne.parse(rt,2,vt),!rt)return null;const Mt=[];let Ut=null;Se==="interpolate-hcl"||Se==="interpolate-lab"?Ut=lr:ne.expectedType&&ne.expectedType.kind!=="value"&&(Ut=ne.expectedType);for(let nr=0;nr=Ar)return ne.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',en);const Tn=ne.parse(Pr,fn,Ut);if(!Tn)return null;Ut=Ut||Tn.type,Mt.push([Ar,Tn])}return at(Ut,vt)||at(Ut,lr)||at(Ut,zr)||at(Ut,Ot)||at(Ut,Qe(vt))?new wi(Ut,Se,Ge,rt,Mt):ne.error(`Type ${ct(Ut)} is not interpolatable.`)}evaluate(O){const ne=this.labels,Se=this.outputs;if(ne.length===1)return Se[0].evaluate(O);const Ge=this.input.evaluate(O);if(Ge<=ne[0])return Se[0].evaluate(O);const rt=ne.length;if(Ge>=ne[rt-1])return Se[rt-1].evaluate(O);const st=bn(ne,Ge),Mt=wi.interpolationFactor(this.interpolation,Ge,ne[st],ne[st+1]),Ut=Se[st].evaluate(O),nr=Se[st+1].evaluate(O);switch(this.operator){case"interpolate":return So[this.type.kind](Ut,nr,Mt);case"interpolate-hcl":return So.color(Ut,nr,Mt,"hcl");case"interpolate-lab":return So.color(Ut,nr,Mt,"lab")}}eachChild(O){O(this.input);for(const ne of this.outputs)O(ne)}outputDefined(){return this.outputs.every(O=>O.outputDefined())}}function ts(K,O,ne,Se){const Ge=Se-ne,rt=K-ne;return Ge===0?0:O===1?rt/Ge:(Math.pow(O,rt)-1)/(Math.pow(O,Ge)-1)}class jo{constructor(O,ne){this.type=O,this.args=ne}static parse(O,ne){if(O.length<2)return ne.error("Expectected at least one argument.");let Se=null;const Ge=ne.expectedType;Ge&&Ge.kind!=="value"&&(Se=Ge);const rt=[];for(const Mt of O.slice(1)){const Ut=ne.parse(Mt,1+rt.length,Se,void 0,{typeAnnotation:"omit"});if(!Ut)return null;Se=Se||Ut.type,rt.push(Ut)}if(!Se)throw new Error("No output type");const st=Ge&&rt.some(Mt=>Ie(Ge,Mt.type));return new jo(st?Nr:Se,rt)}evaluate(O){let ne,Se=null,Ge=0;for(const rt of this.args)if(Ge++,Se=rt.evaluate(O),Se&&Se instanceof Ma&&!Se.available&&(ne||(ne=Se.name),Se=null,Ge===this.args.length&&(Se=ne)),Se!==null)break;return Se}eachChild(O){this.args.forEach(O)}outputDefined(){return this.args.every(O=>O.outputDefined())}}function js(K,O){return K==="=="||K==="!="?O.kind==="boolean"||O.kind==="string"||O.kind==="number"||O.kind==="null"||O.kind==="value":O.kind==="string"||O.kind==="number"||O.kind==="value"}function us(K,O,ne,Se){return Se.compare(O,ne)===0}function Zo(K,O,ne){const Se=K!=="=="&&K!=="!=";return class $S{constructor(rt,st,Mt){this.type=Yt,this.lhs=rt,this.rhs=st,this.collator=Mt,this.hasUntypedArgument=rt.type.kind==="value"||st.type.kind==="value"}static parse(rt,st){if(rt.length!==3&&rt.length!==4)return st.error("Expected two or three arguments.");const Mt=rt[0];let Ut=st.parse(rt[1],1,Nr);if(!Ut)return null;if(!js(Mt,Ut.type))return st.concat(1).error(`"${Mt}" comparisons are not supported for type '${ct(Ut.type)}'.`);let nr=st.parse(rt[2],2,Nr);if(!nr)return null;if(!js(Mt,nr.type))return st.concat(2).error(`"${Mt}" comparisons are not supported for type '${ct(nr.type)}'.`);if(Ut.type.kind!==nr.type.kind&&Ut.type.kind!=="value"&&nr.type.kind!=="value")return st.error(`Cannot compare types '${ct(Ut.type)}' and '${ct(nr.type)}'.`);Se&&(Ut.type.kind==="value"&&nr.type.kind!=="value"?Ut=new Br(nr.type,[Ut]):Ut.type.kind!=="value"&&nr.type.kind==="value"&&(nr=new Br(Ut.type,[nr])));let Ar=null;if(rt.length===4){if(Ut.type.kind!=="string"&&nr.type.kind!=="string"&&Ut.type.kind!=="value"&&nr.type.kind!=="value")return st.error("Cannot use collator to compare non-string types.");if(Ar=st.parse(rt[3],3,Fr),!Ar)return null}return new $S(Ut,nr,Ar)}evaluate(rt){const st=this.lhs.evaluate(rt),Mt=this.rhs.evaluate(rt);if(Se&&this.hasUntypedArgument){const Ut=na(st),nr=na(Mt);if(Ut.kind!==nr.kind||Ut.kind!=="string"&&Ut.kind!=="number")throw new Vt(`Expected arguments for "${K}" to be (string, string) or (number, number), but found (${Ut.kind}, ${nr.kind}) instead.`)}if(this.collator&&!Se&&this.hasUntypedArgument){const Ut=na(st),nr=na(Mt);if(Ut.kind!=="string"||nr.kind!=="string")return O(rt,st,Mt)}return this.collator?ne(rt,st,Mt,this.collator.evaluate(rt)):O(rt,st,Mt)}eachChild(rt){rt(this.lhs),rt(this.rhs),this.collator&&rt(this.collator)}outputDefined(){return!0}}}const No=Zo("==",function(K,O,ne){return O===ne},us),Vs=Zo("!=",function(K,O,ne){return O!==ne},function(K,O,ne,Se){return!us(0,O,ne,Se)}),Ns=Zo("<",function(K,O,ne){return O",function(K,O,ne){return O>ne},function(K,O,ne,Se){return Se.compare(O,ne)>0}),cs=Zo("<=",function(K,O,ne){return O<=ne},function(K,O,ne,Se){return Se.compare(O,ne)<=0}),$o=Zo(">=",function(K,O,ne){return O>=ne},function(K,O,ne,Se){return Se.compare(O,ne)>=0});class yo{constructor(O,ne,Se){this.type=Fr,this.locale=Se,this.caseSensitive=O,this.diacriticSensitive=ne}static parse(O,ne){if(O.length!==2)return ne.error("Expected one argument.");const Se=O[1];if(typeof Se!="object"||Array.isArray(Se))return ne.error("Collator options argument must be an object.");const Ge=ne.parse(Se["case-sensitive"]!==void 0&&Se["case-sensitive"],1,Yt);if(!Ge)return null;const rt=ne.parse(Se["diacritic-sensitive"]!==void 0&&Se["diacritic-sensitive"],1,Yt);if(!rt)return null;let st=null;return Se.locale&&(st=ne.parse(Se.locale,1,$t),!st)?null:new yo(Ge,rt,st)}evaluate(O){return new rn(this.caseSensitive.evaluate(O),this.diacriticSensitive.evaluate(O),this.locale?this.locale.evaluate(O):null)}eachChild(O){O(this.caseSensitive),O(this.diacriticSensitive),this.locale&&O(this.locale)}outputDefined(){return!1}}class fs{constructor(O,ne,Se,Ge,rt){this.type=$t,this.number=O,this.locale=ne,this.currency=Se,this.minFractionDigits=Ge,this.maxFractionDigits=rt}static parse(O,ne){if(O.length!==3)return ne.error("Expected two arguments.");const Se=ne.parse(O[1],1,vt);if(!Se)return null;const Ge=O[2];if(typeof Ge!="object"||Array.isArray(Ge))return ne.error("NumberFormat options argument must be an object.");let rt=null;if(Ge.locale&&(rt=ne.parse(Ge.locale,1,$t),!rt))return null;let st=null;if(Ge.currency&&(st=ne.parse(Ge.currency,1,$t),!st))return null;let Mt=null;if(Ge["min-fraction-digits"]&&(Mt=ne.parse(Ge["min-fraction-digits"],1,vt),!Mt))return null;let Ut=null;return Ge["max-fraction-digits"]&&(Ut=ne.parse(Ge["max-fraction-digits"],1,vt),!Ut)?null:new fs(Se,rt,st,Mt,Ut)}evaluate(O){return new Intl.NumberFormat(this.locale?this.locale.evaluate(O):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(O):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(O):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(O):void 0}).format(this.number.evaluate(O))}eachChild(O){O(this.number),this.locale&&O(this.locale),this.currency&&O(this.currency),this.minFractionDigits&&O(this.minFractionDigits),this.maxFractionDigits&&O(this.maxFractionDigits)}outputDefined(){return!1}}class nl{constructor(O){this.type=ln,this.sections=O}static parse(O,ne){if(O.length<2)return ne.error("Expected at least one argument.");const Se=O[1];if(!Array.isArray(Se)&&typeof Se=="object")return ne.error("First argument must be an image or text section.");const Ge=[];let rt=!1;for(let st=1;st<=O.length-1;++st){const Mt=O[st];if(rt&&typeof Mt=="object"&&!Array.isArray(Mt)){rt=!1;let Ut=null;if(Mt["font-scale"]&&(Ut=ne.parse(Mt["font-scale"],1,vt),!Ut))return null;let nr=null;if(Mt["text-font"]&&(nr=ne.parse(Mt["text-font"],1,Qe($t)),!nr))return null;let Ar=null;if(Mt["text-color"]&&(Ar=ne.parse(Mt["text-color"],1,lr),!Ar))return null;const Pr=Ge[Ge.length-1];Pr.scale=Ut,Pr.font=nr,Pr.textColor=Ar}else{const Ut=ne.parse(O[st],1,Nr);if(!Ut)return null;const nr=Ut.type.kind;if(nr!=="string"&&nr!=="value"&&nr!=="null"&&nr!=="resolvedImage")return ne.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");rt=!0,Ge.push({content:Ut,scale:null,font:null,textColor:null})}}return new nl(Ge)}evaluate(O){return new Mn(this.sections.map(ne=>{const Se=ne.content.evaluate(O);return na(Se)===Xr?new gn("",Se,null,null,null):new gn(Mi(Se),null,ne.scale?ne.scale.evaluate(O):null,ne.font?ne.font.evaluate(O).join(","):null,ne.textColor?ne.textColor.evaluate(O):null)}))}eachChild(O){for(const ne of this.sections)O(ne.content),ne.scale&&O(ne.scale),ne.font&&O(ne.font),ne.textColor&&O(ne.textColor)}outputDefined(){return!1}}class wl{constructor(O){this.type=Xr,this.input=O}static parse(O,ne){if(O.length!==2)return ne.error("Expected two arguments.");const Se=ne.parse(O[1],1,$t);return Se?new wl(Se):ne.error("No image name provided.")}evaluate(O){const ne=this.input.evaluate(O),Se=Ma.fromString(ne);return Se&&O.availableImages&&(Se.available=O.availableImages.indexOf(ne)>-1),Se}eachChild(O){O(this.input)}outputDefined(){return!1}}class Ml{constructor(O){this.type=vt,this.input=O}static parse(O,ne){if(O.length!==2)return ne.error(`Expected 1 argument, but found ${O.length-1} instead.`);const Se=ne.parse(O[1],1);return Se?Se.type.kind!=="array"&&Se.type.kind!=="string"&&Se.type.kind!=="value"?ne.error(`Expected argument of type string or array, but found ${ct(Se.type)} instead.`):new Ml(Se):null}evaluate(O){const ne=this.input.evaluate(O);if(typeof ne=="string")return[...ne].length;if(Array.isArray(ne))return ne.length;throw new Vt(`Expected value to be of type string or array, but found ${ct(na(ne))} instead.`)}eachChild(O){O(this.input)}outputDefined(){return!1}}const Ts=8192;function Ai(K,O){const ne=(180+K[0])/360,Se=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+K[1]*Math.PI/360)))/360,Ge=Math.pow(2,O.z);return[Math.round(ne*Ge*Ts),Math.round(Se*Ge*Ts)]}function uo(K,O){const ne=Math.pow(2,O.z);return[(Ge=(K[0]/Ts+O.x)/ne,360*Ge-180),(Se=(K[1]/Ts+O.y)/ne,360/Math.PI*Math.atan(Math.exp((180-360*Se)*Math.PI/180))-90)];var Se,Ge}function Tl(K,O){K[0]=Math.min(K[0],O[0]),K[1]=Math.min(K[1],O[1]),K[2]=Math.max(K[2],O[0]),K[3]=Math.max(K[3],O[1])}function Cs(K,O){return!(K[0]<=O[0]||K[2]>=O[2]||K[1]<=O[1]||K[3]>=O[3])}function Ro(K,O,ne){const Se=K[0]-O[0],Ge=K[1]-O[1],rt=K[0]-ne[0],st=K[1]-ne[1];return Se*st-rt*Ge==0&&Se*rt<=0&&Ge*st<=0}function El(K,O,ne,Se){return(Ge=[Se[0]-ne[0],Se[1]-ne[1]])[0]*(rt=[O[0]-K[0],O[1]-K[1]])[1]-Ge[1]*rt[0]!=0&&!(!rs(K,O,ne,Se)||!rs(ne,Se,K,O));var Ge,rt}function qs(K,O,ne){for(const Se of ne)for(let Ge=0;Ge(Ge=K)[1]!=(st=Mt[Ut+1])[1]>Ge[1]&&Ge[0]<(st[0]-rt[0])*(Ge[1]-rt[1])/(st[1]-rt[1])+rt[0]&&(Se=!Se)}var Ge,rt,st;return Se}function mu(K,O){for(const ne of O)if(al(K,ne))return!0;return!1}function io(K,O){for(const ne of K)if(!al(ne,O))return!1;for(let ne=0;ne0&&Mt<0||st<0&&Mt>0}function Bl(K,O,ne){const Se=[];for(let Ge=0;Gene[2]){const Ge=.5*Se;let rt=K[0]-ne[0]>Ge?-Se:ne[0]-K[0]>Ge?Se:0;rt===0&&(rt=K[0]-ne[2]>Ge?-Se:ne[2]-K[0]>Ge?Se:0),K[0]+=rt}Tl(O,K)}function tu(K,O,ne,Se){const Ge=Math.pow(2,Se.z)*Ts,rt=[Se.x*Ts,Se.y*Ts],st=[];for(const Mt of K)for(const Ut of Mt){const nr=[Ut.x+rt[0],Ut.y+rt[1]];Lo(nr,O,ne,Ge),st.push(nr)}return st}function su(K,O,ne,Se){const Ge=Math.pow(2,Se.z)*Ts,rt=[Se.x*Ts,Se.y*Ts],st=[];for(const Ut of K){const nr=[];for(const Ar of Ut){const Pr=[Ar.x+rt[0],Ar.y+rt[1]];Tl(O,Pr),nr.push(Pr)}st.push(nr)}if(O[2]-O[0]<=Ge/2){(Mt=O)[0]=Mt[1]=1/0,Mt[2]=Mt[3]=-1/0;for(const Ut of st)for(const nr of Ut)Lo(nr,O,ne,Ge)}var Mt;return st}class Ds{constructor(O,ne){this.type=Yt,this.geojson=O,this.geometries=ne}static parse(O,ne){if(O.length!==2)return ne.error(`'within' expression requires exactly one argument, but found ${O.length-1} instead.`);if(Va(O[1])){const Se=O[1];if(Se.type==="FeatureCollection"){const Ge=[];for(const rt of Se.features){const{type:st,coordinates:Mt}=rt.geometry;st==="Polygon"&&Ge.push(Mt),st==="MultiPolygon"&&Ge.push(...Mt)}if(Ge.length)return new Ds(Se,{type:"MultiPolygon",coordinates:Ge})}else if(Se.type==="Feature"){const Ge=Se.geometry.type;if(Ge==="Polygon"||Ge==="MultiPolygon")return new Ds(Se,Se.geometry)}else if(Se.type==="Polygon"||Se.type==="MultiPolygon")return new Ds(Se,Se)}return ne.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(O){if(O.geometry()!=null&&O.canonicalID()!=null){if(O.geometryType()==="Point")return function(ne,Se){const Ge=[1/0,1/0,-1/0,-1/0],rt=[1/0,1/0,-1/0,-1/0],st=ne.canonicalID();if(Se.type==="Polygon"){const Mt=Bl(Se.coordinates,rt,st),Ut=tu(ne.geometry(),Ge,rt,st);if(!Cs(Ge,rt))return!1;for(const nr of Ut)if(!al(nr,Mt))return!1}if(Se.type==="MultiPolygon"){const Mt=Ul(Se.coordinates,rt,st),Ut=tu(ne.geometry(),Ge,rt,st);if(!Cs(Ge,rt))return!1;for(const nr of Ut)if(!mu(nr,Mt))return!1}return!0}(O,this.geometries);if(O.geometryType()==="LineString")return function(ne,Se){const Ge=[1/0,1/0,-1/0,-1/0],rt=[1/0,1/0,-1/0,-1/0],st=ne.canonicalID();if(Se.type==="Polygon"){const Mt=Bl(Se.coordinates,rt,st),Ut=su(ne.geometry(),Ge,rt,st);if(!Cs(Ge,rt))return!1;for(const nr of Ut)if(!io(nr,Mt))return!1}if(Se.type==="MultiPolygon"){const Mt=Ul(Se.coordinates,rt,st),Ut=su(ne.geometry(),Ge,rt,st);if(!Cs(Ge,rt))return!1;for(const nr of Ut)if(!vs(nr,Mt))return!1}return!0}(O,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let vl=class{constructor(K=[],O=(ne,Se)=>neSe?1:0){if(this.data=K,this.length=this.data.length,this.compare=O,this.length>0)for(let ne=(this.length>>1)-1;ne>=0;ne--)this._down(ne)}push(K){this.data.push(K),this._up(this.length++)}pop(){if(this.length===0)return;const K=this.data[0],O=this.data.pop();return--this.length>0&&(this.data[0]=O,this._down(0)),K}peek(){return this.data[0]}_up(K){const{data:O,compare:ne}=this,Se=O[K];for(;K>0;){const Ge=K-1>>1,rt=O[Ge];if(ne(Se,rt)>=0)break;O[K]=rt,K=Ge}O[K]=Se}_down(K){const{data:O,compare:ne}=this,Se=this.length>>1,Ge=O[K];for(;K=0)break;O[K]=O[rt],K=rt}O[K]=Ge}};function Il(K,O,ne,Se,Ge){zl(K,O,ne,Se||K.length-1,Ge||qc)}function zl(K,O,ne,Se,Ge){for(;Se>ne;){if(Se-ne>600){var rt=Se-ne+1,st=O-ne+1,Mt=Math.log(rt),Ut=.5*Math.exp(2*Mt/3),nr=.5*Math.sqrt(Mt*Ut*(rt-Ut)/rt)*(st-rt/2<0?-1:1);zl(K,O,Math.max(ne,Math.floor(O-st*Ut/rt+nr)),Math.min(Se,Math.floor(O+(rt-st)*Ut/rt+nr)),Ge)}var Ar=K[O],Pr=ne,en=Se;for(Ou(K,ne,O),Ge(K[Se],Ar)>0&&Ou(K,ne,Se);Pr0;)en--}Ge(K[ne],Ar)===0?Ou(K,ne,en):Ou(K,++en,Se),en<=O&&(ne=en+1),O<=en&&(Se=en-1)}}function Ou(K,O,ne){var Se=K[O];K[O]=K[ne],K[ne]=Se}function qc(K,O){return KO?1:0}function Mc(K,O){if(K.length<=1)return[K];const ne=[];let Se,Ge;for(const rt of K){const st=rh(rt);st!==0&&(rt.area=Math.abs(st),Ge===void 0&&(Ge=st<0),Ge===st<0?(Se&&ne.push(Se),Se=[rt]):Se.push(rt))}if(Se&&ne.push(Se),O>1)for(let rt=0;rt1?(nr=O[Ut+1][0],Ar=O[Ut+1][1]):fn>0&&(nr+=Pr/this.kx*fn,Ar+=en/this.ky*fn)),Pr=this.wrap(ne[0]-nr)*this.kx,en=(ne[1]-Ar)*this.ky;const Tn=Pr*Pr+en*en;Tn180;)O-=360;return O}}function Gu(K,O){return O[0]-K[0]}function zu(K){return K[1]-K[0]+1}function Hu(K,O){return K[1]>=K[0]&&K[1]K[1])return[null,null];const ne=zu(K);if(O){if(ne===2)return[K,null];const Ge=Math.floor(ne/2);return[[K[0],K[0]+Ge],[K[0]+Ge,K[1]]]}if(ne===1)return[K,null];const Se=Math.floor(ne/2)-1;return[[K[0],K[0]+Se],[K[0]+Se+1,K[1]]]}function $l(K,O){if(!Hu(O,K.length))return[1/0,1/0,-1/0,-1/0];const ne=[1/0,1/0,-1/0,-1/0];for(let Se=O[0];Se<=O[1];++Se)Tl(ne,K[Se]);return ne}function Fu(K){const O=[1/0,1/0,-1/0,-1/0];for(const ne of K)for(const Se of ne)Tl(O,Se);return O}function Bs(K){return K[0]!==-1/0&&K[1]!==-1/0&&K[2]!==1/0&&K[3]!==1/0}function kl(K,O,ne){if(!Bs(K)||!Bs(O))return NaN;let Se=0,Ge=0;return K[2]O[2]&&(Se=K[0]-O[2]),K[1]>O[3]&&(Ge=K[1]-O[3]),K[3]=Se)return Se;if(Cs(Ge,rt)){if(Yh(K,O))return 0}else if(Yh(O,K))return 0;let st=1/0;for(const Mt of K)for(let Ut=0,nr=Mt.length,Ar=nr-1;Ut0;){const Ut=st.pop();if(Ut[0]>=rt)continue;const nr=Ut[1],Ar=O?50:100;if(zu(nr)<=Ar){if(!Hu(nr,K.length))return NaN;if(O){const Pr=Rs(K,nr,ne,Se);if(isNaN(Pr)||Pr===0)return Pr;rt=Math.min(rt,Pr)}else for(let Pr=nr[0];Pr<=nr[1];++Pr){const en=Rh(K[Pr],ne,Se);if(rt=Math.min(rt,en),rt===0)return 0}}else{const Pr=Rc(nr,O);Do(st,rt,Se,K,Mt,Pr[0]),Do(st,rt,Se,K,Mt,Pr[1])}}return rt}function Cu(K,O,ne,Se,Ge,rt=1/0){let st=Math.min(rt,Ge.distance(K[0],ne[0]));if(st===0)return st;const Mt=new vl([[0,[0,K.length-1],[0,ne.length-1]]],Gu);for(;Mt.length>0;){const Ut=Mt.pop();if(Ut[0]>=st)continue;const nr=Ut[1],Ar=Ut[2],Pr=O?50:100,en=Se?50:100;if(zu(nr)<=Pr&&zu(Ar)<=en){if(!Hu(nr,K.length)&&Hu(Ar,ne.length))return NaN;let fn;if(O&&Se)fn=df(K,nr,ne,Ar,Ge),st=Math.min(st,fn);else if(O&&!Se){const Tn=K.slice(nr[0],nr[1]+1);for(let Dn=Ar[0];Dn<=Ar[1];++Dn)if(fn=rf(ne[Dn],Tn,Ge),st=Math.min(st,fn),st===0)return st}else if(!O&&Se){const Tn=ne.slice(Ar[0],Ar[1]+1);for(let Dn=nr[0];Dn<=nr[1];++Dn)if(fn=rf(K[Dn],Tn,Ge),st=Math.min(st,fn),st===0)return st}else fn=ru(K,nr,ne,Ar,Ge),st=Math.min(st,fn)}else{const fn=Rc(nr,O),Tn=Rc(Ar,Se);kf(Mt,st,Ge,K,ne,fn[0],Tn[0]),kf(Mt,st,Ge,K,ne,fn[0],Tn[1]),kf(Mt,st,Ge,K,ne,fn[1],Tn[0]),kf(Mt,st,Ge,K,ne,fn[1],Tn[1])}}return st}function ah(K){return K.type==="MultiPolygon"?K.coordinates.map(O=>({type:"Polygon",coordinates:O})):K.type==="MultiLineString"?K.coordinates.map(O=>({type:"LineString",coordinates:O})):K.type==="MultiPoint"?K.coordinates.map(O=>({type:"Point",coordinates:O})):[K]}class pf{constructor(O,ne){this.type=vt,this.geojson=O,this.geometries=ne}static parse(O,ne){if(O.length!==2)return ne.error(`'distance' expression requires exactly one argument, but found ${O.length-1} instead.`);if(Va(O[1])){const Se=O[1];if(Se.type==="FeatureCollection")return new pf(Se,Se.features.map(Ge=>ah(Ge.geometry)).flat());if(Se.type==="Feature")return new pf(Se,ah(Se.geometry));if("type"in Se&&"coordinates"in Se)return new pf(Se,ah(Se))}return ne.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(O){if(O.geometry()!=null&&O.canonicalID()!=null){if(O.geometryType()==="Point")return function(ne,Se){const Ge=ne.geometry(),rt=Ge.flat().map(Ut=>uo([Ut.x,Ut.y],ne.canonical));if(Ge.length===0)return NaN;const st=new nh(rt[0][1]);let Mt=1/0;for(const Ut of Se){switch(Ut.type){case"Point":Mt=Math.min(Mt,Cu(rt,!1,[Ut.coordinates],!1,st,Mt));break;case"LineString":Mt=Math.min(Mt,Cu(rt,!1,Ut.coordinates,!0,st,Mt));break;case"Polygon":Mt=Math.min(Mt,Oc(rt,!1,Ut.coordinates,st,Mt))}if(Mt===0)return Mt}return Mt}(O,this.geometries);if(O.geometryType()==="LineString")return function(ne,Se){const Ge=ne.geometry(),rt=Ge.flat().map(Ut=>uo([Ut.x,Ut.y],ne.canonical));if(Ge.length===0)return NaN;const st=new nh(rt[0][1]);let Mt=1/0;for(const Ut of Se){switch(Ut.type){case"Point":Mt=Math.min(Mt,Cu(rt,!0,[Ut.coordinates],!1,st,Mt));break;case"LineString":Mt=Math.min(Mt,Cu(rt,!0,Ut.coordinates,!0,st,Mt));break;case"Polygon":Mt=Math.min(Mt,Oc(rt,!0,Ut.coordinates,st,Mt))}if(Mt===0)return Mt}return Mt}(O,this.geometries);if(O.geometryType()==="Polygon")return function(ne,Se){const Ge=ne.geometry();if(Ge.length===0||Ge[0].length===0)return NaN;const rt=Mc(Ge,0).map(Ut=>Ut.map(nr=>nr.map(Ar=>uo([Ar.x,Ar.y],ne.canonical)))),st=new nh(rt[0][0][0][1]);let Mt=1/0;for(const Ut of Se)for(const nr of rt){switch(Ut.type){case"Point":Mt=Math.min(Mt,Oc([Ut.coordinates],!1,nr,st,Mt));break;case"LineString":Mt=Math.min(Mt,Oc(Ut.coordinates,!0,nr,st,Mt));break;case"Polygon":Mt=Math.min(Mt,ul(nr,Ut.coordinates,st,Mt))}if(Mt===0)return Mt}return Mt}(O,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Nf={"==":No,"!=":Vs,">":rl,"<":Ns,">=":$o,"<=":cs,array:Br,at:yr,boolean:Br,case:ea,coalesce:jo,collator:yo,format:nl,image:wl,in:Hr,"index-of":_n,interpolate:wi,"interpolate-hcl":wi,"interpolate-lab":wi,length:Ml,let:cn,literal:Oi,match:Hn,number:Br,"number-format":fs,object:Br,slice:Qn,step:$n,string:Br,"to-boolean":Qr,"to-color":Qr,"to-number":Qr,"to-string":Qr,var:Dt,within:Ds,distance:pf};class Nu{constructor(O,ne,Se,Ge){this.name=O,this.type=ne,this._evaluate=Se,this.args=Ge}evaluate(O){return this._evaluate(O,this.args)}eachChild(O){this.args.forEach(O)}outputDefined(){return!1}static parse(O,ne){const Se=O[0],Ge=Nu.definitions[Se];if(!Ge)return ne.error(`Unknown expression "${Se}". If you wanted a literal array, use ["literal", [...]].`,0);const rt=Array.isArray(Ge)?Ge[0]:Ge.type,st=Array.isArray(Ge)?[[Ge[1],Ge[2]]]:Ge.overloads,Mt=st.filter(([nr])=>!Array.isArray(nr)||nr.length===O.length-1);let Ut=null;for(const[nr,Ar]of Mt){Ut=new yn(ne.registry,ih,ne.path,null,ne.scope);const Pr=[];let en=!1;for(let fn=1;fn{return en=Pr,Array.isArray(en)?`(${en.map(ct).join(", ")})`:`(${ct(en.type)}...)`;var en}).join(" | "),Ar=[];for(let Pr=1;Pr{ne=O?ne&&ih(Se):ne&&Se instanceof Oi}),!!ne&&oh(K)&&hh(K,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function oh(K){if(K instanceof Nu&&(K.name==="get"&&K.args.length===1||K.name==="feature-state"||K.name==="has"&&K.args.length===1||K.name==="properties"||K.name==="geometry-type"||K.name==="id"||/^filter-/.test(K.name))||K instanceof Ds||K instanceof pf)return!1;let O=!0;return K.eachChild(ne=>{O&&!oh(ne)&&(O=!1)}),O}function zc(K){if(K instanceof Nu&&K.name==="feature-state")return!1;let O=!0;return K.eachChild(ne=>{O&&!zc(ne)&&(O=!1)}),O}function hh(K,O){if(K instanceof Nu&&O.indexOf(K.name)>=0)return!1;let ne=!0;return K.eachChild(Se=>{ne&&!hh(Se,O)&&(ne=!1)}),ne}function nf(K){return{result:"success",value:K}}function Gc(K){return{result:"error",value:K}}function Bu(K){return K["property-type"]==="data-driven"||K["property-type"]==="cross-faded-data-driven"}function Af(K){return!!K.expression&&K.expression.parameters.indexOf("zoom")>-1}function sh(K){return!!K.expression&&K.expression.interpolated}function Dl(K){return K instanceof Number?"number":K instanceof String?"string":K instanceof Boolean?"boolean":Array.isArray(K)?"array":K===null?"null":typeof K}function $f(K){return typeof K=="object"&&K!==null&&!Array.isArray(K)}function Oh(K){return K}function dh(K,O){const ne=O.type==="color",Se=K.stops&&typeof K.stops[0][0]=="object",Ge=Se||!(Se||K.property!==void 0),rt=K.type||(sh(O)?"exponential":"interval");if(ne||O.type==="padding"){const Ar=ne?_r.parse:In.parse;(K=Ae({},K)).stops&&(K.stops=K.stops.map(Pr=>[Pr[0],Ar(Pr[1])])),K.default=Ar(K.default?K.default:O.default)}if(K.colorSpace&&(st=K.colorSpace)!=="rgb"&&st!=="hcl"&&st!=="lab")throw new Error(`Unknown color space: "${K.colorSpace}"`);var st;let Mt,Ut,nr;if(rt==="exponential")Mt=vh;else if(rt==="interval")Mt=mc;else if(rt==="categorical"){Mt=ph,Ut=Object.create(null);for(const Ar of K.stops)Ut[Ar[0]]=Ar[1];nr=typeof K.stops[0][0]}else{if(rt!=="identity")throw new Error(`Unknown function type "${rt}"`);Mt=du}if(Se){const Ar={},Pr=[];for(let Tn=0;TnTn[0]),evaluate:({zoom:Tn},Dn)=>vh({stops:en,base:K.base},O,Tn).evaluate(Tn,Dn)}}if(Ge){const Ar=rt==="exponential"?{name:"exponential",base:K.base!==void 0?K.base:1}:null;return{kind:"camera",interpolationType:Ar,interpolationFactor:wi.interpolationFactor.bind(void 0,Ar),zoomStops:K.stops.map(Pr=>Pr[0]),evaluate:({zoom:Pr})=>Mt(K,O,Pr,Ut,nr)}}return{kind:"source",evaluate(Ar,Pr){const en=Pr&&Pr.properties?Pr.properties[K.property]:void 0;return en===void 0?Uf(K.default,O.default):Mt(K,O,en,Ut,nr)}}}function Uf(K,O,ne){return K!==void 0?K:O!==void 0?O:ne!==void 0?ne:void 0}function ph(K,O,ne,Se,Ge){return Uf(typeof ne===Ge?Se[ne]:void 0,K.default,O.default)}function mc(K,O,ne){if(Dl(ne)!=="number")return Uf(K.default,O.default);const Se=K.stops.length;if(Se===1||ne<=K.stops[0][0])return K.stops[0][1];if(ne>=K.stops[Se-1][0])return K.stops[Se-1][1];const Ge=bn(K.stops.map(rt=>rt[0]),ne);return K.stops[Ge][1]}function vh(K,O,ne){const Se=K.base!==void 0?K.base:1;if(Dl(ne)!=="number")return Uf(K.default,O.default);const Ge=K.stops.length;if(Ge===1||ne<=K.stops[0][0])return K.stops[0][1];if(ne>=K.stops[Ge-1][0])return K.stops[Ge-1][1];const rt=bn(K.stops.map(Ar=>Ar[0]),ne),st=function(Ar,Pr,en,fn){const Tn=fn-en,Dn=Ar-en;return Tn===0?0:Pr===1?Dn/Tn:(Math.pow(Pr,Dn)-1)/(Math.pow(Pr,Tn)-1)}(ne,Se,K.stops[rt][0],K.stops[rt+1][0]),Mt=K.stops[rt][1],Ut=K.stops[rt+1][1],nr=So[O.type]||Oh;return typeof Mt.evaluate=="function"?{evaluate(...Ar){const Pr=Mt.evaluate.apply(void 0,Ar),en=Ut.evaluate.apply(void 0,Ar);if(Pr!==void 0&&en!==void 0)return nr(Pr,en,st,K.colorSpace)}}:nr(Mt,Ut,st,K.colorSpace)}function du(K,O,ne){switch(O.type){case"color":ne=_r.parse(ne);break;case"formatted":ne=Mn.fromString(ne.toString());break;case"resolvedImage":ne=Ma.fromString(ne.toString());break;case"padding":ne=In.parse(ne);break;default:Dl(ne)===O.type||O.type==="enum"&&O.values[ne]||(ne=void 0)}return Uf(ne,K.default,O.default)}Nu.register(Nf,{error:[{kind:"error"},[$t],(K,[O])=>{throw new Vt(O.evaluate(K))}],typeof:[$t,[Nr],(K,[O])=>ct(na(O.evaluate(K)))],"to-rgba":[Qe(vt,4),[lr],(K,[O])=>{const[ne,Se,Ge,rt]=O.evaluate(K).rgb;return[255*ne,255*Se,255*Ge,rt]}],rgb:[lr,[vt,vt,vt],Eh],rgba:[lr,[vt,vt,vt,vt],Eh],has:{type:Yt,overloads:[[[$t],(K,[O])=>fh(O.evaluate(K),K.properties())],[[$t,dr],(K,[O,ne])=>fh(O.evaluate(K),ne.evaluate(K))]]},get:{type:Nr,overloads:[[[$t],(K,[O])=>Bf(O.evaluate(K),K.properties())],[[$t,dr],(K,[O,ne])=>Bf(O.evaluate(K),ne.evaluate(K))]]},"feature-state":[Nr,[$t],(K,[O])=>Bf(O.evaluate(K),K.featureState||{})],properties:[dr,[],K=>K.properties()],"geometry-type":[$t,[],K=>K.geometryType()],id:[Nr,[],K=>K.id()],zoom:[vt,[],K=>K.globals.zoom],"heatmap-density":[vt,[],K=>K.globals.heatmapDensity||0],"line-progress":[vt,[],K=>K.globals.lineProgress||0],accumulated:[Nr,[],K=>K.globals.accumulated===void 0?null:K.globals.accumulated],"+":[vt,vf(vt),(K,O)=>{let ne=0;for(const Se of O)ne+=Se.evaluate(K);return ne}],"*":[vt,vf(vt),(K,O)=>{let ne=1;for(const Se of O)ne*=Se.evaluate(K);return ne}],"-":{type:vt,overloads:[[[vt,vt],(K,[O,ne])=>O.evaluate(K)-ne.evaluate(K)],[[vt],(K,[O])=>-O.evaluate(K)]]},"/":[vt,[vt,vt],(K,[O,ne])=>O.evaluate(K)/ne.evaluate(K)],"%":[vt,[vt,vt],(K,[O,ne])=>O.evaluate(K)%ne.evaluate(K)],ln2:[vt,[],()=>Math.LN2],pi:[vt,[],()=>Math.PI],e:[vt,[],()=>Math.E],"^":[vt,[vt,vt],(K,[O,ne])=>Math.pow(O.evaluate(K),ne.evaluate(K))],sqrt:[vt,[vt],(K,[O])=>Math.sqrt(O.evaluate(K))],log10:[vt,[vt],(K,[O])=>Math.log(O.evaluate(K))/Math.LN10],ln:[vt,[vt],(K,[O])=>Math.log(O.evaluate(K))],log2:[vt,[vt],(K,[O])=>Math.log(O.evaluate(K))/Math.LN2],sin:[vt,[vt],(K,[O])=>Math.sin(O.evaluate(K))],cos:[vt,[vt],(K,[O])=>Math.cos(O.evaluate(K))],tan:[vt,[vt],(K,[O])=>Math.tan(O.evaluate(K))],asin:[vt,[vt],(K,[O])=>Math.asin(O.evaluate(K))],acos:[vt,[vt],(K,[O])=>Math.acos(O.evaluate(K))],atan:[vt,[vt],(K,[O])=>Math.atan(O.evaluate(K))],min:[vt,vf(vt),(K,O)=>Math.min(...O.map(ne=>ne.evaluate(K)))],max:[vt,vf(vt),(K,O)=>Math.max(...O.map(ne=>ne.evaluate(K)))],abs:[vt,[vt],(K,[O])=>Math.abs(O.evaluate(K))],round:[vt,[vt],(K,[O])=>{const ne=O.evaluate(K);return ne<0?-Math.round(-ne):Math.round(ne)}],floor:[vt,[vt],(K,[O])=>Math.floor(O.evaluate(K))],ceil:[vt,[vt],(K,[O])=>Math.ceil(O.evaluate(K))],"filter-==":[Yt,[$t,Nr],(K,[O,ne])=>K.properties()[O.value]===ne.value],"filter-id-==":[Yt,[Nr],(K,[O])=>K.id()===O.value],"filter-type-==":[Yt,[$t],(K,[O])=>K.geometryType()===O.value],"filter-<":[Yt,[$t,Nr],(K,[O,ne])=>{const Se=K.properties()[O.value],Ge=ne.value;return typeof Se==typeof Ge&&Se{const ne=K.id(),Se=O.value;return typeof ne==typeof Se&&ne":[Yt,[$t,Nr],(K,[O,ne])=>{const Se=K.properties()[O.value],Ge=ne.value;return typeof Se==typeof Ge&&Se>Ge}],"filter-id->":[Yt,[Nr],(K,[O])=>{const ne=K.id(),Se=O.value;return typeof ne==typeof Se&&ne>Se}],"filter-<=":[Yt,[$t,Nr],(K,[O,ne])=>{const Se=K.properties()[O.value],Ge=ne.value;return typeof Se==typeof Ge&&Se<=Ge}],"filter-id-<=":[Yt,[Nr],(K,[O])=>{const ne=K.id(),Se=O.value;return typeof ne==typeof Se&&ne<=Se}],"filter->=":[Yt,[$t,Nr],(K,[O,ne])=>{const Se=K.properties()[O.value],Ge=ne.value;return typeof Se==typeof Ge&&Se>=Ge}],"filter-id->=":[Yt,[Nr],(K,[O])=>{const ne=K.id(),Se=O.value;return typeof ne==typeof Se&&ne>=Se}],"filter-has":[Yt,[Nr],(K,[O])=>O.value in K.properties()],"filter-has-id":[Yt,[],K=>K.id()!==null&&K.id()!==void 0],"filter-type-in":[Yt,[Qe($t)],(K,[O])=>O.value.indexOf(K.geometryType())>=0],"filter-id-in":[Yt,[Qe(Nr)],(K,[O])=>O.value.indexOf(K.id())>=0],"filter-in-small":[Yt,[$t,Qe(Nr)],(K,[O,ne])=>ne.value.indexOf(K.properties()[O.value])>=0],"filter-in-large":[Yt,[$t,Qe(Nr)],(K,[O,ne])=>function(Se,Ge,rt,st){for(;rt<=st;){const Mt=rt+st>>1;if(Ge[Mt]===Se)return!0;Ge[Mt]>Se?st=Mt-1:rt=Mt+1}return!1}(K.properties()[O.value],ne.value,0,ne.value.length-1)],all:{type:Yt,overloads:[[[Yt,Yt],(K,[O,ne])=>O.evaluate(K)&&ne.evaluate(K)],[vf(Yt),(K,O)=>{for(const ne of O)if(!ne.evaluate(K))return!1;return!0}]]},any:{type:Yt,overloads:[[[Yt,Yt],(K,[O,ne])=>O.evaluate(K)||ne.evaluate(K)],[vf(Yt),(K,O)=>{for(const ne of O)if(ne.evaluate(K))return!0;return!1}]]},"!":[Yt,[Yt],(K,[O])=>!O.evaluate(K)],"is-supported-script":[Yt,[$t],(K,[O])=>{const ne=K.globals&&K.globals.isSupportedScript;return!ne||ne(O.evaluate(K))}],upcase:[$t,[$t],(K,[O])=>O.evaluate(K).toUpperCase()],downcase:[$t,[$t],(K,[O])=>O.evaluate(K).toLowerCase()],concat:[$t,vf(Nr),(K,O)=>O.map(ne=>Mi(ne.evaluate(K))).join("")],"resolved-locale":[$t,[Fr],(K,[O])=>O.evaluate(K).resolvedLocale()]});class gc{constructor(O,ne){var Se;this.expression=O,this._warningHistory={},this._evaluator=new Jr,this._defaultValue=ne?(Se=ne).type==="color"&&$f(Se.default)?new _r(0,0,0,0):Se.type==="color"?_r.parse(Se.default)||null:Se.type==="padding"?In.parse(Se.default)||null:Se.type==="variableAnchorOffsetCollection"?Ca.parse(Se.default)||null:Se.default===void 0?null:Se.default:null,this._enumValues=ne&&ne.type==="enum"?ne.values:null}evaluateWithoutErrorHandling(O,ne,Se,Ge,rt,st){return this._evaluator.globals=O,this._evaluator.feature=ne,this._evaluator.featureState=Se,this._evaluator.canonical=Ge,this._evaluator.availableImages=rt||null,this._evaluator.formattedSection=st,this.expression.evaluate(this._evaluator)}evaluate(O,ne,Se,Ge,rt,st){this._evaluator.globals=O,this._evaluator.feature=ne||null,this._evaluator.featureState=Se||null,this._evaluator.canonical=Ge,this._evaluator.availableImages=rt||null,this._evaluator.formattedSection=st||null;try{const 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 Vt(`Expected value to be one of ${Object.keys(this._enumValues).map(Ut=>JSON.stringify(Ut)).join(", ")}, but found ${JSON.stringify(Mt)} instead.`);return Mt}catch(Mt){return this._warningHistory[Mt.message]||(this._warningHistory[Mt.message]=!0,typeof console<"u"&&console.warn(Mt.message)),this._defaultValue}}}function mf(K){return Array.isArray(K)&&K.length>0&&typeof K[0]=="string"&&K[0]in Nf}function Wl(K,O){const ne=new yn(Nf,ih,[],O?function(Ge){const rt={color:lr,string:$t,number:vt,enum:$t,boolean:Yt,formatted:ln,padding:zr,resolvedImage:Xr,variableAnchorOffsetCollection:Ot};return Ge.type==="array"?Qe(rt[Ge.value]||Nr,Ge.length):rt[Ge.type]}(O):void 0),Se=ne.parse(K,void 0,void 0,void 0,O&&O.type==="string"?{typeAnnotation:"coerce"}:void 0);return Se?nf(new gc(Se,O)):Gc(ne.errors)}class af{constructor(O,ne){this.kind=O,this._styleExpression=ne,this.isStateDependent=O!=="constant"&&!zc(ne.expression)}evaluateWithoutErrorHandling(O,ne,Se,Ge,rt,st){return this._styleExpression.evaluateWithoutErrorHandling(O,ne,Se,Ge,rt,st)}evaluate(O,ne,Se,Ge,rt,st){return this._styleExpression.evaluate(O,ne,Se,Ge,rt,st)}}class ac{constructor(O,ne,Se,Ge){this.kind=O,this.zoomStops=Se,this._styleExpression=ne,this.isStateDependent=O!=="camera"&&!zc(ne.expression),this.interpolationType=Ge}evaluateWithoutErrorHandling(O,ne,Se,Ge,rt,st){return this._styleExpression.evaluateWithoutErrorHandling(O,ne,Se,Ge,rt,st)}evaluate(O,ne,Se,Ge,rt,st){return this._styleExpression.evaluate(O,ne,Se,Ge,rt,st)}interpolationFactor(O,ne,Se){return this.interpolationType?wi.interpolationFactor(this.interpolationType,O,ne,Se):0}}function yc(K,O){const ne=Wl(K,O);if(ne.result==="error")return ne;const Se=ne.value.expression,Ge=oh(Se);if(!Ge&&!Bu(O))return Gc([new Ke("","data expressions not supported")]);const rt=hh(Se,["zoom"]);if(!rt&&!Af(O))return Gc([new Ke("","zoom expressions not supported")]);const st=Cf(Se);return st||rt?st instanceof Ke?Gc([st]):st instanceof wi&&!sh(O)?Gc([new Ke("",'"interpolate" expressions cannot be used with this property')]):nf(st?new ac(Ge?"camera":"composite",ne.value,st.labels,st instanceof wi?st.interpolation:void 0):new af(Ge?"constant":"source",ne.value)):Gc([new Ke("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class nu{constructor(O,ne){this._parameters=O,this._specification=ne,Ae(this,dh(this._parameters,this._specification))}static deserialize(O){return new nu(O._parameters,O._specification)}static serialize(O){return{_parameters:O._parameters,_specification:O._specification}}}function Cf(K){let O=null;if(K instanceof cn)O=Cf(K.result);else if(K instanceof jo){for(const ne of K.args)if(O=Cf(ne),O)break}else(K instanceof $n||K instanceof wi)&&K.input instanceof Nu&&K.input.name==="zoom"&&(O=K);return O instanceof Ke||K.eachChild(ne=>{const Se=Cf(ne);Se instanceof Ke?O=Se:!O&&Se?O=new Ke("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):O&&Se&&O!==Se&&(O=new Ke("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),O}function Hc(K){if(K===!0||K===!1)return!0;if(!Array.isArray(K)||K.length===0)return!1;switch(K[0]){case"has":return K.length>=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(const O of K.slice(1))if(!Hc(O)&&typeof O!="boolean")return!1;return!0;default:return!0}}const gf={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Wf(K){if(K==null)return{filter:()=>!0,needGeometry:!1};Hc(K)||(K=Pf(K));const O=Wl(K,gf);if(O.result==="error")throw new Error(O.value.map(ne=>`${ne.key}: ${ne.message}`).join(", "));return{filter:(ne,Se,Ge)=>O.value.evaluate(ne,Se,{},Ge),needGeometry:td(K)}}function zh(K,O){return KO?1:0}function td(K){if(!Array.isArray(K))return!1;if(K[0]==="within"||K[0]==="distance")return!0;for(let O=1;O"||O==="<="||O===">="?Yf(K[1],K[2],O):O==="any"?(ne=K.slice(1),["any"].concat(ne.map(Pf))):O==="all"?["all"].concat(K.slice(1).map(Pf)):O==="none"?["all"].concat(K.slice(1).map(Pf).map($u)):O==="in"?Ec(K[1],K.slice(2)):O==="!in"?$u(Ec(K[1],K.slice(2))):O==="has"?Xf(K[1]):O!=="!has"||$u(Xf(K[1]));var ne}function Yf(K,O,ne){switch(K){case"$type":return[`filter-type-${ne}`,O];case"$id":return[`filter-id-${ne}`,O];default:return[`filter-${ne}`,K,O]}}function Ec(K,O){if(O.length===0)return!1;switch(K){case"$type":return["filter-type-in",["literal",O]];case"$id":return["filter-id-in",["literal",O]];default:return O.length>200&&!O.some(ne=>typeof ne!=typeof O[0])?["filter-in-large",K,["literal",O.sort(zh)]]:["filter-in-small",K,["literal",O]]}}function Xf(K){switch(K){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",K]}}function $u(K){return["!",K]}function Lf(K){const O=typeof K;if(O==="number"||O==="boolean"||O==="string"||K==null)return JSON.stringify(K);if(Array.isArray(K)){let Ge="[";for(const rt of K)Ge+=`${Lf(rt)},`;return`${Ge}]`}const ne=Object.keys(K).sort();let Se="{";for(let Ge=0;GeSe.maximum?[new ze(O,ne,`${ne} is greater than the maximum value ${Se.maximum}`)]:[]}function jf(K){const O=K.valueSpec,ne=Zl(K.value.type);let Se,Ge,rt,st={};const Mt=ne!=="categorical"&&K.value.property===void 0,Ut=!Mt,nr=Dl(K.value.stops)==="array"&&Dl(K.value.stops[0])==="array"&&Dl(K.value.stops[0][0])==="object",Ar=Fc({key:K.key,value:K.value,valueSpec:K.styleSpec.function,validateSpec:K.validateSpec,style:K.style,styleSpec:K.styleSpec,objectElementValidators:{stops:function(fn){if(ne==="identity")return[new ze(fn.key,fn.value,'identity function may not have a "stops" property')];let Tn=[];const Dn=fn.value;return Tn=Tn.concat(lh({key:fn.key,value:Dn,valueSpec:fn.valueSpec,validateSpec:fn.validateSpec,style:fn.style,styleSpec:fn.styleSpec,arrayElementValidator:Pr})),Dl(Dn)==="array"&&Dn.length===0&&Tn.push(new ze(fn.key,Dn,"array must have at least one stop")),Tn},default:function(fn){return fn.validateSpec({key:fn.key,value:fn.value,valueSpec:O,validateSpec:fn.validateSpec,style:fn.style,styleSpec:fn.styleSpec})}}});return ne==="identity"&&Mt&&Ar.push(new ze(K.key,K.value,'missing required property "property"')),ne==="identity"||K.value.stops||Ar.push(new ze(K.key,K.value,'missing required property "stops"')),ne==="exponential"&&K.valueSpec.expression&&!sh(K.valueSpec)&&Ar.push(new ze(K.key,K.value,"exponential functions not supported")),K.styleSpec.$version>=8&&(Ut&&!Bu(K.valueSpec)?Ar.push(new ze(K.key,K.value,"property functions not supported")):Mt&&!Af(K.valueSpec)&&Ar.push(new ze(K.key,K.value,"zoom functions not supported"))),ne!=="categorical"&&!nr||K.value.property!==void 0||Ar.push(new ze(K.key,K.value,'"property" property is required')),Ar;function Pr(fn){let Tn=[];const Dn=fn.value,Kn=fn.key;if(Dl(Dn)!=="array")return[new ze(Kn,Dn,`array expected, ${Dl(Dn)} found`)];if(Dn.length!==2)return[new ze(Kn,Dn,`array length 2 expected, length ${Dn.length} found`)];if(nr){if(Dl(Dn[0])!=="object")return[new ze(Kn,Dn,`object expected, ${Dl(Dn[0])} found`)];if(Dn[0].zoom===void 0)return[new ze(Kn,Dn,"object stop key must have zoom")];if(Dn[0].value===void 0)return[new ze(Kn,Dn,"object stop key must have value")];if(rt&&rt>Zl(Dn[0].zoom))return[new ze(Kn,Dn[0].zoom,"stop zoom values must appear in ascending order")];Zl(Dn[0].zoom)!==rt&&(rt=Zl(Dn[0].zoom),Ge=void 0,st={}),Tn=Tn.concat(Fc({key:`${Kn}[0]`,value:Dn[0],valueSpec:{zoom:{}},validateSpec:fn.validateSpec,style:fn.style,styleSpec:fn.styleSpec,objectElementValidators:{zoom:eu,value:en}}))}else Tn=Tn.concat(en({key:`${Kn}[0]`,value:Dn[0],validateSpec:fn.validateSpec,style:fn.style,styleSpec:fn.styleSpec},Dn));return mf(_c(Dn[1]))?Tn.concat([new ze(`${Kn}[1]`,Dn[1],"expressions are not allowed in function stops.")]):Tn.concat(fn.validateSpec({key:`${Kn}[1]`,value:Dn[1],valueSpec:O,validateSpec:fn.validateSpec,style:fn.style,styleSpec:fn.styleSpec}))}function en(fn,Tn){const Dn=Dl(fn.value),Kn=Zl(fn.value),ka=fn.value!==null?fn.value:Tn;if(Se){if(Dn!==Se)return[new ze(fn.key,ka,`${Dn} stop domain type must match previous stop domain type ${Se}`)]}else Se=Dn;if(Dn!=="number"&&Dn!=="string"&&Dn!=="boolean")return[new ze(fn.key,ka,"stop domain value must be a number, string, or boolean")];if(Dn!=="number"&&ne!=="categorical"){let _i=`number expected, ${Dn} found`;return Bu(O)&&ne===void 0&&(_i+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ze(fn.key,ka,_i)]}return ne!=="categorical"||Dn!=="number"||isFinite(Kn)&&Math.floor(Kn)===Kn?ne!=="categorical"&&Dn==="number"&&Ge!==void 0&&Knnew ze(`${K.key}${Se.key}`,K.value,Se.message));const ne=O.value.expression||O.value._styleExpression.expression;if(K.expressionContext==="property"&&K.propertyKey==="text-font"&&!ne.outputDefined())return[new ze(K.key,K.value,`Invalid data expression for "${K.propertyKey}". Output values must be contained as literals within the expression.`)];if(K.expressionContext==="property"&&K.propertyType==="layout"&&!zc(ne))return[new ze(K.key,K.value,'"feature-state" data expressions are not supported with layout properties.')];if(K.expressionContext==="filter"&&!zc(ne))return[new ze(K.key,K.value,'"feature-state" data expressions are not supported with filters.')];if(K.expressionContext&&K.expressionContext.indexOf("cluster")===0){if(!hh(ne,["zoom","feature-state"]))return[new ze(K.key,K.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(K.expressionContext==="cluster-initial"&&!oh(ne))return[new ze(K.key,K.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function kc(K){const O=K.key,ne=K.value,Se=K.valueSpec,Ge=[];return Array.isArray(Se.values)?Se.values.indexOf(Zl(ne))===-1&&Ge.push(new ze(O,ne,`expected one of [${Se.values.join(", ")}], ${JSON.stringify(ne)} found`)):Object.keys(Se.values).indexOf(Zl(ne))===-1&&Ge.push(new ze(O,ne,`expected one of [${Object.keys(Se.values).join(", ")}], ${JSON.stringify(ne)} found`)),Ge}function Vf(K){return Hc(_c(K.value))?yf(Ae({},K,{expressionContext:"filter",valueSpec:{value:"boolean"}})):$c(K)}function $c(K){const O=K.value,ne=K.key;if(Dl(O)!=="array")return[new ze(ne,O,`array expected, ${Dl(O)} found`)];const Se=K.styleSpec;let Ge,rt=[];if(O.length<1)return[new ze(ne,O,"filter array must have at least 1 element")];switch(rt=rt.concat(kc({key:`${ne}[0]`,value:O[0],valueSpec:Se.filter_operator,style:K.style,styleSpec:K.styleSpec})),Zl(O[0])){case"<":case"<=":case">":case">=":O.length>=2&&Zl(O[1])==="$type"&&rt.push(new ze(ne,O,`"$type" cannot be use with operator "${O[0]}"`));case"==":case"!=":O.length!==3&&rt.push(new ze(ne,O,`filter array for operator "${O[0]}" must have 3 elements`));case"in":case"!in":O.length>=2&&(Ge=Dl(O[1]),Ge!=="string"&&rt.push(new ze(`${ne}[1]`,O[1],`string expected, ${Ge} found`)));for(let st=2;st{nr in ne&&O.push(new ze(Se,ne[nr],`"${nr}" is prohibited for ref layers`))}),Ge.layers.forEach(nr=>{Zl(nr.id)===Mt&&(Ut=nr)}),Ut?Ut.ref?O.push(new ze(Se,ne.ref,"ref cannot reference another ref layer")):st=Zl(Ut.type):O.push(new ze(Se,ne.ref,`ref layer "${Mt}" not found`))}else if(st!=="background")if(ne.source){const Ut=Ge.sources&&Ge.sources[ne.source],nr=Ut&&Zl(Ut.type);Ut?nr==="vector"&&st==="raster"?O.push(new ze(Se,ne.source,`layer "${ne.id}" requires a raster source`)):nr!=="raster-dem"&&st==="hillshade"?O.push(new ze(Se,ne.source,`layer "${ne.id}" requires a raster-dem source`)):nr==="raster"&&st!=="raster"?O.push(new ze(Se,ne.source,`layer "${ne.id}" requires a vector source`)):nr!=="vector"||ne["source-layer"]?nr==="raster-dem"&&st!=="hillshade"?O.push(new ze(Se,ne.source,"raster-dem source can only be used with layer type 'hillshade'.")):st!=="line"||!ne.paint||!ne.paint["line-gradient"]||nr==="geojson"&&Ut.lineMetrics||O.push(new ze(Se,ne,`layer "${ne.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):O.push(new ze(Se,ne,`layer "${ne.id}" must specify a "source-layer"`)):O.push(new ze(Se,ne.source,`source "${ne.source}" not found`))}else O.push(new ze(Se,ne,'missing required property "source"'));return O=O.concat(Fc({key:Se,value:ne,valueSpec:rt.layer,style:K.style,styleSpec:K.styleSpec,validateSpec:K.validateSpec,objectElementValidators:{"*":()=>[],type:()=>K.validateSpec({key:`${Se}.type`,value:ne.type,valueSpec:rt.layer.type,style:K.style,styleSpec:K.styleSpec,validateSpec:K.validateSpec,object:ne,objectKey:"type"}),filter:Vf,layout:Ut=>Fc({layer:ne,key:Ut.key,value:Ut.value,style:Ut.style,styleSpec:Ut.styleSpec,validateSpec:Ut.validateSpec,objectElementValidators:{"*":nr=>Xu(Ae({layerType:st},nr))}}),paint:Ut=>Fc({layer:ne,key:Ut.key,value:Ut.value,style:Ut.style,styleSpec:Ut.styleSpec,validateSpec:Ut.validateSpec,objectElementValidators:{"*":nr=>Fh(Ae({layerType:st},nr))}})}})),O}function Cc(K){const O=K.value,ne=K.key,Se=Dl(O);return Se!=="string"?[new ze(ne,O,`string expected, ${Se} found`)]:[]}const of={promoteId:function({key:K,value:O}){if(Dl(O)==="string")return Cc({key:K,value:O});{const ne=[];for(const Se in O)ne.push(...Cc({key:`${K}.${Se}`,value:O[Se]}));return ne}}};function Wc(K){const O=K.value,ne=K.key,Se=K.styleSpec,Ge=K.style,rt=K.validateSpec;if(!O.type)return[new ze(ne,O,'"type" is required')];const st=Zl(O.type);let Mt;switch(st){case"vector":case"raster":return Mt=Fc({key:ne,value:O,valueSpec:Se[`source_${st.replace("-","_")}`],style:K.style,styleSpec:Se,objectElementValidators:of,validateSpec:rt}),Mt;case"raster-dem":return Mt=function(Ut){var nr;const Ar=(nr=Ut.sourceName)!==null&&nr!==void 0?nr:"",Pr=Ut.value,en=Ut.styleSpec,fn=en.source_raster_dem,Tn=Ut.style;let Dn=[];const Kn=Dl(Pr);if(Pr===void 0)return Dn;if(Kn!=="object")return Dn.push(new ze("source_raster_dem",Pr,`object expected, ${Kn} found`)),Dn;const ka=Zl(Pr.encoding)==="custom",_i=["redFactor","greenFactor","blueFactor","baseShift"],Ka=Ut.value.encoding?`"${Ut.value.encoding}"`:"Default";for(const di in Pr)!ka&&_i.includes(di)?Dn.push(new ze(di,Pr[di],`In "${Ar}": "${di}" is only valid when "encoding" is set to "custom". ${Ka} encoding found`)):fn[di]?Dn=Dn.concat(Ut.validateSpec({key:di,value:Pr[di],valueSpec:fn[di],validateSpec:Ut.validateSpec,style:Tn,styleSpec:en})):Dn.push(new ze(di,Pr[di],`unknown property "${di}"`));return Dn}({sourceName:ne,value:O,style:K.style,styleSpec:Se,validateSpec:rt}),Mt;case"geojson":if(Mt=Fc({key:ne,value:O,valueSpec:Se.source_geojson,style:Ge,styleSpec:Se,validateSpec:rt,objectElementValidators:of}),O.cluster)for(const Ut in O.clusterProperties){const[nr,Ar]=O.clusterProperties[Ut],Pr=typeof nr=="string"?[nr,["accumulated"],["get",Ut]]:nr;Mt.push(...yf({key:`${ne}.${Ut}.map`,value:Ar,expressionContext:"cluster-map"})),Mt.push(...yf({key:`${ne}.${Ut}.reduce`,value:Pr,expressionContext:"cluster-reduce"}))}return Mt;case"video":return Fc({key:ne,value:O,valueSpec:Se.source_video,style:Ge,validateSpec:rt,styleSpec:Se});case"image":return Fc({key:ne,value:O,valueSpec:Se.source_image,style:Ge,validateSpec:rt,styleSpec:Se});case"canvas":return[new ze(ne,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return kc({key:`${ne}.type`,value:O.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function gu(K){const O=K.value,ne=K.styleSpec,Se=ne.light,Ge=K.style;let rt=[];const st=Dl(O);if(O===void 0)return rt;if(st!=="object")return rt=rt.concat([new ze("light",O,`object expected, ${st} found`)]),rt;for(const Mt in O){const Ut=Mt.match(/^(.*)-transition$/);rt=rt.concat(Ut&&Se[Ut[1]]&&Se[Ut[1]].transition?K.validateSpec({key:Mt,value:O[Mt],valueSpec:ne.transition,validateSpec:K.validateSpec,style:Ge,styleSpec:ne}):Se[Mt]?K.validateSpec({key:Mt,value:O[Mt],valueSpec:Se[Mt],validateSpec:K.validateSpec,style:Ge,styleSpec:ne}):[new ze(Mt,O[Mt],`unknown property "${Mt}"`)])}return rt}function uc(K){const O=K.value,ne=K.styleSpec,Se=ne.sky,Ge=K.style,rt=Dl(O);if(O===void 0)return[];if(rt!=="object")return[new ze("sky",O,`object expected, ${rt} found`)];let st=[];for(const Mt in O)st=st.concat(Se[Mt]?K.validateSpec({key:Mt,value:O[Mt],valueSpec:Se[Mt],style:Ge,styleSpec:ne}):[new ze(Mt,O[Mt],`unknown property "${Mt}"`)]);return st}function lu(K){const O=K.value,ne=K.styleSpec,Se=ne.terrain,Ge=K.style;let rt=[];const st=Dl(O);if(O===void 0)return rt;if(st!=="object")return rt=rt.concat([new ze("terrain",O,`object expected, ${st} found`)]),rt;for(const Mt in O)rt=rt.concat(Se[Mt]?K.validateSpec({key:Mt,value:O[Mt],valueSpec:Se[Mt],validateSpec:K.validateSpec,style:Ge,styleSpec:ne}):[new ze(Mt,O[Mt],`unknown property "${Mt}"`)]);return rt}function _f(K){let O=[];const ne=K.value,Se=K.key;if(Array.isArray(ne)){const Ge=[],rt=[];for(const st in ne)ne[st].id&&Ge.includes(ne[st].id)&&O.push(new ze(Se,ne,`all the sprites' ids must be unique, but ${ne[st].id} is duplicated`)),Ge.push(ne[st].id),ne[st].url&&rt.includes(ne[st].url)&&O.push(new ze(Se,ne,`all the sprites' URLs must be unique, but ${ne[st].url} is duplicated`)),rt.push(ne[st].url),O=O.concat(Fc({key:`${Se}[${st}]`,value:ne[st],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:K.validateSpec}));return O}return Cc({key:Se,value:ne})}const Yc={"*":()=>[],array:lh,boolean:function(K){const O=K.value,ne=K.key,Se=Dl(O);return Se!=="boolean"?[new ze(ne,O,`boolean expected, ${Se} found`)]:[]},number:eu,color:function(K){const O=K.key,ne=K.value,Se=Dl(ne);return Se!=="string"?[new ze(O,ne,`color expected, ${Se} found`)]:_r.parse(String(ne))?[]:[new ze(O,ne,`color expected, "${ne}" found`)]},constants:Df,enum:kc,filter:Vf,function:jf,layer:gh,object:Fc,source:Wc,light:gu,sky:uc,terrain:lu,projection:function(K){const O=K.value,ne=K.styleSpec,Se=ne.projection,Ge=K.style,rt=Dl(O);if(O===void 0)return[];if(rt!=="object")return[new ze("projection",O,`object expected, ${rt} found`)];let st=[];for(const Mt in O)st=st.concat(Se[Mt]?K.validateSpec({key:Mt,value:O[Mt],valueSpec:Se[Mt],style:Ge,styleSpec:ne}):[new ze(Mt,O[Mt],`unknown property "${Mt}"`)]);return st},string:Cc,formatted:function(K){return Cc(K).length===0?[]:yf(K)},resolvedImage:function(K){return Cc(K).length===0?[]:yf(K)},padding:function(K){const O=K.key,ne=K.value;if(Dl(ne)==="array"){if(ne.length<1||ne.length>4)return[new ze(O,ne,`padding requires 1 to 4 values; ${ne.length} values found`)];const Se={type:"number"};let Ge=[];for(let rt=0;rt[]}})),K.constants&&(ne=ne.concat(Df({key:"constants",value:K.constants}))),vn(ne)}function An(K){return function(O){return K(He(we({},O),{validateSpec:uh}))}}function vn(K){return[].concat(K).sort((O,ne)=>O.line-ne.line)}function Xn(K){return function(...O){return vn(K.apply(this,O))}}qr.source=Xn(An(Wc)),qr.sprite=Xn(An(_f)),qr.glyphs=Xn(An(br)),qr.light=Xn(An(gu)),qr.sky=Xn(An(uc)),qr.terrain=Xn(An(lu)),qr.layer=Xn(An(gh)),qr.filter=Xn(An(Vf)),qr.paintProperty=Xn(An(Fh)),qr.layoutProperty=Xn(An(Xu));const Na=qr,Ra=Na.light,pi=Na.sky,xi=Na.paintProperty,$i=Na.layoutProperty;function ni(K,O){let ne=!1;if(O&&O.length)for(const Se of O)K.fire(new Y(new Error(Se.message))),ne=!0;return ne}class Ii{constructor(O,ne,Se){const Ge=this.cells=[];if(O instanceof ArrayBuffer){this.arrayBuffer=O;const st=new Int32Array(this.arrayBuffer);O=st[0],this.d=(ne=st[1])+2*(Se=st[2]);for(let Ut=0;Ut=Pr[Tn+0]&&Ge>=Pr[Tn+1])?(Mt[fn]=!0,st.push(Ar[fn])):Mt[fn]=!1}}}}_forEachCell(O,ne,Se,Ge,rt,st,Mt,Ut){const nr=this._convertToCellCoord(O),Ar=this._convertToCellCoord(ne),Pr=this._convertToCellCoord(Se),en=this._convertToCellCoord(Ge);for(let fn=nr;fn<=Pr;fn++)for(let Tn=Ar;Tn<=en;Tn++){const Dn=this.d*Tn+fn;if((!Ut||Ut(this._convertFromCellCoord(fn),this._convertFromCellCoord(Tn),this._convertFromCellCoord(fn+1),this._convertFromCellCoord(Tn+1)))&&rt.call(this,O,ne,Se,Ge,Dn,st,Mt,Ut))return}}_convertFromCellCoord(O){return(O-this.padding)/this.scale}_convertToCellCoord(O){return Math.max(0,Math.min(this.d-1,Math.floor(O*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const O=this.cells,ne=3+this.cells.length+1+1;let Se=0;for(let st=0;st=0)continue;const st=K[rt];Ge[rt]=hi[ne].shallow.indexOf(rt)>=0?st:Vo(st,O)}K instanceof Error&&(Ge.message=K.message)}if(Ge.$name)throw new Error("$name property is reserved for worker serialization logic.");return ne!=="Object"&&(Ge.$name=ne),Ge}function Bo(K){if(Io(K))return K;if(Array.isArray(K))return K.map(Bo);if(typeof K!="object")throw new Error("can't deserialize object of type "+typeof K);const O=zo(K)||"Object";if(!hi[O])throw new Error(`can't deserialize unregistered class ${O}`);const{klass:ne}=hi[O];if(!ne)throw new Error(`can't deserialize unregistered class ${O}`);if(ne.deserialize)return ne.deserialize(K);const Se=Object.create(ne.prototype);for(const Ge of Object.keys(K)){if(Ge==="$name")continue;const rt=K[Ge];Se[Ge]=hi[O].shallow.indexOf(Ge)>=0?rt:Bo(rt)}return Se}class ro{constructor(){this.first=!0}update(O,ne){const Se=Math.floor(O);return this.first?(this.first=!1,this.lastIntegerZoom=Se,this.lastIntegerZoomTime=0,this.lastZoom=O,this.lastFloorZoom=Se,!0):(this.lastFloorZoom>Se?(this.lastIntegerZoom=Se+1,this.lastIntegerZoomTime=ne):this.lastFloorZoomK>=128&&K<=255,"Hangul Jamo":K=>K>=4352&&K<=4607,Khmer:K=>K>=6016&&K<=6143,"General Punctuation":K=>K>=8192&&K<=8303,"Letterlike Symbols":K=>K>=8448&&K<=8527,"Number Forms":K=>K>=8528&&K<=8591,"Miscellaneous Technical":K=>K>=8960&&K<=9215,"Control Pictures":K=>K>=9216&&K<=9279,"Optical Character Recognition":K=>K>=9280&&K<=9311,"Enclosed Alphanumerics":K=>K>=9312&&K<=9471,"Geometric Shapes":K=>K>=9632&&K<=9727,"Miscellaneous Symbols":K=>K>=9728&&K<=9983,"Miscellaneous Symbols and Arrows":K=>K>=11008&&K<=11263,"Ideographic Description Characters":K=>K>=12272&&K<=12287,"CJK Symbols and Punctuation":K=>K>=12288&&K<=12351,Katakana:K=>K>=12448&&K<=12543,Kanbun:K=>K>=12688&&K<=12703,"CJK Strokes":K=>K>=12736&&K<=12783,"Enclosed CJK Letters and Months":K=>K>=12800&&K<=13055,"CJK Compatibility":K=>K>=13056&&K<=13311,"Yijing Hexagram Symbols":K=>K>=19904&&K<=19967,"Private Use Area":K=>K>=57344&&K<=63743,"Vertical Forms":K=>K>=65040&&K<=65055,"CJK Compatibility Forms":K=>K>=65072&&K<=65103,"Small Form Variants":K=>K>=65104&&K<=65135,"Halfwidth and Fullwidth Forms":K=>K>=65280&&K<=65519};function ns(K){for(const O of K)if(Ks(O.charCodeAt(0)))return!0;return!1}function Os(K){for(const O of K)if(!_l(O.charCodeAt(0)))return!1;return!0}function yl(K){const O=K.map(ne=>{try{return new RegExp(`\\p{sc=${ne}}`,"u").source}catch{return null}}).filter(ne=>ne);return new RegExp(O.join("|"),"u")}const jl=yl(["Arab","Dupl","Mong","Ougr","Syrc"]);function _l(K){return!jl.test(String.fromCodePoint(K))}const Vl=yl(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Ks(K){return!(K!==746&&K!==747&&(K<4352||!(Ni["CJK Compatibility Forms"](K)&&!(K>=65097&&K<=65103)||Ni["CJK Compatibility"](K)||Ni["CJK Strokes"](K)||!(!Ni["CJK Symbols and Punctuation"](K)||K>=12296&&K<=12305||K>=12308&&K<=12319||K===12336)||Ni["Enclosed CJK Letters and Months"](K)||Ni["Ideographic Description Characters"](K)||Ni.Kanbun(K)||Ni.Katakana(K)&&K!==12540||!(!Ni["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)||!(!Ni["Small Form Variants"](K)||K>=65112&&K<=65118||K>=65123&&K<=65126)||Ni["Vertical Forms"](K)||Ni["Yijing Hexagram Symbols"](K)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(K))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(K))||Vl.test(String.fromCodePoint(K)))))}function xu(K){return!(Ks(K)||function(O){return!!(Ni["Latin-1 Supplement"](O)&&(O===167||O===169||O===174||O===177||O===188||O===189||O===190||O===215||O===247)||Ni["General Punctuation"](O)&&(O===8214||O===8224||O===8225||O===8240||O===8241||O===8251||O===8252||O===8258||O===8263||O===8264||O===8265||O===8273)||Ni["Letterlike Symbols"](O)||Ni["Number Forms"](O)||Ni["Miscellaneous Technical"](O)&&(O>=8960&&O<=8967||O>=8972&&O<=8991||O>=8996&&O<=9e3||O===9003||O>=9085&&O<=9114||O>=9150&&O<=9165||O===9167||O>=9169&&O<=9179||O>=9186&&O<=9215)||Ni["Control Pictures"](O)&&O!==9251||Ni["Optical Character Recognition"](O)||Ni["Enclosed Alphanumerics"](O)||Ni["Geometric Shapes"](O)||Ni["Miscellaneous Symbols"](O)&&!(O>=9754&&O<=9759)||Ni["Miscellaneous Symbols and Arrows"](O)&&(O>=11026&&O<=11055||O>=11088&&O<=11097||O>=11192&&O<=11243)||Ni["CJK Symbols and Punctuation"](O)||Ni.Katakana(O)||Ni["Private Use Area"](O)||Ni["CJK Compatibility Forms"](O)||Ni["Small Form Variants"](O)||Ni["Halfwidth and Fullwidth Forms"](O)||O===8734||O===8756||O===8757||O>=9984&&O<=10087||O>=10102&&O<=10131||O===65532||O===65533)}(K))}const yu=yl(["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 Fl(K){return yu.test(String.fromCodePoint(K))}function bo(K,O){return!(!O&&Fl(K)||K>=2304&&K<=3583||K>=3840&&K<=4255||Ni.Khmer(K))}function ms(K){for(const O of K)if(Fl(O.charCodeAt(0)))return!0;return!1}const Cl=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(K){this.pluginStatus=K.pluginStatus,this.pluginURL=K.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(K){this.applyArabicShaping=K.applyArabicShaping,this.processBidirectionalText=K.processBidirectionalText,this.processStyledBidirectionalText=K.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class cl{constructor(O,ne){this.zoom=O,ne?(this.now=ne.now,this.fadeDuration=ne.fadeDuration,this.zoomHistory=ne.zoomHistory,this.transition=ne.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ro,this.transition={})}isSupportedScript(O){return function(ne,Se){for(const Ge of ne)if(!bo(Ge.charCodeAt(0),Se))return!1;return!0}(O,Cl.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const O=this.zoom,ne=O-Math.floor(O),Se=this.crossFadingFactor();return O>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:ne+(1-ne)*Se}:{fromScale:.5,toScale:1,t:1-(1-Se)*ne}}}class ic{constructor(O,ne){this.property=O,this.value=ne,this.expression=function(Se,Ge){if($f(Se))return new nu(Se,Ge);if(mf(Se)){const rt=yc(Se,Ge);if(rt.result==="error")throw new Error(rt.value.map(st=>`${st.key}: ${st.message}`).join(", "));return rt.value}{let rt=Se;return Ge.type==="color"&&typeof Se=="string"?rt=_r.parse(Se):Ge.type!=="padding"||typeof Se!="number"&&!Array.isArray(Se)?Ge.type==="variableAnchorOffsetCollection"&&Array.isArray(Se)&&(rt=Ca.parse(Se)):rt=In.parse(Se),{kind:"constant",evaluate:()=>rt}}}(ne===void 0?O.specification.default:ne,O.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(O,ne,Se){return this.property.possiblyEvaluate(this,O,ne,Se)}}class oc{constructor(O){this.property=O,this.value=new ic(O,void 0)}transitioned(O,ne){return new Sf(this.property,this.value,ne,E({},O.transition,this.transition),O.now)}untransitioned(){return new Sf(this.property,this.value,null,{},0)}}class cc{constructor(O){this._properties=O,this._values=Object.create(O.defaultTransitionablePropertyValues)}getValue(O){return u(this._values[O].value.value)}setValue(O,ne){Object.prototype.hasOwnProperty.call(this._values,O)||(this._values[O]=new oc(this._values[O].property)),this._values[O].value=new ic(this._values[O].property,ne===null?void 0:u(ne))}getTransition(O){return u(this._values[O].transition)}setTransition(O,ne){Object.prototype.hasOwnProperty.call(this._values,O)||(this._values[O]=new oc(this._values[O].property)),this._values[O].transition=u(ne)||void 0}serialize(){const O={};for(const ne of Object.keys(this._values)){const Se=this.getValue(ne);Se!==void 0&&(O[ne]=Se);const Ge=this.getTransition(ne);Ge!==void 0&&(O[`${ne}-transition`]=Ge)}return O}transitioned(O,ne){const Se=new sc(this._properties);for(const Ge of Object.keys(this._values))Se._values[Ge]=this._values[Ge].transitioned(O,ne._values[Ge]);return Se}untransitioned(){const O=new sc(this._properties);for(const ne of Object.keys(this._values))O._values[ne]=this._values[ne].untransitioned();return O}}class Sf{constructor(O,ne,Se,Ge,rt){this.property=O,this.value=ne,this.begin=rt+Ge.delay||0,this.end=this.begin+Ge.duration||0,O.specification.transition&&(Ge.delay||Ge.duration)&&(this.prior=Se)}possiblyEvaluate(O,ne,Se){const Ge=O.now||0,rt=this.value.possiblyEvaluate(O,ne,Se),st=this.prior;if(st){if(Ge>this.end)return this.prior=null,rt;if(this.value.isDataDriven())return this.prior=null,rt;if(Ge=1)return 1;const nr=Ut*Ut,Ar=nr*Ut;return 4*(Ut<.5?Ar:3*(Ut-nr)+Ar-.75)}(Mt))}}return rt}}class sc{constructor(O){this._properties=O,this._values=Object.create(O.defaultTransitioningPropertyValues)}possiblyEvaluate(O,ne,Se){const Ge=new lf(this._properties);for(const rt of Object.keys(this._values))Ge._values[rt]=this._values[rt].possiblyEvaluate(O,ne,Se);return Ge}hasTransition(){for(const O of Object.keys(this._values))if(this._values[O].prior)return!0;return!1}}class sf{constructor(O){this._properties=O,this._values=Object.create(O.defaultPropertyValues)}hasValue(O){return this._values[O].value!==void 0}getValue(O){return u(this._values[O].value)}setValue(O,ne){this._values[O]=new ic(this._values[O].property,ne===null?void 0:u(ne))}serialize(){const O={};for(const ne of Object.keys(this._values)){const Se=this.getValue(ne);Se!==void 0&&(O[ne]=Se)}return O}possiblyEvaluate(O,ne,Se){const Ge=new lf(this._properties);for(const rt of Object.keys(this._values))Ge._values[rt]=this._values[rt].possiblyEvaluate(O,ne,Se);return Ge}}class wu{constructor(O,ne,Se){this.property=O,this.value=ne,this.parameters=Se}isConstant(){return this.value.kind==="constant"}constantOr(O){return this.value.kind==="constant"?this.value.value:O}evaluate(O,ne,Se,Ge){return this.property.evaluate(this.value,this.parameters,O,ne,Se,Ge)}}class lf{constructor(O){this._properties=O,this._values=Object.create(O.defaultPossiblyEvaluatedValues)}get(O){return this._values[O]}}class qo{constructor(O){this.specification=O}possiblyEvaluate(O,ne){if(O.isDataDriven())throw new Error("Value should not be data driven");return O.expression.evaluate(ne)}interpolate(O,ne,Se){const Ge=So[this.specification.type];return Ge?Ge(O,ne,Se):O}}class as{constructor(O,ne){this.specification=O,this.overrides=ne}possiblyEvaluate(O,ne,Se,Ge){return new wu(this,O.expression.kind==="constant"||O.expression.kind==="camera"?{kind:"constant",value:O.expression.evaluate(ne,null,{},Se,Ge)}:O.expression,ne)}interpolate(O,ne,Se){if(O.value.kind!=="constant"||ne.value.kind!=="constant")return O;if(O.value.value===void 0||ne.value.value===void 0)return new wu(this,{kind:"constant",value:void 0},O.parameters);const Ge=So[this.specification.type];if(Ge){const rt=Ge(O.value.value,ne.value.value,Se);return new wu(this,{kind:"constant",value:rt},O.parameters)}return O}evaluate(O,ne,Se,Ge,rt,st){return O.kind==="constant"?O.value:O.evaluate(ne,Se,Ge,rt,st)}}class uf extends as{possiblyEvaluate(O,ne,Se,Ge){if(O.value===void 0)return new wu(this,{kind:"constant",value:void 0},ne);if(O.expression.kind==="constant"){const rt=O.expression.evaluate(ne,null,{},Se,Ge),st=O.property.specification.type==="resolvedImage"&&typeof rt!="string"?rt.name:rt,Mt=this._calculate(st,st,st,ne);return new wu(this,{kind:"constant",value:Mt},ne)}if(O.expression.kind==="camera"){const rt=this._calculate(O.expression.evaluate({zoom:ne.zoom-1}),O.expression.evaluate({zoom:ne.zoom}),O.expression.evaluate({zoom:ne.zoom+1}),ne);return new wu(this,{kind:"constant",value:rt},ne)}return new wu(this,O.expression,ne)}evaluate(O,ne,Se,Ge,rt,st){if(O.kind==="source"){const Mt=O.evaluate(ne,Se,Ge,rt,st);return this._calculate(Mt,Mt,Mt,ne)}return O.kind==="composite"?this._calculate(O.evaluate({zoom:Math.floor(ne.zoom)-1},Se,Ge),O.evaluate({zoom:Math.floor(ne.zoom)},Se,Ge),O.evaluate({zoom:Math.floor(ne.zoom)+1},Se,Ge),ne):O.value}_calculate(O,ne,Se,Ge){return Ge.zoom>Ge.zoomHistory.lastIntegerZoom?{from:O,to:ne}:{from:Se,to:ne}}interpolate(O){return O}}class Pc{constructor(O){this.specification=O}possiblyEvaluate(O,ne,Se,Ge){if(O.value!==void 0){if(O.expression.kind==="constant"){const rt=O.expression.evaluate(ne,null,{},Se,Ge);return this._calculate(rt,rt,rt,ne)}return this._calculate(O.expression.evaluate(new cl(Math.floor(ne.zoom-1),ne)),O.expression.evaluate(new cl(Math.floor(ne.zoom),ne)),O.expression.evaluate(new cl(Math.floor(ne.zoom+1),ne)),ne)}}_calculate(O,ne,Se,Ge){return Ge.zoom>Ge.zoomHistory.lastIntegerZoom?{from:O,to:ne}:{from:Se,to:ne}}interpolate(O){return O}}class bc{constructor(O){this.specification=O}possiblyEvaluate(O,ne,Se,Ge){return!!O.expression.evaluate(ne,null,{},Se,Ge)}interpolate(){return!1}}class Je{constructor(O){this.properties=O,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const ne in O){const Se=O[ne];Se.specification.overridable&&this.overridableProperties.push(ne);const Ge=this.defaultPropertyValues[ne]=new ic(Se,void 0),rt=this.defaultTransitionablePropertyValues[ne]=new oc(Se);this.defaultTransitioningPropertyValues[ne]=rt.untransitioned(),this.defaultPossiblyEvaluatedValues[ne]=Ge.possiblyEvaluate({})}}}Ja("DataDrivenProperty",as),Ja("DataConstantProperty",qo),Ja("CrossFadedDataDrivenProperty",uf),Ja("CrossFadedProperty",Pc),Ja("ColorRampProperty",bc);const I="-transition";class ce extends le{constructor(O,ne){if(super(),this.id=O.id,this.type=O.type,this._featureFilter={filter:()=>!0,needGeometry:!1},O.type!=="custom"&&(this.metadata=O.metadata,this.minzoom=O.minzoom,this.maxzoom=O.maxzoom,O.type!=="background"&&(this.source=O.source,this.sourceLayer=O["source-layer"],this.filter=O.filter),ne.layout&&(this._unevaluatedLayout=new sf(ne.layout)),ne.paint)){this._transitionablePaint=new cc(ne.paint);for(const Se in O.paint)this.setPaintProperty(Se,O.paint[Se],{validate:!1});for(const Se in O.layout)this.setLayoutProperty(Se,O.layout[Se],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new lf(ne.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(O){return O==="visibility"?this.visibility:this._unevaluatedLayout.getValue(O)}setLayoutProperty(O,ne,Se={}){ne!=null&&this._validate($i,`layers.${this.id}.layout.${O}`,O,ne,Se)||(O!=="visibility"?this._unevaluatedLayout.setValue(O,ne):this.visibility=ne)}getPaintProperty(O){return O.endsWith(I)?this._transitionablePaint.getTransition(O.slice(0,-11)):this._transitionablePaint.getValue(O)}setPaintProperty(O,ne,Se={}){if(ne!=null&&this._validate(xi,`layers.${this.id}.paint.${O}`,O,ne,Se))return!1;if(O.endsWith(I))return this._transitionablePaint.setTransition(O.slice(0,-11),ne||void 0),!1;{const Ge=this._transitionablePaint._values[O],rt=Ge.property.specification["property-type"]==="cross-faded-data-driven",st=Ge.value.isDataDriven(),Mt=Ge.value;this._transitionablePaint.setValue(O,ne),this._handleSpecialPaintPropertyUpdate(O);const Ut=this._transitionablePaint._values[O].value;return Ut.isDataDriven()||st||rt||this._handleOverridablePaintPropertyUpdate(O,Mt,Ut)}}_handleSpecialPaintPropertyUpdate(O){}_handleOverridablePaintPropertyUpdate(O,ne,Se){return!1}isHidden(O){return!!(this.minzoom&&O=this.maxzoom)||this.visibility==="none"}updateTransitions(O){this._transitioningPaint=this._transitionablePaint.transitioned(O,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(O,ne){O.getCrossfadeParameters&&(this._crossfadeParameters=O.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(O,void 0,ne)),this.paint=this._transitioningPaint.possiblyEvaluate(O,void 0,ne)}serialize(){const O={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&&(O.layout=O.layout||{},O.layout.visibility=this.visibility),m(O,(ne,Se)=>!(ne===void 0||Se==="layout"&&!Object.keys(ne).length||Se==="paint"&&!Object.keys(ne).length))}_validate(O,ne,Se,Ge,rt={}){return(!rt||rt.validate!==!1)&&ni(this,O.call(Na,{key:ne,layerType:this.type,objectKey:Se,value:Ge,styleSpec:ue,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const O in this.paint._values){const ne=this.paint.get(O);if(ne instanceof wu&&Bu(ne.property.specification)&&(ne.value.kind==="source"||ne.value.kind==="composite")&&ne.value.isStateDependent)return!0}return!1}}const Ne={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class je{constructor(O,ne){this._structArray=O,this._pos1=ne*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ze{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(O,ne){return O._trim(),ne&&(O.isTransferred=!0,ne.push(O.arrayBuffer)),{length:O.length,arrayBuffer:O.arrayBuffer}}static deserialize(O){const ne=Object.create(this.prototype);return ne.arrayBuffer=O.arrayBuffer,ne.length=O.length,ne.capacity=O.arrayBuffer.byteLength/ne.bytesPerElement,ne._refreshViews(),ne}_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(O){this.reserve(O),this.length=O}reserve(O){if(O>this.capacity){this.capacity=Math.max(O,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const ne=this.uint8;this._refreshViews(),ne&&this.uint8.set(ne)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function kt(K,O=1){let ne=0,Se=0;return{members:K.map(Ge=>{const rt=Ne[Ge.type].BYTES_PER_ELEMENT,st=ne=Ft(ne,Math.max(O,rt)),Mt=Ge.components||1;return Se=Math.max(Se,rt),ne+=rt*Mt,{name:Ge.name,type:Ge.type,components:Mt,offset:st}}),size:Ft(ne,Math.max(Se,O)),alignment:O}}function Ft(K,O){return Math.ceil(K/O)*O}class tr extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(O,ne){const Se=this.length;return this.resize(Se+1),this.emplace(Se,O,ne)}emplace(O,ne,Se){const Ge=2*O;return this.int16[Ge+0]=ne,this.int16[Ge+1]=Se,O}}tr.prototype.bytesPerElement=4,Ja("StructArrayLayout2i4",tr);class xr extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(O,ne,Se){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,O,ne,Se)}emplace(O,ne,Se,Ge){const rt=3*O;return this.int16[rt+0]=ne,this.int16[rt+1]=Se,this.int16[rt+2]=Ge,O}}xr.prototype.bytesPerElement=6,Ja("StructArrayLayout3i6",xr);class Or extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(O,ne,Se,Ge){const rt=this.length;return this.resize(rt+1),this.emplace(rt,O,ne,Se,Ge)}emplace(O,ne,Se,Ge,rt){const st=4*O;return this.int16[st+0]=ne,this.int16[st+1]=Se,this.int16[st+2]=Ge,this.int16[st+3]=rt,O}}Or.prototype.bytesPerElement=8,Ja("StructArrayLayout4i8",Or);class Ur extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(O,ne,Se,Ge,rt,st){const Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,O,ne,Se,Ge,rt,st)}emplace(O,ne,Se,Ge,rt,st,Mt){const Ut=6*O;return this.int16[Ut+0]=ne,this.int16[Ut+1]=Se,this.int16[Ut+2]=Ge,this.int16[Ut+3]=rt,this.int16[Ut+4]=st,this.int16[Ut+5]=Mt,O}}Ur.prototype.bytesPerElement=12,Ja("StructArrayLayout2i4i12",Ur);class hn extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(O,ne,Se,Ge,rt,st){const Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,O,ne,Se,Ge,rt,st)}emplace(O,ne,Se,Ge,rt,st,Mt){const Ut=4*O,nr=8*O;return this.int16[Ut+0]=ne,this.int16[Ut+1]=Se,this.uint8[nr+4]=Ge,this.uint8[nr+5]=rt,this.uint8[nr+6]=st,this.uint8[nr+7]=Mt,O}}hn.prototype.bytesPerElement=8,Ja("StructArrayLayout2i4ub8",hn);class Cn extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(O,ne){const Se=this.length;return this.resize(Se+1),this.emplace(Se,O,ne)}emplace(O,ne,Se){const Ge=2*O;return this.float32[Ge+0]=ne,this.float32[Ge+1]=Se,O}}Cn.prototype.bytesPerElement=8,Ja("StructArrayLayout2f8",Cn);class ot extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar){const Pr=this.length;return this.resize(Pr+1),this.emplace(Pr,O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar)}emplace(O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr){const en=10*O;return this.uint16[en+0]=ne,this.uint16[en+1]=Se,this.uint16[en+2]=Ge,this.uint16[en+3]=rt,this.uint16[en+4]=st,this.uint16[en+5]=Mt,this.uint16[en+6]=Ut,this.uint16[en+7]=nr,this.uint16[en+8]=Ar,this.uint16[en+9]=Pr,O}}ot.prototype.bytesPerElement=20,Ja("StructArrayLayout10ui20",ot);class dt extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en){const fn=this.length;return this.resize(fn+1),this.emplace(fn,O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en)}emplace(O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en,fn){const Tn=12*O;return this.int16[Tn+0]=ne,this.int16[Tn+1]=Se,this.int16[Tn+2]=Ge,this.int16[Tn+3]=rt,this.uint16[Tn+4]=st,this.uint16[Tn+5]=Mt,this.uint16[Tn+6]=Ut,this.uint16[Tn+7]=nr,this.int16[Tn+8]=Ar,this.int16[Tn+9]=Pr,this.int16[Tn+10]=en,this.int16[Tn+11]=fn,O}}dt.prototype.bytesPerElement=24,Ja("StructArrayLayout4i4ui4i24",dt);class Tt extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(O,ne,Se){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,O,ne,Se)}emplace(O,ne,Se,Ge){const rt=3*O;return this.float32[rt+0]=ne,this.float32[rt+1]=Se,this.float32[rt+2]=Ge,O}}Tt.prototype.bytesPerElement=12,Ja("StructArrayLayout3f12",Tt);class Pt extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(O){const ne=this.length;return this.resize(ne+1),this.emplace(ne,O)}emplace(O,ne){return this.uint32[1*O+0]=ne,O}}Pt.prototype.bytesPerElement=4,Ja("StructArrayLayout1ul4",Pt);class qt extends Ze{_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(O,ne,Se,Ge,rt,st,Mt,Ut,nr){const Ar=this.length;return this.resize(Ar+1),this.emplace(Ar,O,ne,Se,Ge,rt,st,Mt,Ut,nr)}emplace(O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar){const Pr=10*O,en=5*O;return this.int16[Pr+0]=ne,this.int16[Pr+1]=Se,this.int16[Pr+2]=Ge,this.int16[Pr+3]=rt,this.int16[Pr+4]=st,this.int16[Pr+5]=Mt,this.uint32[en+3]=Ut,this.uint16[Pr+8]=nr,this.uint16[Pr+9]=Ar,O}}qt.prototype.bytesPerElement=20,Ja("StructArrayLayout6i1ul2ui20",qt);class zt extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(O,ne,Se,Ge,rt,st){const Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,O,ne,Se,Ge,rt,st)}emplace(O,ne,Se,Ge,rt,st,Mt){const Ut=6*O;return this.int16[Ut+0]=ne,this.int16[Ut+1]=Se,this.int16[Ut+2]=Ge,this.int16[Ut+3]=rt,this.int16[Ut+4]=st,this.int16[Ut+5]=Mt,O}}zt.prototype.bytesPerElement=12,Ja("StructArrayLayout2i2i2i12",zt);class Xt extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(O,ne,Se,Ge,rt){const st=this.length;return this.resize(st+1),this.emplace(st,O,ne,Se,Ge,rt)}emplace(O,ne,Se,Ge,rt,st){const Mt=4*O,Ut=8*O;return this.float32[Mt+0]=ne,this.float32[Mt+1]=Se,this.float32[Mt+2]=Ge,this.int16[Ut+6]=rt,this.int16[Ut+7]=st,O}}Xt.prototype.bytesPerElement=16,Ja("StructArrayLayout2f1f2i16",Xt);class Mr extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(O,ne,Se,Ge,rt,st){const Mt=this.length;return this.resize(Mt+1),this.emplace(Mt,O,ne,Se,Ge,rt,st)}emplace(O,ne,Se,Ge,rt,st,Mt){const Ut=16*O,nr=4*O,Ar=8*O;return this.uint8[Ut+0]=ne,this.uint8[Ut+1]=Se,this.float32[nr+1]=Ge,this.float32[nr+2]=rt,this.int16[Ar+6]=st,this.int16[Ar+7]=Mt,O}}Mr.prototype.bytesPerElement=16,Ja("StructArrayLayout2ub2f2i16",Mr);class Rr extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(O,ne,Se){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,O,ne,Se)}emplace(O,ne,Se,Ge){const rt=3*O;return this.uint16[rt+0]=ne,this.uint16[rt+1]=Se,this.uint16[rt+2]=Ge,O}}Rr.prototype.bytesPerElement=6,Ja("StructArrayLayout3ui6",Rr);class Vr extends Ze{_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(O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en,fn,Tn,Dn,Kn,ka){const _i=this.length;return this.resize(_i+1),this.emplace(_i,O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en,fn,Tn,Dn,Kn,ka)}emplace(O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en,fn,Tn,Dn,Kn,ka,_i){const Ka=24*O,di=12*O,Gi=48*O;return this.int16[Ka+0]=ne,this.int16[Ka+1]=Se,this.uint16[Ka+2]=Ge,this.uint16[Ka+3]=rt,this.uint32[di+2]=st,this.uint32[di+3]=Mt,this.uint32[di+4]=Ut,this.uint16[Ka+10]=nr,this.uint16[Ka+11]=Ar,this.uint16[Ka+12]=Pr,this.float32[di+7]=en,this.float32[di+8]=fn,this.uint8[Gi+36]=Tn,this.uint8[Gi+37]=Dn,this.uint8[Gi+38]=Kn,this.uint32[di+10]=ka,this.int16[Ka+22]=_i,O}}Vr.prototype.bytesPerElement=48,Ja("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Vr);class an extends Ze{_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(O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en,fn,Tn,Dn,Kn,ka,_i,Ka,di,Gi,vo,Yo,sl,is,Go,Ls,ws){const _s=this.length;return this.resize(_s+1),this.emplace(_s,O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en,fn,Tn,Dn,Kn,ka,_i,Ka,di,Gi,vo,Yo,sl,is,Go,Ls,ws)}emplace(O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en,fn,Tn,Dn,Kn,ka,_i,Ka,di,Gi,vo,Yo,sl,is,Go,Ls,ws,_s){const oo=32*O,Us=16*O;return this.int16[oo+0]=ne,this.int16[oo+1]=Se,this.int16[oo+2]=Ge,this.int16[oo+3]=rt,this.int16[oo+4]=st,this.int16[oo+5]=Mt,this.int16[oo+6]=Ut,this.int16[oo+7]=nr,this.uint16[oo+8]=Ar,this.uint16[oo+9]=Pr,this.uint16[oo+10]=en,this.uint16[oo+11]=fn,this.uint16[oo+12]=Tn,this.uint16[oo+13]=Dn,this.uint16[oo+14]=Kn,this.uint16[oo+15]=ka,this.uint16[oo+16]=_i,this.uint16[oo+17]=Ka,this.uint16[oo+18]=di,this.uint16[oo+19]=Gi,this.uint16[oo+20]=vo,this.uint16[oo+21]=Yo,this.uint16[oo+22]=sl,this.uint32[Us+12]=is,this.float32[Us+13]=Go,this.float32[Us+14]=Ls,this.uint16[oo+30]=ws,this.uint16[oo+31]=_s,O}}an.prototype.bytesPerElement=64,Ja("StructArrayLayout8i15ui1ul2f2ui64",an);class mn extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(O){const ne=this.length;return this.resize(ne+1),this.emplace(ne,O)}emplace(O,ne){return this.float32[1*O+0]=ne,O}}mn.prototype.bytesPerElement=4,Ja("StructArrayLayout1f4",mn);class zn extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(O,ne,Se){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,O,ne,Se)}emplace(O,ne,Se,Ge){const rt=3*O;return this.uint16[6*O+0]=ne,this.float32[rt+1]=Se,this.float32[rt+2]=Ge,O}}zn.prototype.bytesPerElement=12,Ja("StructArrayLayout1ui2f12",zn);class Gn extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(O,ne,Se){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,O,ne,Se)}emplace(O,ne,Se,Ge){const rt=4*O;return this.uint32[2*O+0]=ne,this.uint16[rt+2]=Se,this.uint16[rt+3]=Ge,O}}Gn.prototype.bytesPerElement=8,Ja("StructArrayLayout1ul2ui8",Gn);class oa extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(O,ne){const Se=this.length;return this.resize(Se+1),this.emplace(Se,O,ne)}emplace(O,ne,Se){const Ge=2*O;return this.uint16[Ge+0]=ne,this.uint16[Ge+1]=Se,O}}oa.prototype.bytesPerElement=4,Ja("StructArrayLayout2ui4",oa);class Fa extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(O){const ne=this.length;return this.resize(ne+1),this.emplace(ne,O)}emplace(O,ne){return this.uint16[1*O+0]=ne,O}}Fa.prototype.bytesPerElement=2,Ja("StructArrayLayout1ui2",Fa);class vi extends Ze{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(O,ne,Se,Ge){const rt=this.length;return this.resize(rt+1),this.emplace(rt,O,ne,Se,Ge)}emplace(O,ne,Se,Ge,rt){const st=4*O;return this.float32[st+0]=ne,this.float32[st+1]=Se,this.float32[st+2]=Ge,this.float32[st+3]=rt,O}}vi.prototype.bytesPerElement=16,Ja("StructArrayLayout4f16",vi);class li extends je{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)}}li.prototype.size=20;class mi extends qt{get(O){return new li(this,O)}}Ja("CollisionBoxArray",mi);class no extends je{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(O){this._structArray.uint8[this._pos1+37]=O}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(O){this._structArray.uint8[this._pos1+38]=O}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(O){this._structArray.uint32[this._pos4+10]=O}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}no.prototype.size=48;class To extends Vr{get(O){return new no(this,O)}}Ja("PlacedSymbolArray",To);class go extends je{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(O){this._structArray.uint32[this._pos4+12]=O}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]}}go.prototype.size=64;class Wo extends an{get(O){return new go(this,O)}}Ja("SymbolInstanceArray",Wo);class $s extends mn{getoffsetX(O){return this.float32[1*O+0]}}Ja("GlyphOffsetArray",$s);class Ws extends xr{getx(O){return this.int16[3*O+0]}gety(O){return this.int16[3*O+1]}gettileUnitDistanceFromAnchor(O){return this.int16[3*O+2]}}Ja("SymbolLineVertexArray",Ws);class As extends je{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]}}As.prototype.size=12;class Qs extends zn{get(O){return new As(this,O)}}Ja("TextAnchorOffsetArray",Qs);class uu extends je{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]}}uu.prototype.size=8;class Kl extends Gn{get(O){return new uu(this,O)}}Ja("FeatureIndexArray",Kl);class Ms extends tr{}class Es extends tr{}class Mu extends tr{}class Wu extends Ur{}class xc extends hn{}class ke extends Cn{}class Ye extends ot{}class pt extends dt{}class Lt extends Tt{}class Rt extends Pt{}class jt extends zt{}class cr extends Mr{}class ur extends Rr{}class kr extends oa{}const on=kt([{name:"a_pos",components:2,type:"Int16"}],4),{members:nn}=on;class wn{constructor(O=[]){this.segments=O}prepareSegment(O,ne,Se,Ge){let rt=this.segments[this.segments.length-1];return O>wn.MAX_VERTEX_ARRAY_LENGTH&&y(`Max vertices per segment is ${wn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${O}`),(!rt||rt.vertexLength+O>wn.MAX_VERTEX_ARRAY_LENGTH||rt.sortKey!==Ge)&&(rt={vertexOffset:ne.length,primitiveOffset:Se.length,vertexLength:0,primitiveLength:0},Ge!==void 0&&(rt.sortKey=Ge),this.segments.push(rt)),rt}get(){return this.segments}destroy(){for(const O of this.segments)for(const ne in O.vaos)O.vaos[ne].destroy()}static simpleSegment(O,ne,Se,Ge){return new wn([{vertexOffset:O,primitiveOffset:ne,vertexLength:Se,primitiveLength:Ge,vaos:{},sortKey:0}])}}function Rn(K,O){return 256*(K=b(Math.floor(K),0,255))+b(Math.floor(O),0,255)}wn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ja("SegmentVector",wn);const Nn=kt([{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 qa={exports:{}},Yn={exports:{}};Yn.exports=function(K,O){var ne,Se,Ge,rt,st,Mt,Ut,nr;for(Se=K.length-(ne=3&K.length),Ge=O,st=3432918353,Mt=461845907,nr=0;nr>>16)*st&65535)<<16)&4294967295)<<15|Ut>>>17))*Mt+(((Ut>>>16)*Mt&65535)<<16)&4294967295)<<13|Ge>>>19))+((5*(Ge>>>16)&65535)<<16)&4294967295))+((58964+(rt>>>16)&65535)<<16);switch(Ut=0,ne){case 3:Ut^=(255&K.charCodeAt(nr+2))<<16;case 2:Ut^=(255&K.charCodeAt(nr+1))<<8;case 1:Ge^=Ut=(65535&(Ut=(Ut=(65535&(Ut^=255&K.charCodeAt(nr)))*st+(((Ut>>>16)*st&65535)<<16)&4294967295)<<15|Ut>>>17))*Mt+(((Ut>>>16)*Mt&65535)<<16)&4294967295}return Ge^=K.length,Ge=2246822507*(65535&(Ge^=Ge>>>16))+((2246822507*(Ge>>>16)&65535)<<16)&4294967295,Ge=3266489909*(65535&(Ge^=Ge>>>13))+((3266489909*(Ge>>>16)&65535)<<16)&4294967295,(Ge^=Ge>>>16)>>>0};var ha=Yn.exports,xa={exports:{}};xa.exports=function(K,O){for(var ne,Se=K.length,Ge=O^Se,rt=0;Se>=4;)ne=1540483477*(65535&(ne=255&K.charCodeAt(rt)|(255&K.charCodeAt(++rt))<<8|(255&K.charCodeAt(++rt))<<16|(255&K.charCodeAt(++rt))<<24))+((1540483477*(ne>>>16)&65535)<<16),Ge=1540483477*(65535&Ge)+((1540483477*(Ge>>>16)&65535)<<16)^(ne=1540483477*(65535&(ne^=ne>>>24))+((1540483477*(ne>>>16)&65535)<<16)),Se-=4,++rt;switch(Se){case 3:Ge^=(255&K.charCodeAt(rt+2))<<16;case 2:Ge^=(255&K.charCodeAt(rt+1))<<8;case 1:Ge=1540483477*(65535&(Ge^=255&K.charCodeAt(rt)))+((1540483477*(Ge>>>16)&65535)<<16)}return Ge=1540483477*(65535&(Ge^=Ge>>>13))+((1540483477*(Ge>>>16)&65535)<<16),(Ge^=Ge>>>15)>>>0};var Ba=ha,Ha=xa.exports;qa.exports=Ba,qa.exports.murmur3=Ba,qa.exports.murmur2=Ha;var _a=r(qa.exports);class gi{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(O,ne,Se,Ge){this.ids.push(to(O)),this.positions.push(ne,Se,Ge)}getPositions(O){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const ne=to(O);let Se=0,Ge=this.ids.length-1;for(;Se>1;this.ids[st]>=ne?Ge=st:Se=st+1}const rt=[];for(;this.ids[Se]===ne;)rt.push({index:this.positions[3*Se],start:this.positions[3*Se+1],end:this.positions[3*Se+2]}),Se++;return rt}static serialize(O,ne){const Se=new Float64Array(O.ids),Ge=new Uint32Array(O.positions);return Vi(Se,Ge,0,Se.length-1),ne&&ne.push(Se.buffer,Ge.buffer),{ids:Se,positions:Ge}}static deserialize(O){const ne=new gi;return ne.ids=O.ids,ne.positions=O.positions,ne.indexed=!0,ne}}function to(K){const O=+K;return!isNaN(O)&&O<=Number.MAX_SAFE_INTEGER?O:_a(String(K))}function Vi(K,O,ne,Se){for(;ne>1];let rt=ne-1,st=Se+1;for(;;){do rt++;while(K[rt]Ge);if(rt>=st)break;Zi(K,rt,st),Zi(O,3*rt,3*st),Zi(O,3*rt+1,3*st+1),Zi(O,3*rt+2,3*st+2)}st-ne`u_${Ge}`),this.type=Se}setUniform(O,ne,Se){O.set(Se.constantOr(this.value))}getBinding(O,ne,Se){return this.type==="color"?new Po(O,ne):new Mo(O,ne)}}class Yl{constructor(O,ne){this.uniformNames=ne.map(Se=>`u_${Se}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(O,ne){this.pixelRatioFrom=ne.pixelRatio,this.pixelRatioTo=O.pixelRatio,this.patternFrom=ne.tlbr,this.patternTo=O.tlbr}setUniform(O,ne,Se,Ge){const rt=Ge==="u_pattern_to"?this.patternTo:Ge==="u_pattern_from"?this.patternFrom:Ge==="u_pixel_ratio_to"?this.pixelRatioTo:Ge==="u_pixel_ratio_from"?this.pixelRatioFrom:null;rt&&O.set(rt)}getBinding(O,ne,Se){return Se.substr(0,9)==="u_pattern"?new Gs(O,ne):new Mo(O,ne)}}class ho{constructor(O,ne,Se,Ge){this.expression=O,this.type=Se,this.maxValue=0,this.paintVertexAttributes=ne.map(rt=>({name:`a_${rt}`,type:"Float32",components:Se==="color"?2:1,offset:0})),this.paintVertexArray=new Ge}populatePaintArray(O,ne,Se,Ge,rt){const st=this.paintVertexArray.length,Mt=this.expression.evaluate(new cl(0),ne,{},Ge,[],rt);this.paintVertexArray.resize(O),this._setPaintValue(st,O,Mt)}updatePaintArray(O,ne,Se,Ge){const rt=this.expression.evaluate({zoom:0},Se,Ge);this._setPaintValue(O,ne,rt)}_setPaintValue(O,ne,Se){if(this.type==="color"){const Ge=Js(Se);for(let rt=O;rt`u_${Mt}_t`),this.type=Se,this.useIntegerZoom=Ge,this.zoom=rt,this.maxValue=0,this.paintVertexAttributes=ne.map(Mt=>({name:`a_${Mt}`,type:"Float32",components:Se==="color"?4:2,offset:0})),this.paintVertexArray=new st}populatePaintArray(O,ne,Se,Ge,rt){const st=this.expression.evaluate(new cl(this.zoom),ne,{},Ge,[],rt),Mt=this.expression.evaluate(new cl(this.zoom+1),ne,{},Ge,[],rt),Ut=this.paintVertexArray.length;this.paintVertexArray.resize(O),this._setPaintValue(Ut,O,st,Mt)}updatePaintArray(O,ne,Se,Ge){const rt=this.expression.evaluate({zoom:this.zoom},Se,Ge),st=this.expression.evaluate({zoom:this.zoom+1},Se,Ge);this._setPaintValue(O,ne,rt,st)}_setPaintValue(O,ne,Se,Ge){if(this.type==="color"){const rt=Js(Se),st=Js(Ge);for(let Mt=O;Mt`#define HAS_UNIFORM_${Ge}`))}return O}getBinderAttributes(){const O=[];for(const ne in this.binders){const Se=this.binders[ne];if(Se instanceof ho||Se instanceof ks)for(let Ge=0;Ge!0){this.programConfigurations={};for(const Ge of O)this.programConfigurations[Ge.id]=new ql(Ge,ne,Se);this.needsUpload=!1,this._featureMap=new gi,this._bufferOffset=0}populatePaintArrays(O,ne,Se,Ge,rt,st){for(const Mt in this.programConfigurations)this.programConfigurations[Mt].populatePaintArrays(O,ne,Ge,rt,st);ne.id!==void 0&&this._featureMap.add(ne.id,Se,this._bufferOffset,O),this._bufferOffset=O,this.needsUpload=!0}updatePaintArrays(O,ne,Se,Ge){for(const rt of Se)this.needsUpload=this.programConfigurations[rt.id].updatePaintArrays(O,this._featureMap,ne,rt,Ge)||this.needsUpload}get(O){return this.programConfigurations[O]}upload(O){if(this.needsUpload){for(const ne in this.programConfigurations)this.programConfigurations[ne].upload(O);this.needsUpload=!1}}destroy(){for(const O in this.programConfigurations)this.programConfigurations[O].destroy()}}function fc(K,O){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"]}[K]||[K.replace(`${O}-`,"").replace(/-/g,"_")]}function bl(K,O,ne){const Se={color:{source:Cn,composite:vi},number:{source:mn,composite:Cn}},Ge=function(rt){return{"line-pattern":{source:Ye,composite:Ye},"fill-pattern":{source:Ye,composite:Ye},"fill-extrusion-pattern":{source:Ye,composite:Ye}}[rt]}(K);return Ge&&Ge[ne]||Se[O][ne]}Ja("ConstantBinder",Eu),Ja("CrossFadedConstantBinder",Yl),Ja("SourceExpressionBinder",ho),Ja("CrossFadedCompositeBinder",Ys),Ja("CompositeExpressionBinder",ks),Ja("ProgramConfiguration",ql,{omit:["_buffers"]}),Ja("ProgramConfigurationSet",Pl);const Gl=8192,Lc=Math.pow(2,14)-1,Tu=-Lc-1;function St(K){const O=Gl/K.extent,ne=K.loadGeometry();for(let Se=0;Sest.x+1||Utst.y+1)&&y("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return ne}function Er(K,O){return{type:K.type,id:K.id,properties:K.properties,geometry:O?St(K):[]}}function Dr(K,O,ne,Se,Ge){K.emplaceBack(2*O+(Se+1)/2,2*ne+(Ge+1)/2)}class Bn{constructor(O){this.zoom=O.zoom,this.overscaling=O.overscaling,this.layers=O.layers,this.layerIds=this.layers.map(ne=>ne.id),this.index=O.index,this.hasPattern=!1,this.layoutVertexArray=new Es,this.indexArray=new ur,this.segments=new wn,this.programConfigurations=new Pl(O.layers,O.zoom),this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(O,ne,Se){const Ge=this.layers[0],rt=[];let st=null,Mt=!1;Ge.type==="circle"&&(st=Ge.layout.get("circle-sort-key"),Mt=!st.isConstant());for(const{feature:Ut,id:nr,index:Ar,sourceLayerIndex:Pr}of O){const en=this.layers[0]._featureFilter.needGeometry,fn=Er(Ut,en);if(!this.layers[0]._featureFilter.filter(new cl(this.zoom),fn,Se))continue;const Tn=Mt?st.evaluate(fn,{},Se):void 0,Dn={id:nr,properties:Ut.properties,type:Ut.type,sourceLayerIndex:Pr,index:Ar,geometry:en?fn.geometry:St(Ut),patterns:{},sortKey:Tn};rt.push(Dn)}Mt&&rt.sort((Ut,nr)=>Ut.sortKey-nr.sortKey);for(const Ut of rt){const{geometry:nr,index:Ar,sourceLayerIndex:Pr}=Ut,en=O[Ar].feature;this.addFeature(Ut,nr,Ar,Se),ne.featureIndex.insert(en,nr,Ar,Pr,this.index)}}update(O,ne,Se){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(O,ne,this.stateDependentLayers,Se)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(O){this.uploaded||(this.layoutVertexBuffer=O.createVertexBuffer(this.layoutVertexArray,nn),this.indexBuffer=O.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(O),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(O,ne,Se,Ge){for(const rt of ne)for(const st of rt){const Mt=st.x,Ut=st.y;if(Mt<0||Mt>=Gl||Ut<0||Ut>=Gl)continue;const nr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,O.sortKey),Ar=nr.vertexLength;Dr(this.layoutVertexArray,Mt,Ut,-1,-1),Dr(this.layoutVertexArray,Mt,Ut,1,-1),Dr(this.layoutVertexArray,Mt,Ut,1,1),Dr(this.layoutVertexArray,Mt,Ut,-1,1),this.indexArray.emplaceBack(Ar,Ar+1,Ar+2),this.indexArray.emplaceBack(Ar,Ar+3,Ar+2),nr.vertexLength+=4,nr.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,O,Se,{},Ge)}}function Aa(K,O){for(let ne=0;ne1){if($a(K,O))return!0;for(let Se=0;Se1?ne:ne.sub(O)._mult(Ge)._add(O))}function Ci(K,O){let ne,Se,Ge,rt=!1;for(let st=0;stO.y!=Ge.y>O.y&&O.x<(Ge.x-Se.x)*(O.y-Se.y)/(Ge.y-Se.y)+Se.x&&(rt=!rt)}return rt}function ai(K,O){let ne=!1;for(let Se=0,Ge=K.length-1;SeO.y!=st.y>O.y&&O.x<(st.x-rt.x)*(O.y-rt.y)/(st.y-rt.y)+rt.x&&(ne=!ne)}return ne}function Pa(K,O,ne){const Se=ne[0],Ge=ne[2];if(K.xGe.x&&O.x>Ge.x||K.yGe.y&&O.y>Ge.y)return!1;const rt=R(K,O,ne[0]);return rt!==R(K,O,ne[1])||rt!==R(K,O,ne[2])||rt!==R(K,O,ne[3])}function pn(K,O,ne){const Se=O.paint.get(K).value;return Se.kind==="constant"?Se.value:ne.programConfigurations.get(O.id).getMaxValue(K)}function Zn(K){return Math.sqrt(K[0]*K[0]+K[1]*K[1])}function da(K,O,ne,Se,Ge){if(!O[0]&&!O[1])return K;const rt=i.convert(O)._mult(Ge);ne==="viewport"&&rt._rotate(-Se);const st=[];for(let Mt=0;Mtqi(Kn,Dn))}(nr,Ut),fn=Pr?Ar*Mt:Ar;for(const Tn of Ge)for(const Dn of Tn){const Kn=Pr?Dn:qi(Dn,Ut);let ka=fn;const _i=ui([],[Dn.x,Dn.y,0,1],Ut);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ka*=_i[3]/st.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ka*=st.cameraToCenterDistance/_i[3]),En(en,Kn,ka))return!0}return!1}}function qi(K,O){const ne=ui([],[K.x,K.y,0,1],O);return new i(ne[0]/ne[3],ne[1]/ne[3])}class Co extends Bn{}let Li;Ja("HeatmapBucket",Co,{omit:["layers"]});var Wi={get paint(){return Li=Li||new Je({"heatmap-radius":new as(ue.paint_heatmap["heatmap-radius"]),"heatmap-weight":new as(ue.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new qo(ue.paint_heatmap["heatmap-intensity"]),"heatmap-color":new bc(ue.paint_heatmap["heatmap-color"]),"heatmap-opacity":new qo(ue.paint_heatmap["heatmap-opacity"])})}};function ii(K,{width:O,height:ne},Se,Ge){if(Ge){if(Ge instanceof Uint8ClampedArray)Ge=new Uint8Array(Ge.buffer);else if(Ge.length!==O*ne*Se)throw new RangeError(`mismatched image size. expected: ${Ge.length} but got: ${O*ne*Se}`)}else Ge=new Uint8Array(O*ne*Se);return K.width=O,K.height=ne,K.data=Ge,K}function Ao(K,{width:O,height:ne},Se){if(O===K.width&&ne===K.height)return;const Ge=ii({},{width:O,height:ne},Se);Uo(K,Ge,{x:0,y:0},{x:0,y:0},{width:Math.min(K.width,O),height:Math.min(K.height,ne)},Se),K.width=O,K.height=ne,K.data=Ge.data}function Uo(K,O,ne,Se,Ge,rt){if(Ge.width===0||Ge.height===0)return O;if(Ge.width>K.width||Ge.height>K.height||ne.x>K.width-Ge.width||ne.y>K.height-Ge.height)throw new RangeError("out of range source coordinates for image copy");if(Ge.width>O.width||Ge.height>O.height||Se.x>O.width-Ge.width||Se.y>O.height-Ge.height)throw new RangeError("out of range destination coordinates for image copy");const st=K.data,Mt=O.data;if(st===Mt)throw new Error("srcData equals dstData, so image is already copied");for(let Ut=0;Ut{O[K.evaluationKey]=Ut;const nr=K.expression.evaluate(O);Ge.data[st+Mt+0]=Math.floor(255*nr.r/nr.a),Ge.data[st+Mt+1]=Math.floor(255*nr.g/nr.a),Ge.data[st+Mt+2]=Math.floor(255*nr.b/nr.a),Ge.data[st+Mt+3]=Math.floor(255*nr.a)};if(K.clips)for(let st=0,Mt=0;st80*ne){Mt=1/0,Ut=1/0;let Ar=-1/0,Pr=-1/0;for(let en=ne;enAr&&(Ar=fn),Tn>Pr&&(Pr=Tn)}nr=Math.max(Ar-Mt,Pr-Ut),nr=nr!==0?32767/nr:0}return zs(rt,st,ne,Mt,Ut,nr,0),st}function mo(K,O,ne,Se,Ge){let rt;if(Ge===function(st,Mt,Ut,nr){let Ar=0;for(let Pr=Mt,en=Ut-nr;Pr0)for(let st=O;st=O;st-=Se)rt=Jt(st/Se|0,K[st],K[st+1],rt);return rt&&xt(rt,rt.next)&&(sr(rt),rt=rt.next),rt}function ju(K,O){if(!K)return K;O||(O=K);let ne,Se=K;do if(ne=!1,Se.steiner||!xt(Se,Se.next)&&et(Se.prev,Se,Se.next)!==0)Se=Se.next;else{if(sr(Se),Se=O=Se.prev,Se===Se.next)break;ne=!0}while(ne||Se!==O);return O}function zs(K,O,ne,Se,Ge,rt,st){if(!K)return;!st&&rt&&function(Ut,nr,Ar,Pr){let en=Ut;do en.z===0&&(en.z=G(en.x,en.y,nr,Ar,Pr)),en.prevZ=en.prev,en.nextZ=en.next,en=en.next;while(en!==Ut);en.prevZ.nextZ=null,en.prevZ=null,function(fn){let Tn,Dn=1;do{let Kn,ka=fn;fn=null;let _i=null;for(Tn=0;ka;){Tn++;let Ka=ka,di=0;for(let vo=0;vo0||Gi>0&&Ka;)di!==0&&(Gi===0||!Ka||ka.z<=Ka.z)?(Kn=ka,ka=ka.nextZ,di--):(Kn=Ka,Ka=Ka.nextZ,Gi--),_i?_i.nextZ=Kn:fn=Kn,Kn.prevZ=_i,_i=Kn;ka=Ka}_i.nextZ=null,Dn*=2}while(Tn>1)}(en)}(K,Se,Ge,rt);let Mt=K;for(;K.prev!==K.next;){const Ut=K.prev,nr=K.next;if(rt?Zu(K,Se,Ge,rt):Ll(K))O.push(Ut.i,K.i,nr.i),sr(K),K=nr.next,Mt=nr.next;else if((K=nr)===Mt){st?st===1?zs(K=Ku(ju(K),O),O,ne,Se,Ge,rt,2):st===2&&Eo(K,O,ne,Se,Ge,rt):zs(ju(K),O,ne,Se,Ge,rt,1);break}}}function Ll(K){const O=K.prev,ne=K,Se=K.next;if(et(O,ne,Se)>=0)return!1;const Ge=O.x,rt=ne.x,st=Se.x,Mt=O.y,Ut=ne.y,nr=Se.y,Ar=Gert?Ge>st?Ge:st:rt>st?rt:st,fn=Mt>Ut?Mt>nr?Mt:nr:Ut>nr?Ut:nr;let Tn=Se.next;for(;Tn!==O;){if(Tn.x>=Ar&&Tn.x<=en&&Tn.y>=Pr&&Tn.y<=fn&&re(Ge,Mt,rt,Ut,st,nr,Tn.x,Tn.y)&&et(Tn.prev,Tn,Tn.next)>=0)return!1;Tn=Tn.next}return!0}function Zu(K,O,ne,Se){const Ge=K.prev,rt=K,st=K.next;if(et(Ge,rt,st)>=0)return!1;const Mt=Ge.x,Ut=rt.x,nr=st.x,Ar=Ge.y,Pr=rt.y,en=st.y,fn=MtUt?Mt>nr?Mt:nr:Ut>nr?Ut:nr,Kn=Ar>Pr?Ar>en?Ar:en:Pr>en?Pr:en,ka=G(fn,Tn,O,ne,Se),_i=G(Dn,Kn,O,ne,Se);let Ka=K.prevZ,di=K.nextZ;for(;Ka&&Ka.z>=ka&&di&&di.z<=_i;){if(Ka.x>=fn&&Ka.x<=Dn&&Ka.y>=Tn&&Ka.y<=Kn&&Ka!==Ge&&Ka!==st&&re(Mt,Ar,Ut,Pr,nr,en,Ka.x,Ka.y)&&et(Ka.prev,Ka,Ka.next)>=0||(Ka=Ka.prevZ,di.x>=fn&&di.x<=Dn&&di.y>=Tn&&di.y<=Kn&&di!==Ge&&di!==st&&re(Mt,Ar,Ut,Pr,nr,en,di.x,di.y)&&et(di.prev,di,di.next)>=0))return!1;di=di.nextZ}for(;Ka&&Ka.z>=ka;){if(Ka.x>=fn&&Ka.x<=Dn&&Ka.y>=Tn&&Ka.y<=Kn&&Ka!==Ge&&Ka!==st&&re(Mt,Ar,Ut,Pr,nr,en,Ka.x,Ka.y)&&et(Ka.prev,Ka,Ka.next)>=0)return!1;Ka=Ka.prevZ}for(;di&&di.z<=_i;){if(di.x>=fn&&di.x<=Dn&&di.y>=Tn&&di.y<=Kn&&di!==Ge&&di!==st&&re(Mt,Ar,Ut,Pr,nr,en,di.x,di.y)&&et(di.prev,di,di.next)>=0)return!1;di=di.nextZ}return!0}function Ku(K,O){let ne=K;do{const Se=ne.prev,Ge=ne.next.next;!xt(Se,Ge)&&At(Se,ne,ne.next,Ge)&&It(Se,Ge)&&It(Ge,Se)&&(O.push(Se.i,ne.i,Ge.i),sr(ne),sr(ne.next),ne=K=Ge),ne=ne.next}while(ne!==K);return ju(ne)}function Eo(K,O,ne,Se,Ge,rt){let st=K;do{let Mt=st.next.next;for(;Mt!==st.prev;){if(st.i!==Mt.i&&Le(st,Mt)){let Ut=ar(st,Mt);return st=ju(st,st.next),Ut=ju(Ut,Ut.next),zs(st,O,ne,Se,Ge,rt,0),void zs(Ut,O,ne,Se,Ge,rt,0)}Mt=Mt.next}st=st.next}while(st!==K)}function hs(K,O){return K.x-O.x}function gs(K,O){const ne=function(Ge,rt){let st=rt;const Mt=Ge.x,Ut=Ge.y;let nr,Ar=-1/0;do{if(Ut<=st.y&&Ut>=st.next.y&&st.next.y!==st.y){const Dn=st.x+(Ut-st.y)*(st.next.x-st.x)/(st.next.y-st.y);if(Dn<=Mt&&Dn>Ar&&(Ar=Dn,nr=st.x=st.x&&st.x>=en&&Mt!==st.x&&re(Utnr.x||st.x===nr.x&&De(nr,st)))&&(nr=st,Tn=Dn)}st=st.next}while(st!==Pr);return nr}(K,O);if(!ne)return O;const Se=ar(ne,K);return ju(Se,Se.next),ju(ne,ne.next)}function De(K,O){return et(K.prev,K,O.prev)<0&&et(O.next,K,K.next)<0}function G(K,O,ne,Se,Ge){return(K=1431655765&((K=858993459&((K=252645135&((K=16711935&((K=(K-ne)*Ge|0)|K<<8))|K<<4))|K<<2))|K<<1))|(O=1431655765&((O=858993459&((O=252645135&((O=16711935&((O=(O-Se)*Ge|0)|O<<8))|O<<4))|O<<2))|O<<1))<<1}function xe(K){let O=K,ne=K;do(O.x=(K-st)*(rt-Mt)&&(K-st)*(Se-Mt)>=(ne-st)*(O-Mt)&&(ne-st)*(rt-Mt)>=(Ge-st)*(Se-Mt)}function Le(K,O){return K.next.i!==O.i&&K.prev.i!==O.i&&!function(ne,Se){let Ge=ne;do{if(Ge.i!==ne.i&&Ge.next.i!==ne.i&&Ge.i!==Se.i&&Ge.next.i!==Se.i&&At(Ge,Ge.next,ne,Se))return!0;Ge=Ge.next}while(Ge!==ne);return!1}(K,O)&&(It(K,O)&&It(O,K)&&function(ne,Se){let Ge=ne,rt=!1;const st=(ne.x+Se.x)/2,Mt=(ne.y+Se.y)/2;do Ge.y>Mt!=Ge.next.y>Mt&&Ge.next.y!==Ge.y&&st<(Ge.next.x-Ge.x)*(Mt-Ge.y)/(Ge.next.y-Ge.y)+Ge.x&&(rt=!rt),Ge=Ge.next;while(Ge!==ne);return rt}(K,O)&&(et(K.prev,K,O.prev)||et(K,O.prev,O))||xt(K,O)&&et(K.prev,K,K.next)>0&&et(O.prev,O,O.next)>0)}function et(K,O,ne){return(O.y-K.y)*(ne.x-O.x)-(O.x-K.x)*(ne.y-O.y)}function xt(K,O){return K.x===O.x&&K.y===O.y}function At(K,O,ne,Se){const Ge=gt(et(K,O,ne)),rt=gt(et(K,O,Se)),st=gt(et(ne,Se,K)),Mt=gt(et(ne,Se,O));return Ge!==rt&&st!==Mt||!(Ge!==0||!lt(K,ne,O))||!(rt!==0||!lt(K,Se,O))||!(st!==0||!lt(ne,K,Se))||!(Mt!==0||!lt(ne,O,Se))}function lt(K,O,ne){return O.x<=Math.max(K.x,ne.x)&&O.x>=Math.min(K.x,ne.x)&&O.y<=Math.max(K.y,ne.y)&&O.y>=Math.min(K.y,ne.y)}function gt(K){return K>0?1:K<0?-1:0}function It(K,O){return et(K.prev,K,K.next)<0?et(K,O,K.next)>=0&&et(K,K.prev,O)>=0:et(K,O,K.prev)<0||et(K,K.next,O)<0}function ar(K,O){const ne=pr(K.i,K.x,K.y),Se=pr(O.i,O.x,O.y),Ge=K.next,rt=O.prev;return K.next=O,O.prev=K,ne.next=Ge,Ge.prev=ne,Se.next=ne,ne.prev=Se,rt.next=Se,Se.prev=rt,Se}function Jt(K,O,ne,Se){const Ge=pr(K,O,ne);return Se?(Ge.next=Se.next,Ge.prev=Se,Se.next.prev=Ge,Se.next=Ge):(Ge.prev=Ge,Ge.next=Ge),Ge}function sr(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 pr(K,O,ne){return{i:K,x:O,y:ne,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function fr(K,O,ne){const Se=ne.patternDependencies;let Ge=!1;for(const rt of O){const st=rt.paint.get(`${K}-pattern`);st.isConstant()||(Ge=!0);const Mt=st.constantOr(null);Mt&&(Ge=!0,Se[Mt.to]=!0,Se[Mt.from]=!0)}return Ge}function Wt(K,O,ne,Se,Ge){const rt=Ge.patternDependencies;for(const st of O){const Mt=st.paint.get(`${K}-pattern`).value;if(Mt.kind!=="constant"){let Ut=Mt.evaluate({zoom:Se-1},ne,{},Ge.availableImages),nr=Mt.evaluate({zoom:Se},ne,{},Ge.availableImages),Ar=Mt.evaluate({zoom:Se+1},ne,{},Ge.availableImages);Ut=Ut&&Ut.name?Ut.name:Ut,nr=nr&&nr.name?nr.name:nr,Ar=Ar&&Ar.name?Ar.name:Ar,rt[Ut]=!0,rt[nr]=!0,rt[Ar]=!0,ne.patterns[st.id]={min:Ut,mid:nr,max:Ar}}}return ne}class rr{constructor(O){this.zoom=O.zoom,this.overscaling=O.overscaling,this.layers=O.layers,this.layerIds=this.layers.map(ne=>ne.id),this.index=O.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Mu,this.indexArray=new ur,this.indexArray2=new kr,this.programConfigurations=new Pl(O.layers,O.zoom),this.segments=new wn,this.segments2=new wn,this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(O,ne,Se){this.hasPattern=fr("fill",this.layers,ne);const Ge=this.layers[0].layout.get("fill-sort-key"),rt=!Ge.isConstant(),st=[];for(const{feature:Mt,id:Ut,index:nr,sourceLayerIndex:Ar}of O){const Pr=this.layers[0]._featureFilter.needGeometry,en=Er(Mt,Pr);if(!this.layers[0]._featureFilter.filter(new cl(this.zoom),en,Se))continue;const fn=rt?Ge.evaluate(en,{},Se,ne.availableImages):void 0,Tn={id:Ut,properties:Mt.properties,type:Mt.type,sourceLayerIndex:Ar,index:nr,geometry:Pr?en.geometry:St(Mt),patterns:{},sortKey:fn};st.push(Tn)}rt&&st.sort((Mt,Ut)=>Mt.sortKey-Ut.sortKey);for(const Mt of st){const{geometry:Ut,index:nr,sourceLayerIndex:Ar}=Mt;if(this.hasPattern){const Pr=Wt("fill",this.layers,Mt,this.zoom,ne);this.patternFeatures.push(Pr)}else this.addFeature(Mt,Ut,nr,Se,{});ne.featureIndex.insert(O[nr].feature,Ut,nr,Ar,this.index)}}update(O,ne,Se){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(O,ne,this.stateDependentLayers,Se)}addFeatures(O,ne,Se){for(const Ge of this.patternFeatures)this.addFeature(Ge,Ge.geometry,Ge.index,ne,Se)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(O){this.uploaded||(this.layoutVertexBuffer=O.createVertexBuffer(this.layoutVertexArray,Xl),this.indexBuffer=O.createIndexBuffer(this.indexArray),this.indexBuffer2=O.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(O),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(O,ne,Se,Ge,rt){for(const st of Mc(ne,500)){let Mt=0;for(const fn of st)Mt+=fn.length;const Ut=this.segments.prepareSegment(Mt,this.layoutVertexArray,this.indexArray),nr=Ut.vertexLength,Ar=[],Pr=[];for(const fn of st){if(fn.length===0)continue;fn!==st[0]&&Pr.push(Ar.length/2);const Tn=this.segments2.prepareSegment(fn.length,this.layoutVertexArray,this.indexArray2),Dn=Tn.vertexLength;this.layoutVertexArray.emplaceBack(fn[0].x,fn[0].y),this.indexArray2.emplaceBack(Dn+fn.length-1,Dn),Ar.push(fn[0].x),Ar.push(fn[0].y);for(let Kn=1;Kn>3}if(Ge--,Se===1||Se===2)rt+=K.readSVarint(),st+=K.readSVarint(),Se===1&&(O&&Mt.push(O),O=[]),O.push(new Ea(rt,st));else{if(Se!==7)throw new Error("unknown command "+Se);O&&O.push(O[0].clone())}}return O&&Mt.push(O),Mt},Sa.prototype.bbox=function(){var K=this._pbf;K.pos=this._geometry;for(var O=K.readVarint()+K.pos,ne=1,Se=0,Ge=0,rt=0,st=1/0,Mt=-1/0,Ut=1/0,nr=-1/0;K.pos>3}if(Se--,ne===1||ne===2)(Ge+=K.readSVarint())Mt&&(Mt=Ge),(rt+=K.readSVarint())nr&&(nr=rt);else if(ne!==7)throw new Error("unknown command "+ne)}return[st,Ut,Mt,nr]},Sa.prototype.toGeoJSON=function(K,O,ne){var Se,Ge,rt=this.extent*Math.pow(2,ne),st=this.extent*K,Mt=this.extent*O,Ut=this.loadGeometry(),nr=Sa.types[this.type];function Ar(fn){for(var Tn=0;Tn>3;Ge=st===1?Se.readString():st===2?Se.readFloat():st===3?Se.readDouble():st===4?Se.readVarint64():st===5?Se.readVarint():st===6?Se.readSVarint():st===7?Se.readBoolean():null}return Ge}(ne))}ys.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 O=this._pbf.readVarint()+this._pbf.pos;return new Ri(this._pbf,O,this.extent,this._keys,this._values)};var fl=Yi;function ol(K,O,ne){if(K===3){var Se=new fl(ne,ne.readVarint()+ne.pos);Se.length&&(O[Se.name]=Se)}}Ta.VectorTile=function(K,O){this.layers=K.readFields(ol,{},O)},Ta.VectorTileFeature=Ga,Ta.VectorTileLayer=Yi;const dl=Ta.VectorTileFeature.types,hl=Math.pow(2,13);function Vu(K,O,ne,Se,Ge,rt,st,Mt){K.emplaceBack(O,ne,2*Math.floor(Se*hl)+st,Ge*hl*2,rt*hl*2,Math.round(Mt))}class tl{constructor(O){this.zoom=O.zoom,this.overscaling=O.overscaling,this.layers=O.layers,this.layerIds=this.layers.map(ne=>ne.id),this.index=O.index,this.hasPattern=!1,this.layoutVertexArray=new Wu,this.centroidVertexArray=new Ms,this.indexArray=new ur,this.programConfigurations=new Pl(O.layers,O.zoom),this.segments=new wn,this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(O,ne,Se){this.features=[],this.hasPattern=fr("fill-extrusion",this.layers,ne);for(const{feature:Ge,id:rt,index:st,sourceLayerIndex:Mt}of O){const Ut=this.layers[0]._featureFilter.needGeometry,nr=Er(Ge,Ut);if(!this.layers[0]._featureFilter.filter(new cl(this.zoom),nr,Se))continue;const Ar={id:rt,sourceLayerIndex:Mt,index:st,geometry:Ut?nr.geometry:St(Ge),properties:Ge.properties,type:Ge.type,patterns:{}};this.hasPattern?this.features.push(Wt("fill-extrusion",this.layers,Ar,this.zoom,ne)):this.addFeature(Ar,Ar.geometry,st,Se,{}),ne.featureIndex.insert(Ge,Ar.geometry,st,Mt,this.index,!0)}}addFeatures(O,ne,Se){for(const Ge of this.features){const{geometry:rt}=Ge;this.addFeature(Ge,rt,Ge.index,ne,Se)}}update(O,ne,Se){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(O,ne,this.stateDependentLayers,Se)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(O){this.uploaded||(this.layoutVertexBuffer=O.createVertexBuffer(this.layoutVertexArray,aa),this.centroidVertexBuffer=O.createVertexBuffer(this.centroidVertexArray,la.members,!0),this.indexBuffer=O.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(O),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(O,ne,Se,Ge,rt){for(const st of Mc(ne,500)){const Mt={x:0,y:0,vertexCount:0};let Ut=0;for(const Tn of st)Ut+=Tn.length;let nr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const Tn of st){if(Tn.length===0||Mf(Tn))continue;let Dn=0;for(let Kn=0;Kn=1){const _i=Tn[Kn-1];if(!pu(ka,_i)){nr.vertexLength+4>wn.MAX_VERTEX_ARRAY_LENGTH&&(nr=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ka=ka.sub(_i)._perp()._unit(),di=_i.dist(ka);Dn+di>32768&&(Dn=0),Vu(this.layoutVertexArray,ka.x,ka.y,Ka.x,Ka.y,0,0,Dn),Vu(this.layoutVertexArray,ka.x,ka.y,Ka.x,Ka.y,0,1,Dn),Mt.x+=2*ka.x,Mt.y+=2*ka.y,Mt.vertexCount+=2,Dn+=di,Vu(this.layoutVertexArray,_i.x,_i.y,Ka.x,Ka.y,0,0,Dn),Vu(this.layoutVertexArray,_i.x,_i.y,Ka.x,Ka.y,0,1,Dn),Mt.x+=2*_i.x,Mt.y+=2*_i.y,Mt.vertexCount+=2;const Gi=nr.vertexLength;this.indexArray.emplaceBack(Gi,Gi+2,Gi+1),this.indexArray.emplaceBack(Gi+1,Gi+2,Gi+3),nr.vertexLength+=4,nr.primitiveLength+=2}}}}if(nr.vertexLength+Ut>wn.MAX_VERTEX_ARRAY_LENGTH&&(nr=this.segments.prepareSegment(Ut,this.layoutVertexArray,this.indexArray)),dl[O.type]!=="Polygon")continue;const Ar=[],Pr=[],en=nr.vertexLength;for(const Tn of st)if(Tn.length!==0){Tn!==st[0]&&Pr.push(Ar.length/2);for(let Dn=0;DnGl)||K.y===O.y&&(K.y<0||K.y>Gl)}function Mf(K){return K.every(O=>O.x<0)||K.every(O=>O.x>Gl)||K.every(O=>O.y<0)||K.every(O=>O.y>Gl)}let Zf;Ja("FillExtrusionBucket",tl,{omit:["layers","features"]});var Dd={get paint(){return Zf=Zf||new Je({"fill-extrusion-opacity":new qo(ue["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new as(ue["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new qo(ue["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new qo(ue["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new uf(ue["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new as(ue["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new as(ue["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new qo(ue["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Rd extends ce{constructor(O){super(O,Dd)}createBucket(O){return new tl(O)}queryRadius(){return Zn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(O,ne,Se,Ge,rt,st,Mt,Ut){const nr=da(O,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),st.angle,Mt),Ar=this.paint.get("fill-extrusion-height").evaluate(ne,Se),Pr=this.paint.get("fill-extrusion-base").evaluate(ne,Se),en=function(Tn,Dn,Kn,ka){const _i=[];for(const Ka of Tn){const di=[Ka.x,Ka.y,0,1];ui(di,di,Dn),_i.push(new i(di[0]/di[3],di[1]/di[3]))}return _i}(nr,Ut),fn=function(Tn,Dn,Kn,ka){const _i=[],Ka=[],di=ka[8]*Dn,Gi=ka[9]*Dn,vo=ka[10]*Dn,Yo=ka[11]*Dn,sl=ka[8]*Kn,is=ka[9]*Kn,Go=ka[10]*Kn,Ls=ka[11]*Kn;for(const ws of Tn){const _s=[],oo=[];for(const Us of ws){const Is=Us.x,Al=Us.y,Nc=ka[0]*Is+ka[4]*Al+ka[12],Ic=ka[1]*Is+ka[5]*Al+ka[13],kh=ka[2]*Is+ka[6]*Al+ka[14],Sd=ka[3]*Is+ka[7]*Al+ka[15],Kf=kh+vo,bh=Sd+Yo,hd=Nc+sl,dd=Ic+is,pd=kh+Go,Ef=Sd+Ls,Ch=new i((Nc+di)/bh,(Ic+Gi)/bh);Ch.z=Kf/bh,_s.push(Ch);const od=new i(hd/Ef,dd/Ef);od.z=pd/Ef,oo.push(od)}_i.push(_s),Ka.push(oo)}return[_i,Ka]}(Ge,Pr,Ar,Ut);return function(Tn,Dn,Kn){let ka=1/0;Sn(Kn,Dn)&&(ka=Gd(Kn,Dn[0]));for(let _i=0;_ine.id),this.index=O.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(ne=>{this.gradients[ne.id]={}}),this.layoutVertexArray=new xc,this.layoutVertexArray2=new ke,this.indexArray=new ur,this.programConfigurations=new Pl(O.layers,O.zoom),this.segments=new wn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(ne=>ne.isStateDependent()).map(ne=>ne.id)}populate(O,ne,Se){this.hasPattern=fr("line",this.layers,ne);const Ge=this.layers[0].layout.get("line-sort-key"),rt=!Ge.isConstant(),st=[];for(const{feature:Mt,id:Ut,index:nr,sourceLayerIndex:Ar}of O){const Pr=this.layers[0]._featureFilter.needGeometry,en=Er(Mt,Pr);if(!this.layers[0]._featureFilter.filter(new cl(this.zoom),en,Se))continue;const fn=rt?Ge.evaluate(en,{},Se):void 0,Tn={id:Ut,properties:Mt.properties,type:Mt.type,sourceLayerIndex:Ar,index:nr,geometry:Pr?en.geometry:St(Mt),patterns:{},sortKey:fn};st.push(Tn)}rt&&st.sort((Mt,Ut)=>Mt.sortKey-Ut.sortKey);for(const Mt of st){const{geometry:Ut,index:nr,sourceLayerIndex:Ar}=Mt;if(this.hasPattern){const Pr=Wt("line",this.layers,Mt,this.zoom,ne);this.patternFeatures.push(Pr)}else this.addFeature(Mt,Ut,nr,Se,{});ne.featureIndex.insert(O[nr].feature,Ut,nr,Ar,this.index)}}update(O,ne,Se){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(O,ne,this.stateDependentLayers,Se)}addFeatures(O,ne,Se){for(const Ge of this.patternFeatures)this.addFeature(Ge,Ge.geometry,Ge.index,ne,Se)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(O){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=O.createVertexBuffer(this.layoutVertexArray2,Kd)),this.layoutVertexBuffer=O.createVertexBuffer(this.layoutVertexArray,Zd),this.indexBuffer=O.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(O),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(O){if(O.properties&&Object.prototype.hasOwnProperty.call(O.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(O.properties,"mapbox_clip_end"))return{start:+O.properties.mapbox_clip_start,end:+O.properties.mapbox_clip_end}}addFeature(O,ne,Se,Ge,rt){const st=this.layers[0].layout,Mt=st.get("line-join").evaluate(O,{}),Ut=st.get("line-cap"),nr=st.get("line-miter-limit"),Ar=st.get("line-round-limit");this.lineClips=this.lineFeatureClips(O);for(const Pr of ne)this.addLine(Pr,O,Mt,Ut,nr,Ar);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,O,Se,rt,Ge)}addLine(O,ne,Se,Ge,rt,st){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let ka=0;ka=2&&O[Ut-1].equals(O[Ut-2]);)Ut--;let nr=0;for(;nr0;if(Yo&&ka>nr){const Ls=en.dist(fn);if(Ls>2*Ar){const ws=en.sub(en.sub(fn)._mult(Ar/Ls)._round());this.updateDistance(fn,ws),this.addCurrentVertex(ws,Dn,0,0,Pr),fn=ws}}const is=fn&&Tn;let Go=is?Se:Mt?"butt":Ge;if(is&&Go==="round"&&(Girt&&(Go="bevel"),Go==="bevel"&&(Gi>2&&(Go="flipbevel"),Gi100)_i=Kn.mult(-1);else{const Ls=Gi*Dn.add(Kn).mag()/Dn.sub(Kn).mag();_i._perp()._mult(Ls*(sl?-1:1))}this.addCurrentVertex(en,_i,0,0,Pr),this.addCurrentVertex(en,_i.mult(-1),0,0,Pr)}else if(Go==="bevel"||Go==="fakeround"){const Ls=-Math.sqrt(Gi*Gi-1),ws=sl?Ls:0,_s=sl?0:Ls;if(fn&&this.addCurrentVertex(en,Dn,ws,_s,Pr),Go==="fakeround"){const oo=Math.round(180*vo/Math.PI/20);for(let Us=1;Us2*Ar){const ws=en.add(Tn.sub(en)._mult(Ar/Ls)._round());this.updateDistance(en,ws),this.addCurrentVertex(ws,Kn,0,0,Pr),en=ws}}}}addCurrentVertex(O,ne,Se,Ge,rt,st=!1){const Mt=ne.y*Ge-ne.x,Ut=-ne.y-ne.x*Ge;this.addHalfVertex(O,ne.x+ne.y*Se,ne.y-ne.x*Se,st,!1,Se,rt),this.addHalfVertex(O,Mt,Ut,st,!0,-Ge,rt),this.distance>Od/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(O,ne,Se,Ge,rt,st))}addHalfVertex({x:O,y:ne},Se,Ge,rt,st,Mt,Ut){const nr=.5*(this.lineClips?this.scaledDistance*(Od-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((O<<1)+(rt?1:0),(ne<<1)+(st?1:0),Math.round(63*Se)+128,Math.round(63*Ge)+128,1+(Mt===0?0:Mt<0?-1:1)|(63&nr)<<2,nr>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const Ar=Ut.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Ar),Ut.primitiveLength++),st?this.e2=Ar:this.e1=Ar}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(O,ne){this.distance+=O.dist(ne),this.updateScaledDistance()}}let zd,dv;Ja("LineBucket",Hd,{omit:["layers","patternFeatures"]});var kp={get paint(){return dv=dv||new Je({"line-opacity":new as(ue.paint_line["line-opacity"]),"line-color":new as(ue.paint_line["line-color"]),"line-translate":new qo(ue.paint_line["line-translate"]),"line-translate-anchor":new qo(ue.paint_line["line-translate-anchor"]),"line-width":new as(ue.paint_line["line-width"]),"line-gap-width":new as(ue.paint_line["line-gap-width"]),"line-offset":new as(ue.paint_line["line-offset"]),"line-blur":new as(ue.paint_line["line-blur"]),"line-dasharray":new Pc(ue.paint_line["line-dasharray"]),"line-pattern":new uf(ue.paint_line["line-pattern"]),"line-gradient":new bc(ue.paint_line["line-gradient"])})},get layout(){return zd=zd||new Je({"line-cap":new qo(ue.layout_line["line-cap"]),"line-join":new as(ue.layout_line["line-join"]),"line-miter-limit":new qo(ue.layout_line["line-miter-limit"]),"line-round-limit":new qo(ue.layout_line["line-round-limit"]),"line-sort-key":new as(ue.layout_line["line-sort-key"])})}};class yh extends as{possiblyEvaluate(O,ne){return ne=new cl(Math.floor(ne.zoom),{now:ne.now,fadeDuration:ne.fadeDuration,zoomHistory:ne.zoomHistory,transition:ne.transition}),super.possiblyEvaluate(O,ne)}evaluate(O,ne,Se,Ge){return ne=E({},ne,{zoom:Math.floor(ne.zoom)}),super.evaluate(O,ne,Se,Ge)}}let Cp;class pv extends ce{constructor(O){super(O,kp),this.gradientVersion=0,Cp||(Cp=new yh(kp.paint.properties["line-width"].specification),Cp.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(O){if(O==="line-gradient"){const ne=this.gradientExpression();this.stepInterpolant=!!function(Se){return Se._styleExpression!==void 0}(ne)&&ne._styleExpression.expression instanceof $n,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(O,ne){super.recalculate(O,ne),this.paint._values["line-floorwidth"]=Cp.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,O)}createBucket(O){return new Hd(O)}queryRadius(O){const ne=O,Se=Nh(pn("line-width",this,ne),pn("line-gap-width",this,ne)),Ge=pn("line-offset",this,ne);return Se/2+Math.abs(Ge)+Zn(this.paint.get("line-translate"))}queryIntersectsFeature(O,ne,Se,Ge,rt,st,Mt){const Ut=da(O,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),st.angle,Mt),nr=Mt/2*Nh(this.paint.get("line-width").evaluate(ne,Se),this.paint.get("line-gap-width").evaluate(ne,Se)),Ar=this.paint.get("line-offset").evaluate(ne,Se);return Ar&&(Ge=function(Pr,en){const fn=[];for(let Tn=0;Tn=3){for(let Kn=0;Kn0?O+2*K:K}const Gp=kt([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Gv=kt([{name:"a_projected_pos",components:3,type:"Float32"}],4);kt([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Hv=kt([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);kt([{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 vv=kt([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Hp=kt([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function $p(K,O,ne){return K.sections.forEach(Se=>{Se.text=function(Ge,rt,st){const Mt=rt.layout.get("text-transform").evaluate(st,{});return Mt==="uppercase"?Ge=Ge.toLocaleUpperCase():Mt==="lowercase"&&(Ge=Ge.toLocaleLowerCase()),Cl.applyArabicShaping&&(Ge=Cl.applyArabicShaping(Ge)),Ge}(Se.text,O,ne)}),K}kt([{name:"triangle",components:3,type:"Uint16"}]),kt([{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"}]),kt([{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"}]),kt([{type:"Float32",name:"offsetX"}]),kt([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),kt([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Zc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Ju=24,id=hc,mv=function(K,O,ne,Se,Ge){var rt,st,Mt=8*Ge-Se-1,Ut=(1<>1,Ar=-7,Pr=Ge-1,en=-1,fn=K[O+Pr];for(Pr+=en,rt=fn&(1<<-Ar)-1,fn>>=-Ar,Ar+=Mt;Ar>0;rt=256*rt+K[O+Pr],Pr+=en,Ar-=8);for(st=rt&(1<<-Ar)-1,rt>>=-Ar,Ar+=Se;Ar>0;st=256*st+K[O+Pr],Pr+=en,Ar-=8);if(rt===0)rt=1-nr;else{if(rt===Ut)return st?NaN:1/0*(fn?-1:1);st+=Math.pow(2,Se),rt-=nr}return(fn?-1:1)*st*Math.pow(2,rt-Se)},$v=function(K,O,ne,Se,Ge,rt){var st,Mt,Ut,nr=8*rt-Ge-1,Ar=(1<>1,en=Ge===23?Math.pow(2,-24)-Math.pow(2,-77):0,fn=0,Tn=1,Dn=O<0||O===0&&1/O<0?1:0;for(O=Math.abs(O),isNaN(O)||O===1/0?(Mt=isNaN(O)?1:0,st=Ar):(st=Math.floor(Math.log(O)/Math.LN2),O*(Ut=Math.pow(2,-st))<1&&(st--,Ut*=2),(O+=st+Pr>=1?en/Ut:en*Math.pow(2,1-Pr))*Ut>=2&&(st++,Ut/=2),st+Pr>=Ar?(Mt=0,st=Ar):st+Pr>=1?(Mt=(O*Ut-1)*Math.pow(2,Ge),st+=Pr):(Mt=O*Math.pow(2,Pr-1)*Math.pow(2,Ge),st=0));Ge>=8;K[ne+fn]=255&Mt,fn+=Tn,Mt/=256,Ge-=8);for(st=st<0;K[ne+fn]=255&st,fn+=Tn,st/=256,nr-=8);K[ne+fn-Tn]|=128*Dn};function hc(K){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(K)?K:new Uint8Array(K||0),this.pos=0,this.type=0,this.length=this.buf.length}hc.Varint=0,hc.Fixed64=1,hc.Bytes=2,hc.Fixed32=5;var B0=4294967296,Wp=1/B0,km=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Fd(K){return K.type===hc.Bytes?K.readVarint()+K.pos:K.pos+1}function Yp(K,O,ne){return ne?4294967296*O+(K>>>0):4294967296*(O>>>0)+(K>>>0)}function Cm(K,O,ne){var Se=O<=16383?1:O<=2097151?2:O<=268435455?3:Math.floor(Math.log(O)/(7*Math.LN2));ne.realloc(Se);for(var Ge=ne.pos-1;Ge>=K;Ge--)ne.buf[Ge+Se]=ne.buf[Ge]}function U0(K,O){for(var ne=0;ne>>8,K[ne+2]=O>>>16,K[ne+3]=O>>>24}function S1(K,O){return(K[O]|K[O+1]<<8|K[O+2]<<16)+(K[O+3]<<24)}hc.prototype={destroy:function(){this.buf=null},readFields:function(K,O,ne){for(ne=ne||this.length;this.pos>3,rt=this.pos;this.type=7&Se,K(Ge,O,this),this.pos===rt&&this.skip(Se)}return O},readMessage:function(K,O){return this.readFields(K,O,this.readVarint()+this.pos)},readFixed32:function(){var K=Lm(this.buf,this.pos);return this.pos+=4,K},readSFixed32:function(){var K=S1(this.buf,this.pos);return this.pos+=4,K},readFixed64:function(){var K=Lm(this.buf,this.pos)+Lm(this.buf,this.pos+4)*B0;return this.pos+=8,K},readSFixed64:function(){var K=Lm(this.buf,this.pos)+S1(this.buf,this.pos+4)*B0;return this.pos+=8,K},readFloat:function(){var K=mv(this.buf,this.pos,!0,23,4);return this.pos+=4,K},readDouble:function(){var K=mv(this.buf,this.pos,!0,52,8);return this.pos+=8,K},readVarint:function(K){var O,ne,Se=this.buf;return O=127&(ne=Se[this.pos++]),ne<128?O:(O|=(127&(ne=Se[this.pos++]))<<7,ne<128?O:(O|=(127&(ne=Se[this.pos++]))<<14,ne<128?O:(O|=(127&(ne=Se[this.pos++]))<<21,ne<128?O:function(Ge,rt,st){var Mt,Ut,nr=st.buf;if(Mt=(112&(Ut=nr[st.pos++]))>>4,Ut<128||(Mt|=(127&(Ut=nr[st.pos++]))<<3,Ut<128)||(Mt|=(127&(Ut=nr[st.pos++]))<<10,Ut<128)||(Mt|=(127&(Ut=nr[st.pos++]))<<17,Ut<128)||(Mt|=(127&(Ut=nr[st.pos++]))<<24,Ut<128)||(Mt|=(1&(Ut=nr[st.pos++]))<<31,Ut<128))return Yp(Ge,Mt,rt);throw new Error("Expected varint not more than 10 bytes")}(O|=(15&(ne=Se[this.pos]))<<28,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,O=this.pos;return this.pos=K,K-O>=12&&km?function(ne,Se,Ge){return km.decode(ne.subarray(Se,Ge))}(this.buf,O,K):function(ne,Se,Ge){for(var rt="",st=Se;st239?4:Ar>223?3:Ar>191?2:1;if(st+en>Ge)break;en===1?Ar<128&&(Pr=Ar):en===2?(192&(Mt=ne[st+1]))==128&&(Pr=(31&Ar)<<6|63&Mt)<=127&&(Pr=null):en===3?(Ut=ne[st+2],(192&(Mt=ne[st+1]))==128&&(192&Ut)==128&&((Pr=(15&Ar)<<12|(63&Mt)<<6|63&Ut)<=2047||Pr>=55296&&Pr<=57343)&&(Pr=null)):en===4&&(Ut=ne[st+2],nr=ne[st+3],(192&(Mt=ne[st+1]))==128&&(192&Ut)==128&&(192&nr)==128&&((Pr=(15&Ar)<<18|(63&Mt)<<12|(63&Ut)<<6|63&nr)<=65535||Pr>=1114112)&&(Pr=null)),Pr===null?(Pr=65533,en=1):Pr>65535&&(Pr-=65536,rt+=String.fromCharCode(Pr>>>10&1023|55296),Pr=56320|1023&Pr),rt+=String.fromCharCode(Pr),st+=en}return rt}(this.buf,O,K)},readBytes:function(){var K=this.readVarint()+this.pos,O=this.buf.subarray(this.pos,K);return this.pos=K,O},readPackedVarint:function(K,O){if(this.type!==hc.Bytes)return K.push(this.readVarint(O));var ne=Fd(this);for(K=K||[];this.pos127;);else if(O===hc.Bytes)this.pos=this.readVarint()+this.pos;else if(O===hc.Fixed32)this.pos+=4;else{if(O!==hc.Fixed64)throw new Error("Unimplemented type: "+O);this.pos+=8}},writeTag:function(K,O){this.writeVarint(K<<3|O)},realloc:function(K){for(var O=this.length||16;O268435455||K<0?function(O,ne){var Se,Ge;if(O>=0?(Se=O%4294967296|0,Ge=O/4294967296|0):(Ge=~(-O/4294967296),4294967295^(Se=~(-O%4294967296))?Se=Se+1|0:(Se=0,Ge=Ge+1|0)),O>=18446744073709552e3||O<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");ne.realloc(10),function(rt,st,Mt){Mt.buf[Mt.pos++]=127&rt|128,rt>>>=7,Mt.buf[Mt.pos++]=127&rt|128,rt>>>=7,Mt.buf[Mt.pos++]=127&rt|128,rt>>>=7,Mt.buf[Mt.pos++]=127&rt|128,Mt.buf[Mt.pos]=127&(rt>>>=7)}(Se,0,ne),function(rt,st){var Mt=(7&rt)<<4;st.buf[st.pos++]|=Mt|((rt>>>=3)?128:0),rt&&(st.buf[st.pos++]=127&rt|((rt>>>=7)?128:0),rt&&(st.buf[st.pos++]=127&rt|((rt>>>=7)?128:0),rt&&(st.buf[st.pos++]=127&rt|((rt>>>=7)?128:0),rt&&(st.buf[st.pos++]=127&rt|((rt>>>=7)?128:0),rt&&(st.buf[st.pos++]=127&rt)))))}(Ge,ne)}(K,this):(this.realloc(4),this.buf[this.pos++]=127&K|(K>127?128:0),K<=127||(this.buf[this.pos++]=127&(K>>>=7)|(K>127?128:0),K<=127||(this.buf[this.pos++]=127&(K>>>=7)|(K>127?128:0),K<=127||(this.buf[this.pos++]=K>>>7&127))))},writeSVarint:function(K){this.writeVarint(K<0?2*-K-1:2*K)},writeBoolean:function(K){this.writeVarint(!!K)},writeString:function(K){K=String(K),this.realloc(4*K.length),this.pos++;var O=this.pos;this.pos=function(Se,Ge,rt){for(var st,Mt,Ut=0;Ut55295&&st<57344){if(!Mt){st>56319||Ut+1===Ge.length?(Se[rt++]=239,Se[rt++]=191,Se[rt++]=189):Mt=st;continue}if(st<56320){Se[rt++]=239,Se[rt++]=191,Se[rt++]=189,Mt=st;continue}st=Mt-55296<<10|st-56320|65536,Mt=null}else Mt&&(Se[rt++]=239,Se[rt++]=191,Se[rt++]=189,Mt=null);st<128?Se[rt++]=st:(st<2048?Se[rt++]=st>>6|192:(st<65536?Se[rt++]=st>>12|224:(Se[rt++]=st>>18|240,Se[rt++]=st>>12&63|128),Se[rt++]=st>>6&63|128),Se[rt++]=63&st|128)}return rt}(this.buf,K,this.pos);var ne=this.pos-O;ne>=128&&Cm(O,ne,this),this.pos=O-1,this.writeVarint(ne),this.pos+=ne},writeFloat:function(K){this.realloc(4),$v(this.buf,K,this.pos,!0,23,4),this.pos+=4},writeDouble:function(K){this.realloc(8),$v(this.buf,K,this.pos,!0,52,8),this.pos+=8},writeBytes:function(K){var O=K.length;this.writeVarint(O),this.realloc(O);for(var ne=0;ne=128&&Cm(ne,Se,this),this.pos=ne-1,this.writeVarint(Se),this.pos+=Se},writeMessage:function(K,O,ne){this.writeTag(K,hc.Bytes),this.writeRawMessage(O,ne)},writePackedVarint:function(K,O){O.length&&this.writeMessage(K,U0,O)},writePackedSVarint:function(K,O){O.length&&this.writeMessage(K,Nx,O)},writePackedBoolean:function(K,O){O.length&&this.writeMessage(K,jx,O)},writePackedFloat:function(K,O){O.length&&this.writeMessage(K,Bx,O)},writePackedDouble:function(K,O){O.length&&this.writeMessage(K,Ux,O)},writePackedFixed32:function(K,O){O.length&&this.writeMessage(K,Vx,O)},writePackedSFixed32:function(K,O){O.length&&this.writeMessage(K,qx,O)},writePackedFixed64:function(K,O){O.length&&this.writeMessage(K,Gx,O)},writePackedSFixed64:function(K,O){O.length&&this.writeMessage(K,Pm,O)},writeBytesField:function(K,O){this.writeTag(K,hc.Bytes),this.writeBytes(O)},writeFixed32Field:function(K,O){this.writeTag(K,hc.Fixed32),this.writeFixed32(O)},writeSFixed32Field:function(K,O){this.writeTag(K,hc.Fixed32),this.writeSFixed32(O)},writeFixed64Field:function(K,O){this.writeTag(K,hc.Fixed64),this.writeFixed64(O)},writeSFixed64Field:function(K,O){this.writeTag(K,hc.Fixed64),this.writeSFixed64(O)},writeVarintField:function(K,O){this.writeTag(K,hc.Varint),this.writeVarint(O)},writeSVarintField:function(K,O){this.writeTag(K,hc.Varint),this.writeSVarint(O)},writeStringField:function(K,O){this.writeTag(K,hc.Bytes),this.writeString(O)},writeFloatField:function(K,O){this.writeTag(K,hc.Fixed32),this.writeFloat(O)},writeDoubleField:function(K,O){this.writeTag(K,hc.Fixed64),this.writeDouble(O)},writeBooleanField:function(K,O){this.writeVarintField(K,!!O)}};var Bg=r(id);const Im=3;function Hx(K,O,ne){K===1&&ne.readMessage(M1,O)}function M1(K,O,ne){if(K===3){const{id:Se,bitmap:Ge,width:rt,height:st,left:Mt,top:Ut,advance:nr}=ne.readMessage(Ug,{});O.push({id:Se,bitmap:new Ko({width:rt+2*Im,height:st+2*Im},Ge),metrics:{width:rt,height:st,left:Mt,top:Ut,advance:nr}})}}function Ug(K,O,ne){K===1?O.id=ne.readVarint():K===2?O.bitmap=ne.readBytes():K===3?O.width=ne.readVarint():K===4?O.height=ne.readVarint():K===5?O.left=ne.readSVarint():K===6?O.top=ne.readSVarint():K===7&&(O.advance=ne.readVarint())}const jg=Im;function Dm(K){let O=0,ne=0;for(const st of K)O+=st.w*st.h,ne=Math.max(ne,st.w);K.sort((st,Mt)=>Mt.h-st.h);const Se=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(O/.95)),ne),h:1/0}];let Ge=0,rt=0;for(const st of K)for(let Mt=Se.length-1;Mt>=0;Mt--){const Ut=Se[Mt];if(!(st.w>Ut.w||st.h>Ut.h)){if(st.x=Ut.x,st.y=Ut.y,rt=Math.max(rt,st.y+st.h),Ge=Math.max(Ge,st.x+st.w),st.w===Ut.w&&st.h===Ut.h){const nr=Se.pop();Mt=0&&Se>=O&&Om[this.text.charCodeAt(Se)];Se--)ne--;this.text=this.text.substring(O,ne),this.sectionIndex=this.sectionIndex.slice(O,ne)}substring(O,ne){const Se=new Xv;return Se.text=this.text.substring(O,ne),Se.sectionIndex=this.sectionIndex.slice(O,ne),Se.sections=this.sections,Se}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((O,ne)=>Math.max(O,this.sections[ne].scale),0)}addTextSection(O,ne){this.text+=O.text,this.sections.push(j0.forText(O.scale,O.fontStack||ne));const Se=this.sections.length-1;for(let Ge=0;Ge=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Rm(K,O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en,fn,Tn){const Dn=Xv.fromFeature(K,Ge);let Kn;Pr===e.ah.vertical&&Dn.verticalizePunctuation();const{processBidirectionalText:ka,processStyledBidirectionalText:_i}=Cl;if(ka&&Dn.sections.length===1){Kn=[];const Gi=ka(Dn.toString(),gv(Dn,nr,rt,O,Se,fn));for(const vo of Gi){const Yo=new Xv;Yo.text=vo,Yo.sections=Dn.sections;for(let sl=0;sl0&&Qd>Uh&&(Uh=Qd)}else{const Bc=Yo[Lu.fontStack],jh=Bc&&Bc[wc];if(jh&&jh.rect)a0=jh.rect,Jc=jh.metrics;else{const Qd=vo[Lu.fontStack],Ud=Qd&&Qd[wc];if(!Ud)continue;Jc=Ud.metrics}bf=(Ch-Lu.scale)*Ju}sd?(Gi.verticalizable=!0,vd.push({glyph:wc,imageName:tp,x:Al,y:Nc+bf,vertical:sd,scale:Lu.scale,fontStack:Lu.fontStack,sectionIndex:dc,metrics:Jc,rect:a0}),Al+=rp*Lu.scale+oo):(vd.push({glyph:wc,imageName:tp,x:Al,y:Nc+bf,vertical:sd,scale:Lu.scale,fontStack:Lu.fontStack,sectionIndex:dc,metrics:Jc,rect:a0}),Al+=Jc.advance*Lu.scale+oo)}vd.length!==0&&(Ic=Math.max(Al-oo,Ic),Yx(vd,0,vd.length-1,Sd,Uh)),Al=0;const Bd=Go*Ch+Uh;Kh.lineOffset=Math.max(Uh,od),Nc+=Bd,kh=Math.max(Bd,kh),++Kf}var bh;const hd=Nc-Yv,{horizontalAlign:dd,verticalAlign:pd}=qg(Ls);(function(Ef,Ch,od,Kh,vd,Uh,Bd,Kc,Lu){const dc=(Ch-od)*vd;let wc=0;wc=Uh!==Bd?-Kc*Kh-Yv:(-Kh*Lu+.5)*Bd;for(const bf of Ef)for(const Jc of bf.positionedGlyphs)Jc.x+=dc,Jc.y+=wc})(Gi.positionedLines,Sd,dd,pd,Ic,kh,Go,hd,is.length),Gi.top+=-pd*hd,Gi.bottom=Gi.top+hd,Gi.left+=-dd*Ic,Gi.right=Gi.left+Ic}(di,O,ne,Se,Kn,st,Mt,Ut,Pr,nr,en,Tn),!function(Gi){for(const vo of Gi)if(vo.positionedGlyphs.length!==0)return!1;return!0}(Ka)&&di}const Om={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},$x={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},Wx={40:!0};function zm(K,O,ne,Se,Ge,rt){if(O.imageName){const st=Se[O.imageName];return st?st.displaySize[0]*O.scale*Ju/rt+Ge:0}{const st=ne[O.fontStack],Mt=st&&st[K];return Mt?Mt.metrics.advance*O.scale+Ge:0}}function k1(K,O,ne,Se){const Ge=Math.pow(K-O,2);return Se?K=0;let nr=0;for(let Pr=0;Prnr){const Ar=Math.ceil(rt/nr);Ge*=Ar/st,st=Ar}return{x1:Se,y1:Ge,x2:Se+rt,y2:Ge+st}}function P1(K,O,ne,Se,Ge,rt){const st=K.image;let Mt;if(st.content){const Kn=st.content,ka=st.pixelRatio||1;Mt=[Kn[0]/ka,Kn[1]/ka,st.displaySize[0]-Kn[2]/ka,st.displaySize[1]-Kn[3]/ka]}const Ut=O.left*rt,nr=O.right*rt;let Ar,Pr,en,fn;ne==="width"||ne==="both"?(fn=Ge[0]+Ut-Se[3],Pr=Ge[0]+nr+Se[1]):(fn=Ge[0]+(Ut+nr-st.displaySize[0])/2,Pr=fn+st.displaySize[0]);const Tn=O.top*rt,Dn=O.bottom*rt;return ne==="height"||ne==="both"?(Ar=Ge[1]+Tn-Se[0],en=Ge[1]+Dn+Se[2]):(Ar=Ge[1]+(Tn+Dn-st.displaySize[1])/2,en=Ar+st.displaySize[1]),{image:st,top:Ar,right:Pr,bottom:en,left:fn,collisionPadding:Mt}}const V0=255,cp=128,Zp=V0*cp;function L1(K,O){const{expression:ne}=O;if(ne.kind==="constant")return{kind:"constant",layoutSize:ne.evaluate(new cl(K+1))};if(ne.kind==="source")return{kind:"source"};{const{zoomStops:Se,interpolationType:Ge}=ne;let rt=0;for(;rtst.id),this.index=O.index,this.pixelRatio=O.pixelRatio,this.sourceLayerIndex=O.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ya([]),this.placementViewportMatrix=ya([]);const ne=this.layers[0]._unevaluatedLayout._values;this.textSizeData=L1(this.zoom,ne["text-size"]),this.iconSizeData=L1(this.zoom,ne["icon-size"]);const Se=this.layers[0].layout,Ge=Se.get("symbol-sort-key"),rt=Se.get("symbol-z-order");this.canOverlap=Gg(Se,"text-overlap","text-allow-overlap")!=="never"||Gg(Se,"icon-overlap","icon-allow-overlap")!=="never"||Se.get("text-ignore-placement")||Se.get("icon-ignore-placement"),this.sortFeaturesByKey=rt!=="viewport-y"&&!Ge.isConstant(),this.sortFeaturesByY=(rt==="viewport-y"||rt==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,Se.get("symbol-placement")==="point"&&(this.writingModes=Se.get("text-writing-mode").map(st=>e.ah[st])),this.stateDependentLayerIds=this.layers.filter(st=>st.isStateDependent()).map(st=>st.id),this.sourceID=O.sourceID}createArrays(){this.text=new Rf(new Pl(this.layers,this.zoom,O=>/^text/.test(O))),this.icon=new Rf(new Pl(this.layers,this.zoom,O=>/^icon/.test(O))),this.glyphOffsetArray=new $s,this.lineVertexArray=new Ws,this.symbolInstances=new Wo,this.textAnchorOffsets=new Qs}calculateGlyphDependencies(O,ne,Se,Ge,rt){for(let st=0;st0)&&(st.value.kind!=="constant"||st.value.value.length>0),Ar=Ut.value.kind!=="constant"||!!Ut.value.value||Object.keys(Ut.parameters).length>0,Pr=rt.get("symbol-sort-key");if(this.features=[],!nr&&!Ar)return;const en=ne.iconDependencies,fn=ne.glyphDependencies,Tn=ne.availableImages,Dn=new cl(this.zoom);for(const{feature:Kn,id:ka,index:_i,sourceLayerIndex:Ka}of O){const di=Ge._featureFilter.needGeometry,Gi=Er(Kn,di);if(!Ge._featureFilter.filter(Dn,Gi,Se))continue;let vo,Yo;if(di||(Gi.geometry=St(Kn)),nr){const is=Ge.getValueAndResolveTokens("text-field",Gi,Se,Tn),Go=Mn.factory(is),Ls=this.hasRTLText=this.hasRTLText||Kx(Go);(!Ls||Cl.getRTLTextPluginStatus()==="unavailable"||Ls&&Cl.isParsed())&&(vo=$p(Go,Ge,Gi))}if(Ar){const is=Ge.getValueAndResolveTokens("icon-image",Gi,Se,Tn);Yo=is instanceof Ma?is:Ma.fromString(is)}if(!vo&&!Yo)continue;const sl=this.sortFeaturesByKey?Pr.evaluate(Gi,{},Se):void 0;if(this.features.push({id:ka,text:vo,icon:Yo,index:_i,sourceLayerIndex:Ka,geometry:Gi.geometry,properties:Kn.properties,type:Zx[Kn.type],sortKey:sl}),Yo&&(en[Yo.name]=!0),vo){const is=st.evaluate(Gi,{},Se).join(","),Go=rt.get("text-rotation-alignment")!=="viewport"&&rt.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(const Ls of vo.sections)if(Ls.image)en[Ls.image.name]=!0;else{const ws=ns(vo.toString()),_s=Ls.fontStack||is,oo=fn[_s]=fn[_s]||{};this.calculateGlyphDependencies(Ls.text,oo,Go,this.allowVerticalPlacement,ws)}}}rt.get("symbol-placement")==="line"&&(this.features=function(Kn){const ka={},_i={},Ka=[];let di=0;function Gi(is){Ka.push(Kn[is]),di++}function vo(is,Go,Ls){const ws=_i[is];return delete _i[is],_i[Go]=ws,Ka[ws].geometry[0].pop(),Ka[ws].geometry[0]=Ka[ws].geometry[0].concat(Ls[0]),ws}function Yo(is,Go,Ls){const ws=ka[Go];return delete ka[Go],ka[is]=ws,Ka[ws].geometry[0].shift(),Ka[ws].geometry[0]=Ls[0].concat(Ka[ws].geometry[0]),ws}function sl(is,Go,Ls){const ws=Ls?Go[0][Go[0].length-1]:Go[0][0];return`${is}:${ws.x}:${ws.y}`}for(let is=0;isis.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Kn,ka)=>Kn.sortKey-ka.sortKey)}update(O,ne,Se){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(O,ne,this.layers,Se),this.icon.programConfigurations.updatePaintArrays(O,ne,this.layers,Se))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(O){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(O),this.iconCollisionBox.upload(O)),this.text.upload(O,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(O,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(O,ne){const Se=this.lineVertexArray.length;if(O.segment!==void 0){let Ge=O.dist(ne[O.segment+1]),rt=O.dist(ne[O.segment]);const st={};for(let Mt=O.segment+1;Mt=0;Mt--)st[Mt]={x:ne[Mt].x,y:ne[Mt].y,tileUnitDistanceFromAnchor:rt},Mt>0&&(rt+=ne[Mt-1].dist(ne[Mt]));for(let Mt=0;Mt0}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(O,ne){const Se=O.placedSymbolArray.get(ne),Ge=Se.vertexStartIndex+4*Se.numGlyphs;for(let rt=Se.vertexStartIndex;rtGe[Mt]-Ge[Ut]||rt[Ut]-rt[Mt]),st}addToSortKeyRanges(O,ne){const Se=this.sortKeyRanges[this.sortKeyRanges.length-1];Se&&Se.sortKey===ne?Se.symbolInstanceEnd=O+1:this.sortKeyRanges.push({sortKey:ne,symbolInstanceStart:O,symbolInstanceEnd:O+1})}sortFeatures(O){if(this.sortFeaturesByY&&this.sortedAngle!==O&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(O),this.sortedAngle=O,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const ne of this.symbolInstanceIndexes){const Se=this.symbolInstances.get(ne);this.featureSortOrder.push(Se.featureIndex),[Se.rightJustifiedTextSymbolIndex,Se.centerJustifiedTextSymbolIndex,Se.leftJustifiedTextSymbolIndex].forEach((Ge,rt,st)=>{Ge>=0&&st.indexOf(Ge)===rt&&this.addIndicesForPlacedSymbol(this.text,Ge)}),Se.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Se.verticalPlacedTextSymbolIndex),Se.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Se.placedIconSymbolIndex),Se.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Se.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let q0,G0;Ja("SymbolBucket",yv,{omit:["layers","collisionBoxArray","features","compareText"]}),yv.MAX_GLYPHS=65535,yv.addDynamicAttributes=Kp;var $g={get paint(){return G0=G0||new Je({"icon-opacity":new as(ue.paint_symbol["icon-opacity"]),"icon-color":new as(ue.paint_symbol["icon-color"]),"icon-halo-color":new as(ue.paint_symbol["icon-halo-color"]),"icon-halo-width":new as(ue.paint_symbol["icon-halo-width"]),"icon-halo-blur":new as(ue.paint_symbol["icon-halo-blur"]),"icon-translate":new qo(ue.paint_symbol["icon-translate"]),"icon-translate-anchor":new qo(ue.paint_symbol["icon-translate-anchor"]),"text-opacity":new as(ue.paint_symbol["text-opacity"]),"text-color":new as(ue.paint_symbol["text-color"],{runtimeType:lr,getOverride:K=>K.textColor,hasOverride:K=>!!K.textColor}),"text-halo-color":new as(ue.paint_symbol["text-halo-color"]),"text-halo-width":new as(ue.paint_symbol["text-halo-width"]),"text-halo-blur":new as(ue.paint_symbol["text-halo-blur"]),"text-translate":new qo(ue.paint_symbol["text-translate"]),"text-translate-anchor":new qo(ue.paint_symbol["text-translate-anchor"])})},get layout(){return q0=q0||new Je({"symbol-placement":new qo(ue.layout_symbol["symbol-placement"]),"symbol-spacing":new qo(ue.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new qo(ue.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new as(ue.layout_symbol["symbol-sort-key"]),"symbol-z-order":new qo(ue.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new qo(ue.layout_symbol["icon-allow-overlap"]),"icon-overlap":new qo(ue.layout_symbol["icon-overlap"]),"icon-ignore-placement":new qo(ue.layout_symbol["icon-ignore-placement"]),"icon-optional":new qo(ue.layout_symbol["icon-optional"]),"icon-rotation-alignment":new qo(ue.layout_symbol["icon-rotation-alignment"]),"icon-size":new as(ue.layout_symbol["icon-size"]),"icon-text-fit":new qo(ue.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new qo(ue.layout_symbol["icon-text-fit-padding"]),"icon-image":new as(ue.layout_symbol["icon-image"]),"icon-rotate":new as(ue.layout_symbol["icon-rotate"]),"icon-padding":new as(ue.layout_symbol["icon-padding"]),"icon-keep-upright":new qo(ue.layout_symbol["icon-keep-upright"]),"icon-offset":new as(ue.layout_symbol["icon-offset"]),"icon-anchor":new as(ue.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new qo(ue.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new qo(ue.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new qo(ue.layout_symbol["text-rotation-alignment"]),"text-field":new as(ue.layout_symbol["text-field"]),"text-font":new as(ue.layout_symbol["text-font"]),"text-size":new as(ue.layout_symbol["text-size"]),"text-max-width":new as(ue.layout_symbol["text-max-width"]),"text-line-height":new qo(ue.layout_symbol["text-line-height"]),"text-letter-spacing":new as(ue.layout_symbol["text-letter-spacing"]),"text-justify":new as(ue.layout_symbol["text-justify"]),"text-radial-offset":new as(ue.layout_symbol["text-radial-offset"]),"text-variable-anchor":new qo(ue.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new as(ue.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new as(ue.layout_symbol["text-anchor"]),"text-max-angle":new qo(ue.layout_symbol["text-max-angle"]),"text-writing-mode":new qo(ue.layout_symbol["text-writing-mode"]),"text-rotate":new as(ue.layout_symbol["text-rotate"]),"text-padding":new qo(ue.layout_symbol["text-padding"]),"text-keep-upright":new qo(ue.layout_symbol["text-keep-upright"]),"text-transform":new as(ue.layout_symbol["text-transform"]),"text-offset":new as(ue.layout_symbol["text-offset"]),"text-allow-overlap":new qo(ue.layout_symbol["text-allow-overlap"]),"text-overlap":new qo(ue.layout_symbol["text-overlap"]),"text-ignore-placement":new qo(ue.layout_symbol["text-ignore-placement"]),"text-optional":new qo(ue.layout_symbol["text-optional"])})}};class Kv{constructor(O){if(O.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=O.property.overrides?O.property.overrides.runtimeType:wt,this.defaultValue=O}evaluate(O){if(O.formattedSection){const ne=this.defaultValue.property.overrides;if(ne&&ne.hasOverride(O.formattedSection))return ne.getOverride(O.formattedSection)}return O.feature&&O.featureState?this.defaultValue.evaluate(O.feature,O.featureState):this.defaultValue.property.specification.default}eachChild(O){this.defaultValue.isConstant()||O(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ja("FormatSectionOverride",Kv,{omit:["defaultValue"]});class Bm extends ce{constructor(O){super(O,$g)}recalculate(O,ne){if(super.recalculate(O,ne),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 Se=this.layout.get("text-writing-mode");if(Se){const Ge=[];for(const rt of Se)Ge.indexOf(rt)<0&&Ge.push(rt);this.layout._values["text-writing-mode"]=Ge}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(O,ne,Se,Ge){const rt=this.layout.get(O).evaluate(ne,{},Se,Ge),st=this._unevaluatedLayout._values[O];return st.isDataDriven()||mf(st.value)||!rt?rt:function(Mt,Ut){return Ut.replace(/{([^{}]+)}/g,(nr,Ar)=>Mt&&Ar in Mt?String(Mt[Ar]):"")}(ne.properties,rt)}createBucket(O){return new yv(O)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const O of $g.paint.overridableProperties){if(!Bm.hasPaintOverride(this.layout,O))continue;const ne=this.paint.get(O),Se=new Kv(ne),Ge=new gc(Se,ne.property.specification);let rt=null;rt=ne.value.kind==="constant"||ne.value.kind==="source"?new af("source",Ge):new ac("composite",Ge,ne.value.zoomStops),this.paint._values[O]=new wu(ne.property,rt,ne.parameters)}}_handleOverridablePaintPropertyUpdate(O,ne,Se){return!(!this.layout||ne.isDataDriven()||Se.isDataDriven())&&Bm.hasPaintOverride(this.layout,O)}static hasPaintOverride(O,ne){const Se=O.get("text-field"),Ge=$g.paint.properties[ne];let rt=!1;const st=Mt=>{for(const Ut of Mt)if(Ge.overrides&&Ge.overrides.hasOverride(Ut))return void(rt=!0)};if(Se.value.kind==="constant"&&Se.value.value instanceof Mn)st(Se.value.value.sections);else if(Se.value.kind==="source"){const Mt=nr=>{rt||(nr instanceof Oi&&na(nr.value)===ln?st(nr.value.sections):nr instanceof nl?st(nr.sections):nr.eachChild(Mt))},Ut=Se.value;Ut._styleExpression&&Mt(Ut._styleExpression.expression)}return rt}}let Wg;var I1={get paint(){return Wg=Wg||new Je({"background-color":new qo(ue.paint_background["background-color"]),"background-pattern":new Pc(ue.paint_background["background-pattern"]),"background-opacity":new qo(ue.paint_background["background-opacity"])})}};class H0 extends ce{constructor(O){super(O,I1)}}let Um;var Yg={get paint(){return Um=Um||new Je({"raster-opacity":new qo(ue.paint_raster["raster-opacity"]),"raster-hue-rotate":new qo(ue.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new qo(ue.paint_raster["raster-brightness-min"]),"raster-brightness-max":new qo(ue.paint_raster["raster-brightness-max"]),"raster-saturation":new qo(ue.paint_raster["raster-saturation"]),"raster-contrast":new qo(ue.paint_raster["raster-contrast"]),"raster-resampling":new qo(ue.paint_raster["raster-resampling"]),"raster-fade-duration":new qo(ue.paint_raster["raster-fade-duration"])})}};class Jx extends ce{constructor(O){super(O,Yg)}}class D1 extends ce{constructor(O){super(O,{}),this.onAdd=ne=>{this.implementation.onAdd&&this.implementation.onAdd(ne,ne.painter.context.gl)},this.onRemove=ne=>{this.implementation.onRemove&&this.implementation.onRemove(ne,ne.painter.context.gl)},this.implementation=O}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 $0{constructor(O){this._methodToThrottle=O,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 Xg=63710088e-1;class fp{constructor(O,ne){if(isNaN(O)||isNaN(ne))throw new Error(`Invalid LngLat object: (${O}, ${ne})`);if(this.lng=+O,this.lat=+ne,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new fp(A(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(O){const ne=Math.PI/180,Se=this.lat*ne,Ge=O.lat*ne,rt=Math.sin(Se)*Math.sin(Ge)+Math.cos(Se)*Math.cos(Ge)*Math.cos((O.lng-this.lng)*ne);return Xg*Math.acos(Math.min(rt,1))}static convert(O){if(O instanceof fp)return O;if(Array.isArray(O)&&(O.length===2||O.length===3))return new fp(Number(O[0]),Number(O[1]));if(!Array.isArray(O)&&typeof O=="object"&&O!==null)return new fp(Number("lng"in O?O.lng:O.lon),Number(O.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 R1=2*Math.PI*Xg;function jm(K){return R1*Math.cos(K*Math.PI/180)}function Vm(K){return(180+K)/360}function O1(K){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+K*Math.PI/360)))/360}function Jd(K,O){return K/jm(O)}function Zg(K){return 360/Math.PI*Math.atan(Math.exp((180-360*K)*Math.PI/180))-90}class W0{constructor(O,ne,Se=0){this.x=+O,this.y=+ne,this.z=+Se}static fromLngLat(O,ne=0){const Se=fp.convert(O);return new W0(Vm(Se.lng),O1(Se.lat),Jd(ne,Se.lat))}toLngLat(){return new fp(360*this.x-180,Zg(this.y))}toAltitude(){return this.z*jm(Zg(this.y))}meterInMercatorCoordinateUnits(){return 1/R1*(O=Zg(this.y),1/Math.cos(O*Math.PI/180));var O}}function z1(K,O,ne){var Se=2*Math.PI*6378137/256/Math.pow(2,ne);return[K*Se-2*Math.PI*6378137/2,O*Se-2*Math.PI*6378137/2]}class Kg{constructor(O,ne,Se){if(!function(Ge,rt,st){return!(Ge<0||Ge>25||st<0||st>=Math.pow(2,Ge)||rt<0||rt>=Math.pow(2,Ge))}(O,ne,Se))throw new Error(`x=${ne}, y=${Se}, z=${O} outside of bounds. 0<=x<${Math.pow(2,O)}, 0<=y<${Math.pow(2,O)} 0<=z<=25 `);this.z=O,this.x=ne,this.y=Se,this.key=Jv(0,O,O,ne,Se)}equals(O){return this.z===O.z&&this.x===O.x&&this.y===O.y}url(O,ne,Se){const Ge=(st=this.y,Mt=this.z,Ut=z1(256*(rt=this.x),256*(st=Math.pow(2,Mt)-st-1),Mt),nr=z1(256*(rt+1),256*(st+1),Mt),Ut[0]+","+Ut[1]+","+nr[0]+","+nr[1]);var rt,st,Mt,Ut,nr;const Ar=function(Pr,en,fn){let Tn,Dn="";for(let Kn=Pr;Kn>0;Kn--)Tn=1<1?"@2x":"").replace(/{quadkey}/g,Ar).replace(/{bbox-epsg-3857}/g,Ge)}isChildOf(O){const ne=this.z-O.z;return ne>0&&O.x===this.x>>ne&&O.y===this.y>>ne}getTilePoint(O){const ne=Math.pow(2,this.z);return new i((O.x*ne-this.x)*Gl,(O.y*ne-this.y)*Gl)}toString(){return`${this.z}/${this.x}/${this.y}`}}class F1{constructor(O,ne){this.wrap=O,this.canonical=ne,this.key=Jv(O,ne.z,ne.z,ne.x,ne.y)}}class $d{constructor(O,ne,Se,Ge,rt){if(O= z; overscaledZ = ${O}; z = ${Se}`);this.overscaledZ=O,this.wrap=ne,this.canonical=new Kg(Se,+Ge,+rt),this.key=Jv(ne,O,Se,Ge,rt)}clone(){return new $d(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(O){return this.overscaledZ===O.overscaledZ&&this.wrap===O.wrap&&this.canonical.equals(O.canonical)}scaledTo(O){if(O>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${O}; overscaledZ = ${this.overscaledZ}`);const ne=this.canonical.z-O;return O>this.canonical.z?new $d(O,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new $d(O,this.wrap,O,this.canonical.x>>ne,this.canonical.y>>ne)}calculateScaledKey(O,ne){if(O>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${O}; overscaledZ = ${this.overscaledZ}`);const Se=this.canonical.z-O;return O>this.canonical.z?Jv(this.wrap*+ne,O,this.canonical.z,this.canonical.x,this.canonical.y):Jv(this.wrap*+ne,O,O,this.canonical.x>>Se,this.canonical.y>>Se)}isChildOf(O){if(O.wrap!==this.wrap)return!1;const ne=this.canonical.z-O.canonical.z;return O.overscaledZ===0||O.overscaledZ>ne&&O.canonical.y===this.canonical.y>>ne}children(O){if(this.overscaledZ>=O)return[new $d(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const ne=this.canonical.z+1,Se=2*this.canonical.x,Ge=2*this.canonical.y;return[new $d(ne,this.wrap,ne,Se,Ge),new $d(ne,this.wrap,ne,Se+1,Ge),new $d(ne,this.wrap,ne,Se,Ge+1),new $d(ne,this.wrap,ne,Se+1,Ge+1)]}isLessThan(O){return this.wrapO.wrap)&&(this.overscaledZO.overscaledZ)&&(this.canonical.xO.canonical.x)&&this.canonical.ythis.max&&(this.max=Pr),Pr=this.dim+1||ne<-1||ne>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(ne+1)*this.stride+(O+1)}unpack(O,ne,Se){return O*this.redFactor+ne*this.greenFactor+Se*this.blueFactor-this.baseShift}getPixels(){return new il({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(O,ne,Se){if(this.dim!==O.dim)throw new Error("dem dimension mismatch");let Ge=ne*this.dim,rt=ne*this.dim+this.dim,st=Se*this.dim,Mt=Se*this.dim+this.dim;switch(ne){case-1:Ge=rt-1;break;case 1:rt=Ge+1}switch(Se){case-1:st=Mt-1;break;case 1:Mt=st+1}const Ut=-ne*this.dim,nr=-Se*this.dim;for(let Ar=st;Ar=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${O} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[O]}}class B1{constructor(O,ne,Se,Ge,rt){this.type="Feature",this._vectorTileFeature=O,O._z=ne,O._x=Se,O._y=Ge,this.properties=O.properties,this.id=rt}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(O){this._geometry=O}toJSON(){const O={geometry:this.geometry};for(const ne in this)ne!=="_geometry"&&ne!=="_vectorTileFeature"&&(O[ne]=this[ne]);return O}}class U1{constructor(O,ne){this.tileID=O,this.x=O.canonical.x,this.y=O.canonical.y,this.z=O.canonical.z,this.grid=new Ii(Gl,16,0),this.grid3D=new Ii(Gl,16,0),this.featureIndexArray=new Kl,this.promoteId=ne}insert(O,ne,Se,Ge,rt,st){const Mt=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(Se,Ge,rt);const Ut=st?this.grid3D:this.grid;for(let nr=0;nr=0&&Pr[3]>=0&&Ut.insert(Mt,Pr[0],Pr[1],Pr[2],Pr[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ta.VectorTile(new Bg(this.rawTileData)).layers,this.sourceLayerCoder=new N1(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(O,ne,Se,Ge){this.loadVTLayers();const rt=O.params||{},st=Gl/O.tileSize/O.scale,Mt=Wf(rt.filter),Ut=O.queryGeometry,nr=O.queryPadding*st,Ar=Jg(Ut),Pr=this.grid.query(Ar.minX-nr,Ar.minY-nr,Ar.maxX+nr,Ar.maxY+nr),en=Jg(O.cameraQueryGeometry),fn=this.grid3D.query(en.minX-nr,en.minY-nr,en.maxX+nr,en.maxY+nr,(Kn,ka,_i,Ka)=>function(di,Gi,vo,Yo,sl){for(const Go of di)if(Gi<=Go.x&&vo<=Go.y&&Yo>=Go.x&&sl>=Go.y)return!0;const is=[new i(Gi,vo),new i(Gi,sl),new i(Yo,sl),new i(Yo,vo)];if(di.length>2){for(const Go of is)if(ai(di,Go))return!0}for(let Go=0;Go(Ka||(Ka=St(di)),Gi.queryIntersectsFeature(Ut,di,vo,Ka,this.z,O.transform,st,O.pixelPosMatrix)))}return Tn}loadMatchingFeature(O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr){const en=this.bucketLayerIDs[ne];if(st&&!function(Kn,ka){for(let _i=0;_i=0)return!0;return!1}(st,en))return;const fn=this.sourceLayerCoder.decode(Se),Tn=this.vtLayers[fn].feature(Ge);if(rt.needGeometry){const Kn=Er(Tn,!0);if(!rt.filter(new cl(this.tileID.overscaledZ),Kn,this.tileID.canonical))return}else if(!rt.filter(new cl(this.tileID.overscaledZ),Tn))return;const Dn=this.getId(Tn,fn);for(let Kn=0;Kn{const Mt=O instanceof lf?O.get(st):null;return Mt&&Mt.evaluate?Mt.evaluate(ne,Se,Ge):Mt})}function Jg(K){let O=1/0,ne=1/0,Se=-1/0,Ge=-1/0;for(const rt of K)O=Math.min(O,rt.x),ne=Math.min(ne,rt.y),Se=Math.max(Se,rt.x),Ge=Math.max(Ge,rt.y);return{minX:O,minY:ne,maxX:Se,maxY:Ge}}function V1(K,O){return O-K}function q1(K,O,ne,Se,Ge){const rt=[];for(let st=0;st=Se&&Pr.x>=Se||(Ar.x>=Se?Ar=new i(Se,Ar.y+(Se-Ar.x)/(Pr.x-Ar.x)*(Pr.y-Ar.y))._round():Pr.x>=Se&&(Pr=new i(Se,Ar.y+(Se-Ar.x)/(Pr.x-Ar.x)*(Pr.y-Ar.y))._round()),Ar.y>=Ge&&Pr.y>=Ge||(Ar.y>=Ge?Ar=new i(Ar.x+(Ge-Ar.y)/(Pr.y-Ar.y)*(Pr.x-Ar.x),Ge)._round():Pr.y>=Ge&&(Pr=new i(Ar.x+(Ge-Ar.y)/(Pr.y-Ar.y)*(Pr.x-Ar.x),Ge)._round()),Ut&&Ar.equals(Ut[Ut.length-1])||(Ut=[Ar],rt.push(Ut)),Ut.push(Pr)))))}}return rt}Ja("FeatureIndex",U1,{omit:["rawTileData","sourceLayerCoder"]});class Jp extends i{constructor(O,ne,Se,Ge){super(O,ne),this.angle=Se,Ge!==void 0&&(this.segment=Ge)}clone(){return new Jp(this.x,this.y,this.angle,this.segment)}}function G1(K,O,ne,Se,Ge){if(O.segment===void 0||ne===0)return!0;let rt=O,st=O.segment+1,Mt=0;for(;Mt>-ne/2;){if(st--,st<0)return!1;Mt-=K[st].dist(rt),rt=K[st]}Mt+=K[st].dist(K[st+1]),st++;const Ut=[];let nr=0;for(;MtSe;)nr-=Ut.shift().angleDelta;if(nr>Ge)return!1;st++,Mt+=Ar.dist(Pr)}return!0}function H1(K){let O=0;for(let ne=0;nenr){const Tn=(nr-Ut)/fn,Dn=So.number(Pr.x,en.x,Tn),Kn=So.number(Pr.y,en.y,Tn),ka=new Jp(Dn,Kn,en.angleTo(Pr),Ar);return ka._round(),!st||G1(K,ka,Mt,st,O)?ka:void 0}Ut+=fn}}function ew(K,O,ne,Se,Ge,rt,st,Mt,Ut){const nr=$1(Se,rt,st),Ar=W1(Se,Ge),Pr=Ar*st,en=K[0].x===0||K[0].x===Ut||K[0].y===0||K[0].y===Ut;return O-Pr=0&&di=0&&Gi=0&&en+nr<=Ar){const vo=new Jp(di,Gi,_i,Tn);vo._round(),Se&&!G1(K,vo,rt,Se,Ge)||fn.push(vo)}}Pr+=ka}return Mt||fn.length||st||(fn=bv(K,Pr/2,ne,Se,Ge,rt,st,!0,Ut)),fn}Ja("Anchor",Jp);const Qv=_h;function Y1(K,O,ne,Se){const Ge=[],rt=K.image,st=rt.pixelRatio,Mt=rt.paddedRect.w-2*Qv,Ut=rt.paddedRect.h-2*Qv;let nr={x1:K.left,y1:K.top,x2:K.right,y2:K.bottom};const Ar=rt.stretchX||[[0,Mt]],Pr=rt.stretchY||[[0,Ut]],en=(oo,Us)=>oo+Us[1]-Us[0],fn=Ar.reduce(en,0),Tn=Pr.reduce(en,0),Dn=Mt-fn,Kn=Ut-Tn;let ka=0,_i=fn,Ka=0,di=Tn,Gi=0,vo=Dn,Yo=0,sl=Kn;if(rt.content&&Se){const oo=rt.content,Us=oo[2]-oo[0],Is=oo[3]-oo[1];(rt.textFitWidth||rt.textFitHeight)&&(nr=C1(K)),ka=e0(Ar,0,oo[0]),Ka=e0(Pr,0,oo[1]),_i=e0(Ar,oo[0],oo[2]),di=e0(Pr,oo[1],oo[3]),Gi=oo[0]-ka,Yo=oo[1]-Ka,vo=Us-_i,sl=Is-di}const is=nr.x1,Go=nr.y1,Ls=nr.x2-is,ws=nr.y2-Go,_s=(oo,Us,Is,Al)=>{const Nc=Nd(oo.stretch-ka,_i,Ls,is),Ic=qm(oo.fixed-Gi,vo,oo.stretch,fn),kh=Nd(Us.stretch-Ka,di,ws,Go),Sd=qm(Us.fixed-Yo,sl,Us.stretch,Tn),Kf=Nd(Is.stretch-ka,_i,Ls,is),bh=qm(Is.fixed-Gi,vo,Is.stretch,fn),hd=Nd(Al.stretch-Ka,di,ws,Go),dd=qm(Al.fixed-Yo,sl,Al.stretch,Tn),pd=new i(Nc,kh),Ef=new i(Kf,kh),Ch=new i(Kf,hd),od=new i(Nc,hd),Kh=new i(Ic/st,Sd/st),vd=new i(bh/st,dd/st),Uh=O*Math.PI/180;if(Uh){const Lu=Math.sin(Uh),dc=Math.cos(Uh),wc=[dc,-Lu,Lu,dc];pd._matMult(wc),Ef._matMult(wc),od._matMult(wc),Ch._matMult(wc)}const Bd=oo.stretch+oo.fixed,Kc=Us.stretch+Us.fixed;return{tl:pd,tr:Ef,bl:od,br:Ch,tex:{x:rt.paddedRect.x+Qv+Bd,y:rt.paddedRect.y+Qv+Kc,w:Is.stretch+Is.fixed-Bd,h:Al.stretch+Al.fixed-Kc},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Kh,pixelOffsetBR:vd,minFontScaleX:vo/st/Ls,minFontScaleY:sl/st/ws,isSDF:ne}};if(Se&&(rt.stretchX||rt.stretchY)){const oo=t0(Ar,Dn,fn),Us=t0(Pr,Kn,Tn);for(let Is=0;Is0&&(Dn=Math.max(10,Dn),this.circleDiameter=Dn)}else{const en=!((Pr=st.image)===null||Pr===void 0)&&Pr.content&&(st.image.textFitWidth||st.image.textFitHeight)?C1(st):{x1:st.left,y1:st.top,x2:st.right,y2:st.bottom};en.y1=en.y1*Mt-Ut[0],en.y2=en.y2*Mt+Ut[2],en.x1=en.x1*Mt-Ut[3],en.x2=en.x2*Mt+Ut[1];const fn=st.collisionPadding;if(fn&&(en.x1-=fn[0]*Mt,en.y1-=fn[1]*Mt,en.x2+=fn[2]*Mt,en.y2+=fn[3]*Mt),Ar){const Tn=new i(en.x1,en.y1),Dn=new i(en.x2,en.y1),Kn=new i(en.x1,en.y2),ka=new i(en.x2,en.y2),_i=Ar*Math.PI/180;Tn._rotate(_i),Dn._rotate(_i),Kn._rotate(_i),ka._rotate(_i),en.x1=Math.min(Tn.x,Dn.x,Kn.x,ka.x),en.x2=Math.max(Tn.x,Dn.x,Kn.x,ka.x),en.y1=Math.min(Tn.y,Dn.y,Kn.y,ka.y),en.y2=Math.max(Tn.y,Dn.y,Kn.y,ka.y)}O.emplaceBack(ne.x,ne.y,en.x1,en.y1,en.x2,en.y2,Se,Ge,rt)}this.boxEndIndex=O.length}}class tw{constructor(O=[],ne=(Se,Ge)=>SeGe?1:0){if(this.data=O,this.length=this.data.length,this.compare=ne,this.length>0)for(let Se=(this.length>>1)-1;Se>=0;Se--)this._down(Se)}push(O){this.data.push(O),this._up(this.length++)}pop(){if(this.length===0)return;const O=this.data[0],ne=this.data.pop();return--this.length>0&&(this.data[0]=ne,this._down(0)),O}peek(){return this.data[0]}_up(O){const{data:ne,compare:Se}=this,Ge=ne[O];for(;O>0;){const rt=O-1>>1,st=ne[rt];if(Se(Ge,st)>=0)break;ne[O]=st,O=rt}ne[O]=Ge}_down(O){const{data:ne,compare:Se}=this,Ge=this.length>>1,rt=ne[O];for(;O=0)break;ne[O]=ne[st],O=st}ne[O]=rt}}function rw(K,O=1,ne=!1){let Se=1/0,Ge=1/0,rt=-1/0,st=-1/0;const Mt=K[0];for(let fn=0;fnrt)&&(rt=Tn.x),(!fn||Tn.y>st)&&(st=Tn.y)}const Ut=Math.min(rt-Se,st-Ge);let nr=Ut/2;const Ar=new tw([],nw);if(Ut===0)return new i(Se,Ge);for(let fn=Se;fnPr.d||!Pr.d)&&(Pr=fn,ne&&console.log("found best %d after %d probes",Math.round(1e4*fn.d)/1e4,en)),fn.max-Pr.d<=O||(nr=fn.h/2,Ar.push(new hp(fn.p.x-nr,fn.p.y-nr,nr,K)),Ar.push(new hp(fn.p.x+nr,fn.p.y-nr,nr,K)),Ar.push(new hp(fn.p.x-nr,fn.p.y+nr,nr,K)),Ar.push(new hp(fn.p.x+nr,fn.p.y+nr,nr,K)),en+=4)}return ne&&(console.log(`num probes: ${en}`),console.log(`best distance: ${Pr.d}`)),Pr.p}function nw(K,O){return O.max-K.max}function hp(K,O,ne,Se){this.p=new i(K,O),this.h=ne,this.d=function(Ge,rt){let st=!1,Mt=1/0;for(let Ut=0;UtGe.y!=Tn.y>Ge.y&&Ge.x<(Tn.x-fn.x)*(Ge.y-fn.y)/(Tn.y-fn.y)+fn.x&&(st=!st),Mt=Math.min(Mt,Hi(Ge,fn,Tn))}}return(st?1:-1)*Math.sqrt(Mt)}(this.p,Se),this.max=this.d+this.h*Math.SQRT2}var Bh;e.aq=void 0,(Bh=e.aq||(e.aq={}))[Bh.center=1]="center",Bh[Bh.left=2]="left",Bh[Bh.right=3]="right",Bh[Bh.top=4]="top",Bh[Bh.bottom=5]="bottom",Bh[Bh["top-left"]=6]="top-left",Bh[Bh["top-right"]=7]="top-right",Bh[Bh["bottom-left"]=8]="bottom-left",Bh[Bh["bottom-right"]=9]="bottom-right";const Qp=7,Qg=Number.POSITIVE_INFINITY;function X1(K,O){return O[1]!==Qg?function(ne,Se,Ge){let rt=0,st=0;switch(Se=Math.abs(Se),Ge=Math.abs(Ge),ne){case"top-right":case"top-left":case"top":st=Ge-Qp;break;case"bottom-right":case"bottom-left":case"bottom":st=-Ge+Qp}switch(ne){case"top-right":case"bottom-right":case"right":rt=-Se;break;case"top-left":case"bottom-left":case"left":rt=Se}return[rt,st]}(K,O[0],O[1]):function(ne,Se){let Ge=0,rt=0;Se<0&&(Se=0);const st=Se/Math.SQRT2;switch(ne){case"top-right":case"top-left":rt=st-Qp;break;case"bottom-right":case"bottom-left":rt=-st+Qp;break;case"bottom":rt=-Se+Qp;break;case"top":rt=Se-Qp}switch(ne){case"top-right":case"bottom-right":Ge=-st;break;case"top-left":case"bottom-left":Ge=st;break;case"left":Ge=Se;break;case"right":Ge=-Se}return[Ge,rt]}(K,O[0])}function Z1(K,O,ne){var Se;const Ge=K.layout,rt=(Se=Ge.get("text-variable-anchor-offset"))===null||Se===void 0?void 0:Se.evaluate(O,{},ne);if(rt){const Mt=rt.values,Ut=[];for(let nr=0;nren*Ju);Ar.startsWith("top")?Pr[1]-=Qp:Ar.startsWith("bottom")&&(Pr[1]+=Qp),Ut[nr+1]=Pr}return new Ca(Ut)}const st=Ge.get("text-variable-anchor");if(st){let Mt;Mt=K._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Ge.get("text-radial-offset").evaluate(O,{},ne)*Ju,Qg]:Ge.get("text-offset").evaluate(O,{},ne).map(nr=>nr*Ju);const Ut=[];for(const nr of st)Ut.push(nr,X1(nr,Mt));return new Ca(Ut)}return null}function ey(K){switch(K){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function aw(K,O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar){let Pr=rt.textMaxSize.evaluate(O,{});Pr===void 0&&(Pr=st);const en=K.layers[0].layout,fn=en.get("icon-offset").evaluate(O,{},Ar),Tn=J1(ne.horizontal),Dn=st/24,Kn=K.tilePixelRatio*Dn,ka=K.tilePixelRatio*Pr/24,_i=K.tilePixelRatio*Mt,Ka=K.tilePixelRatio*en.get("symbol-spacing"),di=en.get("text-padding")*K.tilePixelRatio,Gi=function(oo,Us,Is,Al=1){const Nc=oo.get("icon-padding").evaluate(Us,{},Is),Ic=Nc&&Nc.values;return[Ic[0]*Al,Ic[1]*Al,Ic[2]*Al,Ic[3]*Al]}(en,O,Ar,K.tilePixelRatio),vo=en.get("text-max-angle")/180*Math.PI,Yo=en.get("text-rotation-alignment")!=="viewport"&&en.get("symbol-placement")!=="point",sl=en.get("icon-rotation-alignment")==="map"&&en.get("symbol-placement")!=="point",is=en.get("symbol-placement"),Go=Ka/2,Ls=en.get("icon-text-fit");let ws;Se&&Ls!=="none"&&(K.allowVerticalPlacement&&ne.vertical&&(ws=P1(Se,ne.vertical,Ls,en.get("icon-text-fit-padding"),fn,Dn)),Tn&&(Se=P1(Se,Tn,Ls,en.get("icon-text-fit-padding"),fn,Dn)));const _s=(oo,Us)=>{Us.x<0||Us.x>=Gl||Us.y<0||Us.y>=Gl||function(Is,Al,Nc,Ic,kh,Sd,Kf,bh,hd,dd,pd,Ef,Ch,od,Kh,vd,Uh,Bd,Kc,Lu,dc,wc,bf,Jc,a0){const tp=Is.addToLineVertexArray(Al,Nc);let rp,sd,Bc,jh,Qd=0,Ud=0,md=0,oy=0,sy=-1,Ym=-1;const Lp={};let ly=_a("");if(Is.allowVerticalPlacement&&Ic.vertical){const Jh=bh.layout.get("text-rotate").evaluate(dc,{},Jc)+90;Bc=new Gm(hd,Al,dd,pd,Ef,Ic.vertical,Ch,od,Kh,Jh),Kf&&(jh=new Gm(hd,Al,dd,pd,Ef,Kf,Uh,Bd,Kh,Jh))}if(kh){const Jh=bh.layout.get("icon-rotate").evaluate(dc,{}),jd=bh.layout.get("icon-text-fit")!=="none",ev=Y1(kh,Jh,bf,jd),np=Kf?Y1(Kf,Jh,bf,jd):void 0;sd=new Gm(hd,Al,dd,pd,Ef,kh,Uh,Bd,!1,Jh),Qd=4*ev.length;const xv=Is.iconSizeData;let ap=null;xv.kind==="source"?(ap=[cp*bh.layout.get("icon-size").evaluate(dc,{})],ap[0]>Zp&&y(`${Is.layerIds[0]}: Value for "icon-size" is >= ${V0}. Reduce your "icon-size".`)):xv.kind==="composite"&&(ap=[cp*wc.compositeIconSizes[0].evaluate(dc,{},Jc),cp*wc.compositeIconSizes[1].evaluate(dc,{},Jc)],(ap[0]>Zp||ap[1]>Zp)&&y(`${Is.layerIds[0]}: Value for "icon-size" is >= ${V0}. Reduce your "icon-size".`)),Is.addSymbols(Is.icon,ev,ap,Lu,Kc,dc,e.ah.none,Al,tp.lineStartIndex,tp.lineLength,-1,Jc),sy=Is.icon.placedSymbolArray.length-1,np&&(Ud=4*np.length,Is.addSymbols(Is.icon,np,ap,Lu,Kc,dc,e.ah.vertical,Al,tp.lineStartIndex,tp.lineLength,-1,Jc),Ym=Is.icon.placedSymbolArray.length-1)}const uy=Object.keys(Ic.horizontal);for(const Jh of uy){const jd=Ic.horizontal[Jh];if(!rp){ly=_a(jd.text);const np=bh.layout.get("text-rotate").evaluate(dc,{},Jc);rp=new Gm(hd,Al,dd,pd,Ef,jd,Ch,od,Kh,np)}const ev=jd.positionedLines.length===1;if(md+=K1(Is,Al,jd,Sd,bh,Kh,dc,vd,tp,Ic.vertical?e.ah.horizontal:e.ah.horizontalOnly,ev?uy:[Jh],Lp,sy,wc,Jc),ev)break}Ic.vertical&&(oy+=K1(Is,Al,Ic.vertical,Sd,bh,Kh,dc,vd,tp,e.ah.vertical,["vertical"],Lp,Ym,wc,Jc));const cy=rp?rp.boxStartIndex:Is.collisionBoxArray.length,fy=rp?rp.boxEndIndex:Is.collisionBoxArray.length,iw=Bc?Bc.boxStartIndex:Is.collisionBoxArray.length,ow=Bc?Bc.boxEndIndex:Is.collisionBoxArray.length,sw=sd?sd.boxStartIndex:Is.collisionBoxArray.length,lw=sd?sd.boxEndIndex:Is.collisionBoxArray.length,n_=jh?jh.boxStartIndex:Is.collisionBoxArray.length,i0=jh?jh.boxEndIndex:Is.collisionBoxArray.length;let xh=-1;const o0=(Jh,jd)=>Jh&&Jh.circleDiameter?Math.max(Jh.circleDiameter,jd):jd;xh=o0(rp,xh),xh=o0(Bc,xh),xh=o0(sd,xh),xh=o0(jh,xh);const hy=xh>-1?1:0;hy&&(xh*=a0/Ju),Is.glyphOffsetArray.length>=yv.MAX_GLYPHS&&y("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),dc.sortKey!==void 0&&Is.addToSortKeyRanges(Is.symbolInstances.length,dc.sortKey);const a_=Z1(bh,dc,Jc),[uw,i_]=function(Jh,jd){const ev=Jh.length,np=jd?.values;if(np?.length>0)for(let xv=0;xv=0?Lp.right:-1,Lp.center>=0?Lp.center:-1,Lp.left>=0?Lp.left:-1,Lp.vertical||-1,sy,Ym,ly,cy,fy,iw,ow,sw,lw,n_,i0,dd,md,oy,Qd,Ud,hy,0,Ch,xh,uw,i_)}(K,Us,oo,ne,Se,Ge,ws,K.layers[0],K.collisionBoxArray,O.index,O.sourceLayerIndex,K.index,Kn,[di,di,di,di],Yo,Ut,_i,Gi,sl,fn,O,rt,nr,Ar,st)};if(is==="line")for(const oo of q1(O.geometry,0,0,Gl,Gl)){const Us=ew(oo,Ka,vo,ne.vertical||Tn,Se,24,ka,K.overscaling,Gl);for(const Is of Us)Tn&&Q1(K,Tn.text,Go,Is)||_s(oo,Is)}else if(is==="line-center"){for(const oo of O.geometry)if(oo.length>1){const Us=Qx(oo,vo,ne.vertical||Tn,Se,24,ka);Us&&_s(oo,Us)}}else if(O.type==="Polygon")for(const oo of Mc(O.geometry,0)){const Us=rw(oo,16);_s(oo[0],new Jp(Us.x,Us.y,0))}else if(O.type==="LineString")for(const oo of O.geometry)_s(oo,new Jp(oo[0].x,oo[0].y,0));else if(O.type==="Point")for(const oo of O.geometry)for(const Us of oo)_s([Us],new Jp(Us.x,Us.y,0))}function K1(K,O,ne,Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en,fn,Tn){const Dn=function(_i,Ka,di,Gi,vo,Yo,sl,is){const Go=Gi.layout.get("text-rotate").evaluate(Yo,{})*Math.PI/180,Ls=[];for(const ws of Ka.positionedLines)for(const _s of ws.positionedGlyphs){if(!_s.rect)continue;const oo=_s.rect||{};let Us=jg+1,Is=!0,Al=1,Nc=0;const Ic=(vo||is)&&_s.vertical,kh=_s.metrics.advance*_s.scale/2;if(is&&Ka.verticalizable&&(Nc=ws.lineOffset/2-(_s.imageName?-(Ju-_s.metrics.width*_s.scale)/2:(_s.scale-1)*Ju)),_s.imageName){const Lu=sl[_s.imageName];Is=Lu.sdf,Al=Lu.pixelRatio,Us=_h/Al}const Sd=vo?[_s.x+kh,_s.y]:[0,0];let Kf=vo?[0,0]:[_s.x+kh+di[0],_s.y+di[1]-Nc],bh=[0,0];Ic&&(bh=Kf,Kf=[0,0]);const hd=_s.metrics.isDoubleResolution?2:1,dd=(_s.metrics.left-Us)*_s.scale-kh+Kf[0],pd=(-_s.metrics.top-Us)*_s.scale+Kf[1],Ef=dd+oo.w/hd*_s.scale/Al,Ch=pd+oo.h/hd*_s.scale/Al,od=new i(dd,pd),Kh=new i(Ef,pd),vd=new i(dd,Ch),Uh=new i(Ef,Ch);if(Ic){const Lu=new i(-kh,kh-Yv),dc=-Math.PI/2,wc=Ju/2-kh,bf=new i(5-Yv-wc,-(_s.imageName?wc:0)),Jc=new i(...bh);od._rotateAround(dc,Lu)._add(bf)._add(Jc),Kh._rotateAround(dc,Lu)._add(bf)._add(Jc),vd._rotateAround(dc,Lu)._add(bf)._add(Jc),Uh._rotateAround(dc,Lu)._add(bf)._add(Jc)}if(Go){const Lu=Math.sin(Go),dc=Math.cos(Go),wc=[dc,-Lu,Lu,dc];od._matMult(wc),Kh._matMult(wc),vd._matMult(wc),Uh._matMult(wc)}const Bd=new i(0,0),Kc=new i(0,0);Ls.push({tl:od,tr:Kh,bl:vd,br:Uh,tex:oo,writingMode:Ka.writingMode,glyphOffset:Sd,sectionIndex:_s.sectionIndex,isSDF:Is,pixelOffsetTL:Bd,pixelOffsetBR:Kc,minFontScaleX:0,minFontScaleY:0})}return Ls}(0,ne,Mt,Ge,rt,st,Se,K.allowVerticalPlacement),Kn=K.textSizeData;let ka=null;Kn.kind==="source"?(ka=[cp*Ge.layout.get("text-size").evaluate(st,{})],ka[0]>Zp&&y(`${K.layerIds[0]}: Value for "text-size" is >= ${V0}. Reduce your "text-size".`)):Kn.kind==="composite"&&(ka=[cp*fn.compositeTextSizes[0].evaluate(st,{},Tn),cp*fn.compositeTextSizes[1].evaluate(st,{},Tn)],(ka[0]>Zp||ka[1]>Zp)&&y(`${K.layerIds[0]}: Value for "text-size" is >= ${V0}. Reduce your "text-size".`)),K.addSymbols(K.text,Dn,ka,Mt,rt,st,nr,O,Ut.lineStartIndex,Ut.lineLength,en,Tn);for(const _i of Ar)Pr[_i]=K.text.placedSymbolArray.length-1;return 4*Dn.length}function J1(K){for(const O in K)return K[O];return null}function Q1(K,O,ne,Se){const Ge=K.compareText;if(O in Ge){const rt=Ge[O];for(let st=rt.length-1;st>=0;st--)if(Se.dist(rt[st])>4;if(Ge!==1)throw new Error(`Got v${Ge} data when expected v1.`);const rt=e_[15&Se];if(!rt)throw new Error("Unrecognized array type.");const[st]=new Uint16Array(O,2,1),[Mt]=new Uint32Array(O,4,1);return new ty(Mt,st,rt,O)}constructor(O,ne=64,Se=Float64Array,Ge){if(isNaN(O)||O<0)throw new Error(`Unpexpected numItems value: ${O}.`);this.numItems=+O,this.nodeSize=Math.min(Math.max(+ne,2),65535),this.ArrayType=Se,this.IndexArrayType=O<65536?Uint16Array:Uint32Array;const rt=e_.indexOf(this.ArrayType),st=2*O*this.ArrayType.BYTES_PER_ELEMENT,Mt=O*this.IndexArrayType.BYTES_PER_ELEMENT,Ut=(8-Mt%8)%8;if(rt<0)throw new Error(`Unexpected typed array class: ${Se}.`);Ge&&Ge instanceof ArrayBuffer?(this.data=Ge,this.ids=new this.IndexArrayType(this.data,8,O),this.coords=new this.ArrayType(this.data,8+Mt+Ut,2*O),this._pos=2*O,this._finished=!0):(this.data=new ArrayBuffer(8+st+Mt+Ut),this.ids=new this.IndexArrayType(this.data,8,O),this.coords=new this.ArrayType(this.data,8+Mt+Ut,2*O),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+rt]),new Uint16Array(this.data,2,1)[0]=ne,new Uint32Array(this.data,4,1)[0]=O)}add(O,ne){const Se=this._pos>>1;return this.ids[Se]=Se,this.coords[this._pos++]=O,this.coords[this._pos++]=ne,Se}finish(){const O=this._pos>>1;if(O!==this.numItems)throw new Error(`Added ${O} items when expected ${this.numItems}.`);return ry(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(O,ne,Se,Ge){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:rt,coords:st,nodeSize:Mt}=this,Ut=[0,rt.length-1,0],nr=[];for(;Ut.length;){const Ar=Ut.pop()||0,Pr=Ut.pop()||0,en=Ut.pop()||0;if(Pr-en<=Mt){for(let Kn=en;Kn<=Pr;Kn++){const ka=st[2*Kn],_i=st[2*Kn+1];ka>=O&&ka<=Se&&_i>=ne&&_i<=Ge&&nr.push(rt[Kn])}continue}const fn=en+Pr>>1,Tn=st[2*fn],Dn=st[2*fn+1];Tn>=O&&Tn<=Se&&Dn>=ne&&Dn<=Ge&&nr.push(rt[fn]),(Ar===0?O<=Tn:ne<=Dn)&&(Ut.push(en),Ut.push(fn-1),Ut.push(1-Ar)),(Ar===0?Se>=Tn:Ge>=Dn)&&(Ut.push(fn+1),Ut.push(Pr),Ut.push(1-Ar))}return nr}within(O,ne,Se){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Ge,coords:rt,nodeSize:st}=this,Mt=[0,Ge.length-1,0],Ut=[],nr=Se*Se;for(;Mt.length;){const Ar=Mt.pop()||0,Pr=Mt.pop()||0,en=Mt.pop()||0;if(Pr-en<=st){for(let Kn=en;Kn<=Pr;Kn++)Zh(rt[2*Kn],rt[2*Kn+1],O,ne)<=nr&&Ut.push(Ge[Kn]);continue}const fn=en+Pr>>1,Tn=rt[2*fn],Dn=rt[2*fn+1];Zh(Tn,Dn,O,ne)<=nr&&Ut.push(Ge[fn]),(Ar===0?O-Se<=Tn:ne-Se<=Dn)&&(Mt.push(en),Mt.push(fn-1),Mt.push(1-Ar)),(Ar===0?O+Se>=Tn:ne+Se>=Dn)&&(Mt.push(fn+1),Mt.push(Pr),Mt.push(1-Ar))}return Ut}}function ry(K,O,ne,Se,Ge,rt){if(Ge-Se<=ne)return;const st=Se+Ge>>1;t_(K,O,st,Se,Ge,rt),ry(K,O,ne,Se,st-1,1-rt),ry(K,O,ne,st+1,Ge,1-rt)}function t_(K,O,ne,Se,Ge,rt){for(;Ge>Se;){if(Ge-Se>600){const nr=Ge-Se+1,Ar=ne-Se+1,Pr=Math.log(nr),en=.5*Math.exp(2*Pr/3),fn=.5*Math.sqrt(Pr*en*(nr-en)/nr)*(Ar-nr/2<0?-1:1);t_(K,O,ne,Math.max(Se,Math.floor(ne-Ar*en/nr+fn)),Math.min(Ge,Math.floor(ne+(nr-Ar)*en/nr+fn)),rt)}const st=O[2*ne+rt];let Mt=Se,Ut=Ge;for(r0(K,O,Se,ne),O[2*Ge+rt]>st&&r0(K,O,Se,Ge);Mtst;)Ut--}O[2*Se+rt]===st?r0(K,O,Se,Ut):(Ut++,r0(K,O,Ut,Ge)),Ut<=ne&&(Se=Ut+1),ne<=Ut&&(Ge=Ut-1)}}function r0(K,O,ne,Se){Hm(K,ne,Se),Hm(O,2*ne,2*Se),Hm(O,2*ne+1,2*Se+1)}function Hm(K,O,ne){const Se=K[O];K[O]=K[ne],K[ne]=Se}function Zh(K,O,ne,Se){const Ge=K-ne,rt=O-Se;return Ge*Ge+rt*rt}var ny;e.bg=void 0,(ny=e.bg||(e.bg={})).create="create",ny.load="load",ny.fullLoad="fullLoad";let $m=null,n0=[];const ay=1e3/60,Wm="loadTime",iy="fullLoadTime",r_={mark(K){performance.mark(K)},frame(K){const O=K;$m!=null&&n0.push(O-$m),$m=O},clearMetrics(){$m=null,n0=[],performance.clearMeasures(Wm),performance.clearMeasures(iy);for(const K in e.bg)performance.clearMarks(e.bg[K])},getPerformanceMetrics(){performance.measure(Wm,e.bg.create,e.bg.load),performance.measure(iy,e.bg.create,e.bg.fullLoad);const K=performance.getEntriesByName(Wm)[0].duration,O=performance.getEntriesByName(iy)[0].duration,ne=n0.length,Se=1/(n0.reduce((rt,st)=>rt+st,0)/ne/1e3),Ge=n0.filter(rt=>rt>ay).reduce((rt,st)=>rt+(st-ay)/ay,0);return{loadTime:K,fullLoadTime:O,fps:Se,percentDroppedFrames:Ge/(ne+Ge)*100,totalFrames:ne}}};e.$=class extends Or{},e.A=Ui,e.B=pi,e.C=function(K){if(z==null){const O=K.navigator?K.navigator.userAgent:null;z=!!K.safari||!(!O||!(/\b(iPad|iPhone|iPod)\b/.test(O)||O.match("Safari")&&!O.match("Chrome")))}return z},e.D=qo,e.E=le,e.F=class{constructor(K,O){this.target=K,this.mapId=O,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new $0(()=>this.process()),this.subscription=function(ne,Se,Ge,rt){return ne.addEventListener(Se,Ge,!1),{unsubscribe:()=>{ne.removeEventListener(Se,Ge,!1)}}}(this.target,"message",ne=>this.receive(ne)),this.globalScope=L(self)?K:window}registerMessageHandler(K,O){this.messageHandlers[K]=O}sendAsync(K,O){return new Promise((ne,Se)=>{const Ge=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Ge]={resolve:ne,reject:Se},O&&O.signal.addEventListener("abort",()=>{delete this.resolveRejects[Ge];const Mt={id:Ge,type:"",origin:location.origin,targetMapId:K.targetMapId,sourceMapId:this.mapId};this.target.postMessage(Mt)},{once:!0});const rt=[],st=Object.assign(Object.assign({},K),{id:Ge,sourceMapId:this.mapId,origin:location.origin,data:Vo(K.data,rt)});this.target.postMessage(st,{transfer:rt})})}receive(K){const O=K.data,ne=O.id;if(!(O.origin!=="file://"&&location.origin!=="file://"&&O.origin!=="resource://android"&&location.origin!=="resource://android"&&O.origin!==location.origin||O.targetMapId&&this.mapId!==O.targetMapId)){if(O.type===""){delete this.tasks[ne];const Se=this.abortControllers[ne];return delete this.abortControllers[ne],void(Se&&Se.abort())}if(L(self)||O.mustQueue)return this.tasks[ne]=O,this.taskQueue.push(ne),void this.invoker.trigger();this.processTask(ne,O)}}process(){if(this.taskQueue.length===0)return;const K=this.taskQueue.shift(),O=this.tasks[K];delete this.tasks[K],this.taskQueue.length>0&&this.invoker.trigger(),O&&this.processTask(K,O)}processTask(K,O){return t(this,void 0,void 0,function*(){if(O.type===""){const Ge=this.resolveRejects[K];return delete this.resolveRejects[K],Ge?void(O.error?Ge.reject(Bo(O.error)):Ge.resolve(Bo(O.data))):void 0}if(!this.messageHandlers[O.type])return void this.completeTask(K,new Error(`Could not find a registered handler for ${O.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const ne=Bo(O.data),Se=new AbortController;this.abortControllers[K]=Se;try{const Ge=yield this.messageHandlers[O.type](O.sourceMapId,ne,Se);this.completeTask(K,null,Ge)}catch(Ge){this.completeTask(K,Ge)}})}completeTask(K,O,ne){const Se=[];delete this.abortControllers[K];const Ge={id:K,type:"",sourceMapId:this.mapId,origin:location.origin,error:O?Vo(O):null,data:Vo(ne,Se)};this.target.postMessage(Ge,{transfer:Se})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=pe,e.H=function(){var K=new Ui(16);return Ui!=Float32Array&&(K[1]=0,K[2]=0,K[3]=0,K[4]=0,K[6]=0,K[7]=0,K[8]=0,K[9]=0,K[11]=0,K[12]=0,K[13]=0,K[14]=0),K[0]=1,K[5]=1,K[10]=1,K[15]=1,K},e.I=Xh,e.J=function(K,O,ne){var Se,Ge,rt,st,Mt,Ut,nr,Ar,Pr,en,fn,Tn,Dn=ne[0],Kn=ne[1],ka=ne[2];return O===K?(K[12]=O[0]*Dn+O[4]*Kn+O[8]*ka+O[12],K[13]=O[1]*Dn+O[5]*Kn+O[9]*ka+O[13],K[14]=O[2]*Dn+O[6]*Kn+O[10]*ka+O[14],K[15]=O[3]*Dn+O[7]*Kn+O[11]*ka+O[15]):(Ge=O[1],rt=O[2],st=O[3],Mt=O[4],Ut=O[5],nr=O[6],Ar=O[7],Pr=O[8],en=O[9],fn=O[10],Tn=O[11],K[0]=Se=O[0],K[1]=Ge,K[2]=rt,K[3]=st,K[4]=Mt,K[5]=Ut,K[6]=nr,K[7]=Ar,K[8]=Pr,K[9]=en,K[10]=fn,K[11]=Tn,K[12]=Se*Dn+Mt*Kn+Pr*ka+O[12],K[13]=Ge*Dn+Ut*Kn+en*ka+O[13],K[14]=rt*Dn+nr*Kn+fn*ka+O[14],K[15]=st*Dn+Ar*Kn+Tn*ka+O[15]),K},e.K=function(K,O,ne){var Se=ne[0],Ge=ne[1],rt=ne[2];return K[0]=O[0]*Se,K[1]=O[1]*Se,K[2]=O[2]*Se,K[3]=O[3]*Se,K[4]=O[4]*Ge,K[5]=O[5]*Ge,K[6]=O[6]*Ge,K[7]=O[7]*Ge,K[8]=O[8]*rt,K[9]=O[9]*rt,K[10]=O[10]*rt,K[11]=O[11]*rt,K[12]=O[12],K[13]=O[13],K[14]=O[14],K[15]=O[15],K},e.L=sa,e.M=function(K,O){const ne={};for(let Se=0;Se{const O=window.document.createElement("video");return O.muted=!0,new Promise(ne=>{O.onloadstart=()=>{ne(O)};for(const Se of K){const Ge=window.document.createElement("source");se(Se)||(O.crossOrigin="Anonymous"),Ge.src=Se,O.appendChild(Ge)}})},e.a4=function(){return _++},e.a5=mi,e.a6=yv,e.a7=Wf,e.a8=Er,e.a9=B1,e.aA=function(K){if(K.type==="custom")return new D1(K);switch(K.type){case"background":return new H0(K);case"circle":return new Xa(K);case"fill":return new xn(K);case"fill-extrusion":return new Rd(K);case"heatmap":return new Xs(K);case"hillshade":return new Uu(K);case"line":return new pv(K);case"raster":return new Jx(K);case"symbol":return new Bm(K)}},e.aB=u,e.aC=function(K,O){if(!K)return[{command:"setStyle",args:[O]}];let ne=[];try{if(!Ve(K.version,O.version))return[{command:"setStyle",args:[O]}];Ve(K.center,O.center)||ne.push({command:"setCenter",args:[O.center]}),Ve(K.zoom,O.zoom)||ne.push({command:"setZoom",args:[O.zoom]}),Ve(K.bearing,O.bearing)||ne.push({command:"setBearing",args:[O.bearing]}),Ve(K.pitch,O.pitch)||ne.push({command:"setPitch",args:[O.pitch]}),Ve(K.sprite,O.sprite)||ne.push({command:"setSprite",args:[O.sprite]}),Ve(K.glyphs,O.glyphs)||ne.push({command:"setGlyphs",args:[O.glyphs]}),Ve(K.transition,O.transition)||ne.push({command:"setTransition",args:[O.transition]}),Ve(K.light,O.light)||ne.push({command:"setLight",args:[O.light]}),Ve(K.terrain,O.terrain)||ne.push({command:"setTerrain",args:[O.terrain]}),Ve(K.sky,O.sky)||ne.push({command:"setSky",args:[O.sky]}),Ve(K.projection,O.projection)||ne.push({command:"setProjection",args:[O.projection]});const Se={},Ge=[];(function(st,Mt,Ut,nr){let Ar;for(Ar in Mt=Mt||{},st=st||{})Object.prototype.hasOwnProperty.call(st,Ar)&&(Object.prototype.hasOwnProperty.call(Mt,Ar)||it(Ar,Ut,nr));for(Ar in Mt)Object.prototype.hasOwnProperty.call(Mt,Ar)&&(Object.prototype.hasOwnProperty.call(st,Ar)?Ve(st[Ar],Mt[Ar])||(st[Ar].type==="geojson"&&Mt[Ar].type==="geojson"&&bt(st,Mt,Ar)?Xe(Ut,{command:"setGeoJSONSourceData",args:[Ar,Mt[Ar].data]}):yt(Ar,Mt,Ut,nr)):We(Ar,Mt,Ut))})(K.sources,O.sources,Ge,Se);const rt=[];K.layers&&K.layers.forEach(st=>{"source"in st&&Se[st.source]?ne.push({command:"removeLayer",args:[st.id]}):rt.push(st)}),ne=ne.concat(Ge),function(st,Mt,Ut){Mt=Mt||[];const nr=(st=st||[]).map(ht),Ar=Mt.map(ht),Pr=st.reduce(qe,{}),en=Mt.reduce(qe,{}),fn=nr.slice(),Tn=Object.create(null);let Dn,Kn,ka,_i,Ka;for(let di=0,Gi=0;di@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(ne,Se,Ge,rt)=>{const st=Ge||rt;return O[Se]=!st||st.toLowerCase(),""}),O["max-age"]){const ne=parseInt(O["max-age"],10);isNaN(ne)?delete O["max-age"]:O["max-age"]=ne}return O},e.ab=function(K,O){const ne=[];for(const Se in K)Se in O||ne.push(Se);return ne},e.ac=b,e.ad=function(K,O,ne){var Se=Math.sin(ne),Ge=Math.cos(ne),rt=O[0],st=O[1],Mt=O[2],Ut=O[3],nr=O[4],Ar=O[5],Pr=O[6],en=O[7];return O!==K&&(K[8]=O[8],K[9]=O[9],K[10]=O[10],K[11]=O[11],K[12]=O[12],K[13]=O[13],K[14]=O[14],K[15]=O[15]),K[0]=rt*Ge+nr*Se,K[1]=st*Ge+Ar*Se,K[2]=Mt*Ge+Pr*Se,K[3]=Ut*Ge+en*Se,K[4]=nr*Ge-rt*Se,K[5]=Ar*Ge-st*Se,K[6]=Pr*Ge-Mt*Se,K[7]=en*Ge-Ut*Se,K},e.ae=function(K){var O=new Ui(16);return O[0]=K[0],O[1]=K[1],O[2]=K[2],O[3]=K[3],O[4]=K[4],O[5]=K[5],O[6]=K[6],O[7]=K[7],O[8]=K[8],O[9]=K[9],O[10]=K[10],O[11]=K[11],O[12]=K[12],O[13]=K[13],O[14]=K[14],O[15]=K[15],O},e.af=ui,e.ag=function(K,O){let ne=0,Se=0;if(K.kind==="constant")Se=K.layoutSize;else if(K.kind!=="source"){const{interpolationType:Ge,minZoom:rt,maxZoom:st}=K,Mt=Ge?b(wi.interpolationFactor(Ge,O,rt,st),0,1):0;K.kind==="camera"?Se=So.number(K.minSize,K.maxSize,Mt):ne=Mt}return{uSizeT:ne,uSize:Se}},e.ai=function(K,{uSize:O,uSizeT:ne},{lowerSize:Se,upperSize:Ge}){return K.kind==="source"?Se/cp:K.kind==="composite"?So.number(Se/cp,Ge/cp,ne):O},e.aj=Kp,e.ak=function(K,O,ne,Se){const Ge=O.y-K.y,rt=O.x-K.x,st=Se.y-ne.y,Mt=Se.x-ne.x,Ut=st*rt-Mt*Ge;if(Ut===0)return null;const nr=(Mt*(K.y-ne.y)-st*(K.x-ne.x))/Ut;return new i(K.x+nr*rt,K.y+nr*Ge)},e.al=q1,e.am=Aa,e.an=ya,e.ao=function(K){let O=1/0,ne=1/0,Se=-1/0,Ge=-1/0;for(const rt of K)O=Math.min(O,rt.x),ne=Math.min(ne,rt.y),Se=Math.max(Se,rt.x),Ge=Math.max(Ge,rt.y);return[O,ne,Se,Ge]},e.ap=Ju,e.ar=Gg,e.as=function(K,O){var ne=O[0],Se=O[1],Ge=O[2],rt=O[3],st=O[4],Mt=O[5],Ut=O[6],nr=O[7],Ar=O[8],Pr=O[9],en=O[10],fn=O[11],Tn=O[12],Dn=O[13],Kn=O[14],ka=O[15],_i=ne*Mt-Se*st,Ka=ne*Ut-Ge*st,di=ne*nr-rt*st,Gi=Se*Ut-Ge*Mt,vo=Se*nr-rt*Mt,Yo=Ge*nr-rt*Ut,sl=Ar*Dn-Pr*Tn,is=Ar*Kn-en*Tn,Go=Ar*ka-fn*Tn,Ls=Pr*Kn-en*Dn,ws=Pr*ka-fn*Dn,_s=en*ka-fn*Kn,oo=_i*_s-Ka*ws+di*Ls+Gi*Go-vo*is+Yo*sl;return oo?(K[0]=(Mt*_s-Ut*ws+nr*Ls)*(oo=1/oo),K[1]=(Ge*ws-Se*_s-rt*Ls)*oo,K[2]=(Dn*Yo-Kn*vo+ka*Gi)*oo,K[3]=(en*vo-Pr*Yo-fn*Gi)*oo,K[4]=(Ut*Go-st*_s-nr*is)*oo,K[5]=(ne*_s-Ge*Go+rt*is)*oo,K[6]=(Kn*di-Tn*Yo-ka*Ka)*oo,K[7]=(Ar*Yo-en*di+fn*Ka)*oo,K[8]=(st*ws-Mt*Go+nr*sl)*oo,K[9]=(Se*Go-ne*ws-rt*sl)*oo,K[10]=(Tn*vo-Dn*di+ka*_i)*oo,K[11]=(Pr*di-Ar*vo-fn*_i)*oo,K[12]=(Mt*is-st*Ls-Ut*sl)*oo,K[13]=(ne*Ls-Se*is+Ge*sl)*oo,K[14]=(Dn*Ka-Tn*Gi-Kn*_i)*oo,K[15]=(Ar*Gi-Pr*Ka+en*_i)*oo,K):null},e.at=ey,e.au=qg,e.av=ty,e.aw=function(){const K={},O=ue.$version;for(const ne in ue.$root){const Se=ue.$root[ne];if(Se.required){let Ge=null;Ge=ne==="version"?O:Se.type==="array"?[]:{},Ge!=null&&(K[ne]=Ge)}}return K},e.ax=ro,e.ay=W,e.az=function(K){K=K.slice();const O=Object.create(null);for(let ne=0;ne25||Se<0||Se>=1||ne<0||ne>=1)},e.bc=function(K,O){return K[0]=O[0],K[1]=0,K[2]=0,K[3]=0,K[4]=0,K[5]=O[1],K[6]=0,K[7]=0,K[8]=0,K[9]=0,K[10]=O[2],K[11]=0,K[12]=0,K[13]=0,K[14]=0,K[15]=1,K},e.bd=class extends xr{},e.be=Xg,e.bf=r_,e.bh=ge,e.bi=function(K,O){oe.REGISTERED_PROTOCOLS[K]=O},e.bj=function(K){delete oe.REGISTERED_PROTOCOLS[K]},e.bk=function(K,O){const ne={};for(let Ge=0;Ge_s*Ju)}let is=st?"center":ne.get("text-justify").evaluate(nr,{},K.canonical);const Go=ne.get("symbol-placement")==="point"?ne.get("text-max-width").evaluate(nr,{},K.canonical)*Ju:1/0,Ls=()=>{K.bucket.allowVerticalPlacement&&ns(di)&&(Tn.vertical=Rm(Dn,K.glyphMap,K.glyphPositions,K.imagePositions,Ar,Go,rt,Yo,"left",vo,ka,e.ah.vertical,!0,en,Pr))};if(!st&&sl){const ws=new Set;if(is==="auto")for(let oo=0;oot(void 0,void 0,void 0,function*(){if(K.byteLength===0)return createImageBitmap(new ImageData(1,1));const O=new Blob([new Uint8Array(K)],{type:"image/png"});try{return createImageBitmap(O)}catch(ne){throw new Error(`Could not load image because of ${ne.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=E,e.f=K=>new Promise((O,ne)=>{const Se=new Image;Se.onload=()=>{O(Se),URL.revokeObjectURL(Se.src),Se.onload=null,window.requestAnimationFrame(()=>{Se.src=U})},Se.onerror=()=>ne(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 Ge=new Blob([new Uint8Array(K)],{type:"image/png"});Se.src=K.byteLength?URL.createObjectURL(Ge):U}),e.g=ye,e.h=(K,O)=>ae(E(K,{type:"json"}),O),e.i=L,e.j=Y,e.k=ie,e.l=(K,O)=>ae(E(K,{type:"arrayBuffer"}),O),e.m=ae,e.n=function(K){return new Bg(K).readFields(Hx,[])},e.o=Ko,e.p=Dm,e.q=Je,e.r=Ra,e.s=se,e.t=ni,e.u=Na,e.v=ue,e.w=y,e.x=function([K,O,ne]){return O+=90,O*=Math.PI/180,ne*=Math.PI/180,{x:K*Math.cos(O)*Math.sin(ne),y:K*Math.sin(O)*Math.sin(ne),z:K*Math.cos(ne)}},e.y=So,e.z=cl}),S("worker",["./shared"],function(e){class t{constructor(Qe){this.keyCache={},Qe&&this.replace(Qe)}replace(Qe){this._layerConfigs={},this._layers={},this.update(Qe,[])}update(Qe,ct){for(const Ie of Qe){this._layerConfigs[Ie.id]=Ie;const Pe=this._layers[Ie.id]=e.aA(Ie);Pe._featureFilter=e.a7(Pe.filter),this.keyCache[Ie.id]&&delete this.keyCache[Ie.id]}for(const Ie of ct)delete this.keyCache[Ie],delete this._layerConfigs[Ie],delete this._layers[Ie];this.familiesBySource={};const Ue=e.bk(Object.values(this._layerConfigs),this.keyCache);for(const Ie of Ue){const Pe=Ie.map(Ht=>this._layers[Ht.id]),Be=Pe[0];if(Be.visibility==="none")continue;const at=Be.source||"";let ft=this.familiesBySource[at];ft||(ft=this.familiesBySource[at]={});const Bt=Be.sourceLayer||"_geojsonTileLayer";let Nt=ft[Bt];Nt||(Nt=ft[Bt]=[]),Nt.push(Pe)}}}class r{constructor(Qe){const ct={},Ue=[];for(const at in Qe){const ft=Qe[at],Bt=ct[at]={};for(const Nt in ft){const Ht=ft[+Nt];if(!Ht||Ht.bitmap.width===0||Ht.bitmap.height===0)continue;const or={x:0,y:0,w:Ht.bitmap.width+2,h:Ht.bitmap.height+2};Ue.push(or),Bt[Nt]={rect:or,metrics:Ht.metrics}}}const{w:Ie,h:Pe}=e.p(Ue),Be=new e.o({width:Ie||1,height:Pe||1});for(const at in Qe){const ft=Qe[at];for(const Bt in ft){const Nt=ft[+Bt];if(!Nt||Nt.bitmap.width===0||Nt.bitmap.height===0)continue;const Ht=ct[at][Bt].rect;e.o.copy(Nt.bitmap,Be,{x:0,y:0},{x:Ht.x+1,y:Ht.y+1},Nt.bitmap)}}this.image=Be,this.positions=ct}}e.bl("GlyphAtlas",r);class o{constructor(Qe){this.tileID=new e.S(Qe.tileID.overscaledZ,Qe.tileID.wrap,Qe.tileID.canonical.z,Qe.tileID.canonical.x,Qe.tileID.canonical.y),this.uid=Qe.uid,this.zoom=Qe.zoom,this.pixelRatio=Qe.pixelRatio,this.tileSize=Qe.tileSize,this.source=Qe.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Qe.showCollisionBoxes,this.collectResourceTiming=!!Qe.collectResourceTiming,this.returnDependencies=!!Qe.returnDependencies,this.promoteId=Qe.promoteId,this.inFlightDependencies=[]}parse(Qe,ct,Ue,Ie){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=Qe,this.collisionBoxArray=new e.a5;const Pe=new e.bm(Object.keys(Qe.layers).sort()),Be=new e.bn(this.tileID,this.promoteId);Be.bucketLayerIDs=[];const at={},ft={featureIndex:Be,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Ue},Bt=ct.familiesBySource[this.source];for(const ma in Bt){const Jn=Qe.layers[ma];if(!Jn)continue;Jn.version===1&&e.w(`Vector tile source "${this.source}" layer "${ma}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const ja=Pe.encode(ma),ti=[];for(let gr=0;gr=Kt.maxzoom||Kt.visibility!=="none"&&(n(gr,this.zoom,Ue),(at[Kt.id]=Kt.createBucket({index:Be.bucketLayerIDs.length,layers:gr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:ja,sourceID:this.source})).populate(ti,ft,this.tileID.canonical),Be.bucketLayerIDs.push(gr.map(vr=>vr.id)))}}const Nt=e.aF(ft.glyphDependencies,ma=>Object.keys(ma).map(Number));this.inFlightDependencies.forEach(ma=>ma?.abort()),this.inFlightDependencies=[];let Ht=Promise.resolve({});if(Object.keys(Nt).length){const ma=new AbortController;this.inFlightDependencies.push(ma),Ht=Ie.sendAsync({type:"GG",data:{stacks:Nt,source:this.source,tileID:this.tileID,type:"glyphs"}},ma)}const or=Object.keys(ft.iconDependencies);let Cr=Promise.resolve({});if(or.length){const ma=new AbortController;this.inFlightDependencies.push(ma),Cr=Ie.sendAsync({type:"GI",data:{icons:or,source:this.source,tileID:this.tileID,type:"icons"}},ma)}const Sr=Object.keys(ft.patternDependencies);let Tr=Promise.resolve({});if(Sr.length){const ma=new AbortController;this.inFlightDependencies.push(ma),Tr=Ie.sendAsync({type:"GI",data:{icons:Sr,source:this.source,tileID:this.tileID,type:"patterns"}},ma)}const[Yr,Fn,ua]=yield Promise.all([Ht,Cr,Tr]),ta=new r(Yr),va=new e.bo(Fn,ua);for(const ma in at){const Jn=at[ma];Jn instanceof e.a6?(n(Jn.layers,this.zoom,Ue),e.bp({bucket:Jn,glyphMap:Yr,glyphPositions:ta.positions,imageMap:Fn,imagePositions:va.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Jn.hasPattern&&(Jn instanceof e.bq||Jn instanceof e.br||Jn instanceof e.bs)&&(n(Jn.layers,this.zoom,Ue),Jn.addFeatures(ft,this.tileID.canonical,va.patternPositions))}return this.status="done",{buckets:Object.values(at).filter(ma=>!ma.isEmpty()),featureIndex:Be,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ta.image,imageAtlas:va,glyphMap:this.returnDependencies?Yr:null,iconMap:this.returnDependencies?Fn:null,glyphPositions:this.returnDependencies?ta.positions:null}})}}function n(Ot,Qe,ct){const Ue=new e.z(Qe);for(const Ie of Ot)Ie.recalculate(Ue,ct)}class i{constructor(Qe,ct,Ue){this.actor=Qe,this.layerIndex=ct,this.availableImages=Ue,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(Qe,ct){return e._(this,void 0,void 0,function*(){const Ue=yield e.l(Qe.request,ct);try{return{vectorTile:new e.bt.VectorTile(new e.bu(Ue.data)),rawData:Ue.data,cacheControl:Ue.cacheControl,expires:Ue.expires}}catch(Ie){const Pe=new Uint8Array(Ue.data);let Be=`Unable to parse the tile at ${Qe.request.url}, `;throw Be+=Pe[0]===31&&Pe[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Ie.message}`,new Error(Be)}})}loadTile(Qe){return e._(this,void 0,void 0,function*(){const ct=Qe.uid,Ue=!!(Qe&&Qe.request&&Qe.request.collectResourceTiming)&&new e.bv(Qe.request),Ie=new o(Qe);this.loading[ct]=Ie;const Pe=new AbortController;Ie.abort=Pe;try{const Be=yield this.loadVectorTile(Qe,Pe);if(delete this.loading[ct],!Be)return null;const at=Be.rawData,ft={};Be.expires&&(ft.expires=Be.expires),Be.cacheControl&&(ft.cacheControl=Be.cacheControl);const Bt={};if(Ue){const Ht=Ue.finish();Ht&&(Bt.resourceTiming=JSON.parse(JSON.stringify(Ht)))}Ie.vectorTile=Be.vectorTile;const Nt=Ie.parse(Be.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[ct]=Ie,this.fetching[ct]={rawTileData:at,cacheControl:ft,resourceTiming:Bt};try{const Ht=yield Nt;return e.e({rawTileData:at.slice(0)},Ht,ft,Bt)}finally{delete this.fetching[ct]}}catch(Be){throw delete this.loading[ct],Ie.status="done",this.loaded[ct]=Ie,Be}})}reloadTile(Qe){return e._(this,void 0,void 0,function*(){const ct=Qe.uid;if(!this.loaded||!this.loaded[ct])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Ue=this.loaded[ct];if(Ue.showCollisionBoxes=Qe.showCollisionBoxes,Ue.status==="parsing"){const Ie=yield Ue.parse(Ue.vectorTile,this.layerIndex,this.availableImages,this.actor);let Pe;if(this.fetching[ct]){const{rawTileData:Be,cacheControl:at,resourceTiming:ft}=this.fetching[ct];delete this.fetching[ct],Pe=e.e({rawTileData:Be.slice(0)},Ie,at,ft)}else Pe=Ie;return Pe}if(Ue.status==="done"&&Ue.vectorTile)return Ue.parse(Ue.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(Qe){return e._(this,void 0,void 0,function*(){const ct=this.loading,Ue=Qe.uid;ct&&ct[Ue]&&ct[Ue].abort&&(ct[Ue].abort.abort(),delete ct[Ue])})}removeTile(Qe){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[Qe.uid]&&delete this.loaded[Qe.uid]})}}class a{constructor(){this.loaded={}}loadTile(Qe){return e._(this,void 0,void 0,function*(){const{uid:ct,encoding:Ue,rawImageData:Ie,redFactor:Pe,greenFactor:Be,blueFactor:at,baseShift:ft}=Qe,Bt=Ie.width+2,Nt=Ie.height+2,Ht=e.b(Ie)?new e.R({width:Bt,height:Nt},yield e.bw(Ie,-1,-1,Bt,Nt)):Ie,or=new e.bx(ct,Ht,Ue,Pe,Be,at,ft);return this.loaded=this.loaded||{},this.loaded[ct]=or,or})}removeTile(Qe){const ct=this.loaded,Ue=Qe.uid;ct&&ct[Ue]&&delete ct[Ue]}}function s(Ot,Qe){if(Ot.length!==0){f(Ot[0],Qe);for(var ct=1;ct=Math.abs(at)?ct-ft+at:at-ft+ct,ct=ft}ct+Ue>=0!=!!Qe&&Ot.reverse()}var c=e.by(function Ot(Qe,ct){var Ue,Ie=Qe&&Qe.type;if(Ie==="FeatureCollection")for(Ue=0;Ue>31}function L(Ot,Qe){for(var ct=Ot.loadGeometry(),Ue=Ot.type,Ie=0,Pe=0,Be=ct.length,at=0;atOt},B=Math.fround||(D=new Float32Array(1),Ot=>(D[0]=+Ot,D[0]));var D;const j=3,q=5,J=6;class oe{constructor(Qe){this.options=Object.assign(Object.create(U),Qe),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(Qe){const{log:ct,minZoom:Ue,maxZoom:Ie}=this.options;ct&&console.time("total time");const Pe=`prepare ${Qe.length} points`;ct&&console.time(Pe),this.points=Qe;const Be=[];for(let ft=0;ft=Ue;ft--){const Bt=+Date.now();at=this.trees[ft]=this._createTree(this._cluster(at,ft)),ct&&console.log("z%d: %d clusters in %dms",ft,at.numItems,+Date.now()-Bt)}return ct&&console.timeEnd("total time"),this}getClusters(Qe,ct){let Ue=((Qe[0]+180)%360+360)%360-180;const Ie=Math.max(-90,Math.min(90,Qe[1]));let Pe=Qe[2]===180?180:((Qe[2]+180)%360+360)%360-180;const Be=Math.max(-90,Math.min(90,Qe[3]));if(Qe[2]-Qe[0]>=360)Ue=-180,Pe=180;else if(Ue>Pe){const Ht=this.getClusters([Ue,Ie,180,Be],ct),or=this.getClusters([-180,Ie,Pe,Be],ct);return Ht.concat(or)}const at=this.trees[this._limitZoom(ct)],ft=at.range(ge(Ue),W(Be),ge(Pe),W(Ie)),Bt=at.data,Nt=[];for(const Ht of ft){const or=this.stride*Ht;Nt.push(Bt[or+q]>1?ye(Bt,or,this.clusterProps):this.points[Bt[or+j]])}return Nt}getChildren(Qe){const ct=this._getOriginId(Qe),Ue=this._getOriginZoom(Qe),Ie="No cluster with the specified id.",Pe=this.trees[Ue];if(!Pe)throw new Error(Ie);const Be=Pe.data;if(ct*this.stride>=Be.length)throw new Error(Ie);const at=this.options.radius/(this.options.extent*Math.pow(2,Ue-1)),ft=Pe.within(Be[ct*this.stride],Be[ct*this.stride+1],at),Bt=[];for(const Nt of ft){const Ht=Nt*this.stride;Be[Ht+4]===Qe&&Bt.push(Be[Ht+q]>1?ye(Be,Ht,this.clusterProps):this.points[Be[Ht+j]])}if(Bt.length===0)throw new Error(Ie);return Bt}getLeaves(Qe,ct,Ue){const Ie=[];return this._appendLeaves(Ie,Qe,ct=ct||10,Ue=Ue||0,0),Ie}getTile(Qe,ct,Ue){const Ie=this.trees[this._limitZoom(Qe)],Pe=Math.pow(2,Qe),{extent:Be,radius:at}=this.options,ft=at/Be,Bt=(Ue-ft)/Pe,Nt=(Ue+1+ft)/Pe,Ht={features:[]};return this._addTileFeatures(Ie.range((ct-ft)/Pe,Bt,(ct+1+ft)/Pe,Nt),Ie.data,ct,Ue,Pe,Ht),ct===0&&this._addTileFeatures(Ie.range(1-ft/Pe,Bt,1,Nt),Ie.data,Pe,Ue,Pe,Ht),ct===Pe-1&&this._addTileFeatures(Ie.range(0,Bt,ft/Pe,Nt),Ie.data,-1,Ue,Pe,Ht),Ht.features.length?Ht:null}getClusterExpansionZoom(Qe){let ct=this._getOriginZoom(Qe)-1;for(;ct<=this.options.maxZoom;){const Ue=this.getChildren(Qe);if(ct++,Ue.length!==1)break;Qe=Ue[0].properties.cluster_id}return ct}_appendLeaves(Qe,ct,Ue,Ie,Pe){const Be=this.getChildren(ct);for(const at of Be){const ft=at.properties;if(ft&&ft.cluster?Pe+ft.point_count<=Ie?Pe+=ft.point_count:Pe=this._appendLeaves(Qe,ft.cluster_id,Ue,Ie,Pe):Pe1;let Nt,Ht,or;if(Bt)Nt=pe(ct,ft,this.clusterProps),Ht=ct[ft],or=ct[ft+1];else{const Tr=this.points[ct[ft+j]];Nt=Tr.properties;const[Yr,Fn]=Tr.geometry.coordinates;Ht=ge(Yr),or=W(Fn)}const Cr={type:1,geometry:[[Math.round(this.options.extent*(Ht*Pe-Ue)),Math.round(this.options.extent*(or*Pe-Ie))]],tags:Nt};let Sr;Sr=Bt||this.options.generateId?ct[ft+j]:this.points[ct[ft+j]].id,Sr!==void 0&&(Cr.id=Sr),Be.features.push(Cr)}}_limitZoom(Qe){return Math.max(this.options.minZoom,Math.min(Math.floor(+Qe),this.options.maxZoom+1))}_cluster(Qe,ct){const{radius:Ue,extent:Ie,reduce:Pe,minPoints:Be}=this.options,at=Ue/(Ie*Math.pow(2,ct)),ft=Qe.data,Bt=[],Nt=this.stride;for(let Ht=0;Htct&&(Yr+=ft[ua+q])}if(Yr>Tr&&Yr>=Be){let Fn,ua=or*Tr,ta=Cr*Tr,va=-1;const ma=((Ht/Nt|0)<<5)+(ct+1)+this.points.length;for(const Jn of Sr){const ja=Jn*Nt;if(ft[ja+2]<=ct)continue;ft[ja+2]=ct;const ti=ft[ja+q];ua+=ft[ja]*ti,ta+=ft[ja+1]*ti,ft[ja+4]=ma,Pe&&(Fn||(Fn=this._map(ft,Ht,!0),va=this.clusterProps.length,this.clusterProps.push(Fn)),Pe(Fn,this._map(ft,ja)))}ft[Ht+4]=ma,Bt.push(ua/Yr,ta/Yr,1/0,ma,-1,Yr),Pe&&Bt.push(va)}else{for(let Fn=0;Fn1)for(const Fn of Sr){const ua=Fn*Nt;if(!(ft[ua+2]<=ct)){ft[ua+2]=ct;for(let ta=0;ta>5}_getOriginZoom(Qe){return(Qe-this.points.length)%32}_map(Qe,ct,Ue){if(Qe[ct+q]>1){const Be=this.clusterProps[Qe[ct+J]];return Ue?Object.assign({},Be):Be}const Ie=this.points[Qe[ct+j]].properties,Pe=this.options.map(Ie);return Ue&&Pe===Ie?Object.assign({},Pe):Pe}}function ye(Ot,Qe,ct){return{type:"Feature",id:Ot[Qe+j],properties:pe(Ot,Qe,ct),geometry:{type:"Point",coordinates:[(Ue=Ot[Qe],360*(Ue-.5)),ae(Ot[Qe+1])]}};var Ue}function pe(Ot,Qe,ct){const Ue=Ot[Qe+q],Ie=Ue>=1e4?`${Math.round(Ue/1e3)}k`:Ue>=1e3?Math.round(Ue/100)/10+"k":Ue,Pe=Ot[Qe+J],Be=Pe===-1?{}:Object.assign({},ct[Pe]);return Object.assign(Be,{cluster:!0,cluster_id:Ot[Qe+j],point_count:Ue,point_count_abbreviated:Ie})}function ge(Ot){return Ot/360+.5}function W(Ot){const Qe=Math.sin(Ot*Math.PI/180),ct=.5-.25*Math.log((1+Qe)/(1-Qe))/Math.PI;return ct<0?0:ct>1?1:ct}function ae(Ot){const Qe=(180-360*Ot)*Math.PI/180;return 360*Math.atan(Math.exp(Qe))/Math.PI-90}function se(Ot,Qe,ct,Ue){let Ie=Ue;const Pe=Qe+(ct-Qe>>1);let Be,at=ct-Qe;const ft=Ot[Qe],Bt=Ot[Qe+1],Nt=Ot[ct],Ht=Ot[ct+1];for(let or=Qe+3;orIe)Be=or,Ie=Cr;else if(Cr===Ie){const Sr=Math.abs(or-Pe);SrUe&&(Be-Qe>3&&se(Ot,Qe,Be,Ue),Ot[Be+2]=Ie,ct-Be>3&&se(Ot,Be,ct,Ue))}function Q(Ot,Qe,ct,Ue,Ie,Pe){let Be=Ie-ct,at=Pe-Ue;if(Be!==0||at!==0){const ft=((Ot-ct)*Be+(Qe-Ue)*at)/(Be*Be+at*at);ft>1?(ct=Ie,Ue=Pe):ft>0&&(ct+=Be*ft,Ue+=at*ft)}return Be=Ot-ct,at=Qe-Ue,Be*Be+at*at}function me(Ot,Qe,ct,Ue){const Ie={id:Ot??null,type:Qe,geometry:ct,tags:Ue,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(Qe==="Point"||Qe==="MultiPoint"||Qe==="LineString")ie(Ie,ct);else if(Qe==="Polygon")ie(Ie,ct[0]);else if(Qe==="MultiLineString")for(const Pe of ct)ie(Ie,Pe);else if(Qe==="MultiPolygon")for(const Pe of ct)ie(Ie,Pe[0]);return Ie}function ie(Ot,Qe){for(let ct=0;ct0&&(Be+=Ue?(Ie*Nt-Bt*Pe)/2:Math.sqrt(Math.pow(Bt-Ie,2)+Math.pow(Nt-Pe,2))),Ie=Bt,Pe=Nt}const at=Qe.length-3;Qe[2]=1,se(Qe,0,at,ct),Qe[at+2]=1,Qe.size=Math.abs(Be),Qe.start=0,Qe.end=Qe.size}function Te(Ot,Qe,ct,Ue){for(let Ie=0;Ie1?1:ct}function Xe(Ot,Qe,ct,Ue,Ie,Pe,Be,at){if(Ue/=Qe,Pe>=(ct/=Qe)&&Be=Ue)return null;const ft=[];for(const Bt of Ot){const Nt=Bt.geometry;let Ht=Bt.type;const or=Ie===0?Bt.minX:Bt.minY,Cr=Ie===0?Bt.maxX:Bt.maxY;if(or>=ct&&Cr=Ue)continue;let Sr=[];if(Ht==="Point"||Ht==="MultiPoint")We(Nt,Sr,ct,Ue,Ie);else if(Ht==="LineString")it(Nt,Sr,ct,Ue,Ie,!1,at.lineMetrics);else if(Ht==="MultiLineString")bt(Nt,Sr,ct,Ue,Ie,!1);else if(Ht==="Polygon")bt(Nt,Sr,ct,Ue,Ie,!0);else if(Ht==="MultiPolygon")for(const Tr of Nt){const Yr=[];bt(Tr,Yr,ct,Ue,Ie,!0),Yr.length&&Sr.push(Yr)}if(Sr.length){if(at.lineMetrics&&Ht==="LineString"){for(const Tr of Sr)ft.push(me(Bt.id,Ht,Tr,Bt.tags));continue}Ht!=="LineString"&&Ht!=="MultiLineString"||(Sr.length===1?(Ht="LineString",Sr=Sr[0]):Ht="MultiLineString"),Ht!=="Point"&&Ht!=="MultiPoint"||(Ht=Sr.length===3?"Point":"MultiPoint"),ft.push(me(Bt.id,Ht,Sr,Bt.tags))}}return ft.length?ft:null}function We(Ot,Qe,ct,Ue,Ie){for(let Pe=0;Pe=ct&&Be<=Ue&&mt(Qe,Ot[Pe],Ot[Pe+1],Ot[Pe+2])}}function it(Ot,Qe,ct,Ue,Ie,Pe,Be){let at=yt(Ot);const ft=Ie===0?ht:qe;let Bt,Nt,Ht=Ot.start;for(let Yr=0;Yrct&&(Nt=ft(at,Fn,ua,va,ma,ct),Be&&(at.start=Ht+Bt*Nt)):Jn>Ue?ja=ct&&(Nt=ft(at,Fn,ua,va,ma,ct),ti=!0),ja>Ue&&Jn<=Ue&&(Nt=ft(at,Fn,ua,va,ma,Ue),ti=!0),!Pe&&ti&&(Be&&(at.end=Ht+Bt*Nt),Qe.push(at),at=yt(Ot)),Be&&(Ht+=Bt)}let or=Ot.length-3;const Cr=Ot[or],Sr=Ot[or+1],Tr=Ie===0?Cr:Sr;Tr>=ct&&Tr<=Ue&&mt(at,Cr,Sr,Ot[or+2]),or=at.length-3,Pe&&or>=3&&(at[or]!==at[0]||at[or+1]!==at[1])&&mt(at,at[0],at[1],at[2]),at.length&&Qe.push(at)}function yt(Ot){const Qe=[];return Qe.size=Ot.size,Qe.start=Ot.start,Qe.end=Ot.end,Qe}function bt(Ot,Qe,ct,Ue,Ie,Pe){for(const Be of Ot)it(Be,Qe,ct,Ue,Ie,Pe,!1)}function mt(Ot,Qe,ct,Ue){Ot.push(Qe,ct,Ue)}function ht(Ot,Qe,ct,Ue,Ie,Pe){const Be=(Pe-Qe)/(Ue-Qe);return mt(Ot,Pe,ct+(Ie-ct)*Be,1),Be}function qe(Ot,Qe,ct,Ue,Ie,Pe){const Be=(Pe-ct)/(Ie-ct);return mt(Ot,Qe+(Ue-Qe)*Be,Pe,1),Be}function ze(Ot,Qe){const ct=[];for(let Ue=0;Ue0&&Qe.size<(Ie?Be:Ue))return void(ct.numPoints+=Qe.length/3);const at=[];for(let ft=0;ftBe)&&(ct.numSimplified++,at.push(Qe[ft],Qe[ft+1])),ct.numPoints++;Ie&&function(ft,Bt){let Nt=0;for(let Ht=0,or=ft.length,Cr=or-2;Ht0===Bt)for(let Ht=0,or=ft.length;Ht24)throw new Error("maxZoom should be in the 0-24 range");if(ct.promoteId&&ct.generateId)throw new Error("promoteId and generateId cannot be used together.");let Ie=function(Pe,Be){const at=[];if(Pe.type==="FeatureCollection")for(let ft=0;ft1&&console.time("creation"),Cr=this.tiles[or]=wt(Qe,ct,Ue,Ie,Bt),this.tileCoords.push({z:ct,x:Ue,y:Ie}),Nt)){Nt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ct,Ue,Ie,Cr.numFeatures,Cr.numPoints,Cr.numSimplified),console.timeEnd("creation"));const ti=`z${ct}`;this.stats[ti]=(this.stats[ti]||0)+1,this.total++}if(Cr.source=Qe,Pe==null){if(ct===Bt.indexMaxZoom||Cr.numPoints<=Bt.indexMaxPoints)continue}else{if(ct===Bt.maxZoom||ct===Pe)continue;if(Pe!=null){const ti=Pe-ct;if(Ue!==Be>>ti||Ie!==at>>ti)continue}}if(Cr.source=null,Qe.length===0)continue;Nt>1&&console.time("clipping");const Sr=.5*Bt.buffer/Bt.extent,Tr=.5-Sr,Yr=.5+Sr,Fn=1+Sr;let ua=null,ta=null,va=null,ma=null,Jn=Xe(Qe,Ht,Ue-Sr,Ue+Yr,0,Cr.minX,Cr.maxX,Bt),ja=Xe(Qe,Ht,Ue+Tr,Ue+Fn,0,Cr.minX,Cr.maxX,Bt);Qe=null,Jn&&(ua=Xe(Jn,Ht,Ie-Sr,Ie+Yr,1,Cr.minY,Cr.maxY,Bt),ta=Xe(Jn,Ht,Ie+Tr,Ie+Fn,1,Cr.minY,Cr.maxY,Bt),Jn=null),ja&&(va=Xe(ja,Ht,Ie-Sr,Ie+Yr,1,Cr.minY,Cr.maxY,Bt),ma=Xe(ja,Ht,Ie+Tr,Ie+Fn,1,Cr.minY,Cr.maxY,Bt),ja=null),Nt>1&&console.timeEnd("clipping"),ft.push(ua||[],ct+1,2*Ue,2*Ie),ft.push(ta||[],ct+1,2*Ue,2*Ie+1),ft.push(va||[],ct+1,2*Ue+1,2*Ie),ft.push(ma||[],ct+1,2*Ue+1,2*Ie+1)}}getTile(Qe,ct,Ue){Qe=+Qe,ct=+ct,Ue=+Ue;const Ie=this.options,{extent:Pe,debug:Be}=Ie;if(Qe<0||Qe>24)return null;const at=1<1&&console.log("drilling down to z%d-%d-%d",Qe,ct,Ue);let Bt,Nt=Qe,Ht=ct,or=Ue;for(;!Bt&&Nt>0;)Nt--,Ht>>=1,or>>=1,Bt=this.tiles[dr(Nt,Ht,or)];return Bt&&Bt.source?(Be>1&&(console.log("found parent tile z%d-%d-%d",Nt,Ht,or),console.time("drilling down")),this.splitTile(Bt.source,Nt,Ht,or,Qe,ct,Ue),Be>1&&console.timeEnd("drilling down"),this.tiles[ft]?Ke(this.tiles[ft],Pe):null):null}}function dr(Ot,Qe,ct){return 32*((1<{Ht.properties=Cr;const Sr={};for(const Tr of or)Sr[Tr]=ft[Tr].evaluate(Nt,Ht);return Sr},Be.reduce=(Cr,Sr)=>{Ht.properties=Sr;for(const Tr of or)Nt.accumulated=Cr[Tr],Cr[Tr]=Bt[Tr].evaluate(Nt,Ht)},Be}(Qe)).load((yield this._pendingData).features):(Ie=yield this._pendingData,new lr(Ie,Qe.geojsonVtOptions)),this.loaded={};const Pe={};if(Ue){const Be=Ue.finish();Be&&(Pe.resourceTiming={},Pe.resourceTiming[Qe.source]=JSON.parse(JSON.stringify(Be)))}return Pe}catch(Pe){if(delete this._pendingRequest,e.bB(Pe))return{abandoned:!0};throw Pe}var Ie})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(Qe){const ct=this.loaded;return ct&&ct[Qe.uid]?super.reloadTile(Qe):this.loadTile(Qe)}loadAndProcessGeoJSON(Qe,ct){return e._(this,void 0,void 0,function*(){let Ue=yield this.loadGeoJSON(Qe,ct);if(delete this._pendingRequest,typeof Ue!="object")throw new Error(`Input data given to '${Qe.source}' is not a valid GeoJSON object.`);if(c(Ue,!0),Qe.filter){const Ie=e.bC(Qe.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Ie.result==="error")throw new Error(Ie.value.map(Be=>`${Be.key}: ${Be.message}`).join(", "));Ue={type:"FeatureCollection",features:Ue.features.filter(Be=>Ie.value.evaluate({zoom:0},Be))}}return Ue})}loadGeoJSON(Qe,ct){return e._(this,void 0,void 0,function*(){const{promoteId:Ue}=Qe;if(Qe.request){const Ie=yield e.h(Qe.request,ct);return this._dataUpdateable=Fr(Ie.data,Ue)?ln(Ie.data,Ue):void 0,Ie.data}if(typeof Qe.data=="string")try{const Ie=JSON.parse(Qe.data);return this._dataUpdateable=Fr(Ie,Ue)?ln(Ie,Ue):void 0,Ie}catch{throw new Error(`Input data given to '${Qe.source}' is not a valid GeoJSON object.`)}if(!Qe.dataDiff)throw new Error(`Input data given to '${Qe.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${Qe.source}`);return function(Ie,Pe,Be){var at,ft,Bt,Nt;if(Pe.removeAll&&Ie.clear(),Pe.remove)for(const Ht of Pe.remove)Ie.delete(Ht);if(Pe.add)for(const Ht of Pe.add){const or=Nr(Ht,Be);or!=null&&Ie.set(or,Ht)}if(Pe.update)for(const Ht of Pe.update){let or=Ie.get(Ht.id);if(or==null)continue;const Cr=!Ht.removeAllProperties&&(((at=Ht.removeProperties)===null||at===void 0?void 0:at.length)>0||((ft=Ht.addOrUpdateProperties)===null||ft===void 0?void 0:ft.length)>0);if((Ht.newGeometry||Ht.removeAllProperties||Cr)&&(or=Object.assign({},or),Ie.set(Ht.id,or),Cr&&(or.properties=Object.assign({},or.properties))),Ht.newGeometry&&(or.geometry=Ht.newGeometry),Ht.removeAllProperties)or.properties={};else if(((Bt=Ht.removeProperties)===null||Bt===void 0?void 0:Bt.length)>0)for(const Sr of Ht.removeProperties)Object.prototype.hasOwnProperty.call(or.properties,Sr)&&delete or.properties[Sr];if(((Nt=Ht.addOrUpdateProperties)===null||Nt===void 0?void 0:Nt.length)>0)for(const{key:Sr,value:Tr}of Ht.addOrUpdateProperties)or.properties[Sr]=Tr}}(this._dataUpdateable,Qe.dataDiff,Ue),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(Qe){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(Qe){return this._geoJSONIndex.getClusterExpansionZoom(Qe.clusterId)}getClusterChildren(Qe){return this._geoJSONIndex.getChildren(Qe.clusterId)}getClusterLeaves(Qe){return this._geoJSONIndex.getLeaves(Qe.clusterId,Qe.limit,Qe.offset)}}class Xr{constructor(Qe){this.self=Qe,this.actor=new e.F(Qe),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(ct,Ue)=>{if(this.externalWorkerSourceTypes[ct])throw new Error(`Worker source with name "${ct}" already registered.`);this.externalWorkerSourceTypes[ct]=Ue},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=ct=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(ct)},this.actor.registerMessageHandler("LDT",(ct,Ue)=>this._getDEMWorkerSource(ct,Ue.source).loadTile(Ue)),this.actor.registerMessageHandler("RDT",(ct,Ue)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource(ct,Ue.source).removeTile(Ue)})),this.actor.registerMessageHandler("GCEZ",(ct,Ue)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(ct,Ue.type,Ue.source).getClusterExpansionZoom(Ue)})),this.actor.registerMessageHandler("GCC",(ct,Ue)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(ct,Ue.type,Ue.source).getClusterChildren(Ue)})),this.actor.registerMessageHandler("GCL",(ct,Ue)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(ct,Ue.type,Ue.source).getClusterLeaves(Ue)})),this.actor.registerMessageHandler("LD",(ct,Ue)=>this._getWorkerSource(ct,Ue.type,Ue.source).loadData(Ue)),this.actor.registerMessageHandler("GD",(ct,Ue)=>this._getWorkerSource(ct,Ue.type,Ue.source).getData()),this.actor.registerMessageHandler("LT",(ct,Ue)=>this._getWorkerSource(ct,Ue.type,Ue.source).loadTile(Ue)),this.actor.registerMessageHandler("RT",(ct,Ue)=>this._getWorkerSource(ct,Ue.type,Ue.source).reloadTile(Ue)),this.actor.registerMessageHandler("AT",(ct,Ue)=>this._getWorkerSource(ct,Ue.type,Ue.source).abortTile(Ue)),this.actor.registerMessageHandler("RMT",(ct,Ue)=>this._getWorkerSource(ct,Ue.type,Ue.source).removeTile(Ue)),this.actor.registerMessageHandler("RS",(ct,Ue)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[ct]||!this.workerSources[ct][Ue.type]||!this.workerSources[ct][Ue.type][Ue.source])return;const Ie=this.workerSources[ct][Ue.type][Ue.source];delete this.workerSources[ct][Ue.type][Ue.source],Ie.removeSource!==void 0&&Ie.removeSource(Ue)})),this.actor.registerMessageHandler("RM",ct=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[ct],delete this.availableImages[ct],delete this.workerSources[ct],delete this.demWorkerSources[ct]})),this.actor.registerMessageHandler("SR",(ct,Ue)=>e._(this,void 0,void 0,function*(){this.referrer=Ue})),this.actor.registerMessageHandler("SRPS",(ct,Ue)=>this._syncRTLPluginState(ct,Ue)),this.actor.registerMessageHandler("IS",(ct,Ue)=>e._(this,void 0,void 0,function*(){this.self.importScripts(Ue)})),this.actor.registerMessageHandler("SI",(ct,Ue)=>this._setImages(ct,Ue)),this.actor.registerMessageHandler("UL",(ct,Ue)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(ct).update(Ue.layers,Ue.removedIds)})),this.actor.registerMessageHandler("SL",(ct,Ue)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(ct).replace(Ue)}))}_setImages(Qe,ct){return e._(this,void 0,void 0,function*(){this.availableImages[Qe]=ct;for(const Ue in this.workerSources[Qe]){const Ie=this.workerSources[Qe][Ue];for(const Pe in Ie)Ie[Pe].availableImages=ct}})}_syncRTLPluginState(Qe,ct){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if(ct.pluginStatus!=="loading")return e.bD.setState(ct),ct;const Ue=ct.pluginURL;if(this.self.importScripts(Ue),e.bD.isParsed()){const Ie={pluginStatus:"loaded",pluginURL:Ue};return e.bD.setState(Ie),Ie}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Ue}`)})}_getAvailableImages(Qe){let ct=this.availableImages[Qe];return ct||(ct=[]),ct}_getLayerIndex(Qe){let ct=this.layerIndexes[Qe];return ct||(ct=this.layerIndexes[Qe]=new t),ct}_getWorkerSource(Qe,ct,Ue){if(this.workerSources[Qe]||(this.workerSources[Qe]={}),this.workerSources[Qe][ct]||(this.workerSources[Qe][ct]={}),!this.workerSources[Qe][ct][Ue]){const Ie={sendAsync:(Pe,Be)=>(Pe.targetMapId=Qe,this.actor.sendAsync(Pe,Be))};switch(ct){case"vector":this.workerSources[Qe][ct][Ue]=new i(Ie,this._getLayerIndex(Qe),this._getAvailableImages(Qe));break;case"geojson":this.workerSources[Qe][ct][Ue]=new zr(Ie,this._getLayerIndex(Qe),this._getAvailableImages(Qe));break;default:this.workerSources[Qe][ct][Ue]=new this.externalWorkerSourceTypes[ct](Ie,this._getLayerIndex(Qe),this._getAvailableImages(Qe))}}return this.workerSources[Qe][ct][Ue]}_getDEMWorkerSource(Qe,ct){return this.demWorkerSources[Qe]||(this.demWorkerSources[Qe]={}),this.demWorkerSources[Qe][ct]||(this.demWorkerSources[Qe][ct]=new a),this.demWorkerSources[Qe][ct]}}return e.i(self)&&(self.worker=new Xr(self)),Xr}),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:Je=>new Promise((I,ce)=>{const Ne=requestAnimationFrame(I);Je.signal.addEventListener("abort",()=>{cancelAnimationFrame(Ne),ce(t.c())})}),getImageData(Je,I=0){return this.getImageCanvasContext(Je).getImageData(-I,-I,Je.width+2*I,Je.height+2*I)},getImageCanvasContext(Je){const I=window.document.createElement("canvas"),ce=I.getContext("2d",{willReadFrequently:!0});if(!ce)throw new Error("failed to create canvas 2d context");return I.width=Je.width,I.height=Je.height,ce.drawImage(Je,0,0,Je.width,Je.height),ce},resolveURL:Je=>(o||(o=document.createElement("a")),o.href=Je,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(I){if(!a.docStyle)return I[0];for(let ce=0;ce{window.removeEventListener("click",a.suppressClickInternal,!0)},0)}static getScale(I){const ce=I.getBoundingClientRect();return{x:ce.width/I.offsetWidth||1,y:ce.height/I.offsetHeight||1,boundingClientRect:ce}}static getPoint(I,ce,Ne){const je=ce.boundingClientRect;return new t.P((Ne.clientX-je.left)/ce.x-I.clientLeft,(Ne.clientY-je.top)/ce.y-I.clientTop)}static mousePos(I,ce){const Ne=a.getScale(I);return a.getPoint(I,Ne,ce)}static touchPos(I,ce){const Ne=[],je=a.getScale(I);for(let Ze=0;Ze{f&&T(f),f=null,p=!0},c.onerror=()=>{v=!0,f=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(Je){let I,ce,Ne,je;Je.resetRequestQueue=()=>{I=[],ce=0,Ne=0,je={}},Je.addThrottleControl=tr=>{const xr=Ne++;return je[xr]=tr,xr},Je.removeThrottleControl=tr=>{delete je[tr],kt()},Je.getImage=(tr,xr,Or=!0)=>new Promise((Ur,hn)=>{s.supported&&(tr.headers||(tr.headers={}),tr.headers.accept="image/webp,*/*"),t.e(tr,{type:"image"}),I.push({abortController:xr,requestParameters:tr,supportImageRefresh:Or,state:"queued",onError:Cn=>{hn(Cn)},onSuccess:Cn=>{Ur(Cn)}}),kt()});const Ze=tr=>t._(this,void 0,void 0,function*(){tr.state="running";const{requestParameters:xr,supportImageRefresh:Or,onError:Ur,onSuccess:hn,abortController:Cn}=tr,ot=Or===!1&&!t.i(self)&&!t.g(xr.url)&&(!xr.headers||Object.keys(xr.headers).reduce((Pt,qt)=>Pt&&qt==="accept",!0));ce++;const dt=ot?Ft(xr,Cn):t.m(xr,Cn);try{const Pt=yield dt;delete tr.abortController,tr.state="completed",Pt.data instanceof HTMLImageElement||t.b(Pt.data)?hn(Pt):Pt.data&&hn({data:yield(Tt=Pt.data,typeof createImageBitmap=="function"?t.d(Tt):t.f(Tt)),cacheControl:Pt.cacheControl,expires:Pt.expires})}catch(Pt){delete tr.abortController,Ur(Pt)}finally{ce--,kt()}var Tt}),kt=()=>{const tr=(()=>{for(const xr of Object.keys(je))if(je[xr]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let xr=ce;xr0;xr++){const Or=I.shift();Or.abortController.signal.aborted?xr--:Ze(Or)}},Ft=(tr,xr)=>new Promise((Or,Ur)=>{const hn=new Image,Cn=tr.url,ot=tr.credentials;ot&&ot==="include"?hn.crossOrigin="use-credentials":(ot&&ot==="same-origin"||!t.s(Cn))&&(hn.crossOrigin="anonymous"),xr.signal.addEventListener("abort",()=>{hn.src="",Ur(t.c())}),hn.fetchPriority="high",hn.onload=()=>{hn.onerror=hn.onload=null,Or({data:hn})},hn.onerror=()=>{hn.onerror=hn.onload=null,xr.signal.aborted||Ur(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."))},hn.src=Cn})}(l||(l={})),l.resetRequestQueue();class g{constructor(I){this._transformRequestFn=I}transformRequest(I,ce){return this._transformRequestFn&&this._transformRequestFn(I,ce)||{url:I}}setTransformRequest(I){this._transformRequestFn=I}}function b(Je){var I=new t.A(3);return I[0]=Je[0],I[1]=Je[1],I[2]=Je[2],I}var A,E=function(Je,I,ce){return Je[0]=I[0]-ce[0],Je[1]=I[1]-ce[1],Je[2]=I[2]-ce[2],Je};A=new t.A(3),t.A!=Float32Array&&(A[0]=0,A[1]=0,A[2]=0);var _=function(Je){var I=Je[0],ce=Je[1];return I*I+ce*ce};function w(Je){const I=[];if(typeof Je=="string")I.push({id:"default",url:Je});else if(Je&&Je.length>0){const ce=[];for(const{id:Ne,url:je}of Je){const Ze=`${Ne}${je}`;ce.indexOf(Ze)===-1&&(ce.push(Ze),I.push({id:Ne,url:je}))}}return I}function m(Je,I,ce){const Ne=Je.split("?");return Ne[0]+=`${I}${ce}`,Ne.join("?")}(function(){var Je=new t.A(2);t.A!=Float32Array&&(Je[0]=0,Je[1]=0)})();class u{constructor(I,ce,Ne,je){this.context=I,this.format=Ne,this.texture=I.gl.createTexture(),this.update(ce,je)}update(I,ce,Ne){const{width:je,height:Ze}=I,kt=!(this.size&&this.size[0]===je&&this.size[1]===Ze||Ne),{context:Ft}=this,{gl:tr}=Ft;if(this.useMipmap=!!(ce&&ce.useMipmap),tr.bindTexture(tr.TEXTURE_2D,this.texture),Ft.pixelStoreUnpackFlipY.set(!1),Ft.pixelStoreUnpack.set(1),Ft.pixelStoreUnpackPremultiplyAlpha.set(this.format===tr.RGBA&&(!ce||ce.premultiply!==!1)),kt)this.size=[je,Ze],I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||t.b(I)?tr.texImage2D(tr.TEXTURE_2D,0,this.format,this.format,tr.UNSIGNED_BYTE,I):tr.texImage2D(tr.TEXTURE_2D,0,this.format,je,Ze,0,this.format,tr.UNSIGNED_BYTE,I.data);else{const{x:xr,y:Or}=Ne||{x:0,y:0};I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||t.b(I)?tr.texSubImage2D(tr.TEXTURE_2D,0,xr,Or,tr.RGBA,tr.UNSIGNED_BYTE,I):tr.texSubImage2D(tr.TEXTURE_2D,0,xr,Or,je,Ze,tr.RGBA,tr.UNSIGNED_BYTE,I.data)}this.useMipmap&&this.isSizePowerOfTwo()&&tr.generateMipmap(tr.TEXTURE_2D)}bind(I,ce,Ne){const{context:je}=this,{gl:Ze}=je;Ze.bindTexture(Ze.TEXTURE_2D,this.texture),Ne!==Ze.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Ne=Ze.LINEAR),I!==this.filter&&(Ze.texParameteri(Ze.TEXTURE_2D,Ze.TEXTURE_MAG_FILTER,I),Ze.texParameteri(Ze.TEXTURE_2D,Ze.TEXTURE_MIN_FILTER,Ne||I),this.filter=I),ce!==this.wrap&&(Ze.texParameteri(Ze.TEXTURE_2D,Ze.TEXTURE_WRAP_S,ce),Ze.texParameteri(Ze.TEXTURE_2D,Ze.TEXTURE_WRAP_T,ce),this.wrap=ce)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:I}=this.context;I.deleteTexture(this.texture),this.texture=null}}function d(Je){const{userImage:I}=Je;return!!(I&&I.render&&I.render())&&(Je.data.replace(new Uint8Array(I.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(I){if(this.loaded!==I&&(this.loaded=I,I)){for(const{ids:ce,promiseResolve:Ne}of this.requestors)Ne(this._getImagesForIds(ce));this.requestors=[]}}getImage(I){const ce=this.images[I];if(ce&&!ce.data&&ce.spriteData){const Ne=ce.spriteData;ce.data=new t.R({width:Ne.width,height:Ne.height},Ne.context.getImageData(Ne.x,Ne.y,Ne.width,Ne.height).data),ce.spriteData=null}return ce}addImage(I,ce){if(this.images[I])throw new Error(`Image id ${I} already exist, use updateImage instead`);this._validate(I,ce)&&(this.images[I]=ce)}_validate(I,ce){let Ne=!0;const je=ce.data||ce.spriteData;return this._validateStretch(ce.stretchX,je&&je.width)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "stretchX" value`))),Ne=!1),this._validateStretch(ce.stretchY,je&&je.height)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "stretchY" value`))),Ne=!1),this._validateContent(ce.content,ce)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "content" value`))),Ne=!1),Ne}_validateStretch(I,ce){if(!I)return!0;let Ne=0;for(const je of I){if(je[0]{let je=!0;if(!this.isLoaded())for(const Ze of I)this.images[Ze]||(je=!1);this.isLoaded()||je?ce(this._getImagesForIds(I)):this.requestors.push({ids:I,promiseResolve:ce})})}_getImagesForIds(I){const ce={};for(const Ne of I){let je=this.getImage(Ne);je||(this.fire(new t.k("styleimagemissing",{id:Ne})),je=this.getImage(Ne)),je?ce[Ne]={data:je.data.clone(),pixelRatio:je.pixelRatio,sdf:je.sdf,version:je.version,stretchX:je.stretchX,stretchY:je.stretchY,content:je.content,textFitWidth:je.textFitWidth,textFitHeight:je.textFitHeight,hasRenderCallback:!!(je.userImage&&je.userImage.render)}:t.w(`Image "${Ne}" 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 ce}getPixelSize(){const{width:I,height:ce}=this.atlasImage;return{width:I,height:ce}}getPattern(I){const ce=this.patterns[I],Ne=this.getImage(I);if(!Ne)return null;if(ce&&ce.position.version===Ne.version)return ce.position;if(ce)ce.position.version=Ne.version;else{const je={w:Ne.data.width+2,h:Ne.data.height+2,x:0,y:0},Ze=new t.I(je,Ne);this.patterns[I]={bin:je,position:Ze}}return this._updatePatternAtlas(),this.patterns[I].position}bind(I){const ce=I.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u(I,this.atlasImage,ce.RGBA),this.atlasTexture.bind(ce.LINEAR,ce.CLAMP_TO_EDGE)}_updatePatternAtlas(){const I=[];for(const Ze in this.patterns)I.push(this.patterns[Ze].bin);const{w:ce,h:Ne}=t.p(I),je=this.atlasImage;je.resize({width:ce||1,height:Ne||1});for(const Ze in this.patterns){const{bin:kt}=this.patterns[Ze],Ft=kt.x+1,tr=kt.y+1,xr=this.getImage(Ze).data,Or=xr.width,Ur=xr.height;t.R.copy(xr,je,{x:0,y:0},{x:Ft,y:tr},{width:Or,height:Ur}),t.R.copy(xr,je,{x:0,y:Ur-1},{x:Ft,y:tr-1},{width:Or,height:1}),t.R.copy(xr,je,{x:0,y:0},{x:Ft,y:tr+Ur},{width:Or,height:1}),t.R.copy(xr,je,{x:Or-1,y:0},{x:Ft-1,y:tr},{width:1,height:Ur}),t.R.copy(xr,je,{x:0,y:0},{x:Ft+Or,y:tr},{width:1,height:Ur})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(I){for(const ce of I){if(this.callbackDispatchedThisFrame[ce])continue;this.callbackDispatchedThisFrame[ce]=!0;const Ne=this.getImage(ce);Ne||t.w(`Image with ID: "${ce}" was not found`),d(Ne)&&this.updateImage(ce,Ne)}}}const R=1e20;function L(Je,I,ce,Ne,je,Ze,kt,Ft,tr){for(let xr=I;xr-1);tr++,Ze[tr]=Ft,kt[tr]=xr,kt[tr+1]=R}for(let Ft=0,tr=0;Ft65535)throw new Error("glyphs > 65535 not supported");if(Ne.ranges[Ze])return{stack:I,id:ce,glyph:je};if(!this.url)throw new Error("glyphsUrl is not set");if(!Ne.requests[Ze]){const Ft=N.loadGlyphRange(I,Ze,this.url,this.requestManager);Ne.requests[Ze]=Ft}const kt=yield Ne.requests[Ze];for(const Ft in kt)this._doesCharSupportLocalGlyph(+Ft)||(Ne.glyphs[+Ft]=kt[+Ft]);return Ne.ranges[Ze]=!0,{stack:I,id:ce,glyph:kt[ce]||null}})}_doesCharSupportLocalGlyph(I){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(I))}_tinySDF(I,ce,Ne){const je=this.localIdeographFontFamily;if(!je||!this._doesCharSupportLocalGlyph(Ne))return;let Ze=I.tinySDF;if(!Ze){let Ft="400";/bold/i.test(ce)?Ft="900":/medium/i.test(ce)?Ft="500":/light/i.test(ce)&&(Ft="200"),Ze=I.tinySDF=new N.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:je,fontWeight:Ft})}const kt=Ze.draw(String.fromCharCode(Ne));return{id:Ne,bitmap:new t.o({width:kt.width||60,height:kt.height||60},kt.data),metrics:{width:kt.glyphWidth/2||24,height:kt.glyphHeight/2||24,left:kt.glyphLeft/2+.5||0,top:kt.glyphTop/2-27.5||-8,advance:kt.glyphAdvance/2||24,isDoubleResolution:!0}}}}N.loadGlyphRange=function(Je,I,ce,Ne){return t._(this,void 0,void 0,function*(){const je=256*I,Ze=je+255,kt=Ne.transformRequest(ce.replace("{fontstack}",Je).replace("{range}",`${je}-${Ze}`),"Glyphs"),Ft=yield t.l(kt,new AbortController);if(!Ft||!Ft.data)throw new Error(`Could not load glyph range. range: ${I}, ${je}-${Ze}`);const tr={};for(const xr of t.n(Ft.data))tr[xr.id]=xr;return tr})},N.TinySDF=class{constructor({fontSize:Je=24,buffer:I=3,radius:ce=8,cutoff:Ne=.25,fontFamily:je="sans-serif",fontWeight:Ze="normal",fontStyle:kt="normal"}={}){this.buffer=I,this.cutoff=Ne,this.radius=ce;const Ft=this.size=Je+4*I,tr=this._createCanvas(Ft),xr=this.ctx=tr.getContext("2d",{willReadFrequently:!0});xr.font=`${kt} ${Ze} ${Je}px ${je}`,xr.textBaseline="alphabetic",xr.textAlign="left",xr.fillStyle="black",this.gridOuter=new Float64Array(Ft*Ft),this.gridInner=new Float64Array(Ft*Ft),this.f=new Float64Array(Ft),this.z=new Float64Array(Ft+1),this.v=new Uint16Array(Ft)}_createCanvas(Je){const I=document.createElement("canvas");return I.width=I.height=Je,I}draw(Je){const{width:I,actualBoundingBoxAscent:ce,actualBoundingBoxDescent:Ne,actualBoundingBoxLeft:je,actualBoundingBoxRight:Ze}=this.ctx.measureText(Je),kt=Math.ceil(ce),Ft=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Ze-je))),tr=Math.min(this.size-this.buffer,kt+Math.ceil(Ne)),xr=Ft+2*this.buffer,Or=tr+2*this.buffer,Ur=Math.max(xr*Or,0),hn=new Uint8ClampedArray(Ur),Cn={data:hn,width:xr,height:Or,glyphWidth:Ft,glyphHeight:tr,glyphTop:kt,glyphLeft:0,glyphAdvance:I};if(Ft===0||tr===0)return Cn;const{ctx:ot,buffer:dt,gridInner:Tt,gridOuter:Pt}=this;ot.clearRect(dt,dt,Ft,tr),ot.fillText(Je,dt,dt+kt);const qt=ot.getImageData(dt,dt,Ft,tr);Pt.fill(R,0,Ur),Tt.fill(0,0,Ur);for(let zt=0;zt0?Vr*Vr:0,Tt[Rr]=Vr<0?Vr*Vr:0}}L(Pt,0,0,xr,Or,xr,this.f,this.v,this.z),L(Tt,dt,dt,Ft,tr,xr,this.f,this.v,this.z);for(let zt=0;zt1&&(tr=I[++Ft]);const Or=Math.abs(xr-tr.left),Ur=Math.abs(xr-tr.right),hn=Math.min(Or,Ur);let Cn;const ot=Ze/Ne*(je+1);if(tr.isDash){const dt=je-Math.abs(ot);Cn=Math.sqrt(hn*hn+dt*dt)}else Cn=je-Math.sqrt(hn*hn+ot*ot);this.data[kt+xr]=Math.max(0,Math.min(255,Cn+128))}}}addRegularDash(I){for(let Ft=I.length-1;Ft>=0;--Ft){const tr=I[Ft],xr=I[Ft+1];tr.zeroLength?I.splice(Ft,1):xr&&xr.isDash===tr.isDash&&(xr.left=tr.left,I.splice(Ft,1))}const ce=I[0],Ne=I[I.length-1];ce.isDash===Ne.isDash&&(ce.left=Ne.left-this.width,Ne.right=ce.right+this.width);const je=this.width*this.nextRow;let Ze=0,kt=I[Ze];for(let Ft=0;Ft1&&(kt=I[++Ze]);const tr=Math.abs(Ft-kt.left),xr=Math.abs(Ft-kt.right),Or=Math.min(tr,xr);this.data[je+Ft]=Math.max(0,Math.min(255,(kt.isDash?Or:-Or)+128))}}addDash(I,ce){const Ne=ce?7:0,je=2*Ne+1;if(this.nextRow+je>this.height)return t.w("LineAtlas out of space"),null;let Ze=0;for(let Ft=0;Ft{ce.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[oe]}numActive(){return Object.keys(this.active).length}}const pe=Math.floor(i.hardwareConcurrency/2);let ge,W;function ae(){return ge||(ge=new ye),ge}ye.workerCount=t.C(globalThis)?Math.max(Math.min(pe,3),1):1;class se{constructor(I,ce){this.workerPool=I,this.actors=[],this.currentActor=0,this.id=ce;const Ne=this.workerPool.acquire(ce);for(let je=0;je{ce.remove()}),this.actors=[],I&&this.workerPool.release(this.id)}registerMessageHandler(I,ce){for(const Ne of this.actors)Ne.registerMessageHandler(I,ce)}}function Q(){return W||(W=new se(ae(),t.G),W.registerMessageHandler("GR",(Je,I,ce)=>t.m(I,ce))),W}function me(Je,I){const ce=t.H();return t.J(ce,ce,[1,1,0]),t.K(ce,ce,[.5*Je.width,.5*Je.height,1]),t.L(ce,ce,Je.calculatePosMatrix(I.toUnwrapped()))}function ie(Je,I,ce,Ne,je,Ze){const kt=function(Ur,hn,Cn){if(Ur)for(const ot of Ur){const dt=hn[ot];if(dt&&dt.source===Cn&&dt.type==="fill-extrusion")return!0}else for(const ot in hn){const dt=hn[ot];if(dt.source===Cn&&dt.type==="fill-extrusion")return!0}return!1}(je&&je.layers,I,Je.id),Ft=Ze.maxPitchScaleFactor(),tr=Je.tilesIn(Ne,Ft,kt);tr.sort(Y);const xr=[];for(const Ur of tr)xr.push({wrappedTileID:Ur.tileID.wrapped().key,queryResults:Ur.tile.queryRenderedFeatures(I,ce,Je._state,Ur.queryGeometry,Ur.cameraQueryGeometry,Ur.scale,je,Ze,Ft,me(Je.transform,Ur.tileID))});const Or=function(Ur){const hn={},Cn={};for(const ot of Ur){const dt=ot.queryResults,Tt=ot.wrappedTileID,Pt=Cn[Tt]=Cn[Tt]||{};for(const qt in dt){const zt=dt[qt],Xt=Pt[qt]=Pt[qt]||{},Mr=hn[qt]=hn[qt]||[];for(const Rr of zt)Xt[Rr.featureIndex]||(Xt[Rr.featureIndex]=!0,Mr.push(Rr))}}return hn}(xr);for(const Ur in Or)Or[Ur].forEach(hn=>{const Cn=hn.feature,ot=Je.getFeatureState(Cn.layer["source-layer"],Cn.id);Cn.source=Cn.layer.source,Cn.layer["source-layer"]&&(Cn.sourceLayer=Cn.layer["source-layer"]),Cn.state=ot});return Or}function Y(Je,I){const ce=Je.tileID,Ne=I.tileID;return ce.overscaledZ-Ne.overscaledZ||ce.canonical.y-Ne.canonical.y||ce.wrap-Ne.wrap||ce.canonical.x-Ne.canonical.x}function le(Je,I,ce){return t._(this,void 0,void 0,function*(){let Ne=Je;if(Je.url?Ne=(yield t.h(I.transformRequest(Je.url,"Source"),ce)).data:yield i.frameAsync(ce),!Ne)return null;const je=t.M(t.e(Ne,Je),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Ne&&Ne.vector_layers&&(je.vectorLayerIds=Ne.vector_layers.map(Ze=>Ze.id)),je})}class ue{constructor(I,ce){I&&(ce?this.setSouthWest(I).setNorthEast(ce):Array.isArray(I)&&(I.length===4?this.setSouthWest([I[0],I[1]]).setNorthEast([I[2],I[3]]):this.setSouthWest(I[0]).setNorthEast(I[1])))}setNorthEast(I){return this._ne=I instanceof t.N?new t.N(I.lng,I.lat):t.N.convert(I),this}setSouthWest(I){return this._sw=I instanceof t.N?new t.N(I.lng,I.lat):t.N.convert(I),this}extend(I){const ce=this._sw,Ne=this._ne;let je,Ze;if(I instanceof t.N)je=I,Ze=I;else{if(!(I instanceof ue))return Array.isArray(I)?I.length===4||I.every(Array.isArray)?this.extend(ue.convert(I)):this.extend(t.N.convert(I)):I&&("lng"in I||"lon"in I)&&"lat"in I?this.extend(t.N.convert(I)):this;if(je=I._sw,Ze=I._ne,!je||!Ze)return this}return ce||Ne?(ce.lng=Math.min(je.lng,ce.lng),ce.lat=Math.min(je.lat,ce.lat),Ne.lng=Math.max(Ze.lng,Ne.lng),Ne.lat=Math.max(Ze.lat,Ne.lat)):(this._sw=new t.N(je.lng,je.lat),this._ne=new t.N(Ze.lng,Ze.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(I){const{lng:ce,lat:Ne}=t.N.convert(I);let je=this._sw.lng<=ce&&ce<=this._ne.lng;return this._sw.lng>this._ne.lng&&(je=this._sw.lng>=ce&&ce>=this._ne.lng),this._sw.lat<=Ne&&Ne<=this._ne.lat&&je}static convert(I){return I instanceof ue?I:I&&new ue(I)}static fromLngLat(I,ce=0){const Ne=360*ce/40075017,je=Ne/Math.cos(Math.PI/180*I.lat);return new ue(new t.N(I.lng-je,I.lat-Ne),new t.N(I.lng+je,I.lat+Ne))}adjustAntiMeridian(){const I=new t.N(this._sw.lng,this._sw.lat),ce=new t.N(this._ne.lng,this._ne.lat);return new ue(I,I.lng>ce.lng?new t.N(ce.lng+360,ce.lat):ce)}}class Te{constructor(I,ce,Ne){this.bounds=ue.convert(this.validateBounds(I)),this.minzoom=ce||0,this.maxzoom=Ne||24}validateBounds(I){return Array.isArray(I)&&I.length===4?[Math.max(-180,I[0]),Math.max(-90,I[1]),Math.min(180,I[2]),Math.min(90,I[3])]:[-180,-90,180,90]}contains(I){const ce=Math.pow(2,I.z),Ne=Math.floor(t.O(this.bounds.getWest())*ce),je=Math.floor(t.Q(this.bounds.getNorth())*ce),Ze=Math.ceil(t.O(this.bounds.getEast())*ce),kt=Math.ceil(t.Q(this.bounds.getSouth())*ce);return I.x>=Ne&&I.x=je&&I.y{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(I){return t._(this,void 0,void 0,function*(){const ce=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Ne={request:this.map._requestManager.transformRequest(ce,"Tile"),uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,tileSize:this.tileSize*I.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Ne.request.collectResourceTiming=this._collectResourceTiming;let je="RT";if(I.actor&&I.state!=="expired"){if(I.state==="loading")return new Promise((Ze,kt)=>{I.reloadPromise={resolve:Ze,reject:kt}})}else I.actor=this.dispatcher.getActor(),je="LT";I.abortController=new AbortController;try{const Ze=yield I.actor.sendAsync({type:je,data:Ne},I.abortController);if(delete I.abortController,I.aborted)return;this._afterTileLoadWorkerResponse(I,Ze)}catch(Ze){if(delete I.abortController,I.aborted)return;if(Ze&&Ze.status!==404)throw Ze;this._afterTileLoadWorkerResponse(I,null)}})}_afterTileLoadWorkerResponse(I,ce){if(ce&&ce.resourceTiming&&(I.resourceTiming=ce.resourceTiming),ce&&this.map._refreshExpiredTiles&&I.setExpiryData(ce),I.loadVectorData(ce,this.map.painter),I.reloadPromise){const Ne=I.reloadPromise;I.reloadPromise=null,this.loadTile(I).then(Ne.resolve).catch(Ne.reject)}}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.actor&&(yield I.actor.sendAsync({type:"AT",data:{uid:I.uid,type:this.type,source:this.id}}))})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.unloadVectorData(),I.actor&&(yield I.actor.sendAsync({type:"RMT",data:{uid:I.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Ve extends t.E{constructor(I,ce,Ne,je){super(),this.id=I,this.dispatcher=Ne,this.setEventedParent(je),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"},ce),t.e(this,t.M(ce,["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 I=yield le(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,I&&(t.e(this,I),I.bounds&&(this.tileBounds=new Te(I.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(I){this._tileJSONRequest=null,this.fire(new t.j(I))}})}loaded(){return this._loaded}onAdd(I){this.map=I,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(I){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),I(),this.load()}setTiles(I){return this.setSourceProperty(()=>{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}serialize(){return t.e({},this._options)}hasTile(I){return!this.tileBounds||this.tileBounds.contains(I.canonical)}loadTile(I){return t._(this,void 0,void 0,function*(){const ce=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);I.abortController=new AbortController;try{const Ne=yield l.getImage(this.map._requestManager.transformRequest(ce,"Tile"),I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(Ne&&Ne.data){this.map._refreshExpiredTiles&&Ne.cacheControl&&Ne.expires&&I.setExpiryData({cacheControl:Ne.cacheControl,expires:Ne.expires});const je=this.map.painter.context,Ze=je.gl,kt=Ne.data;I.texture=this.map.painter.getTileTexture(kt.width),I.texture?I.texture.update(kt,{useMipmap:!0}):(I.texture=new u(je,kt,Ze.RGBA,{useMipmap:!0}),I.texture.bind(Ze.LINEAR,Ze.CLAMP_TO_EDGE,Ze.LINEAR_MIPMAP_NEAREST)),I.state="loaded"}}catch(Ne){if(delete I.abortController,I.aborted)I.state="unloaded";else if(Ne)throw I.state="errored",Ne}})}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController)})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.texture&&this.map.painter.saveTileTexture(I.texture)})}hasTransition(){return!1}}class Xe extends Ve{constructor(I,ce,Ne,je){super(I,ce,Ne,je),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},ce),this.encoding=ce.encoding||"mapbox",this.redFactor=ce.redFactor,this.greenFactor=ce.greenFactor,this.blueFactor=ce.blueFactor,this.baseShift=ce.baseShift}loadTile(I){return t._(this,void 0,void 0,function*(){const ce=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Ne=this.map._requestManager.transformRequest(ce,"Tile");I.neighboringTiles=this._getNeighboringTiles(I.tileID),I.abortController=new AbortController;try{const je=yield l.getImage(Ne,I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(je&&je.data){const Ze=je.data;this.map._refreshExpiredTiles&&je.cacheControl&&je.expires&&I.setExpiryData({cacheControl:je.cacheControl,expires:je.expires});const kt=t.b(Ze)&&t.U()?Ze:yield this.readImageNow(Ze),Ft={type:this.type,uid:I.uid,source:this.id,rawImageData:kt,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!I.actor||I.state==="expired"){I.actor=this.dispatcher.getActor();const tr=yield I.actor.sendAsync({type:"LDT",data:Ft});I.dem=tr,I.needsHillshadePrepare=!0,I.needsTerrainPrepare=!0,I.state="loaded"}}}catch(je){if(delete I.abortController,I.aborted)I.state="unloaded";else if(je)throw I.state="errored",je}})}readImageNow(I){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&t.V()){const ce=I.width+2,Ne=I.height+2;try{return new t.R({width:ce,height:Ne},yield t.W(I,-1,-1,ce,Ne))}catch{}}return i.getImageData(I,1)})}_getNeighboringTiles(I){const ce=I.canonical,Ne=Math.pow(2,ce.z),je=(ce.x-1+Ne)%Ne,Ze=ce.x===0?I.wrap-1:I.wrap,kt=(ce.x+1+Ne)%Ne,Ft=ce.x+1===Ne?I.wrap+1:I.wrap,tr={};return tr[new t.S(I.overscaledZ,Ze,ce.z,je,ce.y).key]={backfilled:!1},tr[new t.S(I.overscaledZ,Ft,ce.z,kt,ce.y).key]={backfilled:!1},ce.y>0&&(tr[new t.S(I.overscaledZ,Ze,ce.z,je,ce.y-1).key]={backfilled:!1},tr[new t.S(I.overscaledZ,I.wrap,ce.z,ce.x,ce.y-1).key]={backfilled:!1},tr[new t.S(I.overscaledZ,Ft,ce.z,kt,ce.y-1).key]={backfilled:!1}),ce.y+10&&t.e(Ze,{resourceTiming:je}),this.fire(new t.k("data",Object.assign(Object.assign({},Ze),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},Ze),{sourceDataType:"content"})))}catch(Ne){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(Ne))}})}loaded(){return this._pendingLoads===0}loadTile(I){return t._(this,void 0,void 0,function*(){const ce=I.actor?"RT":"LT";I.actor=this.actor;const Ne={type:this.type,uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};I.abortController=new AbortController;const je=yield this.actor.sendAsync({type:ce,data:Ne},I.abortController);delete I.abortController,I.unloadVectorData(),I.aborted||I.loadVectorData(je,this.map.painter,ce==="RT")})}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.aborted=!0})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:I.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 it=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class yt extends t.E{constructor(I,ce,Ne,je){super(),this.id=I,this.dispatcher=Ne,this.coordinates=ce.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(je),this.options=ce}load(I){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 ce=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,ce&&ce.data&&(this.image=ce.data,I&&(this.coordinates=I),this._finishLoading())}catch(ce){this._request=null,this._loaded=!0,this.fire(new t.j(ce))}})}loaded(){return this._loaded}updateImage(I){return I.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=I.url,this.load(I.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(I){this.map=I,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(I){this.coordinates=I;const ce=I.map(t.Z.fromLngLat);this.tileID=function(je){let Ze=1/0,kt=1/0,Ft=-1/0,tr=-1/0;for(const hn of je)Ze=Math.min(Ze,hn.x),kt=Math.min(kt,hn.y),Ft=Math.max(Ft,hn.x),tr=Math.max(tr,hn.y);const xr=Math.max(Ft-Ze,tr-kt),Or=Math.max(0,Math.floor(-Math.log(xr)/Math.LN2)),Ur=Math.pow(2,Or);return new t.a1(Or,Math.floor((Ze+Ft)/2*Ur),Math.floor((kt+tr)/2*Ur))}(ce),this.minzoom=this.maxzoom=this.tileID.z;const Ne=ce.map(je=>this.tileID.getTilePoint(je)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(Ne[0].x,Ne[0].y,0,0),this._boundsArray.emplaceBack(Ne[1].x,Ne[1].y,t.X,0),this._boundsArray.emplaceBack(Ne[3].x,Ne[3].y,0,t.X),this._boundsArray.emplaceBack(Ne[2].x,Ne[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 I=this.map.painter.context,ce=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,it.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u(I,this.image,ce.RGBA),this.texture.bind(ce.LINEAR,ce.CLAMP_TO_EDGE));let Ne=!1;for(const je in this.tiles){const Ze=this.tiles[je];Ze.state!=="loaded"&&(Ze.state="loaded",Ze.texture=this.texture,Ne=!0)}Ne&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(I){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(I.tileID.canonical)?(this.tiles[String(I.tileID.wrap)]=I,I.buckets={}):I.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class bt extends yt{constructor(I,ce,Ne,je){super(I,ce,Ne,je),this.roundZoom=!0,this.type="video",this.options=ce}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;const I=this.options;this.urls=[];for(const ce of I.urls)this.urls.push(this.map._requestManager.transformRequest(ce,"Source").url);try{const ce=yield t.a3(this.urls);if(this._loaded=!0,!ce)return;this.video=ce,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(ce){this.fire(new t.j(ce))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(I){if(this.video){const ce=this.video.seekable;Ice.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${ce.start(0)} and ${ce.end(0)}-second mark.`))):this.video.currentTime=I}}getVideo(){return this.video}onAdd(I){this.map||(this.map=I,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 I=this.map.painter.context,ce=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,it.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ce.LINEAR,ce.CLAMP_TO_EDGE),ce.texSubImage2D(ce.TEXTURE_2D,0,0,0,ce.RGBA,ce.UNSIGNED_BYTE,this.video)):(this.texture=new u(I,this.video,ce.RGBA),this.texture.bind(ce.LINEAR,ce.CLAMP_TO_EDGE));let Ne=!1;for(const je in this.tiles){const Ze=this.tiles[je];Ze.state!=="loaded"&&(Ze.state="loaded",Ze.texture=this.texture,Ne=!0)}Ne&&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 mt extends yt{constructor(I,ce,Ne,je){super(I,ce,Ne,je),ce.coordinates?Array.isArray(ce.coordinates)&&ce.coordinates.length===4&&!ce.coordinates.some(Ze=>!Array.isArray(Ze)||Ze.length!==2||Ze.some(kt=>typeof kt!="number"))||this.fire(new t.j(new t.a2(`sources.${I}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${I}`,null,'missing required property "coordinates"'))),ce.animate&&typeof ce.animate!="boolean"&&this.fire(new t.j(new t.a2(`sources.${I}`,null,'optional "animate" property must be a boolean value'))),ce.canvas?typeof ce.canvas=="string"||ce.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${I}`,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.${I}`,null,'missing required property "canvas"'))),this.options=ce,this.animate=ce.animate===void 0||ce.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(I){this.map=I,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let I=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,I=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,I=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const ce=this.map.painter.context,Ne=ce.gl;this.boundsBuffer||(this.boundsBuffer=ce.createVertexBuffer(this._boundsArray,it.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(I||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u(ce,this.canvas,Ne.RGBA,{premultiply:!0});let je=!1;for(const Ze in this.tiles){const kt=this.tiles[Ze];kt.state!=="loaded"&&(kt.state="loaded",kt.texture=this.texture,je=!0)}je&&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 I of[this.canvas.width,this.canvas.height])if(isNaN(I)||I<=0)return!0;return!1}}const ht={},qe=Je=>{switch(Je){case"geojson":return We;case"image":return yt;case"raster":return Ve;case"raster-dem":return Xe;case"vector":return Fe;case"video":return bt;case"canvas":return mt}return ht[Je]},ze="RTLPluginLoaded";class Ae extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Q()}_syncState(I){return this.status=I,this.dispatcher.broadcast("SRPS",{pluginStatus:I,pluginURL:this.url}).catch(ce=>{throw this.status="error",ce})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(I){return t._(this,arguments,void 0,function*(ce,Ne=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=i.resolveURL(ce),!this.url)throw new Error(`requested url ${ce} is invalid`);if(this.status==="unavailable"){if(!Ne)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(ze))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Ke=null;function _t(){return Ke||(Ke=new Ae),Ke}class wt{constructor(I,ce){this.timeAdded=0,this.fadeEndTime=0,this.tileID=I,this.uid=t.a4(),this.uses=0,this.tileSize=ce,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(I){const ce=I+this.timeAdded;ceZe.getLayer(xr)).filter(Boolean);if(tr.length!==0){Ft.layers=tr,Ft.stateDependentLayerIds&&(Ft.stateDependentLayers=Ft.stateDependentLayerIds.map(xr=>tr.filter(Or=>Or.id===xr)[0]));for(const xr of tr)kt[xr.id]=Ft}}return kt}(I.buckets,ce.style),this.hasSymbolBuckets=!1;for(const je in this.buckets){const Ze=this.buckets[je];if(Ze instanceof t.a6){if(this.hasSymbolBuckets=!0,!Ne)break;Ze.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const je in this.buckets){const Ze=this.buckets[je];if(Ze instanceof t.a6&&Ze.hasRTLText){this.hasRTLText=!0,_t().lazyLoad();break}}this.queryPadding=0;for(const je in this.buckets){const Ze=this.buckets[je];this.queryPadding=Math.max(this.queryPadding,ce.style.getLayer(je).queryRadius(Ze))}I.imageAtlas&&(this.imageAtlas=I.imageAtlas),I.glyphAtlasImage&&(this.glyphAtlasImage=I.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(const I in this.buckets)this.buckets[I].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(I){return this.buckets[I.id]}upload(I){for(const Ne in this.buckets){const je=this.buckets[Ne];je.uploadPending()&&je.upload(I)}const ce=I.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u(I,this.imageAtlas.image,ce.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u(I,this.glyphAtlasImage,ce.ALPHA),this.glyphAtlasImage=null)}prepare(I){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(I,this.imageAtlasTexture)}queryRenderedFeatures(I,ce,Ne,je,Ze,kt,Ft,tr,xr,Or){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:je,cameraQueryGeometry:Ze,scale:kt,tileSize:this.tileSize,pixelPosMatrix:Or,transform:tr,params:Ft,queryPadding:this.queryPadding*xr},I,ce,Ne):{}}querySourceFeatures(I,ce){const Ne=this.latestFeatureIndex;if(!Ne||!Ne.rawTileData)return;const je=Ne.loadVTLayers(),Ze=ce&&ce.sourceLayer?ce.sourceLayer:"",kt=je._geojsonTileLayer||je[Ze];if(!kt)return;const Ft=t.a7(ce&&ce.filter),{z:tr,x:xr,y:Or}=this.tileID.canonical,Ur={z:tr,x:xr,y:Or};for(let hn=0;hnNe)je=!1;else if(ce)if(this.expirationTime{this.remove(I,Ze)},Ne)),this.data[je].push(Ze),this.order.push(je),this.order.length>this.max){const kt=this._getAndRemoveByKey(this.order[0]);kt&&this.onRemove(kt)}return this}has(I){return I.wrapped().key in this.data}getAndRemove(I){return this.has(I)?this._getAndRemoveByKey(I.wrapped().key):null}_getAndRemoveByKey(I){const ce=this.data[I].shift();return ce.timeout&&clearTimeout(ce.timeout),this.data[I].length===0&&delete this.data[I],this.order.splice(this.order.indexOf(I),1),ce.value}getByKey(I){const ce=this.data[I];return ce?ce[0].value:null}get(I){return this.has(I)?this.data[I.wrapped().key][0].value:null}remove(I,ce){if(!this.has(I))return this;const Ne=I.wrapped().key,je=ce===void 0?0:this.data[Ne].indexOf(ce),Ze=this.data[Ne][je];return this.data[Ne].splice(je,1),Ze.timeout&&clearTimeout(Ze.timeout),this.data[Ne].length===0&&delete this.data[Ne],this.onRemove(Ze.value),this.order.splice(this.order.indexOf(Ne),1),this}setMaxSize(I){for(this.max=I;this.order.length>this.max;){const ce=this._getAndRemoveByKey(this.order[0]);ce&&this.onRemove(ce)}return this}filter(I){const ce=[];for(const Ne in this.data)for(const je of this.data[Ne])I(je.value)||ce.push(je);for(const Ne of ce)this.remove(Ne.value.tileID,Ne)}}class $t{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(I,ce,Ne){const je=String(ce);if(this.stateChanges[I]=this.stateChanges[I]||{},this.stateChanges[I][je]=this.stateChanges[I][je]||{},t.e(this.stateChanges[I][je],Ne),this.deletedStates[I]===null){this.deletedStates[I]={};for(const Ze in this.state[I])Ze!==je&&(this.deletedStates[I][Ze]=null)}else if(this.deletedStates[I]&&this.deletedStates[I][je]===null){this.deletedStates[I][je]={};for(const Ze in this.state[I][je])Ne[Ze]||(this.deletedStates[I][je][Ze]=null)}else for(const Ze in Ne)this.deletedStates[I]&&this.deletedStates[I][je]&&this.deletedStates[I][je][Ze]===null&&delete this.deletedStates[I][je][Ze]}removeFeatureState(I,ce,Ne){if(this.deletedStates[I]===null)return;const je=String(ce);if(this.deletedStates[I]=this.deletedStates[I]||{},Ne&&ce!==void 0)this.deletedStates[I][je]!==null&&(this.deletedStates[I][je]=this.deletedStates[I][je]||{},this.deletedStates[I][je][Ne]=null);else if(ce!==void 0)if(this.stateChanges[I]&&this.stateChanges[I][je])for(Ne in this.deletedStates[I][je]={},this.stateChanges[I][je])this.deletedStates[I][je][Ne]=null;else this.deletedStates[I][je]=null;else this.deletedStates[I]=null}getState(I,ce){const Ne=String(ce),je=t.e({},(this.state[I]||{})[Ne],(this.stateChanges[I]||{})[Ne]);if(this.deletedStates[I]===null)return{};if(this.deletedStates[I]){const Ze=this.deletedStates[I][ce];if(Ze===null)return{};for(const kt in Ze)delete je[kt]}return je}initializeTileState(I,ce){I.setFeatureState(this.state,ce)}coalesceChanges(I,ce){const Ne={};for(const je in this.stateChanges){this.state[je]=this.state[je]||{};const Ze={};for(const kt in this.stateChanges[je])this.state[je][kt]||(this.state[je][kt]={}),t.e(this.state[je][kt],this.stateChanges[je][kt]),Ze[kt]=this.state[je][kt];Ne[je]=Ze}for(const je in this.deletedStates){this.state[je]=this.state[je]||{};const Ze={};if(this.deletedStates[je]===null)for(const kt in this.state[je])Ze[kt]={},this.state[je][kt]={};else for(const kt in this.deletedStates[je]){if(this.deletedStates[je][kt]===null)this.state[je][kt]={};else for(const Ft of Object.keys(this.deletedStates[je][kt]))delete this.state[je][kt][Ft];Ze[kt]=this.state[je][kt]}Ne[je]=Ne[je]||{},t.e(Ne[je],Ze)}if(this.stateChanges={},this.deletedStates={},Object.keys(Ne).length!==0)for(const je in I)I[je].setFeatureState(Ne,ce)}}class Yt extends t.E{constructor(I,ce,Ne){super(),this.id=I,this.dispatcher=Ne,this.on("data",je=>this._dataHandler(je)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((je,Ze,kt,Ft)=>{const tr=new(qe(Ze.type))(je,Ze,kt,Ft);if(tr.id!==je)throw new Error(`Expected Source id to be ${je} instead of ${tr.id}`);return tr})(I,ce,Ne,this),this._tiles={},this._cache=new vt(0,je=>this._unloadTile(je)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new $t,this._didEmitContent=!1,this._updated=!1}onAdd(I){this.map=I,this._maxTileCacheSize=I?I._maxTileCacheSize:null,this._maxTileCacheZoomLevels=I?I._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(I)}onRemove(I){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(I)}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 I in this._tiles){const ce=this._tiles[I];if(ce.state!=="loaded"&&ce.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const I=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,I&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(I,ce,Ne){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(I),this._tileLoaded(I,ce,Ne)}catch(je){I.state="errored",je.status!==404?this._source.fire(new t.j(je,{tile:I})):this.update(this.transform,this.terrain)}})}_unloadTile(I){this._source.unloadTile&&this._source.unloadTile(I)}_abortTile(I){this._source.abortTile&&this._source.abortTile(I),this._source.fire(new t.k("dataabort",{tile:I,coord:I.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(I){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const ce in this._tiles){const Ne=this._tiles[ce];Ne.upload(I),Ne.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(I=>I.tileID).sort(lr).map(I=>I.key)}getRenderableIds(I){const ce=[];for(const Ne in this._tiles)this._isIdRenderable(Ne,I)&&ce.push(this._tiles[Ne]);return I?ce.sort((Ne,je)=>{const Ze=Ne.tileID,kt=je.tileID,Ft=new t.P(Ze.canonical.x,Ze.canonical.y)._rotate(this.transform.angle),tr=new t.P(kt.canonical.x,kt.canonical.y)._rotate(this.transform.angle);return Ze.overscaledZ-kt.overscaledZ||tr.y-Ft.y||tr.x-Ft.x}).map(Ne=>Ne.tileID.key):ce.map(Ne=>Ne.tileID).sort(lr).map(Ne=>Ne.key)}hasRenderableParent(I){const ce=this.findLoadedParent(I,0);return!!ce&&this._isIdRenderable(ce.tileID.key)}_isIdRenderable(I,ce){return this._tiles[I]&&this._tiles[I].hasData()&&!this._coveredTiles[I]&&(ce||!this._tiles[I].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const I in this._tiles)this._tiles[I].state!=="errored"&&this._reloadTile(I,"reloading")}}_reloadTile(I,ce){return t._(this,void 0,void 0,function*(){const Ne=this._tiles[I];Ne&&(Ne.state!=="loading"&&(Ne.state=ce),yield this._loadTile(Ne,I,ce))})}_tileLoaded(I,ce,Ne){I.timeAdded=i.now(),Ne==="expired"&&(I.refreshedUponExpiration=!0),this._setTileReloadTimer(ce,I),this.getSource().type==="raster-dem"&&I.dem&&this._backfillDEM(I),this._state.initializeTileState(I,this.map?this.map.painter:null),I.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:I,coord:I.tileID}))}_backfillDEM(I){const ce=this.getRenderableIds();for(let je=0;je1||(Math.abs(kt)>1&&(Math.abs(kt+tr)===1?kt+=tr:Math.abs(kt-tr)===1&&(kt-=tr)),Ze.dem&&je.dem&&(je.dem.backfillBorder(Ze.dem,kt,Ft),je.neighboringTiles&&je.neighboringTiles[xr]&&(je.neighboringTiles[xr].backfilled=!0)))}}getTile(I){return this.getTileByID(I.key)}getTileByID(I){return this._tiles[I]}_retainLoadedChildren(I,ce,Ne,je){for(const Ze in this._tiles){let kt=this._tiles[Ze];if(je[Ze]||!kt.hasData()||kt.tileID.overscaledZ<=ce||kt.tileID.overscaledZ>Ne)continue;let Ft=kt.tileID;for(;kt&&kt.tileID.overscaledZ>ce+1;){const xr=kt.tileID.scaledTo(kt.tileID.overscaledZ-1);kt=this._tiles[xr.key],kt&&kt.hasData()&&(Ft=xr)}let tr=Ft;for(;tr.overscaledZ>ce;)if(tr=tr.scaledTo(tr.overscaledZ-1),I[tr.key]){je[Ft.key]=Ft;break}}}findLoadedParent(I,ce){if(I.key in this._loadedParentTiles){const Ne=this._loadedParentTiles[I.key];return Ne&&Ne.tileID.overscaledZ>=ce?Ne:null}for(let Ne=I.overscaledZ-1;Ne>=ce;Ne--){const je=I.scaledTo(Ne),Ze=this._getLoadedTile(je);if(Ze)return Ze}}findLoadedSibling(I){return this._getLoadedTile(I)}_getLoadedTile(I){const ce=this._tiles[I.key];return ce&&ce.hasData()?ce:this._cache.getByKey(I.wrapped().key)}updateCacheSize(I){const ce=Math.ceil(I.width/this._source.tileSize)+1,Ne=Math.ceil(I.height/this._source.tileSize)+1,je=Math.floor(ce*Ne*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Ze=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,je):je;this._cache.setMaxSize(Ze)}handleWrapJump(I){const ce=Math.round((I-(this._prevLng===void 0?I:this._prevLng))/360);if(this._prevLng=I,ce){const Ne={};for(const je in this._tiles){const Ze=this._tiles[je];Ze.tileID=Ze.tileID.unwrapTo(Ze.tileID.wrap+ce),Ne[Ze.tileID.key]=Ze}this._tiles=Ne;for(const je in this._timers)clearTimeout(this._timers[je]),delete this._timers[je];for(const je in this._tiles)this._setTileReloadTimer(je,this._tiles[je])}}_updateCoveredAndRetainedTiles(I,ce,Ne,je,Ze,kt){const Ft={},tr={},xr=Object.keys(I),Or=i.now();for(const Ur of xr){const hn=I[Ur],Cn=this._tiles[Ur];if(!Cn||Cn.fadeEndTime!==0&&Cn.fadeEndTime<=Or)continue;const ot=this.findLoadedParent(hn,ce),dt=this.findLoadedSibling(hn),Tt=ot||dt||null;Tt&&(this._addTile(Tt.tileID),Ft[Tt.tileID.key]=Tt.tileID),tr[Ur]=hn}this._retainLoadedChildren(tr,je,Ne,I);for(const Ur in Ft)I[Ur]||(this._coveredTiles[Ur]=!0,I[Ur]=Ft[Ur]);if(kt){const Ur={},hn={};for(const Cn of Ze)this._tiles[Cn.key].hasData()?Ur[Cn.key]=Cn:hn[Cn.key]=Cn;for(const Cn in hn){const ot=hn[Cn].children(this._source.maxzoom);this._tiles[ot[0].key]&&this._tiles[ot[1].key]&&this._tiles[ot[2].key]&&this._tiles[ot[3].key]&&(Ur[ot[0].key]=I[ot[0].key]=ot[0],Ur[ot[1].key]=I[ot[1].key]=ot[1],Ur[ot[2].key]=I[ot[2].key]=ot[2],Ur[ot[3].key]=I[ot[3].key]=ot[3],delete hn[Cn])}for(const Cn in hn){const ot=hn[Cn],dt=this.findLoadedParent(ot,this._source.minzoom),Tt=this.findLoadedSibling(ot),Pt=dt||Tt||null;if(Pt){Ur[Pt.tileID.key]=I[Pt.tileID.key]=Pt.tileID;for(const qt in Ur)Ur[qt].isChildOf(Pt.tileID)&&delete Ur[qt]}}for(const Cn in this._tiles)Ur[Cn]||(this._coveredTiles[Cn]=!0)}}update(I,ce){if(!this._sourceLoaded||this._paused)return;let Ne;this.transform=I,this.terrain=ce,this.updateCacheSize(I),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Ne=I.getVisibleUnwrappedCoordinates(this._source.tileID).map(Or=>new t.S(Or.canonical.z,Or.wrap,Or.canonical.z,Or.canonical.x,Or.canonical.y)):(Ne=I.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:ce}),this._source.hasTile&&(Ne=Ne.filter(Or=>this._source.hasTile(Or)))):Ne=[];const je=I.coveringZoomLevel(this._source),Ze=Math.max(je-Yt.maxOverzooming,this._source.minzoom),kt=Math.max(je+Yt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const Or={};for(const Ur of Ne)if(Ur.canonical.z>this._source.minzoom){const hn=Ur.scaledTo(Ur.canonical.z-1);Or[hn.key]=hn;const Cn=Ur.scaledTo(Math.max(this._source.minzoom,Math.min(Ur.canonical.z,5)));Or[Cn.key]=Cn}Ne=Ne.concat(Object.values(Or))}const Ft=Ne.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,Ft&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const tr=this._updateRetainedTiles(Ne,je);dr(this._source.type)&&this._updateCoveredAndRetainedTiles(tr,Ze,kt,je,Ne,ce);for(const Or in tr)this._tiles[Or].clearFadeHold();const xr=t.ab(this._tiles,tr);for(const Or of xr){const Ur=this._tiles[Or];Ur.hasSymbolBuckets&&!Ur.holdingForFade()?Ur.setHoldDuration(this.map._fadeDuration):Ur.hasSymbolBuckets&&!Ur.symbolFadeFinished()||this._removeTile(Or)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const I in this._tiles)this._tiles[I].holdingForFade()&&this._removeTile(I)}_updateRetainedTiles(I,ce){var Ne;const je={},Ze={},kt=Math.max(ce-Yt.maxOverzooming,this._source.minzoom),Ft=Math.max(ce+Yt.maxUnderzooming,this._source.minzoom),tr={};for(const xr of I){const Or=this._addTile(xr);je[xr.key]=xr,Or.hasData()||cethis._source.maxzoom){const hn=xr.children(this._source.maxzoom)[0],Cn=this.getTile(hn);if(Cn&&Cn.hasData()){je[hn.key]=hn;continue}}else{const hn=xr.children(this._source.maxzoom);if(je[hn[0].key]&&je[hn[1].key]&&je[hn[2].key]&&je[hn[3].key])continue}let Ur=Or.wasRequested();for(let hn=xr.overscaledZ-1;hn>=kt;--hn){const Cn=xr.scaledTo(hn);if(Ze[Cn.key])break;if(Ze[Cn.key]=!0,Or=this.getTile(Cn),!Or&&Ur&&(Or=this._addTile(Cn)),Or){const ot=Or.hasData();if((ot||!(!((Ne=this.map)===null||Ne===void 0)&&Ne.cancelPendingTileRequestsWhileZooming)||Ur)&&(je[Cn.key]=Cn),Ur=Or.wasRequested(),ot)break}}}return je}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const I in this._tiles){const ce=[];let Ne,je=this._tiles[I].tileID;for(;je.overscaledZ>0;){if(je.key in this._loadedParentTiles){Ne=this._loadedParentTiles[je.key];break}ce.push(je.key);const Ze=je.scaledTo(je.overscaledZ-1);if(Ne=this._getLoadedTile(Ze),Ne)break;je=Ze}for(const Ze of ce)this._loadedParentTiles[Ze]=Ne}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const I in this._tiles){const ce=this._tiles[I].tileID,Ne=this._getLoadedTile(ce);this._loadedSiblingTiles[ce.key]=Ne}}_addTile(I){let ce=this._tiles[I.key];if(ce)return ce;ce=this._cache.getAndRemove(I),ce&&(this._setTileReloadTimer(I.key,ce),ce.tileID=I,this._state.initializeTileState(ce,this.map?this.map.painter:null),this._cacheTimers[I.key]&&(clearTimeout(this._cacheTimers[I.key]),delete this._cacheTimers[I.key],this._setTileReloadTimer(I.key,ce)));const Ne=ce;return ce||(ce=new wt(I,this._source.tileSize*I.overscaleFactor()),this._loadTile(ce,I.key,ce.state)),ce.uses++,this._tiles[I.key]=ce,Ne||this._source.fire(new t.k("dataloading",{tile:ce,coord:ce.tileID,dataType:"source"})),ce}_setTileReloadTimer(I,ce){I in this._timers&&(clearTimeout(this._timers[I]),delete this._timers[I]);const Ne=ce.getExpiryTimeout();Ne&&(this._timers[I]=setTimeout(()=>{this._reloadTile(I,"expired"),delete this._timers[I]},Ne))}_removeTile(I){const ce=this._tiles[I];ce&&(ce.uses--,delete this._tiles[I],this._timers[I]&&(clearTimeout(this._timers[I]),delete this._timers[I]),ce.uses>0||(ce.hasData()&&ce.state!=="reloading"?this._cache.add(ce.tileID,ce,ce.getExpiryTimeout()):(ce.aborted=!0,this._abortTile(ce),this._unloadTile(ce))))}_dataHandler(I){const ce=I.sourceDataType;I.dataType==="source"&&ce==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&I.dataType==="source"&&ce==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const I in this._tiles)this._removeTile(I);this._cache.reset()}tilesIn(I,ce,Ne){const je=[],Ze=this.transform;if(!Ze)return je;const kt=Ne?Ze.getCameraQueryGeometry(I):I,Ft=I.map(ot=>Ze.pointCoordinate(ot,this.terrain)),tr=kt.map(ot=>Ze.pointCoordinate(ot,this.terrain)),xr=this.getIds();let Or=1/0,Ur=1/0,hn=-1/0,Cn=-1/0;for(const ot of tr)Or=Math.min(Or,ot.x),Ur=Math.min(Ur,ot.y),hn=Math.max(hn,ot.x),Cn=Math.max(Cn,ot.y);for(let ot=0;ot=0&&zt[1].y+qt>=0){const Xt=Ft.map(Rr=>Tt.getTilePoint(Rr)),Mr=tr.map(Rr=>Tt.getTilePoint(Rr));je.push({tile:dt,tileID:Tt,queryGeometry:Xt,cameraQueryGeometry:Mr,scale:Pt})}}return je}getVisibleCoordinates(I){const ce=this.getRenderableIds(I).map(Ne=>this._tiles[Ne].tileID);for(const Ne of ce)Ne.posMatrix=this.transform.calculatePosMatrix(Ne.toUnwrapped());return ce}hasTransition(){if(this._source.hasTransition())return!0;if(dr(this._source.type)){const I=i.now();for(const ce in this._tiles)if(this._tiles[ce].fadeEndTime>=I)return!0}return!1}setFeatureState(I,ce,Ne){this._state.updateState(I=I||"_geojsonTileLayer",ce,Ne)}removeFeatureState(I,ce,Ne){this._state.removeFeatureState(I=I||"_geojsonTileLayer",ce,Ne)}getFeatureState(I,ce){return this._state.getState(I=I||"_geojsonTileLayer",ce)}setDependencies(I,ce,Ne){const je=this._tiles[I];je&&je.setDependencies(ce,Ne)}reloadTilesForDependencies(I,ce){for(const Ne in this._tiles)this._tiles[Ne].hasDependency(I,ce)&&this._reloadTile(Ne,"reloading");this._cache.filter(Ne=>!Ne.hasDependency(I,ce))}}function lr(Je,I){const ce=Math.abs(2*Je.wrap)-+(Je.wrap<0),Ne=Math.abs(2*I.wrap)-+(I.wrap<0);return Je.overscaledZ-I.overscaledZ||Ne-ce||I.canonical.y-Je.canonical.y||I.canonical.x-Je.canonical.x}function dr(Je){return Je==="raster"||Je==="image"||Je==="video"}Yt.maxOverzooming=10,Yt.maxUnderzooming=3;class Nr{constructor(I,ce){this.reset(I,ce)}reset(I,ce){this.points=I||[],this._distances=[0];for(let Ne=1;Ne0?(je-kt)/Ft:0;return this.points[Ze].mult(1-tr).add(this.points[ce].mult(tr))}}function Fr(Je,I){let ce=!0;return Je==="always"||Je!=="never"&&I!=="never"||(ce=!1),ce}class ln{constructor(I,ce,Ne){const je=this.boxCells=[],Ze=this.circleCells=[];this.xCellCount=Math.ceil(I/Ne),this.yCellCount=Math.ceil(ce/Ne);for(let kt=0;ktthis.width||je<0||ce>this.height)return[];const tr=[];if(I<=0&&ce<=0&&this.width<=Ne&&this.height<=je){if(Ze)return[{key:null,x1:I,y1:ce,x2:Ne,y2:je}];for(let xr=0;xr0}hitTestCircle(I,ce,Ne,je,Ze){const kt=I-Ne,Ft=I+Ne,tr=ce-Ne,xr=ce+Ne;if(Ft<0||kt>this.width||xr<0||tr>this.height)return!1;const Or=[];return this._forEachCell(kt,tr,Ft,xr,this._queryCellCircle,Or,{hitTest:!0,overlapMode:je,circle:{x:I,y:ce,radius:Ne},seenUids:{box:{},circle:{}}},Ze),Or.length>0}_queryCell(I,ce,Ne,je,Ze,kt,Ft,tr){const{seenUids:xr,hitTest:Or,overlapMode:Ur}=Ft,hn=this.boxCells[Ze];if(hn!==null){const ot=this.bboxes;for(const dt of hn)if(!xr.box[dt]){xr.box[dt]=!0;const Tt=4*dt,Pt=this.boxKeys[dt];if(I<=ot[Tt+2]&&ce<=ot[Tt+3]&&Ne>=ot[Tt+0]&&je>=ot[Tt+1]&&(!tr||tr(Pt))&&(!Or||!Fr(Ur,Pt.overlapMode))&&(kt.push({key:Pt,x1:ot[Tt],y1:ot[Tt+1],x2:ot[Tt+2],y2:ot[Tt+3]}),Or))return!0}}const Cn=this.circleCells[Ze];if(Cn!==null){const ot=this.circles;for(const dt of Cn)if(!xr.circle[dt]){xr.circle[dt]=!0;const Tt=3*dt,Pt=this.circleKeys[dt];if(this._circleAndRectCollide(ot[Tt],ot[Tt+1],ot[Tt+2],I,ce,Ne,je)&&(!tr||tr(Pt))&&(!Or||!Fr(Ur,Pt.overlapMode))){const qt=ot[Tt],zt=ot[Tt+1],Xt=ot[Tt+2];if(kt.push({key:Pt,x1:qt-Xt,y1:zt-Xt,x2:qt+Xt,y2:zt+Xt}),Or)return!0}}}return!1}_queryCellCircle(I,ce,Ne,je,Ze,kt,Ft,tr){const{circle:xr,seenUids:Or,overlapMode:Ur}=Ft,hn=this.boxCells[Ze];if(hn!==null){const ot=this.bboxes;for(const dt of hn)if(!Or.box[dt]){Or.box[dt]=!0;const Tt=4*dt,Pt=this.boxKeys[dt];if(this._circleAndRectCollide(xr.x,xr.y,xr.radius,ot[Tt+0],ot[Tt+1],ot[Tt+2],ot[Tt+3])&&(!tr||tr(Pt))&&!Fr(Ur,Pt.overlapMode))return kt.push(!0),!0}}const Cn=this.circleCells[Ze];if(Cn!==null){const ot=this.circles;for(const dt of Cn)if(!Or.circle[dt]){Or.circle[dt]=!0;const Tt=3*dt,Pt=this.circleKeys[dt];if(this._circlesCollide(ot[Tt],ot[Tt+1],ot[Tt+2],xr.x,xr.y,xr.radius)&&(!tr||tr(Pt))&&!Fr(Ur,Pt.overlapMode))return kt.push(!0),!0}}}_forEachCell(I,ce,Ne,je,Ze,kt,Ft,tr){const xr=this._convertToXCellCoord(I),Or=this._convertToYCellCoord(ce),Ur=this._convertToXCellCoord(Ne),hn=this._convertToYCellCoord(je);for(let Cn=xr;Cn<=Ur;Cn++)for(let ot=Or;ot<=hn;ot++)if(Ze.call(this,I,ce,Ne,je,this.xCellCount*ot+Cn,kt,Ft,tr))return}_convertToXCellCoord(I){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(I*this.xScale)))}_convertToYCellCoord(I){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(I*this.yScale)))}_circlesCollide(I,ce,Ne,je,Ze,kt){const Ft=je-I,tr=Ze-ce,xr=Ne+kt;return xr*xr>Ft*Ft+tr*tr}_circleAndRectCollide(I,ce,Ne,je,Ze,kt,Ft){const tr=(kt-je)/2,xr=Math.abs(I-(je+tr));if(xr>tr+Ne)return!1;const Or=(Ft-Ze)/2,Ur=Math.abs(ce-(Ze+Or));if(Ur>Or+Ne)return!1;if(xr<=tr||Ur<=Or)return!0;const hn=xr-tr,Cn=Ur-Or;return hn*hn+Cn*Cn<=Ne*Ne}}function zr(Je,I,ce,Ne,je){const Ze=t.H();return I?(t.K(Ze,Ze,[1/je,1/je,1]),ce||t.ad(Ze,Ze,Ne.angle)):t.L(Ze,Ne.labelPlaneMatrix,Je),Ze}function Xr(Je,I,ce,Ne,je){if(I){const Ze=t.ae(Je);return t.K(Ze,Ze,[je,je,1]),ce||t.ad(Ze,Ze,-Ne.angle),Ze}return Ne.glCoordMatrix}function Ot(Je,I,ce,Ne){let je;Ne?(je=[Je,I,Ne(Je,I),1],t.af(je,je,ce)):(je=[Je,I,0,1],Tr(je,je,ce));const Ze=je[3];return{point:new t.P(je[0]/Ze,je[1]/Ze),signedDistanceFromCamera:Ze,isOccluded:!1}}function Qe(Je,I){return .5+Je/I*.5}function ct(Je,I){return Je.x>=-I[0]&&Je.x<=I[0]&&Je.y>=-I[1]&&Je.y<=I[1]}function Ue(Je,I,ce,Ne,je,Ze,kt,Ft,tr,xr,Or,Ur,hn,Cn,ot){const dt=Ne?Je.textSizeData:Je.iconSizeData,Tt=t.ag(dt,ce.transform.zoom),Pt=[256/ce.width*2+1,256/ce.height*2+1],qt=Ne?Je.text.dynamicLayoutVertexArray:Je.icon.dynamicLayoutVertexArray;qt.clear();const zt=Je.lineVertexArray,Xt=Ne?Je.text.placedSymbolArray:Je.icon.placedSymbolArray,Mr=ce.transform.width/ce.transform.height;let Rr=!1;for(let Vr=0;VrMath.abs(ce.x-I.x)*Ne?{useVertical:!0}:(Je===t.ah.vertical?I.yce.x)?{needsFlipping:!0}:null}function Be(Je,I,ce,Ne,je,Ze,kt,Ft,tr,xr,Or){const Ur=ce/24,hn=I.lineOffsetX*Ur,Cn=I.lineOffsetY*Ur;let ot;if(I.numGlyphs>1){const dt=I.glyphStartIndex+I.numGlyphs,Tt=I.lineStartIndex,Pt=I.lineStartIndex+I.lineLength,qt=Ie(Ur,Ft,hn,Cn,Ne,I,Or,Je);if(!qt)return{notEnoughRoom:!0};const zt=Ot(qt.first.point.x,qt.first.point.y,kt,Je.getElevation).point,Xt=Ot(qt.last.point.x,qt.last.point.y,kt,Je.getElevation).point;if(je&&!Ne){const Mr=Pe(I.writingMode,zt,Xt,xr);if(Mr)return Mr}ot=[qt.first];for(let Mr=I.glyphStartIndex+1;Mr0?zt.point:function(Rr,Vr,an,mn,zn,Gn){return at(Rr,Vr,an,1,zn,Gn)}(Je.tileAnchorPoint,qt,Tt,0,Ze,Je),Mr=Pe(I.writingMode,Tt,Xt,xr);if(Mr)return Mr}const dt=or(Ur*Ft.getoffsetX(I.glyphStartIndex),hn,Cn,Ne,I.segment,I.lineStartIndex,I.lineStartIndex+I.lineLength,Je,Or);if(!dt||Je.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};ot=[dt]}for(const dt of ot)t.aj(tr,dt.point,dt.angle);return{}}function at(Je,I,ce,Ne,je,Ze){const kt=Je.add(Je.sub(I)._unit()),Ft=je!==void 0?Ot(kt.x,kt.y,je,Ze.getElevation).point:Bt(kt.x,kt.y,Ze).point,tr=ce.sub(Ft);return ce.add(tr._mult(Ne/tr.mag()))}function ft(Je,I,ce){const Ne=I.projectionCache;if(Ne.projections[Je])return Ne.projections[Je];const je=new t.P(I.lineVertexArray.getx(Je),I.lineVertexArray.gety(Je)),Ze=Bt(je.x,je.y,I);if(Ze.signedDistanceFromCamera>0)return Ne.projections[Je]=Ze.point,Ne.anyProjectionOccluded=Ne.anyProjectionOccluded||Ze.isOccluded,Ze.point;const kt=Je-ce.direction;return function(Ft,tr,xr,Or,Ur){return at(Ft,tr,xr,Or,void 0,Ur)}(ce.distanceFromAnchor===0?I.tileAnchorPoint:new t.P(I.lineVertexArray.getx(kt),I.lineVertexArray.gety(kt)),je,ce.previousVertex,ce.absOffsetX-ce.distanceFromAnchor+1,I)}function Bt(Je,I,ce){const Ne=Je+ce.translation[0],je=I+ce.translation[1];let Ze;return!ce.pitchWithMap&&ce.projection.useSpecialProjectionForSymbols?(Ze=ce.projection.projectTileCoordinates(Ne,je,ce.unwrappedTileID,ce.getElevation),Ze.point.x=(.5*Ze.point.x+.5)*ce.width,Ze.point.y=(.5*-Ze.point.y+.5)*ce.height):(Ze=Ot(Ne,je,ce.labelPlaneMatrix,ce.getElevation),Ze.isOccluded=!1),Ze}function Nt(Je,I,ce){return Je._unit()._perp()._mult(I*ce)}function Ht(Je,I,ce,Ne,je,Ze,kt,Ft,tr){if(Ft.projectionCache.offsets[Je])return Ft.projectionCache.offsets[Je];const xr=ce.add(I);if(Je+tr.direction=je)return Ft.projectionCache.offsets[Je]=xr,xr;const Or=ft(Je+tr.direction,Ft,tr),Ur=Nt(Or.sub(ce),kt,tr.direction),hn=ce.add(Ur),Cn=Or.add(Ur);return Ft.projectionCache.offsets[Je]=t.ak(Ze,xr,hn,Cn)||xr,Ft.projectionCache.offsets[Je]}function or(Je,I,ce,Ne,je,Ze,kt,Ft,tr){const xr=Ne?Je-I:Je+I;let Or=xr>0?1:-1,Ur=0;Ne&&(Or*=-1,Ur=Math.PI),Or<0&&(Ur+=Math.PI);let hn,Cn=Or>0?Ze+je:Ze+je+1;Ft.projectionCache.cachedAnchorPoint?hn=Ft.projectionCache.cachedAnchorPoint:(hn=Bt(Ft.tileAnchorPoint.x,Ft.tileAnchorPoint.y,Ft).point,Ft.projectionCache.cachedAnchorPoint=hn);let ot,dt,Tt=hn,Pt=hn,qt=0,zt=0;const Xt=Math.abs(xr),Mr=[];let Rr;for(;qt+zt<=Xt;){if(Cn+=Or,Cn=kt)return null;qt+=zt,Pt=Tt,dt=ot;const mn={absOffsetX:Xt,direction:Or,distanceFromAnchor:qt,previousVertex:Pt};if(Tt=ft(Cn,Ft,mn),ce===0)Mr.push(Pt),Rr=Tt.sub(Pt);else{let zn;const Gn=Tt.sub(Pt);zn=Gn.mag()===0?Nt(ft(Cn+Or,Ft,mn).sub(Tt),ce,Or):Nt(Gn,ce,Or),dt||(dt=Pt.add(zn)),ot=Ht(Cn,zn,Tt,Ze,kt,dt,ce,Ft,mn),Mr.push(dt),Rr=ot.sub(dt)}zt=Rr.mag()}const Vr=Rr._mult((Xt-qt)/zt)._add(dt||Pt),an=Ur+Math.atan2(Tt.y-Pt.y,Tt.x-Pt.x);return Mr.push(Vr),{point:Vr,angle:tr?an:0,path:Mr}}const Cr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Sr(Je,I){for(let ce=0;ce=1;go--)mi.push(vi.path[go]);for(let go=1;goWo.signedDistanceFromCamera<=0)?[]:go.map(Wo=>Wo.point)}let To=[];if(mi.length>0){const go=mi[0].clone(),Wo=mi[0].clone();for(let $s=1;$s=Gn.x&&Wo.x<=oa.x&&go.y>=Gn.y&&Wo.y<=oa.y?[mi]:Wo.xoa.x||Wo.yoa.y?[]:t.al([mi],Gn.x,Gn.y,oa.x,oa.y)}for(const go of To){Fa.reset(go,.25*zn);let Wo=0;Wo=Fa.length<=.5*zn?1:Math.ceil(Fa.paddedLength/no)+1;for(let $s=0;$sOt(je.x,je.y,Ne,ce.getElevation))}queryRenderedSymbols(I){if(I.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const ce=[];let Ne=1/0,je=1/0,Ze=-1/0,kt=-1/0;for(const Or of I){const Ur=new t.P(Or.x+Yr,Or.y+Yr);Ne=Math.min(Ne,Ur.x),je=Math.min(je,Ur.y),Ze=Math.max(Ze,Ur.x),kt=Math.max(kt,Ur.y),ce.push(Ur)}const Ft=this.grid.query(Ne,je,Ze,kt).concat(this.ignoredGrid.query(Ne,je,Ze,kt)),tr={},xr={};for(const Or of Ft){const Ur=Or.key;if(tr[Ur.bucketInstanceId]===void 0&&(tr[Ur.bucketInstanceId]={}),tr[Ur.bucketInstanceId][Ur.featureIndex])continue;const hn=[new t.P(Or.x1,Or.y1),new t.P(Or.x2,Or.y1),new t.P(Or.x2,Or.y2),new t.P(Or.x1,Or.y2)];t.am(ce,hn)&&(tr[Ur.bucketInstanceId][Ur.featureIndex]=!0,xr[Ur.bucketInstanceId]===void 0&&(xr[Ur.bucketInstanceId]=[]),xr[Ur.bucketInstanceId].push(Ur.featureIndex))}return xr}insertCollisionBox(I,ce,Ne,je,Ze,kt){(Ne?this.ignoredGrid:this.grid).insert({bucketInstanceId:je,featureIndex:Ze,collisionGroupID:kt,overlapMode:ce},I[0],I[1],I[2],I[3])}insertCollisionCircles(I,ce,Ne,je,Ze,kt){const Ft=Ne?this.ignoredGrid:this.grid,tr={bucketInstanceId:je,featureIndex:Ze,collisionGroupID:kt,overlapMode:ce};for(let xr=0;xr=this.screenRightBoundary||jethis.screenBottomBoundary}isInsideGrid(I,ce,Ne,je){return Ne>=0&&I=0&&cethis.projectAndGetPerspectiveRatio(Ne,zn.x,zn.y,je,xr));an=mn.some(zn=>!zn.isOccluded),Vr=mn.map(zn=>zn.point)}else an=!0;return{box:t.ao(Vr),allPointsOccluded:!an}}}function ua(Je,I,ce){return I*(t.X/(Je.tileSize*Math.pow(2,ce-Je.tileID.overscaledZ)))}class ta{constructor(I,ce,Ne,je){this.opacity=I?Math.max(0,Math.min(1,I.opacity+(I.placed?ce:-ce))):je&&Ne?1:0,this.placed=Ne}isHidden(){return this.opacity===0&&!this.placed}}class va{constructor(I,ce,Ne,je,Ze){this.text=new ta(I?I.text:null,ce,Ne,Ze),this.icon=new ta(I?I.icon:null,ce,je,Ze)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class ma{constructor(I,ce,Ne){this.text=I,this.icon=ce,this.skipFade=Ne}}class Jn{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class ja{constructor(I,ce,Ne,je,Ze){this.bucketInstanceId=I,this.featureIndex=ce,this.sourceLayerIndex=Ne,this.bucketIndex=je,this.tileID=Ze}}class ti{constructor(I){this.crossSourceCollisions=I,this.maxGroupID=0,this.collisionGroups={}}get(I){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[I]){const ce=++this.maxGroupID;this.collisionGroups[I]={ID:ce,predicate:Ne=>Ne.collisionGroupID===ce}}return this.collisionGroups[I]}}function gr(Je,I,ce,Ne,je){const{horizontalAlign:Ze,verticalAlign:kt}=t.au(Je);return new t.P(-(Ze-.5)*I+Ne[0]*je,-(kt-.5)*ce+Ne[1]*je)}class Kt{constructor(I,ce,Ne,je,Ze,kt){this.transform=I.clone(),this.terrain=Ne,this.collisionIndex=new Fn(this.transform,ce),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=je,this.retainedQueryData={},this.collisionGroups=new ti(Ze),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=kt,kt&&(kt.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(I){const ce=this.terrain;return ce?(Ne,je)=>ce.getElevation(I,Ne,je):null}getBucketParts(I,ce,Ne,je){const Ze=Ne.getBucket(ce),kt=Ne.latestFeatureIndex;if(!Ze||!kt||ce.id!==Ze.layerIds[0])return;const Ft=Ne.collisionBoxArray,tr=Ze.layers[0].layout,xr=Ze.layers[0].paint,Or=Math.pow(2,this.transform.zoom-Ne.tileID.overscaledZ),Ur=Ne.tileSize/t.X,hn=Ne.tileID.toUnwrapped(),Cn=this.transform.calculatePosMatrix(hn),ot=tr.get("text-pitch-alignment")==="map",dt=tr.get("text-rotation-alignment")==="map",Tt=ua(Ne,1,this.transform.zoom),Pt=this.collisionIndex.mapProjection.translatePosition(this.transform,Ne,xr.get("text-translate"),xr.get("text-translate-anchor")),qt=this.collisionIndex.mapProjection.translatePosition(this.transform,Ne,xr.get("icon-translate"),xr.get("icon-translate-anchor")),zt=zr(Cn,ot,dt,this.transform,Tt);let Xt=null;if(ot){const Rr=Xr(Cn,ot,dt,this.transform,Tt);Xt=t.L([],this.transform.labelPlaneMatrix,Rr)}this.retainedQueryData[Ze.bucketInstanceId]=new ja(Ze.bucketInstanceId,kt,Ze.sourceLayerIndex,Ze.index,Ne.tileID);const Mr={bucket:Ze,layout:tr,translationText:Pt,translationIcon:qt,posMatrix:Cn,unwrappedTileID:hn,textLabelPlaneMatrix:zt,labelToScreenMatrix:Xt,scale:Or,textPixelRatio:Ur,holdingForFade:Ne.holdingForFade(),collisionBoxArray:Ft,partiallyEvaluatedTextSize:t.ag(Ze.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Ze.sourceID)};if(je)for(const Rr of Ze.sortKeyRanges){const{sortKey:Vr,symbolInstanceStart:an,symbolInstanceEnd:mn}=Rr;I.push({sortKey:Vr,symbolInstanceStart:an,symbolInstanceEnd:mn,parameters:Mr})}else I.push({symbolInstanceStart:0,symbolInstanceEnd:Ze.symbolInstances.length,parameters:Mr})}attemptAnchorPlacement(I,ce,Ne,je,Ze,kt,Ft,tr,xr,Or,Ur,hn,Cn,ot,dt,Tt,Pt,qt,zt){const Xt=t.aq[I.textAnchor],Mr=[I.textOffset0,I.textOffset1],Rr=gr(Xt,Ne,je,Mr,Ze),Vr=this.collisionIndex.placeCollisionBox(ce,hn,tr,xr,Or,Ft,kt,Tt,Ur.predicate,zt,Rr);if((!qt||this.collisionIndex.placeCollisionBox(qt,hn,tr,xr,Or,Ft,kt,Pt,Ur.predicate,zt,Rr).placeable)&&Vr.placeable){let an;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Cn.crossTileID]&&this.prevPlacement.placements[Cn.crossTileID]&&this.prevPlacement.placements[Cn.crossTileID].text&&(an=this.prevPlacement.variableOffsets[Cn.crossTileID].anchor),Cn.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Cn.crossTileID]={textOffset:Mr,width:Ne,height:je,anchor:Xt,textBoxScale:Ze,prevAnchor:an},this.markUsedJustification(ot,Xt,Cn,dt),ot.allowVerticalPlacement&&(this.markUsedOrientation(ot,dt,Cn),this.placedOrientations[Cn.crossTileID]=dt),{shift:Rr,placedGlyphBoxes:Vr}}}placeLayerBucketPart(I,ce,Ne){const{bucket:je,layout:Ze,translationText:kt,translationIcon:Ft,posMatrix:tr,unwrappedTileID:xr,textLabelPlaneMatrix:Or,labelToScreenMatrix:Ur,textPixelRatio:hn,holdingForFade:Cn,collisionBoxArray:ot,partiallyEvaluatedTextSize:dt,collisionGroup:Tt}=I.parameters,Pt=Ze.get("text-optional"),qt=Ze.get("icon-optional"),zt=t.ar(Ze,"text-overlap","text-allow-overlap"),Xt=zt==="always",Mr=t.ar(Ze,"icon-overlap","icon-allow-overlap"),Rr=Mr==="always",Vr=Ze.get("text-rotation-alignment")==="map",an=Ze.get("text-pitch-alignment")==="map",mn=Ze.get("icon-text-fit")!=="none",zn=Ze.get("symbol-z-order")==="viewport-y",Gn=Xt&&(Rr||!je.hasIconData()||qt),oa=Rr&&(Xt||!je.hasTextData()||Pt);!je.collisionArrays&&ot&&je.deserializeCollisionBoxes(ot);const Fa=this._getTerrainElevationFunc(this.retainedQueryData[je.bucketInstanceId].tileID),vi=(li,mi,no)=>{var To,go;if(ce[li.crossTileID])return;if(Cn)return void(this.placements[li.crossTileID]=new ma(!1,!1,!1));let Wo=!1,$s=!1,Ws=!0,As=null,Qs={box:null,placeable:!1,offscreen:null},uu={placeable:!1},Kl=null,Ms=null,Es=null,Mu=0,Wu=0,xc=0;mi.textFeatureIndex?Mu=mi.textFeatureIndex:li.useRuntimeCollisionCircles&&(Mu=li.featureIndex),mi.verticalTextFeatureIndex&&(Wu=mi.verticalTextFeatureIndex);const ke=mi.textBox;if(ke){const Rt=kr=>{let on=t.ah.horizontal;if(je.allowVerticalPlacement&&!kr&&this.prevPlacement){const nn=this.prevPlacement.placedOrientations[li.crossTileID];nn&&(this.placedOrientations[li.crossTileID]=nn,on=nn,this.markUsedOrientation(je,on,li))}return on},jt=(kr,on)=>{if(je.allowVerticalPlacement&&li.numVerticalGlyphVertices>0&&mi.verticalTextBox){for(const nn of je.writingModes)if(nn===t.ah.vertical?(Qs=on(),uu=Qs):Qs=kr(),Qs&&Qs.placeable)break}else Qs=kr()},cr=li.textAnchorOffsetStartIndex,ur=li.textAnchorOffsetEndIndex;if(ur===cr){const kr=(on,nn)=>{const wn=this.collisionIndex.placeCollisionBox(on,zt,hn,tr,xr,an,Vr,kt,Tt.predicate,Fa);return wn&&wn.placeable&&(this.markUsedOrientation(je,nn,li),this.placedOrientations[li.crossTileID]=nn),wn};jt(()=>kr(ke,t.ah.horizontal),()=>{const on=mi.verticalTextBox;return je.allowVerticalPlacement&&li.numVerticalGlyphVertices>0&&on?kr(on,t.ah.vertical):{box:null,offscreen:null}}),Rt(Qs&&Qs.placeable)}else{let kr=t.aq[(go=(To=this.prevPlacement)===null||To===void 0?void 0:To.variableOffsets[li.crossTileID])===null||go===void 0?void 0:go.anchor];const on=(wn,Rn,Nn)=>{const qa=wn.x2-wn.x1,Yn=wn.y2-wn.y1,ha=li.textBoxScale,xa=mn&&Mr==="never"?Rn:null;let Ba=null,Ha=zt==="never"?1:2,_a="never";kr&&Ha++;for(let gi=0;gion(ke,mi.iconBox,t.ah.horizontal),()=>{const wn=mi.verticalTextBox;return je.allowVerticalPlacement&&(!Qs||!Qs.placeable)&&li.numVerticalGlyphVertices>0&&wn?on(wn,mi.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Qs&&(Wo=Qs.placeable,Ws=Qs.offscreen);const nn=Rt(Qs&&Qs.placeable);if(!Wo&&this.prevPlacement){const wn=this.prevPlacement.variableOffsets[li.crossTileID];wn&&(this.variableOffsets[li.crossTileID]=wn,this.markUsedJustification(je,wn.anchor,li,nn))}}}if(Kl=Qs,Wo=Kl&&Kl.placeable,Ws=Kl&&Kl.offscreen,li.useRuntimeCollisionCircles){const Rt=je.text.placedSymbolArray.get(li.centerJustifiedTextSymbolIndex),jt=t.ai(je.textSizeData,dt,Rt),cr=Ze.get("text-padding");Ms=this.collisionIndex.placeCollisionCircles(zt,Rt,je.lineVertexArray,je.glyphOffsetArray,jt,tr,xr,Or,Ur,Ne,an,Tt.predicate,li.collisionCircleDiameter,cr,kt,Fa),Ms.circles.length&&Ms.collisionDetected&&!Ne&&t.w("Collisions detected, but collision boxes are not shown"),Wo=Xt||Ms.circles.length>0&&!Ms.collisionDetected,Ws=Ws&&Ms.offscreen}if(mi.iconFeatureIndex&&(xc=mi.iconFeatureIndex),mi.iconBox){const Rt=jt=>this.collisionIndex.placeCollisionBox(jt,Mr,hn,tr,xr,an,Vr,Ft,Tt.predicate,Fa,mn&&As?As:void 0);uu&&uu.placeable&&mi.verticalIconBox?(Es=Rt(mi.verticalIconBox),$s=Es.placeable):(Es=Rt(mi.iconBox),$s=Es.placeable),Ws=Ws&&Es.offscreen}const Ye=Pt||li.numHorizontalGlyphVertices===0&&li.numVerticalGlyphVertices===0,pt=qt||li.numIconVertices===0;Ye||pt?pt?Ye||($s=$s&&Wo):Wo=$s&&Wo:$s=Wo=$s&&Wo;const Lt=$s&&Es.placeable;if(Wo&&Kl.placeable&&this.collisionIndex.insertCollisionBox(Kl.box,zt,Ze.get("text-ignore-placement"),je.bucketInstanceId,uu&&uu.placeable&&Wu?Wu:Mu,Tt.ID),Lt&&this.collisionIndex.insertCollisionBox(Es.box,Mr,Ze.get("icon-ignore-placement"),je.bucketInstanceId,xc,Tt.ID),Ms&&Wo&&this.collisionIndex.insertCollisionCircles(Ms.circles,zt,Ze.get("text-ignore-placement"),je.bucketInstanceId,Mu,Tt.ID),Ne&&this.storeCollisionData(je.bucketInstanceId,no,mi,Kl,Es,Ms),li.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(je.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[li.crossTileID]=new ma(Wo||Gn,$s||oa,Ws||je.justReloaded),ce[li.crossTileID]=!0};if(zn){if(I.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const li=je.getSortedSymbolIndexes(this.transform.angle);for(let mi=li.length-1;mi>=0;--mi){const no=li[mi];vi(je.symbolInstances.get(no),je.collisionArrays[no],no)}}else for(let li=I.symbolInstanceStart;li=0&&(I.text.placedSymbolArray.get(Ft).crossTileID=Ze>=0&&Ft!==Ze?0:Ne.crossTileID)}markUsedOrientation(I,ce,Ne){const je=ce===t.ah.horizontal||ce===t.ah.horizontalOnly?ce:0,Ze=ce===t.ah.vertical?ce:0,kt=[Ne.leftJustifiedTextSymbolIndex,Ne.centerJustifiedTextSymbolIndex,Ne.rightJustifiedTextSymbolIndex];for(const Ft of kt)I.text.placedSymbolArray.get(Ft).placedOrientation=je;Ne.verticalPlacedTextSymbolIndex&&(I.text.placedSymbolArray.get(Ne.verticalPlacedTextSymbolIndex).placedOrientation=Ze)}commit(I){this.commitTime=I,this.zoomAtLastRecencyCheck=this.transform.zoom;const ce=this.prevPlacement;let Ne=!1;this.prevZoomAdjustment=ce?ce.zoomAdjustment(this.transform.zoom):0;const je=ce?ce.symbolFadeChange(I):1,Ze=ce?ce.opacities:{},kt=ce?ce.variableOffsets:{},Ft=ce?ce.placedOrientations:{};for(const tr in this.placements){const xr=this.placements[tr],Or=Ze[tr];Or?(this.opacities[tr]=new va(Or,je,xr.text,xr.icon),Ne=Ne||xr.text!==Or.text.placed||xr.icon!==Or.icon.placed):(this.opacities[tr]=new va(null,je,xr.text,xr.icon,xr.skipFade),Ne=Ne||xr.text||xr.icon)}for(const tr in Ze){const xr=Ze[tr];if(!this.opacities[tr]){const Or=new va(xr,je,!1,!1);Or.isHidden()||(this.opacities[tr]=Or,Ne=Ne||xr.text.placed||xr.icon.placed)}}for(const tr in kt)this.variableOffsets[tr]||!this.opacities[tr]||this.opacities[tr].isHidden()||(this.variableOffsets[tr]=kt[tr]);for(const tr in Ft)this.placedOrientations[tr]||!this.opacities[tr]||this.opacities[tr].isHidden()||(this.placedOrientations[tr]=Ft[tr]);if(ce&&ce.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Ne?this.lastPlacementChangeTime=I:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ce?ce.lastPlacementChangeTime:I)}updateLayerOpacities(I,ce){const Ne={};for(const je of ce){const Ze=je.getBucket(I);Ze&&je.latestFeatureIndex&&I.id===Ze.layerIds[0]&&this.updateBucketOpacities(Ze,je.tileID,Ne,je.collisionBoxArray)}}updateBucketOpacities(I,ce,Ne,je){I.hasTextData()&&(I.text.opacityVertexArray.clear(),I.text.hasVisibleVertices=!1),I.hasIconData()&&(I.icon.opacityVertexArray.clear(),I.icon.hasVisibleVertices=!1),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexArray.clear(),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexArray.clear();const Ze=I.layers[0],kt=Ze.layout,Ft=new va(null,0,!1,!1,!0),tr=kt.get("text-allow-overlap"),xr=kt.get("icon-allow-overlap"),Or=Ze._unevaluatedLayout.hasValue("text-variable-anchor")||Ze._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Ur=kt.get("text-rotation-alignment")==="map",hn=kt.get("text-pitch-alignment")==="map",Cn=kt.get("icon-text-fit")!=="none",ot=new va(null,0,tr&&(xr||!I.hasIconData()||kt.get("icon-optional")),xr&&(tr||!I.hasTextData()||kt.get("text-optional")),!0);!I.collisionArrays&&je&&(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData())&&I.deserializeCollisionBoxes(je);const dt=(Pt,qt,zt)=>{for(let Xt=0;Xt0,an=this.placedOrientations[qt.crossTileID],mn=an===t.ah.vertical,zn=an===t.ah.horizontal||an===t.ah.horizontalOnly;if(zt>0||Xt>0){const oa=Ma(Rr.text);dt(I.text,zt,mn?Da:oa),dt(I.text,Xt,zn?Da:oa);const Fa=Rr.text.isHidden();[qt.rightJustifiedTextSymbolIndex,qt.centerJustifiedTextSymbolIndex,qt.leftJustifiedTextSymbolIndex].forEach(mi=>{mi>=0&&(I.text.placedSymbolArray.get(mi).hidden=Fa||mn?1:0)}),qt.verticalPlacedTextSymbolIndex>=0&&(I.text.placedSymbolArray.get(qt.verticalPlacedTextSymbolIndex).hidden=Fa||zn?1:0);const vi=this.variableOffsets[qt.crossTileID];vi&&this.markUsedJustification(I,vi.anchor,qt,an);const li=this.placedOrientations[qt.crossTileID];li&&(this.markUsedJustification(I,"left",qt,li),this.markUsedOrientation(I,li,qt))}if(Vr){const oa=Ma(Rr.icon),Fa=!(Cn&&qt.verticalPlacedIconSymbolIndex&&mn);qt.placedIconSymbolIndex>=0&&(dt(I.icon,qt.numIconVertices,Fa?oa:Da),I.icon.placedSymbolArray.get(qt.placedIconSymbolIndex).hidden=Rr.icon.isHidden()),qt.verticalPlacedIconSymbolIndex>=0&&(dt(I.icon,qt.numVerticalIconVertices,Fa?Da:oa),I.icon.placedSymbolArray.get(qt.verticalPlacedIconSymbolIndex).hidden=Rr.icon.isHidden())}const Gn=Tt&&Tt.has(Pt)?Tt.get(Pt):{text:null,icon:null};if(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData()){const oa=I.collisionArrays[Pt];if(oa){let Fa=new t.P(0,0);if(oa.textBox||oa.verticalTextBox){let vi=!0;if(Or){const li=this.variableOffsets[Mr];li?(Fa=gr(li.anchor,li.width,li.height,li.textOffset,li.textBoxScale),Ur&&Fa._rotate(hn?this.transform.angle:-this.transform.angle)):vi=!1}if(oa.textBox||oa.verticalTextBox){let li;oa.textBox&&(li=mn),oa.verticalTextBox&&(li=zn),vr(I.textCollisionBox.collisionVertexArray,Rr.text.placed,!vi||li,Gn.text,Fa.x,Fa.y)}}if(oa.iconBox||oa.verticalIconBox){const vi=!!(!zn&&oa.verticalIconBox);let li;oa.iconBox&&(li=vi),oa.verticalIconBox&&(li=!vi),vr(I.iconCollisionBox.collisionVertexArray,Rr.icon.placed,li,Gn.icon,Cn?Fa.x:0,Cn?Fa.y:0)}}}}if(I.sortFeatures(this.transform.angle),this.retainedQueryData[I.bucketInstanceId]&&(this.retainedQueryData[I.bucketInstanceId].featureSortOrder=I.featureSortOrder),I.hasTextData()&&I.text.opacityVertexBuffer&&I.text.opacityVertexBuffer.updateData(I.text.opacityVertexArray),I.hasIconData()&&I.icon.opacityVertexBuffer&&I.icon.opacityVertexBuffer.updateData(I.icon.opacityVertexArray),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexBuffer&&I.iconCollisionBox.collisionVertexBuffer.updateData(I.iconCollisionBox.collisionVertexArray),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexBuffer&&I.textCollisionBox.collisionVertexBuffer.updateData(I.textCollisionBox.collisionVertexArray),I.text.opacityVertexArray.length!==I.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${I.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${I.text.layoutVertexArray.length}) / 4`);if(I.icon.opacityVertexArray.length!==I.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${I.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${I.icon.layoutVertexArray.length}) / 4`);if(I.bucketInstanceId in this.collisionCircleArrays){const Pt=this.collisionCircleArrays[I.bucketInstanceId];I.placementInvProjMatrix=Pt.invProjMatrix,I.placementViewportMatrix=Pt.viewportMatrix,I.collisionCircleArray=Pt.circles,delete this.collisionCircleArrays[I.bucketInstanceId]}}symbolFadeChange(I){return this.fadeDuration===0?1:(I-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(I){return Math.max(0,(this.transform.zoom-I)/1.5)}hasTransitions(I){return this.stale||I-this.lastPlacementChangeTimeI}setStale(){this.stale=!0}}function vr(Je,I,ce,Ne,je,Ze){Ne&&Ne.length!==0||(Ne=[0,0,0,0]);const kt=Ne[0]-Yr,Ft=Ne[1]-Yr,tr=Ne[2]-Yr,xr=Ne[3]-Yr;Je.emplaceBack(I?1:0,ce?1:0,je||0,Ze||0,kt,Ft),Je.emplaceBack(I?1:0,ce?1:0,je||0,Ze||0,tr,Ft),Je.emplaceBack(I?1:0,ce?1:0,je||0,Ze||0,tr,xr),Je.emplaceBack(I?1:0,ce?1:0,je||0,Ze||0,kt,xr)}const _r=Math.pow(2,25),rn=Math.pow(2,24),gn=Math.pow(2,17),Mn=Math.pow(2,16),In=Math.pow(2,9),fa=Math.pow(2,8),Ca=Math.pow(2,1);function Ma(Je){if(Je.opacity===0&&!Je.placed)return 0;if(Je.opacity===1&&Je.placed)return 4294967295;const I=Je.placed?1:0,ce=Math.floor(127*Je.opacity);return ce*_r+I*rn+ce*gn+I*Mn+ce*In+I*fa+ce*Ca+I}const Da=0;function Va(){return{isOccluded:(Je,I,ce)=>!1,getPitchedTextCorrection:(Je,I,ce)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(Je,I,ce,Ne){throw new Error("Not implemented.")},translatePosition:(Je,I,ce,Ne)=>function(je,Ze,kt,Ft,tr=!1){if(!kt[0]&&!kt[1])return[0,0];const xr=tr?Ft==="map"?je.angle:0:Ft==="viewport"?-je.angle:0;if(xr){const Or=Math.sin(xr),Ur=Math.cos(xr);kt=[kt[0]*Ur-kt[1]*Or,kt[0]*Or+kt[1]*Ur]}return[tr?kt[0]:ua(Ze,kt[0],je.zoom),tr?kt[1]:ua(Ze,kt[1],je.zoom)]}(Je,I,ce,Ne),getCircleRadiusCorrection:Je=>1}}class na{constructor(I){this._sortAcrossTiles=I.layout.get("symbol-z-order")!=="viewport-y"&&!I.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(I,ce,Ne,je,Ze){const kt=this._bucketParts;for(;this._currentTileIndexFt.sortKey-tr.sortKey));this._currentPartIndex!this._forceFullPlacement&&i.now()-je>2;for(;this._currentPlacementIndex>=0;){const kt=ce[I[this._currentPlacementIndex]],Ft=this.placement.collisionIndex.transform.zoom;if(kt.type==="symbol"&&(!kt.minzoom||kt.minzoom<=Ft)&&(!kt.maxzoom||kt.maxzoom>Ft)){if(this._inProgressLayer||(this._inProgressLayer=new na(kt)),this._inProgressLayer.continuePlacement(Ne[kt.source],this.placement,this._showCollisionBoxes,kt,Ze))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(I){return this.placement.commit(I),this.placement}}const Oi=512/t.X/2;class Vt{constructor(I,ce,Ne){this.tileID=I,this.bucketInstanceId=Ne,this._symbolsByKey={};const je=new Map;for(let Ze=0;Ze({x:Math.floor(tr.anchorX*Oi),y:Math.floor(tr.anchorY*Oi)})),crossTileIDs:kt.map(tr=>tr.crossTileID)};if(Ft.positions.length>128){const tr=new t.av(Ft.positions.length,16,Uint16Array);for(const{x:xr,y:Or}of Ft.positions)tr.add(xr,Or);tr.finish(),delete Ft.positions,Ft.index=tr}this._symbolsByKey[Ze]=Ft}}getScaledCoordinates(I,ce){const{x:Ne,y:je,z:Ze}=this.tileID.canonical,{x:kt,y:Ft,z:tr}=ce.canonical,xr=Oi/Math.pow(2,tr-Ze),Or=(Ft*t.X+I.anchorY)*xr,Ur=je*t.X*Oi;return{x:Math.floor((kt*t.X+I.anchorX)*xr-Ne*t.X*Oi),y:Math.floor(Or-Ur)}}findMatches(I,ce,Ne){const je=this.tileID.canonical.zI)}}class Ct{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Br{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(I){const ce=Math.round((I-this.lng)/360);if(ce!==0)for(const Ne in this.indexes){const je=this.indexes[Ne],Ze={};for(const kt in je){const Ft=je[kt];Ft.tileID=Ft.tileID.unwrapTo(Ft.tileID.wrap+ce),Ze[Ft.tileID.key]=Ft}this.indexes[Ne]=Ze}this.lng=I}addBucket(I,ce,Ne){if(this.indexes[I.overscaledZ]&&this.indexes[I.overscaledZ][I.key]){if(this.indexes[I.overscaledZ][I.key].bucketInstanceId===ce.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(I.overscaledZ,this.indexes[I.overscaledZ][I.key])}for(let Ze=0;ZeI.overscaledZ)for(const Ft in kt){const tr=kt[Ft];tr.tileID.isChildOf(I)&&tr.findMatches(ce.symbolInstances,I,je)}else{const Ft=kt[I.scaledTo(Number(Ze)).key];Ft&&Ft.findMatches(ce.symbolInstances,I,je)}}for(let Ze=0;Ze{ce[Ne]=!0});for(const Ne in this.layerIndexes)ce[Ne]||delete this.layerIndexes[Ne]}}const Qr=(Je,I)=>t.t(Je,I&&I.filter(ce=>ce.identifier!=="source.canvas")),Gr=t.aw();class Jr extends t.E{constructor(I,ce={}){super(),this._rtlPluginLoaded=()=>{for(const Ne in this.sourceCaches){const je=this.sourceCaches[Ne].getSource().type;je!=="vector"&&je!=="geojson"||this.sourceCaches[Ne].reload()}},this.map=I,this.dispatcher=new se(ae(),I._getMapId()),this.dispatcher.registerMessageHandler("GG",(Ne,je)=>this.getGlyphs(Ne,je)),this.dispatcher.registerMessageHandler("GI",(Ne,je)=>this.getImages(Ne,je)),this.imageManager=new y,this.imageManager.setEventedParent(this),this.glyphManager=new N(I._requestManager,ce.localIdeographFontFamily),this.lineAtlas=new J(256,512),this.crossTileSymbolIndex=new Kr,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()),_t().on(ze,this._rtlPluginLoaded),this.on("data",Ne=>{if(Ne.dataType!=="source"||Ne.sourceDataType!=="metadata")return;const je=this.sourceCaches[Ne.sourceId];if(!je)return;const Ze=je.getSource();if(Ze&&Ze.vectorLayerIds)for(const kt in this._layers){const Ft=this._layers[kt];Ft.source===Ze.id&&this._validateLayer(Ft)}})}loadURL(I,ce={},Ne){this.fire(new t.k("dataloading",{dataType:"style"})),ce.validate=typeof ce.validate!="boolean"||ce.validate;const je=this.map._requestManager.transformRequest(I,"Style");this._loadStyleRequest=new AbortController;const Ze=this._loadStyleRequest;t.h(je,this._loadStyleRequest).then(kt=>{this._loadStyleRequest=null,this._load(kt.data,ce,Ne)}).catch(kt=>{this._loadStyleRequest=null,kt&&!Ze.signal.aborted&&this.fire(new t.j(kt))})}loadJSON(I,ce={},Ne){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,ce.validate=ce.validate!==!1,this._load(I,ce,Ne)}).catch(()=>{})}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(Gr,{validate:!1})}_load(I,ce,Ne){var je;const Ze=ce.transformStyle?ce.transformStyle(Ne,I):I;if(!ce.validate||!Qr(this,t.u(Ze))){this._loaded=!0,this.stylesheet=Ze;for(const kt in Ze.sources)this.addSource(kt,Ze.sources[kt],{validate:!1});Ze.sprite?this._loadSprite(Ze.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Ze.glyphs),this._createLayers(),this.light=new D(this.stylesheet.light),this.sky=new q(this.stylesheet.sky),this.map.setTerrain((je=this.stylesheet.terrain)!==null&&je!==void 0?je:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){const I=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",I),this._order=I.map(ce=>ce.id),this._layers={},this._serializedLayers=null;for(const ce of I){const Ne=t.aA(ce);Ne.setEventedParent(this,{layer:{id:ce.id}}),this._layers[ce.id]=Ne}}_loadSprite(I,ce=!1,Ne=void 0){let je;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(Ze,kt,Ft,tr){return t._(this,void 0,void 0,function*(){const xr=w(Ze),Or=Ft>1?"@2x":"",Ur={},hn={};for(const{id:Cn,url:ot}of xr){const dt=kt.transformRequest(m(ot,Or,".json"),"SpriteJSON");Ur[Cn]=t.h(dt,tr);const Tt=kt.transformRequest(m(ot,Or,".png"),"SpriteImage");hn[Cn]=l.getImage(Tt,tr)}return yield Promise.all([...Object.values(Ur),...Object.values(hn)]),function(Cn,ot){return t._(this,void 0,void 0,function*(){const dt={};for(const Tt in Cn){dt[Tt]={};const Pt=i.getImageCanvasContext((yield ot[Tt]).data),qt=(yield Cn[Tt]).data;for(const zt in qt){const{width:Xt,height:Mr,x:Rr,y:Vr,sdf:an,pixelRatio:mn,stretchX:zn,stretchY:Gn,content:oa,textFitWidth:Fa,textFitHeight:vi}=qt[zt];dt[Tt][zt]={data:null,pixelRatio:mn,sdf:an,stretchX:zn,stretchY:Gn,content:oa,textFitWidth:Fa,textFitHeight:vi,spriteData:{width:Xt,height:Mr,x:Rr,y:Vr,context:Pt}}}}return dt})}(Ur,hn)})}(I,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Ze=>{if(this._spriteRequest=null,Ze)for(const kt in Ze){this._spritesImagesIds[kt]=[];const Ft=this._spritesImagesIds[kt]?this._spritesImagesIds[kt].filter(tr=>!(tr in Ze)):[];for(const tr of Ft)this.imageManager.removeImage(tr),this._changedImages[tr]=!0;for(const tr in Ze[kt]){const xr=kt==="default"?tr:`${kt}:${tr}`;this._spritesImagesIds[kt].push(xr),xr in this.imageManager.images?this.imageManager.updateImage(xr,Ze[kt][tr],!1):this.imageManager.addImage(xr,Ze[kt][tr]),ce&&(this._changedImages[xr]=!0)}}}).catch(Ze=>{this._spriteRequest=null,je=Ze,this.fire(new t.j(je))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),ce&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),Ne&&Ne(je)})}_unloadSprite(){for(const I of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(I),this._changedImages[I]=!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(I){const ce=this.sourceCaches[I.source];if(!ce)return;const Ne=I.sourceLayer;if(!Ne)return;const je=ce.getSource();(je.type==="geojson"||je.vectorLayerIds&&je.vectorLayerIds.indexOf(Ne)===-1)&&this.fire(new t.j(new Error(`Source layer "${Ne}" does not exist on source "${je.id}" as specified by style layer "${I.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const I in this.sourceCaches)if(!this.sourceCaches[I].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(I,ce=!1){const Ne=this._serializedAllLayers();if(!I||I.length===0)return Object.values(ce?t.aB(Ne):Ne);const je=[];for(const Ze of I)if(Ne[Ze]){const kt=ce?t.aB(Ne[Ze]):Ne[Ze];je.push(kt)}return je}_serializedAllLayers(){let I=this._serializedLayers;if(I)return I;I=this._serializedLayers={};const ce=Object.keys(this._layers);for(const Ne of ce){const je=this._layers[Ne];je.type!=="custom"&&(I[Ne]=je.serialize())}return I}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const I in this.sourceCaches)if(this.sourceCaches[I].hasTransition())return!0;for(const I in this._layers)if(this._layers[I].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(I){if(!this._loaded)return;const ce=this._changed;if(ce){const je=Object.keys(this._updatedLayers),Ze=Object.keys(this._removedLayers);(je.length||Ze.length)&&this._updateWorkerLayers(je,Ze);for(const kt in this._updatedSources){const Ft=this._updatedSources[kt];if(Ft==="reload")this._reloadSource(kt);else{if(Ft!=="clear")throw new Error(`Invalid action ${Ft}`);this._clearSource(kt)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const kt in this._updatedPaintProps)this._layers[kt].updateTransitions(I);this.light.updateTransitions(I),this.sky.updateTransitions(I),this._resetUpdates()}const Ne={};for(const je in this.sourceCaches){const Ze=this.sourceCaches[je];Ne[je]=Ze.used,Ze.used=!1}for(const je of this._order){const Ze=this._layers[je];Ze.recalculate(I,this._availableImages),!Ze.isHidden(I.zoom)&&Ze.source&&(this.sourceCaches[Ze.source].used=!0)}for(const je in Ne){const Ze=this.sourceCaches[je];!!Ne[je]!=!!Ze.used&&Ze.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:je}))}this.light.recalculate(I),this.sky.recalculate(I),this.z=I.zoom,ce&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const I=Object.keys(this._changedImages);if(I.length){for(const ce in this.sourceCaches)this.sourceCaches[ce].reloadTilesForDependencies(["icons","patterns"],I);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const I in this.sourceCaches)this.sourceCaches[I].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(I,ce){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(I,!1),removedIds:ce})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(I,ce={}){var Ne;this._checkLoaded();const je=this.serialize();if(I=ce.transformStyle?ce.transformStyle(je,I):I,((Ne=ce.validate)===null||Ne===void 0||Ne)&&Qr(this,t.u(I)))return!1;(I=t.aB(I)).layers=t.az(I.layers);const Ze=t.aC(je,I),kt=this._getOperationsToPerform(Ze);if(kt.unimplemented.length>0)throw new Error(`Unimplemented: ${kt.unimplemented.join(", ")}.`);if(kt.operations.length===0)return!1;for(const Ft of kt.operations)Ft();return this.stylesheet=I,this._serializedLayers=null,!0}_getOperationsToPerform(I){const ce=[],Ne=[];for(const je of I)switch(je.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":ce.push(()=>this.addLayer.apply(this,je.args));break;case"removeLayer":ce.push(()=>this.removeLayer.apply(this,je.args));break;case"setPaintProperty":ce.push(()=>this.setPaintProperty.apply(this,je.args));break;case"setLayoutProperty":ce.push(()=>this.setLayoutProperty.apply(this,je.args));break;case"setFilter":ce.push(()=>this.setFilter.apply(this,je.args));break;case"addSource":ce.push(()=>this.addSource.apply(this,je.args));break;case"removeSource":ce.push(()=>this.removeSource.apply(this,je.args));break;case"setLayerZoomRange":ce.push(()=>this.setLayerZoomRange.apply(this,je.args));break;case"setLight":ce.push(()=>this.setLight.apply(this,je.args));break;case"setGeoJSONSourceData":ce.push(()=>this.setGeoJSONSourceData.apply(this,je.args));break;case"setGlyphs":ce.push(()=>this.setGlyphs.apply(this,je.args));break;case"setSprite":ce.push(()=>this.setSprite.apply(this,je.args));break;case"setSky":ce.push(()=>this.setSky.apply(this,je.args));break;case"setTerrain":ce.push(()=>this.map.setTerrain.apply(this,je.args));break;case"setTransition":ce.push(()=>{});break;default:Ne.push(je.command)}return{operations:ce,unimplemented:Ne}}addImage(I,ce){if(this.getImage(I))return this.fire(new t.j(new Error(`An image named "${I}" already exists.`)));this.imageManager.addImage(I,ce),this._afterImageUpdated(I)}updateImage(I,ce){this.imageManager.updateImage(I,ce)}getImage(I){return this.imageManager.getImage(I)}removeImage(I){if(!this.getImage(I))return this.fire(new t.j(new Error(`An image named "${I}" does not exist.`)));this.imageManager.removeImage(I),this._afterImageUpdated(I)}_afterImageUpdated(I){this._availableImages=this.imageManager.listImages(),this._changedImages[I]=!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(I,ce,Ne={}){if(this._checkLoaded(),this.sourceCaches[I]!==void 0)throw new Error(`Source "${I}" already exists.`);if(!ce.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(ce).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(ce.type)>=0&&this._validate(t.u.source,`sources.${I}`,ce,null,Ne))return;this.map&&this.map._collectResourceTiming&&(ce.collectResourceTiming=!0);const je=this.sourceCaches[I]=new Yt(I,ce,this.dispatcher);je.style=this,je.setEventedParent(this,()=>({isSourceLoaded:je.loaded(),source:je.serialize(),sourceId:I})),je.onAdd(this.map),this._changed=!0}removeSource(I){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error("There is no source with this ID");for(const Ne in this._layers)if(this._layers[Ne].source===I)return this.fire(new t.j(new Error(`Source "${I}" cannot be removed while layer "${Ne}" is using it.`)));const ce=this.sourceCaches[I];delete this.sourceCaches[I],delete this._updatedSources[I],ce.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:I})),ce.setEventedParent(null),ce.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(I,ce){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error(`There is no source with this ID=${I}`);const Ne=this.sourceCaches[I].getSource();if(Ne.type!=="geojson")throw new Error(`geojsonSource.type is ${Ne.type}, which is !== 'geojson`);Ne.setData(ce),this._changed=!0}getSource(I){return this.sourceCaches[I]&&this.sourceCaches[I].getSource()}addLayer(I,ce,Ne={}){this._checkLoaded();const je=I.id;if(this.getLayer(je))return void this.fire(new t.j(new Error(`Layer "${je}" already exists on this map.`)));let Ze;if(I.type==="custom"){if(Qr(this,t.aD(I)))return;Ze=t.aA(I)}else{if("source"in I&&typeof I.source=="object"&&(this.addSource(je,I.source),I=t.aB(I),I=t.e(I,{source:je})),this._validate(t.u.layer,`layers.${je}`,I,{arrayIndex:-1},Ne))return;Ze=t.aA(I),this._validateLayer(Ze),Ze.setEventedParent(this,{layer:{id:je}})}const kt=ce?this._order.indexOf(ce):this._order.length;if(ce&&kt===-1)this.fire(new t.j(new Error(`Cannot add layer "${je}" before non-existing layer "${ce}".`)));else{if(this._order.splice(kt,0,je),this._layerOrderChanged=!0,this._layers[je]=Ze,this._removedLayers[je]&&Ze.source&&Ze.type!=="custom"){const Ft=this._removedLayers[je];delete this._removedLayers[je],Ft.type!==Ze.type?this._updatedSources[Ze.source]="clear":(this._updatedSources[Ze.source]="reload",this.sourceCaches[Ze.source].pause())}this._updateLayer(Ze),Ze.onAdd&&Ze.onAdd(this.map)}}moveLayer(I,ce){if(this._checkLoaded(),this._changed=!0,!this._layers[I])return void this.fire(new t.j(new Error(`The layer '${I}' does not exist in the map's style and cannot be moved.`)));if(I===ce)return;const Ne=this._order.indexOf(I);this._order.splice(Ne,1);const je=ce?this._order.indexOf(ce):this._order.length;ce&&je===-1?this.fire(new t.j(new Error(`Cannot move layer "${I}" before non-existing layer "${ce}".`))):(this._order.splice(je,0,I),this._layerOrderChanged=!0)}removeLayer(I){this._checkLoaded();const ce=this._layers[I];if(!ce)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${I}".`)));ce.setEventedParent(null);const Ne=this._order.indexOf(I);this._order.splice(Ne,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[I]=ce,delete this._layers[I],this._serializedLayers&&delete this._serializedLayers[I],delete this._updatedLayers[I],delete this._updatedPaintProps[I],ce.onRemove&&ce.onRemove(this.map)}getLayer(I){return this._layers[I]}getLayersOrder(){return[...this._order]}hasLayer(I){return I in this._layers}setLayerZoomRange(I,ce,Ne){this._checkLoaded();const je=this.getLayer(I);je?je.minzoom===ce&&je.maxzoom===Ne||(ce!=null&&(je.minzoom=ce),Ne!=null&&(je.maxzoom=Ne),this._updateLayer(je)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${I}".`)))}setFilter(I,ce,Ne={}){this._checkLoaded();const je=this.getLayer(I);if(je){if(!t.aE(je.filter,ce))return ce==null?(je.filter=void 0,void this._updateLayer(je)):void(this._validate(t.u.filter,`layers.${je.id}.filter`,ce,null,Ne)||(je.filter=t.aB(ce),this._updateLayer(je)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${I}".`)))}getFilter(I){return t.aB(this.getLayer(I).filter)}setLayoutProperty(I,ce,Ne,je={}){this._checkLoaded();const Ze=this.getLayer(I);Ze?t.aE(Ze.getLayoutProperty(ce),Ne)||(Ze.setLayoutProperty(ce,Ne,je),this._updateLayer(Ze)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${I}".`)))}getLayoutProperty(I,ce){const Ne=this.getLayer(I);if(Ne)return Ne.getLayoutProperty(ce);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${I}".`)))}setPaintProperty(I,ce,Ne,je={}){this._checkLoaded();const Ze=this.getLayer(I);Ze?t.aE(Ze.getPaintProperty(ce),Ne)||(Ze.setPaintProperty(ce,Ne,je)&&this._updateLayer(Ze),this._changed=!0,this._updatedPaintProps[I]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${I}".`)))}getPaintProperty(I,ce){return this.getLayer(I).getPaintProperty(ce)}setFeatureState(I,ce){this._checkLoaded();const Ne=I.source,je=I.sourceLayer,Ze=this.sourceCaches[Ne];if(Ze===void 0)return void this.fire(new t.j(new Error(`The source '${Ne}' does not exist in the map's style.`)));const kt=Ze.getSource().type;kt==="geojson"&&je?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):kt!=="vector"||je?(I.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Ze.setFeatureState(je,I.id,ce)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(I,ce){this._checkLoaded();const Ne=I.source,je=this.sourceCaches[Ne];if(je===void 0)return void this.fire(new t.j(new Error(`The source '${Ne}' does not exist in the map's style.`)));const Ze=je.getSource().type,kt=Ze==="vector"?I.sourceLayer:void 0;Ze!=="vector"||kt?ce&&typeof I.id!="string"&&typeof I.id!="number"?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):je.removeFeatureState(kt,I.id,ce):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(I){this._checkLoaded();const ce=I.source,Ne=I.sourceLayer,je=this.sourceCaches[ce];if(je!==void 0)return je.getSource().type!=="vector"||Ne?(I.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),je.getFeatureState(Ne,I.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 '${ce}' 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 I=t.aF(this.sourceCaches,Ze=>Ze.serialize()),ce=this._serializeByIds(this._order,!0),Ne=this.map.getTerrain()||void 0,je=this.stylesheet;return t.aG({version:je.version,name:je.name,metadata:je.metadata,light:je.light,sky:je.sky,center:je.center,zoom:je.zoom,bearing:je.bearing,pitch:je.pitch,sprite:je.sprite,glyphs:je.glyphs,transition:je.transition,sources:I,layers:ce,terrain:Ne},Ze=>Ze!==void 0)}_updateLayer(I){this._updatedLayers[I.id]=!0,I.source&&!this._updatedSources[I.source]&&this.sourceCaches[I.source].getSource().type!=="raster"&&(this._updatedSources[I.source]="reload",this.sourceCaches[I.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(I){const ce=kt=>this._layers[kt].type==="fill-extrusion",Ne={},je=[];for(let kt=this._order.length-1;kt>=0;kt--){const Ft=this._order[kt];if(ce(Ft)){Ne[Ft]=kt;for(const tr of I){const xr=tr[Ft];if(xr)for(const Or of xr)je.push(Or)}}}je.sort((kt,Ft)=>Ft.intersectionZ-kt.intersectionZ);const Ze=[];for(let kt=this._order.length-1;kt>=0;kt--){const Ft=this._order[kt];if(ce(Ft))for(let tr=je.length-1;tr>=0;tr--){const xr=je[tr].feature;if(Ne[xr.layer.id]{const an=Pt.featureSortOrder;if(an){const mn=an.indexOf(Rr.featureIndex);return an.indexOf(Vr.featureIndex)-mn}return Vr.featureIndex-Rr.featureIndex});for(const Rr of Mr)Xt.push(Rr)}}for(const Pt in ot)ot[Pt].forEach(qt=>{const zt=qt.feature,Xt=xr[Ft[Pt].source].getFeatureState(zt.layer["source-layer"],zt.id);zt.source=zt.layer.source,zt.layer["source-layer"]&&(zt.sourceLayer=zt.layer["source-layer"]),zt.state=Xt});return ot}(this._layers,kt,this.sourceCaches,I,ce,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Ze)}querySourceFeatures(I,ce){ce&&ce.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",ce.filter,null,ce);const Ne=this.sourceCaches[I];return Ne?function(je,Ze){const kt=je.getRenderableIds().map(xr=>je.getTileByID(xr)),Ft=[],tr={};for(let xr=0;xrhn.getTileByID(Cn)).sort((Cn,ot)=>ot.tileID.overscaledZ-Cn.tileID.overscaledZ||(Cn.tileID.isLessThan(ot.tileID)?-1:1))}const Ur=this.crossTileSymbolIndex.addLayer(Or,tr[Or.source],I.center.lng);kt=kt||Ur}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Ze=Ze||this._layerOrderChanged||Ne===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.now(),I.zoom))&&(this.pauseablePlacement=new Mi(I,this.map.terrain,this._order,Ze,ce,Ne,je,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,tr),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),Ft=!0),kt&&this.pauseablePlacement.placement.setStale()),Ft||kt)for(const xr of this._order){const Or=this._layers[xr];Or.type==="symbol"&&this.placement.updateLayerOpacities(Or,tr[Or.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.now())}_releaseSymbolFadeTiles(){for(const I in this.sourceCaches)this.sourceCaches[I].releaseSymbolFadeTiles()}getImages(I,ce){return t._(this,void 0,void 0,function*(){const Ne=yield this.imageManager.getImages(ce.icons);this._updateTilesForChangedImages();const je=this.sourceCaches[ce.source];return je&&je.setDependencies(ce.tileID.key,ce.type,ce.icons),Ne})}getGlyphs(I,ce){return t._(this,void 0,void 0,function*(){const Ne=yield this.glyphManager.getGlyphs(ce.stacks),je=this.sourceCaches[ce.source];return je&&je.setDependencies(ce.tileID.key,ce.type,[""]),Ne})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(I,ce={}){this._checkLoaded(),I&&this._validate(t.u.glyphs,"glyphs",I,null,ce)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=I,this.glyphManager.entries={},this.glyphManager.setURL(I))}addSprite(I,ce,Ne={},je){this._checkLoaded();const Ze=[{id:I,url:ce}],kt=[...w(this.stylesheet.sprite),...Ze];this._validate(t.u.sprite,"sprite",kt,null,Ne)||(this.stylesheet.sprite=kt,this._loadSprite(Ze,!0,je))}removeSprite(I){this._checkLoaded();const ce=w(this.stylesheet.sprite);if(ce.find(Ne=>Ne.id===I)){if(this._spritesImagesIds[I])for(const Ne of this._spritesImagesIds[I])this.imageManager.removeImage(Ne),this._changedImages[Ne]=!0;ce.splice(ce.findIndex(Ne=>Ne.id===I),1),this.stylesheet.sprite=ce.length>0?ce:void 0,delete this._spritesImagesIds[I],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 "${I}" doesn't exists on this map.`)))}getSprite(){return w(this.stylesheet.sprite)}setSprite(I,ce={},Ne){this._checkLoaded(),I&&this._validate(t.u.sprite,"sprite",I,null,ce)||(this.stylesheet.sprite=I,I?this._loadSprite(I,!0,Ne):(this._unloadSprite(),Ne&&Ne(null)))}}var yn=t.Y([{name:"a_pos",type:"Int16",components:2}]);const cn={prelude:Dt(`#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:Dt(`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:Dt(`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:Dt(`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:Dt("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:Dt(`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:Dt(`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:Dt("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:Dt("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:Dt("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:Dt(`#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:Dt(`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:Dt(`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:Dt(`#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:Dt(`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:Dt(`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:Dt(`#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:Dt(`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:Dt(`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:Dt(`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:Dt(`#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:Dt(`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:Dt(`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:Dt(`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:Dt(`#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:Dt(`#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:Dt("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:Dt("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:Dt("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:Dt("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 Dt(Je,I){const ce=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Ne=I.match(/attribute ([\w]+) ([\w]+)/g),je=Je.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ze=I.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),kt=Ze?Ze.concat(je):je,Ft={};return{fragmentSource:Je=Je.replace(ce,(tr,xr,Or,Ur,hn)=>(Ft[hn]=!0,xr==="define"?` #ifndef HAS_UNIFORM_u_${hn} varying ${Or} ${Ur} ${hn}; #else uniform ${Or} ${Ur} u_${hn}; #endif `:` #ifdef HAS_UNIFORM_u_${hn} ${Or} ${Ur} ${hn} = u_${hn}; #endif `)),vertexSource:I=I.replace(ce,(tr,xr,Or,Ur,hn)=>{const Cn=Ur==="float"?"vec2":"vec4",ot=hn.match(/color/)?"color":Cn;return Ft[hn]?xr==="define"?` #ifndef HAS_UNIFORM_u_${hn} uniform lowp float u_${hn}_t; attribute ${Or} ${Cn} a_${hn}; varying ${Or} ${Ur} ${hn}; #else uniform ${Or} ${Ur} u_${hn}; #endif `:ot==="vec4"?` #ifndef HAS_UNIFORM_u_${hn} ${hn} = a_${hn}; #else ${Or} ${Ur} ${hn} = u_${hn}; #endif `:` #ifndef HAS_UNIFORM_u_${hn} ${hn} = unpack_mix_${ot}(a_${hn}, u_${hn}_t); #else ${Or} ${Ur} ${hn} = u_${hn}; #endif `:xr==="define"?` #ifndef HAS_UNIFORM_u_${hn} uniform lowp float u_${hn}_t; attribute ${Or} ${Cn} a_${hn}; #else uniform ${Or} ${Ur} u_${hn}; #endif `:ot==="vec4"?` #ifndef HAS_UNIFORM_u_${hn} ${Or} ${Ur} ${hn} = a_${hn}; #else ${Or} ${Ur} ${hn} = u_${hn}; #endif `:` #ifndef HAS_UNIFORM_u_${hn} ${Or} ${Ur} ${hn} = unpack_mix_${ot}(a_${hn}, u_${hn}_t); #else ${Or} ${Ur} ${hn} = u_${hn}; #endif `}),staticAttributes:Ne,staticUniforms:kt}}class yr{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(I,ce,Ne,je,Ze,kt,Ft,tr,xr){this.context=I;let Or=this.boundPaintVertexBuffers.length!==je.length;for(let Ur=0;!Or&&Ur({u_matrix:Je,u_texture:0,u_ele_delta:I,u_fog_matrix:ce,u_fog_color:Ne?Ne.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:Ne?Ne.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Ne?Ne.calculateFogBlendOpacity(je):0,u_horizon_color:Ne?Ne.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:Ne?Ne.properties.get("horizon-fog-blend"):1});function _n(Je){const I=[];for(let ce=0;ce({u_depth:new t.aH(Rr,Vr.u_depth),u_terrain:new t.aH(Rr,Vr.u_terrain),u_terrain_dim:new t.aI(Rr,Vr.u_terrain_dim),u_terrain_matrix:new t.aJ(Rr,Vr.u_terrain_matrix),u_terrain_unpack:new t.aK(Rr,Vr.u_terrain_unpack),u_terrain_exaggeration:new t.aI(Rr,Vr.u_terrain_exaggeration)}))(I,Mr),this.binderUniforms=Ne?Ne.getUniforms(I,Mr):[]}draw(I,ce,Ne,je,Ze,kt,Ft,tr,xr,Or,Ur,hn,Cn,ot,dt,Tt,Pt,qt){const zt=I.gl;if(this.failedToCreate)return;if(I.program.set(this.program),I.setDepthMode(Ne),I.setStencilMode(je),I.setColorMode(Ze),I.setCullFace(kt),tr){I.activeTexture.set(zt.TEXTURE2),zt.bindTexture(zt.TEXTURE_2D,tr.depthTexture),I.activeTexture.set(zt.TEXTURE3),zt.bindTexture(zt.TEXTURE_2D,tr.texture);for(const Mr in this.terrainUniforms)this.terrainUniforms[Mr].set(tr[Mr])}for(const Mr in this.fixedUniforms)this.fixedUniforms[Mr].set(Ft[Mr]);dt&&dt.setUniforms(I,this.binderUniforms,Cn,{zoom:ot});let Xt=0;switch(ce){case zt.LINES:Xt=2;break;case zt.TRIANGLES:Xt=3;break;case zt.LINE_STRIP:Xt=1}for(const Mr of hn.get()){const Rr=Mr.vaos||(Mr.vaos={});(Rr[xr]||(Rr[xr]=new yr)).bind(I,this,Or,dt?dt.getPaintVertexBuffers():[],Ur,Mr.vertexOffset,Tt,Pt,qt),zt.drawElements(ce,Mr.primitiveLength*Xt,zt.UNSIGNED_SHORT,Mr.primitiveOffset*Xt*2)}}}function ea(Je,I,ce){const Ne=1/ua(ce,1,I.transform.tileZoom),je=Math.pow(2,ce.tileID.overscaledZ),Ze=ce.tileSize*Math.pow(2,I.transform.tileZoom)/je,kt=Ze*(ce.tileID.canonical.x+ce.tileID.wrap*je),Ft=Ze*ce.tileID.canonical.y;return{u_image:0,u_texsize:ce.imageAtlasTexture.size,u_scale:[Ne,Je.fromScale,Je.toScale],u_fade:Je.t,u_pixel_coord_upper:[kt>>16,Ft>>16],u_pixel_coord_lower:[65535&kt,65535&Ft]}}const Qn=(Je,I,ce,Ne)=>{const je=I.style.light,Ze=je.properties.get("position"),kt=[Ze.x,Ze.y,Ze.z],Ft=function(){var xr=new t.A(9);return t.A!=Float32Array&&(xr[1]=0,xr[2]=0,xr[3]=0,xr[5]=0,xr[6]=0,xr[7]=0),xr[0]=1,xr[4]=1,xr[8]=1,xr}();je.properties.get("anchor")==="viewport"&&function(xr,Or){var Ur=Math.sin(Or),hn=Math.cos(Or);xr[0]=hn,xr[1]=Ur,xr[2]=0,xr[3]=-Ur,xr[4]=hn,xr[5]=0,xr[6]=0,xr[7]=0,xr[8]=1}(Ft,-I.transform.angle),function(xr,Or,Ur){var hn=Or[0],Cn=Or[1],ot=Or[2];xr[0]=hn*Ur[0]+Cn*Ur[3]+ot*Ur[6],xr[1]=hn*Ur[1]+Cn*Ur[4]+ot*Ur[7],xr[2]=hn*Ur[2]+Cn*Ur[5]+ot*Ur[8]}(kt,kt,Ft);const tr=je.properties.get("color");return{u_matrix:Je,u_lightpos:kt,u_lightintensity:je.properties.get("intensity"),u_lightcolor:[tr.r,tr.g,tr.b],u_vertical_gradient:+ce,u_opacity:Ne}},bn=(Je,I,ce,Ne,je,Ze,kt)=>t.e(Qn(Je,I,ce,Ne),ea(Ze,I,kt),{u_height_factor:-Math.pow(2,je.overscaledZ)/kt.tileSize/8}),$n=Je=>({u_matrix:Je}),ki=(Je,I,ce,Ne)=>t.e($n(Je),ea(ce,I,Ne)),Ua=(Je,I)=>({u_matrix:Je,u_world:I}),Fi=(Je,I,ce,Ne,je)=>t.e(ki(Je,I,ce,Ne),{u_world:je}),Ji=(Je,I,ce,Ne)=>{const je=Je.transform;let Ze,kt;if(Ne.paint.get("circle-pitch-alignment")==="map"){const Ft=ua(ce,1,je.zoom);Ze=!0,kt=[Ft,Ft]}else Ze=!1,kt=je.pixelsToGLUnits;return{u_camera_to_center_distance:je.cameraToCenterDistance,u_scale_with_map:+(Ne.paint.get("circle-pitch-scale")==="map"),u_matrix:Je.translatePosMatrix(I.posMatrix,ce,Ne.paint.get("circle-translate"),Ne.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ze,u_device_pixel_ratio:Je.pixelRatio,u_extrude_scale:kt}},fo=(Je,I,ce)=>({u_matrix:Je,u_inv_matrix:I,u_camera_to_center_distance:ce.cameraToCenterDistance,u_viewport_size:[ce.width,ce.height]}),co=(Je,I,ce=1)=>({u_matrix:Je,u_color:I,u_overlay:0,u_overlay_scale:ce}),So=Je=>({u_matrix:Je}),wi=(Je,I,ce,Ne)=>({u_matrix:Je,u_extrude_scale:ua(I,1,ce),u_intensity:Ne}),ts=(Je,I,ce,Ne)=>{const je=t.H();t.aP(je,0,Je.width,Je.height,0,0,1);const Ze=Je.context.gl;return{u_matrix:je,u_world:[Ze.drawingBufferWidth,Ze.drawingBufferHeight],u_image:ce,u_color_ramp:Ne,u_opacity:I.paint.get("heatmap-opacity")}};function jo(Je,I){const ce=Math.pow(2,I.canonical.z),Ne=I.canonical.y;return[new t.Z(0,Ne/ce).toLngLat().lat,new t.Z(0,(Ne+1)/ce).toLngLat().lat]}const js=(Je,I,ce,Ne)=>{const je=Je.transform;return{u_matrix:Ns(Je,I,ce,Ne),u_ratio:1/ua(I,1,je.zoom),u_device_pixel_ratio:Je.pixelRatio,u_units_to_pixels:[1/je.pixelsToGLUnits[0],1/je.pixelsToGLUnits[1]]}},us=(Je,I,ce,Ne,je)=>t.e(js(Je,I,ce,je),{u_image:0,u_image_height:Ne}),Zo=(Je,I,ce,Ne,je)=>{const Ze=Je.transform,kt=Vs(I,Ze);return{u_matrix:Ns(Je,I,ce,je),u_texsize:I.imageAtlasTexture.size,u_ratio:1/ua(I,1,Ze.zoom),u_device_pixel_ratio:Je.pixelRatio,u_image:0,u_scale:[kt,Ne.fromScale,Ne.toScale],u_fade:Ne.t,u_units_to_pixels:[1/Ze.pixelsToGLUnits[0],1/Ze.pixelsToGLUnits[1]]}},No=(Je,I,ce,Ne,je,Ze)=>{const kt=Je.lineAtlas,Ft=Vs(I,Je.transform),tr=ce.layout.get("line-cap")==="round",xr=kt.getDash(Ne.from,tr),Or=kt.getDash(Ne.to,tr),Ur=xr.width*je.fromScale,hn=Or.width*je.toScale;return t.e(js(Je,I,ce,Ze),{u_patternscale_a:[Ft/Ur,-xr.height/2],u_patternscale_b:[Ft/hn,-Or.height/2],u_sdfgamma:kt.width/(256*Math.min(Ur,hn)*Je.pixelRatio)/2,u_image:0,u_tex_y_a:xr.y,u_tex_y_b:Or.y,u_mix:je.t})};function Vs(Je,I){return 1/ua(Je,1,I.tileZoom)}function Ns(Je,I,ce,Ne){return Je.translatePosMatrix(Ne?Ne.posMatrix:I.tileID.posMatrix,I,ce.paint.get("line-translate"),ce.paint.get("line-translate-anchor"))}const rl=(Je,I,ce,Ne,je)=>{return{u_matrix:Je,u_tl_parent:I,u_scale_parent:ce,u_buffer_scale:1,u_fade_t:Ne.mix,u_opacity:Ne.opacity*je.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:je.paint.get("raster-brightness-min"),u_brightness_high:je.paint.get("raster-brightness-max"),u_saturation_factor:(kt=je.paint.get("raster-saturation"),kt>0?1-1/(1.001-kt):-kt),u_contrast_factor:(Ze=je.paint.get("raster-contrast"),Ze>0?1/(1-Ze):1+Ze),u_spin_weights:cs(je.paint.get("raster-hue-rotate"))};var Ze,kt};function cs(Je){Je*=Math.PI/180;const I=Math.sin(Je),ce=Math.cos(Je);return[(2*ce+1)/3,(-Math.sqrt(3)*I-ce+1)/3,(Math.sqrt(3)*I-ce+1)/3]}const $o=(Je,I,ce,Ne,je,Ze,kt,Ft,tr,xr,Or,Ur,hn,Cn)=>{const ot=kt.transform;return{u_is_size_zoom_constant:+(Je==="constant"||Je==="source"),u_is_size_feature_constant:+(Je==="constant"||Je==="camera"),u_size_t:I?I.uSizeT:0,u_size:I?I.uSize:0,u_camera_to_center_distance:ot.cameraToCenterDistance,u_pitch:ot.pitch/360*2*Math.PI,u_rotate_symbol:+ce,u_aspect_ratio:ot.width/ot.height,u_fade_change:kt.options.fadeDuration?kt.symbolFadeChange:1,u_matrix:Ft,u_label_plane_matrix:tr,u_coord_matrix:xr,u_is_text:+Ur,u_pitch_with_map:+Ne,u_is_along_line:je,u_is_variable_anchor:Ze,u_texsize:hn,u_texture:0,u_translation:Or,u_pitched_scale:Cn}},yo=(Je,I,ce,Ne,je,Ze,kt,Ft,tr,xr,Or,Ur,hn,Cn,ot)=>{const dt=kt.transform;return t.e($o(Je,I,ce,Ne,je,Ze,kt,Ft,tr,xr,Or,Ur,hn,ot),{u_gamma_scale:Ne?Math.cos(dt._pitch)*dt.cameraToCenterDistance:1,u_device_pixel_ratio:kt.pixelRatio,u_is_halo:1})},fs=(Je,I,ce,Ne,je,Ze,kt,Ft,tr,xr,Or,Ur,hn,Cn)=>t.e(yo(Je,I,ce,Ne,je,Ze,kt,Ft,tr,xr,Or,!0,Ur,!0,Cn),{u_texsize_icon:hn,u_texture_icon:1}),nl=(Je,I,ce)=>({u_matrix:Je,u_opacity:I,u_color:ce}),wl=(Je,I,ce,Ne,je,Ze)=>t.e(function(kt,Ft,tr,xr){const Or=tr.imageManager.getPattern(kt.from.toString()),Ur=tr.imageManager.getPattern(kt.to.toString()),{width:hn,height:Cn}=tr.imageManager.getPixelSize(),ot=Math.pow(2,xr.tileID.overscaledZ),dt=xr.tileSize*Math.pow(2,tr.transform.tileZoom)/ot,Tt=dt*(xr.tileID.canonical.x+xr.tileID.wrap*ot),Pt=dt*xr.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:Or.tl,u_pattern_br_a:Or.br,u_pattern_tl_b:Ur.tl,u_pattern_br_b:Ur.br,u_texsize:[hn,Cn],u_mix:Ft.t,u_pattern_size_a:Or.displaySize,u_pattern_size_b:Ur.displaySize,u_scale_a:Ft.fromScale,u_scale_b:Ft.toScale,u_tile_units_to_pixels:1/ua(xr,1,tr.transform.tileZoom),u_pixel_coord_upper:[Tt>>16,Pt>>16],u_pixel_coord_lower:[65535&Tt,65535&Pt]}}(Ne,Ze,ce,je),{u_matrix:Je,u_opacity:I}),Ml={fillExtrusion:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_lightpos:new t.aN(Je,I.u_lightpos),u_lightintensity:new t.aI(Je,I.u_lightintensity),u_lightcolor:new t.aN(Je,I.u_lightcolor),u_vertical_gradient:new t.aI(Je,I.u_vertical_gradient),u_opacity:new t.aI(Je,I.u_opacity)}),fillExtrusionPattern:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_lightpos:new t.aN(Je,I.u_lightpos),u_lightintensity:new t.aI(Je,I.u_lightintensity),u_lightcolor:new t.aN(Je,I.u_lightcolor),u_vertical_gradient:new t.aI(Je,I.u_vertical_gradient),u_height_factor:new t.aI(Je,I.u_height_factor),u_image:new t.aH(Je,I.u_image),u_texsize:new t.aO(Je,I.u_texsize),u_pixel_coord_upper:new t.aO(Je,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Je,I.u_pixel_coord_lower),u_scale:new t.aN(Je,I.u_scale),u_fade:new t.aI(Je,I.u_fade),u_opacity:new t.aI(Je,I.u_opacity)}),fill:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix)}),fillPattern:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_image:new t.aH(Je,I.u_image),u_texsize:new t.aO(Je,I.u_texsize),u_pixel_coord_upper:new t.aO(Je,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Je,I.u_pixel_coord_lower),u_scale:new t.aN(Je,I.u_scale),u_fade:new t.aI(Je,I.u_fade)}),fillOutline:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_world:new t.aO(Je,I.u_world)}),fillOutlinePattern:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_world:new t.aO(Je,I.u_world),u_image:new t.aH(Je,I.u_image),u_texsize:new t.aO(Je,I.u_texsize),u_pixel_coord_upper:new t.aO(Je,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Je,I.u_pixel_coord_lower),u_scale:new t.aN(Je,I.u_scale),u_fade:new t.aI(Je,I.u_fade)}),circle:(Je,I)=>({u_camera_to_center_distance:new t.aI(Je,I.u_camera_to_center_distance),u_scale_with_map:new t.aH(Je,I.u_scale_with_map),u_pitch_with_map:new t.aH(Je,I.u_pitch_with_map),u_extrude_scale:new t.aO(Je,I.u_extrude_scale),u_device_pixel_ratio:new t.aI(Je,I.u_device_pixel_ratio),u_matrix:new t.aJ(Je,I.u_matrix)}),collisionBox:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_pixel_extrude_scale:new t.aO(Je,I.u_pixel_extrude_scale)}),collisionCircle:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_inv_matrix:new t.aJ(Je,I.u_inv_matrix),u_camera_to_center_distance:new t.aI(Je,I.u_camera_to_center_distance),u_viewport_size:new t.aO(Je,I.u_viewport_size)}),debug:(Je,I)=>({u_color:new t.aL(Je,I.u_color),u_matrix:new t.aJ(Je,I.u_matrix),u_overlay:new t.aH(Je,I.u_overlay),u_overlay_scale:new t.aI(Je,I.u_overlay_scale)}),clippingMask:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix)}),heatmap:(Je,I)=>({u_extrude_scale:new t.aI(Je,I.u_extrude_scale),u_intensity:new t.aI(Je,I.u_intensity),u_matrix:new t.aJ(Je,I.u_matrix)}),heatmapTexture:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_world:new t.aO(Je,I.u_world),u_image:new t.aH(Je,I.u_image),u_color_ramp:new t.aH(Je,I.u_color_ramp),u_opacity:new t.aI(Je,I.u_opacity)}),hillshade:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_image:new t.aH(Je,I.u_image),u_latrange:new t.aO(Je,I.u_latrange),u_light:new t.aO(Je,I.u_light),u_shadow:new t.aL(Je,I.u_shadow),u_highlight:new t.aL(Je,I.u_highlight),u_accent:new t.aL(Je,I.u_accent)}),hillshadePrepare:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_image:new t.aH(Je,I.u_image),u_dimension:new t.aO(Je,I.u_dimension),u_zoom:new t.aI(Je,I.u_zoom),u_unpack:new t.aK(Je,I.u_unpack)}),line:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_ratio:new t.aI(Je,I.u_ratio),u_device_pixel_ratio:new t.aI(Je,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Je,I.u_units_to_pixels)}),lineGradient:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_ratio:new t.aI(Je,I.u_ratio),u_device_pixel_ratio:new t.aI(Je,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Je,I.u_units_to_pixels),u_image:new t.aH(Je,I.u_image),u_image_height:new t.aI(Je,I.u_image_height)}),linePattern:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_texsize:new t.aO(Je,I.u_texsize),u_ratio:new t.aI(Je,I.u_ratio),u_device_pixel_ratio:new t.aI(Je,I.u_device_pixel_ratio),u_image:new t.aH(Je,I.u_image),u_units_to_pixels:new t.aO(Je,I.u_units_to_pixels),u_scale:new t.aN(Je,I.u_scale),u_fade:new t.aI(Je,I.u_fade)}),lineSDF:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_ratio:new t.aI(Je,I.u_ratio),u_device_pixel_ratio:new t.aI(Je,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(Je,I.u_units_to_pixels),u_patternscale_a:new t.aO(Je,I.u_patternscale_a),u_patternscale_b:new t.aO(Je,I.u_patternscale_b),u_sdfgamma:new t.aI(Je,I.u_sdfgamma),u_image:new t.aH(Je,I.u_image),u_tex_y_a:new t.aI(Je,I.u_tex_y_a),u_tex_y_b:new t.aI(Je,I.u_tex_y_b),u_mix:new t.aI(Je,I.u_mix)}),raster:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_tl_parent:new t.aO(Je,I.u_tl_parent),u_scale_parent:new t.aI(Je,I.u_scale_parent),u_buffer_scale:new t.aI(Je,I.u_buffer_scale),u_fade_t:new t.aI(Je,I.u_fade_t),u_opacity:new t.aI(Je,I.u_opacity),u_image0:new t.aH(Je,I.u_image0),u_image1:new t.aH(Je,I.u_image1),u_brightness_low:new t.aI(Je,I.u_brightness_low),u_brightness_high:new t.aI(Je,I.u_brightness_high),u_saturation_factor:new t.aI(Je,I.u_saturation_factor),u_contrast_factor:new t.aI(Je,I.u_contrast_factor),u_spin_weights:new t.aN(Je,I.u_spin_weights)}),symbolIcon:(Je,I)=>({u_is_size_zoom_constant:new t.aH(Je,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Je,I.u_is_size_feature_constant),u_size_t:new t.aI(Je,I.u_size_t),u_size:new t.aI(Je,I.u_size),u_camera_to_center_distance:new t.aI(Je,I.u_camera_to_center_distance),u_pitch:new t.aI(Je,I.u_pitch),u_rotate_symbol:new t.aH(Je,I.u_rotate_symbol),u_aspect_ratio:new t.aI(Je,I.u_aspect_ratio),u_fade_change:new t.aI(Je,I.u_fade_change),u_matrix:new t.aJ(Je,I.u_matrix),u_label_plane_matrix:new t.aJ(Je,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(Je,I.u_coord_matrix),u_is_text:new t.aH(Je,I.u_is_text),u_pitch_with_map:new t.aH(Je,I.u_pitch_with_map),u_is_along_line:new t.aH(Je,I.u_is_along_line),u_is_variable_anchor:new t.aH(Je,I.u_is_variable_anchor),u_texsize:new t.aO(Je,I.u_texsize),u_texture:new t.aH(Je,I.u_texture),u_translation:new t.aO(Je,I.u_translation),u_pitched_scale:new t.aI(Je,I.u_pitched_scale)}),symbolSDF:(Je,I)=>({u_is_size_zoom_constant:new t.aH(Je,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Je,I.u_is_size_feature_constant),u_size_t:new t.aI(Je,I.u_size_t),u_size:new t.aI(Je,I.u_size),u_camera_to_center_distance:new t.aI(Je,I.u_camera_to_center_distance),u_pitch:new t.aI(Je,I.u_pitch),u_rotate_symbol:new t.aH(Je,I.u_rotate_symbol),u_aspect_ratio:new t.aI(Je,I.u_aspect_ratio),u_fade_change:new t.aI(Je,I.u_fade_change),u_matrix:new t.aJ(Je,I.u_matrix),u_label_plane_matrix:new t.aJ(Je,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(Je,I.u_coord_matrix),u_is_text:new t.aH(Je,I.u_is_text),u_pitch_with_map:new t.aH(Je,I.u_pitch_with_map),u_is_along_line:new t.aH(Je,I.u_is_along_line),u_is_variable_anchor:new t.aH(Je,I.u_is_variable_anchor),u_texsize:new t.aO(Je,I.u_texsize),u_texture:new t.aH(Je,I.u_texture),u_gamma_scale:new t.aI(Je,I.u_gamma_scale),u_device_pixel_ratio:new t.aI(Je,I.u_device_pixel_ratio),u_is_halo:new t.aH(Je,I.u_is_halo),u_translation:new t.aO(Je,I.u_translation),u_pitched_scale:new t.aI(Je,I.u_pitched_scale)}),symbolTextAndIcon:(Je,I)=>({u_is_size_zoom_constant:new t.aH(Je,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(Je,I.u_is_size_feature_constant),u_size_t:new t.aI(Je,I.u_size_t),u_size:new t.aI(Je,I.u_size),u_camera_to_center_distance:new t.aI(Je,I.u_camera_to_center_distance),u_pitch:new t.aI(Je,I.u_pitch),u_rotate_symbol:new t.aH(Je,I.u_rotate_symbol),u_aspect_ratio:new t.aI(Je,I.u_aspect_ratio),u_fade_change:new t.aI(Je,I.u_fade_change),u_matrix:new t.aJ(Je,I.u_matrix),u_label_plane_matrix:new t.aJ(Je,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(Je,I.u_coord_matrix),u_is_text:new t.aH(Je,I.u_is_text),u_pitch_with_map:new t.aH(Je,I.u_pitch_with_map),u_is_along_line:new t.aH(Je,I.u_is_along_line),u_is_variable_anchor:new t.aH(Je,I.u_is_variable_anchor),u_texsize:new t.aO(Je,I.u_texsize),u_texsize_icon:new t.aO(Je,I.u_texsize_icon),u_texture:new t.aH(Je,I.u_texture),u_texture_icon:new t.aH(Je,I.u_texture_icon),u_gamma_scale:new t.aI(Je,I.u_gamma_scale),u_device_pixel_ratio:new t.aI(Je,I.u_device_pixel_ratio),u_is_halo:new t.aH(Je,I.u_is_halo),u_translation:new t.aO(Je,I.u_translation),u_pitched_scale:new t.aI(Je,I.u_pitched_scale)}),background:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_opacity:new t.aI(Je,I.u_opacity),u_color:new t.aL(Je,I.u_color)}),backgroundPattern:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_opacity:new t.aI(Je,I.u_opacity),u_image:new t.aH(Je,I.u_image),u_pattern_tl_a:new t.aO(Je,I.u_pattern_tl_a),u_pattern_br_a:new t.aO(Je,I.u_pattern_br_a),u_pattern_tl_b:new t.aO(Je,I.u_pattern_tl_b),u_pattern_br_b:new t.aO(Je,I.u_pattern_br_b),u_texsize:new t.aO(Je,I.u_texsize),u_mix:new t.aI(Je,I.u_mix),u_pattern_size_a:new t.aO(Je,I.u_pattern_size_a),u_pattern_size_b:new t.aO(Je,I.u_pattern_size_b),u_scale_a:new t.aI(Je,I.u_scale_a),u_scale_b:new t.aI(Je,I.u_scale_b),u_pixel_coord_upper:new t.aO(Je,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(Je,I.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(Je,I.u_tile_units_to_pixels)}),terrain:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_texture:new t.aH(Je,I.u_texture),u_ele_delta:new t.aI(Je,I.u_ele_delta),u_fog_matrix:new t.aJ(Je,I.u_fog_matrix),u_fog_color:new t.aL(Je,I.u_fog_color),u_fog_ground_blend:new t.aI(Je,I.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(Je,I.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(Je,I.u_horizon_color),u_horizon_fog_blend:new t.aI(Je,I.u_horizon_fog_blend)}),terrainDepth:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_ele_delta:new t.aI(Je,I.u_ele_delta)}),terrainCoords:(Je,I)=>({u_matrix:new t.aJ(Je,I.u_matrix),u_texture:new t.aH(Je,I.u_texture),u_terrain_coords_id:new t.aI(Je,I.u_terrain_coords_id),u_ele_delta:new t.aI(Je,I.u_ele_delta)}),sky:(Je,I)=>({u_sky_color:new t.aL(Je,I.u_sky_color),u_horizon_color:new t.aL(Je,I.u_horizon_color),u_horizon:new t.aI(Je,I.u_horizon),u_sky_horizon_blend:new t.aI(Je,I.u_sky_horizon_blend)})};class Ts{constructor(I,ce,Ne){this.context=I;const je=I.gl;this.buffer=je.createBuffer(),this.dynamicDraw=!!Ne,this.context.unbindVAO(),I.bindElementBuffer.set(this.buffer),je.bufferData(je.ELEMENT_ARRAY_BUFFER,ce.arrayBuffer,this.dynamicDraw?je.DYNAMIC_DRAW:je.STATIC_DRAW),this.dynamicDraw||delete ce.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(I){const ce=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),ce.bufferSubData(ce.ELEMENT_ARRAY_BUFFER,0,I.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ai={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class uo{constructor(I,ce,Ne,je){this.length=ce.length,this.attributes=Ne,this.itemSize=ce.bytesPerElement,this.dynamicDraw=je,this.context=I;const Ze=I.gl;this.buffer=Ze.createBuffer(),I.bindVertexBuffer.set(this.buffer),Ze.bufferData(Ze.ARRAY_BUFFER,ce.arrayBuffer,this.dynamicDraw?Ze.DYNAMIC_DRAW:Ze.STATIC_DRAW),this.dynamicDraw||delete ce.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(I){if(I.length!==this.length)throw new Error(`Length of new data is ${I.length}, which doesn't match current length of ${this.length}`);const ce=this.context.gl;this.bind(),ce.bufferSubData(ce.ARRAY_BUFFER,0,I.arrayBuffer)}enableAttributes(I,ce){for(let Ne=0;Ne0){const Rr=t.H();t.aQ(Rr,zt.placementInvProjMatrix,Je.transform.glCoordMatrix),t.aQ(Rr,Rr,zt.placementViewportMatrix),tr.push({circleArray:Mr,circleOffset:Or,transform:qt.posMatrix,invTransform:Rr,coord:qt}),xr+=Mr.length/4,Or=xr}Xt&&Ft.draw(Ze,kt.LINES,Rs.disabled,ul.disabled,Je.colorModeForRenderPass(),Do.disabled,{u_matrix:qt.posMatrix,u_pixel_extrude_scale:[1/(Ur=Je.transform).width,1/Ur.height]},Je.style.map.terrain&&Je.style.map.terrain.getTerrainData(qt),ce.id,Xt.layoutVertexBuffer,Xt.indexBuffer,Xt.segments,null,Je.transform.zoom,null,null,Xt.collisionVertexBuffer)}var Ur;if(!je||!tr.length)return;const hn=Je.useProgram("collisionCircle"),Cn=new t.aR;Cn.resize(4*xr),Cn._trim();let ot=0;for(const Pt of tr)for(let qt=0;qt=0&&(Pt[zt.associatedIconIndex]={shiftedAnchor:no,angle:To})}else Sr(zt.numGlyphs,dt)}if(xr){Tt.clear();const qt=Je.icon.placedSymbolArray;for(let zt=0;ztJe.style.map.terrain.getElevation(Gn,Nn,qa):null,Rn=ce.layout.get("text-rotation-alignment")==="map";Ue(Fa,Gn.posMatrix,Je,je,Wu,ke,Pt,xr,Rn,dt,Gn.toUnwrapped(),ot.width,ot.height,Ye,wn)}const Rt=Gn.posMatrix,jt=je&&an||Lt,cr=qt||jt?Cu:Wu,ur=xc,kr=mi&&ce.paint.get(je?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let on;on=mi?Fa.iconsInText?fs(no.kind,Wo,zt,Pt,qt,jt,Je,Rt,cr,ur,Ye,Ws,Kl,zn):yo(no.kind,Wo,zt,Pt,qt,jt,Je,Rt,cr,ur,Ye,je,Ws,!0,zn):$o(no.kind,Wo,zt,Pt,qt,jt,Je,Rt,cr,ur,Ye,je,Ws,zn);const nn={program:go,buffers:vi,uniformValues:on,atlasTexture:As,atlasTextureIcon:Ms,atlasInterpolation:Qs,atlasInterpolationIcon:uu,isSDF:mi,hasHalo:kr};if(Mr&&Fa.canOverlap){Rr=!0;const wn=vi.segments.get();for(const Rn of wn)mn.push({segments:new t.a0([Rn]),sortKey:Rn.sortKey,state:nn,terrainData:$s})}else mn.push({segments:vi.segments,sortKey:0,state:nn,terrainData:$s})}Rr&&mn.sort((Gn,oa)=>Gn.sortKey-oa.sortKey);for(const Gn of mn){const oa=Gn.state;if(hn.activeTexture.set(Cn.TEXTURE0),oa.atlasTexture.bind(oa.atlasInterpolation,Cn.CLAMP_TO_EDGE),oa.atlasTextureIcon&&(hn.activeTexture.set(Cn.TEXTURE1),oa.atlasTextureIcon&&oa.atlasTextureIcon.bind(oa.atlasInterpolationIcon,Cn.CLAMP_TO_EDGE)),oa.isSDF){const Fa=oa.uniformValues;oa.hasHalo&&(Fa.u_is_halo=1,fh(oa.buffers,Gn.segments,ce,Je,oa.program,Vr,Or,Ur,Fa,Gn.terrainData)),Fa.u_is_halo=0}fh(oa.buffers,Gn.segments,ce,Je,oa.program,Vr,Or,Ur,oa.uniformValues,Gn.terrainData)}}function fh(Je,I,ce,Ne,je,Ze,kt,Ft,tr,xr){const Or=Ne.context;je.draw(Or,Or.gl.TRIANGLES,Ze,kt,Ft,Do.disabled,tr,xr,ce.id,Je.layoutVertexBuffer,Je.indexBuffer,I,ce.paint,Ne.transform.zoom,Je.programConfigurations.get(ce.id),Je.dynamicLayoutVertexBuffer,Je.opacityVertexBuffer)}function Bf(Je,I,ce,Ne){const je=Je.context,Ze=je.gl,kt=ul.disabled,Ft=new ru([Ze.ONE,Ze.ONE],t.aM.transparent,[!0,!0,!0,!0]),tr=I.getBucket(ce);if(!tr)return;const xr=Ne.key;let Or=ce.heatmapFbos.get(xr);Or||(Or=ih(je,I.tileSize,I.tileSize),ce.heatmapFbos.set(xr,Or)),je.bindFramebuffer.set(Or.framebuffer),je.viewport.set([0,0,I.tileSize,I.tileSize]),je.clear({color:t.aM.transparent});const Ur=tr.programConfigurations.get(ce.id),hn=Je.useProgram("heatmap",Ur),Cn=Je.style.map.terrain.getTerrainData(Ne);hn.draw(je,Ze.TRIANGLES,Rs.disabled,kt,Ft,Do.disabled,wi(Ne.posMatrix,I,Je.transform.zoom,ce.paint.get("heatmap-intensity")),Cn,ce.id,tr.layoutVertexBuffer,tr.indexBuffer,tr.segments,ce.paint,Je.transform.zoom,Ur)}function vf(Je,I,ce){const Ne=Je.context,je=Ne.gl;Ne.setColorMode(Je.colorModeForRenderPass());const Ze=oh(Ne,I),kt=ce.key,Ft=I.heatmapFbos.get(kt);Ft&&(Ne.activeTexture.set(je.TEXTURE0),je.bindTexture(je.TEXTURE_2D,Ft.colorAttachment.get()),Ne.activeTexture.set(je.TEXTURE1),Ze.bind(je.LINEAR,je.CLAMP_TO_EDGE),Je.useProgram("heatmapTexture").draw(Ne,je.TRIANGLES,Rs.disabled,ul.disabled,Je.colorModeForRenderPass(),Do.disabled,ts(Je,I,0,1),null,I.id,Je.rasterBoundsBuffer,Je.quadTriangleIndexBuffer,Je.rasterBoundsSegments,I.paint,Je.transform.zoom),Ft.destroy(),I.heatmapFbos.delete(kt))}function ih(Je,I,ce){var Ne,je;const Ze=Je.gl,kt=Ze.createTexture();Ze.bindTexture(Ze.TEXTURE_2D,kt),Ze.texParameteri(Ze.TEXTURE_2D,Ze.TEXTURE_WRAP_S,Ze.CLAMP_TO_EDGE),Ze.texParameteri(Ze.TEXTURE_2D,Ze.TEXTURE_WRAP_T,Ze.CLAMP_TO_EDGE),Ze.texParameteri(Ze.TEXTURE_2D,Ze.TEXTURE_MIN_FILTER,Ze.LINEAR),Ze.texParameteri(Ze.TEXTURE_2D,Ze.TEXTURE_MAG_FILTER,Ze.LINEAR);const Ft=(Ne=Je.HALF_FLOAT)!==null&&Ne!==void 0?Ne:Ze.UNSIGNED_BYTE,tr=(je=Je.RGBA16F)!==null&&je!==void 0?je:Ze.RGBA;Ze.texImage2D(Ze.TEXTURE_2D,0,tr,I,ce,0,Ze.RGBA,Ft,null);const xr=Je.createFramebuffer(I,ce,!1,!1);return xr.colorAttachment.set(kt),xr}function oh(Je,I){return I.colorRampTexture||(I.colorRampTexture=new u(Je,I.colorRamp,Je.gl.RGBA)),I.colorRampTexture}function zc(Je,I,ce,Ne,je){if(!ce||!Ne||!Ne.imageAtlas)return;const Ze=Ne.imageAtlas.patternPositions;let kt=Ze[ce.to.toString()],Ft=Ze[ce.from.toString()];if(!kt&&Ft&&(kt=Ft),!Ft&&kt&&(Ft=kt),!kt||!Ft){const tr=je.getPaintProperty(I);kt=Ze[tr],Ft=Ze[tr]}kt&&Ft&&Je.setConstantPatternPositions(kt,Ft)}function hh(Je,I,ce,Ne,je,Ze,kt){const Ft=Je.context.gl,tr="fill-pattern",xr=ce.paint.get(tr),Or=xr&&xr.constantOr(1),Ur=ce.getCrossfadeParameters();let hn,Cn,ot,dt,Tt;kt?(Cn=Or&&!ce.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",hn=Ft.LINES):(Cn=Or?"fillPattern":"fill",hn=Ft.TRIANGLES);const Pt=xr.constantOr(null);for(const qt of Ne){const zt=I.getTile(qt);if(Or&&!zt.patternsLoaded())continue;const Xt=zt.getBucket(ce);if(!Xt)continue;const Mr=Xt.programConfigurations.get(ce.id),Rr=Je.useProgram(Cn,Mr),Vr=Je.style.map.terrain&&Je.style.map.terrain.getTerrainData(qt);Or&&(Je.context.activeTexture.set(Ft.TEXTURE0),zt.imageAtlasTexture.bind(Ft.LINEAR,Ft.CLAMP_TO_EDGE),Mr.updatePaintBuffers(Ur)),zc(Mr,tr,Pt,zt,ce);const an=Vr?qt:null,mn=Je.translatePosMatrix(an?an.posMatrix:qt.posMatrix,zt,ce.paint.get("fill-translate"),ce.paint.get("fill-translate-anchor"));if(kt){dt=Xt.indexBuffer2,Tt=Xt.segments2;const zn=[Ft.drawingBufferWidth,Ft.drawingBufferHeight];ot=Cn==="fillOutlinePattern"&&Or?Fi(mn,Je,Ur,zt,zn):Ua(mn,zn)}else dt=Xt.indexBuffer,Tt=Xt.segments,ot=Or?ki(mn,Je,Ur,zt):$n(mn);Rr.draw(Je.context,hn,je,Je.stencilModeForClipping(qt),Ze,Do.disabled,ot,Vr,ce.id,Xt.layoutVertexBuffer,dt,Tt,ce.paint,Je.transform.zoom,Mr)}}function nf(Je,I,ce,Ne,je,Ze,kt){const Ft=Je.context,tr=Ft.gl,xr="fill-extrusion-pattern",Or=ce.paint.get(xr),Ur=Or.constantOr(1),hn=ce.getCrossfadeParameters(),Cn=ce.paint.get("fill-extrusion-opacity"),ot=Or.constantOr(null);for(const dt of Ne){const Tt=I.getTile(dt),Pt=Tt.getBucket(ce);if(!Pt)continue;const qt=Je.style.map.terrain&&Je.style.map.terrain.getTerrainData(dt),zt=Pt.programConfigurations.get(ce.id),Xt=Je.useProgram(Ur?"fillExtrusionPattern":"fillExtrusion",zt);Ur&&(Je.context.activeTexture.set(tr.TEXTURE0),Tt.imageAtlasTexture.bind(tr.LINEAR,tr.CLAMP_TO_EDGE),zt.updatePaintBuffers(hn)),zc(zt,xr,ot,Tt,ce);const Mr=Je.translatePosMatrix(dt.posMatrix,Tt,ce.paint.get("fill-extrusion-translate"),ce.paint.get("fill-extrusion-translate-anchor")),Rr=ce.paint.get("fill-extrusion-vertical-gradient"),Vr=Ur?bn(Mr,Je,Rr,Cn,dt,hn,Tt):Qn(Mr,Je,Rr,Cn);Xt.draw(Ft,Ft.gl.TRIANGLES,je,Ze,kt,Do.backCCW,Vr,qt,ce.id,Pt.layoutVertexBuffer,Pt.indexBuffer,Pt.segments,ce.paint,Je.transform.zoom,zt,Je.style.map.terrain&&Pt.centroidVertexBuffer)}}function Gc(Je,I,ce,Ne,je,Ze,kt){const Ft=Je.context,tr=Ft.gl,xr=ce.fbo;if(!xr)return;const Or=Je.useProgram("hillshade"),Ur=Je.style.map.terrain&&Je.style.map.terrain.getTerrainData(I);Ft.activeTexture.set(tr.TEXTURE0),tr.bindTexture(tr.TEXTURE_2D,xr.colorAttachment.get()),Or.draw(Ft,tr.TRIANGLES,je,Ze,kt,Do.disabled,((hn,Cn,ot,dt)=>{const Tt=ot.paint.get("hillshade-shadow-color"),Pt=ot.paint.get("hillshade-highlight-color"),qt=ot.paint.get("hillshade-accent-color");let zt=ot.paint.get("hillshade-illumination-direction")*(Math.PI/180);ot.paint.get("hillshade-illumination-anchor")==="viewport"&&(zt-=hn.transform.angle);const Xt=!hn.options.moving;return{u_matrix:dt?dt.posMatrix:hn.transform.calculatePosMatrix(Cn.tileID.toUnwrapped(),Xt),u_image:0,u_latrange:jo(0,Cn.tileID),u_light:[ot.paint.get("hillshade-exaggeration"),zt],u_shadow:Tt,u_highlight:Pt,u_accent:qt}})(Je,ce,Ne,Ur?I:null),Ur,Ne.id,Je.rasterBoundsBuffer,Je.quadTriangleIndexBuffer,Je.rasterBoundsSegments)}function Bu(Je,I,ce,Ne,je,Ze){const kt=Je.context,Ft=kt.gl,tr=I.dem;if(tr&&tr.data){const xr=tr.dim,Or=tr.stride,Ur=tr.getPixels();if(kt.activeTexture.set(Ft.TEXTURE1),kt.pixelStoreUnpackPremultiplyAlpha.set(!1),I.demTexture=I.demTexture||Je.getTileTexture(Or),I.demTexture){const Cn=I.demTexture;Cn.update(Ur,{premultiply:!1}),Cn.bind(Ft.NEAREST,Ft.CLAMP_TO_EDGE)}else I.demTexture=new u(kt,Ur,Ft.RGBA,{premultiply:!1}),I.demTexture.bind(Ft.NEAREST,Ft.CLAMP_TO_EDGE);kt.activeTexture.set(Ft.TEXTURE0);let hn=I.fbo;if(!hn){const Cn=new u(kt,{width:xr,height:xr,data:null},Ft.RGBA);Cn.bind(Ft.LINEAR,Ft.CLAMP_TO_EDGE),hn=I.fbo=kt.createFramebuffer(xr,xr,!0,!1),hn.colorAttachment.set(Cn.texture)}kt.bindFramebuffer.set(hn.framebuffer),kt.viewport.set([0,0,xr,xr]),Je.useProgram("hillshadePrepare").draw(kt,Ft.TRIANGLES,Ne,je,Ze,Do.disabled,((Cn,ot)=>{const dt=ot.stride,Tt=t.H();return t.aP(Tt,0,t.X,-t.X,0,0,1),t.J(Tt,Tt,[0,-t.X,0]),{u_matrix:Tt,u_image:1,u_dimension:[dt,dt],u_zoom:Cn.overscaledZ,u_unpack:ot.getUnpackVector()}})(I.tileID,tr),null,ce.id,Je.rasterBoundsBuffer,Je.quadTriangleIndexBuffer,Je.rasterBoundsSegments),I.needsHillshadePrepare=!1}}function Af(Je,I,ce,Ne,je,Ze){const kt=Ne.paint.get("raster-fade-duration");if(!Ze&&kt>0){const Ft=i.now(),tr=(Ft-Je.timeAdded)/kt,xr=I?(Ft-I.timeAdded)/kt:-1,Or=ce.getSource(),Ur=je.coveringZoomLevel({tileSize:Or.tileSize,roundZoom:Or.roundZoom}),hn=!I||Math.abs(I.tileID.overscaledZ-Ur)>Math.abs(Je.tileID.overscaledZ-Ur),Cn=hn&&Je.refreshedUponExpiration?1:t.ac(hn?tr:1-xr,0,1);return Je.refreshedUponExpiration&&tr>=1&&(Je.refreshedUponExpiration=!1),I?{opacity:1,mix:1-Cn}:{opacity:Cn,mix:0}}return{opacity:1,mix:0}}const sh=new t.aM(1,0,0,1),Dl=new t.aM(0,1,0,1),$f=new t.aM(0,0,1,1),Oh=new t.aM(1,0,1,1),dh=new t.aM(0,1,1,1);function Uf(Je,I,ce,Ne){mc(Je,0,I+ce/2,Je.transform.width,ce,Ne)}function ph(Je,I,ce,Ne){mc(Je,I-ce/2,0,ce,Je.transform.height,Ne)}function mc(Je,I,ce,Ne,je,Ze){const kt=Je.context,Ft=kt.gl;Ft.enable(Ft.SCISSOR_TEST),Ft.scissor(I*Je.pixelRatio,ce*Je.pixelRatio,Ne*Je.pixelRatio,je*Je.pixelRatio),kt.clear({color:Ze}),Ft.disable(Ft.SCISSOR_TEST)}function vh(Je,I,ce){const Ne=Je.context,je=Ne.gl,Ze=ce.posMatrix,kt=Je.useProgram("debug"),Ft=Rs.disabled,tr=ul.disabled,xr=Je.colorModeForRenderPass(),Or="$debug",Ur=Je.style.map.terrain&&Je.style.map.terrain.getTerrainData(ce);Ne.activeTexture.set(je.TEXTURE0);const hn=I.getTileByID(ce.key).latestRawTileData,Cn=Math.floor((hn&&hn.byteLength||0)/1024),ot=I.getTile(ce).tileSize,dt=512/Math.min(ot,512)*(ce.overscaledZ/Je.transform.zoom)*.5;let Tt=ce.canonical.toString();ce.overscaledZ!==ce.canonical.z&&(Tt+=` => ${ce.overscaledZ}`),function(Pt,qt){Pt.initDebugOverlayCanvas();const zt=Pt.debugOverlayCanvas,Xt=Pt.context.gl,Mr=Pt.debugOverlayCanvas.getContext("2d");Mr.clearRect(0,0,zt.width,zt.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(qt,5,5),Mr.strokeText(qt,5,5),Pt.debugOverlayTexture.update(zt),Pt.debugOverlayTexture.bind(Xt.LINEAR,Xt.CLAMP_TO_EDGE)}(Je,`${Tt} ${Cn}kB`),kt.draw(Ne,je.TRIANGLES,Ft,tr,ru.alphaBlended,Do.disabled,co(Ze,t.aM.transparent,dt),null,Or,Je.debugBuffer,Je.quadTriangleIndexBuffer,Je.debugSegments),kt.draw(Ne,je.LINE_STRIP,Ft,tr,xr,Do.disabled,co(Ze,t.aM.red),Ur,Or,Je.debugBuffer,Je.tileBorderIndexBuffer,Je.debugSegments)}function du(Je,I,ce){const Ne=Je.context,je=Ne.gl,Ze=Je.colorModeForRenderPass(),kt=new Rs(je.LEQUAL,Rs.ReadWrite,Je.depthRangeFor3D),Ft=Je.useProgram("terrain"),tr=I.getTerrainMesh();Ne.bindFramebuffer.set(null),Ne.viewport.set([0,0,Je.width,Je.height]);for(const xr of ce){const Or=Je.renderToTexture.getTexture(xr),Ur=I.getTerrainData(xr.tileID);Ne.activeTexture.set(je.TEXTURE0),je.bindTexture(je.TEXTURE_2D,Or.texture);const hn=Je.transform.calculatePosMatrix(xr.tileID.toUnwrapped()),Cn=I.getMeshFrameDelta(Je.transform.zoom),ot=Je.transform.calculateFogMatrix(xr.tileID.toUnwrapped()),dt=Hr(hn,Cn,ot,Je.style.sky,Je.transform.pitch);Ft.draw(Ne,je.TRIANGLES,kt,ul.disabled,Ze,Do.backCCW,dt,Ur,"terrain",tr.vertexBuffer,tr.indexBuffer,tr.segments)}}class gc{constructor(I,ce,Ne){this.vertexBuffer=I,this.indexBuffer=ce,this.segments=Ne}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class mf{constructor(I,ce){this.context=new Rh(I),this.transform=ce,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Yt.maxUnderzooming+Yt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Kr}resize(I,ce,Ne){if(this.width=Math.floor(I*Ne),this.height=Math.floor(ce*Ne),this.pixelRatio=Ne,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const je of this.style._order)this.style._layers[je].resize()}setup(){const I=this.context,ce=new t.aX;ce.emplaceBack(0,0),ce.emplaceBack(t.X,0),ce.emplaceBack(0,t.X),ce.emplaceBack(t.X,t.X),this.tileExtentBuffer=I.createVertexBuffer(ce,yn.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);const Ne=new t.aX;Ne.emplaceBack(0,0),Ne.emplaceBack(t.X,0),Ne.emplaceBack(0,t.X),Ne.emplaceBack(t.X,t.X),this.debugBuffer=I.createVertexBuffer(Ne,yn.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);const je=new t.$;je.emplaceBack(0,0,0,0),je.emplaceBack(t.X,0,t.X,0),je.emplaceBack(0,t.X,0,t.X),je.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=I.createVertexBuffer(je,it.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);const Ze=new t.aX;Ze.emplaceBack(0,0),Ze.emplaceBack(1,0),Ze.emplaceBack(0,1),Ze.emplaceBack(1,1),this.viewportBuffer=I.createVertexBuffer(Ze,yn.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);const kt=new t.aZ;kt.emplaceBack(0),kt.emplaceBack(1),kt.emplaceBack(3),kt.emplaceBack(2),kt.emplaceBack(0),this.tileBorderIndexBuffer=I.createIndexBuffer(kt);const Ft=new t.aY;Ft.emplaceBack(0,1,2),Ft.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=I.createIndexBuffer(Ft);const tr=this.context.gl;this.stencilClearMode=new ul({func:tr.ALWAYS,mask:0},0,255,tr.ZERO,tr.ZERO,tr.ZERO)}clearStencil(){const I=this.context,ce=I.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const Ne=t.H();t.aP(Ne,0,this.width,this.height,0,0,1),t.K(Ne,Ne,[ce.drawingBufferWidth,ce.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(I,ce.TRIANGLES,Rs.disabled,this.stencilClearMode,ru.disabled,Do.disabled,So(Ne),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(I,ce){if(this.currentStencilSource===I.source||!I.isTileClipped()||!ce||!ce.length)return;this.currentStencilSource=I.source;const Ne=this.context,je=Ne.gl;this.nextStencilID+ce.length>256&&this.clearStencil(),Ne.setColorMode(ru.disabled),Ne.setDepthMode(Rs.disabled);const Ze=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const kt of ce){const Ft=this._tileClippingMaskIDs[kt.key]=this.nextStencilID++,tr=this.style.map.terrain&&this.style.map.terrain.getTerrainData(kt);Ze.draw(Ne,je.TRIANGLES,Rs.disabled,new ul({func:je.ALWAYS,mask:0},Ft,255,je.KEEP,je.KEEP,je.REPLACE),ru.disabled,Do.disabled,So(kt.posMatrix),tr,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const I=this.nextStencilID++,ce=this.context.gl;return new ul({func:ce.NOTEQUAL,mask:255},I,255,ce.KEEP,ce.KEEP,ce.REPLACE)}stencilModeForClipping(I){const ce=this.context.gl;return new ul({func:ce.EQUAL,mask:255},this._tileClippingMaskIDs[I.key],0,ce.KEEP,ce.KEEP,ce.REPLACE)}stencilConfigForOverlap(I){const ce=this.context.gl,Ne=I.sort((kt,Ft)=>Ft.overscaledZ-kt.overscaledZ),je=Ne[Ne.length-1].overscaledZ,Ze=Ne[0].overscaledZ-je+1;if(Ze>1){this.currentStencilSource=void 0,this.nextStencilID+Ze>256&&this.clearStencil();const kt={};for(let Ft=0;Ft({u_sky_color:Pt.properties.get("sky-color"),u_horizon_color:Pt.properties.get("horizon-color"),u_horizon:(qt.height/2+qt.getHorizon())*zt,u_sky_horizon_blend:Pt.properties.get("sky-horizon-blend")*qt.height/2*zt}))(xr,tr.style.map.transform,tr.pixelRatio),Cn=new Rs(Ur.LEQUAL,Rs.ReadWrite,[0,1]),ot=ul.disabled,dt=tr.colorModeForRenderPass(),Tt=tr.useProgram("sky");if(!xr.mesh){const Pt=new t.aX;Pt.emplaceBack(-1,-1),Pt.emplaceBack(1,-1),Pt.emplaceBack(1,1),Pt.emplaceBack(-1,1);const qt=new t.aY;qt.emplaceBack(0,1,2),qt.emplaceBack(0,2,3),xr.mesh=new gc(Or.createVertexBuffer(Pt,yn.members),Or.createIndexBuffer(qt),t.a0.simpleSegment(0,0,Pt.length,qt.length))}Tt.draw(Or,Ur.TRIANGLES,Cn,ot,dt,Do.disabled,hn,void 0,"sky",xr.mesh.vertexBuffer,xr.mesh.indexBuffer,xr.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=ce.showOverdrawInspector,this.depthRangeFor3D=[0,1-(I._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Ne.length-1;this.currentLayer>=0;this.currentLayer--){const tr=this.style._layers[Ne[this.currentLayer]],xr=je[tr.source],Or=Ze[tr.source];this._renderTileClippingMasks(tr,Or),this.renderLayer(this,xr,tr,Or)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerTt.source&&!Tt.isHidden(Or)?[xr.sourceCaches[Tt.source]]:[]),Cn=hn.filter(Tt=>Tt.getSource().type==="vector"),ot=hn.filter(Tt=>Tt.getSource().type!=="vector"),dt=Tt=>{(!Ur||Ur.getSource().maxzoomdt(Tt)),Ur||ot.forEach(Tt=>dt(Tt)),Ur}(this.style,this.transform.zoom);tr&&function(xr,Or,Ur){for(let hn=0;hn0),je&&(t.b0(ce,Ne),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Ze,kt){const Ft=Ze.context,tr=Ft.gl,xr=ru.unblended,Or=new Rs(tr.LEQUAL,Rs.ReadWrite,[0,1]),Ur=kt.getTerrainMesh(),hn=kt.sourceCache.getRenderableTiles(),Cn=Ze.useProgram("terrainDepth");Ft.bindFramebuffer.set(kt.getFramebuffer("depth").framebuffer),Ft.viewport.set([0,0,Ze.width/devicePixelRatio,Ze.height/devicePixelRatio]),Ft.clear({color:t.aM.transparent,depth:1});for(const ot of hn){const dt=kt.getTerrainData(ot.tileID),Tt={u_matrix:Ze.transform.calculatePosMatrix(ot.tileID.toUnwrapped()),u_ele_delta:kt.getMeshFrameDelta(Ze.transform.zoom)};Cn.draw(Ft,tr.TRIANGLES,Or,ul.disabled,xr,Do.backCCW,Tt,dt,"terrain",Ur.vertexBuffer,Ur.indexBuffer,Ur.segments)}Ft.bindFramebuffer.set(null),Ft.viewport.set([0,0,Ze.width,Ze.height])}(this,this.style.map.terrain),function(Ze,kt){const Ft=Ze.context,tr=Ft.gl,xr=ru.unblended,Or=new Rs(tr.LEQUAL,Rs.ReadWrite,[0,1]),Ur=kt.getTerrainMesh(),hn=kt.getCoordsTexture(),Cn=kt.sourceCache.getRenderableTiles(),ot=Ze.useProgram("terrainCoords");Ft.bindFramebuffer.set(kt.getFramebuffer("coords").framebuffer),Ft.viewport.set([0,0,Ze.width/devicePixelRatio,Ze.height/devicePixelRatio]),Ft.clear({color:t.aM.transparent,depth:1}),kt.coordsIndex=[];for(const dt of Cn){const Tt=kt.getTerrainData(dt.tileID);Ft.activeTexture.set(tr.TEXTURE0),tr.bindTexture(tr.TEXTURE_2D,hn.texture);const Pt={u_matrix:Ze.transform.calculatePosMatrix(dt.tileID.toUnwrapped()),u_terrain_coords_id:(255-kt.coordsIndex.length)/255,u_texture:0,u_ele_delta:kt.getMeshFrameDelta(Ze.transform.zoom)};ot.draw(Ft,tr.TRIANGLES,Or,ul.disabled,xr,Do.backCCW,Pt,Tt,"terrain",Ur.vertexBuffer,Ur.indexBuffer,Ur.segments),kt.coordsIndex.push(dt.tileID.key)}Ft.bindFramebuffer.set(null),Ft.viewport.set([0,0,Ze.width,Ze.height])}(this,this.style.map.terrain))}renderLayer(I,ce,Ne,je){if(!Ne.isHidden(this.transform.zoom)&&(Ne.type==="background"||Ne.type==="custom"||(je||[]).length))switch(this.id=Ne.id,Ne.type){case"symbol":(function(Ze,kt,Ft,tr,xr){if(Ze.renderPass!=="translucent")return;const Or=ul.disabled,Ur=Ze.colorModeForRenderPass();(Ft._unevaluatedLayout.hasValue("text-variable-anchor")||Ft._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(hn,Cn,ot,dt,Tt,Pt,qt,zt,Xt){const Mr=Cn.transform,Rr=Va(),Vr=Tt==="map",an=Pt==="map";for(const mn of hn){const zn=dt.getTile(mn),Gn=zn.getBucket(ot);if(!Gn||!Gn.text||!Gn.text.segments.get().length)continue;const oa=t.ag(Gn.textSizeData,Mr.zoom),Fa=ua(zn,1,Cn.transform.zoom),vi=zr(mn.posMatrix,an,Vr,Cn.transform,Fa),li=ot.layout.get("icon-text-fit")!=="none"&&Gn.hasIconData();if(oa){const mi=Math.pow(2,Mr.zoom-zn.tileID.overscaledZ),no=Cn.style.map.terrain?(go,Wo)=>Cn.style.map.terrain.getElevation(mn,go,Wo):null,To=Rr.translatePosition(Mr,zn,qt,zt);Nf(Gn,Vr,an,Xt,Mr,vi,mn.posMatrix,mi,oa,li,Rr,To,mn.toUnwrapped(),no)}}}(tr,Ze,Ft,kt,Ft.layout.get("text-rotation-alignment"),Ft.layout.get("text-pitch-alignment"),Ft.paint.get("text-translate"),Ft.paint.get("text-translate-anchor"),xr),Ft.paint.get("icon-opacity").constantOr(1)!==0&&Eh(Ze,kt,Ft,tr,!1,Ft.paint.get("icon-translate"),Ft.paint.get("icon-translate-anchor"),Ft.layout.get("icon-rotation-alignment"),Ft.layout.get("icon-pitch-alignment"),Ft.layout.get("icon-keep-upright"),Or,Ur),Ft.paint.get("text-opacity").constantOr(1)!==0&&Eh(Ze,kt,Ft,tr,!0,Ft.paint.get("text-translate"),Ft.paint.get("text-translate-anchor"),Ft.layout.get("text-rotation-alignment"),Ft.layout.get("text-pitch-alignment"),Ft.layout.get("text-keep-upright"),Or,Ur),kt.map.showCollisionBoxes&&(Oc(Ze,kt,Ft,tr,!0),Oc(Ze,kt,Ft,tr,!1))})(I,ce,Ne,je,this.style.placement.variableOffsets);break;case"circle":(function(Ze,kt,Ft,tr){if(Ze.renderPass!=="translucent")return;const xr=Ft.paint.get("circle-opacity"),Or=Ft.paint.get("circle-stroke-width"),Ur=Ft.paint.get("circle-stroke-opacity"),hn=!Ft.layout.get("circle-sort-key").isConstant();if(xr.constantOr(1)===0&&(Or.constantOr(1)===0||Ur.constantOr(1)===0))return;const Cn=Ze.context,ot=Cn.gl,dt=Ze.depthModeForSublayer(0,Rs.ReadOnly),Tt=ul.disabled,Pt=Ze.colorModeForRenderPass(),qt=[];for(let zt=0;ztzt.sortKey-Xt.sortKey);for(const zt of qt){const{programConfiguration:Xt,program:Mr,layoutVertexBuffer:Rr,indexBuffer:Vr,uniformValues:an,terrainData:mn}=zt.state;Mr.draw(Cn,ot.TRIANGLES,dt,Tt,Pt,Do.disabled,an,mn,Ft.id,Rr,Vr,zt.segments,Ft.paint,Ze.transform.zoom,Xt)}})(I,ce,Ne,je);break;case"heatmap":(function(Ze,kt,Ft,tr){if(Ft.paint.get("heatmap-opacity")===0)return;const xr=Ze.context;if(Ze.style.map.terrain){for(const Or of tr){const Ur=kt.getTile(Or);kt.hasRenderableParent(Or)||(Ze.renderPass==="offscreen"?Bf(Ze,Ur,Ft,Or):Ze.renderPass==="translucent"&&vf(Ze,Ft,Or))}xr.viewport.set([0,0,Ze.width,Ze.height])}else Ze.renderPass==="offscreen"?function(Or,Ur,hn,Cn){const ot=Or.context,dt=ot.gl,Tt=ul.disabled,Pt=new ru([dt.ONE,dt.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(qt,zt,Xt){const Mr=qt.gl;qt.activeTexture.set(Mr.TEXTURE1),qt.viewport.set([0,0,zt.width/4,zt.height/4]);let Rr=Xt.heatmapFbos.get(t.aU);Rr?(Mr.bindTexture(Mr.TEXTURE_2D,Rr.colorAttachment.get()),qt.bindFramebuffer.set(Rr.framebuffer)):(Rr=ih(qt,zt.width/4,zt.height/4),Xt.heatmapFbos.set(t.aU,Rr))})(ot,Or,hn),ot.clear({color:t.aM.transparent});for(let qt=0;qt20&&Or.texParameterf(Or.TEXTURE_2D,xr.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,xr.extTextureFilterAnisotropicMax);const Gn=Ze.style.map.terrain&&Ze.style.map.terrain.getTerrainData(qt),oa=Gn?qt:null,Fa=oa?oa.posMatrix:Ze.transform.calculatePosMatrix(qt.toUnwrapped(),Pt),vi=rl(Fa,mn||[0,0],an||1,Vr,Ft);Ur instanceof yt?hn.draw(xr,Or.TRIANGLES,zt,ul.disabled,Cn,Do.disabled,vi,Gn,Ft.id,Ur.boundsBuffer,Ze.quadTriangleIndexBuffer,Ur.boundsSegments):hn.draw(xr,Or.TRIANGLES,zt,ot[qt.overscaledZ],Cn,Do.disabled,vi,Gn,Ft.id,Ze.rasterBoundsBuffer,Ze.quadTriangleIndexBuffer,Ze.rasterBoundsSegments)}})(I,ce,Ne,je);break;case"background":(function(Ze,kt,Ft,tr){const xr=Ft.paint.get("background-color"),Or=Ft.paint.get("background-opacity");if(Or===0)return;const Ur=Ze.context,hn=Ur.gl,Cn=Ze.transform,ot=Cn.tileSize,dt=Ft.paint.get("background-pattern");if(Ze.isPatternMissing(dt))return;const Tt=!dt&&xr.a===1&&Or===1&&Ze.opaquePassEnabledForLayer()?"opaque":"translucent";if(Ze.renderPass!==Tt)return;const Pt=ul.disabled,qt=Ze.depthModeForSublayer(0,Tt==="opaque"?Rs.ReadWrite:Rs.ReadOnly),zt=Ze.colorModeForRenderPass(),Xt=Ze.useProgram(dt?"backgroundPattern":"background"),Mr=tr||Cn.coveringTiles({tileSize:ot,terrain:Ze.style.map.terrain});dt&&(Ur.activeTexture.set(hn.TEXTURE0),Ze.imageManager.bind(Ze.context));const Rr=Ft.getCrossfadeParameters();for(const Vr of Mr){const an=tr?Vr.posMatrix:Ze.transform.calculatePosMatrix(Vr.toUnwrapped()),mn=dt?wl(an,Or,Ze,dt,{tileID:Vr,tileSize:ot},Rr):nl(an,Or,xr),zn=Ze.style.map.terrain&&Ze.style.map.terrain.getTerrainData(Vr);Xt.draw(Ur,hn.TRIANGLES,qt,Pt,zt,Do.disabled,mn,zn,Ft.id,Ze.tileExtentBuffer,Ze.quadTriangleIndexBuffer,Ze.tileExtentSegments)}})(I,0,Ne,je);break;case"custom":(function(Ze,kt,Ft){const tr=Ze.context,xr=Ft.implementation;if(Ze.renderPass==="offscreen"){const Or=xr.prerender;Or&&(Ze.setCustomLayerDefaults(),tr.setColorMode(Ze.colorModeForRenderPass()),Or.call(xr,tr.gl,Ze.transform.customLayerMatrix()),tr.setDirty(),Ze.setBaseState())}else if(Ze.renderPass==="translucent"){Ze.setCustomLayerDefaults(),tr.setColorMode(Ze.colorModeForRenderPass()),tr.setStencilMode(ul.disabled);const Or=xr.renderingMode==="3d"?new Rs(Ze.context.gl.LEQUAL,Rs.ReadWrite,Ze.depthRangeFor3D):Ze.depthModeForSublayer(0,Rs.ReadOnly);tr.setDepthMode(Or),xr.render(tr.gl,Ze.transform.customLayerMatrix(),{farZ:Ze.transform.farZ,nearZ:Ze.transform.nearZ,fov:Ze.transform._fov,modelViewProjectionMatrix:Ze.transform.modelViewProjectionMatrix,projectionMatrix:Ze.transform.projectionMatrix}),tr.setDirty(),Ze.setBaseState(),tr.bindFramebuffer.set(null)}})(I,0,Ne)}}translatePosMatrix(I,ce,Ne,je,Ze){if(!Ne[0]&&!Ne[1])return I;const kt=Ze?je==="map"?this.transform.angle:0:je==="viewport"?-this.transform.angle:0;if(kt){const xr=Math.sin(kt),Or=Math.cos(kt);Ne=[Ne[0]*Or-Ne[1]*xr,Ne[0]*xr+Ne[1]*Or]}const Ft=[Ze?Ne[0]:ua(ce,Ne[0],this.transform.zoom),Ze?Ne[1]:ua(ce,Ne[1],this.transform.zoom),0],tr=new Float32Array(16);return t.J(tr,I,Ft),tr}saveTileTexture(I){const ce=this._tileTextures[I.size[0]];ce?ce.push(I):this._tileTextures[I.size[0]]=[I]}getTileTexture(I){const ce=this._tileTextures[I];return ce&&ce.length>0?ce.pop():null}isPatternMissing(I){if(!I)return!1;if(!I.from||!I.to)return!0;const ce=this.imageManager.getPattern(I.from.toString()),Ne=this.imageManager.getPattern(I.to.toString());return!ce||!Ne}useProgram(I,ce){this.cache=this.cache||{};const Ne=I+(ce?ce.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Ne]||(this.cache[Ne]=new Hn(this.context,cn[I],ce,Ml[I],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Ne]}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 I=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(I.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:I,drawingBufferHeight:ce}=this.context.gl;return this.width!==I||this.height!==ce}}class Wl{constructor(I,ce){this.points=I,this.planes=ce}static fromInvProjectionMatrix(I,ce,Ne){const je=Math.pow(2,Ne),Ze=[[-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(Ft=>{const tr=1/(Ft=t.af([],Ft,I))[3]/ce*je;return t.b1(Ft,Ft,[tr,tr,1/Ft[3],tr])}),kt=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(Ft=>{const tr=function(hn,Cn){var ot=Cn[0],dt=Cn[1],Tt=Cn[2],Pt=ot*ot+dt*dt+Tt*Tt;return Pt>0&&(Pt=1/Math.sqrt(Pt)),hn[0]=Cn[0]*Pt,hn[1]=Cn[1]*Pt,hn[2]=Cn[2]*Pt,hn}([],function(hn,Cn,ot){var dt=Cn[0],Tt=Cn[1],Pt=Cn[2],qt=ot[0],zt=ot[1],Xt=ot[2];return hn[0]=Tt*Xt-Pt*zt,hn[1]=Pt*qt-dt*Xt,hn[2]=dt*zt-Tt*qt,hn}([],E([],Ze[Ft[0]],Ze[Ft[1]]),E([],Ze[Ft[2]],Ze[Ft[1]]))),xr=-((Or=tr)[0]*(Ur=Ze[Ft[1]])[0]+Or[1]*Ur[1]+Or[2]*Ur[2]);var Or,Ur;return tr.concat(xr)});return new Wl(Ze,kt)}}class af{constructor(I,ce){this.min=I,this.max=ce,this.center=function(Ne,je,Ze){return Ne[0]=.5*je[0],Ne[1]=.5*je[1],Ne[2]=.5*je[2],Ne}([],function(Ne,je,Ze){return Ne[0]=je[0]+Ze[0],Ne[1]=je[1]+Ze[1],Ne[2]=je[2]+Ze[2],Ne}([],this.min,this.max))}quadrant(I){const ce=[I%2==0,I<2],Ne=b(this.min),je=b(this.max);for(let Ze=0;Ze=0&&kt++;if(kt===0)return 0;kt!==ce.length&&(Ne=!1)}if(Ne)return 2;for(let je=0;je<3;je++){let Ze=Number.MAX_VALUE,kt=-Number.MAX_VALUE;for(let Ft=0;Ftthis.max[je]-this.min[je])return 0}return 1}}class ac{constructor(I=0,ce=0,Ne=0,je=0){if(isNaN(I)||I<0||isNaN(ce)||ce<0||isNaN(Ne)||Ne<0||isNaN(je)||je<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=I,this.bottom=ce,this.left=Ne,this.right=je}interpolate(I,ce,Ne){return ce.top!=null&&I.top!=null&&(this.top=t.y.number(I.top,ce.top,Ne)),ce.bottom!=null&&I.bottom!=null&&(this.bottom=t.y.number(I.bottom,ce.bottom,Ne)),ce.left!=null&&I.left!=null&&(this.left=t.y.number(I.left,ce.left,Ne)),ce.right!=null&&I.right!=null&&(this.right=t.y.number(I.right,ce.right,Ne)),this}getCenter(I,ce){const Ne=t.ac((this.left+I-this.right)/2,0,I),je=t.ac((this.top+ce-this.bottom)/2,0,ce);return new t.P(Ne,je)}equals(I){return this.top===I.top&&this.bottom===I.bottom&&this.left===I.left&&this.right===I.right}clone(){return new ac(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const yc=85.051129;class nu{constructor(I,ce,Ne,je,Ze){this.tileSize=512,this._renderWorldCopies=Ze===void 0||!!Ze,this._minZoom=I||0,this._maxZoom=ce||22,this._minPitch=Ne??0,this._maxPitch=je??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 ac,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const I=new nu(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return I.apply(this),I}apply(I){this.tileSize=I.tileSize,this.latRange=I.latRange,this.lngRange=I.lngRange,this.width=I.width,this.height=I.height,this._center=I._center,this._elevation=I._elevation,this.minElevationForCurrentTile=I.minElevationForCurrentTile,this.zoom=I.zoom,this.angle=I.angle,this._fov=I._fov,this._pitch=I._pitch,this._unmodified=I._unmodified,this._edgeInsets=I._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(I){this._minZoom!==I&&(this._minZoom=I,this.zoom=Math.max(this.zoom,I))}get maxZoom(){return this._maxZoom}set maxZoom(I){this._maxZoom!==I&&(this._maxZoom=I,this.zoom=Math.min(this.zoom,I))}get minPitch(){return this._minPitch}set minPitch(I){this._minPitch!==I&&(this._minPitch=I,this.pitch=Math.max(this.pitch,I))}get maxPitch(){return this._maxPitch}set maxPitch(I){this._maxPitch!==I&&(this._maxPitch=I,this.pitch=Math.min(this.pitch,I))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(I){I===void 0?I=!0:I===null&&(I=!1),this._renderWorldCopies=I}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(I){const ce=-t.b3(I,-180,180)*Math.PI/180;this.angle!==ce&&(this._unmodified=!1,this.angle=ce,this._calcMatrices(),this.rotationMatrix=function(){var Ne=new t.A(4);return t.A!=Float32Array&&(Ne[1]=0,Ne[2]=0),Ne[0]=1,Ne[3]=1,Ne}(),function(Ne,je,Ze){var kt=je[0],Ft=je[1],tr=je[2],xr=je[3],Or=Math.sin(Ze),Ur=Math.cos(Ze);Ne[0]=kt*Ur+tr*Or,Ne[1]=Ft*Ur+xr*Or,Ne[2]=kt*-Or+tr*Ur,Ne[3]=Ft*-Or+xr*Ur}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(I){const ce=t.ac(I,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ce&&(this._unmodified=!1,this._pitch=ce,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(I){I=Math.max(.01,Math.min(60,I)),this._fov!==I&&(this._unmodified=!1,this._fov=I/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(I){const ce=Math.min(Math.max(I,this.minZoom),this.maxZoom);this._zoom!==ce&&(this._unmodified=!1,this._zoom=ce,this.tileZoom=Math.max(0,Math.floor(ce)),this.scale=this.zoomScale(ce),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(I){I.lat===this._center.lat&&I.lng===this._center.lng||(this._unmodified=!1,this._center=I,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(I){I!==this._elevation&&(this._elevation=I,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(I){this._edgeInsets.equals(I)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,I,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(I){return this._edgeInsets.equals(I)}interpolatePadding(I,ce,Ne){this._unmodified=!1,this._edgeInsets.interpolate(I,ce,Ne),this._constrain(),this._calcMatrices()}coveringZoomLevel(I){const ce=(I.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/I.tileSize));return Math.max(0,ce)}getVisibleUnwrappedCoordinates(I){const ce=[new t.b4(0,I)];if(this._renderWorldCopies){const Ne=this.pointCoordinate(new t.P(0,0)),je=this.pointCoordinate(new t.P(this.width,0)),Ze=this.pointCoordinate(new t.P(this.width,this.height)),kt=this.pointCoordinate(new t.P(0,this.height)),Ft=Math.floor(Math.min(Ne.x,je.x,Ze.x,kt.x)),tr=Math.floor(Math.max(Ne.x,je.x,Ze.x,kt.x)),xr=1;for(let Or=Ft-xr;Or<=tr+xr;Or++)Or!==0&&ce.push(new t.b4(Or,I))}return ce}coveringTiles(I){var ce,Ne;let je=this.coveringZoomLevel(I);const Ze=je;if(I.minzoom!==void 0&&jeI.maxzoom&&(je=I.maxzoom);const kt=this.pointCoordinate(this.getCameraPoint()),Ft=t.Z.fromLngLat(this.center),tr=Math.pow(2,je),xr=[tr*kt.x,tr*kt.y,0],Or=[tr*Ft.x,tr*Ft.y,0],Ur=Wl.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,je);let hn=I.minzoom||0;!I.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(hn=je);const Cn=I.terrain?2/Math.min(this.tileSize,I.tileSize)*this.tileSize:3,ot=zt=>({aabb:new af([zt*tr,0,0],[(zt+1)*tr,tr,0]),zoom:0,x:0,y:0,wrap:zt,fullyVisible:!1}),dt=[],Tt=[],Pt=je,qt=I.reparseOverscaled?Ze:je;if(this._renderWorldCopies)for(let zt=1;zt<=3;zt++)dt.push(ot(-zt)),dt.push(ot(zt));for(dt.push(ot(0));dt.length>0;){const zt=dt.pop(),Xt=zt.x,Mr=zt.y;let Rr=zt.fullyVisible;if(!Rr){const Gn=zt.aabb.intersects(Ur);if(Gn===0)continue;Rr=Gn===2}const Vr=I.terrain?xr:Or,an=zt.aabb.distanceX(Vr),mn=zt.aabb.distanceY(Vr),zn=Math.max(Math.abs(an),Math.abs(mn));if(zt.zoom===Pt||zn>Cn+(1<=hn){const Gn=Pt-zt.zoom,oa=xr[0]-.5-(Xt<>1),vi=zt.zoom+1;let li=zt.aabb.quadrant(Gn);if(I.terrain){const mi=new t.S(vi,zt.wrap,vi,oa,Fa),no=I.terrain.getMinMaxElevation(mi),To=(ce=no.minElevation)!==null&&ce!==void 0?ce:this.elevation,go=(Ne=no.maxElevation)!==null&&Ne!==void 0?Ne:this.elevation;li=new af([li.min[0],li.min[1],To],[li.max[0],li.max[1],go])}dt.push({aabb:li,zoom:vi,x:oa,y:Fa,wrap:zt.wrap,fullyVisible:Rr})}}return Tt.sort((zt,Xt)=>zt.distanceSq-Xt.distanceSq).map(zt=>zt.tileID)}resize(I,ce){this.width=I,this.height=ce,this.pixelsToGLUnits=[2/I,-2/ce],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(I){return Math.pow(2,I)}scaleZoom(I){return Math.log(I)/Math.LN2}project(I){const ce=t.ac(I.lat,-85.051129,yc);return new t.P(t.O(I.lng)*this.worldSize,t.Q(ce)*this.worldSize)}unproject(I){return new t.Z(I.x/this.worldSize,I.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(I){const ce=this.elevation,Ne=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,je=this.pointLocation(this.centerPoint,I),Ze=I.getElevationForLngLatZoom(je,this.tileZoom);if(!(this.elevation-Ze))return;const kt=Ne+ce-Ze,Ft=Math.cos(this._pitch)*this.cameraToCenterDistance/kt/t.b5(1,je.lat),tr=this.scaleZoom(Ft/this.tileSize);this._elevation=Ze,this._center=je,this.zoom=tr}setLocationAtPoint(I,ce){const Ne=this.pointCoordinate(ce),je=this.pointCoordinate(this.centerPoint),Ze=this.locationCoordinate(I),kt=new t.Z(Ze.x-(Ne.x-je.x),Ze.y-(Ne.y-je.y));this.center=this.coordinateLocation(kt),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(I,ce){return ce?this.coordinatePoint(this.locationCoordinate(I),ce.getElevationForLngLatZoom(I,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(I))}pointLocation(I,ce){return this.coordinateLocation(this.pointCoordinate(I,ce))}locationCoordinate(I){return t.Z.fromLngLat(I)}coordinateLocation(I){return I&&I.toLngLat()}pointCoordinate(I,ce){if(ce){const hn=ce.pointCoordinate(I);if(hn!=null)return hn}const Ne=[I.x,I.y,0,1],je=[I.x,I.y,1,1];t.af(Ne,Ne,this.pixelMatrixInverse),t.af(je,je,this.pixelMatrixInverse);const Ze=Ne[3],kt=je[3],Ft=Ne[1]/Ze,tr=je[1]/kt,xr=Ne[2]/Ze,Or=je[2]/kt,Ur=xr===Or?0:(0-xr)/(Or-xr);return new t.Z(t.y.number(Ne[0]/Ze,je[0]/kt,Ur)/this.worldSize,t.y.number(Ft,tr,Ur)/this.worldSize)}coordinatePoint(I,ce=0,Ne=this.pixelMatrix){const je=[I.x*this.worldSize,I.y*this.worldSize,ce,1];return t.af(je,je,Ne),new t.P(je[0]/je[3],je[1]/je[3])}getBounds(){const I=Math.max(0,this.height/2-this.getHorizon());return new ue().extend(this.pointLocation(new t.P(0,I))).extend(this.pointLocation(new t.P(this.width,I))).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 ue([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(I){I?(this.lngRange=[I.getWest(),I.getEast()],this.latRange=[I.getSouth(),I.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,yc])}calculateTileMatrix(I){const ce=I.canonical,Ne=this.worldSize/this.zoomScale(ce.z),je=ce.x+Math.pow(2,ce.z)*I.wrap,Ze=t.an(new Float64Array(16));return t.J(Ze,Ze,[je*Ne,ce.y*Ne,0]),t.K(Ze,Ze,[Ne/t.X,Ne/t.X,1]),Ze}calculatePosMatrix(I,ce=!1){const Ne=I.key,je=ce?this._alignedPosMatrixCache:this._posMatrixCache;if(je[Ne])return je[Ne];const Ze=this.calculateTileMatrix(I);return t.L(Ze,ce?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Ze),je[Ne]=new Float32Array(Ze),je[Ne]}calculateFogMatrix(I){const ce=I.key,Ne=this._fogMatrixCache;if(Ne[ce])return Ne[ce];const je=this.calculateTileMatrix(I);return t.L(je,this.fogMatrix,je),Ne[ce]=new Float32Array(je),Ne[ce]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(I,ce){ce=t.ac(+ce,this.minZoom,this.maxZoom);const Ne={center:new t.N(I.lng,I.lat),zoom:ce};let je=this.lngRange;if(!this._renderWorldCopies&&je===null){const zt=179.9999999999;je=[-zt,zt]}const Ze=this.tileSize*this.zoomScale(Ne.zoom);let kt=0,Ft=Ze,tr=0,xr=Ze,Or=0,Ur=0;const{x:hn,y:Cn}=this.size;if(this.latRange){const zt=this.latRange;kt=t.Q(zt[1])*Ze,Ft=t.Q(zt[0])*Ze,Ft-ktFt&&(Pt=Ft-zt)}if(je){const zt=(tr+xr)/2;let Xt=ot;this._renderWorldCopies&&(Xt=t.b3(ot,zt-Ze/2,zt+Ze/2));const Mr=hn/2;Xt-Mrxr&&(Tt=xr-Mr)}if(Tt!==void 0||Pt!==void 0){const zt=new t.P(Tt??ot,Pt??dt);Ne.center=this.unproject.call({worldSize:Ze},zt).wrap()}return Ne}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const I=this._unmodified,{center:ce,zoom:Ne}=this.getConstrained(this.center,this.zoom);this.center=ce,this.zoom=Ne,this._unmodified=I,this._constraining=!1}_calcMatrices(){if(!this.height)return;const I=this.centerOffset,ce=this.point.x,Ne=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let je=t.an(new Float64Array(16));t.K(je,je,[this.width/2,-this.height/2,1]),t.J(je,je,[1,-1,0]),this.labelPlaneMatrix=je,je=t.an(new Float64Array(16)),t.K(je,je,[1,-1,1]),t.J(je,je,[-1,-1,0]),t.K(je,je,[2/this.width,2/this.height,1]),this.glCoordMatrix=je;const Ze=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),kt=Math.min(this.elevation,this.minElevationForCurrentTile),Ft=Ze-kt*this._pixelPerMeter/Math.cos(this._pitch),tr=kt<0?Ft:Ze,xr=Math.PI/2+this._pitch,Or=this._fov*(.5+I.y/this.height),Ur=Math.sin(Or)*tr/Math.sin(t.ac(Math.PI-xr-Or,.01,Math.PI-.01)),hn=this.getHorizon(),Cn=2*Math.atan(hn/this.cameraToCenterDistance)*(.5+I.y/(2*hn)),ot=Math.sin(Cn)*tr/Math.sin(t.ac(Math.PI-xr-Cn,.01,Math.PI-.01)),dt=Math.min(Ur,ot);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*dt+tr),this.nearZ=this.height/50,je=new Float64Array(16),t.b6(je,this._fov,this.width/this.height,this.nearZ,this.farZ),je[8]=2*-I.x/this.width,je[9]=2*I.y/this.height,this.projectionMatrix=t.ae(je),t.K(je,je,[1,-1,1]),t.J(je,je,[0,0,-this.cameraToCenterDistance]),t.b7(je,je,this._pitch),t.ad(je,je,this.angle),t.J(je,je,[-ce,-Ne,0]),this.mercatorMatrix=t.K([],je,[this.worldSize,this.worldSize,this.worldSize]),t.K(je,je,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,je),t.J(je,je,[0,0,-this.elevation]),this.modelViewProjectionMatrix=je,this.invModelViewProjectionMatrix=t.as([],je),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Ze,this.farZ),this.fogMatrix[8]=2*-I.x/this.width,this.fogMatrix[9]=2*I.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,[-ce,-Ne,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,je);const Tt=this.width%2/2,Pt=this.height%2/2,qt=Math.cos(this.angle),zt=Math.sin(this.angle),Xt=ce-Math.round(ce)+qt*Tt+zt*Pt,Mr=Ne-Math.round(Ne)+qt*Pt+zt*Tt,Rr=new Float64Array(je);if(t.J(Rr,Rr,[Xt>.5?Xt-1:Xt,Mr>.5?Mr-1:Mr,0]),this.alignedModelViewProjectionMatrix=Rr,je=t.as(new Float64Array(16),this.pixelMatrix),!je)throw new Error("failed to invert matrix");this.pixelMatrixInverse=je,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const I=this.pointCoordinate(new t.P(0,0)),ce=[I.x*this.worldSize,I.y*this.worldSize,0,1];return t.af(ce,ce,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const I=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,I))}getCameraQueryGeometry(I){const ce=this.getCameraPoint();if(I.length===1)return[I[0],ce];{let Ne=ce.x,je=ce.y,Ze=ce.x,kt=ce.y;for(const Ft of I)Ne=Math.min(Ne,Ft.x),je=Math.min(je,Ft.y),Ze=Math.max(Ze,Ft.x),kt=Math.max(kt,Ft.y);return[new t.P(Ne,je),new t.P(Ze,je),new t.P(Ze,kt),new t.P(Ne,kt),new t.P(Ne,je)]}}lngLatToCameraDepth(I,ce){const Ne=this.locationCoordinate(I),je=[Ne.x*this.worldSize,Ne.y*this.worldSize,ce,1];return t.af(je,je,this.modelViewProjectionMatrix),je[2]/je[3]}}function Cf(Je,I){let ce,Ne=!1,je=null,Ze=null;const kt=()=>{je=null,Ne&&(Je.apply(Ze,ce),je=setTimeout(kt,I),Ne=!1)};return(...Ft)=>(Ne=!0,Ze=this,ce=Ft,je||kt(),je)}class Hc{constructor(I){this._getCurrentHash=()=>{const ce=window.location.hash.replace("#","");if(this._hashName){let Ne;return ce.split("&").map(je=>je.split("=")).forEach(je=>{je[0]===this._hashName&&(Ne=je)}),(Ne&&Ne[1]||"").split("/")}return ce.split("/")},this._onHashChange=()=>{const ce=this._getCurrentHash();if(ce.length>=3&&!ce.some(Ne=>isNaN(Ne))){const Ne=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ce[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ce[2],+ce[1]],zoom:+ce[0],bearing:Ne,pitch:+(ce[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const ce=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,ce)},this._removeHash=()=>{const ce=this._getCurrentHash();if(ce.length===0)return;const Ne=ce.join("/");let je=Ne;je.split("&").length>0&&(je=je.split("&")[0]),this._hashName&&(je=`${this._hashName}=${Ne}`);let Ze=window.location.hash.replace(je,"");Ze.startsWith("#&")?Ze=Ze.slice(0,1)+Ze.slice(2):Ze==="#"&&(Ze="");let kt=window.location.href.replace(/(#.+)?$/,Ze);kt=kt.replace("&&","&"),window.history.replaceState(window.history.state,null,kt)},this._updateHash=Cf(this._updateHashUnthrottled,300),this._hashName=I&&encodeURIComponent(I)}addTo(I){return this._map=I,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(I){const ce=this._map.getCenter(),Ne=Math.round(100*this._map.getZoom())/100,je=Math.ceil((Ne*Math.LN2+Math.log(512/360/.5))/Math.LN10),Ze=Math.pow(10,je),kt=Math.round(ce.lng*Ze)/Ze,Ft=Math.round(ce.lat*Ze)/Ze,tr=this._map.getBearing(),xr=this._map.getPitch();let Or="";if(Or+=I?`/${kt}/${Ft}/${Ne}`:`${Ne}/${Ft}/${kt}`,(tr||xr)&&(Or+="/"+Math.round(10*tr)/10),xr&&(Or+=`/${Math.round(xr)}`),this._hashName){const Ur=this._hashName;let hn=!1;const Cn=window.location.hash.slice(1).split("&").map(ot=>{const dt=ot.split("=")[0];return dt===Ur?(hn=!0,`${dt}=${Or}`):ot}).filter(ot=>ot);return hn||Cn.push(`${Ur}=${Or}`),`#${Cn.join("&")}`}return`#${Or}`}}const gf={linearity:.3,easing:t.b8(0,0,.3,1)},Wf=t.e({deceleration:2500,maxSpeed:1400},gf),zh=t.e({deceleration:20,maxSpeed:1400},gf),td=t.e({deceleration:1e3,maxSpeed:360},gf),Pf=t.e({deceleration:1e3,maxSpeed:90},gf);class Yf{constructor(I){this._map=I,this.clear()}clear(){this._inertiaBuffer=[]}record(I){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.now(),settings:I})}_drainInertiaBuffer(){const I=this._inertiaBuffer,ce=i.now();for(;I.length>0&&ce-I[0].time>160;)I.shift()}_onMoveEnd(I){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const ce={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Ze}of this._inertiaBuffer)ce.zoom+=Ze.zoomDelta||0,ce.bearing+=Ze.bearingDelta||0,ce.pitch+=Ze.pitchDelta||0,Ze.panDelta&&ce.pan._add(Ze.panDelta),Ze.around&&(ce.around=Ze.around),Ze.pinchAround&&(ce.pinchAround=Ze.pinchAround);const Ne=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,je={};if(ce.pan.mag()){const Ze=Xf(ce.pan.mag(),Ne,t.e({},Wf,I||{}));je.offset=ce.pan.mult(Ze.amount/ce.pan.mag()),je.center=this._map.transform.center,Ec(je,Ze)}if(ce.zoom){const Ze=Xf(ce.zoom,Ne,zh);je.zoom=this._map.transform.zoom+Ze.amount,Ec(je,Ze)}if(ce.bearing){const Ze=Xf(ce.bearing,Ne,td);je.bearing=this._map.transform.bearing+t.ac(Ze.amount,-179,179),Ec(je,Ze)}if(ce.pitch){const Ze=Xf(ce.pitch,Ne,Pf);je.pitch=this._map.transform.pitch+Ze.amount,Ec(je,Ze)}if(je.zoom||je.bearing){const Ze=ce.pinchAround===void 0?ce.around:ce.pinchAround;je.around=Ze?this._map.unproject(Ze):this._map.getCenter()}return this.clear(),t.e(je,{noMoveStart:!0})}}function Ec(Je,I){(!Je.duration||Je.durationce.unproject(tr)),Ft=Ze.reduce((tr,xr,Or,Ur)=>tr.add(xr.div(Ur.length)),new t.P(0,0));super(I,{points:Ze,point:Ft,lngLats:kt,lngLat:ce.unproject(Ft),originalEvent:Ne}),this._defaultPrevented=!1}}class mh extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(I,ce,Ne){super(I,{originalEvent:Ne}),this._defaultPrevented=!1}}class Df{constructor(I,ce){this._map=I,this._clickTolerance=ce.clickTolerance}reset(){delete this._mousedownPos}wheel(I){return this._firePreventable(new mh(I.type,this._map,I))}mousedown(I,ce){return this._mousedownPos=ce,this._firePreventable(new $u(I.type,this._map,I))}mouseup(I){this._map.fire(new $u(I.type,this._map,I))}click(I,ce){this._mousedownPos&&this._mousedownPos.dist(ce)>=this._clickTolerance||this._map.fire(new $u(I.type,this._map,I))}dblclick(I){return this._firePreventable(new $u(I.type,this._map,I))}mouseover(I){this._map.fire(new $u(I.type,this._map,I))}mouseout(I){this._map.fire(new $u(I.type,this._map,I))}touchstart(I){return this._firePreventable(new Lf(I.type,this._map,I))}touchmove(I){this._map.fire(new Lf(I.type,this._map,I))}touchend(I){this._map.fire(new Lf(I.type,this._map,I))}touchcancel(I){this._map.fire(new Lf(I.type,this._map,I))}_firePreventable(I){if(this._map.fire(I),I.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Zl{constructor(I){this._map=I}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(I){this._map.fire(new $u(I.type,this._map,I))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new $u("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(I){this._delayContextMenu?this._contextMenuEvent=I:this._ignoreContextMenu||this._map.fire(new $u(I.type,this._map,I)),this._map.listens("contextmenu")&&I.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class _c{constructor(I){this._map=I}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(I){return this.transform.pointLocation(t.P.convert(I),this._map.terrain)}}class Fc{constructor(I,ce){this._map=I,this._tr=new _c(I),this._el=I.getCanvasContainer(),this._container=I.getContainer(),this._clickTolerance=ce.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(I,ce){this.isEnabled()&&I.shiftKey&&I.button===0&&(a.disableDrag(),this._startPos=this._lastPos=ce,this._active=!0)}mousemoveWindow(I,ce){if(!this._active)return;const Ne=ce;if(this._lastPos.equals(Ne)||!this._box&&Ne.dist(this._startPos)Ze.fitScreenCoordinates(Ne,je,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",I)}keydown(I){this._active&&I.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",I))}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(I,ce){return this._map.fire(new t.k(I,{originalEvent:ce}))}}function lh(Je,I){if(Je.length!==I.length)throw new Error(`The number of touches and points are not equal - touches ${Je.length}, points ${I.length}`);const ce={};for(let Ne=0;Nethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=I.timeStamp),Ne.length===this.numTouches&&(this.centroid=function(je){const Ze=new t.P(0,0);for(const kt of je)Ze._add(kt);return Ze.div(je.length)}(ce),this.touches=lh(Ne,ce)))}touchmove(I,ce,Ne){if(this.aborted||!this.centroid)return;const je=lh(Ne,ce);for(const Ze in this.touches){const kt=je[Ze];(!kt||kt.dist(this.touches[Ze])>30)&&(this.aborted=!0)}}touchend(I,ce,Ne){if((!this.centroid||I.timeStamp-this.startTime>500)&&(this.aborted=!0),Ne.length===0){const je=!this.aborted&&this.centroid;if(this.reset(),je)return je}}}class jf{constructor(I){this.singleTap=new eu(I),this.numTaps=I.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(I,ce,Ne){this.singleTap.touchstart(I,ce,Ne)}touchmove(I,ce,Ne){this.singleTap.touchmove(I,ce,Ne)}touchend(I,ce,Ne){const je=this.singleTap.touchend(I,ce,Ne);if(je){const Ze=I.timeStamp-this.lastTime<500,kt=!this.lastTap||this.lastTap.dist(je)<30;if(Ze&&kt||this.reset(),this.count++,this.lastTime=I.timeStamp,this.lastTap=je,this.count===this.numTaps)return this.reset(),je}}}class yf{constructor(I){this._tr=new _c(I),this._zoomIn=new jf({numTouches:1,numTaps:2}),this._zoomOut=new jf({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(I,ce,Ne){this._zoomIn.touchstart(I,ce,Ne),this._zoomOut.touchstart(I,ce,Ne)}touchmove(I,ce,Ne){this._zoomIn.touchmove(I,ce,Ne),this._zoomOut.touchmove(I,ce,Ne)}touchend(I,ce,Ne){const je=this._zoomIn.touchend(I,ce,Ne),Ze=this._zoomOut.touchend(I,ce,Ne),kt=this._tr;return je?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Ft=>Ft.easeTo({duration:300,zoom:kt.zoom+1,around:kt.unproject(je)},{originalEvent:I})}):Ze?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:Ft=>Ft.easeTo({duration:300,zoom:kt.zoom-1,around:kt.unproject(Ze)},{originalEvent:I})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class kc{constructor(I){this._enabled=!!I.enable,this._moveStateManager=I.moveStateManager,this._clickTolerance=I.clickTolerance||1,this._moveFunction=I.move,this._activateOnStart=!!I.activateOnStart,I.assignEvents(this),this.reset()}reset(I){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(I)}_move(...I){const ce=this._moveFunction(...I);if(ce.bearingDelta||ce.pitchDelta||ce.around||ce.panDelta)return this._active=!0,ce}dragStart(I,ce){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(I)&&(this._moveStateManager.startMove(I),this._lastPoint=ce.length?ce[0]:ce,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(I,ce){if(!this.isEnabled())return;const Ne=this._lastPoint;if(!Ne)return;if(I.preventDefault(),!this._moveStateManager.isValidMoveEvent(I))return void this.reset(I);const je=ce.length?ce[0]:ce;return!this._moved&&je.dist(Ne){Je.mousedown=Je.dragStart,Je.mousemoveWindow=Je.dragMove,Je.mouseup=Je.dragEnd,Je.contextmenu=I=>{I.preventDefault()}},Xu=({enable:Je,clickTolerance:I,bearingDegreesPerPixelMoved:ce=.8})=>{const Ne=new $c({checkCorrectEvent:je=>a.mouseButton(je)===0&&je.ctrlKey||a.mouseButton(je)===2});return new kc({clickTolerance:I,move:(je,Ze)=>({bearingDelta:(Ze.x-je.x)*ce}),moveStateManager:Ne,enable:Je,assignEvents:Fh})},gh=({enable:Je,clickTolerance:I,pitchDegreesPerPixelMoved:ce=-.5})=>{const Ne=new $c({checkCorrectEvent:je=>a.mouseButton(je)===0&&je.ctrlKey||a.mouseButton(je)===2});return new kc({clickTolerance:I,move:(je,Ze)=>({pitchDelta:(Ze.y-je.y)*ce}),moveStateManager:Ne,enable:Je,assignEvents:Fh})};class Cc{constructor(I,ce){this._clickTolerance=I.clickTolerance||1,this._map=ce,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(I){return I<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(I,ce,Ne){return this._calculateTransform(I,ce,Ne)}touchmove(I,ce,Ne){if(this._active){if(!this._shouldBePrevented(Ne.length))return I.preventDefault(),this._calculateTransform(I,ce,Ne);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",I)}}touchend(I,ce,Ne){this._calculateTransform(I,ce,Ne),this._active&&this._shouldBePrevented(Ne.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(I,ce,Ne){Ne.length>0&&(this._active=!0);const je=lh(Ne,ce),Ze=new t.P(0,0),kt=new t.P(0,0);let Ft=0;for(const xr in je){const Or=je[xr],Ur=this._touches[xr];Ur&&(Ze._add(Or),kt._add(Or.sub(Ur)),Ft++,je[xr]=Or)}if(this._touches=je,this._shouldBePrevented(Ft)||!kt.mag())return;const tr=kt.div(Ft);return this._sum._add(tr),this._sum.mag()Math.abs(Je.x)}class uh extends of{constructor(I){super(),this._currentTouchCount=0,this._map=I}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(I,ce,Ne){super.touchstart(I,ce,Ne),this._currentTouchCount=Ne.length}_start(I){this._lastPoints=I,Yc(I[0].sub(I[1]))&&(this._valid=!1)}_move(I,ce,Ne){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const je=I[0].sub(this._lastPoints[0]),Ze=I[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(je,Ze,Ne.timeStamp),this._valid?(this._lastPoints=I,this._active=!0,{pitchDelta:(je.y+Ze.y)/2*-.5}):void 0}gestureBeginsVertically(I,ce,Ne){if(this._valid!==void 0)return this._valid;const je=I.mag()>=2,Ze=ce.mag()>=2;if(!je&&!Ze)return;if(!je||!Ze)return this._firstMove===void 0&&(this._firstMove=Ne),Ne-this._firstMove<100&&void 0;const kt=I.y>0==ce.y>0;return Yc(I)&&Yc(ce)&&kt}}const br={panStep:100,bearingStep:15,pitchStep:10};class qr{constructor(I){this._tr=new _c(I);const ce=br;this._panStep=ce.panStep,this._bearingStep=ce.bearingStep,this._pitchStep=ce.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(I){if(I.altKey||I.ctrlKey||I.metaKey)return;let ce=0,Ne=0,je=0,Ze=0,kt=0;switch(I.keyCode){case 61:case 107:case 171:case 187:ce=1;break;case 189:case 109:case 173:ce=-1;break;case 37:I.shiftKey?Ne=-1:(I.preventDefault(),Ze=-1);break;case 39:I.shiftKey?Ne=1:(I.preventDefault(),Ze=1);break;case 38:I.shiftKey?je=1:(I.preventDefault(),kt=-1);break;case 40:I.shiftKey?je=-1:(I.preventDefault(),kt=1);break;default:return}return this._rotationDisabled&&(Ne=0,je=0),{cameraAnimation:Ft=>{const tr=this._tr;Ft.easeTo({duration:300,easeId:"keyboardHandler",easing:An,zoom:ce?Math.round(tr.zoom)+ce*(I.shiftKey?2:1):tr.zoom,bearing:tr.bearing+Ne*this._bearingStep,pitch:tr.pitch+je*this._pitchStep,offset:[-Ze*this._panStep,-kt*this._panStep],center:tr.center},{originalEvent:I})}}}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 An(Je){return Je*(2-Je)}const vn=4.000244140625;class Xn{constructor(I,ce){this._onTimeout=Ne=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Ne)},this._map=I,this._tr=new _c(I),this._triggerRenderFrame=ce,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(I){this._defaultZoomRate=I}setWheelZoomRate(I){this._wheelZoomRate=I}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(I){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!I&&I.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(I){return!!this._map.cooperativeGestures.isEnabled()&&!(I.ctrlKey||this._map.cooperativeGestures.isBypassed(I))}wheel(I){if(!this.isEnabled())return;if(this._shouldBePrevented(I))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",I);let ce=I.deltaMode===WheelEvent.DOM_DELTA_LINE?40*I.deltaY:I.deltaY;const Ne=i.now(),je=Ne-(this._lastWheelEventTime||0);this._lastWheelEventTime=Ne,ce!==0&&ce%vn==0?this._type="wheel":ce!==0&&Math.abs(ce)<4?this._type="trackpad":je>400?(this._type=null,this._lastValue=ce,this._timeout=setTimeout(this._onTimeout,40,I)):this._type||(this._type=Math.abs(je*ce)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ce+=this._lastValue)),I.shiftKey&&ce&&(ce/=4),this._type&&(this._lastWheelEvent=I,this._delta-=ce,this._active||this._start(I)),I.preventDefault()}_start(I){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 ce=a.mousePos(this._map.getCanvas(),I),Ne=this._tr;this._around=ce.y>Ne.transform.height/2-Ne.transform.getHorizon()?t.N.convert(this._aroundCenter?Ne.center:Ne.unproject(ce)):t.N.convert(Ne.center),this._aroundPoint=Ne.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const I=this._tr.transform;if(this._delta!==0){const tr=this._type==="wheel"&&Math.abs(this._delta)>vn?this._wheelZoomRate:this._defaultZoomRate;let xr=2/(1+Math.exp(-Math.abs(this._delta*tr)));this._delta<0&&xr!==0&&(xr=1/xr);const Or=typeof this._targetZoom=="number"?I.zoomScale(this._targetZoom):I.scale;this._targetZoom=Math.min(I.maxZoom,Math.max(I.minZoom,I.scaleZoom(Or*xr))),this._type==="wheel"&&(this._startZoom=I.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const ce=typeof this._targetZoom=="number"?this._targetZoom:I.zoom,Ne=this._startZoom,je=this._easing;let Ze,kt=!1;const Ft=i.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Ne&&je&&Ft){const tr=Math.min(Ft/200,1),xr=je(tr);Ze=t.y.number(Ne,ce,xr),tr<1?this._frameId||(this._frameId=!0):kt=!0}else Ze=ce,kt=!0;return this._active=!0,kt&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!kt,zoomDelta:Ze-I.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(I){let ce=t.b9;if(this._prevEase){const Ne=this._prevEase,je=(i.now()-Ne.start)/Ne.duration,Ze=Ne.easing(je+.01)-Ne.easing(je),kt=.27/Math.sqrt(Ze*Ze+1e-4)*.01,Ft=Math.sqrt(.0729-kt*kt);ce=t.b8(kt,Ft,.25,1)}return this._prevEase={start:i.now(),duration:I,easing:ce},ce}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Na{constructor(I,ce){this._clickZoom=I,this._tapZoom=ce}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 Ra{constructor(I){this._tr=new _c(I),this.reset()}reset(){this._active=!1}dblclick(I,ce){return I.preventDefault(),{cameraAnimation:Ne=>{Ne.easeTo({duration:300,zoom:this._tr.zoom+(I.shiftKey?-1:1),around:this._tr.unproject(ce)},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class pi{constructor(){this._tap=new jf({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(I,ce,Ne){if(!this._swipePoint)if(this._tapTime){const je=ce[0],Ze=I.timeStamp-this._tapTime<500,kt=this._tapPoint.dist(je)<30;Ze&&kt?Ne.length>0&&(this._swipePoint=je,this._swipeTouch=Ne[0].identifier):this.reset()}else this._tap.touchstart(I,ce,Ne)}touchmove(I,ce,Ne){if(this._tapTime){if(this._swipePoint){if(Ne[0].identifier!==this._swipeTouch)return;const je=ce[0],Ze=je.y-this._swipePoint.y;return this._swipePoint=je,I.preventDefault(),this._active=!0,{zoomDelta:Ze/128}}}else this._tap.touchmove(I,ce,Ne)}touchend(I,ce,Ne){if(this._tapTime)this._swipePoint&&Ne.length===0&&this.reset();else{const je=this._tap.touchend(I,ce,Ne);je&&(this._tapTime=I.timeStamp,this._tapPoint=je)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class xi{constructor(I,ce,Ne){this._el=I,this._mousePan=ce,this._touchPan=Ne}enable(I){this._inertiaOptions=I||{},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 $i{constructor(I,ce,Ne){this._pitchWithRotate=I.pitchWithRotate,this._mouseRotate=ce,this._mousePitch=Ne}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 ni{constructor(I,ce,Ne,je){this._el=I,this._touchZoom=ce,this._touchRotate=Ne,this._tapDragZoom=je,this._rotationDisabled=!1,this._enabled=!0}enable(I){this._touchZoom.enable(I),this._rotationDisabled||this._touchRotate.enable(I),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 Ii{constructor(I,ce){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=I,this._options=ce,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const I=this._map.getCanvasContainer();I.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",I);let ce=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(ce=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const Ne=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),je=document.createElement("div");je.className="maplibregl-desktop-message",je.textContent=ce,this._container.appendChild(je);const Ze=document.createElement("div");Ze.className="maplibregl-mobile-message",Ze.textContent=Ne,this._container.appendChild(Ze),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(I){return I[this._bypassKey]}notifyGestureBlocked(I,ce){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:I,originalEvent:ce})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const hi=Je=>Je.zoom||Je.drag||Je.pitch||Je.rotate;class Ja extends t.k{}function eo(Je){return Je.panDelta&&Je.panDelta.mag()||Je.zoomDelta||Je.bearingDelta||Je.pitchDelta}class zo{constructor(I,ce){this.handleWindowEvent=je=>{this.handleEvent(je,`${je.type}Window`)},this.handleEvent=(je,Ze)=>{if(je.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const kt=je.type==="renderFrame"?void 0:je,Ft={needsRenderFrame:!1},tr={},xr={},Or=je.touches,Ur=Or?this._getMapTouches(Or):void 0,hn=Ur?a.touchPos(this._map.getCanvas(),Ur):a.mousePos(this._map.getCanvas(),je);for(const{handlerName:dt,handler:Tt,allowed:Pt}of this._handlers){if(!Tt.isEnabled())continue;let qt;this._blockedByActive(xr,Pt,dt)?Tt.reset():Tt[Ze||je.type]&&(qt=Tt[Ze||je.type](je,hn,Ur),this.mergeHandlerResult(Ft,tr,qt,dt,kt),qt&&qt.needsRenderFrame&&this._triggerRenderFrame()),(qt||Tt.isActive())&&(xr[dt]=Tt)}const Cn={};for(const dt in this._previousActiveHandlers)xr[dt]||(Cn[dt]=kt);this._previousActiveHandlers=xr,(Object.keys(Cn).length||eo(Ft))&&(this._changes.push([Ft,tr,Cn]),this._triggerRenderFrame()),(Object.keys(xr).length||eo(Ft))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ot}=Ft;ot&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ot(this._map))},this._map=I,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Yf(I),this._bearingSnap=ce.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ce);const Ne=this._el;this._listeners=[[Ne,"touchstart",{passive:!0}],[Ne,"touchmove",{passive:!1}],[Ne,"touchend",void 0],[Ne,"touchcancel",void 0],[Ne,"mousedown",void 0],[Ne,"mousemove",void 0],[Ne,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Ne,"mouseover",void 0],[Ne,"mouseout",void 0],[Ne,"dblclick",void 0],[Ne,"click",void 0],[Ne,"keydown",{capture:!1}],[Ne,"keyup",void 0],[Ne,"wheel",{passive:!1}],[Ne,"contextmenu",void 0],[window,"blur",void 0]];for(const[je,Ze,kt]of this._listeners)a.addEventListener(je,Ze,je===document?this.handleWindowEvent:this.handleEvent,kt)}destroy(){for(const[I,ce,Ne]of this._listeners)a.removeEventListener(I,ce,I===document?this.handleWindowEvent:this.handleEvent,Ne)}_addDefaultHandlers(I){const ce=this._map,Ne=ce.getCanvasContainer();this._add("mapEvent",new Df(ce,I));const je=ce.boxZoom=new Fc(ce,I);this._add("boxZoom",je),I.interactive&&I.boxZoom&&je.enable();const Ze=ce.cooperativeGestures=new Ii(ce,I.cooperativeGestures);this._add("cooperativeGestures",Ze),I.cooperativeGestures&&Ze.enable();const kt=new yf(ce),Ft=new Ra(ce);ce.doubleClickZoom=new Na(Ft,kt),this._add("tapZoom",kt),this._add("clickZoom",Ft),I.interactive&&I.doubleClickZoom&&ce.doubleClickZoom.enable();const tr=new pi;this._add("tapDragZoom",tr);const xr=ce.touchPitch=new uh(ce);this._add("touchPitch",xr),I.interactive&&I.touchPitch&&ce.touchPitch.enable(I.touchPitch);const Or=Xu(I),Ur=gh(I);ce.dragRotate=new $i(I,Or,Ur),this._add("mouseRotate",Or,["mousePitch"]),this._add("mousePitch",Ur,["mouseRotate"]),I.interactive&&I.dragRotate&&ce.dragRotate.enable();const hn=(({enable:qt,clickTolerance:zt})=>{const Xt=new $c({checkCorrectEvent:Mr=>a.mouseButton(Mr)===0&&!Mr.ctrlKey});return new kc({clickTolerance:zt,move:(Mr,Rr)=>({around:Rr,panDelta:Rr.sub(Mr)}),activateOnStart:!0,moveStateManager:Xt,enable:qt,assignEvents:Fh})})(I),Cn=new Cc(I,ce);ce.dragPan=new xi(Ne,hn,Cn),this._add("mousePan",hn),this._add("touchPan",Cn,["touchZoom","touchRotate"]),I.interactive&&I.dragPan&&ce.dragPan.enable(I.dragPan);const ot=new _f,dt=new uc;ce.touchZoomRotate=new ni(Ne,dt,ot,tr),this._add("touchRotate",ot,["touchPan","touchZoom"]),this._add("touchZoom",dt,["touchPan","touchRotate"]),I.interactive&&I.touchZoomRotate&&ce.touchZoomRotate.enable(I.touchZoomRotate);const Tt=ce.scrollZoom=new Xn(ce,()=>this._triggerRenderFrame());this._add("scrollZoom",Tt,["mousePan"]),I.interactive&&I.scrollZoom&&ce.scrollZoom.enable(I.scrollZoom);const Pt=ce.keyboard=new qr(ce);this._add("keyboard",Pt),I.interactive&&I.keyboard&&ce.keyboard.enable(),this._add("blockableMapEvent",new Zl(ce))}_add(I,ce,Ne){this._handlers.push({handlerName:I,handler:ce,allowed:Ne}),this._handlersById[I]=ce}stop(I){if(!this._updatingCamera){for(const{handler:ce}of this._handlers)ce.reset();this._inertia.clear(),this._fireEvents({},{},I),this._changes=[]}}isActive(){for(const{handler:I}of this._handlers)if(I.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!hi(this._eventsInProgress)||this.isZooming()}_blockedByActive(I,ce,Ne){for(const je in I)if(je!==Ne&&(!ce||ce.indexOf(je)<0))return!0;return!1}_getMapTouches(I){const ce=[];for(const Ne of I)this._el.contains(Ne.target)&&ce.push(Ne);return ce}mergeHandlerResult(I,ce,Ne,je,Ze){if(!Ne)return;t.e(I,Ne);const kt={handlerName:je,originalEvent:Ne.originalEvent||Ze};Ne.zoomDelta!==void 0&&(ce.zoom=kt),Ne.panDelta!==void 0&&(ce.drag=kt),Ne.pitchDelta!==void 0&&(ce.pitch=kt),Ne.bearingDelta!==void 0&&(ce.rotate=kt)}_applyChanges(){const I={},ce={},Ne={};for(const[je,Ze,kt]of this._changes)je.panDelta&&(I.panDelta=(I.panDelta||new t.P(0,0))._add(je.panDelta)),je.zoomDelta&&(I.zoomDelta=(I.zoomDelta||0)+je.zoomDelta),je.bearingDelta&&(I.bearingDelta=(I.bearingDelta||0)+je.bearingDelta),je.pitchDelta&&(I.pitchDelta=(I.pitchDelta||0)+je.pitchDelta),je.around!==void 0&&(I.around=je.around),je.pinchAround!==void 0&&(I.pinchAround=je.pinchAround),je.noInertia&&(I.noInertia=je.noInertia),t.e(ce,Ze),t.e(Ne,kt);this._updateMapTransform(I,ce,Ne),this._changes=[]}_updateMapTransform(I,ce,Ne){const je=this._map,Ze=je._getTransformForUpdate(),kt=je.terrain;if(!(eo(I)||kt&&this._terrainMovement))return this._fireEvents(ce,Ne,!0);let{panDelta:Ft,zoomDelta:tr,bearingDelta:xr,pitchDelta:Or,around:Ur,pinchAround:hn}=I;hn!==void 0&&(Ur=hn),je._stop(!0),Ur=Ur||je.transform.centerPoint;const Cn=Ze.pointLocation(Ft?Ur.sub(Ft):Ur);xr&&(Ze.bearing+=xr),Or&&(Ze.pitch+=Or),tr&&(Ze.zoom+=tr),kt?this._terrainMovement||!ce.drag&&!ce.zoom?ce.drag&&this._terrainMovement?Ze.center=Ze.pointLocation(Ze.centerPoint.sub(Ft)):Ze.setLocationAtPoint(Cn,Ur):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Ze.setLocationAtPoint(Cn,Ur)):Ze.setLocationAtPoint(Cn,Ur),je._applyUpdatedTransform(Ze),this._map._update(),I.noInertia||this._inertia.record(I),this._fireEvents(ce,Ne,!0)}_fireEvents(I,ce,Ne){const je=hi(this._eventsInProgress),Ze=hi(I),kt={};for(const Ur in I){const{originalEvent:hn}=I[Ur];this._eventsInProgress[Ur]||(kt[`${Ur}start`]=hn),this._eventsInProgress[Ur]=I[Ur]}!je&&Ze&&this._fireEvent("movestart",Ze.originalEvent);for(const Ur in kt)this._fireEvent(Ur,kt[Ur]);Ze&&this._fireEvent("move",Ze.originalEvent);for(const Ur in I){const{originalEvent:hn}=I[Ur];this._fireEvent(Ur,hn)}const Ft={};let tr;for(const Ur in this._eventsInProgress){const{handlerName:hn,originalEvent:Cn}=this._eventsInProgress[Ur];this._handlersById[hn].isActive()||(delete this._eventsInProgress[Ur],tr=ce[hn]||Cn,Ft[`${Ur}end`]=tr)}for(const Ur in Ft)this._fireEvent(Ur,Ft[Ur]);const xr=hi(this._eventsInProgress),Or=(je||Ze)&&!xr;if(Or&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const Ur=this._map._getTransformForUpdate();Ur.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(Ur)}if(Ne&&Or){this._updatingCamera=!0;const Ur=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),hn=Cn=>Cn!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Ja("renderFrame",{timeStamp:I})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Io extends t.E{constructor(I,ce){super(),this._renderFrameCallback=()=>{const Ne=Math.min((i.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Ne)),Ne<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=I,this._bearingSnap=ce.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(I,ce){return this.jumpTo({center:I},ce)}panBy(I,ce,Ne){return I=t.P.convert(I).mult(-1),this.panTo(this.transform.center,t.e({offset:I},ce),Ne)}panTo(I,ce,Ne){return this.easeTo(t.e({center:I},ce),Ne)}getZoom(){return this.transform.zoom}setZoom(I,ce){return this.jumpTo({zoom:I},ce),this}zoomTo(I,ce,Ne){return this.easeTo(t.e({zoom:I},ce),Ne)}zoomIn(I,ce){return this.zoomTo(this.getZoom()+1,I,ce),this}zoomOut(I,ce){return this.zoomTo(this.getZoom()-1,I,ce),this}getBearing(){return this.transform.bearing}setBearing(I,ce){return this.jumpTo({bearing:I},ce),this}getPadding(){return this.transform.padding}setPadding(I,ce){return this.jumpTo({padding:I},ce),this}rotateTo(I,ce,Ne){return this.easeTo(t.e({bearing:I},ce),Ne)}resetNorth(I,ce){return this.rotateTo(0,t.e({duration:1e3},I),ce),this}resetNorthPitch(I,ce){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},I),ce),this}snapToNorth(I,ce){return Math.abs(this.getBearing()){if(this._zooming&&(je.zoom=t.y.number(Ze,Tt,Vr)),this._rotating&&(je.bearing=t.y.number(kt,xr,Vr)),this._pitching&&(je.pitch=t.y.number(Ft,Or,Vr)),this._padding&&(je.interpolatePadding(tr,Ur,Vr),Cn=je.centerPoint.add(hn)),this.terrain&&!I.freezeElevation&&this._updateElevation(Vr),Xt)je.setLocationAtPoint(Xt,Mr);else{const an=je.zoomScale(je.zoom-Ze),mn=Tt>Ze?Math.min(2,zt):Math.max(.5,zt),zn=Math.pow(mn,1-Vr),Gn=je.unproject(Pt.add(qt.mult(Vr*zn)).mult(an));je.setLocationAtPoint(je.renderWorldCopies?Gn.wrap():Gn,Cn)}this._applyUpdatedTransform(je),this._fireMoveEvents(ce)},Vr=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ce,Vr)},I),this}_prepareEase(I,ce,Ne={}){this._moving=!0,ce||Ne.moving||this.fire(new t.k("movestart",I)),this._zooming&&!Ne.zooming&&this.fire(new t.k("zoomstart",I)),this._rotating&&!Ne.rotating&&this.fire(new t.k("rotatestart",I)),this._pitching&&!Ne.pitching&&this.fire(new t.k("pitchstart",I))}_prepareElevation(I){this._elevationCenter=I,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(I,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(I){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const ce=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(I<1&&ce!==this._elevationTarget){const Ne=this._elevationTarget-this._elevationStart;this._elevationStart+=I*(Ne-(ce-(Ne*I+this._elevationStart))/(1-I)),this._elevationTarget=ce}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,I)}_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(I){const ce=I.getCameraPosition(),Ne=this.terrain.getElevationForLngLatZoom(ce.lngLat,I.zoom);if(ce.altitudethis._elevateCameraIfInsideTerrain(je)),this.transformCameraUpdate&&ce.push(je=>this.transformCameraUpdate(je)),!ce.length)return;const Ne=I.clone();for(const je of ce){const Ze=Ne.clone(),{center:kt,zoom:Ft,pitch:tr,bearing:xr,elevation:Or}=je(Ze);kt&&(Ze.center=kt),Ft!==void 0&&(Ze.zoom=Ft),tr!==void 0&&(Ze.pitch=tr),xr!==void 0&&(Ze.bearing=xr),Or!==void 0&&(Ze.elevation=Or),Ne.apply(Ze)}this.transform.apply(Ne)}_fireMoveEvents(I){this.fire(new t.k("move",I)),this._zooming&&this.fire(new t.k("zoom",I)),this._rotating&&this.fire(new t.k("rotate",I)),this._pitching&&this.fire(new t.k("pitch",I))}_afterEase(I,ce){if(this._easeId&&ce&&this._easeId===ce)return;delete this._easeId;const Ne=this._zooming,je=this._rotating,Ze=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ne&&this.fire(new t.k("zoomend",I)),je&&this.fire(new t.k("rotateend",I)),Ze&&this.fire(new t.k("pitchend",I)),this.fire(new t.k("moveend",I))}flyTo(I,ce){var Ne;if(!I.essential&&i.prefersReducedMotion){const mi=t.M(I,["center","zoom","bearing","pitch","around"]);return this.jumpTo(mi,ce)}this.stop(),I=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},I);const je=this._getTransformForUpdate(),Ze=je.zoom,kt=je.bearing,Ft=je.pitch,tr=je.padding,xr="bearing"in I?this._normalizeBearing(I.bearing,kt):kt,Or="pitch"in I?+I.pitch:Ft,Ur="padding"in I?I.padding:je.padding,hn=t.P.convert(I.offset);let Cn=je.centerPoint.add(hn);const ot=je.pointLocation(Cn),{center:dt,zoom:Tt}=je.getConstrained(t.N.convert(I.center||ot),(Ne=I.zoom)!==null&&Ne!==void 0?Ne:Ze);this._normalizeCenter(dt,je);const Pt=je.zoomScale(Tt-Ze),qt=je.project(ot),zt=je.project(dt).sub(qt);let Xt=I.curve;const Mr=Math.max(je.width,je.height),Rr=Mr/Pt,Vr=zt.mag();if("minZoom"in I){const mi=t.ac(Math.min(I.minZoom,Ze,Tt),je.minZoom,je.maxZoom),no=Mr/je.zoomScale(mi-Ze);Xt=Math.sqrt(no/Vr*2)}const an=Xt*Xt;function mn(mi){const no=(Rr*Rr-Mr*Mr+(mi?-1:1)*an*an*Vr*Vr)/(2*(mi?Rr:Mr)*an*Vr);return Math.log(Math.sqrt(no*no+1)-no)}function zn(mi){return(Math.exp(mi)-Math.exp(-mi))/2}function Gn(mi){return(Math.exp(mi)+Math.exp(-mi))/2}const oa=mn(!1);let Fa=function(mi){return Gn(oa)/Gn(oa+Xt*mi)},vi=function(mi){return Mr*((Gn(oa)*(zn(no=oa+Xt*mi)/Gn(no))-zn(oa))/an)/Vr;var no},li=(mn(!0)-oa)/Xt;if(Math.abs(Vr)<1e-6||!isFinite(li)){if(Math.abs(Mr-Rr)<1e-6)return this.easeTo(I,ce);const mi=Rr0,Fa=no=>Math.exp(mi*Xt*no)}return I.duration="duration"in I?+I.duration:1e3*li/("screenSpeed"in I?+I.screenSpeed/Xt:+I.speed),I.maxDuration&&I.duration>I.maxDuration&&(I.duration=0),this._zooming=!0,this._rotating=kt!==xr,this._pitching=Or!==Ft,this._padding=!je.isPaddingEqual(Ur),this._prepareEase(ce,!1),this.terrain&&this._prepareElevation(dt),this._ease(mi=>{const no=mi*li,To=1/Fa(no);je.zoom=mi===1?Tt:Ze+je.scaleZoom(To),this._rotating&&(je.bearing=t.y.number(kt,xr,mi)),this._pitching&&(je.pitch=t.y.number(Ft,Or,mi)),this._padding&&(je.interpolatePadding(tr,Ur,mi),Cn=je.centerPoint.add(hn)),this.terrain&&!I.freezeElevation&&this._updateElevation(mi);const go=mi===1?dt:je.unproject(qt.add(zt.mult(vi(no))).mult(To));je.setLocationAtPoint(je.renderWorldCopies?go.wrap():go,Cn),this._applyUpdatedTransform(je),this._fireMoveEvents(ce)},()=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ce)},I),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(I,ce){var Ne;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const je=this._onEaseEnd;delete this._onEaseEnd,je.call(this,ce)}return I||(Ne=this.handlers)===null||Ne===void 0||Ne.stop(!1),this}_ease(I,ce,Ne){Ne.animate===!1||Ne.duration===0?(I(1),ce()):(this._easeStart=i.now(),this._easeOptions=Ne,this._onEaseFrame=I,this._onEaseEnd=ce,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(I,ce){I=t.b3(I,-180,180);const Ne=Math.abs(I-ce);return Math.abs(I-360-ce)180?-360:Ne<-180?360:0}queryTerrainElevation(I){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(I),this.transform.tileZoom)-this.transform.elevation:null}}const Vo={compact:!0,customAttribution:'MapLibre'};class Bo{constructor(I=Vo){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=ce=>{!ce||ce.sourceDataType!=="metadata"&&ce.sourceDataType!=="visibility"&&ce.dataType!=="style"&&ce.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=I}getDefaultPosition(){return"bottom-right"}onAdd(I){return this._map=I,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(I,ce){const Ne=this._map._getUIString(`AttributionControl.${ce}`);I.title=Ne,I.setAttribute("aria-label",Ne)}_updateAttributions(){if(!this._map.style)return;let I=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?I=I.concat(this.options.customAttribution.map(je=>typeof je!="string"?"":je)):typeof this.options.customAttribution=="string"&&I.push(this.options.customAttribution)),this._map.style.stylesheet){const je=this._map.style.stylesheet;this.styleOwner=je.owner,this.styleId=je.id}const ce=this._map.style.sourceCaches;for(const je in ce){const Ze=ce[je];if(Ze.used||Ze.usedForTerrain){const kt=Ze.getSource();kt.attribution&&I.indexOf(kt.attribution)<0&&I.push(kt.attribution)}}I=I.filter(je=>String(je).trim()),I.sort((je,Ze)=>je.length-Ze.length),I=I.filter((je,Ze)=>{for(let kt=Ze+1;kt=0)return!1;return!0});const Ne=I.join(" | ");Ne!==this._attribHTML&&(this._attribHTML=Ne,I.length?(this._innerContainer.innerHTML=Ne,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class ro{constructor(I={}){this._updateCompact=()=>{const ce=this._container.children;if(ce.length){const Ne=ce[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Ne.classList.add("maplibregl-compact"):Ne.classList.remove("maplibregl-compact")}},this.options=I}getDefaultPosition(){return"bottom-left"}onAdd(I){this._map=I,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl");const ce=a.create("a","maplibregl-ctrl-logo");return ce.target="_blank",ce.rel="noopener nofollow",ce.href="https://maplibre.org/",ce.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ce.setAttribute("rel","noopener nofollow"),this._container.appendChild(ce),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 Ni{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(I){const ce=++this._id;return this._queue.push({callback:I,id:ce,cancelled:!1}),ce}remove(I){const ce=this._currentlyRunning,Ne=ce?this._queue.concat(ce):this._queue;for(const je of Ne)if(je.id===I)return void(je.cancelled=!0)}run(I=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const ce=this._currentlyRunning=this._queue;this._queue=[];for(const Ne of ce)if(!Ne.cancelled&&(Ne.callback(I),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 Os extends t.E{constructor(I){super(),this.sourceCache=I,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,I.usedForTerrain=!0,I.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(I,ce){this.sourceCache.update(I,ce),this._renderableTilesKeys=[];const Ne={};for(const je of I.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:ce}))Ne[je.key]=!0,this._renderableTilesKeys.push(je.key),this._tiles[je.key]||(je.posMatrix=new Float64Array(16),t.aP(je.posMatrix,0,t.X,0,t.X,0,1),this._tiles[je.key]=new wt(je,this.tileSize));for(const je in this._tiles)Ne[je]||delete this._tiles[je]}freeRtt(I){for(const ce in this._tiles){const Ne=this._tiles[ce];(!I||Ne.tileID.equals(I)||Ne.tileID.isChildOf(I)||I.isChildOf(Ne.tileID))&&(Ne.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(I=>this.getTileByID(I))}getTileByID(I){return this._tiles[I]}getTerrainCoords(I){const ce={};for(const Ne of this._renderableTilesKeys){const je=this._tiles[Ne].tileID;if(je.canonical.equals(I.canonical)){const Ze=I.clone();Ze.posMatrix=new Float64Array(16),t.aP(Ze.posMatrix,0,t.X,0,t.X,0,1),ce[Ne]=Ze}else if(je.canonical.isChildOf(I.canonical)){const Ze=I.clone();Ze.posMatrix=new Float64Array(16);const kt=je.canonical.z-I.canonical.z,Ft=je.canonical.x-(je.canonical.x>>kt<>kt<>kt;t.aP(Ze.posMatrix,0,xr,0,xr,0,1),t.J(Ze.posMatrix,Ze.posMatrix,[-Ft*xr,-tr*xr,0]),ce[Ne]=Ze}else if(I.canonical.isChildOf(je.canonical)){const Ze=I.clone();Ze.posMatrix=new Float64Array(16);const kt=I.canonical.z-je.canonical.z,Ft=I.canonical.x-(I.canonical.x>>kt<>kt<>kt;t.aP(Ze.posMatrix,0,t.X,0,t.X,0,1),t.J(Ze.posMatrix,Ze.posMatrix,[Ft*xr,tr*xr,0]),t.K(Ze.posMatrix,Ze.posMatrix,[1/2**kt,1/2**kt,0]),ce[Ne]=Ze}}return ce}getSourceTile(I,ce){const Ne=this.sourceCache._source;let je=I.overscaledZ-this.deltaZoom;if(je>Ne.maxzoom&&(je=Ne.maxzoom),je=Ne.minzoom&&(!Ze||!Ze.dem);)Ze=this.sourceCache.getTileByID(I.scaledTo(je--).key);return Ze}tilesAfterTime(I=Date.now()){return Object.values(this._tiles).filter(ce=>ce.timeAdded>=I)}}class yl{constructor(I,ce,Ne){this.painter=I,this.sourceCache=new Os(ce),this.options=Ne,this.exaggeration=typeof Ne.exaggeration=="number"?Ne.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(I,ce,Ne,je=t.X){var Ze;if(!(ce>=0&&ce=0&&NeI.canonical.z&&(I.canonical.z>=je?Ze=I.canonical.z-je:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const kt=I.canonical.x-(I.canonical.x>>Ze<>Ze<>8<<4|Ze>>8,ce[kt+3]=0;const Ne=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(ce.buffer)),je=new u(I,Ne,I.gl.RGBA,{premultiply:!1});return je.bind(I.gl.NEAREST,I.gl.CLAMP_TO_EDGE),this._coordsTexture=je,je}pointCoordinate(I){this.painter.maybeDrawDepthAndCoords(!0);const ce=new Uint8Array(4),Ne=this.painter.context,je=Ne.gl,Ze=Math.round(I.x*this.painter.pixelRatio/devicePixelRatio),kt=Math.round(I.y*this.painter.pixelRatio/devicePixelRatio),Ft=Math.round(this.painter.height/devicePixelRatio);Ne.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),je.readPixels(Ze,Ft-kt-1,1,1,je.RGBA,je.UNSIGNED_BYTE,ce),Ne.bindFramebuffer.set(null);const tr=ce[0]+(ce[2]>>4<<8),xr=ce[1]+((15&ce[2])<<8),Or=this.coordsIndex[255-ce[3]],Ur=Or&&this.sourceCache.getTileByID(Or);if(!Ur)return null;const hn=this._coordsTextureSize,Cn=(1<I.id!==ce),this._recentlyUsed.push(I.id)}stampObject(I){I.stamp=++this._stamp}getOrCreateFreeObject(){for(const ce of this._recentlyUsed)if(!this._objects[ce].inUse)return this._objects[ce];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const I=this._createObject(this._objects.length);return this._objects.push(I),I}freeObject(I){I.inUse=!1}freeAllObjects(){for(const I of this._objects)this.freeObject(I)}isFull(){return!(this._objects.length!I.inUse)===!1}}const _l={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Vl{constructor(I,ce){this.painter=I,this.terrain=ce,this.pool=new jl(I.context,30,ce.sourceCache.tileSize*ce.qualityFactor)}destruct(){this.pool.destruct()}getTexture(I){return this.pool.getObjectForId(I.rtt[this._stacks.length-1].id).texture}prepareForRender(I,ce){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=I._order.filter(Ne=>!I._layers[Ne].isHidden(ce)),this._coordsDescendingInv={};for(const Ne in I.sourceCaches){this._coordsDescendingInv[Ne]={};const je=I.sourceCaches[Ne].getVisibleCoordinates();for(const Ze of je){const kt=this.terrain.sourceCache.getTerrainCoords(Ze);for(const Ft in kt)this._coordsDescendingInv[Ne][Ft]||(this._coordsDescendingInv[Ne][Ft]=[]),this._coordsDescendingInv[Ne][Ft].push(kt[Ft])}}this._coordsDescendingInvStr={};for(const Ne of I._order){const je=I._layers[Ne],Ze=je.source;if(_l[je.type]&&!this._coordsDescendingInvStr[Ze]){this._coordsDescendingInvStr[Ze]={};for(const kt in this._coordsDescendingInv[Ze])this._coordsDescendingInvStr[Ze][kt]=this._coordsDescendingInv[Ze][kt].map(Ft=>Ft.key).sort().join()}}for(const Ne of this._renderableTiles)for(const je in this._coordsDescendingInvStr){const Ze=this._coordsDescendingInvStr[je][Ne.tileID.key];Ze&&Ze!==Ne.rttCoords[je]&&(Ne.rtt=[])}}renderLayer(I){if(I.isHidden(this.painter.transform.zoom))return!1;const ce=I.type,Ne=this.painter,je=this._renderableLayerIds[this._renderableLayerIds.length-1]===I.id;if(_l[ce]&&(this._prevType&&_l[this._prevType]||this._stacks.push([]),this._prevType=ce,this._stacks[this._stacks.length-1].push(I.id),!je))return!0;if(_l[this._prevType]||_l[ce]&&je){this._prevType=ce;const Ze=this._stacks.length-1,kt=this._stacks[Ze]||[];for(const Ft of this._renderableTiles){if(this.pool.isFull()&&(du(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(Ft),Ft.rtt[Ze]){const xr=this.pool.getObjectForId(Ft.rtt[Ze].id);if(xr.stamp===Ft.rtt[Ze].stamp){this.pool.useObject(xr);continue}}const tr=this.pool.getOrCreateFreeObject();this.pool.useObject(tr),this.pool.stampObject(tr),Ft.rtt[Ze]={id:tr.id,stamp:tr.stamp},Ne.context.bindFramebuffer.set(tr.fbo.framebuffer),Ne.context.clear({color:t.aM.transparent,stencil:0}),Ne.currentStencilSource=void 0;for(let xr=0;xr{Je.touchstart=Je.dragStart,Je.touchmoveWindow=Je.dragMove,Je.touchend=Je.dragEnd},bo={showCompass:!0,showZoom:!0,visualizePitch:!1};class ms{constructor(I,ce,Ne=!1){this.mousedown=kt=>{this.startMouse(t.e({},kt,{ctrlKey:!0,preventDefault:()=>kt.preventDefault()}),a.mousePos(this.element,kt)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=kt=>{this.moveMouse(kt,a.mousePos(this.element,kt))},this.mouseup=kt=>{this.mouseRotate.dragEnd(kt),this.mousePitch&&this.mousePitch.dragEnd(kt),this.offTemp()},this.touchstart=kt=>{kt.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,kt.targetTouches)[0],this.startTouch(kt,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=kt=>{kt.targetTouches.length!==1?this.reset():(this._lastPos=a.touchPos(this.element,kt.targetTouches)[0],this.moveTouch(kt,this._lastPos))},this.touchend=kt=>{kt.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 je=I.dragRotate._mouseRotate.getClickTolerance(),Ze=I.dragRotate._mousePitch.getClickTolerance();this.element=ce,this.mouseRotate=Xu({clickTolerance:je,enable:!0}),this.touchRotate=(({enable:kt,clickTolerance:Ft,bearingDegreesPerPixelMoved:tr=.8})=>{const xr=new qf;return new kc({clickTolerance:Ft,move:(Or,Ur)=>({bearingDelta:(Ur.x-Or.x)*tr}),moveStateManager:xr,enable:kt,assignEvents:Fl})})({clickTolerance:je,enable:!0}),this.map=I,Ne&&(this.mousePitch=gh({clickTolerance:Ze,enable:!0}),this.touchPitch=(({enable:kt,clickTolerance:Ft,pitchDegreesPerPixelMoved:tr=-.5})=>{const xr=new qf;return new kc({clickTolerance:Ft,move:(Or,Ur)=>({pitchDelta:(Ur.y-Or.y)*tr}),moveStateManager:xr,enable:kt,assignEvents:Fl})})({clickTolerance:Ze,enable:!0})),a.addEventListener(ce,"mousedown",this.mousedown),a.addEventListener(ce,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(ce,"touchcancel",this.reset)}startMouse(I,ce){this.mouseRotate.dragStart(I,ce),this.mousePitch&&this.mousePitch.dragStart(I,ce),a.disableDrag()}startTouch(I,ce){this.touchRotate.dragStart(I,ce),this.touchPitch&&this.touchPitch.dragStart(I,ce),a.disableDrag()}moveMouse(I,ce){const Ne=this.map,{bearingDelta:je}=this.mouseRotate.dragMove(I,ce)||{};if(je&&Ne.setBearing(Ne.getBearing()+je),this.mousePitch){const{pitchDelta:Ze}=this.mousePitch.dragMove(I,ce)||{};Ze&&Ne.setPitch(Ne.getPitch()+Ze)}}moveTouch(I,ce){const Ne=this.map,{bearingDelta:je}=this.touchRotate.dragMove(I,ce)||{};if(je&&Ne.setBearing(Ne.getBearing()+je),this.touchPitch){const{pitchDelta:Ze}=this.touchPitch.dragMove(I,ce)||{};Ze&&Ne.setPitch(Ne.getPitch()+Ze)}}off(){const I=this.element;a.removeEventListener(I,"mousedown",this.mousedown),a.removeEventListener(I,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(I,"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 Cl;function cl(Je,I,ce){const Ne=new t.N(Je.lng,Je.lat);if(Je=new t.N(Je.lng,Je.lat),I){const je=new t.N(Je.lng-360,Je.lat),Ze=new t.N(Je.lng+360,Je.lat),kt=ce.locationPoint(Je).distSqr(I);ce.locationPoint(je).distSqr(I)180;){const je=ce.locationPoint(Je);if(je.x>=0&&je.y>=0&&je.x<=ce.width&&je.y<=ce.height)break;Je.lng>ce.center.lng?Je.lng-=360:Je.lng+=360}return Je.lng!==Ne.lng&&ce.locationPoint(Je).y>ce.height/2-ce.getHorizon()?Je:Ne}const ic={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 oc(Je,I,ce){const Ne=Je.classList;for(const je in ic)Ne.remove(`maplibregl-${ce}-anchor-${je}`);Ne.add(`maplibregl-${ce}-anchor-${I}`)}class cc extends t.E{constructor(I){if(super(),this._onKeyPress=ce=>{const Ne=ce.code,je=ce.charCode||ce.keyCode;Ne!=="Space"&&Ne!=="Enter"&&je!==32&&je!==13||this.togglePopup()},this._onMapClick=ce=>{const Ne=ce.originalEvent.target,je=this._element;this._popup&&(Ne===je||je.contains(Ne))&&this.togglePopup()},this._update=ce=>{var Ne;if(!this._map)return;const je=this._map.loaded()&&!this._map.isMoving();(ce?.type==="terrain"||ce?.type==="render"&&!je)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?cl(this._lngLat,this._flatPos,this._map.transform):(Ne=this._lngLat)===null||Ne===void 0?void 0:Ne.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 Ze="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Ze=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Ze=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let kt="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?kt="rotateX(0deg)":this._pitchAlignment==="map"&&(kt=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||ce&&ce.type!=="moveend"||(this._pos=this._pos.round()),a.setTransform(this._element,`${ic[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${kt} ${Ze}`),i.frameAsync(new AbortController).then(()=>{this._updateOpacity(ce&&ce.type==="moveend")}).catch(()=>{})},this._onMove=ce=>{if(!this._isDragging){const Ne=this._clickTolerance||this._map._clickTolerance;this._isDragging=ce.point.dist(this._pointerdownPos)>=Ne}this._isDragging&&(this._pos=ce.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=ce=>{this._element.contains(ce.originalEvent.target)&&(ce.preventDefault(),this._positionDelta=ce.point.sub(this._pos).add(this._offset),this._pointerdownPos=ce.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=I&&I.anchor||"center",this._color=I&&I.color||"#3FB1CE",this._scale=I&&I.scale||1,this._draggable=I&&I.draggable||!1,this._clickTolerance=I&&I.clickTolerance||0,this._subpixelPositioning=I&&I.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=I&&I.rotation||0,this._rotationAlignment=I&&I.rotationAlignment||"auto",this._pitchAlignment=I&&I.pitchAlignment&&I.pitchAlignment!=="auto"?I.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(I?.opacity,I?.opacityWhenCovered),I&&I.element)this._element=I.element,this._offset=t.P.convert(I&&I.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");const ce=a.createNS("http://www.w3.org/2000/svg","svg"),Ne=41,je=27;ce.setAttributeNS(null,"display","block"),ce.setAttributeNS(null,"height",`${Ne}px`),ce.setAttributeNS(null,"width",`${je}px`),ce.setAttributeNS(null,"viewBox",`0 0 ${je} ${Ne}`);const Ze=a.createNS("http://www.w3.org/2000/svg","g");Ze.setAttributeNS(null,"stroke","none"),Ze.setAttributeNS(null,"stroke-width","1"),Ze.setAttributeNS(null,"fill","none"),Ze.setAttributeNS(null,"fill-rule","evenodd");const kt=a.createNS("http://www.w3.org/2000/svg","g");kt.setAttributeNS(null,"fill-rule","nonzero");const Ft=a.createNS("http://www.w3.org/2000/svg","g");Ft.setAttributeNS(null,"transform","translate(3.0, 29.0)"),Ft.setAttributeNS(null,"fill","#000000");const tr=[{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 Pt of tr){const qt=a.createNS("http://www.w3.org/2000/svg","ellipse");qt.setAttributeNS(null,"opacity","0.04"),qt.setAttributeNS(null,"cx","10.5"),qt.setAttributeNS(null,"cy","5.80029008"),qt.setAttributeNS(null,"rx",Pt.rx),qt.setAttributeNS(null,"ry",Pt.ry),Ft.appendChild(qt)}const xr=a.createNS("http://www.w3.org/2000/svg","g");xr.setAttributeNS(null,"fill",this._color);const Or=a.createNS("http://www.w3.org/2000/svg","path");Or.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"),xr.appendChild(Or);const Ur=a.createNS("http://www.w3.org/2000/svg","g");Ur.setAttributeNS(null,"opacity","0.25"),Ur.setAttributeNS(null,"fill","#000000");const hn=a.createNS("http://www.w3.org/2000/svg","path");hn.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"),Ur.appendChild(hn);const Cn=a.createNS("http://www.w3.org/2000/svg","g");Cn.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Cn.setAttributeNS(null,"fill","#FFFFFF");const ot=a.createNS("http://www.w3.org/2000/svg","g");ot.setAttributeNS(null,"transform","translate(8.0, 8.0)");const dt=a.createNS("http://www.w3.org/2000/svg","circle");dt.setAttributeNS(null,"fill","#000000"),dt.setAttributeNS(null,"opacity","0.25"),dt.setAttributeNS(null,"cx","5.5"),dt.setAttributeNS(null,"cy","5.5"),dt.setAttributeNS(null,"r","5.4999962");const Tt=a.createNS("http://www.w3.org/2000/svg","circle");Tt.setAttributeNS(null,"fill","#FFFFFF"),Tt.setAttributeNS(null,"cx","5.5"),Tt.setAttributeNS(null,"cy","5.5"),Tt.setAttributeNS(null,"r","5.4999962"),ot.appendChild(dt),ot.appendChild(Tt),kt.appendChild(Ft),kt.appendChild(xr),kt.appendChild(Ur),kt.appendChild(Cn),kt.appendChild(ot),ce.appendChild(kt),ce.setAttributeNS(null,"height",Ne*this._scale+"px"),ce.setAttributeNS(null,"width",je*this._scale+"px"),this._element.appendChild(ce),this._offset=t.P.convert(I&&I.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",ce=>{ce.preventDefault()}),this._element.addEventListener("mousedown",ce=>{ce.preventDefault()}),oc(this._element,this._anchor,"marker"),I&&I.className)for(const ce of I.className.split(" "))this._element.classList.add(ce);this._popup=null}addTo(I){return this.remove(),this._map=I,this._element.setAttribute("aria-label",I._getUIString("Marker.Title")),I.getCanvasContainer().appendChild(this._element),I.on("move",this._update),I.on("moveend",this._update),I.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(I){return this._lngLat=t.N.convert(I),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(I){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),I){if(!("offset"in I.options)){const je=Math.abs(13.5)/Math.SQRT2;I.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[je,-1*(38.1-13.5+je)],"bottom-right":[-je,-1*(38.1-13.5+je)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=I,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(I){return this._subpixelPositioning=I,this}getPopup(){return this._popup}togglePopup(){const I=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:I?(I.isOpen()?I.remove():(I.setLngLat(this._lngLat),I.addTo(this._map)),this):this}_updateOpacity(I=!1){var ce,Ne;if(!(!((ce=this._map)===null||ce===void 0)&&ce.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(I)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const je=this._map,Ze=je.terrain.depthAtPoint(this._pos),kt=je.terrain.getElevationForLngLatZoom(this._lngLat,je.transform.tileZoom);if(je.transform.lngLatToCameraDepth(this._lngLat,kt)-Ze<.006)return void(this._element.style.opacity=this._opacity);const Ft=-this._offset.y/je.transform._pixelPerMeter,tr=Math.sin(je.getPitch()*Math.PI/180)*Ft,xr=je.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),Or=je.transform.lngLatToCameraDepth(this._lngLat,kt+tr)-xr>.006;!((Ne=this._popup)===null||Ne===void 0)&&Ne.isOpen()&&Or&&this._popup.remove(),this._element.style.opacity=Or?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(I){return this._offset=t.P.convert(I),this._update(),this}addClassName(I){this._element.classList.add(I)}removeClassName(I){this._element.classList.remove(I)}toggleClassName(I){return this._element.classList.toggle(I)}setDraggable(I){return this._draggable=!!I,this._map&&(I?(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(I){return this._rotation=I||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(I){return this._rotationAlignment=I||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(I){return this._pitchAlignment=I&&I!=="auto"?I:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(I,ce){return I===void 0&&ce===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),I!==void 0&&(this._opacity=I),ce!==void 0&&(this._opacityWhenCovered=ce),this._map&&this._updateOpacity(!0),this}}const Sf={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let sc=0,sf=!1;const wu={maxWidth:100,unit:"metric"};function lf(Je,I,ce){const Ne=ce&&ce.maxWidth||100,je=Je._container.clientHeight/2,Ze=Je.unproject([0,je]),kt=Je.unproject([Ne,je]),Ft=Ze.distanceTo(kt);if(ce&&ce.unit==="imperial"){const tr=3.2808*Ft;tr>5280?qo(I,Ne,tr/5280,Je._getUIString("ScaleControl.Miles")):qo(I,Ne,tr,Je._getUIString("ScaleControl.Feet"))}else ce&&ce.unit==="nautical"?qo(I,Ne,Ft/1852,Je._getUIString("ScaleControl.NauticalMiles")):Ft>=1e3?qo(I,Ne,Ft/1e3,Je._getUIString("ScaleControl.Kilometers")):qo(I,Ne,Ft,Je._getUIString("ScaleControl.Meters"))}function qo(Je,I,ce,Ne){const je=function(Ze){const kt=Math.pow(10,`${Math.floor(Ze)}`.length-1);let Ft=Ze/kt;return Ft=Ft>=10?10:Ft>=5?5:Ft>=3?3:Ft>=2?2:Ft>=1?1:function(tr){const xr=Math.pow(10,Math.ceil(-Math.log(tr)/Math.LN10));return Math.round(tr*xr)/xr}(Ft),kt*Ft}(ce);Je.style.width=I*(je/ce)+"px",Je.innerHTML=`${je} ${Ne}`}const as={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},uf=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Pc(Je){if(Je){if(typeof Je=="number"){const I=Math.round(Math.abs(Je)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,Je),"top-left":new t.P(I,I),"top-right":new t.P(-I,I),bottom:new t.P(0,-Je),"bottom-left":new t.P(I,-I),"bottom-right":new t.P(-I,-I),left:new t.P(Je,0),right:new t.P(-Je,0)}}if(Je instanceof t.P||Array.isArray(Je)){const I=t.P.convert(Je);return{center:I,top:I,"top-left":I,"top-right":I,bottom:I,"bottom-left":I,"bottom-right":I,left:I,right:I}}return{center:t.P.convert(Je.center||[0,0]),top:t.P.convert(Je.top||[0,0]),"top-left":t.P.convert(Je["top-left"]||[0,0]),"top-right":t.P.convert(Je["top-right"]||[0,0]),bottom:t.P.convert(Je.bottom||[0,0]),"bottom-left":t.P.convert(Je["bottom-left"]||[0,0]),"bottom-right":t.P.convert(Je["bottom-right"]||[0,0]),left:t.P.convert(Je.left||[0,0]),right:t.P.convert(Je.right||[0,0])}}return Pc(new t.P(0,0))}const bc=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=Bo,e.BoxZoomHandler=Fc,e.CanvasSource=mt,e.CooperativeGesturesHandler=Ii,e.DoubleClickZoomHandler=Na,e.DragPanHandler=xi,e.DragRotateHandler=$i,e.EdgeInsets=ac,e.FullscreenControl=class extends t.E{constructor(Je={}){super(),this._onFullscreenChange=()=>{var I;let ce=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((I=ce?.shadowRoot)===null||I===void 0)&&I.fullscreenElement;)ce=ce.shadowRoot.fullscreenElement;ce===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,Je&&Je.container&&(Je.container instanceof HTMLElement?this._container=Je.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(Je){return this._map=Je,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 Je=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon",Je).setAttribute("aria-hidden","true"),Je.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const Je=this._getTitle();this._fullscreenButton.setAttribute("aria-label",Je),this._fullscreenButton.title=Je}_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=We,e.GeolocateControl=class extends t.E{constructor(Je){super(),this._onSuccess=I=>{if(this._map){if(this._isOutOfMapMaxBounds(I))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",I)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=I,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(I),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(I),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",I)),this._finish()}},this._updateCamera=I=>{const ce=new t.N(I.coords.longitude,I.coords.latitude),Ne=I.coords.accuracy,je=this._map.getBearing(),Ze=t.e({bearing:je},this.options.fitBoundsOptions),kt=ue.fromLngLat(ce,Ne);this._map.fitBounds(kt,Ze,{geolocateSource:!0})},this._updateMarker=I=>{if(I){const ce=new t.N(I.coords.longitude,I.coords.latitude);this._accuracyCircleMarker.setLngLat(ce).addTo(this._map),this._userLocationDotMarker.setLngLat(ce).addTo(this._map),this._accuracy=I.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=I=>{if(this._map){if(this.options.trackUserLocation)if(I.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 ce=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ce,this._geolocateButton.setAttribute("aria-label",ce),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(I.code===3&&sf)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",I)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",I=>I.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=I=>{if(this._map){if(I===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");const ce=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=ce,this._geolocateButton.setAttribute("aria-label",ce)}else{const ce=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=ce,this._geolocateButton.setAttribute("aria-label",ce)}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 cc({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new cc({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",ce=>{ce.geolocateSource||this._watchState!=="ACTIVE_LOCK"||ce.originalEvent&&ce.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({},Sf,Je)}onAdd(Je){return this._map=Je,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return t._(this,arguments,void 0,function*(I=!1){if(Cl!==void 0&&!I)return Cl;if(window.navigator.permissions===void 0)return Cl=!!window.navigator.geolocation,Cl;try{Cl=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Cl=!!window.navigator.geolocation}return Cl})}().then(I=>this._finishSetupUI(I)),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,sc=0,sf=!1}_isOutOfMapMaxBounds(Je){const I=this._map.getMaxBounds(),ce=Je.coords;return I&&(ce.longitudeI.getEast()||ce.latitudeI.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 Je=this._map.getBounds(),I=Je.getSouthEast(),ce=Je.getNorthEast(),Ne=I.distanceTo(ce),je=Math.ceil(this._accuracy/(Ne/this._map._container.clientHeight)*2);this._circleElement.style.width=`${je}px`,this._circleElement.style.height=`${je}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":sc--,sf=!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 Je;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),sc++,sc>1?(Je={maximumAge:6e5,timeout:0},sf=!0):(Je=this.options.positionOptions,sf=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,Je)}}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=Hc,e.ImageSource=yt,e.KeyboardHandler=qr,e.LngLatBounds=ue,e.LogoControl=ro,e.Map=class extends Io{constructor(Je){t.bf.mark(t.bg.create);const I=Object.assign(Object.assign({},yu),Je);if(I.minZoom!=null&&I.maxZoom!=null&&I.minZoom>I.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(I.minPitch!=null&&I.maxPitch!=null&&I.minPitch>I.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(I.minPitch!=null&&I.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(I.maxPitch!=null&&I.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new nu(I.minZoom,I.maxZoom,I.minPitch,I.maxPitch,I.renderWorldCopies),{bearingSnap:I.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ni,this._controls=[],this._mapId=t.a4(),this._contextLost=ce=>{ce.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:ce}))},this._contextRestored=ce=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:ce}))},this._onMapScroll=ce=>{if(ce.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=I.interactive,this._maxTileCacheSize=I.maxTileCacheSize,this._maxTileCacheZoomLevels=I.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=I.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=I.preserveDrawingBuffer===!0,this._antialias=I.antialias===!0,this._trackResize=I.trackResize===!0,this._bearingSnap=I.bearingSnap,this._refreshExpiredTiles=I.refreshExpiredTiles===!0,this._fadeDuration=I.fadeDuration,this._crossSourceCollisions=I.crossSourceCollisions===!0,this._collectResourceTiming=I.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Ks),I.locale),this._clickTolerance=I.clickTolerance,this._overridePixelRatio=I.pixelRatio,this._maxCanvasSize=I.maxCanvasSize,this.transformCameraUpdate=I.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=I.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new g(I.transformRequest),typeof I.container=="string"){if(this._container=document.getElementById(I.container),!this._container)throw new Error(`Container '${I.container}' not found.`)}else{if(!(I.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=I.container}if(I.maxBounds&&this.setMaxBounds(I.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 ce=!1;const Ne=Cf(je=>{this._trackResize&&!this._removed&&(this.resize(je),this.redraw())},50);this._resizeObserver=new ResizeObserver(je=>{ce?Ne(je):ce=!0}),this._resizeObserver.observe(this._container)}this.handlers=new zo(this,I),this._hash=I.hash&&new Hc(typeof I.hash=="string"&&I.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:I.center,zoom:I.zoom,bearing:I.bearing,pitch:I.pitch}),I.bounds&&(this.resize(),this.fitBounds(I.bounds,t.e({},I.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=I.localIdeographFontFamily,this._validateStyle=I.validateStyle,I.style&&this.setStyle(I.style,{localIdeographFontFamily:I.localIdeographFontFamily}),I.attributionControl&&this.addControl(new Bo(typeof I.attributionControl=="boolean"?void 0:I.attributionControl)),I.maplibreLogo&&this.addControl(new ro,I.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",ce=>{this._update(ce.dataType==="style"),this.fire(new t.k(`${ce.dataType}data`,ce))}),this.on("dataloading",ce=>{this.fire(new t.k(`${ce.dataType}dataloading`,ce))}),this.on("dataabort",ce=>{this.fire(new t.k("sourcedataabort",ce))})}_getMapId(){return this._mapId}addControl(Je,I){if(I===void 0&&(I=Je.getDefaultPosition?Je.getDefaultPosition():"top-right"),!Je||!Je.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 ce=Je.onAdd(this);this._controls.push(Je);const Ne=this._controlPositions[I];return I.indexOf("bottom")!==-1?Ne.insertBefore(ce,Ne.firstChild):Ne.appendChild(ce),this}removeControl(Je){if(!Je||!Je.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 I=this._controls.indexOf(Je);return I>-1&&this._controls.splice(I,1),Je.onRemove(this),this}hasControl(Je){return this._controls.indexOf(Je)>-1}calculateCameraOptionsFromTo(Je,I,ce,Ne){return Ne==null&&this.terrain&&(Ne=this.terrain.getElevationForLngLatZoom(ce,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(Je,I,ce,Ne)}resize(Je){var I;const ce=this._containerDimensions(),Ne=ce[0],je=ce[1],Ze=this._getClampedPixelRatio(Ne,je);if(this._resizeCanvas(Ne,je,Ze),this.painter.resize(Ne,je,Ze),this.painter.overLimit()){const Ft=this.painter.context.gl;this._maxCanvasSize=[Ft.drawingBufferWidth,Ft.drawingBufferHeight];const tr=this._getClampedPixelRatio(Ne,je);this._resizeCanvas(Ne,je,tr),this.painter.resize(Ne,je,tr)}this.transform.resize(Ne,je),(I=this._requestedCameraState)===null||I===void 0||I.resize(Ne,je);const kt=!this._moving;return kt&&(this.stop(),this.fire(new t.k("movestart",Je)).fire(new t.k("move",Je))),this.fire(new t.k("resize",Je)),kt&&this.fire(new t.k("moveend",Je)),this}_getClampedPixelRatio(Je,I){const{0:ce,1:Ne}=this._maxCanvasSize,je=this.getPixelRatio(),Ze=Je*je,kt=I*je;return Math.min(Ze>ce?ce/Ze:1,kt>Ne?Ne/kt:1)*je}getPixelRatio(){var Je;return(Je=this._overridePixelRatio)!==null&&Je!==void 0?Je:devicePixelRatio}setPixelRatio(Je){this._overridePixelRatio=Je,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(Je){return this.transform.setMaxBounds(ue.convert(Je)),this._update()}setMinZoom(Je){if((Je=Je??-2)>=-2&&Je<=this.transform.maxZoom)return this.transform.minZoom=Je,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=Je,this._update(),this.getZoom()>Je&&this.setZoom(Je),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(Je){if((Je=Je??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(Je>=0&&Je<=this.transform.maxPitch)return this.transform.minPitch=Je,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(Je>=this.transform.minPitch)return this.transform.maxPitch=Je,this._update(),this.getPitch()>Je&&this.setPitch(Je),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(Je){return this.transform.renderWorldCopies=Je,this._update()}project(Je){return this.transform.locationPoint(t.N.convert(Je),this.style&&this.terrain)}unproject(Je){return this.transform.pointLocation(t.P.convert(Je),this.terrain)}isMoving(){var Je;return this._moving||((Je=this.handlers)===null||Je===void 0?void 0:Je.isMoving())}isZooming(){var Je;return this._zooming||((Je=this.handlers)===null||Je===void 0?void 0:Je.isZooming())}isRotating(){var Je;return this._rotating||((Je=this.handlers)===null||Je===void 0?void 0:Je.isRotating())}_createDelegatedListener(Je,I,ce){if(Je==="mouseenter"||Je==="mouseover"){let Ne=!1;return{layers:I,listener:ce,delegates:{mousemove:Ze=>{const kt=I.filter(tr=>this.getLayer(tr)),Ft=kt.length!==0?this.queryRenderedFeatures(Ze.point,{layers:kt}):[];Ft.length?Ne||(Ne=!0,ce.call(this,new $u(Je,this,Ze.originalEvent,{features:Ft}))):Ne=!1},mouseout:()=>{Ne=!1}}}}if(Je==="mouseleave"||Je==="mouseout"){let Ne=!1;return{layers:I,listener:ce,delegates:{mousemove:kt=>{const Ft=I.filter(tr=>this.getLayer(tr));(Ft.length!==0?this.queryRenderedFeatures(kt.point,{layers:Ft}):[]).length?Ne=!0:Ne&&(Ne=!1,ce.call(this,new $u(Je,this,kt.originalEvent)))},mouseout:kt=>{Ne&&(Ne=!1,ce.call(this,new $u(Je,this,kt.originalEvent)))}}}}{const Ne=je=>{const Ze=I.filter(Ft=>this.getLayer(Ft)),kt=Ze.length!==0?this.queryRenderedFeatures(je.point,{layers:Ze}):[];kt.length&&(je.features=kt,ce.call(this,je),delete je.features)};return{layers:I,listener:ce,delegates:{[Je]:Ne}}}}_saveDelegatedListener(Je,I){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[Je]=this._delegatedListeners[Je]||[],this._delegatedListeners[Je].push(I)}_removeDelegatedListener(Je,I,ce){if(!this._delegatedListeners||!this._delegatedListeners[Je])return;const Ne=this._delegatedListeners[Je];for(let je=0;jeI.includes(kt))){for(const kt in Ze.delegates)this.off(kt,Ze.delegates[kt]);return void Ne.splice(je,1)}}}on(Je,I,ce){if(ce===void 0)return super.on(Je,I);const Ne=this._createDelegatedListener(Je,typeof I=="string"?[I]:I,ce);this._saveDelegatedListener(Je,Ne);for(const je in Ne.delegates)this.on(je,Ne.delegates[je]);return this}once(Je,I,ce){if(ce===void 0)return super.once(Je,I);const Ne=typeof I=="string"?[I]:I,je=this._createDelegatedListener(Je,Ne,ce);for(const Ze in je.delegates){const kt=je.delegates[Ze];je.delegates[Ze]=(...Ft)=>{this._removeDelegatedListener(Je,Ne,ce),kt(...Ft)}}this._saveDelegatedListener(Je,je);for(const Ze in je.delegates)this.once(Ze,je.delegates[Ze]);return this}off(Je,I,ce){return ce===void 0?super.off(Je,I):(this._removeDelegatedListener(Je,typeof I=="string"?[I]:I,ce),this)}queryRenderedFeatures(Je,I){if(!this.style)return[];let ce;const Ne=Je instanceof t.P||Array.isArray(Je),je=Ne?Je:[[0,0],[this.transform.width,this.transform.height]];if(I=I||(Ne?{}:Je)||{},je instanceof t.P||typeof je[0]=="number")ce=[t.P.convert(je)];else{const Ze=t.P.convert(je[0]),kt=t.P.convert(je[1]);ce=[Ze,new t.P(kt.x,Ze.y),kt,new t.P(Ze.x,kt.y),Ze]}return this.style.queryRenderedFeatures(ce,I,this.transform)}querySourceFeatures(Je,I){return this.style.querySourceFeatures(Je,I)}setStyle(Je,I){return(I=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},I)).diff!==!1&&I.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&Je?(this._diffStyle(Je,I),this):(this._localIdeographFontFamily=I.localIdeographFontFamily,this._updateStyle(Je,I))}setTransformRequest(Je){return this._requestManager.setTransformRequest(Je),this}_getUIString(Je){const I=this._locale[Je];if(I==null)throw new Error(`Missing UI string '${Je}'`);return I}_updateStyle(Je,I){if(I.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(Je,I));const ce=this.style&&I.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!Je)),Je?(this.style=new Jr(this,I||{}),this.style.setEventedParent(this,{style:this.style}),typeof Je=="string"?this.style.loadURL(Je,I,ce):this.style.loadJSON(Je,I,ce),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Jr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(Je,I){if(typeof Je=="string"){const ce=this._requestManager.transformRequest(Je,"Style");t.h(ce,new AbortController).then(Ne=>{this._updateDiff(Ne.data,I)}).catch(Ne=>{Ne&&this.fire(new t.j(Ne))})}else typeof Je=="object"&&this._updateDiff(Je,I)}_updateDiff(Je,I){try{this.style.setState(Je,I)&&this._update(!0)}catch(ce){t.w(`Unable to perform style diff: ${ce.message||ce.error||ce}. Rebuilding the style from scratch.`),this._updateStyle(Je,I)}}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(Je,I){return this._lazyInitEmptyStyle(),this.style.addSource(Je,I),this._update(!0)}isSourceLoaded(Je){const I=this.style&&this.style.sourceCaches[Je];if(I!==void 0)return I.loaded();this.fire(new t.j(new Error(`There is no source with ID '${Je}'`)))}setTerrain(Je){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),Je){const I=this.style.sourceCaches[Je.source];if(!I)throw new Error(`cannot load terrain, because there exists no source with ID: ${Je.source}`);this.terrain===null&&I.reload();for(const ce in this.style._layers){const Ne=this.style._layers[ce];Ne.type==="hillshade"&&Ne.source===Je.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 yl(this.painter,I,Je),this.painter.renderToTexture=new Vl(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=ce=>{ce.dataType==="style"?this.terrain.sourceCache.freeRtt():ce.dataType==="source"&&ce.tile&&(ce.sourceId!==Je.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(ce.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:Je})),this}getTerrain(){var Je,I;return(I=(Je=this.terrain)===null||Je===void 0?void 0:Je.options)!==null&&I!==void 0?I:null}areTilesLoaded(){const Je=this.style&&this.style.sourceCaches;for(const I in Je){const ce=Je[I]._tiles;for(const Ne in ce){const je=ce[Ne];if(je.state!=="loaded"&&je.state!=="errored")return!1}}return!0}removeSource(Je){return this.style.removeSource(Je),this._update(!0)}getSource(Je){return this.style.getSource(Je)}addImage(Je,I,ce={}){const{pixelRatio:Ne=1,sdf:je=!1,stretchX:Ze,stretchY:kt,content:Ft,textFitWidth:tr,textFitHeight:xr}=ce;if(this._lazyInitEmptyStyle(),!(I instanceof HTMLImageElement||t.b(I))){if(I.width===void 0||I.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:Or,height:Ur,data:hn}=I,Cn=I;return this.style.addImage(Je,{data:new t.R({width:Or,height:Ur},new Uint8Array(hn)),pixelRatio:Ne,stretchX:Ze,stretchY:kt,content:Ft,textFitWidth:tr,textFitHeight:xr,sdf:je,version:0,userImage:Cn}),Cn.onAdd&&Cn.onAdd(this,Je),this}}{const{width:Or,height:Ur,data:hn}=i.getImageData(I);this.style.addImage(Je,{data:new t.R({width:Or,height:Ur},hn),pixelRatio:Ne,stretchX:Ze,stretchY:kt,content:Ft,textFitWidth:tr,textFitHeight:xr,sdf:je,version:0})}}updateImage(Je,I){const ce=this.style.getImage(Je);if(!ce)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 Ne=I instanceof HTMLImageElement||t.b(I)?i.getImageData(I):I,{width:je,height:Ze,data:kt}=Ne;if(je===void 0||Ze===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(je!==ce.data.width||Ze!==ce.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 Ft=!(I instanceof HTMLImageElement||t.b(I));return ce.data.replace(kt,Ft),this.style.updateImage(Je,ce),this}getImage(Je){return this.style.getImage(Je)}hasImage(Je){return Je?!!this.style.getImage(Je):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(Je){this.style.removeImage(Je)}loadImage(Je){return l.getImage(this._requestManager.transformRequest(Je,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(Je,I){return this._lazyInitEmptyStyle(),this.style.addLayer(Je,I),this._update(!0)}moveLayer(Je,I){return this.style.moveLayer(Je,I),this._update(!0)}removeLayer(Je){return this.style.removeLayer(Je),this._update(!0)}getLayer(Je){return this.style.getLayer(Je)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(Je,I,ce){return this.style.setLayerZoomRange(Je,I,ce),this._update(!0)}setFilter(Je,I,ce={}){return this.style.setFilter(Je,I,ce),this._update(!0)}getFilter(Je){return this.style.getFilter(Je)}setPaintProperty(Je,I,ce,Ne={}){return this.style.setPaintProperty(Je,I,ce,Ne),this._update(!0)}getPaintProperty(Je,I){return this.style.getPaintProperty(Je,I)}setLayoutProperty(Je,I,ce,Ne={}){return this.style.setLayoutProperty(Je,I,ce,Ne),this._update(!0)}getLayoutProperty(Je,I){return this.style.getLayoutProperty(Je,I)}setGlyphs(Je,I={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(Je,I),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(Je,I,ce={}){return this._lazyInitEmptyStyle(),this.style.addSprite(Je,I,ce,Ne=>{Ne||this._update(!0)}),this}removeSprite(Je){return this._lazyInitEmptyStyle(),this.style.removeSprite(Je),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(Je,I={}){return this._lazyInitEmptyStyle(),this.style.setSprite(Je,I,ce=>{ce||this._update(!0)}),this}setLight(Je,I={}){return this._lazyInitEmptyStyle(),this.style.setLight(Je,I),this._update(!0)}getLight(){return this.style.getLight()}setSky(Je){return this._lazyInitEmptyStyle(),this.style.setSky(Je),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(Je,I){return this.style.setFeatureState(Je,I),this._update()}removeFeatureState(Je,I){return this.style.removeFeatureState(Je,I),this._update()}getFeatureState(Je){return this.style.getFeatureState(Je)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let Je=0,I=0;return this._container&&(Je=this._container.clientWidth||400,I=this._container.clientHeight||300),[Je,I]}_setupContainer(){const Je=this._container;Je.classList.add("maplibregl-map");const I=this._canvasContainer=a.create("div","maplibregl-canvas-container",Je);this._interactive&&I.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",I),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 ce=this._containerDimensions(),Ne=this._getClampedPixelRatio(ce[0],ce[1]);this._resizeCanvas(ce[0],ce[1],Ne);const je=this._controlContainer=a.create("div","maplibregl-control-container",Je),Ze=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(kt=>{Ze[kt]=a.create("div",`maplibregl-ctrl-${kt} `,je)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(Je,I,ce){this._canvas.width=Math.floor(ce*Je),this._canvas.height=Math.floor(ce*I),this._canvas.style.width=`${Je}px`,this._canvas.style.height=`${I}px`}_setupPainter(){const Je={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let I=null;this._canvas.addEventListener("webglcontextcreationerror",Ne=>{I={requestedAttributes:Je},Ne&&(I.statusMessage=Ne.statusMessage,I.type=Ne.type)},{once:!0});const ce=this._canvas.getContext("webgl2",Je)||this._canvas.getContext("webgl",Je);if(!ce){const Ne="Failed to initialize WebGL";throw I?(I.message=Ne,new Error(JSON.stringify(I))):new Error(Ne)}this.painter=new mf(ce,this.transform),s.testSupport(ce)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(Je){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||Je,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(Je){return this._update(),this._renderTaskQueue.add(Je)}_cancelRenderFrame(Je){this._renderTaskQueue.remove(Je)}_render(Je){const I=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(Je),this._removed)return;let ce=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const je=this.transform.zoom,Ze=i.now();this.style.zoomHistory.update(je,Ze);const kt=new t.z(je,{now:Ze,fadeDuration:I,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Ft=kt.crossFadingFactor();Ft===1&&Ft===this._crossFadingFactor||(ce=!0,this._crossFadingFactor=Ft),this.style.update(kt)}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,I,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:I,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()||ce)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const Ne=this._sourcesDirty||this._styleDirty||this._placementDirty;return Ne||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||Ne||(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 Je;this._hash&&this._hash.remove();for(const ce of this._controls)ce.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),(Je=this._resizeObserver)===null||Je===void 0||Je.disconnect();const I=this.painter.context.gl.getExtension("WEBGL_lose_context");I?.loseContext&&I.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(Je=>{t.bf.frame(Je),this._frameRequest=null,this._render(Je)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(Je){this._showTileBoundaries!==Je&&(this._showTileBoundaries=Je,this._update())}get showPadding(){return!!this._showPadding}set showPadding(Je){this._showPadding!==Je&&(this._showPadding=Je,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(Je){this._showCollisionBoxes!==Je&&(this._showCollisionBoxes=Je,Je?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(Je){this._showOverdrawInspector!==Je&&(this._showOverdrawInspector=Je,this._update())}get repaint(){return!!this._repaint}set repaint(Je){this._repaint!==Je&&(this._repaint=Je,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(Je){this._vertices=Je,this._update()}get version(){return xu}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=$u,e.MapTouchEvent=Lf,e.MapWheelEvent=mh,e.Marker=cc,e.NavigationControl=class{constructor(Je){this._updateZoomButtons=()=>{const I=this._map.getZoom(),ce=I===this._map.getMaxZoom(),Ne=I===this._map.getMinZoom();this._zoomInButton.disabled=ce,this._zoomOutButton.disabled=Ne,this._zoomInButton.setAttribute("aria-disabled",ce.toString()),this._zoomOutButton.setAttribute("aria-disabled",Ne.toString())},this._rotateCompassArrow=()=>{const I=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=I},this._setButtonTitle=(I,ce)=>{const Ne=this._map._getUIString(`NavigationControl.${ce}`);I.title=Ne,I.setAttribute("aria-label",Ne)},this.options=t.e({},bo,Je),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",I=>I.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",I=>this._map.zoomIn({},{originalEvent:I})),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",I=>this._map.zoomOut({},{originalEvent:I})),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",I=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:I}):this._map.resetNorth({},{originalEvent:I})}),this._compassIcon=a.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(Je){return this._map=Je,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 ms(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(Je,I){const ce=a.create("button",Je,this._container);return ce.type="button",ce.addEventListener("click",I),ce}},e.Popup=class extends t.E{constructor(Je){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=I=>{this._update(I.point)},this._onMouseMove=I=>{this._update(I.point)},this._onDrag=I=>{this._update(I.point)},this._update=I=>{var ce;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 Ft of this.options.className.split(" "))this._container.classList.add(Ft);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?cl(this._lngLat,this._flatPos,this._map.transform):(ce=this._lngLat)===null||ce===void 0?void 0:ce.wrap(),this._trackPointer&&!I)return;const Ne=this._flatPos=this._pos=this._trackPointer&&I?I:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&I?I:this._map.transform.locationPoint(this._lngLat));let je=this.options.anchor;const Ze=Pc(this.options.offset);if(!je){const Ft=this._container.offsetWidth,tr=this._container.offsetHeight;let xr;xr=Ne.y+Ze.bottom.ythis._map.transform.height-tr?["bottom"]:[],Ne.xthis._map.transform.width-Ft/2&&xr.push("right"),je=xr.length===0?"bottom":xr.join("-")}let kt=Ne.add(Ze[je]);this.options.subpixelPositioning||(kt=kt.round()),a.setTransform(this._container,`${ic[je]} translate(${kt.x}px,${kt.y}px)`),oc(this._container,je,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(as),Je)}addTo(Je){return this._map&&this.remove(),this._map=Je,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(Je){return this._lngLat=t.N.convert(Je),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(Je){return this.setDOMContent(document.createTextNode(Je))}setHTML(Je){const I=document.createDocumentFragment(),ce=document.createElement("body");let Ne;for(ce.innerHTML=Je;Ne=ce.firstChild,Ne;)I.appendChild(Ne);return this.setDOMContent(I)}getMaxWidth(){var Je;return(Je=this._container)===null||Je===void 0?void 0:Je.style.maxWidth}setMaxWidth(Je){return this.options.maxWidth=Je,this._update(),this}setDOMContent(Je){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(Je),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(Je){return this._container&&this._container.classList.add(Je),this}removeClassName(Je){return this._container&&this._container.classList.remove(Je),this}setOffset(Je){return this.options.offset=Je,this._update(),this}toggleClassName(Je){if(this._container)return this._container.classList.toggle(Je)}setSubpixelPositioning(Je){this.options.subpixelPositioning=Je}_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 Je=this._container.querySelector(uf);Je&&Je.focus()}},e.RasterDEMTileSource=Xe,e.RasterTileSource=Ve,e.ScaleControl=class{constructor(Je){this._onMove=()=>{lf(this._map,this._container,this.options)},this.setUnit=I=>{this.options.unit=I,lf(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},wu),Je)}getDefaultPosition(){return"bottom-left"}onAdd(Je){return this._map=Je,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",Je.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=Xn,e.Style=Jr,e.TerrainControl=class{constructor(Je){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=Je}onAdd(Je){return this._map=Je,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=uh,e.TwoFingersTouchRotateHandler=_f,e.TwoFingersTouchZoomHandler=uc,e.TwoFingersTouchZoomRotateHandler=ni,e.VectorTileSource=Fe,e.VideoSource=bt,e.addSourceType=(Je,I)=>t._(void 0,void 0,void 0,function*(){if(qe(Je))throw new Error(`A source type called "${Je}" already exists.`);((ce,Ne)=>{ht[ce]=Ne})(Je,I)}),e.clearPrewarmedResources=function(){const Je=ge;Je&&(Je.isPreloaded()&&Je.numActive()===1?(Je.release(oe),ge=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 _t().getRTLTextPluginStatus()},e.getVersion=function(){return bc},e.getWorkerCount=function(){return ye.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(Je){return Q().broadcast("IS",Je)},e.prewarm=function(){ae().acquire(oe)},e.setMaxParallelImageRequests=function(Je){t.a.MAX_PARALLEL_IMAGE_REQUESTS=Je},e.setRTLTextPlugin=function(Je,I){return _t().setRTLTextPlugin(Je,I)},e.setWorkerCount=function(Je){ye.workerCount=Je},e.setWorkerUrl=function(Je){t.a.WORKER_URL=Je}});var k=h;return k})}}),ED=_e({"src/plots/map/layers.js"(ee,X){var h=kn(),x=Au().sanitizeHTML,S=VA(),k=N0();function e(i,a){this.subplot=i,this.uid=i.uid+"-"+a,this.index=a,this.idSource="source-"+this.uid,this.idLayer=k.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=x(i.sourceattribution)),f}X.exports=function(a,s,f){var c=new e(a,s);return c.update(f),c}}}),kD=_e({"src/plots/map/map.js"(ee,X){var h=MD(),x=kn(),S=R0(),k=bi(),e=xs(),t=Pd(),r=zf(),o=Fp(),n=o.drawMode,i=o.selectMode,a=th().prepSelect,s=th().clearOutline,f=th().clearSelectionsCache,c=th().selectOnClick,v=N0(),p=ED();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,d;u.map?d=new Promise(function(y,R){u.updateMap(_,w,y,R)}):d=new Promise(function(y,R){u.createMap(_,w,y,R)}),m.push(d)},l.createMap=function(_,w,m,u){var d=this,y=w[d.id],R=d.styleObj=b(y.style),L=y.bounds,z=L?[[L.west,L.south],[L.east,L.north]]:null,N=d.map=new h.Map({container:d.div,style:R.style,center:E(y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch,maxBounds:z,interactive:!d.isStatic,preserveDrawingBuffer:d.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new h.AttributionControl({compact:!0})),U={};N.on("styleimagemissing",function(D){var j=D.id;if(!U[j]&&j.includes("-15")){U[j]=!0;var q=new Image(15,15);q.onload=function(){N.addImage(j,q)},q.crossOrigin="Anonymous",q.src="https://unpkg.com/maki@2.1.0/icons/"+j+".svg"}}),N.setTransformRequest(function(D){return D=D.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),D=D.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),D=D.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:D}}),N._canvas.style.left="0px",N._canvas.style.top="0px",d.rejectOnError(u),d.isStatic||d.initFx(_,w);var B=[];B.push(new Promise(function(D){N.once("load",D)})),B=B.concat(S.fetchTraceGeoData(_)),Promise.all(B).then(function(){d.fillBelowLookup(_,w),d.updateData(_),d.updateLayout(w),d.resolveOnRender(m)}).catch(u)},l.updateMap=function(_,w,m,u){var d=this,y=d.map,R=w[this.id];d.rejectOnError(u);var L=[],z=b(R.style);JSON.stringify(d.styleObj)!==JSON.stringify(z)&&(d.styleObj=z,y.setStyle(z.style),d.traceHash={},L.push(new Promise(function(N){y.once("styledata",N)}))),L=L.concat(S.fetchTraceGeoData(_)),Promise.all(L).then(function(){d.fillBelowLookup(_,w),d.updateData(_),d.updateLayout(w),d.resolveOnRender(m)}).catch(u)},l.fillBelowLookup=function(_,w){var m=w[this.id],u=m.layers,d,y,R=this.belowLookup={},L=!1;for(d=0;d<_.length;d++){var z=_[d][0].trace,N=z._module;typeof z.below=="string"?y=z.below:N.getBelow&&(y=N.getBelow(z,this)),y===""&&(L=!0),R["trace-"+z.uid]=y||""}for(d=0;d1)for(d=0;d-1&&c(z.originalEvent,u,[m.xaxis],[m.yaxis],m.id,L),N.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 d(z){var N=w.map.unproject(z);return[N.lng,N.lat]}var y=_.dragmode,R;R=function(z,N){if(N.isRect){var U=z.range={};U[w.id]=[d([N.xmin,N.ymin]),d([N.xmax,N.ymax])]}else{var B=z.lassoPoints={};B[w.id]=N.map(d)}};var L=w.dragOptions;w.dragOptions=x.extendDeep(L||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:R},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,N,U){a(z,N,U,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,d;if(m.length!==u.length){for(d=0;dm/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)),E.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 d=1;w.width+6>m&&(d=m/(w.width+6));var y=[f.l+f.w*p.x[1],f.t+f.h*(1-p.y[0])];E.attr("transform",h(y[0],y[1])+x(d))}},ee.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)},X.exports=function(r,o){var n=o[0].trace,i=new k(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}}}),RD=_e({"src/traces/choroplethmap/index.js"(ee,X){X.exports={attributes:qA(),supplyDefaults:ID(),colorbar:w0(),calc:ox(),plot:DD(),hoverPoints:lx(),eventData:ux(),selectPoints:cx(),styleOnSelect:function(h,x){if(x){var S=x[0].trace;S._glTrace.updateOnSelect(x)}},getBelow:function(h,x){for(var S=x.getMapLayers(),k=S.length-2;k>=0;k--){var e=S[k].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=k+1;t0?+p[c]:0),f.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:A})}}var _=k.extractOpts(n),w=_.reversescale?k.flipScale(_.colorscale):_.colorscale,m=w[0][1],u=S.opacity(m)<1?m:S.addOpacity(m,0),d=["interpolate",["linear"],["heatmap-density"],0,u];for(c=1;c=0;r--)e.removeLayer(t[r][1])},k.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},X.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}}}),UD=_e({"src/traces/densitymap/hover.js"(ee,X){var h=xs(),x=Mx().hoverPoints,S=Mx().getExtraText;X.exports=function(e,t,r){var o=x(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]}}}}),jD=_e({"src/traces/densitymap/event_data.js"(ee,X){X.exports=function(x,S){return x.lon=S.lon,x.lat=S.lat,x.z=S.z,x}}}),VD=_e({"src/traces/densitymap/index.js"(ee,X){X.exports={attributes:HA(),supplyDefaults:zD(),colorbar:w0(),formatLabels:jA(),calc:FD(),plot:BD(),hoverPoints:UD(),eventData:jD(),getBelow:function(h,x){for(var S=x.getMapLayers(),k=0;k0;){l=b[b.length-1];var A=x[l];if(r[l]=0&&n[l].push(o[_])}r[l]=E}else{if(e[l]===k[l]){for(var w=[],m=[],u=0,E=g.length-1;E>=0;--E){var d=g[E];if(t[d]=!1,w.push(d),m.push(n[d]),u+=n[d].length,o[d]=s.length,d===l){g.length=E;break}}s.push(w);for(var y=new Array(u),E=0;E_&&(_=a.source[g]),a.target[g]>_&&(_=a.target[g]);var w=_+1;n.node._count=w;var m,u=n.node.groups,d={};for(g=0;g0&&e(U,w)&&e(B,w)&&!(d.hasOwnProperty(U)&&d.hasOwnProperty(B)&&d[U]===d[B])){d.hasOwnProperty(B)&&(B=d[B]),d.hasOwnProperty(U)&&(U=d[U]),U=+U,B=+B,p[U]=p[B]=!0;var D="";a.label&&a.label[g]&&(D=a.label[g]);var j=null;D&&T.hasOwnProperty(D)&&(j=T[D]),s.push({pointNumber:g,label:D,color:f?a.color[g]:a.color,hovercolor:c?a.hovercolor[g]:a.hovercolor,customdata:v?a.customdata[g]:a.customdata,concentrationscale:j,source:U,target:B,value:+N}),z.source.push(U),z.target.push(B)}}var q=w+u.length,J=k(i.color),oe=k(i.customdata),ye=[];for(g=0;gw-1,childrenNodes:[],pointNumber:g,label:pe,color:J?i.color[g]:i.color,customdata:oe?i.customdata[g]:i.customdata})}var ge=!1;return o(q,z.source,z.target)&&(ge=!0),{circular:ge,links:s,nodes:ye,groups:u,groupLookup:d}}function o(n,i,a){for(var s=x.init2dArray(n,0),f=0;f1})}X.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})}}}),$D=_e({"node_modules/d3-quadtree/dist/d3-quadtree.js"(ee,X){(function(h,x){typeof ee=="object"&&typeof X<"u"?x(ee):(h=h||self,x(h.d3=h.d3||{}))})(ee,function(h){function x(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,d){if(isNaN(m)||isNaN(u))return w;var y,R=w._root,L={data:d},z=w._x0,N=w._y0,U=w._x1,B=w._y1,D,j,q,J,oe,ye,pe,ge;if(!R)return w._root=L,w;for(;R.length;)if((oe=m>=(D=(z+U)/2))?z=D:U=D,(ye=u>=(j=(N+B)/2))?N=j:B=j,y=R,!(R=R[pe=ye<<1|oe]))return y[pe]=L,w;if(q=+w._x.call(null,R.data),J=+w._y.call(null,R.data),m===q&&u===J)return L.next=R,y?y[pe]=L:w._root=L,w;do y=y?y[pe]=new Array(4):w._root=new Array(4),(oe=m>=(D=(z+U)/2))?z=D:U=D,(ye=u>=(j=(N+B)/2))?N=j:B=j;while((pe=ye<<1|oe)===(ge=(J>=j)<<1|q>=D));return y[ge]=R,y[pe]=L,w}function k(w){var m,u,d=w.length,y,R,L=new Array(d),z=new Array(d),N=1/0,U=1/0,B=-1/0,D=-1/0;for(u=0;uB&&(B=y),RD&&(D=R));if(N>B||U>D)return this;for(this.cover(N,U).cover(B,D),u=0;uw||w>=y||d>m||m>=R;)switch(U=(mB||(z=J.y0)>D||(N=J.x1)=pe)<<1|w>=ye)&&(J=j[j.length-1],j[j.length-1]=j[j.length-1-oe],j[j.length-1-oe]=J)}else{var ge=w-+this._x.call(null,q.data),W=m-+this._y.call(null,q.data),ae=ge*ge+W*W;if(ae=(j=(L+N)/2))?L=j:N=j,(oe=D>=(q=(z+U)/2))?z=q:U=q,m=u,!(u=u[ye=oe<<1|J]))return this;if(!u.length)break;(m[ye+1&3]||m[ye+2&3]||m[ye+3&3])&&(d=m,pe=ye)}for(;u.data!==w;)if(y=u,!(u=u.next))return this;return(R=u.next)&&delete u.next,y?(R?y.next=R:delete y.next,this):m?(R?m[ye]=R:delete m[ye],(u=m[0]||m[1]||m[2]||m[3])&&u===(m[3]||m[2]||m[1]||m[0])&&!u.length&&(d?d[pe]=u:this._root=u),this):(this._root=R,this)}function a(w){for(var m=0,u=w.length;m=p.length)return l!=null&&_.sort(l),g!=null?g(_):_;for(var d=-1,y=_.length,R=p[w++],L,z,N=k(),U,B=m();++dp.length)return _;var m,u=T[w-1];return g!=null&&w>=p.length?m=_.entries():(m=[],_.each(function(d,y){m.push({key:y,values:E(d,w)})})),u!=null?m.sort(function(d,y){return u(d.key,y.key)}):m}return b={object:function(_){return A(_,0,t,r)},map:function(_){return A(_,0,o,n)},entries:function(_){return E(A(_,0,o,n),0)},key:function(_){return p.push(_),b},sortKeys:function(_){return T[p.length-1]=_,b},sortValues:function(_){return l=_,b},rollup:function(_){return g=_,b}}}function t(){return{}}function r(p,T,l){p[T]=l}function o(){return k()}function n(p,T,l){p.set(T,l)}function i(){}var a=k.prototype;i.prototype=s.prototype={constructor:i,has:a.has,add:function(p){return p+="",this[x+p]=p,this},remove:a.remove,clear:a.clear,values:a.keys,size:a.size,empty:a.empty,each:a.each};function s(p,T){var l=new i;if(p instanceof i)p.each(function(A){l.add(A)});else if(p){var g=-1,b=p.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}})}k.prototype=S.prototype={constructor:k,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;--x}function l(){n=(o=a.now())+i,x=S=0;try{T()}finally{x=0,b(),n=0}}function g(){var w=a.now(),m=w-o;m>e&&(i-=m,o=w)}function b(){for(var w,m=t,u,d=1/0;m;)m._call?(d>m._time&&(d=m._time),w=m,m=m._next):(u=m._next,m._next=null,m=w?w._next=u:t=u);r=w,A(d)}function A(w){if(!x){S&&(S=clearTimeout(S));var m=w-n;m>24?(w<1/0&&(S=setTimeout(l,w-a.now()-i)),k&&(k=clearInterval(k))):(k||(o=a.now(),k=setInterval(g,e)),x=1,s(l))}}function E(w,m,u){var d=new v;return m=m==null?0:+m,d.restart(function(y){d.stop(),w(y+m)},m,u),d}function _(w,m,u){var d=new v,y=m;return m==null?(d.restart(w,m,u),d):(m=+m,u=u==null?f():+u,d.restart(function R(L){L+=y,d.restart(R,y+=m,u),w(L)},m,u),d)}h.interval=_,h.now=f,h.timeout=E,h.timer=p,h.timerFlush=T,Object.defineProperty(h,"__esModule",{value:!0})})}}),XD=_e({"node_modules/d3-force/dist/d3-force.js"(ee,X){(function(h,x){typeof ee=="object"&&typeof X<"u"?x(ee,$D(),kx(),WD(),YD()):x(h.d3=h.d3||{},h.d3,h.d3,h.d3,h.d3)})(ee,function(h,x,S,k,e){function t(w,m){var u;w==null&&(w=0),m==null&&(m=0);function d(){var y,R=u.length,L,z=0,N=0;for(y=0;yD.index){var le=j-me.x-me.vx,ue=q-me.y-me.vy,Te=le*le+ue*ue;Tej+Y||seq+Y||QN.r&&(N.r=N[U].r)}function z(){if(m){var N,U=m.length,B;for(u=new Array(U),N=0;N1?(oe==null?z.remove(J):z.set(J,q(oe)),m):z.get(J)},find:function(J,oe,ye){var pe=0,ge=w.length,W,ae,se,Q,me;for(ye==null?ye=1/0:ye*=ye,pe=0;pe1?(U.on(J,oe),m):U.on(J)}}}function b(){var w,m,u,d=r(-30),y,R=1,L=1/0,z=.81;function N(j){var q,J=w.length,oe=x.quadtree(w,v,p).visitAfter(B);for(u=j,q=0;q=L)return;(j.data!==m||j.next)&&(ye===0&&(ye=o(),W+=ye*ye),pe===0&&(pe=o(),W+=pe*pe),Wk)if(!(Math.abs(l*v-p*T)>k)||!s)this._+="L"+(this._x1=o)+","+(this._y1=n);else{var b=i-f,A=a-c,E=v*v+p*p,_=b*b+A*A,w=Math.sqrt(E),m=Math.sqrt(g),u=s*Math.tan((x-Math.acos((E+g-_)/(2*w*m)))/2),d=u/m,y=u/w;Math.abs(d-1)>k&&(this._+="L"+(o+d*T)+","+(n+d*l)),this._+="A"+s+","+s+",0,0,"+ +(l*b>T*A)+","+(this._x1=o+y*v)+","+(this._y1=n+y*p)}},arc:function(o,n,i,a,s,f){o=+o,n=+n,i=+i,f=!!f;var c=i*Math.cos(a),v=i*Math.sin(a),p=o+c,T=n+v,l=1^f,g=f?a-s:s-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+p+","+T:(Math.abs(this._x1-p)>k||Math.abs(this._y1-T)>k)&&(this._+="L"+p+","+T),i&&(g<0&&(g=g%S+S),g>e?this._+="A"+i+","+i+",0,1,"+l+","+(o-c)+","+(n-v)+"A"+i+","+i+",0,1,"+l+","+(this._x1=p)+","+(this._y1=T):g>k&&(this._+="A"+i+","+i+",0,"+ +(g>=x)+","+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})})}}),YA=_e({"node_modules/d3-shape/dist/d3-shape.js"(ee,X){(function(h,x){typeof ee=="object"&&typeof X<"u"?x(ee,ZD()):(h=h||self,x(h.d3=h.d3||{},h.d3))})(ee,function(h,x){function S(Dt){return function(){return Dt}}var k=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 v(Dt){return Dt>1?0:Dt<-1?s:Math.acos(Dt)}function p(Dt){return Dt>=1?f:Dt<=-1?-f:Math.asin(Dt)}function T(Dt){return Dt.innerRadius}function l(Dt){return Dt.outerRadius}function g(Dt){return Dt.startAngle}function b(Dt){return Dt.endAngle}function A(Dt){return Dt&&Dt.padAngle}function E(Dt,yr,Hr,_n,Hn,ea,Qn,bn){var $n=Hr-Dt,ki=_n-yr,Ua=Qn-Hn,Fi=bn-ea,Ji=Fi*$n-Ua*ki;if(!(Ji*Jinl*nl+wl*wl&&(Ns=cs,rl=$o),{cx:Ns,cy:rl,x01:-Ua,y01:-Fi,x11:Ns*(Hn/Zo-1),y11:rl*(Hn/Zo-1)}}function w(){var Dt=T,yr=l,Hr=S(0),_n=null,Hn=g,ea=b,Qn=A,bn=null;function $n(){var ki,Ua,Fi=+Dt.apply(this,arguments),Ji=+yr.apply(this,arguments),fo=Hn.apply(this,arguments)-f,co=ea.apply(this,arguments)-f,So=k(co-fo),wi=co>fo;if(bn||(bn=ki=x.path()),Jia))bn.moveTo(0,0);else if(So>c-a)bn.moveTo(Ji*t(fo),Ji*n(fo)),bn.arc(0,0,Ji,fo,co,!wi),Fi>a&&(bn.moveTo(Fi*t(co),Fi*n(co)),bn.arc(0,0,Fi,co,fo,wi));else{var ts=fo,jo=co,js=fo,us=co,Zo=So,No=So,Vs=Qn.apply(this,arguments)/2,Ns=Vs>a&&(_n?+_n.apply(this,arguments):i(Fi*Fi+Ji*Ji)),rl=o(k(Ji-Fi)/2,+Hr.apply(this,arguments)),cs=rl,$o=rl,yo,fs;if(Ns>a){var nl=p(Ns/Fi*n(Vs)),wl=p(Ns/Ji*n(Vs));(Zo-=nl*2)>a?(nl*=wi?1:-1,js+=nl,us-=nl):(Zo=0,js=us=(fo+co)/2),(No-=wl*2)>a?(wl*=wi?1:-1,ts+=wl,jo-=wl):(No=0,ts=jo=(fo+co)/2)}var Ml=Ji*t(ts),Ts=Ji*n(ts),Ai=Fi*t(us),uo=Fi*n(us);if(rl>a){var Tl=Ji*t(jo),Cs=Ji*n(jo),Ro=Fi*t(js),El=Fi*n(js),qs;if(Soa?$o>a?(yo=_(Ro,El,Ml,Ts,Ji,$o,wi),fs=_(Tl,Cs,Ai,uo,Ji,$o,wi),bn.moveTo(yo.cx+yo.x01,yo.cy+yo.y01),$oa)||!(Zo>a)?bn.lineTo(Ai,uo):cs>a?(yo=_(Ai,uo,Tl,Cs,Fi,-cs,wi),fs=_(Ml,Ts,Ro,El,Fi,-cs,wi),bn.lineTo(yo.cx+yo.x01,yo.cy+yo.y01),cs=Ji;--fo)bn.point(jo[fo],js[fo]);bn.lineEnd(),bn.areaEnd()}wi&&(jo[Fi]=+Dt(So,Fi,Ua),js[Fi]=+Hr(So,Fi,Ua),bn.point(yr?+yr(So,Fi,Ua):jo[Fi],_n?+_n(So,Fi,Ua):js[Fi]))}if(ts)return bn=null,ts+""||null}function ki(){return R().defined(Hn).curve(Qn).context(ea)}return $n.x=function(Ua){return arguments.length?(Dt=typeof Ua=="function"?Ua:S(+Ua),yr=null,$n):Dt},$n.x0=function(Ua){return arguments.length?(Dt=typeof Ua=="function"?Ua:S(+Ua),$n):Dt},$n.x1=function(Ua){return arguments.length?(yr=Ua==null?null:typeof Ua=="function"?Ua:S(+Ua),$n):yr},$n.y=function(Ua){return arguments.length?(Hr=typeof Ua=="function"?Ua:S(+Ua),_n=null,$n):Hr},$n.y0=function(Ua){return arguments.length?(Hr=typeof Ua=="function"?Ua:S(+Ua),$n):Hr},$n.y1=function(Ua){return arguments.length?(_n=Ua==null?null:typeof Ua=="function"?Ua:S(+Ua),$n):_n},$n.lineX0=$n.lineY0=function(){return ki().x(Dt).y(Hr)},$n.lineY1=function(){return ki().x(Dt).y(_n)},$n.lineX1=function(){return ki().x(yr).y(Hr)},$n.defined=function(Ua){return arguments.length?(Hn=typeof Ua=="function"?Ua:S(!!Ua),$n):Hn},$n.curve=function(Ua){return arguments.length?(Qn=Ua,ea!=null&&(bn=Qn(ea)),$n):Qn},$n.context=function(Ua){return arguments.length?(Ua==null?ea=bn=null:bn=Qn(ea=Ua),$n):ea},$n}function z(Dt,yr){return yrDt?1:yr>=Dt?0:NaN}function N(Dt){return Dt}function U(){var Dt=N,yr=z,Hr=null,_n=S(0),Hn=S(c),ea=S(0);function Qn(bn){var $n,ki=bn.length,Ua,Fi,Ji=0,fo=new Array(ki),co=new Array(ki),So=+_n.apply(this,arguments),wi=Math.min(c,Math.max(-c,Hn.apply(this,arguments)-So)),ts,jo=Math.min(Math.abs(wi)/ki,ea.apply(this,arguments)),js=jo*(wi<0?-1:1),us;for($n=0;$n0&&(Ji+=us);for(yr!=null?fo.sort(function(Zo,No){return yr(co[Zo],co[No])}):Hr!=null&&fo.sort(function(Zo,No){return Hr(bn[Zo],bn[No])}),$n=0,Fi=Ji?(wi-ki*js)/Ji:0;$n0?us*Fi:0)+js,co[Ua]={data:bn[Ua],index:$n,value:us,startAngle:So,endAngle:ts,padAngle:jo};return co}return Qn.value=function(bn){return arguments.length?(Dt=typeof bn=="function"?bn:S(+bn),Qn):Dt},Qn.sortValues=function(bn){return arguments.length?(yr=bn,Hr=null,Qn):yr},Qn.sort=function(bn){return arguments.length?(Hr=bn,yr=null,Qn):Hr},Qn.startAngle=function(bn){return arguments.length?(_n=typeof bn=="function"?bn:S(+bn),Qn):_n},Qn.endAngle=function(bn){return arguments.length?(Hn=typeof bn=="function"?bn:S(+bn),Qn):Hn},Qn.padAngle=function(bn){return arguments.length?(ea=typeof bn=="function"?bn:S(+bn),Qn):ea},Qn}var B=j(u);function D(Dt){this._curve=Dt}D.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(Dt,yr){this._curve.point(yr*Math.sin(Dt),yr*-Math.cos(Dt))}};function j(Dt){function yr(Hr){return new D(Dt(Hr))}return yr._curve=Dt,yr}function q(Dt){var yr=Dt.curve;return Dt.angle=Dt.x,delete Dt.x,Dt.radius=Dt.y,delete Dt.y,Dt.curve=function(Hr){return arguments.length?yr(j(Hr)):yr()._curve},Dt}function J(){return q(R().curve(B))}function oe(){var Dt=L().curve(B),yr=Dt.curve,Hr=Dt.lineX0,_n=Dt.lineX1,Hn=Dt.lineY0,ea=Dt.lineY1;return Dt.angle=Dt.x,delete Dt.x,Dt.startAngle=Dt.x0,delete Dt.x0,Dt.endAngle=Dt.x1,delete Dt.x1,Dt.radius=Dt.y,delete Dt.y,Dt.innerRadius=Dt.y0,delete Dt.y0,Dt.outerRadius=Dt.y1,delete Dt.y1,Dt.lineStartAngle=function(){return q(Hr())},delete Dt.lineX0,Dt.lineEndAngle=function(){return q(_n())},delete Dt.lineX1,Dt.lineInnerRadius=function(){return q(Hn())},delete Dt.lineY0,Dt.lineOuterRadius=function(){return q(ea())},delete Dt.lineY1,Dt.curve=function(Qn){return arguments.length?yr(j(Qn)):yr()._curve},Dt}function ye(Dt,yr){return[(yr=+yr)*Math.cos(Dt-=Math.PI/2),yr*Math.sin(Dt)]}var pe=Array.prototype.slice;function ge(Dt){return Dt.source}function W(Dt){return Dt.target}function ae(Dt){var yr=ge,Hr=W,_n=d,Hn=y,ea=null;function Qn(){var bn,$n=pe.call(arguments),ki=yr.apply(this,$n),Ua=Hr.apply(this,$n);if(ea||(ea=bn=x.path()),Dt(ea,+_n.apply(this,($n[0]=ki,$n)),+Hn.apply(this,$n),+_n.apply(this,($n[0]=Ua,$n)),+Hn.apply(this,$n)),bn)return ea=null,bn+""||null}return Qn.source=function(bn){return arguments.length?(yr=bn,Qn):yr},Qn.target=function(bn){return arguments.length?(Hr=bn,Qn):Hr},Qn.x=function(bn){return arguments.length?(_n=typeof bn=="function"?bn:S(+bn),Qn):_n},Qn.y=function(bn){return arguments.length?(Hn=typeof bn=="function"?bn:S(+bn),Qn):Hn},Qn.context=function(bn){return arguments.length?(ea=bn??null,Qn):ea},Qn}function se(Dt,yr,Hr,_n,Hn){Dt.moveTo(yr,Hr),Dt.bezierCurveTo(yr=(yr+_n)/2,Hr,yr,Hn,_n,Hn)}function Q(Dt,yr,Hr,_n,Hn){Dt.moveTo(yr,Hr),Dt.bezierCurveTo(yr,Hr=(Hr+Hn)/2,_n,Hr,_n,Hn)}function me(Dt,yr,Hr,_n,Hn){var ea=ye(yr,Hr),Qn=ye(yr,Hr=(Hr+Hn)/2),bn=ye(_n,Hr),$n=ye(_n,Hn);Dt.moveTo(ea[0],ea[1]),Dt.bezierCurveTo(Qn[0],Qn[1],bn[0],bn[1],$n[0],$n[1])}function ie(){return ae(se)}function Y(){return ae(Q)}function le(){var Dt=ae(me);return Dt.angle=Dt.x,delete Dt.x,Dt.radius=Dt.y,delete Dt.y,Dt}var ue={draw:function(Dt,yr){var Hr=Math.sqrt(yr/s);Dt.moveTo(Hr,0),Dt.arc(0,0,Hr,0,c)}},Te={draw:function(Dt,yr){var Hr=Math.sqrt(yr/5)/2;Dt.moveTo(-3*Hr,-Hr),Dt.lineTo(-Hr,-Hr),Dt.lineTo(-Hr,-3*Hr),Dt.lineTo(Hr,-3*Hr),Dt.lineTo(Hr,-Hr),Dt.lineTo(3*Hr,-Hr),Dt.lineTo(3*Hr,Hr),Dt.lineTo(Hr,Hr),Dt.lineTo(Hr,3*Hr),Dt.lineTo(-Hr,3*Hr),Dt.lineTo(-Hr,Hr),Dt.lineTo(-3*Hr,Hr),Dt.closePath()}},Fe=Math.sqrt(1/3),Ve=Fe*2,Xe={draw:function(Dt,yr){var Hr=Math.sqrt(yr/Ve),_n=Hr*Fe;Dt.moveTo(0,-Hr),Dt.lineTo(_n,0),Dt.lineTo(0,Hr),Dt.lineTo(-_n,0),Dt.closePath()}},We=.8908130915292852,it=Math.sin(s/10)/Math.sin(7*s/10),yt=Math.sin(c/10)*it,bt=-Math.cos(c/10)*it,mt={draw:function(Dt,yr){var Hr=Math.sqrt(yr*We),_n=yt*Hr,Hn=bt*Hr;Dt.moveTo(0,-Hr),Dt.lineTo(_n,Hn);for(var ea=1;ea<5;++ea){var Qn=c*ea/5,bn=Math.cos(Qn),$n=Math.sin(Qn);Dt.lineTo($n*Hr,-bn*Hr),Dt.lineTo(bn*_n-$n*Hn,$n*_n+bn*Hn)}Dt.closePath()}},ht={draw:function(Dt,yr){var Hr=Math.sqrt(yr),_n=-Hr/2;Dt.rect(_n,_n,Hr,Hr)}},qe=Math.sqrt(3),ze={draw:function(Dt,yr){var Hr=-Math.sqrt(yr/(qe*3));Dt.moveTo(0,Hr*2),Dt.lineTo(-qe*Hr,-Hr),Dt.lineTo(qe*Hr,-Hr),Dt.closePath()}},Ae=-.5,Ke=Math.sqrt(3)/2,_t=1/Math.sqrt(12),wt=(_t/2+1)*3,vt={draw:function(Dt,yr){var Hr=Math.sqrt(yr/wt),_n=Hr/2,Hn=Hr*_t,ea=_n,Qn=Hr*_t+Hr,bn=-ea,$n=Qn;Dt.moveTo(_n,Hn),Dt.lineTo(ea,Qn),Dt.lineTo(bn,$n),Dt.lineTo(Ae*_n-Ke*Hn,Ke*_n+Ae*Hn),Dt.lineTo(Ae*ea-Ke*Qn,Ke*ea+Ae*Qn),Dt.lineTo(Ae*bn-Ke*$n,Ke*bn+Ae*$n),Dt.lineTo(Ae*_n+Ke*Hn,Ae*Hn-Ke*_n),Dt.lineTo(Ae*ea+Ke*Qn,Ae*Qn-Ke*ea),Dt.lineTo(Ae*bn+Ke*$n,Ae*$n-Ke*bn),Dt.closePath()}},$t=[ue,Te,Xe,ht,mt,ze,vt];function Yt(){var Dt=S(ue),yr=S(64),Hr=null;function _n(){var Hn;if(Hr||(Hr=Hn=x.path()),Dt.apply(this,arguments).draw(Hr,+yr.apply(this,arguments)),Hn)return Hr=null,Hn+""||null}return _n.type=function(Hn){return arguments.length?(Dt=typeof Hn=="function"?Hn:S(Hn),_n):Dt},_n.size=function(Hn){return arguments.length?(yr=typeof Hn=="function"?Hn:S(+Hn),_n):yr},_n.context=function(Hn){return arguments.length?(Hr=Hn??null,_n):Hr},_n}function lr(){}function dr(Dt,yr,Hr){Dt._context.bezierCurveTo((2*Dt._x0+Dt._x1)/3,(2*Dt._y0+Dt._y1)/3,(Dt._x0+2*Dt._x1)/3,(Dt._y0+2*Dt._y1)/3,(Dt._x0+4*Dt._x1+yr)/6,(Dt._y0+4*Dt._y1+Hr)/6)}function Nr(Dt){this._context=Dt}Nr.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:dr(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(Dt,yr){switch(Dt=+Dt,yr=+yr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Dt,yr):this._context.moveTo(Dt,yr);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:dr(this,Dt,yr);break}this._x0=this._x1,this._x1=Dt,this._y0=this._y1,this._y1=yr}};function Fr(Dt){return new Nr(Dt)}function ln(Dt){this._context=Dt}ln.prototype={areaStart:lr,areaEnd:lr,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(Dt,yr){switch(Dt=+Dt,yr=+yr,this._point){case 0:this._point=1,this._x2=Dt,this._y2=yr;break;case 1:this._point=2,this._x3=Dt,this._y3=yr;break;case 2:this._point=3,this._x4=Dt,this._y4=yr,this._context.moveTo((this._x0+4*this._x1+Dt)/6,(this._y0+4*this._y1+yr)/6);break;default:dr(this,Dt,yr);break}this._x0=this._x1,this._x1=Dt,this._y0=this._y1,this._y1=yr}};function zr(Dt){return new ln(Dt)}function Xr(Dt){this._context=Dt}Xr.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(Dt,yr){switch(Dt=+Dt,yr=+yr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var Hr=(this._x0+4*this._x1+Dt)/6,_n=(this._y0+4*this._y1+yr)/6;this._line?this._context.lineTo(Hr,_n):this._context.moveTo(Hr,_n);break;case 3:this._point=4;default:dr(this,Dt,yr);break}this._x0=this._x1,this._x1=Dt,this._y0=this._y1,this._y1=yr}};function Ot(Dt){return new Xr(Dt)}function Qe(Dt,yr){this._basis=new Nr(Dt),this._beta=yr}Qe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var Dt=this._x,yr=this._y,Hr=Dt.length-1;if(Hr>0)for(var _n=Dt[0],Hn=yr[0],ea=Dt[Hr]-_n,Qn=yr[Hr]-Hn,bn=-1,$n;++bn<=Hr;)$n=bn/Hr,this._basis.point(this._beta*Dt[bn]+(1-this._beta)*(_n+$n*ea),this._beta*yr[bn]+(1-this._beta)*(Hn+$n*Qn));this._x=this._y=null,this._basis.lineEnd()},point:function(Dt,yr){this._x.push(+Dt),this._y.push(+yr)}};var ct=function Dt(yr){function Hr(_n){return yr===1?new Nr(_n):new Qe(_n,yr)}return Hr.beta=function(_n){return Dt(+_n)},Hr}(.85);function Ue(Dt,yr,Hr){Dt._context.bezierCurveTo(Dt._x1+Dt._k*(Dt._x2-Dt._x0),Dt._y1+Dt._k*(Dt._y2-Dt._y0),Dt._x2+Dt._k*(Dt._x1-yr),Dt._y2+Dt._k*(Dt._y1-Hr),Dt._x2,Dt._y2)}function Ie(Dt,yr){this._context=Dt,this._k=(1-yr)/6}Ie.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ue(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Dt,yr){switch(Dt=+Dt,yr=+yr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Dt,yr):this._context.moveTo(Dt,yr);break;case 1:this._point=2,this._x1=Dt,this._y1=yr;break;case 2:this._point=3;default:Ue(this,Dt,yr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Dt,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var Pe=function Dt(yr){function Hr(_n){return new Ie(_n,yr)}return Hr.tension=function(_n){return Dt(+_n)},Hr}(0);function Be(Dt,yr){this._context=Dt,this._k=(1-yr)/6}Be.prototype={areaStart:lr,areaEnd:lr,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(Dt,yr){switch(Dt=+Dt,yr=+yr,this._point){case 0:this._point=1,this._x3=Dt,this._y3=yr;break;case 1:this._point=2,this._context.moveTo(this._x4=Dt,this._y4=yr);break;case 2:this._point=3,this._x5=Dt,this._y5=yr;break;default:Ue(this,Dt,yr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Dt,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var at=function Dt(yr){function Hr(_n){return new Be(_n,yr)}return Hr.tension=function(_n){return Dt(+_n)},Hr}(0);function ft(Dt,yr){this._context=Dt,this._k=(1-yr)/6}ft.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(Dt,yr){switch(Dt=+Dt,yr=+yr,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ue(this,Dt,yr);break}this._x0=this._x1,this._x1=this._x2,this._x2=Dt,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var Bt=function Dt(yr){function Hr(_n){return new ft(_n,yr)}return Hr.tension=function(_n){return Dt(+_n)},Hr}(0);function Nt(Dt,yr,Hr){var _n=Dt._x1,Hn=Dt._y1,ea=Dt._x2,Qn=Dt._y2;if(Dt._l01_a>a){var bn=2*Dt._l01_2a+3*Dt._l01_a*Dt._l12_a+Dt._l12_2a,$n=3*Dt._l01_a*(Dt._l01_a+Dt._l12_a);_n=(_n*bn-Dt._x0*Dt._l12_2a+Dt._x2*Dt._l01_2a)/$n,Hn=(Hn*bn-Dt._y0*Dt._l12_2a+Dt._y2*Dt._l01_2a)/$n}if(Dt._l23_a>a){var ki=2*Dt._l23_2a+3*Dt._l23_a*Dt._l12_a+Dt._l12_2a,Ua=3*Dt._l23_a*(Dt._l23_a+Dt._l12_a);ea=(ea*ki+Dt._x1*Dt._l23_2a-yr*Dt._l12_2a)/Ua,Qn=(Qn*ki+Dt._y1*Dt._l23_2a-Hr*Dt._l12_2a)/Ua}Dt._context.bezierCurveTo(_n,Hn,ea,Qn,Dt._x2,Dt._y2)}function Ht(Dt,yr){this._context=Dt,this._alpha=yr}Ht.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(Dt,yr){if(Dt=+Dt,yr=+yr,this._point){var Hr=this._x2-Dt,_n=this._y2-yr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Hr*Hr+_n*_n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Dt,yr):this._context.moveTo(Dt,yr);break;case 1:this._point=2;break;case 2:this._point=3;default:Nt(this,Dt,yr);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=Dt,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var or=function Dt(yr){function Hr(_n){return yr?new Ht(_n,yr):new Ie(_n,0)}return Hr.alpha=function(_n){return Dt(+_n)},Hr}(.5);function Cr(Dt,yr){this._context=Dt,this._alpha=yr}Cr.prototype={areaStart:lr,areaEnd:lr,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(Dt,yr){if(Dt=+Dt,yr=+yr,this._point){var Hr=this._x2-Dt,_n=this._y2-yr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Hr*Hr+_n*_n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=Dt,this._y3=yr;break;case 1:this._point=2,this._context.moveTo(this._x4=Dt,this._y4=yr);break;case 2:this._point=3,this._x5=Dt,this._y5=yr;break;default:Nt(this,Dt,yr);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=Dt,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var Sr=function Dt(yr){function Hr(_n){return yr?new Cr(_n,yr):new Be(_n,0)}return Hr.alpha=function(_n){return Dt(+_n)},Hr}(.5);function Tr(Dt,yr){this._context=Dt,this._alpha=yr}Tr.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(Dt,yr){if(Dt=+Dt,yr=+yr,this._point){var Hr=this._x2-Dt,_n=this._y2-yr;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(Hr*Hr+_n*_n,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:Nt(this,Dt,yr);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=Dt,this._y0=this._y1,this._y1=this._y2,this._y2=yr}};var Yr=function Dt(yr){function Hr(_n){return yr?new Tr(_n,yr):new ft(_n,0)}return Hr.alpha=function(_n){return Dt(+_n)},Hr}(.5);function Fn(Dt){this._context=Dt}Fn.prototype={areaStart:lr,areaEnd:lr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(Dt,yr){Dt=+Dt,yr=+yr,this._point?this._context.lineTo(Dt,yr):(this._point=1,this._context.moveTo(Dt,yr))}};function ua(Dt){return new Fn(Dt)}function ta(Dt){return Dt<0?-1:1}function va(Dt,yr,Hr){var _n=Dt._x1-Dt._x0,Hn=yr-Dt._x1,ea=(Dt._y1-Dt._y0)/(_n||Hn<0&&-0),Qn=(Hr-Dt._y1)/(Hn||_n<0&&-0),bn=(ea*Hn+Qn*_n)/(_n+Hn);return(ta(ea)+ta(Qn))*Math.min(Math.abs(ea),Math.abs(Qn),.5*Math.abs(bn))||0}function ma(Dt,yr){var Hr=Dt._x1-Dt._x0;return Hr?(3*(Dt._y1-Dt._y0)/Hr-yr)/2:yr}function Jn(Dt,yr,Hr){var _n=Dt._x0,Hn=Dt._y0,ea=Dt._x1,Qn=Dt._y1,bn=(ea-_n)/3;Dt._context.bezierCurveTo(_n+bn,Hn+bn*yr,ea-bn,Qn-bn*Hr,ea,Qn)}function ja(Dt){this._context=Dt}ja.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:Jn(this,this._t0,ma(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(Dt,yr){var Hr=NaN;if(Dt=+Dt,yr=+yr,!(Dt===this._x1&&yr===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(Dt,yr):this._context.moveTo(Dt,yr);break;case 1:this._point=2;break;case 2:this._point=3,Jn(this,ma(this,Hr=va(this,Dt,yr)),Hr);break;default:Jn(this,this._t0,Hr=va(this,Dt,yr));break}this._x0=this._x1,this._x1=Dt,this._y0=this._y1,this._y1=yr,this._t0=Hr}}};function ti(Dt){this._context=new gr(Dt)}(ti.prototype=Object.create(ja.prototype)).point=function(Dt,yr){ja.prototype.point.call(this,yr,Dt)};function gr(Dt){this._context=Dt}gr.prototype={moveTo:function(Dt,yr){this._context.moveTo(yr,Dt)},closePath:function(){this._context.closePath()},lineTo:function(Dt,yr){this._context.lineTo(yr,Dt)},bezierCurveTo:function(Dt,yr,Hr,_n,Hn,ea){this._context.bezierCurveTo(yr,Dt,_n,Hr,ea,Hn)}};function Kt(Dt){return new ja(Dt)}function vr(Dt){return new ti(Dt)}function _r(Dt){this._context=Dt}_r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var Dt=this._x,yr=this._y,Hr=Dt.length;if(Hr)if(this._line?this._context.lineTo(Dt[0],yr[0]):this._context.moveTo(Dt[0],yr[0]),Hr===2)this._context.lineTo(Dt[1],yr[1]);else for(var _n=rn(Dt),Hn=rn(yr),ea=0,Qn=1;Qn=0;--yr)Hn[yr]=(Qn[yr]-Hn[yr+1])/ea[yr];for(ea[Hr-1]=(Dt[Hr]+Hn[Hr-1])/2,yr=0;yr=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(Dt,yr){switch(Dt=+Dt,yr=+yr,this._point){case 0:this._point=1,this._line?this._context.lineTo(Dt,yr):this._context.moveTo(Dt,yr);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,yr),this._context.lineTo(Dt,yr);else{var Hr=this._x*(1-this._t)+Dt*this._t;this._context.lineTo(Hr,this._y),this._context.lineTo(Hr,yr)}break}}this._x=Dt,this._y=yr}};function In(Dt){return new Mn(Dt,.5)}function fa(Dt){return new Mn(Dt,0)}function Ca(Dt){return new Mn(Dt,1)}function Ma(Dt,yr){if((Qn=Dt.length)>1)for(var Hr=1,_n,Hn,ea=Dt[yr[0]],Qn,bn=ea.length;Hr=0;)Hr[yr]=yr;return Hr}function Va(Dt,yr){return Dt[yr]}function na(){var Dt=S([]),yr=Da,Hr=Ma,_n=Va;function Hn(ea){var Qn=Dt.apply(this,arguments),bn,$n=ea.length,ki=Qn.length,Ua=new Array(ki),Fi;for(bn=0;bn0){for(var Hr,_n,Hn=0,ea=Dt[0].length,Qn;Hn0)for(var Hr,_n=0,Hn,ea,Qn,bn,$n,ki=Dt[yr[0]].length;_n0?(Hn[0]=Qn,Hn[1]=Qn+=ea):ea<0?(Hn[1]=bn,Hn[0]=bn+=ea):(Hn[0]=0,Hn[1]=ea)}function Vt(Dt,yr){if((Hn=Dt.length)>0){for(var Hr=0,_n=Dt[yr[0]],Hn,ea=_n.length;Hr0)||!((ea=(Hn=Dt[yr[0]]).length)>0))){for(var Hr=0,_n=1,Hn,ea,Qn;_nea&&(ea=Hn,Hr=yr);return Hr}function Qr(Dt){var yr=Dt.map(Gr);return Da(Dt).sort(function(Hr,_n){return yr[Hr]-yr[_n]})}function Gr(Dt){for(var yr=0,Hr=-1,_n=Dt.length,Hn;++Hr<_n;)(Hn=+Dt[Hr][1])&&(yr+=Hn);return yr}function Jr(Dt){return Qr(Dt).reverse()}function yn(Dt){var yr=Dt.length,Hr,_n,Hn=Dt.map(Gr),ea=Br(Dt),Qn=0,bn=0,$n=[],ki=[];for(Hr=0;Hr0;--me)le(Q*=.99),ue(),Y(Q),ue();function ie(){var Te=x.max(se,function(Xe){return Xe.length}),Fe=q*(R-d)/(Te-1);z>Fe&&(z=Fe);var Ve=x.min(se,function(Xe){return(R-d-(Xe.length-1)*z)/x.sum(Xe,c)});se.forEach(function(Xe){Xe.forEach(function(We,it){We.y1=(We.y0=it)+We.value*Ve})}),ae.links.forEach(function(Xe){Xe.width=Xe.value*Ve})}function Y(Te){se.forEach(function(Fe){Fe.forEach(function(Ve){if(Ve.targetLinks.length){var Xe=(x.sum(Ve.targetLinks,p)/x.sum(Ve.targetLinks,c)-v(Ve))*Te;Ve.y0+=Xe,Ve.y1+=Xe}})})}function le(Te){se.slice().reverse().forEach(function(Fe){Fe.forEach(function(Ve){if(Ve.sourceLinks.length){var Xe=(x.sum(Ve.sourceLinks,T)/x.sum(Ve.sourceLinks,c)-v(Ve))*Te;Ve.y0+=Xe,Ve.y1+=Xe}})})}function ue(){se.forEach(function(Te){var Fe,Ve,Xe=d,We=Te.length,it;for(Te.sort(f),it=0;it0&&(Fe.y0+=Ve,Fe.y1+=Ve),Xe=Fe.y1+z;if(Ve=Xe-z-R,Ve>0)for(Xe=Fe.y0-=Ve,Fe.y1-=Ve,it=We-2;it>=0;--it)Fe=Te[it],Ve=Fe.y1+z-Xe,Ve>0&&(Fe.y0-=Ve,Fe.y1-=Ve),Xe=Fe.y0})}}function W(ae){ae.nodes.forEach(function(se){se.sourceLinks.sort(s),se.targetLinks.sort(a)}),ae.nodes.forEach(function(se){var Q=se.y0,me=Q;se.sourceLinks.forEach(function(ie){ie.y0=Q+ie.width/2,Q+=ie.width}),se.targetLinks.forEach(function(ie){ie.y1=me+ie.width/2,me+=ie.width})})}return J};function _(u){return[u.source.x1,u.y0]}function w(u){return[u.target.x0,u.y1]}var m=function(){return k.linkHorizontal().source(_).target(w)};h.sankey=E,h.sankeyCenter=n,h.sankeyLeft=t,h.sankeyRight=r,h.sankeyJustify=o,h.sankeyLinkHorizontal=m,Object.defineProperty(h,"__esModule",{value:!0})})}}),JD=_e({"node_modules/elementary-circuits-directed-graph/johnson.js"(ee,X){var h=WA();X.exports=function(S,k){var e=[],t=[],r=[],o={},n=[],i;function a(A){r[A]=!1,o.hasOwnProperty(A)&&Object.keys(o[A]).forEach(function(E){delete o[A][E],r[E]&&a(E)})}function s(A){var E=!1;t.push(A),r[A]=!0;var _,w;for(_=0;_=A})}function v(A){c(A);for(var E=S,_=h(E),w=_.components.filter(function(z){return z.length>1}),m=1/0,u,d=0;d"u"?"undefined":s(Ie))!=="object"&&(Ie=ct.source=_(Qe,Ie)),(typeof Pe>"u"?"undefined":s(Pe))!=="object"&&(Pe=ct.target=_(Qe,Pe)),Ie.sourceLinks.push(ct),Pe.targetLinks.push(ct)}),Ot}function dr(Ot){Ot.nodes.forEach(function(Qe){Qe.partOfCycle=!1,Qe.value=Math.max(x.sum(Qe.sourceLinks,p),x.sum(Qe.targetLinks,p)),Qe.sourceLinks.forEach(function(ct){ct.circular&&(Qe.partOfCycle=!0,Qe.circularLinkType=ct.circularLinkType)}),Qe.targetLinks.forEach(function(ct){ct.circular&&(Qe.partOfCycle=!0,Qe.circularLinkType=ct.circularLinkType)})})}function Nr(Ot){var Qe=0,ct=0,Ue=0,Ie=0,Pe=x.max(Ot.nodes,function(Be){return Be.column});return Ot.links.forEach(function(Be){Be.circular&&(Be.circularLinkType=="top"?Qe=Qe+Be.width:ct=ct+Be.width,Be.target.column==0&&(Ie=Ie+Be.width),Be.source.column==Pe&&(Ue=Ue+Be.width))}),Qe=Qe>0?Qe+m+u:Qe,ct=ct>0?ct+m+u:ct,Ue=Ue>0?Ue+m+u:Ue,Ie=Ie>0?Ie+m+u:Ie,{top:Qe,bottom:ct,left:Ie,right:Ue}}function Fr(Ot,Qe){var ct=x.max(Ot.nodes,function(Bt){return Bt.column}),Ue=yt-We,Ie=bt-it,Pe=Ue+Qe.right+Qe.left,Be=Ie+Qe.top+Qe.bottom,at=Ue/Pe,ft=Ie/Be;return We=We*at+Qe.left,yt=Qe.right==0?yt:yt*at,it=it*ft+Qe.top,bt=bt*ft,Ot.nodes.forEach(function(Bt){Bt.x0=We+Bt.column*((yt-We-mt)/ct),Bt.x1=Bt.x0+mt}),ft}function ln(Ot){var Qe,ct,Ue;for(Qe=Ot.nodes,ct=[],Ue=0;Qe.length;++Ue,Qe=ct,ct=[])Qe.forEach(function(Ie){Ie.depth=Ue,Ie.sourceLinks.forEach(function(Pe){ct.indexOf(Pe.target)<0&&!Pe.circular&&ct.push(Pe.target)})});for(Qe=Ot.nodes,ct=[],Ue=0;Qe.length;++Ue,Qe=ct,ct=[])Qe.forEach(function(Ie){Ie.height=Ue,Ie.targetLinks.forEach(function(Pe){ct.indexOf(Pe.source)<0&&!Pe.circular&&ct.push(Pe.source)})});Ot.nodes.forEach(function(Ie){Ie.column=Math.floor(ze.call(null,Ie,Ue))})}function zr(Ot,Qe,ct){var Ue=S.nest().key(function(Bt){return Bt.column}).sortKeys(x.ascending).entries(Ot.nodes).map(function(Bt){return Bt.values});Be(ct),ft();for(var Ie=1,Pe=Qe;Pe>0;--Pe)at(Ie*=.99,ct),ft();function Be(Bt){if(vt){var Nt=1/0;Ue.forEach(function(Sr){var Tr=bt*vt/(Sr.length+1);Nt=Tr0))if(Sr==0&&Cr==1)Yr=Tr.y1-Tr.y0,Tr.y0=bt/2-Yr/2,Tr.y1=bt/2+Yr/2;else if(Sr==Ht-1&&Cr==1)Yr=Tr.y1-Tr.y0,Tr.y0=bt/2-Yr/2,Tr.y1=bt/2+Yr/2;else{var Fn=0,ua=x.mean(Tr.sourceLinks,g),ta=x.mean(Tr.targetLinks,l);ua&&ta?Fn=(ua+ta)/2:Fn=ua||ta;var va=(Fn-T(Tr))*Bt;Tr.y0+=va,Tr.y1+=va}})})}function ft(){Ue.forEach(function(Bt){var Nt,Ht,or=it,Cr=Bt.length,Sr;for(Bt.sort(v),Sr=0;Sr0&&(Nt.y0+=Ht,Nt.y1+=Ht),or=Nt.y1+ht;if(Ht=or-ht-bt,Ht>0)for(or=Nt.y0-=Ht,Nt.y1-=Ht,Sr=Cr-2;Sr>=0;--Sr)Nt=Bt[Sr],Ht=Nt.y1+ht-or,Ht>0&&(Nt.y0-=Ht,Nt.y1-=Ht),or=Nt.y0})}}function Xr(Ot){Ot.nodes.forEach(function(Qe){Qe.sourceLinks.sort(c),Qe.targetLinks.sort(f)}),Ot.nodes.forEach(function(Qe){var ct=Qe.y0,Ue=ct,Ie=Qe.y1,Pe=Ie;Qe.sourceLinks.forEach(function(Be){Be.circular?(Be.y0=Ie-Be.width/2,Ie=Ie-Be.width):(Be.y0=ct+Be.width/2,ct+=Be.width)}),Qe.targetLinks.forEach(function(Be){Be.circular?(Be.y1=Pe-Be.width/2,Pe=Pe-Be.width):(Be.y1=Ue+Be.width/2,Ue+=Be.width)})})}return Yt}function R(We,it,yt){var bt=0;if(yt===null){for(var mt=[],ht=0;htit.source.column)}function U(We,it){var yt=0;We.sourceLinks.forEach(function(mt){yt=mt.circular&&!Ve(mt,it)?yt+1:yt});var bt=0;return We.targetLinks.forEach(function(mt){bt=mt.circular&&!Ve(mt,it)?bt+1:bt}),yt+bt}function B(We){var it=We.source.sourceLinks,yt=0;it.forEach(function(ht){yt=ht.circular?yt+1:yt});var bt=We.target.targetLinks,mt=0;return bt.forEach(function(ht){mt=ht.circular?mt+1:mt}),!(yt>1||mt>1)}function D(We,it,yt){return We.sort(J),We.forEach(function(bt,mt){var ht=0;if(Ve(bt,yt)&&B(bt))bt.circularPathData.verticalBuffer=ht+bt.width/2;else{var qe=0;for(qe;qeht?ze:ht}bt.circularPathData.verticalBuffer=ht+bt.width/2}}),We}function j(We,it,yt,bt){var mt=5,ht=x.min(We.links,function(Ae){return Ae.source.y0});We.links.forEach(function(Ae){Ae.circular&&(Ae.circularPathData={})});var qe=We.links.filter(function(Ae){return Ae.circularLinkType=="top"});D(qe,it,bt);var ze=We.links.filter(function(Ae){return Ae.circularLinkType=="bottom"});D(ze,it,bt),We.links.forEach(function(Ae){if(Ae.circular){if(Ae.circularPathData.arcRadius=Ae.width+u,Ae.circularPathData.leftNodeBuffer=mt,Ae.circularPathData.rightNodeBuffer=mt,Ae.circularPathData.sourceWidth=Ae.source.x1-Ae.source.x0,Ae.circularPathData.sourceX=Ae.source.x0+Ae.circularPathData.sourceWidth,Ae.circularPathData.targetX=Ae.target.x0,Ae.circularPathData.sourceY=Ae.y0,Ae.circularPathData.targetY=Ae.y1,Ve(Ae,bt)&&B(Ae))Ae.circularPathData.leftSmallArcRadius=u+Ae.width/2,Ae.circularPathData.leftLargeArcRadius=u+Ae.width/2,Ae.circularPathData.rightSmallArcRadius=u+Ae.width/2,Ae.circularPathData.rightLargeArcRadius=u+Ae.width/2,Ae.circularLinkType=="bottom"?(Ae.circularPathData.verticalFullExtent=Ae.source.y1+m+Ae.circularPathData.verticalBuffer,Ae.circularPathData.verticalLeftInnerExtent=Ae.circularPathData.verticalFullExtent-Ae.circularPathData.leftLargeArcRadius,Ae.circularPathData.verticalRightInnerExtent=Ae.circularPathData.verticalFullExtent-Ae.circularPathData.rightLargeArcRadius):(Ae.circularPathData.verticalFullExtent=Ae.source.y0-m-Ae.circularPathData.verticalBuffer,Ae.circularPathData.verticalLeftInnerExtent=Ae.circularPathData.verticalFullExtent+Ae.circularPathData.leftLargeArcRadius,Ae.circularPathData.verticalRightInnerExtent=Ae.circularPathData.verticalFullExtent+Ae.circularPathData.rightLargeArcRadius);else{var Ke=Ae.source.column,_t=Ae.circularLinkType,wt=We.links.filter(function(Yt){return Yt.source.column==Ke&&Yt.circularLinkType==_t});Ae.circularLinkType=="bottom"?wt.sort(ye):wt.sort(oe);var vt=0;wt.forEach(function(Yt,lr){Yt.circularLinkID==Ae.circularLinkID&&(Ae.circularPathData.leftSmallArcRadius=u+Ae.width/2+vt,Ae.circularPathData.leftLargeArcRadius=u+Ae.width/2+lr*it+vt),vt=vt+Yt.width}),Ke=Ae.target.column,wt=We.links.filter(function(Yt){return Yt.target.column==Ke&&Yt.circularLinkType==_t}),Ae.circularLinkType=="bottom"?wt.sort(ge):wt.sort(pe),vt=0,wt.forEach(function(Yt,lr){Yt.circularLinkID==Ae.circularLinkID&&(Ae.circularPathData.rightSmallArcRadius=u+Ae.width/2+vt,Ae.circularPathData.rightLargeArcRadius=u+Ae.width/2+lr*it+vt),vt=vt+Yt.width}),Ae.circularLinkType=="bottom"?(Ae.circularPathData.verticalFullExtent=Math.max(yt,Ae.source.y1,Ae.target.y1)+m+Ae.circularPathData.verticalBuffer,Ae.circularPathData.verticalLeftInnerExtent=Ae.circularPathData.verticalFullExtent-Ae.circularPathData.leftLargeArcRadius,Ae.circularPathData.verticalRightInnerExtent=Ae.circularPathData.verticalFullExtent-Ae.circularPathData.rightLargeArcRadius):(Ae.circularPathData.verticalFullExtent=ht-m-Ae.circularPathData.verticalBuffer,Ae.circularPathData.verticalLeftInnerExtent=Ae.circularPathData.verticalFullExtent+Ae.circularPathData.leftLargeArcRadius,Ae.circularPathData.verticalRightInnerExtent=Ae.circularPathData.verticalFullExtent+Ae.circularPathData.rightLargeArcRadius)}Ae.circularPathData.leftInnerExtent=Ae.circularPathData.sourceX+Ae.circularPathData.leftNodeBuffer,Ae.circularPathData.rightInnerExtent=Ae.circularPathData.targetX-Ae.circularPathData.rightNodeBuffer,Ae.circularPathData.leftFullExtent=Ae.circularPathData.sourceX+Ae.circularPathData.leftLargeArcRadius+Ae.circularPathData.leftNodeBuffer,Ae.circularPathData.rightFullExtent=Ae.circularPathData.targetX-Ae.circularPathData.rightLargeArcRadius-Ae.circularPathData.rightNodeBuffer}if(Ae.circular)Ae.path=q(Ae);else{var $t=k.linkHorizontal().source(function(Yt){var lr=Yt.source.x0+(Yt.source.x1-Yt.source.x0),dr=Yt.y0;return[lr,dr]}).target(function(Yt){var lr=Yt.target.x0,dr=Yt.y1;return[lr,dr]});Ae.path=$t(Ae)}})}function q(We){var it="";return We.circularLinkType=="top"?it="M"+We.circularPathData.sourceX+" "+We.circularPathData.sourceY+" L"+We.circularPathData.leftInnerExtent+" "+We.circularPathData.sourceY+" A"+We.circularPathData.leftLargeArcRadius+" "+We.circularPathData.leftSmallArcRadius+" 0 0 0 "+We.circularPathData.leftFullExtent+" "+(We.circularPathData.sourceY-We.circularPathData.leftSmallArcRadius)+" L"+We.circularPathData.leftFullExtent+" "+We.circularPathData.verticalLeftInnerExtent+" A"+We.circularPathData.leftLargeArcRadius+" "+We.circularPathData.leftLargeArcRadius+" 0 0 0 "+We.circularPathData.leftInnerExtent+" "+We.circularPathData.verticalFullExtent+" L"+We.circularPathData.rightInnerExtent+" "+We.circularPathData.verticalFullExtent+" A"+We.circularPathData.rightLargeArcRadius+" "+We.circularPathData.rightLargeArcRadius+" 0 0 0 "+We.circularPathData.rightFullExtent+" "+We.circularPathData.verticalRightInnerExtent+" L"+We.circularPathData.rightFullExtent+" "+(We.circularPathData.targetY-We.circularPathData.rightSmallArcRadius)+" A"+We.circularPathData.rightLargeArcRadius+" "+We.circularPathData.rightSmallArcRadius+" 0 0 0 "+We.circularPathData.rightInnerExtent+" "+We.circularPathData.targetY+" L"+We.circularPathData.targetX+" "+We.circularPathData.targetY:it="M"+We.circularPathData.sourceX+" "+We.circularPathData.sourceY+" L"+We.circularPathData.leftInnerExtent+" "+We.circularPathData.sourceY+" A"+We.circularPathData.leftLargeArcRadius+" "+We.circularPathData.leftSmallArcRadius+" 0 0 1 "+We.circularPathData.leftFullExtent+" "+(We.circularPathData.sourceY+We.circularPathData.leftSmallArcRadius)+" L"+We.circularPathData.leftFullExtent+" "+We.circularPathData.verticalLeftInnerExtent+" A"+We.circularPathData.leftLargeArcRadius+" "+We.circularPathData.leftLargeArcRadius+" 0 0 1 "+We.circularPathData.leftInnerExtent+" "+We.circularPathData.verticalFullExtent+" L"+We.circularPathData.rightInnerExtent+" "+We.circularPathData.verticalFullExtent+" A"+We.circularPathData.rightLargeArcRadius+" "+We.circularPathData.rightLargeArcRadius+" 0 0 1 "+We.circularPathData.rightFullExtent+" "+We.circularPathData.verticalRightInnerExtent+" L"+We.circularPathData.rightFullExtent+" "+(We.circularPathData.targetY+We.circularPathData.rightSmallArcRadius)+" A"+We.circularPathData.rightLargeArcRadius+" "+We.circularPathData.rightSmallArcRadius+" 0 0 1 "+We.circularPathData.rightInnerExtent+" "+We.circularPathData.targetY+" L"+We.circularPathData.targetX+" "+We.circularPathData.targetY,it}function J(We,it){return W(We)==W(it)?We.circularLinkType=="bottom"?ye(We,it):oe(We,it):W(it)-W(We)}function oe(We,it){return We.y0-it.y0}function ye(We,it){return it.y0-We.y0}function pe(We,it){return We.y1-it.y1}function ge(We,it){return it.y1-We.y1}function W(We){return We.target.column-We.source.column}function ae(We){return We.target.x0-We.source.x1}function se(We,it){var yt=z(We),bt=ae(it)/Math.tan(yt),mt=Fe(We)=="up"?We.y1+bt:We.y1-bt;return mt}function Q(We,it){var yt=z(We),bt=ae(it)/Math.tan(yt),mt=Fe(We)=="up"?We.y1-bt:We.y1+bt;return mt}function me(We,it,yt,bt){We.links.forEach(function(mt){if(!mt.circular&&mt.target.column-mt.source.column>1){var ht=mt.source.column+1,qe=mt.target.column-1,ze=1,Ae=qe-ht+1;for(ze=1;ht<=qe;ht++,ze++)We.nodes.forEach(function(Ke){if(Ke.column==ht){var _t=ze/(Ae+1),wt=Math.pow(1-_t,3),vt=3*_t*Math.pow(1-_t,2),$t=3*Math.pow(_t,2)*(1-_t),Yt=Math.pow(_t,3),lr=wt*mt.y0+vt*mt.y0+$t*mt.y1+Yt*mt.y1,dr=lr-mt.width/2,Nr=lr+mt.width/2,Fr;dr>Ke.y0&&drKe.y0&&NrKe.y1&&Y(ln,Fr,it,yt)})):drKe.y1&&(Fr=Nr-Ke.y0+10,Ke=Y(Ke,Fr,it,yt),We.nodes.forEach(function(ln){w(ln,bt)==w(Ke,bt)||ln.column!=Ke.column||ln.y0Ke.y1&&Y(ln,Fr,it,yt)}))}})}})}function ie(We,it){return We.y0>it.y0&&We.y0it.y0&&We.y1it.y1}function Y(We,it,yt,bt){return We.y0+it>=yt&&We.y1+it<=bt&&(We.y0=We.y0+it,We.y1=We.y1+it,We.targetLinks.forEach(function(mt){mt.y1=mt.y1+it}),We.sourceLinks.forEach(function(mt){mt.y0=mt.y0+it})),We}function le(We,it,yt,bt){We.nodes.forEach(function(mt){bt&&mt.y+(mt.y1-mt.y0)>it&&(mt.y=mt.y-(mt.y+(mt.y1-mt.y0)-it));var ht=We.links.filter(function(Ae){return w(Ae.source,yt)==w(mt,yt)}),qe=ht.length;qe>1&&ht.sort(function(Ae,Ke){if(!Ae.circular&&!Ke.circular){if(Ae.target.column==Ke.target.column)return Ae.y1-Ke.y1;if(Te(Ae,Ke)){if(Ae.target.column>Ke.target.column){var _t=Q(Ke,Ae);return Ae.y1-_t}if(Ke.target.column>Ae.target.column){var wt=Q(Ae,Ke);return wt-Ke.y1}}else return Ae.y1-Ke.y1}if(Ae.circular&&!Ke.circular)return Ae.circularLinkType=="top"?-1:1;if(Ke.circular&&!Ae.circular)return Ke.circularLinkType=="top"?1:-1;if(Ae.circular&&Ke.circular)return Ae.circularLinkType===Ke.circularLinkType&&Ae.circularLinkType=="top"?Ae.target.column===Ke.target.column?Ae.target.y1-Ke.target.y1:Ke.target.column-Ae.target.column:Ae.circularLinkType===Ke.circularLinkType&&Ae.circularLinkType=="bottom"?Ae.target.column===Ke.target.column?Ke.target.y1-Ae.target.y1:Ae.target.column-Ke.target.column:Ae.circularLinkType=="top"?-1:1});var ze=mt.y0;ht.forEach(function(Ae){Ae.y0=ze+Ae.width/2,ze=ze+Ae.width}),ht.forEach(function(Ae,Ke){if(Ae.circularLinkType=="bottom"){var _t=Ke+1,wt=0;for(_t;_t1&&mt.sort(function(ze,Ae){if(!ze.circular&&!Ae.circular){if(ze.source.column==Ae.source.column)return ze.y0-Ae.y0;if(Te(ze,Ae)){if(Ae.source.column0?"up":"down"}function Ve(We,it){return w(We.source,it)==w(We.target,it)}function Xe(We,it,yt){var bt=We.nodes,mt=We.links,ht=!1,qe=!1;if(mt.forEach(function(vt){vt.circularLinkType=="top"?ht=!0:vt.circularLinkType=="bottom"&&(qe=!0)}),ht==!1||qe==!1){var ze=x.min(bt,function(vt){return vt.y0}),Ae=x.max(bt,function(vt){return vt.y1}),Ke=Ae-ze,_t=yt-it,wt=_t/Ke;bt.forEach(function(vt){var $t=(vt.y1-vt.y0)*wt;vt.y0=(vt.y0-ze)*wt,vt.y1=vt.y0+$t}),mt.forEach(function(vt){vt.y0=(vt.y0-ze)*wt,vt.y1=(vt.y1-ze)*wt,vt.width=vt.width*wt})}}h.sankeyCircular=y,h.sankeyCenter=i,h.sankeyLeft=r,h.sankeyRight=o,h.sankeyJustify=n,Object.defineProperty(h,"__esModule",{value:!0})})}}),XA=_e({"src/traces/sankey/constants.js"(ee,X){X.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"}}}}),e4=_e({"src/traces/sankey/render.js"(ee,X){var h=XD(),x=(xm(),Lr(P0)).interpolateNumber,S=mr(),k=KD(),e=QD(),t=XA(),r=bs(),o=so(),n=ri(),i=kn(),a=i.strTranslate,s=i.strRotate,f=hv(),c=f.keyFun,v=f.repeat,p=f.unwrap,T=Au(),l=bi(),g=eh(),b=g.CAP_SHIFT,A=g.LINE_SPACING,E=3;function _(se,Q,me){var ie=p(Q),Y=ie.trace,le=Y.domain,ue=Y.orientation==="h",Te=Y.node.pad,Fe=Y.node.thickness,Ve={justify:k.sankeyJustify,left:k.sankeyLeft,right:k.sankeyRight,center:k.sankeyCenter}[Y.node.align],Xe=se.width*(le.x[1]-le.x[0]),We=se.height*(le.y[1]-le.y[0]),it=ie._nodes,yt=ie._links,bt=ie.circular,mt;bt?mt=e.sankeyCircular().circularLinkGap(0):mt=k.sankey(),mt.iterations(t.sankeyIterations).size(ue?[Xe,We]:[We,Xe]).nodeWidth(Fe).nodePadding(Te).nodeId(function(ln){return ln.pointNumber}).nodeAlign(Ve).nodes(it).links(yt);var ht=mt();mt.nodePadding()=Qe||(Ot=Qe-Xr.y0,Ot>1e-6&&(Xr.y0+=Ot,Xr.y1+=Ot)),Qe=Xr.y1+Te})}function lr(ln){var zr=ln.map(function(Pe,Be){return{x0:Pe.x0,index:Be}}).sort(function(Pe,Be){return Pe.x0-Be.x0}),Xr=[],Ot=-1,Qe,ct=-1/0,Ue;for(qe=0;qect+Fe&&(Ot+=1,Qe=Ie.x0),ct=Ie.x0,Xr[Ot]||(Xr[Ot]=[]),Xr[Ot].push(Ie),Ue=Qe-Ie.x0,Ie.x0+=Ue,Ie.x1+=Ue}return Xr}if(Y.node.x.length&&Y.node.y.length){for(qe=0;qe0?" L "+Y.targetX+" "+Y.targetY:"")+"Z"):(me="M "+(Y.targetX-Q)+" "+(Y.targetY-ie)+" L "+(Y.rightInnerExtent-Q)+" "+(Y.targetY-ie)+" A "+(Y.rightLargeArcRadius+ie)+" "+(Y.rightSmallArcRadius+ie)+" 0 0 0 "+(Y.rightFullExtent-ie-Q)+" "+(Y.targetY+Y.rightSmallArcRadius)+" L "+(Y.rightFullExtent-ie-Q)+" "+Y.verticalRightInnerExtent,le&&ue?me+=" A "+(Y.rightLargeArcRadius+ie)+" "+(Y.rightLargeArcRadius+ie)+" 0 0 0 "+(Y.rightInnerExtent-ie-Q)+" "+(Y.verticalFullExtent+ie)+" L "+(Y.rightFullExtent+ie-Q-(Y.rightLargeArcRadius-ie))+" "+(Y.verticalFullExtent+ie)+" A "+(Y.rightLargeArcRadius+ie)+" "+(Y.rightLargeArcRadius+ie)+" 0 0 0 "+(Y.leftFullExtent+ie)+" "+Y.verticalLeftInnerExtent:le?me+=" A "+(Y.rightLargeArcRadius-ie)+" "+(Y.rightSmallArcRadius-ie)+" 0 0 1 "+(Y.rightFullExtent-Q-ie-(Y.rightLargeArcRadius-ie))+" "+(Y.verticalFullExtent-ie)+" L "+(Y.leftFullExtent+ie+(Y.rightLargeArcRadius-ie))+" "+(Y.verticalFullExtent-ie)+" A "+(Y.rightLargeArcRadius-ie)+" "+(Y.rightSmallArcRadius-ie)+" 0 0 1 "+(Y.leftFullExtent+ie)+" "+Y.verticalLeftInnerExtent:me+=" A "+(Y.rightLargeArcRadius+ie)+" "+(Y.rightLargeArcRadius+ie)+" 0 0 0 "+(Y.rightInnerExtent-Q)+" "+(Y.verticalFullExtent+ie)+" L "+Y.leftInnerExtent+" "+(Y.verticalFullExtent+ie)+" A "+(Y.leftLargeArcRadius+ie)+" "+(Y.leftLargeArcRadius+ie)+" 0 0 0 "+(Y.leftFullExtent+ie)+" "+Y.verticalLeftInnerExtent,me+=" L "+(Y.leftFullExtent+ie)+" "+(Y.sourceY+Y.leftSmallArcRadius)+" A "+(Y.leftLargeArcRadius+ie)+" "+(Y.leftSmallArcRadius+ie)+" 0 0 0 "+Y.leftInnerExtent+" "+(Y.sourceY-ie)+" L "+Y.sourceX+" "+(Y.sourceY-ie)+" L "+Y.sourceX+" "+(Y.sourceY+ie)+" L "+Y.leftInnerExtent+" "+(Y.sourceY+ie)+" A "+(Y.leftLargeArcRadius-ie)+" "+(Y.leftSmallArcRadius-ie)+" 0 0 1 "+(Y.leftFullExtent-ie)+" "+(Y.sourceY+Y.leftSmallArcRadius)+" L "+(Y.leftFullExtent-ie)+" "+Y.verticalLeftInnerExtent,le&&ue?me+=" A "+(Y.rightLargeArcRadius-ie)+" "+(Y.rightSmallArcRadius-ie)+" 0 0 1 "+(Y.leftFullExtent-ie-(Y.rightLargeArcRadius-ie))+" "+(Y.verticalFullExtent-ie)+" L "+(Y.rightFullExtent+ie-Q+(Y.rightLargeArcRadius-ie))+" "+(Y.verticalFullExtent-ie)+" A "+(Y.rightLargeArcRadius-ie)+" "+(Y.rightSmallArcRadius-ie)+" 0 0 1 "+(Y.rightFullExtent+ie-Q)+" "+Y.verticalRightInnerExtent:le?me+=" A "+(Y.rightLargeArcRadius+ie)+" "+(Y.rightLargeArcRadius+ie)+" 0 0 0 "+(Y.leftFullExtent+ie)+" "+(Y.verticalFullExtent+ie)+" L "+(Y.rightFullExtent-Q-ie)+" "+(Y.verticalFullExtent+ie)+" A "+(Y.rightLargeArcRadius+ie)+" "+(Y.rightLargeArcRadius+ie)+" 0 0 0 "+(Y.rightFullExtent+ie-Q)+" "+Y.verticalRightInnerExtent:me+=" A "+(Y.leftLargeArcRadius-ie)+" "+(Y.leftLargeArcRadius-ie)+" 0 0 1 "+Y.leftInnerExtent+" "+(Y.verticalFullExtent-ie)+" L "+(Y.rightInnerExtent-Q)+" "+(Y.verticalFullExtent-ie)+" A "+(Y.rightLargeArcRadius-ie)+" "+(Y.rightLargeArcRadius-ie)+" 0 0 1 "+(Y.rightFullExtent+ie-Q)+" "+Y.verticalRightInnerExtent,me+=" L "+(Y.rightFullExtent+ie-Q)+" "+(Y.targetY+Y.rightSmallArcRadius)+" A "+(Y.rightLargeArcRadius-ie)+" "+(Y.rightSmallArcRadius-ie)+" 0 0 1 "+(Y.rightInnerExtent-Q)+" "+(Y.targetY+ie)+" L "+(Y.targetX-Q)+" "+(Y.targetY+ie)+(Q>0?" L "+Y.targetX+" "+Y.targetY:"")+"Z"),me}function u(){var se=.5;function Q(me){var ie=me.linkArrowLength;if(me.link.circular)return m(me.link,ie);var Y=Math.abs((me.link.target.x0-me.link.source.x1)/2);ie>Y&&(ie=Y);var le=me.link.source.x1,ue=me.link.target.x0-ie,Te=x(le,ue),Fe=Te(se),Ve=Te(1-se),Xe=me.link.y0-me.link.width/2,We=me.link.y0+me.link.width/2,it=me.link.y1-me.link.width/2,yt=me.link.y1+me.link.width/2,bt="M"+le+","+Xe,mt="C"+Fe+","+Xe+" "+Ve+","+it+" "+ue+","+it,ht="C"+Ve+","+yt+" "+Fe+","+We+" "+le+","+We,qe=ie>0?"L"+(ue+ie)+","+(it+me.link.width/2):"";return qe+="L"+ue+","+yt,bt+mt+qe+ht+"Z"}return Q}function d(se,Q){var me=r(Q.color),ie=t.nodePadAcross,Y=se.nodePad/2;Q.dx=Q.x1-Q.x0,Q.dy=Q.y1-Q.y0;var le=Q.dx,ue=Math.max(.5,Q.dy),Te="node_"+Q.pointNumber;return Q.group&&(Te=i.randstr()),Q.trace=se.trace,Q.curveNumber=se.trace.index,{index:Q.pointNumber,key:Te,partOfGroup:Q.partOfGroup||!1,group:Q.group,traceId:se.key,trace:se.trace,node:Q,nodePad:se.nodePad,nodeLineColor:se.nodeLineColor,nodeLineWidth:se.nodeLineWidth,textFont:se.textFont,size:se.horizontal?se.height:se.width,visibleWidth:Math.ceil(le),visibleHeight:ue,zoneX:-ie,zoneY:-Y,zoneWidth:le+2*ie,zoneHeight:ue+2*Y,labelY:se.horizontal?Q.dy/2+1:Q.dx/2+1,left:Q.originalLayer===1,sizeAcross:se.width,forceLayouts:se.forceLayouts,horizontal:se.horizontal,darkBackground:me.getBrightness()<=128,tinyColorHue:o.tinyRGB(me),tinyColorAlpha:me.getAlpha(),valueFormat:se.valueFormat,valueSuffix:se.valueSuffix,sankey:se.sankey,graph:se.graph,arrangement:se.arrangement,uniqueNodeLabelPathId:[se.guid,se.key,Te].join("_"),interactionState:se.interactionState,figure:se}}function y(se){se.attr("transform",function(Q){return a(Q.node.x0.toFixed(3),Q.node.y0.toFixed(3))})}function R(se){se.call(y)}function L(se,Q){se.call(R),Q.attr("d",u())}function z(se){se.attr("width",function(Q){return Q.node.x1-Q.node.x0}).attr("height",function(Q){return Q.visibleHeight})}function N(se){return se.link.width>1||se.linkLineWidth>0}function U(se){var Q=a(se.translateX,se.translateY);return Q+(se.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function B(se,Q,me){se.on(".basic",null).on("mouseover.basic",function(ie){!ie.interactionState.dragInProgress&&!ie.partOfGroup&&(me.hover(this,ie,Q),ie.interactionState.hovered=[this,ie])}).on("mousemove.basic",function(ie){!ie.interactionState.dragInProgress&&!ie.partOfGroup&&(me.follow(this,ie),ie.interactionState.hovered=[this,ie])}).on("mouseout.basic",function(ie){!ie.interactionState.dragInProgress&&!ie.partOfGroup&&(me.unhover(this,ie,Q),ie.interactionState.hovered=!1)}).on("click.basic",function(ie){ie.interactionState.hovered&&(me.unhover(this,ie,Q),ie.interactionState.hovered=!1),!ie.interactionState.dragInProgress&&!ie.partOfGroup&&me.select(this,ie,Q)})}function D(se,Q,me,ie){var Y=S.behavior.drag().origin(function(le){return{x:le.node.x0+le.visibleWidth/2,y:le.node.y0+le.visibleHeight/2}}).on("dragstart",function(le){if(le.arrangement!=="fixed"&&(i.ensureSingle(ie._fullLayout._infolayer,"g","dragcover",function(Te){ie._fullLayout._dragCover=Te}),i.raiseToTop(this),le.interactionState.dragInProgress=le.node,pe(le.node),le.interactionState.hovered&&(me.nodeEvents.unhover.apply(0,le.interactionState.hovered),le.interactionState.hovered=!1),le.arrangement==="snap")){var ue=le.traceId+"|"+le.key;le.forceLayouts[ue]?le.forceLayouts[ue].alpha(1):j(se,ue,le),q(se,Q,le,ue,ie)}}).on("drag",function(le){if(le.arrangement!=="fixed"){var ue=S.event.x,Te=S.event.y;le.arrangement==="snap"?(le.node.x0=ue-le.visibleWidth/2,le.node.x1=ue+le.visibleWidth/2,le.node.y0=Te-le.visibleHeight/2,le.node.y1=Te+le.visibleHeight/2):(le.arrangement==="freeform"&&(le.node.x0=ue-le.visibleWidth/2,le.node.x1=ue+le.visibleWidth/2),Te=Math.max(0,Math.min(le.size-le.visibleHeight/2,Te)),le.node.y0=Te-le.visibleHeight/2,le.node.y1=Te+le.visibleHeight/2),pe(le.node),le.arrangement!=="snap"&&(le.sankey.update(le.graph),L(se.filter(ge(le)),Q))}}).on("dragend",function(le){if(le.arrangement!=="fixed"){le.interactionState.dragInProgress=!1;for(var ue=0;ue0)window.requestAnimationFrame(le);else{var Fe=me.node.originalX;me.node.x0=Fe-me.visibleWidth/2,me.node.x1=Fe+me.visibleWidth/2,oe(me,Y)}})}function J(se,Q,me,ie){return function(){for(var le=0,ue=0;ue0&&ie.forceLayouts[Q].alpha(0)}}function oe(se,Q){for(var me=[],ie=[],Y=0;Y"),color:g(W,"bgcolor")||t.addOpacity(ie.color,1),borderColor:g(W,"bordercolor"),fontFamily:g(W,"font.family"),fontSize:g(W,"font.size"),fontColor:g(W,"font.color"),fontWeight:g(W,"font.weight"),fontStyle:g(W,"font.style"),fontVariant:g(W,"font.variant"),fontTextcase:g(W,"font.textcase"),fontLineposition:g(W,"font.lineposition"),fontShadow:g(W,"font.shadow"),nameLength:g(W,"namelength"),textAlign:g(W,"align"),idealAlign:h.event.x"),color:g(W,"bgcolor")||ge.tinyColorHue,borderColor:g(W,"bordercolor"),fontFamily:g(W,"font.family"),fontSize:g(W,"font.size"),fontColor:g(W,"font.color"),fontWeight:g(W,"font.weight"),fontStyle:g(W,"font.style"),fontVariant:g(W,"font.variant"),fontTextcase:g(W,"font.textcase"),fontLineposition:g(W,"font.lineposition"),fontShadow:g(W,"font.shadow"),nameLength:g(W,"namelength"),textAlign:g(W,"align"),idealAlign:"left",hovertemplate:W.hovertemplate,hovertemplateLabels:le,eventData:[ge.node]},{container:_._hoverlayer.node(),outerContainer:_._paper.node(),gd:A});a(Fe,.85),s(Fe)}}},ye=function(pe,ge,W){A._fullLayout.hovermode!==!1&&(h.select(pe).call(p,ge,W),ge.node.trace.node.hoverinfo!=="skip"&&(ge.node.fullData=ge.node.trace,A.emit("plotly_unhover",{event:h.event,points:[ge.node]})),e.loneUnhover(_._hoverlayer.node()))};k(A,w,E,{width:m.w,height:m.h,margin:{t:m.t,r:m.r,b:m.b,l:m.l}},{linkEvents:{hover:R,follow:D,unhover:j,select:y},nodeEvents:{hover:J,follow:oe,unhover:ye,select:q}})}}}),t4=_e({"src/traces/sankey/base_plot.js"(ee){var X=nc().overrideAll,h=xl().getModuleCalcData,x=ZA(),S=wf(),k=zp(),e=Pd(),t=th().prepSelect,r=kn(),o=bi(),n="sankey";ee.name=n,ee.baseLayoutAttrOverrides=X({hoverlabel:S.hoverlabel},"plot","nested"),ee.plot=function(a){var s=h(a.calcdata,n)[0];x(a,s),ee.updateFx(a)},ee.clean=function(a,s,f,c){var v=c._has&&c._has(n),p=s._has&&s._has(n);v&&!p&&(c._paperdiv.selectAll(".sankey").remove(),c._paperdiv.selectAll(".bgsankey").remove())},ee.updateFx=function(a){for(var s=0;s0}X.exports=function(N,U,B,D){var j=N._fullLayout,q;b(B)&&D&&(q=D()),k.makeTraceGroups(j._indicatorlayer,U,"trace").each(function(J){var oe=J[0],ye=oe.trace,pe=h.select(this),ge=ye._hasGauge,W=ye._isAngular,ae=ye._isBullet,se=ye.domain,Q={w:j._size.w*(se.x[1]-se.x[0]),h:j._size.h*(se.y[1]-se.y[0]),l:j._size.l+j._size.w*se.x[0],r:j._size.r+j._size.w*(1-se.x[1]),t:j._size.t+j._size.h*(1-se.y[1]),b:j._size.b+j._size.h*se.y[0]},me=Q.l+Q.w/2,ie=Q.t+Q.h/2,Y=Math.min(Q.w/2,Q.h),le=i.innerRadius*Y,ue,Te,Fe,Ve=ye.align||"center";if(Te=ie,!ge)ue=Q.l+l[Ve]*Q.w,Fe=function(Ae){return d(Ae,Q.w,Q.h)};else if(W&&(ue=me,Te=ie+Y/2,Fe=function(Ae){return y(Ae,.9*le)}),ae){var Xe=i.bulletPadding,We=1-i.bulletNumberDomainSize+Xe;ue=Q.l+(We+(1-We)*l[Ve])*Q.w,Fe=function(Ae){return d(Ae,(i.bulletNumberDomainSize-Xe)*Q.w,Q.h)}}_(N,pe,J,{numbersX:ue,numbersY:Te,numbersScaler:Fe,transitionOpts:B,onComplete:q});var it,yt;ge&&(it={range:ye.gauge.axis.range,color:ye.gauge.bgcolor,line:{color:ye.gauge.bordercolor,width:0},thickness:1},yt={range:ye.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:ye.gauge.bordercolor,width:ye.gauge.borderwidth},thickness:1});var bt=pe.selectAll("g.angular").data(W?J:[]);bt.exit().remove();var mt=pe.selectAll("g.angularaxis").data(W?J:[]);mt.exit().remove(),W&&E(N,pe,J,{radius:Y,innerRadius:le,gauge:bt,layer:mt,size:Q,gaugeBg:it,gaugeOutline:yt,transitionOpts:B,onComplete:q});var ht=pe.selectAll("g.bullet").data(ae?J:[]);ht.exit().remove();var qe=pe.selectAll("g.bulletaxis").data(ae?J:[]);qe.exit().remove(),ae&&A(N,pe,J,{gauge:ht,layer:qe,size:Q,gaugeBg:it,gaugeOutline:yt,transitionOpts:B,onComplete:q});var ze=pe.selectAll("text.title").data(J);ze.exit().remove(),ze.enter().append("text").classed("title",!0),ze.attr("text-anchor",function(){return ae?T.right:T[ye.title.align]}).text(ye.title.text).call(n.font,ye.title.font).call(a.convertToTspans,N),ze.attr("transform",function(){var Ae=Q.l+Q.w*l[ye.title.align],Ke,_t=i.titlePadding,wt=n.bBox(ze.node());if(ge){if(W)if(ye.gauge.axis.visible){var vt=n.bBox(mt.node());Ke=vt.top-_t-wt.bottom}else Ke=Q.t+Q.h/2-Y/2-wt.bottom-_t;ae&&(Ke=Te-(wt.top+wt.bottom)/2,Ae=Q.l-i.bulletPadding*Q.w)}else Ke=ye._numbersTop-_t-wt.bottom;return t(Ae,Ke)})})};function A(z,N,U,B){var D=U[0].trace,j=B.gauge,q=B.layer,J=B.gaugeBg,oe=B.gaugeOutline,ye=B.size,pe=D.domain,ge=B.transitionOpts,W=B.onComplete,ae,se,Q,me,ie;j.enter().append("g").classed("bullet",!0),j.attr("transform",t(ye.l,ye.t)),q.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),q.selectAll("g.xbulletaxistick,path,text").remove();var Y=ye.h,le=D.gauge.bar.thickness*Y,ue=pe.x[0],Te=pe.x[0]+(pe.x[1]-pe.x[0])*(D._hasNumber||D._hasDelta?1-i.bulletNumberDomainSize:1);ae=u(z,D.gauge.axis),ae._id="xbulletaxis",ae.domain=[ue,Te],ae.setScale(),se=s.calcTicks(ae),Q=s.makeTransTickFn(ae),me=s.getTickSigns(ae)[2],ie=ye.t+ye.h,ae.visible&&(s.drawTicks(z,ae,{vals:ae.ticks==="inside"?s.clipEnds(ae,se):se,layer:q,path:s.makeTickPath(ae,ie,me),transFn:Q}),s.drawLabels(z,ae,{vals:se,layer:q,transFn:Q,labelFns:s.makeLabelFns(ae,ie)}));function Fe(mt){mt.attr("width",function(ht){return Math.max(0,ae.c2p(ht.range[1])-ae.c2p(ht.range[0]))}).attr("x",function(ht){return ae.c2p(ht.range[0])}).attr("y",function(ht){return .5*(1-ht.thickness)*Y}).attr("height",function(ht){return ht.thickness*Y})}var Ve=[J].concat(D.gauge.steps),Xe=j.selectAll("g.bg-bullet").data(Ve);Xe.enter().append("g").classed("bg-bullet",!0).append("rect"),Xe.select("rect").call(Fe).call(w),Xe.exit().remove();var We=j.selectAll("g.value-bullet").data([D.gauge.bar]);We.enter().append("g").classed("value-bullet",!0).append("rect"),We.select("rect").attr("height",le).attr("y",(Y-le)/2).call(w),b(ge)?We.select("rect").transition().duration(ge.duration).ease(ge.easing).each("end",function(){W&&W()}).each("interrupt",function(){W&&W()}).attr("width",Math.max(0,ae.c2p(Math.min(D.gauge.axis.range[1],U[0].y)))):We.select("rect").attr("width",typeof U[0].y=="number"?Math.max(0,ae.c2p(Math.min(D.gauge.axis.range[1],U[0].y))):0),We.exit().remove();var it=U.filter(function(){return D.gauge.threshold.value||D.gauge.threshold.value===0}),yt=j.selectAll("g.threshold-bullet").data(it);yt.enter().append("g").classed("threshold-bullet",!0).append("line"),yt.select("line").attr("x1",ae.c2p(D.gauge.threshold.value)).attr("x2",ae.c2p(D.gauge.threshold.value)).attr("y1",(1-D.gauge.threshold.thickness)/2*Y).attr("y2",(1-(1-D.gauge.threshold.thickness)/2)*Y).call(p.stroke,D.gauge.threshold.line.color).style("stroke-width",D.gauge.threshold.line.width),yt.exit().remove();var bt=j.selectAll("g.gauge-outline").data([oe]);bt.enter().append("g").classed("gauge-outline",!0).append("rect"),bt.select("rect").call(Fe).call(w),bt.exit().remove()}function E(z,N,U,B){var D=U[0].trace,j=B.size,q=B.radius,J=B.innerRadius,oe=B.gaugeBg,ye=B.gaugeOutline,pe=[j.l+j.w/2,j.t+j.h/2+q/2],ge=B.gauge,W=B.layer,ae=B.transitionOpts,se=B.onComplete,Q=Math.PI/2;function me($t){var Yt=D.gauge.axis.range[0],lr=D.gauge.axis.range[1],dr=($t-Yt)/(lr-Yt)*Math.PI-Q;return dr<-Q?-Q:dr>Q?Q:dr}function ie($t){return h.svg.arc().innerRadius((J+q)/2-$t/2*(q-J)).outerRadius((J+q)/2+$t/2*(q-J)).startAngle(-Q)}function Y($t){$t.attr("d",function(Yt){return ie(Yt.thickness).startAngle(me(Yt.range[0])).endAngle(me(Yt.range[1]))()})}var le,ue,Te,Fe;ge.enter().append("g").classed("angular",!0),ge.attr("transform",t(pe[0],pe[1])),W.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),W.selectAll("g.xangularaxistick,path,text").remove(),le=u(z,D.gauge.axis),le.type="linear",le.range=D.gauge.axis.range,le._id="xangularaxis",le.ticklabeloverflow="allow",le.setScale();var Ve=function($t){return(le.range[0]-$t.x)/(le.range[1]-le.range[0])*Math.PI+Math.PI},Xe={},We=s.makeLabelFns(le,0),it=We.labelStandoff;Xe.xFn=function($t){var Yt=Ve($t);return Math.cos(Yt)*it},Xe.yFn=function($t){var Yt=Ve($t),lr=Math.sin(Yt)>0?.2:1;return-Math.sin(Yt)*(it+$t.fontSize*lr)+Math.abs(Math.cos(Yt))*($t.fontSize*o)},Xe.anchorFn=function($t){var Yt=Ve($t),lr=Math.cos(Yt);return Math.abs(lr)<.1?"middle":lr>0?"start":"end"},Xe.heightFn=function($t,Yt,lr){var dr=Ve($t);return-.5*(1+Math.sin(dr))*lr};var yt=function($t){return t(pe[0]+q*Math.cos($t),pe[1]-q*Math.sin($t))};Te=function($t){return yt(Ve($t))};var bt=function($t){var Yt=Ve($t);return yt(Yt)+"rotate("+-r(Yt)+")"};if(ue=s.calcTicks(le),Fe=s.getTickSigns(le)[2],le.visible){Fe=le.ticks==="inside"?-1:1;var mt=(le.linewidth||1)/2;s.drawTicks(z,le,{vals:ue,layer:W,path:"M"+Fe*mt+",0h"+Fe*le.ticklen,transFn:bt}),s.drawLabels(z,le,{vals:ue,layer:W,transFn:Te,labelFns:Xe})}var ht=[oe].concat(D.gauge.steps),qe=ge.selectAll("g.bg-arc").data(ht);qe.enter().append("g").classed("bg-arc",!0).append("path"),qe.select("path").call(Y).call(w),qe.exit().remove();var ze=ie(D.gauge.bar.thickness),Ae=ge.selectAll("g.value-arc").data([D.gauge.bar]);Ae.enter().append("g").classed("value-arc",!0).append("path");var Ke=Ae.select("path");b(ae)?(Ke.transition().duration(ae.duration).ease(ae.easing).each("end",function(){se&&se()}).each("interrupt",function(){se&&se()}).attrTween("d",m(ze,me(U[0].lastY),me(U[0].y))),D._lastValue=U[0].y):Ke.attr("d",typeof U[0].y=="number"?ze.endAngle(me(U[0].y)):"M0,0Z"),Ke.call(w),Ae.exit().remove(),ht=[];var _t=D.gauge.threshold.value;(_t||_t===0)&&ht.push({range:[_t,_t],color:D.gauge.threshold.color,line:{color:D.gauge.threshold.line.color,width:D.gauge.threshold.line.width},thickness:D.gauge.threshold.thickness});var wt=ge.selectAll("g.threshold-arc").data(ht);wt.enter().append("g").classed("threshold-arc",!0).append("path"),wt.select("path").call(Y).call(w),wt.exit().remove();var vt=ge.selectAll("g.gauge-outline").data([ye]);vt.enter().append("g").classed("gauge-outline",!0).append("path"),vt.select("path").call(Y).call(w),vt.exit().remove()}function _(z,N,U,B){var D=U[0].trace,j=B.numbersX,q=B.numbersY,J=D.align||"center",oe=T[J],ye=B.transitionOpts,pe=B.onComplete,ge=k.ensureSingle(N,"g","numbers"),W,ae,se,Q=[];D._hasNumber&&Q.push("number"),D._hasDelta&&(Q.push("delta"),D.delta.position==="left"&&Q.reverse());var me=ge.selectAll("text").data(Q);me.enter().append("text"),me.attr("text-anchor",function(){return oe}).attr("class",function(yt){return yt}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),me.exit().remove();function ie(yt,bt,mt,ht){if(yt.match("s")&&mt>=0!=ht>=0&&!bt(mt).slice(-1).match(g)&&!bt(ht).slice(-1).match(g)){var qe=yt.slice().replace("s","f").replace(/\d+/,function(Ae){return parseInt(Ae)-1}),ze=u(z,{tickformat:qe});return function(Ae){return Math.abs(Ae)<1?s.tickText(ze,Ae).text:bt(Ae)}}else return bt}function Y(){var yt=u(z,{tickformat:D.number.valueformat},D._range);yt.setScale(),s.prepTicks(yt);var bt=function(Ae){return s.tickText(yt,Ae).text},mt=D.number.suffix,ht=D.number.prefix,qe=ge.select("text.number");function ze(){var Ae=typeof U[0].y=="number"?ht+bt(U[0].y)+mt:"-";qe.text(Ae).call(n.font,D.number.font).call(a.convertToTspans,z)}return b(ye)?qe.transition().duration(ye.duration).ease(ye.easing).each("end",function(){ze(),pe&&pe()}).each("interrupt",function(){ze(),pe&&pe()}).attrTween("text",function(){var Ae=h.select(this),Ke=S(U[0].lastY,U[0].y);D._lastValue=U[0].y;var _t=ie(D.number.valueformat,bt,U[0].lastY,U[0].y);return function(wt){Ae.text(ht+_t(Ke(wt))+mt)}}):ze(),W=R(ht+bt(U[0].y)+mt,D.number.font,oe,z),qe}function le(){var yt=u(z,{tickformat:D.delta.valueformat},D._range);yt.setScale(),s.prepTicks(yt);var bt=function(wt){return s.tickText(yt,wt).text},mt=D.delta.suffix,ht=D.delta.prefix,qe=function(wt){var vt=D.delta.relative?wt.relativeDelta:wt.delta;return vt},ze=function(wt,vt){return wt===0||typeof wt!="number"||isNaN(wt)?"-":(wt>0?D.delta.increasing.symbol:D.delta.decreasing.symbol)+ht+vt(wt)+mt},Ae=function(wt){return wt.delta>=0?D.delta.increasing.color:D.delta.decreasing.color};D._deltaLastValue===void 0&&(D._deltaLastValue=qe(U[0]));var Ke=ge.select("text.delta");Ke.call(n.font,D.delta.font).call(p.fill,Ae({delta:D._deltaLastValue}));function _t(){Ke.text(ze(qe(U[0]),bt)).call(p.fill,Ae(U[0])).call(a.convertToTspans,z)}return b(ye)?Ke.transition().duration(ye.duration).ease(ye.easing).tween("text",function(){var wt=h.select(this),vt=qe(U[0]),$t=D._deltaLastValue,Yt=ie(D.delta.valueformat,bt,$t,vt),lr=S($t,vt);return D._deltaLastValue=vt,function(dr){wt.text(ze(lr(dr),Yt)),wt.call(p.fill,Ae({delta:lr(dr)}))}}).each("end",function(){_t(),pe&&pe()}).each("interrupt",function(){_t(),pe&&pe()}):_t(),ae=R(ze(qe(U[0]),bt),D.delta.font,oe,z),Ke}var ue=D.mode+D.align,Te;if(D._hasDelta&&(Te=le(),ue+=D.delta.position+D.delta.font.size+D.delta.font.family+D.delta.valueformat,ue+=D.delta.increasing.symbol+D.delta.decreasing.symbol,se=ae),D._hasNumber&&(Y(),ue+=D.number.font.size+D.number.font.family+D.number.valueformat+D.number.suffix+D.number.prefix,se=W),D._hasDelta&&D._hasNumber){var Fe=[(W.left+W.right)/2,(W.top+W.bottom)/2],Ve=[(ae.left+ae.right)/2,(ae.top+ae.bottom)/2],Xe,We,it=.75*D.delta.font.size;D.delta.position==="left"&&(Xe=L(D,"deltaPos",0,-1*(W.width*l[D.align]+ae.width*(1-l[D.align])+it),ue,Math.min),We=Fe[1]-Ve[1],se={width:W.width+ae.width+it,height:Math.max(W.height,ae.height),left:ae.left+Xe,right:W.right,top:Math.min(W.top,ae.top+We),bottom:Math.max(W.bottom,ae.bottom+We)}),D.delta.position==="right"&&(Xe=L(D,"deltaPos",0,W.width*(1-l[D.align])+ae.width*l[D.align]+it,ue,Math.max),We=Fe[1]-Ve[1],se={width:W.width+ae.width+it,height:Math.max(W.height,ae.height),left:W.left,right:ae.right+Xe,top:Math.min(W.top,ae.top+We),bottom:Math.max(W.bottom,ae.bottom+We)}),D.delta.position==="bottom"&&(Xe=null,We=ae.height,se={width:Math.max(W.width,ae.width),height:W.height+ae.height,left:Math.min(W.left,ae.left),right:Math.max(W.right,ae.right),top:W.bottom-W.height,bottom:W.bottom+ae.height}),D.delta.position==="top"&&(Xe=null,We=W.top,se={width:Math.max(W.width,ae.width),height:W.height+ae.height,left:Math.min(W.left,ae.left),right:Math.max(W.right,ae.right),top:W.bottom-W.height-ae.height,bottom:W.bottom}),Te.attr({dx:Xe,dy:We})}(D._hasNumber||D._hasDelta)&&ge.attr("transform",function(){var yt=B.numbersScaler(se);ue+=yt[2];var bt=L(D,"numbersScale",1,yt[0],ue,Math.min),mt;D._scaleNumbers||(bt=1),D._isAngular?mt=q-bt*se.bottom:mt=q-bt*(se.top+se.bottom)/2,D._numbersTop=bt*se.top+mt;var ht=se[J];J==="center"&&(ht=(se.left+se.right)/2);var qe=j-bt*ht;return qe=L(D,"numbersTranslate",0,qe,ue,Math.max),t(qe,mt)+e(bt)})}function w(z){z.each(function(N){p.stroke(h.select(this),N.line.color)}).each(function(N){p.fill(h.select(this),N.color)}).style("stroke-width",function(N){return N.line.width})}function m(z,N,U){return function(){var B=x(N,U);return function(D){return z.endAngle(B(D))()}}}function u(z,N,U){var B=z._fullLayout,D=k.extendFlat({type:"linear",ticks:"outside",range:U,showline:!0},N),j={type:"linear",_id:"x"+N._id},q={letter:"x",font:B.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function J(oe,ye){return k.coerce(D,j,v,oe,ye)}return f(D,j,J,q,B),c(D,j,J,q),j}function d(z,N,U){var B=Math.min(N/z.width,U/z.height);return[B,z,N+"x"+U]}function y(z,N){var U=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),B=N/U;return[B,z,N]}function R(z,N,U,B){var D=document.createElementNS("http://www.w3.org/2000/svg","text"),j=h.select(D);return j.text(z).attr("x",0).attr("y",0).attr("text-anchor",U).attr("data-unformatted",z).call(a.convertToTspans,B).call(n.font,N),n.bBox(j.node())}function L(z,N,U,B,D,j){var q="_cache"+N;z[q]&&z[q].key===D||(z[q]={key:D,value:U});var J=k.aggNums(j,null,[z[q].value,B],2);return z[q].value=J,J}}}),u4=_e({"src/traces/indicator/index.js"(ee,X){X.exports={moduleType:"trace",name:"indicator",basePlotModule:i4(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:KA(),supplyDefaults:o4().supplyDefaults,calc:s4().calc,plot:l4(),meta:{}}}}),c4=_e({"lib/indicator.js"(ee,X){X.exports=u4()}}),QA=_e({"src/traces/table/attributes.js"(ee,X){var h=im(),x=po().extendFlat,S=nc().overrideAll,k=es(),e=hf().attributes,t=ff().descriptionOnlyNumbers;X.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:x({},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:x({},k({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:x({},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:x({},k({arrayOk:!0}))}},"calc","from-root")}}),f4=_e({"src/traces/table/defaults.js"(ee,X){var h=kn(),x=QA(),S=hf().defaults;function k(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"}}}}),d4=_e({"src/traces/table/data_preparation_helper.js"(ee,X){var h=eS(),x=po().extendFlat,S=jn(),k=lo().isTypedArray,e=lo().isArrayOrTypedArray;X.exports=function(v,p){var T=o(p.cells.values),l=function(oe){return oe.slice(p.header.values.length,oe.length)},g=o(p.header.values);g.length&&!g[0].length&&(g[0]=[""],g=o(g));var b=g.concat(l(T).map(function(){return n((g[0]||[""]).length)})),A=p.domain,E=Math.floor(v._fullLayout._size.w*(A.x[1]-A.x[0])),_=Math.floor(v._fullLayout._size.h*(A.y[1]-A.y[0])),w=p.header.values.length?b[0].map(function(){return p.header.height}):[h.emptyHeaderHeight],m=T.length?T[0].map(function(){return p.cells.height}):[],u=w.reduce(r,0),d=_-u,y=d+h.uplift,R=s(m,y),L=s(w,u),z=a(L,[]),N=a(R,z),U={},B=p._fullInput.columnorder;e(B)&&(B=Array.from(B)),B=B.concat(l(T.map(function(oe,ye){return ye})));var D=b.map(function(oe,ye){var pe=e(p.columnwidth)?p.columnwidth[Math.min(ye,p.columnwidth.length-1)]:p.columnwidth;return S(pe)?Number(pe):1}),j=D.reduce(r,0);D=D.map(function(oe){return oe/j*E});var q=Math.max(t(p.header.line.width),t(p.cells.line.width)),J={key:p.uid+v._context.staticPlot,translateX:A.x[0]*v._fullLayout._size.w,translateY:v._fullLayout._size.h*(1-A.y[1]),size:v._fullLayout._size,width:E,maxLineWidth:q,height:_,columnOrder:B,groupHeight:_,rowBlocks:N,headerRowBlocks:z,scrollY:0,cells:x({},p.cells,{values:T}),headerCells:x({},p.header,{values:b}),gdColumns:b.map(function(oe){return oe[0]}),gdColumnsOriginalOrder:b.map(function(oe){return oe[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:b.map(function(oe,ye){var pe=U[oe];U[oe]=(pe||0)+1;var ge=oe+"__"+U[oe];return{key:ge,label:oe,specIndex:ye,xIndex:B[ye],xScale:i,x:void 0,calcdata:void 0,columnWidth:D[ye]}})};return J.columns.forEach(function(oe){oe.calcdata=J,oe.x=i(oe)}),J};function t(c){if(e(c)){for(var v=0,p=0;p=v||_===c.length-1)&&(p[l]=b,b.key=E++,b.firstRowIndex=A,b.lastRowIndex=_,b=f(),l+=g,A=_+1,g=0);return p}function f(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),p4=_e({"src/traces/table/data_split_helpers.js"(ee){var X=po().extendFlat;ee.splitToPanels=function(x){var S=[0,0],k=X({},x,{key:"header",type:"header",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!0,values:x.calcdata.headerCells.values[x.specIndex],rowBlocks:x.calcdata.headerRowBlocks,calcdata:X({},x.calcdata,{cells:x.calcdata.headerCells})}),e=X({},x,{key:"cells1",type:"cells",page:0,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks}),t=X({},x,{key:"cells2",type:"cells",page:1,prevPages:S,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks});return[e,t,k]},ee.splitToCells=function(x){var S=h(x);return(x.values||[]).slice(S[0],S[1]).map(function(k,e){var t=typeof k=="string"&&k.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:S[0]+e,column:x,calcdata:x.calcdata,page:x.page,rowBlocks:x.rowBlocks,value:k}})};function h(x){var S=x.rowBlocks[x.page],k=S?S.rows[0].rowIndex:0,e=S?k+S.rows.length:0;return[k,e]}}}),tS=_e({"src/traces/table/plot.js"(ee,X){var h=eS(),x=mr(),S=kn(),k=S.numberFormat,e=hv(),t=ri(),r=Au(),o=kn().raiseToTop,n=kn().strTranslate,i=kn().cancelTransition,a=d4(),s=p4(),f=so();X.exports=function(ue,Te){var Fe=!ue._context.staticPlot,Ve=ue._fullLayout._paper.selectAll("."+h.cn.table).data(Te.map(function(vt){var $t=e.unwrap(vt),Yt=$t.trace;return a(ue,Yt)}),e.keyFun);Ve.exit().remove(),Ve.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"),Ve.attr("width",function(vt){return vt.width+vt.size.l+vt.size.r}).attr("height",function(vt){return vt.height+vt.size.t+vt.size.b}).attr("transform",function(vt){return n(vt.translateX,vt.translateY)});var Xe=Ve.selectAll("."+h.cn.tableControlView).data(e.repeat,e.keyFun),We=Xe.enter().append("g").classed(h.cn.tableControlView,!0).style("box-sizing","content-box");if(Fe){var it="onwheel"in document?"wheel":"mousewheel";We.on("mousemove",function(vt){Xe.filter(function($t){return vt===$t}).call(l,ue)}).on(it,function(vt){if(!vt.scrollbarState.wheeling){vt.scrollbarState.wheeling=!0;var $t=vt.scrollY+x.event.deltaY,Yt=oe(ue,Xe,null,$t)(vt);Yt||(x.event.stopPropagation(),x.event.preventDefault()),vt.scrollbarState.wheeling=!1}}).call(l,ue,!0)}Xe.attr("transform",function(vt){return n(vt.size.l,vt.size.t)});var yt=Xe.selectAll("."+h.cn.scrollBackground).data(e.repeat,e.keyFun);yt.enter().append("rect").classed(h.cn.scrollBackground,!0).attr("fill","none"),yt.attr("width",function(vt){return vt.width}).attr("height",function(vt){return vt.height}),Xe.each(function(vt){t.setClipUrl(x.select(this),v(ue,vt),ue)});var bt=Xe.selectAll("."+h.cn.yColumn).data(function(vt){return vt.columns},e.keyFun);bt.enter().append("g").classed(h.cn.yColumn,!0),bt.exit().remove(),bt.attr("transform",function(vt){return n(vt.x,0)}),Fe&&bt.call(x.behavior.drag().origin(function(vt){var $t=x.select(this);return U($t,vt,-h.uplift),o(this),vt.calcdata.columnDragInProgress=!0,l(Xe.filter(function(Yt){return vt.calcdata.key===Yt.key}),ue),vt}).on("drag",function(vt){var $t=x.select(this),Yt=function(Nr){return(vt===Nr?x.event.x:Nr.x)+Nr.columnWidth/2};vt.x=Math.max(-h.overdrag,Math.min(vt.calcdata.width+h.overdrag-vt.columnWidth,x.event.x));var lr=T(bt).filter(function(Nr){return Nr.calcdata.key===vt.calcdata.key}),dr=lr.sort(function(Nr,Fr){return Yt(Nr)-Yt(Fr)});dr.forEach(function(Nr,Fr){Nr.xIndex=Fr,Nr.x=vt===Nr?Nr.x:Nr.xScale(Nr)}),bt.filter(function(Nr){return vt!==Nr}).transition().ease(h.transitionEase).duration(h.transitionDuration).attr("transform",function(Nr){return n(Nr.x,0)}),$t.call(i).attr("transform",n(vt.x,-h.uplift))}).on("dragend",function(vt){var $t=x.select(this),Yt=vt.calcdata;vt.x=vt.xScale(vt),vt.calcdata.columnDragInProgress=!1,U($t,vt,0),z(ue,Yt,Yt.columns.map(function(lr){return lr.xIndex}))})),bt.each(function(vt){t.setClipUrl(x.select(this),p(ue,vt),ue)});var mt=bt.selectAll("."+h.cn.columnBlock).data(s.splitToPanels,e.keyFun);mt.enter().append("g").classed(h.cn.columnBlock,!0).attr("id",function(vt){return vt.key}),mt.style("cursor",function(vt){return vt.dragHandle?"ew-resize":vt.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var ht=mt.filter(D),qe=mt.filter(B);Fe&&qe.call(x.behavior.drag().origin(function(vt){return x.event.stopPropagation(),vt}).on("drag",oe(ue,Xe,-1)).on("dragend",function(){})),g(ue,Xe,ht,mt),g(ue,Xe,qe,mt);var ze=Xe.selectAll("."+h.cn.scrollAreaClip).data(e.repeat,e.keyFun);ze.enter().append("clipPath").classed(h.cn.scrollAreaClip,!0).attr("id",function(vt){return v(ue,vt)});var Ae=ze.selectAll("."+h.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);Ae.enter().append("rect").classed(h.cn.scrollAreaClipRect,!0).attr("x",-h.overdrag).attr("y",-h.uplift).attr("fill","none"),Ae.attr("width",function(vt){return vt.width+2*h.overdrag}).attr("height",function(vt){return vt.height+h.uplift});var Ke=bt.selectAll("."+h.cn.columnBoundary).data(e.repeat,e.keyFun);Ke.enter().append("g").classed(h.cn.columnBoundary,!0);var _t=bt.selectAll("."+h.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);_t.enter().append("clipPath").classed(h.cn.columnBoundaryClippath,!0),_t.attr("id",function(vt){return p(ue,vt)});var wt=_t.selectAll("."+h.cn.columnBoundaryRect).data(e.repeat,e.keyFun);wt.enter().append("rect").classed(h.cn.columnBoundaryRect,!0).attr("fill","none"),wt.attr("width",function(vt){return vt.columnWidth+2*c(vt)}).attr("height",function(vt){return vt.calcdata.height+2*c(vt)+h.uplift}).attr("x",function(vt){return-c(vt)}).attr("y",function(vt){return-c(vt)}),J(null,qe,Xe)};function c(le){return Math.ceil(le.calcdata.maxLineWidth/2)}function v(le,ue){return"clip"+le._fullLayout._uid+"_scrollAreaBottomClip_"+ue.key}function p(le,ue){return"clip"+le._fullLayout._uid+"_columnBoundaryClippath_"+ue.calcdata.key+"_"+ue.specIndex}function T(le){return[].concat.apply([],le.map(function(ue){return ue})).map(function(ue){return ue.__data__})}function l(le,ue,Te){function Fe(bt){var mt=bt.rowBlocks;return se(mt,mt.length-1)+(mt.length?Q(mt[mt.length-1],1/0):1)}var Ve=le.selectAll("."+h.cn.scrollbarKit).data(e.repeat,e.keyFun);Ve.enter().append("g").classed(h.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Ve.each(function(bt){var mt=bt.scrollbarState;mt.totalHeight=Fe(bt),mt.scrollableAreaHeight=bt.groupHeight-j(bt),mt.currentlyVisibleHeight=Math.min(mt.totalHeight,mt.scrollableAreaHeight),mt.ratio=mt.currentlyVisibleHeight/mt.totalHeight,mt.barLength=Math.max(mt.ratio*mt.currentlyVisibleHeight,h.goldenRatio*h.scrollbarWidth),mt.barWiggleRoom=mt.currentlyVisibleHeight-mt.barLength,mt.wiggleRoom=Math.max(0,mt.totalHeight-mt.scrollableAreaHeight),mt.topY=mt.barWiggleRoom===0?0:bt.scrollY/mt.wiggleRoom*mt.barWiggleRoom,mt.bottomY=mt.topY+mt.barLength,mt.dragMultiplier=mt.wiggleRoom/mt.barWiggleRoom}).attr("transform",function(bt){var mt=bt.width+h.scrollbarWidth/2+h.scrollbarOffset;return n(mt,j(bt))});var Xe=Ve.selectAll("."+h.cn.scrollbar).data(e.repeat,e.keyFun);Xe.enter().append("g").classed(h.cn.scrollbar,!0);var We=Xe.selectAll("."+h.cn.scrollbarSlider).data(e.repeat,e.keyFun);We.enter().append("g").classed(h.cn.scrollbarSlider,!0),We.attr("transform",function(bt){return n(0,bt.scrollbarState.topY||0)});var it=We.selectAll("."+h.cn.scrollbarGlyph).data(e.repeat,e.keyFun);it.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),it.attr("y2",function(bt){return bt.scrollbarState.barLength-h.scrollbarWidth/2}).attr("stroke-opacity",function(bt){return bt.columnDragInProgress||!bt.scrollbarState.barWiggleRoom||Te?0:.4}),it.transition().delay(0).duration(0),it.transition().delay(h.scrollbarHideDelay).duration(h.scrollbarHideDuration).attr("stroke-opacity",0);var yt=Xe.selectAll("."+h.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);yt.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(bt){var mt=x.event.y,ht=this.getBoundingClientRect(),qe=bt.scrollbarState,ze=mt-ht.top,Ae=x.scale.linear().domain([0,qe.scrollableAreaHeight]).range([0,qe.totalHeight]).clamp(!0);qe.topY<=ze&&ze<=qe.bottomY||oe(ue,le,null,Ae(ze-qe.barLength/2))(bt)}).call(x.behavior.drag().origin(function(bt){return x.event.stopPropagation(),bt.scrollbarState.scrollbarScrollInProgress=!0,bt}).on("drag",oe(ue,le)).on("dragend",function(){})),yt.attr("y2",function(bt){return bt.scrollbarState.scrollableAreaHeight}),ue._context.staticPlot&&(it.remove(),yt.remove())}function g(le,ue,Te,Fe){var Ve=b(Te),Xe=A(Ve);m(Xe);var We=E(Xe);d(We);var it=w(Xe),yt=_(it);u(yt),y(yt,ue,Fe,le),ae(Xe)}function b(le){var ue=le.selectAll("."+h.cn.columnCells).data(e.repeat,e.keyFun);return ue.enter().append("g").classed(h.cn.columnCells,!0),ue.exit().remove(),ue}function A(le){var ue=le.selectAll("."+h.cn.columnCell).data(s.splitToCells,function(Te){return Te.keyWithinBlock});return ue.enter().append("g").classed(h.cn.columnCell,!0),ue.exit().remove(),ue}function E(le){var ue=le.selectAll("."+h.cn.cellRect).data(e.repeat,function(Te){return Te.keyWithinBlock});return ue.enter().append("rect").classed(h.cn.cellRect,!0),ue}function _(le){var ue=le.selectAll("."+h.cn.cellText).data(e.repeat,function(Te){return Te.keyWithinBlock});return ue.enter().append("text").classed(h.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){x.event.stopPropagation()}),ue}function w(le){var ue=le.selectAll("."+h.cn.cellTextHolder).data(e.repeat,function(Te){return Te.keyWithinBlock});return ue.enter().append("g").classed(h.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),ue}function m(le){le.each(function(ue,Te){var Fe=ue.calcdata.cells.font,Ve=ue.column.specIndex,Xe={size:N(Fe.size,Ve,Te),color:N(Fe.color,Ve,Te),family:N(Fe.family,Ve,Te),weight:N(Fe.weight,Ve,Te),style:N(Fe.style,Ve,Te),variant:N(Fe.variant,Ve,Te),textcase:N(Fe.textcase,Ve,Te),lineposition:N(Fe.lineposition,Ve,Te),shadow:N(Fe.shadow,Ve,Te)};ue.rowNumber=ue.key,ue.align=N(ue.calcdata.cells.align,Ve,Te),ue.cellBorderWidth=N(ue.calcdata.cells.line.width,Ve,Te),ue.font=Xe})}function u(le){le.each(function(ue){t.font(x.select(this),ue.font)})}function d(le){le.attr("width",function(ue){return ue.column.columnWidth}).attr("stroke-width",function(ue){return ue.cellBorderWidth}).each(function(ue){var Te=x.select(this);f.stroke(Te,N(ue.calcdata.cells.line.color,ue.column.specIndex,ue.rowNumber)),f.fill(Te,N(ue.calcdata.cells.fill.color,ue.column.specIndex,ue.rowNumber))})}function y(le,ue,Te,Fe){le.text(function(Ve){var Xe=Ve.column.specIndex,We=Ve.rowNumber,it=Ve.value,yt=typeof it=="string",bt=yt&&it.match(/
/i),mt=!yt||bt;Ve.mayHaveMarkup=yt&&it.match(/[<&>]/);var ht=R(it);Ve.latex=ht;var qe=ht?"":N(Ve.calcdata.cells.prefix,Xe,We)||"",ze=ht?"":N(Ve.calcdata.cells.suffix,Xe,We)||"",Ae=ht?null:N(Ve.calcdata.cells.format,Xe,We)||null,Ke=qe+(Ae?k(Ae)(Ve.value):Ve.value)+ze,_t;Ve.wrappingNeeded=!Ve.wrapped&&!mt&&!ht&&(_t=L(Ke)),Ve.cellHeightMayIncrease=bt||ht||Ve.mayHaveMarkup||(_t===void 0?L(Ke):_t),Ve.needsConvertToTspans=Ve.mayHaveMarkup||Ve.wrappingNeeded||Ve.latex;var wt;if(Ve.wrappingNeeded){var vt=h.wrapSplitCharacter===" "?Ke.replace(/Ve&&Fe.push(Xe),Ve+=yt}return Fe}function J(le,ue,Te){var Fe=T(ue)[0];if(Fe!==void 0){var Ve=Fe.rowBlocks,Xe=Fe.calcdata,We=se(Ve,Ve.length),it=Fe.calcdata.groupHeight-j(Fe),yt=Xe.scrollY=Math.max(0,Math.min(We-it,Xe.scrollY)),bt=q(Ve,yt,it);bt.length===1&&(bt[0]===Ve.length-1?bt.unshift(bt[0]-1):bt.push(bt[0]+1)),bt[0]%2&&bt.reverse(),ue.each(function(mt,ht){mt.page=bt[ht],mt.scrollY=yt}),ue.attr("transform",function(mt){var ht=se(mt.rowBlocks,mt.page)-mt.scrollY;return n(0,ht)}),le&&(ye(le,Te,ue,bt,Fe.prevPages,Fe,0),ye(le,Te,ue,bt,Fe.prevPages,Fe,1),l(Te,le))}}function oe(le,ue,Te,Fe){return function(Xe){var We=Xe.calcdata?Xe.calcdata:Xe,it=ue.filter(function(ht){return We.key===ht.key}),yt=Te||We.scrollbarState.dragMultiplier,bt=We.scrollY;We.scrollY=Fe===void 0?We.scrollY+yt*x.event.dy:Fe;var mt=it.selectAll("."+h.cn.yColumn).selectAll("."+h.cn.columnBlock).filter(B);return J(le,mt,it),We.scrollY===bt}}function ye(le,ue,Te,Fe,Ve,Xe,We){var it=Fe[We]!==Ve[We];it&&(clearTimeout(Xe.currentRepaint[We]),Xe.currentRepaint[We]=setTimeout(function(){var yt=Te.filter(function(bt,mt){return mt===We&&Fe[mt]!==Ve[mt]});g(le,ue,yt,Te),Ve[We]=Fe[We]}))}function pe(le,ue,Te,Fe){return function(){var Xe=x.select(ue.parentNode);Xe.each(function(We){var it=We.fragments;Xe.selectAll("tspan.line").each(function(Ke,_t){it[_t].width=this.getComputedTextLength()});var yt=it[it.length-1].width,bt=it.slice(0,-1),mt=[],ht,qe,ze=0,Ae=We.column.columnWidth-2*h.cellPad;for(We.value="";bt.length;)ht=bt.shift(),qe=ht.width+yt,ze+qe>Ae&&(We.value+=mt.join(h.wrapSpacer)+h.lineBreaker,mt=[],ze=0),mt.push(ht.text),ze+=qe;ze&&(We.value+=mt.join(h.wrapSpacer)),We.wrapped=!0}),Xe.selectAll("tspan.line").remove(),y(Xe.select("."+h.cn.cellText),Te,le,Fe),x.select(ue.parentNode.parentNode).call(ae)}}function ge(le,ue,Te,Fe,Ve){return function(){if(!Ve.settledY){var We=x.select(ue.parentNode),it=ie(Ve),yt=Ve.key-it.firstRowIndex,bt=it.rows[yt].rowHeight,mt=Ve.cellHeightMayIncrease?ue.parentNode.getBoundingClientRect().height+2*h.cellPad:bt,ht=Math.max(mt,bt),qe=ht-it.rows[yt].rowHeight;qe&&(it.rows[yt].rowHeight=ht,le.selectAll("."+h.cn.columnCell).call(ae),J(null,le.filter(B),0),l(Te,Fe,!0)),We.attr("transform",function(){var ze=this,Ae=ze.parentNode,Ke=Ae.getBoundingClientRect(),_t=x.select(ze.parentNode).select("."+h.cn.cellRect).node().getBoundingClientRect(),wt=ze.transform.baseVal.consolidate(),vt=_t.top-Ke.top+(wt?wt.matrix.f:h.cellPad);return n(W(Ve,x.select(ze.parentNode).select("."+h.cn.cellTextHolder).node().getBoundingClientRect().width),vt)}),Ve.settledY=!0}}}function W(le,ue){switch(le.align){case"left":return h.cellPad;case"right":return le.column.columnWidth-(ue||0)-h.cellPad;case"center":return(le.column.columnWidth-(ue||0))/2;default:return h.cellPad}}function ae(le){le.attr("transform",function(ue){var Te=ue.rowBlocks[0].auxiliaryBlocks.reduce(function(We,it){return We+Q(it,1/0)},0),Fe=ie(ue),Ve=Q(Fe,ue.key),Xe=Ve+Te;return n(0,Xe)}).selectAll("."+h.cn.cellRect).attr("height",function(ue){return Y(ie(ue),ue.key).rowHeight})}function se(le,ue){for(var Te=0,Fe=ue-1;Fe>=0;Fe--)Te+=me(le[Fe]);return Te}function Q(le,ue){for(var Te=0,Fe=0;Fek.length&&(S=S.slice(0,k.length)):S=[],t=0;t90&&(v-=180,i=-i),{angle:v,flip:i,p:x.c2p(e,S,k),offsetMultplier:a}}}}),A4=_e({"src/traces/carpet/plot.js"(ee,X){var h=mr(),x=ri(),S=rS(),k=nS(),e=T4(),t=Au(),r=kn(),o=r.strRotate,n=r.strTranslate,i=eh();X.exports=function(g,b,A,E){var _=g._context.staticPlot,w=b.xaxis,m=b.yaxis,u=g._fullLayout,d=u._clips;r.makeTraceGroups(E,A,"trace").each(function(y){var R=h.select(this),L=y[0],z=L.trace,N=z.aaxis,U=z.baxis,B=r.ensureSingle(R,"g","minorlayer"),D=r.ensureSingle(R,"g","majorlayer"),j=r.ensureSingle(R,"g","boundarylayer"),q=r.ensureSingle(R,"g","labellayer");R.style("opacity",z.opacity),s(w,m,D,N,"a",N._gridlines,!0),s(w,m,D,U,"b",U._gridlines,!0),s(w,m,B,N,"a",N._minorgridlines,!0),s(w,m,B,U,"b",U._minorgridlines,!0),s(w,m,j,N,"a-boundary",N._boundarylines,_),s(w,m,j,U,"b-boundary",U._boundarylines,_);var J=f(g,w,m,z,L,q,N._labels,"a-label"),oe=f(g,w,m,z,L,q,U._labels,"b-label");c(g,q,z,L,w,m,J,oe),a(z,L,d,w,m)})};function a(l,g,b,A,E){var _,w,m,u,d=b.select("#"+l._clipPathId);d.size()||(d=b.append("clipPath").classed("carpetclip",!0));var y=r.ensureSingle(d,"path","carpetboundary"),R=g.clipsegments,L=[];for(u=0;u0?"start":"end","data-notex":1}).call(x.font,R.font).text(R.text).call(t.convertToTspans,l),D=x.bBox(this);B.attr("transform",n(z.p[0],z.p[1])+o(z.angle)+n(R.axis.labelpadding*U,D.height*.3)),d=Math.max(d,D.width+R.axis.labelpadding)}),u.exit().remove(),y.maxExtent=d,y}function c(l,g,b,A,E,_,w,m){var u,d,y,R,L=r.aggNums(Math.min,null,b.a),z=r.aggNums(Math.max,null,b.a),N=r.aggNums(Math.min,null,b.b),U=r.aggNums(Math.max,null,b.b);u=.5*(L+z),d=N,y=b.ab2xy(u,d,!0),R=b.dxyda_rough(u,d),w.angle===void 0&&r.extendFlat(w,e(b,E,_,y,b.dxydb_rough(u,d))),T(l,g,b,A,y,R,b.aaxis,E,_,w,"a-title"),u=L,d=.5*(N+U),y=b.ab2xy(u,d,!0),R=b.dxydb_rough(u,d),m.angle===void 0&&r.extendFlat(m,e(b,E,_,y,b.dxyda_rough(u,d))),T(l,g,b,A,y,R,b.baxis,E,_,m,"b-title")}var v=i.LINE_SPACING,p=(1-i.MID_SHIFT)/v+1;function T(l,g,b,A,E,_,w,m,u,d,y){var R=[];w.title.text&&R.push(w.title.text);var L=g.selectAll("text."+y).data(R),z=d.maxExtent;L.enter().append("text").classed(y,!0),L.each(function(){var N=e(b,m,u,E,_);["start","both"].indexOf(w.showticklabels)===-1&&(z=0);var U=w.title.font.size;z+=U+w.title.offset;var B=d.angle+(d.flip<0?180:0),D=(B-N.angle+450)%360,j=D>90&&D<270,q=h.select(this);q.text(w.title.text).call(t.convertToTspans,l),j&&(z=(-t.lineCount(q)+p)*v*U-z),q.attr("transform",n(N.p[0],N.p[1])+o(N.angle)+n(0,z)).attr("text-anchor","middle").call(x.font,w.title.font)}),L.exit().remove()}}}),S4=_e({"src/traces/carpet/cheater_basis.js"(ee,X){var h=kn().isArrayOrTypedArray;X.exports=function(x,S,k){var e,t,r,o,n,i,a=[],s=h(x)?x.length:x,f=h(S)?S.length:S,c=h(x)?x:null,v=h(S)?S:null;c&&(r=(c.length-1)/(c[c.length-1]-c[0])/(s-1)),v&&(o=(v.length-1)/(v[v.length-1]-v[0])/(f-1));var p,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&&(Q=k.dxydi([],J-1,ye,0,pe),le.push(ge[0]+Q[0]/3),ue.push(ge[1]+Q[1]/3),me=k.dxydi([],J-1,ye,1,pe),le.push(se[0]-me[0]/3),ue.push(se[1]-me[1]/3)),le.push(se[0]),ue.push(se[1]),ge=se;else for(J=k.a2i(q),W=Math.floor(Math.max(0,Math.min(N-2,J))),ae=J-W,Te.length=N,Te.crossLength=U,Te.xy=function(Fe){return k.evalxy([],J,Fe)},Te.dxy=function(Fe,Ve){return k.dxydj([],W,Fe,ae,Ve)},oe=0;oe0&&(ie=k.dxydj([],W,oe-1,ae,0),le.push(ge[0]+ie[0]/3),ue.push(ge[1]+ie[1]/3),Y=k.dxydj([],W,oe-1,ae,1),le.push(se[0]-Y[0]/3),ue.push(se[1]-Y[1]/3)),le.push(se[0]),ue.push(se[1]),ge=se;return Te.axisLetter=e,Te.axis=E,Te.crossAxis=d,Te.value=q,Te.constvar=t,Te.index=c,Te.x=le,Te.y=ue,Te.smoothing=d.smoothing,Te}function j(q){var J,oe,ye,pe,ge,W=[],ae=[],se={};if(se.length=A.length,se.crossLength=u.length,e==="b")for(ye=Math.max(0,Math.min(U-2,q)),ge=Math.min(1,Math.max(0,q-ye)),se.xy=function(Q){return k.evalxy([],Q,q)},se.dxy=function(Q,me){return k.dxydi([],Q,ye,me,ge)},J=0;JA.length-1)&&_.push(x(j(o),{color:E.gridcolor,width:E.gridwidth,dash:E.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(x(D(p),{color:E.minorgridcolor,width:E.minorgridwidth,dash:E.minorgriddash})));E.startline&&m.push(x(j(0),{color:E.startlinecolor,width:E.startlinewidth})),E.endline&&m.push(x(j(A.length-1),{color:E.endlinecolor,width:E.endlinewidth}))}else{for(i=5e-15,a=[Math.floor((A[A.length-1]-E.tick0)/E.dtick*(1+i)),Math.ceil((A[0]-E.tick0)/E.dtick/(1+i))].sort(function(q,J){return q-J}),s=a[0],f=a[1],c=s;c<=f;c++)v=E.tick0+E.dtick*c,_.push(x(D(v),{color:E.gridcolor,width:E.gridwidth,dash:E.griddash}));for(c=s-1;cA[A.length-1])&&w.push(x(D(p),{color:E.minorgridcolor,width:E.minorgridwidth,dash:E.minorgriddash}));E.startline&&m.push(x(D(A[0]),{color:E.startlinecolor,width:E.startlinewidth})),E.endline&&m.push(x(D(A[A.length-1]),{color:E.endlinecolor,width:E.endlinewidth}))}}}}),k4=_e({"src/traces/carpet/calc_labels.js"(ee,X){var h=xs(),x=po().extendFlat;X.exports=function(k,e){var t,r,o,n,i,a=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=x[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]=x[t][0],o[f-t]=S[t][0];return n.push({x:r,y:o,bicubic:a}),n}}}),P4=_e({"src/traces/carpet/smooth_fill_2d_array.js"(ee,X){var h=kn();X.exports=function(S,k,e){var t,r,o,n=[],i=[],a=S[0].length,s=S.length;function f(oe,ye){var pe=0,ge,W=0;return oe>0&&(ge=S[ye][oe-1])!==void 0&&(W++,pe+=ge),oe0&&(ge=S[ye-1][oe])!==void 0&&(W++,pe+=ge),ye0&&r0&&tu);return h.log("Smoother converged to",d,"after",R,"iterations"),S}}}),L4=_e({"src/traces/carpet/constants.js"(ee,X){X.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),I4=_e({"src/traces/carpet/catmull_rom.js"(ee,X){var h=.5;X.exports=function(S,k,e,t){var r=S[0]-k[0],o=S[1]-k[1],n=e[0]-k[0],i=e[1]-k[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,v=s*(a+s)*3,p=a*(a+s)*3;return[[k[0]+(v&&f/v),k[1]+(v&&c/v)],[k[0]-(p&&f/p),k[1]-(p&&c/p)]]}}}),D4=_e({"src/traces/carpet/compute_control_points.js"(ee,X){var h=I4(),x=kn().ensureArray;function S(k,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+k[0])/3,(2*o+k[1])/3]}X.exports=function(e,t,r,o,n,i){var a,s,f,c,v,p,T,l,g,b,A=r[0].length,E=r.length,_=n?3*A-2:A,w=i?3*E-2:E;for(e=x(e,w),t=x(t,w),f=0;fv&&_T&&wp||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=k([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(x(_,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(x(_,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(_),d=o.b2j(w),y=o.evalxy([],u,d);if(m){var R=0,L=0,z=[],N,U,B,D;_n[a-1]?(N=a-2,U=1,R=(_-n[a-1])/(n[a-1]-n[a-2])):(N=Math.max(0,Math.min(a-2,Math.floor(u))),U=u-N),wi[s-1]?(B=s-2,D=1,L=(w-i[s-1])/(i[s-1]-i[s-2])):(B=Math.max(0,Math.min(s-2,Math.floor(d))),D=d-B),R&&(o.dxydi(z,N,B,U,D),y[0]+=z[0]*R,y[1]+=z[1]*R),L&&(o.dxydj(z,N,B,U,D),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 d=o.dxydi(null,_,w,m,u),y=o.dadi(_,m);return[d[0]/y,d[1]/y]},o.dxydb=function(_,w,m,u){var d=o.dxydj(null,_,w,m,u),y=o.dbdj(w,u);return[d[0]/y,d[1]/y]},o.dxyda_rough=function(_,w,m){var u=g*(m||.1),d=o.ab2xy(_+u,w,!0),y=o.ab2xy(_-u,w,!0);return[(d[0]-y[0])*.5/u,(d[1]-y[1])*.5/u]},o.dxydb_rough=function(_,w,m){var u=b*(m||.1),d=o.ab2xy(_,w+u,!0),y=o.ab2xy(_,w-u,!0);return[(d[0]-y[0])*.5/u,(d[1]-y[1])*.5/u]},o.dpdx=function(_){return _._m},o.dpdy=function(_){return _._m}}}}),N4=_e({"src/traces/carpet/calc.js"(ee,X){var h=xs(),x=kn().isArray1D,S=S4(),k=M4(),e=E4(),t=k4(),r=C4(),o=W_(),n=P4(),i=$_(),a=F4();X.exports=function(f,c){var v=h.getFromId(f,c.xaxis),p=h.getFromId(f,c.yaxis),T=c.aaxis,l=c.baxis,g=c.x,b=c.y,A=[];g&&x(g)&&A.push("x"),b&&x(b)&&A.push("y"),A.length&&i(c,T,l,"a","b",A);var E=c._a=c._a||c.a,_=c._b=c._b||c.b;g=c._x||c.x,b=c._y||c.y;var w={};if(c._cheater){var m=T.cheatertype==="index"?E.length:E,u=l.cheatertype==="index"?_.length:_;g=S(m,u,c.cheaterslope)}c._x=g=o(g),c._y=b=o(b),n(g,E,_),n(b,E,_),a(c),c.setScale();var d=k(g),y=k(b),R=.5*(d[1]-d[0]),L=.5*(d[1]+d[0]),z=.5*(y[1]-y[0]),N=.5*(y[1]+y[0]),U=1.3;return d=[L-R*U,L+R*U],y=[N-z*U,N+z*U],c._extremes[v._id]=h.findExtremes(v,d,{padded:!0}),c._extremes[p._id]=h.findExtremes(p,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=b,w.a=E,w.b=_,[w]}}}),B4=_e({"src/traces/carpet/index.js"(ee,X){X.exports={attributes:Cx(),supplyDefaults:w4(),plot:A4(),calc:N4(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Mh(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),U4=_e({"lib/carpet.js"(ee,X){X.exports=B4()}}),aS=_e({"src/traces/scattercarpet/attributes.js"(ee,X){var h=Np(),x=Ff(),S=Zs(),{hovertemplateAttrs:k,texttemplateAttrs:e,templatefallbackAttrs:t}=fu(),r=tc(),o=po().extendFlat,n=x.marker,i=x.line,a=n.line;X.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:o({},x.mode,{dflt:"markers"}),text:o({},x.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),texttemplatefallback:t({editType:"plot"}),hovertext:o({},x.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:x.connectgaps,fill:o({},x.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:x.textfont,textposition:x.textposition,selected:x.selected,unselected:x.unselected,hoverinfo:o({},S.hoverinfo,{flags:["a","b","text","name"]}),hoveron:x.hoveron,hovertemplate:k(),hovertemplatefallback:t(),zorder:x.zorder}}}),j4=_e({"src/traces/scattercarpet/defaults.js"(ee,X){var h=kn(),x=sv(),S=Ps(),k=lp(),e=yp(),t=pg(),r=_p(),o=Up(),n=aS();X.exports=function(a,s,f,c){function v(E,_){return h.coerce(a,s,n,E,_)}v("carpet"),s.xaxis="x",s.yaxis="y";var p=v("a"),T=v("b"),l=Math.min(p.length,T.length);if(!l){s.visible=!1;return}s._length=l,v("text"),v("texttemplate"),v("texttemplatefallback"),v("hovertext");var g=l0?w=E.labelprefix.replace(/ = $/,""):w=E._hovertitle,l.push(w+": "+_.toFixed(3)+E.labelsuffix)}if(!v.hovertemplate){var b=c.hi||v.hoverinfo,A=b.split("+");A.indexOf("all")!==-1&&(A=["a","b","text"]),A.indexOf("a")!==-1&&g(p.aaxis,c.a),A.indexOf("b")!==-1&&g(p.baxis,c.b),l.push("y: "+n.yLabel),A.indexOf("text")!==-1&&x(c,v,l),n.extraText=l.join("
")}return o}}}),$4=_e({"src/traces/scattercarpet/event_data.js"(ee,X){X.exports=function(x,S,k,e,t){var r=e[t];return x.a=r.a,x.b=r.b,x.y=r.y,x}}}),W4=_e({"src/traces/scattercarpet/index.js"(ee,X){X.exports={attributes:aS(),supplyDefaults:j4(),colorbar:Ad(),formatLabels:V4(),calc:q4(),plot:G4(),style:Xd().style,styleOnSelect:Xd().styleOnSelect,hoverPoints:H4(),selectPoints:yg(),eventData:$4(),moduleType:"trace",name:"scattercarpet",basePlotModule:Mh(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Y4=_e({"lib/scattercarpet.js"(ee,X){X.exports=W4()}}),iS=_e({"src/traces/contourcarpet/attributes.js"(ee,X){var h=xg(),x=Ny(),S=tc(),k=po().extendFlat,e=x.contours;X.exports=k({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:x.fillcolor,autocontour:x.autocontour,ncontours:x.ncontours,contours:{type:e.type,start:e.start,end:e.end,size:e.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:e.showlines,showlabels:e.showlabels,labelfont:e.labelfont,labelformat:e.labelformat,operation:e.operation,value:e.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:x.line.color,width:x.line.width,dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},zorder:x.zorder},S("",{cLetter:"z",autoColorDflt:!1}))}}),oS=_e({"src/traces/contourcarpet/defaults.js"(ee,X){var h=kn(),x=H_(),S=iS(),k=L2(),e=ib(),t=ob();X.exports=function(o,n,i,a){function s(p,T){return h.coerce(o,n,S,p,T)}function f(p){return h.coerce2(o,n,S,p)}if(s("carpet"),o.a&&o.b){var c=x(o,n,s,a,"a","b");if(!c){n.visible=!1;return}s("text");var v=s("contours.type")==="constraint";v?k(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")}}}),X4=_e({"src/traces/contourcarpet/calc.js"(ee,X){var h=ko(),x=kn(),S=$_(),k=W_(),e=Y_(),t=X_(),r=v2(),o=oS(),n=Px(),i=w2();X.exports=function(f,c){var v=c._carpetTrace=n(f,c);if(!(!v||!v.visible||v.visible==="legendonly")){if(!c.a||!c.b){var p=f.data[v.index],T=f.data[c.index];T.a||(T.a=p.a),T.b||(T.b=p.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,v=c.aaxis,p=c.baxis,T,l,g,b,A,E,_;v._minDtick=0,p._minDtick=0,x.isArray1D(f.z)&&S(f,v,p,"a","b",["z"]),T=f._a=f._a||f.a,b=f._b=f._b||f.b,T=T?v.makeCalcdata(f,"_a"):[],b=b?p.makeCalcdata(f,"_b"):[],l=f.a0||0,g=f.da||1,A=f.b0||0,E=f.db||1,_=f._z=k(f._z||f.z,f.transpose),f._emptypoints=t(_),e(_,f._emptypoints);var w=x.maxRowLength(_),m=f.xtype==="scaled"?"":T,u=r(f,m,l,g,w,v),d=f.ytype==="scaled"?"":b,y=r(f,d,A,E,_.length,p),R={a:u,b:y,z:_};return f.contours.type==="levels"&&f.contours.coloring!=="none"&&h(s,f,{vals:_,containerStr:"",cLetter:"z"}),[R]}}}),Z4=_e({"src/traces/carpet/axis_aligned_line.js"(ee,X){var h=kn().isArrayOrTypedArray;X.exports=function(x,S,k,e){var t,r,o,n,i,a,s,f,c,v,p,T,l,g=h(k)?"a":"b",b=g==="a"?x.aaxis:x.baxis,A=b.smoothing,E=g==="a"?x.a2i:x.b2j,_=g==="a"?k:e,w=g==="a"?e:k,m=g==="a"?S.a.length:S.b.length,u=g==="a"?S.b.length:S.a.length,d=Math.floor(g==="a"?x.b2j(w):x.a2i(w)),y=g==="a"?function(ye){return x.evalxy([],ye,d)}:function(ye){return x.evalxy([],d,ye)};A&&(o=Math.max(0,Math.min(u-2,d)),n=d-o,r=g==="a"?function(ye,pe){return x.dxydi([],ye,o,pe,n)}:function(ye,pe){return x.dxydj([],o,ye,n,pe)});var R=E(_[0]),L=E(_[1]),z=R0?Math.floor:Math.ceil,B=z>0?Math.ceil:Math.floor,D=z>0?Math.min:Math.max,j=z>0?Math.max:Math.min,q=U(R+N),J=B(L-N);s=y(R);var oe=[[s]];for(t=q;t*z=0;Te--)Y=j.clipsegments[Te],le=x([],Y.x,R.c2p),ue=x([],Y.y,L.c2p),le.reverse(),ue.reverse(),Fe.push(S(le,ue,Y.bicubic));var Ve="M"+Fe.join("L")+"Z";A(N,j.clipsegments,R,L,pe,W),E(B,N,R,L,ie,se,ae,D,j,W,Ve),p(N,ye,m,U,oe,u,D),k.setClipUrl(N,D._clipPathId,m)})};function v(w,m){var u,d,y,R,L,z,N,U,B;for(u=0;uye&&(d.max=ye),d.len=d.max-d.min}function l(w,m,u){var d=w.getPointAtLength(m),y=w.getPointAtLength(u),R=y.x-d.x,L=y.y-d.y,z=Math.sqrt(R*R+L*L);return[R/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 b(w,m){var u=Math.abs(w[0]*m[0]+w[1]*m[1]),d=Math.sqrt(1-u*u);return d/u}function A(w,m,u,d,y,R){var L,z,N,U,B=e.ensureSingle(w,"g","contourbg"),D=B.selectAll("path").data(R==="fill"&&!y?[0]:[]);D.enter().append("path"),D.exit().remove();var j=[];for(U=0;U=0&&(q=le,oe=ye):Math.abs(j[1]-q[1])=0&&(q=le,oe=ye):e.log("endpt to newendpt is not vert. or horz.",j,q,le)}if(oe>=0)break;U+=ie(j,q),j=q}if(oe===m.edgepaths.length){e.log("unclosed perimeter path");break}N=oe,D=B.indexOf(N)===-1,D&&(N=B[0],U+=ie(j,q)+"Z",j=null)}for(N=0;N_):E=z>y,_=z;var N=v(y,R,L,z);N.pos=d,N.yc=(y+z)/2,N.i=u,N.dir=E?"increasing":"decreasing",N.x=N.pos,N.y=[L,R],w&&(N.orig_p=s[u]),b&&(N.tx=a.text[u]),A&&(N.htx=a.hovertext[u]),m.push(N)}else m.push({pos:d,empty:!0})}return a._extremes[c._id]=S.findExtremes(c,h.concat(l,T),{padded:!0}),m.length&&(m[0].t={labels:{open:x(i,"open:")+" ",high:x(i,"high:")+" ",low:x(i,"low:")+" ",close:x(i,"close:")+" "}}),m}function n(i,a,s){var f=s._minDiff;if(!f){var c=i._fullData,v=[];f=1/0;var p;for(p=0;p"+g.labels[d]+h.hoverLabelText(T,y,l.yhoverformat)):(L=x.extendFlat({},A),L.y0=L.y1=R,L.yLabelVal=y,L.yLabel=g.labels[d]+h.hoverLabelText(T,y,l.yhoverformat),L.name="",b.push(L),m[y]=L)}return b}function a(s,f,c,v){var p=s.cd,T=s.ya,l=p[0].trace,g=p[0].t,b=n(s,f,c,v);if(!b)return[];var A=b.index,E=p[A],_=b.index=E.i,w=E.dir;function m(N){return g.labels[N]+h.hoverLabelText(T,l[N][_],l.yhoverformat)}var u=E.hi||l.hoverinfo||"",d=u.split("+"),y=u==="all",R=y||d.indexOf("y")!==-1,L=y||d.indexOf("text")!==-1,z=R?[m("open"),m("high"),m("low"),m("close")+" "+r[w]]:[];return L&&e(E,l,z),b.extraText=z.join("
"),b.y0=b.y1=T.c2p(E.yc,!0),[b]}X.exports={hoverPoints:o,hoverSplit:i,hoverOnPoints:a}}}),cS=_e({"src/traces/ohlc/select.js"(ee,X){X.exports=function(x,S){var k=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,n=k[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)+p},n.g2c=function(l){return n.l2c(l+s-p)},n.g2p=function(l){return l*v},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"?k(n):n}function o(n,i){var a=n.type;if(a==="linear"){var s=n.d2c,f=n.c2d;n.d2c=function(c,v){return t(s(c),v)},n.c2d=function(c,v){return f(r(c,v))}}n.makeCalcdata=function(c,v){var p=c[v],T=c._length,l,g,b=function(m){return n.d2c(m,c.thetaunit)};if(p)for(l=new Array(T),g=0;g0?m:1/0},E=S(b,A),_=h.mod(E+1,b.length);return[b[E],b[_]]}function v(g){return Math.abs(g)>1e-10?g:0}function p(g,b,A){b=b||0,A=A||0;for(var E=g.length,_=new Array(E),w=0;w0?1:0}function x(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 k(r,o){return o*r.radius}function e(r,o,n,i){var a=S(r,x([n,o])),s=a[0],f=a[1],c=S(r,x([i,o])),v=c[0],p=c[1];if(o===0)return["M"+s+","+f,"L"+v+","+p].join(" ");var T=k(r,1/Math.abs(o));return["M"+s+","+f,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+v+","+p].join(" ")}function t(r,o,n,i){var a=k(r,1/(o+1)),s=S(r,x([o,n])),f=s[0],c=s[1],v=S(r,x([o,i])),p=v[0],T=v[1];if(h(n)!==h(i)){var l=S(r,x([o,0])),g=l[0],b=l[1];return["M"+f+","+c,"A"+a+","+a+" 0 0,"+(0yt?(bt=ue,mt=ue*yt,ze=(Te-mt)/Q.h/2,ht=[Y[0],Y[1]],qe=[le[0]+ze,le[1]-ze]):(bt=Te/yt,mt=Te,ze=(ue-bt)/Q.w/2,ht=[Y[0]+ze,Y[1]-ze],qe=[le[0],le[1]]),ae.xLength2=bt,ae.yLength2=mt,ae.xDomain2=ht,ae.yDomain2=qe;var Ae=ae.xOffset2=Q.l+Q.w*ht[0],Ke=ae.yOffset2=Q.t+Q.h*(1-qe[1]),_t=ae.radius=bt/Xe,wt=ae.innerRadius=ae.getHole(W)*_t,vt=ae.cx=Ae-_t*Ve[0],$t=ae.cy=Ke+_t*Ve[3],Yt=ae.cxx=vt-Ae,lr=ae.cyy=$t-Ke,dr=me.side,Nr;dr==="counterclockwise"?(Nr=dr,dr="top"):dr==="clockwise"&&(Nr=dr,dr="bottom"),ae.radialAxis=ae.mockAxis(ge,W,me,{_id:"x",side:dr,_trueSide:Nr,domain:[wt/Q.w,_t/Q.w]}),ae.angularAxis=ae.mockAxis(ge,W,ie,{side:"right",domain:[0,Math.PI],autorange:!1}),ae.doAutoRange(ge,W),ae.updateAngularAxis(ge,W),ae.updateRadialAxis(ge,W),ae.updateRadialAxisTitle(ge,W),ae.xaxis=ae.mockCartesianAxis(ge,W,{_id:"x",domain:ht}),ae.yaxis=ae.mockCartesianAxis(ge,W,{_id:"y",domain:qe});var Fr=ae.pathSubplot();ae.clipPaths.forTraces.select("path").attr("d",Fr).attr("transform",t(Yt,lr)),se.frontplot.attr("transform",t(Ae,Ke)).call(o.setClipUrl,ae._hasClipOnAxisFalse?null:ae.clipIds.forTraces,ae.gd),se.bg.attr("d",Fr).attr("transform",t(vt,$t)).call(r.fill,W.bgcolor)},q.mockAxis=function(ge,W,ae,se){var Q=k.extendFlat({},ae,se);return s(Q,W,ge),Q},q.mockCartesianAxis=function(ge,W,ae){var se=this,Q=se.isSmith,me=ae._id,ie=k.extendFlat({type:"linear"},ae);a(ie,ge);var Y={x:[0,2],y:[1,3]};return ie.setRange=function(){var le=se.sectorBBox,ue=Y[me],Te=se.radialAxis._rl,Fe=(Te[1]-Te[0])/(1-se.getHole(W));ie.range=[le[ue[0]]*Fe,le[ue[1]]*Fe]},ie.isPtWithinRange=me==="x"&&!Q?function(le){return se.isPtInside(le)}:function(){return!0},ie.setRange(),ie.setScale(),ie},q.doAutoRange=function(ge,W){var ae=this,se=ae.gd,Q=ae.radialAxis,me=ae.getRadial(W);f(se,Q);var ie=Q.range;if(me.range=ie.slice(),me._input.range=ie.slice(),Q._rl=[Q.r2l(ie[0],null,"gregorian"),Q.r2l(ie[1],null,"gregorian")],Q.minallowed!==void 0){var Y=Q.r2l(Q.minallowed);Q._rl[0]>Q._rl[1]?Q._rl[1]=Math.max(Q._rl[1],Y):Q._rl[0]=Math.max(Q._rl[0],Y)}if(Q.maxallowed!==void 0){var le=Q.r2l(Q.maxallowed);Q._rl[0]90&&Te<=270&&(Fe.tickangle=180);var We=Xe?function(_t){var wt=z(ae,y([_t.x,0]));return t(wt[0]-Y,wt[1]-le)}:function(_t){return t(Fe.l2p(_t.x)+ie,0)},it=Xe?function(_t){return L(ae,_t.x,-1/0,1/0)}:function(_t){return ae.pathArc(Fe.r2p(_t.x)+ie)},yt=J(ue);if(ae.radialTickLayout!==yt&&(Q["radial-axis"].selectAll(".xtick").remove(),ae.radialTickLayout=yt),Ve){Fe.setScale();var bt=0,mt=Xe?(Fe.tickvals||[]).filter(function(_t){return _t>=0}).map(function(_t){return i.tickText(Fe,_t,!0,!1)}):i.calcTicks(Fe),ht=Xe?mt:i.clipEnds(Fe,mt),qe=i.getTickSigns(Fe)[2];Xe&&((Fe.ticks==="top"&&Fe.side==="bottom"||Fe.ticks==="bottom"&&Fe.side==="top")&&(qe=-qe),Fe.ticks==="top"&&Fe.side==="top"&&(bt=-Fe.ticklen),Fe.ticks==="bottom"&&Fe.side==="bottom"&&(bt=Fe.ticklen)),i.drawTicks(se,Fe,{vals:mt,layer:Q["radial-axis"],path:i.makeTickPath(Fe,0,qe),transFn:We,crisp:!1}),i.drawGrid(se,Fe,{vals:ht,layer:Q["radial-grid"],path:it,transFn:k.noop,crisp:!1}),i.drawLabels(se,Fe,{vals:mt,layer:Q["radial-axis"],transFn:We,labelFns:i.makeLabelFns(Fe,bt)})}var ze=ae.radialAxisAngle=ae.vangles?D(ye(B(ue.angle),ae.vangles)):ue.angle,Ae=t(Y,le),Ke=Ae+e(-ze);pe(Q["radial-axis"],Ve&&(ue.showticklabels||ue.ticks),{transform:Ke}),pe(Q["radial-grid"],Ve&&ue.showgrid,{transform:Xe?"":Ae}),pe(Q["radial-line"].select("line"),Ve&&ue.showline,{x1:Xe?-me:ie,y1:0,x2:me,y2:0,transform:Ke}).attr("stroke-width",ue.linewidth).call(r.stroke,ue.linecolor)},q.updateRadialAxisTitle=function(ge,W,ae){if(!this.isSmith){var se=this,Q=se.gd,me=se.radius,ie=se.cx,Y=se.cy,le=se.getRadial(W),ue=se.id+"title",Te=0;if(le.title){var Fe=o.bBox(se.layers["radial-axis"].node()).height,Ve=le.title.font.size,Xe=le.side;Te=Xe==="top"?Ve:Xe==="counterclockwise"?-(Fe+Ve*.4):Fe+Ve*.8}var We=ae!==void 0?ae:se.radialAxisAngle,it=B(We),yt=Math.cos(it),bt=Math.sin(it),mt=ie+me/2*yt+Te*bt,ht=Y-me/2*bt+Te*yt;se.layers["radial-axis-title"]=T.draw(Q,ue,{propContainer:le,propName:se.id+".radialaxis.title.text",placeholder:N(Q,"Click to enter radial axis title"),attributes:{x:mt,y:ht,"text-anchor":"middle"},transform:{rotate:-We}})}},q.updateAngularAxis=function(ge,W){var ae=this,se=ae.gd,Q=ae.layers,me=ae.radius,ie=ae.innerRadius,Y=ae.cx,le=ae.cy,ue=ae.getAngular(W),Te=ae.angularAxis,Fe=ae.isSmith;Fe||(ae.fillViewInitialKey("angularaxis.rotation",ue.rotation),Te.setGeometry(),Te.setScale());var Ve=Fe?function(wt){var vt=z(ae,y([0,wt.x]));return Math.atan2(vt[0]-Y,vt[1]-le)-Math.PI/2}:function(wt){return Te.t2g(wt.x)};Te.type==="linear"&&Te.thetaunit==="radians"&&(Te.tick0=D(Te.tick0),Te.dtick=D(Te.dtick));var Xe=function(wt){return t(Y+me*Math.cos(wt),le-me*Math.sin(wt))},We=Fe?function(wt){var vt=z(ae,y([0,wt.x]));return t(vt[0],vt[1])}:function(wt){return Xe(Ve(wt))},it=Fe?function(wt){var vt=z(ae,y([0,wt.x])),$t=Math.atan2(vt[0]-Y,vt[1]-le)-Math.PI/2;return t(vt[0],vt[1])+e(-D($t))}:function(wt){var vt=Ve(wt);return Xe(vt)+e(-D(vt))},yt=Fe?function(wt){return R(ae,wt.x,0,1/0)}:function(wt){var vt=Ve(wt),$t=Math.cos(vt),Yt=Math.sin(vt);return"M"+[Y+ie*$t,le-ie*Yt]+"L"+[Y+me*$t,le-me*Yt]},bt=i.makeLabelFns(Te,0),mt=bt.labelStandoff,ht={};ht.xFn=function(wt){var vt=Ve(wt);return Math.cos(vt)*mt},ht.yFn=function(wt){var vt=Ve(wt),$t=Math.sin(vt)>0?.2:1;return-Math.sin(vt)*(mt+wt.fontSize*$t)+Math.abs(Math.cos(vt))*(wt.fontSize*w)},ht.anchorFn=function(wt){var vt=Ve(wt),$t=Math.cos(vt);return Math.abs($t)<.1?"middle":$t>0?"start":"end"},ht.heightFn=function(wt,vt,$t){var Yt=Ve(wt);return-.5*(1+Math.sin(Yt))*$t};var qe=J(ue);ae.angularTickLayout!==qe&&(Q["angular-axis"].selectAll("."+Te._id+"tick").remove(),ae.angularTickLayout=qe);var ze=Fe?[1/0].concat(Te.tickvals||[]).map(function(wt){return i.tickText(Te,wt,!0,!1)}):i.calcTicks(Te);Fe&&(ze[0].text="∞",ze[0].fontSize*=1.75);var Ae;if(W.gridshape==="linear"?(Ae=ze.map(Ve),k.angleDelta(Ae[0],Ae[1])<0&&(Ae=Ae.slice().reverse())):Ae=null,ae.vangles=Ae,Te.type==="category"&&(ze=ze.filter(function(wt){return k.isAngleInsideSector(Ve(wt),ae.sectorInRad)})),Te.visible){var Ke=Te.ticks==="inside"?-1:1,_t=(Te.linewidth||1)/2;i.drawTicks(se,Te,{vals:ze,layer:Q["angular-axis"],path:"M"+Ke*_t+",0h"+Ke*Te.ticklen,transFn:it,crisp:!1}),i.drawGrid(se,Te,{vals:ze,layer:Q["angular-grid"],path:yt,transFn:k.noop,crisp:!1}),i.drawLabels(se,Te,{vals:ze,layer:Q["angular-axis"],repositionOnUpdate:!0,transFn:We,labelFns:ht})}pe(Q["angular-line"].select("path"),ue.showline,{d:ae.pathSubplot(),transform:t(Y,le)}).attr("stroke-width",ue.linewidth).call(r.stroke,ue.linecolor)},q.updateFx=function(ge,W){if(!this.gd._context.staticPlot){var ae=!this.isSmith;ae&&(this.updateAngularDrag(ge),this.updateRadialDrag(ge,W,0),this.updateRadialDrag(ge,W,1)),this.updateHoverAndMainDrag(ge)}},q.updateHoverAndMainDrag=function(ge){var W=this,ae=W.isSmith,se=W.gd,Q=W.layers,me=ge._zoomlayer,ie=m.MINZOOM,Y=m.OFFEDGE,le=W.radius,ue=W.innerRadius,Te=W.cx,Fe=W.cy,Ve=W.cxx,Xe=W.cyy,We=W.sectorInRad,it=W.vangles,yt=W.radialAxis,bt=u.clampTiny,mt=u.findXYatLength,ht=u.findEnclosingVertexAngles,qe=m.cornerHalfWidth,ze=m.cornerLen/2,Ae,Ke,_t=c.makeDragger(Q,"path","maindrag",ge.dragmode===!1?"none":"crosshair");h.select(_t).attr("d",W.pathSubplot()).attr("transform",t(Te,Fe)),_t.onmousemove=function(Sr){p.hover(se,Sr,W.id),se._fullLayout._lasthover=_t,se._fullLayout._hoversubplot=W.id},_t.onmouseout=function(Sr){se._dragging||v.unhover(se,Sr)};var wt={element:_t,gd:se,subplot:W.id,plotinfo:{id:W.id,xaxis:W.xaxis,yaxis:W.yaxis},xaxes:[W.xaxis],yaxes:[W.yaxis]},vt,$t,Yt,lr,dr,Nr,Fr,ln,zr;function Xr(Sr,Tr){return Math.sqrt(Sr*Sr+Tr*Tr)}function Ot(Sr,Tr){return Xr(Sr-Ve,Tr-Xe)}function Qe(Sr,Tr){return Math.atan2(Xe-Tr,Sr-Ve)}function ct(Sr,Tr){return[Sr*Math.cos(Tr),Sr*Math.sin(-Tr)]}function Ue(Sr,Tr){if(Sr===0)return W.pathSector(2*qe);var Yr=ze/Sr,Fn=Tr-Yr,ua=Tr+Yr,ta=Math.max(0,Math.min(Sr,le)),va=ta-qe,ma=ta+qe;return"M"+ct(va,Fn)+"A"+[va,va]+" 0,0,0 "+ct(va,ua)+"L"+ct(ma,ua)+"A"+[ma,ma]+" 0,0,1 "+ct(ma,Fn)+"Z"}function Ie(Sr,Tr,Yr){if(Sr===0)return W.pathSector(2*qe);var Fn=ct(Sr,Tr),ua=ct(Sr,Yr),ta=bt((Fn[0]+ua[0])/2),va=bt((Fn[1]+ua[1])/2),ma,Jn;if(ta&&va){var ja=va/ta,ti=-1/ja,gr=mt(qe,ja,ta,va);ma=mt(ze,ti,gr[0][0],gr[0][1]),Jn=mt(ze,ti,gr[1][0],gr[1][1])}else{var Kt,vr;va?(Kt=ze,vr=qe):(Kt=qe,vr=ze),ma=[[ta-Kt,va-vr],[ta+Kt,va-vr]],Jn=[[ta-Kt,va+vr],[ta+Kt,va+vr]]}return"M"+ma.join("L")+"L"+Jn.reverse().join("L")+"Z"}function Pe(){Yt=null,lr=null,dr=W.pathSubplot(),Nr=!1;var Sr=se._fullLayout[W.id];Fr=x(Sr.bgcolor).getLuminance(),ln=c.makeZoombox(me,Fr,Te,Fe,dr),ln.attr("fill-rule","evenodd"),zr=c.makeCorners(me,Te,Fe),b(se)}function Be(Sr,Tr){return Tr=Math.max(Math.min(Tr,le),ue),Srie?(Sr-1&&Sr===1&&g(Tr,se,[W.xaxis],[W.yaxis],W.id,wt),Yr.indexOf("event")>-1&&p.click(se,Tr,W.id)}wt.prepFn=function(Sr,Tr,Yr){var Fn=se._fullLayout.dragmode,ua=_t.getBoundingClientRect();se._fullLayout._calcInverseTransform(se);var ta=se._fullLayout._invTransform;Ae=se._fullLayout._invScaleX,Ke=se._fullLayout._invScaleY;var va=k.apply3DTransform(ta)(Tr-ua.left,Yr-ua.top);if(vt=va[0],$t=va[1],it){var ma=u.findPolygonOffset(le,We[0],We[1],it);vt+=Ve+ma[0],$t+=Xe+ma[1]}switch(Fn){case"zoom":wt.clickFn=Cr,ae||(it?wt.moveFn=Nt:wt.moveFn=ft,wt.doneFn=Ht,Pe());break;case"select":case"lasso":l(Sr,Tr,Yr,wt,Fn);break}},v.init(wt)},q.updateRadialDrag=function(ge,W,ae){var se=this,Q=se.gd,me=se.layers,ie=se.radius,Y=se.innerRadius,le=se.cx,ue=se.cy,Te=se.radialAxis,Fe=m.radialDragBoxSize,Ve=Fe/2;if(!Te.visible)return;var Xe=B(se.radialAxisAngle),We=Te._rl,it=We[0],yt=We[1],bt=We[ae],mt=.75*(We[1]-We[0])/(1-se.getHole(W))/ie,ht,qe,ze;ae?(ht=le+(ie+Ve)*Math.cos(Xe),qe=ue-(ie+Ve)*Math.sin(Xe),ze="radialdrag"):(ht=le+(Y-Ve)*Math.cos(Xe),qe=ue-(Y-Ve)*Math.sin(Xe),ze="radialdrag-inner");var Ae=c.makeRectDragger(me,ze,"crosshair",-Ve,-Ve,Fe,Fe),Ke={element:Ae,gd:Q};ge.dragmode===!1&&(Ke.dragmode=!1),pe(h.select(Ae),Te.visible&&Y0!=(ae?vt>it:vt=90||Q>90&&me>=450?Xe=1:Y<=0&&ue<=0?Xe=0:Xe=Math.max(Y,ue),Q<=180&&me>=180||Q>180&&me>=540?Te=-1:ie>=0&&le>=0?Te=0:Te=Math.min(ie,le),Q<=270&&me>=270||Q>270&&me>=630?Fe=-1:Y>=0&&ue>=0?Fe=0:Fe=Math.min(Y,ue),me>=360?Ve=1:ie<=0&&le<=0?Ve=0:Ve=Math.max(ie,le),[Te,Fe,Ve,Xe]}function ye(ge,W){var ae=function(Q){return k.angleDist(ge,Q)},se=k.findIndexOfMin(W,ae);return W[se]}function pe(ge,W,ae){return W?(ge.attr("display",null),ge.attr(ae)):ge&&ge.attr("display","none"),ge}}}),vS=_e({"src/plots/polar/layout_attributes.js"(ee,X){var h=Hl(),x=Ih(),S=hf().attributes,k=kn().extendFlat,e=nc().overrideAll,t=e({color:x.color,showline:k({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:k({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,ticklabelstep:x.ticklabelstep,showticklabels:x.showticklabels,labelalias:x.labelalias,minorloglabels:x.minorloglabels,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickfont:x.tickfont,tickangle:x.tickangle,tickformat:x.tickformat,tickformatstops:x.tickformatstops,layer:x.layer},"plot","from-root"),o={visible:k({},x.visible,{dflt:!0}),type:k({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},autorange:k({},x.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:k({},x.minallowed,{editType:"plot"}),maxallowed:k({},x.maxallowed,{editType:"plot"}),range:k({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:x.categoryorder,categoryarray:x.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:x.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:k({},x.title.text,{editType:"plot",dflt:""}),font:k({},x.title.font,{editType:"plot"}),editType:"plot"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};k(o,t,r);var n={visible:k({},x.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:x.autotypenumbers,categoryorder:x.categoryorder,categoryarray:x.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};k(n,t,r),X.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"}}}),uR=_e({"src/plots/polar/layout_defaults.js"(ee,X){var h=kn(),x=so(),S=ou(),k=T0(),e=xl().getSubplotData,t=ov(),r=Dv(),o=Zr(),n=Ln(),i=P_(),a=Py(),s=bw(),f=qd(),c=vS(),v=hS(),p=Ix(),T=p.axisNames;function l(b,A,E,_){var w=E("bgcolor");_.bgColor=x.combine(w,_.paper_bgcolor);var m=E("sector");E("hole");var u=e(_.fullData,p.name,_.id),d=_.layoutOut,y;function R(Fe,Ve){return E(y+"."+Fe,Ve)}for(var L=0;L")}}X.exports={hoverPoints:x,makeHoverPointText:S}}}),hR=_e({"src/traces/scatterpolar/index.js"(ee,X){X.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:Rx(),categories:["polar","symbols","showLegend","scatter-like"],attributes:A1(),supplyDefaults:Ox().supplyDefaults,colorbar:Ad(),formatLabels:zx(),calc:cR(),plot:fR(),style:Xd().style,styleOnSelect:Xd().styleOnSelect,hoverPoints:Fx().hoverPoints,selectPoints:yg(),meta:{}}}}),dR=_e({"lib/scatterpolar.js"(ee,X){X.exports=hR()}}),mS=_e({"src/traces/scatterpolargl/attributes.js"(ee,X){var h=A1(),{cliponaxis:x,hoveron:S}=h,k=ut(h,["cliponaxis","hoveron"]),{connectgaps:e,line:{color:t,dash:r,width:o},fill:n,fillcolor:i,marker:a,textfont:s,textposition:f}=v1();X.exports=He(we({},k),{connectgaps:e,fill:n,fillcolor:i,line:{color:t,dash:r,editType:"calc",width:o},marker:a,textfont:s,textposition:f})}}),pR=_e({"src/traces/scatterpolargl/defaults.js"(ee,X){var h=kn(),x=Ps(),S=Ox().handleRThetaDefaults,k=lp(),e=yp(),t=_p(),r=Up(),o=sv().PTS_LINESONLY,n=mS();X.exports=function(a,s,f,c){function v(T,l){return h.coerce(a,s,n,T,l)}var p=S(a,s,c,v);if(!p){s.visible=!1;return}v("thetaunit"),v("mode",p=r&&(_.marker.cluster=g.tree),_.marker&&(_.markerSel.positions=_.markerUnsel.positions=_.marker.positions=d),_.line&&d.length>1&&t.extendFlat(_.line,e.linePositions(i,l,d)),_.text&&(t.extendFlat(_.text,{positions:d},e.textPosition(i,l,_.text,_.marker)),t.extendFlat(_.textSel,{positions:d},e.textPosition(i,l,_.text,_.markerSel)),t.extendFlat(_.textUnsel,{positions:d},e.textPosition(i,l,_.text,_.markerUnsel))),_.fill&&!v.fill2d&&(v.fill2d=!0),_.marker&&!v.scatter2d&&(v.scatter2d=!0),_.line&&!v.line2d&&(v.line2d=!0),_.text&&!v.glText&&(v.glText=!0),v.lineOptions.push(_.line),v.fillOptions.push(_.fill),v.markerOptions.push(_.marker),v.markerSelectedOptions.push(_.markerSel),v.markerUnselectedOptions.push(_.markerUnsel),v.textOptions.push(_.text),v.textSelectedOptions.push(_.textSel),v.textUnselectedOptions.push(_.textUnsel),v.selectBatch.push([]),v.unselectBatch.push([]),g.x=y,g.y=R,g.rawx=y,g.rawy=R,g.r=A,g.theta=E,g.positions=d,g._scene=v,g.index=v.count,v.count++}}),S(i,a,s)}},X.exports.reglPrecompiled=o}}),bR=_e({"src/traces/scatterpolargl/index.js"(ee,X){var h=yR();h.plot=_R(),X.exports=h}}),xR=_e({"lib/scatterpolargl.js"(ee,X){X.exports=bR()}}),gS=_e({"src/traces/barpolar/attributes.js"(ee,X){var{hovertemplateAttrs:h,templatefallbackAttrs:x}=fu(),S=po().extendFlat,k=A1(),e=uv();X.exports={r:k.r,theta:k.theta,r0:k.r0,dr:k.dr,theta0:k.theta0,dtheta:k.dtheta,thetaunit:k.thetaunit,base:S({},e.base,{}),offset:S({},e.offset,{}),width:S({},e.width,{}),text:S({},e.text,{}),hovertext:S({},e.hovertext,{}),marker:t(),hoverinfo:k.hoverinfo,hovertemplate:h(),hovertemplatefallback:x(),selected:e.selected,unselected:e.unselected};function t(){var r=S({},e.marker);return delete r.cornerradius,r}}}),yS=_e({"src/traces/barpolar/layout_attributes.js"(ee,X){X.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),wR=_e({"src/traces/barpolar/defaults.js"(ee,X){var h=kn(),x=Ox().handleRThetaDefaults,S=B_(),k=gS();X.exports=function(t,r,o,n){function i(s,f){return h.coerce(t,r,k,s,f)}var a=x(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)}}}),TR=_e({"src/traces/barpolar/layout_defaults.js"(ee,X){var h=kn(),x=yS();X.exports=function(S,k,e){var t={},r;function o(a,s){return h.coerce(S[r]||{},k[r],x,a,s)}for(var n=0;n0?(c=s,v=f):(c=f,v=s);var p=e.findEnclosingVertexAngles(c,r.vangles)[0],T=e.findEnclosingVertexAngles(v,r.vangles)[1],l=[p,(c+v)/2,T];return e.pathPolygonAnnulus(i,a,c,v,l,o,n)}:function(i,a,s,f){return S.pathAnnulus(i,a,s,f,o,n)}}}}),SR=_e({"src/traces/barpolar/hover.js"(ee,X){var h=zf(),x=kn(),S=_g().getTraceColor,k=x.fillText,e=Fx().makeHoverPointText,t=Dx().isPtInsidePolygon;X.exports=function(o,n,i){var a=o.cd,s=a[0].trace,f=o.subplot,c=f.radialAxis,v=f.angularAxis,p=f.vangles,T=p?t:x.isPtInsideSector,l=o.maxHoverDistance,g=v._period||2*Math.PI,b=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 E=function(u){return T(b,A,[u.rp0,u.rp1],[u.thetag0,u.thetag1],p)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/g)-1+(u.rp1-b)/(u.rp1-u.rp0)-1:1/0};if(h.getClosest(a,E,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=x.extendFlat({},w,{r:w.s,theta:w.p});return k(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]}}}}),MR=_e({"src/traces/barpolar/index.js"(ee,X){X.exports={moduleType:"trace",name:"barpolar",basePlotModule:Rx(),categories:["polar","bar","showLegend"],attributes:gS(),layoutAttributes:yS(),supplyDefaults:wR(),supplyLayoutDefaults:TR(),calc:_S().calc,crossTraceCalc:_S().crossTraceCalc,plot:AR(),colorbar:Ad(),formatLabels:zx(),style:Ap().style,styleOnSelect:Ap().styleOnSelect,hoverPoints:SR(),selectPoints:bg(),meta:{}}}}),ER=_e({"lib/barpolar.js"(ee,X){X.exports=MR()}}),bS=_e({"src/plots/smith/constants.js"(ee,X){X.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),xS=_e({"src/plots/smith/layout_attributes.js"(ee,X){var h=Hl(),x=Ih(),S=hf().attributes,k=kn().extendFlat,e=nc().overrideAll,t=e({color:x.color,showline:k({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:k({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({ticklen:x.ticklen,tickwidth:k({},x.tickwidth,{dflt:2}),tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,tickfont:x.tickfont,tickformat:x.tickformat,hoverformat:x.hoverformat,layer:x.layer},"plot","from-root"),o=k({visible:k({},x.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:k({},x.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},t,r),n=k({visible:k({},x.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:x.ticks,editType:"calc"},t,r);X.exports={domain:S({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:h.background},realaxis:o,imaginaryaxis:n,editType:"calc"}}}),kR=_e({"src/plots/smith/layout_defaults.js"(ee,X){var h=kn(),x=so(),S=ou(),k=T0(),e=xl().getSubplotData,t=Ln(),r=Zr(),o=Py(),n=Sc(),i=xS(),a=bS(),s=a.axisNames,f=v(function(p){return h.isTypedArray(p)&&(p=Array.from(p)),p.slice().reverse().map(function(T){return-T}).concat([0]).concat(p)},String);function c(p,T,l,g){var b=l("bgcolor");g.bgColor=x.combine(b,g.paper_bgcolor);var A=e(g.fullData,a.name,g.id),E=g.layoutOut,_;function w(q,J){return l(_+"."+q,J)}for(var m=0;m")}}X.exports={hoverPoints:x,makeHoverPointText:S}}}),OR=_e({"src/traces/scattersmith/index.js"(ee,X){X.exports={moduleType:"trace",name:"scattersmith",basePlotModule:CR(),categories:["smith","symbols","showLegend","scatter-like"],attributes:wS(),supplyDefaults:PR(),colorbar:Ad(),formatLabels:LR(),calc:IR(),plot:DR(),style:Xd().style,styleOnSelect:Xd().styleOnSelect,hoverPoints:RR().hoverPoints,selectPoints:yg(),meta:{}}}}),zR=_e({"lib/scattersmith.js"(ee,X){X.exports=OR()}}),Id=_e({"node_modules/world-calendars/dist/main.js"(ee,X){var h=Dh();function x(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}h(x.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 k(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?"-":"")+k(Math.abs(this.year()),4)+"-"+k(this.month(),2)+"-"+k(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?"-":"")+k(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(),v=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"&&(v(this),s=Math.min(s,this.daysInMonth(f,this.fromMonthOfYear(f,c))));var p=[f,this.fromMonthOfYear(f,c),s];return this._validateLevel--,p}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-(p>2.5?4716:4715);return T<=0&&T--,this.newDate(T,p,v)},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=X.exports=new x;r.cdate=S,r.baseCalendar=e,r.calendars.gregorian=t}}),FR=_e({"node_modules/world-calendars/dist/plus.js"(){var ee=Dh(),X=Id();ee(X.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"}),X.local=X.regionalOptions[""],ee(X.cdate.prototype,{formatDate:function(h,x){return typeof h!="string"&&(x=h,h=""),this._calendar.formatDate(h||"",this,x)}}),ee(X.baseCalendar.prototype,{UNIX_EPOCH:X.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:24*60*60,TICKS_EPOCH:X.instance().jdEpoch,TICKS_PER_DAY:24*60*60*1e7,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(h,x,S){if(typeof h!="string"&&(S=x,x=h,h=""),!x)return"";if(x.calendar()!==this)throw X.local.invalidFormat||X.regionalOptions[""].invalidFormat;h=h||this.local.dateFormat,S=S||{};var k=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(b,A){for(var E=1;g+E1},i=function(b,A,E,_){var w=""+A;if(n(b,_))for(;w.length1},g=function(R,L){var z=l(R,L),N=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(R)+1],U=new RegExp("^-?\\d{1,"+N+"}"),B=x.substring(m).match(U);if(!B)throw(X.local.missingNumberAt||X.regionalOptions[""].missingNumberAt).replace(/\{0\}/,m);return m+=B[0].length,parseInt(B[0],10)},b=this,A=function(){if(typeof o=="function"){l("m");var R=o.call(b,x.substring(m));return m+=R.length,R}return g("m")},E=function(R,L,z,N){for(var U=l(R,N)?z:L,B=0;B-1){f=1,c=v;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,x,S,k,e){S&&typeof S!="object"&&(e=k,k=S,S=null),typeof k!="string"&&(e=k,k="");var t=this,r=function(o){try{return t.parseDate(k,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 x=x?x.newDate():null,h=h==null?x:typeof h=="string"?r(h):typeof h=="number"?isNaN(h)||h===1/0||h===-1/0?x:t.today().add(h,"d"):t.newDate(h),h}})}}),NR=_e({"node_modules/world-calendars/dist/calendars/chinese.js"(){var ee=Id(),X=Dh(),h=ee.instance();function x(a){this.local=this.regionalOptions[a||""]||this.regionalOptions[""]}x.prototype=new ee.baseCalendar,X(x.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(k);return f?f[0]:""}var c=this._validateYear(a),v=a.month(),p=""+this.toChineseMonth(c,v);return s&&p.length<2&&(p="0"+p),this.isIntercalaryMonth(c,v)&&(p+="i"),p},monthNames:function(a){if(typeof a=="string"){var s=a.match(e);return s?s[0]:""}var f=this._validateYear(a),c=a.month(),v=this.toChineseMonth(f,c),p=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][v-1];return this.isIntercalaryMonth(f,c)&&(p="闰"+p),p},monthNamesShort:function(a){if(typeof a=="string"){var s=a.match(t);return s?s[0]:""}var f=this._validateYear(a),c=a.month(),v=this.toChineseMonth(f,c),p=["一","二","三","四","五","六","七","八","九","十","十一","十二"][v-1];return this.isIntercalaryMonth(f,c)&&(p="闰"+p),p},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 v=s[s.length-1];c=v==="i"||v==="I"}var p=this.toMonthIndex(a,f,c);return p},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),v=f&&s!==c;if(v||s<1||s>12)throw ee.local.invalidMonth.replace(/\{0\}/,this.local.name);var p;return c?!f&&s<=c?p=s-1:p=s:p=s-1,p},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 ee.local.invalidMonth.replace(/\{0\}/,this.local.name);var v;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,ee.local.invalidyear),v=o[c-o[0]],p=v>>9&4095,T=v>>5&15,l=v&31,g;g=h.newDate(p,T,l),g.add(4-(g.dayOfWeek()||7),"d");var b=this.toJD(a,s,f)-g.toJD();return 1+Math.floor(b/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,v=c?12:11;if(s>v)throw ee.local.invalidMonth.replace(/\{0\}/,this.local.name);var p=f&1<<12-s?30:29;return p},weekDay:function(a,s,f){return(this.dayOfWeek(a,s,f)||7)<6},toJD:function(a,s,f){var c=this._validate(a,p,f,ee.local.invalidDate);a=this._validateYear(c.year()),s=c.month(),f=c.day();var v=this.isIntercalaryMonth(a,s),p=this.toChineseMonth(a,s),T=i(a,p,f,v);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],v=!!s[3],p=this.toMonthIndex(f,c,v),T=+s[4];return this.newDate(f,p,T)},add:function(a,s,f){var c=a.year(),v=a.month(),p=this.isIntercalaryMonth(c,v),T=this.toChineseMonth(c,v),l=Object.getPrototypeOf(x.prototype).add.call(this,a,s,f);if(f==="y"){var g=l.year(),b=l.month(),A=this.isIntercalaryMonth(g,T),E=p&&A?this.toMonthIndex(g,T,!0):this.toMonthIndex(g,T,!1);E!==b&&l.month(E)}return l}});var S=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,k=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;ee.calendars.chinese=x;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function n(a,s,f,c){var v,p;if(typeof a=="object")v=a,p=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");v={year:a,month:s,day:f},p={}}var b=o[v.year-o[0]],A=v.year<<9|v.month<<5|v.day;p.year=A>=b?v.year:v.year-1,b=o[p.year-o[0]];var E=b>>9&4095,_=b>>5&15,w=b&31,m,u=new Date(E,_-1,w),d=new Date(v.year,v.month-1,v.day);m=Math.round((d-u)/(24*3600*1e3));var y=r[p.year-r[0]],R;for(R=0;R<13;R++){var L=y&1<<12-R?30:29;if(m>13;return!z||R=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 b=typeof f=="number"&&f>=1&&f<=30;if(!b)throw new Error("Lunar day outside range 1 - 30");var A;typeof c=="object"?(A=!1,p=c):(A=!!c,p={}),T={year:a,month:s,day:f,isIntercalary:A}}var E;E=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,N=new Date(R,L-1,z+E);return p.year=N.getFullYear(),p.month=1+N.getMonth(),p.day=N.getDate(),p}}}),BR=_e({"node_modules/world-calendars/dist/calendars/coptic.js"(){var ee=Id(),X=Dh();function h(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}h.prototype=new ee.baseCalendar,X(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(k){var S=this._validate(k,this.minMonth,this.minDay,ee.local.invalidYear),k=S.year()+(S.year()<0?1:0);return k%4===3||k%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,ee.local.invalidYear||ee.regionalOptions[""].invalidYear),13},weekOfYear:function(x,S,k){var e=this.newDate(x,S,k);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,S){var k=this._validate(x,S,this.minDay,ee.local.invalidMonth);return this.daysPerMonth[k.month()-1]+(k.month()===13&&this.leapYear(k.year())?1:0)},weekDay:function(x,S,k){return(this.dayOfWeek(x,S,k)||7)<6},toJD:function(x,S,k){var e=this._validate(x,S,k,ee.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var S=Math.floor(x)+.5-this.jdEpoch,k=Math.floor((S-Math.floor((S+366)/1461))/365)+1;k<=0&&k--,S=Math.floor(x)+.5-this.newDate(k,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(k,e,t)}}),ee.calendars.coptic=h}}),UR=_e({"node_modules/world-calendars/dist/calendars/discworld.js"(){var ee=Id(),X=Dh();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new ee.baseCalendar,X(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,ee.local.invalidYear),!1},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,ee.local.invalidYear),13},daysInYear:function(S){return this._validate(S,this.minMonth,this.minDay,ee.local.invalidYear),400},weekOfYear:function(S,k,e){var t=this.newDate(S,k,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(S,k){var e=this._validate(S,k,this.minDay,ee.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(S,k,e){var t=this._validate(S,k,e,ee.local.invalidDate);return(t.day()+1)%8},weekDay:function(S,k,e){var t=this.dayOfWeek(S,k,e);return t>=2&&t<=6},extraInfo:function(S,k,e){var t=this._validate(S,k,e,ee.local.invalidDate);return{century:x[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(S,k,e){var t=this._validate(S,k,e,ee.local.invalidDate);return S=t.year()+(t.year()<0?1:0),k=t.month(),e=t.day(),e+(k>1?16:0)+(k>2?(k-2)*32:0)+(S-1)*400+this.jdEpoch-1},fromJD:function(S){S=Math.floor(S+.5)-Math.floor(this.jdEpoch)-1;var k=Math.floor(S/400)+1;S-=(k-1)*400,S+=S>15?16:0;var e=Math.floor(S/32)+1,t=S-(e-1)*32+1;return this.newDate(k<=0?k-1:k,e,t)}});var x={20:"Fruitbat",21:"Anchovy"};ee.calendars.discworld=h}}),jR=_e({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var ee=Id(),X=Dh();function h(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}h.prototype=new ee.baseCalendar,X(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(k){var S=this._validate(k,this.minMonth,this.minDay,ee.local.invalidYear),k=S.year()+(S.year()<0?1:0);return k%4===3||k%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,ee.local.invalidYear||ee.regionalOptions[""].invalidYear),13},weekOfYear:function(x,S,k){var e=this.newDate(x,S,k);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,S){var k=this._validate(x,S,this.minDay,ee.local.invalidMonth);return this.daysPerMonth[k.month()-1]+(k.month()===13&&this.leapYear(k.year())?1:0)},weekDay:function(x,S,k){return(this.dayOfWeek(x,S,k)||7)<6},toJD:function(x,S,k){var e=this._validate(x,S,k,ee.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var S=Math.floor(x)+.5-this.jdEpoch,k=Math.floor((S-Math.floor((S+366)/1461))/365)+1;k<=0&&k--,S=Math.floor(x)+.5-this.newDate(k,1,1).toJD();var e=Math.floor(S/30)+1,t=S-(e-1)*30+1;return this.newDate(k,e,t)}}),ee.calendars.ethiopian=h}}),VR=_e({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var ee=Id(),X=Dh();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new ee.baseCalendar,X(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 k=this._validate(S,this.minMonth,this.minDay,ee.local.invalidYear);return this._leapYear(k.year())},_leapYear:function(S){return S=S<0?S+1:S,x(S*7+1,19)<7},monthsInYear:function(S){return this._validate(S,this.minMonth,this.minDay,ee.local.invalidYear),this._leapYear(S.year?S.year():S)?13:12},weekOfYear:function(S,k,e){var t=this.newDate(S,k,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){var k=this._validate(S,this.minMonth,this.minDay,ee.local.invalidYear);return S=k.year(),this.toJD(S===-1?1:S+1,7,1)-this.toJD(S,7,1)},daysInMonth:function(S,k){return S.year&&(k=S.month(),S=S.year()),this._validate(S,k,this.minDay,ee.local.invalidMonth),k===12&&this.leapYear(S)||k===8&&x(this.daysInYear(S),10)===5?30:k===9&&x(this.daysInYear(S),10)===3?29:this.daysPerMonth[k-1]},weekDay:function(S,k,e){return this.dayOfWeek(S,k,e)!==6},extraInfo:function(S,k,e){var t=this._validate(S,k,e,ee.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(S,k,e){var t=this._validate(S,k,e,ee.local.invalidDate);S=t.year(),k=t.month(),e=t.day();var r=S<=0?S+1:S,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(k<7){for(var n=7;n<=this.monthsInYear(S);n++)o+=this.daysInMonth(S,n);for(var n=1;n=this.toJD(k===-1?1:k+1,7,1);)k++;for(var e=Sthis.toJD(k,e,this.daysInMonth(k,e));)e++;var t=S-this.toJD(k,e,1)+1;return this.newDate(k,e,t)}});function x(S,k){return S-k*Math.floor(S/k)}ee.calendars.hebrew=h}}),qR=_e({"node_modules/world-calendars/dist/calendars/islamic.js"(){var ee=Id(),X=Dh();function h(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}h.prototype=new ee.baseCalendar,X(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(x){var S=this._validate(x,this.minMonth,this.minDay,ee.local.invalidYear);return(S.year()*11+14)%30<11},weekOfYear:function(x,S,k){var e=this.newDate(x,S,k);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){return this.leapYear(x)?355:354},daysInMonth:function(x,S){var k=this._validate(x,S,this.minDay,ee.local.invalidMonth);return this.daysPerMonth[k.month()-1]+(k.month()===12&&this.leapYear(k.year())?1:0)},weekDay:function(x,S,k){return this.dayOfWeek(x,S,k)!==5},toJD:function(x,S,k){var e=this._validate(x,S,k,ee.local.invalidDate);return x=e.year(),S=e.month(),k=e.day(),x=x<=0?x+1:x,k+Math.ceil(29.5*(S-1))+(x-1)*354+Math.floor((3+11*x)/30)+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x)+.5;var S=Math.floor((30*(x-this.jdEpoch)+10646)/10631);S=S<=0?S-1:S;var k=Math.min(12,Math.ceil((x-29-this.toJD(S,1,1))/29.5)+1),e=x-this.toJD(S,k,1)+1;return this.newDate(S,k,e)}}),ee.calendars.islamic=h}}),GR=_e({"node_modules/world-calendars/dist/calendars/julian.js"(){var ee=Id(),X=Dh();function h(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}h.prototype=new ee.baseCalendar,X(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(k){var S=this._validate(k,this.minMonth,this.minDay,ee.local.invalidYear),k=S.year()<0?S.year()+1:S.year();return k%4===0},weekOfYear:function(x,S,k){var e=this.newDate(x,S,k);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,S){var k=this._validate(x,S,this.minDay,ee.local.invalidMonth);return this.daysPerMonth[k.month()-1]+(k.month()===2&&this.leapYear(k.year())?1:0)},weekDay:function(x,S,k){return(this.dayOfWeek(x,S,k)||7)<6},toJD:function(x,S,k){var e=this._validate(x,S,k,ee.local.invalidDate);return x=e.year(),S=e.month(),k=e.day(),x<0&&x++,S<=2&&(x--,S+=12),Math.floor(365.25*(x+4716))+Math.floor(30.6001*(S+1))+k-1524.5},fromJD:function(x){var S=Math.floor(x+.5),k=S+1524,e=Math.floor((k-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((k-t)/30.6001),o=r-Math.floor(r<14?1:13),n=e-Math.floor(o>2?4716:4715),i=k-t-Math.floor(30.6001*r);return n<=0&&n--,this.newDate(n,o,i)}}),ee.calendars.julian=h}}),HR=_e({"node_modules/world-calendars/dist/calendars/mayan.js"(){var ee=Id(),X=Dh();function h(k){this.local=this.regionalOptions[k||""]||this.regionalOptions[""]}h.prototype=new ee.baseCalendar,X(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(k){return this._validate(k,this.minMonth,this.minDay,ee.local.invalidYear),!1},formatYear:function(k){var e=this._validate(k,this.minMonth,this.minDay,ee.local.invalidYear);k=e.year();var t=Math.floor(k/400);k=k%400,k+=k<0?400:0;var r=Math.floor(k/20);return t+"."+r+"."+k%20},forYear:function(k){if(k=k.split("."),k.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(k){return this._validate(k,this.minMonth,this.minDay,ee.local.invalidYear),18},weekOfYear:function(k,e,t){return this._validate(k,e,t,ee.local.invalidDate),0},daysInYear:function(k){return this._validate(k,this.minMonth,this.minDay,ee.local.invalidYear),360},daysInMonth:function(k,e){return this._validate(k,e,this.minDay,ee.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(k,e,t){var r=this._validate(k,e,t,ee.local.invalidDate);return r.day()},weekDay:function(k,e,t){return this._validate(k,e,t,ee.local.invalidDate),!0},extraInfo:function(k,e,t){var r=this._validate(k,e,t,ee.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(k){k-=this.jdEpoch;var e=x(k+8+17*20,365);return[Math.floor(e/20)+1,x(e,20)]},_toTzolkin:function(k){return k-=this.jdEpoch,[S(k+20,20),S(k+4,13)]},toJD:function(k,e,t){var r=this._validate(k,e,t,ee.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(k){k=Math.floor(k)+.5-this.jdEpoch;var e=Math.floor(k/360);k=k%360,k+=k<0?360:0;var t=Math.floor(k/20),r=k%20;return this.newDate(e,t,r)}});function x(k,e){return k-e*Math.floor(k/e)}function S(k,e){return x(k-1,e)+1}ee.calendars.mayan=h}}),$R=_e({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var ee=Id(),X=Dh();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new ee.baseCalendar;var x=ee.instance("gregorian");X(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 k=this._validate(S,this.minMonth,this.minDay,ee.local.invalidYear||ee.regionalOptions[""].invalidYear);return x.leapYear(k.year()+(k.year()<1?1:0)+1469)},weekOfYear:function(S,k,e){var t=this.newDate(S,k,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,k){var e=this._validate(S,k,this.minDay,ee.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,k,e){return(this.dayOfWeek(S,k,e)||7)<6},toJD:function(r,k,e){var t=this._validate(r,k,e,ee.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),n=1;n=this.toJD(k+1,1,1);)k++;for(var e=S-Math.floor(this.toJD(k,1,1)+.5)+1,t=1;e>this.daysInMonth(k,t);)e-=this.daysInMonth(k,t),t++;return this.newDate(k,t,e)}}),ee.calendars.nanakshahi=h}}),WR=_e({"node_modules/world-calendars/dist/calendars/nepali.js"(){var ee=Id(),X=Dh();function h(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}h.prototype=new ee.baseCalendar,X(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(x){return this.daysInYear(x)!==this.daysPerYear},weekOfYear:function(x,S,k){var e=this.newDate(x,S,k);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){var S=this._validate(x,this.minMonth,this.minDay,ee.local.invalidYear);if(x=S.year(),typeof this.NEPALI_CALENDAR_DATA[x]>"u")return this.daysPerYear;for(var k=0,e=this.minMonth;e<=12;e++)k+=this.NEPALI_CALENDAR_DATA[x][e];return k},daysInMonth:function(x,S){return x.year&&(S=x.month(),x=x.year()),this._validate(x,S,this.minDay,ee.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[x]>"u"?this.daysPerMonth[S-1]:this.NEPALI_CALENDAR_DATA[x][S]},weekDay:function(x,S,k){return this.dayOfWeek(x,S,k)!==6},toJD:function(x,S,k){var e=this._validate(x,S,k,ee.local.invalidDate);x=e.year(),S=e.month(),k=e.day();var t=ee.instance(),r=0,o=S,n=x;this._createMissingCalendarData(x);var i=x-(o>9||o===9&&k>=this.NEPALI_CALENDAR_DATA[n][0]?56:57);for(S!==9&&(r=k,o--);o!==9;)o<=0&&(o=12,n--),r+=this.NEPALI_CALENDAR_DATA[n][o],o--;return S===9?(r+=k-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(x){var S=ee.instance(),k=S.fromJD(x),e=k.year(),t=k.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(x){var S=this.daysPerMonth.slice(0);S.unshift(17);for(var k=x-1;k"u"&&(this.NEPALI_CALENDAR_DATA[k]=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]}}),ee.calendars.nepali=h}}),YR=_e({"node_modules/world-calendars/dist/calendars/persian.js"(){var ee=Id(),X=Dh();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}function x(S){var k=S-475;S<0&&k++;var e=.242197,t=e*k,r=e*(k+1),o=t-Math.floor(t),n=r-Math.floor(r);return o>n}h.prototype=new ee.baseCalendar,X(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 k=this._validate(S,this.minMonth,this.minDay,ee.local.invalidYear);return x(k.year())},weekOfYear:function(S,k,e){var t=this.newDate(S,k,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(S,k){var e=this._validate(S,k,this.minDay,ee.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(S,k,e){return this.dayOfWeek(S,k,e)!==5},toJD:function(S,k,e){var t=this._validate(S,k,e,ee.local.invalidDate);S=t.year(),k=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 k=475+(S-this.toJD(475,1,1))/365.242197,e=Math.floor(k);e<=0&&e--,S>this.toJD(e,12,x(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)}}),ee.calendars.persian=h,ee.calendars.jalali=h}}),XR=_e({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var ee=Id(),X=Dh(),h=ee.instance();function x(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}x.prototype=new ee.baseCalendar,X(x.prototype,{name:"Taiwan",jdEpoch:24194025e-1,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(e){var k=this._validate(e,this.minMonth,this.minDay,ee.local.invalidYear),e=this._t2gYear(k.year());return h.leapYear(e)},weekOfYear:function(r,k,e){var t=this._validate(r,this.minMonth,this.minDay,ee.local.invalidYear),r=this._t2gYear(t.year());return h.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,k){var e=this._validate(S,k,this.minDay,ee.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,k,e){return(this.dayOfWeek(S,k,e)||7)<6},toJD:function(r,k,e){var t=this._validate(r,k,e,ee.local.invalidDate),r=this._t2gYear(t.year());return h.toJD(r,t.month(),t.day())},fromJD:function(S){var k=h.fromJD(S),e=this._g2tYear(k.year());return this.newDate(e,k.month(),k.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)}}),ee.calendars.taiwan=x}}),ZR=_e({"node_modules/world-calendars/dist/calendars/thai.js"(){var ee=Id(),X=Dh(),h=ee.instance();function x(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}x.prototype=new ee.baseCalendar,X(x.prototype,{name:"Thai",jdEpoch:15230985e-1,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var k=this._validate(e,this.minMonth,this.minDay,ee.local.invalidYear),e=this._t2gYear(k.year());return h.leapYear(e)},weekOfYear:function(r,k,e){var t=this._validate(r,this.minMonth,this.minDay,ee.local.invalidYear),r=this._t2gYear(t.year());return h.weekOfYear(r,t.month(),t.day())},daysInMonth:function(S,k){var e=this._validate(S,k,this.minDay,ee.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(S,k,e){return(this.dayOfWeek(S,k,e)||7)<6},toJD:function(r,k,e){var t=this._validate(r,k,e,ee.local.invalidDate),r=this._t2gYear(t.year());return h.toJD(r,t.month(),t.day())},fromJD:function(S){var k=h.fromJD(S),e=this._g2tYear(k.year());return this.newDate(e,k.month(),k.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)}}),ee.calendars.thai=x}}),KR=_e({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var ee=Id(),X=Dh();function h(S){this.local=this.regionalOptions[S||""]||this.regionalOptions[""]}h.prototype=new ee.baseCalendar,X(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 k=this._validate(S,this.minMonth,this.minDay,ee.local.invalidYear);return this.daysInYear(k.year())===355},weekOfYear:function(S,k,e){var t=this.newDate(S,k,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(S){for(var k=0,e=1;e<=12;e++)k+=this.daysInMonth(S,e);return k},daysInMonth:function(S,k){for(var e=this._validate(S,k,this.minDay,ee.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;ot)return x[r]-x[r-1];r++}return 30},weekDay:function(S,k,e){return this.dayOfWeek(S,k,e)!==5},toJD:function(S,k,e){var t=this._validate(S,k,e,ee.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+x[r-1]-1;return o+24e5-.5},fromJD:function(S){for(var k=S-24e5+.5,e=0,t=0;tk);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),n=o+1,i=r-12*o,a=k-x[e-1]+1;return this.newDate(n,i,a)},isValid:function(S,k,e){var t=ee.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(S=S.year!=null?S.year:S,t=S>=1276&&S<=1500),t},_validate:function(S,k,e,t){var r=ee.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),ee.calendars.ummalqura=h;var x=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),JR=_e({"src/components/calendars/calendars.js"(ee,X){X.exports=Id(),FR(),NR(),BR(),UR(),jR(),VR(),qR(),GR(),HR(),$R(),WR(),YR(),XR(),ZR(),KR()}}),QR=_e({"src/components/calendars/index.js"(ee,X){var h=JR(),x=kn(),S=qn(),k=S.EPOCHJD,e=S.ONEDAY,t={valType:"enumerated",values:x.sortObjectKeys(h.calendars),editType:"calc",dflt:"gregorian"},r=function(_,w,m,u){var d={};return d[m]=t,x.coerce(_,w,d,m,u)},o=function(_,w,m,u){for(var d=0;d * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT license. *//*! * repeat-string * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. *//*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *//*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT *//*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT *//*! Bundled license information: native-promise-only/lib/npo.src.js: (*! Native Promise Only v0.8.1 (c) Kyle Simpson MIT License: http://getify.mit-license.org *) polybooljs/index.js: (* * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc * @license MIT * @preserve Project Home: https://github.com/voidqk/polybooljs *) ieee754/index.js: (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) buffer/index.js: (*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT *) safe-buffer/index.js: (*! safe-buffer. MIT License. Feross Aboukhadijeh *) assert/build/internal/util/comparisons.js: (*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT *) object-assign/index.js: (* object-assign (c) Sindre Sorhus @license MIT *) maplibre-gl/dist/maplibre-gl.js: (** * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt *) */return window.Plotly=V,V})})(plotly);var plotlyExports=plotly.exports;const Plotly=getDefaultExportFromCjs(plotlyExports);function assertNotNull(be,M){if(be==null)throw new Error(`->${M} is null or undefined`)}function assertDefined(be,M){return typeof be>"u"?M:be}function assertMatrixElements(be,M,V){for(const[H,te]of V)assertNotNull(be[H],`Row ${M}[${H}][${te}]`),te!==void 0&&assertNotNull(be[H][te],`Col ${M}[${H}][${te}]`)}function assertValidMatrix(be,M){if(!be[0]||!be.length)throw new Error(`->${M} should be a valid matrix`)}function assertValidMatrices(be,M,V,H){if(assertValidMatrix(be,V),assertValidMatrix(M,H),M.length!==be[0].length)throw new Error(`Columns in ${V} should be the same as the number of rows in ${H}`)}function format(be,M){let V=Math.pow(10,M);return be.map(function(H,te){return H.map(function(ve){return Math.round(ve*V)/V})})}function clone(be){return be.map(M=>Array.from(new Float64Array(M)))}function multiply(be,M){assertValidMatrices(be,M,"a","b");const V=be.length,H=be[0].length,te=M[0].length,ve=new Float64Array(V*te);for(let Ee=0;EeArray(ve).fill(0));for(var Ee=0;EeArray(H).fill(0));for(var ve=0;veArray(be).fill(0));for(let V=0;VIr?mr*Math.sqrt(1+Ir*Ir/mr/mr):Ir==0?mr:Ir*Math.sqrt(1+mr*mr/Ir/Ir)}function tt(mr,Ir,On){let ba=assertDefined(On,0),ra=mr[ba],jn=Array(ra),qn;if(ba===mr.length-1){for(qn=ra-2;qn>=0;qn-=2)jn[qn+1]=Ir,jn[qn]=Ir;return qn===-1&&(jn[0]=Ir),jn}for(qn=ra-1;qn>=0;qn--)jn[qn]=tt(mr,Ir,ba+1);return jn}let _e=0,Gt=0,Qt=0,ir=0,Lr=0,jr=0,tn=0;for(fe=0;fe=0&&(Gt=-Gt),Qt=_e*Gt-tn,Me[fe][fe]=_e-Gt,Ee=Ce;Ee=0&&(Gt=-Gt),Qt=_e*Gt-tn,assertMatrixElements(Me,"u[i, i+1]",[[fe,fe+1]]),Me[fe][fe+1]=_e-Gt,Ee=Ce;Eeir&&(ir=Lr)}for(fe=F-1;fe!=-1;fe+=-1){if(Gt!=0){for(assertMatrixElements(Me,"u[i, i+1]",[[fe,fe+1]]),Qt=Gt*Me[fe][fe+1],Ee=Ce;Ee=te-1)throw`Error: no convergence for ${mr} exceeding ${te-1}`;for(ir=we[Ce],Lr=we[Re-1],Gt=he[Re-1],Qt=he[Re],_e=((Lr-jr)*(Lr+jr)+(Gt-Qt)*(Gt+Qt))/(2*Qt*Lr),Gt=ut(_e,1),_e<0?_e=((ir-jr)*(ir+jr)+Qt*(Lr/(_e-Gt)-Qt))/ir:_e=((ir-jr)*(ir+jr)+Qt*(Lr/(_e+Gt)-Qt))/ir,ve=1,tn=1,fe=Ce+1;fe=0;Ee--)if(we[Ee]te.eigenvalue).reduce((te,ve)=>te+ve);return M.map(te=>te.eigenvalue).reduce((te,ve)=>te+ve)/V}function getEigenVectors(be){return computeSVD(computeVarianceCovariance(computeDeviationScores(computeDeviationMatrix(be)),!1))}function analyseTopResult(be){let H=getEigenVectors(be).sort(function(te,ve){return ve.eigenvalue-te.eigenvalue})[0];return computeAdjustedData(be,H)}var PCACore=Object.freeze({__proto__:null,analyseTopResult,computeAdjustedData,computeDeviationMatrix,computeDeviationScores,computeOriginalData,computePercentageExplained,computeSVD,computeVarianceCovariance,getEigenVectors});typeof window<"u"&&(window.PCA=PCACore);function squaredEuclidean(be,M){let V=0;for(let H=0;Hfe&&(fe=Re,ve=Ee)}}else if(typeof H=="function"){let fe=Number.MAX_VALUE;for(let Ee=0;EeH)return!1;return!0}class KMeansResult{clusters;centroids;converged;iterations;distance;constructor(M,V,H,te,ve){this.clusters=M,this.centroids=V,this.converged=H,this.iterations=te,this.distance=ve}nearest(M){const V=new Array(M.length);return updateClusterID(M,this.centroids,V,this.distance)}computeInformation(M){const V=this.centroids.map(H=>({centroid:H,error:0,size:0}));for(let H=0;H0&&te!==-1?te/=V[H].size:V[H].error=-1}return V}}function assertUnreachable(be,M){throw new Error(`${M}: "${String(be)}"`)}function validateKmeansInput(be,M){if(M<=0||M>be.length||!Number.isInteger(M))throw new Error("K should be a positive integer smaller than the number of points")}var matrix={};const toString=Object.prototype.toString;function isAnyArray$1(be){const M=toString.call(be);return M.endsWith("Array]")&&!M.includes("Big")}const libEsm=Object.freeze(Object.defineProperty({__proto__:null,isAnyArray:isAnyArray$1},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(libEsm);function max(be){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!isAnyArray$1(be))throw new TypeError("input must be an array");if(be.length===0)throw new TypeError("input must not be empty");var V=M.fromIndex,H=V===void 0?0:V,te=M.toIndex,ve=te===void 0?be.length:te;if(H<0||H>=be.length||!Number.isInteger(H))throw new Error("fromIndex must be a positive integer smaller than length");if(ve<=H||ve>be.length||!Number.isInteger(ve))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var fe=be[H],Ee=H+1;Eefe&&(fe=be[Ee]);return fe}function min(be){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!isAnyArray$1(be))throw new TypeError("input must be an array");if(be.length===0)throw new TypeError("input must not be empty");var V=M.fromIndex,H=V===void 0?0:V,te=M.toIndex,ve=te===void 0?be.length:te;if(H<0||H>=be.length||!Number.isInteger(H))throw new Error("fromIndex must be a positive integer smaller than length");if(ve<=H||ve>be.length||!Number.isInteger(ve))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var fe=be[H],Ee=H+1;Ee1&&arguments[1]!==void 0?arguments[1]:{};if(isAnyArray$1(be)){if(be.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var V;if(M.output!==void 0){if(!isAnyArray$1(M.output))throw new TypeError("output option must be an array if specified");V=M.output}else V=new Array(be.length);var H=min(be),te=max(be);if(H===te)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var ve=M.min,fe=ve===void 0?M.autoMinMax?H:0:ve,Ee=M.max,Re=Ee===void 0?M.autoMinMax?te:1:Ee;if(fe>=Re)throw new RangeError("min option must be smaller than max option");for(var Ce=(Re-fe)/(te-H),Me=0;Me=0&&V?` ${formatNumber2(be,M-1)}`:formatNumber2(be,M)).padEnd(M)}function formatNumber2(be,M){let V=be.toString();if(V.length<=M)return V;let H=be.toFixed(M);if(H.length>M&&(H=be.toFixed(Math.max(0,M-(H.length-M)))),H.length<=M&&!H.startsWith("0.000")&&!H.startsWith("-0.000"))return H;let te=be.toExponential(M);return te.length>M&&(te=be.toExponential(Math.max(0,M-(te.length-M)))),te.slice(0)}function installMathOperations(be,M){be.prototype.add=function(H){return typeof H=="number"?this.addS(H):this.addM(H)},be.prototype.addS=function(H){for(let te=0;te>H);return this},be.prototype.signPropagatingRightShiftM=function(H){if(H=M.checkMatrix(H),this.rows!==H.rows||this.columns!==H.columns)throw new RangeError("Matrices dimensions must be equal");for(let te=0;te>H.get(te,ve));return this},be.signPropagatingRightShift=function(H,te){return new M(H).signPropagatingRightShift(te)},be.prototype.rightShift=function(H){return typeof H=="number"?this.rightShiftS(H):this.rightShiftM(H)},be.prototype.rightShiftS=function(H){for(let te=0;te>>H);return this},be.prototype.rightShiftM=function(H){if(H=M.checkMatrix(H),this.rows!==H.rows||this.columns!==H.columns)throw new RangeError("Matrices dimensions must be equal");for(let te=0;te>>H.get(te,ve));return this},be.rightShift=function(H,te){return new M(H).rightShift(te)},be.prototype.zeroFillRightShift=be.prototype.rightShift,be.prototype.zeroFillRightShiftS=be.prototype.rightShiftS,be.prototype.zeroFillRightShiftM=be.prototype.rightShiftM,be.zeroFillRightShift=be.rightShift,be.prototype.not=function(){for(let H=0;HH)throw new RangeError("Row index out of range")}function checkColumnIndex(be,M,V){let H=V?be.columns:be.columns-1;if(M<0||M>H)throw new RangeError("Column index out of range")}function checkRowVector(be,M){if(M.to1DArray&&(M=M.to1DArray()),M.length!==be.columns)throw new RangeError("vector size must be the same as the number of columns");return M}function checkColumnVector(be,M){if(M.to1DArray&&(M=M.to1DArray()),M.length!==be.rows)throw new RangeError("vector size must be the same as the number of rows");return M}function checkRowIndices(be,M){if(!isAnyArray.isAnyArray(M))throw new TypeError("row indices must be an array");for(let V=0;V=be.rows)throw new RangeError("row indices are out of range")}function checkColumnIndices(be,M){if(!isAnyArray.isAnyArray(M))throw new TypeError("column indices must be an array");for(let V=0;V=be.columns)throw new RangeError("column indices are out of range")}function checkRange(be,M,V,H,te){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(checkNumber("startRow",M),checkNumber("endRow",V),checkNumber("startColumn",H),checkNumber("endColumn",te),M>V||H>te||M<0||M>=be.rows||V<0||V>=be.rows||H<0||H>=be.columns||te<0||te>=be.columns)throw new RangeError("Submatrix indices are out of range")}function newArray(be,M=0){let V=[];for(let H=0;H=ve)throw new RangeError("min must be smaller than max");let Ee=ve-te,Re=new Matrix$1(M,V);for(let Ce=0;CeH?(ve=!0,H=V):(te=!1,ve=!0);M++}return te}isReducedEchelonForm(){let M=0,V=0,H=-1,te=!0,ve=!1;for(;MH?(ve=!0,H=V):(te=!1,ve=!0);for(let fe=V+1;feM.get(te,H)&&(te=ve);if(M.get(te,H)===0)H++;else{M.swapRows(V,te);let ve=M.get(V,H);for(let fe=H;fe=0;)if(M.maxRow(te)===0)te--;else{let ve=0,fe=!1;for(;veV[H]&&(V[H]=this.get(H,te));return V}case"column":{const V=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let H=0;HV[te]&&(V[te]=this.get(H,te));return V}case void 0:{let V=this.get(0,0);for(let H=0;HV&&(V=this.get(H,te));return V}default:throw new Error(`invalid option: ${M}`)}}maxIndex(){checkNonEmpty(this);let M=this.get(0,0),V=[0,0];for(let H=0;HM&&(M=this.get(H,te),V[0]=H,V[1]=te);return V}min(M){if(this.isEmpty())return NaN;switch(M){case"row":{const V=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let H=0;HV&&(V=this.get(M,H));return V}maxRowIndex(M){checkRowIndex(this,M),checkNonEmpty(this);let V=this.get(M,0),H=[M,0];for(let te=1;teV&&(V=this.get(M,te),H[1]=te);return H}minRow(M){if(checkRowIndex(this,M),this.isEmpty())return NaN;let V=this.get(M,0);for(let H=1;HV&&(V=this.get(H,M));return V}maxColumnIndex(M){checkColumnIndex(this,M),checkNonEmpty(this);let V=this.get(0,M),H=[0,M];for(let te=1;teV&&(V=this.get(te,M),H[0]=te);return H}minColumn(M){if(checkColumnIndex(this,M),this.isEmpty())return NaN;let V=this.get(0,M);for(let H=1;H=1;te/=2)te&1&&(V=V.mmul(H)),H=H.mmul(H);return V}strassen2x2(M){M=Matrix$1.checkMatrix(M);let V=new Matrix$1(2,2);const H=this.get(0,0),te=M.get(0,0),ve=this.get(0,1),fe=M.get(0,1),Ee=this.get(1,0),Re=M.get(1,0),Ce=this.get(1,1),Me=M.get(1,1),$=(H+Ce)*(te+Me),F=(Ee+Ce)*te,he=H*(fe-Me),we=Ce*(Re-te),He=(H+ve)*Me,ut=(Ee-H)*(te+fe),tt=(ve-Ce)*(Re+Me),_e=$+we-He+tt,Gt=he+He,Qt=F+we,ir=$-F+he+ut;return V.set(0,0,_e),V.set(0,1,Gt),V.set(1,0,Qt),V.set(1,1,ir),V}strassen3x3(M){M=Matrix$1.checkMatrix(M);let V=new Matrix$1(3,3);const H=this.get(0,0),te=this.get(0,1),ve=this.get(0,2),fe=this.get(1,0),Ee=this.get(1,1),Re=this.get(1,2),Ce=this.get(2,0),Me=this.get(2,1),$=this.get(2,2),F=M.get(0,0),he=M.get(0,1),we=M.get(0,2),He=M.get(1,0),ut=M.get(1,1),tt=M.get(1,2),_e=M.get(2,0),Gt=M.get(2,1),Qt=M.get(2,2),ir=(H+te+ve-fe-Ee-Me-$)*ut,Lr=(H-fe)*(-he+ut),jr=Ee*(-F+he+He-ut-tt-_e+Qt),tn=(-H+fe+Ee)*(F-he+ut),mr=(fe+Ee)*(-F+he),Ir=H*F,On=(-H+Ce+Me)*(F-we+tt),ba=(-H+Ce)*(we-tt),ra=(Ce+Me)*(-F+we),jn=(H+te+ve-Ee-Re-Ce-Me)*tt,qn=Me*(-F+we+He-ut-tt-_e+Gt),Un=(-ve+Me+$)*(ut+_e-Gt),pa=(ve-$)*(ut-Gt),lo=ve*_e,ji=(Me+$)*(-_e+Gt),Fo=(-ve+Ee+Re)*(tt+_e-Qt),Qo=(ve-Re)*(tt-Qt),Sl=(Ee+Re)*(-_e+Qt),Hs=te*He,Rl=Re*Gt,bs=fe*we,po=Ce*he,es=$*Qt,ef=Ir+lo+Hs,wf=ir+tn+mr+Ir+Un+lo+ji,Qu=Ir+On+ra+jn+lo+Fo+Sl,Zs=Lr+jr+tn+Ir+lo+Fo+Qo,jc=Lr+tn+mr+Ir+Rl,Hl=lo+Fo+Qo+Sl+bs,so=Ir+On+ba+qn+Un+pa+lo,Of=Un+pa+lo+ji+po,ch=Ir+On+ba+ra+es;return V.set(0,0,ef),V.set(0,1,wf),V.set(0,2,Qu),V.set(1,0,Zs),V.set(1,1,jc),V.set(1,2,Hl),V.set(2,0,so),V.set(2,1,Of),V.set(2,2,ch),V}mmulStrassen(M){M=Matrix$1.checkMatrix(M);let V=this.clone(),H=V.rows,te=V.columns,ve=M.rows,fe=M.columns;te!==ve&&console.warn(`Multiplying ${H} x ${te} and ${ve} x ${fe} matrix: dimensions do not match.`);function Ee($,F,he){let we=$.rows,He=$.columns;if(we===F&&He===he)return $;{let ut=AbstractMatrix.zeros(F,he);return ut=ut.setSubMatrix($,0,0),ut}}let Re=Math.max(H,ve),Ce=Math.max(te,fe);V=Ee(V,Re,Ce),M=Ee(M,Re,Ce);function Me($,F,he,we){if(he<=512||we<=512)return $.mmul(F);he%2===1&&we%2===1?($=Ee($,he+1,we+1),F=Ee(F,he+1,we+1)):he%2===1?($=Ee($,he+1,we),F=Ee(F,he+1,we)):we%2===1&&($=Ee($,he,we+1),F=Ee(F,he,we+1));let He=parseInt($.rows/2,10),ut=parseInt($.columns/2,10),tt=$.subMatrix(0,He-1,0,ut-1),_e=F.subMatrix(0,He-1,0,ut-1),Gt=$.subMatrix(0,He-1,ut,$.columns-1),Qt=F.subMatrix(0,He-1,ut,F.columns-1),ir=$.subMatrix(He,$.rows-1,0,ut-1),Lr=F.subMatrix(He,F.rows-1,0,ut-1),jr=$.subMatrix(He,$.rows-1,ut,$.columns-1),tn=F.subMatrix(He,F.rows-1,ut,F.columns-1),mr=Me(AbstractMatrix.add(tt,jr),AbstractMatrix.add(_e,tn),He,ut),Ir=Me(AbstractMatrix.add(ir,jr),_e,He,ut),On=Me(tt,AbstractMatrix.sub(Qt,tn),He,ut),ba=Me(jr,AbstractMatrix.sub(Lr,_e),He,ut),ra=Me(AbstractMatrix.add(tt,Gt),tn,He,ut),jn=Me(AbstractMatrix.sub(ir,tt),AbstractMatrix.add(_e,Qt),He,ut),qn=Me(AbstractMatrix.sub(Gt,jr),AbstractMatrix.add(Lr,tn),He,ut),Un=AbstractMatrix.add(mr,ba);Un.sub(ra),Un.add(qn);let pa=AbstractMatrix.add(On,ra),lo=AbstractMatrix.add(Ir,ba),ji=AbstractMatrix.sub(mr,Ir);ji.add(On),ji.add(jn);let Fo=AbstractMatrix.zeros(2*Un.rows,2*Un.columns);return Fo=Fo.setSubMatrix(Un,0,0),Fo=Fo.setSubMatrix(pa,Un.rows,0),Fo=Fo.setSubMatrix(lo,0,Un.columns),Fo=Fo.setSubMatrix(ji,Un.rows,Un.columns),Fo.subMatrix(0,he-1,0,we-1)}return Me(V,M,Re,Ce)}scaleRows(M={}){if(typeof M!="object")throw new TypeError("options must be an object");const{min:V=0,max:H=1}=M;if(!Number.isFinite(V))throw new TypeError("min must be a number");if(!Number.isFinite(H))throw new TypeError("max must be a number");if(V>=H)throw new RangeError("min must be smaller than max");let te=new Matrix$1(this.rows,this.columns);for(let ve=0;ve0&&rescale(fe,{min:V,max:H,output:fe}),te.setRow(ve,fe)}return te}scaleColumns(M={}){if(typeof M!="object")throw new TypeError("options must be an object");const{min:V=0,max:H=1}=M;if(!Number.isFinite(V))throw new TypeError("min must be a number");if(!Number.isFinite(H))throw new TypeError("max must be a number");if(V>=H)throw new RangeError("min must be smaller than max");let te=new Matrix$1(this.rows,this.columns);for(let ve=0;veH||V<0||V>=this.columns||H<0||H>=this.columns)throw new RangeError("Argument out of range");let te=new Matrix$1(M.length,H-V+1);for(let ve=0;ve=this.rows)throw new RangeError(`Row index out of range: ${M[ve]}`);te.set(ve,fe-V,this.get(M[ve],fe))}return te}subMatrixColumn(M,V,H){if(V===void 0&&(V=0),H===void 0&&(H=this.rows-1),V>H||V<0||V>=this.rows||H<0||H>=this.rows)throw new RangeError("Argument out of range");let te=new Matrix$1(H-V+1,M.length);for(let ve=0;ve=this.columns)throw new RangeError(`Column index out of range: ${M[ve]}`);te.set(fe-V,ve,this.get(fe,M[ve]))}return te}setSubMatrix(M,V,H){if(M=Matrix$1.checkMatrix(M),M.isEmpty())return this;let te=V+M.rows-1,ve=H+M.columns-1;checkRange(this,V,te,H,ve);for(let fe=0;fetypeof M=="number")}AbstractMatrix.random=AbstractMatrix.rand;AbstractMatrix.randomInt=AbstractMatrix.randInt;AbstractMatrix.diagonal=AbstractMatrix.diag;AbstractMatrix.prototype.diagonal=AbstractMatrix.prototype.diag;AbstractMatrix.identity=AbstractMatrix.eye;AbstractMatrix.prototype.negate=AbstractMatrix.prototype.neg;AbstractMatrix.prototype.tensorProduct=AbstractMatrix.prototype.kroneckerProduct;let Matrix$1=class _w extends AbstractMatrix{data;#e(M,V){if(this.data=[],Number.isInteger(V)&&V>=0)for(let H=0;H=0)this.#e(M,V);else if(isAnyArray.isAnyArray(M)){const H=M;if(M=H.length,V=M?H[0].length:0,typeof V!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let te=0;te"u"&&(V=M,M=this.columns),checkColumnIndex(this,M,!0),V=checkColumnVector(this,V);for(let H=0;H=0)this.#e=new Matrix$1(M,M);else if(this.#e=new Matrix$1(M),!this.isSymmetric())throw new TypeError("not symmetric data")}clone(){const M=new SymmetricMatrix(this.diagonalSize);for(const[V,H,te]of this.upperRightEntries())M.set(V,H,te);return M}toMatrix(){return new Matrix$1(this)}get(M,V){return this.#e.get(M,V)}set(M,V,H){return this.#e.set(M,V,H),this.#e.set(V,M,H),this}removeCross(M){return this.#e.removeRow(M),this.#e.removeColumn(M),this}addCross(M,V){V===void 0&&(V=M,M=this.diagonalSize);const H=V.slice();return H.splice(M,1),this.#e.addRow(M,H),this.#e.addColumn(M,V),this}applyMask(M){if(M.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const V=[];for(const[H,te]of M.entries())te||V.push(H);V.reverse();for(const H of V)this.removeCross(H);return this}toCompact(){const{diagonalSize:M}=this,V=new Array(M*(M+1)/2);for(let H=0,te=0,ve=0;ve=M&&(H=++te);return V}static fromCompact(M){const V=M.length,H=(Math.sqrt(8*V+1)-1)/2;if(!Number.isInteger(H))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(M)}`);const te=new SymmetricMatrix(H);for(let ve=0,fe=0,Ee=0;Ee=H&&(ve=++fe);return te}*upperRightEntries(){for(let M=0,V=0;M=this.diagonalSize&&(V=++M)}}*upperRightValues(){for(let M=0,V=0;M=this.diagonalSize&&(V=++M)}}SymmetricMatrix.prototype.klassType="SymmetricMatrix";class DistanceMatrix extends SymmetricMatrix{static isDistanceMatrix(M){return SymmetricMatrix.isSymmetricMatrix(M)&&M.klassSubType==="DistanceMatrix"}constructor(M){if(super(M),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(M,V,H){return M===V&&(H=0),super.set(M,V,H)}addCross(M,V){return V===void 0&&(V=M,M=this.diagonalSize),V=V.slice(),V[M]=0,super.addCross(M,V)}toSymmetricMatrix(){return new SymmetricMatrix(this)}clone(){const M=new DistanceMatrix(this.diagonalSize);for(const[V,H,te]of this.upperRightEntries())V!==H&&M.set(V,H,te);return M}toCompact(){const{diagonalSize:M}=this,V=(M-1)*M/2,H=new Array(V);for(let te=1,ve=0,fe=0;fe=M&&(te=++ve+1);return H}static fromCompact(M){const V=M.length;if(V===0)return new this(0);const H=(Math.sqrt(8*V+1)+1)/2;if(!Number.isInteger(H))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(M)}`);const te=new this(H);for(let ve=1,fe=0,Ee=0;Ee=H&&(ve=++fe+1);return te}}DistanceMatrix.prototype.klassSubType="DistanceMatrix";class BaseView extends AbstractMatrix{constructor(M,V,H){super(),this.matrix=M,this.rows=V,this.columns=H}}class MatrixColumnView extends BaseView{constructor(M,V){checkColumnIndex(M,V),super(M,M.rows,1),this.column=V}set(M,V,H){return this.matrix.set(M,this.column,H),this}get(M){return this.matrix.get(M,this.column)}}class MatrixColumnSelectionView extends BaseView{constructor(M,V){checkColumnIndices(M,V),super(M,M.rows,V.length),this.columnIndices=V}set(M,V,H){return this.matrix.set(M,this.columnIndices[V],H),this}get(M,V){return this.matrix.get(M,this.columnIndices[V])}}class MatrixFlipColumnView extends BaseView{constructor(M){super(M,M.rows,M.columns)}set(M,V,H){return this.matrix.set(M,this.columns-V-1,H),this}get(M,V){return this.matrix.get(M,this.columns-V-1)}}class MatrixFlipRowView extends BaseView{constructor(M){super(M,M.rows,M.columns)}set(M,V,H){return this.matrix.set(this.rows-M-1,V,H),this}get(M,V){return this.matrix.get(this.rows-M-1,V)}}class MatrixRowView extends BaseView{constructor(M,V){checkRowIndex(M,V),super(M,1,M.columns),this.row=V}set(M,V,H){return this.matrix.set(this.row,V,H),this}get(M,V){return this.matrix.get(this.row,V)}}class MatrixRowSelectionView extends BaseView{constructor(M,V){checkRowIndices(M,V),super(M,V.length,M.columns),this.rowIndices=V}set(M,V,H){return this.matrix.set(this.rowIndices[M],V,H),this}get(M,V){return this.matrix.get(this.rowIndices[M],V)}}class MatrixSelectionView extends BaseView{constructor(M,V,H){checkRowIndices(M,V),checkColumnIndices(M,H),super(M,V.length,H.length),this.rowIndices=V,this.columnIndices=H}set(M,V,H){return this.matrix.set(this.rowIndices[M],this.columnIndices[V],H),this}get(M,V){return this.matrix.get(this.rowIndices[M],this.columnIndices[V])}}class MatrixSubView extends BaseView{constructor(M,V,H,te,ve){checkRange(M,V,H,te,ve),super(M,H-V+1,ve-te+1),this.startRow=V,this.startColumn=te}set(M,V,H){return this.matrix.set(this.startRow+M,this.startColumn+V,H),this}get(M,V){return this.matrix.get(this.startRow+M,this.startColumn+V)}}class MatrixTransposeView extends BaseView{constructor(M){super(M,M.columns,M.rows)}set(M,V,H){return this.matrix.set(V,M,H),this}get(M,V){return this.matrix.get(V,M)}}class WrapperMatrix1D extends AbstractMatrix{constructor(M,V={}){const{rows:H=1}=V;if(M.length%H!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=H,this.columns=M.length/H,this.data=M}set(M,V,H){let te=this._calculateIndex(M,V);return this.data[te]=H,this}get(M,V){let H=this._calculateIndex(M,V);return this.data[H]}_calculateIndex(M,V){return M*this.columns+V}}class WrapperMatrix2D extends AbstractMatrix{constructor(M){super(),this.data=M,this.rows=M.length,this.columns=M[0].length}set(M,V,H){return this.data[M][V]=H,this}get(M,V){return this.data[M][V]}}function wrap(be,M){if(isAnyArray.isAnyArray(be))return be[0]&&isAnyArray.isAnyArray(be[0])?new WrapperMatrix2D(be):new WrapperMatrix1D(be,M);throw new Error("the argument is not an array")}class LuDecomposition{constructor(M){M=WrapperMatrix2D.checkMatrix(M);let V=M.clone(),H=V.rows,te=V.columns,ve=new Float64Array(H),fe=1,Ee,Re,Ce,Me,$,F,he,we,He;for(Ee=0;EeMath.abs(we[Me])&&(Me=Ee);if(Me!==Re){for(Ce=0;Ce=0;Ce--){for(Re=0;Refe?te.set(ve,fe,M.get(ve,fe)):ve===fe?te.set(ve,fe,1):te.set(ve,fe,0);return te}get upperTriangularMatrix(){let M=this.LU,V=M.rows,H=M.columns,te=new Matrix$1(V,H);for(let ve=0;veMath.abs(M)?(V=M/be,Math.abs(be)*Math.sqrt(1+V*V)):M!==0?(V=be/M,Math.abs(M)*Math.sqrt(1+V*V)):0}class QrDecomposition{constructor(M){M=WrapperMatrix2D.checkMatrix(M);let V=M.clone(),H=M.rows,te=M.columns,ve=new Float64Array(te),fe,Ee,Re,Ce;for(Re=0;Re=0;Ce--){for(Re=0;Re=0;Ee--){for(ve=0;ve=0;Ir--)if(we[Ir]!==0){for(let On=Ir+1;On=0;Ir--){if(Ir0;){let Ir,On;for(Ir=jr-2;Ir>=-1&&Ir!==-1;Ir--){const ba=Number.MIN_VALUE+mr*Math.abs(we[Ir]+Math.abs(we[Ir+1]));if(Math.abs(tt[Ir])<=ba||Number.isNaN(tt[Ir])){tt[Ir]=0;break}}if(Ir===jr-2)On=4;else{let ba;for(ba=jr-1;ba>=Ir&&ba!==Ir;ba--){let ra=(ba!==jr?Math.abs(tt[ba]):0)+(ba!==Ir+1?Math.abs(tt[ba-1]):0);if(Math.abs(we[ba])<=mr*ra){we[ba]=0;break}}ba===Ir?On=3:ba===jr-1?On=1:(On=2,Ir=ba)}switch(Ir++,On){case 1:{let ba=tt[jr-2];tt[jr-2]=0;for(let ra=jr-2;ra>=Ir;ra--){let jn=hypotenuse(we[ra],ba),qn=we[ra]/jn,Un=ba/jn;if(we[ra]=jn,ra!==Ir&&(ba=-Un*tt[ra-1],tt[ra-1]=qn*tt[ra-1]),Ce)for(let pa=0;pa=we[Ir+1]);){let ba=we[Ir];if(we[Ir]=we[Ir+1],we[Ir+1]=ba,Ce&&IrV&&ve.set(Me,$,M.get(Me,$)/this.s[$]);let fe=this.U,Ee=fe.rows,Re=fe.columns,Ce=new Matrix$1(H,Ee);for(let Me=0;MeM&&V++;return V}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return Matrix$1.diag(this.s)}}function inverse(be,M=!1){return be=WrapperMatrix2D.checkMatrix(be),M?new SingularValueDecomposition(be).inverse():solve(be,Matrix$1.eye(be.rows))}function solve(be,M,V=!1){return be=WrapperMatrix2D.checkMatrix(be),M=WrapperMatrix2D.checkMatrix(M),V?new SingularValueDecomposition(be).solve(M):be.isSquare()?new LuDecomposition(be).solve(M):new QrDecomposition(be).solve(M)}function determinant(be){if(be=Matrix$1.checkMatrix(be),be.isSquare()){if(be.columns===0)return 1;let M,V,H,te;if(be.columns===2)return M=be.get(0,0),V=be.get(0,1),H=be.get(1,0),te=be.get(1,1),M*te-V*H;if(be.columns===3){let ve,fe,Ee;return ve=new MatrixSelectionView(be,[1,2],[1,2]),fe=new MatrixSelectionView(be,[1,2],[0,2]),Ee=new MatrixSelectionView(be,[1,2],[0,1]),M=be.get(0,0),V=be.get(0,1),H=be.get(0,2),M*determinant(ve)-V*determinant(fe)+H*determinant(Ee)}else return new LuDecomposition(be).determinant}else throw Error("determinant can only be calculated for a square matrix")}function xrange(be,M){let V=[];for(let H=0;Hte)return new Array(M.rows+1).fill(0);{let ve=M.addRow(V,[0]);for(let fe=0;feM?ve[fe]=1/ve[fe]:ve[fe]=0;return te.mmul(Matrix$1.diag(ve).mmul(H.transpose()))}function covariance(be,M=be,V={}){be=new Matrix$1(be);let H=!1;if(typeof M=="object"&&!Matrix$1.isMatrix(M)&&!isAnyArray.isAnyArray(M)?(V=M,M=be,H=!0):M=new Matrix$1(M),be.rows!==M.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:te=!0}=V;te&&(be=be.center("column"),H||(M=M.center("column")));const ve=be.transpose().mmul(M);for(let fe=0;fe0?te.set(ve,ve+1,V[ve]):V[ve]<0&&te.set(ve,ve-1,V[ve])}return te}}function tred2(be,M,V,H){let te,ve,fe,Ee,Re,Ce,Me,$;for(Re=0;Re0;Ee--){for($=0,fe=0,Ce=0;Ce0&&(ve=-ve),M[Ee]=$*ve,fe=fe-te*ve,V[Ee-1]=te-ve,Re=0;ReCe)do{for(te=V[Ce],$=(V[Ce+1]-te)/(2*M[Ce]),F=hypotenuse($,1),$<0&&(F=-F),V[Ce]=M[Ce]/($+F),V[Ce+1]=M[Ce]*($+F),he=V[Ce+1],ve=te-V[Ce],fe=Ce+2;fe=Ce;fe--)for(ut=He,He=we,Gt=_e,te=we*M[fe],ve=we*$,F=hypotenuse($,M[fe]),M[fe+1]=_e*F,_e=M[fe]/F,we=$/F,$=we*V[fe]-_e*te,V[fe+1]=ve+_e*(we*te+_e*V[fe]),Re=0;ReLr*ir);V[Ce]=V[Ce]+Qt,M[Ce]=0}for(fe=0;fe=$;Ce--)V[Ce]=M.get(Ce,$-1)/F,Re+=V[Ce]*V[Ce];for(Ee=Math.sqrt(Re),V[$]>0&&(Ee=-Ee),Re=Re-V[$]*Ee,V[$]=V[$]-Ee,Me=$;Me=$;Ce--)fe+=V[Ce]*M.get(Ce,Me);for(fe=fe/Re,Ce=$;Ce<=ve;Ce++)M.set(Ce,Me,M.get(Ce,Me)-fe*V[Ce])}for(Ce=0;Ce<=ve;Ce++){for(fe=0,Me=ve;Me>=$;Me--)fe+=V[Me]*M.get(Ce,Me);for(fe=fe/Re,Me=$;Me<=ve;Me++)M.set(Ce,Me,M.get(Ce,Me)-fe*V[Me])}V[$]=F*V[$],M.set($,$-1,F*Ee)}}for(Ce=0;Ce=te+1;$--)if(M.get($,$-1)!==0){for(Ce=$+1;Ce<=ve;Ce++)V[Ce]=M.get(Ce,$-1);for(Me=$;Me<=ve;Me++){for(Ee=0,Ce=$;Ce<=ve;Ce++)Ee+=V[Ce]*H.get(Ce,Me);for(Ee=Ee/V[$]/M.get($,$-1),Ce=$;Ce<=ve;Ce++)H.set(Ce,Me,H.get(Ce,Me)+Ee*V[Ce])}}}function hqr2(be,M,V,H,te){let ve=be-1,fe=0,Ee=be-1,Re=Number.EPSILON,Ce=0,Me=0,$=0,F=0,he=0,we=0,He=0,ut=0,tt,_e,Gt,Qt,ir,Lr,jr,tn,mr,Ir,On,ba,ra,jn,qn;for(tt=0;ttEe)&&(V[tt]=te.get(tt,tt),M[tt]=0),_e=Math.max(tt-1,0);_e=fe;){for(Qt=ve;Qt>fe&&(we=Math.abs(te.get(Qt-1,Qt-1))+Math.abs(te.get(Qt,Qt)),we===0&&(we=Me),!(Math.abs(te.get(Qt,Qt-1))=0){for(He=$>=0?$+He:$-He,V[ve-1]=tn+He,V[ve]=V[ve-1],He!==0&&(V[ve]=tn-jr/He),M[ve-1]=0,M[ve]=0,tn=te.get(ve,ve-1),we=Math.abs(tn)+Math.abs(He),$=tn/we,F=He/we,he=Math.sqrt($*$+F*F),$=$/he,F=F/he,_e=ve-1;_e0)){for(we=Math.sqrt(we),mr=Qt&&(He=te.get(ir,ir),he=tn-He,we=mr-He,$=(he*we-jr)/te.get(ir+1,ir)+te.get(ir,ir+1),F=te.get(ir+1,ir+1)-He-he-we,he=te.get(ir+2,ir+1),we=Math.abs($)+Math.abs(F)+Math.abs(he),$=$/we,F=F/we,he=he/we,!(ir===Qt||Math.abs(te.get(ir,ir-1))*(Math.abs(F)+Math.abs(he))ir+2&&te.set(tt,tt-3,0);for(Gt=ir;Gt<=ve-1&&(jn=Gt!==ve-1,Gt!==ir&&($=te.get(Gt,Gt-1),F=te.get(Gt+1,Gt-1),he=jn?te.get(Gt+2,Gt-1):0,tn=Math.abs($)+Math.abs(F)+Math.abs(he),tn!==0&&($=$/tn,F=F/tn,he=he/tn)),tn!==0);Gt++)if(we=Math.sqrt($*$+F*F+he*he),$<0&&(we=-we),we!==0){for(Gt!==ir?te.set(Gt,Gt-1,-we*tn):Qt!==ir&&te.set(Gt,Gt-1,-te.get(Gt,Gt-1)),$=$+we,tn=$/we,mr=F/we,He=he/we,F=F/$,he=he/$,_e=Gt;_e=0;ve--)if($=V[ve],F=M[ve],F===0)for(Qt=ve,te.set(ve,ve,1),tt=ve-1;tt>=0;tt--){for(jr=te.get(tt,tt)-$,he=0,_e=Qt;_e<=ve;_e++)he=he+te.get(tt,_e)*te.get(_e,ve);if(M[tt]<0)He=jr,we=he;else if(Qt=tt,M[tt]===0?te.set(tt,ve,jr!==0?-he/jr:-he/(Re*Me)):(tn=te.get(tt,tt+1),mr=te.get(tt+1,tt),F=(V[tt]-$)*(V[tt]-$)+M[tt]*M[tt],Lr=(tn*we-He*he)/F,te.set(tt,ve,Lr),te.set(tt+1,ve,Math.abs(tn)>Math.abs(He)?(-he-jr*Lr)/tn:(-we-mr*Lr)/He)),Lr=Math.abs(te.get(tt,ve)),Re*Lr*Lr>1)for(_e=tt;_e<=ve;_e++)te.set(_e,ve,te.get(_e,ve)/Lr)}else if(F<0)for(Qt=ve-1,Math.abs(te.get(ve,ve-1))>Math.abs(te.get(ve-1,ve))?(te.set(ve-1,ve-1,F/te.get(ve,ve-1)),te.set(ve-1,ve,-(te.get(ve,ve)-$)/te.get(ve,ve-1))):(qn=cdiv(0,-te.get(ve-1,ve),te.get(ve-1,ve-1)-$,F),te.set(ve-1,ve-1,qn[0]),te.set(ve-1,ve,qn[1])),te.set(ve,ve-1,0),te.set(ve,ve,1),tt=ve-2;tt>=0;tt--){for(Ir=0,On=0,_e=Qt;_e<=ve;_e++)Ir=Ir+te.get(tt,_e)*te.get(_e,ve-1),On=On+te.get(tt,_e)*te.get(_e,ve);if(jr=te.get(tt,tt)-$,M[tt]<0)He=jr,he=Ir,we=On;else if(Qt=tt,M[tt]===0?(qn=cdiv(-Ir,-On,jr,F),te.set(tt,ve-1,qn[0]),te.set(tt,ve,qn[1])):(tn=te.get(tt,tt+1),mr=te.get(tt+1,tt),ba=(V[tt]-$)*(V[tt]-$)+M[tt]*M[tt]-F*F,ra=(V[tt]-$)*2*F,ba===0&&ra===0&&(ba=Re*Me*(Math.abs(jr)+Math.abs(F)+Math.abs(tn)+Math.abs(mr)+Math.abs(He))),qn=cdiv(tn*he-He*Ir+F*On,tn*we-He*On-F*Ir,ba,ra),te.set(tt,ve-1,qn[0]),te.set(tt,ve,qn[1]),Math.abs(tn)>Math.abs(He)+Math.abs(F)?(te.set(tt+1,ve-1,(-Ir-jr*te.get(tt,ve-1)+F*te.get(tt,ve))/tn),te.set(tt+1,ve,(-On-jr*te.get(tt,ve)-F*te.get(tt,ve-1))/tn)):(qn=cdiv(-he-mr*te.get(tt,ve-1),-we-mr*te.get(tt,ve),He,F),te.set(tt+1,ve-1,qn[0]),te.set(tt+1,ve,qn[1]))),Lr=Math.max(Math.abs(te.get(tt,ve-1)),Math.abs(te.get(tt,ve))),Re*Lr*Lr>1)for(_e=tt;_e<=ve;_e++)te.set(_e,ve-1,te.get(_e,ve-1)/Lr),te.set(_e,ve,te.get(_e,ve)/Lr)}for(tt=0;ttEe)for(_e=tt;_e=fe;_e--)for(tt=fe;tt<=Ee;tt++){for(He=0,Gt=fe;Gt<=Math.min(_e,Ee);Gt++)He=He+H.get(tt,Gt)*te.get(Gt,_e);H.set(tt,_e,He)}}}function cdiv(be,M,V,H){let te,ve;return Math.abs(V)>Math.abs(H)?(te=H/V,ve=V+te*H,[(be+te*M)/ve,(M-te*be)/ve]):(te=V/H,ve=H+te*V,[(te*be+M)/ve,(te*M-be)/ve])}class CholeskyDecomposition{constructor(M){if(M=WrapperMatrix2D.checkMatrix(M),!M.isSymmetric())throw new Error("Matrix is not symmetric");let V=M,H=V.rows,te=new Matrix$1(H,H),ve=!0,fe,Ee,Re;for(Ee=0;Ee0,te.set(Ee,Ee,Math.sqrt(Math.max(Ce,0))),Re=Ee+1;Re=0;Re--)for(Ee=0;Eefe;he++)$=M.transpose().mmul(Ee).div(Ee.transpose().mmul(Ee).get(0,0)),$=$.div($.norm()),Ce=M.mmul($).div($.transpose().mmul($).get(0,0)),he>0&&(Re=Ce.clone().sub(F).pow(2).sum()),F=Ce.clone(),H?(Me=H.transpose().mmul(Ce).div(Ce.transpose().mmul(Ce).get(0,0)),Me=Me.div(Me.norm()),Ee=H.mmul(Me).div(Me.transpose().mmul(Me).get(0,0))):Ee=Ce;if(H){let he=M.transpose().mmul(Ce).div(Ce.transpose().mmul(Ce).get(0,0));he=he.div(he.norm());let we=M.clone().sub(Ce.clone().mmul(he.transpose())),He=Ee.transpose().mmul(Ce).div(Ce.transpose().mmul(Ce).get(0,0)),ut=H.clone().sub(Ce.clone().mulS(He.get(0,0)).mmul(Me.transpose()));this.t=Ce,this.p=he.transpose(),this.w=$.transpose(),this.q=Me,this.u=Ee,this.s=Ce.transpose().mmul(Ce),this.xResidual=we,this.yResidual=ut,this.betas=He}else this.w=$.transpose(),this.s=Ce.transpose().mmul(Ce).sqrt(),te?this.t=Ce.clone().div(this.s.get(0,0)):this.t=Ce,this.xResidual=M.sub(Ce.mmul($.transpose()))}}matrix.AbstractMatrix=AbstractMatrix;matrix.CHO=CholeskyDecomposition;matrix.CholeskyDecomposition=CholeskyDecomposition;matrix.DistanceMatrix=DistanceMatrix;matrix.EVD=EigenvalueDecomposition;matrix.EigenvalueDecomposition=EigenvalueDecomposition;matrix.LU=LuDecomposition;matrix.LuDecomposition=LuDecomposition;var Matrix_1=matrix.Matrix=Matrix$1;matrix.MatrixColumnSelectionView=MatrixColumnSelectionView;matrix.MatrixColumnView=MatrixColumnView;matrix.MatrixFlipColumnView=MatrixFlipColumnView;matrix.MatrixFlipRowView=MatrixFlipRowView;matrix.MatrixRowSelectionView=MatrixRowSelectionView;matrix.MatrixRowView=MatrixRowView;matrix.MatrixSelectionView=MatrixSelectionView;matrix.MatrixSubView=MatrixSubView;matrix.MatrixTransposeView=MatrixTransposeView;matrix.NIPALS=nipals;matrix.Nipals=nipals;matrix.QR=QrDecomposition;matrix.QrDecomposition=QrDecomposition;matrix.SVD=SingularValueDecomposition;matrix.SingularValueDecomposition=SingularValueDecomposition;matrix.SymmetricMatrix=SymmetricMatrix;matrix.WrapperMatrix1D=WrapperMatrix1D;matrix.WrapperMatrix2D=WrapperMatrix2D;matrix.correlation=correlation;matrix.covariance=covariance;var _default=matrix.default=Matrix$1;matrix.determinant=determinant;matrix.inverse=inverse;matrix.linearDependencies=linearDependencies;matrix.pseudoInverse=pseudoInverse;matrix.solve=solve;matrix.wrap=wrap;const Matrix=Matrix_1;_default.Matrix&&_default.Matrix;const LOOP=8,FLOAT_MUL=1/16777216,sh1=15,sh2=18,sh3=11;function multiplyUint32(be,M){be>>>=0,M>>>=0;const V=be&65535;return((be-V)*M>>>0)+V*M>>>0}class XSadd{random;state;constructor(M=Date.now()){this.state=new Uint32Array(4),this.init(M),this.random=this.getFloat.bind(this)}getUint32(){return this.nextState(),this.state[3]+this.state[2]>>>0}getFloat(){return(this.getUint32()>>>8)*FLOAT_MUL}init(M){if(!Number.isInteger(M))throw new TypeError("seed must be an integer");this.state[0]=M,this.state[1]=0,this.state[2]=0,this.state[3]=0;for(let V=1;V>>30>>>0)>>>0;this.periodCertification();for(let V=0;V>>sh2,M^=this.state[3]<PROB_TOLERANCE)throw new Error(`probabilities should sum to 1, but instead sums to ${Ee.at(-1)}`)}if(!te&&H>fe.length)throw new Error("size option is too large");const Re=[];for(let Ce=0;CeV[te];)te++;return te}else return Math.floor(H*be)}class Random{randomGenerator;constructor(M=Math.random){if(typeof M=="number"){const V=new XSadd(M);this.randomGenerator=V.random}else this.randomGenerator=M}choice(M,V){return typeof M=="number"?randomChoice(M,V,this.randomGenerator):randomChoice(M,V,this.randomGenerator)}random(){return this.randomGenerator()}randInt(M,V){return V===void 0&&(V=M,M=0),M+Math.floor(this.randomGenerator()*(V-M))}randomSample(M){const V=[];for(let H=0;H1){const fe={dist:-1,index:-1};for(let Ee=0;Eefe.dist&&(fe.dist=V[ve[0]][Ee],fe.index=Ee);if(ve[1]=fe.index,M>2)for(let Ee=2;EeRe.dist&&(Re={...Me})}ve[Ee]=Re.index}}return ve.map(fe=>be[fe])}function kmeanspp(be,M,V={}){const H=new Matrix(be),te=H.rows,ve=new Random(V.seed),fe=[],Ee=V.localTrials||2+Math.floor(Math.log(M)),Re=ve.randInt(te);fe.push(H.getRow(Re));let Ce=new Matrix(1,H.rows);for(let he=0;hett+_e,0);const we=[];for(const[tt,_e]of he.entries()){const Gt=_e,Qt=Me.get(tt).size,ir=Math.log(1+Re/Qt),Lr=Gt*ir;we.push({word:tt,score:Lr})}we.sort((tt,_e)=>_e.score-tt.score);const He=we.slice(0,5).map(tt=>tt.word),ut=He.slice(0,3).join("_")||`Topic ${$}`;Ee.push({id:$,label:ut,keywords:He,docs:F.docs,indices:F.indices,embeddings:F.indices.map(tt=>V[tt])})}return Ee.sort(($,F)=>$.id-F.id)}_cluster(M,V){return{clusters:kmeans(M,V,{initialization:"kmeans++"}).clusters}}_countWords(M){const V=new Map;for(const H of M){const te=H.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter(ve=>ve.length>2&&!this.stopWords.has(ve));for(const ve of te)V.set(ve,(V.get(ve)||0)+1)}return V}}env$1.allowLocalModels=!1;env$1.backends.onnx.wasm.wasmPaths="https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/";const colors={red:{dark:"#F22C3D"},orange:{dark:"#FF5828"},teal:{dark:"#21B5C2"},mustard:{dark:"#EA9100"},violet:{dark:"#5436DA"},"bright-green":{dark:"#00DE22"},"bright-blue":{dark:"#00B7FF"},pink:{dark:"#F2BAFF"},olive:{dark:"#7E813C"},navy:{dark:"#1D0D4C"}},topicColors=[colors.orange.dark,colors["bright-green"].dark,colors["bright-blue"].dark,colors.violet.dark,colors.pink.dark,colors.teal.dark,colors.red.dark,colors.mustard.dark,colors.olive.dark,colors.navy.dark],bp=580;function getMarkerSize(be){return be>bp?8:6}function addBr(be){let M="";return be=be||"",be.trim().split("").forEach(function(V,H){M=M+V,H!==0&&H%30===0&&(M=M+"
")}),M}class EmbeddingManager{constructor(){this.pipe=null,this.modelId="onnx-community/Qwen3-Embedding-0.6B-ONNX"}async loadModel(M){this.pipe||(M("Loading model (WebGPU/WASM)..."),this.pipe=await pipeline("feature-extraction",this.modelId,{}),M("Model ready."))}async generateEmbeddings(M,V){if(!this.pipe)throw new Error("Model not loaded");const H=[];for(let te=0;tesetTimeout(Re,0))}return H}}class DimensionalityReducer{static reduce(M,V=3){if(M.length{const Me=Ce.slice(0,V);for(;Me.lengthCe.eigenvector),ve=M.length,fe=V,Ee=[],Re=(Ce,Me)=>Ce.reduce(($,F,he)=>$+F*Me[he],0);for(let Ce=0;Ce{Plotly.Plots.resize(this.divId)})}updatePoints(M,V,H=null,te=null){const ve=this.container.offsetWidth||window.innerWidth*.9,fe=getMarkerSize(ve),Ee=[];if(H){const Me=new Map;M.forEach(($,F)=>{const he=H[F],we=he?he.id:"unknown";Me.has(we)||Me.set(we,{x:[],y:[],z:[],text:[],name:he?he.label:"Unknown",color:he?topicColors[he.id%topicColors.length]:"#999"});const He=Me.get(we);He.x.push($[0]),He.y.push($[1]),He.z.push($[2]),He.text.push(addBr(V[F]))});for(const[$,F]of Me.entries())Ee.push({x:F.x,y:F.y,z:F.z,mode:"markers",name:F.name,marker:{color:F.color,size:fe,opacity:.8,line:{color:"rgba(255, 255, 255, 0.2)",width:.5}},text:F.text,hoverinfo:"text+name",hoverlabel:{bgcolor:"#fff",bordercolor:"#fff",font:{color:"#050505",family:"Inter, sans-serif"}},type:"scatter3d"})}else{const Me=M.map(($,F)=>topicColors[F%topicColors.length]);Ee.push({x:M.map($=>$[0]),y:M.map($=>$[1]),z:M.map($=>$[2]),mode:"markers",marker:{color:Me,size:fe,opacity:.8,line:{color:"rgba(255, 255, 255, 0.2)",width:.5}},text:V.map($=>addBr($)),hoverinfo:"text",hoverlabel:{bgcolor:"#fff",bordercolor:"#fff",font:{color:"#050505",family:"Inter, sans-serif"}},type:"scatter3d"})}const Re={autosize:!0,height:480,margin:{l:0,r:0,b:0,t:0},paper_bgcolor:"#fff",showlegend:!0,legend:{x:0,y:1},scene:{xaxis:{tickfont:{size:10,color:"rgb(107, 107, 107)"},title:""},yaxis:{tickfont:{size:10,color:"rgb(107, 107, 107)"},title:""},zaxis:{tickfont:{size:10,color:"rgb(107, 107, 107)"},title:""},aspectmode:"cube",camera:{eye:{x:1.5,y:1.5,z:1.5}}}},Ce={modeBarButtonsToRemove:["pan3d","resetCameraLastSave3d","toImage","tableRotation"],displaylogo:!1,responsive:!0,displayModeBar:!1};Plotly.newPlot(this.divId,Ee,Re,Ce)}startRotation(){this.animationFrame&&cancelAnimationFrame(this.animationFrame);let M=0;const V=()=>{M+=.002;const H=1.8;Plotly.relayout(this.divId,{"scene.camera.eye":{x:H*Math.cos(M),y:H*Math.sin(M),z:1.5}}),this.animationFrame=requestAnimationFrame(V)};V()}}const app={embeddingManager:new EmbeddingManager,topicModeler:new TopicModeler,visualizer:new PlotlyVisualizer("chart-div"),init:async()=>{const be=document.getElementById("text-input"),M=document.getElementById("generate-btn"),V=document.getElementById("loader"),H=document.getElementById("btn-text"),te=document.getElementById("status-msg");try{await app.embeddingManager.loadModel(ve=>{te.textContent=ve})}catch(ve){console.error(ve),te.textContent="Error loading model. Check console.";return}M.addEventListener("click",async()=>{const ve=be.value.trim();if(!ve)return;const fe=ve.split(` `).map(Ee=>Ee.trim()).filter(Ee=>Ee.length>0);if(fe.length!==0){M.disabled=!0,H.style.display="none",V&&(V.style.display="inline-block"),te.textContent=`Generating embeddings for ${fe.length} items...`;try{const Ee=document.getElementById("progress-container"),Re=document.getElementById("progress-bar"),Ce=document.getElementById("progress-label");Ee&&(Ee.style.display="block",Ee.classList.remove("hidden"),Re.style.width="0%");const Me=(He,ut,tt)=>{const _e=Math.round(He/ut*100);Re&&(Re.style.width=`${_e}%`),Ce&&(Ce.textContent=`${_e}% - Generated for "${tt.slice(0,15)}..."`)},$=await app.embeddingManager.generateEmbeddings(fe,Me),F=DimensionalityReducer.reduce($,3);te.textContent="Clustering and identifying topics...",await new Promise(He=>setTimeout(He,10));const he=app.topicModeler.run(fe,$);console.log("Topics found:",he);const we=new Array(fe.length);he.forEach(He=>{He.indices?He.indices.forEach(ut=>{we[ut]={id:He.id,label:He.label}}):He.docs.forEach(ut=>{})}),app.visualizer.updatePoints(F,fe,we),te.textContent=`Visualizing ${fe.length} items in ${he.length} topics.`,Ee&&(Ee.style.display="none")}catch(Ee){console.error(Ee),te.textContent="Error: "+Ee.message}finally{M.disabled=!1,H.style.display="inline",V&&(V.style.display="none")}}})}};app.init();