@abi-software/flatmapvuer 1.4.4 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flatmapvuer.js +3910 -3856
- package/dist/flatmapvuer.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/FlatmapVuer.vue +6 -6
- package/src/services/flatmapQueries.js +133 -14
package/dist/flatmapvuer.umd.cjs
CHANGED
|
@@ -30,7 +30,7 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
|
30
30
|
<circle cx="12.5" cy="12.5" r="9" fill="#fff"></circle>
|
|
31
31
|
<text x="12" y="17.5" style="font-size:14px;fill:#000;text-anchor:middle">2</text>
|
|
32
32
|
</svg>
|
|
33
|
-
</div>`,Qv=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},Xc={},Dk=async function(t,e){return Xc&&Xc.hasOwnProperty(e)?Xc[e]:new Promise(r=>{fetch(`${t}knowledge/label/${e}`,{method:"GET"}).then(n=>n.json()).then(n=>{let i=n.label;i==="Mammalia"&&(i="Mammalia not otherwise specified"),Xc[e]=i,r(i)}).catch(n=>{console.error("Error:",n),Xc[e]=e,r(e)})})},Bk=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1};let A2t=function(){this.initialise=function(t){this.flatmapApi=t,this.destinations=[],this.origins=[],this.components=[],this.urls=[],this.controller=void 0,this.uberons=[],this.lookUp=[]},this.createTooltipData=async function(t){let e=[];t.feature.hyperlinks&&t.feature.hyperlinks.length>0?e=t.feature.hyperlinks:e=this.urls.map(i=>({url:i,id:"pubmed"}));let r;if(t.provenanceTaxonomy){r=[];for(let i=0;t.provenanceTaxonomy.length>i;i++)r.push(await Dk(this.flatmapAPI,t.provenanceTaxonomy[i]))}return{destinations:this.destinations,origins:this.origins,components:this.components,destinationsWithDatasets:this.destinationsWithDatasets,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,title:t.label,featureId:t.resource,hyperlinks:e,provenanceTaxonomy:t.provenanceTaxonomy,provenanceTaxonomyLabel:r}},this.createComponentsLabelList=function(t,e){let r=[];return t.forEach(n=>{r.push(this.createLabelFromNeuralNode(n[0]),e),n.length===2&&r.push(this.createLabelFromNeuralNode(n[1]),e)}),r},this.createLabelLookup=function(t){return new Promise(e=>{let r={};this.uberons=[];const n={sql:this.buildLabelSqlStatement(t)};fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(i=>i.json()).then(i=>{const o=i.keys.indexOf("entity"),s=i.keys.indexOf("label");o>-1&&s>-1&&i.values.forEach(a=>{r[a[o]]=a[s],this.uberons.push({id:a[o],name:a[s]})}),e(r)})})},this.buildConnectivitySqlStatement=function(t){let e="select knowledge from knowledge where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.buildLabelSqlStatement=function(t){let e="select entity, label from labels where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.findAllIdsFromConnectivity=function(t){let e=t.connectivity.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),[...new Set(n.flat())]},this.flattenConntectivity=function(t){let e=t.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(t){let e=t.connectivity.flat(),r=Qv(e),n=[],i=!1;return r.forEach(o=>{i=!1,Bk(t.axons,o)&&(i=!0),Bk(t.dendrites,o)&&(i=!0),i||n.push(o)}),n},this.retrieveFlatmapKnowledgeForEvent=async function(t){this.controller&&this.controller.abort(),this.controller=new AbortController;const e=this.controller.signal,r=t.resource;if(this.destinations=[],this.origins=[],this.components=[],!r||r.length==0)return;let n=this.queryForConnectivity(r,e),i=await this.pubmedQueryOnIds(t);return await Promise.all([n,i])},this.queryForConnectivity=function(t,e,r=!0){const n={sql:this.buildConnectivitySqlStatement(t)},i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),...e?{signal:e}:{}};return new Promise(o=>{fetch(`${this.flatmapApi}knowledge/query/`,i).then(s=>s.json()).then(s=>{if(this.connectivityExists(s)){let a=JSON.parse(s.values[0][0]);r?this.processConnectivity(a).then(u=>{o(u)}):o(a)}else o(!1)}).catch(s=>{s.name==="AbortError"||console.error("Error:",s),o(!1)})})},this.connectivityExists=function(t){return!!(t.values&&t.values.length>0&&JSON.parse(t.values[0][0]).connectivity&&JSON.parse(t.values[0][0]).connectivity.length>0)},this.findIfNodeIsSingle=function(t){return t.length===1?(console.error("Server returns a single node",t),t[0]):t.length===2&&t[1].length===0?t[0]:!1},this.createLabelFromNeuralNode=function(t,e){let r=this.findIfNodeIsSingle(t);if(r)return e[r];let n=e[t[0]];return t.length===2&&t[1].length>0&&t[1].forEach(i=>{e[i]==null?n+=`, ${i}`:n+=`, ${e[i]}`}),n},this.flattenAndFindDatasets=function(t,e,r){let n=this.flattenConntectivity(t),i=this.flattenConntectivity(e),o=this.flattenConntectivity(r);this.destinationsWithDatasets=this.uberons.filter(s=>i.indexOf(s.id)!==-1),this.originsWithDatasets=this.uberons.filter(s=>o.indexOf(s.id)!==-1),this.componentsWithDatasets=this.uberons.filter(s=>n.indexOf(s.id)!==-1)},this.processConnectivity=function(t){return new Promise(e=>{let r=this.findComponents(t),n=Qv(t.axons),i=Qv(t.dendrites),o=this.findAllIdsFromConnectivity(t);this.createLabelLookup(o).then(s=>{this.destinations=n.map(a=>this.createLabelFromNeuralNode(a,s)),this.origins=i.map(a=>this.createLabelFromNeuralNode(a,s)),this.components=r.map(a=>this.createLabelFromNeuralNode(a,s)),this.flattenAndFindDatasets(r,n,i),e({ids:{axons:n,dendrites:i,components:r},labels:{destinations:this.destinations,origins:this.origins,components:this.components}})})})},this.flattenConntectivity=function(t){let e=t.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.stripPMIDPrefix=function(t){return t.split(":")[1]},this.buildPubmedSqlStatement=function(t){let e="select distinct publication from publications where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.buildPubmedSqlStatementForModels=function(t){return`select distinct publication from publications where entity = '${t}'`},this.flatmapQuery=function(t){const e={sql:t};return fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(r=>r.json()).catch(r=>{console.error("Error:",r)})},this.pubmedQueryOnIds=function(t){return new Promise(e=>{const r=t.resource,n=t.feature.source;if(!r||r.length===0)return;const i=this.buildPubmedSqlStatement(r);this.flatmapQuery(i).then(o=>{o.values.length>0?(this.urls=[this.pubmedSearchUrl(o.values.map(s=>this.stripPMIDPrefix(s[0])))],e(!0)):this.pubmedQueryOnModels(n).then(s=>{e(s)})})})},this.pubmedQueryOnModels=function(t){return this.flatmapQuery(this.buildPubmedSqlStatementForModels(t)).then(e=>Array.isArray(e.values)&&e.values.length>0?(this.urls=[this.pubmedSearchUrl(e.values.map(r=>this.stripPMIDPrefix(r[0])))],!0):(this.urls=[],!1))},this.pubmedSearchUrl=function(t){let e="https://pubmed.ncbi.nlm.nih.gov/?",r=new URLSearchParams;const n=t.map(i=>decodeURIComponent(i));return r.append("term",n),e+r.toString()}};const O2t='<svg width="195px" height="24px" viewBox="0 0 200 24" fill="yellow"><path d="M22.0748 3.25583C22.4141 2.42845 23.5859 2.42845 23.9252 3.25583L25.6493 7.45955C25.793 7.80979 26.1221 8.04889 26.4995 8.07727L31.0303 8.41798C31.922 8.48504 32.2841 9.59942 31.6021 10.1778L28.1369 13.1166C27.8482 13.3614 27.7225 13.7483 27.8122 14.1161L28.8882 18.5304C29.1 19.3992 28.152 20.0879 27.3912 19.618L23.5255 17.2305C23.2034 17.0316 22.7966 17.0316 22.4745 17.2305L18.60881 19.618C17.84796 20.0879 16.9 19.3992 17.1118 18.5304L18.18785 14.1161C18.2775 13.7483 18.1518 13.3614 17.86309 13.1166L14.3979 10.1778C13.71588 9.59942 14.07796 8.48504 14.96971 8.41798L19.50046 8.07727C19.87794 8.04889 20.20704 7.80979 20.35068 7.45955L22.0748 3.25583Z" stroke="#000000" stroke-width="2"/><text x="47" y="52%" style="white-space: pre" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#333333">Featured dataset marker</text></svg>';var Fk={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(typeof window<"u"?window:mst,function(){if(typeof window>"u")return null;var r=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),n=r.requestAnimationFrame||r.mozRequestAnimationFrame||r.webkitRequestAnimationFrame||function(f){return r.setTimeout(f,20)},i=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||function(f){r.clearTimeout(f)};function o(f,T){var Q=Object.prototype.toString.call(f),_=Q==="[object Array]"||Q==="[object NodeList]"||Q==="[object HTMLCollection]"||Q==="[object Object]"||typeof jQuery<"u"&&f instanceof jQuery||typeof Elements<"u"&&f instanceof Elements,w=0,b=f.length;if(_)for(;w<b;w++)T(f[w]);else T(f)}function s(f){if(!f.getBoundingClientRect)return{width:f.offsetWidth,height:f.offsetHeight};var T=f.getBoundingClientRect();return{width:Math.round(T.width),height:Math.round(T.height)}}function a(f,T){Object.keys(T).forEach(function(Q){f.style[Q]=T[Q]})}var u=function(f,T){var Q=0;function _(){var b=[];this.add=function(O){b.push(O)};var S,E;this.call=function(O){for(S=0,E=b.length;S<E;S++)b[S].call(this,O)},this.remove=function(O){var I=[];for(S=0,E=b.length;S<E;S++)b[S]!==O&&I.push(b[S]);b=I},this.length=function(){return b.length}}function w(b,S){if(b){if(b.resizedAttached){b.resizedAttached.add(S);return}b.resizedAttached=new _,b.resizedAttached.add(S),b.resizeSensor=document.createElement("div"),b.resizeSensor.dir="ltr",b.resizeSensor.className="resize-sensor";var E={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},O={position:"absolute",left:"0px",top:"0px",transition:"0s"};a(b.resizeSensor,E);var I=document.createElement("div");I.className="resize-sensor-expand",a(I,E);var D=document.createElement("div");a(D,O),I.appendChild(D);var j=document.createElement("div");j.className="resize-sensor-shrink",a(j,E);var $=document.createElement("div");a($,O),a($,{width:"200%",height:"200%"}),j.appendChild($),b.resizeSensor.appendChild(I),b.resizeSensor.appendChild(j),b.appendChild(b.resizeSensor);var G=window.getComputedStyle(b),tt=G?G.getPropertyValue("position"):null;tt!=="absolute"&&tt!=="relative"&&tt!=="fixed"&&tt!=="sticky"&&(b.style.position="relative");var it=!1,lt=0,rt=s(b),gt=0,Pt=0,Gt=!0;Q=0;var re=function(){var ee=b.offsetWidth,he=b.offsetHeight;D.style.width=ee+10+"px",D.style.height=he+10+"px",I.scrollLeft=ee+10,I.scrollTop=he+10,j.scrollLeft=ee+10,j.scrollTop=he+10},_e=function(){if(Gt){var ee=b.offsetWidth===0&&b.offsetHeight===0;if(ee){Q||(Q=n(function(){Q=0,_e()}));return}else Gt=!1}re()};b.resizeSensor.resetSensor=_e;var de=function(){lt=0,it&&(gt=rt.width,Pt=rt.height,b.resizedAttached&&b.resizedAttached.call(rt))},Ke=function(){rt=s(b),it=rt.width!==gt||rt.height!==Pt,it&&!lt&&(lt=n(de)),_e()},Mr=function(ee,he,be){ee.attachEvent?ee.attachEvent("on"+he,be):ee.addEventListener(he,be)};Mr(I,"scroll",Ke),Mr(j,"scroll",Ke),Q=n(function(){Q=0,_e()})}}o(f,function(b){w(b,T)}),this.detach=function(b){Q||(i(Q),Q=0),u.detach(f,b)},this.reset=function(){f.resizeSensor.resetSensor()}};if(u.reset=function(f){o(f,function(T){T.resizeSensor.resetSensor()})},u.detach=function(f,T){o(f,function(Q){Q&&(Q.resizedAttached&&typeof T=="function"&&(Q.resizedAttached.remove(T),Q.resizedAttached.length())||Q.resizeSensor&&(Q.contains(Q.resizeSensor)&&Q.removeChild(Q.resizeSensor),delete Q.resizeSensor,delete Q.resizedAttached))})},typeof MutationObserver<"u"){var d=new MutationObserver(function(f){for(var T in f)if(f.hasOwnProperty(T))for(var Q=f[T].addedNodes,_=0;_<Q.length;_++)Q[_].resizeSensor&&u.reset(Q[_])});document.addEventListener("DOMContentLoaded",function(f){d.observe(document.body,{childList:!0,subtree:!0})})}return u})})(Fk);var k2t=Fk.exports;const I2t=gst(k2t);var P2t=Object.defineProperty,V2t=(t,e,r)=>e in t?P2t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ft=(t,e,r)=>(V2t(t,typeof e!="symbol"?e+"":e,r),r),mv=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},ut=(t,e,r)=>(mv(t,e,"read from private field"),r?r.call(t):e.get(t)),te=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},me=(t,e,r,n)=>(mv(t,e,"write to private field"),e.set(t,r),r),ae=(t,e,r)=>(mv(t,e,"access private method"),r);function R2t(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function u3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function jk(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var f1=function(t){try{return!!t()}catch{return!0}},N2t=f1,gv=!N2t(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),zk=gv,Uk=Function.prototype,yv=Uk.call,D2t=zk&&Uk.bind.bind(yv,yv),Io=zk?D2t:function(t){return function(){return yv.apply(t,arguments)}},Gk=Io,B2t=Gk({}.toString),F2t=Gk("".slice),Kc=function(t){return F2t(B2t(t),8,-1)},j2t=Io,z2t=f1,U2t=Kc,_v=Object,G2t=j2t("".split),$2t=z2t(function(){return!_v("z").propertyIsEnumerable(0)})?function(t){return U2t(t)==="String"?G2t(t,""):_v(t)}:_v,Yc=function(t){return t==null},Z2t=Yc,W2t=TypeError,ip=function(t){if(Z2t(t))throw new W2t("Can't call method on "+t);return t},q2t=$2t,X2t=ip,q5=function(t){return q2t(X2t(t))},Jc=function(t){return t&&t.Math===Math&&t},rs=Jc(typeof globalThis=="object"&&globalThis)||Jc(typeof window=="object"&&window)||Jc(typeof self=="object"&&self)||Jc(typeof P=="object"&&P)||Jc(typeof P=="object"&&P)||function(){return this}()||Function("return this")(),$k={exports:{}},Zk=rs,K2t=Object.defineProperty,vv=function(t,e){try{K2t(Zk,t,{value:e,configurable:!0,writable:!0})}catch{Zk[t]=e}return e},Y2t=rs,J2t=vv,Wk="__core-js_shared__",qk=$k.exports=Y2t[Wk]||J2t(Wk,{});(qk.versions||(qk.versions=[])).push({version:"3.37.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE",source:"https://github.com/zloirock/core-js"});var bv=$k.exports,Xk=bv,Kk=function(t,e){return Xk[t]||(Xk[t]=e||{})},t3t=ip,e3t=Object,Yk=function(t){return e3t(t3t(t))},r3t=Io,n3t=Yk,i3t=r3t({}.hasOwnProperty),qa=Object.hasOwn||function(t,e){return i3t(n3t(t),e)},o3t=Io,s3t=0,a3t=Math.random(),l3t=o3t(1 .toString),Lv=function(t){return"Symbol("+(t===void 0?"":t)+")_"+l3t(++s3t+a3t,36)},c3t=typeof navigator<"u"&&String(navigator.userAgent)||"",Jk=rs,wv=c3t,tI=Jk.process,eI=Jk.Deno,rI=tI&&tI.versions||eI&&eI.version,nI=rI&&rI.v8,ga,op;nI&&(ga=nI.split("."),op=ga[0]>0&&ga[0]<4?1:+(ga[0]+ga[1])),!op&&wv&&(ga=wv.match(/Edge\/(\d+)/),(!ga||ga[1]>=74)&&(ga=wv.match(/Chrome\/(\d+)/),ga&&(op=+ga[1])));var u3t=op,iI=u3t,h3t=f1,d3t=rs,p3t=d3t.String,oI=!!Object.getOwnPropertySymbols&&!h3t(function(){var t=Symbol("symbol detection");return!p3t(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&iI&&iI<41}),f3t=oI,sI=f3t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",T3t=rs,Q3t=Kk,aI=qa,m3t=Lv,g3t=oI,y3t=sI,X5=T3t.Symbol,xv=Q3t("wks"),_3t=y3t?X5.for||X5:X5&&X5.withoutSetter||m3t,Is=function(t){return aI(xv,t)||(xv[t]=g3t&&aI(X5,t)?X5[t]:_3t("Symbol."+t)),xv[t]},Ev=typeof document=="object"&&document.all,Zo=typeof Ev>"u"&&Ev!==void 0?function(t){return typeof t=="function"||t===Ev}:function(t){return typeof t=="function"},v3t=Zo,Ps=function(t){return typeof t=="object"?t!==null:v3t(t)},b3t=Ps,L3t=String,w3t=TypeError,h4=function(t){if(b3t(t))return t;throw new w3t(L3t(t)+" is not an object")},lI={},x3t=f1,ya=!x3t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),E3t=ya,S3t=f1,cI=E3t&&S3t(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Xa={},M3t=rs,uI=Ps,Sv=M3t.document,H3t=uI(Sv)&&uI(Sv.createElement),Mv=function(t){return H3t?Sv.createElement(t):{}},C3t=ya,A3t=f1,O3t=Mv,hI=!C3t&&!A3t(function(){return Object.defineProperty(O3t("div"),"a",{get:function(){return 7}}).a!==7}),k3t=gv,sp=Function.prototype.call,h3=k3t?sp.bind(sp):function(){return sp.apply(sp,arguments)},Hv=rs,I3t=Zo,P3t=function(t){return I3t(t)?t:void 0},t8=function(t,e){return arguments.length<2?P3t(Hv[t]):Hv[t]&&Hv[t][e]},V3t=Io,Cv=V3t({}.isPrototypeOf),R3t=t8,N3t=Zo,D3t=Cv,B3t=sI,F3t=Object,dI=B3t?function(t){return typeof t=="symbol"}:function(t){var e=R3t("Symbol");return N3t(e)&&D3t(e.prototype,F3t(t))},j3t=String,Av=function(t){try{return j3t(t)}catch{return"Object"}},z3t=Zo,U3t=Av,G3t=TypeError,e8=function(t){if(z3t(t))return t;throw new G3t(U3t(t)+" is not a function")},$3t=e8,Z3t=Yc,Ov=function(t,e){var r=t[e];return Z3t(r)?void 0:$3t(r)},kv=h3,Iv=Zo,Pv=Ps,W3t=TypeError,q3t=function(t,e){var r,n;if(e==="string"&&Iv(r=t.toString)&&!Pv(n=kv(r,t))||Iv(r=t.valueOf)&&!Pv(n=kv(r,t))||e!=="string"&&Iv(r=t.toString)&&!Pv(n=kv(r,t)))return n;throw new W3t("Can't convert object to primitive value")},X3t=h3,pI=Ps,fI=dI,K3t=Ov,Y3t=q3t,J3t=Is,t4t=TypeError,e4t=J3t("toPrimitive"),r4t=function(t,e){if(!pI(t)||fI(t))return t;var r=K3t(t,e4t),n;if(r){if(e===void 0&&(e="default"),n=X3t(r,t,e),!pI(n)||fI(n))return n;throw new t4t("Can't convert object to primitive value")}return e===void 0&&(e="number"),Y3t(t,e)},n4t=r4t,i4t=dI,TI=function(t){var e=n4t(t,"string");return i4t(e)?e:e+""},o4t=ya,s4t=hI,a4t=cI,ap=h4,QI=TI,l4t=TypeError,Vv=Object.defineProperty,c4t=Object.getOwnPropertyDescriptor,Rv="enumerable",Nv="configurable",Dv="writable";Xa.f=o4t?a4t?function(t,e,r){if(ap(t),e=QI(e),ap(r),typeof t=="function"&&e==="prototype"&&"value"in r&&Dv in r&&!r[Dv]){var n=c4t(t,e);n&&n[Dv]&&(t[e]=r.value,r={configurable:Nv in r?r[Nv]:n[Nv],enumerable:Rv in r?r[Rv]:n[Rv],writable:!1})}return Vv(t,e,r)}:Vv:function(t,e,r){if(ap(t),e=QI(e),ap(r),s4t)try{return Vv(t,e,r)}catch{}if("get"in r||"set"in r)throw new l4t("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var u4t=Math.ceil,h4t=Math.floor,d4t=Math.trunc||function(t){var e=+t;return(e>0?h4t:u4t)(e)},p4t=d4t,lp=function(t){var e=+t;return e!==e||e===0?0:p4t(e)},f4t=lp,T4t=Math.max,Q4t=Math.min,m4t=function(t,e){var r=f4t(t);return r<0?T4t(r+e,0):Q4t(r,e)},g4t=lp,y4t=Math.min,_4t=function(t){var e=g4t(t);return e>0?y4t(e,9007199254740991):0},v4t=_4t,mI=function(t){return v4t(t.length)},b4t=q5,L4t=m4t,w4t=mI,gI=function(t){return function(e,r,n){var i=b4t(e),o=w4t(i);if(o===0)return!t&&-1;var s=L4t(n,o),a;if(t&&r!==r){for(;o>s;)if(a=i[s++],a!==a)return!0}else for(;o>s;s++)if((t||s in i)&&i[s]===r)return t||s||0;return!t&&-1}},x4t={includes:gI(!0),indexOf:gI(!1)},cp={},E4t=Io,Bv=qa,S4t=q5,M4t=x4t.indexOf,H4t=cp,yI=E4t([].push),_I=function(t,e){var r=S4t(t),n=0,i=[],o;for(o in r)!Bv(H4t,o)&&Bv(r,o)&&yI(i,o);for(;e.length>n;)Bv(r,o=e[n++])&&(~M4t(i,o)||yI(i,o));return i},Fv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],C4t=_I,A4t=Fv,O4t=Object.keys||function(t){return C4t(t,A4t)},k4t=ya,I4t=cI,P4t=Xa,V4t=h4,R4t=q5,N4t=O4t;lI.f=k4t&&!I4t?Object.defineProperties:function(t,e){V4t(t);for(var r=R4t(e),n=N4t(e),i=n.length,o=0,s;i>o;)P4t.f(t,s=n[o++],r[s]);return t};var D4t=t8,B4t=D4t("document","documentElement"),F4t=Kk,j4t=Lv,vI=F4t("keys"),jv=function(t){return vI[t]||(vI[t]=j4t(t))},z4t=h4,U4t=lI,bI=Fv,G4t=cp,$4t=B4t,Z4t=Mv,W4t=jv,LI=">",wI="<",zv="prototype",Uv="script",xI=W4t("IE_PROTO"),Gv=function(){},EI=function(t){return wI+Uv+LI+t+wI+"/"+Uv+LI},SI=function(t){t.write(EI("")),t.close();var e=t.parentWindow.Object;return t=null,e},q4t=function(){var t=Z4t("iframe"),e="java"+Uv+":",r;return t.style.display="none",$4t.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(EI("document.F=Object")),r.close(),r.F},up,hp=function(){try{up=new ActiveXObject("htmlfile")}catch{}hp=typeof document<"u"?document.domain&&up?SI(up):q4t():SI(up);for(var t=bI.length;t--;)delete hp[zv][bI[t]];return hp()};G4t[xI]=!0;var $v=Object.create||function(t,e){var r;return t!==null?(Gv[zv]=z4t(t),r=new Gv,Gv[zv]=null,r[xI]=t):r=hp(),e===void 0?r:U4t.f(r,e)},X4t=Is,K4t=$v,Y4t=Xa.f,Zv=X4t("unscopables"),Wv=Array.prototype;Wv[Zv]===void 0&&Y4t(Wv,Zv,{configurable:!0,value:K4t(null)});var J4t=function(t){Wv[Zv][t]=!0},r8={},t6t=rs,e6t=Zo,MI=t6t.WeakMap,r6t=e6t(MI)&&/native code/.test(String(MI)),qv=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},n6t=ya,i6t=Xa,o6t=qv,dp=n6t?function(t,e,r){return i6t.f(t,e,o6t(1,r))}:function(t,e,r){return t[e]=r,t},s6t=r6t,HI=rs,a6t=Ps,l6t=dp,Xv=qa,Kv=bv,c6t=jv,u6t=cp,CI="Object already initialized",Yv=HI.TypeError,h6t=HI.WeakMap,pp,n8,fp,d6t=function(t){return fp(t)?n8(t):pp(t,{})},p6t=function(t){return function(e){var r;if(!a6t(e)||(r=n8(e)).type!==t)throw new Yv("Incompatible receiver, "+t+" required");return r}};if(s6t||Kv.state){var Ka=Kv.state||(Kv.state=new h6t);Ka.get=Ka.get,Ka.has=Ka.has,Ka.set=Ka.set,pp=function(t,e){if(Ka.has(t))throw new Yv(CI);return e.facade=t,Ka.set(t,e),e},n8=function(t){return Ka.get(t)||{}},fp=function(t){return Ka.has(t)}}else{var K5=c6t("state");u6t[K5]=!0,pp=function(t,e){if(Xv(t,K5))throw new Yv(CI);return e.facade=t,l6t(t,K5,e),e},n8=function(t){return Xv(t,K5)?t[K5]:{}},fp=function(t){return Xv(t,K5)}}var Tp={set:pp,get:n8,has:fp,enforce:d6t,getterFor:p6t},Jv={},AI={},OI={}.propertyIsEnumerable,kI=Object.getOwnPropertyDescriptor,f6t=kI&&!OI.call({1:2},1);AI.f=f6t?function(t){var e=kI(this,t);return!!e&&e.enumerable}:OI;var T6t=ya,Q6t=h3,m6t=AI,g6t=qv,y6t=q5,_6t=TI,v6t=qa,b6t=hI,II=Object.getOwnPropertyDescriptor;Jv.f=T6t?II:function(t,e){if(t=y6t(t),e=_6t(e),b6t)try{return II(t,e)}catch{}if(v6t(t,e))return g6t(!Q6t(m6t.f,t,e),t[e])};var PI={exports:{}},tb=ya,L6t=qa,VI=Function.prototype,w6t=tb&&Object.getOwnPropertyDescriptor,eb=L6t(VI,"name"),x6t=eb&&(function(){}).name==="something",E6t=eb&&(!tb||tb&&w6t(VI,"name").configurable),RI={EXISTS:eb,PROPER:x6t,CONFIGURABLE:E6t},S6t=Io,M6t=Zo,rb=bv,H6t=S6t(Function.toString);M6t(rb.inspectSource)||(rb.inspectSource=function(t){return H6t(t)});var C6t=rb.inspectSource,nb=Io,A6t=f1,O6t=Zo,Qp=qa,ib=ya,k6t=RI.CONFIGURABLE,I6t=C6t,NI=Tp,P6t=NI.enforce,V6t=NI.get,DI=String,mp=Object.defineProperty,R6t=nb("".slice),N6t=nb("".replace),D6t=nb([].join),B6t=ib&&!A6t(function(){return mp(function(){},"length",{value:8}).length!==8}),F6t=String(String).split("String"),j6t=PI.exports=function(t,e,r){R6t(DI(e),0,7)==="Symbol("&&(e="["+N6t(DI(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Qp(t,"name")||k6t&&t.name!==e)&&(ib?mp(t,"name",{value:e,configurable:!0}):t.name=e),B6t&&r&&Qp(r,"arity")&&t.length!==r.arity&&mp(t,"length",{value:r.arity});try{r&&Qp(r,"constructor")&&r.constructor?ib&&mp(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=P6t(t);return Qp(n,"source")||(n.source=D6t(F6t,typeof e=="string"?e:"")),t};Function.prototype.toString=j6t(function(){return O6t(this)&&V6t(this).source||I6t(this)},"toString");var BI=PI.exports,z6t=Zo,U6t=Xa,G6t=BI,$6t=vv,Y5=function(t,e,r,n){n||(n={});var i=n.enumerable,o=n.name!==void 0?n.name:e;if(z6t(r)&&G6t(r,o,n),n.global)i?t[e]=r:$6t(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=r:U6t.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},gp={},Z6t=_I,W6t=Fv,q6t=W6t.concat("length","prototype");gp.f=Object.getOwnPropertyNames||function(t){return Z6t(t,q6t)};var FI={};FI.f=Object.getOwnPropertySymbols;var X6t=t8,K6t=Io,Y6t=gp,J6t=FI,t0t=h4,e0t=K6t([].concat),r0t=X6t("Reflect","ownKeys")||function(t){var e=Y6t.f(t0t(t)),r=J6t.f;return r?e0t(e,r(t)):e},jI=qa,n0t=r0t,i0t=Jv,o0t=Xa,s0t=function(t,e,r){for(var n=n0t(e),i=o0t.f,o=i0t.f,s=0;s<n.length;s++){var a=n[s];!jI(t,a)&&!(r&&jI(r,a))&&i(t,a,o(e,a))}},a0t=f1,l0t=Zo,c0t=/#|\.prototype\./,i8=function(t,e){var r=h0t[u0t(t)];return r===p0t?!0:r===d0t?!1:l0t(e)?a0t(e):!!e},u0t=i8.normalize=function(t){return String(t).replace(c0t,".").toLowerCase()},h0t=i8.data={},d0t=i8.NATIVE="N",p0t=i8.POLYFILL="P",zI=i8,yp=rs,f0t=Jv.f,T0t=dp,Q0t=Y5,m0t=vv,g0t=s0t,y0t=zI,Ya=function(t,e){var r=t.target,n=t.global,i=t.stat,o,s,a,u,d,f;if(n?s=yp:i?s=yp[r]||m0t(r,{}):s=yp[r]&&yp[r].prototype,s)for(a in e){if(d=e[a],t.dontCallGetSet?(f=f0t(s,a),u=f&&f.value):u=s[a],o=y0t(n?a:r+(i?".":"#")+a,t.forced),!o&&u!==void 0){if(typeof d==typeof u)continue;g0t(d,u)}(t.sham||u&&u.sham)&&T0t(d,"sham",!0),Q0t(s,a,d,t)}},_0t=f1,v0t=!_0t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),b0t=qa,L0t=Zo,w0t=Yk,x0t=jv,E0t=v0t,UI=x0t("IE_PROTO"),ob=Object,S0t=ob.prototype,GI=E0t?ob.getPrototypeOf:function(t){var e=w0t(t);if(b0t(e,UI))return e[UI];var r=e.constructor;return L0t(r)&&e instanceof r?r.prototype:e instanceof ob?S0t:null},M0t=f1,H0t=Zo,C0t=Ps,$I=GI,A0t=Y5,O0t=Is,sb=O0t("iterator"),ZI=!1,r0,ab,lb;[].keys&&(lb=[].keys(),"next"in lb?(ab=$I($I(lb)),ab!==Object.prototype&&(r0=ab)):ZI=!0);var k0t=!C0t(r0)||M0t(function(){var t={};return r0[sb].call(t)!==t});k0t&&(r0={}),H0t(r0[sb])||A0t(r0,sb,function(){return this});var WI={IteratorPrototype:r0,BUGGY_SAFARI_ITERATORS:ZI},I0t=Xa.f,P0t=qa,V0t=Is,qI=V0t("toStringTag"),_p=function(t,e,r){t&&!r&&(t=t.prototype),t&&!P0t(t,qI)&&I0t(t,qI,{configurable:!0,value:e})},R0t=WI.IteratorPrototype,N0t=$v,D0t=qv,B0t=_p,F0t=r8,j0t=function(){return this},z0t=function(t,e,r,n){var i=e+" Iterator";return t.prototype=N0t(R0t,{next:D0t(+!n,r)}),B0t(t,i,!1),F0t[i]=j0t,t},U0t=Io,G0t=e8,XI=function(t,e,r){try{return U0t(G0t(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}},$0t=Ps,Z0t=function(t){return $0t(t)||t===null},W0t=Z0t,q0t=String,X0t=TypeError,K0t=function(t){if(W0t(t))return t;throw new X0t("Can't set "+q0t(t)+" as a prototype")},Y0t=XI,J0t=Ps,t5t=ip,e5t=K0t,KI=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=Y0t(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(n,i){return t5t(n),e5t(i),J0t(n)&&(t?r(n,i):n.__proto__=i),n}}():void 0),r5t=Ya,n5t=h3,YI=RI,i5t=Zo,o5t=z0t,JI=GI,tP=KI,s5t=_p,a5t=dp,cb=Y5,l5t=Is,c5t=r8,eP=WI,u5t=YI.PROPER,h5t=YI.CONFIGURABLE,rP=eP.IteratorPrototype,vp=eP.BUGGY_SAFARI_ITERATORS,o8=l5t("iterator"),nP="keys",s8="values",iP="entries",d5t=function(){return this},ub=function(t,e,r,n,i,o,s){o5t(r,e,n);var a=function(E){if(E===i&&Q)return Q;if(!vp&&E&&E in f)return f[E];switch(E){case nP:return function(){return new r(this,E)};case s8:return function(){return new r(this,E)};case iP:return function(){return new r(this,E)}}return function(){return new r(this)}},u=e+" Iterator",d=!1,f=t.prototype,T=f[o8]||f["@@iterator"]||i&&f[i],Q=!vp&&T||a(i),_=e==="Array"&&f.entries||T,w,b,S;if(_&&(w=JI(_.call(new t)),w!==Object.prototype&&w.next&&(JI(w)!==rP&&(tP?tP(w,rP):i5t(w[o8])||cb(w,o8,d5t)),s5t(w,u,!0))),u5t&&i===s8&&T&&T.name!==s8&&(h5t?a5t(f,"name",s8):(d=!0,Q=function(){return n5t(T,this)})),i)if(b={values:a(s8),keys:o?Q:a(nP),entries:a(iP)},s)for(S in b)(vp||d||!(S in f))&&cb(f,S,b[S]);else r5t({target:e,proto:!0,forced:vp||d},b);return f[o8]!==Q&&cb(f,o8,Q,{name:i}),c5t[e]=Q,b},hb=function(t,e){return{value:t,done:e}},p5t=q5,db=J4t,oP=r8,sP=Tp,f5t=Xa.f,T5t=ub,bp=hb,Q5t=ya,aP="Array Iterator",m5t=sP.set,g5t=sP.getterFor(aP),y5t=T5t(Array,"Array",function(t,e){m5t(this,{type:aP,target:p5t(t),index:0,kind:e})},function(){var t=g5t(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,bp(void 0,!0);switch(t.kind){case"keys":return bp(r,!1);case"values":return bp(e[r],!1)}return bp([r,e[r]],!1)},"values"),lP=oP.Arguments=oP.Array;if(db("keys"),db("values"),db("entries"),Q5t&&lP.name!=="values")try{f5t(lP,"name",{value:"values"})}catch{}var _5t=Is,v5t=_5t("toStringTag"),cP={};cP[v5t]="z";var pb=String(cP)==="[object z]",b5t=pb,L5t=Zo,Lp=Kc,w5t=Is,x5t=w5t("toStringTag"),E5t=Object,S5t=Lp(function(){return arguments}())==="Arguments",M5t=function(t,e){try{return t[e]}catch{}},fb=b5t?Lp:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=M5t(e=E5t(t),x5t))=="string"?r:S5t?Lp(e):(n=Lp(e))==="Object"&&L5t(e.callee)?"Arguments":n},H5t=pb,C5t=fb,A5t=H5t?{}.toString:function(){return"[object "+C5t(this)+"]"},O5t=pb,k5t=Y5,I5t=A5t;O5t||k5t(Object.prototype,"toString",I5t,{unsafe:!0});var uP={exports:{}},hP={},P5t=Io,V5t=P5t([].slice),R5t=Kc,N5t=q5,dP=gp.f,D5t=V5t,pP=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],B5t=function(t){try{return dP(t)}catch{return D5t(pP)}};hP.f=function(t){return pP&&R5t(t)==="Window"?B5t(t):dP(N5t(t))};var F5t=f1,j5t=F5t(function(){if(typeof ArrayBuffer=="function"){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}),z5t=f1,U5t=Ps,G5t=Kc,fP=j5t,wp=Object.isExtensible,$5t=z5t(function(){wp(1)}),Z5t=$5t||fP?function(t){return!U5t(t)||fP&&G5t(t)==="ArrayBuffer"?!1:wp?wp(t):!0}:wp,W5t=f1,q5t=!W5t(function(){return Object.isExtensible(Object.preventExtensions({}))}),X5t=Ya,K5t=Io,Y5t=cp,J5t=Ps,Tb=qa,tlt=Xa.f,TP=gp,elt=hP,Qb=Z5t,rlt=Lv,nlt=q5t,QP=!1,d3=rlt("meta"),ilt=0,mb=function(t){tlt(t,d3,{value:{objectID:"O"+ilt++,weakData:{}}})},olt=function(t,e){if(!J5t(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!Tb(t,d3)){if(!Qb(t))return"F";if(!e)return"E";mb(t)}return t[d3].objectID},slt=function(t,e){if(!Tb(t,d3)){if(!Qb(t))return!0;if(!e)return!1;mb(t)}return t[d3].weakData},alt=function(t){return nlt&&QP&&Qb(t)&&!Tb(t,d3)&&mb(t),t},llt=function(){clt.enable=function(){},QP=!0;var t=TP.f,e=K5t([].splice),r={};r[d3]=1,t(r).length&&(TP.f=function(n){for(var i=t(n),o=0,s=i.length;o<s;o++)if(i[o]===d3){e(i,o,1);break}return i},X5t({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:elt.f}))},clt=uP.exports={enable:llt,fastKey:olt,getWeakData:slt,onFreeze:alt};Y5t[d3]=!0;var mP=uP.exports,ult=Kc,hlt=Io,dlt=function(t){if(ult(t)==="Function")return hlt(t)},gP=dlt,plt=e8,flt=gv,Tlt=gP(gP.bind),yP=function(t,e){return plt(t),e===void 0?t:flt?Tlt(t,e):function(){return t.apply(e,arguments)}},Qlt=Is,mlt=r8,glt=Qlt("iterator"),ylt=Array.prototype,_lt=function(t){return t!==void 0&&(mlt.Array===t||ylt[glt]===t)},vlt=fb,_P=Ov,blt=Yc,Llt=r8,wlt=Is,xlt=wlt("iterator"),vP=function(t){if(!blt(t))return _P(t,xlt)||_P(t,"@@iterator")||Llt[vlt(t)]},Elt=h3,Slt=e8,Mlt=h4,Hlt=Av,Clt=vP,Alt=TypeError,Olt=function(t,e){var r=arguments.length<2?Clt(t):e;if(Slt(r))return Mlt(Elt(r,t));throw new Alt(Hlt(t)+" is not iterable")},klt=h3,bP=h4,Ilt=Ov,gb=function(t,e,r){var n,i;bP(t);try{if(n=Ilt(t,"return"),!n){if(e==="throw")throw r;return r}n=klt(n,t)}catch(o){i=!0,n=o}if(e==="throw")throw r;if(i)throw n;return bP(n),r},Plt=yP,Vlt=h3,Rlt=h4,Nlt=Av,Dlt=_lt,Blt=mI,LP=Cv,Flt=Olt,jlt=vP,wP=gb,zlt=TypeError,xp=function(t,e){this.stopped=t,this.result=e},xP=xp.prototype,EP=function(t,e,r){var n=r&&r.that,i=!!(r&&r.AS_ENTRIES),o=!!(r&&r.IS_RECORD),s=!!(r&&r.IS_ITERATOR),a=!!(r&&r.INTERRUPTED),u=Plt(e,n),d,f,T,Q,_,w,b,S=function(O){return d&&wP(d,"normal",O),new xp(!0,O)},E=function(O){return i?(Rlt(O),a?u(O[0],O[1],S):u(O[0],O[1])):a?u(O,S):u(O)};if(o)d=t.iterator;else if(s)d=t;else{if(f=jlt(t),!f)throw new zlt(Nlt(t)+" is not iterable");if(Dlt(f)){for(T=0,Q=Blt(t);Q>T;T++)if(_=E(t[T]),_&&LP(xP,_))return _;return new xp(!1)}d=Flt(t,f)}for(w=o?t.next:d.next;!(b=Vlt(w,d)).done;){try{_=E(b.value)}catch(O){wP(d,"throw",O)}if(typeof _=="object"&&_&&LP(xP,_))return _}return new xp(!1)},Ult=Cv,Glt=TypeError,SP=function(t,e){if(Ult(e,t))return t;throw new Glt("Incorrect invocation")},$lt=Is,MP=$lt("iterator"),HP=!1;try{var Zlt=0,CP={next:function(){return{done:!!Zlt++}},return:function(){HP=!0}};CP[MP]=function(){return this},Array.from(CP,function(){throw 2})}catch{}var Wlt=function(t,e){try{if(!e&&!HP)return!1}catch{return!1}var r=!1;try{var n={};n[MP]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r},qlt=Zo,Xlt=Ps,AP=KI,Klt=function(t,e,r){var n,i;return AP&&qlt(n=e.constructor)&&n!==r&&Xlt(i=n.prototype)&&i!==r.prototype&&AP(t,i),t},Ylt=Ya,Jlt=rs,t7t=Io,OP=zI,e7t=Y5,r7t=mP,n7t=EP,i7t=SP,o7t=Zo,s7t=Yc,yb=Ps,_b=f1,a7t=Wlt,l7t=_p,c7t=Klt,u7t=function(t,e,r){var n=t.indexOf("Map")!==-1,i=t.indexOf("Weak")!==-1,o=n?"set":"add",s=Jlt[t],a=s&&s.prototype,u=s,d={},f=function(E){var O=t7t(a[E]);e7t(a,E,E==="add"?function(I){return O(this,I===0?0:I),this}:E==="delete"?function(I){return i&&!yb(I)?!1:O(this,I===0?0:I)}:E==="get"?function(I){return i&&!yb(I)?void 0:O(this,I===0?0:I)}:E==="has"?function(I){return i&&!yb(I)?!1:O(this,I===0?0:I)}:function(I,D){return O(this,I===0?0:I,D),this})},T=OP(t,!o7t(s)||!(i||a.forEach&&!_b(function(){new s().entries().next()})));if(T)u=r.getConstructor(e,t,n,o),r7t.enable();else if(OP(t,!0)){var Q=new u,_=Q[o](i?{}:-0,1)!==Q,w=_b(function(){Q.has(1)}),b=a7t(function(E){new s(E)}),S=!i&&_b(function(){for(var E=new s,O=5;O--;)E[o](O,O);return!E.has(-0)});b||(u=e(function(E,O){i7t(E,a);var I=c7t(new s,E,u);return s7t(O)||n7t(O,I[o],{that:I,AS_ENTRIES:n}),I}),u.prototype=a,a.constructor=u),(w||S)&&(f("delete"),f("has"),n&&f("get")),(S||_)&&f(o),i&&a.clear&&delete a.clear}return d[t]=u,Ylt({global:!0,constructor:!0,forced:u!==s},d),l7t(u,t),i||r.setStrong(u,t,n),u},kP=BI,h7t=Xa,IP=function(t,e,r){return r.get&&kP(r.get,e,{getter:!0}),r.set&&kP(r.set,e,{setter:!0}),h7t.f(t,e,r)},d7t=Y5,p7t=function(t,e,r){for(var n in e)d7t(t,n,e[n],r);return t},f7t=t8,T7t=IP,Q7t=Is,m7t=ya,PP=Q7t("species"),g7t=function(t){var e=f7t(t);m7t&&e&&!e[PP]&&T7t(e,PP,{configurable:!0,get:function(){return this}})},VP=$v,y7t=IP,RP=p7t,_7t=yP,v7t=SP,b7t=Yc,L7t=EP,w7t=ub,NP=hb,x7t=g7t,a8=ya,DP=mP.fastKey,BP=Tp,FP=BP.set,vb=BP.getterFor,E7t={getConstructor:function(t,e,r,n){var i=t(function(d,f){v7t(d,o),FP(d,{type:e,index:VP(null),first:void 0,last:void 0,size:0}),a8||(d.size=0),b7t(f)||L7t(f,d[n],{that:d,AS_ENTRIES:r})}),o=i.prototype,s=vb(e),a=function(d,f,T){var Q=s(d),_=u(d,f),w,b;return _?_.value=T:(Q.last=_={index:b=DP(f,!0),key:f,value:T,previous:w=Q.last,next:void 0,removed:!1},Q.first||(Q.first=_),w&&(w.next=_),a8?Q.size++:d.size++,b!=="F"&&(Q.index[b]=_)),d},u=function(d,f){var T=s(d),Q=DP(f),_;if(Q!=="F")return T.index[Q];for(_=T.first;_;_=_.next)if(_.key===f)return _};return RP(o,{clear:function(){for(var d=this,f=s(d),T=f.first;T;)T.removed=!0,T.previous&&(T.previous=T.previous.next=void 0),T=T.next;f.first=f.last=void 0,f.index=VP(null),a8?f.size=0:d.size=0},delete:function(d){var f=this,T=s(f),Q=u(f,d);if(Q){var _=Q.next,w=Q.previous;delete T.index[Q.index],Q.removed=!0,w&&(w.next=_),_&&(_.previous=w),T.first===Q&&(T.first=_),T.last===Q&&(T.last=w),a8?T.size--:f.size--}return!!Q},forEach:function(d){for(var f=s(this),T=_7t(d,arguments.length>1?arguments[1]:void 0),Q;Q=Q?Q.next:f.first;)for(T(Q.value,Q.key,this);Q&&Q.removed;)Q=Q.previous},has:function(d){return!!u(this,d)}}),RP(o,r?{get:function(d){var f=u(this,d);return f&&f.value},set:function(d,f){return a(this,d===0?0:d,f)}}:{add:function(d){return a(this,d=d===0?0:d,d)}}),a8&&y7t(o,"size",{configurable:!0,get:function(){return s(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=vb(e),o=vb(n);w7t(t,e,function(s,a){FP(this,{type:n,target:s,state:i(s),kind:a,last:void 0})},function(){for(var s=o(this),a=s.kind,u=s.last;u&&u.removed;)u=u.previous;return!s.target||!(s.last=u=u?u.next:s.state.first)?(s.target=void 0,NP(void 0,!0)):NP(a==="keys"?u.key:a==="values"?u.value:[u.key,u.value],!1)},r?"entries":"values",!r,!0),x7t(e)}},S7t=u7t,M7t=E7t;S7t("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},M7t);var bb=Io,Ep=Set.prototype,Ja={Set,add:bb(Ep.add),has:bb(Ep.has),remove:bb(Ep.delete),proto:Ep},H7t=Ja.has,n0=function(t){return H7t(t),t},C7t=h3,i0=function(t,e,r){for(var n=r?t:t.iterator,i=t.next,o,s;!(o=C7t(i,n)).done;)if(s=e(o.value),s!==void 0)return s},jP=Io,A7t=i0,zP=Ja,O7t=zP.Set,UP=zP.proto,k7t=jP(UP.forEach),GP=jP(UP.keys),I7t=GP(new O7t).next,l8=function(t,e,r){return r?A7t({iterator:GP(t),next:I7t},e):k7t(t,e)},$P=Ja,P7t=l8,V7t=$P.Set,R7t=$P.add,Lb=function(t){var e=new V7t;return P7t(t,function(r){R7t(e,r)}),e},N7t=XI,D7t=Ja,c8=N7t(D7t.proto,"size","get")||function(t){return t.size},B7t=function(t){return{iterator:t,next:t.next,done:!1}},ZP=e8,WP=h4,qP=h3,F7t=lp,j7t=B7t,XP="Invalid size",z7t=RangeError,U7t=TypeError,G7t=Math.max,KP=function(t,e){this.set=t,this.size=G7t(e,0),this.has=ZP(t.has),this.keys=ZP(t.keys)};KP.prototype={getIterator:function(){return j7t(WP(qP(this.keys,this.set)))},includes:function(t){return qP(this.has,this.set,t)}};var o0=function(t){WP(t);var e=+t.size;if(e!==e)throw new U7t(XP);var r=F7t(e);if(r<0)throw new z7t(XP);return new KP(t,r)},$7t=n0,YP=Ja,Z7t=Lb,W7t=c8,q7t=o0,X7t=l8,K7t=i0,Y7t=YP.has,JP=YP.remove,J7t=function(t){var e=$7t(this),r=q7t(t),n=Z7t(e);return W7t(e)<=r.size?X7t(e,function(i){r.includes(i)&&JP(n,i)}):K7t(r.getIterator(),function(i){Y7t(e,i)&&JP(n,i)}),n},tct=t8,tV=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},s0=function(t){var e=tct("Set");try{new e()[t](tV(0));try{return new e()[t](tV(-1)),!1}catch{return!0}}catch{return!1}},ect=Ya,rct=J7t,nct=s0;ect({target:"Set",proto:!0,real:!0,forced:!nct("difference")},{difference:rct});var ict=n0,wb=Ja,oct=c8,sct=o0,act=l8,lct=i0,cct=wb.Set,eV=wb.add,uct=wb.has,hct=function(t){var e=ict(this),r=sct(t),n=new cct;return oct(e)>r.size?lct(r.getIterator(),function(i){uct(e,i)&&eV(n,i)}):act(e,function(i){r.includes(i)&&eV(n,i)}),n},dct=Ya,pct=f1,fct=hct,Tct=s0,Qct=!Tct("intersection")||pct(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});dct({target:"Set",proto:!0,real:!0,forced:Qct},{intersection:fct});var mct=n0,gct=Ja.has,yct=c8,_ct=o0,vct=l8,bct=i0,Lct=gb,wct=function(t){var e=mct(this),r=_ct(t);if(yct(e)<=r.size)return vct(e,function(i){if(r.includes(i))return!1},!0)!==!1;var n=r.getIterator();return bct(n,function(i){if(gct(e,i))return Lct(n,"normal",!1)})!==!1},xct=Ya,Ect=wct,Sct=s0;xct({target:"Set",proto:!0,real:!0,forced:!Sct("isDisjointFrom")},{isDisjointFrom:Ect});var Mct=n0,Hct=c8,Cct=l8,Act=o0,Oct=function(t){var e=Mct(this),r=Act(t);return Hct(e)>r.size?!1:Cct(e,function(n){if(!r.includes(n))return!1},!0)!==!1},kct=Ya,Ict=Oct,Pct=s0;kct({target:"Set",proto:!0,real:!0,forced:!Pct("isSubsetOf")},{isSubsetOf:Ict});var Vct=n0,Rct=Ja.has,Nct=c8,Dct=o0,Bct=i0,Fct=gb,jct=function(t){var e=Vct(this),r=Dct(t);if(Nct(e)<r.size)return!1;var n=r.getIterator();return Bct(n,function(i){if(!Rct(e,i))return Fct(n,"normal",!1)})!==!1},zct=Ya,Uct=jct,Gct=s0;zct({target:"Set",proto:!0,real:!0,forced:!Gct("isSupersetOf")},{isSupersetOf:Uct});var $ct=n0,xb=Ja,Zct=Lb,Wct=o0,qct=i0,Xct=xb.add,Kct=xb.has,Yct=xb.remove,Jct=function(t){var e=$ct(this),r=Wct(t).getIterator(),n=Zct(e);return qct(r,function(i){Kct(e,i)?Yct(n,i):Xct(n,i)}),n},t8t=Ya,e8t=Jct,r8t=s0;t8t({target:"Set",proto:!0,real:!0,forced:!r8t("symmetricDifference")},{symmetricDifference:e8t});var n8t=n0,i8t=Ja.add,o8t=Lb,s8t=o0,a8t=i0,l8t=function(t){var e=n8t(this),r=s8t(t).getIterator(),n=o8t(e);return a8t(r,function(i){i8t(n,i)}),n},c8t=Ya,u8t=l8t,h8t=s0;c8t({target:"Set",proto:!0,real:!0,forced:!h8t("union")},{union:u8t});var d8t=fb,p8t=String,rV=function(t){if(d8t(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return p8t(t)},Eb=Io,f8t=lp,T8t=rV,Q8t=ip,m8t=Eb("".charAt),nV=Eb("".charCodeAt),g8t=Eb("".slice),iV=function(t){return function(e,r){var n=T8t(Q8t(e)),i=f8t(r),o=n.length,s,a;return i<0||i>=o?t?"":void 0:(s=nV(n,i),s<55296||s>56319||i+1===o||(a=nV(n,i+1))<56320||a>57343?t?m8t(n,i):s:t?g8t(n,i,i+2):(s-55296<<10)+(a-56320)+65536)}},y8t={codeAt:iV(!1),charAt:iV(!0)},_8t=y8t.charAt,v8t=rV,oV=Tp,b8t=ub,sV=hb,aV="String Iterator",L8t=oV.set,w8t=oV.getterFor(aV);b8t(String,"String",function(t){L8t(this,{type:aV,string:v8t(t),index:0})},function(){var t=w8t(this),e=t.string,r=t.index,n;return r>=e.length?sV(void 0,!0):(n=_8t(e,r),t.index+=n.length,sV(n,!1))});var x8t=rs,E8t=x8t,S8t=E8t,M8t=S8t.Set,H8t={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},C8t=Mv,Sb=C8t("span").classList,lV=Sb&&Sb.constructor&&Sb.constructor.prototype,A8t=lV===Object.prototype?void 0:lV,cV=rs,uV=H8t,O8t=A8t,u8=y5t,hV=dp,k8t=_p,I8t=Is,Mb=I8t("iterator"),Hb=u8.values,dV=function(t,e){if(t){if(t[Mb]!==Hb)try{hV(t,Mb,Hb)}catch{t[Mb]=Hb}if(k8t(t,e,!0),uV[e]){for(var r in u8)if(t[r]!==u8[r])try{hV(t,r,u8[r])}catch{t[r]=u8[r]}}}};for(var Cb in uV)dV(cV[Cb]&&cV[Cb].prototype,Cb);dV(O8t,"DOMTokenList");var P8t=M8t,V8t=P8t,R8t=V8t,N8t=R8t;const h8=u3(N8t);var pV={exports:{}};/**
|
|
33
|
+
</div>`,Qv=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},Xc={},Dk=async function(t,e){return Xc&&Xc.hasOwnProperty(e)?Xc[e]:new Promise(r=>{fetch(`${t}knowledge/label/${e}`,{method:"GET"}).then(n=>n.json()).then(n=>{let i=n.label;i==="Mammalia"&&(i="Mammalia not otherwise specified"),Xc[e]=i,r(i)}).catch(n=>{console.error("Error:",n),Xc[e]=e,r(e)})})},Bk=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1};let A2t=function(){this.initialise=function(t){this.flatmapApi=t,this.destinations=[],this.origins=[],this.components=[],this.urls=[],this.controller=void 0,this.uberons=[],this.lookUp=[]},this.createTooltipData=async function(t){let e=[];t.feature.hyperlinks&&t.feature.hyperlinks.length>0?e=t.feature.hyperlinks:e=this.urls.map(i=>({url:i,id:"pubmed"}));let r;if(t.provenanceTaxonomy){r=[];for(let i=0;t.provenanceTaxonomy.length>i;i++)r.push(await Dk(this.flatmapAPI,t.provenanceTaxonomy[i]))}return{destinations:this.destinations,origins:this.origins,components:this.components,destinationsWithDatasets:this.destinationsWithDatasets,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,title:t.label,featureId:t.resource,hyperlinks:e,provenanceTaxonomy:t.provenanceTaxonomy,provenanceTaxonomyLabel:r}},this.createComponentsLabelList=function(t,e){let r=[];return t.forEach(n=>{r.push(this.createLabelFromNeuralNode(n[0]),e),n.length===2&&r.push(this.createLabelFromNeuralNode(n[1]),e)}),r},this.createLabelLookup=function(t){return new Promise(e=>{let r={};this.uberons=[];const n={sql:this.buildLabelSqlStatement(t)};fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(i=>i.json()).then(i=>{const o=i.keys.indexOf("entity"),s=i.keys.indexOf("label");o>-1&&s>-1&&i.values.forEach(a=>{r[a[o]]=a[s],this.uberons.push({id:a[o],name:a[s]})}),e(r)})})},this.buildConnectivitySqlStatement=function(t){let e="select knowledge from knowledge where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.buildLabelSqlStatement=function(t){let e="select entity, label from labels where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.findAllIdsFromConnectivity=function(t){let e=t.connectivity.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),[...new Set(n.flat())]},this.flattenConntectivity=function(t){let e=t.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(t){let e=t.connectivity.flat(),r=Qv(e),n=[],i=!1;return r.forEach(o=>{i=!1,Bk(t.axons,o)&&(i=!0),Bk(t.dendrites,o)&&(i=!0),i||n.push(o)}),n},this.retrieveFlatmapKnowledgeForEvent=async function(t){this.controller&&this.controller.abort(),this.controller=new AbortController;const e=this.controller.signal,r=t.resource;if(this.destinations=[],this.origins=[],this.components=[],!r||r.length==0)return;let n=this.queryForConnectivity(r,e),i=await this.pubmedQueryOnIds(t);return await Promise.all([n,i])},this.queryForConnectivity=function(t,e,r=!0){const n={sql:this.buildConnectivitySqlStatement(t)},i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),...e?{signal:e}:{}};return new Promise(o=>{fetch(`${this.flatmapApi}knowledge/query/`,i).then(s=>s.json()).then(s=>{if(this.connectivityExists(s)){let a=JSON.parse(s.values[0][0]);r?this.processConnectivity(a).then(u=>{o(u)}):o(a)}else o(!1)}).catch(s=>{s.name==="AbortError"||console.error("Error:",s),o(!1)})})},this.connectivityExists=function(t){return!!(t.values&&t.values.length>0&&JSON.parse(t.values[0][0]).connectivity&&JSON.parse(t.values[0][0]).connectivity.length>0)},this.findIfNodeIsSingle=function(t){return t.length===1?(console.error("Server returns a single node",t),t[0]):t.length===2&&t[1].length===0?t[0]:!1},this.createLabelFromNeuralNode=function(t,e){let r=this.findIfNodeIsSingle(t);if(r)return e[r];let n=e[t[0]];return t.length===2&&t[1].length>0&&t[1].forEach(i=>{e[i]==null?n+=`, ${i}`:n+=`, ${e[i]}`}),n},this.flattenAndFindDatasets=function(t,e,r){let n=this.flattenConntectivity(t),i=this.flattenConntectivity(e),o=this.flattenConntectivity(r);this.destinationsWithDatasets=this.uberons.filter(s=>i.indexOf(s.id)!==-1),this.originsWithDatasets=this.uberons.filter(s=>o.indexOf(s.id)!==-1),this.componentsWithDatasets=this.uberons.filter(s=>n.indexOf(s.id)!==-1)},this.processConnectivity=function(t){return new Promise(e=>{let r=this.findComponents(t),n=Qv(t.axons),i=Qv(t.dendrites),o=this.findAllIdsFromConnectivity(t);this.createLabelLookup(o).then(s=>{this.destinations=n.map(a=>this.createLabelFromNeuralNode(a,s)),this.origins=i.map(a=>this.createLabelFromNeuralNode(a,s)),this.components=r.map(a=>this.createLabelFromNeuralNode(a,s)),this.flattenAndFindDatasets(r,n,i),e({ids:{axons:n,dendrites:i,components:r},labels:{destinations:this.destinations,origins:this.origins,components:this.components}})})})},this.flattenConntectivity=function(t){let e=t.flat(),r=[...new Set(e)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.stripPMIDPrefix=function(t){return t.split(":")[1]},this.getPMID=function(t){return new Promise(e=>{if(t.length>0){const r=[],n=[];t.forEach(i=>{const o='"'+i+'"',s=new URLSearchParams({db:"pubmed",term:o,format:"json"}),a=fetch(`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?${s}`,{method:"GET"}).then(u=>u.json()).then(u=>{const d=u.esearchresult?u.esearchresult.idlist:[];n.push(...d)});r.push(a)}),Promise.all(r).then(()=>{e(n)}).catch(()=>{e(n)})}else e([])})},this.convertPublicationIds=function(t){return new Promise(e=>{const r=[],n=[];t.forEach(i=>{i.type==="pmid"?r.push(i.id):(i.type==="doi"||i.type==="pmc")&&n.push(i.id)}),this.getPMID(n).then(i=>{r.push(...i),e(r)}).catch(()=>{e(r)})})},this.extractPublicationIdFromURLString=function(t){if(!t)return;const e=decodeURIComponent(t);let r={id:"",type:""};return["doi.org/","nih.gov/pubmed/","pmc/articles/","pubmed.ncbi.nlm.nih.gov/"].forEach(i=>{const o=e.lastIndexOf(i);o!==-1&&(r.id=e.slice(o+i.length),i==="doi.org/"?r.type="doi":i==="pmc/articles/"?r.type="pmc":r.type="pmid")}),r.id===""&&(t.includes("doi:")?(r.id=this.stripPMIDPrefix(t),r.type="doi"):t.includes("PMID:")&&(r.id=this.stripPMIDPrefix(t),r.type="pmid")),r.id.endsWith("/")&&(r.id=r.id.slice(0,-1)),r},this.getURLsForPubMed=function(t){return new Promise(e=>{const r=t.values.map(n=>this.extractPublicationIdFromURLString(n[0]));this.convertPublicationIds(r).then(n=>{if(n.length>0){const i=n.join();e([this.pubmedSearchUrl(i)])}})})},this.buildPubmedSqlStatement=function(t){let e="select distinct publication from publications where entity in (";if(t.length===1)e+=`'${t[0]}')`;else if(t.length>1)for(let r in t)e+=`'${t[r]}'${r>=t.length-1?")":","} `;return e},this.buildPubmedSqlStatementForModels=function(t){return`select distinct publication from publications where entity = '${t}'`},this.flatmapQuery=function(t){const e={sql:t};return fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(r=>r.json()).catch(r=>{console.error("Error:",r)})},this.pubmedQueryOnIds=function(t){return new Promise(e=>{const r=t.resource,n=t.feature.source;if(!r||r.length===0)return;const i=this.buildPubmedSqlStatement(r);this.flatmapQuery(i).then(o=>{o.values.length>0?this.getURLsForPubMed(o).then(s=>{this.urls=s,e(!0)}).catch(()=>{this.urls=[],e(!1)}):this.pubmedQueryOnModels(n).then(s=>{e(s)})})})},this.pubmedQueryOnModels=function(t){return this.flatmapQuery(this.buildPubmedSqlStatementForModels(t)).then(e=>(Array.isArray(e.values)&&e.values.length>0?this.getURLsForPubMed(e).then(r=>(this.urls=r,!0)).catch(()=>(this.urls=[],!1)):this.urls=[],!1))},this.pubmedSearchUrl=function(t){let e="https://pubmed.ncbi.nlm.nih.gov/?",r=new URLSearchParams;return r.append("term",t),e+r.toString()}};const O2t='<svg width="195px" height="24px" viewBox="0 0 200 24" fill="yellow"><path d="M22.0748 3.25583C22.4141 2.42845 23.5859 2.42845 23.9252 3.25583L25.6493 7.45955C25.793 7.80979 26.1221 8.04889 26.4995 8.07727L31.0303 8.41798C31.922 8.48504 32.2841 9.59942 31.6021 10.1778L28.1369 13.1166C27.8482 13.3614 27.7225 13.7483 27.8122 14.1161L28.8882 18.5304C29.1 19.3992 28.152 20.0879 27.3912 19.618L23.5255 17.2305C23.2034 17.0316 22.7966 17.0316 22.4745 17.2305L18.60881 19.618C17.84796 20.0879 16.9 19.3992 17.1118 18.5304L18.18785 14.1161C18.2775 13.7483 18.1518 13.3614 17.86309 13.1166L14.3979 10.1778C13.71588 9.59942 14.07796 8.48504 14.96971 8.41798L19.50046 8.07727C19.87794 8.04889 20.20704 7.80979 20.35068 7.45955L22.0748 3.25583Z" stroke="#000000" stroke-width="2"/><text x="47" y="52%" style="white-space: pre" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#333333">Featured dataset marker</text></svg>';var Fk={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(typeof window<"u"?window:mst,function(){if(typeof window>"u")return null;var r=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),n=r.requestAnimationFrame||r.mozRequestAnimationFrame||r.webkitRequestAnimationFrame||function(f){return r.setTimeout(f,20)},i=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||function(f){r.clearTimeout(f)};function o(f,T){var Q=Object.prototype.toString.call(f),_=Q==="[object Array]"||Q==="[object NodeList]"||Q==="[object HTMLCollection]"||Q==="[object Object]"||typeof jQuery<"u"&&f instanceof jQuery||typeof Elements<"u"&&f instanceof Elements,w=0,b=f.length;if(_)for(;w<b;w++)T(f[w]);else T(f)}function s(f){if(!f.getBoundingClientRect)return{width:f.offsetWidth,height:f.offsetHeight};var T=f.getBoundingClientRect();return{width:Math.round(T.width),height:Math.round(T.height)}}function a(f,T){Object.keys(T).forEach(function(Q){f.style[Q]=T[Q]})}var u=function(f,T){var Q=0;function _(){var b=[];this.add=function(O){b.push(O)};var S,E;this.call=function(O){for(S=0,E=b.length;S<E;S++)b[S].call(this,O)},this.remove=function(O){var I=[];for(S=0,E=b.length;S<E;S++)b[S]!==O&&I.push(b[S]);b=I},this.length=function(){return b.length}}function w(b,S){if(b){if(b.resizedAttached){b.resizedAttached.add(S);return}b.resizedAttached=new _,b.resizedAttached.add(S),b.resizeSensor=document.createElement("div"),b.resizeSensor.dir="ltr",b.resizeSensor.className="resize-sensor";var E={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},O={position:"absolute",left:"0px",top:"0px",transition:"0s"};a(b.resizeSensor,E);var I=document.createElement("div");I.className="resize-sensor-expand",a(I,E);var D=document.createElement("div");a(D,O),I.appendChild(D);var j=document.createElement("div");j.className="resize-sensor-shrink",a(j,E);var $=document.createElement("div");a($,O),a($,{width:"200%",height:"200%"}),j.appendChild($),b.resizeSensor.appendChild(I),b.resizeSensor.appendChild(j),b.appendChild(b.resizeSensor);var G=window.getComputedStyle(b),tt=G?G.getPropertyValue("position"):null;tt!=="absolute"&&tt!=="relative"&&tt!=="fixed"&&tt!=="sticky"&&(b.style.position="relative");var it=!1,lt=0,rt=s(b),gt=0,Pt=0,Gt=!0;Q=0;var re=function(){var ee=b.offsetWidth,he=b.offsetHeight;D.style.width=ee+10+"px",D.style.height=he+10+"px",I.scrollLeft=ee+10,I.scrollTop=he+10,j.scrollLeft=ee+10,j.scrollTop=he+10},_e=function(){if(Gt){var ee=b.offsetWidth===0&&b.offsetHeight===0;if(ee){Q||(Q=n(function(){Q=0,_e()}));return}else Gt=!1}re()};b.resizeSensor.resetSensor=_e;var de=function(){lt=0,it&&(gt=rt.width,Pt=rt.height,b.resizedAttached&&b.resizedAttached.call(rt))},Ke=function(){rt=s(b),it=rt.width!==gt||rt.height!==Pt,it&&!lt&&(lt=n(de)),_e()},Mr=function(ee,he,be){ee.attachEvent?ee.attachEvent("on"+he,be):ee.addEventListener(he,be)};Mr(I,"scroll",Ke),Mr(j,"scroll",Ke),Q=n(function(){Q=0,_e()})}}o(f,function(b){w(b,T)}),this.detach=function(b){Q||(i(Q),Q=0),u.detach(f,b)},this.reset=function(){f.resizeSensor.resetSensor()}};if(u.reset=function(f){o(f,function(T){T.resizeSensor.resetSensor()})},u.detach=function(f,T){o(f,function(Q){Q&&(Q.resizedAttached&&typeof T=="function"&&(Q.resizedAttached.remove(T),Q.resizedAttached.length())||Q.resizeSensor&&(Q.contains(Q.resizeSensor)&&Q.removeChild(Q.resizeSensor),delete Q.resizeSensor,delete Q.resizedAttached))})},typeof MutationObserver<"u"){var d=new MutationObserver(function(f){for(var T in f)if(f.hasOwnProperty(T))for(var Q=f[T].addedNodes,_=0;_<Q.length;_++)Q[_].resizeSensor&&u.reset(Q[_])});document.addEventListener("DOMContentLoaded",function(f){d.observe(document.body,{childList:!0,subtree:!0})})}return u})})(Fk);var k2t=Fk.exports;const I2t=gst(k2t);var P2t=Object.defineProperty,V2t=(t,e,r)=>e in t?P2t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ft=(t,e,r)=>(V2t(t,typeof e!="symbol"?e+"":e,r),r),mv=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},ut=(t,e,r)=>(mv(t,e,"read from private field"),r?r.call(t):e.get(t)),te=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},me=(t,e,r,n)=>(mv(t,e,"write to private field"),e.set(t,r),r),ae=(t,e,r)=>(mv(t,e,"access private method"),r);function R2t(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function u3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function jk(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var f1=function(t){try{return!!t()}catch{return!0}},N2t=f1,gv=!N2t(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),zk=gv,Uk=Function.prototype,yv=Uk.call,D2t=zk&&Uk.bind.bind(yv,yv),Io=zk?D2t:function(t){return function(){return yv.apply(t,arguments)}},Gk=Io,B2t=Gk({}.toString),F2t=Gk("".slice),Kc=function(t){return F2t(B2t(t),8,-1)},j2t=Io,z2t=f1,U2t=Kc,_v=Object,G2t=j2t("".split),$2t=z2t(function(){return!_v("z").propertyIsEnumerable(0)})?function(t){return U2t(t)==="String"?G2t(t,""):_v(t)}:_v,Yc=function(t){return t==null},Z2t=Yc,W2t=TypeError,ip=function(t){if(Z2t(t))throw new W2t("Can't call method on "+t);return t},q2t=$2t,X2t=ip,q5=function(t){return q2t(X2t(t))},Jc=function(t){return t&&t.Math===Math&&t},rs=Jc(typeof globalThis=="object"&&globalThis)||Jc(typeof window=="object"&&window)||Jc(typeof self=="object"&&self)||Jc(typeof P=="object"&&P)||Jc(typeof P=="object"&&P)||function(){return this}()||Function("return this")(),$k={exports:{}},Zk=rs,K2t=Object.defineProperty,vv=function(t,e){try{K2t(Zk,t,{value:e,configurable:!0,writable:!0})}catch{Zk[t]=e}return e},Y2t=rs,J2t=vv,Wk="__core-js_shared__",qk=$k.exports=Y2t[Wk]||J2t(Wk,{});(qk.versions||(qk.versions=[])).push({version:"3.37.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.0/LICENSE",source:"https://github.com/zloirock/core-js"});var bv=$k.exports,Xk=bv,Kk=function(t,e){return Xk[t]||(Xk[t]=e||{})},t3t=ip,e3t=Object,Yk=function(t){return e3t(t3t(t))},r3t=Io,n3t=Yk,i3t=r3t({}.hasOwnProperty),qa=Object.hasOwn||function(t,e){return i3t(n3t(t),e)},o3t=Io,s3t=0,a3t=Math.random(),l3t=o3t(1 .toString),Lv=function(t){return"Symbol("+(t===void 0?"":t)+")_"+l3t(++s3t+a3t,36)},c3t=typeof navigator<"u"&&String(navigator.userAgent)||"",Jk=rs,wv=c3t,tI=Jk.process,eI=Jk.Deno,rI=tI&&tI.versions||eI&&eI.version,nI=rI&&rI.v8,ga,op;nI&&(ga=nI.split("."),op=ga[0]>0&&ga[0]<4?1:+(ga[0]+ga[1])),!op&&wv&&(ga=wv.match(/Edge\/(\d+)/),(!ga||ga[1]>=74)&&(ga=wv.match(/Chrome\/(\d+)/),ga&&(op=+ga[1])));var u3t=op,iI=u3t,h3t=f1,d3t=rs,p3t=d3t.String,oI=!!Object.getOwnPropertySymbols&&!h3t(function(){var t=Symbol("symbol detection");return!p3t(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&iI&&iI<41}),f3t=oI,sI=f3t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",T3t=rs,Q3t=Kk,aI=qa,m3t=Lv,g3t=oI,y3t=sI,X5=T3t.Symbol,xv=Q3t("wks"),_3t=y3t?X5.for||X5:X5&&X5.withoutSetter||m3t,Is=function(t){return aI(xv,t)||(xv[t]=g3t&&aI(X5,t)?X5[t]:_3t("Symbol."+t)),xv[t]},Ev=typeof document=="object"&&document.all,Zo=typeof Ev>"u"&&Ev!==void 0?function(t){return typeof t=="function"||t===Ev}:function(t){return typeof t=="function"},v3t=Zo,Ps=function(t){return typeof t=="object"?t!==null:v3t(t)},b3t=Ps,L3t=String,w3t=TypeError,h4=function(t){if(b3t(t))return t;throw new w3t(L3t(t)+" is not an object")},lI={},x3t=f1,ya=!x3t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),E3t=ya,S3t=f1,cI=E3t&&S3t(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Xa={},M3t=rs,uI=Ps,Sv=M3t.document,H3t=uI(Sv)&&uI(Sv.createElement),Mv=function(t){return H3t?Sv.createElement(t):{}},C3t=ya,A3t=f1,O3t=Mv,hI=!C3t&&!A3t(function(){return Object.defineProperty(O3t("div"),"a",{get:function(){return 7}}).a!==7}),k3t=gv,sp=Function.prototype.call,h3=k3t?sp.bind(sp):function(){return sp.apply(sp,arguments)},Hv=rs,I3t=Zo,P3t=function(t){return I3t(t)?t:void 0},t8=function(t,e){return arguments.length<2?P3t(Hv[t]):Hv[t]&&Hv[t][e]},V3t=Io,Cv=V3t({}.isPrototypeOf),R3t=t8,N3t=Zo,D3t=Cv,B3t=sI,F3t=Object,dI=B3t?function(t){return typeof t=="symbol"}:function(t){var e=R3t("Symbol");return N3t(e)&&D3t(e.prototype,F3t(t))},j3t=String,Av=function(t){try{return j3t(t)}catch{return"Object"}},z3t=Zo,U3t=Av,G3t=TypeError,e8=function(t){if(z3t(t))return t;throw new G3t(U3t(t)+" is not a function")},$3t=e8,Z3t=Yc,Ov=function(t,e){var r=t[e];return Z3t(r)?void 0:$3t(r)},kv=h3,Iv=Zo,Pv=Ps,W3t=TypeError,q3t=function(t,e){var r,n;if(e==="string"&&Iv(r=t.toString)&&!Pv(n=kv(r,t))||Iv(r=t.valueOf)&&!Pv(n=kv(r,t))||e!=="string"&&Iv(r=t.toString)&&!Pv(n=kv(r,t)))return n;throw new W3t("Can't convert object to primitive value")},X3t=h3,pI=Ps,fI=dI,K3t=Ov,Y3t=q3t,J3t=Is,t4t=TypeError,e4t=J3t("toPrimitive"),r4t=function(t,e){if(!pI(t)||fI(t))return t;var r=K3t(t,e4t),n;if(r){if(e===void 0&&(e="default"),n=X3t(r,t,e),!pI(n)||fI(n))return n;throw new t4t("Can't convert object to primitive value")}return e===void 0&&(e="number"),Y3t(t,e)},n4t=r4t,i4t=dI,TI=function(t){var e=n4t(t,"string");return i4t(e)?e:e+""},o4t=ya,s4t=hI,a4t=cI,ap=h4,QI=TI,l4t=TypeError,Vv=Object.defineProperty,c4t=Object.getOwnPropertyDescriptor,Rv="enumerable",Nv="configurable",Dv="writable";Xa.f=o4t?a4t?function(t,e,r){if(ap(t),e=QI(e),ap(r),typeof t=="function"&&e==="prototype"&&"value"in r&&Dv in r&&!r[Dv]){var n=c4t(t,e);n&&n[Dv]&&(t[e]=r.value,r={configurable:Nv in r?r[Nv]:n[Nv],enumerable:Rv in r?r[Rv]:n[Rv],writable:!1})}return Vv(t,e,r)}:Vv:function(t,e,r){if(ap(t),e=QI(e),ap(r),s4t)try{return Vv(t,e,r)}catch{}if("get"in r||"set"in r)throw new l4t("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var u4t=Math.ceil,h4t=Math.floor,d4t=Math.trunc||function(t){var e=+t;return(e>0?h4t:u4t)(e)},p4t=d4t,lp=function(t){var e=+t;return e!==e||e===0?0:p4t(e)},f4t=lp,T4t=Math.max,Q4t=Math.min,m4t=function(t,e){var r=f4t(t);return r<0?T4t(r+e,0):Q4t(r,e)},g4t=lp,y4t=Math.min,_4t=function(t){var e=g4t(t);return e>0?y4t(e,9007199254740991):0},v4t=_4t,mI=function(t){return v4t(t.length)},b4t=q5,L4t=m4t,w4t=mI,gI=function(t){return function(e,r,n){var i=b4t(e),o=w4t(i);if(o===0)return!t&&-1;var s=L4t(n,o),a;if(t&&r!==r){for(;o>s;)if(a=i[s++],a!==a)return!0}else for(;o>s;s++)if((t||s in i)&&i[s]===r)return t||s||0;return!t&&-1}},x4t={includes:gI(!0),indexOf:gI(!1)},cp={},E4t=Io,Bv=qa,S4t=q5,M4t=x4t.indexOf,H4t=cp,yI=E4t([].push),_I=function(t,e){var r=S4t(t),n=0,i=[],o;for(o in r)!Bv(H4t,o)&&Bv(r,o)&&yI(i,o);for(;e.length>n;)Bv(r,o=e[n++])&&(~M4t(i,o)||yI(i,o));return i},Fv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],C4t=_I,A4t=Fv,O4t=Object.keys||function(t){return C4t(t,A4t)},k4t=ya,I4t=cI,P4t=Xa,V4t=h4,R4t=q5,N4t=O4t;lI.f=k4t&&!I4t?Object.defineProperties:function(t,e){V4t(t);for(var r=R4t(e),n=N4t(e),i=n.length,o=0,s;i>o;)P4t.f(t,s=n[o++],r[s]);return t};var D4t=t8,B4t=D4t("document","documentElement"),F4t=Kk,j4t=Lv,vI=F4t("keys"),jv=function(t){return vI[t]||(vI[t]=j4t(t))},z4t=h4,U4t=lI,bI=Fv,G4t=cp,$4t=B4t,Z4t=Mv,W4t=jv,LI=">",wI="<",zv="prototype",Uv="script",xI=W4t("IE_PROTO"),Gv=function(){},EI=function(t){return wI+Uv+LI+t+wI+"/"+Uv+LI},SI=function(t){t.write(EI("")),t.close();var e=t.parentWindow.Object;return t=null,e},q4t=function(){var t=Z4t("iframe"),e="java"+Uv+":",r;return t.style.display="none",$4t.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(EI("document.F=Object")),r.close(),r.F},up,hp=function(){try{up=new ActiveXObject("htmlfile")}catch{}hp=typeof document<"u"?document.domain&&up?SI(up):q4t():SI(up);for(var t=bI.length;t--;)delete hp[zv][bI[t]];return hp()};G4t[xI]=!0;var $v=Object.create||function(t,e){var r;return t!==null?(Gv[zv]=z4t(t),r=new Gv,Gv[zv]=null,r[xI]=t):r=hp(),e===void 0?r:U4t.f(r,e)},X4t=Is,K4t=$v,Y4t=Xa.f,Zv=X4t("unscopables"),Wv=Array.prototype;Wv[Zv]===void 0&&Y4t(Wv,Zv,{configurable:!0,value:K4t(null)});var J4t=function(t){Wv[Zv][t]=!0},r8={},t6t=rs,e6t=Zo,MI=t6t.WeakMap,r6t=e6t(MI)&&/native code/.test(String(MI)),qv=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},n6t=ya,i6t=Xa,o6t=qv,dp=n6t?function(t,e,r){return i6t.f(t,e,o6t(1,r))}:function(t,e,r){return t[e]=r,t},s6t=r6t,HI=rs,a6t=Ps,l6t=dp,Xv=qa,Kv=bv,c6t=jv,u6t=cp,CI="Object already initialized",Yv=HI.TypeError,h6t=HI.WeakMap,pp,n8,fp,d6t=function(t){return fp(t)?n8(t):pp(t,{})},p6t=function(t){return function(e){var r;if(!a6t(e)||(r=n8(e)).type!==t)throw new Yv("Incompatible receiver, "+t+" required");return r}};if(s6t||Kv.state){var Ka=Kv.state||(Kv.state=new h6t);Ka.get=Ka.get,Ka.has=Ka.has,Ka.set=Ka.set,pp=function(t,e){if(Ka.has(t))throw new Yv(CI);return e.facade=t,Ka.set(t,e),e},n8=function(t){return Ka.get(t)||{}},fp=function(t){return Ka.has(t)}}else{var K5=c6t("state");u6t[K5]=!0,pp=function(t,e){if(Xv(t,K5))throw new Yv(CI);return e.facade=t,l6t(t,K5,e),e},n8=function(t){return Xv(t,K5)?t[K5]:{}},fp=function(t){return Xv(t,K5)}}var Tp={set:pp,get:n8,has:fp,enforce:d6t,getterFor:p6t},Jv={},AI={},OI={}.propertyIsEnumerable,kI=Object.getOwnPropertyDescriptor,f6t=kI&&!OI.call({1:2},1);AI.f=f6t?function(t){var e=kI(this,t);return!!e&&e.enumerable}:OI;var T6t=ya,Q6t=h3,m6t=AI,g6t=qv,y6t=q5,_6t=TI,v6t=qa,b6t=hI,II=Object.getOwnPropertyDescriptor;Jv.f=T6t?II:function(t,e){if(t=y6t(t),e=_6t(e),b6t)try{return II(t,e)}catch{}if(v6t(t,e))return g6t(!Q6t(m6t.f,t,e),t[e])};var PI={exports:{}},tb=ya,L6t=qa,VI=Function.prototype,w6t=tb&&Object.getOwnPropertyDescriptor,eb=L6t(VI,"name"),x6t=eb&&(function(){}).name==="something",E6t=eb&&(!tb||tb&&w6t(VI,"name").configurable),RI={EXISTS:eb,PROPER:x6t,CONFIGURABLE:E6t},S6t=Io,M6t=Zo,rb=bv,H6t=S6t(Function.toString);M6t(rb.inspectSource)||(rb.inspectSource=function(t){return H6t(t)});var C6t=rb.inspectSource,nb=Io,A6t=f1,O6t=Zo,Qp=qa,ib=ya,k6t=RI.CONFIGURABLE,I6t=C6t,NI=Tp,P6t=NI.enforce,V6t=NI.get,DI=String,mp=Object.defineProperty,R6t=nb("".slice),N6t=nb("".replace),D6t=nb([].join),B6t=ib&&!A6t(function(){return mp(function(){},"length",{value:8}).length!==8}),F6t=String(String).split("String"),j6t=PI.exports=function(t,e,r){R6t(DI(e),0,7)==="Symbol("&&(e="["+N6t(DI(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Qp(t,"name")||k6t&&t.name!==e)&&(ib?mp(t,"name",{value:e,configurable:!0}):t.name=e),B6t&&r&&Qp(r,"arity")&&t.length!==r.arity&&mp(t,"length",{value:r.arity});try{r&&Qp(r,"constructor")&&r.constructor?ib&&mp(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=P6t(t);return Qp(n,"source")||(n.source=D6t(F6t,typeof e=="string"?e:"")),t};Function.prototype.toString=j6t(function(){return O6t(this)&&V6t(this).source||I6t(this)},"toString");var BI=PI.exports,z6t=Zo,U6t=Xa,G6t=BI,$6t=vv,Y5=function(t,e,r,n){n||(n={});var i=n.enumerable,o=n.name!==void 0?n.name:e;if(z6t(r)&&G6t(r,o,n),n.global)i?t[e]=r:$6t(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=r:U6t.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},gp={},Z6t=_I,W6t=Fv,q6t=W6t.concat("length","prototype");gp.f=Object.getOwnPropertyNames||function(t){return Z6t(t,q6t)};var FI={};FI.f=Object.getOwnPropertySymbols;var X6t=t8,K6t=Io,Y6t=gp,J6t=FI,t0t=h4,e0t=K6t([].concat),r0t=X6t("Reflect","ownKeys")||function(t){var e=Y6t.f(t0t(t)),r=J6t.f;return r?e0t(e,r(t)):e},jI=qa,n0t=r0t,i0t=Jv,o0t=Xa,s0t=function(t,e,r){for(var n=n0t(e),i=o0t.f,o=i0t.f,s=0;s<n.length;s++){var a=n[s];!jI(t,a)&&!(r&&jI(r,a))&&i(t,a,o(e,a))}},a0t=f1,l0t=Zo,c0t=/#|\.prototype\./,i8=function(t,e){var r=h0t[u0t(t)];return r===p0t?!0:r===d0t?!1:l0t(e)?a0t(e):!!e},u0t=i8.normalize=function(t){return String(t).replace(c0t,".").toLowerCase()},h0t=i8.data={},d0t=i8.NATIVE="N",p0t=i8.POLYFILL="P",zI=i8,yp=rs,f0t=Jv.f,T0t=dp,Q0t=Y5,m0t=vv,g0t=s0t,y0t=zI,Ya=function(t,e){var r=t.target,n=t.global,i=t.stat,o,s,a,u,d,f;if(n?s=yp:i?s=yp[r]||m0t(r,{}):s=yp[r]&&yp[r].prototype,s)for(a in e){if(d=e[a],t.dontCallGetSet?(f=f0t(s,a),u=f&&f.value):u=s[a],o=y0t(n?a:r+(i?".":"#")+a,t.forced),!o&&u!==void 0){if(typeof d==typeof u)continue;g0t(d,u)}(t.sham||u&&u.sham)&&T0t(d,"sham",!0),Q0t(s,a,d,t)}},_0t=f1,v0t=!_0t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),b0t=qa,L0t=Zo,w0t=Yk,x0t=jv,E0t=v0t,UI=x0t("IE_PROTO"),ob=Object,S0t=ob.prototype,GI=E0t?ob.getPrototypeOf:function(t){var e=w0t(t);if(b0t(e,UI))return e[UI];var r=e.constructor;return L0t(r)&&e instanceof r?r.prototype:e instanceof ob?S0t:null},M0t=f1,H0t=Zo,C0t=Ps,$I=GI,A0t=Y5,O0t=Is,sb=O0t("iterator"),ZI=!1,r0,ab,lb;[].keys&&(lb=[].keys(),"next"in lb?(ab=$I($I(lb)),ab!==Object.prototype&&(r0=ab)):ZI=!0);var k0t=!C0t(r0)||M0t(function(){var t={};return r0[sb].call(t)!==t});k0t&&(r0={}),H0t(r0[sb])||A0t(r0,sb,function(){return this});var WI={IteratorPrototype:r0,BUGGY_SAFARI_ITERATORS:ZI},I0t=Xa.f,P0t=qa,V0t=Is,qI=V0t("toStringTag"),_p=function(t,e,r){t&&!r&&(t=t.prototype),t&&!P0t(t,qI)&&I0t(t,qI,{configurable:!0,value:e})},R0t=WI.IteratorPrototype,N0t=$v,D0t=qv,B0t=_p,F0t=r8,j0t=function(){return this},z0t=function(t,e,r,n){var i=e+" Iterator";return t.prototype=N0t(R0t,{next:D0t(+!n,r)}),B0t(t,i,!1),F0t[i]=j0t,t},U0t=Io,G0t=e8,XI=function(t,e,r){try{return U0t(G0t(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}},$0t=Ps,Z0t=function(t){return $0t(t)||t===null},W0t=Z0t,q0t=String,X0t=TypeError,K0t=function(t){if(W0t(t))return t;throw new X0t("Can't set "+q0t(t)+" as a prototype")},Y0t=XI,J0t=Ps,t5t=ip,e5t=K0t,KI=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=Y0t(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(n,i){return t5t(n),e5t(i),J0t(n)&&(t?r(n,i):n.__proto__=i),n}}():void 0),r5t=Ya,n5t=h3,YI=RI,i5t=Zo,o5t=z0t,JI=GI,tP=KI,s5t=_p,a5t=dp,cb=Y5,l5t=Is,c5t=r8,eP=WI,u5t=YI.PROPER,h5t=YI.CONFIGURABLE,rP=eP.IteratorPrototype,vp=eP.BUGGY_SAFARI_ITERATORS,o8=l5t("iterator"),nP="keys",s8="values",iP="entries",d5t=function(){return this},ub=function(t,e,r,n,i,o,s){o5t(r,e,n);var a=function(E){if(E===i&&Q)return Q;if(!vp&&E&&E in f)return f[E];switch(E){case nP:return function(){return new r(this,E)};case s8:return function(){return new r(this,E)};case iP:return function(){return new r(this,E)}}return function(){return new r(this)}},u=e+" Iterator",d=!1,f=t.prototype,T=f[o8]||f["@@iterator"]||i&&f[i],Q=!vp&&T||a(i),_=e==="Array"&&f.entries||T,w,b,S;if(_&&(w=JI(_.call(new t)),w!==Object.prototype&&w.next&&(JI(w)!==rP&&(tP?tP(w,rP):i5t(w[o8])||cb(w,o8,d5t)),s5t(w,u,!0))),u5t&&i===s8&&T&&T.name!==s8&&(h5t?a5t(f,"name",s8):(d=!0,Q=function(){return n5t(T,this)})),i)if(b={values:a(s8),keys:o?Q:a(nP),entries:a(iP)},s)for(S in b)(vp||d||!(S in f))&&cb(f,S,b[S]);else r5t({target:e,proto:!0,forced:vp||d},b);return f[o8]!==Q&&cb(f,o8,Q,{name:i}),c5t[e]=Q,b},hb=function(t,e){return{value:t,done:e}},p5t=q5,db=J4t,oP=r8,sP=Tp,f5t=Xa.f,T5t=ub,bp=hb,Q5t=ya,aP="Array Iterator",m5t=sP.set,g5t=sP.getterFor(aP),y5t=T5t(Array,"Array",function(t,e){m5t(this,{type:aP,target:p5t(t),index:0,kind:e})},function(){var t=g5t(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,bp(void 0,!0);switch(t.kind){case"keys":return bp(r,!1);case"values":return bp(e[r],!1)}return bp([r,e[r]],!1)},"values"),lP=oP.Arguments=oP.Array;if(db("keys"),db("values"),db("entries"),Q5t&&lP.name!=="values")try{f5t(lP,"name",{value:"values"})}catch{}var _5t=Is,v5t=_5t("toStringTag"),cP={};cP[v5t]="z";var pb=String(cP)==="[object z]",b5t=pb,L5t=Zo,Lp=Kc,w5t=Is,x5t=w5t("toStringTag"),E5t=Object,S5t=Lp(function(){return arguments}())==="Arguments",M5t=function(t,e){try{return t[e]}catch{}},fb=b5t?Lp:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=M5t(e=E5t(t),x5t))=="string"?r:S5t?Lp(e):(n=Lp(e))==="Object"&&L5t(e.callee)?"Arguments":n},H5t=pb,C5t=fb,A5t=H5t?{}.toString:function(){return"[object "+C5t(this)+"]"},O5t=pb,k5t=Y5,I5t=A5t;O5t||k5t(Object.prototype,"toString",I5t,{unsafe:!0});var uP={exports:{}},hP={},P5t=Io,V5t=P5t([].slice),R5t=Kc,N5t=q5,dP=gp.f,D5t=V5t,pP=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],B5t=function(t){try{return dP(t)}catch{return D5t(pP)}};hP.f=function(t){return pP&&R5t(t)==="Window"?B5t(t):dP(N5t(t))};var F5t=f1,j5t=F5t(function(){if(typeof ArrayBuffer=="function"){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}),z5t=f1,U5t=Ps,G5t=Kc,fP=j5t,wp=Object.isExtensible,$5t=z5t(function(){wp(1)}),Z5t=$5t||fP?function(t){return!U5t(t)||fP&&G5t(t)==="ArrayBuffer"?!1:wp?wp(t):!0}:wp,W5t=f1,q5t=!W5t(function(){return Object.isExtensible(Object.preventExtensions({}))}),X5t=Ya,K5t=Io,Y5t=cp,J5t=Ps,Tb=qa,tlt=Xa.f,TP=gp,elt=hP,Qb=Z5t,rlt=Lv,nlt=q5t,QP=!1,d3=rlt("meta"),ilt=0,mb=function(t){tlt(t,d3,{value:{objectID:"O"+ilt++,weakData:{}}})},olt=function(t,e){if(!J5t(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!Tb(t,d3)){if(!Qb(t))return"F";if(!e)return"E";mb(t)}return t[d3].objectID},slt=function(t,e){if(!Tb(t,d3)){if(!Qb(t))return!0;if(!e)return!1;mb(t)}return t[d3].weakData},alt=function(t){return nlt&&QP&&Qb(t)&&!Tb(t,d3)&&mb(t),t},llt=function(){clt.enable=function(){},QP=!0;var t=TP.f,e=K5t([].splice),r={};r[d3]=1,t(r).length&&(TP.f=function(n){for(var i=t(n),o=0,s=i.length;o<s;o++)if(i[o]===d3){e(i,o,1);break}return i},X5t({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:elt.f}))},clt=uP.exports={enable:llt,fastKey:olt,getWeakData:slt,onFreeze:alt};Y5t[d3]=!0;var mP=uP.exports,ult=Kc,hlt=Io,dlt=function(t){if(ult(t)==="Function")return hlt(t)},gP=dlt,plt=e8,flt=gv,Tlt=gP(gP.bind),yP=function(t,e){return plt(t),e===void 0?t:flt?Tlt(t,e):function(){return t.apply(e,arguments)}},Qlt=Is,mlt=r8,glt=Qlt("iterator"),ylt=Array.prototype,_lt=function(t){return t!==void 0&&(mlt.Array===t||ylt[glt]===t)},vlt=fb,_P=Ov,blt=Yc,Llt=r8,wlt=Is,xlt=wlt("iterator"),vP=function(t){if(!blt(t))return _P(t,xlt)||_P(t,"@@iterator")||Llt[vlt(t)]},Elt=h3,Slt=e8,Mlt=h4,Hlt=Av,Clt=vP,Alt=TypeError,Olt=function(t,e){var r=arguments.length<2?Clt(t):e;if(Slt(r))return Mlt(Elt(r,t));throw new Alt(Hlt(t)+" is not iterable")},klt=h3,bP=h4,Ilt=Ov,gb=function(t,e,r){var n,i;bP(t);try{if(n=Ilt(t,"return"),!n){if(e==="throw")throw r;return r}n=klt(n,t)}catch(o){i=!0,n=o}if(e==="throw")throw r;if(i)throw n;return bP(n),r},Plt=yP,Vlt=h3,Rlt=h4,Nlt=Av,Dlt=_lt,Blt=mI,LP=Cv,Flt=Olt,jlt=vP,wP=gb,zlt=TypeError,xp=function(t,e){this.stopped=t,this.result=e},xP=xp.prototype,EP=function(t,e,r){var n=r&&r.that,i=!!(r&&r.AS_ENTRIES),o=!!(r&&r.IS_RECORD),s=!!(r&&r.IS_ITERATOR),a=!!(r&&r.INTERRUPTED),u=Plt(e,n),d,f,T,Q,_,w,b,S=function(O){return d&&wP(d,"normal",O),new xp(!0,O)},E=function(O){return i?(Rlt(O),a?u(O[0],O[1],S):u(O[0],O[1])):a?u(O,S):u(O)};if(o)d=t.iterator;else if(s)d=t;else{if(f=jlt(t),!f)throw new zlt(Nlt(t)+" is not iterable");if(Dlt(f)){for(T=0,Q=Blt(t);Q>T;T++)if(_=E(t[T]),_&&LP(xP,_))return _;return new xp(!1)}d=Flt(t,f)}for(w=o?t.next:d.next;!(b=Vlt(w,d)).done;){try{_=E(b.value)}catch(O){wP(d,"throw",O)}if(typeof _=="object"&&_&&LP(xP,_))return _}return new xp(!1)},Ult=Cv,Glt=TypeError,SP=function(t,e){if(Ult(e,t))return t;throw new Glt("Incorrect invocation")},$lt=Is,MP=$lt("iterator"),HP=!1;try{var Zlt=0,CP={next:function(){return{done:!!Zlt++}},return:function(){HP=!0}};CP[MP]=function(){return this},Array.from(CP,function(){throw 2})}catch{}var Wlt=function(t,e){try{if(!e&&!HP)return!1}catch{return!1}var r=!1;try{var n={};n[MP]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r},qlt=Zo,Xlt=Ps,AP=KI,Klt=function(t,e,r){var n,i;return AP&&qlt(n=e.constructor)&&n!==r&&Xlt(i=n.prototype)&&i!==r.prototype&&AP(t,i),t},Ylt=Ya,Jlt=rs,t7t=Io,OP=zI,e7t=Y5,r7t=mP,n7t=EP,i7t=SP,o7t=Zo,s7t=Yc,yb=Ps,_b=f1,a7t=Wlt,l7t=_p,c7t=Klt,u7t=function(t,e,r){var n=t.indexOf("Map")!==-1,i=t.indexOf("Weak")!==-1,o=n?"set":"add",s=Jlt[t],a=s&&s.prototype,u=s,d={},f=function(E){var O=t7t(a[E]);e7t(a,E,E==="add"?function(I){return O(this,I===0?0:I),this}:E==="delete"?function(I){return i&&!yb(I)?!1:O(this,I===0?0:I)}:E==="get"?function(I){return i&&!yb(I)?void 0:O(this,I===0?0:I)}:E==="has"?function(I){return i&&!yb(I)?!1:O(this,I===0?0:I)}:function(I,D){return O(this,I===0?0:I,D),this})},T=OP(t,!o7t(s)||!(i||a.forEach&&!_b(function(){new s().entries().next()})));if(T)u=r.getConstructor(e,t,n,o),r7t.enable();else if(OP(t,!0)){var Q=new u,_=Q[o](i?{}:-0,1)!==Q,w=_b(function(){Q.has(1)}),b=a7t(function(E){new s(E)}),S=!i&&_b(function(){for(var E=new s,O=5;O--;)E[o](O,O);return!E.has(-0)});b||(u=e(function(E,O){i7t(E,a);var I=c7t(new s,E,u);return s7t(O)||n7t(O,I[o],{that:I,AS_ENTRIES:n}),I}),u.prototype=a,a.constructor=u),(w||S)&&(f("delete"),f("has"),n&&f("get")),(S||_)&&f(o),i&&a.clear&&delete a.clear}return d[t]=u,Ylt({global:!0,constructor:!0,forced:u!==s},d),l7t(u,t),i||r.setStrong(u,t,n),u},kP=BI,h7t=Xa,IP=function(t,e,r){return r.get&&kP(r.get,e,{getter:!0}),r.set&&kP(r.set,e,{setter:!0}),h7t.f(t,e,r)},d7t=Y5,p7t=function(t,e,r){for(var n in e)d7t(t,n,e[n],r);return t},f7t=t8,T7t=IP,Q7t=Is,m7t=ya,PP=Q7t("species"),g7t=function(t){var e=f7t(t);m7t&&e&&!e[PP]&&T7t(e,PP,{configurable:!0,get:function(){return this}})},VP=$v,y7t=IP,RP=p7t,_7t=yP,v7t=SP,b7t=Yc,L7t=EP,w7t=ub,NP=hb,x7t=g7t,a8=ya,DP=mP.fastKey,BP=Tp,FP=BP.set,vb=BP.getterFor,E7t={getConstructor:function(t,e,r,n){var i=t(function(d,f){v7t(d,o),FP(d,{type:e,index:VP(null),first:void 0,last:void 0,size:0}),a8||(d.size=0),b7t(f)||L7t(f,d[n],{that:d,AS_ENTRIES:r})}),o=i.prototype,s=vb(e),a=function(d,f,T){var Q=s(d),_=u(d,f),w,b;return _?_.value=T:(Q.last=_={index:b=DP(f,!0),key:f,value:T,previous:w=Q.last,next:void 0,removed:!1},Q.first||(Q.first=_),w&&(w.next=_),a8?Q.size++:d.size++,b!=="F"&&(Q.index[b]=_)),d},u=function(d,f){var T=s(d),Q=DP(f),_;if(Q!=="F")return T.index[Q];for(_=T.first;_;_=_.next)if(_.key===f)return _};return RP(o,{clear:function(){for(var d=this,f=s(d),T=f.first;T;)T.removed=!0,T.previous&&(T.previous=T.previous.next=void 0),T=T.next;f.first=f.last=void 0,f.index=VP(null),a8?f.size=0:d.size=0},delete:function(d){var f=this,T=s(f),Q=u(f,d);if(Q){var _=Q.next,w=Q.previous;delete T.index[Q.index],Q.removed=!0,w&&(w.next=_),_&&(_.previous=w),T.first===Q&&(T.first=_),T.last===Q&&(T.last=w),a8?T.size--:f.size--}return!!Q},forEach:function(d){for(var f=s(this),T=_7t(d,arguments.length>1?arguments[1]:void 0),Q;Q=Q?Q.next:f.first;)for(T(Q.value,Q.key,this);Q&&Q.removed;)Q=Q.previous},has:function(d){return!!u(this,d)}}),RP(o,r?{get:function(d){var f=u(this,d);return f&&f.value},set:function(d,f){return a(this,d===0?0:d,f)}}:{add:function(d){return a(this,d=d===0?0:d,d)}}),a8&&y7t(o,"size",{configurable:!0,get:function(){return s(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=vb(e),o=vb(n);w7t(t,e,function(s,a){FP(this,{type:n,target:s,state:i(s),kind:a,last:void 0})},function(){for(var s=o(this),a=s.kind,u=s.last;u&&u.removed;)u=u.previous;return!s.target||!(s.last=u=u?u.next:s.state.first)?(s.target=void 0,NP(void 0,!0)):NP(a==="keys"?u.key:a==="values"?u.value:[u.key,u.value],!1)},r?"entries":"values",!r,!0),x7t(e)}},S7t=u7t,M7t=E7t;S7t("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},M7t);var bb=Io,Ep=Set.prototype,Ja={Set,add:bb(Ep.add),has:bb(Ep.has),remove:bb(Ep.delete),proto:Ep},H7t=Ja.has,n0=function(t){return H7t(t),t},C7t=h3,i0=function(t,e,r){for(var n=r?t:t.iterator,i=t.next,o,s;!(o=C7t(i,n)).done;)if(s=e(o.value),s!==void 0)return s},jP=Io,A7t=i0,zP=Ja,O7t=zP.Set,UP=zP.proto,k7t=jP(UP.forEach),GP=jP(UP.keys),I7t=GP(new O7t).next,l8=function(t,e,r){return r?A7t({iterator:GP(t),next:I7t},e):k7t(t,e)},$P=Ja,P7t=l8,V7t=$P.Set,R7t=$P.add,Lb=function(t){var e=new V7t;return P7t(t,function(r){R7t(e,r)}),e},N7t=XI,D7t=Ja,c8=N7t(D7t.proto,"size","get")||function(t){return t.size},B7t=function(t){return{iterator:t,next:t.next,done:!1}},ZP=e8,WP=h4,qP=h3,F7t=lp,j7t=B7t,XP="Invalid size",z7t=RangeError,U7t=TypeError,G7t=Math.max,KP=function(t,e){this.set=t,this.size=G7t(e,0),this.has=ZP(t.has),this.keys=ZP(t.keys)};KP.prototype={getIterator:function(){return j7t(WP(qP(this.keys,this.set)))},includes:function(t){return qP(this.has,this.set,t)}};var o0=function(t){WP(t);var e=+t.size;if(e!==e)throw new U7t(XP);var r=F7t(e);if(r<0)throw new z7t(XP);return new KP(t,r)},$7t=n0,YP=Ja,Z7t=Lb,W7t=c8,q7t=o0,X7t=l8,K7t=i0,Y7t=YP.has,JP=YP.remove,J7t=function(t){var e=$7t(this),r=q7t(t),n=Z7t(e);return W7t(e)<=r.size?X7t(e,function(i){r.includes(i)&&JP(n,i)}):K7t(r.getIterator(),function(i){Y7t(e,i)&&JP(n,i)}),n},tct=t8,tV=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},s0=function(t){var e=tct("Set");try{new e()[t](tV(0));try{return new e()[t](tV(-1)),!1}catch{return!0}}catch{return!1}},ect=Ya,rct=J7t,nct=s0;ect({target:"Set",proto:!0,real:!0,forced:!nct("difference")},{difference:rct});var ict=n0,wb=Ja,oct=c8,sct=o0,act=l8,lct=i0,cct=wb.Set,eV=wb.add,uct=wb.has,hct=function(t){var e=ict(this),r=sct(t),n=new cct;return oct(e)>r.size?lct(r.getIterator(),function(i){uct(e,i)&&eV(n,i)}):act(e,function(i){r.includes(i)&&eV(n,i)}),n},dct=Ya,pct=f1,fct=hct,Tct=s0,Qct=!Tct("intersection")||pct(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});dct({target:"Set",proto:!0,real:!0,forced:Qct},{intersection:fct});var mct=n0,gct=Ja.has,yct=c8,_ct=o0,vct=l8,bct=i0,Lct=gb,wct=function(t){var e=mct(this),r=_ct(t);if(yct(e)<=r.size)return vct(e,function(i){if(r.includes(i))return!1},!0)!==!1;var n=r.getIterator();return bct(n,function(i){if(gct(e,i))return Lct(n,"normal",!1)})!==!1},xct=Ya,Ect=wct,Sct=s0;xct({target:"Set",proto:!0,real:!0,forced:!Sct("isDisjointFrom")},{isDisjointFrom:Ect});var Mct=n0,Hct=c8,Cct=l8,Act=o0,Oct=function(t){var e=Mct(this),r=Act(t);return Hct(e)>r.size?!1:Cct(e,function(n){if(!r.includes(n))return!1},!0)!==!1},kct=Ya,Ict=Oct,Pct=s0;kct({target:"Set",proto:!0,real:!0,forced:!Pct("isSubsetOf")},{isSubsetOf:Ict});var Vct=n0,Rct=Ja.has,Nct=c8,Dct=o0,Bct=i0,Fct=gb,jct=function(t){var e=Vct(this),r=Dct(t);if(Nct(e)<r.size)return!1;var n=r.getIterator();return Bct(n,function(i){if(!Rct(e,i))return Fct(n,"normal",!1)})!==!1},zct=Ya,Uct=jct,Gct=s0;zct({target:"Set",proto:!0,real:!0,forced:!Gct("isSupersetOf")},{isSupersetOf:Uct});var $ct=n0,xb=Ja,Zct=Lb,Wct=o0,qct=i0,Xct=xb.add,Kct=xb.has,Yct=xb.remove,Jct=function(t){var e=$ct(this),r=Wct(t).getIterator(),n=Zct(e);return qct(r,function(i){Kct(e,i)?Yct(n,i):Xct(n,i)}),n},t8t=Ya,e8t=Jct,r8t=s0;t8t({target:"Set",proto:!0,real:!0,forced:!r8t("symmetricDifference")},{symmetricDifference:e8t});var n8t=n0,i8t=Ja.add,o8t=Lb,s8t=o0,a8t=i0,l8t=function(t){var e=n8t(this),r=s8t(t).getIterator(),n=o8t(e);return a8t(r,function(i){i8t(n,i)}),n},c8t=Ya,u8t=l8t,h8t=s0;c8t({target:"Set",proto:!0,real:!0,forced:!h8t("union")},{union:u8t});var d8t=fb,p8t=String,rV=function(t){if(d8t(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return p8t(t)},Eb=Io,f8t=lp,T8t=rV,Q8t=ip,m8t=Eb("".charAt),nV=Eb("".charCodeAt),g8t=Eb("".slice),iV=function(t){return function(e,r){var n=T8t(Q8t(e)),i=f8t(r),o=n.length,s,a;return i<0||i>=o?t?"":void 0:(s=nV(n,i),s<55296||s>56319||i+1===o||(a=nV(n,i+1))<56320||a>57343?t?m8t(n,i):s:t?g8t(n,i,i+2):(s-55296<<10)+(a-56320)+65536)}},y8t={codeAt:iV(!1),charAt:iV(!0)},_8t=y8t.charAt,v8t=rV,oV=Tp,b8t=ub,sV=hb,aV="String Iterator",L8t=oV.set,w8t=oV.getterFor(aV);b8t(String,"String",function(t){L8t(this,{type:aV,string:v8t(t),index:0})},function(){var t=w8t(this),e=t.string,r=t.index,n;return r>=e.length?sV(void 0,!0):(n=_8t(e,r),t.index+=n.length,sV(n,!1))});var x8t=rs,E8t=x8t,S8t=E8t,M8t=S8t.Set,H8t={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},C8t=Mv,Sb=C8t("span").classList,lV=Sb&&Sb.constructor&&Sb.constructor.prototype,A8t=lV===Object.prototype?void 0:lV,cV=rs,uV=H8t,O8t=A8t,u8=y5t,hV=dp,k8t=_p,I8t=Is,Mb=I8t("iterator"),Hb=u8.values,dV=function(t,e){if(t){if(t[Mb]!==Hb)try{hV(t,Mb,Hb)}catch{t[Mb]=Hb}if(k8t(t,e,!0),uV[e]){for(var r in u8)if(t[r]!==u8[r])try{hV(t,r,u8[r])}catch{t[r]=u8[r]}}}};for(var Cb in uV)dV(cV[Cb]&&cV[Cb].prototype,Cb);dV(O8t,"DOMTokenList");var P8t=M8t,V8t=P8t,R8t=V8t,N8t=R8t;const h8=u3(N8t);var pV={exports:{}};/**
|
|
34
34
|
* MapLibre GL JS
|
|
35
35
|
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.0/LICENSE.txt
|
|
36
36
|
*/(function(t,e){(function(r,n){t.exports=n()})(P,function(){var r={},n={};function i(s,a,u){if(n[s]=u,s==="index"){var d="var sharedModule = {}; ("+n.shared+")(sharedModule); ("+n.worker+")(sharedModule);",f={};return n.shared(f),n.index(r,f),typeof window<"u"&&r.setWorkerUrl(window.URL.createObjectURL(new Blob([d],{type:"text/javascript"}))),r}}i("shared",["exports"],function(s){function a(h,c,p,g){return new(p||(p=Promise))(function(x,C){function A(U){try{N(g.next(U))}catch(W){C(W)}}function k(U){try{N(g.throw(U))}catch(W){C(W)}}function N(U){var W;U.done?x(U.value):(W=U.value,W instanceof p?W:new p(function(K){K(W)})).then(A,k)}N((g=g.apply(h,c||[])).next())})}function u(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}typeof SuppressedError=="function"&&SuppressedError;var d=f;function f(h,c){this.x=h,this.y=c}f.prototype={clone:function(){return new f(this.x,this.y)},add:function(h){return this.clone()._add(h)},sub:function(h){return this.clone()._sub(h)},multByPoint:function(h){return this.clone()._multByPoint(h)},divByPoint:function(h){return this.clone()._divByPoint(h)},mult:function(h){return this.clone()._mult(h)},div:function(h){return this.clone()._div(h)},rotate:function(h){return this.clone()._rotate(h)},rotateAround:function(h,c){return this.clone()._rotateAround(h,c)},matMult:function(h){return this.clone()._matMult(h)},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(h){return this.x===h.x&&this.y===h.y},dist:function(h){return Math.sqrt(this.distSqr(h))},distSqr:function(h){var c=h.x-this.x,p=h.y-this.y;return c*c+p*p},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(h){return Math.atan2(this.y-h.y,this.x-h.x)},angleWith:function(h){return this.angleWithSep(h.x,h.y)},angleWithSep:function(h,c){return Math.atan2(this.x*c-this.y*h,this.x*h+this.y*c)},_matMult:function(h){var c=h[2]*this.x+h[3]*this.y;return this.x=h[0]*this.x+h[1]*this.y,this.y=c,this},_add:function(h){return this.x+=h.x,this.y+=h.y,this},_sub:function(h){return this.x-=h.x,this.y-=h.y,this},_mult:function(h){return this.x*=h,this.y*=h,this},_div:function(h){return this.x/=h,this.y/=h,this},_multByPoint:function(h){return this.x*=h.x,this.y*=h.y,this},_divByPoint:function(h){return this.x/=h.x,this.y/=h.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var h=this.y;return this.y=this.x,this.x=-h,this},_rotate:function(h){var c=Math.cos(h),p=Math.sin(h),g=p*this.x+c*this.y;return this.x=c*this.x-p*this.y,this.y=g,this},_rotateAround:function(h,c){var p=Math.cos(h),g=Math.sin(h),x=c.y+g*(this.x-c.x)+p*(this.y-c.y);return this.x=c.x+p*(this.x-c.x)-g*(this.y-c.y),this.y=x,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},f.convert=function(h){return h instanceof f?h:Array.isArray(h)?new f(h[0],h[1]):h};var T=u(d),Q=_;function _(h,c,p,g){this.cx=3*h,this.bx=3*(p-h)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*c,this.by=3*(g-c)-this.cy,this.ay=1-this.cy-this.by,this.p1x=h,this.p1y=c,this.p2x=p,this.p2y=g}_.prototype={sampleCurveX:function(h){return((this.ax*h+this.bx)*h+this.cx)*h},sampleCurveY:function(h){return((this.ay*h+this.by)*h+this.cy)*h},sampleCurveDerivativeX:function(h){return(3*this.ax*h+2*this.bx)*h+this.cx},solveCurveX:function(h,c){if(c===void 0&&(c=1e-6),h<0)return 0;if(h>1)return 1;for(var p=h,g=0;g<8;g++){var x=this.sampleCurveX(p)-h;if(Math.abs(x)<c)return p;var C=this.sampleCurveDerivativeX(p);if(Math.abs(C)<1e-6)break;p-=x/C}var A=0,k=1;for(p=h,g=0;g<20&&(x=this.sampleCurveX(p),!(Math.abs(x-h)<c));g++)h>x?A=p:k=p,p=.5*(k-A)+A;return p},solve:function(h,c){return this.sampleCurveY(this.solveCurveX(h,c))}};var w=u(Q);let b,S;function E(){return b==null&&(b=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),b}function O(){if(S==null&&(S=!1,E())){const h=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(h){for(let p=0;p<5*5;p++){const g=4*p;h.fillStyle=`rgb(${g},${g+1},${g+2})`,h.fillRect(p%5,Math.floor(p/5),1,1)}const c=h.getImageData(0,0,5,5).data;for(let p=0;p<5*5*4;p++)if(p%4!=3&&c[p]!==p){S=!0;break}}}return S||!1}function I(h,c,p,g){const x=new w(h,c,p,g);return C=>x.solve(C)}const D=I(.25,.1,.25,1);function j(h,c,p){return Math.min(p,Math.max(c,h))}function $(h,c,p){const g=p-c,x=((h-c)%g+g)%g+c;return x===c?p:x}function G(h,...c){for(const p of c)for(const g in p)h[g]=p[g];return h}let tt=1;function it(h,c,p){const g={};for(const x in h)g[x]=c.call(this,h[x],x,h);return g}function lt(h,c,p){const g={};for(const x in h)c.call(this,h[x],x,h)&&(g[x]=h[x]);return g}function rt(h){return Array.isArray(h)?h.map(rt):typeof h=="object"&&h?it(h,rt):h}const gt={};function Pt(h){gt[h]||(typeof console<"u"&&console.warn(h),gt[h]=!0)}function Gt(h,c,p){return(p.y-h.y)*(c.x-h.x)>(c.y-h.y)*(p.x-h.x)}function re(h){return typeof WorkerGlobalScope<"u"&&h!==void 0&&h instanceof WorkerGlobalScope}let _e=null;function de(h){return typeof ImageBitmap<"u"&&h instanceof ImageBitmap}const Ke="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Mr(h,c,p,g,x){return a(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const C=new VideoFrame(h,{timestamp:0});try{const A=C==null?void 0:C.format;if(!A||!A.startsWith("BGR")&&!A.startsWith("RGB"))throw new Error(`Unrecognized format ${A}`);const k=A.startsWith("BGR"),N=new Uint8ClampedArray(g*x*4);if(yield C.copyTo(N,function(U,W,K,et,at){const ht=4*Math.max(-W,0),Tt=(Math.max(0,K)-K)*et*4+ht,Lt=4*et,Et=Math.max(0,W),$t=Math.max(0,K);return{rect:{x:Et,y:$t,width:Math.min(U.width,W+et)-Et,height:Math.min(U.height,K+at)-$t},layout:[{offset:Tt,stride:Lt}]}}(h,c,p,g,x)),k)for(let U=0;U<N.length;U+=4){const W=N[U];N[U]=N[U+2],N[U+2]=W}return N}finally{C.close()}})}let ee,he;const be="AbortError";function Me(){return new Error(be)}const $e={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Ue(h){return $e.REGISTERED_PROTOCOLS[h.substring(0,h.indexOf("://"))]}const We="global-dispatcher";class Ut extends Error{constructor(c,p,g,x){super(`AJAXError: ${p} (${c}): ${g}`),this.status=c,this.statusText=p,this.url=g,this.body=x}}const Xt=()=>re(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Te=function(h,c){if(/:\/\//.test(h.url)&&!/^https?:|^file:/.test(h.url)){const g=Ue(h.url);if(g)return g(h,c);if(re(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:h,targetMapId:We},c)}if(!(/^file:/.test(p=h.url)||/^file:/.test(Xt())&&!/^\w+:/.test(p))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(g,x){return a(this,void 0,void 0,function*(){const C=new Request(g.url,{method:g.method||"GET",body:g.body,credentials:g.credentials,headers:g.headers,cache:g.cache,referrer:Xt(),signal:x.signal});g.type!=="json"||C.headers.has("Accept")||C.headers.set("Accept","application/json");const A=yield fetch(C);if(!A.ok){const U=yield A.blob();throw new Ut(A.status,A.statusText,g.url,U)}let k;k=g.type==="arrayBuffer"||g.type==="image"?A.arrayBuffer():g.type==="json"?A.json():A.text();const N=yield k;if(x.signal.aborted)throw Me();return{data:N,cacheControl:A.headers.get("Cache-Control"),expires:A.headers.get("Expires")}})}(h,c);if(re(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:h,mustQueue:!0,targetMapId:We},c)}var p;return function(g,x){return new Promise((C,A)=>{var k;const N=new XMLHttpRequest;N.open(g.method||"GET",g.url,!0),g.type!=="arrayBuffer"&&g.type!=="image"||(N.responseType="arraybuffer");for(const U in g.headers)N.setRequestHeader(U,g.headers[U]);g.type==="json"&&(N.responseType="text",!((k=g.headers)===null||k===void 0)&&k.Accept||N.setRequestHeader("Accept","application/json")),N.withCredentials=g.credentials==="include",N.onerror=()=>{A(new Error(N.statusText))},N.onload=()=>{if(!x.signal.aborted)if((N.status>=200&&N.status<300||N.status===0)&&N.response!==null){let U=N.response;if(g.type==="json")try{U=JSON.parse(N.response)}catch(W){return void A(W)}C({data:U,cacheControl:N.getResponseHeader("Cache-Control"),expires:N.getResponseHeader("Expires")})}else{const U=new Blob([N.response],{type:N.getResponseHeader("Content-Type")});A(new Ut(N.status,N.statusText,g.url,U))}},x.signal.addEventListener("abort",()=>{N.abort(),A(Me())}),N.send(g.body)})}(h,c)};function le(h){if(!h||h.indexOf("://")<=0||h.indexOf("data:image/")===0||h.indexOf("blob:")===0)return!0;const c=new URL(h),p=window.location;return c.protocol===p.protocol&&c.host===p.host}function He(h,c,p){p[h]&&p[h].indexOf(c)!==-1||(p[h]=p[h]||[],p[h].push(c))}function tr(h,c,p){if(p&&p[h]){const g=p[h].indexOf(c);g!==-1&&p[h].splice(g,1)}}class Ie{constructor(c,p={}){G(this,p),this.type=c}}class Ve extends Ie{constructor(c,p={}){super("error",G({error:c},p))}}class Ye{on(c,p){return this._listeners=this._listeners||{},He(c,p,this._listeners),this}off(c,p){return tr(c,p,this._listeners),tr(c,p,this._oneTimeListeners),this}once(c,p){return p?(this._oneTimeListeners=this._oneTimeListeners||{},He(c,p,this._oneTimeListeners),this):new Promise(g=>this.once(c,g))}fire(c,p){typeof c=="string"&&(c=new Ie(c,p||{}));const g=c.type;if(this.listens(g)){c.target=this;const x=this._listeners&&this._listeners[g]?this._listeners[g].slice():[];for(const k of x)k.call(this,c);const C=this._oneTimeListeners&&this._oneTimeListeners[g]?this._oneTimeListeners[g].slice():[];for(const k of C)tr(g,k,this._oneTimeListeners),k.call(this,c);const A=this._eventedParent;A&&(G(c,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),A.fire(c))}else c instanceof Ve&&console.error(c.error);return this}listens(c){return this._listeners&&this._listeners[c]&&this._listeners[c].length>0||this._oneTimeListeners&&this._oneTimeListeners[c]&&this._oneTimeListeners[c].length>0||this._eventedParent&&this._eventedParent.listens(c)}setEventedParent(c,p){return this._eventedParent=c,this._eventedParentData=p,this}}var kt={$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 Fr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function zr(h,c){const p={};for(const g in h)g!=="ref"&&(p[g]=h[g]);return Fr.forEach(g=>{g in c&&(p[g]=c[g])}),p}function yr(h,c){if(Array.isArray(h)){if(!Array.isArray(c)||h.length!==c.length)return!1;for(let p=0;p<h.length;p++)if(!yr(h[p],c[p]))return!1;return!0}if(typeof h=="object"&&h!==null&&c!==null){if(typeof c!="object"||Object.keys(h).length!==Object.keys(c).length)return!1;for(const p in h)if(!yr(h[p],c[p]))return!1;return!0}return h===c}function br(h,c){h.push(c)}function Xr(h,c,p){br(p,{command:"addSource",args:[h,c[h]]})}function Qi(h,c,p){br(c,{command:"removeSource",args:[h]}),p[h]=!0}function bi(h,c,p,g){Qi(h,p,g),Xr(h,c,p)}function Wn(h,c,p){let g;for(g in h[p])if(Object.prototype.hasOwnProperty.call(h[p],g)&&g!=="data"&&!yr(h[p][g],c[p][g]))return!1;for(g in c[p])if(Object.prototype.hasOwnProperty.call(c[p],g)&&g!=="data"&&!yr(h[p][g],c[p][g]))return!1;return!0}function pe(h,c,p,g,x,C){h=h||{},c=c||{};for(const A in h)Object.prototype.hasOwnProperty.call(h,A)&&(yr(h[A],c[A])||p.push({command:C,args:[g,A,c[A],x]}));for(const A in c)Object.prototype.hasOwnProperty.call(c,A)&&!Object.prototype.hasOwnProperty.call(h,A)&&(yr(h[A],c[A])||p.push({command:C,args:[g,A,c[A],x]}))}function mr(h){return h.id}function Kr(h,c){return h[c.id]=c,h}class fe{constructor(c,p,g,x){this.message=(c?`${c}: `:"")+g,x&&(this.identifier=x),p!=null&&p.__line__&&(this.line=p.__line__)}}function mi(h,...c){for(const p of c)for(const g in p)h[g]=p[g];return h}class Rn extends Error{constructor(c,p){super(p),this.message=p,this.key=c}}class si{constructor(c,p=[]){this.parent=c,this.bindings={};for(const[g,x]of p)this.bindings[g]=x}concat(c){return new si(this,c)}get(c){if(this.bindings[c])return this.bindings[c];if(this.parent)return this.parent.get(c);throw new Error(`${c} not found in scope.`)}has(c){return!!this.bindings[c]||!!this.parent&&this.parent.has(c)}}const Gi={kind:"null"},Ee={kind:"number"},Or={kind:"string"},pr={kind:"boolean"},ai={kind:"color"},co={kind:"object"},fr={kind:"value"},ui={kind:"collator"},Lo={kind:"formatted"},Ki={kind:"padding"},xn={kind:"resolvedImage"},xt={kind:"variableAnchorOffsetCollection"};function ot(h,c){return{kind:"array",itemType:h,N:c}}function st(h){if(h.kind==="array"){const c=st(h.itemType);return typeof h.N=="number"?`array<${c}, ${h.N}>`:h.itemType.kind==="value"?"array":`array<${c}>`}return h.kind}const pt=[Gi,Ee,Or,pr,ai,Lo,co,ot(fr),Ki,xn,xt];function _t(h,c){if(c.kind==="error")return null;if(h.kind==="array"){if(c.kind==="array"&&(c.N===0&&c.itemType.kind==="value"||!_t(h.itemType,c.itemType))&&(typeof h.N!="number"||h.N===c.N))return null}else{if(h.kind===c.kind)return null;if(h.kind==="value"){for(const p of pt)if(!_t(p,c))return null}}return`Expected ${st(h)} but found ${st(c)} instead.`}function At(h,c){return c.some(p=>p.kind===h.kind)}function Rt(h,c){return c.some(p=>p==="null"?h===null:p==="array"?Array.isArray(h):p==="object"?h&&!Array.isArray(h)&&typeof h=="object":p===typeof h)}function Bt(h,c){return h.kind==="array"&&c.kind==="array"?h.itemType.kind===c.itemType.kind&&typeof h.N=="number":h.kind===c.kind}const Mt=.96422,Yt=.82521,ie=4/29,qt=6/29,Ct=3*qt*qt,Kt=qt*qt*qt,Le=Math.PI/180,hr=180/Math.PI;function cr(h){return(h%=360)<0&&(h+=360),h}function Cr([h,c,p,g]){let x,C;const A=sn((.2225045*(h=kr(h))+.7168786*(c=kr(c))+.0606169*(p=kr(p)))/1);h===c&&c===p?x=C=A:(x=sn((.4360747*h+.3850649*c+.1430804*p)/Mt),C=sn((.0139322*h+.0971045*c+.7141733*p)/Yt));const k=116*A-16;return[k<0?0:k,500*(x-A),200*(A-C),g]}function kr(h){return h<=.04045?h/12.92:Math.pow((h+.055)/1.055,2.4)}function sn(h){return h>Kt?Math.pow(h,1/3):h/Ct+ie}function Lr([h,c,p,g]){let x=(h+16)/116,C=isNaN(c)?x:x+c/500,A=isNaN(p)?x:x-p/200;return x=1*Zr(x),C=Mt*Zr(C),A=Yt*Zr(A),[_r(3.1338561*C-1.6168667*x-.4906146*A),_r(-.9787684*C+1.9161415*x+.033454*A),_r(.0719453*C-.2289914*x+1.4052427*A),g]}function _r(h){return(h=h<=.00304?12.92*h:1.055*Math.pow(h,1/2.4)-.055)<0?0:h>1?1:h}function Zr(h){return h>qt?h*h*h:Ct*(h-ie)}function an(h){return parseInt(h.padEnd(2,h),16)/255}function qn(h,c){return gi(c?h/100:h,0,1)}function gi(h,c,p){return Math.min(Math.max(c,h),p)}function Si(h){return!h.some(Number.isNaN)}const Ks={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 Ur{constructor(c,p,g,x=1,C=!0){this.r=c,this.g=p,this.b=g,this.a=x,C||(this.r*=x,this.g*=x,this.b*=x,x||this.overwriteGetter("rgb",[c,p,g,x]))}static parse(c){if(c instanceof Ur)return c;if(typeof c!="string")return;const p=function(g){if((g=g.toLowerCase().trim())==="transparent")return[0,0,0,0];const x=Ks[g];if(x){const[A,k,N]=x;return[A/255,k/255,N/255,1]}if(g.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(g)){const A=g.length<6?1:2;let k=1;return[an(g.slice(k,k+=A)),an(g.slice(k,k+=A)),an(g.slice(k,k+=A)),an(g.slice(k,k+A)||"ff")]}if(g.startsWith("rgb")){const A=g.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(A){const[k,N,U,W,K,et,at,ht,Tt,Lt,Et,$t]=A,Vt=[W||" ",at||" ",Lt].join("");if(Vt===" "||Vt===" /"||Vt===",,"||Vt===",,,"){const Ft=[U,et,Tt].join(""),Jt=Ft==="%%%"?100:Ft===""?255:0;if(Jt){const ye=[gi(+N/Jt,0,1),gi(+K/Jt,0,1),gi(+ht/Jt,0,1),Et?qn(+Et,$t):1];if(Si(ye))return ye}}return}}const C=g.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(C){const[A,k,N,U,W,K,et,at,ht]=C,Tt=[N||" ",W||" ",et].join("");if(Tt===" "||Tt===" /"||Tt===",,"||Tt===",,,"){const Lt=[+k,gi(+U,0,100),gi(+K,0,100),at?qn(+at,ht):1];if(Si(Lt))return function([Et,$t,Vt,Ft]){function Jt(ye){const ze=(ye+Et/30)%12,Qr=$t*Math.min(Vt,1-Vt);return Vt-Qr*Math.max(-1,Math.min(ze-3,9-ze,1))}return Et=cr(Et),$t/=100,Vt/=100,[Jt(0),Jt(8),Jt(4),Ft]}(Lt)}}}(c);return p?new Ur(...p,!1):void 0}get rgb(){const{r:c,g:p,b:g,a:x}=this,C=x||1/0;return this.overwriteGetter("rgb",[c/C,p/C,g/C,x])}get hcl(){return this.overwriteGetter("hcl",function(c){const[p,g,x,C]=Cr(c),A=Math.sqrt(g*g+x*x);return[Math.round(1e4*A)?cr(Math.atan2(x,g)*hr):NaN,A,p,C]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Cr(this.rgb))}overwriteGetter(c,p){return Object.defineProperty(this,c,{value:p}),p}toString(){const[c,p,g,x]=this.rgb;return`rgba(${[c,p,g].map(C=>Math.round(255*C)).join(",")},${x})`}}Ur.black=new Ur(0,0,0,1),Ur.white=new Ur(1,1,1,1),Ur.transparent=new Ur(0,0,0,0),Ur.red=new Ur(1,0,0,1);class Pi{constructor(c,p,g){this.sensitivity=c?p?"variant":"case":p?"accent":"base",this.locale=g,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(c,p){return this.collator.compare(c,p)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Jo{constructor(c,p,g,x,C){this.text=c,this.image=p,this.scale=g,this.fontStack=x,this.textColor=C}}class Br{constructor(c){this.sections=c}static fromString(c){return new Br([new Jo(c,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(c=>c.text.length!==0||c.image&&c.image.name.length!==0)}static factory(c){return c instanceof Br?c:Br.fromString(c)}toString(){return this.sections.length===0?"":this.sections.map(c=>c.text).join("")}}class Xn{constructor(c){this.values=c.slice()}static parse(c){if(c instanceof Xn)return c;if(typeof c=="number")return new Xn([c,c,c,c]);if(Array.isArray(c)&&!(c.length<1||c.length>4)){for(const p of c)if(typeof p!="number")return;switch(c.length){case 1:c=[c[0],c[0],c[0],c[0]];break;case 2:c=[c[0],c[1],c[0],c[1]];break;case 3:c=[c[0],c[1],c[2],c[1]]}return new Xn(c)}}toString(){return JSON.stringify(this.values)}}const Ys=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class hn{constructor(c){this.values=c.slice()}static parse(c){if(c instanceof hn)return c;if(Array.isArray(c)&&!(c.length<1)&&c.length%2==0){for(let p=0;p<c.length;p+=2){const g=c[p],x=c[p+1];if(typeof g!="string"||!Ys.has(g)||!Array.isArray(x)||x.length!==2||typeof x[0]!="number"||typeof x[1]!="number")return}return new hn(c)}}toString(){return JSON.stringify(this.values)}}class tn{constructor(c){this.name=c.name,this.available=c.available}toString(){return this.name}static fromString(c){return c?new tn({name:c,available:!1}):null}}function t1(h,c,p,g){return typeof h=="number"&&h>=0&&h<=255&&typeof c=="number"&&c>=0&&c<=255&&typeof p=="number"&&p>=0&&p<=255?g===void 0||typeof g=="number"&&g>=0&&g<=1?null:`Invalid rgba value [${[h,c,p,g].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof g=="number"?[h,c,p,g]:[h,c,p]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Yi(h){if(h===null||typeof h=="string"||typeof h=="boolean"||typeof h=="number"||h instanceof Ur||h instanceof Pi||h instanceof Br||h instanceof Xn||h instanceof hn||h instanceof tn)return!0;if(Array.isArray(h)){for(const c of h)if(!Yi(c))return!1;return!0}if(typeof h=="object"){for(const c in h)if(!Yi(h[c]))return!1;return!0}return!1}function ln(h){if(h===null)return Gi;if(typeof h=="string")return Or;if(typeof h=="boolean")return pr;if(typeof h=="number")return Ee;if(h instanceof Ur)return ai;if(h instanceof Pi)return ui;if(h instanceof Br)return Lo;if(h instanceof Xn)return Ki;if(h instanceof hn)return xt;if(h instanceof tn)return xn;if(Array.isArray(h)){const c=h.length;let p;for(const g of h){const x=ln(g);if(p){if(p===x)continue;p=fr;break}p=x}return ot(p||fr,c)}return co}function Vi(h){const c=typeof h;return h===null?"":c==="string"||c==="number"||c==="boolean"?String(h):h instanceof Ur||h instanceof Br||h instanceof Xn||h instanceof hn||h instanceof tn?h.toString():JSON.stringify(h)}class Ji{constructor(c,p){this.type=c,this.value=p}static parse(c,p){if(c.length!==2)return p.error(`'literal' expression requires exactly one argument, but found ${c.length-1} instead.`);if(!Yi(c[1]))return p.error("invalid value");const g=c[1];let x=ln(g);const C=p.expectedType;return x.kind!=="array"||x.N!==0||!C||C.kind!=="array"||typeof C.N=="number"&&C.N!==0||(x=C),new Ji(x,g)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Nn{constructor(c){this.name="ExpressionEvaluationError",this.message=c}toJSON(){return this.message}}const Js={string:Or,number:Ee,boolean:pr,object:co};class to{constructor(c,p){this.type=c,this.args=p}static parse(c,p){if(c.length<2)return p.error("Expected at least one argument.");let g,x=1;const C=c[0];if(C==="array"){let k,N;if(c.length>2){const U=c[1];if(typeof U!="string"||!(U in Js)||U==="object")return p.error('The item type argument of "array" must be one of string, number, boolean',1);k=Js[U],x++}else k=fr;if(c.length>3){if(c[2]!==null&&(typeof c[2]!="number"||c[2]<0||c[2]!==Math.floor(c[2])))return p.error('The length argument to "array" must be a positive integer literal',2);N=c[2],x++}g=ot(k,N)}else{if(!Js[C])throw new Error(`Types doesn't contain name = ${C}`);g=Js[C]}const A=[];for(;x<c.length;x++){const k=p.parse(c[x],x,fr);if(!k)return null;A.push(k)}return new to(g,A)}evaluate(c){for(let p=0;p<this.args.length;p++){const g=this.args[p].evaluate(c);if(!_t(this.type,ln(g)))return g;if(p===this.args.length-1)throw new Nn(`Expected value to be of type ${st(this.type)}, but found ${st(ln(g))} instead.`)}throw new Error}eachChild(c){this.args.forEach(c)}outputDefined(){return this.args.every(c=>c.outputDefined())}}const Ts={"to-boolean":pr,"to-color":ai,"to-number":Ee,"to-string":Or};class $i{constructor(c,p){this.type=c,this.args=p}static parse(c,p){if(c.length<2)return p.error("Expected at least one argument.");const g=c[0];if(!Ts[g])throw new Error(`Can't parse ${g} as it is not part of the known types`);if((g==="to-boolean"||g==="to-string")&&c.length!==2)return p.error("Expected one argument.");const x=Ts[g],C=[];for(let A=1;A<c.length;A++){const k=p.parse(c[A],A,fr);if(!k)return null;C.push(k)}return new $i(x,C)}evaluate(c){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(c);case"color":{let p,g;for(const x of this.args){if(p=x.evaluate(c),g=null,p instanceof Ur)return p;if(typeof p=="string"){const C=c.parseColor(p);if(C)return C}else if(Array.isArray(p)&&(g=p.length<3||p.length>4?`Invalid rbga value ${JSON.stringify(p)}: expected an array containing either three or four numeric values.`:t1(p[0],p[1],p[2],p[3]),!g))return new Ur(p[0]/255,p[1]/255,p[2]/255,p[3])}throw new Nn(g||`Could not parse color from value '${typeof p=="string"?p:JSON.stringify(p)}'`)}case"padding":{let p;for(const g of this.args){p=g.evaluate(c);const x=Xn.parse(p);if(x)return x}throw new Nn(`Could not parse padding from value '${typeof p=="string"?p:JSON.stringify(p)}'`)}case"variableAnchorOffsetCollection":{let p;for(const g of this.args){p=g.evaluate(c);const x=hn.parse(p);if(x)return x}throw new Nn(`Could not parse variableAnchorOffsetCollection from value '${typeof p=="string"?p:JSON.stringify(p)}'`)}case"number":{let p=null;for(const g of this.args){if(p=g.evaluate(c),p===null)return 0;const x=Number(p);if(!isNaN(x))return x}throw new Nn(`Could not convert ${JSON.stringify(p)} to number.`)}case"formatted":return Br.fromString(Vi(this.args[0].evaluate(c)));case"resolvedImage":return tn.fromString(Vi(this.args[0].evaluate(c)));default:return Vi(this.args[0].evaluate(c))}}eachChild(c){this.args.forEach(c)}outputDefined(){return this.args.every(c=>c.outputDefined())}}const _1=["Unknown","Point","LineString","Polygon"];class N2{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"?_1[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(c){let p=this._parseColorCache[c];return p||(p=this._parseColorCache[c]=Ur.parse(c)),p}}class F1{constructor(c,p,g=[],x,C=new si,A=[]){this.registry=c,this.path=g,this.key=g.map(k=>`[${k}]`).join(""),this.scope=C,this.errors=A,this.expectedType=x,this._isConstant=p}parse(c,p,g,x,C={}){return p?this.concat(p,g,x)._parse(c,C):this._parse(c,C)}_parse(c,p){function g(x,C,A){return A==="assert"?new to(C,[x]):A==="coerce"?new $i(C,[x]):x}if(c!==null&&typeof c!="string"&&typeof c!="boolean"&&typeof c!="number"||(c=["literal",c]),Array.isArray(c)){if(c.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const x=c[0];if(typeof x!="string")return this.error(`Expression name must be a string, but found ${typeof x} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const C=this.registry[x];if(C){let A=C.parse(c,this);if(!A)return null;if(this.expectedType){const k=this.expectedType,N=A.type;if(k.kind!=="string"&&k.kind!=="number"&&k.kind!=="boolean"&&k.kind!=="object"&&k.kind!=="array"||N.kind!=="value")if(k.kind!=="color"&&k.kind!=="formatted"&&k.kind!=="resolvedImage"||N.kind!=="value"&&N.kind!=="string")if(k.kind!=="padding"||N.kind!=="value"&&N.kind!=="number"&&N.kind!=="array")if(k.kind!=="variableAnchorOffsetCollection"||N.kind!=="value"&&N.kind!=="array"){if(this.checkSubtype(k,N))return null}else A=g(A,k,p.typeAnnotation||"coerce");else A=g(A,k,p.typeAnnotation||"coerce");else A=g(A,k,p.typeAnnotation||"coerce");else A=g(A,k,p.typeAnnotation||"assert")}if(!(A instanceof Ji)&&A.type.kind!=="resolvedImage"&&this._isConstant(A)){const k=new N2;try{A=new Ji(A.type,A.evaluate(k))}catch(N){return this.error(N.message),null}}return A}return this.error(`Unknown expression "${x}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(c===void 0?"'undefined' value invalid. Use null instead.":typeof c=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof c} instead.`)}concat(c,p,g){const x=typeof c=="number"?this.path.concat(c):this.path,C=g?this.scope.concat(g):this.scope;return new F1(this.registry,this._isConstant,x,p||null,C,this.errors)}error(c,...p){const g=`${this.key}${p.map(x=>`[${x}]`).join("")}`;this.errors.push(new Rn(g,c))}checkSubtype(c,p){const g=_t(c,p);return g&&this.error(g),g}}class e1{constructor(c,p){this.type=p.type,this.bindings=[].concat(c),this.result=p}evaluate(c){return this.result.evaluate(c)}eachChild(c){for(const p of this.bindings)c(p[1]);c(this.result)}static parse(c,p){if(c.length<4)return p.error(`Expected at least 3 arguments, but found ${c.length-1} instead.`);const g=[];for(let C=1;C<c.length-1;C+=2){const A=c[C];if(typeof A!="string")return p.error(`Expected string, but found ${typeof A} instead.`,C);if(/[^a-zA-Z0-9_]/.test(A))return p.error("Variable names must contain only alphanumeric characters or '_'.",C);const k=p.parse(c[C+1],C+1);if(!k)return null;g.push([A,k])}const x=p.parse(c[c.length-1],c.length-1,p.expectedType,g);return x?new e1(g,x):null}outputDefined(){return this.result.outputDefined()}}class jr{constructor(c,p){this.type=p.type,this.name=c,this.boundExpression=p}static parse(c,p){if(c.length!==2||typeof c[1]!="string")return p.error("'var' expression requires exactly one string literal argument.");const g=c[1];return p.scope.has(g)?new jr(g,p.scope.get(g)):p.error(`Unknown variable "${g}". Make sure "${g}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(c){return this.boundExpression.evaluate(c)}eachChild(){}outputDefined(){return!1}}class V{constructor(c,p,g){this.type=c,this.index=p,this.input=g}static parse(c,p){if(c.length!==3)return p.error(`Expected 2 arguments, but found ${c.length-1} instead.`);const g=p.parse(c[1],1,Ee),x=p.parse(c[2],2,ot(p.expectedType||fr));return g&&x?new V(x.type.itemType,g,x):null}evaluate(c){const p=this.index.evaluate(c),g=this.input.evaluate(c);if(p<0)throw new Nn(`Array index out of bounds: ${p} < 0.`);if(p>=g.length)throw new Nn(`Array index out of bounds: ${p} > ${g.length-1}.`);if(p!==Math.floor(p))throw new Nn(`Array index must be an integer, but found ${p} instead.`);return g[p]}eachChild(c){c(this.index),c(this.input)}outputDefined(){return!1}}class Z{constructor(c,p){this.type=pr,this.needle=c,this.haystack=p}static parse(c,p){if(c.length!==3)return p.error(`Expected 2 arguments, but found ${c.length-1} instead.`);const g=p.parse(c[1],1,fr),x=p.parse(c[2],2,fr);return g&&x?At(g.type,[pr,Or,Ee,Gi,fr])?new Z(g,x):p.error(`Expected first argument to be of type boolean, string, number or null, but found ${st(g.type)} instead`):null}evaluate(c){const p=this.needle.evaluate(c),g=this.haystack.evaluate(c);if(!g)return!1;if(!Rt(p,["boolean","string","number","null"]))throw new Nn(`Expected first argument to be of type boolean, string, number or null, but found ${st(ln(p))} instead.`);if(!Rt(g,["string","array"]))throw new Nn(`Expected second argument to be of type array or string, but found ${st(ln(g))} instead.`);return g.indexOf(p)>=0}eachChild(c){c(this.needle),c(this.haystack)}outputDefined(){return!0}}class F{constructor(c,p,g){this.type=Ee,this.needle=c,this.haystack=p,this.fromIndex=g}static parse(c,p){if(c.length<=2||c.length>=5)return p.error(`Expected 3 or 4 arguments, but found ${c.length-1} instead.`);const g=p.parse(c[1],1,fr),x=p.parse(c[2],2,fr);if(!g||!x)return null;if(!At(g.type,[pr,Or,Ee,Gi,fr]))return p.error(`Expected first argument to be of type boolean, string, number or null, but found ${st(g.type)} instead`);if(c.length===4){const C=p.parse(c[3],3,Ee);return C?new F(g,x,C):null}return new F(g,x)}evaluate(c){const p=this.needle.evaluate(c),g=this.haystack.evaluate(c);if(!Rt(p,["boolean","string","number","null"]))throw new Nn(`Expected first argument to be of type boolean, string, number or null, but found ${st(ln(p))} instead.`);let x;if(this.fromIndex&&(x=this.fromIndex.evaluate(c)),Rt(g,["string"])){const C=g.indexOf(p,x);return C===-1?-1:[...g.slice(0,C)].length}if(Rt(g,["array"]))return g.indexOf(p,x);throw new Nn(`Expected second argument to be of type array or string, but found ${st(ln(g))} instead.`)}eachChild(c){c(this.needle),c(this.haystack),this.fromIndex&&c(this.fromIndex)}outputDefined(){return!1}}class X{constructor(c,p,g,x,C,A){this.inputType=c,this.type=p,this.input=g,this.cases=x,this.outputs=C,this.otherwise=A}static parse(c,p){if(c.length<5)return p.error(`Expected at least 4 arguments, but found only ${c.length-1}.`);if(c.length%2!=1)return p.error("Expected an even number of arguments.");let g,x;p.expectedType&&p.expectedType.kind!=="value"&&(x=p.expectedType);const C={},A=[];for(let U=2;U<c.length-1;U+=2){let W=c[U];const K=c[U+1];Array.isArray(W)||(W=[W]);const et=p.concat(U);if(W.length===0)return et.error("Expected at least one branch label.");for(const ht of W){if(typeof ht!="number"&&typeof ht!="string")return et.error("Branch labels must be numbers or strings.");if(typeof ht=="number"&&Math.abs(ht)>Number.MAX_SAFE_INTEGER)return et.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ht=="number"&&Math.floor(ht)!==ht)return et.error("Numeric branch labels must be integer values.");if(g){if(et.checkSubtype(g,ln(ht)))return null}else g=ln(ht);if(C[String(ht)]!==void 0)return et.error("Branch labels must be unique.");C[String(ht)]=A.length}const at=p.parse(K,U,x);if(!at)return null;x=x||at.type,A.push(at)}const k=p.parse(c[1],1,fr);if(!k)return null;const N=p.parse(c[c.length-1],c.length-1,x);return N?k.type.kind!=="value"&&p.concat(1).checkSubtype(g,k.type)?null:new X(g,x,k,C,A,N):null}evaluate(c){const p=this.input.evaluate(c);return(ln(p)===this.inputType&&this.outputs[this.cases[p]]||this.otherwise).evaluate(c)}eachChild(c){c(this.input),this.outputs.forEach(c),c(this.otherwise)}outputDefined(){return this.outputs.every(c=>c.outputDefined())&&this.otherwise.outputDefined()}}class nt{constructor(c,p,g){this.type=c,this.branches=p,this.otherwise=g}static parse(c,p){if(c.length<4)return p.error(`Expected at least 3 arguments, but found only ${c.length-1}.`);if(c.length%2!=0)return p.error("Expected an odd number of arguments.");let g;p.expectedType&&p.expectedType.kind!=="value"&&(g=p.expectedType);const x=[];for(let A=1;A<c.length-1;A+=2){const k=p.parse(c[A],A,pr);if(!k)return null;const N=p.parse(c[A+1],A+1,g);if(!N)return null;x.push([k,N]),g=g||N.type}const C=p.parse(c[c.length-1],c.length-1,g);if(!C)return null;if(!g)throw new Error("Can't infer output type");return new nt(g,x,C)}evaluate(c){for(const[p,g]of this.branches)if(p.evaluate(c))return g.evaluate(c);return this.otherwise.evaluate(c)}eachChild(c){for(const[p,g]of this.branches)c(p),c(g);c(this.otherwise)}outputDefined(){return this.branches.every(([c,p])=>p.outputDefined())&&this.otherwise.outputDefined()}}class dt{constructor(c,p,g,x){this.type=c,this.input=p,this.beginIndex=g,this.endIndex=x}static parse(c,p){if(c.length<=2||c.length>=5)return p.error(`Expected 3 or 4 arguments, but found ${c.length-1} instead.`);const g=p.parse(c[1],1,fr),x=p.parse(c[2],2,Ee);if(!g||!x)return null;if(!At(g.type,[ot(fr),Or,fr]))return p.error(`Expected first argument to be of type array or string, but found ${st(g.type)} instead`);if(c.length===4){const C=p.parse(c[3],3,Ee);return C?new dt(g.type,g,x,C):null}return new dt(g.type,g,x)}evaluate(c){const p=this.input.evaluate(c),g=this.beginIndex.evaluate(c);let x;if(this.endIndex&&(x=this.endIndex.evaluate(c)),Rt(p,["string"]))return[...p].slice(g,x).join("");if(Rt(p,["array"]))return p.slice(g,x);throw new Nn(`Expected first argument to be of type array or string, but found ${st(ln(p))} instead.`)}eachChild(c){c(this.input),c(this.beginIndex),this.endIndex&&c(this.endIndex)}outputDefined(){return!1}}function yt(h,c){const p=h.length-1;let g,x,C=0,A=p,k=0;for(;C<=A;)if(k=Math.floor((C+A)/2),g=h[k],x=h[k+1],g<=c){if(k===p||c<x)return k;C=k+1}else{if(!(g>c))throw new Nn("Input is not a number.");A=k-1}return 0}class Wt{constructor(c,p,g){this.type=c,this.input=p,this.labels=[],this.outputs=[];for(const[x,C]of g)this.labels.push(x),this.outputs.push(C)}static parse(c,p){if(c.length-1<4)return p.error(`Expected at least 4 arguments, but found only ${c.length-1}.`);if((c.length-1)%2!=0)return p.error("Expected an even number of arguments.");const g=p.parse(c[1],1,Ee);if(!g)return null;const x=[];let C=null;p.expectedType&&p.expectedType.kind!=="value"&&(C=p.expectedType);for(let A=1;A<c.length;A+=2){const k=A===1?-1/0:c[A],N=c[A+1],U=A,W=A+1;if(typeof k!="number")return p.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',U);if(x.length&&x[x.length-1][0]>=k)return p.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',U);const K=p.parse(N,W,C);if(!K)return null;C=C||K.type,x.push([k,K])}return new Wt(C,g,x)}evaluate(c){const p=this.labels,g=this.outputs;if(p.length===1)return g[0].evaluate(c);const x=this.input.evaluate(c);if(x<=p[0])return g[0].evaluate(c);const C=p.length;return x>=p[C-1]?g[C-1].evaluate(c):g[yt(p,x)].evaluate(c)}eachChild(c){c(this.input);for(const p of this.outputs)c(p)}outputDefined(){return this.outputs.every(c=>c.outputDefined())}}function oe(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var ge=Se;function Se(h,c,p,g){this.cx=3*h,this.bx=3*(p-h)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*c,this.by=3*(g-c)-this.cy,this.ay=1-this.cy-this.by,this.p1x=h,this.p1y=c,this.p2x=p,this.p2y=g}Se.prototype={sampleCurveX:function(h){return((this.ax*h+this.bx)*h+this.cx)*h},sampleCurveY:function(h){return((this.ay*h+this.by)*h+this.cy)*h},sampleCurveDerivativeX:function(h){return(3*this.ax*h+2*this.bx)*h+this.cx},solveCurveX:function(h,c){if(c===void 0&&(c=1e-6),h<0)return 0;if(h>1)return 1;for(var p=h,g=0;g<8;g++){var x=this.sampleCurveX(p)-h;if(Math.abs(x)<c)return p;var C=this.sampleCurveDerivativeX(p);if(Math.abs(C)<1e-6)break;p-=x/C}var A=0,k=1;for(p=h,g=0;g<20&&(x=this.sampleCurveX(p),!(Math.abs(x-h)<c));g++)h>x?A=p:k=p,p=.5*(k-A)+A;return p},solve:function(h,c){return this.sampleCurveY(this.solveCurveX(h,c))}};var ve=oe(ge);function sr(h,c,p){return h+p*(c-h)}function bn(h,c,p){return h.map((g,x)=>sr(g,c[x],p))}const Tr={number:sr,color:function(h,c,p,g="rgb"){switch(g){case"rgb":{const[x,C,A,k]=bn(h.rgb,c.rgb,p);return new Ur(x,C,A,k,!1)}case"hcl":{const[x,C,A,k]=h.hcl,[N,U,W,K]=c.hcl;let et,at;if(isNaN(x)||isNaN(N))isNaN(x)?isNaN(N)?et=NaN:(et=N,A!==1&&A!==0||(at=U)):(et=x,W!==1&&W!==0||(at=C));else{let $t=N-x;N>x&&$t>180?$t-=360:N<x&&x-N>180&&($t+=360),et=x+p*$t}const[ht,Tt,Lt,Et]=function([$t,Vt,Ft,Jt]){return $t=isNaN($t)?0:$t*Le,Lr([Ft,Math.cos($t)*Vt,Math.sin($t)*Vt,Jt])}([et,at??sr(C,U,p),sr(A,W,p),sr(k,K,p)]);return new Ur(ht,Tt,Lt,Et,!1)}case"lab":{const[x,C,A,k]=Lr(bn(h.lab,c.lab,p));return new Ur(x,C,A,k,!1)}}},array:bn,padding:function(h,c,p){return new Xn(bn(h.values,c.values,p))},variableAnchorOffsetCollection:function(h,c,p){const g=h.values,x=c.values;if(g.length!==x.length)throw new Nn(`Cannot interpolate values of different length. from: ${h.toString()}, to: ${c.toString()}`);const C=[];for(let A=0;A<g.length;A+=2){if(g[A]!==x[A])throw new Nn(`Cannot interpolate values containing mismatched anchors. from[${A}]: ${g[A]}, to[${A}]: ${x[A]}`);C.push(g[A]);const[k,N]=g[A+1],[U,W]=x[A+1];C.push([sr(k,U,p),sr(N,W,p)])}return new hn(C)}};class Yr{constructor(c,p,g,x,C){this.type=c,this.operator=p,this.interpolation=g,this.input=x,this.labels=[],this.outputs=[];for(const[A,k]of C)this.labels.push(A),this.outputs.push(k)}static interpolationFactor(c,p,g,x){let C=0;if(c.name==="exponential")C=ue(p,c.base,g,x);else if(c.name==="linear")C=ue(p,1,g,x);else if(c.name==="cubic-bezier"){const A=c.controlPoints;C=new ve(A[0],A[1],A[2],A[3]).solve(ue(p,1,g,x))}return C}static parse(c,p){let[g,x,C,...A]=c;if(!Array.isArray(x)||x.length===0)return p.error("Expected an interpolation type expression.",1);if(x[0]==="linear")x={name:"linear"};else if(x[0]==="exponential"){const U=x[1];if(typeof U!="number")return p.error("Exponential interpolation requires a numeric base.",1,1);x={name:"exponential",base:U}}else{if(x[0]!=="cubic-bezier")return p.error(`Unknown interpolation type ${String(x[0])}`,1,0);{const U=x.slice(1);if(U.length!==4||U.some(W=>typeof W!="number"||W<0||W>1))return p.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);x={name:"cubic-bezier",controlPoints:U}}}if(c.length-1<4)return p.error(`Expected at least 4 arguments, but found only ${c.length-1}.`);if((c.length-1)%2!=0)return p.error("Expected an even number of arguments.");if(C=p.parse(C,2,Ee),!C)return null;const k=[];let N=null;g==="interpolate-hcl"||g==="interpolate-lab"?N=ai:p.expectedType&&p.expectedType.kind!=="value"&&(N=p.expectedType);for(let U=0;U<A.length;U+=2){const W=A[U],K=A[U+1],et=U+3,at=U+4;if(typeof W!="number")return p.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',et);if(k.length&&k[k.length-1][0]>=W)return p.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',et);const ht=p.parse(K,at,N);if(!ht)return null;N=N||ht.type,k.push([W,ht])}return Bt(N,Ee)||Bt(N,ai)||Bt(N,Ki)||Bt(N,xt)||Bt(N,ot(Ee))?new Yr(N,g,x,C,k):p.error(`Type ${st(N)} is not interpolatable.`)}evaluate(c){const p=this.labels,g=this.outputs;if(p.length===1)return g[0].evaluate(c);const x=this.input.evaluate(c);if(x<=p[0])return g[0].evaluate(c);const C=p.length;if(x>=p[C-1])return g[C-1].evaluate(c);const A=yt(p,x),k=Yr.interpolationFactor(this.interpolation,x,p[A],p[A+1]),N=g[A].evaluate(c),U=g[A+1].evaluate(c);switch(this.operator){case"interpolate":return Tr[this.type.kind](N,U,k);case"interpolate-hcl":return Tr.color(N,U,k,"hcl");case"interpolate-lab":return Tr.color(N,U,k,"lab")}}eachChild(c){c(this.input);for(const p of this.outputs)c(p)}outputDefined(){return this.outputs.every(c=>c.outputDefined())}}function ue(h,c,p,g){const x=g-p,C=h-p;return x===0?0:c===1?C/x:(Math.pow(c,C)-1)/(Math.pow(c,x)-1)}class ir{constructor(c,p){this.type=c,this.args=p}static parse(c,p){if(c.length<2)return p.error("Expectected at least one argument.");let g=null;const x=p.expectedType;x&&x.kind!=="value"&&(g=x);const C=[];for(const k of c.slice(1)){const N=p.parse(k,1+C.length,g,void 0,{typeAnnotation:"omit"});if(!N)return null;g=g||N.type,C.push(N)}if(!g)throw new Error("No output type");const A=x&&C.some(k=>_t(x,k.type));return new ir(A?fr:g,C)}evaluate(c){let p,g=null,x=0;for(const C of this.args)if(x++,g=C.evaluate(c),g&&g instanceof tn&&!g.available&&(p||(p=g.name),g=null,x===this.args.length&&(g=p)),g!==null)break;return g}eachChild(c){this.args.forEach(c)}outputDefined(){return this.args.every(c=>c.outputDefined())}}function en(h,c){return h==="=="||h==="!="?c.kind==="boolean"||c.kind==="string"||c.kind==="number"||c.kind==="null"||c.kind==="value":c.kind==="string"||c.kind==="number"||c.kind==="value"}function Mi(h,c,p,g){return g.compare(c,p)===0}function Dn(h,c,p){const g=h!=="=="&&h!=="!=";return class EY{constructor(C,A,k){this.type=pr,this.lhs=C,this.rhs=A,this.collator=k,this.hasUntypedArgument=C.type.kind==="value"||A.type.kind==="value"}static parse(C,A){if(C.length!==3&&C.length!==4)return A.error("Expected two or three arguments.");const k=C[0];let N=A.parse(C[1],1,fr);if(!N)return null;if(!en(k,N.type))return A.concat(1).error(`"${k}" comparisons are not supported for type '${st(N.type)}'.`);let U=A.parse(C[2],2,fr);if(!U)return null;if(!en(k,U.type))return A.concat(2).error(`"${k}" comparisons are not supported for type '${st(U.type)}'.`);if(N.type.kind!==U.type.kind&&N.type.kind!=="value"&&U.type.kind!=="value")return A.error(`Cannot compare types '${st(N.type)}' and '${st(U.type)}'.`);g&&(N.type.kind==="value"&&U.type.kind!=="value"?N=new to(U.type,[N]):N.type.kind!=="value"&&U.type.kind==="value"&&(U=new to(N.type,[U])));let W=null;if(C.length===4){if(N.type.kind!=="string"&&U.type.kind!=="string"&&N.type.kind!=="value"&&U.type.kind!=="value")return A.error("Cannot use collator to compare non-string types.");if(W=A.parse(C[3],3,ui),!W)return null}return new EY(N,U,W)}evaluate(C){const A=this.lhs.evaluate(C),k=this.rhs.evaluate(C);if(g&&this.hasUntypedArgument){const N=ln(A),U=ln(k);if(N.kind!==U.kind||N.kind!=="string"&&N.kind!=="number")throw new Nn(`Expected arguments for "${h}" to be (string, string) or (number, number), but found (${N.kind}, ${U.kind}) instead.`)}if(this.collator&&!g&&this.hasUntypedArgument){const N=ln(A),U=ln(k);if(N.kind!=="string"||U.kind!=="string")return c(C,A,k)}return this.collator?p(C,A,k,this.collator.evaluate(C)):c(C,A,k)}eachChild(C){C(this.lhs),C(this.rhs),this.collator&&C(this.collator)}outputDefined(){return!0}}}const p5=Dn("==",function(h,c,p){return c===p},Mi),Z7=Dn("!=",function(h,c,p){return c!==p},function(h,c,p,g){return!Mi(0,c,p,g)}),En=Dn("<",function(h,c,p){return c<p},function(h,c,p,g){return g.compare(c,p)<0}),W7=Dn(">",function(h,c,p){return c>p},function(h,c,p,g){return g.compare(c,p)>0}),Ph=Dn("<=",function(h,c,p){return c<=p},function(h,c,p,g){return g.compare(c,p)<=0}),j1=Dn(">=",function(h,c,p){return c>=p},function(h,c,p,g){return g.compare(c,p)>=0});class D2{constructor(c,p,g){this.type=ui,this.locale=g,this.caseSensitive=c,this.diacriticSensitive=p}static parse(c,p){if(c.length!==2)return p.error("Expected one argument.");const g=c[1];if(typeof g!="object"||Array.isArray(g))return p.error("Collator options argument must be an object.");const x=p.parse(g["case-sensitive"]!==void 0&&g["case-sensitive"],1,pr);if(!x)return null;const C=p.parse(g["diacritic-sensitive"]!==void 0&&g["diacritic-sensitive"],1,pr);if(!C)return null;let A=null;return g.locale&&(A=p.parse(g.locale,1,Or),!A)?null:new D2(x,C,A)}evaluate(c){return new Pi(this.caseSensitive.evaluate(c),this.diacriticSensitive.evaluate(c),this.locale?this.locale.evaluate(c):null)}eachChild(c){c(this.caseSensitive),c(this.diacriticSensitive),this.locale&&c(this.locale)}outputDefined(){return!1}}class c6{constructor(c,p,g,x,C){this.type=Or,this.number=c,this.locale=p,this.currency=g,this.minFractionDigits=x,this.maxFractionDigits=C}static parse(c,p){if(c.length!==3)return p.error("Expected two arguments.");const g=p.parse(c[1],1,Ee);if(!g)return null;const x=c[2];if(typeof x!="object"||Array.isArray(x))return p.error("NumberFormat options argument must be an object.");let C=null;if(x.locale&&(C=p.parse(x.locale,1,Or),!C))return null;let A=null;if(x.currency&&(A=p.parse(x.currency,1,Or),!A))return null;let k=null;if(x["min-fraction-digits"]&&(k=p.parse(x["min-fraction-digits"],1,Ee),!k))return null;let N=null;return x["max-fraction-digits"]&&(N=p.parse(x["max-fraction-digits"],1,Ee),!N)?null:new c6(g,C,A,k,N)}evaluate(c){return new Intl.NumberFormat(this.locale?this.locale.evaluate(c):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(c):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(c):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(c):void 0}).format(this.number.evaluate(c))}eachChild(c){c(this.number),this.locale&&c(this.locale),this.currency&&c(this.currency),this.minFractionDigits&&c(this.minFractionDigits),this.maxFractionDigits&&c(this.maxFractionDigits)}outputDefined(){return!1}}class F3{constructor(c){this.type=Lo,this.sections=c}static parse(c,p){if(c.length<2)return p.error("Expected at least one argument.");const g=c[1];if(!Array.isArray(g)&&typeof g=="object")return p.error("First argument must be an image or text section.");const x=[];let C=!1;for(let A=1;A<=c.length-1;++A){const k=c[A];if(C&&typeof k=="object"&&!Array.isArray(k)){C=!1;let N=null;if(k["font-scale"]&&(N=p.parse(k["font-scale"],1,Ee),!N))return null;let U=null;if(k["text-font"]&&(U=p.parse(k["text-font"],1,ot(Or)),!U))return null;let W=null;if(k["text-color"]&&(W=p.parse(k["text-color"],1,ai),!W))return null;const K=x[x.length-1];K.scale=N,K.font=U,K.textColor=W}else{const N=p.parse(c[A],1,fr);if(!N)return null;const U=N.type.kind;if(U!=="string"&&U!=="value"&&U!=="null"&&U!=="resolvedImage")return p.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");C=!0,x.push({content:N,scale:null,font:null,textColor:null})}}return new F3(x)}evaluate(c){return new Br(this.sections.map(p=>{const g=p.content.evaluate(c);return ln(g)===xn?new Jo("",g,null,null,null):new Jo(Vi(g),null,p.scale?p.scale.evaluate(c):null,p.font?p.font.evaluate(c).join(","):null,p.textColor?p.textColor.evaluate(c):null)}))}eachChild(c){for(const p of this.sections)c(p.content),p.scale&&c(p.scale),p.font&&c(p.font),p.textColor&&c(p.textColor)}outputDefined(){return!1}}class j3{constructor(c){this.type=xn,this.input=c}static parse(c,p){if(c.length!==2)return p.error("Expected two arguments.");const g=p.parse(c[1],1,Or);return g?new j3(g):p.error("No image name provided.")}evaluate(c){const p=this.input.evaluate(c),g=tn.fromString(p);return g&&c.availableImages&&(g.available=c.availableImages.indexOf(p)>-1),g}eachChild(c){c(this.input)}outputDefined(){return!1}}class u6{constructor(c){this.type=Ee,this.input=c}static parse(c,p){if(c.length!==2)return p.error(`Expected 1 argument, but found ${c.length-1} instead.`);const g=p.parse(c[1],1);return g?g.type.kind!=="array"&&g.type.kind!=="string"&&g.type.kind!=="value"?p.error(`Expected argument of type string or array, but found ${st(g.type)} instead.`):new u6(g):null}evaluate(c){const p=this.input.evaluate(c);if(typeof p=="string")return[...p].length;if(Array.isArray(p))return p.length;throw new Nn(`Expected value to be of type string or array, but found ${st(ln(p))} instead.`)}eachChild(c){c(this.input)}outputDefined(){return!1}}const v1=8192;function Vh(h,c){const p=(180+h[0])/360,g=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+h[1]*Math.PI/360)))/360,x=Math.pow(2,c.z);return[Math.round(p*x*v1),Math.round(g*x*v1)]}function f5(h,c){const p=Math.pow(2,c.z);return[(x=(h[0]/v1+c.x)/p,360*x-180),(g=(h[1]/v1+c.y)/p,360/Math.PI*Math.atan(Math.exp((180-360*g)*Math.PI/180))-90)];var g,x}function Pa(h,c){h[0]=Math.min(h[0],c[0]),h[1]=Math.min(h[1],c[1]),h[2]=Math.max(h[2],c[0]),h[3]=Math.max(h[3],c[1])}function Qs(h,c){return!(h[0]<=c[0]||h[2]>=c[2]||h[1]<=c[1]||h[3]>=c[3])}function Jr(h,c,p){const g=h[0]-c[0],x=h[1]-c[1],C=h[0]-p[0],A=h[1]-p[1];return g*A-C*x==0&&g*C<=0&&x*A<=0}function z3(h,c,p,g){return(x=[g[0]-p[0],g[1]-p[1]])[0]*(C=[c[0]-h[0],c[1]-h[1]])[1]-x[1]*C[0]!=0&&!(!b1(h,c,p,g)||!b1(p,g,h,c));var x,C}function Rh(h,c,p){for(const g of p)for(let x=0;x<g.length-1;++x)if(z3(h,c,g[x],g[x+1]))return!0;return!1}function B2(h,c,p=!1){let g=!1;for(const k of c)for(let N=0;N<k.length-1;N++){if(Jr(h,k[N],k[N+1]))return p;(C=k[N])[1]>(x=h)[1]!=(A=k[N+1])[1]>x[1]&&x[0]<(A[0]-C[0])*(x[1]-C[1])/(A[1]-C[1])+C[0]&&(g=!g)}var x,C,A;return g}function h6(h,c){for(const p of c)if(B2(h,p))return!0;return!1}function d6(h,c){for(const p of h)if(!B2(p,c))return!1;for(let p=0;p<h.length-1;++p)if(Rh(h[p],h[p+1],c))return!1;return!0}function q7(h,c){for(const p of c)if(d6(h,p))return!0;return!1}function b1(h,c,p,g){const x=g[0]-p[0],C=g[1]-p[1],A=(h[0]-p[0])*C-x*(h[1]-p[1]),k=(c[0]-p[0])*C-x*(c[1]-p[1]);return A>0&&k<0||A<0&&k>0}function p6(h,c,p){const g=[];for(let x=0;x<h.length;x++){const C=[];for(let A=0;A<h[x].length;A++){const k=Vh(h[x][A],p);Pa(c,k),C.push(k)}g.push(C)}return g}function T5(h,c,p){const g=[];for(let x=0;x<h.length;x++){const C=p6(h[x],c,p);g.push(C)}return g}function X7(h,c,p,g){if(h[0]<p[0]||h[0]>p[2]){const x=.5*g;let C=h[0]-p[0]>x?-g:p[0]-h[0]>x?g:0;C===0&&(C=h[0]-p[2]>x?-g:p[2]-h[0]>x?g:0),h[0]+=C}Pa(c,h)}function Q5(h,c,p,g){const x=Math.pow(2,g.z)*v1,C=[g.x*v1,g.y*v1],A=[];for(const k of h)for(const N of k){const U=[N.x+C[0],N.y+C[1]];X7(U,c,p,x),A.push(U)}return A}function U3(h,c,p,g){const x=Math.pow(2,g.z)*v1,C=[g.x*v1,g.y*v1],A=[];for(const N of h){const U=[];for(const W of N){const K=[W.x+C[0],W.y+C[1]];Pa(c,K),U.push(K)}A.push(U)}if(c[2]-c[0]<=x/2){(k=c)[0]=k[1]=1/0,k[2]=k[3]=-1/0;for(const N of A)for(const U of N)X7(U,c,p,x)}var k;return A}class ta{constructor(c,p){this.type=pr,this.geojson=c,this.geometries=p}static parse(c,p){if(c.length!==2)return p.error(`'within' expression requires exactly one argument, but found ${c.length-1} instead.`);if(Yi(c[1])){const g=c[1];if(g.type==="FeatureCollection"){const x=[];for(const C of g.features){const{type:A,coordinates:k}=C.geometry;A==="Polygon"&&x.push(k),A==="MultiPolygon"&&x.push(...k)}if(x.length)return new ta(g,{type:"MultiPolygon",coordinates:x})}else if(g.type==="Feature"){const x=g.geometry.type;if(x==="Polygon"||x==="MultiPolygon")return new ta(g,g.geometry)}else if(g.type==="Polygon"||g.type==="MultiPolygon")return new ta(g,g)}return p.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(c){if(c.geometry()!=null&&c.canonicalID()!=null){if(c.geometryType()==="Point")return function(p,g){const x=[1/0,1/0,-1/0,-1/0],C=[1/0,1/0,-1/0,-1/0],A=p.canonicalID();if(g.type==="Polygon"){const k=p6(g.coordinates,C,A),N=Q5(p.geometry(),x,C,A);if(!Qs(x,C))return!1;for(const U of N)if(!B2(U,k))return!1}if(g.type==="MultiPolygon"){const k=T5(g.coordinates,C,A),N=Q5(p.geometry(),x,C,A);if(!Qs(x,C))return!1;for(const U of N)if(!h6(U,k))return!1}return!0}(c,this.geometries);if(c.geometryType()==="LineString")return function(p,g){const x=[1/0,1/0,-1/0,-1/0],C=[1/0,1/0,-1/0,-1/0],A=p.canonicalID();if(g.type==="Polygon"){const k=p6(g.coordinates,C,A),N=U3(p.geometry(),x,C,A);if(!Qs(x,C))return!1;for(const U of N)if(!d6(U,k))return!1}if(g.type==="MultiPolygon"){const k=T5(g.coordinates,C,A),N=U3(p.geometry(),x,C,A);if(!Qs(x,C))return!1;for(const U of N)if(!q7(U,k))return!1}return!0}(c,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let m5=class{constructor(h=[],c=(p,g)=>p<g?-1:p>g?1:0){if(this.data=h,this.length=this.data.length,this.compare=c,this.length>0)for(let p=(this.length>>1)-1;p>=0;p--)this._down(p)}push(h){this.data.push(h),this._up(this.length++)}pop(){if(this.length===0)return;const h=this.data[0],c=this.data.pop();return--this.length>0&&(this.data[0]=c,this._down(0)),h}peek(){return this.data[0]}_up(h){const{data:c,compare:p}=this,g=c[h];for(;h>0;){const x=h-1>>1,C=c[x];if(p(g,C)>=0)break;c[h]=C,h=x}c[h]=g}_down(h){const{data:c,compare:p}=this,g=this.length>>1,x=c[h];for(;h<g;){let C=1+(h<<1);const A=C+1;if(A<this.length&&p(c[A],c[C])<0&&(C=A),p(c[C],x)>=0)break;c[h]=c[C],h=C}c[h]=x}};function Nh(h,c,p,g,x){ea(h,c,p,g||h.length-1,x||Dh)}function ea(h,c,p,g,x){for(;g>p;){if(g-p>600){var C=g-p+1,A=c-p+1,k=Math.log(C),N=.5*Math.exp(2*k/3),U=.5*Math.sqrt(k*N*(C-N)/C)*(A-C/2<0?-1:1);ea(h,c,Math.max(p,Math.floor(c-A*N/C+U)),Math.min(g,Math.floor(c+(C-A)*N/C+U)),x)}var W=h[c],K=p,et=g;for(F2(h,p,c),x(h[g],W)>0&&F2(h,p,g);K<et;){for(F2(h,K,et),K++,et--;x(h[K],W)<0;)K++;for(;x(h[et],W)>0;)et--}x(h[p],W)===0?F2(h,p,et):F2(h,++et,g),et<=c&&(p=et+1),c<=et&&(g=et-1)}}function F2(h,c,p){var g=h[c];h[c]=h[p],h[p]=g}function Dh(h,c){return h<c?-1:h>c?1:0}function f6(h,c){if(h.length<=1)return[h];const p=[];let g,x;for(const C of h){const A=G3(C);A!==0&&(C.area=Math.abs(A),x===void 0&&(x=A<0),x===A<0?(g&&p.push(g),g=[C]):g.push(C))}if(g&&p.push(g),c>1)for(let C=0;C<p.length;C++)p[C].length<=c||(Nh(p[C],c,1,p[C].length-1,g5),p[C]=p[C].slice(0,c));return p}function g5(h,c){return c.area-h.area}function G3(h){let c=0;for(let p,g,x=0,C=h.length,A=C-1;x<C;A=x++)p=h[x],g=h[A],c+=(g.x-p.x)*(p.y+g.y);return c}const T6=1/298.257223563,Q6=T6*(2-T6),m6=Math.PI/180;class Va{constructor(c){const p=6378.137*m6*1e3,g=Math.cos(c*m6),x=1/(1-Q6*(1-g*g)),C=Math.sqrt(x);this.kx=p*C*g,this.ky=p*C*x*(1-Q6)}distance(c,p){const g=this.wrap(c[0]-p[0])*this.kx,x=(c[1]-p[1])*this.ky;return Math.sqrt(g*g+x*x)}pointOnLine(c,p){let g,x,C,A,k=1/0;for(let N=0;N<c.length-1;N++){let U=c[N][0],W=c[N][1],K=this.wrap(c[N+1][0]-U)*this.kx,et=(c[N+1][1]-W)*this.ky,at=0;K===0&&et===0||(at=(this.wrap(p[0]-U)*this.kx*K+(p[1]-W)*this.ky*et)/(K*K+et*et),at>1?(U=c[N+1][0],W=c[N+1][1]):at>0&&(U+=K/this.kx*at,W+=et/this.ky*at)),K=this.wrap(p[0]-U)*this.kx,et=(p[1]-W)*this.ky;const ht=K*K+et*et;ht<k&&(k=ht,g=U,x=W,C=N,A=at)}return{point:[g,x],index:C,t:Math.max(0,Math.min(1,A))}}wrap(c){for(;c<-180;)c+=360;for(;c>180;)c-=360;return c}}function K7(h,c){return c[0]-h[0]}function g6(h){return h[1]-h[0]+1}function ms(h,c){return h[1]>=h[0]&&h[1]<c}function y5(h,c){if(h[0]>h[1])return[null,null];const p=g6(h);if(c){if(p===2)return[h,null];const x=Math.floor(p/2);return[[h[0],h[0]+x],[h[0]+x,h[1]]]}if(p===1)return[h,null];const g=Math.floor(p/2)-1;return[[h[0],h[0]+g],[h[0]+g+1,h[1]]]}function _5(h,c){if(!ms(c,h.length))return[1/0,1/0,-1/0,-1/0];const p=[1/0,1/0,-1/0,-1/0];for(let g=c[0];g<=c[1];++g)Pa(p,h[g]);return p}function y6(h){const c=[1/0,1/0,-1/0,-1/0];for(const p of h)for(const g of p)Pa(c,g);return c}function j2(h){return h[0]!==-1/0&&h[1]!==-1/0&&h[2]!==1/0&&h[3]!==1/0}function gs(h,c,p){if(!j2(h)||!j2(c))return NaN;let g=0,x=0;return h[2]<c[0]&&(g=c[0]-h[2]),h[0]>c[2]&&(g=h[0]-c[2]),h[1]>c[3]&&(x=h[1]-c[3]),h[3]<c[1]&&(x=c[1]-h[3]),p.distance([0,0],[g,x])}function uo(h,c,p){const g=p.pointOnLine(c,h);return p.distance(h,g.point)}function ys(h,c,p,g,x){const C=Math.min(uo(h,[p,g],x),uo(c,[p,g],x)),A=Math.min(uo(p,[h,c],x),uo(g,[h,c],x));return Math.min(C,A)}function _6(h,c,p,g,x){if(!ms(c,h.length)||!ms(g,p.length))return 1/0;let C=1/0;for(let A=c[0];A<c[1];++A){const k=h[A],N=h[A+1];for(let U=g[0];U<g[1];++U){const W=p[U],K=p[U+1];if(z3(k,N,W,K))return 0;C=Math.min(C,ys(k,N,W,K,x))}}return C}function Qn(h,c,p,g,x){if(!ms(c,h.length)||!ms(g,p.length))return NaN;let C=1/0;for(let A=c[0];A<=c[1];++A)for(let k=g[0];k<=g[1];++k)if(C=Math.min(C,x.distance(h[A],p[k])),C===0)return C;return C}function Bh(h,c,p){if(B2(h,c,!0))return 0;let g=1/0;for(const x of c){const C=x[0],A=x[x.length-1];if(C!==A&&(g=Math.min(g,uo(h,[A,C],p)),g===0))return g;const k=p.pointOnLine(x,h);if(g=Math.min(g,p.distance(h,k.point)),g===0)return g}return g}function Vr(h,c,p,g){if(!ms(c,h.length))return NaN;for(let C=c[0];C<=c[1];++C)if(B2(h[C],p,!0))return 0;let x=1/0;for(let C=c[0];C<c[1];++C){const A=h[C],k=h[C+1];for(const N of p)for(let U=0,W=N.length,K=W-1;U<W;K=U++){const et=N[K],at=N[U];if(z3(A,k,et,at))return 0;x=Math.min(x,ys(A,k,et,at,g))}}return x}function ra(h,c){for(const p of h)for(const g of p)if(B2(g,c,!0))return!0;return!1}function _n(h,c,p,g=1/0){const x=y6(h),C=y6(c);if(g!==1/0&&gs(x,C,p)>=g)return g;if(Qs(x,C)){if(ra(h,c))return 0}else if(ra(c,h))return 0;let A=1/0;for(const k of h)for(let N=0,U=k.length,W=U-1;N<U;W=N++){const K=k[W],et=k[N];for(const at of c)for(let ht=0,Tt=at.length,Lt=Tt-1;ht<Tt;Lt=ht++){const Et=at[Lt],$t=at[ht];if(z3(K,et,Et,$t))return 0;A=Math.min(A,ys(K,et,Et,$t,p))}}return A}function dn(h,c,p,g,x,C){if(!C)return;const A=gs(_5(g,C),x,p);A<c&&h.push([A,C,[0,0]])}function Ra(h,c,p,g,x,C,A){if(!C||!A)return;const k=gs(_5(g,C),_5(x,A),p);k<c&&h.push([k,C,A])}function $3(h,c,p,g,x=1/0){let C=Math.min(g.distance(h[0],p[0][0]),x);if(C===0)return C;const A=new m5([[0,[0,h.length-1],[0,0]]],K7),k=y6(p);for(;A.length>0;){const N=A.pop();if(N[0]>=C)continue;const U=N[1],W=c?50:100;if(g6(U)<=W){if(!ms(U,h.length))return NaN;if(c){const K=Vr(h,U,p,g);if(isNaN(K)||K===0)return K;C=Math.min(C,K)}else for(let K=U[0];K<=U[1];++K){const et=Bh(h[K],p,g);if(C=Math.min(C,et),C===0)return 0}}else{const K=y5(U,c);dn(A,C,g,h,k,K[0]),dn(A,C,g,h,k,K[1])}}return C}function z2(h,c,p,g,x,C=1/0){let A=Math.min(C,x.distance(h[0],p[0]));if(A===0)return A;const k=new m5([[0,[0,h.length-1],[0,p.length-1]]],K7);for(;k.length>0;){const N=k.pop();if(N[0]>=A)continue;const U=N[1],W=N[2],K=c?50:100,et=g?50:100;if(g6(U)<=K&&g6(W)<=et){if(!ms(U,h.length)&&ms(W,p.length))return NaN;let at;if(c&&g)at=_6(h,U,p,W,x),A=Math.min(A,at);else if(c&&!g){const ht=h.slice(U[0],U[1]+1);for(let Tt=W[0];Tt<=W[1];++Tt)if(at=uo(p[Tt],ht,x),A=Math.min(A,at),A===0)return A}else if(!c&&g){const ht=p.slice(W[0],W[1]+1);for(let Tt=U[0];Tt<=U[1];++Tt)if(at=uo(h[Tt],ht,x),A=Math.min(A,at),A===0)return A}else at=Qn(h,U,p,W,x),A=Math.min(A,at)}else{const at=y5(U,c),ht=y5(W,g);Ra(k,A,x,h,p,at[0],ht[0]),Ra(k,A,x,h,p,at[0],ht[1]),Ra(k,A,x,h,p,at[1],ht[0]),Ra(k,A,x,h,p,at[1],ht[1])}}return A}function v6(h){return h.type==="MultiPolygon"?h.coordinates.map(c=>({type:"Polygon",coordinates:c})):h.type==="MultiLineString"?h.coordinates.map(c=>({type:"LineString",coordinates:c})):h.type==="MultiPoint"?h.coordinates.map(c=>({type:"Point",coordinates:c})):[h]}class z1{constructor(c,p){this.type=Ee,this.geojson=c,this.geometries=p}static parse(c,p){if(c.length!==2)return p.error(`'distance' expression requires exactly one argument, but found ${c.length-1} instead.`);if(Yi(c[1])){const g=c[1];if(g.type==="FeatureCollection")return new z1(g,g.features.map(x=>v6(x.geometry)).flat());if(g.type==="Feature")return new z1(g,v6(g.geometry));if("type"in g&&"coordinates"in g)return new z1(g,v6(g))}return p.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(c){if(c.geometry()!=null&&c.canonicalID()!=null){if(c.geometryType()==="Point")return function(p,g){const x=p.geometry(),C=x.flat().map(N=>f5([N.x,N.y],p.canonical));if(x.length===0)return NaN;const A=new Va(C[0][1]);let k=1/0;for(const N of g){switch(N.type){case"Point":k=Math.min(k,z2(C,!1,[N.coordinates],!1,A,k));break;case"LineString":k=Math.min(k,z2(C,!1,N.coordinates,!0,A,k));break;case"Polygon":k=Math.min(k,$3(C,!1,N.coordinates,A,k))}if(k===0)return k}return k}(c,this.geometries);if(c.geometryType()==="LineString")return function(p,g){const x=p.geometry(),C=x.flat().map(N=>f5([N.x,N.y],p.canonical));if(x.length===0)return NaN;const A=new Va(C[0][1]);let k=1/0;for(const N of g){switch(N.type){case"Point":k=Math.min(k,z2(C,!0,[N.coordinates],!1,A,k));break;case"LineString":k=Math.min(k,z2(C,!0,N.coordinates,!0,A,k));break;case"Polygon":k=Math.min(k,$3(C,!0,N.coordinates,A,k))}if(k===0)return k}return k}(c,this.geometries);if(c.geometryType()==="Polygon")return function(p,g){const x=p.geometry();if(x.length===0||x[0].length===0)return NaN;const C=f6(x,0).map(N=>N.map(U=>U.map(W=>f5([W.x,W.y],p.canonical)))),A=new Va(C[0][0][0][1]);let k=1/0;for(const N of g)for(const U of C){switch(N.type){case"Point":k=Math.min(k,$3([N.coordinates],!1,U,A,k));break;case"LineString":k=Math.min(k,$3(N.coordinates,!0,U,A,k));break;case"Polygon":k=Math.min(k,_n(U,N.coordinates,A,k))}if(k===0)return k}return k}(c,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const L1={"==":p5,"!=":Z7,">":W7,"<":En,">=":j1,"<=":Ph,array:to,at:V,boolean:to,case:nt,coalesce:ir,collator:D2,format:F3,image:j3,in:Z,"index-of":F,interpolate:Yr,"interpolate-hcl":Yr,"interpolate-lab":Yr,length:u6,let:e1,literal:Ji,match:X,number:to,"number-format":c6,object:to,slice:dt,step:Wt,string:to,"to-boolean":$i,"to-color":$i,"to-number":$i,"to-string":$i,var:jr,within:ta,distance:z1};class r1{constructor(c,p,g,x){this.name=c,this.type=p,this._evaluate=g,this.args=x}evaluate(c){return this._evaluate(c,this.args)}eachChild(c){this.args.forEach(c)}outputDefined(){return!1}static parse(c,p){const g=c[0],x=r1.definitions[g];if(!x)return p.error(`Unknown expression "${g}". If you wanted a literal array, use ["literal", [...]].`,0);const C=Array.isArray(x)?x[0]:x.type,A=Array.isArray(x)?[[x[1],x[2]]]:x.overloads,k=A.filter(([U])=>!Array.isArray(U)||U.length===c.length-1);let N=null;for(const[U,W]of k){N=new F1(p.registry,Z3,p.path,null,p.scope);const K=[];let et=!1;for(let at=1;at<c.length;at++){const ht=c[at],Tt=Array.isArray(U)?U[at-1]:U.type,Lt=N.parse(ht,1+K.length,Tt);if(!Lt){et=!0;break}K.push(Lt)}if(!et)if(Array.isArray(U)&&U.length!==K.length)N.error(`Expected ${U.length} arguments, but found ${K.length} instead.`);else{for(let at=0;at<K.length;at++){const ht=Array.isArray(U)?U[at]:U.type,Tt=K[at];N.concat(at+1).checkSubtype(ht,Tt.type)}if(N.errors.length===0)return new r1(g,C,W,K)}}if(k.length===1)p.errors.push(...N.errors);else{const U=(k.length?k:A).map(([K])=>{return et=K,Array.isArray(et)?`(${et.map(st).join(", ")})`:`(${st(et.type)}...)`;var et}).join(" | "),W=[];for(let K=1;K<c.length;K++){const et=p.parse(c[K],1+W.length);if(!et)return null;W.push(st(et.type))}p.error(`Expected arguments of type ${U}, but found (${W.join(", ")}) instead.`)}return null}static register(c,p){r1.definitions=p;for(const g in p)c[g]=r1}}function U1(h,[c,p,g,x]){c=c.evaluate(h),p=p.evaluate(h),g=g.evaluate(h);const C=x?x.evaluate(h):1,A=t1(c,p,g,C);if(A)throw new Nn(A);return new Ur(c/255,p/255,g/255,C,!1)}function v5(h,c){return h in c}function _s(h,c){const p=c[h];return p===void 0?null:p}function na(h){return{type:h}}function Z3(h){if(h instanceof jr)return Z3(h.boundExpression);if(h instanceof r1&&h.name==="error"||h instanceof D2||h instanceof ta||h instanceof z1)return!1;const c=h instanceof $i||h instanceof to;let p=!0;return h.eachChild(g=>{p=c?p&&Z3(g):p&&g instanceof Ji}),!!p&&ia(h)&&U2(h,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function ia(h){if(h instanceof r1&&(h.name==="get"&&h.args.length===1||h.name==="feature-state"||h.name==="has"&&h.args.length===1||h.name==="properties"||h.name==="geometry-type"||h.name==="id"||/^filter-/.test(h.name))||h instanceof ta||h instanceof z1)return!1;let c=!0;return h.eachChild(p=>{c&&!ia(p)&&(c=!1)}),c}function oa(h){if(h instanceof r1&&h.name==="feature-state")return!1;let c=!0;return h.eachChild(p=>{c&&!oa(p)&&(c=!1)}),c}function U2(h,c){if(h instanceof r1&&c.indexOf(h.name)>=0)return!1;let p=!0;return h.eachChild(g=>{p&&!U2(g,c)&&(p=!1)}),p}function W3(h){return{result:"success",value:h}}function Na(h){return{result:"error",value:h}}function G1(h){return h["property-type"]==="data-driven"||h["property-type"]==="cross-faded-data-driven"}function b5(h){return!!h.expression&&h.expression.parameters.indexOf("zoom")>-1}function L5(h){return!!h.expression&&h.expression.interpolated}function It(h){return h instanceof Number?"number":h instanceof String?"string":h instanceof Boolean?"boolean":Array.isArray(h)?"array":h===null?"null":typeof h}function ne(h){return typeof h=="object"&&h!==null&&!Array.isArray(h)}function Ne(h){return h}function dr(h,c){const p=c.type==="color",g=h.stops&&typeof h.stops[0][0]=="object",x=g||!(g||h.property!==void 0),C=h.type||(L5(c)?"exponential":"interval");if(p||c.type==="padding"){const W=p?Ur.parse:Xn.parse;(h=mi({},h)).stops&&(h.stops=h.stops.map(K=>[K[0],W(K[1])])),h.default=W(h.default?h.default:c.default)}if(h.colorSpace&&(A=h.colorSpace)!=="rgb"&&A!=="hcl"&&A!=="lab")throw new Error(`Unknown color space: "${h.colorSpace}"`);var A;let k,N,U;if(C==="exponential")k=yi;else if(C==="interval")k=Kn;else if(C==="categorical"){k=Gr,N=Object.create(null);for(const W of h.stops)N[W[0]]=W[1];U=typeof h.stops[0][0]}else{if(C!=="identity")throw new Error(`Unknown function type "${C}"`);k=n1}if(g){const W={},K=[];for(let ht=0;ht<h.stops.length;ht++){const Tt=h.stops[ht],Lt=Tt[0].zoom;W[Lt]===void 0&&(W[Lt]={zoom:Lt,type:h.type,property:h.property,default:h.default,stops:[]},K.push(Lt)),W[Lt].stops.push([Tt[0].value,Tt[1]])}const et=[];for(const ht of K)et.push([W[ht].zoom,dr(W[ht],c)]);const at={name:"linear"};return{kind:"composite",interpolationType:at,interpolationFactor:Yr.interpolationFactor.bind(void 0,at),zoomStops:et.map(ht=>ht[0]),evaluate:({zoom:ht},Tt)=>yi({stops:et,base:h.base},c,ht).evaluate(ht,Tt)}}if(x){const W=C==="exponential"?{name:"exponential",base:h.base!==void 0?h.base:1}:null;return{kind:"camera",interpolationType:W,interpolationFactor:Yr.interpolationFactor.bind(void 0,W),zoomStops:h.stops.map(K=>K[0]),evaluate:({zoom:K})=>k(h,c,K,N,U)}}return{kind:"source",evaluate(W,K){const et=K&&K.properties?K.properties[h.property]:void 0;return et===void 0?pn(h.default,c.default):k(h,c,et,N,U)}}}function pn(h,c,p){return h!==void 0?h:c!==void 0?c:p!==void 0?p:void 0}function Gr(h,c,p,g,x){return pn(typeof p===x?g[p]:void 0,h.default,c.default)}function Kn(h,c,p){if(It(p)!=="number")return pn(h.default,c.default);const g=h.stops.length;if(g===1||p<=h.stops[0][0])return h.stops[0][1];if(p>=h.stops[g-1][0])return h.stops[g-1][1];const x=yt(h.stops.map(C=>C[0]),p);return h.stops[x][1]}function yi(h,c,p){const g=h.base!==void 0?h.base:1;if(It(p)!=="number")return pn(h.default,c.default);const x=h.stops.length;if(x===1||p<=h.stops[0][0])return h.stops[0][1];if(p>=h.stops[x-1][0])return h.stops[x-1][1];const C=yt(h.stops.map(W=>W[0]),p),A=function(W,K,et,at){const ht=at-et,Tt=W-et;return ht===0?0:K===1?Tt/ht:(Math.pow(K,Tt)-1)/(Math.pow(K,ht)-1)}(p,g,h.stops[C][0],h.stops[C+1][0]),k=h.stops[C][1],N=h.stops[C+1][1],U=Tr[c.type]||Ne;return typeof k.evaluate=="function"?{evaluate(...W){const K=k.evaluate.apply(void 0,W),et=N.evaluate.apply(void 0,W);if(K!==void 0&&et!==void 0)return U(K,et,A,h.colorSpace)}}:U(k,N,A,h.colorSpace)}function n1(h,c,p){switch(c.type){case"color":p=Ur.parse(p);break;case"formatted":p=Br.fromString(p.toString());break;case"resolvedImage":p=tn.fromString(p.toString());break;case"padding":p=Xn.parse(p);break;default:It(p)===c.type||c.type==="enum"&&c.values[p]||(p=void 0)}return pn(p,h.default,c.default)}r1.register(L1,{error:[{kind:"error"},[Or],(h,[c])=>{throw new Nn(c.evaluate(h))}],typeof:[Or,[fr],(h,[c])=>st(ln(c.evaluate(h)))],"to-rgba":[ot(Ee,4),[ai],(h,[c])=>{const[p,g,x,C]=c.evaluate(h).rgb;return[255*p,255*g,255*x,C]}],rgb:[ai,[Ee,Ee,Ee],U1],rgba:[ai,[Ee,Ee,Ee,Ee],U1],has:{type:pr,overloads:[[[Or],(h,[c])=>v5(c.evaluate(h),h.properties())],[[Or,co],(h,[c,p])=>v5(c.evaluate(h),p.evaluate(h))]]},get:{type:fr,overloads:[[[Or],(h,[c])=>_s(c.evaluate(h),h.properties())],[[Or,co],(h,[c,p])=>_s(c.evaluate(h),p.evaluate(h))]]},"feature-state":[fr,[Or],(h,[c])=>_s(c.evaluate(h),h.featureState||{})],properties:[co,[],h=>h.properties()],"geometry-type":[Or,[],h=>h.geometryType()],id:[fr,[],h=>h.id()],zoom:[Ee,[],h=>h.globals.zoom],"heatmap-density":[Ee,[],h=>h.globals.heatmapDensity||0],"line-progress":[Ee,[],h=>h.globals.lineProgress||0],accumulated:[fr,[],h=>h.globals.accumulated===void 0?null:h.globals.accumulated],"+":[Ee,na(Ee),(h,c)=>{let p=0;for(const g of c)p+=g.evaluate(h);return p}],"*":[Ee,na(Ee),(h,c)=>{let p=1;for(const g of c)p*=g.evaluate(h);return p}],"-":{type:Ee,overloads:[[[Ee,Ee],(h,[c,p])=>c.evaluate(h)-p.evaluate(h)],[[Ee],(h,[c])=>-c.evaluate(h)]]},"/":[Ee,[Ee,Ee],(h,[c,p])=>c.evaluate(h)/p.evaluate(h)],"%":[Ee,[Ee,Ee],(h,[c,p])=>c.evaluate(h)%p.evaluate(h)],ln2:[Ee,[],()=>Math.LN2],pi:[Ee,[],()=>Math.PI],e:[Ee,[],()=>Math.E],"^":[Ee,[Ee,Ee],(h,[c,p])=>Math.pow(c.evaluate(h),p.evaluate(h))],sqrt:[Ee,[Ee],(h,[c])=>Math.sqrt(c.evaluate(h))],log10:[Ee,[Ee],(h,[c])=>Math.log(c.evaluate(h))/Math.LN10],ln:[Ee,[Ee],(h,[c])=>Math.log(c.evaluate(h))],log2:[Ee,[Ee],(h,[c])=>Math.log(c.evaluate(h))/Math.LN2],sin:[Ee,[Ee],(h,[c])=>Math.sin(c.evaluate(h))],cos:[Ee,[Ee],(h,[c])=>Math.cos(c.evaluate(h))],tan:[Ee,[Ee],(h,[c])=>Math.tan(c.evaluate(h))],asin:[Ee,[Ee],(h,[c])=>Math.asin(c.evaluate(h))],acos:[Ee,[Ee],(h,[c])=>Math.acos(c.evaluate(h))],atan:[Ee,[Ee],(h,[c])=>Math.atan(c.evaluate(h))],min:[Ee,na(Ee),(h,c)=>Math.min(...c.map(p=>p.evaluate(h)))],max:[Ee,na(Ee),(h,c)=>Math.max(...c.map(p=>p.evaluate(h)))],abs:[Ee,[Ee],(h,[c])=>Math.abs(c.evaluate(h))],round:[Ee,[Ee],(h,[c])=>{const p=c.evaluate(h);return p<0?-Math.round(-p):Math.round(p)}],floor:[Ee,[Ee],(h,[c])=>Math.floor(c.evaluate(h))],ceil:[Ee,[Ee],(h,[c])=>Math.ceil(c.evaluate(h))],"filter-==":[pr,[Or,fr],(h,[c,p])=>h.properties()[c.value]===p.value],"filter-id-==":[pr,[fr],(h,[c])=>h.id()===c.value],"filter-type-==":[pr,[Or],(h,[c])=>h.geometryType()===c.value],"filter-<":[pr,[Or,fr],(h,[c,p])=>{const g=h.properties()[c.value],x=p.value;return typeof g==typeof x&&g<x}],"filter-id-<":[pr,[fr],(h,[c])=>{const p=h.id(),g=c.value;return typeof p==typeof g&&p<g}],"filter->":[pr,[Or,fr],(h,[c,p])=>{const g=h.properties()[c.value],x=p.value;return typeof g==typeof x&&g>x}],"filter-id->":[pr,[fr],(h,[c])=>{const p=h.id(),g=c.value;return typeof p==typeof g&&p>g}],"filter-<=":[pr,[Or,fr],(h,[c,p])=>{const g=h.properties()[c.value],x=p.value;return typeof g==typeof x&&g<=x}],"filter-id-<=":[pr,[fr],(h,[c])=>{const p=h.id(),g=c.value;return typeof p==typeof g&&p<=g}],"filter->=":[pr,[Or,fr],(h,[c,p])=>{const g=h.properties()[c.value],x=p.value;return typeof g==typeof x&&g>=x}],"filter-id->=":[pr,[fr],(h,[c])=>{const p=h.id(),g=c.value;return typeof p==typeof g&&p>=g}],"filter-has":[pr,[fr],(h,[c])=>c.value in h.properties()],"filter-has-id":[pr,[],h=>h.id()!==null&&h.id()!==void 0],"filter-type-in":[pr,[ot(Or)],(h,[c])=>c.value.indexOf(h.geometryType())>=0],"filter-id-in":[pr,[ot(fr)],(h,[c])=>c.value.indexOf(h.id())>=0],"filter-in-small":[pr,[Or,ot(fr)],(h,[c,p])=>p.value.indexOf(h.properties()[c.value])>=0],"filter-in-large":[pr,[Or,ot(fr)],(h,[c,p])=>function(g,x,C,A){for(;C<=A;){const k=C+A>>1;if(x[k]===g)return!0;x[k]>g?A=k-1:C=k+1}return!1}(h.properties()[c.value],p.value,0,p.value.length-1)],all:{type:pr,overloads:[[[pr,pr],(h,[c,p])=>c.evaluate(h)&&p.evaluate(h)],[na(pr),(h,c)=>{for(const p of c)if(!p.evaluate(h))return!1;return!0}]]},any:{type:pr,overloads:[[[pr,pr],(h,[c,p])=>c.evaluate(h)||p.evaluate(h)],[na(pr),(h,c)=>{for(const p of c)if(p.evaluate(h))return!0;return!1}]]},"!":[pr,[pr],(h,[c])=>!c.evaluate(h)],"is-supported-script":[pr,[Or],(h,[c])=>{const p=h.globals&&h.globals.isSupportedScript;return!p||p(c.evaluate(h))}],upcase:[Or,[Or],(h,[c])=>c.evaluate(h).toUpperCase()],downcase:[Or,[Or],(h,[c])=>c.evaluate(h).toLowerCase()],concat:[Or,na(fr),(h,c)=>c.map(p=>Vi(p.evaluate(h))).join("")],"resolved-locale":[Or,[ui],(h,[c])=>c.evaluate(h).resolvedLocale()]});class hi{constructor(c,p){var g;this.expression=c,this._warningHistory={},this._evaluator=new N2,this._defaultValue=p?(g=p).type==="color"&&ne(g.default)?new Ur(0,0,0,0):g.type==="color"?Ur.parse(g.default)||null:g.type==="padding"?Xn.parse(g.default)||null:g.type==="variableAnchorOffsetCollection"?hn.parse(g.default)||null:g.default===void 0?null:g.default:null,this._enumValues=p&&p.type==="enum"?p.values:null}evaluateWithoutErrorHandling(c,p,g,x,C,A){return this._evaluator.globals=c,this._evaluator.feature=p,this._evaluator.featureState=g,this._evaluator.canonical=x,this._evaluator.availableImages=C||null,this._evaluator.formattedSection=A,this.expression.evaluate(this._evaluator)}evaluate(c,p,g,x,C,A){this._evaluator.globals=c,this._evaluator.feature=p||null,this._evaluator.featureState=g||null,this._evaluator.canonical=x,this._evaluator.availableImages=C||null,this._evaluator.formattedSection=A||null;try{const k=this.expression.evaluate(this._evaluator);if(k==null||typeof k=="number"&&k!=k)return this._defaultValue;if(this._enumValues&&!(k in this._enumValues))throw new Nn(`Expected value to be one of ${Object.keys(this._enumValues).map(N=>JSON.stringify(N)).join(", ")}, but found ${JSON.stringify(k)} instead.`);return k}catch(k){return this._warningHistory[k.message]||(this._warningHistory[k.message]=!0,typeof console<"u"&&console.warn(k.message)),this._defaultValue}}}function di(h){return Array.isArray(h)&&h.length>0&&typeof h[0]=="string"&&h[0]in L1}function ho(h,c){const p=new F1(L1,Z3,[],c?function(x){const C={color:ai,string:Or,number:Ee,enum:Or,boolean:pr,formatted:Lo,padding:Ki,resolvedImage:xn,variableAnchorOffsetCollection:xt};return x.type==="array"?ot(C[x.value]||fr,x.length):C[x.type]}(c):void 0),g=p.parse(h,void 0,void 0,void 0,c&&c.type==="string"?{typeAnnotation:"coerce"}:void 0);return g?W3(new hi(g,c)):Na(p.errors)}class wo{constructor(c,p){this.kind=c,this._styleExpression=p,this.isStateDependent=c!=="constant"&&!oa(p.expression)}evaluateWithoutErrorHandling(c,p,g,x,C,A){return this._styleExpression.evaluateWithoutErrorHandling(c,p,g,x,C,A)}evaluate(c,p,g,x,C,A){return this._styleExpression.evaluate(c,p,g,x,C,A)}}class Li{constructor(c,p,g,x){this.kind=c,this.zoomStops=g,this._styleExpression=p,this.isStateDependent=c!=="camera"&&!oa(p.expression),this.interpolationType=x}evaluateWithoutErrorHandling(c,p,g,x,C,A){return this._styleExpression.evaluateWithoutErrorHandling(c,p,g,x,C,A)}evaluate(c,p,g,x,C,A){return this._styleExpression.evaluate(c,p,g,x,C,A)}interpolationFactor(c,p,g){return this.interpolationType?Yr.interpolationFactor(this.interpolationType,c,p,g):0}}function w1(h,c){const p=ho(h,c);if(p.result==="error")return p;const g=p.value.expression,x=ia(g);if(!x&&!G1(c))return Na([new Rn("","data expressions not supported")]);const C=U2(g,["zoom"]);if(!C&&!b5(c))return Na([new Rn("","zoom expressions not supported")]);const A=sa(g);return A||C?A instanceof Rn?Na([A]):A instanceof Yr&&!L5(c)?Na([new Rn("",'"interpolate" expressions cannot be used with this property')]):W3(A?new Li(x?"camera":"composite",p.value,A.labels,A instanceof Yr?A.interpolation:void 0):new wo(x?"constant":"source",p.value)):Na([new Rn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class x1{constructor(c,p){this._parameters=c,this._specification=p,mi(this,dr(this._parameters,this._specification))}static deserialize(c){return new x1(c._parameters,c._specification)}static serialize(c){return{_parameters:c._parameters,_specification:c._specification}}}function sa(h){let c=null;if(h instanceof e1)c=sa(h.result);else if(h instanceof ir){for(const p of h.args)if(c=sa(p),c)break}else(h instanceof Wt||h instanceof Yr)&&h.input instanceof r1&&h.input.name==="zoom"&&(c=h);return c instanceof Rn||h.eachChild(p=>{const g=sa(p);g instanceof Rn?c=g:!c&&g?c=new Rn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):c&&g&&c!==g&&(c=new Rn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),c}function vs(h){if(h===!0||h===!1)return!0;if(!Array.isArray(h)||h.length===0)return!1;switch(h[0]){case"has":return h.length>=2&&h[1]!=="$id"&&h[1]!=="$type";case"in":return h.length>=3&&(typeof h[1]!="string"||Array.isArray(h[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return h.length!==3||Array.isArray(h[1])||Array.isArray(h[2]);case"any":case"all":for(const c of h.slice(1))if(!vs(c)&&typeof c!="boolean")return!1;return!0;default:return!0}}const aa={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function b6(h){if(h==null)return{filter:()=>!0,needGeometry:!1};vs(h)||(h=fn(h));const c=ho(h,aa);if(c.result==="error")throw new Error(c.value.map(p=>`${p.key}: ${p.message}`).join(", "));return{filter:(p,g,x)=>c.value.evaluate(p,g,{},x),needGeometry:Y7(h)}}function Fh(h,c){return h<c?-1:h>c?1:0}function Y7(h){if(!Array.isArray(h))return!1;if(h[0]==="within"||h[0]==="distance")return!0;for(let c=1;c<h.length;c++)if(Y7(h[c]))return!0;return!1}function fn(h){if(!h)return!0;const c=h[0];return h.length<=1?c!=="any":c==="=="?cn(h[1],h[2],"=="):c==="!="?Ri(cn(h[1],h[2],"==")):c==="<"||c===">"||c==="<="||c===">="?cn(h[1],h[2],c):c==="any"?(p=h.slice(1),["any"].concat(p.map(fn))):c==="all"?["all"].concat(h.slice(1).map(fn)):c==="none"?["all"].concat(h.slice(1).map(fn).map(Ri)):c==="in"?la(h[1],h.slice(2)):c==="!in"?Ri(la(h[1],h.slice(2))):c==="has"?i1(h[1]):c!=="!has"||Ri(i1(h[1]));var p}function cn(h,c,p){switch(h){case"$type":return[`filter-type-${p}`,c];case"$id":return[`filter-id-${p}`,c];default:return[`filter-${p}`,h,c]}}function la(h,c){if(c.length===0)return!1;switch(h){case"$type":return["filter-type-in",["literal",c]];case"$id":return["filter-id-in",["literal",c]];default:return c.length>200&&!c.some(p=>typeof p!=typeof c[0])?["filter-in-large",h,["literal",c.sort(Fh)]]:["filter-in-small",h,["literal",c]]}}function i1(h){switch(h){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",h]}}function Ri(h){return["!",h]}function Ni(h){const c=typeof h;if(c==="number"||c==="boolean"||c==="string"||h==null)return JSON.stringify(h);if(Array.isArray(h)){let x="[";for(const C of h)x+=`${Ni(C)},`;return`${x}]`}const p=Object.keys(h).sort();let g="{";for(let x=0;x<p.length;x++)g+=`${JSON.stringify(p[x])}:${Ni(h[p[x]])},`;return`${g}}`}function $1(h){let c="";for(const p of Fr)c+=`/${Ni(h[p])}`;return c}function bs(h){const c=h.value;return c?[new fe(h.key,c,"constants have been deprecated as of v8")]:[]}function Sn(h){return h instanceof Number||h instanceof String||h instanceof Boolean?h.valueOf():h}function xo(h){if(Array.isArray(h))return h.map(xo);if(h instanceof Object&&!(h instanceof Number||h instanceof String||h instanceof Boolean)){const c={};for(const p in h)c[p]=xo(h[p]);return c}return Sn(h)}function Di(h){const c=h.key,p=h.value,g=h.valueSpec||{},x=h.objectElementValidators||{},C=h.style,A=h.styleSpec,k=h.validateSpec;let N=[];const U=It(p);if(U!=="object")return[new fe(c,p,`object expected, ${U} found`)];for(const W in p){const K=W.split(".")[0],et=g[K]||g["*"];let at;if(x[K])at=x[K];else if(g[K])at=k;else if(x["*"])at=x["*"];else{if(!g["*"]){N.push(new fe(c,p[W],`unknown property "${W}"`));continue}at=k}N=N.concat(at({key:(c&&`${c}.`)+W,value:p[W],valueSpec:et,style:C,styleSpec:A,object:p,objectKey:W,validateSpec:k},p))}for(const W in g)x[W]||g[W].required&&g[W].default===void 0&&p[W]===void 0&&N.push(new fe(c,p,`missing required property "${W}"`));return N}function E1(h){const c=h.value,p=h.valueSpec,g=h.style,x=h.styleSpec,C=h.key,A=h.arrayElementValidator||h.validateSpec;if(It(c)!=="array")return[new fe(C,c,`array expected, ${It(c)} found`)];if(p.length&&c.length!==p.length)return[new fe(C,c,`array length ${p.length} expected, length ${c.length} found`)];if(p["min-length"]&&c.length<p["min-length"])return[new fe(C,c,`array length at least ${p["min-length"]} expected, length ${c.length} found`)];let k={type:p.value,values:p.values};x.$version<7&&(k.function=p.function),It(p.value)==="object"&&(k=p.value);let N=[];for(let U=0;U<c.length;U++)N=N.concat(A({array:c,arrayIndex:U,value:c[U],valueSpec:k,validateSpec:h.validateSpec,style:g,styleSpec:x,key:`${C}[${U}]`}));return N}function L6(h){const c=h.key,p=h.value,g=h.valueSpec;let x=It(p);return x==="number"&&p!=p&&(x="NaN"),x!=="number"?[new fe(c,p,`number expected, ${x} found`)]:"minimum"in g&&p<g.minimum?[new fe(c,p,`${p} is less than the minimum value ${g.minimum}`)]:"maximum"in g&&p>g.maximum?[new fe(c,p,`${p} is greater than the maximum value ${g.maximum}`)]:[]}function Da(h){const c=h.valueSpec,p=Sn(h.value.type);let g,x,C,A={};const k=p!=="categorical"&&h.value.property===void 0,N=!k,U=It(h.value.stops)==="array"&&It(h.value.stops[0])==="array"&&It(h.value.stops[0][0])==="object",W=Di({key:h.key,value:h.value,valueSpec:h.styleSpec.function,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec,objectElementValidators:{stops:function(at){if(p==="identity")return[new fe(at.key,at.value,'identity function may not have a "stops" property')];let ht=[];const Tt=at.value;return ht=ht.concat(E1({key:at.key,value:Tt,valueSpec:at.valueSpec,validateSpec:at.validateSpec,style:at.style,styleSpec:at.styleSpec,arrayElementValidator:K})),It(Tt)==="array"&&Tt.length===0&&ht.push(new fe(at.key,Tt,"array must have at least one stop")),ht},default:function(at){return at.validateSpec({key:at.key,value:at.value,valueSpec:c,validateSpec:at.validateSpec,style:at.style,styleSpec:at.styleSpec})}}});return p==="identity"&&k&&W.push(new fe(h.key,h.value,'missing required property "property"')),p==="identity"||h.value.stops||W.push(new fe(h.key,h.value,'missing required property "stops"')),p==="exponential"&&h.valueSpec.expression&&!L5(h.valueSpec)&&W.push(new fe(h.key,h.value,"exponential functions not supported")),h.styleSpec.$version>=8&&(N&&!G1(h.valueSpec)?W.push(new fe(h.key,h.value,"property functions not supported")):k&&!b5(h.valueSpec)&&W.push(new fe(h.key,h.value,"zoom functions not supported"))),p!=="categorical"&&!U||h.value.property!==void 0||W.push(new fe(h.key,h.value,'"property" property is required')),W;function K(at){let ht=[];const Tt=at.value,Lt=at.key;if(It(Tt)!=="array")return[new fe(Lt,Tt,`array expected, ${It(Tt)} found`)];if(Tt.length!==2)return[new fe(Lt,Tt,`array length 2 expected, length ${Tt.length} found`)];if(U){if(It(Tt[0])!=="object")return[new fe(Lt,Tt,`object expected, ${It(Tt[0])} found`)];if(Tt[0].zoom===void 0)return[new fe(Lt,Tt,"object stop key must have zoom")];if(Tt[0].value===void 0)return[new fe(Lt,Tt,"object stop key must have value")];if(C&&C>Sn(Tt[0].zoom))return[new fe(Lt,Tt[0].zoom,"stop zoom values must appear in ascending order")];Sn(Tt[0].zoom)!==C&&(C=Sn(Tt[0].zoom),x=void 0,A={}),ht=ht.concat(Di({key:`${Lt}[0]`,value:Tt[0],valueSpec:{zoom:{}},validateSpec:at.validateSpec,style:at.style,styleSpec:at.styleSpec,objectElementValidators:{zoom:L6,value:et}}))}else ht=ht.concat(et({key:`${Lt}[0]`,value:Tt[0],valueSpec:{},validateSpec:at.validateSpec,style:at.style,styleSpec:at.styleSpec},Tt));return di(xo(Tt[1]))?ht.concat([new fe(`${Lt}[1]`,Tt[1],"expressions are not allowed in function stops.")]):ht.concat(at.validateSpec({key:`${Lt}[1]`,value:Tt[1],valueSpec:c,validateSpec:at.validateSpec,style:at.style,styleSpec:at.styleSpec}))}function et(at,ht){const Tt=It(at.value),Lt=Sn(at.value),Et=at.value!==null?at.value:ht;if(g){if(Tt!==g)return[new fe(at.key,Et,`${Tt} stop domain type must match previous stop domain type ${g}`)]}else g=Tt;if(Tt!=="number"&&Tt!=="string"&&Tt!=="boolean")return[new fe(at.key,Et,"stop domain value must be a number, string, or boolean")];if(Tt!=="number"&&p!=="categorical"){let $t=`number expected, ${Tt} found`;return G1(c)&&p===void 0&&($t+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new fe(at.key,Et,$t)]}return p!=="categorical"||Tt!=="number"||isFinite(Lt)&&Math.floor(Lt)===Lt?p!=="categorical"&&Tt==="number"&&x!==void 0&&Lt<x?[new fe(at.key,Et,"stop domain values must appear in ascending order")]:(x=Lt,p==="categorical"&&Lt in A?[new fe(at.key,Et,"stop domain values must be unique")]:(A[Lt]=!0,[])):[new fe(at.key,Et,`integer expected, found ${Lt}`)]}}function ca(h){const c=(h.expressionContext==="property"?w1:ho)(xo(h.value),h.valueSpec);if(c.result==="error")return c.value.map(g=>new fe(`${h.key}${g.key}`,h.value,g.message));const p=c.value.expression||c.value._styleExpression.expression;if(h.expressionContext==="property"&&h.propertyKey==="text-font"&&!p.outputDefined())return[new fe(h.key,h.value,`Invalid data expression for "${h.propertyKey}". Output values must be contained as literals within the expression.`)];if(h.expressionContext==="property"&&h.propertyType==="layout"&&!oa(p))return[new fe(h.key,h.value,'"feature-state" data expressions are not supported with layout properties.')];if(h.expressionContext==="filter"&&!oa(p))return[new fe(h.key,h.value,'"feature-state" data expressions are not supported with filters.')];if(h.expressionContext&&h.expressionContext.indexOf("cluster")===0){if(!U2(p,["zoom","feature-state"]))return[new fe(h.key,h.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(h.expressionContext==="cluster-initial"&&!ia(p))return[new fe(h.key,h.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function o1(h){const c=h.key,p=h.value,g=h.valueSpec,x=[];return Array.isArray(g.values)?g.values.indexOf(Sn(p))===-1&&x.push(new fe(c,p,`expected one of [${g.values.join(", ")}], ${JSON.stringify(p)} found`)):Object.keys(g.values).indexOf(Sn(p))===-1&&x.push(new fe(c,p,`expected one of [${Object.keys(g.values).join(", ")}], ${JSON.stringify(p)} found`)),x}function G2(h){return vs(xo(h.value))?ca(mi({},h,{expressionContext:"filter",valueSpec:{value:"boolean"}})):q3(h)}function q3(h){const c=h.value,p=h.key;if(It(c)!=="array")return[new fe(p,c,`array expected, ${It(c)} found`)];const g=h.styleSpec;let x,C=[];if(c.length<1)return[new fe(p,c,"filter array must have at least 1 element")];switch(C=C.concat(o1({key:`${p}[0]`,value:c[0],valueSpec:g.filter_operator,style:h.style,styleSpec:h.styleSpec})),Sn(c[0])){case"<":case"<=":case">":case">=":c.length>=2&&Sn(c[1])==="$type"&&C.push(new fe(p,c,`"$type" cannot be use with operator "${c[0]}"`));case"==":case"!=":c.length!==3&&C.push(new fe(p,c,`filter array for operator "${c[0]}" must have 3 elements`));case"in":case"!in":c.length>=2&&(x=It(c[1]),x!=="string"&&C.push(new fe(`${p}[1]`,c[1],`string expected, ${x} found`)));for(let A=2;A<c.length;A++)x=It(c[A]),Sn(c[1])==="$type"?C=C.concat(o1({key:`${p}[${A}]`,value:c[A],valueSpec:g.geometry_type,style:h.style,styleSpec:h.styleSpec})):x!=="string"&&x!=="number"&&x!=="boolean"&&C.push(new fe(`${p}[${A}]`,c[A],`string, number, or boolean expected, ${x} found`));break;case"any":case"all":case"none":for(let A=1;A<c.length;A++)C=C.concat(q3({key:`${p}[${A}]`,value:c[A],style:h.style,styleSpec:h.styleSpec}));break;case"has":case"!has":x=It(c[1]),c.length!==2?C.push(new fe(p,c,`filter array for "${c[0]}" operator must have 2 elements`)):x!=="string"&&C.push(new fe(`${p}[1]`,c[1],`string expected, ${x} found`))}return C}function $2(h,c){const p=h.key,g=h.validateSpec,x=h.style,C=h.styleSpec,A=h.value,k=h.objectKey,N=C[`${c}_${h.layerType}`];if(!N)return[];const U=k.match(/^(.*)-transition$/);if(c==="paint"&&U&&N[U[1]]&&N[U[1]].transition)return g({key:p,value:A,valueSpec:C.transition,style:x,styleSpec:C});const W=h.valueSpec||N[k];if(!W)return[new fe(p,A,`unknown property "${k}"`)];let K;if(It(A)==="string"&&G1(W)&&!W.tokens&&(K=/^{([^}]+)}$/.exec(A)))return[new fe(p,A,`"${k}" does not support interpolation syntax
|
|
@@ -1727,4 +1727,4 @@ DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
|
1727
1727
|
state: () => new MyClass()
|
|
1728
1728
|
Found in store "${G.$id}".`),w&&o&&r.hydrate&&r.hydrate(G.$state,w),d=!0,f=!0,G}function DUt(t,e,r){let n,i;const o=typeof e=="function";n=t,i=o?r:e;function s(a,u){const d=y.hasInjectionContext();if(a=(process.env.NODE_ENV==="test"&&kh&&kh._testing?null:a)||(d?y.inject(PUt,null):null),a&&Oy(a),process.env.NODE_ENV!=="production"&&!kh)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
1729
1729
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
1730
|
-
This will fail in production.`);a=kh,a._s.has(n)||(o?HH(n,e,i,a):DX(n,i,a),process.env.NODE_ENV!=="production"&&(s._pinia=a));const f=a._s.get(n);if(process.env.NODE_ENV!=="production"&&u){const T="__hot:"+n,Q=o?HH(T,e,i,a,!0):DX(T,Xs({},i),a,!0);u._hotUpdate(Q),delete a.state.value[T],a._s.delete(T)}if(process.env.NODE_ENV!=="production"&&EH){const T=y.getCurrentInstance();if(T&&T.proxy&&!u){const Q=T.proxy,_="_pStores"in Q?Q._pStores:Q._pStores={};_[n]=f}}return f}return s.$id=n,s}function BUt(t,e){return Array.isArray(e)?e.reduce((r,n)=>(r[n]=function(){return t(this.$pinia)[n]},r),{}):Object.keys(e).reduce((r,n)=>(r[n]=function(){const i=t(this.$pinia),o=e[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const FUt=DUt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),jUt=t=>{let e={lng:0,lat:0},r;return t.type==="Polygon"?r=t.coordinates[0]:r=t.coordinates,t.type!=="Point"?(r.map(n=>{e.lng+=parseFloat(n[0]),e.lat+=parseFloat(n[1])}),e.lng=e.lng/r.length,e.lat=e.lat/r.length):(e.lng+=parseFloat(r[0]),e.lat+=parseFloat(r[1])),e},BX=(t,e)=>{const r=[];let n=t.organs?t.organs:t.ftus;const i=n?n.filter((o,s)=>n.findIndex(a=>a.label===o.label)===s):void 0;return i&&i.forEach(o=>{const s={label:o.label,models:o.models,key:`${e}.${o.label}`},a=BX(o,s.key);a.length>0&&(s.children=a),r.push(s)}),r},zUt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},UUt={name:"FlatmapVuer",components:{Button:lk,Col:qc,Loading:T2t,Radio:wk,Icon:p1,RadioGroup:xk,Row:Wc,Select:Jd,Dialog:Cat,MapSvgIcon:HC.MapSvgIcon,MapSvgSpriteColor:HC.MapSvgSpriteColor,Tooltip:u_.Tooltip,TreeControls:u_.TreeControls,SelectionsGroup:Rk,SvgLegends:Nk,ElIconWarningFilled:DA,ElIconArrowDown:C_,ElIconArrowLeft:RA,DrawToolbar:u_.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(t){return{annotator:y.markRaw(new kUt(`${t.flatmapAPI}annotator`))}},methods:{initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(this.closeTooltip(),this.annotationEntry={...this.drawnCreatedEvent.feature,resourceId:this.serverURL},this.rollbackAnnotationEvent(),this.initialiseDrawing())},connectedFeatureTooltip:function(t){if(this.mapImp)if(t){const e=Number(t);let r={feature:{}};if(e){const n=this.mapImp.featureProperties(e);r.feature=n}else{const n=this.existDrawnFeatures.find(i=>i.id===t.replace(" ",""));r.feature.feature=n}this.checkAndCreatePopups(r)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(t,e){if(this.closeTooltip(),this.doubleClickedFeature=!1,this.connectionEntry={},t==="mode")this.changeAnnotationDrawMode({mode:"simple_select"}),this.activeDrawMode=e,Object.keys(this.annotationEntry).length>0&&!this.featureAnnotationSubmitted&&this.rollbackAnnotationEvent();else if(t==="tool"){if(e){const r=e.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${r}`}),this.initialiseDrawing()}else this.changeAnnotationDrawMode({mode:"simple_select"}),this.cancelDrawnFeature();this.activeDrawTool=e}},annotationDrawModeEvent:function(t){this.activeDrawMode==="Edit"&&this.doubleClickedFeature&&(t.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:t.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1),this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[t.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const t=Object.values(this.connectionEntry),e={type:"connectivity",source:t[0],target:t[t.length-1],intermediates:t.filter((r,n)=>n!==0&&n!==t.length-1)};this.annotationEntry.body=e}},changeAnnotationDrawMode:function(t){this.mapImp&&this.mapImp.changeAnnotationDrawMode(t)},clearAnnotationFeature:function(){this.mapImp&&this.existDrawnFeatures.length>0&&this.mapImp.clearAnnotationFeature()},modifyAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&(this.mapImp.rollbackAnnotationEvent(this.annotationEntry),this.annotationEntry={})},commitAnnotationEvent:function(t){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&t&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"?(this.closeTooltip(),this.annotationEntry={}):this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(t=void 0,e=void 0){let r=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,t,e);return"resource"in r&&(r=r.itemIds),r},setFeatureAnnotated:async function(){if(this.mapImp){const t=await this.fetchAnnotatedItemIds();for(const e of t)this.mapImp.setFeatureAnnotated(e)}},fetchDrawnFeatures:async function(t,e){const r=await this.fetchAnnotatedItemIds(t,e);let n=await this.annotator.drawnFeatures(this.userToken,this.serverURL,r);return"resource"in n&&(n=n.features),this.drawnType!=="All tools"&&(n=n.filter(i=>i.geometry.type===this.drawnType)),n},addAnnotationFeature:async function(){if(this.mapImp&&(this.featureAnnotationSubmitted||this.clearAnnotationFeature(),this.drawnType!=="None")){this.featureAnnotationSubmitted||(this.loading=!0);const t=this.annotatedType==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",e=this.annotatedType==="Anyone"?void 0:this.annotatedType==="Me",r=await this.fetchDrawnFeatures(t,e);if(this.existDrawnFeatures=r,this.loading=!1,!this.featureAnnotationSubmitted)for(const n of r)this.mapImp.addAnnotationFeature(n)}},showAnnotator:function(t){this.mapImp&&(this.mapImp.showAnnotator(t),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(t){this.drawnType=t,this.mapImp&&(this.addAnnotationFeature(),this.initialiseDrawing())},setAnnotatedType:function(t){this.annotatedType=t,this.mapImp&&this.addAnnotationFeature()},setFlightPath3D:function(t){this.flightPath3DRadio=t,this.mapImp&&this.mapImp.enableFlightPaths(t)},viewLatestMap:function(){let t=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(t="PATO:0000384");const e={entry:this.entry,biologicalSex:t,viewport:this.mapImp.getState()};this.$emit("view-latest-map",e)},backgroundChangeCallback:function(t){this.currentBackground=t,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(t){if(this.systems.length=0,t&&t.length>0){const e={label:"All",key:"All",children:[]};t.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=BX(r,n.key);i.length>0&&(n.children=i),e.children.push(n)}),this.systems.push(e)}},processTaxon:function(t,e){this.taxonConnectivity.length=0,e.forEach(r=>{Dk(t,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(t){this.colourRadio=t,this.mapImp&&this.mapImp.setColour({colour:t,outline:this.outlinesRadio})},setOutlines:function(t){this.outlineRadio=t,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:t})},resetView:function(){this.mapImp&&(this.mapImp.resetMap(),this.$refs.centrelinesSelection&&this.$refs.centrelinesSelection.reset(),this.$refs.skcanSelection&&this.$refs.skcanSelection.reset(),this.$refs.layersSelection&&this.$refs.layersSelection.reset(),this.$refs.systemsSelection&&this.$refs.pathwaysSelection.reset(),this.$refs.pathwaysSelection&&this.$refs.pathwaysSelection.reset())},zoomIn:function(){this.mapImp&&this.mapImp.zoomIn()},zoomOut:function(){this.mapImp&&this.mapImp.zoomOut()},centreLinesSelected:function(t){this.mapImp&&this.mapImp.enableCentrelines(t.value)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},sckanSelected:function(t){this.mapImp&&this.mapImp.enableSckanPath(t.key,t.value)},checkAllSCKAN:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableSckanPath(e,t.value))},highlightConnectedPaths:async function(t){var e,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(t)].map(d=>this.mapImp.featureProperties(d)),o=await this.flatmapQueries.queryForConnectivity(t),s=(r=(e=o==null?void 0:o.ids)==null?void 0:e.dendrites)==null?void 0:r.flat().flat(),a=[],u=!1;i.forEach(d=>{this.mapImp.nodePathModels(d.featureId).forEach(f=>{u=!0,this.mapImp.pathModelNodes(f).forEach(Q=>{let _=this.mapImp.featureProperties([Q]);if(s.includes(_.models)){u=!1;return}}),u&&a.push(f)})}),this.mapImp.zoomToFeatures(a,{noZoomIn:!0})}},resetMapFilter:function(){const t=this.mapFilters.alert;let e;t.with?t.without||(e={HAS:"alert"}):t.without?e={NOT:{HAS:"alert"}}:e={AND:[{NOT:{HAS:"alert"}},{HAS:"alert"}]},e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter()},alertMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e;t.key==="alert"?e={HAS:"alert"}:t.key==="withoutAlert"&&(e={NOT:{HAS:"alert"}}),this.mapImp.setVisibilityFilter(e)}else this.resetMapFilter()},alertSelected:function(t){this.mapImp&&(t.key==="alert"?t.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:t.key==="withoutAlert"&&(t.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(t){this.mapImp&&(t.value?(this.mapFilters.alert.without=!0,this.mapFilters.alert.with=!0):(this.mapFilters.alert.without=!1,this.mapFilters.alert.with=!1),this.resetMapFilter())},systemSelected:function(t){this.mapImp&&this.mapImp.enableSystem(t.key,t.value)},checkAllSystems:function(t){this.mapImp&&this.systems[0].children.forEach(e=>this.mapImp.enableSystem(e.label,t))},ftuSelected:function(t){this.searchAndShowResult(t,!0)},layersSelected:function(t){this.mapImp&&this.mapImp.enableLayer(t.key,t.value)},checkAllLayers:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableLayer(e,t.value))},taxonsSelected:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.key,t.value)},taxonMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e=this.mapImp.taxonFeatureIds(t.key);this.mapImp.enableConnectivityByTaxonIds(t.key,t.value),this.mapImp.zoomToGeoJSONFeatures(e,{noZoomIn:!0})}else this.mapImp.unselectGeoJSONFeatures(),t.selections.forEach(e=>{let r=t.checked.includes(e.taxon);this.mapImp.enableConnectivityByTaxonIds(e.taxon,r)})},checkAllTaxons:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableConnectivityByTaxonIds(e,t.value))},pathwaysSelected:function(t){this.mapImp&&this.mapImp.enablePath(t.key,t.value)},checkAllPathways:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enablePath(e,t.value))},enablePanZoomEvents:function(t){this.mapImp.enablePanZoomEvents(t)},annotationEventCallback:function(t,e){if(e.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent();else if(e.type==="modeChanged")e.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);else if(e.type==="selectionChanged"){if(this.selectedDrawnFeature=e.feature.features.length===0?void 0:e.feature.features[0],t.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool&&(this.connectionEntry={},this.selectedDrawnFeature)){const r=this.existDrawnFeatures.find(n=>n.id===this.selectedDrawnFeature.id);r&&r.connection&&(this.connectionEntry=r.connection),this.annotationDrawModeEvent(t)}}else{if(e.type==="created"||e.type==="updated"){e.type==="updated"&&e.feature.action&&(e.positionUpdated=e.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(e.feature);t.feature.feature=r}e.type==="created"?this.drawnCreatedEvent=t:this.checkAndCreatePopups(t)}},eventCallback:function(){return(t,e,...r)=>{if(t==="annotation"){const n={feature:e,userData:r,eventType:t};this.annotationEventCallback(n,e)}else if(t!=="pan-zoom"){const n=e.label,i=[e.models],o=this.entry,s=this.biologicalSex;let a;e.taxons&&(typeof e.taxons!="object"?a=JSON.parse(e.taxons):a=e.taxons);const u={dataset:e.dataset,biologicalSex:s,taxonomy:o,resource:i,label:n,feature:e,userData:r,eventType:t,provenanceTaxonomy:a};if(t==="click"){if(this.featuresAlert=e.alert,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([e.models]);else if(this.currentActive=e.models?e.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const d=e.featureId||this.existDrawnFeatures.find(f=>f.id===e.id);if(this.activeDrawTool==="LineString"&&d){const f=e.featureId?e.featureId:e.id,T=e.label?e.label:`Feature ${e.id}`;this.connectionEntry[` ${f}`]=Object.assign({label:T},Object.fromEntries(Object.entries(e).filter(([Q])=>["featureId","models"].includes(Q)).map(([Q,_])=>[Q==="featureId"?"id":Q,_])))}}}else t==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=e.models?e.models:"");e&&e.type!=="marker"&&t==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(u),this.$emit("resource-selected",u)}else this.$emit("pan-zoom-callback",e)}},changeViewingMode:function(t){t&&(this.viewingMode=t),this.closeTooltip()},checkAndCreatePopups:async function(t){if(this.viewingMode==="Annotation")t.feature?(this.annotationEntry={...t.feature,resourceId:this.serverURL},t.feature.featureId&&t.feature.models?this.displayTooltip(t.feature.models):t.feature.feature&&(this.activeDrawTool||this.activeDrawMode||Object.keys(this.connectionEntry).length>0?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=t.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(t.feature.feature.id,jUt(t.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let e=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(t);(e[0]||e[1]||t.feature.hyperlinks&&t.feature.hyperlinks.length>0)&&(this.resourceForTooltip=t.resource[0],t.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(t))}},popUpCssHacks:function(){const t=document.querySelector(".flatmap-tooltip-popup"),e=document.querySelector(".maplibregl-popup-close-button");t&&(t.style.display="none"),e.style.display="block",this.$refs.tooltip.$el.style.display="flex",e.onclick=()=>{this.$emit("connectivity-info-close"),t&&(t.style.display="block")}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(t=>{t.style.display="none"})},createTooltipFromNeuronCuration:async function(t){this.tooltipEntry=await this.flatmapQueries.createTooltipData(t),this.displayTooltip(t.resource[0])},showPopup:function(t,e,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(t,e,n))},showMarkerPopup:function(t,e,r){this.mapImp&&this.mapImp.showMarkerPopup(t,e,r)},closeMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(t.classList.add("enlarge"),t.classList.remove("shrink")):(t.classList.add("shrink"),t.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");t&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),t.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(t){const e=this.hoverVisibilities.length,r=e-1,n=this.hoverVisibilities[this.helpModeActiveIndex];if(n){const i=n==null?void 0:n.refs,o=n==null?void 0:n.ref,s=this.$refs[i||o];if(s){const{parentElement:a,nextElementSibling:u}=s.$el,d=f=>f&&(f.classList.contains("pathway-container")||f.classList.contains("pathway-location"));(d(a)||d(u))&&(this.drawerOpen=!0)}else this.helpModeActiveIndex+=1}t||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=r),t&&this.helpModeActiveIndex>=r&&this.$emit("help-mode-last-item",!0),t&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(i=>{i.value=!0})):t&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.closeFlatmapHelpPopup())},showTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!0,this.$emit("shown-tooltip")},e))},hideTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!1},e))},displayTooltip:function(t,e=void 0){let r,n={className:"flatmapvuer-popover"};e?(r=t,n.annotationFeatureGeometry=e):(r=this.mapImp.modelFeatureIds(t)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&(this.featuresAlert&&(this.tooltipEntry.featuresAlert=this.featuresAlert),this.$emit("connectivity-info-open",this.tooltipEntry)),!this.disableUI&&(this.viewingMode==="Annotation"||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar&&this.hasTooltipEntry())&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:t,destinations:e,origins:r,provenanceTaxonomy:n,provenanceTaxonomyLabel:i}=this.tooltipEntry;return!!(t!=null&&t.length||e!=null&&e.length||r!=null&&r.length||n!=null&&n.length||i!=null&&i.length)},moveMap:function(t,e={}){if(this.mapImp){const{offsetX:r=0,offsetY:n=0,zoom:i=4}=e,o=this.mapImp._map,s=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(t,{noZoomIn:!0}),this.showPathwaysDrawer(!1),s!=null&&s.length&&setTimeout(()=>{o.fitBounds(s,{offset:[r,n],zoom:i,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let t=this.mapImp.modelFeatureIds("UBERON:0000948");t&&t.length>0&&(this.mapImp.showPopup(t[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"}),this.$emit("shown-map-tooltip"))}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(t=>{t.click()})},getLabels:function(){let t=[];if(this.mapImp){let e=this.mapImp.annotations;for(let r of e.values())r.label&&t.push(r.label);return Array.from(new Set(t))}},getState:function(){if(this.mapImp){let t={entry:this.entry,viewport:this.mapImp.getState()};const e=this.mapImp.getIdentifier();return this.biologicalSex?t.biologicalSex=this.biologicalSex:e&&e.biologicalSex&&(t.biologicalSex=e.biologicalSex),e&&e.uuid&&(t.uuid=e.uuid),t}},setState:function(t){t&&(this.mapImp&&t.entry&&this.entry==t.entry&&(!t.biologicalSex||t.biologicalSex===this.biologicalSex)?t.viewport&&this.mapImp.setState(t.viewport):this.createFlatmap(t),this.setStateRequired=!1)},restoreMapState:function(t){t&&(t.viewport&&this.mapImp.setState(t.viewport),t.searchTerm&&this.searchAndShowResult(t.searchTerm,!0))},setFlightPathInfo:function(t){(t===1.6||t>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(t){if(!this.mapImp&&!this.loading){this.loading=!0;let e=!1;this.displayMinimap&&(e={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),t?t.uuid?r={uuid:t.uuid}:t.entry&&(r.taxon=t.entry,t.biologicalSex?r.biologicalSex=t.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:e}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o),this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(t)})}else t&&(this._stateToBeSet={viewport:t.viewport,searchTerm:t.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const t=this.$refs.display;if(t){const e=getComputedStyle(t),r=parseInt(e.paddingTop)+parseInt(e.paddingBottom),n=t.clientHeight-r;this.pathwaysMaxHeight=n-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&(this.mapImp.resize(),this.showMinimap(this.displayMinimap),this.mapImp._minimap&&this.mapImp._minimap._miniMap.resize())}catch{console.error("Map resize error")}},onFlatmapReady:function(){var t,e;this.sensor=y.markRaw(new I2t(this.$refs.display,this.mapResize)),console.log(this.mapImp.options),((t=this.mapImp.options)==null?void 0:t.style)==="functional"?this.isFC=!0:((e=this.mapImp.options)==null?void 0:e.style)==="centreline"&&(this.isCentreLine=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.isCentreLine||this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!this.isCentreLine,this.mapResize(),this.handleMapClick(),this.$emit("ready",this)},handleMapClick:function(){const t=this.mapImp._map;t&&t.on("click",e=>{this.tooltipEntry.featureId&&this.$emit("connectivity-info-close")})},showMinimap:function(t){this.mapImp&&this.mapImp.showMinimap(t)},showPathwaysDrawer:function(t){this.drawerOpen=t},searchAndShowResult:function(t,e){if(this.mapImp){if(t===void 0||t==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(t);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),e&&r.results[0].featureId&&r.results[0].text){const n=this.mapImp.annotation(r.results[0].featureId);this.mapImp.showPopup(r.results[0].featureId,n.label,{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(t){return this.mapImp?this.mapImp.search(t):[]}},props:{entry:{type:String,required:!0},uuid:String,biologicalSex:{type:String,default:""},minZoom:{type:Number,default:4},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},renderAtMounted:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},showStarInLegend:{type:Boolean,default:!1},isLegacy:{type:Boolean,default:!1},displayLatestChanges:{type:Boolean,default:!1},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,$annotator:this.annotator,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{sensor:null,mapManager:void 0,flatmapQueries:void 0,annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:y.markRaw([]),hoverVisibilities:[{value:!1,ref:"markerPopover"},{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"polygonPopover"},{value:!1,refs:"toolbarPopover",ref:"connectionPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:O2t,isFC:!1,isCentreLine:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:C2t,tooltipEntry:zUt(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover Neuron connections by selecting a neuron and viewing its associated network connections",Annotation:"View internal identifiers of features"},drawnType:"All tools",drawnTypes:["All tools","Point","LineString","Polygon","None"],annotatedType:"Anyone",annotatedTypes:["Anyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,userInformation:void 0,activeDrawMode:void 0,activeDrawTool:void 0,featureAnnotationSubmitted:!1,drawnCreatedEvent:{},connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:y.markRaw({alert:{with:!0,without:!0}})}},computed:{...BUt(FUt,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(t,e){t!==e&&this.setHelpMode(t)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},state:{handler:function(t,e){t!==e&&(this.mapManager?this.setState(t):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(t){t==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&(this.showAnnotator(!0),this.userInformation=e,this.setFeatureAnnotated(),this.existDrawnFeatures.length===0&&this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(t){t&&this.closeTooltip()}},mounted:function(){this.openMapRef=y.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=y.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=y.markRaw(new bH(this.flatmapAPI)),this.flatmapQueries=y.markRaw(new A2t),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},Ia=t=>(y.pushScopeId("data-v-ae9562fe"),t=t(),y.popScopeId(),t),GUt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},$Ut={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},ZUt={style:{height:"100%",width:"100%"},ref:"display"},WUt={class:"beta-popovers"},qUt=Ia(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),XUt=Ia(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),KUt=Ia(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),YUt=Ia(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),JUt=Ia(()=>y.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),tGt={key:1,class:"warning-text"},eGt=Ia(()=>y.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),rGt=Ia(()=>y.createElementVNode("b",null,"Neuron Connection mode",-1)),nGt=Ia(()=>y.createElementVNode("p",null," You can now view the network of neurons connected to a selected neuron. This mode is located in the settings at the bottom right. Once discovery mode is on, click on a neuron to see its connections. ",-1)),iGt=Ia(()=>y.createElementVNode("b",null,"Now can display up to 6 panes",-1)),oGt=Ia(()=>y.createElementVNode("p",null," You can now display up to 6 panes in the flatmap. This allows you to compare between different datasets and/or different views of the same dataset. ",-1)),sGt={class:"bottom-right-control"},aGt=Ia(()=>y.createElementVNode("div",null,[y.createTextVNode(" Fit to "),y.createElementVNode("br"),y.createTextVNode(" window ")],-1)),lGt=["innerHTML"],cGt=["innerHTML"],uGt={style:{"margin-bottom":"2px"}},hGt={key:0,class:"viewing-mode-title"},dGt=["onClick"],pGt=["onClick"];function fGt(t,e,r,n,i,o){const s=y.resolveComponent("map-svg-sprite-color"),a=DA,u=p1,d=tp,f=C_,T=y.resolveComponent("DrawToolbar"),Q=y.resolveComponent("map-svg-icon"),_=Nk,w=y.resolveComponent("tree-controls"),b=Rk,S=RA,E=lk,O=Wc,I=qc,D=pv,j=Jd,$=wk,G=xk,tt=y.resolveComponent("Tooltip"),it=Ik,lt=Tv;return y.withDirectives((y.openBlock(),y.createElementBlock("div",GUt,[y.createVNode(s),y.createElementVNode("div",$Ut,[y.createElementVNode("div",ZUt,null,512),y.withDirectives(y.createElementVNode("div",WUt,[y.createElementVNode("div",null,[y.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[7].value,ref:"warningPopover"},{reference:y.withCtx(()=>[r.displayWarning?(y.openBlock(),y.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:e[7]||(e[7]=rt=>o.showTooltip(7)),onMouseout:e[8]||(e[8]=rt=>o.hideTooltip(7))},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(a)]),_:1}),r.isLegacy?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[JUt,y.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(y.openBlock(),y.createElementBlock("span",tGt,"Beta"))],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[r.isLegacy?(y.openBlock(),y.createElementBlock("p",{key:0,onMouseover:e[0]||(e[0]=rt=>o.showTooltip(7)),onMouseout:e[1]||(e[1]=rt=>o.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):t.isFC?(y.openBlock(),y.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=rt=>o.showTooltip(7)),onMouseout:e[3]||(e[3]=rt=>o.hideTooltip(7))},[y.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),qUt,y.createTextVNode(" models available in "),XUt,y.createTextVNode(". ")],32)):(y.openBlock(),y.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=rt=>o.showTooltip(7)),onMouseout:e[5]||(e[5]=rt=>o.hideTooltip(7))},[y.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),KUt,y.createTextVNode(" models available in "),YUt,y.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(y.openBlock(),y.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:y.withCtx(()=>[r.displayLatestChanges?(y.openBlock(),y.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:e[9]||(e[9]=rt=>o.showTooltip(8)),onMouseout:e[10]||(e[10]=rt=>o.hideTooltip(8))},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(a)]),_:1}),eGt],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[rGt,nGt,iGt,oGt]),_:1},8,["visible"])):y.createCommentVNode("",!0)],512),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(u,{class:y.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:y.withCtx(()=>[y.createVNode(f)]),_:1},8,["class","onClick"]),[[y.vShow,t.minimapResizeShow]]),t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI?(y.openBlock(),y.createBlock(T,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:t.toolbarOptions,drawnType:t.drawnType,activeDrawTool:t.activeDrawTool,activeDrawMode:t.activeDrawMode,newlyDrawnEntry:t.drawnCreatedEvent,connectionEntry:t.connectionEntry,hoverVisibilities:t.hoverVisibilities,onClickToolbar:o.toolbarEvent,onFeatureTooltip:o.connectedFeatureTooltip,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","drawnType","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("div",sGt,[y.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{class:"icon-button-container",onClick:e[11]||(e[11]=rt=>o.zoomIn()),onMouseover:e[12]||(e[12]=rt=>o.showTooltip(1)),onMouseout:e[13]||(e[13]=rt=>o.hideTooltip(1))},[y.createVNode(Q,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),y.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{class:"icon-button-container",onClick:e[14]||(e[14]=rt=>o.zoomOut()),onMouseover:e[15]||(e[15]=rt=>o.showTooltip(2)),onMouseout:e[16]||(e[16]=rt=>o.hideTooltip(2))},[y.createVNode(Q,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),y.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{class:"icon-button-container",onClick:e[17]||(e[17]=rt=>o.resetView()),onMouseover:e[18]||(e[18]=rt=>o.showTooltip(3)),onMouseout:e[19]||(e[19]=rt=>o.hideTooltip(3))},[y.createVNode(Q,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:y.withCtx(()=>[aGt]),_:1},8,["visible"])],512),[[y.vShow,!r.disableUI]]),y.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:t.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.withDirectives((y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:y.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?y.createCommentVNode("",!0):(y.openBlock(),y.createBlock(_,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(y.openBlock(),y.createBlock(d,{key:1,content:"Location of the featured dataset",placement:"right",teleported:!0,trigger:"manual",width:"max-content",offset:-10,"popper-class":"flatmap-popper flatmap-teleport-popper",visible:t.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"yellow-star-legend",innerHTML:t.yellowstar,onMouseover:e[20]||(e[20]=rt=>o.showTooltip(9)),onMouseout:e[21]||(e[21]=rt=>o.hideTooltip(9))},null,40,lGt),[[it,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):y.createCommentVNode("",!0),y.createVNode(d,{content:"Find these markers for data. The number inside the markers is the number of datasets available for each marker.",placement:"right",teleported:!1,width:"200",trigger:"manual","popper-class":"flatmap-popper flatmap-marker-popper",visible:t.hoverVisibilities[0].value,ref:"markerPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,cGt),[[y.vShow,t.hoverVisibilities[0].value],[it,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(y.openBlock(),y.createBlock(w,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:t.systems,active:t.currentActive,hover:t.currentHover,onCheckChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):y.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(y.openBlock(),y.createBlock(b,{title:"Alert",labelKey:"label",identifierKey:"key",selections:t.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(y.openBlock(),y.createBlock(b,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:t.pathways,onChanged:o.pathwaysSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),t.taxonConnectivity&&t.taxonConnectivity.length>0?(y.openBlock(),y.createBlock(b,{title:"Studied in",labelKey:"label",identifierKey:"taxon",helpMessage:"Evidence exists that this set of neuron populations have been studied in the given species.",selections:t.taxonConnectivity,onChanged:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),!(t.isCentreLine||t.isFC)&&t.centreLines&&t.centreLines.length>0?(y.openBlock(),y.createBlock(b,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:t.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):y.createCommentVNode("",!0)],6)),[[it,void 0,"checkBoxPopover"]]),y.createElementVNode("div",{onClick:e[22]||(e[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:y.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(S)]),_:1})],2)],2),[[y.vShow,!(r.disableUI||t.isCentreLine)]])]),_:1},8,["visible"]),t.openMapRef?(y.openBlock(),y.createBlock(d,{key:1,ref:"open-map-popover","virtual-ref":t.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(r.openMapOptions,rt=>(y.openBlock(),y.createBlock(O,{key:rt.key},{default:y.withCtx(()=>[y.createVNode(E,{type:"primary",plain:"",onClick:gt=>t.$emit("open-map",rt.key)},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):y.createCommentVNode("",!0),y.createVNode(d,{ref:"backgroundPopover","virtual-ref":t.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Viewing Mode")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createElementVNode("div",uGt,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.viewingModes,(rt,gt,Pt)=>(y.openBlock(),y.createElementBlock(y.Fragment,{key:gt},[gt===t.viewingMode?(y.openBlock(),y.createElementBlock("span",hGt,[y.createElementVNode("b",null,y.toDisplayString(gt),1)])):(y.openBlock(),y.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Gt=>o.changeViewingMode(gt)},y.toDisplayString(gt),9,dGt))],64))),128))]),y.createVNode(O,{class:"viewing-mode-description"},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(t.viewingModes[t.viewingMode]),1)]),_:1})]),_:1}),t.viewingMode==="Annotation"&&t.userInformation?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Drawn By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(j,{teleported:!1,modelValue:t.drawnType,"onUpdate:modelValue":e[23]||(e[23]=rt=>t.drawnType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setDrawnType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.drawnTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(I,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Annotated By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(j,{teleported:!1,modelValue:t.annotatedType,"onUpdate:modelValue":e[24]||(e[24]=rt=>t.annotatedType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setAnnotatedType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.annotatedTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(I,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:1,class:"backgroundSpacer"})):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:2,class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Flight path display")]),_:1})):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:3,class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(G,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[25]||(e[25]=rt=>t.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:y.withCtx(()=>[y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("2D")]),_:1}),y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):y.createCommentVNode("",!0),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Organs display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(G,{modelValue:t.colourRadio,"onUpdate:modelValue":e[26]||(e[26]=rt=>t.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:y.withCtx(()=>[y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Colour")]),_:1}),y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Outlines display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(G,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[27]||(e[27]=rt=>t.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:y.withCtx(()=>[y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Show")]),_:1}),y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Change background")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.availableBackground,rt=>(y.openBlock(),y.createElementBlock("div",{key:rt,class:y.normalizeClass(["backgroundChoice",rt,rt==t.currentBackground?"active":""]),onClick:gt=>o.backgroundChangeCallback(rt)},null,10,pGt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{visible:t.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:y.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(y.openBlock(),y.createElementBlock("div",{key:0,ref:"openMapRef",class:"icon-button-container",onMouseover:e[28]||(e[28]=rt=>o.showTooltip(4)),onMouseout:e[29]||(e[29]=rt=>o.hideTooltip(4))},[y.createVNode(Q,{icon:"openMap",class:"icon-button open-map-button"})],544)):y.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{ref:"backgroundIconRef",class:"icon-button-container",onMouseover:e[30]||(e[30]=rt=>o.showTooltip(5)),onMouseout:e[31]||(e[31]=rt=>o.hideTooltip(5))},[y.createVNode(Q,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})],2),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(tt,{ref:"tooltip",class:"tooltip",annotationEntry:t.annotationEntry,tooltipEntry:t.tooltipEntry,annotationDisplay:t.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"]),[[y.vShow,t.tooltipDisplay]])])])),[[lt,t.loading]])}const CH=np(UUt,[["render",fGt],["__scopeId","data-v-ae9562fe"]]);function TGt(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(i){i(r)}),(n=t.get("*"))&&n.slice().map(function(i){i(e,r)})}}}const FX=new TGt,jX={"NCBITaxon:10114":"01fedbf9-d783-509c-a10c-827941ab13da","NCBITaxon:9823":"a336ac04-24db-561f-a25f-1c994fe17410","NCBITaxon:9606":"42ed6323-f645-5fbe-bada-9581819cf689","NCBITaxon:10090":"25285fab-48a0-5620-a6a0-f9a0374837d5","NCBITaxon:9685":"73060497-46a6-52bf-b975-cac511c127cb"},QGt={name:"MultiFlatmapVuer",components:{Col:qc,Row:Wc,Option:pv,Select:Jd,Popover:tp,FlatmapVuer:CH},mounted:function(){this.initialise(),FX.on("onActionClick",t=>{this.resourceSelected(t)}),FX.on("open-pubmed-url",t=>{this.$emit("open-pubmed-url",t)})},methods:{initialise:function(){return new Promise(t=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(e=>e.json()).then(e=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&e.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=this.availableSpecies[n];else for(let o=0;o<e.length;o++)if(this.availableSpecies[n].taxo===e[o].taxon)if(this.availableSpecies[n].biologicalSex){if(e[o].biologicalSex&&e[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=this.availableSpecies[n];break}}else{this.speciesList[n]=this.availableSpecies[n];break}});let r=this.initial;if(this.state){const n=this.state.state;(!n||!n.uuid&&!n.entry)&&this.state.species?r=this.state.species:r=void 0}r&&(r&&this.speciesList[r]!==void 0?this.activeSpecies=r:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this.initialised=!0,t(),this.resolveList.forEach(n=>{n()})})):this.initialised?t():this.resolveList.push(t)})},resourceSelected:function(t){this.$emit("resource-selected",t)},FlatmapReady:function(t){this.$emit("ready",t)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(t){this.$emit("pan-zoom-callback",t)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(t){this.$emit("connectivity-info-open",t)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},showPopup:function(t,e,r){this.getCurrentFlatmap().showPopup(t,e,r)},showMarkerPopup:function(t,e,r){this.getCurrentFlatmap().showMarkerPopup(t,e,r)},setSpecies:function(t,e,r){if(this.$refs&&t in this.$refs)this.activeSpecies=t,this.$refs[this.activeSpecies][0].createFlatmap(e),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(t,e,n)})}},viewLatestMap:function(t){const e=Object.keys(this.speciesList);for(let r=0;r<e.length;r++){const n=this.speciesList[e[r]];if(!n.isLegacy&&n.taxo===t.entry&&n.biologicalSex===t.biologicalSex){this.setSpecies(e[r],t,0);return}}},createLegacyEntry:function(t,e,r){if(r&&e){let n="Legacy";return t.species&&(t.species.slice(0,6)==="Legacy"?n=t.species:n=n+` ${t.species}`),this.speciesList[n]={taxo:e,isLegacy:!0,displayWarning:!0},{species:n,state:{entry:e,uuid:r,viewport:t.state.viewport,searchTerm:t.state.searchTerm}}}},updateState:function(t){return new Promise(e=>{if(t&&t.state){const r=t.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new bH(this.flatmapAPI),i={taxon:r.entry};r.biologicalSex&&(i.biologicalSex=r.biologicalSex),n.findMap_(i).then(o=>{if(o.uuid!==r.uuid)return this.createLegacyEntry(t,r.entry,r.uuid)}).then(o=>{e(o||t)}).catch(()=>{e(t)})})}else if(r.entry){const n=r.entry in jX?jX[r.entry]:void 0,i=this.createLegacyEntry(t,r.entry,n);e(i||t)}}e(t)})},getState:function(){let t={species:this.activeSpecies,state:void 0},e=this.getCurrentFlatmap();return t.state=e.getState(),t},setState:function(t){t&&this.updateState(t).then(e=>{this.initialise().then(()=>{e.species&&e.species!==this.activeSpecies?this.setSpecies(e.species,e.state,5):e.state&&this.getCurrentFlatmap().setState(e.state)})})},activateTooltipByIndex:function(t){return t===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(t){t&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(t){this.getCurrentFlatmap().changeViewingMode(t)}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:4},renderAtMounted:{type:Boolean,default:!1},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},displayMinimap:{type:Boolean,default:!1},showStarInLegend:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array},availableSpecies:{type:Object,default:function(){return{"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayWarning:!0}}}},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:y.markRaw([]),initialised:!1}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},mGt=t=>(y.pushScopeId("data-v-5364de02"),t=t(),y.popScopeId(),t),gGt={class:"multi-container",ref:"multiContainer"},yGt={key:0,style:{position:"absolute","z-index":"10"}},_Gt=mGt(()=>y.createElementVNode("div",{class:"species-display-text"},"Species",-1)),vGt={class:"select-box-icon"};function bGt(t,e,r,n,i,o){const s=pv,a=Jd,u=tp,d=CH;return y.openBlock(),y.createElementBlock("div",gGt,[r.disableUI?y.createCommentVNode("",!0):(y.openBlock(),y.createElementBlock("div",yGt,[_Gt,y.createVNode(u,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:o.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:y.withCtx(()=>[y.createVNode(a,{id:"flatmap-select",teleported:!1,modelValue:t.activeSpecies,"onUpdate:modelValue":e[0]||(e[0]=f=>t.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.speciesList,(f,T)=>(y.openBlock(),y.createBlock(s,{key:T,label:T,value:T},{default:y.withCtx(()=>[y.createElementVNode("span",vGt,[y.createElementVNode("i",{class:y.normalizeClass(f.iconClass)},null,2)]),y.createTextVNode(" "+y.toDisplayString(T),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.speciesList,(f,T)=>y.withDirectives((y.openBlock(),y.createBlock(d,{key:T,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:T,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,connectivityInfoSidebar:r.connectivityInfoSidebar,onConnectivityInfoOpen:o.onConnectivityInfoOpen,onConnectivityInfoClose:o.onConnectivityInfoClose,onOpenMap:e[1]||(e[1]=Q=>t.$emit("open-map",Q)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:t.activeSpecies==T&&r.helpMode,helpModeActiveItem:r.helpModeActiveItem,helpModeDialog:r.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:o.onHelpModeLastItem,onShownTooltip:o.onTooltipShown,onShownMapTooltip:o.onMapTooltipShown,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[y.vShow,t.activeSpecies==T]])),128))],512)}const LGt=np(QGt,[["render",bGt],["__scopeId","data-v-5364de02"]]);To.FlatmapVuer=CH,To.MultiFlatmapVuer=LGt,Object.defineProperty(To,Symbol.toStringTag,{value:"Module"})});
|
|
1730
|
+
This will fail in production.`);a=kh,a._s.has(n)||(o?HH(n,e,i,a):DX(n,i,a),process.env.NODE_ENV!=="production"&&(s._pinia=a));const f=a._s.get(n);if(process.env.NODE_ENV!=="production"&&u){const T="__hot:"+n,Q=o?HH(T,e,i,a,!0):DX(T,Xs({},i),a,!0);u._hotUpdate(Q),delete a.state.value[T],a._s.delete(T)}if(process.env.NODE_ENV!=="production"&&EH){const T=y.getCurrentInstance();if(T&&T.proxy&&!u){const Q=T.proxy,_="_pStores"in Q?Q._pStores:Q._pStores={};_[n]=f}}return f}return s.$id=n,s}function BUt(t,e){return Array.isArray(e)?e.reduce((r,n)=>(r[n]=function(){return t(this.$pinia)[n]},r),{}):Object.keys(e).reduce((r,n)=>(r[n]=function(){const i=t(this.$pinia),o=e[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const FUt=DUt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),jUt=t=>{let e={lng:0,lat:0},r;return t.type==="Polygon"?r=t.coordinates[0]:r=t.coordinates,t.type!=="Point"?(r.map(n=>{e.lng+=parseFloat(n[0]),e.lat+=parseFloat(n[1])}),e.lng=e.lng/r.length,e.lat=e.lat/r.length):(e.lng+=parseFloat(r[0]),e.lat+=parseFloat(r[1])),e},BX=(t,e)=>{const r=[];let n=t.organs?t.organs:t.ftus;const i=n?n.filter((o,s)=>n.findIndex(a=>a.label===o.label)===s):void 0;return i&&i.forEach(o=>{const s={label:o.label,models:o.models,key:`${e}.${o.label}`},a=BX(o,s.key);a.length>0&&(s.children=a),r.push(s)}),r},zUt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},UUt={name:"FlatmapVuer",components:{Button:lk,Col:qc,Loading:T2t,Radio:wk,Icon:p1,RadioGroup:xk,Row:Wc,Select:Jd,Dialog:Cat,MapSvgIcon:HC.MapSvgIcon,MapSvgSpriteColor:HC.MapSvgSpriteColor,Tooltip:u_.Tooltip,TreeControls:u_.TreeControls,SelectionsGroup:Rk,SvgLegends:Nk,ElIconWarningFilled:DA,ElIconArrowDown:C_,ElIconArrowLeft:RA,DrawToolbar:u_.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(t){return{annotator:y.markRaw(new kUt(`${t.flatmapAPI}annotator`))}},methods:{initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(this.closeTooltip(),this.annotationEntry={...this.drawnCreatedEvent.feature,resourceId:this.serverURL},this.rollbackAnnotationEvent(),this.initialiseDrawing())},connectedFeatureTooltip:function(t){if(this.mapImp)if(t){const e=Number(t);let r={feature:{}};if(e){const n=this.mapImp.featureProperties(e);r.feature=n}else{const n=this.existDrawnFeatures.find(i=>i.id===t.replace(" ",""));r.feature.feature=n}this.checkAndCreatePopups(r)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(t,e){if(this.closeTooltip(),this.doubleClickedFeature=!1,this.connectionEntry={},t==="mode")this.changeAnnotationDrawMode({mode:"simple_select"}),this.activeDrawMode=e,Object.keys(this.annotationEntry).length>0&&!this.featureAnnotationSubmitted&&this.rollbackAnnotationEvent();else if(t==="tool"){if(e){const r=e.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${r}`}),this.initialiseDrawing()}else this.changeAnnotationDrawMode({mode:"simple_select"}),this.cancelDrawnFeature();this.activeDrawTool=e}},annotationDrawModeEvent:function(t){this.activeDrawMode==="Edit"&&this.doubleClickedFeature&&(t.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:t.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1),this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[t.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const t=Object.values(this.connectionEntry),e={type:"connectivity",source:t[0],target:t[t.length-1],intermediates:t.filter((r,n)=>n!==0&&n!==t.length-1)};this.annotationEntry.body=e}},changeAnnotationDrawMode:function(t){this.mapImp&&this.mapImp.changeAnnotationDrawMode(t)},clearAnnotationFeature:function(){this.mapImp&&this.existDrawnFeatures.length>0&&this.mapImp.clearAnnotationFeature()},modifyAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&(this.mapImp.rollbackAnnotationEvent(this.annotationEntry),this.annotationEntry={})},commitAnnotationEvent:function(t){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&t&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"?(this.closeTooltip(),this.annotationEntry={}):this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(t=void 0,e=void 0){let r=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,t,e);return"resource"in r&&(r=r.itemIds),r},setFeatureAnnotated:async function(){if(this.mapImp){const t=await this.fetchAnnotatedItemIds();for(const e of t)this.mapImp.setFeatureAnnotated(e)}},fetchDrawnFeatures:async function(t,e){const r=await this.fetchAnnotatedItemIds(t,e);let n=await this.annotator.drawnFeatures(this.userToken,this.serverURL,r);return"resource"in n&&(n=n.features),this.drawnType!=="All tools"&&(n=n.filter(i=>i.geometry.type===this.drawnType)),n},addAnnotationFeature:async function(){if(this.mapImp&&(this.featureAnnotationSubmitted||this.clearAnnotationFeature(),this.drawnType!=="None")){this.featureAnnotationSubmitted||(this.loading=!0);const t=this.annotatedType==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",e=this.annotatedType==="Anyone"?void 0:this.annotatedType==="Me",r=await this.fetchDrawnFeatures(t,e);if(this.existDrawnFeatures=r,this.loading=!1,!this.featureAnnotationSubmitted)for(const n of r)this.mapImp.addAnnotationFeature(n)}},showAnnotator:function(t){this.mapImp&&(this.mapImp.showAnnotator(t),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(t){this.drawnType=t,this.mapImp&&(this.addAnnotationFeature(),this.initialiseDrawing())},setAnnotatedType:function(t){this.annotatedType=t,this.mapImp&&this.addAnnotationFeature()},setFlightPath3D:function(t){this.flightPath3DRadio=t,this.mapImp&&this.mapImp.enableFlightPaths(t)},viewLatestMap:function(){let t=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(t="PATO:0000384");const e={entry:this.entry,biologicalSex:t,viewport:this.mapImp.getState()};this.$emit("view-latest-map",e)},backgroundChangeCallback:function(t){this.currentBackground=t,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(t){if(this.systems.length=0,t&&t.length>0){const e={label:"All",key:"All",children:[]};t.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=BX(r,n.key);i.length>0&&(n.children=i),e.children.push(n)}),this.systems.push(e)}},processTaxon:function(t,e){this.taxonConnectivity.length=0,e.forEach(r=>{Dk(t,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(t){this.colourRadio=t,this.mapImp&&this.mapImp.setColour({colour:t,outline:this.outlinesRadio})},setOutlines:function(t){this.outlineRadio=t,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:t})},resetView:function(){this.mapImp&&(this.mapImp.resetMap(),this.$refs.centrelinesSelection&&this.$refs.centrelinesSelection.reset(),this.$refs.skcanSelection&&this.$refs.skcanSelection.reset(),this.$refs.layersSelection&&this.$refs.layersSelection.reset(),this.$refs.systemsSelection&&this.$refs.pathwaysSelection.reset(),this.$refs.pathwaysSelection&&this.$refs.pathwaysSelection.reset())},zoomIn:function(){this.mapImp&&this.mapImp.zoomIn()},zoomOut:function(){this.mapImp&&this.mapImp.zoomOut()},centreLinesSelected:function(t){this.mapImp&&this.mapImp.enableCentrelines(t.value)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},sckanSelected:function(t){this.mapImp&&this.mapImp.enableSckanPath(t.key,t.value)},checkAllSCKAN:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableSckanPath(e,t.value))},highlightConnectedPaths:async function(t){var e,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(t)].map(d=>this.mapImp.featureProperties(d)),o=await this.flatmapQueries.queryForConnectivity(t),s=(r=(e=o==null?void 0:o.ids)==null?void 0:e.dendrites)==null?void 0:r.flat().flat(),a=[],u=!1;i.forEach(d=>{this.mapImp.nodePathModels(d.featureId).forEach(f=>{u=!0,this.mapImp.pathModelNodes(f).forEach(Q=>{let _=this.mapImp.featureProperties([Q]);if(s.includes(_.models)){u=!1;return}}),u&&a.push(f)})}),this.mapImp.zoomToFeatures(a,{noZoomIn:!0})}},resetMapFilter:function(){const t=this.mapFilters.alert;let e;t.with?t.without||(e={HAS:"alert"}):t.without?e={NOT:{HAS:"alert"}}:e={AND:[{NOT:{HAS:"alert"}},{HAS:"alert"}]},e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter()},alertMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e;t.key==="alert"?e={HAS:"alert"}:t.key==="withoutAlert"&&(e={NOT:{HAS:"alert"}}),this.mapImp.setVisibilityFilter(e)}else this.resetMapFilter()},alertSelected:function(t){this.mapImp&&(t.key==="alert"?t.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:t.key==="withoutAlert"&&(t.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(t){this.mapImp&&(t.value?(this.mapFilters.alert.without=!0,this.mapFilters.alert.with=!0):(this.mapFilters.alert.without=!1,this.mapFilters.alert.with=!1),this.resetMapFilter())},systemSelected:function(t){this.mapImp&&this.mapImp.enableSystem(t.key,t.value)},checkAllSystems:function(t){this.mapImp&&this.systems[0].children.forEach(e=>this.mapImp.enableSystem(e.label,t))},ftuSelected:function(t){this.searchAndShowResult(t,!0)},layersSelected:function(t){this.mapImp&&this.mapImp.enableLayer(t.key,t.value)},checkAllLayers:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableLayer(e,t.value))},taxonsSelected:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.key,t.value)},taxonMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e=this.mapImp.taxonFeatureIds(t.key);this.mapImp.enableConnectivityByTaxonIds(t.key,t.value),this.mapImp.zoomToGeoJSONFeatures(e,{noZoomIn:!0})}else this.mapImp.unselectGeoJSONFeatures(),t.selections.forEach(e=>{let r=t.checked.includes(e.taxon);this.mapImp.enableConnectivityByTaxonIds(e.taxon,r)})},checkAllTaxons:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableConnectivityByTaxonIds(e,t.value))},pathwaysSelected:function(t){this.mapImp&&this.mapImp.enablePath(t.key,t.value)},checkAllPathways:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enablePath(e,t.value))},enablePanZoomEvents:function(t){this.mapImp.enablePanZoomEvents(t)},annotationEventCallback:function(t,e){if(e.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent();else if(e.type==="modeChanged")e.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);else if(e.type==="selectionChanged"){if(this.selectedDrawnFeature=e.feature.features.length===0?void 0:e.feature.features[0],t.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool&&(this.connectionEntry={},this.selectedDrawnFeature)){const r=this.existDrawnFeatures.find(n=>n.id===this.selectedDrawnFeature.id);r&&r.connection&&(this.connectionEntry=r.connection),this.annotationDrawModeEvent(t)}}else{if(e.type==="created"||e.type==="updated"){e.type==="updated"&&e.feature.action&&(e.positionUpdated=e.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(e.feature);t.feature.feature=r}e.type==="created"?this.drawnCreatedEvent=t:this.checkAndCreatePopups(t)}},eventCallback:function(){return(t,e,...r)=>{if(t==="annotation"){const n={feature:e,userData:r,eventType:t};this.annotationEventCallback(n,e)}else if(t!=="pan-zoom"){const n=e.label,i=[e.models],o=this.entry,s=this.biologicalSex;let a;e.taxons&&(typeof e.taxons!="object"?a=JSON.parse(e.taxons):a=e.taxons);const u={dataset:e.dataset,biologicalSex:s,taxonomy:o,resource:i,label:n,feature:e,userData:r,eventType:t,provenanceTaxonomy:a};if(t==="click"){if(this.featuresAlert=e.alert,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([e.models]);else if(this.currentActive=e.models?e.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const d=e.featureId||this.existDrawnFeatures.find(f=>f.id===e.id);if(this.activeDrawTool==="LineString"&&d){const f=e.featureId?e.featureId:e.id,T=e.label?e.label:`Feature ${e.id}`;this.connectionEntry[` ${f}`]=Object.assign({label:T},Object.fromEntries(Object.entries(e).filter(([Q])=>["featureId","models"].includes(Q)).map(([Q,_])=>[Q==="featureId"?"id":Q,_])))}}}else t==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=e.models?e.models:"");e&&e.type!=="marker"&&t==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(u),this.$emit("resource-selected",u)}else this.$emit("pan-zoom-callback",e)}},changeViewingMode:function(t){t&&(this.viewingMode=t),this.closeTooltip()},checkAndCreatePopups:async function(t){if(this.viewingMode==="Annotation")t.feature?(this.annotationEntry={...t.feature,resourceId:this.serverURL},t.feature.featureId&&t.feature.models?this.displayTooltip(t.feature.models):t.feature.feature&&(this.activeDrawTool||this.activeDrawMode||Object.keys(this.connectionEntry).length>0?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=t.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(t.feature.feature.id,jUt(t.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let e=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(t);(e[0]||e[1]||t.feature.hyperlinks&&t.feature.hyperlinks.length>0)&&(this.resourceForTooltip=t.resource[0],t.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(t))}},popUpCssHacks:function(){const t=document.querySelector(".flatmap-tooltip-popup"),e=document.querySelector(".maplibregl-popup-close-button");t&&(t.style.display="none"),e.style.display="block",this.$refs.tooltip.$el.style.display="flex",e.onclick=()=>{this.$emit("connectivity-info-close"),t&&(t.style.display="block")}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(t=>{t.style.display="none"})},createTooltipFromNeuronCuration:async function(t){this.tooltipEntry=await this.flatmapQueries.createTooltipData(t),this.displayTooltip(t.resource[0])},showPopup:function(t,e,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(t,e,n))},showMarkerPopup:function(t,e,r){this.mapImp&&this.mapImp.showMarkerPopup(t,e,r)},closeMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(t.classList.add("enlarge"),t.classList.remove("shrink")):(t.classList.add("shrink"),t.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");t&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),t.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(t){const e=this.hoverVisibilities.length,r=e-1,n=this.hoverVisibilities[this.helpModeActiveIndex];if(n){const i=n==null?void 0:n.refs,o=n==null?void 0:n.ref,s=this.$refs[i||o];if(s){const{parentElement:a,nextElementSibling:u}=s.$el,d=f=>f&&(f.classList.contains("pathway-container")||f.classList.contains("pathway-location"));(d(a)||d(u))&&(this.drawerOpen=!0)}else this.helpModeActiveIndex+=1}t||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=r),t&&this.helpModeActiveIndex>=r&&this.$emit("help-mode-last-item",!0),t&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(i=>{i.value=!0})):t&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.closeFlatmapHelpPopup())},showTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!0,this.$emit("shown-tooltip")},e))},hideTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!1},e))},displayTooltip:function(t,e=void 0){let r,n={className:"flatmapvuer-popover"};e?(r=t,n.annotationFeatureGeometry=e):(r=this.mapImp.modelFeatureIds(t)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&(this.featuresAlert&&(this.tooltipEntry.featuresAlert=this.featuresAlert),this.$emit("connectivity-info-open",this.tooltipEntry)),!this.disableUI&&(this.viewingMode==="Annotation"||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar&&this.hasTooltipEntry())&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:t,destinations:e,origins:r,provenanceTaxonomy:n,provenanceTaxonomyLabel:i}=this.tooltipEntry;return!!(t!=null&&t.length||e!=null&&e.length||r!=null&&r.length||n!=null&&n.length||i!=null&&i.length)},moveMap:function(t,e={}){if(this.mapImp){const{offsetX:r=0,offsetY:n=0,zoom:i=4}=e,o=this.mapImp._map,s=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(t,{noZoomIn:!0}),this.showPathwaysDrawer(!1),s!=null&&s.length&&setTimeout(()=>{o.fitBounds(s,{offset:[r,n],zoom:i,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let t=this.mapImp.modelFeatureIds("UBERON:0000948");t&&t.length>0&&(this.mapImp.showPopup(t[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"}),this.$emit("shown-map-tooltip"))}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(t=>{t.click()})},getLabels:function(){let t=[];if(this.mapImp){let e=this.mapImp.annotations;for(let r of e.values())r.label&&t.push(r.label);return Array.from(new Set(t))}},getState:function(){if(this.mapImp){let t={entry:this.entry,viewport:this.mapImp.getState()};const e=this.mapImp.getIdentifier();return this.biologicalSex?t.biologicalSex=this.biologicalSex:e&&e.biologicalSex&&(t.biologicalSex=e.biologicalSex),e&&e.uuid&&(t.uuid=e.uuid),t}},setState:function(t){t&&(this.mapImp&&t.entry&&this.entry==t.entry&&(!t.biologicalSex||t.biologicalSex===this.biologicalSex)?t.viewport&&this.mapImp.setState(t.viewport):this.createFlatmap(t),this.setStateRequired=!1)},restoreMapState:function(t){t&&(t.viewport&&this.mapImp.setState(t.viewport),t.searchTerm&&this.searchAndShowResult(t.searchTerm,!0))},setFlightPathInfo:function(t){(t===1.6||t>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(t){if(!this.mapImp&&!this.loading){this.loading=!0;let e=!1;this.displayMinimap&&(e={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),t?(t.uuid?r={uuid:t.uuid}:t.entry&&(r.taxon=t.entry),t.biologicalSex?r.biologicalSex=t.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:e}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o),this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(t)})}else t&&(this._stateToBeSet={viewport:t.viewport,searchTerm:t.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const t=this.$refs.display;if(t){const e=getComputedStyle(t),r=parseInt(e.paddingTop)+parseInt(e.paddingBottom),n=t.clientHeight-r;this.pathwaysMaxHeight=n-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&(this.mapImp.resize(),this.showMinimap(this.displayMinimap),this.mapImp._minimap&&this.mapImp._minimap._miniMap.resize())}catch{console.error("Map resize error")}},onFlatmapReady:function(){var t,e;this.sensor=y.markRaw(new I2t(this.$refs.display,this.mapResize)),console.log(this.mapImp.options),((t=this.mapImp.options)==null?void 0:t.style)==="functional"?this.isFC=!0:((e=this.mapImp.options)==null?void 0:e.style)==="centreline"&&(this.isCentreLine=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.isCentreLine||this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!this.isCentreLine,this.mapResize(),this.handleMapClick(),this.$emit("ready",this)},handleMapClick:function(){const t=this.mapImp._map;t&&t.on("click",e=>{this.tooltipEntry.featureId&&this.$emit("connectivity-info-close")})},showMinimap:function(t){this.mapImp&&this.mapImp.showMinimap(t)},showPathwaysDrawer:function(t){this.drawerOpen=t},searchAndShowResult:function(t,e){if(this.mapImp){if(t===void 0||t==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(t);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),e&&r.results[0].featureId&&r.results[0].text){const n=this.mapImp.annotation(r.results[0].featureId);this.mapImp.showPopup(r.results[0].featureId,n.label,{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(t){return this.mapImp?this.mapImp.search(t):[]}},props:{entry:{type:String,required:!0},uuid:String,biologicalSex:{type:String,default:""},minZoom:{type:Number,default:4},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},renderAtMounted:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},showStarInLegend:{type:Boolean,default:!1},isLegacy:{type:Boolean,default:!1},displayLatestChanges:{type:Boolean,default:!1},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,$annotator:this.annotator,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{sensor:null,mapManager:void 0,flatmapQueries:void 0,annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:y.markRaw([]),hoverVisibilities:[{value:!1,ref:"markerPopover"},{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"polygonPopover"},{value:!1,refs:"toolbarPopover",ref:"connectionPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:O2t,isFC:!1,isCentreLine:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:C2t,tooltipEntry:zUt(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover Neuron connections by selecting a neuron and viewing its associated network connections",Annotation:"View internal identifiers of features"},drawnType:"All tools",drawnTypes:["All tools","Point","LineString","Polygon","None"],annotatedType:"Anyone",annotatedTypes:["Anyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,userInformation:void 0,activeDrawMode:void 0,activeDrawTool:void 0,featureAnnotationSubmitted:!1,drawnCreatedEvent:{},connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:y.markRaw({alert:{with:!0,without:!0}})}},computed:{...BUt(FUt,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(t,e){t!==e&&this.setHelpMode(t)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},state:{handler:function(t,e){t!==e&&(this.mapManager?this.setState(t):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(t){t==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&(this.showAnnotator(!0),this.userInformation=e,this.setFeatureAnnotated(),this.existDrawnFeatures.length===0&&this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(t){t&&this.closeTooltip()}},mounted:function(){this.openMapRef=y.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=y.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=y.markRaw(new bH(this.flatmapAPI)),this.flatmapQueries=y.markRaw(new A2t),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},Ia=t=>(y.pushScopeId("data-v-df196382"),t=t(),y.popScopeId(),t),GUt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},$Ut={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},ZUt={style:{height:"100%",width:"100%"},ref:"display"},WUt={class:"beta-popovers"},qUt=Ia(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),XUt=Ia(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),KUt=Ia(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),YUt=Ia(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),JUt=Ia(()=>y.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),tGt={key:1,class:"warning-text"},eGt=Ia(()=>y.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),rGt=Ia(()=>y.createElementVNode("b",null,"Neuron Connection mode",-1)),nGt=Ia(()=>y.createElementVNode("p",null," You can now view the network of neurons connected to a selected neuron. This mode is located in the settings at the bottom right. Once discovery mode is on, click on a neuron to see its connections. ",-1)),iGt=Ia(()=>y.createElementVNode("b",null,"Now can display up to 6 panes",-1)),oGt=Ia(()=>y.createElementVNode("p",null," You can now display up to 6 panes in the flatmap. This allows you to compare between different datasets and/or different views of the same dataset. ",-1)),sGt={class:"bottom-right-control"},aGt=Ia(()=>y.createElementVNode("div",null,[y.createTextVNode(" Fit to "),y.createElementVNode("br"),y.createTextVNode(" window ")],-1)),lGt=["innerHTML"],cGt=["innerHTML"],uGt={style:{"margin-bottom":"2px"}},hGt={key:0,class:"viewing-mode-title"},dGt=["onClick"],pGt=["onClick"];function fGt(t,e,r,n,i,o){const s=y.resolveComponent("map-svg-sprite-color"),a=DA,u=p1,d=tp,f=C_,T=y.resolveComponent("DrawToolbar"),Q=y.resolveComponent("map-svg-icon"),_=Nk,w=y.resolveComponent("tree-controls"),b=Rk,S=RA,E=lk,O=Wc,I=qc,D=pv,j=Jd,$=wk,G=xk,tt=y.resolveComponent("Tooltip"),it=Ik,lt=Tv;return y.withDirectives((y.openBlock(),y.createElementBlock("div",GUt,[y.createVNode(s),y.createElementVNode("div",$Ut,[y.createElementVNode("div",ZUt,null,512),y.withDirectives(y.createElementVNode("div",WUt,[y.createElementVNode("div",null,[y.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[7].value,ref:"warningPopover"},{reference:y.withCtx(()=>[r.displayWarning?(y.openBlock(),y.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:e[7]||(e[7]=rt=>o.showTooltip(7)),onMouseout:e[8]||(e[8]=rt=>o.hideTooltip(7))},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(a)]),_:1}),r.isLegacy?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[JUt,y.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(y.openBlock(),y.createElementBlock("span",tGt,"Beta"))],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[r.isLegacy?(y.openBlock(),y.createElementBlock("p",{key:0,onMouseover:e[0]||(e[0]=rt=>o.showTooltip(7)),onMouseout:e[1]||(e[1]=rt=>o.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):t.isFC?(y.openBlock(),y.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=rt=>o.showTooltip(7)),onMouseout:e[3]||(e[3]=rt=>o.hideTooltip(7))},[y.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),qUt,y.createTextVNode(" models available in "),XUt,y.createTextVNode(". ")],32)):(y.openBlock(),y.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=rt=>o.showTooltip(7)),onMouseout:e[5]||(e[5]=rt=>o.hideTooltip(7))},[y.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),KUt,y.createTextVNode(" models available in "),YUt,y.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(y.openBlock(),y.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:y.withCtx(()=>[r.displayLatestChanges?(y.openBlock(),y.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:e[9]||(e[9]=rt=>o.showTooltip(8)),onMouseout:e[10]||(e[10]=rt=>o.hideTooltip(8))},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(a)]),_:1}),eGt],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[rGt,nGt,iGt,oGt]),_:1},8,["visible"])):y.createCommentVNode("",!0)],512),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(u,{class:y.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:y.withCtx(()=>[y.createVNode(f)]),_:1},8,["class","onClick"]),[[y.vShow,t.minimapResizeShow]]),t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI?(y.openBlock(),y.createBlock(T,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:t.toolbarOptions,drawnType:t.drawnType,activeDrawTool:t.activeDrawTool,activeDrawMode:t.activeDrawMode,newlyDrawnEntry:t.drawnCreatedEvent,connectionEntry:t.connectionEntry,hoverVisibilities:t.hoverVisibilities,onClickToolbar:o.toolbarEvent,onFeatureTooltip:o.connectedFeatureTooltip,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","drawnType","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("div",sGt,[y.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{class:"icon-button-container",onClick:e[11]||(e[11]=rt=>o.zoomIn()),onMouseover:e[12]||(e[12]=rt=>o.showTooltip(1)),onMouseout:e[13]||(e[13]=rt=>o.hideTooltip(1))},[y.createVNode(Q,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),y.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{class:"icon-button-container",onClick:e[14]||(e[14]=rt=>o.zoomOut()),onMouseover:e[15]||(e[15]=rt=>o.showTooltip(2)),onMouseout:e[16]||(e[16]=rt=>o.hideTooltip(2))},[y.createVNode(Q,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),y.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{class:"icon-button-container",onClick:e[17]||(e[17]=rt=>o.resetView()),onMouseover:e[18]||(e[18]=rt=>o.showTooltip(3)),onMouseout:e[19]||(e[19]=rt=>o.hideTooltip(3))},[y.createVNode(Q,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:y.withCtx(()=>[aGt]),_:1},8,["visible"])],512),[[y.vShow,!r.disableUI]]),y.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:t.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.withDirectives((y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:y.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?y.createCommentVNode("",!0):(y.openBlock(),y.createBlock(_,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(y.openBlock(),y.createBlock(d,{key:1,content:"Location of the featured dataset",placement:"right",teleported:!0,trigger:"manual",width:"max-content",offset:-10,"popper-class":"flatmap-popper flatmap-teleport-popper",visible:t.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"yellow-star-legend",innerHTML:t.yellowstar,onMouseover:e[20]||(e[20]=rt=>o.showTooltip(9)),onMouseout:e[21]||(e[21]=rt=>o.hideTooltip(9))},null,40,lGt),[[it,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):y.createCommentVNode("",!0),y.createVNode(d,{content:"Find these markers for data. The number inside the markers is the number of datasets available for each marker.",placement:"right",teleported:!1,width:"200",trigger:"manual","popper-class":"flatmap-popper flatmap-marker-popper",visible:t.hoverVisibilities[0].value,ref:"markerPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,cGt),[[y.vShow,t.hoverVisibilities[0].value],[it,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(y.openBlock(),y.createBlock(w,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:t.systems,active:t.currentActive,hover:t.currentHover,onCheckChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):y.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(y.openBlock(),y.createBlock(b,{title:"Alert",labelKey:"label",identifierKey:"key",selections:t.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(y.openBlock(),y.createBlock(b,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:t.pathways,onChanged:o.pathwaysSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),t.taxonConnectivity&&t.taxonConnectivity.length>0?(y.openBlock(),y.createBlock(b,{title:"Studied in",labelKey:"label",identifierKey:"taxon",helpMessage:"Evidence exists that this set of neuron populations have been studied in the given species.",selections:t.taxonConnectivity,onChanged:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),!(t.isCentreLine||t.isFC)&&t.centreLines&&t.centreLines.length>0?(y.openBlock(),y.createBlock(b,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:t.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):y.createCommentVNode("",!0)],6)),[[it,void 0,"checkBoxPopover"]]),y.createElementVNode("div",{onClick:e[22]||(e[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:y.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.createVNode(u,null,{default:y.withCtx(()=>[y.createVNode(S)]),_:1})],2)],2),[[y.vShow,!(r.disableUI||t.isCentreLine)]])]),_:1},8,["visible"]),t.openMapRef?(y.openBlock(),y.createBlock(d,{key:1,ref:"open-map-popover","virtual-ref":t.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(r.openMapOptions,rt=>(y.openBlock(),y.createBlock(O,{key:rt.key},{default:y.withCtx(()=>[y.createVNode(E,{type:"primary",plain:"",onClick:gt=>t.$emit("open-map",rt.key)},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):y.createCommentVNode("",!0),y.createVNode(d,{ref:"backgroundPopover","virtual-ref":t.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Viewing Mode")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createElementVNode("div",uGt,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.viewingModes,(rt,gt,Pt)=>(y.openBlock(),y.createElementBlock(y.Fragment,{key:gt},[gt===t.viewingMode?(y.openBlock(),y.createElementBlock("span",hGt,[y.createElementVNode("b",null,y.toDisplayString(gt),1)])):(y.openBlock(),y.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Gt=>o.changeViewingMode(gt)},y.toDisplayString(gt),9,dGt))],64))),128))]),y.createVNode(O,{class:"viewing-mode-description"},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(t.viewingModes[t.viewingMode]),1)]),_:1})]),_:1}),t.viewingMode==="Annotation"&&t.userInformation?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Drawn By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(j,{teleported:!1,modelValue:t.drawnType,"onUpdate:modelValue":e[23]||(e[23]=rt=>t.drawnType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setDrawnType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.drawnTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(I,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Annotated By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(j,{teleported:!1,modelValue:t.annotatedType,"onUpdate:modelValue":e[24]||(e[24]=rt=>t.annotatedType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setAnnotatedType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.annotatedTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(I,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:1,class:"backgroundSpacer"})):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:2,class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Flight path display")]),_:1})):y.createCommentVNode("",!0),t.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:3,class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(G,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[25]||(e[25]=rt=>t.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:y.withCtx(()=>[y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("2D")]),_:1}),y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):y.createCommentVNode("",!0),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Organs display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(G,{modelValue:t.colourRadio,"onUpdate:modelValue":e[26]||(e[26]=rt=>t.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:y.withCtx(()=>[y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Colour")]),_:1}),y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Outlines display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(G,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[27]||(e[27]=rt=>t.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:y.withCtx(()=>[y.createVNode($,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Show")]),_:1}),y.createVNode($,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Change background")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.availableBackground,rt=>(y.openBlock(),y.createElementBlock("div",{key:rt,class:y.normalizeClass(["backgroundChoice",rt,rt==t.currentBackground?"active":""]),onClick:gt=>o.backgroundChangeCallback(rt)},null,10,pGt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{visible:t.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:y.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(y.openBlock(),y.createElementBlock("div",{key:0,ref:"openMapRef",class:"icon-button-container",onMouseover:e[28]||(e[28]=rt=>o.showTooltip(4)),onMouseout:e[29]||(e[29]=rt=>o.hideTooltip(4))},[y.createVNode(Q,{icon:"openMap",class:"icon-button open-map-button"})],544)):y.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:y.withCtx(()=>[y.createElementVNode("div",{ref:"backgroundIconRef",class:"icon-button-container",onMouseover:e[30]||(e[30]=rt=>o.showTooltip(5)),onMouseout:e[31]||(e[31]=rt=>o.hideTooltip(5))},[y.createVNode(Q,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})],2),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(tt,{ref:"tooltip",class:"tooltip",annotationEntry:t.annotationEntry,tooltipEntry:t.tooltipEntry,annotationDisplay:t.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"]),[[y.vShow,t.tooltipDisplay]])])])),[[lt,t.loading]])}const CH=np(UUt,[["render",fGt],["__scopeId","data-v-df196382"]]);function TGt(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(i){i(r)}),(n=t.get("*"))&&n.slice().map(function(i){i(e,r)})}}}const FX=new TGt,jX={"NCBITaxon:10114":"01fedbf9-d783-509c-a10c-827941ab13da","NCBITaxon:9823":"a336ac04-24db-561f-a25f-1c994fe17410","NCBITaxon:9606":"42ed6323-f645-5fbe-bada-9581819cf689","NCBITaxon:10090":"25285fab-48a0-5620-a6a0-f9a0374837d5","NCBITaxon:9685":"73060497-46a6-52bf-b975-cac511c127cb"},QGt={name:"MultiFlatmapVuer",components:{Col:qc,Row:Wc,Option:pv,Select:Jd,Popover:tp,FlatmapVuer:CH},mounted:function(){this.initialise(),FX.on("onActionClick",t=>{this.resourceSelected(t)}),FX.on("open-pubmed-url",t=>{this.$emit("open-pubmed-url",t)})},methods:{initialise:function(){return new Promise(t=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(e=>e.json()).then(e=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&e.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=this.availableSpecies[n];else for(let o=0;o<e.length;o++)if(this.availableSpecies[n].taxo===e[o].taxon)if(this.availableSpecies[n].biologicalSex){if(e[o].biologicalSex&&e[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=this.availableSpecies[n];break}}else{this.speciesList[n]=this.availableSpecies[n];break}});let r=this.initial;if(this.state){const n=this.state.state;(!n||!n.uuid&&!n.entry)&&this.state.species?r=this.state.species:r=void 0}r&&(r&&this.speciesList[r]!==void 0?this.activeSpecies=r:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this.initialised=!0,t(),this.resolveList.forEach(n=>{n()})})):this.initialised?t():this.resolveList.push(t)})},resourceSelected:function(t){this.$emit("resource-selected",t)},FlatmapReady:function(t){this.$emit("ready",t)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(t){this.$emit("pan-zoom-callback",t)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(t){this.$emit("connectivity-info-open",t)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},showPopup:function(t,e,r){this.getCurrentFlatmap().showPopup(t,e,r)},showMarkerPopup:function(t,e,r){this.getCurrentFlatmap().showMarkerPopup(t,e,r)},setSpecies:function(t,e,r){if(this.$refs&&t in this.$refs)this.activeSpecies=t,this.$refs[this.activeSpecies][0].createFlatmap(e),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(t,e,n)})}},viewLatestMap:function(t){const e=Object.keys(this.speciesList);for(let r=0;r<e.length;r++){const n=this.speciesList[e[r]];if(!n.isLegacy&&n.taxo===t.entry&&n.biologicalSex===t.biologicalSex){this.setSpecies(e[r],t,0);return}}},createLegacyEntry:function(t,e,r){if(r&&e){let n="Legacy";return t.species&&(t.species.slice(0,6)==="Legacy"?n=t.species:n=n+` ${t.species}`),this.speciesList[n]={taxo:e,isLegacy:!0,displayWarning:!0},{species:n,state:{entry:e,uuid:r,viewport:t.state.viewport,searchTerm:t.state.searchTerm}}}},updateState:function(t){return new Promise(e=>{if(t&&t.state){const r=t.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new bH(this.flatmapAPI),i={taxon:r.entry};r.biologicalSex&&(i.biologicalSex=r.biologicalSex),n.findMap_(i).then(o=>{if(o.uuid!==r.uuid)return this.createLegacyEntry(t,r.entry,r.uuid)}).then(o=>{e(o||t)}).catch(()=>{e(t)})})}else if(r.entry){const n=r.entry in jX?jX[r.entry]:void 0,i=this.createLegacyEntry(t,r.entry,n);e(i||t)}}e(t)})},getState:function(){let t={species:this.activeSpecies,state:void 0},e=this.getCurrentFlatmap();return t.state=e.getState(),t},setState:function(t){t&&this.updateState(t).then(e=>{this.initialise().then(()=>{e.species&&e.species!==this.activeSpecies?this.setSpecies(e.species,e.state,5):e.state&&this.getCurrentFlatmap().setState(e.state)})})},activateTooltipByIndex:function(t){return t===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(t){t&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(t){this.getCurrentFlatmap().changeViewingMode(t)}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:4},renderAtMounted:{type:Boolean,default:!1},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},displayMinimap:{type:Boolean,default:!1},showStarInLegend:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array},availableSpecies:{type:Object,default:function(){return{"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayWarning:!0}}}},state:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:y.markRaw([]),initialised:!1}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},mGt=t=>(y.pushScopeId("data-v-5364de02"),t=t(),y.popScopeId(),t),gGt={class:"multi-container",ref:"multiContainer"},yGt={key:0,style:{position:"absolute","z-index":"10"}},_Gt=mGt(()=>y.createElementVNode("div",{class:"species-display-text"},"Species",-1)),vGt={class:"select-box-icon"};function bGt(t,e,r,n,i,o){const s=pv,a=Jd,u=tp,d=CH;return y.openBlock(),y.createElementBlock("div",gGt,[r.disableUI?y.createCommentVNode("",!0):(y.openBlock(),y.createElementBlock("div",yGt,[_Gt,y.createVNode(u,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:o.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:y.withCtx(()=>[y.createVNode(a,{id:"flatmap-select",teleported:!1,modelValue:t.activeSpecies,"onUpdate:modelValue":e[0]||(e[0]=f=>t.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.speciesList,(f,T)=>(y.openBlock(),y.createBlock(s,{key:T,label:T,value:T},{default:y.withCtx(()=>[y.createElementVNode("span",vGt,[y.createElementVNode("i",{class:y.normalizeClass(f.iconClass)},null,2)]),y.createTextVNode(" "+y.toDisplayString(T),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(t.speciesList,(f,T)=>y.withDirectives((y.openBlock(),y.createBlock(d,{key:T,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:T,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,connectivityInfoSidebar:r.connectivityInfoSidebar,onConnectivityInfoOpen:o.onConnectivityInfoOpen,onConnectivityInfoClose:o.onConnectivityInfoClose,onOpenMap:e[1]||(e[1]=Q=>t.$emit("open-map",Q)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:t.activeSpecies==T&&r.helpMode,helpModeActiveItem:r.helpModeActiveItem,helpModeDialog:r.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:o.onHelpModeLastItem,onShownTooltip:o.onTooltipShown,onShownMapTooltip:o.onMapTooltipShown,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[y.vShow,t.activeSpecies==T]])),128))],512)}const LGt=np(QGt,[["render",bGt],["__scopeId","data-v-5364de02"]]);To.FlatmapVuer=CH,To.MultiFlatmapVuer=LGt,Object.defineProperty(To,Symbol.toStringTag,{value:"Module"})});
|