@abi-software/mapintegratedvuer 0.7.0-vue3.8 → 0.7.0-vue3.9

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.
@@ -439,7 +439,7 @@ usage: app.provide(ID_INJECTION_KEY, {
439
439
  z-index:-1000 !important;
440
440
  top:0 !important;
441
441
  right:0 !important;
442
- `,g0t=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function y0t(e){const t=window.getComputedStyle(e),r=t.getPropertyValue("box-sizing"),n=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),i=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:g0t.map(o=>`${o}:${t.getPropertyValue(o)}`).join(";"),paddingSize:n,borderSize:i,boxSizing:r}}function p3e(e,t=1,r){var n;xu||(xu=document.createElement("textarea"),document.body.appendChild(xu));const{paddingSize:i,borderSize:o,boxSizing:s,contextStyle:l}=y0t(e);xu.setAttribute("style",`${l};${m0t}`),xu.value=e.value||e.placeholder||"";let c=xu.scrollHeight;const u={};s==="border-box"?c=c+o:s==="content-box"&&(c=c-i),xu.value="";const d=xu.scrollHeight-i;if(Ys(t)){let p=d*t;s==="border-box"&&(p=p+i+o),c=Math.max(p,c),u.minHeight=`${p}px`}if(Ys(r)){let p=d*r;s==="border-box"&&(p=p+i+o),c=Math.min(p,c)}return u.height=`${c}px`,(n=xu.parentNode)==null||n.removeChild(xu),xu=void 0,u}const T0t=Lo({id:{type:String,default:void 0},size:E8,disabled:Boolean,modelValue:{type:mi([String,Number,Object]),default:""},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:mi([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},suffixIcon:{type:lh},prefixIcon:{type:lh},containerRole:{type:String,default:void 0},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:mi([Object,Array,String]),default:()=>sg({})},autofocus:{type:Boolean,default:!1}}),v0t={[ss]:e=>Js(e),input:e=>Js(e),change:e=>Js(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},Q0t=["role"],b0t=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus"],x0t=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus"],_0t=a.defineComponent({name:"ElInput",inheritAttrs:!1}),w0t=a.defineComponent({..._0t,props:T0t,emits:v0t,setup(e,{expose:t,emit:r}){const n=e,i=a.useAttrs(),o=a.useSlots(),s=a.computed(()=>{const xe={};return n.containerRole==="combobox"&&(xe["aria-haspopup"]=i["aria-haspopup"],xe["aria-owns"]=i["aria-owns"],xe["aria-expanded"]=i["aria-expanded"]),xe}),l=a.computed(()=>[n.type==="textarea"?T.b():g.b(),g.m(f.value),g.is("disabled",m.value),g.is("exceed",he.value),{[g.b("group")]:o.prepend||o.append,[g.bm("group","append")]:o.append,[g.bm("group","prepend")]:o.prepend,[g.m("prefix")]:o.prefix||n.prefixIcon,[g.m("suffix")]:o.suffix||n.suffixIcon||n.clearable||n.showPassword,[g.bm("suffix","password-clear")]:U.value&&X.value},i.class]),c=a.computed(()=>[g.e("wrapper"),g.is("focus",O.value)]),u=R1t({excludeKeys:a.computed(()=>Object.keys(s.value))}),{form:d,formItem:p}=dh(),{inputId:h}=gx(n,{formItemContext:p}),f=uh(),m=mg(),g=li("input"),T=li("textarea"),y=a.shallowRef(),v=a.shallowRef(),_=a.ref(!1),b=a.ref(!1),L=a.ref(!1),w=a.ref(),k=a.shallowRef(n.inputStyle),C=a.computed(()=>y.value||v.value),{wrapperRef:A,isFocused:O,handleFocus:N,handleBlur:I}=u3e(C,{afterBlur(){var xe;n.validateEvent&&((xe=p==null?void 0:p.validate)==null||xe.call(p,"blur").catch(Ue=>$s(Ue)))}}),R=a.computed(()=>{var xe;return(xe=d==null?void 0:d.statusIcon)!=null?xe:!1}),D=a.computed(()=>(p==null?void 0:p.validateState)||""),j=a.computed(()=>D.value&&kue[D.value]),G=a.computed(()=>L.value?C1t:w1t),P=a.computed(()=>[i.style,n.inputStyle]),W=a.computed(()=>[n.inputStyle,k.value,{resize:n.resize}]),K=a.computed(()=>oh(n.modelValue)?"":String(n.modelValue)),U=a.computed(()=>n.clearable&&!m.value&&!n.readonly&&!!K.value&&(O.value||_.value)),X=a.computed(()=>n.showPassword&&!m.value&&!n.readonly&&!!K.value&&(!!K.value||O.value)),ee=a.computed(()=>n.showWordLimit&&!!u.value.maxlength&&(n.type==="text"||n.type==="textarea")&&!m.value&&!n.readonly&&!n.showPassword),oe=a.computed(()=>K.value.length),he=a.computed(()=>!!ee.value&&oe.value>Number(u.value.maxlength)),me=a.computed(()=>!!o.suffix||!!n.suffixIcon||U.value||n.showPassword||ee.value||!!D.value&&R.value),[ie,be]=a0t(y);zC(v,xe=>{if(ue(),!ee.value||n.resize!=="both")return;const Ue=xe[0],{width:$e}=Ue.contentRect;w.value={right:`calc(100% - ${$e+15+6}px)`}});const re=()=>{const{type:xe,autosize:Ue}=n;if(!(!Xs||xe!=="textarea"||!v.value))if(Ue){const $e=Sc(Ue)?Ue.minRows:void 0,at=Sc(Ue)?Ue.maxRows:void 0,Ht=p3e(v.value,$e,at);k.value={overflowY:"hidden",...Ht},a.nextTick(()=>{v.value.offsetHeight,k.value=Ht})}else k.value={minHeight:p3e(v.value).minHeight}},ue=(xe=>{let Ue=!1;return()=>{var $e;Ue||!n.autosize||(($e=v.value)==null?void 0:$e.offsetParent)===null||(xe(),Ue=!0)}})(re),ne=()=>{const xe=C.value,Ue=n.formatter?n.formatter(K.value):K.value;!xe||xe.value===Ue||(xe.value=Ue)},ye=async xe=>{ie();let{value:Ue}=xe.target;if(n.formatter&&(Ue=n.parser?n.parser(Ue):Ue),!b.value){if(Ue===K.value){ne();return}r(ss,Ue),r("input",Ue),await a.nextTick(),ne(),be()}},_e=xe=>{r("change",xe.target.value)},Ie=xe=>{r("compositionstart",xe),b.value=!0},qe=xe=>{var Ue;r("compositionupdate",xe);const $e=(Ue=xe.target)==null?void 0:Ue.value,at=$e[$e.length-1]||"";b.value=!Mue(at)},Ge=xe=>{r("compositionend",xe),b.value&&(b.value=!1,ye(xe))},et=()=>{L.value=!L.value,Ve()},Ve=async()=>{var xe;await a.nextTick(),(xe=C.value)==null||xe.focus()},Ne=()=>{var xe;return(xe=C.value)==null?void 0:xe.blur()},it=xe=>{_.value=!1,r("mouseleave",xe)},Re=xe=>{_.value=!0,r("mouseenter",xe)},pt=xe=>{r("keydown",xe)},yt=()=>{var xe;(xe=C.value)==null||xe.select()},ct=()=>{r(ss,""),r("change",""),r("clear"),r("input","")};return a.watch(()=>n.modelValue,()=>{var xe;a.nextTick(()=>re()),n.validateEvent&&((xe=p==null?void 0:p.validate)==null||xe.call(p,"change").catch(Ue=>$s(Ue)))}),a.watch(K,()=>ne()),a.watch(()=>n.type,async()=>{await a.nextTick(),ne(),re()}),a.onMounted(()=>{!n.formatter&&n.parser&&$s("ElInput","If you set the parser, you also need to set the formatter."),ne(),a.nextTick(re)}),t({input:y,textarea:v,ref:C,textareaStyle:W,autosize:a.toRef(n,"autosize"),focus:Ve,blur:Ne,select:yt,clear:ct,resizeTextarea:re}),(xe,Ue)=>a.withDirectives((a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(s),{class:a.unref(l),style:a.unref(P),role:xe.containerRole,onMouseenter:Re,onMouseleave:it}),[a.createCommentVNode(" input "),xe.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),xe.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(g).be("group","prepend"))},[a.renderSlot(xe.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:A,class:a.normalizeClass(a.unref(c))},[a.createCommentVNode(" prefix slot "),xe.$slots.prefix||xe.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(g).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(g).e("prefix-inner"))},[a.renderSlot(xe.$slots,"prefix"),xe.prefixIcon?(a.openBlock(),a.createBlock(a.unref(ql),{key:0,class:a.normalizeClass(a.unref(g).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(xe.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(h),ref_key:"input",ref:y,class:a.unref(g).e("inner")},a.unref(u),{type:xe.showPassword?L.value?"text":"password":xe.type,disabled:a.unref(m),formatter:xe.formatter,parser:xe.parser,readonly:xe.readonly,autocomplete:xe.autocomplete,tabindex:xe.tabindex,"aria-label":xe.label,placeholder:xe.placeholder,style:xe.inputStyle,form:n.form,autofocus:n.autofocus,onCompositionstart:Ie,onCompositionupdate:qe,onCompositionend:Ge,onInput:ye,onFocus:Ue[0]||(Ue[0]=(...$e)=>a.unref(N)&&a.unref(N)(...$e)),onBlur:Ue[1]||(Ue[1]=(...$e)=>a.unref(I)&&a.unref(I)(...$e)),onChange:_e,onKeydown:pt}),null,16,b0t),a.createCommentVNode(" suffix slot "),a.unref(me)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(g).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(g).e("suffix-inner"))},[!a.unref(U)||!a.unref(X)||!a.unref(ee)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(xe.$slots,"suffix"),xe.suffixIcon?(a.openBlock(),a.createBlock(a.unref(ql),{key:0,class:a.normalizeClass(a.unref(g).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(xe.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(U)?(a.openBlock(),a.createBlock(a.unref(ql),{key:1,class:a.normalizeClass([a.unref(g).e("icon"),a.unref(g).e("clear")]),onMousedown:a.withModifiers(a.unref(Jb),["prevent"]),onClick:ct},{default:a.withCtx(()=>[a.createVNode(a.unref(lU))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(X)?(a.openBlock(),a.createBlock(a.unref(ql),{key:2,class:a.normalizeClass([a.unref(g).e("icon"),a.unref(g).e("password")]),onClick:et},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(G))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(ee)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(g).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(g).e("count-inner"))},a.toDisplayString(a.unref(oe))+" / "+a.toDisplayString(a.unref(u).maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(D)&&a.unref(j)&&a.unref(R)?(a.openBlock(),a.createBlock(a.unref(ql),{key:4,class:a.normalizeClass([a.unref(g).e("icon"),a.unref(g).e("validateIcon"),a.unref(g).is("loading",a.unref(D)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(j))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),xe.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(g).be("group","append"))},[a.renderSlot(xe.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(h),ref_key:"textarea",ref:v,class:a.unref(T).e("inner")},a.unref(u),{tabindex:xe.tabindex,disabled:a.unref(m),readonly:xe.readonly,autocomplete:xe.autocomplete,style:a.unref(W),"aria-label":xe.label,placeholder:xe.placeholder,form:n.form,autofocus:n.autofocus,onCompositionstart:Ie,onCompositionupdate:qe,onCompositionend:Ge,onInput:ye,onFocus:Ue[2]||(Ue[2]=(...$e)=>a.unref(N)&&a.unref(N)(...$e)),onBlur:Ue[3]||(Ue[3]=(...$e)=>a.unref(I)&&a.unref(I)(...$e)),onChange:_e,onKeydown:pt}),null,16,x0t),a.unref(ee)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(w.value),class:a.normalizeClass(a.unref(g).e("count"))},a.toDisplayString(a.unref(oe))+" / "+a.toDisplayString(a.unref(u).maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,Q0t)),[[a.vShow,xe.type!=="hidden"]])}});var L0t=hi(w0t,[["__file","input.vue"]]);const lE=Jc(L0t),gg=4,S0t={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},k0t=({move:e,size:t,bar:r})=>({[r.size]:t,transform:`translate${r.axis}(${e}%)`}),h3e=Symbol("scrollbarContextKey"),M0t=Lo({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),C0t="Thumb";var f3e=hi(a.defineComponent({__name:"thumb",props:M0t,setup(e){const t=e,r=a.inject(h3e),n=li("scrollbar");r||u1t(C0t,"can not inject scrollbar context");const i=a.ref(),o=a.ref(),s=a.ref({}),l=a.ref(!1);let c=!1,u=!1,d=Xs?document.onselectstart:null;const p=a.computed(()=>S0t[t.vertical?"vertical":"horizontal"]),h=a.computed(()=>k0t({size:t.size,move:t.move,bar:p.value})),f=a.computed(()=>i.value[p.value.offset]**2/r.wrapElement[p.value.scrollSize]/t.ratio/o.value[p.value.offset]),m=w=>{var k;if(w.stopPropagation(),w.ctrlKey||[1,2].includes(w.button))return;(k=window.getSelection())==null||k.removeAllRanges(),T(w);const C=w.currentTarget;C&&(s.value[p.value.axis]=C[p.value.offset]-(w[p.value.client]-C.getBoundingClientRect()[p.value.direction]))},g=w=>{if(!o.value||!i.value||!r.wrapElement)return;const k=Math.abs(w.target.getBoundingClientRect()[p.value.direction]-w[p.value.client]),C=o.value[p.value.offset]/2,A=(k-C)*100*f.value/i.value[p.value.offset];r.wrapElement[p.value.scroll]=A*r.wrapElement[p.value.scrollSize]/100},T=w=>{w.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",v),d=document.onselectstart,document.onselectstart=()=>!1},y=w=>{if(!i.value||!o.value||c===!1)return;const k=s.value[p.value.axis];if(!k)return;const C=(i.value.getBoundingClientRect()[p.value.direction]-w[p.value.client])*-1,A=o.value[p.value.offset]-k,O=(C-A)*100*f.value/i.value[p.value.offset];r.wrapElement[p.value.scroll]=O*r.wrapElement[p.value.scrollSize]/100},v=()=>{c=!1,s.value[p.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v),L(),u&&(l.value=!1)},_=()=>{u=!1,l.value=!!t.size},b=()=>{u=!0,l.value=c};a.onBeforeUnmount(()=>{L(),document.removeEventListener("mouseup",v)});const L=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return nh(a.toRef(r,"scrollbarElement"),"mousemove",_),nh(a.toRef(r,"scrollbarElement"),"mouseleave",b),(w,k)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(n).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:i,class:a.normalizeClass([a.unref(n).e("bar"),a.unref(n).is(a.unref(p).key)]),onMousedown:g},[a.createElementVNode("div",{ref_key:"thumb",ref:o,class:a.normalizeClass(a.unref(n).e("thumb")),style:a.normalizeStyle(a.unref(h)),onMousedown:m},null,38)],34),[[a.vShow,w.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const E0t=Lo({always:{type:Boolean,default:!0},width:String,height:String,ratioX:{type:Number,default:1},ratioY:{type:Number,default:1}});var A0t=hi(a.defineComponent({__name:"bar",props:E0t,setup(e,{expose:t}){const r=e,n=a.ref(0),i=a.ref(0);return t({handleScroll:o=>{if(o){const s=o.offsetHeight-gg,l=o.offsetWidth-gg;i.value=o.scrollTop*100/s*r.ratioY,n.value=o.scrollLeft*100/l*r.ratioX}}}),(o,s)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(f3e,{move:n.value,ratio:o.ratioX,size:o.width,always:o.always},null,8,["move","ratio","size","always"]),a.createVNode(f3e,{move:i.value,ratio:o.ratioY,size:o.height,vertical:"",always:o.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const O0t=Lo({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:mi([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},id:String,role:String,ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical"]}}),H0t={scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(Ys)},wU="ElScrollbar",V0t=a.defineComponent({name:wU}),I0t=a.defineComponent({...V0t,props:O0t,emits:H0t,setup(e,{expose:t,emit:r}){const n=e,i=li("scrollbar");let o,s;const l=a.ref(),c=a.ref(),u=a.ref(),d=a.ref("0"),p=a.ref("0"),h=a.ref(),f=a.ref(1),m=a.ref(1),g=a.computed(()=>{const k={};return n.height&&(k.height=ag(n.height)),n.maxHeight&&(k.maxHeight=ag(n.maxHeight)),[n.wrapStyle,k]}),T=a.computed(()=>[n.wrapClass,i.e("wrap"),{[i.em("wrap","hidden-default")]:!n.native}]),y=a.computed(()=>[i.e("view"),n.viewClass]),v=()=>{var k;c.value&&((k=h.value)==null||k.handleScroll(c.value),r("scroll",{scrollTop:c.value.scrollTop,scrollLeft:c.value.scrollLeft}))};function _(k,C){Sc(k)?c.value.scrollTo(k):Ys(k)&&Ys(C)&&c.value.scrollTo(k,C)}const b=k=>{if(!Ys(k)){$s(wU,"value must be a number");return}c.value.scrollTop=k},L=k=>{if(!Ys(k)){$s(wU,"value must be a number");return}c.value.scrollLeft=k},w=()=>{if(!c.value)return;const k=c.value.offsetHeight-gg,C=c.value.offsetWidth-gg,A=k**2/c.value.scrollHeight,O=C**2/c.value.scrollWidth,N=Math.max(A,n.minSize),I=Math.max(O,n.minSize);f.value=A/(k-A)/(N/(k-N)),m.value=O/(C-O)/(I/(C-I)),p.value=N+gg<k?`${N}px`:"",d.value=I+gg<C?`${I}px`:""};return a.watch(()=>n.noresize,k=>{k?(o==null||o(),s==null||s()):({stop:o}=zC(u,w),s=nh("resize",w))},{immediate:!0}),a.watch(()=>[n.maxHeight,n.height],()=>{n.native||a.nextTick(()=>{var k;w(),c.value&&((k=h.value)==null||k.handleScroll(c.value))})}),a.provide(h3e,a.reactive({scrollbarElement:l,wrapElement:c})),a.onMounted(()=>{n.native||a.nextTick(()=>{w()})}),a.onUpdated(()=>w()),t({wrapRef:c,update:w,scrollTo:_,setScrollTop:b,setScrollLeft:L,handleScroll:v}),(k,C)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:l,class:a.normalizeClass(a.unref(i).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:c,class:a.normalizeClass(a.unref(T)),style:a.normalizeStyle(a.unref(g)),onScroll:v},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(k.tag),{id:k.id,ref_key:"resizeRef",ref:u,class:a.normalizeClass(a.unref(y)),style:a.normalizeStyle(k.viewStyle),role:k.role,"aria-label":k.ariaLabel,"aria-orientation":k.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(k.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],38),k.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(A0t,{key:0,ref_key:"barRef",ref:h,height:p.value,width:d.value,always:k.always,"ratio-x":m.value,"ratio-y":f.value},null,8,["height","width","always","ratio-x","ratio-y"]))],2))}});var P0t=hi(I0t,[["__file","scrollbar.vue"]]);const N0t=Jc(P0t),LU=Symbol("popper"),m3e=Symbol("popperContent"),B0t=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],g3e=Lo({role:{type:String,values:B0t,default:"tooltip"}}),R0t=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),F0t=a.defineComponent({...R0t,props:g3e,setup(e,{expose:t}){const r=e,n=a.ref(),i=a.ref(),o=a.ref(),s=a.ref(),l=a.computed(()=>r.role),c={triggerRef:n,popperInstanceRef:i,contentRef:o,referenceRef:s,role:l};return t(c),a.provide(LU,c),(u,d)=>a.renderSlot(u.$slots,"default")}});var D0t=hi(F0t,[["__file","popper.vue"]]);const y3e=Lo({arrowOffset:{type:Number,default:5}}),z0t=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),j0t=a.defineComponent({...z0t,props:y3e,setup(e,{expose:t}){const r=e,n=li("popper"),{arrowOffset:i,arrowRef:o,arrowStyle:s}=a.inject(m3e,void 0);return a.watch(()=>r.arrowOffset,l=>{i.value=l}),a.onBeforeUnmount(()=>{o.value=void 0}),t({arrowRef:o}),(l,c)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:o,class:a.normalizeClass(a.unref(n).e("arrow")),style:a.normalizeStyle(a.unref(s)),"data-popper-arrow":""},null,6))}});var U0t=hi(j0t,[["__file","arrow.vue"]]);const SU="ElOnlyChild",G0t=a.defineComponent({name:SU,setup(e,{slots:t,attrs:r}){var n;const i=a.inject(i3e),o=o0t((n=i==null?void 0:i.setForwardRef)!=null?n:Jb);return()=>{var s;const l=(s=t.default)==null?void 0:s.call(t,r);if(!l)return null;if(l.length>1)return $s(SU,"requires exact only one valid child."),null;const c=T3e(l);return c?a.withDirectives(a.cloneVNode(c,r),[[o]]):($s(SU,"no valid child node found"),null)}}});function T3e(e){if(!e)return null;const t=e;for(const r of t){if(Sc(r))switch(r.type){case a.Comment:continue;case a.Text:case"svg":return v3e(r);case a.Fragment:return T3e(r.children);default:return r}return v3e(r)}return null}function v3e(e){const t=li("only-child");return a.createVNode("span",{class:t.e("content")},[e])}const Q3e=Lo({virtualRef:{type:mi(Object)},virtualTriggering:Boolean,onMouseenter:{type:mi(Function)},onMouseleave:{type:mi(Function)},onClick:{type:mi(Function)},onKeydown:{type:mi(Function)},onFocus:{type:mi(Function)},onBlur:{type:mi(Function)},onContextmenu:{type:mi(Function)},id:String,open:Boolean}),q0t=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),W0t=a.defineComponent({...q0t,props:Q3e,setup(e,{expose:t}){const r=e,{role:n,triggerRef:i}=a.inject(LU,void 0);i0t(i);const o=a.computed(()=>l.value?r.id:void 0),s=a.computed(()=>{if(n&&n.value==="tooltip")return r.open&&r.id?r.id:void 0}),l=a.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),c=a.computed(()=>l.value?`${r.open}`:void 0);let u;return a.onMounted(()=>{a.watch(()=>r.virtualRef,d=>{d&&(i.value=rh(d))},{immediate:!0}),a.watch(i,(d,p)=>{u==null||u(),u=void 0,ix(d)&&(["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"].forEach(h=>{var f;const m=r[h];m&&(d.addEventListener(h.slice(2).toLowerCase(),m),(f=p==null?void 0:p.removeEventListener)==null||f.call(p,h.slice(2).toLowerCase(),m))}),u=a.watch([o,s,l,c],h=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((f,m)=>{oh(h[m])?d.removeAttribute(f):d.setAttribute(f,h[m])})},{immediate:!0})),ix(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(h=>p.removeAttribute(h))},{immediate:!0})}),a.onBeforeUnmount(()=>{u==null||u(),u=void 0}),t({triggerRef:i}),(d,p)=>d.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(G0t),a.mergeProps({key:0},d.$attrs,{"aria-controls":a.unref(o),"aria-describedby":a.unref(s),"aria-expanded":a.unref(c),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(d.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var Z0t=hi(W0t,[["__file","trigger.vue"]]);const kU="focus-trap.focus-after-trapped",MU="focus-trap.focus-after-released",K0t="focus-trap.focusout-prevented",b3e={cancelable:!0,bubbles:!1},X0t={cancelable:!0,bubbles:!1},x3e="focusAfterTrapped",_3e="focusAfterReleased",J0t=Symbol("elFocusTrap"),CU=a.ref(),cE=a.ref(0),EU=a.ref(0);let uE=0;const w3e=e=>{const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t},L3e=(e,t)=>{for(const r of e)if(!Y0t(r,t))return r},Y0t=(e,t)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},$0t=e=>{const t=w3e(e),r=L3e(t,e),n=L3e(t.reverse(),e);return[r,n]},eut=e=>e instanceof HTMLInputElement&&"select"in e,ph=(e,t)=>{if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),EU.value=window.performance.now(),e!==r&&eut(e)&&t&&e.select()}};function S3e(e,t){const r=[...e],n=e.indexOf(t);return n!==-1&&r.splice(n,1),r}const tut=()=>{let e=[];return{push:t=>{const r=e[0];r&&t!==r&&r.pause(),e=S3e(e,t),e.unshift(t)},remove:t=>{var r,n;e=S3e(e,t),(n=(r=e[0])==null?void 0:r.resume)==null||n.call(r)}}},rut=(e,t=!1)=>{const r=document.activeElement;for(const n of e)if(ph(n,t),document.activeElement!==r)return},k3e=tut(),nut=()=>cE.value>EU.value,dE=()=>{CU.value="pointer",cE.value=window.performance.now()},M3e=()=>{CU.value="keyboard",cE.value=window.performance.now()},iut=()=>(a.onMounted(()=>{uE===0&&(document.addEventListener("mousedown",dE),document.addEventListener("touchstart",dE),document.addEventListener("keydown",M3e)),uE++}),a.onBeforeUnmount(()=>{uE--,uE<=0&&(document.removeEventListener("mousedown",dE),document.removeEventListener("touchstart",dE),document.removeEventListener("keydown",M3e))}),{focusReason:CU,lastUserFocusTimestamp:cE,lastAutomatedFocusTimestamp:EU}),pE=e=>new CustomEvent(K0t,{...X0t,detail:e}),out=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[x3e,_3e,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const r=a.ref();let n,i;const{focusReason:o}=iut();$2t(m=>{e.trapped&&!s.paused&&t("release-requested",m)});const s={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!e.loop&&!e.trapped||s.paused)return;const{key:g,altKey:T,ctrlKey:y,metaKey:v,currentTarget:_,shiftKey:b}=m,{loop:L}=e,w=g===kc.tab&&!T&&!y&&!v,k=document.activeElement;if(w&&k){const C=_,[A,O]=$0t(C);if(A&&O){if(!b&&k===O){const N=pE({focusReason:o.value});t("focusout-prevented",N),N.defaultPrevented||(m.preventDefault(),L&&ph(A,!0))}else if(b&&[A,C].includes(k)){const N=pE({focusReason:o.value});t("focusout-prevented",N),N.defaultPrevented||(m.preventDefault(),L&&ph(O,!0))}}else if(k===C){const N=pE({focusReason:o.value});t("focusout-prevented",N),N.defaultPrevented||m.preventDefault()}}};a.provide(J0t,{focusTrapRef:r,onKeydown:l}),a.watch(()=>e.focusTrapEl,m=>{m&&(r.value=m)},{immediate:!0}),a.watch([r],([m],[g])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",d),m.addEventListener("focusout",p)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",p))});const c=m=>{t(x3e,m)},u=m=>t(_3e,m),d=m=>{const g=a.unref(r);if(!g)return;const T=m.target,y=m.relatedTarget,v=T&&g.contains(T);e.trapped||y&&g.contains(y)||(n=y),v&&t("focusin",m),!s.paused&&e.trapped&&(v?i=T:ph(i,!0))},p=m=>{const g=a.unref(r);if(!(s.paused||!g))if(e.trapped){const T=m.relatedTarget;!oh(T)&&!g.contains(T)&&setTimeout(()=>{if(!s.paused&&e.trapped){const y=pE({focusReason:o.value});t("focusout-prevented",y),y.defaultPrevented||ph(i,!0)}},0)}else{const T=m.target;T&&g.contains(T)||t("focusout",m)}};async function h(){await a.nextTick();const m=a.unref(r);if(m){k3e.push(s);const g=m.contains(document.activeElement)?n:document.activeElement;if(n=g,!m.contains(g)){const T=new Event(kU,b3e);m.addEventListener(kU,c),m.dispatchEvent(T),T.defaultPrevented||a.nextTick(()=>{let y=e.focusStartEl;Js(y)||(ph(y),document.activeElement!==y&&(y="first")),y==="first"&&rut(w3e(m),!0),(document.activeElement===g||y==="container")&&ph(m)})}}}function f(){const m=a.unref(r);if(m){m.removeEventListener(kU,c);const g=new CustomEvent(MU,{...b3e,detail:{focusReason:o.value}});m.addEventListener(MU,u),m.dispatchEvent(g),!g.defaultPrevented&&(o.value=="keyboard"||!nut()||m.contains(document.activeElement))&&ph(n??document.body),m.removeEventListener(MU,u),k3e.remove(s)}}return a.onMounted(()=>{e.trapped&&h(),a.watch(()=>e.trapped,m=>{m?h():f()})}),a.onBeforeUnmount(()=>{e.trapped&&f()}),{onKeydown:l}}});function aut(e,t,r,n,i,o){return a.renderSlot(e.$slots,"default",{handleKeydown:e.onKeydown})}var sut=hi(out,[["render",aut],["__file","focus-trap.vue"]]);const lut=["fixed","absolute"],cut=Lo({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:mi(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:rE,default:"bottom"},popperOptions:{type:mi(Object),default:()=>({})},strategy:{type:String,values:lut,default:"absolute"}}),C3e=Lo({...cut,id:String,style:{type:mi([String,Array,Object])},className:{type:mi([String,Array,Object])},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:mi([String,Array,Object])},popperStyle:{type:mi([String,Array,Object])},referenceEl:{type:mi(Object)},triggerTargetEl:{type:mi(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},ariaLabel:{type:String,default:void 0},virtualTriggering:Boolean,zIndex:Number}),uut={mouseenter:e=>e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},dut=(e,t=[])=>{const{placement:r,strategy:n,popperOptions:i}=e,o={placement:r,strategy:n,...i,modifiers:[...hut(e),...t]};return fut(o,i==null?void 0:i.modifiers),o},put=e=>{if(Xs)return rh(e)};function hut(e){const{offset:t,gpuAcceleration:r,fallbackPlacements:n}=e;return[{name:"offset",options:{offset:[0,t??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:n}},{name:"computeStyles",options:{gpuAcceleration:r}}]}function fut(e,t){t&&(e.modifiers=[...e.modifiers,...t??[]])}const mut=0,gut=e=>{const{popperInstanceRef:t,contentRef:r,triggerRef:n,role:i}=a.inject(LU,void 0),o=a.ref(),s=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!e.visible})),c=a.computed(()=>{var y;const v=a.unref(o),_=(y=a.unref(s))!=null?y:mut;return{name:"arrow",enabled:!n1t(v),options:{element:v,padding:_}}}),u=a.computed(()=>({onFirstUpdate:()=>{m()},...dut(e,[a.unref(c),a.unref(l)])})),d=a.computed(()=>put(e.referenceEl)||a.unref(n)),{attributes:p,state:h,styles:f,update:m,forceUpdate:g,instanceRef:T}=X2t(d,r,u);return a.watch(T,y=>t.value=y),a.onMounted(()=>{a.watch(()=>{var y;return(y=a.unref(d))==null?void 0:y.getBoundingClientRect()},()=>{m()})}),{attributes:p,arrowRef:o,contentRef:r,instanceRef:T,state:h,styles:f,role:i,forceUpdate:g,update:m}},yut=(e,{attributes:t,styles:r,role:n})=>{const{nextZIndex:i}=l3e(),o=li("popper"),s=a.computed(()=>a.unref(t).popper),l=a.ref(Ys(e.zIndex)?e.zIndex:i()),c=a.computed(()=>[o.b(),o.is("pure",e.pure),o.is(e.effect),e.popperClass]),u=a.computed(()=>[{zIndex:a.unref(l)},a.unref(r).popper,e.popperStyle||{}]),d=a.computed(()=>n.value==="dialog"?"false":void 0),p=a.computed(()=>a.unref(r).arrow||{});return{ariaModal:d,arrowStyle:p,contentAttrs:s,contentClass:c,contentStyle:u,contentZIndex:l,updateZIndex:()=>{l.value=Ys(e.zIndex)?e.zIndex:i()}}},Tut=(e,t)=>{const r=a.ref(!1),n=a.ref();return{focusStartRef:n,trapped:r,onFocusAfterReleased:i=>{var o;((o=i.detail)==null?void 0:o.focusReason)!=="pointer"&&(n.value="first",t("blur"))},onFocusAfterTrapped:()=>{t("focus")},onFocusInTrap:i=>{e.visible&&!r.value&&(i.target&&(n.value=i.target),r.value=!0)},onFocusoutPrevented:i=>{e.trapping||(i.detail.focusReason==="pointer"&&i.preventDefault(),r.value=!1)},onReleaseRequested:()=>{r.value=!1,t("close")}}},vut=a.defineComponent({name:"ElPopperContent"}),Qut=a.defineComponent({...vut,props:C3e,emits:uut,setup(e,{expose:t,emit:r}){const n=e,{focusStartRef:i,trapped:o,onFocusAfterReleased:s,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=Tut(n,r),{attributes:p,arrowRef:h,contentRef:f,styles:m,instanceRef:g,role:T,update:y}=gut(n),{ariaModal:v,arrowStyle:_,contentAttrs:b,contentClass:L,contentStyle:w,updateZIndex:k}=yut(n,{styles:m,attributes:p,role:T}),C=a.inject(mx,void 0),A=a.ref();a.provide(m3e,{arrowStyle:_,arrowRef:h,arrowOffset:A}),C&&(C.addInputId||C.removeInputId)&&a.provide(mx,{...C,addInputId:Jb,removeInputId:Jb});let O;const N=(R=!0)=>{y(),R&&k()},I=()=>{N(!1),n.visible&&n.focusOnShow?o.value=!0:n.visible===!1&&(o.value=!1)};return a.onMounted(()=>{a.watch(()=>n.triggerTargetEl,(R,D)=>{O==null||O(),O=void 0;const j=a.unref(R||f.value),G=a.unref(D||f.value);ix(j)&&(O=a.watch([T,()=>n.ariaLabel,v,()=>n.id],P=>{["role","aria-label","aria-modal","id"].forEach((W,K)=>{oh(P[K])?j.removeAttribute(W):j.setAttribute(W,P[K])})},{immediate:!0})),G!==j&&ix(G)&&["role","aria-label","aria-modal","id"].forEach(P=>{G.removeAttribute(P)})},{immediate:!0}),a.watch(()=>n.visible,I,{immediate:!0})}),a.onBeforeUnmount(()=>{O==null||O(),O=void 0}),t({popperContentRef:f,popperInstanceRef:g,updatePopper:N,contentStyle:w}),(R,D)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:f},a.unref(b),{style:a.unref(w),class:a.unref(L),tabindex:"-1",onMouseenter:D[0]||(D[0]=j=>R.$emit("mouseenter",j)),onMouseleave:D[1]||(D[1]=j=>R.$emit("mouseleave",j))}),[a.createVNode(a.unref(sut),{trapped:a.unref(o),"trap-on-focus-in":!0,"focus-trap-el":a.unref(f),"focus-start-el":a.unref(i),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(s),onFocusin:a.unref(c),onFocusoutPrevented:a.unref(u),onReleaseRequested:a.unref(d)},{default:a.withCtx(()=>[a.renderSlot(R.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});var but=hi(Qut,[["__file","content.vue"]]);const xut=Jc(D0t),AU=Symbol("elTooltip"),T2=Lo({...r0t,...C3e,appendTo:{type:mi([String,Object])},content:{type:String,default:""},rawContent:{type:Boolean,default:!1},persistent:Boolean,ariaLabel:String,visible:{type:mi(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean}),yx=Lo({...Q3e,disabled:Boolean,trigger:{type:mi([String,Array]),default:"hover"},triggerKeys:{type:mi(Array),default:()=>[kc.enter,kc.space]}}),{useModelToggleProps:_ut,useModelToggleEmits:wut,useModelToggle:Lut}=W1t("visible"),Sut=Lo({...g3e,..._ut,...T2,...yx,...y3e,showArrow:{type:Boolean,default:!0}}),kut=[...wut,"before-show","before-hide","show","hide","open","close"],Mut=(e,t)=>ng(e)?e.includes(t):e===t,yg=(e,t,r)=>n=>{Mut(a.unref(e),t)&&r(n)},Cut=a.defineComponent({name:"ElTooltipTrigger"}),Eut=a.defineComponent({...Cut,props:yx,setup(e,{expose:t}){const r=e,n=li("tooltip"),{controlled:i,id:o,open:s,onOpen:l,onClose:c,onToggle:u}=a.inject(AU,void 0),d=a.ref(null),p=()=>{if(a.unref(i)||r.disabled)return!0},h=a.toRef(r,"trigger"),f=O4(p,yg(h,"hover",l)),m=O4(p,yg(h,"hover",c)),g=O4(p,yg(h,"click",b=>{b.button===0&&u(b)})),T=O4(p,yg(h,"focus",l)),y=O4(p,yg(h,"focus",c)),v=O4(p,yg(h,"contextmenu",b=>{b.preventDefault(),u(b)})),_=O4(p,b=>{const{code:L}=b;r.triggerKeys.includes(L)&&(b.preventDefault(),u(b))});return t({triggerRef:d}),(b,L)=>(a.openBlock(),a.createBlock(a.unref(Z0t),{id:a.unref(o),"virtual-ref":b.virtualRef,open:a.unref(s),"virtual-triggering":b.virtualTriggering,class:a.normalizeClass(a.unref(n).e("trigger")),onBlur:a.unref(y),onClick:a.unref(g),onContextmenu:a.unref(v),onFocus:a.unref(T),onMouseenter:a.unref(f),onMouseleave:a.unref(m),onKeydown:a.unref(_)},{default:a.withCtx(()=>[a.renderSlot(b.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var Aut=hi(Eut,[["__file","trigger.vue"]]);const Out=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),Hut=a.defineComponent({...Out,props:T2,setup(e,{expose:t}){const r=e,{selector:n}=n3e(),i=li("tooltip"),o=a.ref(null),s=a.ref(!1),{controlled:l,id:c,open:u,trigger:d,onClose:p,onOpen:h,onShow:f,onHide:m,onBeforeShow:g,onBeforeHide:T}=a.inject(AU,void 0),y=a.computed(()=>r.transition||`${i.namespace.value}-fade-in-linear`),v=a.computed(()=>process.env.NODE_ENV==="test"?!0:r.persistent);a.onBeforeUnmount(()=>{s.value=!0});const _=a.computed(()=>a.unref(v)?!0:a.unref(u)),b=a.computed(()=>r.disabled?!1:a.unref(u)),L=a.computed(()=>r.appendTo||n.value),w=a.computed(()=>{var P;return(P=r.style)!=null?P:{}}),k=a.computed(()=>!a.unref(u)),C=()=>{m()},A=()=>{if(a.unref(l))return!0},O=O4(A,()=>{r.enterable&&a.unref(d)==="hover"&&h()}),N=O4(A,()=>{a.unref(d)==="hover"&&p()}),I=()=>{var P,W;(W=(P=o.value)==null?void 0:P.updatePopper)==null||W.call(P),g==null||g()},R=()=>{T==null||T()},D=()=>{f(),G=Zot(a.computed(()=>{var P;return(P=o.value)==null?void 0:P.popperContentRef}),()=>{a.unref(l)||a.unref(d)!=="hover"&&p()})},j=()=>{r.virtualTriggering||p()};let G;return a.watch(()=>a.unref(u),P=>{P||G==null||G()},{flush:"post"}),a.watch(()=>r.content,()=>{var P,W;(W=(P=o.value)==null?void 0:P.updatePopper)==null||W.call(P)}),t({contentRef:o}),(P,W)=>(a.openBlock(),a.createBlock(a.Teleport,{disabled:!P.teleported,to:a.unref(L)},[a.createVNode(a.Transition,{name:a.unref(y),onAfterLeave:C,onBeforeEnter:I,onAfterEnter:D,onBeforeLeave:R},{default:a.withCtx(()=>[a.unref(_)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(but),a.mergeProps({key:0,id:a.unref(c),ref_key:"contentRef",ref:o},P.$attrs,{"aria-label":P.ariaLabel,"aria-hidden":a.unref(k),"boundaries-padding":P.boundariesPadding,"fallback-placements":P.fallbackPlacements,"gpu-acceleration":P.gpuAcceleration,offset:P.offset,placement:P.placement,"popper-options":P.popperOptions,strategy:P.strategy,effect:P.effect,enterable:P.enterable,pure:P.pure,"popper-class":P.popperClass,"popper-style":[P.popperStyle,a.unref(w)],"reference-el":P.referenceEl,"trigger-target-el":P.triggerTargetEl,visible:a.unref(b),"z-index":P.zIndex,onMouseenter:a.unref(O),onMouseleave:a.unref(N),onBlur:j,onClose:a.unref(p)}),{default:a.withCtx(()=>[s.value?a.createCommentVNode("v-if",!0):a.renderSlot(P.$slots,"default",{key:0})]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(b)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["disabled","to"]))}});var Vut=hi(Hut,[["__file","content.vue"]]);const Iut=["innerHTML"],Put={key:1},Nut=a.defineComponent({name:"ElTooltip"}),But=a.defineComponent({...Nut,props:Sut,emits:kut,setup(e,{expose:t,emit:r}){const n=e;t0t();const i=fx(),o=a.ref(),s=a.ref(),l=()=>{var y;const v=a.unref(o);v&&((y=v.popperInstanceRef)==null||y.update())},c=a.ref(!1),u=a.ref(),{show:d,hide:p,hasUpdateHandler:h}=Lut({indicator:c,toggleReason:u}),{onOpen:f,onClose:m}=n0t({showAfter:a.toRef(n,"showAfter"),hideAfter:a.toRef(n,"hideAfter"),autoClose:a.toRef(n,"autoClose"),open:d,close:p}),g=a.computed(()=>ah(n.visible)&&!h.value);a.provide(AU,{controlled:g,id:i,open:a.readonly(c),trigger:a.toRef(n,"trigger"),onOpen:y=>{f(y)},onClose:y=>{m(y)},onToggle:y=>{a.unref(c)?m(y):f(y)},onShow:()=>{r("show",u.value)},onHide:()=>{r("hide",u.value)},onBeforeShow:()=>{r("before-show",u.value)},onBeforeHide:()=>{r("before-hide",u.value)},updatePopper:l}),a.watch(()=>n.disabled,y=>{y&&c.value&&(c.value=!1)});const T=y=>{var v,_;const b=(_=(v=s.value)==null?void 0:v.contentRef)==null?void 0:_.popperContentRef,L=(y==null?void 0:y.relatedTarget)||document.activeElement;return b&&b.contains(L)};return a.onDeactivated(()=>c.value&&p()),t({popperRef:o,contentRef:s,isFocusInsideContent:T,updatePopper:l,onOpen:f,onClose:m,hide:p}),(y,v)=>(a.openBlock(),a.createBlock(a.unref(xut),{ref_key:"popperRef",ref:o,role:y.role},{default:a.withCtx(()=>[a.createVNode(Aut,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:a.withCtx(()=>[y.$slots.default?a.renderSlot(y.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(Vut,{ref_key:"contentRef",ref:s,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:a.withCtx(()=>[a.renderSlot(y.$slots,"content",{},()=>[y.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:y.content},null,8,Iut)):(a.openBlock(),a.createElementBlock("span",Put,a.toDisplayString(y.content),1))]),y.showArrow?(a.openBlock(),a.createBlock(a.unref(U0t),{key:0,"arrow-offset":y.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var Rut=hi(But,[["__file","tooltip.vue"]]);const OU=Jc(Rut),E3e=Symbol("buttonGroupContextKey"),Fut=(e,t)=>{Cue({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>e.type==="text"));const r=a.inject(E3e,void 0),n=xU("button"),{form:i}=dh(),o=uh(a.computed(()=>r==null?void 0:r.size)),s=mg(),l=a.ref(),c=a.useSlots(),u=a.computed(()=>e.type||(r==null?void 0:r.type)||""),d=a.computed(()=>{var f,m,g;return(g=(m=e.autoInsertSpace)!=null?m:(f=n.value)==null?void 0:f.autoInsertSpace)!=null?g:!1}),p=a.computed(()=>e.tag==="button"?{ariaDisabled:s.value||e.loading,disabled:s.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),h=a.computed(()=>{var f;const m=(f=c.default)==null?void 0:f.call(c);if(d.value&&(m==null?void 0:m.length)===1){const g=m[0];if((g==null?void 0:g.type)===a.Text){const T=g.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(T.trim())}}return!1});return{_disabled:s,_size:o,_type:u,_ref:l,_props:p,shouldAddSpace:h,handleClick:f=>{e.nativeType==="reset"&&(i==null||i.resetFields()),t("click",f)}}},Dut=["default","primary","success","warning","info","danger","text",""],zut=["button","submit","reset"],HU=Lo({size:E8,disabled:Boolean,type:{type:String,values:Dut,default:""},icon:{type:lh},nativeType:{type:String,values:zut,default:"button"},loading:Boolean,loadingIcon:{type:lh,default:()=>cU},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:mi([String,Object]),default:"button"}}),jut={click:e=>e instanceof MouseEvent};function Wl(e,t){Uut(e)&&(e="100%");var r=Gut(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function hE(e){return Math.min(1,Math.max(0,e))}function Uut(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Gut(e){return typeof e=="string"&&e.indexOf("%")!==-1}function A3e(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function fE(e){return e<=1?"".concat(Number(e)*100,"%"):e}function A8(e){return e.length===1?"0"+e:String(e)}function qut(e,t,r){return{r:Wl(e,255)*255,g:Wl(t,255)*255,b:Wl(r,255)*255}}function O3e(e,t,r){e=Wl(e,255),t=Wl(t,255),r=Wl(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),o=0,s=0,l=(n+i)/2;if(n===i)s=0,o=0;else{var c=n-i;switch(s=l>.5?c/(2-n-i):c/(n+i),n){case e:o=(t-r)/c+(t<r?6:0);break;case t:o=(r-e)/c+2;break;case r:o=(e-t)/c+4;break}o/=6}return{h:o,s,l}}function VU(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Wut(e,t,r){var n,i,o;if(e=Wl(e,360),t=Wl(t,100),r=Wl(r,100),t===0)i=r,o=r,n=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=VU(l,s,e+1/3),i=VU(l,s,e),o=VU(l,s,e-1/3)}return{r:n*255,g:i*255,b:o*255}}function H3e(e,t,r){e=Wl(e,255),t=Wl(t,255),r=Wl(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),o=0,s=n,l=n-i,c=n===0?0:l/n;if(n===i)o=0;else{switch(n){case e:o=(t-r)/l+(t<r?6:0);break;case t:o=(r-e)/l+2;break;case r:o=(e-t)/l+4;break}o/=6}return{h:o,s:c,v:s}}function Zut(e,t,r){e=Wl(e,360)*6,t=Wl(t,100),r=Wl(r,100);var n=Math.floor(e),i=e-n,o=r*(1-t),s=r*(1-i*t),l=r*(1-(1-i)*t),c=n%6,u=[r,s,o,o,l,r][c],d=[l,r,r,s,o,o][c],p=[o,o,l,r,r,s][c];return{r:u*255,g:d*255,b:p*255}}function V3e(e,t,r,n){var i=[A8(Math.round(e).toString(16)),A8(Math.round(t).toString(16)),A8(Math.round(r).toString(16))];return n&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Kut(e,t,r,n,i){var o=[A8(Math.round(e).toString(16)),A8(Math.round(t).toString(16)),A8(Math.round(r).toString(16)),A8(Xut(n))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function Xut(e){return Math.round(parseFloat(e)*255).toString(16)}function I3e(e){return v2(e)/255}function v2(e){return parseInt(e,16)}function Jut(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var IU={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Yut(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,o=null,s=!1,l=!1;return typeof e=="string"&&(e=t3t(e)),typeof e=="object"&&(N4(e.r)&&N4(e.g)&&N4(e.b)?(t=qut(e.r,e.g,e.b),s=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):N4(e.h)&&N4(e.s)&&N4(e.v)?(n=fE(e.s),i=fE(e.v),t=Zut(e.h,n,i),s=!0,l="hsv"):N4(e.h)&&N4(e.s)&&N4(e.l)&&(n=fE(e.s),o=fE(e.l),t=Wut(e.h,n,o),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=A3e(r),{ok:s,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var $ut="[-\\+]?\\d+%?",e3t="[-\\+]?\\d*\\.\\d+%?",hh="(?:".concat(e3t,")|(?:").concat($ut,")"),PU="[\\s|\\(]+(".concat(hh,")[,|\\s]+(").concat(hh,")[,|\\s]+(").concat(hh,")\\s*\\)?"),NU="[\\s|\\(]+(".concat(hh,")[,|\\s]+(").concat(hh,")[,|\\s]+(").concat(hh,")[,|\\s]+(").concat(hh,")\\s*\\)?"),_u={CSS_UNIT:new RegExp(hh),rgb:new RegExp("rgb"+PU),rgba:new RegExp("rgba"+NU),hsl:new RegExp("hsl"+PU),hsla:new RegExp("hsla"+NU),hsv:new RegExp("hsv"+PU),hsva:new RegExp("hsva"+NU),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function t3t(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(IU[e])e=IU[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=_u.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=_u.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=_u.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=_u.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=_u.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=_u.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=_u.hex8.exec(e),r?{r:v2(r[1]),g:v2(r[2]),b:v2(r[3]),a:I3e(r[4]),format:t?"name":"hex8"}:(r=_u.hex6.exec(e),r?{r:v2(r[1]),g:v2(r[2]),b:v2(r[3]),format:t?"name":"hex"}:(r=_u.hex4.exec(e),r?{r:v2(r[1]+r[1]),g:v2(r[2]+r[2]),b:v2(r[3]+r[3]),a:I3e(r[4]+r[4]),format:t?"name":"hex8"}:(r=_u.hex3.exec(e),r?{r:v2(r[1]+r[1]),g:v2(r[2]+r[2]),b:v2(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function N4(e){return!!_u.CSS_UNIT.exec(String(e))}var r3t=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var n;if(t instanceof e)return t;typeof t=="number"&&(t=Jut(t)),this.originalInput=t;var i=Yut(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=r.format)!==null&&n!==void 0?n:i.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,n,i,o=t.r/255,s=t.g/255,l=t.b/255;return o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),l<=.03928?i=l/12.92:i=Math.pow((l+.055)/1.055,2.4),.2126*r+.7152*n+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=A3e(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=H3e(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=H3e(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=O3e(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=O3e(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),V3e(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Kut(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(n,")"):"rgba(".concat(t,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(Wl(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(Wl(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+V3e(this.r,this.g,this.b,!1),r=0,n=Object.entries(IU);r<n.length;r++){var i=n[r],o=i[0],s=i[1];if(t===s)return o}return!1},e.prototype.toString=function(t){var r=!!t;t=t??this.format;var n=!1,i=this.a<1&&this.a>=0,o=!r&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=hE(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=hE(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=hE(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=hE(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var n=this.toRgb(),i=new e(t).toRgb(),o=r/100,s={r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a};return new e(s)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var n=this.toHsl(),i=360/r,o=[this];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,o.push(new e(n));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),n=r.h,i=r.s,o=r.v,s=[],l=1/t;t--;)s.push(new e({h:n,s:i,v:o})),o=(o+l)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),i=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/i,g:(r.g*r.a+n.g*n.a*(1-r.a))/i,b:(r.b*r.a+n.b*n.a*(1-r.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,i=[this],o=360/t,s=1;s<t;s++)i.push(new e({h:(n+s*o)%360,s:r.s,l:r.l}));return i},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function fh(e,t=20){return e.mix("#141414",t).toString()}function n3t(e){const t=mg(),r=li("button");return a.computed(()=>{let n={};const i=e.color;if(i){const o=new r3t(i),s=e.dark?o.tint(20).toString():fh(o,20);if(e.plain)n=r.cssVarBlock({"bg-color":e.dark?fh(o,90):o.tint(90).toString(),"text-color":i,"border-color":e.dark?fh(o,50):o.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":i,"hover-border-color":i,"active-bg-color":s,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":s}),t.value&&(n[r.cssVarBlockName("disabled-bg-color")]=e.dark?fh(o,90):o.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=e.dark?fh(o,50):o.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=e.dark?fh(o,80):o.tint(80).toString());else{const l=e.dark?fh(o,30):o.tint(30).toString(),c=o.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(n=r.cssVarBlock({"bg-color":i,"text-color":c,"border-color":i,"hover-bg-color":l,"hover-text-color":c,"hover-border-color":l,"active-bg-color":s,"active-border-color":s}),t.value){const u=e.dark?fh(o,50):o.tint(50).toString();n[r.cssVarBlockName("disabled-bg-color")]=u,n[r.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,n[r.cssVarBlockName("disabled-border-color")]=u}}}return n})}const i3t=a.defineComponent({name:"ElButton"}),o3t=a.defineComponent({...i3t,props:HU,emits:jut,setup(e,{expose:t,emit:r}){const n=e,i=n3t(n),o=li("button"),{_ref:s,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:p,handleClick:h}=Fut(n,r);return t({ref:s,size:l,type:c,disabled:u,shouldAddSpace:p}),(f,m)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(f.tag),a.mergeProps({ref_key:"_ref",ref:s},a.unref(d),{class:[a.unref(o).b(),a.unref(o).m(a.unref(c)),a.unref(o).m(a.unref(l)),a.unref(o).is("disabled",a.unref(u)),a.unref(o).is("loading",f.loading),a.unref(o).is("plain",f.plain),a.unref(o).is("round",f.round),a.unref(o).is("circle",f.circle),a.unref(o).is("text",f.text),a.unref(o).is("link",f.link),a.unref(o).is("has-bg",f.bg)],style:a.unref(i),onClick:a.unref(h)}),{default:a.withCtx(()=>[f.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[f.$slots.loading?a.renderSlot(f.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(ql),{key:1,class:a.normalizeClass(a.unref(o).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(f.loadingIcon)))]),_:1},8,["class"]))],64)):f.icon||f.$slots.icon?(a.openBlock(),a.createBlock(a.unref(ql),{key:1},{default:a.withCtx(()=>[f.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(f.icon),{key:0})):a.renderSlot(f.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),f.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(o).em("text","expand")]:a.unref(p)})},[a.renderSlot(f.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var a3t=hi(o3t,[["__file","button.vue"]]);const s3t={size:HU.size,type:HU.type},l3t=a.defineComponent({name:"ElButtonGroup"}),c3t=a.defineComponent({...l3t,props:s3t,setup(e){const t=e;a.provide(E3e,a.reactive({size:a.toRef(t,"size"),type:a.toRef(t,"type")}));const r=li("button");return(n,i)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(`${a.unref(r).b("group")}`)},[a.renderSlot(n.$slots,"default")],2))}});var P3e=hi(c3t,[["__file","button-group.vue"]]);const j3=Jc(a3t,{ButtonGroup:P3e});Qu(P3e);var ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function BU(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function u3t(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}const mh=new Map;let N3e;Xs&&(document.addEventListener("mousedown",e=>N3e=e),document.addEventListener("mouseup",e=>{for(const t of mh.values())for(const{documentHandler:r}of t)r(e,N3e)}));function B3e(e,t){let r=[];return Array.isArray(t.arg)?r=t.arg:ix(t.arg)&&r.push(t.arg),function(n,i){const o=t.instance.popperRef,s=n.target,l=i==null?void 0:i.target,c=!t||!t.instance,u=!s||!l,d=e.contains(s)||e.contains(l),p=e===s,h=r.length&&r.some(m=>m==null?void 0:m.contains(s))||r.length&&r.includes(l),f=o&&(o.contains(s)||o.contains(l));c||u||d||p||h||f||t.value(n,i)}}const R3e={beforeMount(e,t){mh.has(e)||mh.set(e,[]),mh.get(e).push({documentHandler:B3e(e,t),bindingFn:t.value})},updated(e,t){mh.has(e)||mh.set(e,[]);const r=mh.get(e),n=r.findIndex(o=>o.bindingFn===t.oldValue),i={documentHandler:B3e(e,t),bindingFn:t.value};n>=0?r.splice(n,1,i):r.push(i)},unmounted(e){mh.delete(e)}},F3e={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},controls:{type:String,default:void 0},border:Boolean,size:E8,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0}},D3e={[ss]:e=>Js(e)||Ys(e)||ah(e),change:e=>Js(e)||Ys(e)||ah(e)},Tg=Symbol("checkboxGroupContextKey"),d3t=({model:e,isChecked:t})=>{const r=a.inject(Tg,void 0),n=a.computed(()=>{var i,o;const s=(i=r==null?void 0:r.max)==null?void 0:i.value,l=(o=r==null?void 0:r.min)==null?void 0:o.value;return!nx(s)&&e.value.length>=s&&!t.value||!nx(l)&&e.value.length<=l&&t.value});return{isDisabled:mg(a.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},p3t=(e,{model:t,isLimitExceeded:r,hasOwnLabel:n,isDisabled:i,isLabeledByFormItem:o})=>{const s=a.inject(Tg,void 0),{formItem:l}=dh(),{emit:c}=a.getCurrentInstance();function u(m){var g,T;return m===e.trueLabel||m===!0?(g=e.trueLabel)!=null?g:!0:(T=e.falseLabel)!=null?T:!1}function d(m,g){c("change",u(m),g)}function p(m){if(r.value)return;const g=m.target;c("change",u(g.checked),m)}async function h(m){r.value||!n.value&&!i.value&&o.value&&(m.composedPath().some(g=>g.tagName==="LABEL")||(t.value=u([!1,e.falseLabel].includes(t.value)),await a.nextTick(),d(t.value,m)))}const f=a.computed(()=>(s==null?void 0:s.validateEvent)||e.validateEvent);return a.watch(()=>e.modelValue,()=>{f.value&&(l==null||l.validate("change").catch(m=>$s(m)))}),{handleChange:p,onClickRoot:h}},h3t=e=>{const t=a.ref(!1),{emit:r}=a.getCurrentInstance(),n=a.inject(Tg,void 0),i=a.computed(()=>nx(n)===!1),o=a.ref(!1);return{model:a.computed({get(){var s,l;return i.value?(s=n==null?void 0:n.modelValue)==null?void 0:s.value:(l=e.modelValue)!=null?l:t.value},set(s){var l,c;i.value&&ng(s)?(o.value=((l=n==null?void 0:n.max)==null?void 0:l.value)!==void 0&&s.length>(n==null?void 0:n.max.value),o.value===!1&&((c=n==null?void 0:n.changeEvent)==null||c.call(n,s))):(r(ss,s),t.value=s)}}),isGroup:i,isLimitExceeded:o}},f3t=(e,t,{model:r})=>{const n=a.inject(Tg,void 0),i=a.ref(!1),o=a.computed(()=>{const u=r.value;return ah(u)?u:ng(u)?Sc(e.label)?u.map(a.toRaw).some(d=>aU(d,e.label)):u.map(a.toRaw).includes(e.label):u!=null?u===e.trueLabel:!!u}),s=uh(a.computed(()=>{var u;return(u=n==null?void 0:n.size)==null?void 0:u.value}),{prop:!0}),l=uh(a.computed(()=>{var u;return(u=n==null?void 0:n.size)==null?void 0:u.value})),c=a.computed(()=>!!t.default||!oh(e.label));return{checkboxButtonSize:s,isChecked:o,isFocused:i,checkboxSize:l,hasOwnLabel:c}},m3t=(e,{model:t})=>{function r(){ng(t.value)&&!t.value.includes(e.label)?t.value.push(e.label):t.value=e.trueLabel||!0}e.checked&&r()},z3e=(e,t)=>{const{formItem:r}=dh(),{model:n,isGroup:i,isLimitExceeded:o}=h3t(e),{isFocused:s,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d}=f3t(e,t,{model:n}),{isDisabled:p}=d3t({model:n,isChecked:l}),{inputId:h,isLabeledByFormItem:f}=gx(e,{formItemContext:r,disableIdGeneration:d,disableIdManagement:i}),{handleChange:m,onClickRoot:g}=p3t(e,{model:n,isLimitExceeded:o,hasOwnLabel:d,isDisabled:p,isLabeledByFormItem:f});return m3t(e,{model:n}),{inputId:h,isLabeledByFormItem:f,isChecked:l,isDisabled:p,isFocused:s,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,model:n,handleChange:m,onClickRoot:g}},g3t=["id","indeterminate","name","tabindex","disabled","true-value","false-value"],y3t=["id","indeterminate","disabled","value","name","tabindex"],T3t=a.defineComponent({name:"ElCheckbox"}),v3t=a.defineComponent({...T3t,props:F3e,emits:D3e,setup(e){const t=e,r=a.useSlots(),{inputId:n,isLabeledByFormItem:i,isChecked:o,isDisabled:s,isFocused:l,checkboxSize:c,hasOwnLabel:u,model:d,handleChange:p,onClickRoot:h}=z3e(t,r),f=li("checkbox"),m=a.computed(()=>[f.b(),f.m(c.value),f.is("disabled",s.value),f.is("bordered",t.border),f.is("checked",o.value)]),g=a.computed(()=>[f.e("input"),f.is("disabled",s.value),f.is("checked",o.value),f.is("indeterminate",t.indeterminate),f.is("focus",l.value)]);return(T,y)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(!a.unref(u)&&a.unref(i)?"span":"label"),{class:a.normalizeClass(a.unref(m)),"aria-controls":T.indeterminate?T.controls:null,onClick:a.unref(h)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(g))},[T.trueLabel||T.falseLabel?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,id:a.unref(n),"onUpdate:modelValue":y[0]||(y[0]=v=>a.isRef(d)?d.value=v:null),class:a.normalizeClass(a.unref(f).e("original")),type:"checkbox",indeterminate:T.indeterminate,name:T.name,tabindex:T.tabindex,disabled:a.unref(s),"true-value":T.trueLabel,"false-value":T.falseLabel,onChange:y[1]||(y[1]=(...v)=>a.unref(p)&&a.unref(p)(...v)),onFocus:y[2]||(y[2]=v=>l.value=!0),onBlur:y[3]||(y[3]=v=>l.value=!1),onClick:y[4]||(y[4]=a.withModifiers(()=>{},["stop"]))},null,42,g3t)),[[a.vModelCheckbox,a.unref(d)]]):a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:1,id:a.unref(n),"onUpdate:modelValue":y[5]||(y[5]=v=>a.isRef(d)?d.value=v:null),class:a.normalizeClass(a.unref(f).e("original")),type:"checkbox",indeterminate:T.indeterminate,disabled:a.unref(s),value:T.label,name:T.name,tabindex:T.tabindex,onChange:y[6]||(y[6]=(...v)=>a.unref(p)&&a.unref(p)(...v)),onFocus:y[7]||(y[7]=v=>l.value=!0),onBlur:y[8]||(y[8]=v=>l.value=!1),onClick:y[9]||(y[9]=a.withModifiers(()=>{},["stop"]))},null,42,y3t)),[[a.vModelCheckbox,a.unref(d)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(f).e("inner"))},null,2)],2),a.unref(u)?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(f).e("label"))},[a.renderSlot(T.$slots,"default"),T.$slots.default?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(T.label),1)],64))],2)):a.createCommentVNode("v-if",!0)]),_:3},8,["class","aria-controls","onClick"]))}});var Q3t=hi(v3t,[["__file","checkbox.vue"]]);const b3t=["name","tabindex","disabled","true-value","false-value"],x3t=["name","tabindex","disabled","value"],_3t=a.defineComponent({name:"ElCheckboxButton"}),w3t=a.defineComponent({..._3t,props:F3e,emits:D3e,setup(e){const t=e,r=a.useSlots(),{isFocused:n,isChecked:i,isDisabled:o,checkboxButtonSize:s,model:l,handleChange:c}=z3e(t,r),u=a.inject(Tg,void 0),d=li("checkbox"),p=a.computed(()=>{var f,m,g,T;const y=(m=(f=u==null?void 0:u.fill)==null?void 0:f.value)!=null?m:"";return{backgroundColor:y,borderColor:y,color:(T=(g=u==null?void 0:u.textColor)==null?void 0:g.value)!=null?T:"",boxShadow:y?`-1px 0 0 0 ${y}`:void 0}}),h=a.computed(()=>[d.b("button"),d.bm("button",s.value),d.is("disabled",o.value),d.is("checked",i.value),d.is("focus",n.value)]);return(f,m)=>(a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass(a.unref(h))},[f.trueLabel||f.falseLabel?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":m[0]||(m[0]=g=>a.isRef(l)?l.value=g:null),class:a.normalizeClass(a.unref(d).be("button","original")),type:"checkbox",name:f.name,tabindex:f.tabindex,disabled:a.unref(o),"true-value":f.trueLabel,"false-value":f.falseLabel,onChange:m[1]||(m[1]=(...g)=>a.unref(c)&&a.unref(c)(...g)),onFocus:m[2]||(m[2]=g=>n.value=!0),onBlur:m[3]||(m[3]=g=>n.value=!1),onClick:m[4]||(m[4]=a.withModifiers(()=>{},["stop"]))},null,42,b3t)),[[a.vModelCheckbox,a.unref(l)]]):a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:1,"onUpdate:modelValue":m[5]||(m[5]=g=>a.isRef(l)?l.value=g:null),class:a.normalizeClass(a.unref(d).be("button","original")),type:"checkbox",name:f.name,tabindex:f.tabindex,disabled:a.unref(o),value:f.label,onChange:m[6]||(m[6]=(...g)=>a.unref(c)&&a.unref(c)(...g)),onFocus:m[7]||(m[7]=g=>n.value=!0),onBlur:m[8]||(m[8]=g=>n.value=!1),onClick:m[9]||(m[9]=a.withModifiers(()=>{},["stop"]))},null,42,x3t)),[[a.vModelCheckbox,a.unref(l)]]),f.$slots.default||f.label?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass(a.unref(d).be("button","inner")),style:a.normalizeStyle(a.unref(i)?a.unref(p):void 0)},[a.renderSlot(f.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(f.label),1)])],6)):a.createCommentVNode("v-if",!0)],2))}});var j3e=hi(w3t,[["__file","checkbox-button.vue"]]);const L3t=Lo({modelValue:{type:mi(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:E8,label:String,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0}}),S3t={[ss]:e=>ng(e),change:e=>ng(e)},k3t=a.defineComponent({name:"ElCheckboxGroup"}),M3t=a.defineComponent({...k3t,props:L3t,emits:S3t,setup(e,{emit:t}){const r=e,n=li("checkbox"),{formItem:i}=dh(),{inputId:o,isLabeledByFormItem:s}=gx(r,{formItemContext:i}),l=async u=>{t(ss,u),await a.nextTick(),t("change",u)},c=a.computed({get(){return r.modelValue},set(u){l(u)}});return a.provide(Tg,{...s1t(a.toRefs(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:c,changeEvent:l}),a.watch(()=>r.modelValue,()=>{r.validateEvent&&(i==null||i.validate("change").catch(u=>$s(u)))}),(u,d)=>{var p;return a.openBlock(),a.createBlock(a.resolveDynamicComponent(u.tag),{id:a.unref(o),class:a.normalizeClass(a.unref(n).b("group")),role:"group","aria-label":a.unref(s)?void 0:u.label||"checkbox-group","aria-labelledby":a.unref(s)?(p=a.unref(i))==null?void 0:p.labelId:void 0},{default:a.withCtx(()=>[a.renderSlot(u.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var U3e=hi(M3t,[["__file","checkbox-group.vue"]]);const mE=Jc(Q3t,{CheckboxButton:j3e,CheckboxGroup:U3e});Qu(j3e);const RU=Qu(U3e),G3e=Lo({size:E8,disabled:Boolean,label:{type:[String,Number,Boolean],default:""}}),C3t=Lo({...G3e,modelValue:{type:[String,Number,Boolean],default:""},name:{type:String,default:""},border:Boolean}),q3e={[ss]:e=>Js(e)||Ys(e)||ah(e),[eE]:e=>Js(e)||Ys(e)||ah(e)},W3e=Symbol("radioGroupKey"),Z3e=(e,t)=>{const r=a.ref(),n=a.inject(W3e,void 0),i=a.computed(()=>!!n),o=a.computed({get(){return i.value?n.modelValue:e.modelValue},set(d){i.value?n.changeEvent(d):t&&t(ss,d),r.value.checked=e.modelValue===e.label}}),s=uh(a.computed(()=>n==null?void 0:n.size)),l=mg(a.computed(()=>n==null?void 0:n.disabled)),c=a.ref(!1),u=a.computed(()=>l.value||i.value&&o.value!==e.label?-1:0);return{radioRef:r,isGroup:i,radioGroup:n,focus:c,size:s,disabled:l,tabIndex:u,modelValue:o}},E3t=["value","name","disabled"],A3t=a.defineComponent({name:"ElRadio"}),O3t=a.defineComponent({...A3t,props:C3t,emits:q3e,setup(e,{emit:t}){const r=e,n=li("radio"),{radioRef:i,radioGroup:o,focus:s,size:l,disabled:c,modelValue:u}=Z3e(r,t);function d(){a.nextTick(()=>t("change",u.value))}return(p,h)=>{var f;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(n).b(),a.unref(n).is("disabled",a.unref(c)),a.unref(n).is("focus",a.unref(s)),a.unref(n).is("bordered",p.border),a.unref(n).is("checked",a.unref(u)===p.label),a.unref(n).m(a.unref(l))])},[a.createElementVNode("span",{class:a.normalizeClass([a.unref(n).e("input"),a.unref(n).is("disabled",a.unref(c)),a.unref(n).is("checked",a.unref(u)===p.label)])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":h[0]||(h[0]=m=>a.isRef(u)?u.value=m:null),class:a.normalizeClass(a.unref(n).e("original")),value:p.label,name:p.name||((f=a.unref(o))==null?void 0:f.name),disabled:a.unref(c),type:"radio",onFocus:h[1]||(h[1]=m=>s.value=!0),onBlur:h[2]||(h[2]=m=>s.value=!1),onChange:d,onClick:h[3]||(h[3]=a.withModifiers(()=>{},["stop"]))},null,42,E3t),[[a.vModelRadio,a.unref(u)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(n).e("inner"))},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass(a.unref(n).e("label")),onKeydown:h[4]||(h[4]=a.withModifiers(()=>{},["stop"]))},[a.renderSlot(p.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(p.label),1)])],34)],2)}}});var H3t=hi(O3t,[["__file","radio.vue"]]);const V3t=Lo({...G3e,name:{type:String,default:""}}),I3t=["value","name","disabled"],P3t=a.defineComponent({name:"ElRadioButton"}),N3t=a.defineComponent({...P3t,props:V3t,setup(e){const t=e,r=li("radio"),{radioRef:n,focus:i,size:o,disabled:s,modelValue:l,radioGroup:c}=Z3e(t),u=a.computed(()=>({backgroundColor:(c==null?void 0:c.fill)||"",borderColor:(c==null?void 0:c.fill)||"",boxShadow:c!=null&&c.fill?`-1px 0 0 0 ${c.fill}`:"",color:(c==null?void 0:c.textColor)||""}));return(d,p)=>{var h;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(r).b("button"),a.unref(r).is("active",a.unref(l)===d.label),a.unref(r).is("disabled",a.unref(s)),a.unref(r).is("focus",a.unref(i)),a.unref(r).bm("button",a.unref(o))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:n,"onUpdate:modelValue":p[0]||(p[0]=f=>a.isRef(l)?l.value=f:null),class:a.normalizeClass(a.unref(r).be("button","original-radio")),value:d.label,type:"radio",name:d.name||((h=a.unref(c))==null?void 0:h.name),disabled:a.unref(s),onFocus:p[1]||(p[1]=f=>i.value=!0),onBlur:p[2]||(p[2]=f=>i.value=!1),onClick:p[3]||(p[3]=a.withModifiers(()=>{},["stop"]))},null,42,I3t),[[a.vModelRadio,a.unref(l)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).be("button","inner")),style:a.normalizeStyle(a.unref(l)===d.label?a.unref(u):{}),onKeydown:p[4]||(p[4]=a.withModifiers(()=>{},["stop"]))},[a.renderSlot(d.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(d.label),1)])],38)],2)}}});var K3e=hi(N3t,[["__file","radio-button.vue"]]);const B3t=Lo({id:{type:String,default:void 0},size:E8,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:""},fill:{type:String,default:""},label:{type:String,default:void 0},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0}}),R3t=q3e,F3t=["id","aria-label","aria-labelledby"],D3t=a.defineComponent({name:"ElRadioGroup"}),z3t=a.defineComponent({...D3t,props:B3t,emits:R3t,setup(e,{emit:t}){const r=e,n=li("radio"),i=fx(),o=a.ref(),{formItem:s}=dh(),{inputId:l,isLabeledByFormItem:c}=gx(r,{formItemContext:s}),u=p=>{t(ss,p),a.nextTick(()=>t("change",p))};a.onMounted(()=>{const p=o.value.querySelectorAll("[type=radio]"),h=p[0];!Array.from(p).some(f=>f.checked)&&h&&(h.tabIndex=0)});const d=a.computed(()=>r.name||i.value);return a.provide(W3e,a.reactive({...a.toRefs(r),changeEvent:u,name:d})),a.watch(()=>r.modelValue,()=>{r.validateEvent&&(s==null||s.validate("change").catch(p=>$s(p)))}),(p,h)=>(a.openBlock(),a.createElementBlock("div",{id:a.unref(l),ref_key:"radioGroupRef",ref:o,class:a.normalizeClass(a.unref(n).b("group")),role:"radiogroup","aria-label":a.unref(c)?void 0:p.label||"radio-group","aria-labelledby":a.unref(c)?a.unref(s).labelId:void 0},[a.renderSlot(p.$slots,"default")],10,F3t))}});var X3e=hi(z3t,[["__file","radio-group.vue"]]);const J3e=Jc(H3t,{RadioButton:K3e,RadioGroup:X3e}),Y3e=Qu(X3e);Qu(K3e);const $3e=Lo({type:{type:String,values:["success","info","warning","danger",""],default:""},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:{type:String,default:""},size:{type:String,values:uU,default:""},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),j3t={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},U3t=a.defineComponent({name:"ElTag"}),G3t=a.defineComponent({...U3t,props:$3e,emits:j3t,setup(e,{emit:t}){const r=e,n=uh(),i=li("tag"),o=a.computed(()=>{const{type:c,hit:u,effect:d,closable:p,round:h}=r;return[i.b(),i.is("closable",p),i.m(c),i.m(n.value),i.m(d),i.is("hit",u),i.is("round",h)]}),s=c=>{t("close",c)},l=c=>{t("click",c)};return(c,u)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(o)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ql),{key:0,class:a.normalizeClass(a.unref(i).e("close")),onClick:a.withModifiers(s,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(ax))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(i).namespace.value}-zoom-in-center`,appear:""},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(o)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ql),{key:0,class:a.normalizeClass(a.unref(i).e("close")),onClick:a.withModifiers(s,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(ax))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var q3t=hi(G3t,[["__file","tag.vue"]]);const W3t=Jc(q3t),ede=Symbol("rowContextKey"),Z3t=["start","center","end","space-around","space-between","space-evenly"],K3t=["top","middle","bottom"],X3t=Lo({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:Z3t,default:"start"},align:{type:String,values:K3t}}),J3t=a.defineComponent({name:"ElRow"}),Y3t=a.defineComponent({...J3t,props:X3t,setup(e){const t=e,r=li("row"),n=a.computed(()=>t.gutter);a.provide(ede,{gutter:n});const i=a.computed(()=>{const s={};return t.gutter&&(s.marginRight=s.marginLeft=`-${t.gutter/2}px`),s}),o=a.computed(()=>[r.b(),r.is(`justify-${t.justify}`,t.justify!=="start"),r.is(`align-${t.align}`,!!t.align)]);return(s,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(s.tag),{class:a.normalizeClass(a.unref(o)),style:a.normalizeStyle(a.unref(i))},{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var $3t=hi(Y3t,[["__file","row.vue"]]);const U3=Jc($3t),edt=Lo({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:mi([Number,Object]),default:()=>sg({})},sm:{type:mi([Number,Object]),default:()=>sg({})},md:{type:mi([Number,Object]),default:()=>sg({})},lg:{type:mi([Number,Object]),default:()=>sg({})},xl:{type:mi([Number,Object]),default:()=>sg({})}}),tdt=a.defineComponent({name:"ElCol"}),rdt=a.defineComponent({...tdt,props:edt,setup(e){const t=e,{gutter:r}=a.inject(ede,{gutter:a.computed(()=>0)}),n=li("col"),i=a.computed(()=>{const s={};return r.value&&(s.paddingLeft=s.paddingRight=`${r.value/2}px`),s}),o=a.computed(()=>{const s=[];return["span","offset","pull","push"].forEach(l=>{const c=t[l];Ys(c)&&(l==="span"?s.push(n.b(`${t[l]}`)):c>0&&s.push(n.b(`${l}-${t[l]}`)))}),["xs","sm","md","lg","xl"].forEach(l=>{Ys(t[l])?s.push(n.b(`${l}-${t[l]}`)):Sc(t[l])&&Object.entries(t[l]).forEach(([c,u])=>{s.push(c!=="span"?n.b(`${l}-${c}-${u}`):n.b(`${l}-${u}`))})}),r.value&&s.push(n.is("guttered")),[n.b(),s]});return(s,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(s.tag),{class:a.normalizeClass(a.unref(o)),style:a.normalizeStyle(a.unref(i))},{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var ndt=hi(rdt,[["__file","col.vue"]]);const B4=Jc(ndt),idt=a.defineComponent({name:"ElCollapseTransition"}),odt=a.defineComponent({...idt,setup(e){const t=li("collapse-transition"),r=i=>{i.style.maxHeight="",i.style.overflow=i.dataset.oldOverflow,i.style.paddingTop=i.dataset.oldPaddingTop,i.style.paddingBottom=i.dataset.oldPaddingBottom},n={beforeEnter(i){i.dataset||(i.dataset={}),i.dataset.oldPaddingTop=i.style.paddingTop,i.dataset.oldPaddingBottom=i.style.paddingBottom,i.style.height&&(i.dataset.elExistsHeight=i.style.height),i.style.maxHeight=0,i.style.paddingTop=0,i.style.paddingBottom=0},enter(i){requestAnimationFrame(()=>{i.dataset.oldOverflow=i.style.overflow,i.dataset.elExistsHeight?i.style.maxHeight=i.dataset.elExistsHeight:i.scrollHeight!==0?i.style.maxHeight=`${i.scrollHeight}px`:i.style.maxHeight=0,i.style.paddingTop=i.dataset.oldPaddingTop,i.style.paddingBottom=i.dataset.oldPaddingBottom,i.style.overflow="hidden"})},afterEnter(i){i.style.maxHeight="",i.style.overflow=i.dataset.oldOverflow},enterCancelled(i){r(i)},beforeLeave(i){i.dataset||(i.dataset={}),i.dataset.oldPaddingTop=i.style.paddingTop,i.dataset.oldPaddingBottom=i.style.paddingBottom,i.dataset.oldOverflow=i.style.overflow,i.style.maxHeight=`${i.scrollHeight}px`,i.style.overflow="hidden"},leave(i){i.scrollHeight!==0&&(i.style.maxHeight=0,i.style.paddingTop=0,i.style.paddingBottom=0)},afterLeave(i){r(i)},leaveCancelled(i){r(i)}};return(i,o)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(t).b()},a.toHandlers(n)),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["name"]))}});var gE=hi(odt,[["__file","collapse-transition.vue"]]);gE.install=e=>{e.component(gE.name,gE)};const adt=gE,sdt=Lo({color:{type:mi(Object),required:!0},vertical:{type:Boolean,default:!1}});let FU=!1;function Tx(e,t){if(!Xs)return;const r=function(o){var s;(s=t.drag)==null||s.call(t,o)},n=function(o){var s;document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",n),document.onselectstart=null,document.ondragstart=null,FU=!1,(s=t.end)==null||s.call(t,o)},i=function(o){var s;FU||(o.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),FU=!0,(s=t.start)==null||s.call(t,o))};e.addEventListener("mousedown",i),e.addEventListener("touchstart",i)}const ldt=e=>{const t=a.getCurrentInstance(),r=a.shallowRef(),n=a.shallowRef();function i(s){s.target!==r.value&&o(s)}function o(s){if(!n.value||!r.value)return;const l=t.vnode.el.getBoundingClientRect(),{clientX:c,clientY:u}=Fj(s);if(e.vertical){let d=u-l.top;d=Math.max(r.value.offsetHeight/2,d),d=Math.min(d,l.height-r.value.offsetHeight/2),e.color.set("alpha",Math.round((d-r.value.offsetHeight/2)/(l.height-r.value.offsetHeight)*100))}else{let d=c-l.left;d=Math.max(r.value.offsetWidth/2,d),d=Math.min(d,l.width-r.value.offsetWidth/2),e.color.set("alpha",Math.round((d-r.value.offsetWidth/2)/(l.width-r.value.offsetWidth)*100))}}return{thumb:r,bar:n,handleDrag:o,handleClick:i}},cdt=(e,{bar:t,thumb:r,handleDrag:n})=>{const i=a.getCurrentInstance(),o=li("color-alpha-slider"),s=a.ref(0),l=a.ref(0),c=a.ref();function u(){if(!r.value||e.vertical)return 0;const v=i.vnode.el,_=e.color.get("alpha");return v?Math.round(_*(v.offsetWidth-r.value.offsetWidth/2)/100):0}function d(){if(!r.value)return 0;const v=i.vnode.el;if(!e.vertical)return 0;const _=e.color.get("alpha");return v?Math.round(_*(v.offsetHeight-r.value.offsetHeight/2)/100):0}function p(){if(e.color&&e.color.value){const{r:v,g:_,b}=e.color.toRgb();return`linear-gradient(to right, rgba(${v}, ${_}, ${b}, 0) 0%, rgba(${v}, ${_}, ${b}, 1) 100%)`}return""}function h(){s.value=u(),l.value=d(),c.value=p()}a.onMounted(()=>{if(!t.value||!r.value)return;const v={drag:_=>{n(_)},end:_=>{n(_)}};Tx(t.value,v),Tx(r.value,v),h()}),a.watch(()=>e.color.get("alpha"),()=>h()),a.watch(()=>e.color.value,()=>h());const f=a.computed(()=>[o.b(),o.is("vertical",e.vertical)]),m=a.computed(()=>o.e("bar")),g=a.computed(()=>o.e("thumb")),T=a.computed(()=>({background:c.value})),y=a.computed(()=>({left:ag(s.value),top:ag(l.value)}));return{rootKls:f,barKls:m,barStyle:T,thumbKls:g,thumbStyle:y,update:h}},udt="ElColorAlphaSlider",ddt=a.defineComponent({name:udt}),pdt=a.defineComponent({...ddt,props:sdt,setup(e,{expose:t}){const r=e,{bar:n,thumb:i,handleDrag:o,handleClick:s}=ldt(r),{rootKls:l,barKls:c,barStyle:u,thumbKls:d,thumbStyle:p,update:h}=cdt(r,{bar:n,thumb:i,handleDrag:o});return t({update:h,bar:n,thumb:i}),(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(l))},[a.createElementVNode("div",{ref_key:"bar",ref:n,class:a.normalizeClass(a.unref(c)),style:a.normalizeStyle(a.unref(u)),onClick:m[0]||(m[0]=(...g)=>a.unref(s)&&a.unref(s)(...g))},null,6),a.createElementVNode("div",{ref_key:"thumb",ref:i,class:a.normalizeClass(a.unref(d)),style:a.normalizeStyle(a.unref(p))},null,6)],2))}});var hdt=hi(pdt,[["__file","alpha-slider.vue"]]);const fdt=a.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(e){const t=li("color-hue-slider"),r=a.getCurrentInstance(),n=a.ref(),i=a.ref(),o=a.ref(0),s=a.ref(0),l=a.computed(()=>e.color.get("hue"));a.watch(()=>l.value,()=>{h()});function c(f){f.target!==n.value&&u(f)}function u(f){if(!i.value||!n.value)return;const m=r.vnode.el.getBoundingClientRect(),{clientX:g,clientY:T}=Fj(f);let y;if(e.vertical){let v=T-m.top;v=Math.min(v,m.height-n.value.offsetHeight/2),v=Math.max(n.value.offsetHeight/2,v),y=Math.round((v-n.value.offsetHeight/2)/(m.height-n.value.offsetHeight)*360)}else{let v=g-m.left;v=Math.min(v,m.width-n.value.offsetWidth/2),v=Math.max(n.value.offsetWidth/2,v),y=Math.round((v-n.value.offsetWidth/2)/(m.width-n.value.offsetWidth)*360)}e.color.set("hue",y)}function d(){if(!n.value)return 0;const f=r.vnode.el;if(e.vertical)return 0;const m=e.color.get("hue");return f?Math.round(m*(f.offsetWidth-n.value.offsetWidth/2)/360):0}function p(){if(!n.value)return 0;const f=r.vnode.el;if(!e.vertical)return 0;const m=e.color.get("hue");return f?Math.round(m*(f.offsetHeight-n.value.offsetHeight/2)/360):0}function h(){o.value=d(),s.value=p()}return a.onMounted(()=>{if(!i.value||!n.value)return;const f={drag:m=>{u(m)},end:m=>{u(m)}};Tx(i.value,f),Tx(n.value,f),h()}),{bar:i,thumb:n,thumbLeft:o,thumbTop:s,hueValue:l,handleClick:c,update:h,ns:t}}});function mdt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([e.ns.b(),e.ns.is("vertical",e.vertical)])},[a.createElementVNode("div",{ref:"bar",class:a.normalizeClass(e.ns.e("bar")),onClick:t[0]||(t[0]=(...s)=>e.handleClick&&e.handleClick(...s))},null,2),a.createElementVNode("div",{ref:"thumb",class:a.normalizeClass(e.ns.e("thumb")),style:a.normalizeStyle({left:e.thumbLeft+"px",top:e.thumbTop+"px"})},null,6)],2)}var gdt=hi(fdt,[["render",mdt],["__file","hue-slider.vue"]]);const ydt=Lo({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:E8,popperClass:{type:String,default:""},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},predefine:{type:mi(Array)},validateEvent:{type:Boolean,default:!0}}),Tdt={[ss]:e=>Js(e)||oh(e),[eE]:e=>Js(e)||oh(e),activeChange:e=>Js(e)||oh(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent},tde=Symbol("colorPickerContextKey"),rde=function(e,t,r){return[e,t*r/((e=(2-t)*r)<1?e:2-e)||0,e/2]},vdt=function(e){return typeof e=="string"&&e.includes(".")&&Number.parseFloat(e)===1},Qdt=function(e){return typeof e=="string"&&e.includes("%")},vg=function(e,t){vdt(e)&&(e="100%");const r=Qdt(e);return e=Math.min(t,Math.max(0,Number.parseFloat(`${e}`))),r&&(e=Number.parseInt(`${e*t}`,10)/100),Math.abs(e-t)<1e-6?1:e%t/Number.parseFloat(t)},nde={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},yE=e=>{e=Math.min(Math.round(e),255);const t=Math.floor(e/16),r=e%16;return`${nde[t]||t}${nde[r]||r}`},ide=function({r:e,g:t,b:r}){return Number.isNaN(+e)||Number.isNaN(+t)||Number.isNaN(+r)?"":`#${yE(e)}${yE(t)}${yE(r)}`},DU={A:10,B:11,C:12,D:13,E:14,F:15},O8=function(e){return e.length===2?(DU[e[0].toUpperCase()]||+e[0])*16+(DU[e[1].toUpperCase()]||+e[1]):DU[e[1].toUpperCase()]||+e[1]},bdt=function(e,t,r){t=t/100,r=r/100;let n=t;const i=Math.max(r,.01);r*=2,t*=r<=1?r:2-r,n*=i<=1?i:2-i;const o=(r+t)/2,s=r===0?2*n/(i+n):2*t/(r+t);return{h:e,s:s*100,v:o*100}},ode=(e,t,r)=>{e=vg(e,255),t=vg(t,255),r=vg(r,255);const n=Math.max(e,t,r),i=Math.min(e,t,r);let o;const s=n,l=n-i,c=n===0?0:l/n;if(n===i)o=0;else{switch(n){case e:{o=(t-r)/l+(t<r?6:0);break}case t:{o=(r-e)/l+2;break}case r:{o=(e-t)/l+4;break}}o/=6}return{h:o*360,s:c*100,v:s*100}},vx=function(e,t,r){e=vg(e,360)*6,t=vg(t,100),r=vg(r,100);const n=Math.floor(e),i=e-n,o=r*(1-t),s=r*(1-i*t),l=r*(1-(1-i)*t),c=n%6,u=[r,s,o,o,l,r][c],d=[l,r,r,s,o,o][c],p=[o,o,l,r,r,s][c];return{r:Math.round(u*255),g:Math.round(d*255),b:Math.round(p*255)}};let Qx=class{constructor(t={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const r in t)x8(t,r)&&(this[r]=t[r]);t.value?this.fromString(t.value):this.doOnChange()}set(t,r){if(arguments.length===1&&typeof t=="object"){for(const n in t)x8(t,n)&&this.set(n,t[n]);return}this[`_${t}`]=r,this.doOnChange()}get(t){return t==="alpha"?Math.floor(this[`_${t}`]):this[`_${t}`]}toRgb(){return vx(this._hue,this._saturation,this._value)}fromString(t){if(!t){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const r=(n,i,o)=>{this._hue=Math.max(0,Math.min(360,n)),this._saturation=Math.max(0,Math.min(100,i)),this._value=Math.max(0,Math.min(100,o)),this.doOnChange()};if(t.includes("hsl")){const n=t.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,o)=>o>2?Number.parseFloat(i):Number.parseInt(i,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:i,s:o,v:s}=bdt(n[0],n[1],n[2]);r(i,o,s)}}else if(t.includes("hsv")){const n=t.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,o)=>o>2?Number.parseFloat(i):Number.parseInt(i,10));n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3&&r(n[0],n[1],n[2])}else if(t.includes("rgb")){const n=t.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,o)=>o>2?Number.parseFloat(i):Number.parseInt(i,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:i,s:o,v:s}=ode(n[0],n[1],n[2]);r(i,o,s)}}else if(t.includes("#")){const n=t.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n))return;let i,o,s;n.length===3?(i=O8(n[0]+n[0]),o=O8(n[1]+n[1]),s=O8(n[2]+n[2])):(n.length===6||n.length===8)&&(i=O8(n.slice(0,2)),o=O8(n.slice(2,4)),s=O8(n.slice(4,6))),n.length===8?this._alpha=O8(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=ode(i,o,s);r(l,c,u)}}compare(t){return Math.abs(t._hue-this._hue)<2&&Math.abs(t._saturation-this._saturation)<1&&Math.abs(t._value-this._value)<1&&Math.abs(t._alpha-this._alpha)<1}doOnChange(){const{_hue:t,_saturation:r,_value:n,_alpha:i,format:o}=this;if(this.enableAlpha)switch(o){case"hsl":{const s=rde(t,r/100,n/100);this.value=`hsla(${t}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${t}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${ide(vx(t,r,n))}${yE(i*255/100)}`;break}default:{const{r:s,g:l,b:c}=vx(t,r,n);this.value=`rgba(${s}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(o){case"hsl":{const s=rde(t,r/100,n/100);this.value=`hsl(${t}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${t}, ${Math.round(r)}%, ${Math.round(n)}%)`;break}case"rgb":{const{r:s,g:l,b:c}=vx(t,r,n);this.value=`rgb(${s}, ${l}, ${c})`;break}default:this.value=ide(vx(t,r,n))}}};const xdt=a.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0}},setup(e){const t=li("color-predefine"),{currentColor:r}=a.inject(tde),n=a.ref(o(e.colors,e.color));a.watch(()=>r.value,s=>{const l=new Qx;l.fromString(s),n.value.forEach(c=>{c.selected=l.compare(c)})}),a.watchEffect(()=>{n.value=o(e.colors,e.color)});function i(s){e.color.fromString(e.colors[s])}function o(s,l){return s.map(c=>{const u=new Qx;return u.enableAlpha=!0,u.format="rgba",u.fromString(c),u.selected=u.value===l.value,u})}return{rgbaColors:n,handleSelect:i,ns:t}}}),_dt=["onClick"];function wdt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(e.ns.b())},[a.createElementVNode("div",{class:a.normalizeClass(e.ns.e("colors"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.rgbaColors,(s,l)=>(a.openBlock(),a.createElementBlock("div",{key:e.colors[l],class:a.normalizeClass([e.ns.e("color-selector"),e.ns.is("alpha",s._alpha<100),{selected:s.selected}]),onClick:c=>e.handleSelect(l)},[a.createElementVNode("div",{style:a.normalizeStyle({backgroundColor:s.value})},null,4)],10,_dt))),128))],2)],2)}var Ldt=hi(xdt,[["render",wdt],["__file","predefine.vue"]]);const Sdt=a.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(e){const t=li("color-svpanel"),r=a.getCurrentInstance(),n=a.ref(0),i=a.ref(0),o=a.ref("hsl(0, 100%, 50%)"),s=a.computed(()=>{const u=e.color.get("hue"),d=e.color.get("value");return{hue:u,value:d}});function l(){const u=e.color.get("saturation"),d=e.color.get("value"),p=r.vnode.el,{clientWidth:h,clientHeight:f}=p;i.value=u*h/100,n.value=(100-d)*f/100,o.value=`hsl(${e.color.get("hue")}, 100%, 50%)`}function c(u){const d=r.vnode.el.getBoundingClientRect(),{clientX:p,clientY:h}=Fj(u);let f=p-d.left,m=h-d.top;f=Math.max(0,f),f=Math.min(f,d.width),m=Math.max(0,m),m=Math.min(m,d.height),i.value=f,n.value=m,e.color.set({saturation:f/d.width*100,value:100-m/d.height*100})}return a.watch(()=>s.value,()=>{l()}),a.onMounted(()=>{Tx(r.vnode.el,{drag:u=>{c(u)},end:u=>{c(u)}}),l()}),{cursorTop:n,cursorLeft:i,background:o,colorValue:s,handleDrag:c,update:l,ns:t}}}),kdt=a.createElementVNode("div",null,null,-1),Mdt=[kdt];function Cdt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(e.ns.b()),style:a.normalizeStyle({backgroundColor:e.background})},[a.createElementVNode("div",{class:a.normalizeClass(e.ns.e("white"))},null,2),a.createElementVNode("div",{class:a.normalizeClass(e.ns.e("black"))},null,2),a.createElementVNode("div",{class:a.normalizeClass(e.ns.e("cursor")),style:a.normalizeStyle({top:e.cursorTop+"px",left:e.cursorLeft+"px"})},Mdt,6)],6)}var Edt=hi(Sdt,[["render",Cdt],["__file","sv-panel.vue"]]);const Adt=["onKeydown"],Odt=["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex"],Hdt=a.defineComponent({name:"ElColorPicker"}),Vdt=a.defineComponent({...Hdt,props:ydt,emits:Tdt,setup(e,{expose:t,emit:r}){const n=e,{t:i}=lg(),o=li("color"),{formItem:s}=dh(),l=uh(),c=mg(),{inputId:u,isLabeledByFormItem:d}=gx(n,{formItemContext:s}),p=a.ref(),h=a.ref(),f=a.ref(),m=a.ref(),g=a.ref(),T=a.ref(),{isFocused:y,handleFocus:v,handleBlur:_}=u3e(g,{beforeBlur(ne){var ye;return(ye=m.value)==null?void 0:ye.isFocusInsideContent(ne)},afterBlur(){G(!1),U()}}),b=ne=>{if(c.value)return ue();v(ne)};let L=!0;const w=a.reactive(new Qx({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),k=a.ref(!1),C=a.ref(!1),A=a.ref(""),O=a.computed(()=>!n.modelValue&&!C.value?"transparent":j(w,n.showAlpha)),N=a.computed(()=>!n.modelValue&&!C.value?"":w.value),I=a.computed(()=>d.value?void 0:n.label||i("el.colorpicker.defaultLabel")),R=a.computed(()=>d.value?s==null?void 0:s.labelId:void 0),D=a.computed(()=>[o.b("picker"),o.is("disabled",c.value),o.bm("picker",l.value),o.is("focused",y.value)]);function j(ne,ye){if(!(ne instanceof Qx))throw new TypeError("color should be instance of _color Class");const{r:_e,g:Ie,b:qe}=ne.toRgb();return ye?`rgba(${_e}, ${Ie}, ${qe}, ${ne.get("alpha")/100})`:`rgb(${_e}, ${Ie}, ${qe})`}function G(ne){k.value=ne}const P=oU(G,100,{leading:!0});function W(){c.value||G(!0)}function K(){P(!1),U()}function U(){a.nextTick(()=>{n.modelValue?w.fromString(n.modelValue):(w.value="",a.nextTick(()=>{C.value=!1}))})}function X(){c.value||P(!k.value)}function ee(){w.fromString(A.value)}function oe(){const ne=w.value;r(ss,ne),r("change",ne),n.validateEvent&&(s==null||s.validate("change").catch(ye=>$s(ye))),P(!1),a.nextTick(()=>{const ye=new Qx({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});w.compare(ye)||U()})}function he(){P(!1),r(ss,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(s==null||s.validate("change").catch(ne=>$s(ne))),U()}function me(ne){if(k.value&&(K(),y.value)){const ye=new FocusEvent("focus",ne);_(ye)}}function ie(ne){ne.preventDefault(),ne.stopPropagation(),G(!1),U()}function be(ne){switch(ne.code){case kc.enter:case kc.space:ne.preventDefault(),ne.stopPropagation(),W(),T.value.focus();break;case kc.esc:ie(ne);break}}function re(){g.value.focus()}function ue(){g.value.blur()}return a.onMounted(()=>{n.modelValue&&(A.value=N.value)}),a.watch(()=>n.modelValue,ne=>{ne?ne&&ne!==w.value&&(L=!1,w.fromString(ne)):C.value=!1}),a.watch(()=>N.value,ne=>{A.value=ne,L&&r("activeChange",ne),L=!0}),a.watch(()=>w.value,()=>{!n.modelValue&&!C.value&&(C.value=!0)}),a.watch(()=>k.value,()=>{a.nextTick(()=>{var ne,ye,_e;(ne=p.value)==null||ne.update(),(ye=h.value)==null||ye.update(),(_e=f.value)==null||_e.update()})}),a.provide(tde,{currentColor:N}),t({color:w,show:W,hide:K,focus:re,blur:ue}),(ne,ye)=>(a.openBlock(),a.createBlock(a.unref(OU),{ref_key:"popper",ref:m,visible:k.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[a.unref(o).be("picker","panel"),a.unref(o).b("dropdown"),ne.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",transition:`${a.unref(o).namespace.value}-zoom-in-top`,persistent:"",onHide:ye[2]||(ye[2]=_e=>G(!1))},{content:a.withCtx(()=>[a.withDirectives((a.openBlock(),a.createElementBlock("div",{onKeydown:a.withKeys(ie,["esc"])},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(o).be("dropdown","main-wrapper"))},[a.createVNode(gdt,{ref_key:"hue",ref:p,class:"hue-slider",color:a.unref(w),vertical:""},null,8,["color"]),a.createVNode(Edt,{ref_key:"sv",ref:h,color:a.unref(w)},null,8,["color"])],2),ne.showAlpha?(a.openBlock(),a.createBlock(hdt,{key:0,ref_key:"alpha",ref:f,color:a.unref(w)},null,8,["color"])):a.createCommentVNode("v-if",!0),ne.predefine?(a.openBlock(),a.createBlock(Ldt,{key:1,ref:"predefine",color:a.unref(w),colors:ne.predefine},null,8,["color","colors"])):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{class:a.normalizeClass(a.unref(o).be("dropdown","btns"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(o).be("dropdown","value"))},[a.createVNode(a.unref(lE),{ref_key:"inputRef",ref:T,modelValue:A.value,"onUpdate:modelValue":ye[0]||(ye[0]=_e=>A.value=_e),"validate-event":!1,size:"small",onKeyup:a.withKeys(ee,["enter"]),onBlur:ee},null,8,["modelValue","onKeyup"])],2),a.createVNode(a.unref(j3),{class:a.normalizeClass(a.unref(o).be("dropdown","link-btn")),text:"",size:"small",onClick:he},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(i)("el.colorpicker.clear")),1)]),_:1},8,["class"]),a.createVNode(a.unref(j3),{plain:"",size:"small",class:a.normalizeClass(a.unref(o).be("dropdown","btn")),onClick:oe},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(i)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,Adt)),[[a.unref(R3e),me]])]),default:a.withCtx(()=>[a.createElementVNode("div",{id:a.unref(u),ref_key:"triggerRef",ref:g,class:a.normalizeClass(a.unref(D)),role:"button","aria-label":a.unref(I),"aria-labelledby":a.unref(R),"aria-description":a.unref(i)("el.colorpicker.description",{color:ne.modelValue||""}),"aria-disabled":a.unref(c),tabindex:a.unref(c)?-1:ne.tabindex,onKeydown:be,onFocus:b,onBlur:ye[1]||(ye[1]=(..._e)=>a.unref(_)&&a.unref(_)(..._e))},[a.unref(c)?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(o).be("picker","mask"))},null,2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{class:a.normalizeClass(a.unref(o).be("picker","trigger")),onClick:X},[a.createElementVNode("span",{class:a.normalizeClass([a.unref(o).be("picker","color"),a.unref(o).is("alpha",ne.showAlpha)])},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(o).be("picker","color-inner")),style:a.normalizeStyle({backgroundColor:a.unref(O)})},[a.withDirectives(a.createVNode(a.unref(ql),{class:a.normalizeClass([a.unref(o).be("picker","icon"),a.unref(o).is("icon-arrow-down")])},{default:a.withCtx(()=>[a.createVNode(a.unref(sh))]),_:1},8,["class"]),[[a.vShow,ne.modelValue||C.value]]),a.withDirectives(a.createVNode(a.unref(ql),{class:a.normalizeClass([a.unref(o).be("picker","empty"),a.unref(o).is("icon-close")])},{default:a.withCtx(()=>[a.createVNode(a.unref(ax))]),_:1},8,["class"]),[[a.vShow,!ne.modelValue&&!C.value]])],6)],2)],2)],42,Odt)]),_:1},8,["visible","popper-class","transition"]))}});var Idt=hi(Vdt,[["__file","color-picker.vue"]]);const Pdt=Jc(Idt),Ndt=a.defineComponent({name:"ElContainer"}),Bdt=a.defineComponent({...Ndt,props:{direction:{type:String}},setup(e){const t=e,r=a.useSlots(),n=li("container"),i=a.computed(()=>t.direction==="vertical"?!0:t.direction==="horizontal"?!1:r&&r.default?r.default().some(o=>{const s=o.type.name;return s==="ElHeader"||s==="ElFooter"}):!1);return(o,s)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(n).b(),a.unref(n).is("vertical",a.unref(i))])},[a.renderSlot(o.$slots,"default")],2))}});var Rdt=hi(Bdt,[["__file","container.vue"]]);const Fdt=a.defineComponent({name:"ElAside"}),Ddt=a.defineComponent({...Fdt,props:{width:{type:String,default:null}},setup(e){const t=e,r=li("aside"),n=a.computed(()=>t.width?r.cssVarBlock({width:t.width}):{});return(i,o)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(r).b()),style:a.normalizeStyle(a.unref(n))},[a.renderSlot(i.$slots,"default")],6))}});var ade=hi(Ddt,[["__file","aside.vue"]]);const zdt=a.defineComponent({name:"ElFooter"}),jdt=a.defineComponent({...zdt,props:{height:{type:String,default:null}},setup(e){const t=e,r=li("footer"),n=a.computed(()=>t.height?r.cssVarBlock({height:t.height}):{});return(i,o)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(r).b()),style:a.normalizeStyle(a.unref(n))},[a.renderSlot(i.$slots,"default")],6))}});var sde=hi(jdt,[["__file","footer.vue"]]);const Udt=a.defineComponent({name:"ElHeader"}),Gdt=a.defineComponent({...Udt,props:{height:{type:String,default:null}},setup(e){const t=e,r=li("header"),n=a.computed(()=>t.height?r.cssVarBlock({height:t.height}):{});return(i,o)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(r).b()),style:a.normalizeStyle(a.unref(n))},[a.renderSlot(i.$slots,"default")],6))}});var lde=hi(Gdt,[["__file","header.vue"]]);const qdt=a.defineComponent({name:"ElMain"}),Wdt=a.defineComponent({...qdt,setup(e){const t=li("main");return(r,n)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(t).b())},[a.renderSlot(r.$slots,"default")],2))}});var cde=hi(Wdt,[["__file","main.vue"]]);const Zdt=Jc(Rdt,{Aside:ade,Footer:sde,Header:lde,Main:cde});Qu(ade),Qu(sde),Qu(lde);const ude=Qu(cde),Kdt=a.defineComponent({inheritAttrs:!1});function Xdt(e,t,r,n,i,o){return a.renderSlot(e.$slots,"default")}var Jdt=hi(Kdt,[["render",Xdt],["__file","collection.vue"]]);const Ydt=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function $dt(e,t,r,n,i,o){return a.renderSlot(e.$slots,"default")}var e4t=hi(Ydt,[["render",$dt],["__file","collection-item.vue"]]);const t4t="data-el-collection-item",r4t=e=>{const t=`El${e}Collection`,r=`${t}Item`,n=Symbol(t),i=Symbol(r),o={...Jdt,name:t,setup(){const l=a.ref(null),c=new Map;a.provide(n,{itemMap:c,getItems:()=>{const u=a.unref(l);if(!u)return[];const d=Array.from(u.querySelectorAll(`[${t4t}]`));return[...c.values()].sort((p,h)=>d.indexOf(p.ref)-d.indexOf(h.ref))},collectionRef:l})}},s={...e4t,name:r,setup(l,{attrs:c}){const u=a.ref(null),d=a.inject(n,void 0);a.provide(i,{collectionItemRef:u}),a.onMounted(()=>{const p=a.unref(u);p&&d.itemMap.set(p,{ref:p,...c})}),a.onBeforeUnmount(()=>{const p=a.unref(u);d.itemMap.delete(p)})}};return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:i,ElCollection:o,ElCollectionItem:s}},zU=Lo({trigger:yx.trigger,effect:{...T2.effect,default:"light"},type:{type:mi(String)},placement:{type:mi(String),default:"bottom"},popperOptions:{type:mi(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:mi([Number,String]),default:0},maxHeight:{type:mi([Number,String]),default:""},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},role:{type:String,default:"menu"},buttonProps:{type:mi(Object)},teleported:T2.teleported});Lo({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:lh}}),Lo({onKeydown:{type:mi(Function)}}),r4t("Dropdown");const dde=Symbol("ElSelectGroup"),TE=Symbol("ElSelect");function n4t(e,t){const r=a.inject(TE),n=a.inject(dde,{disabled:!1}),i=a.computed(()=>Sc(e.value)),o=a.computed(()=>r.props.multiple?p(r.props.modelValue,e.value):h(e.value,r.props.modelValue)),s=a.computed(()=>{if(r.props.multiple){const g=r.props.modelValue||[];return!o.value&&g.length>=r.props.multipleLimit&&r.props.multipleLimit>0}else return!1}),l=a.computed(()=>e.label||(i.value?"":e.value)),c=a.computed(()=>e.value||e.label||""),u=a.computed(()=>e.disabled||t.groupDisabled||s.value),d=a.getCurrentInstance(),p=(g=[],T)=>{if(i.value){const y=r.props.valueKey;return g&&g.some(v=>a.toRaw(y2(v,y))===y2(T,y))}else return g&&g.includes(T)},h=(g,T)=>{if(i.value){const{valueKey:y}=r.props;return y2(g,y)===y2(T,y)}else return g===T},f=()=>{!e.disabled&&!n.disabled&&(r.hoverIndex=r.optionsArray.indexOf(d.proxy))};a.watch(()=>l.value,()=>{!e.created&&!r.props.remote&&r.setSelected()}),a.watch(()=>e.value,(g,T)=>{const{remote:y,valueKey:v}=r.props;if(Object.is(g,T)||(r.onOptionDestroy(T,d.proxy),r.onOptionCreate(d.proxy)),!e.created&&!y){if(v&&Sc(g)&&Sc(T)&&g[v]===T[v])return;r.setSelected()}}),a.watch(()=>n.disabled,()=>{t.groupDisabled=n.disabled},{immediate:!0});const{queryChange:m}=a.toRaw(r);return a.watch(m,g=>{const{query:T}=a.unref(g),y=new RegExp(c1t(T),"i");t.visible=y.test(l.value)||e.created,t.visible||r.filteredOptionsCount--},{immediate:!0}),{select:r,currentLabel:l,currentValue:c,itemSelected:o,isDisabled:u,hoverItem:f}}const i4t=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(e){const t=li("select"),r=fx(),n=a.computed(()=>[t.be("dropdown","item"),t.is("disabled",a.unref(l)),{selected:a.unref(s),hover:a.unref(p)}]),i=a.reactive({index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}),{currentLabel:o,itemSelected:s,isDisabled:l,select:c,hoverItem:u}=n4t(e,i),{visible:d,hover:p}=a.toRefs(i),h=a.getCurrentInstance().proxy;c.onOptionCreate(h),a.onBeforeUnmount(()=>{const m=h.value,{selected:g}=c,T=(c.props.multiple?g:[g]).some(y=>y.value===h.value);a.nextTick(()=>{c.cachedOptions.get(m)===h&&!T&&c.cachedOptions.delete(m)}),c.onOptionDestroy(m,h)});function f(){e.disabled!==!0&&i.groupDisabled!==!0&&c.handleOptionSelect(h)}return{ns:t,id:r,containerKls:n,currentLabel:o,itemSelected:s,isDisabled:l,select:c,hoverItem:u,visible:d,hover:p,selectOptionClick:f,states:i}}}),o4t=["id","aria-disabled","aria-selected"];function a4t(e,t,r,n,i,o){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:e.id,class:a.normalizeClass(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMouseenter:t[0]||(t[0]=(...s)=>e.hoverItem&&e.hoverItem(...s)),onClick:t[1]||(t[1]=a.withModifiers((...s)=>e.selectOptionClick&&e.selectOptionClick(...s),["stop"]))},[a.renderSlot(e.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(e.currentLabel),1)])],42,o4t)),[[a.vShow,e.visible]])}var jU=hi(i4t,[["render",a4t],["__file","option.vue"]]);const s4t=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=a.inject(TE),t=li("select"),r=a.computed(()=>e.props.popperClass),n=a.computed(()=>e.props.multiple),i=a.computed(()=>e.props.fitInputWidth),o=a.ref("");function s(){var l;o.value=`${(l=e.selectWrapper)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{s(),zC(e.selectWrapper,s)}),{ns:t,minWidth:o,popperClass:r,isMultiple:n,isFitInputWidth:i}}});function l4t(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:a.normalizeStyle({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(e.ns.be("dropdown","header"))},[a.renderSlot(e.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(e.$slots,"default"),e.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(e.ns.be("dropdown","footer"))},[a.renderSlot(e.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var c4t=hi(s4t,[["render",l4t],["__file","select-dropdown.vue"]]);function u4t(e){const{t}=lg();return a.reactive({options:new Map,cachedOptions:new Map,disabledOptions:new Map,createdLabel:null,createdSelected:!1,selected:e.multiple?[]:{},inputLength:20,inputWidth:0,optionsCount:0,filteredOptionsCount:0,visible:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,cachedPlaceHolder:"",currentPlaceholder:t("el.select.placeholder"),menuVisibleOnFocus:!1,isOnComposition:!1,prefixWidth:11,mouseEnter:!1,focused:!1})}const d4t=(e,t,r)=>{const{t:n}=lg(),i=li("select");Cue({from:"suffixTransition",replacement:"override style scheme",version:"2.3.0",scope:"props",ref:"https://element-plus.org/en-US/component/select.html#select-attributes"},a.computed(()=>e.suffixTransition===!1));const o=a.ref(null),s=a.ref(null),l=a.ref(null),c=a.ref(null),u=a.ref(null),d=a.ref(null),p=a.ref(null),h=a.ref(null),f=a.ref(),m=a.shallowRef({query:""}),g=a.shallowRef(""),T=a.ref([]);let y=0;const{form:v,formItem:_}=dh(),b=a.computed(()=>!e.filterable||e.multiple||!t.visible),L=a.computed(()=>e.disabled||(v==null?void 0:v.disabled)),w=a.computed(()=>{const wt=e.multiple?Array.isArray(e.modelValue)&&e.modelValue.length>0:e.modelValue!==void 0&&e.modelValue!==null&&e.modelValue!=="";return e.clearable&&!L.value&&t.inputHovering&&wt}),k=a.computed(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),C=a.computed(()=>i.is("reverse",k.value&&t.visible&&e.suffixTransition)),A=a.computed(()=>(v==null?void 0:v.statusIcon)&&(_==null?void 0:_.validateState)&&kue[_==null?void 0:_.validateState]),O=a.computed(()=>e.remote?300:0),N=a.computed(()=>e.loading?e.loadingText||n("el.select.loading"):e.remote&&t.query===""&&t.options.size===0?!1:e.filterable&&t.query&&t.options.size>0&&t.filteredOptionsCount===0?e.noMatchText||n("el.select.noMatch"):t.options.size===0?e.noDataText||n("el.select.noData"):null),I=a.computed(()=>{const wt=Array.from(t.options.values()),je=[];return T.value.forEach(ke=>{const Oe=wt.findIndex(Ye=>Ye.currentLabel===ke);Oe>-1&&je.push(wt[Oe])}),je.length>=wt.length?je:wt}),R=a.computed(()=>Array.from(t.cachedOptions.values())),D=a.computed(()=>{const wt=I.value.filter(je=>!je.created).some(je=>je.currentLabel===t.query);return e.filterable&&e.allowCreate&&t.query!==""&&!wt}),j=uh(),G=a.computed(()=>["small"].includes(j.value)?"small":"default"),P=a.computed({get(){return t.visible&&N.value!==!1},set(wt){t.visible=wt}});a.watch([()=>L.value,()=>j.value,()=>v==null?void 0:v.size],()=>{a.nextTick(()=>{W()})}),a.watch(()=>e.placeholder,wt=>{t.cachedPlaceHolder=t.currentPlaceholder=wt,e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(t.currentPlaceholder="")}),a.watch(()=>e.modelValue,(wt,je)=>{e.multiple&&(W(),wt&&wt.length>0||s.value&&t.query!==""?t.currentPlaceholder="":t.currentPlaceholder=t.cachedPlaceHolder,e.filterable&&!e.reserveKeyword&&(t.query="",K(t.query))),ee(),e.filterable&&!e.multiple&&(t.inputLength=20),!aU(wt,je)&&e.validateEvent&&(_==null||_.validate("change").catch(ke=>$s(ke)))},{flush:"post",deep:!0}),a.watch(()=>t.visible,wt=>{var je,ke,Oe,Ye,ve;wt?((ke=(je=c.value)==null?void 0:je.updatePopper)==null||ke.call(je),e.filterable&&(t.filteredOptionsCount=t.optionsCount,t.query=e.remote?"":t.selectedLabel,(Ye=(Oe=l.value)==null?void 0:Oe.focus)==null||Ye.call(Oe),e.multiple?(ve=s.value)==null||ve.focus():t.selectedLabel&&(t.currentPlaceholder=`${t.selectedLabel}`,t.selectedLabel=""),K(t.query),!e.multiple&&!e.remote&&(m.value.query="",a.triggerRef(m),a.triggerRef(g)))):(e.filterable&&(g2(e.filterMethod)&&e.filterMethod(""),g2(e.remoteMethod)&&e.remoteMethod("")),t.query="",t.previousQuery=null,t.selectedLabel="",t.inputLength=20,t.menuVisibleOnFocus=!1,he(),a.nextTick(()=>{s.value&&s.value.value===""&&t.selected.length===0&&(t.currentPlaceholder=t.cachedPlaceHolder)}),e.multiple||(t.selected&&(e.filterable&&e.allowCreate&&t.createdSelected&&t.createdLabel?t.selectedLabel=t.createdLabel:t.selectedLabel=t.selected.currentLabel,e.filterable&&(t.query=t.selectedLabel)),e.filterable&&(t.currentPlaceholder=t.cachedPlaceHolder))),r.emit("visible-change",wt)}),a.watch(()=>t.options.entries(),()=>{var wt,je,ke;if(!Xs)return;(je=(wt=c.value)==null?void 0:wt.updatePopper)==null||je.call(wt),e.multiple&&W();const Oe=((ke=p.value)==null?void 0:ke.querySelectorAll("input"))||[];(!e.filterable&&!e.defaultFirstOption&&!nx(e.modelValue)||!Array.from(Oe).includes(document.activeElement))&&ee(),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&X()},{flush:"post"}),a.watch(()=>t.hoverIndex,wt=>{Ys(wt)&&wt>-1?f.value=I.value[wt]||{}:f.value={},I.value.forEach(je=>{je.hover=f.value===je})});const W=()=>{a.nextTick(()=>{var wt,je;if(!o.value)return;const ke=o.value.$el.querySelector("input");y=y||(ke.clientHeight>0?ke.clientHeight+2:0);const Oe=d.value,Ye=getComputedStyle(ke).getPropertyValue(i.cssVarName("input-height")),ve=Number.parseFloat(Ye)||I1t(j.value||(v==null?void 0:v.size)),Ae=j.value||ve===y||y<=0?ve:y;ke.offsetParent!==null&&(ke.style.height=`${(t.selected.length===0?Ae:Math.max(Oe?Oe.clientHeight+(Oe.clientHeight>Ae?6:0):0,Ae))-2}px`),t.visible&&N.value!==!1&&((je=(wt=c.value)==null?void 0:wt.updatePopper)==null||je.call(wt))})},K=async wt=>{if(!(t.previousQuery===wt||t.isOnComposition)){if(t.previousQuery===null&&(g2(e.filterMethod)||g2(e.remoteMethod))){t.previousQuery=wt;return}t.previousQuery=wt,a.nextTick(()=>{var je,ke;t.visible&&((ke=(je=c.value)==null?void 0:je.updatePopper)==null||ke.call(je))}),t.hoverIndex=-1,e.multiple&&e.filterable&&a.nextTick(()=>{if(!L.value){const je=s.value.value.length*15+20;t.inputLength=e.collapseTags?Math.min(50,je):je,U()}W()}),e.remote&&g2(e.remoteMethod)?(t.hoverIndex=-1,e.remoteMethod(wt)):g2(e.filterMethod)?(e.filterMethod(wt),a.triggerRef(g)):(t.filteredOptionsCount=t.optionsCount,m.value.query=wt,a.triggerRef(m),a.triggerRef(g)),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&(await a.nextTick(),X())}},U=()=>{t.currentPlaceholder!==""&&(t.currentPlaceholder=s.value.value?"":t.cachedPlaceHolder)},X=()=>{const wt=I.value.filter(Oe=>Oe.visible&&!Oe.disabled&&!Oe.states.groupDisabled),je=wt.find(Oe=>Oe.created),ke=wt[0];t.hoverIndex=et(I.value,je||ke)},ee=()=>{var wt;if(e.multiple)t.selectedLabel="";else{const ke=oe(e.modelValue);(wt=ke.props)!=null&&wt.created?(t.createdLabel=ke.props.value,t.createdSelected=!0):t.createdSelected=!1,t.selectedLabel=ke.currentLabel,t.selected=ke,e.filterable&&(t.query=t.selectedLabel);return}const je=[];Array.isArray(e.modelValue)&&e.modelValue.forEach(ke=>{je.push(oe(ke))}),t.selected=je,a.nextTick(()=>{W()})},oe=wt=>{let je;const ke=Dj(wt).toLowerCase()==="object",Oe=Dj(wt).toLowerCase()==="null",Ye=Dj(wt).toLowerCase()==="undefined";for(let Be=t.cachedOptions.size-1;Be>=0;Be--){const Se=R.value[Be];if(ke?y2(Se.value,e.valueKey)===y2(wt,e.valueKey):Se.value===wt){je={value:wt,currentLabel:Se.currentLabel,isDisabled:Se.isDisabled};break}}if(je)return je;const ve=ke?wt.label:!Oe&&!Ye?wt:"",Ae={value:wt,currentLabel:ve};return e.multiple&&(Ae.hitState=!1),Ae},he=()=>{setTimeout(()=>{const wt=e.valueKey;e.multiple?t.selected.length>0?t.hoverIndex=Math.min.apply(null,t.selected.map(je=>I.value.findIndex(ke=>y2(ke,wt)===y2(je,wt)))):t.hoverIndex=-1:t.hoverIndex=I.value.findIndex(je=>St(je)===St(t.selected))},300)},me=()=>{var wt,je;ie(),(je=(wt=c.value)==null?void 0:wt.updatePopper)==null||je.call(wt),e.multiple&&W()},ie=()=>{var wt;t.inputWidth=(wt=o.value)==null?void 0:wt.$el.offsetWidth},be=()=>{e.filterable&&t.query!==t.selectedLabel&&(t.query=t.selectedLabel,K(t.query))},re=oU(()=>{be()},O.value),ue=oU(wt=>{K(wt.target.value)},O.value),ne=wt=>{aU(e.modelValue,wt)||r.emit(eE,wt)},ye=wt=>r1t(wt,je=>!t.disabledOptions.has(je)),_e=wt=>{if(wt.code!==kc.delete){if(wt.target.value.length<=0&&!yt()){const je=e.modelValue.slice(),ke=ye(je);if(ke<0)return;je.splice(ke,1),r.emit(ss,je),ne(je)}wt.target.value.length===1&&e.modelValue.length===0&&(t.currentPlaceholder=t.cachedPlaceHolder)}},Ie=(wt,je)=>{const ke=t.selected.indexOf(je);if(ke>-1&&!L.value){const Oe=e.modelValue.slice();Oe.splice(ke,1),r.emit(ss,Oe),ne(Oe),r.emit("remove-tag",je.value)}wt.stopPropagation(),$e()},qe=wt=>{wt.stopPropagation();const je=e.multiple?[]:"";if(!Js(je))for(const ke of t.selected)ke.isDisabled&&je.push(ke.value);r.emit(ss,je),ne(je),t.hoverIndex=-1,t.visible=!1,r.emit("clear"),$e()},Ge=wt=>{var je;if(e.multiple){const ke=(e.modelValue||[]).slice(),Oe=et(ke,wt.value);Oe>-1?ke.splice(Oe,1):(e.multipleLimit<=0||ke.length<e.multipleLimit)&&ke.push(wt.value),r.emit(ss,ke),ne(ke),wt.created&&(t.query="",K(""),t.inputLength=20),e.filterable&&((je=s.value)==null||je.focus())}else r.emit(ss,wt.value),ne(wt.value),t.visible=!1;Ve(),!t.visible&&a.nextTick(()=>{Ne(wt)})},et=(wt=[],je)=>{if(!Sc(je))return wt.indexOf(je);const ke=e.valueKey;let Oe=-1;return wt.some((Ye,ve)=>a.toRaw(y2(Ye,ke))===y2(je,ke)?(Oe=ve,!0):!1),Oe},Ve=()=>{const wt=s.value||o.value;wt&&(wt==null||wt.focus())},Ne=wt=>{var je,ke,Oe,Ye,ve;const Ae=Array.isArray(wt)?wt[0]:wt;let Be=null;if(Ae!=null&&Ae.value){const Se=I.value.filter(ge=>ge.value===Ae.value);Se.length>0&&(Be=Se[0].$el)}if(c.value&&Be){const Se=(Ye=(Oe=(ke=(je=c.value)==null?void 0:je.popperRef)==null?void 0:ke.contentRef)==null?void 0:Oe.querySelector)==null?void 0:Ye.call(Oe,`.${i.be("dropdown","wrap")}`);Se&&p1t(Se,Be)}(ve=h.value)==null||ve.handleScroll()},it=wt=>{t.optionsCount++,t.filteredOptionsCount++,t.options.set(wt.value,wt),t.cachedOptions.set(wt.value,wt),wt.disabled&&t.disabledOptions.set(wt.value,wt)},Re=(wt,je)=>{t.options.get(wt)===je&&(t.optionsCount--,t.filteredOptionsCount--,t.options.delete(wt))},pt=wt=>{wt.code!==kc.backspace&&yt(!1),t.inputLength=s.value.value.length*15+20,W()},yt=wt=>{if(!Array.isArray(t.selected))return;const je=ye(t.selected.map(Oe=>Oe.value)),ke=t.selected[je];if(ke)return wt===!0||wt===!1?(ke.hitState=wt,wt):(ke.hitState=!ke.hitState,ke.hitState)},ct=wt=>{const je=wt.target.value;if(wt.type==="compositionend")t.isOnComposition=!1,a.nextTick(()=>K(je));else{const ke=je[je.length-1]||"";t.isOnComposition=!Mue(ke)}},xe=()=>{a.nextTick(()=>Ne(t.selected))},Ue=wt=>{t.focused||((e.automaticDropdown||e.filterable)&&(e.filterable&&!t.visible&&(t.menuVisibleOnFocus=!0),t.visible=!0),t.focused=!0,r.emit("focus",wt))},$e=()=>{var wt,je;t.visible?(wt=s.value||o.value)==null||wt.focus():(je=o.value)==null||je.focus()},at=()=>{var wt,je,ke;t.visible=!1,(wt=o.value)==null||wt.blur(),(ke=(je=l.value)==null?void 0:je.blur)==null||ke.call(je)},Ht=wt=>{var je,ke,Oe;(je=c.value)!=null&&je.isFocusInsideContent(wt)||(ke=u.value)!=null&&ke.isFocusInsideContent(wt)||(Oe=p.value)!=null&&Oe.contains(wt.relatedTarget)||(t.visible&&Ft(),t.focused=!1,r.emit("blur",wt))},Vt=wt=>{qe(wt)},Ft=()=>{t.visible=!1},Gt=wt=>{t.visible&&(wt.preventDefault(),wt.stopPropagation(),t.visible=!1)},Je=wt=>{wt&&!t.mouseEnter||L.value||(t.menuVisibleOnFocus?t.menuVisibleOnFocus=!1:(!c.value||!c.value.isFocusInsideContent())&&(t.visible=!t.visible),$e())},ft=()=>{t.visible?I.value[t.hoverIndex]&&Ge(I.value[t.hoverIndex]):Je()},St=wt=>Sc(wt.value)?y2(wt.value,e.valueKey):wt.value,Zt=a.computed(()=>I.value.filter(wt=>wt.visible).every(wt=>wt.disabled)),Jt=a.computed(()=>e.multiple?t.selected.slice(0,e.maxCollapseTags):[]),Pt=a.computed(()=>e.multiple?t.selected.slice(e.maxCollapseTags):[]),rt=wt=>{if(!t.visible){t.visible=!0;return}if(!(t.options.size===0||t.filteredOptionsCount===0)&&!t.isOnComposition&&!Zt.value){wt==="next"?(t.hoverIndex++,t.hoverIndex===t.options.size&&(t.hoverIndex=0)):wt==="prev"&&(t.hoverIndex--,t.hoverIndex<0&&(t.hoverIndex=t.options.size-1));const je=I.value[t.hoverIndex];(je.disabled===!0||je.states.groupDisabled===!0||!je.visible)&&rt(wt),a.nextTick(()=>Ne(f.value))}},Et=()=>{t.mouseEnter=!0},kt=()=>{t.mouseEnter=!1},or=(wt,je)=>{var ke,Oe;Ie(wt,je),(Oe=(ke=u.value)==null?void 0:ke.updatePopper)==null||Oe.call(ke)},$t=a.computed(()=>({maxWidth:`${a.unref(t.inputWidth)-32-(A.value?22:0)}px`,width:"100%"}));return{optionList:T,optionsArray:I,hoverOption:f,selectSize:j,handleResize:me,debouncedOnInputChange:re,debouncedQueryChange:ue,deletePrevTag:_e,deleteTag:Ie,deleteSelected:qe,handleOptionSelect:Ge,scrollToOption:Ne,readonly:b,resetInputHeight:W,showClose:w,iconComponent:k,iconReverse:C,showNewOption:D,collapseTagSize:G,setSelected:ee,managePlaceholder:U,selectDisabled:L,emptyText:N,toggleLastOptionHitState:yt,resetInputState:pt,handleComposition:ct,onOptionCreate:it,onOptionDestroy:Re,handleMenuEnter:xe,handleFocus:Ue,focus:$e,blur:at,handleBlur:Ht,handleClearClick:Vt,handleClose:Ft,handleKeydownEscape:Gt,toggleMenu:Je,selectOption:ft,getValueKey:St,navigateOptions:rt,handleDeleteTooltipTag:or,dropMenuVisible:P,queryChange:m,groupQueryChange:g,showTagList:Jt,collapseTagList:Pt,selectTagsStyle:$t,reference:o,input:s,iOSInput:l,tooltipRef:c,tagTooltipRef:u,tags:d,selectWrapper:p,scrollbar:h,handleMouseEnter:Et,handleMouseLeave:kt}};var p4t=a.defineComponent({name:"ElOptions",emits:["update-options"],setup(e,{slots:t,emit:r}){let n=[];function i(o,s){if(o.length!==s.length)return!1;for(const[l]of o.entries())if(o[l]!=s[l])return!1;return!0}return()=>{var o,s;const l=(o=t.default)==null?void 0:o.call(t),c=[];function u(d){Array.isArray(d)&&d.forEach(p=>{var h,f,m,g;const T=(h=(p==null?void 0:p.type)||{})==null?void 0:h.name;T==="ElOptionGroup"?u(!Js(p.children)&&!Array.isArray(p.children)&&g2((f=p.children)==null?void 0:f.default)?(m=p.children)==null?void 0:m.default():p.children):T==="ElOption"?c.push((g=p.props)==null?void 0:g.label):Array.isArray(p.children)&&u(p.children)})}return l.length&&u((s=l[0])==null?void 0:s.children),i(c,n)||(n=c,r("update-options",c)),l}}});const pde="ElSelect",h4t=a.defineComponent({name:pde,componentName:pde,components:{ElInput:lE,ElSelectMenu:c4t,ElOption:jU,ElOptions:p4t,ElTag:W3t,ElScrollbar:N0t,ElTooltip:OU,ElIcon:ql},directives:{ClickOutside:R3e},props:{name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:{type:String,validator:P1t},effect:{type:String,default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Object,default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:T2.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:lh,default:lU},fitInputWidth:Boolean,suffixIcon:{type:lh,default:sh},tagType:{...$3e.type,default:"info"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,suffixTransition:{type:Boolean,default:!0},placement:{type:String,values:rE,default:"bottom-start"},ariaLabel:{type:String,default:void 0}},emits:[ss,eE,"remove-tag","clear","visible-change","focus","blur"],setup(e,t){const r=li("select"),n=li("input"),{t:i}=lg(),o=fx(),s=u4t(e),{optionList:l,optionsArray:c,hoverOption:u,selectSize:d,readonly:p,handleResize:h,collapseTagSize:f,debouncedOnInputChange:m,debouncedQueryChange:g,deletePrevTag:T,deleteTag:y,deleteSelected:v,handleOptionSelect:_,scrollToOption:b,setSelected:L,resetInputHeight:w,managePlaceholder:k,showClose:C,selectDisabled:A,iconComponent:O,iconReverse:N,showNewOption:I,emptyText:R,toggleLastOptionHitState:D,resetInputState:j,handleComposition:G,onOptionCreate:P,onOptionDestroy:W,handleMenuEnter:K,handleFocus:U,focus:X,blur:ee,handleBlur:oe,handleClearClick:he,handleClose:me,handleKeydownEscape:ie,toggleMenu:be,selectOption:re,getValueKey:ue,navigateOptions:ne,handleDeleteTooltipTag:ye,dropMenuVisible:_e,reference:Ie,input:qe,iOSInput:Ge,tooltipRef:et,tagTooltipRef:Ve,tags:Ne,selectWrapper:it,scrollbar:Re,queryChange:pt,groupQueryChange:yt,handleMouseEnter:ct,handleMouseLeave:xe,showTagList:Ue,collapseTagList:$e,selectTagsStyle:at}=d4t(e,s,t),{inputWidth:Ht,selected:Vt,inputLength:Ft,filteredOptionsCount:Gt,visible:Je,selectedLabel:ft,hoverIndex:St,query:Zt,inputHovering:Jt,currentPlaceholder:Pt,menuVisibleOnFocus:rt,isOnComposition:Et,options:kt,cachedOptions:or,optionsCount:$t,prefixWidth:wt}=a.toRefs(s),je=a.computed(()=>{const Ce=[r.b()],Xe=a.unref(d);return Xe&&Ce.push(r.m(Xe)),e.disabled&&Ce.push(r.m("disabled")),Ce}),ke=a.computed(()=>[r.e("tags"),r.is("disabled",a.unref(A))]),Oe=a.computed(()=>[r.b("tags-wrapper"),{"has-prefix":a.unref(wt)&&a.unref(Vt).length}]),Ye=a.computed(()=>[r.e("input"),r.is(a.unref(d)),r.is("disabled",a.unref(A))]),ve=a.computed(()=>[r.e("input"),r.is(a.unref(d)),r.em("input","iOS")]),Ae=a.computed(()=>[r.is("empty",!e.allowCreate&&!!a.unref(Zt)&&a.unref(Gt)===0)]),Be=a.computed(()=>({maxWidth:`${a.unref(Ht)>123&&a.unref(Vt).length>e.maxCollapseTags?a.unref(Ht)-123:a.unref(Ht)-75}px`})),Se=a.computed(()=>({marginLeft:`${a.unref(wt)}px`,flexGrow:1,width:`${a.unref(Ft)/(a.unref(Ht)-32)}%`,maxWidth:`${a.unref(Ht)-42}px`}));a.provide(TE,a.reactive({props:e,options:kt,optionsArray:c,cachedOptions:or,optionsCount:$t,filteredOptionsCount:Gt,hoverIndex:St,handleOptionSelect:_,onOptionCreate:P,onOptionDestroy:W,selectWrapper:it,selected:Vt,setSelected:L,queryChange:pt,groupQueryChange:yt})),a.onMounted(()=>{s.cachedPlaceHolder=Pt.value=e.placeholder||(()=>i("el.select.placeholder")),e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(Pt.value=""),zC(it,h),e.remote&&e.multiple&&w(),a.nextTick(()=>{const Ce=Ie.value&&Ie.value.$el;if(Ce&&(Ht.value=Ce.getBoundingClientRect().width,t.slots.prefix)){const Xe=Ce.querySelector(`.${n.e("prefix")}`);wt.value=Math.max(Xe.getBoundingClientRect().width+11,30)}}),L()}),e.multiple&&!Array.isArray(e.modelValue)&&t.emit(ss,[]),!e.multiple&&Array.isArray(e.modelValue)&&t.emit(ss,"");const ge=a.computed(()=>{var Ce,Xe;return(Xe=(Ce=et.value)==null?void 0:Ce.popperRef)==null?void 0:Xe.contentRef});return{isIOS:b0e,onOptionsRendered:Ce=>{l.value=Ce},prefixWidth:wt,selectSize:d,readonly:p,handleResize:h,collapseTagSize:f,debouncedOnInputChange:m,debouncedQueryChange:g,deletePrevTag:T,deleteTag:y,handleDeleteTooltipTag:ye,deleteSelected:v,handleOptionSelect:_,scrollToOption:b,inputWidth:Ht,selected:Vt,inputLength:Ft,filteredOptionsCount:Gt,visible:Je,selectedLabel:ft,hoverIndex:St,query:Zt,inputHovering:Jt,currentPlaceholder:Pt,menuVisibleOnFocus:rt,isOnComposition:Et,options:kt,resetInputHeight:w,managePlaceholder:k,showClose:C,selectDisabled:A,iconComponent:O,iconReverse:N,showNewOption:I,emptyText:R,toggleLastOptionHitState:D,resetInputState:j,handleComposition:G,handleMenuEnter:K,handleFocus:U,focus:X,blur:ee,handleBlur:oe,handleClearClick:he,handleClose:me,handleKeydownEscape:ie,toggleMenu:be,selectOption:re,getValueKey:ue,navigateOptions:ne,dropMenuVisible:_e,reference:Ie,input:qe,iOSInput:Ge,tooltipRef:et,popperPaneRef:ge,tags:Ne,selectWrapper:it,scrollbar:Re,wrapperKls:je,tagsKls:ke,tagWrapperKls:Oe,inputKls:Ye,iOSInputKls:ve,scrollbarKls:Ae,selectTagsStyle:at,nsSelect:r,tagTextStyle:Be,inputStyle:Se,handleMouseEnter:ct,handleMouseLeave:xe,showTagList:Ue,collapseTagList:$e,tagTooltipRef:Ve,contentId:o,hoverOption:u}}}),f4t=["disabled","autocomplete","aria-activedescendant","aria-controls","aria-expanded","aria-label"],m4t=["disabled"],g4t={style:{height:"100%",display:"flex","justify-content":"center","align-items":"center"}};function y4t(e,t,r,n,i,o){const s=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),c=a.resolveComponent("el-icon"),u=a.resolveComponent("el-input"),d=a.resolveComponent("el-option"),p=a.resolveComponent("el-options"),h=a.resolveComponent("el-scrollbar"),f=a.resolveComponent("el-select-menu"),m=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectWrapper",class:a.normalizeClass(e.wrapperKls),onMouseenter:t[22]||(t[22]=(...g)=>e.handleMouseEnter&&e.handleMouseEnter(...g)),onMouseleave:t[23]||(t[23]=(...g)=>e.handleMouseLeave&&e.handleMouseLeave(...g)),onClick:t[24]||(t[24]=a.withModifiers((...g)=>e.toggleMenu&&e.toggleMenu(...g),["stop"]))},[a.createVNode(l,{ref:"tooltipRef",visible:e.dropMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,onShow:e.handleMenuEnter},{default:a.withCtx(()=>{var g,T;return[a.createElementVNode("div",{class:"select-trigger",onMouseenter:t[20]||(t[20]=y=>e.inputHovering=!0),onMouseleave:t[21]||(t[21]=y=>e.inputHovering=!1)},[e.multiple?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"tags",tabindex:"-1",class:a.normalizeClass(e.tagsKls),style:a.normalizeStyle(e.selectTagsStyle),onClick:t[15]||(t[15]=(...y)=>e.focus&&e.focus(...y))},[e.collapseTags&&e.selected.length?(a.openBlock(),a.createBlock(a.Transition,{key:0,onAfterLeave:e.resetInputHeight},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.tagWrapperKls)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.showTagList,y=>(a.openBlock(),a.createBlock(s,{key:e.getValueKey(y),closable:!e.selectDisabled&&!y.isDisabled,size:e.collapseTagSize,hit:y.hitState,type:e.tagType,"disable-transitions":"",onClose:v=>e.deleteTag(v,y)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.nsSelect.e("tags-text")),style:a.normalizeStyle(e.tagTextStyle)},a.toDisplayString(y.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128)),e.selected.length>e.maxCollapseTags?(a.openBlock(),a.createBlock(s,{key:0,closable:!1,size:e.collapseTagSize,type:e.tagType,"disable-transitions":""},{default:a.withCtx(()=>[e.collapseTagsTooltip?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:e.dropMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.nsSelect.e("tags-text"))},"+ "+a.toDisplayString(e.selected.length-e.maxCollapseTags),3)]),content:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass(e.nsSelect.e("collapse-tags"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.collapseTagList,y=>(a.openBlock(),a.createElementBlock("div",{key:e.getValueKey(y),class:a.normalizeClass(e.nsSelect.e("collapse-tag"))},[a.createVNode(s,{class:"in-tooltip",closable:!e.selectDisabled&&!y.isDisabled,size:e.collapseTagSize,hit:y.hitState,type:e.tagType,"disable-transitions":"",style:{margin:"2px"},onClose:v=>e.handleDeleteTooltipTag(v,y)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.nsSelect.e("tags-text")),style:a.normalizeStyle({maxWidth:e.inputWidth-75+"px"})},a.toDisplayString(y.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect","teleported"])):(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(e.nsSelect.e("tags-text"))},"+ "+a.toDisplayString(e.selected.length-e.maxCollapseTags),3))]),_:1},8,["size","type"])):a.createCommentVNode("v-if",!0)],2)]),_:1},8,["onAfterLeave"])):a.createCommentVNode("v-if",!0),e.collapseTags?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.Transition,{key:1,onAfterLeave:e.resetInputHeight},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.tagWrapperKls),style:a.normalizeStyle(e.prefixWidth&&e.selected.length?{marginLeft:`${e.prefixWidth}px`}:"")},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.selected,y=>(a.openBlock(),a.createBlock(s,{key:e.getValueKey(y),closable:!e.selectDisabled&&!y.isDisabled,size:e.collapseTagSize,hit:y.hitState,type:e.tagType,"disable-transitions":"",onClose:v=>e.deleteTag(v,y)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.nsSelect.e("tags-text")),style:a.normalizeStyle({maxWidth:e.inputWidth-75+"px"})},a.toDisplayString(y.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128))],6)]),_:1},8,["onAfterLeave"])),e.filterable&&!e.selectDisabled?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:2,ref:"input","onUpdate:modelValue":t[0]||(t[0]=y=>e.query=y),type:"text",class:a.normalizeClass(e.inputKls),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:a.normalizeStyle(e.inputStyle),role:"combobox","aria-activedescendant":((g=e.hoverOption)==null?void 0:g.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:t[1]||(t[1]=(...y)=>e.handleFocus&&e.handleFocus(...y)),onBlur:t[2]||(t[2]=(...y)=>e.handleBlur&&e.handleBlur(...y)),onKeyup:t[3]||(t[3]=(...y)=>e.managePlaceholder&&e.managePlaceholder(...y)),onKeydown:[t[4]||(t[4]=(...y)=>e.resetInputState&&e.resetInputState(...y)),t[5]||(t[5]=a.withKeys(a.withModifiers(y=>e.navigateOptions("next"),["prevent"]),["down"])),t[6]||(t[6]=a.withKeys(a.withModifiers(y=>e.navigateOptions("prev"),["prevent"]),["up"])),t[7]||(t[7]=a.withKeys((...y)=>e.handleKeydownEscape&&e.handleKeydownEscape(...y),["esc"])),t[8]||(t[8]=a.withKeys(a.withModifiers((...y)=>e.selectOption&&e.selectOption(...y),["stop","prevent"]),["enter"])),t[9]||(t[9]=a.withKeys((...y)=>e.deletePrevTag&&e.deletePrevTag(...y),["delete"])),t[10]||(t[10]=a.withKeys(y=>e.visible=!1,["tab"]))],onCompositionstart:t[11]||(t[11]=(...y)=>e.handleComposition&&e.handleComposition(...y)),onCompositionupdate:t[12]||(t[12]=(...y)=>e.handleComposition&&e.handleComposition(...y)),onCompositionend:t[13]||(t[13]=(...y)=>e.handleComposition&&e.handleComposition(...y)),onInput:t[14]||(t[14]=(...y)=>e.debouncedQueryChange&&e.debouncedQueryChange(...y))},null,46,f4t)),[[a.vModelText,e.query]]):a.createCommentVNode("v-if",!0)],6)):a.createCommentVNode("v-if",!0),e.isIOS&&!e.multiple&&e.filterable&&e.readonly?(a.openBlock(),a.createElementBlock("input",{key:1,ref:"iOSInput",class:a.normalizeClass(e.iOSInputKls),disabled:e.selectDisabled,type:"text"},null,10,m4t)):a.createCommentVNode("v-if",!0),a.createVNode(u,{id:e.id,ref:"reference",modelValue:e.selectedLabel,"onUpdate:modelValue":t[16]||(t[16]=y=>e.selectedLabel=y),type:"text",placeholder:typeof e.currentPlaceholder=="function"?e.currentPlaceholder():e.currentPlaceholder,name:e.name,autocomplete:e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,class:a.normalizeClass([e.nsSelect.is("focus",e.visible)]),tabindex:e.multiple&&e.filterable?-1:void 0,role:"combobox","aria-activedescendant":((T=e.hoverOption)==null?void 0:T.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropMenuVisible,label:e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:e.handleFocus,onBlur:e.handleBlur,onInput:e.debouncedOnInputChange,onPaste:e.debouncedOnInputChange,onCompositionstart:e.handleComposition,onCompositionupdate:e.handleComposition,onCompositionend:e.handleComposition,onKeydown:[t[17]||(t[17]=a.withKeys(a.withModifiers(y=>e.navigateOptions("next"),["stop","prevent"]),["down"])),t[18]||(t[18]=a.withKeys(a.withModifiers(y=>e.navigateOptions("prev"),["stop","prevent"]),["up"])),a.withKeys(a.withModifiers(e.selectOption,["stop","prevent"]),["enter"]),a.withKeys(e.handleKeydownEscape,["esc"]),t[19]||(t[19]=a.withKeys(y=>e.visible=!1,["tab"]))]},a.createSlots({suffix:a.withCtx(()=>[e.iconComponent&&!e.showClose?(a.openBlock(),a.createBlock(c,{key:0,class:a.normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),e.showClose&&e.clearIcon?(a.openBlock(),a.createBlock(c,{key:1,class:a.normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon")]),onClick:e.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)]),_:2},[e.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.createElementVNode("div",g4t,[a.renderSlot(e.$slots,"prefix")])])}:void 0]),1032,["id","modelValue","placeholder","name","autocomplete","size","disabled","readonly","class","tabindex","aria-activedescendant","aria-controls","aria-expanded","label","onFocus","onBlur","onInput","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown"])],32)]}),content:a.withCtx(()=>[a.createVNode(f,null,a.createSlots({default:a.withCtx(()=>[a.withDirectives(a.createVNode(h,{id:e.contentId,ref:"scrollbar",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:a.normalizeClass(e.scrollbarKls),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[e.showNewOption?(a.openBlock(),a.createBlock(d,{key:0,value:e.query,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(p,{onUpdateOptions:e.onOptionsRendered},{default:a.withCtx(()=>[a.renderSlot(e.$slots,"default")]),_:3},8,["onUpdateOptions"])]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,e.options.size>0&&!e.loading]]),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&e.options.size===0)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[e.$slots.empty?a.renderSlot(e.$slots,"empty",{key:0}):(a.openBlock(),a.createElementBlock("p",{key:1,class:a.normalizeClass(e.nsSelect.be("dropdown","empty"))},a.toDisplayString(e.emptyText),3))],64)):a.createCommentVNode("v-if",!0)]),_:2},[e.$slots.header?{name:"header",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"header")])}:void 0,e.$slots.footer?{name:"footer",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"footer")])}:void 0]),1024)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","effect","transition","persistent","onShow"])],34)),[[m,e.handleClose,e.popperPaneRef]])}var T4t=hi(h4t,[["render",y4t],["__file","select.vue"]]);const v4t=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const t=li("select"),r=a.ref(!0),n=a.getCurrentInstance(),i=a.ref([]);a.provide(dde,a.reactive({...a.toRefs(e)}));const o=a.inject(TE);a.onMounted(()=>{i.value=s(n.subTree)});const s=c=>{const u=[];return Array.isArray(c.children)&&c.children.forEach(d=>{var p;d.type&&d.type.name==="ElOption"&&d.component&&d.component.proxy?u.push(d.component.proxy):(p=d.children)!=null&&p.length&&u.push(...s(d))}),u},{groupQueryChange:l}=a.toRaw(o);return a.watch(l,()=>{r.value=i.value.some(c=>c.visible===!0)},{flush:"post"}),{visible:r,ns:t}}});function Q4t(e,t,r,n,i,o){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{class:a.normalizeClass(e.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(e.ns.be("group","title"))},a.toDisplayString(e.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(e.ns.b("group"))},[a.renderSlot(e.$slots,"default")],2)])],2)),[[a.vShow,e.visible]])}var hde=hi(v4t,[["render",Q4t],["__file","option-group.vue"]]);const Qg=Jc(T4t,{Option:jU,OptionGroup:hde}),vE=Qu(jU);Qu(hde);const b4t=Lo({trigger:yx.trigger,placement:zU.placement,disabled:yx.disabled,visible:T2.visible,transition:T2.transition,popperOptions:zU.popperOptions,tabindex:zU.tabindex,content:T2.content,popperStyle:T2.popperStyle,popperClass:T2.popperClass,enterable:{...T2.enterable,default:!0},effect:{...T2.effect,default:"light"},teleported:T2.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),x4t={"update:visible":e=>ah(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},_4t="onUpdate:visible",w4t=a.defineComponent({name:"ElPopover"}),L4t=a.defineComponent({...w4t,props:b4t,emits:x4t,setup(e,{expose:t,emit:r}){const n=e,i=a.computed(()=>n[_4t]),o=li("popover"),s=a.ref(),l=a.computed(()=>{var T;return(T=a.unref(s))==null?void 0:T.popperRef}),c=a.computed(()=>[{width:ag(n.width)},n.popperStyle]),u=a.computed(()=>[o.b(),n.popperClass,{[o.m("plain")]:!!n.content}]),d=a.computed(()=>n.transition===`${o.namespace.value}-fade-in-linear`),p=()=>{var T;(T=s.value)==null||T.hide()},h=()=>{r("before-enter")},f=()=>{r("before-leave")},m=()=>{r("after-enter")},g=()=>{r("update:visible",!1),r("after-leave")};return t({popperRef:l,hide:p}),(T,y)=>(a.openBlock(),a.createBlock(a.unref(OU),a.mergeProps({ref_key:"tooltipRef",ref:s},T.$attrs,{trigger:T.trigger,placement:T.placement,disabled:T.disabled,visible:T.visible,transition:T.transition,"popper-options":T.popperOptions,tabindex:T.tabindex,content:T.content,offset:T.offset,"show-after":T.showAfter,"hide-after":T.hideAfter,"auto-close":T.autoClose,"show-arrow":T.showArrow,"aria-label":T.title,effect:T.effect,enterable:T.enterable,"popper-class":a.unref(u),"popper-style":a.unref(c),teleported:T.teleported,persistent:T.persistent,"gpu-acceleration":a.unref(d),"onUpdate:visible":a.unref(i),onBeforeShow:h,onBeforeHide:f,onShow:m,onHide:g}),{content:a.withCtx(()=>[T.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(o).e("title")),role:"title"},a.toDisplayString(T.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(T.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(T.content),1)])]),default:a.withCtx(()=>[T.$slots.reference?a.renderSlot(T.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var S4t=hi(L4t,[["__file","popover.vue"]]);const fde=(e,t)=>{const r=t.arg||t.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=e)};var k4t={mounted(e,t){fde(e,t)},updated(e,t){fde(e,t)}};const M4t="popover",mde=H1t(k4t,M4t),QE=Jc(S4t,{directive:mde}),bg="$treeNodeId",gde=function(e,t){!t||t[bg]||Object.defineProperty(t,bg,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},UU=function(e,t){return e?t[e]:t[bg]},GU=(e,t,r)=>{const n=e.value.currentNode;r();const i=e.value.currentNode;n!==i&&t("current-change",i?i.data:null,i)},qU=e=>{let t=!0,r=!0,n=!0;for(let i=0,o=e.length;i<o;i++){const s=e[i];(s.checked!==!0||s.indeterminate)&&(t=!1,s.disabled||(n=!1)),(s.checked!==!1||s.indeterminate)&&(r=!1)}return{all:t,none:r,allWithoutDisable:n,half:!t&&!r}},bE=function(e){if(e.childNodes.length===0||e.loading)return;const{all:t,none:r,half:n}=qU(e.childNodes);t?(e.checked=!0,e.indeterminate=!1):n?(e.checked=!1,e.indeterminate=!0):r&&(e.checked=!1,e.indeterminate=!1);const i=e.parent;!i||i.level===0||e.store.checkStrictly||bE(i)},xE=function(e,t){const r=e.store.props,n=e.data||{},i=r[t];if(typeof i=="function")return i(n,e);if(typeof i=="string")return n[i];if(typeof i>"u"){const o=n[t];return o===void 0?"":o}};let C4t=0,WU=class Mz{constructor(t){this.id=C4t++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in t)x8(t,r)&&(this[r]=t[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const t=this.store;if(!t)throw new Error("[Node]store is required!");t.registerNode(this);const r=t.props;if(r&&typeof r.isLeaf<"u"){const o=xE(this,"isLeaf");typeof o=="boolean"&&(this.isLeafByUser=o)}if(t.lazy!==!0&&this.data?(this.setData(this.data),t.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&t.lazy&&t.defaultExpandAll&&this.expand(),Array.isArray(this.data)||gde(this,this.data),!this.data)return;const n=t.defaultExpandedKeys,i=t.key;i&&n&&n.includes(this.key)&&this.expand(null,t.autoExpandParent),i&&t.currentNodeKey!==void 0&&this.key===t.currentNodeKey&&(t.currentNode=this,t.currentNode.isCurrent=!0),t.lazy&&t._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(t){Array.isArray(t)||gde(this,t),this.data=t,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=xE(this,"children")||[];for(let n=0,i=r.length;n<i;n++)this.insertChild({data:r[n]})}get label(){return xE(this,"label")}get key(){const t=this.store.key;return this.data?this.data[t]:null}get disabled(){return xE(this,"disabled")}get nextSibling(){const t=this.parent;if(t){const r=t.childNodes.indexOf(this);if(r>-1)return t.childNodes[r+1]}return null}get previousSibling(){const t=this.parent;if(t){const r=t.childNodes.indexOf(this);if(r>-1)return r>0?t.childNodes[r-1]:null}return null}contains(t,r=!0){return(this.childNodes||[]).some(n=>n===t||r&&n.contains(t))}remove(){const t=this.parent;t&&t.removeChild(this)}insertChild(t,r,n){if(!t)throw new Error("InsertChild error: child is required.");if(!(t instanceof Mz)){if(!n){const i=this.getChildren(!0);i.includes(t.data)||(typeof r>"u"||r<0?i.push(t.data):i.splice(r,0,t.data))}Object.assign(t,{parent:this,store:this.store}),t=a.reactive(new Mz(t)),t instanceof Mz&&t.initialize()}t.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),this.updateLeafState()}insertBefore(t,r){let n;r&&(n=this.childNodes.indexOf(r)),this.insertChild(t,n)}insertAfter(t,r){let n;r&&(n=this.childNodes.indexOf(r),n!==-1&&(n+=1)),this.insertChild(t,n)}removeChild(t){const r=this.getChildren()||[],n=r.indexOf(t.data);n>-1&&r.splice(n,1);const i=this.childNodes.indexOf(t);i>-1&&(this.store&&this.store.deregisterNode(t),t.parent=null,this.childNodes.splice(i,1)),this.updateLeafState()}removeChildByData(t){let r=null;for(let n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===t){r=this.childNodes[n];break}r&&this.removeChild(r)}expand(t,r){const n=()=>{if(r){let i=this.parent;for(;i.level>0;)i.expanded=!0,i=i.parent}this.expanded=!0,t&&t(),this.childNodes.forEach(i=>{i.canFocus=!0})};this.shouldLoadData()?this.loadData(i=>{Array.isArray(i)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||bE(this),n())}):n()}doCreateChildren(t,r={}){t.forEach(n=>{this.insertChild(Object.assign({data:n},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(t=>{t.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const t=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!t||t.length===0;return}this.isLeaf=!1}setChecked(t,r,n,i){if(this.indeterminate=t==="half",this.checked=t===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:s,allWithoutDisable:l}=qU(this.childNodes);!this.isLeaf&&!s&&l&&(this.checked=!1,t=!1);const c=()=>{if(r){const u=this.childNodes;for(let h=0,f=u.length;h<f;h++){const m=u[h];i=i||t!==!1;const g=m.disabled?m.checked:i;m.setChecked(g,r,!0,i)}const{half:d,all:p}=qU(u);p||(this.checked=p,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),bE(this)},{checked:t!==!1});return}else c()}const o=this.parent;!o||o.level===0||n||bE(o)}getChildren(t=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const n=this.store.props;let i="children";return n&&(i=n.children||"children"),r[i]===void 0&&(r[i]=null),t&&!r[i]&&(r[i]=[]),r[i]}updateChildren(){const t=this.getChildren()||[],r=this.childNodes.map(o=>o.data),n={},i=[];t.forEach((o,s)=>{const l=o[bg];l&&r.findIndex(c=>c[bg]===l)>=0?n[l]={index:s,data:o}:i.push({index:s,data:o})}),this.store.lazy||r.forEach(o=>{n[o[bg]]||this.removeChildByData(o)}),i.forEach(({index:o,data:s})=>{this.insertChild({data:s},o)}),this.updateLeafState()}loadData(t,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const n=i=>{this.childNodes=[],this.doCreateChildren(i,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),t&&t.call(this,i)};this.store.load(this,n)}else t&&t.call(this)}},E4t=class{constructor(t){this.currentNode=null,this.currentNodeKey=null;for(const r in t)x8(t,r)&&(this[r]=t[r]);this.nodesMap={}}initialize(){if(this.root=new WU({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const t=this.load;t(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(t){const r=this.filterNodeMethod,n=this.lazy,i=function(o){const s=o.root?o.root.childNodes:o.childNodes;if(s.forEach(l=>{l.visible=r.call(l,t,l.data,l),i(l)}),!o.visible&&s.length){let l=!0;l=!s.some(c=>c.visible),o.root?o.root.visible=l===!1:o.visible=l===!1}t&&o.visible&&!o.isLeaf&&!n&&o.expand()};i(this)}setData(t){t!==this.root.data?(this.root.setData(t),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(t){if(t instanceof WU)return t;const r=Sc(t)?UU(this.key,t):t;return this.nodesMap[r]||null}insertBefore(t,r){const n=this.getNode(r);n.parent.insertBefore({data:t},n)}insertAfter(t,r){const n=this.getNode(r);n.parent.insertAfter({data:t},n)}remove(t){const r=this.getNode(t);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(t,r){const n=r?this.getNode(r):this.root;n&&n.insertChild({data:t})}_initDefaultCheckedNodes(){const t=this.defaultCheckedKeys||[],r=this.nodesMap;t.forEach(n=>{const i=r[n];i&&i.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(t){(this.defaultCheckedKeys||[]).includes(t.key)&&t.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(t){t!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=t,this._initDefaultCheckedNodes())}registerNode(t){const r=this.key;!t||!t.data||(r?t.key!==void 0&&(this.nodesMap[t.key]=t):this.nodesMap[t.id]=t)}deregisterNode(t){!this.key||!t||!t.data||(t.childNodes.forEach(r=>{this.deregisterNode(r)}),delete this.nodesMap[t.key])}getCheckedNodes(t=!1,r=!1){const n=[],i=function(o){(o.root?o.root.childNodes:o.childNodes).forEach(s=>{(s.checked||r&&s.indeterminate)&&(!t||t&&s.isLeaf)&&n.push(s.data),i(s)})};return i(this),n}getCheckedKeys(t=!1){return this.getCheckedNodes(t).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const t=[],r=function(n){(n.root?n.root.childNodes:n.childNodes).forEach(i=>{i.indeterminate&&t.push(i.data),r(i)})};return r(this),t}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(t=>(t||{})[this.key])}_getAllNodes(){const t=[],r=this.nodesMap;for(const n in r)x8(r,n)&&t.push(r[n]);return t}updateChildren(t,r){const n=this.nodesMap[t];if(!n)return;const i=n.childNodes;for(let o=i.length-1;o>=0;o--){const s=i[o];this.remove(s.data)}for(let o=0,s=r.length;o<s;o++){const l=r[o];this.append(l,n.data)}}_setCheckedKeys(t,r=!1,n){const i=this._getAllNodes().sort((l,c)=>c.level-l.level),o=Object.create(null),s=Object.keys(n);i.forEach(l=>l.setChecked(!1,!1));for(let l=0,c=i.length;l<c;l++){const u=i[l],d=u.data[t].toString();if(!s.includes(d)){u.checked&&!o[d]&&u.setChecked(!1,!1);continue}let p=u.parent;for(;p&&p.level>0;)o[p.data[t]]=!0,p=p.parent;if(u.isLeaf||this.checkStrictly){u.setChecked(!0,!1);continue}if(u.setChecked(!0,!0),r){u.setChecked(!1,!1);const h=function(f){f.childNodes.forEach(m=>{m.isLeaf||m.setChecked(!1,!1),h(m)})};h(u)}}}setCheckedNodes(t,r=!1){const n=this.key,i={};t.forEach(o=>{i[(o||{})[n]]=!0}),this._setCheckedKeys(n,r,i)}setCheckedKeys(t,r=!1){this.defaultCheckedKeys=t;const n=this.key,i={};t.forEach(o=>{i[o]=!0}),this._setCheckedKeys(n,r,i)}setDefaultExpandedKeys(t){t=t||[],this.defaultExpandedKeys=t,t.forEach(r=>{const n=this.getNode(r);n&&n.expand(null,this.autoExpandParent)})}setChecked(t,r,n){const i=this.getNode(t);i&&i.setChecked(!!r,n)}getCurrentNode(){return this.currentNode}setCurrentNode(t){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=t,this.currentNode.isCurrent=!0}setUserCurrentNode(t,r=!0){const n=t[this.key],i=this.nodesMap[n];this.setCurrentNode(i),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(t,r=!0){if(t==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const n=this.getNode(t);n&&(this.setCurrentNode(n),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}};const A4t=a.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=li("tree"),r=a.inject("NodeInstance"),n=a.inject("RootTree");return()=>{const i=e.node,{data:o,store:s}=i;return e.renderContent?e.renderContent(a.h,{_self:r,node:i,data:o,store:s}):a.renderSlot(n.ctx.slots,"default",{node:i,data:o},()=>[a.h("span",{class:t.be("node","label")},[i.label])])}}});var O4t=hi(A4t,[["__file","tree-node-content.vue"]]);function yde(e){const t=a.inject("TreeNodeMap",null),r={treeNodeExpand:n=>{e.node!==n&&e.node.collapse()},children:[]};return t&&t.children.push(r),a.provide("TreeNodeMap",r),{broadcastExpanded:n=>{if(e.accordion)for(const i of r.children)i.treeNodeExpand(n)}}}const Tde=Symbol("dragEvents");function H4t({props:e,ctx:t,el$:r,dropIndicator$:n,store:i}){const o=li("tree"),s=a.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null});return a.provide(Tde,{treeNodeDragStart:({event:l,treeNode:c})=>{if(typeof e.allowDrag=="function"&&!e.allowDrag(c.node))return l.preventDefault(),!1;l.dataTransfer.effectAllowed="move";try{l.dataTransfer.setData("text/plain","")}catch{}s.value.draggingNode=c,t.emit("node-drag-start",c.node,l)},treeNodeDragOver:({event:l,treeNode:c})=>{const u=c,d=s.value.dropNode;d&&d.node.id!==u.node.id&&k8(d.$el,o.is("drop-inner"));const p=s.value.draggingNode;if(!p||!u)return;let h=!0,f=!0,m=!0,g=!0;typeof e.allowDrop=="function"&&(h=e.allowDrop(p.node,u.node,"prev"),g=f=e.allowDrop(p.node,u.node,"inner"),m=e.allowDrop(p.node,u.node,"next")),l.dataTransfer.dropEffect=f||h||m?"move":"none",(h||f||m)&&(d==null?void 0:d.node.id)!==u.node.id&&(d&&t.emit("node-drag-leave",p.node,d.node,l),t.emit("node-drag-enter",p.node,u.node,l)),(h||f||m)&&(s.value.dropNode=u),u.node.nextSibling===p.node&&(m=!1),u.node.previousSibling===p.node&&(h=!1),u.node.contains(p.node,!1)&&(f=!1),(p.node===u.node||p.node.contains(u.node))&&(h=!1,f=!1,m=!1);const T=u.$el.querySelector(`.${o.be("node","content")}`).getBoundingClientRect(),y=r.value.getBoundingClientRect();let v;const _=h?f?.25:m?.45:1:-1,b=m?f?.75:h?.55:0:1;let L=-9999;const w=l.clientY-T.top;w<T.height*_?v="before":w>T.height*b?v="after":f?v="inner":v="none";const k=u.$el.querySelector(`.${o.be("node","expand-icon")}`).getBoundingClientRect(),C=n.value;v==="before"?L=k.top-y.top:v==="after"&&(L=k.bottom-y.top),C.style.top=`${L}px`,C.style.left=`${k.right-y.left}px`,v==="inner"?sU(u.$el,o.is("drop-inner")):k8(u.$el,o.is("drop-inner")),s.value.showDropIndicator=v==="before"||v==="after",s.value.allowDrop=s.value.showDropIndicator||g,s.value.dropType=v,t.emit("node-drag-over",p.node,u.node,l)},treeNodeDragEnd:l=>{const{draggingNode:c,dropType:u,dropNode:d}=s.value;if(l.preventDefault(),l.dataTransfer.dropEffect="move",c&&d){const p={data:c.node.data};u!=="none"&&c.node.remove(),u==="before"?d.node.parent.insertBefore(p,d.node):u==="after"?d.node.parent.insertAfter(p,d.node):u==="inner"&&d.node.insertChild(p),u!=="none"&&i.value.registerNode(p),k8(d.$el,o.is("drop-inner")),t.emit("node-drag-end",c.node,d.node,u,l),u!=="none"&&t.emit("node-drop",c.node,d.node,u,l)}c&&!d&&t.emit("node-drag-end",c.node,null,u,l),s.value.showDropIndicator=!1,s.value.draggingNode=null,s.value.dropNode=null,s.value.allowDrop=!0}}),{dragState:s}}const V4t=a.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:adt,ElCheckbox:mE,NodeContent:O4t,ElIcon:ql,Loading:cU},props:{node:{type:WU,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,t){const r=li("tree"),{broadcastExpanded:n}=yde(e),i=a.inject("RootTree"),o=a.ref(!1),s=a.ref(!1),l=a.ref(null),c=a.ref(null),u=a.ref(null),d=a.inject(Tde),p=a.getCurrentInstance();a.provide("NodeInstance",p),i||$s("Tree","Can not find node's tree."),e.node.expanded&&(o.value=!0,s.value=!0);const h=i.props.props.children||"children";a.watch(()=>{const b=e.node.data[h];return b&&[...b]},()=>{e.node.updateChildren()}),a.watch(()=>e.node.indeterminate,b=>{g(e.node.checked,b)}),a.watch(()=>e.node.checked,b=>{g(b,e.node.indeterminate)}),a.watch(()=>e.node.expanded,b=>{a.nextTick(()=>o.value=b),b&&(s.value=!0)});const f=b=>UU(i.props.nodeKey,b.data),m=b=>{const L=e.props.class;if(!L)return{};let w;if(g2(L)){const{data:k}=b;w=L(k,b)}else w=L;return Js(w)?{[w]:!0}:w},g=(b,L)=>{(l.value!==b||c.value!==L)&&i.ctx.emit("check-change",e.node.data,b,L),l.value=b,c.value=L},T=b=>{GU(i.store,i.ctx.emit,()=>i.store.value.setCurrentNode(e.node)),i.currentNode.value=e.node,i.props.expandOnClickNode&&v(),i.props.checkOnClickNode&&!e.node.disabled&&_(null,{target:{checked:!e.node.checked}}),i.ctx.emit("node-click",e.node.data,e.node,p,b)},y=b=>{i.instance.vnode.props.onNodeContextmenu&&(b.stopPropagation(),b.preventDefault()),i.ctx.emit("node-contextmenu",b,e.node.data,e.node,p)},v=()=>{e.node.isLeaf||(o.value?(i.ctx.emit("node-collapse",e.node.data,e.node,p),e.node.collapse()):(e.node.expand(),t.emit("node-expand",e.node.data,e.node,p)))},_=(b,L)=>{e.node.setChecked(L.target.checked,!i.props.checkStrictly),a.nextTick(()=>{const w=i.store.value;i.ctx.emit("check",e.node.data,{checkedNodes:w.getCheckedNodes(),checkedKeys:w.getCheckedKeys(),halfCheckedNodes:w.getHalfCheckedNodes(),halfCheckedKeys:w.getHalfCheckedKeys()})})};return{ns:r,node$:u,tree:i,expanded:o,childNodeRendered:s,oldChecked:l,oldIndeterminate:c,getNodeKey:f,getNodeClass:m,handleSelectChange:g,handleClick:T,handleContextMenu:y,handleExpandIconClick:v,handleCheckChange:_,handleChildNodeExpand:(b,L,w)=>{n(L),i.ctx.emit("node-expand",b,L,w)},handleDragStart:b=>{i.props.draggable&&d.treeNodeDragStart({event:b,treeNode:e})},handleDragOver:b=>{b.preventDefault(),i.props.draggable&&d.treeNodeDragOver({event:b,treeNode:{$el:u.value,node:e.node}})},handleDrop:b=>{b.preventDefault()},handleDragEnd:b=>{i.props.draggable&&d.treeNodeDragEnd(b)},CaretRight:y1t}}}),I4t=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],P4t=["aria-expanded"];function N4t(e,t,r,n,i,o){const s=a.resolveComponent("el-icon"),l=a.resolveComponent("el-checkbox"),c=a.resolveComponent("loading"),u=a.resolveComponent("node-content"),d=a.resolveComponent("el-tree-node"),p=a.resolveComponent("el-collapse-transition");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"node$",class:a.normalizeClass([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[1]||(t[1]=a.withModifiers((...h)=>e.handleClick&&e.handleClick(...h),["stop"])),onContextmenu:t[2]||(t[2]=(...h)=>e.handleContextMenu&&e.handleContextMenu(...h)),onDragstart:t[3]||(t[3]=a.withModifiers((...h)=>e.handleDragStart&&e.handleDragStart(...h),["stop"])),onDragover:t[4]||(t[4]=a.withModifiers((...h)=>e.handleDragOver&&e.handleDragOver(...h),["stop"])),onDragend:t[5]||(t[5]=a.withModifiers((...h)=>e.handleDragEnd&&e.handleDragEnd(...h),["stop"])),onDrop:t[6]||(t[6]=a.withModifiers((...h)=>e.handleDrop&&e.handleDrop(...h),["stop"]))},[a.createElementVNode("div",{class:a.normalizeClass(e.ns.be("node","content")),style:a.normalizeStyle({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?(a.openBlock(),a.createBlock(s,{key:0,class:a.normalizeClass([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:a.withModifiers(e.handleExpandIconClick,["stop"])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.tree.props.icon||e.CaretRight)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),e.showCheckbox?(a.openBlock(),a.createBlock(l,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=a.withModifiers(()=>{},["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):a.createCommentVNode("v-if",!0),e.node.loading?(a.openBlock(),a.createBlock(s,{key:2,class:a.normalizeClass([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:a.withCtx(()=>[a.createVNode(c)]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.createVNode(u,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),a.createVNode(p,null,{default:a.withCtx(()=>[!e.renderAfterExpand||e.childNodeRendered?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.node.childNodes,h=>(a.openBlock(),a.createBlock(d,{key:e.getNodeKey(h),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:h,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,P4t)),[[a.vShow,e.expanded]]):a.createCommentVNode("v-if",!0)]),_:1})],42,I4t)),[[a.vShow,e.node.visible]])}var B4t=hi(V4t,[["render",N4t],["__file","tree-node.vue"]]);function R4t({el$:e},t){const r=li("tree"),n=a.shallowRef([]),i=a.shallowRef([]);a.onMounted(()=>{o()}),a.onUpdated(()=>{n.value=Array.from(e.value.querySelectorAll("[role=treeitem]")),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"))}),a.watch(i,s=>{s.forEach(l=>{l.setAttribute("tabindex","-1")})}),nh(e,"keydown",s=>{const l=s.target;if(!l.className.includes(r.b("node")))return;const c=s.code;n.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const u=n.value.indexOf(l);let d;if([kc.up,kc.down].includes(c)){if(s.preventDefault(),c===kc.up){d=u===-1?0:u!==0?u-1:n.value.length-1;const h=d;for(;!t.value.getNode(n.value[d].dataset.key).canFocus;){if(d--,d===h){d=-1;break}d<0&&(d=n.value.length-1)}}else{d=u===-1?0:u<n.value.length-1?u+1:0;const h=d;for(;!t.value.getNode(n.value[d].dataset.key).canFocus;){if(d++,d===h){d=-1;break}d>=n.value.length&&(d=0)}}d!==-1&&n.value[d].focus()}[kc.left,kc.right].includes(c)&&(s.preventDefault(),l.click());const p=l.querySelector('[type="checkbox"]');[kc.enter,kc.space].includes(c)&&p&&(s.preventDefault(),p.click())});const o=()=>{var s;n.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"));const l=e.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(l.length){l[0].setAttribute("tabindex","0");return}(s=n.value[0])==null||s.setAttribute("tabindex","0")}}const F4t=a.defineComponent({name:"ElTree",components:{ElTreeNode:B4t},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:lh}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,t){const{t:r}=lg(),n=li("tree"),i=a.ref(new E4t({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));i.value.initialize();const o=a.ref(i.value.root),s=a.ref(null),l=a.ref(null),c=a.ref(null),{broadcastExpanded:u}=yde(e),{dragState:d}=H4t({props:e,ctx:t,el$:l,dropIndicator$:c,store:i});R4t({el$:l},i);const p=a.computed(()=>{const{childNodes:P}=o.value;return!P||P.length===0||P.every(({visible:W})=>!W)});a.watch(()=>e.currentNodeKey,P=>{i.value.setCurrentNodeKey(P)}),a.watch(()=>e.defaultCheckedKeys,P=>{i.value.setDefaultCheckedKey(P)}),a.watch(()=>e.defaultExpandedKeys,P=>{i.value.setDefaultExpandedKeys(P)}),a.watch(()=>e.data,P=>{i.value.setData(P)},{deep:!0}),a.watch(()=>e.checkStrictly,P=>{i.value.checkStrictly=P});const h=P=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(P)},f=P=>UU(e.nodeKey,P.data),m=P=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const W=i.value.getNode(P);if(!W)return[];const K=[W.data];let U=W.parent;for(;U&&U!==o.value;)K.push(U.data),U=U.parent;return K.reverse()},g=(P,W)=>i.value.getCheckedNodes(P,W),T=P=>i.value.getCheckedKeys(P),y=()=>{const P=i.value.getCurrentNode();return P?P.data:null},v=()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const P=y();return P?P[e.nodeKey]:null},_=(P,W)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(P,W)},b=(P,W)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(P,W)},L=(P,W,K)=>{i.value.setChecked(P,W,K)},w=()=>i.value.getHalfCheckedNodes(),k=()=>i.value.getHalfCheckedKeys(),C=(P,W=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");GU(i,t.emit,()=>i.value.setUserCurrentNode(P,W))},A=(P,W=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");GU(i,t.emit,()=>i.value.setCurrentNodeKey(P,W))},O=P=>i.value.getNode(P),N=P=>{i.value.remove(P)},I=(P,W)=>{i.value.append(P,W)},R=(P,W)=>{i.value.insertBefore(P,W)},D=(P,W)=>{i.value.insertAfter(P,W)},j=(P,W,K)=>{u(W),t.emit("node-expand",P,W,K)},G=(P,W)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(P,W)};return a.provide("RootTree",{ctx:t,props:e,store:i,root:o,currentNode:s,instance:a.getCurrentInstance()}),a.provide(mx,void 0),{ns:n,store:i,root:o,currentNode:s,dragState:d,el$:l,dropIndicator$:c,isEmpty:p,filter:h,getNodeKey:f,getNodePath:m,getCheckedNodes:g,getCheckedKeys:T,getCurrentNode:y,getCurrentKey:v,setCheckedNodes:_,setCheckedKeys:b,setChecked:L,getHalfCheckedNodes:w,getHalfCheckedKeys:k,setCurrentNode:C,setCurrentKey:A,t:r,getNode:O,remove:N,append:I,insertBefore:R,insertAfter:D,handleNodeExpand:j,updateKeyChildren:G}}});function D4t(e,t,r,n,i,o){const s=a.resolveComponent("el-tree-node");return a.openBlock(),a.createElementBlock("div",{ref:"el$",class:a.normalizeClass([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner",e.dragState.dropType==="inner"),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.root.childNodes,l=>(a.openBlock(),a.createBlock(s,{key:e.getNodeKey(l),node:l,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),e.isEmpty?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(e.ns.e("empty-block"))},[a.renderSlot(e.$slots,"empty",{},()=>{var l;return[a.createElementVNode("span",{class:a.normalizeClass(e.ns.e("empty-text"))},a.toDisplayString((l=e.emptyText)!=null?l:e.t("el.tree.emptyText")),3)]})],2)):a.createCommentVNode("v-if",!0),a.withDirectives(a.createElementVNode("div",{ref:"dropIndicator$",class:a.normalizeClass(e.ns.e("drop-indicator"))},null,2),[[a.vShow,e.dragState.showDropIndicator]])],2)}var _E=hi(F4t,[["render",D4t],["__file","tree.vue"]]);_E.install=e=>{e.component(_E.name,_E)};const z4t=_E,vde=z4t;function j4t(e){let t;const r=a.ref(!1),n=a.reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function i(h){n.text=h}function o(){const h=n.parent,f=p.ns;if(!h.vLoadingAddClassList){let m=h.getAttribute("loading-number");m=Number.parseInt(m)-1,m?h.setAttribute("loading-number",m.toString()):(k8(h,f.bm("parent","relative")),h.removeAttribute("loading-number")),k8(h,f.bm("parent","hidden"))}s(),d.unmount()}function s(){var h,f;(f=(h=p.$el)==null?void 0:h.parentNode)==null||f.removeChild(p.$el)}function l(){var h;e.beforeClose&&!e.beforeClose()||(r.value=!0,clearTimeout(t),t=window.setTimeout(c,400),n.visible=!1,(h=e.closed)==null||h.call(e))}function c(){if(!r.value)return;const h=n.parent;r.value=!1,h.vLoadingAddClassList=void 0,o()}const u=a.defineComponent({name:"ElLoading",setup(h,{expose:f}){const{ns:m,zIndex:g}=l0t("loading");return f({ns:m,zIndex:g}),()=>{const T=n.spinner||n.svg,y=a.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...T?{innerHTML:T}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),v=n.text?a.h("p",{class:m.b("text")},[n.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:c},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:n.background||""},class:[m.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[y,v])]),[[a.vShow,n.visible]])])})}}}),d=a.createApp(u),p=d.mount(document.createElement("div"));return{...a.toRefs(n),setText:i,removeElLoadingChild:s,close:l,handleAfterLeave:c,vm:p,get $el(){return p.$el}}}let wE;const ZU=function(e={}){if(!Xs)return;const t=U4t(e);if(t.fullscreen&&wE)return wE;const r=j4t({...t,closed:()=>{var i;(i=t.closed)==null||i.call(t),t.fullscreen&&(wE=void 0)}});G4t(t,t.parent,r),Qde(t,t.parent,r),t.parent.vLoadingAddClassList=()=>Qde(t,t.parent,r);let n=t.parent.getAttribute("loading-number");return n?n=`${Number.parseInt(n)+1}`:n="1",t.parent.setAttribute("loading-number",n),t.parent.appendChild(r.$el),a.nextTick(()=>r.visible.value=t.visible),t.fullscreen&&(wE=r),r},U4t=e=>{var t,r,n,i;let o;return Js(e.target)?o=(t=document.querySelector(e.target))!=null?t:document.body:o=e.target||document.body,{parent:o===document.body||e.body?document.body:o,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:o===document.body&&((r=e.fullscreen)!=null?r:!0),lock:(n=e.lock)!=null?n:!1,customClass:e.customClass||"",visible:(i=e.visible)!=null?i:!0,target:o}},G4t=async(e,t,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,i={};if(e.fullscreen)r.originalPosition.value=ox(document.body,"position"),r.originalOverflow.value=ox(document.body,"overflow"),i.zIndex=n();else if(e.parent===document.body){r.originalPosition.value=ox(document.body,"position"),await a.nextTick();for(const o of["top","left"]){const s=o==="top"?"scrollTop":"scrollLeft";i[o]=`${e.target.getBoundingClientRect()[o]+document.body[s]+document.documentElement[s]-Number.parseInt(ox(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])i[o]=`${e.target.getBoundingClientRect()[o]}px`}else r.originalPosition.value=ox(t,"position");for(const[o,s]of Object.entries(i))r.$el.style[o]=s},Qde=(e,t,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?k8(t,n.bm("parent","relative")):sU(t,n.bm("parent","relative")),e.fullscreen&&e.lock?sU(t,n.bm("parent","hidden")):k8(t,n.bm("parent","hidden"))},KU=Symbol("ElLoading"),bde=(e,t)=>{var r,n,i,o;const s=t.instance,l=h=>Sc(t.value)?t.value[h]:void 0,c=h=>{const f=Js(h)&&(s==null?void 0:s[h])||h;return f&&a.ref(f)},u=h=>c(l(h)||e.getAttribute(`element-loading-${uat(h)}`)),d=(r=l("fullscreen"))!=null?r:t.modifiers.fullscreen,p={text:u("text"),svg:u("svg"),svgViewBox:u("svgViewBox"),spinner:u("spinner"),background:u("background"),customClass:u("customClass"),fullscreen:d,target:(n=l("target"))!=null?n:d?void 0:e,body:(i=l("body"))!=null?i:t.modifiers.body,lock:(o=l("lock"))!=null?o:t.modifiers.lock};e[KU]={options:p,instance:ZU(p)}},q4t=(e,t)=>{for(const r of Object.keys(t))a.isRef(t[r])&&(t[r].value=e[r])},LE={mounted(e,t){t.value&&bde(e,t)},updated(e,t){const r=e[KU];t.oldValue!==t.value&&(t.value&&!t.oldValue?bde(e,t):t.value&&t.oldValue?Sc(t.value)&&q4t(t.value,r.options):r==null||r.instance.close())},unmounted(e){var t;(t=e[KU])==null||t.instance.close()}},W4t={install(e){e.directive("loading",LE),e.config.globalProperties.$loading=ZU},directive:LE,service:ZU},R4=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},Z4t={name:"ExternalResourceCard",components:{Button:j3},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:a.shallowRef(k1t)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){window.open(e,"_blank")}}},K4t={class:"resource-container"};function X4t(e,t,r,n,i,o){const s=j3;return a.openBlock(),a.createElementBlock("div",K4t,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.resources,l=>(a.openBlock(),a.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(a.openBlock(),a.createBlock(s,{key:0,class:"button",icon:e.ElIconNotebook,onClick:c=>o.openUrl(l.url)},{default:a.withCtx(()=>[a.createTextVNode(" Open publications in pubmed ")]),_:2},1032,["icon","onClick"])):a.createCommentVNode("",!0)]))),128))])}const xde=R4(Z4t,[["render",X4t],["__scopeId","data-v-e3aa8e1a"]]);function J4t(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(i){i(r)}),(n=e.get("*"))&&n.slice().map(function(i){i(t,r)})}}}const SE=new J4t,Y4t=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),$4t=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},ept={name:"ProvenancePopup",components:{Button:j3,Container:Zdt,Icon:ql,ExternalResourceCard:xde,ElIconArrowUp:YC,ElIconArrowDown:sh,ElIconWarning:Lue},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},computed:{resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Observed in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return Y4t(e)},capitalise:function(e){return $4t(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){SE.emit("onActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name)})},openAxons:function(){SE.emit("onActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name)})},openDendrites:function(){SE.emit("onActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name)})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e}}},bx=e=>(a.pushScopeId("data-v-822227e4"),e=e(),a.popScopeId(),e),tpt={key:0,class:"main"},rpt={key:0,class:"block"},npt={class:"title"},ipt={key:0,class:"subtitle"},opt={key:1,class:"block"},apt={class:"title"},spt={class:"content-container scrollbar"},lpt={key:0,class:"block"},cpt=bx(()=>a.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),upt={style:{"word-break":"keep-all"}},dpt=bx(()=>a.createElementVNode("i",null,"Origin",-1)),ppt={key:0,class:"seperator"},hpt={key:1,class:"block"},fpt=bx(()=>a.createElementVNode("div",{class:"attribute-title"},"Components",-1)),mpt={key:0,class:"seperator"},gpt={key:2,class:"block"},ypt=bx(()=>a.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),Tpt=bx(()=>a.createElementVNode("span",{style:{"word-break":"keep-all"}},[a.createElementVNode("i",null,"Destination"),a.createTextVNode(" is where the axons terminate ")],-1)),vpt={key:0,class:"seperator"};function Qpt(e,t,r,n,i,o){const s=YC,l=ql,c=sh,u=Lue,d=QE,p=j3,h=xde,f=LE;return r.entry?a.withDirectives((a.openBlock(),a.createElementBlock("div",tpt,[r.entry.title?(a.openBlock(),a.createElementBlock("div",rpt,[a.createElementVNode("span",npt,a.toDisplayString(o.capitalise(r.entry.title)),1),r.entry.provenanceTaxonomyLabel&&r.entry.provenanceTaxonomyLabel.length>0?(a.openBlock(),a.createElementBlock("div",ipt,a.toDisplayString(o.provSpeciesDescription),1)):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",opt,[a.createElementVNode("span",apt,a.toDisplayString(r.entry.featureId),1)])),a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[0]||(t[0]=m=>e.showDetails=!1)},[a.createTextVNode(" Hide path information "),a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(s)]),_:1})],512),[[a.vShow,e.showDetails]]),a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[1]||(t[1]=m=>e.showDetails=!0)},[a.createTextVNode(" Show path information "),a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1})],512),[[a.vShow,!e.showDetails]]),a.createVNode(a.Transition,{name:"slide-fade"},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",spt,[a.createTextVNode(a.toDisplayString(r.entry.paths)+" ",1),r.entry.origins&&r.entry.origins.length>0?(a.openBlock(),a.createElementBlock("div",lpt,[a.createElementVNode("div",null,[cpt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(l,{class:"info"},{default:a.withCtx(()=>[a.createVNode(u)]),_:1}),a.createElementVNode("span",upt,[dpt,a.createTextVNode(" "+a.toDisplayString(o.originDescription),1)])]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.origins,(m,g)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content",key:m},[a.createTextVNode(a.toDisplayString(o.capitalise(m))+" ",1),g!=r.entry.origins.length-1?(a.openBlock(),a.createElementBlock("div",ppt)):a.createCommentVNode("",!0)]))),128)),a.withDirectives(a.createVNode(p,{class:"button",onClick:o.openDendrites},{default:a.withCtx(()=>[a.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.originsWithDatasets&&r.entry.originsWithDatasets.length>0]])])):a.createCommentVNode("",!0),r.entry.components&&r.entry.components.length>0?(a.openBlock(),a.createElementBlock("div",hpt,[fpt,(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.components,(m,g)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content",key:m},[a.createTextVNode(a.toDisplayString(o.capitalise(m))+" ",1),g!=r.entry.components.length-1?(a.openBlock(),a.createElementBlock("div",mpt)):a.createCommentVNode("",!0)]))),128))])):a.createCommentVNode("",!0),r.entry.destinations&&r.entry.destinations.length>0?(a.openBlock(),a.createElementBlock("div",gpt,[a.createElementVNode("div",null,[ypt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(l,{class:"info"},{default:a.withCtx(()=>[a.createVNode(u)]),_:1}),Tpt]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.destinations,(m,g)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content",key:m},[a.createTextVNode(a.toDisplayString(o.capitalise(m))+" ",1),g!=r.entry.destinations.length-1?(a.openBlock(),a.createElementBlock("div",vpt)):a.createCommentVNode("",!0)]))),128)),a.withDirectives(a.createVNode(p,{class:"button",onClick:o.openAxons},{default:a.withCtx(()=>[a.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.destinationsWithDatasets&&r.entry.destinationsWithDatasets.length>0]])])):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(p,{class:"button",onClick:o.openAll},{default:a.withCtx(()=>[a.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.componentsWithDatasets&&r.entry.componentsWithDatasets.length>0]]),a.createVNode(h,{resources:o.resources},null,8,["resources"])],512),[[a.vShow,e.showDetails]])]),_:1})])),[[f,e.loading]]):a.createCommentVNode("",!0)}const _de=R4(ept,[["render",Qpt],["__scopeId","data-v-822227e4"]]);var wde={},kE={},Lde={exports:{}};/*! js-cookie v3.0.5 | MIT */(function(e,t){(function(r,n){e.exports=n()})(ae,function(){function r(s){for(var l=1;l<arguments.length;l++){var c=arguments[l];for(var u in c)s[u]=c[u]}return s}var n={read:function(s){return s[0]==='"'&&(s=s.slice(1,-1)),s.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(s){return encodeURIComponent(s).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function i(s,l){function c(d,p,h){if(!(typeof document>"u")){h=r({},l,h),typeof h.expires=="number"&&(h.expires=new Date(Date.now()+h.expires*864e5)),h.expires&&(h.expires=h.expires.toUTCString()),d=encodeURIComponent(d).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var f="";for(var m in h)h[m]&&(f+="; "+m,h[m]!==!0&&(f+="="+h[m].split(";")[0]));return document.cookie=d+"="+s.write(p,d)+f}}function u(d){if(!(typeof document>"u"||arguments.length&&!d)){for(var p=document.cookie?document.cookie.split("; "):[],h={},f=0;f<p.length;f++){var m=p[f].split("="),g=m.slice(1).join("=");try{var T=decodeURIComponent(m[0]);if(h[T]=s.read(g,T),d===T)break}catch{}}return d?h[d]:h}}return Object.create({set:c,get:u,remove:function(d,p){c(d,"",r({},p,{expires:-1}))},withAttributes:function(d){return i(this.converter,r({},this.attributes,d))},withConverter:function(d){return i(r({},this.converter,d),this.attributes)}},{attributes:{value:Object.freeze(l)},converter:{value:Object.freeze(s)}})}var o=i(n,{path:"/"});return o})})(Lde);var bpt=Lde.exports,G3=ae&&ae.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Hs=ae&&ae.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},xpt=ae&&ae.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gh,xx,Yc,q3,H8;Object.defineProperty(kE,"__esModule",{value:!0}),kE.AnnotationService=void 0;const ME=xpt(bpt),_pt=1e4;let wpt=class{constructor(t){gh.add(this),xx.set(this,void 0),Yc.set(this,null),q3.set(this,null),t.slice(-1)==="/"?G3(this,xx,t.slice(0,-1),"f"):G3(this,xx,t,"f")}get currentUser(){return Hs(this,q3,"f")}get currentError(){return Hs(this,Yc,"f")}async authenticate(){G3(this,Yc,null,"f"),G3(this,q3,null,"f");const t=await Hs(this,gh,"m",H8).call(this,"authenticate");return"error"in t?(ME.default.remove("annotation-key"),Promise.resolve(Hs(this,Yc,"f"))):(ME.default.set("annotation-key",t.session,{secure:!0,expires:1}),G3(this,q3,t.data,"f"),Promise.resolve(Hs(this,q3,"f")))}async unauthenticate(){G3(this,Yc,null,"f"),G3(this,q3,null,"f");const t=await Hs(this,gh,"m",H8).call(this,"unauthenticate");return"success"in t?Promise.resolve(t):Promise.resolve(Hs(this,Yc,"f"))}async annotatedItemIds(t){const r=await Hs(this,gh,"m",H8).call(this,"items/","GET",{resource:t});return"error"in r?Promise.resolve(Hs(this,Yc,"f")):Promise.resolve(r)}async itemAnnotations(t,r){const n=await Hs(this,gh,"m",H8).call(this,"annotations/","GET",{resource:t,item:r});return"error"in n?Promise.resolve(Hs(this,Yc,"f")):Promise.resolve(n)}async annotation(t){const r=await Hs(this,gh,"m",H8).call(this,"annotation/","GET",{annotation:t});return"error"in r?Promise.resolve(Hs(this,Yc,"f")):Promise.resolve(r)}async addAnnotation(t){if(Hs(this,q3,"f")&&Hs(this,q3,"f").canUpdate){const r=Object.assign({creator:Hs(this,q3,"f"),created:new Date().toISOString()},t),n=await Hs(this,gh,"m",H8).call(this,"annotation/","POST",{data:r});if(!("error"in n))return Promise.resolve(n);G3(this,Yc,n,"f")}else G3(this,Yc,{error:"user cannot add annotation"},"f");return Promise.resolve(Hs(this,Yc,"f"))}};kE.AnnotationService=wpt,xx=new WeakMap,Yc=new WeakMap,q3=new WeakMap,gh=new WeakSet,H8=async function(e,t="GET",r={}){let n=!0;const i=new AbortController;setTimeout(()=>{n&&(console.log("Annotation server timeout..."),i.abort())},_pt);const o={method:t,signal:i.signal};let s=`${Hs(this,xx,"f")}/${e}`;const l=ME.default.get("user-token")||"",c=ME.default.get("annotation-key")||"";if(t==="GET"){const d=[];for(const[p,h]of Object.entries(r))d.push(`${p}=${encodeURIComponent(JSON.stringify(h))}`);d.push(`key=${encodeURIComponent(l)}`),d.push(`session=${encodeURIComponent(c)}`),s+="?"+d.join("&"),o.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(t==="POST"){const d=Object.assign({key:l,session:c},r);o.body=JSON.stringify(d),o.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const u=await fetch(s,o);return n=!1,u.ok?Promise.resolve(await u.json()):(G3(this,Yc,{error:`${u.status} ${u.statusText}`},"f"),Promise.resolve(Hs(this,Yc,"f")))},function(e){var t=ae&&ae.__createBinding||(Object.create?function(n,i,o,s){s===void 0&&(s=o);var l=Object.getOwnPropertyDescriptor(i,o);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,s,l)}:function(n,i,o,s){s===void 0&&(s=o),n[s]=i[o]}),r=ae&&ae.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(kE,e)}(wde);const Lpt={name:"AnnotationTool",components:{Button:j3,Col:B4,Input:lE,Main:ude,Row:U3,Select:Qg,ElIconArrowUp:YC,ElIconArrowDown:sh,ElIconEdit:_ue,ElIconClose:ax},props:{annotationEntry:{type:Object}},inject:["flatmapAPI"],data:function(){return{displayPair:{"Feature ID":"featureId",Tooltip:"label",Models:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:["DOI:","PMID:"],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:""}},computed:{isEditable:function(){return this.annotationEntry.resourceId&&this.annotationEntry.featureId}},methods:{evidenceEntered:function(e){e&&(this.evidence.push(this.evidencePrefix+e),this.newEvidence="")},formatTime:function(e){const t={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(e).toLocaleDateString(void 0,t)},updatePrevSubmissions:function(){this.$annotator&&this.authenticated&&this.annotationEntry.resourceId&&this.annotationEntry.featureId&&this.$annotator.itemAnnotations(this.annotationEntry.resourceId,this.annotationEntry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)})},submit:function(){if((this.evidence.length>0||this.comment)&&this.annotationEntry.resourceId&&this.annotationEntry.featureId){const e=[];this.evidence.forEach(r=>{if(r.includes("DOI:")){const n=r.replace("DOI:","https://doi.org/");e.push(new URL(n))}else if(r.includes("PMID:")){const n=r.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(n))}});const t={resource:this.annotationEntry.resourceId,item:this.annotationEntry.featureId,evidence:e,comment:this.comment};this.$annotator.addAnnotation(t).then(()=>{this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"})}},removeEvidence:function(e){this.evidence.splice(e,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""}},watch:{annotationEntry:{handler:function(){this.resetSubmission(),this.updatePrevSubmissions()},immediate:!1,deep:!1}},mounted:function(){this.$annotator||(this.$annotator=new wde.AnnotationService(`${this.flatmapAPI}annotator`)),this.$annotator.authenticate().then(e=>{e.name&&e.email?(this.authenticated=!0,this.updatePrevSubmissions()):this.errorMessage=""})}},V8=e=>(a.pushScopeId("data-v-18380efb"),e=e(),a.popScopeId(),e),Spt={class:"block"},kpt=V8(()=>a.createElementVNode("span",{class:"title"},"Feature Annotations",-1)),Mpt=V8(()=>a.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),Cpt=V8(()=>a.createElementVNode("strong",null,"Evidence: ",-1)),Ept=["href"],Apt=V8(()=>a.createElementVNode("strong",null,"Comment: ",-1)),Opt=V8(()=>a.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),Hpt=V8(()=>a.createElementVNode("strong",null,"Evidvence:",-1)),Vpt=V8(()=>a.createElementVNode("strong",null,"Comment:",-1)),Ipt={class:"sub-title"};function Ppt(e,t,r,n,i,o){const s=U3,l=YC,c=ql,u=sh,d=_ue,p=B4,h=ax,f=vE,m=Qg,g=lE,T=j3,y=ude;return a.openBlock(),a.createBlock(y,{class:"main"},{default:a.withCtx(()=>[a.createElementVNode("div",Spt,[a.createVNode(s,{class:"info-field"},{default:a.withCtx(()=>[kpt]),_:1}),r.annotationEntry?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.displayPair,(v,_)=>a.withDirectives((a.openBlock(),a.createBlock(s,{class:"dialog-text",key:v},{default:a.withCtx(()=>[a.createElementVNode("strong",null,a.toDisplayString(_)+": ",1),a.createTextVNode(" "+a.toDisplayString(r.annotationEntry[v]),1)]),_:2},1024)),[[a.vShow,r.annotationEntry[v]]])),128)),e.prevSubs.length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[0]||(t[0]=v=>e.showSubmissions=!1)},[a.createTextVNode(" Hide previous submissions "),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1})],512),[[a.vShow,e.showSubmissions]]),a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[1]||(t[1]=v=>e.showSubmissions=!0)},[a.createTextVNode(" Show previous "+a.toDisplayString(e.prevSubs.length)+" submission(s) ",1),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(u)]),_:1})],512),[[a.vShow,!e.showSubmissions]]),e.showSubmissions?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(s,{class:"dialog-spacer"}),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[Mpt]),_:1}),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.prevSubs,(v,_)=>(a.openBlock(),a.createElementBlock("div",{class:"entry",key:_},[a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[a.createElementVNode("strong",null,a.toDisplayString(o.formatTime(v.created)),1),a.createTextVNode(" "+a.toDisplayString(v.creator.name),1)]),_:2},1024),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[Cpt,(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(v.evidence,b=>(a.openBlock(),a.createBlock(s,{key:b,class:"dialog-text"},{default:a.withCtx(()=>[a.createElementVNode("a",{href:b,target:"_blank"},a.toDisplayString(b),9,Ept)]),_:2},1024))),128))]),_:2},1024),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[Apt,a.createTextVNode(" "+a.toDisplayString(v.comment),1)]),_:2},1024)]))),128))],64)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0),e.authenticated?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[o.isEditable?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(s,{class:"dialog-spacer"}),e.editing?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[Opt]),_:1}),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[Hpt]),_:1}),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.evidence,(v,_)=>(a.openBlock(),a.createBlock(s,{key:v},{default:a.withCtx(()=>[a.createVNode(p,{span:20},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.evidence[_]),1)]),_:2},1024),a.createVNode(p,{span:4},{default:a.withCtx(()=>[a.createVNode(c,{class:"standard-icon"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),_:1})]),_:2},1024))),128)),a.createVNode(s,null,{default:a.withCtx(()=>[a.createVNode(g,{size:"mini",placeholder:"Enter",modelValue:e.newEvidence,"onUpdate:modelValue":t[3]||(t[3]=v=>e.newEvidence=v),onChange:t[4]||(t[4]=v=>o.evidenceEntered(v))},{prepend:a.withCtx(()=>[a.createVNode(m,{teleported:!1,modelValue:e.evidencePrefix,"onUpdate:modelValue":t[2]||(t[2]=v=>e.evidencePrefix=v),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.evidencePrefixes,v=>(a.openBlock(),a.createBlock(f,{key:v,label:v,value:v},{default:a.withCtx(()=>[a.createVNode(s,null,{default:a.withCtx(()=>[a.createVNode(p,{span:12},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(v),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1}),a.createVNode(s,null,{default:a.withCtx(()=>[Vpt]),_:1}),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[a.createVNode(g,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:e.comment,"onUpdate:modelValue":t[5]||(t[5]=v=>e.comment=v)},null,8,["modelValue"])]),_:1}),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[a.createVNode(T,{class:"button",type:"primary",plain:"",onClick:o.submit},{default:a.withCtx(()=>[a.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(a.openBlock(),a.createBlock(s,{key:0},{default:a.withCtx(()=>[a.createVNode(c,{class:"standard-icon"},{default:a.withCtx(()=>[a.createVNode(d)]),_:1})]),_:1})),e.errorMessage?(a.openBlock(),a.createBlock(s,{key:2,class:"dialog-text"},{default:a.withCtx(()=>[a.createElementVNode("strong",Ipt,a.toDisplayString(e.errorMessage),1)]),_:1})):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)])]),_:1})}const Sde=R4(Lpt,[["render",Ppt],["__scopeId","data-v-18380efb"]]),Npt={name:"Tooltip",components:{AnnotationTool:Sde,ProvenancePopup:_de},props:{entry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}}},Bpt={class:"tooltip-container"};function Rpt(e,t,r,n,i,o){const s=Sde,l=_de;return a.openBlock(),a.createElementBlock("div",Bpt,[r.annotationDisplay?(a.openBlock(),a.createBlock(s,{key:0,annotationEntry:r.annotationEntry},null,8,["annotationEntry"])):(a.openBlock(),a.createBlock(l,{key:1,entry:r.entry},null,8,["entry"]))])}const XU=R4(Npt,[["render",Rpt],["__scopeId","data-v-ab5392fa"]]),Fpt={name:"SelectionsGroup",components:{Checkbox:mE,CheckboxGroup:RU,Col:B4,Row:U3},methods:{reset:function(){this.checkAll=!0,this.checkedItems=[],this.selections.forEach(e=>{!("enabled"in e)||e.enabled===!0?this.checkedItems.push(e[this.identifierKey]):this.checkAll=!1})},visibilityToggle:function(e,t){this.$emit("changed",{key:e,value:t})},handleCheckedItemsChange:function(e){let t=e.length;this.checkAll=t===this.selections.length},handleCheckAllChange:function(e){this.checkedItems=e?this.selections.map(t=>t[this.identifierKey]):[],this.$emit("checkAll",{keys:this.selections.map(t=>t[this.identifierKey]),value:e})},getBackgroundStyles:function(e){return"colour"in e&&this.colourStyle==="background"?{background:e.colour}:{}},hasLineStyles:function(e){return"colour"in e&&this.colourStyle==="line"},getLineStyles:function(e){return"colour"in e&&this.colourStyle==="line"?"dashed"in e&&e.dashed===!0?{background:`repeating-linear-gradient(90deg,${e.colour},${e.colour} 6px,transparent 0,transparent 9px)`}:{background:e.colour}:{display:"None"}}},props:{colourStyle:{type:String,default:"line"},identifierKey:{type:String,default:"id"},labelKey:{type:String,default:"label"},title:{type:String,default:""},selections:{type:Array,default:function(){return[]}}},computed:{isIndeterminate:function(){return!(this.checkedItems.length===0||this.checkAll)}},data:function(){return{checkedItems:[],checkAll:!0}},mounted:function(){this.reset()}},Dpt={class:"selections-container"},zpt={class:"checkall-display-text"},jpt={class:"checkbox-group-inner"},Upt={class:"checkbox-container"};function Gpt(e,t,r,n,i,o){const s=B4,l=mE,c=U3,u=RU;return a.openBlock(),a.createElementBlock("div",Dpt,[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(s,{span:12},{default:a.withCtx(()=>[a.createElementVNode("div",zpt,a.toDisplayString(r.title),1)]),_:1}),a.createVNode(s,{span:12},{default:a.withCtx(()=>[r.selections&&r.selections.length>1?(a.openBlock(),a.createBlock(l,{key:0,class:"all-checkbox",indeterminate:o.isIndeterminate,modelValue:e.checkAll,"onUpdate:modelValue":t[0]||(t[0]=d=>e.checkAll=d),onChange:o.handleCheckAllChange},{default:a.withCtx(()=>[a.createTextVNode("Display all")]),_:1},8,["indeterminate","modelValue","onChange"])):a.createCommentVNode("",!0)]),_:1})]),_:1}),a.createVNode(u,{modelValue:e.checkedItems,"onUpdate:modelValue":t[1]||(t[1]=d=>e.checkedItems=d),size:"small",class:"checkbox-group",onChange:o.handleCheckedItemsChange},{default:a.withCtx(()=>[a.createElementVNode("div",jpt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.selections,d=>(a.openBlock(),a.createBlock(c,{key:d[r.identifierKey],label:d[r.identifierKey]},{default:a.withCtx(()=>[a.createElementVNode("div",Upt,[a.createVNode(l,{class:"my-checkbox",label:d[r.identifierKey],onChange:p=>o.visibilityToggle(d[r.identifierKey],p),checked:!("enabled"in d)||d.enabled===!0},{default:a.withCtx(()=>[a.createVNode(c,{class:"checkbox-row"},{default:a.withCtx(()=>[o.hasLineStyles(d)?(a.openBlock(),a.createBlock(s,{key:0,span:4},{default:a.withCtx(()=>[a.createElementVNode("div",{class:"path-visual",style:a.normalizeStyle(o.getLineStyles(d))},null,4)]),_:2},1024)):a.createCommentVNode("",!0),a.createVNode(s,{span:20},{default:a.withCtx(()=>[a.createElementVNode("div",{style:a.normalizeStyle(o.getBackgroundStyles(d))},a.toDisplayString(d[r.labelKey]),5)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","onChange","checked"])])]),_:2},1032,["label"]))),128))])]),_:1},8,["modelValue","onChange"])])}const kde=R4(Fpt,[["render",Gpt],["__scopeId","data-v-4d3741da"]]),qpt={name:"TreeControls",components:{Checkbox:mE,CheckboxGroup:RU,ColorPicker:Pdt,Row:U3,Tree:vde},props:{treeData:{type:Array,default:function(){return[]}},active:{type:String,default:""},hover:{type:String,default:""}},data:function(){return{defaultExpandedKeys:["All"]}},unmounted:function(){this.sortedPrimitiveGroups=void 0},methods:{nodeIsActive:function(e){return this.active===e.models},nodeIsHover:function(e){return this.hover===e.models},changeActiveByNode:function(e){e.models&&this.$emit("change-active",e.models)},changeHoverByNode:function(){},checkChanged:function(e,t){const r=t.checkedKeys.includes(e.key);e.key==="All"?this.$emit("checkAll",r):this.$emit("changed",{key:e.key,value:r})},getBackgroundStyles:function(e){return"colour"in e?{background:e.colour}:{}}}},Wpt=e=>(a.pushScopeId("data-v-df242013"),e=e(),a.popScopeId(),e),Zpt={class:"container"},Kpt=Wpt(()=>a.createElementVNode("div",{class:"title-text"},"Systems",-1)),Xpt={class:"tree-container"},Jpt=["onClick","onMouseover"];function Ypt(e,t,r,n,i,o){const s=B4,l=U3,c=vde;return a.openBlock(),a.createElementBlock("div",Zpt,[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(s,{span:12},{default:a.withCtx(()=>[Kpt]),_:1})]),_:1}),a.createElementVNode("div",Xpt,[a.createVNode(c,{ref:"tree","node-key":"key","show-checkbox":"","check-strictly":!1,data:r.treeData,"render-after-expand":!1,"default-expanded-keys":e.defaultExpandedKeys,onCheck:o.checkChanged},{default:a.withCtx(({node:u,data:d})=>[a.createElementVNode("span",{class:a.normalizeClass(["region-tree-node",{activeItem:o.nodeIsActive(d),hoverItem:o.nodeIsHover(d)}]),onClick:p=>o.changeActiveByNode(d),onMouseover:p=>o.changeHoverByNode(d)},[a.createElementVNode("div",{style:a.normalizeStyle(o.getBackgroundStyles(d))},a.toDisplayString(u.label),5)],42,Jpt)]),_:1},8,["data","default-expanded-keys","onCheck"])])])}const Mde=R4(qpt,[["render",Ypt],["__scopeId","data-v-df242013"]]),$pt={name:"SvgLegends"},e6t=e=>(a.pushScopeId("data-v-88079d87"),e=e(),a.popScopeId(),e),t6t={class:"legends-container"},r6t={version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 500 500",style:{"enable-background":"new 0 0 500 500"},xmlns:"http://www.w3.org/2000/svg","xmlns:bx":"https://boxy-svg.com"},n6t=a.createStaticVNode('<defs data-v-88079d87><bx:grid height="30.447" width="32.516" x="0" y="0" data-v-88079d87></bx:grid></defs><path class="st0 st0-translate" d="M61.3,103.8c-15.9,0-28.8-12.3-28.8-27.3c0-15,13-27.3,28.8-27.3s28.8,12.3,28.8,27.3 C90.1,91.5,77.2,103.8,61.3,103.8z" data-v-88079d87></path><path class="st1" d="M40.3,356.1C29.5,345,29.8,328,41.5,317.5c11.7-10.5,29.6-9.9,40.7,1.1c11.1,11,10.5,28.1-1.2,38.5 C69.3,367.4,51.1,366.9,40.3,356.1z" data-v-88079d87></path><path class="st2" d="M61.2,396.9c-5.3,9.3-15.3,15.1-26.1,15.1l-0.4,0.6c5.1,9,5.1,20,0,29l0.4,0.6c10.7,0,20.8,5.8,26.1,15.1 c5.3-9.3,15.3-15.1,26.1-15.1c-5.3-9.3-5.3-20.9,0-30.4C76.6,412.1,66.7,406.3,61.2,396.9z" data-v-88079d87></path><text transform="matrix(0.9908 0 0 1 118.0161 171.7975)" class="st3 st4 st5" style="white-space:pre;" data-v-88079d87> Tissue region </text><path class="st6" d="M40.9,231.1c11.3-10.6,29.5-10.6,40.8,0c11.3,10.6,11.3,27.9,0,38.5c-11.3,10.6-29.5,10.6-40.8,0 C29.7,259,29.7,241.7,40.9,231.1z" data-v-88079d87></path><text transform="matrix(0.9908 0 0 1 118.0161 257.675)" class="st3 st4 st5" style="white-space:pre;" data-v-88079d87> Brain nuclei </text><text transform="matrix(0.9908 0 0 1 118.0903 345.5266)" class="st3 st4 st5" style="white-space:pre;" data-v-88079d87> Ganglia </text><text transform="matrix(0.9908 0 0 1 118.0903 433.1613)" class="st3 st4 st5" style="white-space:pre;" data-v-88079d87> Ganglionated nerve plexus </text>',9),i6t=[n6t],o6t=e6t(()=>a.createElementVNode("svg",{width:"72px",height:"72px",viewBox:"0 0 24 24",fill:"yellow"},null,-1));function a6t(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",t6t,[(a.openBlock(),a.createElementBlock("svg",r6t,i6t)),o6t])}const Cde=R4($pt,[["render",a6t],["__scopeId","data-v-88079d87"]]),s6t='<div class="flatmap-marker"><svg display="block" height="41px" width="27px" viewBox="0 0 27 41"><g fill-rule="nonzero"><g transform="translate(3.0, 29.0)" fill="#000000"><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="10.5" ry="5.25002273"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="10.5" ry="5.25002273"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="9.5" ry="4.77275007"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="8.5" ry="4.29549936"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="7.5" ry="3.81822308"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="6.5" ry="3.34094679"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="5.5" ry="2.86367051"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="4.5" ry="2.38636864"></ellipse></g><g fill="#005974"><path d="M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"></path></g><g opacity="0.25" fill="#000000"><path d="M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"></path></g><g transform="translate(6.0, 7.0)" fill="#FFFFFF"></g><g transform="translate(8.0, 8.0)"><circle fill="#000000" opacity="0.25" cx="5.5" cy="5.5" r="5.4999962"></circle><circle fill="#FFFFFF" cx="5.5" cy="5.5" r="5.4999962"></circle></g></g></svg></div>',CE=function(e){return[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t))},_x={},Ede=async function(e,t){return _x&&_x.hasOwnProperty(t)?_x[t]:new Promise(r=>{fetch(`${e}knowledge/label/${t}`,{method:"GET"}).then(n=>n.json()).then(n=>{let i=n.label;i==="Mammalia"&&(i="Mammalia not otherwise specified"),_x[t]=i,r(i)}).catch(n=>{console.error("Error:",n),_x[t]=t,r(t)})})},EE=function(e,t){let r=JSON.stringify(e),n=JSON.stringify(t);return r.indexOf(n)!==-1};let l6t=function(){this.initialise=function(e){this.flatmapApi=e,this.destinations=[],this.origins=[],this.components=[],this.urls=[],this.controller=void 0,this.uberons=[],this.lookUp=[]},this.createTooltipData=async function(e){let t=[];e.feature.hyperlinks&&e.feature.hyperlinks.length>0?t=e.feature.hyperlinks:t=this.urls.map(n=>({url:n,id:"pubmed"}));let r;if(e.provenanceTaxonomy){r=[];for(let n=0;e.provenanceTaxonomy.length>n;n++)r.push(await Ede(this.flatmapAPI,e.provenanceTaxonomy[n]))}return{destinations:this.destinations,origins:this.origins,components:this.components,destinationsWithDatasets:this.destinationsWithDatasets,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,title:e.label,featureId:e.resource,hyperlinks:t,provenanceTaxonomy:e.provenanceTaxonomy,provenanceTaxonomyLabel:r}},this.createComponentsLabelList=function(e,t){let r=[];return e.forEach(n=>{r.push(this.createLabelFromNeuralNode(n[0]),t),n.length===2&&r.push(this.createLabelFromNeuralNode(n[1]),t)}),r},this.createLabelLookup=function(e){return new Promise(t=>{let r={};this.uberons=[];const n={sql:this.buildLabelSqlStatement(e)};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(l=>{r[l[o]]=l[s],this.uberons.push({id:l[o],name:l[s]})}),t(r)})})},this.buildConnectivitySqlStatement=function(e){let t="select knowledge from knowledge where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.buildLabelSqlStatement=function(e){let t="select entity, label from labels where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.findAllIdsFromConnectivity=function(e){let t=e.connectivity.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),[...new Set(n.flat())]},this.flattenConntectivity=function(e){let t=e.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(e){let t=e.connectivity.flat(),r=CE(t),n=[],i=!1;return r.forEach(o=>{i=!1,EE(e.axons,o)&&(i=!0),EE(e.dendrites,o)&&(i=!0),i||n.push(o)}),n},this.retrieveFlatmapKnowledgeForEvent=async function(e){this.controller&&this.controller.abort(),this.controller=new AbortController;const t=this.controller.signal,r=e.resource;if(this.destinations=[],this.origins=[],this.components=[],!r||r.length==0)return;const n={sql:this.buildConnectivitySqlStatement(r)};let i=new Promise(s=>{fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:t}).then(l=>l.json()).then(l=>{if(this.connectivityExists(l)){let c=JSON.parse(l.values[0][0]);this.processConnectivity(c).then(()=>{s(!0)})}else s(!1)}).catch(l=>{console.error("Error:",l),s(!1)})}),o=await this.pubmedQueryOnIds(e);return await Promise.all([i,o])},this.connectivityExists=function(e){return!!(e.values&&e.values.length>0&&JSON.parse(e.values[0][0]).connectivity&&JSON.parse(e.values[0][0]).connectivity.length>0)},this.createLabelFromNeuralNode=function(e,t){let r=t[e[0]];return e.length===2&&e[1].length>0&&e[1].forEach(n=>{t[n]==null?r+=`, ${n}`:r+=`, ${t[n]}`}),r},this.flattenAndFindDatasets=function(e,t,r){let n=this.flattenConntectivity(e),i=this.flattenConntectivity(t),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(e){return new Promise(t=>{let r=this.findComponents(e),n=CE(e.axons),i=CE(e.dendrites),o=this.findAllIdsFromConnectivity(e);this.createLabelLookup(o).then(s=>{this.destinations=n.map(l=>this.createLabelFromNeuralNode(l,s)),this.origins=i.map(l=>this.createLabelFromNeuralNode(l,s)),this.components=r.map(l=>this.createLabelFromNeuralNode(l,s)),this.flattenAndFindDatasets(r,n,i),t(!0)})})},this.flattenConntectivity=function(e){let t=e.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(e){let t=e.connectivity.flat(),r=CE(t),n=[],i=!1;return r.forEach(o=>{i=!1,EE(e.axons,o)&&(i=!0),EE(e.dendrites,o)&&(i=!0),i||n.push(o)}),n},this.stripPMIDPrefix=function(e){return e.split(":")[1]},this.buildPubmedSqlStatement=function(e){let t="select distinct publication from publications where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.buildPubmedSqlStatementForModels=function(e){return`select distinct publication from publications where entity = '${e}'`},this.flatmapQuery=function(e){const t={sql:e};return fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(r=>r.json()).catch(r=>{console.error("Error:",r)})},this.pubmedQueryOnIds=function(e){return new Promise(t=>{const r=e.resource,n=e.feature.source;if(!r||r.length===0)return;const i=this.buildPubmedSqlStatement(r);this.flatmapQuery(i).then(o=>{o.values.length>0?(this.urls=[this.pubmedSearchUrl(o.values.map(s=>this.stripPMIDPrefix(s[0])))],t(!0)):this.pubmedQueryOnModels(n).then(s=>{t(s)})})})},this.pubmedQueryOnModels=function(e){return this.flatmapQuery(this.buildPubmedSqlStatementForModels(e)).then(t=>Array.isArray(t.values)&&t.values.length>0?(this.urls=[this.pubmedSearchUrl(t.values.map(r=>this.stripPMIDPrefix(r[0])))],!0):(this.urls=[],!1))},this.pubmedSearchUrl=function(e){let t="https://pubmed.ncbi.nlm.nih.gov/?",r=new URLSearchParams;return r.append("term",e),t+r.toString()}};const c6t='<svg width="195px" height="24px" viewBox="0 0 160 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="42" y="50%" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#000000">Featured dataset marker</text></svg>';var Ade={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof window<"u"?window:ae,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(d){return r.setTimeout(d,20)},i=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||function(d){r.clearTimeout(d)};function o(d,p){var h=Object.prototype.toString.call(d),f=h==="[object Array]"||h==="[object NodeList]"||h==="[object HTMLCollection]"||h==="[object Object]"||typeof jQuery<"u"&&d instanceof jQuery||typeof Elements<"u"&&d instanceof Elements,m=0,g=d.length;if(f)for(;m<g;m++)p(d[m]);else p(d)}function s(d){if(!d.getBoundingClientRect)return{width:d.offsetWidth,height:d.offsetHeight};var p=d.getBoundingClientRect();return{width:Math.round(p.width),height:Math.round(p.height)}}function l(d,p){Object.keys(p).forEach(function(h){d.style[h]=p[h]})}var c=function(d,p){var h=0;function f(){var g=[];this.add=function(v){g.push(v)};var T,y;this.call=function(v){for(T=0,y=g.length;T<y;T++)g[T].call(this,v)},this.remove=function(v){var _=[];for(T=0,y=g.length;T<y;T++)g[T]!==v&&_.push(g[T]);g=_},this.length=function(){return g.length}}function m(g,T){if(g){if(g.resizedAttached){g.resizedAttached.add(T);return}g.resizedAttached=new f,g.resizedAttached.add(T),g.resizeSensor=document.createElement("div"),g.resizeSensor.dir="ltr",g.resizeSensor.className="resize-sensor";var y={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},v={position:"absolute",left:"0px",top:"0px",transition:"0s"};l(g.resizeSensor,y);var _=document.createElement("div");_.className="resize-sensor-expand",l(_,y);var b=document.createElement("div");l(b,v),_.appendChild(b);var L=document.createElement("div");L.className="resize-sensor-shrink",l(L,y);var w=document.createElement("div");l(w,v),l(w,{width:"200%",height:"200%"}),L.appendChild(w),g.resizeSensor.appendChild(_),g.resizeSensor.appendChild(L),g.appendChild(g.resizeSensor);var k=window.getComputedStyle(g),C=k?k.getPropertyValue("position"):null;C!=="absolute"&&C!=="relative"&&C!=="fixed"&&C!=="sticky"&&(g.style.position="relative");var A=!1,O=0,N=s(g),I=0,R=0,D=!0;h=0;var j=function(){var U=g.offsetWidth,X=g.offsetHeight;b.style.width=U+10+"px",b.style.height=X+10+"px",_.scrollLeft=U+10,_.scrollTop=X+10,L.scrollLeft=U+10,L.scrollTop=X+10},G=function(){if(D){var U=g.offsetWidth===0&&g.offsetHeight===0;if(U){h||(h=n(function(){h=0,G()}));return}else D=!1}j()};g.resizeSensor.resetSensor=G;var P=function(){O=0,A&&(I=N.width,R=N.height,g.resizedAttached&&g.resizedAttached.call(N))},W=function(){N=s(g),A=N.width!==I||N.height!==R,A&&!O&&(O=n(P)),G()},K=function(U,X,ee){U.attachEvent?U.attachEvent("on"+X,ee):U.addEventListener(X,ee)};K(_,"scroll",W),K(L,"scroll",W),h=n(function(){h=0,G()})}}o(d,function(g){m(g,p)}),this.detach=function(g){h||(i(h),h=0),c.detach(d,g)},this.reset=function(){d.resizeSensor.resetSensor()}};if(c.reset=function(d){o(d,function(p){p.resizeSensor.resetSensor()})},c.detach=function(d,p){o(d,function(h){h&&(h.resizedAttached&&typeof p=="function"&&(h.resizedAttached.remove(p),h.resizedAttached.length())||h.resizeSensor&&(h.contains(h.resizeSensor)&&h.removeChild(h.resizeSensor),delete h.resizeSensor,delete h.resizedAttached))})},typeof MutationObserver<"u"){var u=new MutationObserver(function(d){for(var p in d)if(d.hasOwnProperty(p))for(var h=d[p].addedNodes,f=0;f<h.length;f++)h[f].resizeSensor&&c.reset(h[f])});document.addEventListener("DOMContentLoaded",function(d){u.observe(document.body,{childList:!0,subtree:!0})})}return c})})(Ade);var u6t=Ade.exports;const d6t=BU(u6t);var Ode={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(ae,function(){var r,n,i;function o(l,c){if(!r)r=c;else if(!n)n=c;else{var u="var sharedChunk = {}; ("+r+")(sharedChunk); ("+n+")(sharedChunk);",d={};r(d),i=c(d),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([u],{type:"text/javascript"})))}}o(["exports"],function(l){function c(S,Q,M,V){return new(M||(M=Promise))(function(F,Y){function $(Me){try{Qe(V.next(Me))}catch(Fe){Y(Fe)}}function ce(Me){try{Qe(V.throw(Me))}catch(Fe){Y(Fe)}}function Qe(Me){var Fe;Me.done?F(Me.value):(Fe=Me.value,Fe instanceof M?Fe:new M(function(Ze){Ze(Fe)})).then($,ce)}Qe((V=V.apply(S,Q||[])).next())})}function u(S){return S&&S.__esModule&&Object.prototype.hasOwnProperty.call(S,"default")?S.default:S}typeof SuppressedError=="function"&&SuppressedError;var d=p;function p(S,Q){this.x=S,this.y=Q}p.prototype={clone:function(){return new p(this.x,this.y)},add:function(S){return this.clone()._add(S)},sub:function(S){return this.clone()._sub(S)},multByPoint:function(S){return this.clone()._multByPoint(S)},divByPoint:function(S){return this.clone()._divByPoint(S)},mult:function(S){return this.clone()._mult(S)},div:function(S){return this.clone()._div(S)},rotate:function(S){return this.clone()._rotate(S)},rotateAround:function(S,Q){return this.clone()._rotateAround(S,Q)},matMult:function(S){return this.clone()._matMult(S)},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(S){return this.x===S.x&&this.y===S.y},dist:function(S){return Math.sqrt(this.distSqr(S))},distSqr:function(S){var Q=S.x-this.x,M=S.y-this.y;return Q*Q+M*M},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(S){return Math.atan2(this.y-S.y,this.x-S.x)},angleWith:function(S){return this.angleWithSep(S.x,S.y)},angleWithSep:function(S,Q){return Math.atan2(this.x*Q-this.y*S,this.x*S+this.y*Q)},_matMult:function(S){var Q=S[2]*this.x+S[3]*this.y;return this.x=S[0]*this.x+S[1]*this.y,this.y=Q,this},_add:function(S){return this.x+=S.x,this.y+=S.y,this},_sub:function(S){return this.x-=S.x,this.y-=S.y,this},_mult:function(S){return this.x*=S,this.y*=S,this},_div:function(S){return this.x/=S,this.y/=S,this},_multByPoint:function(S){return this.x*=S.x,this.y*=S.y,this},_divByPoint:function(S){return this.x/=S.x,this.y/=S.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var S=this.y;return this.y=this.x,this.x=-S,this},_rotate:function(S){var Q=Math.cos(S),M=Math.sin(S),V=M*this.x+Q*this.y;return this.x=Q*this.x-M*this.y,this.y=V,this},_rotateAround:function(S,Q){var M=Math.cos(S),V=Math.sin(S),F=Q.y+V*(this.x-Q.x)+M*(this.y-Q.y);return this.x=Q.x+M*(this.x-Q.x)-V*(this.y-Q.y),this.y=F,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},p.convert=function(S){return S instanceof p?S:Array.isArray(S)?new p(S[0],S[1]):S};var h=u(d),f=m;function m(S,Q,M,V){this.cx=3*S,this.bx=3*(M-S)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*Q,this.by=3*(V-Q)-this.cy,this.ay=1-this.cy-this.by,this.p1x=S,this.p1y=Q,this.p2x=M,this.p2y=V}m.prototype={sampleCurveX:function(S){return((this.ax*S+this.bx)*S+this.cx)*S},sampleCurveY:function(S){return((this.ay*S+this.by)*S+this.cy)*S},sampleCurveDerivativeX:function(S){return(3*this.ax*S+2*this.bx)*S+this.cx},solveCurveX:function(S,Q){if(Q===void 0&&(Q=1e-6),S<0)return 0;if(S>1)return 1;for(var M=S,V=0;V<8;V++){var F=this.sampleCurveX(M)-S;if(Math.abs(F)<Q)return M;var Y=this.sampleCurveDerivativeX(M);if(Math.abs(Y)<1e-6)break;M-=F/Y}var $=0,ce=1;for(M=S,V=0;V<20&&(F=this.sampleCurveX(M),!(Math.abs(F-S)<Q));V++)S>F?$=M:ce=M,M=.5*(ce-$)+$;return M},solve:function(S,Q){return this.sampleCurveY(this.solveCurveX(S,Q))}};var g=u(f);let T,y;function v(){return T==null&&(T=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),T}function _(){if(y==null&&(y=!1,v())){const S=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(S){for(let M=0;M<5*5;M++){const V=4*M;S.fillStyle=`rgb(${V},${V+1},${V+2})`,S.fillRect(M%5,Math.floor(M/5),1,1)}const Q=S.getImageData(0,0,5,5).data;for(let M=0;M<5*5*4;M++)if(M%4!=3&&Q[M]!==M){y=!0;break}}}return y||!1}function b(S,Q,M,V){const F=new g(S,Q,M,V);return function(Y){return F.solve(Y)}}const L=b(.25,.1,.25,1);function w(S,Q,M){return Math.min(M,Math.max(Q,S))}function k(S,Q,M){const V=M-Q,F=((S-Q)%V+V)%V+Q;return F===Q?M:F}function C(S,...Q){for(const M of Q)for(const V in M)S[V]=M[V];return S}let A=1;function O(S,Q,M){const V={};for(const F in S)V[F]=Q.call(M||this,S[F],F,S);return V}function N(S,Q,M){const V={};for(const F in S)Q.call(M||this,S[F],F,S)&&(V[F]=S[F]);return V}function I(S){return Array.isArray(S)?S.map(I):typeof S=="object"&&S?O(S,I):S}const R={};function D(S){R[S]||(typeof console<"u"&&console.warn(S),R[S]=!0)}function j(S,Q,M){return(M.y-S.y)*(Q.x-S.x)>(Q.y-S.y)*(M.x-S.x)}function G(S){let Q=0;for(let M,V,F=0,Y=S.length,$=Y-1;F<Y;$=F++)M=S[F],V=S[$],Q+=(V.x-M.x)*(M.y+V.y);return Q}function P(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let W=null;function K(S){return typeof ImageBitmap<"u"&&S instanceof ImageBitmap}const U="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function X(S,Q,M,V,F){return c(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const Y=new VideoFrame(S,{timestamp:0});try{const $=Y==null?void 0:Y.format;if(!$||!$.startsWith("BGR")&&!$.startsWith("RGB"))throw new Error(`Unrecognized format ${$}`);const ce=$.startsWith("BGR"),Qe=new Uint8ClampedArray(V*F*4);if(yield Y.copyTo(Qe,function(Me,Fe,Ze,tt,ut){const dt=4*Math.max(-Fe,0),xt=(Math.max(0,Ze)-Ze)*tt*4+dt,Ot=4*tt,Bt=Math.max(0,Fe),rr=Math.max(0,Ze);return{rect:{x:Bt,y:rr,width:Math.min(Me.width,Fe+tt)-Bt,height:Math.min(Me.height,Ze+ut)-rr},layout:[{offset:xt,stride:Ot}]}}(S,Q,M,V,F)),ce)for(let Me=0;Me<Qe.length;Me+=4){const Fe=Qe[Me];Qe[Me]=Qe[Me+2],Qe[Me+2]=Fe}return Qe}finally{Y.close()}})}let ee,oe,he,me;const ie={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(S){const Q=requestAnimationFrame(S);return{cancel:()=>cancelAnimationFrame(Q)}},getImageData(S,Q=0){return this.getImageCanvasContext(S).getImageData(-Q,-Q,S.width+2*Q,S.height+2*Q)},getImageCanvasContext(S){const Q=window.document.createElement("canvas"),M=Q.getContext("2d",{willReadFrequently:!0});if(!M)throw new Error("failed to create canvas 2d context");return Q.width=S.width,Q.height=S.height,M.drawImage(S,0,0,S.width,S.height),M},resolveURL:S=>(he||(he=document.createElement("a")),he.href=S,he.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(me==null&&(me=matchMedia("(prefers-reduced-motion: reduce)")),me.matches)}},be={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class re extends Error{constructor(Q,M,V,F){super(`AJAXError: ${M} (${Q}): ${V}`),this.status=Q,this.statusText=M,this.url=V,this.body=F}}const ue=P()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,ne=S=>be.REGISTERED_PROTOCOLS[S.substring(0,S.indexOf("://"))];function ye(S,Q){const M=new AbortController,V=new Request(S.url,{method:S.method||"GET",body:S.body,credentials:S.credentials,headers:S.headers,cache:S.cache,referrer:ue(),signal:M.signal});let F=!1,Y=!1;return S.type==="json"&&V.headers.set("Accept","application/json"),Y||fetch(V).then($=>$.ok?(ce=>{(S.type==="arrayBuffer"||S.type==="image"?ce.arrayBuffer():S.type==="json"?ce.json():ce.text()).then(Qe=>{Y||(F=!0,Q(null,Qe,ce.headers.get("Cache-Control"),ce.headers.get("Expires")))}).catch(Qe=>{Y||Q(new Error(Qe.message))})})($):$.blob().then(ce=>Q(new re($.status,$.statusText,S.url,ce)))).catch($=>{$.code!==20&&Q(new Error($.message))}),{cancel:()=>{Y=!0,F||M.abort()}}}const _e=function(S,Q){if(/:\/\//.test(S.url)&&!/^https?:|^file:/.test(S.url)){if(P()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",S,Q);if(!P())return(ne(S.url)||ye)(S,Q)}if(!(/^file:/.test(M=S.url)||/^file:/.test(ue())&&!/^\w+:/.test(M))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return ye(S,Q);if(P()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",S,Q,void 0,!0)}var M;return function(V,F){const Y=new XMLHttpRequest;Y.open(V.method||"GET",V.url,!0),V.type!=="arrayBuffer"&&V.type!=="image"||(Y.responseType="arraybuffer");for(const $ in V.headers)Y.setRequestHeader($,V.headers[$]);return V.type==="json"&&(Y.responseType="text",Y.setRequestHeader("Accept","application/json")),Y.withCredentials=V.credentials==="include",Y.onerror=()=>{F(new Error(Y.statusText))},Y.onload=()=>{if((Y.status>=200&&Y.status<300||Y.status===0)&&Y.response!==null){let $=Y.response;if(V.type==="json")try{$=JSON.parse(Y.response)}catch(ce){return F(ce)}F(null,$,Y.getResponseHeader("Cache-Control"),Y.getResponseHeader("Expires"))}else{const $=new Blob([Y.response],{type:Y.getResponseHeader("Content-Type")});F(new re(Y.status,Y.statusText,V.url,$))}},Y.send(V.body),{cancel:()=>Y.abort()}}(S,Q)},Ie=function(S,Q){return _e(C(S,{type:"arrayBuffer"}),Q)};function qe(S){if(!S||S.indexOf("://")<=0||S.indexOf("data:image/")===0||S.indexOf("blob:")===0)return!0;const Q=new URL(S),M=window.location;return Q.protocol===M.protocol&&Q.host===M.host}function Ge(S,Q,M){M[S]&&M[S].indexOf(Q)!==-1||(M[S]=M[S]||[],M[S].push(Q))}function et(S,Q,M){if(M&&M[S]){const V=M[S].indexOf(Q);V!==-1&&M[S].splice(V,1)}}class Ve{constructor(Q,M={}){C(this,M),this.type=Q}}class Ne extends Ve{constructor(Q,M={}){super("error",C({error:Q},M))}}class it{on(Q,M){return this._listeners=this._listeners||{},Ge(Q,M,this._listeners),this}off(Q,M){return et(Q,M,this._listeners),et(Q,M,this._oneTimeListeners),this}once(Q,M){return M?(this._oneTimeListeners=this._oneTimeListeners||{},Ge(Q,M,this._oneTimeListeners),this):new Promise(V=>this.once(Q,V))}fire(Q,M){typeof Q=="string"&&(Q=new Ve(Q,M||{}));const V=Q.type;if(this.listens(V)){Q.target=this;const F=this._listeners&&this._listeners[V]?this._listeners[V].slice():[];for(const ce of F)ce.call(this,Q);const Y=this._oneTimeListeners&&this._oneTimeListeners[V]?this._oneTimeListeners[V].slice():[];for(const ce of Y)et(V,ce,this._oneTimeListeners),ce.call(this,Q);const $=this._eventedParent;$&&(C(Q,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),$.fire(Q))}else Q instanceof Ne&&console.error(Q.error);return this}listens(Q){return this._listeners&&this._listeners[Q]&&this._listeners[Q].length>0||this._oneTimeListeners&&this._oneTimeListeners[Q]&&this._oneTimeListeners[Q].length>0||this._eventedParent&&this._eventedParent.listens(Q)}setEventedParent(Q,M){return this._eventedParent=Q,this._eventedParentData=M,this}}var Re={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},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":{},within:{}}},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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 pt=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function yt(S,Q){const M={};for(const V in S)V!=="ref"&&(M[V]=S[V]);return pt.forEach(V=>{V in Q&&(M[V]=Q[V])}),M}function ct(S,Q){if(Array.isArray(S)){if(!Array.isArray(Q)||S.length!==Q.length)return!1;for(let M=0;M<S.length;M++)if(!ct(S[M],Q[M]))return!1;return!0}if(typeof S=="object"&&S!==null&&Q!==null){if(typeof Q!="object"||Object.keys(S).length!==Object.keys(Q).length)return!1;for(const M in S)if(!ct(S[M],Q[M]))return!1;return!0}return S===Q}const xe={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Ue(S,Q,M){M.push({command:xe.addSource,args:[S,Q[S]]})}function $e(S,Q,M){Q.push({command:xe.removeSource,args:[S]}),M[S]=!0}function at(S,Q,M,V){$e(S,M,V),Ue(S,Q,M)}function Ht(S,Q,M){let V;for(V in S[M])if(Object.prototype.hasOwnProperty.call(S[M],V)&&V!=="data"&&!ct(S[M][V],Q[M][V]))return!1;for(V in Q[M])if(Object.prototype.hasOwnProperty.call(Q[M],V)&&V!=="data"&&!ct(S[M][V],Q[M][V]))return!1;return!0}function Vt(S,Q,M,V,F,Y){let $;for($ in Q=Q||{},S=S||{})Object.prototype.hasOwnProperty.call(S,$)&&(ct(S[$],Q[$])||M.push({command:Y,args:[V,$,Q[$],F]}));for($ in Q)Object.prototype.hasOwnProperty.call(Q,$)&&!Object.prototype.hasOwnProperty.call(S,$)&&(ct(S[$],Q[$])||M.push({command:Y,args:[V,$,Q[$],F]}))}function Ft(S){return S.id}function Gt(S,Q){return S[Q.id]=Q,S}class Je{constructor(Q,M,V,F){this.message=(Q?`${Q}: `:"")+V,F&&(this.identifier=F),M!=null&&M.__line__&&(this.line=M.__line__)}}function ft(S,...Q){for(const M of Q)for(const V in M)S[V]=M[V];return S}class St extends Error{constructor(Q,M){super(M),this.message=M,this.key=Q}}class Zt{constructor(Q,M=[]){this.parent=Q,this.bindings={};for(const[V,F]of M)this.bindings[V]=F}concat(Q){return new Zt(this,Q)}get(Q){if(this.bindings[Q])return this.bindings[Q];if(this.parent)return this.parent.get(Q);throw new Error(`${Q} not found in scope.`)}has(Q){return!!this.bindings[Q]||!!this.parent&&this.parent.has(Q)}}const Jt={kind:"null"},Pt={kind:"number"},rt={kind:"string"},Et={kind:"boolean"},kt={kind:"color"},or={kind:"object"},$t={kind:"value"},wt={kind:"collator"},je={kind:"formatted"},ke={kind:"padding"},Oe={kind:"resolvedImage"},Ye={kind:"variableAnchorOffsetCollection"};function ve(S,Q){return{kind:"array",itemType:S,N:Q}}function Ae(S){if(S.kind==="array"){const Q=Ae(S.itemType);return typeof S.N=="number"?`array<${Q}, ${S.N}>`:S.itemType.kind==="value"?"array":`array<${Q}>`}return S.kind}const Be=[Jt,Pt,rt,Et,kt,je,or,ve($t),ke,Oe,Ye];function Se(S,Q){if(Q.kind==="error")return null;if(S.kind==="array"){if(Q.kind==="array"&&(Q.N===0&&Q.itemType.kind==="value"||!Se(S.itemType,Q.itemType))&&(typeof S.N!="number"||S.N===Q.N))return null}else{if(S.kind===Q.kind)return null;if(S.kind==="value"){for(const M of Be)if(!Se(M,Q))return null}}return`Expected ${Ae(S)} but found ${Ae(Q)} instead.`}function ge(S,Q){return Q.some(M=>M.kind===S.kind)}function Ce(S,Q){return Q.some(M=>M==="null"?S===null:M==="array"?Array.isArray(S):M==="object"?S&&!Array.isArray(S)&&typeof S=="object":M===typeof S)}function Xe(S,Q){return S.kind==="array"&&Q.kind==="array"?S.itemType.kind===Q.itemType.kind&&typeof S.N=="number":S.kind===Q.kind}const se=.96422,Le=.82521,Ke=4/29,ht=6/29,At=3*ht*ht,qt=ht*ht*ht,nr=Math.PI/180,cr=180/Math.PI;function lr(S){return(S%=360)<0&&(S+=360),S}function hr([S,Q,M,V]){let F,Y;const $=Rr((.2225045*(S=Ir(S))+.7168786*(Q=Ir(Q))+.0606169*(M=Ir(M)))/1);S===Q&&Q===M?F=Y=$:(F=Rr((.4360747*S+.3850649*Q+.1430804*M)/se),Y=Rr((.0139322*S+.0971045*Q+.7141733*M)/Le));const ce=116*$-16;return[ce<0?0:ce,500*(F-$),200*($-Y),V]}function Ir(S){return S<=.04045?S/12.92:Math.pow((S+.055)/1.055,2.4)}function Rr(S){return S>qt?Math.pow(S,1/3):S/At+Ke}function yr([S,Q,M,V]){let F=(S+16)/116,Y=isNaN(Q)?F:F+Q/500,$=isNaN(M)?F:F-M/200;return F=1*an(F),Y=se*an(Y),$=Le*an($),[Ar(3.1338561*Y-1.6168667*F-.4906146*$),Ar(-.9787684*Y+1.9161415*F+.033454*$),Ar(.0719453*Y-.2289914*F+1.4052427*$),V]}function Ar(S){return(S=S<=.00304?12.92*S:1.055*Math.pow(S,1/2.4)-.055)<0?0:S>1?1:S}function an(S){return S>ht?S*S*S:At*(S-Ke)}function Er(S){return parseInt(S.padEnd(2,S),16)/255}function nn(S,Q){return Fr(Q?S/100:S,0,1)}function Fr(S,Q,M){return Math.min(Math.max(Q,S),M)}function zr(S){return!S.some(Number.isNaN)}const Sn={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 dn{constructor(Q,M,V,F=1,Y=!0){this.r=Q,this.g=M,this.b=V,this.a=F,Y||(this.r*=F,this.g*=F,this.b*=F,F||this.overwriteGetter("rgb",[Q,M,V,F]))}static parse(Q){if(Q instanceof dn)return Q;if(typeof Q!="string")return;const M=function(V){if((V=V.toLowerCase().trim())==="transparent")return[0,0,0,0];const F=Sn[V];if(F){const[$,ce,Qe]=F;return[$/255,ce/255,Qe/255,1]}if(V.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(V)){const $=V.length<6?1:2;let ce=1;return[Er(V.slice(ce,ce+=$)),Er(V.slice(ce,ce+=$)),Er(V.slice(ce,ce+=$)),Er(V.slice(ce,ce+$)||"ff")]}if(V.startsWith("rgb")){const $=V.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if($){const[ce,Qe,Me,Fe,Ze,tt,ut,dt,xt,Ot,Bt,rr]=$,Wt=[Fe||" ",ut||" ",Ot].join("");if(Wt===" "||Wt===" /"||Wt===",,"||Wt===",,,"){const ir=[Me,tt,xt].join(""),dr=ir==="%%%"?100:ir===""?255:0;if(dr){const xr=[Fr(+Qe/dr,0,1),Fr(+Ze/dr,0,1),Fr(+dt/dr,0,1),Bt?nn(+Bt,rr):1];if(zr(xr))return xr}}return}}const Y=V.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Y){const[$,ce,Qe,Me,Fe,Ze,tt,ut,dt]=Y,xt=[Qe||" ",Fe||" ",tt].join("");if(xt===" "||xt===" /"||xt===",,"||xt===",,,"){const Ot=[+ce,Fr(+Me,0,100),Fr(+Ze,0,100),ut?nn(+ut,dt):1];if(zr(Ot))return function([Bt,rr,Wt,ir]){function dr(xr){const en=(xr+Bt/30)%12,yn=rr*Math.min(Wt,1-Wt);return Wt-yn*Math.max(-1,Math.min(en-3,9-en,1))}return Bt=lr(Bt),rr/=100,Wt/=100,[dr(0),dr(8),dr(4),ir]}(Ot)}}}(Q);return M?new dn(...M,!1):void 0}get rgb(){const{r:Q,g:M,b:V,a:F}=this,Y=F||1/0;return this.overwriteGetter("rgb",[Q/Y,M/Y,V/Y,F])}get hcl(){return this.overwriteGetter("hcl",function(Q){const[M,V,F,Y]=hr(Q),$=Math.sqrt(V*V+F*F);return[Math.round(1e4*$)?lr(Math.atan2(F,V)*cr):NaN,$,M,Y]}(this.rgb))}get lab(){return this.overwriteGetter("lab",hr(this.rgb))}overwriteGetter(Q,M){return Object.defineProperty(this,Q,{value:M}),M}toString(){const[Q,M,V,F]=this.rgb;return`rgba(${[Q,M,V].map(Y=>Math.round(255*Y)).join(",")},${F})`}}dn.black=new dn(0,0,0,1),dn.white=new dn(1,1,1,1),dn.transparent=new dn(0,0,0,0),dn.red=new dn(1,0,0,1);class Xr{constructor(Q,M,V){this.sensitivity=Q?M?"variant":"case":M?"accent":"base",this.locale=V,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(Q,M){return this.collator.compare(Q,M)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Pn{constructor(Q,M,V,F,Y){this.text=Q,this.image=M,this.scale=V,this.fontStack=F,this.textColor=Y}}class cn{constructor(Q){this.sections=Q}static fromString(Q){return new cn([new Pn(Q,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(Q=>Q.text.length!==0||Q.image&&Q.image.name.length!==0)}static factory(Q){return Q instanceof cn?Q:cn.fromString(Q)}toString(){return this.sections.length===0?"":this.sections.map(Q=>Q.text).join("")}}class ni{constructor(Q){this.values=Q.slice()}static parse(Q){if(Q instanceof ni)return Q;if(typeof Q=="number")return new ni([Q,Q,Q,Q]);if(Array.isArray(Q)&&!(Q.length<1||Q.length>4)){for(const M of Q)if(typeof M!="number")return;switch(Q.length){case 1:Q=[Q[0],Q[0],Q[0],Q[0]];break;case 2:Q=[Q[0],Q[1],Q[0],Q[1]];break;case 3:Q=[Q[0],Q[1],Q[2],Q[1]]}return new ni(Q)}}toString(){return JSON.stringify(this.values)}}const Zn=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class si{constructor(Q){this.values=Q.slice()}static parse(Q){if(Q instanceof si)return Q;if(Array.isArray(Q)&&!(Q.length<1)&&Q.length%2==0){for(let M=0;M<Q.length;M+=2){const V=Q[M],F=Q[M+1];if(typeof V!="string"||!Zn.has(V)||!Array.isArray(F)||F.length!==2||typeof F[0]!="number"||typeof F[1]!="number")return}return new si(Q)}}toString(){return JSON.stringify(this.values)}}class ii{constructor(Q){this.name=Q.name,this.available=Q.available}toString(){return this.name}static fromString(Q){return Q?new ii({name:Q,available:!1}):null}}function ra(S,Q,M,V){return typeof S=="number"&&S>=0&&S<=255&&typeof Q=="number"&&Q>=0&&Q<=255&&typeof M=="number"&&M>=0&&M<=255?V===void 0||typeof V=="number"&&V>=0&&V<=1?null:`Invalid rgba value [${[S,Q,M,V].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof V=="number"?[S,Q,M,V]:[S,Q,M]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function mo(S){if(S===null||typeof S=="string"||typeof S=="boolean"||typeof S=="number"||S instanceof dn||S instanceof Xr||S instanceof cn||S instanceof ni||S instanceof si||S instanceof ii)return!0;if(Array.isArray(S)){for(const Q of S)if(!mo(Q))return!1;return!0}if(typeof S=="object"){for(const Q in S)if(!mo(S[Q]))return!1;return!0}return!1}function Qn(S){if(S===null)return Jt;if(typeof S=="string")return rt;if(typeof S=="boolean")return Et;if(typeof S=="number")return Pt;if(S instanceof dn)return kt;if(S instanceof Xr)return wt;if(S instanceof cn)return je;if(S instanceof ni)return ke;if(S instanceof si)return Ye;if(S instanceof ii)return Oe;if(Array.isArray(S)){const Q=S.length;let M;for(const V of S){const F=Qn(V);if(M){if(M===F)continue;M=$t;break}M=F}return ve(M||$t,Q)}return or}function jn(S){const Q=typeof S;return S===null?"":Q==="string"||Q==="number"||Q==="boolean"?String(S):S instanceof dn||S instanceof cn||S instanceof ni||S instanceof si||S instanceof ii?S.toString():JSON.stringify(S)}class qa{constructor(Q,M){this.type=Q,this.value=M}static parse(Q,M){if(Q.length!==2)return M.error(`'literal' expression requires exactly one argument, but found ${Q.length-1} instead.`);if(!mo(Q[1]))return M.error("invalid value");const V=Q[1];let F=Qn(V);const Y=M.expectedType;return F.kind!=="array"||F.N!==0||!Y||Y.kind!=="array"||typeof Y.N=="number"&&Y.N!==0||(F=Y),new qa(F,V)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ri{constructor(Q){this.name="ExpressionEvaluationError",this.message=Q}toJSON(){return this.message}}const Wa={string:rt,number:Pt,boolean:Et,object:or};class na{constructor(Q,M){this.type=Q,this.args=M}static parse(Q,M){if(Q.length<2)return M.error("Expected at least one argument.");let V,F=1;const Y=Q[0];if(Y==="array"){let ce,Qe;if(Q.length>2){const Me=Q[1];if(typeof Me!="string"||!(Me in Wa)||Me==="object")return M.error('The item type argument of "array" must be one of string, number, boolean',1);ce=Wa[Me],F++}else ce=$t;if(Q.length>3){if(Q[2]!==null&&(typeof Q[2]!="number"||Q[2]<0||Q[2]!==Math.floor(Q[2])))return M.error('The length argument to "array" must be a positive integer literal',2);Qe=Q[2],F++}V=ve(ce,Qe)}else{if(!Wa[Y])throw new Error(`Types doesn't contain name = ${Y}`);V=Wa[Y]}const $=[];for(;F<Q.length;F++){const ce=M.parse(Q[F],F,$t);if(!ce)return null;$.push(ce)}return new na(V,$)}evaluate(Q){for(let M=0;M<this.args.length;M++){const V=this.args[M].evaluate(Q);if(!Se(this.type,Qn(V)))return V;if(M===this.args.length-1)throw new ri(`Expected value to be of type ${Ae(this.type)}, but found ${Ae(Qn(V))} instead.`)}throw new Error}eachChild(Q){this.args.forEach(Q)}outputDefined(){return this.args.every(Q=>Q.outputDefined())}}const Qs={"to-boolean":Et,"to-color":kt,"to-number":Pt,"to-string":rt};class lt{constructor(Q,M){this.type=Q,this.args=M}static parse(Q,M){if(Q.length<2)return M.error("Expected at least one argument.");const V=Q[0];if(!Qs[V])throw new Error(`Can't parse ${V} as it is not part of the known types`);if((V==="to-boolean"||V==="to-string")&&Q.length!==2)return M.error("Expected one argument.");const F=Qs[V],Y=[];for(let $=1;$<Q.length;$++){const ce=M.parse(Q[$],$,$t);if(!ce)return null;Y.push(ce)}return new lt(F,Y)}evaluate(Q){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(Q);case"color":{let M,V;for(const F of this.args){if(M=F.evaluate(Q),V=null,M instanceof dn)return M;if(typeof M=="string"){const Y=Q.parseColor(M);if(Y)return Y}else if(Array.isArray(M)&&(V=M.length<3||M.length>4?`Invalid rbga value ${JSON.stringify(M)}: expected an array containing either three or four numeric values.`:ra(M[0],M[1],M[2],M[3]),!V))return new dn(M[0]/255,M[1]/255,M[2]/255,M[3])}throw new ri(V||`Could not parse color from value '${typeof M=="string"?M:JSON.stringify(M)}'`)}case"padding":{let M;for(const V of this.args){M=V.evaluate(Q);const F=ni.parse(M);if(F)return F}throw new ri(`Could not parse padding from value '${typeof M=="string"?M:JSON.stringify(M)}'`)}case"variableAnchorOffsetCollection":{let M;for(const V of this.args){M=V.evaluate(Q);const F=si.parse(M);if(F)return F}throw new ri(`Could not parse variableAnchorOffsetCollection from value '${typeof M=="string"?M:JSON.stringify(M)}'`)}case"number":{let M=null;for(const V of this.args){if(M=V.evaluate(Q),M===null)return 0;const F=Number(M);if(!isNaN(F))return F}throw new ri(`Could not convert ${JSON.stringify(M)} to number.`)}case"formatted":return cn.fromString(jn(this.args[0].evaluate(Q)));case"resolvedImage":return ii.fromString(jn(this.args[0].evaluate(Q)));default:return jn(this.args[0].evaluate(Q))}}eachChild(Q){this.args.forEach(Q)}outputDefined(){return this.args.every(Q=>Q.outputDefined())}}const _t=["Unknown","Point","LineString","Polygon"];class Mt{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"?_t[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(Q){let M=this._parseColorCache[Q];return M||(M=this._parseColorCache[Q]=dn.parse(Q)),M}}class Rt{constructor(Q,M,V=[],F,Y=new Zt,$=[]){this.registry=Q,this.path=V,this.key=V.map(ce=>`[${ce}]`).join(""),this.scope=Y,this.errors=$,this.expectedType=F,this._isConstant=M}parse(Q,M,V,F,Y={}){return M?this.concat(M,V,F)._parse(Q,Y):this._parse(Q,Y)}_parse(Q,M){function V(F,Y,$){return $==="assert"?new na(Y,[F]):$==="coerce"?new lt(Y,[F]):F}if(Q!==null&&typeof Q!="string"&&typeof Q!="boolean"&&typeof Q!="number"||(Q=["literal",Q]),Array.isArray(Q)){if(Q.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const F=Q[0];if(typeof F!="string")return this.error(`Expression name must be a string, but found ${typeof F} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Y=this.registry[F];if(Y){let $=Y.parse(Q,this);if(!$)return null;if(this.expectedType){const ce=this.expectedType,Qe=$.type;if(ce.kind!=="string"&&ce.kind!=="number"&&ce.kind!=="boolean"&&ce.kind!=="object"&&ce.kind!=="array"||Qe.kind!=="value")if(ce.kind!=="color"&&ce.kind!=="formatted"&&ce.kind!=="resolvedImage"||Qe.kind!=="value"&&Qe.kind!=="string")if(ce.kind!=="padding"||Qe.kind!=="value"&&Qe.kind!=="number"&&Qe.kind!=="array")if(ce.kind!=="variableAnchorOffsetCollection"||Qe.kind!=="value"&&Qe.kind!=="array"){if(this.checkSubtype(ce,Qe))return null}else $=V($,ce,M.typeAnnotation||"coerce");else $=V($,ce,M.typeAnnotation||"coerce");else $=V($,ce,M.typeAnnotation||"coerce");else $=V($,ce,M.typeAnnotation||"assert")}if(!($ instanceof qa)&&$.type.kind!=="resolvedImage"&&this._isConstant($)){const ce=new Mt;try{$=new qa($.type,$.evaluate(ce))}catch(Qe){return this.error(Qe.message),null}}return $}return this.error(`Unknown expression "${F}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(Q===void 0?"'undefined' value invalid. Use null instead.":typeof Q=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof Q} instead.`)}concat(Q,M,V){const F=typeof Q=="number"?this.path.concat(Q):this.path,Y=V?this.scope.concat(V):this.scope;return new Rt(this.registry,this._isConstant,F,M||null,Y,this.errors)}error(Q,...M){const V=`${this.key}${M.map(F=>`[${F}]`).join("")}`;this.errors.push(new St(V,Q))}checkSubtype(Q,M){const V=Se(Q,M);return V&&this.error(V),V}}class ar{constructor(Q,M,V){this.type=wt,this.locale=V,this.caseSensitive=Q,this.diacriticSensitive=M}static parse(Q,M){if(Q.length!==2)return M.error("Expected one argument.");const V=Q[1];if(typeof V!="object"||Array.isArray(V))return M.error("Collator options argument must be an object.");const F=M.parse(V["case-sensitive"]!==void 0&&V["case-sensitive"],1,Et);if(!F)return null;const Y=M.parse(V["diacritic-sensitive"]!==void 0&&V["diacritic-sensitive"],1,Et);if(!Y)return null;let $=null;return V.locale&&($=M.parse(V.locale,1,rt),!$)?null:new ar(F,Y,$)}evaluate(Q){return new Xr(this.caseSensitive.evaluate(Q),this.diacriticSensitive.evaluate(Q),this.locale?this.locale.evaluate(Q):null)}eachChild(Q){Q(this.caseSensitive),Q(this.diacriticSensitive),this.locale&&Q(this.locale)}outputDefined(){return!1}}const gr=8192;function Pr(S,Q){S[0]=Math.min(S[0],Q[0]),S[1]=Math.min(S[1],Q[1]),S[2]=Math.max(S[2],Q[0]),S[3]=Math.max(S[3],Q[1])}function Qr(S,Q){return!(S[0]<=Q[0]||S[2]>=Q[2]||S[1]<=Q[1]||S[3]>=Q[3])}function Dr(S,Q){const M=(180+S[0])/360,V=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+S[1]*Math.PI/360)))/360,F=Math.pow(2,Q.z);return[Math.round(M*F*gr),Math.round(V*F*gr)]}function rn(S,Q,M){const V=S[0]-Q[0],F=S[1]-Q[1],Y=S[0]-M[0],$=S[1]-M[1];return V*$-Y*F==0&&V*Y<=0&&F*$<=0}function qr(S,Q){let M=!1;for(let $=0,ce=Q.length;$<ce;$++){const Qe=Q[$];for(let Me=0,Fe=Qe.length;Me<Fe-1;Me++){if(rn(S,Qe[Me],Qe[Me+1]))return!1;(F=Qe[Me])[1]>(V=S)[1]!=(Y=Qe[Me+1])[1]>V[1]&&V[0]<(Y[0]-F[0])*(V[1]-F[1])/(Y[1]-F[1])+F[0]&&(M=!M)}}var V,F,Y;return M}function Nn(S,Q){for(let M=0;M<Q.length;M++)if(qr(S,Q[M]))return!0;return!1}function Dn(S,Q,M,V){const F=V[0]-M[0],Y=V[1]-M[1],$=(S[0]-M[0])*Y-F*(S[1]-M[1]),ce=(Q[0]-M[0])*Y-F*(Q[1]-M[1]);return $>0&&ce<0||$<0&&ce>0}function Ci(S,Q,M){for(const Me of M)for(let Fe=0;Fe<Me.length-1;++Fe)if((ce=[($=Me[Fe+1])[0]-(Y=Me[Fe])[0],$[1]-Y[1]])[0]*(Qe=[(F=Q)[0]-(V=S)[0],F[1]-V[1]])[1]-ce[1]*Qe[0]!=0&&Dn(V,F,Y,$)&&Dn(Y,$,V,F))return!0;var V,F,Y,$,ce,Qe;return!1}function Xn(S,Q){for(let M=0;M<S.length;++M)if(!qr(S[M],Q))return!1;for(let M=0;M<S.length-1;++M)if(Ci(S[M],S[M+1],Q))return!1;return!0}function Fi(S,Q){for(let M=0;M<Q.length;M++)if(Xn(S,Q[M]))return!0;return!1}function no(S,Q,M){const V=[];for(let F=0;F<S.length;F++){const Y=[];for(let $=0;$<S[F].length;$++){const ce=Dr(S[F][$],M);Pr(Q,ce),Y.push(ce)}V.push(Y)}return V}function bs(S,Q,M){const V=[];for(let F=0;F<S.length;F++){const Y=no(S[F],Q,M);V.push(Y)}return V}function p1(S,Q,M,V){if(S[0]<M[0]||S[0]>M[2]){const F=.5*V;let Y=S[0]-M[0]>F?-V:M[0]-S[0]>F?V:0;Y===0&&(Y=S[0]-M[2]>F?-V:M[2]-S[0]>F?V:0),S[0]+=Y}Pr(Q,S)}function Ha(S,Q,M,V){const F=Math.pow(2,V.z)*gr,Y=[V.x*gr,V.y*gr],$=[];for(const ce of S)for(const Qe of ce){const Me=[Qe.x+Y[0],Qe.y+Y[1]];p1(Me,Q,M,F),$.push(Me)}return $}function ia(S,Q,M,V){const F=Math.pow(2,V.z)*gr,Y=[V.x*gr,V.y*gr],$=[];for(const Qe of S){const Me=[];for(const Fe of Qe){const Ze=[Fe.x+Y[0],Fe.y+Y[1]];Pr(Q,Ze),Me.push(Ze)}$.push(Me)}if(Q[2]-Q[0]<=F/2){(ce=Q)[0]=ce[1]=1/0,ce[2]=ce[3]=-1/0;for(const Qe of $)for(const Me of Qe)p1(Me,Q,M,F)}var ce;return $}class qs{constructor(Q,M){this.type=Et,this.geojson=Q,this.geometries=M}static parse(Q,M){if(Q.length!==2)return M.error(`'within' expression requires exactly one argument, but found ${Q.length-1} instead.`);if(mo(Q[1])){const V=Q[1];if(V.type==="FeatureCollection")for(let F=0;F<V.features.length;++F){const Y=V.features[F].geometry.type;if(Y==="Polygon"||Y==="MultiPolygon")return new qs(V,V.features[F].geometry)}else if(V.type==="Feature"){const F=V.geometry.type;if(F==="Polygon"||F==="MultiPolygon")return new qs(V,V.geometry)}else if(V.type==="Polygon"||V.type==="MultiPolygon")return new qs(V,V)}return M.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(Q){if(Q.geometry()!=null&&Q.canonicalID()!=null){if(Q.geometryType()==="Point")return function(M,V){const F=[1/0,1/0,-1/0,-1/0],Y=[1/0,1/0,-1/0,-1/0],$=M.canonicalID();if(V.type==="Polygon"){const ce=no(V.coordinates,Y,$),Qe=Ha(M.geometry(),F,Y,$);if(!Qr(F,Y))return!1;for(const Me of Qe)if(!qr(Me,ce))return!1}if(V.type==="MultiPolygon"){const ce=bs(V.coordinates,Y,$),Qe=Ha(M.geometry(),F,Y,$);if(!Qr(F,Y))return!1;for(const Me of Qe)if(!Nn(Me,ce))return!1}return!0}(Q,this.geometries);if(Q.geometryType()==="LineString")return function(M,V){const F=[1/0,1/0,-1/0,-1/0],Y=[1/0,1/0,-1/0,-1/0],$=M.canonicalID();if(V.type==="Polygon"){const ce=no(V.coordinates,Y,$),Qe=ia(M.geometry(),F,Y,$);if(!Qr(F,Y))return!1;for(const Me of Qe)if(!Xn(Me,ce))return!1}if(V.type==="MultiPolygon"){const ce=bs(V.coordinates,Y,$),Qe=ia(M.geometry(),F,Y,$);if(!Qr(F,Y))return!1;for(const Me of Qe)if(!Fi(Me,ce))return!1}return!0}(Q,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class is{constructor(Q,M){this.type=M.type,this.name=Q,this.boundExpression=M}static parse(Q,M){if(Q.length!==2||typeof Q[1]!="string")return M.error("'var' expression requires exactly one string literal argument.");const V=Q[1];return M.scope.has(V)?new is(V,M.scope.get(V)):M.error(`Unknown variable "${V}". Make sure "${V}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(Q){return this.boundExpression.evaluate(Q)}eachChild(){}outputDefined(){return!1}}class Mo{constructor(Q,M,V,F){this.name=Q,this.type=M,this._evaluate=V,this.args=F}evaluate(Q){return this._evaluate(Q,this.args)}eachChild(Q){this.args.forEach(Q)}outputDefined(){return!1}static parse(Q,M){const V=Q[0],F=Mo.definitions[V];if(!F)return M.error(`Unknown expression "${V}". If you wanted a literal array, use ["literal", [...]].`,0);const Y=Array.isArray(F)?F[0]:F.type,$=Array.isArray(F)?[[F[1],F[2]]]:F.overloads,ce=$.filter(([Me])=>!Array.isArray(Me)||Me.length===Q.length-1);let Qe=null;for(const[Me,Fe]of ce){Qe=new Rt(M.registry,dl,M.path,null,M.scope);const Ze=[];let tt=!1;for(let ut=1;ut<Q.length;ut++){const dt=Q[ut],xt=Array.isArray(Me)?Me[ut-1]:Me.type,Ot=Qe.parse(dt,1+Ze.length,xt);if(!Ot){tt=!0;break}Ze.push(Ot)}if(!tt)if(Array.isArray(Me)&&Me.length!==Ze.length)Qe.error(`Expected ${Me.length} arguments, but found ${Ze.length} instead.`);else{for(let ut=0;ut<Ze.length;ut++){const dt=Array.isArray(Me)?Me[ut]:Me.type,xt=Ze[ut];Qe.concat(ut+1).checkSubtype(dt,xt.type)}if(Qe.errors.length===0)return new Mo(V,Y,Fe,Ze)}}if(ce.length===1)M.errors.push(...Qe.errors);else{const Me=(ce.length?ce:$).map(([Ze])=>{return tt=Ze,Array.isArray(tt)?`(${tt.map(Ae).join(", ")})`:`(${Ae(tt.type)}...)`;var tt}).join(" | "),Fe=[];for(let Ze=1;Ze<Q.length;Ze++){const tt=M.parse(Q[Ze],1+Fe.length);if(!tt)return null;Fe.push(Ae(tt.type))}M.error(`Expected arguments of type ${Me}, but found (${Fe.join(", ")}) instead.`)}return null}static register(Q,M){Mo.definitions=M;for(const V in M)Q[V]=Mo}}function dl(S){if(S instanceof is)return dl(S.boundExpression);if(S instanceof Mo&&S.name==="error"||S instanceof ar||S instanceof qs)return!1;const Q=S instanceof lt||S instanceof na;let M=!0;return S.eachChild(V=>{M=Q?M&&dl(V):M&&V instanceof qa}),!!M&&G2(S)&&l2(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function G2(S){if(S instanceof Mo&&(S.name==="get"&&S.args.length===1||S.name==="feature-state"||S.name==="has"&&S.args.length===1||S.name==="properties"||S.name==="geometry-type"||S.name==="id"||/^filter-/.test(S.name))||S instanceof qs)return!1;let Q=!0;return S.eachChild(M=>{Q&&!G2(M)&&(Q=!1)}),Q}function h1(S){if(S instanceof Mo&&S.name==="feature-state")return!1;let Q=!0;return S.eachChild(M=>{Q&&!h1(M)&&(Q=!1)}),Q}function l2(S,Q){if(S instanceof Mo&&Q.indexOf(S.name)>=0)return!1;let M=!0;return S.eachChild(V=>{M&&!l2(V,Q)&&(M=!1)}),M}function L3(S,Q){const M=S.length-1;let V,F,Y=0,$=M,ce=0;for(;Y<=$;)if(ce=Math.floor((Y+$)/2),V=S[ce],F=S[ce+1],V<=Q){if(ce===M||Q<F)return ce;Y=ce+1}else{if(!(V>Q))throw new ri("Input is not a number.");$=ce-1}return 0}class iu{constructor(Q,M,V){this.type=Q,this.input=M,this.labels=[],this.outputs=[];for(const[F,Y]of V)this.labels.push(F),this.outputs.push(Y)}static parse(Q,M){if(Q.length-1<4)return M.error(`Expected at least 4 arguments, but found only ${Q.length-1}.`);if((Q.length-1)%2!=0)return M.error("Expected an even number of arguments.");const V=M.parse(Q[1],1,Pt);if(!V)return null;const F=[];let Y=null;M.expectedType&&M.expectedType.kind!=="value"&&(Y=M.expectedType);for(let $=1;$<Q.length;$+=2){const ce=$===1?-1/0:Q[$],Qe=Q[$+1],Me=$,Fe=$+1;if(typeof ce!="number")return M.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Me);if(F.length&&F[F.length-1][0]>=ce)return M.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Me);const Ze=M.parse(Qe,Fe,Y);if(!Ze)return null;Y=Y||Ze.type,F.push([ce,Ze])}return new iu(Y,V,F)}evaluate(Q){const M=this.labels,V=this.outputs;if(M.length===1)return V[0].evaluate(Q);const F=this.input.evaluate(Q);if(F<=M[0])return V[0].evaluate(Q);const Y=M.length;return F>=M[Y-1]?V[Y-1].evaluate(Q):V[L3(M,F)].evaluate(Q)}eachChild(Q){Q(this.input);for(const M of this.outputs)Q(M)}outputDefined(){return this.outputs.every(Q=>Q.outputDefined())}}function Li(S,Q,M){return S+M*(Q-S)}function i4(S,Q,M){return S.map((V,F)=>Li(V,Q[F],M))}const fc={number:Li,color:function(S,Q,M,V="rgb"){switch(V){case"rgb":{const[F,Y,$,ce]=i4(S.rgb,Q.rgb,M);return new dn(F,Y,$,ce,!1)}case"hcl":{const[F,Y,$,ce]=S.hcl,[Qe,Me,Fe,Ze]=Q.hcl;let tt,ut;if(isNaN(F)||isNaN(Qe))isNaN(F)?isNaN(Qe)?tt=NaN:(tt=Qe,$!==1&&$!==0||(ut=Me)):(tt=F,Fe!==1&&Fe!==0||(ut=Y));else{let rr=Qe-F;Qe>F&&rr>180?rr-=360:Qe<F&&F-Qe>180&&(rr+=360),tt=F+M*rr}const[dt,xt,Ot,Bt]=function([rr,Wt,ir,dr]){return rr=isNaN(rr)?0:rr*nr,yr([ir,Math.cos(rr)*Wt,Math.sin(rr)*Wt,dr])}([tt,ut??Li(Y,Me,M),Li($,Fe,M),Li(ce,Ze,M)]);return new dn(dt,xt,Ot,Bt,!1)}case"lab":{const[F,Y,$,ce]=yr(i4(S.lab,Q.lab,M));return new dn(F,Y,$,ce,!1)}}},array:i4,padding:function(S,Q,M){return new ni(i4(S.values,Q.values,M))},variableAnchorOffsetCollection:function(S,Q,M){const V=S.values,F=Q.values;if(V.length!==F.length)throw new ri(`Cannot interpolate values of different length. from: ${S.toString()}, to: ${Q.toString()}`);const Y=[];for(let $=0;$<V.length;$+=2){if(V[$]!==F[$])throw new ri(`Cannot interpolate values containing mismatched anchors. from[${$}]: ${V[$]}, to[${$}]: ${F[$]}`);Y.push(V[$]);const[ce,Qe]=V[$+1],[Me,Fe]=F[$+1];Y.push([Li(ce,Me,M),Li(Qe,Fe,M)])}return new si(Y)}};class mc{constructor(Q,M,V,F,Y){this.type=Q,this.operator=M,this.interpolation=V,this.input=F,this.labels=[],this.outputs=[];for(const[$,ce]of Y)this.labels.push($),this.outputs.push(ce)}static interpolationFactor(Q,M,V,F){let Y=0;if(Q.name==="exponential")Y=kf(M,Q.base,V,F);else if(Q.name==="linear")Y=kf(M,1,V,F);else if(Q.name==="cubic-bezier"){const $=Q.controlPoints;Y=new g($[0],$[1],$[2],$[3]).solve(kf(M,1,V,F))}return Y}static parse(Q,M){let[V,F,Y,...$]=Q;if(!Array.isArray(F)||F.length===0)return M.error("Expected an interpolation type expression.",1);if(F[0]==="linear")F={name:"linear"};else if(F[0]==="exponential"){const Me=F[1];if(typeof Me!="number")return M.error("Exponential interpolation requires a numeric base.",1,1);F={name:"exponential",base:Me}}else{if(F[0]!=="cubic-bezier")return M.error(`Unknown interpolation type ${String(F[0])}`,1,0);{const Me=F.slice(1);if(Me.length!==4||Me.some(Fe=>typeof Fe!="number"||Fe<0||Fe>1))return M.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);F={name:"cubic-bezier",controlPoints:Me}}}if(Q.length-1<4)return M.error(`Expected at least 4 arguments, but found only ${Q.length-1}.`);if((Q.length-1)%2!=0)return M.error("Expected an even number of arguments.");if(Y=M.parse(Y,2,Pt),!Y)return null;const ce=[];let Qe=null;V==="interpolate-hcl"||V==="interpolate-lab"?Qe=kt:M.expectedType&&M.expectedType.kind!=="value"&&(Qe=M.expectedType);for(let Me=0;Me<$.length;Me+=2){const Fe=$[Me],Ze=$[Me+1],tt=Me+3,ut=Me+4;if(typeof Fe!="number")return M.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',tt);if(ce.length&&ce[ce.length-1][0]>=Fe)return M.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',tt);const dt=M.parse(Ze,ut,Qe);if(!dt)return null;Qe=Qe||dt.type,ce.push([Fe,dt])}return Xe(Qe,Pt)||Xe(Qe,kt)||Xe(Qe,ke)||Xe(Qe,Ye)||Xe(Qe,ve(Pt))?new mc(Qe,V,F,Y,ce):M.error(`Type ${Ae(Qe)} is not interpolatable.`)}evaluate(Q){const M=this.labels,V=this.outputs;if(M.length===1)return V[0].evaluate(Q);const F=this.input.evaluate(Q);if(F<=M[0])return V[0].evaluate(Q);const Y=M.length;if(F>=M[Y-1])return V[Y-1].evaluate(Q);const $=L3(M,F),ce=mc.interpolationFactor(this.interpolation,F,M[$],M[$+1]),Qe=V[$].evaluate(Q),Me=V[$+1].evaluate(Q);switch(this.operator){case"interpolate":return fc[this.type.kind](Qe,Me,ce);case"interpolate-hcl":return fc.color(Qe,Me,ce,"hcl");case"interpolate-lab":return fc.color(Qe,Me,ce,"lab")}}eachChild(Q){Q(this.input);for(const M of this.outputs)Q(M)}outputDefined(){return this.outputs.every(Q=>Q.outputDefined())}}function kf(S,Q,M,V){const F=V-M,Y=S-M;return F===0?0:Q===1?Y/F:(Math.pow(Q,Y)-1)/(Math.pow(Q,F)-1)}class Mf{constructor(Q,M){this.type=Q,this.args=M}static parse(Q,M){if(Q.length<2)return M.error("Expectected at least one argument.");let V=null;const F=M.expectedType;F&&F.kind!=="value"&&(V=F);const Y=[];for(const ce of Q.slice(1)){const Qe=M.parse(ce,1+Y.length,V,void 0,{typeAnnotation:"omit"});if(!Qe)return null;V=V||Qe.type,Y.push(Qe)}if(!V)throw new Error("No output type");const $=F&&Y.some(ce=>Se(F,ce.type));return new Mf($?$t:V,Y)}evaluate(Q){let M,V=null,F=0;for(const Y of this.args)if(F++,V=Y.evaluate(Q),V&&V instanceof ii&&!V.available&&(M||(M=V.name),V=null,F===this.args.length&&(V=M)),V!==null)break;return V}eachChild(Q){this.args.forEach(Q)}outputDefined(){return this.args.every(Q=>Q.outputDefined())}}class y6{constructor(Q,M){this.type=M.type,this.bindings=[].concat(Q),this.result=M}evaluate(Q){return this.result.evaluate(Q)}eachChild(Q){for(const M of this.bindings)Q(M[1]);Q(this.result)}static parse(Q,M){if(Q.length<4)return M.error(`Expected at least 3 arguments, but found ${Q.length-1} instead.`);const V=[];for(let Y=1;Y<Q.length-1;Y+=2){const $=Q[Y];if(typeof $!="string")return M.error(`Expected string, but found ${typeof $} instead.`,Y);if(/[^a-zA-Z0-9_]/.test($))return M.error("Variable names must contain only alphanumeric characters or '_'.",Y);const ce=M.parse(Q[Y+1],Y+1);if(!ce)return null;V.push([$,ce])}const F=M.parse(Q[Q.length-1],Q.length-1,M.expectedType,V);return F?new y6(V,F):null}outputDefined(){return this.result.outputDefined()}}class u9{constructor(Q,M,V){this.type=Q,this.index=M,this.input=V}static parse(Q,M){if(Q.length!==3)return M.error(`Expected 2 arguments, but found ${Q.length-1} instead.`);const V=M.parse(Q[1],1,Pt),F=M.parse(Q[2],2,ve(M.expectedType||$t));return V&&F?new u9(F.type.itemType,V,F):null}evaluate(Q){const M=this.index.evaluate(Q),V=this.input.evaluate(Q);if(M<0)throw new ri(`Array index out of bounds: ${M} < 0.`);if(M>=V.length)throw new ri(`Array index out of bounds: ${M} > ${V.length-1}.`);if(M!==Math.floor(M))throw new ri(`Array index must be an integer, but found ${M} instead.`);return V[M]}eachChild(Q){Q(this.index),Q(this.input)}outputDefined(){return!1}}class Cf{constructor(Q,M){this.type=Et,this.needle=Q,this.haystack=M}static parse(Q,M){if(Q.length!==3)return M.error(`Expected 2 arguments, but found ${Q.length-1} instead.`);const V=M.parse(Q[1],1,$t),F=M.parse(Q[2],2,$t);return V&&F?ge(V.type,[Et,rt,Pt,Jt,$t])?new Cf(V,F):M.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(V.type)} instead`):null}evaluate(Q){const M=this.needle.evaluate(Q),V=this.haystack.evaluate(Q);if(!V)return!1;if(!Ce(M,["boolean","string","number","null"]))throw new ri(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(Qn(M))} instead.`);if(!Ce(V,["string","array"]))throw new ri(`Expected second argument to be of type array or string, but found ${Ae(Qn(V))} instead.`);return V.indexOf(M)>=0}eachChild(Q){Q(this.needle),Q(this.haystack)}outputDefined(){return!0}}class Ef{constructor(Q,M,V){this.type=Pt,this.needle=Q,this.haystack=M,this.fromIndex=V}static parse(Q,M){if(Q.length<=2||Q.length>=5)return M.error(`Expected 3 or 4 arguments, but found ${Q.length-1} instead.`);const V=M.parse(Q[1],1,$t),F=M.parse(Q[2],2,$t);if(!V||!F)return null;if(!ge(V.type,[Et,rt,Pt,Jt,$t]))return M.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(V.type)} instead`);if(Q.length===4){const Y=M.parse(Q[3],3,Pt);return Y?new Ef(V,F,Y):null}return new Ef(V,F)}evaluate(Q){const M=this.needle.evaluate(Q),V=this.haystack.evaluate(Q);if(!Ce(M,["boolean","string","number","null"]))throw new ri(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(Qn(M))} instead.`);if(!Ce(V,["string","array"]))throw new ri(`Expected second argument to be of type array or string, but found ${Ae(Qn(V))} instead.`);if(this.fromIndex){const F=this.fromIndex.evaluate(Q);return V.indexOf(M,F)}return V.indexOf(M)}eachChild(Q){Q(this.needle),Q(this.haystack),this.fromIndex&&Q(this.fromIndex)}outputDefined(){return!1}}class ou{constructor(Q,M,V,F,Y,$){this.inputType=Q,this.type=M,this.input=V,this.cases=F,this.outputs=Y,this.otherwise=$}static parse(Q,M){if(Q.length<5)return M.error(`Expected at least 4 arguments, but found only ${Q.length-1}.`);if(Q.length%2!=1)return M.error("Expected an even number of arguments.");let V,F;M.expectedType&&M.expectedType.kind!=="value"&&(F=M.expectedType);const Y={},$=[];for(let Me=2;Me<Q.length-1;Me+=2){let Fe=Q[Me];const Ze=Q[Me+1];Array.isArray(Fe)||(Fe=[Fe]);const tt=M.concat(Me);if(Fe.length===0)return tt.error("Expected at least one branch label.");for(const dt of Fe){if(typeof dt!="number"&&typeof dt!="string")return tt.error("Branch labels must be numbers or strings.");if(typeof dt=="number"&&Math.abs(dt)>Number.MAX_SAFE_INTEGER)return tt.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof dt=="number"&&Math.floor(dt)!==dt)return tt.error("Numeric branch labels must be integer values.");if(V){if(tt.checkSubtype(V,Qn(dt)))return null}else V=Qn(dt);if(Y[String(dt)]!==void 0)return tt.error("Branch labels must be unique.");Y[String(dt)]=$.length}const ut=M.parse(Ze,Me,F);if(!ut)return null;F=F||ut.type,$.push(ut)}const ce=M.parse(Q[1],1,$t);if(!ce)return null;const Qe=M.parse(Q[Q.length-1],Q.length-1,F);return Qe?ce.type.kind!=="value"&&M.concat(1).checkSubtype(V,ce.type)?null:new ou(V,F,ce,Y,$,Qe):null}evaluate(Q){const M=this.input.evaluate(Q);return(Qn(M)===this.inputType&&this.outputs[this.cases[M]]||this.otherwise).evaluate(Q)}eachChild(Q){Q(this.input),this.outputs.forEach(Q),Q(this.otherwise)}outputDefined(){return this.outputs.every(Q=>Q.outputDefined())&&this.otherwise.outputDefined()}}class au{constructor(Q,M,V){this.type=Q,this.branches=M,this.otherwise=V}static parse(Q,M){if(Q.length<4)return M.error(`Expected at least 3 arguments, but found only ${Q.length-1}.`);if(Q.length%2!=0)return M.error("Expected an odd number of arguments.");let V;M.expectedType&&M.expectedType.kind!=="value"&&(V=M.expectedType);const F=[];for(let $=1;$<Q.length-1;$+=2){const ce=M.parse(Q[$],$,Et);if(!ce)return null;const Qe=M.parse(Q[$+1],$+1,V);if(!Qe)return null;F.push([ce,Qe]),V=V||Qe.type}const Y=M.parse(Q[Q.length-1],Q.length-1,V);if(!Y)return null;if(!V)throw new Error("Can't infer output type");return new au(V,F,Y)}evaluate(Q){for(const[M,V]of this.branches)if(M.evaluate(Q))return V.evaluate(Q);return this.otherwise.evaluate(Q)}eachChild(Q){for(const[M,V]of this.branches)Q(M),Q(V);Q(this.otherwise)}outputDefined(){return this.branches.every(([Q,M])=>M.outputDefined())&&this.otherwise.outputDefined()}}class Af{constructor(Q,M,V,F){this.type=Q,this.input=M,this.beginIndex=V,this.endIndex=F}static parse(Q,M){if(Q.length<=2||Q.length>=5)return M.error(`Expected 3 or 4 arguments, but found ${Q.length-1} instead.`);const V=M.parse(Q[1],1,$t),F=M.parse(Q[2],2,Pt);if(!V||!F)return null;if(!ge(V.type,[ve($t),rt,$t]))return M.error(`Expected first argument to be of type array or string, but found ${Ae(V.type)} instead`);if(Q.length===4){const Y=M.parse(Q[3],3,Pt);return Y?new Af(V.type,V,F,Y):null}return new Af(V.type,V,F)}evaluate(Q){const M=this.input.evaluate(Q),V=this.beginIndex.evaluate(Q);if(!Ce(M,["string","array"]))throw new ri(`Expected first argument to be of type array or string, but found ${Ae(Qn(M))} instead.`);if(this.endIndex){const F=this.endIndex.evaluate(Q);return M.slice(V,F)}return M.slice(V)}eachChild(Q){Q(this.input),Q(this.beginIndex),this.endIndex&&Q(this.endIndex)}outputDefined(){return!1}}function eb(S,Q){return S==="=="||S==="!="?Q.kind==="boolean"||Q.kind==="string"||Q.kind==="number"||Q.kind==="null"||Q.kind==="value":Q.kind==="string"||Q.kind==="number"||Q.kind==="value"}function tb(S,Q,M,V){return V.compare(Q,M)===0}function S3(S,Q,M){const V=S!=="=="&&S!=="!=";return class MWe{constructor(Y,$,ce){this.type=Et,this.lhs=Y,this.rhs=$,this.collator=ce,this.hasUntypedArgument=Y.type.kind==="value"||$.type.kind==="value"}static parse(Y,$){if(Y.length!==3&&Y.length!==4)return $.error("Expected two or three arguments.");const ce=Y[0];let Qe=$.parse(Y[1],1,$t);if(!Qe)return null;if(!eb(ce,Qe.type))return $.concat(1).error(`"${ce}" comparisons are not supported for type '${Ae(Qe.type)}'.`);let Me=$.parse(Y[2],2,$t);if(!Me)return null;if(!eb(ce,Me.type))return $.concat(2).error(`"${ce}" comparisons are not supported for type '${Ae(Me.type)}'.`);if(Qe.type.kind!==Me.type.kind&&Qe.type.kind!=="value"&&Me.type.kind!=="value")return $.error(`Cannot compare types '${Ae(Qe.type)}' and '${Ae(Me.type)}'.`);V&&(Qe.type.kind==="value"&&Me.type.kind!=="value"?Qe=new na(Me.type,[Qe]):Qe.type.kind!=="value"&&Me.type.kind==="value"&&(Me=new na(Qe.type,[Me])));let Fe=null;if(Y.length===4){if(Qe.type.kind!=="string"&&Me.type.kind!=="string"&&Qe.type.kind!=="value"&&Me.type.kind!=="value")return $.error("Cannot use collator to compare non-string types.");if(Fe=$.parse(Y[3],3,wt),!Fe)return null}return new MWe(Qe,Me,Fe)}evaluate(Y){const $=this.lhs.evaluate(Y),ce=this.rhs.evaluate(Y);if(V&&this.hasUntypedArgument){const Qe=Qn($),Me=Qn(ce);if(Qe.kind!==Me.kind||Qe.kind!=="string"&&Qe.kind!=="number")throw new ri(`Expected arguments for "${S}" to be (string, string) or (number, number), but found (${Qe.kind}, ${Me.kind}) instead.`)}if(this.collator&&!V&&this.hasUntypedArgument){const Qe=Qn($),Me=Qn(ce);if(Qe.kind!=="string"||Me.kind!=="string")return Q(Y,$,ce)}return this.collator?M(Y,$,ce,this.collator.evaluate(Y)):Q(Y,$,ce)}eachChild(Y){Y(this.lhs),Y(this.rhs),this.collator&&Y(this.collator)}outputDefined(){return!0}}}const T6=S3("==",function(S,Q,M){return Q===M},tb),kM=S3("!=",function(S,Q,M){return Q!==M},function(S,Q,M,V){return!tb(0,Q,M,V)}),Of=S3("<",function(S,Q,M){return Q<M},function(S,Q,M,V){return V.compare(Q,M)<0}),Hf=S3(">",function(S,Q,M){return Q>M},function(S,Q,M,V){return V.compare(Q,M)>0}),d9=S3("<=",function(S,Q,M){return Q<=M},function(S,Q,M,V){return V.compare(Q,M)<=0}),Vf=S3(">=",function(S,Q,M){return Q>=M},function(S,Q,M,V){return V.compare(Q,M)>=0});class k3{constructor(Q,M,V,F,Y){this.type=rt,this.number=Q,this.locale=M,this.currency=V,this.minFractionDigits=F,this.maxFractionDigits=Y}static parse(Q,M){if(Q.length!==3)return M.error("Expected two arguments.");const V=M.parse(Q[1],1,Pt);if(!V)return null;const F=Q[2];if(typeof F!="object"||Array.isArray(F))return M.error("NumberFormat options argument must be an object.");let Y=null;if(F.locale&&(Y=M.parse(F.locale,1,rt),!Y))return null;let $=null;if(F.currency&&($=M.parse(F.currency,1,rt),!$))return null;let ce=null;if(F["min-fraction-digits"]&&(ce=M.parse(F["min-fraction-digits"],1,Pt),!ce))return null;let Qe=null;return F["max-fraction-digits"]&&(Qe=M.parse(F["max-fraction-digits"],1,Pt),!Qe)?null:new k3(V,Y,$,ce,Qe)}evaluate(Q){return new Intl.NumberFormat(this.locale?this.locale.evaluate(Q):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(Q):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(Q):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(Q):void 0}).format(this.number.evaluate(Q))}eachChild(Q){Q(this.number),this.locale&&Q(this.locale),this.currency&&Q(this.currency),this.minFractionDigits&&Q(this.minFractionDigits),this.maxFractionDigits&&Q(this.maxFractionDigits)}outputDefined(){return!1}}class su{constructor(Q){this.type=je,this.sections=Q}static parse(Q,M){if(Q.length<2)return M.error("Expected at least one argument.");const V=Q[1];if(!Array.isArray(V)&&typeof V=="object")return M.error("First argument must be an image or text section.");const F=[];let Y=!1;for(let $=1;$<=Q.length-1;++$){const ce=Q[$];if(Y&&typeof ce=="object"&&!Array.isArray(ce)){Y=!1;let Qe=null;if(ce["font-scale"]&&(Qe=M.parse(ce["font-scale"],1,Pt),!Qe))return null;let Me=null;if(ce["text-font"]&&(Me=M.parse(ce["text-font"],1,ve(rt)),!Me))return null;let Fe=null;if(ce["text-color"]&&(Fe=M.parse(ce["text-color"],1,kt),!Fe))return null;const Ze=F[F.length-1];Ze.scale=Qe,Ze.font=Me,Ze.textColor=Fe}else{const Qe=M.parse(Q[$],1,$t);if(!Qe)return null;const Me=Qe.type.kind;if(Me!=="string"&&Me!=="value"&&Me!=="null"&&Me!=="resolvedImage")return M.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Y=!0,F.push({content:Qe,scale:null,font:null,textColor:null})}}return new su(F)}evaluate(Q){return new cn(this.sections.map(M=>{const V=M.content.evaluate(Q);return Qn(V)===Oe?new Pn("",V,null,null,null):new Pn(jn(V),null,M.scale?M.scale.evaluate(Q):null,M.font?M.font.evaluate(Q).join(","):null,M.textColor?M.textColor.evaluate(Q):null)}))}eachChild(Q){for(const M of this.sections)Q(M.content),M.scale&&Q(M.scale),M.font&&Q(M.font),M.textColor&&Q(M.textColor)}outputDefined(){return!1}}class If{constructor(Q){this.type=Oe,this.input=Q}static parse(Q,M){if(Q.length!==2)return M.error("Expected two arguments.");const V=M.parse(Q[1],1,rt);return V?new If(V):M.error("No image name provided.")}evaluate(Q){const M=this.input.evaluate(Q),V=ii.fromString(M);return V&&Q.availableImages&&(V.available=Q.availableImages.indexOf(M)>-1),V}eachChild(Q){Q(this.input)}outputDefined(){return!1}}class v6{constructor(Q){this.type=Pt,this.input=Q}static parse(Q,M){if(Q.length!==2)return M.error(`Expected 1 argument, but found ${Q.length-1} instead.`);const V=M.parse(Q[1],1);return V?V.type.kind!=="array"&&V.type.kind!=="string"&&V.type.kind!=="value"?M.error(`Expected argument of type string or array, but found ${Ae(V.type)} instead.`):new v6(V):null}evaluate(Q){const M=this.input.evaluate(Q);if(typeof M=="string"||Array.isArray(M))return M.length;throw new ri(`Expected value to be of type string or array, but found ${Ae(Qn(M))} instead.`)}eachChild(Q){Q(this.input)}outputDefined(){return!1}}const o4={"==":T6,"!=":kM,">":Hf,"<":Of,">=":Vf,"<=":d9,array:na,at:u9,boolean:na,case:au,coalesce:Mf,collator:ar,format:su,image:If,in:Cf,"index-of":Ef,interpolate:mc,"interpolate-hcl":mc,"interpolate-lab":mc,length:v6,let:y6,literal:qa,match:ou,number:na,"number-format":k3,object:na,slice:Af,step:iu,string:na,"to-boolean":lt,"to-color":lt,"to-number":lt,"to-string":lt,var:is,within:qs};function Q6(S,[Q,M,V,F]){Q=Q.evaluate(S),M=M.evaluate(S),V=V.evaluate(S);const Y=F?F.evaluate(S):1,$=ra(Q,M,V,Y);if($)throw new ri($);return new dn(Q/255,M/255,V/255,Y,!1)}function rb(S,Q){return S in Q}function p9(S,Q){const M=Q[S];return M===void 0?null:M}function M3(S){return{type:S}}function h9(S){return{result:"success",value:S}}function zc(S){return{result:"error",value:S}}function a4(S){return S["property-type"]==="data-driven"||S["property-type"]==="cross-faded-data-driven"}function Pf(S){return!!S.expression&&S.expression.parameters.indexOf("zoom")>-1}function Nf(S){return!!S.expression&&S.expression.interpolated}function fi(S){return S instanceof Number?"number":S instanceof String?"string":S instanceof Boolean?"boolean":Array.isArray(S)?"array":S===null?"null":typeof S}function Co(S){return typeof S=="object"&&S!==null&&!Array.isArray(S)}function f9(S){return S}function Qi(S,Q){const M=Q.type==="color",V=S.stops&&typeof S.stops[0][0]=="object",F=V||!(V||S.property!==void 0),Y=S.type||(Nf(Q)?"exponential":"interval");if(M||Q.type==="padding"){const Fe=M?dn.parse:ni.parse;(S=ft({},S)).stops&&(S.stops=S.stops.map(Ze=>[Ze[0],Fe(Ze[1])])),S.default=Fe(S.default?S.default:Q.default)}if(S.colorSpace&&($=S.colorSpace)!=="rgb"&&$!=="hcl"&&$!=="lab")throw new Error(`Unknown color space: "${S.colorSpace}"`);var $;let ce,Qe,Me;if(Y==="exponential")ce=b6;else if(Y==="interval")ce=_o;else if(Y==="categorical"){ce=go,Qe=Object.create(null);for(const Fe of S.stops)Qe[Fe[0]]=Fe[1];Me=typeof S.stops[0][0]}else{if(Y!=="identity")throw new Error(`Unknown function type "${Y}"`);ce=nb}if(V){const Fe={},Ze=[];for(let dt=0;dt<S.stops.length;dt++){const xt=S.stops[dt],Ot=xt[0].zoom;Fe[Ot]===void 0&&(Fe[Ot]={zoom:Ot,type:S.type,property:S.property,default:S.default,stops:[]},Ze.push(Ot)),Fe[Ot].stops.push([xt[0].value,xt[1]])}const tt=[];for(const dt of Ze)tt.push([Fe[dt].zoom,Qi(Fe[dt],Q)]);const ut={name:"linear"};return{kind:"composite",interpolationType:ut,interpolationFactor:mc.interpolationFactor.bind(void 0,ut),zoomStops:tt.map(dt=>dt[0]),evaluate:({zoom:dt},xt)=>b6({stops:tt,base:S.base},Q,dt).evaluate(dt,xt)}}if(F){const Fe=Y==="exponential"?{name:"exponential",base:S.base!==void 0?S.base:1}:null;return{kind:"camera",interpolationType:Fe,interpolationFactor:mc.interpolationFactor.bind(void 0,Fe),zoomStops:S.stops.map(Ze=>Ze[0]),evaluate:({zoom:Ze})=>ce(S,Q,Ze,Qe,Me)}}return{kind:"source",evaluate(Fe,Ze){const tt=Ze&&Ze.properties?Ze.properties[S.property]:void 0;return tt===void 0?gc(S.default,Q.default):ce(S,Q,tt,Qe,Me)}}}function gc(S,Q,M){return S!==void 0?S:Q!==void 0?Q:M!==void 0?M:void 0}function go(S,Q,M,V,F){return gc(typeof M===F?V[M]:void 0,S.default,Q.default)}function _o(S,Q,M){if(fi(M)!=="number")return gc(S.default,Q.default);const V=S.stops.length;if(V===1||M<=S.stops[0][0])return S.stops[0][1];if(M>=S.stops[V-1][0])return S.stops[V-1][1];const F=L3(S.stops.map(Y=>Y[0]),M);return S.stops[F][1]}function b6(S,Q,M){const V=S.base!==void 0?S.base:1;if(fi(M)!=="number")return gc(S.default,Q.default);const F=S.stops.length;if(F===1||M<=S.stops[0][0])return S.stops[0][1];if(M>=S.stops[F-1][0])return S.stops[F-1][1];const Y=L3(S.stops.map(Fe=>Fe[0]),M),$=function(Fe,Ze,tt,ut){const dt=ut-tt,xt=Fe-tt;return dt===0?0:Ze===1?xt/dt:(Math.pow(Ze,xt)-1)/(Math.pow(Ze,dt)-1)}(M,V,S.stops[Y][0],S.stops[Y+1][0]),ce=S.stops[Y][1],Qe=S.stops[Y+1][1],Me=fc[Q.type]||f9;return typeof ce.evaluate=="function"?{evaluate(...Fe){const Ze=ce.evaluate.apply(void 0,Fe),tt=Qe.evaluate.apply(void 0,Fe);if(Ze!==void 0&&tt!==void 0)return Me(Ze,tt,$,S.colorSpace)}}:Me(ce,Qe,$,S.colorSpace)}function nb(S,Q,M){switch(Q.type){case"color":M=dn.parse(M);break;case"formatted":M=cn.fromString(M.toString());break;case"resolvedImage":M=ii.fromString(M.toString());break;case"padding":M=ni.parse(M);break;default:fi(M)===Q.type||Q.type==="enum"&&Q.values[M]||(M=void 0)}return gc(M,S.default,Q.default)}Mo.register(o4,{error:[{kind:"error"},[rt],(S,[Q])=>{throw new ri(Q.evaluate(S))}],typeof:[rt,[$t],(S,[Q])=>Ae(Qn(Q.evaluate(S)))],"to-rgba":[ve(Pt,4),[kt],(S,[Q])=>{const[M,V,F,Y]=Q.evaluate(S).rgb;return[255*M,255*V,255*F,Y]}],rgb:[kt,[Pt,Pt,Pt],Q6],rgba:[kt,[Pt,Pt,Pt,Pt],Q6],has:{type:Et,overloads:[[[rt],(S,[Q])=>rb(Q.evaluate(S),S.properties())],[[rt,or],(S,[Q,M])=>rb(Q.evaluate(S),M.evaluate(S))]]},get:{type:$t,overloads:[[[rt],(S,[Q])=>p9(Q.evaluate(S),S.properties())],[[rt,or],(S,[Q,M])=>p9(Q.evaluate(S),M.evaluate(S))]]},"feature-state":[$t,[rt],(S,[Q])=>p9(Q.evaluate(S),S.featureState||{})],properties:[or,[],S=>S.properties()],"geometry-type":[rt,[],S=>S.geometryType()],id:[$t,[],S=>S.id()],zoom:[Pt,[],S=>S.globals.zoom],"heatmap-density":[Pt,[],S=>S.globals.heatmapDensity||0],"line-progress":[Pt,[],S=>S.globals.lineProgress||0],accumulated:[$t,[],S=>S.globals.accumulated===void 0?null:S.globals.accumulated],"+":[Pt,M3(Pt),(S,Q)=>{let M=0;for(const V of Q)M+=V.evaluate(S);return M}],"*":[Pt,M3(Pt),(S,Q)=>{let M=1;for(const V of Q)M*=V.evaluate(S);return M}],"-":{type:Pt,overloads:[[[Pt,Pt],(S,[Q,M])=>Q.evaluate(S)-M.evaluate(S)],[[Pt],(S,[Q])=>-Q.evaluate(S)]]},"/":[Pt,[Pt,Pt],(S,[Q,M])=>Q.evaluate(S)/M.evaluate(S)],"%":[Pt,[Pt,Pt],(S,[Q,M])=>Q.evaluate(S)%M.evaluate(S)],ln2:[Pt,[],()=>Math.LN2],pi:[Pt,[],()=>Math.PI],e:[Pt,[],()=>Math.E],"^":[Pt,[Pt,Pt],(S,[Q,M])=>Math.pow(Q.evaluate(S),M.evaluate(S))],sqrt:[Pt,[Pt],(S,[Q])=>Math.sqrt(Q.evaluate(S))],log10:[Pt,[Pt],(S,[Q])=>Math.log(Q.evaluate(S))/Math.LN10],ln:[Pt,[Pt],(S,[Q])=>Math.log(Q.evaluate(S))],log2:[Pt,[Pt],(S,[Q])=>Math.log(Q.evaluate(S))/Math.LN2],sin:[Pt,[Pt],(S,[Q])=>Math.sin(Q.evaluate(S))],cos:[Pt,[Pt],(S,[Q])=>Math.cos(Q.evaluate(S))],tan:[Pt,[Pt],(S,[Q])=>Math.tan(Q.evaluate(S))],asin:[Pt,[Pt],(S,[Q])=>Math.asin(Q.evaluate(S))],acos:[Pt,[Pt],(S,[Q])=>Math.acos(Q.evaluate(S))],atan:[Pt,[Pt],(S,[Q])=>Math.atan(Q.evaluate(S))],min:[Pt,M3(Pt),(S,Q)=>Math.min(...Q.map(M=>M.evaluate(S)))],max:[Pt,M3(Pt),(S,Q)=>Math.max(...Q.map(M=>M.evaluate(S)))],abs:[Pt,[Pt],(S,[Q])=>Math.abs(Q.evaluate(S))],round:[Pt,[Pt],(S,[Q])=>{const M=Q.evaluate(S);return M<0?-Math.round(-M):Math.round(M)}],floor:[Pt,[Pt],(S,[Q])=>Math.floor(Q.evaluate(S))],ceil:[Pt,[Pt],(S,[Q])=>Math.ceil(Q.evaluate(S))],"filter-==":[Et,[rt,$t],(S,[Q,M])=>S.properties()[Q.value]===M.value],"filter-id-==":[Et,[$t],(S,[Q])=>S.id()===Q.value],"filter-type-==":[Et,[rt],(S,[Q])=>S.geometryType()===Q.value],"filter-<":[Et,[rt,$t],(S,[Q,M])=>{const V=S.properties()[Q.value],F=M.value;return typeof V==typeof F&&V<F}],"filter-id-<":[Et,[$t],(S,[Q])=>{const M=S.id(),V=Q.value;return typeof M==typeof V&&M<V}],"filter->":[Et,[rt,$t],(S,[Q,M])=>{const V=S.properties()[Q.value],F=M.value;return typeof V==typeof F&&V>F}],"filter-id->":[Et,[$t],(S,[Q])=>{const M=S.id(),V=Q.value;return typeof M==typeof V&&M>V}],"filter-<=":[Et,[rt,$t],(S,[Q,M])=>{const V=S.properties()[Q.value],F=M.value;return typeof V==typeof F&&V<=F}],"filter-id-<=":[Et,[$t],(S,[Q])=>{const M=S.id(),V=Q.value;return typeof M==typeof V&&M<=V}],"filter->=":[Et,[rt,$t],(S,[Q,M])=>{const V=S.properties()[Q.value],F=M.value;return typeof V==typeof F&&V>=F}],"filter-id->=":[Et,[$t],(S,[Q])=>{const M=S.id(),V=Q.value;return typeof M==typeof V&&M>=V}],"filter-has":[Et,[$t],(S,[Q])=>Q.value in S.properties()],"filter-has-id":[Et,[],S=>S.id()!==null&&S.id()!==void 0],"filter-type-in":[Et,[ve(rt)],(S,[Q])=>Q.value.indexOf(S.geometryType())>=0],"filter-id-in":[Et,[ve($t)],(S,[Q])=>Q.value.indexOf(S.id())>=0],"filter-in-small":[Et,[rt,ve($t)],(S,[Q,M])=>M.value.indexOf(S.properties()[Q.value])>=0],"filter-in-large":[Et,[rt,ve($t)],(S,[Q,M])=>function(V,F,Y,$){for(;Y<=$;){const ce=Y+$>>1;if(F[ce]===V)return!0;F[ce]>V?$=ce-1:Y=ce+1}return!1}(S.properties()[Q.value],M.value,0,M.value.length-1)],all:{type:Et,overloads:[[[Et,Et],(S,[Q,M])=>Q.evaluate(S)&&M.evaluate(S)],[M3(Et),(S,Q)=>{for(const M of Q)if(!M.evaluate(S))return!1;return!0}]]},any:{type:Et,overloads:[[[Et,Et],(S,[Q,M])=>Q.evaluate(S)||M.evaluate(S)],[M3(Et),(S,Q)=>{for(const M of Q)if(M.evaluate(S))return!0;return!1}]]},"!":[Et,[Et],(S,[Q])=>!Q.evaluate(S)],"is-supported-script":[Et,[rt],(S,[Q])=>{const M=S.globals&&S.globals.isSupportedScript;return!M||M(Q.evaluate(S))}],upcase:[rt,[rt],(S,[Q])=>Q.evaluate(S).toUpperCase()],downcase:[rt,[rt],(S,[Q])=>Q.evaluate(S).toLowerCase()],concat:[rt,M3($t),(S,Q)=>Q.map(M=>jn(M.evaluate(S))).join("")],"resolved-locale":[rt,[wt],(S,[Q])=>Q.evaluate(S).resolvedLocale()]});class m9{constructor(Q,M){var V;this.expression=Q,this._warningHistory={},this._evaluator=new Mt,this._defaultValue=M?(V=M).type==="color"&&Co(V.default)?new dn(0,0,0,0):V.type==="color"?dn.parse(V.default)||null:V.type==="padding"?ni.parse(V.default)||null:V.type==="variableAnchorOffsetCollection"?si.parse(V.default)||null:V.default===void 0?null:V.default:null,this._enumValues=M&&M.type==="enum"?M.values:null}evaluateWithoutErrorHandling(Q,M,V,F,Y,$){return this._evaluator.globals=Q,this._evaluator.feature=M,this._evaluator.featureState=V,this._evaluator.canonical=F,this._evaluator.availableImages=Y||null,this._evaluator.formattedSection=$,this.expression.evaluate(this._evaluator)}evaluate(Q,M,V,F,Y,$){this._evaluator.globals=Q,this._evaluator.feature=M||null,this._evaluator.featureState=V||null,this._evaluator.canonical=F,this._evaluator.availableImages=Y||null,this._evaluator.formattedSection=$||null;try{const ce=this.expression.evaluate(this._evaluator);if(ce==null||typeof ce=="number"&&ce!=ce)return this._defaultValue;if(this._enumValues&&!(ce in this._enumValues))throw new ri(`Expected value to be one of ${Object.keys(this._enumValues).map(Qe=>JSON.stringify(Qe)).join(", ")}, but found ${JSON.stringify(ce)} instead.`);return ce}catch(ce){return this._warningHistory[ce.message]||(this._warningHistory[ce.message]=!0,typeof console<"u"&&console.warn(ce.message)),this._defaultValue}}}function x6(S){return Array.isArray(S)&&S.length>0&&typeof S[0]=="string"&&S[0]in o4}function _6(S,Q){const M=new Rt(o4,dl,[],Q?function(F){const Y={color:kt,string:rt,number:Pt,enum:rt,boolean:Et,formatted:je,padding:ke,resolvedImage:Oe,variableAnchorOffsetCollection:Ye};return F.type==="array"?ve(Y[F.value]||$t,F.length):Y[F.type]}(Q):void 0),V=M.parse(S,void 0,void 0,void 0,Q&&Q.type==="string"?{typeAnnotation:"coerce"}:void 0);return V?h9(new m9(V,Q)):zc(M.errors)}class g9{constructor(Q,M){this.kind=Q,this._styleExpression=M,this.isStateDependent=Q!=="constant"&&!h1(M.expression)}evaluateWithoutErrorHandling(Q,M,V,F,Y,$){return this._styleExpression.evaluateWithoutErrorHandling(Q,M,V,F,Y,$)}evaluate(Q,M,V,F,Y,$){return this._styleExpression.evaluate(Q,M,V,F,Y,$)}}class Bf{constructor(Q,M,V,F){this.kind=Q,this.zoomStops=V,this._styleExpression=M,this.isStateDependent=Q!=="camera"&&!h1(M.expression),this.interpolationType=F}evaluateWithoutErrorHandling(Q,M,V,F,Y,$){return this._styleExpression.evaluateWithoutErrorHandling(Q,M,V,F,Y,$)}evaluate(Q,M,V,F,Y,$){return this._styleExpression.evaluate(Q,M,V,F,Y,$)}interpolationFactor(Q,M,V){return this.interpolationType?mc.interpolationFactor(this.interpolationType,Q,M,V):0}}function y9(S,Q){const M=_6(S,Q);if(M.result==="error")return M;const V=M.value.expression,F=G2(V);if(!F&&!a4(Q))return zc([new St("","data expressions not supported")]);const Y=l2(V,["zoom"]);if(!Y&&!Pf(Q))return zc([new St("","zoom expressions not supported")]);const $=L6(V);return $||Y?$ instanceof St?zc([$]):$ instanceof mc&&!Nf(Q)?zc([new St("",'"interpolate" expressions cannot be used with this property')]):h9($?new Bf(F?"camera":"composite",M.value,$.labels,$ instanceof mc?$.interpolation:void 0):new g9(F?"constant":"source",M.value)):zc([new St("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class w6{constructor(Q,M){this._parameters=Q,this._specification=M,ft(this,Qi(this._parameters,this._specification))}static deserialize(Q){return new w6(Q._parameters,Q._specification)}static serialize(Q){return{_parameters:Q._parameters,_specification:Q._specification}}}function L6(S){let Q=null;if(S instanceof y6)Q=L6(S.result);else if(S instanceof Mf){for(const M of S.args)if(Q=L6(M),Q)break}else(S instanceof iu||S instanceof mc)&&S.input instanceof Mo&&S.input.name==="zoom"&&(Q=S);return Q instanceof St||S.eachChild(M=>{const V=L6(M);V instanceof St?Q=V:!Q&&V?Q=new St("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):Q&&V&&Q!==V&&(Q=new St("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),Q}function S6(S){if(S===!0||S===!1)return!0;if(!Array.isArray(S)||S.length===0)return!1;switch(S[0]){case"has":return S.length>=2&&S[1]!=="$id"&&S[1]!=="$type";case"in":return S.length>=3&&(typeof S[1]!="string"||Array.isArray(S[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return S.length!==3||Array.isArray(S[1])||Array.isArray(S[2]);case"any":case"all":for(const Q of S.slice(1))if(!S6(Q)&&typeof Q!="boolean")return!1;return!0;default:return!0}}const MM={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function T9(S){if(S==null)return{filter:()=>!0,needGeometry:!1};S6(S)||(S=Rf(S));const Q=_6(S,MM);if(Q.result==="error")throw new Error(Q.value.map(M=>`${M.key}: ${M.message}`).join(", "));return{filter:(M,V,F)=>Q.value.evaluate(M,V,{},F),needGeometry:ib(S)}}function CM(S,Q){return S<Q?-1:S>Q?1:0}function ib(S){if(!Array.isArray(S))return!1;if(S[0]==="within")return!0;for(let Q=1;Q<S.length;Q++)if(ib(S[Q]))return!0;return!1}function Rf(S){if(!S)return!0;const Q=S[0];return S.length<=1?Q!=="any":Q==="=="?v9(S[1],S[2],"=="):Q==="!="?s4(v9(S[1],S[2],"==")):Q==="<"||Q===">"||Q==="<="||Q===">="?v9(S[1],S[2],Q):Q==="any"?(M=S.slice(1),["any"].concat(M.map(Rf))):Q==="all"?["all"].concat(S.slice(1).map(Rf)):Q==="none"?["all"].concat(S.slice(1).map(Rf).map(s4)):Q==="in"?ob(S[1],S.slice(2)):Q==="!in"?s4(ob(S[1],S.slice(2))):Q==="has"?Q9(S[1]):Q==="!has"?s4(Q9(S[1])):Q!=="within"||S;var M}function v9(S,Q,M){switch(S){case"$type":return[`filter-type-${M}`,Q];case"$id":return[`filter-id-${M}`,Q];default:return[`filter-${M}`,S,Q]}}function ob(S,Q){if(Q.length===0)return!1;switch(S){case"$type":return["filter-type-in",["literal",Q]];case"$id":return["filter-id-in",["literal",Q]];default:return Q.length>200&&!Q.some(M=>typeof M!=typeof Q[0])?["filter-in-large",S,["literal",Q.sort(CM)]]:["filter-in-small",S,["literal",Q]]}}function Q9(S){switch(S){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",S]}}function s4(S){return["!",S]}function k6(S){const Q=typeof S;if(Q==="number"||Q==="boolean"||Q==="string"||S==null)return JSON.stringify(S);if(Array.isArray(S)){let F="[";for(const Y of S)F+=`${k6(Y)},`;return`${F}]`}const M=Object.keys(S).sort();let V="{";for(let F=0;F<M.length;F++)V+=`${JSON.stringify(M[F])}:${k6(S[M[F]])},`;return`${V}}`}function M6(S){let Q="";for(const M of pt)Q+=`/${k6(S[M])}`;return Q}function ab(S){const Q=S.value;return Q?[new Je(S.key,Q,"constants have been deprecated as of v8")]:[]}function jo(S){return S instanceof Number||S instanceof String||S instanceof Boolean?S.valueOf():S}function jc(S){if(Array.isArray(S))return S.map(jc);if(S instanceof Object&&!(S instanceof Number||S instanceof String||S instanceof Boolean)){const Q={};for(const M in S)Q[M]=jc(S[M]);return Q}return jo(S)}function Vl(S){const Q=S.key,M=S.value,V=S.valueSpec||{},F=S.objectElementValidators||{},Y=S.style,$=S.styleSpec,ce=S.validateSpec;let Qe=[];const Me=fi(M);if(Me!=="object")return[new Je(Q,M,`object expected, ${Me} found`)];for(const Fe in M){const Ze=Fe.split(".")[0],tt=V[Ze]||V["*"];let ut;if(F[Ze])ut=F[Ze];else if(V[Ze])ut=ce;else if(F["*"])ut=F["*"];else{if(!V["*"]){Qe.push(new Je(Q,M[Fe],`unknown property "${Fe}"`));continue}ut=ce}Qe=Qe.concat(ut({key:(Q&&`${Q}.`)+Fe,value:M[Fe],valueSpec:tt,style:Y,styleSpec:$,object:M,objectKey:Fe,validateSpec:ce},M))}for(const Fe in V)F[Fe]||V[Fe].required&&V[Fe].default===void 0&&M[Fe]===void 0&&Qe.push(new Je(Q,M,`missing required property "${Fe}"`));return Qe}function l4(S){const Q=S.value,M=S.valueSpec,V=S.style,F=S.styleSpec,Y=S.key,$=S.arrayElementValidator||S.validateSpec;if(fi(Q)!=="array")return[new Je(Y,Q,`array expected, ${fi(Q)} found`)];if(M.length&&Q.length!==M.length)return[new Je(Y,Q,`array length ${M.length} expected, length ${Q.length} found`)];if(M["min-length"]&&Q.length<M["min-length"])return[new Je(Y,Q,`array length at least ${M["min-length"]} expected, length ${Q.length} found`)];let ce={type:M.value,values:M.values};F.$version<7&&(ce.function=M.function),fi(M.value)==="object"&&(ce=M.value);let Qe=[];for(let Me=0;Me<Q.length;Me++)Qe=Qe.concat($({array:Q,arrayIndex:Me,value:Q[Me],valueSpec:ce,validateSpec:S.validateSpec,style:V,styleSpec:F,key:`${Y}[${Me}]`}));return Qe}function C6(S){const Q=S.key,M=S.value,V=S.valueSpec;let F=fi(M);return F==="number"&&M!=M&&(F="NaN"),F!=="number"?[new Je(Q,M,`number expected, ${F} found`)]:"minimum"in V&&M<V.minimum?[new Je(Q,M,`${M} is less than the minimum value ${V.minimum}`)]:"maximum"in V&&M>V.maximum?[new Je(Q,M,`${M} is greater than the maximum value ${V.maximum}`)]:[]}function Ff(S){const Q=S.valueSpec,M=jo(S.value.type);let V,F,Y,$={};const ce=M!=="categorical"&&S.value.property===void 0,Qe=!ce,Me=fi(S.value.stops)==="array"&&fi(S.value.stops[0])==="array"&&fi(S.value.stops[0][0])==="object",Fe=Vl({key:S.key,value:S.value,valueSpec:S.styleSpec.function,validateSpec:S.validateSpec,style:S.style,styleSpec:S.styleSpec,objectElementValidators:{stops:function(ut){if(M==="identity")return[new Je(ut.key,ut.value,'identity function may not have a "stops" property')];let dt=[];const xt=ut.value;return dt=dt.concat(l4({key:ut.key,value:xt,valueSpec:ut.valueSpec,validateSpec:ut.validateSpec,style:ut.style,styleSpec:ut.styleSpec,arrayElementValidator:Ze})),fi(xt)==="array"&&xt.length===0&&dt.push(new Je(ut.key,xt,"array must have at least one stop")),dt},default:function(ut){return ut.validateSpec({key:ut.key,value:ut.value,valueSpec:Q,validateSpec:ut.validateSpec,style:ut.style,styleSpec:ut.styleSpec})}}});return M==="identity"&&ce&&Fe.push(new Je(S.key,S.value,'missing required property "property"')),M==="identity"||S.value.stops||Fe.push(new Je(S.key,S.value,'missing required property "stops"')),M==="exponential"&&S.valueSpec.expression&&!Nf(S.valueSpec)&&Fe.push(new Je(S.key,S.value,"exponential functions not supported")),S.styleSpec.$version>=8&&(Qe&&!a4(S.valueSpec)?Fe.push(new Je(S.key,S.value,"property functions not supported")):ce&&!Pf(S.valueSpec)&&Fe.push(new Je(S.key,S.value,"zoom functions not supported"))),M!=="categorical"&&!Me||S.value.property!==void 0||Fe.push(new Je(S.key,S.value,'"property" property is required')),Fe;function Ze(ut){let dt=[];const xt=ut.value,Ot=ut.key;if(fi(xt)!=="array")return[new Je(Ot,xt,`array expected, ${fi(xt)} found`)];if(xt.length!==2)return[new Je(Ot,xt,`array length 2 expected, length ${xt.length} found`)];if(Me){if(fi(xt[0])!=="object")return[new Je(Ot,xt,`object expected, ${fi(xt[0])} found`)];if(xt[0].zoom===void 0)return[new Je(Ot,xt,"object stop key must have zoom")];if(xt[0].value===void 0)return[new Je(Ot,xt,"object stop key must have value")];if(Y&&Y>jo(xt[0].zoom))return[new Je(Ot,xt[0].zoom,"stop zoom values must appear in ascending order")];jo(xt[0].zoom)!==Y&&(Y=jo(xt[0].zoom),F=void 0,$={}),dt=dt.concat(Vl({key:`${Ot}[0]`,value:xt[0],valueSpec:{zoom:{}},validateSpec:ut.validateSpec,style:ut.style,styleSpec:ut.styleSpec,objectElementValidators:{zoom:C6,value:tt}}))}else dt=dt.concat(tt({key:`${Ot}[0]`,value:xt[0],valueSpec:{},validateSpec:ut.validateSpec,style:ut.style,styleSpec:ut.styleSpec},xt));return x6(jc(xt[1]))?dt.concat([new Je(`${Ot}[1]`,xt[1],"expressions are not allowed in function stops.")]):dt.concat(ut.validateSpec({key:`${Ot}[1]`,value:xt[1],valueSpec:Q,validateSpec:ut.validateSpec,style:ut.style,styleSpec:ut.styleSpec}))}function tt(ut,dt){const xt=fi(ut.value),Ot=jo(ut.value),Bt=ut.value!==null?ut.value:dt;if(V){if(xt!==V)return[new Je(ut.key,Bt,`${xt} stop domain type must match previous stop domain type ${V}`)]}else V=xt;if(xt!=="number"&&xt!=="string"&&xt!=="boolean")return[new Je(ut.key,Bt,"stop domain value must be a number, string, or boolean")];if(xt!=="number"&&M!=="categorical"){let rr=`number expected, ${xt} found`;return a4(Q)&&M===void 0&&(rr+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Je(ut.key,Bt,rr)]}return M!=="categorical"||xt!=="number"||isFinite(Ot)&&Math.floor(Ot)===Ot?M!=="categorical"&&xt==="number"&&F!==void 0&&Ot<F?[new Je(ut.key,Bt,"stop domain values must appear in ascending order")]:(F=Ot,M==="categorical"&&Ot in $?[new Je(ut.key,Bt,"stop domain values must be unique")]:($[Ot]=!0,[])):[new Je(ut.key,Bt,`integer expected, found ${Ot}`)]}}function lu(S){const Q=(S.expressionContext==="property"?y9:_6)(jc(S.value),S.valueSpec);if(Q.result==="error")return Q.value.map(V=>new Je(`${S.key}${V.key}`,S.value,V.message));const M=Q.value.expression||Q.value._styleExpression.expression;if(S.expressionContext==="property"&&S.propertyKey==="text-font"&&!M.outputDefined())return[new Je(S.key,S.value,`Invalid data expression for "${S.propertyKey}". Output values must be contained as literals within the expression.`)];if(S.expressionContext==="property"&&S.propertyType==="layout"&&!h1(M))return[new Je(S.key,S.value,'"feature-state" data expressions are not supported with layout properties.')];if(S.expressionContext==="filter"&&!h1(M))return[new Je(S.key,S.value,'"feature-state" data expressions are not supported with filters.')];if(S.expressionContext&&S.expressionContext.indexOf("cluster")===0){if(!l2(M,["zoom","feature-state"]))return[new Je(S.key,S.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(S.expressionContext==="cluster-initial"&&!G2(M))return[new Je(S.key,S.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function E6(S){const Q=S.key,M=S.value,V=S.valueSpec,F=[];return Array.isArray(V.values)?V.values.indexOf(jo(M))===-1&&F.push(new Je(Q,M,`expected one of [${V.values.join(", ")}], ${JSON.stringify(M)} found`)):Object.keys(V.values).indexOf(jo(M))===-1&&F.push(new Je(Q,M,`expected one of [${Object.keys(V.values).join(", ")}], ${JSON.stringify(M)} found`)),F}function c4(S){return S6(jc(S.value))?lu(ft({},S,{expressionContext:"filter",valueSpec:{value:"boolean"}})):sb(S)}function sb(S){const Q=S.value,M=S.key;if(fi(Q)!=="array")return[new Je(M,Q,`array expected, ${fi(Q)} found`)];const V=S.styleSpec;let F,Y=[];if(Q.length<1)return[new Je(M,Q,"filter array must have at least 1 element")];switch(Y=Y.concat(E6({key:`${M}[0]`,value:Q[0],valueSpec:V.filter_operator,style:S.style,styleSpec:S.styleSpec})),jo(Q[0])){case"<":case"<=":case">":case">=":Q.length>=2&&jo(Q[1])==="$type"&&Y.push(new Je(M,Q,`"$type" cannot be use with operator "${Q[0]}"`));case"==":case"!=":Q.length!==3&&Y.push(new Je(M,Q,`filter array for operator "${Q[0]}" must have 3 elements`));case"in":case"!in":Q.length>=2&&(F=fi(Q[1]),F!=="string"&&Y.push(new Je(`${M}[1]`,Q[1],`string expected, ${F} found`)));for(let $=2;$<Q.length;$++)F=fi(Q[$]),jo(Q[1])==="$type"?Y=Y.concat(E6({key:`${M}[${$}]`,value:Q[$],valueSpec:V.geometry_type,style:S.style,styleSpec:S.styleSpec})):F!=="string"&&F!=="number"&&F!=="boolean"&&Y.push(new Je(`${M}[${$}]`,Q[$],`string, number, or boolean expected, ${F} found`));break;case"any":case"all":case"none":for(let $=1;$<Q.length;$++)Y=Y.concat(sb({key:`${M}[${$}]`,value:Q[$],style:S.style,styleSpec:S.styleSpec}));break;case"has":case"!has":F=fi(Q[1]),Q.length!==2?Y.push(new Je(M,Q,`filter array for "${Q[0]}" operator must have 2 elements`)):F!=="string"&&Y.push(new Je(`${M}[1]`,Q[1],`string expected, ${F} found`));break;case"within":F=fi(Q[1]),Q.length!==2?Y.push(new Je(M,Q,`filter array for "${Q[0]}" operator must have 2 elements`)):F!=="object"&&Y.push(new Je(`${M}[1]`,Q[1],`object expected, ${F} found`))}return Y}function b9(S,Q){const M=S.key,V=S.validateSpec,F=S.style,Y=S.styleSpec,$=S.value,ce=S.objectKey,Qe=Y[`${Q}_${S.layerType}`];if(!Qe)return[];const Me=ce.match(/^(.*)-transition$/);if(Q==="paint"&&Me&&Qe[Me[1]]&&Qe[Me[1]].transition)return V({key:M,value:$,valueSpec:Y.transition,style:F,styleSpec:Y});const Fe=S.valueSpec||Qe[ce];if(!Fe)return[new Je(M,$,`unknown property "${ce}"`)];let Ze;if(fi($)==="string"&&a4(Fe)&&!Fe.tokens&&(Ze=/^{([^}]+)}$/.exec($)))return[new Je(M,$,`"${ce}" does not support interpolation syntax
442
+ `,g0t=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function y0t(e){const t=window.getComputedStyle(e),r=t.getPropertyValue("box-sizing"),n=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),i=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:g0t.map(o=>`${o}:${t.getPropertyValue(o)}`).join(";"),paddingSize:n,borderSize:i,boxSizing:r}}function p3e(e,t=1,r){var n;xu||(xu=document.createElement("textarea"),document.body.appendChild(xu));const{paddingSize:i,borderSize:o,boxSizing:s,contextStyle:l}=y0t(e);xu.setAttribute("style",`${l};${m0t}`),xu.value=e.value||e.placeholder||"";let c=xu.scrollHeight;const u={};s==="border-box"?c=c+o:s==="content-box"&&(c=c-i),xu.value="";const d=xu.scrollHeight-i;if(Ys(t)){let p=d*t;s==="border-box"&&(p=p+i+o),c=Math.max(p,c),u.minHeight=`${p}px`}if(Ys(r)){let p=d*r;s==="border-box"&&(p=p+i+o),c=Math.min(p,c)}return u.height=`${c}px`,(n=xu.parentNode)==null||n.removeChild(xu),xu=void 0,u}const T0t=Lo({id:{type:String,default:void 0},size:E8,disabled:Boolean,modelValue:{type:mi([String,Number,Object]),default:""},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:mi([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},suffixIcon:{type:lh},prefixIcon:{type:lh},containerRole:{type:String,default:void 0},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:mi([Object,Array,String]),default:()=>sg({})},autofocus:{type:Boolean,default:!1}}),v0t={[ss]:e=>Js(e),input:e=>Js(e),change:e=>Js(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},Q0t=["role"],b0t=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus"],x0t=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus"],_0t=a.defineComponent({name:"ElInput",inheritAttrs:!1}),w0t=a.defineComponent({..._0t,props:T0t,emits:v0t,setup(e,{expose:t,emit:r}){const n=e,i=a.useAttrs(),o=a.useSlots(),s=a.computed(()=>{const xe={};return n.containerRole==="combobox"&&(xe["aria-haspopup"]=i["aria-haspopup"],xe["aria-owns"]=i["aria-owns"],xe["aria-expanded"]=i["aria-expanded"]),xe}),l=a.computed(()=>[n.type==="textarea"?T.b():g.b(),g.m(f.value),g.is("disabled",m.value),g.is("exceed",he.value),{[g.b("group")]:o.prepend||o.append,[g.bm("group","append")]:o.append,[g.bm("group","prepend")]:o.prepend,[g.m("prefix")]:o.prefix||n.prefixIcon,[g.m("suffix")]:o.suffix||n.suffixIcon||n.clearable||n.showPassword,[g.bm("suffix","password-clear")]:U.value&&X.value},i.class]),c=a.computed(()=>[g.e("wrapper"),g.is("focus",O.value)]),u=R1t({excludeKeys:a.computed(()=>Object.keys(s.value))}),{form:d,formItem:p}=dh(),{inputId:h}=gx(n,{formItemContext:p}),f=uh(),m=mg(),g=li("input"),T=li("textarea"),y=a.shallowRef(),v=a.shallowRef(),_=a.ref(!1),b=a.ref(!1),L=a.ref(!1),w=a.ref(),k=a.shallowRef(n.inputStyle),C=a.computed(()=>y.value||v.value),{wrapperRef:A,isFocused:O,handleFocus:N,handleBlur:I}=u3e(C,{afterBlur(){var xe;n.validateEvent&&((xe=p==null?void 0:p.validate)==null||xe.call(p,"blur").catch(Ue=>$s(Ue)))}}),R=a.computed(()=>{var xe;return(xe=d==null?void 0:d.statusIcon)!=null?xe:!1}),D=a.computed(()=>(p==null?void 0:p.validateState)||""),j=a.computed(()=>D.value&&kue[D.value]),G=a.computed(()=>L.value?C1t:w1t),P=a.computed(()=>[i.style,n.inputStyle]),W=a.computed(()=>[n.inputStyle,k.value,{resize:n.resize}]),K=a.computed(()=>oh(n.modelValue)?"":String(n.modelValue)),U=a.computed(()=>n.clearable&&!m.value&&!n.readonly&&!!K.value&&(O.value||_.value)),X=a.computed(()=>n.showPassword&&!m.value&&!n.readonly&&!!K.value&&(!!K.value||O.value)),ee=a.computed(()=>n.showWordLimit&&!!u.value.maxlength&&(n.type==="text"||n.type==="textarea")&&!m.value&&!n.readonly&&!n.showPassword),oe=a.computed(()=>K.value.length),he=a.computed(()=>!!ee.value&&oe.value>Number(u.value.maxlength)),me=a.computed(()=>!!o.suffix||!!n.suffixIcon||U.value||n.showPassword||ee.value||!!D.value&&R.value),[ie,be]=a0t(y);zC(v,xe=>{if(ue(),!ee.value||n.resize!=="both")return;const Ue=xe[0],{width:$e}=Ue.contentRect;w.value={right:`calc(100% - ${$e+15+6}px)`}});const re=()=>{const{type:xe,autosize:Ue}=n;if(!(!Xs||xe!=="textarea"||!v.value))if(Ue){const $e=Sc(Ue)?Ue.minRows:void 0,at=Sc(Ue)?Ue.maxRows:void 0,Ht=p3e(v.value,$e,at);k.value={overflowY:"hidden",...Ht},a.nextTick(()=>{v.value.offsetHeight,k.value=Ht})}else k.value={minHeight:p3e(v.value).minHeight}},ue=(xe=>{let Ue=!1;return()=>{var $e;Ue||!n.autosize||(($e=v.value)==null?void 0:$e.offsetParent)===null||(xe(),Ue=!0)}})(re),ne=()=>{const xe=C.value,Ue=n.formatter?n.formatter(K.value):K.value;!xe||xe.value===Ue||(xe.value=Ue)},ye=async xe=>{ie();let{value:Ue}=xe.target;if(n.formatter&&(Ue=n.parser?n.parser(Ue):Ue),!b.value){if(Ue===K.value){ne();return}r(ss,Ue),r("input",Ue),await a.nextTick(),ne(),be()}},_e=xe=>{r("change",xe.target.value)},Ie=xe=>{r("compositionstart",xe),b.value=!0},qe=xe=>{var Ue;r("compositionupdate",xe);const $e=(Ue=xe.target)==null?void 0:Ue.value,at=$e[$e.length-1]||"";b.value=!Mue(at)},Ge=xe=>{r("compositionend",xe),b.value&&(b.value=!1,ye(xe))},et=()=>{L.value=!L.value,Ve()},Ve=async()=>{var xe;await a.nextTick(),(xe=C.value)==null||xe.focus()},Ne=()=>{var xe;return(xe=C.value)==null?void 0:xe.blur()},it=xe=>{_.value=!1,r("mouseleave",xe)},Re=xe=>{_.value=!0,r("mouseenter",xe)},pt=xe=>{r("keydown",xe)},yt=()=>{var xe;(xe=C.value)==null||xe.select()},ct=()=>{r(ss,""),r("change",""),r("clear"),r("input","")};return a.watch(()=>n.modelValue,()=>{var xe;a.nextTick(()=>re()),n.validateEvent&&((xe=p==null?void 0:p.validate)==null||xe.call(p,"change").catch(Ue=>$s(Ue)))}),a.watch(K,()=>ne()),a.watch(()=>n.type,async()=>{await a.nextTick(),ne(),re()}),a.onMounted(()=>{!n.formatter&&n.parser&&$s("ElInput","If you set the parser, you also need to set the formatter."),ne(),a.nextTick(re)}),t({input:y,textarea:v,ref:C,textareaStyle:W,autosize:a.toRef(n,"autosize"),focus:Ve,blur:Ne,select:yt,clear:ct,resizeTextarea:re}),(xe,Ue)=>a.withDirectives((a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(s),{class:a.unref(l),style:a.unref(P),role:xe.containerRole,onMouseenter:Re,onMouseleave:it}),[a.createCommentVNode(" input "),xe.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),xe.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(g).be("group","prepend"))},[a.renderSlot(xe.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:A,class:a.normalizeClass(a.unref(c))},[a.createCommentVNode(" prefix slot "),xe.$slots.prefix||xe.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(g).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(g).e("prefix-inner"))},[a.renderSlot(xe.$slots,"prefix"),xe.prefixIcon?(a.openBlock(),a.createBlock(a.unref(ql),{key:0,class:a.normalizeClass(a.unref(g).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(xe.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(h),ref_key:"input",ref:y,class:a.unref(g).e("inner")},a.unref(u),{type:xe.showPassword?L.value?"text":"password":xe.type,disabled:a.unref(m),formatter:xe.formatter,parser:xe.parser,readonly:xe.readonly,autocomplete:xe.autocomplete,tabindex:xe.tabindex,"aria-label":xe.label,placeholder:xe.placeholder,style:xe.inputStyle,form:n.form,autofocus:n.autofocus,onCompositionstart:Ie,onCompositionupdate:qe,onCompositionend:Ge,onInput:ye,onFocus:Ue[0]||(Ue[0]=(...$e)=>a.unref(N)&&a.unref(N)(...$e)),onBlur:Ue[1]||(Ue[1]=(...$e)=>a.unref(I)&&a.unref(I)(...$e)),onChange:_e,onKeydown:pt}),null,16,b0t),a.createCommentVNode(" suffix slot "),a.unref(me)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(g).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(g).e("suffix-inner"))},[!a.unref(U)||!a.unref(X)||!a.unref(ee)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(xe.$slots,"suffix"),xe.suffixIcon?(a.openBlock(),a.createBlock(a.unref(ql),{key:0,class:a.normalizeClass(a.unref(g).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(xe.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(U)?(a.openBlock(),a.createBlock(a.unref(ql),{key:1,class:a.normalizeClass([a.unref(g).e("icon"),a.unref(g).e("clear")]),onMousedown:a.withModifiers(a.unref(Jb),["prevent"]),onClick:ct},{default:a.withCtx(()=>[a.createVNode(a.unref(lU))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(X)?(a.openBlock(),a.createBlock(a.unref(ql),{key:2,class:a.normalizeClass([a.unref(g).e("icon"),a.unref(g).e("password")]),onClick:et},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(G))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(ee)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(g).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(g).e("count-inner"))},a.toDisplayString(a.unref(oe))+" / "+a.toDisplayString(a.unref(u).maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(D)&&a.unref(j)&&a.unref(R)?(a.openBlock(),a.createBlock(a.unref(ql),{key:4,class:a.normalizeClass([a.unref(g).e("icon"),a.unref(g).e("validateIcon"),a.unref(g).is("loading",a.unref(D)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(j))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),xe.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(g).be("group","append"))},[a.renderSlot(xe.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(h),ref_key:"textarea",ref:v,class:a.unref(T).e("inner")},a.unref(u),{tabindex:xe.tabindex,disabled:a.unref(m),readonly:xe.readonly,autocomplete:xe.autocomplete,style:a.unref(W),"aria-label":xe.label,placeholder:xe.placeholder,form:n.form,autofocus:n.autofocus,onCompositionstart:Ie,onCompositionupdate:qe,onCompositionend:Ge,onInput:ye,onFocus:Ue[2]||(Ue[2]=(...$e)=>a.unref(N)&&a.unref(N)(...$e)),onBlur:Ue[3]||(Ue[3]=(...$e)=>a.unref(I)&&a.unref(I)(...$e)),onChange:_e,onKeydown:pt}),null,16,x0t),a.unref(ee)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(w.value),class:a.normalizeClass(a.unref(g).e("count"))},a.toDisplayString(a.unref(oe))+" / "+a.toDisplayString(a.unref(u).maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,Q0t)),[[a.vShow,xe.type!=="hidden"]])}});var L0t=hi(w0t,[["__file","input.vue"]]);const lE=Jc(L0t),gg=4,S0t={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},k0t=({move:e,size:t,bar:r})=>({[r.size]:t,transform:`translate${r.axis}(${e}%)`}),h3e=Symbol("scrollbarContextKey"),M0t=Lo({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),C0t="Thumb";var f3e=hi(a.defineComponent({__name:"thumb",props:M0t,setup(e){const t=e,r=a.inject(h3e),n=li("scrollbar");r||u1t(C0t,"can not inject scrollbar context");const i=a.ref(),o=a.ref(),s=a.ref({}),l=a.ref(!1);let c=!1,u=!1,d=Xs?document.onselectstart:null;const p=a.computed(()=>S0t[t.vertical?"vertical":"horizontal"]),h=a.computed(()=>k0t({size:t.size,move:t.move,bar:p.value})),f=a.computed(()=>i.value[p.value.offset]**2/r.wrapElement[p.value.scrollSize]/t.ratio/o.value[p.value.offset]),m=w=>{var k;if(w.stopPropagation(),w.ctrlKey||[1,2].includes(w.button))return;(k=window.getSelection())==null||k.removeAllRanges(),T(w);const C=w.currentTarget;C&&(s.value[p.value.axis]=C[p.value.offset]-(w[p.value.client]-C.getBoundingClientRect()[p.value.direction]))},g=w=>{if(!o.value||!i.value||!r.wrapElement)return;const k=Math.abs(w.target.getBoundingClientRect()[p.value.direction]-w[p.value.client]),C=o.value[p.value.offset]/2,A=(k-C)*100*f.value/i.value[p.value.offset];r.wrapElement[p.value.scroll]=A*r.wrapElement[p.value.scrollSize]/100},T=w=>{w.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",v),d=document.onselectstart,document.onselectstart=()=>!1},y=w=>{if(!i.value||!o.value||c===!1)return;const k=s.value[p.value.axis];if(!k)return;const C=(i.value.getBoundingClientRect()[p.value.direction]-w[p.value.client])*-1,A=o.value[p.value.offset]-k,O=(C-A)*100*f.value/i.value[p.value.offset];r.wrapElement[p.value.scroll]=O*r.wrapElement[p.value.scrollSize]/100},v=()=>{c=!1,s.value[p.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v),L(),u&&(l.value=!1)},_=()=>{u=!1,l.value=!!t.size},b=()=>{u=!0,l.value=c};a.onBeforeUnmount(()=>{L(),document.removeEventListener("mouseup",v)});const L=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return nh(a.toRef(r,"scrollbarElement"),"mousemove",_),nh(a.toRef(r,"scrollbarElement"),"mouseleave",b),(w,k)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(n).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:i,class:a.normalizeClass([a.unref(n).e("bar"),a.unref(n).is(a.unref(p).key)]),onMousedown:g},[a.createElementVNode("div",{ref_key:"thumb",ref:o,class:a.normalizeClass(a.unref(n).e("thumb")),style:a.normalizeStyle(a.unref(h)),onMousedown:m},null,38)],34),[[a.vShow,w.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const E0t=Lo({always:{type:Boolean,default:!0},width:String,height:String,ratioX:{type:Number,default:1},ratioY:{type:Number,default:1}});var A0t=hi(a.defineComponent({__name:"bar",props:E0t,setup(e,{expose:t}){const r=e,n=a.ref(0),i=a.ref(0);return t({handleScroll:o=>{if(o){const s=o.offsetHeight-gg,l=o.offsetWidth-gg;i.value=o.scrollTop*100/s*r.ratioY,n.value=o.scrollLeft*100/l*r.ratioX}}}),(o,s)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(f3e,{move:n.value,ratio:o.ratioX,size:o.width,always:o.always},null,8,["move","ratio","size","always"]),a.createVNode(f3e,{move:i.value,ratio:o.ratioY,size:o.height,vertical:"",always:o.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const O0t=Lo({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:mi([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},id:String,role:String,ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical"]}}),H0t={scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(Ys)},wU="ElScrollbar",V0t=a.defineComponent({name:wU}),I0t=a.defineComponent({...V0t,props:O0t,emits:H0t,setup(e,{expose:t,emit:r}){const n=e,i=li("scrollbar");let o,s;const l=a.ref(),c=a.ref(),u=a.ref(),d=a.ref("0"),p=a.ref("0"),h=a.ref(),f=a.ref(1),m=a.ref(1),g=a.computed(()=>{const k={};return n.height&&(k.height=ag(n.height)),n.maxHeight&&(k.maxHeight=ag(n.maxHeight)),[n.wrapStyle,k]}),T=a.computed(()=>[n.wrapClass,i.e("wrap"),{[i.em("wrap","hidden-default")]:!n.native}]),y=a.computed(()=>[i.e("view"),n.viewClass]),v=()=>{var k;c.value&&((k=h.value)==null||k.handleScroll(c.value),r("scroll",{scrollTop:c.value.scrollTop,scrollLeft:c.value.scrollLeft}))};function _(k,C){Sc(k)?c.value.scrollTo(k):Ys(k)&&Ys(C)&&c.value.scrollTo(k,C)}const b=k=>{if(!Ys(k)){$s(wU,"value must be a number");return}c.value.scrollTop=k},L=k=>{if(!Ys(k)){$s(wU,"value must be a number");return}c.value.scrollLeft=k},w=()=>{if(!c.value)return;const k=c.value.offsetHeight-gg,C=c.value.offsetWidth-gg,A=k**2/c.value.scrollHeight,O=C**2/c.value.scrollWidth,N=Math.max(A,n.minSize),I=Math.max(O,n.minSize);f.value=A/(k-A)/(N/(k-N)),m.value=O/(C-O)/(I/(C-I)),p.value=N+gg<k?`${N}px`:"",d.value=I+gg<C?`${I}px`:""};return a.watch(()=>n.noresize,k=>{k?(o==null||o(),s==null||s()):({stop:o}=zC(u,w),s=nh("resize",w))},{immediate:!0}),a.watch(()=>[n.maxHeight,n.height],()=>{n.native||a.nextTick(()=>{var k;w(),c.value&&((k=h.value)==null||k.handleScroll(c.value))})}),a.provide(h3e,a.reactive({scrollbarElement:l,wrapElement:c})),a.onMounted(()=>{n.native||a.nextTick(()=>{w()})}),a.onUpdated(()=>w()),t({wrapRef:c,update:w,scrollTo:_,setScrollTop:b,setScrollLeft:L,handleScroll:v}),(k,C)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:l,class:a.normalizeClass(a.unref(i).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:c,class:a.normalizeClass(a.unref(T)),style:a.normalizeStyle(a.unref(g)),onScroll:v},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(k.tag),{id:k.id,ref_key:"resizeRef",ref:u,class:a.normalizeClass(a.unref(y)),style:a.normalizeStyle(k.viewStyle),role:k.role,"aria-label":k.ariaLabel,"aria-orientation":k.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(k.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],38),k.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(A0t,{key:0,ref_key:"barRef",ref:h,height:p.value,width:d.value,always:k.always,"ratio-x":m.value,"ratio-y":f.value},null,8,["height","width","always","ratio-x","ratio-y"]))],2))}});var P0t=hi(I0t,[["__file","scrollbar.vue"]]);const N0t=Jc(P0t),LU=Symbol("popper"),m3e=Symbol("popperContent"),B0t=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],g3e=Lo({role:{type:String,values:B0t,default:"tooltip"}}),R0t=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),F0t=a.defineComponent({...R0t,props:g3e,setup(e,{expose:t}){const r=e,n=a.ref(),i=a.ref(),o=a.ref(),s=a.ref(),l=a.computed(()=>r.role),c={triggerRef:n,popperInstanceRef:i,contentRef:o,referenceRef:s,role:l};return t(c),a.provide(LU,c),(u,d)=>a.renderSlot(u.$slots,"default")}});var D0t=hi(F0t,[["__file","popper.vue"]]);const y3e=Lo({arrowOffset:{type:Number,default:5}}),z0t=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),j0t=a.defineComponent({...z0t,props:y3e,setup(e,{expose:t}){const r=e,n=li("popper"),{arrowOffset:i,arrowRef:o,arrowStyle:s}=a.inject(m3e,void 0);return a.watch(()=>r.arrowOffset,l=>{i.value=l}),a.onBeforeUnmount(()=>{o.value=void 0}),t({arrowRef:o}),(l,c)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:o,class:a.normalizeClass(a.unref(n).e("arrow")),style:a.normalizeStyle(a.unref(s)),"data-popper-arrow":""},null,6))}});var U0t=hi(j0t,[["__file","arrow.vue"]]);const SU="ElOnlyChild",G0t=a.defineComponent({name:SU,setup(e,{slots:t,attrs:r}){var n;const i=a.inject(i3e),o=o0t((n=i==null?void 0:i.setForwardRef)!=null?n:Jb);return()=>{var s;const l=(s=t.default)==null?void 0:s.call(t,r);if(!l)return null;if(l.length>1)return $s(SU,"requires exact only one valid child."),null;const c=T3e(l);return c?a.withDirectives(a.cloneVNode(c,r),[[o]]):($s(SU,"no valid child node found"),null)}}});function T3e(e){if(!e)return null;const t=e;for(const r of t){if(Sc(r))switch(r.type){case a.Comment:continue;case a.Text:case"svg":return v3e(r);case a.Fragment:return T3e(r.children);default:return r}return v3e(r)}return null}function v3e(e){const t=li("only-child");return a.createVNode("span",{class:t.e("content")},[e])}const Q3e=Lo({virtualRef:{type:mi(Object)},virtualTriggering:Boolean,onMouseenter:{type:mi(Function)},onMouseleave:{type:mi(Function)},onClick:{type:mi(Function)},onKeydown:{type:mi(Function)},onFocus:{type:mi(Function)},onBlur:{type:mi(Function)},onContextmenu:{type:mi(Function)},id:String,open:Boolean}),q0t=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),W0t=a.defineComponent({...q0t,props:Q3e,setup(e,{expose:t}){const r=e,{role:n,triggerRef:i}=a.inject(LU,void 0);i0t(i);const o=a.computed(()=>l.value?r.id:void 0),s=a.computed(()=>{if(n&&n.value==="tooltip")return r.open&&r.id?r.id:void 0}),l=a.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),c=a.computed(()=>l.value?`${r.open}`:void 0);let u;return a.onMounted(()=>{a.watch(()=>r.virtualRef,d=>{d&&(i.value=rh(d))},{immediate:!0}),a.watch(i,(d,p)=>{u==null||u(),u=void 0,ix(d)&&(["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"].forEach(h=>{var f;const m=r[h];m&&(d.addEventListener(h.slice(2).toLowerCase(),m),(f=p==null?void 0:p.removeEventListener)==null||f.call(p,h.slice(2).toLowerCase(),m))}),u=a.watch([o,s,l,c],h=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((f,m)=>{oh(h[m])?d.removeAttribute(f):d.setAttribute(f,h[m])})},{immediate:!0})),ix(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(h=>p.removeAttribute(h))},{immediate:!0})}),a.onBeforeUnmount(()=>{u==null||u(),u=void 0}),t({triggerRef:i}),(d,p)=>d.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(G0t),a.mergeProps({key:0},d.$attrs,{"aria-controls":a.unref(o),"aria-describedby":a.unref(s),"aria-expanded":a.unref(c),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(d.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var Z0t=hi(W0t,[["__file","trigger.vue"]]);const kU="focus-trap.focus-after-trapped",MU="focus-trap.focus-after-released",K0t="focus-trap.focusout-prevented",b3e={cancelable:!0,bubbles:!1},X0t={cancelable:!0,bubbles:!1},x3e="focusAfterTrapped",_3e="focusAfterReleased",J0t=Symbol("elFocusTrap"),CU=a.ref(),cE=a.ref(0),EU=a.ref(0);let uE=0;const w3e=e=>{const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t},L3e=(e,t)=>{for(const r of e)if(!Y0t(r,t))return r},Y0t=(e,t)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},$0t=e=>{const t=w3e(e),r=L3e(t,e),n=L3e(t.reverse(),e);return[r,n]},eut=e=>e instanceof HTMLInputElement&&"select"in e,ph=(e,t)=>{if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),EU.value=window.performance.now(),e!==r&&eut(e)&&t&&e.select()}};function S3e(e,t){const r=[...e],n=e.indexOf(t);return n!==-1&&r.splice(n,1),r}const tut=()=>{let e=[];return{push:t=>{const r=e[0];r&&t!==r&&r.pause(),e=S3e(e,t),e.unshift(t)},remove:t=>{var r,n;e=S3e(e,t),(n=(r=e[0])==null?void 0:r.resume)==null||n.call(r)}}},rut=(e,t=!1)=>{const r=document.activeElement;for(const n of e)if(ph(n,t),document.activeElement!==r)return},k3e=tut(),nut=()=>cE.value>EU.value,dE=()=>{CU.value="pointer",cE.value=window.performance.now()},M3e=()=>{CU.value="keyboard",cE.value=window.performance.now()},iut=()=>(a.onMounted(()=>{uE===0&&(document.addEventListener("mousedown",dE),document.addEventListener("touchstart",dE),document.addEventListener("keydown",M3e)),uE++}),a.onBeforeUnmount(()=>{uE--,uE<=0&&(document.removeEventListener("mousedown",dE),document.removeEventListener("touchstart",dE),document.removeEventListener("keydown",M3e))}),{focusReason:CU,lastUserFocusTimestamp:cE,lastAutomatedFocusTimestamp:EU}),pE=e=>new CustomEvent(K0t,{...X0t,detail:e}),out=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[x3e,_3e,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const r=a.ref();let n,i;const{focusReason:o}=iut();$2t(m=>{e.trapped&&!s.paused&&t("release-requested",m)});const s={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!e.loop&&!e.trapped||s.paused)return;const{key:g,altKey:T,ctrlKey:y,metaKey:v,currentTarget:_,shiftKey:b}=m,{loop:L}=e,w=g===kc.tab&&!T&&!y&&!v,k=document.activeElement;if(w&&k){const C=_,[A,O]=$0t(C);if(A&&O){if(!b&&k===O){const N=pE({focusReason:o.value});t("focusout-prevented",N),N.defaultPrevented||(m.preventDefault(),L&&ph(A,!0))}else if(b&&[A,C].includes(k)){const N=pE({focusReason:o.value});t("focusout-prevented",N),N.defaultPrevented||(m.preventDefault(),L&&ph(O,!0))}}else if(k===C){const N=pE({focusReason:o.value});t("focusout-prevented",N),N.defaultPrevented||m.preventDefault()}}};a.provide(J0t,{focusTrapRef:r,onKeydown:l}),a.watch(()=>e.focusTrapEl,m=>{m&&(r.value=m)},{immediate:!0}),a.watch([r],([m],[g])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",d),m.addEventListener("focusout",p)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",p))});const c=m=>{t(x3e,m)},u=m=>t(_3e,m),d=m=>{const g=a.unref(r);if(!g)return;const T=m.target,y=m.relatedTarget,v=T&&g.contains(T);e.trapped||y&&g.contains(y)||(n=y),v&&t("focusin",m),!s.paused&&e.trapped&&(v?i=T:ph(i,!0))},p=m=>{const g=a.unref(r);if(!(s.paused||!g))if(e.trapped){const T=m.relatedTarget;!oh(T)&&!g.contains(T)&&setTimeout(()=>{if(!s.paused&&e.trapped){const y=pE({focusReason:o.value});t("focusout-prevented",y),y.defaultPrevented||ph(i,!0)}},0)}else{const T=m.target;T&&g.contains(T)||t("focusout",m)}};async function h(){await a.nextTick();const m=a.unref(r);if(m){k3e.push(s);const g=m.contains(document.activeElement)?n:document.activeElement;if(n=g,!m.contains(g)){const T=new Event(kU,b3e);m.addEventListener(kU,c),m.dispatchEvent(T),T.defaultPrevented||a.nextTick(()=>{let y=e.focusStartEl;Js(y)||(ph(y),document.activeElement!==y&&(y="first")),y==="first"&&rut(w3e(m),!0),(document.activeElement===g||y==="container")&&ph(m)})}}}function f(){const m=a.unref(r);if(m){m.removeEventListener(kU,c);const g=new CustomEvent(MU,{...b3e,detail:{focusReason:o.value}});m.addEventListener(MU,u),m.dispatchEvent(g),!g.defaultPrevented&&(o.value=="keyboard"||!nut()||m.contains(document.activeElement))&&ph(n??document.body),m.removeEventListener(MU,u),k3e.remove(s)}}return a.onMounted(()=>{e.trapped&&h(),a.watch(()=>e.trapped,m=>{m?h():f()})}),a.onBeforeUnmount(()=>{e.trapped&&f()}),{onKeydown:l}}});function aut(e,t,r,n,i,o){return a.renderSlot(e.$slots,"default",{handleKeydown:e.onKeydown})}var sut=hi(out,[["render",aut],["__file","focus-trap.vue"]]);const lut=["fixed","absolute"],cut=Lo({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:mi(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:rE,default:"bottom"},popperOptions:{type:mi(Object),default:()=>({})},strategy:{type:String,values:lut,default:"absolute"}}),C3e=Lo({...cut,id:String,style:{type:mi([String,Array,Object])},className:{type:mi([String,Array,Object])},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:mi([String,Array,Object])},popperStyle:{type:mi([String,Array,Object])},referenceEl:{type:mi(Object)},triggerTargetEl:{type:mi(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},ariaLabel:{type:String,default:void 0},virtualTriggering:Boolean,zIndex:Number}),uut={mouseenter:e=>e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},dut=(e,t=[])=>{const{placement:r,strategy:n,popperOptions:i}=e,o={placement:r,strategy:n,...i,modifiers:[...hut(e),...t]};return fut(o,i==null?void 0:i.modifiers),o},put=e=>{if(Xs)return rh(e)};function hut(e){const{offset:t,gpuAcceleration:r,fallbackPlacements:n}=e;return[{name:"offset",options:{offset:[0,t??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:n}},{name:"computeStyles",options:{gpuAcceleration:r}}]}function fut(e,t){t&&(e.modifiers=[...e.modifiers,...t??[]])}const mut=0,gut=e=>{const{popperInstanceRef:t,contentRef:r,triggerRef:n,role:i}=a.inject(LU,void 0),o=a.ref(),s=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!e.visible})),c=a.computed(()=>{var y;const v=a.unref(o),_=(y=a.unref(s))!=null?y:mut;return{name:"arrow",enabled:!n1t(v),options:{element:v,padding:_}}}),u=a.computed(()=>({onFirstUpdate:()=>{m()},...dut(e,[a.unref(c),a.unref(l)])})),d=a.computed(()=>put(e.referenceEl)||a.unref(n)),{attributes:p,state:h,styles:f,update:m,forceUpdate:g,instanceRef:T}=X2t(d,r,u);return a.watch(T,y=>t.value=y),a.onMounted(()=>{a.watch(()=>{var y;return(y=a.unref(d))==null?void 0:y.getBoundingClientRect()},()=>{m()})}),{attributes:p,arrowRef:o,contentRef:r,instanceRef:T,state:h,styles:f,role:i,forceUpdate:g,update:m}},yut=(e,{attributes:t,styles:r,role:n})=>{const{nextZIndex:i}=l3e(),o=li("popper"),s=a.computed(()=>a.unref(t).popper),l=a.ref(Ys(e.zIndex)?e.zIndex:i()),c=a.computed(()=>[o.b(),o.is("pure",e.pure),o.is(e.effect),e.popperClass]),u=a.computed(()=>[{zIndex:a.unref(l)},a.unref(r).popper,e.popperStyle||{}]),d=a.computed(()=>n.value==="dialog"?"false":void 0),p=a.computed(()=>a.unref(r).arrow||{});return{ariaModal:d,arrowStyle:p,contentAttrs:s,contentClass:c,contentStyle:u,contentZIndex:l,updateZIndex:()=>{l.value=Ys(e.zIndex)?e.zIndex:i()}}},Tut=(e,t)=>{const r=a.ref(!1),n=a.ref();return{focusStartRef:n,trapped:r,onFocusAfterReleased:i=>{var o;((o=i.detail)==null?void 0:o.focusReason)!=="pointer"&&(n.value="first",t("blur"))},onFocusAfterTrapped:()=>{t("focus")},onFocusInTrap:i=>{e.visible&&!r.value&&(i.target&&(n.value=i.target),r.value=!0)},onFocusoutPrevented:i=>{e.trapping||(i.detail.focusReason==="pointer"&&i.preventDefault(),r.value=!1)},onReleaseRequested:()=>{r.value=!1,t("close")}}},vut=a.defineComponent({name:"ElPopperContent"}),Qut=a.defineComponent({...vut,props:C3e,emits:uut,setup(e,{expose:t,emit:r}){const n=e,{focusStartRef:i,trapped:o,onFocusAfterReleased:s,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=Tut(n,r),{attributes:p,arrowRef:h,contentRef:f,styles:m,instanceRef:g,role:T,update:y}=gut(n),{ariaModal:v,arrowStyle:_,contentAttrs:b,contentClass:L,contentStyle:w,updateZIndex:k}=yut(n,{styles:m,attributes:p,role:T}),C=a.inject(mx,void 0),A=a.ref();a.provide(m3e,{arrowStyle:_,arrowRef:h,arrowOffset:A}),C&&(C.addInputId||C.removeInputId)&&a.provide(mx,{...C,addInputId:Jb,removeInputId:Jb});let O;const N=(R=!0)=>{y(),R&&k()},I=()=>{N(!1),n.visible&&n.focusOnShow?o.value=!0:n.visible===!1&&(o.value=!1)};return a.onMounted(()=>{a.watch(()=>n.triggerTargetEl,(R,D)=>{O==null||O(),O=void 0;const j=a.unref(R||f.value),G=a.unref(D||f.value);ix(j)&&(O=a.watch([T,()=>n.ariaLabel,v,()=>n.id],P=>{["role","aria-label","aria-modal","id"].forEach((W,K)=>{oh(P[K])?j.removeAttribute(W):j.setAttribute(W,P[K])})},{immediate:!0})),G!==j&&ix(G)&&["role","aria-label","aria-modal","id"].forEach(P=>{G.removeAttribute(P)})},{immediate:!0}),a.watch(()=>n.visible,I,{immediate:!0})}),a.onBeforeUnmount(()=>{O==null||O(),O=void 0}),t({popperContentRef:f,popperInstanceRef:g,updatePopper:N,contentStyle:w}),(R,D)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:f},a.unref(b),{style:a.unref(w),class:a.unref(L),tabindex:"-1",onMouseenter:D[0]||(D[0]=j=>R.$emit("mouseenter",j)),onMouseleave:D[1]||(D[1]=j=>R.$emit("mouseleave",j))}),[a.createVNode(a.unref(sut),{trapped:a.unref(o),"trap-on-focus-in":!0,"focus-trap-el":a.unref(f),"focus-start-el":a.unref(i),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(s),onFocusin:a.unref(c),onFocusoutPrevented:a.unref(u),onReleaseRequested:a.unref(d)},{default:a.withCtx(()=>[a.renderSlot(R.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});var but=hi(Qut,[["__file","content.vue"]]);const xut=Jc(D0t),AU=Symbol("elTooltip"),T2=Lo({...r0t,...C3e,appendTo:{type:mi([String,Object])},content:{type:String,default:""},rawContent:{type:Boolean,default:!1},persistent:Boolean,ariaLabel:String,visible:{type:mi(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean}),yx=Lo({...Q3e,disabled:Boolean,trigger:{type:mi([String,Array]),default:"hover"},triggerKeys:{type:mi(Array),default:()=>[kc.enter,kc.space]}}),{useModelToggleProps:_ut,useModelToggleEmits:wut,useModelToggle:Lut}=W1t("visible"),Sut=Lo({...g3e,..._ut,...T2,...yx,...y3e,showArrow:{type:Boolean,default:!0}}),kut=[...wut,"before-show","before-hide","show","hide","open","close"],Mut=(e,t)=>ng(e)?e.includes(t):e===t,yg=(e,t,r)=>n=>{Mut(a.unref(e),t)&&r(n)},Cut=a.defineComponent({name:"ElTooltipTrigger"}),Eut=a.defineComponent({...Cut,props:yx,setup(e,{expose:t}){const r=e,n=li("tooltip"),{controlled:i,id:o,open:s,onOpen:l,onClose:c,onToggle:u}=a.inject(AU,void 0),d=a.ref(null),p=()=>{if(a.unref(i)||r.disabled)return!0},h=a.toRef(r,"trigger"),f=O4(p,yg(h,"hover",l)),m=O4(p,yg(h,"hover",c)),g=O4(p,yg(h,"click",b=>{b.button===0&&u(b)})),T=O4(p,yg(h,"focus",l)),y=O4(p,yg(h,"focus",c)),v=O4(p,yg(h,"contextmenu",b=>{b.preventDefault(),u(b)})),_=O4(p,b=>{const{code:L}=b;r.triggerKeys.includes(L)&&(b.preventDefault(),u(b))});return t({triggerRef:d}),(b,L)=>(a.openBlock(),a.createBlock(a.unref(Z0t),{id:a.unref(o),"virtual-ref":b.virtualRef,open:a.unref(s),"virtual-triggering":b.virtualTriggering,class:a.normalizeClass(a.unref(n).e("trigger")),onBlur:a.unref(y),onClick:a.unref(g),onContextmenu:a.unref(v),onFocus:a.unref(T),onMouseenter:a.unref(f),onMouseleave:a.unref(m),onKeydown:a.unref(_)},{default:a.withCtx(()=>[a.renderSlot(b.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var Aut=hi(Eut,[["__file","trigger.vue"]]);const Out=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),Hut=a.defineComponent({...Out,props:T2,setup(e,{expose:t}){const r=e,{selector:n}=n3e(),i=li("tooltip"),o=a.ref(null),s=a.ref(!1),{controlled:l,id:c,open:u,trigger:d,onClose:p,onOpen:h,onShow:f,onHide:m,onBeforeShow:g,onBeforeHide:T}=a.inject(AU,void 0),y=a.computed(()=>r.transition||`${i.namespace.value}-fade-in-linear`),v=a.computed(()=>process.env.NODE_ENV==="test"?!0:r.persistent);a.onBeforeUnmount(()=>{s.value=!0});const _=a.computed(()=>a.unref(v)?!0:a.unref(u)),b=a.computed(()=>r.disabled?!1:a.unref(u)),L=a.computed(()=>r.appendTo||n.value),w=a.computed(()=>{var P;return(P=r.style)!=null?P:{}}),k=a.computed(()=>!a.unref(u)),C=()=>{m()},A=()=>{if(a.unref(l))return!0},O=O4(A,()=>{r.enterable&&a.unref(d)==="hover"&&h()}),N=O4(A,()=>{a.unref(d)==="hover"&&p()}),I=()=>{var P,W;(W=(P=o.value)==null?void 0:P.updatePopper)==null||W.call(P),g==null||g()},R=()=>{T==null||T()},D=()=>{f(),G=Zot(a.computed(()=>{var P;return(P=o.value)==null?void 0:P.popperContentRef}),()=>{a.unref(l)||a.unref(d)!=="hover"&&p()})},j=()=>{r.virtualTriggering||p()};let G;return a.watch(()=>a.unref(u),P=>{P||G==null||G()},{flush:"post"}),a.watch(()=>r.content,()=>{var P,W;(W=(P=o.value)==null?void 0:P.updatePopper)==null||W.call(P)}),t({contentRef:o}),(P,W)=>(a.openBlock(),a.createBlock(a.Teleport,{disabled:!P.teleported,to:a.unref(L)},[a.createVNode(a.Transition,{name:a.unref(y),onAfterLeave:C,onBeforeEnter:I,onAfterEnter:D,onBeforeLeave:R},{default:a.withCtx(()=>[a.unref(_)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(but),a.mergeProps({key:0,id:a.unref(c),ref_key:"contentRef",ref:o},P.$attrs,{"aria-label":P.ariaLabel,"aria-hidden":a.unref(k),"boundaries-padding":P.boundariesPadding,"fallback-placements":P.fallbackPlacements,"gpu-acceleration":P.gpuAcceleration,offset:P.offset,placement:P.placement,"popper-options":P.popperOptions,strategy:P.strategy,effect:P.effect,enterable:P.enterable,pure:P.pure,"popper-class":P.popperClass,"popper-style":[P.popperStyle,a.unref(w)],"reference-el":P.referenceEl,"trigger-target-el":P.triggerTargetEl,visible:a.unref(b),"z-index":P.zIndex,onMouseenter:a.unref(O),onMouseleave:a.unref(N),onBlur:j,onClose:a.unref(p)}),{default:a.withCtx(()=>[s.value?a.createCommentVNode("v-if",!0):a.renderSlot(P.$slots,"default",{key:0})]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(b)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["disabled","to"]))}});var Vut=hi(Hut,[["__file","content.vue"]]);const Iut=["innerHTML"],Put={key:1},Nut=a.defineComponent({name:"ElTooltip"}),But=a.defineComponent({...Nut,props:Sut,emits:kut,setup(e,{expose:t,emit:r}){const n=e;t0t();const i=fx(),o=a.ref(),s=a.ref(),l=()=>{var y;const v=a.unref(o);v&&((y=v.popperInstanceRef)==null||y.update())},c=a.ref(!1),u=a.ref(),{show:d,hide:p,hasUpdateHandler:h}=Lut({indicator:c,toggleReason:u}),{onOpen:f,onClose:m}=n0t({showAfter:a.toRef(n,"showAfter"),hideAfter:a.toRef(n,"hideAfter"),autoClose:a.toRef(n,"autoClose"),open:d,close:p}),g=a.computed(()=>ah(n.visible)&&!h.value);a.provide(AU,{controlled:g,id:i,open:a.readonly(c),trigger:a.toRef(n,"trigger"),onOpen:y=>{f(y)},onClose:y=>{m(y)},onToggle:y=>{a.unref(c)?m(y):f(y)},onShow:()=>{r("show",u.value)},onHide:()=>{r("hide",u.value)},onBeforeShow:()=>{r("before-show",u.value)},onBeforeHide:()=>{r("before-hide",u.value)},updatePopper:l}),a.watch(()=>n.disabled,y=>{y&&c.value&&(c.value=!1)});const T=y=>{var v,_;const b=(_=(v=s.value)==null?void 0:v.contentRef)==null?void 0:_.popperContentRef,L=(y==null?void 0:y.relatedTarget)||document.activeElement;return b&&b.contains(L)};return a.onDeactivated(()=>c.value&&p()),t({popperRef:o,contentRef:s,isFocusInsideContent:T,updatePopper:l,onOpen:f,onClose:m,hide:p}),(y,v)=>(a.openBlock(),a.createBlock(a.unref(xut),{ref_key:"popperRef",ref:o,role:y.role},{default:a.withCtx(()=>[a.createVNode(Aut,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:a.withCtx(()=>[y.$slots.default?a.renderSlot(y.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(Vut,{ref_key:"contentRef",ref:s,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:a.withCtx(()=>[a.renderSlot(y.$slots,"content",{},()=>[y.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:y.content},null,8,Iut)):(a.openBlock(),a.createElementBlock("span",Put,a.toDisplayString(y.content),1))]),y.showArrow?(a.openBlock(),a.createBlock(a.unref(U0t),{key:0,"arrow-offset":y.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var Rut=hi(But,[["__file","tooltip.vue"]]);const OU=Jc(Rut),E3e=Symbol("buttonGroupContextKey"),Fut=(e,t)=>{Cue({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>e.type==="text"));const r=a.inject(E3e,void 0),n=xU("button"),{form:i}=dh(),o=uh(a.computed(()=>r==null?void 0:r.size)),s=mg(),l=a.ref(),c=a.useSlots(),u=a.computed(()=>e.type||(r==null?void 0:r.type)||""),d=a.computed(()=>{var f,m,g;return(g=(m=e.autoInsertSpace)!=null?m:(f=n.value)==null?void 0:f.autoInsertSpace)!=null?g:!1}),p=a.computed(()=>e.tag==="button"?{ariaDisabled:s.value||e.loading,disabled:s.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),h=a.computed(()=>{var f;const m=(f=c.default)==null?void 0:f.call(c);if(d.value&&(m==null?void 0:m.length)===1){const g=m[0];if((g==null?void 0:g.type)===a.Text){const T=g.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(T.trim())}}return!1});return{_disabled:s,_size:o,_type:u,_ref:l,_props:p,shouldAddSpace:h,handleClick:f=>{e.nativeType==="reset"&&(i==null||i.resetFields()),t("click",f)}}},Dut=["default","primary","success","warning","info","danger","text",""],zut=["button","submit","reset"],HU=Lo({size:E8,disabled:Boolean,type:{type:String,values:Dut,default:""},icon:{type:lh},nativeType:{type:String,values:zut,default:"button"},loading:Boolean,loadingIcon:{type:lh,default:()=>cU},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:mi([String,Object]),default:"button"}}),jut={click:e=>e instanceof MouseEvent};function Wl(e,t){Uut(e)&&(e="100%");var r=Gut(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function hE(e){return Math.min(1,Math.max(0,e))}function Uut(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Gut(e){return typeof e=="string"&&e.indexOf("%")!==-1}function A3e(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function fE(e){return e<=1?"".concat(Number(e)*100,"%"):e}function A8(e){return e.length===1?"0"+e:String(e)}function qut(e,t,r){return{r:Wl(e,255)*255,g:Wl(t,255)*255,b:Wl(r,255)*255}}function O3e(e,t,r){e=Wl(e,255),t=Wl(t,255),r=Wl(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),o=0,s=0,l=(n+i)/2;if(n===i)s=0,o=0;else{var c=n-i;switch(s=l>.5?c/(2-n-i):c/(n+i),n){case e:o=(t-r)/c+(t<r?6:0);break;case t:o=(r-e)/c+2;break;case r:o=(e-t)/c+4;break}o/=6}return{h:o,s,l}}function VU(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Wut(e,t,r){var n,i,o;if(e=Wl(e,360),t=Wl(t,100),r=Wl(r,100),t===0)i=r,o=r,n=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=VU(l,s,e+1/3),i=VU(l,s,e),o=VU(l,s,e-1/3)}return{r:n*255,g:i*255,b:o*255}}function H3e(e,t,r){e=Wl(e,255),t=Wl(t,255),r=Wl(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),o=0,s=n,l=n-i,c=n===0?0:l/n;if(n===i)o=0;else{switch(n){case e:o=(t-r)/l+(t<r?6:0);break;case t:o=(r-e)/l+2;break;case r:o=(e-t)/l+4;break}o/=6}return{h:o,s:c,v:s}}function Zut(e,t,r){e=Wl(e,360)*6,t=Wl(t,100),r=Wl(r,100);var n=Math.floor(e),i=e-n,o=r*(1-t),s=r*(1-i*t),l=r*(1-(1-i)*t),c=n%6,u=[r,s,o,o,l,r][c],d=[l,r,r,s,o,o][c],p=[o,o,l,r,r,s][c];return{r:u*255,g:d*255,b:p*255}}function V3e(e,t,r,n){var i=[A8(Math.round(e).toString(16)),A8(Math.round(t).toString(16)),A8(Math.round(r).toString(16))];return n&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Kut(e,t,r,n,i){var o=[A8(Math.round(e).toString(16)),A8(Math.round(t).toString(16)),A8(Math.round(r).toString(16)),A8(Xut(n))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function Xut(e){return Math.round(parseFloat(e)*255).toString(16)}function I3e(e){return v2(e)/255}function v2(e){return parseInt(e,16)}function Jut(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var IU={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Yut(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,o=null,s=!1,l=!1;return typeof e=="string"&&(e=t3t(e)),typeof e=="object"&&(N4(e.r)&&N4(e.g)&&N4(e.b)?(t=qut(e.r,e.g,e.b),s=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):N4(e.h)&&N4(e.s)&&N4(e.v)?(n=fE(e.s),i=fE(e.v),t=Zut(e.h,n,i),s=!0,l="hsv"):N4(e.h)&&N4(e.s)&&N4(e.l)&&(n=fE(e.s),o=fE(e.l),t=Wut(e.h,n,o),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=A3e(r),{ok:s,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var $ut="[-\\+]?\\d+%?",e3t="[-\\+]?\\d*\\.\\d+%?",hh="(?:".concat(e3t,")|(?:").concat($ut,")"),PU="[\\s|\\(]+(".concat(hh,")[,|\\s]+(").concat(hh,")[,|\\s]+(").concat(hh,")\\s*\\)?"),NU="[\\s|\\(]+(".concat(hh,")[,|\\s]+(").concat(hh,")[,|\\s]+(").concat(hh,")[,|\\s]+(").concat(hh,")\\s*\\)?"),_u={CSS_UNIT:new RegExp(hh),rgb:new RegExp("rgb"+PU),rgba:new RegExp("rgba"+NU),hsl:new RegExp("hsl"+PU),hsla:new RegExp("hsla"+NU),hsv:new RegExp("hsv"+PU),hsva:new RegExp("hsva"+NU),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function t3t(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(IU[e])e=IU[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=_u.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=_u.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=_u.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=_u.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=_u.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=_u.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=_u.hex8.exec(e),r?{r:v2(r[1]),g:v2(r[2]),b:v2(r[3]),a:I3e(r[4]),format:t?"name":"hex8"}:(r=_u.hex6.exec(e),r?{r:v2(r[1]),g:v2(r[2]),b:v2(r[3]),format:t?"name":"hex"}:(r=_u.hex4.exec(e),r?{r:v2(r[1]+r[1]),g:v2(r[2]+r[2]),b:v2(r[3]+r[3]),a:I3e(r[4]+r[4]),format:t?"name":"hex8"}:(r=_u.hex3.exec(e),r?{r:v2(r[1]+r[1]),g:v2(r[2]+r[2]),b:v2(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function N4(e){return!!_u.CSS_UNIT.exec(String(e))}var r3t=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var n;if(t instanceof e)return t;typeof t=="number"&&(t=Jut(t)),this.originalInput=t;var i=Yut(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=r.format)!==null&&n!==void 0?n:i.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,n,i,o=t.r/255,s=t.g/255,l=t.b/255;return o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),l<=.03928?i=l/12.92:i=Math.pow((l+.055)/1.055,2.4),.2126*r+.7152*n+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=A3e(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=H3e(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=H3e(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=O3e(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=O3e(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),V3e(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Kut(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(n,")"):"rgba(".concat(t,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(Wl(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(Wl(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+V3e(this.r,this.g,this.b,!1),r=0,n=Object.entries(IU);r<n.length;r++){var i=n[r],o=i[0],s=i[1];if(t===s)return o}return!1},e.prototype.toString=function(t){var r=!!t;t=t??this.format;var n=!1,i=this.a<1&&this.a>=0,o=!r&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=hE(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=hE(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=hE(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=hE(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var n=this.toRgb(),i=new e(t).toRgb(),o=r/100,s={r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a};return new e(s)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var n=this.toHsl(),i=360/r,o=[this];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,o.push(new e(n));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),n=r.h,i=r.s,o=r.v,s=[],l=1/t;t--;)s.push(new e({h:n,s:i,v:o})),o=(o+l)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),i=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/i,g:(r.g*r.a+n.g*n.a*(1-r.a))/i,b:(r.b*r.a+n.b*n.a*(1-r.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,i=[this],o=360/t,s=1;s<t;s++)i.push(new e({h:(n+s*o)%360,s:r.s,l:r.l}));return i},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function fh(e,t=20){return e.mix("#141414",t).toString()}function n3t(e){const t=mg(),r=li("button");return a.computed(()=>{let n={};const i=e.color;if(i){const o=new r3t(i),s=e.dark?o.tint(20).toString():fh(o,20);if(e.plain)n=r.cssVarBlock({"bg-color":e.dark?fh(o,90):o.tint(90).toString(),"text-color":i,"border-color":e.dark?fh(o,50):o.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":i,"hover-border-color":i,"active-bg-color":s,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":s}),t.value&&(n[r.cssVarBlockName("disabled-bg-color")]=e.dark?fh(o,90):o.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=e.dark?fh(o,50):o.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=e.dark?fh(o,80):o.tint(80).toString());else{const l=e.dark?fh(o,30):o.tint(30).toString(),c=o.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(n=r.cssVarBlock({"bg-color":i,"text-color":c,"border-color":i,"hover-bg-color":l,"hover-text-color":c,"hover-border-color":l,"active-bg-color":s,"active-border-color":s}),t.value){const u=e.dark?fh(o,50):o.tint(50).toString();n[r.cssVarBlockName("disabled-bg-color")]=u,n[r.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,n[r.cssVarBlockName("disabled-border-color")]=u}}}return n})}const i3t=a.defineComponent({name:"ElButton"}),o3t=a.defineComponent({...i3t,props:HU,emits:jut,setup(e,{expose:t,emit:r}){const n=e,i=n3t(n),o=li("button"),{_ref:s,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:p,handleClick:h}=Fut(n,r);return t({ref:s,size:l,type:c,disabled:u,shouldAddSpace:p}),(f,m)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(f.tag),a.mergeProps({ref_key:"_ref",ref:s},a.unref(d),{class:[a.unref(o).b(),a.unref(o).m(a.unref(c)),a.unref(o).m(a.unref(l)),a.unref(o).is("disabled",a.unref(u)),a.unref(o).is("loading",f.loading),a.unref(o).is("plain",f.plain),a.unref(o).is("round",f.round),a.unref(o).is("circle",f.circle),a.unref(o).is("text",f.text),a.unref(o).is("link",f.link),a.unref(o).is("has-bg",f.bg)],style:a.unref(i),onClick:a.unref(h)}),{default:a.withCtx(()=>[f.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[f.$slots.loading?a.renderSlot(f.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(ql),{key:1,class:a.normalizeClass(a.unref(o).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(f.loadingIcon)))]),_:1},8,["class"]))],64)):f.icon||f.$slots.icon?(a.openBlock(),a.createBlock(a.unref(ql),{key:1},{default:a.withCtx(()=>[f.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(f.icon),{key:0})):a.renderSlot(f.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),f.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(o).em("text","expand")]:a.unref(p)})},[a.renderSlot(f.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var a3t=hi(o3t,[["__file","button.vue"]]);const s3t={size:HU.size,type:HU.type},l3t=a.defineComponent({name:"ElButtonGroup"}),c3t=a.defineComponent({...l3t,props:s3t,setup(e){const t=e;a.provide(E3e,a.reactive({size:a.toRef(t,"size"),type:a.toRef(t,"type")}));const r=li("button");return(n,i)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(`${a.unref(r).b("group")}`)},[a.renderSlot(n.$slots,"default")],2))}});var P3e=hi(c3t,[["__file","button-group.vue"]]);const j3=Jc(a3t,{ButtonGroup:P3e});Qu(P3e);var ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function BU(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function u3t(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}const mh=new Map;let N3e;Xs&&(document.addEventListener("mousedown",e=>N3e=e),document.addEventListener("mouseup",e=>{for(const t of mh.values())for(const{documentHandler:r}of t)r(e,N3e)}));function B3e(e,t){let r=[];return Array.isArray(t.arg)?r=t.arg:ix(t.arg)&&r.push(t.arg),function(n,i){const o=t.instance.popperRef,s=n.target,l=i==null?void 0:i.target,c=!t||!t.instance,u=!s||!l,d=e.contains(s)||e.contains(l),p=e===s,h=r.length&&r.some(m=>m==null?void 0:m.contains(s))||r.length&&r.includes(l),f=o&&(o.contains(s)||o.contains(l));c||u||d||p||h||f||t.value(n,i)}}const R3e={beforeMount(e,t){mh.has(e)||mh.set(e,[]),mh.get(e).push({documentHandler:B3e(e,t),bindingFn:t.value})},updated(e,t){mh.has(e)||mh.set(e,[]);const r=mh.get(e),n=r.findIndex(o=>o.bindingFn===t.oldValue),i={documentHandler:B3e(e,t),bindingFn:t.value};n>=0?r.splice(n,1,i):r.push(i)},unmounted(e){mh.delete(e)}},F3e={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},controls:{type:String,default:void 0},border:Boolean,size:E8,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0}},D3e={[ss]:e=>Js(e)||Ys(e)||ah(e),change:e=>Js(e)||Ys(e)||ah(e)},Tg=Symbol("checkboxGroupContextKey"),d3t=({model:e,isChecked:t})=>{const r=a.inject(Tg,void 0),n=a.computed(()=>{var i,o;const s=(i=r==null?void 0:r.max)==null?void 0:i.value,l=(o=r==null?void 0:r.min)==null?void 0:o.value;return!nx(s)&&e.value.length>=s&&!t.value||!nx(l)&&e.value.length<=l&&t.value});return{isDisabled:mg(a.computed(()=>(r==null?void 0:r.disabled.value)||n.value)),isLimitDisabled:n}},p3t=(e,{model:t,isLimitExceeded:r,hasOwnLabel:n,isDisabled:i,isLabeledByFormItem:o})=>{const s=a.inject(Tg,void 0),{formItem:l}=dh(),{emit:c}=a.getCurrentInstance();function u(m){var g,T;return m===e.trueLabel||m===!0?(g=e.trueLabel)!=null?g:!0:(T=e.falseLabel)!=null?T:!1}function d(m,g){c("change",u(m),g)}function p(m){if(r.value)return;const g=m.target;c("change",u(g.checked),m)}async function h(m){r.value||!n.value&&!i.value&&o.value&&(m.composedPath().some(g=>g.tagName==="LABEL")||(t.value=u([!1,e.falseLabel].includes(t.value)),await a.nextTick(),d(t.value,m)))}const f=a.computed(()=>(s==null?void 0:s.validateEvent)||e.validateEvent);return a.watch(()=>e.modelValue,()=>{f.value&&(l==null||l.validate("change").catch(m=>$s(m)))}),{handleChange:p,onClickRoot:h}},h3t=e=>{const t=a.ref(!1),{emit:r}=a.getCurrentInstance(),n=a.inject(Tg,void 0),i=a.computed(()=>nx(n)===!1),o=a.ref(!1);return{model:a.computed({get(){var s,l;return i.value?(s=n==null?void 0:n.modelValue)==null?void 0:s.value:(l=e.modelValue)!=null?l:t.value},set(s){var l,c;i.value&&ng(s)?(o.value=((l=n==null?void 0:n.max)==null?void 0:l.value)!==void 0&&s.length>(n==null?void 0:n.max.value),o.value===!1&&((c=n==null?void 0:n.changeEvent)==null||c.call(n,s))):(r(ss,s),t.value=s)}}),isGroup:i,isLimitExceeded:o}},f3t=(e,t,{model:r})=>{const n=a.inject(Tg,void 0),i=a.ref(!1),o=a.computed(()=>{const u=r.value;return ah(u)?u:ng(u)?Sc(e.label)?u.map(a.toRaw).some(d=>aU(d,e.label)):u.map(a.toRaw).includes(e.label):u!=null?u===e.trueLabel:!!u}),s=uh(a.computed(()=>{var u;return(u=n==null?void 0:n.size)==null?void 0:u.value}),{prop:!0}),l=uh(a.computed(()=>{var u;return(u=n==null?void 0:n.size)==null?void 0:u.value})),c=a.computed(()=>!!t.default||!oh(e.label));return{checkboxButtonSize:s,isChecked:o,isFocused:i,checkboxSize:l,hasOwnLabel:c}},m3t=(e,{model:t})=>{function r(){ng(t.value)&&!t.value.includes(e.label)?t.value.push(e.label):t.value=e.trueLabel||!0}e.checked&&r()},z3e=(e,t)=>{const{formItem:r}=dh(),{model:n,isGroup:i,isLimitExceeded:o}=h3t(e),{isFocused:s,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d}=f3t(e,t,{model:n}),{isDisabled:p}=d3t({model:n,isChecked:l}),{inputId:h,isLabeledByFormItem:f}=gx(e,{formItemContext:r,disableIdGeneration:d,disableIdManagement:i}),{handleChange:m,onClickRoot:g}=p3t(e,{model:n,isLimitExceeded:o,hasOwnLabel:d,isDisabled:p,isLabeledByFormItem:f});return m3t(e,{model:n}),{inputId:h,isLabeledByFormItem:f,isChecked:l,isDisabled:p,isFocused:s,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,model:n,handleChange:m,onClickRoot:g}},g3t=["id","indeterminate","name","tabindex","disabled","true-value","false-value"],y3t=["id","indeterminate","disabled","value","name","tabindex"],T3t=a.defineComponent({name:"ElCheckbox"}),v3t=a.defineComponent({...T3t,props:F3e,emits:D3e,setup(e){const t=e,r=a.useSlots(),{inputId:n,isLabeledByFormItem:i,isChecked:o,isDisabled:s,isFocused:l,checkboxSize:c,hasOwnLabel:u,model:d,handleChange:p,onClickRoot:h}=z3e(t,r),f=li("checkbox"),m=a.computed(()=>[f.b(),f.m(c.value),f.is("disabled",s.value),f.is("bordered",t.border),f.is("checked",o.value)]),g=a.computed(()=>[f.e("input"),f.is("disabled",s.value),f.is("checked",o.value),f.is("indeterminate",t.indeterminate),f.is("focus",l.value)]);return(T,y)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(!a.unref(u)&&a.unref(i)?"span":"label"),{class:a.normalizeClass(a.unref(m)),"aria-controls":T.indeterminate?T.controls:null,onClick:a.unref(h)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(g))},[T.trueLabel||T.falseLabel?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,id:a.unref(n),"onUpdate:modelValue":y[0]||(y[0]=v=>a.isRef(d)?d.value=v:null),class:a.normalizeClass(a.unref(f).e("original")),type:"checkbox",indeterminate:T.indeterminate,name:T.name,tabindex:T.tabindex,disabled:a.unref(s),"true-value":T.trueLabel,"false-value":T.falseLabel,onChange:y[1]||(y[1]=(...v)=>a.unref(p)&&a.unref(p)(...v)),onFocus:y[2]||(y[2]=v=>l.value=!0),onBlur:y[3]||(y[3]=v=>l.value=!1),onClick:y[4]||(y[4]=a.withModifiers(()=>{},["stop"]))},null,42,g3t)),[[a.vModelCheckbox,a.unref(d)]]):a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:1,id:a.unref(n),"onUpdate:modelValue":y[5]||(y[5]=v=>a.isRef(d)?d.value=v:null),class:a.normalizeClass(a.unref(f).e("original")),type:"checkbox",indeterminate:T.indeterminate,disabled:a.unref(s),value:T.label,name:T.name,tabindex:T.tabindex,onChange:y[6]||(y[6]=(...v)=>a.unref(p)&&a.unref(p)(...v)),onFocus:y[7]||(y[7]=v=>l.value=!0),onBlur:y[8]||(y[8]=v=>l.value=!1),onClick:y[9]||(y[9]=a.withModifiers(()=>{},["stop"]))},null,42,y3t)),[[a.vModelCheckbox,a.unref(d)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(f).e("inner"))},null,2)],2),a.unref(u)?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(f).e("label"))},[a.renderSlot(T.$slots,"default"),T.$slots.default?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(T.label),1)],64))],2)):a.createCommentVNode("v-if",!0)]),_:3},8,["class","aria-controls","onClick"]))}});var Q3t=hi(v3t,[["__file","checkbox.vue"]]);const b3t=["name","tabindex","disabled","true-value","false-value"],x3t=["name","tabindex","disabled","value"],_3t=a.defineComponent({name:"ElCheckboxButton"}),w3t=a.defineComponent({..._3t,props:F3e,emits:D3e,setup(e){const t=e,r=a.useSlots(),{isFocused:n,isChecked:i,isDisabled:o,checkboxButtonSize:s,model:l,handleChange:c}=z3e(t,r),u=a.inject(Tg,void 0),d=li("checkbox"),p=a.computed(()=>{var f,m,g,T;const y=(m=(f=u==null?void 0:u.fill)==null?void 0:f.value)!=null?m:"";return{backgroundColor:y,borderColor:y,color:(T=(g=u==null?void 0:u.textColor)==null?void 0:g.value)!=null?T:"",boxShadow:y?`-1px 0 0 0 ${y}`:void 0}}),h=a.computed(()=>[d.b("button"),d.bm("button",s.value),d.is("disabled",o.value),d.is("checked",i.value),d.is("focus",n.value)]);return(f,m)=>(a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass(a.unref(h))},[f.trueLabel||f.falseLabel?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:0,"onUpdate:modelValue":m[0]||(m[0]=g=>a.isRef(l)?l.value=g:null),class:a.normalizeClass(a.unref(d).be("button","original")),type:"checkbox",name:f.name,tabindex:f.tabindex,disabled:a.unref(o),"true-value":f.trueLabel,"false-value":f.falseLabel,onChange:m[1]||(m[1]=(...g)=>a.unref(c)&&a.unref(c)(...g)),onFocus:m[2]||(m[2]=g=>n.value=!0),onBlur:m[3]||(m[3]=g=>n.value=!1),onClick:m[4]||(m[4]=a.withModifiers(()=>{},["stop"]))},null,42,b3t)),[[a.vModelCheckbox,a.unref(l)]]):a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:1,"onUpdate:modelValue":m[5]||(m[5]=g=>a.isRef(l)?l.value=g:null),class:a.normalizeClass(a.unref(d).be("button","original")),type:"checkbox",name:f.name,tabindex:f.tabindex,disabled:a.unref(o),value:f.label,onChange:m[6]||(m[6]=(...g)=>a.unref(c)&&a.unref(c)(...g)),onFocus:m[7]||(m[7]=g=>n.value=!0),onBlur:m[8]||(m[8]=g=>n.value=!1),onClick:m[9]||(m[9]=a.withModifiers(()=>{},["stop"]))},null,42,x3t)),[[a.vModelCheckbox,a.unref(l)]]),f.$slots.default||f.label?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass(a.unref(d).be("button","inner")),style:a.normalizeStyle(a.unref(i)?a.unref(p):void 0)},[a.renderSlot(f.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(f.label),1)])],6)):a.createCommentVNode("v-if",!0)],2))}});var j3e=hi(w3t,[["__file","checkbox-button.vue"]]);const L3t=Lo({modelValue:{type:mi(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:E8,label:String,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0}}),S3t={[ss]:e=>ng(e),change:e=>ng(e)},k3t=a.defineComponent({name:"ElCheckboxGroup"}),M3t=a.defineComponent({...k3t,props:L3t,emits:S3t,setup(e,{emit:t}){const r=e,n=li("checkbox"),{formItem:i}=dh(),{inputId:o,isLabeledByFormItem:s}=gx(r,{formItemContext:i}),l=async u=>{t(ss,u),await a.nextTick(),t("change",u)},c=a.computed({get(){return r.modelValue},set(u){l(u)}});return a.provide(Tg,{...s1t(a.toRefs(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:c,changeEvent:l}),a.watch(()=>r.modelValue,()=>{r.validateEvent&&(i==null||i.validate("change").catch(u=>$s(u)))}),(u,d)=>{var p;return a.openBlock(),a.createBlock(a.resolveDynamicComponent(u.tag),{id:a.unref(o),class:a.normalizeClass(a.unref(n).b("group")),role:"group","aria-label":a.unref(s)?void 0:u.label||"checkbox-group","aria-labelledby":a.unref(s)?(p=a.unref(i))==null?void 0:p.labelId:void 0},{default:a.withCtx(()=>[a.renderSlot(u.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var U3e=hi(M3t,[["__file","checkbox-group.vue"]]);const mE=Jc(Q3t,{CheckboxButton:j3e,CheckboxGroup:U3e});Qu(j3e);const RU=Qu(U3e),G3e=Lo({size:E8,disabled:Boolean,label:{type:[String,Number,Boolean],default:""}}),C3t=Lo({...G3e,modelValue:{type:[String,Number,Boolean],default:""},name:{type:String,default:""},border:Boolean}),q3e={[ss]:e=>Js(e)||Ys(e)||ah(e),[eE]:e=>Js(e)||Ys(e)||ah(e)},W3e=Symbol("radioGroupKey"),Z3e=(e,t)=>{const r=a.ref(),n=a.inject(W3e,void 0),i=a.computed(()=>!!n),o=a.computed({get(){return i.value?n.modelValue:e.modelValue},set(d){i.value?n.changeEvent(d):t&&t(ss,d),r.value.checked=e.modelValue===e.label}}),s=uh(a.computed(()=>n==null?void 0:n.size)),l=mg(a.computed(()=>n==null?void 0:n.disabled)),c=a.ref(!1),u=a.computed(()=>l.value||i.value&&o.value!==e.label?-1:0);return{radioRef:r,isGroup:i,radioGroup:n,focus:c,size:s,disabled:l,tabIndex:u,modelValue:o}},E3t=["value","name","disabled"],A3t=a.defineComponent({name:"ElRadio"}),O3t=a.defineComponent({...A3t,props:C3t,emits:q3e,setup(e,{emit:t}){const r=e,n=li("radio"),{radioRef:i,radioGroup:o,focus:s,size:l,disabled:c,modelValue:u}=Z3e(r,t);function d(){a.nextTick(()=>t("change",u.value))}return(p,h)=>{var f;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(n).b(),a.unref(n).is("disabled",a.unref(c)),a.unref(n).is("focus",a.unref(s)),a.unref(n).is("bordered",p.border),a.unref(n).is("checked",a.unref(u)===p.label),a.unref(n).m(a.unref(l))])},[a.createElementVNode("span",{class:a.normalizeClass([a.unref(n).e("input"),a.unref(n).is("disabled",a.unref(c)),a.unref(n).is("checked",a.unref(u)===p.label)])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":h[0]||(h[0]=m=>a.isRef(u)?u.value=m:null),class:a.normalizeClass(a.unref(n).e("original")),value:p.label,name:p.name||((f=a.unref(o))==null?void 0:f.name),disabled:a.unref(c),type:"radio",onFocus:h[1]||(h[1]=m=>s.value=!0),onBlur:h[2]||(h[2]=m=>s.value=!1),onChange:d,onClick:h[3]||(h[3]=a.withModifiers(()=>{},["stop"]))},null,42,E3t),[[a.vModelRadio,a.unref(u)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(n).e("inner"))},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass(a.unref(n).e("label")),onKeydown:h[4]||(h[4]=a.withModifiers(()=>{},["stop"]))},[a.renderSlot(p.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(p.label),1)])],34)],2)}}});var H3t=hi(O3t,[["__file","radio.vue"]]);const V3t=Lo({...G3e,name:{type:String,default:""}}),I3t=["value","name","disabled"],P3t=a.defineComponent({name:"ElRadioButton"}),N3t=a.defineComponent({...P3t,props:V3t,setup(e){const t=e,r=li("radio"),{radioRef:n,focus:i,size:o,disabled:s,modelValue:l,radioGroup:c}=Z3e(t),u=a.computed(()=>({backgroundColor:(c==null?void 0:c.fill)||"",borderColor:(c==null?void 0:c.fill)||"",boxShadow:c!=null&&c.fill?`-1px 0 0 0 ${c.fill}`:"",color:(c==null?void 0:c.textColor)||""}));return(d,p)=>{var h;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(r).b("button"),a.unref(r).is("active",a.unref(l)===d.label),a.unref(r).is("disabled",a.unref(s)),a.unref(r).is("focus",a.unref(i)),a.unref(r).bm("button",a.unref(o))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:n,"onUpdate:modelValue":p[0]||(p[0]=f=>a.isRef(l)?l.value=f:null),class:a.normalizeClass(a.unref(r).be("button","original-radio")),value:d.label,type:"radio",name:d.name||((h=a.unref(c))==null?void 0:h.name),disabled:a.unref(s),onFocus:p[1]||(p[1]=f=>i.value=!0),onBlur:p[2]||(p[2]=f=>i.value=!1),onClick:p[3]||(p[3]=a.withModifiers(()=>{},["stop"]))},null,42,I3t),[[a.vModelRadio,a.unref(l)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).be("button","inner")),style:a.normalizeStyle(a.unref(l)===d.label?a.unref(u):{}),onKeydown:p[4]||(p[4]=a.withModifiers(()=>{},["stop"]))},[a.renderSlot(d.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(d.label),1)])],38)],2)}}});var K3e=hi(N3t,[["__file","radio-button.vue"]]);const B3t=Lo({id:{type:String,default:void 0},size:E8,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:""},fill:{type:String,default:""},label:{type:String,default:void 0},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0}}),R3t=q3e,F3t=["id","aria-label","aria-labelledby"],D3t=a.defineComponent({name:"ElRadioGroup"}),z3t=a.defineComponent({...D3t,props:B3t,emits:R3t,setup(e,{emit:t}){const r=e,n=li("radio"),i=fx(),o=a.ref(),{formItem:s}=dh(),{inputId:l,isLabeledByFormItem:c}=gx(r,{formItemContext:s}),u=p=>{t(ss,p),a.nextTick(()=>t("change",p))};a.onMounted(()=>{const p=o.value.querySelectorAll("[type=radio]"),h=p[0];!Array.from(p).some(f=>f.checked)&&h&&(h.tabIndex=0)});const d=a.computed(()=>r.name||i.value);return a.provide(W3e,a.reactive({...a.toRefs(r),changeEvent:u,name:d})),a.watch(()=>r.modelValue,()=>{r.validateEvent&&(s==null||s.validate("change").catch(p=>$s(p)))}),(p,h)=>(a.openBlock(),a.createElementBlock("div",{id:a.unref(l),ref_key:"radioGroupRef",ref:o,class:a.normalizeClass(a.unref(n).b("group")),role:"radiogroup","aria-label":a.unref(c)?void 0:p.label||"radio-group","aria-labelledby":a.unref(c)?a.unref(s).labelId:void 0},[a.renderSlot(p.$slots,"default")],10,F3t))}});var X3e=hi(z3t,[["__file","radio-group.vue"]]);const J3e=Jc(H3t,{RadioButton:K3e,RadioGroup:X3e}),Y3e=Qu(X3e);Qu(K3e);const $3e=Lo({type:{type:String,values:["success","info","warning","danger",""],default:""},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:{type:String,default:""},size:{type:String,values:uU,default:""},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),j3t={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},U3t=a.defineComponent({name:"ElTag"}),G3t=a.defineComponent({...U3t,props:$3e,emits:j3t,setup(e,{emit:t}){const r=e,n=uh(),i=li("tag"),o=a.computed(()=>{const{type:c,hit:u,effect:d,closable:p,round:h}=r;return[i.b(),i.is("closable",p),i.m(c),i.m(n.value),i.m(d),i.is("hit",u),i.is("round",h)]}),s=c=>{t("close",c)},l=c=>{t("click",c)};return(c,u)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(o)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ql),{key:0,class:a.normalizeClass(a.unref(i).e("close")),onClick:a.withModifiers(s,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(ax))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(i).namespace.value}-zoom-in-center`,appear:""},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(o)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ql),{key:0,class:a.normalizeClass(a.unref(i).e("close")),onClick:a.withModifiers(s,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(ax))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var q3t=hi(G3t,[["__file","tag.vue"]]);const W3t=Jc(q3t),ede=Symbol("rowContextKey"),Z3t=["start","center","end","space-around","space-between","space-evenly"],K3t=["top","middle","bottom"],X3t=Lo({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:Z3t,default:"start"},align:{type:String,values:K3t}}),J3t=a.defineComponent({name:"ElRow"}),Y3t=a.defineComponent({...J3t,props:X3t,setup(e){const t=e,r=li("row"),n=a.computed(()=>t.gutter);a.provide(ede,{gutter:n});const i=a.computed(()=>{const s={};return t.gutter&&(s.marginRight=s.marginLeft=`-${t.gutter/2}px`),s}),o=a.computed(()=>[r.b(),r.is(`justify-${t.justify}`,t.justify!=="start"),r.is(`align-${t.align}`,!!t.align)]);return(s,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(s.tag),{class:a.normalizeClass(a.unref(o)),style:a.normalizeStyle(a.unref(i))},{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var $3t=hi(Y3t,[["__file","row.vue"]]);const U3=Jc($3t),edt=Lo({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:mi([Number,Object]),default:()=>sg({})},sm:{type:mi([Number,Object]),default:()=>sg({})},md:{type:mi([Number,Object]),default:()=>sg({})},lg:{type:mi([Number,Object]),default:()=>sg({})},xl:{type:mi([Number,Object]),default:()=>sg({})}}),tdt=a.defineComponent({name:"ElCol"}),rdt=a.defineComponent({...tdt,props:edt,setup(e){const t=e,{gutter:r}=a.inject(ede,{gutter:a.computed(()=>0)}),n=li("col"),i=a.computed(()=>{const s={};return r.value&&(s.paddingLeft=s.paddingRight=`${r.value/2}px`),s}),o=a.computed(()=>{const s=[];return["span","offset","pull","push"].forEach(l=>{const c=t[l];Ys(c)&&(l==="span"?s.push(n.b(`${t[l]}`)):c>0&&s.push(n.b(`${l}-${t[l]}`)))}),["xs","sm","md","lg","xl"].forEach(l=>{Ys(t[l])?s.push(n.b(`${l}-${t[l]}`)):Sc(t[l])&&Object.entries(t[l]).forEach(([c,u])=>{s.push(c!=="span"?n.b(`${l}-${c}-${u}`):n.b(`${l}-${u}`))})}),r.value&&s.push(n.is("guttered")),[n.b(),s]});return(s,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(s.tag),{class:a.normalizeClass(a.unref(o)),style:a.normalizeStyle(a.unref(i))},{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var ndt=hi(rdt,[["__file","col.vue"]]);const B4=Jc(ndt),idt=a.defineComponent({name:"ElCollapseTransition"}),odt=a.defineComponent({...idt,setup(e){const t=li("collapse-transition"),r=i=>{i.style.maxHeight="",i.style.overflow=i.dataset.oldOverflow,i.style.paddingTop=i.dataset.oldPaddingTop,i.style.paddingBottom=i.dataset.oldPaddingBottom},n={beforeEnter(i){i.dataset||(i.dataset={}),i.dataset.oldPaddingTop=i.style.paddingTop,i.dataset.oldPaddingBottom=i.style.paddingBottom,i.style.height&&(i.dataset.elExistsHeight=i.style.height),i.style.maxHeight=0,i.style.paddingTop=0,i.style.paddingBottom=0},enter(i){requestAnimationFrame(()=>{i.dataset.oldOverflow=i.style.overflow,i.dataset.elExistsHeight?i.style.maxHeight=i.dataset.elExistsHeight:i.scrollHeight!==0?i.style.maxHeight=`${i.scrollHeight}px`:i.style.maxHeight=0,i.style.paddingTop=i.dataset.oldPaddingTop,i.style.paddingBottom=i.dataset.oldPaddingBottom,i.style.overflow="hidden"})},afterEnter(i){i.style.maxHeight="",i.style.overflow=i.dataset.oldOverflow},enterCancelled(i){r(i)},beforeLeave(i){i.dataset||(i.dataset={}),i.dataset.oldPaddingTop=i.style.paddingTop,i.dataset.oldPaddingBottom=i.style.paddingBottom,i.dataset.oldOverflow=i.style.overflow,i.style.maxHeight=`${i.scrollHeight}px`,i.style.overflow="hidden"},leave(i){i.scrollHeight!==0&&(i.style.maxHeight=0,i.style.paddingTop=0,i.style.paddingBottom=0)},afterLeave(i){r(i)},leaveCancelled(i){r(i)}};return(i,o)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(t).b()},a.toHandlers(n)),{default:a.withCtx(()=>[a.renderSlot(i.$slots,"default")]),_:3},16,["name"]))}});var gE=hi(odt,[["__file","collapse-transition.vue"]]);gE.install=e=>{e.component(gE.name,gE)};const adt=gE,sdt=Lo({color:{type:mi(Object),required:!0},vertical:{type:Boolean,default:!1}});let FU=!1;function Tx(e,t){if(!Xs)return;const r=function(o){var s;(s=t.drag)==null||s.call(t,o)},n=function(o){var s;document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",n),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",n),document.onselectstart=null,document.ondragstart=null,FU=!1,(s=t.end)==null||s.call(t,o)},i=function(o){var s;FU||(o.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",r),document.addEventListener("mouseup",n),document.addEventListener("touchmove",r),document.addEventListener("touchend",n),FU=!0,(s=t.start)==null||s.call(t,o))};e.addEventListener("mousedown",i),e.addEventListener("touchstart",i)}const ldt=e=>{const t=a.getCurrentInstance(),r=a.shallowRef(),n=a.shallowRef();function i(s){s.target!==r.value&&o(s)}function o(s){if(!n.value||!r.value)return;const l=t.vnode.el.getBoundingClientRect(),{clientX:c,clientY:u}=Fj(s);if(e.vertical){let d=u-l.top;d=Math.max(r.value.offsetHeight/2,d),d=Math.min(d,l.height-r.value.offsetHeight/2),e.color.set("alpha",Math.round((d-r.value.offsetHeight/2)/(l.height-r.value.offsetHeight)*100))}else{let d=c-l.left;d=Math.max(r.value.offsetWidth/2,d),d=Math.min(d,l.width-r.value.offsetWidth/2),e.color.set("alpha",Math.round((d-r.value.offsetWidth/2)/(l.width-r.value.offsetWidth)*100))}}return{thumb:r,bar:n,handleDrag:o,handleClick:i}},cdt=(e,{bar:t,thumb:r,handleDrag:n})=>{const i=a.getCurrentInstance(),o=li("color-alpha-slider"),s=a.ref(0),l=a.ref(0),c=a.ref();function u(){if(!r.value||e.vertical)return 0;const v=i.vnode.el,_=e.color.get("alpha");return v?Math.round(_*(v.offsetWidth-r.value.offsetWidth/2)/100):0}function d(){if(!r.value)return 0;const v=i.vnode.el;if(!e.vertical)return 0;const _=e.color.get("alpha");return v?Math.round(_*(v.offsetHeight-r.value.offsetHeight/2)/100):0}function p(){if(e.color&&e.color.value){const{r:v,g:_,b}=e.color.toRgb();return`linear-gradient(to right, rgba(${v}, ${_}, ${b}, 0) 0%, rgba(${v}, ${_}, ${b}, 1) 100%)`}return""}function h(){s.value=u(),l.value=d(),c.value=p()}a.onMounted(()=>{if(!t.value||!r.value)return;const v={drag:_=>{n(_)},end:_=>{n(_)}};Tx(t.value,v),Tx(r.value,v),h()}),a.watch(()=>e.color.get("alpha"),()=>h()),a.watch(()=>e.color.value,()=>h());const f=a.computed(()=>[o.b(),o.is("vertical",e.vertical)]),m=a.computed(()=>o.e("bar")),g=a.computed(()=>o.e("thumb")),T=a.computed(()=>({background:c.value})),y=a.computed(()=>({left:ag(s.value),top:ag(l.value)}));return{rootKls:f,barKls:m,barStyle:T,thumbKls:g,thumbStyle:y,update:h}},udt="ElColorAlphaSlider",ddt=a.defineComponent({name:udt}),pdt=a.defineComponent({...ddt,props:sdt,setup(e,{expose:t}){const r=e,{bar:n,thumb:i,handleDrag:o,handleClick:s}=ldt(r),{rootKls:l,barKls:c,barStyle:u,thumbKls:d,thumbStyle:p,update:h}=cdt(r,{bar:n,thumb:i,handleDrag:o});return t({update:h,bar:n,thumb:i}),(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(l))},[a.createElementVNode("div",{ref_key:"bar",ref:n,class:a.normalizeClass(a.unref(c)),style:a.normalizeStyle(a.unref(u)),onClick:m[0]||(m[0]=(...g)=>a.unref(s)&&a.unref(s)(...g))},null,6),a.createElementVNode("div",{ref_key:"thumb",ref:i,class:a.normalizeClass(a.unref(d)),style:a.normalizeStyle(a.unref(p))},null,6)],2))}});var hdt=hi(pdt,[["__file","alpha-slider.vue"]]);const fdt=a.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(e){const t=li("color-hue-slider"),r=a.getCurrentInstance(),n=a.ref(),i=a.ref(),o=a.ref(0),s=a.ref(0),l=a.computed(()=>e.color.get("hue"));a.watch(()=>l.value,()=>{h()});function c(f){f.target!==n.value&&u(f)}function u(f){if(!i.value||!n.value)return;const m=r.vnode.el.getBoundingClientRect(),{clientX:g,clientY:T}=Fj(f);let y;if(e.vertical){let v=T-m.top;v=Math.min(v,m.height-n.value.offsetHeight/2),v=Math.max(n.value.offsetHeight/2,v),y=Math.round((v-n.value.offsetHeight/2)/(m.height-n.value.offsetHeight)*360)}else{let v=g-m.left;v=Math.min(v,m.width-n.value.offsetWidth/2),v=Math.max(n.value.offsetWidth/2,v),y=Math.round((v-n.value.offsetWidth/2)/(m.width-n.value.offsetWidth)*360)}e.color.set("hue",y)}function d(){if(!n.value)return 0;const f=r.vnode.el;if(e.vertical)return 0;const m=e.color.get("hue");return f?Math.round(m*(f.offsetWidth-n.value.offsetWidth/2)/360):0}function p(){if(!n.value)return 0;const f=r.vnode.el;if(!e.vertical)return 0;const m=e.color.get("hue");return f?Math.round(m*(f.offsetHeight-n.value.offsetHeight/2)/360):0}function h(){o.value=d(),s.value=p()}return a.onMounted(()=>{if(!i.value||!n.value)return;const f={drag:m=>{u(m)},end:m=>{u(m)}};Tx(i.value,f),Tx(n.value,f),h()}),{bar:i,thumb:n,thumbLeft:o,thumbTop:s,hueValue:l,handleClick:c,update:h,ns:t}}});function mdt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([e.ns.b(),e.ns.is("vertical",e.vertical)])},[a.createElementVNode("div",{ref:"bar",class:a.normalizeClass(e.ns.e("bar")),onClick:t[0]||(t[0]=(...s)=>e.handleClick&&e.handleClick(...s))},null,2),a.createElementVNode("div",{ref:"thumb",class:a.normalizeClass(e.ns.e("thumb")),style:a.normalizeStyle({left:e.thumbLeft+"px",top:e.thumbTop+"px"})},null,6)],2)}var gdt=hi(fdt,[["render",mdt],["__file","hue-slider.vue"]]);const ydt=Lo({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:E8,popperClass:{type:String,default:""},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},predefine:{type:mi(Array)},validateEvent:{type:Boolean,default:!0}}),Tdt={[ss]:e=>Js(e)||oh(e),[eE]:e=>Js(e)||oh(e),activeChange:e=>Js(e)||oh(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent},tde=Symbol("colorPickerContextKey"),rde=function(e,t,r){return[e,t*r/((e=(2-t)*r)<1?e:2-e)||0,e/2]},vdt=function(e){return typeof e=="string"&&e.includes(".")&&Number.parseFloat(e)===1},Qdt=function(e){return typeof e=="string"&&e.includes("%")},vg=function(e,t){vdt(e)&&(e="100%");const r=Qdt(e);return e=Math.min(t,Math.max(0,Number.parseFloat(`${e}`))),r&&(e=Number.parseInt(`${e*t}`,10)/100),Math.abs(e-t)<1e-6?1:e%t/Number.parseFloat(t)},nde={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},yE=e=>{e=Math.min(Math.round(e),255);const t=Math.floor(e/16),r=e%16;return`${nde[t]||t}${nde[r]||r}`},ide=function({r:e,g:t,b:r}){return Number.isNaN(+e)||Number.isNaN(+t)||Number.isNaN(+r)?"":`#${yE(e)}${yE(t)}${yE(r)}`},DU={A:10,B:11,C:12,D:13,E:14,F:15},O8=function(e){return e.length===2?(DU[e[0].toUpperCase()]||+e[0])*16+(DU[e[1].toUpperCase()]||+e[1]):DU[e[1].toUpperCase()]||+e[1]},bdt=function(e,t,r){t=t/100,r=r/100;let n=t;const i=Math.max(r,.01);r*=2,t*=r<=1?r:2-r,n*=i<=1?i:2-i;const o=(r+t)/2,s=r===0?2*n/(i+n):2*t/(r+t);return{h:e,s:s*100,v:o*100}},ode=(e,t,r)=>{e=vg(e,255),t=vg(t,255),r=vg(r,255);const n=Math.max(e,t,r),i=Math.min(e,t,r);let o;const s=n,l=n-i,c=n===0?0:l/n;if(n===i)o=0;else{switch(n){case e:{o=(t-r)/l+(t<r?6:0);break}case t:{o=(r-e)/l+2;break}case r:{o=(e-t)/l+4;break}}o/=6}return{h:o*360,s:c*100,v:s*100}},vx=function(e,t,r){e=vg(e,360)*6,t=vg(t,100),r=vg(r,100);const n=Math.floor(e),i=e-n,o=r*(1-t),s=r*(1-i*t),l=r*(1-(1-i)*t),c=n%6,u=[r,s,o,o,l,r][c],d=[l,r,r,s,o,o][c],p=[o,o,l,r,r,s][c];return{r:Math.round(u*255),g:Math.round(d*255),b:Math.round(p*255)}};let Qx=class{constructor(t={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const r in t)x8(t,r)&&(this[r]=t[r]);t.value?this.fromString(t.value):this.doOnChange()}set(t,r){if(arguments.length===1&&typeof t=="object"){for(const n in t)x8(t,n)&&this.set(n,t[n]);return}this[`_${t}`]=r,this.doOnChange()}get(t){return t==="alpha"?Math.floor(this[`_${t}`]):this[`_${t}`]}toRgb(){return vx(this._hue,this._saturation,this._value)}fromString(t){if(!t){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const r=(n,i,o)=>{this._hue=Math.max(0,Math.min(360,n)),this._saturation=Math.max(0,Math.min(100,i)),this._value=Math.max(0,Math.min(100,o)),this.doOnChange()};if(t.includes("hsl")){const n=t.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,o)=>o>2?Number.parseFloat(i):Number.parseInt(i,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:i,s:o,v:s}=bdt(n[0],n[1],n[2]);r(i,o,s)}}else if(t.includes("hsv")){const n=t.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,o)=>o>2?Number.parseFloat(i):Number.parseInt(i,10));n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3&&r(n[0],n[1],n[2])}else if(t.includes("rgb")){const n=t.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(i=>i!=="").map((i,o)=>o>2?Number.parseFloat(i):Number.parseInt(i,10));if(n.length===4?this._alpha=Number.parseFloat(n[3])*100:n.length===3&&(this._alpha=100),n.length>=3){const{h:i,s:o,v:s}=ode(n[0],n[1],n[2]);r(i,o,s)}}else if(t.includes("#")){const n=t.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n))return;let i,o,s;n.length===3?(i=O8(n[0]+n[0]),o=O8(n[1]+n[1]),s=O8(n[2]+n[2])):(n.length===6||n.length===8)&&(i=O8(n.slice(0,2)),o=O8(n.slice(2,4)),s=O8(n.slice(4,6))),n.length===8?this._alpha=O8(n.slice(6))/255*100:(n.length===3||n.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=ode(i,o,s);r(l,c,u)}}compare(t){return Math.abs(t._hue-this._hue)<2&&Math.abs(t._saturation-this._saturation)<1&&Math.abs(t._value-this._value)<1&&Math.abs(t._alpha-this._alpha)<1}doOnChange(){const{_hue:t,_saturation:r,_value:n,_alpha:i,format:o}=this;if(this.enableAlpha)switch(o){case"hsl":{const s=rde(t,r/100,n/100);this.value=`hsla(${t}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${t}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${ide(vx(t,r,n))}${yE(i*255/100)}`;break}default:{const{r:s,g:l,b:c}=vx(t,r,n);this.value=`rgba(${s}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(o){case"hsl":{const s=rde(t,r/100,n/100);this.value=`hsl(${t}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${t}, ${Math.round(r)}%, ${Math.round(n)}%)`;break}case"rgb":{const{r:s,g:l,b:c}=vx(t,r,n);this.value=`rgb(${s}, ${l}, ${c})`;break}default:this.value=ide(vx(t,r,n))}}};const xdt=a.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0}},setup(e){const t=li("color-predefine"),{currentColor:r}=a.inject(tde),n=a.ref(o(e.colors,e.color));a.watch(()=>r.value,s=>{const l=new Qx;l.fromString(s),n.value.forEach(c=>{c.selected=l.compare(c)})}),a.watchEffect(()=>{n.value=o(e.colors,e.color)});function i(s){e.color.fromString(e.colors[s])}function o(s,l){return s.map(c=>{const u=new Qx;return u.enableAlpha=!0,u.format="rgba",u.fromString(c),u.selected=u.value===l.value,u})}return{rgbaColors:n,handleSelect:i,ns:t}}}),_dt=["onClick"];function wdt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(e.ns.b())},[a.createElementVNode("div",{class:a.normalizeClass(e.ns.e("colors"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.rgbaColors,(s,l)=>(a.openBlock(),a.createElementBlock("div",{key:e.colors[l],class:a.normalizeClass([e.ns.e("color-selector"),e.ns.is("alpha",s._alpha<100),{selected:s.selected}]),onClick:c=>e.handleSelect(l)},[a.createElementVNode("div",{style:a.normalizeStyle({backgroundColor:s.value})},null,4)],10,_dt))),128))],2)],2)}var Ldt=hi(xdt,[["render",wdt],["__file","predefine.vue"]]);const Sdt=a.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(e){const t=li("color-svpanel"),r=a.getCurrentInstance(),n=a.ref(0),i=a.ref(0),o=a.ref("hsl(0, 100%, 50%)"),s=a.computed(()=>{const u=e.color.get("hue"),d=e.color.get("value");return{hue:u,value:d}});function l(){const u=e.color.get("saturation"),d=e.color.get("value"),p=r.vnode.el,{clientWidth:h,clientHeight:f}=p;i.value=u*h/100,n.value=(100-d)*f/100,o.value=`hsl(${e.color.get("hue")}, 100%, 50%)`}function c(u){const d=r.vnode.el.getBoundingClientRect(),{clientX:p,clientY:h}=Fj(u);let f=p-d.left,m=h-d.top;f=Math.max(0,f),f=Math.min(f,d.width),m=Math.max(0,m),m=Math.min(m,d.height),i.value=f,n.value=m,e.color.set({saturation:f/d.width*100,value:100-m/d.height*100})}return a.watch(()=>s.value,()=>{l()}),a.onMounted(()=>{Tx(r.vnode.el,{drag:u=>{c(u)},end:u=>{c(u)}}),l()}),{cursorTop:n,cursorLeft:i,background:o,colorValue:s,handleDrag:c,update:l,ns:t}}}),kdt=a.createElementVNode("div",null,null,-1),Mdt=[kdt];function Cdt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(e.ns.b()),style:a.normalizeStyle({backgroundColor:e.background})},[a.createElementVNode("div",{class:a.normalizeClass(e.ns.e("white"))},null,2),a.createElementVNode("div",{class:a.normalizeClass(e.ns.e("black"))},null,2),a.createElementVNode("div",{class:a.normalizeClass(e.ns.e("cursor")),style:a.normalizeStyle({top:e.cursorTop+"px",left:e.cursorLeft+"px"})},Mdt,6)],6)}var Edt=hi(Sdt,[["render",Cdt],["__file","sv-panel.vue"]]);const Adt=["onKeydown"],Odt=["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex"],Hdt=a.defineComponent({name:"ElColorPicker"}),Vdt=a.defineComponent({...Hdt,props:ydt,emits:Tdt,setup(e,{expose:t,emit:r}){const n=e,{t:i}=lg(),o=li("color"),{formItem:s}=dh(),l=uh(),c=mg(),{inputId:u,isLabeledByFormItem:d}=gx(n,{formItemContext:s}),p=a.ref(),h=a.ref(),f=a.ref(),m=a.ref(),g=a.ref(),T=a.ref(),{isFocused:y,handleFocus:v,handleBlur:_}=u3e(g,{beforeBlur(ne){var ye;return(ye=m.value)==null?void 0:ye.isFocusInsideContent(ne)},afterBlur(){G(!1),U()}}),b=ne=>{if(c.value)return ue();v(ne)};let L=!0;const w=a.reactive(new Qx({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue})),k=a.ref(!1),C=a.ref(!1),A=a.ref(""),O=a.computed(()=>!n.modelValue&&!C.value?"transparent":j(w,n.showAlpha)),N=a.computed(()=>!n.modelValue&&!C.value?"":w.value),I=a.computed(()=>d.value?void 0:n.label||i("el.colorpicker.defaultLabel")),R=a.computed(()=>d.value?s==null?void 0:s.labelId:void 0),D=a.computed(()=>[o.b("picker"),o.is("disabled",c.value),o.bm("picker",l.value),o.is("focused",y.value)]);function j(ne,ye){if(!(ne instanceof Qx))throw new TypeError("color should be instance of _color Class");const{r:_e,g:Ie,b:qe}=ne.toRgb();return ye?`rgba(${_e}, ${Ie}, ${qe}, ${ne.get("alpha")/100})`:`rgb(${_e}, ${Ie}, ${qe})`}function G(ne){k.value=ne}const P=oU(G,100,{leading:!0});function W(){c.value||G(!0)}function K(){P(!1),U()}function U(){a.nextTick(()=>{n.modelValue?w.fromString(n.modelValue):(w.value="",a.nextTick(()=>{C.value=!1}))})}function X(){c.value||P(!k.value)}function ee(){w.fromString(A.value)}function oe(){const ne=w.value;r(ss,ne),r("change",ne),n.validateEvent&&(s==null||s.validate("change").catch(ye=>$s(ye))),P(!1),a.nextTick(()=>{const ye=new Qx({enableAlpha:n.showAlpha,format:n.colorFormat||"",value:n.modelValue});w.compare(ye)||U()})}function he(){P(!1),r(ss,null),r("change",null),n.modelValue!==null&&n.validateEvent&&(s==null||s.validate("change").catch(ne=>$s(ne))),U()}function me(ne){if(k.value&&(K(),y.value)){const ye=new FocusEvent("focus",ne);_(ye)}}function ie(ne){ne.preventDefault(),ne.stopPropagation(),G(!1),U()}function be(ne){switch(ne.code){case kc.enter:case kc.space:ne.preventDefault(),ne.stopPropagation(),W(),T.value.focus();break;case kc.esc:ie(ne);break}}function re(){g.value.focus()}function ue(){g.value.blur()}return a.onMounted(()=>{n.modelValue&&(A.value=N.value)}),a.watch(()=>n.modelValue,ne=>{ne?ne&&ne!==w.value&&(L=!1,w.fromString(ne)):C.value=!1}),a.watch(()=>N.value,ne=>{A.value=ne,L&&r("activeChange",ne),L=!0}),a.watch(()=>w.value,()=>{!n.modelValue&&!C.value&&(C.value=!0)}),a.watch(()=>k.value,()=>{a.nextTick(()=>{var ne,ye,_e;(ne=p.value)==null||ne.update(),(ye=h.value)==null||ye.update(),(_e=f.value)==null||_e.update()})}),a.provide(tde,{currentColor:N}),t({color:w,show:W,hide:K,focus:re,blur:ue}),(ne,ye)=>(a.openBlock(),a.createBlock(a.unref(OU),{ref_key:"popper",ref:m,visible:k.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[a.unref(o).be("picker","panel"),a.unref(o).b("dropdown"),ne.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",transition:`${a.unref(o).namespace.value}-zoom-in-top`,persistent:"",onHide:ye[2]||(ye[2]=_e=>G(!1))},{content:a.withCtx(()=>[a.withDirectives((a.openBlock(),a.createElementBlock("div",{onKeydown:a.withKeys(ie,["esc"])},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(o).be("dropdown","main-wrapper"))},[a.createVNode(gdt,{ref_key:"hue",ref:p,class:"hue-slider",color:a.unref(w),vertical:""},null,8,["color"]),a.createVNode(Edt,{ref_key:"sv",ref:h,color:a.unref(w)},null,8,["color"])],2),ne.showAlpha?(a.openBlock(),a.createBlock(hdt,{key:0,ref_key:"alpha",ref:f,color:a.unref(w)},null,8,["color"])):a.createCommentVNode("v-if",!0),ne.predefine?(a.openBlock(),a.createBlock(Ldt,{key:1,ref:"predefine",color:a.unref(w),colors:ne.predefine},null,8,["color","colors"])):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{class:a.normalizeClass(a.unref(o).be("dropdown","btns"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(o).be("dropdown","value"))},[a.createVNode(a.unref(lE),{ref_key:"inputRef",ref:T,modelValue:A.value,"onUpdate:modelValue":ye[0]||(ye[0]=_e=>A.value=_e),"validate-event":!1,size:"small",onKeyup:a.withKeys(ee,["enter"]),onBlur:ee},null,8,["modelValue","onKeyup"])],2),a.createVNode(a.unref(j3),{class:a.normalizeClass(a.unref(o).be("dropdown","link-btn")),text:"",size:"small",onClick:he},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(i)("el.colorpicker.clear")),1)]),_:1},8,["class"]),a.createVNode(a.unref(j3),{plain:"",size:"small",class:a.normalizeClass(a.unref(o).be("dropdown","btn")),onClick:oe},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(i)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,Adt)),[[a.unref(R3e),me]])]),default:a.withCtx(()=>[a.createElementVNode("div",{id:a.unref(u),ref_key:"triggerRef",ref:g,class:a.normalizeClass(a.unref(D)),role:"button","aria-label":a.unref(I),"aria-labelledby":a.unref(R),"aria-description":a.unref(i)("el.colorpicker.description",{color:ne.modelValue||""}),"aria-disabled":a.unref(c),tabindex:a.unref(c)?-1:ne.tabindex,onKeydown:be,onFocus:b,onBlur:ye[1]||(ye[1]=(..._e)=>a.unref(_)&&a.unref(_)(..._e))},[a.unref(c)?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(o).be("picker","mask"))},null,2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{class:a.normalizeClass(a.unref(o).be("picker","trigger")),onClick:X},[a.createElementVNode("span",{class:a.normalizeClass([a.unref(o).be("picker","color"),a.unref(o).is("alpha",ne.showAlpha)])},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(o).be("picker","color-inner")),style:a.normalizeStyle({backgroundColor:a.unref(O)})},[a.withDirectives(a.createVNode(a.unref(ql),{class:a.normalizeClass([a.unref(o).be("picker","icon"),a.unref(o).is("icon-arrow-down")])},{default:a.withCtx(()=>[a.createVNode(a.unref(sh))]),_:1},8,["class"]),[[a.vShow,ne.modelValue||C.value]]),a.withDirectives(a.createVNode(a.unref(ql),{class:a.normalizeClass([a.unref(o).be("picker","empty"),a.unref(o).is("icon-close")])},{default:a.withCtx(()=>[a.createVNode(a.unref(ax))]),_:1},8,["class"]),[[a.vShow,!ne.modelValue&&!C.value]])],6)],2)],2)],42,Odt)]),_:1},8,["visible","popper-class","transition"]))}});var Idt=hi(Vdt,[["__file","color-picker.vue"]]);const Pdt=Jc(Idt),Ndt=a.defineComponent({name:"ElContainer"}),Bdt=a.defineComponent({...Ndt,props:{direction:{type:String}},setup(e){const t=e,r=a.useSlots(),n=li("container"),i=a.computed(()=>t.direction==="vertical"?!0:t.direction==="horizontal"?!1:r&&r.default?r.default().some(o=>{const s=o.type.name;return s==="ElHeader"||s==="ElFooter"}):!1);return(o,s)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(n).b(),a.unref(n).is("vertical",a.unref(i))])},[a.renderSlot(o.$slots,"default")],2))}});var Rdt=hi(Bdt,[["__file","container.vue"]]);const Fdt=a.defineComponent({name:"ElAside"}),Ddt=a.defineComponent({...Fdt,props:{width:{type:String,default:null}},setup(e){const t=e,r=li("aside"),n=a.computed(()=>t.width?r.cssVarBlock({width:t.width}):{});return(i,o)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(r).b()),style:a.normalizeStyle(a.unref(n))},[a.renderSlot(i.$slots,"default")],6))}});var ade=hi(Ddt,[["__file","aside.vue"]]);const zdt=a.defineComponent({name:"ElFooter"}),jdt=a.defineComponent({...zdt,props:{height:{type:String,default:null}},setup(e){const t=e,r=li("footer"),n=a.computed(()=>t.height?r.cssVarBlock({height:t.height}):{});return(i,o)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(r).b()),style:a.normalizeStyle(a.unref(n))},[a.renderSlot(i.$slots,"default")],6))}});var sde=hi(jdt,[["__file","footer.vue"]]);const Udt=a.defineComponent({name:"ElHeader"}),Gdt=a.defineComponent({...Udt,props:{height:{type:String,default:null}},setup(e){const t=e,r=li("header"),n=a.computed(()=>t.height?r.cssVarBlock({height:t.height}):{});return(i,o)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(r).b()),style:a.normalizeStyle(a.unref(n))},[a.renderSlot(i.$slots,"default")],6))}});var lde=hi(Gdt,[["__file","header.vue"]]);const qdt=a.defineComponent({name:"ElMain"}),Wdt=a.defineComponent({...qdt,setup(e){const t=li("main");return(r,n)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(t).b())},[a.renderSlot(r.$slots,"default")],2))}});var cde=hi(Wdt,[["__file","main.vue"]]);const Zdt=Jc(Rdt,{Aside:ade,Footer:sde,Header:lde,Main:cde});Qu(ade),Qu(sde),Qu(lde);const ude=Qu(cde),Kdt=a.defineComponent({inheritAttrs:!1});function Xdt(e,t,r,n,i,o){return a.renderSlot(e.$slots,"default")}var Jdt=hi(Kdt,[["render",Xdt],["__file","collection.vue"]]);const Ydt=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function $dt(e,t,r,n,i,o){return a.renderSlot(e.$slots,"default")}var e4t=hi(Ydt,[["render",$dt],["__file","collection-item.vue"]]);const t4t="data-el-collection-item",r4t=e=>{const t=`El${e}Collection`,r=`${t}Item`,n=Symbol(t),i=Symbol(r),o={...Jdt,name:t,setup(){const l=a.ref(null),c=new Map;a.provide(n,{itemMap:c,getItems:()=>{const u=a.unref(l);if(!u)return[];const d=Array.from(u.querySelectorAll(`[${t4t}]`));return[...c.values()].sort((p,h)=>d.indexOf(p.ref)-d.indexOf(h.ref))},collectionRef:l})}},s={...e4t,name:r,setup(l,{attrs:c}){const u=a.ref(null),d=a.inject(n,void 0);a.provide(i,{collectionItemRef:u}),a.onMounted(()=>{const p=a.unref(u);p&&d.itemMap.set(p,{ref:p,...c})}),a.onBeforeUnmount(()=>{const p=a.unref(u);d.itemMap.delete(p)})}};return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:i,ElCollection:o,ElCollectionItem:s}},zU=Lo({trigger:yx.trigger,effect:{...T2.effect,default:"light"},type:{type:mi(String)},placement:{type:mi(String),default:"bottom"},popperOptions:{type:mi(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:mi([Number,String]),default:0},maxHeight:{type:mi([Number,String]),default:""},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},role:{type:String,default:"menu"},buttonProps:{type:mi(Object)},teleported:T2.teleported});Lo({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:lh}}),Lo({onKeydown:{type:mi(Function)}}),r4t("Dropdown");const dde=Symbol("ElSelectGroup"),TE=Symbol("ElSelect");function n4t(e,t){const r=a.inject(TE),n=a.inject(dde,{disabled:!1}),i=a.computed(()=>Sc(e.value)),o=a.computed(()=>r.props.multiple?p(r.props.modelValue,e.value):h(e.value,r.props.modelValue)),s=a.computed(()=>{if(r.props.multiple){const g=r.props.modelValue||[];return!o.value&&g.length>=r.props.multipleLimit&&r.props.multipleLimit>0}else return!1}),l=a.computed(()=>e.label||(i.value?"":e.value)),c=a.computed(()=>e.value||e.label||""),u=a.computed(()=>e.disabled||t.groupDisabled||s.value),d=a.getCurrentInstance(),p=(g=[],T)=>{if(i.value){const y=r.props.valueKey;return g&&g.some(v=>a.toRaw(y2(v,y))===y2(T,y))}else return g&&g.includes(T)},h=(g,T)=>{if(i.value){const{valueKey:y}=r.props;return y2(g,y)===y2(T,y)}else return g===T},f=()=>{!e.disabled&&!n.disabled&&(r.hoverIndex=r.optionsArray.indexOf(d.proxy))};a.watch(()=>l.value,()=>{!e.created&&!r.props.remote&&r.setSelected()}),a.watch(()=>e.value,(g,T)=>{const{remote:y,valueKey:v}=r.props;if(Object.is(g,T)||(r.onOptionDestroy(T,d.proxy),r.onOptionCreate(d.proxy)),!e.created&&!y){if(v&&Sc(g)&&Sc(T)&&g[v]===T[v])return;r.setSelected()}}),a.watch(()=>n.disabled,()=>{t.groupDisabled=n.disabled},{immediate:!0});const{queryChange:m}=a.toRaw(r);return a.watch(m,g=>{const{query:T}=a.unref(g),y=new RegExp(c1t(T),"i");t.visible=y.test(l.value)||e.created,t.visible||r.filteredOptionsCount--},{immediate:!0}),{select:r,currentLabel:l,currentValue:c,itemSelected:o,isDisabled:u,hoverItem:f}}const i4t=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(e){const t=li("select"),r=fx(),n=a.computed(()=>[t.be("dropdown","item"),t.is("disabled",a.unref(l)),{selected:a.unref(s),hover:a.unref(p)}]),i=a.reactive({index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}),{currentLabel:o,itemSelected:s,isDisabled:l,select:c,hoverItem:u}=n4t(e,i),{visible:d,hover:p}=a.toRefs(i),h=a.getCurrentInstance().proxy;c.onOptionCreate(h),a.onBeforeUnmount(()=>{const m=h.value,{selected:g}=c,T=(c.props.multiple?g:[g]).some(y=>y.value===h.value);a.nextTick(()=>{c.cachedOptions.get(m)===h&&!T&&c.cachedOptions.delete(m)}),c.onOptionDestroy(m,h)});function f(){e.disabled!==!0&&i.groupDisabled!==!0&&c.handleOptionSelect(h)}return{ns:t,id:r,containerKls:n,currentLabel:o,itemSelected:s,isDisabled:l,select:c,hoverItem:u,visible:d,hover:p,selectOptionClick:f,states:i}}}),o4t=["id","aria-disabled","aria-selected"];function a4t(e,t,r,n,i,o){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:e.id,class:a.normalizeClass(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMouseenter:t[0]||(t[0]=(...s)=>e.hoverItem&&e.hoverItem(...s)),onClick:t[1]||(t[1]=a.withModifiers((...s)=>e.selectOptionClick&&e.selectOptionClick(...s),["stop"]))},[a.renderSlot(e.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(e.currentLabel),1)])],42,o4t)),[[a.vShow,e.visible]])}var jU=hi(i4t,[["render",a4t],["__file","option.vue"]]);const s4t=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=a.inject(TE),t=li("select"),r=a.computed(()=>e.props.popperClass),n=a.computed(()=>e.props.multiple),i=a.computed(()=>e.props.fitInputWidth),o=a.ref("");function s(){var l;o.value=`${(l=e.selectWrapper)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{s(),zC(e.selectWrapper,s)}),{ns:t,minWidth:o,popperClass:r,isMultiple:n,isFitInputWidth:i}}});function l4t(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:a.normalizeStyle({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(e.ns.be("dropdown","header"))},[a.renderSlot(e.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(e.$slots,"default"),e.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(e.ns.be("dropdown","footer"))},[a.renderSlot(e.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var c4t=hi(s4t,[["render",l4t],["__file","select-dropdown.vue"]]);function u4t(e){const{t}=lg();return a.reactive({options:new Map,cachedOptions:new Map,disabledOptions:new Map,createdLabel:null,createdSelected:!1,selected:e.multiple?[]:{},inputLength:20,inputWidth:0,optionsCount:0,filteredOptionsCount:0,visible:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,cachedPlaceHolder:"",currentPlaceholder:t("el.select.placeholder"),menuVisibleOnFocus:!1,isOnComposition:!1,prefixWidth:11,mouseEnter:!1,focused:!1})}const d4t=(e,t,r)=>{const{t:n}=lg(),i=li("select");Cue({from:"suffixTransition",replacement:"override style scheme",version:"2.3.0",scope:"props",ref:"https://element-plus.org/en-US/component/select.html#select-attributes"},a.computed(()=>e.suffixTransition===!1));const o=a.ref(null),s=a.ref(null),l=a.ref(null),c=a.ref(null),u=a.ref(null),d=a.ref(null),p=a.ref(null),h=a.ref(null),f=a.ref(),m=a.shallowRef({query:""}),g=a.shallowRef(""),T=a.ref([]);let y=0;const{form:v,formItem:_}=dh(),b=a.computed(()=>!e.filterable||e.multiple||!t.visible),L=a.computed(()=>e.disabled||(v==null?void 0:v.disabled)),w=a.computed(()=>{const wt=e.multiple?Array.isArray(e.modelValue)&&e.modelValue.length>0:e.modelValue!==void 0&&e.modelValue!==null&&e.modelValue!=="";return e.clearable&&!L.value&&t.inputHovering&&wt}),k=a.computed(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),C=a.computed(()=>i.is("reverse",k.value&&t.visible&&e.suffixTransition)),A=a.computed(()=>(v==null?void 0:v.statusIcon)&&(_==null?void 0:_.validateState)&&kue[_==null?void 0:_.validateState]),O=a.computed(()=>e.remote?300:0),N=a.computed(()=>e.loading?e.loadingText||n("el.select.loading"):e.remote&&t.query===""&&t.options.size===0?!1:e.filterable&&t.query&&t.options.size>0&&t.filteredOptionsCount===0?e.noMatchText||n("el.select.noMatch"):t.options.size===0?e.noDataText||n("el.select.noData"):null),I=a.computed(()=>{const wt=Array.from(t.options.values()),je=[];return T.value.forEach(ke=>{const Oe=wt.findIndex(Ye=>Ye.currentLabel===ke);Oe>-1&&je.push(wt[Oe])}),je.length>=wt.length?je:wt}),R=a.computed(()=>Array.from(t.cachedOptions.values())),D=a.computed(()=>{const wt=I.value.filter(je=>!je.created).some(je=>je.currentLabel===t.query);return e.filterable&&e.allowCreate&&t.query!==""&&!wt}),j=uh(),G=a.computed(()=>["small"].includes(j.value)?"small":"default"),P=a.computed({get(){return t.visible&&N.value!==!1},set(wt){t.visible=wt}});a.watch([()=>L.value,()=>j.value,()=>v==null?void 0:v.size],()=>{a.nextTick(()=>{W()})}),a.watch(()=>e.placeholder,wt=>{t.cachedPlaceHolder=t.currentPlaceholder=wt,e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(t.currentPlaceholder="")}),a.watch(()=>e.modelValue,(wt,je)=>{e.multiple&&(W(),wt&&wt.length>0||s.value&&t.query!==""?t.currentPlaceholder="":t.currentPlaceholder=t.cachedPlaceHolder,e.filterable&&!e.reserveKeyword&&(t.query="",K(t.query))),ee(),e.filterable&&!e.multiple&&(t.inputLength=20),!aU(wt,je)&&e.validateEvent&&(_==null||_.validate("change").catch(ke=>$s(ke)))},{flush:"post",deep:!0}),a.watch(()=>t.visible,wt=>{var je,ke,Oe,Ye,ve;wt?((ke=(je=c.value)==null?void 0:je.updatePopper)==null||ke.call(je),e.filterable&&(t.filteredOptionsCount=t.optionsCount,t.query=e.remote?"":t.selectedLabel,(Ye=(Oe=l.value)==null?void 0:Oe.focus)==null||Ye.call(Oe),e.multiple?(ve=s.value)==null||ve.focus():t.selectedLabel&&(t.currentPlaceholder=`${t.selectedLabel}`,t.selectedLabel=""),K(t.query),!e.multiple&&!e.remote&&(m.value.query="",a.triggerRef(m),a.triggerRef(g)))):(e.filterable&&(g2(e.filterMethod)&&e.filterMethod(""),g2(e.remoteMethod)&&e.remoteMethod("")),t.query="",t.previousQuery=null,t.selectedLabel="",t.inputLength=20,t.menuVisibleOnFocus=!1,he(),a.nextTick(()=>{s.value&&s.value.value===""&&t.selected.length===0&&(t.currentPlaceholder=t.cachedPlaceHolder)}),e.multiple||(t.selected&&(e.filterable&&e.allowCreate&&t.createdSelected&&t.createdLabel?t.selectedLabel=t.createdLabel:t.selectedLabel=t.selected.currentLabel,e.filterable&&(t.query=t.selectedLabel)),e.filterable&&(t.currentPlaceholder=t.cachedPlaceHolder))),r.emit("visible-change",wt)}),a.watch(()=>t.options.entries(),()=>{var wt,je,ke;if(!Xs)return;(je=(wt=c.value)==null?void 0:wt.updatePopper)==null||je.call(wt),e.multiple&&W();const Oe=((ke=p.value)==null?void 0:ke.querySelectorAll("input"))||[];(!e.filterable&&!e.defaultFirstOption&&!nx(e.modelValue)||!Array.from(Oe).includes(document.activeElement))&&ee(),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&X()},{flush:"post"}),a.watch(()=>t.hoverIndex,wt=>{Ys(wt)&&wt>-1?f.value=I.value[wt]||{}:f.value={},I.value.forEach(je=>{je.hover=f.value===je})});const W=()=>{a.nextTick(()=>{var wt,je;if(!o.value)return;const ke=o.value.$el.querySelector("input");y=y||(ke.clientHeight>0?ke.clientHeight+2:0);const Oe=d.value,Ye=getComputedStyle(ke).getPropertyValue(i.cssVarName("input-height")),ve=Number.parseFloat(Ye)||I1t(j.value||(v==null?void 0:v.size)),Ae=j.value||ve===y||y<=0?ve:y;ke.offsetParent!==null&&(ke.style.height=`${(t.selected.length===0?Ae:Math.max(Oe?Oe.clientHeight+(Oe.clientHeight>Ae?6:0):0,Ae))-2}px`),t.visible&&N.value!==!1&&((je=(wt=c.value)==null?void 0:wt.updatePopper)==null||je.call(wt))})},K=async wt=>{if(!(t.previousQuery===wt||t.isOnComposition)){if(t.previousQuery===null&&(g2(e.filterMethod)||g2(e.remoteMethod))){t.previousQuery=wt;return}t.previousQuery=wt,a.nextTick(()=>{var je,ke;t.visible&&((ke=(je=c.value)==null?void 0:je.updatePopper)==null||ke.call(je))}),t.hoverIndex=-1,e.multiple&&e.filterable&&a.nextTick(()=>{if(!L.value){const je=s.value.value.length*15+20;t.inputLength=e.collapseTags?Math.min(50,je):je,U()}W()}),e.remote&&g2(e.remoteMethod)?(t.hoverIndex=-1,e.remoteMethod(wt)):g2(e.filterMethod)?(e.filterMethod(wt),a.triggerRef(g)):(t.filteredOptionsCount=t.optionsCount,m.value.query=wt,a.triggerRef(m),a.triggerRef(g)),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&(await a.nextTick(),X())}},U=()=>{t.currentPlaceholder!==""&&(t.currentPlaceholder=s.value.value?"":t.cachedPlaceHolder)},X=()=>{const wt=I.value.filter(Oe=>Oe.visible&&!Oe.disabled&&!Oe.states.groupDisabled),je=wt.find(Oe=>Oe.created),ke=wt[0];t.hoverIndex=et(I.value,je||ke)},ee=()=>{var wt;if(e.multiple)t.selectedLabel="";else{const ke=oe(e.modelValue);(wt=ke.props)!=null&&wt.created?(t.createdLabel=ke.props.value,t.createdSelected=!0):t.createdSelected=!1,t.selectedLabel=ke.currentLabel,t.selected=ke,e.filterable&&(t.query=t.selectedLabel);return}const je=[];Array.isArray(e.modelValue)&&e.modelValue.forEach(ke=>{je.push(oe(ke))}),t.selected=je,a.nextTick(()=>{W()})},oe=wt=>{let je;const ke=Dj(wt).toLowerCase()==="object",Oe=Dj(wt).toLowerCase()==="null",Ye=Dj(wt).toLowerCase()==="undefined";for(let Be=t.cachedOptions.size-1;Be>=0;Be--){const Se=R.value[Be];if(ke?y2(Se.value,e.valueKey)===y2(wt,e.valueKey):Se.value===wt){je={value:wt,currentLabel:Se.currentLabel,isDisabled:Se.isDisabled};break}}if(je)return je;const ve=ke?wt.label:!Oe&&!Ye?wt:"",Ae={value:wt,currentLabel:ve};return e.multiple&&(Ae.hitState=!1),Ae},he=()=>{setTimeout(()=>{const wt=e.valueKey;e.multiple?t.selected.length>0?t.hoverIndex=Math.min.apply(null,t.selected.map(je=>I.value.findIndex(ke=>y2(ke,wt)===y2(je,wt)))):t.hoverIndex=-1:t.hoverIndex=I.value.findIndex(je=>St(je)===St(t.selected))},300)},me=()=>{var wt,je;ie(),(je=(wt=c.value)==null?void 0:wt.updatePopper)==null||je.call(wt),e.multiple&&W()},ie=()=>{var wt;t.inputWidth=(wt=o.value)==null?void 0:wt.$el.offsetWidth},be=()=>{e.filterable&&t.query!==t.selectedLabel&&(t.query=t.selectedLabel,K(t.query))},re=oU(()=>{be()},O.value),ue=oU(wt=>{K(wt.target.value)},O.value),ne=wt=>{aU(e.modelValue,wt)||r.emit(eE,wt)},ye=wt=>r1t(wt,je=>!t.disabledOptions.has(je)),_e=wt=>{if(wt.code!==kc.delete){if(wt.target.value.length<=0&&!yt()){const je=e.modelValue.slice(),ke=ye(je);if(ke<0)return;je.splice(ke,1),r.emit(ss,je),ne(je)}wt.target.value.length===1&&e.modelValue.length===0&&(t.currentPlaceholder=t.cachedPlaceHolder)}},Ie=(wt,je)=>{const ke=t.selected.indexOf(je);if(ke>-1&&!L.value){const Oe=e.modelValue.slice();Oe.splice(ke,1),r.emit(ss,Oe),ne(Oe),r.emit("remove-tag",je.value)}wt.stopPropagation(),$e()},qe=wt=>{wt.stopPropagation();const je=e.multiple?[]:"";if(!Js(je))for(const ke of t.selected)ke.isDisabled&&je.push(ke.value);r.emit(ss,je),ne(je),t.hoverIndex=-1,t.visible=!1,r.emit("clear"),$e()},Ge=wt=>{var je;if(e.multiple){const ke=(e.modelValue||[]).slice(),Oe=et(ke,wt.value);Oe>-1?ke.splice(Oe,1):(e.multipleLimit<=0||ke.length<e.multipleLimit)&&ke.push(wt.value),r.emit(ss,ke),ne(ke),wt.created&&(t.query="",K(""),t.inputLength=20),e.filterable&&((je=s.value)==null||je.focus())}else r.emit(ss,wt.value),ne(wt.value),t.visible=!1;Ve(),!t.visible&&a.nextTick(()=>{Ne(wt)})},et=(wt=[],je)=>{if(!Sc(je))return wt.indexOf(je);const ke=e.valueKey;let Oe=-1;return wt.some((Ye,ve)=>a.toRaw(y2(Ye,ke))===y2(je,ke)?(Oe=ve,!0):!1),Oe},Ve=()=>{const wt=s.value||o.value;wt&&(wt==null||wt.focus())},Ne=wt=>{var je,ke,Oe,Ye,ve;const Ae=Array.isArray(wt)?wt[0]:wt;let Be=null;if(Ae!=null&&Ae.value){const Se=I.value.filter(ge=>ge.value===Ae.value);Se.length>0&&(Be=Se[0].$el)}if(c.value&&Be){const Se=(Ye=(Oe=(ke=(je=c.value)==null?void 0:je.popperRef)==null?void 0:ke.contentRef)==null?void 0:Oe.querySelector)==null?void 0:Ye.call(Oe,`.${i.be("dropdown","wrap")}`);Se&&p1t(Se,Be)}(ve=h.value)==null||ve.handleScroll()},it=wt=>{t.optionsCount++,t.filteredOptionsCount++,t.options.set(wt.value,wt),t.cachedOptions.set(wt.value,wt),wt.disabled&&t.disabledOptions.set(wt.value,wt)},Re=(wt,je)=>{t.options.get(wt)===je&&(t.optionsCount--,t.filteredOptionsCount--,t.options.delete(wt))},pt=wt=>{wt.code!==kc.backspace&&yt(!1),t.inputLength=s.value.value.length*15+20,W()},yt=wt=>{if(!Array.isArray(t.selected))return;const je=ye(t.selected.map(Oe=>Oe.value)),ke=t.selected[je];if(ke)return wt===!0||wt===!1?(ke.hitState=wt,wt):(ke.hitState=!ke.hitState,ke.hitState)},ct=wt=>{const je=wt.target.value;if(wt.type==="compositionend")t.isOnComposition=!1,a.nextTick(()=>K(je));else{const ke=je[je.length-1]||"";t.isOnComposition=!Mue(ke)}},xe=()=>{a.nextTick(()=>Ne(t.selected))},Ue=wt=>{t.focused||((e.automaticDropdown||e.filterable)&&(e.filterable&&!t.visible&&(t.menuVisibleOnFocus=!0),t.visible=!0),t.focused=!0,r.emit("focus",wt))},$e=()=>{var wt,je;t.visible?(wt=s.value||o.value)==null||wt.focus():(je=o.value)==null||je.focus()},at=()=>{var wt,je,ke;t.visible=!1,(wt=o.value)==null||wt.blur(),(ke=(je=l.value)==null?void 0:je.blur)==null||ke.call(je)},Ht=wt=>{var je,ke,Oe;(je=c.value)!=null&&je.isFocusInsideContent(wt)||(ke=u.value)!=null&&ke.isFocusInsideContent(wt)||(Oe=p.value)!=null&&Oe.contains(wt.relatedTarget)||(t.visible&&Ft(),t.focused=!1,r.emit("blur",wt))},Vt=wt=>{qe(wt)},Ft=()=>{t.visible=!1},Gt=wt=>{t.visible&&(wt.preventDefault(),wt.stopPropagation(),t.visible=!1)},Je=wt=>{wt&&!t.mouseEnter||L.value||(t.menuVisibleOnFocus?t.menuVisibleOnFocus=!1:(!c.value||!c.value.isFocusInsideContent())&&(t.visible=!t.visible),$e())},ft=()=>{t.visible?I.value[t.hoverIndex]&&Ge(I.value[t.hoverIndex]):Je()},St=wt=>Sc(wt.value)?y2(wt.value,e.valueKey):wt.value,Zt=a.computed(()=>I.value.filter(wt=>wt.visible).every(wt=>wt.disabled)),Jt=a.computed(()=>e.multiple?t.selected.slice(0,e.maxCollapseTags):[]),Pt=a.computed(()=>e.multiple?t.selected.slice(e.maxCollapseTags):[]),rt=wt=>{if(!t.visible){t.visible=!0;return}if(!(t.options.size===0||t.filteredOptionsCount===0)&&!t.isOnComposition&&!Zt.value){wt==="next"?(t.hoverIndex++,t.hoverIndex===t.options.size&&(t.hoverIndex=0)):wt==="prev"&&(t.hoverIndex--,t.hoverIndex<0&&(t.hoverIndex=t.options.size-1));const je=I.value[t.hoverIndex];(je.disabled===!0||je.states.groupDisabled===!0||!je.visible)&&rt(wt),a.nextTick(()=>Ne(f.value))}},Et=()=>{t.mouseEnter=!0},kt=()=>{t.mouseEnter=!1},or=(wt,je)=>{var ke,Oe;Ie(wt,je),(Oe=(ke=u.value)==null?void 0:ke.updatePopper)==null||Oe.call(ke)},$t=a.computed(()=>({maxWidth:`${a.unref(t.inputWidth)-32-(A.value?22:0)}px`,width:"100%"}));return{optionList:T,optionsArray:I,hoverOption:f,selectSize:j,handleResize:me,debouncedOnInputChange:re,debouncedQueryChange:ue,deletePrevTag:_e,deleteTag:Ie,deleteSelected:qe,handleOptionSelect:Ge,scrollToOption:Ne,readonly:b,resetInputHeight:W,showClose:w,iconComponent:k,iconReverse:C,showNewOption:D,collapseTagSize:G,setSelected:ee,managePlaceholder:U,selectDisabled:L,emptyText:N,toggleLastOptionHitState:yt,resetInputState:pt,handleComposition:ct,onOptionCreate:it,onOptionDestroy:Re,handleMenuEnter:xe,handleFocus:Ue,focus:$e,blur:at,handleBlur:Ht,handleClearClick:Vt,handleClose:Ft,handleKeydownEscape:Gt,toggleMenu:Je,selectOption:ft,getValueKey:St,navigateOptions:rt,handleDeleteTooltipTag:or,dropMenuVisible:P,queryChange:m,groupQueryChange:g,showTagList:Jt,collapseTagList:Pt,selectTagsStyle:$t,reference:o,input:s,iOSInput:l,tooltipRef:c,tagTooltipRef:u,tags:d,selectWrapper:p,scrollbar:h,handleMouseEnter:Et,handleMouseLeave:kt}};var p4t=a.defineComponent({name:"ElOptions",emits:["update-options"],setup(e,{slots:t,emit:r}){let n=[];function i(o,s){if(o.length!==s.length)return!1;for(const[l]of o.entries())if(o[l]!=s[l])return!1;return!0}return()=>{var o,s;const l=(o=t.default)==null?void 0:o.call(t),c=[];function u(d){Array.isArray(d)&&d.forEach(p=>{var h,f,m,g;const T=(h=(p==null?void 0:p.type)||{})==null?void 0:h.name;T==="ElOptionGroup"?u(!Js(p.children)&&!Array.isArray(p.children)&&g2((f=p.children)==null?void 0:f.default)?(m=p.children)==null?void 0:m.default():p.children):T==="ElOption"?c.push((g=p.props)==null?void 0:g.label):Array.isArray(p.children)&&u(p.children)})}return l.length&&u((s=l[0])==null?void 0:s.children),i(c,n)||(n=c,r("update-options",c)),l}}});const pde="ElSelect",h4t=a.defineComponent({name:pde,componentName:pde,components:{ElInput:lE,ElSelectMenu:c4t,ElOption:jU,ElOptions:p4t,ElTag:W3t,ElScrollbar:N0t,ElTooltip:OU,ElIcon:ql},directives:{ClickOutside:R3e},props:{name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:{type:String,validator:P1t},effect:{type:String,default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Object,default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:T2.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:lh,default:lU},fitInputWidth:Boolean,suffixIcon:{type:lh,default:sh},tagType:{...$3e.type,default:"info"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,suffixTransition:{type:Boolean,default:!0},placement:{type:String,values:rE,default:"bottom-start"},ariaLabel:{type:String,default:void 0}},emits:[ss,eE,"remove-tag","clear","visible-change","focus","blur"],setup(e,t){const r=li("select"),n=li("input"),{t:i}=lg(),o=fx(),s=u4t(e),{optionList:l,optionsArray:c,hoverOption:u,selectSize:d,readonly:p,handleResize:h,collapseTagSize:f,debouncedOnInputChange:m,debouncedQueryChange:g,deletePrevTag:T,deleteTag:y,deleteSelected:v,handleOptionSelect:_,scrollToOption:b,setSelected:L,resetInputHeight:w,managePlaceholder:k,showClose:C,selectDisabled:A,iconComponent:O,iconReverse:N,showNewOption:I,emptyText:R,toggleLastOptionHitState:D,resetInputState:j,handleComposition:G,onOptionCreate:P,onOptionDestroy:W,handleMenuEnter:K,handleFocus:U,focus:X,blur:ee,handleBlur:oe,handleClearClick:he,handleClose:me,handleKeydownEscape:ie,toggleMenu:be,selectOption:re,getValueKey:ue,navigateOptions:ne,handleDeleteTooltipTag:ye,dropMenuVisible:_e,reference:Ie,input:qe,iOSInput:Ge,tooltipRef:et,tagTooltipRef:Ve,tags:Ne,selectWrapper:it,scrollbar:Re,queryChange:pt,groupQueryChange:yt,handleMouseEnter:ct,handleMouseLeave:xe,showTagList:Ue,collapseTagList:$e,selectTagsStyle:at}=d4t(e,s,t),{inputWidth:Ht,selected:Vt,inputLength:Ft,filteredOptionsCount:Gt,visible:Je,selectedLabel:ft,hoverIndex:St,query:Zt,inputHovering:Jt,currentPlaceholder:Pt,menuVisibleOnFocus:rt,isOnComposition:Et,options:kt,cachedOptions:or,optionsCount:$t,prefixWidth:wt}=a.toRefs(s),je=a.computed(()=>{const Ce=[r.b()],Xe=a.unref(d);return Xe&&Ce.push(r.m(Xe)),e.disabled&&Ce.push(r.m("disabled")),Ce}),ke=a.computed(()=>[r.e("tags"),r.is("disabled",a.unref(A))]),Oe=a.computed(()=>[r.b("tags-wrapper"),{"has-prefix":a.unref(wt)&&a.unref(Vt).length}]),Ye=a.computed(()=>[r.e("input"),r.is(a.unref(d)),r.is("disabled",a.unref(A))]),ve=a.computed(()=>[r.e("input"),r.is(a.unref(d)),r.em("input","iOS")]),Ae=a.computed(()=>[r.is("empty",!e.allowCreate&&!!a.unref(Zt)&&a.unref(Gt)===0)]),Be=a.computed(()=>({maxWidth:`${a.unref(Ht)>123&&a.unref(Vt).length>e.maxCollapseTags?a.unref(Ht)-123:a.unref(Ht)-75}px`})),Se=a.computed(()=>({marginLeft:`${a.unref(wt)}px`,flexGrow:1,width:`${a.unref(Ft)/(a.unref(Ht)-32)}%`,maxWidth:`${a.unref(Ht)-42}px`}));a.provide(TE,a.reactive({props:e,options:kt,optionsArray:c,cachedOptions:or,optionsCount:$t,filteredOptionsCount:Gt,hoverIndex:St,handleOptionSelect:_,onOptionCreate:P,onOptionDestroy:W,selectWrapper:it,selected:Vt,setSelected:L,queryChange:pt,groupQueryChange:yt})),a.onMounted(()=>{s.cachedPlaceHolder=Pt.value=e.placeholder||(()=>i("el.select.placeholder")),e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(Pt.value=""),zC(it,h),e.remote&&e.multiple&&w(),a.nextTick(()=>{const Ce=Ie.value&&Ie.value.$el;if(Ce&&(Ht.value=Ce.getBoundingClientRect().width,t.slots.prefix)){const Xe=Ce.querySelector(`.${n.e("prefix")}`);wt.value=Math.max(Xe.getBoundingClientRect().width+11,30)}}),L()}),e.multiple&&!Array.isArray(e.modelValue)&&t.emit(ss,[]),!e.multiple&&Array.isArray(e.modelValue)&&t.emit(ss,"");const ge=a.computed(()=>{var Ce,Xe;return(Xe=(Ce=et.value)==null?void 0:Ce.popperRef)==null?void 0:Xe.contentRef});return{isIOS:b0e,onOptionsRendered:Ce=>{l.value=Ce},prefixWidth:wt,selectSize:d,readonly:p,handleResize:h,collapseTagSize:f,debouncedOnInputChange:m,debouncedQueryChange:g,deletePrevTag:T,deleteTag:y,handleDeleteTooltipTag:ye,deleteSelected:v,handleOptionSelect:_,scrollToOption:b,inputWidth:Ht,selected:Vt,inputLength:Ft,filteredOptionsCount:Gt,visible:Je,selectedLabel:ft,hoverIndex:St,query:Zt,inputHovering:Jt,currentPlaceholder:Pt,menuVisibleOnFocus:rt,isOnComposition:Et,options:kt,resetInputHeight:w,managePlaceholder:k,showClose:C,selectDisabled:A,iconComponent:O,iconReverse:N,showNewOption:I,emptyText:R,toggleLastOptionHitState:D,resetInputState:j,handleComposition:G,handleMenuEnter:K,handleFocus:U,focus:X,blur:ee,handleBlur:oe,handleClearClick:he,handleClose:me,handleKeydownEscape:ie,toggleMenu:be,selectOption:re,getValueKey:ue,navigateOptions:ne,dropMenuVisible:_e,reference:Ie,input:qe,iOSInput:Ge,tooltipRef:et,popperPaneRef:ge,tags:Ne,selectWrapper:it,scrollbar:Re,wrapperKls:je,tagsKls:ke,tagWrapperKls:Oe,inputKls:Ye,iOSInputKls:ve,scrollbarKls:Ae,selectTagsStyle:at,nsSelect:r,tagTextStyle:Be,inputStyle:Se,handleMouseEnter:ct,handleMouseLeave:xe,showTagList:Ue,collapseTagList:$e,tagTooltipRef:Ve,contentId:o,hoverOption:u}}}),f4t=["disabled","autocomplete","aria-activedescendant","aria-controls","aria-expanded","aria-label"],m4t=["disabled"],g4t={style:{height:"100%",display:"flex","justify-content":"center","align-items":"center"}};function y4t(e,t,r,n,i,o){const s=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),c=a.resolveComponent("el-icon"),u=a.resolveComponent("el-input"),d=a.resolveComponent("el-option"),p=a.resolveComponent("el-options"),h=a.resolveComponent("el-scrollbar"),f=a.resolveComponent("el-select-menu"),m=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectWrapper",class:a.normalizeClass(e.wrapperKls),onMouseenter:t[22]||(t[22]=(...g)=>e.handleMouseEnter&&e.handleMouseEnter(...g)),onMouseleave:t[23]||(t[23]=(...g)=>e.handleMouseLeave&&e.handleMouseLeave(...g)),onClick:t[24]||(t[24]=a.withModifiers((...g)=>e.toggleMenu&&e.toggleMenu(...g),["stop"]))},[a.createVNode(l,{ref:"tooltipRef",visible:e.dropMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,onShow:e.handleMenuEnter},{default:a.withCtx(()=>{var g,T;return[a.createElementVNode("div",{class:"select-trigger",onMouseenter:t[20]||(t[20]=y=>e.inputHovering=!0),onMouseleave:t[21]||(t[21]=y=>e.inputHovering=!1)},[e.multiple?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"tags",tabindex:"-1",class:a.normalizeClass(e.tagsKls),style:a.normalizeStyle(e.selectTagsStyle),onClick:t[15]||(t[15]=(...y)=>e.focus&&e.focus(...y))},[e.collapseTags&&e.selected.length?(a.openBlock(),a.createBlock(a.Transition,{key:0,onAfterLeave:e.resetInputHeight},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.tagWrapperKls)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.showTagList,y=>(a.openBlock(),a.createBlock(s,{key:e.getValueKey(y),closable:!e.selectDisabled&&!y.isDisabled,size:e.collapseTagSize,hit:y.hitState,type:e.tagType,"disable-transitions":"",onClose:v=>e.deleteTag(v,y)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.nsSelect.e("tags-text")),style:a.normalizeStyle(e.tagTextStyle)},a.toDisplayString(y.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128)),e.selected.length>e.maxCollapseTags?(a.openBlock(),a.createBlock(s,{key:0,closable:!1,size:e.collapseTagSize,type:e.tagType,"disable-transitions":""},{default:a.withCtx(()=>[e.collapseTagsTooltip?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:e.dropMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.nsSelect.e("tags-text"))},"+ "+a.toDisplayString(e.selected.length-e.maxCollapseTags),3)]),content:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass(e.nsSelect.e("collapse-tags"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.collapseTagList,y=>(a.openBlock(),a.createElementBlock("div",{key:e.getValueKey(y),class:a.normalizeClass(e.nsSelect.e("collapse-tag"))},[a.createVNode(s,{class:"in-tooltip",closable:!e.selectDisabled&&!y.isDisabled,size:e.collapseTagSize,hit:y.hitState,type:e.tagType,"disable-transitions":"",style:{margin:"2px"},onClose:v=>e.handleDeleteTooltipTag(v,y)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.nsSelect.e("tags-text")),style:a.normalizeStyle({maxWidth:e.inputWidth-75+"px"})},a.toDisplayString(y.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect","teleported"])):(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(e.nsSelect.e("tags-text"))},"+ "+a.toDisplayString(e.selected.length-e.maxCollapseTags),3))]),_:1},8,["size","type"])):a.createCommentVNode("v-if",!0)],2)]),_:1},8,["onAfterLeave"])):a.createCommentVNode("v-if",!0),e.collapseTags?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.Transition,{key:1,onAfterLeave:e.resetInputHeight},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.tagWrapperKls),style:a.normalizeStyle(e.prefixWidth&&e.selected.length?{marginLeft:`${e.prefixWidth}px`}:"")},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.selected,y=>(a.openBlock(),a.createBlock(s,{key:e.getValueKey(y),closable:!e.selectDisabled&&!y.isDisabled,size:e.collapseTagSize,hit:y.hitState,type:e.tagType,"disable-transitions":"",onClose:v=>e.deleteTag(v,y)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(e.nsSelect.e("tags-text")),style:a.normalizeStyle({maxWidth:e.inputWidth-75+"px"})},a.toDisplayString(y.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128))],6)]),_:1},8,["onAfterLeave"])),e.filterable&&!e.selectDisabled?a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:2,ref:"input","onUpdate:modelValue":t[0]||(t[0]=y=>e.query=y),type:"text",class:a.normalizeClass(e.inputKls),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:a.normalizeStyle(e.inputStyle),role:"combobox","aria-activedescendant":((g=e.hoverOption)==null?void 0:g.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:t[1]||(t[1]=(...y)=>e.handleFocus&&e.handleFocus(...y)),onBlur:t[2]||(t[2]=(...y)=>e.handleBlur&&e.handleBlur(...y)),onKeyup:t[3]||(t[3]=(...y)=>e.managePlaceholder&&e.managePlaceholder(...y)),onKeydown:[t[4]||(t[4]=(...y)=>e.resetInputState&&e.resetInputState(...y)),t[5]||(t[5]=a.withKeys(a.withModifiers(y=>e.navigateOptions("next"),["prevent"]),["down"])),t[6]||(t[6]=a.withKeys(a.withModifiers(y=>e.navigateOptions("prev"),["prevent"]),["up"])),t[7]||(t[7]=a.withKeys((...y)=>e.handleKeydownEscape&&e.handleKeydownEscape(...y),["esc"])),t[8]||(t[8]=a.withKeys(a.withModifiers((...y)=>e.selectOption&&e.selectOption(...y),["stop","prevent"]),["enter"])),t[9]||(t[9]=a.withKeys((...y)=>e.deletePrevTag&&e.deletePrevTag(...y),["delete"])),t[10]||(t[10]=a.withKeys(y=>e.visible=!1,["tab"]))],onCompositionstart:t[11]||(t[11]=(...y)=>e.handleComposition&&e.handleComposition(...y)),onCompositionupdate:t[12]||(t[12]=(...y)=>e.handleComposition&&e.handleComposition(...y)),onCompositionend:t[13]||(t[13]=(...y)=>e.handleComposition&&e.handleComposition(...y)),onInput:t[14]||(t[14]=(...y)=>e.debouncedQueryChange&&e.debouncedQueryChange(...y))},null,46,f4t)),[[a.vModelText,e.query]]):a.createCommentVNode("v-if",!0)],6)):a.createCommentVNode("v-if",!0),e.isIOS&&!e.multiple&&e.filterable&&e.readonly?(a.openBlock(),a.createElementBlock("input",{key:1,ref:"iOSInput",class:a.normalizeClass(e.iOSInputKls),disabled:e.selectDisabled,type:"text"},null,10,m4t)):a.createCommentVNode("v-if",!0),a.createVNode(u,{id:e.id,ref:"reference",modelValue:e.selectedLabel,"onUpdate:modelValue":t[16]||(t[16]=y=>e.selectedLabel=y),type:"text",placeholder:typeof e.currentPlaceholder=="function"?e.currentPlaceholder():e.currentPlaceholder,name:e.name,autocomplete:e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,class:a.normalizeClass([e.nsSelect.is("focus",e.visible)]),tabindex:e.multiple&&e.filterable?-1:void 0,role:"combobox","aria-activedescendant":((T=e.hoverOption)==null?void 0:T.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropMenuVisible,label:e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:e.handleFocus,onBlur:e.handleBlur,onInput:e.debouncedOnInputChange,onPaste:e.debouncedOnInputChange,onCompositionstart:e.handleComposition,onCompositionupdate:e.handleComposition,onCompositionend:e.handleComposition,onKeydown:[t[17]||(t[17]=a.withKeys(a.withModifiers(y=>e.navigateOptions("next"),["stop","prevent"]),["down"])),t[18]||(t[18]=a.withKeys(a.withModifiers(y=>e.navigateOptions("prev"),["stop","prevent"]),["up"])),a.withKeys(a.withModifiers(e.selectOption,["stop","prevent"]),["enter"]),a.withKeys(e.handleKeydownEscape,["esc"]),t[19]||(t[19]=a.withKeys(y=>e.visible=!1,["tab"]))]},a.createSlots({suffix:a.withCtx(()=>[e.iconComponent&&!e.showClose?(a.openBlock(),a.createBlock(c,{key:0,class:a.normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),e.showClose&&e.clearIcon?(a.openBlock(),a.createBlock(c,{key:1,class:a.normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon")]),onClick:e.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)]),_:2},[e.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.createElementVNode("div",g4t,[a.renderSlot(e.$slots,"prefix")])])}:void 0]),1032,["id","modelValue","placeholder","name","autocomplete","size","disabled","readonly","class","tabindex","aria-activedescendant","aria-controls","aria-expanded","label","onFocus","onBlur","onInput","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown"])],32)]}),content:a.withCtx(()=>[a.createVNode(f,null,a.createSlots({default:a.withCtx(()=>[a.withDirectives(a.createVNode(h,{id:e.contentId,ref:"scrollbar",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:a.normalizeClass(e.scrollbarKls),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[e.showNewOption?(a.openBlock(),a.createBlock(d,{key:0,value:e.query,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(p,{onUpdateOptions:e.onOptionsRendered},{default:a.withCtx(()=>[a.renderSlot(e.$slots,"default")]),_:3},8,["onUpdateOptions"])]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,e.options.size>0&&!e.loading]]),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&e.options.size===0)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[e.$slots.empty?a.renderSlot(e.$slots,"empty",{key:0}):(a.openBlock(),a.createElementBlock("p",{key:1,class:a.normalizeClass(e.nsSelect.be("dropdown","empty"))},a.toDisplayString(e.emptyText),3))],64)):a.createCommentVNode("v-if",!0)]),_:2},[e.$slots.header?{name:"header",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"header")])}:void 0,e.$slots.footer?{name:"footer",fn:a.withCtx(()=>[a.renderSlot(e.$slots,"footer")])}:void 0]),1024)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","effect","transition","persistent","onShow"])],34)),[[m,e.handleClose,e.popperPaneRef]])}var T4t=hi(h4t,[["render",y4t],["__file","select.vue"]]);const v4t=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const t=li("select"),r=a.ref(!0),n=a.getCurrentInstance(),i=a.ref([]);a.provide(dde,a.reactive({...a.toRefs(e)}));const o=a.inject(TE);a.onMounted(()=>{i.value=s(n.subTree)});const s=c=>{const u=[];return Array.isArray(c.children)&&c.children.forEach(d=>{var p;d.type&&d.type.name==="ElOption"&&d.component&&d.component.proxy?u.push(d.component.proxy):(p=d.children)!=null&&p.length&&u.push(...s(d))}),u},{groupQueryChange:l}=a.toRaw(o);return a.watch(l,()=>{r.value=i.value.some(c=>c.visible===!0)},{flush:"post"}),{visible:r,ns:t}}});function Q4t(e,t,r,n,i,o){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{class:a.normalizeClass(e.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(e.ns.be("group","title"))},a.toDisplayString(e.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(e.ns.b("group"))},[a.renderSlot(e.$slots,"default")],2)])],2)),[[a.vShow,e.visible]])}var hde=hi(v4t,[["render",Q4t],["__file","option-group.vue"]]);const Qg=Jc(T4t,{Option:jU,OptionGroup:hde}),vE=Qu(jU);Qu(hde);const b4t=Lo({trigger:yx.trigger,placement:zU.placement,disabled:yx.disabled,visible:T2.visible,transition:T2.transition,popperOptions:zU.popperOptions,tabindex:zU.tabindex,content:T2.content,popperStyle:T2.popperStyle,popperClass:T2.popperClass,enterable:{...T2.enterable,default:!0},effect:{...T2.effect,default:"light"},teleported:T2.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),x4t={"update:visible":e=>ah(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},_4t="onUpdate:visible",w4t=a.defineComponent({name:"ElPopover"}),L4t=a.defineComponent({...w4t,props:b4t,emits:x4t,setup(e,{expose:t,emit:r}){const n=e,i=a.computed(()=>n[_4t]),o=li("popover"),s=a.ref(),l=a.computed(()=>{var T;return(T=a.unref(s))==null?void 0:T.popperRef}),c=a.computed(()=>[{width:ag(n.width)},n.popperStyle]),u=a.computed(()=>[o.b(),n.popperClass,{[o.m("plain")]:!!n.content}]),d=a.computed(()=>n.transition===`${o.namespace.value}-fade-in-linear`),p=()=>{var T;(T=s.value)==null||T.hide()},h=()=>{r("before-enter")},f=()=>{r("before-leave")},m=()=>{r("after-enter")},g=()=>{r("update:visible",!1),r("after-leave")};return t({popperRef:l,hide:p}),(T,y)=>(a.openBlock(),a.createBlock(a.unref(OU),a.mergeProps({ref_key:"tooltipRef",ref:s},T.$attrs,{trigger:T.trigger,placement:T.placement,disabled:T.disabled,visible:T.visible,transition:T.transition,"popper-options":T.popperOptions,tabindex:T.tabindex,content:T.content,offset:T.offset,"show-after":T.showAfter,"hide-after":T.hideAfter,"auto-close":T.autoClose,"show-arrow":T.showArrow,"aria-label":T.title,effect:T.effect,enterable:T.enterable,"popper-class":a.unref(u),"popper-style":a.unref(c),teleported:T.teleported,persistent:T.persistent,"gpu-acceleration":a.unref(d),"onUpdate:visible":a.unref(i),onBeforeShow:h,onBeforeHide:f,onShow:m,onHide:g}),{content:a.withCtx(()=>[T.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(o).e("title")),role:"title"},a.toDisplayString(T.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(T.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(T.content),1)])]),default:a.withCtx(()=>[T.$slots.reference?a.renderSlot(T.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var S4t=hi(L4t,[["__file","popover.vue"]]);const fde=(e,t)=>{const r=t.arg||t.value,n=r==null?void 0:r.popperRef;n&&(n.triggerRef=e)};var k4t={mounted(e,t){fde(e,t)},updated(e,t){fde(e,t)}};const M4t="popover",mde=H1t(k4t,M4t),QE=Jc(S4t,{directive:mde}),bg="$treeNodeId",gde=function(e,t){!t||t[bg]||Object.defineProperty(t,bg,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},UU=function(e,t){return e?t[e]:t[bg]},GU=(e,t,r)=>{const n=e.value.currentNode;r();const i=e.value.currentNode;n!==i&&t("current-change",i?i.data:null,i)},qU=e=>{let t=!0,r=!0,n=!0;for(let i=0,o=e.length;i<o;i++){const s=e[i];(s.checked!==!0||s.indeterminate)&&(t=!1,s.disabled||(n=!1)),(s.checked!==!1||s.indeterminate)&&(r=!1)}return{all:t,none:r,allWithoutDisable:n,half:!t&&!r}},bE=function(e){if(e.childNodes.length===0||e.loading)return;const{all:t,none:r,half:n}=qU(e.childNodes);t?(e.checked=!0,e.indeterminate=!1):n?(e.checked=!1,e.indeterminate=!0):r&&(e.checked=!1,e.indeterminate=!1);const i=e.parent;!i||i.level===0||e.store.checkStrictly||bE(i)},xE=function(e,t){const r=e.store.props,n=e.data||{},i=r[t];if(typeof i=="function")return i(n,e);if(typeof i=="string")return n[i];if(typeof i>"u"){const o=n[t];return o===void 0?"":o}};let C4t=0,WU=class Mz{constructor(t){this.id=C4t++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const r in t)x8(t,r)&&(this[r]=t[r]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const t=this.store;if(!t)throw new Error("[Node]store is required!");t.registerNode(this);const r=t.props;if(r&&typeof r.isLeaf<"u"){const o=xE(this,"isLeaf");typeof o=="boolean"&&(this.isLeafByUser=o)}if(t.lazy!==!0&&this.data?(this.setData(this.data),t.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&t.lazy&&t.defaultExpandAll&&this.expand(),Array.isArray(this.data)||gde(this,this.data),!this.data)return;const n=t.defaultExpandedKeys,i=t.key;i&&n&&n.includes(this.key)&&this.expand(null,t.autoExpandParent),i&&t.currentNodeKey!==void 0&&this.key===t.currentNodeKey&&(t.currentNode=this,t.currentNode.isCurrent=!0),t.lazy&&t._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(t){Array.isArray(t)||gde(this,t),this.data=t,this.childNodes=[];let r;this.level===0&&Array.isArray(this.data)?r=this.data:r=xE(this,"children")||[];for(let n=0,i=r.length;n<i;n++)this.insertChild({data:r[n]})}get label(){return xE(this,"label")}get key(){const t=this.store.key;return this.data?this.data[t]:null}get disabled(){return xE(this,"disabled")}get nextSibling(){const t=this.parent;if(t){const r=t.childNodes.indexOf(this);if(r>-1)return t.childNodes[r+1]}return null}get previousSibling(){const t=this.parent;if(t){const r=t.childNodes.indexOf(this);if(r>-1)return r>0?t.childNodes[r-1]:null}return null}contains(t,r=!0){return(this.childNodes||[]).some(n=>n===t||r&&n.contains(t))}remove(){const t=this.parent;t&&t.removeChild(this)}insertChild(t,r,n){if(!t)throw new Error("InsertChild error: child is required.");if(!(t instanceof Mz)){if(!n){const i=this.getChildren(!0);i.includes(t.data)||(typeof r>"u"||r<0?i.push(t.data):i.splice(r,0,t.data))}Object.assign(t,{parent:this,store:this.store}),t=a.reactive(new Mz(t)),t instanceof Mz&&t.initialize()}t.level=this.level+1,typeof r>"u"||r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),this.updateLeafState()}insertBefore(t,r){let n;r&&(n=this.childNodes.indexOf(r)),this.insertChild(t,n)}insertAfter(t,r){let n;r&&(n=this.childNodes.indexOf(r),n!==-1&&(n+=1)),this.insertChild(t,n)}removeChild(t){const r=this.getChildren()||[],n=r.indexOf(t.data);n>-1&&r.splice(n,1);const i=this.childNodes.indexOf(t);i>-1&&(this.store&&this.store.deregisterNode(t),t.parent=null,this.childNodes.splice(i,1)),this.updateLeafState()}removeChildByData(t){let r=null;for(let n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===t){r=this.childNodes[n];break}r&&this.removeChild(r)}expand(t,r){const n=()=>{if(r){let i=this.parent;for(;i.level>0;)i.expanded=!0,i=i.parent}this.expanded=!0,t&&t(),this.childNodes.forEach(i=>{i.canFocus=!0})};this.shouldLoadData()?this.loadData(i=>{Array.isArray(i)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||bE(this),n())}):n()}doCreateChildren(t,r={}){t.forEach(n=>{this.insertChild(Object.assign({data:n},r),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(t=>{t.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const t=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!t||t.length===0;return}this.isLeaf=!1}setChecked(t,r,n,i){if(this.indeterminate=t==="half",this.checked=t===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:s,allWithoutDisable:l}=qU(this.childNodes);!this.isLeaf&&!s&&l&&(this.checked=!1,t=!1);const c=()=>{if(r){const u=this.childNodes;for(let h=0,f=u.length;h<f;h++){const m=u[h];i=i||t!==!1;const g=m.disabled?m.checked:i;m.setChecked(g,r,!0,i)}const{half:d,all:p}=qU(u);p||(this.checked=p,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),bE(this)},{checked:t!==!1});return}else c()}const o=this.parent;!o||o.level===0||n||bE(o)}getChildren(t=!1){if(this.level===0)return this.data;const r=this.data;if(!r)return null;const n=this.store.props;let i="children";return n&&(i=n.children||"children"),r[i]===void 0&&(r[i]=null),t&&!r[i]&&(r[i]=[]),r[i]}updateChildren(){const t=this.getChildren()||[],r=this.childNodes.map(o=>o.data),n={},i=[];t.forEach((o,s)=>{const l=o[bg];l&&r.findIndex(c=>c[bg]===l)>=0?n[l]={index:s,data:o}:i.push({index:s,data:o})}),this.store.lazy||r.forEach(o=>{n[o[bg]]||this.removeChildByData(o)}),i.forEach(({index:o,data:s})=>{this.insertChild({data:s},o)}),this.updateLeafState()}loadData(t,r={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(r).length)){this.loading=!0;const n=i=>{this.childNodes=[],this.doCreateChildren(i,r),this.loaded=!0,this.loading=!1,this.updateLeafState(),t&&t.call(this,i)};this.store.load(this,n)}else t&&t.call(this)}},E4t=class{constructor(t){this.currentNode=null,this.currentNodeKey=null;for(const r in t)x8(t,r)&&(this[r]=t[r]);this.nodesMap={}}initialize(){if(this.root=new WU({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const t=this.load;t(this.root,r=>{this.root.doCreateChildren(r),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(t){const r=this.filterNodeMethod,n=this.lazy,i=function(o){const s=o.root?o.root.childNodes:o.childNodes;if(s.forEach(l=>{l.visible=r.call(l,t,l.data,l),i(l)}),!o.visible&&s.length){let l=!0;l=!s.some(c=>c.visible),o.root?o.root.visible=l===!1:o.visible=l===!1}t&&o.visible&&!o.isLeaf&&!n&&o.expand()};i(this)}setData(t){t!==this.root.data?(this.root.setData(t),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(t){if(t instanceof WU)return t;const r=Sc(t)?UU(this.key,t):t;return this.nodesMap[r]||null}insertBefore(t,r){const n=this.getNode(r);n.parent.insertBefore({data:t},n)}insertAfter(t,r){const n=this.getNode(r);n.parent.insertAfter({data:t},n)}remove(t){const r=this.getNode(t);r&&r.parent&&(r===this.currentNode&&(this.currentNode=null),r.parent.removeChild(r))}append(t,r){const n=r?this.getNode(r):this.root;n&&n.insertChild({data:t})}_initDefaultCheckedNodes(){const t=this.defaultCheckedKeys||[],r=this.nodesMap;t.forEach(n=>{const i=r[n];i&&i.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(t){(this.defaultCheckedKeys||[]).includes(t.key)&&t.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(t){t!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=t,this._initDefaultCheckedNodes())}registerNode(t){const r=this.key;!t||!t.data||(r?t.key!==void 0&&(this.nodesMap[t.key]=t):this.nodesMap[t.id]=t)}deregisterNode(t){!this.key||!t||!t.data||(t.childNodes.forEach(r=>{this.deregisterNode(r)}),delete this.nodesMap[t.key])}getCheckedNodes(t=!1,r=!1){const n=[],i=function(o){(o.root?o.root.childNodes:o.childNodes).forEach(s=>{(s.checked||r&&s.indeterminate)&&(!t||t&&s.isLeaf)&&n.push(s.data),i(s)})};return i(this),n}getCheckedKeys(t=!1){return this.getCheckedNodes(t).map(r=>(r||{})[this.key])}getHalfCheckedNodes(){const t=[],r=function(n){(n.root?n.root.childNodes:n.childNodes).forEach(i=>{i.indeterminate&&t.push(i.data),r(i)})};return r(this),t}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(t=>(t||{})[this.key])}_getAllNodes(){const t=[],r=this.nodesMap;for(const n in r)x8(r,n)&&t.push(r[n]);return t}updateChildren(t,r){const n=this.nodesMap[t];if(!n)return;const i=n.childNodes;for(let o=i.length-1;o>=0;o--){const s=i[o];this.remove(s.data)}for(let o=0,s=r.length;o<s;o++){const l=r[o];this.append(l,n.data)}}_setCheckedKeys(t,r=!1,n){const i=this._getAllNodes().sort((l,c)=>c.level-l.level),o=Object.create(null),s=Object.keys(n);i.forEach(l=>l.setChecked(!1,!1));for(let l=0,c=i.length;l<c;l++){const u=i[l],d=u.data[t].toString();if(!s.includes(d)){u.checked&&!o[d]&&u.setChecked(!1,!1);continue}let p=u.parent;for(;p&&p.level>0;)o[p.data[t]]=!0,p=p.parent;if(u.isLeaf||this.checkStrictly){u.setChecked(!0,!1);continue}if(u.setChecked(!0,!0),r){u.setChecked(!1,!1);const h=function(f){f.childNodes.forEach(m=>{m.isLeaf||m.setChecked(!1,!1),h(m)})};h(u)}}}setCheckedNodes(t,r=!1){const n=this.key,i={};t.forEach(o=>{i[(o||{})[n]]=!0}),this._setCheckedKeys(n,r,i)}setCheckedKeys(t,r=!1){this.defaultCheckedKeys=t;const n=this.key,i={};t.forEach(o=>{i[o]=!0}),this._setCheckedKeys(n,r,i)}setDefaultExpandedKeys(t){t=t||[],this.defaultExpandedKeys=t,t.forEach(r=>{const n=this.getNode(r);n&&n.expand(null,this.autoExpandParent)})}setChecked(t,r,n){const i=this.getNode(t);i&&i.setChecked(!!r,n)}getCurrentNode(){return this.currentNode}setCurrentNode(t){const r=this.currentNode;r&&(r.isCurrent=!1),this.currentNode=t,this.currentNode.isCurrent=!0}setUserCurrentNode(t,r=!0){const n=t[this.key],i=this.nodesMap[n];this.setCurrentNode(i),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(t,r=!0){if(t==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const n=this.getNode(t);n&&(this.setCurrentNode(n),r&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}};const A4t=a.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=li("tree"),r=a.inject("NodeInstance"),n=a.inject("RootTree");return()=>{const i=e.node,{data:o,store:s}=i;return e.renderContent?e.renderContent(a.h,{_self:r,node:i,data:o,store:s}):a.renderSlot(n.ctx.slots,"default",{node:i,data:o},()=>[a.h("span",{class:t.be("node","label")},[i.label])])}}});var O4t=hi(A4t,[["__file","tree-node-content.vue"]]);function yde(e){const t=a.inject("TreeNodeMap",null),r={treeNodeExpand:n=>{e.node!==n&&e.node.collapse()},children:[]};return t&&t.children.push(r),a.provide("TreeNodeMap",r),{broadcastExpanded:n=>{if(e.accordion)for(const i of r.children)i.treeNodeExpand(n)}}}const Tde=Symbol("dragEvents");function H4t({props:e,ctx:t,el$:r,dropIndicator$:n,store:i}){const o=li("tree"),s=a.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null});return a.provide(Tde,{treeNodeDragStart:({event:l,treeNode:c})=>{if(typeof e.allowDrag=="function"&&!e.allowDrag(c.node))return l.preventDefault(),!1;l.dataTransfer.effectAllowed="move";try{l.dataTransfer.setData("text/plain","")}catch{}s.value.draggingNode=c,t.emit("node-drag-start",c.node,l)},treeNodeDragOver:({event:l,treeNode:c})=>{const u=c,d=s.value.dropNode;d&&d.node.id!==u.node.id&&k8(d.$el,o.is("drop-inner"));const p=s.value.draggingNode;if(!p||!u)return;let h=!0,f=!0,m=!0,g=!0;typeof e.allowDrop=="function"&&(h=e.allowDrop(p.node,u.node,"prev"),g=f=e.allowDrop(p.node,u.node,"inner"),m=e.allowDrop(p.node,u.node,"next")),l.dataTransfer.dropEffect=f||h||m?"move":"none",(h||f||m)&&(d==null?void 0:d.node.id)!==u.node.id&&(d&&t.emit("node-drag-leave",p.node,d.node,l),t.emit("node-drag-enter",p.node,u.node,l)),(h||f||m)&&(s.value.dropNode=u),u.node.nextSibling===p.node&&(m=!1),u.node.previousSibling===p.node&&(h=!1),u.node.contains(p.node,!1)&&(f=!1),(p.node===u.node||p.node.contains(u.node))&&(h=!1,f=!1,m=!1);const T=u.$el.querySelector(`.${o.be("node","content")}`).getBoundingClientRect(),y=r.value.getBoundingClientRect();let v;const _=h?f?.25:m?.45:1:-1,b=m?f?.75:h?.55:0:1;let L=-9999;const w=l.clientY-T.top;w<T.height*_?v="before":w>T.height*b?v="after":f?v="inner":v="none";const k=u.$el.querySelector(`.${o.be("node","expand-icon")}`).getBoundingClientRect(),C=n.value;v==="before"?L=k.top-y.top:v==="after"&&(L=k.bottom-y.top),C.style.top=`${L}px`,C.style.left=`${k.right-y.left}px`,v==="inner"?sU(u.$el,o.is("drop-inner")):k8(u.$el,o.is("drop-inner")),s.value.showDropIndicator=v==="before"||v==="after",s.value.allowDrop=s.value.showDropIndicator||g,s.value.dropType=v,t.emit("node-drag-over",p.node,u.node,l)},treeNodeDragEnd:l=>{const{draggingNode:c,dropType:u,dropNode:d}=s.value;if(l.preventDefault(),l.dataTransfer.dropEffect="move",c&&d){const p={data:c.node.data};u!=="none"&&c.node.remove(),u==="before"?d.node.parent.insertBefore(p,d.node):u==="after"?d.node.parent.insertAfter(p,d.node):u==="inner"&&d.node.insertChild(p),u!=="none"&&i.value.registerNode(p),k8(d.$el,o.is("drop-inner")),t.emit("node-drag-end",c.node,d.node,u,l),u!=="none"&&t.emit("node-drop",c.node,d.node,u,l)}c&&!d&&t.emit("node-drag-end",c.node,null,u,l),s.value.showDropIndicator=!1,s.value.draggingNode=null,s.value.dropNode=null,s.value.allowDrop=!0}}),{dragState:s}}const V4t=a.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:adt,ElCheckbox:mE,NodeContent:O4t,ElIcon:ql,Loading:cU},props:{node:{type:WU,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,t){const r=li("tree"),{broadcastExpanded:n}=yde(e),i=a.inject("RootTree"),o=a.ref(!1),s=a.ref(!1),l=a.ref(null),c=a.ref(null),u=a.ref(null),d=a.inject(Tde),p=a.getCurrentInstance();a.provide("NodeInstance",p),i||$s("Tree","Can not find node's tree."),e.node.expanded&&(o.value=!0,s.value=!0);const h=i.props.props.children||"children";a.watch(()=>{const b=e.node.data[h];return b&&[...b]},()=>{e.node.updateChildren()}),a.watch(()=>e.node.indeterminate,b=>{g(e.node.checked,b)}),a.watch(()=>e.node.checked,b=>{g(b,e.node.indeterminate)}),a.watch(()=>e.node.expanded,b=>{a.nextTick(()=>o.value=b),b&&(s.value=!0)});const f=b=>UU(i.props.nodeKey,b.data),m=b=>{const L=e.props.class;if(!L)return{};let w;if(g2(L)){const{data:k}=b;w=L(k,b)}else w=L;return Js(w)?{[w]:!0}:w},g=(b,L)=>{(l.value!==b||c.value!==L)&&i.ctx.emit("check-change",e.node.data,b,L),l.value=b,c.value=L},T=b=>{GU(i.store,i.ctx.emit,()=>i.store.value.setCurrentNode(e.node)),i.currentNode.value=e.node,i.props.expandOnClickNode&&v(),i.props.checkOnClickNode&&!e.node.disabled&&_(null,{target:{checked:!e.node.checked}}),i.ctx.emit("node-click",e.node.data,e.node,p,b)},y=b=>{i.instance.vnode.props.onNodeContextmenu&&(b.stopPropagation(),b.preventDefault()),i.ctx.emit("node-contextmenu",b,e.node.data,e.node,p)},v=()=>{e.node.isLeaf||(o.value?(i.ctx.emit("node-collapse",e.node.data,e.node,p),e.node.collapse()):(e.node.expand(),t.emit("node-expand",e.node.data,e.node,p)))},_=(b,L)=>{e.node.setChecked(L.target.checked,!i.props.checkStrictly),a.nextTick(()=>{const w=i.store.value;i.ctx.emit("check",e.node.data,{checkedNodes:w.getCheckedNodes(),checkedKeys:w.getCheckedKeys(),halfCheckedNodes:w.getHalfCheckedNodes(),halfCheckedKeys:w.getHalfCheckedKeys()})})};return{ns:r,node$:u,tree:i,expanded:o,childNodeRendered:s,oldChecked:l,oldIndeterminate:c,getNodeKey:f,getNodeClass:m,handleSelectChange:g,handleClick:T,handleContextMenu:y,handleExpandIconClick:v,handleCheckChange:_,handleChildNodeExpand:(b,L,w)=>{n(L),i.ctx.emit("node-expand",b,L,w)},handleDragStart:b=>{i.props.draggable&&d.treeNodeDragStart({event:b,treeNode:e})},handleDragOver:b=>{b.preventDefault(),i.props.draggable&&d.treeNodeDragOver({event:b,treeNode:{$el:u.value,node:e.node}})},handleDrop:b=>{b.preventDefault()},handleDragEnd:b=>{i.props.draggable&&d.treeNodeDragEnd(b)},CaretRight:y1t}}}),I4t=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],P4t=["aria-expanded"];function N4t(e,t,r,n,i,o){const s=a.resolveComponent("el-icon"),l=a.resolveComponent("el-checkbox"),c=a.resolveComponent("loading"),u=a.resolveComponent("node-content"),d=a.resolveComponent("el-tree-node"),p=a.resolveComponent("el-collapse-transition");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"node$",class:a.normalizeClass([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[1]||(t[1]=a.withModifiers((...h)=>e.handleClick&&e.handleClick(...h),["stop"])),onContextmenu:t[2]||(t[2]=(...h)=>e.handleContextMenu&&e.handleContextMenu(...h)),onDragstart:t[3]||(t[3]=a.withModifiers((...h)=>e.handleDragStart&&e.handleDragStart(...h),["stop"])),onDragover:t[4]||(t[4]=a.withModifiers((...h)=>e.handleDragOver&&e.handleDragOver(...h),["stop"])),onDragend:t[5]||(t[5]=a.withModifiers((...h)=>e.handleDragEnd&&e.handleDragEnd(...h),["stop"])),onDrop:t[6]||(t[6]=a.withModifiers((...h)=>e.handleDrop&&e.handleDrop(...h),["stop"]))},[a.createElementVNode("div",{class:a.normalizeClass(e.ns.be("node","content")),style:a.normalizeStyle({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?(a.openBlock(),a.createBlock(s,{key:0,class:a.normalizeClass([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:a.withModifiers(e.handleExpandIconClick,["stop"])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(e.tree.props.icon||e.CaretRight)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),e.showCheckbox?(a.openBlock(),a.createBlock(l,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=a.withModifiers(()=>{},["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):a.createCommentVNode("v-if",!0),e.node.loading?(a.openBlock(),a.createBlock(s,{key:2,class:a.normalizeClass([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:a.withCtx(()=>[a.createVNode(c)]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.createVNode(u,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),a.createVNode(p,null,{default:a.withCtx(()=>[!e.renderAfterExpand||e.childNodeRendered?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.node.childNodes,h=>(a.openBlock(),a.createBlock(d,{key:e.getNodeKey(h),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:h,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,P4t)),[[a.vShow,e.expanded]]):a.createCommentVNode("v-if",!0)]),_:1})],42,I4t)),[[a.vShow,e.node.visible]])}var B4t=hi(V4t,[["render",N4t],["__file","tree-node.vue"]]);function R4t({el$:e},t){const r=li("tree"),n=a.shallowRef([]),i=a.shallowRef([]);a.onMounted(()=>{o()}),a.onUpdated(()=>{n.value=Array.from(e.value.querySelectorAll("[role=treeitem]")),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"))}),a.watch(i,s=>{s.forEach(l=>{l.setAttribute("tabindex","-1")})}),nh(e,"keydown",s=>{const l=s.target;if(!l.className.includes(r.b("node")))return;const c=s.code;n.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const u=n.value.indexOf(l);let d;if([kc.up,kc.down].includes(c)){if(s.preventDefault(),c===kc.up){d=u===-1?0:u!==0?u-1:n.value.length-1;const h=d;for(;!t.value.getNode(n.value[d].dataset.key).canFocus;){if(d--,d===h){d=-1;break}d<0&&(d=n.value.length-1)}}else{d=u===-1?0:u<n.value.length-1?u+1:0;const h=d;for(;!t.value.getNode(n.value[d].dataset.key).canFocus;){if(d++,d===h){d=-1;break}d>=n.value.length&&(d=0)}}d!==-1&&n.value[d].focus()}[kc.left,kc.right].includes(c)&&(s.preventDefault(),l.click());const p=l.querySelector('[type="checkbox"]');[kc.enter,kc.space].includes(c)&&p&&(s.preventDefault(),p.click())});const o=()=>{var s;n.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"));const l=e.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);if(l.length){l[0].setAttribute("tabindex","0");return}(s=n.value[0])==null||s.setAttribute("tabindex","0")}}const F4t=a.defineComponent({name:"ElTree",components:{ElTreeNode:B4t},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:lh}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,t){const{t:r}=lg(),n=li("tree"),i=a.ref(new E4t({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));i.value.initialize();const o=a.ref(i.value.root),s=a.ref(null),l=a.ref(null),c=a.ref(null),{broadcastExpanded:u}=yde(e),{dragState:d}=H4t({props:e,ctx:t,el$:l,dropIndicator$:c,store:i});R4t({el$:l},i);const p=a.computed(()=>{const{childNodes:P}=o.value;return!P||P.length===0||P.every(({visible:W})=>!W)});a.watch(()=>e.currentNodeKey,P=>{i.value.setCurrentNodeKey(P)}),a.watch(()=>e.defaultCheckedKeys,P=>{i.value.setDefaultCheckedKey(P)}),a.watch(()=>e.defaultExpandedKeys,P=>{i.value.setDefaultExpandedKeys(P)}),a.watch(()=>e.data,P=>{i.value.setData(P)},{deep:!0}),a.watch(()=>e.checkStrictly,P=>{i.value.checkStrictly=P});const h=P=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(P)},f=P=>UU(e.nodeKey,P.data),m=P=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const W=i.value.getNode(P);if(!W)return[];const K=[W.data];let U=W.parent;for(;U&&U!==o.value;)K.push(U.data),U=U.parent;return K.reverse()},g=(P,W)=>i.value.getCheckedNodes(P,W),T=P=>i.value.getCheckedKeys(P),y=()=>{const P=i.value.getCurrentNode();return P?P.data:null},v=()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const P=y();return P?P[e.nodeKey]:null},_=(P,W)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(P,W)},b=(P,W)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(P,W)},L=(P,W,K)=>{i.value.setChecked(P,W,K)},w=()=>i.value.getHalfCheckedNodes(),k=()=>i.value.getHalfCheckedKeys(),C=(P,W=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");GU(i,t.emit,()=>i.value.setUserCurrentNode(P,W))},A=(P,W=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");GU(i,t.emit,()=>i.value.setCurrentNodeKey(P,W))},O=P=>i.value.getNode(P),N=P=>{i.value.remove(P)},I=(P,W)=>{i.value.append(P,W)},R=(P,W)=>{i.value.insertBefore(P,W)},D=(P,W)=>{i.value.insertAfter(P,W)},j=(P,W,K)=>{u(W),t.emit("node-expand",P,W,K)},G=(P,W)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(P,W)};return a.provide("RootTree",{ctx:t,props:e,store:i,root:o,currentNode:s,instance:a.getCurrentInstance()}),a.provide(mx,void 0),{ns:n,store:i,root:o,currentNode:s,dragState:d,el$:l,dropIndicator$:c,isEmpty:p,filter:h,getNodeKey:f,getNodePath:m,getCheckedNodes:g,getCheckedKeys:T,getCurrentNode:y,getCurrentKey:v,setCheckedNodes:_,setCheckedKeys:b,setChecked:L,getHalfCheckedNodes:w,getHalfCheckedKeys:k,setCurrentNode:C,setCurrentKey:A,t:r,getNode:O,remove:N,append:I,insertBefore:R,insertAfter:D,handleNodeExpand:j,updateKeyChildren:G}}});function D4t(e,t,r,n,i,o){const s=a.resolveComponent("el-tree-node");return a.openBlock(),a.createElementBlock("div",{ref:"el$",class:a.normalizeClass([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner",e.dragState.dropType==="inner"),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.root.childNodes,l=>(a.openBlock(),a.createBlock(s,{key:e.getNodeKey(l),node:l,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),e.isEmpty?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(e.ns.e("empty-block"))},[a.renderSlot(e.$slots,"empty",{},()=>{var l;return[a.createElementVNode("span",{class:a.normalizeClass(e.ns.e("empty-text"))},a.toDisplayString((l=e.emptyText)!=null?l:e.t("el.tree.emptyText")),3)]})],2)):a.createCommentVNode("v-if",!0),a.withDirectives(a.createElementVNode("div",{ref:"dropIndicator$",class:a.normalizeClass(e.ns.e("drop-indicator"))},null,2),[[a.vShow,e.dragState.showDropIndicator]])],2)}var _E=hi(F4t,[["render",D4t],["__file","tree.vue"]]);_E.install=e=>{e.component(_E.name,_E)};const z4t=_E,vde=z4t;function j4t(e){let t;const r=a.ref(!1),n=a.reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function i(h){n.text=h}function o(){const h=n.parent,f=p.ns;if(!h.vLoadingAddClassList){let m=h.getAttribute("loading-number");m=Number.parseInt(m)-1,m?h.setAttribute("loading-number",m.toString()):(k8(h,f.bm("parent","relative")),h.removeAttribute("loading-number")),k8(h,f.bm("parent","hidden"))}s(),d.unmount()}function s(){var h,f;(f=(h=p.$el)==null?void 0:h.parentNode)==null||f.removeChild(p.$el)}function l(){var h;e.beforeClose&&!e.beforeClose()||(r.value=!0,clearTimeout(t),t=window.setTimeout(c,400),n.visible=!1,(h=e.closed)==null||h.call(e))}function c(){if(!r.value)return;const h=n.parent;r.value=!1,h.vLoadingAddClassList=void 0,o()}const u=a.defineComponent({name:"ElLoading",setup(h,{expose:f}){const{ns:m,zIndex:g}=l0t("loading");return f({ns:m,zIndex:g}),()=>{const T=n.spinner||n.svg,y=a.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...T?{innerHTML:T}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),v=n.text?a.h("p",{class:m.b("text")},[n.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:c},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:n.background||""},class:[m.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[y,v])]),[[a.vShow,n.visible]])])})}}}),d=a.createApp(u),p=d.mount(document.createElement("div"));return{...a.toRefs(n),setText:i,removeElLoadingChild:s,close:l,handleAfterLeave:c,vm:p,get $el(){return p.$el}}}let wE;const ZU=function(e={}){if(!Xs)return;const t=U4t(e);if(t.fullscreen&&wE)return wE;const r=j4t({...t,closed:()=>{var i;(i=t.closed)==null||i.call(t),t.fullscreen&&(wE=void 0)}});G4t(t,t.parent,r),Qde(t,t.parent,r),t.parent.vLoadingAddClassList=()=>Qde(t,t.parent,r);let n=t.parent.getAttribute("loading-number");return n?n=`${Number.parseInt(n)+1}`:n="1",t.parent.setAttribute("loading-number",n),t.parent.appendChild(r.$el),a.nextTick(()=>r.visible.value=t.visible),t.fullscreen&&(wE=r),r},U4t=e=>{var t,r,n,i;let o;return Js(e.target)?o=(t=document.querySelector(e.target))!=null?t:document.body:o=e.target||document.body,{parent:o===document.body||e.body?document.body:o,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:o===document.body&&((r=e.fullscreen)!=null?r:!0),lock:(n=e.lock)!=null?n:!1,customClass:e.customClass||"",visible:(i=e.visible)!=null?i:!0,target:o}},G4t=async(e,t,r)=>{const{nextZIndex:n}=r.vm.zIndex||r.vm._.exposed.zIndex,i={};if(e.fullscreen)r.originalPosition.value=ox(document.body,"position"),r.originalOverflow.value=ox(document.body,"overflow"),i.zIndex=n();else if(e.parent===document.body){r.originalPosition.value=ox(document.body,"position"),await a.nextTick();for(const o of["top","left"]){const s=o==="top"?"scrollTop":"scrollLeft";i[o]=`${e.target.getBoundingClientRect()[o]+document.body[s]+document.documentElement[s]-Number.parseInt(ox(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])i[o]=`${e.target.getBoundingClientRect()[o]}px`}else r.originalPosition.value=ox(t,"position");for(const[o,s]of Object.entries(i))r.$el.style[o]=s},Qde=(e,t,r)=>{const n=r.vm.ns||r.vm._.exposed.ns;["absolute","fixed","sticky"].includes(r.originalPosition.value)?k8(t,n.bm("parent","relative")):sU(t,n.bm("parent","relative")),e.fullscreen&&e.lock?sU(t,n.bm("parent","hidden")):k8(t,n.bm("parent","hidden"))},KU=Symbol("ElLoading"),bde=(e,t)=>{var r,n,i,o;const s=t.instance,l=h=>Sc(t.value)?t.value[h]:void 0,c=h=>{const f=Js(h)&&(s==null?void 0:s[h])||h;return f&&a.ref(f)},u=h=>c(l(h)||e.getAttribute(`element-loading-${uat(h)}`)),d=(r=l("fullscreen"))!=null?r:t.modifiers.fullscreen,p={text:u("text"),svg:u("svg"),svgViewBox:u("svgViewBox"),spinner:u("spinner"),background:u("background"),customClass:u("customClass"),fullscreen:d,target:(n=l("target"))!=null?n:d?void 0:e,body:(i=l("body"))!=null?i:t.modifiers.body,lock:(o=l("lock"))!=null?o:t.modifiers.lock};e[KU]={options:p,instance:ZU(p)}},q4t=(e,t)=>{for(const r of Object.keys(t))a.isRef(t[r])&&(t[r].value=e[r])},LE={mounted(e,t){t.value&&bde(e,t)},updated(e,t){const r=e[KU];t.oldValue!==t.value&&(t.value&&!t.oldValue?bde(e,t):t.value&&t.oldValue?Sc(t.value)&&q4t(t.value,r.options):r==null||r.instance.close())},unmounted(e){var t;(t=e[KU])==null||t.instance.close()}},W4t={install(e){e.directive("loading",LE),e.config.globalProperties.$loading=ZU},directive:LE,service:ZU},R4=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},Z4t={name:"ExternalResourceCard",components:{Button:j3},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:a.shallowRef(k1t)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){window.open(e,"_blank")}}},K4t={class:"resource-container"};function X4t(e,t,r,n,i,o){const s=j3;return a.openBlock(),a.createElementBlock("div",K4t,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.resources,l=>(a.openBlock(),a.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(a.openBlock(),a.createBlock(s,{key:0,class:"button",icon:e.ElIconNotebook,onClick:c=>o.openUrl(l.url)},{default:a.withCtx(()=>[a.createTextVNode(" Open publications in pubmed ")]),_:2},1032,["icon","onClick"])):a.createCommentVNode("",!0)]))),128))])}const xde=R4(Z4t,[["render",X4t],["__scopeId","data-v-1160491b"]]);function J4t(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(i){i(r)}),(n=e.get("*"))&&n.slice().map(function(i){i(t,r)})}}}const SE=new J4t,Y4t=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),$4t=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},ept={name:"ProvenancePopup",components:{Button:j3,Container:Zdt,Icon:ql,ExternalResourceCard:xde,ElIconArrowUp:YC,ElIconArrowDown:sh,ElIconWarning:Lue},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},computed:{resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Observed in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return Y4t(e)},capitalise:function(e){return $4t(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){SE.emit("onActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name)})},openAxons:function(){SE.emit("onActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name)})},openDendrites:function(){SE.emit("onActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name)})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e}}},bx=e=>(a.pushScopeId("data-v-5464af49"),e=e(),a.popScopeId(),e),tpt={key:0,class:"main"},rpt={key:0,class:"block"},npt={class:"title"},ipt={key:0,class:"subtitle"},opt={key:1,class:"block"},apt={class:"title"},spt={class:"content-container scrollbar"},lpt={key:0,class:"block"},cpt=bx(()=>a.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),upt={style:{"word-break":"keep-all"}},dpt=bx(()=>a.createElementVNode("i",null,"Origin",-1)),ppt={key:0,class:"seperator"},hpt={key:1,class:"block"},fpt=bx(()=>a.createElementVNode("div",{class:"attribute-title"},"Components",-1)),mpt={key:0,class:"seperator"},gpt={key:2,class:"block"},ypt=bx(()=>a.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),Tpt=bx(()=>a.createElementVNode("span",{style:{"word-break":"keep-all"}},[a.createElementVNode("i",null,"Destination"),a.createTextVNode(" is where the axons terminate ")],-1)),vpt={key:0,class:"seperator"};function Qpt(e,t,r,n,i,o){const s=YC,l=ql,c=sh,u=Lue,d=QE,p=j3,h=xde,f=LE;return r.entry?a.withDirectives((a.openBlock(),a.createElementBlock("div",tpt,[r.entry.title?(a.openBlock(),a.createElementBlock("div",rpt,[a.createElementVNode("span",npt,a.toDisplayString(o.capitalise(r.entry.title)),1),r.entry.provenanceTaxonomyLabel&&r.entry.provenanceTaxonomyLabel.length>0?(a.openBlock(),a.createElementBlock("div",ipt,a.toDisplayString(o.provSpeciesDescription),1)):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",opt,[a.createElementVNode("span",apt,a.toDisplayString(r.entry.featureId),1)])),a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[0]||(t[0]=m=>e.showDetails=!1)},[a.createTextVNode(" Hide path information "),a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(s)]),_:1})],512),[[a.vShow,e.showDetails]]),a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[1]||(t[1]=m=>e.showDetails=!0)},[a.createTextVNode(" Show path information "),a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1})],512),[[a.vShow,!e.showDetails]]),a.createVNode(a.Transition,{name:"slide-fade"},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",spt,[a.createTextVNode(a.toDisplayString(r.entry.paths)+" ",1),r.entry.origins&&r.entry.origins.length>0?(a.openBlock(),a.createElementBlock("div",lpt,[a.createElementVNode("div",null,[cpt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(l,{class:"info"},{default:a.withCtx(()=>[a.createVNode(u)]),_:1}),a.createElementVNode("span",upt,[dpt,a.createTextVNode(" "+a.toDisplayString(o.originDescription),1)])]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.origins,(m,g)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content",key:m},[a.createTextVNode(a.toDisplayString(o.capitalise(m))+" ",1),g!=r.entry.origins.length-1?(a.openBlock(),a.createElementBlock("div",ppt)):a.createCommentVNode("",!0)]))),128)),a.withDirectives(a.createVNode(p,{class:"button",onClick:o.openDendrites},{default:a.withCtx(()=>[a.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.originsWithDatasets&&r.entry.originsWithDatasets.length>0]])])):a.createCommentVNode("",!0),r.entry.components&&r.entry.components.length>0?(a.openBlock(),a.createElementBlock("div",hpt,[fpt,(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.components,(m,g)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content",key:m},[a.createTextVNode(a.toDisplayString(o.capitalise(m))+" ",1),g!=r.entry.components.length-1?(a.openBlock(),a.createElementBlock("div",mpt)):a.createCommentVNode("",!0)]))),128))])):a.createCommentVNode("",!0),r.entry.destinations&&r.entry.destinations.length>0?(a.openBlock(),a.createElementBlock("div",gpt,[a.createElementVNode("div",null,[ypt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(l,{class:"info"},{default:a.withCtx(()=>[a.createVNode(u)]),_:1}),Tpt]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.destinations,(m,g)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content",key:m},[a.createTextVNode(a.toDisplayString(o.capitalise(m))+" ",1),g!=r.entry.destinations.length-1?(a.openBlock(),a.createElementBlock("div",vpt)):a.createCommentVNode("",!0)]))),128)),a.withDirectives(a.createVNode(p,{class:"button",onClick:o.openAxons},{default:a.withCtx(()=>[a.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.destinationsWithDatasets&&r.entry.destinationsWithDatasets.length>0]])])):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(p,{class:"button",onClick:o.openAll},{default:a.withCtx(()=>[a.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.componentsWithDatasets&&r.entry.componentsWithDatasets.length>0]]),a.createVNode(h,{resources:o.resources},null,8,["resources"])],512),[[a.vShow,e.showDetails]])]),_:1})])),[[f,e.loading]]):a.createCommentVNode("",!0)}const _de=R4(ept,[["render",Qpt],["__scopeId","data-v-5464af49"]]);var wde={},kE={},Lde={exports:{}};/*! js-cookie v3.0.5 | MIT */(function(e,t){(function(r,n){e.exports=n()})(ae,function(){function r(s){for(var l=1;l<arguments.length;l++){var c=arguments[l];for(var u in c)s[u]=c[u]}return s}var n={read:function(s){return s[0]==='"'&&(s=s.slice(1,-1)),s.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(s){return encodeURIComponent(s).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function i(s,l){function c(d,p,h){if(!(typeof document>"u")){h=r({},l,h),typeof h.expires=="number"&&(h.expires=new Date(Date.now()+h.expires*864e5)),h.expires&&(h.expires=h.expires.toUTCString()),d=encodeURIComponent(d).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var f="";for(var m in h)h[m]&&(f+="; "+m,h[m]!==!0&&(f+="="+h[m].split(";")[0]));return document.cookie=d+"="+s.write(p,d)+f}}function u(d){if(!(typeof document>"u"||arguments.length&&!d)){for(var p=document.cookie?document.cookie.split("; "):[],h={},f=0;f<p.length;f++){var m=p[f].split("="),g=m.slice(1).join("=");try{var T=decodeURIComponent(m[0]);if(h[T]=s.read(g,T),d===T)break}catch{}}return d?h[d]:h}}return Object.create({set:c,get:u,remove:function(d,p){c(d,"",r({},p,{expires:-1}))},withAttributes:function(d){return i(this.converter,r({},this.attributes,d))},withConverter:function(d){return i(r({},this.converter,d),this.attributes)}},{attributes:{value:Object.freeze(l)},converter:{value:Object.freeze(s)}})}var o=i(n,{path:"/"});return o})})(Lde);var bpt=Lde.exports,G3=ae&&ae.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Hs=ae&&ae.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},xpt=ae&&ae.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gh,xx,Yc,q3,H8;Object.defineProperty(kE,"__esModule",{value:!0}),kE.AnnotationService=void 0;const ME=xpt(bpt),_pt=1e4;let wpt=class{constructor(t){gh.add(this),xx.set(this,void 0),Yc.set(this,null),q3.set(this,null),t.slice(-1)==="/"?G3(this,xx,t.slice(0,-1),"f"):G3(this,xx,t,"f")}get currentUser(){return Hs(this,q3,"f")}get currentError(){return Hs(this,Yc,"f")}async authenticate(){G3(this,Yc,null,"f"),G3(this,q3,null,"f");const t=await Hs(this,gh,"m",H8).call(this,"authenticate");return"error"in t?(ME.default.remove("annotation-key"),Promise.resolve(Hs(this,Yc,"f"))):(ME.default.set("annotation-key",t.session,{secure:!0,expires:1}),G3(this,q3,t.data,"f"),Promise.resolve(Hs(this,q3,"f")))}async unauthenticate(){G3(this,Yc,null,"f"),G3(this,q3,null,"f");const t=await Hs(this,gh,"m",H8).call(this,"unauthenticate");return"success"in t?Promise.resolve(t):Promise.resolve(Hs(this,Yc,"f"))}async annotatedItemIds(t){const r=await Hs(this,gh,"m",H8).call(this,"items/","GET",{resource:t});return"error"in r?Promise.resolve(Hs(this,Yc,"f")):Promise.resolve(r)}async itemAnnotations(t,r){const n=await Hs(this,gh,"m",H8).call(this,"annotations/","GET",{resource:t,item:r});return"error"in n?Promise.resolve(Hs(this,Yc,"f")):Promise.resolve(n)}async annotation(t){const r=await Hs(this,gh,"m",H8).call(this,"annotation/","GET",{annotation:t});return"error"in r?Promise.resolve(Hs(this,Yc,"f")):Promise.resolve(r)}async addAnnotation(t){if(Hs(this,q3,"f")&&Hs(this,q3,"f").canUpdate){const r=Object.assign({creator:Hs(this,q3,"f"),created:new Date().toISOString()},t),n=await Hs(this,gh,"m",H8).call(this,"annotation/","POST",{data:r});if(!("error"in n))return Promise.resolve(n);G3(this,Yc,n,"f")}else G3(this,Yc,{error:"user cannot add annotation"},"f");return Promise.resolve(Hs(this,Yc,"f"))}};kE.AnnotationService=wpt,xx=new WeakMap,Yc=new WeakMap,q3=new WeakMap,gh=new WeakSet,H8=async function(e,t="GET",r={}){let n=!0;const i=new AbortController;setTimeout(()=>{n&&(console.log("Annotation server timeout..."),i.abort())},_pt);const o={method:t,signal:i.signal};let s=`${Hs(this,xx,"f")}/${e}`;const l=ME.default.get("user-token")||"",c=ME.default.get("annotation-key")||"";if(t==="GET"){const d=[];for(const[p,h]of Object.entries(r))d.push(`${p}=${encodeURIComponent(JSON.stringify(h))}`);d.push(`key=${encodeURIComponent(l)}`),d.push(`session=${encodeURIComponent(c)}`),s+="?"+d.join("&"),o.headers={Accept:"application/json; charset=utf-8","Cache-Control":"no-store"}}else if(t==="POST"){const d=Object.assign({key:l,session:c},r);o.body=JSON.stringify(d),o.headers={Accept:"application/json; charset=utf-8","Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}}const u=await fetch(s,o);return n=!1,u.ok?Promise.resolve(await u.json()):(G3(this,Yc,{error:`${u.status} ${u.statusText}`},"f"),Promise.resolve(Hs(this,Yc,"f")))},function(e){var t=ae&&ae.__createBinding||(Object.create?function(n,i,o,s){s===void 0&&(s=o);var l=Object.getOwnPropertyDescriptor(i,o);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,s,l)}:function(n,i,o,s){s===void 0&&(s=o),n[s]=i[o]}),r=ae&&ae.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(kE,e)}(wde);const Lpt={name:"AnnotationTool",components:{Button:j3,Col:B4,Input:lE,Main:ude,Row:U3,Select:Qg,ElIconArrowUp:YC,ElIconArrowDown:sh,ElIconEdit:_ue,ElIconClose:ax},props:{annotationEntry:{type:Object}},inject:["flatmapAPI"],data:function(){return{displayPair:{"Feature ID":"featureId",Tooltip:"label",Models:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:["DOI:","PMID:"],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:""}},computed:{isEditable:function(){return this.annotationEntry.resourceId&&this.annotationEntry.featureId}},methods:{evidenceEntered:function(e){e&&(this.evidence.push(this.evidencePrefix+e),this.newEvidence="")},formatTime:function(e){const t={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(e).toLocaleDateString(void 0,t)},updatePrevSubmissions:function(){this.$annotator&&this.authenticated&&this.annotationEntry.resourceId&&this.annotationEntry.featureId&&this.$annotator.itemAnnotations(this.annotationEntry.resourceId,this.annotationEntry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)})},submit:function(){if((this.evidence.length>0||this.comment)&&this.annotationEntry.resourceId&&this.annotationEntry.featureId){const e=[];this.evidence.forEach(r=>{if(r.includes("DOI:")){const n=r.replace("DOI:","https://doi.org/");e.push(new URL(n))}else if(r.includes("PMID:")){const n=r.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(n))}});const t={resource:this.annotationEntry.resourceId,item:this.annotationEntry.featureId,evidence:e,comment:this.comment};this.$annotator.addAnnotation(t).then(()=>{this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"})}},removeEvidence:function(e){this.evidence.splice(e,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""}},watch:{annotationEntry:{handler:function(){this.resetSubmission(),this.updatePrevSubmissions()},immediate:!1,deep:!1}},mounted:function(){this.$annotator||(this.$annotator=new wde.AnnotationService(`${this.flatmapAPI}annotator`)),this.$annotator.authenticate().then(e=>{e.name&&e.email?(this.authenticated=!0,this.updatePrevSubmissions()):this.errorMessage=""})}},V8=e=>(a.pushScopeId("data-v-23ee0a25"),e=e(),a.popScopeId(),e),Spt={class:"block"},kpt=V8(()=>a.createElementVNode("span",{class:"title"},"Feature Annotations",-1)),Mpt=V8(()=>a.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),Cpt=V8(()=>a.createElementVNode("strong",null,"Evidence: ",-1)),Ept=["href"],Apt=V8(()=>a.createElementVNode("strong",null,"Comment: ",-1)),Opt=V8(()=>a.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),Hpt=V8(()=>a.createElementVNode("strong",null,"Evidvence:",-1)),Vpt=V8(()=>a.createElementVNode("strong",null,"Comment:",-1)),Ipt={class:"sub-title"};function Ppt(e,t,r,n,i,o){const s=U3,l=YC,c=ql,u=sh,d=_ue,p=B4,h=ax,f=vE,m=Qg,g=lE,T=j3,y=ude;return a.openBlock(),a.createBlock(y,{class:"main"},{default:a.withCtx(()=>[a.createElementVNode("div",Spt,[a.createVNode(s,{class:"info-field"},{default:a.withCtx(()=>[kpt]),_:1}),r.annotationEntry?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.displayPair,(v,_)=>a.withDirectives((a.openBlock(),a.createBlock(s,{class:"dialog-text",key:v},{default:a.withCtx(()=>[a.createElementVNode("strong",null,a.toDisplayString(_)+": ",1),a.createTextVNode(" "+a.toDisplayString(r.annotationEntry[v]),1)]),_:2},1024)),[[a.vShow,r.annotationEntry[v]]])),128)),e.prevSubs.length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[0]||(t[0]=v=>e.showSubmissions=!1)},[a.createTextVNode(" Hide previous submissions "),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1})],512),[[a.vShow,e.showSubmissions]]),a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[1]||(t[1]=v=>e.showSubmissions=!0)},[a.createTextVNode(" Show previous "+a.toDisplayString(e.prevSubs.length)+" submission(s) ",1),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(u)]),_:1})],512),[[a.vShow,!e.showSubmissions]]),e.showSubmissions?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(s,{class:"dialog-spacer"}),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[Mpt]),_:1}),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.prevSubs,(v,_)=>(a.openBlock(),a.createElementBlock("div",{class:"entry",key:_},[a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[a.createElementVNode("strong",null,a.toDisplayString(o.formatTime(v.created)),1),a.createTextVNode(" "+a.toDisplayString(v.creator.name),1)]),_:2},1024),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[Cpt,(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(v.evidence,b=>(a.openBlock(),a.createBlock(s,{key:b,class:"dialog-text"},{default:a.withCtx(()=>[a.createElementVNode("a",{href:b,target:"_blank"},a.toDisplayString(b),9,Ept)]),_:2},1024))),128))]),_:2},1024),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[Apt,a.createTextVNode(" "+a.toDisplayString(v.comment),1)]),_:2},1024)]))),128))],64)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0),e.authenticated?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[o.isEditable?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(s,{class:"dialog-spacer"}),e.editing?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[Opt]),_:1}),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[Hpt]),_:1}),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.evidence,(v,_)=>(a.openBlock(),a.createBlock(s,{key:v},{default:a.withCtx(()=>[a.createVNode(p,{span:20},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.evidence[_]),1)]),_:2},1024),a.createVNode(p,{span:4},{default:a.withCtx(()=>[a.createVNode(c,{class:"standard-icon"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),_:1})]),_:2},1024))),128)),a.createVNode(s,null,{default:a.withCtx(()=>[a.createVNode(g,{size:"mini",placeholder:"Enter",modelValue:e.newEvidence,"onUpdate:modelValue":t[3]||(t[3]=v=>e.newEvidence=v),onChange:t[4]||(t[4]=v=>o.evidenceEntered(v))},{prepend:a.withCtx(()=>[a.createVNode(m,{teleported:!1,modelValue:e.evidencePrefix,"onUpdate:modelValue":t[2]||(t[2]=v=>e.evidencePrefix=v),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.evidencePrefixes,v=>(a.openBlock(),a.createBlock(f,{key:v,label:v,value:v},{default:a.withCtx(()=>[a.createVNode(s,null,{default:a.withCtx(()=>[a.createVNode(p,{span:12},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(v),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1}),a.createVNode(s,null,{default:a.withCtx(()=>[Vpt]),_:1}),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[a.createVNode(g,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:e.comment,"onUpdate:modelValue":t[5]||(t[5]=v=>e.comment=v)},null,8,["modelValue"])]),_:1}),a.createVNode(s,{class:"dialog-text"},{default:a.withCtx(()=>[a.createVNode(T,{class:"button",type:"primary",plain:"",onClick:o.submit},{default:a.withCtx(()=>[a.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(a.openBlock(),a.createBlock(s,{key:0},{default:a.withCtx(()=>[a.createVNode(c,{class:"standard-icon"},{default:a.withCtx(()=>[a.createVNode(d)]),_:1})]),_:1})),e.errorMessage?(a.openBlock(),a.createBlock(s,{key:2,class:"dialog-text"},{default:a.withCtx(()=>[a.createElementVNode("strong",Ipt,a.toDisplayString(e.errorMessage),1)]),_:1})):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)])]),_:1})}const Sde=R4(Lpt,[["render",Ppt],["__scopeId","data-v-23ee0a25"]]),Npt={name:"Tooltip",components:{AnnotationTool:Sde,ProvenancePopup:_de},props:{entry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}}},Bpt={class:"tooltip-container"};function Rpt(e,t,r,n,i,o){const s=Sde,l=_de;return a.openBlock(),a.createElementBlock("div",Bpt,[r.annotationDisplay?(a.openBlock(),a.createBlock(s,{key:0,annotationEntry:r.annotationEntry},null,8,["annotationEntry"])):(a.openBlock(),a.createBlock(l,{key:1,entry:r.entry},null,8,["entry"]))])}const XU=R4(Npt,[["render",Rpt],["__scopeId","data-v-193cf123"]]),Fpt={name:"SelectionsGroup",components:{Checkbox:mE,CheckboxGroup:RU,Col:B4,Row:U3},methods:{reset:function(){this.checkAll=!0,this.checkedItems=[],this.selections.forEach(e=>{!("enabled"in e)||e.enabled===!0?this.checkedItems.push(e[this.identifierKey]):this.checkAll=!1})},visibilityToggle:function(e,t){this.$emit("changed",{key:e,value:t})},handleCheckedItemsChange:function(e){let t=e.length;this.checkAll=t===this.selections.length},handleCheckAllChange:function(e){this.checkedItems=e?this.selections.map(t=>t[this.identifierKey]):[],this.$emit("checkAll",{keys:this.selections.map(t=>t[this.identifierKey]),value:e})},getBackgroundStyles:function(e){return"colour"in e&&this.colourStyle==="background"?{background:e.colour}:{}},hasLineStyles:function(e){return"colour"in e&&this.colourStyle==="line"},getLineStyles:function(e){return"colour"in e&&this.colourStyle==="line"?"dashed"in e&&e.dashed===!0?{background:`repeating-linear-gradient(90deg,${e.colour},${e.colour} 6px,transparent 0,transparent 9px)`}:{background:e.colour}:{display:"None"}}},props:{colourStyle:{type:String,default:"line"},identifierKey:{type:String,default:"id"},labelKey:{type:String,default:"label"},title:{type:String,default:""},selections:{type:Array,default:function(){return[]}}},computed:{isIndeterminate:function(){return!(this.checkedItems.length===0||this.checkAll)}},data:function(){return{checkedItems:[],checkAll:!0}},mounted:function(){this.reset()}},Dpt={class:"selections-container"},zpt={class:"checkall-display-text"},jpt={class:"checkbox-group-inner"},Upt={class:"checkbox-container"};function Gpt(e,t,r,n,i,o){const s=B4,l=mE,c=U3,u=RU;return a.openBlock(),a.createElementBlock("div",Dpt,[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(s,{span:12},{default:a.withCtx(()=>[a.createElementVNode("div",zpt,a.toDisplayString(r.title),1)]),_:1}),a.createVNode(s,{span:12},{default:a.withCtx(()=>[r.selections&&r.selections.length>1?(a.openBlock(),a.createBlock(l,{key:0,class:"all-checkbox",indeterminate:o.isIndeterminate,modelValue:e.checkAll,"onUpdate:modelValue":t[0]||(t[0]=d=>e.checkAll=d),onChange:o.handleCheckAllChange},{default:a.withCtx(()=>[a.createTextVNode("Display all")]),_:1},8,["indeterminate","modelValue","onChange"])):a.createCommentVNode("",!0)]),_:1})]),_:1}),a.createVNode(u,{modelValue:e.checkedItems,"onUpdate:modelValue":t[1]||(t[1]=d=>e.checkedItems=d),size:"small",class:"checkbox-group",onChange:o.handleCheckedItemsChange},{default:a.withCtx(()=>[a.createElementVNode("div",jpt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.selections,d=>(a.openBlock(),a.createBlock(c,{key:d[r.identifierKey],label:d[r.identifierKey]},{default:a.withCtx(()=>[a.createElementVNode("div",Upt,[a.createVNode(l,{class:"my-checkbox",label:d[r.identifierKey],onChange:p=>o.visibilityToggle(d[r.identifierKey],p),checked:!("enabled"in d)||d.enabled===!0},{default:a.withCtx(()=>[a.createVNode(c,{class:"checkbox-row"},{default:a.withCtx(()=>[o.hasLineStyles(d)?(a.openBlock(),a.createBlock(s,{key:0,span:4},{default:a.withCtx(()=>[a.createElementVNode("div",{class:"path-visual",style:a.normalizeStyle(o.getLineStyles(d))},null,4)]),_:2},1024)):a.createCommentVNode("",!0),a.createVNode(s,{span:20},{default:a.withCtx(()=>[a.createElementVNode("div",{style:a.normalizeStyle(o.getBackgroundStyles(d))},a.toDisplayString(d[r.labelKey]),5)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","onChange","checked"])])]),_:2},1032,["label"]))),128))])]),_:1},8,["modelValue","onChange"])])}const kde=R4(Fpt,[["render",Gpt],["__scopeId","data-v-9c4fff49"]]),qpt={name:"TreeControls",components:{Checkbox:mE,CheckboxGroup:RU,ColorPicker:Pdt,Row:U3,Tree:vde},props:{treeData:{type:Array,default:function(){return[]}},active:{type:String,default:""},hover:{type:String,default:""}},data:function(){return{defaultExpandedKeys:["All"]}},unmounted:function(){this.sortedPrimitiveGroups=void 0},methods:{nodeIsActive:function(e){return this.active===e.models},nodeIsHover:function(e){return this.hover===e.models},changeActiveByNode:function(e){e.models&&this.$emit("change-active",e.models)},changeHoverByNode:function(){},checkChanged:function(e,t){const r=t.checkedKeys.includes(e.key);e.key==="All"?this.$emit("checkAll",r):this.$emit("changed",{key:e.key,value:r})},getBackgroundStyles:function(e){return"colour"in e?{background:e.colour}:{}}}},Wpt=e=>(a.pushScopeId("data-v-27e4d901"),e=e(),a.popScopeId(),e),Zpt={class:"container"},Kpt=Wpt(()=>a.createElementVNode("div",{class:"title-text"},"Systems",-1)),Xpt={class:"tree-container"},Jpt=["onClick","onMouseover"];function Ypt(e,t,r,n,i,o){const s=B4,l=U3,c=vde;return a.openBlock(),a.createElementBlock("div",Zpt,[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(s,{span:12},{default:a.withCtx(()=>[Kpt]),_:1})]),_:1}),a.createElementVNode("div",Xpt,[a.createVNode(c,{ref:"tree","node-key":"key","show-checkbox":"","check-strictly":!1,data:r.treeData,"render-after-expand":!1,"default-expanded-keys":e.defaultExpandedKeys,onCheck:o.checkChanged},{default:a.withCtx(({node:u,data:d})=>[a.createElementVNode("span",{class:a.normalizeClass(["region-tree-node",{activeItem:o.nodeIsActive(d),hoverItem:o.nodeIsHover(d)}]),onClick:p=>o.changeActiveByNode(d),onMouseover:p=>o.changeHoverByNode(d)},[a.createElementVNode("div",{style:a.normalizeStyle(o.getBackgroundStyles(d))},a.toDisplayString(u.label),5)],42,Jpt)]),_:1},8,["data","default-expanded-keys","onCheck"])])])}const Mde=R4(qpt,[["render",Ypt],["__scopeId","data-v-27e4d901"]]),$pt={name:"SvgLegends"},e6t=e=>(a.pushScopeId("data-v-7a368b29"),e=e(),a.popScopeId(),e),t6t={class:"legends-container"},r6t={version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 500 500",style:{"enable-background":"new 0 0 500 500"},xmlns:"http://www.w3.org/2000/svg","xmlns:bx":"https://boxy-svg.com"},n6t=a.createStaticVNode('<defs data-v-7a368b29><bx:grid height="30.447" width="32.516" x="0" y="0" data-v-7a368b29></bx:grid></defs><path class="st0 st0-translate" d="M61.3,103.8c-15.9,0-28.8-12.3-28.8-27.3c0-15,13-27.3,28.8-27.3s28.8,12.3,28.8,27.3 C90.1,91.5,77.2,103.8,61.3,103.8z" data-v-7a368b29></path><path class="st1" d="M40.3,356.1C29.5,345,29.8,328,41.5,317.5c11.7-10.5,29.6-9.9,40.7,1.1c11.1,11,10.5,28.1-1.2,38.5 C69.3,367.4,51.1,366.9,40.3,356.1z" data-v-7a368b29></path><path class="st2" d="M61.2,396.9c-5.3,9.3-15.3,15.1-26.1,15.1l-0.4,0.6c5.1,9,5.1,20,0,29l0.4,0.6c10.7,0,20.8,5.8,26.1,15.1 c5.3-9.3,15.3-15.1,26.1-15.1c-5.3-9.3-5.3-20.9,0-30.4C76.6,412.1,66.7,406.3,61.2,396.9z" data-v-7a368b29></path><text transform="matrix(0.9908 0 0 1 118.0161 171.7975)" class="st3 st4 st5" style="white-space:pre;" data-v-7a368b29> Tissue region </text><path class="st6" d="M40.9,231.1c11.3-10.6,29.5-10.6,40.8,0c11.3,10.6,11.3,27.9,0,38.5c-11.3,10.6-29.5,10.6-40.8,0 C29.7,259,29.7,241.7,40.9,231.1z" data-v-7a368b29></path><text transform="matrix(0.9908 0 0 1 118.0161 257.675)" class="st3 st4 st5" style="white-space:pre;" data-v-7a368b29> Brain nuclei </text><text transform="matrix(0.9908 0 0 1 118.0903 345.5266)" class="st3 st4 st5" style="white-space:pre;" data-v-7a368b29> Ganglia </text><text transform="matrix(0.9908 0 0 1 118.0903 433.1613)" class="st3 st4 st5" style="white-space:pre;" data-v-7a368b29> Ganglionated nerve plexus </text>',9),i6t=[n6t],o6t=e6t(()=>a.createElementVNode("svg",{width:"72px",height:"72px",viewBox:"0 0 24 24",fill:"yellow"},null,-1));function a6t(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",t6t,[(a.openBlock(),a.createElementBlock("svg",r6t,i6t)),o6t])}const Cde=R4($pt,[["render",a6t],["__scopeId","data-v-7a368b29"]]),s6t='<div class="flatmap-marker"><svg display="block" height="41px" width="27px" viewBox="0 0 27 41"><g fill-rule="nonzero"><g transform="translate(3.0, 29.0)" fill="#000000"><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="10.5" ry="5.25002273"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="10.5" ry="5.25002273"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="9.5" ry="4.77275007"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="8.5" ry="4.29549936"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="7.5" ry="3.81822308"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="6.5" ry="3.34094679"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="5.5" ry="2.86367051"></ellipse><ellipse opacity="0.04" cx="10.5" cy="5.80029008" rx="4.5" ry="2.38636864"></ellipse></g><g fill="#005974"><path d="M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"></path></g><g opacity="0.25" fill="#000000"><path d="M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"></path></g><g transform="translate(6.0, 7.0)" fill="#FFFFFF"></g><g transform="translate(8.0, 8.0)"><circle fill="#000000" opacity="0.25" cx="5.5" cy="5.5" r="5.4999962"></circle><circle fill="#FFFFFF" cx="5.5" cy="5.5" r="5.4999962"></circle></g></g></svg></div>',CE=function(e){return[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t))},_x={},Ede=async function(e,t){return _x&&_x.hasOwnProperty(t)?_x[t]:new Promise(r=>{fetch(`${e}knowledge/label/${t}`,{method:"GET"}).then(n=>n.json()).then(n=>{let i=n.label;i==="Mammalia"&&(i="Mammalia not otherwise specified"),_x[t]=i,r(i)}).catch(n=>{console.error("Error:",n),_x[t]=t,r(t)})})},EE=function(e,t){let r=JSON.stringify(e),n=JSON.stringify(t);return r.indexOf(n)!==-1};let l6t=function(){this.initialise=function(e){this.flatmapApi=e,this.destinations=[],this.origins=[],this.components=[],this.urls=[],this.controller=void 0,this.uberons=[],this.lookUp=[]},this.createTooltipData=async function(e){let t=[];e.feature.hyperlinks&&e.feature.hyperlinks.length>0?t=e.feature.hyperlinks:t=this.urls.map(n=>({url:n,id:"pubmed"}));let r;if(e.provenanceTaxonomy){r=[];for(let n=0;e.provenanceTaxonomy.length>n;n++)r.push(await Ede(this.flatmapAPI,e.provenanceTaxonomy[n]))}return{destinations:this.destinations,origins:this.origins,components:this.components,destinationsWithDatasets:this.destinationsWithDatasets,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,title:e.label,featureId:e.resource,hyperlinks:t,provenanceTaxonomy:e.provenanceTaxonomy,provenanceTaxonomyLabel:r}},this.createComponentsLabelList=function(e,t){let r=[];return e.forEach(n=>{r.push(this.createLabelFromNeuralNode(n[0]),t),n.length===2&&r.push(this.createLabelFromNeuralNode(n[1]),t)}),r},this.createLabelLookup=function(e){return new Promise(t=>{let r={};this.uberons=[];const n={sql:this.buildLabelSqlStatement(e)};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(l=>{r[l[o]]=l[s],this.uberons.push({id:l[o],name:l[s]})}),t(r)})})},this.buildConnectivitySqlStatement=function(e){let t="select knowledge from knowledge where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.buildLabelSqlStatement=function(e){let t="select entity, label from labels where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.findAllIdsFromConnectivity=function(e){let t=e.connectivity.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),[...new Set(n.flat())]},this.flattenConntectivity=function(e){let t=e.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(e){let t=e.connectivity.flat(),r=CE(t),n=[],i=!1;return r.forEach(o=>{i=!1,EE(e.axons,o)&&(i=!0),EE(e.dendrites,o)&&(i=!0),i||n.push(o)}),n},this.retrieveFlatmapKnowledgeForEvent=async function(e){this.controller&&this.controller.abort(),this.controller=new AbortController;const t=this.controller.signal,r=e.resource;if(this.destinations=[],this.origins=[],this.components=[],!r||r.length==0)return;const n={sql:this.buildConnectivitySqlStatement(r)};let i=new Promise(s=>{fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:t}).then(l=>l.json()).then(l=>{if(this.connectivityExists(l)){let c=JSON.parse(l.values[0][0]);this.processConnectivity(c).then(()=>{s(!0)})}else s(!1)}).catch(l=>{console.error("Error:",l),s(!1)})}),o=await this.pubmedQueryOnIds(e);return await Promise.all([i,o])},this.connectivityExists=function(e){return!!(e.values&&e.values.length>0&&JSON.parse(e.values[0][0]).connectivity&&JSON.parse(e.values[0][0]).connectivity.length>0)},this.createLabelFromNeuralNode=function(e,t){let r=t[e[0]];return e.length===2&&e[1].length>0&&e[1].forEach(n=>{t[n]==null?r+=`, ${n}`:r+=`, ${t[n]}`}),r},this.flattenAndFindDatasets=function(e,t,r){let n=this.flattenConntectivity(e),i=this.flattenConntectivity(t),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(e){return new Promise(t=>{let r=this.findComponents(e),n=CE(e.axons),i=CE(e.dendrites),o=this.findAllIdsFromConnectivity(e);this.createLabelLookup(o).then(s=>{this.destinations=n.map(l=>this.createLabelFromNeuralNode(l,s)),this.origins=i.map(l=>this.createLabelFromNeuralNode(l,s)),this.components=r.map(l=>this.createLabelFromNeuralNode(l,s)),this.flattenAndFindDatasets(r,n,i),t(!0)})})},this.flattenConntectivity=function(e){let t=e.flat(),r=[...new Set(t)],n=[];return r.forEach(i=>{Array.isArray(i)?n.push(i.flat()):n.push(i)}),n.flat()},this.findComponents=function(e){let t=e.connectivity.flat(),r=CE(t),n=[],i=!1;return r.forEach(o=>{i=!1,EE(e.axons,o)&&(i=!0),EE(e.dendrites,o)&&(i=!0),i||n.push(o)}),n},this.stripPMIDPrefix=function(e){return e.split(":")[1]},this.buildPubmedSqlStatement=function(e){let t="select distinct publication from publications where entity in (";if(e.length===1)t+=`'${e[0]}')`;else if(e.length>1)for(let r in e)t+=`'${e[r]}'${r>=e.length-1?")":","} `;return t},this.buildPubmedSqlStatementForModels=function(e){return`select distinct publication from publications where entity = '${e}'`},this.flatmapQuery=function(e){const t={sql:e};return fetch(`${this.flatmapApi}knowledge/query/`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(r=>r.json()).catch(r=>{console.error("Error:",r)})},this.pubmedQueryOnIds=function(e){return new Promise(t=>{const r=e.resource,n=e.feature.source;if(!r||r.length===0)return;const i=this.buildPubmedSqlStatement(r);this.flatmapQuery(i).then(o=>{o.values.length>0?(this.urls=[this.pubmedSearchUrl(o.values.map(s=>this.stripPMIDPrefix(s[0])))],t(!0)):this.pubmedQueryOnModels(n).then(s=>{t(s)})})})},this.pubmedQueryOnModels=function(e){return this.flatmapQuery(this.buildPubmedSqlStatementForModels(e)).then(t=>Array.isArray(t.values)&&t.values.length>0?(this.urls=[this.pubmedSearchUrl(t.values.map(r=>this.stripPMIDPrefix(r[0])))],!0):(this.urls=[],!1))},this.pubmedSearchUrl=function(e){let t="https://pubmed.ncbi.nlm.nih.gov/?",r=new URLSearchParams;return r.append("term",e),t+r.toString()}};const c6t='<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="42" y="50%" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#000000">Featured dataset marker</text></svg>';var Ade={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof window<"u"?window:ae,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(d){return r.setTimeout(d,20)},i=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||function(d){r.clearTimeout(d)};function o(d,p){var h=Object.prototype.toString.call(d),f=h==="[object Array]"||h==="[object NodeList]"||h==="[object HTMLCollection]"||h==="[object Object]"||typeof jQuery<"u"&&d instanceof jQuery||typeof Elements<"u"&&d instanceof Elements,m=0,g=d.length;if(f)for(;m<g;m++)p(d[m]);else p(d)}function s(d){if(!d.getBoundingClientRect)return{width:d.offsetWidth,height:d.offsetHeight};var p=d.getBoundingClientRect();return{width:Math.round(p.width),height:Math.round(p.height)}}function l(d,p){Object.keys(p).forEach(function(h){d.style[h]=p[h]})}var c=function(d,p){var h=0;function f(){var g=[];this.add=function(v){g.push(v)};var T,y;this.call=function(v){for(T=0,y=g.length;T<y;T++)g[T].call(this,v)},this.remove=function(v){var _=[];for(T=0,y=g.length;T<y;T++)g[T]!==v&&_.push(g[T]);g=_},this.length=function(){return g.length}}function m(g,T){if(g){if(g.resizedAttached){g.resizedAttached.add(T);return}g.resizedAttached=new f,g.resizedAttached.add(T),g.resizeSensor=document.createElement("div"),g.resizeSensor.dir="ltr",g.resizeSensor.className="resize-sensor";var y={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},v={position:"absolute",left:"0px",top:"0px",transition:"0s"};l(g.resizeSensor,y);var _=document.createElement("div");_.className="resize-sensor-expand",l(_,y);var b=document.createElement("div");l(b,v),_.appendChild(b);var L=document.createElement("div");L.className="resize-sensor-shrink",l(L,y);var w=document.createElement("div");l(w,v),l(w,{width:"200%",height:"200%"}),L.appendChild(w),g.resizeSensor.appendChild(_),g.resizeSensor.appendChild(L),g.appendChild(g.resizeSensor);var k=window.getComputedStyle(g),C=k?k.getPropertyValue("position"):null;C!=="absolute"&&C!=="relative"&&C!=="fixed"&&C!=="sticky"&&(g.style.position="relative");var A=!1,O=0,N=s(g),I=0,R=0,D=!0;h=0;var j=function(){var U=g.offsetWidth,X=g.offsetHeight;b.style.width=U+10+"px",b.style.height=X+10+"px",_.scrollLeft=U+10,_.scrollTop=X+10,L.scrollLeft=U+10,L.scrollTop=X+10},G=function(){if(D){var U=g.offsetWidth===0&&g.offsetHeight===0;if(U){h||(h=n(function(){h=0,G()}));return}else D=!1}j()};g.resizeSensor.resetSensor=G;var P=function(){O=0,A&&(I=N.width,R=N.height,g.resizedAttached&&g.resizedAttached.call(N))},W=function(){N=s(g),A=N.width!==I||N.height!==R,A&&!O&&(O=n(P)),G()},K=function(U,X,ee){U.attachEvent?U.attachEvent("on"+X,ee):U.addEventListener(X,ee)};K(_,"scroll",W),K(L,"scroll",W),h=n(function(){h=0,G()})}}o(d,function(g){m(g,p)}),this.detach=function(g){h||(i(h),h=0),c.detach(d,g)},this.reset=function(){d.resizeSensor.resetSensor()}};if(c.reset=function(d){o(d,function(p){p.resizeSensor.resetSensor()})},c.detach=function(d,p){o(d,function(h){h&&(h.resizedAttached&&typeof p=="function"&&(h.resizedAttached.remove(p),h.resizedAttached.length())||h.resizeSensor&&(h.contains(h.resizeSensor)&&h.removeChild(h.resizeSensor),delete h.resizeSensor,delete h.resizedAttached))})},typeof MutationObserver<"u"){var u=new MutationObserver(function(d){for(var p in d)if(d.hasOwnProperty(p))for(var h=d[p].addedNodes,f=0;f<h.length;f++)h[f].resizeSensor&&c.reset(h[f])});document.addEventListener("DOMContentLoaded",function(d){u.observe(document.body,{childList:!0,subtree:!0})})}return c})})(Ade);var u6t=Ade.exports;const d6t=BU(u6t);var Ode={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(ae,function(){var r,n,i;function o(l,c){if(!r)r=c;else if(!n)n=c;else{var u="var sharedChunk = {}; ("+r+")(sharedChunk); ("+n+")(sharedChunk);",d={};r(d),i=c(d),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([u],{type:"text/javascript"})))}}o(["exports"],function(l){function c(S,Q,M,V){return new(M||(M=Promise))(function(F,Y){function $(Me){try{Qe(V.next(Me))}catch(Fe){Y(Fe)}}function ce(Me){try{Qe(V.throw(Me))}catch(Fe){Y(Fe)}}function Qe(Me){var Fe;Me.done?F(Me.value):(Fe=Me.value,Fe instanceof M?Fe:new M(function(Ze){Ze(Fe)})).then($,ce)}Qe((V=V.apply(S,Q||[])).next())})}function u(S){return S&&S.__esModule&&Object.prototype.hasOwnProperty.call(S,"default")?S.default:S}typeof SuppressedError=="function"&&SuppressedError;var d=p;function p(S,Q){this.x=S,this.y=Q}p.prototype={clone:function(){return new p(this.x,this.y)},add:function(S){return this.clone()._add(S)},sub:function(S){return this.clone()._sub(S)},multByPoint:function(S){return this.clone()._multByPoint(S)},divByPoint:function(S){return this.clone()._divByPoint(S)},mult:function(S){return this.clone()._mult(S)},div:function(S){return this.clone()._div(S)},rotate:function(S){return this.clone()._rotate(S)},rotateAround:function(S,Q){return this.clone()._rotateAround(S,Q)},matMult:function(S){return this.clone()._matMult(S)},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(S){return this.x===S.x&&this.y===S.y},dist:function(S){return Math.sqrt(this.distSqr(S))},distSqr:function(S){var Q=S.x-this.x,M=S.y-this.y;return Q*Q+M*M},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(S){return Math.atan2(this.y-S.y,this.x-S.x)},angleWith:function(S){return this.angleWithSep(S.x,S.y)},angleWithSep:function(S,Q){return Math.atan2(this.x*Q-this.y*S,this.x*S+this.y*Q)},_matMult:function(S){var Q=S[2]*this.x+S[3]*this.y;return this.x=S[0]*this.x+S[1]*this.y,this.y=Q,this},_add:function(S){return this.x+=S.x,this.y+=S.y,this},_sub:function(S){return this.x-=S.x,this.y-=S.y,this},_mult:function(S){return this.x*=S,this.y*=S,this},_div:function(S){return this.x/=S,this.y/=S,this},_multByPoint:function(S){return this.x*=S.x,this.y*=S.y,this},_divByPoint:function(S){return this.x/=S.x,this.y/=S.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var S=this.y;return this.y=this.x,this.x=-S,this},_rotate:function(S){var Q=Math.cos(S),M=Math.sin(S),V=M*this.x+Q*this.y;return this.x=Q*this.x-M*this.y,this.y=V,this},_rotateAround:function(S,Q){var M=Math.cos(S),V=Math.sin(S),F=Q.y+V*(this.x-Q.x)+M*(this.y-Q.y);return this.x=Q.x+M*(this.x-Q.x)-V*(this.y-Q.y),this.y=F,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},p.convert=function(S){return S instanceof p?S:Array.isArray(S)?new p(S[0],S[1]):S};var h=u(d),f=m;function m(S,Q,M,V){this.cx=3*S,this.bx=3*(M-S)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*Q,this.by=3*(V-Q)-this.cy,this.ay=1-this.cy-this.by,this.p1x=S,this.p1y=Q,this.p2x=M,this.p2y=V}m.prototype={sampleCurveX:function(S){return((this.ax*S+this.bx)*S+this.cx)*S},sampleCurveY:function(S){return((this.ay*S+this.by)*S+this.cy)*S},sampleCurveDerivativeX:function(S){return(3*this.ax*S+2*this.bx)*S+this.cx},solveCurveX:function(S,Q){if(Q===void 0&&(Q=1e-6),S<0)return 0;if(S>1)return 1;for(var M=S,V=0;V<8;V++){var F=this.sampleCurveX(M)-S;if(Math.abs(F)<Q)return M;var Y=this.sampleCurveDerivativeX(M);if(Math.abs(Y)<1e-6)break;M-=F/Y}var $=0,ce=1;for(M=S,V=0;V<20&&(F=this.sampleCurveX(M),!(Math.abs(F-S)<Q));V++)S>F?$=M:ce=M,M=.5*(ce-$)+$;return M},solve:function(S,Q){return this.sampleCurveY(this.solveCurveX(S,Q))}};var g=u(f);let T,y;function v(){return T==null&&(T=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),T}function _(){if(y==null&&(y=!1,v())){const S=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(S){for(let M=0;M<5*5;M++){const V=4*M;S.fillStyle=`rgb(${V},${V+1},${V+2})`,S.fillRect(M%5,Math.floor(M/5),1,1)}const Q=S.getImageData(0,0,5,5).data;for(let M=0;M<5*5*4;M++)if(M%4!=3&&Q[M]!==M){y=!0;break}}}return y||!1}function b(S,Q,M,V){const F=new g(S,Q,M,V);return function(Y){return F.solve(Y)}}const L=b(.25,.1,.25,1);function w(S,Q,M){return Math.min(M,Math.max(Q,S))}function k(S,Q,M){const V=M-Q,F=((S-Q)%V+V)%V+Q;return F===Q?M:F}function C(S,...Q){for(const M of Q)for(const V in M)S[V]=M[V];return S}let A=1;function O(S,Q,M){const V={};for(const F in S)V[F]=Q.call(M||this,S[F],F,S);return V}function N(S,Q,M){const V={};for(const F in S)Q.call(M||this,S[F],F,S)&&(V[F]=S[F]);return V}function I(S){return Array.isArray(S)?S.map(I):typeof S=="object"&&S?O(S,I):S}const R={};function D(S){R[S]||(typeof console<"u"&&console.warn(S),R[S]=!0)}function j(S,Q,M){return(M.y-S.y)*(Q.x-S.x)>(Q.y-S.y)*(M.x-S.x)}function G(S){let Q=0;for(let M,V,F=0,Y=S.length,$=Y-1;F<Y;$=F++)M=S[F],V=S[$],Q+=(V.x-M.x)*(M.y+V.y);return Q}function P(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}let W=null;function K(S){return typeof ImageBitmap<"u"&&S instanceof ImageBitmap}const U="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function X(S,Q,M,V,F){return c(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const Y=new VideoFrame(S,{timestamp:0});try{const $=Y==null?void 0:Y.format;if(!$||!$.startsWith("BGR")&&!$.startsWith("RGB"))throw new Error(`Unrecognized format ${$}`);const ce=$.startsWith("BGR"),Qe=new Uint8ClampedArray(V*F*4);if(yield Y.copyTo(Qe,function(Me,Fe,Ze,tt,ut){const dt=4*Math.max(-Fe,0),xt=(Math.max(0,Ze)-Ze)*tt*4+dt,Ot=4*tt,Bt=Math.max(0,Fe),rr=Math.max(0,Ze);return{rect:{x:Bt,y:rr,width:Math.min(Me.width,Fe+tt)-Bt,height:Math.min(Me.height,Ze+ut)-rr},layout:[{offset:xt,stride:Ot}]}}(S,Q,M,V,F)),ce)for(let Me=0;Me<Qe.length;Me+=4){const Fe=Qe[Me];Qe[Me]=Qe[Me+2],Qe[Me+2]=Fe}return Qe}finally{Y.close()}})}let ee,oe,he,me;const ie={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(S){const Q=requestAnimationFrame(S);return{cancel:()=>cancelAnimationFrame(Q)}},getImageData(S,Q=0){return this.getImageCanvasContext(S).getImageData(-Q,-Q,S.width+2*Q,S.height+2*Q)},getImageCanvasContext(S){const Q=window.document.createElement("canvas"),M=Q.getContext("2d",{willReadFrequently:!0});if(!M)throw new Error("failed to create canvas 2d context");return Q.width=S.width,Q.height=S.height,M.drawImage(S,0,0,S.width,S.height),M},resolveURL:S=>(he||(he=document.createElement("a")),he.href=S,he.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(me==null&&(me=matchMedia("(prefers-reduced-motion: reduce)")),me.matches)}},be={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class re extends Error{constructor(Q,M,V,F){super(`AJAXError: ${M} (${Q}): ${V}`),this.status=Q,this.statusText=M,this.url=V,this.body=F}}const ue=P()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,ne=S=>be.REGISTERED_PROTOCOLS[S.substring(0,S.indexOf("://"))];function ye(S,Q){const M=new AbortController,V=new Request(S.url,{method:S.method||"GET",body:S.body,credentials:S.credentials,headers:S.headers,cache:S.cache,referrer:ue(),signal:M.signal});let F=!1,Y=!1;return S.type==="json"&&V.headers.set("Accept","application/json"),Y||fetch(V).then($=>$.ok?(ce=>{(S.type==="arrayBuffer"||S.type==="image"?ce.arrayBuffer():S.type==="json"?ce.json():ce.text()).then(Qe=>{Y||(F=!0,Q(null,Qe,ce.headers.get("Cache-Control"),ce.headers.get("Expires")))}).catch(Qe=>{Y||Q(new Error(Qe.message))})})($):$.blob().then(ce=>Q(new re($.status,$.statusText,S.url,ce)))).catch($=>{$.code!==20&&Q(new Error($.message))}),{cancel:()=>{Y=!0,F||M.abort()}}}const _e=function(S,Q){if(/:\/\//.test(S.url)&&!/^https?:|^file:/.test(S.url)){if(P()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",S,Q);if(!P())return(ne(S.url)||ye)(S,Q)}if(!(/^file:/.test(M=S.url)||/^file:/.test(ue())&&!/^\w+:/.test(M))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return ye(S,Q);if(P()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",S,Q,void 0,!0)}var M;return function(V,F){const Y=new XMLHttpRequest;Y.open(V.method||"GET",V.url,!0),V.type!=="arrayBuffer"&&V.type!=="image"||(Y.responseType="arraybuffer");for(const $ in V.headers)Y.setRequestHeader($,V.headers[$]);return V.type==="json"&&(Y.responseType="text",Y.setRequestHeader("Accept","application/json")),Y.withCredentials=V.credentials==="include",Y.onerror=()=>{F(new Error(Y.statusText))},Y.onload=()=>{if((Y.status>=200&&Y.status<300||Y.status===0)&&Y.response!==null){let $=Y.response;if(V.type==="json")try{$=JSON.parse(Y.response)}catch(ce){return F(ce)}F(null,$,Y.getResponseHeader("Cache-Control"),Y.getResponseHeader("Expires"))}else{const $=new Blob([Y.response],{type:Y.getResponseHeader("Content-Type")});F(new re(Y.status,Y.statusText,V.url,$))}},Y.send(V.body),{cancel:()=>Y.abort()}}(S,Q)},Ie=function(S,Q){return _e(C(S,{type:"arrayBuffer"}),Q)};function qe(S){if(!S||S.indexOf("://")<=0||S.indexOf("data:image/")===0||S.indexOf("blob:")===0)return!0;const Q=new URL(S),M=window.location;return Q.protocol===M.protocol&&Q.host===M.host}function Ge(S,Q,M){M[S]&&M[S].indexOf(Q)!==-1||(M[S]=M[S]||[],M[S].push(Q))}function et(S,Q,M){if(M&&M[S]){const V=M[S].indexOf(Q);V!==-1&&M[S].splice(V,1)}}class Ve{constructor(Q,M={}){C(this,M),this.type=Q}}class Ne extends Ve{constructor(Q,M={}){super("error",C({error:Q},M))}}class it{on(Q,M){return this._listeners=this._listeners||{},Ge(Q,M,this._listeners),this}off(Q,M){return et(Q,M,this._listeners),et(Q,M,this._oneTimeListeners),this}once(Q,M){return M?(this._oneTimeListeners=this._oneTimeListeners||{},Ge(Q,M,this._oneTimeListeners),this):new Promise(V=>this.once(Q,V))}fire(Q,M){typeof Q=="string"&&(Q=new Ve(Q,M||{}));const V=Q.type;if(this.listens(V)){Q.target=this;const F=this._listeners&&this._listeners[V]?this._listeners[V].slice():[];for(const ce of F)ce.call(this,Q);const Y=this._oneTimeListeners&&this._oneTimeListeners[V]?this._oneTimeListeners[V].slice():[];for(const ce of Y)et(V,ce,this._oneTimeListeners),ce.call(this,Q);const $=this._eventedParent;$&&(C(Q,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),$.fire(Q))}else Q instanceof Ne&&console.error(Q.error);return this}listens(Q){return this._listeners&&this._listeners[Q]&&this._listeners[Q].length>0||this._oneTimeListeners&&this._oneTimeListeners[Q]&&this._oneTimeListeners[Q].length>0||this._eventedParent&&this._eventedParent.listens(Q)}setEventedParent(Q,M){return this._eventedParent=Q,this._eventedParentData=M,this}}var Re={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},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":{},within:{}}},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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 pt=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function yt(S,Q){const M={};for(const V in S)V!=="ref"&&(M[V]=S[V]);return pt.forEach(V=>{V in Q&&(M[V]=Q[V])}),M}function ct(S,Q){if(Array.isArray(S)){if(!Array.isArray(Q)||S.length!==Q.length)return!1;for(let M=0;M<S.length;M++)if(!ct(S[M],Q[M]))return!1;return!0}if(typeof S=="object"&&S!==null&&Q!==null){if(typeof Q!="object"||Object.keys(S).length!==Object.keys(Q).length)return!1;for(const M in S)if(!ct(S[M],Q[M]))return!1;return!0}return S===Q}const xe={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Ue(S,Q,M){M.push({command:xe.addSource,args:[S,Q[S]]})}function $e(S,Q,M){Q.push({command:xe.removeSource,args:[S]}),M[S]=!0}function at(S,Q,M,V){$e(S,M,V),Ue(S,Q,M)}function Ht(S,Q,M){let V;for(V in S[M])if(Object.prototype.hasOwnProperty.call(S[M],V)&&V!=="data"&&!ct(S[M][V],Q[M][V]))return!1;for(V in Q[M])if(Object.prototype.hasOwnProperty.call(Q[M],V)&&V!=="data"&&!ct(S[M][V],Q[M][V]))return!1;return!0}function Vt(S,Q,M,V,F,Y){let $;for($ in Q=Q||{},S=S||{})Object.prototype.hasOwnProperty.call(S,$)&&(ct(S[$],Q[$])||M.push({command:Y,args:[V,$,Q[$],F]}));for($ in Q)Object.prototype.hasOwnProperty.call(Q,$)&&!Object.prototype.hasOwnProperty.call(S,$)&&(ct(S[$],Q[$])||M.push({command:Y,args:[V,$,Q[$],F]}))}function Ft(S){return S.id}function Gt(S,Q){return S[Q.id]=Q,S}class Je{constructor(Q,M,V,F){this.message=(Q?`${Q}: `:"")+V,F&&(this.identifier=F),M!=null&&M.__line__&&(this.line=M.__line__)}}function ft(S,...Q){for(const M of Q)for(const V in M)S[V]=M[V];return S}class St extends Error{constructor(Q,M){super(M),this.message=M,this.key=Q}}class Zt{constructor(Q,M=[]){this.parent=Q,this.bindings={};for(const[V,F]of M)this.bindings[V]=F}concat(Q){return new Zt(this,Q)}get(Q){if(this.bindings[Q])return this.bindings[Q];if(this.parent)return this.parent.get(Q);throw new Error(`${Q} not found in scope.`)}has(Q){return!!this.bindings[Q]||!!this.parent&&this.parent.has(Q)}}const Jt={kind:"null"},Pt={kind:"number"},rt={kind:"string"},Et={kind:"boolean"},kt={kind:"color"},or={kind:"object"},$t={kind:"value"},wt={kind:"collator"},je={kind:"formatted"},ke={kind:"padding"},Oe={kind:"resolvedImage"},Ye={kind:"variableAnchorOffsetCollection"};function ve(S,Q){return{kind:"array",itemType:S,N:Q}}function Ae(S){if(S.kind==="array"){const Q=Ae(S.itemType);return typeof S.N=="number"?`array<${Q}, ${S.N}>`:S.itemType.kind==="value"?"array":`array<${Q}>`}return S.kind}const Be=[Jt,Pt,rt,Et,kt,je,or,ve($t),ke,Oe,Ye];function Se(S,Q){if(Q.kind==="error")return null;if(S.kind==="array"){if(Q.kind==="array"&&(Q.N===0&&Q.itemType.kind==="value"||!Se(S.itemType,Q.itemType))&&(typeof S.N!="number"||S.N===Q.N))return null}else{if(S.kind===Q.kind)return null;if(S.kind==="value"){for(const M of Be)if(!Se(M,Q))return null}}return`Expected ${Ae(S)} but found ${Ae(Q)} instead.`}function ge(S,Q){return Q.some(M=>M.kind===S.kind)}function Ce(S,Q){return Q.some(M=>M==="null"?S===null:M==="array"?Array.isArray(S):M==="object"?S&&!Array.isArray(S)&&typeof S=="object":M===typeof S)}function Xe(S,Q){return S.kind==="array"&&Q.kind==="array"?S.itemType.kind===Q.itemType.kind&&typeof S.N=="number":S.kind===Q.kind}const se=.96422,Le=.82521,Ke=4/29,ht=6/29,At=3*ht*ht,qt=ht*ht*ht,nr=Math.PI/180,cr=180/Math.PI;function lr(S){return(S%=360)<0&&(S+=360),S}function hr([S,Q,M,V]){let F,Y;const $=Rr((.2225045*(S=Ir(S))+.7168786*(Q=Ir(Q))+.0606169*(M=Ir(M)))/1);S===Q&&Q===M?F=Y=$:(F=Rr((.4360747*S+.3850649*Q+.1430804*M)/se),Y=Rr((.0139322*S+.0971045*Q+.7141733*M)/Le));const ce=116*$-16;return[ce<0?0:ce,500*(F-$),200*($-Y),V]}function Ir(S){return S<=.04045?S/12.92:Math.pow((S+.055)/1.055,2.4)}function Rr(S){return S>qt?Math.pow(S,1/3):S/At+Ke}function yr([S,Q,M,V]){let F=(S+16)/116,Y=isNaN(Q)?F:F+Q/500,$=isNaN(M)?F:F-M/200;return F=1*an(F),Y=se*an(Y),$=Le*an($),[Ar(3.1338561*Y-1.6168667*F-.4906146*$),Ar(-.9787684*Y+1.9161415*F+.033454*$),Ar(.0719453*Y-.2289914*F+1.4052427*$),V]}function Ar(S){return(S=S<=.00304?12.92*S:1.055*Math.pow(S,1/2.4)-.055)<0?0:S>1?1:S}function an(S){return S>ht?S*S*S:At*(S-Ke)}function Er(S){return parseInt(S.padEnd(2,S),16)/255}function nn(S,Q){return Fr(Q?S/100:S,0,1)}function Fr(S,Q,M){return Math.min(Math.max(Q,S),M)}function zr(S){return!S.some(Number.isNaN)}const Sn={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 dn{constructor(Q,M,V,F=1,Y=!0){this.r=Q,this.g=M,this.b=V,this.a=F,Y||(this.r*=F,this.g*=F,this.b*=F,F||this.overwriteGetter("rgb",[Q,M,V,F]))}static parse(Q){if(Q instanceof dn)return Q;if(typeof Q!="string")return;const M=function(V){if((V=V.toLowerCase().trim())==="transparent")return[0,0,0,0];const F=Sn[V];if(F){const[$,ce,Qe]=F;return[$/255,ce/255,Qe/255,1]}if(V.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(V)){const $=V.length<6?1:2;let ce=1;return[Er(V.slice(ce,ce+=$)),Er(V.slice(ce,ce+=$)),Er(V.slice(ce,ce+=$)),Er(V.slice(ce,ce+$)||"ff")]}if(V.startsWith("rgb")){const $=V.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if($){const[ce,Qe,Me,Fe,Ze,tt,ut,dt,xt,Ot,Bt,rr]=$,Wt=[Fe||" ",ut||" ",Ot].join("");if(Wt===" "||Wt===" /"||Wt===",,"||Wt===",,,"){const ir=[Me,tt,xt].join(""),dr=ir==="%%%"?100:ir===""?255:0;if(dr){const xr=[Fr(+Qe/dr,0,1),Fr(+Ze/dr,0,1),Fr(+dt/dr,0,1),Bt?nn(+Bt,rr):1];if(zr(xr))return xr}}return}}const Y=V.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Y){const[$,ce,Qe,Me,Fe,Ze,tt,ut,dt]=Y,xt=[Qe||" ",Fe||" ",tt].join("");if(xt===" "||xt===" /"||xt===",,"||xt===",,,"){const Ot=[+ce,Fr(+Me,0,100),Fr(+Ze,0,100),ut?nn(+ut,dt):1];if(zr(Ot))return function([Bt,rr,Wt,ir]){function dr(xr){const en=(xr+Bt/30)%12,yn=rr*Math.min(Wt,1-Wt);return Wt-yn*Math.max(-1,Math.min(en-3,9-en,1))}return Bt=lr(Bt),rr/=100,Wt/=100,[dr(0),dr(8),dr(4),ir]}(Ot)}}}(Q);return M?new dn(...M,!1):void 0}get rgb(){const{r:Q,g:M,b:V,a:F}=this,Y=F||1/0;return this.overwriteGetter("rgb",[Q/Y,M/Y,V/Y,F])}get hcl(){return this.overwriteGetter("hcl",function(Q){const[M,V,F,Y]=hr(Q),$=Math.sqrt(V*V+F*F);return[Math.round(1e4*$)?lr(Math.atan2(F,V)*cr):NaN,$,M,Y]}(this.rgb))}get lab(){return this.overwriteGetter("lab",hr(this.rgb))}overwriteGetter(Q,M){return Object.defineProperty(this,Q,{value:M}),M}toString(){const[Q,M,V,F]=this.rgb;return`rgba(${[Q,M,V].map(Y=>Math.round(255*Y)).join(",")},${F})`}}dn.black=new dn(0,0,0,1),dn.white=new dn(1,1,1,1),dn.transparent=new dn(0,0,0,0),dn.red=new dn(1,0,0,1);class Xr{constructor(Q,M,V){this.sensitivity=Q?M?"variant":"case":M?"accent":"base",this.locale=V,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(Q,M){return this.collator.compare(Q,M)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Pn{constructor(Q,M,V,F,Y){this.text=Q,this.image=M,this.scale=V,this.fontStack=F,this.textColor=Y}}class cn{constructor(Q){this.sections=Q}static fromString(Q){return new cn([new Pn(Q,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(Q=>Q.text.length!==0||Q.image&&Q.image.name.length!==0)}static factory(Q){return Q instanceof cn?Q:cn.fromString(Q)}toString(){return this.sections.length===0?"":this.sections.map(Q=>Q.text).join("")}}class ni{constructor(Q){this.values=Q.slice()}static parse(Q){if(Q instanceof ni)return Q;if(typeof Q=="number")return new ni([Q,Q,Q,Q]);if(Array.isArray(Q)&&!(Q.length<1||Q.length>4)){for(const M of Q)if(typeof M!="number")return;switch(Q.length){case 1:Q=[Q[0],Q[0],Q[0],Q[0]];break;case 2:Q=[Q[0],Q[1],Q[0],Q[1]];break;case 3:Q=[Q[0],Q[1],Q[2],Q[1]]}return new ni(Q)}}toString(){return JSON.stringify(this.values)}}const Zn=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class si{constructor(Q){this.values=Q.slice()}static parse(Q){if(Q instanceof si)return Q;if(Array.isArray(Q)&&!(Q.length<1)&&Q.length%2==0){for(let M=0;M<Q.length;M+=2){const V=Q[M],F=Q[M+1];if(typeof V!="string"||!Zn.has(V)||!Array.isArray(F)||F.length!==2||typeof F[0]!="number"||typeof F[1]!="number")return}return new si(Q)}}toString(){return JSON.stringify(this.values)}}class ii{constructor(Q){this.name=Q.name,this.available=Q.available}toString(){return this.name}static fromString(Q){return Q?new ii({name:Q,available:!1}):null}}function ra(S,Q,M,V){return typeof S=="number"&&S>=0&&S<=255&&typeof Q=="number"&&Q>=0&&Q<=255&&typeof M=="number"&&M>=0&&M<=255?V===void 0||typeof V=="number"&&V>=0&&V<=1?null:`Invalid rgba value [${[S,Q,M,V].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof V=="number"?[S,Q,M,V]:[S,Q,M]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function mo(S){if(S===null||typeof S=="string"||typeof S=="boolean"||typeof S=="number"||S instanceof dn||S instanceof Xr||S instanceof cn||S instanceof ni||S instanceof si||S instanceof ii)return!0;if(Array.isArray(S)){for(const Q of S)if(!mo(Q))return!1;return!0}if(typeof S=="object"){for(const Q in S)if(!mo(S[Q]))return!1;return!0}return!1}function Qn(S){if(S===null)return Jt;if(typeof S=="string")return rt;if(typeof S=="boolean")return Et;if(typeof S=="number")return Pt;if(S instanceof dn)return kt;if(S instanceof Xr)return wt;if(S instanceof cn)return je;if(S instanceof ni)return ke;if(S instanceof si)return Ye;if(S instanceof ii)return Oe;if(Array.isArray(S)){const Q=S.length;let M;for(const V of S){const F=Qn(V);if(M){if(M===F)continue;M=$t;break}M=F}return ve(M||$t,Q)}return or}function jn(S){const Q=typeof S;return S===null?"":Q==="string"||Q==="number"||Q==="boolean"?String(S):S instanceof dn||S instanceof cn||S instanceof ni||S instanceof si||S instanceof ii?S.toString():JSON.stringify(S)}class qa{constructor(Q,M){this.type=Q,this.value=M}static parse(Q,M){if(Q.length!==2)return M.error(`'literal' expression requires exactly one argument, but found ${Q.length-1} instead.`);if(!mo(Q[1]))return M.error("invalid value");const V=Q[1];let F=Qn(V);const Y=M.expectedType;return F.kind!=="array"||F.N!==0||!Y||Y.kind!=="array"||typeof Y.N=="number"&&Y.N!==0||(F=Y),new qa(F,V)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ri{constructor(Q){this.name="ExpressionEvaluationError",this.message=Q}toJSON(){return this.message}}const Wa={string:rt,number:Pt,boolean:Et,object:or};class na{constructor(Q,M){this.type=Q,this.args=M}static parse(Q,M){if(Q.length<2)return M.error("Expected at least one argument.");let V,F=1;const Y=Q[0];if(Y==="array"){let ce,Qe;if(Q.length>2){const Me=Q[1];if(typeof Me!="string"||!(Me in Wa)||Me==="object")return M.error('The item type argument of "array" must be one of string, number, boolean',1);ce=Wa[Me],F++}else ce=$t;if(Q.length>3){if(Q[2]!==null&&(typeof Q[2]!="number"||Q[2]<0||Q[2]!==Math.floor(Q[2])))return M.error('The length argument to "array" must be a positive integer literal',2);Qe=Q[2],F++}V=ve(ce,Qe)}else{if(!Wa[Y])throw new Error(`Types doesn't contain name = ${Y}`);V=Wa[Y]}const $=[];for(;F<Q.length;F++){const ce=M.parse(Q[F],F,$t);if(!ce)return null;$.push(ce)}return new na(V,$)}evaluate(Q){for(let M=0;M<this.args.length;M++){const V=this.args[M].evaluate(Q);if(!Se(this.type,Qn(V)))return V;if(M===this.args.length-1)throw new ri(`Expected value to be of type ${Ae(this.type)}, but found ${Ae(Qn(V))} instead.`)}throw new Error}eachChild(Q){this.args.forEach(Q)}outputDefined(){return this.args.every(Q=>Q.outputDefined())}}const Qs={"to-boolean":Et,"to-color":kt,"to-number":Pt,"to-string":rt};class lt{constructor(Q,M){this.type=Q,this.args=M}static parse(Q,M){if(Q.length<2)return M.error("Expected at least one argument.");const V=Q[0];if(!Qs[V])throw new Error(`Can't parse ${V} as it is not part of the known types`);if((V==="to-boolean"||V==="to-string")&&Q.length!==2)return M.error("Expected one argument.");const F=Qs[V],Y=[];for(let $=1;$<Q.length;$++){const ce=M.parse(Q[$],$,$t);if(!ce)return null;Y.push(ce)}return new lt(F,Y)}evaluate(Q){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(Q);case"color":{let M,V;for(const F of this.args){if(M=F.evaluate(Q),V=null,M instanceof dn)return M;if(typeof M=="string"){const Y=Q.parseColor(M);if(Y)return Y}else if(Array.isArray(M)&&(V=M.length<3||M.length>4?`Invalid rbga value ${JSON.stringify(M)}: expected an array containing either three or four numeric values.`:ra(M[0],M[1],M[2],M[3]),!V))return new dn(M[0]/255,M[1]/255,M[2]/255,M[3])}throw new ri(V||`Could not parse color from value '${typeof M=="string"?M:JSON.stringify(M)}'`)}case"padding":{let M;for(const V of this.args){M=V.evaluate(Q);const F=ni.parse(M);if(F)return F}throw new ri(`Could not parse padding from value '${typeof M=="string"?M:JSON.stringify(M)}'`)}case"variableAnchorOffsetCollection":{let M;for(const V of this.args){M=V.evaluate(Q);const F=si.parse(M);if(F)return F}throw new ri(`Could not parse variableAnchorOffsetCollection from value '${typeof M=="string"?M:JSON.stringify(M)}'`)}case"number":{let M=null;for(const V of this.args){if(M=V.evaluate(Q),M===null)return 0;const F=Number(M);if(!isNaN(F))return F}throw new ri(`Could not convert ${JSON.stringify(M)} to number.`)}case"formatted":return cn.fromString(jn(this.args[0].evaluate(Q)));case"resolvedImage":return ii.fromString(jn(this.args[0].evaluate(Q)));default:return jn(this.args[0].evaluate(Q))}}eachChild(Q){this.args.forEach(Q)}outputDefined(){return this.args.every(Q=>Q.outputDefined())}}const _t=["Unknown","Point","LineString","Polygon"];class Mt{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"?_t[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(Q){let M=this._parseColorCache[Q];return M||(M=this._parseColorCache[Q]=dn.parse(Q)),M}}class Rt{constructor(Q,M,V=[],F,Y=new Zt,$=[]){this.registry=Q,this.path=V,this.key=V.map(ce=>`[${ce}]`).join(""),this.scope=Y,this.errors=$,this.expectedType=F,this._isConstant=M}parse(Q,M,V,F,Y={}){return M?this.concat(M,V,F)._parse(Q,Y):this._parse(Q,Y)}_parse(Q,M){function V(F,Y,$){return $==="assert"?new na(Y,[F]):$==="coerce"?new lt(Y,[F]):F}if(Q!==null&&typeof Q!="string"&&typeof Q!="boolean"&&typeof Q!="number"||(Q=["literal",Q]),Array.isArray(Q)){if(Q.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const F=Q[0];if(typeof F!="string")return this.error(`Expression name must be a string, but found ${typeof F} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Y=this.registry[F];if(Y){let $=Y.parse(Q,this);if(!$)return null;if(this.expectedType){const ce=this.expectedType,Qe=$.type;if(ce.kind!=="string"&&ce.kind!=="number"&&ce.kind!=="boolean"&&ce.kind!=="object"&&ce.kind!=="array"||Qe.kind!=="value")if(ce.kind!=="color"&&ce.kind!=="formatted"&&ce.kind!=="resolvedImage"||Qe.kind!=="value"&&Qe.kind!=="string")if(ce.kind!=="padding"||Qe.kind!=="value"&&Qe.kind!=="number"&&Qe.kind!=="array")if(ce.kind!=="variableAnchorOffsetCollection"||Qe.kind!=="value"&&Qe.kind!=="array"){if(this.checkSubtype(ce,Qe))return null}else $=V($,ce,M.typeAnnotation||"coerce");else $=V($,ce,M.typeAnnotation||"coerce");else $=V($,ce,M.typeAnnotation||"coerce");else $=V($,ce,M.typeAnnotation||"assert")}if(!($ instanceof qa)&&$.type.kind!=="resolvedImage"&&this._isConstant($)){const ce=new Mt;try{$=new qa($.type,$.evaluate(ce))}catch(Qe){return this.error(Qe.message),null}}return $}return this.error(`Unknown expression "${F}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(Q===void 0?"'undefined' value invalid. Use null instead.":typeof Q=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof Q} instead.`)}concat(Q,M,V){const F=typeof Q=="number"?this.path.concat(Q):this.path,Y=V?this.scope.concat(V):this.scope;return new Rt(this.registry,this._isConstant,F,M||null,Y,this.errors)}error(Q,...M){const V=`${this.key}${M.map(F=>`[${F}]`).join("")}`;this.errors.push(new St(V,Q))}checkSubtype(Q,M){const V=Se(Q,M);return V&&this.error(V),V}}class ar{constructor(Q,M,V){this.type=wt,this.locale=V,this.caseSensitive=Q,this.diacriticSensitive=M}static parse(Q,M){if(Q.length!==2)return M.error("Expected one argument.");const V=Q[1];if(typeof V!="object"||Array.isArray(V))return M.error("Collator options argument must be an object.");const F=M.parse(V["case-sensitive"]!==void 0&&V["case-sensitive"],1,Et);if(!F)return null;const Y=M.parse(V["diacritic-sensitive"]!==void 0&&V["diacritic-sensitive"],1,Et);if(!Y)return null;let $=null;return V.locale&&($=M.parse(V.locale,1,rt),!$)?null:new ar(F,Y,$)}evaluate(Q){return new Xr(this.caseSensitive.evaluate(Q),this.diacriticSensitive.evaluate(Q),this.locale?this.locale.evaluate(Q):null)}eachChild(Q){Q(this.caseSensitive),Q(this.diacriticSensitive),this.locale&&Q(this.locale)}outputDefined(){return!1}}const gr=8192;function Pr(S,Q){S[0]=Math.min(S[0],Q[0]),S[1]=Math.min(S[1],Q[1]),S[2]=Math.max(S[2],Q[0]),S[3]=Math.max(S[3],Q[1])}function Qr(S,Q){return!(S[0]<=Q[0]||S[2]>=Q[2]||S[1]<=Q[1]||S[3]>=Q[3])}function Dr(S,Q){const M=(180+S[0])/360,V=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+S[1]*Math.PI/360)))/360,F=Math.pow(2,Q.z);return[Math.round(M*F*gr),Math.round(V*F*gr)]}function rn(S,Q,M){const V=S[0]-Q[0],F=S[1]-Q[1],Y=S[0]-M[0],$=S[1]-M[1];return V*$-Y*F==0&&V*Y<=0&&F*$<=0}function qr(S,Q){let M=!1;for(let $=0,ce=Q.length;$<ce;$++){const Qe=Q[$];for(let Me=0,Fe=Qe.length;Me<Fe-1;Me++){if(rn(S,Qe[Me],Qe[Me+1]))return!1;(F=Qe[Me])[1]>(V=S)[1]!=(Y=Qe[Me+1])[1]>V[1]&&V[0]<(Y[0]-F[0])*(V[1]-F[1])/(Y[1]-F[1])+F[0]&&(M=!M)}}var V,F,Y;return M}function Nn(S,Q){for(let M=0;M<Q.length;M++)if(qr(S,Q[M]))return!0;return!1}function Dn(S,Q,M,V){const F=V[0]-M[0],Y=V[1]-M[1],$=(S[0]-M[0])*Y-F*(S[1]-M[1]),ce=(Q[0]-M[0])*Y-F*(Q[1]-M[1]);return $>0&&ce<0||$<0&&ce>0}function Ci(S,Q,M){for(const Me of M)for(let Fe=0;Fe<Me.length-1;++Fe)if((ce=[($=Me[Fe+1])[0]-(Y=Me[Fe])[0],$[1]-Y[1]])[0]*(Qe=[(F=Q)[0]-(V=S)[0],F[1]-V[1]])[1]-ce[1]*Qe[0]!=0&&Dn(V,F,Y,$)&&Dn(Y,$,V,F))return!0;var V,F,Y,$,ce,Qe;return!1}function Xn(S,Q){for(let M=0;M<S.length;++M)if(!qr(S[M],Q))return!1;for(let M=0;M<S.length-1;++M)if(Ci(S[M],S[M+1],Q))return!1;return!0}function Fi(S,Q){for(let M=0;M<Q.length;M++)if(Xn(S,Q[M]))return!0;return!1}function no(S,Q,M){const V=[];for(let F=0;F<S.length;F++){const Y=[];for(let $=0;$<S[F].length;$++){const ce=Dr(S[F][$],M);Pr(Q,ce),Y.push(ce)}V.push(Y)}return V}function bs(S,Q,M){const V=[];for(let F=0;F<S.length;F++){const Y=no(S[F],Q,M);V.push(Y)}return V}function p1(S,Q,M,V){if(S[0]<M[0]||S[0]>M[2]){const F=.5*V;let Y=S[0]-M[0]>F?-V:M[0]-S[0]>F?V:0;Y===0&&(Y=S[0]-M[2]>F?-V:M[2]-S[0]>F?V:0),S[0]+=Y}Pr(Q,S)}function Ha(S,Q,M,V){const F=Math.pow(2,V.z)*gr,Y=[V.x*gr,V.y*gr],$=[];for(const ce of S)for(const Qe of ce){const Me=[Qe.x+Y[0],Qe.y+Y[1]];p1(Me,Q,M,F),$.push(Me)}return $}function ia(S,Q,M,V){const F=Math.pow(2,V.z)*gr,Y=[V.x*gr,V.y*gr],$=[];for(const Qe of S){const Me=[];for(const Fe of Qe){const Ze=[Fe.x+Y[0],Fe.y+Y[1]];Pr(Q,Ze),Me.push(Ze)}$.push(Me)}if(Q[2]-Q[0]<=F/2){(ce=Q)[0]=ce[1]=1/0,ce[2]=ce[3]=-1/0;for(const Qe of $)for(const Me of Qe)p1(Me,Q,M,F)}var ce;return $}class qs{constructor(Q,M){this.type=Et,this.geojson=Q,this.geometries=M}static parse(Q,M){if(Q.length!==2)return M.error(`'within' expression requires exactly one argument, but found ${Q.length-1} instead.`);if(mo(Q[1])){const V=Q[1];if(V.type==="FeatureCollection")for(let F=0;F<V.features.length;++F){const Y=V.features[F].geometry.type;if(Y==="Polygon"||Y==="MultiPolygon")return new qs(V,V.features[F].geometry)}else if(V.type==="Feature"){const F=V.geometry.type;if(F==="Polygon"||F==="MultiPolygon")return new qs(V,V.geometry)}else if(V.type==="Polygon"||V.type==="MultiPolygon")return new qs(V,V)}return M.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(Q){if(Q.geometry()!=null&&Q.canonicalID()!=null){if(Q.geometryType()==="Point")return function(M,V){const F=[1/0,1/0,-1/0,-1/0],Y=[1/0,1/0,-1/0,-1/0],$=M.canonicalID();if(V.type==="Polygon"){const ce=no(V.coordinates,Y,$),Qe=Ha(M.geometry(),F,Y,$);if(!Qr(F,Y))return!1;for(const Me of Qe)if(!qr(Me,ce))return!1}if(V.type==="MultiPolygon"){const ce=bs(V.coordinates,Y,$),Qe=Ha(M.geometry(),F,Y,$);if(!Qr(F,Y))return!1;for(const Me of Qe)if(!Nn(Me,ce))return!1}return!0}(Q,this.geometries);if(Q.geometryType()==="LineString")return function(M,V){const F=[1/0,1/0,-1/0,-1/0],Y=[1/0,1/0,-1/0,-1/0],$=M.canonicalID();if(V.type==="Polygon"){const ce=no(V.coordinates,Y,$),Qe=ia(M.geometry(),F,Y,$);if(!Qr(F,Y))return!1;for(const Me of Qe)if(!Xn(Me,ce))return!1}if(V.type==="MultiPolygon"){const ce=bs(V.coordinates,Y,$),Qe=ia(M.geometry(),F,Y,$);if(!Qr(F,Y))return!1;for(const Me of Qe)if(!Fi(Me,ce))return!1}return!0}(Q,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class is{constructor(Q,M){this.type=M.type,this.name=Q,this.boundExpression=M}static parse(Q,M){if(Q.length!==2||typeof Q[1]!="string")return M.error("'var' expression requires exactly one string literal argument.");const V=Q[1];return M.scope.has(V)?new is(V,M.scope.get(V)):M.error(`Unknown variable "${V}". Make sure "${V}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(Q){return this.boundExpression.evaluate(Q)}eachChild(){}outputDefined(){return!1}}class Mo{constructor(Q,M,V,F){this.name=Q,this.type=M,this._evaluate=V,this.args=F}evaluate(Q){return this._evaluate(Q,this.args)}eachChild(Q){this.args.forEach(Q)}outputDefined(){return!1}static parse(Q,M){const V=Q[0],F=Mo.definitions[V];if(!F)return M.error(`Unknown expression "${V}". If you wanted a literal array, use ["literal", [...]].`,0);const Y=Array.isArray(F)?F[0]:F.type,$=Array.isArray(F)?[[F[1],F[2]]]:F.overloads,ce=$.filter(([Me])=>!Array.isArray(Me)||Me.length===Q.length-1);let Qe=null;for(const[Me,Fe]of ce){Qe=new Rt(M.registry,dl,M.path,null,M.scope);const Ze=[];let tt=!1;for(let ut=1;ut<Q.length;ut++){const dt=Q[ut],xt=Array.isArray(Me)?Me[ut-1]:Me.type,Ot=Qe.parse(dt,1+Ze.length,xt);if(!Ot){tt=!0;break}Ze.push(Ot)}if(!tt)if(Array.isArray(Me)&&Me.length!==Ze.length)Qe.error(`Expected ${Me.length} arguments, but found ${Ze.length} instead.`);else{for(let ut=0;ut<Ze.length;ut++){const dt=Array.isArray(Me)?Me[ut]:Me.type,xt=Ze[ut];Qe.concat(ut+1).checkSubtype(dt,xt.type)}if(Qe.errors.length===0)return new Mo(V,Y,Fe,Ze)}}if(ce.length===1)M.errors.push(...Qe.errors);else{const Me=(ce.length?ce:$).map(([Ze])=>{return tt=Ze,Array.isArray(tt)?`(${tt.map(Ae).join(", ")})`:`(${Ae(tt.type)}...)`;var tt}).join(" | "),Fe=[];for(let Ze=1;Ze<Q.length;Ze++){const tt=M.parse(Q[Ze],1+Fe.length);if(!tt)return null;Fe.push(Ae(tt.type))}M.error(`Expected arguments of type ${Me}, but found (${Fe.join(", ")}) instead.`)}return null}static register(Q,M){Mo.definitions=M;for(const V in M)Q[V]=Mo}}function dl(S){if(S instanceof is)return dl(S.boundExpression);if(S instanceof Mo&&S.name==="error"||S instanceof ar||S instanceof qs)return!1;const Q=S instanceof lt||S instanceof na;let M=!0;return S.eachChild(V=>{M=Q?M&&dl(V):M&&V instanceof qa}),!!M&&G2(S)&&l2(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function G2(S){if(S instanceof Mo&&(S.name==="get"&&S.args.length===1||S.name==="feature-state"||S.name==="has"&&S.args.length===1||S.name==="properties"||S.name==="geometry-type"||S.name==="id"||/^filter-/.test(S.name))||S instanceof qs)return!1;let Q=!0;return S.eachChild(M=>{Q&&!G2(M)&&(Q=!1)}),Q}function h1(S){if(S instanceof Mo&&S.name==="feature-state")return!1;let Q=!0;return S.eachChild(M=>{Q&&!h1(M)&&(Q=!1)}),Q}function l2(S,Q){if(S instanceof Mo&&Q.indexOf(S.name)>=0)return!1;let M=!0;return S.eachChild(V=>{M&&!l2(V,Q)&&(M=!1)}),M}function L3(S,Q){const M=S.length-1;let V,F,Y=0,$=M,ce=0;for(;Y<=$;)if(ce=Math.floor((Y+$)/2),V=S[ce],F=S[ce+1],V<=Q){if(ce===M||Q<F)return ce;Y=ce+1}else{if(!(V>Q))throw new ri("Input is not a number.");$=ce-1}return 0}class iu{constructor(Q,M,V){this.type=Q,this.input=M,this.labels=[],this.outputs=[];for(const[F,Y]of V)this.labels.push(F),this.outputs.push(Y)}static parse(Q,M){if(Q.length-1<4)return M.error(`Expected at least 4 arguments, but found only ${Q.length-1}.`);if((Q.length-1)%2!=0)return M.error("Expected an even number of arguments.");const V=M.parse(Q[1],1,Pt);if(!V)return null;const F=[];let Y=null;M.expectedType&&M.expectedType.kind!=="value"&&(Y=M.expectedType);for(let $=1;$<Q.length;$+=2){const ce=$===1?-1/0:Q[$],Qe=Q[$+1],Me=$,Fe=$+1;if(typeof ce!="number")return M.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',Me);if(F.length&&F[F.length-1][0]>=ce)return M.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Me);const Ze=M.parse(Qe,Fe,Y);if(!Ze)return null;Y=Y||Ze.type,F.push([ce,Ze])}return new iu(Y,V,F)}evaluate(Q){const M=this.labels,V=this.outputs;if(M.length===1)return V[0].evaluate(Q);const F=this.input.evaluate(Q);if(F<=M[0])return V[0].evaluate(Q);const Y=M.length;return F>=M[Y-1]?V[Y-1].evaluate(Q):V[L3(M,F)].evaluate(Q)}eachChild(Q){Q(this.input);for(const M of this.outputs)Q(M)}outputDefined(){return this.outputs.every(Q=>Q.outputDefined())}}function Li(S,Q,M){return S+M*(Q-S)}function i4(S,Q,M){return S.map((V,F)=>Li(V,Q[F],M))}const fc={number:Li,color:function(S,Q,M,V="rgb"){switch(V){case"rgb":{const[F,Y,$,ce]=i4(S.rgb,Q.rgb,M);return new dn(F,Y,$,ce,!1)}case"hcl":{const[F,Y,$,ce]=S.hcl,[Qe,Me,Fe,Ze]=Q.hcl;let tt,ut;if(isNaN(F)||isNaN(Qe))isNaN(F)?isNaN(Qe)?tt=NaN:(tt=Qe,$!==1&&$!==0||(ut=Me)):(tt=F,Fe!==1&&Fe!==0||(ut=Y));else{let rr=Qe-F;Qe>F&&rr>180?rr-=360:Qe<F&&F-Qe>180&&(rr+=360),tt=F+M*rr}const[dt,xt,Ot,Bt]=function([rr,Wt,ir,dr]){return rr=isNaN(rr)?0:rr*nr,yr([ir,Math.cos(rr)*Wt,Math.sin(rr)*Wt,dr])}([tt,ut??Li(Y,Me,M),Li($,Fe,M),Li(ce,Ze,M)]);return new dn(dt,xt,Ot,Bt,!1)}case"lab":{const[F,Y,$,ce]=yr(i4(S.lab,Q.lab,M));return new dn(F,Y,$,ce,!1)}}},array:i4,padding:function(S,Q,M){return new ni(i4(S.values,Q.values,M))},variableAnchorOffsetCollection:function(S,Q,M){const V=S.values,F=Q.values;if(V.length!==F.length)throw new ri(`Cannot interpolate values of different length. from: ${S.toString()}, to: ${Q.toString()}`);const Y=[];for(let $=0;$<V.length;$+=2){if(V[$]!==F[$])throw new ri(`Cannot interpolate values containing mismatched anchors. from[${$}]: ${V[$]}, to[${$}]: ${F[$]}`);Y.push(V[$]);const[ce,Qe]=V[$+1],[Me,Fe]=F[$+1];Y.push([Li(ce,Me,M),Li(Qe,Fe,M)])}return new si(Y)}};class mc{constructor(Q,M,V,F,Y){this.type=Q,this.operator=M,this.interpolation=V,this.input=F,this.labels=[],this.outputs=[];for(const[$,ce]of Y)this.labels.push($),this.outputs.push(ce)}static interpolationFactor(Q,M,V,F){let Y=0;if(Q.name==="exponential")Y=kf(M,Q.base,V,F);else if(Q.name==="linear")Y=kf(M,1,V,F);else if(Q.name==="cubic-bezier"){const $=Q.controlPoints;Y=new g($[0],$[1],$[2],$[3]).solve(kf(M,1,V,F))}return Y}static parse(Q,M){let[V,F,Y,...$]=Q;if(!Array.isArray(F)||F.length===0)return M.error("Expected an interpolation type expression.",1);if(F[0]==="linear")F={name:"linear"};else if(F[0]==="exponential"){const Me=F[1];if(typeof Me!="number")return M.error("Exponential interpolation requires a numeric base.",1,1);F={name:"exponential",base:Me}}else{if(F[0]!=="cubic-bezier")return M.error(`Unknown interpolation type ${String(F[0])}`,1,0);{const Me=F.slice(1);if(Me.length!==4||Me.some(Fe=>typeof Fe!="number"||Fe<0||Fe>1))return M.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);F={name:"cubic-bezier",controlPoints:Me}}}if(Q.length-1<4)return M.error(`Expected at least 4 arguments, but found only ${Q.length-1}.`);if((Q.length-1)%2!=0)return M.error("Expected an even number of arguments.");if(Y=M.parse(Y,2,Pt),!Y)return null;const ce=[];let Qe=null;V==="interpolate-hcl"||V==="interpolate-lab"?Qe=kt:M.expectedType&&M.expectedType.kind!=="value"&&(Qe=M.expectedType);for(let Me=0;Me<$.length;Me+=2){const Fe=$[Me],Ze=$[Me+1],tt=Me+3,ut=Me+4;if(typeof Fe!="number")return M.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',tt);if(ce.length&&ce[ce.length-1][0]>=Fe)return M.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',tt);const dt=M.parse(Ze,ut,Qe);if(!dt)return null;Qe=Qe||dt.type,ce.push([Fe,dt])}return Xe(Qe,Pt)||Xe(Qe,kt)||Xe(Qe,ke)||Xe(Qe,Ye)||Xe(Qe,ve(Pt))?new mc(Qe,V,F,Y,ce):M.error(`Type ${Ae(Qe)} is not interpolatable.`)}evaluate(Q){const M=this.labels,V=this.outputs;if(M.length===1)return V[0].evaluate(Q);const F=this.input.evaluate(Q);if(F<=M[0])return V[0].evaluate(Q);const Y=M.length;if(F>=M[Y-1])return V[Y-1].evaluate(Q);const $=L3(M,F),ce=mc.interpolationFactor(this.interpolation,F,M[$],M[$+1]),Qe=V[$].evaluate(Q),Me=V[$+1].evaluate(Q);switch(this.operator){case"interpolate":return fc[this.type.kind](Qe,Me,ce);case"interpolate-hcl":return fc.color(Qe,Me,ce,"hcl");case"interpolate-lab":return fc.color(Qe,Me,ce,"lab")}}eachChild(Q){Q(this.input);for(const M of this.outputs)Q(M)}outputDefined(){return this.outputs.every(Q=>Q.outputDefined())}}function kf(S,Q,M,V){const F=V-M,Y=S-M;return F===0?0:Q===1?Y/F:(Math.pow(Q,Y)-1)/(Math.pow(Q,F)-1)}class Mf{constructor(Q,M){this.type=Q,this.args=M}static parse(Q,M){if(Q.length<2)return M.error("Expectected at least one argument.");let V=null;const F=M.expectedType;F&&F.kind!=="value"&&(V=F);const Y=[];for(const ce of Q.slice(1)){const Qe=M.parse(ce,1+Y.length,V,void 0,{typeAnnotation:"omit"});if(!Qe)return null;V=V||Qe.type,Y.push(Qe)}if(!V)throw new Error("No output type");const $=F&&Y.some(ce=>Se(F,ce.type));return new Mf($?$t:V,Y)}evaluate(Q){let M,V=null,F=0;for(const Y of this.args)if(F++,V=Y.evaluate(Q),V&&V instanceof ii&&!V.available&&(M||(M=V.name),V=null,F===this.args.length&&(V=M)),V!==null)break;return V}eachChild(Q){this.args.forEach(Q)}outputDefined(){return this.args.every(Q=>Q.outputDefined())}}class y6{constructor(Q,M){this.type=M.type,this.bindings=[].concat(Q),this.result=M}evaluate(Q){return this.result.evaluate(Q)}eachChild(Q){for(const M of this.bindings)Q(M[1]);Q(this.result)}static parse(Q,M){if(Q.length<4)return M.error(`Expected at least 3 arguments, but found ${Q.length-1} instead.`);const V=[];for(let Y=1;Y<Q.length-1;Y+=2){const $=Q[Y];if(typeof $!="string")return M.error(`Expected string, but found ${typeof $} instead.`,Y);if(/[^a-zA-Z0-9_]/.test($))return M.error("Variable names must contain only alphanumeric characters or '_'.",Y);const ce=M.parse(Q[Y+1],Y+1);if(!ce)return null;V.push([$,ce])}const F=M.parse(Q[Q.length-1],Q.length-1,M.expectedType,V);return F?new y6(V,F):null}outputDefined(){return this.result.outputDefined()}}class u9{constructor(Q,M,V){this.type=Q,this.index=M,this.input=V}static parse(Q,M){if(Q.length!==3)return M.error(`Expected 2 arguments, but found ${Q.length-1} instead.`);const V=M.parse(Q[1],1,Pt),F=M.parse(Q[2],2,ve(M.expectedType||$t));return V&&F?new u9(F.type.itemType,V,F):null}evaluate(Q){const M=this.index.evaluate(Q),V=this.input.evaluate(Q);if(M<0)throw new ri(`Array index out of bounds: ${M} < 0.`);if(M>=V.length)throw new ri(`Array index out of bounds: ${M} > ${V.length-1}.`);if(M!==Math.floor(M))throw new ri(`Array index must be an integer, but found ${M} instead.`);return V[M]}eachChild(Q){Q(this.index),Q(this.input)}outputDefined(){return!1}}class Cf{constructor(Q,M){this.type=Et,this.needle=Q,this.haystack=M}static parse(Q,M){if(Q.length!==3)return M.error(`Expected 2 arguments, but found ${Q.length-1} instead.`);const V=M.parse(Q[1],1,$t),F=M.parse(Q[2],2,$t);return V&&F?ge(V.type,[Et,rt,Pt,Jt,$t])?new Cf(V,F):M.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(V.type)} instead`):null}evaluate(Q){const M=this.needle.evaluate(Q),V=this.haystack.evaluate(Q);if(!V)return!1;if(!Ce(M,["boolean","string","number","null"]))throw new ri(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(Qn(M))} instead.`);if(!Ce(V,["string","array"]))throw new ri(`Expected second argument to be of type array or string, but found ${Ae(Qn(V))} instead.`);return V.indexOf(M)>=0}eachChild(Q){Q(this.needle),Q(this.haystack)}outputDefined(){return!0}}class Ef{constructor(Q,M,V){this.type=Pt,this.needle=Q,this.haystack=M,this.fromIndex=V}static parse(Q,M){if(Q.length<=2||Q.length>=5)return M.error(`Expected 3 or 4 arguments, but found ${Q.length-1} instead.`);const V=M.parse(Q[1],1,$t),F=M.parse(Q[2],2,$t);if(!V||!F)return null;if(!ge(V.type,[Et,rt,Pt,Jt,$t]))return M.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(V.type)} instead`);if(Q.length===4){const Y=M.parse(Q[3],3,Pt);return Y?new Ef(V,F,Y):null}return new Ef(V,F)}evaluate(Q){const M=this.needle.evaluate(Q),V=this.haystack.evaluate(Q);if(!Ce(M,["boolean","string","number","null"]))throw new ri(`Expected first argument to be of type boolean, string, number or null, but found ${Ae(Qn(M))} instead.`);if(!Ce(V,["string","array"]))throw new ri(`Expected second argument to be of type array or string, but found ${Ae(Qn(V))} instead.`);if(this.fromIndex){const F=this.fromIndex.evaluate(Q);return V.indexOf(M,F)}return V.indexOf(M)}eachChild(Q){Q(this.needle),Q(this.haystack),this.fromIndex&&Q(this.fromIndex)}outputDefined(){return!1}}class ou{constructor(Q,M,V,F,Y,$){this.inputType=Q,this.type=M,this.input=V,this.cases=F,this.outputs=Y,this.otherwise=$}static parse(Q,M){if(Q.length<5)return M.error(`Expected at least 4 arguments, but found only ${Q.length-1}.`);if(Q.length%2!=1)return M.error("Expected an even number of arguments.");let V,F;M.expectedType&&M.expectedType.kind!=="value"&&(F=M.expectedType);const Y={},$=[];for(let Me=2;Me<Q.length-1;Me+=2){let Fe=Q[Me];const Ze=Q[Me+1];Array.isArray(Fe)||(Fe=[Fe]);const tt=M.concat(Me);if(Fe.length===0)return tt.error("Expected at least one branch label.");for(const dt of Fe){if(typeof dt!="number"&&typeof dt!="string")return tt.error("Branch labels must be numbers or strings.");if(typeof dt=="number"&&Math.abs(dt)>Number.MAX_SAFE_INTEGER)return tt.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof dt=="number"&&Math.floor(dt)!==dt)return tt.error("Numeric branch labels must be integer values.");if(V){if(tt.checkSubtype(V,Qn(dt)))return null}else V=Qn(dt);if(Y[String(dt)]!==void 0)return tt.error("Branch labels must be unique.");Y[String(dt)]=$.length}const ut=M.parse(Ze,Me,F);if(!ut)return null;F=F||ut.type,$.push(ut)}const ce=M.parse(Q[1],1,$t);if(!ce)return null;const Qe=M.parse(Q[Q.length-1],Q.length-1,F);return Qe?ce.type.kind!=="value"&&M.concat(1).checkSubtype(V,ce.type)?null:new ou(V,F,ce,Y,$,Qe):null}evaluate(Q){const M=this.input.evaluate(Q);return(Qn(M)===this.inputType&&this.outputs[this.cases[M]]||this.otherwise).evaluate(Q)}eachChild(Q){Q(this.input),this.outputs.forEach(Q),Q(this.otherwise)}outputDefined(){return this.outputs.every(Q=>Q.outputDefined())&&this.otherwise.outputDefined()}}class au{constructor(Q,M,V){this.type=Q,this.branches=M,this.otherwise=V}static parse(Q,M){if(Q.length<4)return M.error(`Expected at least 3 arguments, but found only ${Q.length-1}.`);if(Q.length%2!=0)return M.error("Expected an odd number of arguments.");let V;M.expectedType&&M.expectedType.kind!=="value"&&(V=M.expectedType);const F=[];for(let $=1;$<Q.length-1;$+=2){const ce=M.parse(Q[$],$,Et);if(!ce)return null;const Qe=M.parse(Q[$+1],$+1,V);if(!Qe)return null;F.push([ce,Qe]),V=V||Qe.type}const Y=M.parse(Q[Q.length-1],Q.length-1,V);if(!Y)return null;if(!V)throw new Error("Can't infer output type");return new au(V,F,Y)}evaluate(Q){for(const[M,V]of this.branches)if(M.evaluate(Q))return V.evaluate(Q);return this.otherwise.evaluate(Q)}eachChild(Q){for(const[M,V]of this.branches)Q(M),Q(V);Q(this.otherwise)}outputDefined(){return this.branches.every(([Q,M])=>M.outputDefined())&&this.otherwise.outputDefined()}}class Af{constructor(Q,M,V,F){this.type=Q,this.input=M,this.beginIndex=V,this.endIndex=F}static parse(Q,M){if(Q.length<=2||Q.length>=5)return M.error(`Expected 3 or 4 arguments, but found ${Q.length-1} instead.`);const V=M.parse(Q[1],1,$t),F=M.parse(Q[2],2,Pt);if(!V||!F)return null;if(!ge(V.type,[ve($t),rt,$t]))return M.error(`Expected first argument to be of type array or string, but found ${Ae(V.type)} instead`);if(Q.length===4){const Y=M.parse(Q[3],3,Pt);return Y?new Af(V.type,V,F,Y):null}return new Af(V.type,V,F)}evaluate(Q){const M=this.input.evaluate(Q),V=this.beginIndex.evaluate(Q);if(!Ce(M,["string","array"]))throw new ri(`Expected first argument to be of type array or string, but found ${Ae(Qn(M))} instead.`);if(this.endIndex){const F=this.endIndex.evaluate(Q);return M.slice(V,F)}return M.slice(V)}eachChild(Q){Q(this.input),Q(this.beginIndex),this.endIndex&&Q(this.endIndex)}outputDefined(){return!1}}function eb(S,Q){return S==="=="||S==="!="?Q.kind==="boolean"||Q.kind==="string"||Q.kind==="number"||Q.kind==="null"||Q.kind==="value":Q.kind==="string"||Q.kind==="number"||Q.kind==="value"}function tb(S,Q,M,V){return V.compare(Q,M)===0}function S3(S,Q,M){const V=S!=="=="&&S!=="!=";return class MWe{constructor(Y,$,ce){this.type=Et,this.lhs=Y,this.rhs=$,this.collator=ce,this.hasUntypedArgument=Y.type.kind==="value"||$.type.kind==="value"}static parse(Y,$){if(Y.length!==3&&Y.length!==4)return $.error("Expected two or three arguments.");const ce=Y[0];let Qe=$.parse(Y[1],1,$t);if(!Qe)return null;if(!eb(ce,Qe.type))return $.concat(1).error(`"${ce}" comparisons are not supported for type '${Ae(Qe.type)}'.`);let Me=$.parse(Y[2],2,$t);if(!Me)return null;if(!eb(ce,Me.type))return $.concat(2).error(`"${ce}" comparisons are not supported for type '${Ae(Me.type)}'.`);if(Qe.type.kind!==Me.type.kind&&Qe.type.kind!=="value"&&Me.type.kind!=="value")return $.error(`Cannot compare types '${Ae(Qe.type)}' and '${Ae(Me.type)}'.`);V&&(Qe.type.kind==="value"&&Me.type.kind!=="value"?Qe=new na(Me.type,[Qe]):Qe.type.kind!=="value"&&Me.type.kind==="value"&&(Me=new na(Qe.type,[Me])));let Fe=null;if(Y.length===4){if(Qe.type.kind!=="string"&&Me.type.kind!=="string"&&Qe.type.kind!=="value"&&Me.type.kind!=="value")return $.error("Cannot use collator to compare non-string types.");if(Fe=$.parse(Y[3],3,wt),!Fe)return null}return new MWe(Qe,Me,Fe)}evaluate(Y){const $=this.lhs.evaluate(Y),ce=this.rhs.evaluate(Y);if(V&&this.hasUntypedArgument){const Qe=Qn($),Me=Qn(ce);if(Qe.kind!==Me.kind||Qe.kind!=="string"&&Qe.kind!=="number")throw new ri(`Expected arguments for "${S}" to be (string, string) or (number, number), but found (${Qe.kind}, ${Me.kind}) instead.`)}if(this.collator&&!V&&this.hasUntypedArgument){const Qe=Qn($),Me=Qn(ce);if(Qe.kind!=="string"||Me.kind!=="string")return Q(Y,$,ce)}return this.collator?M(Y,$,ce,this.collator.evaluate(Y)):Q(Y,$,ce)}eachChild(Y){Y(this.lhs),Y(this.rhs),this.collator&&Y(this.collator)}outputDefined(){return!0}}}const T6=S3("==",function(S,Q,M){return Q===M},tb),kM=S3("!=",function(S,Q,M){return Q!==M},function(S,Q,M,V){return!tb(0,Q,M,V)}),Of=S3("<",function(S,Q,M){return Q<M},function(S,Q,M,V){return V.compare(Q,M)<0}),Hf=S3(">",function(S,Q,M){return Q>M},function(S,Q,M,V){return V.compare(Q,M)>0}),d9=S3("<=",function(S,Q,M){return Q<=M},function(S,Q,M,V){return V.compare(Q,M)<=0}),Vf=S3(">=",function(S,Q,M){return Q>=M},function(S,Q,M,V){return V.compare(Q,M)>=0});class k3{constructor(Q,M,V,F,Y){this.type=rt,this.number=Q,this.locale=M,this.currency=V,this.minFractionDigits=F,this.maxFractionDigits=Y}static parse(Q,M){if(Q.length!==3)return M.error("Expected two arguments.");const V=M.parse(Q[1],1,Pt);if(!V)return null;const F=Q[2];if(typeof F!="object"||Array.isArray(F))return M.error("NumberFormat options argument must be an object.");let Y=null;if(F.locale&&(Y=M.parse(F.locale,1,rt),!Y))return null;let $=null;if(F.currency&&($=M.parse(F.currency,1,rt),!$))return null;let ce=null;if(F["min-fraction-digits"]&&(ce=M.parse(F["min-fraction-digits"],1,Pt),!ce))return null;let Qe=null;return F["max-fraction-digits"]&&(Qe=M.parse(F["max-fraction-digits"],1,Pt),!Qe)?null:new k3(V,Y,$,ce,Qe)}evaluate(Q){return new Intl.NumberFormat(this.locale?this.locale.evaluate(Q):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(Q):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(Q):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(Q):void 0}).format(this.number.evaluate(Q))}eachChild(Q){Q(this.number),this.locale&&Q(this.locale),this.currency&&Q(this.currency),this.minFractionDigits&&Q(this.minFractionDigits),this.maxFractionDigits&&Q(this.maxFractionDigits)}outputDefined(){return!1}}class su{constructor(Q){this.type=je,this.sections=Q}static parse(Q,M){if(Q.length<2)return M.error("Expected at least one argument.");const V=Q[1];if(!Array.isArray(V)&&typeof V=="object")return M.error("First argument must be an image or text section.");const F=[];let Y=!1;for(let $=1;$<=Q.length-1;++$){const ce=Q[$];if(Y&&typeof ce=="object"&&!Array.isArray(ce)){Y=!1;let Qe=null;if(ce["font-scale"]&&(Qe=M.parse(ce["font-scale"],1,Pt),!Qe))return null;let Me=null;if(ce["text-font"]&&(Me=M.parse(ce["text-font"],1,ve(rt)),!Me))return null;let Fe=null;if(ce["text-color"]&&(Fe=M.parse(ce["text-color"],1,kt),!Fe))return null;const Ze=F[F.length-1];Ze.scale=Qe,Ze.font=Me,Ze.textColor=Fe}else{const Qe=M.parse(Q[$],1,$t);if(!Qe)return null;const Me=Qe.type.kind;if(Me!=="string"&&Me!=="value"&&Me!=="null"&&Me!=="resolvedImage")return M.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Y=!0,F.push({content:Qe,scale:null,font:null,textColor:null})}}return new su(F)}evaluate(Q){return new cn(this.sections.map(M=>{const V=M.content.evaluate(Q);return Qn(V)===Oe?new Pn("",V,null,null,null):new Pn(jn(V),null,M.scale?M.scale.evaluate(Q):null,M.font?M.font.evaluate(Q).join(","):null,M.textColor?M.textColor.evaluate(Q):null)}))}eachChild(Q){for(const M of this.sections)Q(M.content),M.scale&&Q(M.scale),M.font&&Q(M.font),M.textColor&&Q(M.textColor)}outputDefined(){return!1}}class If{constructor(Q){this.type=Oe,this.input=Q}static parse(Q,M){if(Q.length!==2)return M.error("Expected two arguments.");const V=M.parse(Q[1],1,rt);return V?new If(V):M.error("No image name provided.")}evaluate(Q){const M=this.input.evaluate(Q),V=ii.fromString(M);return V&&Q.availableImages&&(V.available=Q.availableImages.indexOf(M)>-1),V}eachChild(Q){Q(this.input)}outputDefined(){return!1}}class v6{constructor(Q){this.type=Pt,this.input=Q}static parse(Q,M){if(Q.length!==2)return M.error(`Expected 1 argument, but found ${Q.length-1} instead.`);const V=M.parse(Q[1],1);return V?V.type.kind!=="array"&&V.type.kind!=="string"&&V.type.kind!=="value"?M.error(`Expected argument of type string or array, but found ${Ae(V.type)} instead.`):new v6(V):null}evaluate(Q){const M=this.input.evaluate(Q);if(typeof M=="string"||Array.isArray(M))return M.length;throw new ri(`Expected value to be of type string or array, but found ${Ae(Qn(M))} instead.`)}eachChild(Q){Q(this.input)}outputDefined(){return!1}}const o4={"==":T6,"!=":kM,">":Hf,"<":Of,">=":Vf,"<=":d9,array:na,at:u9,boolean:na,case:au,coalesce:Mf,collator:ar,format:su,image:If,in:Cf,"index-of":Ef,interpolate:mc,"interpolate-hcl":mc,"interpolate-lab":mc,length:v6,let:y6,literal:qa,match:ou,number:na,"number-format":k3,object:na,slice:Af,step:iu,string:na,"to-boolean":lt,"to-color":lt,"to-number":lt,"to-string":lt,var:is,within:qs};function Q6(S,[Q,M,V,F]){Q=Q.evaluate(S),M=M.evaluate(S),V=V.evaluate(S);const Y=F?F.evaluate(S):1,$=ra(Q,M,V,Y);if($)throw new ri($);return new dn(Q/255,M/255,V/255,Y,!1)}function rb(S,Q){return S in Q}function p9(S,Q){const M=Q[S];return M===void 0?null:M}function M3(S){return{type:S}}function h9(S){return{result:"success",value:S}}function zc(S){return{result:"error",value:S}}function a4(S){return S["property-type"]==="data-driven"||S["property-type"]==="cross-faded-data-driven"}function Pf(S){return!!S.expression&&S.expression.parameters.indexOf("zoom")>-1}function Nf(S){return!!S.expression&&S.expression.interpolated}function fi(S){return S instanceof Number?"number":S instanceof String?"string":S instanceof Boolean?"boolean":Array.isArray(S)?"array":S===null?"null":typeof S}function Co(S){return typeof S=="object"&&S!==null&&!Array.isArray(S)}function f9(S){return S}function Qi(S,Q){const M=Q.type==="color",V=S.stops&&typeof S.stops[0][0]=="object",F=V||!(V||S.property!==void 0),Y=S.type||(Nf(Q)?"exponential":"interval");if(M||Q.type==="padding"){const Fe=M?dn.parse:ni.parse;(S=ft({},S)).stops&&(S.stops=S.stops.map(Ze=>[Ze[0],Fe(Ze[1])])),S.default=Fe(S.default?S.default:Q.default)}if(S.colorSpace&&($=S.colorSpace)!=="rgb"&&$!=="hcl"&&$!=="lab")throw new Error(`Unknown color space: "${S.colorSpace}"`);var $;let ce,Qe,Me;if(Y==="exponential")ce=b6;else if(Y==="interval")ce=_o;else if(Y==="categorical"){ce=go,Qe=Object.create(null);for(const Fe of S.stops)Qe[Fe[0]]=Fe[1];Me=typeof S.stops[0][0]}else{if(Y!=="identity")throw new Error(`Unknown function type "${Y}"`);ce=nb}if(V){const Fe={},Ze=[];for(let dt=0;dt<S.stops.length;dt++){const xt=S.stops[dt],Ot=xt[0].zoom;Fe[Ot]===void 0&&(Fe[Ot]={zoom:Ot,type:S.type,property:S.property,default:S.default,stops:[]},Ze.push(Ot)),Fe[Ot].stops.push([xt[0].value,xt[1]])}const tt=[];for(const dt of Ze)tt.push([Fe[dt].zoom,Qi(Fe[dt],Q)]);const ut={name:"linear"};return{kind:"composite",interpolationType:ut,interpolationFactor:mc.interpolationFactor.bind(void 0,ut),zoomStops:tt.map(dt=>dt[0]),evaluate:({zoom:dt},xt)=>b6({stops:tt,base:S.base},Q,dt).evaluate(dt,xt)}}if(F){const Fe=Y==="exponential"?{name:"exponential",base:S.base!==void 0?S.base:1}:null;return{kind:"camera",interpolationType:Fe,interpolationFactor:mc.interpolationFactor.bind(void 0,Fe),zoomStops:S.stops.map(Ze=>Ze[0]),evaluate:({zoom:Ze})=>ce(S,Q,Ze,Qe,Me)}}return{kind:"source",evaluate(Fe,Ze){const tt=Ze&&Ze.properties?Ze.properties[S.property]:void 0;return tt===void 0?gc(S.default,Q.default):ce(S,Q,tt,Qe,Me)}}}function gc(S,Q,M){return S!==void 0?S:Q!==void 0?Q:M!==void 0?M:void 0}function go(S,Q,M,V,F){return gc(typeof M===F?V[M]:void 0,S.default,Q.default)}function _o(S,Q,M){if(fi(M)!=="number")return gc(S.default,Q.default);const V=S.stops.length;if(V===1||M<=S.stops[0][0])return S.stops[0][1];if(M>=S.stops[V-1][0])return S.stops[V-1][1];const F=L3(S.stops.map(Y=>Y[0]),M);return S.stops[F][1]}function b6(S,Q,M){const V=S.base!==void 0?S.base:1;if(fi(M)!=="number")return gc(S.default,Q.default);const F=S.stops.length;if(F===1||M<=S.stops[0][0])return S.stops[0][1];if(M>=S.stops[F-1][0])return S.stops[F-1][1];const Y=L3(S.stops.map(Fe=>Fe[0]),M),$=function(Fe,Ze,tt,ut){const dt=ut-tt,xt=Fe-tt;return dt===0?0:Ze===1?xt/dt:(Math.pow(Ze,xt)-1)/(Math.pow(Ze,dt)-1)}(M,V,S.stops[Y][0],S.stops[Y+1][0]),ce=S.stops[Y][1],Qe=S.stops[Y+1][1],Me=fc[Q.type]||f9;return typeof ce.evaluate=="function"?{evaluate(...Fe){const Ze=ce.evaluate.apply(void 0,Fe),tt=Qe.evaluate.apply(void 0,Fe);if(Ze!==void 0&&tt!==void 0)return Me(Ze,tt,$,S.colorSpace)}}:Me(ce,Qe,$,S.colorSpace)}function nb(S,Q,M){switch(Q.type){case"color":M=dn.parse(M);break;case"formatted":M=cn.fromString(M.toString());break;case"resolvedImage":M=ii.fromString(M.toString());break;case"padding":M=ni.parse(M);break;default:fi(M)===Q.type||Q.type==="enum"&&Q.values[M]||(M=void 0)}return gc(M,S.default,Q.default)}Mo.register(o4,{error:[{kind:"error"},[rt],(S,[Q])=>{throw new ri(Q.evaluate(S))}],typeof:[rt,[$t],(S,[Q])=>Ae(Qn(Q.evaluate(S)))],"to-rgba":[ve(Pt,4),[kt],(S,[Q])=>{const[M,V,F,Y]=Q.evaluate(S).rgb;return[255*M,255*V,255*F,Y]}],rgb:[kt,[Pt,Pt,Pt],Q6],rgba:[kt,[Pt,Pt,Pt,Pt],Q6],has:{type:Et,overloads:[[[rt],(S,[Q])=>rb(Q.evaluate(S),S.properties())],[[rt,or],(S,[Q,M])=>rb(Q.evaluate(S),M.evaluate(S))]]},get:{type:$t,overloads:[[[rt],(S,[Q])=>p9(Q.evaluate(S),S.properties())],[[rt,or],(S,[Q,M])=>p9(Q.evaluate(S),M.evaluate(S))]]},"feature-state":[$t,[rt],(S,[Q])=>p9(Q.evaluate(S),S.featureState||{})],properties:[or,[],S=>S.properties()],"geometry-type":[rt,[],S=>S.geometryType()],id:[$t,[],S=>S.id()],zoom:[Pt,[],S=>S.globals.zoom],"heatmap-density":[Pt,[],S=>S.globals.heatmapDensity||0],"line-progress":[Pt,[],S=>S.globals.lineProgress||0],accumulated:[$t,[],S=>S.globals.accumulated===void 0?null:S.globals.accumulated],"+":[Pt,M3(Pt),(S,Q)=>{let M=0;for(const V of Q)M+=V.evaluate(S);return M}],"*":[Pt,M3(Pt),(S,Q)=>{let M=1;for(const V of Q)M*=V.evaluate(S);return M}],"-":{type:Pt,overloads:[[[Pt,Pt],(S,[Q,M])=>Q.evaluate(S)-M.evaluate(S)],[[Pt],(S,[Q])=>-Q.evaluate(S)]]},"/":[Pt,[Pt,Pt],(S,[Q,M])=>Q.evaluate(S)/M.evaluate(S)],"%":[Pt,[Pt,Pt],(S,[Q,M])=>Q.evaluate(S)%M.evaluate(S)],ln2:[Pt,[],()=>Math.LN2],pi:[Pt,[],()=>Math.PI],e:[Pt,[],()=>Math.E],"^":[Pt,[Pt,Pt],(S,[Q,M])=>Math.pow(Q.evaluate(S),M.evaluate(S))],sqrt:[Pt,[Pt],(S,[Q])=>Math.sqrt(Q.evaluate(S))],log10:[Pt,[Pt],(S,[Q])=>Math.log(Q.evaluate(S))/Math.LN10],ln:[Pt,[Pt],(S,[Q])=>Math.log(Q.evaluate(S))],log2:[Pt,[Pt],(S,[Q])=>Math.log(Q.evaluate(S))/Math.LN2],sin:[Pt,[Pt],(S,[Q])=>Math.sin(Q.evaluate(S))],cos:[Pt,[Pt],(S,[Q])=>Math.cos(Q.evaluate(S))],tan:[Pt,[Pt],(S,[Q])=>Math.tan(Q.evaluate(S))],asin:[Pt,[Pt],(S,[Q])=>Math.asin(Q.evaluate(S))],acos:[Pt,[Pt],(S,[Q])=>Math.acos(Q.evaluate(S))],atan:[Pt,[Pt],(S,[Q])=>Math.atan(Q.evaluate(S))],min:[Pt,M3(Pt),(S,Q)=>Math.min(...Q.map(M=>M.evaluate(S)))],max:[Pt,M3(Pt),(S,Q)=>Math.max(...Q.map(M=>M.evaluate(S)))],abs:[Pt,[Pt],(S,[Q])=>Math.abs(Q.evaluate(S))],round:[Pt,[Pt],(S,[Q])=>{const M=Q.evaluate(S);return M<0?-Math.round(-M):Math.round(M)}],floor:[Pt,[Pt],(S,[Q])=>Math.floor(Q.evaluate(S))],ceil:[Pt,[Pt],(S,[Q])=>Math.ceil(Q.evaluate(S))],"filter-==":[Et,[rt,$t],(S,[Q,M])=>S.properties()[Q.value]===M.value],"filter-id-==":[Et,[$t],(S,[Q])=>S.id()===Q.value],"filter-type-==":[Et,[rt],(S,[Q])=>S.geometryType()===Q.value],"filter-<":[Et,[rt,$t],(S,[Q,M])=>{const V=S.properties()[Q.value],F=M.value;return typeof V==typeof F&&V<F}],"filter-id-<":[Et,[$t],(S,[Q])=>{const M=S.id(),V=Q.value;return typeof M==typeof V&&M<V}],"filter->":[Et,[rt,$t],(S,[Q,M])=>{const V=S.properties()[Q.value],F=M.value;return typeof V==typeof F&&V>F}],"filter-id->":[Et,[$t],(S,[Q])=>{const M=S.id(),V=Q.value;return typeof M==typeof V&&M>V}],"filter-<=":[Et,[rt,$t],(S,[Q,M])=>{const V=S.properties()[Q.value],F=M.value;return typeof V==typeof F&&V<=F}],"filter-id-<=":[Et,[$t],(S,[Q])=>{const M=S.id(),V=Q.value;return typeof M==typeof V&&M<=V}],"filter->=":[Et,[rt,$t],(S,[Q,M])=>{const V=S.properties()[Q.value],F=M.value;return typeof V==typeof F&&V>=F}],"filter-id->=":[Et,[$t],(S,[Q])=>{const M=S.id(),V=Q.value;return typeof M==typeof V&&M>=V}],"filter-has":[Et,[$t],(S,[Q])=>Q.value in S.properties()],"filter-has-id":[Et,[],S=>S.id()!==null&&S.id()!==void 0],"filter-type-in":[Et,[ve(rt)],(S,[Q])=>Q.value.indexOf(S.geometryType())>=0],"filter-id-in":[Et,[ve($t)],(S,[Q])=>Q.value.indexOf(S.id())>=0],"filter-in-small":[Et,[rt,ve($t)],(S,[Q,M])=>M.value.indexOf(S.properties()[Q.value])>=0],"filter-in-large":[Et,[rt,ve($t)],(S,[Q,M])=>function(V,F,Y,$){for(;Y<=$;){const ce=Y+$>>1;if(F[ce]===V)return!0;F[ce]>V?$=ce-1:Y=ce+1}return!1}(S.properties()[Q.value],M.value,0,M.value.length-1)],all:{type:Et,overloads:[[[Et,Et],(S,[Q,M])=>Q.evaluate(S)&&M.evaluate(S)],[M3(Et),(S,Q)=>{for(const M of Q)if(!M.evaluate(S))return!1;return!0}]]},any:{type:Et,overloads:[[[Et,Et],(S,[Q,M])=>Q.evaluate(S)||M.evaluate(S)],[M3(Et),(S,Q)=>{for(const M of Q)if(M.evaluate(S))return!0;return!1}]]},"!":[Et,[Et],(S,[Q])=>!Q.evaluate(S)],"is-supported-script":[Et,[rt],(S,[Q])=>{const M=S.globals&&S.globals.isSupportedScript;return!M||M(Q.evaluate(S))}],upcase:[rt,[rt],(S,[Q])=>Q.evaluate(S).toUpperCase()],downcase:[rt,[rt],(S,[Q])=>Q.evaluate(S).toLowerCase()],concat:[rt,M3($t),(S,Q)=>Q.map(M=>jn(M.evaluate(S))).join("")],"resolved-locale":[rt,[wt],(S,[Q])=>Q.evaluate(S).resolvedLocale()]});class m9{constructor(Q,M){var V;this.expression=Q,this._warningHistory={},this._evaluator=new Mt,this._defaultValue=M?(V=M).type==="color"&&Co(V.default)?new dn(0,0,0,0):V.type==="color"?dn.parse(V.default)||null:V.type==="padding"?ni.parse(V.default)||null:V.type==="variableAnchorOffsetCollection"?si.parse(V.default)||null:V.default===void 0?null:V.default:null,this._enumValues=M&&M.type==="enum"?M.values:null}evaluateWithoutErrorHandling(Q,M,V,F,Y,$){return this._evaluator.globals=Q,this._evaluator.feature=M,this._evaluator.featureState=V,this._evaluator.canonical=F,this._evaluator.availableImages=Y||null,this._evaluator.formattedSection=$,this.expression.evaluate(this._evaluator)}evaluate(Q,M,V,F,Y,$){this._evaluator.globals=Q,this._evaluator.feature=M||null,this._evaluator.featureState=V||null,this._evaluator.canonical=F,this._evaluator.availableImages=Y||null,this._evaluator.formattedSection=$||null;try{const ce=this.expression.evaluate(this._evaluator);if(ce==null||typeof ce=="number"&&ce!=ce)return this._defaultValue;if(this._enumValues&&!(ce in this._enumValues))throw new ri(`Expected value to be one of ${Object.keys(this._enumValues).map(Qe=>JSON.stringify(Qe)).join(", ")}, but found ${JSON.stringify(ce)} instead.`);return ce}catch(ce){return this._warningHistory[ce.message]||(this._warningHistory[ce.message]=!0,typeof console<"u"&&console.warn(ce.message)),this._defaultValue}}}function x6(S){return Array.isArray(S)&&S.length>0&&typeof S[0]=="string"&&S[0]in o4}function _6(S,Q){const M=new Rt(o4,dl,[],Q?function(F){const Y={color:kt,string:rt,number:Pt,enum:rt,boolean:Et,formatted:je,padding:ke,resolvedImage:Oe,variableAnchorOffsetCollection:Ye};return F.type==="array"?ve(Y[F.value]||$t,F.length):Y[F.type]}(Q):void 0),V=M.parse(S,void 0,void 0,void 0,Q&&Q.type==="string"?{typeAnnotation:"coerce"}:void 0);return V?h9(new m9(V,Q)):zc(M.errors)}class g9{constructor(Q,M){this.kind=Q,this._styleExpression=M,this.isStateDependent=Q!=="constant"&&!h1(M.expression)}evaluateWithoutErrorHandling(Q,M,V,F,Y,$){return this._styleExpression.evaluateWithoutErrorHandling(Q,M,V,F,Y,$)}evaluate(Q,M,V,F,Y,$){return this._styleExpression.evaluate(Q,M,V,F,Y,$)}}class Bf{constructor(Q,M,V,F){this.kind=Q,this.zoomStops=V,this._styleExpression=M,this.isStateDependent=Q!=="camera"&&!h1(M.expression),this.interpolationType=F}evaluateWithoutErrorHandling(Q,M,V,F,Y,$){return this._styleExpression.evaluateWithoutErrorHandling(Q,M,V,F,Y,$)}evaluate(Q,M,V,F,Y,$){return this._styleExpression.evaluate(Q,M,V,F,Y,$)}interpolationFactor(Q,M,V){return this.interpolationType?mc.interpolationFactor(this.interpolationType,Q,M,V):0}}function y9(S,Q){const M=_6(S,Q);if(M.result==="error")return M;const V=M.value.expression,F=G2(V);if(!F&&!a4(Q))return zc([new St("","data expressions not supported")]);const Y=l2(V,["zoom"]);if(!Y&&!Pf(Q))return zc([new St("","zoom expressions not supported")]);const $=L6(V);return $||Y?$ instanceof St?zc([$]):$ instanceof mc&&!Nf(Q)?zc([new St("",'"interpolate" expressions cannot be used with this property')]):h9($?new Bf(F?"camera":"composite",M.value,$.labels,$ instanceof mc?$.interpolation:void 0):new g9(F?"constant":"source",M.value)):zc([new St("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class w6{constructor(Q,M){this._parameters=Q,this._specification=M,ft(this,Qi(this._parameters,this._specification))}static deserialize(Q){return new w6(Q._parameters,Q._specification)}static serialize(Q){return{_parameters:Q._parameters,_specification:Q._specification}}}function L6(S){let Q=null;if(S instanceof y6)Q=L6(S.result);else if(S instanceof Mf){for(const M of S.args)if(Q=L6(M),Q)break}else(S instanceof iu||S instanceof mc)&&S.input instanceof Mo&&S.input.name==="zoom"&&(Q=S);return Q instanceof St||S.eachChild(M=>{const V=L6(M);V instanceof St?Q=V:!Q&&V?Q=new St("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):Q&&V&&Q!==V&&(Q=new St("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),Q}function S6(S){if(S===!0||S===!1)return!0;if(!Array.isArray(S)||S.length===0)return!1;switch(S[0]){case"has":return S.length>=2&&S[1]!=="$id"&&S[1]!=="$type";case"in":return S.length>=3&&(typeof S[1]!="string"||Array.isArray(S[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return S.length!==3||Array.isArray(S[1])||Array.isArray(S[2]);case"any":case"all":for(const Q of S.slice(1))if(!S6(Q)&&typeof Q!="boolean")return!1;return!0;default:return!0}}const MM={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function T9(S){if(S==null)return{filter:()=>!0,needGeometry:!1};S6(S)||(S=Rf(S));const Q=_6(S,MM);if(Q.result==="error")throw new Error(Q.value.map(M=>`${M.key}: ${M.message}`).join(", "));return{filter:(M,V,F)=>Q.value.evaluate(M,V,{},F),needGeometry:ib(S)}}function CM(S,Q){return S<Q?-1:S>Q?1:0}function ib(S){if(!Array.isArray(S))return!1;if(S[0]==="within")return!0;for(let Q=1;Q<S.length;Q++)if(ib(S[Q]))return!0;return!1}function Rf(S){if(!S)return!0;const Q=S[0];return S.length<=1?Q!=="any":Q==="=="?v9(S[1],S[2],"=="):Q==="!="?s4(v9(S[1],S[2],"==")):Q==="<"||Q===">"||Q==="<="||Q===">="?v9(S[1],S[2],Q):Q==="any"?(M=S.slice(1),["any"].concat(M.map(Rf))):Q==="all"?["all"].concat(S.slice(1).map(Rf)):Q==="none"?["all"].concat(S.slice(1).map(Rf).map(s4)):Q==="in"?ob(S[1],S.slice(2)):Q==="!in"?s4(ob(S[1],S.slice(2))):Q==="has"?Q9(S[1]):Q==="!has"?s4(Q9(S[1])):Q!=="within"||S;var M}function v9(S,Q,M){switch(S){case"$type":return[`filter-type-${M}`,Q];case"$id":return[`filter-id-${M}`,Q];default:return[`filter-${M}`,S,Q]}}function ob(S,Q){if(Q.length===0)return!1;switch(S){case"$type":return["filter-type-in",["literal",Q]];case"$id":return["filter-id-in",["literal",Q]];default:return Q.length>200&&!Q.some(M=>typeof M!=typeof Q[0])?["filter-in-large",S,["literal",Q.sort(CM)]]:["filter-in-small",S,["literal",Q]]}}function Q9(S){switch(S){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",S]}}function s4(S){return["!",S]}function k6(S){const Q=typeof S;if(Q==="number"||Q==="boolean"||Q==="string"||S==null)return JSON.stringify(S);if(Array.isArray(S)){let F="[";for(const Y of S)F+=`${k6(Y)},`;return`${F}]`}const M=Object.keys(S).sort();let V="{";for(let F=0;F<M.length;F++)V+=`${JSON.stringify(M[F])}:${k6(S[M[F]])},`;return`${V}}`}function M6(S){let Q="";for(const M of pt)Q+=`/${k6(S[M])}`;return Q}function ab(S){const Q=S.value;return Q?[new Je(S.key,Q,"constants have been deprecated as of v8")]:[]}function jo(S){return S instanceof Number||S instanceof String||S instanceof Boolean?S.valueOf():S}function jc(S){if(Array.isArray(S))return S.map(jc);if(S instanceof Object&&!(S instanceof Number||S instanceof String||S instanceof Boolean)){const Q={};for(const M in S)Q[M]=jc(S[M]);return Q}return jo(S)}function Vl(S){const Q=S.key,M=S.value,V=S.valueSpec||{},F=S.objectElementValidators||{},Y=S.style,$=S.styleSpec,ce=S.validateSpec;let Qe=[];const Me=fi(M);if(Me!=="object")return[new Je(Q,M,`object expected, ${Me} found`)];for(const Fe in M){const Ze=Fe.split(".")[0],tt=V[Ze]||V["*"];let ut;if(F[Ze])ut=F[Ze];else if(V[Ze])ut=ce;else if(F["*"])ut=F["*"];else{if(!V["*"]){Qe.push(new Je(Q,M[Fe],`unknown property "${Fe}"`));continue}ut=ce}Qe=Qe.concat(ut({key:(Q&&`${Q}.`)+Fe,value:M[Fe],valueSpec:tt,style:Y,styleSpec:$,object:M,objectKey:Fe,validateSpec:ce},M))}for(const Fe in V)F[Fe]||V[Fe].required&&V[Fe].default===void 0&&M[Fe]===void 0&&Qe.push(new Je(Q,M,`missing required property "${Fe}"`));return Qe}function l4(S){const Q=S.value,M=S.valueSpec,V=S.style,F=S.styleSpec,Y=S.key,$=S.arrayElementValidator||S.validateSpec;if(fi(Q)!=="array")return[new Je(Y,Q,`array expected, ${fi(Q)} found`)];if(M.length&&Q.length!==M.length)return[new Je(Y,Q,`array length ${M.length} expected, length ${Q.length} found`)];if(M["min-length"]&&Q.length<M["min-length"])return[new Je(Y,Q,`array length at least ${M["min-length"]} expected, length ${Q.length} found`)];let ce={type:M.value,values:M.values};F.$version<7&&(ce.function=M.function),fi(M.value)==="object"&&(ce=M.value);let Qe=[];for(let Me=0;Me<Q.length;Me++)Qe=Qe.concat($({array:Q,arrayIndex:Me,value:Q[Me],valueSpec:ce,validateSpec:S.validateSpec,style:V,styleSpec:F,key:`${Y}[${Me}]`}));return Qe}function C6(S){const Q=S.key,M=S.value,V=S.valueSpec;let F=fi(M);return F==="number"&&M!=M&&(F="NaN"),F!=="number"?[new Je(Q,M,`number expected, ${F} found`)]:"minimum"in V&&M<V.minimum?[new Je(Q,M,`${M} is less than the minimum value ${V.minimum}`)]:"maximum"in V&&M>V.maximum?[new Je(Q,M,`${M} is greater than the maximum value ${V.maximum}`)]:[]}function Ff(S){const Q=S.valueSpec,M=jo(S.value.type);let V,F,Y,$={};const ce=M!=="categorical"&&S.value.property===void 0,Qe=!ce,Me=fi(S.value.stops)==="array"&&fi(S.value.stops[0])==="array"&&fi(S.value.stops[0][0])==="object",Fe=Vl({key:S.key,value:S.value,valueSpec:S.styleSpec.function,validateSpec:S.validateSpec,style:S.style,styleSpec:S.styleSpec,objectElementValidators:{stops:function(ut){if(M==="identity")return[new Je(ut.key,ut.value,'identity function may not have a "stops" property')];let dt=[];const xt=ut.value;return dt=dt.concat(l4({key:ut.key,value:xt,valueSpec:ut.valueSpec,validateSpec:ut.validateSpec,style:ut.style,styleSpec:ut.styleSpec,arrayElementValidator:Ze})),fi(xt)==="array"&&xt.length===0&&dt.push(new Je(ut.key,xt,"array must have at least one stop")),dt},default:function(ut){return ut.validateSpec({key:ut.key,value:ut.value,valueSpec:Q,validateSpec:ut.validateSpec,style:ut.style,styleSpec:ut.styleSpec})}}});return M==="identity"&&ce&&Fe.push(new Je(S.key,S.value,'missing required property "property"')),M==="identity"||S.value.stops||Fe.push(new Je(S.key,S.value,'missing required property "stops"')),M==="exponential"&&S.valueSpec.expression&&!Nf(S.valueSpec)&&Fe.push(new Je(S.key,S.value,"exponential functions not supported")),S.styleSpec.$version>=8&&(Qe&&!a4(S.valueSpec)?Fe.push(new Je(S.key,S.value,"property functions not supported")):ce&&!Pf(S.valueSpec)&&Fe.push(new Je(S.key,S.value,"zoom functions not supported"))),M!=="categorical"&&!Me||S.value.property!==void 0||Fe.push(new Je(S.key,S.value,'"property" property is required')),Fe;function Ze(ut){let dt=[];const xt=ut.value,Ot=ut.key;if(fi(xt)!=="array")return[new Je(Ot,xt,`array expected, ${fi(xt)} found`)];if(xt.length!==2)return[new Je(Ot,xt,`array length 2 expected, length ${xt.length} found`)];if(Me){if(fi(xt[0])!=="object")return[new Je(Ot,xt,`object expected, ${fi(xt[0])} found`)];if(xt[0].zoom===void 0)return[new Je(Ot,xt,"object stop key must have zoom")];if(xt[0].value===void 0)return[new Je(Ot,xt,"object stop key must have value")];if(Y&&Y>jo(xt[0].zoom))return[new Je(Ot,xt[0].zoom,"stop zoom values must appear in ascending order")];jo(xt[0].zoom)!==Y&&(Y=jo(xt[0].zoom),F=void 0,$={}),dt=dt.concat(Vl({key:`${Ot}[0]`,value:xt[0],valueSpec:{zoom:{}},validateSpec:ut.validateSpec,style:ut.style,styleSpec:ut.styleSpec,objectElementValidators:{zoom:C6,value:tt}}))}else dt=dt.concat(tt({key:`${Ot}[0]`,value:xt[0],valueSpec:{},validateSpec:ut.validateSpec,style:ut.style,styleSpec:ut.styleSpec},xt));return x6(jc(xt[1]))?dt.concat([new Je(`${Ot}[1]`,xt[1],"expressions are not allowed in function stops.")]):dt.concat(ut.validateSpec({key:`${Ot}[1]`,value:xt[1],valueSpec:Q,validateSpec:ut.validateSpec,style:ut.style,styleSpec:ut.styleSpec}))}function tt(ut,dt){const xt=fi(ut.value),Ot=jo(ut.value),Bt=ut.value!==null?ut.value:dt;if(V){if(xt!==V)return[new Je(ut.key,Bt,`${xt} stop domain type must match previous stop domain type ${V}`)]}else V=xt;if(xt!=="number"&&xt!=="string"&&xt!=="boolean")return[new Je(ut.key,Bt,"stop domain value must be a number, string, or boolean")];if(xt!=="number"&&M!=="categorical"){let rr=`number expected, ${xt} found`;return a4(Q)&&M===void 0&&(rr+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Je(ut.key,Bt,rr)]}return M!=="categorical"||xt!=="number"||isFinite(Ot)&&Math.floor(Ot)===Ot?M!=="categorical"&&xt==="number"&&F!==void 0&&Ot<F?[new Je(ut.key,Bt,"stop domain values must appear in ascending order")]:(F=Ot,M==="categorical"&&Ot in $?[new Je(ut.key,Bt,"stop domain values must be unique")]:($[Ot]=!0,[])):[new Je(ut.key,Bt,`integer expected, found ${Ot}`)]}}function lu(S){const Q=(S.expressionContext==="property"?y9:_6)(jc(S.value),S.valueSpec);if(Q.result==="error")return Q.value.map(V=>new Je(`${S.key}${V.key}`,S.value,V.message));const M=Q.value.expression||Q.value._styleExpression.expression;if(S.expressionContext==="property"&&S.propertyKey==="text-font"&&!M.outputDefined())return[new Je(S.key,S.value,`Invalid data expression for "${S.propertyKey}". Output values must be contained as literals within the expression.`)];if(S.expressionContext==="property"&&S.propertyType==="layout"&&!h1(M))return[new Je(S.key,S.value,'"feature-state" data expressions are not supported with layout properties.')];if(S.expressionContext==="filter"&&!h1(M))return[new Je(S.key,S.value,'"feature-state" data expressions are not supported with filters.')];if(S.expressionContext&&S.expressionContext.indexOf("cluster")===0){if(!l2(M,["zoom","feature-state"]))return[new Je(S.key,S.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(S.expressionContext==="cluster-initial"&&!G2(M))return[new Je(S.key,S.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function E6(S){const Q=S.key,M=S.value,V=S.valueSpec,F=[];return Array.isArray(V.values)?V.values.indexOf(jo(M))===-1&&F.push(new Je(Q,M,`expected one of [${V.values.join(", ")}], ${JSON.stringify(M)} found`)):Object.keys(V.values).indexOf(jo(M))===-1&&F.push(new Je(Q,M,`expected one of [${Object.keys(V.values).join(", ")}], ${JSON.stringify(M)} found`)),F}function c4(S){return S6(jc(S.value))?lu(ft({},S,{expressionContext:"filter",valueSpec:{value:"boolean"}})):sb(S)}function sb(S){const Q=S.value,M=S.key;if(fi(Q)!=="array")return[new Je(M,Q,`array expected, ${fi(Q)} found`)];const V=S.styleSpec;let F,Y=[];if(Q.length<1)return[new Je(M,Q,"filter array must have at least 1 element")];switch(Y=Y.concat(E6({key:`${M}[0]`,value:Q[0],valueSpec:V.filter_operator,style:S.style,styleSpec:S.styleSpec})),jo(Q[0])){case"<":case"<=":case">":case">=":Q.length>=2&&jo(Q[1])==="$type"&&Y.push(new Je(M,Q,`"$type" cannot be use with operator "${Q[0]}"`));case"==":case"!=":Q.length!==3&&Y.push(new Je(M,Q,`filter array for operator "${Q[0]}" must have 3 elements`));case"in":case"!in":Q.length>=2&&(F=fi(Q[1]),F!=="string"&&Y.push(new Je(`${M}[1]`,Q[1],`string expected, ${F} found`)));for(let $=2;$<Q.length;$++)F=fi(Q[$]),jo(Q[1])==="$type"?Y=Y.concat(E6({key:`${M}[${$}]`,value:Q[$],valueSpec:V.geometry_type,style:S.style,styleSpec:S.styleSpec})):F!=="string"&&F!=="number"&&F!=="boolean"&&Y.push(new Je(`${M}[${$}]`,Q[$],`string, number, or boolean expected, ${F} found`));break;case"any":case"all":case"none":for(let $=1;$<Q.length;$++)Y=Y.concat(sb({key:`${M}[${$}]`,value:Q[$],style:S.style,styleSpec:S.styleSpec}));break;case"has":case"!has":F=fi(Q[1]),Q.length!==2?Y.push(new Je(M,Q,`filter array for "${Q[0]}" operator must have 2 elements`)):F!=="string"&&Y.push(new Je(`${M}[1]`,Q[1],`string expected, ${F} found`));break;case"within":F=fi(Q[1]),Q.length!==2?Y.push(new Je(M,Q,`filter array for "${Q[0]}" operator must have 2 elements`)):F!=="object"&&Y.push(new Je(`${M}[1]`,Q[1],`object expected, ${F} found`))}return Y}function b9(S,Q){const M=S.key,V=S.validateSpec,F=S.style,Y=S.styleSpec,$=S.value,ce=S.objectKey,Qe=Y[`${Q}_${S.layerType}`];if(!Qe)return[];const Me=ce.match(/^(.*)-transition$/);if(Q==="paint"&&Me&&Qe[Me[1]]&&Qe[Me[1]].transition)return V({key:M,value:$,valueSpec:Y.transition,style:F,styleSpec:Y});const Fe=S.valueSpec||Qe[ce];if(!Fe)return[new Je(M,$,`unknown property "${ce}"`)];let Ze;if(fi($)==="string"&&a4(Fe)&&!Fe.tokens&&(Ze=/^{([^}]+)}$/.exec($)))return[new Je(M,$,`"${ce}" does not support interpolation syntax
443
443
  Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(Ze[1])} }\`.`)];const tt=[];return S.layerType==="symbol"&&(ce==="text-field"&&F&&!F.glyphs&&tt.push(new Je(M,$,'use of "text-field" requires a style "glyphs" property')),ce==="text-font"&&Co(jc($))&&jo($.type)==="identity"&&tt.push(new Je(M,$,'"text-font" does not support identity functions'))),tt.concat(V({key:S.key,value:$,valueSpec:Fe,style:F,styleSpec:Y,expressionContext:"property",propertyType:Q,propertyKey:ce}))}function lb(S){return b9(S,"paint")}function cb(S){return b9(S,"layout")}function ub(S){let Q=[];const M=S.value,V=S.key,F=S.style,Y=S.styleSpec;M.type||M.ref||Q.push(new Je(V,M,'either "type" or "ref" is required'));let $=jo(M.type);const ce=jo(M.ref);if(M.id){const Qe=jo(M.id);for(let Me=0;Me<S.arrayIndex;Me++){const Fe=F.layers[Me];jo(Fe.id)===Qe&&Q.push(new Je(V,M.id,`duplicate layer id "${M.id}", previously used at line ${Fe.id.__line__}`))}}if("ref"in M){let Qe;["type","source","source-layer","filter","layout"].forEach(Me=>{Me in M&&Q.push(new Je(V,M[Me],`"${Me}" is prohibited for ref layers`))}),F.layers.forEach(Me=>{jo(Me.id)===ce&&(Qe=Me)}),Qe?Qe.ref?Q.push(new Je(V,M.ref,"ref cannot reference another ref layer")):$=jo(Qe.type):Q.push(new Je(V,M.ref,`ref layer "${ce}" not found`))}else if($!=="background")if(M.source){const Qe=F.sources&&F.sources[M.source],Me=Qe&&jo(Qe.type);Qe?Me==="vector"&&$==="raster"?Q.push(new Je(V,M.source,`layer "${M.id}" requires a raster source`)):Me!=="raster-dem"&&$==="hillshade"?Q.push(new Je(V,M.source,`layer "${M.id}" requires a raster-dem source`)):Me==="raster"&&$!=="raster"?Q.push(new Je(V,M.source,`layer "${M.id}" requires a vector source`)):Me!=="vector"||M["source-layer"]?Me==="raster-dem"&&$!=="hillshade"?Q.push(new Je(V,M.source,"raster-dem source can only be used with layer type 'hillshade'.")):$!=="line"||!M.paint||!M.paint["line-gradient"]||Me==="geojson"&&Qe.lineMetrics||Q.push(new Je(V,M,`layer "${M.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):Q.push(new Je(V,M,`layer "${M.id}" must specify a "source-layer"`)):Q.push(new Je(V,M.source,`source "${M.source}" not found`))}else Q.push(new Je(V,M,'missing required property "source"'));return Q=Q.concat(Vl({key:V,value:M,valueSpec:Y.layer,style:S.style,styleSpec:S.styleSpec,validateSpec:S.validateSpec,objectElementValidators:{"*":()=>[],type:()=>S.validateSpec({key:`${V}.type`,value:M.type,valueSpec:Y.layer.type,style:S.style,styleSpec:S.styleSpec,validateSpec:S.validateSpec,object:M,objectKey:"type"}),filter:c4,layout:Qe=>Vl({layer:M,key:Qe.key,value:Qe.value,style:Qe.style,styleSpec:Qe.styleSpec,validateSpec:Qe.validateSpec,objectElementValidators:{"*":Me=>cb(ft({layerType:$},Me))}}),paint:Qe=>Vl({layer:M,key:Qe.key,value:Qe.value,style:Qe.style,styleSpec:Qe.styleSpec,validateSpec:Qe.validateSpec,objectElementValidators:{"*":Me=>lb(ft({layerType:$},Me))}})}})),Q}function c2(S){const Q=S.value,M=S.key,V=fi(Q);return V!=="string"?[new Je(M,Q,`string expected, ${V} found`)]:[]}const A6={promoteId:function({key:S,value:Q}){if(fi(Q)==="string")return c2({key:S,value:Q});{const M=[];for(const V in Q)M.push(...c2({key:`${S}.${V}`,value:Q[V]}));return M}}};function Il(S){const Q=S.value,M=S.key,V=S.styleSpec,F=S.style,Y=S.validateSpec;if(!Q.type)return[new Je(M,Q,'"type" is required')];const $=jo(Q.type);let ce;switch($){case"vector":case"raster":return ce=Vl({key:M,value:Q,valueSpec:V[`source_${$.replace("-","_")}`],style:S.style,styleSpec:V,objectElementValidators:A6,validateSpec:Y}),ce;case"raster-dem":return ce=function(Qe){var Me;const Fe=(Me=Qe.sourceName)!==null&&Me!==void 0?Me:"",Ze=Qe.value,tt=Qe.styleSpec,ut=tt.source_raster_dem,dt=Qe.style;let xt=[];const Ot=fi(Ze);if(Ze===void 0)return xt;if(Ot!=="object")return xt.push(new Je("source_raster_dem",Ze,`object expected, ${Ot} found`)),xt;const Bt=jo(Ze.encoding)==="custom",rr=["redFactor","greenFactor","blueFactor","baseShift"],Wt=Qe.value.encoding?`"${Qe.value.encoding}"`:"Default";for(const ir in Ze)!Bt&&rr.includes(ir)?xt.push(new Je(ir,Ze[ir],`In "${Fe}": "${ir}" is only valid when "encoding" is set to "custom". ${Wt} encoding found`)):ut[ir]?xt=xt.concat(Qe.validateSpec({key:ir,value:Ze[ir],valueSpec:ut[ir],validateSpec:Qe.validateSpec,style:dt,styleSpec:tt})):xt.push(new Je(ir,Ze[ir],`unknown property "${ir}"`));return xt}({sourceName:M,value:Q,style:S.style,styleSpec:V,validateSpec:Y}),ce;case"geojson":if(ce=Vl({key:M,value:Q,valueSpec:V.source_geojson,style:F,styleSpec:V,validateSpec:Y,objectElementValidators:A6}),Q.cluster)for(const Qe in Q.clusterProperties){const[Me,Fe]=Q.clusterProperties[Qe],Ze=typeof Me=="string"?[Me,["accumulated"],["get",Qe]]:Me;ce.push(...lu({key:`${M}.${Qe}.map`,value:Fe,validateSpec:Y,expressionContext:"cluster-map"})),ce.push(...lu({key:`${M}.${Qe}.reduce`,value:Ze,validateSpec:Y,expressionContext:"cluster-reduce"}))}return ce;case"video":return Vl({key:M,value:Q,valueSpec:V.source_video,style:F,validateSpec:Y,styleSpec:V});case"image":return Vl({key:M,value:Q,valueSpec:V.source_image,style:F,validateSpec:Y,styleSpec:V});case"canvas":return[new Je(M,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return E6({key:`${M}.type`,value:Q.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:F,validateSpec:Y,styleSpec:V})}}function O6(S){const Q=S.value,M=S.styleSpec,V=M.light,F=S.style;let Y=[];const $=fi(Q);if(Q===void 0)return Y;if($!=="object")return Y=Y.concat([new Je("light",Q,`object expected, ${$} found`)]),Y;for(const ce in Q){const Qe=ce.match(/^(.*)-transition$/);Y=Y.concat(Qe&&V[Qe[1]]&&V[Qe[1]].transition?S.validateSpec({key:ce,value:Q[ce],valueSpec:M.transition,validateSpec:S.validateSpec,style:F,styleSpec:M}):V[ce]?S.validateSpec({key:ce,value:Q[ce],valueSpec:V[ce],validateSpec:S.validateSpec,style:F,styleSpec:M}):[new Je(ce,Q[ce],`unknown property "${ce}"`)])}return Y}function db(S){const Q=S.value,M=S.styleSpec,V=M.terrain,F=S.style;let Y=[];const $=fi(Q);if(Q===void 0)return Y;if($!=="object")return Y=Y.concat([new Je("terrain",Q,`object expected, ${$} found`)]),Y;for(const ce in Q)Y=Y.concat(V[ce]?S.validateSpec({key:ce,value:Q[ce],valueSpec:V[ce],validateSpec:S.validateSpec,style:F,styleSpec:M}):[new Je(ce,Q[ce],`unknown property "${ce}"`)]);return Y}function pb(S){let Q=[];const M=S.value,V=S.key;if(Array.isArray(M)){const F=[],Y=[];for(const $ in M)M[$].id&&F.includes(M[$].id)&&Q.push(new Je(V,M,`all the sprites' ids must be unique, but ${M[$].id} is duplicated`)),F.push(M[$].id),M[$].url&&Y.includes(M[$].url)&&Q.push(new Je(V,M,`all the sprites' URLs must be unique, but ${M[$].url} is duplicated`)),Y.push(M[$].url),Q=Q.concat(Vl({key:`${V}[${$}]`,value:M[$],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:S.validateSpec}));return Q}return c2({key:V,value:M})}const u4={"*":()=>[],array:l4,boolean:function(S){const Q=S.value,M=S.key,V=fi(Q);return V!=="boolean"?[new Je(M,Q,`boolean expected, ${V} found`)]:[]},number:C6,color:function(S){const Q=S.key,M=S.value,V=fi(M);return V!=="string"?[new Je(Q,M,`color expected, ${V} found`)]:dn.parse(String(M))?[]:[new Je(Q,M,`color expected, "${M}" found`)]},constants:ab,enum:E6,filter:c4,function:Ff,layer:ub,object:Vl,source:Il,light:O6,terrain:db,string:c2,formatted:function(S){return c2(S).length===0?[]:lu(S)},resolvedImage:function(S){return c2(S).length===0?[]:lu(S)},padding:function(S){const Q=S.key,M=S.value;if(fi(M)==="array"){if(M.length<1||M.length>4)return[new Je(Q,M,`padding requires 1 to 4 values; ${M.length} values found`)];const V={type:"number"};let F=[];for(let Y=0;Y<M.length;Y++)F=F.concat(S.validateSpec({key:`${Q}[${Y}]`,value:M[Y],validateSpec:S.validateSpec,valueSpec:V}));return F}return C6({key:Q,value:M,valueSpec:{}})},variableAnchorOffsetCollection:function(S){const Q=S.key,M=S.value,V=fi(M),F=S.styleSpec;if(V!=="array"||M.length<1||M.length%2!=0)return[new Je(Q,M,"variableAnchorOffsetCollection requires a non-empty array of even length")];let Y=[];for(let $=0;$<M.length;$+=2)Y=Y.concat(E6({key:`${Q}[${$}]`,value:M[$],valueSpec:F.layout_symbol["text-anchor"]})),Y=Y.concat(l4({key:`${Q}[${$+1}]`,value:M[$+1],valueSpec:{length:2,value:"number"},validateSpec:S.validateSpec,style:S.style,styleSpec:F}));return Y},sprite:pb};function yc(S){const Q=S.value,M=S.valueSpec,V=S.styleSpec;return S.validateSpec=yc,M.expression&&Co(jo(Q))?Ff(S):M.expression&&x6(jc(Q))?lu(S):M.type&&u4[M.type]?u4[M.type](S):Vl(ft({},S,{valueSpec:M.type?V[M.type]:M}))}function f1(S){const Q=S.value,M=S.key,V=c2(S);return V.length||(Q.indexOf("{fontstack}")===-1&&V.push(new Je(M,Q,'"glyphs" url must include a "{fontstack}" token')),Q.indexOf("{range}")===-1&&V.push(new Je(M,Q,'"glyphs" url must include a "{range}" token'))),V}function Uc(S,Q=Re){let M=[];return M=M.concat(yc({key:"",value:S,valueSpec:Q.$root,styleSpec:Q,style:S,validateSpec:yc,objectElementValidators:{glyphs:f1,"*":()=>[]}})),S.constants&&(M=M.concat(ab({key:"constants",value:S.constants,style:S,styleSpec:Q,validateSpec:yc}))),Df(M)}function q2(S){return function(Q){return S({...Q,validateSpec:yc})}}function Df(S){return[].concat(S).sort((Q,M)=>Q.line-M.line)}function W2(S){return function(...Q){return Df(S.apply(this,Q))}}Uc.source=W2(q2(Il)),Uc.sprite=W2(q2(pb)),Uc.glyphs=W2(q2(f1)),Uc.light=W2(q2(O6)),Uc.terrain=W2(q2(db)),Uc.layer=W2(q2(ub)),Uc.filter=W2(q2(c4)),Uc.paintProperty=W2(q2(lb)),Uc.layoutProperty=W2(q2(cb));const u2=Uc,EM=u2.light,x9=u2.paintProperty,hb=u2.layoutProperty;function zf(S,Q){let M=!1;if(Q&&Q.length)for(const V of Q)S.fire(new Ne(new Error(V.message))),M=!0;return M}class d4{constructor(Q,M,V){const F=this.cells=[];if(Q instanceof ArrayBuffer){this.arrayBuffer=Q;const $=new Int32Array(this.arrayBuffer);Q=$[0],this.d=(M=$[1])+2*(V=$[2]);for(let Qe=0;Qe<this.d*this.d;Qe++){const Me=$[3+Qe],Fe=$[3+Qe+1];F.push(Me===Fe?null:$.subarray(Me,Fe))}const ce=$[3+F.length+1];this.keys=$.subarray($[3+F.length],ce),this.bboxes=$.subarray(ce),this.insert=this._insertReadonly}else{this.d=M+2*V;for(let $=0;$<this.d*this.d;$++)F.push([]);this.keys=[],this.bboxes=[]}this.n=M,this.extent=Q,this.padding=V,this.scale=M/Q,this.uid=0;const Y=V/M*Q;this.min=-Y,this.max=Q+Y}insert(Q,M,V,F,Y){this._forEachCell(M,V,F,Y,this._insertCell,this.uid++,void 0,void 0),this.keys.push(Q),this.bboxes.push(M),this.bboxes.push(V),this.bboxes.push(F),this.bboxes.push(Y)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(Q,M,V,F,Y,$){this.cells[Y].push($)}query(Q,M,V,F,Y){const $=this.min,ce=this.max;if(Q<=$&&M<=$&&ce<=V&&ce<=F&&!Y)return Array.prototype.slice.call(this.keys);{const Qe=[];return this._forEachCell(Q,M,V,F,this._queryCell,Qe,{},Y),Qe}}_queryCell(Q,M,V,F,Y,$,ce,Qe){const Me=this.cells[Y];if(Me!==null){const Fe=this.keys,Ze=this.bboxes;for(let tt=0;tt<Me.length;tt++){const ut=Me[tt];if(ce[ut]===void 0){const dt=4*ut;(Qe?Qe(Ze[dt+0],Ze[dt+1],Ze[dt+2],Ze[dt+3]):Q<=Ze[dt+2]&&M<=Ze[dt+3]&&V>=Ze[dt+0]&&F>=Ze[dt+1])?(ce[ut]=!0,$.push(Fe[ut])):ce[ut]=!1}}}}_forEachCell(Q,M,V,F,Y,$,ce,Qe){const Me=this._convertToCellCoord(Q),Fe=this._convertToCellCoord(M),Ze=this._convertToCellCoord(V),tt=this._convertToCellCoord(F);for(let ut=Me;ut<=Ze;ut++)for(let dt=Fe;dt<=tt;dt++){const xt=this.d*dt+ut;if((!Qe||Qe(this._convertFromCellCoord(ut),this._convertFromCellCoord(dt),this._convertFromCellCoord(ut+1),this._convertFromCellCoord(dt+1)))&&Y.call(this,Q,M,V,F,xt,$,ce,Qe))return}}_convertFromCellCoord(Q){return(Q-this.padding)/this.scale}_convertToCellCoord(Q){return Math.max(0,Math.min(this.d-1,Math.floor(Q*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const Q=this.cells,M=3+this.cells.length+1+1;let V=0;for(let $=0;$<this.cells.length;$++)V+=this.cells[$].length;const F=new Int32Array(M+V+this.keys.length+this.bboxes.length);F[0]=this.extent,F[1]=this.n,F[2]=this.padding;let Y=M;for(let $=0;$<Q.length;$++){const ce=Q[$];F[3+$]=Y,F.set(ce,Y),Y+=ce.length}return F[3+Q.length]=Y,F.set(this.keys,Y),Y+=this.keys.length,F[3+Q.length+1]=Y,F.set(this.bboxes,Y),Y+=this.bboxes.length,F.buffer}static serialize(Q,M){const V=Q.toArrayBuffer();return M&&M.push(V),{buffer:V}}static deserialize(Q){return new d4(Q.buffer)}}const m1={};function sn(S,Q,M={}){if(m1[S])throw new Error(`${S} is already registered.`);Object.defineProperty(Q,"_classRegistryKey",{value:S,writeable:!1}),m1[S]={klass:Q,omit:M.omit||[],shallow:M.shallow||[]}}sn("Object",Object),sn("TransferableGridIndex",d4),sn("Color",dn),sn("Error",Error),sn("AJAXError",re),sn("ResolvedImage",ii),sn("StylePropertyFunction",w6),sn("StyleExpression",m9,{omit:["_evaluator"]}),sn("ZoomDependentExpression",Bf),sn("ZoomConstantExpression",g9),sn("CompoundExpression",Mo,{omit:["_evaluate"]});for(const S in o4)o4[S]._classRegistryKey||sn(`Expression_${S}`,o4[S]);function jf(S){return S&&typeof ArrayBuffer<"u"&&(S instanceof ArrayBuffer||S.constructor&&S.constructor.name==="ArrayBuffer")}function cu(S,Q){if(S==null||typeof S=="boolean"||typeof S=="number"||typeof S=="string"||S instanceof Boolean||S instanceof Number||S instanceof String||S instanceof Date||S instanceof RegExp||S instanceof Blob)return S;if(jf(S)||K(S))return Q&&Q.push(S),S;if(ArrayBuffer.isView(S)){const M=S;return Q&&Q.push(M.buffer),M}if(S instanceof ImageData)return Q&&Q.push(S.data.buffer),S;if(Array.isArray(S)){const M=[];for(const V of S)M.push(cu(V,Q));return M}if(typeof S=="object"){const M=S.constructor,V=M._classRegistryKey;if(!V)throw new Error("can't serialize object of unregistered class");if(!m1[V])throw new Error(`${V} is not registered.`);const F=M.serialize?M.serialize(S,Q):{};if(M.serialize){if(Q&&F===Q[Q.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const Y in S){if(!S.hasOwnProperty(Y)||m1[V].omit.indexOf(Y)>=0)continue;const $=S[Y];F[Y]=m1[V].shallow.indexOf(Y)>=0?$:cu($,Q)}S instanceof Error&&(F.message=S.message)}if(F.$name)throw new Error("$name property is reserved for worker serialization logic.");return V!=="Object"&&(F.$name=V),F}throw new Error("can't serialize object of type "+typeof S)}function p4(S){if(S==null||typeof S=="boolean"||typeof S=="number"||typeof S=="string"||S instanceof Boolean||S instanceof Number||S instanceof String||S instanceof Date||S instanceof RegExp||S instanceof Blob||jf(S)||K(S)||ArrayBuffer.isView(S)||S instanceof ImageData)return S;if(Array.isArray(S))return S.map(p4);if(typeof S=="object"){const Q=S.$name||"Object";if(!m1[Q])throw new Error(`can't deserialize unregistered class ${Q}`);const{klass:M}=m1[Q];if(!M)throw new Error(`can't deserialize unregistered class ${Q}`);if(M.deserialize)return M.deserialize(S);const V=Object.create(M.prototype);for(const F of Object.keys(S)){if(F==="$name")continue;const Y=S[F];V[F]=m1[Q].shallow.indexOf(F)>=0?Y:p4(Y)}return V}throw new Error("can't deserialize object of type "+typeof S)}class fb{constructor(){this.first=!0}update(Q,M){const V=Math.floor(Q);return this.first?(this.first=!1,this.lastIntegerZoom=V,this.lastIntegerZoomTime=0,this.lastZoom=Q,this.lastFloorZoom=V,!0):(this.lastFloorZoom>V?(this.lastIntegerZoom=V+1,this.lastIntegerZoomTime=M):this.lastFloorZoom<V&&(this.lastIntegerZoom=V,this.lastIntegerZoomTime=M),Q!==this.lastZoom&&(this.lastZoom=Q,this.lastFloorZoom=V,!0))}}const Jr={"Latin-1 Supplement":S=>S>=128&&S<=255,Arabic:S=>S>=1536&&S<=1791,"Arabic Supplement":S=>S>=1872&&S<=1919,"Arabic Extended-A":S=>S>=2208&&S<=2303,"Hangul Jamo":S=>S>=4352&&S<=4607,"Unified Canadian Aboriginal Syllabics":S=>S>=5120&&S<=5759,Khmer:S=>S>=6016&&S<=6143,"Unified Canadian Aboriginal Syllabics Extended":S=>S>=6320&&S<=6399,"General Punctuation":S=>S>=8192&&S<=8303,"Letterlike Symbols":S=>S>=8448&&S<=8527,"Number Forms":S=>S>=8528&&S<=8591,"Miscellaneous Technical":S=>S>=8960&&S<=9215,"Control Pictures":S=>S>=9216&&S<=9279,"Optical Character Recognition":S=>S>=9280&&S<=9311,"Enclosed Alphanumerics":S=>S>=9312&&S<=9471,"Geometric Shapes":S=>S>=9632&&S<=9727,"Miscellaneous Symbols":S=>S>=9728&&S<=9983,"Miscellaneous Symbols and Arrows":S=>S>=11008&&S<=11263,"CJK Radicals Supplement":S=>S>=11904&&S<=12031,"Kangxi Radicals":S=>S>=12032&&S<=12255,"Ideographic Description Characters":S=>S>=12272&&S<=12287,"CJK Symbols and Punctuation":S=>S>=12288&&S<=12351,Hiragana:S=>S>=12352&&S<=12447,Katakana:S=>S>=12448&&S<=12543,Bopomofo:S=>S>=12544&&S<=12591,"Hangul Compatibility Jamo":S=>S>=12592&&S<=12687,Kanbun:S=>S>=12688&&S<=12703,"Bopomofo Extended":S=>S>=12704&&S<=12735,"CJK Strokes":S=>S>=12736&&S<=12783,"Katakana Phonetic Extensions":S=>S>=12784&&S<=12799,"Enclosed CJK Letters and Months":S=>S>=12800&&S<=13055,"CJK Compatibility":S=>S>=13056&&S<=13311,"CJK Unified Ideographs Extension A":S=>S>=13312&&S<=19903,"Yijing Hexagram Symbols":S=>S>=19904&&S<=19967,"CJK Unified Ideographs":S=>S>=19968&&S<=40959,"Yi Syllables":S=>S>=40960&&S<=42127,"Yi Radicals":S=>S>=42128&&S<=42191,"Hangul Jamo Extended-A":S=>S>=43360&&S<=43391,"Hangul Syllables":S=>S>=44032&&S<=55215,"Hangul Jamo Extended-B":S=>S>=55216&&S<=55295,"Private Use Area":S=>S>=57344&&S<=63743,"CJK Compatibility Ideographs":S=>S>=63744&&S<=64255,"Arabic Presentation Forms-A":S=>S>=64336&&S<=65023,"Vertical Forms":S=>S>=65040&&S<=65055,"CJK Compatibility Forms":S=>S>=65072&&S<=65103,"Small Form Variants":S=>S>=65104&&S<=65135,"Arabic Presentation Forms-B":S=>S>=65136&&S<=65279,"Halfwidth and Fullwidth Forms":S=>S>=65280&&S<=65519};function _9(S){for(const Q of S)if(Uf(Q.charCodeAt(0)))return!0;return!1}function w9(S){for(const Q of S)if(!L9(Q.charCodeAt(0)))return!1;return!0}function L9(S){return!(Jr.Arabic(S)||Jr["Arabic Supplement"](S)||Jr["Arabic Extended-A"](S)||Jr["Arabic Presentation Forms-A"](S)||Jr["Arabic Presentation Forms-B"](S))}function Uf(S){return!(S!==746&&S!==747&&(S<4352||!(Jr["Bopomofo Extended"](S)||Jr.Bopomofo(S)||Jr["CJK Compatibility Forms"](S)&&!(S>=65097&&S<=65103)||Jr["CJK Compatibility Ideographs"](S)||Jr["CJK Compatibility"](S)||Jr["CJK Radicals Supplement"](S)||Jr["CJK Strokes"](S)||!(!Jr["CJK Symbols and Punctuation"](S)||S>=12296&&S<=12305||S>=12308&&S<=12319||S===12336)||Jr["CJK Unified Ideographs Extension A"](S)||Jr["CJK Unified Ideographs"](S)||Jr["Enclosed CJK Letters and Months"](S)||Jr["Hangul Compatibility Jamo"](S)||Jr["Hangul Jamo Extended-A"](S)||Jr["Hangul Jamo Extended-B"](S)||Jr["Hangul Jamo"](S)||Jr["Hangul Syllables"](S)||Jr.Hiragana(S)||Jr["Ideographic Description Characters"](S)||Jr.Kanbun(S)||Jr["Kangxi Radicals"](S)||Jr["Katakana Phonetic Extensions"](S)||Jr.Katakana(S)&&S!==12540||!(!Jr["Halfwidth and Fullwidth Forms"](S)||S===65288||S===65289||S===65293||S>=65306&&S<=65310||S===65339||S===65341||S===65343||S>=65371&&S<=65503||S===65507||S>=65512&&S<=65519)||!(!Jr["Small Form Variants"](S)||S>=65112&&S<=65118||S>=65123&&S<=65126)||Jr["Unified Canadian Aboriginal Syllabics"](S)||Jr["Unified Canadian Aboriginal Syllabics Extended"](S)||Jr["Vertical Forms"](S)||Jr["Yijing Hexagram Symbols"](S)||Jr["Yi Syllables"](S)||Jr["Yi Radicals"](S))))}function S9(S){return!(Uf(S)||function(Q){return!!(Jr["Latin-1 Supplement"](Q)&&(Q===167||Q===169||Q===174||Q===177||Q===188||Q===189||Q===190||Q===215||Q===247)||Jr["General Punctuation"](Q)&&(Q===8214||Q===8224||Q===8225||Q===8240||Q===8241||Q===8251||Q===8252||Q===8258||Q===8263||Q===8264||Q===8265||Q===8273)||Jr["Letterlike Symbols"](Q)||Jr["Number Forms"](Q)||Jr["Miscellaneous Technical"](Q)&&(Q>=8960&&Q<=8967||Q>=8972&&Q<=8991||Q>=8996&&Q<=9e3||Q===9003||Q>=9085&&Q<=9114||Q>=9150&&Q<=9165||Q===9167||Q>=9169&&Q<=9179||Q>=9186&&Q<=9215)||Jr["Control Pictures"](Q)&&Q!==9251||Jr["Optical Character Recognition"](Q)||Jr["Enclosed Alphanumerics"](Q)||Jr["Geometric Shapes"](Q)||Jr["Miscellaneous Symbols"](Q)&&!(Q>=9754&&Q<=9759)||Jr["Miscellaneous Symbols and Arrows"](Q)&&(Q>=11026&&Q<=11055||Q>=11088&&Q<=11097||Q>=11192&&Q<=11243)||Jr["CJK Symbols and Punctuation"](Q)||Jr.Katakana(Q)||Jr["Private Use Area"](Q)||Jr["CJK Compatibility Forms"](Q)||Jr["Small Form Variants"](Q)||Jr["Halfwidth and Fullwidth Forms"](Q)||Q===8734||Q===8756||Q===8757||Q>=9984&&Q<=10087||Q>=10102&&Q<=10131||Q===65532||Q===65533)}(S))}function k9(S){return S>=1424&&S<=2303||Jr["Arabic Presentation Forms-A"](S)||Jr["Arabic Presentation Forms-B"](S)}function mb(S,Q){return!(!Q&&k9(S)||S>=2304&&S<=3583||S>=3840&&S<=4255||Jr.Khmer(S))}function AM(S){for(const Q of S)if(k9(Q.charCodeAt(0)))return!0;return!1}const Gf="deferred",qf="loading",Wf="loaded";let H6=null,Ws="unavailable",uu=null;const V6=function(S){S&&typeof S=="string"&&S.indexOf("NetworkError")>-1&&(Ws="error"),H6&&H6(S)};function M9(){I6.fire(new Ve("pluginStateChange",{pluginStatus:Ws,pluginURL:uu}))}const I6=new it,C9=function(){return Ws},E9=function(){if(Ws!==Gf||!uu)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ws=qf,M9(),uu&&Ie({url:uu},S=>{S?V6(S):(Ws=Wf,M9())})},Pl={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Ws===Wf||Pl.applyArabicShaping!=null,isLoading:()=>Ws===qf,setState(S){if(!P())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Ws=S.pluginStatus,uu=S.pluginURL},isParsed(){if(!P())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Pl.applyArabicShaping!=null&&Pl.processBidirectionalText!=null&&Pl.processStyledBidirectionalText!=null},getPluginURL(){if(!P())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return uu}};class po{constructor(Q,M){this.zoom=Q,M?(this.now=M.now,this.fadeDuration=M.fadeDuration,this.zoomHistory=M.zoomHistory,this.transition=M.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new fb,this.transition={})}isSupportedScript(Q){return function(M,V){for(const F of M)if(!mb(F.charCodeAt(0),V))return!1;return!0}(Q,Pl.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const Q=this.zoom,M=Q-Math.floor(Q),V=this.crossFadingFactor();return Q>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:M+(1-M)*V}:{fromScale:.5,toScale:1,t:1-(1-V)*M}}}class P6{constructor(Q,M){this.property=Q,this.value=M,this.expression=function(V,F){if(Co(V))return new w6(V,F);if(x6(V)){const Y=y9(V,F);if(Y.result==="error")throw new Error(Y.value.map($=>`${$.key}: ${$.message}`).join(", "));return Y.value}{let Y=V;return F.type==="color"&&typeof V=="string"?Y=dn.parse(V):F.type!=="padding"||typeof V!="number"&&!Array.isArray(V)?F.type==="variableAnchorOffsetCollection"&&Array.isArray(V)&&(Y=si.parse(V)):Y=ni.parse(V),{kind:"constant",evaluate:()=>Y}}}(M===void 0?Q.specification.default:M,Q.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(Q,M,V){return this.property.possiblyEvaluate(this,Q,M,V)}}class h4{constructor(Q){this.property=Q,this.value=new P6(Q,void 0)}transitioned(Q,M){return new gb(this.property,this.value,M,C({},Q.transition,this.transition),Q.now)}untransitioned(){return new gb(this.property,this.value,null,{},0)}}class N6{constructor(Q){this._properties=Q,this._values=Object.create(Q.defaultTransitionablePropertyValues)}getValue(Q){return I(this._values[Q].value.value)}setValue(Q,M){Object.prototype.hasOwnProperty.call(this._values,Q)||(this._values[Q]=new h4(this._values[Q].property)),this._values[Q].value=new P6(this._values[Q].property,M===null?void 0:I(M))}getTransition(Q){return I(this._values[Q].transition)}setTransition(Q,M){Object.prototype.hasOwnProperty.call(this._values,Q)||(this._values[Q]=new h4(this._values[Q].property)),this._values[Q].transition=I(M)||void 0}serialize(){const Q={};for(const M of Object.keys(this._values)){const V=this.getValue(M);V!==void 0&&(Q[M]=V);const F=this.getTransition(M);F!==void 0&&(Q[`${M}-transition`]=F)}return Q}transitioned(Q,M){const V=new Zf(this._properties);for(const F of Object.keys(this._values))V._values[F]=this._values[F].transitioned(Q,M._values[F]);return V}untransitioned(){const Q=new Zf(this._properties);for(const M of Object.keys(this._values))Q._values[M]=this._values[M].untransitioned();return Q}}class gb{constructor(Q,M,V,F,Y){this.property=Q,this.value=M,this.begin=Y+F.delay||0,this.end=this.begin+F.duration||0,Q.specification.transition&&(F.delay||F.duration)&&(this.prior=V)}possiblyEvaluate(Q,M,V){const F=Q.now||0,Y=this.value.possiblyEvaluate(Q,M,V),$=this.prior;if($){if(F>this.end)return this.prior=null,Y;if(this.value.isDataDriven())return this.prior=null,Y;if(F<this.begin)return $.possiblyEvaluate(Q,M,V);{const ce=(F-this.begin)/(this.end-this.begin);return this.property.interpolate($.possiblyEvaluate(Q,M,V),Y,function(Qe){if(Qe<=0)return 0;if(Qe>=1)return 1;const Me=Qe*Qe,Fe=Me*Qe;return 4*(Qe<.5?Fe:3*(Qe-Me)+Fe-.75)}(ce))}}return Y}}class Zf{constructor(Q){this._properties=Q,this._values=Object.create(Q.defaultTransitioningPropertyValues)}possiblyEvaluate(Q,M,V){const F=new Kf(this._properties);for(const Y of Object.keys(this._values))F._values[Y]=this._values[Y].possiblyEvaluate(Q,M,V);return F}hasTransition(){for(const Q of Object.keys(this._values))if(this._values[Q].prior)return!0;return!1}}class yb{constructor(Q){this._properties=Q,this._values=Object.create(Q.defaultPropertyValues)}hasValue(Q){return this._values[Q].value!==void 0}getValue(Q){return I(this._values[Q].value)}setValue(Q,M){this._values[Q]=new P6(this._values[Q].property,M===null?void 0:I(M))}serialize(){const Q={};for(const M of Object.keys(this._values)){const V=this.getValue(M);V!==void 0&&(Q[M]=V)}return Q}possiblyEvaluate(Q,M,V){const F=new Kf(this._properties);for(const Y of Object.keys(this._values))F._values[Y]=this._values[Y].possiblyEvaluate(Q,M,V);return F}}class pl{constructor(Q,M,V){this.property=Q,this.value=M,this.parameters=V}isConstant(){return this.value.kind==="constant"}constantOr(Q){return this.value.kind==="constant"?this.value.value:Q}evaluate(Q,M,V,F){return this.property.evaluate(this.value,this.parameters,Q,M,V,F)}}class Kf{constructor(Q){this._properties=Q,this._values=Object.create(Q.defaultPossiblyEvaluatedValues)}get(Q){return this._values[Q]}}class Tn{constructor(Q){this.specification=Q}possiblyEvaluate(Q,M){if(Q.isDataDriven())throw new Error("Value should not be data driven");return Q.expression.evaluate(M)}interpolate(Q,M,V){const F=fc[this.specification.type];return F?F(Q,M,V):Q}}class Mn{constructor(Q,M){this.specification=Q,this.overrides=M}possiblyEvaluate(Q,M,V,F){return new pl(this,Q.expression.kind==="constant"||Q.expression.kind==="camera"?{kind:"constant",value:Q.expression.evaluate(M,null,{},V,F)}:Q.expression,M)}interpolate(Q,M,V){if(Q.value.kind!=="constant"||M.value.kind!=="constant")return Q;if(Q.value.value===void 0||M.value.value===void 0)return new pl(this,{kind:"constant",value:void 0},Q.parameters);const F=fc[this.specification.type];if(F){const Y=F(Q.value.value,M.value.value,V);return new pl(this,{kind:"constant",value:Y},Q.parameters)}return Q}evaluate(Q,M,V,F,Y,$){return Q.kind==="constant"?Q.value:Q.evaluate(M,V,F,Y,$)}}class f4 extends Mn{possiblyEvaluate(Q,M,V,F){if(Q.value===void 0)return new pl(this,{kind:"constant",value:void 0},M);if(Q.expression.kind==="constant"){const Y=Q.expression.evaluate(M,null,{},V,F),$=Q.property.specification.type==="resolvedImage"&&typeof Y!="string"?Y.name:Y,ce=this._calculate($,$,$,M);return new pl(this,{kind:"constant",value:ce},M)}if(Q.expression.kind==="camera"){const Y=this._calculate(Q.expression.evaluate({zoom:M.zoom-1}),Q.expression.evaluate({zoom:M.zoom}),Q.expression.evaluate({zoom:M.zoom+1}),M);return new pl(this,{kind:"constant",value:Y},M)}return new pl(this,Q.expression,M)}evaluate(Q,M,V,F,Y,$){if(Q.kind==="source"){const ce=Q.evaluate(M,V,F,Y,$);return this._calculate(ce,ce,ce,M)}return Q.kind==="composite"?this._calculate(Q.evaluate({zoom:Math.floor(M.zoom)-1},V,F),Q.evaluate({zoom:Math.floor(M.zoom)},V,F),Q.evaluate({zoom:Math.floor(M.zoom)+1},V,F),M):Q.value}_calculate(Q,M,V,F){return F.zoom>F.zoomHistory.lastIntegerZoom?{from:Q,to:M}:{from:V,to:M}}interpolate(Q){return Q}}class B6{constructor(Q){this.specification=Q}possiblyEvaluate(Q,M,V,F){if(Q.value!==void 0){if(Q.expression.kind==="constant"){const Y=Q.expression.evaluate(M,null,{},V,F);return this._calculate(Y,Y,Y,M)}return this._calculate(Q.expression.evaluate(new po(Math.floor(M.zoom-1),M)),Q.expression.evaluate(new po(Math.floor(M.zoom),M)),Q.expression.evaluate(new po(Math.floor(M.zoom+1),M)),M)}}_calculate(Q,M,V,F){return F.zoom>F.zoomHistory.lastIntegerZoom?{from:Q,to:M}:{from:V,to:M}}interpolate(Q){return Q}}class R6{constructor(Q){this.specification=Q}possiblyEvaluate(Q,M,V,F){return!!Q.expression.evaluate(M,null,{},V,F)}interpolate(){return!1}}class oa{constructor(Q){this.properties=Q,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const M in Q){const V=Q[M];V.specification.overridable&&this.overridableProperties.push(M);const F=this.defaultPropertyValues[M]=new P6(V,void 0),Y=this.defaultTransitionablePropertyValues[M]=new h4(V);this.defaultTransitioningPropertyValues[M]=Y.untransitioned(),this.defaultPossiblyEvaluatedValues[M]=F.possiblyEvaluate({})}}}sn("DataDrivenProperty",Mn),sn("DataConstantProperty",Tn),sn("CrossFadedDataDrivenProperty",f4),sn("CrossFadedProperty",B6),sn("ColorRampProperty",R6);const A9="-transition";class Tc extends it{constructor(Q,M){if(super(),this.id=Q.id,this.type=Q.type,this._featureFilter={filter:()=>!0,needGeometry:!1},Q.type!=="custom"&&(this.metadata=Q.metadata,this.minzoom=Q.minzoom,this.maxzoom=Q.maxzoom,Q.type!=="background"&&(this.source=Q.source,this.sourceLayer=Q["source-layer"],this.filter=Q.filter),M.layout&&(this._unevaluatedLayout=new yb(M.layout)),M.paint)){this._transitionablePaint=new N6(M.paint);for(const V in Q.paint)this.setPaintProperty(V,Q.paint[V],{validate:!1});for(const V in Q.layout)this.setLayoutProperty(V,Q.layout[V],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Kf(M.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(Q){return Q==="visibility"?this.visibility:this._unevaluatedLayout.getValue(Q)}setLayoutProperty(Q,M,V={}){M!=null&&this._validate(hb,`layers.${this.id}.layout.${Q}`,Q,M,V)||(Q!=="visibility"?this._unevaluatedLayout.setValue(Q,M):this.visibility=M)}getPaintProperty(Q){return Q.endsWith(A9)?this._transitionablePaint.getTransition(Q.slice(0,-11)):this._transitionablePaint.getValue(Q)}setPaintProperty(Q,M,V={}){if(M!=null&&this._validate(x9,`layers.${this.id}.paint.${Q}`,Q,M,V))return!1;if(Q.endsWith(A9))return this._transitionablePaint.setTransition(Q.slice(0,-11),M||void 0),!1;{const F=this._transitionablePaint._values[Q],Y=F.property.specification["property-type"]==="cross-faded-data-driven",$=F.value.isDataDriven(),ce=F.value;this._transitionablePaint.setValue(Q,M),this._handleSpecialPaintPropertyUpdate(Q);const Qe=this._transitionablePaint._values[Q].value;return Qe.isDataDriven()||$||Y||this._handleOverridablePaintPropertyUpdate(Q,ce,Qe)}}_handleSpecialPaintPropertyUpdate(Q){}_handleOverridablePaintPropertyUpdate(Q,M,V){return!1}isHidden(Q){return!!(this.minzoom&&Q<this.minzoom)||!!(this.maxzoom&&Q>=this.maxzoom)||this.visibility==="none"}updateTransitions(Q){this._transitioningPaint=this._transitionablePaint.transitioned(Q,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(Q,M){Q.getCrossfadeParameters&&(this._crossfadeParameters=Q.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(Q,void 0,M)),this.paint=this._transitioningPaint.possiblyEvaluate(Q,void 0,M)}serialize(){const Q={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(Q.layout=Q.layout||{},Q.layout.visibility=this.visibility),N(Q,(M,V)=>!(M===void 0||V==="layout"&&!Object.keys(M).length||V==="paint"&&!Object.keys(M).length))}_validate(Q,M,V,F,Y={}){return(!Y||Y.validate!==!1)&&zf(this,Q.call(u2,{key:M,layerType:this.type,objectKey:V,value:F,styleSpec:Re,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const Q in this.paint._values){const M=this.paint.get(Q);if(M instanceof pl&&a4(M.property.specification)&&(M.value.kind==="source"||M.value.kind==="composite")&&M.value.isStateDependent)return!0}return!1}}const F6={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class du{constructor(Q,M){this._structArray=Q,this._pos1=M*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Uo{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(Q,M){return Q._trim(),M&&(Q.isTransferred=!0,M.push(Q.arrayBuffer)),{length:Q.length,arrayBuffer:Q.arrayBuffer}}static deserialize(Q){const M=Object.create(this.prototype);return M.arrayBuffer=Q.arrayBuffer,M.length=Q.length,M.capacity=Q.arrayBuffer.byteLength/M.bytesPerElement,M._refreshViews(),M}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(Q){this.reserve(Q),this.length=Q}reserve(Q){if(Q>this.capacity){this.capacity=Math.max(Q,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const M=this.uint8;this._refreshViews(),M&&this.uint8.set(M)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Po(S,Q=1){let M=0,V=0;return{members:S.map(F=>{const Y=F6[F.type].BYTES_PER_ELEMENT,$=M=m4(M,Math.max(Q,Y)),ce=F.components||1;return V=Math.max(V,Y),M+=Y*ce,{name:F.name,type:F.type,components:ce,offset:$}}),size:m4(M,Math.max(V,Q)),alignment:Q}}function m4(S,Q){return Math.ceil(S/Q)*Q}class D6 extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(Q,M){const V=this.length;return this.resize(V+1),this.emplace(V,Q,M)}emplace(Q,M,V){const F=2*Q;return this.int16[F+0]=M,this.int16[F+1]=V,Q}}D6.prototype.bytesPerElement=4,sn("StructArrayLayout2i4",D6);class g4 extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(Q,M,V){const F=this.length;return this.resize(F+1),this.emplace(F,Q,M,V)}emplace(Q,M,V,F){const Y=3*Q;return this.int16[Y+0]=M,this.int16[Y+1]=V,this.int16[Y+2]=F,Q}}g4.prototype.bytesPerElement=6,sn("StructArrayLayout3i6",g4);class pu extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(Q,M,V,F){const Y=this.length;return this.resize(Y+1),this.emplace(Y,Q,M,V,F)}emplace(Q,M,V,F,Y){const $=4*Q;return this.int16[$+0]=M,this.int16[$+1]=V,this.int16[$+2]=F,this.int16[$+3]=Y,Q}}pu.prototype.bytesPerElement=8,sn("StructArrayLayout4i8",pu);class Xf extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(Q,M,V,F,Y,$){const ce=this.length;return this.resize(ce+1),this.emplace(ce,Q,M,V,F,Y,$)}emplace(Q,M,V,F,Y,$,ce){const Qe=6*Q;return this.int16[Qe+0]=M,this.int16[Qe+1]=V,this.int16[Qe+2]=F,this.int16[Qe+3]=Y,this.int16[Qe+4]=$,this.int16[Qe+5]=ce,Q}}Xf.prototype.bytesPerElement=12,sn("StructArrayLayout2i4i12",Xf);class Jf extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(Q,M,V,F,Y,$){const ce=this.length;return this.resize(ce+1),this.emplace(ce,Q,M,V,F,Y,$)}emplace(Q,M,V,F,Y,$,ce){const Qe=4*Q,Me=8*Q;return this.int16[Qe+0]=M,this.int16[Qe+1]=V,this.uint8[Me+4]=F,this.uint8[Me+5]=Y,this.uint8[Me+6]=$,this.uint8[Me+7]=ce,Q}}Jf.prototype.bytesPerElement=8,sn("StructArrayLayout2i4ub8",Jf);class y4 extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(Q,M){const V=this.length;return this.resize(V+1),this.emplace(V,Q,M)}emplace(Q,M,V){const F=2*Q;return this.float32[F+0]=M,this.float32[F+1]=V,Q}}y4.prototype.bytesPerElement=8,sn("StructArrayLayout2f8",y4);class T4 extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(Q,M,V,F,Y,$,ce,Qe,Me,Fe){const Ze=this.length;return this.resize(Ze+1),this.emplace(Ze,Q,M,V,F,Y,$,ce,Qe,Me,Fe)}emplace(Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze){const tt=10*Q;return this.uint16[tt+0]=M,this.uint16[tt+1]=V,this.uint16[tt+2]=F,this.uint16[tt+3]=Y,this.uint16[tt+4]=$,this.uint16[tt+5]=ce,this.uint16[tt+6]=Qe,this.uint16[tt+7]=Me,this.uint16[tt+8]=Fe,this.uint16[tt+9]=Ze,Q}}T4.prototype.bytesPerElement=20,sn("StructArrayLayout10ui20",T4);class O9 extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt){const ut=this.length;return this.resize(ut+1),this.emplace(ut,Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt)}emplace(Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt,ut){const dt=12*Q;return this.int16[dt+0]=M,this.int16[dt+1]=V,this.int16[dt+2]=F,this.int16[dt+3]=Y,this.uint16[dt+4]=$,this.uint16[dt+5]=ce,this.uint16[dt+6]=Qe,this.uint16[dt+7]=Me,this.int16[dt+8]=Fe,this.int16[dt+9]=Ze,this.int16[dt+10]=tt,this.int16[dt+11]=ut,Q}}O9.prototype.bytesPerElement=24,sn("StructArrayLayout4i4ui4i24",O9);class Di extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(Q,M,V){const F=this.length;return this.resize(F+1),this.emplace(F,Q,M,V)}emplace(Q,M,V,F){const Y=3*Q;return this.float32[Y+0]=M,this.float32[Y+1]=V,this.float32[Y+2]=F,Q}}Di.prototype.bytesPerElement=12,sn("StructArrayLayout3f12",Di);class Z extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(Q){const M=this.length;return this.resize(M+1),this.emplace(M,Q)}emplace(Q,M){return this.uint32[1*Q+0]=M,Q}}Z.prototype.bytesPerElement=4,sn("StructArrayLayout1ul4",Z);class x extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(Q,M,V,F,Y,$,ce,Qe,Me){const Fe=this.length;return this.resize(Fe+1),this.emplace(Fe,Q,M,V,F,Y,$,ce,Qe,Me)}emplace(Q,M,V,F,Y,$,ce,Qe,Me,Fe){const Ze=10*Q,tt=5*Q;return this.int16[Ze+0]=M,this.int16[Ze+1]=V,this.int16[Ze+2]=F,this.int16[Ze+3]=Y,this.int16[Ze+4]=$,this.int16[Ze+5]=ce,this.uint32[tt+3]=Qe,this.uint16[Ze+8]=Me,this.uint16[Ze+9]=Fe,Q}}x.prototype.bytesPerElement=20,sn("StructArrayLayout6i1ul2ui20",x);class E extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(Q,M,V,F,Y,$){const ce=this.length;return this.resize(ce+1),this.emplace(ce,Q,M,V,F,Y,$)}emplace(Q,M,V,F,Y,$,ce){const Qe=6*Q;return this.int16[Qe+0]=M,this.int16[Qe+1]=V,this.int16[Qe+2]=F,this.int16[Qe+3]=Y,this.int16[Qe+4]=$,this.int16[Qe+5]=ce,Q}}E.prototype.bytesPerElement=12,sn("StructArrayLayout2i2i2i12",E);class B extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(Q,M,V,F,Y){const $=this.length;return this.resize($+1),this.emplace($,Q,M,V,F,Y)}emplace(Q,M,V,F,Y,$){const ce=4*Q,Qe=8*Q;return this.float32[ce+0]=M,this.float32[ce+1]=V,this.float32[ce+2]=F,this.int16[Qe+6]=Y,this.int16[Qe+7]=$,Q}}B.prototype.bytesPerElement=16,sn("StructArrayLayout2f1f2i16",B);class z extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(Q,M,V,F){const Y=this.length;return this.resize(Y+1),this.emplace(Y,Q,M,V,F)}emplace(Q,M,V,F,Y){const $=12*Q,ce=3*Q;return this.uint8[$+0]=M,this.uint8[$+1]=V,this.float32[ce+1]=F,this.float32[ce+2]=Y,Q}}z.prototype.bytesPerElement=12,sn("StructArrayLayout2ub2f12",z);class J extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(Q,M,V){const F=this.length;return this.resize(F+1),this.emplace(F,Q,M,V)}emplace(Q,M,V,F){const Y=3*Q;return this.uint16[Y+0]=M,this.uint16[Y+1]=V,this.uint16[Y+2]=F,Q}}J.prototype.bytesPerElement=6,sn("StructArrayLayout3ui6",J);class de extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt,ut,dt,xt,Ot,Bt){const rr=this.length;return this.resize(rr+1),this.emplace(rr,Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt,ut,dt,xt,Ot,Bt)}emplace(Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt,ut,dt,xt,Ot,Bt,rr){const Wt=24*Q,ir=12*Q,dr=48*Q;return this.int16[Wt+0]=M,this.int16[Wt+1]=V,this.uint16[Wt+2]=F,this.uint16[Wt+3]=Y,this.uint32[ir+2]=$,this.uint32[ir+3]=ce,this.uint32[ir+4]=Qe,this.uint16[Wt+10]=Me,this.uint16[Wt+11]=Fe,this.uint16[Wt+12]=Ze,this.float32[ir+7]=tt,this.float32[ir+8]=ut,this.uint8[dr+36]=dt,this.uint8[dr+37]=xt,this.uint8[dr+38]=Ot,this.uint32[ir+10]=Bt,this.int16[Wt+22]=rr,Q}}de.prototype.bytesPerElement=48,sn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",de);class fe extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt,ut,dt,xt,Ot,Bt,rr,Wt,ir,dr,xr,en,yn,$r,Kr,Ur,hn){const Wr=this.length;return this.resize(Wr+1),this.emplace(Wr,Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt,ut,dt,xt,Ot,Bt,rr,Wt,ir,dr,xr,en,yn,$r,Kr,Ur,hn)}emplace(Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt,ut,dt,xt,Ot,Bt,rr,Wt,ir,dr,xr,en,yn,$r,Kr,Ur,hn,Wr){const Cr=32*Q,kn=16*Q;return this.int16[Cr+0]=M,this.int16[Cr+1]=V,this.int16[Cr+2]=F,this.int16[Cr+3]=Y,this.int16[Cr+4]=$,this.int16[Cr+5]=ce,this.int16[Cr+6]=Qe,this.int16[Cr+7]=Me,this.uint16[Cr+8]=Fe,this.uint16[Cr+9]=Ze,this.uint16[Cr+10]=tt,this.uint16[Cr+11]=ut,this.uint16[Cr+12]=dt,this.uint16[Cr+13]=xt,this.uint16[Cr+14]=Ot,this.uint16[Cr+15]=Bt,this.uint16[Cr+16]=rr,this.uint16[Cr+17]=Wt,this.uint16[Cr+18]=ir,this.uint16[Cr+19]=dr,this.uint16[Cr+20]=xr,this.uint16[Cr+21]=en,this.uint16[Cr+22]=yn,this.uint32[kn+12]=$r,this.float32[kn+13]=Kr,this.float32[kn+14]=Ur,this.uint16[Cr+30]=hn,this.uint16[Cr+31]=Wr,Q}}fe.prototype.bytesPerElement=64,sn("StructArrayLayout8i15ui1ul2f2ui64",fe);class we extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(Q){const M=this.length;return this.resize(M+1),this.emplace(M,Q)}emplace(Q,M){return this.float32[1*Q+0]=M,Q}}we.prototype.bytesPerElement=4,sn("StructArrayLayout1f4",we);class He extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(Q,M,V){const F=this.length;return this.resize(F+1),this.emplace(F,Q,M,V)}emplace(Q,M,V,F){const Y=3*Q;return this.uint16[6*Q+0]=M,this.float32[Y+1]=V,this.float32[Y+2]=F,Q}}He.prototype.bytesPerElement=12,sn("StructArrayLayout1ui2f12",He);class De extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(Q,M,V){const F=this.length;return this.resize(F+1),this.emplace(F,Q,M,V)}emplace(Q,M,V,F){const Y=4*Q;return this.uint32[2*Q+0]=M,this.uint16[Y+2]=V,this.uint16[Y+3]=F,Q}}De.prototype.bytesPerElement=8,sn("StructArrayLayout1ul2ui8",De);class We extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(Q,M){const V=this.length;return this.resize(V+1),this.emplace(V,Q,M)}emplace(Q,M,V){const F=2*Q;return this.uint16[F+0]=M,this.uint16[F+1]=V,Q}}We.prototype.bytesPerElement=4,sn("StructArrayLayout2ui4",We);class st extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(Q){const M=this.length;return this.resize(M+1),this.emplace(M,Q)}emplace(Q,M){return this.uint16[1*Q+0]=M,Q}}st.prototype.bytesPerElement=2,sn("StructArrayLayout1ui2",st);class Qt extends Uo{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(Q,M,V,F){const Y=this.length;return this.resize(Y+1),this.emplace(Y,Q,M,V,F)}emplace(Q,M,V,F,Y){const $=4*Q;return this.float32[$+0]=M,this.float32[$+1]=V,this.float32[$+2]=F,this.float32[$+3]=Y,Q}}Qt.prototype.bytesPerElement=16,sn("StructArrayLayout4f16",Qt);class bt extends du{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new h(this.anchorPointX,this.anchorPointY)}}bt.prototype.size=20;class Ct extends x{get(Q){return new bt(this,Q)}}sn("CollisionBoxArray",Ct);class Tt extends du{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(Q){this._structArray.uint8[this._pos1+37]=Q}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(Q){this._structArray.uint8[this._pos1+38]=Q}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(Q){this._structArray.uint32[this._pos4+10]=Q}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Tt.prototype.size=48;class Kt extends de{get(Q){return new Tt(this,Q)}}sn("PlacedSymbolArray",Kt);class sr extends du{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(Q){this._structArray.uint32[this._pos4+12]=Q}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}sr.prototype.size=64;class It extends fe{get(Q){return new sr(this,Q)}}sn("SymbolInstanceArray",It);class tr extends we{getoffsetX(Q){return this.float32[1*Q+0]}}sn("GlyphOffsetArray",tr);class pr extends g4{getx(Q){return this.int16[3*Q+0]}gety(Q){return this.int16[3*Q+1]}gettileUnitDistanceFromAnchor(Q){return this.int16[3*Q+2]}}sn("SymbolLineVertexArray",pr);class ur extends du{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}ur.prototype.size=12;class Tr extends He{get(Q){return new ur(this,Q)}}sn("TextAnchorOffsetArray",Tr);class Lr extends du{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Lr.prototype.size=8;class br extends De{get(Q){return new Lr(this,Q)}}sn("FeatureIndexArray",br);class Or extends D6{}class fn extends D6{}class bi extends D6{}class Zr extends Xf{}class An extends Jf{}class gn extends y4{}class qi extends T4{}class pi extends O9{}class ei extends Di{}class xi extends Z{}class Go extends E{}class yo extends z{}class xs extends J{}class Za extends We{}const aa=Po([{name:"a_pos",components:2,type:"Int16"}],4),{members:Nl}=aa;class io{constructor(Q=[]){this.segments=Q}prepareSegment(Q,M,V,F){let Y=this.segments[this.segments.length-1];return Q>io.MAX_VERTEX_ARRAY_LENGTH&&D(`Max vertices per segment is ${io.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${Q}`),(!Y||Y.vertexLength+Q>io.MAX_VERTEX_ARRAY_LENGTH||Y.sortKey!==F)&&(Y={vertexOffset:M.length,primitiveOffset:V.length,vertexLength:0,primitiveLength:0},F!==void 0&&(Y.sortKey=F),this.segments.push(Y)),Y}get(){return this.segments}destroy(){for(const Q of this.segments)for(const M in Q.vaos)Q.vaos[M].destroy()}static simpleSegment(Q,M,V,F){return new io([{vertexOffset:Q,primitiveOffset:M,vertexLength:V,primitiveLength:F,vaos:{},sortKey:0}])}}function g1(S,Q){return 256*(S=w(Math.floor(S),0,255))+w(Math.floor(Q),0,255)}io.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,sn("SegmentVector",io);const vc=Po([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Z2={exports:{}},y1={exports:{}};y1.exports=function(S,Q){var M,V,F,Y,$,ce,Qe,Me;for(V=S.length-(M=3&S.length),F=Q,$=3432918353,ce=461845907,Me=0;Me<V;)Qe=255&S.charCodeAt(Me)|(255&S.charCodeAt(++Me))<<8|(255&S.charCodeAt(++Me))<<16|(255&S.charCodeAt(++Me))<<24,++Me,F=27492+(65535&(Y=5*(65535&(F=(F^=Qe=(65535&(Qe=(Qe=(65535&Qe)*$+(((Qe>>>16)*$&65535)<<16)&4294967295)<<15|Qe>>>17))*ce+(((Qe>>>16)*ce&65535)<<16)&4294967295)<<13|F>>>19))+((5*(F>>>16)&65535)<<16)&4294967295))+((58964+(Y>>>16)&65535)<<16);switch(Qe=0,M){case 3:Qe^=(255&S.charCodeAt(Me+2))<<16;case 2:Qe^=(255&S.charCodeAt(Me+1))<<8;case 1:F^=Qe=(65535&(Qe=(Qe=(65535&(Qe^=255&S.charCodeAt(Me)))*$+(((Qe>>>16)*$&65535)<<16)&4294967295)<<15|Qe>>>17))*ce+(((Qe>>>16)*ce&65535)<<16)&4294967295}return F^=S.length,F=2246822507*(65535&(F^=F>>>16))+((2246822507*(F>>>16)&65535)<<16)&4294967295,F=3266489909*(65535&(F^=F>>>13))+((3266489909*(F>>>16)&65535)<<16)&4294967295,(F^=F>>>16)>>>0};var wo=y1.exports,_s={exports:{}};_s.exports=function(S,Q){for(var M,V=S.length,F=Q^V,Y=0;V>=4;)M=1540483477*(65535&(M=255&S.charCodeAt(Y)|(255&S.charCodeAt(++Y))<<8|(255&S.charCodeAt(++Y))<<16|(255&S.charCodeAt(++Y))<<24))+((1540483477*(M>>>16)&65535)<<16),F=1540483477*(65535&F)+((1540483477*(F>>>16)&65535)<<16)^(M=1540483477*(65535&(M^=M>>>24))+((1540483477*(M>>>16)&65535)<<16)),V-=4,++Y;switch(V){case 3:F^=(255&S.charCodeAt(Y+2))<<16;case 2:F^=(255&S.charCodeAt(Y+1))<<8;case 1:F=1540483477*(65535&(F^=255&S.charCodeAt(Y)))+((1540483477*(F>>>16)&65535)<<16)}return F=1540483477*(65535&(F^=F>>>13))+((1540483477*(F>>>16)&65535)<<16),(F^=F>>>15)>>>0};var qo=wo,os=_s.exports;Z2.exports=qo,Z2.exports.murmur3=qo,Z2.exports.murmur2=os;var K2=u(Z2.exports);class sa{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(Q,M,V,F){this.ids.push(ba(Q)),this.positions.push(M,V,F)}getPositions(Q){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const M=ba(Q);let V=0,F=this.ids.length-1;for(;V<F;){const $=V+F>>1;this.ids[$]>=M?F=$:V=$+1}const Y=[];for(;this.ids[V]===M;)Y.push({index:this.positions[3*V],start:this.positions[3*V+1],end:this.positions[3*V+2]}),V++;return Y}static serialize(Q,M){const V=new Float64Array(Q.ids),F=new Uint32Array(Q.positions);return ws(V,F,0,V.length-1),M&&M.push(V.buffer,F.buffer),{ids:V,positions:F}}static deserialize(Q){const M=new sa;return M.ids=Q.ids,M.positions=Q.positions,M.indexed=!0,M}}function ba(S){const Q=+S;return!isNaN(Q)&&Q<=Number.MAX_SAFE_INTEGER?Q:K2(String(S))}function ws(S,Q,M,V){for(;M<V;){const F=S[M+V>>1];let Y=M-1,$=V+1;for(;;){do Y++;while(S[Y]<F);do $--;while(S[$]>F);if(Y>=$)break;Wo(S,Y,$),Wo(Q,3*Y,3*$),Wo(Q,3*Y+1,3*$+1),Wo(Q,3*Y+2,3*$+2)}$-M<V-$?(ws(S,Q,M,$),M=$+1):(ws(S,Q,$+1,V),V=$)}}function Wo(S,Q,M){const V=S[Q];S[Q]=S[M],S[M]=V}sn("FeaturePositionMap",sa);class C3{constructor(Q,M){this.gl=Q.gl,this.location=M}}class Yf extends C3{constructor(Q,M){super(Q,M),this.current=0}set(Q){this.current!==Q&&(this.current=Q,this.gl.uniform1f(this.location,Q))}}class Tb extends C3{constructor(Q,M){super(Q,M),this.current=[0,0,0,0]}set(Q){Q[0]===this.current[0]&&Q[1]===this.current[1]&&Q[2]===this.current[2]&&Q[3]===this.current[3]||(this.current=Q,this.gl.uniform4f(this.location,Q[0],Q[1],Q[2],Q[3]))}}class vb extends C3{constructor(Q,M){super(Q,M),this.current=dn.transparent}set(Q){Q.r===this.current.r&&Q.g===this.current.g&&Q.b===this.current.b&&Q.a===this.current.a||(this.current=Q,this.gl.uniform4f(this.location,Q.r,Q.g,Q.b,Q.a))}}const H9=new Float32Array(16);function V9(S){return[g1(255*S.r,255*S.g),g1(255*S.b,255*S.a)]}class d2{constructor(Q,M,V){this.value=Q,this.uniformNames=M.map(F=>`u_${F}`),this.type=V}setUniform(Q,M,V){Q.set(V.constantOr(this.value))}getBinding(Q,M,V){return this.type==="color"?new vb(Q,M):new Yf(Q,M)}}class H{constructor(Q,M){this.uniformNames=M.map(V=>`u_${V}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(Q,M){this.pixelRatioFrom=M.pixelRatio,this.pixelRatioTo=Q.pixelRatio,this.patternFrom=M.tlbr,this.patternTo=Q.tlbr}setUniform(Q,M,V,F){const Y=F==="u_pattern_to"?this.patternTo:F==="u_pattern_from"?this.patternFrom:F==="u_pixel_ratio_to"?this.pixelRatioTo:F==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Y&&Q.set(Y)}getBinding(Q,M,V){return V.substr(0,9)==="u_pattern"?new Tb(Q,M):new Yf(Q,M)}}class q{constructor(Q,M,V,F){this.expression=Q,this.type=V,this.maxValue=0,this.paintVertexAttributes=M.map(Y=>({name:`a_${Y}`,type:"Float32",components:V==="color"?2:1,offset:0})),this.paintVertexArray=new F}populatePaintArray(Q,M,V,F,Y){const $=this.paintVertexArray.length,ce=this.expression.evaluate(new po(0),M,{},F,[],Y);this.paintVertexArray.resize(Q),this._setPaintValue($,Q,ce)}updatePaintArray(Q,M,V,F){const Y=this.expression.evaluate({zoom:0},V,F);this._setPaintValue(Q,M,Y)}_setPaintValue(Q,M,V){if(this.type==="color"){const F=V9(V);for(let Y=Q;Y<M;Y++)this.paintVertexArray.emplace(Y,F[0],F[1])}else{for(let F=Q;F<M;F++)this.paintVertexArray.emplace(F,V);this.maxValue=Math.max(this.maxValue,Math.abs(V))}}upload(Q){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=Q.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class te{constructor(Q,M,V,F,Y,$){this.expression=Q,this.uniformNames=M.map(ce=>`u_${ce}_t`),this.type=V,this.useIntegerZoom=F,this.zoom=Y,this.maxValue=0,this.paintVertexAttributes=M.map(ce=>({name:`a_${ce}`,type:"Float32",components:V==="color"?4:2,offset:0})),this.paintVertexArray=new $}populatePaintArray(Q,M,V,F,Y){const $=this.expression.evaluate(new po(this.zoom),M,{},F,[],Y),ce=this.expression.evaluate(new po(this.zoom+1),M,{},F,[],Y),Qe=this.paintVertexArray.length;this.paintVertexArray.resize(Q),this._setPaintValue(Qe,Q,$,ce)}updatePaintArray(Q,M,V,F){const Y=this.expression.evaluate({zoom:this.zoom},V,F),$=this.expression.evaluate({zoom:this.zoom+1},V,F);this._setPaintValue(Q,M,Y,$)}_setPaintValue(Q,M,V,F){if(this.type==="color"){const Y=V9(V),$=V9(F);for(let ce=Q;ce<M;ce++)this.paintVertexArray.emplace(ce,Y[0],Y[1],$[0],$[1])}else{for(let Y=Q;Y<M;Y++)this.paintVertexArray.emplace(Y,V,F);this.maxValue=Math.max(this.maxValue,Math.abs(V),Math.abs(F))}}upload(Q){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=Q.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(Q,M){const V=this.useIntegerZoom?Math.floor(M.zoom):M.zoom,F=w(this.expression.interpolationFactor(V,this.zoom,this.zoom+1),0,1);Q.set(F)}getBinding(Q,M,V){return new Yf(Q,M)}}class le{constructor(Q,M,V,F,Y,$){this.expression=Q,this.type=M,this.useIntegerZoom=V,this.zoom=F,this.layerId=$,this.zoomInPaintVertexArray=new Y,this.zoomOutPaintVertexArray=new Y}populatePaintArray(Q,M,V){const F=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(Q),this.zoomOutPaintVertexArray.resize(Q),this._setPaintValues(F,Q,M.patterns&&M.patterns[this.layerId],V)}updatePaintArray(Q,M,V,F,Y){this._setPaintValues(Q,M,V.patterns&&V.patterns[this.layerId],Y)}_setPaintValues(Q,M,V,F){if(!F||!V)return;const{min:Y,mid:$,max:ce}=V,Qe=F[Y],Me=F[$],Fe=F[ce];if(Qe&&Me&&Fe)for(let Ze=Q;Ze<M;Ze++)this.zoomInPaintVertexArray.emplace(Ze,Me.tl[0],Me.tl[1],Me.br[0],Me.br[1],Qe.tl[0],Qe.tl[1],Qe.br[0],Qe.br[1],Me.pixelRatio,Qe.pixelRatio),this.zoomOutPaintVertexArray.emplace(Ze,Me.tl[0],Me.tl[1],Me.br[0],Me.br[1],Fe.tl[0],Fe.tl[1],Fe.br[0],Fe.br[1],Me.pixelRatio,Fe.pixelRatio)}upload(Q){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=Q.createVertexBuffer(this.zoomInPaintVertexArray,vc.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=Q.createVertexBuffer(this.zoomOutPaintVertexArray,vc.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class pe{constructor(Q,M,V){this.binders={},this._buffers=[];const F=[];for(const Y in Q.paint._values){if(!V(Y))continue;const $=Q.paint.get(Y);if(!($ instanceof pl&&a4($.property.specification)))continue;const ce=Pe(Y,Q.type),Qe=$.value,Me=$.property.specification.type,Fe=$.property.useIntegerZoom,Ze=$.property.specification["property-type"],tt=Ze==="cross-faded"||Ze==="cross-faded-data-driven";if(Qe.kind==="constant")this.binders[Y]=tt?new H(Qe.value,ce):new d2(Qe.value,ce,Me),F.push(`/u_${Y}`);else if(Qe.kind==="source"||tt){const ut=Ee(Y,Me,"source");this.binders[Y]=tt?new le(Qe,Me,Fe,M,ut,Q.id):new q(Qe,ce,Me,ut),F.push(`/a_${Y}`)}else{const ut=Ee(Y,Me,"composite");this.binders[Y]=new te(Qe,ce,Me,Fe,M,ut),F.push(`/z_${Y}`)}}this.cacheKey=F.sort().join("")}getMaxValue(Q){const M=this.binders[Q];return M instanceof q||M instanceof te?M.maxValue:0}populatePaintArrays(Q,M,V,F,Y){for(const $ in this.binders){const ce=this.binders[$];(ce instanceof q||ce instanceof te||ce instanceof le)&&ce.populatePaintArray(Q,M,V,F,Y)}}setConstantPatternPositions(Q,M){for(const V in this.binders){const F=this.binders[V];F instanceof H&&F.setConstantPatternPositions(Q,M)}}updatePaintArrays(Q,M,V,F,Y){let $=!1;for(const ce in Q){const Qe=M.getPositions(ce);for(const Me of Qe){const Fe=V.feature(Me.index);for(const Ze in this.binders){const tt=this.binders[Ze];if((tt instanceof q||tt instanceof te||tt instanceof le)&&tt.expression.isStateDependent===!0){const ut=F.paint.get(Ze);tt.expression=ut.value,tt.updatePaintArray(Me.start,Me.end,Fe,Q[ce],Y),$=!0}}}}return $}defines(){const Q=[];for(const M in this.binders){const V=this.binders[M];(V instanceof d2||V instanceof H)&&Q.push(...V.uniformNames.map(F=>`#define HAS_UNIFORM_${F}`))}return Q}getBinderAttributes(){const Q=[];for(const M in this.binders){const V=this.binders[M];if(V instanceof q||V instanceof te)for(let F=0;F<V.paintVertexAttributes.length;F++)Q.push(V.paintVertexAttributes[F].name);else if(V instanceof le)for(let F=0;F<vc.members.length;F++)Q.push(vc.members[F].name)}return Q}getBinderUniforms(){const Q=[];for(const M in this.binders){const V=this.binders[M];if(V instanceof d2||V instanceof H||V instanceof te)for(const F of V.uniformNames)Q.push(F)}return Q}getPaintVertexBuffers(){return this._buffers}getUniforms(Q,M){const V=[];for(const F in this.binders){const Y=this.binders[F];if(Y instanceof d2||Y instanceof H||Y instanceof te){for(const $ of Y.uniformNames)if(M[$]){const ce=Y.getBinding(Q,M[$],$);V.push({name:$,property:F,binding:ce})}}}return V}setUniforms(Q,M,V,F){for(const{name:Y,property:$,binding:ce}of M)this.binders[$].setUniform(ce,F,V.get($),Y)}updatePaintBuffers(Q){this._buffers=[];for(const M in this.binders){const V=this.binders[M];if(Q&&V instanceof le){const F=Q.fromScale===2?V.zoomInPaintVertexBuffer:V.zoomOutPaintVertexBuffer;F&&this._buffers.push(F)}else(V instanceof q||V instanceof te)&&V.paintVertexBuffer&&this._buffers.push(V.paintVertexBuffer)}}upload(Q){for(const M in this.binders){const V=this.binders[M];(V instanceof q||V instanceof te||V instanceof le)&&V.upload(Q)}this.updatePaintBuffers()}destroy(){for(const Q in this.binders){const M=this.binders[Q];(M instanceof q||M instanceof te||M instanceof le)&&M.destroy()}}}class Te{constructor(Q,M,V=()=>!0){this.programConfigurations={};for(const F of Q)this.programConfigurations[F.id]=new pe(F,M,V);this.needsUpload=!1,this._featureMap=new sa,this._bufferOffset=0}populatePaintArrays(Q,M,V,F,Y,$){for(const ce in this.programConfigurations)this.programConfigurations[ce].populatePaintArrays(Q,M,F,Y,$);M.id!==void 0&&this._featureMap.add(M.id,V,this._bufferOffset,Q),this._bufferOffset=Q,this.needsUpload=!0}updatePaintArrays(Q,M,V,F){for(const Y of V)this.needsUpload=this.programConfigurations[Y.id].updatePaintArrays(Q,this._featureMap,M,Y,F)||this.needsUpload}get(Q){return this.programConfigurations[Q]}upload(Q){if(this.needsUpload){for(const M in this.programConfigurations)this.programConfigurations[M].upload(Q);this.needsUpload=!1}}destroy(){for(const Q in this.programConfigurations)this.programConfigurations[Q].destroy()}}function Pe(S,Q){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[S]||[S.replace(`${Q}-`,"").replace(/-/g,"_")]}function Ee(S,Q,M){const V={color:{source:y4,composite:Qt},number:{source:we,composite:y4}},F=function(Y){return{"line-pattern":{source:qi,composite:qi},"fill-pattern":{source:qi,composite:qi},"fill-extrusion-pattern":{source:qi,composite:qi}}[Y]}(S);return F&&F[M]||V[Q][M]}sn("ConstantBinder",d2),sn("CrossFadedConstantBinder",H),sn("SourceExpressionBinder",q),sn("CrossFadedCompositeBinder",le),sn("CompositeExpressionBinder",te),sn("ProgramConfiguration",pe,{omit:["_buffers"]}),sn("ProgramConfigurationSet",Te);const ze=8192,nt=Math.pow(2,14)-1,ot=-nt-1;function mt(S){const Q=ze/S.extent,M=S.loadGeometry();for(let V=0;V<M.length;V++){const F=M[V];for(let Y=0;Y<F.length;Y++){const $=F[Y],ce=Math.round($.x*Q),Qe=Math.round($.y*Q);$.x=w(ce,ot,nt),$.y=w(Qe,ot,nt),(ce<$.x||ce>$.x+1||Qe<$.y||Qe>$.y+1)&&D("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return M}function gt(S,Q){return{type:S.type,id:S.id,properties:S.properties,geometry:Q?mt(S):[]}}function zt(S,Q,M,V,F){S.emplaceBack(2*Q+(V+1)/2,2*M+(F+1)/2)}class Xt{constructor(Q){this.zoom=Q.zoom,this.overscaling=Q.overscaling,this.layers=Q.layers,this.layerIds=this.layers.map(M=>M.id),this.index=Q.index,this.hasPattern=!1,this.layoutVertexArray=new fn,this.indexArray=new xs,this.segments=new io,this.programConfigurations=new Te(Q.layers,Q.zoom),this.stateDependentLayerIds=this.layers.filter(M=>M.isStateDependent()).map(M=>M.id)}populate(Q,M,V){const F=this.layers[0],Y=[];let $=null,ce=!1;F.type==="circle"&&($=F.layout.get("circle-sort-key"),ce=!$.isConstant());for(const{feature:Qe,id:Me,index:Fe,sourceLayerIndex:Ze}of Q){const tt=this.layers[0]._featureFilter.needGeometry,ut=gt(Qe,tt);if(!this.layers[0]._featureFilter.filter(new po(this.zoom),ut,V))continue;const dt=ce?$.evaluate(ut,{},V):void 0,xt={id:Me,properties:Qe.properties,type:Qe.type,sourceLayerIndex:Ze,index:Fe,geometry:tt?ut.geometry:mt(Qe),patterns:{},sortKey:dt};Y.push(xt)}ce&&Y.sort((Qe,Me)=>Qe.sortKey-Me.sortKey);for(const Qe of Y){const{geometry:Me,index:Fe,sourceLayerIndex:Ze}=Qe,tt=Q[Fe].feature;this.addFeature(Qe,Me,Fe,V),M.featureIndex.insert(tt,Me,Fe,Ze,this.index)}}update(Q,M,V){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(Q,M,this.stateDependentLayers,V)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(Q){this.uploaded||(this.layoutVertexBuffer=Q.createVertexBuffer(this.layoutVertexArray,Nl),this.indexBuffer=Q.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(Q),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(Q,M,V,F){for(const Y of M)for(const $ of Y){const ce=$.x,Qe=$.y;if(ce<0||ce>=ze||Qe<0||Qe>=ze)continue;const Me=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,Q.sortKey),Fe=Me.vertexLength;zt(this.layoutVertexArray,ce,Qe,-1,-1),zt(this.layoutVertexArray,ce,Qe,1,-1),zt(this.layoutVertexArray,ce,Qe,1,1),zt(this.layoutVertexArray,ce,Qe,-1,1),this.indexArray.emplaceBack(Fe,Fe+1,Fe+2),this.indexArray.emplaceBack(Fe,Fe+3,Fe+2),Me.vertexLength+=4,Me.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,Q,V,{},F)}}function vt(S,Q){for(let M=0;M<S.length;M++)if(Hr(Q,S[M]))return!0;for(let M=0;M<Q.length;M++)if(Hr(S,Q[M]))return!0;return!!er(S,Q)}function Nt(S,Q,M){return!!Hr(S,Q)||!!mr(Q,S,M)}function Dt(S,Q){if(S.length===1)return jr(Q,S[0]);for(let M=0;M<Q.length;M++){const V=Q[M];for(let F=0;F<V.length;F++)if(Hr(S,V[F]))return!0}for(let M=0;M<S.length;M++)if(jr(Q,S[M]))return!0;for(let M=0;M<Q.length;M++)if(er(S,Q[M]))return!0;return!1}function Yt(S,Q,M){if(S.length>1){if(er(S,Q))return!0;for(let V=0;V<Q.length;V++)if(mr(Q[V],S,M))return!0}for(let V=0;V<S.length;V++)if(mr(S[V],Q,M))return!0;return!1}function er(S,Q){if(S.length===0||Q.length===0)return!1;for(let M=0;M<S.length-1;M++){const V=S[M],F=S[M+1];for(let Y=0;Y<Q.length-1;Y++)if(Ut(V,F,Q[Y],Q[Y+1]))return!0}return!1}function Ut(S,Q,M,V){return j(S,M,V)!==j(Q,M,V)&&j(S,Q,M)!==j(S,Q,V)}function mr(S,Q,M){const V=M*M;if(Q.length===1)return S.distSqr(Q[0])<V;for(let F=1;F<Q.length;F++)if(Vr(S,Q[F-1],Q[F])<V)return!0;return!1}function Vr(S,Q,M){const V=Q.distSqr(M);if(V===0)return S.distSqr(Q);const F=((S.x-Q.x)*(M.x-Q.x)+(S.y-Q.y)*(M.y-Q.y))/V;return S.distSqr(F<0?Q:F>1?M:M.sub(Q)._mult(F)._add(Q))}function jr(S,Q){let M,V,F,Y=!1;for(let $=0;$<S.length;$++){M=S[$];for(let ce=0,Qe=M.length-1;ce<M.length;Qe=ce++)V=M[ce],F=M[Qe],V.y>Q.y!=F.y>Q.y&&Q.x<(F.x-V.x)*(Q.y-V.y)/(F.y-V.y)+V.x&&(Y=!Y)}return Y}function Hr(S,Q){let M=!1;for(let V=0,F=S.length-1;V<S.length;F=V++){const Y=S[V],$=S[F];Y.y>Q.y!=$.y>Q.y&&Q.x<($.x-Y.x)*(Q.y-Y.y)/($.y-Y.y)+Y.x&&(M=!M)}return M}function on(S,Q,M){const V=M[0],F=M[2];if(S.x<V.x&&Q.x<V.x||S.x>F.x&&Q.x>F.x||S.y<V.y&&Q.y<V.y||S.y>F.y&&Q.y>F.y)return!1;const Y=j(S,Q,M[0]);return Y!==j(S,Q,M[1])||Y!==j(S,Q,M[2])||Y!==j(S,Q,M[3])}function Yr(S,Q,M){const V=Q.paint.get(S).value;return V.kind==="constant"?V.value:M.programConfigurations.get(Q.id).getMaxValue(S)}function Vn(S){return Math.sqrt(S[0]*S[0]+S[1]*S[1])}function ln(S,Q,M,V,F){if(!Q[0]&&!Q[1])return S;const Y=h.convert(Q)._mult(F);M==="viewport"&&Y._rotate(-V);const $=[];for(let ce=0;ce<S.length;ce++)$.push(S[ce].sub(Y));return $}let On,Hi;sn("CircleBucket",Xt,{omit:["layers"]});var xa={get paint(){return Hi=Hi||new oa({"circle-radius":new Mn(Re.paint_circle["circle-radius"]),"circle-color":new Mn(Re.paint_circle["circle-color"]),"circle-blur":new Mn(Re.paint_circle["circle-blur"]),"circle-opacity":new Mn(Re.paint_circle["circle-opacity"]),"circle-translate":new Tn(Re.paint_circle["circle-translate"]),"circle-translate-anchor":new Tn(Re.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Tn(Re.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Tn(Re.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Mn(Re.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Mn(Re.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Mn(Re.paint_circle["circle-stroke-opacity"])})},get layout(){return On=On||new oa({"circle-sort-key":new Mn(Re.layout_circle["circle-sort-key"])})}},Jn=1e-6,Mr=typeof Float32Array<"u"?Float32Array:Array;function In(S){return S[0]=1,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=1,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=1,S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S}function Un(S,Q,M){var V=Q[0],F=Q[1],Y=Q[2],$=Q[3],ce=Q[4],Qe=Q[5],Me=Q[6],Fe=Q[7],Ze=Q[8],tt=Q[9],ut=Q[10],dt=Q[11],xt=Q[12],Ot=Q[13],Bt=Q[14],rr=Q[15],Wt=M[0],ir=M[1],dr=M[2],xr=M[3];return S[0]=Wt*V+ir*ce+dr*Ze+xr*xt,S[1]=Wt*F+ir*Qe+dr*tt+xr*Ot,S[2]=Wt*Y+ir*Me+dr*ut+xr*Bt,S[3]=Wt*$+ir*Fe+dr*dt+xr*rr,S[4]=(Wt=M[4])*V+(ir=M[5])*ce+(dr=M[6])*Ze+(xr=M[7])*xt,S[5]=Wt*F+ir*Qe+dr*tt+xr*Ot,S[6]=Wt*Y+ir*Me+dr*ut+xr*Bt,S[7]=Wt*$+ir*Fe+dr*dt+xr*rr,S[8]=(Wt=M[8])*V+(ir=M[9])*ce+(dr=M[10])*Ze+(xr=M[11])*xt,S[9]=Wt*F+ir*Qe+dr*tt+xr*Ot,S[10]=Wt*Y+ir*Me+dr*ut+xr*Bt,S[11]=Wt*$+ir*Fe+dr*dt+xr*rr,S[12]=(Wt=M[12])*V+(ir=M[13])*ce+(dr=M[14])*Ze+(xr=M[15])*xt,S[13]=Wt*F+ir*Qe+dr*tt+xr*Ot,S[14]=Wt*Y+ir*Me+dr*ut+xr*Bt,S[15]=Wt*$+ir*Fe+dr*dt+xr*rr,S}Math.hypot||(Math.hypot=function(){for(var S=0,Q=arguments.length;Q--;)S+=arguments[Q]*arguments[Q];return Math.sqrt(S)});var Si,Zo=Un;function la(S,Q,M){var V=Q[0],F=Q[1],Y=Q[2],$=Q[3];return S[0]=M[0]*V+M[4]*F+M[8]*Y+M[12]*$,S[1]=M[1]*V+M[5]*F+M[9]*Y+M[13]*$,S[2]=M[2]*V+M[6]*F+M[10]*Y+M[14]*$,S[3]=M[3]*V+M[7]*F+M[11]*Y+M[15]*$,S}Si=new Mr(4),Mr!=Float32Array&&(Si[0]=0,Si[1]=0,Si[2]=0,Si[3]=0);class Zs extends Tc{constructor(Q){super(Q,xa)}createBucket(Q){return new Xt(Q)}queryRadius(Q){const M=Q;return Yr("circle-radius",this,M)+Yr("circle-stroke-width",this,M)+Vn(this.paint.get("circle-translate"))}queryIntersectsFeature(Q,M,V,F,Y,$,ce,Qe){const Me=ln(Q,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),$.angle,ce),Fe=this.paint.get("circle-radius").evaluate(M,V)+this.paint.get("circle-stroke-width").evaluate(M,V),Ze=this.paint.get("circle-pitch-alignment")==="map",tt=Ze?Me:function(dt,xt){return dt.map(Ot=>hl(Ot,xt))}(Me,Qe),ut=Ze?Fe*ce:Fe;for(const dt of F)for(const xt of dt){const Ot=Ze?xt:hl(xt,Qe);let Bt=ut;const rr=la([],[xt.x,xt.y,0,1],Qe);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Bt*=rr[3]/$.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Bt*=$.cameraToCenterDistance/rr[3]),Nt(tt,Ot,Bt))return!0}return!1}}function hl(S,Q){const M=la([],[S.x,S.y,0,1],Q);return new h(M[0]/M[3],M[1]/M[3])}class Bl extends Xt{}let fl;sn("HeatmapBucket",Bl,{omit:["layers"]});var Gc={get paint(){return fl=fl||new oa({"heatmap-radius":new Mn(Re.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Mn(Re.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Tn(Re.paint_heatmap["heatmap-intensity"]),"heatmap-color":new R6(Re.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Tn(Re.paint_heatmap["heatmap-opacity"])})}};function Ls(S,{width:Q,height:M},V,F){if(F){if(F instanceof Uint8ClampedArray)F=new Uint8Array(F.buffer);else if(F.length!==Q*M*V)throw new RangeError(`mismatched image size. expected: ${F.length} but got: ${Q*M*V}`)}else F=new Uint8Array(Q*M*V);return S.width=Q,S.height=M,S.data=F,S}function Qc(S,{width:Q,height:M},V){if(Q===S.width&&M===S.height)return;const F=Ls({},{width:Q,height:M},V);E3(S,F,{x:0,y:0},{x:0,y:0},{width:Math.min(S.width,Q),height:Math.min(S.height,M)},V),S.width=Q,S.height=M,S.data=F.data}function E3(S,Q,M,V,F,Y){if(F.width===0||F.height===0)return Q;if(F.width>S.width||F.height>S.height||M.x>S.width-F.width||M.y>S.height-F.height)throw new RangeError("out of range source coordinates for image copy");if(F.width>Q.width||F.height>Q.height||V.x>Q.width-F.width||V.y>Q.height-F.height)throw new RangeError("out of range destination coordinates for image copy");const $=S.data,ce=Q.data;if($===ce)throw new Error("srcData equals dstData, so image is already copied");for(let Qe=0;Qe<F.height;Qe++){const Me=((M.y+Qe)*S.width+M.x)*Y,Fe=((V.y+Qe)*Q.width+V.x)*Y;for(let Ze=0;Ze<F.width*Y;Ze++)ce[Fe+Ze]=$[Me+Ze]}return Q}class I9{constructor(Q,M){Ls(this,Q,1,M)}resize(Q){Qc(this,Q,1)}clone(){return new I9({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(Q,M,V,F,Y){E3(Q,M,V,F,Y,1)}}class _a{constructor(Q,M){Ls(this,Q,4,M)}resize(Q){Qc(this,Q,4)}replace(Q,M){M?this.data.set(Q):this.data=Q instanceof Uint8ClampedArray?new Uint8Array(Q.buffer):Q}clone(){return new _a({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(Q,M,V,F,Y){E3(Q,M,V,F,Y,4)}}function Ss(S){const Q={},M=S.resolution||256,V=S.clips?S.clips.length:1,F=S.image||new _a({width:M,height:V});if(Math.log(M)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${M}`);const Y=($,ce,Qe)=>{Q[S.evaluationKey]=Qe;const Me=S.expression.evaluate(Q);F.data[$+ce+0]=Math.floor(255*Me.r/Me.a),F.data[$+ce+1]=Math.floor(255*Me.g/Me.a),F.data[$+ce+2]=Math.floor(255*Me.b/Me.a),F.data[$+ce+3]=Math.floor(255*Me.a)};if(S.clips)for(let $=0,ce=0;$<V;++$,ce+=4*M)for(let Qe=0,Me=0;Qe<M;Qe++,Me+=4){const Fe=Qe/(M-1),{start:Ze,end:tt}=S.clips[$];Y(ce,Me,Ze*(1-Fe)+tt*Fe)}else for(let $=0,ce=0;$<M;$++,ce+=4)Y(0,ce,$/(M-1));return F}sn("AlphaImage",I9),sn("RGBAImage",_a);class p2 extends Tc{createBucket(Q){return new Bl(Q)}constructor(Q){super(Q,Gc),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(Q){Q==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Ss({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let X2;var h2={get paint(){return X2=X2||new oa({"hillshade-illumination-direction":new Tn(Re.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Tn(Re.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Tn(Re.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Tn(Re.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Tn(Re.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Tn(Re.paint_hillshade["hillshade-accent-color"])})}};class $f extends Tc{constructor(Q){super(Q,h2)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const z6=Po([{name:"a_pos",components:2,type:"Int16"}],4),{members:v4}=z6;var e8={exports:{}};function P9(S,Q,M){M=M||2;var V,F,Y,$,ce,Qe,Me,Fe=Q&&Q.length,Ze=Fe?Q[0]*M:S.length,tt=lqe(S,0,Ze,M,!0),ut=[];if(!tt||tt.next===tt.prev)return ut;if(Fe&&(tt=function(xt,Ot,Bt,rr){var Wt,ir,dr,xr=[];for(Wt=0,ir=Ot.length;Wt<ir;Wt++)(dr=lqe(xt,Ot[Wt]*rr,Wt<ir-1?Ot[Wt+1]*rr:xt.length,rr,!1))===dr.next&&(dr.steiner=!0),xr.push(LKr(dr));for(xr.sort(xKr),Wt=0;Wt<xr.length;Wt++)Bt=_Kr(xr[Wt],Bt);return Bt}(S,Q,tt,M)),S.length>80*M){V=Y=S[0],F=$=S[1];for(var dt=M;dt<Ze;dt+=M)(ce=S[dt])<V&&(V=ce),(Qe=S[dt+1])<F&&(F=Qe),ce>Y&&(Y=ce),Qe>$&&($=Qe);Me=(Me=Math.max(Y-V,$-F))!==0?32767/Me:0}return OM(tt,ut,M,V,F,Me,0),ut}function lqe(S,Q,M,V,F){var Y,$;if(F===kse(S,Q,M,V)>0)for(Y=Q;Y<M;Y+=V)$=dqe(Y,S[Y],S[Y+1],$);else for(Y=M-V;Y>=Q;Y-=V)$=dqe(Y,S[Y],S[Y+1],$);return $&&pz($,$.next)&&(VM($),$=$.next),$}function N9(S,Q){if(!S)return S;Q||(Q=S);var M,V=S;do if(M=!1,V.steiner||!pz(V,V.next)&&Ka(V.prev,V,V.next)!==0)V=V.next;else{if(VM(V),(V=Q=V.prev)===V.next)break;M=!0}while(M||V!==Q);return Q}function OM(S,Q,M,V,F,Y,$){if(S){!$&&Y&&function(Fe,Ze,tt,ut){var dt=Fe;do dt.z===0&&(dt.z=Lse(dt.x,dt.y,Ze,tt,ut)),dt.prevZ=dt.prev,dt.nextZ=dt.next,dt=dt.next;while(dt!==Fe);dt.prevZ.nextZ=null,dt.prevZ=null,function(xt){var Ot,Bt,rr,Wt,ir,dr,xr,en,yn=1;do{for(Bt=xt,xt=null,ir=null,dr=0;Bt;){for(dr++,rr=Bt,xr=0,Ot=0;Ot<yn&&(xr++,rr=rr.nextZ);Ot++);for(en=yn;xr>0||en>0&&rr;)xr!==0&&(en===0||!rr||Bt.z<=rr.z)?(Wt=Bt,Bt=Bt.nextZ,xr--):(Wt=rr,rr=rr.nextZ,en--),ir?ir.nextZ=Wt:xt=Wt,Wt.prevZ=ir,ir=Wt;Bt=rr}ir.nextZ=null,yn*=2}while(dr>1)}(dt)}(S,V,F,Y);for(var ce,Qe,Me=S;S.prev!==S.next;)if(ce=S.prev,Qe=S.next,Y?vKr(S,V,F,Y):TKr(S))Q.push(ce.i/M|0),Q.push(S.i/M|0),Q.push(Qe.i/M|0),VM(S),S=Qe.next,Me=Qe.next;else if((S=Qe)===Me){$?$===1?OM(S=QKr(N9(S),Q,M),Q,M,V,F,Y,2):$===2&&bKr(S,Q,M,V,F,Y):OM(N9(S),Q,M,V,F,Y,1);break}}}function TKr(S){var Q=S.prev,M=S,V=S.next;if(Ka(Q,M,V)>=0)return!1;for(var F=Q.x,Y=M.x,$=V.x,ce=Q.y,Qe=M.y,Me=V.y,Fe=F<Y?F<$?F:$:Y<$?Y:$,Ze=ce<Qe?ce<Me?ce:Me:Qe<Me?Qe:Me,tt=F>Y?F>$?F:$:Y>$?Y:$,ut=ce>Qe?ce>Me?ce:Me:Qe>Me?Qe:Me,dt=V.next;dt!==Q;){if(dt.x>=Fe&&dt.x<=tt&&dt.y>=Ze&&dt.y<=ut&&Qb(F,ce,Y,Qe,$,Me,dt.x,dt.y)&&Ka(dt.prev,dt,dt.next)>=0)return!1;dt=dt.next}return!0}function vKr(S,Q,M,V){var F=S.prev,Y=S,$=S.next;if(Ka(F,Y,$)>=0)return!1;for(var ce=F.x,Qe=Y.x,Me=$.x,Fe=F.y,Ze=Y.y,tt=$.y,ut=ce<Qe?ce<Me?ce:Me:Qe<Me?Qe:Me,dt=Fe<Ze?Fe<tt?Fe:tt:Ze<tt?Ze:tt,xt=ce>Qe?ce>Me?ce:Me:Qe>Me?Qe:Me,Ot=Fe>Ze?Fe>tt?Fe:tt:Ze>tt?Ze:tt,Bt=Lse(ut,dt,Q,M,V),rr=Lse(xt,Ot,Q,M,V),Wt=S.prevZ,ir=S.nextZ;Wt&&Wt.z>=Bt&&ir&&ir.z<=rr;){if(Wt.x>=ut&&Wt.x<=xt&&Wt.y>=dt&&Wt.y<=Ot&&Wt!==F&&Wt!==$&&Qb(ce,Fe,Qe,Ze,Me,tt,Wt.x,Wt.y)&&Ka(Wt.prev,Wt,Wt.next)>=0||(Wt=Wt.prevZ,ir.x>=ut&&ir.x<=xt&&ir.y>=dt&&ir.y<=Ot&&ir!==F&&ir!==$&&Qb(ce,Fe,Qe,Ze,Me,tt,ir.x,ir.y)&&Ka(ir.prev,ir,ir.next)>=0))return!1;ir=ir.nextZ}for(;Wt&&Wt.z>=Bt;){if(Wt.x>=ut&&Wt.x<=xt&&Wt.y>=dt&&Wt.y<=Ot&&Wt!==F&&Wt!==$&&Qb(ce,Fe,Qe,Ze,Me,tt,Wt.x,Wt.y)&&Ka(Wt.prev,Wt,Wt.next)>=0)return!1;Wt=Wt.prevZ}for(;ir&&ir.z<=rr;){if(ir.x>=ut&&ir.x<=xt&&ir.y>=dt&&ir.y<=Ot&&ir!==F&&ir!==$&&Qb(ce,Fe,Qe,Ze,Me,tt,ir.x,ir.y)&&Ka(ir.prev,ir,ir.next)>=0)return!1;ir=ir.nextZ}return!0}function QKr(S,Q,M){var V=S;do{var F=V.prev,Y=V.next.next;!pz(F,Y)&&cqe(F,V,V.next,Y)&&HM(F,Y)&&HM(Y,F)&&(Q.push(F.i/M|0),Q.push(V.i/M|0),Q.push(Y.i/M|0),VM(V),VM(V.next),V=S=Y),V=V.next}while(V!==S);return N9(V)}function bKr(S,Q,M,V,F,Y){var $=S;do{for(var ce=$.next.next;ce!==$.prev;){if($.i!==ce.i&&SKr($,ce)){var Qe=uqe($,ce);return $=N9($,$.next),Qe=N9(Qe,Qe.next),OM($,Q,M,V,F,Y,0),void OM(Qe,Q,M,V,F,Y,0)}ce=ce.next}$=$.next}while($!==S)}function xKr(S,Q){return S.x-Q.x}function _Kr(S,Q){var M=function(F,Y){var $,ce=Y,Qe=F.x,Me=F.y,Fe=-1/0;do{if(Me<=ce.y&&Me>=ce.next.y&&ce.next.y!==ce.y){var Ze=ce.x+(Me-ce.y)*(ce.next.x-ce.x)/(ce.next.y-ce.y);if(Ze<=Qe&&Ze>Fe&&(Fe=Ze,$=ce.x<ce.next.x?ce:ce.next,Ze===Qe))return $}ce=ce.next}while(ce!==Y);if(!$)return null;var tt,ut=$,dt=$.x,xt=$.y,Ot=1/0;ce=$;do Qe>=ce.x&&ce.x>=dt&&Qe!==ce.x&&Qb(Me<xt?Qe:Fe,Me,dt,xt,Me<xt?Fe:Qe,Me,ce.x,ce.y)&&(tt=Math.abs(Me-ce.y)/(Qe-ce.x),HM(ce,F)&&(tt<Ot||tt===Ot&&(ce.x>$.x||ce.x===$.x&&wKr($,ce)))&&($=ce,Ot=tt)),ce=ce.next;while(ce!==ut);return $}(S,Q);if(!M)return Q;var V=uqe(M,S);return N9(V,V.next),N9(M,M.next)}function wKr(S,Q){return Ka(S.prev,S,Q.prev)<0&&Ka(Q.next,S,S.next)<0}function Lse(S,Q,M,V,F){return(S=1431655765&((S=858993459&((S=252645135&((S=16711935&((S=(S-M)*F|0)|S<<8))|S<<4))|S<<2))|S<<1))|(Q=1431655765&((Q=858993459&((Q=252645135&((Q=16711935&((Q=(Q-V)*F|0)|Q<<8))|Q<<4))|Q<<2))|Q<<1))<<1}function LKr(S){var Q=S,M=S;do(Q.x<M.x||Q.x===M.x&&Q.y<M.y)&&(M=Q),Q=Q.next;while(Q!==S);return M}function Qb(S,Q,M,V,F,Y,$,ce){return(F-$)*(Q-ce)>=(S-$)*(Y-ce)&&(S-$)*(V-ce)>=(M-$)*(Q-ce)&&(M-$)*(Y-ce)>=(F-$)*(V-ce)}function SKr(S,Q){return S.next.i!==Q.i&&S.prev.i!==Q.i&&!function(M,V){var F=M;do{if(F.i!==M.i&&F.next.i!==M.i&&F.i!==V.i&&F.next.i!==V.i&&cqe(F,F.next,M,V))return!0;F=F.next}while(F!==M);return!1}(S,Q)&&(HM(S,Q)&&HM(Q,S)&&function(M,V){var F=M,Y=!1,$=(M.x+V.x)/2,ce=(M.y+V.y)/2;do F.y>ce!=F.next.y>ce&&F.next.y!==F.y&&$<(F.next.x-F.x)*(ce-F.y)/(F.next.y-F.y)+F.x&&(Y=!Y),F=F.next;while(F!==M);return Y}(S,Q)&&(Ka(S.prev,S,Q.prev)||Ka(S,Q.prev,Q))||pz(S,Q)&&Ka(S.prev,S,S.next)>0&&Ka(Q.prev,Q,Q.next)>0)}function Ka(S,Q,M){return(Q.y-S.y)*(M.x-Q.x)-(Q.x-S.x)*(M.y-Q.y)}function pz(S,Q){return S.x===Q.x&&S.y===Q.y}function cqe(S,Q,M,V){var F=fz(Ka(S,Q,M)),Y=fz(Ka(S,Q,V)),$=fz(Ka(M,V,S)),ce=fz(Ka(M,V,Q));return F!==Y&&$!==ce||!(F!==0||!hz(S,M,Q))||!(Y!==0||!hz(S,V,Q))||!($!==0||!hz(M,S,V))||!(ce!==0||!hz(M,Q,V))}function hz(S,Q,M){return Q.x<=Math.max(S.x,M.x)&&Q.x>=Math.min(S.x,M.x)&&Q.y<=Math.max(S.y,M.y)&&Q.y>=Math.min(S.y,M.y)}function fz(S){return S>0?1:S<0?-1:0}function HM(S,Q){return Ka(S.prev,S,S.next)<0?Ka(S,Q,S.next)>=0&&Ka(S,S.prev,Q)>=0:Ka(S,Q,S.prev)<0||Ka(S,S.next,Q)<0}function uqe(S,Q){var M=new Sse(S.i,S.x,S.y),V=new Sse(Q.i,Q.x,Q.y),F=S.next,Y=Q.prev;return S.next=Q,Q.prev=S,M.next=F,F.prev=M,V.next=M,M.prev=V,Y.next=V,V.prev=Y,V}function dqe(S,Q,M,V){var F=new Sse(S,Q,M);return V?(F.next=V.next,F.prev=V,V.next.prev=F,V.next=F):(F.prev=F,F.next=F),F}function VM(S){S.next.prev=S.prev,S.prev.next=S.next,S.prevZ&&(S.prevZ.nextZ=S.nextZ),S.nextZ&&(S.nextZ.prevZ=S.prevZ)}function Sse(S,Q,M){this.i=S,this.x=Q,this.y=M,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function kse(S,Q,M,V){for(var F=0,Y=Q,$=M-V;Y<M;Y+=V)F+=(S[$]-S[Y])*(S[Y+1]+S[$+1]),$=Y;return F}e8.exports=P9,e8.exports.default=P9,P9.deviation=function(S,Q,M,V){var F=Q&&Q.length,Y=Math.abs(kse(S,0,F?Q[0]*M:S.length,M));if(F)for(var $=0,ce=Q.length;$<ce;$++)Y-=Math.abs(kse(S,Q[$]*M,$<ce-1?Q[$+1]*M:S.length,M));var Qe=0;for($=0;$<V.length;$+=3){var Me=V[$]*M,Fe=V[$+1]*M,Ze=V[$+2]*M;Qe+=Math.abs((S[Me]-S[Ze])*(S[Fe+1]-S[Me+1])-(S[Me]-S[Fe])*(S[Ze+1]-S[Me+1]))}return Y===0&&Qe===0?0:Math.abs((Qe-Y)/Y)},P9.flatten=function(S){for(var Q=S[0][0].length,M={vertices:[],holes:[],dimensions:Q},V=0,F=0;F<S.length;F++){for(var Y=0;Y<S[F].length;Y++)for(var $=0;$<Q;$++)M.vertices.push(S[F][Y][$]);F>0&&M.holes.push(V+=S[F-1].length)}return M};var pqe=u(e8.exports);function kKr(S,Q,M,V,F){hqe(S,Q,M||0,V||S.length-1,F||MKr)}function hqe(S,Q,M,V,F){for(;V>M;){if(V-M>600){var Y=V-M+1,$=Q-M+1,ce=Math.log(Y),Qe=.5*Math.exp(2*ce/3),Me=.5*Math.sqrt(ce*Qe*(Y-Qe)/Y)*($-Y/2<0?-1:1);hqe(S,Q,Math.max(M,Math.floor(Q-$*Qe/Y+Me)),Math.min(V,Math.floor(Q+(Y-$)*Qe/Y+Me)),F)}var Fe=S[Q],Ze=M,tt=V;for(IM(S,M,Q),F(S[V],Fe)>0&&IM(S,M,V);Ze<tt;){for(IM(S,Ze,tt),Ze++,tt--;F(S[Ze],Fe)<0;)Ze++;for(;F(S[tt],Fe)>0;)tt--}F(S[M],Fe)===0?IM(S,M,tt):IM(S,++tt,V),tt<=Q&&(M=tt+1),Q<=tt&&(V=tt-1)}}function IM(S,Q,M){var V=S[Q];S[Q]=S[M],S[M]=V}function MKr(S,Q){return S<Q?-1:S>Q?1:0}function Mse(S,Q){const M=S.length;if(M<=1)return[S];const V=[];let F,Y;for(let $=0;$<M;$++){const ce=G(S[$]);ce!==0&&(S[$].area=Math.abs(ce),Y===void 0&&(Y=ce<0),Y===ce<0?(F&&V.push(F),F=[S[$]]):F.push(S[$]))}if(F&&V.push(F),Q>1)for(let $=0;$<V.length;$++)V[$].length<=Q||(kKr(V[$],Q,1,V[$].length-1,CKr),V[$]=V[$].slice(0,Q));return V}function CKr(S,Q){return Q.area-S.area}function Cse(S,Q,M){const V=M.patternDependencies;let F=!1;for(const Y of Q){const $=Y.paint.get(`${S}-pattern`);$.isConstant()||(F=!0);const ce=$.constantOr(null);ce&&(F=!0,V[ce.to]=!0,V[ce.from]=!0)}return F}function Ese(S,Q,M,V,F){const Y=F.patternDependencies;for(const $ of Q){const ce=$.paint.get(`${S}-pattern`).value;if(ce.kind!=="constant"){let Qe=ce.evaluate({zoom:V-1},M,{},F.availableImages),Me=ce.evaluate({zoom:V},M,{},F.availableImages),Fe=ce.evaluate({zoom:V+1},M,{},F.availableImages);Qe=Qe&&Qe.name?Qe.name:Qe,Me=Me&&Me.name?Me.name:Me,Fe=Fe&&Fe.name?Fe.name:Fe,Y[Qe]=!0,Y[Me]=!0,Y[Fe]=!0,M.patterns[$.id]={min:Qe,mid:Me,max:Fe}}}return M}class Ase{constructor(Q){this.zoom=Q.zoom,this.overscaling=Q.overscaling,this.layers=Q.layers,this.layerIds=this.layers.map(M=>M.id),this.index=Q.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new bi,this.indexArray=new xs,this.indexArray2=new Za,this.programConfigurations=new Te(Q.layers,Q.zoom),this.segments=new io,this.segments2=new io,this.stateDependentLayerIds=this.layers.filter(M=>M.isStateDependent()).map(M=>M.id)}populate(Q,M,V){this.hasPattern=Cse("fill",this.layers,M);const F=this.layers[0].layout.get("fill-sort-key"),Y=!F.isConstant(),$=[];for(const{feature:ce,id:Qe,index:Me,sourceLayerIndex:Fe}of Q){const Ze=this.layers[0]._featureFilter.needGeometry,tt=gt(ce,Ze);if(!this.layers[0]._featureFilter.filter(new po(this.zoom),tt,V))continue;const ut=Y?F.evaluate(tt,{},V,M.availableImages):void 0,dt={id:Qe,properties:ce.properties,type:ce.type,sourceLayerIndex:Fe,index:Me,geometry:Ze?tt.geometry:mt(ce),patterns:{},sortKey:ut};$.push(dt)}Y&&$.sort((ce,Qe)=>ce.sortKey-Qe.sortKey);for(const ce of $){const{geometry:Qe,index:Me,sourceLayerIndex:Fe}=ce;if(this.hasPattern){const Ze=Ese("fill",this.layers,ce,this.zoom,M);this.patternFeatures.push(Ze)}else this.addFeature(ce,Qe,Me,V,{});M.featureIndex.insert(Q[Me].feature,Qe,Me,Fe,this.index)}}update(Q,M,V){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(Q,M,this.stateDependentLayers,V)}addFeatures(Q,M,V){for(const F of this.patternFeatures)this.addFeature(F,F.geometry,F.index,M,V)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(Q){this.uploaded||(this.layoutVertexBuffer=Q.createVertexBuffer(this.layoutVertexArray,v4),this.indexBuffer=Q.createIndexBuffer(this.indexArray),this.indexBuffer2=Q.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(Q),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(Q,M,V,F,Y){for(const $ of Mse(M,500)){let ce=0;for(const ut of $)ce+=ut.length;const Qe=this.segments.prepareSegment(ce,this.layoutVertexArray,this.indexArray),Me=Qe.vertexLength,Fe=[],Ze=[];for(const ut of $){if(ut.length===0)continue;ut!==$[0]&&Ze.push(Fe.length/2);const dt=this.segments2.prepareSegment(ut.length,this.layoutVertexArray,this.indexArray2),xt=dt.vertexLength;this.layoutVertexArray.emplaceBack(ut[0].x,ut[0].y),this.indexArray2.emplaceBack(xt+ut.length-1,xt),Fe.push(ut[0].x),Fe.push(ut[0].y);for(let Ot=1;Ot<ut.length;Ot++)this.layoutVertexArray.emplaceBack(ut[Ot].x,ut[Ot].y),this.indexArray2.emplaceBack(xt+Ot-1,xt+Ot),Fe.push(ut[Ot].x),Fe.push(ut[Ot].y);dt.vertexLength+=ut.length,dt.primitiveLength+=ut.length}const tt=pqe(Fe,Ze);for(let ut=0;ut<tt.length;ut+=3)this.indexArray.emplaceBack(Me+tt[ut],Me+tt[ut+1],Me+tt[ut+2]);Qe.vertexLength+=ce,Qe.primitiveLength+=tt.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,Q,V,Y,F)}}let fqe,mqe;sn("FillBucket",Ase,{omit:["layers","patternFeatures"]});var EKr={get paint(){return mqe=mqe||new oa({"fill-antialias":new Tn(Re.paint_fill["fill-antialias"]),"fill-opacity":new Mn(Re.paint_fill["fill-opacity"]),"fill-color":new Mn(Re.paint_fill["fill-color"]),"fill-outline-color":new Mn(Re.paint_fill["fill-outline-color"]),"fill-translate":new Tn(Re.paint_fill["fill-translate"]),"fill-translate-anchor":new Tn(Re.paint_fill["fill-translate-anchor"]),"fill-pattern":new f4(Re.paint_fill["fill-pattern"])})},get layout(){return fqe=fqe||new oa({"fill-sort-key":new Mn(Re.layout_fill["fill-sort-key"])})}};class AKr extends Tc{constructor(Q){super(Q,EKr)}recalculate(Q,M){super.recalculate(Q,M);const V=this.paint._values["fill-outline-color"];V.value.kind==="constant"&&V.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(Q){return new Ase(Q)}queryRadius(){return Vn(this.paint.get("fill-translate"))}queryIntersectsFeature(Q,M,V,F,Y,$,ce){return Dt(ln(Q,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),$.angle,ce),F)}isTileClipped(){return!0}}const OKr=Po([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),HKr=Po([{name:"a_centroid",components:2,type:"Int16"}],4),{members:VKr}=OKr;var t8={},IKr=d,gqe=bb;function bb(S,Q,M,V,F){this.properties={},this.extent=M,this.type=0,this._pbf=S,this._geometry=-1,this._keys=V,this._values=F,S.readFields(PKr,this,Q)}function PKr(S,Q,M){S==1?Q.id=M.readVarint():S==2?function(V,F){for(var Y=V.readVarint()+V.pos;V.pos<Y;){var $=F._keys[V.readVarint()],ce=F._values[V.readVarint()];F.properties[$]=ce}}(M,Q):S==3?Q.type=M.readVarint():S==4&&(Q._geometry=M.pos)}function NKr(S){for(var Q,M,V=0,F=0,Y=S.length,$=Y-1;F<Y;$=F++)V+=((M=S[$]).x-(Q=S[F]).x)*(Q.y+M.y);return V}bb.types=["Unknown","Point","LineString","Polygon"],bb.prototype.loadGeometry=function(){var S=this._pbf;S.pos=this._geometry;for(var Q,M=S.readVarint()+S.pos,V=1,F=0,Y=0,$=0,ce=[];S.pos<M;){if(F<=0){var Qe=S.readVarint();V=7&Qe,F=Qe>>3}if(F--,V===1||V===2)Y+=S.readSVarint(),$+=S.readSVarint(),V===1&&(Q&&ce.push(Q),Q=[]),Q.push(new IKr(Y,$));else{if(V!==7)throw new Error("unknown command "+V);Q&&Q.push(Q[0].clone())}}return Q&&ce.push(Q),ce},bb.prototype.bbox=function(){var S=this._pbf;S.pos=this._geometry;for(var Q=S.readVarint()+S.pos,M=1,V=0,F=0,Y=0,$=1/0,ce=-1/0,Qe=1/0,Me=-1/0;S.pos<Q;){if(V<=0){var Fe=S.readVarint();M=7&Fe,V=Fe>>3}if(V--,M===1||M===2)(F+=S.readSVarint())<$&&($=F),F>ce&&(ce=F),(Y+=S.readSVarint())<Qe&&(Qe=Y),Y>Me&&(Me=Y);else if(M!==7)throw new Error("unknown command "+M)}return[$,Qe,ce,Me]},bb.prototype.toGeoJSON=function(S,Q,M){var V,F,Y=this.extent*Math.pow(2,M),$=this.extent*S,ce=this.extent*Q,Qe=this.loadGeometry(),Me=bb.types[this.type];function Fe(ut){for(var dt=0;dt<ut.length;dt++){var xt=ut[dt];ut[dt]=[360*(xt.x+$)/Y-180,360/Math.PI*Math.atan(Math.exp((180-360*(xt.y+ce)/Y)*Math.PI/180))-90]}}switch(this.type){case 1:var Ze=[];for(V=0;V<Qe.length;V++)Ze[V]=Qe[V][0];Fe(Qe=Ze);break;case 2:for(V=0;V<Qe.length;V++)Fe(Qe[V]);break;case 3:for(Qe=function(ut){var dt=ut.length;if(dt<=1)return[ut];for(var xt,Ot,Bt=[],rr=0;rr<dt;rr++){var Wt=NKr(ut[rr]);Wt!==0&&(Ot===void 0&&(Ot=Wt<0),Ot===Wt<0?(xt&&Bt.push(xt),xt=[ut[rr]]):xt.push(ut[rr]))}return xt&&Bt.push(xt),Bt}(Qe),V=0;V<Qe.length;V++)for(F=0;F<Qe[V].length;F++)Fe(Qe[V][F])}Qe.length===1?Qe=Qe[0]:Me="Multi"+Me;var tt={type:"Feature",geometry:{type:Me,coordinates:Qe},properties:this.properties};return"id"in this&&(tt.id=this.id),tt};var BKr=gqe,yqe=Tqe;function Tqe(S,Q){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=S,this._keys=[],this._values=[],this._features=[],S.readFields(RKr,this,Q),this.length=this._features.length}function RKr(S,Q,M){S===15?Q.version=M.readVarint():S===1?Q.name=M.readString():S===5?Q.extent=M.readVarint():S===2?Q._features.push(M.pos):S===3?Q._keys.push(M.readString()):S===4&&Q._values.push(function(V){for(var F=null,Y=V.readVarint()+V.pos;V.pos<Y;){var $=V.readVarint()>>3;F=$===1?V.readString():$===2?V.readFloat():$===3?V.readDouble():$===4?V.readVarint64():$===5?V.readVarint():$===6?V.readSVarint():$===7?V.readBoolean():null}return F}(M))}Tqe.prototype.feature=function(S){if(S<0||S>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[S];var Q=this._pbf.readVarint()+this._pbf.pos;return new BKr(this._pbf,Q,this.extent,this._keys,this._values)};var FKr=yqe;function DKr(S,Q,M){if(S===3){var V=new FKr(M,M.readVarint()+M.pos);V.length&&(Q[V.name]=V)}}t8.VectorTile=function(S,Q){this.layers=S.readFields(DKr,{},Q)},t8.VectorTileFeature=gqe,t8.VectorTileLayer=yqe;const zKr=t8.VectorTileFeature.types,Ose=Math.pow(2,13);function PM(S,Q,M,V,F,Y,$,ce){S.emplaceBack(Q,M,2*Math.floor(V*Ose)+$,F*Ose*2,Y*Ose*2,Math.round(ce))}class Hse{constructor(Q){this.zoom=Q.zoom,this.overscaling=Q.overscaling,this.layers=Q.layers,this.layerIds=this.layers.map(M=>M.id),this.index=Q.index,this.hasPattern=!1,this.layoutVertexArray=new Zr,this.centroidVertexArray=new Or,this.indexArray=new xs,this.programConfigurations=new Te(Q.layers,Q.zoom),this.segments=new io,this.stateDependentLayerIds=this.layers.filter(M=>M.isStateDependent()).map(M=>M.id)}populate(Q,M,V){this.features=[],this.hasPattern=Cse("fill-extrusion",this.layers,M);for(const{feature:F,id:Y,index:$,sourceLayerIndex:ce}of Q){const Qe=this.layers[0]._featureFilter.needGeometry,Me=gt(F,Qe);if(!this.layers[0]._featureFilter.filter(new po(this.zoom),Me,V))continue;const Fe={id:Y,sourceLayerIndex:ce,index:$,geometry:Qe?Me.geometry:mt(F),properties:F.properties,type:F.type,patterns:{}};this.hasPattern?this.features.push(Ese("fill-extrusion",this.layers,Fe,this.zoom,M)):this.addFeature(Fe,Fe.geometry,$,V,{}),M.featureIndex.insert(F,Fe.geometry,$,ce,this.index,!0)}}addFeatures(Q,M,V){for(const F of this.features){const{geometry:Y}=F;this.addFeature(F,Y,F.index,M,V)}}update(Q,M,V){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(Q,M,this.stateDependentLayers,V)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(Q){this.uploaded||(this.layoutVertexBuffer=Q.createVertexBuffer(this.layoutVertexArray,VKr),this.centroidVertexBuffer=Q.createVertexBuffer(this.centroidVertexArray,HKr.members,!0),this.indexBuffer=Q.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(Q),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(Q,M,V,F,Y){const $={x:0,y:0,vertexCount:0};for(const ce of Mse(M,500)){let Qe=0;for(const dt of ce)Qe+=dt.length;let Me=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const dt of ce){if(dt.length===0||UKr(dt))continue;let xt=0;for(let Ot=0;Ot<dt.length;Ot++){const Bt=dt[Ot];if(Ot>=1){const rr=dt[Ot-1];if(!jKr(Bt,rr)){Me.vertexLength+4>io.MAX_VERTEX_ARRAY_LENGTH&&(Me=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Wt=Bt.sub(rr)._perp()._unit(),ir=rr.dist(Bt);xt+ir>32768&&(xt=0),PM(this.layoutVertexArray,Bt.x,Bt.y,Wt.x,Wt.y,0,0,xt),PM(this.layoutVertexArray,Bt.x,Bt.y,Wt.x,Wt.y,0,1,xt),$.x+=2*Bt.x,$.y+=2*Bt.y,$.vertexCount+=2,xt+=ir,PM(this.layoutVertexArray,rr.x,rr.y,Wt.x,Wt.y,0,0,xt),PM(this.layoutVertexArray,rr.x,rr.y,Wt.x,Wt.y,0,1,xt),$.x+=2*rr.x,$.y+=2*rr.y,$.vertexCount+=2;const dr=Me.vertexLength;this.indexArray.emplaceBack(dr,dr+2,dr+1),this.indexArray.emplaceBack(dr+1,dr+2,dr+3),Me.vertexLength+=4,Me.primitiveLength+=2}}}}if(Me.vertexLength+Qe>io.MAX_VERTEX_ARRAY_LENGTH&&(Me=this.segments.prepareSegment(Qe,this.layoutVertexArray,this.indexArray)),zKr[Q.type]!=="Polygon")continue;const Fe=[],Ze=[],tt=Me.vertexLength;for(const dt of ce)if(dt.length!==0){dt!==ce[0]&&Ze.push(Fe.length/2);for(let xt=0;xt<dt.length;xt++){const Ot=dt[xt];PM(this.layoutVertexArray,Ot.x,Ot.y,0,0,1,1,0),$.x+=Ot.x,$.y+=Ot.y,$.vertexCount+=1,Fe.push(Ot.x),Fe.push(Ot.y)}}const ut=pqe(Fe,Ze);for(let dt=0;dt<ut.length;dt+=3)this.indexArray.emplaceBack(tt+ut[dt],tt+ut[dt+2],tt+ut[dt+1]);Me.primitiveLength+=ut.length/3,Me.vertexLength+=Qe}for(let ce=0;ce<$.vertexCount;ce++)this.centroidVertexArray.emplaceBack(Math.floor($.x/$.vertexCount),Math.floor($.y/$.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,Q,V,Y,F)}}function jKr(S,Q){return S.x===Q.x&&(S.x<0||S.x>ze)||S.y===Q.y&&(S.y<0||S.y>ze)}function UKr(S){return S.every(Q=>Q.x<0)||S.every(Q=>Q.x>ze)||S.every(Q=>Q.y<0)||S.every(Q=>Q.y>ze)}let vqe;sn("FillExtrusionBucket",Hse,{omit:["layers","features"]});var GKr={get paint(){return vqe=vqe||new oa({"fill-extrusion-opacity":new Tn(Re["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Mn(Re["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Tn(Re["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Tn(Re["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new f4(Re["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Mn(Re["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Mn(Re["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Tn(Re["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class qKr extends Tc{constructor(Q){super(Q,GKr)}createBucket(Q){return new Hse(Q)}queryRadius(){return Vn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(Q,M,V,F,Y,$,ce,Qe){const Me=ln(Q,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),$.angle,ce),Fe=this.paint.get("fill-extrusion-height").evaluate(M,V),Ze=this.paint.get("fill-extrusion-base").evaluate(M,V),tt=function(dt,xt,Ot,Bt){const rr=[];for(const Wt of dt){const ir=[Wt.x,Wt.y,0,1];la(ir,ir,xt),rr.push(new h(ir[0]/ir[3],ir[1]/ir[3]))}return rr}(Me,Qe),ut=function(dt,xt,Ot,Bt){const rr=[],Wt=[],ir=Bt[8]*xt,dr=Bt[9]*xt,xr=Bt[10]*xt,en=Bt[11]*xt,yn=Bt[8]*Ot,$r=Bt[9]*Ot,Kr=Bt[10]*Ot,Ur=Bt[11]*Ot;for(const hn of dt){const Wr=[],Cr=[];for(const kn of hn){const vn=kn.x,_i=kn.y,No=Bt[0]*vn+Bt[4]*_i+Bt[12],Ko=Bt[1]*vn+Bt[5]*_i+Bt[13],Ms=Bt[2]*vn+Bt[6]*_i+Bt[14],f2=Bt[3]*vn+Bt[7]*_i+Bt[15],qc=Ms+xr,as=f2+en,ml=No+yn,Fl=Ko+$r,Wc=Ms+Kr,Zc=f2+Ur,Cs=new h((No+ir)/as,(Ko+dr)/as);Cs.z=qc/as,Wr.push(Cs);const Es=new h(ml/Zc,Fl/Zc);Es.z=Wc/Zc,Cr.push(Es)}rr.push(Wr),Wt.push(Cr)}return[rr,Wt]}(F,Ze,Fe,Qe);return function(dt,xt,Ot){let Bt=1/0;Dt(Ot,xt)&&(Bt=Qqe(Ot,xt[0]));for(let rr=0;rr<xt.length;rr++){const Wt=xt[rr],ir=dt[rr];for(let dr=0;dr<Wt.length-1;dr++){const xr=Wt[dr],en=[xr,Wt[dr+1],ir[dr+1],ir[dr],xr];vt(Ot,en)&&(Bt=Math.min(Bt,Qqe(Ot,en)))}}return Bt!==1/0&&Bt}(ut[0],ut[1],tt)}}function NM(S,Q){return S.x*Q.x+S.y*Q.y}function Qqe(S,Q){if(S.length===1){let M=0;const V=Q[M++];let F;for(;!F||V.equals(F);)if(F=Q[M++],!F)return 1/0;for(;M<Q.length;M++){const Y=Q[M],$=S[0],ce=F.sub(V),Qe=Y.sub(V),Me=$.sub(V),Fe=NM(ce,ce),Ze=NM(ce,Qe),tt=NM(Qe,Qe),ut=NM(Me,ce),dt=NM(Me,Qe),xt=Fe*tt-Ze*Ze,Ot=(tt*ut-Ze*dt)/xt,Bt=(Fe*dt-Ze*ut)/xt,rr=V.z*(1-Ot-Bt)+F.z*Ot+Y.z*Bt;if(isFinite(rr))return rr}return 1/0}{let M=1/0;for(const V of Q)M=Math.min(M,V.z);return M}}const WKr=Po([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:ZKr}=WKr,KKr=Po([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:XKr}=KKr,JKr=t8.VectorTileFeature.types,YKr=Math.cos(Math.PI/180*37.5),bqe=Math.pow(2,14)/.5;class Vse{constructor(Q){this.zoom=Q.zoom,this.overscaling=Q.overscaling,this.layers=Q.layers,this.layerIds=this.layers.map(M=>M.id),this.index=Q.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(M=>{this.gradients[M.id]={}}),this.layoutVertexArray=new An,this.layoutVertexArray2=new gn,this.indexArray=new xs,this.programConfigurations=new Te(Q.layers,Q.zoom),this.segments=new io,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(M=>M.isStateDependent()).map(M=>M.id)}populate(Q,M,V){this.hasPattern=Cse("line",this.layers,M);const F=this.layers[0].layout.get("line-sort-key"),Y=!F.isConstant(),$=[];for(const{feature:ce,id:Qe,index:Me,sourceLayerIndex:Fe}of Q){const Ze=this.layers[0]._featureFilter.needGeometry,tt=gt(ce,Ze);if(!this.layers[0]._featureFilter.filter(new po(this.zoom),tt,V))continue;const ut=Y?F.evaluate(tt,{},V):void 0,dt={id:Qe,properties:ce.properties,type:ce.type,sourceLayerIndex:Fe,index:Me,geometry:Ze?tt.geometry:mt(ce),patterns:{},sortKey:ut};$.push(dt)}Y&&$.sort((ce,Qe)=>ce.sortKey-Qe.sortKey);for(const ce of $){const{geometry:Qe,index:Me,sourceLayerIndex:Fe}=ce;if(this.hasPattern){const Ze=Ese("line",this.layers,ce,this.zoom,M);this.patternFeatures.push(Ze)}else this.addFeature(ce,Qe,Me,V,{});M.featureIndex.insert(Q[Me].feature,Qe,Me,Fe,this.index)}}update(Q,M,V){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(Q,M,this.stateDependentLayers,V)}addFeatures(Q,M,V){for(const F of this.patternFeatures)this.addFeature(F,F.geometry,F.index,M,V)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(Q){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=Q.createVertexBuffer(this.layoutVertexArray2,XKr)),this.layoutVertexBuffer=Q.createVertexBuffer(this.layoutVertexArray,ZKr),this.indexBuffer=Q.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(Q),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(Q){if(Q.properties&&Object.prototype.hasOwnProperty.call(Q.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(Q.properties,"mapbox_clip_end"))return{start:+Q.properties.mapbox_clip_start,end:+Q.properties.mapbox_clip_end}}addFeature(Q,M,V,F,Y){const $=this.layers[0].layout,ce=$.get("line-join").evaluate(Q,{}),Qe=$.get("line-cap"),Me=$.get("line-miter-limit"),Fe=$.get("line-round-limit");this.lineClips=this.lineFeatureClips(Q);for(const Ze of M)this.addLine(Ze,Q,ce,Qe,Me,Fe);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,Q,V,Y,F)}addLine(Q,M,V,F,Y,$){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Bt=0;Bt<Q.length-1;Bt++)this.totalDistance+=Q[Bt].dist(Q[Bt+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const ce=JKr[M.type]==="Polygon";let Qe=Q.length;for(;Qe>=2&&Q[Qe-1].equals(Q[Qe-2]);)Qe--;let Me=0;for(;Me<Qe-1&&Q[Me].equals(Q[Me+1]);)Me++;if(Qe<(ce?3:2))return;V==="bevel"&&(Y=1.05);const Fe=this.overscaling<=16?15*ze/(512*this.overscaling):0,Ze=this.segments.prepareSegment(10*Qe,this.layoutVertexArray,this.indexArray);let tt,ut,dt,xt,Ot;this.e1=this.e2=-1,ce&&(tt=Q[Qe-2],Ot=Q[Me].sub(tt)._unit()._perp());for(let Bt=Me;Bt<Qe;Bt++){if(dt=Bt===Qe-1?ce?Q[Me+1]:void 0:Q[Bt+1],dt&&Q[Bt].equals(dt))continue;Ot&&(xt=Ot),tt&&(ut=tt),tt=Q[Bt],Ot=dt?dt.sub(tt)._unit()._perp():xt,xt=xt||Ot;let rr=xt.add(Ot);rr.x===0&&rr.y===0||rr._unit();const Wt=xt.x*Ot.x+xt.y*Ot.y,ir=rr.x*Ot.x+rr.y*Ot.y,dr=ir!==0?1/ir:1/0,xr=2*Math.sqrt(2-2*ir),en=ir<YKr&&ut&&dt,yn=xt.x*Ot.y-xt.y*Ot.x>0;if(en&&Bt>Me){const Ur=tt.dist(ut);if(Ur>2*Fe){const hn=tt.sub(tt.sub(ut)._mult(Fe/Ur)._round());this.updateDistance(ut,hn),this.addCurrentVertex(hn,xt,0,0,Ze),ut=hn}}const $r=ut&&dt;let Kr=$r?V:ce?"butt":F;if($r&&Kr==="round"&&(dr<$?Kr="miter":dr<=2&&(Kr="fakeround")),Kr==="miter"&&dr>Y&&(Kr="bevel"),Kr==="bevel"&&(dr>2&&(Kr="flipbevel"),dr<Y&&(Kr="miter")),ut&&this.updateDistance(ut,tt),Kr==="miter")rr._mult(dr),this.addCurrentVertex(tt,rr,0,0,Ze);else if(Kr==="flipbevel"){if(dr>100)rr=Ot.mult(-1);else{const Ur=dr*xt.add(Ot).mag()/xt.sub(Ot).mag();rr._perp()._mult(Ur*(yn?-1:1))}this.addCurrentVertex(tt,rr,0,0,Ze),this.addCurrentVertex(tt,rr.mult(-1),0,0,Ze)}else if(Kr==="bevel"||Kr==="fakeround"){const Ur=-Math.sqrt(dr*dr-1),hn=yn?Ur:0,Wr=yn?0:Ur;if(ut&&this.addCurrentVertex(tt,xt,hn,Wr,Ze),Kr==="fakeround"){const Cr=Math.round(180*xr/Math.PI/20);for(let kn=1;kn<Cr;kn++){let vn=kn/Cr;if(vn!==.5){const No=vn-.5;vn+=vn*No*(vn-1)*((1.0904+Wt*(Wt*(3.55645-1.43519*Wt)-3.2452))*No*No+(.848013+Wt*(.215638*Wt-1.06021)))}const _i=Ot.sub(xt)._mult(vn)._add(xt)._unit()._mult(yn?-1:1);this.addHalfVertex(tt,_i.x,_i.y,!1,yn,0,Ze)}}dt&&this.addCurrentVertex(tt,Ot,-hn,-Wr,Ze)}else if(Kr==="butt")this.addCurrentVertex(tt,rr,0,0,Ze);else if(Kr==="square"){const Ur=ut?1:-1;this.addCurrentVertex(tt,rr,Ur,Ur,Ze)}else Kr==="round"&&(ut&&(this.addCurrentVertex(tt,xt,0,0,Ze),this.addCurrentVertex(tt,xt,1,1,Ze,!0)),dt&&(this.addCurrentVertex(tt,Ot,-1,-1,Ze,!0),this.addCurrentVertex(tt,Ot,0,0,Ze)));if(en&&Bt<Qe-1){const Ur=tt.dist(dt);if(Ur>2*Fe){const hn=tt.add(dt.sub(tt)._mult(Fe/Ur)._round());this.updateDistance(tt,hn),this.addCurrentVertex(hn,Ot,0,0,Ze),tt=hn}}}}addCurrentVertex(Q,M,V,F,Y,$=!1){const ce=M.y*F-M.x,Qe=-M.y-M.x*F;this.addHalfVertex(Q,M.x+M.y*V,M.y-M.x*V,$,!1,V,Y),this.addHalfVertex(Q,ce,Qe,$,!0,-F,Y),this.distance>bqe/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(Q,M,V,F,Y,$))}addHalfVertex({x:Q,y:M},V,F,Y,$,ce,Qe){const Me=.5*(this.lineClips?this.scaledDistance*(bqe-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((Q<<1)+(Y?1:0),(M<<1)+($?1:0),Math.round(63*V)+128,Math.round(63*F)+128,1+(ce===0?0:ce<0?-1:1)|(63&Me)<<2,Me>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const Fe=Qe.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Fe),Qe.primitiveLength++),$?this.e2=Fe:this.e1=Fe}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(Q,M){this.distance+=Q.dist(M),this.updateScaledDistance()}}let xqe,_qe;sn("LineBucket",Vse,{omit:["layers","patternFeatures"]});var wqe={get paint(){return _qe=_qe||new oa({"line-opacity":new Mn(Re.paint_line["line-opacity"]),"line-color":new Mn(Re.paint_line["line-color"]),"line-translate":new Tn(Re.paint_line["line-translate"]),"line-translate-anchor":new Tn(Re.paint_line["line-translate-anchor"]),"line-width":new Mn(Re.paint_line["line-width"]),"line-gap-width":new Mn(Re.paint_line["line-gap-width"]),"line-offset":new Mn(Re.paint_line["line-offset"]),"line-blur":new Mn(Re.paint_line["line-blur"]),"line-dasharray":new B6(Re.paint_line["line-dasharray"]),"line-pattern":new f4(Re.paint_line["line-pattern"]),"line-gradient":new R6(Re.paint_line["line-gradient"])})},get layout(){return xqe=xqe||new oa({"line-cap":new Tn(Re.layout_line["line-cap"]),"line-join":new Mn(Re.layout_line["line-join"]),"line-miter-limit":new Tn(Re.layout_line["line-miter-limit"]),"line-round-limit":new Tn(Re.layout_line["line-round-limit"]),"line-sort-key":new Mn(Re.layout_line["line-sort-key"])})}};class $Kr extends Mn{possiblyEvaluate(Q,M){return M=new po(Math.floor(M.zoom),{now:M.now,fadeDuration:M.fadeDuration,zoomHistory:M.zoomHistory,transition:M.transition}),super.possiblyEvaluate(Q,M)}evaluate(Q,M,V,F){return M=C({},M,{zoom:Math.floor(M.zoom)}),super.evaluate(Q,M,V,F)}}let mz;class eXr extends Tc{constructor(Q){super(Q,wqe),this.gradientVersion=0,mz||(mz=new $Kr(wqe.paint.properties["line-width"].specification),mz.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(Q){if(Q==="line-gradient"){const M=this.gradientExpression();this.stepInterpolant=!!function(V){return V._styleExpression!==void 0}(M)&&M._styleExpression.expression instanceof iu,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(Q,M){super.recalculate(Q,M),this.paint._values["line-floorwidth"]=mz.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,Q)}createBucket(Q){return new Vse(Q)}queryRadius(Q){const M=Q,V=Lqe(Yr("line-width",this,M),Yr("line-gap-width",this,M)),F=Yr("line-offset",this,M);return V/2+Math.abs(F)+Vn(this.paint.get("line-translate"))}queryIntersectsFeature(Q,M,V,F,Y,$,ce){const Qe=ln(Q,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),$.angle,ce),Me=ce/2*Lqe(this.paint.get("line-width").evaluate(M,V),this.paint.get("line-gap-width").evaluate(M,V)),Fe=this.paint.get("line-offset").evaluate(M,V);return Fe&&(F=function(Ze,tt){const ut=[];for(let dt=0;dt<Ze.length;dt++){const xt=Ze[dt],Ot=[];for(let Bt=0;Bt<xt.length;Bt++){const rr=xt[Bt-1],Wt=xt[Bt],ir=xt[Bt+1],dr=Bt===0?new h(0,0):Wt.sub(rr)._unit()._perp(),xr=Bt===xt.length-1?new h(0,0):ir.sub(Wt)._unit()._perp(),en=dr._add(xr)._unit(),yn=en.x*xr.x+en.y*xr.y;yn!==0&&en._mult(1/yn),Ot.push(en._mult(tt)._add(Wt))}ut.push(Ot)}return ut}(F,Fe*ce)),function(Ze,tt,ut){for(let dt=0;dt<tt.length;dt++){const xt=tt[dt];if(Ze.length>=3){for(let Ot=0;Ot<xt.length;Ot++)if(Hr(Ze,xt[Ot]))return!0}if(Yt(Ze,xt,ut))return!0}return!1}(Qe,F,Me)}isTileClipped(){return!0}}function Lqe(S,Q){return Q>0?Q+2*S:S}const tXr=Po([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),rXr=Po([{name:"a_projected_pos",components:3,type:"Float32"}],4);Po([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const nXr=Po([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);Po([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Sqe=Po([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),iXr=Po([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function oXr(S,Q,M){return S.sections.forEach(V=>{V.text=function(F,Y,$){const ce=Y.layout.get("text-transform").evaluate($,{});return ce==="uppercase"?F=F.toLocaleUpperCase():ce==="lowercase"&&(F=F.toLocaleLowerCase()),Pl.applyArabicShaping&&(F=Pl.applyArabicShaping(F)),F}(V.text,Q,M)}),S}Po([{name:"triangle",components:3,type:"Uint16"}]),Po([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Po([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Po([{type:"Float32",name:"offsetX"}]),Po([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Po([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const BM={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var ks=24,kqe=To,Mqe=function(S,Q,M,V,F){var Y,$,ce=8*F-V-1,Qe=(1<<ce)-1,Me=Qe>>1,Fe=-7,Ze=M?F-1:0,tt=M?-1:1,ut=S[Q+Ze];for(Ze+=tt,Y=ut&(1<<-Fe)-1,ut>>=-Fe,Fe+=ce;Fe>0;Y=256*Y+S[Q+Ze],Ze+=tt,Fe-=8);for($=Y&(1<<-Fe)-1,Y>>=-Fe,Fe+=V;Fe>0;$=256*$+S[Q+Ze],Ze+=tt,Fe-=8);if(Y===0)Y=1-Me;else{if(Y===Qe)return $?NaN:1/0*(ut?-1:1);$+=Math.pow(2,V),Y-=Me}return(ut?-1:1)*$*Math.pow(2,Y-V)},Cqe=function(S,Q,M,V,F,Y){var $,ce,Qe,Me=8*Y-F-1,Fe=(1<<Me)-1,Ze=Fe>>1,tt=F===23?Math.pow(2,-24)-Math.pow(2,-77):0,ut=V?0:Y-1,dt=V?1:-1,xt=Q<0||Q===0&&1/Q<0?1:0;for(Q=Math.abs(Q),isNaN(Q)||Q===1/0?(ce=isNaN(Q)?1:0,$=Fe):($=Math.floor(Math.log(Q)/Math.LN2),Q*(Qe=Math.pow(2,-$))<1&&($--,Qe*=2),(Q+=$+Ze>=1?tt/Qe:tt*Math.pow(2,1-Ze))*Qe>=2&&($++,Qe/=2),$+Ze>=Fe?(ce=0,$=Fe):$+Ze>=1?(ce=(Q*Qe-1)*Math.pow(2,F),$+=Ze):(ce=Q*Math.pow(2,Ze-1)*Math.pow(2,F),$=0));F>=8;S[M+ut]=255&ce,ut+=dt,ce/=256,F-=8);for($=$<<F|ce,Me+=F;Me>0;S[M+ut]=255&$,ut+=dt,$/=256,Me-=8);S[M+ut-dt]|=128*xt};function To(S){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(S)?S:new Uint8Array(S||0),this.pos=0,this.type=0,this.length=this.buf.length}To.Varint=0,To.Fixed64=1,To.Bytes=2,To.Fixed32=5;var Ise=4294967296,Eqe=1/Ise,Aqe=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function j6(S){return S.type===To.Bytes?S.readVarint()+S.pos:S.pos+1}function aXr(S,Q,M){return M?4294967296*Q+(S>>>0):4294967296*(Q>>>0)+(S>>>0)}function Oqe(S,Q,M){var V=Q<=16383?1:Q<=2097151?2:Q<=268435455?3:Math.floor(Math.log(Q)/(7*Math.LN2));M.realloc(V);for(var F=M.pos-1;F>=S;F--)M.buf[F+V]=M.buf[F]}function sXr(S,Q){for(var M=0;M<S.length;M++)Q.writeVarint(S[M])}function lXr(S,Q){for(var M=0;M<S.length;M++)Q.writeSVarint(S[M])}function cXr(S,Q){for(var M=0;M<S.length;M++)Q.writeFloat(S[M])}function uXr(S,Q){for(var M=0;M<S.length;M++)Q.writeDouble(S[M])}function dXr(S,Q){for(var M=0;M<S.length;M++)Q.writeBoolean(S[M])}function pXr(S,Q){for(var M=0;M<S.length;M++)Q.writeFixed32(S[M])}function hXr(S,Q){for(var M=0;M<S.length;M++)Q.writeSFixed32(S[M])}function fXr(S,Q){for(var M=0;M<S.length;M++)Q.writeFixed64(S[M])}function mXr(S,Q){for(var M=0;M<S.length;M++)Q.writeSFixed64(S[M])}function gz(S,Q){return(S[Q]|S[Q+1]<<8|S[Q+2]<<16)+16777216*S[Q+3]}function xb(S,Q,M){S[M]=Q,S[M+1]=Q>>>8,S[M+2]=Q>>>16,S[M+3]=Q>>>24}function Hqe(S,Q){return(S[Q]|S[Q+1]<<8|S[Q+2]<<16)+(S[Q+3]<<24)}To.prototype={destroy:function(){this.buf=null},readFields:function(S,Q,M){for(M=M||this.length;this.pos<M;){var V=this.readVarint(),F=V>>3,Y=this.pos;this.type=7&V,S(F,Q,this),this.pos===Y&&this.skip(V)}return Q},readMessage:function(S,Q){return this.readFields(S,Q,this.readVarint()+this.pos)},readFixed32:function(){var S=gz(this.buf,this.pos);return this.pos+=4,S},readSFixed32:function(){var S=Hqe(this.buf,this.pos);return this.pos+=4,S},readFixed64:function(){var S=gz(this.buf,this.pos)+gz(this.buf,this.pos+4)*Ise;return this.pos+=8,S},readSFixed64:function(){var S=gz(this.buf,this.pos)+Hqe(this.buf,this.pos+4)*Ise;return this.pos+=8,S},readFloat:function(){var S=Mqe(this.buf,this.pos,!0,23,4);return this.pos+=4,S},readDouble:function(){var S=Mqe(this.buf,this.pos,!0,52,8);return this.pos+=8,S},readVarint:function(S){var Q,M,V=this.buf;return Q=127&(M=V[this.pos++]),M<128?Q:(Q|=(127&(M=V[this.pos++]))<<7,M<128?Q:(Q|=(127&(M=V[this.pos++]))<<14,M<128?Q:(Q|=(127&(M=V[this.pos++]))<<21,M<128?Q:function(F,Y,$){var ce,Qe,Me=$.buf;if(ce=(112&(Qe=Me[$.pos++]))>>4,Qe<128||(ce|=(127&(Qe=Me[$.pos++]))<<3,Qe<128)||(ce|=(127&(Qe=Me[$.pos++]))<<10,Qe<128)||(ce|=(127&(Qe=Me[$.pos++]))<<17,Qe<128)||(ce|=(127&(Qe=Me[$.pos++]))<<24,Qe<128)||(ce|=(1&(Qe=Me[$.pos++]))<<31,Qe<128))return aXr(F,ce,Y);throw new Error("Expected varint not more than 10 bytes")}(Q|=(15&(M=V[this.pos]))<<28,S,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var S=this.readVarint();return S%2==1?(S+1)/-2:S/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var S=this.readVarint()+this.pos,Q=this.pos;return this.pos=S,S-Q>=12&&Aqe?function(M,V,F){return Aqe.decode(M.subarray(V,F))}(this.buf,Q,S):function(M,V,F){for(var Y="",$=V;$<F;){var ce,Qe,Me,Fe=M[$],Ze=null,tt=Fe>239?4:Fe>223?3:Fe>191?2:1;if($+tt>F)break;tt===1?Fe<128&&(Ze=Fe):tt===2?(192&(ce=M[$+1]))==128&&(Ze=(31&Fe)<<6|63&ce)<=127&&(Ze=null):tt===3?(Qe=M[$+2],(192&(ce=M[$+1]))==128&&(192&Qe)==128&&((Ze=(15&Fe)<<12|(63&ce)<<6|63&Qe)<=2047||Ze>=55296&&Ze<=57343)&&(Ze=null)):tt===4&&(Qe=M[$+2],Me=M[$+3],(192&(ce=M[$+1]))==128&&(192&Qe)==128&&(192&Me)==128&&((Ze=(15&Fe)<<18|(63&ce)<<12|(63&Qe)<<6|63&Me)<=65535||Ze>=1114112)&&(Ze=null)),Ze===null?(Ze=65533,tt=1):Ze>65535&&(Ze-=65536,Y+=String.fromCharCode(Ze>>>10&1023|55296),Ze=56320|1023&Ze),Y+=String.fromCharCode(Ze),$+=tt}return Y}(this.buf,Q,S)},readBytes:function(){var S=this.readVarint()+this.pos,Q=this.buf.subarray(this.pos,S);return this.pos=S,Q},readPackedVarint:function(S,Q){if(this.type!==To.Bytes)return S.push(this.readVarint(Q));var M=j6(this);for(S=S||[];this.pos<M;)S.push(this.readVarint(Q));return S},readPackedSVarint:function(S){if(this.type!==To.Bytes)return S.push(this.readSVarint());var Q=j6(this);for(S=S||[];this.pos<Q;)S.push(this.readSVarint());return S},readPackedBoolean:function(S){if(this.type!==To.Bytes)return S.push(this.readBoolean());var Q=j6(this);for(S=S||[];this.pos<Q;)S.push(this.readBoolean());return S},readPackedFloat:function(S){if(this.type!==To.Bytes)return S.push(this.readFloat());var Q=j6(this);for(S=S||[];this.pos<Q;)S.push(this.readFloat());return S},readPackedDouble:function(S){if(this.type!==To.Bytes)return S.push(this.readDouble());var Q=j6(this);for(S=S||[];this.pos<Q;)S.push(this.readDouble());return S},readPackedFixed32:function(S){if(this.type!==To.Bytes)return S.push(this.readFixed32());var Q=j6(this);for(S=S||[];this.pos<Q;)S.push(this.readFixed32());return S},readPackedSFixed32:function(S){if(this.type!==To.Bytes)return S.push(this.readSFixed32());var Q=j6(this);for(S=S||[];this.pos<Q;)S.push(this.readSFixed32());return S},readPackedFixed64:function(S){if(this.type!==To.Bytes)return S.push(this.readFixed64());var Q=j6(this);for(S=S||[];this.pos<Q;)S.push(this.readFixed64());return S},readPackedSFixed64:function(S){if(this.type!==To.Bytes)return S.push(this.readSFixed64());var Q=j6(this);for(S=S||[];this.pos<Q;)S.push(this.readSFixed64());return S},skip:function(S){var Q=7&S;if(Q===To.Varint)for(;this.buf[this.pos++]>127;);else if(Q===To.Bytes)this.pos=this.readVarint()+this.pos;else if(Q===To.Fixed32)this.pos+=4;else{if(Q!==To.Fixed64)throw new Error("Unimplemented type: "+Q);this.pos+=8}},writeTag:function(S,Q){this.writeVarint(S<<3|Q)},realloc:function(S){for(var Q=this.length||16;Q<this.pos+S;)Q*=2;if(Q!==this.length){var M=new Uint8Array(Q);M.set(this.buf),this.buf=M,this.length=Q}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(S){this.realloc(4),xb(this.buf,S,this.pos),this.pos+=4},writeSFixed32:function(S){this.realloc(4),xb(this.buf,S,this.pos),this.pos+=4},writeFixed64:function(S){this.realloc(8),xb(this.buf,-1&S,this.pos),xb(this.buf,Math.floor(S*Eqe),this.pos+4),this.pos+=8},writeSFixed64:function(S){this.realloc(8),xb(this.buf,-1&S,this.pos),xb(this.buf,Math.floor(S*Eqe),this.pos+4),this.pos+=8},writeVarint:function(S){(S=+S||0)>268435455||S<0?function(Q,M){var V,F;if(Q>=0?(V=Q%4294967296|0,F=Q/4294967296|0):(F=~(-Q/4294967296),4294967295^(V=~(-Q%4294967296))?V=V+1|0:(V=0,F=F+1|0)),Q>=18446744073709552e3||Q<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");M.realloc(10),function(Y,$,ce){ce.buf[ce.pos++]=127&Y|128,Y>>>=7,ce.buf[ce.pos++]=127&Y|128,Y>>>=7,ce.buf[ce.pos++]=127&Y|128,Y>>>=7,ce.buf[ce.pos++]=127&Y|128,ce.buf[ce.pos]=127&(Y>>>=7)}(V,0,M),function(Y,$){var ce=(7&Y)<<4;$.buf[$.pos++]|=ce|((Y>>>=3)?128:0),Y&&($.buf[$.pos++]=127&Y|((Y>>>=7)?128:0),Y&&($.buf[$.pos++]=127&Y|((Y>>>=7)?128:0),Y&&($.buf[$.pos++]=127&Y|((Y>>>=7)?128:0),Y&&($.buf[$.pos++]=127&Y|((Y>>>=7)?128:0),Y&&($.buf[$.pos++]=127&Y)))))}(F,M)}(S,this):(this.realloc(4),this.buf[this.pos++]=127&S|(S>127?128:0),S<=127||(this.buf[this.pos++]=127&(S>>>=7)|(S>127?128:0),S<=127||(this.buf[this.pos++]=127&(S>>>=7)|(S>127?128:0),S<=127||(this.buf[this.pos++]=S>>>7&127))))},writeSVarint:function(S){this.writeVarint(S<0?2*-S-1:2*S)},writeBoolean:function(S){this.writeVarint(!!S)},writeString:function(S){S=String(S),this.realloc(4*S.length),this.pos++;var Q=this.pos;this.pos=function(V,F,Y){for(var $,ce,Qe=0;Qe<F.length;Qe++){if(($=F.charCodeAt(Qe))>55295&&$<57344){if(!ce){$>56319||Qe+1===F.length?(V[Y++]=239,V[Y++]=191,V[Y++]=189):ce=$;continue}if($<56320){V[Y++]=239,V[Y++]=191,V[Y++]=189,ce=$;continue}$=ce-55296<<10|$-56320|65536,ce=null}else ce&&(V[Y++]=239,V[Y++]=191,V[Y++]=189,ce=null);$<128?V[Y++]=$:($<2048?V[Y++]=$>>6|192:($<65536?V[Y++]=$>>12|224:(V[Y++]=$>>18|240,V[Y++]=$>>12&63|128),V[Y++]=$>>6&63|128),V[Y++]=63&$|128)}return Y}(this.buf,S,this.pos);var M=this.pos-Q;M>=128&&Oqe(Q,M,this),this.pos=Q-1,this.writeVarint(M),this.pos+=M},writeFloat:function(S){this.realloc(4),Cqe(this.buf,S,this.pos,!0,23,4),this.pos+=4},writeDouble:function(S){this.realloc(8),Cqe(this.buf,S,this.pos,!0,52,8),this.pos+=8},writeBytes:function(S){var Q=S.length;this.writeVarint(Q),this.realloc(Q);for(var M=0;M<Q;M++)this.buf[this.pos++]=S[M]},writeRawMessage:function(S,Q){this.pos++;var M=this.pos;S(Q,this);var V=this.pos-M;V>=128&&Oqe(M,V,this),this.pos=M-1,this.writeVarint(V),this.pos+=V},writeMessage:function(S,Q,M){this.writeTag(S,To.Bytes),this.writeRawMessage(Q,M)},writePackedVarint:function(S,Q){Q.length&&this.writeMessage(S,sXr,Q)},writePackedSVarint:function(S,Q){Q.length&&this.writeMessage(S,lXr,Q)},writePackedBoolean:function(S,Q){Q.length&&this.writeMessage(S,dXr,Q)},writePackedFloat:function(S,Q){Q.length&&this.writeMessage(S,cXr,Q)},writePackedDouble:function(S,Q){Q.length&&this.writeMessage(S,uXr,Q)},writePackedFixed32:function(S,Q){Q.length&&this.writeMessage(S,pXr,Q)},writePackedSFixed32:function(S,Q){Q.length&&this.writeMessage(S,hXr,Q)},writePackedFixed64:function(S,Q){Q.length&&this.writeMessage(S,fXr,Q)},writePackedSFixed64:function(S,Q){Q.length&&this.writeMessage(S,mXr,Q)},writeBytesField:function(S,Q){this.writeTag(S,To.Bytes),this.writeBytes(Q)},writeFixed32Field:function(S,Q){this.writeTag(S,To.Fixed32),this.writeFixed32(Q)},writeSFixed32Field:function(S,Q){this.writeTag(S,To.Fixed32),this.writeSFixed32(Q)},writeFixed64Field:function(S,Q){this.writeTag(S,To.Fixed64),this.writeFixed64(Q)},writeSFixed64Field:function(S,Q){this.writeTag(S,To.Fixed64),this.writeSFixed64(Q)},writeVarintField:function(S,Q){this.writeTag(S,To.Varint),this.writeVarint(Q)},writeSVarintField:function(S,Q){this.writeTag(S,To.Varint),this.writeSVarint(Q)},writeStringField:function(S,Q){this.writeTag(S,To.Bytes),this.writeString(Q)},writeFloatField:function(S,Q){this.writeTag(S,To.Fixed32),this.writeFloat(Q)},writeDoubleField:function(S,Q){this.writeTag(S,To.Fixed64),this.writeDouble(Q)},writeBooleanField:function(S,Q){this.writeVarintField(S,!!Q)}};var Pse=u(kqe);const Nse=3;function gXr(S,Q,M){S===1&&M.readMessage(yXr,Q)}function yXr(S,Q,M){if(S===3){const{id:V,bitmap:F,width:Y,height:$,left:ce,top:Qe,advance:Me}=M.readMessage(TXr,{});Q.push({id:V,bitmap:new I9({width:Y+2*Nse,height:$+2*Nse},F),metrics:{width:Y,height:$,left:ce,top:Qe,advance:Me}})}}function TXr(S,Q,M){S===1?Q.id=M.readVarint():S===2?Q.bitmap=M.readBytes():S===3?Q.width=M.readVarint():S===4?Q.height=M.readVarint():S===5?Q.left=M.readSVarint():S===6?Q.top=M.readSVarint():S===7&&(Q.advance=M.readVarint())}const Vqe=Nse;function Iqe(S){let Q=0,M=0;for(const $ of S)Q+=$.w*$.h,M=Math.max(M,$.w);S.sort(($,ce)=>ce.h-$.h);const V=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(Q/.95)),M),h:1/0}];let F=0,Y=0;for(const $ of S)for(let ce=V.length-1;ce>=0;ce--){const Qe=V[ce];if(!($.w>Qe.w||$.h>Qe.h)){if($.x=Qe.x,$.y=Qe.y,Y=Math.max(Y,$.y+$.h),F=Math.max(F,$.x+$.w),$.w===Qe.w&&$.h===Qe.h){const Me=V.pop();ce<V.length&&(V[ce]=Me)}else $.h===Qe.h?(Qe.x+=$.w,Qe.w-=$.w):$.w===Qe.w?(Qe.y+=$.h,Qe.h-=$.h):(V.push({x:Qe.x+$.w,y:Qe.y,w:Qe.w-$.w,h:$.h}),Qe.y+=$.h,Qe.h-=$.h);break}}return{w:F,h:Y,fill:Q/(F*Y)||0}}const T1=1;class Bse{constructor(Q,{pixelRatio:M,version:V,stretchX:F,stretchY:Y,content:$}){this.paddedRect=Q,this.pixelRatio=M,this.stretchX=F,this.stretchY=Y,this.content=$,this.version=V}get tl(){return[this.paddedRect.x+T1,this.paddedRect.y+T1]}get br(){return[this.paddedRect.x+this.paddedRect.w-T1,this.paddedRect.y+this.paddedRect.h-T1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*T1)/this.pixelRatio,(this.paddedRect.h-2*T1)/this.pixelRatio]}}class Pqe{constructor(Q,M){const V={},F={};this.haveRenderCallbacks=[];const Y=[];this.addImages(Q,V,Y),this.addImages(M,F,Y);const{w:$,h:ce}=Iqe(Y),Qe=new _a({width:$||1,height:ce||1});for(const Me in Q){const Fe=Q[Me],Ze=V[Me].paddedRect;_a.copy(Fe.data,Qe,{x:0,y:0},{x:Ze.x+T1,y:Ze.y+T1},Fe.data)}for(const Me in M){const Fe=M[Me],Ze=F[Me].paddedRect,tt=Ze.x+T1,ut=Ze.y+T1,dt=Fe.data.width,xt=Fe.data.height;_a.copy(Fe.data,Qe,{x:0,y:0},{x:tt,y:ut},Fe.data),_a.copy(Fe.data,Qe,{x:0,y:xt-1},{x:tt,y:ut-1},{width:dt,height:1}),_a.copy(Fe.data,Qe,{x:0,y:0},{x:tt,y:ut+xt},{width:dt,height:1}),_a.copy(Fe.data,Qe,{x:dt-1,y:0},{x:tt-1,y:ut},{width:1,height:xt}),_a.copy(Fe.data,Qe,{x:0,y:0},{x:tt+dt,y:ut},{width:1,height:xt})}this.image=Qe,this.iconPositions=V,this.patternPositions=F}addImages(Q,M,V){for(const F in Q){const Y=Q[F],$={x:0,y:0,w:Y.data.width+2*T1,h:Y.data.height+2*T1};V.push($),M[F]=new Bse($,Y),Y.hasRenderCallback&&this.haveRenderCallbacks.push(F)}}patchUpdatedImages(Q,M){Q.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const V in Q.updatedImages)this.patchUpdatedImage(this.iconPositions[V],Q.getImage(V),M),this.patchUpdatedImage(this.patternPositions[V],Q.getImage(V),M)}patchUpdatedImage(Q,M,V){if(!Q||!M||Q.version===M.version)return;Q.version=M.version;const[F,Y]=Q.tl;V.update(M.data,void 0,{x:F,y:Y})}}var r8;sn("ImagePosition",Bse),sn("ImageAtlas",Pqe),l.ai=void 0,(r8=l.ai||(l.ai={}))[r8.none=0]="none",r8[r8.horizontal=1]="horizontal",r8[r8.vertical=2]="vertical",r8[r8.horizontalOnly=3]="horizontalOnly";const RM=-17;class FM{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(Q,M){const V=new FM;return V.scale=Q||1,V.fontStack=M,V}static forImage(Q){const M=new FM;return M.imageName=Q,M}}class _b{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(Q,M){const V=new _b;for(let F=0;F<Q.sections.length;F++){const Y=Q.sections[F];Y.image?V.addImageSection(Y):V.addTextSection(Y,M)}return V}length(){return this.text.length}getSection(Q){return this.sections[this.sectionIndex[Q]]}getSectionIndex(Q){return this.sectionIndex[Q]}getCharCode(Q){return this.text.charCodeAt(Q)}verticalizePunctuation(){this.text=function(Q){let M="";for(let V=0;V<Q.length;V++){const F=Q.charCodeAt(V+1)||null,Y=Q.charCodeAt(V-1)||null;M+=F&&S9(F)&&!BM[Q[V+1]]||Y&&S9(Y)&&!BM[Q[V-1]]||!BM[Q[V]]?Q[V]:BM[Q[V]]}return M}(this.text)}trim(){let Q=0;for(let V=0;V<this.text.length&&Tz[this.text.charCodeAt(V)];V++)Q++;let M=this.text.length;for(let V=this.text.length-1;V>=0&&V>=Q&&Tz[this.text.charCodeAt(V)];V--)M--;this.text=this.text.substring(Q,M),this.sectionIndex=this.sectionIndex.slice(Q,M)}substring(Q,M){const V=new _b;return V.text=this.text.substring(Q,M),V.sectionIndex=this.sectionIndex.slice(Q,M),V.sections=this.sections,V}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((Q,M)=>Math.max(Q,this.sections[M].scale),0)}addTextSection(Q,M){this.text+=Q.text,this.sections.push(FM.forText(Q.scale,Q.fontStack||M));const V=this.sections.length-1;for(let F=0;F<Q.text.length;++F)this.sectionIndex.push(V)}addImageSection(Q){const M=Q.image?Q.image.name:"";if(M.length===0)return void D("Can't add FormattedSection with an empty image.");const V=this.getNextImageSectionCharCode();V?(this.text+=String.fromCharCode(V),this.sections.push(FM.forImage(M)),this.sectionIndex.push(this.sections.length-1)):D("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function yz(S,Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt,ut,dt,xt){const Ot=_b.fromFeature(S,F);let Bt;Ze===l.ai.vertical&&Ot.verticalizePunctuation();const{processBidirectionalText:rr,processStyledBidirectionalText:Wt}=Pl;if(rr&&Ot.sections.length===1){Bt=[];const xr=rr(Ot.toString(),Rse(Ot,Me,Y,Q,V,ut,dt));for(const en of xr){const yn=new _b;yn.text=en,yn.sections=Ot.sections;for(let $r=0;$r<en.length;$r++)yn.sectionIndex.push(0);Bt.push(yn)}}else if(Wt){Bt=[];const xr=Wt(Ot.text,Ot.sectionIndex,Rse(Ot,Me,Y,Q,V,ut,dt));for(const en of xr){const yn=new _b;yn.text=en[0],yn.sectionIndex=en[1],yn.sections=Ot.sections,Bt.push(yn)}}else Bt=function(xr,en){const yn=[],$r=xr.text;let Kr=0;for(const Ur of en)yn.push(xr.substring(Kr,Ur)),Kr=Ur;return Kr<$r.length&&yn.push(xr.substring(Kr,$r.length)),yn}(Ot,Rse(Ot,Me,Y,Q,V,ut,dt));const ir=[],dr={positionedLines:ir,text:Ot.toString(),top:Fe[1],bottom:Fe[1],left:Fe[0],right:Fe[0],writingMode:Ze,iconsInText:!1,verticalizable:!1};return function(xr,en,yn,$r,Kr,Ur,hn,Wr,Cr,kn,vn,_i){let No=0,Ko=RM,Ms=0,f2=0;const qc=Wr==="right"?1:Wr==="left"?0:.5;let as=0;for(const Cs of Kr){Cs.trim();const Es=Cs.getMaxScale(),bc=(Es-1)*ks,Kc={positionedGlyphs:[],lineOffset:0};xr.positionedLines[as]=Kc;const xc=Kc.positionedGlyphs;let v1=0;if(!Cs.length()){Ko+=Ur,++as;continue}for(let As=0;As<Cs.length();As++){const Ei=Cs.getSection(As),_c=Cs.getSectionIndex(As),Dl=Cs.getCharCode(As);let Os=0,hu=null,A3=null,O3=null,U6=ks;const fu=!(Cr===l.ai.horizontal||!vn&&!Uf(Dl)||vn&&(Tz[Dl]||(ml=Dl,Jr.Arabic(ml)||Jr["Arabic Supplement"](ml)||Jr["Arabic Extended-A"](ml)||Jr["Arabic Presentation Forms-A"](ml)||Jr["Arabic Presentation Forms-B"](ml))));if(Ei.imageName){const Y2=$r[Ei.imageName];if(!Y2)continue;O3=Ei.imageName,xr.iconsInText=xr.iconsInText||!0,A3=Y2.paddedRect;const b1=Y2.displaySize;Ei.scale=Ei.scale*ks/_i,hu={width:b1[0],height:b1[1],left:T1,top:-Vqe,advance:fu?b1[1]:b1[0]},Os=bc+(ks-b1[1]*Ei.scale),U6=hu.advance;const G6=fu?b1[0]*Ei.scale-ks*Es:b1[1]*Ei.scale-ks*Es;G6>0&&G6>v1&&(v1=G6)}else{const Y2=yn[Ei.fontStack],b1=Y2&&Y2[Dl];if(b1&&b1.rect)A3=b1.rect,hu=b1.metrics;else{const G6=en[Ei.fontStack],GM=G6&&G6[Dl];if(!GM)continue;hu=GM.metrics}Os=(Es-Ei.scale)*ks}fu?(xr.verticalizable=!0,xc.push({glyph:Dl,imageName:O3,x:No,y:Ko+Os,vertical:fu,scale:Ei.scale,fontStack:Ei.fontStack,sectionIndex:_c,metrics:hu,rect:A3}),No+=U6*Ei.scale+kn):(xc.push({glyph:Dl,imageName:O3,x:No,y:Ko+Os,vertical:fu,scale:Ei.scale,fontStack:Ei.fontStack,sectionIndex:_c,metrics:hu,rect:A3}),No+=hu.advance*Ei.scale+kn)}xc.length!==0&&(Ms=Math.max(No-kn,Ms),bXr(xc,0,xc.length-1,qc,v1)),No=0;const Q1=Ur*Es+v1;Kc.lineOffset=Math.max(v1,bc),Ko+=Q1,f2=Math.max(Q1,f2),++as}var ml;const Fl=Ko-RM,{horizontalAlign:Wc,verticalAlign:Zc}=Fse(hn);(function(Cs,Es,bc,Kc,xc,v1,Q1,As,Ei){const _c=(Es-bc)*xc;let Dl=0;Dl=v1!==Q1?-As*Kc-RM:(-Kc*Ei+.5)*Q1;for(const Os of Cs)for(const hu of Os.positionedGlyphs)hu.x+=_c,hu.y+=Dl})(xr.positionedLines,qc,Wc,Zc,Ms,f2,Ur,Fl,Kr.length),xr.top+=-Zc*Fl,xr.bottom=xr.top+Fl,xr.left+=-Wc*Ms,xr.right=xr.left+Ms}(dr,Q,M,V,Bt,$,ce,Qe,Ze,Me,tt,xt),!function(xr){for(const en of xr)if(en.positionedGlyphs.length!==0)return!1;return!0}(ir)&&dr}const Tz={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},vXr={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Nqe(S,Q,M,V,F,Y){if(Q.imageName){const $=V[Q.imageName];return $?$.displaySize[0]*Q.scale*ks/Y+F:0}{const $=M[Q.fontStack],ce=$&&$[S];return ce?ce.metrics.advance*Q.scale+F:0}}function Bqe(S,Q,M,V){const F=Math.pow(S-Q,2);return V?S<Q?F/2:2*F:F+Math.abs(M)*M}function QXr(S,Q,M){let V=0;return S===10&&(V-=1e4),M&&(V+=150),S!==40&&S!==65288||(V+=50),Q!==41&&Q!==65289||(V+=50),V}function Rqe(S,Q,M,V,F,Y){let $=null,ce=Bqe(Q,M,F,Y);for(const Qe of V){const Me=Bqe(Q-Qe.x,M,F,Y)+Qe.badness;Me<=ce&&($=Qe,ce=Me)}return{index:S,x:Q,priorBreak:$,badness:ce}}function Fqe(S){return S?Fqe(S.priorBreak).concat(S.index):[]}function Rse(S,Q,M,V,F,Y,$){if(Y!=="point")return[];if(!S)return[];const ce=[],Qe=function(tt,ut,dt,xt,Ot,Bt){let rr=0;for(let Wt=0;Wt<tt.length();Wt++){const ir=tt.getSection(Wt);rr+=Nqe(tt.getCharCode(Wt),ir,xt,Ot,ut,Bt)}return rr/Math.max(1,Math.ceil(rr/dt))}(S,Q,M,V,F,$),Me=S.text.indexOf("​")>=0;let Fe=0;for(let tt=0;tt<S.length();tt++){const ut=S.getSection(tt),dt=S.getCharCode(tt);if(Tz[dt]||(Fe+=Nqe(dt,ut,V,F,Q,$)),tt<S.length()-1){const xt=!((Ze=dt)<11904||!(Jr["Bopomofo Extended"](Ze)||Jr.Bopomofo(Ze)||Jr["CJK Compatibility Forms"](Ze)||Jr["CJK Compatibility Ideographs"](Ze)||Jr["CJK Compatibility"](Ze)||Jr["CJK Radicals Supplement"](Ze)||Jr["CJK Strokes"](Ze)||Jr["CJK Symbols and Punctuation"](Ze)||Jr["CJK Unified Ideographs Extension A"](Ze)||Jr["CJK Unified Ideographs"](Ze)||Jr["Enclosed CJK Letters and Months"](Ze)||Jr["Halfwidth and Fullwidth Forms"](Ze)||Jr.Hiragana(Ze)||Jr["Ideographic Description Characters"](Ze)||Jr["Kangxi Radicals"](Ze)||Jr["Katakana Phonetic Extensions"](Ze)||Jr.Katakana(Ze)||Jr["Vertical Forms"](Ze)||Jr["Yi Radicals"](Ze)||Jr["Yi Syllables"](Ze)));(vXr[dt]||xt||ut.imageName)&&ce.push(Rqe(tt+1,Fe,Qe,ce,QXr(dt,S.getCharCode(tt+1),xt&&Me),!1))}}var Ze;return Fqe(Rqe(S.length(),Fe,Qe,ce,0,!0))}function Fse(S){let Q=.5,M=.5;switch(S){case"right":case"top-right":case"bottom-right":Q=1;break;case"left":case"top-left":case"bottom-left":Q=0}switch(S){case"bottom":case"bottom-right":case"bottom-left":M=1;break;case"top":case"top-right":case"top-left":M=0}return{horizontalAlign:Q,verticalAlign:M}}function bXr(S,Q,M,V,F){if(!V&&!F)return;const Y=S[M],$=(S[M].x+Y.metrics.advance*Y.scale)*V;for(let ce=Q;ce<=M;ce++)S[ce].x-=$,S[ce].y+=F}function xXr(S,Q,M){const{horizontalAlign:V,verticalAlign:F}=Fse(M),Y=Q[0]-S.displaySize[0]*V,$=Q[1]-S.displaySize[1]*F;return{image:S,top:$,bottom:$+S.displaySize[1],left:Y,right:Y+S.displaySize[0]}}function Dqe(S,Q,M,V,F,Y){const $=S.image;let ce;if($.content){const Ot=$.content,Bt=$.pixelRatio||1;ce=[Ot[0]/Bt,Ot[1]/Bt,$.displaySize[0]-Ot[2]/Bt,$.displaySize[1]-Ot[3]/Bt]}const Qe=Q.left*Y,Me=Q.right*Y;let Fe,Ze,tt,ut;M==="width"||M==="both"?(ut=F[0]+Qe-V[3],Ze=F[0]+Me+V[1]):(ut=F[0]+(Qe+Me-$.displaySize[0])/2,Ze=ut+$.displaySize[0]);const dt=Q.top*Y,xt=Q.bottom*Y;return M==="height"||M==="both"?(Fe=F[1]+dt-V[0],tt=F[1]+xt+V[2]):(Fe=F[1]+(dt+xt-$.displaySize[1])/2,tt=Fe+$.displaySize[1]),{image:$,top:Fe,right:Ze,bottom:tt,left:ut,collisionPadding:ce}}const DM=255,Q4=128,n8=DM*Q4;function zqe(S,Q){const{expression:M}=Q;if(M.kind==="constant")return{kind:"constant",layoutSize:M.evaluate(new po(S+1))};if(M.kind==="source")return{kind:"source"};{const{zoomStops:V,interpolationType:F}=M;let Y=0;for(;Y<V.length&&V[Y]<=S;)Y++;Y=Math.max(0,Y-1);let $=Y;for(;$<V.length&&V[$]<S+1;)$++;$=Math.min(V.length-1,$);const ce=V[Y],Qe=V[$];return M.kind==="composite"?{kind:"composite",minZoom:ce,maxZoom:Qe,interpolationType:F}:{kind:"camera",minZoom:ce,maxZoom:Qe,minSize:M.evaluate(new po(ce)),maxSize:M.evaluate(new po(Qe)),interpolationType:F}}}function Dse(S,Q,M){let V="never";const F=S.get(Q);return F?V=F:S.get(M)&&(V="always"),V}const _Xr=t8.VectorTileFeature.types,wXr=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function vz(S,Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt){const ut=ce?Math.min(n8,Math.round(ce[0])):0,dt=ce?Math.min(n8,Math.round(ce[1])):0;S.emplaceBack(Q,M,Math.round(32*V),Math.round(32*F),Y,$,(ut<<1)+(Qe?1:0),dt,16*Me,16*Fe,256*Ze,256*tt)}function zse(S,Q,M){S.emplaceBack(Q.x,Q.y,M),S.emplaceBack(Q.x,Q.y,M),S.emplaceBack(Q.x,Q.y,M),S.emplaceBack(Q.x,Q.y,M)}function LXr(S){for(const Q of S.sections)if(AM(Q.text))return!0;return!1}class jse{constructor(Q){this.layoutVertexArray=new pi,this.indexArray=new xs,this.programConfigurations=Q,this.segments=new io,this.dynamicLayoutVertexArray=new ei,this.opacityVertexArray=new xi,this.hasVisibleVertices=!1,this.placedSymbolArray=new Kt}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(Q,M,V,F){this.isEmpty()||(V&&(this.layoutVertexBuffer=Q.createVertexBuffer(this.layoutVertexArray,tXr.members),this.indexBuffer=Q.createIndexBuffer(this.indexArray,M),this.dynamicLayoutVertexBuffer=Q.createVertexBuffer(this.dynamicLayoutVertexArray,rXr.members,!0),this.opacityVertexBuffer=Q.createVertexBuffer(this.opacityVertexArray,wXr,!0),this.opacityVertexBuffer.itemSize=1),(V||F)&&this.programConfigurations.upload(Q))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}sn("SymbolBuffers",jse);class Use{constructor(Q,M,V){this.layoutVertexArray=new Q,this.layoutAttributes=M,this.indexArray=new V,this.segments=new io,this.collisionVertexArray=new yo}upload(Q){this.layoutVertexBuffer=Q.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=Q.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=Q.createVertexBuffer(this.collisionVertexArray,nXr.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}sn("CollisionBuffers",Use);class wb{constructor(Q){this.collisionBoxArray=Q.collisionBoxArray,this.zoom=Q.zoom,this.overscaling=Q.overscaling,this.layers=Q.layers,this.layerIds=this.layers.map($=>$.id),this.index=Q.index,this.pixelRatio=Q.pixelRatio,this.sourceLayerIndex=Q.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=In([]),this.placementViewportMatrix=In([]);const M=this.layers[0]._unevaluatedLayout._values;this.textSizeData=zqe(this.zoom,M["text-size"]),this.iconSizeData=zqe(this.zoom,M["icon-size"]);const V=this.layers[0].layout,F=V.get("symbol-sort-key"),Y=V.get("symbol-z-order");this.canOverlap=Dse(V,"text-overlap","text-allow-overlap")!=="never"||Dse(V,"icon-overlap","icon-allow-overlap")!=="never"||V.get("text-ignore-placement")||V.get("icon-ignore-placement"),this.sortFeaturesByKey=Y!=="viewport-y"&&!F.isConstant(),this.sortFeaturesByY=(Y==="viewport-y"||Y==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,V.get("symbol-placement")==="point"&&(this.writingModes=V.get("text-writing-mode").map($=>l.ai[$])),this.stateDependentLayerIds=this.layers.filter($=>$.isStateDependent()).map($=>$.id),this.sourceID=Q.sourceID}createArrays(){this.text=new jse(new Te(this.layers,this.zoom,Q=>/^text/.test(Q))),this.icon=new jse(new Te(this.layers,this.zoom,Q=>/^icon/.test(Q))),this.glyphOffsetArray=new tr,this.lineVertexArray=new pr,this.symbolInstances=new It,this.textAnchorOffsets=new Tr}calculateGlyphDependencies(Q,M,V,F,Y){for(let $=0;$<Q.length;$++)if(M[Q.charCodeAt($)]=!0,(V||F)&&Y){const ce=BM[Q.charAt($)];ce&&(M[ce.charCodeAt(0)]=!0)}}populate(Q,M,V){const F=this.layers[0],Y=F.layout,$=Y.get("text-font"),ce=Y.get("text-field"),Qe=Y.get("icon-image"),Me=(ce.value.kind!=="constant"||ce.value.value instanceof cn&&!ce.value.value.isEmpty()||ce.value.value.toString().length>0)&&($.value.kind!=="constant"||$.value.value.length>0),Fe=Qe.value.kind!=="constant"||!!Qe.value.value||Object.keys(Qe.parameters).length>0,Ze=Y.get("symbol-sort-key");if(this.features=[],!Me&&!Fe)return;const tt=M.iconDependencies,ut=M.glyphDependencies,dt=M.availableImages,xt=new po(this.zoom);for(const{feature:Ot,id:Bt,index:rr,sourceLayerIndex:Wt}of Q){const ir=F._featureFilter.needGeometry,dr=gt(Ot,ir);if(!F._featureFilter.filter(xt,dr,V))continue;let xr,en;if(ir||(dr.geometry=mt(Ot)),Me){const $r=F.getValueAndResolveTokens("text-field",dr,V,dt),Kr=cn.factory($r);LXr(Kr)&&(this.hasRTLText=!0),(!this.hasRTLText||C9()==="unavailable"||this.hasRTLText&&Pl.isParsed())&&(xr=oXr(Kr,F,dr))}if(Fe){const $r=F.getValueAndResolveTokens("icon-image",dr,V,dt);en=$r instanceof ii?$r:ii.fromString($r)}if(!xr&&!en)continue;const yn=this.sortFeaturesByKey?Ze.evaluate(dr,{},V):void 0;if(this.features.push({id:Bt,text:xr,icon:en,index:rr,sourceLayerIndex:Wt,geometry:dr.geometry,properties:Ot.properties,type:_Xr[Ot.type],sortKey:yn}),en&&(tt[en.name]=!0),xr){const $r=$.evaluate(dr,{},V).join(","),Kr=Y.get("text-rotation-alignment")!=="viewport"&&Y.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(l.ai.vertical)>=0;for(const Ur of xr.sections)if(Ur.image)tt[Ur.image.name]=!0;else{const hn=_9(xr.toString()),Wr=Ur.fontStack||$r,Cr=ut[Wr]=ut[Wr]||{};this.calculateGlyphDependencies(Ur.text,Cr,Kr,this.allowVerticalPlacement,hn)}}}Y.get("symbol-placement")==="line"&&(this.features=function(Ot){const Bt={},rr={},Wt=[];let ir=0;function dr($r){Wt.push(Ot[$r]),ir++}function xr($r,Kr,Ur){const hn=rr[$r];return delete rr[$r],rr[Kr]=hn,Wt[hn].geometry[0].pop(),Wt[hn].geometry[0]=Wt[hn].geometry[0].concat(Ur[0]),hn}function en($r,Kr,Ur){const hn=Bt[Kr];return delete Bt[Kr],Bt[$r]=hn,Wt[hn].geometry[0].shift(),Wt[hn].geometry[0]=Ur[0].concat(Wt[hn].geometry[0]),hn}function yn($r,Kr,Ur){const hn=Ur?Kr[0][Kr[0].length-1]:Kr[0][0];return`${$r}:${hn.x}:${hn.y}`}for(let $r=0;$r<Ot.length;$r++){const Kr=Ot[$r],Ur=Kr.geometry,hn=Kr.text?Kr.text.toString():null;if(!hn){dr($r);continue}const Wr=yn(hn,Ur),Cr=yn(hn,Ur,!0);if(Wr in rr&&Cr in Bt&&rr[Wr]!==Bt[Cr]){const kn=en(Wr,Cr,Ur),vn=xr(Wr,Cr,Wt[kn].geometry);delete Bt[Wr],delete rr[Cr],rr[yn(hn,Wt[vn].geometry,!0)]=vn,Wt[kn].geometry=null}else Wr in rr?xr(Wr,Cr,Ur):Cr in Bt?en(Wr,Cr,Ur):(dr($r),Bt[Wr]=ir-1,rr[Cr]=ir-1)}return Wt.filter($r=>$r.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Ot,Bt)=>Ot.sortKey-Bt.sortKey)}update(Q,M,V){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(Q,M,this.layers,V),this.icon.programConfigurations.updatePaintArrays(Q,M,this.layers,V))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(Q){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(Q),this.iconCollisionBox.upload(Q)),this.text.upload(Q,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(Q,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(Q,M){const V=this.lineVertexArray.length;if(Q.segment!==void 0){let F=Q.dist(M[Q.segment+1]),Y=Q.dist(M[Q.segment]);const $={};for(let ce=Q.segment+1;ce<M.length;ce++)$[ce]={x:M[ce].x,y:M[ce].y,tileUnitDistanceFromAnchor:F},ce<M.length-1&&(F+=M[ce+1].dist(M[ce]));for(let ce=Q.segment||0;ce>=0;ce--)$[ce]={x:M[ce].x,y:M[ce].y,tileUnitDistanceFromAnchor:Y},ce>0&&(Y+=M[ce-1].dist(M[ce]));for(let ce=0;ce<M.length;ce++){const Qe=$[ce];this.lineVertexArray.emplaceBack(Qe.x,Qe.y,Qe.tileUnitDistanceFromAnchor)}}return{lineStartIndex:V,lineLength:this.lineVertexArray.length-V}}addSymbols(Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt){const ut=Q.indexArray,dt=Q.layoutVertexArray,xt=Q.segments.prepareSegment(4*M.length,dt,ut,this.canOverlap?$.sortKey:void 0),Ot=this.glyphOffsetArray.length,Bt=xt.vertexLength,rr=this.allowVerticalPlacement&&ce===l.ai.vertical?Math.PI/2:0,Wt=$.text&&$.text.sections;for(let ir=0;ir<M.length;ir++){const{tl:dr,tr:xr,bl:en,br:yn,tex:$r,pixelOffsetTL:Kr,pixelOffsetBR:Ur,minFontScaleX:hn,minFontScaleY:Wr,glyphOffset:Cr,isSDF:kn,sectionIndex:vn}=M[ir],_i=xt.vertexLength,No=Cr[1];vz(dt,Qe.x,Qe.y,dr.x,No+dr.y,$r.x,$r.y,V,kn,Kr.x,Kr.y,hn,Wr),vz(dt,Qe.x,Qe.y,xr.x,No+xr.y,$r.x+$r.w,$r.y,V,kn,Ur.x,Kr.y,hn,Wr),vz(dt,Qe.x,Qe.y,en.x,No+en.y,$r.x,$r.y+$r.h,V,kn,Kr.x,Ur.y,hn,Wr),vz(dt,Qe.x,Qe.y,yn.x,No+yn.y,$r.x+$r.w,$r.y+$r.h,V,kn,Ur.x,Ur.y,hn,Wr),zse(Q.dynamicLayoutVertexArray,Qe,rr),ut.emplaceBack(_i,_i+1,_i+2),ut.emplaceBack(_i+1,_i+2,_i+3),xt.vertexLength+=4,xt.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Cr[0]),ir!==M.length-1&&vn===M[ir+1].sectionIndex||Q.programConfigurations.populatePaintArrays(dt.length,$,$.index,{},tt,Wt&&Wt[vn])}Q.placedSymbolArray.emplaceBack(Qe.x,Qe.y,Ot,this.glyphOffsetArray.length-Ot,Bt,Me,Fe,Qe.segment,V?V[0]:0,V?V[1]:0,F[0],F[1],ce,0,!1,0,Ze)}_addCollisionDebugVertex(Q,M,V,F,Y,$){return M.emplaceBack(0,0),Q.emplaceBack(V.x,V.y,F,Y,Math.round($.x),Math.round($.y))}addCollisionDebugVertices(Q,M,V,F,Y,$,ce){const Qe=Y.segments.prepareSegment(4,Y.layoutVertexArray,Y.indexArray),Me=Qe.vertexLength,Fe=Y.layoutVertexArray,Ze=Y.collisionVertexArray,tt=ce.anchorX,ut=ce.anchorY;this._addCollisionDebugVertex(Fe,Ze,$,tt,ut,new h(Q,M)),this._addCollisionDebugVertex(Fe,Ze,$,tt,ut,new h(V,M)),this._addCollisionDebugVertex(Fe,Ze,$,tt,ut,new h(V,F)),this._addCollisionDebugVertex(Fe,Ze,$,tt,ut,new h(Q,F)),Qe.vertexLength+=4;const dt=Y.indexArray;dt.emplaceBack(Me,Me+1),dt.emplaceBack(Me+1,Me+2),dt.emplaceBack(Me+2,Me+3),dt.emplaceBack(Me+3,Me),Qe.primitiveLength+=4}addDebugCollisionBoxes(Q,M,V,F){for(let Y=Q;Y<M;Y++){const $=this.collisionBoxArray.get(Y);this.addCollisionDebugVertices($.x1,$.y1,$.x2,$.y2,F?this.textCollisionBox:this.iconCollisionBox,$.anchorPoint,V)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Use(Go,Sqe.members,Za),this.iconCollisionBox=new Use(Go,Sqe.members,Za);for(let Q=0;Q<this.symbolInstances.length;Q++){const M=this.symbolInstances.get(Q);this.addDebugCollisionBoxes(M.textBoxStartIndex,M.textBoxEndIndex,M,!0),this.addDebugCollisionBoxes(M.verticalTextBoxStartIndex,M.verticalTextBoxEndIndex,M,!0),this.addDebugCollisionBoxes(M.iconBoxStartIndex,M.iconBoxEndIndex,M,!1),this.addDebugCollisionBoxes(M.verticalIconBoxStartIndex,M.verticalIconBoxEndIndex,M,!1)}}_deserializeCollisionBoxesForSymbol(Q,M,V,F,Y,$,ce,Qe,Me){const Fe={};for(let Ze=M;Ze<V;Ze++){const tt=Q.get(Ze);Fe.textBox={x1:tt.x1,y1:tt.y1,x2:tt.x2,y2:tt.y2,anchorPointX:tt.anchorPointX,anchorPointY:tt.anchorPointY},Fe.textFeatureIndex=tt.featureIndex;break}for(let Ze=F;Ze<Y;Ze++){const tt=Q.get(Ze);Fe.verticalTextBox={x1:tt.x1,y1:tt.y1,x2:tt.x2,y2:tt.y2,anchorPointX:tt.anchorPointX,anchorPointY:tt.anchorPointY},Fe.verticalTextFeatureIndex=tt.featureIndex;break}for(let Ze=$;Ze<ce;Ze++){const tt=Q.get(Ze);Fe.iconBox={x1:tt.x1,y1:tt.y1,x2:tt.x2,y2:tt.y2,anchorPointX:tt.anchorPointX,anchorPointY:tt.anchorPointY},Fe.iconFeatureIndex=tt.featureIndex;break}for(let Ze=Qe;Ze<Me;Ze++){const tt=Q.get(Ze);Fe.verticalIconBox={x1:tt.x1,y1:tt.y1,x2:tt.x2,y2:tt.y2,anchorPointX:tt.anchorPointX,anchorPointY:tt.anchorPointY},Fe.verticalIconFeatureIndex=tt.featureIndex;break}return Fe}deserializeCollisionBoxes(Q){this.collisionArrays=[];for(let M=0;M<this.symbolInstances.length;M++){const V=this.symbolInstances.get(M);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(Q,V.textBoxStartIndex,V.textBoxEndIndex,V.verticalTextBoxStartIndex,V.verticalTextBoxEndIndex,V.iconBoxStartIndex,V.iconBoxEndIndex,V.verticalIconBoxStartIndex,V.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(Q,M){const V=Q.placedSymbolArray.get(M),F=V.vertexStartIndex+4*V.numGlyphs;for(let Y=V.vertexStartIndex;Y<F;Y+=4)Q.indexArray.emplaceBack(Y,Y+1,Y+2),Q.indexArray.emplaceBack(Y+1,Y+2,Y+3)}getSortedSymbolIndexes(Q){if(this.sortedAngle===Q&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const M=Math.sin(Q),V=Math.cos(Q),F=[],Y=[],$=[];for(let ce=0;ce<this.symbolInstances.length;++ce){$.push(ce);const Qe=this.symbolInstances.get(ce);F.push(0|Math.round(M*Qe.anchorX+V*Qe.anchorY)),Y.push(Qe.featureIndex)}return $.sort((ce,Qe)=>F[ce]-F[Qe]||Y[Qe]-Y[ce]),$}addToSortKeyRanges(Q,M){const V=this.sortKeyRanges[this.sortKeyRanges.length-1];V&&V.sortKey===M?V.symbolInstanceEnd=Q+1:this.sortKeyRanges.push({sortKey:M,symbolInstanceStart:Q,symbolInstanceEnd:Q+1})}sortFeatures(Q){if(this.sortFeaturesByY&&this.sortedAngle!==Q&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(Q),this.sortedAngle=Q,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const M of this.symbolInstanceIndexes){const V=this.symbolInstances.get(M);this.featureSortOrder.push(V.featureIndex),[V.rightJustifiedTextSymbolIndex,V.centerJustifiedTextSymbolIndex,V.leftJustifiedTextSymbolIndex].forEach((F,Y,$)=>{F>=0&&$.indexOf(F)===Y&&this.addIndicesForPlacedSymbol(this.text,F)}),V.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,V.verticalPlacedTextSymbolIndex),V.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,V.placedIconSymbolIndex),V.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,V.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let jqe,Uqe;sn("SymbolBucket",wb,{omit:["layers","collisionBoxArray","features","compareText"]}),wb.MAX_GLYPHS=65535,wb.addDynamicAttributes=zse;var Gse={get paint(){return Uqe=Uqe||new oa({"icon-opacity":new Mn(Re.paint_symbol["icon-opacity"]),"icon-color":new Mn(Re.paint_symbol["icon-color"]),"icon-halo-color":new Mn(Re.paint_symbol["icon-halo-color"]),"icon-halo-width":new Mn(Re.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Mn(Re.paint_symbol["icon-halo-blur"]),"icon-translate":new Tn(Re.paint_symbol["icon-translate"]),"icon-translate-anchor":new Tn(Re.paint_symbol["icon-translate-anchor"]),"text-opacity":new Mn(Re.paint_symbol["text-opacity"]),"text-color":new Mn(Re.paint_symbol["text-color"],{runtimeType:kt,getOverride:S=>S.textColor,hasOverride:S=>!!S.textColor}),"text-halo-color":new Mn(Re.paint_symbol["text-halo-color"]),"text-halo-width":new Mn(Re.paint_symbol["text-halo-width"]),"text-halo-blur":new Mn(Re.paint_symbol["text-halo-blur"]),"text-translate":new Tn(Re.paint_symbol["text-translate"]),"text-translate-anchor":new Tn(Re.paint_symbol["text-translate-anchor"])})},get layout(){return jqe=jqe||new oa({"symbol-placement":new Tn(Re.layout_symbol["symbol-placement"]),"symbol-spacing":new Tn(Re.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Tn(Re.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Mn(Re.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Tn(Re.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Tn(Re.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Tn(Re.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Tn(Re.layout_symbol["icon-ignore-placement"]),"icon-optional":new Tn(Re.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Tn(Re.layout_symbol["icon-rotation-alignment"]),"icon-size":new Mn(Re.layout_symbol["icon-size"]),"icon-text-fit":new Tn(Re.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Tn(Re.layout_symbol["icon-text-fit-padding"]),"icon-image":new Mn(Re.layout_symbol["icon-image"]),"icon-rotate":new Mn(Re.layout_symbol["icon-rotate"]),"icon-padding":new Mn(Re.layout_symbol["icon-padding"]),"icon-keep-upright":new Tn(Re.layout_symbol["icon-keep-upright"]),"icon-offset":new Mn(Re.layout_symbol["icon-offset"]),"icon-anchor":new Mn(Re.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Tn(Re.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Tn(Re.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Tn(Re.layout_symbol["text-rotation-alignment"]),"text-field":new Mn(Re.layout_symbol["text-field"]),"text-font":new Mn(Re.layout_symbol["text-font"]),"text-size":new Mn(Re.layout_symbol["text-size"]),"text-max-width":new Mn(Re.layout_symbol["text-max-width"]),"text-line-height":new Tn(Re.layout_symbol["text-line-height"]),"text-letter-spacing":new Mn(Re.layout_symbol["text-letter-spacing"]),"text-justify":new Mn(Re.layout_symbol["text-justify"]),"text-radial-offset":new Mn(Re.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Tn(Re.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Mn(Re.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Mn(Re.layout_symbol["text-anchor"]),"text-max-angle":new Tn(Re.layout_symbol["text-max-angle"]),"text-writing-mode":new Tn(Re.layout_symbol["text-writing-mode"]),"text-rotate":new Mn(Re.layout_symbol["text-rotate"]),"text-padding":new Tn(Re.layout_symbol["text-padding"]),"text-keep-upright":new Tn(Re.layout_symbol["text-keep-upright"]),"text-transform":new Mn(Re.layout_symbol["text-transform"]),"text-offset":new Mn(Re.layout_symbol["text-offset"]),"text-allow-overlap":new Tn(Re.layout_symbol["text-allow-overlap"]),"text-overlap":new Tn(Re.layout_symbol["text-overlap"]),"text-ignore-placement":new Tn(Re.layout_symbol["text-ignore-placement"]),"text-optional":new Tn(Re.layout_symbol["text-optional"])})}};class Gqe{constructor(Q){if(Q.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=Q.property.overrides?Q.property.overrides.runtimeType:Jt,this.defaultValue=Q}evaluate(Q){if(Q.formattedSection){const M=this.defaultValue.property.overrides;if(M&&M.hasOverride(Q.formattedSection))return M.getOverride(Q.formattedSection)}return Q.feature&&Q.featureState?this.defaultValue.evaluate(Q.feature,Q.featureState):this.defaultValue.property.specification.default}eachChild(Q){this.defaultValue.isConstant()||Q(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}sn("FormatSectionOverride",Gqe,{omit:["defaultValue"]});class Qz extends Tc{constructor(Q){super(Q,Gse)}recalculate(Q,M){if(super.recalculate(Q,M),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const V=this.layout.get("text-writing-mode");if(V){const F=[];for(const Y of V)F.indexOf(Y)<0&&F.push(Y);this.layout._values["text-writing-mode"]=F}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(Q,M,V,F){const Y=this.layout.get(Q).evaluate(M,{},V,F),$=this._unevaluatedLayout._values[Q];return $.isDataDriven()||x6($.value)||!Y?Y:function(ce,Qe){return Qe.replace(/{([^{}]+)}/g,(Me,Fe)=>ce&&Fe in ce?String(ce[Fe]):"")}(M.properties,Y)}createBucket(Q){return new wb(Q)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const Q of Gse.paint.overridableProperties){if(!Qz.hasPaintOverride(this.layout,Q))continue;const M=this.paint.get(Q),V=new Gqe(M),F=new m9(V,M.property.specification);let Y=null;Y=M.value.kind==="constant"||M.value.kind==="source"?new g9("source",F):new Bf("composite",F,M.value.zoomStops),this.paint._values[Q]=new pl(M.property,Y,M.parameters)}}_handleOverridablePaintPropertyUpdate(Q,M,V){return!(!this.layout||M.isDataDriven()||V.isDataDriven())&&Qz.hasPaintOverride(this.layout,Q)}static hasPaintOverride(Q,M){const V=Q.get("text-field"),F=Gse.paint.properties[M];let Y=!1;const $=ce=>{for(const Qe of ce)if(F.overrides&&F.overrides.hasOverride(Qe))return void(Y=!0)};if(V.value.kind==="constant"&&V.value.value instanceof cn)$(V.value.value.sections);else if(V.value.kind==="source"){const ce=Me=>{Y||(Me instanceof qa&&Qn(Me.value)===je?$(Me.value.sections):Me instanceof su?$(Me.sections):Me.eachChild(ce))},Qe=V.value;Qe._styleExpression&&ce(Qe._styleExpression.expression)}return Y}}let qqe;var SXr={get paint(){return qqe=qqe||new oa({"background-color":new Tn(Re.paint_background["background-color"]),"background-pattern":new B6(Re.paint_background["background-pattern"]),"background-opacity":new Tn(Re.paint_background["background-opacity"])})}};class kXr extends Tc{constructor(Q){super(Q,SXr)}}let Wqe;var MXr={get paint(){return Wqe=Wqe||new oa({"raster-opacity":new Tn(Re.paint_raster["raster-opacity"]),"raster-hue-rotate":new Tn(Re.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Tn(Re.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Tn(Re.paint_raster["raster-brightness-max"]),"raster-saturation":new Tn(Re.paint_raster["raster-saturation"]),"raster-contrast":new Tn(Re.paint_raster["raster-contrast"]),"raster-resampling":new Tn(Re.paint_raster["raster-resampling"]),"raster-fade-duration":new Tn(Re.paint_raster["raster-fade-duration"])})}};class CXr extends Tc{constructor(Q){super(Q,MXr)}}class EXr extends Tc{constructor(Q){super(Q,{}),this.onAdd=M=>{this.implementation.onAdd&&this.implementation.onAdd(M,M.painter.context.gl)},this.onRemove=M=>{this.implementation.onRemove&&this.implementation.onRemove(M,M.painter.context.gl)},this.implementation=Q}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class AXr{constructor(Q){this._callback=Q,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const qse=63710088e-1;class i8{constructor(Q,M){if(isNaN(Q)||isNaN(M))throw new Error(`Invalid LngLat object: (${Q}, ${M})`);if(this.lng=+Q,this.lat=+M,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new i8(k(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(Q){const M=Math.PI/180,V=this.lat*M,F=Q.lat*M,Y=Math.sin(V)*Math.sin(F)+Math.cos(V)*Math.cos(F)*Math.cos((Q.lng-this.lng)*M);return qse*Math.acos(Math.min(Y,1))}static convert(Q){if(Q instanceof i8)return Q;if(Array.isArray(Q)&&(Q.length===2||Q.length===3))return new i8(Number(Q[0]),Number(Q[1]));if(!Array.isArray(Q)&&typeof Q=="object"&&Q!==null)return new i8(Number("lng"in Q?Q.lng:Q.lon),Number(Q.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Zqe=2*Math.PI*qse;function Kqe(S){return Zqe*Math.cos(S*Math.PI/180)}function Xqe(S){return(180+S)/360}function Jqe(S){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+S*Math.PI/360)))/360}function Yqe(S,Q){return S/Kqe(Q)}function $qe(S){return 360*S-180}function Wse(S){return 360/Math.PI*Math.atan(Math.exp((180-360*S)*Math.PI/180))-90}class bz{constructor(Q,M,V=0){this.x=+Q,this.y=+M,this.z=+V}static fromLngLat(Q,M=0){const V=i8.convert(Q);return new bz(Xqe(V.lng),Jqe(V.lat),Yqe(M,V.lat))}toLngLat(){return new i8($qe(this.x),Wse(this.y))}toAltitude(){return this.z*Kqe(Wse(this.y))}meterInMercatorCoordinateUnits(){return 1/Zqe*(Q=Wse(this.y),1/Math.cos(Q*Math.PI/180));var Q}}function eWe(S,Q,M){var V=2*Math.PI*6378137/256/Math.pow(2,M);return[S*V-2*Math.PI*6378137/2,Q*V-2*Math.PI*6378137/2]}class Zse{constructor(Q,M,V){if(Q<0||Q>25||V<0||V>=Math.pow(2,Q)||M<0||M>=Math.pow(2,Q))throw new Error(`x=${M}, y=${V}, z=${Q} outside of bounds. 0<=x<${Math.pow(2,Q)}, 0<=y<${Math.pow(2,Q)} 0<=z<=25 `);this.z=Q,this.x=M,this.y=V,this.key=zM(0,Q,Q,M,V)}equals(Q){return this.z===Q.z&&this.x===Q.x&&this.y===Q.y}url(Q,M,V){const F=($=this.y,ce=this.z,Qe=eWe(256*(Y=this.x),256*($=Math.pow(2,ce)-$-1),ce),Me=eWe(256*(Y+1),256*($+1),ce),Qe[0]+","+Qe[1]+","+Me[0]+","+Me[1]);var Y,$,ce,Qe,Me;const Fe=function(Ze,tt,ut){let dt,xt="";for(let Ot=Ze;Ot>0;Ot--)dt=1<<Ot-1,xt+=(tt&dt?1:0)+(ut&dt?2:0);return xt}(this.z,this.x,this.y);return Q[(this.x+this.y)%Q.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(V==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,M>1?"@2x":"").replace(/{quadkey}/g,Fe).replace(/{bbox-epsg-3857}/g,F)}isChildOf(Q){const M=this.z-Q.z;return M>0&&Q.x===this.x>>M&&Q.y===this.y>>M}getTilePoint(Q){const M=Math.pow(2,this.z);return new h((Q.x*M-this.x)*ze,(Q.y*M-this.y)*ze)}toString(){return`${this.z}/${this.x}/${this.y}`}}class tWe{constructor(Q,M){this.wrap=Q,this.canonical=M,this.key=zM(Q,M.z,M.z,M.x,M.y)}}class J2{constructor(Q,M,V,F,Y){if(Q<V)throw new Error(`overscaledZ should be >= z; overscaledZ = ${Q}; z = ${V}`);this.overscaledZ=Q,this.wrap=M,this.canonical=new Zse(V,+F,+Y),this.key=zM(M,Q,V,F,Y)}clone(){return new J2(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(Q){return this.overscaledZ===Q.overscaledZ&&this.wrap===Q.wrap&&this.canonical.equals(Q.canonical)}scaledTo(Q){if(Q>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${Q}; overscaledZ = ${this.overscaledZ}`);const M=this.canonical.z-Q;return Q>this.canonical.z?new J2(Q,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new J2(Q,this.wrap,Q,this.canonical.x>>M,this.canonical.y>>M)}calculateScaledKey(Q,M){if(Q>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${Q}; overscaledZ = ${this.overscaledZ}`);const V=this.canonical.z-Q;return Q>this.canonical.z?zM(this.wrap*+M,Q,this.canonical.z,this.canonical.x,this.canonical.y):zM(this.wrap*+M,Q,Q,this.canonical.x>>V,this.canonical.y>>V)}isChildOf(Q){if(Q.wrap!==this.wrap)return!1;const M=this.canonical.z-Q.canonical.z;return Q.overscaledZ===0||Q.overscaledZ<this.overscaledZ&&Q.canonical.x===this.canonical.x>>M&&Q.canonical.y===this.canonical.y>>M}children(Q){if(this.overscaledZ>=Q)return[new J2(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const M=this.canonical.z+1,V=2*this.canonical.x,F=2*this.canonical.y;return[new J2(M,this.wrap,M,V,F),new J2(M,this.wrap,M,V+1,F),new J2(M,this.wrap,M,V,F+1),new J2(M,this.wrap,M,V+1,F+1)]}isLessThan(Q){return this.wrap<Q.wrap||!(this.wrap>Q.wrap)&&(this.overscaledZ<Q.overscaledZ||!(this.overscaledZ>Q.overscaledZ)&&(this.canonical.x<Q.canonical.x||!(this.canonical.x>Q.canonical.x)&&this.canonical.y<Q.canonical.y))}wrapped(){return new J2(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(Q){return new J2(this.overscaledZ,Q,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new tWe(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(Q){return this.canonical.getTilePoint(new bz(Q.x-this.wrap,Q.y))}}function zM(S,Q,M,V,F){(S*=2)<0&&(S=-1*S-1);const Y=1<<M;return(Y*Y*S+Y*F+V).toString(36)+M.toString(36)+Q.toString(36)}sn("CanonicalTileID",Zse),sn("OverscaledTileID",J2,{omit:["posMatrix"]});class rWe{constructor(Q,M,V,F=1,Y=1,$=1,ce=0){if(this.uid=Q,M.height!==M.width)throw new RangeError("DEM tiles must be square");if(V&&!["mapbox","terrarium","custom"].includes(V))return void D(`"${V}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=M.height;const Qe=this.dim=M.height-2;switch(this.data=new Uint32Array(M.data.buffer),V){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=F,this.greenFactor=Y,this.blueFactor=$,this.baseShift=ce;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let Me=0;Me<Qe;Me++)this.data[this._idx(-1,Me)]=this.data[this._idx(0,Me)],this.data[this._idx(Qe,Me)]=this.data[this._idx(Qe-1,Me)],this.data[this._idx(Me,-1)]=this.data[this._idx(Me,0)],this.data[this._idx(Me,Qe)]=this.data[this._idx(Me,Qe-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(Qe,-1)]=this.data[this._idx(Qe-1,0)],this.data[this._idx(-1,Qe)]=this.data[this._idx(0,Qe-1)],this.data[this._idx(Qe,Qe)]=this.data[this._idx(Qe-1,Qe-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let Me=0;Me<Qe;Me++)for(let Fe=0;Fe<Qe;Fe++){const Ze=this.get(Me,Fe);Ze>this.max&&(this.max=Ze),Ze<this.min&&(this.min=Ze)}}get(Q,M){const V=new Uint8Array(this.data.buffer),F=4*this._idx(Q,M);return this.unpack(V[F],V[F+1],V[F+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(Q,M){if(Q<-1||Q>=this.dim+1||M<-1||M>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(M+1)*this.stride+(Q+1)}unpack(Q,M,V){return Q*this.redFactor+M*this.greenFactor+V*this.blueFactor-this.baseShift}getPixels(){return new _a({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(Q,M,V){if(this.dim!==Q.dim)throw new Error("dem dimension mismatch");let F=M*this.dim,Y=M*this.dim+this.dim,$=V*this.dim,ce=V*this.dim+this.dim;switch(M){case-1:F=Y-1;break;case 1:Y=F+1}switch(V){case-1:$=ce-1;break;case 1:ce=$+1}const Qe=-M*this.dim,Me=-V*this.dim;for(let Fe=$;Fe<ce;Fe++)for(let Ze=F;Ze<Y;Ze++)this.data[this._idx(Ze,Fe)]=Q.data[this._idx(Ze+Qe,Fe+Me)]}}sn("DEMData",rWe);class nWe{constructor(Q){this._stringToNumber={},this._numberToString=[];for(let M=0;M<Q.length;M++){const V=Q[M];this._stringToNumber[V]=M,this._numberToString[M]=V}}encode(Q){return this._stringToNumber[Q]}decode(Q){if(Q>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${Q} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[Q]}}class iWe{constructor(Q,M,V,F,Y){this.type="Feature",this._vectorTileFeature=Q,Q._z=M,Q._x=V,Q._y=F,this.properties=Q.properties,this.id=Y}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(Q){this._geometry=Q}toJSON(){const Q={geometry:this.geometry};for(const M in this)M!=="_geometry"&&M!=="_vectorTileFeature"&&(Q[M]=this[M]);return Q}}class oWe{constructor(Q,M){this.tileID=Q,this.x=Q.canonical.x,this.y=Q.canonical.y,this.z=Q.canonical.z,this.grid=new d4(ze,16,0),this.grid3D=new d4(ze,16,0),this.featureIndexArray=new br,this.promoteId=M}insert(Q,M,V,F,Y,$){const ce=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(V,F,Y);const Qe=$?this.grid3D:this.grid;for(let Me=0;Me<M.length;Me++){const Fe=M[Me],Ze=[1/0,1/0,-1/0,-1/0];for(let tt=0;tt<Fe.length;tt++){const ut=Fe[tt];Ze[0]=Math.min(Ze[0],ut.x),Ze[1]=Math.min(Ze[1],ut.y),Ze[2]=Math.max(Ze[2],ut.x),Ze[3]=Math.max(Ze[3],ut.y)}Ze[0]<ze&&Ze[1]<ze&&Ze[2]>=0&&Ze[3]>=0&&Qe.insert(ce,Ze[0],Ze[1],Ze[2],Ze[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new t8.VectorTile(new Pse(this.rawTileData)).layers,this.sourceLayerCoder=new nWe(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(Q,M,V,F){this.loadVTLayers();const Y=Q.params||{},$=ze/Q.tileSize/Q.scale,ce=T9(Y.filter),Qe=Q.queryGeometry,Me=Q.queryPadding*$,Fe=sWe(Qe),Ze=this.grid.query(Fe.minX-Me,Fe.minY-Me,Fe.maxX+Me,Fe.maxY+Me),tt=sWe(Q.cameraQueryGeometry),ut=this.grid3D.query(tt.minX-Me,tt.minY-Me,tt.maxX+Me,tt.maxY+Me,(Ot,Bt,rr,Wt)=>function(ir,dr,xr,en,yn){for(const Kr of ir)if(dr<=Kr.x&&xr<=Kr.y&&en>=Kr.x&&yn>=Kr.y)return!0;const $r=[new h(dr,xr),new h(dr,yn),new h(en,yn),new h(en,xr)];if(ir.length>2){for(const Kr of $r)if(Hr(ir,Kr))return!0}for(let Kr=0;Kr<ir.length-1;Kr++)if(on(ir[Kr],ir[Kr+1],$r))return!0;return!1}(Q.cameraQueryGeometry,Ot-Me,Bt-Me,rr+Me,Wt+Me));for(const Ot of ut)Ze.push(Ot);Ze.sort(OXr);const dt={};let xt;for(let Ot=0;Ot<Ze.length;Ot++){const Bt=Ze[Ot];if(Bt===xt)continue;xt=Bt;const rr=this.featureIndexArray.get(Bt);let Wt=null;this.loadMatchingFeature(dt,rr.bucketIndex,rr.sourceLayerIndex,rr.featureIndex,ce,Y.layers,Y.availableImages,M,V,F,(ir,dr,xr)=>(Wt||(Wt=mt(ir)),dr.queryIntersectsFeature(Qe,ir,xr,Wt,this.z,Q.transform,$,Q.pixelPosMatrix)))}return dt}loadMatchingFeature(Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze){const tt=this.bucketLayerIDs[M];if($&&!function(Ot,Bt){for(let rr=0;rr<Ot.length;rr++)if(Bt.indexOf(Ot[rr])>=0)return!0;return!1}($,tt))return;const ut=this.sourceLayerCoder.decode(V),dt=this.vtLayers[ut].feature(F);if(Y.needGeometry){const Ot=gt(dt,!0);if(!Y.filter(new po(this.tileID.overscaledZ),Ot,this.tileID.canonical))return}else if(!Y.filter(new po(this.tileID.overscaledZ),dt))return;const xt=this.getId(dt,ut);for(let Ot=0;Ot<tt.length;Ot++){const Bt=tt[Ot];if($&&$.indexOf(Bt)<0)continue;const rr=Qe[Bt];if(!rr)continue;let Wt={};xt&&Fe&&(Wt=Fe.getState(rr.sourceLayer||"_geojsonTileLayer",xt));const ir=C({},Me[Bt]);ir.paint=aWe(ir.paint,rr.paint,dt,Wt,ce),ir.layout=aWe(ir.layout,rr.layout,dt,Wt,ce);const dr=!Ze||Ze(dt,rr,Wt);if(!dr)continue;const xr=new iWe(dt,this.z,this.x,this.y,xt);xr.layer=ir;let en=Q[Bt];en===void 0&&(en=Q[Bt]=[]),en.push({featureIndex:F,feature:xr,intersectionZ:dr})}}lookupSymbolFeatures(Q,M,V,F,Y,$,ce,Qe){const Me={};this.loadVTLayers();const Fe=T9(Y);for(const Ze of Q)this.loadMatchingFeature(Me,V,F,Ze,Fe,$,ce,Qe,M);return Me}hasLayer(Q){for(const M of this.bucketLayerIDs)for(const V of M)if(Q===V)return!0;return!1}getId(Q,M){let V=Q.id;return this.promoteId&&(V=Q.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[M]],typeof V=="boolean"&&(V=Number(V))),V}}function aWe(S,Q,M,V,F){return O(S,(Y,$)=>{const ce=Q instanceof Kf?Q.get($):null;return ce&&ce.evaluate?ce.evaluate(M,V,F):ce})}function sWe(S){let Q=1/0,M=1/0,V=-1/0,F=-1/0;for(const Y of S)Q=Math.min(Q,Y.x),M=Math.min(M,Y.y),V=Math.max(V,Y.x),F=Math.max(F,Y.y);return{minX:Q,minY:M,maxX:V,maxY:F}}function OXr(S,Q){return Q-S}function lWe(S,Q,M,V,F){const Y=[];for(let $=0;$<S.length;$++){const ce=S[$];let Qe;for(let Me=0;Me<ce.length-1;Me++){let Fe=ce[Me],Ze=ce[Me+1];Fe.x<Q&&Ze.x<Q||(Fe.x<Q?Fe=new h(Q,Fe.y+(Q-Fe.x)/(Ze.x-Fe.x)*(Ze.y-Fe.y))._round():Ze.x<Q&&(Ze=new h(Q,Fe.y+(Q-Fe.x)/(Ze.x-Fe.x)*(Ze.y-Fe.y))._round()),Fe.y<M&&Ze.y<M||(Fe.y<M?Fe=new h(Fe.x+(M-Fe.y)/(Ze.y-Fe.y)*(Ze.x-Fe.x),M)._round():Ze.y<M&&(Ze=new h(Fe.x+(M-Fe.y)/(Ze.y-Fe.y)*(Ze.x-Fe.x),M)._round()),Fe.x>=V&&Ze.x>=V||(Fe.x>=V?Fe=new h(V,Fe.y+(V-Fe.x)/(Ze.x-Fe.x)*(Ze.y-Fe.y))._round():Ze.x>=V&&(Ze=new h(V,Fe.y+(V-Fe.x)/(Ze.x-Fe.x)*(Ze.y-Fe.y))._round()),Fe.y>=F&&Ze.y>=F||(Fe.y>=F?Fe=new h(Fe.x+(F-Fe.y)/(Ze.y-Fe.y)*(Ze.x-Fe.x),F)._round():Ze.y>=F&&(Ze=new h(Fe.x+(F-Fe.y)/(Ze.y-Fe.y)*(Ze.x-Fe.x),F)._round()),Qe&&Fe.equals(Qe[Qe.length-1])||(Qe=[Fe],Y.push(Qe)),Qe.push(Ze)))))}}return Y}sn("FeatureIndex",oWe,{omit:["rawTileData","sourceLayerCoder"]});class o8 extends h{constructor(Q,M,V,F){super(Q,M),this.angle=V,F!==void 0&&(this.segment=F)}clone(){return new o8(this.x,this.y,this.angle,this.segment)}}function cWe(S,Q,M,V,F){if(Q.segment===void 0||M===0)return!0;let Y=Q,$=Q.segment+1,ce=0;for(;ce>-M/2;){if($--,$<0)return!1;ce-=S[$].dist(Y),Y=S[$]}ce+=S[$].dist(S[$+1]),$++;const Qe=[];let Me=0;for(;ce<M/2;){const Fe=S[$],Ze=S[$+1];if(!Ze)return!1;let tt=S[$-1].angleTo(Fe)-Fe.angleTo(Ze);for(tt=Math.abs((tt+3*Math.PI)%(2*Math.PI)-Math.PI),Qe.push({distance:ce,angleDelta:tt}),Me+=tt;ce-Qe[0].distance>V;)Me-=Qe.shift().angleDelta;if(Me>F)return!1;$++,ce+=Fe.dist(Ze)}return!0}function uWe(S){let Q=0;for(let M=0;M<S.length-1;M++)Q+=S[M].dist(S[M+1]);return Q}function dWe(S,Q,M){return S?.6*Q*M:0}function pWe(S,Q){return Math.max(S?S.right-S.left:0,Q?Q.right-Q.left:0)}function HXr(S,Q,M,V,F,Y){const $=dWe(M,F,Y),ce=pWe(M,V)*Y;let Qe=0;const Me=uWe(S)/2;for(let Fe=0;Fe<S.length-1;Fe++){const Ze=S[Fe],tt=S[Fe+1],ut=Ze.dist(tt);if(Qe+ut>Me){const dt=(Me-Qe)/ut,xt=fc.number(Ze.x,tt.x,dt),Ot=fc.number(Ze.y,tt.y,dt),Bt=new o8(xt,Ot,tt.angleTo(Ze),Fe);return Bt._round(),!$||cWe(S,Bt,ce,$,Q)?Bt:void 0}Qe+=ut}}function VXr(S,Q,M,V,F,Y,$,ce,Qe){const Me=dWe(V,Y,$),Fe=pWe(V,F),Ze=Fe*$,tt=S[0].x===0||S[0].x===Qe||S[0].y===0||S[0].y===Qe;return Q-Ze<Q/4&&(Q=Ze+Q/4),hWe(S,tt?Q/2*ce%Q:(Fe/2+2*Y)*$*ce%Q,Q,Me,M,Ze,tt,!1,Qe)}function hWe(S,Q,M,V,F,Y,$,ce,Qe){const Me=Y/2,Fe=uWe(S);let Ze=0,tt=Q-M,ut=[];for(let dt=0;dt<S.length-1;dt++){const xt=S[dt],Ot=S[dt+1],Bt=xt.dist(Ot),rr=Ot.angleTo(xt);for(;tt+M<Ze+Bt;){tt+=M;const Wt=(tt-Ze)/Bt,ir=fc.number(xt.x,Ot.x,Wt),dr=fc.number(xt.y,Ot.y,Wt);if(ir>=0&&ir<Qe&&dr>=0&&dr<Qe&&tt-Me>=0&&tt+Me<=Fe){const xr=new o8(ir,dr,rr,dt);xr._round(),V&&!cWe(S,xr,Y,V,F)||ut.push(xr)}}Ze+=Bt}return ce||ut.length||$||(ut=hWe(S,Ze/2,M,V,F,Y,$,!0,Qe)),ut}sn("Anchor",o8);const Lb=T1;function fWe(S,Q,M,V){const F=[],Y=S.image,$=Y.pixelRatio,ce=Y.paddedRect.w-2*Lb,Qe=Y.paddedRect.h-2*Lb,Me=S.right-S.left,Fe=S.bottom-S.top,Ze=Y.stretchX||[[0,ce]],tt=Y.stretchY||[[0,Qe]],ut=(Ur,hn)=>Ur+hn[1]-hn[0],dt=Ze.reduce(ut,0),xt=tt.reduce(ut,0),Ot=ce-dt,Bt=Qe-xt;let rr=0,Wt=dt,ir=0,dr=xt,xr=0,en=Ot,yn=0,$r=Bt;if(Y.content&&V){const Ur=Y.content;rr=xz(Ze,0,Ur[0]),ir=xz(tt,0,Ur[1]),Wt=xz(Ze,Ur[0],Ur[2]),dr=xz(tt,Ur[1],Ur[3]),xr=Ur[0]-rr,yn=Ur[1]-ir,en=Ur[2]-Ur[0]-Wt,$r=Ur[3]-Ur[1]-dr}const Kr=(Ur,hn,Wr,Cr)=>{const kn=_z(Ur.stretch-rr,Wt,Me,S.left),vn=wz(Ur.fixed-xr,en,Ur.stretch,dt),_i=_z(hn.stretch-ir,dr,Fe,S.top),No=wz(hn.fixed-yn,$r,hn.stretch,xt),Ko=_z(Wr.stretch-rr,Wt,Me,S.left),Ms=wz(Wr.fixed-xr,en,Wr.stretch,dt),f2=_z(Cr.stretch-ir,dr,Fe,S.top),qc=wz(Cr.fixed-yn,$r,Cr.stretch,xt),as=new h(kn,_i),ml=new h(Ko,_i),Fl=new h(Ko,f2),Wc=new h(kn,f2),Zc=new h(vn/$,No/$),Cs=new h(Ms/$,qc/$),Es=Q*Math.PI/180;if(Es){const xc=Math.sin(Es),v1=Math.cos(Es),Q1=[v1,-xc,xc,v1];as._matMult(Q1),ml._matMult(Q1),Wc._matMult(Q1),Fl._matMult(Q1)}const bc=Ur.stretch+Ur.fixed,Kc=hn.stretch+hn.fixed;return{tl:as,tr:ml,bl:Wc,br:Fl,tex:{x:Y.paddedRect.x+Lb+bc,y:Y.paddedRect.y+Lb+Kc,w:Wr.stretch+Wr.fixed-bc,h:Cr.stretch+Cr.fixed-Kc},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Zc,pixelOffsetBR:Cs,minFontScaleX:en/$/Me,minFontScaleY:$r/$/Fe,isSDF:M}};if(V&&(Y.stretchX||Y.stretchY)){const Ur=mWe(Ze,Ot,dt),hn=mWe(tt,Bt,xt);for(let Wr=0;Wr<Ur.length-1;Wr++){const Cr=Ur[Wr],kn=Ur[Wr+1];for(let vn=0;vn<hn.length-1;vn++)F.push(Kr(Cr,hn[vn],kn,hn[vn+1]))}}else F.push(Kr({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:ce+1},{fixed:0,stretch:Qe+1}));return F}function xz(S,Q,M){let V=0;for(const F of S)V+=Math.max(Q,Math.min(M,F[1]))-Math.max(Q,Math.min(M,F[0]));return V}function mWe(S,Q,M){const V=[{fixed:-Lb,stretch:0}];for(const[F,Y]of S){const $=V[V.length-1];V.push({fixed:F-$.stretch,stretch:$.stretch}),V.push({fixed:F-$.stretch,stretch:$.stretch+(Y-F)})}return V.push({fixed:Q+Lb,stretch:M}),V}function _z(S,Q,M,V){return S/Q*M+V}function wz(S,Q,M,V){return S-Q*M/V}class Lz{constructor(Q,M,V,F,Y,$,ce,Qe,Me,Fe){if(this.boxStartIndex=Q.length,Me){let Ze=$.top,tt=$.bottom;const ut=$.collisionPadding;ut&&(Ze-=ut[1],tt+=ut[3]);let dt=tt-Ze;dt>0&&(dt=Math.max(10,dt),this.circleDiameter=dt)}else{let Ze=$.top*ce-Qe[0],tt=$.bottom*ce+Qe[2],ut=$.left*ce-Qe[3],dt=$.right*ce+Qe[1];const xt=$.collisionPadding;if(xt&&(ut-=xt[0]*ce,Ze-=xt[1]*ce,dt+=xt[2]*ce,tt+=xt[3]*ce),Fe){const Ot=new h(ut,Ze),Bt=new h(dt,Ze),rr=new h(ut,tt),Wt=new h(dt,tt),ir=Fe*Math.PI/180;Ot._rotate(ir),Bt._rotate(ir),rr._rotate(ir),Wt._rotate(ir),ut=Math.min(Ot.x,Bt.x,rr.x,Wt.x),dt=Math.max(Ot.x,Bt.x,rr.x,Wt.x),Ze=Math.min(Ot.y,Bt.y,rr.y,Wt.y),tt=Math.max(Ot.y,Bt.y,rr.y,Wt.y)}Q.emplaceBack(M.x,M.y,ut,Ze,dt,tt,V,F,Y)}this.boxEndIndex=Q.length}}class IXr{constructor(Q=[],M=PXr){if(this.data=Q,this.length=this.data.length,this.compare=M,this.length>0)for(let V=(this.length>>1)-1;V>=0;V--)this._down(V)}push(Q){this.data.push(Q),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const Q=this.data[0],M=this.data.pop();return this.length--,this.length>0&&(this.data[0]=M,this._down(0)),Q}peek(){return this.data[0]}_up(Q){const{data:M,compare:V}=this,F=M[Q];for(;Q>0;){const Y=Q-1>>1,$=M[Y];if(V(F,$)>=0)break;M[Q]=$,Q=Y}M[Q]=F}_down(Q){const{data:M,compare:V}=this,F=this.length>>1,Y=M[Q];for(;Q<F;){let $=1+(Q<<1),ce=M[$];const Qe=$+1;if(Qe<this.length&&V(M[Qe],ce)<0&&($=Qe,ce=M[Qe]),V(ce,Y)>=0)break;M[Q]=ce,Q=$}M[Q]=Y}}function PXr(S,Q){return S<Q?-1:S>Q?1:0}function NXr(S,Q=1,M=!1){let V=1/0,F=1/0,Y=-1/0,$=-1/0;const ce=S[0];for(let ut=0;ut<ce.length;ut++){const dt=ce[ut];(!ut||dt.x<V)&&(V=dt.x),(!ut||dt.y<F)&&(F=dt.y),(!ut||dt.x>Y)&&(Y=dt.x),(!ut||dt.y>$)&&($=dt.y)}const Qe=Math.min(Y-V,$-F);let Me=Qe/2;const Fe=new IXr([],BXr);if(Qe===0)return new h(V,F);for(let ut=V;ut<Y;ut+=Qe)for(let dt=F;dt<$;dt+=Qe)Fe.push(new Sb(ut+Me,dt+Me,Me,S));let Ze=function(ut){let dt=0,xt=0,Ot=0;const Bt=ut[0];for(let rr=0,Wt=Bt.length,ir=Wt-1;rr<Wt;ir=rr++){const dr=Bt[rr],xr=Bt[ir],en=dr.x*xr.y-xr.x*dr.y;xt+=(dr.x+xr.x)*en,Ot+=(dr.y+xr.y)*en,dt+=3*en}return new Sb(xt/dt,Ot/dt,0,ut)}(S),tt=Fe.length;for(;Fe.length;){const ut=Fe.pop();(ut.d>Ze.d||!Ze.d)&&(Ze=ut,M&&console.log("found best %d after %d probes",Math.round(1e4*ut.d)/1e4,tt)),ut.max-Ze.d<=Q||(Me=ut.h/2,Fe.push(new Sb(ut.p.x-Me,ut.p.y-Me,Me,S)),Fe.push(new Sb(ut.p.x+Me,ut.p.y-Me,Me,S)),Fe.push(new Sb(ut.p.x-Me,ut.p.y+Me,Me,S)),Fe.push(new Sb(ut.p.x+Me,ut.p.y+Me,Me,S)),tt+=4)}return M&&(console.log(`num probes: ${tt}`),console.log(`best distance: ${Ze.d}`)),Ze.p}function BXr(S,Q){return Q.max-S.max}function Sb(S,Q,M,V){this.p=new h(S,Q),this.h=M,this.d=function(F,Y){let $=!1,ce=1/0;for(let Qe=0;Qe<Y.length;Qe++){const Me=Y[Qe];for(let Fe=0,Ze=Me.length,tt=Ze-1;Fe<Ze;tt=Fe++){const ut=Me[Fe],dt=Me[tt];ut.y>F.y!=dt.y>F.y&&F.x<(dt.x-ut.x)*(F.y-ut.y)/(dt.y-ut.y)+ut.x&&($=!$),ce=Math.min(ce,Vr(F,ut,dt))}}return($?1:-1)*Math.sqrt(ce)}(this.p,V),this.max=this.d+this.h*Math.SQRT2}var Rl;l.aq=void 0,(Rl=l.aq||(l.aq={}))[Rl.center=1]="center",Rl[Rl.left=2]="left",Rl[Rl.right=3]="right",Rl[Rl.top=4]="top",Rl[Rl.bottom=5]="bottom",Rl[Rl["top-left"]=6]="top-left",Rl[Rl["top-right"]=7]="top-right",Rl[Rl["bottom-left"]=8]="bottom-left",Rl[Rl["bottom-right"]=9]="bottom-right";const a8=7,Kse=Number.POSITIVE_INFINITY;function gWe(S,Q){return Q[1]!==Kse?function(M,V,F){let Y=0,$=0;switch(V=Math.abs(V),F=Math.abs(F),M){case"top-right":case"top-left":case"top":$=F-a8;break;case"bottom-right":case"bottom-left":case"bottom":$=-F+a8}switch(M){case"top-right":case"bottom-right":case"right":Y=-V;break;case"top-left":case"bottom-left":case"left":Y=V}return[Y,$]}(S,Q[0],Q[1]):function(M,V){let F=0,Y=0;V<0&&(V=0);const $=V/Math.SQRT2;switch(M){case"top-right":case"top-left":Y=$-a8;break;case"bottom-right":case"bottom-left":Y=-$+a8;break;case"bottom":Y=-V+a8;break;case"top":Y=V-a8}switch(M){case"top-right":case"bottom-right":F=-$;break;case"top-left":case"bottom-left":F=$;break;case"left":F=V;break;case"right":F=-V}return[F,Y]}(S,Q[0])}function yWe(S,Q,M){var V;const F=S.layout,Y=(V=F.get("text-variable-anchor-offset"))===null||V===void 0?void 0:V.evaluate(Q,{},M);if(Y){const ce=Y.values,Qe=[];for(let Me=0;Me<ce.length;Me+=2){const Fe=Qe[Me]=ce[Me],Ze=ce[Me+1].map(tt=>tt*ks);Fe.startsWith("top")?Ze[1]-=a8:Fe.startsWith("bottom")&&(Ze[1]+=a8),Qe[Me+1]=Ze}return new si(Qe)}const $=F.get("text-variable-anchor");if($){let ce;ce=S._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[F.get("text-radial-offset").evaluate(Q,{},M)*ks,Kse]:F.get("text-offset").evaluate(Q,{},M).map(Me=>Me*ks);const Qe=[];for(const Me of $)Qe.push(Me,gWe(Me,ce));return new si(Qe)}return null}function Xse(S){switch(S){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function RXr(S,Q,M,V,F,Y,$,ce,Qe,Me,Fe){let Ze=Y.textMaxSize.evaluate(Q,{});Ze===void 0&&(Ze=$);const tt=S.layers[0].layout,ut=tt.get("icon-offset").evaluate(Q,{},Fe),dt=vWe(M.horizontal),xt=$/24,Ot=S.tilePixelRatio*xt,Bt=S.tilePixelRatio*Ze/24,rr=S.tilePixelRatio*ce,Wt=S.tilePixelRatio*tt.get("symbol-spacing"),ir=tt.get("text-padding")*S.tilePixelRatio,dr=function(Cr,kn,vn,_i=1){const No=Cr.get("icon-padding").evaluate(kn,{},vn),Ko=No&&No.values;return[Ko[0]*_i,Ko[1]*_i,Ko[2]*_i,Ko[3]*_i]}(tt,Q,Fe,S.tilePixelRatio),xr=tt.get("text-max-angle")/180*Math.PI,en=tt.get("text-rotation-alignment")!=="viewport"&&tt.get("symbol-placement")!=="point",yn=tt.get("icon-rotation-alignment")==="map"&&tt.get("symbol-placement")!=="point",$r=tt.get("symbol-placement"),Kr=Wt/2,Ur=tt.get("icon-text-fit");let hn;V&&Ur!=="none"&&(S.allowVerticalPlacement&&M.vertical&&(hn=Dqe(V,M.vertical,Ur,tt.get("icon-text-fit-padding"),ut,xt)),dt&&(V=Dqe(V,dt,Ur,tt.get("icon-text-fit-padding"),ut,xt)));const Wr=(Cr,kn)=>{kn.x<0||kn.x>=ze||kn.y<0||kn.y>=ze||function(vn,_i,No,Ko,Ms,f2,qc,as,ml,Fl,Wc,Zc,Cs,Es,bc,Kc,xc,v1,Q1,As,Ei,_c,Dl,Os,hu){const A3=vn.addToLineVertexArray(_i,No);let O3,U6,fu,Y2,b1=0,G6=0,GM=0,_We=0,ile=-1,ole=-1;const q6={};let wWe=K2("");if(vn.allowVerticalPlacement&&Ko.vertical){const wc=as.layout.get("text-rotate").evaluate(Ei,{},Os)+90;fu=new Lz(ml,_i,Fl,Wc,Zc,Ko.vertical,Cs,Es,bc,wc),qc&&(Y2=new Lz(ml,_i,Fl,Wc,Zc,qc,xc,v1,bc,wc))}if(Ms){const wc=as.layout.get("icon-rotate").evaluate(Ei,{}),$2=as.layout.get("icon-text-fit")!=="none",B9=fWe(Ms,wc,Dl,$2),V3=qc?fWe(qc,wc,Dl,$2):void 0;U6=new Lz(ml,_i,Fl,Wc,Zc,Ms,xc,v1,!1,wc),b1=4*B9.length;const R9=vn.iconSizeData;let b4=null;R9.kind==="source"?(b4=[Q4*as.layout.get("icon-size").evaluate(Ei,{})],b4[0]>n8&&D(`${vn.layerIds[0]}: Value for "icon-size" is >= ${DM}. Reduce your "icon-size".`)):R9.kind==="composite"&&(b4=[Q4*_c.compositeIconSizes[0].evaluate(Ei,{},Os),Q4*_c.compositeIconSizes[1].evaluate(Ei,{},Os)],(b4[0]>n8||b4[1]>n8)&&D(`${vn.layerIds[0]}: Value for "icon-size" is >= ${DM}. Reduce your "icon-size".`)),vn.addSymbols(vn.icon,B9,b4,As,Q1,Ei,l.ai.none,_i,A3.lineStartIndex,A3.lineLength,-1,Os),ile=vn.icon.placedSymbolArray.length-1,V3&&(G6=4*V3.length,vn.addSymbols(vn.icon,V3,b4,As,Q1,Ei,l.ai.vertical,_i,A3.lineStartIndex,A3.lineLength,-1,Os),ole=vn.icon.placedSymbolArray.length-1)}const LWe=Object.keys(Ko.horizontal);for(const wc of LWe){const $2=Ko.horizontal[wc];if(!O3){wWe=K2($2.text);const V3=as.layout.get("text-rotate").evaluate(Ei,{},Os);O3=new Lz(ml,_i,Fl,Wc,Zc,$2,Cs,Es,bc,V3)}const B9=$2.positionedLines.length===1;if(GM+=TWe(vn,_i,$2,f2,as,bc,Ei,Kc,A3,Ko.vertical?l.ai.horizontal:l.ai.horizontalOnly,B9?LWe:[wc],q6,ile,_c,Os),B9)break}Ko.vertical&&(_We+=TWe(vn,_i,Ko.vertical,f2,as,bc,Ei,Kc,A3,l.ai.vertical,["vertical"],q6,ole,_c,Os));const zXr=O3?O3.boxStartIndex:vn.collisionBoxArray.length,jXr=O3?O3.boxEndIndex:vn.collisionBoxArray.length,UXr=fu?fu.boxStartIndex:vn.collisionBoxArray.length,GXr=fu?fu.boxEndIndex:vn.collisionBoxArray.length,qXr=U6?U6.boxStartIndex:vn.collisionBoxArray.length,WXr=U6?U6.boxEndIndex:vn.collisionBoxArray.length,ZXr=Y2?Y2.boxStartIndex:vn.collisionBoxArray.length,KXr=Y2?Y2.boxEndIndex:vn.collisionBoxArray.length;let H3=-1;const kz=(wc,$2)=>wc&&wc.circleDiameter?Math.max(wc.circleDiameter,$2):$2;H3=kz(O3,H3),H3=kz(fu,H3),H3=kz(U6,H3),H3=kz(Y2,H3);const SWe=H3>-1?1:0;SWe&&(H3*=hu/ks),vn.glyphOffsetArray.length>=wb.MAX_GLYPHS&&D("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Ei.sortKey!==void 0&&vn.addToSortKeyRanges(vn.symbolInstances.length,Ei.sortKey);const XXr=yWe(as,Ei,Os),[JXr,YXr]=function(wc,$2){const B9=wc.length,V3=$2==null?void 0:$2.values;if((V3==null?void 0:V3.length)>0)for(let R9=0;R9<V3.length;R9+=2){const b4=V3[R9+1];wc.emplaceBack(l.aq[V3[R9]],b4[0],b4[1])}return[B9,wc.length]}(vn.textAnchorOffsets,XXr);vn.symbolInstances.emplaceBack(_i.x,_i.y,q6.right>=0?q6.right:-1,q6.center>=0?q6.center:-1,q6.left>=0?q6.left:-1,q6.vertical||-1,ile,ole,wWe,zXr,jXr,UXr,GXr,qXr,WXr,ZXr,KXr,Fl,GM,_We,b1,G6,SWe,0,Cs,H3,JXr,YXr)}(S,kn,Cr,M,V,F,hn,S.layers[0],S.collisionBoxArray,Q.index,Q.sourceLayerIndex,S.index,Ot,[ir,ir,ir,ir],en,Qe,rr,dr,yn,ut,Q,Y,Me,Fe,$)};if($r==="line")for(const Cr of lWe(Q.geometry,0,0,ze,ze)){const kn=VXr(Cr,Wt,xr,M.vertical||dt,V,24,Bt,S.overscaling,ze);for(const vn of kn)dt&&FXr(S,dt.text,Kr,vn)||Wr(Cr,vn)}else if($r==="line-center"){for(const Cr of Q.geometry)if(Cr.length>1){const kn=HXr(Cr,xr,M.vertical||dt,V,24,Bt);kn&&Wr(Cr,kn)}}else if(Q.type==="Polygon")for(const Cr of Mse(Q.geometry,0)){const kn=NXr(Cr,16);Wr(Cr[0],new o8(kn.x,kn.y,0))}else if(Q.type==="LineString")for(const Cr of Q.geometry)Wr(Cr,new o8(Cr[0].x,Cr[0].y,0));else if(Q.type==="Point")for(const Cr of Q.geometry)for(const kn of Cr)Wr([kn],new o8(kn.x,kn.y,0))}function TWe(S,Q,M,V,F,Y,$,ce,Qe,Me,Fe,Ze,tt,ut,dt){const xt=function(rr,Wt,ir,dr,xr,en,yn,$r){const Kr=dr.layout.get("text-rotate").evaluate(en,{})*Math.PI/180,Ur=[];for(const hn of Wt.positionedLines)for(const Wr of hn.positionedGlyphs){if(!Wr.rect)continue;const Cr=Wr.rect||{};let kn=Vqe+1,vn=!0,_i=1,No=0;const Ko=(xr||$r)&&Wr.vertical,Ms=Wr.metrics.advance*Wr.scale/2;if($r&&Wt.verticalizable&&(No=hn.lineOffset/2-(Wr.imageName?-(ks-Wr.metrics.width*Wr.scale)/2:(Wr.scale-1)*ks)),Wr.imageName){const As=yn[Wr.imageName];vn=As.sdf,_i=As.pixelRatio,kn=T1/_i}const f2=xr?[Wr.x+Ms,Wr.y]:[0,0];let qc=xr?[0,0]:[Wr.x+Ms+ir[0],Wr.y+ir[1]-No],as=[0,0];Ko&&(as=qc,qc=[0,0]);const ml=Wr.metrics.isDoubleResolution?2:1,Fl=(Wr.metrics.left-kn)*Wr.scale-Ms+qc[0],Wc=(-Wr.metrics.top-kn)*Wr.scale+qc[1],Zc=Fl+Cr.w/ml*Wr.scale/_i,Cs=Wc+Cr.h/ml*Wr.scale/_i,Es=new h(Fl,Wc),bc=new h(Zc,Wc),Kc=new h(Fl,Cs),xc=new h(Zc,Cs);if(Ko){const As=new h(-Ms,Ms-RM),Ei=-Math.PI/2,_c=ks/2-Ms,Dl=new h(5-RM-_c,-(Wr.imageName?_c:0)),Os=new h(...as);Es._rotateAround(Ei,As)._add(Dl)._add(Os),bc._rotateAround(Ei,As)._add(Dl)._add(Os),Kc._rotateAround(Ei,As)._add(Dl)._add(Os),xc._rotateAround(Ei,As)._add(Dl)._add(Os)}if(Kr){const As=Math.sin(Kr),Ei=Math.cos(Kr),_c=[Ei,-As,As,Ei];Es._matMult(_c),bc._matMult(_c),Kc._matMult(_c),xc._matMult(_c)}const v1=new h(0,0),Q1=new h(0,0);Ur.push({tl:Es,tr:bc,bl:Kc,br:xc,tex:Cr,writingMode:Wt.writingMode,glyphOffset:f2,sectionIndex:Wr.sectionIndex,isSDF:vn,pixelOffsetTL:v1,pixelOffsetBR:Q1,minFontScaleX:0,minFontScaleY:0})}return Ur}(0,M,ce,F,Y,$,V,S.allowVerticalPlacement),Ot=S.textSizeData;let Bt=null;Ot.kind==="source"?(Bt=[Q4*F.layout.get("text-size").evaluate($,{})],Bt[0]>n8&&D(`${S.layerIds[0]}: Value for "text-size" is >= ${DM}. Reduce your "text-size".`)):Ot.kind==="composite"&&(Bt=[Q4*ut.compositeTextSizes[0].evaluate($,{},dt),Q4*ut.compositeTextSizes[1].evaluate($,{},dt)],(Bt[0]>n8||Bt[1]>n8)&&D(`${S.layerIds[0]}: Value for "text-size" is >= ${DM}. Reduce your "text-size".`)),S.addSymbols(S.text,xt,Bt,ce,Y,$,Me,Q,Qe.lineStartIndex,Qe.lineLength,tt,dt);for(const rr of Fe)Ze[rr]=S.text.placedSymbolArray.length-1;return 4*xt.length}function vWe(S){for(const Q in S)return S[Q];return null}function FXr(S,Q,M,V){const F=S.compareText;if(Q in F){const Y=F[Q];for(let $=Y.length-1;$>=0;$--)if(V.dist(Y[$])<M)return!0}else F[Q]=[];return F[Q].push(V),!1}const QWe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Jse{static from(Q){if(!(Q instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[M,V]=new Uint8Array(Q,0,2);if(M!==219)throw new Error("Data does not appear to be in a KDBush format.");const F=V>>4;if(F!==1)throw new Error(`Got v${F} data when expected v1.`);const Y=QWe[15&V];if(!Y)throw new Error("Unrecognized array type.");const[$]=new Uint16Array(Q,2,1),[ce]=new Uint32Array(Q,4,1);return new Jse(ce,$,Y,Q)}constructor(Q,M=64,V=Float64Array,F){if(isNaN(Q)||Q<0)throw new Error(`Unpexpected numItems value: ${Q}.`);this.numItems=+Q,this.nodeSize=Math.min(Math.max(+M,2),65535),this.ArrayType=V,this.IndexArrayType=Q<65536?Uint16Array:Uint32Array;const Y=QWe.indexOf(this.ArrayType),$=2*Q*this.ArrayType.BYTES_PER_ELEMENT,ce=Q*this.IndexArrayType.BYTES_PER_ELEMENT,Qe=(8-ce%8)%8;if(Y<0)throw new Error(`Unexpected typed array class: ${V}.`);F&&F instanceof ArrayBuffer?(this.data=F,this.ids=new this.IndexArrayType(this.data,8,Q),this.coords=new this.ArrayType(this.data,8+ce+Qe,2*Q),this._pos=2*Q,this._finished=!0):(this.data=new ArrayBuffer(8+$+ce+Qe),this.ids=new this.IndexArrayType(this.data,8,Q),this.coords=new this.ArrayType(this.data,8+ce+Qe,2*Q),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Y]),new Uint16Array(this.data,2,1)[0]=M,new Uint32Array(this.data,4,1)[0]=Q)}add(Q,M){const V=this._pos>>1;return this.ids[V]=V,this.coords[this._pos++]=Q,this.coords[this._pos++]=M,V}finish(){const Q=this._pos>>1;if(Q!==this.numItems)throw new Error(`Added ${Q} items when expected ${this.numItems}.`);return Yse(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(Q,M,V,F){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Y,coords:$,nodeSize:ce}=this,Qe=[0,Y.length-1,0],Me=[];for(;Qe.length;){const Fe=Qe.pop()||0,Ze=Qe.pop()||0,tt=Qe.pop()||0;if(Ze-tt<=ce){for(let Ot=tt;Ot<=Ze;Ot++){const Bt=$[2*Ot],rr=$[2*Ot+1];Bt>=Q&&Bt<=V&&rr>=M&&rr<=F&&Me.push(Y[Ot])}continue}const ut=tt+Ze>>1,dt=$[2*ut],xt=$[2*ut+1];dt>=Q&&dt<=V&&xt>=M&&xt<=F&&Me.push(Y[ut]),(Fe===0?Q<=dt:M<=xt)&&(Qe.push(tt),Qe.push(ut-1),Qe.push(1-Fe)),(Fe===0?V>=dt:F>=xt)&&(Qe.push(ut+1),Qe.push(Ze),Qe.push(1-Fe))}return Me}within(Q,M,V){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:F,coords:Y,nodeSize:$}=this,ce=[0,F.length-1,0],Qe=[],Me=V*V;for(;ce.length;){const Fe=ce.pop()||0,Ze=ce.pop()||0,tt=ce.pop()||0;if(Ze-tt<=$){for(let Ot=tt;Ot<=Ze;Ot++)xWe(Y[2*Ot],Y[2*Ot+1],Q,M)<=Me&&Qe.push(F[Ot]);continue}const ut=tt+Ze>>1,dt=Y[2*ut],xt=Y[2*ut+1];xWe(dt,xt,Q,M)<=Me&&Qe.push(F[ut]),(Fe===0?Q-V<=dt:M-V<=xt)&&(ce.push(tt),ce.push(ut-1),ce.push(1-Fe)),(Fe===0?Q+V>=dt:M+V>=xt)&&(ce.push(ut+1),ce.push(Ze),ce.push(1-Fe))}return Qe}}function Yse(S,Q,M,V,F,Y){if(F-V<=M)return;const $=V+F>>1;bWe(S,Q,$,V,F,Y),Yse(S,Q,M,V,$-1,1-Y),Yse(S,Q,M,$+1,F,1-Y)}function bWe(S,Q,M,V,F,Y){for(;F>V;){if(F-V>600){const Me=F-V+1,Fe=M-V+1,Ze=Math.log(Me),tt=.5*Math.exp(2*Ze/3),ut=.5*Math.sqrt(Ze*tt*(Me-tt)/Me)*(Fe-Me/2<0?-1:1);bWe(S,Q,M,Math.max(V,Math.floor(M-Fe*tt/Me+ut)),Math.min(F,Math.floor(M+(Me-Fe)*tt/Me+ut)),Y)}const $=Q[2*M+Y];let ce=V,Qe=F;for(jM(S,Q,V,M),Q[2*F+Y]>$&&jM(S,Q,V,F);ce<Qe;){for(jM(S,Q,ce,Qe),ce++,Qe--;Q[2*ce+Y]<$;)ce++;for(;Q[2*Qe+Y]>$;)Qe--}Q[2*V+Y]===$?jM(S,Q,V,Qe):(Qe++,jM(S,Q,Qe,F)),Qe<=M&&(V=Qe+1),M<=Qe&&(F=Qe-1)}}function jM(S,Q,M,V){$se(S,M,V),$se(Q,2*M,2*V),$se(Q,2*M+1,2*V+1)}function $se(S,Q,M){const V=S[Q];S[Q]=S[M],S[M]=V}function xWe(S,Q,M,V){const F=S-M,Y=Q-V;return F*F+Y*Y}var ele;l.bh=void 0,(ele=l.bh||(l.bh={})).create="create",ele.load="load",ele.fullLoad="fullLoad";let Sz=null,UM=[];const tle=1e3/60,rle="loadTime",nle="fullLoadTime",DXr={mark(S){performance.mark(S)},frame(S){const Q=S;Sz!=null&&UM.push(Q-Sz),Sz=Q},clearMetrics(){Sz=null,UM=[],performance.clearMeasures(rle),performance.clearMeasures(nle);for(const S in l.bh)performance.clearMarks(l.bh[S])},getPerformanceMetrics(){performance.measure(rle,l.bh.create,l.bh.load),performance.measure(nle,l.bh.create,l.bh.fullLoad);const S=performance.getEntriesByName(rle)[0].duration,Q=performance.getEntriesByName(nle)[0].duration,M=UM.length,V=1/(UM.reduce((Y,$)=>Y+$,0)/M/1e3),F=UM.filter(Y=>Y>tle).reduce((Y,$)=>Y+($-tle)/tle,0);return{loadTime:S,fullLoadTime:Q,fps:V,percentDroppedFrames:F/(M+F)*100,totalFrames:M}}};l.$=function(S,Q,M){var V,F,Y,$,ce,Qe,Me,Fe,Ze,tt,ut,dt,xt=M[0],Ot=M[1],Bt=M[2];return Q===S?(S[12]=Q[0]*xt+Q[4]*Ot+Q[8]*Bt+Q[12],S[13]=Q[1]*xt+Q[5]*Ot+Q[9]*Bt+Q[13],S[14]=Q[2]*xt+Q[6]*Ot+Q[10]*Bt+Q[14],S[15]=Q[3]*xt+Q[7]*Ot+Q[11]*Bt+Q[15]):(F=Q[1],Y=Q[2],$=Q[3],ce=Q[4],Qe=Q[5],Me=Q[6],Fe=Q[7],Ze=Q[8],tt=Q[9],ut=Q[10],dt=Q[11],S[0]=V=Q[0],S[1]=F,S[2]=Y,S[3]=$,S[4]=ce,S[5]=Qe,S[6]=Me,S[7]=Fe,S[8]=Ze,S[9]=tt,S[10]=ut,S[11]=dt,S[12]=V*xt+ce*Ot+Ze*Bt+Q[12],S[13]=F*xt+Qe*Ot+tt*Bt+Q[13],S[14]=Y*xt+Me*Ot+ut*Bt+Q[14],S[15]=$*xt+Fe*Ot+dt*Bt+Q[15]),S},l.A=Mr,l.B=fc,l.C=class{constructor(S,Q,M){this.receive=V=>{const F=V.data,Y=F.id;if(Y&&(!F.targetMapId||this.mapId===F.targetMapId))if(F.type==="<cancel>"){delete this.tasks[Y];const $=this.cancelCallbacks[Y];delete this.cancelCallbacks[Y],$&&$()}else P()||F.mustQueue?(this.tasks[Y]=F,this.taskQueue.push(Y),this.invoker.trigger()):this.processTask(Y,F)},this.process=()=>{if(!this.taskQueue.length)return;const V=this.taskQueue.shift(),F=this.tasks[V];delete this.tasks[V],this.taskQueue.length&&this.invoker.trigger(),F&&this.processTask(V,F)},this.target=S,this.parent=Q,this.mapId=M,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new AXr(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=P()?S:window}send(S,Q,M,V,F=!1){const Y=Math.round(1e18*Math.random()).toString(36).substring(0,10);M&&(this.callbacks[Y]=M);const $=[],ce={id:Y,type:S,hasCallback:!!M,targetMapId:V,mustQueue:F,sourceMapId:this.mapId,data:cu(Q,$)};return this.target.postMessage(ce,{transfer:$}),{cancel:()=>{M&&delete this.callbacks[Y],this.target.postMessage({id:Y,type:"<cancel>",targetMapId:V,sourceMapId:this.mapId})}}}processTask(S,Q){if(Q.type==="<response>"){const M=this.callbacks[S];delete this.callbacks[S],M&&(Q.error?M(p4(Q.error)):M(null,p4(Q.data)))}else{let M=!1;const V=[],F=Q.hasCallback?(ce,Qe)=>{M=!0,delete this.cancelCallbacks[S];const Me={id:S,type:"<response>",sourceMapId:this.mapId,error:ce?cu(ce):null,data:cu(Qe,V)};this.target.postMessage(Me,{transfer:V})}:ce=>{M=!0};let Y=null;const $=p4(Q.data);if(this.parent[Q.type])Y=this.parent[Q.type](Q.sourceMapId,$,F);else if("getWorkerSource"in this.parent){const ce=Q.type.split(".");Y=this.parent.getWorkerSource(Q.sourceMapId,ce[0],$.source)[ce[1]]($,F)}else F(new Error(`Could not find function ${Q.type}`));!M&&Y&&Y.cancel&&(this.cancelCallbacks[S]=Y.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},l.D=Tn,l.E=it,l.F=function(S,Q){const M={};for(let V=0;V<Q.length;V++){const F=Q[V];F in S&&(M[F]=S[F])}return M},l.G=Xqe,l.H=Jqe,l.I=Bse,l.J=v,l.K=_,l.L=i8,l.M=X,l.N=ze,l.O=J2,l.P=h,l.Q=Po,l.R=_a,l.S=io,l.T=N6,l.U=bz,l.V=class extends pu{},l.W=Zse,l.X=function(S,Q){const M=window.document.createElement("video");M.muted=!0,M.onloadstart=function(){Q(null,M)};for(let V=0;V<S.length;V++){const F=window.document.createElement("source");qe(S[V])||(M.crossOrigin="Anonymous"),F.src=S[V],M.appendChild(F)}return{cancel:()=>{}}},l.Y=Je,l.Z=function(){var S=new Mr(16);return Mr!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=0,S[12]=0,S[13]=0,S[14]=0),S[0]=1,S[5]=1,S[10]=1,S[15]=1,S},l._=c,l.a=K,l.a$=class extends st{},l.a0=function(S,Q,M){var V=M[0],F=M[1],Y=M[2];return S[0]=Q[0]*V,S[1]=Q[1]*V,S[2]=Q[2]*V,S[3]=Q[3]*V,S[4]=Q[4]*F,S[5]=Q[5]*F,S[6]=Q[6]*F,S[7]=Q[7]*F,S[8]=Q[8]*Y,S[9]=Q[9]*Y,S[10]=Q[10]*Y,S[11]=Q[11]*Y,S[12]=Q[12],S[13]=Q[13],S[14]=Q[14],S[15]=Q[15],S},l.a1=Un,l.a2=function(){return A++},l.a3=Ct,l.a4=wb,l.a5=function(){Pl.isLoading()||Pl.isLoaded()||C9()!=="deferred"||E9()},l.a6=T9,l.a7=gt,l.a8=po,l.a9=iWe,l.aA=V6,l.aB=function(S){S=S.slice();const Q=Object.create(null);for(let M=0;M<S.length;M++)Q[S[M].id]=S[M];for(let M=0;M<S.length;M++)"ref"in S[M]&&(S[M]=yt(S[M],Q[S[M].ref]));return S},l.aC=function(S){if(S.type==="custom")return new EXr(S);switch(S.type){case"background":return new kXr(S);case"circle":return new Zs(S);case"fill":return new AKr(S);case"fill-extrusion":return new qKr(S);case"heatmap":return new p2(S);case"hillshade":return new $f(S);case"line":return new eXr(S);case"raster":return new CXr(S);case"symbol":return new Qz(S)}},l.aD=I,l.aE=function(S,Q){if(!S)return[{command:xe.setStyle,args:[Q]}];let M=[];try{if(!ct(S.version,Q.version))return[{command:xe.setStyle,args:[Q]}];ct(S.center,Q.center)||M.push({command:xe.setCenter,args:[Q.center]}),ct(S.zoom,Q.zoom)||M.push({command:xe.setZoom,args:[Q.zoom]}),ct(S.bearing,Q.bearing)||M.push({command:xe.setBearing,args:[Q.bearing]}),ct(S.pitch,Q.pitch)||M.push({command:xe.setPitch,args:[Q.pitch]}),ct(S.sprite,Q.sprite)||M.push({command:xe.setSprite,args:[Q.sprite]}),ct(S.glyphs,Q.glyphs)||M.push({command:xe.setGlyphs,args:[Q.glyphs]}),ct(S.transition,Q.transition)||M.push({command:xe.setTransition,args:[Q.transition]}),ct(S.light,Q.light)||M.push({command:xe.setLight,args:[Q.light]});const V={},F=[];(function($,ce,Qe,Me){let Fe;for(Fe in ce=ce||{},$=$||{})Object.prototype.hasOwnProperty.call($,Fe)&&(Object.prototype.hasOwnProperty.call(ce,Fe)||$e(Fe,Qe,Me));for(Fe in ce)Object.prototype.hasOwnProperty.call(ce,Fe)&&(Object.prototype.hasOwnProperty.call($,Fe)?ct($[Fe],ce[Fe])||($[Fe].type==="geojson"&&ce[Fe].type==="geojson"&&Ht($,ce,Fe)?Qe.push({command:xe.setGeoJSONSourceData,args:[Fe,ce[Fe].data]}):at(Fe,ce,Qe,Me)):Ue(Fe,ce,Qe))})(S.sources,Q.sources,F,V);const Y=[];S.layers&&S.layers.forEach($=>{V[$.source]?M.push({command:xe.removeLayer,args:[$.id]}):Y.push($)}),M=M.concat(F),function($,ce,Qe){ce=ce||[];const Me=($=$||[]).map(Ft),Fe=ce.map(Ft),Ze=$.reduce(Gt,{}),tt=ce.reduce(Gt,{}),ut=Me.slice(),dt=Object.create(null);let xt,Ot,Bt,rr,Wt,ir,dr;for(xt=0,Ot=0;xt<Me.length;xt++)Bt=Me[xt],Object.prototype.hasOwnProperty.call(tt,Bt)?Ot++:(Qe.push({command:xe.removeLayer,args:[Bt]}),ut.splice(ut.indexOf(Bt,Ot),1));for(xt=0,Ot=0;xt<Fe.length;xt++)Bt=Fe[Fe.length-1-xt],ut[ut.length-1-xt]!==Bt&&(Object.prototype.hasOwnProperty.call(Ze,Bt)?(Qe.push({command:xe.removeLayer,args:[Bt]}),ut.splice(ut.lastIndexOf(Bt,ut.length-Ot),1)):Ot++,ir=ut[ut.length-xt],Qe.push({command:xe.addLayer,args:[tt[Bt],ir]}),ut.splice(ut.length-xt,0,Bt),dt[Bt]=!0);for(xt=0;xt<Fe.length;xt++)if(Bt=Fe[xt],rr=Ze[Bt],Wt=tt[Bt],!dt[Bt]&&!ct(rr,Wt))if(ct(rr.source,Wt.source)&&ct(rr["source-layer"],Wt["source-layer"])&&ct(rr.type,Wt.type)){for(dr in Vt(rr.layout,Wt.layout,Qe,Bt,null,xe.setLayoutProperty),Vt(rr.paint,Wt.paint,Qe,Bt,null,xe.setPaintProperty),ct(rr.filter,Wt.filter)||Qe.push({command:xe.setFilter,args:[Bt,Wt.filter]}),ct(rr.minzoom,Wt.minzoom)&&ct(rr.maxzoom,Wt.maxzoom)||Qe.push({command:xe.setLayerZoomRange,args:[Bt,Wt.minzoom,Wt.maxzoom]}),rr)Object.prototype.hasOwnProperty.call(rr,dr)&&dr!=="layout"&&dr!=="paint"&&dr!=="filter"&&dr!=="metadata"&&dr!=="minzoom"&&dr!=="maxzoom"&&(dr.indexOf("paint.")===0?Vt(rr[dr],Wt[dr],Qe,Bt,dr.slice(6),xe.setPaintProperty):ct(rr[dr],Wt[dr])||Qe.push({command:xe.setLayerProperty,args:[Bt,dr,Wt[dr]]}));for(dr in Wt)Object.prototype.hasOwnProperty.call(Wt,dr)&&!Object.prototype.hasOwnProperty.call(rr,dr)&&dr!=="layout"&&dr!=="paint"&&dr!=="filter"&&dr!=="metadata"&&dr!=="minzoom"&&dr!=="maxzoom"&&(dr.indexOf("paint.")===0?Vt(rr[dr],Wt[dr],Qe,Bt,dr.slice(6),xe.setPaintProperty):ct(rr[dr],Wt[dr])||Qe.push({command:xe.setLayerProperty,args:[Bt,dr,Wt[dr]]}))}else Qe.push({command:xe.removeLayer,args:[Bt]}),ir=ut[ut.lastIndexOf(Bt)+1],Qe.push({command:xe.addLayer,args:[Wt,ir]})}(Y,Q.layers,M)}catch(V){console.warn("Unable to compute style diff:",V),M=[{command:xe.setStyle,args:[Q]}]}return M},l.aF=function(S){const Q=[],M=S.id;return M===void 0&&Q.push({message:`layers.${M}: missing required property "id"`}),S.render===void 0&&Q.push({message:`layers.${M}: missing required method "render"`}),S.renderingMode&&S.renderingMode!=="2d"&&S.renderingMode!=="3d"&&Q.push({message:`layers.${M}: property "renderingMode" must be either "2d" or "3d"`}),Q},l.aG=function S(Q,M){if(Array.isArray(Q)){if(!Array.isArray(M)||Q.length!==M.length)return!1;for(let V=0;V<Q.length;V++)if(!S(Q[V],M[V]))return!1;return!0}if(typeof Q=="object"&&Q!==null&&M!==null){if(typeof M!="object"||Object.keys(Q).length!==Object.keys(M).length)return!1;for(const V in Q)if(!S(Q[V],M[V]))return!1;return!0}return Q===M},l.aH=O,l.aI=N,l.aJ=I6,l.aK=function(S){return S({pluginStatus:Ws,pluginURL:uu}),I6.on("pluginStateChange",S),S},l.aL=class extends C3{constructor(S,Q){super(S,Q),this.current=0}set(S){this.current!==S&&(this.current=S,this.gl.uniform1i(this.location,S))}},l.aM=Yf,l.aN=class extends C3{constructor(S,Q){super(S,Q),this.current=H9}set(S){if(S[12]!==this.current[12]||S[0]!==this.current[0])return this.current=S,void this.gl.uniformMatrix4fv(this.location,!1,S);for(let Q=1;Q<16;Q++)if(S[Q]!==this.current[Q]){this.current=S,this.gl.uniformMatrix4fv(this.location,!1,S);break}}},l.aO=Tb,l.aP=class extends C3{constructor(S,Q){super(S,Q),this.current=[0,0,0]}set(S){S[0]===this.current[0]&&S[1]===this.current[1]&&S[2]===this.current[2]||(this.current=S,this.gl.uniform3f(this.location,S[0],S[1],S[2]))}},l.aQ=class extends C3{constructor(S,Q){super(S,Q),this.current=[0,0]}set(S){S[0]===this.current[0]&&S[1]===this.current[1]||(this.current=S,this.gl.uniform2f(this.location,S[0],S[1]))}},l.aR=vb,l.aS=function(S,Q,M,V,F,Y,$){var ce=1/(Q-M),Qe=1/(V-F),Me=1/(Y-$);return S[0]=-2*ce,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=-2*Qe,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=2*Me,S[11]=0,S[12]=(Q+M)*ce,S[13]=(F+V)*Qe,S[14]=($+Y)*Me,S[15]=1,S},l.aT=dn,l.aU=Zo,l.aV=class extends B{},l.aW=iXr,l.aX=class extends J{},l.aY=function(S){return S<=1?1:Math.pow(2,Math.ceil(Math.log(S)/Math.LN2))},l.aZ=Ss,l.a_=Or,l.aa=function(S){const Q={};if(S.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(M,V,F,Y)=>{const $=F||Y;return Q[V]=!$||$.toLowerCase(),""}),Q["max-age"]){const M=parseInt(Q["max-age"],10);isNaN(M)?delete Q["max-age"]:Q["max-age"]=M}return Q},l.ab=function(S,Q){const M=[];for(const V in S)V in Q||M.push(V);return M},l.ac=function(S){if(W==null){const Q=S.navigator?S.navigator.userAgent:null;W=!!S.safari||!(!Q||!(/\b(iPad|iPhone|iPod)\b/.test(Q)||Q.match("Safari")&&!Q.match("Chrome")))}return W},l.ad=w,l.ae=function(S,Q,M){var V=Math.sin(M),F=Math.cos(M),Y=Q[0],$=Q[1],ce=Q[2],Qe=Q[3],Me=Q[4],Fe=Q[5],Ze=Q[6],tt=Q[7];return Q!==S&&(S[8]=Q[8],S[9]=Q[9],S[10]=Q[10],S[11]=Q[11],S[12]=Q[12],S[13]=Q[13],S[14]=Q[14],S[15]=Q[15]),S[0]=Y*F+Me*V,S[1]=$*F+Fe*V,S[2]=ce*F+Ze*V,S[3]=Qe*F+tt*V,S[4]=Me*F-Y*V,S[5]=Fe*F-$*V,S[6]=Ze*F-ce*V,S[7]=tt*F-Qe*V,S},l.af=function(S){var Q=new Mr(16);return Q[0]=S[0],Q[1]=S[1],Q[2]=S[2],Q[3]=S[3],Q[4]=S[4],Q[5]=S[5],Q[6]=S[6],Q[7]=S[7],Q[8]=S[8],Q[9]=S[9],Q[10]=S[10],Q[11]=S[11],Q[12]=S[12],Q[13]=S[13],Q[14]=S[14],Q[15]=S[15],Q},l.ag=la,l.ah=function(S,Q){let M=0,V=0;if(S.kind==="constant")V=S.layoutSize;else if(S.kind!=="source"){const{interpolationType:F,minZoom:Y,maxZoom:$}=S,ce=F?w(mc.interpolationFactor(F,Q,Y,$),0,1):0;S.kind==="camera"?V=fc.number(S.minSize,S.maxSize,ce):M=ce}return{uSizeT:M,uSize:V}},l.aj=function(S,{uSize:Q,uSizeT:M},{lowerSize:V,upperSize:F}){return S.kind==="source"?V/Q4:S.kind==="composite"?fc.number(V/Q4,F/Q4,M):Q},l.ak=zse,l.al=function(S,Q,M,V){const F=Q.y-S.y,Y=Q.x-S.x,$=V.y-M.y,ce=V.x-M.x,Qe=$*Y-ce*F;if(Qe===0)return null;const Me=(ce*(S.y-M.y)-$*(S.x-M.x))/Qe;return new h(S.x+Me*Y,S.y+Me*F)},l.am=lWe,l.an=vt,l.ao=In,l.ap=ks,l.ar=Dse,l.as=function(S,Q){var M=Q[0],V=Q[1],F=Q[2],Y=Q[3],$=Q[4],ce=Q[5],Qe=Q[6],Me=Q[7],Fe=Q[8],Ze=Q[9],tt=Q[10],ut=Q[11],dt=Q[12],xt=Q[13],Ot=Q[14],Bt=Q[15],rr=M*ce-V*$,Wt=M*Qe-F*$,ir=M*Me-Y*$,dr=V*Qe-F*ce,xr=V*Me-Y*ce,en=F*Me-Y*Qe,yn=Fe*xt-Ze*dt,$r=Fe*Ot-tt*dt,Kr=Fe*Bt-ut*dt,Ur=Ze*Ot-tt*xt,hn=Ze*Bt-ut*xt,Wr=tt*Bt-ut*Ot,Cr=rr*Wr-Wt*hn+ir*Ur+dr*Kr-xr*$r+en*yn;return Cr?(S[0]=(ce*Wr-Qe*hn+Me*Ur)*(Cr=1/Cr),S[1]=(F*hn-V*Wr-Y*Ur)*Cr,S[2]=(xt*en-Ot*xr+Bt*dr)*Cr,S[3]=(tt*xr-Ze*en-ut*dr)*Cr,S[4]=(Qe*Kr-$*Wr-Me*$r)*Cr,S[5]=(M*Wr-F*Kr+Y*$r)*Cr,S[6]=(Ot*ir-dt*en-Bt*Wt)*Cr,S[7]=(Fe*en-tt*ir+ut*Wt)*Cr,S[8]=($*hn-ce*Kr+Me*yn)*Cr,S[9]=(V*Kr-M*hn-Y*yn)*Cr,S[10]=(dt*xr-xt*ir+Bt*rr)*Cr,S[11]=(Ze*ir-Fe*xr-ut*rr)*Cr,S[12]=(ce*$r-$*Ur-Qe*yn)*Cr,S[13]=(M*Ur-V*$r+F*yn)*Cr,S[14]=(xt*Wt-dt*dr-Ot*rr)*Cr,S[15]=(Fe*dr-Ze*Wt+tt*rr)*Cr,S):null},l.at=Xse,l.au=Fse,l.av=Jse,l.aw=function(){const S={},Q=Re.$version;for(const M in Re.$root){const V=Re.$root[M];if(V.required){let F=null;F=M==="version"?Q:V.type==="array"?[]:{},F!=null&&(S[M]=F)}}return S},l.ax=xe,l.ay=fb,l.az=ue,l.b=function(S,Q){const M=new Blob([new Uint8Array(S)],{type:"image/png"});createImageBitmap(M).then(V=>{Q(null,V)}).catch(V=>{Q(new Error(`Could not load image because of ${V.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},l.b0=xs,l.b1=function(S,Q){var M=S[0],V=S[1],F=S[2],Y=S[3],$=S[4],ce=S[5],Qe=S[6],Me=S[7],Fe=S[8],Ze=S[9],tt=S[10],ut=S[11],dt=S[12],xt=S[13],Ot=S[14],Bt=S[15],rr=Q[0],Wt=Q[1],ir=Q[2],dr=Q[3],xr=Q[4],en=Q[5],yn=Q[6],$r=Q[7],Kr=Q[8],Ur=Q[9],hn=Q[10],Wr=Q[11],Cr=Q[12],kn=Q[13],vn=Q[14],_i=Q[15];return Math.abs(M-rr)<=Jn*Math.max(1,Math.abs(M),Math.abs(rr))&&Math.abs(V-Wt)<=Jn*Math.max(1,Math.abs(V),Math.abs(Wt))&&Math.abs(F-ir)<=Jn*Math.max(1,Math.abs(F),Math.abs(ir))&&Math.abs(Y-dr)<=Jn*Math.max(1,Math.abs(Y),Math.abs(dr))&&Math.abs($-xr)<=Jn*Math.max(1,Math.abs($),Math.abs(xr))&&Math.abs(ce-en)<=Jn*Math.max(1,Math.abs(ce),Math.abs(en))&&Math.abs(Qe-yn)<=Jn*Math.max(1,Math.abs(Qe),Math.abs(yn))&&Math.abs(Me-$r)<=Jn*Math.max(1,Math.abs(Me),Math.abs($r))&&Math.abs(Fe-Kr)<=Jn*Math.max(1,Math.abs(Fe),Math.abs(Kr))&&Math.abs(Ze-Ur)<=Jn*Math.max(1,Math.abs(Ze),Math.abs(Ur))&&Math.abs(tt-hn)<=Jn*Math.max(1,Math.abs(tt),Math.abs(hn))&&Math.abs(ut-Wr)<=Jn*Math.max(1,Math.abs(ut),Math.abs(Wr))&&Math.abs(dt-Cr)<=Jn*Math.max(1,Math.abs(dt),Math.abs(Cr))&&Math.abs(xt-kn)<=Jn*Math.max(1,Math.abs(xt),Math.abs(kn))&&Math.abs(Ot-vn)<=Jn*Math.max(1,Math.abs(Ot),Math.abs(vn))&&Math.abs(Bt-_i)<=Jn*Math.max(1,Math.abs(Bt),Math.abs(_i))},l.b2=function(S,Q){return S[0]=Q[0],S[1]=Q[1],S[2]=Q[2],S[3]=Q[3],S[4]=Q[4],S[5]=Q[5],S[6]=Q[6],S[7]=Q[7],S[8]=Q[8],S[9]=Q[9],S[10]=Q[10],S[11]=Q[11],S[12]=Q[12],S[13]=Q[13],S[14]=Q[14],S[15]=Q[15],S},l.b3=function(S,Q,M){return S[0]=Q[0]*M[0],S[1]=Q[1]*M[1],S[2]=Q[2]*M[2],S[3]=Q[3]*M[3],S},l.b4=function(S,Q){return S[0]*Q[0]+S[1]*Q[1]+S[2]*Q[2]+S[3]*Q[3]},l.b5=k,l.b6=tWe,l.b7=Yqe,l.b8=function(S,Q,M,V,F){var Y,$=1/Math.tan(Q/2);return S[0]=$/M,S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=$,S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[11]=-1,S[12]=0,S[13]=0,S[15]=0,F!=null&&F!==1/0?(S[10]=(F+V)*(Y=1/(V-F)),S[14]=2*F*V*Y):(S[10]=-1,S[14]=-2*V),S},l.b9=function(S,Q,M){var V=Math.sin(M),F=Math.cos(M),Y=Q[4],$=Q[5],ce=Q[6],Qe=Q[7],Me=Q[8],Fe=Q[9],Ze=Q[10],tt=Q[11];return Q!==S&&(S[0]=Q[0],S[1]=Q[1],S[2]=Q[2],S[3]=Q[3],S[12]=Q[12],S[13]=Q[13],S[14]=Q[14],S[15]=Q[15]),S[4]=Y*F+Me*V,S[5]=$*F+Fe*V,S[6]=ce*F+Ze*V,S[7]=Qe*F+tt*V,S[8]=Me*F-Y*V,S[9]=Fe*F-$*V,S[10]=Ze*F-ce*V,S[11]=tt*F-Qe*V,S},l.bA=d,l.bB=kqe,l.bC=_6,l.bD=Pl,l.ba=b,l.bb=L,l.bc=function(S,Q){return S[0]=Q[0],S[1]=0,S[2]=0,S[3]=0,S[4]=0,S[5]=Q[1],S[6]=0,S[7]=0,S[8]=0,S[9]=0,S[10]=Q[2],S[11]=0,S[12]=0,S[13]=0,S[14]=0,S[15]=1,S},l.bd=class extends g4{},l.be=qse,l.bf=$qe,l.bg=DXr,l.bi=re,l.bj=function(S,Q,M=!1){if(Ws===Gf||Ws===qf||Ws===Wf)throw new Error("setRTLTextPlugin cannot be called multiple times.");uu=ie.resolveURL(S),Ws=Gf,H6=Q,M9(),M||E9()},l.bk=C9,l.bl=function(S,Q){const M={};for(let F=0;F<S.length;F++){const Y=Q&&Q[S[F].id]||M6(S[F]);Q&&(Q[S[F].id]=Y);let $=M[Y];$||($=M[Y]=[]),$.push(S[F])}const V=[];for(const F in M)V.push(M[F]);return V},l.bm=sn,l.bn=nWe,l.bo=oWe,l.bp=Pqe,l.bq=function(S){S.bucket.createArrays(),S.bucket.tilePixelRatio=ze/(512*S.bucket.overscaling),S.bucket.compareText={},S.bucket.iconsNeedLinear=!1;const Q=S.bucket.layers[0],M=Q.layout,V=Q._unevaluatedLayout._values,F={layoutIconSize:V["icon-size"].possiblyEvaluate(new po(S.bucket.zoom+1),S.canonical),layoutTextSize:V["text-size"].possiblyEvaluate(new po(S.bucket.zoom+1),S.canonical),textMaxSize:V["text-size"].possiblyEvaluate(new po(18))};if(S.bucket.textSizeData.kind==="composite"){const{minZoom:Me,maxZoom:Fe}=S.bucket.textSizeData;F.compositeTextSizes=[V["text-size"].possiblyEvaluate(new po(Me),S.canonical),V["text-size"].possiblyEvaluate(new po(Fe),S.canonical)]}if(S.bucket.iconSizeData.kind==="composite"){const{minZoom:Me,maxZoom:Fe}=S.bucket.iconSizeData;F.compositeIconSizes=[V["icon-size"].possiblyEvaluate(new po(Me),S.canonical),V["icon-size"].possiblyEvaluate(new po(Fe),S.canonical)]}const Y=M.get("text-line-height")*ks,$=M.get("text-rotation-alignment")!=="viewport"&&M.get("symbol-placement")!=="point",ce=M.get("text-keep-upright"),Qe=M.get("text-size");for(const Me of S.bucket.features){const Fe=M.get("text-font").evaluate(Me,{},S.canonical).join(","),Ze=Qe.evaluate(Me,{},S.canonical),tt=F.layoutTextSize.evaluate(Me,{},S.canonical),ut=F.layoutIconSize.evaluate(Me,{},S.canonical),dt={horizontal:{},vertical:void 0},xt=Me.text;let Ot,Bt=[0,0];if(xt){const ir=xt.toString(),dr=M.get("text-letter-spacing").evaluate(Me,{},S.canonical)*ks,xr=w9(ir)?dr:0,en=M.get("text-anchor").evaluate(Me,{},S.canonical),yn=yWe(Q,Me,S.canonical);if(!yn){const Wr=M.get("text-radial-offset").evaluate(Me,{},S.canonical);Bt=Wr?gWe(en,[Wr*ks,Kse]):M.get("text-offset").evaluate(Me,{},S.canonical).map(Cr=>Cr*ks)}let $r=$?"center":M.get("text-justify").evaluate(Me,{},S.canonical);const Kr=M.get("symbol-placement"),Ur=Kr==="point"?M.get("text-max-width").evaluate(Me,{},S.canonical)*ks:0,hn=()=>{S.bucket.allowVerticalPlacement&&_9(ir)&&(dt.vertical=yz(xt,S.glyphMap,S.glyphPositions,S.imagePositions,Fe,Ur,Y,en,"left",xr,Bt,l.ai.vertical,!0,Kr,tt,Ze))};if(!$&&yn){const Wr=new Set;if($r==="auto")for(let kn=0;kn<yn.values.length;kn+=2)Wr.add(Xse(yn.values[kn]));else Wr.add($r);let Cr=!1;for(const kn of Wr)if(!dt.horizontal[kn])if(Cr)dt.horizontal[kn]=dt.horizontal[0];else{const vn=yz(xt,S.glyphMap,S.glyphPositions,S.imagePositions,Fe,Ur,Y,"center",kn,xr,Bt,l.ai.horizontal,!1,Kr,tt,Ze);vn&&(dt.horizontal[kn]=vn,Cr=vn.positionedLines.length===1)}hn()}else{$r==="auto"&&($r=Xse(en));const Wr=yz(xt,S.glyphMap,S.glyphPositions,S.imagePositions,Fe,Ur,Y,en,$r,xr,Bt,l.ai.horizontal,!1,Kr,tt,Ze);Wr&&(dt.horizontal[$r]=Wr),hn(),_9(ir)&&$&&ce&&(dt.vertical=yz(xt,S.glyphMap,S.glyphPositions,S.imagePositions,Fe,Ur,Y,en,$r,xr,Bt,l.ai.vertical,!1,Kr,tt,Ze))}}let rr=!1;if(Me.icon&&Me.icon.name){const ir=S.imageMap[Me.icon.name];ir&&(Ot=xXr(S.imagePositions[Me.icon.name],M.get("icon-offset").evaluate(Me,{},S.canonical),M.get("icon-anchor").evaluate(Me,{},S.canonical)),rr=!!ir.sdf,S.bucket.sdfIcons===void 0?S.bucket.sdfIcons=rr:S.bucket.sdfIcons!==rr&&D("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(ir.pixelRatio!==S.bucket.pixelRatio||M.get("icon-rotate").constantOr(1)!==0)&&(S.bucket.iconsNeedLinear=!0))}const Wt=vWe(dt.horizontal)||dt.vertical;S.bucket.iconsInText=!!Wt&&Wt.iconsInText,(Wt||Ot)&&RXr(S.bucket,Me,dt,Ot,S.imageMap,F,tt,ut,Bt,rr,S.canonical)}S.showCollisionBoxes&&S.bucket.generateCollisionDebugBuffers()},l.br=Vse,l.bs=Ase,l.bt=Hse,l.bu=class{constructor(S){this._marks={start:[S.url,"start"].join("#"),end:[S.url,"end"].join("#"),measure:S.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let S=performance.getEntriesByName(this._marks.measure);return S.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),S=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),S}},l.bv=Pse,l.bw=t8,l.bx=function(S,Q,M,V,F){return c(this,void 0,void 0,function*(){if(_())try{return yield X(S,Q,M,V,F)}catch{}return function(Y,$,ce,Qe,Me){const Fe=Y.width,Ze=Y.height;ee&&oe||(ee=new OffscreenCanvas(Fe,Ze),oe=ee.getContext("2d",{willReadFrequently:!0})),ee.width=Fe,ee.height=Ze,oe.drawImage(Y,0,0,Fe,Ze);const tt=oe.getImageData($,ce,Qe,Me);return oe.clearRect(0,0,Fe,Ze),tt.data}(S,Q,M,V,F)})},l.by=rWe,l.bz=u,l.c=be,l.d=function(S,Q){const M=new Image;M.onload=()=>{Q(null,M),URL.revokeObjectURL(M.src),M.onload=null,window.requestAnimationFrame(()=>{M.src=U})},M.onerror=()=>Q(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const V=new Blob([new Uint8Array(S)],{type:"image/png"});M.src=S.byteLength?URL.createObjectURL(V):U},l.e=C,l.f=function(S,Q){return _e(C(S,{type:"json"}),Q)},l.g=ne,l.h=ie,l.i=P,l.j=Ne,l.k=Ve,l.l=Ie,l.m=_e,l.n=function(S){return new Pse(S).readFields(gXr,[])},l.o=function(S,Q,M){if(!S.length)return M(null,[]);let V=S.length;const F=new Array(S.length);let Y=null;S.forEach(($,ce)=>{Q($,(Qe,Me)=>{Qe&&(Y=Qe),F[ce]=Me,--V==0&&M(Y,F)})})},l.p=Iqe,l.q=I9,l.r=oa,l.s=qe,l.t=EM,l.u=Jr,l.v=Re,l.w=D,l.x=zf,l.y=u2,l.z=function([S,Q,M]){return Q+=90,Q*=Math.PI/180,M*=Math.PI/180,{x:S*Math.cos(Q)*Math.sin(M),y:S*Math.sin(Q)*Math.sin(M),z:S*Math.cos(M)}}}),o(["./shared"],function(l){class c{constructor(ke){this.keyCache={},ke&&this.replace(ke)}replace(ke){this._layerConfigs={},this._layers={},this.update(ke,[])}update(ke,Oe){for(const ve of ke){this._layerConfigs[ve.id]=ve;const Ae=this._layers[ve.id]=l.aC(ve);Ae._featureFilter=l.a6(Ae.filter),this.keyCache[ve.id]&&delete this.keyCache[ve.id]}for(const ve of Oe)delete this.keyCache[ve],delete this._layerConfigs[ve],delete this._layers[ve];this.familiesBySource={};const Ye=l.bl(Object.values(this._layerConfigs),this.keyCache);for(const ve of Ye){const Ae=ve.map(se=>this._layers[se.id]),Be=Ae[0];if(Be.visibility==="none")continue;const Se=Be.source||"";let ge=this.familiesBySource[Se];ge||(ge=this.familiesBySource[Se]={});const Ce=Be.sourceLayer||"_geojsonTileLayer";let Xe=ge[Ce];Xe||(Xe=ge[Ce]=[]),Xe.push(Ae)}}}class u{constructor(ke){const Oe={},Ye=[];for(const Se in ke){const ge=ke[Se],Ce=Oe[Se]={};for(const Xe in ge){const se=ge[+Xe];if(!se||se.bitmap.width===0||se.bitmap.height===0)continue;const Le={x:0,y:0,w:se.bitmap.width+2,h:se.bitmap.height+2};Ye.push(Le),Ce[Xe]={rect:Le,metrics:se.metrics}}}const{w:ve,h:Ae}=l.p(Ye),Be=new l.q({width:ve||1,height:Ae||1});for(const Se in ke){const ge=ke[Se];for(const Ce in ge){const Xe=ge[+Ce];if(!Xe||Xe.bitmap.width===0||Xe.bitmap.height===0)continue;const se=Oe[Se][Ce].rect;l.q.copy(Xe.bitmap,Be,{x:0,y:0},{x:se.x+1,y:se.y+1},Xe.bitmap)}}this.image=Be,this.positions=Oe}}l.bm("GlyphAtlas",u);class d{constructor(ke){this.tileID=new l.O(ke.tileID.overscaledZ,ke.tileID.wrap,ke.tileID.canonical.z,ke.tileID.canonical.x,ke.tileID.canonical.y),this.uid=ke.uid,this.zoom=ke.zoom,this.pixelRatio=ke.pixelRatio,this.tileSize=ke.tileSize,this.source=ke.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=ke.showCollisionBoxes,this.collectResourceTiming=!!ke.collectResourceTiming,this.returnDependencies=!!ke.returnDependencies,this.promoteId=ke.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(ke,Oe,Ye,ve,Ae){this.status="parsing",this.data=ke,this.collisionBoxArray=new l.a3;const Be=new l.bn(Object.keys(ke.layers).sort()),Se=new l.bo(this.tileID,this.promoteId);Se.bucketLayerIDs=[];const ge={},Ce={featureIndex:Se,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Ye},Xe=Oe.familiesBySource[this.source];for(const hr in Xe){const Ir=ke.layers[hr];if(!Ir)continue;Ir.version===1&&l.w(`Vector tile source "${this.source}" layer "${hr}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Rr=Be.encode(hr),yr=[];for(let Ar=0;Ar<Ir.length;Ar++){const an=Ir.feature(Ar),Er=Se.getId(an,hr);yr.push({feature:an,id:Er,index:Ar,sourceLayerIndex:Rr})}for(const Ar of Xe[hr]){const an=Ar[0];an.source!==this.source&&l.w(`layer.source = ${an.source} does not equal this.source = ${this.source}`),an.minzoom&&this.zoom<Math.floor(an.minzoom)||an.maxzoom&&this.zoom>=an.maxzoom||an.visibility!=="none"&&(p(Ar,this.zoom,Ye),(ge[an.id]=an.createBucket({index:Se.bucketLayerIDs.length,layers:Ar,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Rr,sourceID:this.source})).populate(yr,Ce,this.tileID.canonical),Se.bucketLayerIDs.push(Ar.map(Er=>Er.id)))}}let se,Le,Ke,ht;const At=l.aH(Ce.glyphDependencies,hr=>Object.keys(hr).map(Number));this.inFlightDependencies.forEach(hr=>hr==null?void 0:hr.cancel()),this.inFlightDependencies=[];const qt=++this.dependencySentinel;Object.keys(At).length?this.inFlightDependencies.push(ve.send("getGlyphs",{uid:this.uid,stacks:At,source:this.source,tileID:this.tileID,type:"glyphs"},(hr,Ir)=>{qt===this.dependencySentinel&&(se||(se=hr,Le=Ir,lr.call(this)))})):Le={};const nr=Object.keys(Ce.iconDependencies);nr.length?this.inFlightDependencies.push(ve.send("getImages",{icons:nr,source:this.source,tileID:this.tileID,type:"icons"},(hr,Ir)=>{qt===this.dependencySentinel&&(se||(se=hr,Ke=Ir,lr.call(this)))})):Ke={};const cr=Object.keys(Ce.patternDependencies);function lr(){if(se)return Ae(se);if(Le&&Ke&&ht){const hr=new u(Le),Ir=new l.bp(Ke,ht);for(const Rr in ge){const yr=ge[Rr];yr instanceof l.a4?(p(yr.layers,this.zoom,Ye),l.bq({bucket:yr,glyphMap:Le,glyphPositions:hr.positions,imageMap:Ke,imagePositions:Ir.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):yr.hasPattern&&(yr instanceof l.br||yr instanceof l.bs||yr instanceof l.bt)&&(p(yr.layers,this.zoom,Ye),yr.addFeatures(Ce,this.tileID.canonical,Ir.patternPositions))}this.status="done",Ae(null,{buckets:Object.values(ge).filter(Rr=>!Rr.isEmpty()),featureIndex:Se,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:hr.image,imageAtlas:Ir,glyphMap:this.returnDependencies?Le:null,iconMap:this.returnDependencies?Ke:null,glyphPositions:this.returnDependencies?hr.positions:null})}}cr.length?this.inFlightDependencies.push(ve.send("getImages",{icons:cr,source:this.source,tileID:this.tileID,type:"patterns"},(hr,Ir)=>{qt===this.dependencySentinel&&(se||(se=hr,ht=Ir,lr.call(this)))})):ht={},lr.call(this)}}function p(je,ke,Oe){const Ye=new l.a8(ke);for(const ve of je)ve.recalculate(Ye,Oe)}function h(je,ke){const Oe=l.l(je.request,(Ye,ve,Ae,Be)=>{if(Ye)ke(Ye);else if(ve)try{const Se=new l.bw.VectorTile(new l.bv(ve));ke(null,{vectorTile:Se,rawData:ve,cacheControl:Ae,expires:Be})}catch(Se){const ge=new Uint8Array(ve);let Ce=`Unable to parse the tile at ${je.request.url}, `;Ce+=ge[0]===31&&ge[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${Se.messge}`,ke(new Error(Ce))}});return()=>{Oe.cancel(),ke()}}class f{constructor(ke,Oe,Ye,ve){this.actor=ke,this.layerIndex=Oe,this.availableImages=Ye,this.loadVectorData=ve||h,this.fetching={},this.loading={},this.loaded={}}loadTile(ke,Oe){const Ye=ke.uid;this.loading||(this.loading={});const ve=!!(ke&&ke.request&&ke.request.collectResourceTiming)&&new l.bu(ke.request),Ae=this.loading[Ye]=new d(ke);Ae.abort=this.loadVectorData(ke,(Be,Se)=>{if(delete this.loading[Ye],Be||!Se)return Ae.status="done",this.loaded[Ye]=Ae,Oe(Be);const ge=Se.rawData,Ce={};Se.expires&&(Ce.expires=Se.expires),Se.cacheControl&&(Ce.cacheControl=Se.cacheControl);const Xe={};if(ve){const se=ve.finish();se&&(Xe.resourceTiming=JSON.parse(JSON.stringify(se)))}Ae.vectorTile=Se.vectorTile,Ae.parse(Se.vectorTile,this.layerIndex,this.availableImages,this.actor,(se,Le)=>{if(delete this.fetching[Ye],se||!Le)return Oe(se);Oe(null,l.e({rawTileData:ge.slice(0)},Le,Ce,Xe))}),this.loaded=this.loaded||{},this.loaded[Ye]=Ae,this.fetching[Ye]={rawTileData:ge,cacheControl:Ce,resourceTiming:Xe}})}reloadTile(ke,Oe){const Ye=this.loaded,ve=ke.uid;if(Ye&&Ye[ve]){const Ae=Ye[ve];Ae.showCollisionBoxes=ke.showCollisionBoxes,Ae.status==="parsing"?Ae.parse(Ae.vectorTile,this.layerIndex,this.availableImages,this.actor,(Be,Se)=>{if(Be||!Se)return Oe(Be,Se);let ge;if(this.fetching[ve]){const{rawTileData:Ce,cacheControl:Xe,resourceTiming:se}=this.fetching[ve];delete this.fetching[ve],ge=l.e({rawTileData:Ce.slice(0)},Se,Xe,se)}else ge=Se;Oe(null,ge)}):Ae.status==="done"&&(Ae.vectorTile?Ae.parse(Ae.vectorTile,this.layerIndex,this.availableImages,this.actor,Oe):Oe())}}abortTile(ke,Oe){const Ye=this.loading,ve=ke.uid;Ye&&Ye[ve]&&Ye[ve].abort&&(Ye[ve].abort(),delete Ye[ve]),Oe()}removeTile(ke,Oe){const Ye=this.loaded,ve=ke.uid;Ye&&Ye[ve]&&delete Ye[ve],Oe()}}class m{constructor(){this.loaded={}}loadTile(ke,Oe){return l._(this,void 0,void 0,function*(){const{uid:Ye,encoding:ve,rawImageData:Ae,redFactor:Be,greenFactor:Se,blueFactor:ge,baseShift:Ce}=ke,Xe=Ae.width+2,se=Ae.height+2,Le=l.a(Ae)?new l.R({width:Xe,height:se},yield l.bx(Ae,-1,-1,Xe,se)):Ae,Ke=new l.by(Ye,Le,ve,Be,Se,ge,Ce);this.loaded=this.loaded||{},this.loaded[Ye]=Ke,Oe(null,Ke)})}removeTile(ke){const Oe=this.loaded,Ye=ke.uid;Oe&&Oe[Ye]&&delete Oe[Ye]}}function g(je,ke){if(je.length!==0){T(je[0],ke);for(var Oe=1;Oe<je.length;Oe++)T(je[Oe],!ke)}}function T(je,ke){for(var Oe=0,Ye=0,ve=0,Ae=je.length,Be=Ae-1;ve<Ae;Be=ve++){var Se=(je[ve][0]-je[Be][0])*(je[Be][1]+je[ve][1]),ge=Oe+Se;Ye+=Math.abs(Oe)>=Math.abs(Se)?Oe-ge+Se:Se-ge+Oe,Oe=ge}Oe+Ye>=0!=!!ke&&je.reverse()}var y=l.bz(function je(ke,Oe){var Ye,ve=ke&&ke.type;if(ve==="FeatureCollection")for(Ye=0;Ye<ke.features.length;Ye++)je(ke.features[Ye],Oe);else if(ve==="GeometryCollection")for(Ye=0;Ye<ke.geometries.length;Ye++)je(ke.geometries[Ye],Oe);else if(ve==="Feature")je(ke.geometry,Oe);else if(ve==="Polygon")g(ke.coordinates,Oe);else if(ve==="MultiPolygon")for(Ye=0;Ye<ke.coordinates.length;Ye++)g(ke.coordinates[Ye],Oe);return ke});const v=l.bw.VectorTileFeature.prototype.toGeoJSON;var _={exports:{}},b=l.bA,L=l.bw.VectorTileFeature,w=k;function k(je,ke){this.options=ke||{},this.features=je,this.length=je.length}function C(je,ke){this.id=typeof je.id=="number"?je.id:void 0,this.type=je.type,this.rawGeometry=je.type===1?[je.geometry]:je.geometry,this.properties=je.tags,this.extent=ke||4096}k.prototype.feature=function(je){return new C(this.features[je],this.options.extent)},C.prototype.loadGeometry=function(){var je=this.rawGeometry;this.geometry=[];for(var ke=0;ke<je.length;ke++){for(var Oe=je[ke],Ye=[],ve=0;ve<Oe.length;ve++)Ye.push(new b(Oe[ve][0],Oe[ve][1]));this.geometry.push(Ye)}return this.geometry},C.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var je=this.geometry,ke=1/0,Oe=-1/0,Ye=1/0,ve=-1/0,Ae=0;Ae<je.length;Ae++)for(var Be=je[Ae],Se=0;Se<Be.length;Se++){var ge=Be[Se];ke=Math.min(ke,ge.x),Oe=Math.max(Oe,ge.x),Ye=Math.min(Ye,ge.y),ve=Math.max(ve,ge.y)}return[ke,Ye,Oe,ve]},C.prototype.toGeoJSON=L.prototype.toGeoJSON;var A=l.bB,O=w;function N(je){var ke=new A;return function(Oe,Ye){for(var ve in Oe.layers)Ye.writeMessage(3,I,Oe.layers[ve])}(je,ke),ke.finish()}function I(je,ke){var Oe;ke.writeVarintField(15,je.version||1),ke.writeStringField(1,je.name||""),ke.writeVarintField(5,je.extent||4096);var Ye={keys:[],values:[],keycache:{},valuecache:{}};for(Oe=0;Oe<je.length;Oe++)Ye.feature=je.feature(Oe),ke.writeMessage(2,R,Ye);var ve=Ye.keys;for(Oe=0;Oe<ve.length;Oe++)ke.writeStringField(3,ve[Oe]);var Ae=Ye.values;for(Oe=0;Oe<Ae.length;Oe++)ke.writeMessage(4,W,Ae[Oe])}function R(je,ke){var Oe=je.feature;Oe.id!==void 0&&ke.writeVarintField(1,Oe.id),ke.writeMessage(2,D,je),ke.writeVarintField(3,Oe.type),ke.writeMessage(4,P,Oe)}function D(je,ke){var Oe=je.feature,Ye=je.keys,ve=je.values,Ae=je.keycache,Be=je.valuecache;for(var Se in Oe.properties){var ge=Oe.properties[Se],Ce=Ae[Se];if(ge!==null){Ce===void 0&&(Ye.push(Se),Ae[Se]=Ce=Ye.length-1),ke.writeVarint(Ce);var Xe=typeof ge;Xe!=="string"&&Xe!=="boolean"&&Xe!=="number"&&(ge=JSON.stringify(ge));var se=Xe+":"+ge,Le=Be[se];Le===void 0&&(ve.push(ge),Be[se]=Le=ve.length-1),ke.writeVarint(Le)}}}function j(je,ke){return(ke<<3)+(7&je)}function G(je){return je<<1^je>>31}function P(je,ke){for(var Oe=je.loadGeometry(),Ye=je.type,ve=0,Ae=0,Be=Oe.length,Se=0;Se<Be;Se++){var ge=Oe[Se],Ce=1;Ye===1&&(Ce=ge.length),ke.writeVarint(j(1,Ce));for(var Xe=Ye===3?ge.length-1:ge.length,se=0;se<Xe;se++){se===1&&Ye!==1&&ke.writeVarint(j(2,Xe-1));var Le=ge[se].x-ve,Ke=ge[se].y-Ae;ke.writeVarint(G(Le)),ke.writeVarint(G(Ke)),ve+=Le,Ae+=Ke}Ye===3&&ke.writeVarint(j(7,1))}}function W(je,ke){var Oe=typeof je;Oe==="string"?ke.writeStringField(1,je):Oe==="boolean"?ke.writeBooleanField(7,je):Oe==="number"&&(je%1!=0?ke.writeDoubleField(3,je):je<0?ke.writeSVarintField(6,je):ke.writeVarintField(5,je))}_.exports=N,_.exports.fromVectorTileJs=N,_.exports.fromGeojsonVt=function(je,ke){ke=ke||{};var Oe={};for(var Ye in je)Oe[Ye]=new O(je[Ye].features,ke),Oe[Ye].name=Ye,Oe[Ye].version=ke.version,Oe[Ye].extent=ke.extent;return N({layers:Oe})},_.exports.GeoJSONWrapper=O;var K=l.bz(_.exports);const U={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:je=>je},X=Math.fround||(ee=new Float32Array(1),je=>(ee[0]=+je,ee[0]));var ee;const oe=3,he=5,me=6;class ie{constructor(ke){this.options=Object.assign(Object.create(U),ke),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(ke){const{log:Oe,minZoom:Ye,maxZoom:ve}=this.options;Oe&&console.time("total time");const Ae=`prepare ${ke.length} points`;Oe&&console.time(Ae),this.points=ke;const Be=[];for(let ge=0;ge<ke.length;ge++){const Ce=ke[ge];if(!Ce.geometry)continue;const[Xe,se]=Ce.geometry.coordinates,Le=X(ue(Xe)),Ke=X(ne(se));Be.push(Le,Ke,1/0,ge,-1,1),this.options.reduce&&Be.push(0)}let Se=this.trees[ve+1]=this._createTree(Be);Oe&&console.timeEnd(Ae);for(let ge=ve;ge>=Ye;ge--){const Ce=+Date.now();Se=this.trees[ge]=this._createTree(this._cluster(Se,ge)),Oe&&console.log("z%d: %d clusters in %dms",ge,Se.numItems,+Date.now()-Ce)}return Oe&&console.timeEnd("total time"),this}getClusters(ke,Oe){let Ye=((ke[0]+180)%360+360)%360-180;const ve=Math.max(-90,Math.min(90,ke[1]));let Ae=ke[2]===180?180:((ke[2]+180)%360+360)%360-180;const Be=Math.max(-90,Math.min(90,ke[3]));if(ke[2]-ke[0]>=360)Ye=-180,Ae=180;else if(Ye>Ae){const se=this.getClusters([Ye,ve,180,Be],Oe),Le=this.getClusters([-180,ve,Ae,Be],Oe);return se.concat(Le)}const Se=this.trees[this._limitZoom(Oe)],ge=Se.range(ue(Ye),ne(Be),ue(Ae),ne(ve)),Ce=Se.data,Xe=[];for(const se of ge){const Le=this.stride*se;Xe.push(Ce[Le+he]>1?be(Ce,Le,this.clusterProps):this.points[Ce[Le+oe]])}return Xe}getChildren(ke){const Oe=this._getOriginId(ke),Ye=this._getOriginZoom(ke),ve="No cluster with the specified id.",Ae=this.trees[Ye];if(!Ae)throw new Error(ve);const Be=Ae.data;if(Oe*this.stride>=Be.length)throw new Error(ve);const Se=this.options.radius/(this.options.extent*Math.pow(2,Ye-1)),ge=Ae.within(Be[Oe*this.stride],Be[Oe*this.stride+1],Se),Ce=[];for(const Xe of ge){const se=Xe*this.stride;Be[se+4]===ke&&Ce.push(Be[se+he]>1?be(Be,se,this.clusterProps):this.points[Be[se+oe]])}if(Ce.length===0)throw new Error(ve);return Ce}getLeaves(ke,Oe,Ye){const ve=[];return this._appendLeaves(ve,ke,Oe=Oe||10,Ye=Ye||0,0),ve}getTile(ke,Oe,Ye){const ve=this.trees[this._limitZoom(ke)],Ae=Math.pow(2,ke),{extent:Be,radius:Se}=this.options,ge=Se/Be,Ce=(Ye-ge)/Ae,Xe=(Ye+1+ge)/Ae,se={features:[]};return this._addTileFeatures(ve.range((Oe-ge)/Ae,Ce,(Oe+1+ge)/Ae,Xe),ve.data,Oe,Ye,Ae,se),Oe===0&&this._addTileFeatures(ve.range(1-ge/Ae,Ce,1,Xe),ve.data,Ae,Ye,Ae,se),Oe===Ae-1&&this._addTileFeatures(ve.range(0,Ce,ge/Ae,Xe),ve.data,-1,Ye,Ae,se),se.features.length?se:null}getClusterExpansionZoom(ke){let Oe=this._getOriginZoom(ke)-1;for(;Oe<=this.options.maxZoom;){const Ye=this.getChildren(ke);if(Oe++,Ye.length!==1)break;ke=Ye[0].properties.cluster_id}return Oe}_appendLeaves(ke,Oe,Ye,ve,Ae){const Be=this.getChildren(Oe);for(const Se of Be){const ge=Se.properties;if(ge&&ge.cluster?Ae+ge.point_count<=ve?Ae+=ge.point_count:Ae=this._appendLeaves(ke,ge.cluster_id,Ye,ve,Ae):Ae<ve?Ae++:ke.push(Se),ke.length===Ye)break}return Ae}_createTree(ke){const Oe=new l.av(ke.length/this.stride|0,this.options.nodeSize,Float32Array);for(let Ye=0;Ye<ke.length;Ye+=this.stride)Oe.add(ke[Ye],ke[Ye+1]);return Oe.finish(),Oe.data=ke,Oe}_addTileFeatures(ke,Oe,Ye,ve,Ae,Be){for(const Se of ke){const ge=Se*this.stride,Ce=Oe[ge+he]>1;let Xe,se,Le;if(Ce)Xe=re(Oe,ge,this.clusterProps),se=Oe[ge],Le=Oe[ge+1];else{const At=this.points[Oe[ge+oe]];Xe=At.properties;const[qt,nr]=At.geometry.coordinates;se=ue(qt),Le=ne(nr)}const Ke={type:1,geometry:[[Math.round(this.options.extent*(se*Ae-Ye)),Math.round(this.options.extent*(Le*Ae-ve))]],tags:Xe};let ht;ht=Ce||this.options.generateId?Oe[ge+oe]:this.points[Oe[ge+oe]].id,ht!==void 0&&(Ke.id=ht),Be.features.push(Ke)}}_limitZoom(ke){return Math.max(this.options.minZoom,Math.min(Math.floor(+ke),this.options.maxZoom+1))}_cluster(ke,Oe){const{radius:Ye,extent:ve,reduce:Ae,minPoints:Be}=this.options,Se=Ye/(ve*Math.pow(2,Oe)),ge=ke.data,Ce=[],Xe=this.stride;for(let se=0;se<ge.length;se+=Xe){if(ge[se+2]<=Oe)continue;ge[se+2]=Oe;const Le=ge[se],Ke=ge[se+1],ht=ke.within(ge[se],ge[se+1],Se),At=ge[se+he];let qt=At;for(const nr of ht){const cr=nr*Xe;ge[cr+2]>Oe&&(qt+=ge[cr+he])}if(qt>At&&qt>=Be){let nr,cr=Le*At,lr=Ke*At,hr=-1;const Ir=((se/Xe|0)<<5)+(Oe+1)+this.points.length;for(const Rr of ht){const yr=Rr*Xe;if(ge[yr+2]<=Oe)continue;ge[yr+2]=Oe;const Ar=ge[yr+he];cr+=ge[yr]*Ar,lr+=ge[yr+1]*Ar,ge[yr+4]=Ir,Ae&&(nr||(nr=this._map(ge,se,!0),hr=this.clusterProps.length,this.clusterProps.push(nr)),Ae(nr,this._map(ge,yr)))}ge[se+4]=Ir,Ce.push(cr/qt,lr/qt,1/0,Ir,-1,qt),Ae&&Ce.push(hr)}else{for(let nr=0;nr<Xe;nr++)Ce.push(ge[se+nr]);if(qt>1)for(const nr of ht){const cr=nr*Xe;if(!(ge[cr+2]<=Oe)){ge[cr+2]=Oe;for(let lr=0;lr<Xe;lr++)Ce.push(ge[cr+lr])}}}}return Ce}_getOriginId(ke){return ke-this.points.length>>5}_getOriginZoom(ke){return(ke-this.points.length)%32}_map(ke,Oe,Ye){if(ke[Oe+he]>1){const Be=this.clusterProps[ke[Oe+me]];return Ye?Object.assign({},Be):Be}const ve=this.points[ke[Oe+oe]].properties,Ae=this.options.map(ve);return Ye&&Ae===ve?Object.assign({},Ae):Ae}}function be(je,ke,Oe){return{type:"Feature",id:je[ke+oe],properties:re(je,ke,Oe),geometry:{type:"Point",coordinates:[(Ye=je[ke],360*(Ye-.5)),ye(je[ke+1])]}};var Ye}function re(je,ke,Oe){const Ye=je[ke+he],ve=Ye>=1e4?`${Math.round(Ye/1e3)}k`:Ye>=1e3?Math.round(Ye/100)/10+"k":Ye,Ae=je[ke+me],Be=Ae===-1?{}:Object.assign({},Oe[Ae]);return Object.assign(Be,{cluster:!0,cluster_id:je[ke+oe],point_count:Ye,point_count_abbreviated:ve})}function ue(je){return je/360+.5}function ne(je){const ke=Math.sin(je*Math.PI/180),Oe=.5-.25*Math.log((1+ke)/(1-ke))/Math.PI;return Oe<0?0:Oe>1?1:Oe}function ye(je){const ke=(180-360*je)*Math.PI/180;return 360*Math.atan(Math.exp(ke))/Math.PI-90}function _e(je,ke,Oe,Ye){for(var ve,Ae=Ye,Be=Oe-ke>>1,Se=Oe-ke,ge=je[ke],Ce=je[ke+1],Xe=je[Oe],se=je[Oe+1],Le=ke+3;Le<Oe;Le+=3){var Ke=Ie(je[Le],je[Le+1],ge,Ce,Xe,se);if(Ke>Ae)ve=Le,Ae=Ke;else if(Ke===Ae){var ht=Math.abs(Le-Be);ht<Se&&(ve=Le,Se=ht)}}Ae>Ye&&(ve-ke>3&&_e(je,ke,ve,Ye),je[ve+2]=Ae,Oe-ve>3&&_e(je,ve,Oe,Ye))}function Ie(je,ke,Oe,Ye,ve,Ae){var Be=ve-Oe,Se=Ae-Ye;if(Be!==0||Se!==0){var ge=((je-Oe)*Be+(ke-Ye)*Se)/(Be*Be+Se*Se);ge>1?(Oe=ve,Ye=Ae):ge>0&&(Oe+=Be*ge,Ye+=Se*ge)}return(Be=je-Oe)*Be+(Se=ke-Ye)*Se}function qe(je,ke,Oe,Ye){var ve={id:je===void 0?null:je,type:ke,geometry:Oe,tags:Ye,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Ae){var Be=Ae.geometry,Se=Ae.type;if(Se==="Point"||Se==="MultiPoint"||Se==="LineString")Ge(Ae,Be);else if(Se==="Polygon"||Se==="MultiLineString")for(var ge=0;ge<Be.length;ge++)Ge(Ae,Be[ge]);else if(Se==="MultiPolygon")for(ge=0;ge<Be.length;ge++)for(var Ce=0;Ce<Be[ge].length;Ce++)Ge(Ae,Be[ge][Ce])}(ve),ve}function Ge(je,ke){for(var Oe=0;Oe<ke.length;Oe+=3)je.minX=Math.min(je.minX,ke[Oe]),je.minY=Math.min(je.minY,ke[Oe+1]),je.maxX=Math.max(je.maxX,ke[Oe]),je.maxY=Math.max(je.maxY,ke[Oe+1])}function et(je,ke,Oe,Ye){if(ke.geometry){var ve=ke.geometry.coordinates,Ae=ke.geometry.type,Be=Math.pow(Oe.tolerance/((1<<Oe.maxZoom)*Oe.extent),2),Se=[],ge=ke.id;if(Oe.promoteId?ge=ke.properties[Oe.promoteId]:Oe.generateId&&(ge=Ye||0),Ae==="Point")Ve(ve,Se);else if(Ae==="MultiPoint")for(var Ce=0;Ce<ve.length;Ce++)Ve(ve[Ce],Se);else if(Ae==="LineString")Ne(ve,Se,Be,!1);else if(Ae==="MultiLineString"){if(Oe.lineMetrics){for(Ce=0;Ce<ve.length;Ce++)Ne(ve[Ce],Se=[],Be,!1),je.push(qe(ge,"LineString",Se,ke.properties));return}it(ve,Se,Be,!1)}else if(Ae==="Polygon")it(ve,Se,Be,!0);else{if(Ae!=="MultiPolygon"){if(Ae==="GeometryCollection"){for(Ce=0;Ce<ke.geometry.geometries.length;Ce++)et(je,{id:ge,geometry:ke.geometry.geometries[Ce],properties:ke.properties},Oe,Ye);return}throw new Error("Input data is not a valid GeoJSON object.")}for(Ce=0;Ce<ve.length;Ce++){var Xe=[];it(ve[Ce],Xe,Be,!0),Se.push(Xe)}}je.push(qe(ge,Ae,Se,ke.properties))}}function Ve(je,ke){ke.push(Re(je[0])),ke.push(pt(je[1])),ke.push(0)}function Ne(je,ke,Oe,Ye){for(var ve,Ae,Be=0,Se=0;Se<je.length;Se++){var ge=Re(je[Se][0]),Ce=pt(je[Se][1]);ke.push(ge),ke.push(Ce),ke.push(0),Se>0&&(Be+=Ye?(ve*Ce-ge*Ae)/2:Math.sqrt(Math.pow(ge-ve,2)+Math.pow(Ce-Ae,2))),ve=ge,Ae=Ce}var Xe=ke.length-3;ke[2]=1,_e(ke,0,Xe,Oe),ke[Xe+2]=1,ke.size=Math.abs(Be),ke.start=0,ke.end=ke.size}function it(je,ke,Oe,Ye){for(var ve=0;ve<je.length;ve++){var Ae=[];Ne(je[ve],Ae,Oe,Ye),ke.push(Ae)}}function Re(je){return je/360+.5}function pt(je){var ke=Math.sin(je*Math.PI/180),Oe=.5-.25*Math.log((1+ke)/(1-ke))/Math.PI;return Oe<0?0:Oe>1?1:Oe}function yt(je,ke,Oe,Ye,ve,Ae,Be,Se){if(Ye/=ke,Ae>=(Oe/=ke)&&Be<Ye)return je;if(Be<Oe||Ae>=Ye)return null;for(var ge=[],Ce=0;Ce<je.length;Ce++){var Xe=je[Ce],se=Xe.geometry,Le=Xe.type,Ke=ve===0?Xe.minX:Xe.minY,ht=ve===0?Xe.maxX:Xe.maxY;if(Ke>=Oe&&ht<Ye)ge.push(Xe);else if(!(ht<Oe||Ke>=Ye)){var At=[];if(Le==="Point"||Le==="MultiPoint")ct(se,At,Oe,Ye,ve);else if(Le==="LineString")xe(se,At,Oe,Ye,ve,!1,Se.lineMetrics);else if(Le==="MultiLineString")$e(se,At,Oe,Ye,ve,!1);else if(Le==="Polygon")$e(se,At,Oe,Ye,ve,!0);else if(Le==="MultiPolygon")for(var qt=0;qt<se.length;qt++){var nr=[];$e(se[qt],nr,Oe,Ye,ve,!0),nr.length&&At.push(nr)}if(At.length){if(Se.lineMetrics&&Le==="LineString"){for(qt=0;qt<At.length;qt++)ge.push(qe(Xe.id,Le,At[qt],Xe.tags));continue}Le!=="LineString"&&Le!=="MultiLineString"||(At.length===1?(Le="LineString",At=At[0]):Le="MultiLineString"),Le!=="Point"&&Le!=="MultiPoint"||(Le=At.length===3?"Point":"MultiPoint"),ge.push(qe(Xe.id,Le,At,Xe.tags))}}}return ge.length?ge:null}function ct(je,ke,Oe,Ye,ve){for(var Ae=0;Ae<je.length;Ae+=3){var Be=je[Ae+ve];Be>=Oe&&Be<=Ye&&(ke.push(je[Ae]),ke.push(je[Ae+1]),ke.push(je[Ae+2]))}}function xe(je,ke,Oe,Ye,ve,Ae,Be){for(var Se,ge,Ce=Ue(je),Xe=ve===0?Ht:Vt,se=je.start,Le=0;Le<je.length-3;Le+=3){var Ke=je[Le],ht=je[Le+1],At=je[Le+2],qt=je[Le+3],nr=je[Le+4],cr=ve===0?Ke:ht,lr=ve===0?qt:nr,hr=!1;Be&&(Se=Math.sqrt(Math.pow(Ke-qt,2)+Math.pow(ht-nr,2))),cr<Oe?lr>Oe&&(ge=Xe(Ce,Ke,ht,qt,nr,Oe),Be&&(Ce.start=se+Se*ge)):cr>Ye?lr<Ye&&(ge=Xe(Ce,Ke,ht,qt,nr,Ye),Be&&(Ce.start=se+Se*ge)):at(Ce,Ke,ht,At),lr<Oe&&cr>=Oe&&(ge=Xe(Ce,Ke,ht,qt,nr,Oe),hr=!0),lr>Ye&&cr<=Ye&&(ge=Xe(Ce,Ke,ht,qt,nr,Ye),hr=!0),!Ae&&hr&&(Be&&(Ce.end=se+Se*ge),ke.push(Ce),Ce=Ue(je)),Be&&(se+=Se)}var Ir=je.length-3;Ke=je[Ir],ht=je[Ir+1],At=je[Ir+2],(cr=ve===0?Ke:ht)>=Oe&&cr<=Ye&&at(Ce,Ke,ht,At),Ir=Ce.length-3,Ae&&Ir>=3&&(Ce[Ir]!==Ce[0]||Ce[Ir+1]!==Ce[1])&&at(Ce,Ce[0],Ce[1],Ce[2]),Ce.length&&ke.push(Ce)}function Ue(je){var ke=[];return ke.size=je.size,ke.start=je.start,ke.end=je.end,ke}function $e(je,ke,Oe,Ye,ve,Ae){for(var Be=0;Be<je.length;Be++)xe(je[Be],ke,Oe,Ye,ve,Ae,!1)}function at(je,ke,Oe,Ye){je.push(ke),je.push(Oe),je.push(Ye)}function Ht(je,ke,Oe,Ye,ve,Ae){var Be=(Ae-ke)/(Ye-ke);return je.push(Ae),je.push(Oe+(ve-Oe)*Be),je.push(1),Be}function Vt(je,ke,Oe,Ye,ve,Ae){var Be=(Ae-Oe)/(ve-Oe);return je.push(ke+(Ye-ke)*Be),je.push(Ae),je.push(1),Be}function Ft(je,ke){for(var Oe=[],Ye=0;Ye<je.length;Ye++){var ve,Ae=je[Ye],Be=Ae.type;if(Be==="Point"||Be==="MultiPoint"||Be==="LineString")ve=Gt(Ae.geometry,ke);else if(Be==="MultiLineString"||Be==="Polygon"){ve=[];for(var Se=0;Se<Ae.geometry.length;Se++)ve.push(Gt(Ae.geometry[Se],ke))}else if(Be==="MultiPolygon")for(ve=[],Se=0;Se<Ae.geometry.length;Se++){for(var ge=[],Ce=0;Ce<Ae.geometry[Se].length;Ce++)ge.push(Gt(Ae.geometry[Se][Ce],ke));ve.push(ge)}Oe.push(qe(Ae.id,Be,ve,Ae.tags))}return Oe}function Gt(je,ke){var Oe=[];Oe.size=je.size,je.start!==void 0&&(Oe.start=je.start,Oe.end=je.end);for(var Ye=0;Ye<je.length;Ye+=3)Oe.push(je[Ye]+ke,je[Ye+1],je[Ye+2]);return Oe}function Je(je,ke){if(je.transformed)return je;var Oe,Ye,ve,Ae=1<<je.z,Be=je.x,Se=je.y;for(Oe=0;Oe<je.features.length;Oe++){var ge=je.features[Oe],Ce=ge.geometry,Xe=ge.type;if(ge.geometry=[],Xe===1)for(Ye=0;Ye<Ce.length;Ye+=2)ge.geometry.push(ft(Ce[Ye],Ce[Ye+1],ke,Ae,Be,Se));else for(Ye=0;Ye<Ce.length;Ye++){var se=[];for(ve=0;ve<Ce[Ye].length;ve+=2)se.push(ft(Ce[Ye][ve],Ce[Ye][ve+1],ke,Ae,Be,Se));ge.geometry.push(se)}}return je.transformed=!0,je}function ft(je,ke,Oe,Ye,ve,Ae){return[Math.round(Oe*(je*Ye-ve)),Math.round(Oe*(ke*Ye-Ae))]}function St(je,ke,Oe,Ye,ve){for(var Ae=ke===ve.maxZoom?0:ve.tolerance/((1<<ke)*ve.extent),Be={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:Oe,y:Ye,z:ke,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Se=0;Se<je.length;Se++){Be.numFeatures++,Zt(Be,je[Se],Ae,ve);var ge=je[Se].minX,Ce=je[Se].minY,Xe=je[Se].maxX,se=je[Se].maxY;ge<Be.minX&&(Be.minX=ge),Ce<Be.minY&&(Be.minY=Ce),Xe>Be.maxX&&(Be.maxX=Xe),se>Be.maxY&&(Be.maxY=se)}return Be}function Zt(je,ke,Oe,Ye){var ve=ke.geometry,Ae=ke.type,Be=[];if(Ae==="Point"||Ae==="MultiPoint")for(var Se=0;Se<ve.length;Se+=3)Be.push(ve[Se]),Be.push(ve[Se+1]),je.numPoints++,je.numSimplified++;else if(Ae==="LineString")Jt(Be,ve,je,Oe,!1,!1);else if(Ae==="MultiLineString"||Ae==="Polygon")for(Se=0;Se<ve.length;Se++)Jt(Be,ve[Se],je,Oe,Ae==="Polygon",Se===0);else if(Ae==="MultiPolygon")for(var ge=0;ge<ve.length;ge++){var Ce=ve[ge];for(Se=0;Se<Ce.length;Se++)Jt(Be,Ce[Se],je,Oe,!0,Se===0)}if(Be.length){var Xe=ke.tags||null;if(Ae==="LineString"&&Ye.lineMetrics){for(var se in Xe={},ke.tags)Xe[se]=ke.tags[se];Xe.mapbox_clip_start=ve.start/ve.size,Xe.mapbox_clip_end=ve.end/ve.size}var Le={geometry:Be,type:Ae==="Polygon"||Ae==="MultiPolygon"?3:Ae==="LineString"||Ae==="MultiLineString"?2:1,tags:Xe};ke.id!==null&&(Le.id=ke.id),je.features.push(Le)}}function Jt(je,ke,Oe,Ye,ve,Ae){var Be=Ye*Ye;if(Ye>0&&ke.size<(ve?Be:Ye))Oe.numPoints+=ke.length/3;else{for(var Se=[],ge=0;ge<ke.length;ge+=3)(Ye===0||ke[ge+2]>Be)&&(Oe.numSimplified++,Se.push(ke[ge]),Se.push(ke[ge+1])),Oe.numPoints++;ve&&function(Ce,Xe){for(var se=0,Le=0,Ke=Ce.length,ht=Ke-2;Le<Ke;ht=Le,Le+=2)se+=(Ce[Le]-Ce[ht])*(Ce[Le+1]+Ce[ht+1]);if(se>0===Xe)for(Le=0,Ke=Ce.length;Le<Ke/2;Le+=2){var At=Ce[Le],qt=Ce[Le+1];Ce[Le]=Ce[Ke-2-Le],Ce[Le+1]=Ce[Ke-1-Le],Ce[Ke-2-Le]=At,Ce[Ke-1-Le]=qt}}(Se,Ae),je.push(Se)}}function Pt(je,ke){var Oe=(ke=this.options=function(ve,Ae){for(var Be in Ae)ve[Be]=Ae[Be];return ve}(Object.create(this.options),ke)).debug;if(Oe&&console.time("preprocess data"),ke.maxZoom<0||ke.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(ke.promoteId&&ke.generateId)throw new Error("promoteId and generateId cannot be used together.");var Ye=function(ve,Ae){var Be=[];if(ve.type==="FeatureCollection")for(var Se=0;Se<ve.features.length;Se++)et(Be,ve.features[Se],Ae,Se);else et(Be,ve.type==="Feature"?ve:{geometry:ve},Ae);return Be}(je,ke);this.tiles={},this.tileCoords=[],Oe&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",ke.indexMaxZoom,ke.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Ye=function(ve,Ae){var Be=Ae.buffer/Ae.extent,Se=ve,ge=yt(ve,1,-1-Be,Be,0,-1,2,Ae),Ce=yt(ve,1,1-Be,2+Be,0,-1,2,Ae);return(ge||Ce)&&(Se=yt(ve,1,-Be,1+Be,0,-1,2,Ae)||[],ge&&(Se=Ft(ge,1).concat(Se)),Ce&&(Se=Se.concat(Ft(Ce,-1)))),Se}(Ye,ke),Ye.length&&this.splitTile(Ye,0,0,0),Oe&&(Ye.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function rt(je,ke,Oe){return 32*((1<<je)*Oe+ke)+je}function Et(je,ke){return ke?je.properties[ke]:je.id}function kt(je,ke){if(je==null)return!0;if(je.type==="Feature")return Et(je,ke)!=null;if(je.type==="FeatureCollection"){const Oe=new Set;for(const Ye of je.features){const ve=Et(Ye,ke);if(ve==null||Oe.has(ve))return!1;Oe.add(ve)}return!0}return!1}function or(je,ke){const Oe=new Map;if(je!=null)if(je.type==="Feature")Oe.set(Et(je,ke),je);else for(const Ye of je.features)Oe.set(Et(Ye,ke),Ye);return Oe}Pt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Pt.prototype.splitTile=function(je,ke,Oe,Ye,ve,Ae,Be){for(var Se=[je,ke,Oe,Ye],ge=this.options,Ce=ge.debug;Se.length;){Ye=Se.pop(),Oe=Se.pop(),ke=Se.pop(),je=Se.pop();var Xe=1<<ke,se=rt(ke,Oe,Ye),Le=this.tiles[se];if(!Le&&(Ce>1&&console.time("creation"),Le=this.tiles[se]=St(je,ke,Oe,Ye,ge),this.tileCoords.push({z:ke,x:Oe,y:Ye}),Ce)){Ce>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",ke,Oe,Ye,Le.numFeatures,Le.numPoints,Le.numSimplified),console.timeEnd("creation"));var Ke="z"+ke;this.stats[Ke]=(this.stats[Ke]||0)+1,this.total++}if(Le.source=je,ve){if(ke===ge.maxZoom||ke===ve)continue;var ht=1<<ve-ke;if(Oe!==Math.floor(Ae/ht)||Ye!==Math.floor(Be/ht))continue}else if(ke===ge.indexMaxZoom||Le.numPoints<=ge.indexMaxPoints)continue;if(Le.source=null,je.length!==0){Ce>1&&console.time("clipping");var At,qt,nr,cr,lr,hr,Ir=.5*ge.buffer/ge.extent,Rr=.5-Ir,yr=.5+Ir,Ar=1+Ir;At=qt=nr=cr=null,lr=yt(je,Xe,Oe-Ir,Oe+yr,0,Le.minX,Le.maxX,ge),hr=yt(je,Xe,Oe+Rr,Oe+Ar,0,Le.minX,Le.maxX,ge),je=null,lr&&(At=yt(lr,Xe,Ye-Ir,Ye+yr,1,Le.minY,Le.maxY,ge),qt=yt(lr,Xe,Ye+Rr,Ye+Ar,1,Le.minY,Le.maxY,ge),lr=null),hr&&(nr=yt(hr,Xe,Ye-Ir,Ye+yr,1,Le.minY,Le.maxY,ge),cr=yt(hr,Xe,Ye+Rr,Ye+Ar,1,Le.minY,Le.maxY,ge),hr=null),Ce>1&&console.timeEnd("clipping"),Se.push(At||[],ke+1,2*Oe,2*Ye),Se.push(qt||[],ke+1,2*Oe,2*Ye+1),Se.push(nr||[],ke+1,2*Oe+1,2*Ye),Se.push(cr||[],ke+1,2*Oe+1,2*Ye+1)}}},Pt.prototype.getTile=function(je,ke,Oe){var Ye=this.options,ve=Ye.extent,Ae=Ye.debug;if(je<0||je>24)return null;var Be=1<<je,Se=rt(je,ke=(ke%Be+Be)%Be,Oe);if(this.tiles[Se])return Je(this.tiles[Se],ve);Ae>1&&console.log("drilling down to z%d-%d-%d",je,ke,Oe);for(var ge,Ce=je,Xe=ke,se=Oe;!ge&&Ce>0;)Ce--,Xe=Math.floor(Xe/2),se=Math.floor(se/2),ge=this.tiles[rt(Ce,Xe,se)];return ge&&ge.source?(Ae>1&&console.log("found parent tile z%d-%d-%d",Ce,Xe,se),Ae>1&&console.time("drilling down"),this.splitTile(ge.source,Ce,Xe,se,je,ke,Oe),Ae>1&&console.timeEnd("drilling down"),this.tiles[Se]?Je(this.tiles[Se],ve):null):null};class $t extends f{constructor(ke,Oe,Ye,ve){super(ke,Oe,Ye),this._dataUpdateable=new Map,this.loadGeoJSON=(Ae,Be)=>{const{promoteId:Se}=Ae;if(Ae.request)return l.f(Ae.request,(ge,Ce,Xe,se)=>{this._dataUpdateable=kt(Ce,Se)?or(Ce,Se):void 0,Be(ge,Ce,Xe,se)});if(typeof Ae.data=="string")try{const ge=JSON.parse(Ae.data);this._dataUpdateable=kt(ge,Se)?or(ge,Se):void 0,Be(null,ge)}catch{Be(new Error(`Input data given to '${Ae.source}' is not a valid GeoJSON object.`))}else Ae.dataDiff?this._dataUpdateable?(function(ge,Ce,Xe){var se,Le,Ke,ht;if(Ce.removeAll&&ge.clear(),Ce.remove)for(const At of Ce.remove)ge.delete(At);if(Ce.add)for(const At of Ce.add){const qt=Et(At,Xe);qt!=null&&ge.set(qt,At)}if(Ce.update)for(const At of Ce.update){let qt=ge.get(At.id);if(qt==null)continue;const nr=!At.removeAllProperties&&(((se=At.removeProperties)===null||se===void 0?void 0:se.length)>0||((Le=At.addOrUpdateProperties)===null||Le===void 0?void 0:Le.length)>0);if((At.newGeometry||At.removeAllProperties||nr)&&(qt=Object.assign({},qt),ge.set(At.id,qt),nr&&(qt.properties=Object.assign({},qt.properties))),At.newGeometry&&(qt.geometry=At.newGeometry),At.removeAllProperties)qt.properties={};else if(((Ke=At.removeProperties)===null||Ke===void 0?void 0:Ke.length)>0)for(const cr of At.removeProperties)Object.prototype.hasOwnProperty.call(qt.properties,cr)&&delete qt.properties[cr];if(((ht=At.addOrUpdateProperties)===null||ht===void 0?void 0:ht.length)>0)for(const{key:cr,value:lr}of At.addOrUpdateProperties)qt.properties[cr]=lr}}(this._dataUpdateable,Ae.dataDiff,Se),Be(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):Be(new Error(`Cannot update existing geojson data in ${Ae.source}`)):Be(new Error(`Input data given to '${Ae.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,ve&&(this.loadGeoJSON=ve)}loadGeoJSONTile(ke,Oe){const Ye=ke.tileID.canonical;if(!this._geoJSONIndex)return Oe(null,null);const ve=this._geoJSONIndex.getTile(Ye.z,Ye.x,Ye.y);if(!ve)return Oe(null,null);const Ae=new class{constructor(Se){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.N,this.length=Se.length,this._features=Se}feature(Se){return new class{constructor(ge){this._feature=ge,this.extent=l.N,this.type=ge.type,this.properties=ge.tags,"id"in ge&&!isNaN(ge.id)&&(this.id=parseInt(ge.id,10))}loadGeometry(){if(this._feature.type===1){const ge=[];for(const Ce of this._feature.geometry)ge.push([new l.P(Ce[0],Ce[1])]);return ge}{const ge=[];for(const Ce of this._feature.geometry){const Xe=[];for(const se of Ce)Xe.push(new l.P(se[0],se[1]));ge.push(Xe)}return ge}}toGeoJSON(ge,Ce,Xe){return v.call(this,ge,Ce,Xe)}}(this._features[Se])}}(ve.features);let Be=K(Ae);Be.byteOffset===0&&Be.byteLength===Be.buffer.byteLength||(Be=new Uint8Array(Be)),Oe(null,{vectorTile:Ae,rawData:Be.buffer})}loadData(ke,Oe){var Ye;(Ye=this._pendingRequest)===null||Ye===void 0||Ye.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const ve=!!(ke&&ke.request&&ke.request.collectResourceTiming)&&new l.bu(ke.request);this._pendingCallback=Oe,this._pendingRequest=this.loadGeoJSON(ke,(Ae,Be)=>{if(delete this._pendingCallback,delete this._pendingRequest,Ae||!Be)return Oe(Ae);if(typeof Be!="object")return Oe(new Error(`Input data given to '${ke.source}' is not a valid GeoJSON object.`));{y(Be,!0);try{if(ke.filter){const ge=l.bC(ke.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ge.result==="error")throw new Error(ge.value.map(Ce=>`${Ce.key}: ${Ce.message}`).join(", "));Be={type:"FeatureCollection",features:Be.features.filter(Ce=>ge.value.evaluate({zoom:0},Ce))}}this._geoJSONIndex=ke.cluster?new ie(function({superclusterOptions:ge,clusterProperties:Ce}){if(!Ce||!ge)return ge;const Xe={},se={},Le={accumulated:null,zoom:0},Ke={properties:null},ht=Object.keys(Ce);for(const At of ht){const[qt,nr]=Ce[At],cr=l.bC(nr),lr=l.bC(typeof qt=="string"?[qt,["accumulated"],["get",At]]:qt);Xe[At]=cr.value,se[At]=lr.value}return ge.map=At=>{Ke.properties=At;const qt={};for(const nr of ht)qt[nr]=Xe[nr].evaluate(Le,Ke);return qt},ge.reduce=(At,qt)=>{Ke.properties=qt;for(const nr of ht)Le.accumulated=At[nr],At[nr]=se[nr].evaluate(Le,Ke)},ge}(ke)).load(Be.features):function(ge,Ce){return new Pt(ge,Ce)}(Be,ke.geojsonVtOptions)}catch(ge){return Oe(ge)}this.loaded={};const Se={};if(ve){const ge=ve.finish();ge&&(Se.resourceTiming={},Se.resourceTiming[ke.source]=JSON.parse(JSON.stringify(ge)))}Oe(null,Se)}})}reloadTile(ke,Oe){const Ye=this.loaded;return Ye&&Ye[ke.uid]?super.reloadTile(ke,Oe):this.loadTile(ke,Oe)}removeSource(ke,Oe){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),Oe()}getClusterExpansionZoom(ke,Oe){try{Oe(null,this._geoJSONIndex.getClusterExpansionZoom(ke.clusterId))}catch(Ye){Oe(Ye)}}getClusterChildren(ke,Oe){try{Oe(null,this._geoJSONIndex.getChildren(ke.clusterId))}catch(Ye){Oe(Ye)}}getClusterLeaves(ke,Oe){try{Oe(null,this._geoJSONIndex.getLeaves(ke.clusterId,ke.limit,ke.offset))}catch(Ye){Oe(Ye)}}}class wt{constructor(ke){this.self=ke,this.actor=new l.C(ke,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:f,geojson:$t},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(Oe,Ye)=>{if(this.workerSourceTypes[Oe])throw new Error(`Worker source with name "${Oe}" already registered.`);this.workerSourceTypes[Oe]=Ye},this.self.registerRTLTextPlugin=Oe=>{if(l.bD.isParsed())throw new Error("RTL text plugin already registered.");l.bD.applyArabicShaping=Oe.applyArabicShaping,l.bD.processBidirectionalText=Oe.processBidirectionalText,l.bD.processStyledBidirectionalText=Oe.processStyledBidirectionalText}}setReferrer(ke,Oe){this.referrer=Oe}setImages(ke,Oe,Ye){this.availableImages[ke]=Oe;for(const ve in this.workerSources[ke]){const Ae=this.workerSources[ke][ve];for(const Be in Ae)Ae[Be].availableImages=Oe}Ye()}setLayers(ke,Oe,Ye){this.getLayerIndex(ke).replace(Oe),Ye()}updateLayers(ke,Oe,Ye){this.getLayerIndex(ke).update(Oe.layers,Oe.removedIds),Ye()}loadTile(ke,Oe,Ye){this.getWorkerSource(ke,Oe.type,Oe.source).loadTile(Oe,Ye)}loadDEMTile(ke,Oe,Ye){this.getDEMWorkerSource(ke,Oe.source).loadTile(Oe,Ye)}reloadTile(ke,Oe,Ye){this.getWorkerSource(ke,Oe.type,Oe.source).reloadTile(Oe,Ye)}abortTile(ke,Oe,Ye){this.getWorkerSource(ke,Oe.type,Oe.source).abortTile(Oe,Ye)}removeTile(ke,Oe,Ye){this.getWorkerSource(ke,Oe.type,Oe.source).removeTile(Oe,Ye)}removeDEMTile(ke,Oe){this.getDEMWorkerSource(ke,Oe.source).removeTile(Oe)}removeSource(ke,Oe,Ye){if(!this.workerSources[ke]||!this.workerSources[ke][Oe.type]||!this.workerSources[ke][Oe.type][Oe.source])return;const ve=this.workerSources[ke][Oe.type][Oe.source];delete this.workerSources[ke][Oe.type][Oe.source],ve.removeSource!==void 0?ve.removeSource(Oe,Ye):Ye()}loadWorkerSource(ke,Oe,Ye){try{this.self.importScripts(Oe.url),Ye()}catch(ve){Ye(ve.toString())}}syncRTLPluginState(ke,Oe,Ye){try{l.bD.setState(Oe);const ve=l.bD.getPluginURL();if(l.bD.isLoaded()&&!l.bD.isParsed()&&ve!=null){this.self.importScripts(ve);const Ae=l.bD.isParsed();Ye(Ae?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ve}`),Ae)}}catch(ve){Ye(ve.toString())}}getAvailableImages(ke){let Oe=this.availableImages[ke];return Oe||(Oe=[]),Oe}getLayerIndex(ke){let Oe=this.layerIndexes[ke];return Oe||(Oe=this.layerIndexes[ke]=new c),Oe}getWorkerSource(ke,Oe,Ye){return this.workerSources[ke]||(this.workerSources[ke]={}),this.workerSources[ke][Oe]||(this.workerSources[ke][Oe]={}),this.workerSources[ke][Oe][Ye]||(this.workerSources[ke][Oe][Ye]=new this.workerSourceTypes[Oe]({send:(ve,Ae,Be)=>{this.actor.send(ve,Ae,Be,ke)}},this.getLayerIndex(ke),this.getAvailableImages(ke))),this.workerSources[ke][Oe][Ye]}getDEMWorkerSource(ke,Oe){return this.demWorkerSources[ke]||(this.demWorkerSources[ke]={}),this.demWorkerSources[ke][Oe]||(this.demWorkerSources[ke][Oe]=new m),this.demWorkerSources[ke][Oe]}}return l.i()&&(self.worker=new wt(self)),wt}),o(["./shared"],function(l){var c="3.6.2";class u{static testProp(x){if(!u.docStyle)return x[0];for(let E=0;E<x.length;E++)if(x[E]in u.docStyle)return x[E];return x[0]}static create(x,E,B){const z=window.document.createElement(x);return E!==void 0&&(z.className=E),B&&B.appendChild(z),z}static createNS(x,E){return window.document.createElementNS(x,E)}static disableDrag(){u.docStyle&&u.selectProp&&(u.userSelect=u.docStyle[u.selectProp],u.docStyle[u.selectProp]="none")}static enableDrag(){u.docStyle&&u.selectProp&&(u.docStyle[u.selectProp]=u.userSelect)}static setTransform(x,E){x.style[u.transformProp]=E}static addEventListener(x,E,B,z={}){x.addEventListener(E,B,"passive"in z?z:z.capture)}static removeEventListener(x,E,B,z={}){x.removeEventListener(E,B,"passive"in z?z:z.capture)}static suppressClickInternal(x){x.preventDefault(),x.stopPropagation(),window.removeEventListener("click",u.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",u.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",u.suppressClickInternal,!0)},0)}static mousePos(x,E){const B=x.getBoundingClientRect();return new l.P(E.clientX-B.left-x.clientLeft,E.clientY-B.top-x.clientTop)}static touchPos(x,E){const B=x.getBoundingClientRect(),z=[];for(let J=0;J<E.length;J++)z.push(new l.P(E[J].clientX-B.left-x.clientLeft,E[J].clientY-B.top-x.clientTop));return z}static mouseButton(x){return x.button}static remove(x){x.parentNode&&x.parentNode.removeChild(x)}}u.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,u.selectProp=u.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),u.transformProp=u.testProp(["transform","WebkitTransform"]);const d={supported:!1,testSupport:function(Z){!f&&h&&(m?g(Z):p=Z)}};let p,h,f=!1,m=!1;function g(Z){const x=Z.createTexture();Z.bindTexture(Z.TEXTURE_2D,x);try{if(Z.texImage2D(Z.TEXTURE_2D,0,Z.RGBA,Z.RGBA,Z.UNSIGNED_BYTE,h),Z.isContextLost())return;d.supported=!0}catch{}Z.deleteTexture(x),f=!0}var T,y;typeof document<"u"&&(h=document.createElement("img"),h.onload=function(){p&&g(p),p=null,m=!0},h.onerror=function(){f=!0,p=null},h.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(Z){let x,E,B,z;Z.resetRequestQueue=()=>{x=[],E=0,B=0,z={}},Z.addThrottleControl=He=>{const De=B++;return z[De]=He,De},Z.removeThrottleControl=He=>{delete z[He],fe()},Z.getImage=(He,De,We=!0)=>{d.supported&&(He.headers||(He.headers={}),He.headers.accept="image/webp,*/*");const st={requestParameters:He,supportImageRefresh:We,callback:De,cancelled:!1,completed:!1,cancel:()=>{st.completed||st.cancelled||(st.cancelled=!0,st.innerRequest&&(st.innerRequest.cancel(),E--),fe())}};return x.push(st),fe(),st};const J=He=>{const{requestParameters:De,supportImageRefresh:We,callback:st}=He;return l.e(De,{type:"image"}),(We!==!1||l.i()||l.g(De.url)||De.headers&&!Object.keys(De.headers).reduce((Qt,bt)=>Qt&&bt==="accept",!0)?l.m:we)(De,(Qt,bt,Ct,Tt)=>{de(He,st,Qt,bt,Ct,Tt)})},de=(He,De,We,st,Qt,bt)=>{We?De(We):st instanceof HTMLImageElement||l.a(st)?De(null,st):st&&((Ct,Tt)=>{typeof createImageBitmap=="function"?l.b(Ct,Tt):l.d(Ct,Tt)})(st,(Ct,Tt)=>{Ct!=null?De(Ct):Tt!=null&&De(null,Tt,{cacheControl:Qt,expires:bt})}),He.cancelled||(He.completed=!0,E--,fe())},fe=()=>{const He=(()=>{const De=Object.keys(z);let We=!1;if(De.length>0){for(const st of De)if(We=z[st](),We)break}return We})()?l.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:l.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let De=E;De<He&&x.length>0;De++){const We=x.shift();if(We.cancelled){De--;continue}const st=J(We);E++,We.innerRequest=st}},we=(He,De)=>{const We=new Image,st=He.url;let Qt=!1;const bt=He.credentials;return bt&&bt==="include"?We.crossOrigin="use-credentials":(bt&&bt==="same-origin"||!l.s(st))&&(We.crossOrigin="anonymous"),We.fetchPriority="high",We.onload=()=>{De(null,We),We.onerror=We.onload=null},We.onerror=()=>{Qt||De(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")),We.onerror=We.onload=null},We.src=st,{cancel:()=>{Qt=!0,We.src=""}}}}(T||(T={})),T.resetRequestQueue(),function(Z){Z.Glyphs="Glyphs",Z.Image="Image",Z.Source="Source",Z.SpriteImage="SpriteImage",Z.SpriteJSON="SpriteJSON",Z.Style="Style",Z.Tile="Tile",Z.Unknown="Unknown"}(y||(y={}));class v{constructor(x){this._transformRequestFn=x}transformRequest(x,E){return this._transformRequestFn&&this._transformRequestFn(x,E)||{url:x}}normalizeSpriteURL(x,E,B){const z=function(J){const de=J.match(_);if(!de)throw new Error(`Unable to parse URL "${J}"`);return{protocol:de[1],authority:de[2],path:de[3]||"/",params:de[4]?de[4].split("&"):[]}}(x);return z.path+=`${E}${B}`,function(J){const de=J.params.length?`?${J.params.join("&")}`:"";return`${J.protocol}://${J.authority}${J.path}${de}`}(z)}setTransformRequest(x){this._transformRequestFn=x}}const _=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function b(Z){var x=new l.A(3);return x[0]=Z[0],x[1]=Z[1],x[2]=Z[2],x}var L,w=function(Z,x,E){return Z[0]=x[0]-E[0],Z[1]=x[1]-E[1],Z[2]=x[2]-E[2],Z};L=new l.A(3),l.A!=Float32Array&&(L[0]=0,L[1]=0,L[2]=0);var k=function(Z){var x=Z[0],E=Z[1];return x*x+E*E};function C(Z){const x=[];if(typeof Z=="string")x.push({id:"default",url:Z});else if(Z&&Z.length>0){const E=[];for(const{id:B,url:z}of Z){const J=`${B}${z}`;E.indexOf(J)===-1&&(E.push(J),x.push({id:B,url:z}))}}return x}function A(Z,x,E,B,z){if(B)return void Z(B);if(z!==Object.values(x).length||z!==Object.values(E).length)return;const J={};for(const de in x){J[de]={};const fe=l.h.getImageCanvasContext(E[de]),we=x[de];for(const He in we){const{width:De,height:We,x:st,y:Qt,sdf:bt,pixelRatio:Ct,stretchX:Tt,stretchY:Kt,content:sr}=we[He];J[de][He]={data:null,pixelRatio:Ct,sdf:bt,stretchX:Tt,stretchY:Kt,content:sr,spriteData:{width:De,height:We,x:st,y:Qt,context:fe}}}}Z(null,J)}(function(){var Z=new l.A(2);l.A!=Float32Array&&(Z[0]=0,Z[1]=0)})();class O{constructor(x,E,B,z){this.context=x,this.format=B,this.texture=x.gl.createTexture(),this.update(E,z)}update(x,E,B){const{width:z,height:J}=x,de=!(this.size&&this.size[0]===z&&this.size[1]===J||B),{context:fe}=this,{gl:we}=fe;if(this.useMipmap=!!(E&&E.useMipmap),we.bindTexture(we.TEXTURE_2D,this.texture),fe.pixelStoreUnpackFlipY.set(!1),fe.pixelStoreUnpack.set(1),fe.pixelStoreUnpackPremultiplyAlpha.set(this.format===we.RGBA&&(!E||E.premultiply!==!1)),de)this.size=[z,J],x instanceof HTMLImageElement||x instanceof HTMLCanvasElement||x instanceof HTMLVideoElement||x instanceof ImageData||l.a(x)?we.texImage2D(we.TEXTURE_2D,0,this.format,this.format,we.UNSIGNED_BYTE,x):we.texImage2D(we.TEXTURE_2D,0,this.format,z,J,0,this.format,we.UNSIGNED_BYTE,x.data);else{const{x:He,y:De}=B||{x:0,y:0};x instanceof HTMLImageElement||x instanceof HTMLCanvasElement||x instanceof HTMLVideoElement||x instanceof ImageData||l.a(x)?we.texSubImage2D(we.TEXTURE_2D,0,He,De,we.RGBA,we.UNSIGNED_BYTE,x):we.texSubImage2D(we.TEXTURE_2D,0,He,De,z,J,we.RGBA,we.UNSIGNED_BYTE,x.data)}this.useMipmap&&this.isSizePowerOfTwo()&&we.generateMipmap(we.TEXTURE_2D)}bind(x,E,B){const{context:z}=this,{gl:J}=z;J.bindTexture(J.TEXTURE_2D,this.texture),B!==J.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(B=J.LINEAR),x!==this.filter&&(J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MAG_FILTER,x),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MIN_FILTER,B||x),this.filter=x),E!==this.wrap&&(J.texParameteri(J.TEXTURE_2D,J.TEXTURE_WRAP_S,E),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_WRAP_T,E),this.wrap=E)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:x}=this.context;x.deleteTexture(this.texture),this.texture=null}}function N(Z){const{userImage:x}=Z;return!!(x&&x.render&&x.render())&&(Z.data.replace(new Uint8Array(x.data.buffer)),!0)}class I extends l.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new l.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(x){if(this.loaded!==x&&(this.loaded=x,x)){for(const{ids:E,callback:B}of this.requestors)this._notify(E,B);this.requestors=[]}}getImage(x){const E=this.images[x];if(E&&!E.data&&E.spriteData){const B=E.spriteData;E.data=new l.R({width:B.width,height:B.height},B.context.getImageData(B.x,B.y,B.width,B.height).data),E.spriteData=null}return E}addImage(x,E){if(this.images[x])throw new Error(`Image id ${x} already exist, use updateImage instead`);this._validate(x,E)&&(this.images[x]=E)}_validate(x,E){let B=!0;const z=E.data||E.spriteData;return this._validateStretch(E.stretchX,z&&z.width)||(this.fire(new l.j(new Error(`Image "${x}" has invalid "stretchX" value`))),B=!1),this._validateStretch(E.stretchY,z&&z.height)||(this.fire(new l.j(new Error(`Image "${x}" has invalid "stretchY" value`))),B=!1),this._validateContent(E.content,E)||(this.fire(new l.j(new Error(`Image "${x}" has invalid "content" value`))),B=!1),B}_validateStretch(x,E){if(!x)return!0;let B=0;for(const z of x){if(z[0]<B||z[1]<z[0]||E<z[1])return!1;B=z[1]}return!0}_validateContent(x,E){if(!x)return!0;if(x.length!==4)return!1;const B=E.spriteData,z=B&&B.width||E.data.width,J=B&&B.height||E.data.height;return!(x[0]<0||z<x[0]||x[1]<0||J<x[1]||x[2]<0||z<x[2]||x[3]<0||J<x[3]||x[2]<x[0]||x[3]<x[1])}updateImage(x,E,B=!0){const z=this.getImage(x);if(B&&(z.data.width!==E.data.width||z.data.height!==E.data.height))throw new Error(`size mismatch between old image (${z.data.width}x${z.data.height}) and new image (${E.data.width}x${E.data.height}).`);E.version=z.version+1,this.images[x]=E,this.updatedImages[x]=!0}removeImage(x){const E=this.images[x];delete this.images[x],delete this.patterns[x],E.userImage&&E.userImage.onRemove&&E.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(x,E){let B=!0;if(!this.isLoaded())for(const z of x)this.images[z]||(B=!1);this.isLoaded()||B?this._notify(x,E):this.requestors.push({ids:x,callback:E})}_notify(x,E){const B={};for(const z of x){let J=this.getImage(z);J||(this.fire(new l.k("styleimagemissing",{id:z})),J=this.getImage(z)),J?B[z]={data:J.data.clone(),pixelRatio:J.pixelRatio,sdf:J.sdf,version:J.version,stretchX:J.stretchX,stretchY:J.stretchY,content:J.content,hasRenderCallback:!!(J.userImage&&J.userImage.render)}:l.w(`Image "${z}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}E(null,B)}getPixelSize(){const{width:x,height:E}=this.atlasImage;return{width:x,height:E}}getPattern(x){const E=this.patterns[x],B=this.getImage(x);if(!B)return null;if(E&&E.position.version===B.version)return E.position;if(E)E.position.version=B.version;else{const z={w:B.data.width+2,h:B.data.height+2,x:0,y:0},J=new l.I(z,B);this.patterns[x]={bin:z,position:J}}return this._updatePatternAtlas(),this.patterns[x].position}bind(x){const E=x.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new O(x,this.atlasImage,E.RGBA),this.atlasTexture.bind(E.LINEAR,E.CLAMP_TO_EDGE)}_updatePatternAtlas(){const x=[];for(const J in this.patterns)x.push(this.patterns[J].bin);const{w:E,h:B}=l.p(x),z=this.atlasImage;z.resize({width:E||1,height:B||1});for(const J in this.patterns){const{bin:de}=this.patterns[J],fe=de.x+1,we=de.y+1,He=this.getImage(J).data,De=He.width,We=He.height;l.R.copy(He,z,{x:0,y:0},{x:fe,y:we},{width:De,height:We}),l.R.copy(He,z,{x:0,y:We-1},{x:fe,y:we-1},{width:De,height:1}),l.R.copy(He,z,{x:0,y:0},{x:fe,y:we+We},{width:De,height:1}),l.R.copy(He,z,{x:De-1,y:0},{x:fe-1,y:we},{width:1,height:We}),l.R.copy(He,z,{x:0,y:0},{x:fe+De,y:we},{width:1,height:We})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(x){for(const E of x){if(this.callbackDispatchedThisFrame[E])continue;this.callbackDispatchedThisFrame[E]=!0;const B=this.getImage(E);B||l.w(`Image with ID: "${E}" was not found`),N(B)&&this.updateImage(E,B)}}}const R=1e20;function D(Z,x,E,B,z,J,de,fe,we){for(let He=x;He<x+B;He++)j(Z,E*J+He,J,z,de,fe,we);for(let He=E;He<E+z;He++)j(Z,He*J+x,1,B,de,fe,we)}function j(Z,x,E,B,z,J,de){J[0]=0,de[0]=-R,de[1]=R,z[0]=Z[x];for(let fe=1,we=0,He=0;fe<B;fe++){z[fe]=Z[x+fe*E];const De=fe*fe;do{const We=J[we];He=(z[fe]-z[We]+De-We*We)/(fe-We)/2}while(He<=de[we]&&--we>-1);we++,J[we]=fe,de[we]=He,de[we+1]=R}for(let fe=0,we=0;fe<B;fe++){for(;de[we+1]<fe;)we++;const He=J[we],De=fe-He;Z[x+fe*E]=z[He]+De*De}}class G{constructor(x,E){this.requestManager=x,this.localIdeographFontFamily=E,this.entries={}}setURL(x){this.url=x}getGlyphs(x,E){const B=[];for(const z in x)for(const J of x[z])B.push({stack:z,id:J});l.o(B,({stack:z,id:J},de)=>{let fe=this.entries[z];fe||(fe=this.entries[z]={glyphs:{},requests:{},ranges:{}});let we=fe.glyphs[J];if(we!==void 0)return void de(null,{stack:z,id:J,glyph:we});if(we=this._tinySDF(fe,z,J),we)return fe.glyphs[J]=we,void de(null,{stack:z,id:J,glyph:we});const He=Math.floor(J/256);if(256*He>65535)return void de(new Error("glyphs > 65535 not supported"));if(fe.ranges[He])return void de(null,{stack:z,id:J,glyph:we});if(!this.url)return void de(new Error("glyphsUrl is not set"));let De=fe.requests[He];De||(De=fe.requests[He]=[],G.loadGlyphRange(z,He,this.url,this.requestManager,(We,st)=>{if(st){for(const Qt in st)this._doesCharSupportLocalGlyph(+Qt)||(fe.glyphs[+Qt]=st[+Qt]);fe.ranges[He]=!0}for(const Qt of De)Qt(We,st);delete fe.requests[He]})),De.push((We,st)=>{We?de(We):st&&de(null,{stack:z,id:J,glyph:st[J]||null})})},(z,J)=>{if(z)E(z);else if(J){const de={};for(const{stack:fe,id:we,glyph:He}of J)(de[fe]||(de[fe]={}))[we]=He&&{id:He.id,bitmap:He.bitmap.clone(),metrics:He.metrics};E(null,de)}})}_doesCharSupportLocalGlyph(x){return!!this.localIdeographFontFamily&&(l.u["CJK Unified Ideographs"](x)||l.u["Hangul Syllables"](x)||l.u.Hiragana(x)||l.u.Katakana(x))}_tinySDF(x,E,B){const z=this.localIdeographFontFamily;if(!z||!this._doesCharSupportLocalGlyph(B))return;let J=x.tinySDF;if(!J){let fe="400";/bold/i.test(E)?fe="900":/medium/i.test(E)?fe="500":/light/i.test(E)&&(fe="200"),J=x.tinySDF=new G.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:z,fontWeight:fe})}const de=J.draw(String.fromCharCode(B));return{id:B,bitmap:new l.q({width:de.width||60,height:de.height||60},de.data),metrics:{width:de.glyphWidth/2||24,height:de.glyphHeight/2||24,left:de.glyphLeft/2+.5||0,top:de.glyphTop/2-27.5||-8,advance:de.glyphAdvance/2||24,isDoubleResolution:!0}}}}G.loadGlyphRange=function(Z,x,E,B,z){const J=256*x,de=J+255,fe=B.transformRequest(E.replace("{fontstack}",Z).replace("{range}",`${J}-${de}`),y.Glyphs);l.l(fe,(we,He)=>{if(we)z(we);else if(He){const De={};for(const We of l.n(He))De[We.id]=We;z(null,De)}})},G.TinySDF=class{constructor({fontSize:Z=24,buffer:x=3,radius:E=8,cutoff:B=.25,fontFamily:z="sans-serif",fontWeight:J="normal",fontStyle:de="normal"}={}){this.buffer=x,this.cutoff=B,this.radius=E;const fe=this.size=Z+4*x,we=this._createCanvas(fe),He=this.ctx=we.getContext("2d",{willReadFrequently:!0});He.font=`${de} ${J} ${Z}px ${z}`,He.textBaseline="alphabetic",He.textAlign="left",He.fillStyle="black",this.gridOuter=new Float64Array(fe*fe),this.gridInner=new Float64Array(fe*fe),this.f=new Float64Array(fe),this.z=new Float64Array(fe+1),this.v=new Uint16Array(fe)}_createCanvas(Z){const x=document.createElement("canvas");return x.width=x.height=Z,x}draw(Z){const{width:x,actualBoundingBoxAscent:E,actualBoundingBoxDescent:B,actualBoundingBoxLeft:z,actualBoundingBoxRight:J}=this.ctx.measureText(Z),de=Math.ceil(E),fe=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(J-z))),we=Math.min(this.size-this.buffer,de+Math.ceil(B)),He=fe+2*this.buffer,De=we+2*this.buffer,We=Math.max(He*De,0),st=new Uint8ClampedArray(We),Qt={data:st,width:He,height:De,glyphWidth:fe,glyphHeight:we,glyphTop:de,glyphLeft:0,glyphAdvance:x};if(fe===0||we===0)return Qt;const{ctx:bt,buffer:Ct,gridInner:Tt,gridOuter:Kt}=this;bt.clearRect(Ct,Ct,fe,we),bt.fillText(Z,Ct,Ct+de);const sr=bt.getImageData(Ct,Ct,fe,we);Kt.fill(R,0,We),Tt.fill(0,0,We);for(let It=0;It<we;It++)for(let tr=0;tr<fe;tr++){const pr=sr.data[4*(It*fe+tr)+3]/255;if(pr===0)continue;const ur=(It+Ct)*He+tr+Ct;if(pr===1)Kt[ur]=0,Tt[ur]=R;else{const Tr=.5-pr;Kt[ur]=Tr>0?Tr*Tr:0,Tt[ur]=Tr<0?Tr*Tr:0}}D(Kt,0,0,He,De,He,this.f,this.v,this.z),D(Tt,Ct,Ct,fe,we,He,this.f,this.v,this.z);for(let It=0;It<We;It++){const tr=Math.sqrt(Kt[It])-Math.sqrt(Tt[It]);st[It]=Math.round(255-255*(tr/this.radius+this.cutoff))}return Qt}};class P{constructor(){this.specification=l.v.light.position}possiblyEvaluate(x,E){return l.z(x.expression.evaluate(E))}interpolate(x,E,B){return{x:l.B.number(x.x,E.x,B),y:l.B.number(x.y,E.y,B),z:l.B.number(x.z,E.z,B)}}}let W;class K extends l.E{constructor(x){super(),W=W||new l.r({anchor:new l.D(l.v.light.anchor),position:new P,color:new l.D(l.v.light.color),intensity:new l.D(l.v.light.intensity)}),this._transitionable=new l.T(W),this.setLight(x),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(x,E={}){if(!this._validate(l.t,x,E))for(const B in x){const z=x[B];B.endsWith("-transition")?this._transitionable.setTransition(B.slice(0,-11),z):this._transitionable.setValue(B,z)}}updateTransitions(x){this._transitioning=this._transitionable.transitioned(x,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(x){this.properties=this._transitioning.possiblyEvaluate(x)}_validate(x,E,B){return(!B||B.validate!==!1)&&l.x(this,x.call(l.y,l.e({value:E,style:{glyphs:!0,sprite:!0},styleSpec:l.v})))}}class U{constructor(x,E){this.width=x,this.height=E,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(x,E){const B=x.join(",")+String(E);return this.dashEntry[B]||(this.dashEntry[B]=this.addDash(x,E)),this.dashEntry[B]}getDashRanges(x,E,B){const z=[];let J=x.length%2==1?-x[x.length-1]*B:0,de=x[0]*B,fe=!0;z.push({left:J,right:de,isDash:fe,zeroLength:x[0]===0});let we=x[0];for(let He=1;He<x.length;He++){fe=!fe;const De=x[He];J=we*B,we+=De,de=we*B,z.push({left:J,right:de,isDash:fe,zeroLength:De===0})}return z}addRoundDash(x,E,B){const z=E/2;for(let J=-B;J<=B;J++){const de=this.width*(this.nextRow+B+J);let fe=0,we=x[fe];for(let He=0;He<this.width;He++){He/we.right>1&&(we=x[++fe]);const De=Math.abs(He-we.left),We=Math.abs(He-we.right),st=Math.min(De,We);let Qt;const bt=J/B*(z+1);if(we.isDash){const Ct=z-Math.abs(bt);Qt=Math.sqrt(st*st+Ct*Ct)}else Qt=z-Math.sqrt(st*st+bt*bt);this.data[de+He]=Math.max(0,Math.min(255,Qt+128))}}}addRegularDash(x){for(let fe=x.length-1;fe>=0;--fe){const we=x[fe],He=x[fe+1];we.zeroLength?x.splice(fe,1):He&&He.isDash===we.isDash&&(He.left=we.left,x.splice(fe,1))}const E=x[0],B=x[x.length-1];E.isDash===B.isDash&&(E.left=B.left-this.width,B.right=E.right+this.width);const z=this.width*this.nextRow;let J=0,de=x[J];for(let fe=0;fe<this.width;fe++){fe/de.right>1&&(de=x[++J]);const we=Math.abs(fe-de.left),He=Math.abs(fe-de.right),De=Math.min(we,He);this.data[z+fe]=Math.max(0,Math.min(255,(de.isDash?De:-De)+128))}}addDash(x,E){const B=E?7:0,z=2*B+1;if(this.nextRow+z>this.height)return l.w("LineAtlas out of space"),null;let J=0;for(let fe=0;fe<x.length;fe++)J+=x[fe];if(J!==0){const fe=this.width/J,we=this.getDashRanges(x,this.width,fe);E?this.addRoundDash(we,fe,B):this.addRegularDash(we)}const de={y:(this.nextRow+B+.5)/this.height,height:2*B/this.height,width:J};return this.nextRow+=z,this.dirty=!0,de}bind(x){const E=x.gl;this.texture?(E.bindTexture(E.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,E.texSubImage2D(E.TEXTURE_2D,0,0,0,this.width,this.height,E.ALPHA,E.UNSIGNED_BYTE,this.data))):(this.texture=E.createTexture(),E.bindTexture(E.TEXTURE_2D,this.texture),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,E.REPEAT),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,E.REPEAT),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MIN_FILTER,E.LINEAR),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MAG_FILTER,E.LINEAR),E.texImage2D(E.TEXTURE_2D,0,E.ALPHA,this.width,this.height,0,E.ALPHA,E.UNSIGNED_BYTE,this.data))}}class X{constructor(x,E,B){this.workerPool=x,this.actors=[],this.currentActor=0,this.id=B;const z=this.workerPool.acquire(B);for(let J=0;J<z.length;J++){const de=new l.C(z[J],E,B);de.name=`Worker ${J}`,this.actors.push(de)}if(!this.actors.length)throw new Error("No actors found")}broadcast(x,E,B){l.o(this.actors,(z,J)=>{z.send(x,E,J)},B=B||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(x=!0){this.actors.forEach(E=>{E.remove()}),this.actors=[],x&&this.workerPool.release(this.id)}}function ee(Z,x,E){const B=function(z,J){if(z)return E(z);if(J){const de=l.F(l.e(J,Z),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);J.vector_layers&&(de.vectorLayers=J.vector_layers,de.vectorLayerIds=de.vectorLayers.map(fe=>fe.id)),E(null,de)}};return Z.url?l.f(x.transformRequest(Z.url,y.Source),B):l.h.frame(()=>B(null,Z))}class oe{constructor(x,E){x&&(E?this.setSouthWest(x).setNorthEast(E):Array.isArray(x)&&(x.length===4?this.setSouthWest([x[0],x[1]]).setNorthEast([x[2],x[3]]):this.setSouthWest(x[0]).setNorthEast(x[1])))}setNorthEast(x){return this._ne=x instanceof l.L?new l.L(x.lng,x.lat):l.L.convert(x),this}setSouthWest(x){return this._sw=x instanceof l.L?new l.L(x.lng,x.lat):l.L.convert(x),this}extend(x){const E=this._sw,B=this._ne;let z,J;if(x instanceof l.L)z=x,J=x;else{if(!(x instanceof oe))return Array.isArray(x)?x.length===4||x.every(Array.isArray)?this.extend(oe.convert(x)):this.extend(l.L.convert(x)):x&&("lng"in x||"lon"in x)&&"lat"in x?this.extend(l.L.convert(x)):this;if(z=x._sw,J=x._ne,!z||!J)return this}return E||B?(E.lng=Math.min(z.lng,E.lng),E.lat=Math.min(z.lat,E.lat),B.lng=Math.max(J.lng,B.lng),B.lat=Math.max(J.lat,B.lat)):(this._sw=new l.L(z.lng,z.lat),this._ne=new l.L(J.lng,J.lat)),this}getCenter(){return new l.L((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new l.L(this.getWest(),this.getNorth())}getSouthEast(){return new l.L(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(x){const{lng:E,lat:B}=l.L.convert(x);let z=this._sw.lng<=E&&E<=this._ne.lng;return this._sw.lng>this._ne.lng&&(z=this._sw.lng>=E&&E>=this._ne.lng),this._sw.lat<=B&&B<=this._ne.lat&&z}static convert(x){return x instanceof oe?x:x&&new oe(x)}static fromLngLat(x,E=0){const B=360*E/40075017,z=B/Math.cos(Math.PI/180*x.lat);return new oe(new l.L(x.lng-z,x.lat-B),new l.L(x.lng+z,x.lat+B))}}class he{constructor(x,E,B){this.bounds=oe.convert(this.validateBounds(x)),this.minzoom=E||0,this.maxzoom=B||24}validateBounds(x){return Array.isArray(x)&&x.length===4?[Math.max(-180,x[0]),Math.max(-90,x[1]),Math.min(180,x[2]),Math.min(90,x[3])]:[-180,-90,180,90]}contains(x){const E=Math.pow(2,x.z),B=Math.floor(l.G(this.bounds.getWest())*E),z=Math.floor(l.H(this.bounds.getNorth())*E),J=Math.ceil(l.G(this.bounds.getEast())*E),de=Math.ceil(l.H(this.bounds.getSouth())*E);return x.x>=B&&x.x<J&&x.y>=z&&x.y<de}}class me extends l.E{constructor(x,E,B,z){if(super(),this.load=()=>{this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this._tileJSONRequest=ee(this._options,this.map._requestManager,(J,de)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),J?this.fire(new l.j(J)):de&&(l.e(this,de),de.bounds&&(this.tileBounds=new he(de.bounds,this.minzoom,this.maxzoom)),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>l.e({},this._options),this.id=x,this.dispatcher=B,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,l.e(this,l.F(E,["url","scheme","tileSize","promoteId"])),this._options=l.e({type:"vector"},E),this._collectResourceTiming=E.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(z)}loaded(){return this._loaded}hasTile(x){return!this.tileBounds||this.tileBounds.contains(x.canonical)}onAdd(x){this.map=x,this.load()}setSourceProperty(x){this._tileJSONRequest&&this._tileJSONRequest.cancel(),x(),this.load()}setTiles(x){return this.setSourceProperty(()=>{this._options.tiles=x}),this}setUrl(x){return this.setSourceProperty(()=>{this.url=x,this._options.url=x}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(x,E){const B=x.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),z={request:this.map._requestManager.transformRequest(B,y.Tile),uid:x.uid,tileID:x.tileID,zoom:x.tileID.overscaledZ,tileSize:this.tileSize*x.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function J(de,fe){return delete x.request,x.aborted?E(null):de&&de.status!==404?E(de):(fe&&fe.resourceTiming&&(x.resourceTiming=fe.resourceTiming),this.map._refreshExpiredTiles&&fe&&x.setExpiryData(fe),x.loadVectorData(fe,this.map.painter),E(null),void(x.reloadCallback&&(this.loadTile(x,x.reloadCallback),x.reloadCallback=null)))}z.request.collectResourceTiming=this._collectResourceTiming,x.actor&&x.state!=="expired"?x.state==="loading"?x.reloadCallback=E:x.request=x.actor.send("reloadTile",z,J.bind(this)):(x.actor=this.dispatcher.getActor(),x.request=x.actor.send("loadTile",z,J.bind(this)))}abortTile(x){x.request&&(x.request.cancel(),delete x.request),x.actor&&x.actor.send("abortTile",{uid:x.uid,type:this.type,source:this.id},void 0)}unloadTile(x){x.unloadVectorData(),x.actor&&x.actor.send("removeTile",{uid:x.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class ie extends l.E{constructor(x,E,B,z){super(),this.id=x,this.dispatcher=B,this.setEventedParent(z),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=l.e({type:"raster"},E),l.e(this,l.F(E,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this._tileJSONRequest=ee(this._options,this.map._requestManager,(x,E)=>{this._tileJSONRequest=null,this._loaded=!0,x?this.fire(new l.j(x)):E&&(l.e(this,E),E.bounds&&(this.tileBounds=new he(E.bounds,this.minzoom,this.maxzoom)),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(x){this.map=x,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(x){this._tileJSONRequest&&this._tileJSONRequest.cancel(),x(),this.load()}setTiles(x){return this.setSourceProperty(()=>{this._options.tiles=x}),this}serialize(){return l.e({},this._options)}hasTile(x){return!this.tileBounds||this.tileBounds.contains(x.canonical)}loadTile(x,E){const B=x.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);x.request=T.getImage(this.map._requestManager.transformRequest(B,y.Tile),(z,J,de)=>{if(delete x.request,x.aborted)x.state="unloaded",E(null);else if(z)x.state="errored",E(z);else if(J){this.map._refreshExpiredTiles&&de&&x.setExpiryData(de);const fe=this.map.painter.context,we=fe.gl;x.texture=this.map.painter.getTileTexture(J.width),x.texture?x.texture.update(J,{useMipmap:!0}):(x.texture=new O(fe,J,we.RGBA,{useMipmap:!0}),x.texture.bind(we.LINEAR,we.CLAMP_TO_EDGE,we.LINEAR_MIPMAP_NEAREST),fe.extTextureFilterAnisotropic&&we.texParameterf(we.TEXTURE_2D,fe.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,fe.extTextureFilterAnisotropicMax)),x.state="loaded",E(null)}},this.map._refreshExpiredTiles)}abortTile(x,E){x.request&&(x.request.cancel(),delete x.request),E()}unloadTile(x,E){x.texture&&this.map.painter.saveTileTexture(x.texture),E()}hasTransition(){return!1}}class be extends ie{constructor(x,E,B,z){super(x,E,B,z),this.type="raster-dem",this.maxzoom=22,this._options=l.e({type:"raster-dem"},E),this.encoding=E.encoding||"mapbox",this.redFactor=E.redFactor,this.greenFactor=E.greenFactor,this.blueFactor=E.blueFactor,this.baseShift=E.baseShift}loadTile(x,E){const B=x.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),z=this.map._requestManager.transformRequest(B,y.Tile);function J(de,fe){de&&(x.state="errored",E(de)),fe&&(x.dem=fe,x.needsHillshadePrepare=!0,x.needsTerrainPrepare=!0,x.state="loaded",E(null))}x.neighboringTiles=this._getNeighboringTiles(x.tileID),x.request=T.getImage(z,(de,fe,we)=>l._(this,void 0,void 0,function*(){if(delete x.request,x.aborted)x.state="unloaded",E(null);else if(de)x.state="errored",E(de);else if(fe){this.map._refreshExpiredTiles&&x.setExpiryData(we);const He=l.a(fe)&&l.J()?fe:yield function(We){return l._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&l.K()){const st=We.width+2,Qt=We.height+2;try{return new l.R({width:st,height:Qt},yield l.M(We,-1,-1,st,Qt))}catch{}}return l.h.getImageData(We,1)})}(fe),De={uid:x.uid,coord:x.tileID,source:this.id,rawImageData:He,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};x.actor&&x.state!=="expired"||(x.actor=this.dispatcher.getActor(),x.actor.send("loadDEMTile",De,J))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(x){const E=x.canonical,B=Math.pow(2,E.z),z=(E.x-1+B)%B,J=E.x===0?x.wrap-1:x.wrap,de=(E.x+1+B)%B,fe=E.x+1===B?x.wrap+1:x.wrap,we={};return we[new l.O(x.overscaledZ,J,E.z,z,E.y).key]={backfilled:!1},we[new l.O(x.overscaledZ,fe,E.z,de,E.y).key]={backfilled:!1},E.y>0&&(we[new l.O(x.overscaledZ,J,E.z,z,E.y-1).key]={backfilled:!1},we[new l.O(x.overscaledZ,x.wrap,E.z,E.x,E.y-1).key]={backfilled:!1},we[new l.O(x.overscaledZ,fe,E.z,de,E.y-1).key]={backfilled:!1}),E.y+1<B&&(we[new l.O(x.overscaledZ,J,E.z,z,E.y+1).key]={backfilled:!1},we[new l.O(x.overscaledZ,x.wrap,E.z,E.x,E.y+1).key]={backfilled:!1},we[new l.O(x.overscaledZ,fe,E.z,de,E.y+1).key]={backfilled:!1}),we}unloadTile(x){x.demTexture&&this.map.painter.saveTileTexture(x.demTexture),x.fbo&&(x.fbo.destroy(),delete x.fbo),x.dem&&delete x.dem,delete x.neighboringTiles,x.state="unloaded",x.actor&&x.actor.send("removeDEMTile",{uid:x.uid,source:this.id})}}class re extends l.E{constructor(x,E,B,z){super(),this.load=()=>{this._updateWorkerData()},this.serialize=()=>l.e({},this._options,{type:this.type,data:this._data}),this.id=x,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=B.getActor(),this.setEventedParent(z),this._data=E.data,this._options=l.e({},E),this._collectResourceTiming=E.collectResourceTiming,E.maxzoom!==void 0&&(this.maxzoom=E.maxzoom),E.type&&(this.type=E.type),E.attribution&&(this.attribution=E.attribution),this.promoteId=E.promoteId;const J=l.N/this.tileSize;this.workerOptions=l.e({source:this.id,cluster:E.cluster||!1,geojsonVtOptions:{buffer:(E.buffer!==void 0?E.buffer:128)*J,tolerance:(E.tolerance!==void 0?E.tolerance:.375)*J,extent:l.N,maxZoom:this.maxzoom,lineMetrics:E.lineMetrics||!1,generateId:E.generateId||!1},superclusterOptions:{maxZoom:E.clusterMaxZoom!==void 0?E.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,E.clusterMinPoints||2),extent:l.N,radius:(E.clusterRadius||50)*J,log:!1,generateId:E.generateId||!1},clusterProperties:E.clusterProperties,filter:E.filter},E.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(x){this.map=x,this.load()}setData(x){return this._data=x,this._updateWorkerData(),this}updateData(x){return this._updateWorkerData(x),this}setClusterOptions(x){return this.workerOptions.cluster=x.cluster,x&&(x.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=x.clusterRadius),x.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=x.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(x,E){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:x,source:this.id},E),this}getClusterChildren(x,E){return this.actor.send("geojson.getClusterChildren",{clusterId:x,source:this.id},E),this}getClusterLeaves(x,E,B,z){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:x,limit:E,offset:B},z),this}_updateWorkerData(x){const E=l.e({},this.workerOptions);x?E.dataDiff=x:typeof this._data=="string"?(E.request=this.map._requestManager.transformRequest(l.h.resolveURL(this._data),y.Source),E.request.collectResourceTiming=this._collectResourceTiming):E.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new l.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,E,(B,z)=>{if(this._pendingLoads--,this._removed||z&&z.abandoned)return void this.fire(new l.k("dataabort",{dataType:"source"}));let J=null;if(z&&z.resourceTiming&&z.resourceTiming[this.id]&&(J=z.resourceTiming[this.id].slice(0)),B)return void this.fire(new l.j(B));const de={dataType:"source"};this._collectResourceTiming&&J&&J.length>0&&l.e(de,{resourceTiming:J}),this.fire(new l.k("data",Object.assign(Object.assign({},de),{sourceDataType:"metadata"}))),this.fire(new l.k("data",Object.assign(Object.assign({},de),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(x,E){const B=x.actor?"reloadTile":"loadTile";x.actor=this.actor;const z={type:this.type,uid:x.uid,tileID:x.tileID,zoom:x.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};x.request=this.actor.send(B,z,(J,de)=>(delete x.request,x.unloadVectorData(),x.aborted?E(null):J?E(J):(x.loadVectorData(de,this.map.painter,B==="reloadTile"),E(null))))}abortTile(x){x.request&&(x.request.cancel(),delete x.request),x.aborted=!0}unloadTile(x){x.unloadVectorData(),this.actor.send("removeTile",{uid:x.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var ue=l.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class ne extends l.E{constructor(x,E,B,z){super(),this.load=(J,de)=>{this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=T.getImage(this.map._requestManager.transformRequest(this.url,y.Image),(fe,we)=>{this._request=null,this._loaded=!0,fe?this.fire(new l.j(fe)):we&&(this.image=we,J&&(this.coordinates=J),de&&de(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const J=this.map.painter.context,de=J.gl;this.boundsBuffer||(this.boundsBuffer=J.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new O(J,this.image,de.RGBA),this.texture.bind(de.LINEAR,de.CLAMP_TO_EDGE));let fe=!1;for(const we in this.tiles){const He=this.tiles[we];He.state!=="loaded"&&(He.state="loaded",He.texture=this.texture,fe=!0)}fe&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=x,this.dispatcher=B,this.coordinates=E.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(z),this.options=E}loaded(){return this._loaded}updateImage(x){return x.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=x.url,this.load(x.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(x){this.map=x,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(x){this.coordinates=x;const E=x.map(l.U.fromLngLat);this.tileID=function(z){let J=1/0,de=1/0,fe=-1/0,we=-1/0;for(const st of z)J=Math.min(J,st.x),de=Math.min(de,st.y),fe=Math.max(fe,st.x),we=Math.max(we,st.y);const He=Math.max(fe-J,we-de),De=Math.max(0,Math.floor(-Math.log(He)/Math.LN2)),We=Math.pow(2,De);return new l.W(De,Math.floor((J+fe)/2*We),Math.floor((de+we)/2*We))}(E),this.minzoom=this.maxzoom=this.tileID.z;const B=E.map(z=>this.tileID.getTilePoint(z)._round());return this._boundsArray=new l.V,this._boundsArray.emplaceBack(B[0].x,B[0].y,0,0),this._boundsArray.emplaceBack(B[1].x,B[1].y,l.N,0),this._boundsArray.emplaceBack(B[3].x,B[3].y,0,l.N),this._boundsArray.emplaceBack(B[2].x,B[2].y,l.N,l.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(x,E){this.tileID&&this.tileID.equals(x.tileID.canonical)?(this.tiles[String(x.tileID.wrap)]=x,x.buckets={},E(null)):(x.state="errored",E(null))}hasTransition(){return!1}}class ye extends ne{constructor(x,E,B,z){super(x,E,B,z),this.load=()=>{this._loaded=!1;const J=this.options;this.urls=[];for(const de of J.urls)this.urls.push(this.map._requestManager.transformRequest(de,y.Source).url);l.X(this.urls,(de,fe)=>{this._loaded=!0,de?this.fire(new l.j(de)):fe&&(this.video=fe,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const J=this.map.painter.context,de=J.gl;this.boundsBuffer||(this.boundsBuffer=J.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(de.LINEAR,de.CLAMP_TO_EDGE),de.texSubImage2D(de.TEXTURE_2D,0,0,0,de.RGBA,de.UNSIGNED_BYTE,this.video)):(this.texture=new O(J,this.video,de.RGBA),this.texture.bind(de.LINEAR,de.CLAMP_TO_EDGE));let fe=!1;for(const we in this.tiles){const He=this.tiles[we];He.state!=="loaded"&&(He.state="loaded",He.texture=this.texture,fe=!0)}fe&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=E}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(x){if(this.video){const E=this.video.seekable;x<E.start(0)||x>E.end(0)?this.fire(new l.j(new l.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${E.start(0)} and ${E.end(0)}-second mark.`))):this.video.currentTime=x}}getVideo(){return this.video}onAdd(x){this.map||(this.map=x,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class _e extends ne{constructor(x,E,B,z){super(x,E,B,z),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new l.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},this.prepare=()=>{let J=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,J=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,J=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const de=this.map.painter.context,fe=de.gl;this.boundsBuffer||(this.boundsBuffer=de.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture?(J||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new O(de,this.canvas,fe.RGBA,{premultiply:!0});let we=!1;for(const He in this.tiles){const De=this.tiles[He];De.state!=="loaded"&&(De.state="loaded",De.texture=this.texture,we=!0)}we&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),E.coordinates?Array.isArray(E.coordinates)&&E.coordinates.length===4&&!E.coordinates.some(J=>!Array.isArray(J)||J.length!==2||J.some(de=>typeof de!="number"))||this.fire(new l.j(new l.Y(`sources.${x}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new l.j(new l.Y(`sources.${x}`,null,'missing required property "coordinates"'))),E.animate&&typeof E.animate!="boolean"&&this.fire(new l.j(new l.Y(`sources.${x}`,null,'optional "animate" property must be a boolean value'))),E.canvas?typeof E.canvas=="string"||E.canvas instanceof HTMLCanvasElement||this.fire(new l.j(new l.Y(`sources.${x}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new l.j(new l.Y(`sources.${x}`,null,'missing required property "canvas"'))),this.options=E,this.animate=E.animate===void 0||E.animate}getCanvas(){return this.canvas}onAdd(x){this.map=x,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const x of[this.canvas.width,this.canvas.height])if(isNaN(x)||x<=0)return!0;return!1}}const Ie={},qe=Z=>{switch(Z){case"geojson":return re;case"image":return ne;case"raster":return ie;case"raster-dem":return be;case"vector":return me;case"video":return ye;case"canvas":return _e}return Ie[Z]};function Ge(Z,x){const E=l.Z();return l.$(E,E,[1,1,0]),l.a0(E,E,[.5*Z.width,.5*Z.height,1]),l.a1(E,E,Z.calculatePosMatrix(x.toUnwrapped()))}function et(Z,x,E,B,z,J){const de=function(We,st,Qt){if(We)for(const bt of We){const Ct=st[bt];if(Ct&&Ct.source===Qt&&Ct.type==="fill-extrusion")return!0}else for(const bt in st){const Ct=st[bt];if(Ct.source===Qt&&Ct.type==="fill-extrusion")return!0}return!1}(z&&z.layers,x,Z.id),fe=J.maxPitchScaleFactor(),we=Z.tilesIn(B,fe,de);we.sort(Ve);const He=[];for(const We of we)He.push({wrappedTileID:We.tileID.wrapped().key,queryResults:We.tile.queryRenderedFeatures(x,E,Z._state,We.queryGeometry,We.cameraQueryGeometry,We.scale,z,J,fe,Ge(Z.transform,We.tileID))});const De=function(We){const st={},Qt={};for(const bt of We){const Ct=bt.queryResults,Tt=bt.wrappedTileID,Kt=Qt[Tt]=Qt[Tt]||{};for(const sr in Ct){const It=Ct[sr],tr=Kt[sr]=Kt[sr]||{},pr=st[sr]=st[sr]||[];for(const ur of It)tr[ur.featureIndex]||(tr[ur.featureIndex]=!0,pr.push(ur))}}return st}(He);for(const We in De)De[We].forEach(st=>{const Qt=st.feature,bt=Z.getFeatureState(Qt.layer["source-layer"],Qt.id);Qt.source=Qt.layer.source,Qt.layer["source-layer"]&&(Qt.sourceLayer=Qt.layer["source-layer"]),Qt.state=bt});return De}function Ve(Z,x){const E=Z.tileID,B=x.tileID;return E.overscaledZ-B.overscaledZ||E.canonical.y-B.canonical.y||E.wrap-B.wrap||E.canonical.x-B.canonical.x}class Ne{constructor(x,E){this.timeAdded=0,this.fadeEndTime=0,this.tileID=x,this.uid=l.a2(),this.uses=0,this.tileSize=E,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(x){const E=x+this.timeAdded;E<this.fadeEndTime||(this.fadeEndTime=E)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(x){this.demTexture&&x.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(x,E,B){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",x){x.featureIndex&&(this.latestFeatureIndex=x.featureIndex,x.rawTileData?(this.latestRawTileData=x.rawTileData,this.latestFeatureIndex.rawTileData=x.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=x.collisionBoxArray,this.buckets=function(z,J){const de={};if(!J)return de;for(const fe of z){const we=fe.layerIds.map(He=>J.getLayer(He)).filter(Boolean);if(we.length!==0){fe.layers=we,fe.stateDependentLayerIds&&(fe.stateDependentLayers=fe.stateDependentLayerIds.map(He=>we.filter(De=>De.id===He)[0]));for(const He of we)de[He.id]=fe}}return de}(x.buckets,E.style),this.hasSymbolBuckets=!1;for(const z in this.buckets){const J=this.buckets[z];if(J instanceof l.a4){if(this.hasSymbolBuckets=!0,!B)break;J.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const z in this.buckets){const J=this.buckets[z];if(J instanceof l.a4&&J.hasRTLText){this.hasRTLText=!0,l.a5();break}}this.queryPadding=0;for(const z in this.buckets){const J=this.buckets[z];this.queryPadding=Math.max(this.queryPadding,E.style.getLayer(z).queryRadius(J))}x.imageAtlas&&(this.imageAtlas=x.imageAtlas),x.glyphAtlasImage&&(this.glyphAtlasImage=x.glyphAtlasImage)}else this.collisionBoxArray=new l.a3}unloadVectorData(){for(const x in this.buckets)this.buckets[x].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(x){return this.buckets[x.id]}upload(x){for(const B in this.buckets){const z=this.buckets[B];z.uploadPending()&&z.upload(x)}const E=x.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new O(x,this.imageAtlas.image,E.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new O(x,this.glyphAtlasImage,E.ALPHA),this.glyphAtlasImage=null)}prepare(x){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(x,this.imageAtlasTexture)}queryRenderedFeatures(x,E,B,z,J,de,fe,we,He,De){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:z,cameraQueryGeometry:J,scale:de,tileSize:this.tileSize,pixelPosMatrix:De,transform:we,params:fe,queryPadding:this.queryPadding*He},x,E,B):{}}querySourceFeatures(x,E){const B=this.latestFeatureIndex;if(!B||!B.rawTileData)return;const z=B.loadVTLayers(),J=E&&E.sourceLayer?E.sourceLayer:"",de=z._geojsonTileLayer||z[J];if(!de)return;const fe=l.a6(E&&E.filter),{z:we,x:He,y:De}=this.tileID.canonical,We={z:we,x:He,y:De};for(let st=0;st<de.length;st++){const Qt=de.feature(st);if(fe.needGeometry){const Tt=l.a7(Qt,!0);if(!fe.filter(new l.a8(this.tileID.overscaledZ),Tt,this.tileID.canonical))continue}else if(!fe.filter(new l.a8(this.tileID.overscaledZ),Qt))continue;const bt=B.getId(Qt,J),Ct=new l.a9(Qt,we,He,De,bt);Ct.tile=We,x.push(Ct)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(x){const E=this.expirationTime;if(x.cacheControl){const B=l.aa(x.cacheControl);B["max-age"]&&(this.expirationTime=Date.now()+1e3*B["max-age"])}else x.expires&&(this.expirationTime=new Date(x.expires).getTime());if(this.expirationTime){const B=Date.now();let z=!1;if(this.expirationTime>B)z=!1;else if(E)if(this.expirationTime<E)z=!0;else{const J=this.expirationTime-E;J?this.expirationTime=B+Math.max(J,3e4):z=!0}else z=!0;z?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(x,E){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(x).length===0)return;const B=this.latestFeatureIndex.loadVTLayers();for(const z in this.buckets){if(!E.style.hasLayer(z))continue;const J=this.buckets[z],de=J.layers[0].sourceLayer||"_geojsonTileLayer",fe=B[de],we=x[de];if(!fe||!we||Object.keys(we).length===0)continue;J.update(we,fe,this.imageAtlas&&this.imageAtlas.patternPositions||{});const He=E&&E.style&&E.style.getLayer(z);He&&(this.queryPadding=Math.max(this.queryPadding,He.queryRadius(J)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<l.h.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(x){this.symbolFadeHoldUntil=l.h.now()+x}setDependencies(x,E){const B={};for(const z of E)B[z]=!0;this.dependencies[x]=B}hasDependency(x,E){for(const B of x){const z=this.dependencies[B];if(z){for(const J of E)if(z[J])return!0}}return!1}}class it{constructor(x,E){this.max=x,this.onRemove=E,this.reset()}reset(){for(const x in this.data)for(const E of this.data[x])E.timeout&&clearTimeout(E.timeout),this.onRemove(E.value);return this.data={},this.order=[],this}add(x,E,B){const z=x.wrapped().key;this.data[z]===void 0&&(this.data[z]=[]);const J={value:E,timeout:void 0};if(B!==void 0&&(J.timeout=setTimeout(()=>{this.remove(x,J)},B)),this.data[z].push(J),this.order.push(z),this.order.length>this.max){const de=this._getAndRemoveByKey(this.order[0]);de&&this.onRemove(de)}return this}has(x){return x.wrapped().key in this.data}getAndRemove(x){return this.has(x)?this._getAndRemoveByKey(x.wrapped().key):null}_getAndRemoveByKey(x){const E=this.data[x].shift();return E.timeout&&clearTimeout(E.timeout),this.data[x].length===0&&delete this.data[x],this.order.splice(this.order.indexOf(x),1),E.value}getByKey(x){const E=this.data[x];return E?E[0].value:null}get(x){return this.has(x)?this.data[x.wrapped().key][0].value:null}remove(x,E){if(!this.has(x))return this;const B=x.wrapped().key,z=E===void 0?0:this.data[B].indexOf(E),J=this.data[B][z];return this.data[B].splice(z,1),J.timeout&&clearTimeout(J.timeout),this.data[B].length===0&&delete this.data[B],this.onRemove(J.value),this.order.splice(this.order.indexOf(B),1),this}setMaxSize(x){for(this.max=x;this.order.length>this.max;){const E=this._getAndRemoveByKey(this.order[0]);E&&this.onRemove(E)}return this}filter(x){const E=[];for(const B in this.data)for(const z of this.data[B])x(z.value)||E.push(z);for(const B of E)this.remove(B.value.tileID,B)}}class Re{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(x,E,B){const z=String(E);if(this.stateChanges[x]=this.stateChanges[x]||{},this.stateChanges[x][z]=this.stateChanges[x][z]||{},l.e(this.stateChanges[x][z],B),this.deletedStates[x]===null){this.deletedStates[x]={};for(const J in this.state[x])J!==z&&(this.deletedStates[x][J]=null)}else if(this.deletedStates[x]&&this.deletedStates[x][z]===null){this.deletedStates[x][z]={};for(const J in this.state[x][z])B[J]||(this.deletedStates[x][z][J]=null)}else for(const J in B)this.deletedStates[x]&&this.deletedStates[x][z]&&this.deletedStates[x][z][J]===null&&delete this.deletedStates[x][z][J]}removeFeatureState(x,E,B){if(this.deletedStates[x]===null)return;const z=String(E);if(this.deletedStates[x]=this.deletedStates[x]||{},B&&E!==void 0)this.deletedStates[x][z]!==null&&(this.deletedStates[x][z]=this.deletedStates[x][z]||{},this.deletedStates[x][z][B]=null);else if(E!==void 0)if(this.stateChanges[x]&&this.stateChanges[x][z])for(B in this.deletedStates[x][z]={},this.stateChanges[x][z])this.deletedStates[x][z][B]=null;else this.deletedStates[x][z]=null;else this.deletedStates[x]=null}getState(x,E){const B=String(E),z=l.e({},(this.state[x]||{})[B],(this.stateChanges[x]||{})[B]);if(this.deletedStates[x]===null)return{};if(this.deletedStates[x]){const J=this.deletedStates[x][E];if(J===null)return{};for(const de in J)delete z[de]}return z}initializeTileState(x,E){x.setFeatureState(this.state,E)}coalesceChanges(x,E){const B={};for(const z in this.stateChanges){this.state[z]=this.state[z]||{};const J={};for(const de in this.stateChanges[z])this.state[z][de]||(this.state[z][de]={}),l.e(this.state[z][de],this.stateChanges[z][de]),J[de]=this.state[z][de];B[z]=J}for(const z in this.deletedStates){this.state[z]=this.state[z]||{};const J={};if(this.deletedStates[z]===null)for(const de in this.state[z])J[de]={},this.state[z][de]={};else for(const de in this.deletedStates[z]){if(this.deletedStates[z][de]===null)this.state[z][de]={};else for(const fe of Object.keys(this.deletedStates[z][de]))delete this.state[z][de][fe];J[de]=this.state[z][de]}B[z]=B[z]||{},l.e(B[z],J)}if(this.stateChanges={},this.deletedStates={},Object.keys(B).length!==0)for(const z in x)x[z].setFeatureState(B,E)}}class pt extends l.E{constructor(x,E,B){super(),this.id=x,this.dispatcher=B,this.on("data",z=>{z.dataType==="source"&&z.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&z.dataType==="source"&&z.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((z,J,de,fe)=>{const we=new(qe(J.type))(z,J,de,fe);if(we.id!==z)throw new Error(`Expected Source id to be ${z} instead of ${we.id}`);return we})(x,E,B,this),this._tiles={},this._cache=new it(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Re,this._didEmitContent=!1,this._updated=!1}onAdd(x){this.map=x,this._maxTileCacheSize=x?x._maxTileCacheSize:null,this._maxTileCacheZoomLevels=x?x._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(x)}onRemove(x){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(x)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const x in this._tiles){const E=this._tiles[x];if(E.state!=="loaded"&&E.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const x=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,x&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(x,E){return this._source.loadTile(x,E)}_unloadTile(x){if(this._source.unloadTile)return this._source.unloadTile(x,()=>{})}_abortTile(x){this._source.abortTile&&this._source.abortTile(x,()=>{}),this._source.fire(new l.k("dataabort",{tile:x,coord:x.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(x){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const E in this._tiles){const B=this._tiles[E];B.upload(x),B.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(x=>x.tileID).sort(yt).map(x=>x.key)}getRenderableIds(x){const E=[];for(const B in this._tiles)this._isIdRenderable(B,x)&&E.push(this._tiles[B]);return x?E.sort((B,z)=>{const J=B.tileID,de=z.tileID,fe=new l.P(J.canonical.x,J.canonical.y)._rotate(this.transform.angle),we=new l.P(de.canonical.x,de.canonical.y)._rotate(this.transform.angle);return J.overscaledZ-de.overscaledZ||we.y-fe.y||we.x-fe.x}).map(B=>B.tileID.key):E.map(B=>B.tileID).sort(yt).map(B=>B.key)}hasRenderableParent(x){const E=this.findLoadedParent(x,0);return!!E&&this._isIdRenderable(E.tileID.key)}_isIdRenderable(x,E){return this._tiles[x]&&this._tiles[x].hasData()&&!this._coveredTiles[x]&&(E||!this._tiles[x].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const x in this._tiles)this._tiles[x].state!=="errored"&&this._reloadTile(x,"reloading")}}_reloadTile(x,E){const B=this._tiles[x];B&&(B.state!=="loading"&&(B.state=E),this._loadTile(B,this._tileLoaded.bind(this,B,x,E)))}_tileLoaded(x,E,B,z){if(z)return x.state="errored",void(z.status!==404?this._source.fire(new l.j(z,{tile:x})):this.update(this.transform,this.terrain));x.timeAdded=l.h.now(),B==="expired"&&(x.refreshedUponExpiration=!0),this._setTileReloadTimer(E,x),this.getSource().type==="raster-dem"&&x.dem&&this._backfillDEM(x),this._state.initializeTileState(x,this.map?this.map.painter:null),x.aborted||this._source.fire(new l.k("data",{dataType:"source",tile:x,coord:x.tileID}))}_backfillDEM(x){const E=this.getRenderableIds();for(let z=0;z<E.length;z++){const J=E[z];if(x.neighboringTiles&&x.neighboringTiles[J]){const de=this.getTileByID(J);B(x,de),B(de,x)}}function B(z,J){z.needsHillshadePrepare=!0,z.needsTerrainPrepare=!0;let de=J.tileID.canonical.x-z.tileID.canonical.x;const fe=J.tileID.canonical.y-z.tileID.canonical.y,we=Math.pow(2,z.tileID.canonical.z),He=J.tileID.key;de===0&&fe===0||Math.abs(fe)>1||(Math.abs(de)>1&&(Math.abs(de+we)===1?de+=we:Math.abs(de-we)===1&&(de-=we)),J.dem&&z.dem&&(z.dem.backfillBorder(J.dem,de,fe),z.neighboringTiles&&z.neighboringTiles[He]&&(z.neighboringTiles[He].backfilled=!0)))}}getTile(x){return this.getTileByID(x.key)}getTileByID(x){return this._tiles[x]}_retainLoadedChildren(x,E,B,z){for(const J in this._tiles){let de=this._tiles[J];if(z[J]||!de.hasData()||de.tileID.overscaledZ<=E||de.tileID.overscaledZ>B)continue;let fe=de.tileID;for(;de&&de.tileID.overscaledZ>E+1;){const He=de.tileID.scaledTo(de.tileID.overscaledZ-1);de=this._tiles[He.key],de&&de.hasData()&&(fe=He)}let we=fe;for(;we.overscaledZ>E;)if(we=we.scaledTo(we.overscaledZ-1),x[we.key]){z[fe.key]=fe;break}}}findLoadedParent(x,E){if(x.key in this._loadedParentTiles){const B=this._loadedParentTiles[x.key];return B&&B.tileID.overscaledZ>=E?B:null}for(let B=x.overscaledZ-1;B>=E;B--){const z=x.scaledTo(B),J=this._getLoadedTile(z);if(J)return J}}_getLoadedTile(x){const E=this._tiles[x.key];return E&&E.hasData()?E:this._cache.getByKey(x.wrapped().key)}updateCacheSize(x){const E=Math.ceil(x.width/this._source.tileSize)+1,B=Math.ceil(x.height/this._source.tileSize)+1,z=Math.floor(E*B*(this._maxTileCacheZoomLevels===null?l.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),J=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,z):z;this._cache.setMaxSize(J)}handleWrapJump(x){const E=Math.round((x-(this._prevLng===void 0?x:this._prevLng))/360);if(this._prevLng=x,E){const B={};for(const z in this._tiles){const J=this._tiles[z];J.tileID=J.tileID.unwrapTo(J.tileID.wrap+E),B[J.tileID.key]=J}this._tiles=B;for(const z in this._timers)clearTimeout(this._timers[z]),delete this._timers[z];for(const z in this._tiles)this._setTileReloadTimer(z,this._tiles[z])}}update(x,E){if(this.transform=x,this.terrain=E,!this._sourceLoaded||this._paused)return;let B;this.updateCacheSize(x),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?B=x.getVisibleUnwrappedCoordinates(this._source.tileID).map(De=>new l.O(De.canonical.z,De.wrap,De.canonical.z,De.canonical.x,De.canonical.y)):(B=x.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:E}),this._source.hasTile&&(B=B.filter(De=>this._source.hasTile(De)))):B=[];const z=x.coveringZoomLevel(this._source),J=Math.max(z-pt.maxOverzooming,this._source.minzoom),de=Math.max(z+pt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const De={};for(const We of B)if(We.canonical.z>this._source.minzoom){const st=We.scaledTo(We.canonical.z-1);De[st.key]=st;const Qt=We.scaledTo(Math.max(this._source.minzoom,Math.min(We.canonical.z,5)));De[Qt.key]=Qt}B=B.concat(Object.values(De))}const fe=B.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,fe&&this.fire(new l.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const we=this._updateRetainedTiles(B,z);if(ct(this._source.type)){const De={},We={},st=Object.keys(we),Qt=l.h.now();for(const bt of st){const Ct=we[bt],Tt=this._tiles[bt];if(!Tt||Tt.fadeEndTime!==0&&Tt.fadeEndTime<=Qt)continue;const Kt=this.findLoadedParent(Ct,J);Kt&&(this._addTile(Kt.tileID),De[Kt.tileID.key]=Kt.tileID),We[bt]=Ct}this._retainLoadedChildren(We,z,de,we);for(const bt in De)we[bt]||(this._coveredTiles[bt]=!0,we[bt]=De[bt]);if(E){const bt={},Ct={};for(const Tt of B)this._tiles[Tt.key].hasData()?bt[Tt.key]=Tt:Ct[Tt.key]=Tt;for(const Tt in Ct){const Kt=Ct[Tt].children(this._source.maxzoom);this._tiles[Kt[0].key]&&this._tiles[Kt[1].key]&&this._tiles[Kt[2].key]&&this._tiles[Kt[3].key]&&(bt[Kt[0].key]=we[Kt[0].key]=Kt[0],bt[Kt[1].key]=we[Kt[1].key]=Kt[1],bt[Kt[2].key]=we[Kt[2].key]=Kt[2],bt[Kt[3].key]=we[Kt[3].key]=Kt[3],delete Ct[Tt])}for(const Tt in Ct){const Kt=this.findLoadedParent(Ct[Tt],this._source.minzoom);if(Kt){bt[Kt.tileID.key]=we[Kt.tileID.key]=Kt.tileID;for(const sr in bt)bt[sr].isChildOf(Kt.tileID)&&delete bt[sr]}}for(const Tt in this._tiles)bt[Tt]||(this._coveredTiles[Tt]=!0)}}for(const De in we)this._tiles[De].clearFadeHold();const He=l.ab(this._tiles,we);for(const De of He){const We=this._tiles[De];We.hasSymbolBuckets&&!We.holdingForFade()?We.setHoldDuration(this.map._fadeDuration):We.hasSymbolBuckets&&!We.symbolFadeFinished()||this._removeTile(De)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const x in this._tiles)this._tiles[x].holdingForFade()&&this._removeTile(x)}_updateRetainedTiles(x,E){const B={},z={},J=Math.max(E-pt.maxOverzooming,this._source.minzoom),de=Math.max(E+pt.maxUnderzooming,this._source.minzoom),fe={};for(const we of x){const He=this._addTile(we);B[we.key]=we,He.hasData()||E<this._source.maxzoom&&(fe[we.key]=we)}this._retainLoadedChildren(fe,E,de,B);for(const we of x){let He=this._tiles[we.key];if(He.hasData())continue;if(E+1>this._source.maxzoom){const We=we.children(this._source.maxzoom)[0],st=this.getTile(We);if(st&&st.hasData()){B[We.key]=We;continue}}else{const We=we.children(this._source.maxzoom);if(B[We[0].key]&&B[We[1].key]&&B[We[2].key]&&B[We[3].key])continue}let De=He.wasRequested();for(let We=we.overscaledZ-1;We>=J;--We){const st=we.scaledTo(We);if(z[st.key])break;if(z[st.key]=!0,He=this.getTile(st),!He&&De&&(He=this._addTile(st)),He){const Qt=He.hasData();if((De||Qt)&&(B[st.key]=st),De=He.wasRequested(),Qt)break}}}return B}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const x in this._tiles){const E=[];let B,z=this._tiles[x].tileID;for(;z.overscaledZ>0;){if(z.key in this._loadedParentTiles){B=this._loadedParentTiles[z.key];break}E.push(z.key);const J=z.scaledTo(z.overscaledZ-1);if(B=this._getLoadedTile(J),B)break;z=J}for(const J of E)this._loadedParentTiles[J]=B}}_addTile(x){let E=this._tiles[x.key];if(E)return E;E=this._cache.getAndRemove(x),E&&(this._setTileReloadTimer(x.key,E),E.tileID=x,this._state.initializeTileState(E,this.map?this.map.painter:null),this._cacheTimers[x.key]&&(clearTimeout(this._cacheTimers[x.key]),delete this._cacheTimers[x.key],this._setTileReloadTimer(x.key,E)));const B=E;return E||(E=new Ne(x,this._source.tileSize*x.overscaleFactor()),this._loadTile(E,this._tileLoaded.bind(this,E,x.key,E.state))),E.uses++,this._tiles[x.key]=E,B||this._source.fire(new l.k("dataloading",{tile:E,coord:E.tileID,dataType:"source"})),E}_setTileReloadTimer(x,E){x in this._timers&&(clearTimeout(this._timers[x]),delete this._timers[x]);const B=E.getExpiryTimeout();B&&(this._timers[x]=setTimeout(()=>{this._reloadTile(x,"expired"),delete this._timers[x]},B))}_removeTile(x){const E=this._tiles[x];E&&(E.uses--,delete this._tiles[x],this._timers[x]&&(clearTimeout(this._timers[x]),delete this._timers[x]),E.uses>0||(E.hasData()&&E.state!=="reloading"?this._cache.add(E.tileID,E,E.getExpiryTimeout()):(E.aborted=!0,this._abortTile(E),this._unloadTile(E))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const x in this._tiles)this._removeTile(x);this._cache.reset()}tilesIn(x,E,B){const z=[],J=this.transform;if(!J)return z;const de=B?J.getCameraQueryGeometry(x):x,fe=x.map(bt=>J.pointCoordinate(bt,this.terrain)),we=de.map(bt=>J.pointCoordinate(bt,this.terrain)),He=this.getIds();let De=1/0,We=1/0,st=-1/0,Qt=-1/0;for(const bt of we)De=Math.min(De,bt.x),We=Math.min(We,bt.y),st=Math.max(st,bt.x),Qt=Math.max(Qt,bt.y);for(let bt=0;bt<He.length;bt++){const Ct=this._tiles[He[bt]];if(Ct.holdingForFade())continue;const Tt=Ct.tileID,Kt=Math.pow(2,J.zoom-Ct.tileID.overscaledZ),sr=E*Ct.queryPadding*l.N/Ct.tileSize/Kt,It=[Tt.getTilePoint(new l.U(De,We)),Tt.getTilePoint(new l.U(st,Qt))];if(It[0].x-sr<l.N&&It[0].y-sr<l.N&&It[1].x+sr>=0&&It[1].y+sr>=0){const tr=fe.map(ur=>Tt.getTilePoint(ur)),pr=we.map(ur=>Tt.getTilePoint(ur));z.push({tile:Ct,tileID:Tt,queryGeometry:tr,cameraQueryGeometry:pr,scale:Kt})}}return z}getVisibleCoordinates(x){const E=this.getRenderableIds(x).map(B=>this._tiles[B].tileID);for(const B of E)B.posMatrix=this.transform.calculatePosMatrix(B.toUnwrapped());return E}hasTransition(){if(this._source.hasTransition())return!0;if(ct(this._source.type)){const x=l.h.now();for(const E in this._tiles)if(this._tiles[E].fadeEndTime>=x)return!0}return!1}setFeatureState(x,E,B){this._state.updateState(x=x||"_geojsonTileLayer",E,B)}removeFeatureState(x,E,B){this._state.removeFeatureState(x=x||"_geojsonTileLayer",E,B)}getFeatureState(x,E){return this._state.getState(x=x||"_geojsonTileLayer",E)}setDependencies(x,E,B){const z=this._tiles[x];z&&z.setDependencies(E,B)}reloadTilesForDependencies(x,E){for(const B in this._tiles)this._tiles[B].hasDependency(x,E)&&this._reloadTile(B,"reloading");this._cache.filter(B=>!B.hasDependency(x,E))}}function yt(Z,x){const E=Math.abs(2*Z.wrap)-+(Z.wrap<0),B=Math.abs(2*x.wrap)-+(x.wrap<0);return Z.overscaledZ-x.overscaledZ||B-E||x.canonical.y-Z.canonical.y||x.canonical.x-Z.canonical.x}function ct(Z){return Z==="raster"||Z==="image"||Z==="video"}pt.maxOverzooming=10,pt.maxUnderzooming=3;const xe="mapboxgl_preloaded_worker_pool";class Ue{constructor(){this.active={}}acquire(x){if(!this.workers)for(this.workers=[];this.workers.length<Ue.workerCount;)this.workers.push(new Worker(l.c.WORKER_URL));return this.active[x]=!0,this.workers.slice()}release(x){delete this.active[x],this.numActive()===0&&(this.workers.forEach(E=>{E.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[xe]}numActive(){return Object.keys(this.active).length}}const $e=Math.floor(l.h.hardwareConcurrency/2);let at;function Ht(){return at||(at=new Ue),at}Ue.workerCount=l.ac(globalThis)?Math.max(Math.min($e,3),1):1;class Vt{constructor(x,E){this.reset(x,E)}reset(x,E){this.points=x||[],this._distances=[0];for(let B=1;B<this.points.length;B++)this._distances[B]=this._distances[B-1]+this.points[B].dist(this.points[B-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(E||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(x){if(this.points.length===1)return this.points[0];x=l.ad(x,0,1);let E=1,B=this._distances[E];const z=x*this.paddedLength+this.padding;for(;B<z&&E<this._distances.length;)B=this._distances[++E];const J=E-1,de=this._distances[J],fe=B-de,we=fe>0?(z-de)/fe:0;return this.points[J].mult(1-we).add(this.points[E].mult(we))}}function Ft(Z,x){let E=!0;return Z==="always"||Z!=="never"&&x!=="never"||(E=!1),E}class Gt{constructor(x,E,B){const z=this.boxCells=[],J=this.circleCells=[];this.xCellCount=Math.ceil(x/B),this.yCellCount=Math.ceil(E/B);for(let de=0;de<this.xCellCount*this.yCellCount;de++)z.push([]),J.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=x,this.height=E,this.xScale=this.xCellCount/x,this.yScale=this.yCellCount/E,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(x,E,B,z,J){this._forEachCell(E,B,z,J,this._insertBoxCell,this.boxUid++),this.boxKeys.push(x),this.bboxes.push(E),this.bboxes.push(B),this.bboxes.push(z),this.bboxes.push(J)}insertCircle(x,E,B,z){this._forEachCell(E-z,B-z,E+z,B+z,this._insertCircleCell,this.circleUid++),this.circleKeys.push(x),this.circles.push(E),this.circles.push(B),this.circles.push(z)}_insertBoxCell(x,E,B,z,J,de){this.boxCells[J].push(de)}_insertCircleCell(x,E,B,z,J,de){this.circleCells[J].push(de)}_query(x,E,B,z,J,de,fe){if(B<0||x>this.width||z<0||E>this.height)return[];const we=[];if(x<=0&&E<=0&&this.width<=B&&this.height<=z){if(J)return[{key:null,x1:x,y1:E,x2:B,y2:z}];for(let He=0;He<this.boxKeys.length;He++)we.push({key:this.boxKeys[He],x1:this.bboxes[4*He],y1:this.bboxes[4*He+1],x2:this.bboxes[4*He+2],y2:this.bboxes[4*He+3]});for(let He=0;He<this.circleKeys.length;He++){const De=this.circles[3*He],We=this.circles[3*He+1],st=this.circles[3*He+2];we.push({key:this.circleKeys[He],x1:De-st,y1:We-st,x2:De+st,y2:We+st})}}else this._forEachCell(x,E,B,z,this._queryCell,we,{hitTest:J,overlapMode:de,seenUids:{box:{},circle:{}}},fe);return we}query(x,E,B,z){return this._query(x,E,B,z,!1,null)}hitTest(x,E,B,z,J,de){return this._query(x,E,B,z,!0,J,de).length>0}hitTestCircle(x,E,B,z,J){const de=x-B,fe=x+B,we=E-B,He=E+B;if(fe<0||de>this.width||He<0||we>this.height)return!1;const De=[];return this._forEachCell(de,we,fe,He,this._queryCellCircle,De,{hitTest:!0,overlapMode:z,circle:{x,y:E,radius:B},seenUids:{box:{},circle:{}}},J),De.length>0}_queryCell(x,E,B,z,J,de,fe,we){const{seenUids:He,hitTest:De,overlapMode:We}=fe,st=this.boxCells[J];if(st!==null){const bt=this.bboxes;for(const Ct of st)if(!He.box[Ct]){He.box[Ct]=!0;const Tt=4*Ct,Kt=this.boxKeys[Ct];if(x<=bt[Tt+2]&&E<=bt[Tt+3]&&B>=bt[Tt+0]&&z>=bt[Tt+1]&&(!we||we(Kt))&&(!De||!Ft(We,Kt.overlapMode))&&(de.push({key:Kt,x1:bt[Tt],y1:bt[Tt+1],x2:bt[Tt+2],y2:bt[Tt+3]}),De))return!0}}const Qt=this.circleCells[J];if(Qt!==null){const bt=this.circles;for(const Ct of Qt)if(!He.circle[Ct]){He.circle[Ct]=!0;const Tt=3*Ct,Kt=this.circleKeys[Ct];if(this._circleAndRectCollide(bt[Tt],bt[Tt+1],bt[Tt+2],x,E,B,z)&&(!we||we(Kt))&&(!De||!Ft(We,Kt.overlapMode))){const sr=bt[Tt],It=bt[Tt+1],tr=bt[Tt+2];if(de.push({key:Kt,x1:sr-tr,y1:It-tr,x2:sr+tr,y2:It+tr}),De)return!0}}}return!1}_queryCellCircle(x,E,B,z,J,de,fe,we){const{circle:He,seenUids:De,overlapMode:We}=fe,st=this.boxCells[J];if(st!==null){const bt=this.bboxes;for(const Ct of st)if(!De.box[Ct]){De.box[Ct]=!0;const Tt=4*Ct,Kt=this.boxKeys[Ct];if(this._circleAndRectCollide(He.x,He.y,He.radius,bt[Tt+0],bt[Tt+1],bt[Tt+2],bt[Tt+3])&&(!we||we(Kt))&&!Ft(We,Kt.overlapMode))return de.push(!0),!0}}const Qt=this.circleCells[J];if(Qt!==null){const bt=this.circles;for(const Ct of Qt)if(!De.circle[Ct]){De.circle[Ct]=!0;const Tt=3*Ct,Kt=this.circleKeys[Ct];if(this._circlesCollide(bt[Tt],bt[Tt+1],bt[Tt+2],He.x,He.y,He.radius)&&(!we||we(Kt))&&!Ft(We,Kt.overlapMode))return de.push(!0),!0}}}_forEachCell(x,E,B,z,J,de,fe,we){const He=this._convertToXCellCoord(x),De=this._convertToYCellCoord(E),We=this._convertToXCellCoord(B),st=this._convertToYCellCoord(z);for(let Qt=He;Qt<=We;Qt++)for(let bt=De;bt<=st;bt++)if(J.call(this,x,E,B,z,this.xCellCount*bt+Qt,de,fe,we))return}_convertToXCellCoord(x){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(x*this.xScale)))}_convertToYCellCoord(x){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(x*this.yScale)))}_circlesCollide(x,E,B,z,J,de){const fe=z-x,we=J-E,He=B+de;return He*He>fe*fe+we*we}_circleAndRectCollide(x,E,B,z,J,de,fe){const we=(de-z)/2,He=Math.abs(x-(z+we));if(He>we+B)return!1;const De=(fe-J)/2,We=Math.abs(E-(J+De));if(We>De+B)return!1;if(He<=we||We<=De)return!0;const st=He-we,Qt=We-De;return st*st+Qt*Qt<=B*B}}function Je(Z,x,E,B,z){const J=l.Z();return x?(l.a0(J,J,[1/z,1/z,1]),E||l.ae(J,J,B.angle)):l.a1(J,B.labelPlaneMatrix,Z),J}function ft(Z,x,E,B,z){if(x){const J=l.af(Z);return l.a0(J,J,[z,z,1]),E||l.ae(J,J,-B.angle),J}return B.glCoordMatrix}function St(Z,x,E){let B;E?(B=[Z.x,Z.y,E(Z.x,Z.y),1],l.ag(B,B,x)):(B=[Z.x,Z.y,0,1],ve(B,B,x));const z=B[3];return{point:new l.P(B[0]/z,B[1]/z),signedDistanceFromCamera:z}}function Zt(Z,x){return .5+Z/x*.5}function Jt(Z,x){const E=Z[0]/Z[3],B=Z[1]/Z[3];return E>=-x[0]&&E<=x[0]&&B>=-x[1]&&B<=x[1]}function Pt(Z,x,E,B,z,J,de,fe,we,He){const De=B?Z.textSizeData:Z.iconSizeData,We=l.ah(De,E.transform.zoom),st=[256/E.width*2+1,256/E.height*2+1],Qt=B?Z.text.dynamicLayoutVertexArray:Z.icon.dynamicLayoutVertexArray;Qt.clear();const bt=Z.lineVertexArray,Ct=B?Z.text.placedSymbolArray:Z.icon.placedSymbolArray,Tt=E.transform.width/E.transform.height;let Kt=!1;for(let sr=0;sr<Ct.length;sr++){const It=Ct.get(sr);if(It.hidden||It.writingMode===l.ai.vertical&&!Kt){Ye(It.numGlyphs,Qt);continue}let tr;if(Kt=!1,He?(tr=[It.anchorX,It.anchorY,He(It.anchorX,It.anchorY),1],l.ag(tr,tr,x)):(tr=[It.anchorX,It.anchorY,0,1],ve(tr,tr,x)),!Jt(tr,st)){Ye(It.numGlyphs,Qt);continue}const pr=Zt(E.transform.cameraToCenterDistance,tr[3]),ur=l.aj(De,We,It),Tr=de?ur/pr:ur*pr,Lr=new l.P(It.anchorX,It.anchorY),br=St(Lr,z,He).point,Or={projections:{},offsets:{}},fn=kt(It,Tr,!1,fe,x,z,J,Z.glyphOffsetArray,bt,Qt,br,Lr,Or,Tt,we,He);Kt=fn.useVertical,(fn.notEnoughRoom||Kt||fn.needsFlipping&&kt(It,Tr,!0,fe,x,z,J,Z.glyphOffsetArray,bt,Qt,br,Lr,Or,Tt,we,He).notEnoughRoom)&&Ye(It.numGlyphs,Qt)}B?Z.text.dynamicLayoutVertexBuffer.updateData(Qt):Z.icon.dynamicLayoutVertexBuffer.updateData(Qt)}function rt(Z,x,E,B,z,J,de,fe,we,He,De,We,st){const Qt=fe.glyphStartIndex+fe.numGlyphs,bt=fe.lineStartIndex,Ct=fe.lineStartIndex+fe.lineLength,Tt=x.getoffsetX(fe.glyphStartIndex),Kt=x.getoffsetX(Qt-1),sr=ke(Z*Tt,E,B,z,J,de,fe.segment,bt,Ct,we,He,De,We,st);if(!sr)return null;const It=ke(Z*Kt,E,B,z,J,de,fe.segment,bt,Ct,we,He,De,We,st);return It?{first:sr,last:It}:null}function Et(Z,x,E,B){return Z===l.ai.horizontal&&Math.abs(E.y-x.y)>Math.abs(E.x-x.x)*B?{useVertical:!0}:(Z===l.ai.vertical?x.y<E.y:x.x>E.x)?{needsFlipping:!0}:null}function kt(Z,x,E,B,z,J,de,fe,we,He,De,We,st,Qt,bt,Ct){const Tt=x/24,Kt=Z.lineOffsetX*Tt,sr=Z.lineOffsetY*Tt;let It;if(Z.numGlyphs>1){const tr=Z.glyphStartIndex+Z.numGlyphs,pr=Z.lineStartIndex,ur=Z.lineStartIndex+Z.lineLength,Tr=rt(Tt,fe,Kt,sr,E,De,We,Z,we,J,st,bt,Ct);if(!Tr)return{notEnoughRoom:!0};const Lr=St(Tr.first.point,de,Ct).point,br=St(Tr.last.point,de,Ct).point;if(B&&!E){const Or=Et(Z.writingMode,Lr,br,Qt);if(Or)return Or}It=[Tr.first];for(let Or=Z.glyphStartIndex+1;Or<tr-1;Or++)It.push(ke(Tt*fe.getoffsetX(Or),Kt,sr,E,De,We,Z.segment,pr,ur,we,J,st,bt,Ct));It.push(Tr.last)}else{if(B&&!E){const pr=St(We,z,Ct).point,ur=Z.lineStartIndex+Z.segment+1,Tr=new l.P(we.getx(ur),we.gety(ur)),Lr=St(Tr,z,Ct),br=Lr.signedDistanceFromCamera>0?Lr.point:or(We,Tr,pr,1,z,Ct),Or=Et(Z.writingMode,pr,br,Qt);if(Or)return Or}const tr=ke(Tt*fe.getoffsetX(Z.glyphStartIndex),Kt,sr,E,De,We,Z.segment,Z.lineStartIndex,Z.lineStartIndex+Z.lineLength,we,J,st,bt,Ct);if(!tr)return{notEnoughRoom:!0};It=[tr]}for(const tr of It)l.ak(He,tr.point,tr.angle);return{}}function or(Z,x,E,B,z,J){const de=St(Z.add(Z.sub(x)._unit()),z,J).point,fe=E.sub(de);return E.add(fe._mult(B/fe.mag()))}function $t(Z,x){const{projectionCache:E,lineVertexArray:B,labelPlaneMatrix:z,tileAnchorPoint:J,distanceFromAnchor:de,getElevation:fe,previousVertex:we,direction:He,absOffsetX:De}=x;if(E.projections[Z])return E.projections[Z];const We=new l.P(B.getx(Z),B.gety(Z)),st=St(We,z,fe);if(st.signedDistanceFromCamera>0)return E.projections[Z]=st.point,st.point;const Qt=Z-He;return or(de===0?J:new l.P(B.getx(Qt),B.gety(Qt)),We,we,De-de+1,z,fe)}function wt(Z,x,E){return Z._unit()._perp()._mult(x*E)}function je(Z,x,E,B,z,J,de,fe){const{projectionCache:we,direction:He}=fe;if(we.offsets[Z])return we.offsets[Z];const De=E.add(x);if(Z+He<B||Z+He>=z)return we.offsets[Z]=De,De;const We=$t(Z+He,fe),st=wt(We.sub(E),de,He),Qt=E.add(st),bt=We.add(st);return we.offsets[Z]=l.al(J,De,Qt,bt)||De,we.offsets[Z]}function ke(Z,x,E,B,z,J,de,fe,we,He,De,We,st,Qt){const bt=B?Z-x:Z+x;let Ct=bt>0?1:-1,Tt=0;B&&(Ct*=-1,Tt=Math.PI),Ct<0&&(Tt+=Math.PI);let Kt,sr,It=Ct>0?fe+de:fe+de+1,tr=z,pr=z,ur=0,Tr=0;const Lr=Math.abs(bt),br=[];let Or;for(;ur+Tr<=Lr;){if(It+=Ct,It<fe||It>=we)return null;ur+=Tr,pr=tr,sr=Kt;const Zr={projectionCache:We,lineVertexArray:He,labelPlaneMatrix:De,tileAnchorPoint:J,distanceFromAnchor:ur,getElevation:Qt,previousVertex:pr,direction:Ct,absOffsetX:Lr};if(tr=$t(It,Zr),E===0)br.push(pr),Or=tr.sub(pr);else{let An;const gn=tr.sub(pr);An=gn.mag()===0?wt($t(It+Ct,Zr).sub(tr),E,Ct):wt(gn,E,Ct),sr||(sr=pr.add(An)),Kt=je(It,An,tr,fe,we,sr,E,Zr),br.push(sr),Or=Kt.sub(sr)}Tr=Or.mag()}const fn=Or._mult((Lr-ur)/Tr)._add(sr||pr),bi=Tt+Math.atan2(tr.y-pr.y,tr.x-pr.x);return br.push(fn),{point:fn,angle:st?bi:0,path:br}}const Oe=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ye(Z,x){for(let E=0;E<Z;E++){const B=x.length;x.resize(B+4),x.float32.set(Oe,3*B)}}function ve(Z,x,E){const B=x[0],z=x[1];return Z[0]=E[0]*B+E[4]*z+E[12],Z[1]=E[1]*B+E[5]*z+E[13],Z[3]=E[3]*B+E[7]*z+E[15],Z}const Ae=100;class Be{constructor(x,E=new Gt(x.width+200,x.height+200,25),B=new Gt(x.width+200,x.height+200,25)){this.transform=x,this.grid=E,this.ignoredGrid=B,this.pitchfactor=Math.cos(x._pitch)*x.cameraToCenterDistance,this.screenRightBoundary=x.width+Ae,this.screenBottomBoundary=x.height+Ae,this.gridRightBoundary=x.width+200,this.gridBottomBoundary=x.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(x,E,B,z,J,de){const fe=this.projectAndGetPerspectiveRatio(z,x.anchorPointX,x.anchorPointY,de),we=B*fe.perspectiveRatio,He=x.x1*we+fe.point.x,De=x.y1*we+fe.point.y,We=x.x2*we+fe.point.x,st=x.y2*we+fe.point.y;return!this.isInsideGrid(He,De,We,st)||E!=="always"&&this.grid.hitTest(He,De,We,st,E,J)||fe.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[He,De,We,st],offscreen:this.isOffscreen(He,De,We,st)}}placeCollisionCircles(x,E,B,z,J,de,fe,we,He,De,We,st,Qt,bt){const Ct=[],Tt=new l.P(E.anchorX,E.anchorY),Kt=St(Tt,de,bt),sr=Zt(this.transform.cameraToCenterDistance,Kt.signedDistanceFromCamera),It=(De?J/sr:J*sr)/l.ap,tr=St(Tt,fe,bt).point,pr=rt(It,z,E.lineOffsetX*It,E.lineOffsetY*It,!1,tr,Tt,E,B,fe,{projections:{},offsets:{}},!1,bt);let ur=!1,Tr=!1,Lr=!0;if(pr){const br=.5*st*sr+Qt,Or=new l.P(-100,-100),fn=new l.P(this.screenRightBoundary,this.screenBottomBoundary),bi=new Vt,Zr=pr.first,An=pr.last;let gn=[];for(let ei=Zr.path.length-1;ei>=1;ei--)gn.push(Zr.path[ei]);for(let ei=1;ei<An.path.length;ei++)gn.push(An.path[ei]);const qi=2.5*br;if(we){const ei=gn.map(xi=>St(xi,we,bt));gn=ei.some(xi=>xi.signedDistanceFromCamera<=0)?[]:ei.map(xi=>xi.point)}let pi=[];if(gn.length>0){const ei=gn[0].clone(),xi=gn[0].clone();for(let Go=1;Go<gn.length;Go++)ei.x=Math.min(ei.x,gn[Go].x),ei.y=Math.min(ei.y,gn[Go].y),xi.x=Math.max(xi.x,gn[Go].x),xi.y=Math.max(xi.y,gn[Go].y);pi=ei.x>=Or.x&&xi.x<=fn.x&&ei.y>=Or.y&&xi.y<=fn.y?[gn]:xi.x<Or.x||ei.x>fn.x||xi.y<Or.y||ei.y>fn.y?[]:l.am([gn],Or.x,Or.y,fn.x,fn.y)}for(const ei of pi){bi.reset(ei,.25*br);let xi=0;xi=bi.length<=.5*br?1:Math.ceil(bi.paddedLength/qi)+1;for(let Go=0;Go<xi;Go++){const yo=Go/Math.max(xi-1,1),xs=bi.lerp(yo),Za=xs.x+Ae,aa=xs.y+Ae;Ct.push(Za,aa,br,0);const Nl=Za-br,io=aa-br,g1=Za+br,vc=aa+br;if(Lr=Lr&&this.isOffscreen(Nl,io,g1,vc),Tr=Tr||this.isInsideGrid(Nl,io,g1,vc),x!=="always"&&this.grid.hitTestCircle(Za,aa,br,x,We)&&(ur=!0,!He))return{circles:[],offscreen:!1,collisionDetected:ur}}}}return{circles:!He&&ur||!Tr||sr<this.perspectiveRatioCutoff?[]:Ct,offscreen:Lr,collisionDetected:ur}}queryRenderedSymbols(x){if(x.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const E=[];let B=1/0,z=1/0,J=-1/0,de=-1/0;for(const De of x){const We=new l.P(De.x+Ae,De.y+Ae);B=Math.min(B,We.x),z=Math.min(z,We.y),J=Math.max(J,We.x),de=Math.max(de,We.y),E.push(We)}const fe=this.grid.query(B,z,J,de).concat(this.ignoredGrid.query(B,z,J,de)),we={},He={};for(const De of fe){const We=De.key;if(we[We.bucketInstanceId]===void 0&&(we[We.bucketInstanceId]={}),we[We.bucketInstanceId][We.featureIndex])continue;const st=[new l.P(De.x1,De.y1),new l.P(De.x2,De.y1),new l.P(De.x2,De.y2),new l.P(De.x1,De.y2)];l.an(E,st)&&(we[We.bucketInstanceId][We.featureIndex]=!0,He[We.bucketInstanceId]===void 0&&(He[We.bucketInstanceId]=[]),He[We.bucketInstanceId].push(We.featureIndex))}return He}insertCollisionBox(x,E,B,z,J,de){(B?this.ignoredGrid:this.grid).insert({bucketInstanceId:z,featureIndex:J,collisionGroupID:de,overlapMode:E},x[0],x[1],x[2],x[3])}insertCollisionCircles(x,E,B,z,J,de){const fe=B?this.ignoredGrid:this.grid,we={bucketInstanceId:z,featureIndex:J,collisionGroupID:de,overlapMode:E};for(let He=0;He<x.length;He+=4)fe.insertCircle(we,x[He],x[He+1],x[He+2])}projectAndGetPerspectiveRatio(x,E,B,z){let J;return z?(J=[E,B,z(E,B),1],l.ag(J,J,x)):(J=[E,B,0,1],ve(J,J,x)),{point:new l.P((J[0]/J[3]+1)/2*this.transform.width+Ae,(-J[1]/J[3]+1)/2*this.transform.height+Ae),perspectiveRatio:.5+this.transform.cameraToCenterDistance/J[3]*.5}}isOffscreen(x,E,B,z){return B<Ae||x>=this.screenRightBoundary||z<Ae||E>this.screenBottomBoundary}isInsideGrid(x,E,B,z){return B>=0&&x<this.gridRightBoundary&&z>=0&&E<this.gridBottomBoundary}getViewportMatrix(){const x=l.ao([]);return l.$(x,x,[-100,-100,0]),x}}function Se(Z,x,E){return x*(l.N/(Z.tileSize*Math.pow(2,E-Z.tileID.overscaledZ)))}class ge{constructor(x,E,B,z){this.opacity=x?Math.max(0,Math.min(1,x.opacity+(x.placed?E:-E))):z&&B?1:0,this.placed=B}isHidden(){return this.opacity===0&&!this.placed}}class Ce{constructor(x,E,B,z,J){this.text=new ge(x?x.text:null,E,B,J),this.icon=new ge(x?x.icon:null,E,z,J)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Xe{constructor(x,E,B){this.text=x,this.icon=E,this.skipFade=B}}class se{constructor(){this.invProjMatrix=l.Z(),this.viewportMatrix=l.Z(),this.circles=[]}}class Le{constructor(x,E,B,z,J){this.bucketInstanceId=x,this.featureIndex=E,this.sourceLayerIndex=B,this.bucketIndex=z,this.tileID=J}}class Ke{constructor(x){this.crossSourceCollisions=x,this.maxGroupID=0,this.collisionGroups={}}get(x){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[x]){const E=++this.maxGroupID;this.collisionGroups[x]={ID:E,predicate:B=>B.collisionGroupID===E}}return this.collisionGroups[x]}}function ht(Z,x,E,B,z){const{horizontalAlign:J,verticalAlign:de}=l.au(Z);return new l.P(-(J-.5)*x+B[0]*z,-(de-.5)*E+B[1]*z)}function At(Z,x,E,B,z,J){const{x1:de,x2:fe,y1:we,y2:He,anchorPointX:De,anchorPointY:We}=Z,st=new l.P(x,E);return B&&st._rotate(z?J:-J),{x1:de+st.x,y1:we+st.y,x2:fe+st.x,y2:He+st.y,anchorPointX:De,anchorPointY:We}}class qt{constructor(x,E,B,z,J){this.transform=x.clone(),this.terrain=E,this.collisionIndex=new Be(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=B,this.retainedQueryData={},this.collisionGroups=new Ke(z),this.collisionCircleArrays={},this.prevPlacement=J,J&&(J.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(x,E,B,z){const J=B.getBucket(E),de=B.latestFeatureIndex;if(!J||!de||E.id!==J.layerIds[0])return;const fe=B.collisionBoxArray,we=J.layers[0].layout,He=Math.pow(2,this.transform.zoom-B.tileID.overscaledZ),De=B.tileSize/l.N,We=this.transform.calculatePosMatrix(B.tileID.toUnwrapped()),st=we.get("text-pitch-alignment")==="map",Qt=we.get("text-rotation-alignment")==="map",bt=Se(B,1,this.transform.zoom),Ct=Je(We,st,Qt,this.transform,bt);let Tt=null;if(st){const sr=ft(We,st,Qt,this.transform,bt);Tt=l.a1([],this.transform.labelPlaneMatrix,sr)}this.retainedQueryData[J.bucketInstanceId]=new Le(J.bucketInstanceId,de,J.sourceLayerIndex,J.index,B.tileID);const Kt={bucket:J,layout:we,posMatrix:We,textLabelPlaneMatrix:Ct,labelToScreenMatrix:Tt,scale:He,textPixelRatio:De,holdingForFade:B.holdingForFade(),collisionBoxArray:fe,partiallyEvaluatedTextSize:l.ah(J.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(J.sourceID)};if(z)for(const sr of J.sortKeyRanges){const{sortKey:It,symbolInstanceStart:tr,symbolInstanceEnd:pr}=sr;x.push({sortKey:It,symbolInstanceStart:tr,symbolInstanceEnd:pr,parameters:Kt})}else x.push({symbolInstanceStart:0,symbolInstanceEnd:J.symbolInstances.length,parameters:Kt})}attemptAnchorPlacement(x,E,B,z,J,de,fe,we,He,De,We,st,Qt,bt,Ct,Tt){const Kt=l.aq[x.textAnchor],sr=[x.textOffset0,x.textOffset1],It=ht(Kt,B,z,sr,J),tr=this.collisionIndex.placeCollisionBox(At(E,It.x,It.y,de,fe,this.transform.angle),We,we,He,De.predicate,Tt);if((!Ct||this.collisionIndex.placeCollisionBox(At(Ct,It.x,It.y,de,fe,this.transform.angle),We,we,He,De.predicate,Tt).box.length!==0)&&tr.box.length>0){let pr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[st.crossTileID]&&this.prevPlacement.placements[st.crossTileID]&&this.prevPlacement.placements[st.crossTileID].text&&(pr=this.prevPlacement.variableOffsets[st.crossTileID].anchor),st.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[st.crossTileID]={textOffset:sr,width:B,height:z,anchor:Kt,textBoxScale:J,prevAnchor:pr},this.markUsedJustification(Qt,Kt,st,bt),Qt.allowVerticalPlacement&&(this.markUsedOrientation(Qt,bt,st),this.placedOrientations[st.crossTileID]=bt),{shift:It,placedGlyphBoxes:tr}}}placeLayerBucketPart(x,E,B){const{bucket:z,layout:J,posMatrix:de,textLabelPlaneMatrix:fe,labelToScreenMatrix:we,textPixelRatio:He,holdingForFade:De,collisionBoxArray:We,partiallyEvaluatedTextSize:st,collisionGroup:Qt}=x.parameters,bt=J.get("text-optional"),Ct=J.get("icon-optional"),Tt=l.ar(J,"text-overlap","text-allow-overlap"),Kt=Tt==="always",sr=l.ar(J,"icon-overlap","icon-allow-overlap"),It=sr==="always",tr=J.get("text-rotation-alignment")==="map",pr=J.get("text-pitch-alignment")==="map",ur=J.get("icon-text-fit")!=="none",Tr=J.get("symbol-z-order")==="viewport-y",Lr=Kt&&(It||!z.hasIconData()||Ct),br=It&&(Kt||!z.hasTextData()||bt);!z.collisionArrays&&We&&z.deserializeCollisionBoxes(We);const Or=this.retainedQueryData[z.bucketInstanceId].tileID,fn=this.terrain?(Zr,An)=>this.terrain.getElevation(Or,Zr,An):null,bi=(Zr,An)=>{var gn,qi;if(E[Zr.crossTileID])return;if(De)return void(this.placements[Zr.crossTileID]=new Xe(!1,!1,!1));let pi=!1,ei=!1,xi=!0,Go=null,yo={box:null,offscreen:null},xs={box:null,offscreen:null},Za=null,aa=null,Nl=null,io=0,g1=0,vc=0;An.textFeatureIndex?io=An.textFeatureIndex:Zr.useRuntimeCollisionCircles&&(io=Zr.featureIndex),An.verticalTextFeatureIndex&&(g1=An.verticalTextFeatureIndex);const Z2=An.textBox;if(Z2){const _s=sa=>{let ba=l.ai.horizontal;if(z.allowVerticalPlacement&&!sa&&this.prevPlacement){const ws=this.prevPlacement.placedOrientations[Zr.crossTileID];ws&&(this.placedOrientations[Zr.crossTileID]=ws,ba=ws,this.markUsedOrientation(z,ba,Zr))}return ba},qo=(sa,ba)=>{if(z.allowVerticalPlacement&&Zr.numVerticalGlyphVertices>0&&An.verticalTextBox){for(const ws of z.writingModes)if(ws===l.ai.vertical?(yo=ba(),xs=yo):yo=sa(),yo&&yo.box&&yo.box.length)break}else yo=sa()},os=Zr.textAnchorOffsetStartIndex,K2=Zr.textAnchorOffsetEndIndex;if(K2===os){const sa=(ba,ws)=>{const Wo=this.collisionIndex.placeCollisionBox(ba,Tt,He,de,Qt.predicate,fn);return Wo&&Wo.box&&Wo.box.length&&(this.markUsedOrientation(z,ws,Zr),this.placedOrientations[Zr.crossTileID]=ws),Wo};qo(()=>sa(Z2,l.ai.horizontal),()=>{const ba=An.verticalTextBox;return z.allowVerticalPlacement&&Zr.numVerticalGlyphVertices>0&&ba?sa(ba,l.ai.vertical):{box:null,offscreen:null}}),_s(yo&&yo.box&&yo.box.length)}else{let sa=l.aq[(qi=(gn=this.prevPlacement)===null||gn===void 0?void 0:gn.variableOffsets[Zr.crossTileID])===null||qi===void 0?void 0:qi.anchor];const ba=(Wo,C3,Yf)=>{const Tb=Wo.x2-Wo.x1,vb=Wo.y2-Wo.y1,H9=Zr.textBoxScale,V9=ur&&sr==="never"?C3:null;let d2={box:[],offscreen:!1},H=Tt==="never"?1:2,q="never";sa&&H++;for(let te=0;te<H;te++){for(let le=os;le<K2;le++){const pe=z.textAnchorOffsets.get(le);if(sa&&pe.textAnchor!==sa)continue;const Te=this.attemptAnchorPlacement(pe,Wo,Tb,vb,H9,tr,pr,He,de,Qt,q,Zr,z,Yf,V9,fn);if(Te&&(d2=Te.placedGlyphBoxes,d2&&d2.box&&d2.box.length))return pi=!0,Go=Te.shift,d2}sa?sa=null:q=Tt}return d2};qo(()=>ba(Z2,An.iconBox,l.ai.horizontal),()=>{const Wo=An.verticalTextBox;return z.allowVerticalPlacement&&!(yo&&yo.box&&yo.box.length)&&Zr.numVerticalGlyphVertices>0&&Wo?ba(Wo,An.verticalIconBox,l.ai.vertical):{box:null,offscreen:null}}),yo&&(pi=yo.box,xi=yo.offscreen);const ws=_s(yo&&yo.box);if(!pi&&this.prevPlacement){const Wo=this.prevPlacement.variableOffsets[Zr.crossTileID];Wo&&(this.variableOffsets[Zr.crossTileID]=Wo,this.markUsedJustification(z,Wo.anchor,Zr,ws))}}}if(Za=yo,pi=Za&&Za.box&&Za.box.length>0,xi=Za&&Za.offscreen,Zr.useRuntimeCollisionCircles){const _s=z.text.placedSymbolArray.get(Zr.centerJustifiedTextSymbolIndex),qo=l.aj(z.textSizeData,st,_s),os=J.get("text-padding");aa=this.collisionIndex.placeCollisionCircles(Tt,_s,z.lineVertexArray,z.glyphOffsetArray,qo,de,fe,we,B,pr,Qt.predicate,Zr.collisionCircleDiameter,os,fn),aa.circles.length&&aa.collisionDetected&&!B&&l.w("Collisions detected, but collision boxes are not shown"),pi=Kt||aa.circles.length>0&&!aa.collisionDetected,xi=xi&&aa.offscreen}if(An.iconFeatureIndex&&(vc=An.iconFeatureIndex),An.iconBox){const _s=qo=>{const os=ur&&Go?At(qo,Go.x,Go.y,tr,pr,this.transform.angle):qo;return this.collisionIndex.placeCollisionBox(os,sr,He,de,Qt.predicate,fn)};xs&&xs.box&&xs.box.length&&An.verticalIconBox?(Nl=_s(An.verticalIconBox),ei=Nl.box.length>0):(Nl=_s(An.iconBox),ei=Nl.box.length>0),xi=xi&&Nl.offscreen}const y1=bt||Zr.numHorizontalGlyphVertices===0&&Zr.numVerticalGlyphVertices===0,wo=Ct||Zr.numIconVertices===0;if(y1||wo?wo?y1||(ei=ei&&pi):pi=ei&&pi:ei=pi=ei&&pi,pi&&Za&&Za.box&&this.collisionIndex.insertCollisionBox(Za.box,Tt,J.get("text-ignore-placement"),z.bucketInstanceId,xs&&xs.box&&g1?g1:io,Qt.ID),ei&&Nl&&this.collisionIndex.insertCollisionBox(Nl.box,sr,J.get("icon-ignore-placement"),z.bucketInstanceId,vc,Qt.ID),aa&&(pi&&this.collisionIndex.insertCollisionCircles(aa.circles,Tt,J.get("text-ignore-placement"),z.bucketInstanceId,io,Qt.ID),B)){const _s=z.bucketInstanceId;let qo=this.collisionCircleArrays[_s];qo===void 0&&(qo=this.collisionCircleArrays[_s]=new se);for(let os=0;os<aa.circles.length;os+=4)qo.circles.push(aa.circles[os+0]),qo.circles.push(aa.circles[os+1]),qo.circles.push(aa.circles[os+2]),qo.circles.push(aa.collisionDetected?1:0)}if(Zr.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(z.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Zr.crossTileID]=new Xe(pi||Lr,ei||br,xi||z.justReloaded),E[Zr.crossTileID]=!0};if(Tr){if(x.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const Zr=z.getSortedSymbolIndexes(this.transform.angle);for(let An=Zr.length-1;An>=0;--An){const gn=Zr[An];bi(z.symbolInstances.get(gn),z.collisionArrays[gn])}}else for(let Zr=x.symbolInstanceStart;Zr<x.symbolInstanceEnd;Zr++)bi(z.symbolInstances.get(Zr),z.collisionArrays[Zr]);if(B&&z.bucketInstanceId in this.collisionCircleArrays){const Zr=this.collisionCircleArrays[z.bucketInstanceId];l.as(Zr.invProjMatrix,de),Zr.viewportMatrix=this.collisionIndex.getViewportMatrix()}z.justReloaded=!1}markUsedJustification(x,E,B,z){let J;J=z===l.ai.vertical?B.verticalPlacedTextSymbolIndex:{left:B.leftJustifiedTextSymbolIndex,center:B.centerJustifiedTextSymbolIndex,right:B.rightJustifiedTextSymbolIndex}[l.at(E)];const de=[B.leftJustifiedTextSymbolIndex,B.centerJustifiedTextSymbolIndex,B.rightJustifiedTextSymbolIndex,B.verticalPlacedTextSymbolIndex];for(const fe of de)fe>=0&&(x.text.placedSymbolArray.get(fe).crossTileID=J>=0&&fe!==J?0:B.crossTileID)}markUsedOrientation(x,E,B){const z=E===l.ai.horizontal||E===l.ai.horizontalOnly?E:0,J=E===l.ai.vertical?E:0,de=[B.leftJustifiedTextSymbolIndex,B.centerJustifiedTextSymbolIndex,B.rightJustifiedTextSymbolIndex];for(const fe of de)x.text.placedSymbolArray.get(fe).placedOrientation=z;B.verticalPlacedTextSymbolIndex&&(x.text.placedSymbolArray.get(B.verticalPlacedTextSymbolIndex).placedOrientation=J)}commit(x){this.commitTime=x,this.zoomAtLastRecencyCheck=this.transform.zoom;const E=this.prevPlacement;let B=!1;this.prevZoomAdjustment=E?E.zoomAdjustment(this.transform.zoom):0;const z=E?E.symbolFadeChange(x):1,J=E?E.opacities:{},de=E?E.variableOffsets:{},fe=E?E.placedOrientations:{};for(const we in this.placements){const He=this.placements[we],De=J[we];De?(this.opacities[we]=new Ce(De,z,He.text,He.icon),B=B||He.text!==De.text.placed||He.icon!==De.icon.placed):(this.opacities[we]=new Ce(null,z,He.text,He.icon,He.skipFade),B=B||He.text||He.icon)}for(const we in J){const He=J[we];if(!this.opacities[we]){const De=new Ce(He,z,!1,!1);De.isHidden()||(this.opacities[we]=De,B=B||He.text.placed||He.icon.placed)}}for(const we in de)this.variableOffsets[we]||!this.opacities[we]||this.opacities[we].isHidden()||(this.variableOffsets[we]=de[we]);for(const we in fe)this.placedOrientations[we]||!this.opacities[we]||this.opacities[we].isHidden()||(this.placedOrientations[we]=fe[we]);if(E&&E.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");B?this.lastPlacementChangeTime=x:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=E?E.lastPlacementChangeTime:x)}updateLayerOpacities(x,E){const B={};for(const z of E){const J=z.getBucket(x);J&&z.latestFeatureIndex&&x.id===J.layerIds[0]&&this.updateBucketOpacities(J,B,z.collisionBoxArray)}}updateBucketOpacities(x,E,B){x.hasTextData()&&(x.text.opacityVertexArray.clear(),x.text.hasVisibleVertices=!1),x.hasIconData()&&(x.icon.opacityVertexArray.clear(),x.icon.hasVisibleVertices=!1),x.hasIconCollisionBoxData()&&x.iconCollisionBox.collisionVertexArray.clear(),x.hasTextCollisionBoxData()&&x.textCollisionBox.collisionVertexArray.clear();const z=x.layers[0],J=z.layout,de=new Ce(null,0,!1,!1,!0),fe=J.get("text-allow-overlap"),we=J.get("icon-allow-overlap"),He=z._unevaluatedLayout.hasValue("text-variable-anchor")||z._unevaluatedLayout.hasValue("text-variable-anchor-offset"),De=J.get("text-rotation-alignment")==="map",We=J.get("text-pitch-alignment")==="map",st=J.get("icon-text-fit")!=="none",Qt=new Ce(null,0,fe&&(we||!x.hasIconData()||J.get("icon-optional")),we&&(fe||!x.hasTextData()||J.get("text-optional")),!0);!x.collisionArrays&&B&&(x.hasIconCollisionBoxData()||x.hasTextCollisionBoxData())&&x.deserializeCollisionBoxes(B);const bt=(Ct,Tt,Kt)=>{for(let sr=0;sr<Tt/4;sr++)Ct.opacityVertexArray.emplaceBack(Kt);Ct.hasVisibleVertices=Ct.hasVisibleVertices||Kt!==Er};for(let Ct=0;Ct<x.symbolInstances.length;Ct++){const Tt=x.symbolInstances.get(Ct),{numHorizontalGlyphVertices:Kt,numVerticalGlyphVertices:sr,crossTileID:It}=Tt;let tr=this.opacities[It];E[It]?tr=de:tr||(tr=Qt,this.opacities[It]=tr),E[It]=!0;const pr=Tt.numIconVertices>0,ur=this.placedOrientations[Tt.crossTileID],Tr=ur===l.ai.vertical,Lr=ur===l.ai.horizontal||ur===l.ai.horizontalOnly;if(Kt>0||sr>0){const br=an(tr.text);bt(x.text,Kt,Tr?Er:br),bt(x.text,sr,Lr?Er:br);const Or=tr.text.isHidden();[Tt.rightJustifiedTextSymbolIndex,Tt.centerJustifiedTextSymbolIndex,Tt.leftJustifiedTextSymbolIndex].forEach(Zr=>{Zr>=0&&(x.text.placedSymbolArray.get(Zr).hidden=Or||Tr?1:0)}),Tt.verticalPlacedTextSymbolIndex>=0&&(x.text.placedSymbolArray.get(Tt.verticalPlacedTextSymbolIndex).hidden=Or||Lr?1:0);const fn=this.variableOffsets[Tt.crossTileID];fn&&this.markUsedJustification(x,fn.anchor,Tt,ur);const bi=this.placedOrientations[Tt.crossTileID];bi&&(this.markUsedJustification(x,"left",Tt,bi),this.markUsedOrientation(x,bi,Tt))}if(pr){const br=an(tr.icon),Or=!(st&&Tt.verticalPlacedIconSymbolIndex&&Tr);Tt.placedIconSymbolIndex>=0&&(bt(x.icon,Tt.numIconVertices,Or?br:Er),x.icon.placedSymbolArray.get(Tt.placedIconSymbolIndex).hidden=tr.icon.isHidden()),Tt.verticalPlacedIconSymbolIndex>=0&&(bt(x.icon,Tt.numVerticalIconVertices,Or?Er:br),x.icon.placedSymbolArray.get(Tt.verticalPlacedIconSymbolIndex).hidden=tr.icon.isHidden())}if(x.hasIconCollisionBoxData()||x.hasTextCollisionBoxData()){const br=x.collisionArrays[Ct];if(br){let Or=new l.P(0,0);if(br.textBox||br.verticalTextBox){let bi=!0;if(He){const Zr=this.variableOffsets[It];Zr?(Or=ht(Zr.anchor,Zr.width,Zr.height,Zr.textOffset,Zr.textBoxScale),De&&Or._rotate(We?this.transform.angle:-this.transform.angle)):bi=!1}br.textBox&&nr(x.textCollisionBox.collisionVertexArray,tr.text.placed,!bi||Tr,Or.x,Or.y),br.verticalTextBox&&nr(x.textCollisionBox.collisionVertexArray,tr.text.placed,!bi||Lr,Or.x,Or.y)}const fn=!!(!Lr&&br.verticalIconBox);br.iconBox&&nr(x.iconCollisionBox.collisionVertexArray,tr.icon.placed,fn,st?Or.x:0,st?Or.y:0),br.verticalIconBox&&nr(x.iconCollisionBox.collisionVertexArray,tr.icon.placed,!fn,st?Or.x:0,st?Or.y:0)}}}if(x.sortFeatures(this.transform.angle),this.retainedQueryData[x.bucketInstanceId]&&(this.retainedQueryData[x.bucketInstanceId].featureSortOrder=x.featureSortOrder),x.hasTextData()&&x.text.opacityVertexBuffer&&x.text.opacityVertexBuffer.updateData(x.text.opacityVertexArray),x.hasIconData()&&x.icon.opacityVertexBuffer&&x.icon.opacityVertexBuffer.updateData(x.icon.opacityVertexArray),x.hasIconCollisionBoxData()&&x.iconCollisionBox.collisionVertexBuffer&&x.iconCollisionBox.collisionVertexBuffer.updateData(x.iconCollisionBox.collisionVertexArray),x.hasTextCollisionBoxData()&&x.textCollisionBox.collisionVertexBuffer&&x.textCollisionBox.collisionVertexBuffer.updateData(x.textCollisionBox.collisionVertexArray),x.text.opacityVertexArray.length!==x.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${x.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${x.text.layoutVertexArray.length}) / 4`);if(x.icon.opacityVertexArray.length!==x.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${x.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${x.icon.layoutVertexArray.length}) / 4`);if(x.bucketInstanceId in this.collisionCircleArrays){const Ct=this.collisionCircleArrays[x.bucketInstanceId];x.placementInvProjMatrix=Ct.invProjMatrix,x.placementViewportMatrix=Ct.viewportMatrix,x.collisionCircleArray=Ct.circles,delete this.collisionCircleArrays[x.bucketInstanceId]}}symbolFadeChange(x){return this.fadeDuration===0?1:(x-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(x){return Math.max(0,(this.transform.zoom-x)/1.5)}hasTransitions(x){return this.stale||x-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(x,E){const B=this.zoomAtLastRecencyCheck===E?1-this.zoomAdjustment(E):1;return this.zoomAtLastRecencyCheck=E,this.commitTime+this.fadeDuration*B>x}setStale(){this.stale=!0}}function nr(Z,x,E,B,z){Z.emplaceBack(x?1:0,E?1:0,B||0,z||0),Z.emplaceBack(x?1:0,E?1:0,B||0,z||0),Z.emplaceBack(x?1:0,E?1:0,B||0,z||0),Z.emplaceBack(x?1:0,E?1:0,B||0,z||0)}const cr=Math.pow(2,25),lr=Math.pow(2,24),hr=Math.pow(2,17),Ir=Math.pow(2,16),Rr=Math.pow(2,9),yr=Math.pow(2,8),Ar=Math.pow(2,1);function an(Z){if(Z.opacity===0&&!Z.placed)return 0;if(Z.opacity===1&&Z.placed)return 4294967295;const x=Z.placed?1:0,E=Math.floor(127*Z.opacity);return E*cr+x*lr+E*hr+x*Ir+E*Rr+x*yr+E*Ar+x}const Er=0;class nn{constructor(x){this._sortAcrossTiles=x.layout.get("symbol-z-order")!=="viewport-y"&&!x.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(x,E,B,z,J){const de=this._bucketParts;for(;this._currentTileIndex<x.length;)if(E.getBucketParts(de,z,x[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,J())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,de.sort((fe,we)=>fe.sortKey-we.sortKey));this._currentPartIndex<de.length;)if(E.placeLayerBucketPart(de[this._currentPartIndex],this._seenCrossTileIDs,B),this._currentPartIndex++,J())return!0;return!1}}class Fr{constructor(x,E,B,z,J,de,fe,we){this.placement=new qt(x,E,de,fe,we),this._currentPlacementIndex=B.length-1,this._forceFullPlacement=z,this._showCollisionBoxes=J,this._done=!1}isDone(){return this._done}continuePlacement(x,E,B){const z=l.h.now(),J=()=>!this._forceFullPlacement&&l.h.now()-z>2;for(;this._currentPlacementIndex>=0;){const de=E[x[this._currentPlacementIndex]],fe=this.placement.collisionIndex.transform.zoom;if(de.type==="symbol"&&(!de.minzoom||de.minzoom<=fe)&&(!de.maxzoom||de.maxzoom>fe)){if(this._inProgressLayer||(this._inProgressLayer=new nn(de)),this._inProgressLayer.continuePlacement(B[de.source],this.placement,this._showCollisionBoxes,de,J))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(x){return this.placement.commit(x),this.placement}}const zr=512/l.N/2;class Sn{constructor(x,E,B){this.tileID=x,this.bucketInstanceId=B,this._symbolsByKey={};const z=new Map;for(let J=0;J<E.length;J++){const de=E.get(J),fe=de.key,we=z.get(fe);we?we.push(de):z.set(fe,[de])}for(const[J,de]of z){const fe={positions:de.map(we=>({x:Math.floor(we.anchorX*zr),y:Math.floor(we.anchorY*zr)})),crossTileIDs:de.map(we=>we.crossTileID)};if(fe.positions.length>128){const we=new l.av(fe.positions.length,16,Uint16Array);for(const{x:He,y:De}of fe.positions)we.add(He,De);we.finish(),delete fe.positions,fe.index=we}this._symbolsByKey[J]=fe}}getScaledCoordinates(x,E){const{x:B,y:z,z:J}=this.tileID.canonical,{x:de,y:fe,z:we}=E.canonical,He=zr/Math.pow(2,we-J),De=(fe*l.N+x.anchorY)*He,We=z*l.N*zr;return{x:Math.floor((de*l.N+x.anchorX)*He-B*l.N*zr),y:Math.floor(De-We)}}findMatches(x,E,B){const z=this.tileID.canonical.z<E.canonical.z?1:Math.pow(2,this.tileID.canonical.z-E.canonical.z);for(let J=0;J<x.length;J++){const de=x.get(J);if(de.crossTileID)continue;const fe=this._symbolsByKey[de.key];if(!fe)continue;const we=this.getScaledCoordinates(de,E);if(fe.index){const He=fe.index.range(we.x-z,we.y-z,we.x+z,we.y+z).sort();for(const De of He){const We=fe.crossTileIDs[De];if(!B[We]){B[We]=!0,de.crossTileID=We;break}}}else if(fe.positions)for(let He=0;He<fe.positions.length;He++){const De=fe.positions[He],We=fe.crossTileIDs[He];if(Math.abs(De.x-we.x)<=z&&Math.abs(De.y-we.y)<=z&&!B[We]){B[We]=!0,de.crossTileID=We;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:x})=>x)}}class dn{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Xr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(x){const E=Math.round((x-this.lng)/360);if(E!==0)for(const B in this.indexes){const z=this.indexes[B],J={};for(const de in z){const fe=z[de];fe.tileID=fe.tileID.unwrapTo(fe.tileID.wrap+E),J[fe.tileID.key]=fe}this.indexes[B]=J}this.lng=x}addBucket(x,E,B){if(this.indexes[x.overscaledZ]&&this.indexes[x.overscaledZ][x.key]){if(this.indexes[x.overscaledZ][x.key].bucketInstanceId===E.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(x.overscaledZ,this.indexes[x.overscaledZ][x.key])}for(let J=0;J<E.symbolInstances.length;J++)E.symbolInstances.get(J).crossTileID=0;this.usedCrossTileIDs[x.overscaledZ]||(this.usedCrossTileIDs[x.overscaledZ]={});const z=this.usedCrossTileIDs[x.overscaledZ];for(const J in this.indexes){const de=this.indexes[J];if(Number(J)>x.overscaledZ)for(const fe in de){const we=de[fe];we.tileID.isChildOf(x)&&we.findMatches(E.symbolInstances,x,z)}else{const fe=de[x.scaledTo(Number(J)).key];fe&&fe.findMatches(E.symbolInstances,x,z)}}for(let J=0;J<E.symbolInstances.length;J++){const de=E.symbolInstances.get(J);de.crossTileID||(de.crossTileID=B.generate(),z[de.crossTileID]=!0)}return this.indexes[x.overscaledZ]===void 0&&(this.indexes[x.overscaledZ]={}),this.indexes[x.overscaledZ][x.key]=new Sn(x,E.symbolInstances,E.bucketInstanceId),!0}removeBucketCrossTileIDs(x,E){for(const B of E.getCrossTileIDsLists())for(const z of B)delete this.usedCrossTileIDs[x][z]}removeStaleBuckets(x){let E=!1;for(const B in this.indexes){const z=this.indexes[B];for(const J in z)x[z[J].bucketInstanceId]||(this.removeBucketCrossTileIDs(B,z[J]),delete z[J],E=!0)}return E}}class Pn{constructor(){this.layerIndexes={},this.crossTileIDs=new dn,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(x,E,B){let z=this.layerIndexes[x.id];z===void 0&&(z=this.layerIndexes[x.id]=new Xr);let J=!1;const de={};z.handleWrapJump(B);for(const fe of E){const we=fe.getBucket(x);we&&x.id===we.layerIds[0]&&(we.bucketInstanceId||(we.bucketInstanceId=++this.maxBucketInstanceId),z.addBucket(fe.tileID,we,this.crossTileIDs)&&(J=!0),de[we.bucketInstanceId]=!0)}return z.removeStaleBuckets(de)&&(J=!0),J}pruneUnusedLayers(x){const E={};x.forEach(B=>{E[B]=!0});for(const B in this.layerIndexes)E[B]||delete this.layerIndexes[B]}}const cn=(Z,x)=>l.x(Z,x&&x.filter(E=>E.identifier!=="source.canvas")),ni=l.F(l.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Zn=l.F(l.ax,["setCenter","setZoom","setBearing","setPitch"]),si=l.aw();class ii extends l.E{constructor(x,E={}){super(),this.map=x,this.dispatcher=new X(Ht(),this,x._getMapId()),this.imageManager=new I,this.imageManager.setEventedParent(this),this.glyphManager=new G(x._requestManager,E.localIdeographFontFamily),this.lineAtlas=new U(256,512),this.crossTileSymbolIndex=new Pn,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new l.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",l.az());const B=this;this._rtlTextPluginCallback=ii.registerForPluginStateChange(z=>{B.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:z.pluginStatus,pluginURL:z.pluginURL},(J,de)=>{if(l.aA(J),de&&de.every(fe=>fe))for(const fe in B.sourceCaches){const we=B.sourceCaches[fe].getSource().type;we!=="vector"&&we!=="geojson"||B.sourceCaches[fe].reload()}})}),this.on("data",z=>{if(z.dataType!=="source"||z.sourceDataType!=="metadata")return;const J=this.sourceCaches[z.sourceId];if(!J)return;const de=J.getSource();if(de&&de.vectorLayerIds)for(const fe in this._layers){const we=this._layers[fe];we.source===de.id&&this._validateLayer(we)}})}loadURL(x,E={},B){this.fire(new l.k("dataloading",{dataType:"style"})),E.validate=typeof E.validate!="boolean"||E.validate;const z=this.map._requestManager.transformRequest(x,y.Style);this._request=l.f(z,(J,de)=>{this._request=null,J?this.fire(new l.j(J)):de&&this._load(de,E,B)})}loadJSON(x,E={},B){this.fire(new l.k("dataloading",{dataType:"style"})),this._request=l.h.frame(()=>{this._request=null,E.validate=E.validate!==!1,this._load(x,E,B)})}loadEmpty(){this.fire(new l.k("dataloading",{dataType:"style"})),this._load(si,{validate:!1})}_load(x,E,B){var z;const J=E.transformStyle?E.transformStyle(B,x):x;if(!E.validate||!cn(this,l.y(J))){this._loaded=!0,this.stylesheet=J;for(const de in J.sources)this.addSource(de,J.sources[de],{validate:!1});J.sprite?this._loadSprite(J.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(J.glyphs),this._createLayers(),this.light=new K(this.stylesheet.light),this.map.setTerrain((z=this.stylesheet.terrain)!==null&&z!==void 0?z:null),this.fire(new l.k("data",{dataType:"style"})),this.fire(new l.k("style.load"))}}_createLayers(){const x=l.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",x),this._order=x.map(E=>E.id),this._layers={},this._serializedLayers=null;for(const E of x){const B=l.aC(E);B.setEventedParent(this,{layer:{id:E.id}}),this._layers[E.id]=B}}_loadSprite(x,E=!1,B=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(z,J,de,fe){const we=C(z),He=we.length,De=de>1?"@2x":"",We={},st={},Qt={};for(const{id:bt,url:Ct}of we){const Tt=J.transformRequest(J.normalizeSpriteURL(Ct,De,".json"),y.SpriteJSON),Kt=`${bt}_${Tt.url}`;We[Kt]=l.f(Tt,(tr,pr)=>{delete We[Kt],st[bt]=pr,A(fe,st,Qt,tr,He)});const sr=J.transformRequest(J.normalizeSpriteURL(Ct,De,".png"),y.SpriteImage),It=`${bt}_${sr.url}`;We[It]=T.getImage(sr,(tr,pr)=>{delete We[It],Qt[bt]=pr,A(fe,st,Qt,tr,He)})}return{cancel(){for(const bt of Object.values(We))bt.cancel()}}}(x,this.map._requestManager,this.map.getPixelRatio(),(z,J)=>{if(this._spriteRequest=null,z)this.fire(new l.j(z));else if(J)for(const de in J){this._spritesImagesIds[de]=[];const fe=this._spritesImagesIds[de]?this._spritesImagesIds[de].filter(we=>!(we in J)):[];for(const we of fe)this.imageManager.removeImage(we),this._changedImages[we]=!0;for(const we in J[de]){const He=de==="default"?we:`${de}:${we}`;this._spritesImagesIds[de].push(He),He in this.imageManager.images?this.imageManager.updateImage(He,J[de][we],!1):this.imageManager.addImage(He,J[de][we]),E&&(this._changedImages[He]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),E&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"})),B&&B(z)})}_unloadSprite(){for(const x of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(x),this._changedImages[x]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}_validateLayer(x){const E=this.sourceCaches[x.source];if(!E)return;const B=x.sourceLayer;if(!B)return;const z=E.getSource();(z.type==="geojson"||z.vectorLayerIds&&z.vectorLayerIds.indexOf(B)===-1)&&this.fire(new l.j(new Error(`Source layer "${B}" does not exist on source "${z.id}" as specified by style layer "${x.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const x in this.sourceCaches)if(!this.sourceCaches[x].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(x){const E=this._serializedAllLayers();if(!x||x.length===0)return Object.values(E);const B=[];for(const z of x)E[z]&&B.push(E[z]);return B}_serializedAllLayers(){let x=this._serializedLayers;if(x)return x;x=this._serializedLayers={};const E=Object.keys(this._layers);for(const B of E){const z=this._layers[B];z.type!=="custom"&&(x[B]=z.serialize())}return x}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const x in this.sourceCaches)if(this.sourceCaches[x].hasTransition())return!0;for(const x in this._layers)if(this._layers[x].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(x){if(!this._loaded)return;const E=this._changed;if(this._changed){const z=Object.keys(this._updatedLayers),J=Object.keys(this._removedLayers);(z.length||J.length)&&this._updateWorkerLayers(z,J);for(const de in this._updatedSources){const fe=this._updatedSources[de];if(fe==="reload")this._reloadSource(de);else{if(fe!=="clear")throw new Error(`Invalid action ${fe}`);this._clearSource(de)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const de in this._updatedPaintProps)this._layers[de].updateTransitions(x);this.light.updateTransitions(x),this._resetUpdates()}const B={};for(const z in this.sourceCaches){const J=this.sourceCaches[z];B[z]=J.used,J.used=!1}for(const z of this._order){const J=this._layers[z];J.recalculate(x,this._availableImages),!J.isHidden(x.zoom)&&J.source&&(this.sourceCaches[J.source].used=!0)}for(const z in B){const J=this.sourceCaches[z];B[z]!==J.used&&J.fire(new l.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:z}))}this.light.recalculate(x),this.z=x.zoom,E&&this.fire(new l.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const x=Object.keys(this._changedImages);if(x.length){for(const E in this.sourceCaches)this.sourceCaches[E].reloadTilesForDependencies(["icons","patterns"],x);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const x in this.sourceCaches)this.sourceCaches[x].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(x,E){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(x),removedIds:E})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(x,E={}){this._checkLoaded();const B=this.serialize();if(x=E.transformStyle?E.transformStyle(B,x):x,cn(this,l.y(x)))return!1;(x=l.aD(x)).layers=l.aB(x.layers);const z=l.aE(B,x).filter(de=>!(de.command in Zn));if(z.length===0)return!1;const J=z.filter(de=>!(de.command in ni));if(J.length>0)throw new Error(`Unimplemented: ${J.map(de=>de.command).join(", ")}.`);for(const de of z)de.command!=="setTransition"&&this[de.command].apply(this,de.args);return this.stylesheet=x,this._serializedLayers=null,!0}addImage(x,E){if(this.getImage(x))return this.fire(new l.j(new Error(`An image named "${x}" already exists.`)));this.imageManager.addImage(x,E),this._afterImageUpdated(x)}updateImage(x,E){this.imageManager.updateImage(x,E)}getImage(x){return this.imageManager.getImage(x)}removeImage(x){if(!this.getImage(x))return this.fire(new l.j(new Error(`An image named "${x}" does not exist.`)));this.imageManager.removeImage(x),this._afterImageUpdated(x)}_afterImageUpdated(x){this._availableImages=this.imageManager.listImages(),this._changedImages[x]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(x,E,B={}){if(this._checkLoaded(),this.sourceCaches[x]!==void 0)throw new Error(`Source "${x}" already exists.`);if(!E.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(E).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(E.type)>=0&&this._validate(l.y.source,`sources.${x}`,E,null,B))return;this.map&&this.map._collectResourceTiming&&(E.collectResourceTiming=!0);const z=this.sourceCaches[x]=new pt(x,E,this.dispatcher);z.style=this,z.setEventedParent(this,()=>({isSourceLoaded:z.loaded(),source:z.serialize(),sourceId:x})),z.onAdd(this.map),this._changed=!0}removeSource(x){if(this._checkLoaded(),this.sourceCaches[x]===void 0)throw new Error("There is no source with this ID");for(const B in this._layers)if(this._layers[B].source===x)return this.fire(new l.j(new Error(`Source "${x}" cannot be removed while layer "${B}" is using it.`)));const E=this.sourceCaches[x];delete this.sourceCaches[x],delete this._updatedSources[x],E.fire(new l.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:x})),E.setEventedParent(null),E.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(x,E){if(this._checkLoaded(),this.sourceCaches[x]===void 0)throw new Error(`There is no source with this ID=${x}`);const B=this.sourceCaches[x].getSource();if(B.type!=="geojson")throw new Error(`geojsonSource.type is ${B.type}, which is !== 'geojson`);B.setData(E),this._changed=!0}getSource(x){return this.sourceCaches[x]&&this.sourceCaches[x].getSource()}addLayer(x,E,B={}){this._checkLoaded();const z=x.id;if(this.getLayer(z))return void this.fire(new l.j(new Error(`Layer "${z}" already exists on this map.`)));let J;if(x.type==="custom"){if(cn(this,l.aF(x)))return;J=l.aC(x)}else{if("source"in x&&typeof x.source=="object"&&(this.addSource(z,x.source),x=l.aD(x),x=l.e(x,{source:z})),this._validate(l.y.layer,`layers.${z}`,x,{arrayIndex:-1},B))return;J=l.aC(x),this._validateLayer(J),J.setEventedParent(this,{layer:{id:z}})}const de=E?this._order.indexOf(E):this._order.length;if(E&&de===-1)this.fire(new l.j(new Error(`Cannot add layer "${z}" before non-existing layer "${E}".`)));else{if(this._order.splice(de,0,z),this._layerOrderChanged=!0,this._layers[z]=J,this._removedLayers[z]&&J.source&&J.type!=="custom"){const fe=this._removedLayers[z];delete this._removedLayers[z],fe.type!==J.type?this._updatedSources[J.source]="clear":(this._updatedSources[J.source]="reload",this.sourceCaches[J.source].pause())}this._updateLayer(J),J.onAdd&&J.onAdd(this.map)}}moveLayer(x,E){if(this._checkLoaded(),this._changed=!0,!this._layers[x])return void this.fire(new l.j(new Error(`The layer '${x}' does not exist in the map's style and cannot be moved.`)));if(x===E)return;const B=this._order.indexOf(x);this._order.splice(B,1);const z=E?this._order.indexOf(E):this._order.length;E&&z===-1?this.fire(new l.j(new Error(`Cannot move layer "${x}" before non-existing layer "${E}".`))):(this._order.splice(z,0,x),this._layerOrderChanged=!0)}removeLayer(x){this._checkLoaded();const E=this._layers[x];if(!E)return void this.fire(new l.j(new Error(`Cannot remove non-existing layer "${x}".`)));E.setEventedParent(null);const B=this._order.indexOf(x);this._order.splice(B,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[x]=E,delete this._layers[x],this._serializedLayers&&delete this._serializedLayers[x],delete this._updatedLayers[x],delete this._updatedPaintProps[x],E.onRemove&&E.onRemove(this.map)}getLayer(x){return this._layers[x]}getLayersOrder(){return[...this._order]}hasLayer(x){return x in this._layers}setLayerZoomRange(x,E,B){this._checkLoaded();const z=this.getLayer(x);z?z.minzoom===E&&z.maxzoom===B||(E!=null&&(z.minzoom=E),B!=null&&(z.maxzoom=B),this._updateLayer(z)):this.fire(new l.j(new Error(`Cannot set the zoom range of non-existing layer "${x}".`)))}setFilter(x,E,B={}){this._checkLoaded();const z=this.getLayer(x);if(z){if(!l.aG(z.filter,E))return E==null?(z.filter=void 0,void this._updateLayer(z)):void(this._validate(l.y.filter,`layers.${z.id}.filter`,E,null,B)||(z.filter=l.aD(E),this._updateLayer(z)))}else this.fire(new l.j(new Error(`Cannot filter non-existing layer "${x}".`)))}getFilter(x){return l.aD(this.getLayer(x).filter)}setLayoutProperty(x,E,B,z={}){this._checkLoaded();const J=this.getLayer(x);J?l.aG(J.getLayoutProperty(E),B)||(J.setLayoutProperty(E,B,z),this._updateLayer(J)):this.fire(new l.j(new Error(`Cannot style non-existing layer "${x}".`)))}getLayoutProperty(x,E){const B=this.getLayer(x);if(B)return B.getLayoutProperty(E);this.fire(new l.j(new Error(`Cannot get style of non-existing layer "${x}".`)))}setPaintProperty(x,E,B,z={}){this._checkLoaded();const J=this.getLayer(x);J?l.aG(J.getPaintProperty(E),B)||(J.setPaintProperty(E,B,z)&&this._updateLayer(J),this._changed=!0,this._updatedPaintProps[x]=!0):this.fire(new l.j(new Error(`Cannot style non-existing layer "${x}".`)))}getPaintProperty(x,E){return this.getLayer(x).getPaintProperty(E)}setFeatureState(x,E){this._checkLoaded();const B=x.source,z=x.sourceLayer,J=this.sourceCaches[B];if(J===void 0)return void this.fire(new l.j(new Error(`The source '${B}' does not exist in the map's style.`)));const de=J.getSource().type;de==="geojson"&&z?this.fire(new l.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):de!=="vector"||z?(x.id===void 0&&this.fire(new l.j(new Error("The feature id parameter must be provided."))),J.setFeatureState(z,x.id,E)):this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(x,E){this._checkLoaded();const B=x.source,z=this.sourceCaches[B];if(z===void 0)return void this.fire(new l.j(new Error(`The source '${B}' does not exist in the map's style.`)));const J=z.getSource().type,de=J==="vector"?x.sourceLayer:void 0;J!=="vector"||de?E&&typeof x.id!="string"&&typeof x.id!="number"?this.fire(new l.j(new Error("A feature id is required to remove its specific state property."))):z.removeFeatureState(de,x.id,E):this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(x){this._checkLoaded();const E=x.source,B=x.sourceLayer,z=this.sourceCaches[E];if(z!==void 0)return z.getSource().type!=="vector"||B?(x.id===void 0&&this.fire(new l.j(new Error("The feature id parameter must be provided."))),z.getFeatureState(B,x.id)):void this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new l.j(new Error(`The source '${E}' does not exist in the map's style.`)))}getTransition(){return l.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const x=l.aH(this.sourceCaches,J=>J.serialize()),E=this._serializeByIds(this._order),B=this.map.getTerrain()||void 0,z=this.stylesheet;return l.aI({version:z.version,name:z.name,metadata:z.metadata,light:z.light,center:z.center,zoom:z.zoom,bearing:z.bearing,pitch:z.pitch,sprite:z.sprite,glyphs:z.glyphs,transition:z.transition,sources:x,layers:E,terrain:B},J=>J!==void 0)}_updateLayer(x){this._updatedLayers[x.id]=!0,x.source&&!this._updatedSources[x.source]&&this.sourceCaches[x.source].getSource().type!=="raster"&&(this._updatedSources[x.source]="reload",this.sourceCaches[x.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(x){const E=de=>this._layers[de].type==="fill-extrusion",B={},z=[];for(let de=this._order.length-1;de>=0;de--){const fe=this._order[de];if(E(fe)){B[fe]=de;for(const we of x){const He=we[fe];if(He)for(const De of He)z.push(De)}}}z.sort((de,fe)=>fe.intersectionZ-de.intersectionZ);const J=[];for(let de=this._order.length-1;de>=0;de--){const fe=this._order[de];if(E(fe))for(let we=z.length-1;we>=0;we--){const He=z[we].feature;if(B[He.layer.id]<de)break;J.push(He),z.pop()}else for(const we of x){const He=we[fe];if(He)for(const De of He)J.push(De.feature)}}return J}queryRenderedFeatures(x,E,B){E&&E.filter&&this._validate(l.y.filter,"queryRenderedFeatures.filter",E.filter,null,E);const z={};if(E&&E.layers){if(!Array.isArray(E.layers))return this.fire(new l.j(new Error("parameters.layers must be an Array."))),[];for(const fe of E.layers){const we=this._layers[fe];if(!we)return this.fire(new l.j(new Error(`The layer '${fe}' does not exist in the map's style and cannot be queried for features.`))),[];z[we.source]=!0}}const J=[];E.availableImages=this._availableImages;const de=this._serializedAllLayers();for(const fe in this.sourceCaches)E.layers&&!z[fe]||J.push(et(this.sourceCaches[fe],this._layers,de,x,E,B));return this.placement&&J.push(function(fe,we,He,De,We,st,Qt){const bt={},Ct=st.queryRenderedSymbols(De),Tt=[];for(const Kt of Object.keys(Ct).map(Number))Tt.push(Qt[Kt]);Tt.sort(Ve);for(const Kt of Tt){const sr=Kt.featureIndex.lookupSymbolFeatures(Ct[Kt.bucketInstanceId],we,Kt.bucketIndex,Kt.sourceLayerIndex,We.filter,We.layers,We.availableImages,fe);for(const It in sr){const tr=bt[It]=bt[It]||[],pr=sr[It];pr.sort((ur,Tr)=>{const Lr=Kt.featureSortOrder;if(Lr){const br=Lr.indexOf(ur.featureIndex);return Lr.indexOf(Tr.featureIndex)-br}return Tr.featureIndex-ur.featureIndex});for(const ur of pr)tr.push(ur)}}for(const Kt in bt)bt[Kt].forEach(sr=>{const It=sr.feature,tr=He[fe[Kt].source].getFeatureState(It.layer["source-layer"],It.id);It.source=It.layer.source,It.layer["source-layer"]&&(It.sourceLayer=It.layer["source-layer"]),It.state=tr});return bt}(this._layers,de,this.sourceCaches,x,E,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(J)}querySourceFeatures(x,E){E&&E.filter&&this._validate(l.y.filter,"querySourceFeatures.filter",E.filter,null,E);const B=this.sourceCaches[x];return B?function(z,J){const de=z.getRenderableIds().map(He=>z.getTileByID(He)),fe=[],we={};for(let He=0;He<de.length;He++){const De=de[He],We=De.tileID.canonical.key;we[We]||(we[We]=!0,De.querySourceFeatures(fe,J))}return fe}(B,E):[]}addSourceType(x,E,B){return qe(x)?B(new Error(`A source type called "${x}" already exists.`)):(((z,J)=>{Ie[z]=J})(x,E),E.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:x,url:E.workerSourceURL},B):B(null,null))}getLight(){return this.light.getLight()}setLight(x,E={}){this._checkLoaded();const B=this.light.getLight();let z=!1;for(const de in x)if(!l.aG(x[de],B[de])){z=!0;break}if(!z)return;const J={now:l.h.now(),transition:l.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(x,E),this.light.updateTransitions(J)}_validate(x,E,B,z,J={}){return(!J||J.validate!==!1)&&cn(this,x.call(l.y,l.e({key:E,style:this.serialize(),value:B,styleSpec:l.v},z)))}_remove(x=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),l.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const E in this._layers)this._layers[E].setEventedParent(null);for(const E in this.sourceCaches){const B=this.sourceCaches[E];B.setEventedParent(null),B.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(x)}_clearSource(x){this.sourceCaches[x].clearTiles()}_reloadSource(x){this.sourceCaches[x].resume(),this.sourceCaches[x].reload()}_updateSources(x){for(const E in this.sourceCaches)this.sourceCaches[E].update(x,this.map.terrain)}_generateCollisionBoxes(){for(const x in this.sourceCaches)this._reloadSource(x)}_updatePlacement(x,E,B,z,J=!1){let de=!1,fe=!1;const we={};for(const He of this._order){const De=this._layers[He];if(De.type!=="symbol")continue;if(!we[De.source]){const st=this.sourceCaches[De.source];we[De.source]=st.getRenderableIds(!0).map(Qt=>st.getTileByID(Qt)).sort((Qt,bt)=>bt.tileID.overscaledZ-Qt.tileID.overscaledZ||(Qt.tileID.isLessThan(bt.tileID)?-1:1))}const We=this.crossTileSymbolIndex.addLayer(De,we[De.source],x.center.lng);de=de||We}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((J=J||this._layerOrderChanged||B===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l.h.now(),x.zoom))&&(this.pauseablePlacement=new Fr(x,this.map.terrain,this._order,J,E,B,z,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,we),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(l.h.now()),fe=!0),de&&this.pauseablePlacement.placement.setStale()),fe||de)for(const He of this._order){const De=this._layers[He];De.type==="symbol"&&this.placement.updateLayerOpacities(De,we[De.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(l.h.now())}_releaseSymbolFadeTiles(){for(const x in this.sourceCaches)this.sourceCaches[x].releaseSymbolFadeTiles()}getImages(x,E,B){this.imageManager.getImages(E.icons,B),this._updateTilesForChangedImages();const z=this.sourceCaches[E.source];z&&z.setDependencies(E.tileID.key,E.type,E.icons)}getGlyphs(x,E,B){this.glyphManager.getGlyphs(E.stacks,B);const z=this.sourceCaches[E.source];z&&z.setDependencies(E.tileID.key,E.type,[""])}getResource(x,E,B){return l.m(E,B)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(x,E={}){this._checkLoaded(),x&&this._validate(l.y.glyphs,"glyphs",x,null,E)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=x,this.glyphManager.entries={},this.glyphManager.setURL(x))}addSprite(x,E,B={},z){this._checkLoaded();const J=[{id:x,url:E}],de=[...C(this.stylesheet.sprite),...J];this._validate(l.y.sprite,"sprite",de,null,B)||(this.stylesheet.sprite=de,this._loadSprite(J,!0,z))}removeSprite(x){this._checkLoaded();const E=C(this.stylesheet.sprite);if(E.find(B=>B.id===x)){if(this._spritesImagesIds[x])for(const B of this._spritesImagesIds[x])this.imageManager.removeImage(B),this._changedImages[B]=!0;E.splice(E.findIndex(B=>B.id===x),1),this.stylesheet.sprite=E.length>0?E:void 0,delete this._spritesImagesIds[x],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}else this.fire(new l.j(new Error(`Sprite "${x}" doesn't exists on this map.`)))}getSprite(){return C(this.stylesheet.sprite)}setSprite(x,E={},B){this._checkLoaded(),x&&this._validate(l.y.sprite,"sprite",x,null,E)||(this.stylesheet.sprite=x,x?this._loadSprite(x,!0,B):(this._unloadSprite(),B&&B(null)))}}ii.registerForPluginStateChange=l.aK;var ra=l.Q([{name:"a_pos",type:"Int16",components:2}]),mo="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const Qn={prelude:jn(`#ifdef GL_ES
444
444
  precision mediump float;
445
445
  #else
@@ -1082,7 +1082,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1082
1082
  `;)e.i++;e.i++},Math:function(e,t){e.saveText();for(var r=e.i,n,i,o=0;i=e.GetNext();)switch(n=e.i++,i){case"\\":var s=e.GetCS();s===")"&&(i="\\(");case"$":if(o===0&&t===i){var l=e.texParser.configuration,c=new FQt.default(e.string.substr(r,n-r),e.stack.env,l).mml();e.PushMath(c);return}break;case"{":o++;break;case"}":o===0&&e.Error("ExtraCloseMissingOpen","Extra close brace or missing open brace"),o--;break}e.Error("MathNotTerminated","Math-mode is not properly terminated")},MathModeOnly:function(e,t){e.Error("MathModeOnly","'%1' allowed only in math mode",t)},Misplaced:function(e,t){e.Error("Misplaced","'%1' can not be used here",t)},OpenBrace:function(e,t){var r=e.stack.env;e.envStack.push(r),e.stack.env=Object.assign({},r)},CloseBrace:function(e,t){e.envStack.length?(e.saveText(),e.stack.env=e.envStack.pop()):e.Error("ExtraCloseMissingOpen","Extra close brace or missing open brace")},OpenQuote:function(e,t){e.string.charAt(e.i)===t?(e.text+="“",e.i++):e.text+="‘"},CloseQuote:function(e,t){e.string.charAt(e.i)===t?(e.text+="”",e.i++):e.text+="’"},Tilde:function(e,t){e.text+=" "},Space:function(e,t){for(e.text+=" ";e.GetNext().match(/\s/);)e.i++},SelfQuote:function(e,t){e.text+=t.substr(1)},Insert:function(e,t,r){e.text+=r},Accent:function(e,t,r){var n=e.ParseArg(t),i=e.create("token","mo",{},r);e.addAttributes(i),e.Push(e.create("node","mover",[n,i]))},Emph:function(e,t){var r=e.stack.env.mathvariant==="-tex-mathit"?"normal":"-tex-mathit";e.Push(e.ParseTextArg(t,{mathvariant:r}))},SetFont:function(e,t,r){e.saveText(),e.stack.env.mathvariant=r},SetSize:function(e,t,r){e.saveText(),e.stack.env.mathsize=r},CheckAutoload:function(e,t){var r=e.configuration.packageData.get("autoload"),n=e.texParser;t=t.slice(1);var i=n.lookup("macro",t);if(!i||r&&i._func===r.Autoload){if(n.parse("macro",[n,t]),!i)return;(0,DQt.retryAfter)(Promise.resolve())}n.parse("macro",[e,t])},Macro:ny.default.Macro,Spacer:ny.default.Spacer,Hskip:ny.default.Hskip,rule:ny.default.rule,Rule:ny.default.Rule,HandleRef:ny.default.HandleRef};var q_={},zQt=ae&&ae.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),w5e=ae&&ae.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},jQt=ae&&ae.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o},UQt=ae&&ae.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},jH=ae&&ae.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(q_,"__esModule",{value:!0}),q_.TextParser=void 0;var GQt=jH(Mc()),L5e=jH(ao),qQt=jH(Fo()),WQt=Rn,S5e=jH(Ro),k5e=Bn,ZQt=function(e){zQt(t,e);function t(r,n,i,o){var s=e.call(this,r,n,i)||this;return s.level=o,s}return Object.defineProperty(t.prototype,"texParser",{get:function(){return this.configuration.packageData.get("textmacros").texParser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tags",{get:function(){return this.texParser.tags},enumerable:!1,configurable:!0}),t.prototype.mml=function(){return this.level!=null?this.create("node","mstyle",this.nodes,{displaystyle:!1,scriptlevel:this.level}):this.nodes.length===1?this.nodes[0]:this.create("node","mrow",this.nodes)},t.prototype.Parse=function(){this.text="",this.nodes=[],this.envStack=[],e.prototype.Parse.call(this)},t.prototype.saveText=function(){if(this.text){var r=this.stack.env.mathvariant,n=qQt.default.internalText(this,this.text,r?{mathvariant:r}:{});this.text="",this.Push(n)}},t.prototype.Push=function(r){if(this.text&&this.saveText(),r instanceof k5e.StopItem)return e.prototype.Push.call(this,r);if(r instanceof k5e.StyleItem){this.stack.env.mathcolor=this.stack.env.color;return}r instanceof WQt.AbstractMmlNode&&(this.addAttributes(r),this.nodes.push(r))},t.prototype.PushMath=function(r){var n,i,o=this.stack.env;r.isKind("TeXAtom")||(r=this.create("node","TeXAtom",[r]));try{for(var s=w5e(["mathsize","mathcolor"]),l=s.next();!l.done;l=s.next()){var c=l.value;o[c]&&!r.attributes.getExplicit(c)&&(!r.isToken&&!r.isKind("mstyle")&&(r=this.create("node","mstyle",[r])),S5e.default.setAttribute(r,c,o[c]))}}catch(u){n={error:u}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}r.isInferred&&(r=this.create("node","mrow",r.childNodes)),this.nodes.push(r)},t.prototype.addAttributes=function(r){var n,i,o=this.stack.env;if(r.isToken)try{for(var s=w5e(["mathsize","mathcolor","mathvariant"]),l=s.next();!l.done;l=s.next()){var c=l.value;o[c]&&!r.attributes.getExplicit(c)&&S5e.default.setAttribute(r,c,o[c])}}catch(u){n={error:u}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}},t.prototype.ParseTextArg=function(r,n){var i=this.GetArgument(r);return n=Object.assign(Object.assign({},this.stack.env),n),new t(i,n,this.configuration).mml()},t.prototype.ParseArg=function(r){return new t(this.GetArgument(r),this.stack.env,this.configuration).mml()},t.prototype.Error=function(r,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];throw new(L5e.default.bind.apply(L5e.default,UQt([void 0,r,n],jQt(i),!1)))},t}(GQt.default);q_.TextParser=ZQt;var KQt=ae&&ae.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},XQt=zn,c0=Kl,JQt=ry,YQt=KQt(Fo()),$Qt=q_;new XQt.CommandMap("textcomp-macros",{textasciicircum:["Insert","^"],textasciitilde:["Insert","~"],textasteriskcentered:["Insert","*"],textbackslash:["Insert","\\"],textbar:["Insert","|"],textbraceleft:["Insert","{"],textbraceright:["Insert","}"],textbullet:["Insert","•"],textdagger:["Insert","†"],textdaggerdbl:["Insert","‡"],textellipsis:["Insert","…"],textemdash:["Insert","—"],textendash:["Insert","–"],textexclamdown:["Insert","¡"],textgreater:["Insert",">"],textless:["Insert","<"],textordfeminine:["Insert","ª"],textordmasculine:["Insert","º"],textparagraph:["Insert","¶"],textperiodcentered:["Insert","·"],textquestiondown:["Insert","¿"],textquotedblleft:["Insert","“"],textquotedblright:["Insert","”"],textquoteleft:["Insert","‘"],textquoteright:["Insert","’"],textsection:["Insert","§"],textunderscore:["Insert","_"],textvisiblespace:["Insert","␣"],textacutedbl:["Insert","˝"],textasciiacute:["Insert","´"],textasciibreve:["Insert","˘"],textasciicaron:["Insert","ˇ"],textasciidieresis:["Insert","¨"],textasciimacron:["Insert","¯"],textgravedbl:["Insert","˵"],texttildelow:["Insert","˷"],textbaht:["Insert","฿"],textcent:["Insert","¢"],textcolonmonetary:["Insert","₡"],textcurrency:["Insert","¤"],textdollar:["Insert","$"],textdong:["Insert","₫"],texteuro:["Insert","€"],textflorin:["Insert","ƒ"],textguarani:["Insert","₲"],textlira:["Insert","₤"],textnaira:["Insert","₦"],textpeso:["Insert","₱"],textsterling:["Insert","£"],textwon:["Insert","₩"],textyen:["Insert","¥"],textcircledP:["Insert","℗"],textcompwordmark:["Insert","‌"],textcopyleft:["Insert","🄯"],textcopyright:["Insert","©"],textregistered:["Insert","®"],textservicemark:["Insert","℠"],texttrademark:["Insert","™"],textbardbl:["Insert","‖"],textbigcircle:["Insert","◯"],textblank:["Insert","␢"],textbrokenbar:["Insert","¦"],textdiscount:["Insert","⁒"],textestimated:["Insert","℮"],textinterrobang:["Insert","‽"],textinterrobangdown:["Insert","⸘"],textmusicalnote:["Insert","♪"],textnumero:["Insert","№"],textopenbullet:["Insert","◦"],textpertenthousand:["Insert","‱"],textperthousand:["Insert","‰"],textrecipe:["Insert","℞"],textreferencemark:["Insert","※"],textlangle:["Insert","〈"],textrangle:["Insert","〉"],textlbrackdbl:["Insert","⟦"],textrbrackdbl:["Insert","⟧"],textlquill:["Insert","⁅"],textrquill:["Insert","⁆"],textcelsius:["Insert","℃"],textdegree:["Insert","°"],textdiv:["Insert","÷"],textdownarrow:["Insert","↓"],textfractionsolidus:["Insert","⁄"],textleftarrow:["Insert","←"],textlnot:["Insert","¬"],textmho:["Insert","℧"],textminus:["Insert","−"],textmu:["Insert","µ"],textohm:["Insert","Ω"],textonehalf:["Insert","½"],textonequarter:["Insert","¼"],textonesuperior:["Insert","¹"],textpm:["Insert","±"],textrightarrow:["Insert","→"],textsurd:["Insert","√"],textthreequarters:["Insert","¾"],textthreesuperior:["Insert","³"],texttimes:["Insert","×"],texttwosuperior:["Insert","²"],textuparrow:["Insert","↑"],textborn:["Insert","*"],textdied:["Insert","†"],textdivorced:["Insert","⚮"],textmarried:["Insert","⚭"],textcentoldstyle:["Insert","¢",c0.TexConstant.Variant.OLDSTYLE],textdollaroldstyle:["Insert","$",c0.TexConstant.Variant.OLDSTYLE],textzerooldstyle:["Insert","0",c0.TexConstant.Variant.OLDSTYLE],textoneoldstyle:["Insert","1",c0.TexConstant.Variant.OLDSTYLE],texttwooldstyle:["Insert","2",c0.TexConstant.Variant.OLDSTYLE],textthreeoldstyle:["Insert","3",c0.TexConstant.Variant.OLDSTYLE],textfouroldstyle:["Insert","4",c0.TexConstant.Variant.OLDSTYLE],textfiveoldstyle:["Insert","5",c0.TexConstant.Variant.OLDSTYLE],textsixoldstyle:["Insert","6",c0.TexConstant.Variant.OLDSTYLE],textsevenoldstyle:["Insert","7",c0.TexConstant.Variant.OLDSTYLE],texteightoldstyle:["Insert","8",c0.TexConstant.Variant.OLDSTYLE],textnineoldstyle:["Insert","9",c0.TexConstant.Variant.OLDSTYLE]},{Insert:function(e,t,r,n){if(e instanceof $Qt.TextParser){if(!n){JQt.TextMacrosMethods.Insert(e,t,r);return}e.saveText()}e.Push(YQt.default.internalText(e,r,n?{mathvariant:n}:{}))}}),Object.defineProperty(AW,"__esModule",{value:!0}),AW.TextcompConfiguration=void 0;var ebt=ji;AW.TextcompConfiguration=ebt.Configuration.create("textcomp",{handler:{macro:["textcomp-macros"]}});var W_={},M5e=zn,td=Kl,C5e=ry,em=W3;new M5e.MacroMap("text-special",{$:"Math","%":"Comment","^":"MathModeOnly",_:"MathModeOnly","&":"Misplaced","#":"Misplaced","~":"Tilde"," ":"Space"," ":"Space","\r":"Space","\n":"Space"," ":"Tilde","{":"OpenBrace","}":"CloseBrace","`":"OpenQuote","'":"CloseQuote"},C5e.TextMacrosMethods),new M5e.CommandMap("text-macros",{"(":"Math",$:"SelfQuote",_:"SelfQuote","%":"SelfQuote","{":"SelfQuote","}":"SelfQuote"," ":"SelfQuote","&":"SelfQuote","#":"SelfQuote","\\":"SelfQuote","'":["Accent","´"],"’":["Accent","´"],"`":["Accent","`"],"‘":["Accent","`"],"^":["Accent","^"],'"':["Accent","¨"],"~":["Accent","~"],"=":["Accent","¯"],".":["Accent","˙"],u:["Accent","˘"],v:["Accent","ˇ"],emph:"Emph",rm:["SetFont",td.TexConstant.Variant.NORMAL],mit:["SetFont",td.TexConstant.Variant.ITALIC],oldstyle:["SetFont",td.TexConstant.Variant.OLDSTYLE],cal:["SetFont",td.TexConstant.Variant.CALLIGRAPHIC],it:["SetFont","-tex-mathit"],bf:["SetFont",td.TexConstant.Variant.BOLD],bbFont:["SetFont",td.TexConstant.Variant.DOUBLESTRUCK],scr:["SetFont",td.TexConstant.Variant.SCRIPT],frak:["SetFont",td.TexConstant.Variant.FRAKTUR],sf:["SetFont",td.TexConstant.Variant.SANSSERIF],tt:["SetFont",td.TexConstant.Variant.MONOSPACE],tiny:["SetSize",.5],Tiny:["SetSize",.6],scriptsize:["SetSize",.7],small:["SetSize",.85],normalsize:["SetSize",1],large:["SetSize",1.2],Large:["SetSize",1.44],LARGE:["SetSize",1.73],huge:["SetSize",2.07],Huge:["SetSize",2.49],Bbb:["Macro","{\\bbFont #1}",1],textnormal:["Macro","{\\rm #1}",1],textup:["Macro","{\\rm #1}",1],textrm:["Macro","{\\rm #1}",1],textit:["Macro","{\\it #1}",1],textbf:["Macro","{\\bf #1}",1],textsf:["Macro","{\\sf #1}",1],texttt:["Macro","{\\tt #1}",1],dagger:["Insert","†"],ddagger:["Insert","‡"],S:["Insert","§"],",":["Spacer",em.MATHSPACE.thinmathspace],":":["Spacer",em.MATHSPACE.mediummathspace],">":["Spacer",em.MATHSPACE.mediummathspace],";":["Spacer",em.MATHSPACE.thickmathspace],"!":["Spacer",em.MATHSPACE.negativethinmathspace],enspace:["Spacer",.5],quad:["Spacer",1],qquad:["Spacer",2],thinspace:["Spacer",em.MATHSPACE.thinmathspace],negthinspace:["Spacer",em.MATHSPACE.negativethinmathspace],hskip:"Hskip",hspace:"Hskip",kern:"Hskip",mskip:"Hskip",mspace:"Hskip",mkern:"Hskip",rule:"rule",Rule:["Rule"],Space:["Rule","blank"],color:"CheckAutoload",textcolor:"CheckAutoload",colorbox:"CheckAutoload",fcolorbox:"CheckAutoload",href:"CheckAutoload",style:"CheckAutoload",class:"CheckAutoload",cssId:"CheckAutoload",unicode:"CheckAutoload",ref:["HandleRef",!1],eqref:["HandleRef",!0]},C5e.TextMacrosMethods);var tbt=ae&&ae.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},iy;Object.defineProperty(W_,"__esModule",{value:!0}),W_.TextMacrosConfiguration=W_.TextBaseConfiguration=void 0;var OW=ji,rbt=tbt(XE),E5e=F4,Eh=Bn,A5e=q_,nbt=ry;W_.TextBaseConfiguration=OW.Configuration.create("text-base",{parser:"text",handler:{character:["command","text-special"],macro:["text-macros"]},fallback:{character:function(e,t){e.text+=t},macro:function(e,t){var r=e.texParser,n=r.lookup("macro",t);n&&n._func!==nbt.TextMacrosMethods.Macro&&e.Error("MathMacro","%1 is only supported in math mode","\\"+t),r.parse("macro",[e,t])}},items:(iy={},iy[Eh.StartItem.prototype.kind]=Eh.StartItem,iy[Eh.StopItem.prototype.kind]=Eh.StopItem,iy[Eh.MmlItem.prototype.kind]=Eh.MmlItem,iy[Eh.StyleItem.prototype.kind]=Eh.StyleItem,iy)});function ibt(e,t,r,n){var i=e.configuration.packageData.get("textmacros");return e instanceof A5e.TextParser||(i.texParser=e),[new A5e.TextParser(t,n?{mathvariant:n}:{},i.parseOptions,r).mml()]}W_.TextMacrosConfiguration=OW.Configuration.create("textmacros",{config:function(e,t){var r=new OW.ParserConfiguration(t.parseOptions.options.textmacros.packages,["tex","text"]);r.init();var n=new rbt.default(r,[]);n.options=t.parseOptions.options,r.config(t),E5e.TagsFactory.addTags(r.tags),n.tags=E5e.TagsFactory.getDefault(),n.tags.configuration=n,n.packageData=t.parseOptions.packageData,n.packageData.set("textmacros",{parseOptions:n,jax:t,texParser:null}),n.options.internalMath=ibt},preprocessors:[function(e){var t=e.data.packageData.get("textmacros");t.parseOptions.nodeFactory.setMmlFactory(t.jax.mmlFactory)}],options:{textmacros:{packages:["text-base"]}}});var HW={};Object.defineProperty(HW,"__esModule",{value:!0}),HW.UpgreekConfiguration=void 0;var obt=ji,abt=zn,sbt=Kl;function lbt(e,t){var r=t.attributes||{};r.mathvariant=sbt.TexConstant.Variant.NORMAL;var n=e.create("token","mi",r,t.char);e.Push(n)}new abt.CharacterMap("upgreek",lbt,{upalpha:"α",upbeta:"β",upgamma:"γ",updelta:"δ",upepsilon:"ϵ",upzeta:"ζ",upeta:"η",uptheta:"θ",upiota:"ι",upkappa:"κ",uplambda:"λ",upmu:"μ",upnu:"ν",upxi:"ξ",upomicron:"ο",uppi:"π",uprho:"ρ",upsigma:"σ",uptau:"τ",upupsilon:"υ",upphi:"ϕ",upchi:"χ",uppsi:"ψ",upomega:"ω",upvarepsilon:"ε",upvartheta:"ϑ",upvarpi:"ϖ",upvarrho:"ϱ",upvarsigma:"ς",upvarphi:"φ",Upgamma:"Γ",Updelta:"Δ",Uptheta:"Θ",Uplambda:"Λ",Upxi:"Ξ",Uppi:"Π",Upsigma:"Σ",Upupsilon:"Υ",Upphi:"Φ",Uppsi:"Ψ",Upomega:"Ω"}),HW.UpgreekConfiguration=obt.Configuration.create("upgreek",{handler:{macro:["upgreek"]}});var cbt={};(function(e){var t=ae&&ae.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.UnicodeConfiguration=e.UnicodeMethods=void 0;var r=ji,n=t(ao),i=zn,o=t(Fo()),s=t(Ro),l=Mx;e.UnicodeMethods={};var c={};e.UnicodeMethods.Unicode=function(u,d){var p=u.GetBrackets(d),h=null,f=null;p&&(p.replace(/ /g,"").match(/^(\d+(\.\d*)?|\.\d+),(\d+(\.\d*)?|\.\d+)$/)?(h=p.replace(/ /g,"").split(/,/),f=u.GetBrackets(d)):f=p);var m=o.default.trimSpaces(u.GetArgument(d)).replace(/^0x/,"x");if(!m.match(/^(x[0-9A-Fa-f]+|[0-9]+)$/))throw new n.default("BadUnicode","Argument to \\unicode must be a number");var g=parseInt(m.match(/^x/)?"0"+m:m);c[g]?f||(f=c[g][2]):c[g]=[800,200,f,g],h&&(c[g][0]=Math.floor(parseFloat(h[0])*1e3),c[g][1]=Math.floor(parseFloat(h[1])*1e3));var T=u.stack.env.font,y={};f?(c[g][2]=y.fontfamily=f.replace(/'/g,"'"),T&&(T.match(/bold/)&&(y.fontweight="bold"),T.match(/italic|-mathit/)&&(y.fontstyle="italic"))):T&&(y.mathvariant=T);var v=u.create("token","mtext",y,(0,l.numeric)(m));s.default.setProperty(v,"unicode",!0),u.Push(v)},new i.CommandMap("unicode",{unicode:"Unicode"},e.UnicodeMethods),e.UnicodeConfiguration=r.Configuration.create("unicode",{handler:{macro:["unicode"]}})})(cbt);var ubt={};(function(e){var t=ae&&ae.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(e,"__esModule",{value:!0}),e.VerbConfiguration=e.VerbMethods=void 0;var r=ji,n=Kl,i=zn,o=t(ao);e.VerbMethods={},e.VerbMethods.Verb=function(s,l){var c=s.GetNext(),u=++s.i;if(c==="")throw new o.default("MissingArgFor","Missing argument for %1",l);for(;s.i<s.string.length&&s.string.charAt(s.i)!==c;)s.i++;if(s.i===s.string.length)throw new o.default("NoClosingDelim","Can't find closing delimiter for %1",s.currentCS);var d=s.string.slice(u,s.i).replace(/ /g," ");s.i++,s.Push(s.create("token","mtext",{mathvariant:n.TexConstant.Variant.MONOSPACE},d))},new i.CommandMap("verb",{verb:"Verb"},e.VerbMethods),e.VerbConfiguration=r.Configuration.create("verb",{handler:{macro:["verb"]}})})(ubt),Object.defineProperty(Hq,"__esModule",{value:!0});var O5e=Hq.AllPackages=void 0;p5e(),typeof MathJax<"u"&&MathJax.loader&&MathJax.loader.preLoad("[tex]/action","[tex]/ams","[tex]/amscd","[tex]/bbox","[tex]/boldsymbol","[tex]/braket","[tex]/bussproofs","[tex]/cancel","[tex]/cases","[tex]/centernot","[tex]/color","[tex]/colorv2","[tex]/colortbl","[tex]/empheq","[tex]/enclose","[tex]/extpfeil","[tex]/gensymb","[tex]/html","[tex]/mathtools","[tex]/mhchem","[tex]/newcommand","[tex]/noerrors","[tex]/noundefined","[tex]/physics","[tex]/upgreek","[tex]/unicode","[tex]/verb","[tex]/configmacros","[tex]/tagformat","[tex]/textcomp","[tex]/textmacros","[tex]/setoptions"),O5e=Hq.AllPackages=["base","action","ams","amscd","bbox","boldsymbol","braket","bussproofs","cancel","cases","centernot","color","colortbl","empheq","enclose","extpfeil","gensymb","html","mathtools","mhchem","newcommand","noerrors","noundefined","upgreek","unicode","verb","configmacros","tagformat","textcomp","textmacros"];const dbt=16,pbt=8,hbt=["svg a{fill:blue;stroke:blue}",'[data-mml-node="mstyle"]>rect[data-bgcolor="true"]{rx: 8%; ry: 12%}','[data-mml-node="merror"]>g{fill:red;stroke:red}','[data-mml-node="merror"]>rect[data-background]{fill:yellow;stroke:none}',"[data-frame],[data-line]{stroke-width:70px;fill:none}",".mjx-dashed{stroke-dasharray:140}",".mjx-dotted{stroke-linecap:round;stroke-dasharray:0,140}","use[data-c]{stroke-width:3px}"].join(""),H5e=A6e();uhe(H5e);const fbt=new ipe({packages:O5e}),mbt=new myt.SVG({fontCache:"local"}),gbt=RE.mathjax.document("",{InputJax:fbt,OutputJax:mbt});function ybt(e){const t=gbt.convert(e,{display:!1,em:2*dbt,ex:2*pbt});return H5e.innerHTML(t).replace(/<defs>/,`<defs><style>${hbt}</style>`)}function V5e(e,t,r){return e===null?[t[0]-r.lng,t[1]-r.lat,t[2]+r.lng,t[3]+r.lat]:[Math.min(e[0],t[0]-r.lng),Math.min(e[1],t[1]-r.lat),Math.max(e[2],t[2]+r.lng),Math.max(e[3],t[3]+r.lat)]}function Tbt(e){const t=e.geometry.coordinates,r="area"in e.properties?Math.sqrt(e.properties.area)/5e5:.1;return uht(t,r)}function vbt(e){if(!("renderedLabel"in e)){const t="label"in e?(e.label.substr(0,1).toUpperCase()+e.label.substr(1)).replaceAll(`
1083
1083
  `,"<br/>"):"";e.renderedLabel=t.replaceAll(/`\$([^\$]*)\$`/g,r=>ybt(r.slice(2,-2)))}return e.renderedLabel}let Qbt=class{constructor(t){this._flatmap=t,this._map=t.map,this._activeFeatures=[],this._selectedFeatureIds=new Map,this._currentPopup=null,this._infoControl=null,this._tooltip=null,this._inQuery=!1,this._modal=!1,this.__colourOptions={colour:!0,outline:!0},this.__activeMarker=null,this.__lastMarkerId=9e5,this.__markerIdByMarker=new Map,this.__markerIdByFeatureId=new Map,this.__annotationByMarkerId=new Map,this.__markerPositions=new Map,t.setInitialPosition(),this._layerManager=new Bht(t),this.__featureEnabledCount=new Map(Array.from(this._flatmap.annotations.keys()).map(i=>[+i,0]));const r=t.options.style!=="functional";this.__pathManager=new hht(t,this,r);const n=this.__pathManager.pathTypes();for(const i of n)this.__pathManager.enablePathsByType(i.type,i.enabled,!0);this.__pathManager.haveCentrelines&&this.enableCentrelines(this.__pathManager.enabledCentrelines,!0),this.__systemsManager=new Rht(this._flatmap,this,r),this.__enabledConnectivityTaxons=new Set(this._flatmap.taxonIdentifiers),t.options.standalone&&(this._map.addControl(new Kht(t)),this._infoControl=new Dht(t),this._map.addControl(this._infoControl),this._map.addControl(new Wht(t)),this._map.addControl(new Zht(t,n)),this._map.addControl(new Uht(t,this._layerManager)),this.__pathManager.haveCentrelines&&this._map.addControl(new qht(t,this._layerManager,{showCentrelines:!1})),t.options.style==="functional"?(this._map.addControl(new Xht(t,this.__systemsManager.systems)),this._map.addControl(new Ght(t,t.options.layerOptions))):this._map.addControl(new Jht(t))),this._map.on("click",this.clickEvent_.bind(this)),this._map.on("mousemove",this.mouseMoveEvent_.bind(this)),this._lastFeatureMouseEntered=null,this._lastFeatureModelsMouse=null,this.__lastClickLngLat=null,this._map.on("move",this.panZoomEvent_.bind(this,"pan")),this._map.on("zoom",this.panZoomEvent_.bind(this,"zoom")),this.__pan_zoom_enabled=!1}get pathManager(){return this.__pathManager}getState(){return{center:this._map.getCenter().toArray(),zoom:this._map.getZoom(),layers:this.layers}}setState(t){const r={};"center"in t&&(r.center=t.center),"zoom"in t&&(r.zoom=t.zoom,"center"in t?r.around=t.center:r.around=[0,0]),Object.keys(r).length>0&&this._map.jumpTo(r)}setPaint(t){this.__colourOptions=t,this._layerManager.setPaint(t)}getLayers(){return this._layerManager.layers}enableLayer(t,r=!0){this._layerManager.activate(t,r)}getSystems(){return this.__systemsManager.systems}enableSystem(t,r=!0){this.__systemsManager.enable(t,r)}mapFeature(t){const r=this._flatmap.annotation(t);if(r!==void 0)return{id:t,source:uG,sourceLayer:(this._flatmap.options.separateLayers?`${r.layer}_${r["tile-layer"]}`:r["tile-layer"]).replaceAll("/","_"),children:r.children||[]}}enableMapFeature(t,r=!0){if(t!==void 0){const n=this._map.getFeatureState(t);"hidden"in n?r?this._map.removeFeatureState(t,"hidden"):n.hidden||this._map.setFeatureState(t,{hidden:!0}):r||this._map.setFeatureState(t,{hidden:!0}),this.__enableFeatureMarker(t.id,r)}}enableFeature(t,r=!0,n=!1){const i=this.__featureEnabledCount.get(+t);(n||r&&i===0||!r&&i==1)&&this.enableMapFeature(this.mapFeature(t),r),n?this.__featureEnabledCount.set(+t,r?1:0):this.__featureEnabledCount.set(+t,i+(r?1:-1))}enableFeatureWithChildren(t,r=!0,n=!1){const i=this.mapFeature(t);if(i!==void 0){this.enableFeature(t,r,n);for(const o of i.children)this.enableFeatureWithChildren(o,r,n)}}__enableFeatureMarker(t,r=!0){const n=this.__markerIdByFeatureId.get(+t);if(n!==void 0){const i=document.getElementById(`marker-${n}`);i&&(i.style.visibility=r?"visible":"hidden")}}__featureEnabled(t){if(t.id){const r=this._map.getFeatureState(t);return r!==void 0&&(!("hidden"in r)||!r.hidden)}return!1}featureSelected_(t){return this._selectedFeatureIds.has(+t)}selectFeature(t,r=!0){const n=this._flatmap.annotation(t);if("sckan"in n){const s=this._layerManager.sckanState;if(s==="none"||s==="valid"&&!n.sckan||s==="invalid"&&n.sckan)return!1}t=+t;let i=!1;const o=this._selectedFeatureIds.size===0;if(this._selectedFeatureIds.has(t))this._selectedFeatureIds.set(t,this._selectedFeatureIds.get(t)+1),i=!0;else{const s=this.mapFeature(t);if(s!==void 0){const l=this._map.getFeatureState(s);l!==void 0&&(!("hidden"in l)||!l.hidden)&&(this._map.setFeatureState(s,{selected:!0}),this._selectedFeatureIds.set(t,1),i=!0)}}return i&&o&&this._layerManager.setPaint({...this.__colourOptions,dimmed:r}),i}unselectFeature(t){if(t=+t,this._selectedFeatureIds.has(t)){const r=this._selectedFeatureIds.get(t);if(r>1)this._selectedFeatureIds.set(t,r-1);else{const n=this.mapFeature(t);n!==void 0&&(this._map.removeFeatureState(n,"selected"),this._selectedFeatureIds.delete(+t))}}this._selectedFeatureIds.size===0&&this._layerManager.setPaint({...this.__colourOptions,dimmed:!1})}unselectFeatures(){for(const t of this._selectedFeatureIds.keys()){const r=this.mapFeature(t);r!==void 0&&this._map.removeFeatureState(r,"selected")}this._selectedFeatureIds.clear(),this._layerManager.setPaint({...this.__colourOptions,dimmed:!1})}__activateFeature(t){t!==void 0&&(this._map.setFeatureState(t,{active:!0}),this._activeFeatures.push(t))}resetActiveFeatures_(){for(;this._activeFeatures.length>0;)this._map.removeFeatureState(this._activeFeatures.pop(),"active")}smallestAnnotatedPolygonFeature_(t){let r=0,n=null;for(const i of t)if(i.geometry.type.includes("Polygon")&&this._map.getFeatureState(i)["map-annotation"]){const o=z6t(i.geometry.type,i.geometry.coordinates),s=X6t(o);(n===null||r>s)&&(n=i,r=s)}return n}setModal_(t){this._modal=!0}__clearModal(t){this._modal=!1}reset(){this.__clearModal(),this.__clearActiveMarker(),this.unselectFeatures(),this.__enablePathFeatures(this.__pathManager.allFeatureIds(),!0)}clearSearchResults(t=!0){this.unselectFeatures()}selectFeatures(t){if(t.length){this.unselectFeatures();for(const r of t){const n=this._flatmap.annotation(r);if(n&&this.selectFeature(r)&&"type"in n&&n.type.startsWith("line"))for(const i of this.__pathManager.lineFeatureIds([r]))this.selectFeature(i)}}}showSearchResults(t){this.unselectFeatures(),this.zoomToFeatures(t,{noZoomIn:!0})}zoomToFeatures(t,r=null){if(r=_g(r,{noZoomIn:!1,padding:10}),t.length){this.unselectFeatures();let n=null;if(r.noZoomIn){const o=this._map.getBounds().toArray();n=[...o[0],...o[1]]}const i=this._map.unproject({x:r.padding,y:r.padding});i.lng-=n[0],i.lat=n[3]-i.lat;for(const o of t){const s=this._flatmap.annotation(o);if(s&&this.selectFeature(o)&&(n=V5e(n,s.bounds,i),"type"in s&&s.type.startsWith("line"))){for(const l of this.__pathManager.lineFeatureIds([o]))if(this.selectFeature(l)){const c=this._flatmap.annotation(l);n=V5e(n,c.bounds,i)}}}n!==null&&this._map.fitBounds(n,{padding:0,animate:!1})}}showPopup(t,r,n={}){const i=this._flatmap.annotation(t);if(i){this._currentPopup&&(n&&n.preserveSelection&&(this._currentPopup.options.preserveSelection=n.preserveSelection),this._currentPopup.remove()),n&&n.preserveSelection?delete n.preserveSelection:this.unselectFeatures(),this.selectFeature(t);let o=null;"positionAtLastClick"in n&&n.positionAtLastClick&&this.__lastClickLngLat!==null?o=this.__lastClickLngLat:o=this.__markerPosition(t,i),this._map.getBounds().contains(o)||this._map.panTo(o),this.setModal_(),this._currentPopup=new $c.Popup(n).addTo(this._map),this._currentPopup.on("close",this.__onCloseCurrentPopup.bind(this)),this._currentPopup.setLngLat(o),typeof r=="object"?this._currentPopup.setDOMContent(r):this._currentPopup.setText(r)}}__onCloseCurrentPopup(){this._currentPopup&&(this.__clearModal(),this._currentPopup.options&&this._currentPopup.options.preserveSelection||this.unselectFeatures(),this._currentPopup=null)}removeTooltip_(){this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}lineTooltip_(t){const r=[];for(const n of t){const i=n.properties;if("error"in i&&r.push(`<div class="feature-error">Error: ${i.error}</div>`),"warning"in i&&r.push(`<div class="feature-error">Warning: ${i.warning}</div>`),"label"in i&&(!("tooltip"in i)||i.tooltip)){const o=i.label,s=(o.substr(0,1).toUpperCase()+o.substr(1)).replaceAll(`
1084
1084
  `,"<br/>");r.includes(s)||r.push(s)}}return r.length===0?"":`<div class='flatmap-feature-label'>${r.join("<hr/>")}</div>`}tooltipHtml_(t,r=!1){const n=[];if("error"in t&&n.push(`<div class="feature-error">Error: ${t.error}</div>`),"warning"in t&&n.push(`<div class="feature-error">Warning: ${t.warning}</div>`),("label"in t||"hyperlink"in t)&&(r||!("tooltip"in t)||t.tooltip)){const i=vbt(t);"hyperlink"in t?i===""?n.push(`<a href='${t.hyperlink}'>${t.hyperlink}</a>`):n.push(`<a href='${t.hyperlink}'>${i}</a></div>`):n.push(i)}return n.length===0?"":`<div class='flatmap-feature-label'>${n.join("<hr/>")}</div>`}__featureEvent(t,r){return r.sourceLayer===a0?this._flatmap.featureEvent(t,this.__pathManager.pathProperties(r)):"properties"in r?this._flatmap.featureEvent(t,r.properties):!1}__resetFeatureDisplay(){this.removeTooltip_(),this._map.getCanvas().style.cursor="default",this.resetActiveFeatures_()}mouseMoveEvent_(t){if(this._modal)return;this.__resetFeatureDisplay();const r=this._infoControl&&this._infoControl.active;r&&this._infoControl.reset();const n=this._map.queryRenderedFeatures(t.point).filter(d=>this.__featureEnabled(d));if(n.length===0){this._lastFeatureMouseEntered=null,this._lastFeatureModelsMouse=null;return}const i=n[0],o="properties"in i&&"models"in i.properties?i.properties.models:null;this._lastFeatureMouseEntered!==i.id&&(this._lastFeatureModelsMouse===null||this._lastFeatureModelsMouse!==o)&&(this.__featureEvent("mouseenter",i)?(this._lastFeatureMouseEntered=i.id,this._lastFeatureModelsMouse=o):(this._lastFeatureMouseEntered=null,this._lastFeatureModelsMouse=null));let s="",l="";r&&("tooltip"in n[0].properties||this.__activateFeature(n[0]),s=this._infoControl.featureInformation(n,t.lngLat));const c=n.filter(d=>"centreline"in d.properties||"type"in d.properties&&d.properties.type.startsWith("line"));let u=null;if(c.length>0){l=this.lineTooltip_(c),u=c[0];for(const d of c){const p=+d.properties.featureId;this.__activateFeature(d);const h=new Set(c.map(f=>f.properties.featureId));for(const f of this.__pathManager.lineFeatureIds(h))+f!==p&&this.__activateFeature(this.mapFeature(f))}}else{let d=n.filter(p=>("hyperlink"in p.properties||"label"in p.properties)&&(!("tooltip"in p.properties)||p.properties.tooltip)).sort((p,h)=>p.properties.area-h.properties.area);if(d.length>0){const p=this._map.getZoom(),h=d.filter(m=>m.properties.group&&p<m.properties.scale+1);h.length>0&&(d=h);const f=d[0];if(l=this.tooltipHtml_(f.properties),u=f,this._flatmap.options.debug){const m=["featureId","nerveId","tile-layer","type",...dG],g=[],T=[];for(const y of d)if(!T.includes(y.id)){T.push(y.id);for(const v of m)v in y.properties&&(g.push(`<span class="info-name">${v}:</span>`),g.push(`<span class="info-value">${y.properties[v]}</span>`))}this._flatmap.options.debug||(s=`<div id="info-control-info">${g.join(`
1085
- `)}</div>`)}this.__activateFeature(f),this.__activateRelatedFeatures(f),"hyperlink"in f.properties&&(this._map.getCanvas().style.cursor="pointer")}}s!==""&&this._infoControl.show(s),this.__showToolTip(l,t.lngLat,u)}__showToolTip(t,r,n=null){if(t!==""||this._flatmap.options.showId&&n!==null){let i="";if(this._flatmap.options.showPosition){const o=Zde(r.toArray()),s=eht(o).geometry.coordinates;i=n===null?JSON.stringify(s):`${JSON.stringify(s)} (${n.id})`}this._flatmap.options.showId&&n!==null&&"id"in n.properties&&(i=`${i} ${n.properties.id}`),i!==""&&(t=`<span>${i}</span><br/>${t}`),t!==""&&(this._tooltip=new $c.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-tooltip-popup"}),this._tooltip.setLngLat(r).setHTML(t).addTo(this._map))}}selectionEvent_(t,r){if(r!==void 0){const n=r.id,i=!("properties"in r&&"kind"in r.properties&&["cell-type","scaffold","tissue"].includes(r.properties.kind));if(t.ctrlKey||t.metaKey){const o=this.featureSelected_(n);for(const s of this._activeFeatures)o?this.unselectFeature(s.id):this.selectFeature(s.id,i)}else{let o=!0;for(const s of this._selectedFeatureIds.keys())if(s===n){o=!1;break}if(this.unselectFeatures(),o)for(const s of this._activeFeatures)this.selectFeature(s.id,i)}}}clickEvent_(t){if(this._modal)return;this.__clearActiveMarker();const r=this._map.queryRenderedFeatures(t.point).filter(i=>this.__featureEnabled(i));if(r.length==0){this.unselectFeatures();return}const n=r[0];this.selectionEvent_(t.originalEvent,n),this._modal?(this.__resetFeatureDisplay(),this.unselectFeatures(),this.__clearModal()):n!==void 0&&(this.__lastClickLngLat=t.lngLat,this.__featureEvent("click",n),"properties"in n&&"hyperlink"in n.properties&&window.open(n.properties.hyperlink,"_blank"))}__activateRelatedFeatures(t){if("nerveId"in t.properties){const r=t.properties.nerveId;r!==t.id&&this.__activateFeature(this.mapFeature(r));for(const n of this.__pathManager.nerveFeatureIds(r))this.__activateFeature(this.mapFeature(n))}if("nodeId"in t.properties)for(const r of this.__pathManager.pathFeatureIds(t.properties.nodeId))this.__activateFeature(this.mapFeature(r))}enablePath(t,r=!0){this.__pathManager.enablePath(t,r)}enablePathsBySystem(t,r=!0,n=!1){this.__pathManager.enablePathsBySystem(t,r,n)}enablePathsByType(t,r=!0){this.__pathManager.enablePathsByType(t,r)}pathFeatureIds(t){const r=new a4e;return r.extend(this.__pathManager.connectivityModelFeatureIds(t)),r.extend(this.__pathManager.pathModelFeatureIds(t)),r}pathModelNodes(t){return this.__pathManager.pathModelNodes(t)}nodePathModels(t){return this.__pathManager.nodePathModels(t)}enableCentrelines(t=!0,r=!1){this.__pathManager.enablePathsByType("centreline",t,r),this._layerManager.setPaint({showCentrelines:t})}enableSckanPaths(t,r=!0){this._layerManager.enableSckanPaths(t,r)}enableConnectivityByTaxonIds(t,r=!0){if(r)for(const n of t)this.__enabledConnectivityTaxons.add(n);else for(const n of t)this.__enabledConnectivityTaxons.delete(n);this._layerManager.setFilter({taxons:[...this.__enabledConnectivityTaxons.values()]})}excludeAnnotated(t=!1){this._layerManager.setPaint({excludeAnnotated:t})}__markerPosition(t,r){if(this.__markerPositions.has(t))return this.__markerPositions.get(t);let n=r.markerPosition||r.centroid;if(n===null||n==null){const i=this._map.querySourceFeatures(uG,{sourceLayer:this._flatmap.options.separateLayers?`${r.layer}_${r["tile-layer"]}`:r["tile-layer"],filter:["all",["==",["id"],parseInt(t)],["==",["geometry-type"],"Polygon"]]});i.length>0&&(n=Tbt(i[0]))}return this.__markerPositions.set(t,n),n}addMarker(t,r={}){const n=this._flatmap.modelFeatureIds(t);let i=-1;for(const o of n){const s=this._flatmap.annotation(o);if(!(!("markerPosition"in s)&&!s.geometry.includes("Polygon"))&&!("marker"in s)){i===-1&&(this.__lastMarkerId+=1,i=this.__lastMarkerId);const l=r.colour||"#005974",c=r.element?new $c.Marker({element:r.element}):new $c.Marker({color:l,scale:.5}),u=document.createElement("div"),d=document.createElement("div");d.innerHTML=c.getElement().innerHTML,u.id=`marker-${i}`,u.appendChild(d);const p={element:u};"className"in r&&(p.className=r.className);const h=this.__markerPosition(o,s),f=new $c.Marker(p).setLngLat(h).addTo(this._map);u.addEventListener("mouseenter",this.markerMouseEvent_.bind(this,f,t)),u.addEventListener("mousemove",this.markerMouseEvent_.bind(this,f,t)),u.addEventListener("mouseleave",this.markerMouseEvent_.bind(this,f,t)),u.addEventListener("click",this.markerMouseEvent_.bind(this,f,t)),this.__markerIdByMarker.set(f,i),this.__markerIdByFeatureId.set(+o,i),this.__annotationByMarkerId.set(i,s),this.__featureEnabled(this.mapFeature(+o))||(u.style.visibility="hidden")}}return i===-1&&console.warn(`Unable to find feature '${t}' on which to place marker`),i}clearMarkers(){for(const t of this.__markerIdByMarker.keys())t.remove();this.__markerIdByMarker.clear(),this.__annotationByMarkerId.clear()}removeMarker(t){for(const[r,n]of this.__markerIdByMarker.entries())if(t===n){r.remove(),this.__markerIdByMarker.remove(r),this.__annotationByMarkerId.remove(n);break}}visibleMarkerAnatomicalIds(){const t=[],r=this._map.getBounds();for(const[n,i]of this.__markerIdByMarker.entries())if(r.contains(n.getLngLat())){const o=this.__annotationByMarkerId.get(i);t.includes(o.models)||t.push(o.models)}return t}markerMouseEvent_(t,r,n){if(!(this._modal||this.__activeMarker!==null&&n.type==="mouseleave")){if(["mouseenter","mouseleave","click"].includes(n.type)&&(this.__activeMarker=t,this.removeTooltip_(),t.setPopup(null),t.getElement().style.cursor="default",["mouseenter","click"].includes(n.type))){const i=this.__markerIdByMarker.get(t),o=this.__annotationByMarkerId.get(i),s=this.mapFeature(o.featureId);s!==void 0&&(n.type==="mouseenter"?(this.resetActiveFeatures_(),this.__activateFeature(s)):this.selectionEvent_(n,s));const l=this.tooltipHtml_(o,!0);this.__showToolTip(l,t.getLngLat()),this._flatmap.markerEvent(n.type,i,r)}n.stopPropagation()}}__clearActiveMarker(){this.__activeMarker!==null&&(this.__activeMarker.setPopup(null),this.__activeMarker=null)}showMarkerPopup(t,r,n){const i=this.__activeMarker;if(t!==this.__markerIdByMarker.get(i))return this.__clearActiveMarker(),!1;const o=i.getLngLat();this._map.getBounds().contains(o)||this._map.panTo(o);const s=document.createElement("div");return typeof r=="object"?s.appendChild(r):s.innerHTML=r,s.addEventListener("click",l=>this.__clearActiveMarker()),this._tooltip=new $c.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-marker-popup"}),this._tooltip.setLngLat(o).setDOMContent(s),i.setPopup(this._tooltip),i.togglePopup(),!0}enablePanZoomEvents(t=!0){this.__pan_zoom_enabled=t}panZoomEvent_(t){this.__pan_zoom_enabled&&this._flatmap.panZoomEvent(t)}};const I5e={fillColor:"#DDD",fillOpacity:.3,lineColor:"#08F",lineOpacity:1,lineWidth:1,position:"bottom-left",width:320},bbt=[[18,14,16],[16,12,14],[14,10,12],[12,8,10],[10,6,8]];let xbt=class{constructor(t,r){this._flatmap=t,this._map=void 0,this._container=null,this._background=null,this._opacity=null,this._loaded=!1,this._options=Object.assign({},I5e),typeof r=="object"&&("position"in r&&(this._options.position=r.position),"width"in r&&(this._options.width=r.width)),this._ticking=!1,this._lastMouseMoveEvent=null,this._isDragging=!1,this._isCursorOverFeature=!1,this._previousPoint=[0,0],this._currentPoint=[0,0],this._trackingRectCoordinates=[[[],[],[],[],[]]]}getDefaultPosition(){return this._options.position}onAdd(t){this._map=t;const r=document.createElement("div");r.className="maplibregl-ctrl-minimap maplibregl-ctrl",r.id="maplibre-minimap",this._container=r;const n=t.getCanvas();let i=I5e.width;return typeof this._options.width=="string"?(i=parseInt(this._options.width),this._options.width.includes("%")&&(i=i*n.width/100)):typeof this._options.width=="number"&&(i=this._options.width),r.setAttribute("style",`width: ${i}px; height: ${i*n.height/n.width}px;`),r.addEventListener("contextmenu",this._preventDefault),this._miniMap=new $c.Map({attributionControl:!1,container:r,style:t.getStyle(),bounds:t.getBounds()}),this._miniMap.on("load",this.load_.bind(this)),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0,this._container=null}load_(){const t=this._options,r=this._map,n=this._miniMap;["dragPan","scrollZoom","boxZoom","dragRotate","keyboard","doubleClickZoom","touchZoomRotate"].forEach(o=>n[o].disable()),this._background!==null&&n.setPaintProperty("background","background-color",this._background),this._opacity!==null&&n.setPaintProperty("background","background-opacity",this._opacity),n.resize(),n.fitBounds(this._flatmap.bounds);const i=n.getBounds();this.convertBoundsToPoints_(i),n.addSource("trackingRect",{type:"geojson",data:{type:"Feature",properties:{name:"trackingRect"},geometry:{type:"Polygon",coordinates:this._trackingRectCoordinates}}}),n.addLayer({id:"trackingRectOutline",type:"line",source:"trackingRect",layout:{},paint:{"line-color":t.lineColor,"line-width":t.lineWidth,"line-opacity":t.lineOpacity}}),n.addLayer({id:"trackingRectFill",type:"fill",source:"trackingRect",layout:{},paint:{"fill-color":t.fillColor,"fill-opacity":t.fillOpacity}}),this._trackingRect=this._miniMap.getSource("trackingRect"),this.update_(),r.on("move",this.update_.bind(this)),n.on("mousemove",this.mouseMove_.bind(this)),n.on("mousedown",this.mouseDown_.bind(this)),n.on("mouseup",this.mouseUp_.bind(this)),n.on("touchmove",this.mouseMove_.bind(this)),n.on("touchstart",this.mouseDown_.bind(this)),n.on("touchend",this.mouseUp_.bind(this)),this._miniMapCanvas=n.getCanvasContainer(),this._miniMapCanvas.addEventListener("wheel",this.preventDefault_),this._miniMapCanvas.addEventListener("mousewheel",this.preventDefault_)}mouseDown_(t){this._isCursorOverFeature&&(this._isDragging=!0,this._previousPoint=this._currentPoint,this._currentPoint=[t.lngLat.lng,t.lngLat.lat])}mouseMove_(t){this._ticking=!1;const r=this._miniMap.queryRenderedFeatures(t.point,{layers:["trackingRectFill"]});if(this._isCursorOverFeature&&r.length>0||(this._isCursorOverFeature=r.length>0,this._miniMapCanvas.style.cursor=this._isCursorOverFeature?"move":""),this._isDragging){this._previousPoint=this._currentPoint,this._currentPoint=[t.lngLat.lng,t.lngLat.lat];const n=[this._previousPoint[0]-this._currentPoint[0],this._previousPoint[1]-this._currentPoint[1]],i=this.moveTrackingRect_(n);this._map.fitBounds(i,{duration:80,noMoveStart:!0})}}mouseUp_(){this._isDragging=!1,this._ticking=!1}moveTrackingRect_(t){const r=this._trackingRect,n=r._data,i=n.properties.bounds;return i._ne.lat-=t[1],i._ne.lng-=t[0],i._sw.lat-=t[1],i._sw.lng-=t[0],this.convertBoundsToPoints_(i),r.setData(n),i}setTrackingRectBounds_(t){const r=this._trackingRect,n=r._data;n.properties.bounds=t,this.convertBoundsToPoints_(t),r.setData(n)}convertBoundsToPoints_(t){const r=t._ne,n=t._sw,i=this._trackingRectCoordinates;i[0][0][0]=r.lng,i[0][0][1]=r.lat,i[0][1][0]=n.lng,i[0][1][1]=r.lat,i[0][2][0]=n.lng,i[0][2][1]=n.lat,i[0][3][0]=r.lng,i[0][3][1]=n.lat,i[0][4][0]=r.lng,i[0][4][1]=r.lat}update_(t){if(this._isDragging)return;const r=this._map.getBounds();this.setTrackingRectBounds_(r),this.zoomAdjust_()}zoomAdjust_(){const t=this._miniMap,r=this._map,n=parseInt(t.getZoom(),10),i=parseInt(r.getZoom(),10);let o=!1;bbt.forEach(function(s){!o&&i>=s[0]&&(n>=s[1]&&t.setZoom(s[2]),t.setCenter(r.getCenter()),o=!0)})}preventDefault_(t){t.preventDefault()}setBackgroundColour(t){this._loaded?this._miniMap.setPaintProperty("background","background-color",t):this._background=t}setBackgroundOpacity(t){this._loaded?this._miniMap.setPaintProperty("background","background-opacity",t):this._opacity=t}show(t){this._container&&(t?(this._container.style.display="block",this.update_()):this._container.style.display="none")}};const _bt=[{id:"label-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAmCAIAAADbSlUzAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAACVSURBVFhH7dixDoJAEIThfXqMBcYKrTQ+jkYSStDYkVhZINxyEshJcZXJtC7FfNlmur9eyXb7Vqf6+bI9HUKyWkt5e4RlOF9ycerjsqbqpfefuKzNJawBWIOxBmMNxhqMNRhrMNZgrMFYg7EGYw3GGow1GGuw5dU07y4ua22nUlb3uKxd80IOx1Pjxp+f4P/P+ZButl+YrbXnPs+YmAAAAABJRU5ErkJggg==",options:{content:[21,4,28,33],stretchX:[[21,28]],stretchY:[[4,33]]}},{id:"xlabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJExO2pF7NAAAAqUlEQVQ4y+3OIQ6CYBiH8ef9MDhxc8yABjeP4LwAx3BWTwE3oHkMrBa7JJN3YBogfQkjr0HcDCg0C0/+7f2/AjghycLFj0ECYMarHPRcUoQx25uEJMsR/lUQj4YUtQ+K9aC+1IgABPFc/NjUcy1JYD5++tXM0LEe9rCHPfwXzDu43ChV2qaUKjWWLFLUfkdqLVnkXDiWK4LDkMlckCkwfs8p1cmSbfbs7k+jIi/gASaPYQAAAABJRU5ErkJggg==",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"ylabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJEyeXEKp4AAAAwklEQVQ4y+3ULU/DUBhA4XO/2rUgwV1ZBWLJBP9fI0gQuMktWcJSwUq79n68qAoSGnCYHv3oowBD09jz88t1CpGcBQCtFYWz3D3tNuz3EXgojqdWLt0gKWWZSynLpRvkeGqFpinVuf2QsnDc3mz4qe7zyjgF9BQidVWyVF2VTCGicxa0VotQa0XOguaPrXCFK1zhv8D5VkvNt9POGvphXIT9MOKsAbyvfl2z95UCCrw3769vfYjp2+ydNdxvH2sOh/QFh8F7PWWiL5EAAAAASUVORK5CYII=",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"rounded-rectangle",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGmSURBVDiNldPBitpAGAfwv5mMmy85JCistD5Ai/gCPYovYJENCPZQF8VD36HXUkrfQws9R8WLF58gh2h2W2PpoeTWxBgzMr1spd3uUvOHOQ2//3yHb4C/UyGi95Zl3XLOUwASgFRVNTVN8ysRfQTwFA+FMdYhoqjf7+9ns5kMgkCGYSjDMJTb7VbO53M5HA4PRBRzzl//g8vlcrxYLE7osbNcLmWlUok459cAULgb+2YymRi1Wu3B6e7H9300Go1dkiTPGRG97Xa7LzqdjnqWBlAqlRBFEVzXNZRisXhl2/bFufh3bNvmAF4WOOd73/cvDMPIVSCEQLVaFUqWZbkxAKiqCsaYVHLLe1E452kcx7mhEALH47Gg6Lr+3fO83AXr9Rq6rofK4XD4NB6P07wFo9Eok1J+LgC41DTt1nEco16vn4VXqxWazeYuSZJnCoAfWZZdt9vtneu6/8We56HVasVCiDcAvp0uGGM2Ef3s9Xp7x3HkZrM57X8QBHI6ncrBYJASUcQYe/XYA5eapr2zLOuGc77H3XfmnKemaX4hog8AnvwJfgHMKs1jQ++4tQAAAABJRU5ErkJggg==",options:{content:[3,3,13,13],stretchX:[[7,9]],stretchY:[[7,9]]}}],wbt=1.4,P5e="NCBITaxon:2787823";let Lbt=class{constructor(t,r,n,i){this._baseUrl=r,this.__id=n.id,this.__uuid=n.uuid,this.__details=n.details,this.__provenance=n.provenance,this.__created=n.created,this.__taxon=n.taxon,this.__biologicalSex=n.biologicalSex,this._mapNumber=n.number,this._callback=n.callback,this._layers=n.layers,this._markers=n.markers,this._options=n.options,this._pathways=n.pathways,this._resolve=i,this._map=null,this.__searchIndex=new F6t(this),this.__idToAnnotation=new Map,this.__datasetToFeatureIds=new Map,this.__modelToFeatureIds=new Map,this.__mapSourceToFeatureIds=new Map,this.__annIdToFeatureId=new Map,this.__taxonToFeatureIds=new Map;for(const[s,l]of Object.entries(n.annotations))this.__addAnnotation(s,l),this.__searchIndex.indexMetadata(s,l);for(const[s,l]of Object.entries(n.style.sources))if(l.url&&(l.url=this.makeServerUrl(l.url)),l.tiles){const c=[];for(const u of l.tiles)c.push(this.makeServerUrl(u));l.tiles=c}"images"in n.options||(n.options.images=[]);for(const s of _bt){let l=!1;for(const c of n.options.images)if(s.id===c.id){l=!0;break}l||n.options.images.push(s)}const o={style:n.style,container:t,attributionControl:!1};if("maxZoom"in n.options&&(o.maxZoom=n.options.maxZoom),"minZoom"in n.options&&(o.minZoom=n.options.minZoom),o.hash=n.options.debug===!0,this._map=new $c.Map(o),n.options.debug===!0&&(this._map.showTileBoundaries=!0),this._map.setRenderWorldCopies(!1),n.options.fullscreenControl===!0&&this._map.addControl(new $c.FullscreenControl,"top-right"),this._map.dragRotate.disable(),this._map.touchZoomRotate.disableRotation(),n.options.navigationControl){const s=n.options.navigationControl,l=typeof s=="string"&&["top-left","top-right","bottom-right","bottom-left"].includes(s)?s:"bottom-right";this._map.addControl(new jht(this),l)}this._userInteractions=null,this._initialState=null,this._minimap=null,this._map.on("idle",()=>{if(this._userInteractions===null)this.setupUserInteractions_();else if(this._initialState===null){this._map.setMinZoom(3),this._map.setMaxBounds(null),this._map.setRenderWorldCopies(!0),this._bounds=this._map.getBounds();const s=this._bounds.toArray(),l=$c.MercatorCoordinate.fromLngLat(s[0]),c=$c.MercatorCoordinate.fromLngLat(s[1]);this.__normalised_origin=[l.x,c.y],this.__normalised_size=[c.x-l.x,l.y-c.y],"state"in this._options&&this._userInteractions.setState(this._options.state),this._initialState=this.getState(),this.options.minimap&&(this._minimap=new xbt(this,this.options.minimap),this._map.addControl(this._minimap)),this._resolve(this)}})}async setupUserInteractions_(){for(const t of this._options.images)await this.addImage(t.id,t.url,"",t.options);this._userInteractions=new Qbt(this)}get bounds(){return this._bounds}resetMap(){this._initialState!==null&&this.setState(this._initialState),this._userInteractions!==null&&this._userInteractions.reset()}zoomIn(){this._map.zoomIn()}zoomOut(){this._map.zoomOut()}pathTypes(){if(this._userInteractions!==null)return this._userInteractions.pathManager.pathTypes()}enablePath(t,r=!0){this._userInteractions!==null&&this._userInteractions.enablePathsByType(t,r)}enableSckanPath(t,r=!0){this._userInteractions!==null&&this._userInteractions.enableSckanPaths(t,r)}enableConnectivityByTaxonIds(t,r=!0){this._userInteractions!==null&&(Array.isArray(t)?this._userInteractions.enableConnectivityByTaxonIds(t,r):this._userInteractions.enableConnectivityByTaxonIds([t],r))}enableCentrelines(t=!0){this._userInteractions!==null&&this._userInteractions.enableCentrelines(t)}loadImage_(t){return new Promise((r,n)=>{this._map.loadImage(t,(i,o)=>{i?n(i):r(o)})})}loadEncodedImage_(t){return new Promise((r,n)=>{const i=new Image;i.src=t,i.onload=o=>r(o.target)})}async addImage(t,r,n,i={}){if(!this._map.hasImage(t)){const o=await(r.startsWith("data:image")?this.loadEncodedImage_(r):this.loadImage_(r.startsWith("/")?this.makeServerUrl(r):new URL(r,n)));this._map.addImage(t,o,i)}}makeServerUrl(t,r="flatmap/"){return t.startsWith("http://")||t.startsWith("https://")?t:t.startsWith("/")?`${this._baseUrl}${r}${this.__uuid}${t}`:`${this._baseUrl}${r}${this.__uuid}/${t}`}get taxon(){return this.__taxon}get biologicalSex(){return this.__biologicalSex}get created(){return this.__created}get id(){return this.__id}get uuid(){return this.__uuid}get details(){return this.__details}get provenance(){return this.__provenance}get uniqueId(){return`${this.__uuid}-${this._mapNumber}`}get annotations(){return this.__idToAnnotation}annotation(t){return this.__idToAnnotation.get(t.toString())}setFeatureAnnotated(t){this._userInteractions!==null&&this._userInteractions.setFeatureAnnotated(t)}__updateFeatureIdMapEntry(t,r,n){const i=lG(t),o=r.get(i);o?o.push(n):r.set(i,[n])}__updateFeatureIdMap(t,r,n,i=null){if(t in n&&n[t].length){const o=n[t];if(Array.isArray(o))for(const s of o)this.__updateFeatureIdMapEntry(s,r,n.featureId);else this.__updateFeatureIdMapEntry(o,r,n.featureId)}else i!==null&&"models"in n&&n.models.startsWith(pht)&&this.__updateFeatureIdMapEntry(i,r,n.featureId)}__addAnnotation(t,r){r.featureId=t,this.__idToAnnotation.set(t,r),this.__updateFeatureIdMap("dataset",this.__datasetToFeatureIds,r),this.__updateFeatureIdMap("models",this.__modelToFeatureIds,r),this.__updateFeatureIdMap("source",this.__mapSourceToFeatureIds,r),this.__updateFeatureIdMap("taxons",this.__taxonToFeatureIds,r,P5e),this.__annIdToFeatureId.set(r.id,t)}modelFeatureIds(t){return this.__modelToFeatureIds.get(lG(t))||[]}modelFeatureIdList(t){const r=new a4e;if(Array.isArray(t))for(const n of t)r.extend(this.modelFeatureIds(n));else r.extend(this.modelFeatureIds(t));return r.length==0&&(r.extend(this.__datasetToFeatureIds.get(t)),r.extend(this.__mapSourceToFeatureIds.get(t))),r.length==0&&this._userInteractions!==null&&r.extend(this._userInteractions.pathFeatureIds(t)),r}modelForFeature(t){const r=this.__idToAnnotation.get(t);return r&&"models"in r?lG(r.models):null}nodePathModels(t){if(this._userInteractions!==null)return this._userInteractions.nodePathModels(t)}pathModelNodes(t){if(this._userInteractions!==null)return this._userInteractions.pathModelNodes(t)}get layers(){return this._layers}get map(){return this._map}get markers(){return this._markers}get anatomicalIdentifiers(){return[...this.__modelToFeatureIds.keys()]}get taxonIdentifiers(){return[...this.__taxonToFeatureIds.keys()]}get datasets(){return[...this.__datasetToFeatureIds.keys()]}get options(){return this._options}get pathways(){return this._pathways}getZoom(){return{mapUUID:this.__uuid,minZoom:this._map.getMinZoom(),zoom:this._map.getZoom(),maxZoom:this._map.getMaxZoom()}}callback(t,r,...n){if(this._callback)return r.mapUUID=this.__uuid,this._callback(t,r,...n)}setInitialPosition(){"bounds"in this._options&&this._map.fitBounds(this._options.bounds,{animate:!1}),"center"in this._options&&this._map.setCenter(this._options.center),"zoom"in this._options&&this._map.setZoom(this._options.zoom)}close(){this._map&&(this._map.remove(),this._map=null)}resize(){this._map.resize()}getIdentifier(){return{taxon:this.__taxon,biologicalSex:this.__biologicalSex,uuid:this.__uuid}}getState(){return this._userInteractions!==null?this._userInteractions.getState():{}}setState(t){this._userInteractions!==null&&this._userInteractions.setState(t)}showPopup(t,r,n){this._userInteractions!==null&&this._userInteractions.showPopup(t,r,n)}setPaint(t=null){t=_g(t,{colour:!0,outline:!0}),this._userInteractions!==null&&this._userInteractions.setPaint(t)}setColour(t=null){console.log("`setColour()` is deprecated; please use `setPaint()` instead."),this.setPaint(t)}getBackgroundColour(){return this._map.getPaintProperty("background","background-color")}getBackgroundOpacity(){return this._map.getPaintProperty("background","background-opacity")}setBackgroundColour(t){localStorage.setItem("flatmap-background-colour",t),this._map.setPaintProperty("background","background-color",t),this._minimap&&this._minimap.setBackgroundColour(t)}setBackgroundOpacity(t){this._map.setPaintProperty("background","background-opacity",t),this._minimap&&this._minimap.setBackgroundOpacity(t)}showMinimap(t){this._minimap&&this._minimap.show(t)}getLayers(){if(this._userInteractions!==null)return this._userInteractions.getLayers()}enableLayer(t,r=!0){if(this._userInteractions!==null)return this._userInteractions.enableLayer(t,r)}getSystems(){if(this._userInteractions!==null)return this._userInteractions.getSystems()}enableSystem(t,r=!0){if(this._userInteractions!==null)return this._userInteractions.enableSystem(t,r)}addMarker(t,r={}){return this._userInteractions!==null?this._userInteractions.addMarker(t,r):-1}removeMarker(t){this._userInteractions!==null&&this._userInteractions.removeMarker(t)}clearMarkers(){this._userInteractions!==null&&this._userInteractions.clearMarkers()}visibleMarkerAnatomicalIds(){if(this._userInteractions!==null)return this._userInteractions.visibleMarkerAnatomicalIds()}showMarkerPopup(t,r,n={}){return this._userInteractions!==null?this._userInteractions.showMarkerPopup(t,r,n):!1}__exportedProperties(t){const r={},n=["id","featureId","connectivity","dataset","kind","label","models","source","taxons","hyperlinks"],i=["hyperlinks"];for(const o of n)o in t&&t[o]!==void 0&&(i.includes(o)?r[o]=JSON.parse(t[o]):o==="featureId"?r[o]=+t[o]:r[o]=t[o]);return Object.keys(r).length>0&&(r.type="feature"),r}featureEvent(t,r){const n=this.__exportedProperties(r);return Object.keys(n).length>0?(this.callback(t,n),!0):!1}featureProperties(t){const r=this.annotation(t);return r?this.__exportedProperties(r):{}}markerEvent(t,r,n){this.callback(t,{type:"marker",id:r,models:n})}controlEvent(t,r,n){this.callback(t,{type:"control",control:r,value:n})}enablePanZoomEvents(t=!0){this._userInteractions!==null&&this._userInteractions.enablePanZoomEvents(t)}panZoomEvent(t){const r=this._map.getBounds();if(this.__normalised_origin!==void 0){const n=$c.MercatorCoordinate.fromLngLat(r.toArray()[0]),i=$c.MercatorCoordinate.fromLngLat(r.toArray()[1]),o=[(n.x-this.__normalised_origin[0])/this.__normalised_size[0],(i.y-this.__normalised_origin[1])/this.__normalised_size[1]],s=[(i.x-n.x)/this.__normalised_size[0],(n.y-i.y)/this.__normalised_size[1]];this.callback("pan-zoom",{type:t,origin:o,size:s})}}panZoomTo(t,r){if(this.__normalised_origin!==void 0){const n=t[0]*this.__normalised_size[0]+this.__normalised_origin[0],i=t[1]*this.__normalised_size[1]+this.__normalised_origin[1],o=n+r[0]*this.__normalised_size[0],s=i+r[1]*this.__normalised_size[1],l=new $c.MercatorCoordinate(n,s,0).toLngLat(),c=new $c.MercatorCoordinate(o,i,0).toLngLat();this._map.fitBounds([l,c],{animate:!1})}}search(t,r=!1){return r?this.__searchIndex.auto_suggest(t):this.__searchIndex.search(t)}clearSearchResults(){this._userInteractions!==null&&this._userInteractions.clearSearchResults()}showSearchResults(t){this._userInteractions!==null&&this._userInteractions.showSearchResults(t.featureIds)}selectFeatures(t){if(this._userInteractions!==null){const r=this.modelFeatureIdList(t);this._userInteractions.selectFeatures(r)}}zoomToFeatures(t,r=null){if(r=_g(r,{select:!0,highlight:!1,padding:100}),this._userInteractions!==null){const n=this.modelFeatureIdList(t);this._userInteractions.zoomToFeatures(n,r)}}},N5e=class{constructor(t,r={}){this._mapServer=new f6t(t),this._options=r,this._mapList=[],this._mapNumber=0,this._initialisingMutex=new dht,this._initialised=!1}async ensureInitialised_(){return await this._initialisingMutex.dispatch(async()=>{if(!this._initialised){this._mapList=[];const t=await this._mapServer.loadJSON("");for(const r of t)r.separateLayers="version"in r&&r.version>=wbt,this._mapList.push(r);this._initialised=!0}})}allMaps(){return new Promise(async(t,r)=>{await this.ensureInitialised_();const n={};for(const i of this._mapList){const o="uuid"in i?i.uuid:i.id;n[o]=i}t(n)})}findMap_(t){return new Promise(async(r,n)=>{await this.ensureInitialised_(),r(this.lookupMap_(t))})}latestMap_(t){const r=t.constructor.name==="String"?t:"uuid"in t?t.uuid:"taxon"in t?t.taxon:null;if(r===null)return null;let n=null,i="";for(const o of this._mapList)if(("uuid"in o&&r===o.uuid||r===o.id||"taxon"in o&&r===o.taxon||r===o.source)&&(!("biologicalSex"in t)||"biologicalSex"in o&&t.biologicalSex===o.biologicalSex))if("created"in o)i<o.created&&(i=o.created,n=o);else{n=o;break}return n}lookupMap_(t){return typeof t=="object"?this.latestMap_(t):this.latestMap_({uuid:t})}loadMap(t,r,n,i={}){return new Promise(async(o,s)=>{try{const l=await this.findMap_(t);l===null&&s(`Unknown map: ${JSON.stringify(t)}`);const c="uuid"in l?l.uuid:l.id,u=await this._mapServer.loadJSON(`flatmap/${c}/`),d="uuid"in u?u.uuid:u.id;if(c!==d)throw new Error(`Map '${c}' has wrong ID in index`);const p=Object.assign({},this._options,i);!("bounds"in i)&&"bounds"in u&&(p.bounds=u.bounds),"style"in u?p.style=u.style:p.style="flatmap",!("image-layers"in u)&&"image_layer"in u&&(u["image-layers"]=u.image_layer);let h=[];if(!("version"in u)||u.version<=1)for(const v of u.layers)typeof v=="string"?h.push({id:v,description:v.charAt(0).toUpperCase()+v.slice(1),selectable:!0}):h.push(v);else h=await this._mapServer.loadJSON(`flatmap/${c}/layers`);const f=await this._mapServer.loadJSON(`flatmap/${c}/style`);"glyphs"in f||(f.glyphs="https://fonts.openmaptiles.org/{fontstack}/{range}.pbf");const m=await this._mapServer.loadJSON(`flatmap/${c}/pathways`),g=await this._mapServer.loadJSON(`flatmap/${c}/annotations`),T=await this._mapServer.loadJSON(`flatmap/${c}/metadata`),y=await this._mapServer.loadJSON(`flatmap/${c}/markers`);return"vector-tiles"in f.sources&&("minZoom"in p||(p.minZoom=f.sources["vector-tiles"].minzoom),"maxZoom"in p||(p.maxZoom=f.sources["vector-tiles"].maxzoom)),"layerOptions"in p?("colour"in p.layerOptions||(p.layerOptions.colour=!0),"outline"in p.layerOptions||(p.layerOptions.outline=!0)):p.layerOptions={colour:!0,outline:!0},p.layerOptions.authoring="authoring"in u?u.authoring:!1,p.separateLayers=l.separateLayers,this._mapNumber+=1,new Lbt(r,this._mapServer.url(),{id:l,uuid:c,details:u,taxon:l.taxon,biologicalSex:l.biologicalSex,style:f,options:p,layers:h,markers:y,annotations:g,number:this._mapNumber,pathways:m,provenance:T,provenance:T,callback:n},o)}catch(l){s(l)}})}};const B5e=(e,t)=>{const r=[];let n=e.organs?e.organs:e.ftus;const i=n?n.filter((o,s)=>n.findIndex(l=>l.label===o.label)===s):void 0;return i&&i.forEach(o=>{const s={label:o.label,models:o.models,key:`${t}.${o.label}`},l=B5e(o,s.key);l.length>0&&(s.children=l),r.push(s)}),r},Sbt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},kbt={name:"FlatmapVuer",components:{Button:j3,Col:B4,Loading:W4t,Radio:J3e,RadioGroup:Y3e,Row:U3,Select:Qg,MapSvgIcon:Xb,MapSvgSpriteColor:RC,Tooltip:XU,TreeControls:Mde,SelectionsGroup:kde,SvgLegends:Cde,ElIconWarningFilled:wue,ElIconArrowDown:sh,ElIconArrowLeft:xue},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},methods:{viewLatestMap:function(){let e=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(e="PATO:0000384");const t={entry:this.entry,biologicalSex:e,viewport:this.mapImp.getState()};this.$emit("view-latest-map",t)},backgroundChangeCallback:function(e){this.currentBackground=e,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(e){if(this.systems.length=0,e&&e.length>0){const t={label:"All",key:"All",children:[]};e.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=B5e(r,n.key);i.length>0&&(n.children=i),t.children.push(n)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,t.forEach(r=>{Ede(e,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setColour({colour:e,outline:this.outlinesRadio})},setOutlines:function(e){this.outlineRadio=e,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:e})},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(e){this.mapImp&&this.mapImp.enableCentrelines(e.value)},sckanSelected:function(e){this.mapImp&&this.mapImp.enableSckanPath(e.key,e.value)},checkAllSCKAN:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableSckanPath(t,e.value))},highlightConnectedPaths:function(e){if(this.mapImp){let t=[...this.mapImp.pathModelNodes(e)].map(n=>this.mapImp.featureProperties(n)),r=[];t.forEach(n=>{this.mapImp.nodePathModels(n.featureId).forEach(i=>{r.push(i)})}),this.mapImp.zoomToFeatures(r,{noZoomIn:!0})}},systemSelected:function(e){this.mapImp&&this.mapImp.enableSystem(e.key,e.value)},checkAllSystems:function(e){this.mapImp&&this.systems[0].children.forEach(t=>this.mapImp.enableSystem(t.label,e))},ftuSelected:function(e){this.searchAndShowResult(e,!0)},layersSelected:function(e){this.mapImp&&this.mapImp.enableLayer(e.key,e.value)},checkAllLayers:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableLayer(t,e.value))},taxonsSelected:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.key,e.value)},checkAllTaxons:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableConnectivityByTaxonIds(t,e.value))},pathwaysSelected:function(e){this.mapImp&&this.mapImp.enablePath(e.key,e.value)},checkAllPathways:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enablePath(t,e.value))},enablePanZoomEvents:function(e){this.mapImp.enablePanZoomEvents(e)},eventCallback:function(){return(e,t,...r)=>{if(e!=="pan-zoom"){const n=t.label,i=[t.models],o=this.entry,s=this.biologicalSex,l={dataset:t.dataset,biologicalSex:s,taxonomy:o,resource:i,label:n,feature:t,userData:r,eventType:e,provenanceTaxonomy:t.taxons?JSON.parse(t.taxons):void 0};e==="click"?this.viewingMode==="Network Discovery"?this.highlightConnectedPaths([t.models]):this.currentActive=t.models?t.models:"":e==="mouseenter"&&this.viewingMode!=="Network Discovery"&&(this.currentHover=t.models?t.models:""),t&&t.type!=="marker"&&e==="click"&&this.viewingMode!=="Network Discovery"&&this.checkAndCreatePopups(l),this.$emit("resource-selected",l)}else this.$emit("pan-zoom-callback",t)}},checkAndCreatePopups:async function(e){if(this.viewingMode==="Annotation")e.feature&&e.feature.featureId&&e.feature.models?(this.annotationEntry={...e.feature,resourceId:this.serverUUID},this.displayTooltip(e.feature.models)):this.annotation={};else{let t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(e);(t[0]||t[1]||e.feature.hyperlinks&&e.feature.hyperlinks.length>0)&&(this.resourceForTooltip=e.resource[0],e.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(e))}},popUpCssHacks:function(){let e=document.querySelector(".flatmap-tooltip-popup");e&&(e.style.display="none"),document.querySelector(".maplibregl-popup-close-button").style.display="block",this.$refs.tooltip.$el.style.display="flex",document.querySelector(".maplibregl-popup-close-button").onclick=()=>{document.querySelector(".flatmap-tooltip-popup").style.display="block"}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(e=>{e.style.display="none"})},createTooltipFromNeuronCuration:async function(e){this.tooltipEntry=await this.flatmapQueries.createTooltipData(e),this.displayTooltip(e.resource[0])},showPopup:function(e,t,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,n))},showMarkerPopup:function(e,t,r){this.mapImp&&this.mapImp.showMarkerPopup(e,t,r)},closeMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(e.classList.add("enlarge"),e.classList.remove("shrink")):(e.classList.add("shrink"),e.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");e&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),e.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(e){e?(this.inHelp=!0,this.hoverVisibilities.forEach(t=>{t.value=!0}),this.openFlatmapHelpPopup()):(this.inHelp=!1,this.hoverVisibilities.forEach(t=>{t.value=!1}),this.closeFlatmapHelpPopup())},showToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!0},500))},hideToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!1},500))},displayTooltip:function(e){this.tooltipDisplay=!0,this.disableUI||this.displayPopup(e)},displayPopup:function(e){this.mapImp.showPopup(this.mapImp.modelFeatureIds(e)[0],this.$refs.tooltip.$el,{className:"flatmapvuer-popover",positionAtLastClick:!0}),this.popUpCssHacks()},openFlatmapHelpPopup:function(){if(this.mapImp){let e=this.mapImp.modelFeatureIds("UBERON:0000948");e&&e.length>0&&this.mapImp.showPopup(e[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"})}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(e=>{e.click()})},getLabels:function(){let e=[];if(this.mapImp){let t=this.mapImp.annotations;for(let r of t.values())r.label&&e.push(r.label);return Array.from(new Set(e))}},getState:function(){if(this.mapImp){let e={entry:this.entry,viewport:this.mapImp.getState()};const t=this.mapImp.getIdentifier();return this.biologicalSex?e.biologicalSex=this.biologicalSex:t&&t.biologicalSex&&(e.biologicalSex=t.biologicalSex),t&&t.uuid&&(e.uuid=t.uuid),e}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?e.viewport&&this.mapImp.setState(e.viewport):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){e&&(e.viewport&&this.mapImp.setState(e.viewport),e.searchTerm&&this.searchAndShowResult(e.searchTerm,!0))},createFlatmap:function(e){if(!this.mapImp&&!this.loading){this.loading=!0;let t=!1;this.displayMinimap&&(t={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),e?e.uuid?r={uuid:e.uuid}:e.entry&&(r.taxon=e.entry,e.biologicalSex?r.biologicalSex=e.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{featureInfo:this.featureInfo,"min-zoom":this.minZoom,layerControl:!0,pathControls:!0,searchable:this.searchable,tooltips:this.tooltips,minimap:t}).then(n=>{this.mapImp=n,this.serverUUID=this.mapImp.getIdentifier().uuid,this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(e)})}else e&&(this._stateToBeSet={viewport:e.viewport,searchTerm:e.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),r=parseInt(t.paddingTop)+parseInt(t.paddingBottom),n=e.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(){this.sensor=new d6t(this.$refs.display,this.mapResize),this.mapImp.options&&this.mapImp.options.style==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!0,this.mapResize(),this.$emit("ready",this)},showMinimap:function(e){this.mapImp&&this.mapImp.showMinimap(e)},showPathwaysDrawer:function(e){this.drawerOpen=e},searchAndShowResult:function(e,t){if(this.mapImp){if(e===void 0||e==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(e);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),t&&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(e){return this.mapImp?this.mapImp.search(e):[]}},props:{entry:String,uuid:String,biologicalSex:{type:String,default:""},featureInfo:{type:Boolean,default:!1},minZoom:{type:Number,default:4},pathControls:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},layerControl:{type:Boolean,default:!1},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},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}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI}},data:function(){return{annotationEntry:{},tooltipDisplay:!1,serverUUID:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,hoverVisibilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],yellowstar:c6t,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:s6t,tooltipEntry:Sbt(),connectivityTooltipVisible:!1,drawerOpen:!1,annotationRadio:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",currentHover:"",viewingMode:"Exploration",viewingModes:["Annotation","Exploration","Network Discovery"],openMapRef:void 0,backgroundIconRef:void 0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(e){this.setHelpMode(e)},state:{handler:function(e){this.mapManager?this.setState(e):this.setStateRequired=!0},immediate:!0,deep:!0},disableUI:function(e){e&&this.closeTooltip()}},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait=[],this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=new N5e(this.flatmapAPI),this.flatmapQueries=new l6t,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},Ou=e=>(a.pushScopeId("data-v-2520abe9"),e=e(),a.popScopeId(),e),Mbt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},Cbt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},Ebt={style:{height:"100%",width:"100%"},ref:"display"},Abt={class:"beta-popovers"},Obt=Ou(()=>a.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),Hbt=Ou(()=>a.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Vbt=Ou(()=>a.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),Ibt=Ou(()=>a.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Pbt=Ou(()=>a.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),Nbt={key:1,class:"warning-text"},Bbt=Ou(()=>a.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),Rbt=Ou(()=>a.createElementVNode("b",null,"Network discovery mode",-1)),Fbt=Ou(()=>a.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)),Dbt=Ou(()=>a.createElementVNode("b",null,"Now can display up to 6 panes",-1)),zbt=Ou(()=>a.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)),jbt={class:"bottom-right-control"},Ubt=Ou(()=>a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1)),Gbt=["innerHTML"],qbt=["innerHTML"],Wbt=["onClick"];function Zbt(e,t,r,n,i,o){const s=a.resolveComponent("map-svg-sprite-color"),l=wue,c=ql,u=QE,d=sh,p=a.resolveComponent("map-svg-icon"),h=Cde,f=Mde,m=kde,g=xue,T=j3,y=U3,v=B4,_=vE,b=Qg,L=J3e,w=Y3e,k=XU,C=mde,A=LE;return a.withDirectives((a.openBlock(),a.createElementBlock("div",Mbt,[a.createVNode(s),a.createElementVNode("div",Cbt,[a.createElementVNode("div",Ebt,null,512),a.withDirectives(a.createElementVNode("div",Abt,[a.createElementVNode("div",null,[a.createVNode(u,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[6].value,ref:"warningPopover"},{reference:a.withCtx(()=>[r.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:t[7]||(t[7]=O=>o.showToolitip(6)),onMouseout:t[8]||(t[8]=O=>o.hideToolitip(6))},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1}),r.isLegacy?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[Pbt,a.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...O)=>o.viewLatestMap&&o.viewLatestMap(...O))}," Click here for the latest map ")],64)):(a.openBlock(),a.createElementBlock("span",Nbt,"Beta"))],32)):a.createCommentVNode("",!0)]),default:a.withCtx(()=>[r.isLegacy?(a.openBlock(),a.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=O=>o.showToolitip(6)),onMouseout:t[1]||(t[1]=O=>o.hideToolitip(6))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(a.openBlock(),a.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=O=>o.showToolitip(6)),onMouseout:t[3]||(t[3]=O=>o.hideToolitip(6))},[a.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),Obt,a.createTextVNode(" models available in "),Hbt,a.createTextVNode(". ")],32)):(a.openBlock(),a.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=O=>o.showToolitip(6)),onMouseout:t[5]||(t[5]=O=>o.hideToolitip(6))},[a.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),Vbt,a.createTextVNode(" models available in "),Ibt,a.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(a.openBlock(),a.createBlock(u,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[7].value},{reference:a.withCtx(()=>[r.displayLatestChanges?(a.openBlock(),a.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=O=>o.showToolitip(7)),onMouseout:t[10]||(t[10]=O=>o.hideToolitip(7))},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1}),Bbt],32)):a.createCommentVNode("",!0)]),default:a.withCtx(()=>[Rbt,Fbt,Dbt,zbt]),_:1},8,["visible"])):a.createCommentVNode("",!0)],512),[[a.vShow,!r.disableUI]]),a.withDirectives(a.createVNode(c,{class:a.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:a.withCtx(()=>[a.createVNode(d)]),_:1},8,["class","onClick"]),[[a.vShow,e.minimapResizeShow]]),a.withDirectives(a.createElementVNode("div",jbt,[a.createVNode(u,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[0].value},{reference:a.withCtx(()=>[a.createVNode(p,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[11]||(t[11]=O=>o.zoomIn()),onMouseover:t[12]||(t[12]=O=>o.showToolitip(0)),onMouseout:t[13]||(t[13]=O=>o.hideToolitip(0))})]),_:1},8,["visible"]),a.createVNode(u,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper popper-zoomout",visible:e.hoverVisibilities[1].value},{reference:a.withCtx(()=>[a.createVNode(p,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[14]||(t[14]=O=>o.zoomOut()),onMouseover:t[15]||(t[15]=O=>o.showToolitip(1)),onMouseout:t[16]||(t[16]=O=>o.hideToolitip(1))})]),_:1},8,["visible"]),a.createVNode(u,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value},{reference:a.withCtx(()=>[a.createVNode(p,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[17]||(t[17]=O=>o.resetView()),onMouseover:t[18]||(t[18]=O=>o.showToolitip(2)),onMouseout:t[19]||(t[19]=O=>o.hideToolitip(2))})]),default:a.withCtx(()=>[Ubt]),_:1},8,["visible"])],512),[[a.vShow,!r.disableUI]]),a.createVNode(u,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper",visible:e.hoverVisibilities[4].value,ref:"checkBoxPopover"},{reference:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{class:a.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[r.pathControls?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:a.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(h,{key:0,class:"svg-legends-container"})),a.createVNode(u,{content:"Location of the featured dataset",placement:"right",teleported:!1,trigger:"hover","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{class:"yellow-star-legend",innerHTML:e.yellowstar},null,8,Gbt),[[a.vShow,r.showStarInLegend],[C,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"]),a.createVNode(u,{content:"Find these markers for data",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[5].value,ref:"markerPopover"},{reference:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,qbt),[[a.vShow,e.hoverVisibilities[5].value],[C,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(a.openBlock(),a.createBlock(f,{key:1,active:e.currentActive,hover:e.currentHover,"tree-data":e.systems,ref:"treeControls",onChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected},null,8,["active","hover","tree-data","onChanged","onCheckAll","onChangeActive"])):a.createCommentVNode("",!0),!e.isFC&&e.centreLines&&e.centreLines.length>0?(a.openBlock(),a.createBlock(m,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:e.centreLines,onChanged:o.centreLinesSelected,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged"])):a.createCommentVNode("",!0),!e.isFC&&e.taxonConnectivity&&e.taxonConnectivity.length>0?(a.openBlock(),a.createBlock(m,{title:"Observed in",labelKey:"label",identifierKey:"taxon",selections:e.taxonConnectivity,onChanged:o.taxonsSelected,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckAll"])):a.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(a.openBlock(),a.createBlock(m,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,onChanged:o.pathwaysSelected,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onCheckAll"])):a.createCommentVNode("",!0)],6)),[[C,void 0,"checkBoxPopover"]]):a.createCommentVNode("",!0),a.createElementVNode("div",{onClick:t[20]||(t[20]=(...O)=>o.toggleDrawer&&o.toggleDrawer(...O)),class:a.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(g)]),_:1})],2)],2),[[a.vShow,!r.disableUI]])]),_:1},8,["visible"]),e.openMapRef?(a.openBlock(),a.createBlock(u,{key:0,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.openMapOptions,O=>(a.openBlock(),a.createBlock(y,{key:O.key},{default:a.withCtx(()=>[a.createVNode(T,{type:"primary",plain:"",onClick:N=>e.$emit("open-map",O.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(O.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(u,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"200",teleported:!1,trigger:"click","popper-class":"background-popper","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(y,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Viewing Mode")]),_:1}),a.createVNode(y,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(b,{teleported:!1,modelValue:e.viewingMode,"onUpdate:modelValue":t[21]||(t[21]=O=>e.viewingMode=O),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.viewingModes,O=>(a.openBlock(),a.createBlock(_,{key:O,label:O,value:O},{default:a.withCtx(()=>[a.createVNode(y,null,{default:a.withCtx(()=>[a.createVNode(v,{span:12},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(O),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a.createVNode(y,{class:"backgroundSpacer"}),a.createVNode(y,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Organs display")]),_:1}),a.createVNode(y,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(w,{modelValue:e.colourRadio,"onUpdate:modelValue":t[22]||(t[22]=O=>e.colourRadio=O),class:"flatmap-radio",onChange:o.setColour},{default:a.withCtx(()=>[a.createVNode(L,{label:!0},{default:a.withCtx(()=>[a.createTextVNode("Colour")]),_:1}),a.createVNode(L,{label:!1},{default:a.withCtx(()=>[a.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),a.createVNode(y,{class:"backgroundSpacer"}),a.createVNode(y,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Outlines display")]),_:1}),a.createVNode(y,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(w,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[23]||(t[23]=O=>e.outlinesRadio=O),class:"flatmap-radio",onChange:o.setOutlines},{default:a.withCtx(()=>[a.createVNode(L,{label:!0},{default:a.withCtx(()=>[a.createTextVNode("Show")]),_:1}),a.createVNode(L,{label:!1},{default:a.withCtx(()=>[a.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),a.createVNode(y,{class:"backgroundSpacer"}),a.createVNode(y,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Change background")]),_:1}),a.createVNode(y,{class:"backgroundControl"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.availableBackground,O=>(a.openBlock(),a.createElementBlock("div",{key:O,class:a.normalizeClass(["backgroundChoice",O,O==e.currentBackground?"active":""]),onClick:N=>o.backgroundChangeCallback(O)},null,10,Wbt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.withDirectives(a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[a.createVNode(y,null,{default:a.withCtx(()=>[a.createVNode(u,{visible:e.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper"},{reference:a.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(a.openBlock(),a.createBlock(p,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[24]||(t[24]=O=>o.showToolitip(8)),onMouseout:t[25]||(t[25]=O=>o.hideToolitip(8))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(y,null,{default:a.withCtx(()=>[a.createVNode(u,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[3].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[26]||(t[26]=O=>o.showToolitip(3)),onMouseout:t[27]||(t[27]=O=>o.hideToolitip(3))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[a.vShow,!r.disableUI]]),a.withDirectives(a.createVNode(k,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,entry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation"},null,8,["annotationEntry","entry","annotationDisplay"]),[[a.vShow,e.tooltipDisplay]])])])),[[A,e.loading]])}const VW=R4(kbt,[["render",Zbt],["__scopeId","data-v-2520abe9"]]),R5e={"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"},Kbt={name:"MultiFlatmapVuer",components:{Col:B4,Row:U3,Option:vE,Select:Qg,Popover:QE,FlatmapVuer:VW},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),SE.on("onActionClick",e=>{this.FlatmapSelected(e)})},methods:{initialise:function(){return new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&t.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=a.reactive(this.availableSpecies[n]);else for(let o=0;o<t.length;o++)if(this.availableSpecies[n].taxo===t[o].taxon)if(this.availableSpecies[n].biologicalSex){if(t[o].biologicalSex&&t[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=a.reactive(this.availableSpecies[n]);break}}else{this.speciesList[n]=a.reactive(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,e(),this._resolveList.forEach(n=>{n()})})):this._initialised?e():this._resolveList.push(e)})},FlatmapSelected:function(e){this.$emit("resource-selected",e)},FlatmapReady:function(e){this.$emit("ready",e)},getCoordinatesOfLastClick:function(){const e=this.$refs[this.activeSpecies];if(e&&e[0])return e[0].getCoordinatesOfLastClick()},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(e){this.$emit("pan-zoom-callback",e)},showPopup:function(e,t,r){this.getCurrentFlatmap().showPopup(e,t,r)},showMarkerPopup:function(e,t,r){this.getCurrentFlatmap().showMarkerPopup(e,t,r)},setSpecies:function(e,t,r){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(e,t,n)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let r=0;r<t.length;r++){const n=this.speciesList[t[r]];if(!n.isLegacy&&n.taxo===e.entry&&n.biologicalSex===e.biologicalSex){this.setSpecies(t[r],e,0);return}}},createLegacyEntry:function(e,t,r){if(r&&t){let n="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?n=e.species:n=n+` ${e.species}`),this.speciesList[n]=a.reactive({taxo:t,isLegacy:!0,displayWarning:!0}),{species:n,state:{entry:t,uuid:r,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const r=e.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new N5e(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(e,r.entry,r.uuid)}).then(o=>{t(o||e)}).catch(()=>{t(e)})})}else if(r.entry){const n=r.entry in R5e?R5e[r.entry]:void 0,i=this.createLegacyEntry(e,r.entry,n);t(i||e)}}t(e)})},getState:function(){let e={species:this.activeSpecies,state:void 0},t=this.getCurrentFlatmap();return e.state=t.getState(),e},setState:function(e){e&&this.updateState(e).then(t=>{this.initialise().then(()=>{t.species&&t.species!==this.activeSpecies?this.setSpecies(t.species,t.state,5):t.state&&this.getCurrentFlatmap().setState(t.state)})})},resourceSelected:function(e){this.$emit("resource-selected",e)}},props:{showLayer:{type:Boolean,default:!1},featureInfo:{type:Boolean,default:!1},pathControls:{type:Boolean,default:!0},searchable:{type:Boolean,default:!1},layerControl:{type:Boolean,default:!1},initial:{type:String,default:""},minZoom:{type:Number,default:4},renderAtMounted:{type:Boolean,default:!1},helpMode:{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}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},Xbt=e=>(a.pushScopeId("data-v-40c0dbdb"),e=e(),a.popScopeId(),e),Jbt={class:"multi-container",ref:"multiContainer"},Ybt={key:0,style:{position:"absolute","z-index":"10"}},$bt=Xbt(()=>a.createElementVNode("div",{class:"species-display-text"},"Species",-1));function ext(e,t,r,n,i,o){const s=B4,l=U3,c=vE,u=Qg,d=QE,p=VW;return a.openBlock(),a.createElementBlock("div",Jbt,[r.disableUI?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Ybt,[$bt,a.createVNode(d,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper right-popper",visible:r.helpMode,teleported:!1,ref:"selectPopover"},{reference:a.withCtx(()=>[a.createVNode(u,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=h=>e.activeSpecies=h),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.speciesList,(h,f)=>(a.openBlock(),a.createBlock(c,{key:f,label:f,value:f},{default:a.withCtx(()=>[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(s,{span:8},{default:a.withCtx(()=>[a.createElementVNode("i",{class:a.normalizeClass(h.iconClass)},null,2)]),_:2},1024),a.createVNode(s,{span:12},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(f),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.speciesList,(h,f)=>a.withDirectives((a.openBlock(),a.createBlock(p,{key:f,showLayer:r.showLayer,entry:h.taxo,uuid:h.uuid,biologicalSex:h.biologicalSex,displayWarning:h.displayWarning,displayLatestChanges:h.displayLatestChanges,isLegacy:h.isLegacy,ref_for:!0,ref:f,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.FlatmapSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,onOpenMap:t[1]||(t[1]=m=>e.$emit("open-map",m)),featureInfo:r.featureInfo,minZoom:r.minZoom,pathControls:r.pathControls,searchable:r.searchable,layerControl:r.layerControl,helpMode:r.helpMode,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["showLayer","entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","featureInfo","minZoom","pathControls","searchable","layerControl","helpMode","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[a.vShow,e.activeSpecies==f]])),128))],512)}const txt=R4(Kbt,[["render",ext],["__scopeId","data-v-40c0dbdb"]]),Z_=[{id:"ilxtr:neuron-type-keast-13",centrelines:["n_71"]},{id:"ilxtr:neuron-type-keast-2",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-3",centrelines:["bladder_n","hypogastric_n"]},{id:"ilxtr:neuron-type-keast-15",centrelines:["n_73"]},{id:"ilxtr:neuron-type-keast-1",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-7",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-9",centrelines:["L6_spinal_n-1","L6_ventral_root","pudendal_n","L5_spinal_n","L5_ventral_root"]},{id:"ilxtr:neuron-type-keast-10",centrelines:["S1_dorsal_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_dorsal_root","bladder_n"]},{id:"ilxtr:neuron-type-keast-11",centrelines:["lumbar_splanchnic_n","L2_spinal_n","L1_spinal_n-1","hypogastric_n","bladder_n","L1_dorsal_root","L2_dorsal_root"]},{id:"ilxtr:neuron-type-keast-12",centrelines:["L6_spinal_n-1","L6_dorsal_root","pudendal_n","S1_spinal_n-1","S1_dorsal_root"]},{id:"ilxtr:neuron-type-keast-8",centrelines:["L1_ventral_root_paravertebral_ganglion","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","L2_ventral_root_paravertebral_ganglion","sympathetic_trunk_L2-L3","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_L5-L6","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-20",centrelines:["T1_T2_cns","C8_T1_cns","T2_T3_cns","T10_T11_cns","T9_T10_cns","T11_T12_cns","T8_T9_cns","C7_C8_cns","C6_C7_cns","C4_C5_cns","C3_C4_cns","C5_C6_cns","medulla_C1_cns","pons_medulla_cns","C1_C2_cns","T5_T6_cns","T4_T5_cns","T6_T7_cns","L3_L4_cns","L2_L3_cns","L4_L5_cns","L5_L6_cns","T13_L1_cns","T12_T13_cns","L1_L2_cns","T3_T4_cns","n_69","C2_C3_cns","T7_T8_cns"]},{id:"ilxtr:neuron-type-keast-16",centrelines:["n_74"]},{id:"ilxtr:neuron-type-keast-4",centrelines:["sympathetic_trunk_L6-S1","L6_gray_ramus-spinal_n","sympathetic_trunk_L5-L6","S1_gray_ramus-spinal_n","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","sympathetic_trunk_L2-L3","bladder_n","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-17",centrelines:["n_75"]},{id:"ilxtr:neuron-type-keast-5",centrelines:["S1_ventral_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_ventral_root"]},{id:"ilxtr:neuron-type-keast-18",centrelines:["n_70"]},{id:"ilxtr:neuron-type-keast-6",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","hypogastric_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-19",centrelines:["n_69"]},{id:"ilxtr:neuron-type-keast-14",centrelines:["n_72"]}];function oy(e,t,r,n,i){let o={};if(o.dataset=r,o.scaffold=n,o.simulations=i,t?o.title=t:o.title=e,o.description="",o.actions=[],e)switch(e){case"ICN":o.title="RNA",o.description="The distribution of neurons in the intrinsic cardiac nervous system (ICN) were mapped and visualized in a 3D reconstruction of a male rat heart.",o.actions={search:{title:"Explore data",resource:"icn",type:"Search",label:"ICN",filter:{facet:"genotype",term:"heart"}},plot:{title:"View plot",label:"ICN",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/ISAN/csv-data/use-case-4/RNA_Seq.csv",type:"Plot",plotType:"heatmap",datasetTitle:"Molecular Phenotype Distribution of Single Rat Intracardiac Neurons",datasetDescription:"Images collected from serial cryostat sectioning of a cryopreserved heart was used to reconstruct the 3D context. Transcriptional profiles taken from isolated single neurons and mapped back into the previously generated 3D context.",datasetUrl:"https://discover.pennsieve.io/datasets/29",datasetImage:"https://assets.discover.pennsieve.io/dataset-assets/29/6/revisions/1/banner.jpg"}};break}else o.actions=[];return o}function rxt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0001157":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"colon"}},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/human/humanColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0000948":case"UBERON:0002080":o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/human/humanHeart_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Lung",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Lungs/human/humanLeftLung_metadata.json",type:"Scaffold"}};break;default:o=oy(e,t,r,n,i);break}return o}}function nxt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0000948":case"UBERON:0002080":i?o=oy(e,t,r,n,i):(o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=heart",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/rat/ratHeart_metadata.json",type:"Scaffold"},simulation:{title:"Explore simulations",label:"Heart",resource:"https://sparc.science/data?type=simulation&q=heart",type:"URL"}});break;case"UBERON:0001156":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;case"UBERON:0001255":o.title="Urinary bladder",o.description="",o.actions={search:{title:"Explore data",label:"Urinary Bladder",resource:"https://sparc.science/data?type=dataset&q=bladder",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Bladder",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Bladder/rat/ratBladder_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"}};break;case"ICN":o.title="RNA",o.description="The distribution of neurons in the intrinsic cardiac nervous system (ICN) were mapped and visualized in a 3D reconstruction of a male rat heart.",o.actions={search:{title:"Explore data",resource:"icn",type:"Search"},plot:{title:"View plot",label:"ICN",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/ISAN/csv-data/use-case-4/RNA_Seq.csv",type:"Plot",plotType:"heatmap",datasetTitle:"Molecular Phenotype Distribution of Single Rat Intracardiac Neurons",datasetDescription:"Images collected from serial cryostat sectioning of a cryopreserved heart was used to reconstruct the 3D context. Transcriptional profiles taken from isolated single neurons and mapped back into the previously generated 3D context.",datasetUrl:"https://discover.pennsieve.io/datasets/29",datasetImage:"https://assets.discover.pennsieve.io/dataset-assets/29/6/revisions/1/banner.jpg"}};break;case"UBERON:0000945":case"UBERON:0001160":case"UBERON:0001161":o.title="Stomach",o.description="",o.actions={search:{title:"Explore data",label:"Stomach",resource:"https://sparc.science/data?type=dataset&q=stomach",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Stomach",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Stomach/rat/ratStomach_metadata.json",type:"Scaffold"}};break;case"UBERON:0001759":t?o.title=t:o.title="Vagus nerve",o.actions={search:{title:"Explore data",label:"Vagus nerve",resource:"https://sparc.science/data?type=dataset&q=vagus+nerve",type:"Search"},simulation:{title:"Explore simulations",label:"Vagus nerve",resource:"https://sparc.science/data?type=simulation&q=vagus%20nerve",type:"simulation"}};break;default:o=oy(e,t,r,n,i);break}return o}}function ixt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0001156":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/mouse/mouseColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Lung",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Lungs/mouse/mouseLeftLung_metadata.json",type:"Scaffold"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;default:o=oy(e,t,r,n,i);break}return o}}function oxt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0008972":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/pig/pigColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;case"UBERON:0000948":case"UBERON:0002080":o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/pig/pigHeart_metadata.json",type:"Scaffold"}};break;default:o=oy(e,t,r,n,i);break}return o}}function axt(e,t,r,n,i,o){switch(t){case"NCBITaxon:9606":return rxt(e,r,n,i,o);case"NCBITaxon:9823":return oxt(e,r,n,i,o);case"NCBITaxon:10090":return ixt(e,r,n,i,o);case"NCBITaxon:10114":return nxt(e,r,n,i,o);default:return oy(e,t,r,n,i)}}function sxt(){return[{id:"UBERON:0000948",name:"Heart",type:"simulation"},{id:"UBERON:0001156",name:"Colon",type:"simulation"},{id:"UBERON:0001255",name:"Bladder",type:"simulation"},{id:"UBERON:0000945",name:"Stomach",type:"simulation"},{id:"UBERON:0001759",name:"Vagus nerve",type:"simulation"},{id:"UBERON:0002108",name:"Small intestines",type:"simulation"},{id:"UBERON:0002107",name:"Liver",type:"simulation"}]}function lxt(){return sxt()}function F5e(e){if(e)for(let t=0;t<Z_.length;t++){if(Z_[t].id==e)return Z_[t].centrelines;if(Z_[t].centrelines.find(n=>n===e))return[Z_[t].id]}return[]}function cxt(e){if(e){const t=e.toLowerCase();if(t.includes("heart"))return{id:"UBERON:0000948",name:"Heart"};if(t.includes("liver"))return{id:"UBERON:0002107",name:"Liver"};if(t.includes("stomach"))return{id:"UBERON:0000945",name:"Stomach"};if(t.includes("colon"))return{id:"UBERON:0001156",name:"Colon"};if(t.includes("bladder"))return{id:"UBERON:0001255",name:"Bladder"}}}function uxt(e,t){if(e&&e.resource){let r=e.resource;Array.isArray(r)&&r[0]&&(r=r[0]);let n,i,o,s,l,c=r.taxonomy;if(r.data&&r.data.id?(n=r.data.id,i=r.data.id):r.feature&&(n=r.feature.models,i=r.feature.label,o=r.feature.dataset,s=r.feature.scaffold,l=r.feature.simulations),n||i){let u=axt(n,c,i,o,s,l);if(u&&u.actions)return u.actions[t]}}}let IW=7,rd=5;const UH=[{id:"UBERON:0000948",name:"heart",showAtZoom:1},{id:"UBERON:0001759",name:"vagus nerve",showAtZoom:1},{id:"UBERON:0001155",name:"colon",showAtZoom:1},{id:"UBERON:0000945",name:"stomach",showAtZoom:1},{id:"UBERON:0001013",name:"adipose tissue",showAtZoom:1},{id:"UBERON:0001255",name:"urinary bladder",showAtZoom:1},{id:"UBERON:0001348",name:"brown adipose tissue",showAtZoom:6},{id:"UBERON:0002008",name:"cardiac nerve plexus",showAtZoom:1},{id:"UBERON:0002240",name:"spinal cord",showAtZoom:1},{id:"UBERON:0002005",name:"Enteric Nervous System",showAtZoom:4},{id:"UBERON:0013702",name:"body proper",showAtZoom:1},{id:"UBERON:0002298",name:"brainstem",showAtZoom:1},{id:"UBERON:0002439",name:"myenteric nerve plexus",showAtZoom:6},{id:"UBERON:0000010",name:"peripheral nervous system",showAtZoom:6},{id:"UBERON:0002048",name:"lung",showAtZoom:1},{id:"UBERON:0002410",name:"autonomic nervous system",showAtZoom:6},{id:"UBERON:0002441",name:"cervicothoracic ganglion",showAtZoom:6},{id:"UBERON:0005363",name:"inferior vagus X ganglion",showAtZoom:6},{id:"UBERON:0001264",name:"pancreas",showAtZoom:1},{id:"UBERON:0001884",name:"phrenic nerve",showAtZoom:6},{id:"UBERON:0002059",name:"submandibular ganglion",showAtZoom:7},{id:"UBERON:0001347",name:"white adipose tissue",showAtZoom:6},{id:"UBERON:0001556",name:"lower urinary tract",showAtZoom:1},{id:"UBERON:0002262",name:"celiac ganglion",showAtZoom:5},{id:"UBERON:0000955",name:"Brain",showAtZoom:1},{id:"UBERON:0000160",name:"intestine",showAtZoom:1},{id:"UBERON:0001322",name:"sciatic nerve",showAtZoom:1},{id:"UBERON:0001649",name:"glossopharyngeal nerve",showAtZoom:6},{id:"UBERON:0002063",name:"sinus venosus",showAtZoom:6},{id:"UBERON:0002107",name:"liver",showAtZoom:1},{id:"UBERON:0002113",name:"kidney",showAtZoom:1},{id:"UBERON:0002481",name:"bone tissue",showAtZoom:1},{id:"UBERON:0004907",name:"lower digestive tract",showAtZoom:4},{id:"UBERON:0000044",name:"Dorsal root ganglion",showAtZoom:5},{id:"UBERON:0001736",name:"Submandibular gland",showAtZoom:IW,keyword:!0},{id:"UBERON:0001103",name:"Diaphragm",showAtZoom:rd,keyword:!0},{id:"UBERON:0001160",name:"Fundus of stomach",showAtZoom:rd,keyword:!0},{id:"UBERON:0000955",name:"Brain",showAtZoom:rd,keyword:!0},{id:"UBERON:0003708",name:"Carotid sinus",showAtZoom:IW,keyword:!0},{id:"UBERON:0002079",name:"Left cardiac atrium",showAtZoom:rd,keyword:!0},{id:"ILX:0485722",name:"Nodose ganglion",showAtZoom:IW,keyword:!0},{id:"UBERON:0002078",name:"Right cardiac atrium",showAtZoom:rd,keyword:!0},{id:"UBERON:0002084",name:"Heart left ventricle",showAtZoom:rd,keyword:!0},{id:"UBERON:0002080",name:"Heart right ventricle",showAtZoom:rd,keyword:!0},{id:"UBERON:0001508",name:"Arch of Aorta",showAtZoom:rd,keyword:!0},{id:"UBERON:0001738",name:"Thyroid cartilage",showAtZoom:rd,keyword:!0},{id:"UBERON:0000388",name:"Epiglottis",showAtZoom:rd,keyword:!0}];function dxt(e){return e[0].toUpperCase()+e.substring(1)}const ay={props:{entry:Object,visible:{type:Boolean,default:!0},mouseHovered:{type:Boolean,default:!1}},computed:{...gl.mapStores(rg,b8),syncMode(){return this.splitFlowStore.syncMode}},mounted:function(){Xo.on("startHelp",()=>{this.startHelp()})},methods:{toggleSyncMode:function(){},getState:function(){},openMap:function(e){e==="SYNC"?this.toggleSyncMode():Xo.emit("OpenNewMap",e)},updateWithViewUrl:function(){},search:function(){return!1},searchSuggestions:function(){},resourceSelected:function(e,t,r){if(this.resourceHasAction(t)){Xo.emit("PopoverActionClick",t);return}let n,i="none",o=!1;const s={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0,eventType:void 0};if(e=="MultiFlatmap"||e=="Flatmap")if(s.internalName=this.idNamePair[t.feature.models],t.eventType=="click")if(s.eventType="selected",t.feature.type=="marker"){let l=this.idNamePair[t.feature.models],c=UH.filter(u=>u.id===t.feature.models);this.settingsStore.isFeaturedMarkerIdentifier(t.feature.id)?n={type:"Search",term:this.settingsStore.featuredMarkerDoi(t.feature.id)}:c.filter(u=>u.keyword).length>0?n={type:"Search",term:"http://purl.obolibrary.org/obo/"+t.feature.models.replace(":","_")}:n={type:"Facet",facet:l,facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"},o=!0,e=="MultiFlatmap"&&this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}else t.feature.type=="feature"&&(this.syncMode?o=!0:i="scaffold");else t.eventType=="mouseenter"&&(s.eventType="highlighted",o=!0);else e=="Scaffold"&&(t&&t[0]&&(s.internalName=t[0].data.id,t[0].data.lastActionOnMarker===!0&&(n={type:"Facet",facet:dxt(t[0].data.id),facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"})),s.eventType="selected",o=!0,i="search");n===void 0&&r&&(n=uxt(s,i)),n&&Xo.emit("PopoverActionClick",n),o&&this.$emit("resource-selected",s)},resourceHasAction:function(e){return e.type==="URL"||e.type==="Search"||e.type==="Neuron Search"||e.type=="Facet"||e.type=="Facets"},isVisible:function(){return this.splitFlowStore.getPaneNameById(this.entry.id)!==void 0},displayTooltip:function(){},getNameAndIdFromSyncData:async function(e){let t=e.internalName;t===void 0&&e.resource&&(t=e.resource.label);let r;if(e.resource&&e.resource.resource&&(r=e.resource.resource[0]),this.entry.type==="Scaffold"){if(this.$refs.scaffold.findObjectsWithGroupName(t).length===0){if(e.resource&&e.resource.feature){const o=F5e(e.resource.feature.models);if(o.length>0)return o}let i=cxt(t);if(i)return i;if(r&&e.eventType==="selected")return fetch(`${this.apiLocation}get-related-terms/${r}`).then(o=>o.json()).then(o=>{if(o.uberon.array.length>0)return t=o.uberon.array[0].name.charAt(0).toUpperCase()+o.uberon.array[0].name.slice(1),r=o.uberon.array[0].id.toUpperCase(),{id:r,name:t}})}}else if(this.entry.type==="MultiFlatmap")if(t==="Bladder")t="Urinary Bladder";else{const n=F5e(t);n.length>0&&(t=n[0])}return{id:r,name:t}},getDatasetAnatomyInfo:function(e){fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then(t=>t.json()).then(t=>{const r=t.result[0];let n;try{n=r.anatomy.organ[0].curie}catch{n=void 0}let i;try{i=r.item.curie}catch{i=void 0}let o;try{let s=0,l=!1;for(;!l&&s<r.organisms.subject.length;){const c=r.organisms.subject[s];c.species&&(o=c.species.name,l=!0),s+=1}}catch{o=void 0}this.settingsStore.updateFeaturedMarker({identifier:e,marker:n,doi:i,species:o})})},getFeaturedDatasets:function(){const e=this;fetch(`${this.apiLocation}get_featured_datasets_identifiers`).then(t=>t.json()).then(t=>{this.settingsStore.updateFeatured(t.identifiers),t.identifiers.forEach(r=>{e.getDatasetAnatomyInfo(r)})})},zoomToFeatures:function(){},handleSyncMouseEvent:async function(e){let t=await this.getNameAndIdFromSyncData(e);e.eventType==="highlighted"?this.highlightFeatures(t):e.eventType==="selected"&&this.displayTooltip(t)},handleSyncPanZoomEvent:function(){},highlightFeatures:function(){},receiveSynchronisedEvent:async function(e){if(e.paneIndex!==this.entry.id)e.eventType=="panZoom"||this.handleSyncMouseEvent(e);else if(e.eventType=="selected"){let t=await this.getNameAndIdFromSyncData(e);this.zoomToFeatures(t,!1)}},requestSynchronisedEvent:function(){},getAvailableTerms:function(){let e=lxt();for(let t=0;t<e.length;t++)this.idNamePair[e[t].id]=e[t].name;if(this.apiLocation){this._controller&&this._controller.abort(),this._controller=new AbortController;let t=this._controller.signal;fetch(`${this.apiLocation}get-organ-curies`,{signal:t}).then(r=>r.json()).then(r=>{this._controller=void 0,r.uberon.array.forEach(n=>{this.idNamePair[n.id.toUpperCase()]=n.name.charAt(0).toUpperCase()+n.name.slice(1)})})}},flatmapMarkerZoomUpdate(){},onResize:function(){},startHelp:function(){this.isInHelp===!1&&(this.helpMode=!0,window.addEventListener("mousedown",this.endHelp),this.isInHelp=!0)},endHelp:function(){window.removeEventListener("mousedown",this.endHelp),this.helpMode=!1,setTimeout(()=>{this.isInHelp=!1},200)}},data:function(){return{apiLocation:void 0,activeSpecies:"Rat",scaffoldCamera:void 0,mainStyle:{height:this.entry.datasetTitle?"calc(100% - 30px)":"100%",width:"100%",bottom:"0px"},helpMode:!1,idNamePair:{},scaffoldLoaded:!1,isInHelp:!1}},created:function(){this.flatmapAPI=void 0,this.apiLocation=void 0,this.settingsStore.flatmapAPI&&(this.flatmapAPI=this.settingsStore.flatmapAPI),this.settingsStore.sparcApi&&(this.apiLocation=this.settingsStore.sparcApi)}},pxt=(e,t,r)=>{t&&t.forEach(n=>{let i=!1;for(let o=0;o<UH.length;o++)if(UH[o].id===n){i=!0,r>=UH[o].showAtZoom&&e.addMarker(n,{className:"standard-marker"});break}i||e.addMarker(n,{className:"standard-marker"})})},D5e={computed:{...gl.mapStores(rg)},methods:{flatmapPanZoomCallback:function(e){if(this.mouseHovered){const t={paneIndex:this.entry.id,eventType:"panZoom",payload:e,type:this.entry.type};this.flatmapMarkerZoomUpdate(!1,void 0),this.$emit("resource-selected",t)}},flatmapMarkerZoomUpdate(e,t){if(!this.flatmapReady)return;let r=t;if(r||(r=this.getFlatmapImp()),r){let n=r.getZoom().zoom;if(e||this.zoomLevel!==n){this.zoomLevel=n,r.clearMarkers();let i=this.settingsStore.markers;pxt(r,i,this.zoomLevel),this.entry.type==="MultiFlatmap"&&this.restoreFeaturedMarkers(r)}}},flatmapReadyForMarkerUpdates:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerZoomUpdate(!0,t)}}}},hxt={name:"Flatmap",mixins:[ay,D5e],components:{FlatmapVuer:VW},methods:{getState:function(){return this.$refs.flatmap.getState()},search:function(e){return this.$refs.flatmap.searchAndShowResult(e)},getFlatmapImp(){return this.$refs.flatmap.mapImp},flatmaprResourceSelected:function(e,t){this.$refs.flatmap.resourceSelected(e,t,this.$refs.map.viewingMode==="Exploration")},flatmapReadyCall:function(e){let t={id:this.entry.id,prov:this.getFlatmapImp().provenance};Xo.emit("mapImpProv",t),this.$emit("flatmap-provenance-ready",t),this.getAvailableTerms(),this.entry.resource==="FunctionalConnectivity"&&this.flatmapReadyForMarkerUpdates(e)},highlightFeatures:function(e){let t=e.name;const r=this.$refs.flatmap.mapImp;if(t){const n=r.search(t);n.featureIds[0]&&r.highlightFeatures([r.modelForFeature(n.featureIds[0])])}},searchSuggestions:function(e,t){e&&this.$refs.flatmap.mapImp&&this.$refs.flatmap.mapImp.search(e).__featureIds.forEach(n=>{const i=this.$refs.flatmap.mapImp.annotation(n);i&&i.label&&t.push(i.label)})},zoomToFeatures:function(e,t){let r=e.name;const n=this.$refs.flatmap.mapImp;if(r){const i=n.search(r);if(i.featureIds.length){let o=n.modelForFeature(i.featureIds[0]);o?(t&&n.selectFeatures(o),n.zoomToFeatures(o)):n.clearSearchResults()}}else n.clearSearchResults()}},computed:{facetSpecies(){return this.settingsStore.facets.species}},mounted:function(){this.getAvailableTerms(),Xo.on("markerUpdate",()=>{this.flatmapMarkerZoomUpdate(!0,void 0)})}};function fxt(e,t,r,n,i,o){const s=a.resolveComponent("FlatmapVuer");return a.openBlock(),a.createBlock(s,{state:e.entry.state,entry:e.entry.resource,onResourceSelected:t[0]||(t[0]=l=>o.flatmaprResourceSelected(e.entry.type,l)),onPanZoomCallback:e.flatmapPanZoomCallback,name:e.entry.resource,style:{height:"100%",width:"100%"},minZoom:e.entry.minZoom,helpMode:e.helpMode,pathControls:!0,ref:"flatmap",onReady:o.flatmapReadyCall,displayMinimap:!1,displayWarning:!0,enableOpenMapUI:!0,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,onOpenMap:e.openMap},null,8,["state","entry","onPanZoomCallback","name","minZoom","helpMode","onReady","flatmapAPI","sparcAPI","onOpenMap"])}const mxt=Gl(hxt,[["render",fxt],["__scopeId","data-v-1cc78d5b"]]),gxt={name:"Iframe",mixins:[ay]},yxt={class:"map-iframe-container"},Txt=["src"];function vxt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",yxt,[a.createElementVNode("iframe",{class:"my-iframe",src:e.entry.resource.share_link},null,8,Txt)])}const Qxt=Gl(gxt,[["render",vxt],["__scopeId","data-v-60f8bfe1"]]),bxt='<svg width="72px" height="72px" viewBox="0 0 24 24" fill="yellow"><path d="M11.0748 3.25583C11.4141 2.42845 12.5859 2.42845 12.9252 3.25583L14.6493 7.45955C14.793 7.80979 15.1221 8.04889 15.4995 8.07727L20.0303 8.41798C20.922 8.48504 21.2841 9.59942 20.6021 10.1778L17.1369 13.1166C16.8482 13.3614 16.7225 13.7483 16.8122 14.1161L17.8882 18.5304C18.1 19.3992 17.152 20.0879 16.3912 19.618L12.5255 17.2305C12.2034 17.0316 11.7966 17.0316 11.4745 17.2305L7.60881 19.618C6.84796 20.0879 5.90001 19.3992 6.1118 18.5304L7.18785 14.1161C7.2775 13.7483 7.1518 13.3614 6.86309 13.1166L3.3979 10.1778C2.71588 9.59942 3.07796 8.48504 3.96971 8.41798L8.50046 8.07727C8.87794 8.04889 9.20704 7.80979 9.35068 7.45955L11.0748 3.25583Z" stroke="#000000" stroke-width="2"/></svg>',z5e=e=>{const t=[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}];switch(e){case"Human Male":case"Human Female":case"Rat":t.push({display:"Open Sync Map",key:"SYNC"});break}return t},xxt={name:"MultiFlatmap",mixins:[ay,D5e],components:{MultiFlatmapVuer:txt},data:function(){return{zoomLevel:6,flatmapReady:!1,availableSpecies:g0e(),scaffoldResource:{},showStarInLegend:!1,openMapOptions:z5e("Rat")}},methods:{toggleSyncMode:async function(){if(this.syncMode==!1){let e;this.activeSpecies==="Rat"?e={contextCard:void 0,discoverId:void 0,label:"Rat Body",resource:"https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/31-May-2021/ratBody/ratBody_syncmap_metadata.json",title:"View 3D scaffold",layout:"2horpanel",type:"SyncMap"}:(this.activeSpecies==="Human Male"||this.activeSpecies==="Human Female")&&("human"in this.scaffoldResource||(this.scaffoldResource.human=await Nj(storeeSettings.sparcApi,"human")),e={contextCardUrl:this.scaffoldResource.human.datasetInfo.contextCardUrl,discoverId:this.scaffoldResource.human.datasetInfo.discoverId,s3uri:this.scaffoldResource.human.datasetInfo.s3uri,version:this.scaffoldResource.human.datasetInfo.version,label:"Human Body",resource:this.scaffoldResource.human.url,title:"View 3D scaffold",layout:"2vertpanel",type:"SyncMap",isBodyScaffold:!0}),e&&Xo.emit("SyncModeRequest",{flag:!0,action:e})}else Xo.emit("SyncModeRequest",{flag:!1})},getState:function(){if(this.flatmapReady)return this.$refs.multiflatmap.getState()},flatmapPanZoomCallback:function(e){if(this.mouseHovered){const t={paneIndex:this.entry.id,eventType:"panZoom",payload:e,type:this.entry.type};this.flatmapMarkerZoomUpdate(!1,void 0),this.$emit("resource-selected",t)}},search:function(e){return this.$refs.multiflatmap.getCurrentFlatmap().searchAndShowResult(e,!0)},searchSuggestions:function(e,t){const r=this.$refs.multiflatmap.getCurrentFlatmap();e&&r.mapImp&&r.mapImp.search(e).__featureIds.forEach(i=>{const o=r.mapImp.annotation(i);o&&o.label&&t.push(o.label)})},flatmaprResourceSelected:function(e,t){const r=this.$refs.multiflatmap.getCurrentFlatmap();this.resourceSelected(e,t,r.viewingMode==="Exploration")},handleSyncPanZoomEvent:function(e){if(!this.mouseHovered&&e.type!==this.entry.type){const t=e.payload.zoom,r=e.payload.target,n=this.$el.clientHeight,i=this.$el.clientWidth,o=Math.max(i,n);let s=i/o/t;const l=n/o/t,c=[r[0]/2+.5-s/2,.5-r[1]/2-l/2];this.$refs.multiflatmap.getCurrentFlatmap().mapImp.panZoomTo(c,[s,l]),this.flatmapMarkerZoomUpdate(!1,void 0)}},displayTooltip:function(e){if(e){let t=e.name;t?this.search(t):this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}},zoomToFeatures:function(e,t){let r=e.name;const n=this.$refs.multiflatmap.getCurrentFlatmap().mapImp;if(r){const i=n.search(r);i.featureIds.length>0?(t&&n.selectFeatures(i.featureIds),n.zoomToFeatures(i.featureIds)):n.clearSearchResults()}else n.clearSearchResults()},highlightFeatures:function(e){let t=e.name;const r=this.$refs.multiflatmap.getCurrentFlatmap().mapImp;if(t){const n=r.search(t);n.featureIds.length>0&&r.zoomToFeatures(n.featureIds,{noZoomIn:!0})}},updateProvCard:function(){const e=this.getFlatmapImp();if(e){let t={id:this.entry.id,prov:e.provenance};this.$emit("flatmap-provenance-ready",t)}},flatmapChanged:async function(e){this.activeSpecies=e,this.openMapOptions=z5e(e),this.$emit("species-changed",e),this.entry.state&&this.entry.state.species===this.activeSpecies||this.syncMode==!0&&await this.toggleSyncMode(),this.updateProvCard()},multiFlatmapReady:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerZoomUpdate(!0,t),this.updateProvCard()}},getFlatmapImp:function(){if(this.entry.type==="MultiFlatmap")return this.$refs.multiflatmap.getCurrentFlatmap().mapImp},flatmapAreaSearch(){let r={type:"Facets",label:"Unused",val:this.getFlatmapImp().visibleMarkerAnatomicalIds().map(n=>this.idNamePair[n])};Xo.emit("PopoverActionClick",r)},restoreFeaturedMarkers:function(e){this.settingsStore.resetFeaturedMarkerIdentifier();const t=this.settingsStore.featuredMarkers;this.updateFeatureMarkers(t,e)},updateFeatureMarkers:function(e,t){this.showStarInLegend=!1;for(let r=0;r<e.length;++r)e[r]&&(this.settingsStore.featuredMarkerIdentifiers[r]||this.addFeaturedMarker(e[r],r,t)&&(this.showStarInLegend=!0))},addFeaturedMarker:function(e,t,r){const n=this.settingsStore.featuredMarkerSpecies[t];if(n&&!this.activeSpecies.startsWith(n))return!1;let i=r;if(i||(i=this.getFlatmapImp()),i){let o=document.createElement("div");o.innerHTML=bxt;const s=i.addMarker(e,{element:o,className:"highlight-marker"});return this.settingsStore.updateFeaturedMarkerIdentifier({index:t,markerIdentifier:s}),!0}return!1}},computed:{facetSpecies(){return this.settingsStore.facets.species},featuredMarkers(){return this.settingsStore.featuredMarkers}},watch:{syncMode:function(e){this.$refs.multiflatmap.getCurrentFlatmap()&&this.$refs.multiflatmap.getCurrentFlatmap().enablePanZoomEvents(e)},featuredMarkers:function(e){this.flatmapReady&&this.updateFeatureMarkers(e,void 0)}},mounted:function(){this.getAvailableTerms(),this.getFeaturedDatasets(),Xo.on("markerUpdate",()=>{this.flatmapMarkerZoomUpdate(!0,void 0)})}};function _xt(e,t,r,n,i,o){const s=a.resolveComponent("MultiFlatmapVuer");return a.openBlock(),a.createBlock(s,{availableSpecies:e.availableSpecies,onFlatmapChanged:o.flatmapChanged,onReady:o.multiFlatmapReady,state:e.entry.state,onResourceSelected:t[0]||(t[0]=l=>o.flatmaprResourceSelected(e.entry.type,l)),style:{height:"100%",width:"100%"},initial:e.entry.resource,helpMode:e.helpMode,ref:"multiflatmap",displayMinimap:!0,showStarInLegend:e.showStarInLegend,enableOpenMapUI:!0,openMapOptions:e.openMapOptions,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,onPanZoomCallback:o.flatmapPanZoomCallback,onOpenMap:e.openMap},null,8,["availableSpecies","onFlatmapChanged","onReady","state","initial","helpMode","showStarInLegend","openMapOptions","flatmapAPI","sparcAPI","onPanZoomCallback","onOpenMap"])}const wxt=Gl(xxt,[["render",_xt],["__scopeId","data-v-51af652b"]]);function Lxt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j5e={exports:{}},cs=j5e.exports={},nd,id;function PW(){throw new Error("setTimeout has not been defined")}function NW(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?nd=setTimeout:nd=PW}catch{nd=PW}try{typeof clearTimeout=="function"?id=clearTimeout:id=NW}catch{id=NW}})();function U5e(e){if(nd===setTimeout)return setTimeout(e,0);if((nd===PW||!nd)&&setTimeout)return nd=setTimeout,setTimeout(e,0);try{return nd(e,0)}catch{try{return nd.call(null,e,0)}catch{return nd.call(this,e,0)}}}function Sxt(e){if(id===clearTimeout)return clearTimeout(e);if((id===NW||!id)&&clearTimeout)return id=clearTimeout,clearTimeout(e);try{return id(e)}catch{try{return id.call(null,e)}catch{return id.call(this,e)}}}var ep=[],sy=!1,tm,GH=-1;function kxt(){!sy||!tm||(sy=!1,tm.length?ep=tm.concat(ep):GH=-1,ep.length&&G5e())}function G5e(){if(!sy){var e=U5e(kxt);sy=!0;for(var t=ep.length;t;){for(tm=ep,ep=[];++GH<t;)tm&&tm[GH].run();GH=-1,t=ep.length}tm=null,sy=!1,Sxt(e)}}cs.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];ep.push(new q5e(e,t)),ep.length===1&&!sy&&U5e(G5e)};function q5e(e,t){this.fun=e,this.array=t}q5e.prototype.run=function(){this.fun.apply(null,this.array)},cs.title="browser",cs.browser=!0,cs.env={},cs.argv=[],cs.version="",cs.versions={};function tp(){}cs.on=tp,cs.addListener=tp,cs.once=tp,cs.off=tp,cs.removeListener=tp,cs.removeAllListeners=tp,cs.emit=tp,cs.prependListener=tp,cs.prependOnceListener=tp,cs.listeners=function(e){return[]},cs.binding=function(e){throw new Error("process.binding is not supported")},cs.cwd=function(){return"/"},cs.chdir=function(e){throw new Error("process.chdir is not supported")},cs.umask=function(){return 0};var Mxt=j5e.exports;const ly=Lxt(Mxt),rp=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)},cy=globalThis||void 0||self;var W5e;const Ec=typeof window<"u",Cxt=e=>typeof e=="string",Z5e=()=>{},Ext=Ec&&((W5e=window==null?void 0:window.navigator)==null?void 0:W5e.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function K5e(e){return typeof e=="function"?e():a.unref(e)}function Axt(e){return e}function qH(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function Oxt(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function np(e){var t;const r=K5e(e);return(t=r==null?void 0:r.$el)!=null?t:r}const WH=Ec?window:void 0;function rm(...e){let t,r,n,i;if(Cxt(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=WH):[t,r,n,i]=e,!t)return Z5e;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,p,h,f)=>(d.addEventListener(p,h,f),()=>d.removeEventListener(p,h,f)),c=a.watch(()=>[np(t),K5e(i)],([d,p])=>{s(),d&&o.push(...r.flatMap(h=>n.map(f=>l(d,h,f,p))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return qH(u),u}let X5e=!1;function Hxt(e,t,r={}){const{window:n=WH,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;Ext&&!X5e&&(X5e=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",Z5e)));let l=!0;const c=d=>i.some(p=>{if(typeof p=="string")return Array.from(n.document.querySelectorAll(p)).some(h=>h===d.target||d.composedPath().includes(h));{const h=np(p);return h&&(d.target===h||d.composedPath().includes(h))}}),u=[rm(n,"click",d=>{const p=np(e);if(!(!p||p===d.target||d.composedPath().includes(p))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),rm(n,"pointerdown",d=>{const p=np(e);p&&(l=!d.composedPath().includes(p)&&!c(d))},{passive:!0}),s&&rm(n,"blur",d=>{var p;const h=np(e);((p=n.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(h!=null&&h.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function J5e(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),Oxt(n,t),r}const BW=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof cy<"u"?cy:typeof self<"u"?self:{},RW="__vueuse_ssr_handlers__";BW[RW]=BW[RW]||{},BW[RW];var Y5e=Object.getOwnPropertySymbols,Vxt=Object.prototype.hasOwnProperty,Ixt=Object.prototype.propertyIsEnumerable,Pxt=(e,t)=>{var r={};for(var n in e)Vxt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Y5e)for(var n of Y5e(e))t.indexOf(n)<0&&Ixt.call(e,n)&&(r[n]=e[n]);return r};function ip(e,t,r={}){const n=r,{window:i=WH}=n,o=Pxt(n,["window"]);let s;const l=J5e(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>np(e),p=>{c(),l.value&&i&&p&&(s=new ResizeObserver(t),s.observe(p,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return qH(d),{isSupported:l,stop:d}}var $5e=Object.getOwnPropertySymbols,Nxt=Object.prototype.hasOwnProperty,Bxt=Object.prototype.propertyIsEnumerable,Rxt=(e,t)=>{var r={};for(var n in e)Nxt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$5e)for(var n of $5e(e))t.indexOf(n)<0&&Bxt.call(e,n)&&(r[n]=e[n]);return r};function Fxt(e,t,r={}){const n=r,{window:i=WH}=n,o=Rxt(n,["window"]);let s;const l=J5e(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>np(e),p=>{c(),l.value&&i&&p&&(s=new MutationObserver(t),s.observe(p,o))},{immediate:!0}),d=()=>{c(),u()};return qH(d),{isSupported:l,stop:d}}var efe;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(efe||(efe={}));var Dxt=Object.defineProperty,tfe=Object.getOwnPropertySymbols,zxt=Object.prototype.hasOwnProperty,jxt=Object.prototype.propertyIsEnumerable,rfe=(e,t,r)=>t in e?Dxt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Uxt=(e,t)=>{for(var r in t||(t={}))zxt.call(t,r)&&rfe(e,r,t[r]);if(tfe)for(var r of tfe(t))jxt.call(t,r)&&rfe(e,r,t[r]);return e};Uxt({linear:Axt},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Gxt=()=>Ec&&/firefox/i.test(window.navigator.userAgent);ly.env.NODE_ENV!=="production"&&Object.freeze({}),ly.env.NODE_ENV!=="production"&&Object.freeze([]);const K_=()=>{},qxt=Object.prototype.hasOwnProperty,nfe=(e,t)=>qxt.call(e,t),u0=Array.isArray,d0=e=>typeof e=="function",od=e=>typeof e=="string",p0=e=>e!==null&&typeof e=="object",Wxt=Object.prototype.toString,Zxt=e=>Wxt.call(e),FW=e=>Zxt(e).slice(8,-1);var ife=typeof cy=="object"&&cy&&cy.Object===Object&&cy,Kxt=typeof self=="object"&&self&&self.Object===Object&&self,ad=ife||Kxt||Function("return this")(),Ah=ad.Symbol,ofe=Object.prototype,Xxt=ofe.hasOwnProperty,Jxt=ofe.toString,X_=Ah?Ah.toStringTag:void 0;function Yxt(e){var t=Xxt.call(e,X_),r=e[X_];try{e[X_]=void 0;var n=!0}catch{}var i=Jxt.call(e);return n&&(t?e[X_]=r:delete e[X_]),i}var $xt=Object.prototype,e_t=$xt.toString;function t_t(e){return e_t.call(e)}var r_t="[object Null]",n_t="[object Undefined]",afe=Ah?Ah.toStringTag:void 0;function uy(e){return e==null?e===void 0?n_t:r_t:afe&&afe in Object(e)?Yxt(e):t_t(e)}function dy(e){return e!=null&&typeof e=="object"}var i_t="[object Symbol]";function ZH(e){return typeof e=="symbol"||dy(e)&&uy(e)==i_t}function o_t(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var sd=Array.isArray,a_t=1/0,sfe=Ah?Ah.prototype:void 0,lfe=sfe?sfe.toString:void 0;function cfe(e){if(typeof e=="string")return e;if(sd(e))return o_t(e,cfe)+"";if(ZH(e))return lfe?lfe.call(e):"";var t=e+"";return t=="0"&&1/e==-a_t?"-0":t}var s_t=/\s/;function l_t(e){for(var t=e.length;t--&&s_t.test(e.charAt(t)););return t}var c_t=/^\s+/;function u_t(e){return e&&e.slice(0,l_t(e)+1).replace(c_t,"")}function py(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ufe=NaN,d_t=/^[-+]0x[0-9a-f]+$/i,p_t=/^0b[01]+$/i,h_t=/^0o[0-7]+$/i,f_t=parseInt;function DW(e){if(typeof e=="number")return e;if(ZH(e))return ufe;if(py(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=py(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=u_t(e);var r=p_t.test(e);return r||h_t.test(e)?f_t(e.slice(2),r?2:8):d_t.test(e)?ufe:+e}var dfe=1/0,m_t=17976931348623157e292;function g_t(e){if(!e)return e===0?e:0;if(e=DW(e),e===dfe||e===-dfe){var t=e<0?-1:1;return t*m_t}return e===e?e:0}function y_t(e){var t=g_t(e),r=t%1;return t===t?r?t-r:t:0}function T_t(e){return e}var v_t="[object AsyncFunction]",Q_t="[object Function]",b_t="[object GeneratorFunction]",x_t="[object Proxy]";function pfe(e){if(!py(e))return!1;var t=uy(e);return t==Q_t||t==b_t||t==v_t||t==x_t}var zW=ad["__core-js_shared__"],hfe=function(){var e=/[^.]+$/.exec(zW&&zW.keys&&zW.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function __t(e){return!!hfe&&hfe in e}var w_t=Function.prototype,L_t=w_t.toString;function nm(e){if(e!=null){try{return L_t.call(e)}catch{}try{return e+""}catch{}}return""}var S_t=/[\\^$.*+?()[\]{}|]/g,k_t=/^\[object .+?Constructor\]$/,M_t=Function.prototype,C_t=Object.prototype,E_t=M_t.toString,A_t=C_t.hasOwnProperty,O_t=RegExp("^"+E_t.call(A_t).replace(S_t,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function H_t(e){if(!py(e)||__t(e))return!1;var t=pfe(e)?O_t:k_t;return t.test(nm(e))}function V_t(e,t){return e==null?void 0:e[t]}function hy(e,t){var r=V_t(e,t);return H_t(r)?r:void 0}var jW=hy(ad,"WeakMap");function I_t(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var P_t=9007199254740991,N_t=/^(?:0|[1-9]\d*)$/;function ffe(e,t){var r=typeof e;return t=t??P_t,!!t&&(r=="number"||r!="symbol"&&N_t.test(e))&&e>-1&&e%1==0&&e<t}function mfe(e,t){return e===t||e!==e&&t!==t}var B_t=9007199254740991;function UW(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=B_t}function R_t(e){return e!=null&&UW(e.length)&&!pfe(e)}var F_t=Object.prototype;function D_t(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||F_t;return e===r}function z_t(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var j_t="[object Arguments]";function gfe(e){return dy(e)&&uy(e)==j_t}var yfe=Object.prototype,U_t=yfe.hasOwnProperty,G_t=yfe.propertyIsEnumerable,Tfe=gfe(function(){return arguments}())?gfe:function(e){return dy(e)&&U_t.call(e,"callee")&&!G_t.call(e,"callee")};function q_t(){return!1}var vfe=typeof bn=="object"&&bn&&!bn.nodeType&&bn,Qfe=vfe&&typeof module=="object"&&module&&!module.nodeType&&module,W_t=Qfe&&Qfe.exports===vfe,bfe=W_t?ad.Buffer:void 0,Z_t=bfe?bfe.isBuffer:void 0,GW=Z_t||q_t,K_t="[object Arguments]",X_t="[object Array]",J_t="[object Boolean]",Y_t="[object Date]",$_t="[object Error]",ewt="[object Function]",twt="[object Map]",rwt="[object Number]",nwt="[object Object]",iwt="[object RegExp]",owt="[object Set]",awt="[object String]",swt="[object WeakMap]",lwt="[object ArrayBuffer]",cwt="[object DataView]",uwt="[object Float32Array]",dwt="[object Float64Array]",pwt="[object Int8Array]",hwt="[object Int16Array]",fwt="[object Int32Array]",mwt="[object Uint8Array]",gwt="[object Uint8ClampedArray]",ywt="[object Uint16Array]",Twt="[object Uint32Array]",fa={};fa[uwt]=fa[dwt]=fa[pwt]=fa[hwt]=fa[fwt]=fa[mwt]=fa[gwt]=fa[ywt]=fa[Twt]=!0,fa[K_t]=fa[X_t]=fa[lwt]=fa[J_t]=fa[cwt]=fa[Y_t]=fa[$_t]=fa[ewt]=fa[twt]=fa[rwt]=fa[nwt]=fa[iwt]=fa[owt]=fa[awt]=fa[swt]=!1;function vwt(e){return dy(e)&&UW(e.length)&&!!fa[uy(e)]}function Qwt(e){return function(t){return e(t)}}var xfe=typeof bn=="object"&&bn&&!bn.nodeType&&bn,J_=xfe&&typeof module=="object"&&module&&!module.nodeType&&module,bwt=J_&&J_.exports===xfe,qW=bwt&&ife.process,_fe=function(){try{var e=J_&&J_.require&&J_.require("util").types;return e||qW&&qW.binding&&qW.binding("util")}catch{}}(),wfe=_fe&&_fe.isTypedArray,Lfe=wfe?Qwt(wfe):vwt,xwt=Object.prototype,_wt=xwt.hasOwnProperty;function wwt(e,t){var r=sd(e),n=!r&&Tfe(e),i=!r&&!n&&GW(e),o=!r&&!n&&!i&&Lfe(e),s=r||n||i||o,l=s?z_t(e.length,String):[],c=l.length;for(var u in e)(t||_wt.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ffe(u,c)))&&l.push(u);return l}function Lwt(e,t){return function(r){return e(t(r))}}var Swt=Lwt(Object.keys,Object),kwt=Object.prototype,Mwt=kwt.hasOwnProperty;function Cwt(e){if(!D_t(e))return Swt(e);var t=[];for(var r in Object(e))Mwt.call(e,r)&&r!="constructor"&&t.push(r);return t}function Sfe(e){return R_t(e)?wwt(e):Cwt(e)}var Ewt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Awt=/^\w*$/;function WW(e,t){if(sd(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||ZH(e)?!0:Awt.test(e)||!Ewt.test(e)||t!=null&&e in Object(t)}var Y_=hy(Object,"create");function Owt(){this.__data__=Y_?Y_(null):{},this.size=0}function Hwt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Vwt="__lodash_hash_undefined__",Iwt=Object.prototype,Pwt=Iwt.hasOwnProperty;function Nwt(e){var t=this.__data__;if(Y_){var r=t[e];return r===Vwt?void 0:r}return Pwt.call(t,e)?t[e]:void 0}var Bwt=Object.prototype,Rwt=Bwt.hasOwnProperty;function Fwt(e){var t=this.__data__;return Y_?t[e]!==void 0:Rwt.call(t,e)}var Dwt="__lodash_hash_undefined__";function zwt(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Y_&&t===void 0?Dwt:t,this}function im(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}im.prototype.clear=Owt,im.prototype.delete=Hwt,im.prototype.get=Nwt,im.prototype.has=Fwt,im.prototype.set=zwt;function jwt(){this.__data__=[],this.size=0}function KH(e,t){for(var r=e.length;r--;)if(mfe(e[r][0],t))return r;return-1}var Uwt=Array.prototype,Gwt=Uwt.splice;function qwt(e){var t=this.__data__,r=KH(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Gwt.call(t,r,1),--this.size,!0}function Wwt(e){var t=this.__data__,r=KH(t,e);return r<0?void 0:t[r][1]}function Zwt(e){return KH(this.__data__,e)>-1}function Kwt(e,t){var r=this.__data__,n=KH(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function op(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}op.prototype.clear=jwt,op.prototype.delete=qwt,op.prototype.get=Wwt,op.prototype.has=Zwt,op.prototype.set=Kwt;var $_=hy(ad,"Map");function Xwt(){this.size=0,this.__data__={hash:new im,map:new($_||op),string:new im}}function Jwt(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function XH(e,t){var r=e.__data__;return Jwt(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Ywt(e){var t=XH(this,e).delete(e);return this.size-=t?1:0,t}function $wt(e){return XH(this,e).get(e)}function eLt(e){return XH(this,e).has(e)}function tLt(e,t){var r=XH(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function ap(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ap.prototype.clear=Xwt,ap.prototype.delete=Ywt,ap.prototype.get=$wt,ap.prototype.has=eLt,ap.prototype.set=tLt;var rLt="Expected a function";function ZW(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(rLt);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(ZW.Cache||ap),r}ZW.Cache=ap;var nLt=500;function iLt(e){var t=ZW(e,function(n){return r.size===nLt&&r.clear(),n}),r=t.cache;return t}var oLt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aLt=/\\(\\)?/g,sLt=iLt(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(oLt,function(r,n,i,o){t.push(i?o.replace(aLt,"$1"):n||r)}),t});function lLt(e){return e==null?"":cfe(e)}function kfe(e,t){return sd(e)?e:WW(e,t)?[e]:sLt(lLt(e))}var cLt=1/0;function JH(e){if(typeof e=="string"||ZH(e))return e;var t=e+"";return t=="0"&&1/e==-cLt?"-0":t}function Mfe(e,t){t=kfe(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[JH(t[r++])];return r&&r==n?e:void 0}function sp(e,t,r){var n=e==null?void 0:Mfe(e,t);return n===void 0?r:n}function uLt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Cfe(){if(!arguments.length)return[];var e=arguments[0];return sd(e)?e:[e]}function dLt(){this.__data__=new op,this.size=0}function pLt(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function hLt(e){return this.__data__.get(e)}function fLt(e){return this.__data__.has(e)}var mLt=200;function gLt(e,t){var r=this.__data__;if(r instanceof op){var n=r.__data__;if(!$_||n.length<mLt-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ap(n)}return r.set(e,t),this.size=r.size,this}function lp(e){var t=this.__data__=new op(e);this.size=t.size}lp.prototype.clear=dLt,lp.prototype.delete=pLt,lp.prototype.get=hLt,lp.prototype.has=fLt,lp.prototype.set=gLt;function yLt(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function TLt(){return[]}var vLt=Object.prototype,QLt=vLt.propertyIsEnumerable,Efe=Object.getOwnPropertySymbols,bLt=Efe?function(e){return e==null?[]:(e=Object(e),yLt(Efe(e),function(t){return QLt.call(e,t)}))}:TLt;const xLt=bLt;function _Lt(e,t,r){var n=t(e);return sd(e)?n:uLt(n,r(e))}function Afe(e){return _Lt(e,Sfe,xLt)}var KW=hy(ad,"DataView"),XW=hy(ad,"Promise"),JW=hy(ad,"Set"),Ofe="[object Map]",wLt="[object Object]",Hfe="[object Promise]",Vfe="[object Set]",Ife="[object WeakMap]",Pfe="[object DataView]",LLt=nm(KW),SLt=nm($_),kLt=nm(XW),MLt=nm(JW),CLt=nm(jW),om=uy;(KW&&om(new KW(new ArrayBuffer(1)))!=Pfe||$_&&om(new $_)!=Ofe||XW&&om(XW.resolve())!=Hfe||JW&&om(new JW)!=Vfe||jW&&om(new jW)!=Ife)&&(om=function(e){var t=uy(e),r=t==wLt?e.constructor:void 0,n=r?nm(r):"";if(n)switch(n){case LLt:return Pfe;case SLt:return Ofe;case kLt:return Hfe;case MLt:return Vfe;case CLt:return Ife}return t});const Nfe=om;var ELt=ad.Uint8Array;const Bfe=ELt;var ALt="__lodash_hash_undefined__";function OLt(e){return this.__data__.set(e,ALt),this}function HLt(e){return this.__data__.has(e)}function YH(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new ap;++t<r;)this.add(e[t])}YH.prototype.add=YH.prototype.push=OLt,YH.prototype.has=HLt;function VLt(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function ILt(e,t){return e.has(t)}var PLt=1,NLt=2;function Rfe(e,t,r,n,i,o){var s=r&PLt,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var p=-1,h=!0,f=r&NLt?new YH:void 0;for(o.set(e,t),o.set(t,e);++p<l;){var m=e[p],g=t[p];if(n)var T=s?n(g,m,p,t,e,o):n(m,g,p,e,t,o);if(T!==void 0){if(T)continue;h=!1;break}if(f){if(!VLt(t,function(y,v){if(!ILt(f,v)&&(m===y||i(m,y,r,n,o)))return f.push(v)})){h=!1;break}}else if(!(m===g||i(m,g,r,n,o))){h=!1;break}}return o.delete(e),o.delete(t),h}function BLt(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function RLt(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var FLt=1,DLt=2,zLt="[object Boolean]",jLt="[object Date]",ULt="[object Error]",GLt="[object Map]",qLt="[object Number]",WLt="[object RegExp]",ZLt="[object Set]",KLt="[object String]",XLt="[object Symbol]",JLt="[object ArrayBuffer]",YLt="[object DataView]",Ffe=Ah?Ah.prototype:void 0,YW=Ffe?Ffe.valueOf:void 0;function $Lt(e,t,r,n,i,o,s){switch(r){case YLt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case JLt:return!(e.byteLength!=t.byteLength||!o(new Bfe(e),new Bfe(t)));case zLt:case jLt:case qLt:return mfe(+e,+t);case ULt:return e.name==t.name&&e.message==t.message;case WLt:case KLt:return e==t+"";case GLt:var l=BLt;case ZLt:var c=n&FLt;if(l||(l=RLt),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=DLt,s.set(e,t);var d=Rfe(l(e),l(t),n,i,o,s);return s.delete(e),d;case XLt:if(YW)return YW.call(e)==YW.call(t)}return!1}var eSt=1,tSt=Object.prototype,rSt=tSt.hasOwnProperty;function nSt(e,t,r,n,i,o){var s=r&eSt,l=Afe(e),c=l.length,u=Afe(t),d=u.length;if(c!=d&&!s)return!1;for(var p=c;p--;){var h=l[p];if(!(s?h in t:rSt.call(t,h)))return!1}var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var g=!0;o.set(e,t),o.set(t,e);for(var T=s;++p<c;){h=l[p];var y=e[h],v=t[h];if(n)var _=s?n(v,y,h,t,e,o):n(y,v,h,e,t,o);if(!(_===void 0?y===v||i(y,v,r,n,o):_)){g=!1;break}T||(T=h=="constructor")}if(g&&!T){var b=e.constructor,L=t.constructor;b!=L&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof L=="function"&&L instanceof L)&&(g=!1)}return o.delete(e),o.delete(t),g}var iSt=1,Dfe="[object Arguments]",zfe="[object Array]",$H="[object Object]",oSt=Object.prototype,jfe=oSt.hasOwnProperty;function aSt(e,t,r,n,i,o){var s=sd(e),l=sd(t),c=s?zfe:Nfe(e),u=l?zfe:Nfe(t);c=c==Dfe?$H:c,u=u==Dfe?$H:u;var d=c==$H,p=u==$H,h=c==u;if(h&&GW(e)){if(!GW(t))return!1;s=!0,d=!1}if(h&&!d)return o||(o=new lp),s||Lfe(e)?Rfe(e,t,r,n,i,o):$Lt(e,t,c,r,n,i,o);if(!(r&iSt)){var f=d&&jfe.call(e,"__wrapped__"),m=p&&jfe.call(t,"__wrapped__");if(f||m){var g=f?e.value():e,T=m?t.value():t;return o||(o=new lp),i(g,T,r,n,o)}}return h?(o||(o=new lp),nSt(e,t,r,n,i,o)):!1}function eV(e,t,r,n,i){return e===t?!0:e==null||t==null||!dy(e)&&!dy(t)?e!==e&&t!==t:aSt(e,t,r,n,eV,i)}var sSt=1,lSt=2;function cSt(e,t,r,n){var i=r.length,o=i,s=!n;if(e==null)return!o;for(e=Object(e);i--;){var l=r[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<o;){l=r[i];var c=l[0],u=e[c],d=l[1];if(s&&l[2]){if(u===void 0&&!(c in e))return!1}else{var p=new lp;if(n)var h=n(u,d,c,e,t,p);if(!(h===void 0?eV(d,u,sSt|lSt,n,p):h))return!1}}return!0}function Ufe(e){return e===e&&!py(e)}function uSt(e){for(var t=Sfe(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ufe(i)]}return t}function Gfe(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function dSt(e){var t=uSt(e);return t.length==1&&t[0][2]?Gfe(t[0][0],t[0][1]):function(r){return r===e||cSt(r,e,t)}}function pSt(e,t){return e!=null&&t in Object(e)}function hSt(e,t,r){t=kfe(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var s=JH(t[n]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&UW(i)&&ffe(s,i)&&(sd(e)||Tfe(e)))}function fSt(e,t){return e!=null&&hSt(e,t,pSt)}var mSt=1,gSt=2;function ySt(e,t){return WW(e)&&Ufe(t)?Gfe(JH(e),t):function(r){var n=sp(r,e);return n===void 0&&n===t?fSt(r,e):eV(t,n,mSt|gSt)}}function TSt(e){return function(t){return t==null?void 0:t[e]}}function vSt(e){return function(t){return Mfe(t,e)}}function QSt(e){return WW(e)?TSt(JH(e)):vSt(e)}function bSt(e){return typeof e=="function"?e:e==null?T_t:typeof e=="object"?sd(e)?ySt(e[0],e[1]):dSt(e):QSt(e)}var $W=function(){return ad.Date.now()},xSt="Expected a function",_St=Math.max,wSt=Math.min;function LSt(e,t,r){var n,i,o,s,l,c,u=0,d=!1,p=!1,h=!0;if(typeof e!="function")throw new TypeError(xSt);t=DW(t)||0,py(r)&&(d=!!r.leading,p="maxWait"in r,o=p?_St(DW(r.maxWait)||0,t):o,h="trailing"in r?!!r.trailing:h);function f(w){var k=n,C=i;return n=i=void 0,u=w,s=e.apply(C,k),s}function m(w){return u=w,l=setTimeout(y,t),d?f(w):s}function g(w){var k=w-c,C=w-u,A=t-k;return p?wSt(A,o-C):A}function T(w){var k=w-c,C=w-u;return c===void 0||k>=t||k<0||p&&C>=o}function y(){var w=$W();if(T(w))return v(w);l=setTimeout(y,g(w))}function v(w){return l=void 0,h&&n?f(w):(n=i=void 0,s)}function _(){l!==void 0&&clearTimeout(l),u=0,n=c=i=l=void 0}function b(){return l===void 0?s:v($W())}function L(){var w=$W(),k=T(w);if(n=arguments,i=this,c=w,k){if(l===void 0)return m(c);if(p)return clearTimeout(l),l=setTimeout(y,t),f(c)}return l===void 0&&(l=setTimeout(y,t)),s}return L.cancel=_,L.flush=b,L}var SSt=Math.max,kSt=Math.min;function MSt(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=n-1;return r!==void 0&&(i=y_t(r),i=r<0?SSt(n+i,0):kSt(i,n-1)),I_t(e,bSt(t),i,!0)}function tV(e){for(var t=-1,r=e==null?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n}function ew(e,t){return eV(e,t)}function rV(e){return e==null}function CSt(e){return e===void 0}const qfe=e=>e===void 0,eZ=e=>typeof e=="boolean",V1=e=>typeof e=="number",tw=e=>typeof Element>"u"?!1:e instanceof Element,ESt=e=>od(e)?!Number.isNaN(Number(e)):!1,ASt=(e="")=>e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d");let Wfe=class extends Error{constructor(t){super(t),this.name="ElementPlusError"}};function OSt(e,t){throw new Wfe(`[${e}] ${t}`)}function h0(e,t){if(ly.env.NODE_ENV!=="production"){const r=od(e)?new Wfe(`[${e}] ${t}`):e;console.warn(r)}}const HSt="utils/dom/style";function nV(e,t="px"){if(!e)return"";if(V1(e)||ESt(e))return`${e}${t}`;if(od(e))return e;h0(HSt,"binding value must be a string or number")}function VSt(e,t){if(!Ec)return;if(!t){e.scrollTop=0;return}const r=[];let n=t.offsetParent;for(;n!==null&&e!==n&&e.contains(n);)r.push(n),n=n.offsetParent;const i=t.offsetTop+r.reduce((c,u)=>c+u.offsetTop,0),o=i+t.offsetHeight,s=e.scrollTop,l=s+e.clientHeight;i<s?e.scrollTop=i:o>l&&(e.scrollTop=o-e.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var ISt=a.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),PSt=ISt,NSt=a.defineComponent({name:"ArrowRight",__name:"arrow-right",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),BSt=NSt,RSt=a.defineComponent({name:"CircleCheck",__name:"circle-check",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),a.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),FSt=RSt,DSt=a.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),tZ=DSt,zSt=a.defineComponent({name:"Close",__name:"close",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Zfe=zSt,jSt=a.defineComponent({name:"Hide",__name:"hide",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),a.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),USt=jSt,GSt=a.defineComponent({name:"Loading",__name:"loading",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),Kfe=GSt,qSt=a.defineComponent({name:"View",__name:"view",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),WSt=qSt;const Xfe="__epPropKey",ki=e=>e,ZSt=e=>p0(e)&&!!e[Xfe],iV=(e,t)=>{if(!p0(e)||ZSt(e))return e;const{values:r,required:n,default:i,type:o,validator:s}=e,l={type:o,required:!!n,validator:r||s?c=>{let u=!1,d=[];if(r&&(d=Array.from(r),nfe(e,"default")&&d.push(i),u||(u=d.includes(c))),s&&(u||(u=s(c))),!u&&d.length>0){const p=[...new Set(d)].map(h=>JSON.stringify(h)).join(", ");a.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${p}], got value ${JSON.stringify(c)}.`)}return u}:void 0,[Xfe]:!0};return nfe(e,"default")&&(l.default=i),l},Na=e=>tV(Object.entries(e).map(([t,r])=>[t,iV(r,t)])),am=ki([String,Object,Function]),Jfe={validating:Kfe,success:FSt,error:tZ},ld=(e,t)=>{if(e.install=r=>{for(const n of[e,...Object.values(t??{})])r.component(n.name,n)},t)for(const[r,n]of Object.entries(t))e[r]=n;return e},KSt=(e,t)=>(e.install=r=>{r.directive(t,e)},e),oV=e=>(e.install=K_,e),rw={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},x2="update:modelValue",aV="change",Yfe=["","default","small","large"],$fe=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e),e8e=e=>e,XSt=["class","style"],JSt=/^on[A-Z]/,YSt=(e={})=>{const{excludeListeners:t=!1,excludeKeys:r}=e,n=a.computed(()=>((r==null?void 0:r.value)||[]).concat(XSt)),i=a.getCurrentInstance();return i?a.computed(()=>{var o;return tV(Object.entries((o=i.proxy)==null?void 0:o.$attrs).filter(([s])=>!n.value.includes(s)&&!(t&&JSt.test(s))))}):(h0("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),a.computed(()=>({})))},t8e=({from:e,replacement:t,scope:r,version:n,ref:i,type:o="API"},s)=>{a.watch(()=>a.unref(s),l=>{l&&h0(r,`[${o}] ${e} is about to be deprecated in version ${n}, please use ${t} instead.
1085
+ `)}</div>`)}this.__activateFeature(f),this.__activateRelatedFeatures(f),"hyperlink"in f.properties&&(this._map.getCanvas().style.cursor="pointer")}}s!==""&&this._infoControl.show(s),this.__showToolTip(l,t.lngLat,u)}__showToolTip(t,r,n=null){if(t!==""||this._flatmap.options.showId&&n!==null){let i="";if(this._flatmap.options.showPosition){const o=Zde(r.toArray()),s=eht(o).geometry.coordinates;i=n===null?JSON.stringify(s):`${JSON.stringify(s)} (${n.id})`}this._flatmap.options.showId&&n!==null&&"id"in n.properties&&(i=`${i} ${n.properties.id}`),i!==""&&(t=`<span>${i}</span><br/>${t}`),t!==""&&(this._tooltip=new $c.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-tooltip-popup"}),this._tooltip.setLngLat(r).setHTML(t).addTo(this._map))}}selectionEvent_(t,r){if(r!==void 0){const n=r.id,i=!("properties"in r&&"kind"in r.properties&&["cell-type","scaffold","tissue"].includes(r.properties.kind));if(t.ctrlKey||t.metaKey){const o=this.featureSelected_(n);for(const s of this._activeFeatures)o?this.unselectFeature(s.id):this.selectFeature(s.id,i)}else{let o=!0;for(const s of this._selectedFeatureIds.keys())if(s===n){o=!1;break}if(this.unselectFeatures(),o)for(const s of this._activeFeatures)this.selectFeature(s.id,i)}}}clickEvent_(t){if(this._modal)return;this.__clearActiveMarker();const r=this._map.queryRenderedFeatures(t.point).filter(i=>this.__featureEnabled(i));if(r.length==0){this.unselectFeatures();return}const n=r[0];this.selectionEvent_(t.originalEvent,n),this._modal?(this.__resetFeatureDisplay(),this.unselectFeatures(),this.__clearModal()):n!==void 0&&(this.__lastClickLngLat=t.lngLat,this.__featureEvent("click",n),"properties"in n&&"hyperlink"in n.properties&&window.open(n.properties.hyperlink,"_blank"))}__activateRelatedFeatures(t){if("nerveId"in t.properties){const r=t.properties.nerveId;r!==t.id&&this.__activateFeature(this.mapFeature(r));for(const n of this.__pathManager.nerveFeatureIds(r))this.__activateFeature(this.mapFeature(n))}if("nodeId"in t.properties)for(const r of this.__pathManager.pathFeatureIds(t.properties.nodeId))this.__activateFeature(this.mapFeature(r))}enablePath(t,r=!0){this.__pathManager.enablePath(t,r)}enablePathsBySystem(t,r=!0,n=!1){this.__pathManager.enablePathsBySystem(t,r,n)}enablePathsByType(t,r=!0){this.__pathManager.enablePathsByType(t,r)}pathFeatureIds(t){const r=new a4e;return r.extend(this.__pathManager.connectivityModelFeatureIds(t)),r.extend(this.__pathManager.pathModelFeatureIds(t)),r}pathModelNodes(t){return this.__pathManager.pathModelNodes(t)}nodePathModels(t){return this.__pathManager.nodePathModels(t)}enableCentrelines(t=!0,r=!1){this.__pathManager.enablePathsByType("centreline",t,r),this._layerManager.setPaint({showCentrelines:t})}enableSckanPaths(t,r=!0){this._layerManager.enableSckanPaths(t,r)}enableConnectivityByTaxonIds(t,r=!0){if(r)for(const n of t)this.__enabledConnectivityTaxons.add(n);else for(const n of t)this.__enabledConnectivityTaxons.delete(n);this._layerManager.setFilter({taxons:[...this.__enabledConnectivityTaxons.values()]})}excludeAnnotated(t=!1){this._layerManager.setPaint({excludeAnnotated:t})}__markerPosition(t,r){if(this.__markerPositions.has(t))return this.__markerPositions.get(t);let n=r.markerPosition||r.centroid;if(n===null||n==null){const i=this._map.querySourceFeatures(uG,{sourceLayer:this._flatmap.options.separateLayers?`${r.layer}_${r["tile-layer"]}`:r["tile-layer"],filter:["all",["==",["id"],parseInt(t)],["==",["geometry-type"],"Polygon"]]});i.length>0&&(n=Tbt(i[0]))}return this.__markerPositions.set(t,n),n}addMarker(t,r={}){const n=this._flatmap.modelFeatureIds(t);let i=-1;for(const o of n){const s=this._flatmap.annotation(o);if(!(!("markerPosition"in s)&&!s.geometry.includes("Polygon"))&&!("marker"in s)){i===-1&&(this.__lastMarkerId+=1,i=this.__lastMarkerId);const l=r.colour||"#005974",c=r.element?new $c.Marker({element:r.element}):new $c.Marker({color:l,scale:.5}),u=document.createElement("div"),d=document.createElement("div");d.innerHTML=c.getElement().innerHTML,u.id=`marker-${i}`,u.appendChild(d);const p={element:u};"className"in r&&(p.className=r.className);const h=this.__markerPosition(o,s),f=new $c.Marker(p).setLngLat(h).addTo(this._map);u.addEventListener("mouseenter",this.markerMouseEvent_.bind(this,f,t)),u.addEventListener("mousemove",this.markerMouseEvent_.bind(this,f,t)),u.addEventListener("mouseleave",this.markerMouseEvent_.bind(this,f,t)),u.addEventListener("click",this.markerMouseEvent_.bind(this,f,t)),this.__markerIdByMarker.set(f,i),this.__markerIdByFeatureId.set(+o,i),this.__annotationByMarkerId.set(i,s),this.__featureEnabled(this.mapFeature(+o))||(u.style.visibility="hidden")}}return i===-1&&console.warn(`Unable to find feature '${t}' on which to place marker`),i}clearMarkers(){for(const t of this.__markerIdByMarker.keys())t.remove();this.__markerIdByMarker.clear(),this.__annotationByMarkerId.clear()}removeMarker(t){for(const[r,n]of this.__markerIdByMarker.entries())if(t===n){r.remove(),this.__markerIdByMarker.remove(r),this.__annotationByMarkerId.remove(n);break}}visibleMarkerAnatomicalIds(){const t=[],r=this._map.getBounds();for(const[n,i]of this.__markerIdByMarker.entries())if(r.contains(n.getLngLat())){const o=this.__annotationByMarkerId.get(i);t.includes(o.models)||t.push(o.models)}return t}markerMouseEvent_(t,r,n){if(!(this._modal||this.__activeMarker!==null&&n.type==="mouseleave")){if(["mouseenter","mouseleave","click"].includes(n.type)&&(this.__activeMarker=t,this.removeTooltip_(),t.setPopup(null),t.getElement().style.cursor="default",["mouseenter","click"].includes(n.type))){const i=this.__markerIdByMarker.get(t),o=this.__annotationByMarkerId.get(i),s=this.mapFeature(o.featureId);s!==void 0&&(n.type==="mouseenter"?(this.resetActiveFeatures_(),this.__activateFeature(s)):this.selectionEvent_(n,s));const l=this.tooltipHtml_(o,!0);this.__showToolTip(l,t.getLngLat()),this._flatmap.markerEvent(n.type,i,r)}n.stopPropagation()}}__clearActiveMarker(){this.__activeMarker!==null&&(this.__activeMarker.setPopup(null),this.__activeMarker=null)}showMarkerPopup(t,r,n){const i=this.__activeMarker;if(t!==this.__markerIdByMarker.get(i))return this.__clearActiveMarker(),!1;const o=i.getLngLat();this._map.getBounds().contains(o)||this._map.panTo(o);const s=document.createElement("div");return typeof r=="object"?s.appendChild(r):s.innerHTML=r,s.addEventListener("click",l=>this.__clearActiveMarker()),this._tooltip=new $c.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none",className:"flatmap-marker-popup"}),this._tooltip.setLngLat(o).setDOMContent(s),i.setPopup(this._tooltip),i.togglePopup(),!0}enablePanZoomEvents(t=!0){this.__pan_zoom_enabled=t}panZoomEvent_(t){this.__pan_zoom_enabled&&this._flatmap.panZoomEvent(t)}};const I5e={fillColor:"#DDD",fillOpacity:.3,lineColor:"#08F",lineOpacity:1,lineWidth:1,position:"bottom-left",width:320},bbt=[[18,14,16],[16,12,14],[14,10,12],[12,8,10],[10,6,8]];let xbt=class{constructor(t,r){this._flatmap=t,this._map=void 0,this._container=null,this._background=null,this._opacity=null,this._loaded=!1,this._options=Object.assign({},I5e),typeof r=="object"&&("position"in r&&(this._options.position=r.position),"width"in r&&(this._options.width=r.width)),this._ticking=!1,this._lastMouseMoveEvent=null,this._isDragging=!1,this._isCursorOverFeature=!1,this._previousPoint=[0,0],this._currentPoint=[0,0],this._trackingRectCoordinates=[[[],[],[],[],[]]]}getDefaultPosition(){return this._options.position}onAdd(t){this._map=t;const r=document.createElement("div");r.className="maplibregl-ctrl-minimap maplibregl-ctrl",r.id="maplibre-minimap",this._container=r;const n=t.getCanvas();let i=I5e.width;return typeof this._options.width=="string"?(i=parseInt(this._options.width),this._options.width.includes("%")&&(i=i*n.width/100)):typeof this._options.width=="number"&&(i=this._options.width),r.setAttribute("style",`width: ${i}px; height: ${i*n.height/n.width}px;`),r.addEventListener("contextmenu",this._preventDefault),this._miniMap=new $c.Map({attributionControl:!1,container:r,style:t.getStyle(),bounds:t.getBounds()}),this._miniMap.on("load",this.load_.bind(this)),this._container}onRemove(){this._container.parentNode.removeChild(this._container),this._map=void 0,this._container=null}load_(){const t=this._options,r=this._map,n=this._miniMap;["dragPan","scrollZoom","boxZoom","dragRotate","keyboard","doubleClickZoom","touchZoomRotate"].forEach(o=>n[o].disable()),this._background!==null&&n.setPaintProperty("background","background-color",this._background),this._opacity!==null&&n.setPaintProperty("background","background-opacity",this._opacity),n.resize(),n.fitBounds(this._flatmap.bounds);const i=n.getBounds();this.convertBoundsToPoints_(i),n.addSource("trackingRect",{type:"geojson",data:{type:"Feature",properties:{name:"trackingRect"},geometry:{type:"Polygon",coordinates:this._trackingRectCoordinates}}}),n.addLayer({id:"trackingRectOutline",type:"line",source:"trackingRect",layout:{},paint:{"line-color":t.lineColor,"line-width":t.lineWidth,"line-opacity":t.lineOpacity}}),n.addLayer({id:"trackingRectFill",type:"fill",source:"trackingRect",layout:{},paint:{"fill-color":t.fillColor,"fill-opacity":t.fillOpacity}}),this._trackingRect=this._miniMap.getSource("trackingRect"),this.update_(),r.on("move",this.update_.bind(this)),n.on("mousemove",this.mouseMove_.bind(this)),n.on("mousedown",this.mouseDown_.bind(this)),n.on("mouseup",this.mouseUp_.bind(this)),n.on("touchmove",this.mouseMove_.bind(this)),n.on("touchstart",this.mouseDown_.bind(this)),n.on("touchend",this.mouseUp_.bind(this)),this._miniMapCanvas=n.getCanvasContainer(),this._miniMapCanvas.addEventListener("wheel",this.preventDefault_),this._miniMapCanvas.addEventListener("mousewheel",this.preventDefault_)}mouseDown_(t){this._isCursorOverFeature&&(this._isDragging=!0,this._previousPoint=this._currentPoint,this._currentPoint=[t.lngLat.lng,t.lngLat.lat])}mouseMove_(t){this._ticking=!1;const r=this._miniMap.queryRenderedFeatures(t.point,{layers:["trackingRectFill"]});if(this._isCursorOverFeature&&r.length>0||(this._isCursorOverFeature=r.length>0,this._miniMapCanvas.style.cursor=this._isCursorOverFeature?"move":""),this._isDragging){this._previousPoint=this._currentPoint,this._currentPoint=[t.lngLat.lng,t.lngLat.lat];const n=[this._previousPoint[0]-this._currentPoint[0],this._previousPoint[1]-this._currentPoint[1]],i=this.moveTrackingRect_(n);this._map.fitBounds(i,{duration:80,noMoveStart:!0})}}mouseUp_(){this._isDragging=!1,this._ticking=!1}moveTrackingRect_(t){const r=this._trackingRect,n=r._data,i=n.properties.bounds;return i._ne.lat-=t[1],i._ne.lng-=t[0],i._sw.lat-=t[1],i._sw.lng-=t[0],this.convertBoundsToPoints_(i),r.setData(n),i}setTrackingRectBounds_(t){const r=this._trackingRect,n=r._data;n.properties.bounds=t,this.convertBoundsToPoints_(t),r.setData(n)}convertBoundsToPoints_(t){const r=t._ne,n=t._sw,i=this._trackingRectCoordinates;i[0][0][0]=r.lng,i[0][0][1]=r.lat,i[0][1][0]=n.lng,i[0][1][1]=r.lat,i[0][2][0]=n.lng,i[0][2][1]=n.lat,i[0][3][0]=r.lng,i[0][3][1]=n.lat,i[0][4][0]=r.lng,i[0][4][1]=r.lat}update_(t){if(this._isDragging)return;const r=this._map.getBounds();this.setTrackingRectBounds_(r),this.zoomAdjust_()}zoomAdjust_(){const t=this._miniMap,r=this._map,n=parseInt(t.getZoom(),10),i=parseInt(r.getZoom(),10);let o=!1;bbt.forEach(function(s){!o&&i>=s[0]&&(n>=s[1]&&t.setZoom(s[2]),t.setCenter(r.getCenter()),o=!0)})}preventDefault_(t){t.preventDefault()}setBackgroundColour(t){this._loaded?this._miniMap.setPaintProperty("background","background-color",t):this._background=t}setBackgroundOpacity(t){this._loaded?this._miniMap.setPaintProperty("background","background-opacity",t):this._opacity=t}show(t){this._container&&(t?(this._container.style.display="block",this.update_()):this._container.style.display="none")}};const _bt=[{id:"label-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAAmCAIAAADbSlUzAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAACVSURBVFhH7dixDoJAEIThfXqMBcYKrTQ+jkYSStDYkVhZINxyEshJcZXJtC7FfNlmur9eyXb7Vqf6+bI9HUKyWkt5e4RlOF9ycerjsqbqpfefuKzNJawBWIOxBmMNxhqMNRhrMNZgrMFYg7EGYw3GGow1GGuw5dU07y4ua22nUlb3uKxd80IOx1Pjxp+f4P/P+ZButl+YrbXnPs+YmAAAAABJRU5ErkJggg==",options:{content:[21,4,28,33],stretchX:[[21,28]],stretchY:[[4,33]]}},{id:"xlabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJExO2pF7NAAAAqUlEQVQ4y+3OIQ6CYBiH8ef9MDhxc8yABjeP4LwAx3BWTwE3oHkMrBa7JJN3YBogfQkjr0HcDCg0C0/+7f2/AjghycLFj0ECYMarHPRcUoQx25uEJMsR/lUQj4YUtQ+K9aC+1IgABPFc/NjUcy1JYD5++tXM0LEe9rCHPfwXzDu43ChV2qaUKjWWLFLUfkdqLVnkXDiWK4LDkMlckCkwfs8p1cmSbfbs7k+jIi/gASaPYQAAAABJRU5ErkJggg==",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"ylabel-background",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAmCAYAAAD9XArwAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TSotUROwg4pChioIFURFHrUIRKoRaoVUHk0s/hCYNSYqLo+BacPBjserg4qyrg6sgCH6AODk6KbpIif9LCi1iPTjux7t7j7t3gFArMc0KjAGabpupRFzMZFfE4CsC6EEIIxiWmWXMSlISbcfXPXx8vYvxrPbn/hxdas5igE8knmGGaROvE09t2gbnfeIIK8oq8TnxqEkXJH7kuuLxG+eCywLPjJjp1BxxhFgstLDSwqxoasSTxFFV0ylfyHisct7irJUqrHFP/sJwTl9e4jrNASSwgEVIEKGggg2UYCNGq06KhRTtx9v4+12/RC6FXBtg5JhHGRpk1w/+B7+7tfIT415SOA50vDjOxyAQ3AXqVcf5Pnac+gngfwau9Ka/XAOmP0mvNrXoEdC9DVxcNzVlD7jcAfqeDNmUXclPU8jngfcz+qYs0HsLdK56vTX2cfoApKmr5A1wcAgMFSh7rc27Q629/Xum0d8PfM1yq13h+DEAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfkBBEJEyeXEKp4AAAAwklEQVQ4y+3ULU/DUBhA4XO/2rUgwV1ZBWLJBP9fI0gQuMktWcJSwUq79n68qAoSGnCYHv3oowBD09jz88t1CpGcBQCtFYWz3D3tNuz3EXgojqdWLt0gKWWZSynLpRvkeGqFpinVuf2QsnDc3mz4qe7zyjgF9BQidVWyVF2VTCGicxa0VotQa0XOguaPrXCFK1zhv8D5VkvNt9POGvphXIT9MOKsAbyvfl2z95UCCrw3769vfYjp2+ydNdxvH2sOh/QFh8F7PWWiL5EAAAAASUVORK5CYII=",options:{content:[4,4,5,33],stretchX:[[4,5]],stretchY:[[4,33]]}},{id:"rounded-rectangle",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGmSURBVDiNldPBitpAGAfwv5mMmy85JCistD5Ai/gCPYovYJENCPZQF8VD36HXUkrfQws9R8WLF58gh2h2W2PpoeTWxBgzMr1spd3uUvOHOQ2//3yHb4C/UyGi95Zl3XLOUwASgFRVNTVN8ysRfQTwFA+FMdYhoqjf7+9ns5kMgkCGYSjDMJTb7VbO53M5HA4PRBRzzl//g8vlcrxYLE7osbNcLmWlUok459cAULgb+2YymRi1Wu3B6e7H9300Go1dkiTPGRG97Xa7LzqdjnqWBlAqlRBFEVzXNZRisXhl2/bFufh3bNvmAF4WOOd73/cvDMPIVSCEQLVaFUqWZbkxAKiqCsaYVHLLe1E452kcx7mhEALH47Gg6Lr+3fO83AXr9Rq6rofK4XD4NB6P07wFo9Eok1J+LgC41DTt1nEco16vn4VXqxWazeYuSZJnCoAfWZZdt9vtneu6/8We56HVasVCiDcAvp0uGGM2Ef3s9Xp7x3HkZrM57X8QBHI6ncrBYJASUcQYe/XYA5eapr2zLOuGc77H3XfmnKemaX4hog8AnvwJfgHMKs1jQ++4tQAAAABJRU5ErkJggg==",options:{content:[3,3,13,13],stretchX:[[7,9]],stretchY:[[7,9]]}}],wbt=1.4,P5e="NCBITaxon:2787823";let Lbt=class{constructor(t,r,n,i){this._baseUrl=r,this.__id=n.id,this.__uuid=n.uuid,this.__details=n.details,this.__provenance=n.provenance,this.__created=n.created,this.__taxon=n.taxon,this.__biologicalSex=n.biologicalSex,this._mapNumber=n.number,this._callback=n.callback,this._layers=n.layers,this._markers=n.markers,this._options=n.options,this._pathways=n.pathways,this._resolve=i,this._map=null,this.__searchIndex=new F6t(this),this.__idToAnnotation=new Map,this.__datasetToFeatureIds=new Map,this.__modelToFeatureIds=new Map,this.__mapSourceToFeatureIds=new Map,this.__annIdToFeatureId=new Map,this.__taxonToFeatureIds=new Map;for(const[s,l]of Object.entries(n.annotations))this.__addAnnotation(s,l),this.__searchIndex.indexMetadata(s,l);for(const[s,l]of Object.entries(n.style.sources))if(l.url&&(l.url=this.makeServerUrl(l.url)),l.tiles){const c=[];for(const u of l.tiles)c.push(this.makeServerUrl(u));l.tiles=c}"images"in n.options||(n.options.images=[]);for(const s of _bt){let l=!1;for(const c of n.options.images)if(s.id===c.id){l=!0;break}l||n.options.images.push(s)}const o={style:n.style,container:t,attributionControl:!1};if("maxZoom"in n.options&&(o.maxZoom=n.options.maxZoom),"minZoom"in n.options&&(o.minZoom=n.options.minZoom),o.hash=n.options.debug===!0,this._map=new $c.Map(o),n.options.debug===!0&&(this._map.showTileBoundaries=!0),this._map.setRenderWorldCopies(!1),n.options.fullscreenControl===!0&&this._map.addControl(new $c.FullscreenControl,"top-right"),this._map.dragRotate.disable(),this._map.touchZoomRotate.disableRotation(),n.options.navigationControl){const s=n.options.navigationControl,l=typeof s=="string"&&["top-left","top-right","bottom-right","bottom-left"].includes(s)?s:"bottom-right";this._map.addControl(new jht(this),l)}this._userInteractions=null,this._initialState=null,this._minimap=null,this._map.on("idle",()=>{if(this._userInteractions===null)this.setupUserInteractions_();else if(this._initialState===null){this._map.setMinZoom(3),this._map.setMaxBounds(null),this._map.setRenderWorldCopies(!0),this._bounds=this._map.getBounds();const s=this._bounds.toArray(),l=$c.MercatorCoordinate.fromLngLat(s[0]),c=$c.MercatorCoordinate.fromLngLat(s[1]);this.__normalised_origin=[l.x,c.y],this.__normalised_size=[c.x-l.x,l.y-c.y],"state"in this._options&&this._userInteractions.setState(this._options.state),this._initialState=this.getState(),this.options.minimap&&(this._minimap=new xbt(this,this.options.minimap),this._map.addControl(this._minimap)),this._resolve(this)}})}async setupUserInteractions_(){for(const t of this._options.images)await this.addImage(t.id,t.url,"",t.options);this._userInteractions=new Qbt(this)}get bounds(){return this._bounds}resetMap(){this._initialState!==null&&this.setState(this._initialState),this._userInteractions!==null&&this._userInteractions.reset()}zoomIn(){this._map.zoomIn()}zoomOut(){this._map.zoomOut()}pathTypes(){if(this._userInteractions!==null)return this._userInteractions.pathManager.pathTypes()}enablePath(t,r=!0){this._userInteractions!==null&&this._userInteractions.enablePathsByType(t,r)}enableSckanPath(t,r=!0){this._userInteractions!==null&&this._userInteractions.enableSckanPaths(t,r)}enableConnectivityByTaxonIds(t,r=!0){this._userInteractions!==null&&(Array.isArray(t)?this._userInteractions.enableConnectivityByTaxonIds(t,r):this._userInteractions.enableConnectivityByTaxonIds([t],r))}enableCentrelines(t=!0){this._userInteractions!==null&&this._userInteractions.enableCentrelines(t)}loadImage_(t){return new Promise((r,n)=>{this._map.loadImage(t,(i,o)=>{i?n(i):r(o)})})}loadEncodedImage_(t){return new Promise((r,n)=>{const i=new Image;i.src=t,i.onload=o=>r(o.target)})}async addImage(t,r,n,i={}){if(!this._map.hasImage(t)){const o=await(r.startsWith("data:image")?this.loadEncodedImage_(r):this.loadImage_(r.startsWith("/")?this.makeServerUrl(r):new URL(r,n)));this._map.addImage(t,o,i)}}makeServerUrl(t,r="flatmap/"){return t.startsWith("http://")||t.startsWith("https://")?t:t.startsWith("/")?`${this._baseUrl}${r}${this.__uuid}${t}`:`${this._baseUrl}${r}${this.__uuid}/${t}`}get taxon(){return this.__taxon}get biologicalSex(){return this.__biologicalSex}get created(){return this.__created}get id(){return this.__id}get uuid(){return this.__uuid}get details(){return this.__details}get provenance(){return this.__provenance}get uniqueId(){return`${this.__uuid}-${this._mapNumber}`}get annotations(){return this.__idToAnnotation}annotation(t){return this.__idToAnnotation.get(t.toString())}setFeatureAnnotated(t){this._userInteractions!==null&&this._userInteractions.setFeatureAnnotated(t)}__updateFeatureIdMapEntry(t,r,n){const i=lG(t),o=r.get(i);o?o.push(n):r.set(i,[n])}__updateFeatureIdMap(t,r,n,i=null){if(t in n&&n[t].length){const o=n[t];if(Array.isArray(o))for(const s of o)this.__updateFeatureIdMapEntry(s,r,n.featureId);else this.__updateFeatureIdMapEntry(o,r,n.featureId)}else i!==null&&"models"in n&&n.models.startsWith(pht)&&this.__updateFeatureIdMapEntry(i,r,n.featureId)}__addAnnotation(t,r){r.featureId=t,this.__idToAnnotation.set(t,r),this.__updateFeatureIdMap("dataset",this.__datasetToFeatureIds,r),this.__updateFeatureIdMap("models",this.__modelToFeatureIds,r),this.__updateFeatureIdMap("source",this.__mapSourceToFeatureIds,r),this.__updateFeatureIdMap("taxons",this.__taxonToFeatureIds,r,P5e),this.__annIdToFeatureId.set(r.id,t)}modelFeatureIds(t){return this.__modelToFeatureIds.get(lG(t))||[]}modelFeatureIdList(t){const r=new a4e;if(Array.isArray(t))for(const n of t)r.extend(this.modelFeatureIds(n));else r.extend(this.modelFeatureIds(t));return r.length==0&&(r.extend(this.__datasetToFeatureIds.get(t)),r.extend(this.__mapSourceToFeatureIds.get(t))),r.length==0&&this._userInteractions!==null&&r.extend(this._userInteractions.pathFeatureIds(t)),r}modelForFeature(t){const r=this.__idToAnnotation.get(t);return r&&"models"in r?lG(r.models):null}nodePathModels(t){if(this._userInteractions!==null)return this._userInteractions.nodePathModels(t)}pathModelNodes(t){if(this._userInteractions!==null)return this._userInteractions.pathModelNodes(t)}get layers(){return this._layers}get map(){return this._map}get markers(){return this._markers}get anatomicalIdentifiers(){return[...this.__modelToFeatureIds.keys()]}get taxonIdentifiers(){return[...this.__taxonToFeatureIds.keys()]}get datasets(){return[...this.__datasetToFeatureIds.keys()]}get options(){return this._options}get pathways(){return this._pathways}getZoom(){return{mapUUID:this.__uuid,minZoom:this._map.getMinZoom(),zoom:this._map.getZoom(),maxZoom:this._map.getMaxZoom()}}callback(t,r,...n){if(this._callback)return r.mapUUID=this.__uuid,this._callback(t,r,...n)}setInitialPosition(){"bounds"in this._options&&this._map.fitBounds(this._options.bounds,{animate:!1}),"center"in this._options&&this._map.setCenter(this._options.center),"zoom"in this._options&&this._map.setZoom(this._options.zoom)}close(){this._map&&(this._map.remove(),this._map=null)}resize(){this._map.resize()}getIdentifier(){return{taxon:this.__taxon,biologicalSex:this.__biologicalSex,uuid:this.__uuid}}getState(){return this._userInteractions!==null?this._userInteractions.getState():{}}setState(t){this._userInteractions!==null&&this._userInteractions.setState(t)}showPopup(t,r,n){this._userInteractions!==null&&this._userInteractions.showPopup(t,r,n)}setPaint(t=null){t=_g(t,{colour:!0,outline:!0}),this._userInteractions!==null&&this._userInteractions.setPaint(t)}setColour(t=null){console.log("`setColour()` is deprecated; please use `setPaint()` instead."),this.setPaint(t)}getBackgroundColour(){return this._map.getPaintProperty("background","background-color")}getBackgroundOpacity(){return this._map.getPaintProperty("background","background-opacity")}setBackgroundColour(t){localStorage.setItem("flatmap-background-colour",t),this._map.setPaintProperty("background","background-color",t),this._minimap&&this._minimap.setBackgroundColour(t)}setBackgroundOpacity(t){this._map.setPaintProperty("background","background-opacity",t),this._minimap&&this._minimap.setBackgroundOpacity(t)}showMinimap(t){this._minimap&&this._minimap.show(t)}getLayers(){if(this._userInteractions!==null)return this._userInteractions.getLayers()}enableLayer(t,r=!0){if(this._userInteractions!==null)return this._userInteractions.enableLayer(t,r)}getSystems(){if(this._userInteractions!==null)return this._userInteractions.getSystems()}enableSystem(t,r=!0){if(this._userInteractions!==null)return this._userInteractions.enableSystem(t,r)}addMarker(t,r={}){return this._userInteractions!==null?this._userInteractions.addMarker(t,r):-1}removeMarker(t){this._userInteractions!==null&&this._userInteractions.removeMarker(t)}clearMarkers(){this._userInteractions!==null&&this._userInteractions.clearMarkers()}visibleMarkerAnatomicalIds(){if(this._userInteractions!==null)return this._userInteractions.visibleMarkerAnatomicalIds()}showMarkerPopup(t,r,n={}){return this._userInteractions!==null?this._userInteractions.showMarkerPopup(t,r,n):!1}__exportedProperties(t){const r={},n=["id","featureId","connectivity","dataset","kind","label","models","source","taxons","hyperlinks"],i=["hyperlinks"];for(const o of n)o in t&&t[o]!==void 0&&(i.includes(o)?r[o]=JSON.parse(t[o]):o==="featureId"?r[o]=+t[o]:r[o]=t[o]);return Object.keys(r).length>0&&(r.type="feature"),r}featureEvent(t,r){const n=this.__exportedProperties(r);return Object.keys(n).length>0?(this.callback(t,n),!0):!1}featureProperties(t){const r=this.annotation(t);return r?this.__exportedProperties(r):{}}markerEvent(t,r,n){this.callback(t,{type:"marker",id:r,models:n})}controlEvent(t,r,n){this.callback(t,{type:"control",control:r,value:n})}enablePanZoomEvents(t=!0){this._userInteractions!==null&&this._userInteractions.enablePanZoomEvents(t)}panZoomEvent(t){const r=this._map.getBounds();if(this.__normalised_origin!==void 0){const n=$c.MercatorCoordinate.fromLngLat(r.toArray()[0]),i=$c.MercatorCoordinate.fromLngLat(r.toArray()[1]),o=[(n.x-this.__normalised_origin[0])/this.__normalised_size[0],(i.y-this.__normalised_origin[1])/this.__normalised_size[1]],s=[(i.x-n.x)/this.__normalised_size[0],(n.y-i.y)/this.__normalised_size[1]];this.callback("pan-zoom",{type:t,origin:o,size:s})}}panZoomTo(t,r){if(this.__normalised_origin!==void 0){const n=t[0]*this.__normalised_size[0]+this.__normalised_origin[0],i=t[1]*this.__normalised_size[1]+this.__normalised_origin[1],o=n+r[0]*this.__normalised_size[0],s=i+r[1]*this.__normalised_size[1],l=new $c.MercatorCoordinate(n,s,0).toLngLat(),c=new $c.MercatorCoordinate(o,i,0).toLngLat();this._map.fitBounds([l,c],{animate:!1})}}search(t,r=!1){return r?this.__searchIndex.auto_suggest(t):this.__searchIndex.search(t)}clearSearchResults(){this._userInteractions!==null&&this._userInteractions.clearSearchResults()}showSearchResults(t){this._userInteractions!==null&&this._userInteractions.showSearchResults(t.featureIds)}selectFeatures(t){if(this._userInteractions!==null){const r=this.modelFeatureIdList(t);this._userInteractions.selectFeatures(r)}}zoomToFeatures(t,r=null){if(r=_g(r,{select:!0,highlight:!1,padding:100}),this._userInteractions!==null){const n=this.modelFeatureIdList(t);this._userInteractions.zoomToFeatures(n,r)}}},N5e=class{constructor(t,r={}){this._mapServer=new f6t(t),this._options=r,this._mapList=[],this._mapNumber=0,this._initialisingMutex=new dht,this._initialised=!1}async ensureInitialised_(){return await this._initialisingMutex.dispatch(async()=>{if(!this._initialised){this._mapList=[];const t=await this._mapServer.loadJSON("");for(const r of t)r.separateLayers="version"in r&&r.version>=wbt,this._mapList.push(r);this._initialised=!0}})}allMaps(){return new Promise(async(t,r)=>{await this.ensureInitialised_();const n={};for(const i of this._mapList){const o="uuid"in i?i.uuid:i.id;n[o]=i}t(n)})}findMap_(t){return new Promise(async(r,n)=>{await this.ensureInitialised_(),r(this.lookupMap_(t))})}latestMap_(t){const r=t.constructor.name==="String"?t:"uuid"in t?t.uuid:"taxon"in t?t.taxon:null;if(r===null)return null;let n=null,i="";for(const o of this._mapList)if(("uuid"in o&&r===o.uuid||r===o.id||"taxon"in o&&r===o.taxon||r===o.source)&&(!("biologicalSex"in t)||"biologicalSex"in o&&t.biologicalSex===o.biologicalSex))if("created"in o)i<o.created&&(i=o.created,n=o);else{n=o;break}return n}lookupMap_(t){return typeof t=="object"?this.latestMap_(t):this.latestMap_({uuid:t})}loadMap(t,r,n,i={}){return new Promise(async(o,s)=>{try{const l=await this.findMap_(t);l===null&&s(`Unknown map: ${JSON.stringify(t)}`);const c="uuid"in l?l.uuid:l.id,u=await this._mapServer.loadJSON(`flatmap/${c}/`),d="uuid"in u?u.uuid:u.id;if(c!==d)throw new Error(`Map '${c}' has wrong ID in index`);const p=Object.assign({},this._options,i);!("bounds"in i)&&"bounds"in u&&(p.bounds=u.bounds),"style"in u?p.style=u.style:p.style="flatmap",!("image-layers"in u)&&"image_layer"in u&&(u["image-layers"]=u.image_layer);let h=[];if(!("version"in u)||u.version<=1)for(const v of u.layers)typeof v=="string"?h.push({id:v,description:v.charAt(0).toUpperCase()+v.slice(1),selectable:!0}):h.push(v);else h=await this._mapServer.loadJSON(`flatmap/${c}/layers`);const f=await this._mapServer.loadJSON(`flatmap/${c}/style`);"glyphs"in f||(f.glyphs="https://fonts.openmaptiles.org/{fontstack}/{range}.pbf");const m=await this._mapServer.loadJSON(`flatmap/${c}/pathways`),g=await this._mapServer.loadJSON(`flatmap/${c}/annotations`),T=await this._mapServer.loadJSON(`flatmap/${c}/metadata`),y=await this._mapServer.loadJSON(`flatmap/${c}/markers`);return"vector-tiles"in f.sources&&("minZoom"in p||(p.minZoom=f.sources["vector-tiles"].minzoom),"maxZoom"in p||(p.maxZoom=f.sources["vector-tiles"].maxzoom)),"layerOptions"in p?("colour"in p.layerOptions||(p.layerOptions.colour=!0),"outline"in p.layerOptions||(p.layerOptions.outline=!0)):p.layerOptions={colour:!0,outline:!0},p.layerOptions.authoring="authoring"in u?u.authoring:!1,p.separateLayers=l.separateLayers,this._mapNumber+=1,new Lbt(r,this._mapServer.url(),{id:l,uuid:c,details:u,taxon:l.taxon,biologicalSex:l.biologicalSex,style:f,options:p,layers:h,markers:y,annotations:g,number:this._mapNumber,pathways:m,provenance:T,provenance:T,callback:n},o)}catch(l){s(l)}})}};const B5e=(e,t)=>{const r=[];let n=e.organs?e.organs:e.ftus;const i=n?n.filter((o,s)=>n.findIndex(l=>l.label===o.label)===s):void 0;return i&&i.forEach(o=>{const s={label:o.label,models:o.models,key:`${t}.${o.label}`},l=B5e(o,s.key);l.length>0&&(s.children=l),r.push(s)}),r},Sbt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},kbt={name:"FlatmapVuer",components:{Button:j3,Col:B4,Loading:W4t,Radio:J3e,RadioGroup:Y3e,Row:U3,Select:Qg,MapSvgIcon:Xb,MapSvgSpriteColor:RC,Tooltip:XU,TreeControls:Mde,SelectionsGroup:kde,SvgLegends:Cde,ElIconWarningFilled:wue,ElIconArrowDown:sh,ElIconArrowLeft:xue},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},methods:{viewLatestMap:function(){let e=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(e="PATO:0000384");const t={entry:this.entry,biologicalSex:e,viewport:this.mapImp.getState()};this.$emit("view-latest-map",t)},backgroundChangeCallback:function(e){this.currentBackground=e,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(e){if(this.systems.length=0,e&&e.length>0){const t={label:"All",key:"All",children:[]};e.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=B5e(r,n.key);i.length>0&&(n.children=i),t.children.push(n)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,t.forEach(r=>{Ede(e,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setColour({colour:e,outline:this.outlinesRadio})},setOutlines:function(e){this.outlineRadio=e,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:e})},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(e){this.mapImp&&this.mapImp.enableCentrelines(e.value)},sckanSelected:function(e){this.mapImp&&this.mapImp.enableSckanPath(e.key,e.value)},checkAllSCKAN:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableSckanPath(t,e.value))},highlightConnectedPaths:function(e){if(this.mapImp){let t=[...this.mapImp.pathModelNodes(e)].map(n=>this.mapImp.featureProperties(n)),r=[];t.forEach(n=>{this.mapImp.nodePathModels(n.featureId).forEach(i=>{r.push(i)})}),this.mapImp.zoomToFeatures(r,{noZoomIn:!0})}},systemSelected:function(e){this.mapImp&&this.mapImp.enableSystem(e.key,e.value)},checkAllSystems:function(e){this.mapImp&&this.systems[0].children.forEach(t=>this.mapImp.enableSystem(t.label,e))},ftuSelected:function(e){this.searchAndShowResult(e,!0)},layersSelected:function(e){this.mapImp&&this.mapImp.enableLayer(e.key,e.value)},checkAllLayers:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableLayer(t,e.value))},taxonsSelected:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.key,e.value)},checkAllTaxons:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableConnectivityByTaxonIds(t,e.value))},pathwaysSelected:function(e){this.mapImp&&this.mapImp.enablePath(e.key,e.value)},checkAllPathways:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enablePath(t,e.value))},enablePanZoomEvents:function(e){this.mapImp.enablePanZoomEvents(e)},eventCallback:function(){return(e,t,...r)=>{if(e!=="pan-zoom"){const n=t.label,i=[t.models],o=this.entry,s=this.biologicalSex,l={dataset:t.dataset,biologicalSex:s,taxonomy:o,resource:i,label:n,feature:t,userData:r,eventType:e,provenanceTaxonomy:t.taxons?JSON.parse(t.taxons):void 0};e==="click"?this.viewingMode==="Network Discovery"?this.highlightConnectedPaths([t.models]):this.currentActive=t.models?t.models:"":e==="mouseenter"&&this.viewingMode!=="Network Discovery"&&(this.currentHover=t.models?t.models:""),t&&t.type!=="marker"&&e==="click"&&this.viewingMode!=="Network Discovery"&&this.checkAndCreatePopups(l),this.$emit("resource-selected",l)}else this.$emit("pan-zoom-callback",t)}},checkAndCreatePopups:async function(e){if(this.viewingMode==="Annotation")e.feature&&e.feature.featureId&&e.feature.models?(this.annotationEntry={...e.feature,resourceId:this.serverUUID},this.displayTooltip(e.feature.models)):this.annotation={};else{let t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(e);(t[0]||t[1]||e.feature.hyperlinks&&e.feature.hyperlinks.length>0)&&(this.resourceForTooltip=e.resource[0],e.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(e))}},popUpCssHacks:function(){let e=document.querySelector(".flatmap-tooltip-popup");e&&(e.style.display="none"),document.querySelector(".maplibregl-popup-close-button").style.display="block",this.$refs.tooltip.$el.style.display="flex",document.querySelector(".maplibregl-popup-close-button").onclick=()=>{document.querySelector(".flatmap-tooltip-popup").style.display="block"}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(e=>{e.style.display="none"})},createTooltipFromNeuronCuration:async function(e){this.tooltipEntry=await this.flatmapQueries.createTooltipData(e),this.displayTooltip(e.resource[0])},showPopup:function(e,t,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,n))},showMarkerPopup:function(e,t,r){this.mapImp&&this.mapImp.showMarkerPopup(e,t,r)},closeMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(e.classList.add("enlarge"),e.classList.remove("shrink")):(e.classList.add("shrink"),e.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");e&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),e.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(e){e?(this.inHelp=!0,this.hoverVisibilities.forEach(t=>{t.value=!0}),this.openFlatmapHelpPopup()):(this.inHelp=!1,this.hoverVisibilities.forEach(t=>{t.value=!1}),this.closeFlatmapHelpPopup())},showToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!0},500))},hideToolitip:function(e){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!1},500))},displayTooltip:function(e){this.tooltipDisplay=!0,this.disableUI||this.displayPopup(e)},displayPopup:function(e){this.mapImp.showPopup(this.mapImp.modelFeatureIds(e)[0],this.$refs.tooltip.$el,{className:"flatmapvuer-popover",positionAtLastClick:!0}),this.popUpCssHacks()},openFlatmapHelpPopup:function(){if(this.mapImp){let e=this.mapImp.modelFeatureIds("UBERON:0000948");e&&e.length>0&&this.mapImp.showPopup(e[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"})}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(e=>{e.click()})},getLabels:function(){let e=[];if(this.mapImp){let t=this.mapImp.annotations;for(let r of t.values())r.label&&e.push(r.label);return Array.from(new Set(e))}},getState:function(){if(this.mapImp){let e={entry:this.entry,viewport:this.mapImp.getState()};const t=this.mapImp.getIdentifier();return this.biologicalSex?e.biologicalSex=this.biologicalSex:t&&t.biologicalSex&&(e.biologicalSex=t.biologicalSex),t&&t.uuid&&(e.uuid=t.uuid),e}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?e.viewport&&this.mapImp.setState(e.viewport):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){e&&(e.viewport&&this.mapImp.setState(e.viewport),e.searchTerm&&this.searchAndShowResult(e.searchTerm,!0))},createFlatmap:function(e){if(!this.mapImp&&!this.loading){this.loading=!0;let t=!1;this.displayMinimap&&(t={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),e?e.uuid?r={uuid:e.uuid}:e.entry&&(r.taxon=e.entry,e.biologicalSex?r.biologicalSex=e.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{featureInfo:this.featureInfo,"min-zoom":this.minZoom,layerControl:!0,pathControls:!0,searchable:this.searchable,tooltips:this.tooltips,minimap:t}).then(n=>{this.mapImp=n,this.serverUUID=this.mapImp.getIdentifier().uuid,this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(e)})}else e&&(this._stateToBeSet={viewport:e.viewport,searchTerm:e.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),r=parseInt(t.paddingTop)+parseInt(t.paddingBottom),n=e.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(){this.sensor=new d6t(this.$refs.display,this.mapResize),this.mapImp.options&&this.mapImp.options.style==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!0,this.mapResize(),this.$emit("ready",this)},showMinimap:function(e){this.mapImp&&this.mapImp.showMinimap(e)},showPathwaysDrawer:function(e){this.drawerOpen=e},searchAndShowResult:function(e,t){if(this.mapImp){if(e===void 0||e==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(e);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),t&&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(e){return this.mapImp?this.mapImp.search(e):[]}},props:{entry:String,uuid:String,biologicalSex:{type:String,default:""},featureInfo:{type:Boolean,default:!1},minZoom:{type:Number,default:4},pathControls:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},layerControl:{type:Boolean,default:!1},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},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}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI}},data:function(){return{annotationEntry:{},tooltipDisplay:!1,serverUUID:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,hoverVisibilities:[{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1},{value:!1}],yellowstar:c6t,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:s6t,tooltipEntry:Sbt(),connectivityTooltipVisible:!1,drawerOpen:!1,annotationRadio:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",currentHover:"",viewingMode:"Exploration",viewingModes:["Annotation","Exploration","Network Discovery"],openMapRef:void 0,backgroundIconRef:void 0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(e){this.setHelpMode(e)},state:{handler:function(e){this.mapManager?this.setState(e):this.setStateRequired=!0},immediate:!0,deep:!0},disableUI:function(e){e&&this.closeTooltip()}},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait=[],this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=new N5e(this.flatmapAPI),this.flatmapQueries=new l6t,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},Ou=e=>(a.pushScopeId("data-v-75254909"),e=e(),a.popScopeId(),e),Mbt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},Cbt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},Ebt={style:{height:"100%",width:"100%"},ref:"display"},Abt={class:"beta-popovers"},Obt=Ou(()=>a.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),Hbt=Ou(()=>a.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Vbt=Ou(()=>a.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),Ibt=Ou(()=>a.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Pbt=Ou(()=>a.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),Nbt={key:1,class:"warning-text"},Bbt=Ou(()=>a.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),Rbt=Ou(()=>a.createElementVNode("b",null,"Network discovery mode",-1)),Fbt=Ou(()=>a.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)),Dbt=Ou(()=>a.createElementVNode("b",null,"Now can display up to 6 panes",-1)),zbt=Ou(()=>a.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)),jbt={class:"bottom-right-control"},Ubt=Ou(()=>a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1)),Gbt=["innerHTML"],qbt=["innerHTML"],Wbt=["onClick"];function Zbt(e,t,r,n,i,o){const s=a.resolveComponent("map-svg-sprite-color"),l=wue,c=ql,u=QE,d=sh,p=a.resolveComponent("map-svg-icon"),h=Cde,f=Mde,m=kde,g=xue,T=j3,y=U3,v=B4,_=vE,b=Qg,L=J3e,w=Y3e,k=XU,C=mde,A=LE;return a.withDirectives((a.openBlock(),a.createElementBlock("div",Mbt,[a.createVNode(s),a.createElementVNode("div",Cbt,[a.createElementVNode("div",Ebt,null,512),a.withDirectives(a.createElementVNode("div",Abt,[a.createElementVNode("div",null,[a.createVNode(u,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[6].value,ref:"warningPopover"},{reference:a.withCtx(()=>[r.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:t[7]||(t[7]=O=>o.showToolitip(6)),onMouseout:t[8]||(t[8]=O=>o.hideToolitip(6))},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1}),r.isLegacy?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[Pbt,a.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...O)=>o.viewLatestMap&&o.viewLatestMap(...O))}," Click here for the latest map ")],64)):(a.openBlock(),a.createElementBlock("span",Nbt,"Beta"))],32)):a.createCommentVNode("",!0)]),default:a.withCtx(()=>[r.isLegacy?(a.openBlock(),a.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=O=>o.showToolitip(6)),onMouseout:t[1]||(t[1]=O=>o.hideToolitip(6))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(a.openBlock(),a.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=O=>o.showToolitip(6)),onMouseout:t[3]||(t[3]=O=>o.hideToolitip(6))},[a.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),Obt,a.createTextVNode(" models available in "),Hbt,a.createTextVNode(". ")],32)):(a.openBlock(),a.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=O=>o.showToolitip(6)),onMouseout:t[5]||(t[5]=O=>o.hideToolitip(6))},[a.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),Vbt,a.createTextVNode(" models available in "),Ibt,a.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(a.openBlock(),a.createBlock(u,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[7].value},{reference:a.withCtx(()=>[r.displayLatestChanges?(a.openBlock(),a.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=O=>o.showToolitip(7)),onMouseout:t[10]||(t[10]=O=>o.hideToolitip(7))},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1}),Bbt],32)):a.createCommentVNode("",!0)]),default:a.withCtx(()=>[Rbt,Fbt,Dbt,zbt]),_:1},8,["visible"])):a.createCommentVNode("",!0)],512),[[a.vShow,!r.disableUI]]),a.withDirectives(a.createVNode(c,{class:a.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:a.withCtx(()=>[a.createVNode(d)]),_:1},8,["class","onClick"]),[[a.vShow,e.minimapResizeShow]]),a.withDirectives(a.createElementVNode("div",jbt,[a.createVNode(u,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[0].value},{reference:a.withCtx(()=>[a.createVNode(p,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[11]||(t[11]=O=>o.zoomIn()),onMouseover:t[12]||(t[12]=O=>o.showToolitip(0)),onMouseout:t[13]||(t[13]=O=>o.hideToolitip(0))})]),_:1},8,["visible"]),a.createVNode(u,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper popper-zoomout",visible:e.hoverVisibilities[1].value},{reference:a.withCtx(()=>[a.createVNode(p,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[14]||(t[14]=O=>o.zoomOut()),onMouseover:t[15]||(t[15]=O=>o.showToolitip(1)),onMouseout:t[16]||(t[16]=O=>o.hideToolitip(1))})]),_:1},8,["visible"]),a.createVNode(u,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value},{reference:a.withCtx(()=>[a.createVNode(p,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[17]||(t[17]=O=>o.resetView()),onMouseover:t[18]||(t[18]=O=>o.showToolitip(2)),onMouseout:t[19]||(t[19]=O=>o.hideToolitip(2))})]),default:a.withCtx(()=>[Ubt]),_:1},8,["visible"])],512),[[a.vShow,!r.disableUI]]),a.createVNode(u,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper",visible:e.hoverVisibilities[4].value,ref:"checkBoxPopover"},{reference:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{class:a.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[r.pathControls?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:a.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(h,{key:0,class:"svg-legends-container"})),a.createVNode(u,{content:"Location of the featured dataset",placement:"right",teleported:!1,trigger:"hover","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{class:"yellow-star-legend",innerHTML:e.yellowstar},null,8,Gbt),[[a.vShow,r.showStarInLegend],[C,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"]),a.createVNode(u,{content:"Find these markers for data",placement:"right",teleported:!1,trigger:"manual","popper-class":"flatmap-popper popper-bump-right",visible:e.hoverVisibilities[5].value,ref:"markerPopover"},{reference:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,qbt),[[a.vShow,e.hoverVisibilities[5].value],[C,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(a.openBlock(),a.createBlock(f,{key:1,active:e.currentActive,hover:e.currentHover,"tree-data":e.systems,ref:"treeControls",onChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected},null,8,["active","hover","tree-data","onChanged","onCheckAll","onChangeActive"])):a.createCommentVNode("",!0),!e.isFC&&e.centreLines&&e.centreLines.length>0?(a.openBlock(),a.createBlock(m,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:e.centreLines,onChanged:o.centreLinesSelected,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged"])):a.createCommentVNode("",!0),!e.isFC&&e.taxonConnectivity&&e.taxonConnectivity.length>0?(a.openBlock(),a.createBlock(m,{title:"Observed in",labelKey:"label",identifierKey:"taxon",selections:e.taxonConnectivity,onChanged:o.taxonsSelected,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckAll"])):a.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(a.openBlock(),a.createBlock(m,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,onChanged:o.pathwaysSelected,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onCheckAll"])):a.createCommentVNode("",!0)],6)),[[C,void 0,"checkBoxPopover"]]):a.createCommentVNode("",!0),a.createElementVNode("div",{onClick:t[20]||(t[20]=(...O)=>o.toggleDrawer&&o.toggleDrawer(...O)),class:a.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(g)]),_:1})],2)],2),[[a.vShow,!r.disableUI]])]),_:1},8,["visible"]),e.openMapRef?(a.openBlock(),a.createBlock(u,{key:0,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.openMapOptions,O=>(a.openBlock(),a.createBlock(y,{key:O.key},{default:a.withCtx(()=>[a.createVNode(T,{type:"primary",plain:"",onClick:N=>e.$emit("open-map",O.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(O.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(u,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"200",teleported:!1,trigger:"click","popper-class":"background-popper","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(y,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Viewing Mode")]),_:1}),a.createVNode(y,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(b,{teleported:!1,modelValue:e.viewingMode,"onUpdate:modelValue":t[21]||(t[21]=O=>e.viewingMode=O),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.viewingModes,O=>(a.openBlock(),a.createBlock(_,{key:O,label:O,value:O},{default:a.withCtx(()=>[a.createVNode(y,null,{default:a.withCtx(()=>[a.createVNode(v,{span:12},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(O),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a.createVNode(y,{class:"backgroundSpacer"}),a.createVNode(y,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Organs display")]),_:1}),a.createVNode(y,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(w,{modelValue:e.colourRadio,"onUpdate:modelValue":t[22]||(t[22]=O=>e.colourRadio=O),class:"flatmap-radio",onChange:o.setColour},{default:a.withCtx(()=>[a.createVNode(L,{label:!0},{default:a.withCtx(()=>[a.createTextVNode("Colour")]),_:1}),a.createVNode(L,{label:!1},{default:a.withCtx(()=>[a.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),a.createVNode(y,{class:"backgroundSpacer"}),a.createVNode(y,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Outlines display")]),_:1}),a.createVNode(y,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(w,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[23]||(t[23]=O=>e.outlinesRadio=O),class:"flatmap-radio",onChange:o.setOutlines},{default:a.withCtx(()=>[a.createVNode(L,{label:!0},{default:a.withCtx(()=>[a.createTextVNode("Show")]),_:1}),a.createVNode(L,{label:!1},{default:a.withCtx(()=>[a.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),a.createVNode(y,{class:"backgroundSpacer"}),a.createVNode(y,{class:"backgroundText"},{default:a.withCtx(()=>[a.createTextVNode("Change background")]),_:1}),a.createVNode(y,{class:"backgroundControl"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.availableBackground,O=>(a.openBlock(),a.createElementBlock("div",{key:O,class:a.normalizeClass(["backgroundChoice",O,O==e.currentBackground?"active":""]),onClick:N=>o.backgroundChangeCallback(O)},null,10,Wbt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.withDirectives(a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[a.createVNode(y,null,{default:a.withCtx(()=>[a.createVNode(u,{visible:e.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper"},{reference:a.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(a.openBlock(),a.createBlock(p,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[24]||(t[24]=O=>o.showToolitip(8)),onMouseout:t[25]||(t[25]=O=>o.hideToolitip(8))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),a.createVNode(y,null,{default:a.withCtx(()=>[a.createVNode(u,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[3].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper"},{reference:a.withCtx(()=>[a.createVNode(p,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[26]||(t[26]=O=>o.showToolitip(3)),onMouseout:t[27]||(t[27]=O=>o.hideToolitip(3))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[a.vShow,!r.disableUI]]),a.withDirectives(a.createVNode(k,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,entry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation"},null,8,["annotationEntry","entry","annotationDisplay"]),[[a.vShow,e.tooltipDisplay]])])])),[[A,e.loading]])}const VW=R4(kbt,[["render",Zbt],["__scopeId","data-v-75254909"]]),R5e={"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"},Kbt={name:"MultiFlatmapVuer",components:{Col:B4,Row:U3,Option:vE,Select:Qg,Popover:QE,FlatmapVuer:VW},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),SE.on("onActionClick",e=>{this.FlatmapSelected(e)})},methods:{initialise:function(){return new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&t.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=a.reactive(this.availableSpecies[n]);else for(let o=0;o<t.length;o++)if(this.availableSpecies[n].taxo===t[o].taxon)if(this.availableSpecies[n].biologicalSex){if(t[o].biologicalSex&&t[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=a.reactive(this.availableSpecies[n]);break}}else{this.speciesList[n]=a.reactive(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,e(),this._resolveList.forEach(n=>{n()})})):this._initialised?e():this._resolveList.push(e)})},FlatmapSelected:function(e){this.$emit("resource-selected",e)},FlatmapReady:function(e){this.$emit("ready",e)},getCoordinatesOfLastClick:function(){const e=this.$refs[this.activeSpecies];if(e&&e[0])return e[0].getCoordinatesOfLastClick()},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(e){this.$emit("pan-zoom-callback",e)},showPopup:function(e,t,r){this.getCurrentFlatmap().showPopup(e,t,r)},showMarkerPopup:function(e,t,r){this.getCurrentFlatmap().showMarkerPopup(e,t,r)},setSpecies:function(e,t,r){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(e,t,n)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let r=0;r<t.length;r++){const n=this.speciesList[t[r]];if(!n.isLegacy&&n.taxo===e.entry&&n.biologicalSex===e.biologicalSex){this.setSpecies(t[r],e,0);return}}},createLegacyEntry:function(e,t,r){if(r&&t){let n="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?n=e.species:n=n+` ${e.species}`),this.speciesList[n]=a.reactive({taxo:t,isLegacy:!0,displayWarning:!0}),{species:n,state:{entry:t,uuid:r,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const r=e.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new N5e(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(e,r.entry,r.uuid)}).then(o=>{t(o||e)}).catch(()=>{t(e)})})}else if(r.entry){const n=r.entry in R5e?R5e[r.entry]:void 0,i=this.createLegacyEntry(e,r.entry,n);t(i||e)}}t(e)})},getState:function(){let e={species:this.activeSpecies,state:void 0},t=this.getCurrentFlatmap();return e.state=t.getState(),e},setState:function(e){e&&this.updateState(e).then(t=>{this.initialise().then(()=>{t.species&&t.species!==this.activeSpecies?this.setSpecies(t.species,t.state,5):t.state&&this.getCurrentFlatmap().setState(t.state)})})},resourceSelected:function(e){this.$emit("resource-selected",e)}},props:{showLayer:{type:Boolean,default:!1},featureInfo:{type:Boolean,default:!1},pathControls:{type:Boolean,default:!0},searchable:{type:Boolean,default:!1},layerControl:{type:Boolean,default:!1},initial:{type:String,default:""},minZoom:{type:Number,default:4},renderAtMounted:{type:Boolean,default:!1},helpMode:{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}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},Xbt=e=>(a.pushScopeId("data-v-4a803829"),e=e(),a.popScopeId(),e),Jbt={class:"multi-container",ref:"multiContainer"},Ybt={key:0,style:{position:"absolute","z-index":"10"}},$bt=Xbt(()=>a.createElementVNode("div",{class:"species-display-text"},"Species",-1));function ext(e,t,r,n,i,o){const s=B4,l=U3,c=vE,u=Qg,d=QE,p=VW;return a.openBlock(),a.createElementBlock("div",Jbt,[r.disableUI?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Ybt,[$bt,a.createVNode(d,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper right-popper",visible:r.helpMode,teleported:!1,ref:"selectPopover"},{reference:a.withCtx(()=>[a.createVNode(u,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=h=>e.activeSpecies=h),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.speciesList,(h,f)=>(a.openBlock(),a.createBlock(c,{key:f,label:f,value:f},{default:a.withCtx(()=>[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(s,{span:8},{default:a.withCtx(()=>[a.createElementVNode("i",{class:a.normalizeClass(h.iconClass)},null,2)]),_:2},1024),a.createVNode(s,{span:12},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(f),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.speciesList,(h,f)=>a.withDirectives((a.openBlock(),a.createBlock(p,{key:f,showLayer:r.showLayer,entry:h.taxo,uuid:h.uuid,biologicalSex:h.biologicalSex,displayWarning:h.displayWarning,displayLatestChanges:h.displayLatestChanges,isLegacy:h.isLegacy,ref_for:!0,ref:f,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.FlatmapSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,onOpenMap:t[1]||(t[1]=m=>e.$emit("open-map",m)),featureInfo:r.featureInfo,minZoom:r.minZoom,pathControls:r.pathControls,searchable:r.searchable,layerControl:r.layerControl,helpMode:r.helpMode,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["showLayer","entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","featureInfo","minZoom","pathControls","searchable","layerControl","helpMode","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[a.vShow,e.activeSpecies==f]])),128))],512)}const txt=R4(Kbt,[["render",ext],["__scopeId","data-v-4a803829"]]),Z_=[{id:"ilxtr:neuron-type-keast-13",centrelines:["n_71"]},{id:"ilxtr:neuron-type-keast-2",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-3",centrelines:["bladder_n","hypogastric_n"]},{id:"ilxtr:neuron-type-keast-15",centrelines:["n_73"]},{id:"ilxtr:neuron-type-keast-1",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-7",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-9",centrelines:["L6_spinal_n-1","L6_ventral_root","pudendal_n","L5_spinal_n","L5_ventral_root"]},{id:"ilxtr:neuron-type-keast-10",centrelines:["S1_dorsal_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_dorsal_root","bladder_n"]},{id:"ilxtr:neuron-type-keast-11",centrelines:["lumbar_splanchnic_n","L2_spinal_n","L1_spinal_n-1","hypogastric_n","bladder_n","L1_dorsal_root","L2_dorsal_root"]},{id:"ilxtr:neuron-type-keast-12",centrelines:["L6_spinal_n-1","L6_dorsal_root","pudendal_n","S1_spinal_n-1","S1_dorsal_root"]},{id:"ilxtr:neuron-type-keast-8",centrelines:["L1_ventral_root_paravertebral_ganglion","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","L2_ventral_root_paravertebral_ganglion","sympathetic_trunk_L2-L3","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_L5-L6","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-20",centrelines:["T1_T2_cns","C8_T1_cns","T2_T3_cns","T10_T11_cns","T9_T10_cns","T11_T12_cns","T8_T9_cns","C7_C8_cns","C6_C7_cns","C4_C5_cns","C3_C4_cns","C5_C6_cns","medulla_C1_cns","pons_medulla_cns","C1_C2_cns","T5_T6_cns","T4_T5_cns","T6_T7_cns","L3_L4_cns","L2_L3_cns","L4_L5_cns","L5_L6_cns","T13_L1_cns","T12_T13_cns","L1_L2_cns","T3_T4_cns","n_69","C2_C3_cns","T7_T8_cns"]},{id:"ilxtr:neuron-type-keast-16",centrelines:["n_74"]},{id:"ilxtr:neuron-type-keast-4",centrelines:["sympathetic_trunk_L6-S1","L6_gray_ramus-spinal_n","sympathetic_trunk_L5-L6","S1_gray_ramus-spinal_n","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","sympathetic_trunk_L2-L3","bladder_n","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-17",centrelines:["n_75"]},{id:"ilxtr:neuron-type-keast-5",centrelines:["S1_ventral_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_ventral_root"]},{id:"ilxtr:neuron-type-keast-18",centrelines:["n_70"]},{id:"ilxtr:neuron-type-keast-6",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","hypogastric_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-19",centrelines:["n_69"]},{id:"ilxtr:neuron-type-keast-14",centrelines:["n_72"]}];function oy(e,t,r,n,i){let o={};if(o.dataset=r,o.scaffold=n,o.simulations=i,t?o.title=t:o.title=e,o.description="",o.actions=[],e)switch(e){case"ICN":o.title="RNA",o.description="The distribution of neurons in the intrinsic cardiac nervous system (ICN) were mapped and visualized in a 3D reconstruction of a male rat heart.",o.actions={search:{title:"Explore data",resource:"icn",type:"Search",label:"ICN",filter:{facet:"genotype",term:"heart"}},plot:{title:"View plot",label:"ICN",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/ISAN/csv-data/use-case-4/RNA_Seq.csv",type:"Plot",plotType:"heatmap",datasetTitle:"Molecular Phenotype Distribution of Single Rat Intracardiac Neurons",datasetDescription:"Images collected from serial cryostat sectioning of a cryopreserved heart was used to reconstruct the 3D context. Transcriptional profiles taken from isolated single neurons and mapped back into the previously generated 3D context.",datasetUrl:"https://discover.pennsieve.io/datasets/29",datasetImage:"https://assets.discover.pennsieve.io/dataset-assets/29/6/revisions/1/banner.jpg"}};break}else o.actions=[];return o}function rxt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0001157":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"colon"}},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/human/humanColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0000948":case"UBERON:0002080":o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/human/humanHeart_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Lung",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Lungs/human/humanLeftLung_metadata.json",type:"Scaffold"}};break;default:o=oy(e,t,r,n,i);break}return o}}function nxt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0000948":case"UBERON:0002080":i?o=oy(e,t,r,n,i):(o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=heart",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/rat/ratHeart_metadata.json",type:"Scaffold"},simulation:{title:"Explore simulations",label:"Heart",resource:"https://sparc.science/data?type=simulation&q=heart",type:"URL"}});break;case"UBERON:0001156":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;case"UBERON:0001255":o.title="Urinary bladder",o.description="",o.actions={search:{title:"Explore data",label:"Urinary Bladder",resource:"https://sparc.science/data?type=dataset&q=bladder",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Bladder",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Bladder/rat/ratBladder_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"}};break;case"ICN":o.title="RNA",o.description="The distribution of neurons in the intrinsic cardiac nervous system (ICN) were mapped and visualized in a 3D reconstruction of a male rat heart.",o.actions={search:{title:"Explore data",resource:"icn",type:"Search"},plot:{title:"View plot",label:"ICN",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/ISAN/csv-data/use-case-4/RNA_Seq.csv",type:"Plot",plotType:"heatmap",datasetTitle:"Molecular Phenotype Distribution of Single Rat Intracardiac Neurons",datasetDescription:"Images collected from serial cryostat sectioning of a cryopreserved heart was used to reconstruct the 3D context. Transcriptional profiles taken from isolated single neurons and mapped back into the previously generated 3D context.",datasetUrl:"https://discover.pennsieve.io/datasets/29",datasetImage:"https://assets.discover.pennsieve.io/dataset-assets/29/6/revisions/1/banner.jpg"}};break;case"UBERON:0000945":case"UBERON:0001160":case"UBERON:0001161":o.title="Stomach",o.description="",o.actions={search:{title:"Explore data",label:"Stomach",resource:"https://sparc.science/data?type=dataset&q=stomach",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Stomach",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Stomach/rat/ratStomach_metadata.json",type:"Scaffold"}};break;case"UBERON:0001759":t?o.title=t:o.title="Vagus nerve",o.actions={search:{title:"Explore data",label:"Vagus nerve",resource:"https://sparc.science/data?type=dataset&q=vagus+nerve",type:"Search"},simulation:{title:"Explore simulations",label:"Vagus nerve",resource:"https://sparc.science/data?type=simulation&q=vagus%20nerve",type:"simulation"}};break;default:o=oy(e,t,r,n,i);break}return o}}function ixt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0001156":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/mouse/mouseColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Lung",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Lungs/mouse/mouseLeftLung_metadata.json",type:"Scaffold"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;default:o=oy(e,t,r,n,i);break}return o}}function oxt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0008972":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/pig/pigColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;case"UBERON:0000948":case"UBERON:0002080":o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/pig/pigHeart_metadata.json",type:"Scaffold"}};break;default:o=oy(e,t,r,n,i);break}return o}}function axt(e,t,r,n,i,o){switch(t){case"NCBITaxon:9606":return rxt(e,r,n,i,o);case"NCBITaxon:9823":return oxt(e,r,n,i,o);case"NCBITaxon:10090":return ixt(e,r,n,i,o);case"NCBITaxon:10114":return nxt(e,r,n,i,o);default:return oy(e,t,r,n,i)}}function sxt(){return[{id:"UBERON:0000948",name:"Heart",type:"simulation"},{id:"UBERON:0001156",name:"Colon",type:"simulation"},{id:"UBERON:0001255",name:"Bladder",type:"simulation"},{id:"UBERON:0000945",name:"Stomach",type:"simulation"},{id:"UBERON:0001759",name:"Vagus nerve",type:"simulation"},{id:"UBERON:0002108",name:"Small intestines",type:"simulation"},{id:"UBERON:0002107",name:"Liver",type:"simulation"}]}function lxt(){return sxt()}function F5e(e){if(e)for(let t=0;t<Z_.length;t++){if(Z_[t].id==e)return Z_[t].centrelines;if(Z_[t].centrelines.find(n=>n===e))return[Z_[t].id]}return[]}function cxt(e){if(e){const t=e.toLowerCase();if(t.includes("heart"))return{id:"UBERON:0000948",name:"Heart"};if(t.includes("liver"))return{id:"UBERON:0002107",name:"Liver"};if(t.includes("stomach"))return{id:"UBERON:0000945",name:"Stomach"};if(t.includes("colon"))return{id:"UBERON:0001156",name:"Colon"};if(t.includes("bladder"))return{id:"UBERON:0001255",name:"Bladder"}}}function uxt(e,t){if(e&&e.resource){let r=e.resource;Array.isArray(r)&&r[0]&&(r=r[0]);let n,i,o,s,l,c=r.taxonomy;if(r.data&&r.data.id?(n=r.data.id,i=r.data.id):r.feature&&(n=r.feature.models,i=r.feature.label,o=r.feature.dataset,s=r.feature.scaffold,l=r.feature.simulations),n||i){let u=axt(n,c,i,o,s,l);if(u&&u.actions)return u.actions[t]}}}let IW=7,rd=5;const UH=[{id:"UBERON:0000948",name:"heart",showAtZoom:1},{id:"UBERON:0001759",name:"vagus nerve",showAtZoom:1},{id:"UBERON:0001155",name:"colon",showAtZoom:1},{id:"UBERON:0000945",name:"stomach",showAtZoom:1},{id:"UBERON:0001013",name:"adipose tissue",showAtZoom:1},{id:"UBERON:0001255",name:"urinary bladder",showAtZoom:1},{id:"UBERON:0001348",name:"brown adipose tissue",showAtZoom:6},{id:"UBERON:0002008",name:"cardiac nerve plexus",showAtZoom:1},{id:"UBERON:0002240",name:"spinal cord",showAtZoom:1},{id:"UBERON:0002005",name:"Enteric Nervous System",showAtZoom:4},{id:"UBERON:0013702",name:"body proper",showAtZoom:1},{id:"UBERON:0002298",name:"brainstem",showAtZoom:1},{id:"UBERON:0002439",name:"myenteric nerve plexus",showAtZoom:6},{id:"UBERON:0000010",name:"peripheral nervous system",showAtZoom:6},{id:"UBERON:0002048",name:"lung",showAtZoom:1},{id:"UBERON:0002410",name:"autonomic nervous system",showAtZoom:6},{id:"UBERON:0002441",name:"cervicothoracic ganglion",showAtZoom:6},{id:"UBERON:0005363",name:"inferior vagus X ganglion",showAtZoom:6},{id:"UBERON:0001264",name:"pancreas",showAtZoom:1},{id:"UBERON:0001884",name:"phrenic nerve",showAtZoom:6},{id:"UBERON:0002059",name:"submandibular ganglion",showAtZoom:7},{id:"UBERON:0001347",name:"white adipose tissue",showAtZoom:6},{id:"UBERON:0001556",name:"lower urinary tract",showAtZoom:1},{id:"UBERON:0002262",name:"celiac ganglion",showAtZoom:5},{id:"UBERON:0000955",name:"Brain",showAtZoom:1},{id:"UBERON:0000160",name:"intestine",showAtZoom:1},{id:"UBERON:0001322",name:"sciatic nerve",showAtZoom:1},{id:"UBERON:0001649",name:"glossopharyngeal nerve",showAtZoom:6},{id:"UBERON:0002063",name:"sinus venosus",showAtZoom:6},{id:"UBERON:0002107",name:"liver",showAtZoom:1},{id:"UBERON:0002113",name:"kidney",showAtZoom:1},{id:"UBERON:0002481",name:"bone tissue",showAtZoom:1},{id:"UBERON:0004907",name:"lower digestive tract",showAtZoom:4},{id:"UBERON:0000044",name:"Dorsal root ganglion",showAtZoom:5},{id:"UBERON:0001736",name:"Submandibular gland",showAtZoom:IW,keyword:!0},{id:"UBERON:0001103",name:"Diaphragm",showAtZoom:rd,keyword:!0},{id:"UBERON:0001160",name:"Fundus of stomach",showAtZoom:rd,keyword:!0},{id:"UBERON:0000955",name:"Brain",showAtZoom:rd,keyword:!0},{id:"UBERON:0003708",name:"Carotid sinus",showAtZoom:IW,keyword:!0},{id:"UBERON:0002079",name:"Left cardiac atrium",showAtZoom:rd,keyword:!0},{id:"ILX:0485722",name:"Nodose ganglion",showAtZoom:IW,keyword:!0},{id:"UBERON:0002078",name:"Right cardiac atrium",showAtZoom:rd,keyword:!0},{id:"UBERON:0002084",name:"Heart left ventricle",showAtZoom:rd,keyword:!0},{id:"UBERON:0002080",name:"Heart right ventricle",showAtZoom:rd,keyword:!0},{id:"UBERON:0001508",name:"Arch of Aorta",showAtZoom:rd,keyword:!0},{id:"UBERON:0001738",name:"Thyroid cartilage",showAtZoom:rd,keyword:!0},{id:"UBERON:0000388",name:"Epiglottis",showAtZoom:rd,keyword:!0}];function dxt(e){return e[0].toUpperCase()+e.substring(1)}const ay={props:{entry:Object,visible:{type:Boolean,default:!0},mouseHovered:{type:Boolean,default:!1}},computed:{...gl.mapStores(rg,b8),syncMode(){return this.splitFlowStore.syncMode}},mounted:function(){Xo.on("startHelp",()=>{this.startHelp()})},methods:{toggleSyncMode:function(){},getState:function(){},openMap:function(e){e==="SYNC"?this.toggleSyncMode():Xo.emit("OpenNewMap",e)},updateWithViewUrl:function(){},search:function(){return!1},searchSuggestions:function(){},resourceSelected:function(e,t,r){if(this.resourceHasAction(t)){Xo.emit("PopoverActionClick",t);return}let n,i="none",o=!1;const s={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0,eventType:void 0};if(e=="MultiFlatmap"||e=="Flatmap")if(s.internalName=this.idNamePair[t.feature.models],t.eventType=="click")if(s.eventType="selected",t.feature.type=="marker"){let l=this.idNamePair[t.feature.models],c=UH.filter(u=>u.id===t.feature.models);this.settingsStore.isFeaturedMarkerIdentifier(t.feature.id)?n={type:"Search",term:this.settingsStore.featuredMarkerDoi(t.feature.id)}:c.filter(u=>u.keyword).length>0?n={type:"Search",term:"http://purl.obolibrary.org/obo/"+t.feature.models.replace(":","_")}:n={type:"Facet",facet:l,facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"},o=!0,e=="MultiFlatmap"&&this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}else t.feature.type=="feature"&&(this.syncMode?o=!0:i="scaffold");else t.eventType=="mouseenter"&&(s.eventType="highlighted",o=!0);else e=="Scaffold"&&(t&&t[0]&&(s.internalName=t[0].data.id,t[0].data.lastActionOnMarker===!0&&(n={type:"Facet",facet:dxt(t[0].data.id),facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"})),s.eventType="selected",o=!0,i="search");n===void 0&&r&&(n=uxt(s,i)),n&&Xo.emit("PopoverActionClick",n),o&&this.$emit("resource-selected",s)},resourceHasAction:function(e){return e.type==="URL"||e.type==="Search"||e.type==="Neuron Search"||e.type=="Facet"||e.type=="Facets"},isVisible:function(){return this.splitFlowStore.getPaneNameById(this.entry.id)!==void 0},displayTooltip:function(){},getNameAndIdFromSyncData:async function(e){let t=e.internalName;t===void 0&&e.resource&&(t=e.resource.label);let r;if(e.resource&&e.resource.resource&&(r=e.resource.resource[0]),this.entry.type==="Scaffold"){if(this.$refs.scaffold.findObjectsWithGroupName(t).length===0){if(e.resource&&e.resource.feature){const o=F5e(e.resource.feature.models);if(o.length>0)return o}let i=cxt(t);if(i)return i;if(r&&e.eventType==="selected")return fetch(`${this.apiLocation}get-related-terms/${r}`).then(o=>o.json()).then(o=>{if(o.uberon.array.length>0)return t=o.uberon.array[0].name.charAt(0).toUpperCase()+o.uberon.array[0].name.slice(1),r=o.uberon.array[0].id.toUpperCase(),{id:r,name:t}})}}else if(this.entry.type==="MultiFlatmap")if(t==="Bladder")t="Urinary Bladder";else{const n=F5e(t);n.length>0&&(t=n[0])}return{id:r,name:t}},getDatasetAnatomyInfo:function(e){fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then(t=>t.json()).then(t=>{const r=t.result[0];let n;try{n=r.anatomy.organ[0].curie}catch{n=void 0}let i;try{i=r.item.curie}catch{i=void 0}let o;try{let s=0,l=!1;for(;!l&&s<r.organisms.subject.length;){const c=r.organisms.subject[s];c.species&&(o=c.species.name,l=!0),s+=1}}catch{o=void 0}this.updateFeatureMarkers([n],void 0),this.settingsStore.updateFeaturedMarker({identifier:e,marker:n,doi:i,species:o})})},oldFeaturedDatasetApiHasInfo:async function(){let t=await(await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();return!t.identifiers||t.identifiers.length==0?!1:t.identifiers},newFeaturedDatasetApiHasInfo:async function(){let t=await(await fetch(`${this.apiLocation}get_featured_dataset`)).json();return!t.datasets||t.datasets.length==0?!1:t.datasets.map(r=>r.id)},getFeaturedDatasets:async function(){let e=[],t=await this.oldFeaturedDatasetApiHasInfo();if(t)e=t;else{let r=await this.newFeaturedDatasetApiHasInfo();r&&(e=r)}this.settingsStore.updateFeatured(e),e.forEach(r=>{this.getDatasetAnatomyInfo(r)})},zoomToFeatures:function(){},handleSyncMouseEvent:async function(e){let t=await this.getNameAndIdFromSyncData(e);e.eventType==="highlighted"?this.highlightFeatures(t):e.eventType==="selected"&&this.displayTooltip(t)},handleSyncPanZoomEvent:function(){},highlightFeatures:function(){},receiveSynchronisedEvent:async function(e){if(e.paneIndex!==this.entry.id)e.eventType=="panZoom"||this.handleSyncMouseEvent(e);else if(e.eventType=="selected"){let t=await this.getNameAndIdFromSyncData(e);this.zoomToFeatures(t,!1)}},requestSynchronisedEvent:function(){},getAvailableTerms:function(){let e=lxt();for(let t=0;t<e.length;t++)this.idNamePair[e[t].id]=e[t].name;if(this.apiLocation){this._controller&&this._controller.abort(),this._controller=new AbortController;let t=this._controller.signal;fetch(`${this.apiLocation}get-organ-curies`,{signal:t}).then(r=>r.json()).then(r=>{this._controller=void 0,r.uberon.array.forEach(n=>{this.idNamePair[n.id.toUpperCase()]=n.name.charAt(0).toUpperCase()+n.name.slice(1)})})}},flatmapMarkerZoomUpdate(){},onResize:function(){},startHelp:function(){this.isInHelp===!1&&(this.helpMode=!0,window.addEventListener("mousedown",this.endHelp),this.isInHelp=!0)},endHelp:function(){window.removeEventListener("mousedown",this.endHelp),this.helpMode=!1,setTimeout(()=>{this.isInHelp=!1},200)}},data:function(){return{apiLocation:void 0,activeSpecies:"Rat",scaffoldCamera:void 0,mainStyle:{height:this.entry.datasetTitle?"calc(100% - 30px)":"100%",width:"100%",bottom:"0px"},helpMode:!1,idNamePair:{},scaffoldLoaded:!1,isInHelp:!1}},created:function(){this.flatmapAPI=void 0,this.apiLocation=void 0,this.settingsStore.flatmapAPI&&(this.flatmapAPI=this.settingsStore.flatmapAPI),this.settingsStore.sparcApi&&(this.apiLocation=this.settingsStore.sparcApi)}},pxt=(e,t,r)=>{t&&t.forEach(n=>{let i=!1;for(let o=0;o<UH.length;o++)if(UH[o].id===n){i=!0,r>=UH[o].showAtZoom&&e.addMarker(n,{className:"standard-marker"});break}i||e.addMarker(n,{className:"standard-marker"})})},D5e={computed:{...gl.mapStores(rg)},methods:{flatmapPanZoomCallback:function(e){if(this.mouseHovered){const t={paneIndex:this.entry.id,eventType:"panZoom",payload:e,type:this.entry.type};this.flatmapMarkerZoomUpdate(!1,void 0),this.$emit("resource-selected",t)}},flatmapMarkerZoomUpdate(e,t){if(!this.flatmapReady)return;let r=t;if(r||(r=this.getFlatmapImp()),r){let n=r.getZoom().zoom;if(e||this.zoomLevel!==n){this.zoomLevel=n,r.clearMarkers();let i=this.settingsStore.markers;pxt(r,i,this.zoomLevel),this.entry.type==="MultiFlatmap"&&this.restoreFeaturedMarkers(r)}}},flatmapReadyForMarkerUpdates:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerZoomUpdate(!0,t)}}}},hxt={name:"Flatmap",mixins:[ay,D5e],components:{FlatmapVuer:VW},methods:{getState:function(){return this.$refs.flatmap.getState()},search:function(e){return this.$refs.flatmap.searchAndShowResult(e)},getFlatmapImp(){return this.$refs.flatmap.mapImp},flatmaprResourceSelected:function(e,t){this.$refs.flatmap.resourceSelected(e,t,this.$refs.map.viewingMode==="Exploration")},flatmapReadyCall:function(e){let t={id:this.entry.id,prov:this.getFlatmapImp().provenance};Xo.emit("mapImpProv",t),this.$emit("flatmap-provenance-ready",t),this.getAvailableTerms(),this.entry.resource==="FunctionalConnectivity"&&this.flatmapReadyForMarkerUpdates(e)},highlightFeatures:function(e){let t=e.name;const r=this.$refs.flatmap.mapImp;if(t){const n=r.search(t);n.featureIds[0]&&r.highlightFeatures([r.modelForFeature(n.featureIds[0])])}},searchSuggestions:function(e,t){e&&this.$refs.flatmap.mapImp&&this.$refs.flatmap.mapImp.search(e).__featureIds.forEach(n=>{const i=this.$refs.flatmap.mapImp.annotation(n);i&&i.label&&t.push(i.label)})},zoomToFeatures:function(e,t){let r=e.name;const n=this.$refs.flatmap.mapImp;if(r){const i=n.search(r);if(i.featureIds.length){let o=n.modelForFeature(i.featureIds[0]);o?(t&&n.selectFeatures(o),n.zoomToFeatures(o)):n.clearSearchResults()}}else n.clearSearchResults()}},computed:{facetSpecies(){return this.settingsStore.facets.species}},mounted:function(){this.getAvailableTerms(),Xo.on("markerUpdate",()=>{this.flatmapMarkerZoomUpdate(!0,void 0)})}};function fxt(e,t,r,n,i,o){const s=a.resolveComponent("FlatmapVuer");return a.openBlock(),a.createBlock(s,{state:e.entry.state,entry:e.entry.resource,onResourceSelected:t[0]||(t[0]=l=>o.flatmaprResourceSelected(e.entry.type,l)),onPanZoomCallback:e.flatmapPanZoomCallback,name:e.entry.resource,style:{height:"100%",width:"100%"},minZoom:e.entry.minZoom,helpMode:e.helpMode,pathControls:!0,ref:"flatmap",onReady:o.flatmapReadyCall,displayMinimap:!1,displayWarning:!0,enableOpenMapUI:!0,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,onOpenMap:e.openMap},null,8,["state","entry","onPanZoomCallback","name","minZoom","helpMode","onReady","flatmapAPI","sparcAPI","onOpenMap"])}const mxt=Gl(hxt,[["render",fxt],["__scopeId","data-v-1cc78d5b"]]),gxt={name:"Iframe",mixins:[ay]},yxt={class:"map-iframe-container"},Txt=["src"];function vxt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",yxt,[a.createElementVNode("iframe",{class:"my-iframe",src:e.entry.resource.share_link},null,8,Txt)])}const Qxt=Gl(gxt,[["render",vxt],["__scopeId","data-v-60f8bfe1"]]),bxt='<svg width="72px" height="72px" viewBox="0 0 24 24" fill="yellow"><path d="M11.0748 3.25583C11.4141 2.42845 12.5859 2.42845 12.9252 3.25583L14.6493 7.45955C14.793 7.80979 15.1221 8.04889 15.4995 8.07727L20.0303 8.41798C20.922 8.48504 21.2841 9.59942 20.6021 10.1778L17.1369 13.1166C16.8482 13.3614 16.7225 13.7483 16.8122 14.1161L17.8882 18.5304C18.1 19.3992 17.152 20.0879 16.3912 19.618L12.5255 17.2305C12.2034 17.0316 11.7966 17.0316 11.4745 17.2305L7.60881 19.618C6.84796 20.0879 5.90001 19.3992 6.1118 18.5304L7.18785 14.1161C7.2775 13.7483 7.1518 13.3614 6.86309 13.1166L3.3979 10.1778C2.71588 9.59942 3.07796 8.48504 3.96971 8.41798L8.50046 8.07727C8.87794 8.04889 9.20704 7.80979 9.35068 7.45955L11.0748 3.25583Z" stroke="#000000" stroke-width="2"/></svg>',z5e=e=>{const t=[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}];switch(e){case"Human Male":case"Human Female":case"Rat":t.push({display:"Open Sync Map",key:"SYNC"});break}return t},xxt={name:"MultiFlatmap",mixins:[ay,D5e],components:{MultiFlatmapVuer:txt},data:function(){return{zoomLevel:6,flatmapReady:!1,availableSpecies:g0e(),scaffoldResource:{},showStarInLegend:!1,openMapOptions:z5e("Rat")}},methods:{toggleSyncMode:async function(){if(this.syncMode==!1){let e;this.activeSpecies==="Rat"?e={contextCard:void 0,discoverId:void 0,label:"Rat Body",resource:"https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/31-May-2021/ratBody/ratBody_syncmap_metadata.json",title:"View 3D scaffold",layout:"2horpanel",type:"SyncMap"}:(this.activeSpecies==="Human Male"||this.activeSpecies==="Human Female")&&("human"in this.scaffoldResource||(this.scaffoldResource.human=await Nj(storeeSettings.sparcApi,"human")),e={contextCardUrl:this.scaffoldResource.human.datasetInfo.contextCardUrl,discoverId:this.scaffoldResource.human.datasetInfo.discoverId,s3uri:this.scaffoldResource.human.datasetInfo.s3uri,version:this.scaffoldResource.human.datasetInfo.version,label:"Human Body",resource:this.scaffoldResource.human.url,title:"View 3D scaffold",layout:"2vertpanel",type:"SyncMap",isBodyScaffold:!0}),e&&Xo.emit("SyncModeRequest",{flag:!0,action:e})}else Xo.emit("SyncModeRequest",{flag:!1})},getState:function(){if(this.flatmapReady)return this.$refs.multiflatmap.getState()},flatmapPanZoomCallback:function(e){if(this.mouseHovered){const t={paneIndex:this.entry.id,eventType:"panZoom",payload:e,type:this.entry.type};this.flatmapMarkerZoomUpdate(!1,void 0),this.$emit("resource-selected",t)}},search:function(e){return this.$refs.multiflatmap.getCurrentFlatmap().searchAndShowResult(e,!0)},searchSuggestions:function(e,t){const r=this.$refs.multiflatmap.getCurrentFlatmap();e&&r.mapImp&&r.mapImp.search(e).__featureIds.forEach(i=>{const o=r.mapImp.annotation(i);o&&o.label&&t.push(o.label)})},flatmaprResourceSelected:function(e,t){const r=this.$refs.multiflatmap.getCurrentFlatmap();this.resourceSelected(e,t,r.viewingMode==="Exploration")},handleSyncPanZoomEvent:function(e){if(!this.mouseHovered&&e.type!==this.entry.type){const t=e.payload.zoom,r=e.payload.target,n=this.$el.clientHeight,i=this.$el.clientWidth,o=Math.max(i,n);let s=i/o/t;const l=n/o/t,c=[r[0]/2+.5-s/2,.5-r[1]/2-l/2];this.$refs.multiflatmap.getCurrentFlatmap().mapImp.panZoomTo(c,[s,l]),this.flatmapMarkerZoomUpdate(!1,void 0)}},displayTooltip:function(e){if(e){let t=e.name;t?this.search(t):this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}},zoomToFeatures:function(e,t){let r=e.name;const n=this.$refs.multiflatmap.getCurrentFlatmap().mapImp;if(r){const i=n.search(r);i.featureIds.length>0?(t&&n.selectFeatures(i.featureIds),n.zoomToFeatures(i.featureIds)):n.clearSearchResults()}else n.clearSearchResults()},highlightFeatures:function(e){let t=e.name;const r=this.$refs.multiflatmap.getCurrentFlatmap().mapImp;if(t){const n=r.search(t);n.featureIds.length>0&&r.zoomToFeatures(n.featureIds,{noZoomIn:!0})}},updateProvCard:function(){const e=this.getFlatmapImp();if(e){let t={id:this.entry.id,prov:e.provenance};this.$emit("flatmap-provenance-ready",t)}},flatmapChanged:async function(e){this.activeSpecies=e,this.openMapOptions=z5e(e),this.$emit("species-changed",e),this.entry.state&&this.entry.state.species===this.activeSpecies||this.syncMode==!0&&await this.toggleSyncMode(),this.updateProvCard()},multiFlatmapReady:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerZoomUpdate(!0,t),this.updateProvCard()}},getFlatmapImp:function(){if(this.entry.type==="MultiFlatmap")return this.$refs.multiflatmap.getCurrentFlatmap().mapImp},flatmapAreaSearch(){let r={type:"Facets",label:"Unused",val:this.getFlatmapImp().visibleMarkerAnatomicalIds().map(n=>this.idNamePair[n])};Xo.emit("PopoverActionClick",r)},restoreFeaturedMarkers:function(e){this.settingsStore.resetFeaturedMarkerIdentifier();const t=this.settingsStore.featuredMarkers;this.updateFeatureMarkers(t,e)},updateFeatureMarkers:function(e,t){this.showStarInLegend=!1;for(let r=0;r<e.length;++r)e[r]&&(this.settingsStore.featuredMarkerIdentifiers[r]||this.addFeaturedMarker(e[r],r,t)&&(this.showStarInLegend=!0))},addFeaturedMarker:function(e,t,r){const n=this.settingsStore.featuredMarkerSpecies[t];if(n&&!this.activeSpecies.startsWith(n))return!1;let i=r;if(i||(i=this.getFlatmapImp()),i){let o=document.createElement("div");o.innerHTML=bxt;const s=i.addMarker(e,{element:o,className:"highlight-marker"});return this.settingsStore.updateFeaturedMarkerIdentifier({index:t,markerIdentifier:s}),!0}return!1}},computed:{facetSpecies(){return this.settingsStore.facets.species},featuredMarkers(){return this.settingsStore.featuredMarkers}},watch:{syncMode:function(e){this.$refs.multiflatmap.getCurrentFlatmap()&&this.$refs.multiflatmap.getCurrentFlatmap().enablePanZoomEvents(e)},featuredMarkers:function(e){this.flatmapReady&&this.updateFeatureMarkers(e,void 0)}},mounted:function(){this.getAvailableTerms(),this.getFeaturedDatasets(),Xo.on("markerUpdate",()=>{this.flatmapMarkerZoomUpdate(!0,void 0)})}};function _xt(e,t,r,n,i,o){const s=a.resolveComponent("MultiFlatmapVuer");return a.openBlock(),a.createBlock(s,{availableSpecies:e.availableSpecies,onFlatmapChanged:o.flatmapChanged,onReady:o.multiFlatmapReady,state:e.entry.state,onResourceSelected:t[0]||(t[0]=l=>o.flatmaprResourceSelected(e.entry.type,l)),style:{height:"100%",width:"100%"},initial:e.entry.resource,helpMode:e.helpMode,ref:"multiflatmap",displayMinimap:!0,showStarInLegend:e.showStarInLegend,enableOpenMapUI:!0,openMapOptions:e.openMapOptions,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,onPanZoomCallback:o.flatmapPanZoomCallback,onOpenMap:e.openMap},null,8,["availableSpecies","onFlatmapChanged","onReady","state","initial","helpMode","showStarInLegend","openMapOptions","flatmapAPI","sparcAPI","onPanZoomCallback","onOpenMap"])}const wxt=Gl(xxt,[["render",_xt],["__scopeId","data-v-1be5c6a6"]]);function Lxt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j5e={exports:{}},cs=j5e.exports={},nd,id;function PW(){throw new Error("setTimeout has not been defined")}function NW(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?nd=setTimeout:nd=PW}catch{nd=PW}try{typeof clearTimeout=="function"?id=clearTimeout:id=NW}catch{id=NW}})();function U5e(e){if(nd===setTimeout)return setTimeout(e,0);if((nd===PW||!nd)&&setTimeout)return nd=setTimeout,setTimeout(e,0);try{return nd(e,0)}catch{try{return nd.call(null,e,0)}catch{return nd.call(this,e,0)}}}function Sxt(e){if(id===clearTimeout)return clearTimeout(e);if((id===NW||!id)&&clearTimeout)return id=clearTimeout,clearTimeout(e);try{return id(e)}catch{try{return id.call(null,e)}catch{return id.call(this,e)}}}var ep=[],sy=!1,tm,GH=-1;function kxt(){!sy||!tm||(sy=!1,tm.length?ep=tm.concat(ep):GH=-1,ep.length&&G5e())}function G5e(){if(!sy){var e=U5e(kxt);sy=!0;for(var t=ep.length;t;){for(tm=ep,ep=[];++GH<t;)tm&&tm[GH].run();GH=-1,t=ep.length}tm=null,sy=!1,Sxt(e)}}cs.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];ep.push(new q5e(e,t)),ep.length===1&&!sy&&U5e(G5e)};function q5e(e,t){this.fun=e,this.array=t}q5e.prototype.run=function(){this.fun.apply(null,this.array)},cs.title="browser",cs.browser=!0,cs.env={},cs.argv=[],cs.version="",cs.versions={};function tp(){}cs.on=tp,cs.addListener=tp,cs.once=tp,cs.off=tp,cs.removeListener=tp,cs.removeAllListeners=tp,cs.emit=tp,cs.prependListener=tp,cs.prependOnceListener=tp,cs.listeners=function(e){return[]},cs.binding=function(e){throw new Error("process.binding is not supported")},cs.cwd=function(){return"/"},cs.chdir=function(e){throw new Error("process.chdir is not supported")},cs.umask=function(){return 0};var Mxt=j5e.exports;const ly=Lxt(Mxt),rp=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)},cy=globalThis||void 0||self;var W5e;const Ec=typeof window<"u",Cxt=e=>typeof e=="string",Z5e=()=>{},Ext=Ec&&((W5e=window==null?void 0:window.navigator)==null?void 0:W5e.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function K5e(e){return typeof e=="function"?e():a.unref(e)}function Axt(e){return e}function qH(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function Oxt(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function np(e){var t;const r=K5e(e);return(t=r==null?void 0:r.$el)!=null?t:r}const WH=Ec?window:void 0;function rm(...e){let t,r,n,i;if(Cxt(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=WH):[t,r,n,i]=e,!t)return Z5e;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,p,h,f)=>(d.addEventListener(p,h,f),()=>d.removeEventListener(p,h,f)),c=a.watch(()=>[np(t),K5e(i)],([d,p])=>{s(),d&&o.push(...r.flatMap(h=>n.map(f=>l(d,h,f,p))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return qH(u),u}let X5e=!1;function Hxt(e,t,r={}){const{window:n=WH,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;Ext&&!X5e&&(X5e=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",Z5e)));let l=!0;const c=d=>i.some(p=>{if(typeof p=="string")return Array.from(n.document.querySelectorAll(p)).some(h=>h===d.target||d.composedPath().includes(h));{const h=np(p);return h&&(d.target===h||d.composedPath().includes(h))}}),u=[rm(n,"click",d=>{const p=np(e);if(!(!p||p===d.target||d.composedPath().includes(p))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),rm(n,"pointerdown",d=>{const p=np(e);p&&(l=!d.composedPath().includes(p)&&!c(d))},{passive:!0}),s&&rm(n,"blur",d=>{var p;const h=np(e);((p=n.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(h!=null&&h.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function J5e(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),Oxt(n,t),r}const BW=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof cy<"u"?cy:typeof self<"u"?self:{},RW="__vueuse_ssr_handlers__";BW[RW]=BW[RW]||{},BW[RW];var Y5e=Object.getOwnPropertySymbols,Vxt=Object.prototype.hasOwnProperty,Ixt=Object.prototype.propertyIsEnumerable,Pxt=(e,t)=>{var r={};for(var n in e)Vxt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Y5e)for(var n of Y5e(e))t.indexOf(n)<0&&Ixt.call(e,n)&&(r[n]=e[n]);return r};function ip(e,t,r={}){const n=r,{window:i=WH}=n,o=Pxt(n,["window"]);let s;const l=J5e(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>np(e),p=>{c(),l.value&&i&&p&&(s=new ResizeObserver(t),s.observe(p,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return qH(d),{isSupported:l,stop:d}}var $5e=Object.getOwnPropertySymbols,Nxt=Object.prototype.hasOwnProperty,Bxt=Object.prototype.propertyIsEnumerable,Rxt=(e,t)=>{var r={};for(var n in e)Nxt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$5e)for(var n of $5e(e))t.indexOf(n)<0&&Bxt.call(e,n)&&(r[n]=e[n]);return r};function Fxt(e,t,r={}){const n=r,{window:i=WH}=n,o=Rxt(n,["window"]);let s;const l=J5e(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>np(e),p=>{c(),l.value&&i&&p&&(s=new MutationObserver(t),s.observe(p,o))},{immediate:!0}),d=()=>{c(),u()};return qH(d),{isSupported:l,stop:d}}var efe;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(efe||(efe={}));var Dxt=Object.defineProperty,tfe=Object.getOwnPropertySymbols,zxt=Object.prototype.hasOwnProperty,jxt=Object.prototype.propertyIsEnumerable,rfe=(e,t,r)=>t in e?Dxt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Uxt=(e,t)=>{for(var r in t||(t={}))zxt.call(t,r)&&rfe(e,r,t[r]);if(tfe)for(var r of tfe(t))jxt.call(t,r)&&rfe(e,r,t[r]);return e};Uxt({linear:Axt},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Gxt=()=>Ec&&/firefox/i.test(window.navigator.userAgent);ly.env.NODE_ENV!=="production"&&Object.freeze({}),ly.env.NODE_ENV!=="production"&&Object.freeze([]);const K_=()=>{},qxt=Object.prototype.hasOwnProperty,nfe=(e,t)=>qxt.call(e,t),u0=Array.isArray,d0=e=>typeof e=="function",od=e=>typeof e=="string",p0=e=>e!==null&&typeof e=="object",Wxt=Object.prototype.toString,Zxt=e=>Wxt.call(e),FW=e=>Zxt(e).slice(8,-1);var ife=typeof cy=="object"&&cy&&cy.Object===Object&&cy,Kxt=typeof self=="object"&&self&&self.Object===Object&&self,ad=ife||Kxt||Function("return this")(),Ah=ad.Symbol,ofe=Object.prototype,Xxt=ofe.hasOwnProperty,Jxt=ofe.toString,X_=Ah?Ah.toStringTag:void 0;function Yxt(e){var t=Xxt.call(e,X_),r=e[X_];try{e[X_]=void 0;var n=!0}catch{}var i=Jxt.call(e);return n&&(t?e[X_]=r:delete e[X_]),i}var $xt=Object.prototype,e_t=$xt.toString;function t_t(e){return e_t.call(e)}var r_t="[object Null]",n_t="[object Undefined]",afe=Ah?Ah.toStringTag:void 0;function uy(e){return e==null?e===void 0?n_t:r_t:afe&&afe in Object(e)?Yxt(e):t_t(e)}function dy(e){return e!=null&&typeof e=="object"}var i_t="[object Symbol]";function ZH(e){return typeof e=="symbol"||dy(e)&&uy(e)==i_t}function o_t(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var sd=Array.isArray,a_t=1/0,sfe=Ah?Ah.prototype:void 0,lfe=sfe?sfe.toString:void 0;function cfe(e){if(typeof e=="string")return e;if(sd(e))return o_t(e,cfe)+"";if(ZH(e))return lfe?lfe.call(e):"";var t=e+"";return t=="0"&&1/e==-a_t?"-0":t}var s_t=/\s/;function l_t(e){for(var t=e.length;t--&&s_t.test(e.charAt(t)););return t}var c_t=/^\s+/;function u_t(e){return e&&e.slice(0,l_t(e)+1).replace(c_t,"")}function py(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ufe=NaN,d_t=/^[-+]0x[0-9a-f]+$/i,p_t=/^0b[01]+$/i,h_t=/^0o[0-7]+$/i,f_t=parseInt;function DW(e){if(typeof e=="number")return e;if(ZH(e))return ufe;if(py(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=py(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=u_t(e);var r=p_t.test(e);return r||h_t.test(e)?f_t(e.slice(2),r?2:8):d_t.test(e)?ufe:+e}var dfe=1/0,m_t=17976931348623157e292;function g_t(e){if(!e)return e===0?e:0;if(e=DW(e),e===dfe||e===-dfe){var t=e<0?-1:1;return t*m_t}return e===e?e:0}function y_t(e){var t=g_t(e),r=t%1;return t===t?r?t-r:t:0}function T_t(e){return e}var v_t="[object AsyncFunction]",Q_t="[object Function]",b_t="[object GeneratorFunction]",x_t="[object Proxy]";function pfe(e){if(!py(e))return!1;var t=uy(e);return t==Q_t||t==b_t||t==v_t||t==x_t}var zW=ad["__core-js_shared__"],hfe=function(){var e=/[^.]+$/.exec(zW&&zW.keys&&zW.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function __t(e){return!!hfe&&hfe in e}var w_t=Function.prototype,L_t=w_t.toString;function nm(e){if(e!=null){try{return L_t.call(e)}catch{}try{return e+""}catch{}}return""}var S_t=/[\\^$.*+?()[\]{}|]/g,k_t=/^\[object .+?Constructor\]$/,M_t=Function.prototype,C_t=Object.prototype,E_t=M_t.toString,A_t=C_t.hasOwnProperty,O_t=RegExp("^"+E_t.call(A_t).replace(S_t,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function H_t(e){if(!py(e)||__t(e))return!1;var t=pfe(e)?O_t:k_t;return t.test(nm(e))}function V_t(e,t){return e==null?void 0:e[t]}function hy(e,t){var r=V_t(e,t);return H_t(r)?r:void 0}var jW=hy(ad,"WeakMap");function I_t(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var P_t=9007199254740991,N_t=/^(?:0|[1-9]\d*)$/;function ffe(e,t){var r=typeof e;return t=t??P_t,!!t&&(r=="number"||r!="symbol"&&N_t.test(e))&&e>-1&&e%1==0&&e<t}function mfe(e,t){return e===t||e!==e&&t!==t}var B_t=9007199254740991;function UW(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=B_t}function R_t(e){return e!=null&&UW(e.length)&&!pfe(e)}var F_t=Object.prototype;function D_t(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||F_t;return e===r}function z_t(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var j_t="[object Arguments]";function gfe(e){return dy(e)&&uy(e)==j_t}var yfe=Object.prototype,U_t=yfe.hasOwnProperty,G_t=yfe.propertyIsEnumerable,Tfe=gfe(function(){return arguments}())?gfe:function(e){return dy(e)&&U_t.call(e,"callee")&&!G_t.call(e,"callee")};function q_t(){return!1}var vfe=typeof bn=="object"&&bn&&!bn.nodeType&&bn,Qfe=vfe&&typeof module=="object"&&module&&!module.nodeType&&module,W_t=Qfe&&Qfe.exports===vfe,bfe=W_t?ad.Buffer:void 0,Z_t=bfe?bfe.isBuffer:void 0,GW=Z_t||q_t,K_t="[object Arguments]",X_t="[object Array]",J_t="[object Boolean]",Y_t="[object Date]",$_t="[object Error]",ewt="[object Function]",twt="[object Map]",rwt="[object Number]",nwt="[object Object]",iwt="[object RegExp]",owt="[object Set]",awt="[object String]",swt="[object WeakMap]",lwt="[object ArrayBuffer]",cwt="[object DataView]",uwt="[object Float32Array]",dwt="[object Float64Array]",pwt="[object Int8Array]",hwt="[object Int16Array]",fwt="[object Int32Array]",mwt="[object Uint8Array]",gwt="[object Uint8ClampedArray]",ywt="[object Uint16Array]",Twt="[object Uint32Array]",fa={};fa[uwt]=fa[dwt]=fa[pwt]=fa[hwt]=fa[fwt]=fa[mwt]=fa[gwt]=fa[ywt]=fa[Twt]=!0,fa[K_t]=fa[X_t]=fa[lwt]=fa[J_t]=fa[cwt]=fa[Y_t]=fa[$_t]=fa[ewt]=fa[twt]=fa[rwt]=fa[nwt]=fa[iwt]=fa[owt]=fa[awt]=fa[swt]=!1;function vwt(e){return dy(e)&&UW(e.length)&&!!fa[uy(e)]}function Qwt(e){return function(t){return e(t)}}var xfe=typeof bn=="object"&&bn&&!bn.nodeType&&bn,J_=xfe&&typeof module=="object"&&module&&!module.nodeType&&module,bwt=J_&&J_.exports===xfe,qW=bwt&&ife.process,_fe=function(){try{var e=J_&&J_.require&&J_.require("util").types;return e||qW&&qW.binding&&qW.binding("util")}catch{}}(),wfe=_fe&&_fe.isTypedArray,Lfe=wfe?Qwt(wfe):vwt,xwt=Object.prototype,_wt=xwt.hasOwnProperty;function wwt(e,t){var r=sd(e),n=!r&&Tfe(e),i=!r&&!n&&GW(e),o=!r&&!n&&!i&&Lfe(e),s=r||n||i||o,l=s?z_t(e.length,String):[],c=l.length;for(var u in e)(t||_wt.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ffe(u,c)))&&l.push(u);return l}function Lwt(e,t){return function(r){return e(t(r))}}var Swt=Lwt(Object.keys,Object),kwt=Object.prototype,Mwt=kwt.hasOwnProperty;function Cwt(e){if(!D_t(e))return Swt(e);var t=[];for(var r in Object(e))Mwt.call(e,r)&&r!="constructor"&&t.push(r);return t}function Sfe(e){return R_t(e)?wwt(e):Cwt(e)}var Ewt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Awt=/^\w*$/;function WW(e,t){if(sd(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||ZH(e)?!0:Awt.test(e)||!Ewt.test(e)||t!=null&&e in Object(t)}var Y_=hy(Object,"create");function Owt(){this.__data__=Y_?Y_(null):{},this.size=0}function Hwt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Vwt="__lodash_hash_undefined__",Iwt=Object.prototype,Pwt=Iwt.hasOwnProperty;function Nwt(e){var t=this.__data__;if(Y_){var r=t[e];return r===Vwt?void 0:r}return Pwt.call(t,e)?t[e]:void 0}var Bwt=Object.prototype,Rwt=Bwt.hasOwnProperty;function Fwt(e){var t=this.__data__;return Y_?t[e]!==void 0:Rwt.call(t,e)}var Dwt="__lodash_hash_undefined__";function zwt(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Y_&&t===void 0?Dwt:t,this}function im(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}im.prototype.clear=Owt,im.prototype.delete=Hwt,im.prototype.get=Nwt,im.prototype.has=Fwt,im.prototype.set=zwt;function jwt(){this.__data__=[],this.size=0}function KH(e,t){for(var r=e.length;r--;)if(mfe(e[r][0],t))return r;return-1}var Uwt=Array.prototype,Gwt=Uwt.splice;function qwt(e){var t=this.__data__,r=KH(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Gwt.call(t,r,1),--this.size,!0}function Wwt(e){var t=this.__data__,r=KH(t,e);return r<0?void 0:t[r][1]}function Zwt(e){return KH(this.__data__,e)>-1}function Kwt(e,t){var r=this.__data__,n=KH(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function op(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}op.prototype.clear=jwt,op.prototype.delete=qwt,op.prototype.get=Wwt,op.prototype.has=Zwt,op.prototype.set=Kwt;var $_=hy(ad,"Map");function Xwt(){this.size=0,this.__data__={hash:new im,map:new($_||op),string:new im}}function Jwt(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function XH(e,t){var r=e.__data__;return Jwt(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Ywt(e){var t=XH(this,e).delete(e);return this.size-=t?1:0,t}function $wt(e){return XH(this,e).get(e)}function eLt(e){return XH(this,e).has(e)}function tLt(e,t){var r=XH(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function ap(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ap.prototype.clear=Xwt,ap.prototype.delete=Ywt,ap.prototype.get=$wt,ap.prototype.has=eLt,ap.prototype.set=tLt;var rLt="Expected a function";function ZW(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(rLt);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(ZW.Cache||ap),r}ZW.Cache=ap;var nLt=500;function iLt(e){var t=ZW(e,function(n){return r.size===nLt&&r.clear(),n}),r=t.cache;return t}var oLt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aLt=/\\(\\)?/g,sLt=iLt(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(oLt,function(r,n,i,o){t.push(i?o.replace(aLt,"$1"):n||r)}),t});function lLt(e){return e==null?"":cfe(e)}function kfe(e,t){return sd(e)?e:WW(e,t)?[e]:sLt(lLt(e))}var cLt=1/0;function JH(e){if(typeof e=="string"||ZH(e))return e;var t=e+"";return t=="0"&&1/e==-cLt?"-0":t}function Mfe(e,t){t=kfe(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[JH(t[r++])];return r&&r==n?e:void 0}function sp(e,t,r){var n=e==null?void 0:Mfe(e,t);return n===void 0?r:n}function uLt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Cfe(){if(!arguments.length)return[];var e=arguments[0];return sd(e)?e:[e]}function dLt(){this.__data__=new op,this.size=0}function pLt(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function hLt(e){return this.__data__.get(e)}function fLt(e){return this.__data__.has(e)}var mLt=200;function gLt(e,t){var r=this.__data__;if(r instanceof op){var n=r.__data__;if(!$_||n.length<mLt-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ap(n)}return r.set(e,t),this.size=r.size,this}function lp(e){var t=this.__data__=new op(e);this.size=t.size}lp.prototype.clear=dLt,lp.prototype.delete=pLt,lp.prototype.get=hLt,lp.prototype.has=fLt,lp.prototype.set=gLt;function yLt(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function TLt(){return[]}var vLt=Object.prototype,QLt=vLt.propertyIsEnumerable,Efe=Object.getOwnPropertySymbols,bLt=Efe?function(e){return e==null?[]:(e=Object(e),yLt(Efe(e),function(t){return QLt.call(e,t)}))}:TLt;const xLt=bLt;function _Lt(e,t,r){var n=t(e);return sd(e)?n:uLt(n,r(e))}function Afe(e){return _Lt(e,Sfe,xLt)}var KW=hy(ad,"DataView"),XW=hy(ad,"Promise"),JW=hy(ad,"Set"),Ofe="[object Map]",wLt="[object Object]",Hfe="[object Promise]",Vfe="[object Set]",Ife="[object WeakMap]",Pfe="[object DataView]",LLt=nm(KW),SLt=nm($_),kLt=nm(XW),MLt=nm(JW),CLt=nm(jW),om=uy;(KW&&om(new KW(new ArrayBuffer(1)))!=Pfe||$_&&om(new $_)!=Ofe||XW&&om(XW.resolve())!=Hfe||JW&&om(new JW)!=Vfe||jW&&om(new jW)!=Ife)&&(om=function(e){var t=uy(e),r=t==wLt?e.constructor:void 0,n=r?nm(r):"";if(n)switch(n){case LLt:return Pfe;case SLt:return Ofe;case kLt:return Hfe;case MLt:return Vfe;case CLt:return Ife}return t});const Nfe=om;var ELt=ad.Uint8Array;const Bfe=ELt;var ALt="__lodash_hash_undefined__";function OLt(e){return this.__data__.set(e,ALt),this}function HLt(e){return this.__data__.has(e)}function YH(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new ap;++t<r;)this.add(e[t])}YH.prototype.add=YH.prototype.push=OLt,YH.prototype.has=HLt;function VLt(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function ILt(e,t){return e.has(t)}var PLt=1,NLt=2;function Rfe(e,t,r,n,i,o){var s=r&PLt,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var p=-1,h=!0,f=r&NLt?new YH:void 0;for(o.set(e,t),o.set(t,e);++p<l;){var m=e[p],g=t[p];if(n)var T=s?n(g,m,p,t,e,o):n(m,g,p,e,t,o);if(T!==void 0){if(T)continue;h=!1;break}if(f){if(!VLt(t,function(y,v){if(!ILt(f,v)&&(m===y||i(m,y,r,n,o)))return f.push(v)})){h=!1;break}}else if(!(m===g||i(m,g,r,n,o))){h=!1;break}}return o.delete(e),o.delete(t),h}function BLt(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function RLt(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var FLt=1,DLt=2,zLt="[object Boolean]",jLt="[object Date]",ULt="[object Error]",GLt="[object Map]",qLt="[object Number]",WLt="[object RegExp]",ZLt="[object Set]",KLt="[object String]",XLt="[object Symbol]",JLt="[object ArrayBuffer]",YLt="[object DataView]",Ffe=Ah?Ah.prototype:void 0,YW=Ffe?Ffe.valueOf:void 0;function $Lt(e,t,r,n,i,o,s){switch(r){case YLt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case JLt:return!(e.byteLength!=t.byteLength||!o(new Bfe(e),new Bfe(t)));case zLt:case jLt:case qLt:return mfe(+e,+t);case ULt:return e.name==t.name&&e.message==t.message;case WLt:case KLt:return e==t+"";case GLt:var l=BLt;case ZLt:var c=n&FLt;if(l||(l=RLt),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=DLt,s.set(e,t);var d=Rfe(l(e),l(t),n,i,o,s);return s.delete(e),d;case XLt:if(YW)return YW.call(e)==YW.call(t)}return!1}var eSt=1,tSt=Object.prototype,rSt=tSt.hasOwnProperty;function nSt(e,t,r,n,i,o){var s=r&eSt,l=Afe(e),c=l.length,u=Afe(t),d=u.length;if(c!=d&&!s)return!1;for(var p=c;p--;){var h=l[p];if(!(s?h in t:rSt.call(t,h)))return!1}var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var g=!0;o.set(e,t),o.set(t,e);for(var T=s;++p<c;){h=l[p];var y=e[h],v=t[h];if(n)var _=s?n(v,y,h,t,e,o):n(y,v,h,e,t,o);if(!(_===void 0?y===v||i(y,v,r,n,o):_)){g=!1;break}T||(T=h=="constructor")}if(g&&!T){var b=e.constructor,L=t.constructor;b!=L&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof L=="function"&&L instanceof L)&&(g=!1)}return o.delete(e),o.delete(t),g}var iSt=1,Dfe="[object Arguments]",zfe="[object Array]",$H="[object Object]",oSt=Object.prototype,jfe=oSt.hasOwnProperty;function aSt(e,t,r,n,i,o){var s=sd(e),l=sd(t),c=s?zfe:Nfe(e),u=l?zfe:Nfe(t);c=c==Dfe?$H:c,u=u==Dfe?$H:u;var d=c==$H,p=u==$H,h=c==u;if(h&&GW(e)){if(!GW(t))return!1;s=!0,d=!1}if(h&&!d)return o||(o=new lp),s||Lfe(e)?Rfe(e,t,r,n,i,o):$Lt(e,t,c,r,n,i,o);if(!(r&iSt)){var f=d&&jfe.call(e,"__wrapped__"),m=p&&jfe.call(t,"__wrapped__");if(f||m){var g=f?e.value():e,T=m?t.value():t;return o||(o=new lp),i(g,T,r,n,o)}}return h?(o||(o=new lp),nSt(e,t,r,n,i,o)):!1}function eV(e,t,r,n,i){return e===t?!0:e==null||t==null||!dy(e)&&!dy(t)?e!==e&&t!==t:aSt(e,t,r,n,eV,i)}var sSt=1,lSt=2;function cSt(e,t,r,n){var i=r.length,o=i,s=!n;if(e==null)return!o;for(e=Object(e);i--;){var l=r[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<o;){l=r[i];var c=l[0],u=e[c],d=l[1];if(s&&l[2]){if(u===void 0&&!(c in e))return!1}else{var p=new lp;if(n)var h=n(u,d,c,e,t,p);if(!(h===void 0?eV(d,u,sSt|lSt,n,p):h))return!1}}return!0}function Ufe(e){return e===e&&!py(e)}function uSt(e){for(var t=Sfe(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ufe(i)]}return t}function Gfe(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function dSt(e){var t=uSt(e);return t.length==1&&t[0][2]?Gfe(t[0][0],t[0][1]):function(r){return r===e||cSt(r,e,t)}}function pSt(e,t){return e!=null&&t in Object(e)}function hSt(e,t,r){t=kfe(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var s=JH(t[n]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&UW(i)&&ffe(s,i)&&(sd(e)||Tfe(e)))}function fSt(e,t){return e!=null&&hSt(e,t,pSt)}var mSt=1,gSt=2;function ySt(e,t){return WW(e)&&Ufe(t)?Gfe(JH(e),t):function(r){var n=sp(r,e);return n===void 0&&n===t?fSt(r,e):eV(t,n,mSt|gSt)}}function TSt(e){return function(t){return t==null?void 0:t[e]}}function vSt(e){return function(t){return Mfe(t,e)}}function QSt(e){return WW(e)?TSt(JH(e)):vSt(e)}function bSt(e){return typeof e=="function"?e:e==null?T_t:typeof e=="object"?sd(e)?ySt(e[0],e[1]):dSt(e):QSt(e)}var $W=function(){return ad.Date.now()},xSt="Expected a function",_St=Math.max,wSt=Math.min;function LSt(e,t,r){var n,i,o,s,l,c,u=0,d=!1,p=!1,h=!0;if(typeof e!="function")throw new TypeError(xSt);t=DW(t)||0,py(r)&&(d=!!r.leading,p="maxWait"in r,o=p?_St(DW(r.maxWait)||0,t):o,h="trailing"in r?!!r.trailing:h);function f(w){var k=n,C=i;return n=i=void 0,u=w,s=e.apply(C,k),s}function m(w){return u=w,l=setTimeout(y,t),d?f(w):s}function g(w){var k=w-c,C=w-u,A=t-k;return p?wSt(A,o-C):A}function T(w){var k=w-c,C=w-u;return c===void 0||k>=t||k<0||p&&C>=o}function y(){var w=$W();if(T(w))return v(w);l=setTimeout(y,g(w))}function v(w){return l=void 0,h&&n?f(w):(n=i=void 0,s)}function _(){l!==void 0&&clearTimeout(l),u=0,n=c=i=l=void 0}function b(){return l===void 0?s:v($W())}function L(){var w=$W(),k=T(w);if(n=arguments,i=this,c=w,k){if(l===void 0)return m(c);if(p)return clearTimeout(l),l=setTimeout(y,t),f(c)}return l===void 0&&(l=setTimeout(y,t)),s}return L.cancel=_,L.flush=b,L}var SSt=Math.max,kSt=Math.min;function MSt(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=n-1;return r!==void 0&&(i=y_t(r),i=r<0?SSt(n+i,0):kSt(i,n-1)),I_t(e,bSt(t),i,!0)}function tV(e){for(var t=-1,r=e==null?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n}function ew(e,t){return eV(e,t)}function rV(e){return e==null}function CSt(e){return e===void 0}const qfe=e=>e===void 0,eZ=e=>typeof e=="boolean",V1=e=>typeof e=="number",tw=e=>typeof Element>"u"?!1:e instanceof Element,ESt=e=>od(e)?!Number.isNaN(Number(e)):!1,ASt=(e="")=>e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d");let Wfe=class extends Error{constructor(t){super(t),this.name="ElementPlusError"}};function OSt(e,t){throw new Wfe(`[${e}] ${t}`)}function h0(e,t){if(ly.env.NODE_ENV!=="production"){const r=od(e)?new Wfe(`[${e}] ${t}`):e;console.warn(r)}}const HSt="utils/dom/style";function nV(e,t="px"){if(!e)return"";if(V1(e)||ESt(e))return`${e}${t}`;if(od(e))return e;h0(HSt,"binding value must be a string or number")}function VSt(e,t){if(!Ec)return;if(!t){e.scrollTop=0;return}const r=[];let n=t.offsetParent;for(;n!==null&&e!==n&&e.contains(n);)r.push(n),n=n.offsetParent;const i=t.offsetTop+r.reduce((c,u)=>c+u.offsetTop,0),o=i+t.offsetHeight,s=e.scrollTop,l=s+e.clientHeight;i<s?e.scrollTop=i:o>l&&(e.scrollTop=o-e.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var ISt=a.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),PSt=ISt,NSt=a.defineComponent({name:"ArrowRight",__name:"arrow-right",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),BSt=NSt,RSt=a.defineComponent({name:"CircleCheck",__name:"circle-check",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),a.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),FSt=RSt,DSt=a.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),a.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),tZ=DSt,zSt=a.defineComponent({name:"Close",__name:"close",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Zfe=zSt,jSt=a.defineComponent({name:"Hide",__name:"hide",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),a.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),USt=jSt,GSt=a.defineComponent({name:"Loading",__name:"loading",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),Kfe=GSt,qSt=a.defineComponent({name:"View",__name:"view",setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),WSt=qSt;const Xfe="__epPropKey",ki=e=>e,ZSt=e=>p0(e)&&!!e[Xfe],iV=(e,t)=>{if(!p0(e)||ZSt(e))return e;const{values:r,required:n,default:i,type:o,validator:s}=e,l={type:o,required:!!n,validator:r||s?c=>{let u=!1,d=[];if(r&&(d=Array.from(r),nfe(e,"default")&&d.push(i),u||(u=d.includes(c))),s&&(u||(u=s(c))),!u&&d.length>0){const p=[...new Set(d)].map(h=>JSON.stringify(h)).join(", ");a.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${p}], got value ${JSON.stringify(c)}.`)}return u}:void 0,[Xfe]:!0};return nfe(e,"default")&&(l.default=i),l},Na=e=>tV(Object.entries(e).map(([t,r])=>[t,iV(r,t)])),am=ki([String,Object,Function]),Jfe={validating:Kfe,success:FSt,error:tZ},ld=(e,t)=>{if(e.install=r=>{for(const n of[e,...Object.values(t??{})])r.component(n.name,n)},t)for(const[r,n]of Object.entries(t))e[r]=n;return e},KSt=(e,t)=>(e.install=r=>{r.directive(t,e)},e),oV=e=>(e.install=K_,e),rw={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},x2="update:modelValue",aV="change",Yfe=["","default","small","large"],$fe=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e),e8e=e=>e,XSt=["class","style"],JSt=/^on[A-Z]/,YSt=(e={})=>{const{excludeListeners:t=!1,excludeKeys:r}=e,n=a.computed(()=>((r==null?void 0:r.value)||[]).concat(XSt)),i=a.getCurrentInstance();return i?a.computed(()=>{var o;return tV(Object.entries((o=i.proxy)==null?void 0:o.$attrs).filter(([s])=>!n.value.includes(s)&&!(t&&JSt.test(s))))}):(h0("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),a.computed(()=>({})))},t8e=({from:e,replacement:t,scope:r,version:n,ref:i,type:o="API"},s)=>{a.watch(()=>a.unref(s),l=>{l&&h0(r,`[${o}] ${e} is about to be deprecated in version ${n}, please use ${t} instead.
1086
1086
  For more detail, please visit: ${i}
1087
1087
  `)},{immediate:!0})};var $St={name:"en",el:{colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color."},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"}}};const ekt=e=>(t,r)=>tkt(t,r,a.unref(e)),tkt=(e,t,r)=>sp(r,e,e).replace(/\{(\w+)\}/g,(n,i)=>{var o;return`${(o=t==null?void 0:t[i])!=null?o:`{${i}}`}`}),rkt=e=>{const t=a.computed(()=>a.unref(e).name),r=a.isRef(e)?e:a.ref(e);return{lang:t,locale:r,t:ekt(e)}},nkt=Symbol("localeContextKey"),ikt=e=>{const t=e||a.inject(nkt,a.ref());return rkt(a.computed(()=>t.value||$St))},rZ="el",okt="is-",sm=(e,t,r,n,i)=>{let o=`${e}-${t}`;return r&&(o+=`-${r}`),n&&(o+=`__${n}`),i&&(o+=`--${i}`),o},akt=Symbol("namespaceContextKey"),nZ=e=>{const t=e||(a.getCurrentInstance()?a.inject(akt,a.ref(rZ)):a.ref(rZ));return a.computed(()=>a.unref(t)||rZ)},La=(e,t)=>{const r=nZ(t);return{namespace:r,b:(n="")=>sm(r.value,e,n,"",""),e:n=>n?sm(r.value,e,"",n,""):"",m:n=>n?sm(r.value,e,"","",n):"",be:(n,i)=>n&&i?sm(r.value,e,n,i,""):"",em:(n,i)=>n&&i?sm(r.value,e,"",n,i):"",bm:(n,i)=>n&&i?sm(r.value,e,n,"",i):"",bem:(n,i,o)=>n&&i&&o?sm(r.value,e,n,i,o):"",is:(n,...i)=>{const o=i.length>=1?i[0]:!0;return n&&o?`${okt}${n}`:""},cssVar:n=>{const i={};for(const o in n)n[o]&&(i[`--${r.value}-${o}`]=n[o]);return i},cssVarName:n=>`--${r.value}-${n}`,cssVarBlock:n=>{const i={};for(const o in n)n[o]&&(i[`--${r.value}-${e}-${o}`]=n[o]);return i},cssVarBlockName:n=>`--${r.value}-${e}-${n}`}},skt=iV({type:ki(Boolean),default:null}),lkt=iV({type:ki(Function)}),ckt=e=>{const t=`update:${e}`,r=`onUpdate:${e}`,n=[t],i={[e]:skt,[r]:lkt};return{useModelToggle:({indicator:o,toggleReason:s,shouldHideWhenRouteChanges:l,shouldProceed:c,onShow:u,onHide:d})=>{const p=a.getCurrentInstance(),{emit:h}=p,f=p.props,m=a.computed(()=>d0(f[r])),g=a.computed(()=>f[e]===null),T=w=>{o.value!==!0&&(o.value=!0,s&&(s.value=w),d0(u)&&u(w))},y=w=>{o.value!==!1&&(o.value=!1,s&&(s.value=w),d0(d)&&d(w))},v=w=>{if(f.disabled===!0||d0(c)&&!c())return;const k=m.value&&Ec;k&&h(t,!0),(g.value||!k)&&T(w)},_=w=>{if(f.disabled===!0||!Ec)return;const k=m.value&&Ec;k&&h(t,!1),(g.value||!k)&&y(w)},b=w=>{eZ(w)&&(f.disabled&&w?m.value&&h(t,!1):o.value!==w&&(w?T():y()))},L=()=>{o.value?_():v()};return a.watch(()=>f[e],b),l&&p.appContext.config.globalProperties.$route!==void 0&&a.watch(()=>({...p.proxy.$route}),()=>{l.value&&o.value&&_()}),a.onMounted(()=>{b(f[e])}),{hide:_,show:v,toggle:L,hasUpdateHandler:m}},useModelToggleProps:i,useModelToggleEmits:n}},r8e=e=>{const t=a.getCurrentInstance();return a.computed(()=>{var r,n;return(n=(r=t==null?void 0:t.proxy)==null?void 0:r.$props)==null?void 0:n[e]})};var I1="top",f0="bottom",m0="right",P1="left",iZ="auto",nw=[I1,f0,m0,P1],fy="start",iw="end",ukt="clippingParents",n8e="viewport",ow="popper",dkt="reference",i8e=nw.reduce(function(e,t){return e.concat([t+"-"+fy,t+"-"+iw])},[]),sV=[].concat(nw,[iZ]).reduce(function(e,t){return e.concat([t,t+"-"+fy,t+"-"+iw])},[]),pkt="beforeRead",hkt="read",fkt="afterRead",mkt="beforeMain",gkt="main",ykt="afterMain",Tkt="beforeWrite",vkt="write",Qkt="afterWrite",bkt=[pkt,hkt,fkt,mkt,gkt,ykt,Tkt,vkt,Qkt];function cd(e){return e?(e.nodeName||"").toLowerCase():null}function Hu(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function my(e){var t=Hu(e).Element;return e instanceof t||e instanceof Element}function g0(e){var t=Hu(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function oZ(e){if(typeof ShadowRoot>"u")return!1;var t=Hu(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function xkt(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},i=t.attributes[r]||{},o=t.elements[r];!g0(o)||!cd(o)||(Object.assign(o.style,n),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function _kt(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var i=t.elements[n],o=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),l=s.reduce(function(c,u){return c[u]="",c},{});!g0(i)||!cd(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}var o8e={name:"applyStyles",enabled:!0,phase:"write",fn:xkt,effect:_kt,requires:["computeStyles"]};function ud(e){return e.split("-")[0]}var lm=Math.max,lV=Math.min,gy=Math.round;function yy(e,t){t===void 0&&(t=!1);var r=e.getBoundingClientRect(),n=1,i=1;if(g0(e)&&t){var o=e.offsetHeight,s=e.offsetWidth;s>0&&(n=gy(r.width)/s||1),o>0&&(i=gy(r.height)/o||1)}return{width:r.width/n,height:r.height/i,top:r.top/i,right:r.right/n,bottom:r.bottom/i,left:r.left/n,x:r.left/n,y:r.top/i}}function aZ(e){var t=yy(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function a8e(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&oZ(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function cp(e){return Hu(e).getComputedStyle(e)}function wkt(e){return["table","td","th"].indexOf(cd(e))>=0}function Oh(e){return((my(e)?e.ownerDocument:e.document)||window.document).documentElement}function cV(e){return cd(e)==="html"?e:e.assignedSlot||e.parentNode||(oZ(e)?e.host:null)||Oh(e)}function s8e(e){return!g0(e)||cp(e).position==="fixed"?null:e.offsetParent}function Lkt(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,r=navigator.userAgent.indexOf("Trident")!==-1;if(r&&g0(e)){var n=cp(e);if(n.position==="fixed")return null}var i=cV(e);for(oZ(i)&&(i=i.host);g0(i)&&["html","body"].indexOf(cd(i))<0;){var o=cp(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function aw(e){for(var t=Hu(e),r=s8e(e);r&&wkt(r)&&cp(r).position==="static";)r=s8e(r);return r&&(cd(r)==="html"||cd(r)==="body"&&cp(r).position==="static")?t:r||Lkt(e)||t}function sZ(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function sw(e,t,r){return lm(e,lV(t,r))}function Skt(e,t,r){var n=sw(e,t,r);return n>r?r:n}function l8e(){return{top:0,right:0,bottom:0,left:0}}function c8e(e){return Object.assign({},l8e(),e)}function u8e(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var kkt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,c8e(typeof e!="number"?e:u8e(e,nw))};function Mkt(e){var t,r=e.state,n=e.name,i=e.options,o=r.elements.arrow,s=r.modifiersData.popperOffsets,l=ud(r.placement),c=sZ(l),u=[P1,m0].indexOf(l)>=0,d=u?"height":"width";if(!(!o||!s)){var p=kkt(i.padding,r),h=aZ(o),f=c==="y"?I1:P1,m=c==="y"?f0:m0,g=r.rects.reference[d]+r.rects.reference[c]-s[c]-r.rects.popper[d],T=s[c]-r.rects.reference[c],y=aw(o),v=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,_=g/2-T/2,b=p[f],L=v-h[d]-p[m],w=v/2-h[d]/2+_,k=sw(b,w,L),C=c;r.modifiersData[n]=(t={},t[C]=k,t.centerOffset=k-w,t)}}function Ckt(e){var t=e.state,r=e.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||!a8e(t.elements.popper,i)||(t.elements.arrow=i))}var Ekt={name:"arrow",enabled:!0,phase:"main",fn:Mkt,effect:Ckt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ty(e){return e.split("-")[1]}var Akt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Okt(e){var t=e.x,r=e.y,n=window,i=n.devicePixelRatio||1;return{x:gy(t*i)/i||0,y:gy(r*i)/i||0}}function d8e(e){var t,r=e.popper,n=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,p=e.isFixed,h=s.x,f=h===void 0?0:h,m=s.y,g=m===void 0?0:m,T=typeof d=="function"?d({x:f,y:g}):{x:f,y:g};f=T.x,g=T.y;var y=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),_=P1,b=I1,L=window;if(u){var w=aw(r),k="clientHeight",C="clientWidth";if(w===Hu(r)&&(w=Oh(r),cp(w).position!=="static"&&l==="absolute"&&(k="scrollHeight",C="scrollWidth")),w=w,i===I1||(i===P1||i===m0)&&o===iw){b=f0;var A=p&&w===L&&L.visualViewport?L.visualViewport.height:w[k];g-=A-n.height,g*=c?1:-1}if(i===P1||(i===I1||i===f0)&&o===iw){_=m0;var O=p&&w===L&&L.visualViewport?L.visualViewport.width:w[C];f-=O-n.width,f*=c?1:-1}}var N=Object.assign({position:l},u&&Akt),I=d===!0?Okt({x:f,y:g}):{x:f,y:g};if(f=I.x,g=I.y,c){var R;return Object.assign({},N,(R={},R[b]=v?"0":"",R[_]=y?"0":"",R.transform=(L.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",R))}return Object.assign({},N,(t={},t[b]=v?g+"px":"",t[_]=y?f+"px":"",t.transform="",t))}function Hkt(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=n===void 0?!0:n,o=r.adaptive,s=o===void 0?!0:o,l=r.roundOffsets,c=l===void 0?!0:l,u={placement:ud(t.placement),variation:Ty(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,d8e(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,d8e(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var p8e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Hkt,data:{}},uV={passive:!0};function Vkt(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,o=i===void 0?!0:i,s=n.resize,l=s===void 0?!0:s,c=Hu(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",r.update,uV)}),l&&c.addEventListener("resize",r.update,uV),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",r.update,uV)}),l&&c.removeEventListener("resize",r.update,uV)}}var h8e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Vkt,data:{}},Ikt={left:"right",right:"left",bottom:"top",top:"bottom"};function dV(e){return e.replace(/left|right|bottom|top/g,function(t){return Ikt[t]})}var Pkt={start:"end",end:"start"};function f8e(e){return e.replace(/start|end/g,function(t){return Pkt[t]})}function lZ(e){var t=Hu(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function cZ(e){return yy(Oh(e)).left+lZ(e).scrollLeft}function Nkt(e){var t=Hu(e),r=Oh(e),n=t.visualViewport,i=r.clientWidth,o=r.clientHeight,s=0,l=0;return n&&(i=n.width,o=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=n.offsetLeft,l=n.offsetTop)),{width:i,height:o,x:s+cZ(e),y:l}}function Bkt(e){var t,r=Oh(e),n=lZ(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=lm(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=lm(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-n.scrollLeft+cZ(e),c=-n.scrollTop;return cp(i||r).direction==="rtl"&&(l+=lm(r.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:c}}function uZ(e){var t=cp(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function m8e(e){return["html","body","#document"].indexOf(cd(e))>=0?e.ownerDocument.body:g0(e)&&uZ(e)?e:m8e(cV(e))}function lw(e,t){var r;t===void 0&&(t=[]);var n=m8e(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=Hu(n),s=i?[o].concat(o.visualViewport||[],uZ(n)?n:[]):n,l=t.concat(s);return i?l:l.concat(lw(cV(s)))}function dZ(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Rkt(e){var t=yy(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function g8e(e,t){return t===n8e?dZ(Nkt(e)):my(t)?Rkt(t):dZ(Bkt(Oh(e)))}function Fkt(e){var t=lw(cV(e)),r=["absolute","fixed"].indexOf(cp(e).position)>=0,n=r&&g0(e)?aw(e):e;return my(n)?t.filter(function(i){return my(i)&&a8e(i,n)&&cd(i)!=="body"}):[]}function Dkt(e,t,r){var n=t==="clippingParents"?Fkt(e):[].concat(t),i=[].concat(n,[r]),o=i[0],s=i.reduce(function(l,c){var u=g8e(e,c);return l.top=lm(u.top,l.top),l.right=lV(u.right,l.right),l.bottom=lV(u.bottom,l.bottom),l.left=lm(u.left,l.left),l},g8e(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function y8e(e){var t=e.reference,r=e.element,n=e.placement,i=n?ud(n):null,o=n?Ty(n):null,s=t.x+t.width/2-r.width/2,l=t.y+t.height/2-r.height/2,c;switch(i){case I1:c={x:s,y:t.y-r.height};break;case f0:c={x:s,y:t.y+t.height};break;case m0:c={x:t.x+t.width,y:l};break;case P1:c={x:t.x-r.width,y:l};break;default:c={x:t.x,y:t.y}}var u=i?sZ(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case fy:c[u]=c[u]-(t[d]/2-r[d]/2);break;case iw:c[u]=c[u]+(t[d]/2-r[d]/2);break}}return c}function cw(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=n===void 0?e.placement:n,o=r.boundary,s=o===void 0?ukt:o,l=r.rootBoundary,c=l===void 0?n8e:l,u=r.elementContext,d=u===void 0?ow:u,p=r.altBoundary,h=p===void 0?!1:p,f=r.padding,m=f===void 0?0:f,g=c8e(typeof m!="number"?m:u8e(m,nw)),T=d===ow?dkt:ow,y=e.rects.popper,v=e.elements[h?T:d],_=Dkt(my(v)?v:v.contextElement||Oh(e.elements.popper),s,c),b=yy(e.elements.reference),L=y8e({reference:b,element:y,strategy:"absolute",placement:i}),w=dZ(Object.assign({},y,L)),k=d===ow?w:b,C={top:_.top-k.top+g.top,bottom:k.bottom-_.bottom+g.bottom,left:_.left-k.left+g.left,right:k.right-_.right+g.right},A=e.modifiersData.offset;if(d===ow&&A){var O=A[i];Object.keys(C).forEach(function(N){var I=[m0,f0].indexOf(N)>=0?1:-1,R=[I1,f0].indexOf(N)>=0?"y":"x";C[N]+=O[R]*I})}return C}function zkt(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=r.boundary,o=r.rootBoundary,s=r.padding,l=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?sV:c,d=Ty(n),p=d?l?i8e:i8e.filter(function(m){return Ty(m)===d}):nw,h=p.filter(function(m){return u.indexOf(m)>=0});h.length===0&&(h=p);var f=h.reduce(function(m,g){return m[g]=cw(e,{placement:g,boundary:i,rootBoundary:o,padding:s})[ud(g)],m},{});return Object.keys(f).sort(function(m,g){return f[m]-f[g]})}function jkt(e){if(ud(e)===iZ)return[];var t=dV(e);return[f8e(e),t,f8e(t)]}function Ukt(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,o=i===void 0?!0:i,s=r.altAxis,l=s===void 0?!0:s,c=r.fallbackPlacements,u=r.padding,d=r.boundary,p=r.rootBoundary,h=r.altBoundary,f=r.flipVariations,m=f===void 0?!0:f,g=r.allowedAutoPlacements,T=t.options.placement,y=ud(T),v=y===T,_=c||(v||!m?[dV(T)]:jkt(T)),b=[T].concat(_).reduce(function(he,me){return he.concat(ud(me)===iZ?zkt(t,{placement:me,boundary:d,rootBoundary:p,padding:u,flipVariations:m,allowedAutoPlacements:g}):me)},[]),L=t.rects.reference,w=t.rects.popper,k=new Map,C=!0,A=b[0],O=0;O<b.length;O++){var N=b[O],I=ud(N),R=Ty(N)===fy,D=[I1,f0].indexOf(I)>=0,j=D?"width":"height",G=cw(t,{placement:N,boundary:d,rootBoundary:p,altBoundary:h,padding:u}),P=D?R?m0:P1:R?f0:I1;L[j]>w[j]&&(P=dV(P));var W=dV(P),K=[];if(o&&K.push(G[I]<=0),l&&K.push(G[P]<=0,G[W]<=0),K.every(function(he){return he})){A=N,C=!1;break}k.set(N,K)}if(C)for(var U=m?3:1,X=function(he){var me=b.find(function(ie){var be=k.get(ie);if(be)return be.slice(0,he).every(function(re){return re})});if(me)return A=me,"break"},ee=U;ee>0;ee--){var oe=X(ee);if(oe==="break")break}t.placement!==A&&(t.modifiersData[n]._skip=!0,t.placement=A,t.reset=!0)}}var Gkt={name:"flip",enabled:!0,phase:"main",fn:Ukt,requiresIfExists:["offset"],data:{_skip:!1}};function T8e(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function v8e(e){return[I1,m0,f0,P1].some(function(t){return e[t]>=0})}function qkt(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=cw(t,{elementContext:"reference"}),l=cw(t,{altBoundary:!0}),c=T8e(s,n),u=T8e(l,i,o),d=v8e(c),p=v8e(u);t.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}var Wkt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:qkt};function Zkt(e,t,r){var n=ud(e),i=[P1,I1].indexOf(n)>=0?-1:1,o=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[P1,m0].indexOf(n)>=0?{x:l,y:s}:{x:s,y:l}}function Kkt(e){var t=e.state,r=e.options,n=e.name,i=r.offset,o=i===void 0?[0,0]:i,s=sV.reduce(function(d,p){return d[p]=Zkt(p,t.rects,o),d},{}),l=s[t.placement],c=l.x,u=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[n]=s}var Xkt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Kkt};function Jkt(e){var t=e.state,r=e.name;t.modifiersData[r]=y8e({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Q8e={name:"popperOffsets",enabled:!0,phase:"read",fn:Jkt,data:{}};function Ykt(e){return e==="x"?"y":"x"}function $kt(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,o=i===void 0?!0:i,s=r.altAxis,l=s===void 0?!1:s,c=r.boundary,u=r.rootBoundary,d=r.altBoundary,p=r.padding,h=r.tether,f=h===void 0?!0:h,m=r.tetherOffset,g=m===void 0?0:m,T=cw(t,{boundary:c,rootBoundary:u,padding:p,altBoundary:d}),y=ud(t.placement),v=Ty(t.placement),_=!v,b=sZ(y),L=Ykt(b),w=t.modifiersData.popperOffsets,k=t.rects.reference,C=t.rects.popper,A=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,O=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(w){if(o){var R,D=b==="y"?I1:P1,j=b==="y"?f0:m0,G=b==="y"?"height":"width",P=w[b],W=P+T[D],K=P-T[j],U=f?-C[G]/2:0,X=v===fy?k[G]:C[G],ee=v===fy?-C[G]:-k[G],oe=t.elements.arrow,he=f&&oe?aZ(oe):{width:0,height:0},me=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:l8e(),ie=me[D],be=me[j],re=sw(0,k[G],he[G]),ue=_?k[G]/2-U-re-ie-O.mainAxis:X-re-ie-O.mainAxis,ne=_?-k[G]/2+U+re+be+O.mainAxis:ee+re+be+O.mainAxis,ye=t.elements.arrow&&aw(t.elements.arrow),_e=ye?b==="y"?ye.clientTop||0:ye.clientLeft||0:0,Ie=(R=N==null?void 0:N[b])!=null?R:0,qe=P+ue-Ie-_e,Ge=P+ne-Ie,et=sw(f?lV(W,qe):W,P,f?lm(K,Ge):K);w[b]=et,I[b]=et-P}if(l){var Ve,Ne=b==="x"?I1:P1,it=b==="x"?f0:m0,Re=w[L],pt=L==="y"?"height":"width",yt=Re+T[Ne],ct=Re-T[it],xe=[I1,P1].indexOf(y)!==-1,Ue=(Ve=N==null?void 0:N[L])!=null?Ve:0,$e=xe?yt:Re-k[pt]-C[pt]-Ue+O.altAxis,at=xe?Re+k[pt]+C[pt]-Ue-O.altAxis:ct,Ht=f&&xe?Skt($e,Re,at):sw(f?$e:yt,Re,f?at:ct);w[L]=Ht,I[L]=Ht-Re}t.modifiersData[n]=I}}var eMt={name:"preventOverflow",enabled:!0,phase:"main",fn:$kt,requiresIfExists:["offset"]};function tMt(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function rMt(e){return e===Hu(e)||!g0(e)?lZ(e):tMt(e)}function nMt(e){var t=e.getBoundingClientRect(),r=gy(t.width)/e.offsetWidth||1,n=gy(t.height)/e.offsetHeight||1;return r!==1||n!==1}function iMt(e,t,r){r===void 0&&(r=!1);var n=g0(t),i=g0(t)&&nMt(t),o=Oh(t),s=yy(e,i),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((cd(t)!=="body"||uZ(o))&&(l=rMt(t)),g0(t)?(c=yy(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=cZ(o))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function oMt(e){var t=new Map,r=new Set,n=[];e.forEach(function(o){t.set(o.name,o)});function i(o){r.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!r.has(l)){var c=t.get(l);c&&i(c)}}),n.push(o)}return e.forEach(function(o){r.has(o.name)||i(o)}),n}function aMt(e){var t=oMt(e);return bkt.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function sMt(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function lMt(e){var t=e.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var b8e={placement:"bottom",modifiers:[],strategy:"absolute"};function x8e(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function pZ(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,o=i===void 0?b8e:i;return function(s,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},b8e,o),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],p=!1,h={state:u,setOptions:function(g){var T=typeof g=="function"?g(u.options):g;m(),u.options=Object.assign({},o,u.options,T),u.scrollParents={reference:my(s)?lw(s):s.contextElement?lw(s.contextElement):[],popper:lw(l)};var y=aMt(lMt([].concat(n,u.options.modifiers)));return u.orderedModifiers=y.filter(function(v){return v.enabled}),f(),h.update()},forceUpdate:function(){if(!p){var g=u.elements,T=g.reference,y=g.popper;if(x8e(T,y)){u.rects={reference:iMt(T,aw(y),u.options.strategy==="fixed"),popper:aZ(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(C){return u.modifiersData[C.name]=Object.assign({},C.data)});for(var v=0;v<u.orderedModifiers.length;v++){if(u.reset===!0){u.reset=!1,v=-1;continue}var _=u.orderedModifiers[v],b=_.fn,L=_.options,w=L===void 0?{}:L,k=_.name;typeof b=="function"&&(u=b({state:u,options:w,name:k,instance:h})||u)}}}},update:sMt(function(){return new Promise(function(g){h.forceUpdate(),g(u)})}),destroy:function(){m(),p=!0}};if(!x8e(s,l))return h;h.setOptions(c).then(function(g){!p&&c.onFirstUpdate&&c.onFirstUpdate(g)});function f(){u.orderedModifiers.forEach(function(g){var T=g.name,y=g.options,v=y===void 0?{}:y,_=g.effect;if(typeof _=="function"){var b=_({state:u,name:T,instance:h,options:v}),L=function(){};d.push(b||L)}})}function m(){d.forEach(function(g){return g()}),d=[]}return h}}pZ();var cMt=[h8e,Q8e,p8e,o8e];pZ({defaultModifiers:cMt});var uMt=[h8e,Q8e,p8e,o8e,Xkt,Gkt,eMt,Ekt,Wkt],dMt=pZ({defaultModifiers:uMt});const pMt=(e,t,r={})=>{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=hMt(c);Object.assign(s.value,u)},requires:["computeStyles"]},i=a.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:p}=a.unref(r);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...p||[],n,{name:"applyStyles",enabled:!1}]}}),o=a.shallowRef(),s=a.ref({styles:{popper:{position:a.unref(i).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{o.value&&(o.value.destroy(),o.value=void 0)};return a.watch(i,c=>{const u=a.unref(o);u&&u.setOptions(c)},{deep:!0}),a.watch([e,t],([c,u])=>{l(),!(!c||!u)&&(o.value=dMt(c,u,a.unref(i)))}),a.onBeforeUnmount(()=>{l()}),{state:a.computed(()=>{var c;return{...((c=a.unref(o))==null?void 0:c.state)||{}}}),styles:a.computed(()=>a.unref(s).styles),attributes:a.computed(()=>a.unref(s).attributes),update:()=>{var c;return(c=a.unref(o))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=a.unref(o))==null?void 0:c.forceUpdate()},instanceRef:a.computed(()=>a.unref(o))}};function hMt(e){const t=Object.keys(e.elements),r=tV(t.map(i=>[i,e.styles[i]||{}])),n=tV(t.map(i=>[i,e.attributes[i]]));return{styles:r,attributes:n}}function _8e(){let e;const t=(n,i)=>{r(),e=window.setTimeout(n,i)},r=()=>window.clearTimeout(e);return qH(()=>r()),{registerTimeout:t,cancelTimeout:r}}const hZ={prefix:Math.floor(Math.random()*1e4),current:0},fMt=Symbol("elIdInjection"),fZ=()=>a.getCurrentInstance()?a.inject(fMt,hZ):hZ,pV=e=>{const t=fZ();!Ec&&t===hZ&&h0("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
1088
1088
  usage: app.provide(ID_INJECTION_KEY, {