@abi-software/flatmapvuer 1.5.5 → 1.5.6
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 +5 -4
- package/dist/flatmapvuer.umd.cjs +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +1 -1
- package/src/components/FlatmapVuer.vue +7 -2
- package/src/services/flatmapQueries.js +10 -4
package/dist/flatmapvuer.umd.cjs
CHANGED
|
@@ -17,7 +17,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,curr
|
|
|
17
17
|
<circle cx="12.5" cy="12.5" r="9" fill="#fff"></circle>
|
|
18
18
|
<text x="12" y="17.5" style="font-size:14px;fill:#000;text-anchor:middle">2</text>
|
|
19
19
|
</svg>
|
|
20
|
-
</div>`,$_=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},Oc={},zO=async function(t,e){return Oc&&Oc.hasOwnProperty(e)?Oc[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"),Oc[e]=i,r(i)}).catch(n=>{console.error("Error:",n),Oc[e]=e,r(e)})})},UO=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1};let w2t=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 zO(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=$_(e),n=[],i=!1;return r.forEach(o=>{i=!1,UO(t.axons,o)&&(i=!0),UO(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=$_(t.axons),i=$_(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 x2t='<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 GO={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(typeof window<"u"?window:E1t,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),y=Q==="[object Array]"||Q==="[object NodeList]"||Q==="[object HTMLCollection]"||Q==="[object Object]"||typeof jQuery<"u"&&f instanceof jQuery||typeof Elements<"u"&&f instanceof Elements,b=0,w=f.length;if(y)for(;b<w;b++)T(f[b]);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 y(){var w=[];this.add=function(O){w.push(O)};var M,E;this.call=function(O){for(M=0,E=w.length;M<E;M++)w[M].call(this,O)},this.remove=function(O){var I=[];for(M=0,E=w.length;M<E;M++)w[M]!==O&&I.push(w[M]);w=I},this.length=function(){return w.length}}function b(w,M){if(w){if(w.resizedAttached){w.resizedAttached.add(M);return}w.resizedAttached=new y,w.resizedAttached.add(M),w.resizeSensor=document.createElement("div"),w.resizeSensor.dir="ltr",w.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(w.resizeSensor,E);var I=document.createElement("div");I.className="resize-sensor-expand",a(I,E);var N=document.createElement("div");a(N,O),I.appendChild(N);var F=document.createElement("div");F.className="resize-sensor-shrink",a(F,E);var G=document.createElement("div");a(G,O),a(G,{width:"200%",height:"200%"}),F.appendChild(G),w.resizeSensor.appendChild(I),w.resizeSensor.appendChild(F),w.appendChild(w.resizeSensor);var Z=window.getComputedStyle(w),et=Z?Z.getPropertyValue("position"):null;et!=="absolute"&&et!=="relative"&&et!=="fixed"&&et!=="sticky"&&(w.style.position="relative");var nt=!1,ut=0,rt=s(w),yt=0,It=0,Zt=!0;Q=0;var ne=function(){var re=w.offsetWidth,de=w.offsetHeight;N.style.width=re+10+"px",N.style.height=de+10+"px",I.scrollLeft=re+10,I.scrollTop=de+10,F.scrollLeft=re+10,F.scrollTop=de+10},te=function(){if(Zt){var re=w.offsetWidth===0&&w.offsetHeight===0;if(re){Q||(Q=n(function(){Q=0,te()}));return}else Zt=!1}ne()};w.resizeSensor.resetSensor=te;var Ae=function(){ut=0,nt&&(yt=rt.width,It=rt.height,w.resizedAttached&&w.resizedAttached.call(rt))},ur=function(){rt=s(w),nt=rt.width!==yt||rt.height!==It,nt&&!ut&&(ut=n(Ae)),te()},Rr=function(re,de,Ue){re.attachEvent?re.attachEvent("on"+de,Ue):re.addEventListener(de,Ue)};Rr(I,"scroll",ur),Rr(F,"scroll",ur),Q=n(function(){Q=0,te()})}}o(f,function(w){b(w,T)}),this.detach=function(w){Q||(i(Q),Q=0),u.detach(f,w)},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,y=0;y<Q.length;y++)Q[y].resizeSensor&&u.reset(Q[y])});document.addEventListener("DOMContentLoaded",function(f){d.observe(document.body,{childList:!0,subtree:!0})})}return u})})(GO);var E2t=GO.exports;const M2t=M1t(E2t);var S2t=Object.defineProperty,H2t=(t,e,r)=>e in t?S2t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pt=(t,e,r)=>(H2t(t,typeof e!="symbol"?e+"":e,r),r),Z_=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},ct=(t,e,r)=>(Z_(t,e,"read from private field"),r?r.call(t):e.get(t)),Yt=(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)},Te=(t,e,r,n)=>(Z_(t,e,"write to private field"),e.set(t,r),r),ae=(t,e,r)=>(Z_(t,e,"access private method"),r);function C2t(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 s4(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function A2t(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 so=function(t){try{return!!t()}catch{return!0}},O2t=so,W_=!O2t(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),$O=W_,ZO=Function.prototype,q_=ZO.call,k2t=$O&&ZO.bind.bind(q_,q_),H1=$O?k2t:function(t){return function(){return q_.apply(t,arguments)}},WO=H1,I2t=WO({}.toString),P2t=WO("".slice),kc=function(t){return P2t(I2t(t),8,-1)},V2t=H1,R2t=so,N2t=kc,X_=Object,D2t=V2t("".split),B2t=R2t(function(){return!X_("z").propertyIsEnumerable(0)})?function(t){return N2t(t)==="String"?D2t(t,""):X_(t)}:X_,Ic=function(t){return t==null},F2t=Ic,j2t=TypeError,Nd=function(t){if(F2t(t))throw new j2t("Can't call method on "+t);return t},z2t=B2t,U2t=Nd,B5=function(t){return z2t(U2t(t))},Pc=function(t){return t&&t.Math===Math&&t},Yo=Pc(typeof globalThis=="object"&&globalThis)||Pc(typeof window=="object"&&window)||Pc(typeof self=="object"&&self)||Pc(typeof P=="object"&&P)||Pc(typeof P=="object"&&P)||function(){return this}()||Function("return this")(),qO={exports:{}},XO=Yo,G2t=Object.defineProperty,K_=function(t,e){try{G2t(XO,t,{value:e,configurable:!0,writable:!0})}catch{XO[t]=e}return e},$2t=Yo,Z2t=K_,KO="__core-js_shared__",YO=qO.exports=$2t[KO]||Z2t(KO,{});(YO.versions||(YO.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 Y_=qO.exports,JO=Y_,tk=function(t,e){return JO[t]||(JO[t]=e||{})},W2t=Nd,q2t=Object,ek=function(t){return q2t(W2t(t))},X2t=H1,K2t=ek,Y2t=X2t({}.hasOwnProperty),Gs=Object.hasOwn||function(t,e){return Y2t(K2t(t),e)},J2t=H1,tst=0,est=Math.random(),rst=J2t(1 .toString),J_=function(t){return"Symbol("+(t===void 0?"":t)+")_"+rst(++tst+est,36)},nst=typeof navigator<"u"&&String(navigator.userAgent)||"",rk=Yo,tv=nst,nk=rk.process,ik=rk.Deno,ok=nk&&nk.versions||ik&&ik.version,sk=ok&&ok.v8,fs,Dd;sk&&(fs=sk.split("."),Dd=fs[0]>0&&fs[0]<4?1:+(fs[0]+fs[1])),!Dd&&tv&&(fs=tv.match(/Edge\/(\d+)/),(!fs||fs[1]>=74)&&(fs=tv.match(/Chrome\/(\d+)/),fs&&(Dd=+fs[1])));var ist=Dd,ak=ist,ost=so,sst=Yo,ast=sst.String,lk=!!Object.getOwnPropertySymbols&&!ost(function(){var t=Symbol("symbol detection");return!ast(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ak&&ak<41}),lst=lk,ck=lst&&!Symbol.sham&&typeof Symbol.iterator=="symbol",cst=Yo,ust=tk,uk=Gs,hst=J_,dst=lk,pst=ck,F5=cst.Symbol,ev=ust("wks"),fst=pst?F5.for||F5:F5&&F5.withoutSetter||hst,H2=function(t){return uk(ev,t)||(ev[t]=dst&&uk(F5,t)?F5[t]:fst("Symbol."+t)),ev[t]},rv=typeof document=="object"&&document.all,D1=typeof rv>"u"&&rv!==void 0?function(t){return typeof t=="function"||t===rv}:function(t){return typeof t=="function"},Tst=D1,C2=function(t){return typeof t=="object"?t!==null:Tst(t)},Qst=C2,mst=String,gst=TypeError,a4=function(t){if(Qst(t))return t;throw new gst(mst(t)+" is not an object")},hk={},yst=so,Ts=!yst(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),_st=Ts,vst=so,dk=_st&&vst(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),$s={},bst=Yo,pk=C2,nv=bst.document,Lst=pk(nv)&&pk(nv.createElement),iv=function(t){return Lst?nv.createElement(t):{}},wst=Ts,xst=so,Est=iv,fk=!wst&&!xst(function(){return Object.defineProperty(Est("div"),"a",{get:function(){return 7}}).a!==7}),Mst=W_,Bd=Function.prototype.call,i3=Mst?Bd.bind(Bd):function(){return Bd.apply(Bd,arguments)},ov=Yo,Sst=D1,Hst=function(t){return Sst(t)?t:void 0},Vc=function(t,e){return arguments.length<2?Hst(ov[t]):ov[t]&&ov[t][e]},Cst=H1,sv=Cst({}.isPrototypeOf),Ast=Vc,Ost=D1,kst=sv,Ist=ck,Pst=Object,Tk=Ist?function(t){return typeof t=="symbol"}:function(t){var e=Ast("Symbol");return Ost(e)&&kst(e.prototype,Pst(t))},Vst=String,av=function(t){try{return Vst(t)}catch{return"Object"}},Rst=D1,Nst=av,Dst=TypeError,Rc=function(t){if(Rst(t))return t;throw new Dst(Nst(t)+" is not a function")},Bst=Rc,Fst=Ic,lv=function(t,e){var r=t[e];return Fst(r)?void 0:Bst(r)},cv=i3,uv=D1,hv=C2,jst=TypeError,zst=function(t,e){var r,n;if(e==="string"&&uv(r=t.toString)&&!hv(n=cv(r,t))||uv(r=t.valueOf)&&!hv(n=cv(r,t))||e!=="string"&&uv(r=t.toString)&&!hv(n=cv(r,t)))return n;throw new jst("Can't convert object to primitive value")},Ust=i3,Qk=C2,mk=Tk,Gst=lv,$st=zst,Zst=H2,Wst=TypeError,qst=Zst("toPrimitive"),Xst=function(t,e){if(!Qk(t)||mk(t))return t;var r=Gst(t,qst),n;if(r){if(e===void 0&&(e="default"),n=Ust(r,t,e),!Qk(n)||mk(n))return n;throw new Wst("Can't convert object to primitive value")}return e===void 0&&(e="number"),$st(t,e)},Kst=Xst,Yst=Tk,gk=function(t){var e=Kst(t,"string");return Yst(e)?e:e+""},Jst=Ts,tat=fk,eat=dk,Fd=a4,yk=gk,rat=TypeError,dv=Object.defineProperty,nat=Object.getOwnPropertyDescriptor,pv="enumerable",fv="configurable",Tv="writable";$s.f=Jst?eat?function(t,e,r){if(Fd(t),e=yk(e),Fd(r),typeof t=="function"&&e==="prototype"&&"value"in r&&Tv in r&&!r[Tv]){var n=nat(t,e);n&&n[Tv]&&(t[e]=r.value,r={configurable:fv in r?r[fv]:n[fv],enumerable:pv in r?r[pv]:n[pv],writable:!1})}return dv(t,e,r)}:dv:function(t,e,r){if(Fd(t),e=yk(e),Fd(r),tat)try{return dv(t,e,r)}catch{}if("get"in r||"set"in r)throw new rat("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var iat=Math.ceil,oat=Math.floor,sat=Math.trunc||function(t){var e=+t;return(e>0?oat:iat)(e)},aat=sat,jd=function(t){var e=+t;return e!==e||e===0?0:aat(e)},lat=jd,cat=Math.max,uat=Math.min,hat=function(t,e){var r=lat(t);return r<0?cat(r+e,0):uat(r,e)},dat=jd,pat=Math.min,fat=function(t){var e=dat(t);return e>0?pat(e,9007199254740991):0},Tat=fat,_k=function(t){return Tat(t.length)},Qat=B5,mat=hat,gat=_k,vk=function(t){return function(e,r,n){var i=Qat(e),o=gat(i);if(o===0)return!t&&-1;var s=mat(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}},yat={includes:vk(!0),indexOf:vk(!1)},zd={},_at=H1,Qv=Gs,vat=B5,bat=yat.indexOf,Lat=zd,bk=_at([].push),Lk=function(t,e){var r=vat(t),n=0,i=[],o;for(o in r)!Qv(Lat,o)&&Qv(r,o)&&bk(i,o);for(;e.length>n;)Qv(r,o=e[n++])&&(~bat(i,o)||bk(i,o));return i},mv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],wat=Lk,xat=mv,Eat=Object.keys||function(t){return wat(t,xat)},Mat=Ts,Sat=dk,Hat=$s,Cat=a4,Aat=B5,Oat=Eat;hk.f=Mat&&!Sat?Object.defineProperties:function(t,e){Cat(t);for(var r=Aat(e),n=Oat(e),i=n.length,o=0,s;i>o;)Hat.f(t,s=n[o++],r[s]);return t};var kat=Vc,Iat=kat("document","documentElement"),Pat=tk,Vat=J_,wk=Pat("keys"),gv=function(t){return wk[t]||(wk[t]=Vat(t))},Rat=a4,Nat=hk,xk=mv,Dat=zd,Bat=Iat,Fat=iv,jat=gv,Ek=">",Mk="<",yv="prototype",_v="script",Sk=jat("IE_PROTO"),vv=function(){},Hk=function(t){return Mk+_v+Ek+t+Mk+"/"+_v+Ek},Ck=function(t){t.write(Hk("")),t.close();var e=t.parentWindow.Object;return t=null,e},zat=function(){var t=Fat("iframe"),e="java"+_v+":",r;return t.style.display="none",Bat.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(Hk("document.F=Object")),r.close(),r.F},Ud,Gd=function(){try{Ud=new ActiveXObject("htmlfile")}catch{}Gd=typeof document<"u"?document.domain&&Ud?Ck(Ud):zat():Ck(Ud);for(var t=xk.length;t--;)delete Gd[yv][xk[t]];return Gd()};Dat[Sk]=!0;var bv=Object.create||function(t,e){var r;return t!==null?(vv[yv]=Rat(t),r=new vv,vv[yv]=null,r[Sk]=t):r=Gd(),e===void 0?r:Nat.f(r,e)},Uat=H2,Gat=bv,$at=$s.f,Lv=Uat("unscopables"),wv=Array.prototype;wv[Lv]===void 0&&$at(wv,Lv,{configurable:!0,value:Gat(null)});var Zat=function(t){wv[Lv][t]=!0},Nc={},Wat=Yo,qat=D1,Ak=Wat.WeakMap,Xat=qat(Ak)&&/native code/.test(String(Ak)),xv=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},Kat=Ts,Yat=$s,Jat=xv,$d=Kat?function(t,e,r){return Yat.f(t,e,Jat(1,r))}:function(t,e,r){return t[e]=r,t},t3t=Xat,Ok=Yo,e3t=C2,r3t=$d,Ev=Gs,Mv=Y_,n3t=gv,i3t=zd,kk="Object already initialized",Sv=Ok.TypeError,o3t=Ok.WeakMap,Zd,Dc,Wd,s3t=function(t){return Wd(t)?Dc(t):Zd(t,{})},a3t=function(t){return function(e){var r;if(!e3t(e)||(r=Dc(e)).type!==t)throw new Sv("Incompatible receiver, "+t+" required");return r}};if(t3t||Mv.state){var Zs=Mv.state||(Mv.state=new o3t);Zs.get=Zs.get,Zs.has=Zs.has,Zs.set=Zs.set,Zd=function(t,e){if(Zs.has(t))throw new Sv(kk);return e.facade=t,Zs.set(t,e),e},Dc=function(t){return Zs.get(t)||{}},Wd=function(t){return Zs.has(t)}}else{var j5=n3t("state");i3t[j5]=!0,Zd=function(t,e){if(Ev(t,j5))throw new Sv(kk);return e.facade=t,r3t(t,j5,e),e},Dc=function(t){return Ev(t,j5)?t[j5]:{}},Wd=function(t){return Ev(t,j5)}}var qd={set:Zd,get:Dc,has:Wd,enforce:s3t,getterFor:a3t},Hv={},Ik={},Pk={}.propertyIsEnumerable,Vk=Object.getOwnPropertyDescriptor,l3t=Vk&&!Pk.call({1:2},1);Ik.f=l3t?function(t){var e=Vk(this,t);return!!e&&e.enumerable}:Pk;var c3t=Ts,u3t=i3,h3t=Ik,d3t=xv,p3t=B5,f3t=gk,T3t=Gs,Q3t=fk,Rk=Object.getOwnPropertyDescriptor;Hv.f=c3t?Rk:function(t,e){if(t=p3t(t),e=f3t(e),Q3t)try{return Rk(t,e)}catch{}if(T3t(t,e))return d3t(!u3t(h3t.f,t,e),t[e])};var Nk={exports:{}},Cv=Ts,m3t=Gs,Dk=Function.prototype,g3t=Cv&&Object.getOwnPropertyDescriptor,Av=m3t(Dk,"name"),y3t=Av&&(function(){}).name==="something",_3t=Av&&(!Cv||Cv&&g3t(Dk,"name").configurable),Bk={EXISTS:Av,PROPER:y3t,CONFIGURABLE:_3t},v3t=H1,b3t=D1,Ov=Y_,L3t=v3t(Function.toString);b3t(Ov.inspectSource)||(Ov.inspectSource=function(t){return L3t(t)});var w3t=Ov.inspectSource,kv=H1,x3t=so,E3t=D1,Xd=Gs,Iv=Ts,M3t=Bk.CONFIGURABLE,S3t=w3t,Fk=qd,H3t=Fk.enforce,C3t=Fk.get,jk=String,Kd=Object.defineProperty,A3t=kv("".slice),O3t=kv("".replace),k3t=kv([].join),I3t=Iv&&!x3t(function(){return Kd(function(){},"length",{value:8}).length!==8}),P3t=String(String).split("String"),V3t=Nk.exports=function(t,e,r){A3t(jk(e),0,7)==="Symbol("&&(e="["+O3t(jk(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Xd(t,"name")||M3t&&t.name!==e)&&(Iv?Kd(t,"name",{value:e,configurable:!0}):t.name=e),I3t&&r&&Xd(r,"arity")&&t.length!==r.arity&&Kd(t,"length",{value:r.arity});try{r&&Xd(r,"constructor")&&r.constructor?Iv&&Kd(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=H3t(t);return Xd(n,"source")||(n.source=k3t(P3t,typeof e=="string"?e:"")),t};Function.prototype.toString=V3t(function(){return E3t(this)&&C3t(this).source||S3t(this)},"toString");var zk=Nk.exports,R3t=D1,N3t=$s,D3t=zk,B3t=K_,z5=function(t,e,r,n){n||(n={});var i=n.enumerable,o=n.name!==void 0?n.name:e;if(R3t(r)&&D3t(r,o,n),n.global)i?t[e]=r:B3t(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=r:N3t.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Yd={},F3t=Lk,j3t=mv,z3t=j3t.concat("length","prototype");Yd.f=Object.getOwnPropertyNames||function(t){return F3t(t,z3t)};var Uk={};Uk.f=Object.getOwnPropertySymbols;var U3t=Vc,G3t=H1,$3t=Yd,Z3t=Uk,W3t=a4,q3t=G3t([].concat),X3t=U3t("Reflect","ownKeys")||function(t){var e=$3t.f(W3t(t)),r=Z3t.f;return r?q3t(e,r(t)):e},Gk=Gs,K3t=X3t,Y3t=Hv,J3t=$s,t4t=function(t,e,r){for(var n=K3t(e),i=J3t.f,o=Y3t.f,s=0;s<n.length;s++){var a=n[s];!Gk(t,a)&&!(r&&Gk(r,a))&&i(t,a,o(e,a))}},e4t=so,r4t=D1,n4t=/#|\.prototype\./,Bc=function(t,e){var r=o4t[i4t(t)];return r===a4t?!0:r===s4t?!1:r4t(e)?e4t(e):!!e},i4t=Bc.normalize=function(t){return String(t).replace(n4t,".").toLowerCase()},o4t=Bc.data={},s4t=Bc.NATIVE="N",a4t=Bc.POLYFILL="P",$k=Bc,Jd=Yo,l4t=Hv.f,c4t=$d,u4t=z5,h4t=K_,d4t=t4t,p4t=$k,Ws=function(t,e){var r=t.target,n=t.global,i=t.stat,o,s,a,u,d,f;if(n?s=Jd:i?s=Jd[r]||h4t(r,{}):s=Jd[r]&&Jd[r].prototype,s)for(a in e){if(d=e[a],t.dontCallGetSet?(f=l4t(s,a),u=f&&f.value):u=s[a],o=p4t(n?a:r+(i?".":"#")+a,t.forced),!o&&u!==void 0){if(typeof d==typeof u)continue;d4t(d,u)}(t.sham||u&&u.sham)&&c4t(d,"sham",!0),u4t(s,a,d,t)}},f4t=so,T4t=!f4t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),Q4t=Gs,m4t=D1,g4t=ek,y4t=gv,_4t=T4t,Zk=y4t("IE_PROTO"),Pv=Object,v4t=Pv.prototype,Wk=_4t?Pv.getPrototypeOf:function(t){var e=g4t(t);if(Q4t(e,Zk))return e[Zk];var r=e.constructor;return m4t(r)&&e instanceof r?r.prototype:e instanceof Pv?v4t:null},b4t=so,L4t=D1,w4t=C2,qk=Wk,x4t=z5,E4t=H2,Vv=E4t("iterator"),Xk=!1,z6,Rv,Nv;[].keys&&(Nv=[].keys(),"next"in Nv?(Rv=qk(qk(Nv)),Rv!==Object.prototype&&(z6=Rv)):Xk=!0);var M4t=!w4t(z6)||b4t(function(){var t={};return z6[Vv].call(t)!==t});M4t&&(z6={}),L4t(z6[Vv])||x4t(z6,Vv,function(){return this});var Kk={IteratorPrototype:z6,BUGGY_SAFARI_ITERATORS:Xk},S4t=$s.f,H4t=Gs,C4t=H2,Yk=C4t("toStringTag"),tp=function(t,e,r){t&&!r&&(t=t.prototype),t&&!H4t(t,Yk)&&S4t(t,Yk,{configurable:!0,value:e})},A4t=Kk.IteratorPrototype,O4t=bv,k4t=xv,I4t=tp,P4t=Nc,V4t=function(){return this},R4t=function(t,e,r,n){var i=e+" Iterator";return t.prototype=O4t(A4t,{next:k4t(+!n,r)}),I4t(t,i,!1),P4t[i]=V4t,t},N4t=H1,D4t=Rc,Jk=function(t,e,r){try{return N4t(D4t(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}},B4t=C2,F4t=function(t){return B4t(t)||t===null},j4t=F4t,z4t=String,U4t=TypeError,G4t=function(t){if(j4t(t))return t;throw new U4t("Can't set "+z4t(t)+" as a prototype")},$4t=Jk,Z4t=C2,W4t=Nd,q4t=G4t,tI=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=$4t(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(n,i){return W4t(n),q4t(i),Z4t(n)&&(t?r(n,i):n.__proto__=i),n}}():void 0),X4t=Ws,K4t=i3,eI=Bk,Y4t=D1,J4t=R4t,rI=Wk,nI=tI,t6t=tp,e6t=$d,Dv=z5,r6t=H2,n6t=Nc,iI=Kk,i6t=eI.PROPER,o6t=eI.CONFIGURABLE,oI=iI.IteratorPrototype,ep=iI.BUGGY_SAFARI_ITERATORS,Fc=r6t("iterator"),sI="keys",jc="values",aI="entries",s6t=function(){return this},Bv=function(t,e,r,n,i,o,s){J4t(r,e,n);var a=function(E){if(E===i&&Q)return Q;if(!ep&&E&&E in f)return f[E];switch(E){case sI:return function(){return new r(this,E)};case jc:return function(){return new r(this,E)};case aI:return function(){return new r(this,E)}}return function(){return new r(this)}},u=e+" Iterator",d=!1,f=t.prototype,T=f[Fc]||f["@@iterator"]||i&&f[i],Q=!ep&&T||a(i),y=e==="Array"&&f.entries||T,b,w,M;if(y&&(b=rI(y.call(new t)),b!==Object.prototype&&b.next&&(rI(b)!==oI&&(nI?nI(b,oI):Y4t(b[Fc])||Dv(b,Fc,s6t)),t6t(b,u,!0))),i6t&&i===jc&&T&&T.name!==jc&&(o6t?e6t(f,"name",jc):(d=!0,Q=function(){return K4t(T,this)})),i)if(w={values:a(jc),keys:o?Q:a(sI),entries:a(aI)},s)for(M in w)(ep||d||!(M in f))&&Dv(f,M,w[M]);else X4t({target:e,proto:!0,forced:ep||d},w);return f[Fc]!==Q&&Dv(f,Fc,Q,{name:i}),n6t[e]=Q,w},Fv=function(t,e){return{value:t,done:e}},a6t=B5,jv=Zat,lI=Nc,cI=qd,l6t=$s.f,c6t=Bv,rp=Fv,u6t=Ts,uI="Array Iterator",h6t=cI.set,d6t=cI.getterFor(uI),p6t=c6t(Array,"Array",function(t,e){h6t(this,{type:uI,target:a6t(t),index:0,kind:e})},function(){var t=d6t(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,rp(void 0,!0);switch(t.kind){case"keys":return rp(r,!1);case"values":return rp(e[r],!1)}return rp([r,e[r]],!1)},"values"),hI=lI.Arguments=lI.Array;if(jv("keys"),jv("values"),jv("entries"),u6t&&hI.name!=="values")try{l6t(hI,"name",{value:"values"})}catch{}var f6t=H2,T6t=f6t("toStringTag"),dI={};dI[T6t]="z";var zv=String(dI)==="[object z]",Q6t=zv,m6t=D1,np=kc,g6t=H2,y6t=g6t("toStringTag"),_6t=Object,v6t=np(function(){return arguments}())==="Arguments",b6t=function(t,e){try{return t[e]}catch{}},Uv=Q6t?np:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=b6t(e=_6t(t),y6t))=="string"?r:v6t?np(e):(n=np(e))==="Object"&&m6t(e.callee)?"Arguments":n},L6t=zv,w6t=Uv,x6t=L6t?{}.toString:function(){return"[object "+w6t(this)+"]"},E6t=zv,M6t=z5,S6t=x6t;E6t||M6t(Object.prototype,"toString",S6t,{unsafe:!0});var pI={exports:{}},fI={},H6t=H1,C6t=H6t([].slice),A6t=kc,O6t=B5,TI=Yd.f,k6t=C6t,QI=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],I6t=function(t){try{return TI(t)}catch{return k6t(QI)}};fI.f=function(t){return QI&&A6t(t)==="Window"?I6t(t):TI(O6t(t))};var P6t=so,V6t=P6t(function(){if(typeof ArrayBuffer=="function"){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}),R6t=so,N6t=C2,D6t=kc,mI=V6t,ip=Object.isExtensible,B6t=R6t(function(){ip(1)}),F6t=B6t||mI?function(t){return!N6t(t)||mI&&D6t(t)==="ArrayBuffer"?!1:ip?ip(t):!0}:ip,j6t=so,z6t=!j6t(function(){return Object.isExtensible(Object.preventExtensions({}))}),U6t=Ws,G6t=H1,$6t=zd,Z6t=C2,Gv=Gs,W6t=$s.f,gI=Yd,q6t=fI,$v=F6t,X6t=J_,K6t=z6t,yI=!1,o3=X6t("meta"),Y6t=0,Zv=function(t){W6t(t,o3,{value:{objectID:"O"+Y6t++,weakData:{}}})},J6t=function(t,e){if(!Z6t(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!Gv(t,o3)){if(!$v(t))return"F";if(!e)return"E";Zv(t)}return t[o3].objectID},t0t=function(t,e){if(!Gv(t,o3)){if(!$v(t))return!0;if(!e)return!1;Zv(t)}return t[o3].weakData},e0t=function(t){return K6t&&yI&&$v(t)&&!Gv(t,o3)&&Zv(t),t},r0t=function(){n0t.enable=function(){},yI=!0;var t=gI.f,e=G6t([].splice),r={};r[o3]=1,t(r).length&&(gI.f=function(n){for(var i=t(n),o=0,s=i.length;o<s;o++)if(i[o]===o3){e(i,o,1);break}return i},U6t({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:q6t.f}))},n0t=pI.exports={enable:r0t,fastKey:J6t,getWeakData:t0t,onFreeze:e0t};$6t[o3]=!0;var _I=pI.exports,i0t=kc,o0t=H1,s0t=function(t){if(i0t(t)==="Function")return o0t(t)},vI=s0t,a0t=Rc,l0t=W_,c0t=vI(vI.bind),bI=function(t,e){return a0t(t),e===void 0?t:l0t?c0t(t,e):function(){return t.apply(e,arguments)}},u0t=H2,h0t=Nc,d0t=u0t("iterator"),p0t=Array.prototype,f0t=function(t){return t!==void 0&&(h0t.Array===t||p0t[d0t]===t)},T0t=Uv,LI=lv,Q0t=Ic,m0t=Nc,g0t=H2,y0t=g0t("iterator"),wI=function(t){if(!Q0t(t))return LI(t,y0t)||LI(t,"@@iterator")||m0t[T0t(t)]},_0t=i3,v0t=Rc,b0t=a4,L0t=av,w0t=wI,x0t=TypeError,E0t=function(t,e){var r=arguments.length<2?w0t(t):e;if(v0t(r))return b0t(_0t(r,t));throw new x0t(L0t(t)+" is not iterable")},M0t=i3,xI=a4,S0t=lv,Wv=function(t,e,r){var n,i;xI(t);try{if(n=S0t(t,"return"),!n){if(e==="throw")throw r;return r}n=M0t(n,t)}catch(o){i=!0,n=o}if(e==="throw")throw r;if(i)throw n;return xI(n),r},H0t=bI,C0t=i3,A0t=a4,O0t=av,k0t=f0t,I0t=_k,EI=sv,P0t=E0t,V0t=wI,MI=Wv,R0t=TypeError,op=function(t,e){this.stopped=t,this.result=e},SI=op.prototype,HI=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=H0t(e,n),d,f,T,Q,y,b,w,M=function(O){return d&&MI(d,"normal",O),new op(!0,O)},E=function(O){return i?(A0t(O),a?u(O[0],O[1],M):u(O[0],O[1])):a?u(O,M):u(O)};if(o)d=t.iterator;else if(s)d=t;else{if(f=V0t(t),!f)throw new R0t(O0t(t)+" is not iterable");if(k0t(f)){for(T=0,Q=I0t(t);Q>T;T++)if(y=E(t[T]),y&&EI(SI,y))return y;return new op(!1)}d=P0t(t,f)}for(b=o?t.next:d.next;!(w=C0t(b,d)).done;){try{y=E(w.value)}catch(O){MI(d,"throw",O)}if(typeof y=="object"&&y&&EI(SI,y))return y}return new op(!1)},N0t=sv,D0t=TypeError,CI=function(t,e){if(N0t(e,t))return t;throw new D0t("Incorrect invocation")},B0t=H2,AI=B0t("iterator"),OI=!1;try{var F0t=0,kI={next:function(){return{done:!!F0t++}},return:function(){OI=!0}};kI[AI]=function(){return this},Array.from(kI,function(){throw 2})}catch{}var j0t=function(t,e){try{if(!e&&!OI)return!1}catch{return!1}var r=!1;try{var n={};n[AI]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r},z0t=D1,U0t=C2,II=tI,G0t=function(t,e,r){var n,i;return II&&z0t(n=e.constructor)&&n!==r&&U0t(i=n.prototype)&&i!==r.prototype&&II(t,i),t},$0t=Ws,Z0t=Yo,W0t=H1,PI=$k,q0t=z5,X0t=_I,K0t=HI,Y0t=CI,J0t=D1,t5t=Ic,qv=C2,Xv=so,e5t=j0t,r5t=tp,n5t=G0t,i5t=function(t,e,r){var n=t.indexOf("Map")!==-1,i=t.indexOf("Weak")!==-1,o=n?"set":"add",s=Z0t[t],a=s&&s.prototype,u=s,d={},f=function(E){var O=W0t(a[E]);q0t(a,E,E==="add"?function(I){return O(this,I===0?0:I),this}:E==="delete"?function(I){return i&&!qv(I)?!1:O(this,I===0?0:I)}:E==="get"?function(I){return i&&!qv(I)?void 0:O(this,I===0?0:I)}:E==="has"?function(I){return i&&!qv(I)?!1:O(this,I===0?0:I)}:function(I,N){return O(this,I===0?0:I,N),this})},T=PI(t,!J0t(s)||!(i||a.forEach&&!Xv(function(){new s().entries().next()})));if(T)u=r.getConstructor(e,t,n,o),X0t.enable();else if(PI(t,!0)){var Q=new u,y=Q[o](i?{}:-0,1)!==Q,b=Xv(function(){Q.has(1)}),w=e5t(function(E){new s(E)}),M=!i&&Xv(function(){for(var E=new s,O=5;O--;)E[o](O,O);return!E.has(-0)});w||(u=e(function(E,O){Y0t(E,a);var I=n5t(new s,E,u);return t5t(O)||K0t(O,I[o],{that:I,AS_ENTRIES:n}),I}),u.prototype=a,a.constructor=u),(b||M)&&(f("delete"),f("has"),n&&f("get")),(M||y)&&f(o),i&&a.clear&&delete a.clear}return d[t]=u,$0t({global:!0,constructor:!0,forced:u!==s},d),r5t(u,t),i||r.setStrong(u,t,n),u},VI=zk,o5t=$s,RI=function(t,e,r){return r.get&&VI(r.get,e,{getter:!0}),r.set&&VI(r.set,e,{setter:!0}),o5t.f(t,e,r)},s5t=z5,a5t=function(t,e,r){for(var n in e)s5t(t,n,e[n],r);return t},l5t=Vc,c5t=RI,u5t=H2,h5t=Ts,NI=u5t("species"),d5t=function(t){var e=l5t(t);h5t&&e&&!e[NI]&&c5t(e,NI,{configurable:!0,get:function(){return this}})},DI=bv,p5t=RI,BI=a5t,f5t=bI,T5t=CI,Q5t=Ic,m5t=HI,g5t=Bv,FI=Fv,y5t=d5t,zc=Ts,jI=_I.fastKey,zI=qd,UI=zI.set,Kv=zI.getterFor,_5t={getConstructor:function(t,e,r,n){var i=t(function(d,f){T5t(d,o),UI(d,{type:e,index:DI(null),first:void 0,last:void 0,size:0}),zc||(d.size=0),Q5t(f)||m5t(f,d[n],{that:d,AS_ENTRIES:r})}),o=i.prototype,s=Kv(e),a=function(d,f,T){var Q=s(d),y=u(d,f),b,w;return y?y.value=T:(Q.last=y={index:w=jI(f,!0),key:f,value:T,previous:b=Q.last,next:void 0,removed:!1},Q.first||(Q.first=y),b&&(b.next=y),zc?Q.size++:d.size++,w!=="F"&&(Q.index[w]=y)),d},u=function(d,f){var T=s(d),Q=jI(f),y;if(Q!=="F")return T.index[Q];for(y=T.first;y;y=y.next)if(y.key===f)return y};return BI(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=DI(null),zc?f.size=0:d.size=0},delete:function(d){var f=this,T=s(f),Q=u(f,d);if(Q){var y=Q.next,b=Q.previous;delete T.index[Q.index],Q.removed=!0,b&&(b.next=y),y&&(y.previous=b),T.first===Q&&(T.first=y),T.last===Q&&(T.last=b),zc?T.size--:f.size--}return!!Q},forEach:function(d){for(var f=s(this),T=f5t(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)}}),BI(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)}}),zc&&p5t(o,"size",{configurable:!0,get:function(){return s(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=Kv(e),o=Kv(n);g5t(t,e,function(s,a){UI(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,FI(void 0,!0)):FI(a==="keys"?u.key:a==="values"?u.value:[u.key,u.value],!1)},r?"entries":"values",!r,!0),y5t(e)}},v5t=i5t,b5t=_5t;v5t("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},b5t);var Yv=H1,sp=Set.prototype,qs={Set,add:Yv(sp.add),has:Yv(sp.has),remove:Yv(sp.delete),proto:sp},L5t=qs.has,U6=function(t){return L5t(t),t},w5t=i3,G6=function(t,e,r){for(var n=r?t:t.iterator,i=t.next,o,s;!(o=w5t(i,n)).done;)if(s=e(o.value),s!==void 0)return s},GI=H1,x5t=G6,$I=qs,E5t=$I.Set,ZI=$I.proto,M5t=GI(ZI.forEach),WI=GI(ZI.keys),S5t=WI(new E5t).next,Uc=function(t,e,r){return r?x5t({iterator:WI(t),next:S5t},e):M5t(t,e)},qI=qs,H5t=Uc,C5t=qI.Set,A5t=qI.add,Jv=function(t){var e=new C5t;return H5t(t,function(r){A5t(e,r)}),e},O5t=Jk,k5t=qs,Gc=O5t(k5t.proto,"size","get")||function(t){return t.size},I5t=function(t){return{iterator:t,next:t.next,done:!1}},XI=Rc,KI=a4,YI=i3,P5t=jd,V5t=I5t,JI="Invalid size",R5t=RangeError,N5t=TypeError,D5t=Math.max,tP=function(t,e){this.set=t,this.size=D5t(e,0),this.has=XI(t.has),this.keys=XI(t.keys)};tP.prototype={getIterator:function(){return V5t(KI(YI(this.keys,this.set)))},includes:function(t){return YI(this.has,this.set,t)}};var $6=function(t){KI(t);var e=+t.size;if(e!==e)throw new N5t(JI);var r=P5t(e);if(r<0)throw new R5t(JI);return new tP(t,r)},B5t=U6,eP=qs,F5t=Jv,j5t=Gc,z5t=$6,U5t=Uc,G5t=G6,$5t=eP.has,rP=eP.remove,Z5t=function(t){var e=B5t(this),r=z5t(t),n=F5t(e);return j5t(e)<=r.size?U5t(e,function(i){r.includes(i)&&rP(n,i)}):G5t(r.getIterator(),function(i){$5t(e,i)&&rP(n,i)}),n},W5t=Vc,nP=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Z6=function(t){var e=W5t("Set");try{new e()[t](nP(0));try{return new e()[t](nP(-1)),!1}catch{return!0}}catch{return!1}},q5t=Ws,X5t=Z5t,K5t=Z6;q5t({target:"Set",proto:!0,real:!0,forced:!K5t("difference")},{difference:X5t});var Y5t=U6,tb=qs,J5t=Gc,tlt=$6,elt=Uc,rlt=G6,nlt=tb.Set,iP=tb.add,ilt=tb.has,olt=function(t){var e=Y5t(this),r=tlt(t),n=new nlt;return J5t(e)>r.size?rlt(r.getIterator(),function(i){ilt(e,i)&&iP(n,i)}):elt(e,function(i){r.includes(i)&&iP(n,i)}),n},slt=Ws,alt=so,llt=olt,clt=Z6,ult=!clt("intersection")||alt(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});slt({target:"Set",proto:!0,real:!0,forced:ult},{intersection:llt});var hlt=U6,dlt=qs.has,plt=Gc,flt=$6,Tlt=Uc,Qlt=G6,mlt=Wv,glt=function(t){var e=hlt(this),r=flt(t);if(plt(e)<=r.size)return Tlt(e,function(i){if(r.includes(i))return!1},!0)!==!1;var n=r.getIterator();return Qlt(n,function(i){if(dlt(e,i))return mlt(n,"normal",!1)})!==!1},ylt=Ws,_lt=glt,vlt=Z6;ylt({target:"Set",proto:!0,real:!0,forced:!vlt("isDisjointFrom")},{isDisjointFrom:_lt});var blt=U6,Llt=Gc,wlt=Uc,xlt=$6,Elt=function(t){var e=blt(this),r=xlt(t);return Llt(e)>r.size?!1:wlt(e,function(n){if(!r.includes(n))return!1},!0)!==!1},Mlt=Ws,Slt=Elt,Hlt=Z6;Mlt({target:"Set",proto:!0,real:!0,forced:!Hlt("isSubsetOf")},{isSubsetOf:Slt});var Clt=U6,Alt=qs.has,Olt=Gc,klt=$6,Ilt=G6,Plt=Wv,Vlt=function(t){var e=Clt(this),r=klt(t);if(Olt(e)<r.size)return!1;var n=r.getIterator();return Ilt(n,function(i){if(!Alt(e,i))return Plt(n,"normal",!1)})!==!1},Rlt=Ws,Nlt=Vlt,Dlt=Z6;Rlt({target:"Set",proto:!0,real:!0,forced:!Dlt("isSupersetOf")},{isSupersetOf:Nlt});var Blt=U6,eb=qs,Flt=Jv,jlt=$6,zlt=G6,Ult=eb.add,Glt=eb.has,$lt=eb.remove,Zlt=function(t){var e=Blt(this),r=jlt(t).getIterator(),n=Flt(e);return zlt(r,function(i){Glt(e,i)?$lt(n,i):Ult(n,i)}),n},Wlt=Ws,qlt=Zlt,Xlt=Z6;Wlt({target:"Set",proto:!0,real:!0,forced:!Xlt("symmetricDifference")},{symmetricDifference:qlt});var Klt=U6,Ylt=qs.add,Jlt=Jv,t7t=$6,e7t=G6,r7t=function(t){var e=Klt(this),r=t7t(t).getIterator(),n=Jlt(e);return e7t(r,function(i){Ylt(n,i)}),n},n7t=Ws,i7t=r7t,o7t=Z6;n7t({target:"Set",proto:!0,real:!0,forced:!o7t("union")},{union:i7t});var s7t=Uv,a7t=String,oP=function(t){if(s7t(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return a7t(t)},rb=H1,l7t=jd,c7t=oP,u7t=Nd,h7t=rb("".charAt),sP=rb("".charCodeAt),d7t=rb("".slice),aP=function(t){return function(e,r){var n=c7t(u7t(e)),i=l7t(r),o=n.length,s,a;return i<0||i>=o?t?"":void 0:(s=sP(n,i),s<55296||s>56319||i+1===o||(a=sP(n,i+1))<56320||a>57343?t?h7t(n,i):s:t?d7t(n,i,i+2):(s-55296<<10)+(a-56320)+65536)}},p7t={codeAt:aP(!1),charAt:aP(!0)},f7t=p7t.charAt,T7t=oP,lP=qd,Q7t=Bv,cP=Fv,uP="String Iterator",m7t=lP.set,g7t=lP.getterFor(uP);Q7t(String,"String",function(t){m7t(this,{type:uP,string:T7t(t),index:0})},function(){var t=g7t(this),e=t.string,r=t.index,n;return r>=e.length?cP(void 0,!0):(n=f7t(e,r),t.index+=n.length,cP(n,!1))});var y7t=Yo,_7t=y7t,v7t=_7t,b7t=v7t.Set,L7t={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},w7t=iv,nb=w7t("span").classList,hP=nb&&nb.constructor&&nb.constructor.prototype,x7t=hP===Object.prototype?void 0:hP,dP=Yo,pP=L7t,E7t=x7t,$c=p6t,fP=$d,M7t=tp,S7t=H2,ib=S7t("iterator"),ob=$c.values,TP=function(t,e){if(t){if(t[ib]!==ob)try{fP(t,ib,ob)}catch{t[ib]=ob}if(M7t(t,e,!0),pP[e]){for(var r in $c)if(t[r]!==$c[r])try{fP(t,r,$c[r])}catch{t[r]=$c[r]}}}};for(var sb in pP)TP(dP[sb]&&dP[sb].prototype,sb);TP(E7t,"DOMTokenList");var H7t=b7t,C7t=H7t,A7t=C7t,O7t=A7t;const Zc=s4(O7t);var QP={exports:{}};/**
|
|
20
|
+
</div>`,$_=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},Oc={},zO=async function(t,e){return Oc&&Oc.hasOwnProperty(e)?Oc[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"),Oc[e]=i,r(i)}).catch(n=>{console.error("Error:",n),Oc[e]=e,r(e)})})},UO=function(t,e){if(!t||!e)return!1;let r=JSON.stringify(t),n=JSON.stringify(e);return r.indexOf(n)!==-1};let w2t=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 zO(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=$_(e),n=[],i=!1;return r.forEach(o=>{i=!1,UO(t.axons,o)&&(i=!0),UO(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=$_(t.axons),i=$_(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)])}else e([])})})},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,s.length?e(!0):e(!1)}).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 x2t='<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 GO={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(typeof window<"u"?window:E1t,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),y=Q==="[object Array]"||Q==="[object NodeList]"||Q==="[object HTMLCollection]"||Q==="[object Object]"||typeof jQuery<"u"&&f instanceof jQuery||typeof Elements<"u"&&f instanceof Elements,b=0,w=f.length;if(y)for(;b<w;b++)T(f[b]);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 y(){var w=[];this.add=function(O){w.push(O)};var M,E;this.call=function(O){for(M=0,E=w.length;M<E;M++)w[M].call(this,O)},this.remove=function(O){var I=[];for(M=0,E=w.length;M<E;M++)w[M]!==O&&I.push(w[M]);w=I},this.length=function(){return w.length}}function b(w,M){if(w){if(w.resizedAttached){w.resizedAttached.add(M);return}w.resizedAttached=new y,w.resizedAttached.add(M),w.resizeSensor=document.createElement("div"),w.resizeSensor.dir="ltr",w.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(w.resizeSensor,E);var I=document.createElement("div");I.className="resize-sensor-expand",a(I,E);var N=document.createElement("div");a(N,O),I.appendChild(N);var F=document.createElement("div");F.className="resize-sensor-shrink",a(F,E);var G=document.createElement("div");a(G,O),a(G,{width:"200%",height:"200%"}),F.appendChild(G),w.resizeSensor.appendChild(I),w.resizeSensor.appendChild(F),w.appendChild(w.resizeSensor);var Z=window.getComputedStyle(w),et=Z?Z.getPropertyValue("position"):null;et!=="absolute"&&et!=="relative"&&et!=="fixed"&&et!=="sticky"&&(w.style.position="relative");var nt=!1,ut=0,rt=s(w),yt=0,It=0,Zt=!0;Q=0;var ne=function(){var re=w.offsetWidth,de=w.offsetHeight;N.style.width=re+10+"px",N.style.height=de+10+"px",I.scrollLeft=re+10,I.scrollTop=de+10,F.scrollLeft=re+10,F.scrollTop=de+10},te=function(){if(Zt){var re=w.offsetWidth===0&&w.offsetHeight===0;if(re){Q||(Q=n(function(){Q=0,te()}));return}else Zt=!1}ne()};w.resizeSensor.resetSensor=te;var Ae=function(){ut=0,nt&&(yt=rt.width,It=rt.height,w.resizedAttached&&w.resizedAttached.call(rt))},ur=function(){rt=s(w),nt=rt.width!==yt||rt.height!==It,nt&&!ut&&(ut=n(Ae)),te()},Rr=function(re,de,Ue){re.attachEvent?re.attachEvent("on"+de,Ue):re.addEventListener(de,Ue)};Rr(I,"scroll",ur),Rr(F,"scroll",ur),Q=n(function(){Q=0,te()})}}o(f,function(w){b(w,T)}),this.detach=function(w){Q||(i(Q),Q=0),u.detach(f,w)},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,y=0;y<Q.length;y++)Q[y].resizeSensor&&u.reset(Q[y])});document.addEventListener("DOMContentLoaded",function(f){d.observe(document.body,{childList:!0,subtree:!0})})}return u})})(GO);var E2t=GO.exports;const M2t=M1t(E2t);var S2t=Object.defineProperty,H2t=(t,e,r)=>e in t?S2t(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pt=(t,e,r)=>(H2t(t,typeof e!="symbol"?e+"":e,r),r),Z_=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},ct=(t,e,r)=>(Z_(t,e,"read from private field"),r?r.call(t):e.get(t)),Yt=(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)},Te=(t,e,r,n)=>(Z_(t,e,"write to private field"),e.set(t,r),r),ae=(t,e,r)=>(Z_(t,e,"access private method"),r);function C2t(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 s4(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function A2t(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 so=function(t){try{return!!t()}catch{return!0}},O2t=so,W_=!O2t(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),$O=W_,ZO=Function.prototype,q_=ZO.call,k2t=$O&&ZO.bind.bind(q_,q_),H1=$O?k2t:function(t){return function(){return q_.apply(t,arguments)}},WO=H1,I2t=WO({}.toString),P2t=WO("".slice),kc=function(t){return P2t(I2t(t),8,-1)},V2t=H1,R2t=so,N2t=kc,X_=Object,D2t=V2t("".split),B2t=R2t(function(){return!X_("z").propertyIsEnumerable(0)})?function(t){return N2t(t)==="String"?D2t(t,""):X_(t)}:X_,Ic=function(t){return t==null},F2t=Ic,j2t=TypeError,Nd=function(t){if(F2t(t))throw new j2t("Can't call method on "+t);return t},z2t=B2t,U2t=Nd,B5=function(t){return z2t(U2t(t))},Pc=function(t){return t&&t.Math===Math&&t},Yo=Pc(typeof globalThis=="object"&&globalThis)||Pc(typeof window=="object"&&window)||Pc(typeof self=="object"&&self)||Pc(typeof P=="object"&&P)||Pc(typeof P=="object"&&P)||function(){return this}()||Function("return this")(),qO={exports:{}},XO=Yo,G2t=Object.defineProperty,K_=function(t,e){try{G2t(XO,t,{value:e,configurable:!0,writable:!0})}catch{XO[t]=e}return e},$2t=Yo,Z2t=K_,KO="__core-js_shared__",YO=qO.exports=$2t[KO]||Z2t(KO,{});(YO.versions||(YO.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 Y_=qO.exports,JO=Y_,tk=function(t,e){return JO[t]||(JO[t]=e||{})},W2t=Nd,q2t=Object,ek=function(t){return q2t(W2t(t))},X2t=H1,K2t=ek,Y2t=X2t({}.hasOwnProperty),Gs=Object.hasOwn||function(t,e){return Y2t(K2t(t),e)},J2t=H1,tst=0,est=Math.random(),rst=J2t(1 .toString),J_=function(t){return"Symbol("+(t===void 0?"":t)+")_"+rst(++tst+est,36)},nst=typeof navigator<"u"&&String(navigator.userAgent)||"",rk=Yo,tv=nst,nk=rk.process,ik=rk.Deno,ok=nk&&nk.versions||ik&&ik.version,sk=ok&&ok.v8,fs,Dd;sk&&(fs=sk.split("."),Dd=fs[0]>0&&fs[0]<4?1:+(fs[0]+fs[1])),!Dd&&tv&&(fs=tv.match(/Edge\/(\d+)/),(!fs||fs[1]>=74)&&(fs=tv.match(/Chrome\/(\d+)/),fs&&(Dd=+fs[1])));var ist=Dd,ak=ist,ost=so,sst=Yo,ast=sst.String,lk=!!Object.getOwnPropertySymbols&&!ost(function(){var t=Symbol("symbol detection");return!ast(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ak&&ak<41}),lst=lk,ck=lst&&!Symbol.sham&&typeof Symbol.iterator=="symbol",cst=Yo,ust=tk,uk=Gs,hst=J_,dst=lk,pst=ck,F5=cst.Symbol,ev=ust("wks"),fst=pst?F5.for||F5:F5&&F5.withoutSetter||hst,H2=function(t){return uk(ev,t)||(ev[t]=dst&&uk(F5,t)?F5[t]:fst("Symbol."+t)),ev[t]},rv=typeof document=="object"&&document.all,D1=typeof rv>"u"&&rv!==void 0?function(t){return typeof t=="function"||t===rv}:function(t){return typeof t=="function"},Tst=D1,C2=function(t){return typeof t=="object"?t!==null:Tst(t)},Qst=C2,mst=String,gst=TypeError,a4=function(t){if(Qst(t))return t;throw new gst(mst(t)+" is not an object")},hk={},yst=so,Ts=!yst(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),_st=Ts,vst=so,dk=_st&&vst(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),$s={},bst=Yo,pk=C2,nv=bst.document,Lst=pk(nv)&&pk(nv.createElement),iv=function(t){return Lst?nv.createElement(t):{}},wst=Ts,xst=so,Est=iv,fk=!wst&&!xst(function(){return Object.defineProperty(Est("div"),"a",{get:function(){return 7}}).a!==7}),Mst=W_,Bd=Function.prototype.call,i3=Mst?Bd.bind(Bd):function(){return Bd.apply(Bd,arguments)},ov=Yo,Sst=D1,Hst=function(t){return Sst(t)?t:void 0},Vc=function(t,e){return arguments.length<2?Hst(ov[t]):ov[t]&&ov[t][e]},Cst=H1,sv=Cst({}.isPrototypeOf),Ast=Vc,Ost=D1,kst=sv,Ist=ck,Pst=Object,Tk=Ist?function(t){return typeof t=="symbol"}:function(t){var e=Ast("Symbol");return Ost(e)&&kst(e.prototype,Pst(t))},Vst=String,av=function(t){try{return Vst(t)}catch{return"Object"}},Rst=D1,Nst=av,Dst=TypeError,Rc=function(t){if(Rst(t))return t;throw new Dst(Nst(t)+" is not a function")},Bst=Rc,Fst=Ic,lv=function(t,e){var r=t[e];return Fst(r)?void 0:Bst(r)},cv=i3,uv=D1,hv=C2,jst=TypeError,zst=function(t,e){var r,n;if(e==="string"&&uv(r=t.toString)&&!hv(n=cv(r,t))||uv(r=t.valueOf)&&!hv(n=cv(r,t))||e!=="string"&&uv(r=t.toString)&&!hv(n=cv(r,t)))return n;throw new jst("Can't convert object to primitive value")},Ust=i3,Qk=C2,mk=Tk,Gst=lv,$st=zst,Zst=H2,Wst=TypeError,qst=Zst("toPrimitive"),Xst=function(t,e){if(!Qk(t)||mk(t))return t;var r=Gst(t,qst),n;if(r){if(e===void 0&&(e="default"),n=Ust(r,t,e),!Qk(n)||mk(n))return n;throw new Wst("Can't convert object to primitive value")}return e===void 0&&(e="number"),$st(t,e)},Kst=Xst,Yst=Tk,gk=function(t){var e=Kst(t,"string");return Yst(e)?e:e+""},Jst=Ts,tat=fk,eat=dk,Fd=a4,yk=gk,rat=TypeError,dv=Object.defineProperty,nat=Object.getOwnPropertyDescriptor,pv="enumerable",fv="configurable",Tv="writable";$s.f=Jst?eat?function(t,e,r){if(Fd(t),e=yk(e),Fd(r),typeof t=="function"&&e==="prototype"&&"value"in r&&Tv in r&&!r[Tv]){var n=nat(t,e);n&&n[Tv]&&(t[e]=r.value,r={configurable:fv in r?r[fv]:n[fv],enumerable:pv in r?r[pv]:n[pv],writable:!1})}return dv(t,e,r)}:dv:function(t,e,r){if(Fd(t),e=yk(e),Fd(r),tat)try{return dv(t,e,r)}catch{}if("get"in r||"set"in r)throw new rat("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var iat=Math.ceil,oat=Math.floor,sat=Math.trunc||function(t){var e=+t;return(e>0?oat:iat)(e)},aat=sat,jd=function(t){var e=+t;return e!==e||e===0?0:aat(e)},lat=jd,cat=Math.max,uat=Math.min,hat=function(t,e){var r=lat(t);return r<0?cat(r+e,0):uat(r,e)},dat=jd,pat=Math.min,fat=function(t){var e=dat(t);return e>0?pat(e,9007199254740991):0},Tat=fat,_k=function(t){return Tat(t.length)},Qat=B5,mat=hat,gat=_k,vk=function(t){return function(e,r,n){var i=Qat(e),o=gat(i);if(o===0)return!t&&-1;var s=mat(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}},yat={includes:vk(!0),indexOf:vk(!1)},zd={},_at=H1,Qv=Gs,vat=B5,bat=yat.indexOf,Lat=zd,bk=_at([].push),Lk=function(t,e){var r=vat(t),n=0,i=[],o;for(o in r)!Qv(Lat,o)&&Qv(r,o)&&bk(i,o);for(;e.length>n;)Qv(r,o=e[n++])&&(~bat(i,o)||bk(i,o));return i},mv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],wat=Lk,xat=mv,Eat=Object.keys||function(t){return wat(t,xat)},Mat=Ts,Sat=dk,Hat=$s,Cat=a4,Aat=B5,Oat=Eat;hk.f=Mat&&!Sat?Object.defineProperties:function(t,e){Cat(t);for(var r=Aat(e),n=Oat(e),i=n.length,o=0,s;i>o;)Hat.f(t,s=n[o++],r[s]);return t};var kat=Vc,Iat=kat("document","documentElement"),Pat=tk,Vat=J_,wk=Pat("keys"),gv=function(t){return wk[t]||(wk[t]=Vat(t))},Rat=a4,Nat=hk,xk=mv,Dat=zd,Bat=Iat,Fat=iv,jat=gv,Ek=">",Mk="<",yv="prototype",_v="script",Sk=jat("IE_PROTO"),vv=function(){},Hk=function(t){return Mk+_v+Ek+t+Mk+"/"+_v+Ek},Ck=function(t){t.write(Hk("")),t.close();var e=t.parentWindow.Object;return t=null,e},zat=function(){var t=Fat("iframe"),e="java"+_v+":",r;return t.style.display="none",Bat.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(Hk("document.F=Object")),r.close(),r.F},Ud,Gd=function(){try{Ud=new ActiveXObject("htmlfile")}catch{}Gd=typeof document<"u"?document.domain&&Ud?Ck(Ud):zat():Ck(Ud);for(var t=xk.length;t--;)delete Gd[yv][xk[t]];return Gd()};Dat[Sk]=!0;var bv=Object.create||function(t,e){var r;return t!==null?(vv[yv]=Rat(t),r=new vv,vv[yv]=null,r[Sk]=t):r=Gd(),e===void 0?r:Nat.f(r,e)},Uat=H2,Gat=bv,$at=$s.f,Lv=Uat("unscopables"),wv=Array.prototype;wv[Lv]===void 0&&$at(wv,Lv,{configurable:!0,value:Gat(null)});var Zat=function(t){wv[Lv][t]=!0},Nc={},Wat=Yo,qat=D1,Ak=Wat.WeakMap,Xat=qat(Ak)&&/native code/.test(String(Ak)),xv=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},Kat=Ts,Yat=$s,Jat=xv,$d=Kat?function(t,e,r){return Yat.f(t,e,Jat(1,r))}:function(t,e,r){return t[e]=r,t},t3t=Xat,Ok=Yo,e3t=C2,r3t=$d,Ev=Gs,Mv=Y_,n3t=gv,i3t=zd,kk="Object already initialized",Sv=Ok.TypeError,o3t=Ok.WeakMap,Zd,Dc,Wd,s3t=function(t){return Wd(t)?Dc(t):Zd(t,{})},a3t=function(t){return function(e){var r;if(!e3t(e)||(r=Dc(e)).type!==t)throw new Sv("Incompatible receiver, "+t+" required");return r}};if(t3t||Mv.state){var Zs=Mv.state||(Mv.state=new o3t);Zs.get=Zs.get,Zs.has=Zs.has,Zs.set=Zs.set,Zd=function(t,e){if(Zs.has(t))throw new Sv(kk);return e.facade=t,Zs.set(t,e),e},Dc=function(t){return Zs.get(t)||{}},Wd=function(t){return Zs.has(t)}}else{var j5=n3t("state");i3t[j5]=!0,Zd=function(t,e){if(Ev(t,j5))throw new Sv(kk);return e.facade=t,r3t(t,j5,e),e},Dc=function(t){return Ev(t,j5)?t[j5]:{}},Wd=function(t){return Ev(t,j5)}}var qd={set:Zd,get:Dc,has:Wd,enforce:s3t,getterFor:a3t},Hv={},Ik={},Pk={}.propertyIsEnumerable,Vk=Object.getOwnPropertyDescriptor,l3t=Vk&&!Pk.call({1:2},1);Ik.f=l3t?function(t){var e=Vk(this,t);return!!e&&e.enumerable}:Pk;var c3t=Ts,u3t=i3,h3t=Ik,d3t=xv,p3t=B5,f3t=gk,T3t=Gs,Q3t=fk,Rk=Object.getOwnPropertyDescriptor;Hv.f=c3t?Rk:function(t,e){if(t=p3t(t),e=f3t(e),Q3t)try{return Rk(t,e)}catch{}if(T3t(t,e))return d3t(!u3t(h3t.f,t,e),t[e])};var Nk={exports:{}},Cv=Ts,m3t=Gs,Dk=Function.prototype,g3t=Cv&&Object.getOwnPropertyDescriptor,Av=m3t(Dk,"name"),y3t=Av&&(function(){}).name==="something",_3t=Av&&(!Cv||Cv&&g3t(Dk,"name").configurable),Bk={EXISTS:Av,PROPER:y3t,CONFIGURABLE:_3t},v3t=H1,b3t=D1,Ov=Y_,L3t=v3t(Function.toString);b3t(Ov.inspectSource)||(Ov.inspectSource=function(t){return L3t(t)});var w3t=Ov.inspectSource,kv=H1,x3t=so,E3t=D1,Xd=Gs,Iv=Ts,M3t=Bk.CONFIGURABLE,S3t=w3t,Fk=qd,H3t=Fk.enforce,C3t=Fk.get,jk=String,Kd=Object.defineProperty,A3t=kv("".slice),O3t=kv("".replace),k3t=kv([].join),I3t=Iv&&!x3t(function(){return Kd(function(){},"length",{value:8}).length!==8}),P3t=String(String).split("String"),V3t=Nk.exports=function(t,e,r){A3t(jk(e),0,7)==="Symbol("&&(e="["+O3t(jk(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Xd(t,"name")||M3t&&t.name!==e)&&(Iv?Kd(t,"name",{value:e,configurable:!0}):t.name=e),I3t&&r&&Xd(r,"arity")&&t.length!==r.arity&&Kd(t,"length",{value:r.arity});try{r&&Xd(r,"constructor")&&r.constructor?Iv&&Kd(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var n=H3t(t);return Xd(n,"source")||(n.source=k3t(P3t,typeof e=="string"?e:"")),t};Function.prototype.toString=V3t(function(){return E3t(this)&&C3t(this).source||S3t(this)},"toString");var zk=Nk.exports,R3t=D1,N3t=$s,D3t=zk,B3t=K_,z5=function(t,e,r,n){n||(n={});var i=n.enumerable,o=n.name!==void 0?n.name:e;if(R3t(r)&&D3t(r,o,n),n.global)i?t[e]=r:B3t(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=r:N3t.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Yd={},F3t=Lk,j3t=mv,z3t=j3t.concat("length","prototype");Yd.f=Object.getOwnPropertyNames||function(t){return F3t(t,z3t)};var Uk={};Uk.f=Object.getOwnPropertySymbols;var U3t=Vc,G3t=H1,$3t=Yd,Z3t=Uk,W3t=a4,q3t=G3t([].concat),X3t=U3t("Reflect","ownKeys")||function(t){var e=$3t.f(W3t(t)),r=Z3t.f;return r?q3t(e,r(t)):e},Gk=Gs,K3t=X3t,Y3t=Hv,J3t=$s,t4t=function(t,e,r){for(var n=K3t(e),i=J3t.f,o=Y3t.f,s=0;s<n.length;s++){var a=n[s];!Gk(t,a)&&!(r&&Gk(r,a))&&i(t,a,o(e,a))}},e4t=so,r4t=D1,n4t=/#|\.prototype\./,Bc=function(t,e){var r=o4t[i4t(t)];return r===a4t?!0:r===s4t?!1:r4t(e)?e4t(e):!!e},i4t=Bc.normalize=function(t){return String(t).replace(n4t,".").toLowerCase()},o4t=Bc.data={},s4t=Bc.NATIVE="N",a4t=Bc.POLYFILL="P",$k=Bc,Jd=Yo,l4t=Hv.f,c4t=$d,u4t=z5,h4t=K_,d4t=t4t,p4t=$k,Ws=function(t,e){var r=t.target,n=t.global,i=t.stat,o,s,a,u,d,f;if(n?s=Jd:i?s=Jd[r]||h4t(r,{}):s=Jd[r]&&Jd[r].prototype,s)for(a in e){if(d=e[a],t.dontCallGetSet?(f=l4t(s,a),u=f&&f.value):u=s[a],o=p4t(n?a:r+(i?".":"#")+a,t.forced),!o&&u!==void 0){if(typeof d==typeof u)continue;d4t(d,u)}(t.sham||u&&u.sham)&&c4t(d,"sham",!0),u4t(s,a,d,t)}},f4t=so,T4t=!f4t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),Q4t=Gs,m4t=D1,g4t=ek,y4t=gv,_4t=T4t,Zk=y4t("IE_PROTO"),Pv=Object,v4t=Pv.prototype,Wk=_4t?Pv.getPrototypeOf:function(t){var e=g4t(t);if(Q4t(e,Zk))return e[Zk];var r=e.constructor;return m4t(r)&&e instanceof r?r.prototype:e instanceof Pv?v4t:null},b4t=so,L4t=D1,w4t=C2,qk=Wk,x4t=z5,E4t=H2,Vv=E4t("iterator"),Xk=!1,z6,Rv,Nv;[].keys&&(Nv=[].keys(),"next"in Nv?(Rv=qk(qk(Nv)),Rv!==Object.prototype&&(z6=Rv)):Xk=!0);var M4t=!w4t(z6)||b4t(function(){var t={};return z6[Vv].call(t)!==t});M4t&&(z6={}),L4t(z6[Vv])||x4t(z6,Vv,function(){return this});var Kk={IteratorPrototype:z6,BUGGY_SAFARI_ITERATORS:Xk},S4t=$s.f,H4t=Gs,C4t=H2,Yk=C4t("toStringTag"),tp=function(t,e,r){t&&!r&&(t=t.prototype),t&&!H4t(t,Yk)&&S4t(t,Yk,{configurable:!0,value:e})},A4t=Kk.IteratorPrototype,O4t=bv,k4t=xv,I4t=tp,P4t=Nc,V4t=function(){return this},R4t=function(t,e,r,n){var i=e+" Iterator";return t.prototype=O4t(A4t,{next:k4t(+!n,r)}),I4t(t,i,!1),P4t[i]=V4t,t},N4t=H1,D4t=Rc,Jk=function(t,e,r){try{return N4t(D4t(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}},B4t=C2,F4t=function(t){return B4t(t)||t===null},j4t=F4t,z4t=String,U4t=TypeError,G4t=function(t){if(j4t(t))return t;throw new U4t("Can't set "+z4t(t)+" as a prototype")},$4t=Jk,Z4t=C2,W4t=Nd,q4t=G4t,tI=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=$4t(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(n,i){return W4t(n),q4t(i),Z4t(n)&&(t?r(n,i):n.__proto__=i),n}}():void 0),X4t=Ws,K4t=i3,eI=Bk,Y4t=D1,J4t=R4t,rI=Wk,nI=tI,t6t=tp,e6t=$d,Dv=z5,r6t=H2,n6t=Nc,iI=Kk,i6t=eI.PROPER,o6t=eI.CONFIGURABLE,oI=iI.IteratorPrototype,ep=iI.BUGGY_SAFARI_ITERATORS,Fc=r6t("iterator"),sI="keys",jc="values",aI="entries",s6t=function(){return this},Bv=function(t,e,r,n,i,o,s){J4t(r,e,n);var a=function(E){if(E===i&&Q)return Q;if(!ep&&E&&E in f)return f[E];switch(E){case sI:return function(){return new r(this,E)};case jc:return function(){return new r(this,E)};case aI:return function(){return new r(this,E)}}return function(){return new r(this)}},u=e+" Iterator",d=!1,f=t.prototype,T=f[Fc]||f["@@iterator"]||i&&f[i],Q=!ep&&T||a(i),y=e==="Array"&&f.entries||T,b,w,M;if(y&&(b=rI(y.call(new t)),b!==Object.prototype&&b.next&&(rI(b)!==oI&&(nI?nI(b,oI):Y4t(b[Fc])||Dv(b,Fc,s6t)),t6t(b,u,!0))),i6t&&i===jc&&T&&T.name!==jc&&(o6t?e6t(f,"name",jc):(d=!0,Q=function(){return K4t(T,this)})),i)if(w={values:a(jc),keys:o?Q:a(sI),entries:a(aI)},s)for(M in w)(ep||d||!(M in f))&&Dv(f,M,w[M]);else X4t({target:e,proto:!0,forced:ep||d},w);return f[Fc]!==Q&&Dv(f,Fc,Q,{name:i}),n6t[e]=Q,w},Fv=function(t,e){return{value:t,done:e}},a6t=B5,jv=Zat,lI=Nc,cI=qd,l6t=$s.f,c6t=Bv,rp=Fv,u6t=Ts,uI="Array Iterator",h6t=cI.set,d6t=cI.getterFor(uI),p6t=c6t(Array,"Array",function(t,e){h6t(this,{type:uI,target:a6t(t),index:0,kind:e})},function(){var t=d6t(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,rp(void 0,!0);switch(t.kind){case"keys":return rp(r,!1);case"values":return rp(e[r],!1)}return rp([r,e[r]],!1)},"values"),hI=lI.Arguments=lI.Array;if(jv("keys"),jv("values"),jv("entries"),u6t&&hI.name!=="values")try{l6t(hI,"name",{value:"values"})}catch{}var f6t=H2,T6t=f6t("toStringTag"),dI={};dI[T6t]="z";var zv=String(dI)==="[object z]",Q6t=zv,m6t=D1,np=kc,g6t=H2,y6t=g6t("toStringTag"),_6t=Object,v6t=np(function(){return arguments}())==="Arguments",b6t=function(t,e){try{return t[e]}catch{}},Uv=Q6t?np:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=b6t(e=_6t(t),y6t))=="string"?r:v6t?np(e):(n=np(e))==="Object"&&m6t(e.callee)?"Arguments":n},L6t=zv,w6t=Uv,x6t=L6t?{}.toString:function(){return"[object "+w6t(this)+"]"},E6t=zv,M6t=z5,S6t=x6t;E6t||M6t(Object.prototype,"toString",S6t,{unsafe:!0});var pI={exports:{}},fI={},H6t=H1,C6t=H6t([].slice),A6t=kc,O6t=B5,TI=Yd.f,k6t=C6t,QI=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],I6t=function(t){try{return TI(t)}catch{return k6t(QI)}};fI.f=function(t){return QI&&A6t(t)==="Window"?I6t(t):TI(O6t(t))};var P6t=so,V6t=P6t(function(){if(typeof ArrayBuffer=="function"){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}),R6t=so,N6t=C2,D6t=kc,mI=V6t,ip=Object.isExtensible,B6t=R6t(function(){ip(1)}),F6t=B6t||mI?function(t){return!N6t(t)||mI&&D6t(t)==="ArrayBuffer"?!1:ip?ip(t):!0}:ip,j6t=so,z6t=!j6t(function(){return Object.isExtensible(Object.preventExtensions({}))}),U6t=Ws,G6t=H1,$6t=zd,Z6t=C2,Gv=Gs,W6t=$s.f,gI=Yd,q6t=fI,$v=F6t,X6t=J_,K6t=z6t,yI=!1,o3=X6t("meta"),Y6t=0,Zv=function(t){W6t(t,o3,{value:{objectID:"O"+Y6t++,weakData:{}}})},J6t=function(t,e){if(!Z6t(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!Gv(t,o3)){if(!$v(t))return"F";if(!e)return"E";Zv(t)}return t[o3].objectID},t0t=function(t,e){if(!Gv(t,o3)){if(!$v(t))return!0;if(!e)return!1;Zv(t)}return t[o3].weakData},e0t=function(t){return K6t&&yI&&$v(t)&&!Gv(t,o3)&&Zv(t),t},r0t=function(){n0t.enable=function(){},yI=!0;var t=gI.f,e=G6t([].splice),r={};r[o3]=1,t(r).length&&(gI.f=function(n){for(var i=t(n),o=0,s=i.length;o<s;o++)if(i[o]===o3){e(i,o,1);break}return i},U6t({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:q6t.f}))},n0t=pI.exports={enable:r0t,fastKey:J6t,getWeakData:t0t,onFreeze:e0t};$6t[o3]=!0;var _I=pI.exports,i0t=kc,o0t=H1,s0t=function(t){if(i0t(t)==="Function")return o0t(t)},vI=s0t,a0t=Rc,l0t=W_,c0t=vI(vI.bind),bI=function(t,e){return a0t(t),e===void 0?t:l0t?c0t(t,e):function(){return t.apply(e,arguments)}},u0t=H2,h0t=Nc,d0t=u0t("iterator"),p0t=Array.prototype,f0t=function(t){return t!==void 0&&(h0t.Array===t||p0t[d0t]===t)},T0t=Uv,LI=lv,Q0t=Ic,m0t=Nc,g0t=H2,y0t=g0t("iterator"),wI=function(t){if(!Q0t(t))return LI(t,y0t)||LI(t,"@@iterator")||m0t[T0t(t)]},_0t=i3,v0t=Rc,b0t=a4,L0t=av,w0t=wI,x0t=TypeError,E0t=function(t,e){var r=arguments.length<2?w0t(t):e;if(v0t(r))return b0t(_0t(r,t));throw new x0t(L0t(t)+" is not iterable")},M0t=i3,xI=a4,S0t=lv,Wv=function(t,e,r){var n,i;xI(t);try{if(n=S0t(t,"return"),!n){if(e==="throw")throw r;return r}n=M0t(n,t)}catch(o){i=!0,n=o}if(e==="throw")throw r;if(i)throw n;return xI(n),r},H0t=bI,C0t=i3,A0t=a4,O0t=av,k0t=f0t,I0t=_k,EI=sv,P0t=E0t,V0t=wI,MI=Wv,R0t=TypeError,op=function(t,e){this.stopped=t,this.result=e},SI=op.prototype,HI=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=H0t(e,n),d,f,T,Q,y,b,w,M=function(O){return d&&MI(d,"normal",O),new op(!0,O)},E=function(O){return i?(A0t(O),a?u(O[0],O[1],M):u(O[0],O[1])):a?u(O,M):u(O)};if(o)d=t.iterator;else if(s)d=t;else{if(f=V0t(t),!f)throw new R0t(O0t(t)+" is not iterable");if(k0t(f)){for(T=0,Q=I0t(t);Q>T;T++)if(y=E(t[T]),y&&EI(SI,y))return y;return new op(!1)}d=P0t(t,f)}for(b=o?t.next:d.next;!(w=C0t(b,d)).done;){try{y=E(w.value)}catch(O){MI(d,"throw",O)}if(typeof y=="object"&&y&&EI(SI,y))return y}return new op(!1)},N0t=sv,D0t=TypeError,CI=function(t,e){if(N0t(e,t))return t;throw new D0t("Incorrect invocation")},B0t=H2,AI=B0t("iterator"),OI=!1;try{var F0t=0,kI={next:function(){return{done:!!F0t++}},return:function(){OI=!0}};kI[AI]=function(){return this},Array.from(kI,function(){throw 2})}catch{}var j0t=function(t,e){try{if(!e&&!OI)return!1}catch{return!1}var r=!1;try{var n={};n[AI]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch{}return r},z0t=D1,U0t=C2,II=tI,G0t=function(t,e,r){var n,i;return II&&z0t(n=e.constructor)&&n!==r&&U0t(i=n.prototype)&&i!==r.prototype&&II(t,i),t},$0t=Ws,Z0t=Yo,W0t=H1,PI=$k,q0t=z5,X0t=_I,K0t=HI,Y0t=CI,J0t=D1,t5t=Ic,qv=C2,Xv=so,e5t=j0t,r5t=tp,n5t=G0t,i5t=function(t,e,r){var n=t.indexOf("Map")!==-1,i=t.indexOf("Weak")!==-1,o=n?"set":"add",s=Z0t[t],a=s&&s.prototype,u=s,d={},f=function(E){var O=W0t(a[E]);q0t(a,E,E==="add"?function(I){return O(this,I===0?0:I),this}:E==="delete"?function(I){return i&&!qv(I)?!1:O(this,I===0?0:I)}:E==="get"?function(I){return i&&!qv(I)?void 0:O(this,I===0?0:I)}:E==="has"?function(I){return i&&!qv(I)?!1:O(this,I===0?0:I)}:function(I,N){return O(this,I===0?0:I,N),this})},T=PI(t,!J0t(s)||!(i||a.forEach&&!Xv(function(){new s().entries().next()})));if(T)u=r.getConstructor(e,t,n,o),X0t.enable();else if(PI(t,!0)){var Q=new u,y=Q[o](i?{}:-0,1)!==Q,b=Xv(function(){Q.has(1)}),w=e5t(function(E){new s(E)}),M=!i&&Xv(function(){for(var E=new s,O=5;O--;)E[o](O,O);return!E.has(-0)});w||(u=e(function(E,O){Y0t(E,a);var I=n5t(new s,E,u);return t5t(O)||K0t(O,I[o],{that:I,AS_ENTRIES:n}),I}),u.prototype=a,a.constructor=u),(b||M)&&(f("delete"),f("has"),n&&f("get")),(M||y)&&f(o),i&&a.clear&&delete a.clear}return d[t]=u,$0t({global:!0,constructor:!0,forced:u!==s},d),r5t(u,t),i||r.setStrong(u,t,n),u},VI=zk,o5t=$s,RI=function(t,e,r){return r.get&&VI(r.get,e,{getter:!0}),r.set&&VI(r.set,e,{setter:!0}),o5t.f(t,e,r)},s5t=z5,a5t=function(t,e,r){for(var n in e)s5t(t,n,e[n],r);return t},l5t=Vc,c5t=RI,u5t=H2,h5t=Ts,NI=u5t("species"),d5t=function(t){var e=l5t(t);h5t&&e&&!e[NI]&&c5t(e,NI,{configurable:!0,get:function(){return this}})},DI=bv,p5t=RI,BI=a5t,f5t=bI,T5t=CI,Q5t=Ic,m5t=HI,g5t=Bv,FI=Fv,y5t=d5t,zc=Ts,jI=_I.fastKey,zI=qd,UI=zI.set,Kv=zI.getterFor,_5t={getConstructor:function(t,e,r,n){var i=t(function(d,f){T5t(d,o),UI(d,{type:e,index:DI(null),first:void 0,last:void 0,size:0}),zc||(d.size=0),Q5t(f)||m5t(f,d[n],{that:d,AS_ENTRIES:r})}),o=i.prototype,s=Kv(e),a=function(d,f,T){var Q=s(d),y=u(d,f),b,w;return y?y.value=T:(Q.last=y={index:w=jI(f,!0),key:f,value:T,previous:b=Q.last,next:void 0,removed:!1},Q.first||(Q.first=y),b&&(b.next=y),zc?Q.size++:d.size++,w!=="F"&&(Q.index[w]=y)),d},u=function(d,f){var T=s(d),Q=jI(f),y;if(Q!=="F")return T.index[Q];for(y=T.first;y;y=y.next)if(y.key===f)return y};return BI(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=DI(null),zc?f.size=0:d.size=0},delete:function(d){var f=this,T=s(f),Q=u(f,d);if(Q){var y=Q.next,b=Q.previous;delete T.index[Q.index],Q.removed=!0,b&&(b.next=y),y&&(y.previous=b),T.first===Q&&(T.first=y),T.last===Q&&(T.last=b),zc?T.size--:f.size--}return!!Q},forEach:function(d){for(var f=s(this),T=f5t(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)}}),BI(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)}}),zc&&p5t(o,"size",{configurable:!0,get:function(){return s(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=Kv(e),o=Kv(n);g5t(t,e,function(s,a){UI(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,FI(void 0,!0)):FI(a==="keys"?u.key:a==="values"?u.value:[u.key,u.value],!1)},r?"entries":"values",!r,!0),y5t(e)}},v5t=i5t,b5t=_5t;v5t("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},b5t);var Yv=H1,sp=Set.prototype,qs={Set,add:Yv(sp.add),has:Yv(sp.has),remove:Yv(sp.delete),proto:sp},L5t=qs.has,U6=function(t){return L5t(t),t},w5t=i3,G6=function(t,e,r){for(var n=r?t:t.iterator,i=t.next,o,s;!(o=w5t(i,n)).done;)if(s=e(o.value),s!==void 0)return s},GI=H1,x5t=G6,$I=qs,E5t=$I.Set,ZI=$I.proto,M5t=GI(ZI.forEach),WI=GI(ZI.keys),S5t=WI(new E5t).next,Uc=function(t,e,r){return r?x5t({iterator:WI(t),next:S5t},e):M5t(t,e)},qI=qs,H5t=Uc,C5t=qI.Set,A5t=qI.add,Jv=function(t){var e=new C5t;return H5t(t,function(r){A5t(e,r)}),e},O5t=Jk,k5t=qs,Gc=O5t(k5t.proto,"size","get")||function(t){return t.size},I5t=function(t){return{iterator:t,next:t.next,done:!1}},XI=Rc,KI=a4,YI=i3,P5t=jd,V5t=I5t,JI="Invalid size",R5t=RangeError,N5t=TypeError,D5t=Math.max,tP=function(t,e){this.set=t,this.size=D5t(e,0),this.has=XI(t.has),this.keys=XI(t.keys)};tP.prototype={getIterator:function(){return V5t(KI(YI(this.keys,this.set)))},includes:function(t){return YI(this.has,this.set,t)}};var $6=function(t){KI(t);var e=+t.size;if(e!==e)throw new N5t(JI);var r=P5t(e);if(r<0)throw new R5t(JI);return new tP(t,r)},B5t=U6,eP=qs,F5t=Jv,j5t=Gc,z5t=$6,U5t=Uc,G5t=G6,$5t=eP.has,rP=eP.remove,Z5t=function(t){var e=B5t(this),r=z5t(t),n=F5t(e);return j5t(e)<=r.size?U5t(e,function(i){r.includes(i)&&rP(n,i)}):G5t(r.getIterator(),function(i){$5t(e,i)&&rP(n,i)}),n},W5t=Vc,nP=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},Z6=function(t){var e=W5t("Set");try{new e()[t](nP(0));try{return new e()[t](nP(-1)),!1}catch{return!0}}catch{return!1}},q5t=Ws,X5t=Z5t,K5t=Z6;q5t({target:"Set",proto:!0,real:!0,forced:!K5t("difference")},{difference:X5t});var Y5t=U6,tb=qs,J5t=Gc,tlt=$6,elt=Uc,rlt=G6,nlt=tb.Set,iP=tb.add,ilt=tb.has,olt=function(t){var e=Y5t(this),r=tlt(t),n=new nlt;return J5t(e)>r.size?rlt(r.getIterator(),function(i){ilt(e,i)&&iP(n,i)}):elt(e,function(i){r.includes(i)&&iP(n,i)}),n},slt=Ws,alt=so,llt=olt,clt=Z6,ult=!clt("intersection")||alt(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});slt({target:"Set",proto:!0,real:!0,forced:ult},{intersection:llt});var hlt=U6,dlt=qs.has,plt=Gc,flt=$6,Tlt=Uc,Qlt=G6,mlt=Wv,glt=function(t){var e=hlt(this),r=flt(t);if(plt(e)<=r.size)return Tlt(e,function(i){if(r.includes(i))return!1},!0)!==!1;var n=r.getIterator();return Qlt(n,function(i){if(dlt(e,i))return mlt(n,"normal",!1)})!==!1},ylt=Ws,_lt=glt,vlt=Z6;ylt({target:"Set",proto:!0,real:!0,forced:!vlt("isDisjointFrom")},{isDisjointFrom:_lt});var blt=U6,Llt=Gc,wlt=Uc,xlt=$6,Elt=function(t){var e=blt(this),r=xlt(t);return Llt(e)>r.size?!1:wlt(e,function(n){if(!r.includes(n))return!1},!0)!==!1},Mlt=Ws,Slt=Elt,Hlt=Z6;Mlt({target:"Set",proto:!0,real:!0,forced:!Hlt("isSubsetOf")},{isSubsetOf:Slt});var Clt=U6,Alt=qs.has,Olt=Gc,klt=$6,Ilt=G6,Plt=Wv,Vlt=function(t){var e=Clt(this),r=klt(t);if(Olt(e)<r.size)return!1;var n=r.getIterator();return Ilt(n,function(i){if(!Alt(e,i))return Plt(n,"normal",!1)})!==!1},Rlt=Ws,Nlt=Vlt,Dlt=Z6;Rlt({target:"Set",proto:!0,real:!0,forced:!Dlt("isSupersetOf")},{isSupersetOf:Nlt});var Blt=U6,eb=qs,Flt=Jv,jlt=$6,zlt=G6,Ult=eb.add,Glt=eb.has,$lt=eb.remove,Zlt=function(t){var e=Blt(this),r=jlt(t).getIterator(),n=Flt(e);return zlt(r,function(i){Glt(e,i)?$lt(n,i):Ult(n,i)}),n},Wlt=Ws,qlt=Zlt,Xlt=Z6;Wlt({target:"Set",proto:!0,real:!0,forced:!Xlt("symmetricDifference")},{symmetricDifference:qlt});var Klt=U6,Ylt=qs.add,Jlt=Jv,t7t=$6,e7t=G6,r7t=function(t){var e=Klt(this),r=t7t(t).getIterator(),n=Jlt(e);return e7t(r,function(i){Ylt(n,i)}),n},n7t=Ws,i7t=r7t,o7t=Z6;n7t({target:"Set",proto:!0,real:!0,forced:!o7t("union")},{union:i7t});var s7t=Uv,a7t=String,oP=function(t){if(s7t(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return a7t(t)},rb=H1,l7t=jd,c7t=oP,u7t=Nd,h7t=rb("".charAt),sP=rb("".charCodeAt),d7t=rb("".slice),aP=function(t){return function(e,r){var n=c7t(u7t(e)),i=l7t(r),o=n.length,s,a;return i<0||i>=o?t?"":void 0:(s=sP(n,i),s<55296||s>56319||i+1===o||(a=sP(n,i+1))<56320||a>57343?t?h7t(n,i):s:t?d7t(n,i,i+2):(s-55296<<10)+(a-56320)+65536)}},p7t={codeAt:aP(!1),charAt:aP(!0)},f7t=p7t.charAt,T7t=oP,lP=qd,Q7t=Bv,cP=Fv,uP="String Iterator",m7t=lP.set,g7t=lP.getterFor(uP);Q7t(String,"String",function(t){m7t(this,{type:uP,string:T7t(t),index:0})},function(){var t=g7t(this),e=t.string,r=t.index,n;return r>=e.length?cP(void 0,!0):(n=f7t(e,r),t.index+=n.length,cP(n,!1))});var y7t=Yo,_7t=y7t,v7t=_7t,b7t=v7t.Set,L7t={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},w7t=iv,nb=w7t("span").classList,hP=nb&&nb.constructor&&nb.constructor.prototype,x7t=hP===Object.prototype?void 0:hP,dP=Yo,pP=L7t,E7t=x7t,$c=p6t,fP=$d,M7t=tp,S7t=H2,ib=S7t("iterator"),ob=$c.values,TP=function(t,e){if(t){if(t[ib]!==ob)try{fP(t,ib,ob)}catch{t[ib]=ob}if(M7t(t,e,!0),pP[e]){for(var r in $c)if(t[r]!==$c[r])try{fP(t,r,$c[r])}catch{t[r]=$c[r]}}}};for(var sb in pP)TP(dP[sb]&&dP[sb].prototype,sb);TP(E7t,"DOMTokenList");var H7t=b7t,C7t=H7t,A7t=C7t,O7t=A7t;const Zc=s4(O7t);var QP={exports:{}};/**
|
|
21
21
|
* MapLibre GL JS
|
|
22
22
|
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.0/LICENSE.txt
|
|
23
23
|
*/(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{D(g.next(U))}catch(W){C(W)}}function k(U){try{D(g.throw(U))}catch(W){C(W)}}function D(U){var W;U.done?x(U.value):(W=U.value,W instanceof p?W:new p(function(K){K(W)})).then(A,k)}D((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=y;function y(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}y.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 b=u(Q);let w,M;function E(){return w==null&&(w=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),w}function O(){if(M==null&&(M=!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){M=!0;break}}}return M||!1}function I(h,c,p,g){const x=new b(h,c,p,g);return C=>x.solve(C)}const N=I(.25,.1,.25,1);function F(h,c,p){return Math.min(p,Math.max(c,h))}function G(h,c,p){const g=p-c,x=((h-c)%g+g)%g+c;return x===c?p:x}function Z(h,...c){for(const p of c)for(const g in p)h[g]=p[g];return h}let et=1;function nt(h,c,p){const g={};for(const x in h)g[x]=c.call(this,h[x],x,h);return g}function ut(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?nt(h,rt):h}const yt={};function It(h){yt[h]||(typeof console<"u"&&console.warn(h),yt[h]=!0)}function Zt(h,c,p){return(p.y-h.y)*(c.x-h.x)>(c.y-h.y)*(p.x-h.x)}function ne(h){return typeof WorkerGlobalScope<"u"&&h!==void 0&&h instanceof WorkerGlobalScope}let te=null;function Ae(h){return typeof ImageBitmap<"u"&&h instanceof ImageBitmap}const ur="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Rr(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"),D=new Uint8ClampedArray(g*x*4);if(yield C.copyTo(D,function(U,W,K,tt,at){const ht=4*Math.max(-W,0),Tt=(Math.max(0,K)-K)*tt*4+ht,Lt=4*tt,Et=Math.max(0,W),Gt=Math.max(0,K);return{rect:{x:Et,y:Gt,width:Math.min(U.width,W+tt)-Et,height:Math.min(U.height,K+at)-Gt},layout:[{offset:Tt,stride:Lt}]}}(h,c,p,g,x)),k)for(let U=0;U<D.length;U+=4){const W=D[U];D[U]=D[U+2],D[U+2]=W}return D}finally{C.close()}})}let re,de;const Ue="AbortError";function Ee(){return new Error(Ue)}const Ze={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Ge(h){return Ze.REGISTERED_PROTOCOLS[h.substring(0,h.indexOf("://"))]}const ke="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 Kt=()=>ne(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,pe=function(h,c){if(/:\/\//.test(h.url)&&!/^https?:|^file:/.test(h.url)){const g=Ge(h.url);if(g)return g(h,c);if(ne(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:h,targetMapId:ke},c)}if(!(/^file:/.test(p=h.url)||/^file:/.test(Kt())&&!/^\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:Kt(),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 D=yield k;if(x.signal.aborted)throw Ee();return{data:D,cacheControl:A.headers.get("Cache-Control"),expires:A.headers.get("Expires")}})}(h,c);if(ne(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:h,mustQueue:!0,targetMapId:ke},c)}var p;return function(g,x){return new Promise((C,A)=>{var k;const D=new XMLHttpRequest;D.open(g.method||"GET",g.url,!0),g.type!=="arrayBuffer"&&g.type!=="image"||(D.responseType="arraybuffer");for(const U in g.headers)D.setRequestHeader(U,g.headers[U]);g.type==="json"&&(D.responseType="text",!((k=g.headers)===null||k===void 0)&&k.Accept||D.setRequestHeader("Accept","application/json")),D.withCredentials=g.credentials==="include",D.onerror=()=>{A(new Error(D.statusText))},D.onload=()=>{if(!x.signal.aborted)if((D.status>=200&&D.status<300||D.status===0)&&D.response!==null){let U=D.response;if(g.type==="json")try{U=JSON.parse(D.response)}catch(W){return void A(W)}C({data:U,cacheControl:D.getResponseHeader("Cache-Control"),expires:D.getResponseHeader("Expires")})}else{const U=new Blob([D.response],{type:D.getResponseHeader("Content-Type")});A(new Ut(D.status,D.statusText,g.url,U))}},x.signal.addEventListener("abort",()=>{D.abort(),A(Ee())}),D.send(g.body)})}(h,c)};function ce(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 De(h,c,p){p[h]&&p[h].indexOf(c)!==-1||(p[h]=p[h]||[],p[h].push(c))}function sr(h,c,p){if(p&&p[h]){const g=p[h].indexOf(c);g!==-1&&p[h].splice(g,1)}}class je{constructor(c,p={}){Z(this,p),this.type=c}}class Be extends je{constructor(c,p={}){super("error",Z({error:c},p))}}class Je{on(c,p){return this._listeners=this._listeners||{},De(c,p,this._listeners),this}off(c,p){return sr(c,p,this._listeners),sr(c,p,this._oneTimeListeners),this}once(c,p){return p?(this._oneTimeListeners=this._oneTimeListeners||{},De(c,p,this._oneTimeListeners),this):new Promise(g=>this.once(c,g))}fire(c,p){typeof c=="string"&&(c=new je(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)sr(g,k,this._oneTimeListeners),k.call(this,c);const A=this._eventedParent;A&&(Z(c,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),A.fire(c))}else c instanceof Be&&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 Ot={$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 zr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Fr(h,c){const p={};for(const g in h)g!=="ref"&&(p[g]=h[g]);return zr.forEach(g=>{g in c&&(p[g]=c[g])}),p}function vr(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(!vr(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(!vr(h[p],c[p]))return!1;return!0}return h===c}function Er(h,c){h.push(c)}function Kr(h,c,p){Er(p,{command:"addSource",args:[h,c[h]]})}function Hi(h,c,p){Er(c,{command:"removeSource",args:[h]}),p[h]=!0}function Fi(h,c,p,g){Hi(h,p,g),Kr(h,c,p)}function gi(h,c,p){let g;for(g in h[p])if(Object.prototype.hasOwnProperty.call(h[p],g)&&g!=="data"&&!vr(h[p][g],c[p][g]))return!1;for(g in c[p])if(Object.prototype.hasOwnProperty.call(c[p],g)&&g!=="data"&&!vr(h[p][g],c[p][g]))return!1;return!0}function ai(h,c,p,g,x,C){h=h||{},c=c||{};for(const A in h)Object.prototype.hasOwnProperty.call(h,A)&&(vr(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)&&(vr(h[A],c[A])||p.push({command:C,args:[g,A,c[A],x]}))}function yi(h){return h.id}function Zi(h,c){return h[c.id]=c,h}class Qe{constructor(c,p,g,x){this.message=(c?`${c}: `:"")+g,x&&(this.identifier=x),p!=null&&p.__line__&&(this.line=p.__line__)}}function li(h,...c){for(const p of c)for(const g in p)h[g]=p[g];return h}class jn extends Error{constructor(c,p){super(p),this.message=p,this.key=c}}class pi{constructor(c,p=[]){this.parent=c,this.bindings={};for(const[g,x]of p)this.bindings[g]=x}concat(c){return new pi(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 ji={kind:"null"},be={kind:"number"},Sr={kind:"string"},dr={kind:"boolean"},bn={kind:"color"},i1={kind:"object"},Tr={kind:"value"},_i={kind:"collator"},m1={kind:"formatted"},vi={kind:"padding"},Ln={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 ft=[ji,be,Sr,dr,bn,m1,i1,ot(Tr),vi,Ln,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 ft)if(!_t(p,c))return null}}return`Expected ${st(h)} but found ${st(c)} instead.`}function Ct(h,c){return c.some(p=>p.kind===h.kind)}function Vt(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 jt(h,c){return h.kind==="array"&&c.kind==="array"?h.itemType.kind===c.itemType.kind&&typeof h.N=="number":h.kind===c.kind}const St=.96422,Xt=.82521,ie=4/29,qt=6/29,_e=3*qt*qt,Ke=qt*qt*qt,Rt=Math.PI/180,he=180/Math.PI;function xe(h){return(h%=360)<0&&(h+=360),h}function tr([h,c,p,g]){let x,C;const A=an((.2225045*(h=br(h))+.7168786*(c=br(c))+.0606169*(p=br(p)))/1);h===c&&c===p?x=C=A:(x=an((.4360747*h+.3850649*c+.1430804*p)/St),C=an((.0139322*h+.0971045*c+.7141733*p)/Xt));const k=116*A-16;return[k<0?0:k,500*(x-A),200*(A-C),g]}function br(h){return h<=.04045?h/12.92:Math.pow((h+.055)/1.055,2.4)}function an(h){return h>Ke?Math.pow(h,1/3):h/_e+ie}function Ar([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*Cr(x),C=St*Cr(C),A=Xt*Cr(A),[pr(3.1338561*C-1.6168667*x-.4906146*A),pr(-.9787684*C+1.9161415*x+.033454*A),pr(.0719453*C-.2289914*x+1.4052427*A),g]}function pr(h){return(h=h<=.00304?12.92*h:1.055*Math.pow(h,1/2.4)-.055)<0?0:h>1?1:h}function Cr(h){return h>qt?h*h*h:_e*(h-ie)}function Wr(h){return parseInt(h.padEnd(2,h),16)/255}function zn(h,c){return ci(c?h/100:h,0,1)}function ci(h,c,p){return Math.min(Math.max(c,h),p)}function bi(h){return!h.some(Number.isNaN)}const G2={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 jr{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 jr)return c;if(typeof c!="string")return;const p=function(g){if((g=g.toLowerCase().trim())==="transparent")return[0,0,0,0];const x=G2[g];if(x){const[A,k,D]=x;return[A/255,k/255,D/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[Wr(g.slice(k,k+=A)),Wr(g.slice(k,k+=A)),Wr(g.slice(k,k+=A)),Wr(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,D,U,W,K,tt,at,ht,Tt,Lt,Et,Gt]=A,Pt=[W||" ",at||" ",Lt].join("");if(Pt===" "||Pt===" /"||Pt===",,"||Pt===",,,"){const Bt=[U,tt,Tt].join(""),Jt=Bt==="%%%"?100:Bt===""?255:0;if(Jt){const ge=[ci(+D/Jt,0,1),ci(+K/Jt,0,1),ci(+ht/Jt,0,1),Et?zn(+Et,Gt):1];if(bi(ge))return ge}}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,D,U,W,K,tt,at,ht]=C,Tt=[D||" ",W||" ",tt].join("");if(Tt===" "||Tt===" /"||Tt===",,"||Tt===",,,"){const Lt=[+k,ci(+U,0,100),ci(+K,0,100),at?zn(+at,ht):1];if(bi(Lt))return function([Et,Gt,Pt,Bt]){function Jt(ge){const ze=(ge+Et/30)%12,mr=Gt*Math.min(Pt,1-Pt);return Pt-mr*Math.max(-1,Math.min(ze-3,9-ze,1))}return Et=xe(Et),Gt/=100,Pt/=100,[Jt(0),Jt(8),Jt(4),Bt]}(Lt)}}}(c);return p?new jr(...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]=tr(c),A=Math.sqrt(g*g+x*x);return[Math.round(1e4*A)?xe(Math.atan2(x,g)*he):NaN,A,p,C]}(this.rgb))}get lab(){return this.overwriteGetter("lab",tr(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})`}}jr.black=new jr(0,0,0,1),jr.white=new jr(1,1,1,1),jr.transparent=new jr(0,0,0,0),jr.red=new jr(1,0,0,1);class Ci{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 G1{constructor(c,p,g,x,C){this.text=c,this.image=p,this.scale=g,this.fontStack=x,this.textColor=C}}class Dr{constructor(c){this.sections=c}static fromString(c){return new Dr([new G1(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 Dr?c:Dr.fromString(c)}toString(){return this.sections.length===0?"":this.sections.map(c=>c.text).join("")}}class Un{constructor(c){this.values=c.slice()}static parse(c){if(c instanceof Un)return c;if(typeof c=="number")return new Un([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 Un(c)}}toString(){return JSON.stringify(this.values)}}const $2=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ln{constructor(c){this.values=c.slice()}static parse(c){if(c instanceof ln)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"||!$2.has(g)||!Array.isArray(x)||x.length!==2||typeof x[0]!="number"||typeof x[1]!="number")return}return new ln(c)}}toString(){return JSON.stringify(this.values)}}class Yr{constructor(c){this.name=c.name,this.available=c.available}toString(){return this.name}static fromString(c){return c?new Yr({name:c,available:!1}):null}}function $1(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 Wi(h){if(h===null||typeof h=="string"||typeof h=="boolean"||typeof h=="number"||h instanceof jr||h instanceof Ci||h instanceof Dr||h instanceof Un||h instanceof ln||h instanceof Yr)return!0;if(Array.isArray(h)){for(const c of h)if(!Wi(c))return!1;return!0}if(typeof h=="object"){for(const c in h)if(!Wi(h[c]))return!1;return!0}return!1}function nn(h){if(h===null)return ji;if(typeof h=="string")return Sr;if(typeof h=="boolean")return dr;if(typeof h=="number")return be;if(h instanceof jr)return bn;if(h instanceof Ci)return _i;if(h instanceof Dr)return m1;if(h instanceof Un)return vi;if(h instanceof ln)return xt;if(h instanceof Yr)return Ln;if(Array.isArray(h)){const c=h.length;let p;for(const g of h){const x=nn(g);if(p){if(p===x)continue;p=Tr;break}p=x}return ot(p||Tr,c)}return i1}function Ai(h){const c=typeof h;return h===null?"":c==="string"||c==="number"||c==="boolean"?String(h):h instanceof jr||h instanceof Dr||h instanceof Un||h instanceof ln||h instanceof Yr?h.toString():JSON.stringify(h)}class qi{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(!Wi(c[1]))return p.error("invalid value");const g=c[1];let x=nn(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 qi(x,g)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class On{constructor(c){this.name="ExpressionEvaluationError",this.message=c}toJSON(){return this.message}}const Z2={string:Sr,number:be,boolean:dr,object:i1};class Xi{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,D;if(c.length>2){const U=c[1];if(typeof U!="string"||!(U in Z2)||U==="object")return p.error('The item type argument of "array" must be one of string, number, boolean',1);k=Z2[U],x++}else k=Tr;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);D=c[2],x++}g=ot(k,D)}else{if(!Z2[C])throw new Error(`Types doesn't contain name = ${C}`);g=Z2[C]}const A=[];for(;x<c.length;x++){const k=p.parse(c[x],x,Tr);if(!k)return null;A.push(k)}return new Xi(g,A)}evaluate(c){for(let p=0;p<this.args.length;p++){const g=this.args[p].evaluate(c);if(!_t(this.type,nn(g)))return g;if(p===this.args.length-1)throw new On(`Expected value to be of type ${st(this.type)}, but found ${st(nn(g))} instead.`)}throw new Error}eachChild(c){this.args.forEach(c)}outputDefined(){return this.args.every(c=>c.outputDefined())}}const u2={"to-boolean":dr,"to-color":bn,"to-number":be,"to-string":Sr};class zi{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(!u2[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=u2[g],C=[];for(let A=1;A<c.length;A++){const k=p.parse(c[A],A,Tr);if(!k)return null;C.push(k)}return new zi(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 jr)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.`:$1(p[0],p[1],p[2],p[3]),!g))return new jr(p[0]/255,p[1]/255,p[2]/255,p[3])}throw new On(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=Un.parse(p);if(x)return x}throw new On(`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=ln.parse(p);if(x)return x}throw new On(`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 On(`Could not convert ${JSON.stringify(p)} to number.`)}case"formatted":return Dr.fromString(Ai(this.args[0].evaluate(c)));case"resolvedImage":return Yr.fromString(Ai(this.args[0].evaluate(c)));default:return Ai(this.args[0].evaluate(c))}}eachChild(c){this.args.forEach(c)}outputDefined(){return this.args.every(c=>c.outputDefined())}}const fo=["Unknown","Point","LineString","Polygon"];class Ia{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"?fo[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]=jr.parse(c)),p}}class No{constructor(c,p,g=[],x,C=new pi,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 Xi(C,[x]):A==="coerce"?new zi(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,D=A.type;if(k.kind!=="string"&&k.kind!=="number"&&k.kind!=="boolean"&&k.kind!=="object"&&k.kind!=="array"||D.kind!=="value")if(k.kind!=="color"&&k.kind!=="formatted"&&k.kind!=="resolvedImage"||D.kind!=="value"&&D.kind!=="string")if(k.kind!=="padding"||D.kind!=="value"&&D.kind!=="number"&&D.kind!=="array")if(k.kind!=="variableAnchorOffsetCollection"||D.kind!=="value"&&D.kind!=="array"){if(this.checkSubtype(k,D))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 qi)&&A.type.kind!=="resolvedImage"&&this._isConstant(A)){const k=new Ia;try{A=new qi(A.type,A.evaluate(k))}catch(D){return this.error(D.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 No(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 jn(g,c))}checkSubtype(c,p){const g=_t(c,p);return g&&this.error(g),g}}class Z1{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 Z1(g,x):null}outputDefined(){return this.result.outputDefined()}}class Br{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 Br(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,be),x=p.parse(c[2],2,ot(p.expectedType||Tr));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 On(`Array index out of bounds: ${p} < 0.`);if(p>=g.length)throw new On(`Array index out of bounds: ${p} > ${g.length-1}.`);if(p!==Math.floor(p))throw new On(`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 ${constructor(c,p){this.type=dr,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,Tr),x=p.parse(c[2],2,Tr);return g&&x?Ct(g.type,[dr,Sr,be,ji,Tr])?new $(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(!Vt(p,["boolean","string","number","null"]))throw new On(`Expected first argument to be of type boolean, string, number or null, but found ${st(nn(p))} instead.`);if(!Vt(g,["string","array"]))throw new On(`Expected second argument to be of type array or string, but found ${st(nn(g))} instead.`);return g.indexOf(p)>=0}eachChild(c){c(this.needle),c(this.haystack)}outputDefined(){return!0}}class j{constructor(c,p,g){this.type=be,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,Tr),x=p.parse(c[2],2,Tr);if(!g||!x)return null;if(!Ct(g.type,[dr,Sr,be,ji,Tr]))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,be);return C?new j(g,x,C):null}return new j(g,x)}evaluate(c){const p=this.needle.evaluate(c),g=this.haystack.evaluate(c);if(!Vt(p,["boolean","string","number","null"]))throw new On(`Expected first argument to be of type boolean, string, number or null, but found ${st(nn(p))} instead.`);let x;if(this.fromIndex&&(x=this.fromIndex.evaluate(c)),Vt(g,["string"])){const C=g.indexOf(p,x);return C===-1?-1:[...g.slice(0,C)].length}if(Vt(g,["array"]))return g.indexOf(p,x);throw new On(`Expected second argument to be of type array or string, but found ${st(nn(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 tt=p.concat(U);if(W.length===0)return tt.error("Expected at least one branch label.");for(const ht of W){if(typeof ht!="number"&&typeof ht!="string")return tt.error("Branch labels must be numbers or strings.");if(typeof ht=="number"&&Math.abs(ht)>Number.MAX_SAFE_INTEGER)return tt.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ht=="number"&&Math.floor(ht)!==ht)return tt.error("Numeric branch labels must be integer values.");if(g){if(tt.checkSubtype(g,nn(ht)))return null}else g=nn(ht);if(C[String(ht)]!==void 0)return tt.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,Tr);if(!k)return null;const D=p.parse(c[c.length-1],c.length-1,x);return D?k.type.kind!=="value"&&p.concat(1).checkSubtype(g,k.type)?null:new X(g,x,k,C,A,D):null}evaluate(c){const p=this.input.evaluate(c);return(nn(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 it{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,dr);if(!k)return null;const D=p.parse(c[A+1],A+1,g);if(!D)return null;x.push([k,D]),g=g||D.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 it(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,Tr),x=p.parse(c[2],2,be);if(!g||!x)return null;if(!Ct(g.type,[ot(Tr),Sr,Tr]))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,be);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)),Vt(p,["string"]))return[...p].slice(g,x).join("");if(Vt(p,["array"]))return p.slice(g,x);throw new On(`Expected first argument to be of type array or string, but found ${st(nn(p))} instead.`)}eachChild(c){c(this.input),c(this.beginIndex),this.endIndex&&c(this.endIndex)}outputDefined(){return!1}}function gt(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 On("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,be);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],D=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(D,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[gt(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 me=we;function we(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}we.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 ye=oe(me);function ar(h,c,p){return h+p*(c-h)}function gn(h,c,p){return h.map((g,x)=>ar(g,c[x],p))}const Qr={number:ar,color:function(h,c,p,g="rgb"){switch(g){case"rgb":{const[x,C,A,k]=gn(h.rgb,c.rgb,p);return new jr(x,C,A,k,!1)}case"hcl":{const[x,C,A,k]=h.hcl,[D,U,W,K]=c.hcl;let tt,at;if(isNaN(x)||isNaN(D))isNaN(x)?isNaN(D)?tt=NaN:(tt=D,A!==1&&A!==0||(at=U)):(tt=x,W!==1&&W!==0||(at=C));else{let Gt=D-x;D>x&&Gt>180?Gt-=360:D<x&&x-D>180&&(Gt+=360),tt=x+p*Gt}const[ht,Tt,Lt,Et]=function([Gt,Pt,Bt,Jt]){return Gt=isNaN(Gt)?0:Gt*Rt,Ar([Bt,Math.cos(Gt)*Pt,Math.sin(Gt)*Pt,Jt])}([tt,at??ar(C,U,p),ar(A,W,p),ar(k,K,p)]);return new jr(ht,Tt,Lt,Et,!1)}case"lab":{const[x,C,A,k]=Ar(gn(h.lab,c.lab,p));return new jr(x,C,A,k,!1)}}},array:gn,padding:function(h,c,p){return new Un(gn(h.values,c.values,p))},variableAnchorOffsetCollection:function(h,c,p){const g=h.values,x=c.values;if(g.length!==x.length)throw new On(`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 On(`Cannot interpolate values containing mismatched anchors. from[${A}]: ${g[A]}, to[${A}]: ${x[A]}`);C.push(g[A]);const[k,D]=g[A+1],[U,W]=x[A+1];C.push([ar(k,U,p),ar(D,W,p)])}return new ln(C)}};class qr{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 ye(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,be),!C)return null;const k=[];let D=null;g==="interpolate-hcl"||g==="interpolate-lab"?D=bn:p.expectedType&&p.expectedType.kind!=="value"&&(D=p.expectedType);for(let U=0;U<A.length;U+=2){const W=A[U],K=A[U+1],tt=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.',tt);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.',tt);const ht=p.parse(K,at,D);if(!ht)return null;D=D||ht.type,k.push([W,ht])}return jt(D,be)||jt(D,bn)||jt(D,vi)||jt(D,xt)||jt(D,ot(be))?new qr(D,g,x,C,k):p.error(`Type ${st(D)} 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=gt(p,x),k=qr.interpolationFactor(this.interpolation,x,p[A],p[A+1]),D=g[A].evaluate(c),U=g[A+1].evaluate(c);switch(this.operator){case"interpolate":return Qr[this.type.kind](D,U,k);case"interpolate-hcl":return Qr.color(D,U,k,"hcl");case"interpolate-lab":return Qr.color(D,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 D=p.parse(k,1+C.length,g,void 0,{typeAnnotation:"omit"});if(!D)return null;g=g||D.type,C.push(D)}if(!g)throw new Error("No output type");const A=x&&C.some(k=>_t(x,k.type));return new ir(A?Tr: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 Yr&&!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 Jr(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 Li(h,c,p,g){return g.compare(c,p)===0}function kn(h,c,p){const g=h!=="=="&&h!=="!=";return class cK{constructor(C,A,k){this.type=dr,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 D=A.parse(C[1],1,Tr);if(!D)return null;if(!Jr(k,D.type))return A.concat(1).error(`"${k}" comparisons are not supported for type '${st(D.type)}'.`);let U=A.parse(C[2],2,Tr);if(!U)return null;if(!Jr(k,U.type))return A.concat(2).error(`"${k}" comparisons are not supported for type '${st(U.type)}'.`);if(D.type.kind!==U.type.kind&&D.type.kind!=="value"&&U.type.kind!=="value")return A.error(`Cannot compare types '${st(D.type)}' and '${st(U.type)}'.`);g&&(D.type.kind==="value"&&U.type.kind!=="value"?D=new Xi(U.type,[D]):D.type.kind!=="value"&&U.type.kind==="value"&&(U=new Xi(D.type,[U])));let W=null;if(C.length===4){if(D.type.kind!=="string"&&U.type.kind!=="string"&&D.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,_i),!W)return null}return new cK(D,U,W)}evaluate(C){const A=this.lhs.evaluate(C),k=this.rhs.evaluate(C);if(g&&this.hasUntypedArgument){const D=nn(A),U=nn(k);if(D.kind!==U.kind||D.kind!=="string"&&D.kind!=="number")throw new On(`Expected arguments for "${h}" to be (string, string) or (number, number), but found (${D.kind}, ${U.kind}) instead.`)}if(this.collator&&!g&&this.hasUntypedArgument){const D=nn(A),U=nn(k);if(D.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 t5=kn("==",function(h,c,p){return c===p},Li),I7=kn("!=",function(h,c,p){return c!==p},function(h,c,p,g){return!Li(0,c,p,g)}),wn=kn("<",function(h,c,p){return c<p},function(h,c,p,g){return g.compare(c,p)<0}),P7=kn(">",function(h,c,p){return c>p},function(h,c,p,g){return g.compare(c,p)>0}),ph=kn("<=",function(h,c,p){return c<=p},function(h,c,p,g){return g.compare(c,p)<=0}),Do=kn(">=",function(h,c,p){return c>=p},function(h,c,p,g){return g.compare(c,p)>=0});class Pa{constructor(c,p,g){this.type=_i,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,dr);if(!x)return null;const C=p.parse(g["diacritic-sensitive"]!==void 0&&g["diacritic-sensitive"],1,dr);if(!C)return null;let A=null;return g.locale&&(A=p.parse(g.locale,1,Sr),!A)?null:new Pa(x,C,A)}evaluate(c){return new Ci(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 Y4{constructor(c,p,g,x,C){this.type=Sr,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,be);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,Sr),!C))return null;let A=null;if(x.currency&&(A=p.parse(x.currency,1,Sr),!A))return null;let k=null;if(x["min-fraction-digits"]&&(k=p.parse(x["min-fraction-digits"],1,be),!k))return null;let D=null;return x["max-fraction-digits"]&&(D=p.parse(x["max-fraction-digits"],1,be),!D)?null:new Y4(g,C,A,k,D)}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 I3{constructor(c){this.type=m1,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 D=null;if(k["font-scale"]&&(D=p.parse(k["font-scale"],1,be),!D))return null;let U=null;if(k["text-font"]&&(U=p.parse(k["text-font"],1,ot(Sr)),!U))return null;let W=null;if(k["text-color"]&&(W=p.parse(k["text-color"],1,bn),!W))return null;const K=x[x.length-1];K.scale=D,K.font=U,K.textColor=W}else{const D=p.parse(c[A],1,Tr);if(!D)return null;const U=D.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:D,scale:null,font:null,textColor:null})}}return new I3(x)}evaluate(c){return new Dr(this.sections.map(p=>{const g=p.content.evaluate(c);return nn(g)===Ln?new G1("",g,null,null,null):new G1(Ai(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 P3{constructor(c){this.type=Ln,this.input=c}static parse(c,p){if(c.length!==2)return p.error("Expected two arguments.");const g=p.parse(c[1],1,Sr);return g?new P3(g):p.error("No image name provided.")}evaluate(c){const p=this.input.evaluate(c),g=Yr.fromString(p);return g&&c.availableImages&&(g.available=c.availableImages.indexOf(p)>-1),g}eachChild(c){c(this.input)}outputDefined(){return!1}}class J4{constructor(c){this.type=be,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 J4(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 On(`Expected value to be of type string or array, but found ${st(nn(p))} instead.`)}eachChild(c){c(this.input)}outputDefined(){return!1}}const To=8192;function fh(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*To),Math.round(g*x*To)]}function e5(h,c){const p=Math.pow(2,c.z);return[(x=(h[0]/To+c.x)/p,360*x-180),(g=(h[1]/To+c.y)/p,360/Math.PI*Math.atan(Math.exp((180-360*g)*Math.PI/180))-90)];var g,x}function As(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 h2(h,c){return!(h[0]<=c[0]||h[2]>=c[2]||h[1]<=c[1]||h[3]>=c[3])}function Xr(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 V3(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&&!(!Qo(h,c,p,g)||!Qo(p,g,h,c));var x,C}function Th(h,c,p){for(const g of p)for(let x=0;x<g.length-1;++x)if(V3(h,c,g[x],g[x+1]))return!0;return!1}function Va(h,c,p=!1){let g=!1;for(const k of c)for(let D=0;D<k.length-1;D++){if(Xr(h,k[D],k[D+1]))return p;(C=k[D])[1]>(x=h)[1]!=(A=k[D+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 t6(h,c){for(const p of c)if(Va(h,p))return!0;return!1}function e6(h,c){for(const p of h)if(!Va(p,c))return!1;for(let p=0;p<h.length-1;++p)if(Th(h[p],h[p+1],c))return!1;return!0}function V7(h,c){for(const p of c)if(e6(h,p))return!0;return!1}function Qo(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 r6(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=fh(h[x][A],p);As(c,k),C.push(k)}g.push(C)}return g}function r5(h,c,p){const g=[];for(let x=0;x<h.length;x++){const C=r6(h[x],c,p);g.push(C)}return g}function R7(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}As(c,h)}function n5(h,c,p,g){const x=Math.pow(2,g.z)*To,C=[g.x*To,g.y*To],A=[];for(const k of h)for(const D of k){const U=[D.x+C[0],D.y+C[1]];R7(U,c,p,x),A.push(U)}return A}function R3(h,c,p,g){const x=Math.pow(2,g.z)*To,C=[g.x*To,g.y*To],A=[];for(const D of h){const U=[];for(const W of D){const K=[W.x+C[0],W.y+C[1]];As(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 D of A)for(const U of D)R7(U,c,p,x)}var k;return A}class W2{constructor(c,p){this.type=dr,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(Wi(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 W2(g,{type:"MultiPolygon",coordinates:x})}else if(g.type==="Feature"){const x=g.geometry.type;if(x==="Polygon"||x==="MultiPolygon")return new W2(g,g.geometry)}else if(g.type==="Polygon"||g.type==="MultiPolygon")return new W2(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=r6(g.coordinates,C,A),D=n5(p.geometry(),x,C,A);if(!h2(x,C))return!1;for(const U of D)if(!Va(U,k))return!1}if(g.type==="MultiPolygon"){const k=r5(g.coordinates,C,A),D=n5(p.geometry(),x,C,A);if(!h2(x,C))return!1;for(const U of D)if(!t6(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=r6(g.coordinates,C,A),D=R3(p.geometry(),x,C,A);if(!h2(x,C))return!1;for(const U of D)if(!e6(U,k))return!1}if(g.type==="MultiPolygon"){const k=r5(g.coordinates,C,A),D=R3(p.geometry(),x,C,A);if(!h2(x,C))return!1;for(const U of D)if(!V7(U,k))return!1}return!0}(c,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let i5=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 Qh(h,c,p,g,x){q2(h,c,p,g||h.length-1,x||mh)}function q2(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),D=.5*Math.exp(2*k/3),U=.5*Math.sqrt(k*D*(C-D)/C)*(A-C/2<0?-1:1);q2(h,c,Math.max(p,Math.floor(c-A*D/C+U)),Math.min(g,Math.floor(c+(C-A)*D/C+U)),x)}var W=h[c],K=p,tt=g;for(Ra(h,p,c),x(h[g],W)>0&&Ra(h,p,g);K<tt;){for(Ra(h,K,tt),K++,tt--;x(h[K],W)<0;)K++;for(;x(h[tt],W)>0;)tt--}x(h[p],W)===0?Ra(h,p,tt):Ra(h,++tt,g),tt<=c&&(p=tt+1),c<=tt&&(g=tt-1)}}function Ra(h,c,p){var g=h[c];h[c]=h[p],h[p]=g}function mh(h,c){return h<c?-1:h>c?1:0}function n6(h,c){if(h.length<=1)return[h];const p=[];let g,x;for(const C of h){const A=N3(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||(Qh(p[C],c,1,p[C].length-1,o5),p[C]=p[C].slice(0,c));return p}function o5(h,c){return c.area-h.area}function N3(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 i6=1/298.257223563,o6=i6*(2-i6),s6=Math.PI/180;class Os{constructor(c){const p=6378.137*s6*1e3,g=Math.cos(c*s6),x=1/(1-o6*(1-g*g)),C=Math.sqrt(x);this.kx=p*C*g,this.ky=p*C*x*(1-o6)}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 D=0;D<c.length-1;D++){let U=c[D][0],W=c[D][1],K=this.wrap(c[D+1][0]-U)*this.kx,tt=(c[D+1][1]-W)*this.ky,at=0;K===0&&tt===0||(at=(this.wrap(p[0]-U)*this.kx*K+(p[1]-W)*this.ky*tt)/(K*K+tt*tt),at>1?(U=c[D+1][0],W=c[D+1][1]):at>0&&(U+=K/this.kx*at,W+=tt/this.ky*at)),K=this.wrap(p[0]-U)*this.kx,tt=(p[1]-W)*this.ky;const ht=K*K+tt*tt;ht<k&&(k=ht,g=U,x=W,C=D,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 N7(h,c){return c[0]-h[0]}function a6(h){return h[1]-h[0]+1}function d2(h,c){return h[1]>=h[0]&&h[1]<c}function s5(h,c){if(h[0]>h[1])return[null,null];const p=a6(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 a5(h,c){if(!d2(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)As(p,h[g]);return p}function l6(h){const c=[1/0,1/0,-1/0,-1/0];for(const p of h)for(const g of p)As(c,g);return c}function Na(h){return h[0]!==-1/0&&h[1]!==-1/0&&h[2]!==1/0&&h[3]!==1/0}function p2(h,c,p){if(!Na(h)||!Na(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 o1(h,c,p){const g=p.pointOnLine(c,h);return p.distance(h,g.point)}function f2(h,c,p,g,x){const C=Math.min(o1(h,[p,g],x),o1(c,[p,g],x)),A=Math.min(o1(p,[h,c],x),o1(g,[h,c],x));return Math.min(C,A)}function c6(h,c,p,g,x){if(!d2(c,h.length)||!d2(g,p.length))return 1/0;let C=1/0;for(let A=c[0];A<c[1];++A){const k=h[A],D=h[A+1];for(let U=g[0];U<g[1];++U){const W=p[U],K=p[U+1];if(V3(k,D,W,K))return 0;C=Math.min(C,f2(k,D,W,K,x))}}return C}function fn(h,c,p,g,x){if(!d2(c,h.length)||!d2(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 gh(h,c,p){if(Va(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,o1(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 Ir(h,c,p,g){if(!d2(c,h.length))return NaN;for(let C=c[0];C<=c[1];++C)if(Va(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 D of p)for(let U=0,W=D.length,K=W-1;U<W;K=U++){const tt=D[K],at=D[U];if(V3(A,k,tt,at))return 0;x=Math.min(x,f2(A,k,tt,at,g))}}return x}function X2(h,c){for(const p of h)for(const g of p)if(Va(g,c,!0))return!0;return!1}function mn(h,c,p,g=1/0){const x=l6(h),C=l6(c);if(g!==1/0&&p2(x,C,p)>=g)return g;if(h2(x,C)){if(X2(h,c))return 0}else if(X2(c,h))return 0;let A=1/0;for(const k of h)for(let D=0,U=k.length,W=U-1;D<U;W=D++){const K=k[W],tt=k[D];for(const at of c)for(let ht=0,Tt=at.length,Lt=Tt-1;ht<Tt;Lt=ht++){const Et=at[Lt],Gt=at[ht];if(V3(K,tt,Et,Gt))return 0;A=Math.min(A,f2(K,tt,Et,Gt,p))}}return A}function cn(h,c,p,g,x,C){if(!C)return;const A=p2(a5(g,C),x,p);A<c&&h.push([A,C,[0,0]])}function ks(h,c,p,g,x,C,A){if(!C||!A)return;const k=p2(a5(g,C),a5(x,A),p);k<c&&h.push([k,C,A])}function D3(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 i5([[0,[0,h.length-1],[0,0]]],N7),k=l6(p);for(;A.length>0;){const D=A.pop();if(D[0]>=C)continue;const U=D[1],W=c?50:100;if(a6(U)<=W){if(!d2(U,h.length))return NaN;if(c){const K=Ir(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 tt=gh(h[K],p,g);if(C=Math.min(C,tt),C===0)return 0}}else{const K=s5(U,c);cn(A,C,g,h,k,K[0]),cn(A,C,g,h,k,K[1])}}return C}function Da(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 i5([[0,[0,h.length-1],[0,p.length-1]]],N7);for(;k.length>0;){const D=k.pop();if(D[0]>=A)continue;const U=D[1],W=D[2],K=c?50:100,tt=g?50:100;if(a6(U)<=K&&a6(W)<=tt){if(!d2(U,h.length)&&d2(W,p.length))return NaN;let at;if(c&&g)at=c6(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=o1(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=o1(h[Tt],ht,x),A=Math.min(A,at),A===0)return A}else at=fn(h,U,p,W,x),A=Math.min(A,at)}else{const at=s5(U,c),ht=s5(W,g);ks(k,A,x,h,p,at[0],ht[0]),ks(k,A,x,h,p,at[0],ht[1]),ks(k,A,x,h,p,at[1],ht[0]),ks(k,A,x,h,p,at[1],ht[1])}}return A}function u6(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 Bo{constructor(c,p){this.type=be,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(Wi(c[1])){const g=c[1];if(g.type==="FeatureCollection")return new Bo(g,g.features.map(x=>u6(x.geometry)).flat());if(g.type==="Feature")return new Bo(g,u6(g.geometry));if("type"in g&&"coordinates"in g)return new Bo(g,u6(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(D=>e5([D.x,D.y],p.canonical));if(x.length===0)return NaN;const A=new Os(C[0][1]);let k=1/0;for(const D of g){switch(D.type){case"Point":k=Math.min(k,Da(C,!1,[D.coordinates],!1,A,k));break;case"LineString":k=Math.min(k,Da(C,!1,D.coordinates,!0,A,k));break;case"Polygon":k=Math.min(k,D3(C,!1,D.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(D=>e5([D.x,D.y],p.canonical));if(x.length===0)return NaN;const A=new Os(C[0][1]);let k=1/0;for(const D of g){switch(D.type){case"Point":k=Math.min(k,Da(C,!0,[D.coordinates],!1,A,k));break;case"LineString":k=Math.min(k,Da(C,!0,D.coordinates,!0,A,k));break;case"Polygon":k=Math.min(k,D3(C,!0,D.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=n6(x,0).map(D=>D.map(U=>U.map(W=>e5([W.x,W.y],p.canonical)))),A=new Os(C[0][0][0][1]);let k=1/0;for(const D of g)for(const U of C){switch(D.type){case"Point":k=Math.min(k,D3([D.coordinates],!1,U,A,k));break;case"LineString":k=Math.min(k,D3(D.coordinates,!0,U,A,k));break;case"Polygon":k=Math.min(k,mn(U,D.coordinates,A,k))}if(k===0)return k}return k}(c,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const mo={"==":t5,"!=":I7,">":P7,"<":wn,">=":Do,"<=":ph,array:Xi,at:V,boolean:Xi,case:it,coalesce:ir,collator:Pa,format:I3,image:P3,in:$,"index-of":j,interpolate:qr,"interpolate-hcl":qr,"interpolate-lab":qr,length:J4,let:Z1,literal:qi,match:X,number:Xi,"number-format":Y4,object:Xi,slice:dt,step:Wt,string:Xi,"to-boolean":zi,"to-color":zi,"to-number":zi,"to-string":zi,var:Br,within:W2,distance:Bo};class W1{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=W1.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 D=null;for(const[U,W]of k){D=new No(p.registry,B3,p.path,null,p.scope);const K=[];let tt=!1;for(let at=1;at<c.length;at++){const ht=c[at],Tt=Array.isArray(U)?U[at-1]:U.type,Lt=D.parse(ht,1+K.length,Tt);if(!Lt){tt=!0;break}K.push(Lt)}if(!tt)if(Array.isArray(U)&&U.length!==K.length)D.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];D.concat(at+1).checkSubtype(ht,Tt.type)}if(D.errors.length===0)return new W1(g,C,W,K)}}if(k.length===1)p.errors.push(...D.errors);else{const U=(k.length?k:A).map(([K])=>{return tt=K,Array.isArray(tt)?`(${tt.map(st).join(", ")})`:`(${st(tt.type)}...)`;var tt}).join(" | "),W=[];for(let K=1;K<c.length;K++){const tt=p.parse(c[K],1+W.length);if(!tt)return null;W.push(st(tt.type))}p.error(`Expected arguments of type ${U}, but found (${W.join(", ")}) instead.`)}return null}static register(c,p){W1.definitions=p;for(const g in p)c[g]=W1}}function Fo(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=$1(c,p,g,C);if(A)throw new On(A);return new jr(c/255,p/255,g/255,C,!1)}function l5(h,c){return h in c}function T2(h,c){const p=c[h];return p===void 0?null:p}function K2(h){return{type:h}}function B3(h){if(h instanceof Br)return B3(h.boundExpression);if(h instanceof W1&&h.name==="error"||h instanceof Pa||h instanceof W2||h instanceof Bo)return!1;const c=h instanceof zi||h instanceof Xi;let p=!0;return h.eachChild(g=>{p=c?p&&B3(g):p&&g instanceof qi}),!!p&&Y2(h)&&Ba(h,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Y2(h){if(h instanceof W1&&(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 W2||h instanceof Bo)return!1;let c=!0;return h.eachChild(p=>{c&&!Y2(p)&&(c=!1)}),c}function J2(h){if(h instanceof W1&&h.name==="feature-state")return!1;let c=!0;return h.eachChild(p=>{c&&!J2(p)&&(c=!1)}),c}function Ba(h,c){if(h instanceof W1&&c.indexOf(h.name)>=0)return!1;let p=!0;return h.eachChild(g=>{p&&!Ba(g,c)&&(p=!1)}),p}function F3(h){return{result:"success",value:h}}function Is(h){return{result:"error",value:h}}function jo(h){return h["property-type"]==="data-driven"||h["property-type"]==="cross-faded-data-driven"}function c5(h){return!!h.expression&&h.expression.parameters.indexOf("zoom")>-1}function u5(h){return!!h.expression&&h.expression.interpolated}function kt(h){return h instanceof Number?"number":h instanceof String?"string":h instanceof Boolean?"boolean":Array.isArray(h)?"array":h===null?"null":typeof h}function ee(h){return typeof h=="object"&&h!==null&&!Array.isArray(h)}function Pe(h){return h}function fr(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||(u5(c)?"exponential":"interval");if(p||c.type==="padding"){const W=p?jr.parse:Un.parse;(h=li({},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,D,U;if(C==="exponential")k=ui;else if(C==="interval")k=Gn;else if(C==="categorical"){k=Ur,D=Object.create(null);for(const W of h.stops)D[W[0]]=W[1];U=typeof h.stops[0][0]}else{if(C!=="identity")throw new Error(`Unknown function type "${C}"`);k=q1}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 tt=[];for(const ht of K)tt.push([W[ht].zoom,fr(W[ht],c)]);const at={name:"linear"};return{kind:"composite",interpolationType:at,interpolationFactor:qr.interpolationFactor.bind(void 0,at),zoomStops:tt.map(ht=>ht[0]),evaluate:({zoom:ht},Tt)=>ui({stops:tt,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:qr.interpolationFactor.bind(void 0,W),zoomStops:h.stops.map(K=>K[0]),evaluate:({zoom:K})=>k(h,c,K,D,U)}}return{kind:"source",evaluate(W,K){const tt=K&&K.properties?K.properties[h.property]:void 0;return tt===void 0?un(h.default,c.default):k(h,c,tt,D,U)}}}function un(h,c,p){return h!==void 0?h:c!==void 0?c:p!==void 0?p:void 0}function Ur(h,c,p,g,x){return un(typeof p===x?g[p]:void 0,h.default,c.default)}function Gn(h,c,p){if(kt(p)!=="number")return un(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=gt(h.stops.map(C=>C[0]),p);return h.stops[x][1]}function ui(h,c,p){const g=h.base!==void 0?h.base:1;if(kt(p)!=="number")return un(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=gt(h.stops.map(W=>W[0]),p),A=function(W,K,tt,at){const ht=at-tt,Tt=W-tt;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],D=h.stops[C+1][1],U=Qr[c.type]||Pe;return typeof k.evaluate=="function"?{evaluate(...W){const K=k.evaluate.apply(void 0,W),tt=D.evaluate.apply(void 0,W);if(K!==void 0&&tt!==void 0)return U(K,tt,A,h.colorSpace)}}:U(k,D,A,h.colorSpace)}function q1(h,c,p){switch(c.type){case"color":p=jr.parse(p);break;case"formatted":p=Dr.fromString(p.toString());break;case"resolvedImage":p=Yr.fromString(p.toString());break;case"padding":p=Un.parse(p);break;default:kt(p)===c.type||c.type==="enum"&&c.values[p]||(p=void 0)}return un(p,h.default,c.default)}W1.register(mo,{error:[{kind:"error"},[Sr],(h,[c])=>{throw new On(c.evaluate(h))}],typeof:[Sr,[Tr],(h,[c])=>st(nn(c.evaluate(h)))],"to-rgba":[ot(be,4),[bn],(h,[c])=>{const[p,g,x,C]=c.evaluate(h).rgb;return[255*p,255*g,255*x,C]}],rgb:[bn,[be,be,be],Fo],rgba:[bn,[be,be,be,be],Fo],has:{type:dr,overloads:[[[Sr],(h,[c])=>l5(c.evaluate(h),h.properties())],[[Sr,i1],(h,[c,p])=>l5(c.evaluate(h),p.evaluate(h))]]},get:{type:Tr,overloads:[[[Sr],(h,[c])=>T2(c.evaluate(h),h.properties())],[[Sr,i1],(h,[c,p])=>T2(c.evaluate(h),p.evaluate(h))]]},"feature-state":[Tr,[Sr],(h,[c])=>T2(c.evaluate(h),h.featureState||{})],properties:[i1,[],h=>h.properties()],"geometry-type":[Sr,[],h=>h.geometryType()],id:[Tr,[],h=>h.id()],zoom:[be,[],h=>h.globals.zoom],"heatmap-density":[be,[],h=>h.globals.heatmapDensity||0],"line-progress":[be,[],h=>h.globals.lineProgress||0],accumulated:[Tr,[],h=>h.globals.accumulated===void 0?null:h.globals.accumulated],"+":[be,K2(be),(h,c)=>{let p=0;for(const g of c)p+=g.evaluate(h);return p}],"*":[be,K2(be),(h,c)=>{let p=1;for(const g of c)p*=g.evaluate(h);return p}],"-":{type:be,overloads:[[[be,be],(h,[c,p])=>c.evaluate(h)-p.evaluate(h)],[[be],(h,[c])=>-c.evaluate(h)]]},"/":[be,[be,be],(h,[c,p])=>c.evaluate(h)/p.evaluate(h)],"%":[be,[be,be],(h,[c,p])=>c.evaluate(h)%p.evaluate(h)],ln2:[be,[],()=>Math.LN2],pi:[be,[],()=>Math.PI],e:[be,[],()=>Math.E],"^":[be,[be,be],(h,[c,p])=>Math.pow(c.evaluate(h),p.evaluate(h))],sqrt:[be,[be],(h,[c])=>Math.sqrt(c.evaluate(h))],log10:[be,[be],(h,[c])=>Math.log(c.evaluate(h))/Math.LN10],ln:[be,[be],(h,[c])=>Math.log(c.evaluate(h))],log2:[be,[be],(h,[c])=>Math.log(c.evaluate(h))/Math.LN2],sin:[be,[be],(h,[c])=>Math.sin(c.evaluate(h))],cos:[be,[be],(h,[c])=>Math.cos(c.evaluate(h))],tan:[be,[be],(h,[c])=>Math.tan(c.evaluate(h))],asin:[be,[be],(h,[c])=>Math.asin(c.evaluate(h))],acos:[be,[be],(h,[c])=>Math.acos(c.evaluate(h))],atan:[be,[be],(h,[c])=>Math.atan(c.evaluate(h))],min:[be,K2(be),(h,c)=>Math.min(...c.map(p=>p.evaluate(h)))],max:[be,K2(be),(h,c)=>Math.max(...c.map(p=>p.evaluate(h)))],abs:[be,[be],(h,[c])=>Math.abs(c.evaluate(h))],round:[be,[be],(h,[c])=>{const p=c.evaluate(h);return p<0?-Math.round(-p):Math.round(p)}],floor:[be,[be],(h,[c])=>Math.floor(c.evaluate(h))],ceil:[be,[be],(h,[c])=>Math.ceil(c.evaluate(h))],"filter-==":[dr,[Sr,Tr],(h,[c,p])=>h.properties()[c.value]===p.value],"filter-id-==":[dr,[Tr],(h,[c])=>h.id()===c.value],"filter-type-==":[dr,[Sr],(h,[c])=>h.geometryType()===c.value],"filter-<":[dr,[Sr,Tr],(h,[c,p])=>{const g=h.properties()[c.value],x=p.value;return typeof g==typeof x&&g<x}],"filter-id-<":[dr,[Tr],(h,[c])=>{const p=h.id(),g=c.value;return typeof p==typeof g&&p<g}],"filter->":[dr,[Sr,Tr],(h,[c,p])=>{const g=h.properties()[c.value],x=p.value;return typeof g==typeof x&&g>x}],"filter-id->":[dr,[Tr],(h,[c])=>{const p=h.id(),g=c.value;return typeof p==typeof g&&p>g}],"filter-<=":[dr,[Sr,Tr],(h,[c,p])=>{const g=h.properties()[c.value],x=p.value;return typeof g==typeof x&&g<=x}],"filter-id-<=":[dr,[Tr],(h,[c])=>{const p=h.id(),g=c.value;return typeof p==typeof g&&p<=g}],"filter->=":[dr,[Sr,Tr],(h,[c,p])=>{const g=h.properties()[c.value],x=p.value;return typeof g==typeof x&&g>=x}],"filter-id->=":[dr,[Tr],(h,[c])=>{const p=h.id(),g=c.value;return typeof p==typeof g&&p>=g}],"filter-has":[dr,[Tr],(h,[c])=>c.value in h.properties()],"filter-has-id":[dr,[],h=>h.id()!==null&&h.id()!==void 0],"filter-type-in":[dr,[ot(Sr)],(h,[c])=>c.value.indexOf(h.geometryType())>=0],"filter-id-in":[dr,[ot(Tr)],(h,[c])=>c.value.indexOf(h.id())>=0],"filter-in-small":[dr,[Sr,ot(Tr)],(h,[c,p])=>p.value.indexOf(h.properties()[c.value])>=0],"filter-in-large":[dr,[Sr,ot(Tr)],(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:dr,overloads:[[[dr,dr],(h,[c,p])=>c.evaluate(h)&&p.evaluate(h)],[K2(dr),(h,c)=>{for(const p of c)if(!p.evaluate(h))return!1;return!0}]]},any:{type:dr,overloads:[[[dr,dr],(h,[c,p])=>c.evaluate(h)||p.evaluate(h)],[K2(dr),(h,c)=>{for(const p of c)if(p.evaluate(h))return!0;return!1}]]},"!":[dr,[dr],(h,[c])=>!c.evaluate(h)],"is-supported-script":[dr,[Sr],(h,[c])=>{const p=h.globals&&h.globals.isSupportedScript;return!p||p(c.evaluate(h))}],upcase:[Sr,[Sr],(h,[c])=>c.evaluate(h).toUpperCase()],downcase:[Sr,[Sr],(h,[c])=>c.evaluate(h).toLowerCase()],concat:[Sr,K2(Tr),(h,c)=>c.map(p=>Ai(p.evaluate(h))).join("")],"resolved-locale":[Sr,[_i],(h,[c])=>c.evaluate(h).resolvedLocale()]});class ri{constructor(c,p){var g;this.expression=c,this._warningHistory={},this._evaluator=new Ia,this._defaultValue=p?(g=p).type==="color"&&ee(g.default)?new jr(0,0,0,0):g.type==="color"?jr.parse(g.default)||null:g.type==="padding"?Un.parse(g.default)||null:g.type==="variableAnchorOffsetCollection"?ln.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 On(`Expected value to be one of ${Object.keys(this._enumValues).map(D=>JSON.stringify(D)).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 ni(h){return Array.isArray(h)&&h.length>0&&typeof h[0]=="string"&&h[0]in mo}function s1(h,c){const p=new No(mo,B3,[],c?function(x){const C={color:bn,string:Sr,number:be,enum:Sr,boolean:dr,formatted:m1,padding:vi,resolvedImage:Ln,variableAnchorOffsetCollection:xt};return x.type==="array"?ot(C[x.value]||Tr,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?F3(new ri(g,c)):Is(p.errors)}class g1{constructor(c,p){this.kind=c,this._styleExpression=p,this.isStateDependent=c!=="constant"&&!J2(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 fi{constructor(c,p,g,x){this.kind=c,this.zoomStops=g,this._styleExpression=p,this.isStateDependent=c!=="camera"&&!J2(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?qr.interpolationFactor(this.interpolationType,c,p,g):0}}function go(h,c){const p=s1(h,c);if(p.result==="error")return p;const g=p.value.expression,x=Y2(g);if(!x&&!jo(c))return Is([new jn("","data expressions not supported")]);const C=Ba(g,["zoom"]);if(!C&&!c5(c))return Is([new jn("","zoom expressions not supported")]);const A=ts(g);return A||C?A instanceof jn?Is([A]):A instanceof qr&&!u5(c)?Is([new jn("",'"interpolate" expressions cannot be used with this property')]):F3(A?new fi(x?"camera":"composite",p.value,A.labels,A instanceof qr?A.interpolation:void 0):new g1(x?"constant":"source",p.value)):Is([new jn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class yo{constructor(c,p){this._parameters=c,this._specification=p,li(this,fr(this._parameters,this._specification))}static deserialize(c){return new yo(c._parameters,c._specification)}static serialize(c){return{_parameters:c._parameters,_specification:c._specification}}}function ts(h){let c=null;if(h instanceof Z1)c=ts(h.result);else if(h instanceof ir){for(const p of h.args)if(c=ts(p),c)break}else(h instanceof Wt||h instanceof qr)&&h.input instanceof W1&&h.input.name==="zoom"&&(c=h);return c instanceof jn||h.eachChild(p=>{const g=ts(p);g instanceof jn?c=g:!c&&g?c=new jn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):c&&g&&c!==g&&(c=new jn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),c}function Q2(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(!Q2(c)&&typeof c!="boolean")return!1;return!0;default:return!0}}const es={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function h6(h){if(h==null)return{filter:()=>!0,needGeometry:!1};Q2(h)||(h=hn(h));const c=s1(h,es);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:D7(h)}}function yh(h,c){return h<c?-1:h>c?1:0}function D7(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(D7(h[c]))return!0;return!1}function hn(h){if(!h)return!0;const c=h[0];return h.length<=1?c!=="any":c==="=="?on(h[1],h[2],"=="):c==="!="?Oi(on(h[1],h[2],"==")):c==="<"||c===">"||c==="<="||c===">="?on(h[1],h[2],c):c==="any"?(p=h.slice(1),["any"].concat(p.map(hn))):c==="all"?["all"].concat(h.slice(1).map(hn)):c==="none"?["all"].concat(h.slice(1).map(hn).map(Oi)):c==="in"?rs(h[1],h.slice(2)):c==="!in"?Oi(rs(h[1],h.slice(2))):c==="has"?X1(h[1]):c!=="!has"||Oi(X1(h[1]));var p}function on(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 rs(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(yh)]]:["filter-in-small",h,["literal",c]]}}function X1(h){switch(h){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",h]}}function Oi(h){return["!",h]}function ki(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+=`${ki(C)},`;return`${x}]`}const p=Object.keys(h).sort();let g="{";for(let x=0;x<p.length;x++)g+=`${JSON.stringify(p[x])}:${ki(h[p[x]])},`;return`${g}}`}function zo(h){let c="";for(const p of zr)c+=`/${ki(h[p])}`;return c}function m2(h){const c=h.value;return c?[new Qe(h.key,c,"constants have been deprecated as of v8")]:[]}function xn(h){return h instanceof Number||h instanceof String||h instanceof Boolean?h.valueOf():h}function y1(h){if(Array.isArray(h))return h.map(y1);if(h instanceof Object&&!(h instanceof Number||h instanceof String||h instanceof Boolean)){const c={};for(const p in h)c[p]=y1(h[p]);return c}return xn(h)}function Ii(h){const c=h.key,p=h.value,g=h.valueSpec||{},x=h.objectElementValidators||{},C=h.style,A=h.styleSpec,k=h.validateSpec;let D=[];const U=kt(p);if(U!=="object")return[new Qe(c,p,`object expected, ${U} found`)];for(const W in p){const K=W.split(".")[0],tt=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["*"]){D.push(new Qe(c,p[W],`unknown property "${W}"`));continue}at=k}D=D.concat(at({key:(c&&`${c}.`)+W,value:p[W],valueSpec:tt,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&&D.push(new Qe(c,p,`missing required property "${W}"`));return D}function _o(h){const c=h.value,p=h.valueSpec,g=h.style,x=h.styleSpec,C=h.key,A=h.arrayElementValidator||h.validateSpec;if(kt(c)!=="array")return[new Qe(C,c,`array expected, ${kt(c)} found`)];if(p.length&&c.length!==p.length)return[new Qe(C,c,`array length ${p.length} expected, length ${c.length} found`)];if(p["min-length"]&&c.length<p["min-length"])return[new Qe(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),kt(p.value)==="object"&&(k=p.value);let D=[];for(let U=0;U<c.length;U++)D=D.concat(A({array:c,arrayIndex:U,value:c[U],valueSpec:k,validateSpec:h.validateSpec,style:g,styleSpec:x,key:`${C}[${U}]`}));return D}function d6(h){const c=h.key,p=h.value,g=h.valueSpec;let x=kt(p);return x==="number"&&p!=p&&(x="NaN"),x!=="number"?[new Qe(c,p,`number expected, ${x} found`)]:"minimum"in g&&p<g.minimum?[new Qe(c,p,`${p} is less than the minimum value ${g.minimum}`)]:"maximum"in g&&p>g.maximum?[new Qe(c,p,`${p} is greater than the maximum value ${g.maximum}`)]:[]}function Ps(h){const c=h.valueSpec,p=xn(h.value.type);let g,x,C,A={};const k=p!=="categorical"&&h.value.property===void 0,D=!k,U=kt(h.value.stops)==="array"&&kt(h.value.stops[0])==="array"&&kt(h.value.stops[0][0])==="object",W=Ii({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 Qe(at.key,at.value,'identity function may not have a "stops" property')];let ht=[];const Tt=at.value;return ht=ht.concat(_o({key:at.key,value:Tt,valueSpec:at.valueSpec,validateSpec:at.validateSpec,style:at.style,styleSpec:at.styleSpec,arrayElementValidator:K})),kt(Tt)==="array"&&Tt.length===0&&ht.push(new Qe(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 Qe(h.key,h.value,'missing required property "property"')),p==="identity"||h.value.stops||W.push(new Qe(h.key,h.value,'missing required property "stops"')),p==="exponential"&&h.valueSpec.expression&&!u5(h.valueSpec)&&W.push(new Qe(h.key,h.value,"exponential functions not supported")),h.styleSpec.$version>=8&&(D&&!jo(h.valueSpec)?W.push(new Qe(h.key,h.value,"property functions not supported")):k&&!c5(h.valueSpec)&&W.push(new Qe(h.key,h.value,"zoom functions not supported"))),p!=="categorical"&&!U||h.value.property!==void 0||W.push(new Qe(h.key,h.value,'"property" property is required')),W;function K(at){let ht=[];const Tt=at.value,Lt=at.key;if(kt(Tt)!=="array")return[new Qe(Lt,Tt,`array expected, ${kt(Tt)} found`)];if(Tt.length!==2)return[new Qe(Lt,Tt,`array length 2 expected, length ${Tt.length} found`)];if(U){if(kt(Tt[0])!=="object")return[new Qe(Lt,Tt,`object expected, ${kt(Tt[0])} found`)];if(Tt[0].zoom===void 0)return[new Qe(Lt,Tt,"object stop key must have zoom")];if(Tt[0].value===void 0)return[new Qe(Lt,Tt,"object stop key must have value")];if(C&&C>xn(Tt[0].zoom))return[new Qe(Lt,Tt[0].zoom,"stop zoom values must appear in ascending order")];xn(Tt[0].zoom)!==C&&(C=xn(Tt[0].zoom),x=void 0,A={}),ht=ht.concat(Ii({key:`${Lt}[0]`,value:Tt[0],valueSpec:{zoom:{}},validateSpec:at.validateSpec,style:at.style,styleSpec:at.styleSpec,objectElementValidators:{zoom:d6,value:tt}}))}else ht=ht.concat(tt({key:`${Lt}[0]`,value:Tt[0],valueSpec:{},validateSpec:at.validateSpec,style:at.style,styleSpec:at.styleSpec},Tt));return ni(y1(Tt[1]))?ht.concat([new Qe(`${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 tt(at,ht){const Tt=kt(at.value),Lt=xn(at.value),Et=at.value!==null?at.value:ht;if(g){if(Tt!==g)return[new Qe(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 Qe(at.key,Et,"stop domain value must be a number, string, or boolean")];if(Tt!=="number"&&p!=="categorical"){let Gt=`number expected, ${Tt} found`;return jo(c)&&p===void 0&&(Gt+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Qe(at.key,Et,Gt)]}return p!=="categorical"||Tt!=="number"||isFinite(Lt)&&Math.floor(Lt)===Lt?p!=="categorical"&&Tt==="number"&&x!==void 0&&Lt<x?[new Qe(at.key,Et,"stop domain values must appear in ascending order")]:(x=Lt,p==="categorical"&&Lt in A?[new Qe(at.key,Et,"stop domain values must be unique")]:(A[Lt]=!0,[])):[new Qe(at.key,Et,`integer expected, found ${Lt}`)]}}function ns(h){const c=(h.expressionContext==="property"?go:s1)(y1(h.value),h.valueSpec);if(c.result==="error")return c.value.map(g=>new Qe(`${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 Qe(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"&&!J2(p))return[new Qe(h.key,h.value,'"feature-state" data expressions are not supported with layout properties.')];if(h.expressionContext==="filter"&&!J2(p))return[new Qe(h.key,h.value,'"feature-state" data expressions are not supported with filters.')];if(h.expressionContext&&h.expressionContext.indexOf("cluster")===0){if(!Ba(p,["zoom","feature-state"]))return[new Qe(h.key,h.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(h.expressionContext==="cluster-initial"&&!Y2(p))return[new Qe(h.key,h.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function K1(h){const c=h.key,p=h.value,g=h.valueSpec,x=[];return Array.isArray(g.values)?g.values.indexOf(xn(p))===-1&&x.push(new Qe(c,p,`expected one of [${g.values.join(", ")}], ${JSON.stringify(p)} found`)):Object.keys(g.values).indexOf(xn(p))===-1&&x.push(new Qe(c,p,`expected one of [${Object.keys(g.values).join(", ")}], ${JSON.stringify(p)} found`)),x}function Fa(h){return Q2(y1(h.value))?ns(li({},h,{expressionContext:"filter",valueSpec:{value:"boolean"}})):j3(h)}function j3(h){const c=h.value,p=h.key;if(kt(c)!=="array")return[new Qe(p,c,`array expected, ${kt(c)} found`)];const g=h.styleSpec;let x,C=[];if(c.length<1)return[new Qe(p,c,"filter array must have at least 1 element")];switch(C=C.concat(K1({key:`${p}[0]`,value:c[0],valueSpec:g.filter_operator,style:h.style,styleSpec:h.styleSpec})),xn(c[0])){case"<":case"<=":case">":case">=":c.length>=2&&xn(c[1])==="$type"&&C.push(new Qe(p,c,`"$type" cannot be use with operator "${c[0]}"`));case"==":case"!=":c.length!==3&&C.push(new Qe(p,c,`filter array for operator "${c[0]}" must have 3 elements`));case"in":case"!in":c.length>=2&&(x=kt(c[1]),x!=="string"&&C.push(new Qe(`${p}[1]`,c[1],`string expected, ${x} found`)));for(let A=2;A<c.length;A++)x=kt(c[A]),xn(c[1])==="$type"?C=C.concat(K1({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 Qe(`${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(j3({key:`${p}[${A}]`,value:c[A],style:h.style,styleSpec:h.styleSpec}));break;case"has":case"!has":x=kt(c[1]),c.length!==2?C.push(new Qe(p,c,`filter array for "${c[0]}" operator must have 2 elements`)):x!=="string"&&C.push(new Qe(`${p}[1]`,c[1],`string expected, ${x} found`))}return C}function ja(h,c){const p=h.key,g=h.validateSpec,x=h.style,C=h.styleSpec,A=h.value,k=h.objectKey,D=C[`${c}_${h.layerType}`];if(!D)return[];const U=k.match(/^(.*)-transition$/);if(c==="paint"&&U&&D[U[1]]&&D[U[1]].transition)return g({key:p,value:A,valueSpec:C.transition,style:x,styleSpec:C});const W=h.valueSpec||D[k];if(!W)return[new Qe(p,A,`unknown property "${k}"`)];let K;if(kt(A)==="string"&&jo(W)&&!W.tokens&&(K=/^{([^}]+)}$/.exec(A)))return[new Qe(p,A,`"${k}" does not support interpolation syntax
|
|
@@ -1715,4 +1715,4 @@ DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
|
1715
1715
|
state: () => new MyClass()
|
|
1716
1716
|
Found in store "${Z.$id}".`),b&&o&&r.hydrate&&r.hydrate(Z.$state,b),d=!0,f=!0,Z}function MFt(t,e,r){let n,i;const o=typeof e=="function";n=t,i=o?r:e;function s(a,u){const d=_.hasInjectionContext();if(a=(process.env.NODE_ENV==="test"&&hh&&hh._testing?null:a)||(d?_.inject(LFt,null):null),a&&cy(a),process.env.NODE_ENV!=="production"&&!hh)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
1717
1717
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
1718
|
-
This will fail in production.`);a=hh,a._s.has(n)||(o?jS(n,e,i,a):bq(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?jS(T,e,i,a,!0):bq(T,U2({},i),a,!0);u._hotUpdate(Q),delete a.state.value[T],a._s.delete(T)}if(process.env.NODE_ENV!=="production"&&DS){const T=_.getCurrentInstance();if(T&&T.proxy&&!u){const Q=T.proxy,y="_pStores"in Q?Q._pStores:Q._pStores={};y[n]=f}}return f}return s.$id=n,s}function SFt(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 HFt=MFt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),CFt=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},Lq=(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=Lq(o,s.key);a.length>0&&(s.children=a),r.push(s)}),r},AFt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},OFt={name:"FlatmapVuer",components:{Button:fO,Col:Ac,Loading:l2t,Radio:HO,Icon:Us,RadioGroup:CO,Row:Cc,Select:kd,Dialog:Mot,MapSvgIcon:jH.MapSvgIcon,MapSvgSpriteColor:jH.MapSvgSpriteColor,Tooltip:Fy.Tooltip,TreeControls:Fy.TreeControls,SelectionsGroup:FO,SvgLegends:jO,ElIconWarningFilled:JC,ElIconArrowDown:c_,ElIconArrowLeft:XC,DrawToolbar:Fy.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(t){return{annotator:_.markRaw(new vFt(`${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=Lq(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=>{zO(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 y=this.mapImp.featureProperties([Q]);if(s.includes(y.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,y])=>[Q==="featureId"?"id":Q,y])))}}}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,CFt(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.userInformation||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=_.markRaw(new M2t(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:_.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:x2t,isFC:!1,isCentreLine:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:L2t,tooltipEntry:AFt(),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:_.markRaw({alert:{with:!0,without:!0}})}},computed:{...SFt(HFt,["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&&e.canUpdate&&(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=_.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=_.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=_.markRaw(new PS(this.flatmapAPI)),this.flatmapQueries=_.markRaw(new w2t),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},Cs=t=>(_.pushScopeId("data-v-8aba816f"),t=t(),_.popScopeId(),t),kFt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},IFt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},PFt={style:{height:"100%",width:"100%"},ref:"display"},VFt={class:"beta-popovers"},RFt=Cs(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),NFt=Cs(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),DFt=Cs(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),BFt=Cs(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),FFt=Cs(()=>_.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),jFt={key:1,class:"warning-text"},zFt=Cs(()=>_.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),UFt=Cs(()=>_.createElementVNode("b",null,"Neuron Connection mode",-1)),GFt=Cs(()=>_.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)),$Ft=Cs(()=>_.createElementVNode("b",null,"Now can display up to 6 panes",-1)),ZFt=Cs(()=>_.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)),WFt={class:"bottom-right-control"},qFt=Cs(()=>_.createElementVNode("div",null,[_.createTextVNode(" Fit to "),_.createElementVNode("br"),_.createTextVNode(" window ")],-1)),XFt=["innerHTML"],KFt=["innerHTML"],YFt={style:{"margin-bottom":"2px"}},JFt={key:0,class:"viewing-mode-title"},tjt=["onClick"],ejt=["onClick"];function rjt(t,e,r,n,i,o){const s=_.resolveComponent("map-svg-sprite-color"),a=JC,u=Us,d=Id,f=c_,T=_.resolveComponent("DrawToolbar"),Q=_.resolveComponent("map-svg-icon"),y=jO,b=_.resolveComponent("tree-controls"),w=FO,M=XC,E=fO,O=Cc,I=Ac,N=z_,F=kd,G=HO,Z=CO,et=_.resolveComponent("Tooltip"),nt=NO,ut=G_;return _.withDirectives((_.openBlock(),_.createElementBlock("div",kFt,[_.createVNode(s),_.createElementVNode("div",IFt,[_.createElementVNode("div",PFt,null,512),_.withDirectives(_.createElementVNode("div",VFt,[_.createElementVNode("div",null,[_.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[7].value,ref:"warningPopover"},{reference:_.withCtx(()=>[r.displayWarning?(_.openBlock(),_.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))},[_.createVNode(u,null,{default:_.withCtx(()=>[_.createVNode(a)]),_:1}),r.isLegacy?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[FFt,_.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(_.openBlock(),_.createElementBlock("span",jFt,"Beta"))],32)):_.createCommentVNode("",!0)]),default:_.withCtx(()=>[r.isLegacy?(_.openBlock(),_.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?(_.openBlock(),_.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=rt=>o.showTooltip(7)),onMouseout:e[3]||(e[3]=rt=>o.hideTooltip(7))},[_.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),RFt,_.createTextVNode(" models available in "),NFt,_.createTextVNode(". ")],32)):(_.openBlock(),_.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=rt=>o.showTooltip(7)),onMouseout:e[5]||(e[5]=rt=>o.hideTooltip(7))},[_.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),DFt,_.createTextVNode(" models available in "),BFt,_.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(_.openBlock(),_.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:_.withCtx(()=>[r.displayLatestChanges?(_.openBlock(),_.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))},[_.createVNode(u,null,{default:_.withCtx(()=>[_.createVNode(a)]),_:1}),zFt],32)):_.createCommentVNode("",!0)]),default:_.withCtx(()=>[UFt,GFt,$Ft,ZFt]),_:1},8,["visible"])):_.createCommentVNode("",!0)],512),[[_.vShow,!r.disableUI]]),_.withDirectives(_.createVNode(u,{class:_.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:_.withCtx(()=>[_.createVNode(f)]),_:1},8,["class","onClick"]),[[_.vShow,t.minimapResizeShow]]),t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI?(_.openBlock(),_.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"])):_.createCommentVNode("",!0),_.withDirectives(_.createElementVNode("div",WFt,[_.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:_.withCtx(()=>[_.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))},[_.createVNode(Q,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),_.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:_.withCtx(()=>[_.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))},[_.createVNode(Q,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),_.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:_.withCtx(()=>[_.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))},[_.createVNode(Q,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:_.withCtx(()=>[qFt]),_:1},8,["visible"])],512),[[_.vShow,!r.disableUI]]),_.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:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",{class:_.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.withDirectives((_.openBlock(),_.createElementBlock("div",{class:_.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:_.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?_.createCommentVNode("",!0):(_.openBlock(),_.createBlock(y,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(_.openBlock(),_.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:_.withCtx(()=>[_.withDirectives(_.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,XFt),[[nt,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):_.createCommentVNode("",!0),_.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:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,KFt),[[_.vShow,t.hoverVisibilities[0].value],[nt,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(_.openBlock(),_.createBlock(b,{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"])):_.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(_.openBlock(),_.createBlock(w,{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"])):_.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(_.openBlock(),_.createBlock(w,{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"])):_.createCommentVNode("",!0),t.taxonConnectivity&&t.taxonConnectivity.length>0?(_.openBlock(),_.createBlock(w,{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"])):_.createCommentVNode("",!0),!(t.isCentreLine||t.isFC)&&t.centreLines&&t.centreLines.length>0?(_.openBlock(),_.createBlock(w,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:t.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):_.createCommentVNode("",!0)],6)),[[nt,void 0,"checkBoxPopover"]]),_.createElementVNode("div",{onClick:e[22]||(e[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:_.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.createVNode(u,null,{default:_.withCtx(()=>[_.createVNode(M)]),_:1})],2)],2),[[_.vShow,!(r.disableUI||t.isCentreLine)]])]),_:1},8,["visible"]),t.openMapRef?(_.openBlock(),_.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:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(r.openMapOptions,rt=>(_.openBlock(),_.createBlock(O,{key:rt.key},{default:_.withCtx(()=>[_.createVNode(E,{type:"primary",plain:"",onClick:yt=>t.$emit("open-map",rt.key)},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):_.createCommentVNode("",!0),_.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:_.withCtx(()=>[_.createElementVNode("div",null,[_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Viewing Mode")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createElementVNode("div",YFt,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.viewingModes,(rt,yt,It)=>(_.openBlock(),_.createElementBlock(_.Fragment,{key:yt},[yt===t.viewingMode?(_.openBlock(),_.createElementBlock("span",JFt,[_.createElementVNode("b",null,_.toDisplayString(yt),1)])):(_.openBlock(),_.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Zt=>o.changeViewingMode(yt)},_.toDisplayString(yt),9,tjt))],64))),128))]),_.createVNode(O,{class:"viewing-mode-description"},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(t.viewingModes[t.viewingMode]),1)]),_:1})]),_:1}),t.viewingMode==="Annotation"&&t.userInformation?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Drawn By*")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(F,{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:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.drawnTypes,rt=>(_.openBlock(),_.createBlock(N,{key:rt,label:rt,value:rt},{default:_.withCtx(()=>[_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(I,{span:12},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Annotated By*")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(F,{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:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.annotatedTypes,rt=>(_.openBlock(),_.createBlock(N,{key:rt,label:rt,value:rt},{default:_.withCtx(()=>[_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(I,{span:12},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:1,class:"backgroundSpacer"})):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:2,class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Flight path display")]),_:1})):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:3,class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(Z,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[25]||(e[25]=rt=>t.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:_.withCtx(()=>[_.createVNode(G,{label:!1},{default:_.withCtx(()=>[_.createTextVNode("2D")]),_:1}),_.createVNode(G,{label:!0},{default:_.withCtx(()=>[_.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):_.createCommentVNode("",!0),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Organs display")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(Z,{modelValue:t.colourRadio,"onUpdate:modelValue":e[26]||(e[26]=rt=>t.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:_.withCtx(()=>[_.createVNode(G,{label:!0},{default:_.withCtx(()=>[_.createTextVNode("Colour")]),_:1}),_.createVNode(G,{label:!1},{default:_.withCtx(()=>[_.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Outlines display")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(Z,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[27]||(e[27]=rt=>t.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:_.withCtx(()=>[_.createVNode(G,{label:!0},{default:_.withCtx(()=>[_.createTextVNode("Show")]),_:1}),_.createVNode(G,{label:!1},{default:_.withCtx(()=>[_.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Change background")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.availableBackground,rt=>(_.openBlock(),_.createElementBlock("div",{key:rt,class:_.normalizeClass(["backgroundChoice",rt,rt==t.currentBackground?"active":""]),onClick:yt=>o.backgroundChangeCallback(rt)},null,10,ejt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),_.withDirectives(_.createElementVNode("div",{class:_.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(d,{visible:t.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:_.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(_.openBlock(),_.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))},[_.createVNode(Q,{icon:"openMap",class:"icon-button open-map-button"})],544)):_.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(d,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:_.withCtx(()=>[_.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))},[_.createVNode(Q,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})],2),[[_.vShow,!r.disableUI]]),_.withDirectives(_.createVNode(et,{ref:"tooltip",class:"tooltip",annotationEntry:t.annotationEntry,tooltipEntry:t.tooltipEntry,annotationDisplay:t.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"]),[[_.vShow,t.tooltipDisplay]])])])),[[ut,t.loading]])}const zS=Rd(OFt,[["render",rjt],["__scopeId","data-v-8aba816f"]]);function njt(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 wq=new njt,xq={"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"},ijt={name:"MultiFlatmapVuer",components:{Col:Ac,Row:Cc,Option:z_,Select:kd,Popover:Id,FlatmapVuer:zS},mounted:function(){this.initialise(),wq.on("onActionClick",t=>{this.resourceSelected(t)}),wq.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 PS(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 xq?xq[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:_.markRaw([]),initialised:!1}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},ojt=t=>(_.pushScopeId("data-v-0a58a2d4"),t=t(),_.popScopeId(),t),sjt={class:"multi-container",ref:"multiContainer"},ajt={key:0,style:{position:"absolute","z-index":"10"}},ljt=ojt(()=>_.createElementVNode("div",{class:"species-display-text"},"Species",-1)),cjt={class:"select-box-icon"};function ujt(t,e,r,n,i,o){const s=z_,a=kd,u=Id,d=zS;return _.openBlock(),_.createElementBlock("div",sjt,[r.disableUI?_.createCommentVNode("",!0):(_.openBlock(),_.createElementBlock("div",ajt,[ljt,_.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:_.withCtx(()=>[_.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:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.speciesList,(f,T)=>(_.openBlock(),_.createBlock(s,{key:T,label:T,value:T},{default:_.withCtx(()=>[_.createElementVNode("span",cjt,[_.createElementVNode("i",{class:_.normalizeClass(f.iconClass)},null,2)]),_.createTextVNode(" "+_.toDisplayString(T),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.speciesList,(f,T)=>_.withDirectives((_.openBlock(),_.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"])),[[_.vShow,t.activeSpecies==T]])),128))],512)}const hjt=Rd(ijt,[["render",ujt],["__scopeId","data-v-0a58a2d4"]]);c1.FlatmapVuer=zS,c1.MultiFlatmapVuer=hjt,Object.defineProperty(c1,Symbol.toStringTag,{value:"Module"})});
|
|
1718
|
+
This will fail in production.`);a=hh,a._s.has(n)||(o?jS(n,e,i,a):bq(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?jS(T,e,i,a,!0):bq(T,U2({},i),a,!0);u._hotUpdate(Q),delete a.state.value[T],a._s.delete(T)}if(process.env.NODE_ENV!=="production"&&DS){const T=_.getCurrentInstance();if(T&&T.proxy&&!u){const Q=T.proxy,y="_pStores"in Q?Q._pStores:Q._pStores={};y[n]=f}}return f}return s.$id=n,s}function SFt(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 HFt=MFt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),CFt=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},Lq=(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=Lq(o,s.key);a.length>0&&(s.children=a),r.push(s)}),r},AFt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},OFt={name:"FlatmapVuer",components:{Button:fO,Col:Ac,Loading:l2t,Radio:HO,Icon:Us,RadioGroup:CO,Row:Cc,Select:kd,Dialog:Mot,MapSvgIcon:jH.MapSvgIcon,MapSvgSpriteColor:jH.MapSvgSpriteColor,Tooltip:Fy.Tooltip,TreeControls:Fy.TreeControls,SelectionsGroup:FO,SvgLegends:jO,ElIconWarningFilled:JC,ElIconArrowDown:c_,ElIconArrowLeft:XC,DrawToolbar:Fy.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(t){return{annotator:_.markRaw(new vFt(`${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=Lq(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=>{zO(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 y=this.mapImp.featureProperties([Q]);if(s.includes(y.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,y])=>[Q==="featureId"?"id":Q,y])))}}}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,CFt(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.userInformation||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=_.markRaw(new M2t(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:_.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:x2t,isFC:!1,isCentreLine:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:L2t,tooltipEntry:AFt(),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:_.markRaw({alert:{with:!0,without:!0}})}},computed:{...SFt(HFt,["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&&e.canUpdate&&(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=_.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=_.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=_.markRaw(new PS(this.flatmapAPI)),this.flatmapQueries=_.markRaw(new w2t),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},Cs=t=>(_.pushScopeId("data-v-0574240c"),t=t(),_.popScopeId(),t),kFt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},IFt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},PFt={style:{height:"100%",width:"100%"},ref:"display"},VFt={class:"beta-popovers"},RFt=Cs(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),NFt=Cs(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),DFt=Cs(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),BFt=Cs(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),FFt=Cs(()=>_.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),jFt={key:1,class:"warning-text"},zFt=Cs(()=>_.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),UFt=Cs(()=>_.createElementVNode("b",null,"Neuron Connection mode",-1)),GFt=Cs(()=>_.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)),$Ft=Cs(()=>_.createElementVNode("b",null,"Now can display up to 6 panes",-1)),ZFt=Cs(()=>_.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)),WFt={class:"bottom-right-control"},qFt=Cs(()=>_.createElementVNode("div",null,[_.createTextVNode(" Fit to "),_.createElementVNode("br"),_.createTextVNode(" window ")],-1)),XFt=["innerHTML"],KFt=["innerHTML"],YFt={style:{"margin-bottom":"2px"}},JFt={key:0,class:"viewing-mode-title"},tjt=["onClick"],ejt=["onClick"];function rjt(t,e,r,n,i,o){const s=_.resolveComponent("map-svg-sprite-color"),a=JC,u=Us,d=Id,f=c_,T=_.resolveComponent("DrawToolbar"),Q=_.resolveComponent("map-svg-icon"),y=jO,b=_.resolveComponent("tree-controls"),w=FO,M=XC,E=fO,O=Cc,I=Ac,N=z_,F=kd,G=HO,Z=CO,et=_.resolveComponent("Tooltip"),nt=NO,ut=G_;return _.withDirectives((_.openBlock(),_.createElementBlock("div",kFt,[_.createVNode(s),_.createElementVNode("div",IFt,[_.createElementVNode("div",PFt,null,512),_.withDirectives(_.createElementVNode("div",VFt,[_.createElementVNode("div",null,[_.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[7].value,ref:"warningPopover"},{reference:_.withCtx(()=>[r.displayWarning?(_.openBlock(),_.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))},[_.createVNode(u,null,{default:_.withCtx(()=>[_.createVNode(a)]),_:1}),r.isLegacy?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[FFt,_.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(_.openBlock(),_.createElementBlock("span",jFt,"Beta"))],32)):_.createCommentVNode("",!0)]),default:_.withCtx(()=>[r.isLegacy?(_.openBlock(),_.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?(_.openBlock(),_.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=rt=>o.showTooltip(7)),onMouseout:e[3]||(e[3]=rt=>o.hideTooltip(7))},[_.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),RFt,_.createTextVNode(" models available in "),NFt,_.createTextVNode(". ")],32)):(_.openBlock(),_.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=rt=>o.showTooltip(7)),onMouseout:e[5]||(e[5]=rt=>o.hideTooltip(7))},[_.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),DFt,_.createTextVNode(" models available in "),BFt,_.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(_.openBlock(),_.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:_.withCtx(()=>[r.displayLatestChanges?(_.openBlock(),_.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))},[_.createVNode(u,null,{default:_.withCtx(()=>[_.createVNode(a)]),_:1}),zFt],32)):_.createCommentVNode("",!0)]),default:_.withCtx(()=>[UFt,GFt,$Ft,ZFt]),_:1},8,["visible"])):_.createCommentVNode("",!0)],512),[[_.vShow,!r.disableUI]]),_.withDirectives(_.createVNode(u,{class:_.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:_.withCtx(()=>[_.createVNode(f)]),_:1},8,["class","onClick"]),[[_.vShow,t.minimapResizeShow]]),t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI?(_.openBlock(),_.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"])):_.createCommentVNode("",!0),_.withDirectives(_.createElementVNode("div",WFt,[_.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:_.withCtx(()=>[_.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))},[_.createVNode(Q,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),_.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:_.withCtx(()=>[_.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))},[_.createVNode(Q,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),_.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:_.withCtx(()=>[_.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))},[_.createVNode(Q,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:_.withCtx(()=>[qFt]),_:1},8,["visible"])],512),[[_.vShow,!r.disableUI]]),_.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:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",{class:_.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.withDirectives((_.openBlock(),_.createElementBlock("div",{class:_.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:_.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?_.createCommentVNode("",!0):(_.openBlock(),_.createBlock(y,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(_.openBlock(),_.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:_.withCtx(()=>[_.withDirectives(_.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,XFt),[[nt,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):_.createCommentVNode("",!0),_.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:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,KFt),[[_.vShow,t.hoverVisibilities[0].value],[nt,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(_.openBlock(),_.createBlock(b,{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"])):_.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(_.openBlock(),_.createBlock(w,{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"])):_.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(_.openBlock(),_.createBlock(w,{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"])):_.createCommentVNode("",!0),t.taxonConnectivity&&t.taxonConnectivity.length>0?(_.openBlock(),_.createBlock(w,{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"])):_.createCommentVNode("",!0),!(t.isCentreLine||t.isFC)&&t.centreLines&&t.centreLines.length>0?(_.openBlock(),_.createBlock(w,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:t.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):_.createCommentVNode("",!0)],6)),[[nt,void 0,"checkBoxPopover"]]),_.createElementVNode("div",{onClick:e[22]||(e[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:_.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.createVNode(u,null,{default:_.withCtx(()=>[_.createVNode(M)]),_:1})],2)],2),[[_.vShow,!(r.disableUI||t.isCentreLine)]])]),_:1},8,["visible"]),t.openMapRef?(_.openBlock(),_.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:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(r.openMapOptions,rt=>(_.openBlock(),_.createBlock(O,{key:rt.key},{default:_.withCtx(()=>[_.createVNode(E,{type:"primary",plain:"",onClick:yt=>t.$emit("open-map",rt.key)},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):_.createCommentVNode("",!0),_.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:_.withCtx(()=>[_.createElementVNode("div",null,[_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Viewing Mode")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createElementVNode("div",YFt,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.viewingModes,(rt,yt,It)=>(_.openBlock(),_.createElementBlock(_.Fragment,{key:yt},[yt===t.viewingMode?(_.openBlock(),_.createElementBlock("span",JFt,[_.createElementVNode("b",null,_.toDisplayString(yt),1)])):(_.openBlock(),_.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Zt=>o.changeViewingMode(yt)},_.toDisplayString(yt),9,tjt))],64))),128))]),_.createVNode(O,{class:"viewing-mode-description"},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(t.viewingModes[t.viewingMode]),1)]),_:1})]),_:1}),t.viewingMode==="Annotation"&&t.userInformation?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Drawn By*")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(F,{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:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.drawnTypes,rt=>(_.openBlock(),_.createBlock(N,{key:rt,label:rt,value:rt},{default:_.withCtx(()=>[_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(I,{span:12},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Annotated By*")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(F,{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:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.annotatedTypes,rt=>(_.openBlock(),_.createBlock(N,{key:rt,label:rt,value:rt},{default:_.withCtx(()=>[_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(I,{span:12},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:1,class:"backgroundSpacer"})):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:2,class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Flight path display")]),_:1})):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:3,class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(Z,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[25]||(e[25]=rt=>t.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:_.withCtx(()=>[_.createVNode(G,{label:!1},{default:_.withCtx(()=>[_.createTextVNode("2D")]),_:1}),_.createVNode(G,{label:!0},{default:_.withCtx(()=>[_.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):_.createCommentVNode("",!0),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Organs display")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(Z,{modelValue:t.colourRadio,"onUpdate:modelValue":e[26]||(e[26]=rt=>t.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:_.withCtx(()=>[_.createVNode(G,{label:!0},{default:_.withCtx(()=>[_.createTextVNode("Colour")]),_:1}),_.createVNode(G,{label:!1},{default:_.withCtx(()=>[_.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Outlines display")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(Z,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[27]||(e[27]=rt=>t.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:_.withCtx(()=>[_.createVNode(G,{label:!0},{default:_.withCtx(()=>[_.createTextVNode("Show")]),_:1}),_.createVNode(G,{label:!1},{default:_.withCtx(()=>[_.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Change background")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.availableBackground,rt=>(_.openBlock(),_.createElementBlock("div",{key:rt,class:_.normalizeClass(["backgroundChoice",rt,rt==t.currentBackground?"active":""]),onClick:yt=>o.backgroundChangeCallback(rt)},null,10,ejt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),_.withDirectives(_.createElementVNode("div",{class:_.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(d,{visible:t.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:_.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(_.openBlock(),_.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))},[_.createVNode(Q,{icon:"openMap",class:"icon-button open-map-button"})],544)):_.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(d,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:_.withCtx(()=>[_.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))},[_.createVNode(Q,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})],2),[[_.vShow,!r.disableUI]]),_.withDirectives(_.createVNode(et,{ref:"tooltip",class:"tooltip",annotationEntry:t.annotationEntry,tooltipEntry:t.tooltipEntry,annotationDisplay:t.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"]),[[_.vShow,t.tooltipDisplay]])])])),[[ut,t.loading]])}const zS=Rd(OFt,[["render",rjt],["__scopeId","data-v-0574240c"]]);function njt(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 wq=new njt,xq={"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"},ijt={name:"MultiFlatmapVuer",components:{Col:Ac,Row:Cc,Option:z_,Select:kd,Popover:Id,FlatmapVuer:zS},mounted:function(){this.initialise(),wq.on("onActionClick",t=>{this.resourceSelected(t)}),wq.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 PS(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 xq?xq[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:_.markRaw([]),initialised:!1}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},ojt=t=>(_.pushScopeId("data-v-0a58a2d4"),t=t(),_.popScopeId(),t),sjt={class:"multi-container",ref:"multiContainer"},ajt={key:0,style:{position:"absolute","z-index":"10"}},ljt=ojt(()=>_.createElementVNode("div",{class:"species-display-text"},"Species",-1)),cjt={class:"select-box-icon"};function ujt(t,e,r,n,i,o){const s=z_,a=kd,u=Id,d=zS;return _.openBlock(),_.createElementBlock("div",sjt,[r.disableUI?_.createCommentVNode("",!0):(_.openBlock(),_.createElementBlock("div",ajt,[ljt,_.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:_.withCtx(()=>[_.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:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.speciesList,(f,T)=>(_.openBlock(),_.createBlock(s,{key:T,label:T,value:T},{default:_.withCtx(()=>[_.createElementVNode("span",cjt,[_.createElementVNode("i",{class:_.normalizeClass(f.iconClass)},null,2)]),_.createTextVNode(" "+_.toDisplayString(T),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.speciesList,(f,T)=>_.withDirectives((_.openBlock(),_.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"])),[[_.vShow,t.activeSpecies==T]])),128))],512)}const hjt=Rd(ijt,[["render",ujt],["__scopeId","data-v-0a58a2d4"]]);c1.FlatmapVuer=zS,c1.MultiFlatmapVuer=hjt,Object.defineProperty(c1,Symbol.toStringTag,{value:"Module"})});
|