diff --git a/pr-preview/pr-17/assets/DashboardLayout-BXaQdr3l.css b/pr-preview/pr-17/assets/DashboardLayout-BXaQdr3l.css new file mode 100644 index 0000000..6847f69 --- /dev/null +++ b/pr-preview/pr-17/assets/DashboardLayout-BXaQdr3l.css @@ -0,0 +1 @@ +.panel[data-v-34c69bd3]{position:relative;overflow:visible;z-index:1;border-radius:0;background:rgb(var(--v-theme-surface))}.bg-panel[data-v-34c69bd3]{z-index:0}.fade-enter-active[data-v-34c69bd3],.fade-leave-active[data-v-34c69bd3]{transition:opacity .25s ease}.fade-enter-from[data-v-34c69bd3],.fade-leave-to[data-v-34c69bd3]{opacity:0} diff --git a/pr-preview/pr-17/assets/DashboardLayout-DFbKmZCh.css b/pr-preview/pr-17/assets/DashboardLayout-DFbKmZCh.css deleted file mode 100644 index d91bfcd..0000000 --- a/pr-preview/pr-17/assets/DashboardLayout-DFbKmZCh.css +++ /dev/null @@ -1 +0,0 @@ -.panel[data-v-d836e339]{position:relative;overflow:visible;z-index:1;border-radius:0;background:rgb(var(--v-theme-surface))}.bg-panel[data-v-d836e339]{z-index:0}.fade-enter-active[data-v-d836e339],.fade-leave-active[data-v-d836e339]{transition:opacity .25s ease}.fade-enter-from[data-v-d836e339],.fade-leave-to[data-v-d836e339]{opacity:0} diff --git a/pr-preview/pr-17/assets/DashboardLayout-bTWwd3M6.js b/pr-preview/pr-17/assets/DashboardLayout-DiXaxksl.js similarity index 82% rename from pr-preview/pr-17/assets/DashboardLayout-bTWwd3M6.js rename to pr-preview/pr-17/assets/DashboardLayout-DiXaxksl.js index 25d352e..283ff56 100644 --- a/pr-preview/pr-17/assets/DashboardLayout-bTWwd3M6.js +++ b/pr-preview/pr-17/assets/DashboardLayout-DiXaxksl.js @@ -1,4 +1,4 @@ -import{_ as y,x as b,W as x,X as d,$ as t,a0 as r,a1 as l,a9 as _,a3 as n,a6 as u,a2 as p,a4 as c,d as h,a5 as g,F as f,a7 as v,ab as w}from"./index-DBoWNDl8.js";import{V as k}from"./VMain-XnWXrEcc.js";import"./ssrBoot-CqR98f8O.js";class A extends HTMLElement{static get observedAttributes(){return["gap"]}constructor(){super(),this.attachShadow({mode:"open"}),this.render()}render(){this.shadowRoot.innerHTML=` +import{_ as m,x as y,W as x,X as d,$ as t,a0 as r,a1 as l,a9 as _,a3 as n,a6 as u,a2 as p,a4 as c,d as h,a5 as g,F as f,a7 as v,ab as w}from"./index-B5c5Pwhg.js";import{V as k}from"./VMain-Cp0gckiv.js";import"./ssrBoot-n6JOT_u2.js";class A extends HTMLElement{static get observedAttributes(){return["gap"]}constructor(){super(),this.attachShadow({mode:"open"}),this.render()}render(){this.shadowRoot.innerHTML=` - `}attributeChangedCallback(a,s,o){s!==o&&(this[a]=o),this.render()}}customElements.define("eox-layout",A);customElements.define("eox-layout-item",C);const L=["gap"],$={key:0,class:"bg-panel",x:"0",y:"0",h:"12",w:"12"},E=["h","w","x","y"],M={__name:"DashboardLayout",setup(i){const a=b(x),[s]=d([a.template?.background]),o=d(a.template?.widgets);return(T,B)=>(t(),r(k,null,{default:l(()=>[_("eox-layout",{gap:n(a).template.gap??2},[n(s).component?(t(),u("eox-layout-item",$,[(t(),r(p,{suspensible:""},{default:l(()=>[(t(),r(c(n(s).component),h({id:"bg-widget"},n(s).props),null,16))]),_:1}))])):g("v-if",!0),(t(!0),u(f,null,v(n(o),(e,m)=>(t(),r(w,{key:m,name:"fade"},{default:l(()=>[e.value.component?(t(),u("eox-layout-item",{key:e.value.id,class:"panel",h:e.value.layout.h,w:e.value.layout.w,x:e.value.layout.x,y:e.value.layout.y},[(t(),r(p,{suspensible:""},{default:l(()=>[(t(),r(c(e.value.component),h({key:e.value.id,ref_for:!0},e.value.props),null,16))]),_:2},1024))],8,E)):g("v-if",!0)]),_:2},1024))),128))],8,L)]),_:1}))}},I=y(M,[["__scopeId","data-v-d836e339"]]);export{I as default}; + `}attributeChangedCallback(a,s,o){s!==o&&(this[a]=o),this.render()}}customElements.define("eox-layout",A);customElements.define("eox-layout-item",C);const L=["gap"],$={key:0,class:"bg-panel",x:"0",y:"0",h:"12",w:"12"},E=["h","w","x","y"],M={__name:"DashboardLayout",setup(i){const a=y(x),[s]=d([a.template?.background]),o=d(a.template?.widgets);return(T,B)=>(t(),r(k,null,{default:l(()=>[_("eox-layout",{gap:n(a).template.gap??2},[n(s).component?(t(),u("eox-layout-item",$,[(t(),r(p,{suspensible:""},{default:l(()=>[(t(),r(c(n(s).component),h({id:"bg-widget"},n(s).props),null,16))]),_:1}))])):g("v-if",!0),(t(!0),u(f,null,v(n(o),(e,b)=>(t(),r(w,{key:b,name:"fade"},{default:l(()=>[e.value.component?(t(),u("eox-layout-item",{key:e.value.id,class:"panel",h:e.value.layout.h,w:e.value.layout.w,x:e.value.layout.x,y:e.value.layout.y},[(t(),r(p,{suspensible:""},{default:l(()=>[(t(),r(c(e.value.component),h({key:e.value.id,ref_for:!0},e.value.props),null,16))]),_:2},1024))],8,E)):g("v-if",!0)]),_:2},1024))),128))],8,L)]),_:1}))}},I=m(M,[["__scopeId","data-v-34c69bd3"]]);export{I as default}; diff --git a/pr-preview/pr-17/assets/DynamicWebComponent-Cx5W-nMa.js b/pr-preview/pr-17/assets/DynamicWebComponent-CFpMl29n.js similarity index 79% rename from pr-preview/pr-17/assets/DynamicWebComponent-Cx5W-nMa.js rename to pr-preview/pr-17/assets/DynamicWebComponent-CFpMl29n.js index 65cf659..2931244 100644 --- a/pr-preview/pr-17/assets/DynamicWebComponent-Cx5W-nMa.js +++ b/pr-preview/pr-17/assets/DynamicWebComponent-CFpMl29n.js @@ -1 +1 @@ -import{bu as i,aV as m,r as p,Z as d,bv as f,$ as c,a6 as g,a0 as y,d as _,a4 as k}from"./index-DBoWNDl8.js";const h={class:"d-flex flex-column fill-height overflow-auto"},x={__name:"DynamicWebComponent",props:{link:{type:[String,Function],required:!0},constructorProp:String,tagName:{type:String,required:!0},properties:{type:Object,default:()=>({})},onMounted:Function,onUnmounted:Function},async setup(o){let t,a;const e=o,u=async()=>typeof e.link=="string"?await import(e.link):await e.link(),l=customElements.get(e.tagName)?null:([t,a]=i(()=>u().catch(n=>{console.error(n)})),t=await t,a(),t);if(!customElements.get(e.tagName)&&e.constructorProp){const n=l[e.constructorProp];customElements.define(e.tagName,n)}const s=m(),r=p(null);return d(()=>{e.onMounted?.(r.value,s)}),f(()=>{e.onUnmounted?.(r.value,s)}),(n,v)=>(c(),g("span",h,[(c(),y(k(o.tagName),_(o.properties,{ref_key:"elementRef",ref:r}),null,16))]))}};export{x as default}; +import{bv as i,aV as m,r as p,Z as d,bw as f,$ as c,a6 as g,a0 as y,d as _,a4 as k}from"./index-B5c5Pwhg.js";const h={class:"d-flex flex-column fill-height overflow-auto"},x={__name:"DynamicWebComponent",props:{link:{type:[String,Function],required:!0},constructorProp:String,tagName:{type:String,required:!0},properties:{type:Object,default:()=>({})},onMounted:Function,onUnmounted:Function},async setup(o){let t,a;const e=o,u=async()=>typeof e.link=="string"?await import(e.link):await e.link(),l=customElements.get(e.tagName)?null:([t,a]=i(()=>u().catch(n=>{console.error(n)})),t=await t,a(),t);if(!customElements.get(e.tagName)&&e.constructorProp){const n=l[e.constructorProp];customElements.define(e.tagName,n)}const s=m(),r=p(null);return d(()=>{e.onMounted?.(r.value,s)}),f(()=>{e.onUnmounted?.(r.value,s)}),(n,b)=>(c(),g("span",h,[(c(),y(k(o.tagName),_(o.properties,{ref_key:"elementRef",ref:r}),null,16))]))}};export{x as default}; diff --git a/pr-preview/pr-17/assets/EodashDatePicker-BJka0txy.js b/pr-preview/pr-17/assets/EodashDatePicker-BJka0txy.js deleted file mode 100644 index f890668..0000000 --- a/pr-preview/pr-17/assets/EodashDatePicker-BJka0txy.js +++ /dev/null @@ -1 +0,0 @@ -import{aw as Le,ax as Me,p as $,r as M,L as j,ao as ue,w as B,ay as N,az as et,aA as ye,aB as te,aC as ne,aD as ge,c as b,D as fe,aE as he,C as V,al as we,aq as ve,aF as Re,aG as tt,aH as Fe,x as de,aI as be,d as R,aJ as nt,s as Y,H as ot,Z as _e,aK as De,q as at,aL as rt,aM as it,e as lt,ac as st,h as ct,g as Ve,y as Ne,i as ut,j as ft,Q as vt,R as dt,ad as mt,am as yt,aN as gt,aO as ht,a as He,b as T,aP as wt,t as Ie,B as bt,v as Et,F as We,ab as St,o as xt,aQ as kt,aR as pt,aS as je,T as Ot,aT as Ct,aU as Pt,aV as At,$ as Ee,a6 as Tt,a1 as oe,a3 as Se,aW as Bt,W as Lt,a9 as xe,aX as Mt,aY as Rt,a0 as Ft,M as _t,aZ as Dt,V as Vt,a_ as ae}from"./index-DBoWNDl8.js";import{t as ke}from"./http-DqoOZdf6.js";import{g as Nt,B as re,c as pe,n as Ht,m as It,u as Wt,b as $e,a as jt,s as $t,f as qt}from"./forwardRefs-CYWtMhRJ.js";import{m as zt,M as Yt}from"./transition-C0IRM1SU.js";import"./_commonjsHelpers-Cpj98o6Y.js";const K=new WeakMap;function Ut(e,t){Object.keys(t).forEach(n=>{if(Le(n)){const a=Me(n),r=K.get(e);if(t[n]==null)r?.forEach(i=>{const[o,l]=i;o===a&&(e.removeEventListener(a,l),r.delete(i))});else if(!r||![...r].some(i=>i[0]===a&&i[1]===t[n])){e.addEventListener(a,t[n]);const i=r||new Set;i.add([a,t[n]]),K.has(e)||K.set(e,i)}}else t[n]==null?e.removeAttribute(n):e.setAttribute(n,t[n])})}function Gt(e,t){Object.keys(t).forEach(n=>{if(Le(n)){const a=Me(n),r=K.get(e);r?.forEach(i=>{const[o,l]=i;o===a&&(e.removeEventListener(a,l),r.delete(i))})}else e.removeAttribute(n)})}function qe(e){if(typeof e.getRootNode!="function"){for(;e.parentNode;)e=e.parentNode;return e!==document?null:document}const t=e.getRootNode();return t!==document&&t.getRootNode({composed:!0})!==document?null:t}function Kt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(;e;){if(t?Xt(e):me(e))return e;e=e.parentElement}return document.scrollingElement}function X(e,t){const n=[];if(t&&e&&!t.contains(e))return n;for(;e&&(me(e)&&n.push(e),e!==t);)e=e.parentElement;return n}function me(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return t.overflowY==="scroll"||t.overflowY==="auto"&&e.scrollHeight>e.clientHeight}function Xt(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return["scroll","auto"].includes(t.overflowY)}function Zt(e){for(;e;){if(window.getComputedStyle(e).position==="fixed")return!0;e=e.offsetParent}return!1}function Qt(){return!0}function ze(e,t,n){if(!e||Ye(e,n)===!1)return!1;const a=qe(t);if(typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&a.host===e.target)return!1;const r=(typeof n.value=="object"&&n.value.include||(()=>[]))();return r.push(t),!r.some(i=>i?.contains(e.target))}function Ye(e,t){return(typeof t.value=="object"&&t.value.closeConditional||Qt)(e)}function Jt(e,t,n){const a=typeof n.value=="function"?n.value:n.value.handler;t._clickOutside.lastMousedownWasOutside&&ze(e,t,n)&&setTimeout(()=>{Ye(e,n)&&a&&a(e)},0)}function Oe(e,t){const n=qe(e);t(document),typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&t(n)}const en={mounted(e,t){const n=r=>Jt(r,e,t),a=r=>{e._clickOutside.lastMousedownWasOutside=ze(r,e,t)};Oe(e,r=>{r.addEventListener("click",n,!0),r.addEventListener("mousedown",a,!0)}),e._clickOutside||(e._clickOutside={lastMousedownWasOutside:!1}),e._clickOutside[t.instance.$.uid]={onClick:n,onMousedown:a}},unmounted(e,t){e._clickOutside&&(Oe(e,n=>{if(!n||!e._clickOutside?.[t.instance.$.uid])return;const{onClick:a,onMousedown:r}=e._clickOutside[t.instance.$.uid];n.removeEventListener("click",a,!0),n.removeEventListener("mousedown",r,!0)}),delete e._clickOutside[t.instance.$.uid])}};function ie(e,t){return{x:e.x+t.x,y:e.y+t.y}}function tn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ce(e,t){if(e.side==="top"||e.side==="bottom"){const{side:n,align:a}=e,r=a==="left"?0:a==="center"?t.width/2:a==="right"?t.width:a,i=n==="top"?0:n==="bottom"?t.height:n;return ie({x:r,y:i},t)}else if(e.side==="left"||e.side==="right"){const{side:n,align:a}=e,r=n==="left"?0:n==="right"?t.width:n,i=a==="top"?0:a==="center"?t.height/2:a==="bottom"?t.height:a;return ie({x:r,y:i},t)}return ie({x:t.width/2,y:t.height/2},t)}const Ue={static:an,connected:ln},nn=$({locationStrategy:{type:[String,Function],default:"static",validator:e=>typeof e=="function"||e in Ue},location:{type:String,default:"bottom"},origin:{type:String,default:"auto"},offset:[Number,String,Array]},"VOverlay-location-strategies");function on(e,t){const n=M({}),a=M();j&&ue(()=>!!(t.isActive.value&&e.locationStrategy),i=>{B(()=>e.locationStrategy,i),N(()=>{window.removeEventListener("resize",r),a.value=void 0}),window.addEventListener("resize",r,{passive:!0}),typeof e.locationStrategy=="function"?a.value=e.locationStrategy(t,e,n)?.updateLocation:a.value=Ue[e.locationStrategy](t,e,n)?.updateLocation});function r(i){a.value?.(i)}return{contentStyles:n,updateLocation:a}}function an(){}function rn(e,t){t?e.style.removeProperty("left"):e.style.removeProperty("right");const n=Ht(e);return t?n.x+=parseFloat(e.style.right||0):n.x-=parseFloat(e.style.left||0),n.y-=parseFloat(e.style.top||0),n}function ln(e,t,n){(Array.isArray(e.target.value)||Zt(e.target.value))&&Object.assign(n.value,{position:"fixed",top:0,[e.isRtl.value?"right":"left"]:0});const{preferredAnchor:r,preferredOrigin:i}=et(()=>{const v=ye(t.location,e.isRtl.value),u=t.origin==="overlap"?v:t.origin==="auto"?te(v):ye(t.origin,e.isRtl.value);return v.side===u.side&&v.align===ne(u).align?{preferredAnchor:ge(v),preferredOrigin:ge(u)}:{preferredAnchor:v,preferredOrigin:u}}),[o,l,c,f]=["minWidth","minHeight","maxWidth","maxHeight"].map(v=>b(()=>{const u=parseFloat(t[v]);return isNaN(u)?1/0:u})),y=b(()=>{if(Array.isArray(t.offset))return t.offset;if(typeof t.offset=="string"){const v=t.offset.split(" ").map(parseFloat);return v.length<2&&v.push(0),v}return typeof t.offset=="number"?[t.offset,0]:[0,0]});let x=!1;const g=new ResizeObserver(()=>{x&&E()});B([e.target,e.contentEl],(v,u)=>{let[C,P]=v,[S,h]=u;S&&!Array.isArray(S)&&g.unobserve(S),C&&!Array.isArray(C)&&g.observe(C),h&&g.unobserve(h),P&&g.observe(P)},{immediate:!0}),N(()=>{g.disconnect()});function E(){if(x=!1,requestAnimationFrame(()=>x=!0),!e.target.value||!e.contentEl.value)return;const v=Nt(e.target.value),u=rn(e.contentEl.value,e.isRtl.value),C=X(e.contentEl.value),P=12;C.length||(C.push(document.documentElement),e.contentEl.value.style.top&&e.contentEl.value.style.left||(u.x-=parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-x")||0),u.y-=parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-y")||0)));const S=C.reduce((k,w)=>{const d=w.getBoundingClientRect(),m=new re({x:w===document.documentElement?0:d.x,y:w===document.documentElement?0:d.y,width:w.clientWidth,height:w.clientHeight});return k?new re({x:Math.max(k.left,m.left),y:Math.max(k.top,m.top),width:Math.min(k.right,m.right)-Math.max(k.left,m.left),height:Math.min(k.bottom,m.bottom)-Math.max(k.top,m.top)}):m},void 0);S.x+=P,S.y+=P,S.width-=P*2,S.height-=P*2;let h={anchor:r.value,origin:i.value};function H(k){const w=new re(u),d=Ce(k.anchor,v),m=Ce(k.origin,w);let{x:_,y:L}=tn(d,m);switch(k.anchor.side){case"top":L-=y.value[0];break;case"bottom":L+=y.value[0];break;case"left":_-=y.value[0];break;case"right":_+=y.value[0];break}switch(k.anchor.align){case"top":L-=y.value[1];break;case"bottom":L+=y.value[1];break;case"left":_-=y.value[1];break;case"right":_+=y.value[1];break}return w.x+=_,w.y+=L,w.width=Math.min(w.width,c.value),w.height=Math.min(w.height,f.value),{overflows:pe(w,S),x:_,y:L}}let F=0,A=0;const s={x:0,y:0},I={x:!1,y:!1};let Q=-1;for(;!(Q++>10);){const{x:k,y:w,overflows:d}=H(h);F+=k,A+=w,u.x+=k,u.y+=w;{const m=he(h.anchor),_=d.x.before||d.x.after,L=d.y.before||d.y.after;let q=!1;if(["x","y"].forEach(O=>{if(O==="x"&&_&&!I.x||O==="y"&&L&&!I.y){const D={anchor:{...h.anchor},origin:{...h.origin}},U=O==="x"?m==="y"?ne:te:m==="y"?te:ne;D.anchor=U(D.anchor),D.origin=U(D.origin);const{overflows:W}=H(D);(W[O].before<=d[O].before&&W[O].after<=d[O].after||W[O].before+W[O].after<(d[O].before+d[O].after)/2)&&(h=D,q=I[O]=!0)}}),q)continue}d.x.before&&(F+=d.x.before,u.x+=d.x.before),d.x.after&&(F-=d.x.after,u.x-=d.x.after),d.y.before&&(A+=d.y.before,u.y+=d.y.before),d.y.after&&(A-=d.y.after,u.y-=d.y.after);{const m=pe(u,S);s.x=S.width-m.x.before-m.x.after,s.y=S.height-m.y.before-m.y.after,F+=m.x.before,u.x+=m.x.before,A+=m.y.before,u.y+=m.y.before}break}const J=he(h.anchor);return Object.assign(n.value,{"--v-overlay-anchor-origin":`${h.anchor.side} ${h.anchor.align}`,transformOrigin:`${h.origin.side} ${h.origin.align}`,top:V(le(A)),left:e.isRtl.value?void 0:V(le(F)),right:e.isRtl.value?V(le(-F)):void 0,minWidth:V(J==="y"?Math.min(o.value,v.width):o.value),maxWidth:V(Pe(we(s.x,o.value===1/0?0:o.value,c.value))),maxHeight:V(Pe(we(s.y,l.value===1/0?0:l.value,f.value)))}),{available:s,contentBox:u}}return B(()=>[r.value,i.value,t.offset,t.minWidth,t.minHeight,t.maxWidth,t.maxHeight],()=>E()),fe(()=>{const v=E();if(!v)return;const{available:u,contentBox:C}=v;C.height>u.y&&requestAnimationFrame(()=>{E(),requestAnimationFrame(()=>{E()})})}),{updateLocation:E}}function le(e){return Math.round(e*devicePixelRatio)/devicePixelRatio}function Pe(e){return Math.ceil(e*devicePixelRatio)/devicePixelRatio}let se=!0;const Z=[];function sn(e){!se||Z.length?(Z.push(e),ce()):(se=!1,e(),ce())}let Ae=-1;function ce(){cancelAnimationFrame(Ae),Ae=requestAnimationFrame(()=>{const e=Z.shift();e&&e(),Z.length?ce():se=!0})}const Ge={none:null,close:fn,block:vn,reposition:dn},cn=$({scrollStrategy:{type:[String,Function],default:"block",validator:e=>typeof e=="function"||e in Ge}},"VOverlay-scroll-strategies");function un(e,t){if(!j)return;let n;ve(async()=>{n?.stop(),t.isActive.value&&e.scrollStrategy&&(n=Re(),await new Promise(a=>setTimeout(a)),n.active&&n.run(()=>{typeof e.scrollStrategy=="function"?e.scrollStrategy(t,e,n):Ge[e.scrollStrategy]?.(t,e,n)}))}),N(()=>{n?.stop()})}function fn(e){function t(n){e.isActive.value=!1}Ke(e.targetEl.value??e.contentEl.value,t)}function vn(e,t){const n=e.root.value?.offsetParent,a=[...new Set([...X(e.targetEl.value,t.contained?n:void 0),...X(e.contentEl.value,t.contained?n:void 0)])].filter(o=>!o.classList.contains("v-overlay-scroll-blocked")),r=window.innerWidth-document.documentElement.offsetWidth,i=(o=>me(o)&&o)(n||document.documentElement);i&&e.root.value.classList.add("v-overlay--scroll-blocked"),a.forEach((o,l)=>{o.style.setProperty("--v-body-scroll-x",V(-o.scrollLeft)),o.style.setProperty("--v-body-scroll-y",V(-o.scrollTop)),o!==document.documentElement&&o.style.setProperty("--v-scrollbar-offset",V(r)),o.classList.add("v-overlay-scroll-blocked")}),N(()=>{a.forEach((o,l)=>{const c=parseFloat(o.style.getPropertyValue("--v-body-scroll-x")),f=parseFloat(o.style.getPropertyValue("--v-body-scroll-y")),y=o.style.scrollBehavior;o.style.scrollBehavior="auto",o.style.removeProperty("--v-body-scroll-x"),o.style.removeProperty("--v-body-scroll-y"),o.style.removeProperty("--v-scrollbar-offset"),o.classList.remove("v-overlay-scroll-blocked"),o.scrollLeft=-c,o.scrollTop=-f,o.style.scrollBehavior=y}),i&&e.root.value.classList.remove("v-overlay--scroll-blocked")})}function dn(e,t,n){let a=!1,r=-1,i=-1;function o(l){sn(()=>{const c=performance.now();e.updateLocation.value?.(l),a=(performance.now()-c)/(1e3/60)>2})}i=(typeof requestIdleCallback>"u"?l=>l():requestIdleCallback)(()=>{n.run(()=>{Ke(e.targetEl.value??e.contentEl.value,l=>{a?(cancelAnimationFrame(r),r=requestAnimationFrame(()=>{r=requestAnimationFrame(()=>{o(l)})})):o(l)})})}),N(()=>{typeof cancelIdleCallback<"u"&&cancelIdleCallback(i),cancelAnimationFrame(r)})}function Ke(e,t){const n=[document,...X(e)];n.forEach(a=>{a.addEventListener("scroll",t,{passive:!0})}),N(()=>{n.forEach(a=>{a.removeEventListener("scroll",t)})})}const mn=Symbol.for("vuetify:v-menu"),yn=$({closeDelay:[Number,String],openDelay:[Number,String]},"delay");function gn(e,t){let n=()=>{};function a(o){n?.();const l=Number(o?e.openDelay:e.closeDelay);return new Promise(c=>{n=tt(l,()=>{t?.(o),c(o)})})}function r(){return a(!0)}function i(){return a(!1)}return{clearDelay:n,runOpenDelay:r,runCloseDelay:i}}const hn=$({target:[String,Object],activator:[String,Object],activatorProps:{type:Object,default:()=>({})},openOnClick:{type:Boolean,default:void 0},openOnHover:Boolean,openOnFocus:{type:Boolean,default:void 0},closeOnContentClick:Boolean,...yn()},"VOverlay-activator");function wn(e,t){let{isActive:n,isTop:a}=t;const r=Fe("useActivator"),i=M();let o=!1,l=!1,c=!0;const f=b(()=>e.openOnFocus||e.openOnFocus==null&&e.openOnHover),y=b(()=>e.openOnClick||e.openOnClick==null&&!e.openOnHover&&!f.value),{runOpenDelay:x,runCloseDelay:g}=gn(e,s=>{s===(e.openOnHover&&o||f.value&&l)&&!(e.openOnHover&&n.value&&!a.value)&&(n.value!==s&&(c=!0),n.value=s)}),E=M(),v={onClick:s=>{s.stopPropagation(),i.value=s.currentTarget||s.target,n.value||(E.value=[s.clientX,s.clientY]),n.value=!n.value},onMouseenter:s=>{s.sourceCapabilities?.firesTouchEvents||(o=!0,i.value=s.currentTarget||s.target,x())},onMouseleave:s=>{o=!1,g()},onFocus:s=>{nt(s.target,":focus-visible")!==!1&&(l=!0,s.stopPropagation(),i.value=s.currentTarget||s.target,x())},onBlur:s=>{l=!1,s.stopPropagation(),g()}},u=b(()=>{const s={};return y.value&&(s.onClick=v.onClick),e.openOnHover&&(s.onMouseenter=v.onMouseenter,s.onMouseleave=v.onMouseleave),f.value&&(s.onFocus=v.onFocus,s.onBlur=v.onBlur),s}),C=b(()=>{const s={};if(e.openOnHover&&(s.onMouseenter=()=>{o=!0,x()},s.onMouseleave=()=>{o=!1,g()}),f.value&&(s.onFocusin=()=>{l=!0,x()},s.onFocusout=()=>{l=!1,g()}),e.closeOnContentClick){const I=de(mn,null);s.onClick=()=>{n.value=!1,I?.closeParents()}}return s}),P=b(()=>{const s={};return e.openOnHover&&(s.onMouseenter=()=>{c&&(o=!0,c=!1,x())},s.onMouseleave=()=>{o=!1,g()}),s});B(a,s=>{s&&(e.openOnHover&&!o&&(!f.value||!l)||f.value&&!l&&(!e.openOnHover||!o))&&(n.value=!1)}),B(n,s=>{s||setTimeout(()=>{E.value=void 0})},{flush:"post"});const S=be();ve(()=>{S.value&&fe(()=>{i.value=S.el})});const h=be(),H=b(()=>e.target==="cursor"&&E.value?E.value:h.value?h.el:Xe(e.target,r)||i.value),F=b(()=>Array.isArray(H.value)?void 0:H.value);let A;return B(()=>!!e.activator,s=>{s&&j?(A=Re(),A.run(()=>{bn(e,r,{activatorEl:i,activatorEvents:u})})):A&&A.stop()},{flush:"post",immediate:!0}),N(()=>{A?.stop()}),{activatorEl:i,activatorRef:S,target:H,targetEl:F,targetRef:h,activatorEvents:u,contentEvents:C,scrimEvents:P}}function bn(e,t,n){let{activatorEl:a,activatorEvents:r}=n;B(()=>e.activator,(c,f)=>{if(f&&c!==f){const y=l(f);y&&o(y)}c&&fe(()=>i())},{immediate:!0}),B(()=>e.activatorProps,()=>{i()}),N(()=>{o()});function i(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:l(),f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.activatorProps;c&&Ut(c,R(r.value,f))}function o(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:l(),f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.activatorProps;c&&Gt(c,R(r.value,f))}function l(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activator;const f=Xe(c,t);return a.value=f?.nodeType===Node.ELEMENT_NODE?f:void 0,a.value}}function Xe(e,t){if(!e)return;let n;if(e==="parent"){let a=t?.proxy?.$el?.parentNode;for(;a?.hasAttribute("data-no-activator");)a=a.parentNode;n=a}else typeof e=="string"?n=document.querySelector(e):"$el"in e?n=e.$el:n=e;return n}function En(){if(!j)return Y(!1);const{ssr:e}=ot();if(e){const t=Y(!1);return _e(()=>{t.value=!0}),t}else return Y(!0)}const Te=Symbol.for("vuetify:stack"),z=De([]);function Sn(e,t,n){const a=Fe("useStack"),r=!n,i=de(Te,void 0),o=De({activeChildren:new Set});at(Te,o);const l=Y(+t.value);ue(e,()=>{const y=z.at(-1)?.[1];l.value=y?y+10:+t.value,r&&z.push([a.uid,l.value]),i?.activeChildren.add(a.uid),N(()=>{if(r){const x=rt(z).findIndex(g=>g[0]===a.uid);z.splice(x,1)}i?.activeChildren.delete(a.uid)})});const c=Y(!0);r&&ve(()=>{const y=z.at(-1)?.[0]===a.uid;setTimeout(()=>c.value=y)});const f=b(()=>!o.activeChildren.size);return{globalTop:it(c),localTop:f,stackStyles:b(()=>({zIndex:l.value}))}}function xn(e){return{teleportTarget:b(()=>{const n=e.value;if(n===!0||!j)return;const a=n===!1?document.body:typeof n=="string"?document.querySelector(n):n;if(a==null)return;let r=a.querySelector(":scope > .v-overlay-container");return r||(r=document.createElement("div"),r.className="v-overlay-container",a.appendChild(r)),r})}}function kn(e){const{modelValue:t,color:n,...a}=e;return T(St,{name:"fade-transition",appear:!0},{default:()=>[e.modelValue&&T("div",R({class:["v-overlay__scrim",e.color.backgroundColorClasses.value],style:e.color.backgroundColorStyles.value},a),null)]})}const Ze=$({absolute:Boolean,attach:[Boolean,String,Object],closeOnBack:{type:Boolean,default:!0},contained:Boolean,contentClass:null,contentProps:null,disabled:Boolean,opacity:[Number,String],noClickAnimation:Boolean,modelValue:Boolean,persistent:Boolean,scrim:{type:[Boolean,String],default:!0},zIndex:{type:[Number,String],default:2e3},...hn(),...lt(),...st(),...It(),...nn(),...cn(),...ct(),...zt()},"VOverlay"),Be=Ve()({name:"VOverlay",directives:{ClickOutside:en},inheritAttrs:!1,props:{_disableGlobalStack:Boolean,...Ze()},emits:{"click:outside":e=>!0,"update:modelValue":e=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(e,t){let{slots:n,attrs:a,emit:r}=t;const i=Ne(e,"modelValue"),o=b({get:()=>i.value,set:p=>{p&&e.disabled||(i.value=p)}}),{teleportTarget:l}=xn(b(()=>e.attach||e.contained)),{themeClasses:c}=ut(e),{rtlClasses:f,isRtl:y}=ft(),{hasContent:x,onAfterLeave:g}=Wt(e,o),E=vt(b(()=>typeof e.scrim=="string"?e.scrim:null)),{globalTop:v,localTop:u,stackStyles:C}=Sn(o,dt(e,"zIndex"),e._disableGlobalStack),{activatorEl:P,activatorRef:S,target:h,targetEl:H,targetRef:F,activatorEvents:A,contentEvents:s,scrimEvents:I}=wn(e,{isActive:o,isTop:u}),{dimensionStyles:Q}=mt(e),J=En(),{scopeId:k}=$e();B(()=>e.disabled,p=>{p&&(o.value=!1)});const w=M(),d=M(),m=M(),{contentStyles:_,updateLocation:L}=on(e,{isRtl:y,contentEl:m,target:h,isActive:o});un(e,{root:w,contentEl:m,targetEl:H,isActive:o,updateLocation:L});function q(p){r("click:outside",p),e.persistent?G():o.value=!1}function O(p){return o.value&&v.value&&(!e.scrim||p.target===d.value)}j&&B(o,p=>{p?window.addEventListener("keydown",D):window.removeEventListener("keydown",D)},{immediate:!0}),yt(()=>{j&&window.removeEventListener("keydown",D)});function D(p){p.key==="Escape"&&v.value&&(e.persistent?G():(o.value=!1,m.value?.contains(document.activeElement)&&P.value?.focus()))}const U=gt();ue(()=>e.closeOnBack,()=>{ht(U,p=>{v.value&&o.value?(p(!1),e.persistent?G():o.value=!1):p()})});const W=M();B(()=>o.value&&(e.absolute||e.contained)&&l.value==null,p=>{if(p){const ee=Kt(w.value);ee&&ee!==document.scrollingElement&&(W.value=ee.scrollTop)}});function G(){e.noClickAnimation||m.value&&jt(m.value,[{transformOrigin:"center"},{transform:"scale(1.03)"},{transformOrigin:"center"}],{duration:150,easing:$t})}function Qe(){r("afterEnter")}function Je(){g(),r("afterLeave")}return He(()=>T(We,null,[n.activator?.({isActive:o.value,targetRef:F,props:R({ref:S},A.value,e.activatorProps)}),J.value&&x.value&&T(wt,{disabled:!l.value,to:l.value},{default:()=>[T("div",R({class:["v-overlay",{"v-overlay--absolute":e.absolute||e.contained,"v-overlay--active":o.value,"v-overlay--contained":e.contained},c.value,f.value,e.class],style:[C.value,{"--v-overlay-opacity":e.opacity,top:V(W.value)},e.style],ref:w},k,a),[T(kn,R({color:E,modelValue:o.value&&!!e.scrim,ref:d},I.value),null),T(Yt,{appear:!0,persisted:!0,transition:e.transition,target:h.value,onAfterEnter:Qe,onAfterLeave:Je},{default:()=>[Ie(T("div",R({ref:m,class:["v-overlay__content",e.contentClass],style:[Q.value,_.value]},s.value,e.contentProps),[n.default?.({isActive:o})]),[[bt,o.value],[Et("click-outside"),{handler:q,closeConditional:O,include:()=>[P.value]}]])]})])]})])),{activatorEl:P,scrimEl:d,target:h,animateClick:G,contentEl:m,globalTop:v,localTop:u,updateLocation:L}}}),pn=$({id:String,text:String,...xt(Ze({closeOnBack:!1,location:"end",locationStrategy:"connected",eager:!0,minWidth:0,offset:10,openOnClick:!1,openOnHover:!0,origin:"auto",scrim:!1,scrollStrategy:"reposition",transition:!1}),["absolute","persistent"])},"VTooltip"),On=Ve()({name:"VTooltip",props:pn(),emits:{"update:modelValue":e=>!0},setup(e,t){let{slots:n}=t;const a=Ne(e,"modelValue"),{scopeId:r}=$e(),i=kt(),o=b(()=>e.id||`v-tooltip-${i}`),l=M(),c=b(()=>e.location.split(" ").length>1?e.location:e.location+" center"),f=b(()=>e.origin==="auto"||e.origin==="overlap"||e.origin.split(" ").length>1||e.location.split(" ").length>1?e.origin:e.origin+" center"),y=b(()=>e.transition?e.transition:a.value?"scale-transition":"fade-transition"),x=b(()=>R({"aria-describedby":o.value},e.activatorProps));return He(()=>{const g=Be.filterProps(e);return T(Be,R({ref:l,class:["v-tooltip",e.class],style:e.style,id:o.value},g,{modelValue:a.value,"onUpdate:modelValue":E=>a.value=E,transition:y.value,absolute:!0,location:c.value,origin:f.value,persistent:!0,role:"tooltip",activatorProps:x.value,_disableGlobalStack:!0},r),{activator:n.activator,default:function(){for(var E=arguments.length,v=new Array(E),u=0;uo??n.innerHTML,f=(r.ctx===a.instance.$?An(r,a.instance.$)?.provides:r.ctx?.provides)??a.instance.$.provides,y=Ct(e,R(i,l),c);y.appContext=Object.assign(Object.create(null),a.instance.$.appContext,{provides:f}),je(y,n)}}function An(e,t){const n=new Set,a=i=>{for(const o of i){if(!o)continue;if(o===e)return!0;n.add(o);let l;if(o.suspense?l=a([o.ssContent]):Array.isArray(o.children)?l=a(o.children):o.component?.vnode&&(l=a([o.component?.subTree])),l)return l;n.delete(o)}return!1};if(!a([t.subTree]))throw new Error("Could not find original vnode");const r=Array.from(n).reverse();for(const i of r)if(i.component)return i.component;return t}const Tn=Cn(On,e=>({activator:"parent",location:e.arg?.replace("-"," ")??"top",text:typeof e.value=="boolean"?void 0:e.value})),Bn={class:"flex rounded-lg border border-gray-300 dark:border-gray-600",style:{margin:"2px"}},Ln=["value"],Vn={__name:"EodashDatePicker",setup(e){function t(){if(r.value&&r.value.length>0){let o=0;r.value.forEach(l=>{l?.dates&&l.dates.forEach(c=>{c instanceof Date&&c.getTime()>o&&(o=c.getTime())})}),o!==0&&(i.value=new Date(o))}}const n=de(Lt),a=M({input:"YYYY-MM-DD"}),r=M([]),i=b({get(){return new Date(ae.value)??new Date},set(o){o instanceof Date&&!isNaN(o)?ae.value=new Date(o.getTime()-o.getTimezoneOffset()*6e4).toISOString():ae.value=new Date().toISOString()}});return _e(()=>{const{selectedStac:o}=Pt(At());B([o],async([l])=>{if(l){const c=ke(`./${l.id}/collection.json`,n.stacEndpoint),f=ke(l.links[1].href,c),x=(await(await fetch(f)).json()).links.filter(g=>g.rel==="item"&&"datetime"in g).map(g=>new Date(g.datetime));r.value=[{bar:!0,dates:x}]}},{immediate:!0})}),(o,l)=>(Ee(),Tt(We,null,[T(Se(Rt),{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),masks:a.value,attributes:r.value},{default:oe(({inputValue:c,inputEvents:f})=>[xe("div",Bn,[xe("input",R({value:c},Mt(f,!0),{style:{margin:"1px"},class:"flex-grow px-1 py-1 bg-white dark:bg-gray-700"}),null,16,Ln)])]),_:1},8,["modelValue","masks","attributes"]),T(Bt,{align:"center",justify:"center",style:{"margin-top":"6px"}},{default:oe(()=>[Ie((Ee(),Ft(Vt,{density:"compact",onClick:t},{default:oe(()=>[T(_t,{icon:[Se(Dt)]},null,8,["icon"])]),_:1})),[[Tn,"Set date to latest available dataset","bottom"]])]),_:1})],64))}};export{Vn as default}; diff --git a/pr-preview/pr-17/assets/EodashDatePicker-DeM7dkbI.js b/pr-preview/pr-17/assets/EodashDatePicker-DeM7dkbI.js new file mode 100644 index 0000000..60242c8 --- /dev/null +++ b/pr-preview/pr-17/assets/EodashDatePicker-DeM7dkbI.js @@ -0,0 +1 @@ +import{aw as De,ax as Ve,p as j,r as M,L as W,ao as de,w as B,ay as N,az as ot,aA as we,aB as oe,aC as ae,aD as be,c as w,D as me,aE as Ee,C as _,al as xe,aq as ye,aF as _e,aG as at,aH as Ne,x as ge,aI as Se,d as R,aJ as rt,s as Y,H as it,Z as He,aK as Ie,q as lt,aL as st,aM as ct,e as ut,ac as ft,h as vt,g as $e,y as We,i as dt,j as mt,Q as yt,R as gt,ad as ht,am as wt,aN as bt,aO as Et,a as je,b as T,aP as xt,t as ue,B as St,v as pt,F as qe,ab as kt,o as Ot,aQ as Ct,aR as Pt,aS as ze,T as At,aT as Tt,aU as Bt,aV as Lt,$ as re,a6 as Mt,a1 as K,a3 as ie,aW as Rt,W as Ft,a9 as pe,aX as Dt,aY as Vt,a0 as ke,M as Oe,aZ as _t,V as Ce,a_ as Nt,a$ as X}from"./index-B5c5Pwhg.js";import{t as Ht,e as It}from"./eodashSTAC-D8JkBEnM.js";import{g as $t,B as le,c as Pe,n as Wt,m as jt,u as qt,b as Ye,a as zt,s as Yt,f as Ut}from"./forwardRefs-ayMwIJVs.js";import{m as Gt,M as Kt}from"./transition-DCXsv86C.js";import"./_commonjsHelpers-Cpj98o6Y.js";const Z=new WeakMap;function Xt(e,t){Object.keys(t).forEach(n=>{if(De(n)){const a=Ve(n),r=Z.get(e);if(t[n]==null)r?.forEach(l=>{const[o,i]=l;o===a&&(e.removeEventListener(a,i),r.delete(l))});else if(!r||![...r].some(l=>l[0]===a&&l[1]===t[n])){e.addEventListener(a,t[n]);const l=r||new Set;l.add([a,t[n]]),Z.has(e)||Z.set(e,l)}}else t[n]==null?e.removeAttribute(n):e.setAttribute(n,t[n])})}function Zt(e,t){Object.keys(t).forEach(n=>{if(De(n)){const a=Ve(n),r=Z.get(e);r?.forEach(l=>{const[o,i]=l;o===a&&(e.removeEventListener(a,i),r.delete(l))})}else e.removeAttribute(n)})}function Ue(e){if(typeof e.getRootNode!="function"){for(;e.parentNode;)e=e.parentNode;return e!==document?null:document}const t=e.getRootNode();return t!==document&&t.getRootNode({composed:!0})!==document?null:t}function Qt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(;e;){if(t?Jt(e):he(e))return e;e=e.parentElement}return document.scrollingElement}function Q(e,t){const n=[];if(t&&e&&!t.contains(e))return n;for(;e&&(he(e)&&n.push(e),e!==t);)e=e.parentElement;return n}function he(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return t.overflowY==="scroll"||t.overflowY==="auto"&&e.scrollHeight>e.clientHeight}function Jt(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(e);return["scroll","auto"].includes(t.overflowY)}function en(e){for(;e;){if(window.getComputedStyle(e).position==="fixed")return!0;e=e.offsetParent}return!1}function tn(){return!0}function Ge(e,t,n){if(!e||Ke(e,n)===!1)return!1;const a=Ue(t);if(typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&a.host===e.target)return!1;const r=(typeof n.value=="object"&&n.value.include||(()=>[]))();return r.push(t),!r.some(l=>l?.contains(e.target))}function Ke(e,t){return(typeof t.value=="object"&&t.value.closeConditional||tn)(e)}function nn(e,t,n){const a=typeof n.value=="function"?n.value:n.value.handler;t._clickOutside.lastMousedownWasOutside&&Ge(e,t,n)&&setTimeout(()=>{Ke(e,n)&&a&&a(e)},0)}function Ae(e,t){const n=Ue(e);t(document),typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&t(n)}const on={mounted(e,t){const n=r=>nn(r,e,t),a=r=>{e._clickOutside.lastMousedownWasOutside=Ge(r,e,t)};Ae(e,r=>{r.addEventListener("click",n,!0),r.addEventListener("mousedown",a,!0)}),e._clickOutside||(e._clickOutside={lastMousedownWasOutside:!1}),e._clickOutside[t.instance.$.uid]={onClick:n,onMousedown:a}},unmounted(e,t){e._clickOutside&&(Ae(e,n=>{if(!n||!e._clickOutside?.[t.instance.$.uid])return;const{onClick:a,onMousedown:r}=e._clickOutside[t.instance.$.uid];n.removeEventListener("click",a,!0),n.removeEventListener("mousedown",r,!0)}),delete e._clickOutside[t.instance.$.uid])}};function se(e,t){return{x:e.x+t.x,y:e.y+t.y}}function an(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Te(e,t){if(e.side==="top"||e.side==="bottom"){const{side:n,align:a}=e,r=a==="left"?0:a==="center"?t.width/2:a==="right"?t.width:a,l=n==="top"?0:n==="bottom"?t.height:n;return se({x:r,y:l},t)}else if(e.side==="left"||e.side==="right"){const{side:n,align:a}=e,r=n==="left"?0:n==="right"?t.width:n,l=a==="top"?0:a==="center"?t.height/2:a==="bottom"?t.height:a;return se({x:r,y:l},t)}return se({x:t.width/2,y:t.height/2},t)}const Xe={static:sn,connected:un},rn=j({locationStrategy:{type:[String,Function],default:"static",validator:e=>typeof e=="function"||e in Xe},location:{type:String,default:"bottom"},origin:{type:String,default:"auto"},offset:[Number,String,Array]},"VOverlay-location-strategies");function ln(e,t){const n=M({}),a=M();W&&de(()=>!!(t.isActive.value&&e.locationStrategy),l=>{B(()=>e.locationStrategy,l),N(()=>{window.removeEventListener("resize",r),a.value=void 0}),window.addEventListener("resize",r,{passive:!0}),typeof e.locationStrategy=="function"?a.value=e.locationStrategy(t,e,n)?.updateLocation:a.value=Xe[e.locationStrategy](t,e,n)?.updateLocation});function r(l){a.value?.(l)}return{contentStyles:n,updateLocation:a}}function sn(){}function cn(e,t){t?e.style.removeProperty("left"):e.style.removeProperty("right");const n=Wt(e);return t?n.x+=parseFloat(e.style.right||0):n.x-=parseFloat(e.style.left||0),n.y-=parseFloat(e.style.top||0),n}function un(e,t,n){(Array.isArray(e.target.value)||en(e.target.value))&&Object.assign(n.value,{position:"fixed",top:0,[e.isRtl.value?"right":"left"]:0});const{preferredAnchor:r,preferredOrigin:l}=ot(()=>{const f=we(t.location,e.isRtl.value),v=t.origin==="overlap"?f:t.origin==="auto"?oe(f):we(t.origin,e.isRtl.value);return f.side===v.side&&f.align===ae(v).align?{preferredAnchor:be(f),preferredOrigin:be(v)}:{preferredAnchor:f,preferredOrigin:v}}),[o,i,c,u]=["minWidth","minHeight","maxWidth","maxHeight"].map(f=>w(()=>{const v=parseFloat(t[f]);return isNaN(v)?1/0:v})),d=w(()=>{if(Array.isArray(t.offset))return t.offset;if(typeof t.offset=="string"){const f=t.offset.split(" ").map(parseFloat);return f.length<2&&f.push(0),f}return typeof t.offset=="number"?[t.offset,0]:[0,0]});let b=!1;const x=new ResizeObserver(()=>{b&&E()});B([e.target,e.contentEl],(f,v)=>{let[C,P]=f,[S,g]=v;S&&!Array.isArray(S)&&x.unobserve(S),C&&!Array.isArray(C)&&x.observe(C),g&&x.unobserve(g),P&&x.observe(P)},{immediate:!0}),N(()=>{x.disconnect()});function E(){if(b=!1,requestAnimationFrame(()=>b=!0),!e.target.value||!e.contentEl.value)return;const f=$t(e.target.value),v=cn(e.contentEl.value,e.isRtl.value),C=Q(e.contentEl.value),P=12;C.length||(C.push(document.documentElement),e.contentEl.value.style.top&&e.contentEl.value.style.left||(v.x-=parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-x")||0),v.y-=parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-y")||0)));const S=C.reduce((p,h)=>{const m=h.getBoundingClientRect(),y=new le({x:h===document.documentElement?0:m.x,y:h===document.documentElement?0:m.y,width:h.clientWidth,height:h.clientHeight});return p?new le({x:Math.max(p.left,y.left),y:Math.max(p.top,y.top),width:Math.min(p.right,y.right)-Math.max(p.left,y.left),height:Math.min(p.bottom,y.bottom)-Math.max(p.top,y.top)}):y},void 0);S.x+=P,S.y+=P,S.width-=P*2,S.height-=P*2;let g={anchor:r.value,origin:l.value};function H(p){const h=new le(v),m=Te(p.anchor,f),y=Te(p.origin,h);let{x:D,y:L}=an(m,y);switch(p.anchor.side){case"top":L-=d.value[0];break;case"bottom":L+=d.value[0];break;case"left":D-=d.value[0];break;case"right":D+=d.value[0];break}switch(p.anchor.align){case"top":L-=d.value[1];break;case"bottom":L+=d.value[1];break;case"left":D-=d.value[1];break;case"right":D+=d.value[1];break}return h.x+=D,h.y+=L,h.width=Math.min(h.width,c.value),h.height=Math.min(h.height,u.value),{overflows:Pe(h,S),x:D,y:L}}let F=0,A=0;const s={x:0,y:0},I={x:!1,y:!1};let ee=-1;for(;!(ee++>10);){const{x:p,y:h,overflows:m}=H(g);F+=p,A+=h,v.x+=p,v.y+=h;{const y=Ee(g.anchor),D=m.x.before||m.x.after,L=m.y.before||m.y.after;let q=!1;if(["x","y"].forEach(O=>{if(O==="x"&&D&&!I.x||O==="y"&&L&&!I.y){const V={anchor:{...g.anchor},origin:{...g.origin}},U=O==="x"?y==="y"?ae:oe:y==="y"?oe:ae;V.anchor=U(V.anchor),V.origin=U(V.origin);const{overflows:$}=H(V);($[O].before<=m[O].before&&$[O].after<=m[O].after||$[O].before+$[O].after<(m[O].before+m[O].after)/2)&&(g=V,q=I[O]=!0)}}),q)continue}m.x.before&&(F+=m.x.before,v.x+=m.x.before),m.x.after&&(F-=m.x.after,v.x-=m.x.after),m.y.before&&(A+=m.y.before,v.y+=m.y.before),m.y.after&&(A-=m.y.after,v.y-=m.y.after);{const y=Pe(v,S);s.x=S.width-y.x.before-y.x.after,s.y=S.height-y.y.before-y.y.after,F+=y.x.before,v.x+=y.x.before,A+=y.y.before,v.y+=y.y.before}break}const te=Ee(g.anchor);return Object.assign(n.value,{"--v-overlay-anchor-origin":`${g.anchor.side} ${g.anchor.align}`,transformOrigin:`${g.origin.side} ${g.origin.align}`,top:_(ce(A)),left:e.isRtl.value?void 0:_(ce(F)),right:e.isRtl.value?_(ce(-F)):void 0,minWidth:_(te==="y"?Math.min(o.value,f.width):o.value),maxWidth:_(Be(xe(s.x,o.value===1/0?0:o.value,c.value))),maxHeight:_(Be(xe(s.y,i.value===1/0?0:i.value,u.value)))}),{available:s,contentBox:v}}return B(()=>[r.value,l.value,t.offset,t.minWidth,t.minHeight,t.maxWidth,t.maxHeight],()=>E()),me(()=>{const f=E();if(!f)return;const{available:v,contentBox:C}=f;C.height>v.y&&requestAnimationFrame(()=>{E(),requestAnimationFrame(()=>{E()})})}),{updateLocation:E}}function ce(e){return Math.round(e*devicePixelRatio)/devicePixelRatio}function Be(e){return Math.ceil(e*devicePixelRatio)/devicePixelRatio}let fe=!0;const J=[];function fn(e){!fe||J.length?(J.push(e),ve()):(fe=!1,e(),ve())}let Le=-1;function ve(){cancelAnimationFrame(Le),Le=requestAnimationFrame(()=>{const e=J.shift();e&&e(),J.length?ve():fe=!0})}const Ze={none:null,close:mn,block:yn,reposition:gn},vn=j({scrollStrategy:{type:[String,Function],default:"block",validator:e=>typeof e=="function"||e in Ze}},"VOverlay-scroll-strategies");function dn(e,t){if(!W)return;let n;ye(async()=>{n?.stop(),t.isActive.value&&e.scrollStrategy&&(n=_e(),await new Promise(a=>setTimeout(a)),n.active&&n.run(()=>{typeof e.scrollStrategy=="function"?e.scrollStrategy(t,e,n):Ze[e.scrollStrategy]?.(t,e,n)}))}),N(()=>{n?.stop()})}function mn(e){function t(n){e.isActive.value=!1}Qe(e.targetEl.value??e.contentEl.value,t)}function yn(e,t){const n=e.root.value?.offsetParent,a=[...new Set([...Q(e.targetEl.value,t.contained?n:void 0),...Q(e.contentEl.value,t.contained?n:void 0)])].filter(o=>!o.classList.contains("v-overlay-scroll-blocked")),r=window.innerWidth-document.documentElement.offsetWidth,l=(o=>he(o)&&o)(n||document.documentElement);l&&e.root.value.classList.add("v-overlay--scroll-blocked"),a.forEach((o,i)=>{o.style.setProperty("--v-body-scroll-x",_(-o.scrollLeft)),o.style.setProperty("--v-body-scroll-y",_(-o.scrollTop)),o!==document.documentElement&&o.style.setProperty("--v-scrollbar-offset",_(r)),o.classList.add("v-overlay-scroll-blocked")}),N(()=>{a.forEach((o,i)=>{const c=parseFloat(o.style.getPropertyValue("--v-body-scroll-x")),u=parseFloat(o.style.getPropertyValue("--v-body-scroll-y")),d=o.style.scrollBehavior;o.style.scrollBehavior="auto",o.style.removeProperty("--v-body-scroll-x"),o.style.removeProperty("--v-body-scroll-y"),o.style.removeProperty("--v-scrollbar-offset"),o.classList.remove("v-overlay-scroll-blocked"),o.scrollLeft=-c,o.scrollTop=-u,o.style.scrollBehavior=d}),l&&e.root.value.classList.remove("v-overlay--scroll-blocked")})}function gn(e,t,n){let a=!1,r=-1,l=-1;function o(i){fn(()=>{const c=performance.now();e.updateLocation.value?.(i),a=(performance.now()-c)/(1e3/60)>2})}l=(typeof requestIdleCallback>"u"?i=>i():requestIdleCallback)(()=>{n.run(()=>{Qe(e.targetEl.value??e.contentEl.value,i=>{a?(cancelAnimationFrame(r),r=requestAnimationFrame(()=>{r=requestAnimationFrame(()=>{o(i)})})):o(i)})})}),N(()=>{typeof cancelIdleCallback<"u"&&cancelIdleCallback(l),cancelAnimationFrame(r)})}function Qe(e,t){const n=[document,...Q(e)];n.forEach(a=>{a.addEventListener("scroll",t,{passive:!0})}),N(()=>{n.forEach(a=>{a.removeEventListener("scroll",t)})})}const hn=Symbol.for("vuetify:v-menu"),wn=j({closeDelay:[Number,String],openDelay:[Number,String]},"delay");function bn(e,t){let n=()=>{};function a(o){n?.();const i=Number(o?e.openDelay:e.closeDelay);return new Promise(c=>{n=at(i,()=>{t?.(o),c(o)})})}function r(){return a(!0)}function l(){return a(!1)}return{clearDelay:n,runOpenDelay:r,runCloseDelay:l}}const En=j({target:[String,Object],activator:[String,Object],activatorProps:{type:Object,default:()=>({})},openOnClick:{type:Boolean,default:void 0},openOnHover:Boolean,openOnFocus:{type:Boolean,default:void 0},closeOnContentClick:Boolean,...wn()},"VOverlay-activator");function xn(e,t){let{isActive:n,isTop:a}=t;const r=Ne("useActivator"),l=M();let o=!1,i=!1,c=!0;const u=w(()=>e.openOnFocus||e.openOnFocus==null&&e.openOnHover),d=w(()=>e.openOnClick||e.openOnClick==null&&!e.openOnHover&&!u.value),{runOpenDelay:b,runCloseDelay:x}=bn(e,s=>{s===(e.openOnHover&&o||u.value&&i)&&!(e.openOnHover&&n.value&&!a.value)&&(n.value!==s&&(c=!0),n.value=s)}),E=M(),f={onClick:s=>{s.stopPropagation(),l.value=s.currentTarget||s.target,n.value||(E.value=[s.clientX,s.clientY]),n.value=!n.value},onMouseenter:s=>{s.sourceCapabilities?.firesTouchEvents||(o=!0,l.value=s.currentTarget||s.target,b())},onMouseleave:s=>{o=!1,x()},onFocus:s=>{rt(s.target,":focus-visible")!==!1&&(i=!0,s.stopPropagation(),l.value=s.currentTarget||s.target,b())},onBlur:s=>{i=!1,s.stopPropagation(),x()}},v=w(()=>{const s={};return d.value&&(s.onClick=f.onClick),e.openOnHover&&(s.onMouseenter=f.onMouseenter,s.onMouseleave=f.onMouseleave),u.value&&(s.onFocus=f.onFocus,s.onBlur=f.onBlur),s}),C=w(()=>{const s={};if(e.openOnHover&&(s.onMouseenter=()=>{o=!0,b()},s.onMouseleave=()=>{o=!1,x()}),u.value&&(s.onFocusin=()=>{i=!0,b()},s.onFocusout=()=>{i=!1,x()}),e.closeOnContentClick){const I=ge(hn,null);s.onClick=()=>{n.value=!1,I?.closeParents()}}return s}),P=w(()=>{const s={};return e.openOnHover&&(s.onMouseenter=()=>{c&&(o=!0,c=!1,b())},s.onMouseleave=()=>{o=!1,x()}),s});B(a,s=>{s&&(e.openOnHover&&!o&&(!u.value||!i)||u.value&&!i&&(!e.openOnHover||!o))&&(n.value=!1)}),B(n,s=>{s||setTimeout(()=>{E.value=void 0})},{flush:"post"});const S=Se();ye(()=>{S.value&&me(()=>{l.value=S.el})});const g=Se(),H=w(()=>e.target==="cursor"&&E.value?E.value:g.value?g.el:Je(e.target,r)||l.value),F=w(()=>Array.isArray(H.value)?void 0:H.value);let A;return B(()=>!!e.activator,s=>{s&&W?(A=_e(),A.run(()=>{Sn(e,r,{activatorEl:l,activatorEvents:v})})):A&&A.stop()},{flush:"post",immediate:!0}),N(()=>{A?.stop()}),{activatorEl:l,activatorRef:S,target:H,targetEl:F,targetRef:g,activatorEvents:v,contentEvents:C,scrimEvents:P}}function Sn(e,t,n){let{activatorEl:a,activatorEvents:r}=n;B(()=>e.activator,(c,u)=>{if(u&&c!==u){const d=i(u);d&&o(d)}c&&me(()=>l())},{immediate:!0}),B(()=>e.activatorProps,()=>{l()}),N(()=>{o()});function l(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i(),u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.activatorProps;c&&Xt(c,R(r.value,u))}function o(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i(),u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.activatorProps;c&&Zt(c,R(r.value,u))}function i(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.activator;const u=Je(c,t);return a.value=u?.nodeType===Node.ELEMENT_NODE?u:void 0,a.value}}function Je(e,t){if(!e)return;let n;if(e==="parent"){let a=t?.proxy?.$el?.parentNode;for(;a?.hasAttribute("data-no-activator");)a=a.parentNode;n=a}else typeof e=="string"?n=document.querySelector(e):"$el"in e?n=e.$el:n=e;return n}function pn(){if(!W)return Y(!1);const{ssr:e}=it();if(e){const t=Y(!1);return He(()=>{t.value=!0}),t}else return Y(!0)}const Me=Symbol.for("vuetify:stack"),z=Ie([]);function kn(e,t,n){const a=Ne("useStack"),r=!n,l=ge(Me,void 0),o=Ie({activeChildren:new Set});lt(Me,o);const i=Y(+t.value);de(e,()=>{const d=z.at(-1)?.[1];i.value=d?d+10:+t.value,r&&z.push([a.uid,i.value]),l?.activeChildren.add(a.uid),N(()=>{if(r){const b=st(z).findIndex(x=>x[0]===a.uid);z.splice(b,1)}l?.activeChildren.delete(a.uid)})});const c=Y(!0);r&&ye(()=>{const d=z.at(-1)?.[0]===a.uid;setTimeout(()=>c.value=d)});const u=w(()=>!o.activeChildren.size);return{globalTop:ct(c),localTop:u,stackStyles:w(()=>({zIndex:i.value}))}}function On(e){return{teleportTarget:w(()=>{const n=e.value;if(n===!0||!W)return;const a=n===!1?document.body:typeof n=="string"?document.querySelector(n):n;if(a==null)return;let r=a.querySelector(":scope > .v-overlay-container");return r||(r=document.createElement("div"),r.className="v-overlay-container",a.appendChild(r)),r})}}function Cn(e){const{modelValue:t,color:n,...a}=e;return T(kt,{name:"fade-transition",appear:!0},{default:()=>[e.modelValue&&T("div",R({class:["v-overlay__scrim",e.color.backgroundColorClasses.value],style:e.color.backgroundColorStyles.value},a),null)]})}const et=j({absolute:Boolean,attach:[Boolean,String,Object],closeOnBack:{type:Boolean,default:!0},contained:Boolean,contentClass:null,contentProps:null,disabled:Boolean,opacity:[Number,String],noClickAnimation:Boolean,modelValue:Boolean,persistent:Boolean,scrim:{type:[Boolean,String],default:!0},zIndex:{type:[Number,String],default:2e3},...En(),...ut(),...ft(),...jt(),...rn(),...vn(),...vt(),...Gt()},"VOverlay"),Re=$e()({name:"VOverlay",directives:{ClickOutside:on},inheritAttrs:!1,props:{_disableGlobalStack:Boolean,...et()},emits:{"click:outside":e=>!0,"update:modelValue":e=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(e,t){let{slots:n,attrs:a,emit:r}=t;const l=We(e,"modelValue"),o=w({get:()=>l.value,set:k=>{k&&e.disabled||(l.value=k)}}),{teleportTarget:i}=On(w(()=>e.attach||e.contained)),{themeClasses:c}=dt(e),{rtlClasses:u,isRtl:d}=mt(),{hasContent:b,onAfterLeave:x}=qt(e,o),E=yt(w(()=>typeof e.scrim=="string"?e.scrim:null)),{globalTop:f,localTop:v,stackStyles:C}=kn(o,gt(e,"zIndex"),e._disableGlobalStack),{activatorEl:P,activatorRef:S,target:g,targetEl:H,targetRef:F,activatorEvents:A,contentEvents:s,scrimEvents:I}=xn(e,{isActive:o,isTop:v}),{dimensionStyles:ee}=ht(e),te=pn(),{scopeId:p}=Ye();B(()=>e.disabled,k=>{k&&(o.value=!1)});const h=M(),m=M(),y=M(),{contentStyles:D,updateLocation:L}=ln(e,{isRtl:d,contentEl:y,target:g,isActive:o});dn(e,{root:h,contentEl:y,targetEl:H,isActive:o,updateLocation:L});function q(k){r("click:outside",k),e.persistent?G():o.value=!1}function O(k){return o.value&&f.value&&(!e.scrim||k.target===m.value)}W&&B(o,k=>{k?window.addEventListener("keydown",V):window.removeEventListener("keydown",V)},{immediate:!0}),wt(()=>{W&&window.removeEventListener("keydown",V)});function V(k){k.key==="Escape"&&f.value&&(e.persistent?G():(o.value=!1,y.value?.contains(document.activeElement)&&P.value?.focus()))}const U=bt();de(()=>e.closeOnBack,()=>{Et(U,k=>{f.value&&o.value?(k(!1),e.persistent?G():o.value=!1):k()})});const $=M();B(()=>o.value&&(e.absolute||e.contained)&&i.value==null,k=>{if(k){const ne=Qt(h.value);ne&&ne!==document.scrollingElement&&($.value=ne.scrollTop)}});function G(){e.noClickAnimation||y.value&&zt(y.value,[{transformOrigin:"center"},{transform:"scale(1.03)"},{transformOrigin:"center"}],{duration:150,easing:Yt})}function tt(){r("afterEnter")}function nt(){x(),r("afterLeave")}return je(()=>T(qe,null,[n.activator?.({isActive:o.value,targetRef:F,props:R({ref:S},A.value,e.activatorProps)}),te.value&&b.value&&T(xt,{disabled:!i.value,to:i.value},{default:()=>[T("div",R({class:["v-overlay",{"v-overlay--absolute":e.absolute||e.contained,"v-overlay--active":o.value,"v-overlay--contained":e.contained},c.value,u.value,e.class],style:[C.value,{"--v-overlay-opacity":e.opacity,top:_($.value)},e.style],ref:h},p,a),[T(Cn,R({color:E,modelValue:o.value&&!!e.scrim,ref:m},I.value),null),T(Kt,{appear:!0,persisted:!0,transition:e.transition,target:g.value,onAfterEnter:tt,onAfterLeave:nt},{default:()=>[ue(T("div",R({ref:y,class:["v-overlay__content",e.contentClass],style:[ee.value,D.value]},s.value,e.contentProps),[n.default?.({isActive:o})]),[[St,o.value],[pt("click-outside"),{handler:q,closeConditional:O,include:()=>[P.value]}]])]})])]})])),{activatorEl:P,scrimEl:m,target:g,animateClick:G,contentEl:y,globalTop:f,localTop:v,updateLocation:L}}}),Pn=j({id:String,text:String,...Ot(et({closeOnBack:!1,location:"end",locationStrategy:"connected",eager:!0,minWidth:0,offset:10,openOnClick:!1,openOnHover:!0,origin:"auto",scrim:!1,scrollStrategy:"reposition",transition:!1}),["absolute","persistent"])},"VTooltip"),An=$e()({name:"VTooltip",props:Pn(),emits:{"update:modelValue":e=>!0},setup(e,t){let{slots:n}=t;const a=We(e,"modelValue"),{scopeId:r}=Ye(),l=Ct(),o=w(()=>e.id||`v-tooltip-${l}`),i=M(),c=w(()=>e.location.split(" ").length>1?e.location:e.location+" center"),u=w(()=>e.origin==="auto"||e.origin==="overlap"||e.origin.split(" ").length>1||e.location.split(" ").length>1?e.origin:e.origin+" center"),d=w(()=>e.transition?e.transition:a.value?"scale-transition":"fade-transition"),b=w(()=>R({"aria-describedby":o.value},e.activatorProps));return je(()=>{const x=Re.filterProps(e);return T(Re,R({ref:i,class:["v-tooltip",e.class],style:e.style,id:o.value},x,{modelValue:a.value,"onUpdate:modelValue":E=>a.value=E,transition:d.value,absolute:!0,location:c.value,origin:u.value,persistent:!0,role:"tooltip",activatorProps:b.value,_disableGlobalStack:!0},r),{activator:n.activator,default:function(){for(var E=arguments.length,f=new Array(E),v=0;vo??n.innerHTML,u=(r.ctx===a.instance.$?Ln(r,a.instance.$)?.provides:r.ctx?.provides)??a.instance.$.provides,d=Tt(e,R(l,i),c);d.appContext=Object.assign(Object.create(null),a.instance.$.appContext,{provides:u}),ze(d,n)}}function Ln(e,t){const n=new Set,a=l=>{for(const o of l){if(!o)continue;if(o===e)return!0;n.add(o);let i;if(o.suspense?i=a([o.ssContent]):Array.isArray(o.children)?i=a(o.children):o.component?.vnode&&(i=a([o.component?.subTree])),i)return i;n.delete(o)}return!1};if(!a([t.subTree]))throw new Error("Could not find original vnode");const r=Array.from(n).reverse();for(const l of r)if(l.component)return l.component;return t}const Fe=Tn(An,e=>({activator:"parent",location:e.arg?.replace("-"," ")??"top",text:typeof e.value=="boolean"?void 0:e.value})),Mn={class:"flex rounded-lg border border-gray-300 dark:border-gray-600",style:{margin:"2px"}},Rn=["value"],Hn={__name:"EodashDatePicker",setup(e){function t(o){if(r.value&&r.value.length>0){let i=o?1/0:-1/0;r.value.forEach(c=>{c?.dates&&c.dates.forEach(u=>{u instanceof Date&&(!o&&u.getTime()>i||o&&u.getTime(){const{selectedStac:o}=Bt(Lt());B([o],async([i])=>{if(i){const c=Ht(`./${i.id}/collection.json`,n.stacEndpoint),u=It(o.value,c),d=["#009E73","#0072B2","#E69F00","#CC79A7","#56B4E9","#D55E00"];for(let b=0;bf.rel==="item"&&"datetime"in f).map(f=>new Date(f.datetime));r.value=[{bar:{style:{backgroundColor:d[b%d.length]}},dates:E}]}}},{immediate:!0})}),(o,i)=>(re(),Mt(qe,null,[T(ie(Vt),{modelValue:l.value,"onUpdate:modelValue":i[0]||(i[0]=c=>l.value=c),masks:a.value,attributes:r.value},{default:K(({inputValue:c,inputEvents:u})=>[pe("div",Mn,[pe("input",R({value:c},Dt(u,!0),{style:{margin:"1px"},class:"flex-grow px-1 py-1 bg-white dark:bg-gray-700"}),null,16,Rn)])]),_:1},8,["modelValue","masks","attributes"]),T(Rt,{align:"center",justify:"center",style:{"margin-top":"6px"}},{default:K(()=>[ue((re(),ke(Ce,{style:{padding:"0px","margin-right":"4px"},density:"compact",onClick:i[1]||(i[1]=c=>t(!0))},{default:K(()=>[T(Oe,{icon:[ie(_t)]},null,8,["icon"])]),_:1})),[[Fe,"Set date to oldest available dataset","bottom"]]),ue((re(),ke(Ce,{style:{padding:"0px","margin-left":"4px"},density:"compact",onClick:i[2]||(i[2]=c=>t(!1))},{default:K(()=>[T(Oe,{icon:[ie(Nt)]},null,8,["icon"])]),_:1})),[[Fe,"Set date to latest available dataset","bottom"]])]),_:1})],64))}};export{Hn as default}; diff --git a/pr-preview/pr-17/assets/EodashItemFilter-CItLwjT8.js b/pr-preview/pr-17/assets/EodashItemFilter-BrZ-eyrX.js similarity index 84% rename from pr-preview/pr-17/assets/EodashItemFilter-CItLwjT8.js rename to pr-preview/pr-17/assets/EodashItemFilter-BrZ-eyrX.js index 5264dab..2a42180 100644 --- a/pr-preview/pr-17/assets/EodashItemFilter-CItLwjT8.js +++ b/pr-preview/pr-17/assets/EodashItemFilter-BrZ-eyrX.js @@ -1,4 +1,4 @@ -import{$ as p,a0 as c,at as d}from"./index-DBoWNDl8.js";import m from"./DynamicWebComponent-Cx5W-nMa.js";const f={__name:"EodashItemFilter",setup(u){const r=()=>d(()=>import("./eox-itemfilter-DzNaeUZj.js"),[]),o={config:{titleProperty:"title",filterProperties:[{keys:["title","themes"],title:"Search",type:"text"},{key:"themes",title:"Theme Filter",type:"multiselect"}],aggregateResults:"themes",enableHighlighting:!0,expandMultipleFilters:!1,expandMultipleResults:!1}},a=(t,i)=>{t.style.height="100%";const s=document.createElement("style");s.innerHTML=` +import{$ as p,a0 as c,at as d}from"./index-B5c5Pwhg.js";import m from"./DynamicWebComponent-CFpMl29n.js";const f={__name:"EodashItemFilter",setup(u){const r=()=>d(()=>import("./eox-itemfilter-B6N0Xfw2.js"),[]),o={config:{titleProperty:"title",filterProperties:[{keys:["title","themes"],title:"Search",type:"text"},{key:"themes",title:"Theme Filter",type:"multiselect"}],aggregateResults:"themes",enableHighlighting:!0,expandMultipleFilters:!1,expandMultipleResults:!1}},a=(t,i)=>{t.style.height="100%";const s=document.createElement("style");s.innerHTML=` section { margin: 0 !important; } diff --git a/pr-preview/pr-17/assets/EodashMap-0k6ZVzxF.js b/pr-preview/pr-17/assets/EodashMap-0k6ZVzxF.js deleted file mode 100644 index 4c644c1..0000000 --- a/pr-preview/pr-17/assets/EodashMap-0k6ZVzxF.js +++ /dev/null @@ -1,655 +0,0 @@ -const __vite__fileDeps=["assets/raw-CcGKjn8q-MKTGGSca.js","assets/basedecoder-Qm25PwVp-gdlnpIMU.js","assets/lzw-BOMhmEDy-CRQZVFv2.js","assets/jpeg-DNfUpLwy-CrsOgAb-.js","assets/deflate-Be2Arps5-XLmgg930.js","assets/pako.esm-C3kYPGGQ-DQSVoCko.js","assets/packbits-DaUD6MLm-DnF8Bj-8.js","assets/lerc-_E46UbWQ-CN6lsrI9.js","assets/index-DBoWNDl8.js","assets/index-D4vzHx3H.css","assets/http-DqoOZdf6.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/DynamicWebComponent-Cx5W-nMa.js","assets/webimage-D2c098k3-CiG7DZmh.js","assets/decoder-HRvnjnEI-Bgc3xmlZ.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); -import{a$ as Z1,at as jn,x as q1,b0 as wi,$ as $1,a0 as V1,W as Y1,aU as H1,w as K1,a_ as J1}from"./index-DBoWNDl8.js";import{t as xl,U as Q1,b as qg}from"./http-DqoOZdf6.js";import{c as tx}from"./_commonjsHelpers-Cpj98o6Y.js";import ex from"./DynamicWebComponent-Cx5W-nMa.js";var rx={exports:{}};(function(r,t){(function(e,n){r.exports=n()})(tx,function(){var e=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;function n(u,d){return u.indexOf(d)===-1?u.length:u.indexOf(d)}function i(u){var d=u.replace(/^v/,"").replace(/\+.*$/,""),g=n(d,"-"),f=d.substring(0,g).split(".");return f.push(d.substring(g+1)),f}function s(u){return isNaN(Number(u))?u:Number(u)}function o(u){if(typeof u!="string")throw new TypeError("Invalid argument expected string");if(!e.test(u))throw new Error("Invalid argument not valid semver ('"+u+"' received)")}function a(u,d){[u,d].forEach(o);for(var g=i(u),f=i(d),p=0;py)return 1;if(y>_)return-1}var v=g[g.length-1],w=f[f.length-1];if(v&&w){var S=v.split(".").map(s),E=w.split(".").map(s);for(p=0;pE[p])return 1;if(E[p]>S[p])return-1}}else if(v||w)return v?-1:1;return 0}var l=[">",">=","=","<","<="],h={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};function c(u){if(typeof u!="string")throw new TypeError("Invalid operator type, expected string but got "+typeof u);if(l.indexOf(u)===-1)throw new TypeError("Invalid operator, expected one of "+l.join("|"))}return a.validate=function(u){return typeof u=="string"&&e.test(u)},a.compare=function(u,d,g){c(g);var f=a(u,d);return h[g].indexOf(f)>-1},a})})(rx);const Ee={classification:"https://stac-extensions.github.io/classification/v1.1.0/schema.json",datacube:"https://stac-extensions.github.io/datacube/v2.1.0/schema.json",eo:"https://stac-extensions.github.io/eo/v1.0.0/schema.json",file:"https://stac-extensions.github.io/file/v1.0.0/schema.json","item-assets":"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json",label:"https://stac-extensions.github.io/label/v1.0.1/schema.json",pointcloud:"https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json",processing:"https://stac-extensions.github.io/processing/v1.1.0/schema.json",projection:"https://stac-extensions.github.io/projection/v1.0.0/schema.json",raster:"https://stac-extensions.github.io/raster/v1.1.0/schema.json",sar:"https://stac-extensions.github.io/sar/v1.0.0/schema.json",sat:"https://stac-extensions.github.io/sat/v1.0.0/schema.json",scientific:"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",table:"https://stac-extensions.github.io/table/v1.2.0/schema.json",timestamps:"https://stac-extensions.github.io/timestamps/v1.0.0/schema.json",version:"https://stac-extensions.github.io/version/v1.0.0/schema.json",view:"https://stac-extensions.github.io/view/v1.0.0/schema.json"},bs={itemAndCollection:{"cube:":Ee.datacube,"eo:":Ee.eo,"file:":Ee.file,"label:":Ee.label,"pc:":Ee.pointcloud,"processing:":Ee.processing,"proj:":Ee.projection,"raster:":Ee.raster,"sar:":Ee.sar,"sat:":Ee.sat,"sci:":Ee.scientific,"view:":Ee.view,version:Ee.version,deprecated:Ee.version,published:Ee.timestamps,expires:Ee.timestamps,unpublished:Ee.timestamps},catalog:{},collection:{item_assets:Ee["item-assets"]},item:{}};bs.collection=Object.assign(bs.collection,bs.itemAndCollection);bs.item=Object.assign(bs.item,bs.itemAndCollection);function ga(r){let t=r.length>=6,e=r[0],n=r[t?3:2],i=r[1],s=r[t?4:3],o={west:e,east:n,south:i,north:s};return t&&(o.base=r[2],o.height=r[5]),o}function tc(r){let{west:t,east:e,south:n,north:i}=ga(r);return[[[t,i],[t,n],[e,n],[e,i],[t,i]]]}function nx(r){if(!In(r))return null;let t=ga(r),e=[];if(Tm(r)){let n=(t.west+360+t.east)/2;n>180&&(n-=360),e.push(n)}else e.push((t.west+t.east)/2);return e.push((t.south+t.north)/2),typeof t.base<"u"&&e.push((t.base+t.height)/2),e}function ix(r){if(In(r)?r=[r]:Array.isArray(r)&&(r=r.filter(n=>In(n))),!Array.isArray(r)||r.length===0)return null;let t=r.reduce((n,i)=>{if(Tm(i)){let{west:s,east:o,south:a,north:l}=ga(i);n.push(tc([-180,a,o,l])),n.push(tc([s,a,180,l]))}else n.push(tc(i));return n},[]),e=null;if(t.length===1?e={type:"Polygon",coordinates:t[0]}:t.length>1&&(e={type:"MultiPolygon",coordinates:t}),e)return{type:"Feature",geometry:e,properties:{}}}function In(r){if(!Array.isArray(r)||![4,6].includes(r.length)||r.some(s=>typeof s!="number"))return!1;let{west:t,east:e,south:n,north:i}=ga(r);return n<=i&&t>=-180&&t<=180&&n>=-90&&e<=180&&e>=-180&&i<=90}function Tm(r){if(!In(r))return!1;let{west:t,east:e}=ga(r);return t>e}function nr(r){return typeof r=="string"&&r.length>0}function Je(r){return typeof r=="object"&&r===Object(r)&&!Array.isArray(r)}function Mm(...r){if(r=r.filter(t=>Array.isArray(t)),r.length>1){let t=Math.max(...r.map(n=>n.length)),e=[];for(let n=0;ni[n])));return e}else if(r.length===1)return r[0];return[]}function sx(r){switch(r){case"int8":return-128;case"int16":return-32768;case"int32":return-2147483648}return r.startsWith("u")?0:null}function ox(r){switch(r){case"int8":return 127;case"uint8":return 255;case"int16":return 32767;case"uint16":return 65535;case"int32":return 2147483647;case"uint32":return 4294967295}return null}class ih{constructor(t,e={},n=[]){if(!Je(t))throw new Error("Given data is not an object");if(t instanceof ih){for(let i of n)this[i]=t[i];t=t.toJSON()}this._keyMap=e,this._privateKeys=["_keyMap","_privateKeys"].concat(n);for(let i in t)typeof this[i]>"u"&&(i in e?this[i]=e[i](t[i],this):this[i]=t[i])}isItem(){return this.type==="Feature"}isCatalog(){return this.type==="Catalog"}isCatalogLike(){return this.isCatalog()||this.isCollection()}isCollection(){return this.type==="Collection"}isItemCollection(){return this.type==="FeatureCollection"}isCollectionCollection(){return!1}isAsset(){return!1}isLink(){return!1}getObjectType(){}getAbsoluteUrl(){return null}getMetadata(t){return this[t]}toGeoJSON(){return null}getBoundingBox(){return null}getCenter(){return nx(this.getBoundingBox())}getBoundingBoxes(){return[]}toJSON(){let t={};return Object.keys(this).forEach(e=>{if(typeof this[e]=="function"||this._privateKeys.includes(e))return;let n=this[e];if(e in this._keyMap){let i=Array.isArray(n)?[]:{};for(let s in n)i[s]=n[s].toJSON();n=i}t[e]=n}),t}}const ax="application/geo+json",lx=["application/json",ax,"text/json"],$g=["image/gif","image/jpeg","image/apng","image/png","image/webp"],Rm=["image/tiff; application=geotiff; profile=cloud-optimized","image/vnd.stac.geotiff; cloud-optimized=true"],Cm=["application/geotiff","image/tiff; application=geotiff","image/vnd.stac.geotiff"].concat(Rm);function Mu(r,t,e=!1){return Array.isArray(t)||(t=[t]),e&&typeof r>"u"?!0:typeof r!="string"?!1:(t=t.map(n=>n.toLowerCase()),t.includes(r.toLowerCase()))}function hx(r,t=!1){return Mu(r,lx,t)}class Im extends ih{constructor(t,e=null,n={},i=[]){super(t,n,["_context"].concat(i)),this._context||(this._context=e)}getAbsoluteUrl(t=!0){return this._context?xl(this.href,this._context.getAbsoluteUrl(),t):this.href.includes("://")?this.href:null}getContext(){return this._context}canBrowserDisplayImage(t=!1){if(typeof this.href!="string")return!1;if(!t&&typeof this.type>"u")return!1;let e=new Q1(this.href),n=e.protocol().toLowerCase(),i=e.suffix().toLowerCase();return nr(n)&&!qg.includes(n)?!1:nr(this.type)&&$g.includes(this.type.toLowerCase())?!0:!!(typeof this.type>"u"&&nr(i)&&(i==="jpg"||$g.includes("image/"+i)))}isType(t){return nr(this.type)&&Mu(this.type,t)}isGeoTIFF(){return this.isType(Cm)}isCOG(){return this.isType(Rm)}isHTTP(){let e=this.getAbsoluteUrl(!1).protocol().toLowerCase();return nr(e)&&qg.includes(e)}}class Ru extends Im{constructor(t,e=null){super(t,e)}isLink(){return!0}getObjectType(){return"Link"}static fromLinks(t,e=null){return Array.isArray(t)?t.map(n=>Je(n)?new Ru(n,e):n):[]}}class cx extends ih{constructor(t,e=null,n={},i=[]){if(super(t,Object.assign({links:Ru.fromLinks},n),["_url"].concat(i)),!this._url&&(this._url=e,!this._url)){let s=this.getSelfLink();s&&(this._url=s.href)}}getAbsoluteUrl(){return this._url}setAbsoluteUrl(t){this._url=t}getStacLinksWithRel(t,e=!0){return this.getLinksWithRels([t]).filter(n=>hx(n.type,e))}getStacLinkWithRel(t,e=!0){const n=this.getStacLinksWithRel(t,e);return n.length>0?n[0]:null}getLinks(){return Array.isArray(this.links)?this.links.filter(t=>Je(t)&&nr(t.href)):[]}getLinkWithRel(t){return this.getLinks().find(e=>e.rel===t)||null}getLinksWithRels(t){return this.getLinks().filter(e=>t.includes(e.rel))}getLinksWithOtherRels(t){return this.getLinks().filter(e=>!t.includes(e.rel))}getSelfLink(){return this.getStacLinkWithRel("self")}getRootLink(){return this.getStacLinkWithRel("root")}getParentLink(){return this.getStacLinkWithRel("parent")}}class Wo extends Im{constructor(t,e=null,n=null){super(t,n,{},["_key"]),this._key||(this._key=e)}getObjectType(){return"Asset"}isAsset(){return!0}getAbsoluteUrl(t=!0){return this.isDefinition()?null:super.getAbsoluteUrl(t)}getKey(){return this._key}getMetadata(t){if(typeof this[t]<"u")return this[t];if(this._context)return this._context.getMetadata(t)}getBands(){return Mm(this["eo:bands"],this["raster:bands"])}findVisualBands(){let t={red:null,green:null,blue:null},e=this.getBands();for(let i in e){let s=parseInt(i,10),o=e[s];Je(o)&&nr(o.common_name)&&o.common_name in t&&(t[o.common_name]={index:s,band:o})}return Object.values(t).every(i=>i!==null)?t:null}findBand(t,e="name",n=null){Array.isArray(t)||(t=[t]),Je(n)||(n=this.getBands());let i=n.findIndex(s=>Je(s)&&t.includes(s[e]));return i>=0?{index:i,band:n[i]}:null}getBand(t){return Je(t)||t===null?t:this.getBands()[t]||null}getMinMaxValues(t=null){t=this.getBand(t);const e={minimum:null,maximum:null},n=a=>a.minimum!==null&&a.maximum!==null;if(t&&(Je(t.statistics)&&(typeof t.statistics.minimum=="number"&&(e.minimum=t.statistics.minimum),typeof t.statistics.maximum=="number"&&(e.maximum=t.statistics.maximum),n(e))||Je(t.histogram)&&(typeof t.histogram.min=="number"&&(e.minimum=t.histogram.min),typeof t.histogram.max=="number"&&(e.maximum=t.histogram.max),n(e))))return e;let i=this.getMetadata("classification:classes");if(Array.isArray(i)&&(i.reduce((a,l)=>(a.minimum=Math.min(a.minimum,l.value),a.maximum=Math.max(a.maximum,l.value),a),e),n(e)))return e;let s=this.getMetadata("file:values");if(Array.isArray(s)&&(s.reduce((a,l)=>(a.minimum=Math.min(a.minimum,...l.values),a.maximum=Math.max(a.maximum,...l.values),a),e),n(e)))return e;let o=Je(t)&&t.data_type||this.getMetadata("file:data_type");return o&&(e.minimum=sx(o),e.maximum=ox(o)),e}getNoDataValues(t=null){t=this.getBand(t);let e=[];if(t&&typeof t.nodata<"u")e.push(t.nodata);else{let n=this.getMetadata("file:nodata");if(typeof n<"u")e=n;else{let i=this.getMetadata("classification:classes");Array.isArray(i)&&(e=i.filter(s=>!!s.nodata).map(s=>s.value))}}return e.map(n=>n==="nan"?NaN:n==="+inf"?1/0:n==="-inf"?-1/0:n)}isDefinition(){return!nr(this.href)}isHTTP(){return this.isDefinition()?null:super.isHTTP()}hasRole(t,e=!1){return Array.isArray(t)||(t=[t]),e&&t.includes(this.getKey())?!0:Array.isArray(this.roles)&&!!this.roles.find(n=>t.includes(n))}static fromAssets(t,e=null){let n={};if(Je(t))for(let i in t)n[i]=new Wo(t[i],i,e);return n}}class sh extends cx{constructor(t,e=null,n={},i=[]){super(t,e,n,i)}getTemporalExtent(){return null}getTemporalExtents(){return[]}getIcons(t=!0){return this.getLinksWithRels(["icon"]).filter(e=>e.canBrowserDisplayImage(t))}getThumbnails(t=!0,e=null){let n=this.getAssetsWithRoles(["thumbnail","overview"],!0);if(n.length===0&&(n=this.getLinksWithRels(["preview"])),t&&(n=n.filter(i=>i.canBrowserDisplayImage())),e&&n.length>1){let i=s=>Array.isArray(s.roles)&&s.roles.includes(e)||s.getKey()===e;n=n.filter(i).concat(n.filter(s=>!i(s)))}return n}getDefaultGeoTIFF(t=!0,e=!1){return this.rankGeoTIFFs(t,e)[0]?.asset}rankGeoTIFFs(t=!0,e=!1,n=null,i=null){Je(n)||(n={data:1,visual:2,thumbnail:2,overview:3});let s=[],o=this.getAssetsByTypes(Cm);t&&(o=o.filter(l=>l.isHTTP()&&(!e||l.isCOG())));let a=Object.entries(n);for(let l of o){let h=0;if(a.length>0){let c=a.filter(([u])=>l.hasRole(u,!0)).map(([,u])=>u);c.length>0&&(h+=Math.max(...c))}!e&&l.isCOG()&&(h+=2),l.findVisualBands()&&(h+=1),typeof i=="function"&&(h+=i(l)),s.push({asset:l,score:h})}return s.sort((l,h)=>h.score-l.score),s}findVisualAssets(){let t={red:null,green:null,blue:null},e=Object.keys(t),n=this.getAssets();for(let s of n){let o=s.getBands();if(o.length!==1)continue;let a=s.findBand(e,"common_name",o);a&&(t[a.band.common_name]=s)}return Object.values(t).every(s=>s!==null)?t:null}getAsset(t){return Je(this.assets)&&this.assets[t]||null}getAssets(){return Je(this.assets)?Object.values(this.assets):[]}getAssetsWithRoles(t,e=!1){return this.getAssets().filter(n=>n.hasRole(t,e))}getAssetWithRole(t,e=!1){return this.getAssetsWithRoles([t],e)[0]||null}getAssetsByTypes(t){return this.getAssets().filter(e=>Mu(e.type,t))}equals(t){return this===t?!0:!(t instanceof sh)||this.getObjectType()!==t.getObjectType()?!1:!!(this.id&&this.id===t.id)}}class ux extends sh{constructor(t,e=null,n={},i=[]){super(t,e,n,i)}getObjectType(){return this.type}getSearchLink(t=null){let e=this.getStacLinksWithRel("search");return t?e[0]||null:e.find(n=>n.method===t||!t&&!n.method)||null}getApiCollectionsLink(){return this.getStacLinkWithRel("data")}getApiItemsLink(){return this.getStacLinkWithRel("items")}getChildLinks(){return this.getStacLinksWithRel("child")}getItemLinks(){return this.getStacLinksWithRel("item")}}function xo(r){if(nr(r)&&r.length>=10)try{let e=r.match(/^(-?\d{1,})-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)(?:\.(\d*))?(?:Z|[+-]00:00)?$/i).slice(1).map(n=>parseInt(n,10));return new Date(Date.UTC(e[0],e[1]-1,e[2],e[3],e[4],e[5],e[6]||0))}catch{return null}return null}function dx(r,t){return new Date(r.valueOf()+(t-r)/2)}class Vg extends ux{constructor(t,e=null){const n={assets:Wo.fromAssets,item_assets:Wo.fromAssets};super(t,e,n)}toGeoJSON(){let t=ix(this.getBoundingBoxes());return t&&(t.id=this.id),t}getBoundingBox(){let t=this.getRawBoundingBoxes();return t.length>0&&In(t[0])?t[0]:null}getBoundingBoxes(){let t=this.getRawBoundingBoxes();return t.length===1&&In(t[0])?t:t.length>1?t.filter((e,n)=>n>0&&In(e)):[]}getRawBoundingBoxes(){let t=this.extent?.spatial?.bbox;return Array.isArray(t)&&t.length>0?t:[]}getTemporalExtent(){return this.getTemporalExtents()[0]||null}getTemporalExtents(){let t=this.extent?.temporal?.interval;return Array.isArray(t)&&t.length>0?t.filter(e=>Array.isArray(e)&&(nr(e[0])||nr(e[1]))).map(e=>e.map(n=>xo(n))):[]}getSummary(t){return this.summaries[t]}getBands(){let t=this.getSummary("eo:bands"),e=this.getSummary("raster:bands"),n=[t,e].filter(i=>Array.isArray(i));return n.length>=2?Mm(...n):n.length===1?n[0]:[]}}class gx extends sh{constructor(t,e=null){super(t,e,{assets:Wo.fromAssets})}getObjectType(){return"Item"}toGeoJSON(){return this.toJSON()}getBoundingBox(){return In(this.bbox)?this.bbox:null}getBoundingBoxes(){return In(this.bbox)?[this.bbox]:[]}getDateTime(){let t=xo(this.properties.datetime);if(!t){let e=xo(this.properties.start_datetime),n=xo(this.properties.end_datetime);return e&&n?dx(e,n):e||n}return t}getTemporalExtent(){return this.getTemporalExtents()[0]||null}getTemporalExtents(){let t=[];return nr(this.properties.start_datetime)||nr(this.properties.end_datetime)?t=[[this.properties.start_datetime||null,this.properties.end_datetime||null]]:nr(this.properties.datetime)&&(t=[[this.properties.datetime,this.properties.datetime]]),t.map(e=>e.map(n=>xo(n)))}getMetadata(t){return this.properties[t]}getBands(){let t=this.getMetadata("eo:bands");return Array.isArray(t)?t:[]}getCollectionLink(){return this.getStacLinkWithRel("collection")}}function fx(r){const t=[];return r.forEach(n=>{if(n.rel==="item"&&"latlng"in n){const[i,s]=n.latlng.split(",").map(o=>Number(o));t.push({type:"Feature",geometry:{type:"Point",coordinates:[s,i]}})}}),{type:"FeatureCollection",crs:{type:"name",properties:{name:"EPSG:4326"}},features:t}}class px{#e="";#t;selectedItem;constructor(t){this.#e=t}createLayersJson=async(t=null)=>{let e,n,i=[{type:"Tile",properties:{id:"OSM"},source:{type:"OSM"}}];if(this.#t||(n=await(await Z1.get(this.#e)).data,this.#t=new Vg(n)),n&&n.endpointtype==="GeoDB"){const s=fx(n.links);return i.unshift({type:"Vector",properties:{id:n.id},source:{type:"Vector",url:"data:,"+encodeURIComponent(JSON.stringify(s)),format:"GeoJSON"},style:{"circle-radius":5,"circle-fill-color":"#00417077","circle-stroke-color":"#004170","fill-color":"#00417077","stroke-color":"#004170"}}),i}else if(t instanceof Date?(e=this.getItems()?.sort((o,a)=>{const l=Math.abs(new Date(o.datetime).getTime()-t.getTime()),h=Math.abs(new Date(a.datetime).getTime()-t.getTime());return l-h})[0],this.selectedItem=e):e=t,n=await(await fetch(e?xl(e.href,this.#e):this.#e)).json(),e){const o=new gx(n);return this.selectedItem=o,i.unshift(this.buildJson(o)),i}else{this.#t=new Vg(n);const o=this.getItems();return this.selectedItem=o?.[o.length-1],this.selectedItem&&(i=await this.createLayersJson(this.selectedItem)),i}};buildJson(t){let e;return t.links.find(n=>n.rel==="wms"||n.rel==="wmts"||n.rel==="xyz")?e={type:"STAC",displayWebMapLink:!0,displayFootprint:!1,data:t,properties:{id:t.id}}:e={type:"Vector",source:{type:"Vector",url:"data:,"+encodeURIComponent(JSON.stringify(t.geometry)),format:"GeoJSON"},properties:{id:t.id}},e}getItems(){return this.#t?.links.filter(t=>t.rel==="item").sort((t,e)=>t.datetimet.rel==="item").sort((t,e)=>t.datetimenew Date(t.datetime))}}var mx=Object.defineProperty,_x=(r,t,e)=>t in r?mx(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Cu=(r,t,e)=>(_x(r,typeof t!="symbol"?t+"":t,e),e);class gn{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const Iu={PROPERTYCHANGE:"propertychange"};class Pu{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function yx(r,t,e){let n,i;e=e||on;let s=0,o=r.length,a=!1;for(;s>1),i=+e(r[n],t),i<0?s=n+1:(o=n,a=!i);return a?s:~s}function on(r,t){return r>t?1:rt?-1:0}function oh(r,t,e){if(r[0]<=t)return 0;const n=r.length;if(t<=r[n-1])return n-1;if(typeof e=="function"){for(let i=1;i0?i-1:i}return n-1}if(e>0){for(let i=1;i0||o===0)})}function Sx(){return!0}function Zo(){}function Pm(r){let t=!1,e,n,i;return function(){const s=Array.prototype.slice.call(arguments);return(!t||this!==i||!Xi(s,n))&&(t=!0,i=this,n=s,e=r.apply(this,arguments)),e}}function Am(r){function t(){let e;try{e=r()}catch(n){return Promise.reject(n)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function qs(r){for(const t in r)delete r[t]}function Fn(r){let t;for(t in r)return!1;return!t}class fa extends Pu{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const n=this.listeners_||(this.listeners_={}),i=n[t]||(n[t]=[]);i.includes(e)||i.push(e)}dispatchEvent(t){const e=typeof t=="string",n=e?t:t.type,i=this.listeners_&&this.listeners_[n];if(!i)return;const s=e?new gn(t):t;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,a[n]=0),++o[n];let l;for(let h=0,c=i.length;h0:!1}removeEventListener(t,e){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const i=n.indexOf(e);i!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[i]=Zo,++this.pendingRemovals_[t]):(n.splice(i,1),n.length===0&&delete this.listeners_[t]))}}const Ct={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function se(r,t,e,n,i){if(n&&n!==r&&(e=e.bind(n)),i){const o=e;e=function(){r.removeEventListener(t,e),o.apply(this,arguments)}}const s={target:r,type:t,listener:e};return r.addEventListener(t,e),s}function qo(r,t,e,n){return se(r,t,e,n,!0)}function ye(r){r&&r.target&&(r.target.removeEventListener(r.type,r.listener),qs(r))}class pa extends fa{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(Ct.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length,i=new Array(n);for(let s=0;sMath.round(t*Hg[e])/Hg[e]).join(", ")+")"}const be={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Ls(r){const t=je();for(let e=0,n=r.length;ei&&(l=l|be.RIGHT),as&&(l=l|be.ABOVE),l===be.UNKNOWN&&(l=be.INTERSECTING),l}function je(){return[1/0,1/0,-1/0,-1/0]}function Ur(r,t,e,n,i){return i?(i[0]=r,i[1]=t,i[2]=e,i[3]=n,i):[r,t,e,n]}function ma(r){return Ur(1/0,1/0,-1/0,-1/0,r)}function Nu(r,t){const e=r[0],n=r[1];return Ur(e,n,e,n,t)}function Du(r,t,e,n,i){const s=ma(i);return Om(s,r,t,e,n)}function Nn(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function Ax(r,t,e){return Math.abs(r[0]-t[0])r[2]&&(r[2]=t[2]),t[1]r[3]&&(r[3]=t[3]),r}function Po(r,t){t[0]r[2]&&(r[2]=t[0]),t[1]r[3]&&(r[3]=t[1])}function Om(r,t,e,n,i){for(;et[0]?n[0]=r[0]:n[0]=t[0],r[1]>t[1]?n[1]=r[1]:n[1]=t[1],r[2]=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function Un(r){return r[2]=o&&p<=l),!n&&s&be.RIGHT&&!(i&be.RIGHT)&&(_=g-(d-l)*f,n=_>=a&&_<=h),!n&&s&be.BELOW&&!(i&be.BELOW)&&(p=d-(g-a)/f,n=p>=o&&p<=l),!n&&s&be.LEFT&&!(i&be.LEFT)&&(_=g-(d-o)*f,n=_>=a&&_<=h)}return n}function Os(r,t,e,n){if(Un(r))return ma(e);let i=[];if(n>1){const a=r[2]-r[0],l=r[3]-r[1];for(let h=0;h=e[2])){const i=mt(e),s=Math.floor((n[0]-e[0])/i)*i;r[0]-=s,r[2]-=s}return r}function Dx(r,t){if(t.canWrapX()){const e=t.getExtent();if(!isFinite(r[0])||!isFinite(r[2]))return[[e[0],r[1],e[2],r[3]]];Gu(r,t);const n=mt(e);if(mt(r)>n)return[[e[0],r[1],e[2],r[3]]];if(r[0]e[2])return[[r[0],r[1],e[2],r[3]],[e[0],r[1],r[2]-n,r[3]]]}return[r]}const kx={9001:"m",9002:"ft",9003:"us-ft",9101:"radians",9102:"degrees"};function Kg(r){return kx[r]}const ju={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};let Fs=class{constructor(r){this.code_=r.code,this.units_=r.units,this.extent_=r.extent!==void 0?r.extent:null,this.worldExtent_=r.worldExtent!==void 0?r.worldExtent:null,this.axisOrientation_=r.axisOrientation!==void 0?r.axisOrientation:"enu",this.global_=r.global!==void 0?r.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=r.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=r.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||ju[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(r){this.global_=r,this.canWrapX_=!!(r&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(r){this.defaultTileGrid_=r}setExtent(r){this.extent_=r,this.canWrapX_=!!(this.global_&&r)}setWorldExtent(r){this.worldExtent_=r}setGetPointResolution(r){this.getPointResolutionFunc_=r}getPointResolutionFunc(){return this.getPointResolutionFunc_}};const xa=6378137,ms=Math.PI*xa,Gx=[-ms,-ms,ms,ms],jx=[-180,-85,180,85],Za=xa*Math.log(Math.tan(Math.PI/2));class Ji extends Fs{constructor(t){super({code:t,units:"m",extent:Gx,global:!0,worldExtent:jx,getPointResolution:function(e,n){return e/Math.cosh(n[1]/xa)}})}}const Jg=[new Ji("EPSG:3857"),new Ji("EPSG:102100"),new Ji("EPSG:102113"),new Ji("EPSG:900913"),new Ji("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ji("http://www.opengis.net/gml/srs/epsg.xml#3857")];function zx(r,t,e){const n=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(n));for(let i=0;iZa?s=Za:s<-Za&&(s=-Za),t[i+1]=s}return t}function Ux(r,t,e){const n=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(n));for(let i=0;i1?(e=i,n=s):l>0&&(e+=o*l,n+=a*l)}return Pi(r,t,e,n)}function Pi(r,t,e,n){const i=e-r,s=n-t;return i*i+s*s}function qx(r){const t=r.length;for(let n=0;ns&&(s=l,i=a)}if(s===0)return null;const o=r[i];r[i]=r[n],r[n]=o;for(let a=n+1;a=0;n--){e[n]=r[n][t]/r[n][n];for(let i=n-1;i>=0;i--)r[i][t]-=r[i][n]*e[n]}return e}function Ao(r){return r*Math.PI/180}function an(r,t){const e=r%t;return e*t<0?e+t:e}function pr(r,t,e){return r+e*(t-r)}function va(r,t){const e=Math.pow(10,t);return Math.round(r*e)/e}function vl(r,t){return Math.round(va(r,t))}function _s(r,t){return Math.floor(va(r,t))}function ri(r,t){return Math.ceil(va(r,t))}function Ti(r,t,e){const n=e!==void 0?r.toFixed(e):""+r;let i=n.indexOf(".");return i=i===-1?n.length:i,i>t?n:new Array(1+t-i).join("0")+n}function zu(r,t){const e=(""+r).split("."),n=(""+t).split(".");for(let i=0;io)return 1;if(o>s)return-1}return 0}function Gm(r,t){return r[0]+=+t[0],r[1]+=+t[1],r}function ef(r,t,e){const n=an(t+180,360)-180,i=Math.abs(3600*n),s=e||0;let o=Math.floor(i/3600),a=Math.floor((i-o*3600)/60),l=va(i-o*3600-a*60,s);l>=60&&(l=0,a+=1),a>=60&&(a=0,o+=1);let h=o+"°";return(a!==0||l!==0)&&(h+=" "+Ti(a,2)+"′"),l!==0&&(h+=" "+Ti(l,2,s)+"″"),n!==0&&(h+=" "+r.charAt(n<0?1:0)),h}function wl(r,t){let e=!0;for(let n=r.length-1;n>=0;--n)if(r[n]!=t[n]){e=!1;break}return e}function $x(r,t){const e=Math.cos(t),n=Math.sin(t),i=r[0]*e-r[1]*n,s=r[1]*e+r[0]*n;return r[0]=i,r[1]=s,r}function Vx(r,t){return r[0]*=t,r[1]*=t,r}function jm(r,t){if(t.canWrapX()){const e=mt(t.getExtent()),n=zm(r,t,e);n&&(r[0]-=n*e)}return r}function zm(r,t,e){const n=t.getExtent();let i=0;return t.canWrapX()&&(r[0]n[2])&&(e=e||mt(n),i=Math.floor((r[0]-n[0])/e)),i}const Yx=63710088e-1;function rf(r,t,e){e=e||Yx;const n=Ao(r[1]),i=Ao(t[1]),s=(i-n)/2,o=Ao(t[0]-r[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(i);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Hx(...r){console.warn(...r)}function Sl(...r){console.error(...r)}let Bc=!0;function Kx(r){Bc=!1}function Uu(r,t){if(t!==void 0){for(let e=0,n=r.length;e=a?t[s+l]:o[l]}return e}}function tv(r,t,e,n){const i=K(r),s=K(t);Ns(i,s,sf(e)),Ns(s,i,sf(n))}function of(r,t){const e=ch(r,t!==void 0?t:"EPSG:3857","EPSG:4326"),n=e[0];return(n<-180||n>180)&&(e[0]=an(n+180,360)-180),e}function Ie(r,t){if(r===t)return!0;const e=r.getUnits()===t.getUnits();return(r.getCode()===t.getCode()||qi(r,t)===Uu)&&e}function qi(r,t){const e=r.getCode(),n=t.getCode();let i=Dm(e,n);return i||(i=Um),i}function hn(r,t){const e=K(r),n=K(t);return qi(e,n)}function ch(r,t,e){return hn(t,e)(r,void 0,r.length)}function Xu(r,t,e,n){const i=hn(t,e);return Os(r,i,void 0,n)}let ev=null;function rv(){return ev}function Wc(r,t){return r}function $n(r,t){return Bc&&!wl(r,[0,0])&&r[0]>=-180&&r[0]<=180&&r[1]>=-90&&r[1]<=90&&(Bc=!1,Hx("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),r}function uh(r,t){return r}function kr(r,t){return r}function af(r,t,e){return function(n){let i,s;if(r.canWrapX()){const o=r.getExtent(),a=mt(o);n=n.slice(0),s=zm(n,r,a),s&&(n[0]=n[0]-s*a),n[0]=xt(n[0],o[0],o[2]),n[1]=xt(n[1],o[1],o[3]),i=e(n)}else i=e(n);return s&&t.canWrapX()&&(i[0]+=s*mt(t.getExtent())),i}}function nv(){Xc(Jg),Xc(tf),Qx(tf,Jg,zx,Ux)}nv();function li(r,t,e,n,i,s){s=s||[];let o=0;for(let a=t;a{if(!n)return this.getSimplifiedGeometry(e);const i=this.clone();return i.applyTransform(n),i.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return lt()}closestPointXY(t,e,n,i){return lt()}containsXY(t,e){const n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return lt()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&ma(e),this.extentRevision_=this.getRevision()}return Fx(this.extent_,t)}rotate(t,e){lt()}scale(t,e,n){lt()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return lt()}getType(){return lt()}applyTransform(t){lt()}intersectsExtent(t){return lt()}translate(t,e){lt()}transform(t,e){const n=K(t),i=n.getUnits()=="tile-pixels"?function(s,o,a){const l=n.getExtent(),h=n.getWorldExtent(),c=qt(h)/qt(l);return ar(lf,h[0],h[3],c,-c,0,0,0),li(s,0,s.length,a,lf,o),hn(n,e)(s,o,a)}:hn(n,e);return this.applyTransform(i),this}}class ov extends Wu{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return Du(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return lt()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().lengtht.clone())}const Ge=El;function hf(r,t,e,n,i,s,o){const a=r[t],l=r[t+1],h=r[e]-a,c=r[e+1]-l;let u;if(h===0&&c===0)u=t;else{const d=((i-a)*h+(s-l)*c)/(h*h+c*c);if(d>1)u=e;else if(d>0){for(let g=0;gi&&(i=h),s=a,o=l}return i}function qu(r,t,e,n,i){for(let s=0,o=e.length;s0;){const u=h.pop(),d=h.pop();let g=0;const f=r[d],p=r[d+1],_=r[u],y=r[u+1];for(let v=d+n;vg&&(c=v,g=E)}g>i&&(l[(c-t)/n]=1,d+n0&&p>g)&&(f<0&&_0&&_>f)){h=u,c=d;continue}s[o++]=h,s[o++]=c,a=h,l=c,h=u,c=d}return s[o++]=h,s[o++]=c,o}function Yu(r,t,e,n,i,s,o,a){for(let l=0,h=e.length;l1?o:2,s=s||new Array(o);for(let c=0;c>1;is&&(h-a)*(s-l)-(i-a)*(c-l)>0&&o++:c<=s&&(h-a)*(s-l)-(i-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function Hu(r,t,e,n,i,s){if(e.length===0||!Mi(r,t,e[0],n,i,s))return!1;for(let o=1,a=e.length;o=i[0]&&s[2]<=i[2]||s[1]>=i[1]&&s[3]<=i[3]?!0:Vm(r,t,e,n,function(o,a){return Nx(i,o,a)}):!1}function _v(r,t,e,n,i){for(let s=0,o=e.length;sy&&(h=(c+u)/2,Hu(r,t,e,n,h,f)&&(_=h,y=v)),c=u}return isNaN(_)&&(_=i[s]),o?(o.push(_,f,y),o):[_,f,y]}function Qm(r,t,e,n,i){let s=[];for(let o=0,a=e.length;o0}function Ju(r,t,e,n,i){i=i!==void 0?i:!1;for(let s=0,o=e.length;s{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const n=this.simplifiedGeometry_.getFlatCoordinates();let i;switch(this.type_){case"LineString":n.length=dh(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),i=[n.length];break;case"MultiLineString":i=[],n.length=Zm(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,i);break;case"Polygon":i=[],n.length=Yu(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,i);break}return i&&(this.simplifiedGeometry_=new ke(this.type_,n,i,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}ke.prototype.getFlatCoordinates=ke.prototype.getOrientedFlatCoordinates;class vv{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=we,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let n=e.dataProjection?K(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()==="tile-pixels"&&(n=K(n),n.setWorldExtent(e.extent)),e={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},t)}getType(){return lt()}readFeature(t,e){return lt()}readFeatures(t,e){return lt()}readGeometry(t,e){return lt()}readProjection(t){return lt()}writeFeature(t,e){return lt()}writeFeatures(t,e){return lt()}writeGeometry(t,e){return lt()}}const Ea=vv;function re(r,t,e){const n=e?K(e.featureProjection):null,i=e?K(e.dataProjection):null;let s=r;if(n&&i&&!Ie(n,i)){t&&(s=r.clone());const o=t?n:i,a=t?i:n;o.getUnits()==="tile-pixels"?s.transform(o,a):s.applyTransform(hn(o,a))}if(t&&e&&e.decimals!==void 0){const o=Math.pow(10,e.decimals),a=function(l){for(let h=0,c=l.length;hn0({...r,geometry:o})).flat();const i=n.type==="MultiPolygon"?"Polygon":n.type;if(i==="GeometryCollection"||i==="Circle")throw new Error("Unsupported geometry type: "+i);const s=n.layout.length;return re(new ke(i,i==="Polygon"?Sv(n.flatCoordinates,n.ends,s):n.flatCoordinates,(e=n.ends)==null?void 0:e.flat(),s,r.properties||{},r.id).enableSimplifyTransformed(),!1,t)}function td(r,t){if(!r)return null;if(Array.isArray(r)){const n=r.map(i=>td(i,t));return new Ge(n)}const e=wv[r.type];return re(new e(r.flatCoordinates,r.layout,r.ends),!1,t)}class ed extends Ea{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(qa(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(qa(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return lt()}readFeaturesFromObject(t,e){return lt()}readGeometry(t,e){return this.readGeometryFromObject(qa(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return lt()}readProjection(t){return this.readProjectionFromObject(qa(t))}readProjectionFromObject(t){return lt()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return lt()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return lt()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return lt()}}function qa(r){return typeof r=="string"?JSON.parse(r)||null:r!==null?r:null}const Ev={Point:Rv,LineString:Cv,Polygon:Lv,MultiPoint:Pv,MultiLineString:Iv,MultiPolygon:Av},bv={Point:Ov,LineString:Fv,Polygon:Nv,MultiPoint:kv,MultiLineString:Dv,MultiPolygon:Gv};class Tv extends ed{constructor(t){t=t||{},super(),this.geometryName_=t.geometryName}readFeatureFromObject(t,e,n){const i=t,s=df(i.geometry,e),o=new we;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(s),i.attributes){o.setProperties(i.attributes,!0);const a=i.attributes[n];a!==void 0&&o.setId(a)}return o}readFeaturesFromObject(t,e){if(e=e||{},t.features){const n=t,i=[],s=n.features;for(let o=0,a=s.length;o=0;s--){const h=n[s][0];if(Ze(new ui(h).getExtent(),new ui(a).getExtent())){n[s].push(a),l=!0;break}}l||n.push([a.reverse()])}return n}function Rv(r){let t;return r.m!==void 0&&r.z!==void 0?t=new Te([r.x,r.y,r.z,r.m],"XYZM"):r.z!==void 0?t=new Te([r.x,r.y,r.z],"XYZ"):r.m!==void 0?t=new Te([r.x,r.y,r.m],"XYM"):t=new Te([r.x,r.y]),t}function Cv(r){const t=Vs(r);return new pe(r.paths[0],t)}function Iv(r){const t=Vs(r);return new lr(r.paths,t)}function Vs(r){let t="XY";return r.hasZ===!0&&r.hasM===!0?t="XYZM":r.hasZ===!0?t="XYZ":r.hasM===!0&&(t="XYM"),t}function Pv(r){const t=Vs(r);return new Zr(r.points,t)}function Av(r){const t=Vs(r);return new Ir(r.rings,t)}function Lv(r){const t=Vs(r);return new ze(r.rings,t)}function Ov(r,t){const e=r.getCoordinates();let n;const i=r.getLayout();if(i==="XYZ")n={x:e[0],y:e[1],z:e[2]};else if(i==="XYM")n={x:e[0],y:e[1],m:e[2]};else if(i==="XYZM")n={x:e[0],y:e[1],z:e[2],m:e[3]};else if(i==="XY")n={x:e[0],y:e[1]};else throw new Error("Invalid geometry layout");return n}function ba(r){const t=r.getLayout();return{hasZ:t==="XYZ"||t==="XYZM",hasM:t==="XYM"||t==="XYZM"}}function Fv(r,t){const e=ba(r);return{hasZ:e.hasZ,hasM:e.hasM,paths:[r.getCoordinates()]}}function Nv(r,t){const e=ba(r);return{hasZ:e.hasZ,hasM:e.hasM,rings:r.getCoordinates(!1)}}function Dv(r,t){const e=ba(r);return{hasZ:e.hasZ,hasM:e.hasM,paths:r.getCoordinates()}}function kv(r,t){const e=ba(r);return{hasZ:e.hasZ,hasM:e.hasM,points:r.getCoordinates()}}function Gv(r,t){const e=ba(r),n=r.getCoordinates(!1),i=[];for(let s=0;s=0;o--)i.push(n[s][o]);return{hasZ:e.hasZ,hasM:e.hasM,rings:i}}function gf(r,t){const e=bv[r.getType()];return e(re(r,!0,t),t)}const jv=Tv;class zv extends ed{constructor(t){t=t||{},super(),this.dataProjection=K(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=K(t.featureProjection)),t.featureClass&&(this.featureClass=t.featureClass),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let n=null;t.type==="Feature"?n=t:n={type:"Feature",geometry:t,properties:null};const i=rd(n.geometry);if(this.featureClass===ke)return n0({geometry:i,id:n.id,properties:n.properties},e);const s=new we;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&s.setGeometryName(n.geometry_name),s.setGeometry(td(i,e)),"id"in n&&s.setId(n.id),n.properties&&s.setProperties(n.properties,!0),s}readFeaturesFromObject(t,e){const n=t;let i=null;if(n.type==="FeatureCollection"){const s=t;i=[];const o=s.features;for(let a=0,l=o.length;a0?n[0]:null}readFeatureFromNode(t,e){return null}readFeatures(t,e){if(!t)return[];if(typeof t=="string"){const n=Rr(t);return this.readFeaturesFromDocument(n,e)}return Mr(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}readFeaturesFromDocument(t,e){const n=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&Pt(n,this.readFeaturesFromNode(i,e));return n}readFeaturesFromNode(t,e){return lt()}readGeometry(t,e){if(!t)return null;if(typeof t=="string"){const n=Rr(t);return this.readGeometryFromDocument(n,e)}return Mr(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}readGeometryFromDocument(t,e){return null}readGeometryFromNode(t,e){return null}readProjection(t){if(!t)return null;if(typeof t=="string"){const e=Rr(t);return this.readProjectionFromDocument(e)}return Mr(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}readProjectionFromDocument(t){return this.dataProjection}readProjectionFromNode(t){return this.dataProjection}writeFeature(t,e){const n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)}writeFeatureNode(t,e){return null}writeFeatures(t,e){const n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)}writeFeaturesNode(t,e){return null}writeGeometry(t,e){const n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)}writeGeometryNode(t,e){return null}}const Pn="http://www.opengis.net/gml",iw=/^\s*$/;class et extends Ta{constructor(t){super(),t=t||{},this.featureType=t.featureType,this.featureNS=t.featureNS,this.srsName=t.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[this.namespace]={featureMember:rt(this.readFeaturesInternal),featureMembers:at(this.readFeaturesInternal)},this.supportedMediaTypes=["application/gml+xml"]}readFeaturesInternal(t,e){const n=t.localName;let i=null;if(n=="FeatureCollection")i=W([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if(n=="featureMembers"||n=="featureMember"||n=="member"){const s=e[0];let o=s.featureType,a=s.featureNS;const l="p",h="p0";if(!o&&t.childNodes){o=[],a={};for(let d=0,g=t.childNodes.length;d0&&!(h instanceof Wu)){h={_content_:h};for(let d=0;d1,n=e&&r.imageInfo.profile[1].supports?r.imageInfo.profile[1].supports:[],i=e&&r.imageInfo.profile[1].formats?r.imageInfo.profile[1].formats:[],s=e&&r.imageInfo.profile[1].qualities?r.imageInfo.profile[1].qualities:[];return{url:r.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:r.imageInfo.sizes===void 0?void 0:r.imageInfo.sizes.map(function(o){return[o.width,o.height]}),tileSize:r.imageInfo.tiles===void 0?void 0:[r.imageInfo.tiles.map(function(o){return o.width})[0],r.imageInfo.tiles.map(function(o){return o.height===void 0?o.width:o.height})[0]],resolutions:r.imageInfo.tiles===void 0?void 0:r.imageInfo.tiles.map(function(o){return o.scaleFactors})[0],supports:[...t.supports,...n],formats:[...t.formats,...i],qualities:[...t.qualities,...s]}}function lS(r){const t=r.getComplianceLevelSupportedFeatures(),e=r.imageInfo.extraFormats===void 0?t.formats:[...t.formats,...r.imageInfo.extraFormats],n=r.imageInfo.preferredFormats!==void 0&&Array.isArray(r.imageInfo.preferredFormats)&&r.imageInfo.preferredFormats.length>0?r.imageInfo.preferredFormats.filter(function(i){return["jpg","png","gif"].includes(i)}).reduce(function(i,s){return i===void 0&&e.includes(s)?s:i},void 0):void 0;return{url:r.imageInfo.id,sizes:r.imageInfo.sizes===void 0?void 0:r.imageInfo.sizes.map(function(i){return[i.width,i.height]}),tileSize:r.imageInfo.tiles===void 0?void 0:[r.imageInfo.tiles.map(function(i){return i.width})[0],r.imageInfo.tiles.map(function(i){return i.height})[0]],resolutions:r.imageInfo.tiles===void 0?void 0:r.imageInfo.tiles.map(function(i){return i.scaleFactors})[0],supports:r.imageInfo.extraFeatures===void 0?t.supports:[...t.supports,...r.imageInfo.extraFeatures],formats:e,qualities:r.imageInfo.extraQualities===void 0?t.qualities:[...t.qualities,...r.imageInfo.extraQualities],preferredFormat:n}}const _h={};_h[fe.VERSION1]=oS;_h[fe.VERSION2]=aS;_h[fe.VERSION3]=lS;class hS{constructor(t){this.setImageInfo(t)}setImageInfo(t){typeof t=="string"?this.imageInfo=JSON.parse(t):this.imageInfo=t}getImageApiVersion(){if(this.imageInfo===void 0)return;let t=this.imageInfo["@context"]||"ol-no-context";typeof t=="string"&&(t=[t]);for(let e=0;e0&&typeof this.imageInfo.profile[0]=="string"&&ff.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0];break}}getComplianceLevelFromProfile(t){const e=this.getComplianceLevelEntryFromProfile(t);if(e===void 0)return;const n=e.match(/level[0-2](?:\.json)?$/g);return Array.isArray(n)?n[0].replace(".json",""):void 0}getComplianceLevelSupportedFeatures(){if(this.imageInfo===void 0)return;const t=this.getImageApiVersion(),e=this.getComplianceLevelFromProfile(t);return e===void 0?Di.none.none:Di[t][e]}getTileSourceOptions(t){const e=t||{},n=this.getImageApiVersion();if(n===void 0)return;const i=n===void 0?void 0:_h[n](this);if(i!==void 0)return{url:i.url,version:n,size:[this.imageInfo.width,this.imageInfo.height],sizes:i.sizes,format:e.format!==void 0&&i.formats.includes(e.format)?e.format:i.preferredFormat!==void 0?i.preferredFormat:"jpg",supports:i.supports,quality:e.quality&&i.qualities.includes(e.quality)?e.quality:i.qualities.includes("native")?"native":"default",resolutions:Array.isArray(i.resolutions)?i.resolutions.sort(function(s,o){return o-s}):void 0,tileSize:i.tileSize}}}const cS=hS,J={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},Yo={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var Pe={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};Pe.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};Pe.max=Pe.whitepoint[2].D65;Pe.rgb=function(r,t){t=t||Pe.whitepoint[2].E;var e=r[0]/t[0],n=r[1]/t[1],i=r[2]/t[2],s,o,a;return s=e*3.240969941904521+n*-1.537383177570093+i*-.498610760293,o=e*-.96924363628087+n*1.87596750150772+i*.041555057407175,a=e*.055630079696993+n*-.20397695888897+i*1.056971514242878,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s=s*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[s*255,o*255,a*255]};Yo.xyz=function(r,t){var e=r[0]/255,n=r[1]/255,i=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var s=e*.41239079926595+n*.35758433938387+i*.18048078840183,o=e*.21263900587151+n*.71516867876775+i*.072192315360733,a=e*.019330818715591+n*.11919477979462+i*.95053215224966;return t=t||Pe.whitepoint[2].E,[s*t[0],o*t[1],a*t[2]]};const hd={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(r,t,e){var n,i,s,o,a,l,h,c,u,d,g,f,p;if(s=r[0],o=r[1],a=r[2],s===0)return[0,0,0];var _=.0011070564598794539;return t=t||"D65",e=e||2,u=Pe.whitepoint[e][t][0],d=Pe.whitepoint[e][t][1],g=Pe.whitepoint[e][t][2],f=4*u/(u+15*d+3*g),p=9*d/(u+15*d+3*g),n=o/(13*s)+f||0,i=a/(13*s)+p||0,h=s>8?d*Math.pow((s+16)/116,3):d*s*_,l=h*9*n/(4*i)||0,c=h*(12-3*n-20*i)/(4*i)||0,[l,h,c]}};Pe.luv=function(r,t,e){var n,i,s,o,a,l,h,c,u,d,g,f,p,_=.008856451679035631,y=903.2962962962961;t=t||"D65",e=e||2,u=Pe.whitepoint[e][t][0],d=Pe.whitepoint[e][t][1],g=Pe.whitepoint[e][t][2],f=4*u/(u+15*d+3*g),p=9*d/(u+15*d+3*g),l=r[0],h=r[1],c=r[2],n=4*l/(l+15*h+3*c)||0,i=9*h/(l+15*h+3*c)||0;var v=h/d;return s=v<=_?y*v:116*Math.pow(v,1/3)-16,o=13*s*(n-f),a=13*s*(i-p),[s,o,a]};var u0={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(r){var t=r[0],e=r[1],n=r[2],i,s,o;return o=n/360*2*Math.PI,i=e*Math.cos(o),s=e*Math.sin(o),[t,i,s]},xyz:function(r){return hd.xyz(u0.luv(r))}};hd.lchuv=function(r){var t=r[0],e=r[1],n=r[2],i=Math.sqrt(e*e+n*n),s=Math.atan2(n,e),o=s*360/2/Math.PI;return o<0&&(o+=360),[t,i,o]};Pe.lchuv=function(r){return hd.lchuv(Pe.luv(r))};var Li=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var uS={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]};const pf=Hs(uS);var mf={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function dS(r){var t,e,n,i=[],s=1,o;if(typeof r=="number")return{space:"rgb",values:[r>>>16,(r&65280)>>>8,r&255],alpha:1};if(typeof r=="number")return{space:"rgb",values:[r>>>16,(r&65280)>>>8,r&255],alpha:1};if(r=String(r).toLowerCase(),pf[r])i=pf[r].slice(),o="rgb";else if(r==="transparent")s=0,o="rgb",i=[0,0,0];else if(r[0]==="#"){var a=r.slice(1),l=a.length,h=l<=4;s=1,h?(i=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],l===4&&(s=parseInt(a[3]+a[3],16)/255)):(i=[parseInt(a[0]+a[1],16),parseInt(a[2]+a[3],16),parseInt(a[4]+a[5],16)],l===8&&(s=parseInt(a[6]+a[7],16)/255)),i[0]||(i[0]=0),i[1]||(i[1]=0),i[2]||(i[2]=0),o="rgb"}else if(n=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(r)){var c=n[1];o=c.replace(/a$/,"");var u=o==="cmyk"?4:o==="gray"?1:3;i=n[2].trim().split(/\s*[,\/]\s*|\s+/),o==="color"&&(o=i.shift()),i=i.map(function(d,g){if(d[d.length-1]==="%")return d=parseFloat(d)/100,g===3?d:o==="rgb"?d*255:o[0]==="h"||o[0]==="l"&&!g?d*100:o==="lab"?d*125:o==="lch"?g<2?d*150:d*360:o[0]==="o"&&!g?d:o==="oklab"?d*.4:o==="oklch"?g<2?d*.4:d*360:d;if(o[g]==="h"||g===2&&o[o.length-1]==="h"){if(mf[d]!==void 0)return mf[d];if(d.endsWith("deg"))return parseFloat(d);if(d.endsWith("turn"))return parseFloat(d)*360;if(d.endsWith("grad"))return parseFloat(d)*360/400;if(d.endsWith("rad"))return parseFloat(d)*180/Math.PI}return d==="none"?0:parseFloat(d)}),s=i.length>u?i.pop():1}else/[0-9](?:\s|\/|,)/.test(r)&&(i=r.match(/([0-9]+)/g).map(function(d){return parseFloat(d)}),o=((e=(t=r.match(/([a-z])/ig))==null?void 0:t.join(""))==null?void 0:e.toLowerCase())||"rgb");return{space:o,values:i,alpha:s}}const ic={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(r){var t=r[0]/360,e=r[1]/100,n=r[2]/100,i,s,o,a,l,h=0;if(e===0)return l=n*255,[l,l,l];for(s=n<.5?n*(1+e):n+e-n*e,i=2*n-s,a=[0,0,0];h<3;)o=t+1/3*-(h-1),o<0?o++:o>1&&o--,l=6*o<1?i+(s-i)*6*o:2*o<1?s:3*o<2?i+(s-i)*(2/3-o)*6:i,a[h++]=l*255;return a}};Yo.hsl=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255,i=Math.min(t,e,n),s=Math.max(t,e,n),o=s-i,a,l,h;return s===i?a=0:t===s?a=(e-n)/o:e===s?a=2+(n-t)/o:n===s&&(a=4+(t-e)/o),a=Math.min(a*60,360),a<0&&(a+=360),h=(i+s)/2,s===i?l=0:h<=.5?l=o/(s+i):l=o/(2-s-i),[a,l*100,h*100]};function gS(r){Array.isArray(r)&&r.raw&&(r=String.raw(...arguments)),r instanceof Number&&(r=+r);var t,e=dS(r);if(!e.space)return[];const n=e.space[0]==="h"?ic.min:Yo.min,i=e.space[0]==="h"?ic.max:Yo.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],n[0]),i[0]),t[1]=Math.min(Math.max(e.values[1],n[1]),i[1]),t[2]=Math.min(Math.max(e.values[2],n[2]),i[2]),e.space[0]==="h"&&(t=ic.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}function fS(r){return typeof r=="string"?r:ud(r)}const pS=1024,co={};let sc=0;function mS(r){if(r.length===4)return r;const t=r.slice();return t[3]=1,t}function _f(r){const t=Pe.lchuv(Yo.xyz(r));return t[3]=r[3],t}function _S(r){const t=Pe.rgb(u0.xyz(r));return t[3]=r[3],t}function cd(r){if(co.hasOwnProperty(r))return co[r];if(sc>=pS){let e=0;for(const n in co)e++&3||(delete co[n],--sc)}const t=gS(r);if(t.length!==4)throw new Error('Failed to parse "'+r+'" as color');for(const e of t)if(isNaN(e))throw new Error('Failed to parse "'+r+'" as color');return d0(t),co[r]=t,++sc,t}function Br(r){return Array.isArray(r)?r:cd(r)}function d0(r){return r[0]=xt(r[0]+.5|0,0,255),r[1]=xt(r[1]+.5|0,0,255),r[2]=xt(r[2]+.5|0,0,255),r[3]=xt(r[3],0,1),r}function ud(r){let t=r[0];t!=(t|0)&&(t=t+.5|0);let e=r[1];e!=(e|0)&&(e=e+.5|0);let n=r[2];n!=(n|0)&&(n=n+.5|0);const i=r[3]===void 0?1:Math.round(r[3]*1e3)/1e3;return"rgba("+t+","+e+","+n+","+i+")"}function yS(r){try{return cd(r),!0}catch{return!1}}const gi=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";gi.includes("firefox");const xS=gi.includes("safari")&&!gi.includes("chrom"),vS=xS&&(gi.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(gi));gi.includes("webkit")&&gi.includes("edge");gi.includes("macintosh");const g0=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,dd=typeof Image<"u"&&Image.prototype.decode,wS=typeof createImageBitmap=="function";(function(){let r=!1;try{const t=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return r})();function Ht(r,t,e,n){let i;return e&&e.length?i=e.shift():g0?i=new OffscreenCanvas(r||300,t||300):i=document.createElement("canvas"),r&&(i.width=r),t&&(i.height=t),i.getContext("2d",n)}let oc;function Hc(){return oc||(oc=Ht(1,1)),oc}function ki(r){const t=r.canvas;t.width=1,t.height=1,r.clearRect(0,0,1,1)}class yh extends fa{constructor(t,e,n,i){super(),this.extent=t,this.pixelRatio_=n,this.resolution=e,this.state=typeof i=="function"?J.IDLE:i,this.image_=null,this.loader=typeof i=="function"?i:null}changed(){this.dispatchEvent(Ct.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==J.IDLE&&this.loader){this.state=J.LOADING,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;Am(()=>this.loader(this.getExtent(),e,this.getPixelRatio())).then(n=>{"image"in n&&(this.image_=n.image),"extent"in n&&(this.extent=n.extent),"resolution"in n&&(this.resolution=n.resolution),"pixelRatio"in n&&(this.pixelRatio_=n.pixelRatio),(n instanceof HTMLImageElement||n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement)&&(this.image_=n),this.state=J.LOADED}).catch(n=>{this.state=J.ERROR,console.error(n)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function SS(r,t,e){const n=r;let i=!0,s=!1,o=!1;const a=[qo(n,Ct.LOAD,function(){o=!0,s||t()})];return n.src&&dd?(s=!0,n.decode().then(function(){i&&t()}).catch(function(l){i&&(o?t():e())})):a.push(qo(n,Ct.ERROR,e)),function(){i=!1,a.forEach(ye)}}function ES(r,t){return new Promise((e,n)=>{function i(){o(),e(r)}function s(){o(),n(new Error("Image load error"))}function o(){r.removeEventListener("load",i),r.removeEventListener("error",s)}r.addEventListener("load",i),r.addEventListener("error",s)})}function f0(r,t){return t&&(r.src=t),r.src&&dd?new Promise((e,n)=>r.decode().then(()=>e(r)).catch(i=>r.complete&&r.width?e(r):n(i))):ES(r)}function mi(r,t){return t&&(r.src=t),r.src&&dd&&wS?r.decode().then(()=>createImageBitmap(r)).catch(e=>{if(r.complete&&r.width)return r;throw e}):f0(r)}class bS{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const n=this.cache_[e];!(t++&3)&&!n.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,n){const i=ac(t,e,n);return i in this.cache_?this.cache_[i]:null}getPattern(t,e,n){const i=ac(t,e,n);return i in this.patternCache_?this.patternCache_[i]:null}set(t,e,n,i,s){const o=ac(t,e,n),a=o in this.cache_;this.cache_[o]=i,s&&(i.getImageState()===J.IDLE&&i.load(),i.getImageState()===J.LOADING?i.ready().then(()=>{this.patternCache_[o]=Hc().createPattern(i.getImage(1),"repeat")}):this.patternCache_[o]=Hc().createPattern(i.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function ac(r,t,e){const n=e?Br(e):"null";return t+":"+r+":"+n}const ni=new bS;let uo=null;class TS extends fa{constructor(t,e,n,i,s){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=s,this.imageState_=i===void 0?J.IDLE:i,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===J.LOADED){uo||(uo=Ht(1,1,void 0,{willReadFrequently:!0})),uo.drawImage(this.image_,0,0);try{uo.getImageData(0,0,1,1),this.tainted_=!1}catch{uo=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(Ct.CHANGE)}handleImageError_(){this.imageState_=J.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=J.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=Ht(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===J.IDLE){this.image_||this.initializeImage_(),this.imageState_=J.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&f0(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==J.LOADED)return;const e=this.image_,n=document.createElement("canvas");n.width=Math.ceil(e.width*t),n.height=Math.ceil(e.height*t);const i=n.getContext("2d");i.scale(t,t),i.drawImage(e,0,0),i.globalCompositeOperation="multiply",i.fillStyle=fS(this.color_),i.fillRect(0,0,n.width/t,n.height/t),i.globalCompositeOperation="destination-in",i.drawImage(e,0,0),this.canvas_[t]=n}ready(){return this.ready_||(this.ready_=new Promise(t=>{this.imageState_===J.LOADED||this.imageState_===J.ERROR?t():this.addEventListener(Ct.CHANGE,function e(){(this.imageState_===J.LOADED||this.imageState_===J.ERROR)&&(this.removeEventListener(Ct.CHANGE,e),t())})})),this.ready_}}function gd(r,t,e,n,i,s){let o=t===void 0?void 0:ni.get(t,e,i);return o||(o=new TS(r,r instanceof HTMLImageElement?r.src||void 0:t,e,n,i),ni.set(t,e,i,o,s)),s&&o&&!ni.getPattern(t,e,i)&&ni.set(t,e,i,o,s),o}class Xr{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,t.color!==void 0&&this.setColor(t.color)}clone(){const t=this.getColor();return new Xr({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(t!==null&&typeof t=="object"&&"src"in t){const e=gd(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),e.getImageState()===J.IDLE&&e.load(),e.getImageState()===J.LOADING&&(this.patternImage_=e)}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function p0(r,t,e){return e===void 0&&(e=[0,0]),e[0]=r[0]*t+.5|0,e[1]=r[1]*t+.5|0,e}function ee(r,t){return Array.isArray(r)?r:(t===void 0?t=[r,r]:(t[0]=r,t[1]=r),t)}class xh{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=ee(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new xh({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return lt()}getImage(t){return lt()}getHitDetectionImage(){return lt()}getPixelRatio(t){return 1}getImageState(){return lt()}getImageSize(){return lt()}getOrigin(){return lt()}getSize(){return lt()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=ee(t)}listenImageChange(t){lt()}load(){lt()}unlistenImageChange(t){lt()}ready(){return Promise.resolve()}}function yf(r,t,e,n){return e!==void 0&&n!==void 0?[e/r,n/t]:e!==void 0?e/r:n!==void 0?n/t:1}class fd extends xh{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,n=t.rotation!==void 0?t.rotation:0,i=t.scale!==void 0?t.scale:1,s=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:n,scale:i,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:s,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const o=t.img!==void 0?t.img:null;let a=t.src;Rt(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||tt(o)),Rt(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),Rt(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(t.src!==void 0?l=J.IDLE:o!==void 0&&(o instanceof HTMLImageElement?o.complete?l=o.src?J.LOADED:J.IDLE:l=J.LOADING:l=J.LOADED),this.color_=t.color!==void 0?Br(t.color):null,this.iconImage_=gd(o,a,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,t.width!==void 0||t.height!==void 0){let h,c;if(t.size)[h,c]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)h=u.width,c=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(yf(g[0],g[1],t.width,t.height))};this.listenImageChange(d);return}}h!==void 0&&this.setScale(yf(h,c,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new fd({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const i=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!i)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=i[0]),this.anchorYUnits_=="fraction"&&(t[1]*=i[1])}if(this.anchorOrigin_!="top-left"){if(!i)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+i[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+i[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==J.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==J.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(Ct.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(Ct.CHANGE,t)}ready(){return this.iconImage_.ready()}}const vh=fd;class pd{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new pd({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}const cn=pd;function rn(r){return r?Array.isArray(r)?ud(r):typeof r=="object"&&"src"in r?MS(r):r:null}function MS(r){if(!r.offset||!r.size)return ni.getPattern(r.src,"anonymous",r.color);const t=r.src+":"+r.offset,e=ni.getPattern(t,void 0,r.color);if(e)return e;const n=ni.get(r.src,"anonymous",null);if(n.getImageState()!==J.LOADED)return null;const i=Ht(r.size[0],r.size[1]);return i.drawImage(n.getImage(1),r.offset[0],r.offset[1],r.size[0],r.size[1],0,0,r.size[0],r.size[1]),gd(i.canvas,t,void 0,J.LOADED,r.color,!0),ni.getPattern(t,void 0,r.color)}const RS=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),xf=["style","variant","weight","size","lineHeight","family"],m0=function(r){const t=r.match(RS);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let n=0,i=xf.length;nMath.max(i,Il(r,s)),0);return e[t]=n,n}function PS(r,t){const e=[],n=[],i=[];let s=0,o=0,a=0,l=0;for(let h=0,c=t.length;h<=c;h+=2){const u=t[h];if(u===` -`||h===c){s=Math.max(s,o),i.push(o),o=0,a+=l;continue}const d=t[h+1]||r.font,g=Il(d,u);e.push(g),o+=g;const f=IS(d);n.push(f),l=Math.max(l,f)}return{width:s,height:a,widths:e,heights:n,lineWidths:i}}function AS(r,t,e,n,i,s,o,a,l,h,c){r.save(),e!==1&&(r.globalAlpha===void 0?r.globalAlpha=u=>u.globalAlpha*=e:r.globalAlpha*=e),t&&r.transform.apply(r,t),n.contextInstructions?(r.translate(l,h),r.scale(c[0],c[1]),LS(n,r)):c[0]<0||c[1]<0?(r.translate(l,h),r.scale(c[0],c[1]),r.drawImage(n,i,s,o,a,0,0,o,a)):r.drawImage(n,i,s,o,a,l,h,o*c[0],a*c[1]),r.restore()}function LS(r,t){const e=r.contextInstructions;for(let n=0,i=e.length;nthis.imageState_=J.LOADED),this.render()}clone(){const t=this.getScale(),e=new wh({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const n=this.renderOptions_,i=Ht(n.size*t,n.size*t);this.draw_(n,i,t),e=i.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let i=this.radius_,s=this.radius2_===void 0?i:this.radius2_;if(i1?o.Document=t:t.length==1&&(o.Placemark=t[0]);const a=US[n.namespaceURI],l=hr(o,a);return gt(s,BS,Re,l,[e],a,this),n}}function qS(r,t){const e=[0,0];let n="start";const i=r.getImage();if(i){const o=i.getSize();if(o&&o.length==2){const a=i.getScaleArray(),l=i.getAnchor();e[0]=a[0]*(o[0]-l[0]),e[1]=a[1]*(o[1]/2-l[1]),n="left"}}let s=r.getText();return s?(s=s.clone(),s.setFont(s.getFont()||Ci.getFont()),s.setScale(s.getScale()||Ci.getScale()),s.setFill(s.getFill()||Ci.getFill()),s.setStroke(s.getStroke()||ru)):s=Ci.clone(),s.setText(t),s.setOffsetX(e[0]),s.setOffsetY(e[1]),s.setTextAlign(n),new $e({image:i,text:s})}function $S(r,t,e,n,i){return function(s,o){let a=i,l="",h=[];if(a){const u=s.getGeometry();if(u)if(u instanceof Ge)h=u.getGeometriesArrayRecursive().filter(function(d){const g=d.getType();return g==="Point"||g==="MultiPoint"}),a=h.length>0;else{const d=u.getType();a=d==="Point"||d==="MultiPoint"}}a&&(l=s.get("name"),a=a&&!!l,a&&/&[^&]+;/.test(l)&&(Va||(Va=document.createElement("textarea")),Va.innerHTML=l,l=Va.value));let c=e;if(r?c=r:t&&(c=v0(t,e,n)),a){const u=qS(c[0],l);if(h.length>0){u.setGeometry(new Ge(h));const d=new $e({geometry:c[0].getGeometry(),image:null,fill:c[0].getFill(),stroke:c[0].getStroke(),text:null});return[u,d].concat(c.slice(1))}return u}return c}}function v0(r,t,e){return Array.isArray(r)?r:typeof r=="string"?v0(e[r],t,e):t}function bh(r){const t=Ve(r,!1),e=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(t);if(e){const n=e[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function w0(r){let t=Ve(r,!1);const e=[];t=t.replace(/\s*,\s*/g,",");const n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;let i;for(;i=n.exec(t);){const s=parseFloat(i[1]),o=parseFloat(i[2]),a=i[3]?parseFloat(i[3]):0;e.push(s,o,a),t=t.substr(i[0].length)}if(t==="")return e}function S0(r){const t=Ve(r,!1).trim();let e=r.baseURI;return(!e||e=="about:blank")&&(e=window.location.href),e?new URL(t,e).href:t}function E0(r){const t=Ve(r,!1).trim().replace(/^(?!.*#)/,"#");let e=r.baseURI;return(!e||e=="about:blank")&&(e=window.location.href),e?new URL(t,e).href:t}function VS(r){const t=r.getAttribute("xunits"),e=r.getAttribute("yunits");let n;return t!=="insetPixels"?e!=="insetPixels"?n="bottom-left":n="top-left":e!=="insetPixels"?n="bottom-right":n="top-right",{x:parseFloat(r.getAttribute("x")),xunits:Sf[t],y:parseFloat(r.getAttribute("y")),yunits:Sf[e],origin:n}}function b0(r){return Mt(r)}const YS=X(st,{Pair:xE});function T0(r,t){return W(void 0,YS,r,t,this)}const HS=X(st,{Icon:I(cE),color:I(bh),heading:I(Mt),hotSpot:I(VS),scale:I(b0)});function KS(r,t){const e=W({},HS,r,t);if(!e)return;const n=t[t.length-1],i="Icon"in e?e.Icon:{},s=!("Icon"in e)||Object.keys(i).length>0;let o;const a=i.href;a?o=a:s&&(o=Pl);let l,h,c,u="bottom-left";const d=e.hotSpot;d?(l=[d.x,d.y],h=d.xunits,c=d.yunits,u=d.origin):/^https?:\/\/maps\.(?:google|gstatic)\.com\//.test(o)&&(o.includes("pushpin")?(l=Qc,h=Lo,c=Oo):o.includes("arrow-reverse")?(l=[54,42],h=Lo,c=Oo):o.includes("paddle")&&(l=[32,1],h=Lo,c=Oo));let g;const f=i.x,p=i.y;f!==void 0&&p!==void 0&&(g=[f,p]);let _;const y=i.w,v=i.h;y!==void 0&&v!==void 0&&(_=[y,v]);let w;const S=e.heading;S!==void 0&&(w=Ao(S));const E=e.scale,T=e.color;if(s){o==Pl&&(_=Fo);const M=new vh({anchor:l,anchorOrigin:u,anchorXUnits:h,anchorYUnits:c,crossOrigin:this.crossOrigin_,offset:g,offsetOrigin:"bottom-left",rotation:w,scale:E,size:_,src:this.iconUrlFunction_(o),color:T}),C=M.getScaleArray()[0],P=M.getSize();if(P===null){const G=M.getImageState();if(G===J.IDLE||G===J.LOADING){const D=function(){const z=M.getImageState();if(!(z===J.IDLE||z===J.LOADING)){const m=M.getSize();if(m&&m.length==2){const x=Al(m);M.setScale(C*x)}M.unlistenImageChange(D)}};M.listenImageChange(D),G===J.IDLE&&M.load()}}else if(P.length==2){const G=Al(P);M.setScale(C*G)}n.imageStyle=M}else n.imageStyle=md}const JS=X(st,{color:I(bh),scale:I(b0)});function QS(r,t){const e=W({},JS,r,t);if(!e)return;const n=t[t.length-1],i=new Gi({fill:new Xr({color:"color"in e?e.color:Ms}),scale:e.scale});n.textStyle=i}const tE=X(st,{color:I(bh),width:I(Mt)});function eE(r,t){const e=W({},tE,r,t);if(!e)return;const n=t[t.length-1],i=new cn({color:"color"in e?e.color:Ms,width:"width"in e?e.width:1});n.strokeStyle=i}const rE=X(st,{color:I(bh),fill:I(di),outline:I(di)});function nE(r,t){const e=W({},rE,r,t);if(!e)return;const n=t[t.length-1],i=new Xr({color:"color"in e?e.color:Ms});n.fillStyle=i;const s=e.fill;s!==void 0&&(n.fill=s);const o=e.outline;o!==void 0&&(n.outline=o)}const iE=X(st,{coordinates:at(w0)});function M0(r,t){return W(null,iE,r,t)}function sE(r,t){const e=t[t.length-1].coordinates,n=Ve(r,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){const s=parseFloat(i[1]),o=parseFloat(i[2]),a=parseFloat(i[3]);e.push([s,o,a])}else e.push([])}const oE=X(Bn,{Track:rt(R0)});function aE(r,t){const e=W([],oE,r,t);if(e)return new lr(e)}const lE=X(st,{when:OE},X(Bn,{coord:sE}));function R0(r,t){const e=W({coordinates:[],whens:[]},lE,r,t);if(!e)return;const n=[],i=e.coordinates,s=e.whens;for(let o=0,a=Math.min(i.length,s.length);o0&&t[t.length-1].push(...e)}const PE=X(st,{LinearRing:at(M0)});function AE(r,t){const e=W(void 0,PE,r,t);if(e){const n=t[t.length-1];n[0]=e}}function LE(r,t){or(jS,r,t)}function OE(r,t){const e=t[t.length-1].whens,n=Ve(r,!1),i=Date.parse(n);e.push(isNaN(i)?0:i)}function Mh(r,t){const e=Br(t),n=[(e.length==4?e[3]:1)*255,e[2],e[1],e[0]];for(let i=0;i<4;++i){const s=Math.floor(n[i]).toString(16);n[i]=s.length==1?"0"+s:s}dt(r,n.join(""))}function FE(r,t,e){const n=e[e.length-1],i=n.layout,s=n.stride;let o;if(i=="XY"||i=="XYM")o=2;else if(i=="XYZ"||i=="XYZM")o=3;else throw new Error("Invalid geometry layout");const a=t.length;let l="";if(a>0){l+=t[0];for(let h=1;h0){const g=hr(i,o);gt(n,cc,l2,[{names:o,values:g}],e)}const u=e[0];let d=t.getGeometry();d&&(d=re(d,!0,u)),gt(n,cc,N0,[d],e)}const h2=X(st,["extrude","tessellate","altitudeMode","coordinates"]),c2=X(st,{extrude:A(Ds),tessellate:A(Ds),altitudeMode:A(dt),coordinates:A(FE)});function Rs(r,t,e){const n=t.getFlatCoordinates(),i={node:r};i.layout=t.getLayout(),i.stride=t.getStride();const s=t.getProperties();s.coordinates=n;const o=e[e.length-1].node,a=h2[o.namespaceURI],l=hr(s,a);gt(i,c2,Re,l,e,a)}const u2=X(st,["color","fill","outline"]),Rf=X(st,{outerBoundaryIs:A(Mf),innerBoundaryIs:A(Mf)}),d2=ae("innerBoundaryIs"),g2=ae("outerBoundaryIs");function G0(r,t,e){const n=t.getLinearRings(),i=n.shift(),s={node:r};gt(s,Rf,d2,n,e),gt(s,Rf,g2,[i],e)}const f2=X(st,{color:A(Mh),fill:A(Ds),outline:A(Ds)});function p2(r,t,e){const n={node:r},i=t.getFill(),s=t.getStroke(),o={color:i?i.getColor():void 0,fill:i?void 0:!1,outline:s?void 0:!1},a=e[e.length-1].node,l=u2[a.namespaceURI],h=hr(o,l);gt(n,f2,Re,h,e,l)}function j0(r,t){tr(r,Math.round(t*1e6)/1e6)}const m2=X(st,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),_2=X(st,{IconStyle:A($E),LabelStyle:A(HE),LineStyle:A(QE),PolyStyle:A(p2)});function y2(r,t,e){const n={node:r},i={};if(t.pointStyles.length){const l=t.pointStyles[0].getText();l&&(i.LabelStyle=l);const h=t.pointStyles[0].getImage();h&&typeof h.getSrc=="function"&&(i.IconStyle=h)}if(t.lineStyles.length){const l=t.lineStyles[0].getStroke();l&&(i.LineStyle=l)}if(t.polyStyles.length){const l=t.polyStyles[0].getStroke();l&&!i.LineStyle&&(i.LineStyle=l),i.PolyStyle=t.polyStyles[0]}const s=e[e.length-1].node,o=m2[s.namespaceURI],a=hr(i,o);gt(n,_2,Re,a,e,o)}function x2(r,t){r.setAttribute("x",String(t.x)),r.setAttribute("y",String(t.y)),r.setAttribute("xunits",t.xunits),r.setAttribute("yunits",t.yunits)}const v2=ZS;var xd={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */xd.read=function(r,t,e,n,i){var s,o,a=i*8-n-1,l=(1<>1,c=-7,u=e?i-1:0,d=e?-1:1,g=r[t+u];for(u+=d,s=g&(1<<-c)-1,g>>=-c,c+=a;c>0;s=s*256+r[t+u],u+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=o*256+r[t+u],u+=d,c-=8);if(s===0)s=1-h;else{if(s===l)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-h}return(g?-1:1)*o*Math.pow(2,s-n)};xd.write=function(r,t,e,n,i,s){var o,a,l,h=s*8-i-1,c=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,f=n?1:-1,p=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+u>=1?t+=d/l:t+=d*Math.pow(2,1-u),t*l>=2&&(o++,l/=2),o+u>=c?(a=0,o=c):o+u>=1?(a=(t*l-1)*Math.pow(2,i),o=o+u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[e+g]=a&255,g+=f,a/=256,i-=8);for(o=o<0;r[e+g]=o&255,g+=f,o/=256,h-=8);r[e+g-f]|=p*128};var w2=kt,Ya=xd;function kt(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}kt.Varint=0;kt.Fixed64=1;kt.Bytes=2;kt.Fixed32=5;var iu=65536*65536,Cf=1/iu,S2=12,z0=typeof TextDecoder>"u"?null:new TextDecoder("utf8");kt.prototype={destroy:function(){this.buf=null},readFields:function(r,t,e){for(e=e||this.length;this.pos>3,s=this.pos;this.type=n&7,r(i,t,this),this.pos===s&&this.skip(n)}return t},readMessage:function(r,t){return this.readFields(r,t,this.readVarint()+this.pos)},readFixed32:function(){var r=Ha(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=Pf(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=Ha(this.buf,this.pos)+Ha(this.buf,this.pos+4)*iu;return this.pos+=8,r},readSFixed64:function(){var r=Ha(this.buf,this.pos)+Pf(this.buf,this.pos+4)*iu;return this.pos+=8,r},readFloat:function(){var r=Ya.read(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=Ya.read(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var t=this.buf,e,n;return n=t[this.pos++],e=n&127,n<128||(n=t[this.pos++],e|=(n&127)<<7,n<128)||(n=t[this.pos++],e|=(n&127)<<14,n<128)||(n=t[this.pos++],e|=(n&127)<<21,n<128)?e:(n=t[this.pos],e|=(n&15)<<28,E2(e,r,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2===1?(r+1)/-2:r/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var r=this.readVarint()+this.pos,t=this.pos;return this.pos=r,r-t>=S2&&z0?G2(this.buf,t,r):k2(this.buf,t,r)},readBytes:function(){var r=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,r);return this.pos=r,t},readPackedVarint:function(r,t){if(this.type!==kt.Bytes)return r.push(this.readVarint(t));var e=xn(this);for(r=r||[];this.pos127;);else if(t===kt.Bytes)this.pos=this.readVarint()+this.pos;else if(t===kt.Fixed32)this.pos+=4;else if(t===kt.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(r,t){this.writeVarint(r<<3|t)},realloc:function(r){for(var t=this.length||16;t268435455||r<0){T2(r,this);return}this.realloc(4),this.buf[this.pos++]=r&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=(r>>>=7)&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=(r>>>=7)&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=r>>>7&127)))},writeSVarint:function(r){this.writeVarint(r<0?-r*2-1:r*2)},writeBoolean:function(r){this.writeVarint(!!r)},writeString:function(r){r=String(r),this.realloc(r.length*4),this.pos++;var t=this.pos;this.pos=j2(this.buf,r,this.pos);var e=this.pos-t;e>=128&&If(t,e,this),this.pos=t-1,this.writeVarint(e),this.pos+=e},writeFloat:function(r){this.realloc(4),Ya.write(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),Ya.write(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var t=r.length;this.writeVarint(t),this.realloc(t);for(var e=0;e=128&&If(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeMessage:function(r,t,e){this.writeTag(r,kt.Bytes),this.writeRawMessage(t,e)},writePackedVarint:function(r,t){t.length&&this.writeMessage(r,C2,t)},writePackedSVarint:function(r,t){t.length&&this.writeMessage(r,I2,t)},writePackedBoolean:function(r,t){t.length&&this.writeMessage(r,L2,t)},writePackedFloat:function(r,t){t.length&&this.writeMessage(r,P2,t)},writePackedDouble:function(r,t){t.length&&this.writeMessage(r,A2,t)},writePackedFixed32:function(r,t){t.length&&this.writeMessage(r,O2,t)},writePackedSFixed32:function(r,t){t.length&&this.writeMessage(r,F2,t)},writePackedFixed64:function(r,t){t.length&&this.writeMessage(r,N2,t)},writePackedSFixed64:function(r,t){t.length&&this.writeMessage(r,D2,t)},writeBytesField:function(r,t){this.writeTag(r,kt.Bytes),this.writeBytes(t)},writeFixed32Field:function(r,t){this.writeTag(r,kt.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(r,t){this.writeTag(r,kt.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(r,t){this.writeTag(r,kt.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(r,t){this.writeTag(r,kt.Fixed64),this.writeSFixed64(t)},writeVarintField:function(r,t){this.writeTag(r,kt.Varint),this.writeVarint(t)},writeSVarintField:function(r,t){this.writeTag(r,kt.Varint),this.writeSVarint(t)},writeStringField:function(r,t){this.writeTag(r,kt.Bytes),this.writeString(t)},writeFloatField:function(r,t){this.writeTag(r,kt.Fixed32),this.writeFloat(t)},writeDoubleField:function(r,t){this.writeTag(r,kt.Fixed64),this.writeDouble(t)},writeBooleanField:function(r,t){this.writeVarintField(r,!!t)}};function E2(r,t,e){var n=e.buf,i,s;if(s=n[e.pos++],i=(s&112)>>4,s<128||(s=n[e.pos++],i|=(s&127)<<3,s<128)||(s=n[e.pos++],i|=(s&127)<<10,s<128)||(s=n[e.pos++],i|=(s&127)<<17,s<128)||(s=n[e.pos++],i|=(s&127)<<24,s<128)||(s=n[e.pos++],i|=(s&1)<<31,s<128))return b2(r,i,t);throw new Error("Expected varint not more than 10 bytes")}function xn(r){return r.type===kt.Bytes?r.readVarint()+r.pos:r.pos+1}function b2(r,t,e){return e?t*4294967296+(r>>>0):(t>>>0)*4294967296+(r>>>0)}function T2(r,t){var e,n;if(r>=0?(e=r%4294967296|0,n=r/4294967296|0):(e=~(-r%4294967296),n=~(-r/4294967296),e^4294967295?e=e+1|0:(e=0,n=n+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),M2(e,n,t),R2(n,t)}function M2(r,t,e){e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos]=r&127}function R2(r,t){var e=(r&7)<<4;t.buf[t.pos++]|=e|((r>>>=3)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127)))))}function If(r,t,e){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));e.realloc(n);for(var i=e.pos-1;i>=r;i--)e.buf[i+n]=e.buf[i]}function C2(r,t){for(var e=0;e>>8,r[e+2]=t>>>16,r[e+3]=t>>>24}function Pf(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+(r[t+3]<<24)}function k2(r,t,e){for(var n="",i=t;i239?4:s>223?3:s>191?2:1;if(i+a>e)break;var l,h,c;a===1?s<128&&(o=s):a===2?(l=r[i+1],(l&192)===128&&(o=(s&31)<<6|l&63,o<=127&&(o=null))):a===3?(l=r[i+1],h=r[i+2],(l&192)===128&&(h&192)===128&&(o=(s&15)<<12|(l&63)<<6|h&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):a===4&&(l=r[i+1],h=r[i+2],c=r[i+3],(l&192)===128&&(h&192)===128&&(c&192)===128&&(o=(s&15)<<18|(l&63)<<12|(h&63)<<6|c&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,a=1):o>65535&&(o-=65536,n+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),n+=String.fromCharCode(o),i+=a}return n}function G2(r,t,e){return z0.decode(r.subarray(t,e))}function j2(r,t,e){for(var n=0,i,s;n55295&&i<57344)if(s)if(i<56320){r[e++]=239,r[e++]=191,r[e++]=189,s=i;continue}else i=s-55296<<10|i-56320|65536,s=null;else{i>56319||n+1===t.length?(r[e++]=239,r[e++]=191,r[e++]=189):s=i;continue}else s&&(r[e++]=239,r[e++]=191,r[e++]=189,s=null);i<128?r[e++]=i:(i<2048?r[e++]=i>>6|192:(i<65536?r[e++]=i>>12|224:(r[e++]=i>>18|240,r[e++]=i>>12&63|128),r[e++]=i>>6&63|128),r[e++]=i&63|128)}return e}const z2=Hs(w2);class U2 extends Ea{constructor(t){super(),t=t||{},this.dataProjection=new Fs({code:"",units:"tile-pixels"}),this.featureClass_=t.featureClass?t.featureClass:ke,this.geometryName_=t.geometryName,this.layerName_=t.layerName?t.layerName:"layer",this.layers_=t.layers?t.layers:null,this.idProperty_=t.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(t,e,n,i){t.pos=e.geometry;const s=t.readVarint()+t.pos;let o=1,a=0,l=0,h=0,c=0,u=0;for(;t.pos>3}if(a--,o===1||o===2)l+=t.readSVarint(),h+=t.readSVarint(),o===1&&c>u&&(i.push(c),u=c),n.push(l,h),c+=2;else if(o===7)c>u&&(n.push(n[u],n[u+1]),c+=2);else throw new Error("Invalid command found in the PBF")}c>u&&(i.push(c),u=c)}createFeature_(t,e,n){const i=e.type;if(i===0)return null;let s;const o=e.properties;let a;this.idProperty_?(a=o[this.idProperty_],delete o[this.idProperty_]):a=e.id,o[this.layerName_]=e.layer.name;const l=[],h=[];this.readRawGeometry_(t,e,l,h);const c=q2(i,h.length);if(this.featureClass_===ke)s=new this.featureClass_(c,l,h,2,o,a),s.transform(n.dataProjection);else{let u;if(c=="Polygon"){const f=e0(l,h);u=f.length>1?new Ir(l,"XY",f):new ze(l,"XY",h)}else u=c==="Point"?new Te(l,"XY"):c==="LineString"?new pe(l,"XY"):c==="MultiPoint"?new Zr(l,"XY"):c==="MultiLineString"?new lr(l,"XY",h):null;const d=this.featureClass_;s=new d,this.geometryName_&&s.setGeometryName(this.geometryName_);const g=re(u,!1,n);s.setGeometry(g),a!==void 0&&s.setId(a),s.setProperties(o,!0)}return s}getType(){return"arraybuffer"}readFeatures(t,e){const n=this.layers_;e=this.adaptOptions(e);const i=K(e.dataProjection);i.setWorldExtent(e.extent),e.dataProjection=i;const s=new z2(t),o=s.readFields(B2,{}),a=[];for(const l in o){if(n&&!n.includes(l))continue;const h=o[l],c=h?[0,0,h.extent,h.extent]:null;i.setExtent(c);for(let u=0,d=h.length;u>3,n=r===1?e.readString():r===2?e.readFloat():r===3?e.readDouble():r===4?e.readVarint64():r===5?e.readVarint():r===6?e.readSVarint():r===7?e.readBoolean():null;t.values.push(n)}}function W2(r,t,e){if(r==1)t.id=e.readVarint();else if(r==2){const n=e.readVarint()+e.pos;for(;e.pos>1):i>>1}return t}function Pb(r){let t="";for(let e=0,n=r.length;e=32;)t=(32|r&31)+63,e+=String.fromCharCode(t),r>>=5;return t=r+63,e+=String.fromCharCode(t),e}const Ob=Eb;class Fb extends ed{constructor(t){super(),t=t||{},this.layerName_=t.layerName,this.layers_=t.layers?t.layers:null,this.dataProjection=K(t.dataProjection?t.dataProjection:"EPSG:4326")}readFeaturesFromObject(t,e){if(t.type=="Topology"){const n=t;let i,s=null,o=null;n.transform&&(i=n.transform,s=i.scale,o=i.translate);const a=n.arcs;i&&Xb(a,s,o);const l=[],h=n.objects,c=this.layerName_;let u;for(const d in h)this.layers_&&!this.layers_.includes(d)||(h[d].type==="GeometryCollection"?(u=h[d],l.push.apply(l,Bb(u,a,s,o,c,d,e))):(u=h[d],l.push(X0(u,a,s,o,c,d,e))));return l}return[]}readProjectionFromObject(t){return this.dataProjection}}const Nb={Point:Db,LineString:Gb,Polygon:zb,MultiPoint:kb,MultiLineString:jb,MultiPolygon:Ub};function Rh(r,t){const e=[];let n;for(let i=0,s=r.length;i0&&e.pop(),n>=0){const o=t[n];for(let a=0,l=o.length;a=0;--a)e.push(o[a].slice(0))}return e}function Db(r,t,e){const n=r.coordinates;return t&&e&&wd(n,t,e),new Te(n)}function kb(r,t,e){const n=r.coordinates;if(t&&e)for(let i=0,s=n.length;i=2,"At least 2 conditions are required")}}class $b extends qb{constructor(t){super("And",Array.prototype.slice.call(arguments))}}const Vb=$b;class Yb extends W0{constructor(t,e,n){if(super("BBOX"),this.geometryName=t,this.extent=e,e.length!==4)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");this.srsName=n}}function Hb(r){const t=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Vb,t))}function Kb(r,t,e){return new Yb(r,t,e)}const Lf={"http://www.opengis.net/gml":{boundedBy:I(et.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:rt(et.prototype.readFeaturesInternal)}},Jb={"http://www.opengis.net/wfs":{totalInserted:I(he),totalUpdated:I(he),totalDeleted:I(he)},"http://www.opengis.net/wfs/2.0":{totalInserted:I(he),totalUpdated:I(he),totalDeleted:I(he)}},Qb={"http://www.opengis.net/wfs":{TransactionSummary:I(Ff,"transactionSummary"),InsertResults:I(Df,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:I(Ff,"transactionSummary"),InsertResults:I(Df,"insertIds")}},tT={"http://www.opengis.net/wfs":{PropertyName:A(dt)},"http://www.opengis.net/wfs/2.0":{PropertyName:A(dt)}},Z0={"http://www.opengis.net/wfs":{Insert:A(kf),Update:A(jf),Delete:A(Gf),Property:A(zf),Native:A(Uf)},"http://www.opengis.net/wfs/2.0":{Insert:A(kf),Update:A(jf),Delete:A(Gf),Property:A(zf),Native:A(Uf)}},q0="feature",Ed="http://www.w3.org/2000/xmlns/",bd={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},su={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},Td={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},Of={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},Md={"2.0.0":Sd,"1.1.0":Et,"1.0.0":Tt},eT="1.1.0";class rT extends Ta{constructor(t){super(),t=t||{},this.version_=t.version?t.version:eT,this.featureType_=t.featureType,this.featureNS_=t.featureNS,this.gmlFormat_=t.gmlFormat?t.gmlFormat:new Md[this.version_],this.schemaLocation_=t.schemaLocation?t.schemaLocation:Of[this.version_]}getFeatureType(){return this.featureType_}setFeatureType(t){this.featureType_=t}readFeaturesFromNode(t,e){const n={node:t};Object.assign(n,{featureType:this.featureType_,featureNS:this.featureNS_}),Object.assign(n,this.getReadOptions(t,e||{}));const i=[n];let s;this.version_==="2.0.0"?s=Lf:s=this.gmlFormat_.FEATURE_COLLECTION_PARSERS;let o=W([],s,t,i,this.gmlFormat_);return o||(o=[]),o}readTransactionResponse(t){if(t){if(typeof t=="string"){const e=Rr(t);return this.readTransactionResponseFromDocument(e)}return Mr(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}}readFeatureCollectionMetadata(t){if(t){if(typeof t=="string"){const e=Rr(t);return this.readFeatureCollectionMetadataFromDocument(e)}return Mr(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}}readFeatureCollectionMetadataFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)}readFeatureCollectionMetadataFromNode(t){const e={},n=Cn(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=n,W(e,Lf,t,[],this.gmlFormat_)}readTransactionResponseFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)}readTransactionResponseFromNode(t){return W({},Qb,t,[])}writeGetFeature(t){const e=ft(su[this.version_],"GetFeature");e.setAttribute("service","WFS"),e.setAttribute("version",this.version_),t.handle&&e.setAttribute("handle",t.handle),t.outputFormat&&e.setAttribute("outputFormat",t.outputFormat),t.maxFeatures!==void 0&&e.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&e.setAttribute("resultType",t.resultType),t.startIndex!==void 0&&e.setAttribute("startIndex",String(t.startIndex)),t.count!==void 0&&e.setAttribute("count",String(t.count)),t.viewParams!==void 0&&e.setAttribute("viewParams",t.viewParams),e.setAttributeNS(Ni,"xsi:schemaLocation",this.schemaLocation_);const n={node:e};if(Object.assign(n,{version:this.version_,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),Rt(Array.isArray(t.featureTypes),"`options.featureTypes` must be an Array"),typeof t.featureTypes[0]=="string"){let i=t.filter;t.bbox&&(Rt(t.geometryName,"`options.geometryName` must also be provided when `options.bbox` is set"),i=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,i)),Object.assign(n,{geometryName:t.geometryName,filter:i}),Kf(e,t.featureTypes,[n])}else t.featureTypes.forEach(i=>{const s=this.combineBboxAndFilter(i.geometryName,i.bbox,t.srsName,t.filter);Object.assign(n,{geometryName:i.geometryName,filter:s}),Kf(e,[i.name],[n])});return e}combineBboxAndFilter(t,e,n,i){const s=Kb(t,e,n);return i?Hb(i,s):s}writeTransaction(t,e,n,i){const s=[],o=i.version?i.version:this.version_,a=ft(su[o],"Transaction");a.setAttribute("service","WFS"),a.setAttribute("version",o);let l;i&&(l=i.gmlOptions?i.gmlOptions:{},i.handle&&a.setAttribute("handle",i.handle)),a.setAttributeNS(Ni,"xsi:schemaLocation",Of[o]);const h=nT(a,l,o,i);return t&&Ka("Insert",t,s,h),e&&Ka("Update",e,s,h),n&&Ka("Delete",n,s,h),i.nativeElements&&Ka("Native",i.nativeElements,s,h),a}readProjectionFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null}readProjectionFromNode(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild){t=t.firstElementChild.firstElementChild;for(let e=t.firstElementChild;e;e=e.nextElementSibling)if(!(e.childNodes.length===0||e.childNodes.length===1&&e.firstChild.nodeType===3)){const n=[{}];return this.gmlFormat_.readGeometryElement(e,n),K(n.pop().srsName)}}return null}}function nT(r,t,e,n){const i=n.featurePrefix?n.featurePrefix:q0;let s;return e==="1.0.0"?s=2:e==="1.1.0"?s=3:e==="2.0.0"&&(s=3.2),Object.assign({node:r},{version:e,featureNS:n.featureNS,featureType:n.featureType,featurePrefix:i,gmlVersion:s,hasZ:n.hasZ,srsName:n.srsName},t)}function Ka(r,t,e,n){gt(n,Z0,ae(r),t,e)}function Ff(r,t){return W({},Jb,r,t)}const iT={"http://www.opengis.net/ogc":{FeatureId:rt(function(r,t){return r.getAttribute("fid")})},"http://www.opengis.net/ogc/1.1":{FeatureId:rt(function(r,t){return r.getAttribute("fid")})}};function Nf(r,t){or(iT,r,t)}const sT={"http://www.opengis.net/wfs":{Feature:Nf},"http://www.opengis.net/wfs/2.0":{Feature:Nf}};function Df(r,t){return W([],sT,r,t)}function kf(r,t,e){const n=e[e.length-1],i=n.featureType,s=n.featureNS,o=n.gmlVersion,a=ft(s,i);r.appendChild(a),o===2?Tt.prototype.writeFeatureElement(a,t,e):o===3?Et.prototype.writeFeatureElement(a,t,e):Sd.prototype.writeFeatureElement(a,t,e)}function $0(r,t,e){const n=e[e.length-1].version,i=bd[n],s=ft(i,"Filter"),o=ft(i,"FeatureId");s.appendChild(o),o.setAttribute("fid",t),r.appendChild(s)}function Rd(r,t){r=r||q0;const e=r+":";return t.startsWith(e)?t:e+t}function Gf(r,t,e){const n=e[e.length-1];Rt(t.getId()!==void 0,"Features must have an id set");const i=n.featureType,s=n.featurePrefix,o=n.featureNS,a=Rd(s,i);r.setAttribute("typeName",a),r.setAttributeNS(Ed,"xmlns:"+s,o);const l=t.getId();l!==void 0&&$0(r,l,e)}function jf(r,t,e){const n=e[e.length-1];Rt(t.getId()!==void 0,"Features must have an id set");const i=n.version,s=n.featureType,o=n.featurePrefix,a=n.featureNS,l=Rd(o,s),h=t.getGeometryName();r.setAttribute("typeName",l),r.setAttributeNS(Ed,"xmlns:"+o,a);const c=t.getId();if(c!==void 0){const u=t.getKeys(),d=[];for(let g=0,f=u.length;g0,n=this.readUint32(e),i=Math.floor((n&268435455)/1e3),s=!!(n&2147483648)||i===1||i===3,o=!!(n&1073741824)||i===2||i===3,a=!!(n&536870912),l=(n&268435455)%1e3,h=["XY",s?"Z":"",o?"M":""].join(""),c=a?this.readUint32(e):null;if(t!==void 0&&t!==l)throw new Error("Unexpected WKB geometry type "+l);if(this.initialized_){if(this.isLittleEndian_!==e)throw new Error("Inconsistent endian");if(this.layout_!==h)throw new Error("Inconsistent geometry layout");if(c&&this.srid_!==c)throw new Error("Inconsistent coordinate system (SRID)")}else this.isLittleEndian_=e,this.hasZ_=s,this.hasM_=o,this.layout_=h,this.srid_=c,this.initialized_=!0;return l}readWkbPayload(t){switch(t){case Xt.POINT:return this.readPoint();case Xt.LINE_STRING:return this.readLineString();case Xt.POLYGON:case Xt.TRIANGLE:return this.readPolygon();case Xt.MULTI_POINT:return this.readMultiPoint();case Xt.MULTI_LINE_STRING:return this.readMultiLineString();case Xt.MULTI_POLYGON:case Xt.POLYHEDRAL_SURFACE:case Xt.TIN:return this.readMultiPolygon();case Xt.GEOMETRY_COLLECTION:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+t+" is found")}}readWkbBlock(t){return this.readWkbPayload(this.readWkbHeader(t))}readWkbCollection(t,e){const n=this.readUint32(),i=[];for(let s=0;s({[i]:t[s]})));for(const i of this.layout_)this.writeDouble(i in n?n[i]:this.nodata_[i])}writeLineString(t,e){this.writeUint32(t.length);for(let n=0;ni===s?i:i==="XYZM"?s:s==="XYZM"?i:"XY";if(t instanceof Dn)return n(t.getLayout(),e);if(t instanceof Ge){const i=t.getGeometriesArray();for(let s=0;ss+o[0],0),e=new ArrayBuffer(t),n=new DataView(e);let i=0;return this.writeQueue_.forEach(s=>{switch(s[0]){case 1:n.setUint8(i,s[1]);break;case 4:n.setUint32(i,s[1],this.isLittleEndian_);break;case 8:n.setFloat64(i,s[1],this.isLittleEndian_);break}i+=s[0]}),e}}class cT extends Ea{constructor(t){super(),t=t||{},this.splitCollection=!!t.splitCollection,this.viewCache_=null,this.hex_=t.hex!==!1,this.littleEndian_=t.littleEndian!==!1,this.ewkb_=t.ewkb!==!1,this.layout_=t.geometryLayout,this.nodataZ_=t.nodataZ||0,this.nodataM_=t.nodataM||0,this.srid_=t.srid}getType(){return this.hex_?"text":"arraybuffer"}readFeature(t,e){return new we({geometry:this.readGeometry(t,e)})}readFeatures(t,e){let n=[];const i=this.readGeometry(t,e);return this.splitCollection&&i instanceof Ge?n=i.getGeometriesArray():n=[i],n.map(s=>new we({geometry:s}))}readGeometry(t,e){const n=Qf(t);if(!n)return null;const i=new Jf(n).readGeometry();return this.viewCache_=n,e=this.getReadOptions(t,e),this.viewCache_=null,re(i,!1,e)}readProjection(t){const e=this.viewCache_||Qf(t);if(!e)return;const n=new Jf(e);return n.readWkbHeader(),n.getSrid()&&K("EPSG:"+n.getSrid())||void 0}writeFeature(t,e){return this.writeGeometry(t.getGeometry(),e)}writeFeatures(t,e){return this.writeGeometry(new Ge(t.map(n=>n.getGeometry())),e)}writeGeometry(t,e){e=this.adaptOptions(e);const n=new hT({layout:this.layout_,littleEndian:this.littleEndian_,ewkb:this.ewkb_,nodata:{Z:this.nodataZ_,M:this.nodataM_}});let i=Number.isInteger(this.srid_)?Number(this.srid_):null;if(this.srid_!==!1&&!Number.isInteger(this.srid_)){const o=e.dataProjection&&K(e.dataProjection);if(o){const a=o.getCode();a.startsWith("EPSG:")&&(i=Number(a.substring(5)))}}n.writeGeometry(re(t,!0,e),i);const s=n.getBuffer();return this.hex_?uT(s):s}}function uT(r){const t=new Uint8Array(r);return Array.from(t.values()).map(e=>(e<16?"0":"")+Number(e).toString(16).toUpperCase()).join("")}function dT(r){const t=new Uint8Array(r.length/2);for(let e=0;e="a"&&t<="z"||t>="A"&&t<="Z"}isNumeric_(t,e){return e=e!==void 0?e:!1,t>="0"&&t<="9"||t=="."&&!e}isWhiteSpace_(t){return t==" "||t==" "||t=="\r"||t==` -`}nextChar_(){return this.wkt.charAt(++this.index_)}nextToken(){const t=this.nextChar_(),e=this.index_;let n=t,i;if(t=="(")i=Gt.LEFT_PAREN;else if(t==",")i=Gt.COMMA;else if(t==")")i=Gt.RIGHT_PAREN;else if(this.isNumeric_(t)||t=="-")i=Gt.NUMBER,n=this.readNumber_();else if(this.isAlpha_(t))i=Gt.TEXT,n=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(t==="")i=Gt.EOF;else throw new Error("Unexpected character: "+t)}return{position:e,value:n,type:i}}readNumber_(){let t;const e=this.index_;let n=!1,i=!1;do t=="."?n=!0:(t=="e"||t=="E")&&(i=!0),t=this.nextChar_();while(this.isNumeric_(t,n)||!i&&(t=="e"||t=="E")||i&&(t=="-"||t=="+"));return parseFloat(this.wkt.substring(e,this.index_--))}readText_(){let t;const e=this.index_;do t=this.nextChar_();while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}let yT=class{constructor(r){this.lexer_=r,this.token_={position:0,type:Gt.START},this.layout_="XY"}consume_(){this.token_=this.lexer_.nextToken()}isTokenType(r){return this.token_.type==r}match(r){const t=this.isTokenType(r);return t&&this.consume_(),t}parse(){return this.consume_(),this.parseGeometry_()}parseGeometryLayout_(){let r="XY";const t=this.token_;if(this.isTokenType(Gt.TEXT)){const e=t.value;e===Y0?r="XYZ":e===H0?r="XYM":e===pT&&(r="XYZM"),r!=="XY"&&this.consume_()}return r}parseGeometryCollectionText_(){if(this.match(Gt.LEFT_PAREN)){const r=[];do r.push(this.parseGeometry_());while(this.match(Gt.COMMA));if(this.match(Gt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(Gt.LEFT_PAREN)){const r=this.parsePoint_();if(this.match(Gt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(Gt.LEFT_PAREN)){const r=this.parsePointList_();if(this.match(Gt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(Gt.LEFT_PAREN)){const r=this.parseLineStringTextList_();if(this.match(Gt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(Gt.LEFT_PAREN)){let r;if(this.token_.type==Gt.LEFT_PAREN?r=this.parsePointTextList_():r=this.parsePointList_(),this.match(Gt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(Gt.LEFT_PAREN)){const r=this.parseLineStringTextList_();if(this.match(Gt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(Gt.LEFT_PAREN)){const r=this.parsePolygonTextList_();if(this.match(Gt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parsePoint_(){const r=[],t=this.layout_.length;for(let e=0;e0&&(i+=" "+s)}return n.length===0?i+" "+V0:i+"("+n+")"}const MT=xT,Ae=[null,"http://www.opengis.net/wms"],RT=X(Ae,{Service:I(VT),Capability:I($T)}),CT=X(Ae,{Request:I(eM),Exception:I(JT),Layer:I(QT)});class IT extends vd{constructor(){super(),this.version=void 0}readFromNode(t){return this.version=t.getAttribute("version").trim(),W({version:this.version},RT,t,[])||null}}const PT=X(Ae,{Name:I(q),Title:I(q),Abstract:I(q),KeywordList:I(n_),OnlineResource:I(Ks),ContactInformation:I(YT),Fees:I(q),AccessConstraints:I(q),LayerLimit:I(he),MaxWidth:I(he),MaxHeight:I(he)}),AT=X(Ae,{ContactPersonPrimary:I(HT),ContactPosition:I(q),ContactAddress:I(KT),ContactVoiceTelephone:I(q),ContactFacsimileTelephone:I(q),ContactElectronicMailAddress:I(q)}),LT=X(Ae,{ContactPerson:I(q),ContactOrganization:I(q)}),OT=X(Ae,{AddressType:I(q),Address:I(q),City:I(q),StateOrProvince:I(q),PostCode:I(q),Country:I(q)}),FT=X(Ae,{Format:rt(q)}),t_=X(Ae,{Name:I(q),Title:I(q),Abstract:I(q),KeywordList:I(n_),CRS:Vt(q),EX_GeographicBoundingBox:I(qT),BoundingBox:Vt(ZT),Dimension:Vt(tM),Attribution:I(WT),AuthorityURL:Vt(iM),Identifier:Vt(q),MetadataURL:Vt(sM),DataURL:Vt(kn),FeatureListURL:Vt(kn),Style:Vt(oM),MinScaleDenominator:I(Mt),MaxScaleDenominator:I(Mt),Layer:Vt(e_)}),NT=X(Ae,{Title:I(q),OnlineResource:I(Ks),LogoURL:I(r_)}),DT=X(Ae,{westBoundLongitude:I(Mt),eastBoundLongitude:I(Mt),southBoundLatitude:I(Mt),northBoundLatitude:I(Mt)}),kT=X(Ae,{GetCapabilities:I(uc),GetMap:I(uc),GetFeatureInfo:I(uc)}),GT=X(Ae,{Format:Vt(q),DCPType:Vt(rM)}),jT=X(Ae,{HTTP:I(nM)}),zT=X(Ae,{Get:I(kn),Post:I(kn)}),UT=X(Ae,{Name:I(q),Title:I(q),Abstract:I(q),LegendURL:Vt(r_),StyleSheetURL:I(kn),StyleURL:I(kn)}),BT=X(Ae,{Format:I(q),OnlineResource:I(Ks)}),XT=X(Ae,{Keyword:rt(q)});function WT(r,t){return W({},NT,r,t)}function ZT(r,t){const e=[bn(r.getAttribute("minx")),bn(r.getAttribute("miny")),bn(r.getAttribute("maxx")),bn(r.getAttribute("maxy"))],n=[bn(r.getAttribute("resx")),bn(r.getAttribute("resy"))];return{crs:r.getAttribute("CRS"),extent:e,res:n}}function qT(r,t){const e=W({},DT,r,t);if(!e)return;const n=e.westBoundLongitude,i=e.southBoundLatitude,s=e.eastBoundLongitude,o=e.northBoundLatitude;if(!(n===void 0||i===void 0||s===void 0||o===void 0))return[n,i,s,o]}function $T(r,t){return W({},CT,r,t)}function VT(r,t){return W({},PT,r,t)}function YT(r,t){return W({},AT,r,t)}function HT(r,t){return W({},LT,r,t)}function KT(r,t){return W({},OT,r,t)}function JT(r,t){return W([],FT,r,t)}function QT(r,t){const e=W({},t_,r,t);return e.Layer===void 0?Object.assign(e,e_(r,t)):e}function e_(r,t){const e=t[t.length-1],n=W({},t_,r,t);if(!n)return;let i=Ai(r.getAttribute("queryable"));i===void 0&&(i=e.queryable),n.queryable=i!==void 0?i:!1;let s=Cn(r.getAttribute("cascaded"));s===void 0&&(s=e.cascaded),n.cascaded=s;let o=Ai(r.getAttribute("opaque"));o===void 0&&(o=e.opaque),n.opaque=o!==void 0?o:!1;let a=Ai(r.getAttribute("noSubsets"));a===void 0&&(a=e.noSubsets),n.noSubsets=a!==void 0?a:!1;let l=bn(r.getAttribute("fixedWidth"));l||(l=e.fixedWidth),n.fixedWidth=l;let h=bn(r.getAttribute("fixedHeight"));return h||(h=e.fixedHeight),n.fixedHeight=h,["Style","CRS","AuthorityURL"].forEach(function(c){if(c in e){const u=n[c]||[];n[c]=u.concat(e[c])}}),["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(c){if(!(c in n)){const u=e[c];n[c]=u}}),n}function tM(r,t){return{name:r.getAttribute("name"),units:r.getAttribute("units"),unitSymbol:r.getAttribute("unitSymbol"),default:r.getAttribute("default"),multipleValues:Ai(r.getAttribute("multipleValues")),nearestValue:Ai(r.getAttribute("nearestValue")),current:Ai(r.getAttribute("current")),values:q(r)}}function kn(r,t){return W({},BT,r,t)}function eM(r,t){return W({},kT,r,t)}function rM(r,t){return W({},jT,r,t)}function nM(r,t){return W({},zT,r,t)}function uc(r,t){return W({},GT,r,t)}function r_(r,t){const e=kn(r,t);if(e){const n=[Cn(r.getAttribute("width")),Cn(r.getAttribute("height"))];return e.size=n,e}}function iM(r,t){const e=kn(r,t);if(e)return e.name=r.getAttribute("name"),e}function sM(r,t){const e=kn(r,t);if(e)return e.type=r.getAttribute("type"),e}function oM(r,t){return W({},UT,r,t)}function n_(r,t){return W([],XT,r,t)}const aM=IT,lM="_feature",hM="_layer";class cM extends Ta{constructor(t){super(),t=t||{},this.featureNS_="http://mapserver.gis.umn.edu/mapserver",this.gmlFormat_=new Tt,this.layers_=t.layers?t.layers:null}getLayers(){return this.layers_}setLayers(t){this.layers_=t}readFeatures_(t,e){t.setAttribute("namespaceURI",this.featureNS_);const n=t.localName;let i=[];if(t.childNodes.length===0)return i;if(n=="msGMLOutput")for(let s=0,o=t.childNodes.length;s0;)this.pop()}extend(r){for(let t=0,e=r.length;tthis.getLength())throw new Error("Index out of bounds: "+r);this.unique_&&this.assertUnique_(t),this.array_.splice(r,0,t),this.updateLength_(),this.dispatchEvent(new Qa(ii.ADD,t,r))}pop(){return this.removeAt(this.getLength()-1)}push(r){this.unique_&&this.assertUnique_(r);const t=this.getLength();return this.insertAt(t,r),this.getLength()}remove(r){const t=this.array_;for(let e=0,n=t.length;e=this.getLength())return;const t=this.array_[r];return this.array_.splice(r,1),this.updateLength_(),this.dispatchEvent(new Qa(ii.REMOVE,t,r)),t}setAt(r,t){const e=this.getLength();if(r>=e){this.insertAt(r,t);return}if(r<0)throw new Error("Index out of bounds: "+r);this.unique_&&this.assertUnique_(t,r);const n=this.array_[r];this.array_[r]=t,this.dispatchEvent(new Qa(ii.REMOVE,n,r)),this.dispatchEvent(new Qa(ii.ADD,t,r))}updateLength_(){this.set(tp.LENGTH,this.array_.length)}assertUnique_(r,t){for(let e=0,n=this.array_.length;eg&&(d=(g+d)/2,g=d),f>p&&(f=(p+f)/2,p=f);let _=xt(n[0],d,g),y=xt(n[1],f,p);if(o&&e&&i){const v=30*i;_+=-v*Math.log(1+Math.max(0,d-n[0])/v)+v*Math.log(1+Math.max(0,n[0]-g)/v),y+=-v*Math.log(1+Math.max(0,f-n[1])/v)+v*Math.log(1+Math.max(0,n[1]-p)/v)}return[_,y]}}function DM(r){return r}function Pd(r,t,e,n){const i=mt(t)/e[0],s=qt(t)/e[1];return n?Math.min(r,Math.max(i,s)):Math.min(r,Math.min(i,s))}function Ad(r,t,e){let n=Math.min(r,t);const i=50;return n*=Math.log(1+i*Math.max(0,r/t-1))/i+1,e&&(n=Math.max(n,e),n/=Math.log(1+i*Math.max(0,e/r-1))/i+1),xt(n,e/2,t*2)}function kM(r,t,e,n){return t=t!==void 0?t:!0,function(i,s,o,a){if(i!==void 0){const l=r[0],h=r[r.length-1],c=e?Pd(l,e,o,n):l;if(a)return t?Ad(i,c,h):xt(i,h,c);const u=Math.min(c,i),d=Math.floor(oh(r,u,s));return r[d]>c&&d1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);let i=0;for(;i0}getInteracting(){return this.hints_[Jt.INTERACTING]>0}cancelAnimations(){this.setHint(Jt.ANIMATING,-this.hints_[Jt.ANIMATING]);let t;for(let e=0,n=this.animations_.length;e=0;--n){const i=this.animations_[n];let s=!0;for(let o=0,a=i.length;o0?h/l.duration:1;c>=1?(l.complete=!0,c=1):s=!1;const u=l.easing(c);if(l.sourceCenter){const d=l.sourceCenter[0],g=l.sourceCenter[1],f=l.targetCenter[0],p=l.targetCenter[1];this.nextCenter_=l.targetCenter;const _=d+u*(f-d),y=g+u*(p-g);this.targetCenter_=[_,y]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const g=this.getViewportSize_(this.getRotation()),f=this.constraints_.resolution(d,0,g,!0);this.targetCenter_=this.calculateCenterZoom(f,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?an(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const g=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(g,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(s){this.animations_[n]=null,this.setHint(Jt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=i[0].callback;o&&tl(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let n;const i=this.getCenterInternal();return i!==void 0&&(n=[i[0]-e[0],i[1]-e[1]],$x(n,t-this.getRotation()),Gm(n,e)),n}calculateCenterZoom(t,e){let n;const i=this.getCenterInternal(),s=this.getResolution();if(i!==void 0&&s!==void 0){const o=e[0]-t*(e[0]-i[0])/s,a=e[1]-t*(e[1]-i[1])/s;n=[o,a]}return n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0],i=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(i*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&Wc(t,this.getProjection())}getCenterInternal(){return this.get(Or.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return uh(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();Rt(e,"The view center is not defined");const n=this.getResolution();Rt(n!==void 0,"The view resolution is not defined");const i=this.getRotation();return Rt(i!==void 0,"The view rotation is not defined"),ku(e,n,i,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Or.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(kr(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=mt(t)/e[0],i=qt(t)/e[1];return Math.max(n,i)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(e/n)/Math.log(t);return function(s){return e/Math.pow(t,s*i)}}getRotation(){return this.get(Or.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,s=Math.log(n/i)/e;return function(o){return Math.log(n/o)/e/s}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),n=this.getRotation();let i=this.getCenterInternal();const s=this.padding_;if(s){const o=this.getViewportSizeMinusPadding_();i=gc(i,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],e,n)}return{center:i.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,n,i;if(this.resolutions_){const s=oh(this.resolutions_,t,1);e=s,n=this.resolutions_[s],s==this.resolutions_.length-1?i=2:i=n/this.resolutions_[s+1]}else n=this.maxResolution_,i=this.zoomFactor_;return e+Math.log(n/t)/Math.log(i)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=xt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,xt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;if(Rt(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){Rt(!Un(t),"Cannot fit empty extent provided as `geometry`");const i=kr(t,this.getProjection());n=cf(i)}else if(t.getType()==="Circle"){const i=kr(t.getExtent(),this.getProjection());n=cf(i),n.rotate(this.getRotation(),Me(i))}else n=t;this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),n=Math.cos(e),i=Math.sin(-e),s=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,h=-1/0,c=-1/0;for(let u=0,d=s.length;u{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const n=this.getMapInternal();!t&&n&&(t=n.getView()),t instanceof ip?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let i;e.layerStatesArray?i=e.layerStatesArray.find(o=>o.layer===this):i=this.getLayerState();const s=this.getExtent();return YM(i,e.viewState)&&(!s||Yt(s,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e;const n=this.getSource();if(n&&(e=n.getAttributions()),!e)return[];const i=t instanceof ip?t.getViewStateAndExtent():t;let s=e(i);return Array.isArray(s)||(s=[s]),s}render(t,e){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(jt.MAP,t)}getMapInternal(){return this.get(jt.MAP)}setMap(t){this.mapPrecomposeKey_&&(ye(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(ye(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=se(t,rr.PRECOMPOSE,function(e){const n=e.frameState.layerStatesArray,i=this.getLayerState(!1);Rt(!n.some(function(s){return s.layer===i.layer}),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),n.push(i)},this),this.mapRenderKey_=se(this,Ct.CHANGE,t.render,t),this.changed())}setSource(t){this.set(jt.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function YM(r,t){if(!r.visible)return!1;const e=t.resolution;if(e=r.maxResolution)return!1;const n=t.zoom;return n>r.minZoom&&n<=r.maxZoom}const Ra=VM;function HM(r,t,e,n,i){h_(r,t,e||0,n||r.length-1,i||KM)}function h_(r,t,e,n,i){for(;n>e;){if(n-e>600){var s=n-e+1,o=t-e+1,a=Math.log(s),l=.5*Math.exp(2*a/3),h=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1),c=Math.max(e,Math.floor(t-o*l/s+h)),u=Math.min(n,Math.floor(t+(s-o)*l/s+h));h_(r,t,c,u,i)}var d=r[t],g=e,f=n;for(go(r,e,t),i(r[n],d)>0&&go(r,e,n);g0;)f--}i(r[e],d)===0?go(r,e,f):(f++,go(r,f,n)),f<=t&&(e=f+1),t<=f&&(n=f-1)}}function go(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function KM(r,t){return rt?1:0}let Ld=class{constructor(r=9){this._maxEntries=Math.max(4,r),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(r){let t=this.data;const e=[];if(!rl(r,t))return e;const n=this.toBBox,i=[];for(;t;){for(let s=0;s=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(n,i,t)}_split(r,t){const e=r[t],n=e.children.length,i=this._minEntries;this._chooseSplitAxis(e,i,n);const s=this._chooseSplitIndex(e,i,n),o=cs(e.children.splice(s,e.children.length-s));o.height=e.height,o.leaf=e.leaf,ts(e,this.toBBox),ts(o,this.toBBox),t?r[t-1].children.push(o):this._splitRoot(e,o)}_splitRoot(r,t){this.data=cs([r,t]),this.data.height=r.height+1,this.data.leaf=!1,ts(this.data,this.toBBox)}_chooseSplitIndex(r,t,e){let n,i=1/0,s=1/0;for(let o=t;o<=e-t;o++){const a=vo(r,0,o,this.toBBox),l=vo(r,o,e,this.toBBox),h=rR(a,l),c=fc(a)+fc(l);h=t;l--){const h=r.children[l];wo(o,r.leaf?i(h):h),a+=el(o)}return a}_adjustParentBBoxes(r,t,e){for(let n=e;n>=0;n--)wo(t[n],r)}_condense(r){for(let t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():ts(r[t],this.toBBox)}};function JM(r,t,e){if(!e)return t.indexOf(r);for(let n=0;n=r.minX&&t.maxY>=r.minY}function cs(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function sp(r,t,e,n,i){const s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=n)continue;const o=t+Math.ceil((e-t)/n/2)*n;HM(r,o,t,e,i),s.push(t,o,o,e)}}let to=0;const Vi=0,Kt=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string"},oR={[F.Get]:yt(([r,t])=>t!==void 0?sR(t.value):Fe,bt(1,2),aR),[F.Var]:yt(([r])=>r.type,bt(1,1),lR),[F.Id]:yt(V|_e,fo,hR),[F.Concat]:yt(_e,bt(2,1/0),Ot(Fe)),[F.GeometryType]:yt(_e,fo,cR),[F.Resolution]:yt(V,fo),[F.Zoom]:yt(V,fo),[F.Time]:yt(V,fo),[F.Any]:yt(Kt,bt(2,1/0),Ot(Kt)),[F.All]:yt(Kt,bt(2,1/0),Ot(Kt)),[F.Not]:yt(Kt,bt(1,1),Ot(Kt)),[F.Equal]:yt(Kt,bt(2,2),Ot(Fe),Yn),[F.NotEqual]:yt(Kt,bt(2,2),Ot(Fe),Yn),[F.GreaterThan]:yt(Kt,bt(2,2),Ot(Fe),Yn),[F.GreaterThanOrEqualTo]:yt(Kt,bt(2,2),Ot(Fe),Yn),[F.LessThan]:yt(Kt,bt(2,2),Ot(Fe),Yn),[F.LessThanOrEqualTo]:yt(Kt,bt(2,2),Ot(Fe),Yn),[F.Multiply]:yt(r=>{let t=V|Ut;for(let e=0;e{let t=Fe;for(let e=1;e{let t=Fe;for(let e=2;e{let t=Ut|V;for(let e=3;e{let t=Fe;for(let e=1;er.length===3||r.length===4?de|Ut:de,bt(1,1/0),Ot(V)),[F.Color]:yt(Ut,bt(1,4),Ot(V)),[F.Band]:yt(V,bt(1,3),Ot(V)),[F.Palette]:yt(Ut,bt(2,2),mR),[F.ToString]:yt(_e,bt(1,1),Ot(Kt|V|_e|Ut))};function aR(r,t){const e=zt(r[1],t);if(!(e instanceof si))throw new Error("Expected a literal argument for get operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");if(t.properties.add(e.value),r.length===3){const n=zt(r[2],t);return[e,n]}return[e]}function lR(r,t,e,n){const i=r[1];if(typeof i!="string")throw new Error("Expected a string argument for var operation");if(t.variables.add(i),!("variables"in t.style)||t.style.variables[i]===void 0)return[new si(Fe,i)];const s=t.style.variables[i],o=zt(s,t);if(o.value=i,n&&!Gr(n,o.type))throw new Error(`The variable ${i} has type ${ve(o.type)} but the following type was expected: ${ve(n)}`);return[o]}function hR(r,t){t.featureId=!0}function cR(r,t){t.geometryType=!0}function fo(r,t){const e=r[0];if(r.length!==1)throw new Error(`Expected no arguments for ${e} operation`);return[]}function bt(r,t){return function(e,n){const i=e[0],s=e.length-1;if(r===t){if(s!==r){const o=r===1?"":"s";throw new Error(`Expected ${r} argument${o} for ${i}, got ${s}`)}}else if(st){const o=t===1/0?`${r} or more`:`${r} to ${t}`;throw new Error(`Expected ${o} arguments for ${i}, got ${s}`)}}}function Ot(r){return function(t,e){const n=t[0],i=t.length-1,s=new Array(i);for(let o=0;on.featureId;case F.GeometryType:return n=>n.geometryType;case F.Concat:{const n=r.args.map(i=>Wr(i));return i=>"".concat(...n.map(s=>s(i).toString()))}case F.Resolution:return n=>n.resolution;case F.Any:case F.All:case F.Between:case F.In:case F.Not:return wR(r);case F.Equal:case F.NotEqual:case F.LessThan:case F.LessThanOrEqualTo:case F.GreaterThan:case F.GreaterThanOrEqualTo:return vR(r);case F.Multiply:case F.Divide:case F.Add:case F.Subtract:case F.Clamp:case F.Mod:case F.Pow:case F.Abs:case F.Floor:case F.Ceil:case F.Round:case F.Sin:case F.Cos:case F.Atan:case F.Sqrt:return SR(r);case F.Case:return ER(r);case F.Match:return bR(r);case F.Interpolate:return TR(r);case F.ToString:return MR(r);default:throw new Error(`Unsupported operator ${e}`)}}function yR(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let s=0;s{for(let o=0;o{for(let o=0;on.properties[e];case F.Var:return n=>n.variables[e];default:throw new Error(`Unsupported accessor operator ${r.operator}`)}}function vR(r,t){const e=r.operator,n=Wr(r.args[0]),i=Wr(r.args[1]);switch(e){case F.Equal:return s=>n(s)===i(s);case F.NotEqual:return s=>n(s)!==i(s);case F.LessThan:return s=>n(s)n(s)<=i(s);case F.GreaterThan:return s=>n(s)>i(s);case F.GreaterThanOrEqualTo:return s=>n(s)>=i(s);default:throw new Error(`Unsupported comparison operator ${e}`)}}function wR(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let s=0;s{for(let o=0;o{for(let o=0;o{const o=i[0](s),a=i[1](s),l=i[2](s);return o>=a&&o<=l};case F.In:return s=>{const o=i[0](s);for(let a=1;a!i[0](s);default:throw new Error(`Unsupported logical operator ${e}`)}}function SR(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let s=0;s{let o=1;for(let a=0;ai[0](s)/i[1](s);case F.Add:return s=>{let o=0;for(let a=0;ai[0](s)-i[1](s);case F.Clamp:return s=>{const o=i[0](s),a=i[1](s);if(ol?l:o};case F.Mod:return s=>i[0](s)%i[1](s);case F.Pow:return s=>Math.pow(i[0](s),i[1](s));case F.Abs:return s=>Math.abs(i[0](s));case F.Floor:return s=>Math.floor(i[0](s));case F.Ceil:return s=>Math.ceil(i[0](s));case F.Round:return s=>Math.round(i[0](s));case F.Sin:return s=>Math.sin(i[0](s));case F.Cos:return s=>Math.cos(i[0](s));case F.Atan:return n===2?s=>Math.atan2(i[0](s),i[1](s)):s=>Math.atan(i[0](s));case F.Sqrt:return s=>Math.sqrt(i[0](s));default:throw new Error(`Unsupported numeric operator ${e}`)}}function ER(r,t){const e=r.args.length,n=new Array(e);for(let i=0;i{for(let s=0;s{const s=n[0](i);for(let o=1;o{const s=n[0](i),o=n[1](i);let a,l;for(let h=2;h=o)return h===2?u:d?RR(s,o,a,l,c,u):So(s,o,a,l,c,u);a=c,l=u}return l}}function MR(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let s=0;s{const o=i[0](s);return r.args[0].type===Ut?ud(o):o.toString()};default:throw new Error(`Unsupported convert operator ${e}`)}}function So(r,t,e,n,i,s){const o=i-e;if(o===0)return n;const a=t-e,l=r===1?a/o:(Math.pow(r,a)-1)/(Math.pow(r,o)-1);return n+l*(s-n)}function RR(r,t,e,n,i,s){if(i-e===0)return n;const o=_f(n),a=_f(s);let l=a[2]-o[2];l>180?l-=360:l<-180&&(l+=360);const h=[So(r,t,e,o[0],i,a[0]),So(r,t,e,o[1],i,a[1]),o[2]+So(r,t,e,0,i,l),So(r,t,e,n[3],i,s[3])];return d0(_S(h))}function CR(r){return!0}function IR(r){const t=Od(),e=PR(r,t),n=d_();return function(i,s){if(n.properties=i.getPropertiesInternal(),n.resolution=s,t.featureId){const o=i.getId();o!==void 0?n.featureId=o:n.featureId=null}return t.geometryType&&(n.geometryType=Fd(i.getGeometry())),e(n)}}function ap(r){const t=Od(),e=r.length,n=new Array(e);for(let o=0;o4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function m_(r,t){const e=Ia(r,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}function UR(r,t){return typeof r=="number"?r:m_(r,t)}const up={RENDER_ORDER:"renderOrder"};class Pa extends Ra{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(up.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const n=this.getDeclutter();n in t.declutter||(t.declutter[n]=new Ld(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(up.RENDER_ORDER,t)}setStyle(t){this.style_=BR(t),this.styleFunction_=t===null?void 0:OS(this.style_),this.changed()}}function BR(r){if(r===void 0)return FS;if(!r)return null;if(typeof r=="function"||r instanceof $e)return r;if(!Array.isArray(r))return ap([r]);if(r.length===0)return[];const t=r.length,e=r[0];if(e instanceof $e){const n=new Array(t);for(let i=0;il&&(this.instructions.push([ht.CUSTOM,l,c,t,n,Rn,s]),this.hitDetectionInstructions.push([ht.CUSTOM,l,c,t,i||n,Rn,s]));break;case"Point":h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),c=this.coordinates.length,this.instructions.push([ht.CUSTOM,l,c,t,n,void 0,s]),this.hitDetectionInstructions.push([ht.CUSTOM,l,c,t,i||n,void 0,s]);break}this.endGeometry(e)}beginGeometry(t,e,n){this.beginGeometryInstruction1_=[ht.BEGIN_GEOMETRY,e,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ht.BEGIN_GEOMETRY,e,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const n=t.length;let i,s,o=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0}createFill(t){const e=t.fillStyle,n=[ht.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[ht.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){const n=t.strokeStyle,i=t.lineCap,s=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=i||s!=t.currentLineDash&&!Xi(t.currentLineDash,s)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(n!==void 0&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=i,t.currentLineDash=s,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=h)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[ht.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Px(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;Cr(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class XR extends Aa{constructor(t,e,n,i){super(t,e,n,i),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,n){if(!this.image_||this.maxExtent&&!yr(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,n);const i=t.getFlatCoordinates(),s=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(i,s);this.instructions.push([ht.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([ht.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,n){if(!this.image_)return;this.beginGeometry(t,e,n);const i=t.getFlatCoordinates(),s=[];for(let l=0,h=i.length;l=r){const f=(r-a+g)/g,p=pr(h,u,f),_=pr(c,d,f);l.push(p,_),s.push(l),l=[p,_],a==r&&(o+=i),a=0}else if(a0&&s.push(l),s}function YR(r,t,e,n,i){let s=e,o=e,a=0,l=0,h=e,c,u,d,g,f,p,_,y,v,w;for(u=e;ur&&(l>a&&(a=l,s=h,o=u),l=0,h=u-i)),d=g,_=v,y=w),f=S,p=E}return l+=g,l>a?[h,u]:[s,o]}const kl={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class HR extends Aa{constructor(t,e,n,i){super(t,e,n,i),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[er]={fillStyle:er},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,n){const i=this.textFillState_,s=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!i&&!s)return;const a=this.coordinates;let l=a.length;const h=t.getType();let c=null,u=t.getStride();if(o.placement==="line"&&(h=="LineString"||h=="MultiLineString"||h=="Polygon"||h=="MultiPolygon")){if(!Yt(this.maxExtent,t.getExtent()))return;let d;if(c=t.getFlatCoordinates(),h=="LineString")d=[c.length];else if(h=="MultiLineString")d=t.getEnds();else if(h=="Polygon")d=t.getEnds().slice(0,1);else if(h=="MultiPolygon"){const _=t.getEndss();d=[];for(let y=0,v=_.length;y{const E=a[(v+S)*2]===c[S*u]&&a[(v+S)*2+1]===c[S*u+1];return E||--v,E})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&this.updateFillStyle(this.state,this.createFill),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,n);let f=o.padding;if(f!=Ri&&(o.scale[0]<0||o.scale[1]<0)){let v=o.padding[0],w=o.padding[1],S=o.padding[2],E=o.padding[3];o.scale[0]<0&&(w=-w,E=-E),o.scale[1]<0&&(v=-v,S=-S),f=[v,w,S,E]}const p=this.pixelRatio;this.instructions.push([ht.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,f==Ri?Ri:f.map(function(v){return v*p}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const _=1/p,y=this.state.fillStyle;o.backgroundFill&&(this.state.fillStyle=er,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([ht.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterMode_,this.declutterImageWithText_,f,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?er:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),o.backgroundFill&&(this.state.fillStyle=y,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,i=this.strokeKey_;t&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:e.font,textAlign:e.textAlign||Jo,justify:e.justify,textBaseline:e.textBaseline||Cl,scale:e.scale});const o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,i=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,h=kl[i.textBaseline],c=this.textOffsetY_*l,u=this.text_,d=n?n.lineWidth*Math.abs(i.scale[0])/2:0;this.instructions.push([ht.DRAW_CHARS,t,e,h,i.overflow,a,i.maxAngle,l,c,s,d*l,u,o,1,this.declutterMode_]),this.hitDetectionInstructions.push([ht.DRAW_CHARS,t,e,h,i.overflow,a&&er,i.maxAngle,l,c,s,d*l,u,o,1/l,this.declutterMode_])}setTextStyle(t,e){let n,i,s;if(!t)this.text_="";else{const o=t.getFill();o?(i=this.textFillState_,i||(i={},this.textFillState_=i),i.fillStyle=rn(o.getColor()||er)):(i=null,this.textFillState_=i);const a=t.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const f=a.getLineDash(),p=a.getLineDashOffset(),_=a.getWidth(),y=a.getMiterLimit();s.lineCap=a.getLineCap()||ks,s.lineDash=f?f.slice():An,s.lineDashOffset=p===void 0?Ln:p,s.lineJoin=a.getLineJoin()||Gs,s.lineWidth=_===void 0?Qo:_,s.miterLimit=y===void 0?Ho:y,s.strokeStyle=rn(a.getColor()||Ko)}n=this.textState_;const l=t.getFont()||_0;CS(l);const h=t.getScaleArray();n.overflow=t.getOverflow(),n.font=l,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||Cl,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Ri,n.scale=h===void 0?[1,1]:h;const c=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=g===void 0?0:g,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:tt(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=i&&i.fillStyle?typeof i.fillStyle=="string"?i.fillStyle:"|"+tt(i.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const KR={Circle:gp,Default:Aa,Image:WR,LineString:qR,Polygon:gp,Text:HR};class y_{constructor(t,e,n,i){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=i,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const i in n){const s=n[i].finish();t[e][i]=s}}return t}getBuilder(t,e){const n=t!==void 0?t.toString():"0";let i=this.buildersByZIndex_[n];i===void 0&&(i={},this.buildersByZIndex_[n]=i);let s=i[e];if(s===void 0){const o=KR[e];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[e]=s}return s}}class x_ extends pa{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return lt()}getData(t){return null}prepareFrame(t){return lt()}renderFrame(t,e){return lt()}loadedTileCallback(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n}createLoadedTileFinder(t,e,n){return(i,s)=>{const o=this.loadedTileCallback.bind(this,n,i);return t.forEachLoadedTile(e,i,s,o)}}forEachFeatureAtCoordinate(t,e,n,i,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===J.LOADED||e.getState()===J.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=J.LOADED&&e!=J.ERROR&&t.addEventListener(Ct.CHANGE,this.boundHandleImageChange_),e==J.IDLE&&(t.load(),e=t.getState()),e==J.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class dl extends gn{constructor(t,e,n,i){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=i}}class Dd{constructor(){Cu(this,"pushMethodArgs_",(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this)),this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(CanvasRenderingContext2D.prototype,{get:(t,e)=>{if(typeof Hc()[e]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,n)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,n),!0)})}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,i=e.length;nR[2]}else D=S>P;const z=Math.PI,m=[],x=T+n===t;t=T,_=0,y=M,d=r[t],g=r[t+1];let b;if(x){v(),b=Math.atan2(g-p,d-f),D&&(b+=b>0?-z:z);const R=(P+S)/2,L=(G+E)/2;return m[0]=[R,L,(C-s)/2,b,i],m}i=i.replace(/\n/g," ");for(let R=0,L=i.length;R0?-z:z),b!==void 0){let U=N-b;if(U+=U>z?-2*z:U<-z?2*z:0,Math.abs(U)>o)return null}b=N;const k=R;let j=0;for(;R0&&r.push(` -`,""),r.push(t,""),r}class eC{constructor(t,e,n,i,s){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=ue(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=s?new Dd:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,n,i){const s=t+e+n+i;if(this.labels_[s])return this.labels_[s];const o=i?this.strokeStates[i]:null,a=n?this.fillStates[n]:null,l=this.textStates[e],h=this.pixelRatio,c=[l.scale[0]*h,l.scale[1]*h],u=Array.isArray(t),d=l.justify?kl[l.justify]:mc(Array.isArray(t)?t[0]:t,l.textAlign||Jo),g=i&&o.lineWidth?o.lineWidth:0,f=u?t:t.split(` -`).reduce(tC,[]),{width:p,height:_,widths:y,heights:v,lineWidths:w}=PS(l,f),S=p+g,E=[],T=(S+2)*c[0],M=(_+g)*c[1],C={width:T<0?Math.floor(T):Math.ceil(T),height:M<0?Math.floor(M):Math.ceil(M),contextInstructions:E};(c[0]!=1||c[1]!=1)&&E.push("scale",c),i&&(E.push("strokeStyle",o.strokeStyle),E.push("lineWidth",g),E.push("lineCap",o.lineCap),E.push("lineJoin",o.lineJoin),E.push("miterLimit",o.miterLimit),E.push("setLineDash",[o.lineDash]),E.push("lineDashOffset",o.lineDashOffset)),n&&E.push("fillStyle",a.fillStyle),E.push("textBaseline","middle"),E.push("textAlign","center");const P=.5-d;let G=d*S+P*g;const D=[],z=[];let m=0,x=0,b=0,R=0,L;for(let N=0,k=f.length;Nt?t-h:s,S=o+c>e?e-c:o,E=f[3]+w*d[0]+f[1],T=f[0]+S*d[1]+f[2],M=y-f[3],C=v-f[0];(p||u!==0)&&(Hn[0]=M,Kn[0]=M,Hn[1]=C,vn[1]=C,vn[0]=M+E,wn[0]=vn[0],wn[1]=C+T,Kn[1]=wn[1]);let P;return u!==0?(P=ar(ue(),n,i,1,1,u,-n,-i),ie(P,Hn),ie(P,vn),ie(P,wn),ie(P,Kn),Ur(Math.min(Hn[0],vn[0],wn[0],Kn[0]),Math.min(Hn[1],vn[1],wn[1],Kn[1]),Math.max(Hn[0],vn[0],wn[0],Kn[0]),Math.max(Hn[1],vn[1],wn[1],Kn[1]),es)):Ur(Math.min(M,M+E),Math.min(C,C+T),Math.max(M,M+E),Math.max(C,C+T),es),g&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:w,drawImageH:S,originX:h,originY:c,declutterBox:{minX:es[0],minY:es[1],maxX:es[2],maxY:es[3],value:_},canvasTransform:P,scale:d}}replayImageOrLabel_(t,e,n,i,s,o,a){const l=!!(o||a),h=i.declutterBox,c=a?a[2]*i.scale[0]/2:0;return h.minX-c<=e[0]&&h.maxX+c>=0&&h.minY-c<=e[1]&&h.maxY+c>=0&&(l&&this.replayTextBackground_(t,Hn,vn,wn,Kn,o,a),AS(t,i.canvasTransform,s,n,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const n=ie(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(n[0]%i,n[1]%i),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,n,i){const s=this.textStates[e],o=this.createLabel(t,e,i,n),a=this.strokeStates[n],l=this.pixelRatio,h=mc(Array.isArray(t)?t[0]:t,s.textAlign||Jo),c=kl[s.textBaseline||Cl],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*s.scale[0],g=h*d+2*(.5-h)*u,f=c*o.height/l+2*(.5-c)*u;return{label:o,anchorX:g,anchorY:f}}execute_(t,e,n,i,s,o,a,l){const h=this.zIndexContext_;let c;this.pixelCoordinates_&&Xi(n,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=li(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Mx(this.renderedTransform_,n));let u=0;const d=i.length;let g=0,f,p,_,y,v,w,S,E,T,M,C,P,G,D=0,z=0,m=null,x=null;const b=this.coordinateCache_,R=this.viewRotation_,L=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,N={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:R},k=this.instructions!=i||this.overlaps?0:200;let j,Z,Y,ot;for(;uk&&(this.fill_(t),D=0),z>k&&(t.stroke(),z=0),!D&&!z&&(t.beginPath(),v=NaN,w=NaN),++u;break;case ht.CIRCLE:g=U[1];const nt=c[g],ut=c[g+1],_t=c[g+2],Lt=c[g+3],It=_t-nt,Dt=Lt-ut,$t=Math.sqrt(It*It+Dt*Dt);t.moveTo(nt+$t,ut),t.arc(nt,ut,$t,0,2*Math.PI,!0),++u;break;case ht.CLOSE_PATH:t.closePath(),++u;break;case ht.CUSTOM:g=U[1],f=U[2];const me=U[3],Oe=U[4],dr=U[5];N.geometry=me,N.feature=j,u in b||(b[u]=[]);const ge=b[u];dr?dr(c,g,f,2,ge):(ge[0]=c[g],ge[1]=c[g+1],ge.length=2),h&&(h.zIndex=U[6]),Oe(ge,N),++u;break;case ht.DRAW_IMAGE:g=U[1],f=U[2],T=U[3],p=U[4],_=U[5];let qr=U[6];const Ba=U[7],Yh=U[8],Xa=U[9],Wa=U[10];let gr=U[11];const Ar=U[12];let $r=U[13];y=U[14]||"declutter";const Lr=U[15];if(!T&&U.length>=20){M=U[19],C=U[20],P=U[21],G=U[22];const vr=this.drawLabelWithPointPlacement_(M,C,P,G);T=vr.label,U[3]=T;const vi=U[23];p=(vr.anchorX-vi)*this.pixelRatio,U[4]=p;const wr=U[24];_=(vr.anchorY-wr)*this.pixelRatio,U[5]=_,qr=T.height,U[6]=qr,$r=T.width,U[13]=$r}let Hi;U.length>25&&(Hi=U[25]);let Ki,qn,pn;U.length>17?(Ki=U[16],qn=U[17],pn=U[18]):(Ki=Ri,qn=!1,pn=!1),Wa&&L?gr+=R:!Wa&&!L&&(gr-=R);let Hh=0;for(;g!Gl.includes(r));class v_{constructor(t,e,n,i,s,o,a){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=ue(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,a)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,e){for(const n in t){let i=this.executorsByZIndex_[n];i===void 0&&(i={},this.executorsByZIndex_[n]=i);const s=t[n];for(const o in s){const a=s[o];i[o]=new eC(this.resolution_,this.pixelRatio_,this.overlaps_,a,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let i=0,s=t.length;i0){if(!o||g!=="Image"&&g!=="Text"||o.includes(E)){const G=(d[C]-3)/4,D=i-G%a,z=i-(G/a|0),m=s(E,T,D*D+z*z);if(m)return m}c.clearRect(0,0,a,a);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(on);let _,y,v,w,S;for(_=p.length-1;_>=0;--_){const E=p[_].toString();for(v=this.executorsByZIndex_[E],y=No.length-1;y>=0;--y)if(g=No[y],w=v[g],w!==void 0&&(S=w.executeHitDetection(c,l,n,f,u),S))return S}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const n=e[0],i=e[1],s=e[2],o=e[3],a=[n,i,n,o,s,o,s,i];return li(a,0,8,2,t,a),a}isEmpty(){return Fn(this.executorsByZIndex_)}execute(t,e,n,i,s,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(on),o=o||No;let h,c,u,d,g,f;for(a&&l.reverse(),h=0,c=l.length;h{s.draw(this.renderedContext_),s.clear()})}}const _c={};function nC(r){if(_c[r]!==void 0)return _c[r];const t=r*2+1,e=r*r,n=new Array(e+1);for(let s=0;s<=r;++s)for(let o=0;o<=r;++o){const a=s*s+o*o;if(a>e)break;let l=n[a];l||(l=[],n[a]=l),l.push(((r+s)*t+(r+o))*4+3),s>0&&l.push(((r-s)*t+(r+o))*4+3),o>0&&(l.push(((r+s)*t+(r-o))*4+3),s>0&&l.push(((r-s)*t+(r-o))*4+3))}const i=[];for(let s=0,o=n.length;su*this.pixelRatio_),lineDashOffset:(o||Ln)*this.pixelRatio_,lineJoin:a!==void 0?a:Gs,lineWidth:(l!==void 0?l:Qo)*this.pixelRatio_,miterLimit:h!==void 0?h:Ho,strokeStyle:rn(n||Ko)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const n=t.getPixelRatio(this.pixelRatio_),i=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*n,this.imageAnchorY_=i[1]*n,this.imageHeight_=e[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/n,o[1]*this.pixelRatio_/n],this.imageWidth_=e[0]*n}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const g=e.getColor();this.textFillState_={fillStyle:rn(g||er)}}const n=t.getStroke();if(!n)this.textStrokeState_=null;else{const g=n.getColor(),f=n.getLineCap(),p=n.getLineDash(),_=n.getLineDashOffset(),y=n.getLineJoin(),v=n.getWidth(),w=n.getMiterLimit();this.textStrokeState_={lineCap:f!==void 0?f:ks,lineDash:p||An,lineDashOffset:_||Ln,lineJoin:y!==void 0?y:Gs,lineWidth:v!==void 0?v:Qo,miterLimit:w!==void 0?w:Ho,strokeStyle:rn(g||Ko)}}const i=t.getFont(),s=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),h=t.getScaleArray(),c=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:i!==void 0?i:_0,textAlign:u!==void 0?u:Jo,textBaseline:d!==void 0?d:Cl},this.text_=c!==void 0?Array.isArray(c)?c.reduce((g,f,p)=>g+=p%2?" ":f,""):c:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}}}const w_=iC,mr=.5;function S_(r,t,e,n,i,s,o,a,l){const h=l?uh(i):i,c=r[0]*mr,u=r[1]*mr,d=Ht(c,u);d.imageSmoothingEnabled=!1;const g=d.canvas,f=new w_(d,mr,i,null,o,a,l?qi(rv(),l):null),p=e.length,_=Math.floor((256*256*256-1)/p),y={};for(let w=1;w<=p;++w){const S=e[w-1],E=S.getStyleFunction()||n;if(!E)continue;let T=E(S,s);if(!T)continue;Array.isArray(T)||(T=[T]);const M=(w*_).toString(16).padStart(7,"#00000");for(let C=0,P=T.length;C0;return u&&Promise.all(l).then(()=>i(null)),lC(r,t,e,n,s,o,a),u}function lC(r,t,e,n,i,s,o){const a=e.getGeometryFunction()(t);if(!a)return;const l=a.simplifyTransformed(n,i);if(e.getRenderer())M_(r,l,e,t,o);else{const h=b_[l.getType()];h(r,l,e,t,o,s)}}function M_(r,t,e,n,i){if(t.getType()=="GeometryCollection"){const s=t.getGeometries();for(let o=0,a=s.length;o{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const n=[this.context.canvas.width,this.context.canvas.height];ie(this.pixelTransform,n);const i=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,h=this.getLayer(),c=[],u=n[0]*mr,d=n[1]*mr;c.push(this.getRenderTransform(i,s,o,mr,u,d,0).slice());const g=h.getSource(),f=a.getExtent();if(g.getWrapX()&&a.canWrapX()&&!Ze(f,l)){let p=l[0];const _=mt(f);let y=0,v;for(;pf[2];)++y,v=_*y,c.push(this.getRenderTransform(i,s,o,mr,u,d,v).slice()),p-=_}this.hitDetectionImageData_=S_(n,c,this.renderedFeatures_,h.getStyleFunction(),l,s,o,jl(s,this.renderedPixelRatio_),null)}e(E_(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,i,s){if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),h={},c=function(f,p,_){const y=tt(f),v=h[y];if(v){if(v!==!0&&_u=f.forEachFeatureAtCoordinate(t,o,a,n,c,g&&e.declutter[g]?e.declutter[g].all().map(p=>p.value):null)),u}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),n=e.getSource();if(!n)return!1;const i=t.viewHints[Jt.ANIMATING],s=t.viewHints[Jt.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&i||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=t.extent,h=t.viewState,c=h.projection,u=h.resolution,d=t.pixelRatio,g=e.getRevision(),f=e.getRenderBuffer();let p=e.getRenderOrder();p===void 0&&(p=oC);const _=h.center.slice(),y=Cr(l,f*u),v=y.slice(),w=[y.slice()],S=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!Ze(S,t.extent)){const x=mt(S),b=Math.max(mt(y)/2,x);y[0]=S[0]-b,y[2]=S[2]+b,jm(_,c);const R=Gu(w[0],c);R[0]S[0]&&R[2]>S[2]&&w.push([R[0]-x,R[1],R[2]-x,R[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==g&&this.renderedRenderOrder_==p&&Ze(this.wrappedRenderedExtent_,y))return Xi(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const E=new y_(T_(u,d),y,u,d);let T;for(let x=0,b=w.length;x{let R;const L=x.getStyleFunction()||e.getStyleFunction();if(L&&(R=L(x,u)),R){const N=this.renderFeature(x,M,R,E,T,this.getLayer().getDeclutter(),b);C=C&&!N}},G=uh(y),D=n.getFeaturesInExtent(G);p&&D.sort(p);for(let x=0,b=D.length;x=200&&a.status<300){const h=t.getType();let c;h=="json"?c=JSON.parse(a.responseText):h=="text"?c=a.responseText:h=="xml"?(c=a.responseXML,c||(c=new DOMParser().parseFromString(a.responseText,"application/xml"))):h=="arraybuffer"&&(c=a.response),c?s(t.readFeatures(c,{extent:e,featureProjection:i}),t.readProjection(c)):o()}else o()},a.onerror=o,a.send()}function xp(r,t){return function(e,n,i,s,o){const a=this;C_(r,t,e,n,i,function(l,h){a.addFeatures(l),s!==void 0&&s(l)},o||Zo)}}class Jn extends gn{constructor(t,e,n){super(t),this.feature=e,this.features=n}}class Lh extends eo{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Zo,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(Rt(this.format_,"`format` must be set when `url` is set"),this.loader_=xp(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:_C;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new _p:null,this.loadedExtentsRtree_=new _p,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,i;Array.isArray(t.features)?i=t.features:t.features&&(n=t.features,i=n.getArray()),!e&&n===void 0&&(n=new Fl(i)),i!==void 0&&this.addFeaturesInternal(i),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=tt(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const n=t.getGeometry();if(n){const i=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Jn(Ne.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof ke||(this.featureChangeKeys_[t]=[se(e,Ct.CHANGE,this.handleFeatureChange_,this),se(e,Iu.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let n=!0;if(e.getId()!==void 0){const i=String(e.getId());if(!(i in this.idIndex_))this.idIndex_[i]=e;else if(e instanceof ke){const s=this.idIndex_[i];s instanceof ke?Array.isArray(s)?s.push(e):this.idIndex_[i]=[s,e]:n=!1}else n=!1}return n&&(Rt(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],n=[],i=[];for(let s=0,o=t.length;s{e||(e=!0,this.addFeature(n.element),e=!1)}),t.addEventListener(ii.REMOVE,n=>{e||(e=!0,this.removeFeature(n.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach(ye);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const n=i=>{this.removeFeatureInternal(i)};this.featuresRtree_.forEach(n);for(const i in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new Jn(Ne.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(i){const s=i.getGeometry();if(s instanceof ke||s.intersectsCoordinate(t))return e(i)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(n){const i=n.getGeometry();if(i instanceof ke||i.intersectsExtent(t)){const s=e(n);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Fn(this.nullGeometryFeatures_)||Pt(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){e.push(n)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const n=Dx(t,e);return[].concat(...n.map(i=>this.featuresRtree_.getInExtent(i)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const n=t[0],i=t[1];let s=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return e=e||Sx,this.featuresRtree_.forEachInExtent(l,function(h){if(e(h)){const c=h.getGeometry(),u=a;if(a=c instanceof ke?0:c.closestPointXY(n,i,o,a),a{--this.loadingExtentsCount_,this.dispatchEvent(new Jn(Ne.FEATURESLOADEND,void 0,h))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Jn(Ne.FEATURESLOADERROR))}),i.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let n;e.forEachInExtent(t,function(i){if(Nn(i.extent,t))return n=i,!0}),n&&e.remove(n)}removeFeatures(t){const e=[];for(let n=0,i=t.length;n0&&this.changed()}removeFeature(t){t&&this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=tt(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);const n=this.featureChangeKeys_[e];if(!n)return;n.forEach(ye),delete this.featureChangeKeys_[e];const i=t.getId();return i!==void 0&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.hasListener(Ne.REMOVEFEATURE)&&this.dispatchEvent(new Jn(Ne.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const n in this.idIndex_){const i=this.idIndex_[n];if(t instanceof ke&&Array.isArray(i)&&i.includes(t))i.splice(i.indexOf(t),1);else if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}}return e}setLoader(t){this.loader_=t}setUrl(t){Rt(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(xp(t,this.format_))}}function xC(r){if(!(r.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");const t=r.inversePixelTransform[0],e=r.inversePixelTransform[1],n=Math.sqrt(t*t+e*e),i=r.frameState,s=$s(r.inversePixelTransform.slice(),i.coordinateToPixelTransform),o=jl(i.viewState.resolution,n);let a;return new w_(r.context,n,i.extent,s,i.viewState.rotation,o,a)}function I_(r,t,e){const n=[];let i=r(0),s=r(1),o=t(i),a=t(s);const l=[s,i],h=[a,o],c=[1,0],u={};let d=1e5,g,f,p,_,y,v;for(;--d>0&&c.length>0;)p=c.pop(),i=l.pop(),o=h.pop(),v=p.toString(),v in u||(n.push(o[0],o[1]),u[v]=!0),_=c.pop(),s=l.pop(),a=h.pop(),y=(p+_)/2,g=r(y),f=t(g),km(f[0],f[1],o[0],o[1],a[0],a[1]){const i=n.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(i),this.lonLabelStyleBase_},this.latLabelStyleBase_=new $e({text:t.latLabelStyle!==void 0?t.latLabelStyle.clone():new Gi({font:"12px Calibri,sans-serif",textAlign:"right",fill:new Xr({color:"rgba(0,0,0,1)"}),stroke:new cn({color:"rgba(255,255,255,1)",width:3})})}),this.latLabelStyle_=n=>{const i=n.get("graticule_label");return this.latLabelStyleBase_.getText().setText(i),this.latLabelStyleBase_},this.meridiansLabels_=[],this.parallelsLabels_=[],this.addEventListener(rr.POSTRENDER,this.drawLabels_.bind(this))),this.intervals_=t.intervals!==void 0?t.intervals:EC,this.setSource(new Lh({loader:this.loaderFunction.bind(this),strategy:this.strategyFunction.bind(this),features:new Fl,overlaps:!1,useSpatialIndex:!1,wrapX:t.wrapX})),this.featurePool_=[],this.lineStyle_=new $e({stroke:this.strokeStyle_}),this.loadedExtent_=null,this.renderedExtent_=null,this.renderedResolution_=null,this.setRenderOrder(null)}strategyFunction(t,e){let n=t.slice();return this.projection_&&this.getSource().getWrapX()&&Gu(n,this.projection_),this.loadedExtent_&&(Ax(this.loadedExtent_,n,e)?n=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[n]}loaderFunction(t,e,n){this.loadedExtent_=t;const i=this.getSource(),s=this.getExtent()||[-1/0,-1/0,1/0,1/0],o=xe(s,t);if(this.renderedExtent_&&Nn(this.renderedExtent_,o)&&this.renderedResolution_===e||(this.renderedExtent_=o,this.renderedResolution_=e,Un(o)))return;const a=Me(o),l=e*e/4;(!this.projection_||!Ie(this.projection_,n))&&this.updateProjectionInfo_(n),this.createGraticule_(o,a,e,l);let h=this.meridians_.length+this.parallels_.length;this.meridiansLabels_&&(h+=this.meridians_.length),this.parallelsLabels_&&(h+=this.parallels_.length);let c;for(;h>this.featurePool_.length;)c=new we,this.featurePool_.push(c);const u=i.getFeaturesCollection();u.clear();let d=0,g,f;for(g=0,f=this.meridians_.length;gMath.PI/2;c=c!==f}const g=xC(t);for(let f=l;f<=h;++f){let p=this.meridians_.length+this.parallels_.length,_,y,v,w;if(this.meridiansLabels_)for(y=0,v=this.meridiansLabels_.length;y=l?(t[0]=a[0],t[2]=a[2]):o=!0);const h=[xt(e[0],this.minX_,this.maxX_),xt(e[1],this.minY_,this.maxY_)],c=this.toLonLatTransform_(h);isNaN(c[1])&&(c[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);let u=xt(c[0],this.minLon_,this.maxLon_),d=xt(c[1],this.minLat_,this.maxLat_);const g=this.maxLines_;let f,p,_,y,v=t;o||(v=[xt(t[0],this.minX_,this.maxX_),xt(t[1],this.minY_,this.maxY_),xt(t[2],this.minX_,this.maxX_),xt(t[3],this.minY_,this.maxY_)]);const w=Os(v,this.toLonLatTransform_,void 0,8);let S=w[3],E=w[2],T=w[1],M=w[0];if(o||(yr(v,this.bottomLeft_)&&(M=this.minLon_,T=this.minLat_),yr(v,this.bottomRight_)&&(E=this.maxLon_,T=this.minLat_),yr(v,this.topLeft_)&&(M=this.minLon_,S=this.maxLat_),yr(v,this.topRight_)&&(E=this.maxLon_,S=this.maxLat_),S=xt(S,d,this.maxLat_),E=xt(E,u,this.maxLon_),T=xt(T,this.minLat_,d),M=xt(M,this.minLon_,u)),u=Math.floor(u/s)*s,y=xt(u,this.minLon_,this.maxLon_),p=this.addMeridian_(y,T,S,i,t,0),f=0,o)for(;(y-=s)>=M&&f++i[o]&&(s=o,o=1);const a=Math.max(e[1],i[s]),l=Math.min(e[3],i[o]),h=xt(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,a,l),c=[i[s-1]+(i[o-1]-i[s-1])*(h-i[s])/(i[o]-i[s]),h],u=this.meridiansLabels_[n].geom;return u.setCoordinates(c),u}getMeridians(){return this.meridians_}getParallel_(t,e,n,i,s){const o=wC(t,e,n,this.projection_,i);let a=this.parallels_[s];return a?(a.setFlatCoordinates("XY",o),a.changed()):a=new pe(o,"XY"),a}getParallelPoint_(t,e,n){const i=t.getFlatCoordinates();let s=0,o=i.length-2;i[s]>i[o]&&(s=o,o=0);const a=Math.max(e[0],i[s]),l=Math.min(e[2],i[o]),h=xt(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,a,l),c=i[s+1]+(i[o+1]-i[s+1])*(h-i[s])/(i[o]-i[s]),u=[h,c],d=this.parallelsLabels_[n].geom;return d.setCoordinates(u),d}getParallels(){return this.parallels_}updateProjectionInfo_(t){const e=K("EPSG:4326"),n=t.getWorldExtent();this.maxLat_=n[3],this.maxLon_=n[2],this.minLat_=n[1],this.minLon_=n[0];const i=hn(t,e);if(this.minLon_=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t}}const TC=bC;class rs extends gn{constructor(t,e){super(t),this.layer=e}}const yc={LAYERS:"layers"};class Oh extends o_{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let n=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(yc.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new Fl(n.slice(),{unique:!0}):Rt(typeof n.getArray=="function","Expected `layers` to be an array or a `Collection`"):n=new Fl(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(ye),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(se(t,ii.ADD,this.handleLayersAdd_,this),se(t,ii.REMOVE,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(ye);qs(this.listenerKeys_);const e=t.getArray();for(let n=0,i=e.length;n{this.uniforms_.push({value:t.uniforms[o],location:e.getUniformLocation(this.renderTargetProgram_,o)})})}getGL(){return this.gl_}init(t){const e=this.getGL(),n=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),e.viewport(0,0,n[0],n[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==n[0]||this.renderTargetTextureSize_[1]!==n[1]){this.renderTargetTextureSize_=n;const i=0,s=e.RGBA,o=0,a=e.RGBA,l=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,i,s,n[0],n[1],o,a,l,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n[0],n[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}apply(t,e,n,i){const s=this.getGL(),o=t.size;if(s.bindFramebuffer(s.FRAMEBUFFER,e?e.getFrameBuffer():null),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.renderTargetTexture_),!e){const l=tt(s.canvas);if(!t.renderTargets[l]){const h=s.getContextAttributes();h&&h.preserveDrawingBuffer&&(s.clearColor(0,0,0,0),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT)),t.renderTargets[l]=!0}}s.disable(s.DEPTH_TEST),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.viewport(0,0,s.drawingBufferWidth,s.drawingBufferHeight),s.bindBuffer(s.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),s.useProgram(this.renderTargetProgram_),s.enableVertexAttribArray(this.renderTargetAttribLocation_),s.vertexAttribPointer(this.renderTargetAttribLocation_,2,s.FLOAT,!1,0,0),s.uniform2f(this.renderTargetUniformLocation_,o[0],o[1]),s.uniform1i(this.renderTargetTextureLocation_,0);const a=t.layerStatesArray[t.layerIndex].opacity;s.uniform1f(this.renderTargetOpacityLocation_,a),this.applyUniforms(t),n&&n(s,t),s.drawArrays(s.TRIANGLES,0,6),i&&i(s,t)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(t){const e=this.getGL();let n,i=1;this.uniforms_.forEach(function(s){if(n=typeof s.value=="function"?s.value(t):s.value,n instanceof HTMLCanvasElement||n instanceof ImageData)s.texture||(s.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${i}`]),e.bindTexture(e.TEXTURE_2D,s.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,n.width,n.height,0,e.UNSIGNED_BYTE,new Uint8Array(n.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n),e.uniform1i(s.location,i++);else if(Array.isArray(n))switch(n.length){case 2:e.uniform2f(s.location,n[0],n[1]);return;case 3:e.uniform3f(s.location,n[0],n[1],n[2]);return;case 4:e.uniform4f(s.location,n[0],n[1],n[2],n[3]);return;default:return}else typeof n=="number"&&e.uniform1f(s.location,n)})}}function A_(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function L_(r,t){return r[0]=t[0],r[1]=t[1],r[4]=t[2],r[5]=t[3],r[12]=t[4],r[13]=t[5],r}const En={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},tn={UNSIGNED_BYTE:RC,UNSIGNED_SHORT:CC,UNSIGNED_INT:IC,FLOAT:P_},Bl={};function Sp(r){return"shared/"+r}let Ep=0;function FC(){const r="unique/"+Ep;return Ep+=1,r}function NC(r){let t=Bl[r];if(!t){const e=document.createElement("canvas");e.width=1,e.height=1,e.style.position="absolute",e.style.left="0",t={users:0,context:PC(e)},Bl[r]=t}return t.users+=1,t.context}function DC(r){const t=Bl[r];if(!t||(t.users-=1,t.users>0))return;const e=t.context,n=e.getExtension("WEBGL_lose_context");n&&n.loseContext();const i=e.canvas;i.width=1,i.height=1,delete Bl[r]}class kC extends Pu{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?Sp(t.canvasCacheKey):FC(),this.gl_=NC(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(il.LOST,this.boundHandleWebGLContextLost_),e.addEventListener(il.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=ue(),this.offsetScaleMatrix_=ue(),this.tmpMat4_=A_(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map(n=>new wp({webGlContext:this.gl_,scaleRatio:n.scaleRatio,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,uniforms:n.uniforms})):[new wp({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===Sp(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.gl_,n=tt(t);let i=this.bufferCache_[n];if(!i){const s=e.createBuffer();i={buffer:t,webGlBuffer:s},this.bufferCache_[n]=i}e.bindBuffer(t.getType(),i.webGlBuffer)}flushBufferData(t){const e=this.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=this.gl_,n=tt(t),i=this.bufferCache_[n];i&&!e.isContextLost()&&e.deleteBuffer(i.webGlBuffer),delete this.bufferCache_[n]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(il.LOST,this.boundHandleWebGLContextLost_),t.removeEventListener(il.RESTORED,this.boundHandleWebGLContextRestored_),DC(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,n){const i=this.gl_,s=this.getCanvas(),o=t.size,a=t.pixelRatio;(s.width!==o[0]*a||s.height!==o[1]*a)&&(s.width=o[0]*a,s.height=o[1]*a,s.style.width=o[0]+"px",s.style.height=o[1]+"px");for(let l=this.postProcessPasses_.length-1;l>=0;l--)this.postProcessPasses_[l].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.depthRange(0,1),i.clearDepth(1),i.clear(i.COLOR_BUFFER_BIT|i.DEPTH_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,e?i.ZERO:i.ONE_MINUS_SRC_ALPHA),n?(i.enable(i.DEPTH_TEST),i.depthFunc(i.LEQUAL)):i.disable(i.DEPTH_TEST)}bindTexture(t,e,n){const i=this.gl_;i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),i.uniform1i(this.getUniformLocation(n),e)}prepareDrawToRenderTarget(t,e,n,i){const s=this.gl_,o=e.getSize();s.bindFramebuffer(s.FRAMEBUFFER,e.getFramebuffer()),s.bindRenderbuffer(s.RENDERBUFFER,e.getDepthbuffer()),s.viewport(0,0,o[0],o[1]),s.bindTexture(s.TEXTURE_2D,e.getTexture()),s.clearColor(0,0,0,0),s.depthRange(0,1),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.enable(s.BLEND),s.blendFunc(s.ONE,n?s.ZERO:s.ONE_MINUS_SRC_ALPHA),i?(s.enable(s.DEPTH_TEST),s.depthFunc(s.LEQUAL)):s.disable(s.DEPTH_TEST)}drawElements(t,e){const n=this.gl_;this.getExtension("OES_element_index_uint");const i=n.UNSIGNED_INT,s=4,o=e-t,a=t*s;n.drawElements(n.TRIANGLES,o,i,a)}finalizeDraw(t,e,n){for(let i=0,s=this.postProcessPasses_.length;i{if(n=typeof s.value=="function"?s.value(t):s.value,n instanceof HTMLCanvasElement||n instanceof HTMLImageElement||n instanceof ImageData||n instanceof WebGLTexture){n instanceof WebGLTexture&&!s.texture?(s.prevValue=void 0,s.texture=n):s.texture||(s.prevValue=void 0,s.texture=e.createTexture()),this.bindTexture(s.texture,i,s.name),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const o=!(n instanceof HTMLImageElement)||n.complete;!(n instanceof WebGLTexture)&&o&&s.prevValue!==n&&(s.prevValue=n,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),i++}else if(Array.isArray(n)&&n.length===6)this.setUniformMatrixValue(s.name,L_(this.tmpMat4_,n));else if(Array.isArray(n)&&n.length<=4)switch(n.length){case 2:e.uniform2f(this.getUniformLocation(s.name),n[0],n[1]);return;case 3:e.uniform3f(this.getUniformLocation(s.name),n[0],n[1],n[2]);return;case 4:e.uniform4f(this.getUniformLocation(s.name),n[0],n[1],n[2],n[3]);return;default:return}else typeof n=="number"&&e.uniform1f(this.getUniformLocation(s.name),n)})}useProgram(t,e){this.gl_.useProgram(t),this.currentProgram_=t,this.applyFrameState(e),this.applyUniforms(e)}compileShader(t,e){const n=this.gl_,i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}getProgram(t,e){const n=this.gl_,i=this.compileShader(t,n.FRAGMENT_SHADER),s=this.compileShader(e,n.VERTEX_SHADER),o=n.createProgram();if(n.attachShader(o,i),n.attachShader(o,s),n.linkProgram(o),!n.getShaderParameter(i,n.COMPILE_STATUS)){const a=`Fragment shader compilation failed: ${n.getShaderInfoLog(i)}`;throw new Error(a)}if(n.deleteShader(i),!n.getShaderParameter(s,n.COMPILE_STATUS)){const a=`Vertex shader compilation failed: ${n.getShaderInfoLog(s)}`;throw new Error(a)}if(n.deleteShader(s),!n.getProgramParameter(o,n.LINK_STATUS)){const a=`GL program linking failed: ${n.getProgramInfoLog(o)}`;throw new Error(a)}return o}getUniformLocation(t){const e=tt(this.currentProgram_);return this.uniformLocationsByProgram_[e]===void 0&&(this.uniformLocationsByProgram_[e]={}),this.uniformLocationsByProgram_[e][t]===void 0&&(this.uniformLocationsByProgram_[e][t]=this.gl_.getUniformLocation(this.currentProgram_,t)),this.uniformLocationsByProgram_[e][t]}getAttributeLocation(t){const e=tt(this.currentProgram_);return this.attribLocationsByProgram_[e]===void 0&&(this.attribLocationsByProgram_[e]={}),this.attribLocationsByProgram_[e][t]===void 0&&(this.attribLocationsByProgram_[e][t]=this.gl_.getAttribLocation(this.currentProgram_,t)),this.attribLocationsByProgram_[e][t]}makeProjectionTransform(t,e){const n=t.size,i=t.viewState.rotation,s=t.viewState.resolution,o=t.viewState.center;return ar(e,0,0,2/(s*n[0]),2/(s*n[1]),-i,-o[0],-o[1]),e}setUniformFloatValue(t,e){this.gl_.uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.gl_.uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.gl_.uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.gl_.uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,n,i,s){const o=this.getAttributeLocation(t);o<0||(this.gl_.enableVertexAttribArray(o),this.gl_.vertexAttribPointer(o,e,n,!1,i,s))}enableAttributes(t){const e=GC(t);let n=0;for(let i=0;ithis.size_[0]||e>=this.size_[1])return Yr[0]=0,Yr[1]=0,Yr[2]=0,Yr[3]=0,Yr;this.readAll();const n=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Yr[0]=this.data_[n*4],Yr[1]=this.data_[n*4+1],Yr[2]=this.data_[n*4+2],Yr[3]=this.data_[n*4+3],Yr}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}getDepthbuffer(){return this.depthbuffer_}updateSize_(){const t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),e.bindRenderbuffer(e.RENDERBUFFER,this.depthbuffer_),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t[0],t[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthbuffer_),this.data_=new Uint8Array(t[0]*t[1]*4)}}const bp={GENERATE_POLYGON_BUFFERS:"GENERATE_POLYGON_BUFFERS",GENERATE_POINT_BUFFERS:"GENERATE_POINT_BUFFERS",GENERATE_LINE_STRING_BUFFERS:"GENERATE_LINE_STRING_BUFFERS"};var F_={exports:{}};F_.exports=kh;F_.exports.default=kh;function kh(r,t,e){e=e||2;var n=t&&t.length,i=n?t[0]*e:r.length,s=N_(r,0,i,e,!0),o=[];if(!s||s.next===s.prev)return o;var a,l,h,c,u,d,g;if(n&&(s=WC(r,t,s,e)),r.length>80*e){a=h=r[0],l=c=r[1];for(var f=e;fh&&(h=u),d>c&&(c=d);g=Math.max(h-a,c-l),g=g!==0?32767/g:0}return na(s,o,e,a,l,g,0),o}function N_(r,t,e,n,i){var s,o;if(i===du(r,t,e,n)>0)for(s=t;s=t;s-=n)o=Tp(s,r[s],r[s+1],o);return o&&Gh(o,o.next)&&(sa(o),o=o.next),o}function ji(r,t){if(!r)return r;t||(t=r);var e=r,n;do if(n=!1,!e.steiner&&(Gh(e,e.next)||oe(e.prev,e,e.next)===0)){if(sa(e),e=t=e.prev,e===e.next)break;n=!0}else e=e.next;while(n||e!==t);return t}function na(r,t,e,n,i,s,o){if(r){!o&&s&&YC(r,n,i,s);for(var a=r,l,h;r.prev!==r.next;){if(l=r.prev,h=r.next,s?UC(r,n,i,s):zC(r)){t.push(l.i/e|0),t.push(r.i/e|0),t.push(h.i/e|0),sa(r),r=h.next,a=h.next;continue}if(r=h,r===a){o?o===1?(r=BC(ji(r),t,e),na(r,t,e,n,i,s,2)):o===2&&XC(r,t,e,n,i,s):na(ji(r),t,e,n,i,s,1);break}}}}function zC(r){var t=r.prev,e=r,n=r.next;if(oe(t,e,n)>=0)return!1;for(var i=t.x,s=e.x,o=n.x,a=t.y,l=e.y,h=n.y,c=is?i>o?i:o:s>o?s:o,g=a>l?a>h?a:h:l>h?l:h,f=n.next;f!==t;){if(f.x>=c&&f.x<=d&&f.y>=u&&f.y<=g&&ys(i,a,s,l,o,h,f.x,f.y)&&oe(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function UC(r,t,e,n){var i=r.prev,s=r,o=r.next;if(oe(i,s,o)>=0)return!1;for(var a=i.x,l=s.x,h=o.x,c=i.y,u=s.y,d=o.y,g=al?a>h?a:h:l>h?l:h,_=c>u?c>d?c:d:u>d?u:d,y=cu(g,f,t,e,n),v=cu(p,_,t,e,n),w=r.prevZ,S=r.nextZ;w&&w.z>=y&&S&&S.z<=v;){if(w.x>=g&&w.x<=p&&w.y>=f&&w.y<=_&&w!==i&&w!==o&&ys(a,c,l,u,h,d,w.x,w.y)&&oe(w.prev,w,w.next)>=0||(w=w.prevZ,S.x>=g&&S.x<=p&&S.y>=f&&S.y<=_&&S!==i&&S!==o&&ys(a,c,l,u,h,d,S.x,S.y)&&oe(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;w&&w.z>=y;){if(w.x>=g&&w.x<=p&&w.y>=f&&w.y<=_&&w!==i&&w!==o&&ys(a,c,l,u,h,d,w.x,w.y)&&oe(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;S&&S.z<=v;){if(S.x>=g&&S.x<=p&&S.y>=f&&S.y<=_&&S!==i&&S!==o&&ys(a,c,l,u,h,d,S.x,S.y)&&oe(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function BC(r,t,e){var n=r;do{var i=n.prev,s=n.next.next;!Gh(i,s)&&D_(i,n,n.next,s)&&ia(i,s)&&ia(s,i)&&(t.push(i.i/e|0),t.push(n.i/e|0),t.push(s.i/e|0),sa(n),sa(n.next),n=r=s),n=n.next}while(n!==r);return ji(n)}function XC(r,t,e,n,i,s){var o=r;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&JC(o,a)){var l=k_(o,a);o=ji(o,o.next),l=ji(l,l.next),na(o,t,e,n,i,s,0),na(l,t,e,n,i,s,0);return}a=a.next}o=o.next}while(o!==r)}function WC(r,t,e,n){var i=[],s,o,a,l,h;for(s=0,o=t.length;s=e.next.y&&e.next.y!==e.y){var a=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=n&&a>s&&(s=a,o=e.x=e.x&&e.x>=h&&n!==e.x&&ys(io.x||e.x===o.x&&VC(o,e)))&&(o=e,u=d)),e=e.next;while(e!==l);return o}function VC(r,t){return oe(r.prev,r,t.prev)<0&&oe(t.next,r,r.next)<0}function YC(r,t,e,n){var i=r;do i.z===0&&(i.z=cu(i.x,i.y,t,e,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,HC(i)}function HC(r){var t,e,n,i,s,o,a,l,h=1;do{for(e=r,r=null,s=null,o=0;e;){for(o++,n=e,a=0,t=0;t0||l>0&&n;)a!==0&&(l===0||!n||e.z<=n.z)?(i=e,e=e.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;e=n}s.nextZ=null,h*=2}while(o>1);return r}function cu(r,t,e,n,i){return r=(r-e)*i|0,t=(t-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function KC(r){var t=r,e=r;do(t.x=(r-o)*(s-a)&&(r-o)*(n-a)>=(e-o)*(t-a)&&(e-o)*(s-a)>=(i-o)*(n-a)}function JC(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!QC(r,t)&&(ia(r,t)&&ia(t,r)&&tI(r,t)&&(oe(r.prev,r,t.prev)||oe(r,t.prev,t))||Gh(r,t)&&oe(r.prev,r,r.next)>0&&oe(t.prev,t,t.next)>0)}function oe(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function Gh(r,t){return r.x===t.x&&r.y===t.y}function D_(r,t,e,n){var i=ol(oe(r,t,e)),s=ol(oe(r,t,n)),o=ol(oe(e,n,r)),a=ol(oe(e,n,t));return!!(i!==s&&o!==a||i===0&&sl(r,e,t)||s===0&&sl(r,n,t)||o===0&&sl(e,r,n)||a===0&&sl(e,t,n))}function sl(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function ol(r){return r>0?1:r<0?-1:0}function QC(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&D_(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function ia(r,t){return oe(r.prev,r,r.next)<0?oe(r,t,r.next)>=0&&oe(r,r.prev,t)>=0:oe(r,t,r.prev)<0||oe(r,r.next,t)<0}function tI(r,t){var e=r,n=!1,i=(r.x+t.x)/2,s=(r.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&i<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(n=!n),e=e.next;while(e!==r);return n}function k_(r,t){var e=new uu(r.i,r.x,r.y),n=new uu(t.i,t.x,t.y),i=r.next,s=t.prev;return r.next=t,t.prev=r,e.next=i,i.prev=e,n.next=e,e.prev=n,s.next=n,n.prev=s,n}function Tp(r,t,e,n){var i=new uu(r,t,e);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function sa(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function uu(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}kh.deviation=function(r,t,e,n){var i=t&&t.length,s=i?t[0]*e:r.length,o=Math.abs(du(r,0,s,e));if(i)for(var a=0,l=t.length;a0&&(n+=r[i-1].length,e.holes.push(n))}return e};const Mp=.985;function eI(r,t){t=t||[];const e=256,n=e-1;return t[0]=Math.floor(r/e/e/e)/n,t[1]=Math.floor(r/e/e)%e/n,t[2]=Math.floor(r/e)%e/n,t[3]=r%e/n,t}function rI(r){let t=0;const e=256,n=e-1;return t+=Math.round(r[0]*e*e*e*n),t+=Math.round(r[1]*e*e*n),t+=Math.round(r[2]*e*n),t+=Math.round(r[3]*n),t}function nI(){const r='const e="GENERATE_POLYGON_BUFFERS",t="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS";function r(e,t){const n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function x(e,t){const n=(r=t)[0]*r[3]-r[1]*r[2];var r;!function(e,t){if(!e)throw new Error(t)}(0!==n,"Transformation matrix cannot be inverted");const x=t[0],i=t[1],u=t[2],o=t[3],f=t[4],s=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-u/n,e[3]=x/n,e[4]=(u*s-o*f)/n,e[5]=-(x*s-i*f)/n,e}function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}new Array(6);var u={exports:{}};function o(e,t,n){n=n||2;var r,x,i,u,o,s,l,v=t&&t.length,h=v?t[0]*n:e.length,c=f(e,0,h,n,!0),g=[];if(!c||c.next===c.prev)return g;if(v&&(c=function(e,t,n,r){var x,i,u,o=[];for(x=0,i=t.length;x80*n){r=i=e[0],x=u=e[1];for(var b=n;bi&&(i=o),s>u&&(u=s);l=0!==(l=Math.max(i-r,u-x))?32767/l:0}return a(c,g,n,r,x,l,0),g}function f(e,t,n,r,x){var i,u;if(x===O(e,t,n,r)>0)for(i=t;i=t;i-=r)u=P(i,e[i],e[i+1],u);return u&&m(u,u.next)&&(B(u),u=u.next),u}function s(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!m(r,r.next)&&0!==w(r.prev,r,r.next))r=r.next;else{if(B(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,x,i,u){if(e){!u&&i&&function(e,t,n,r){var x=e;do{0===x.z&&(x.z=b(x.x,x.y,t,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,function(e){var t,n,r,x,i,u,o,f,s=1;do{for(n=e,e=null,i=null,u=0;n;){for(u++,r=n,o=0,t=0;t0||f>0&&r;)0!==o&&(0===f||!r||n.z<=r.z)?(x=n,n=n.nextZ,o--):(x=r,r=r.nextZ,f--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;n=r}i.nextZ=null,s*=2}while(u>1)}(x)}(e,r,x,i);for(var o,f,p=e;e.prev!==e.next;)if(o=e.prev,f=e.next,i?v(e,r,x,i):l(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(f.i/n|0),B(e),e=f.next,p=f.next;else if((e=f)===p){u?1===u?a(e=h(s(e),t,n),t,n,r,x,i,2):2===u&&c(e,t,n,r,x,i):a(s(e),t,n,r,x,i,1);break}}}function l(e){var t=e.prev,n=e,r=e.next;if(w(t,n,r)>=0)return!1;for(var x=t.x,i=n.x,u=r.x,o=t.y,f=n.y,s=r.y,a=xi?x>u?x:u:i>u?i:u,h=o>f?o>s?o:s:f>s?f:s,c=r.next;c!==t;){if(c.x>=a&&c.x<=v&&c.y>=l&&c.y<=h&&M(x,o,i,f,u,s,c.x,c.y)&&w(c.prev,c,c.next)>=0)return!1;c=c.next}return!0}function v(e,t,n,r){var x=e.prev,i=e,u=e.next;if(w(x,i,u)>=0)return!1;for(var o=x.x,f=i.x,s=u.x,a=x.y,l=i.y,v=u.y,h=of?o>s?o:s:f>s?f:s,y=a>l?a>v?a:v:l>v?l:v,g=b(h,c,t,n,r),d=b(p,y,t,n,r),Z=e.prevZ,m=e.nextZ;Z&&Z.z>=g&&m&&m.z<=d;){if(Z.x>=h&&Z.x<=p&&Z.y>=c&&Z.y<=y&&Z!==x&&Z!==u&&M(o,a,f,l,s,v,Z.x,Z.y)&&w(Z.prev,Z,Z.next)>=0)return!1;if(Z=Z.prevZ,m.x>=h&&m.x<=p&&m.y>=c&&m.y<=y&&m!==x&&m!==u&&M(o,a,f,l,s,v,m.x,m.y)&&w(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;Z&&Z.z>=g;){if(Z.x>=h&&Z.x<=p&&Z.y>=c&&Z.y<=y&&Z!==x&&Z!==u&&M(o,a,f,l,s,v,Z.x,Z.y)&&w(Z.prev,Z,Z.next)>=0)return!1;Z=Z.prevZ}for(;m&&m.z<=d;){if(m.x>=h&&m.x<=p&&m.y>=c&&m.y<=y&&m!==x&&m!==u&&M(o,a,f,l,s,v,m.x,m.y)&&w(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function h(e,t,n){var r=e;do{var x=r.prev,i=r.next.next;!m(x,i)&&A(x,r,r.next,i)&&z(x,i)&&z(i,x)&&(t.push(x.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),B(r),B(r.next),r=e=i),r=r.next}while(r!==e);return s(r)}function c(e,t,n,r,x,i){var u=e;do{for(var o=u.next.next;o!==u.prev;){if(u.i!==o.i&&Z(u,o)){var f=F(u,o);return u=s(u,u.next),f=s(f,f.next),a(u,t,n,r,x,i,0),void a(f,t,n,r,x,i,0)}o=o.next}u=u.next}while(u!==e)}function p(e,t){return e.x-t.x}function y(e,t){var n=function(e,t){var n,r=t,x=e.x,i=e.y,u=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var o=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=x&&o>u&&(u=o,n=r.x=r.x&&r.x>=a&&x!==r.x&&M(in.x||r.x===n.x&&g(n,r)))&&(n=r,v=f)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;var r=F(n,e);return s(r,r.next),s(n,n.next)}function g(e,t){return w(e.prev,e,t.prev)<0&&w(t.next,e,e.next)<0}function b(e,t,n,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*x|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*x|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function d(e){var t=e,n=e;do{(t.x=(e-u)*(i-o)&&(e-u)*(r-o)>=(n-u)*(t-o)&&(n-u)*(i-o)>=(x-u)*(r-o)}function Z(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&A(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(z(e,t)&&z(t,e)&&function(e,t){var n=e,r=!1,x=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&x<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(w(e.prev,e,t.prev)||w(e,t.prev,t))||m(e,t)&&w(e.prev,e,e.next)>0&&w(t.prev,t,t.next)>0)}function w(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function m(e,t){return e.x===t.x&&e.y===t.y}function A(e,t,n,r){var x=I(w(e,t,n)),i=I(w(e,t,r)),u=I(w(n,r,e)),o=I(w(n,r,t));return x!==i&&u!==o||(!(0!==x||!E(e,n,t))||(!(0!==i||!E(e,r,t))||(!(0!==u||!E(n,e,r))||!(0!==o||!E(n,t,r)))))}function E(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function I(e){return e>0?1:e<0?-1:0}function z(e,t){return w(e.prev,e,e.next)<0?w(e,t,e.next)>=0&&w(e,e.prev,t)>=0:w(e,t,e.prev)<0||w(e,e.next,t)<0}function F(e,t){var n=new _(e.i,e.x,e.y),r=new _(t.i,t.x,t.y),x=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=x,x.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function P(e,t,n,r){var x=new _(e,t,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function B(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var x=0,i=t,u=n-r;i0&&(r+=e[x-1].length,n.holes.push(r))}return n};var N=i(u.exports);const R=[],S={vertexPosition:0,indexPosition:0};function T(e,t,n,r,x){e[t+0]=n,e[t+1]=r,e[t+2]=x}function U(e,t,n,r,x,i){const u=3+x,o=e[t+0],f=e[t+1],s=R;s.length=x;for(let n=0;n0?f:2*Math.PI-f}let d=-1,M=-1,Z=l;const w=null!==i;if(null!==x){d=b(y,g,r(s,[...[e[x],e[x+1]]])),Math.cos(d)<=.985&&(Z+=Math.tan((d-Math.PI)/2))}if(w){M=b(g,y,r(s,[...[e[i],e[i+1]]])),Math.cos(M)<=.985&&(Z+=Math.tan((Math.PI-M)/2))}function m(e,t){return 0===t?1e4*e:Math.sign(t)*(1e4*e+Math.abs(t))}return u.push(c[0],c[1],p[0],p[1],d,M,a,m(0,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(1,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(2,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(3,l)),u.push(...f),o.push(h,h+1,h+2,h+1,h+3,h+2),{length:a+Math.sqrt((g[0]-y[0])*(g[0]-y[0])+(g[1]-y[1])*(g[1]-y[1])),angle:Z}}function G(e,t,n,r,x){const i=2+x;let u=t;const o=e.slice(u,u+x);u+=x;const f=e[u++];let s=0;const a=new Array(f-1);for(let t=0;t{const i=r.data;switch(i.type){case t:{const e=3,t=2,n=i.customAttributesSize,r=t+n,x=new Float32Array(i.renderInstructions),u=x.length/r,o=4*u*(n+e),f=new Uint32Array(6*u),s=new Float32Array(o);let a;for(let e=0;e0?c=o+(n-1)*r:l&&(c=i-r);let p=null;n"u"?"data:application/javascript;base64,"+Buffer.from(r,"binary").toString("base64"):URL.createObjectURL(new Blob([r],{type:"application/javascript"})))}function iI(r,t){const e=r.viewState.projection,n=t.getSource().getWrapX()&&e.canWrapX(),i=e.getExtent(),s=r.extent,o=n?mt(i):null,a=n?Math.ceil((s[2]-i[2])/o)+1:1;return[n?Math.floor((s[0]-i[0])/o):0,a,o]}class G_ extends Dh{constructor(t,e){const n=e.uniforms||{},i=ue();n[En.PROJECTION_MATRIX]=i,super(t,{uniforms:n,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.verticesBuffer_=new Ul(Fh,hu),this.indicesBuffer_=new Ul(Nh,hu),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=e.hitDetectionEnabled??!0;const s=e.attributes?e.attributes.map(function(a){return{name:"a_prop_"+a.name,size:1,type:tn.FLOAT}}):[];this.attributes=[{name:"a_position",size:2,type:tn.FLOAT},{name:"a_index",size:1,type:tn.FLOAT}],this.hitDetectionEnabled_&&(this.attributes.push({name:"a_prop_hitColor",size:4,type:tn.FLOAT}),this.attributes.push({name:"a_featureUid",size:1,type:tn.FLOAT})),this.attributes.push(...s),this.customAttributes=e.attributes?e.attributes:[],this.previousExtent_=je(),this.currentTransform_=i,this.renderTransform_=ue(),this.invertRenderTransform_=ue(),this.renderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.lastSentId=0,this.worker_=nI(),this.worker_.addEventListener("message",a=>{const l=a.data;if(l.type===bp.GENERATE_POINT_BUFFERS){const h=l.projectionTransform;this.verticesBuffer_.fromArrayBuffer(l.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.fromArrayBuffer(l.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=h,lh(this.invertRenderTransform_,this.renderTransform_),this.renderInstructions_=new Float32Array(a.data.renderInstructions),l.id===this.lastSentId&&(this.ready=!0),this.getLayer().changed()}}),this.featureCache_={},this.featureCount_=0;const o=this.getLayer().getSource();this.sourceListenKeys_=[se(o,Ne.ADDFEATURE,this.handleSourceFeatureAdded_,this),se(o,Ne.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),se(o,Ne.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),se(o,Ne.CLEAR,this.handleSourceFeatureClear_,this)],o.forEachFeature(a=>{this.featureCache_[tt(a)]={feature:a,properties:a.getProperties(),geometry:a.getGeometry()},this.featureCount_++})}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new jC(this.helper))}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[tt(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[tt(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[tt(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[n,i,s]=iI(t,this.getLayer());return this.renderWorlds(t,!1,n,i,s),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent),this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,n,i,s),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),this.helper.getCanvas()}prepareFrameInternal(t){const e=this.getLayer(),n=e.getSource(),i=t.viewState,s=!t.viewHints[Jt.ANIMATING]&&!t.viewHints[Jt.INTERACTING],o=!Nn(this.previousExtent_,t.extent),a=this.sourceRevision_t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){lt()}getAlpha(t,e){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;const i=e-n+1e3/60;return i>=this.transition_?1:l_(i/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}}function Xl(r){return r instanceof Image||r instanceof HTMLCanvasElement||r instanceof HTMLVideoElement||r instanceof ImageBitmap?r:null}function gu(r){return r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Float32Array||r instanceof DataView?r:null}let ns=null;function oI(r){ns||(ns=Ht(r.width,r.height,void 0,{willReadFrequently:!0}));const t=ns.canvas,e=r.width;t.width!==e&&(t.width=e);const n=r.height;return t.height!==n&&(t.height=n),ns.clearRect(0,0,e,n),ns.drawImage(r,0,0),ns.getImageData(0,0,e,n).data}const aI=[256,256];class Ud extends ro{constructor(t){const e=B.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null}getSize(){if(this.size_)return this.size_;const t=Xl(this.data_);return t?[t.width,t.height]:aI}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==B.IDLE&&this.state!==B.ERROR)return;this.state=B.LOADING,this.changed();const t=this;this.loader_().then(function(e){t.data_=e,t.state=B.LOADED,t.changed()}).catch(function(e){t.error_=e,t.state=B.ERROR,t.changed()})}}const lI=10,Rp=.25;class Bd{constructor(t,e,n,i,s,o){this.sourceProj_=t,this.targetProj_=e;let a={};const l=hn(this.targetProj_,this.sourceProj_);this.transformInv_=function(v){const w=v[0]+"/"+v[1];return a[w]||(a[w]=l(v)),a[w]},this.maxSourceExtent_=i,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&mt(i)>=mt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?mt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?mt(this.targetProj_.getExtent()):null;const h=zn(n),c=ya(n),u=hh(n),d=_a(n),g=this.transformInv_(h),f=this.transformInv_(c),p=this.transformInv_(u),_=this.transformInv_(d),y=lI+(o?Math.max(0,Math.ceil(Math.log2($o(n)/(o*o*256*256)))):0);if(this.addQuad_(h,c,u,d,g,f,p,_,y),this.wrapsXInSource_){let v=1/0;this.triangles_.forEach(function(w,S,E){v=Math.min(v,w.source[0][0],w.source[1][0],w.source[2][0])}),this.triangles_.forEach(w=>{if(Math.max(w.source[0][0],w.source[1][0],w.source[2][0])-v>this.sourceWorldWidth_/2){const S=[[w.source[0][0],w.source[0][1]],[w.source[1][0],w.source[1][1]],[w.source[2][0],w.source[2][1]]];S[0][0]-v>this.sourceWorldWidth_/2&&(S[0][0]-=this.sourceWorldWidth_),S[1][0]-v>this.sourceWorldWidth_/2&&(S[1][0]-=this.sourceWorldWidth_),S[2][0]-v>this.sourceWorldWidth_/2&&(S[2][0]-=this.sourceWorldWidth_);const E=Math.min(S[0][0],S[1][0],S[2][0]);Math.max(S[0][0],S[1][0],S[2][0])-E.5&&u<1;let f=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const _=Ls([t,e,n,i]);f=mt(_)/this.targetWorldWidth_>Rp||f}!g&&this.sourceProj_.isGlobal()&&u&&(f=u>Rp||f)}if(!f&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!Yt(c,this.maxSourceExtent_))return;let p=0;if(!f&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(h>0)f=!0;else if(p=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),p!=1&&p!=2&&p!=4&&p!=8)return}if(h>0){if(!f){const _=[(t[0]+n[0])/2,(t[1]+n[1])/2],y=this.transformInv_(_);let v;g?v=(an(s[0],d)+an(a[0],d))/2-an(y[0],d):v=(s[0]+a[0])/2-y[0];const w=(s[1]+a[1])/2-y[1];f=v*v+w*w>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const _=[(e[0]+n[0])/2,(e[1]+n[1])/2],y=this.transformInv_(_),v=[(i[0]+t[0])/2,(i[1]+t[1])/2],w=this.transformInv_(v);this.addQuad_(t,e,_,v,s,o,y,w,h-1),this.addQuad_(v,_,n,i,w,y,a,l,h-1)}else{const _=[(t[0]+e[0])/2,(t[1]+e[1])/2],y=this.transformInv_(_),v=[(n[0]+i[0])/2,(n[1]+i[1])/2],w=this.transformInv_(v);this.addQuad_(t,_,v,i,s,y,w,l,h-1),this.addQuad_(_,e,n,v,y,o,a,w,h-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}p&11||this.addTriangle_(t,n,i,s,a,l),p&14||this.addTriangle_(t,n,e,s,a,o),p&&(p&13||this.addTriangle_(e,i,t,o,l,s),p&7||this.addTriangle_(e,i,n,o,l,a))}calculateSourceExtent(){const t=je();return this.triangles_.forEach(function(e,n,i){const s=e.source;Po(t,s[0]),Po(t,s[1]),Po(t,s[2])}),t}getTriangles(){return this.triangles_}}let vc;const On=[];function Cp(r,t,e,n,i){r.beginPath(),r.moveTo(0,0),r.lineTo(t,e),r.lineTo(n,i),r.closePath(),r.save(),r.clip(),r.fillRect(0,0,Math.max(t,n)+1,Math.max(e,i)),r.restore()}function wc(r,t){return Math.abs(r[t*4]-210)>2||Math.abs(r[t*4+3]-.75*255)>2}function hI(){if(vc===void 0){const r=Ht(6,6,On);r.globalCompositeOperation="lighter",r.fillStyle="rgba(210, 0, 0, 0.75)",Cp(r,4,5,4,0),Cp(r,4,5,0,5);const t=r.getImageData(0,0,3,3).data;vc=wc(t,0)||wc(t,4)||wc(t,8),ki(r),On.push(r.canvas)}return vc}function oa(r,t,e,n){const i=ch(e,t,r);let s=nf(t,n,e);const o=t.getMetersPerUnit();o!==void 0&&(s*=o);const a=r.getMetersPerUnit();a!==void 0&&(s/=a);const l=r.getExtent();if(!l||yr(l,i)){const h=nf(r,s,i)/s;isFinite(h)&&h>0&&(s/=h)}return s}function j_(r,t,e,n){const i=Me(e);let s=oa(r,t,i,n);return(!isFinite(s)||s<=0)&&Fm(e,function(o){return s=oa(r,t,o,n),isFinite(s)&&s>0}),s}function Xd(r,t,e,n,i,s,o,a,l,h,c,u,d,g){const f=Ht(Math.round(e*r),Math.round(e*t),On);if(u||(f.imageSmoothingEnabled=!1),l.length===0)return f.canvas;f.scale(e,e);function p(E){return Math.round(E*e)/e}f.globalCompositeOperation="lighter";const _=je();l.forEach(function(E,T,M){Lm(_,E.extent)});let y;const v=e/n,w=(u?1:1+Math.pow(2,-24))/v;if(!d||l.length!==1||h!==0){if(y=Ht(Math.round(mt(_)*v),Math.round(qt(_)*v),On),u||(y.imageSmoothingEnabled=!1),i&&g){const E=(i[0]-_[0])*v,T=-(i[3]-_[3])*v,M=mt(i)*v,C=qt(i)*v;y.rect(E,T,M,C),y.clip()}l.forEach(function(E,T,M){const C=(E.extent[0]-_[0])*v,P=-(E.extent[3]-_[3])*v,G=mt(E.extent)*v,D=qt(E.extent)*v;E.image.width>0&&E.image.height>0&&y.drawImage(E.image,h,h,E.image.width-2*h,E.image.height-2*h,u?C:Math.round(C),u?P:Math.round(P),u?G:Math.round(C+G)-Math.round(C),u?D:Math.round(P+D)-Math.round(P))})}const S=zn(o);return a.getTriangles().forEach(function(E,T,M){const C=E.source,P=E.target;let G=C[0][0],D=C[0][1],z=C[1][0],m=C[1][1],x=C[2][0],b=C[2][1];const R=p((P[0][0]-S[0])/s),L=p(-(P[0][1]-S[1])/s),N=p((P[1][0]-S[0])/s),k=p(-(P[1][1]-S[1])/s),j=p((P[2][0]-S[0])/s),Z=p(-(P[2][1]-S[1])/s),Y=G,ot=D;G=0,D=0,z-=Y,m-=ot,x-=Y,b-=ot;const U=[[z,m,0,0,N-R],[x,b,0,0,j-R],[0,0,z,m,k-L],[0,0,x,b,Z-L]],nt=qx(U);if(!nt)return;if(f.save(),f.beginPath(),hI()||!u){f.moveTo(N,k);const _t=4,Lt=R-N,It=L-k;for(let Dt=0;Dt<_t;Dt++)f.lineTo(N+p((Dt+1)*Lt/_t),k+p(Dt*It/(_t-1))),Dt!=_t-1&&f.lineTo(N+p((Dt+1)*Lt/_t),k+p((Dt+1)*It/(_t-1)));f.lineTo(j,Z)}else f.moveTo(N,k),f.lineTo(R,L),f.lineTo(j,Z);f.clip(),f.transform(nt[0],nt[2],nt[1],nt[3],R,L),f.translate(_[0]-Y,_[3]-ot);let ut;if(y)ut=y.canvas,f.scale(w,-w);else{const _t=l[0],Lt=_t.extent;ut=_t.image,f.scale(mt(Lt)/ut.width,-qt(Lt)/ut.height)}f.drawImage(ut,0,0),f.restore()}),y&&(ki(y),On.push(y.canvas)),c&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(E,T,M){const C=E.target,P=(C[0][0]-S[0])/s,G=-(C[0][1]-S[1])/s,D=(C[1][0]-S[0])/s,z=-(C[1][1]-S[1])/s,m=(C[2][0]-S[0])/s,x=-(C[2][1]-S[1])/s;f.beginPath(),f.moveTo(D,z),f.lineTo(P,G),f.lineTo(m,x),f.closePath(),f.stroke()}),f.restore()),f.canvas}class Wd extends Ud{constructor(t){super({tileCoord:t.tileCoord,loader:()=>Promise.resolve(new Uint8Array(4)),interpolate:t.interpolate,transition:t.transition}),this.pixelRatio_=t.pixelRatio,this.gutter_=t.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=t.sourceTileGrid,this.targetTileGrid_=t.targetTileGrid,this.wrappedTileCoord_=t.wrappedTileCoord||t.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const e=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),n=this.targetTileGrid_.getExtent();let i=this.sourceTileGrid_.getExtent();const s=n?xe(e,n):e;if($o(s)===0){this.state=B.EMPTY;return}const o=t.sourceProj,a=o.getExtent();a&&(i?i=xe(i,a):i=a);const l=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),h=t.targetProj,c=j_(o,h,s,l);if(!isFinite(c)||c<=0){this.state=B.EMPTY;return}const u=t.errorThreshold!==void 0?t.errorThreshold:zd;if(this.triangulation_=new Bd(o,h,s,i,c*u,l),this.triangulation_.getTriangles().length===0){this.state=B.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(c);let d=this.triangulation_.calculateSourceExtent();if(i&&(o.canWrapX()?(d[1]=xt(d[1],i[1],i[3]),d[3]=xt(d[3],i[1],i[3])):d=xe(d,i)),!$o(d))this.state=B.EMPTY;else{const g=this.sourceTileGrid_.getTileRangeForExtentAndZ(d,this.sourceZ_),f=t.getTileFunction;for(let p=g.minX;p<=g.maxX;p++)for(let _=g.minY;_<=g.maxY;_++){const y=f(this.sourceZ_,p,_,this.pixelRatio_);y&&this.sourceTiles_.push(y)}this.sourceTiles_.length===0&&(this.state=B.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{if(!e||e.getState()!==B.LOADED)return;const n=e.getSize(),i=this.gutter_;let s;const o=gu(e.getData());o?s=o:s=oI(Xl(e.getData()));const a=[n[0]+2*i,n[1]+2*i],l=s instanceof Float32Array,h=a[0]*a[1],c=l?Float32Array:Uint8Array,u=new c(s.buffer),d=c.BYTES_PER_ELEMENT,g=d*u.length/h,f=u.byteLength/a[1],p=Math.floor(f/d/a[0]),_=h*p;let y=u;if(u.length!==_){y=new c(_);let v=0,w=0;const S=a[0]*p;for(let E=0;E=0;--g){const f=[];for(let S=0,E=t.length;S{const n=e.getState();if(n!==B.IDLE&&n!==B.LOADING)return;t++;const i=se(e,Ct.CHANGE,function(){const s=e.getState();(s==B.LOADED||s==B.ERROR||s==B.EMPTY)&&(ye(i),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(i)}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e){e.getState()==B.IDLE&&e.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(ye),this.sourcesListenerKeys_=null}}class zs extends ro{constructor(t,e,n,i,s,o,a,l,h,c,u,d){super(s,B.IDLE,d),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=i,this.wrappedTileCoord_=o||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const g=i.getTileCoordExtent(this.wrappedTileCoord_),f=this.targetTileGrid_.getExtent();let p=this.sourceTileGrid_.getExtent();const _=f?xe(g,f):g;if($o(_)===0){this.state=B.EMPTY;return}const y=t.getExtent();y&&(p?p=xe(p,y):p=y);const v=i.getResolution(this.wrappedTileCoord_[0]),w=j_(t,n,_,v);if(!isFinite(w)||w<=0){this.state=B.EMPTY;return}const S=c!==void 0?c:zd;if(this.triangulation_=new Bd(t,n,_,p,w*S,v),this.triangulation_.getTriangles().length===0){this.state=B.EMPTY;return}this.sourceZ_=e.getZForResolution(w);let E=this.triangulation_.calculateSourceExtent();if(p&&(t.canWrapX()?(E[1]=xt(E[1],p[1],p[3]),E[3]=xt(E[3],p[1],p[3])):E=xe(E,p)),!$o(E))this.state=B.EMPTY;else{const T=e.getTileRangeForExtentAndZ(E,this.sourceZ_);for(let M=T.minX;M<=T.maxX;M++)for(let C=T.minY;C<=T.maxY;C++){const P=h(this.sourceZ_,M,C,a);P&&this.sourceTiles_.push(P)}this.sourceTiles_.length===0&&(this.state=B.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{e&&e.getState()==B.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}),this.sourceTiles_.length=0,t.length===0)this.state=B.ERROR;else{const e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),i=typeof n=="number"?n:n[0],s=typeof n=="number"?n:n[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Xd(i,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=B.LOADED}this.changed()}load(){if(this.state==B.IDLE){this.state=B.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(e=>{const n=e.getState();if(n==B.IDLE||n==B.LOADING){t++;const i=se(e,Ct.CHANGE,function(s){const o=e.getState();(o==B.LOADED||o==B.ERROR||o==B.EMPTY)&&(ye(i),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(i)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,n,i){e.getState()==B.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(ye),this.sourcesListenerKeys_=null}release(){this.canvas_&&(ki(this.canvas_.getContext("2d")),On.push(this.canvas_),this.canvas_=null),super.release()}}class La extends ro{constructor(t,e,n,i,s,o){super(t,e,o),this.crossOrigin_=i,this.src_=n,this.key=n,this.image_=new Image,i!==null&&(this.image_.crossOrigin=i),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t,this.state=B.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=B.ERROR,this.unlistenImage_(),this.image_=cI(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=B.LOADED:this.state=B.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==B.ERROR&&(this.state=B.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==B.IDLE&&(this.state=B.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=SS(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function cI(){const r=Ht(1,1);return r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1),r.canvas}class uI extends fa{constructor(t){super(),this.tile,this.handleTileChange_=this.handleTileChange_.bind(this),this.gutter_=t.gutter||0,this.helper_=t.helper,this.loaded=!1,this.ready=!1}setTile(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(Ct.CHANGE,this.handleTileChange_),this.tile=t,this.loaded=t.getState()===B.LOADED,this.loaded)this.uploadTile();else{if(t instanceof La){const e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(Ct.CHANGE,this.handleTileChange_)}}uploadTile(){lt()}setReady(){this.ready=!0,this.dispatchEvent(Ct.CHANGE)}handleTileChange_(){this.tile.getState()===B.LOADED&&(this.loaded=!0,this.uploadTile())}disposeInternal(){this.tile.removeEventListener(Ct.CHANGE,this.handleTileChange_)}}function z_(r,t,e){const n=e?r.LINEAR:r.NEAREST;r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,n),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,n)}function dI(r,t,e,n){z_(r,t,n),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)}function Ip(r,t,e,n,i,s){const o=r.getGL();let a,l;e instanceof Float32Array?(a=o.FLOAT,r.getExtension("OES_texture_float"),l=r.getExtension("OES_texture_float_linear")!==null):(a=o.UNSIGNED_BYTE,l=!0),z_(o,t,s&&l);const h=e.byteLength/n[1];let c=1;h%8===0?c=8:h%4===0?c=4:h%2===0&&(c=2);let u;switch(i){case 1:{u=o.LUMINANCE;break}case 2:{u=o.LUMINANCE_ALPHA;break}case 3:{u=o.RGB;break}case 4:{u=o.RGBA;break}default:throw new Error(`Unsupported number of bands: ${i}`)}const d=o.getParameter(o.UNPACK_ALIGNMENT);o.pixelStorei(o.UNPACK_ALIGNMENT,c),o.texImage2D(o.TEXTURE_2D,0,u,n[0],n[1],0,u,a,e),o.pixelStorei(o.UNPACK_ALIGNMENT,d)}let ds=null;function gI(){ds=Ht(1,1,void 0,{willReadFrequently:!0})}class fI extends uI{constructor(t){super(t),this.textures=[],this.renderSize_=ee(t.grid.getTileSize(t.tile.tileCoord[0])),this.bandCount=NaN;const e=new Ul(Fh,jd);e.fromArray([0,1,1,1,1,0,0,0]),this.helper_.flushBufferData(e),this.coords=e,this.setTile(t.tile)}uploadTile(){const t=this.helper_,e=t.getGL(),n=this.tile;this.textures.length=0;let i;n instanceof La||n instanceof zs?i=n.getImage():i=n.getData();const s=Xl(i);if(s){const v=e.createTexture();this.textures.push(v),this.bandCount=4,dI(e,v,s,n.interpolate),this.setReady();return}i=gu(i);const o=n.getSize(),a=[o[0]+2*this.gutter_,o[1]+2*this.gutter_],l=i instanceof Float32Array,h=a[0]*a[1],c=l?Float32Array:Uint8Array,u=c.BYTES_PER_ELEMENT,d=i.byteLength/a[1];this.bandCount=Math.floor(d/u/a[0]);const g=Math.ceil(this.bandCount/4);if(g===1){const v=e.createTexture();this.textures.push(v),Ip(t,v,i,a,this.bandCount,n.interpolate),this.setReady();return}const f=new Array(g);for(let v=0;v0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const n=this.entries_[t];return Rt(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(t){const e=this.entries_[t];return Rt(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.key_;return t}getValues(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){var e;return(e=this.entries_[t])==null?void 0:e.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){Rt(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}class jh{constructor(t,e,n,i){this.minX=t,this.maxX=e,this.minY=n,this.maxY=i}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function is(r,t,e,n,i){return i!==void 0?(i.minX=r,i.maxX=t,i.minY=e,i.maxY=n,i):new jh(r,t,e,n)}function aa(r,t,e,n){return n!==void 0?(n[0]=r,n[1]=t,n[2]=e,n):[r,t,e]}function un(r,t,e){return r+"/"+t+"/"+e}function ei(r){return un(r[0],r[1],r[2])}function pI(r){const[t,e,n]=r.substring(r.lastIndexOf("/")+1,r.length).split(",").map(Number);return un(t,e,n)}function U_(r){return r.split("/").map(Number)}function qd(r){return(r[1]<e||e>t.getMaxZoom())return!1;const s=t.getFullTileRange(e);return s?s.containsXY(n,i):!0}const _I={TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",RENDER_EXTENT:"u_renderExtent",PATTERN_ORIGIN:"u_patternOrigin",RESOLUTION:"u_resolution",ZOOM:"u_zoom",GLOBAL_ALPHA:"u_globalAlpha",PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix"},yI={};function Pp(r){return 1/(r+2)}function xI(){return{tileIds:new Set,representationsByZ:{}}}function Ap(r,t){return r.tileIds.has(tt(t))}function Lp(r,t,e){const n=r.representationsByZ;e in n||(n[e]=new Set),n[e].add(t),r.tileIds.add(tt(t.tile))}function Sc(r,t){const e=r.layerStatesArray[r.layerIndex];e.extent&&(t=xe(t,kr(e.extent,r.viewState.projection)));const n=e.layer.getRenderSource();if(!n.getWrapX()){const i=n.getTileGridForProjection(r.viewState.projection).getExtent();i&&(t=xe(t,i))}return t}function fu(r,t){return`${r.getKey()},${ei(t)}`}class vI extends Dh{constructor(t,e){super(t,{uniforms:e.uniforms,postProcesses:e.postProcesses}),this.renderComplete=!1,this.tileTransform_=ue(),this.tempMat4=A_(),this.tempTileRange_=new jh(0,0,0,0),this.tempTileCoord_=aa(0,0,0),this.tempSize_=[0,0];const n=e.cacheSize!==void 0?e.cacheSize:512;this.tileRepresentationCache=new Zd(n),this.frameState=null,this.projection_=void 0}reset(t){super.reset({uniforms:t.uniforms})}isDrawableTile_(t){const e=this.getLayer(),n=t.getState(),i=e.getUseInterimTilesOnError();return n==B.LOADED||n==B.EMPTY||n==B.ERROR&&!i}prepareFrameInternal(t){this.projection_?t.viewState.projection!==this.projection_&&(this.clearCache(),this.projection_=t.viewState.projection):this.projection_=t.viewState.projection;const e=this.getLayer().getRenderSource();return!e||Un(Sc(t,t.extent))?!1:e.getState()==="ready"}createTileRepresentation(t){return lt()}enqueueTiles(t,e,n,i,s){const o=t.viewState,a=this.getLayer(),l=a.getRenderSource(),h=l.getTileGridForProjection(o.projection),c=l.getGutterForProjection(o.projection),u=tt(l);u in t.wantedTiles||(t.wantedTiles[u]={});const d=t.wantedTiles[u],g=this.tileRepresentationCache,f=a.getMapInternal(),p=Math.max(n-s,h.getMinZoom(),h.getZForResolution(Math.min(a.getMaxResolution(),f?f.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):h.getResolution(0)),l.zDirection));for(let _=n;_>=p;--_){const y=h.getTileRangeForExtentAndZ(e,_,this.tempTileRange_),v=h.getResolution(_);for(let w=y.minX;w<=y.maxX;++w)for(let S=y.minY;S<=y.maxY;++S){const E=aa(_,w,S,this.tempTileCoord_),T=fu(l,E);let M,C;if(g.containsKey(T)&&(M=g.get(T),C=M.tile),(!M||M.tile.key!==l.getKey())&&(C=l.getTile(_,w,S,t.pixelRatio,o.projection)),Ap(i,C))continue;if(!M)M=this.createTileRepresentation({tile:C,grid:h,helper:this.helper,gutter:c}),g.set(T,M);else if(this.isDrawableTile_(C))M.setTile(C);else{const G=C.getInterimTile();M.setTile(G)}Lp(i,M,_);const P=C.getKey();d[P]=!0,C.getState()===B.IDLE&&(t.tileQueue.isKeyQueued(P)||t.tileQueue.enqueue([C,u,h.getTileCoordCenter(E),v]))}}}beforeTilesRender(t,e){this.helper.prepareDraw(this.frameState,!e,!0)}beforeTilesMaskRender(t){return!1}renderTile(t,e,n,i,s,o,a,l,h,c,u){}renderTileMask(t,e,n,i){}drawTile_(t,e,n,i,s,o,a){if(!e.ready)return;const l=e.tile.tileCoord,h=ei(l),c=h in o?o[h]:1,u=a.getResolution(n),d=ee(a.getTileSize(n),this.tempSize_),g=a.getOrigin(n),f=a.getTileCoordExtent(l),p=c<1?-1:Pp(n);c<1&&(t.animate=!0);const _=t.viewState,y=_.center[0],v=_.center[1],w=d[0]+2*i,S=d[1]+2*i,E=w/S,T=(y-g[0])/(d[0]*u),M=(g[1]-v)/(d[1]*u),C=_.resolution/u,P=l[1],G=l[2];Gc(this.tileTransform_),Io(this.tileTransform_,2/(t.size[0]*C/w),-2/(t.size[1]*C/w)),Rx(this.tileTransform_,_.rotation),Io(this.tileTransform_,1,1/E),Lu(this.tileTransform_,(d[0]*(P-T)-i)/w,(d[1]*(G-M)-i)/S),this.renderTile(e,this.tileTransform_,t,s,u,d,g,f,p,i,c)}renderFrame(t){this.frameState=t,this.renderComplete=!0;const e=this.helper.getGL();this.preRender(e,t);const n=t.viewState,i=this.getLayer(),s=i.getRenderSource(),o=s.getTileGridForProjection(n.projection),a=s.getGutterForProjection(n.projection),l=Sc(t,t.extent),h=o.getZForResolution(n.resolution,s.zDirection),c=xI(),u=i.getPreload();if(t.nextExtent){const E=o.getZForResolution(n.nextResolution,s.zDirection),T=Sc(t,t.nextExtent);this.enqueueTiles(t,T,E,c,u)}this.enqueueTiles(t,l,h,c,0),u>0&&setTimeout(()=>{this.enqueueTiles(t,l,h-1,c,u-1)},0);const d={},g=tt(this),f=t.time;let p=!1;for(const E of c.representationsByZ[h]){const T=E.tile;if((T instanceof zs||T instanceof Wd)&&T.getState()===B.EMPTY)continue;const M=T.tileCoord;if(E.ready){const P=T.getAlpha(g,f);if(P===1){T.endTransition(g);continue}p=!0;const G=ei(M);d[G]=P}if(this.renderComplete=!1,this.findAltTiles_(o,M,h+1,c))continue;const C=o.getMinZoom();for(let P=h-1;P>=C&&!this.findAltTiles_(o,M,P,c);--P);}const _=c.representationsByZ,y=Object.keys(_).map(Number).sort(xx);if(this.beforeTilesMaskRender(t))for(let E=0,T=y.length;Ee.dispose()),t.clear()}removeHelper(){this.helper&&this.clearCache(),super.removeHelper()}disposeInternal(){super.disposeInternal(),delete this.frameState}}const wt={..._I,TILE_TEXTURE_ARRAY:"u_tileTextures",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY"},gl={TEXTURE_COORD:"a_textureCoord"},wI=[{name:gl.TEXTURE_COORD,size:2,type:tn.FLOAT}];class SI extends vI{constructor(t,e){super(t,e),this.program_,this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.indices_=new Ul(Nh,jd),this.indices_.fromArray([0,1,3,1,2,3]),this.paletteTextures_=e.paletteTextures||[]}reset(t){super.reset(t),this.vertexShader_=t.vertexShader,this.fragmentShader_=t.fragmentShader,this.paletteTextures_=t.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)}createTileRepresentation(t){return new fI(t)}beforeTilesRender(t,e){super.beforeTilesRender(t,e),this.helper.useProgram(this.program_,t)}renderTile(t,e,n,i,s,o,a,l,h,c,u){const d=this.helper.getGL();this.helper.bindBuffer(t.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(wI);let g=0;for(;g0&&(S=l,xe(S,i,S)),this.helper.setUniformFloatVec4(wt.RENDER_EXTENT,S),this.helper.setUniformFloatValue(wt.RESOLUTION,f.resolution),this.helper.setUniformFloatValue(wt.ZOOM,f.zoom),this.helper.setUniformFloatValue(wt.TEXTURE_PIXEL_WIDTH,p),this.helper.setUniformFloatValue(wt.TEXTURE_PIXEL_HEIGHT,_),this.helper.setUniformFloatValue(wt.TEXTURE_RESOLUTION,s),this.helper.setUniformFloatValue(wt.TEXTURE_ORIGIN_X,a[0]+v*o[0]*s-c*s),this.helper.setUniformFloatValue(wt.TEXTURE_ORIGIN_Y,a[1]-w*o[1]*s+c*s),this.helper.drawElements(0,this.indices_.getSize())}getData(t){if(!this.helper.getGL())return null;const e=this.frameState;if(!e)return null;const n=this.getLayer(),i=ie(e.pixelToCoordinateTransform,t.slice()),s=e.viewState,o=n.getExtent();if(o&&!yr(kr(o,s.projection),i))return null;const a=n.getSources(Ls([i]),s.resolution);let l,h,c;for(l=a.length-1;l>=0;--l)if(h=a[l],h.getState()==="ready"){if(c=h.getTileGridForProjection(s.projection),h.getWrapX())break;const d=c.getExtent();if(!d||yr(d,i))break}if(l<0)return null;const u=this.tileRepresentationCache;for(let d=c.getZForResolution(s.resolution);d>=c.getMinZoom();--d){const g=c.getTileCoordForCoordAndZ(i,d),f=fu(h,g);if(!u.containsKey(f))continue;const p=u.get(f),_=p.tile;if((_ instanceof zs||_ instanceof Wd)&&_.getState()===B.EMPTY)return null;if(!p.loaded)continue;const y=c.getOrigin(d),v=ee(c.getTileSize(d)),w=c.getResolution(d),S=(i[0]-y[0])/w-g[1]*v[0],E=(y[1]-i[1])/w-g[2]*v[1];return p.getPixelData(S,E)}return null}disposeInternal(){const t=this.helper;t&&(t.getGL().deleteProgram(this.program_),delete this.program_,t.deleteBuffer(this.indices_)),super.disposeInternal(),delete this.indices_}}function EI(r,t){return`operator_${r}_${Object.keys(t.functions).length}`}function Oi(r){const t=r.toString();return t.includes(".")?t:t+".0"}function $d(r){if(r.length<2||r.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${r.length}(${r.map(Oi).join(", ")})`}function fl(r){const t=Br(r),e=t.length>3?t[3]:1;return $d([t[0]/255*e,t[1]/255*e,t[2]/255*e,e])}const Ec={};let bI=0;function Wl(r){return r in Ec||(Ec[r]=bI++),Ec[r]}function Mn(r){return Oi(Wl(r))}function Vd(r){return"u_var_"+r}function TI(){return{inFragmentShader:!1,variables:{},properties:{},functions:{},bandCount:0,style:{}}}const bc="getBandValue",B_="u_paletteTextures";function MI(r,t,e,n){const i=zt(r,e,t);if(Ca(i.type,Vi))throw new Error("No matching type was found");if(!Gr(t,i.type)){const s=ve(t),o=ve(i.type);throw new Error(`Expected expression to be of type ${s}, got ${o}`)}return Yd(i,t,n)}function Ft(r){return(t,e,n)=>{const i=e.args.length,s=new Array(i);for(let o=0;o{const e=t.args[0].value;return e in r.properties||(r.properties[e]={name:e,type:t.type}),(r.inFragmentShader?"v_prop_":"a_prop_")+e},[F.GeometryType]:(r,t,e)=>{const n="geometryType";return n in r.properties||(r.properties[n]={name:n,type:_e,evaluator:i=>Fd(i.getGeometry())}),(r.inFragmentShader?"v_prop_":"a_prop_")+n},[F.Var]:(r,t)=>{const e=t.args[0].value;return e in r.variables||(r.variables[e]={name:e,type:t.type}),Vd(e)},[F.Resolution]:()=>"u_resolution",[F.Zoom]:()=>"u_zoom",[F.Time]:()=>"u_time",[F.Any]:Ft(r=>`(${r.join(" || ")})`),[F.All]:Ft(r=>`(${r.join(" && ")})`),[F.Not]:Ft(([r])=>`(!${r})`),[F.Equal]:Ft(([r,t])=>`(${r} == ${t})`),[F.NotEqual]:Ft(([r,t])=>`(${r} != ${t})`),[F.GreaterThan]:Ft(([r,t])=>`(${r} > ${t})`),[F.GreaterThanOrEqualTo]:Ft(([r,t])=>`(${r} >= ${t})`),[F.LessThan]:Ft(([r,t])=>`(${r} < ${t})`),[F.LessThanOrEqualTo]:Ft(([r,t])=>`(${r} <= ${t})`),[F.Multiply]:Ft(r=>`(${r.join(" * ")})`),[F.Divide]:Ft(([r,t])=>`(${r} / ${t})`),[F.Add]:Ft(r=>`(${r.join(" + ")})`),[F.Subtract]:Ft(([r,t])=>`(${r} - ${t})`),[F.Clamp]:Ft(([r,t,e])=>`clamp(${r}, ${t}, ${e})`),[F.Mod]:Ft(([r,t])=>`mod(${r}, ${t})`),[F.Pow]:Ft(([r,t])=>`pow(${r}, ${t})`),[F.Abs]:Ft(([r])=>`abs(${r})`),[F.Floor]:Ft(([r])=>`floor(${r})`),[F.Ceil]:Ft(([r])=>`ceil(${r})`),[F.Round]:Ft(([r])=>`floor(${r} + 0.5)`),[F.Sin]:Ft(([r])=>`sin(${r})`),[F.Cos]:Ft(([r])=>`cos(${r})`),[F.Atan]:Ft(([r,t])=>t!==void 0?`atan(${r}, ${t})`:`atan(${r})`),[F.Sqrt]:Ft(([r])=>`sqrt(${r})`),[F.Match]:Ft(r=>{const t=r[0],e=r[r.length-1];let n=null;for(let i=r.length-3;i>=1;i-=2){const s=r[i],o=r[i+1];n=`(${t} == ${s} ? ${o} : ${n||e})`}return n}),[F.Between]:Ft(([r,t,e])=>`(${r} >= ${t} && ${r} <= ${e})`),[F.Interpolate]:Ft(([r,t,...e])=>{let n="";for(let i=0;i{const t=r[r.length-1];let e=null;for(let n=r.length-3;n>=0;n-=2){const i=r[n],s=r[n+1];e=`(${i} ? ${s} : ${e||t})`}return e}),[F.In]:Ft(([r,...t],e)=>{const n=EI("in",e),i=[];for(let s=0;s`vec${r.length}(${r.join(", ")})`),[F.Color]:Ft(r=>{if(r.length===1)return`vec4(vec3(${r[0]} / 255.0), 1.0)`;if(r.length===2)return`(${r[1]} * vec4(vec3(${r[0]} / 255.0), 1.0))`;const t=r.slice(0,3).map(e=>`${e} / 255.0`);return r.length===3?`vec4(${t.join(", ")}, 1.0)`:`(${r[3]} * vec4(${t.join(", ")}, 1.0))`}),[F.Band]:Ft(([r,t,e],n)=>{if(!(bc in n.functions)){let i="";const s=n.bandCount||1;for(let o=0;o{const[e,...n]=t.args,i=n.length,s=new Uint8Array(i*4);for(let h=0;h0)return Oi(r.value);if((r.type&Kt)>0)return r.value.toString();if((r.type&_e)>0)return Mn(r.value.toString());if((r.type&Ut)>0)return fl(r.value);if((r.type&de)>0)return $d(r.value);throw new Error(`Unexpected expression ${r.value} (expected type ${ve(t)})`)}function CI(){return{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"#3399CC","stroke-width":1.25,"circle-radius":5,"circle-fill-color":"rgba(255,255,255,0.4)","circle-stroke-width":1.25,"circle-stroke-color":"#3399CC"}}const ss=`#ifdef GL_FRAGMENT_PRECISION_HIGH -precision highp float; -#else -precision mediump float; -#endif -uniform mat4 u_projectionMatrix; -uniform mat4 u_screenToWorldMatrix; -uniform vec2 u_viewportSizePx; -uniform float u_pixelRatio; -uniform float u_globalAlpha; -uniform float u_time; -uniform float u_zoom; -uniform float u_resolution; -uniform float u_rotation; -uniform vec4 u_renderExtent; -uniform vec2 u_patternOrigin; -uniform float u_depth; -uniform mediump int u_hitDetection; - -const float PI = 3.141592653589793238; -const float TWO_PI = 2.0 * PI; - -// this used to produce an alpha-premultiplied color from a texture -vec4 samplePremultiplied(sampler2D sampler, vec2 texCoord) { - vec4 color = texture2D(sampler, texCoord); - return vec4(color.rgb * color.a, color.a); -} -`,os=CI();class X_{constructor(){this.uniforms_=[],this.attributes_=[],this.varyings_=[],this.hasSymbol_=!1,this.symbolSizeExpression_=`vec2(${Oi(os["circle-radius"])} + ${Oi(os["circle-stroke-width"]*.5)})`,this.symbolRotationExpression_="0.0",this.symbolOffsetExpression_="vec2(0.0)",this.symbolColorExpression_=fl(os["circle-fill-color"]),this.texCoordExpression_="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression_="false",this.symbolRotateWithView_=!1,this.hasStroke_=!1,this.strokeWidthExpression_=Oi(os["stroke-width"]),this.strokeColorExpression_=fl(os["stroke-color"]),this.strokeOffsetExpression_="0.",this.strokeCapExpression_=Mn("round"),this.strokeJoinExpression_=Mn("round"),this.strokeMiterLimitExpression_="10.",this.strokeDistanceFieldExpression_="-1000.",this.hasFill_=!1,this.fillColorExpression_=fl(os["fill-color"]),this.vertexShaderFunctions_=[],this.fragmentShaderFunctions_=[]}addUniform(t){return this.uniforms_.push(t),this}addAttribute(t){return this.attributes_.push(t),this}addVarying(t,e,n){return this.varyings_.push({name:t,type:e,expression:n}),this}setSymbolSizeExpression(t){return this.hasSymbol_=!0,this.symbolSizeExpression_=t,this}getSymbolSizeExpression(){return this.symbolSizeExpression_}setSymbolRotationExpression(t){return this.symbolRotationExpression_=t,this}setSymbolOffsetExpression(t){return this.symbolOffsetExpression_=t,this}getSymbolOffsetExpression(){return this.symbolOffsetExpression_}setSymbolColorExpression(t){return this.hasSymbol_=!0,this.symbolColorExpression_=t,this}getSymbolColorExpression(){return this.symbolColorExpression_}setTextureCoordinateExpression(t){return this.texCoordExpression_=t,this}setFragmentDiscardExpression(t){return this.discardExpression_=t,this}getFragmentDiscardExpression(){return this.discardExpression_}setSymbolRotateWithView(t){return this.symbolRotateWithView_=t,this}setStrokeWidthExpression(t){return this.hasStroke_=!0,this.strokeWidthExpression_=t,this}setStrokeColorExpression(t){return this.hasStroke_=!0,this.strokeColorExpression_=t,this}getStrokeColorExpression(){return this.strokeColorExpression_}setStrokeOffsetExpression(t){return this.strokeOffsetExpression_=t,this}setStrokeCapExpression(t){return this.strokeCapExpression_=t,this}setStrokeJoinExpression(t){return this.strokeJoinExpression_=t,this}setStrokeMiterLimitExpression(t){return this.strokeMiterLimitExpression_=t,this}setStrokeDistanceFieldExpression(t){return this.strokeDistanceFieldExpression_=t,this}setFillColorExpression(t){return this.hasFill_=!0,this.fillColorExpression_=t,this}getFillColorExpression(){return this.fillColorExpression_}addVertexShaderFunction(t){this.vertexShaderFunctions_.includes(t)||this.vertexShaderFunctions_.push(t)}addFragmentShaderFunction(t){this.fragmentShaderFunctions_.includes(t)||this.fragmentShaderFunctions_.push(t)}getSymbolVertexShader(){return this.hasSymbol_?`${ss} -${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` -`)} -attribute vec2 a_position; -attribute float a_index; -attribute vec4 a_prop_hitColor; -${this.attributes_.map(function(t){return"attribute "+t+";"}).join(` -`)} -varying vec2 v_texCoord; -varying vec2 v_quadCoord; -varying vec4 v_prop_hitColor; -varying vec2 v_centerPx; -varying float v_angle; -varying vec2 v_quadSizePx; -${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` -`)} -${this.vertexShaderFunctions_.join(` -`)} -vec2 pxToScreen(vec2 coordPx) { - vec2 scaled = coordPx / u_viewportSizePx / 0.5; - return scaled; -} - -vec2 screenToPx(vec2 coordScreen) { - return (coordScreen * 0.5 + 0.5) * u_viewportSizePx; -} - -void main(void) { - v_quadSizePx = ${this.symbolSizeExpression_}; - vec2 halfSizePx = v_quadSizePx * 0.5; - vec2 centerOffsetPx = ${this.symbolOffsetExpression_}; - vec2 offsetPx = centerOffsetPx; - if (a_index == 0.0) { - offsetPx -= halfSizePx; - } else if (a_index == 1.0) { - offsetPx += halfSizePx * vec2(1., -1.); - } else if (a_index == 2.0) { - offsetPx += halfSizePx; - } else { - offsetPx += halfSizePx * vec2(-1., 1.); - } - float angle = ${this.symbolRotationExpression_}; - ${this.symbolRotateWithView_?"angle += u_rotation;":""} - float c = cos(-angle); - float s = sin(-angle); - offsetPx = vec2(c * offsetPx.x - s * offsetPx.y, s * offsetPx.x + c * offsetPx.y); - vec4 center = u_projectionMatrix * vec4(a_position, 0.0, 1.0); - gl_Position = center + vec4(pxToScreen(offsetPx), u_depth, 0.); - vec4 texCoord = ${this.texCoordExpression_}; - float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p; - float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q; - v_texCoord = vec2(u, v); - v_prop_hitColor = a_prop_hitColor; - v_angle = angle; - c = cos(-v_angle); - s = sin(-v_angle); - centerOffsetPx = vec2(c * centerOffsetPx.x - s * centerOffsetPx.y, s * centerOffsetPx.x + c * centerOffsetPx.y); - v_centerPx = screenToPx(center.xy) + centerOffsetPx; -${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(` -`)} -}`:null}getSymbolFragmentShader(){return this.hasSymbol_?`${ss} -${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` -`)} -varying vec2 v_texCoord; -varying vec4 v_prop_hitColor; -varying vec2 v_centerPx; -varying float v_angle; -varying vec2 v_quadSizePx; -${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` -`)} -${this.fragmentShaderFunctions_.join(` -`)} - -void main(void) { - if (${this.discardExpression_}) { discard; } - vec2 coordsPx = gl_FragCoord.xy / u_pixelRatio - v_centerPx; // relative to center - float c = cos(v_angle); - float s = sin(v_angle); - coordsPx = vec2(c * coordsPx.x - s * coordsPx.y, s * coordsPx.x + c * coordsPx.y); - gl_FragColor = ${this.symbolColorExpression_}; - if (u_hitDetection > 0) { - if (gl_FragColor.a < 0.05) { discard; }; - gl_FragColor = v_prop_hitColor; - } -}`:null}getStrokeVertexShader(){return this.hasStroke_?`${ss} -${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` -`)} -attribute vec2 a_position; -attribute float a_index; -attribute vec2 a_segmentStart; -attribute vec2 a_segmentEnd; -attribute float a_parameters; -attribute float a_distance; -attribute vec2 a_joinAngles; -attribute vec4 a_prop_hitColor; -${this.attributes_.map(function(t){return"attribute "+t+";"}).join(` -`)} -varying vec2 v_segmentStart; -varying vec2 v_segmentEnd; -varying float v_angleStart; -varying float v_angleEnd; -varying float v_width; -varying vec4 v_prop_hitColor; -varying float v_distanceOffsetPx; -${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` -`)} -${this.vertexShaderFunctions_.join(` -`)} -vec2 worldToPx(vec2 worldPos) { - vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0); - return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx; -} - -vec4 pxToScreen(vec2 pxPos) { - vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0; - return vec4(screenPos, u_depth, 1.0); -} - -bool isCap(float joinAngle) { - return joinAngle < -0.1; -} - -vec2 getJoinOffsetDirection(vec2 normalPx, float joinAngle) { - float halfAngle = joinAngle / 2.0; - float c = cos(halfAngle); - float s = sin(halfAngle); - vec2 angleBisectorNormal = vec2(s * normalPx.x + c * normalPx.y, -c * normalPx.x + s * normalPx.y); - float length = 1.0 / s; - return angleBisectorNormal * length; -} - -vec2 getOffsetPoint(vec2 point, vec2 normal, float joinAngle, float offsetPx) { - // if on a cap or the join angle is too high, offset the line along the segment normal - if (cos(joinAngle) > 0.998 || isCap(joinAngle)) { - return point - normal * offsetPx; - } - // offset is applied along the inverted normal (positive offset goes "right" relative to line direction) - return point - getJoinOffsetDirection(normal, joinAngle) * offsetPx; -} - -void main(void) { - v_angleStart = a_joinAngles.x; - v_angleEnd = a_joinAngles.y; - float vertexNumber = floor(abs(a_parameters) / 10000. + 0.5); - // we're reading the fractional part while keeping the sign (so -4.12 gives -0.12, 3.45 gives 0.45) - float angleTangentSum = fract(abs(a_parameters) / 10000.) * 10000. * sign(a_parameters); - - float lineWidth = ${this.strokeWidthExpression_}; - float lineOffsetPx = ${this.strokeOffsetExpression_}; - - // compute segment start/end in px with offset - vec2 segmentStartPx = worldToPx(a_segmentStart); - vec2 segmentEndPx = worldToPx(a_segmentEnd); - vec2 tangentPx = normalize(segmentEndPx - segmentStartPx); - vec2 normalPx = vec2(-tangentPx.y, tangentPx.x); - segmentStartPx = getOffsetPoint(segmentStartPx, normalPx, v_angleStart, lineOffsetPx), - segmentEndPx = getOffsetPoint(segmentEndPx, normalPx, v_angleEnd, lineOffsetPx); - - // compute current vertex position - float normalDir = vertexNumber < 0.5 || (vertexNumber > 1.5 && vertexNumber < 2.5) ? 1.0 : -1.0; - float tangentDir = vertexNumber < 1.5 ? 1.0 : -1.0; - float angle = vertexNumber < 1.5 ? v_angleStart : v_angleEnd; - vec2 joinDirection; - vec2 positionPx = vertexNumber < 1.5 ? segmentStartPx : segmentEndPx; - // if angle is too high, do not make a proper join - if (cos(angle) > ${Mp} || isCap(angle)) { - joinDirection = normalPx * normalDir - tangentPx * tangentDir; - } else { - joinDirection = getJoinOffsetDirection(normalPx * normalDir, angle); - } - positionPx = positionPx + joinDirection * (lineWidth * 0.5 + 1.); // adding 1 pixel for antialiasing - gl_Position = pxToScreen(positionPx); - - v_segmentStart = segmentStartPx; - v_segmentEnd = segmentEndPx; - v_width = lineWidth; - v_prop_hitColor = a_prop_hitColor; - v_distanceOffsetPx = a_distance / u_resolution - (lineOffsetPx * angleTangentSum); -${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(` -`)} -}`:null}getStrokeFragmentShader(){return this.hasStroke_?`${ss} -${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` -`)} -varying vec2 v_segmentStart; -varying vec2 v_segmentEnd; -varying float v_angleStart; -varying float v_angleEnd; -varying float v_width; -varying vec4 v_prop_hitColor; -varying float v_distanceOffsetPx; -${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` -`)} -${this.fragmentShaderFunctions_.join(` -`)} - -vec2 pxToWorld(vec2 pxPos) { - vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0; - return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy; -} - -bool isCap(float joinAngle) { - return joinAngle < -0.1; -} - -float segmentDistanceField(vec2 point, vec2 start, vec2 end, float width) { - vec2 tangent = normalize(end - start); - vec2 normal = vec2(-tangent.y, tangent.x); - vec2 startToPoint = point - start; - return abs(dot(startToPoint, normal)) - width * 0.5; -} - -float buttCapDistanceField(vec2 point, vec2 start, vec2 end) { - vec2 startToPoint = point - start; - vec2 tangent = normalize(end - start); - return dot(startToPoint, -tangent); -} - -float squareCapDistanceField(vec2 point, vec2 start, vec2 end, float width) { - return buttCapDistanceField(point, start, end) - width * 0.5; -} - -float roundCapDistanceField(vec2 point, vec2 start, vec2 end, float width) { - float onSegment = max(0., 1000. * dot(point - start, end - start)); // this is very high when inside the segment - return length(point - start) - width * 0.5 - onSegment; -} - -float roundJoinDistanceField(vec2 point, vec2 start, vec2 end, float width) { - return roundCapDistanceField(point, start, end, width); -} - -float bevelJoinField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) { - vec2 startToPoint = point - start; - vec2 tangent = normalize(end - start); - float c = cos(joinAngle * 0.5); - float s = sin(joinAngle * 0.5); - float direction = -sign(sin(joinAngle)); - vec2 bisector = vec2(c * tangent.x - s * tangent.y, s * tangent.x + c * tangent.y); - float radius = width * 0.5 * s; - return dot(startToPoint, bisector * direction) - radius; -} - -float miterJoinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) { - if (cos(joinAngle) > ${Mp}) { // avoid risking a division by zero - return bevelJoinField(point, start, end, width, joinAngle); - } - float miterLength = 1. / sin(joinAngle * 0.5); - float miterLimit = ${this.strokeMiterLimitExpression_}; - if (miterLength > miterLimit) { - return bevelJoinField(point, start, end, width, joinAngle); - } - return -1000.; -} - -float capDistanceField(vec2 point, vec2 start, vec2 end, float width, float capType) { - if (capType == ${Mn("butt")}) { - return buttCapDistanceField(point, start, end); - } else if (capType == ${Mn("square")}) { - return squareCapDistanceField(point, start, end, width); - } - return roundCapDistanceField(point, start, end, width); -} - -float joinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float joinType) { - if (joinType == ${Mn("bevel")}) { - return bevelJoinField(point, start, end, width, joinAngle); - } else if (joinType == ${Mn("miter")}) { - return miterJoinDistanceField(point, start, end, width, joinAngle); - } - return roundJoinDistanceField(point, start, end, width); -} - -float computeSegmentPointDistance(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float capType, float joinType) { - if (isCap(joinAngle)) { - return capDistanceField(point, start, end, width, capType); - } - return joinDistanceField(point, start, end, width, joinAngle, joinType); -} - -void main(void) { - vec2 currentPoint = gl_FragCoord.xy / u_pixelRatio; - #ifdef GL_FRAGMENT_PRECISION_HIGH - vec2 worldPos = pxToWorld(currentPoint); - if ( - abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && ( - worldPos[0] < u_renderExtent[0] || - worldPos[1] < u_renderExtent[1] || - worldPos[0] > u_renderExtent[2] || - worldPos[1] > u_renderExtent[3] - ) - ) { - discard; - } - #endif - if (${this.discardExpression_}) { discard; } - - float segmentLength = length(v_segmentEnd - v_segmentStart); - vec2 segmentTangent = (v_segmentEnd - v_segmentStart) / segmentLength; - vec2 segmentNormal = vec2(-segmentTangent.y, segmentTangent.x); - vec2 startToPoint = currentPoint - v_segmentStart; - float currentLengthPx = max(0., min(dot(segmentTangent, startToPoint), segmentLength)) + v_distanceOffsetPx; - float currentRadiusPx = abs(dot(segmentNormal, startToPoint)); - float currentRadiusRatio = dot(segmentNormal, startToPoint) * 2. / v_width; - vec4 color = ${this.strokeColorExpression_} * u_globalAlpha; - float capType = ${this.strokeCapExpression_}; - float joinType = ${this.strokeJoinExpression_}; - float segmentStartDistance = computeSegmentPointDistance(currentPoint, v_segmentStart, v_segmentEnd, v_width, v_angleStart, capType, joinType); - float segmentEndDistance = computeSegmentPointDistance(currentPoint, v_segmentEnd, v_segmentStart, v_width, v_angleEnd, capType, joinType); - float distance = max( - segmentDistanceField(currentPoint, v_segmentStart, v_segmentEnd, v_width), - max(segmentStartDistance, segmentEndDistance) - ); - distance = max(distance, ${this.strokeDistanceFieldExpression_}); - gl_FragColor = color * smoothstep(0.5, -0.5, distance); - if (u_hitDetection > 0) { - if (gl_FragColor.a < 0.1) { discard; }; - gl_FragColor = v_prop_hitColor; - } -}`:null}getFillVertexShader(){return this.hasFill_?`${ss} -${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` -`)} -attribute vec2 a_position; -attribute vec4 a_prop_hitColor; -${this.attributes_.map(function(t){return"attribute "+t+";"}).join(` -`)} -varying vec4 v_prop_hitColor; -${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` -`)} -${this.vertexShaderFunctions_.join(` -`)} -void main(void) { - gl_Position = u_projectionMatrix * vec4(a_position, u_depth, 1.0); - v_prop_hitColor = a_prop_hitColor; -${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(` -`)} -}`:null}getFillFragmentShader(){return this.hasFill_?`${ss} -${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` -`)} -varying vec4 v_prop_hitColor; -${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` -`)} -${this.fragmentShaderFunctions_.join(` -`)} -vec2 pxToWorld(vec2 pxPos) { - vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0; - return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy; -} - -vec2 worldToPx(vec2 worldPos) { - vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0); - return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx; -} - -void main(void) { - vec2 pxPos = gl_FragCoord.xy / u_pixelRatio; - vec2 pxOrigin = worldToPx(u_patternOrigin); - #ifdef GL_FRAGMENT_PRECISION_HIGH - vec2 worldPos = pxToWorld(pxPos); - if ( - abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && ( - worldPos[0] < u_renderExtent[0] || - worldPos[1] < u_renderExtent[1] || - worldPos[0] > u_renderExtent[2] || - worldPos[1] > u_renderExtent[3] - ) - ) { - discard; - } - #endif - if (${this.discardExpression_}) { discard; } - gl_FragColor = ${this.fillColorExpression_} * u_globalAlpha; - if (u_hitDetection > 0) { - if (gl_FragColor.a < 0.1) { discard; }; - gl_FragColor = v_prop_hitColor; - } -}`:null}}const Fr={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},II=["#00f","#0ff","#0f0","#ff0","#f00"];class PI extends Pa{constructor(t){t=t||{};const e=Object.assign({},t);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,super(e),this.gradient_=null,this.addChangeListener(Fr.GRADIENT,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:II),this.setBlur(t.blur!==void 0?t.blur:15),this.setRadius(t.radius!==void 0?t.radius:8);const n=t.weight?t.weight:"weight";typeof n=="string"?this.weightFunction_=function(i){return i.get(n)}:this.weightFunction_=n,this.setRenderOrder(null)}getBlur(){return this.get(Fr.BLUR)}getGradient(){return this.get(Fr.GRADIENT)}getRadius(){return this.get(Fr.RADIUS)}handleGradientChanged_(){this.gradient_=AI(this.getGradient())}setBlur(t){this.set(Fr.BLUR,t)}setGradient(t){this.set(Fr.GRADIENT,t)}setRadius(t){this.set(Fr.RADIUS,t)}createRenderer(){const t=new X_().addAttribute("float a_prop_weight").addVarying("v_prop_weight","float","a_prop_weight").addUniform("float u_size").addUniform("float u_blurSlope").setSymbolSizeExpression("vec2(u_size)").setSymbolColorExpression("vec4(smoothstep(0., 1., (1. - length(coordsPx * 2. / v_quadSizePx)) * u_blurSlope) * v_prop_weight)");return new G_(this,{className:this.getClassName(),attributes:[{name:"weight",callback:e=>{const n=this.weightFunction_(e);return n!==void 0?xt(n,0,1):1}}],uniforms:{u_size:()=>(this.get(Fr.RADIUS)+this.get(Fr.BLUR))*2,u_blurSlope:()=>this.get(Fr.RADIUS)/Math.max(1,this.get(Fr.BLUR))},hitDetectionEnabled:!0,vertexShader:t.getSymbolVertexShader(),fragmentShader:t.getSymbolFragmentShader(),postProcesses:[{fragmentShader:` - precision mediump float; - - uniform sampler2D u_image; - uniform sampler2D u_gradientTexture; - uniform float u_opacity; - - varying vec2 v_texCoord; - - void main() { - vec4 color = texture2D(u_image, v_texCoord); - gl_FragColor.a = color.a * u_opacity; - gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb; - gl_FragColor.rgb *= gl_FragColor.a; - }`,uniforms:{u_gradientTexture:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}renderDeclutter(){}}function AI(r){const t=Ht(1,256),e=t.createLinearGradient(0,0,1,256),n=1/(r.length-1);for(let i=0,s=r.length;i=a.width)return null;const c=qt(o),u=Math.floor(a.height*((o[3]-i[1])/c));return u<0||u>=a.height?null:this.getImageData(a,h,u)}renderFrame(t,e){const n=this.image_,i=n.getExtent(),s=n.getResolution(),[o,a]=Array.isArray(s)?s:[s,s],l=n.getPixelRatio(),h=t.layerStatesArray[t.layerIndex],c=t.pixelRatio,u=t.viewState,d=u.center,g=u.resolution,f=c*o/(g*l),p=c*a/(g*l),_=t.extent,y=u.resolution,v=u.rotation,w=Math.round(mt(_)/y*c),S=Math.round(qt(_)/y*c);ar(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/c,1/c,v,-w/2,-S/2),lh(this.inversePixelTransform,this.pixelTransform);const E=Ou(this.pixelTransform);this.useContainer(e,E,this.getBackground(t));const T=this.getRenderContext(t),M=this.context.canvas;M.width!=w||M.height!=S?(M.width=w,M.height=S):this.containerReused||T.clearRect(0,0,w,S);let C=!1,P=!0;if(h.extent){const x=kr(h.extent,u.projection);P=Yt(x,t.extent),C=P&&!Ze(x,t.extent),C&&this.clipUnrotated(T,t,x)}const G=n.getImage(),D=ar(this.tempTransform,w/2,S/2,f,p,0,l*(i[0]-d[0])/o,l*(d[1]-i[3])/a);this.renderedResolution=a*c/l;const z=G.width*D[0],m=G.height*D[3];if(this.getLayer().getSource().getInterpolate()||(T.imageSmoothingEnabled=!1),this.preRender(T,t),P&&z>=.5&&m>=.5){const x=D[4],b=D[5],R=h.opacity;R!==1&&(T.save(),T.globalAlpha=R),T.drawImage(G,0,0,+G.width,+G.height,x,b,z,m),R!==1&&T.restore()}return this.postRender(this.context,t),C&&T.restore(),T.imageSmoothingEnabled=!0,E!==M.style.transform&&(M.style.transform=E),this.container}}class Hd extends OI{constructor(t){super(t)}createRenderer(){return new W_(this)}getData(t){return super.getData(t)}}const ai={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class Z_ extends Ra{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(ai.PRELOAD)}setPreload(t){this.set(ai.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(ai.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(ai.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}class q_ extends kd{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=je(),this.tmpTileRange_=new jh(0,0,0,0)}isDrawableTile(t){const e=this.getLayer(),n=t.getState(),i=e.getUseInterimTilesOnError();return n==B.LOADED||n==B.EMPTY||n==B.ERROR&&!i}getTile(t,e,n,i){const s=i.pixelRatio,o=i.viewState.projection,a=this.getLayer();let l=a.getSource().getTile(t,e,n,s,o);return l.getState()==B.ERROR&&a.getUseInterimTilesOnError()&&a.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(l)||(l=l.getInterimTile()),l}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),i=ie(e.pixelToCoordinateTransform,t.slice()),s=n.getExtent();if(s&&!yr(s,i))return null;const o=e.pixelRatio,a=e.viewState.projection,l=e.viewState,h=n.getRenderSource(),c=h.getTileGridForProjection(l.projection),u=h.getTilePixelRatio(e.pixelRatio);for(let d=c.getZForResolution(l.resolution);d>=c.getMinZoom();--d){const g=c.getTileCoordForCoordAndZ(i,d),f=h.getTile(d,g[1],g[2],o,a);if(!(f instanceof La||f instanceof zs)||f instanceof zs&&f.getState()===B.EMPTY)return null;if(f.getState()!==B.LOADED)continue;const p=c.getOrigin(d),_=ee(c.getTileSize(d)),y=c.getResolution(d),v=Math.floor(u*((i[0]-p[0])/y-g[1]*_[0])),w=Math.floor(u*((p[1]-i[1])/y-g[2]*_[1])),S=Math.round(u*h.getGutterForProjection(l.projection));return this.getImageData(f.getImage(),v+S,w+S)}return null}loadedTileCallback(t,e,n){return this.isDrawableTile(n)?super.loadedTileCallback(t,e,n):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){const n=t.layerStatesArray[t.layerIndex],i=t.viewState,s=i.projection,o=i.resolution,a=i.center,l=i.rotation,h=t.pixelRatio,c=this.getLayer(),u=c.getSource(),d=u.getRevision(),g=u.getTileGridForProjection(s),f=g.getZForResolution(o,u.zDirection),p=g.getResolution(f);let _=t.extent;const y=t.viewState.resolution,v=u.getTilePixelRatio(h),w=Math.round(mt(_)/y*h),S=Math.round(qt(_)/y*h),E=n.extent&&kr(n.extent);E&&(_=xe(_,kr(n.extent)));const T=p*w/2/v,M=p*S/2/v,C=[a[0]-T,a[1]-M,a[0]+T,a[1]+M],P=g.getTileRangeForExtentAndZ(_,f),G={};G[f]={};const D=this.createLoadedTileFinder(u,s,G),z=this.tmpExtent,m=this.tmpTileRange_;this.newTiles_=!1;const x=l?zc(i.center,y,l,t.size):void 0;for(let ot=P.minX;ot<=P.maxX;++ot)for(let U=P.minY;U<=P.maxY;++U){if(l&&!g.tileCoordIntersectsViewport([f,ot,U],x))continue;const nt=this.getTile(f,ot,U,t);if(this.isDrawableTile(nt)){const Lt=tt(this);if(nt.getState()==B.LOADED){G[f][nt.tileCoord.toString()]=nt;let It=nt.inTransition(Lt);It&&n.opacity!==1&&(nt.endTransition(Lt),It=!1),!this.newTiles_&&(It||!this.renderedTiles.includes(nt))&&(this.newTiles_=!0)}if(nt.getAlpha(Lt,t.time)===1)continue}const ut=g.getTileCoordChildTileRange(nt.tileCoord,m,z);let _t=!1;ut&&(_t=D(f+1,ut)),_t||g.forEachTileCoordParentTileRange(nt.tileCoord,D,m,z)}const b=p/o*h/v;ar(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,l,-w/2,-S/2);const R=Ou(this.pixelTransform);this.useContainer(e,R,this.getBackground(t));const L=this.getRenderContext(t),N=this.context.canvas;lh(this.inversePixelTransform,this.pixelTransform),ar(this.tempTransform,w/2,S/2,b,b,0,-w/2,-S/2),N.width!=w||N.height!=S?(N.width=w,N.height=S):this.containerReused||L.clearRect(0,0,w,S),E&&this.clipUnrotated(L,t,E),u.getInterpolate()||(L.imageSmoothingEnabled=!1),this.preRender(L,t),this.renderedTiles.length=0;let k=Object.keys(G).map(Number);k.sort(on);let j,Z,Y;n.opacity===1&&(!this.containerReused||u.getOpaque(t.viewState.projection))?k=k.reverse():(j=[],Z=[]);for(let ot=k.length-1;ot>=0;--ot){const U=k[ot],nt=u.getTilePixelSize(U,h,s),ut=g.getResolution(U)/p,_t=nt[0]*ut*b,Lt=nt[1]*ut*b,It=g.getTileCoordForCoordAndZ(zn(C),U),Dt=g.getTileCoordExtent(It),$t=ie(this.tempTransform,[v*(Dt[0]-C[0])/p,v*(C[3]-Dt[3])/p]),me=v*u.getGutterForProjection(s),Oe=G[U];for(const dr in Oe){const ge=Oe[dr],qr=ge.tileCoord,Ba=It[1]-qr[1],Yh=Math.round($t[0]-(Ba-1)*_t),Xa=It[2]-qr[2],Wa=Math.round($t[1]-(Xa-1)*Lt),gr=Math.round($t[0]-Ba*_t),Ar=Math.round($t[1]-Xa*Lt),$r=Yh-gr,Lr=Wa-Ar,Hi=f===U,Ki=Hi&&ge.getAlpha(tt(this),t.time)!==1;let qn=!1;if(!Ki)if(j){Y=[gr,Ar,gr+$r,Ar,gr+$r,Ar+Lr,gr,Ar+Lr];for(let pn=0,Hh=j.length;pn{if(_.getState()!==J.LOADED)return;this.image_=p?null:_;const y=_.getPixelRatio(),v=ql(_.getResolution())*e/y;this.renderedResolution=v,this.coordinateToVectorPixelTransform_=ar(this.coordinateToVectorPixelTransform_,l/2,h/2,1/v,-1/v,0,-n.center[0],-n.center[1])}),_.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice()),!!this.image_}preRender(){}postRender(){}renderDeclutter(){}forEachFeatureAtCoordinate(t,e,n,i,s){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,e,n,i,s):super.forEachFeatureAtCoordinate(t,e,n,i,s)}}class NI extends Pa{constructor(t){t=t||{};const e=Object.assign({},t);delete e.imageRatio,super(e),this.imageRatio_=t.imageRatio!==void 0?t.imageRatio:1}getImageRatio(){return this.imageRatio_}createRenderer(){return new FI(this)}}const DI=NI,kI={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},Op={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class GI extends q_{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=ue(),this.tileClipContexts_=null}prepareTile(t,e,n){let i;const s=t.getState();return(s===B.LOADED||s===B.ERROR)&&(this.updateExecutorGroup_(t,e,n),this.tileImageNeedsRender_(t)&&(i=!0)),i}getTile(t,e,n,i){const s=i.pixelRatio,o=i.viewState,a=o.resolution,l=o.projection,h=this.getLayer(),c=h.getSource().getTile(t,e,n,s,l),u=i.viewHints,d=!(u[Jt.ANIMATING]||u[Jt.INTERACTING]);return(d||!c.wantedResolution)&&(c.wantedResolution=a),this.prepareTile(c,s,l)&&(d||Date.now()-i.time<8)&&h.getRenderMode()!=="vector"&&this.renderTileImage_(c,i),super.getTile(t,e,n,i)}isDrawableTile(t){const e=this.getLayer();return super.isDrawableTile(t)&&(e.getRenderMode()==="vector"?tt(e)in t.executorGroups:t.hasContext(e))}getTileImage(t){return t.getImage(this.getLayer())}prepareFrame(t){const e=this.getLayer().getRevision();return this.renderedLayerRevision_!==e&&(this.renderedLayerRevision_=e,this.renderedTiles.length=0),super.prepareFrame(t)}updateExecutorGroup_(t,e,n){var i;const s=this.getLayer(),o=s.getRevision(),a=s.getRenderOrder()||null,l=t.wantedResolution,h=t.getReplayState(s);if(!h.dirty&&h.renderedResolution===l&&h.renderedRevision==o&&h.renderedRenderOrder==a)return;const c=s.getSource(),u=!!s.getDeclutter(),d=c.getTileGrid(),g=c.getTileGridForProjection(n).getTileCoordExtent(t.wrappedTileCoord),f=c.getSourceTiles(e,n,t),p=tt(s);delete t.hitDetectionImageData[p],t.executorGroups[p]=[],h.dirty=!1;for(let _=0,y=f.length;_{const M=E?e.declutter[E].all().map(C=>C.value):null;for(let C=0,P=T.length;C{const i=this.getLayer(),s=tt(i),o=i.getSource(),a=this.renderedProjection,l=a.getExtent(),h=this.renderedResolution,c=o.getTileGridForProjection(a),u=ie(this.renderedPixelToCoordinateTransform_,t.slice()),d=c.getTileCoordForCoordAndResolution(u,h);let g;for(let w=0,S=this.renderedTiles.length;w0){e([]);return}const f=c.getTileCoordExtent(g.wrappedTileCoord),p=zn(f),_=[(u[0]-p[0])/h,(p[1]-u[1])/h],y=g.getSourceTiles().reduce(function(w,S){return w.concat(S.getFeatures())},[]);let v=g.hitDetectionImageData[s];if(!v){const w=ee(c.getTileSize(c.getZForResolution(h,o.zDirection))),S=this.renderedRotation_,E=[this.getRenderTransform(c.getTileCoordCenter(g.wrappedTileCoord),h,0,mr,w[0]*mr,w[1]*mr,0)];v=S_(w,E,y,i.getStyleFunction(),c.getTileCoordExtent(g.wrappedTileCoord),g.getReplayState(i).renderedResolution,S),g.hitDetectionImageData[s]=v}e(E_(_,y,v))})}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.renderedLayerRevision_!==void 0&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}renderDeclutter(t,e){const n=this.context,i=n.globalAlpha;n.globalAlpha=e.opacity;const s=t.viewHints,o=!(s[Jt.ANIMATING]||s[Jt.INTERACTING]),a=this.renderedTiles;for(let l=0,h=a.length;l=0;--g)u[g].execute(this.context,[this.context.canvas.width,this.context.canvas.height],this.getTileRenderTransform(c,t),t.viewState.rotation,o,Gl,d?t.declutter[d]:void 0)}n.globalAlpha=i}renderDeferredInternal(t){const e=this.renderedTiles.reduce((i,s,o)=>(s.executorGroups[tt(this.getLayer())].forEach(a=>i.push({executorGroup:a,index:o})),i),[]),n=e.map(({executorGroup:i})=>i.getDeferredZIndexContexts());n.map(i=>Object.keys(i)).flat().sort(on).map(Number).forEach(i=>{n.forEach((s,o)=>{s[i]&&s[i].forEach(a=>{const{executorGroup:l,index:h}=e[o],c=l.getRenderedContext(),u=c.globalAlpha;c.globalAlpha=this.renderedOpacity_;const d=this.tileClipContexts_[h];d&&d.draw(c),a.draw(c),d&&c.restore(),c.globalAlpha=u,a.clear()})})})}getTileRenderTransform(t,e){const n=e.pixelRatio,i=e.viewState,s=i.center,o=i.resolution,a=i.rotation,l=e.size,h=Math.round(l[0]*n),c=Math.round(l[1]*n),u=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),d=t.tileCoord,g=u.getTileCoordExtent(t.wrappedTileCoord),f=u.getTileCoordExtent(d,this.tmpExtent)[0]-g[0];return $s(Io(this.inversePixelTransform.slice(),1/n,1/n),this.getRenderTransform(s,o,a,n,h,c,f))}postRender(t,e){const n=e.viewHints,i=!(n[Jt.ANIMATING]||n[Jt.INTERACTING]);this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation,this.renderedOpacity_=e.layerStatesArray[e.layerIndex].opacity;const s=this.getLayer(),o=s.getRenderMode(),a=t.globalAlpha;t.globalAlpha=this.renderedOpacity_;const l=s.getDeclutter(),h=l?Op[o].filter(w=>!Gl.includes(w)):Op[o],c=e.viewState,u=c.rotation,d=s.getSource(),g=d.getTileGridForProjection(c.projection).getZForResolution(c.resolution,d.zDirection),f=this.renderedTiles,p=[],_=[],y=[];let v=!0;for(let w=f.length-1;w>=0;--w){const S=f[w];v=v&&!S.getReplayState(s).dirty;const E=S.executorGroups[tt(s)].filter(z=>z.hasExecutors(h));if(E.length===0)continue;const T=this.getTileRenderTransform(S,e),M=S.tileCoord[0];let C=!1;const P=E[0].getClipCoords(T);let G=t,D;if(P){l&&(D=new Dd,G=D.getContext());for(let z=0,m=p.length;z1?`vec${t}`:"float"}function $l(r){return(JSON.stringify(r).split("").reduce((t,e)=>(t<<5)-t+e.charCodeAt(0),0)>>>0).toString()}function Jd(r,t,e,n){if(`${n}radius`in r&&n!=="icon-"){let i=pt(e,r[`${n}radius`],V);if(`${n}radius2`in r){const s=pt(e,r[`${n}radius2`],V);i=`max(${i}, ${s})`}`${n}stroke-width`in r&&(i=`(${i} + ${pt(e,r[`${n}stroke-width`],V)} * 0.5)`),t.setSymbolSizeExpression(`vec2(${i} * 2. + 0.5)`)}if(`${n}scale`in r){const i=pt(e,r[`${n}scale`],V|de);t.setSymbolSizeExpression(`${t.getSymbolSizeExpression()} * ${i}`)}`${n}displacement`in r&&t.setSymbolOffsetExpression(pt(e,r[`${n}displacement`],de)),`${n}rotation`in r&&t.setSymbolRotationExpression(pt(e,r[`${n}rotation`],V)),`${n}rotate-with-view`in r&&t.setSymbolRotateWithView(!!r[`${n}rotate-with-view`])}function Y_(r,t,e,n,i){let s="vec4(0.)";if(t!==null&&(s=t),e!==null&&n!==null){const l=`smoothstep(-${n} + 0.63, -${n} - 0.58, ${r})`;s=`mix(${e}, ${s}, ${l})`}const o=`(1.0 - smoothstep(-0.63, 0.58, ${r}))`;let a=`${s} * ${o}`;return i!==null&&(a=`${a} * ${i}`),a}function Qd(r,t,e,n,i){const s=new Image;let o;return s.crossOrigin=r[`${n}cross-origin`]===void 0?"anonymous":r[`${n}cross-origin`],s.src=r[`${n}src`],s.complete&&s.width&&s.height?o=$d([s.width,s.height]):(e[`u_texture${i}_size`]=()=>s.complete?[s.width,s.height]:[0,0],t.addUniform(`vec2 u_texture${i}_size`),o=`u_texture${i}_size`),e[`u_texture${i}`]=s,t.addUniform(`sampler2D u_texture${i}`),o}function tg(r,t,e,n,i){let s=pt(e,r[`${t}offset`],de);if(`${t}offset-origin`in r)switch(r[`${t}offset-origin`]){case"top-right":s=`vec2(${n}.x, 0.) + ${i} * vec2(-1., 0.) + ${s} * vec2(-1., 1.)`;break;case"bottom-left":s=`vec2(0., ${n}.y) + ${i} * vec2(0., -1.) + ${s} * vec2(1., -1.)`;break;case"bottom-right":s=`${n} - ${i} - ${s}`;break}return s}function zI(r,t,e,n,i){i.functions.circleDistanceField=`float circleDistanceField(vec2 point, float radius) { - return length(point) - radius; -}`,Jd(r,t,n,"circle-");let s=null;"circle-opacity"in r&&(s=pt(i,r["circle-opacity"],V));let o="coordsPx";"circle-scale"in r&&(o=`coordsPx / ${pt(i,r["circle-scale"],V|de)}`);let a=null;"circle-fill-color"in r&&(a=pt(i,r["circle-fill-color"],Ut));let l=null;"circle-stroke-color"in r&&(l=pt(i,r["circle-stroke-color"],Ut));let h=pt(i,r["circle-radius"],V),c=null;"circle-stroke-width"in r&&(c=pt(i,r["circle-stroke-width"],V),h=`(${h} + ${c} * 0.5)`);const u=`circleDistanceField(${o}, ${h})`,d=Y_(u,a,l,c,s);t.setSymbolColorExpression(d)}function UI(r,t,e,n,i){i.functions.round=`float round(float v) { - return sign(v) * floor(abs(v) + 0.5); -}`,i.functions.starDistanceField=`float starDistanceField(vec2 point, float numPoints, float radius, float radius2, float angle) { - float startAngle = -PI * 0.5 + angle; // tip starts upwards and rotates clockwise with angle - float c = cos(startAngle); - float s = sin(startAngle); - vec2 pointRotated = vec2(c * point.x - s * point.y, s * point.x + c * point.y); - float alpha = TWO_PI / numPoints; // the angle of one sector - float beta = atan(pointRotated.y, pointRotated.x); - float gamma = round(beta / alpha) * alpha; // angle in sector - c = cos(-gamma); - s = sin(-gamma); - vec2 inSector = vec2(c * pointRotated.x - s * pointRotated.y, abs(s * pointRotated.x + c * pointRotated.y)); - vec2 tipToPoint = inSector + vec2(-radius, 0.); - vec2 edgeNormal = vec2(radius2 * sin(alpha * 0.5), -radius2 * cos(alpha * 0.5) + radius); - return dot(normalize(edgeNormal), tipToPoint); -}`,i.functions.regularDistanceField=`float regularDistanceField(vec2 point, float numPoints, float radius, float angle) { - float startAngle = -PI * 0.5 + angle; // tip starts upwards and rotates clockwise with angle - float c = cos(startAngle); - float s = sin(startAngle); - vec2 pointRotated = vec2(c * point.x - s * point.y, s * point.x + c * point.y); - float alpha = TWO_PI / numPoints; // the angle of one sector - float radiusIn = radius * cos(PI / numPoints); - float beta = atan(pointRotated.y, pointRotated.x); - float gamma = round((beta - alpha * 0.5) / alpha) * alpha + alpha * 0.5; // angle in sector from mid - c = cos(-gamma); - s = sin(-gamma); - vec2 inSector = vec2(c * pointRotated.x - s * pointRotated.y, abs(s * pointRotated.x + c * pointRotated.y)); - return inSector.x - radiusIn; -}`,Jd(r,t,n,"shape-");let s=null;"shape-opacity"in r&&(s=pt(i,r["shape-opacity"],V));let o="coordsPx";"shape-scale"in r&&(o=`coordsPx / ${pt(i,r["shape-scale"],V|de)}`);let a=null;"shape-fill-color"in r&&(a=pt(i,r["shape-fill-color"],Ut));let l=null;"shape-stroke-color"in r&&(l=pt(i,r["shape-stroke-color"],Ut));let h=null;"shape-stroke-width"in r&&(h=pt(i,r["shape-stroke-width"],V));const c=pt(i,r["shape-points"],V);let u="0.";"shape-angle"in r&&(u=pt(i,r["shape-angle"],V));let d,g=pt(i,r["shape-radius"],V);if(h!==null&&(g=`${g} + ${h} * 0.5`),"shape-radius2"in r){let p=pt(i,r["shape-radius2"],V);h!==null&&(p=`${p} + ${h} * 0.5`),d=`starDistanceField(${o}, ${c}, ${g}, ${p}, ${u})`}else d=`regularDistanceField(${o}, ${c}, ${g}, ${u})`;const f=Y_(d,a,l,h,s);t.setSymbolColorExpression(f)}function BI(r,t,e,n,i){let s="vec4(1.0)";"icon-color"in r&&(s=pt(i,r["icon-color"],Ut)),"icon-opacity"in r&&(s=`${s} * ${pt(i,r["icon-opacity"],V)}`);const o=$l(r["icon-src"]),a=Qd(r,t,e,"icon-",o);if(t.setSymbolColorExpression(`${s} * samplePremultiplied(u_texture${o}, v_texCoord)`).setSymbolSizeExpression(a),"icon-width"in r&&"icon-height"in r&&t.setSymbolSizeExpression(`vec2(${pt(n,r["icon-width"],V)}, ${pt(n,r["icon-height"],V)})`),"icon-offset"in r&&"icon-size"in r){const l=pt(n,r["icon-size"],de),h=t.getSymbolSizeExpression();t.setSymbolSizeExpression(l);const c=tg(r,"icon-",n,"v_quadSizePx",l);t.setTextureCoordinateExpression(`(vec4((${c}).xyxy) + vec4(0., 0., ${l})) / (${h}).xyxy`)}if(Jd(r,t,n,"icon-"),"icon-anchor"in r){const l=pt(n,r["icon-anchor"],de);let h="1.0";"icon-scale"in r&&(h=pt(n,r["icon-scale"],V|de));let c;r["icon-anchor-x-units"]==="pixels"&&r["icon-anchor-y-units"]==="pixels"?c=`${l} * ${h}`:r["icon-anchor-x-units"]==="pixels"?c=`${l} * vec2(vec2(${h}).x, v_quadSizePx.y)`:r["icon-anchor-y-units"]==="pixels"?c=`${l} * vec2(v_quadSizePx.x, vec2(${h}).x)`:c=`${l} * v_quadSizePx`;let u=`v_quadSizePx * vec2(0.5, -0.5) + ${c} * vec2(-1., 1.)`;if("icon-anchor-origin"in r)switch(r["icon-anchor-origin"]){case"top-right":u=`v_quadSizePx * -0.5 + ${c}`;break;case"bottom-left":u=`v_quadSizePx * 0.5 - ${c}`;break;case"bottom-right":u=`v_quadSizePx * vec2(-0.5, 0.5) + ${c} * vec2(1., -1.)`;break}t.setSymbolOffsetExpression(`${t.getSymbolOffsetExpression()} + ${u}`)}}function XI(r,t,e,n,i){if("stroke-color"in r&&t.setStrokeColorExpression(pt(i,r["stroke-color"],Ut)),"stroke-pattern-src"in r){const s=$l(r["stroke-pattern-src"]),o=Qd(r,t,e,"stroke-pattern-",s);let a=o,l="vec2(0.)";"stroke-pattern-offset"in r&&"stroke-pattern-size"in r&&(a=pt(i,r["stroke-pattern-size"],de),l=tg(r,"stroke-pattern-",i,o,a));let h="0.";"stroke-pattern-spacing"in r&&(h=pt(i,r["stroke-pattern-spacing"],V)),i.functions.sampleStrokePattern=`vec4 sampleStrokePattern(sampler2D texture, vec2 textureSize, vec2 textureOffset, vec2 sampleSize, float spacingPx, float currentLengthPx, float currentRadiusRatio, float lineWidth) { - float currentLengthScaled = currentLengthPx * sampleSize.y / lineWidth; - float spacingScaled = spacingPx * sampleSize.y / lineWidth; - float uCoordPx = mod(currentLengthScaled, (sampleSize.x + spacingScaled)); - // make sure that we're not sampling too close to the borders to avoid interpolation with outside pixels - uCoordPx = clamp(uCoordPx, 0.5, sampleSize.x - 0.5); - float vCoordPx = (-currentRadiusRatio * 0.5 + 0.5) * sampleSize.y; - vec2 texCoord = (vec2(uCoordPx, vCoordPx) + textureOffset) / textureSize; - return samplePremultiplied(texture, texCoord); -}`;const c=`u_texture${s}`;let u="1.";"stroke-color"in r&&(u=t.getStrokeColorExpression()),t.setStrokeColorExpression(`${u} * sampleStrokePattern(${c}, ${o}, ${l}, ${a}, ${h}, currentLengthPx, currentRadiusRatio, v_width)`)}if("stroke-width"in r&&t.setStrokeWidthExpression(pt(n,r["stroke-width"],V)),"stroke-offset"in r&&t.setStrokeOffsetExpression(pt(n,r["stroke-offset"],V)),"stroke-line-cap"in r&&t.setStrokeCapExpression(pt(n,r["stroke-line-cap"],_e)),"stroke-line-join"in r&&t.setStrokeJoinExpression(pt(n,r["stroke-line-join"],_e)),"stroke-miter-limit"in r&&t.setStrokeMiterLimitExpression(pt(n,r["stroke-miter-limit"],V)),"stroke-line-dash"in r){i.functions.getSingleDashDistance=`float getSingleDashDistance(float distance, float radius, float dashOffset, float dashLength, float dashLengthTotal, float capType) { - float localDistance = mod(distance, dashLengthTotal); - float distanceSegment = abs(localDistance - dashOffset - dashLength * 0.5) - dashLength * 0.5; - distanceSegment = min(distanceSegment, dashLengthTotal - localDistance); - if (capType == ${Mn("square")}) { - distanceSegment -= v_width * 0.5; - } else if (capType == ${Mn("round")}) { - distanceSegment = min(distanceSegment, sqrt(distanceSegment * distanceSegment + radius * radius) - v_width * 0.5); - } - return distanceSegment; -}`;let s=r["stroke-line-dash"].map(d=>pt(i,d,V));s.length%2===1&&(s=[...s,...s]);let o="0.";"stroke-line-dash-offset"in r&&(o=pt(n,r["stroke-line-dash-offset"],V));const a=`dashDistanceField_${$l(r["stroke-line-dash"])}`,l=s.map((d,g)=>`float dashLength${g} = ${d};`),h=s.map((d,g)=>`dashLength${g}`).join(" + ");let c="0.",u=`getSingleDashDistance(distance, radius, ${c}, dashLength0, totalDashLength, capType)`;for(let d=2;dWl(r.variables[a.name]):a.type===Ut?h=()=>Fp([...Br(r.variables[a.name]||"#eee")]):a.type===Kt?h=()=>r.variables[a.name]?1:0:h=()=>r.variables[a.name],i[l]=h}),Object.keys(e.properties).forEach(function(o){const a=e.properties[o];t.properties[o]||(t.properties[o]=a);let l=Tc(a.type),h=`a_prop_${a.name}`;a.type===Ut&&(l="vec4",h=`unpackColor(${h})`,n.addVertexShaderFunction(jI)),n.addVarying(`v_prop_${a.name}`,l,h)}),Object.keys(t.properties).forEach(function(o){const a=t.properties[o];n.addAttribute(`${Tc(a.type)} a_prop_${a.name}`)});const s=Object.keys(t.properties).map(function(o){const a=t.properties[o];let l;return a.evaluator?l=a.evaluator:a.type===_e?l=h=>Wl(h.get(a.name)):a.type===Ut?l=h=>Fp([...Br(h.get(a.name)||"#eee")]):a.type===Kt?l=h=>h.get(a.name)?1:0:l=h=>h.get(a.name),{name:a.name,size:V_(a.type),callback:l}});for(const o in t.functions)n.addVertexShaderFunction(t.functions[o]);for(const o in e.functions)n.addFragmentShaderFunction(e.functions[o]);return{builder:n,attributes:s.reduce((o,a)=>({...o,[a.name]:{callback:a.callback,size:a.size}}),{}),uniforms:i}}class qI extends Ra{constructor(t){const e=Object.assign({},t);super(e),this.parseResult_=ZI(t.style),this.styleVariables_=t.style.variables||{},this.hitDetectionDisabled_=!!t.disableHitDetection}createRenderer(){const t=Object.keys(this.parseResult_.attributes).map(e=>({name:e,...this.parseResult_.attributes[e]}));return new G_(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitDetectionEnabled:!this.hitDetectionDisabled_,uniforms:this.parseResult_.uniforms,attributes:t})}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}}const $I=qI;function Np(r,t){const e=` - attribute vec2 ${gl.TEXTURE_COORD}; - uniform mat4 ${wt.TILE_TRANSFORM}; - uniform float ${wt.TEXTURE_PIXEL_WIDTH}; - uniform float ${wt.TEXTURE_PIXEL_HEIGHT}; - uniform float ${wt.TEXTURE_RESOLUTION}; - uniform float ${wt.TEXTURE_ORIGIN_X}; - uniform float ${wt.TEXTURE_ORIGIN_Y}; - uniform float ${wt.DEPTH}; - - varying vec2 v_textureCoord; - varying vec2 v_mapCoord; - - void main() { - v_textureCoord = ${gl.TEXTURE_COORD}; - v_mapCoord = vec2( - ${wt.TEXTURE_ORIGIN_X} + ${wt.TEXTURE_RESOLUTION} * ${wt.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0], - ${wt.TEXTURE_ORIGIN_Y} - ${wt.TEXTURE_RESOLUTION} * ${wt.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1] - ); - gl_Position = ${wt.TILE_TRANSFORM} * vec4(${gl.TEXTURE_COORD}, ${wt.DEPTH}, 1.0); - } - `,n={...TI(),inFragmentShader:!0,bandCount:t,style:r},i=[];if(r.color!==void 0){const u=pt(n,r.color,Ut);i.push(`color = ${u};`)}if(r.contrast!==void 0){const u=pt(n,r.contrast,V);i.push(`color.rgb = clamp((${u} + 1.0) * color.rgb - (${u} / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(r.exposure!==void 0){const u=pt(n,r.exposure,V);i.push(`color.rgb = clamp((${u} + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(r.saturation!==void 0){const u=pt(n,r.saturation,V);i.push(` - float saturation = ${u} + 1.0; - float sr = (1.0 - saturation) * 0.2126; - float sg = (1.0 - saturation) * 0.7152; - float sb = (1.0 - saturation) * 0.0722; - mat3 saturationMatrix = mat3( - sr + saturation, sr, sr, - sg, sg + saturation, sg, - sb, sb, sb + saturation - ); - color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0)); - `)}if(r.gamma!==void 0){const u=pt(n,r.gamma,V);i.push(`color.rgb = pow(color.rgb, vec3(1.0 / ${u}));`)}if(r.brightness!==void 0){const u=pt(n,r.brightness,V);i.push(`color.rgb = clamp(color.rgb + ${u}, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}const s={},o=Object.keys(n.variables).length;if(o>1&&!r.variables)throw new Error(`Missing variables in style (expected ${n.variables})`);for(let u=0;u ${wt.RENDER_EXTENT}[2] || - v_mapCoord[1] > ${wt.RENDER_EXTENT}[3] - ) { - discard; - } - - vec4 color = texture2D(${wt.TILE_TEXTURE_ARRAY}[0], v_textureCoord); - - ${i.join(` -`)} - - gl_FragColor = color; - gl_FragColor.rgb *= gl_FragColor.a; - gl_FragColor *= ${wt.TRANSITION_ALPHA}; - }`;return{vertexShader:e,fragmentShader:c,uniforms:s,paletteTextures:n.paletteTextures}}class Vl extends Z_{constructor(t){t=t?Object.assign({},t):{};const e=t.style||{};delete t.style;const n=t.cacheSize;delete t.cacheSize,super(t),this.sources_=t.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=e,this.cacheSize_=n,this.styleVariables_=this.style_.variables||{},this.addChangeListener(jt.SOURCE,this.handleSourceUpdate_)}getSources(t,e){const n=this.getSource();return this.sources_?typeof this.sources_=="function"?this.sources_(t,e):this.sources_:n?[n]:[]}getRenderSource(){return this.renderedSource_||this.getSource()}getSourceState(){const t=this.getRenderSource();return t?t.getState():"undefined"}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache(),this.getSource()&&this.setStyle(this.style_)}getSourceBandCount_(){const t=Number.MAX_SAFE_INTEGER,e=this.getSources([-t,-t,t,t],t);return e&&e.length&&"bandCount"in e[0]?e[0].bandCount:4}createRenderer(){const t=Np(this.style_,this.getSourceBandCount_());return new SI(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.cacheSize_,paletteTextures:t.paletteTextures})}renderSources(t,e){const n=this.getRenderer();let i;for(let s=0,o=e.length;s{h.getState()=="ready"&&(h.removeEventListener("change",u),this.changed())};h.addEventListener("change",u)}s=s&&c=="ready"}const o=this.renderSources(t,i);if(this.getRenderer().renderComplete&&s)return this.renderedResolution_=n.resolution,o;if(this.renderedResolution_>.5*n.resolution){const a=this.getSources(t.extent,this.renderedResolution_).filter(l=>!i.includes(l));if(a.length>0)return this.renderSources(t,a)}return o}setStyle(t){this.styleVariables_=t.variables||{},this.style_=t;const e=Np(this.style_,this.getSourceBandCount_());this.getRenderer().reset({vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,paletteTextures:e.paletteTextures}),this.changed()}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}}Vl.prototype.dispose;const VI=Object.freeze(Object.defineProperty({__proto__:null,Graticule:TC,Group:Oh,Heatmap:LI,Image:Hd,Layer:Ra,Tile:Zl,Vector:Gd,VectorImage:DI,VectorTile:$_,WebGLPoints:$I,WebGLTile:Vl},Symbol.toStringTag,{value:"Module"}));var We=(r,t,e)=>new Promise((n,i)=>{var s=l=>{try{a(e.next(l))}catch(h){i(h)}},o=l=>{try{a(e.throw(l))}catch(h){i(h)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((e=e.apply(r,t)).next())}),_r=Uint8Array,Do=Uint16Array,YI=Int32Array,H_=new _r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),K_=new _r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),HI=new _r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),J_=function(r,t){for(var e=new Do(31),n=0;n<31;++n)e[n]=t+=1<>1|(Bt&21845)<<1,Sn=(Sn&52428)>>2|(Sn&13107)<<2,Sn=(Sn&61680)>>4|(Sn&3855)<<4,ey[Bt]=((Sn&65280)>>8|(Sn&255)<<8)>>1;var Sn,Bt,ko=function(r,t,e){for(var n=r.length,i=0,s=new Do(t);i>l]=h}return a},Oa=new _r(288);for(Bt=0;Bt<144;++Bt)Oa[Bt]=8;var Bt;for(Bt=144;Bt<256;++Bt)Oa[Bt]=9;var Bt;for(Bt=256;Bt<280;++Bt)Oa[Bt]=7;var Bt;for(Bt=280;Bt<288;++Bt)Oa[Bt]=8;var Bt,ry=new _r(32);for(Bt=0;Bt<32;++Bt)ry[Bt]=5;var Bt,tP=ko(Oa,9),eP=ko(ry,5),Mc=function(r){for(var t=r[0],e=1;et&&(t=r[e]);return t},Nr=function(r,t,e){var n=t/8|0;return(r[n]|r[n+1]<<8)>>(t&7)&e},Rc=function(r,t){var e=t/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(t&7)},rP=function(r){return(r+7)/8|0},nP=function(r,t,e){(e==null||e>r.length)&&(e=r.length);var n=new _r(e-t);return n.set(r.subarray(t,e)),n},iP=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],fr=function(r,t,e){var n=new Error(t||iP[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,fr),!e)throw n;return n},eg=function(r,t,e,n){var i=r.length,s=0;if(!i||t.f&&!t.l)return e||new _r(0);var o=!e||t.i!=2,a=t.i;e||(e=new _r(i*3));var l=function(Dt){var $t=e.length;if(Dt>$t){var me=new _r(Math.max($t*2,Dt));me.set(e),e=me}},h=t.f||0,c=t.p||0,u=t.b||0,d=t.l,g=t.d,f=t.m,p=t.n,_=i*8;do{if(!d){h=Nr(r,c,1);var y=Nr(r,c+1,3);if(c+=3,y)if(y==1)d=tP,g=eP,f=9,p=5;else if(y==2){var v=Nr(r,c,31)+257,w=Nr(r,c+10,15)+4,S=v+Nr(r,c+5,31)+1;c+=14;for(var E=new _r(S),T=new _r(19),M=0;M>4;if(z<16)E[M++]=z;else{var m=0,x=0;for(z==16?(x=3+Nr(r,c,3),c+=2,m=E[M-1]):z==17?(x=3+Nr(r,c,7),c+=3):z==18&&(x=11+Nr(r,c,127),c+=7);x--;)E[M++]=m}}var b=E.subarray(0,v),R=E.subarray(v);f=Mc(b),p=Mc(R),d=ko(b,f),g=ko(R,p)}else fr(1);else{var z=rP(c)+4,L=r[z-4]|r[z-3]<<8,N=z+L;if(N>i){a&&fr(0);break}o&&l(u+L),e.set(r.subarray(z,N),u),t.b=u+=L,t.p=c=N*8,t.f=h;continue}if(c>_){a&&fr(0);break}}o&&l(u+131072);for(var k=(1<>4;if(c+=m&15,c>_){a&&fr(0);break}if(m||fr(2),Y<256)e[u++]=Y;else if(Y==256){Z=c,d=null;break}else{var ot=Y-254;if(Y>264){var M=Y-257,U=H_[M];ot=Nr(r,c,(1<>4;nt||fr(3),c+=nt&15;var R=QI[ut];if(ut>3){var U=K_[ut];R+=Rc(r,c)&(1<_){a&&fr(0);break}o&&l(u+131072);var _t=u+ot;if(u>3&1)+(t>>4&1);n>0;n-=!r[e++]);return e+(t&2)},aP=function(r){var t=r.length;return(r[t-4]|r[t-3]<<8|r[t-2]<<16|r[t-1]<<24)>>>0},lP=function(r,t){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&fr(6,"invalid zlib data"),(r[1]>>5&1)==+!t&&fr(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function hP(r,t){return eg(r,{i:2},t,t)}function cP(r,t){var e=oP(r);return e+8>r.length&&fr(6,"invalid gzip data"),eg(r.subarray(e,-8),{i:2},new _r(aP(r)),t)}function uP(r,t){return eg(r.subarray(lP(r,t),-4),{i:2},t,t)}function pu(r,t){return r[0]==31&&r[1]==139&&r[2]==8?cP(r,t):(r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31?hP(r,t):uP(r,t)}var dP=typeof TextDecoder<"u"&&new TextDecoder,gP=0;try{dP.decode(sP,{stream:!0}),gP=1}catch{}var ny=(r,t)=>r*Math.pow(2,t),po=(r,t)=>Math.floor(r/Math.pow(2,t)),Yl=(r,t)=>ny(r.getUint16(t+1,!0),8)+r.getUint8(t),iy=(r,t)=>ny(r.getUint32(t+2,!0),16)+r.getUint16(t,!0),fP=(r,t,e,n,i)=>{if(r!=n.getUint8(i))return r-n.getUint8(i);const s=Yl(n,i+1);if(t!=s)return t-s;const o=Yl(n,i+4);return e!=o?e-o:0},pP=(r,t,e,n)=>{const i=sy(r,t|128,e,n);return i?{z:t,x:e,y:n,offset:i[0],length:i[1],is_dir:!0}:null},Dp=(r,t,e,n)=>{const i=sy(r,t,e,n);return i?{z:t,x:e,y:n,offset:i[0],length:i[1],is_dir:!1}:null},sy=(r,t,e,n)=>{let i=0,s=r.byteLength/17-1;for(;i<=s;){const o=s+i>>1,a=fP(t,e,n,r,o*17);if(a>0)i=o+1;else if(a<0)s=o-1;else return[iy(r,o*17+7),r.getUint32(o*17+13,!0)]}return null},mP=(r,t)=>r.is_dir&&!t.is_dir?1:!r.is_dir&&t.is_dir?-1:r.z!==t.z?r.z-t.z:r.x!==t.x?r.x-t.x:r.y-t.y,oy=(r,t)=>{const e=r.getUint8(t*17);return{z:e&127,x:Yl(r,t*17+1),y:Yl(r,t*17+4),offset:iy(r,t*17+7),length:r.getUint32(t*17+13,!0),is_dir:e>>7===1}},kp=r=>{const t=[],e=new DataView(r);for(let n=0;n{r.sort(mP);const t=new ArrayBuffer(17*r.length),e=new Uint8Array(t);for(let n=0;n>8&255,e[n*17+3]=i.x>>16&255,e[n*17+4]=i.y&255,e[n*17+5]=i.y>>8&255,e[n*17+6]=i.y>>16&255,e[n*17+7]=i.offset&255,e[n*17+8]=po(i.offset,8)&255,e[n*17+9]=po(i.offset,16)&255,e[n*17+10]=po(i.offset,24)&255,e[n*17+11]=po(i.offset,32)&255,e[n*17+12]=po(i.offset,48)&255,e[n*17+13]=i.length&255,e[n*17+14]=i.length>>8&255,e[n*17+15]=i.length>>16&255,e[n*17+16]=i.length>>24&255}return t},yP=(r,t)=>{if(r.byteLength<17)return null;const e=r.byteLength/17,n=oy(r,e-1);if(n.is_dir){const i=n.z,s=t.z-i,o=Math.trunc(t.x/(1<>>0)*4294967296+(r>>>0)}function SP(r,t){const e=t.buf;let n,i;if(i=e[t.pos++],n=(i&112)>>4,i<128||(i=e[t.pos++],n|=(i&127)<<3,i<128)||(i=e[t.pos++],n|=(i&127)<<10,i<128)||(i=e[t.pos++],n|=(i&127)<<17,i<128)||(i=e[t.pos++],n|=(i&127)<<24,i<128)||(i=e[t.pos++],n|=(i&1)<<31,i<128))return wP(r,n);throw new Error("Expected varint not more than 10 bytes")}function mo(r){const t=r.buf;let e,n;return n=t[r.pos++],e=n&127,n<128||(n=t[r.pos++],e|=(n&127)<<7,n<128)||(n=t[r.pos++],e|=(n&127)<<14,n<128)||(n=t[r.pos++],e|=(n&127)<<21,n<128)?e:(n=t[r.pos],e|=(n&15)<<28,SP(e,r))}function EP(r,t,e,n){if(n==0){e==1&&(t[0]=r-1-t[0],t[1]=r-1-t[1]);const i=t[0];t[0]=t[1],t[1]=i}}var bP=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function TP(r,t,e){if(r>26)throw Error("Tile zoom level exceeds max safe number limit (26)");if(t>Math.pow(2,r)-1||e>Math.pow(2,r)-1)throw Error("tile x/y outside zoom level bounds");const n=bP[r],i=Math.pow(2,r);let s=0,o=0,a=0;const l=[t,e];let h=i/2;for(;h>0;)s=(l[0]&h)>0?1:0,o=(l[1]&h)>0?1:0,a+=h*h*(3*s^o),EP(h,l,s,o),h=h/2;return n+a}function ly(r,t){return We(this,null,function*(){if(t===1||t===0)return r;if(t===2){if(typeof globalThis.DecompressionStream>"u")return pu(new Uint8Array(r));{let e=new Response(r).body.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(e).arrayBuffer()}}else throw Error("Compression method not supported")})}var gs=(r=>(r[r.Unknown=0]="Unknown",r[r.Mvt=1]="Mvt",r[r.Png=2]="Png",r[r.Jpeg=3]="Jpeg",r[r.Webp=4]="Webp",r[r.Avif=5]="Avif",r))(gs||{}),MP=127;function RP(r,t){let e=0,n=r.length-1;for(;e<=n;){const i=n+e>>1,s=t-r[i].tileId;if(s>0)e=i+1;else if(s<0)n=i-1;else return r[i]}return n>=0&&(r[n].runLength===0||t-r[n].tileId=300)throw Error("Bad response code: "+s.status);const o=s.headers.get("Content-Length");if(s.status===200&&(!o||+o>t))throw n&&n.abort(),Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield s.arrayBuffer(),etag:s.headers.get("ETag")||void 0,cacheControl:s.headers.get("Cache-Control")||void 0,expires:s.headers.get("Expires")||void 0}})}};function Dr(r,t){const e=r.getUint32(t+4,!0),n=r.getUint32(t+0,!0);return e*Math.pow(2,32)+n}function IP(r,t){const e=new DataView(r),n=e.getUint8(7);if(n>3)throw Error(`Archive is spec version ${n} but this library supports up to spec version 3`);return{specVersion:n,rootDirectoryOffset:Dr(e,8),rootDirectoryLength:Dr(e,16),jsonMetadataOffset:Dr(e,24),jsonMetadataLength:Dr(e,32),leafDirectoryOffset:Dr(e,40),leafDirectoryLength:Dr(e,48),tileDataOffset:Dr(e,56),tileDataLength:Dr(e,64),numAddressedTiles:Dr(e,72),numTileEntries:Dr(e,80),numTileContents:Dr(e,88),clustered:e.getUint8(96)===1,internalCompression:e.getUint8(97),tileCompression:e.getUint8(98),tileType:e.getUint8(99),minZoom:e.getUint8(100),maxZoom:e.getUint8(101),minLon:e.getInt32(102,!0)/1e7,minLat:e.getInt32(106,!0)/1e7,maxLon:e.getInt32(110,!0)/1e7,maxLat:e.getInt32(114,!0)/1e7,centerZoom:e.getUint8(118),centerLon:e.getInt32(119,!0)/1e7,centerLat:e.getInt32(123,!0)/1e7,etag:t}}function hy(r){const t={buf:new Uint8Array(r),pos:0},e=mo(t),n=[];let i=0;for(let s=0;s0?n[s].offset=n[s-1].offset+n[s-1].length:n[s].offset=o-1}return n}function PP(r){const t=new DataView(r);return t.getUint16(2,!0)===2?(console.warn("PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),2):t.getUint16(2,!0)===1?(console.warn("PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),1):3}var xs=class extends Error{};function AP(r,t,e,n){return We(this,null,function*(){const i=yield r.getBytes(0,16384);if(new DataView(i.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");if(PP(i.data)<3)return[yield ay.getHeader(r)];const s=i.data.slice(0,MP);let o=i.etag;n&&i.etag!=n&&(console.warn("ETag conflict detected; your HTTP server might not support content-based ETag headers. ETags disabled for "+r.getKey()),o=void 0);const a=IP(s,o);if(e){const l=i.data.slice(a.rootDirectoryOffset,a.rootDirectoryOffset+a.rootDirectoryLength),h=r.getKey()+"|"+(a.etag||"")+"|"+a.rootDirectoryOffset+"|"+a.rootDirectoryLength,c=hy(yield t(l,a.internalCompression));return[a,[h,c.length,c]]}return[a,void 0]})}function LP(r,t,e,n,i){return We(this,null,function*(){const s=yield r.getBytes(e,n);if(i.etag&&i.etag!==s.etag)throw new xs(s.etag);const o=yield t(s.data,i.internalCompression),a=hy(o);if(a.length===0)throw new Error("Empty directory is invalid");return a})}var OP=class{constructor(r=100,t=!0,e=ly){this.cache=new Map,this.maxCacheEntries=r,this.counter=1,this.prefetch=t,this.decompress=e}getHeader(r,t){return We(this,null,function*(){const e=r.getKey();if(this.cache.has(e))return this.cache.get(e).lastUsed=this.counter++,yield this.cache.get(e).data;const n=new Promise((i,s)=>{AP(r,this.decompress,this.prefetch,t).then(o=>{o[1]&&this.cache.set(o[1][0],{lastUsed:this.counter++,data:Promise.resolve(o[1][2])}),i(o[0]),this.prune()}).catch(o=>{s(o)})});return this.cache.set(e,{lastUsed:this.counter++,data:n}),n})}getDirectory(r,t,e,n){return We(this,null,function*(){const i=r.getKey()+"|"+(n.etag||"")+"|"+t+"|"+e;if(this.cache.has(i))return this.cache.get(i).lastUsed=this.counter++,yield this.cache.get(i).data;const s=new Promise((o,a)=>{LP(r,this.decompress,t,e,n).then(l=>{o(l),this.prune()}).catch(l=>{a(l)})});return this.cache.set(i,{lastUsed:this.counter++,data:s}),s})}getArrayBuffer(r,t,e,n){return We(this,null,function*(){const i=r.getKey()+"|"+(n.etag||"")+"|"+t+"|"+e;if(this.cache.has(i))return this.cache.get(i).lastUsed=this.counter++,yield this.cache.get(i).data;const s=new Promise((o,a)=>{r.getBytes(t,e).then(l=>{if(n.etag&&n.etag!==l.etag)throw new xs(l.etag);o(l.data),this.cache.has(i),this.prune()}).catch(l=>{a(l)})});return this.cache.set(i,{lastUsed:this.counter++,data:s}),s})}prune(){if(this.cache.size>=this.maxCacheEntries){let r=1/0,t;this.cache.forEach((e,n)=>{e.lastUseds.maxZoom)return;let o=s.rootDirectoryOffset,a=s.rootDirectoryLength;for(let l=0;l<=3;l++){const h=yield this.cache.getDirectory(this.source,o,a,s),c=RP(h,i);if(c)if(c.runLength>0){const u=yield this.source.getBytes(s.tileDataOffset+c.offset,c.length,n);if(s.etag&&s.etag!==u.etag)throw new xs(u.etag);return{data:yield this.decompress(u.data,s.tileCompression),cacheControl:u.cacheControl,expires:u.expires}}else o=s.leafDirectoryOffset+c.offset,a=c.length;else return}throw Error("Maximum directory depth exceeded")})}getZxy(r,t,e,n){return We(this,null,function*(){try{return yield this.getZxyAttempt(r,t,e,n)}catch(i){if(i instanceof xs)return this.cache.invalidate(this.source,i.message),yield this.getZxyAttempt(r,t,e,n);throw i}})}getMetadataAttempt(){return We(this,null,function*(){const r=yield this.cache.getHeader(this.source),t=yield this.source.getBytes(r.jsonMetadataOffset,r.jsonMetadataLength);if(r.etag&&r.etag!==t.etag)throw new xs(t.etag);const e=yield this.decompress(t.data,r.internalCompression),n=new TextDecoder("utf-8");return JSON.parse(n.decode(e))})}getMetadata(){return We(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(r){if(r instanceof xs)return this.cache.invalidate(this.source,r.message),yield this.getMetadataAttempt();throw r}})}};class FP extends gn{constructor(t){super(Ct.ERROR),this.error=t}}class zh extends Zd{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const t=this.peekFirstKey(),e=U_(t)[0];this.forEach(n=>{n.tileCoord[0]!==e&&(this.remove(ei(n.tileCoord)),n.release())})}}const Cs={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},as=[0,0,0],Qn=5;class _i{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,Rt(wx(this.resolutions_,(i,s)=>s-i),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let i=0,s=this.resolutions_.length-1;i{const o=new jh(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(n){const a=this.getTileRangeForExtentAndZ(n,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):n&&this.calculateTileRanges_(n)}forEachTileCoord(t,e,n){const i=this.getTileRangeForExtentAndZ(t,e);for(let s=i.minX,o=i.maxX;s<=o;++s)for(let a=i.minY,l=i.maxY;a<=l;++a)n([e,s,a])}forEachTileCoordParentTileRange(t,e,n,i){let s,o,a,l=null,h=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,i);h>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),s=is(o,o,a,a,n)):s=this.getTileRangeForExtentAndZ(l,h,n),e(h,s))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,n){if(t[0]this.maxZoom||e0?S=e.find(function(E){return w[c]==E[h]?!0:w[c].includes(":")?!1:r[c]+":"+w[c]===E[h]}):S=!0,S){i.push(w[c]);const E=w[u]*28e-5/y,T=w[g],M=w[f];v?s.push([w[d][1],w[d][0]]):s.push(w[d]),n.push(E),o.push(T==M?T:[T,M]),a.push([w.MatrixWidth,w.MatrixHeight])}}),new NP({extent:t,origins:s,resolutions:n,matrixIds:i,tileSizes:o,sizes:a})}function ng(r){let t=r.getDefaultTileGrid();return t||(t=jP(r),r.setDefaultTileGrid(t)),t}function kP(r,t,e){const n=t[0],i=r.getTileCoordCenter(t),s=Wn(e);if(!yr(s,i)){const o=mt(s),a=Math.ceil((s[0]-i[0])/o);return i[0]+=o*a,r.getTileCoordForCoordAndZ(i,n)}return t}function GP(r,t,e,n){n=n!==void 0?n:"top-left";const i=cy(r,t,e);return new _i({extent:r,origin:Ox(r,n),resolutions:i,tileSize:e})}function Yi(r){const t=r||{},e=t.extent||K("EPSG:3857").getExtent(),n={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:cy(e,t.maxZoom,t.tileSize,t.maxResolution)};return new _i(n)}function cy(r,t,e,n){t=t!==void 0?t:a_,e=ee(e!==void 0?e:js);const i=qt(r),s=mt(r);n=n>0?n:Math.max(s/e[0],i/e[1]);const o=t+1,a=new Array(o);for(let l=0;ln.highWaterMark&&(n.highWaterMark=t)}useTile(t,e,n,i){}}class uy extends gn{constructor(t,e){super(t),this.tile=e}}const Fa=zP;class ig extends Fa{constructor(t){const e=t.projection===void 0?"EPSG:3857":t.projection;let n=t.tileGrid;n===void 0&&e&&(n=Yi({extent:Wn(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize})),super({cacheSize:.1,attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:e,tileGrid:n,opaque:t.opaque,state:t.state,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate}),this.gutter_=t.gutter!==void 0?t.gutter:0,this.tileSize_=t.tileSize?ee(t.tileSize):null,this.tileSizes_=null,this.tileLoadingKeys_={},this.loader_=t.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=t.bandCount===void 0?4:t.bandCount,this.tileGridForProjection_={},this.tileCacheForProjection_={}}setTileSizes(t){this.tileSizes_=t}getTileSize(t){if(this.tileSizes_)return this.tileSizes_[t];if(this.tileSize_)return this.tileSize_;const e=this.getTileGrid();return e?ee(e.getTileSize(t)):[256,256]}getGutterForProjection(t){const e=this.getProjection();return!e||Ie(e,t)?this.gutter_:0}setLoader(t){this.loader_=t}getReprojTile_(t,e,n,i,s){const o=this.getTileCacheForProjection(i),a=un(t,e,n);if(o.containsKey(a)){const _=o.get(a);if(_&&_.key==this.getKey())return _}const l=this.getTileGrid(),h=Math.max.apply(null,l.getResolutions().map((_,y)=>{const v=ee(l.getTileSize(y)),w=this.getTileSize(y);return Math.max(w[0]/v[0],w[1]/v[1])})),c=this.getTileGridForProjection(s),u=this.getTileGridForProjection(i),d=[t,e,n],g=this.getTileCoordForTileUrlFunction(d,i),f=Object.assign({sourceProj:s,sourceTileGrid:c,targetProj:i,targetTileGrid:u,tileCoord:d,wrappedTileCoord:g,pixelRatio:h,gutter:this.getGutterForProjection(s),getTileFunction:(_,y,v,w)=>this.getTile(_,y,v,w,s)},this.tileOptions),p=new Wd(f);return p.key=this.getKey(),p}getTile(t,e,n,i,s){const o=this.getProjection();if(o&&s&&!Ie(o,s))return this.getReprojTile_(t,e,n,s,o);const a=this.getTileSize(t),l=un(t,e,n);if(this.tileCache.containsKey(l))return this.tileCache.get(l);const h=this.loader_;function c(){return Am(function(){return h(t,e,n)})}const u=Object.assign({tileCoord:[t,e,n],loader:c,size:a},this.tileOptions),d=new Ud(u);return d.key=this.getKey(),d.addEventListener(Ct.CHANGE,this.handleTileChange_),this.tileCache.set(l,d),d}handleTileChange_(t){const e=t.target,n=tt(e),i=e.getState();let s;i==B.LOADING?(this.tileLoadingKeys_[n]=!0,s=Cs.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],s=i==B.ERROR?Cs.TILELOADERROR:i==B.LOADED?Cs.TILELOADEND:void 0),s&&this.dispatchEvent(new uy(s,e))}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||Ie(e,t)))return this.tileGrid;const n=tt(t);return n in this.tileGridForProjection_||(this.tileGridForProjection_[n]=ng(t)),this.tileGridForProjection_[n]}setTileGridForProjection(t,e){const n=K(t);if(n){const i=tt(n);i in this.tileGridForProjection_||(this.tileGridForProjection_[i]=e)}}getTileCacheForProjection(t){const e=this.getProjection();if(!e||Ie(e,t))return this.tileCache;const n=tt(t);return n in this.tileCacheForProjection_||(this.tileCacheForProjection_[n]=new zh(.1)),this.tileCacheForProjection_[n]}expireCache(t,e){const n=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==n?e:{});for(const i in this.tileCacheForProjection_){const s=this.tileCacheForProjection_[i];s.expireCache(s==n?e:{})}}clear(){super.clear();for(const t in this.tileCacheForProjection_)this.tileCacheForProjection_[t].clear()}}function Le(r){return(t,...e)=>UP(r,t,e)}function no(r,t){return Le(dy(r,t).get)}const{apply:UP,construct:yk,defineProperty:xk,get:vk,getOwnPropertyDescriptor:dy,getPrototypeOf:sg,has:wk,ownKeys:BP,set:Sk,setPrototypeOf:Ek}=Reflect,{iterator:Na,species:bk,toStringTag:XP,for:Tk}=Symbol,WP=Object,{create:og,defineProperty:ZP,freeze:Mk,is:Rk}=WP,qP=Array,$P=qP.prototype,gy=$P[Na],VP=Le(gy),fy=ArrayBuffer,YP=fy.prototype;no(YP,"byteLength");const Gp=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;Gp&&no(Gp.prototype,"byteLength");const py=sg(Uint8Array);py.from;const Ye=py.prototype;Ye[Na];Le(Ye.keys);Le(Ye.values);Le(Ye.entries);Le(Ye.set);Le(Ye.reverse);Le(Ye.fill);Le(Ye.copyWithin);Le(Ye.sort);Le(Ye.slice);Le(Ye.subarray);no(Ye,"buffer");no(Ye,"byteOffset");no(Ye,"length");no(Ye,XP);const HP=Uint8Array,my=Uint16Array,ag=Uint32Array,KP=Float32Array,la=sg([][Na]()),_y=Le(la.next),JP=Le(function*(){}().next),QP=sg(la),tA=DataView.prototype,eA=Le(tA.getUint16),lg=WeakMap,yy=lg.prototype,xy=Le(yy.get),rA=Le(yy.set),vy=new lg,nA=og(null,{next:{value:function(){const r=xy(vy,this);return _y(r)}},[Na]:{value:function(){return this}}});function iA(r){if(r[Na]===gy&&la.next===_y)return r;const t=og(nA);return rA(vy,t,VP(r)),t}const sA=new lg,oA=og(QP,{next:{value:function(){const r=xy(sA,this);return JP(r)},writable:!0,configurable:!0}});for(const r of BP(la))r!=="next"&&ZP(oA,r,dy(la,r));const wy=new fy(4),aA=new KP(wy),lA=new ag(wy),Hr=new my(512),Kr=new HP(512);for(let r=0;r<256;++r){const t=r-127;t<-27?(Hr[r]=0,Hr[r|256]=32768,Kr[r]=24,Kr[r|256]=24):t<-14?(Hr[r]=1024>>-t-14,Hr[r|256]=1024>>-t-14|32768,Kr[r]=-t-1,Kr[r|256]=-t-1):t<=15?(Hr[r]=t+15<<10,Hr[r|256]=t+15<<10|32768,Kr[r]=13,Kr[r|256]=13):t<128?(Hr[r]=31744,Hr[r|256]=64512,Kr[r]=24,Kr[r|256]=24):(Hr[r]=31744,Hr[r|256]=64512,Kr[r]=13,Kr[r|256]=13)}const hg=new ag(2048);for(let r=1;r<1024;++r){let t=r<<13,e=0;for(;!(t&8388608);)t<<=1,e-=8388608;t&=-8388609,e+=947912704,hg[r]=t|e}for(let r=1024;r<2048;++r)hg[r]=939524096+(r-1024<<13);const io=new ag(64);for(let r=1;r<31;++r)io[r]=r<<23;io[31]=1199570944;io[32]=2147483648;for(let r=33;r<63;++r)io[r]=2147483648+(r-32<<23);io[63]=3347054592;const Sy=new my(64);for(let r=1;r<64;++r)r!==32&&(Sy[r]=1024);function hA(r){const t=r>>10;return lA[0]=hg[Sy[t]+(r&1023)]+io[t],aA[0]}function Ey(r,t,...e){return hA(eA(r,t,...iA(e)))}var cg={exports:{}};function by(r,t,e){const n=e&&e.debug||!1;n&&console.log("[xml-utils] getting "+t+" in "+r);const i=typeof r=="object"?r.outer:r,s=i.slice(0,i.indexOf(">")+1),o=['"',"'"];for(let a=0;a/]`,s);if(n&&console.log("[xml-utils] start:",o),o===-1)return;const a=r.slice(o+t.length);let l=Ic(a,"^[^<]*[ /]>",0);const h=l!==-1&&a[l-1]==="/";if(n&&console.log("[xml-utils] selfClosing:",h),h===!1)if(i){let g=0,f=1,p=0;for(;(l=Ic(a,"[ /]"+t+">",g))!==-1;){const _=a.substring(g,l+1);if(f+=jp(_,"<"+t+`[ - >]`),p+=jp(_,""),p>=f)break;g=l}}else l=Ic(a,"[ /]"+t+">",0);const c=o+t.length+l+1;if(n&&console.log("[xml-utils] end:",c),c===-1)return;const u=r.slice(o,c);let d;return h?d=null:d=u.slice(u.indexOf(">")+1,u.lastIndexOf("<")),{inner:d,outer:u,start:o,end:c}}dg.exports=Cy;dg.exports.default=Cy;var pA=dg.exports;const mA=pA;function Iy(r,t,e){const n=[],i=e&&e.debug||!1,s=e&&typeof e.nested=="boolean"?e.nested:!0;let o=e&&e.startIndex||0,a;for(;a=mA(r,t,{debug:i,startIndex:o});)s?o=a.start+1+t.length:o=a.end,n.push(a);return i&&console.log("findTagsByName found",n.length,"tags"),n}ug.exports=Iy;ug.exports.default=Iy;var _A=ug.exports;const yA=Hs(_A),Go={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Qr={};for(const r in Go)Go.hasOwnProperty(r)&&(Qr[Go[r]]=parseInt(r,10));const xA=[Qr.BitsPerSample,Qr.ExtraSamples,Qr.SampleFormat,Qr.StripByteCounts,Qr.StripOffsets,Qr.StripRowCounts,Qr.TileByteCounts,Qr.TileOffsets,Qr.SubIFDs],Pc={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},St={};for(const r in Pc)Pc.hasOwnProperty(r)&&(St[Pc[r]]=parseInt(r,10));const He={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},vA={Unspecified:0,Assocalpha:1,Unassalpha:2},Ck={Version:0,AddCompression:1},Ik={None:0,Deflate:1,Zstandard:2},wA={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function SA(r,t){const{width:e,height:n}=r,i=new Uint8Array(e*n*3);let s;for(let o=0,a=0;o>24,l=r[i+2]<<24>>24;let h=(o+16)/116,c=a/500+h,u=h-l/200,d,g,f;c=RA*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),h=CA*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),u=IA*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),d=c*3.2406+h*-1.5372+u*-.4986,g=c*-.9689+h*1.8758+u*.0415,f=c*.0557+h*-.204+u*1.057,d=d>.0031308?1.055*d**(1/2.4)-.055:12.92*d,g=g>.0031308?1.055*g**(1/2.4)-.055:12.92*g,f=f>.0031308?1.055*f**(1/2.4)-.055:12.92*f,n[s]=Math.max(0,Math.min(1,d))*255,n[s+1]=Math.max(0,Math.min(1,g))*255,n[s+2]=Math.max(0,Math.min(1,f))*255}return n}const Py=new Map;function yi(r,t){Array.isArray(r)||(r=[r]),r.forEach(e=>Py.set(e,t))}async function Ay(r){const t=Py.get(r.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${r.Compression}`);const e=await t();return new e(r)}yi([void 0,1],()=>jn(()=>import("./raw-CcGKjn8q-MKTGGSca.js"),__vite__mapDeps([0,1])).then(r=>r.default));yi(5,()=>jn(()=>import("./lzw-BOMhmEDy-CRQZVFv2.js"),__vite__mapDeps([2,1])).then(r=>r.default));yi(6,()=>{throw new Error("old style JPEG compression is not supported.")});yi(7,()=>jn(()=>import("./jpeg-DNfUpLwy-CrsOgAb-.js"),__vite__mapDeps([3,1])).then(r=>r.default));yi([8,32946],()=>jn(()=>import("./deflate-Be2Arps5-XLmgg930.js"),__vite__mapDeps([4,5,1])).then(r=>r.default));yi(32773,()=>jn(()=>import("./packbits-DaUD6MLm-DnF8Bj-8.js"),__vite__mapDeps([6,1])).then(r=>r.default));yi(34887,()=>jn(()=>import("./lerc-_E46UbWQ-CN6lsrI9.js"),__vite__mapDeps([7,5,1,8,9,10,11,12])).then(async r=>(await r.zstd.init(),r)).then(r=>r.default));yi(50001,()=>jn(()=>import("./webimage-D2c098k3-CiG7DZmh.js"),__vite__mapDeps([13,1])).then(r=>r.default));function Uh(r,t,e,n=1){return new(Object.getPrototypeOf(r)).constructor(t*e*n)}function AA(r,t,e,n,i){const s=t/n,o=e/i;return r.map(a=>{const l=Uh(a,n,i);for(let h=0;h{const l=Uh(a,n,i);for(let h=0;h>8-i-T&u;else if(T+i<=16)c[S]=a.getUint16(E)>>16-i-T&u;else if(T+i<=24){const M=a.getUint16(E)<<8|a.getUint8(E+2);c[S]=M>>24-i-T&u}else c[S]=a.getUint32(E)>>32-i-T&u}}}}return c.buffer}class Ly{constructor(t,e,n,i,s,o){this.fileDirectory=t,this.geoKeys=e,this.dataView=n,this.littleEndian=i,this.tiles=s?{}:null,this.isTiled=!t.StripOffsets;const a=t.PlanarConfiguration;if(this.planarConfiguration=typeof a>"u"?1:a,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let e=0;e=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}getReaderForSample(t){const e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,n=this.fileDirectory.BitsPerSample[t];switch(e){case 1:if(n<=8)return DataView.prototype.getUint8;if(n<=16)return DataView.prototype.getUint16;if(n<=32)return DataView.prototype.getUint32;break;case 2:if(n<=8)return DataView.prototype.getInt8;if(n<=16)return DataView.prototype.getInt16;if(n<=32)return DataView.prototype.getInt32;break;case 3:switch(n){case 16:return function(i,s){return Ey(this,i,s)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(t=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}getBitsPerSample(t=0){return this.fileDirectory.BitsPerSample[t]}getArrayForSample(t,e){const n=this.getSampleFormat(t),i=this.getBitsPerSample(t);return mu(n,i,e)}async getTileOrStrip(t,e,n,i,s){const o=Math.ceil(this.getWidth()/this.getTileWidth()),a=Math.ceil(this.getHeight()/this.getTileHeight());let l;const{tiles:h}=this;this.planarConfiguration===1?l=e*o+t:this.planarConfiguration===2&&(l=n*o*a+e*o+t);let c,u;this.isTiled?(c=this.fileDirectory.TileOffsets[l],u=this.fileDirectory.TileByteCounts[l]):(c=this.fileDirectory.StripOffsets[l],u=this.fileDirectory.StripByteCounts[l]);const d=(await this.source.fetch([{offset:c,length:u}],s))[0];let g;return h===null||!h[l]?(g=(async()=>{let f=await i.decode(this.fileDirectory,d);const p=this.getSampleFormat(),_=this.getBitsPerSample();return GA(p,_)&&(f=jA(f,p,this.planarConfiguration,this.getSamplesPerPixel(),_,this.getTileWidth(),this.getBlockHeight(e))),f})(),h!==null&&(h[l]=g)):g=h[l],{x:t,y:e,sample:n,data:await g}}async _readRaster(t,e,n,i,s,o,a,l,h){const c=this.getTileWidth(),u=this.getTileHeight(),d=this.getWidth(),g=this.getHeight(),f=Math.max(Math.floor(t[0]/c),0),p=Math.min(Math.ceil(t[2]/c),Math.ceil(d/c)),_=Math.max(Math.floor(t[1]/u),0),y=Math.min(Math.ceil(t[3]/u),Math.ceil(g/u)),v=t[2]-t[0];let w=this.getBytesPerPixel();const S=[],E=[];for(let C=0;C{const R=b.data,L=new DataView(R),N=this.getBlockHeight(b.y),k=b.y*u,j=b.x*c,Z=k+N,Y=(b.x+1)*c,ot=E[z],U=Math.min(N,N-(Z-t[3]),g-k),nt=Math.min(c,c-(Y-t[2]),d-j);for(let ut=Math.max(0,t[1]-k);utc[2]||c[1]>c[3])throw new Error("Invalid subsets");const u=c[2]-c[0],d=c[3]-c[1],g=u*d,f=this.getSamplesPerPixel();if(!e||!e.length)for(let y=0;y=f)return Promise.reject(new RangeError(`Invalid sample index '${e[y]}'.`));let p;if(n){const y=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,v=Math.max.apply(null,this.fileDirectory.BitsPerSample);p=mu(y,v,g*e.length),l&&p.fill(l)}else{p=[];for(let y=0;yh[2]||h[1]>h[3])throw new Error("Invalid subsets");const c=this.fileDirectory.PhotometricInterpretation;if(c===He.RGB){let y=[0,1,2];if(this.fileDirectory.ExtraSamples!==vA.Unspecified&&a){y=[];for(let v=0;vCc(s,"sample")===void 0):i=i.filter(s=>Number(Cc(s,"sample"))===t);for(let s=0;s[o+n*f+i*p,c+a*f+l*p]),d=u.map(f=>f[0]),g=u.map(f=>f[1]);return[Math.min(...d),Math.min(...g),Math.max(...d),Math.max(...g)]}else{const n=this.getOrigin(),i=this.getResolution(),s=n[0],o=n[1],a=s+i[0]*this.getWidth(),l=o+i[1]*this.getHeight();return[Math.min(s,a),Math.min(o,l),Math.max(s,a),Math.max(o,l)]}}}class zA{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,e){const n=this.getUint32(t,e),i=this.getUint32(t+4,e);let s;if(e){if(s=n+2**32*i,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}if(s=2**32*n+i,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}getInt64(t,e){let n=0;const i=(this._dataView.getUint8(t+(e?7:0))&128)>0;let s=!0;for(let o=0;o<8;o++){let a=this._dataView.getUint8(t+(e?o:7-o));i&&(s?a!==0&&(a=~(a-1)&255,s=!1):a=~a&255),n+=a*256**o}return i&&(n=-n),n}getUint8(t,e){return this._dataView.getUint8(t,e)}getInt8(t,e){return this._dataView.getInt8(t,e)}getUint16(t,e){return this._dataView.getUint16(t,e)}getInt16(t,e){return this._dataView.getInt16(t,e)}getUint32(t,e){return this._dataView.getUint32(t,e)}getInt32(t,e){return this._dataView.getInt32(t,e)}getFloat16(t,e){return Ey(this._dataView,t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class UA{constructor(t,e,n,i){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=n,this._bigTiff=i}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const e=this.readUint32(t),n=this.readUint32(t+4);let i;if(this._littleEndian){if(i=e+2**32*n,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}if(i=2**32*e+n,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}readInt64(t){let e=0;const n=(this._dataView.getUint8(t+(this._littleEndian?7:0))&128)>0;let i=!0;for(let s=0;s<8;s++){let o=this._dataView.getUint8(t+(this._littleEndian?s:7-s));n&&(i?o!==0&&(o=~(o-1)&255,i=!1):o=~o&255),e+=o*256**s}return n&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const BA=typeof navigator<"u"&&navigator.hardwareConcurrency||2;class XA{constructor(t=BA,e){this.workers=null,this._awaitingDecoder=null,this.size=t,this.messageId=0,t&&(this._awaitingDecoder=e?Promise.resolve(e):new Promise(n=>{jn(()=>import("./decoder-HRvnjnEI-Bgc3xmlZ.js"),__vite__mapDeps([14,8,9,10,11,12])).then(i=>{n(i.create)})}),this._awaitingDecoder.then(n=>{this._awaitingDecoder=null,this.workers=[];for(let i=0;in.decode(t,e)):new Promise(n=>{const i=this.workers.find(a=>a.idle)||this.workers[Math.floor(Math.random()*this.size)];i.idle=!1;const s=this.messageId++,o=a=>{a.data.id===s&&(i.idle=!0,n(a.data.decoded),i.worker.removeEventListener("message",o))};i.worker.addEventListener("message",o),i.worker.postMessage({fileDirectory:t,buffer:e,id:s},[e])})}destroy(){this.workers&&(this.workers.forEach(t=>{t.worker.terminate()}),this.workers=null)}}const zp=`\r -\r -`;function Oy(r){if(typeof Object.fromEntries<"u")return Object.fromEntries(r);const t={};for(const[e,n]of r)t[e.toLowerCase()]=n;return t}function WA(r){const t=r.split(`\r -`).map(e=>{const n=e.split(":").map(i=>i.trim());return n[0]=n[0].toLowerCase(),n});return Oy(t)}function ZA(r){const[t,...e]=r.split(";").map(i=>i.trim()),n=e.map(i=>i.split("="));return{type:t,params:Oy(n)}}function _u(r){let t,e,n;return r&&([,t,e,n]=r.match(/bytes (\d+)-(\d+)\/(\d+)/),t=parseInt(t,10),e=parseInt(e,10),n=parseInt(n,10)),{start:t,end:e,total:n}}function qA(r,t){let e=null;const n=new TextDecoder("ascii"),i=[],s=`--${t}`,o=`${s}--`;for(let a=0;a<10;++a)n.decode(new Uint8Array(r,a,s.length))===s&&(e=a);if(e===null)throw new Error("Could not find initial boundary");for(;ethis.fetchSlice(n,e)))}async fetchSlice(t){throw new Error(`fetching of slice ${t} not possible, not implemented`)}get fileSize(){return null}async close(){}}class $A extends Map{constructor(t={}){if(super(),!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof t.maxAge=="number"&&t.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=t.maxSize,this.maxAge=t.maxAge||Number.POSITIVE_INFINITY,this.onEviction=t.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(t){if(typeof this.onEviction=="function")for(const[e,n]of t)this.onEviction(e,n.value)}_deleteIfExpired(t,e){return typeof e.expiry=="number"&&e.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(t,e.value),this.delete(t)):!1}_getOrDeleteIfExpired(t,e){if(this._deleteIfExpired(t,e)===!1)return e.value}_getItemValue(t,e){return e.expiry?this._getOrDeleteIfExpired(t,e):e.value}_peek(t,e){const n=e.get(t);return this._getItemValue(t,n)}_set(t,e){this.cache.set(t,e),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(t,e){this.oldCache.delete(t),this._set(t,e)}*_entriesAscending(){for(const t of this.oldCache){const[e,n]=t;this.cache.has(e)||this._deleteIfExpired(e,n)===!1&&(yield t)}for(const t of this.cache){const[e,n]=t;this._deleteIfExpired(e,n)===!1&&(yield t)}}get(t){if(this.cache.has(t)){const e=this.cache.get(t);return this._getItemValue(t,e)}if(this.oldCache.has(t)){const e=this.oldCache.get(t);if(this._deleteIfExpired(t,e)===!1)return this._moveToRecent(t,e),e.value}}set(t,e,{maxAge:n=this.maxAge}={}){const i=typeof n=="number"&&n!==Number.POSITIVE_INFINITY?Date.now()+n:void 0;return this.cache.has(t)?this.cache.set(t,{value:e,expiry:i}):this._set(t,{value:e,expiry:i}),this}has(t){return this.cache.has(t)?!this._deleteIfExpired(t,this.cache.get(t)):this.oldCache.has(t)?!this._deleteIfExpired(t,this.oldCache.get(t)):!1}peek(t){if(this.cache.has(t))return this._peek(t,this.cache);if(this.oldCache.has(t))return this._peek(t,this.oldCache)}delete(t){const e=this.cache.delete(t);return e&&this._size--,this.oldCache.delete(t)||e}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(t){if(!(t&&t>0))throw new TypeError("`maxSize` must be a number greater than 0");const e=[...this._entriesAscending()],n=e.length-t;n<0?(this.cache=new Map(e),this.oldCache=new Map,this._size=e.length):(n>0&&this._emitEvictions(e.slice(0,n)),this.oldCache=new Map(e.slice(n)),this.cache=new Map,this._size=0),this.maxSize=t}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache){const[e,n]=t;this._deleteIfExpired(e,n)===!1&&(yield[e,n.value])}for(const t of this.oldCache){const[e,n]=t;this.cache.has(e)||this._deleteIfExpired(e,n)===!1&&(yield[e,n.value])}}*entriesDescending(){let t=[...this.cache];for(let e=t.length-1;e>=0;--e){const n=t[e],[i,s]=n;this._deleteIfExpired(i,s)===!1&&(yield[i,s.value])}t=[...this.oldCache];for(let e=t.length-1;e>=0;--e){const n=t[e],[i,s]=n;this.cache.has(i)||this._deleteIfExpired(i,s)===!1&&(yield[i,s.value])}}*entriesAscending(){for(const[t,e]of this._entriesAscending())yield[t,e.value]}get size(){if(!this._size)return this.oldCache.size;let t=0;for(const e of this.oldCache.keys())this.cache.has(e)||t++;return Math.min(this._size+t,this.maxSize)}entries(){return this.entriesAscending()}forEach(t,e=this){for(const[n,i]of this.entriesAscending())t.call(e,i,n,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}async function VA(r){return new Promise(t=>setTimeout(t,r))}function YA(r,t){const e=Array.isArray(r)?r:Array.from(r),n=Array.isArray(t)?t:Array.from(t);return e.map((i,s)=>[i,n[s]])}class Us extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,Us),this.name="AbortError"}}class HA extends Error{constructor(t,e){super(e),this.errors=t,this.message=e,this.name="AggregateError"}}const KA=HA;class JA{constructor(t,e,n=null){this.offset=t,this.length=e,this.data=n}get top(){return this.offset+this.length}}class Up{constructor(t,e,n){this.offset=t,this.length=e,this.blockIds=n}}class QA extends mg{constructor(t,{blockSize:e=65536,cacheSize:n=100}={}){super(),this.source=t,this.blockSize=e,this.blockCache=new $A({maxSize:n,onEviction:(i,s)=>{this.evictedBlocks.set(i,s)}}),this.evictedBlocks=new Map,this.blockRequests=new Map,this.blockIdsToFetch=new Set,this.abortedBlockIds=new Set}get fileSize(){return this.source.fileSize}async fetch(t,e){const n=[],i=[],s=[];this.evictedBlocks.clear();for(const{offset:d,length:g}of t){let f=d+g;const{fileSize:p}=this;p!==null&&(f=Math.min(f,p));const _=Math.floor(d/this.blockSize)*this.blockSize;for(let y=_;ythis.abortedBlockIds.has(d)||!this.blockCache.has(d));if(l.forEach(d=>this.blockIdsToFetch.add(d)),l.length>0&&e&&!e.aborted){this.fetchBlocks(null);for(const d of l){const g=this.blockRequests.get(d);if(!g)throw new Error(`Block ${d} is not in the block requests`);a.push(g)}await Promise.allSettled(a)}if(e&&e.aborted)throw new Us("Request was aborted");const h=s.map(d=>this.blockCache.get(d)||this.evictedBlocks.get(d)),c=h.filter(d=>!d);if(c.length)throw new KA(c,"Request failed");const u=new Map(YA(s,h));return this.readSliceData(t,u)}fetchBlocks(t){if(this.blockIdsToFetch.size>0){const e=this.groupBlocks(this.blockIdsToFetch),n=this.source.fetch(e,t);for(let i=0;i{try{const a=(await n)[i],l=o*this.blockSize,h=l-a.offset,c=Math.min(h+this.blockSize,a.data.byteLength),u=a.data.slice(h,c),d=new JA(l,u.byteLength,u,o);this.blockCache.set(o,d),this.abortedBlockIds.delete(o)}catch(a){if(a.name==="AbortError")a.signal=t,this.blockCache.delete(o),this.abortedBlockIds.add(o);else throw a}finally{this.blockRequests.delete(o)}})())}this.blockIdsToFetch.clear()}}groupBlocks(t){const e=Array.from(t).sort((o,a)=>o-a);if(e.length===0)return[];let n=[],i=null;const s=[];for(const o of e)i===null||i+1===o?(n.push(o),i=o):(s.push(new Up(n[0]*this.blockSize,n.length*this.blockSize,n)),n=[o],i=o);return s.push(new Up(n[0]*this.blockSize,n.length*this.blockSize,n)),s}readSliceData(t,e){return t.map(n=>{let i=n.offset+n.length;this.fileSize!==null&&(i=Math.min(this.fileSize,i));const s=Math.floor(n.offset/this.blockSize),o=Math.floor(i/this.blockSize),a=new ArrayBuffer(n.length),l=new Uint8Array(a);for(let h=s;h<=o;++h){const c=e.get(h),u=c.offset-n.offset,d=c.top-i;let g=0,f=0,p;u<0?g=-u:u>0&&(f=u),d<0?p=c.length-g:p=i-c.offset-g;const _=new Uint8Array(c.data,g,p);l.set(_,f)}return a})}}class _g{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(t){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class yg{constructor(t){this.url=t}async request({headers:t,credentials:e,signal:n}={}){throw new Error("request is not implemented")}}class tL extends _g{constructor(t){super(),this.response=t}get status(){return this.response.status}getHeader(t){return this.response.headers.get(t)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class eL extends yg{constructor(t,e){super(t),this.credentials=e}async request({headers:t,credentials:e,signal:n}={}){const i=await fetch(this.url,{headers:t,credentials:e,signal:n});return new tL(i)}}class rL extends _g{constructor(t,e){super(),this.xhr=t,this.data=e}get status(){return this.xhr.status}getHeader(t){return this.xhr.getResponseHeader(t)}async getData(){return this.data}}class nL extends yg{constructRequest(t,e){return new Promise((n,i)=>{const s=new XMLHttpRequest;s.open("GET",this.url),s.responseType="arraybuffer";for(const[o,a]of Object.entries(t))s.setRequestHeader(o,a);s.onload=()=>{const o=s.response;n(new rL(s,o))},s.onerror=i,s.onabort=()=>i(new Us("Request aborted")),s.send(),e&&(e.aborted&&s.abort(),e.addEventListener("abort",()=>s.abort()))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}const Bp={};class iL extends _g{constructor(t,e){super(),this.response=t,this.dataPromise=e}get status(){return this.response.statusCode}getHeader(t){return this.response.headers[t]}async getData(){return await this.dataPromise}}class sL extends yg{constructor(t){super(t),this.parsedUrl=Bp.parse(this.url),this.httpApi=(this.parsedUrl.protocol,Bp)}constructRequest(t,e){return new Promise((n,i)=>{const s=this.httpApi.get({...this.parsedUrl,headers:t},o=>{const a=new Promise(l=>{const h=[];o.on("data",c=>{h.push(c)}),o.on("end",()=>{const c=Buffer.concat(h).buffer;l(c)}),o.on("error",i)});n(new iL(o,a))});s.on("error",i),e&&(e.aborted&&s.destroy(new Us("Request aborted")),e.addEventListener("abort",()=>s.destroy(new Us("Request aborted"))))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}class xg extends mg{constructor(t,e,n,i){super(),this.client=t,this.headers=e,this.maxRanges=n,this.allowFullFile=i,this._fileSize=null}async fetch(t,e){return this.maxRanges>=t.length?this.fetchSlices(t,e):(this.maxRanges>0&&t.length>1,Promise.all(t.map(n=>this.fetchSlice(n,e))))}async fetchSlices(t,e){const n=await this.client.request({headers:{...this.headers,Range:`bytes=${t.map(({offset:i,length:s})=>`${i}-${i+s}`).join(",")}`},signal:e});if(n.ok)if(n.status===206){const{type:i,params:s}=ZA(n.getHeader("content-type"));if(i==="multipart/byteranges"){const u=qA(await n.getData(),s.boundary);return this._fileSize=u[0].fileSize||null,u}const o=await n.getData(),{start:a,end:l,total:h}=_u(n.getHeader("content-range"));this._fileSize=h||null;const c=[{data:o,offset:a,length:l-a}];if(t.length>1){const u=await Promise.all(t.slice(1).map(d=>this.fetchSlice(d,e)));return c.concat(u)}return c}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const i=await n.getData();return this._fileSize=i.byteLength,[{data:i,offset:0,length:i.byteLength}]}else throw new Error("Error fetching data.")}async fetchSlice(t,e){const{offset:n,length:i}=t,s=await this.client.request({headers:{...this.headers,Range:`bytes=${n}-${n+i}`},signal:e});if(s.ok)if(s.status===206){const o=await s.getData(),{total:a}=_u(s.getHeader("content-range"));return this._fileSize=a||null,{data:o,offset:n,length:i}}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const o=await s.getData();return this._fileSize=o.byteLength,{data:o,offset:0,length:o.byteLength}}else throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function vg(r,{blockSize:t,cacheSize:e}){return t===null?r:new QA(r,{blockSize:t,cacheSize:e})}function oL(r,{headers:t={},credentials:e,maxRanges:n=0,allowFullFile:i=!1,...s}={}){const o=new eL(r,e),a=new xg(o,t,n,i);return vg(a,s)}function aL(r,{headers:t={},maxRanges:e=0,allowFullFile:n=!1,...i}={}){const s=new nL(r),o=new xg(s,t,e,n);return vg(o,i)}function lL(r,{headers:t={},maxRanges:e=0,allowFullFile:n=!1,...i}={}){const s=new sL(r),o=new xg(s,t,e,n);return vg(o,i)}function yu(r,{forceXHR:t=!1,...e}={}){return typeof fetch=="function"&&!t?oL(r,e):typeof XMLHttpRequest<"u"?aL(r,e):lL(r,e)}class hL extends mg{constructor(t){super(),this.file=t}async fetchSlice(t,e){return new Promise((n,i)=>{const s=this.file.slice(t.offset,t.offset+t.length),o=new FileReader;o.onload=a=>n(a.target.result),o.onerror=i,o.onabort=i,o.readAsArrayBuffer(s),e&&e.addEventListener("abort",()=>o.abort())})}}function cL(r){return new hL(r)}function xu(r){switch(r){case St.BYTE:case St.ASCII:case St.SBYTE:case St.UNDEFINED:return 1;case St.SHORT:case St.SSHORT:return 2;case St.LONG:case St.SLONG:case St.FLOAT:case St.IFD:return 4;case St.RATIONAL:case St.SRATIONAL:case St.DOUBLE:case St.LONG8:case St.SLONG8:case St.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${r}`)}}function uL(r){const t=r.GeoKeyDirectory;if(!t)return null;const e={};for(let n=4;n<=t[3]*4;n+=4){const i=wA[t[n]],s=t[n+1]?Go[t[n+1]]:null,o=t[n+2],a=t[n+3];let l=null;if(!s)l=a;else{if(l=r[s],typeof l>"u"||l===null)throw new Error(`Could not get value of geoKey '${i}'.`);typeof l=="string"?l=l.substring(a,a+o-1):l.subarray&&(l=l.subarray(a,a+o),o===1&&(l=l[0]))}e[i]=l}return e}function ls(r,t,e,n){let i=null,s=null;const o=xu(t);switch(t){case St.BYTE:case St.ASCII:case St.UNDEFINED:i=new Uint8Array(e),s=r.readUint8;break;case St.SBYTE:i=new Int8Array(e),s=r.readInt8;break;case St.SHORT:i=new Uint16Array(e),s=r.readUint16;break;case St.SSHORT:i=new Int16Array(e),s=r.readInt16;break;case St.LONG:case St.IFD:i=new Uint32Array(e),s=r.readUint32;break;case St.SLONG:i=new Int32Array(e),s=r.readInt32;break;case St.LONG8:case St.IFD8:i=new Array(e),s=r.readUint64;break;case St.SLONG8:i=new Array(e),s=r.readInt64;break;case St.RATIONAL:i=new Uint32Array(e*2),s=r.readUint32;break;case St.SRATIONAL:i=new Int32Array(e*2),s=r.readInt32;break;case St.FLOAT:i=new Float32Array(e),s=r.readFloat32;break;case St.DOUBLE:i=new Float64Array(e),s=r.readFloat64;break;default:throw new RangeError(`Invalid field type: ${t}`)}if(t===St.RATIONAL||t===St.SRATIONAL)for(let a=0;af.getWidth()-p.getWidth());for(let f=0;f_||o&&o>y)break}}let d=e;if(a){const[g,f]=l.getOrigin(),[p,_]=h.getResolution(l);d=[Math.round((a[0]-g)/p),Math.round((a[1]-f)/_),Math.round((a[2]-g)/p),Math.round((a[3]-f)/_)],d=[Math.min(d[0],d[2]),Math.min(d[1],d[3]),Math.max(d[0],d[2]),Math.max(d[1],d[3])]}return h.readRasters({...t,window:d})}}class Bs extends Fy{constructor(t,e,n,i,s={}){super(),this.source=t,this.littleEndian=e,this.bigTiff=n,this.firstIFDOffset=i,this.cache=s.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,e){const n=this.bigTiff?4048:1024;return new UA((await this.source.fetch([{offset:t,length:typeof e<"u"?e:n}]))[0],t,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(t){const e=this.bigTiff?20:12,n=this.bigTiff?8:2;let i=await this.getSlice(t);const s=this.bigTiff?i.readUint64(t):i.readUint16(t),o=s*e+(this.bigTiff?16:6);i.covers(t,o)||(i=await this.getSlice(t,o));const a={};let l=t+(this.bigTiff?8:2);for(let u=0;u{const e=await this.ifdRequests[t-1];if(e.nextIFDByteOffset===0)throw new al(t);return this.parseFileDirectoryAt(e.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(t=0){const e=await this.requestIFD(t);return new Ly(e.fileDirectory,e.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let t=0,e=!0;for(;e;)try{await this.requestIFD(t),++t}catch(n){if(n instanceof al)e=!1;else throw n}return t}async getGhostValues(){const t=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const e="GDAL_STRUCTURAL_METADATA_SIZE=",n=e.length+100;let i=await this.getSlice(t,n);if(e===ls(i,St.ASCII,e.length,t)){const s=ls(i,St.ASCII,n,t).split(` -`)[0],o=Number(s.split("=")[1].split(" ")[0])+s.length;o>n&&(i=await this.getSlice(t,o));const a=ls(i,St.ASCII,o,t);this.ghostValues={},a.split(` -`).filter(l=>l.length>0).map(l=>l.split("=")).forEach(([l,h])=>{this.ghostValues[l]=h})}return this.ghostValues}static async fromSource(t,e,n){const i=(await t.fetch([{offset:0,length:1024}],n))[0],s=new zA(i),o=s.getUint16(0,0);let a;if(o===18761)a=!0;else if(o===19789)a=!1;else throw new TypeError("Invalid byte order value.");const l=s.getUint16(2,a);let h;if(l===42)h=!1;else if(l===43){if(h=!0,s.getUint16(4,a)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const c=h?s.getUint64(8,a):s.getUint32(4,a);return new Bs(t,a,h,c,e)}close(){return typeof this.source.close=="function"?this.source.close():!1}}class gL extends Fy{constructor(t,e){super(),this.mainFile=t,this.overviewFiles=e,this.imageFiles=[t].concat(e),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const t=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map(e=>e.parseFileDirectoryAt(e.firstIFDOffset)));return this.fileDirectoriesPerFile=await Promise.all(t),this.fileDirectoriesPerFile}async getImage(t=0){await this.getImageCount(),await this.parseFileDirectoriesPerFile();let e=0,n=0;for(let i=0;ie.getImageCount()));return this.imageCounts=await Promise.all(t),this.imageCount=this.imageCounts.reduce((e,n)=>e+n,0),this.imageCount}}async function fL(r,t={},e){return Bs.fromSource(yu(r,t),e)}async function pL(r,t){return Bs.fromSource(cL(r),t)}async function mL(r,t=[],e={},n){const i=await Bs.fromSource(yu(r,e),n),s=await Promise.all(t.map(o=>Bs.fromSource(yu(o,e))));return new gL(i,s)}function _L(r){return((r.fileDirectory.NewSubfileType||0)&4)===4}function yL(r,t){if(!r)return!1;if(r===!0)return!0;if(t.getSamplesPerPixel()!==3)return!1;const e=t.fileDirectory.PhotometricInterpretation,n=He;return e===n.CMYK||e===n.YCbCr||e===n.CIELab||e===n.ICCLab}const Xp="STATISTICS_MAXIMUM",Wp="STATISTICS_MINIMUM",Ac=256;let Lc;function xL(){return Lc||(Lc=new XA),Lc}function vL(r){try{return r.getBoundingBox()}catch{return[0,0,r.getWidth(),r.getHeight()]}}function wL(r){try{return r.getOrigin().slice(0,2)}catch{return[0,r.getHeight()]}}function SL(r,t){try{return r.getResolution(t)}catch{return[t.getWidth()/r.getWidth(),t.getHeight()/r.getHeight()]}}function EL(r){const t=r.geoKeys;if(!t)return null;if(t.ProjectedCSTypeGeoKey&&t.ProjectedCSTypeGeoKey!==32767){const e="EPSG:"+t.ProjectedCSTypeGeoKey;let n=K(e);if(!n){const i=Kg(t.ProjLinearUnitsGeoKey);i&&(n=new Fs({code:e,units:i}))}return n}if(t.GeographicTypeGeoKey&&t.GeographicTypeGeoKey!==32767){const e="EPSG:"+t.GeographicTypeGeoKey;let n=K(e);if(!n){const i=Kg(t.GeogAngularUnitsGeoKey);i&&(n=new Fs({code:e,units:i}))}return n}return null}function bL(r){return r.getImageCount().then(function(t){const e=new Array(t);for(let n=0;ne*r)throw new Error(n)}function ML(r){return r instanceof Int8Array?-128:r instanceof Int16Array?-32768:r instanceof Int32Array?-2147483648:r instanceof Float32Array?12e-39:0}function RL(r){return r instanceof Int8Array?127:r instanceof Uint8Array||r instanceof Uint8ClampedArray?255:r instanceof Int16Array?32767:r instanceof Uint16Array?65535:r instanceof Int32Array?2147483647:r instanceof Uint32Array?4294967295:r instanceof Float32Array?34e37:255}class wg extends ig{constructor(t){super({state:"loading",tileGrid:null,projection:t.projection||null,opaque:t.opaque,transition:t.transition,interpolate:t.interpolate!==!1,wrapX:t.wrapX}),this.sourceInfo_=t.sources;const e=this.sourceInfo_.length;this.sourceOptions_=t.sourceOptions,this.sourceImagery_=new Array(e),this.sourceMasks_=new Array(e),this.resolutionFactors_=new Array(e),this.samplesPerPixel_,this.nodataValues_,this.metadata_,this.normalize_=t.normalize!==!1,this.addAlpha_=!1,this.error_=null,this.convertToRGB_=t.convertToRGB||!1,this.setKey(this.sourceInfo_.map(s=>s.url).join(","));const n=this,i=new Array(e);for(let s=0;s=0;--n){const i=e[n],s=EL(i);if(s){this.projection=s;break}}}configure_(t){let e,n,i,s,o;const a=new Array(t.length),l=new Array(t.length),h=new Array(t.length);let c=0;const u=t.length;for(let p=0;p{_L(C)?y.push(C):_.push(C)});const v=_.length;if(y.length>0&&y.length!==v)throw new Error(`Expected one mask per image found ${y.length} masks and ${v} images`);let w,S;const E=new Array(v),T=new Array(v),M=new Array(v);l[p]=new Array(v),h[p]=new Array(v);for(let C=0;CM.length&&(c=o.length-M.length);const C=o[o.length-1]/M[M.length-1];this.resolutionFactors_[p]=C;const P=M.map(D=>D*=C),G=`Resolution mismatch for source ${p}, got [${P}] but expected [${o}]`;Eo(o.slice(c,o.length),P,.02,G,this.viewRejector)}i?Eo(i.slice(c,i.length),T,.01,`Tile size mismatch for source ${p}`,this.viewRejector):i=T,s?Eo(s.slice(c,s.length),E,0,`Tile size mismatch for source ${p}`,this.viewRejector):s=E,this.sourceImagery_[p]=_.reverse(),this.sourceMasks_[p]=y.reverse()}for(let p=0,_=this.sourceImagery_.length;p<_;++p){const y=this.sourceImagery_[p];for(;y.lengththis.getImageInternal(o,a,l,s),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,e,n,i){if(this.loader){const s=Xh(t,e,n,1),o=this.findNearestResolution(e);if(this.image&&(this.static_||this.wantedProjection_===i&&(this.wantedExtent_&&Ze(this.wantedExtent_,s)||Ze(this.image.getExtent(),s))&&(this.wantedResolution_&&ql(this.wantedResolution_)===o||ql(this.image.getResolution())===o)))return this.image;this.wantedProjection_=i,this.wantedExtent_=s,this.wantedResolution_=o,this.image=new yh(s,o,n,this.loader),this.image.addEventListener(Ct.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const e=t.target;let n;switch(e.getState()){case J.LOADING:this.loading=!0,n=Oc.IMAGELOADSTART;break;case J.LOADED:this.loading=!1,n=Oc.IMAGELOADEND;break;case J.ERROR:this.loading=!1,n=Oc.IMAGELOADERROR;break;default:return}this.hasListener(n)&&this.dispatchEvent(new IL(n,e))}}function Bh(r,t){r.getImage().src=t}function Xh(r,t,e,n){const i=t/e,s=Me(r),o=ri(mt(r)/i,nn),a=ri(qt(r)/i,nn),l=ri((n-1)*o/2,nn),h=o+2*l,c=ri((n-1)*a/2,nn),u=a+2*c;return ku(s,i,0,[h,u])}const xi=PL;function Ny(r){const t=r.load||mi,e=r.imageExtent,n=new Image;return r.crossOrigin!==null&&(n.crossOrigin=r.crossOrigin),()=>t(n,r.url).then(i=>{const s=mt(e)/i.width,o=qt(e)/i.height;return{image:i,extent:e,resolution:s!==o?[s,o]:o,pixelRatio:1}})}class Dy extends xi{constructor(t){const e=t.crossOrigin!==void 0?t.crossOrigin:null,n=t.imageLoadFunction!==void 0?t.imageLoadFunction:Bh;super({attributions:t.attributions,interpolate:t.interpolate,projection:K(t.projection)}),this.url_=t.url,this.imageExtent_=t.imageExtent,this.image=null,this.image=new yh(this.imageExtent_,void 0,1,Ny({url:t.url,imageExtent:t.imageExtent,crossOrigin:e,load:(i,s)=>(this.image.setImage(i),n(this.image,s),mi(i))})),this.image.addEventListener(Ct.CHANGE,this.handleImageChange.bind(this))}getImageExtent(){return this.imageExtent_}getImageInternal(t,e,n,i){return Yt(t,this.image.getExtent())?this.image:null}getUrl(){return this.url_}}function AL(r,t){const e=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,s=/\{-y\}/g;return function(o,a,l){if(o)return r.replace(e,o[0].toString()).replace(n,o[1].toString()).replace(i,o[2].toString()).replace(s,function(){const h=o[0],c=t.getFullTileRange(h);if(!c)throw new Error("The {-y} placeholder requires a tile grid with extent");return(c.getHeight()-o[2]-1).toString()})}}function Sg(r,t){const e=r.length,n=new Array(e);for(let i=0;ithis.getTileInternal(_,y,v,w,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return p.key=u,h?(p.interimTile=h,p.refreshInterimChain(),a.replace(c,p)):a.set(c,p),p}getTileInternal(t,e,n,i,s){let o=null;const a=un(t,e,n),l=this.getKey();if(!this.tileCache.containsKey(a))o=this.createTile_(t,e,n,i,s,l),this.tileCache.set(a,o);else if(o=this.tileCache.get(a),o.key!=l){const h=o;o=this.createTile_(t,e,n,i,s,l),h.getState()==B.IDLE?o.interimTile=h.interimTile:o.interimTile=h,o.refreshInterimChain(),this.tileCache.replace(a,o)}return o}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(const e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){const n=K(t);if(n){const i=tt(n);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}}clear(){super.clear();for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}}function OL(r,t){r.getImage().src=t}function Mg(r,t,e,n){const i=document.createElement("script"),s="olc_"+tt(t);function o(){delete window[s],i.parentNode.removeChild(i)}i.async=!0,i.src=r+(r.includes("?")?"&":"?")+"callback="+s;const a=setTimeout(function(){o(),e&&e()},1e4);window[s]=function(l){clearTimeout(a),o(),t(l)},document.head.appendChild(i)}class FL extends Error{constructor(t){const e="Unexpected response status: "+t.status;super(e),this.name="ResponseError",this.response=t}}class NL extends Error{constructor(t){super("Failed to issue request"),this.name="ClientError",this.client=t}}function ky(r){return new Promise(function(t,e){function n(o){const a=o.target;if(!a.status||a.status>=200&&a.status<300){let l;try{l=JSON.parse(a.responseText)}catch(h){const c="Error parsing response text as JSON: "+h.message;e(new Error(c));return}t(l);return}e(new FL(a))}function i(o){e(new NL(o.target))}const s=new XMLHttpRequest;s.addEventListener("load",n),s.addEventListener("error",i),s.open("GET",r),s.setRequestHeader("Accept","application/json"),s.send()})}function Gy(r,t){return t.includes("://")?t:new URL(t,r).href}class jy extends Pr{constructor(t){if(super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:K("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.tileJSON_=null,this.tileSize_=t.tileSize,t.url)if(t.jsonp)Mg(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else if(t.tileJSON)this.handleTileJSONResponse(t.tileJSON);else throw new Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let n;try{n=JSON.parse(e.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(n)}else this.handleTileJSONError()}onXHRError_(t){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(t){const e=K("EPSG:4326"),n=this.getProjection();let i;if(t.bounds!==void 0){const h=qi(e,n);i=Os(t.bounds,h)}const s=Wn(n),o=t.minzoom||0,a=t.maxzoom||22,l=Yi({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=Sg(t.tiles,l),t.attribution&&!this.getAttributions()){const h=i!==void 0?i:s;this.setAttributions(function(c){return Yt(h,c.extent)?[t.attribution]:null})}this.tileJSON_=t,this.setState("ready")}handleTileJSONError(){this.setState("error")}}let DL=class extends ro{constructor(r,t,e,n,i,s){super(r,t,s),this.extent=null,this.format_=n,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=i,this.url_=e,this.key=e}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==B.IDLE&&(this.setState(B.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(r,t){this.setFeatures(r)}onError(){this.setState(B.ERROR)}setFeatures(r){this.features_=r,this.setState(B.LOADED)}setLoader(r){this.loader_=r}};const Zp=[];class kL extends ro{constructor(t,e,n,i){super(t,e,{transition:0}),this.context_={},this.executorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=i.bind(void 0,this),this.wrappedTileCoord=n}getContext(t){const e=tt(t);return e in this.context_||(this.context_[e]=Ht(1,1,Zp)),this.context_[e]}hasContext(t){return tt(t)in this.context_}getImage(t){return this.hasContext(t)?this.getContext(t).canvas:null}getReplayState(t){const e=tt(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]}load(){this.getSourceTiles()}release(){for(const t in this.context_){const e=this.context_[t];ki(e),Zp.push(e.canvas),delete this.context_[t]}super.release()}}class Wh extends Tg{constructor(t){const e=t.projection||"EPSG:3857",n=t.extent||Wn(e),i=t.tileGrid||Yi({extent:n,maxResolution:t.maxResolution,maxZoom:t.maxZoom!==void 0?t.maxZoom:22,minZoom:t.minZoom,tileSize:t.tileSize||512});super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,interpolate:!0,opaque:!1,projection:e,state:t.state,tileGrid:i,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:GL,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX===void 0?!0:t.wrapX,transition:t.transition,zDirection:t.zDirection===void 0?1:t.zDirection}),this.format_=t.format?t.format:null,this.sourceTileCache=new zh(this.tileCache.highWaterMark),this.overlaps_=t.overlaps==null?!0:t.overlaps,this.tileClass=t.tileClass?t.tileClass:DL,this.tileGrids_={}}getFeaturesInExtent(t){const e=[],n=this.tileCache;if(n.getCount()===0)return e;const i=U_(n.peekFirstKey())[0],s=this.tileGrid;return n.forEach(function(o){if(o.tileCoord[0]!==i||o.getState()!==B.LOADED)return;const a=o.getSourceTiles();for(let l=0,h=a.length;l{const a=pI(o),l=n.peek(a);if(l){const h=l.sourceTiles;for(let c=0,u=h.length;c{const g=this.tileUrlFunction(d,t,e),f=this.sourceTileCache.containsKey(g)?this.sourceTileCache.get(g):new this.tileClass(d,g?B.IDLE:B.EMPTY,g,this.format_,this.tileLoadFunction);n.sourceTiles.push(f);const p=f.getState();if(p{this.handleTileChange(y);const v=f.getState();if(v===B.LOADED||v===B.ERROR){const w=f.getKey();w in n.errorTileKeys?f.getState()===B.LOADED&&delete n.errorTileKeys[w]:n.loadingSourceTiles--,v===B.ERROR?n.errorTileKeys[w]=!0:f.removeEventListener(Ct.CHANGE,_),n.loadingSourceTiles===0&&n.setState(Fn(n.errorTileKeys)?B.LOADED:B.ERROR)}};f.addEventListener(Ct.CHANGE,_),n.loadingSourceTiles++}p===B.IDLE&&(f.extent=h.getTileCoordExtent(d),f.projection=e,f.resolution=h.getResolution(d[0]),this.sourceTileCache.set(g,f),f.load())}),n.loadingSourceTiles||n.setState(n.sourceTiles.some(d=>d.getState()===B.ERROR)?B.ERROR:B.LOADED)}return n.sourceTiles}getTile(t,e,n,i,s){const o=un(t,e,n),a=this.getKey();let l;if(this.tileCache.containsKey(o)&&(l=this.tileCache.get(o),l.key===a))return l;const h=[t,e,n];let c=this.getTileCoordForTileUrlFunction(h,s);const u=this.getTileGrid().getExtent(),d=this.getTileGridForProjection(s);if(c&&u){const p=d.getTileCoordExtent(c);Cr(p,-d.getResolution(t),p),Yt(u,p)||(c=null)}let g=!0;if(c!==null){const p=this.tileGrid,_=d.getResolution(t),y=p.getZForResolution(_,1),v=d.getTileCoordExtent(c);Cr(v,-_,v),p.forEachTileCoord(v,y,w=>{g=g&&!this.tileUrlFunction(w,i,s)})}const f=new kL(h,g?B.EMPTY:B.IDLE,c,this.getSourceTiles.bind(this,i,s));return f.key=a,l?(f.interimTile=l,f.refreshInterimChain(),this.tileCache.replace(o,f)):this.tileCache.set(o,f),f}getTileGridForProjection(t){const e=t.getCode();let n=this.tileGrids_[e];if(!n){const i=this.tileGrid,s=i.getResolutions().slice(),o=s.map(function(h,c){return i.getOrigin(c)}),a=s.map(function(h,c){return i.getTileSize(c)}),l=a_+1;for(let h=s.length;h=0;return i[a?"CRS":"SRS"]=n.getCode(),a&&s.substr(0,2)=="ne"?o=[t[1],t[0],t[3],t[2]]:o=t,i.BBOX=o.join(","),Gn(r,i)}function Uy(r,t,e,n,i,s,o){s=Object.assign({REQUEST:"GetMap"},s);const a=t/e,l=[vl(mt(r)/a,nn),vl(qt(r)/a,nn)];if(e!=1)switch(o){case"geoserver":const h=90*e+.5|0;"FORMAT_OPTIONS"in s?s.FORMAT_OPTIONS+=";dpi:"+h:s.FORMAT_OPTIONS="dpi:"+h;break;case"mapserver":s.MAP_RESOLUTION=90*e;break;case"carmentaserver":case"qgis":s.DPI=90*e;break;default:throw new Error("Unknown `serverType` configured")}return zy(i,r,l,n,s)}function Kl(r,t){return Object.assign({REQUEST:t,SERVICE:"WMS",VERSION:Hl,FORMAT:"image/png",STYLES:"",TRANSPARENT:!0},r)}function By(r){const t=r.hidpi===void 0?!0:r.hidpi,e=K(r.projection||"EPSG:3857"),n=r.ratio||1.5,i=r.load||mi;return(s,o,a)=>{s=Xh(s,o,a,n),a!=1&&(!t||r.serverType===void 0)&&(a=1);const l=Uy(s,o,a,e,r.url,Kl(r.params,"GetMap"),r.serverType),h=new Image;return r.crossOrigin!==null&&(h.crossOrigin=r.crossOrigin),i(h,l).then(c=>({image:c,extent:s,pixelRatio:a}))}}function jL(r,t,e){if(r.url===void 0)return;const n=K(r.projection||"EPSG:3857"),i=ku(t,e,0,qp),s={QUERY_LAYERS:r.params.LAYERS,INFO_FORMAT:"application/json"};Object.assign(s,Kl(r.params,"GetFeatureInfo"),r.params);const o=_s((t[0]-i[0])/e,nn),a=_s((i[3]-t[1])/e,nn),l=zu(s.VERSION,"1.3")>=0;return s[l?"I":"X"]=o,s[l?"J":"Y"]=a,zy(r.url,i,qp,n,s)}function zL(r,t){if(r.url===void 0)return;const e={SERVICE:"WMS",VERSION:Hl,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(r.params===void 0||r.params.LAYER===void 0){const n=r.params.LAYERS;if(!(!Array.isArray(n)||n.length===1))return;e.LAYER=n}if(t!==void 0){const n=K(r.projection||"EPSG:3857").getMetersPerUnit()||1,i=28e-5;e.SCALE=t*n/i}return Object.assign(e,r.params),Gn(r.url,e)}class Xy extends Pr{constructor(t){t=t||{};const e=Object.assign({},t.params),n="TRANSPARENT"in e?e.TRANSPARENT:!0;super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:!n,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0,this.params_=e,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=je(),this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(t,e,n,i){const s=K(n),o=this.getProjection()||s;let a=this.getTileGrid();a||(a=this.getTileGridForProjection(o));const l=ch(t,s,o),h=oa(o,s,t,e),c=a.getZForResolution(h,this.zDirection),u=a.getResolution(c),d=a.getTileCoordForCoordAndZ(l,c);if(a.getResolutions().length<=d[0])return;let g=a.getTileCoordExtent(d,this.tmpExtent_);const f=this.gutter_;f!==0&&(g=Cr(g,u*f,g));const p={QUERY_LAYERS:this.params_.LAYERS};Object.assign(p,Kl(this.params_,"GetFeatureInfo"),i);const _=Math.floor((l[0]-g[0])/u),y=Math.floor((g[3]-l[1])/u);return p[this.v13_?"I":"X"]=_,p[this.v13_?"J":"Y"]=y,this.getRequestUrl_(d,g,1,o||s,p)}getLegendUrl(t,e){if(this.urls[0]===void 0)return;const n={SERVICE:"WMS",VERSION:Hl,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(e===void 0||e.LAYER===void 0){const i=this.params_.LAYERS;if(!(!Array.isArray(i)||i.length===1))return;n.LAYER=i}if(t!==void 0){const i=this.getProjection()?this.getProjection().getMetersPerUnit():1,s=28e-5;n.SCALE=t*i/s}return Object.assign(n,e),Gn(this.urls[0],n)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,e,n,i,s){const o=this.urls;if(!o)return;let a;if(o.length==1)a=o[0];else{const l=an(qd(t),o.length);a=o[l]}return Uy(e,(this.tileGrid||this.getTileGridForProjection(i)).getResolution(t[0]),n,i,a,s,this.serverType_)}getTilePixelRatio(t){return!this.hidpi_||this.serverType_===void 0?1:t}getKeyForParams_(){let t=0;const e=[];for(const n in this.params_)e[t++]=n+"-"+this.params_[n];return e.join("/")}updateParams(t){Object.assign(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())}updateV13_(){const t=this.params_.VERSION||Hl;this.v13_=zu(t,"1.3")>=0}tileUrlFunction(t,e,n){let i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(n)),i.getResolutions().length<=t[0])return;e!=1&&(!this.hidpi_||this.serverType_===void 0)&&(e=1);const s=i.getResolution(t[0]);let o=i.getTileCoordExtent(t,this.tmpExtent_);const a=this.gutter_;a!==0&&(o=Cr(o,s*a,o));const l=Object.assign({},Kl(this.params_,"GetMap"));return this.getRequestUrl_(t,o,e,n,l)}}class Wy extends Pr{constructor(t){const e=t.requestEncoding!==void 0?t.requestEncoding:"KVP",n=t.tileGrid;let i=t.urls;i===void 0&&t.url!==void 0&&(i=Eg(t.url)),super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:i,wrapX:t.wrapX!==void 0?t.wrapX:!1,transition:t.transition,zDirection:t.zDirection}),this.version_=t.version!==void 0?t.version:"1.0.0",this.format_=t.format!==void 0?t.format:"image/jpeg",this.dimensions_=t.dimensions!==void 0?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=e,this.setKey(this.getKeyForDimensions_()),i&&i.length>0&&(this.tileUrlFunction=Xs(i.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const e=t.join(` -`);this.setTileUrlFunction(Xs(t.map(this.createFromWMTSTemplate.bind(this))),e)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){const t=this.urls?this.urls.slice(0):[];for(const e in this.dimensions_)t.push(e+"-"+this.dimensions_[e]);return t.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const e=this.requestEncoding_,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e=="KVP"&&Object.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e=="KVP"?Gn(t,n):t.replace(/\{(\w+?)\}/g,function(o,a){return a.toLowerCase()in n?n[a.toLowerCase()]:o});const i=this.tileGrid,s=this.dimensions_;return function(o,a,l){if(!o)return;const h={TileMatrix:i.getMatrixId(o[0]),TileCol:o[1],TileRow:o[2]};Object.assign(h,s);let c=t;return e=="KVP"?c=Gn(c,h):c=c.replace(/\{(\w+?)\}/g,function(u,d){return h[d]}),c}}}function Zy(r,t){const e=r.Contents.Layer,n=e?.find(function(D){return D.Identifier==t.layer});if(!n)return null;const i=r.Contents.TileMatrixSet;let s;n.TileMatrixSetLink.length>1?"projection"in t?s=n.TileMatrixSetLink.findIndex(function(D){const z=i.find(function(b){return b.Identifier==D.TileMatrixSet}).SupportedCRS,m=K(z),x=K(t.projection);return m&&x?Ie(m,x):z==t.projection}):s=n.TileMatrixSetLink.findIndex(function(D){return D.TileMatrixSet==t.matrixSet}):s=0,s<0&&(s=0);const o=n.TileMatrixSetLink[s].TileMatrixSet,a=n.TileMatrixSetLink[s].TileMatrixSetLimits;let l=n.Format[0];"format"in t&&(l=t.format),s=n.Style.findIndex(function(D){return"style"in t?D.Title==t.style:D.isDefault}),s<0&&(s=0);const h=n.Style[s].Identifier,c={};"Dimension"in n&&n.Dimension.forEach(function(D,z,m){const x=D.Identifier;let b=D.Default;b===void 0&&(b=D.Value[0]),c[x]=b});const u=r.Contents.TileMatrixSet.find(function(D){return D.Identifier==o});let d;const g=u.SupportedCRS;if(g&&(d=K(g)),"projection"in t){const D=K(t.projection);D&&(!d||Ie(D,d))&&(d=D)}let f=!1;const p=d.getAxisOrientation().substr(0,2)=="ne";let _=u.TileMatrix[0],y={MinTileCol:0,MinTileRow:0,MaxTileCol:_.MatrixWidth-1,MaxTileRow:_.MatrixHeight-1};if(a){y=a[a.length-1];const D=u.TileMatrix.find(z=>z.Identifier===y.TileMatrix||u.Identifier+":"+z.Identifier===y.TileMatrix);D&&(_=D)}const v=_.ScaleDenominator*28e-5/d.getMetersPerUnit(),w=p?[_.TopLeftCorner[1],_.TopLeftCorner[0]]:_.TopLeftCorner,S=_.TileWidth*v,E=_.TileHeight*v;let T=u.BoundingBox;T&&p&&(T=[T[1],T[0],T[3],T[2]]);let M=[w[0]+S*y.MinTileCol,w[1]-E*(1+y.MaxTileRow),w[0]+S*(1+y.MaxTileCol),w[1]-E*y.MinTileRow];if(T!==void 0&&!Ze(T,M)){const D=n.WGS84BoundingBox,z=K("EPSG:4326").getExtent();if(M=T,D)f=D[0]===z[0]&&D[2]===z[2];else{const m=Xu(T,u.SupportedCRS,"EPSG:4326");f=m[0]-1e-10<=z[0]&&m[2]+1e-10>=z[2]}}const C=DP(u,M,a),P=[];let G=t.requestEncoding;if(G=G!==void 0?G:"","OperationsMetadata"in r&&"GetTile"in r.OperationsMetadata){const D=r.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let z=0,m=D.length;zy)return 1;if(y>_)return-1}var v=g[g.length-1],w=f[f.length-1];if(v&&w){var S=v.split(".").map(s),E=w.split(".").map(s);for(p=0;pE[p])return 1;if(E[p]>S[p])return-1}}else if(v||w)return v?-1:1;return 0}var l=[">",">=","=","<","<="],h={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};function c(u){if(typeof u!="string")throw new TypeError("Invalid operator type, expected string but got "+typeof u);if(l.indexOf(u)===-1)throw new TypeError("Invalid operator, expected one of "+l.join("|"))}return a.validate=function(u){return typeof u=="string"&&e.test(u)},a.compare=function(u,d,g){c(g);var f=a(u,d);return h[g].indexOf(f)>-1},a})})(qy);var UL=qy.exports,vu=UL;const Rg="1.0.0",ct={classification:"https://stac-extensions.github.io/classification/v1.1.0/schema.json",datacube:"https://stac-extensions.github.io/datacube/v2.1.0/schema.json",eo:"https://stac-extensions.github.io/eo/v1.0.0/schema.json",file:"https://stac-extensions.github.io/file/v1.0.0/schema.json","item-assets":"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json",label:"https://stac-extensions.github.io/label/v1.0.1/schema.json",pointcloud:"https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json",processing:"https://stac-extensions.github.io/processing/v1.1.0/schema.json",projection:"https://stac-extensions.github.io/projection/v1.0.0/schema.json",raster:"https://stac-extensions.github.io/raster/v1.1.0/schema.json",sar:"https://stac-extensions.github.io/sar/v1.0.0/schema.json",sat:"https://stac-extensions.github.io/sat/v1.0.0/schema.json",scientific:"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",table:"https://stac-extensions.github.io/table/v1.2.0/schema.json",timestamps:"https://stac-extensions.github.io/timestamps/v1.0.0/schema.json",version:"https://stac-extensions.github.io/version/v1.0.0/schema.json",view:"https://stac-extensions.github.io/view/v1.0.0/schema.json"},Fi={itemAndCollection:{"cube:":ct.datacube,"eo:":ct.eo,"file:":ct.file,"label:":ct.label,"pc:":ct.pointcloud,"processing:":ct.processing,"proj:":ct.projection,"raster:":ct.raster,"sar:":ct.sar,"sat:":ct.sat,"sci:":ct.scientific,"view:":ct.view,version:ct.version,deprecated:ct.version,published:ct.timestamps,expires:ct.timestamps,unpublished:ct.timestamps},catalog:{},collection:{item_assets:ct["item-assets"]},item:{}};Fi.collection=Object.assign(Fi.collection,Fi.itemAndCollection);Fi.item=Object.assign(Fi.item,Fi.itemAndCollection);var bo={parseUrl(r){let t=r.match(/^https?:\/\/stac-extensions.github.io\/([^\/]+)\/v([^\/]+)\/[^.]+.json$/i);if(t)return{id:t[1],version:t[2]}}},At={version:Rg,extensions:{},set(r){if(typeof r.stac_version!="string"?At.version="0.6.0":At.version=r.stac_version,Array.isArray(r.stac_extensions))for(let t of r.stac_extensions){let e=bo.parseUrl(t);e&&(At.extensions[e.id]=e.version)}},before(r,t=null){let e=t?At.extensions[t]:At.version;return typeof e>"u"?!1:vu.compare(e,r,"<")}},O={type(r){let t=typeof r;if(t==="object"){if(r===null)return"null";if(Array.isArray(r))return"array"}return t},is(r,t){return O.type(r)===t},isDefined(r){return typeof r<"u"},isObject(r){return typeof r=="object"&&r===Object(r)&&!Array.isArray(r)},rename(r,t,e){return typeof r[t]<"u"&&typeof r[e]>"u"?(r[e]=r[t],delete r[t],!0):!1},forAll(r,t,e){if(r[t]&&typeof r[t]=="object")for(let n in r[t])e(r[t][n])},toArray(r,t){return typeof r[t]<"u"&&!Array.isArray(r[t])?(r[t]=[r[t]],!0):!1},flattenArray(r,t,e,n=!1){if(Array.isArray(r[t])){for(let i in r[t])if(typeof e[i]=="string"){let s=r[t][i];r[e[i]]=n?[s]:s}return delete r[t],!0}return!1},flattenOneElementArray(r,t,e=!1){return!e&&Array.isArray(r[t])?r[t].length===1?(r[t]=r[t][0],!0):!1:!0},removeFromArray(r,t,e){if(Array.isArray(r[t])){let n=r[t].indexOf(e);return n>-1&&r[t].splice(n,1),!0}return!1},ensure(r,t,e){return O.type(e)!==O.type(r[t])&&(r[t]=e),!0},upgradeExtension(r,t){let{id:e,version:n}=bo.parseUrl(t),i=r.stac_extensions.findIndex(s=>{let o=bo.parseUrl(s);return o&&o.id===e&&vu.compare(o.version,n,"<")});return i!==-1?(r.stac_extensions[i]=t,!0):!1},addExtension(r,t){let{id:e,version:n}=bo.parseUrl(t),i=r.stac_extensions.findIndex(s=>{if(s===t)return!0;let o=bo.parseUrl(s);return!!(o&&o.id===e&&vu.compare(o.version,n,"<"))});return i===-1?r.stac_extensions.push(t):r.stac_extensions[i]=t,r.stac_extensions.sort(),!0},removeExtension(r,t){return O.removeFromArray(r,"stac_extensions",t)},migrateExtensionShortnames(r){let t=Object.keys(ct),e=Object.values(ct);return O.mapValues(r,"stac_extensions",t,e)},populateExtensions(r,t){let e=[];(t=="catalog"||t=="collection")&&e.push(r),(t=="item"||t=="collection")&&O.isObject(r.assets)&&(e=e.concat(Object.values(r.assets))),t=="collection"&&O.isObject(r.item_assets)&&(e=e.concat(Object.values(r.item_assets))),t=="collection"&&O.isObject(r.summaries)&&e.push(r.summaries),t=="item"&&O.isObject(r.properties)&&e.push(r.properties);for(let n of e)Object.keys(n).forEach(i=>{let s=i.match(/^(\w+:|[^:]+$)/i);if(Array.isArray(s)){let o=Fi[t][s[0]];O.is(o,"string")&&O.addExtension(r,o)}})},mapValues(r,t,e,n){let i=s=>{let o=e.indexOf(s);return o>=0?n[o]:s};return Array.isArray(r[t])?r[t]=r[t].map(i):typeof r[t]<"u"&&(r[t]=i(r[t])),!0},mapObject(r,t){for(let e in r)r[e]=t(r[e],e)},moveTo(r,t,e,n=!1,i=!1){let s;return n?i?s=o=>Array.isArray(o):s=o=>Array.isArray(o)&&o.length===1:s=O.isDefined,s(r[t])?(e[t]=n&&!i?r[t][0]:r[t],delete r[t],!0):!1},runAll(r,t,e,n){for(let i in r)i.startsWith("migrate")||r[i](t,e,n)},toUTC(r,t){if(typeof r[t]=="string")try{return r[t]=this.toISOString(r[t]),!0}catch{}return delete r[t],!1},toISOString(r){return r instanceof Date||(r=new Date(r)),r.toISOString().replace(".000","")}},en={multihash:null,hexToUint8(r){if(r.length===0||r.length%2!==0)throw new Error(`The string "${r}" is not valid hex.`);return new Uint8Array(r.match(/.{1,2}/g).map(t=>parseInt(t,16)))},uint8ToHex(r){return r.reduce((t,e)=>t+e.toString(16).padStart(2,"0"),"")},toMultihash(r,t,e){if(!en.multihash||!O.is(r[t],"string"))return!1;try{const n=en.multihash.encode(en.hexToUint8(r[t]),e);return r[t]=en.uint8ToHex(n),!0}catch(n){return console.warn(n),!1}}},Cg={migrate(r,t=!0){return At.set(r),t&&(r.stac_version=Rg),r.type="Catalog",O.ensure(r,"stac_extensions",[]),At.before("1.0.0-rc.1")&&O.migrateExtensionShortnames(r),O.ensure(r,"id",""),O.ensure(r,"description",""),O.ensure(r,"links",[]),O.runAll(Cg,r,r),At.before("0.8.0")&&O.populateExtensions(r,"catalog"),r}},Ig={migrate(r,t=!0){return Cg.migrate(r,t),r.type="Collection",At.before("1.0.0-rc.1")&&O.migrateExtensionShortnames(r),O.ensure(r,"license","proprietary"),O.ensure(r,"extent",{spatial:{bbox:[]},temporal:{interval:[]}}),O.runAll(Ig,r,r),O.isObject(r.properties)&&(O.removeFromArray(r,"stac_extensions","commons"),delete r.properties),At.before("0.8.0")&&O.populateExtensions(r,"collection"),At.before("1.0.0-beta.1")&&O.mapValues(r,"stac_extensions",["assets"],["item-assets"]),r},extent(r){if(O.ensure(r,"extent",{}),At.before("0.8.0")&&(Array.isArray(r.extent.spatial)&&(r.extent.spatial={bbox:[r.extent.spatial]}),Array.isArray(r.extent.temporal)&&(r.extent.temporal={interval:[r.extent.temporal]})),O.ensure(r.extent,"spatial",{}),O.ensure(r.extent.spatial,"bbox",[]),O.ensure(r.extent,"temporal",{}),O.ensure(r.extent.temporal,"interval",[]),At.before("1.0.0-rc.3")){if(r.extent.temporal.interval.length>1){let t,e;for(let n of r.extent.temporal.interval){if(n[0]===null)t=null;else if(typeof n[0]=="string"&&t!==null)try{let i=new Date(n[0]);(typeof t>"u"||i"u"||i>e)&&(e=i)}catch{}}r.extent.temporal.interval.unshift([t?O.toISOString(t):null,e?O.toISOString(e):null])}if(r.extent.spatial.bbox.length>1){let t=r.extent.spatial.bbox.reduce((e,n)=>Array.isArray(n)?Math.max(n.length,e):e,4);if(t>=4){let e=new Array(t).fill(null),n=t/2;for(let i of r.extent.spatial.bbox){if(!Array.isArray(i)||i.length<4)break;for(let s in i){let o=i[s];e[s]===null?e[s]=o:si===null)===-1&&r.extent.spatial.bbox.unshift(e)}}}},collectionAssets(r){At.before("1.0.0-rc.1")&&O.removeExtension(r,"collection-assets"),ha.migrateAll(r)},itemAsset(r){At.before("1.0.0-beta.2")&&O.rename(r,"item_assets","assets"),ha.migrateAll(r,"item_assets")},summaries(r){if(O.ensure(r,"summaries",{}),At.before("0.8.0")&&O.isObject(r.other_properties)){for(let t in r.other_properties){let e=r.other_properties[t];Array.isArray(e.extent)&&e.extent.length===2?r.summaries[t]={minimum:e.extent[0],maximum:e.extent[1]}:Array.isArray(e.values)&&(e.values.filter(n=>Array.isArray(n)).length===e.values.length?r.summaries[t]=e.values.reduce((n,i)=>n.concat(i),[]):r.summaries[t]=e.values)}delete r.other_properties}if(At.before("1.0.0-beta.1")&&O.isObject(r.properties)&&!r.links.find(t=>["child","item"].includes(t.rel)))for(let t in r.properties){let e=r.properties[t];Array.isArray(e)||(e=[e]),r.summaries[t]=e}At.before("1.0.0-rc.1")&&O.mapObject(r.summaries,t=>(O.rename(t,"min","minimum"),O.rename(t,"max","maximum"),t)),Zh.migrate(r.summaries,r,!0),O.moveTo(r.summaries,"sci:doi",r,!0)&&O.addExtension(r,ct.scientific),O.moveTo(r.summaries,"sci:publications",r,!0,!0)&&O.addExtension(r,ct.scientific),O.moveTo(r.summaries,"sci:citation",r,!0)&&O.addExtension(r,ct.scientific),O.moveTo(r.summaries,"cube:dimensions",r,!0)&&O.addExtension(r,ct.datacube),Object.keys(r.summaries).length===0&&delete r.summaries}},Pg={migrate(r,t=null,e=!0){At.set(r),e&&(r.stac_version=Rg),O.ensure(r,"stac_extensions",[]),At.before("1.0.0-rc.1")&&O.migrateExtensionShortnames(r),O.ensure(r,"id",""),O.ensure(r,"type","Feature"),O.isObject(r.geometry)||(r.geometry=null),r.geometry!==null&&O.ensure(r,"bbox",[]),O.ensure(r,"properties",{}),O.ensure(r,"links",[]),O.ensure(r,"assets",{});let n=!1;return O.isObject(t)&&O.isObject(t.properties)&&(O.removeFromArray(r,"stac_extensions","commons"),r.properties=Object.assign({},t.properties,r.properties),n=!0),O.runAll(Pg,r,r),Zh.migrate(r.properties,r),ha.migrateAll(r),(At.before("0.8.0")||n)&&O.populateExtensions(r,"item"),r}},$y={migrate(r,t=!0){return O.ensure(r,"collections",[]),O.ensure(r,"links",[]),O.runAll($y,r,r),r.collections=r.collections.map(e=>Ig.migrate(e,t)),r}},Vy={migrate(r,t=!0){return O.ensure(r,"type","FeatureCollection"),O.ensure(r,"features",[]),O.ensure(r,"links",[]),O.runAll(Vy,r,r),r.features=r.features.map(e=>Pg.migrate(e,null,t)),r}},ha={migrateAll(r,t="assets"){for(let e in r[t])ha.migrate(r[t][e],r)},migrate(r,t){return O.runAll(ha,r,t),Zh.migrate(r,t),r},mediaTypes(r){O.is(r.type,"string")&&O.mapValues(r,"type",["image/vnd.stac.geotiff","image/vnd.stac.geotiff; cloud-optimized=true"],["image/tiff; application=geotiff","image/tiff; application=geotiff; profile=cloud-optimized"])},eo(r,t){let e=O.isObject(t.properties)&&Array.isArray(t.properties["eo:bands"])?t.properties["eo:bands"]:[];if(Array.isArray(r["eo:bands"]))for(let n in r["eo:bands"]){let i=r["eo:bands"][n];O.is(i,"number")&&O.isObject(e[i])?i=e[i]:O.isObject(i)||(i={}),r["eo:bands"][n]=i}}},Zh={migrate(r,t,e=!1){return O.runAll(Zh,r,t,e),r},_commonMetadata(r){At.before("1.0.0-rc.3")&&(O.toUTC(r,"created"),O.toUTC(r,"updated"))},_timestamps(r,t){O.toUTC(r,"published"),O.toUTC(r,"expires"),O.toUTC(r,"unpublished"),O.upgradeExtension(t,ct.timestamps)},_versioningIndicator(r,t){O.upgradeExtension(t,ct.version)},checksum(r,t){At.before("0.9.0")&&en.multihash&&(O.rename(r,"checksum:md5","checksum:multihash")&&en.toMultihash(r,"checksum:multihash","md5"),O.rename(r,"checksum:sha1","checksum:multihash")&&en.toMultihash(r,"checksum:multihash","sha1"),O.rename(r,"checksum:sha2","checksum:multihash")&&en.toMultihash(r,"checksum:multihash","sha2-256"),O.rename(r,"checksum:sha3","checksum:multihash")&&en.toMultihash(r,"checksum:multihash","sha3-256")),At.before("1.0.0-rc.1")&&O.rename(r,"checksum:multihash","file:checksum")&&O.addExtension(t,ct.file),O.removeExtension(t,"checksum")},classification(r,t){At.before("1.1.0","classification")&&O.forAll(r,"classification:classes",e=>O.rename(e,"color-hint","color_hint")),O.upgradeExtension(t,ct.classification)},cube(r,t){O.upgradeExtension(t,ct.datacube)},dtr(r,t){At.before("0.9.0")&&(O.rename(r,"dtr:start_datetime","start_datetime"),O.rename(r,"dtr:end_datetime","end_datetime"),O.removeExtension(t,"datetime-range"))},eo(r,t){At.before("0.9.0")&&(O.rename(r,"eo:epsg","proj:epsg")&&O.addExtension(t,ct.projection),O.rename(r,"eo:platform","platform"),O.rename(r,"eo:instrument","instruments")&&O.toArray(r,"instruments"),O.rename(r,"eo:constellation","constellation"),O.rename(r,"eo:off_nadir","view:off_nadir")&&O.addExtension(t,ct.view),O.rename(r,"eo:azimuth","view:azimuth")&&O.addExtension(t,ct.view),O.rename(r,"eo:incidence_angle","view:incidence_angle")&&O.addExtension(t,ct.view),O.rename(r,"eo:sun_azimuth","view:sun_azimuth")&&O.addExtension(t,ct.view),O.rename(r,"eo:sun_elevation","view:sun_elevation")&&O.addExtension(t,ct.view)),At.before("1.0.0-beta.1")&&O.rename(r,"eo:gsd","gsd"),O.upgradeExtension(t,ct.eo)},file(r,t){O.upgradeExtension(t,ct.file)},label(r,t){At.before("0.8.0")&&(O.rename(r,"label:property","label:properties"),O.rename(r,"label:task","label:tasks"),O.rename(r,"label:overview","label:overviews")&&O.toArray(r,"label:overviews"),O.rename(r,"label:method","label:methods"),O.toArray(r,"label:classes")),O.upgradeExtension(t,ct.label)},pc(r,t){At.before("0.8.0")&&O.rename(r,"pc:schema","pc:schemas"),O.upgradeExtension(t,ct.pointcloud)},processing(r,t){O.upgradeExtension(t,ct.processing)},proj(r,t){O.upgradeExtension(t,ct.projection)},raster(r,t){O.upgradeExtension(t,ct.raster)},sar(r,t,e){O.rename(r,"sar:incidence_angle","view:incidence_angle")&&O.addExtension(t,ct.view),O.rename(r,"sar:pass_direction","sat:orbit_state")&&O.mapValues(r,"sat:orbit_state",[null],["geostationary"])&&O.addExtension(t,ct.sat),At.before("0.7.0")&&(O.flattenArray(r,"sar:resolution",["sar:resolution_range","sar:resolution_azimuth"],e),O.flattenArray(r,"sar:pixel_spacing",["sar:pixel_spacing_range","sar:pixel_spacing_azimuth"],e),O.flattenArray(r,"sar:looks",["sar:looks_range","sar:looks_azimuth","sar:looks_equivalent_number"],e),O.rename(r,"sar:off_nadir","view:off_nadir")&&O.addExtension(t,ct.view)),At.before("0.9.0")&&(O.rename(r,"sar:platform","platform"),O.rename(r,"sar:instrument","instruments")&&O.toArray(r,"instruments"),O.rename(r,"sar:constellation","constellation"),O.rename(r,"sar:type","sar:product_type"),O.rename(r,"sar:polarization","sar:polarizations"),O.flattenOneElementArray(r,"sar:absolute_orbit",e)&&O.rename(r,"sar:absolute_orbit","sat:absolute_orbit")&&O.addExtension(t,ct.sat),O.flattenOneElementArray(r,"sar:relative_orbit",e)&&O.rename(r,"sar:relative_orbit","sat:relative_orbit")&&O.addExtension(t,ct.sat)),O.upgradeExtension(t,ct.sar)},sat(r,t){At.before("0.9.0")&&(O.rename(r,"sat:off_nadir_angle","sat:off_nadir"),O.rename(r,"sat:azimuth_angle","sat:azimuth"),O.rename(r,"sat:sun_azimuth_angle","sat:sun_azimuth"),O.rename(r,"sat:sun_elevation_angle","sat:sun_elevation")),O.upgradeExtension(t,ct.sat)},sci(r,t){O.upgradeExtension(t,ct.scientific)},item(r){At.before("0.8.0")&&(O.rename(r,"item:license","license"),O.rename(r,"item:providers","providers"))},table(r,t){O.upgradeExtension(t,ct.table)},view(r,t){O.upgradeExtension(t,ct.view)}},fs={item(r,t=null,e=!0){return Pg.migrate(r,t,e)},catalog(r,t=!0){return Cg.migrate(r,t)},collection(r,t=!0){return Ig.migrate(r,t)},collectionCollection(r,t=!0){return $y.migrate(r,t)},itemCollection(r,t=!0){return Vy.migrate(r,t)},stac(r,t=!0){return r.type==="Feature"?fs.item(r,null,t):r.type==="FeatureCollection"?fs.itemCollection(r,t):r.type==="Collection"||!r.type&&O.isDefined(r.extent)&&O.isDefined(r.license)?fs.collection(r,t):!r.type&&Array.isArray(r.collections)?fs.collectionCollection(r,t):fs.catalog(r,t)},enableMultihash(r){en.multihash=r}},BL=fs;const XL=Hs(BL);function so(r){let t=r.length>=6,e=r[0],n=r[t?3:2],i=r[1],s=r[t?4:3],o={west:e,east:n,south:i,north:s};return t&&(o.base=r[2],o.height=r[5]),o}function Fc(r){let{west:t,east:e,south:n,north:i}=so(r);return[[[t,i],[t,n],[e,n],[e,i],[t,i]]]}function WL(r){if(!jr(r))return null;let t=so(r),e=[];if(Hy(r)){let n=(t.west+360+t.east)/2;n>180&&(n-=360),e.push(n)}else e.push((t.west+t.east)/2);return e.push((t.south+t.north)/2),typeof t.base<"u"&&e.push((t.base+t.height)/2),e}function Yy(r){if(jr(r)?r=[r]:Array.isArray(r)&&(r=r.filter(n=>jr(n))),!Array.isArray(r)||r.length===0)return null;let t=r.reduce((n,i)=>{if(Hy(i)){let{west:s,east:o,south:a,north:l}=so(i);n.push(Fc([-180,a,o,l])),n.push(Fc([s,a,180,l]))}else n.push(Fc(i));return n},[]),e=null;if(t.length===1?e={type:"Polygon",coordinates:t[0]}:t.length>1&&(e={type:"MultiPolygon",coordinates:t}),e)return{type:"Feature",geometry:e,properties:{}}}function jr(r){if(!Array.isArray(r)||![4,6].includes(r.length)||r.some(s=>typeof s!="number"))return!1;let{west:t,east:e,south:n,north:i}=so(r);return n<=i&&t>=-180&&t<=180&&n>=-90&&e<=180&&e>=-180&&i<=90}function Hy(r){if(!jr(r))return!1;let{west:t,east:e}=so(r);return t>e}function Ky(r){if(!Array.isArray(r)||r.length===0)return null;let t={west:180,south:90,east:-180,north:-90};r.forEach(n=>{if(!jr(n))return;let i=so(n),s=["west","south"];for(let o in i){let a=s.includes(o)?Math.min:Math.max;t[o]=a(t[o],i[o])}});let e=[t.west,t.south,t.east,t.north];return jr(e)?e:null}function sr(r){return typeof r=="string"&&r.length>0}function Qe(r){return typeof r=="object"&&r===Object(r)&&!Array.isArray(r)}function Jy(...r){if(r=r.filter(t=>Array.isArray(t)),r.length>1){let t=Math.max(...r.map(n=>n.length)),e=[];for(let n=0;ni[n])));return e}else if(r.length===1)return r[0];return[]}function ZL(r){switch(r){case"int8":return-128;case"int16":return-32768;case"int32":return-2147483648}return r.startsWith("u")?0:null}function qL(r){switch(r){case"int8":return 127;case"uint8":return 255;case"int16":return 32767;case"uint16":return 65535;case"int32":return 2147483647;case"uint32":return 4294967295}return null}class qh{constructor(t,e={},n=[]){if(!Qe(t))throw new Error("Given data is not an object");if(t instanceof qh){for(let i of n)this[i]=t[i];t=t.toJSON()}this._keyMap=e,this._privateKeys=["_keyMap","_privateKeys"].concat(n);for(let i in t)typeof this[i]>"u"&&(i in e?this[i]=e[i](t[i],this):this[i]=t[i])}isItem(){return this.type==="Feature"}isCatalog(){return this.type==="Catalog"}isCatalogLike(){return this.isCatalog()||this.isCollection()}isCollection(){return this.type==="Collection"}isItemCollection(){return this.type==="FeatureCollection"}isCollectionCollection(){return!1}isAsset(){return!1}isLink(){return!1}getObjectType(){}getAbsoluteUrl(){return null}getMetadata(t){return this[t]}toGeoJSON(){return null}getBoundingBox(){return null}getCenter(){return WL(this.getBoundingBox())}getBoundingBoxes(){return[]}toJSON(){let t={};return Object.keys(this).forEach(e=>{if(typeof this[e]=="function"||this._privateKeys.includes(e))return;let n=this[e];if(e in this._keyMap){let i=Array.isArray(n)?[]:{};for(let s in n)i[s]=n[s].toJSON();n=i}t[e]=n}),t}}var Qy={exports:{}},pl={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */pl.exports;var $p;function $L(){return $p||($p=1,function(r,t){(function(e){var n=t&&!t.nodeType&&t,i=r&&!r.nodeType&&r,s=typeof Li=="object"&&Li;(s.global===s||s.window===s||s.self===s)&&(e=s);var o,a=2147483647,l=36,h=1,c=26,u=38,d=700,g=72,f=128,p="-",_=/^xn--/,y=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=l-h,E=Math.floor,T=String.fromCharCode,M;function C(j){throw new RangeError(w[j])}function P(j,Z){for(var Y=j.length,ot=[];Y--;)ot[Y]=Z(j[Y]);return ot}function G(j,Z){var Y=j.split("@"),ot="";Y.length>1&&(ot=Y[0]+"@",j=Y[1]),j=j.replace(v,".");var U=j.split("."),nt=P(U,Z).join(".");return ot+nt}function D(j){for(var Z=[],Y=0,ot=j.length,U,nt;Y=55296&&U<=56319&&Y65535&&(Z-=65536,Y+=T(Z>>>10&1023|55296),Z=56320|Z&1023),Y+=T(Z),Y}).join("")}function m(j){return j-48<10?j-22:j-65<26?j-65:j-97<26?j-97:l}function x(j,Z){return j+22+75*(j<26)-((Z!=0)<<5)}function b(j,Z,Y){var ot=0;for(j=Y?E(j/d):j>>1,j+=E(j/Z);j>S*c>>1;ot+=l)j=E(j/S);return E(ot+(S+1)*j/(j+u))}function R(j){var Z=[],Y=j.length,ot,U=0,nt=f,ut=g,_t,Lt,It,Dt,$t,me,Oe,dr,ge;for(_t=j.lastIndexOf(p),_t<0&&(_t=0),Lt=0;Lt<_t;++Lt)j.charCodeAt(Lt)>=128&&C("not-basic"),Z.push(j.charCodeAt(Lt));for(It=_t>0?_t+1:0;It=Y&&C("invalid-input"),Oe=m(j.charCodeAt(It++)),(Oe>=l||Oe>E((a-U)/$t))&&C("overflow"),U+=Oe*$t,dr=me<=ut?h:me>=ut+c?c:me-ut,!(OeE(a/ge)&&C("overflow"),$t*=ge;ot=Z.length+1,ut=b(U-Dt,ot,Dt==0),E(U/ot)>a-nt&&C("overflow"),nt+=E(U/ot),U%=ot,Z.splice(U++,0,nt)}return z(Z)}function L(j){var Z,Y,ot,U,nt,ut,_t,Lt,It,Dt,$t,me=[],Oe,dr,ge,qr;for(j=D(j),Oe=j.length,Z=f,Y=0,nt=g,ut=0;ut=Z&&$t<_t&&(_t=$t);for(dr=ot+1,_t-Z>E((a-Y)/dr)&&C("overflow"),Y+=(_t-Z)*dr,Z=_t,ut=0;uta&&C("overflow"),$t==Z){for(Lt=Y,It=l;Dt=It<=nt?h:It>=nt+c?c:It-nt,!(Lt1;g++)u.splice(0,1);a[d]=u.join("")}var f=-1,p=0,_=0,y=-1,v=!1;for(d=0;dp&&(f=y,p=_)):a[d]==="0"&&(v=!0,y=d,_=1);_>p&&(f=y,p=_),p>1&&a.splice(f,p,""),l=a.length;var w="";for(a[0]===""&&(w=":"),d=0;d=i.length-1)return!1;var o=i.lastIndexOf(".",s-1);if(o<=0||o>=s-1)return!1;var a=n.list[i.slice(s+1)];return a?a.indexOf(" "+i.slice(o+1,s)+" ")>=0:!1},is:function(i){var s=i.lastIndexOf(".");if(s<=0||s>=i.length-1)return!1;var o=i.lastIndexOf(".",s-1);if(o>=0)return!1;var a=n.list[i.slice(s+1)];return a?a.indexOf(" "+i.slice(0,s)+" ")>=0:!1},get:function(i){var s=i.lastIndexOf(".");if(s<=0||s>=i.length-1)return null;var o=i.lastIndexOf(".",s-1);if(o<=0||o>=s-1)return null;var a=n.list[i.slice(s+1)];return!a||a.indexOf(" "+i.slice(o+1,s)+" ")<0?null:i.slice(o+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return n})}(Hp)),Hp.exports}/*! - * URI.js - Mutating URLs - * - * Version: 1.19.11 - * - * Author: Rodney Rehm - * Web: http://medialize.github.io/URI.js/ - * - * Licensed under - * MIT License http://www.opensource.org/licenses/mit-license - * - */(function(r){(function(t,e){r.exports?r.exports=e($L(),VL(),YL()):t.URI=e(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(Li,function(t,e,n,i){var s=i&&i.URI;function o(m,x){var b=arguments.length>=1,R=arguments.length>=2;if(!(this instanceof o))return b?R?new o(m,x):new o(m):new o;if(m===void 0){if(b)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?m=location.href+"":m=""}if(m===null&&b)throw new TypeError("null is not a valid argument for URI");return this.href(m),x!==void 0?this.absoluteTo(x):this}function a(m){return/^[0-9]+$/.test(m)}o.version="1.19.11";var l=o.prototype,h=Object.prototype.hasOwnProperty;function c(m){return m.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(m){return m===void 0?"Undefined":String(Object.prototype.toString.call(m)).slice(8,-1)}function d(m){return u(m)==="Array"}function g(m,x){var b={},R,L;if(u(x)==="RegExp")b=null;else if(d(x))for(R=0,L=x.length;R]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(m){if(!(!m||!m.nodeName)){var x=m.nodeName.toLowerCase();if(!(x==="input"&&m.type!=="image"))return o.domAttributes[x]}};function y(m){return escape(m)}function v(m){return encodeURIComponent(m).replace(/[!'()*]/g,y).replace(/\*/g,"%2A")}o.encode=v,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=v,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(m,x){var b=o.encode(m+"");return x===void 0&&(x=o.escapeQuerySpace),x?b.replace(/%20/g,"+"):b},o.decodeQuery=function(m,x){m+="",x===void 0&&(x=o.escapeQuerySpace);try{return o.decode(x?m.replace(/\+/g,"%20"):m)}catch{return m}};var w={encode:"encode",decode:"decode"},S,E=function(m,x){return function(b){try{return o[x](b+"").replace(o.characters[m][x].expression,function(R){return o.characters[m][x].map[R]})}catch{return b}}};for(S in w)o[S+"PathSegment"]=E("pathname",w[S]),o[S+"UrnPathSegment"]=E("urnpath",w[S]);var T=function(m,x,b){return function(R){var L;b?L=function(Z){return o[x](o[b](Z))}:L=o[x];for(var N=(R+"").split(m),k=0,j=N.length;k-1&&(x.fragment=m.substring(b+1)||null,m=m.substring(0,b)),b=m.indexOf("?"),b>-1&&(x.query=m.substring(b+1)||null,m=m.substring(0,b)),m=m.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),m=m.replace(/^[/\\]{2,}/i,"//"),m.substring(0,2)==="//"?(x.protocol=null,m=m.substring(2),m=o.parseAuthority(m,x)):(b=m.indexOf(":"),b>-1&&(x.protocol=m.substring(0,b)||null,x.protocol&&!x.protocol.match(o.protocol_expression)?x.protocol=void 0:m.substring(b+1,b+3).replace(/\\/g,"/")==="//"?(m=m.substring(b+3),m=o.parseAuthority(m,x)):(m=m.substring(b+1),x.urn=!0))),x.path=m,x},o.parseHost=function(m,x){m||(m=""),m=m.replace(/\\/g,"/");var b=m.indexOf("/"),R,L;if(b===-1&&(b=m.length),m.charAt(0)==="[")R=m.indexOf("]"),x.hostname=m.substring(1,R)||null,x.port=m.substring(R+2,b)||null,x.port==="/"&&(x.port=null);else{var N=m.indexOf(":"),k=m.indexOf("/"),j=m.indexOf(":",N+1);j!==-1&&(k===-1||j-1?L:m.length-1),k;return N>-1&&(L===-1||N-1?nt=nt.slice(0,ut)+nt.slice(ut).replace(N,""):nt=nt.replace(N,""),!(nt.length<=Z[0].length)&&!(b.ignore&&b.ignore.test(nt))){U=Y+nt.length;var It=x(nt,Y,U,m);if(It===void 0){R.lastIndex=U;continue}It=String(It),m=m.slice(0,Y)+It+m.slice(U),R.lastIndex=Y+It.length}}return R.lastIndex=0,m},o.ensureValidHostname=function(m,x){var b=!!m,R=!!x,L=!1;if(R&&(L=f(o.hostProtocols,x)),L&&!b)throw new TypeError("Hostname cannot be empty, if protocol is "+x);if(m&&m.match(o.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+m+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(m).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+m+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(m){if(m){var x=Number(m);if(!(a(x)&&x>0&&x<65536))throw new TypeError('Port "'+m+'" is not a valid port')}},o.noConflict=function(m){if(m){var x={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(x.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(x.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(x.SecondLevelDomains=i.SecondLevelDomains.noConflict()),x}else i.URI===this&&(i.URI=s);return this},l.build=function(m){return m===!0?this._deferred_build=!0:(m===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},l.clone=function(){return new o(this)},l.valueOf=l.toString=function(){return this.build(!1)._string};function M(m){return function(x,b){return x===void 0?this._parts[m]||"":(this._parts[m]=x||null,this.build(!b),this)}}function C(m,x){return function(b,R){return b===void 0?this._parts[m]||"":(b!==null&&(b=b+"",b.charAt(0)===x&&(b=b.substring(1))),this._parts[m]=b,this.build(!R),this)}}l.protocol=M("protocol"),l.username=M("username"),l.password=M("password"),l.hostname=M("hostname"),l.port=M("port"),l.query=C("query","?"),l.fragment=C("fragment","#"),l.search=function(m,x){var b=this.query(m,x);return typeof b=="string"&&b.length?"?"+b:b},l.hash=function(m,x){var b=this.fragment(m,x);return typeof b=="string"&&b.length?"#"+b:b},l.pathname=function(m,x){if(m===void 0||m===!0){var b=this._parts.path||(this._parts.hostname?"/":"");return m?(this._parts.urn?o.decodeUrnPath:o.decodePath)(b):b}else return this._parts.urn?this._parts.path=m?o.recodeUrnPath(m):"":this._parts.path=m?o.recodePath(m):"/",this.build(!x),this},l.path=l.pathname,l.href=function(m,x){var b;if(m===void 0)return this.toString();this._string="",this._parts=o._parts();var R=m instanceof o,L=typeof m=="object"&&(m.hostname||m.path||m.pathname);if(m.nodeName){var N=o.getDomAttribute(m);m=m[N]||"",L=!1}if(!R&&L&&m.pathname!==void 0&&(m=m.toString()),typeof m=="string"||m instanceof String)this._parts=o.parse(String(m),this._parts);else if(R||L){var k=R?m._parts:m;for(b in k)b!=="query"&&h.call(this._parts,b)&&(this._parts[b]=k[b]);k.query&&this.query(k.query,!1)}else throw new TypeError("invalid input");return this.build(!x),this},l.is=function(m){var x=!1,b=!1,R=!1,L=!1,N=!1,k=!1,j=!1,Z=!this._parts.urn;switch(this._parts.hostname&&(Z=!1,b=o.ip4_expression.test(this._parts.hostname),R=o.ip6_expression.test(this._parts.hostname),x=b||R,L=!x,N=L&&n&&n.has(this._parts.hostname),k=L&&o.idn_expression.test(this._parts.hostname),j=L&&o.punycode_expression.test(this._parts.hostname)),m.toLowerCase()){case"relative":return Z;case"absolute":return!Z;case"domain":case"name":return L;case"sld":return N;case"ip":return x;case"ip4":case"ipv4":case"inet4":return b;case"ip6":case"ipv6":case"inet6":return R;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var P=l.protocol,G=l.port,D=l.hostname;l.protocol=function(m,x){if(m&&(m=m.replace(/:(\/\/)?$/,""),!m.match(o.protocol_expression)))throw new TypeError('Protocol "'+m+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,m,x)},l.scheme=l.protocol,l.port=function(m,x){return this._parts.urn?m===void 0?"":this:(m!==void 0&&(m===0&&(m=null),m&&(m+="",m.charAt(0)===":"&&(m=m.substring(1)),o.ensureValidPort(m))),G.call(this,m,x))},l.hostname=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(m!==void 0){var b={preventInvalidHostname:this._parts.preventInvalidHostname},R=o.parseHost(m,b);if(R!=="/")throw new TypeError('Hostname "'+m+'" contains characters other than [A-Z0-9.-]');m=b.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(m,this._parts.protocol)}return D.call(this,m,x)},l.origin=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(m===void 0){var b=this.protocol(),R=this.authority();return R?(b?b+"://":"")+this.authority():""}else{var L=o(m);return this.protocol(L.protocol()).authority(L.authority()).build(!x),this}},l.host=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(m===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var b=o.parseHost(m,this._parts);if(b!=="/")throw new TypeError('Hostname "'+m+'" contains characters other than [A-Z0-9.-]');return this.build(!x),this},l.authority=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(m===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var b=o.parseAuthority(m,this._parts);if(b!=="/")throw new TypeError('Hostname "'+m+'" contains characters other than [A-Z0-9.-]');return this.build(!x),this},l.userinfo=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(m===void 0){var b=o.buildUserinfo(this._parts);return b&&b.substring(0,b.length-1)}else return m[m.length-1]!=="@"&&(m+="@"),o.parseUserinfo(m,this._parts),this.build(!x),this},l.resource=function(m,x){var b;return m===void 0?this.path()+this.search()+this.hash():(b=o.parse(m),this._parts.path=b.path,this._parts.query=b.query,this._parts.fragment=b.fragment,this.build(!x),this)},l.subdomain=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(m===void 0){if(!this._parts.hostname||this.is("IP"))return"";var b=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,b)||""}else{var R=this._parts.hostname.length-this.domain().length,L=this._parts.hostname.substring(0,R),N=new RegExp("^"+c(L));if(m&&m.charAt(m.length-1)!=="."&&(m+="."),m.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return m&&o.ensureValidHostname(m,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(N,m),this.build(!x),this}},l.domain=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(typeof m=="boolean"&&(x=m,m=void 0),m===void 0){if(!this._parts.hostname||this.is("IP"))return"";var b=this._parts.hostname.match(/\./g);if(b&&b.length<2)return this._parts.hostname;var R=this._parts.hostname.length-this.tld(x).length-1;return R=this._parts.hostname.lastIndexOf(".",R-1)+1,this._parts.hostname.substring(R)||""}else{if(!m)throw new TypeError("cannot set domain empty");if(m.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(m,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=m;else{var L=new RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(L,m)}return this.build(!x),this}},l.tld=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(typeof m=="boolean"&&(x=m,m=void 0),m===void 0){if(!this._parts.hostname||this.is("IP"))return"";var b=this._parts.hostname.lastIndexOf("."),R=this._parts.hostname.substring(b+1);return x!==!0&&n&&n.list[R.toLowerCase()]&&n.get(this._parts.hostname)||R}else{var L;if(m)if(m.match(/[^a-zA-Z0-9-]/))if(n&&n.is(m))L=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(L,m);else throw new TypeError('TLD "'+m+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");L=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(L,m)}else throw new TypeError("cannot set TLD empty");return this.build(!x),this}},l.directory=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(m===void 0||m===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var b=this._parts.path.length-this.filename().length-1,R=this._parts.path.substring(0,b)||(this._parts.hostname?"/":"");return m?o.decodePath(R):R}else{var L=this._parts.path.length-this.filename().length,N=this._parts.path.substring(0,L),k=new RegExp("^"+c(N));return this.is("relative")||(m||(m="/"),m.charAt(0)!=="/"&&(m="/"+m)),m&&m.charAt(m.length-1)!=="/"&&(m+="/"),m=o.recodePath(m),this._parts.path=this._parts.path.replace(k,m),this.build(!x),this}},l.filename=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(typeof m!="string"){if(!this._parts.path||this._parts.path==="/")return"";var b=this._parts.path.lastIndexOf("/"),R=this._parts.path.substring(b+1);return m?o.decodePathSegment(R):R}else{var L=!1;m.charAt(0)==="/"&&(m=m.substring(1)),m.match(/\.?\//)&&(L=!0);var N=new RegExp(c(this.filename())+"$");return m=o.recodePath(m),this._parts.path=this._parts.path.replace(N,m),L?this.normalizePath(x):this.build(!x),this}},l.suffix=function(m,x){if(this._parts.urn)return m===void 0?"":this;if(m===void 0||m===!0){if(!this._parts.path||this._parts.path==="/")return"";var b=this.filename(),R=b.lastIndexOf("."),L,N;return R===-1?"":(L=b.substring(R+1),N=/^[a-z0-9%]+$/i.test(L)?L:"",m?o.decodePathSegment(N):N)}else{m.charAt(0)==="."&&(m=m.substring(1));var k=this.suffix(),j;if(k)m?j=new RegExp(c(k)+"$"):j=new RegExp(c("."+k)+"$");else{if(!m)return this;this._parts.path+="."+o.recodePath(m)}return j&&(m=o.recodePath(m),this._parts.path=this._parts.path.replace(j,m)),this.build(!x),this}},l.segment=function(m,x,b){var R=this._parts.urn?":":"/",L=this.path(),N=L.substring(0,1)==="/",k=L.split(R);if(m!==void 0&&typeof m!="number"&&(b=x,x=m,m=void 0),m!==void 0&&typeof m!="number")throw new Error('Bad segment "'+m+'", must be 0-based integer');if(N&&k.shift(),m<0&&(m=Math.max(k.length+m,0)),x===void 0)return m===void 0?k:k[m];if(m===null||k[m]===void 0)if(d(x)){k=[];for(var j=0,Z=x.length;j"u"?!0:typeof r!="string"?!1:(t=t.map(n=>n.toLowerCase()),t.includes(r.toLowerCase()))}function rO(r,t=!1){return Ag(r,eO,t)}class r1 extends qh{constructor(t,e=null,n={},i=[]){super(t,n,["_context"].concat(i)),this._context||(this._context=e)}getAbsoluteUrl(t=!0){return this._context?JL(this.href,this._context.getAbsoluteUrl(),t):this.href.includes("://")?this.href:null}getContext(){return this._context}canBrowserDisplayImage(t=!1){if(typeof this.href!="string"||!t&&typeof this.type>"u")return!1;let e=new wu(this.href),n=e.protocol().toLowerCase(),i=e.suffix().toLowerCase();return sr(n)&&!Jp.includes(n)?!1:sr(this.type)&&Qp.includes(this.type.toLowerCase())?!0:!!(typeof this.type>"u"&&sr(i)&&(i==="jpg"||Qp.includes("image/"+i)))}isType(t){return sr(this.type)&&Ag(this.type,t)}isGeoTIFF(){return this.isType(e1)}isCOG(){return this.isType(t1)}isHTTP(){let t=this.getAbsoluteUrl(!1).protocol().toLowerCase();return sr(t)&&Jp.includes(t)}}class Lg extends r1{constructor(t,e=null){super(t,e)}isLink(){return!0}getObjectType(){return"Link"}static fromLinks(t,e=null){return Array.isArray(t)?t.map(n=>Qe(n)?new Lg(n,e):n):[]}}class n1 extends qh{constructor(t,e=null,n={},i=[]){if(super(t,Object.assign({links:Lg.fromLinks},n),["_url"].concat(i)),!this._url&&(this._url=e,!this._url)){let s=this.getSelfLink();s&&(this._url=s.href)}}getAbsoluteUrl(){return this._url}setAbsoluteUrl(t){this._url=t}getStacLinksWithRel(t,e=!0){return this.getLinksWithRels([t]).filter(n=>rO(n.type,e))}getStacLinkWithRel(t,e=!0){const n=this.getStacLinksWithRel(t,e);return n.length>0?n[0]:null}getLinks(){return Array.isArray(this.links)?this.links.filter(t=>Qe(t)&&sr(t.href)):[]}getLinkWithRel(t){return this.getLinks().find(e=>e.rel===t)||null}getLinksWithRels(t){return this.getLinks().filter(e=>t.includes(e.rel))}getLinksWithOtherRels(t){return this.getLinks().filter(e=>!t.includes(e.rel))}getSelfLink(){return this.getStacLinkWithRel("self")}getRootLink(){return this.getStacLinkWithRel("root")}getParentLink(){return this.getStacLinkWithRel("parent")}}class i1 extends n1{constructor(t,e=null,n={},i=[]){super(t,e,n,i)}getAll(){return[]}}class hi extends r1{constructor(t,e=null,n=null){super(t,n,{},["_key"]),this._key||(this._key=e)}getObjectType(){return"Asset"}isAsset(){return!0}getAbsoluteUrl(t=!0){return this.isDefinition()?null:super.getAbsoluteUrl(t)}getKey(){return this._key}getMetadata(t){if(typeof this[t]<"u")return this[t];if(this._context)return this._context.getMetadata(t)}getBands(){return Jy(this["eo:bands"],this["raster:bands"])}findVisualBands(){let t={red:null,green:null,blue:null},e=this.getBands();for(let n in e){let i=parseInt(n,10),s=e[i];Qe(s)&&sr(s.common_name)&&s.common_name in t&&(t[s.common_name]={index:i,band:s})}return Object.values(t).every(n=>n!==null)?t:null}findBand(t,e="name",n=null){Array.isArray(t)||(t=[t]),Qe(n)||(n=this.getBands());let i=n.findIndex(s=>Qe(s)&&t.includes(s[e]));return i>=0?{index:i,band:n[i]}:null}getBand(t){return Qe(t)||t===null?t:this.getBands()[t]||null}getMinMaxValues(t=null){t=this.getBand(t);const e={minimum:null,maximum:null},n=a=>a.minimum!==null&&a.maximum!==null;if(t&&(Qe(t.statistics)&&(typeof t.statistics.minimum=="number"&&(e.minimum=t.statistics.minimum),typeof t.statistics.maximum=="number"&&(e.maximum=t.statistics.maximum),n(e))||Qe(t.histogram)&&(typeof t.histogram.min=="number"&&(e.minimum=t.histogram.min),typeof t.histogram.max=="number"&&(e.maximum=t.histogram.max),n(e))))return e;let i=this.getMetadata("classification:classes");if(Array.isArray(i)&&(i.reduce((a,l)=>(a.minimum=Math.min(a.minimum,l.value),a.maximum=Math.max(a.maximum,l.value),a),e),n(e)))return e;let s=this.getMetadata("file:values");if(Array.isArray(s)&&(s.reduce((a,l)=>(a.minimum=Math.min(a.minimum,...l.values),a.maximum=Math.max(a.maximum,...l.values),a),e),n(e)))return e;let o=Qe(t)&&t.data_type||this.getMetadata("file:data_type");return o&&(e.minimum=ZL(o),e.maximum=qL(o)),e}getNoDataValues(t=null){t=this.getBand(t);let e=[];if(t&&typeof t.nodata<"u")e.push(t.nodata);else{let n=this.getMetadata("file:nodata");if(typeof n<"u")e=n;else{let i=this.getMetadata("classification:classes");Array.isArray(i)&&(e=i.filter(s=>!!s.nodata).map(s=>s.value))}}return e.map(n=>n==="nan"?NaN:n==="+inf"?1/0:n==="-inf"?-1/0:n)}isDefinition(){return!sr(this.href)}isHTTP(){return this.isDefinition()?null:super.isHTTP()}hasRole(t,e=!1){return Array.isArray(t)||(t=[t]),e&&t.includes(this.getKey())?!0:Array.isArray(this.roles)&&!!this.roles.find(n=>t.includes(n))}static fromAssets(t,e=null){let n={};if(Qe(t))for(let i in t)n[i]=new hi(t[i],i,e);return n}}class Da extends n1{constructor(t,e=null,n={},i=[]){super(t,e,n,i)}getTemporalExtent(){return null}getTemporalExtents(){return[]}getIcons(t=!0){return this.getLinksWithRels(["icon"]).filter(e=>e.canBrowserDisplayImage(t))}getThumbnails(t=!0,e=null){let n=this.getAssetsWithRoles(["thumbnail","overview"],!0);if(n.length===0&&(n=this.getLinksWithRels(["preview"])),t&&(n=n.filter(i=>i.canBrowserDisplayImage())),e&&n.length>1){let i=s=>Array.isArray(s.roles)&&s.roles.includes(e)||s.getKey()===e;n=n.filter(i).concat(n.filter(s=>!i(s)))}return n}getDefaultGeoTIFF(t=!0,e=!1){var n;return(n=this.rankGeoTIFFs(t,e)[0])==null?void 0:n.asset}rankGeoTIFFs(t=!0,e=!1,n=null,i=null){Qe(n)||(n={data:1,visual:2,thumbnail:2,overview:3});let s=[],o=this.getAssetsByTypes(e1);t&&(o=o.filter(l=>l.isHTTP()&&(!e||l.isCOG())));let a=Object.entries(n);for(let l of o){let h=0;if(a.length>0){let c=a.filter(([u])=>l.hasRole(u,!0)).map(([,u])=>u);c.length>0&&(h+=Math.max(...c))}!e&&l.isCOG()&&(h+=2),l.findVisualBands()&&(h+=1),typeof i=="function"&&(h+=i(l)),s.push({asset:l,score:h})}return s.sort((l,h)=>h.score-l.score),s}findVisualAssets(){let t={red:null,green:null,blue:null},e=Object.keys(t),n=this.getAssets();for(let i of n){let s=i.getBands();if(s.length!==1)continue;let o=i.findBand(e,"common_name",s);o&&(t[o.band.common_name]=i)}return Object.values(t).every(i=>i!==null)?t:null}getAsset(t){return Qe(this.assets)&&this.assets[t]||null}getAssets(){return Qe(this.assets)?Object.values(this.assets):[]}getAssetsWithRoles(t,e=!1){return this.getAssets().filter(n=>n.hasRole(t,e))}getAssetWithRole(t,e=!1){return this.getAssetsWithRoles([t],e)[0]||null}getAssetsByTypes(t){return this.getAssets().filter(e=>Ag(e.type,t))}equals(t){return this===t?!0:!(t instanceof Da)||this.getObjectType()!==t.getObjectType()?!1:!!(this.id&&this.id===t.id)}}class s1 extends Da{constructor(t,e=null,n={},i=[]){super(t,e,n,i)}getObjectType(){return this.type}getSearchLink(t=null){let e=this.getStacLinksWithRel("search");return t?e[0]||null:e.find(n=>n.method===t||!t&&!n.method)||null}getApiCollectionsLink(){return this.getStacLinkWithRel("data")}getApiItemsLink(){return this.getStacLinkWithRel("items")}getChildLinks(){return this.getStacLinksWithRel("child")}getItemLinks(){return this.getStacLinksWithRel("item")}}class nO extends s1{constructor(t,e=null){super(t,e)}}function To(r){if(sr(r)&&r.length>=10)try{let t=r.match(/^(-?\d{1,})-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)(?:\.(\d*))?(?:Z|[+-]00:00)?$/i).slice(1).map(e=>parseInt(e,10));return new Date(Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5],t[6]||0))}catch{return null}return null}function iO(r,t){return new Date(r.valueOf()+(t-r)/2)}function o1(r){if(!Array.isArray(r)||r.length===0)return null;let t,e;const n=(i,s,o)=>typeof i>"u"?s:i===null||s===null?null:o(i,s);return r.forEach(([i,s])=>{t=n(t,i,Math.min),e=n(e,s,Math.max)}),[t===null?null:new Date(t),e===null?null:new Date(e)]}class a1 extends s1{constructor(t,e=null){const n={assets:hi.fromAssets,item_assets:hi.fromAssets};super(t,e,n)}toGeoJSON(){let t=Yy(this.getBoundingBoxes());return t&&(t.id=this.id),t}getBoundingBox(){let t=this.getRawBoundingBoxes();return t.length>0&&jr(t[0])?t[0]:null}getBoundingBoxes(){let t=this.getRawBoundingBoxes();return t.length===1&&jr(t[0])?t:t.length>1?t.filter((e,n)=>n>0&&jr(e)):[]}getRawBoundingBoxes(){var t,e;let n=(e=(t=this.extent)==null?void 0:t.spatial)==null?void 0:e.bbox;return Array.isArray(n)&&n.length>0?n:[]}getTemporalExtent(){return this.getTemporalExtents()[0]||null}getTemporalExtents(){var t,e;let n=(e=(t=this.extent)==null?void 0:t.temporal)==null?void 0:e.interval;return Array.isArray(n)&&n.length>0?n.filter(i=>Array.isArray(i)&&(sr(i[0])||sr(i[1]))).map(i=>i.map(s=>To(s))):[]}getSummary(t){return this.summaries[t]}getBands(){let t=this.getSummary("eo:bands"),e=this.getSummary("raster:bands"),n=[t,e].filter(i=>Array.isArray(i));return n.length>=2?Jy(...n):n.length===1?n[0]:[]}}class sO extends i1{constructor(t,e=null){const n={collections:i=>i.map(s=>new a1(s))};super(t,e,n)}getObjectType(){return"CollectionCollection"}getAll(){return this.collections}isCollectionCollection(){return!0}toGeoJSON(){return{type:"FeatureCollection",features:this.collections.map(t=>t.toGeoJSON()).filter(t=>t!==null)}}getBoundingBox(){return Ky(this.getBoundingBoxes())}getBoundingBoxes(){return this.collections.map(t=>t.getBoundingBox())}getTemporalExtent(){return o1(this.getTemporalExtents())}getTemporalExtents(){return this.collections.map(t=>t.getTemporalExtent())}}class l1 extends Da{constructor(t,e=null){super(t,e,{assets:hi.fromAssets})}getObjectType(){return"Item"}toGeoJSON(){return this.toJSON()}getBoundingBox(){return jr(this.bbox)?this.bbox:null}getBoundingBoxes(){return jr(this.bbox)?[this.bbox]:[]}getDateTime(){let t=To(this.properties.datetime);if(!t){let e=To(this.properties.start_datetime),n=To(this.properties.end_datetime);return e&&n?iO(e,n):e||n}return t}getTemporalExtent(){return this.getTemporalExtents()[0]||null}getTemporalExtents(){let t=[];return sr(this.properties.start_datetime)||sr(this.properties.end_datetime)?t=[[this.properties.start_datetime||null,this.properties.end_datetime||null]]:sr(this.properties.datetime)&&(t=[[this.properties.datetime,this.properties.datetime]]),t.map(e=>e.map(n=>To(n)))}getMetadata(t){return this.properties[t]}getBands(){let t=this.getMetadata("eo:bands");return Array.isArray(t)?t:[]}getCollectionLink(){return this.getStacLinkWithRel("collection")}}class oO extends i1{constructor(t,e=null){const n={features:i=>i.map(s=>new l1(s))};super(t,e,n)}getObjectType(){return"ItemCollection"}getAll(){return this.features}toGeoJSON(){return this.toJSON()}getBoundingBox(){return Ky(this.getBoundingBoxes())}getBoundingBoxes(){return this.features.map(t=>t.getBoundingBox())}getTemporalExtent(){return o1(this.getTemporalExtents())}getTemporalExtents(){return this.features.map(t=>t.getTemporalExtent())}}function aO(r,t=!0,e=!1){return t&&(r=XL.stac(r,e)),r.type==="Feature"?new l1(r):r.type==="FeatureCollection"?new oO(r):r.type==="Collection"||!r.type&&typeof r.extent<"u"&&typeof r.license<"u"?new a1(r):!r.type&&Array.isArray(r.collections)?new sO(r):new nO(r)}class tm extends ig{constructor(t){super({...t,state:"loading"}),Cu(this,"loadImage",n=>new Promise((i,s)=>{const o=new Image;o.addEventListener("load",()=>i(o)),o.addEventListener("error",()=>s(new Error("load failed"))),o.src=n}));const e=new rg(t.url);e.getHeader().then(n=>{this.tileGrid.minZoom=n.minZoom,this.tileGrid.maxZoom=n.maxZoom,this.setLoader(async(i,s,o)=>{const a=await e.getZxy(i,s,o),l=URL.createObjectURL(new Blob([a.data])),h=await this.loadImage(l);return URL.revokeObjectURL(l),h}),this.setState("ready")})}}class lO extends Wh{constructor(t){super({...t,state:"loading",url:"pmtiles://"+t.url+"/{z}/{x}/{y}",format:new U0}),Cu(this,"tileLoadFunction",(e,n)=>{const i=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),s=n.match(i),o=+s[2],a=+s[3],l=+s[4];e.setLoader((h,c,u)=>{e.setState(B.LOADING),this.pmtiles_.getZxy(o,a,l).then(d=>{if(d){const g=e.getFormat();e.setFeatures(g.readFeatures(d.data,{extent:h,featureProjection:u})),e.setState(B.LOADED)}else e.setFeatures([]),e.setState(B.EMPTY)}).catch(d=>{e.setFeatures([]),e.setState(B.ERROR)})})}),this.pmtiles_=new rg(t.url),this.pmtiles_.getHeader().then(e=>{this.tileGrid.minZoom=e.minZoom,this.tileGrid.maxZoom=e.maxZoom,this.setTileLoadFunction(this.tileLoadFunction),this.setState("ready")})}}let Og=null;function hO(){return!!Og}function h1(r){Og=r;const t=Object.keys(r.defs),e=t.length;let n,i;for(n=0;n0&&(e.nodata=o[0]),t.length>0&&(e.bands=t),e}async function em(r,t=void 0){let e=t;if(hO()){const n=r.getMetadata("proj:epsg");if(n)try{e=await uO(n)}catch{}}return e}function rm(r,t){const e=r.clone();return t.hasOnlyBounds()||e.setFill(null),e}function pO(r){let t=r.href;if(t.includes("{s}"))if(Array.isArray(r["href:servers"])&&r["href:servers"].length>0){const e=Math.random()*r["href:servers"].length|0;t=t.replace("{s}",r["href:servers"][e])}else return null;return t}async function mO(r){try{const t=new URL(r);t.searchParams.set("service","wmts"),t.searchParams.set("request","GetCapabilities");const e=await fetch(t);return new Id().read(await e.text())}catch{return null}}class Fg extends Oh{constructor(t){const e={};if(["opacity","visible","zIndex","minResolution","maxResolution","minZoom","maxZoom","properties"].forEach(n=>e[n]=t[n]),super(e),this.getSourceOptions_=t.getSourceOptions,this.data_,this.assets_=null,this.bands_=[],this.crossOrigin_=t.crossOrigin||null,this.displayFootprint_=t.displayFootprint!==!1,this.displayGeoTiffByDefault_=!!t.displayGeoTiffByDefault,this.displayPreview_=!!t.displayPreview,this.displayOverview_=t.displayOverview!==!1,this.displayWebMapLink_=t.displayWebMapLink||!1,this.buildTileUrlTemplate_=t.buildTileUrlTemplate||null,this.useTileLayerAsFallback_=t.useTileLayerAsFallback||!1,this.boundsStyle_=t.boundsStyle||dO,this.collectionStyle_=t.collectionStyle||gO,this.boundsLayer_=null,t.data){try{this.configure_(t.data,t.url,t.assets,t.bands)}catch(n){this.handleError_(n)}return}if(!t.url)throw new Error("Either url or data must be provided");fetch(t.url).then(n=>n.json()).then(n=>this.configure_(n,t.url,t.assets,t.bands)).catch(n=>this.handleError_(n))}getBoundsLayer(){return this.boundsLayer_}handleError_(t){this.dispatchEvent(new FP(t))}configure_(t,e=null,n=null,i=[]){t instanceof hi||t instanceof Da?this.data_=t:this.data_=aO(t),e&&e.includes("://")&&this.data_.setAbsoluteUrl(e),this.bands_=i,this.boundsLayer_=this.addFootprint_();const s=()=>{this.boundsLayer_&&this.boundsLayer_.setStyle(rm(this.boundsStyle_,this))};this.getLayers().on("add",s),this.getLayers().on("remove",s),this.setAssets(n).then(()=>this.dispatchEvent("assetsready")).catch(o=>this.handleError_(o)),this.dispatchEvent("sourceready")}async addApiCollection_(){const t=this.getData().getAll().map(e=>{const n=new Fg({data:e,crossOrigin:this.crossOrigin_,boundsStyle:this.collectionStyle_,displayGeoTiffByDefault:this.displayGeoTiffByDefault_,displayOverview:this.displayOverview_,displayPreview:this.displayPreview_,displayFootprint:this.displayFootprint_});return this.addLayer_(n),n});return await Promise.all(t)}async addStacAssets_(){let t=this.getAssets();if(t===null){t=[];const n=this.getData().getDefaultGeoTIFF(!0,!this.displayGeoTiffByDefault_);if(n)t.push(n);else{const i=this.getData().getThumbnails().filter(s=>!Array.isArray(s.roles)||!s.roles.includes("example"));i.length>0&&t.push(i[0])}}const e=t.map(n=>this.addImagery_(n));return await Promise.all(e)}async addImagery_(t){if(t){if(t.isGeoTIFF())return await this.addGeoTiff_(t);if(t.canBrowserDisplayImage())return await this.addThumbnail_(t)}}async addThumbnail_(t){if(!this.displayPreview_)return;let e={url:t.getAbsoluteUrl(),projection:await em(t,"EPSG:4326"),imageExtent:t.getContext().getBoundingBox(),crossOrigin:this.crossOrigin_};this.getSourceOptions_&&(e=await this.getSourceOptions_(Qt.ImageStatic,e,t));const n=new Hd({source:new Dy(e)});return this.addLayer_(n,t),n}async addWebMapLinks_(){const t=this.getWebMapLinks();if(t.length>0)return await this.addLayerForLink(t[0])}async addLayerForLink(t){const e=pO(t);if(!e)return;const n={attributions:t.getMetadata("attribution")||this.data_.getMetadata("attribution"),crossOrigin:this.crossOrigin_,url:e},i=async(o,a)=>(this.getSourceOptions_&&(a=await this.getSourceOptions_(o,a,t)),a),s=[];switch(t.rel){case"pmtiles":const o=await new rg(n.url).getHeader();let a;switch(o.tileType){case gs.Mvt:a=new lO(await i(Qt.PMTilesVector,n));break;case gs.Avif:case gs.Jpeg:case gs.Png:case gs.Webp:a=new tm(await i(Qt.PMTilesRaster,n));break;default:return}s.push(a);break;case"tilejson":s.push(new jy(await i(Qt.TileJSON,n)));break;case"wms":if(!Array.isArray(t["wms:layers"]))break;for(const c in t["wms:layers"]){const u=t["wms:layers"][c]||"";let d="";Array.isArray(t["wms:styles"])&&typeof t["wms:styles"][c]=="string"&&(d=t["wms:styles"][c]);const g=Object.assign({LAYERS:u,STYLES:d},t["wms:dimensions"]);typeof t["wms:transparent"]=="boolean"&&(g.TRANSPARENT=String(t["wms:transparent"])),typeof t.type=="string"&&t.type.startsWith("image/")&&(g.FORMAT=t.type);const f=await i(Qt.TileWMS,Object.assign({},n,{params:g}));s.push(new Xy(f))}break;case"wmts":const l=await mO(e);if(!l)return;const h=Array.isArray(t["wmts:layer"])?t["wmts:layer"]:[t["wmts:layer"]];for(const c of h){let u=Object.assign({},n,{layer:c});typeof t.type=="string"&&t.type.startsWith("image/")&&(u.format=t.type),u=await i(Qt.WMTS,u),s.push(new Wy(Zy(l,u)))}break;case"xyz":s.push(new zi(await i(Qt.XYZ,n)));break;default:return}return s.map(o=>{let a;return o instanceof Wh?a=new $_({source:o,declutter:!0}):o instanceof tm?a=new Vl({source:o}):a=new Zl({source:o}),this.addLayer_(a,t),a})}async addGeoTiff_(t){if(!this.displayOverview_)return;if(this.buildTileUrlTemplate_&&!this.useTileLayerAsFallback_)return await this.addTileLayerForImagery_(t);let e={sources:[fO(t,this.bands_)]};const n=await em(t);n&&(e.projection=n),this.getSourceOptions_&&(e=await this.getSourceOptions_(Qt.GeoTIFF,e,t));const i=async(s,o)=>(o&&this.getLayers().remove(o),await this.addTileLayerForImagery_(s));try{const s=new wg(e),o=new Vl({source:s});if(this.useTileLayerAsFallback_){const a=()=>i(t,o);s.on("error",a),s.on("tileloaderror",a),s.on("change",()=>{s.getState()==="error"&&i(t,o)}),o.on("error",a),await s.getView()}return this.addLayer_(o,t),o}catch(s){if(this.useTileLayerAsFallback_)return await i(t,null);this.handleError_(s)}}async addTileLayerForImagery_(t){let e={crossOrigin:this.crossOrigin_,url:this.buildTileUrlTemplate_(t)};this.getSourceOptions_&&(e=await this.getSourceOptions_(Qt.XYZ,e,t));const n=new Zl({source:new zi(e)});return this.addLayer_(n,t),n}addLayer_(t,e,n=0){t.set("stac",e),t.setZIndex(n),this.getLayers().push(t)}addFootprint_(){let t=null;const e=this.getData();if(e.isItemCollection()||e.isCollectionCollection()?t=Yy(e.getBoundingBox()):t=e.toGeoJSON(),t){const n=new i0,i=new Lh({format:n,loader:(o,a,l)=>{const h=n.readFeatures(t,{featureProjection:l});i.addFeatures(h)}}),s=new Gd({source:i,style:rm(this.boundsStyle_,this),visible:this.displayFootprint_});return s.set("bounds",!0),this.addLayer_(s,e,1),s}return null}async updateLayers_(){const t=this.getLayers();for(let n=t.getLength()-1;n>=0;n--){const i=t.item(n).get("stac");i&&(i.isLink()||i.isAsset())&&t.removeAt(n)}const e=this.getData();e.isItemCollection()||e.isCollectionCollection()?await this.addApiCollection_():(e.isItem()||e.isCollection())&&await this.addStacAssets_(),this.displayWebMapLink_&&(Array.isArray(this.displayWebMapLink_)||this.hasOnlyBounds())&&await this.addWebMapLinks_()}hasOnlyBounds(){const t=this.getBoundsLayer();return typeof this.getLayersArray().find(e=>e!==t)>"u"}getWebMapLinks(){let t=["xyz","tilejson","pmtiles","wmts","wms"];typeof this.displayWebMapLink_=="string"&&(t=[this.displayWebMapLink_]);let e=this.data_.getLinksWithRels(t);return Array.isArray(this.displayWebMapLink_)?e=this.displayWebMapLink_.map(n=>typeof n=="string"?e.find(s=>s.id===n)||null:n).filter(n=>!!n):e.sort((n,i)=>{const s=t.indexOf(n.rel),o=t.indexOf(i.rel);return s-o}),e}async setAssets(t){Array.isArray(t)?this.assets_=t.map(e=>typeof e=="string"?this.getData().getAsset(e):e instanceof hi?e:new hi(e)):this.assets_=null,await this.updateLayers_()}getData(){return this.data_}getAssets(){return this.assets_}getExtent(){if(!this.boundsLayer_)return;const t=this.boundsLayer_.getMapInternal();if(!t)return;const e=t.getView();if(!e)return;const n=this.getData();if(!n)return;const i=n.getBoundingBox();if(i)return Xu(i,"EPSG:4326",e.getProjection())}}function _O(r){r("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),r("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),r("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),r.WGS84=r["EPSG:4326"],r["EPSG:3785"]=r["EPSG:3857"],r.GOOGLE=r["EPSG:3857"],r["EPSG:900913"]=r["EPSG:3857"],r["EPSG:102113"]=r["EPSG:3857"]}var Ui=1,Bi=2,Ps=3,yO=4,Su=5,nm=6378137,xO=6356752314e-3,im=.0066943799901413165,jo=484813681109536e-20,$=Math.PI/2,vO=.16666666666666666,wO=.04722222222222222,SO=.022156084656084655,H=1e-10,Ce=.017453292519943295,sn=57.29577951308232,Wt=Math.PI/4,ca=Math.PI*2,ce=3.14159265359,ur={};ur.greenwich=0;ur.lisbon=-9.131906111111;ur.paris=2.337229166667;ur.bogota=-74.080916666667;ur.madrid=-3.687938888889;ur.rome=12.452333333333;ur.bern=7.439583333333;ur.jakarta=106.807719444444;ur.ferro=-17.666666666667;ur.brussels=4.367975;ur.stockholm=18.058277777778;ur.athens=23.7163375;ur.oslo=10.722916666667;const EO={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var sm=/[\s_\-\/\(\)]/g;function fi(r,t){if(r[t])return r[t];for(var e=Object.keys(r),n=t.toLowerCase().replace(sm,""),i=-1,s,o;++i=this.text.length)return;r=this.text[this.place++]}switch(this.state){case ua:return this.neutral(r);case c1:return this.keyword(r);case Jl:return this.quoted(r);case d1:return this.afterquote(r);case u1:return this.number(r);case Ng:return}};Zn.prototype.afterquote=function(r){if(r==='"'){this.word+='"',this.state=Jl;return}if($h.test(r)){this.word=this.word.trim(),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in afterquote yet, index '+this.place)};Zn.prototype.afterItem=function(r){if(r===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=ua;return}if(r==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=ua,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Ng);return}};Zn.prototype.number=function(r){if(g1.test(r)){this.word+=r;return}if($h.test(r)){this.word=parseFloat(this.word),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in number yet, index '+this.place)};Zn.prototype.quoted=function(r){if(r==='"'){this.state=d1;return}this.word+=r};Zn.prototype.keyword=function(r){if(MO.test(r)){this.word+=r;return}if(r==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=ua;return}if($h.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in keyword yet, index '+this.place)};Zn.prototype.neutral=function(r){if(TO.test(r)){this.word=r,this.state=c1;return}if(r==='"'){this.word="",this.state=Jl;return}if(g1.test(r)){this.word=r,this.state=u1;return}if($h.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in neutral yet, index '+this.place)};Zn.prototype.output=function(){for(;this.place0?90:-90),r.lat_ts=r.lat1):!r.lat_ts&&r.lat0&&r.projName==="Polar_Stereographic"&&(r.lat_ts=r.lat0,r.lat0=Jr(r.lat0>0?90:-90))}function f1(r){var t=RO(r),e=t.shift(),n=t.shift();t.unshift(["name",n]),t.unshift(["type",e]);var i={};return vs(t,i),PO(i),i}function Xe(r){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?Xe[r]=Eu(arguments[1]):Xe[r]=f1(arguments[1]):Xe[r]=e}else if(arguments.length===1){if(Array.isArray(r))return r.map(function(n){Array.isArray(n)?Xe.apply(t,n):Xe(n)});if(typeof r=="string"){if(r in Xe)return Xe[r]}else"EPSG"in r?Xe["EPSG:"+r.EPSG]=r:"ESRI"in r?Xe["ESRI:"+r.ESRI]=r:"IAU2000"in r?Xe["IAU2000:"+r.IAU2000]=r:console.log(r);return}}_O(Xe);function AO(r){return typeof r=="string"}function LO(r){return r in Xe}var OO=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function FO(r){return OO.some(function(t){return r.indexOf(t)>-1})}var NO=["3857","900913","3785","102113"];function DO(r){var t=fi(r,"authority");if(t){var e=fi(t,"epsg");return e&&NO.indexOf(e)>-1}}function kO(r){var t=fi(r,"extension");if(t)return fi(t,"proj4")}function GO(r){return r[0]==="+"}function jO(r){if(AO(r)){if(LO(r))return Xe[r];if(FO(r)){var t=f1(r);if(DO(t))return Xe["EPSG:3857"];var e=kO(t);return e?Eu(e):t}if(GO(r))return Eu(r)}else return r}function am(r,t){r=r||{};var e,n;if(!t)return r;for(n in t)e=t[n],e!==void 0&&(r[n]=e);return r}function dn(r,t,e){var n=r*t;return e/Math.sqrt(1-n*n)}function ka(r){return r<0?-1:1}function Q(r){return Math.abs(r)<=ce?r:r-ka(r)*ca}function zr(r,t,e){var n=r*e,i=.5*r;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*($-t))/n}function da(r,t){for(var e=.5*r,n,i,s=$-2*Math.atan(t),o=0;o<=15;o++)if(n=r*Math.sin(s),i=$-2*Math.atan(t*Math.pow((1-n)/(1+n),e))-s,s+=i,Math.abs(i)<=1e-10)return s;return-9999}function zO(){var r=this.b/this.a;this.es=1-r*r,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=dn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function UO(r){var t=r.x,e=r.y;if(e*sn>90&&e*sn<-90&&t*sn>180&&t*sn<-180)return null;var n,i;if(Math.abs(Math.abs(e)-$)<=H)return null;if(this.sphere)n=this.x0+this.a*this.k0*Q(t-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(Wt+.5*e));else{var s=Math.sin(e),o=zr(this.e,e,s);n=this.x0+this.a*this.k0*Q(t-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return r.x=n,r.y=i,r}function BO(r){var t=r.x-this.x0,e=r.y-this.y0,n,i;if(this.sphere)i=$-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var s=Math.exp(-e/(this.a*this.k0));if(i=da(this.e,s),i===-9999)return null}return n=Q(this.long0+t/(this.a*this.k0)),r.x=n,r.y=i,r}var XO=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const WO={init:zO,forward:UO,inverse:BO,names:XO};function ZO(){}function lm(r){return r}var qO=["longlat","identity"];const $O={init:ZO,forward:lm,inverse:lm,names:qO};var VO=[WO,$O],ml={},Ql=[];function p1(r,t){var e=Ql.length;return r.names?(Ql[e]=r,r.names.forEach(function(n){ml[n.toLowerCase()]=e}),this):(console.log(t),!0)}function YO(r){if(!r)return!1;var t=r.toLowerCase();if(typeof ml[t]<"u"&&Ql[ml[t]])return Ql[ml[t]]}function HO(){VO.forEach(p1)}const KO={start:HO,add:p1,get:YO};var vt={};vt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};vt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};vt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};vt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};vt.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};vt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};vt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};vt.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};vt.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};vt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};vt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};vt.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};vt.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};vt.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};vt.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};vt.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};vt.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};vt.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};vt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};vt.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};vt.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};vt.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};vt.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};vt.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};vt.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};vt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};vt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};vt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};vt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};vt.hough={a:6378270,rf:297,ellipseName:"Hough"};vt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};vt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};vt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};vt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};vt.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};vt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};vt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};vt.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};vt.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};vt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};vt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};vt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var JO=vt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};vt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function QO(r,t,e,n){var i=r*r,s=t*t,o=(i-s)/i,a=0;n?(r*=1-o*(vO+o*(wO+o*SO)),i=r*r,o=0):a=Math.sqrt(o);var l=(i-s)/s;return{es:o,e:a,ep2:l}}function tF(r,t,e,n,i){if(!r){var s=fi(vt,n);s||(s=JO),r=s.a,t=s.b,e=s.rf}return e&&!t&&(t=(1-1/e)*r),(e===0||Math.abs(r-t)3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=Bi,a.datum_params[3]*=jo,a.datum_params[4]*=jo,a.datum_params[5]*=jo,a.datum_params[6]=a.datum_params[6]/1e6+1)),o&&(a.datum_type=Ps,a.grids=o),a.a=e,a.b=n,a.es=i,a.ep2=s,a}var m1={};function rF(r,t){var e=new DataView(t),n=sF(e),i=oF(e,n),s=aF(e,i,n),o={header:i,subgrids:s};return m1[r]=o,o}function nF(r){if(r===void 0)return null;var t=r.split(",");return t.map(iF)}function iF(r){if(r.length===0)return null;var t=r[0]==="@";return t&&(r=r.slice(1)),r==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:r,mandatory:!t,grid:m1[r]||null,isNull:!1}}function ws(r){return r/3600*Math.PI/180}function sF(r){var t=r.getInt32(8,!1);return t===11?!1:(t=r.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function oF(r,t){return{nFields:r.getInt32(8,t),nSubgridFields:r.getInt32(24,t),nSubgrids:r.getInt32(40,t),shiftType:bu(r,56,64).trim(),fromSemiMajorAxis:r.getFloat64(120,t),fromSemiMinorAxis:r.getFloat64(136,t),toSemiMajorAxis:r.getFloat64(152,t),toSemiMinorAxis:r.getFloat64(168,t)}}function bu(r,t,e){return String.fromCharCode.apply(null,new Uint8Array(r.buffer.slice(t,e)))}function aF(r,t,e){for(var n=176,i=[],s=0;s5e-11?!1:r.datum_type===Ui?r.datum_params[0]===t.datum_params[0]&&r.datum_params[1]===t.datum_params[1]&&r.datum_params[2]===t.datum_params[2]:r.datum_type===Bi?r.datum_params[0]===t.datum_params[0]&&r.datum_params[1]===t.datum_params[1]&&r.datum_params[2]===t.datum_params[2]&&r.datum_params[3]===t.datum_params[3]&&r.datum_params[4]===t.datum_params[4]&&r.datum_params[5]===t.datum_params[5]&&r.datum_params[6]===t.datum_params[6]:!0}function _1(r,t,e){var n=r.x,i=r.y,s=r.z?r.z:0,o,a,l,h;if(i<-$&&i>-1.001*$)i=-$;else if(i>$&&i<1.001*$)i=$;else{if(i<-$)return{x:-1/0,y:-1/0,z:r.z};if(i>$)return{x:1/0,y:1/0,z:r.z}}return n>Math.PI&&(n-=2*Math.PI),a=Math.sin(i),h=Math.cos(i),l=a*a,o=e/Math.sqrt(1-t*l),{x:(o+s)*h*Math.cos(n),y:(o+s)*h*Math.sin(n),z:(o*(1-t)+s)*a}}function y1(r,t,e,n){var i=1e-12,s=i*i,o=30,a,l,h,c,u,d,g,f,p,_,y,v,w,S=r.x,E=r.y,T=r.z?r.z:0,M,C,P;if(a=Math.sqrt(S*S+E*E),l=Math.sqrt(S*S+E*E+T*T),a/es&&wn.y||g>n.x||_a&&Math.abs(l.y)>a);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=Q(s.x+e.ll[0]),n.y=s.y+e.ll[1]}else isNaN(s.x)||(n.x=r.x+s.x,n.y=r.y+s.y);return n}function cm(r,t){var e={x:r.x/t.del[0],y:r.y/t.del[1]},n={x:Math.floor(e.x),y:Math.floor(e.y)},i={x:e.x-1*n.x,y:e.y-1*n.y},s={x:Number.NaN,y:Number.NaN},o;if(n.x<0||n.x>=t.lim[0]||n.y<0||n.y>=t.lim[1])return s;o=n.y*t.lim[0]+n.x;var a={x:t.cvs[o][0],y:t.cvs[o][1]};o++;var l={x:t.cvs[o][0],y:t.cvs[o][1]};o+=t.lim[0];var h={x:t.cvs[o][0],y:t.cvs[o][1]};o--;var c={x:t.cvs[o][0],y:t.cvs[o][1]},u=i.x*i.y,d=i.x*(1-i.y),g=(1-i.x)*(1-i.y),f=(1-i.x)*i.y;return s.x=g*a.x+d*l.x+f*c.x+u*h.x,s.y=g*a.y+d*l.y+f*c.y+u*h.y,s}function um(r,t,e){var n=e.x,i=e.y,s=e.z||0,o,a,l,h={};for(l=0;l<3;l++)if(!(t&&l===2&&e.z===void 0))switch(l===0?(o=n,"ew".indexOf(r.axis[l])!==-1?a="x":a="y"):l===1?(o=i,"ns".indexOf(r.axis[l])!==-1?a="y":a="x"):(o=s,a="z"),r.axis[l]){case"e":h[a]=o;break;case"w":h[a]=-o;break;case"n":h[a]=o;break;case"s":h[a]=-o;break;case"u":e[a]!==void 0&&(h.z=o);break;case"d":e[a]!==void 0&&(h.z=-o);break;default:return null}return h}function x1(r){var t={x:r[0],y:r[1]};return r.length>2&&(t.z=r[2]),r.length>3&&(t.m=r[3]),t}function mF(r){dm(r.x),dm(r.y)}function dm(r){if(typeof Number.isFinite=="function"){if(Number.isFinite(r))return;throw new TypeError("coordinates must be finite numbers")}if(typeof r!="number"||r!==r||!isFinite(r))throw new TypeError("coordinates must be finite numbers")}function _F(r,t){return(r.datum.datum_type===Ui||r.datum.datum_type===Bi||r.datum.datum_type===Ps)&&t.datumCode!=="WGS84"||(t.datum.datum_type===Ui||t.datum.datum_type===Bi||t.datum.datum_type===Ps)&&r.datumCode!=="WGS84"}function th(r,t,e,n){var i;Array.isArray(e)?e=x1(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var s=e.z!==void 0;if(mF(e),r.datum&&t.datum&&_F(r,t)&&(i=new ln("WGS84"),e=th(r,i,e,n),r=i),n&&r.axis!=="enu"&&(e=um(r,!1,e)),r.projName==="longlat")e={x:e.x*Ce,y:e.y*Ce,z:e.z||0};else if(r.to_meter&&(e={x:e.x*r.to_meter,y:e.y*r.to_meter,z:e.z||0}),e=r.inverse(e),!e)return;if(r.from_greenwich&&(e.x+=r.from_greenwich),e=fF(r.datum,t.datum,e),!!e)return t.from_greenwich&&(e={x:e.x-t.from_greenwich,y:e.y,z:e.z||0}),t.projName==="longlat"?e={x:e.x*sn,y:e.y*sn,z:e.z||0}:(e=t.forward(e),t.to_meter&&(e={x:e.x/t.to_meter,y:e.y/t.to_meter,z:e.z||0})),n&&t.axis!=="enu"?um(t,!0,e):(e&&!s&&delete e.z,e)}var gm=ln("WGS84");function Nc(r,t,e,n){var i,s,o;return Array.isArray(e)?(i=th(r,t,e,n)||{x:NaN,y:NaN},e.length>2?typeof r.name<"u"&&r.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof i.z=="number"?[i.x,i.y,i.z].concat(e.splice(3)):[i.x,i.y,e[2]].concat(e.splice(3)):[i.x,i.y].concat(e.splice(2)):[i.x,i.y]):(s=th(r,t,e,n),o=Object.keys(e),o.length===2||o.forEach(function(a){if(typeof r.name<"u"&&r.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;s[a]=e[a]}),s)}function fm(r){return r instanceof ln?r:r.oProj?r.oProj:ln(r)}function xr(r,t,e){r=fm(r);var n=!1,i;return typeof t>"u"?(t=r,r=gm,n=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,t=r,r=gm,n=!0),t=fm(t),e?Nc(r,t,e):(i={forward:function(s,o){return Nc(r,t,s,o)},inverse:function(s,o){return Nc(t,r,s,o)}},n&&(i.oProj=t),i)}var pm=6,v1="AJSAJS",w1="AFAFAF",Ss=65,Ke=73,br=79,Mo=86,Ro=90;const yF={forward:S1,inverse:xF,toPoint:E1};function S1(r,t){return t=t||5,SF(vF({lat:r[1],lon:r[0]}),t)}function xF(r){var t=Dg(T1(r.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function E1(r){var t=Dg(T1(r.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Dc(r){return r*(Math.PI/180)}function mm(r){return 180*(r/Math.PI)}function vF(r){var t=r.lat,e=r.lon,n=6378137,i=.00669438,s=.9996,o,a,l,h,c,u,d,g=Dc(t),f=Dc(e),p,_;_=Math.floor((e+180)/6)+1,e===180&&(_=60),t>=56&&t<64&&e>=3&&e<12&&(_=32),t>=72&&t<84&&(e>=0&&e<9?_=31:e>=9&&e<21?_=33:e>=21&&e<33?_=35:e>=33&&e<42&&(_=37)),o=(_-1)*6-180+3,p=Dc(o),a=i/(1-i),l=n/Math.sqrt(1-i*Math.sin(g)*Math.sin(g)),h=Math.tan(g)*Math.tan(g),c=a*Math.cos(g)*Math.cos(g),u=Math.cos(g)*(f-p),d=n*((1-i/4-3*i*i/64-5*i*i*i/256)*g-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*g)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*g)-35*i*i*i/3072*Math.sin(6*g));var y=s*l*(u+(1-h+c)*u*u*u/6+(5-18*h+h*h+72*c-58*a)*u*u*u*u*u/120)+5e5,v=s*(d+l*Math.tan(g)*(u*u/2+(5-h+9*c+4*c*c)*u*u*u*u/24+(61-58*h+h*h+600*c-330*a)*u*u*u*u*u*u/720));return t<0&&(v+=1e7),{northing:Math.round(v),easting:Math.round(y),zoneNumber:_,zoneLetter:wF(t)}}function Dg(r){var t=r.northing,e=r.easting,n=r.zoneLetter,i=r.zoneNumber;if(i<0||i>60)return null;var s=.9996,o=6378137,a=.00669438,l,h=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),c,u,d,g,f,p,_,y,v,w=e-5e5,S=t;n<"N"&&(S-=1e7),_=(i-1)*6-180+3,l=a/(1-a),p=S/s,y=p/(o*(1-a/4-3*a*a/64-5*a*a*a/256)),v=y+(3*h/2-27*h*h*h/32)*Math.sin(2*y)+(21*h*h/16-55*h*h*h*h/32)*Math.sin(4*y)+151*h*h*h/96*Math.sin(6*y),c=o/Math.sqrt(1-a*Math.sin(v)*Math.sin(v)),u=Math.tan(v)*Math.tan(v),d=l*Math.cos(v)*Math.cos(v),g=o*(1-a)/Math.pow(1-a*Math.sin(v)*Math.sin(v),1.5),f=w/(c*s);var E=v-c*Math.tan(v)/g*(f*f/2-(5+3*u+10*d-4*d*d-9*l)*f*f*f*f/24+(61+90*u+298*d+45*u*u-252*l-3*d*d)*f*f*f*f*f*f/720);E=mm(E);var T=(f-(1+2*u+d)*f*f*f/6+(5-2*d+28*u-3*d*d+8*l+24*u*u)*f*f*f*f*f/120)/Math.cos(v);T=_+mm(T);var M;if(r.accuracy){var C=Dg({northing:r.northing+r.accuracy,easting:r.easting+r.accuracy,zoneLetter:r.zoneLetter,zoneNumber:r.zoneNumber});M={top:C.lat,right:C.lon,bottom:E,left:T}}else M={lat:E,lon:T};return M}function wF(r){var t="Z";return 84>=r&&r>=72?t="X":72>r&&r>=64?t="W":64>r&&r>=56?t="V":56>r&&r>=48?t="U":48>r&&r>=40?t="T":40>r&&r>=32?t="S":32>r&&r>=24?t="R":24>r&&r>=16?t="Q":16>r&&r>=8?t="P":8>r&&r>=0?t="N":0>r&&r>=-8?t="M":-8>r&&r>=-16?t="L":-16>r&&r>=-24?t="K":-24>r&&r>=-32?t="J":-32>r&&r>=-40?t="H":-40>r&&r>=-48?t="G":-48>r&&r>=-56?t="F":-56>r&&r>=-64?t="E":-64>r&&r>=-72?t="D":-72>r&&r>=-80&&(t="C"),t}function SF(r,t){var e="00000"+r.easting,n="00000"+r.northing;return r.zoneNumber+r.zoneLetter+EF(r.easting,r.northing,r.zoneNumber)+e.substr(e.length-5,t)+n.substr(n.length-5,t)}function EF(r,t,e){var n=b1(e),i=Math.floor(r/1e5),s=Math.floor(t/1e5)%20;return bF(i,s,n)}function b1(r){var t=r%pm;return t===0&&(t=pm),t}function bF(r,t,e){var n=e-1,i=v1.charCodeAt(n),s=w1.charCodeAt(n),o=i+r-1,a=s+t,l=!1;o>Ro&&(o=o-Ro+Ss-1,l=!0),(o===Ke||iKe||(o>Ke||ibr||(o>br||iRo&&(o=o-Ro+Ss-1),a>Mo?(a=a-Mo+Ss-1,l=!0):l=!1,(a===Ke||sKe||(a>Ke||sbr||(a>br||sMo&&(a=a-Mo+Ss-1);var h=String.fromCharCode(o)+String.fromCharCode(a);return h}function T1(r){if(r&&r.length===0)throw"MGRSPoint coverting from nothing";for(var t=r.length,e=null,n="",i,s=0;!/[A-Z]/.test(i=r.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+r;n+=i,s++}var o=parseInt(n,10);if(s===0||s+3>t)throw"MGRSPoint bad conversion from: "+r;var a=r.charAt(s++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+r;e=r.substring(s,s+=2);for(var l=b1(o),h=TF(e.charAt(0),l),c=MF(e.charAt(1),l);c0&&(p=1e5/Math.pow(10,d),_=r.substring(s,s+d),g=parseFloat(_)*p,y=r.substring(s+d),f=parseFloat(y)*p),v=g+h,w=f+c,{easting:v,northing:w,zoneLetter:a,zoneNumber:o,accuracy:p}}function TF(r,t){for(var e=v1.charCodeAt(t-1),n=1e5,i=!1;e!==r.charCodeAt(0);){if(e++,e===Ke&&e++,e===br&&e++,e>Ro){if(i)throw"Bad character: "+r;e=Ss,i=!0}n+=1e5}return n}function MF(r,t){if(r>"V")throw"MGRSPoint given invalid Northing "+r;for(var e=w1.charCodeAt(t-1),n=0,i=!1;e!==r.charCodeAt(0);){if(e++,e===Ke&&e++,e===br&&e++,e>Mo){if(i)throw"Bad character: "+r;e=Ss,i=!0}n+=1e5}return n}function RF(r){var t;switch(r){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+r}function Ws(r,t,e){if(!(this instanceof Ws))return new Ws(r,t,e);if(Array.isArray(r))this.x=r[0],this.y=r[1],this.z=r[2]||0;else if(typeof r=="object")this.x=r.x,this.y=r.y,this.z=r.z||0;else if(typeof r=="string"&&typeof t>"u"){var n=r.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=r,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ws.fromMGRS=function(r){return new Ws(E1(r))};Ws.prototype.toMGRS=function(r){return S1([this.x,this.y],r)};var CF=1,IF=.25,_m=.046875,ym=.01953125,xm=.01068115234375,PF=.75,AF=.46875,LF=.013020833333333334,OF=.007120768229166667,FF=.3645833333333333,NF=.005696614583333333,DF=.3076171875;function M1(r){var t=[];t[0]=CF-r*(IF+r*(_m+r*(ym+r*xm))),t[1]=r*(PF-r*(_m+r*(ym+r*xm)));var e=r*r;return t[2]=e*(AF-r*(LF+r*OF)),e*=r,t[3]=e*(FF-r*NF),t[4]=e*r*DF,t}function Vh(r,t,e,n){return e*=t,t*=t,n[0]*r-e*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var kF=20;function R1(r,t,e){for(var n=1/(1-t),i=r,s=kF;s;--s){var o=Math.sin(i),a=1-t*o*o;if(a=(Vh(i,o,Math.cos(i),e)-r)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)H?Math.tan(e):0,f=Math.pow(g,2),p=Math.pow(f,2);i=1-this.es*Math.pow(a,2),h=h/Math.sqrt(i);var _=Vh(e,a,l,this.en);s=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+p+14*u-58*f*u+c/42*(61+179*p-p*f-479*f)))))+this.x0,o=this.a*(this.k0*(_-this.ml0+a*n*h/2*(1+c/12*(5-f+9*u+4*d+c/30*(61+p-58*f+270*u-330*f*u+c/56*(1385+543*p-p*f-3111*f))))))+this.y0}else{var y=l*Math.sin(n);if(Math.abs(Math.abs(y)-1)=1){if(y-1>H)return 93;o=0}else o=Math.acos(o);e<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return r.x=s,r.y=o,r}function zF(r){var t,e,n,i,s=(r.x-this.x0)*(1/this.a),o=(r.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,e=R1(t,this.es,this.en),Math.abs(e)<$){var a=Math.sin(e),l=Math.cos(e),h=Math.abs(l)>H?Math.tan(e):0,c=this.ep2*Math.pow(l,2),u=Math.pow(c,2),d=Math.pow(h,2),g=Math.pow(d,2);t=1-this.es*Math.pow(a,2);var f=s*Math.sqrt(t)/this.k0,p=Math.pow(f,2);t=t*h,n=e-t*p/(1-this.es)*.5*(1-p/12*(5+3*d-9*c*d+c-4*u-p/30*(61+90*d-252*c*d+45*g+46*c-p/56*(1385+3633*d+4095*g+1574*g*d)))),i=Q(this.long0+f*(1-p/6*(1+2*d+c-p/20*(5+28*d+24*g+8*c*d+6*c-p/42*(61+662*d+1320*g+720*g*d))))/l)}else n=$*ka(o),i=0;else{var _=Math.exp(s/this.k0),y=.5*(_-1/_),v=this.lat0+o/this.k0,w=Math.cos(v);t=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(y,2))),n=Math.asin(t),o<0&&(n=-n),y===0&&w===0?i=0:i=Q(Math.atan2(y,w)+this.long0)}return r.x=i,r.y=n,r}var UF=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const _l={init:GF,forward:jF,inverse:zF,names:UF};function C1(r){var t=Math.exp(r);return t=(t-1/t)/2,t}function Tr(r,t){r=Math.abs(r),t=Math.abs(t);var e=Math.max(r,t),n=Math.min(r,t)/(e||1);return e*Math.sqrt(1+Math.pow(n,2))}function BF(r){var t=1+r,e=t-1;return e===0?r:r*Math.log(t)/e}function XF(r){var t=Math.abs(r);return t=BF(t*(1+t/(Tr(1,t)+1))),r<0?-t:t}function kg(r,t){for(var e=2*Math.cos(2*t),n=r.length-1,i=r[n],s=0,o;--n>=0;)o=-s+e*i+r[n],s=i,i=o;return t+o*Math.sin(2*t)}function WF(r,t){for(var e=2*Math.cos(t),n=r.length-1,i=r[n],s=0,o;--n>=0;)o=-s+e*i+r[n],s=i,i=o;return Math.sin(t)*o}function ZF(r){var t=Math.exp(r);return t=(t+1/t)/2,t}function I1(r,t,e){for(var n=Math.sin(t),i=Math.cos(t),s=C1(e),o=ZF(e),a=2*i*o,l=-2*n*s,h=r.length-1,c=r[h],u=0,d=0,g=0,f,p;--h>=0;)f=d,p=u,d=c,u=g,c=-f+a*d-l*u+r[h],g=-p+l*d+a*u;return a=n*o,l=i*s,[a*c-l*g,a*g+l*c]}function qF(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(_l.init.apply(this),this.forward=_l.forward,this.inverse=_l.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var r=this.es/(1+Math.sqrt(1-this.es)),t=r/(2-r),e=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),e=e*t,this.cgb[1]=e*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=e*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),e=e*t,this.cgb[2]=e*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=e*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),e=e*t,this.cgb[3]=e*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=e*(1237/630+t*(-12/5+t*(-24832/14175))),e=e*t,this.cgb[4]=e*(4174/315+t*(-144838/6237)),this.cbg[4]=e*(-734/315+t*(109598/31185)),e=e*t,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=e*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=e*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),e=e*t,this.utg[2]=e*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=e*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),e=e*t,this.utg[3]=e*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=e*(49561/161280+t*(-179/168+t*(6601661/7257600))),e=e*t,this.utg[4]=e*(-4583/161280+t*(108847/3991680)),this.gtu[4]=e*(34729/80640+t*(-3418889/1995840)),e=e*t,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=e*(212378941/319334400);var n=kg(this.cbg,this.lat0);this.Zb=-this.Qn*(n+WF(this.gtu,2*n))}function $F(r){var t=Q(r.x-this.long0),e=r.y;e=kg(this.cbg,e);var n=Math.sin(e),i=Math.cos(e),s=Math.sin(t),o=Math.cos(t);e=Math.atan2(n,o*i),t=Math.atan2(s*i,Tr(n,i*o)),t=XF(Math.tan(t));var a=I1(this.gtu,2*e,2*t);e=e+a[0],t=t+a[1];var l,h;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,h=this.a*(this.Qn*e+this.Zb)+this.y0):(l=1/0,h=1/0),r.x=l,r.y=h,r}function VF(r){var t=(r.x-this.x0)*(1/this.a),e=(r.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var n,i;if(Math.abs(t)<=2.623395162778){var s=I1(this.utg,2*e,2*t);e=e+s[0],t=t+s[1],t=Math.atan(C1(t));var o=Math.sin(e),a=Math.cos(e),l=Math.sin(t),h=Math.cos(t);e=Math.atan2(o*h,Tr(l,h*a)),t=Math.atan2(l,h*a),n=Q(t+this.long0),i=kg(this.cgb,e)}else n=1/0,i=1/0;return r.x=n,r.y=i,r}var YF=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const yl={init:qF,forward:$F,inverse:VF,names:YF};function HF(r,t){if(r===void 0){if(r=Math.floor((Q(t)+Math.PI)*30/Math.PI)+1,r<0)return 0;if(r>60)return 60}return r}var KF="etmerc";function JF(){var r=HF(this.zone,this.long0);if(r===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(r)-183)*Ce,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,yl.init.apply(this),this.forward=yl.forward,this.inverse=yl.inverse}var QF=["Universal Transverse Mercator System","utm"];const t3={init:JF,names:QF,dependsOn:KF};function Gg(r,t){return Math.pow((1-r)/(1+r),t)}var e3=20;function r3(){var r=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*r*r),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(r/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Wt)/(Math.pow(Math.tan(.5*this.lat0+Wt),this.C)*Gg(this.e*r,this.ratexp))}function n3(r){var t=r.x,e=r.y;return r.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+Wt),this.C)*Gg(this.e*Math.sin(e),this.ratexp))-$,r.x=this.C*t,r}function i3(r){for(var t=1e-14,e=r.x/this.C,n=r.y,i=Math.pow(Math.tan(.5*n+Wt)/this.K,1/this.C),s=e3;s>0&&(n=2*Math.atan(i*Gg(this.e*Math.sin(r.y),-.5*this.e))-$,!(Math.abs(n-r.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=H&&Math.abs(Math.cos(this.lat_ts))>H&&(this.k0=.5*this.cons*dn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/zr(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=dn(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-$,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function g3(r){var t=r.x,e=r.y,n=Math.sin(e),i=Math.cos(e),s,o,a,l,h,c,u=Q(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=H&&Math.abs(e+this.lat0)<=H?(r.x=NaN,r.y=NaN,r):this.sphere?(s=2*this.k0/(1+this.sinlat0*n+this.coslat0*i*Math.cos(u)),r.x=this.a*s*i*Math.sin(u)+this.x0,r.y=this.a*s*(this.coslat0*n-this.sinlat0*i*Math.cos(u))+this.y0,r):(o=2*Math.atan(this.ssfn_(e,n,this.e))-$,l=Math.cos(o),a=Math.sin(o),Math.abs(this.coslat0)<=H?(h=zr(this.e,e*this.con,this.con*n),c=2*this.a*this.k0*h/this.cons,r.x=this.x0+c*Math.sin(t-this.long0),r.y=this.y0-this.con*c*Math.cos(t-this.long0),r):(Math.abs(this.sinlat0)0?t=Q(this.long0+Math.atan2(r.x,-1*r.y)):t=Q(this.long0+Math.atan2(r.x,r.y)):t=Q(this.long0+Math.atan2(r.x*Math.sin(a),o*this.coslat0*Math.cos(a)-r.y*this.sinlat0*Math.sin(a))),r.x=t,r.y=e,r)}else if(Math.abs(this.coslat0)<=H){if(o<=H)return e=this.lat0,t=this.long0,r.x=t,r.y=e,r;r.x*=this.con,r.y*=this.con,n=o*this.cons/(2*this.a*this.k0),e=this.con*da(this.e,n),t=this.con*Q(this.con*this.long0+Math.atan2(r.x,-1*r.y))}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=H?s=this.X0:(s=Math.asin(Math.cos(i)*this.sinX0+r.y*Math.sin(i)*this.cosX0/o),t=Q(this.long0+Math.atan2(r.x*Math.sin(i),o*this.cosX0*Math.cos(i)-r.y*this.sinX0*Math.sin(i)))),e=-1*da(this.e,Math.tan(.5*($+s)));return r.x=t,r.y=e,r}var p3=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const m3={init:d3,forward:g3,inverse:f3,names:p3,ssfn_:u3};function _3(){var r=this.lat0;this.lambda0=this.long0;var t=Math.sin(r),e=this.a,n=this.rf,i=1/n,s=2*i-Math.pow(i,2),o=this.e=Math.sqrt(s);this.R=this.k0*e*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(r),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+r/2)),h=Math.log((1+o*t)/(1-o*t));this.K=a-this.alpha*l+this.alpha*o/2*h}function y3(r){var t=Math.log(Math.tan(Math.PI/4-r.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(r.y))/(1-this.e*Math.sin(r.y))),n=-this.alpha*(t+e)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(r.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(s));return r.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,r.x=this.R*o+this.x0,r}function x3(r){for(var t=r.x-this.x0,e=r.y-this.y0,n=t/this.R,i=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+o/this.alpha,l=0,h=s,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return r.x=a,r.y=h,r}var v3=["somerc"];const w3={init:_3,forward:y3,inverse:x3,names:v3};var ps=1e-7;function S3(r){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof r.PROJECTION=="object"?Object.keys(r.PROJECTION)[0]:r.PROJECTION;return"no_uoff"in r||"no_off"in r||t.indexOf(e)!==-1}function E3(){var r,t,e,n,i,s,o,a,l,h,c=0,u,d=0,g=0,f=0,p=0,_=0,y=0;this.no_off=S3(this),this.no_rot="no_rot"in this;var v=!1;"alpha"in this&&(v=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),v&&(y=this.alpha),w&&(c=this.rectified_grid_angle*Ce),v||w)d=this.longc;else if(g=this.long1,p=this.lat1,f=this.long2,_=this.lat2,Math.abs(p-_)<=ps||(r=Math.abs(p))<=ps||Math.abs(r-$)<=ps||Math.abs(Math.abs(this.lat0)-$)<=ps||Math.abs(Math.abs(_)-$)<=ps)throw new Error;var S=1-this.es;t=Math.sqrt(S),Math.abs(this.lat0)>H?(a=Math.sin(this.lat0),e=Math.cos(this.lat0),r=1-this.es*a*a,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/S),this.A=this.B*this.k0*t/r,n=this.B*t/(e*Math.sqrt(r)),i=n*n-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(zr(this.e,this.lat0,a),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=i=1),v||w?(v?(u=Math.asin(Math.sin(y)/n),w||(c=y)):(u=c,y=Math.asin(n*Math.sin(u))),this.lam0=d-Math.asin(.5*(i-1/i)*Math.tan(u))/this.B):(s=Math.pow(zr(this.e,p,Math.sin(p)),this.B),o=Math.pow(zr(this.e,_,Math.sin(_)),this.B),i=this.E/s,l=(o-s)/(o+s),h=this.E*this.E,h=(h-o*s)/(h+o*s),r=g-f,r<-Math.pi?f-=ca:r>Math.pi&&(f+=ca),this.lam0=Q(.5*(g+f)-Math.atan(h*Math.tan(.5*this.B*(g-f))/l)/this.B),u=Math.atan(2*Math.sin(this.B*Q(g-this.lam0))/(i-1/i)),c=y=Math.asin(n*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(y))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(Wt-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(Wt+i))}function b3(r){var t={},e,n,i,s,o,a,l,h;if(r.x=r.x-this.lam0,Math.abs(Math.abs(r.y)-$)>H){if(o=this.E/Math.pow(zr(this.e,r.y,Math.sin(r.y)),this.B),a=1/o,e=.5*(o-a),n=.5*(o+a),s=Math.sin(this.B*r.x),i=(e*this.singam-s*this.cosgam)/n,Math.abs(Math.abs(i)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*r.y;return this.no_rot?(t.x=l,t.y=h):(l-=this.u_0,t.x=h*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-h*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function T3(r){var t,e,n,i,s,o,a,l={};if(r.x=(r.x-this.x0)*(1/this.a),r.y=(r.y-this.y0)*(1/this.a),this.no_rot?(e=r.y,t=r.x):(e=r.x*this.cosrot-r.y*this.sinrot,t=r.y*this.cosrot+r.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*e),i=.5*(n-1/n),s=.5*(n+1/n),o=Math.sin(this.BrA*t),a=(o*this.cosgam+i*this.singam)/s,Math.abs(Math.abs(a)-1)H?this.ns=Math.log(n/a)/Math.log(i/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function I3(r){var t=r.x,e=r.y;Math.abs(2*Math.abs(e)-Math.PI)<=H&&(e=ka(e)*($-2*H));var n=Math.abs(Math.abs(e)-$),i,s;if(n>H)i=zr(this.e,e,Math.sin(e)),s=this.a*this.f0*Math.pow(i,this.ns);else{if(n=e*this.ns,n<=0)return null;s=0}var o=this.ns*Q(t-this.long0);return r.x=this.k0*(s*Math.sin(o))+this.x0,r.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,r}function P3(r){var t,e,n,i,s,o=(r.x-this.x0)/this.k0,a=this.rh-(r.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+a*a),e=1):(t=-Math.sqrt(o*o+a*a),e=-1);var l=0;if(t!==0&&(l=Math.atan2(e*o,e*a)),t!==0||this.ns>0){if(e=1/this.ns,n=Math.pow(t/(this.a*this.f0),e),i=da(this.e,n),i===-9999)return null}else i=-$;return s=Q(l/this.ns+this.long0),r.x=s,r.y=i,r}var A3=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const L3={init:C3,forward:I3,inverse:P3,names:A3};function O3(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function F3(r){var t,e,n,i,s,o,a,l=r.x,h=r.y,c=Q(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),n=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(n)),s=Math.asin(Math.cos(e)*Math.sin(n)/Math.cos(i)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),r.y=a*Math.cos(o)/1,r.x=a*Math.sin(o)/1,this.czech||(r.y*=-1,r.x*=-1),r}function N3(r){var t,e,n,i,s,o,a,l,h=r.x;r.x=r.y,r.y=h,this.czech||(r.y*=-1,r.x*=-1),o=Math.sqrt(r.x*r.x+r.y*r.y),s=Math.atan2(r.y,r.x),i=s/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),e=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(t)),r.x=this.long0-e/this.alfa,a=t,l=0;var c=0;do r.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-r.y)<1e-10&&(l=1),a=r.y,c+=1;while(l===0&&c<15);return c>=15?null:r}var D3=["Krovak","krovak"];const k3={init:O3,forward:F3,inverse:N3,names:D3};function qe(r,t,e,n,i){return r*i-t*Math.sin(2*i)+e*Math.sin(4*i)-n*Math.sin(6*i)}function Ga(r){return 1-.25*r*(1+r/16*(3+1.25*r))}function ja(r){return .375*r*(1+.25*r*(1+.46875*r))}function za(r){return .05859375*r*r*(1+.75*r)}function Ua(r){return r*r*r*(35/3072)}function Zs(r,t,e){var n=t*e;return r/Math.sqrt(1-n*n)}function oo(r){return Math.abs(r)<$?r:r-ka(r)*Math.PI}function eh(r,t,e,n,i){var s,o;s=r/t;for(var a=0;a<15;a++)if(o=(r-(t*s-e*Math.sin(2*s)+n*Math.sin(4*s)-i*Math.sin(6*s)))/(t-2*e*Math.cos(2*s)+4*n*Math.cos(4*s)-6*i*Math.cos(6*s)),s+=o,Math.abs(o)<=1e-10)return s;return NaN}function G3(){this.sphere||(this.e0=Ga(this.es),this.e1=ja(this.es),this.e2=za(this.es),this.e3=Ua(this.es),this.ml0=this.a*qe(this.e0,this.e1,this.e2,this.e3,this.lat0))}function j3(r){var t,e,n=r.x,i=r.y;if(n=Q(n-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(n)),e=this.a*(Math.atan2(Math.tan(i),Math.cos(n))-this.lat0);else{var s=Math.sin(i),o=Math.cos(i),a=Zs(this.a,this.e,s),l=Math.tan(i)*Math.tan(i),h=n*Math.cos(i),c=h*h,u=this.es*o*o/(1-this.es),d=this.a*qe(this.e0,this.e1,this.e2,this.e3,i);t=a*h*(1-c*l*(1/6-(8-l+8*u)*c/120)),e=d-this.ml0+a*s/o*c*(.5+(5-l+6*u)*c/24)}return r.x=t+this.x0,r.y=e+this.y0,r}function z3(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,n,i;if(this.sphere){var s=e+this.lat0;n=Math.asin(Math.sin(s)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(s))}else{var o=this.ml0/this.a+e,a=eh(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-$)<=H)return r.x=this.long0,r.y=$,e<0&&(r.y*=-1),r;var l=Zs(this.a,this.e,Math.sin(a)),h=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(a),2),u=t*this.a/l,d=u*u;n=a-l*Math.tan(a)/h*u*u*(.5-(1+3*c)*u*u/24),i=u*(1-d*(c/3+(1+3*c)*c*d/15))/Math.cos(a)}return r.x=Q(i+this.long0),r.y=oo(n),r}var U3=["Cassini","Cassini_Soldner","cass"];const B3={init:G3,forward:j3,inverse:z3,names:U3};function ci(r,t){var e;return r>1e-7?(e=r*t,(1-r*r)*(t/(1-e*e)-.5/r*Math.log((1-e)/(1+e)))):2*t}var X3=1,W3=2,Z3=3,q3=4;function $3(){var r=Math.abs(this.lat0);if(Math.abs(r-$)0){var t;switch(this.qp=ci(this.e,1),this.mmf=.5/(1-this.es),this.apa=rN(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=ci(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function V3(r){var t,e,n,i,s,o,a,l,h,c,u=r.x,d=r.y;if(u=Q(u-this.long0),this.sphere){if(s=Math.sin(d),c=Math.cos(d),n=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+c*n:1+this.sinph0*s+this.cosph0*c*n,e<=H)return null;e=Math.sqrt(2/e),t=e*c*Math.sin(u),e*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*c*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(d+this.lat0)=0?(t=(h=Math.sqrt(o))*i,e=n*(this.mode===this.S_POLE?h:-h)):t=e=0;break}}return r.x=this.a*t+this.x0,r.y=this.a*e+this.y0,r}function Y3(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,n,i,s,o,a,l,h;if(this.sphere){var c=0,u,d=0;if(u=Math.sqrt(t*t+e*e),i=u*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(d=Math.sin(i),c=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(u)<=H?0:Math.asin(e*d/u),t*=d,e=c*u;break;case this.OBLIQ:i=Math.abs(u)<=H?this.lat0:Math.asin(c*this.sinph0+e*d*this.cosph0/u),t*=d*this.cosph0,e=(c-Math.sin(i)*this.sinph0)*u;break;case this.N_POLE:e=-e,i=$-i;break;case this.S_POLE:i-=$;break}n=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(h=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,l=Math.sqrt(t*t+e*e),l1&&(r=r>1?1:-1),Math.asin(r)}function oN(){Math.abs(this.lat1+this.lat2)H?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function aN(r){var t=r.x,e=r.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var n=ci(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*Q(t-this.long0),o=i*Math.sin(s)+this.x0,a=this.rh-i*Math.cos(s)+this.y0;return r.x=o,r.y=a,r}function lN(r){var t,e,n,i,s,o;return r.x-=this.x0,r.y=this.rh-r.y+this.y0,this.ns0>=0?(t=Math.sqrt(r.x*r.x+r.y*r.y),n=1):(t=-Math.sqrt(r.x*r.x+r.y*r.y),n=-1),i=0,t!==0&&(i=Math.atan2(n*r.x,n*r.y)),n=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(e=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,e)),s=Q(i/this.ns0+this.long0),r.x=s,r.y=o,r}function hN(r,t){var e,n,i,s,o,a=pi(.5*t);if(r0||Math.abs(o)<=H?(a=this.x0+this.a*s*e*Math.sin(n)/o,l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*i)/o):(a=this.x0+this.infinity_dist*e*Math.sin(n),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*i)),r.x=a,r.y=l,r}function fN(r){var t,e,n,i,s,o;return r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,(t=Math.sqrt(r.x*r.x+r.y*r.y))?(i=Math.atan2(t,this.rc),e=Math.sin(i),n=Math.cos(i),o=pi(n*this.sin_p14+r.y*e*this.cos_p14/t),s=Math.atan2(r.x*e,t*this.cos_p14*n-r.y*this.sin_p14*e),s=Q(this.long0+s)):(o=this.phic0,s=0),r.x=s,r.y=o,r}var pN=["gnom"];const mN={init:dN,forward:gN,inverse:fN,names:pN};function _N(r,t){var e=1-(1-r*r)/(2*r)*Math.log((1-r)/(1+r));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*$:$;for(var n=Math.asin(.5*t),i,s,o,a,l=0;l<30;l++)if(s=Math.sin(n),o=Math.cos(n),a=r*s,i=Math.pow(1-a*a,2)/(2*o)*(t/(1-r*r)-s/(1-a*a)+.5/r*Math.log((1-a)/(1+a))),n+=i,Math.abs(i)<=1e-10)return n;return NaN}function yN(){this.sphere||(this.k0=dn(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function xN(r){var t=r.x,e=r.y,n,i,s=Q(t-this.long0);if(this.sphere)n=this.x0+this.a*s*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var o=ci(this.e,Math.sin(e));n=this.x0+this.a*this.k0*s,i=this.y0+this.a*o*.5/this.k0}return r.x=n,r.y=i,r}function vN(r){r.x-=this.x0,r.y-=this.y0;var t,e;return this.sphere?(t=Q(this.long0+r.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(r.y/this.a*Math.cos(this.lat_ts))):(e=_N(this.e,2*r.y*this.k0/this.a),t=Q(this.long0+r.x/(this.a*this.k0))),r.x=t,r.y=e,r}var wN=["cea"];const SN={init:yN,forward:xN,inverse:vN,names:wN};function EN(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function bN(r){var t=r.x,e=r.y,n=Q(t-this.long0),i=oo(e-this.lat0);return r.x=this.x0+this.a*n*this.rc,r.y=this.y0+this.a*i,r}function TN(r){var t=r.x,e=r.y;return r.x=Q(this.long0+(t-this.x0)/(this.a*this.rc)),r.y=oo(this.lat0+(e-this.y0)/this.a),r}var MN=["Equirectangular","Equidistant_Cylindrical","eqc"];const RN={init:EN,forward:bN,inverse:TN,names:MN};var vm=20;function CN(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ga(this.es),this.e1=ja(this.es),this.e2=za(this.es),this.e3=Ua(this.es),this.ml0=this.a*qe(this.e0,this.e1,this.e2,this.e3,this.lat0)}function IN(r){var t=r.x,e=r.y,n,i,s,o=Q(t-this.long0);if(s=o*Math.sin(e),this.sphere)Math.abs(e)<=H?(n=this.a*o,i=-1*this.a*this.lat0):(n=this.a*Math.sin(s)/Math.tan(e),i=this.a*(oo(e-this.lat0)+(1-Math.cos(s))/Math.tan(e)));else if(Math.abs(e)<=H)n=this.a*o,i=-1*this.ml0;else{var a=Zs(this.a,this.e,Math.sin(e))/Math.tan(e);n=a*Math.sin(s),i=this.a*qe(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+a*(1-Math.cos(s))}return r.x=n+this.x0,r.y=i+this.y0,r}function PN(r){var t,e,n,i,s,o,a,l,h;if(n=r.x-this.x0,i=r.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=H)t=Q(n/this.a+this.long0),e=0;else{o=this.lat0+i/this.a,a=n*n/this.a/this.a+o*o,l=o;var c;for(s=vm;s;--s)if(c=Math.tan(l),h=-1*(o*(l*c+1)-l-.5*(l*l+a)*c)/((l-o)/c-1),l+=h,Math.abs(h)<=H){e=l;break}t=Q(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(e))}else if(Math.abs(i+this.ml0)<=H)e=0,t=Q(this.long0+n/this.a);else{o=(this.ml0+i)/this.a,a=n*n/this.a/this.a+o*o,l=o;var u,d,g,f,p;for(s=vm;s;--s)if(p=this.e*Math.sin(l),u=Math.sqrt(1-p*p)*Math.tan(l),d=this.a*qe(this.e0,this.e1,this.e2,this.e3,l),g=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),f=d/this.a,h=(o*(u*f+1)-f-.5*u*(f*f+a))/(this.es*Math.sin(2*l)*(f*f+a-2*o*f)/(4*u)+(o-f)*(u*g-2/Math.sin(2*l))-g),l-=h,Math.abs(h)<=H){e=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=Q(this.long0+Math.asin(n*u/this.a)/Math.sin(e))}return r.x=t,r.y=e,r}var AN=["Polyconic","poly"];const LN={init:CN,forward:IN,inverse:PN,names:AN};function ON(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function FN(r){var t,e=r.x,n=r.y,i=n-this.lat0,s=e-this.long0,o=i/jo*1e-5,a=s,l=1,h=0;for(t=1;t<=10;t++)l=l*o,h=h+this.A[t]*l;var c=h,u=a,d=1,g=0,f,p,_=0,y=0;for(t=1;t<=6;t++)f=d*c-g*u,p=g*c+d*u,d=f,g=p,_=_+this.B_re[t]*d-this.B_im[t]*g,y=y+this.B_im[t]*d+this.B_re[t]*g;return r.x=y*this.a+this.x0,r.y=_*this.a+this.y0,r}function NN(r){var t,e=r.x,n=r.y,i=e-this.x0,s=n-this.y0,o=s/this.a,a=i/this.a,l=1,h=0,c,u,d=0,g=0;for(t=1;t<=6;t++)c=l*o-h*a,u=h*o+l*a,l=c,h=u,d=d+this.C_re[t]*l-this.C_im[t]*h,g=g+this.C_im[t]*l+this.C_re[t]*h;for(var f=0;f.999999999999&&(e=.999999999999),t=Math.asin(e);var n=Q(this.long0+r.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var i=Math.asin(e);return r.x=n,r.y=i,r}var JN=["Mollweide","moll"];const QN={init:YN,forward:HN,inverse:KN,names:JN};function tD(){Math.abs(this.lat1+this.lat2)=0?(e=Math.sqrt(r.x*r.x+r.y*r.y),t=1):(e=-Math.sqrt(r.x*r.x+r.y*r.y),t=-1);var s=0;if(e!==0&&(s=Math.atan2(t*r.x,t*r.y)),this.sphere)return i=Q(this.long0+s/this.ns),n=oo(this.g-e/this.a),r.x=i,r.y=n,r;var o=this.g-e/this.a;return n=eh(o,this.e0,this.e1,this.e2,this.e3),i=Q(this.long0+s/this.ns),r.x=i,r.y=n,r}var nD=["Equidistant_Conic","eqdc"];const iD={init:tD,forward:eD,inverse:rD,names:nD};function sD(){this.R=this.a}function oD(r){var t=r.x,e=r.y,n=Q(t-this.long0),i,s;Math.abs(e)<=H&&(i=this.x0+this.R*n,s=this.y0);var o=pi(2*Math.abs(e/Math.PI));(Math.abs(n)<=H||Math.abs(Math.abs(e)-$)<=H)&&(i=this.x0,e>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*o):s=this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/n-n/Math.PI),l=a*a,h=Math.sin(o),c=Math.cos(o),u=c/(h+c-1),d=u*u,g=u*(2/h-1),f=g*g,p=Math.PI*this.R*(a*(u-f)+Math.sqrt(l*(u-f)*(u-f)-(f+l)*(d-f)))/(f+l);n<0&&(p=-p),i=this.x0+p;var _=l+u;return p=Math.PI*this.R*(g*_-a*Math.sqrt((f+l)*(l+1)-_*_))/(f+l),e>=0?s=this.y0+p:s=this.y0-p,r.x=i,r.y=s,r}function aD(r){var t,e,n,i,s,o,a,l,h,c,u,d,g;return r.x-=this.x0,r.y-=this.y0,u=Math.PI*this.R,n=r.x/u,i=r.y/u,s=n*n+i*i,o=-Math.abs(i)*(1+s),a=o-2*i*i+n*n,l=-2*o+1+2*i*i+s*s,g=i*i/l+(2*a*a*a/l/l/l-9*o*a/l/l)/27,h=(o-a*a/3/l)/l,c=2*Math.sqrt(-h/3),u=3*g/h/c,Math.abs(u)>1&&(u>=0?u=1:u=-1),d=Math.acos(u)/3,r.y>=0?e=(-c*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI:e=-(-c*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI,Math.abs(n)2*$*this.a?void 0:(e=t/this.a,n=Math.sin(e),i=Math.cos(e),s=this.long0,Math.abs(t)<=H?o=this.lat0:(o=pi(i*this.sin_p12+r.y*n*this.cos_p12/t),a=Math.abs(this.lat0)-$,Math.abs(a)<=H?this.lat0>=0?s=Q(this.long0+Math.atan2(r.x,-r.y)):s=Q(this.long0-Math.atan2(-r.x,r.y)):s=Q(this.long0+Math.atan2(r.x*n,t*this.cos_p12*i-r.y*this.sin_p12*n))),r.x=s,r.y=o,r)):(l=Ga(this.es),h=ja(this.es),c=za(this.es),u=Ua(this.es),Math.abs(this.sin_p12-1)<=H?(d=this.a*qe(l,h,c,u,$),t=Math.sqrt(r.x*r.x+r.y*r.y),g=d-t,o=eh(g/this.a,l,h,c,u),s=Q(this.long0+Math.atan2(r.x,-1*r.y)),r.x=s,r.y=o,r):Math.abs(this.sin_p12+1)<=H?(d=this.a*qe(l,h,c,u,$),t=Math.sqrt(r.x*r.x+r.y*r.y),g=t-d,o=eh(g/this.a,l,h,c,u),s=Q(this.long0+Math.atan2(r.x,r.y)),r.x=s,r.y=o,r):(t=Math.sqrt(r.x*r.x+r.y*r.y),_=Math.atan2(r.x,r.y),f=Zs(this.a,this.e,this.sin_p12),y=Math.cos(_),v=this.e*this.cos_p12*y,w=-v*v/(1-this.es),S=3*this.es*(1-w)*this.sin_p12*this.cos_p12*y/(1-this.es),E=t/f,T=E-w*(1+w)*Math.pow(E,3)/6-S*(1+3*w)*Math.pow(E,4)/24,M=1-w*T*T/2-E*T*T*T/6,p=Math.asin(this.sin_p12*Math.cos(T)+this.cos_p12*Math.sin(T)*y),s=Q(this.long0+Math.asin(Math.sin(_)*Math.sin(T)/Math.cos(p))),C=Math.sin(p),o=Math.atan2((C-this.es*M*this.sin_p12)*Math.tan(p),C*(1-this.es)),r.x=s,r.y=o,r))}var gD=["Azimuthal_Equidistant","aeqd"];const fD={init:cD,forward:uD,inverse:dD,names:gD};function pD(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function mD(r){var t,e,n,i,s,o,a,l,h=r.x,c=r.y;return n=Q(h-this.long0),t=Math.sin(c),e=Math.cos(c),i=Math.cos(n),o=this.sin_p14*t+this.cos_p14*e*i,s=1,(o>0||Math.abs(o)<=H)&&(a=this.a*s*e*Math.sin(n),l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*i)),r.x=a,r.y=l,r}function _D(r){var t,e,n,i,s,o,a;return r.x-=this.x0,r.y-=this.y0,t=Math.sqrt(r.x*r.x+r.y*r.y),e=pi(t/this.a),n=Math.sin(e),i=Math.cos(e),o=this.long0,Math.abs(t)<=H?(a=this.lat0,r.x=o,r.y=a,r):(a=pi(i*this.sin_p14+r.y*n*this.cos_p14/t),s=Math.abs(this.lat0)-$,Math.abs(s)<=H?(this.lat0>=0?o=Q(this.long0+Math.atan2(r.x,-r.y)):o=Q(this.long0-Math.atan2(-r.x,r.y)),r.x=o,r.y=a,r):(o=Q(this.long0+Math.atan2(r.x*n,t*this.cos_p14*i-r.y*this.sin_p14*n)),r.x=o,r.y=a,r))}var yD=["ortho"];const xD={init:pD,forward:mD,inverse:_D,names:yD};var ne={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Zt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function vD(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=$-Wt/2?this.face=ne.TOP:this.lat0<=-($-Wt/2)?this.face=ne.BOTTOM:Math.abs(this.long0)<=Wt?this.face=ne.FRONT:Math.abs(this.long0)<=$+Wt?this.face=this.long0>0?ne.RIGHT:ne.LEFT:this.face=ne.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function wD(r){var t={x:0,y:0},e,n,i,s,o,a,l={value:0};if(r.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(r.y)):e=r.y,n=r.x,this.face===ne.TOP)s=$-e,n>=Wt&&n<=$+Wt?(l.value=Zt.AREA_0,i=n-$):n>$+Wt||n<=-($+Wt)?(l.value=Zt.AREA_1,i=n>0?n-ce:n+ce):n>-($+Wt)&&n<=-Wt?(l.value=Zt.AREA_2,i=n+$):(l.value=Zt.AREA_3,i=n);else if(this.face===ne.BOTTOM)s=$+e,n>=Wt&&n<=$+Wt?(l.value=Zt.AREA_0,i=-n+$):n=-Wt?(l.value=Zt.AREA_1,i=-n):n<-Wt&&n>=-($+Wt)?(l.value=Zt.AREA_2,i=-n-$):(l.value=Zt.AREA_3,i=n>0?-n+ce:-n-ce);else{var h,c,u,d,g,f,p;this.face===ne.RIGHT?n=As(n,+$):this.face===ne.BACK?n=As(n,+ce):this.face===ne.LEFT&&(n=As(n,-$)),d=Math.sin(e),g=Math.cos(e),f=Math.sin(n),p=Math.cos(n),h=g*p,c=g*f,u=d,this.face===ne.FRONT?(s=Math.acos(h),i=hl(s,u,c,l)):this.face===ne.RIGHT?(s=Math.acos(c),i=hl(s,u,-h,l)):this.face===ne.BACK?(s=Math.acos(-h),i=hl(s,u,-c,l)):this.face===ne.LEFT?(s=Math.acos(-c),i=hl(s,u,h,l)):(s=i=0,l.value=Zt.AREA_0)}return a=Math.atan(12/ce*(i+Math.acos(Math.sin(i)*Math.cos(Wt))-$)),o=Math.sqrt((1-Math.cos(s))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Zt.AREA_1?a+=$:l.value===Zt.AREA_2?a+=ce:l.value===Zt.AREA_3&&(a+=1.5*ce),t.x=o*Math.cos(a),t.y=o*Math.sin(a),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,r.x=t.x,r.y=t.y,r}function SD(r){var t={lam:0,phi:0},e,n,i,s,o,a,l,h,c,u={value:0};if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,n=Math.atan(Math.sqrt(r.x*r.x+r.y*r.y)),e=Math.atan2(r.y,r.x),r.x>=0&&r.x>=Math.abs(r.y)?u.value=Zt.AREA_0:r.y>=0&&r.y>=Math.abs(r.x)?(u.value=Zt.AREA_1,e-=$):r.x<0&&-r.x>=Math.abs(r.y)?(u.value=Zt.AREA_2,e=e<0?e+ce:e-ce):(u.value=Zt.AREA_3,e+=$),c=ce/12*Math.tan(e),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),a=Math.atan(o),i=Math.cos(e),s=Math.tan(n),l=1-i*i*s*s*(1-Math.cos(Math.atan(1/Math.cos(a)))),l<-1?l=-1:l>1&&(l=1),this.face===ne.TOP)h=Math.acos(l),t.phi=$-h,u.value===Zt.AREA_0?t.lam=a+$:u.value===Zt.AREA_1?t.lam=a<0?a+ce:a-ce:u.value===Zt.AREA_2?t.lam=a-$:t.lam=a;else if(this.face===ne.BOTTOM)h=Math.acos(l),t.phi=h-$,u.value===Zt.AREA_0?t.lam=-a+$:u.value===Zt.AREA_1?t.lam=-a:u.value===Zt.AREA_2?t.lam=-a-$:t.lam=a<0?-a-ce:-a+ce;else{var d,g,f;d=l,c=d*d,c>=1?f=0:f=Math.sqrt(1-c)*Math.sin(a),c+=f*f,c>=1?g=0:g=Math.sqrt(1-c),u.value===Zt.AREA_1?(c=g,g=-f,f=c):u.value===Zt.AREA_2?(g=-g,f=-f):u.value===Zt.AREA_3&&(c=g,g=f,f=-c),this.face===ne.RIGHT?(c=d,d=-g,g=c):this.face===ne.BACK?(d=-d,g=-g):this.face===ne.LEFT&&(c=d,d=g,g=-c),t.phi=Math.acos(-f)-$,t.lam=Math.atan2(g,d),this.face===ne.RIGHT?t.lam=As(t.lam,-$):this.face===ne.BACK?t.lam=As(t.lam,-ce):this.face===ne.LEFT&&(t.lam=As(t.lam,+$))}if(this.es!==0){var p,_,y;p=t.phi<0?1:0,_=Math.tan(t.phi),y=this.b/Math.sqrt(_*_+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-y*y)/(this.one_minus_f*y)),p&&(t.phi=-t.phi)}return t.lam+=this.long0,r.x=t.lam,r.y=t.phi,r}function hl(r,t,e,n){var i;return rWt&&i<=$+Wt?(n.value=Zt.AREA_1,i-=$):i>$+Wt||i<=-($+Wt)?(n.value=Zt.AREA_2,i=i>=0?i-ce:i+ce):(n.value=Zt.AREA_3,i+=$)),i}function As(r,t){var e=r+t;return e<-ce?e+=ca:e>+ce&&(e-=ca),e}var ED=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const bD={init:vD,forward:wD,inverse:SD,names:ED};var Tu=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Co=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],P1=.8487,A1=1.3523,L1=sn/5,TD=1/L1,Es=18,rh=function(r,t){return r[0]+t*(r[1]+t*(r[2]+t*r[3]))},MD=function(r,t){return r[1]+t*(2*r[2]+t*3*r[3])};function RD(r,t,e,n){for(var i=t;n;--n){var s=r(i);if(i-=s,Math.abs(s)=Es&&(n=Es-1),e=sn*(e-TD*n);var i={x:rh(Tu[n],e)*t,y:rh(Co[n],e)};return r.y<0&&(i.y=-i.y),i.x=i.x*this.a*P1+this.x0,i.y=i.y*this.a*A1+this.y0,i}function PD(r){var t={x:(r.x-this.x0)/(this.a*P1),y:Math.abs(r.y-this.y0)/(this.a*A1)};if(t.y>=1)t.x/=Tu[Es][0],t.y=r.y<0?-$:$;else{var e=Math.floor(t.y*Es);for(e<0?e=0:e>=Es&&(e=Es-1);;)if(Co[e][0]>t.y)--e;else if(Co[e+1][0]<=t.y)++e;else break;var n=Co[e],i=5*(t.y-n[0])/(Co[e+1][0]-n[0]);i=RD(function(s){return(rh(n,s)-t.y)/MD(n,s)},i,H,100),t.x/=rh(Tu[e],i),t.y=(5*e+i)*Ce,r.y<0&&(t.y=-t.y)}return t.x=Q(t.x+this.long0),t}var AD=["Robinson","robin"];const LD={init:CD,forward:ID,inverse:PD,names:AD};function OD(){this.name="geocent"}function FD(r){var t=_1(r,this.es,this.a);return t}function ND(r){var t=y1(r,this.es,this.a,this.b);return t}var DD=["Geocentric","geocentric","geocent","Geocent"];const kD={init:OD,forward:FD,inverse:ND,names:DD};var De={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},_o={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function GD(){if(Object.keys(_o).forEach(function(e){if(typeof this[e]>"u")this[e]=_o[e].def;else{if(_o[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);_o[e].num&&(this[e]=parseFloat(this[e]))}_o[e].degrees&&(this[e]=this[e]*Ce)}.bind(this)),Math.abs(Math.abs(this.lat0)-$)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var r=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(r),this.sw=Math.sin(r)}function jD(r){r.x-=this.long0;var t=Math.sin(r.y),e=Math.cos(r.y),n=Math.cos(r.x),i,s;switch(this.mode){case De.OBLIQ:s=this.sinph0*t+this.cosph0*e*n;break;case De.EQUIT:s=e*n;break;case De.S_POLE:s=-t;break;case De.N_POLE:s=t;break}switch(s=this.pn1/(this.p-s),i=s*e*Math.sin(r.x),this.mode){case De.OBLIQ:s*=this.cosph0*t-this.sinph0*e*n;break;case De.EQUIT:s*=t;break;case De.N_POLE:s*=-(e*n);break;case De.S_POLE:s*=e*n;break}var o,a;return o=s*this.cg+i*this.sg,a=1/(o*this.sw*this.h1+this.cw),i=(i*this.cg-s*this.sg)*this.cw*a,s=o*a,r.x=i*this.a,r.y=s*this.a,r}function zD(r){r.x/=this.a,r.y/=this.a;var t={x:r.x,y:r.y},e,n,i;i=1/(this.pn1-r.y*this.sw),e=this.pn1*r.x*i,n=this.pn1*r.y*this.cw*i,r.x=e*this.cg+n*this.sg,r.y=n*this.cg-e*this.sg;var s=Tr(r.x,r.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var r=1-this.es,t=1/r;this.radius_p=Math.sqrt(r),this.radius_p2=r,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function WD(r){var t=r.x,e=r.y,n,i,s,o;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var a=this.radius_p/Tr(this.radius_p*Math.cos(e),Math.sin(e));if(i=a*Math.cos(t)*Math.cos(e),s=a*Math.sin(t)*Math.cos(e),o=a*Math.sin(e),(this.radius_g-i)*i-s*s-o*o*this.radius_p_inv2<0)return r.x=Number.NaN,r.y=Number.NaN,r;n=this.radius_g-i,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/Tr(o,n)),r.y=this.radius_g_1*Math.atan(o/n)):(r.x=this.radius_g_1*Math.atan(s/n),r.y=this.radius_g_1*Math.atan(o/Tr(s,n)))}else this.shape==="sphere"&&(n=Math.cos(e),i=Math.cos(t)*n,s=Math.sin(t)*n,o=Math.sin(e),n=this.radius_g-i,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/Tr(o,n)),r.y=this.radius_g_1*Math.atan(o/n)):(r.x=this.radius_g_1*Math.atan(s/n),r.y=this.radius_g_1*Math.atan(o/Tr(s,n))));return r.x=r.x*this.a,r.y=r.y*this.a,r}function ZD(r){var t=-1,e=0,n=0,i,s,o,a;if(r.x=r.x/this.a,r.y=r.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*Tr(1,n)):(e=Math.tan(r.x/this.radius_g_1),n=Math.tan(r.y/this.radius_g_1)*Tr(1,e));var l=n/this.radius_p;if(i=e*e+l*l+t*t,s=2*this.radius_g*t,o=s*s-4*i*this.C,o<0)return r.x=Number.NaN,r.y=Number.NaN,r;a=(-s-Math.sqrt(o))/(2*i),t=this.radius_g+a*t,e*=a,n*=a,r.x=Math.atan2(e,t),r.y=Math.atan(n*Math.cos(r.x)/t),r.y=Math.atan(this.radius_p_inv2*Math.tan(r.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*Math.sqrt(1+n*n)):(e=Math.tan(r.x/this.radius_g_1),n=Math.tan(r.y/this.radius_g_1)*Math.sqrt(1+e*e)),i=e*e+n*n+t*t,s=2*this.radius_g*t,o=s*s-4*i*this.C,o<0)return r.x=Number.NaN,r.y=Number.NaN,r;a=(-s-Math.sqrt(o))/(2*i),t=this.radius_g+a*t,e*=a,n*=a,r.x=Math.atan2(e,t),r.y=Math.atan(n*Math.cos(r.x)/t)}return r.x=r.x+this.long0,r}var qD=["Geostationary Satellite View","Geostationary_Satellite","geos"];const $D={init:XD,forward:WD,inverse:ZD,names:qD};var zo=1.340264,Uo=-.081106,Bo=893e-6,Xo=.003796,nh=Math.sqrt(3)/2;function VD(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function YD(r){var t=Q(r.x-this.long0),e=r.y,n=Math.asin(nh*Math.sin(e)),i=n*n,s=i*i*i;return r.x=t*Math.cos(n)/(nh*(zo+3*Uo*i+s*(7*Bo+9*Xo*i))),r.y=n*(zo+Uo*i+s*(Bo+Xo*i)),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function HD(r){r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a;var t=1e-9,e=12,n=r.y,i,s,o,a,l,h;for(h=0;h>=1;return e.join("")}const e5='Terms of Use';class r5 extends Pr{constructor(t){const e=t.hidpi!==void 0?t.hidpi:!1;super({cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,opaque:!0,projection:K("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,tilePixelRatio:e?2:1,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.hidpi_=e,this.culture_=t.culture!==void 0?t.culture:"en-us",this.maxZoom_=t.maxZoom!==void 0?t.maxZoom:-1,this.apiKey_=t.key,this.imagerySet_=t.imagerySet,this.placeholderTiles_=t.placeholderTiles;const n="https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+this.apiKey_+"&c="+this.culture_;fetch(n).then(i=>i.json()).then(i=>this.handleImageryMetadataResponse(i))}getApiKey(){return this.apiKey_}getImagerySet(){return this.imagerySet_}handleImageryMetadataResponse(t){if(t.statusCode!=200||t.statusDescription!="OK"||t.authenticationResultCode!="ValidCredentials"||t.resourceSets.length!=1||t.resourceSets[0].resources.length!=1){this.setState("error");return}const e=t.resourceSets[0].resources[0],n=this.maxZoom_==-1?e.zoomMax:this.maxZoom_,i=this.getProjection(),s=Wn(i),o=this.hidpi_?2:1,a=e.imageWidth==e.imageHeight?e.imageWidth/o:[e.imageWidth/o,e.imageHeight/o],l=Yi({extent:s,minZoom:e.zoomMin,maxZoom:n,tileSize:a});this.tileGrid=l;const h=this.culture_,c=this.hidpi_,u=this.placeholderTiles_;if(this.tileUrlFunction=Xs(e.imageUrlSubdomains.map(function(d){const g=[0,0,0],f=e.imageUrl.replace("{subdomain}",d).replace("{culture}",h);return function(p,_,y){if(!p)return;aa(p[0],p[1],p[2],g);const v=new URL(f.replace("{quadkey}",t5(g))),w=v.searchParams;return c&&(w.set("dpi","d1"),w.set("device","mobile")),u===!0?w.delete("n"):u===!1&&w.set("n","z"),v.toString()}})),e.imageryProviders){const d=qi(K("EPSG:4326"),this.getProjection());this.setAttributions(g=>{const f=[],p=g.viewState,_=this.getTileGrid(),y=_.getZForResolution(p.resolution,this.zDirection),v=_.getTileCoordForCoordAndZ(p.center,y)[0];return e.imageryProviders.map(function(w){let S=!1;const E=w.coverageAreas;for(let T=0,M=E.length;T=C.zoomMin&&v<=C.zoomMax){const P=C.bbox,G=[P[1],P[0],P[3],P[2]],D=Os(G,d);if(Yt(D,g.extent)){S=!0;break}}}S&&f.push(w.attribution)}),f.push(e5),f})}this.setState("ready")}}const n5=r5;class i5 extends zi{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,maxZoom:t.maxZoom!==void 0?t.maxZoom:18,minZoom:t.minZoom,projection:t.projection,transition:t.transition,wrapX:t.wrapX,zDirection:t.zDirection}),this.account_=t.account,this.mapId_=t.map||"",this.config_=t.config||{},this.templateCache_={},this.initializeMap_()}getConfig(){return this.config_}updateConfig(t){Object.assign(this.config_,t),this.initializeMap_()}setConfig(t){this.config_=t||{},this.initializeMap_()}initializeMap_(){const t=JSON.stringify(this.config_);if(this.templateCache_[t]){this.applyTemplate_(this.templateCache_[t]);return}let e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);const n=new XMLHttpRequest;n.addEventListener("load",this.handleInitResponse_.bind(this,t)),n.addEventListener("error",this.handleInitError_.bind(this)),n.open("POST",e),n.setRequestHeader("Content-type","application/json"),n.send(JSON.stringify(this.config_))}handleInitResponse_(t,e){const n=e.target;if(!n.status||n.status>=200&&n.status<300){let i;try{i=JSON.parse(n.responseText)}catch{this.setState("error");return}this.applyTemplate_(i),this.templateCache_[t]=i,this.setState("ready")}else this.setState("error")}handleInitError_(t){this.setState("error")}applyTemplate_(t){const e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)}}const s5=i5;class o5 extends Lh{constructor(t){super({attributions:t.attributions,wrapX:t.wrapX}),this.resolution=void 0,this.distance=t.distance!==void 0?t.distance:20,this.minDistance=t.minDistance||0,this.interpolationRatio=0,this.features=[],this.geometryFunction=t.geometryFunction||function(e){const n=e.getGeometry();return Rt(!n||n.getType()==="Point","The default `geometryFunction` can only handle `Point` or null geometries"),n},this.createCustomCluster_=t.createCluster,this.source=null,this.boundRefresh_=this.refresh.bind(this),this.updateDistance(this.distance,this.minDistance),this.setSource(t.source||null)}clear(t){this.features.length=0,super.clear(t)}getDistance(){return this.distance}getSource(){return this.source}loadFeatures(t,e,n){this.source.loadFeatures(t,e,n),e!==this.resolution&&(this.resolution=e,this.refresh())}setDistance(t){this.updateDistance(t,this.minDistance)}setMinDistance(t){this.updateDistance(this.distance,t)}getMinDistance(){return this.minDistance}setSource(t){this.source&&this.source.removeEventListener(Ct.CHANGE,this.boundRefresh_),this.source=t,t&&t.addEventListener(Ct.CHANGE,this.boundRefresh_),this.refresh()}refresh(){this.clear(),this.cluster(),this.addFeatures(this.features)}updateDistance(t,e){const n=t===0?0:Math.min(e,t)/t,i=t!==this.distance||this.interpolationRatio!==n;this.distance=t,this.minDistance=e,this.interpolationRatio=n,i&&this.refresh()}cluster(){if(this.resolution===void 0||!this.source)return;const t=je(),e=this.distance*this.resolution,n=this.source.getFeatures(),i={};for(let s=0,o=n.length;s=0;--a){const l=this.geometryFunction(t[a]);l?Gm(n,l.getCoordinates()):t.splice(a,1)}Vx(n,1/t.length);const i=Me(e),s=this.interpolationRatio,o=new Te([n[0]*(1-s)+i[0]*s,n[1]*(1-s)+i[1]*s]);return this.createCustomCluster_?this.createCustomCluster_(o,t):new we({geometry:o,features:t})}}const a5=o5,l5="https://tile.googleapis.com/v1/createSession",h5="https://tile.googleapis.com/v1/2dtiles",c5="https://tile.googleapis.com/tile/v1/viewport",u5=22;class d5 extends Pr{constructor(t){const e=!!t.highDpi,n=t.overlay!==!0;super({attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,opaque:n,projection:"EPSG:3857",reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,tilePixelRatio:e?2:1,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.apiKey_=t.key,this.error_=null;const i={mapType:t.mapType||"roadmap",language:t.language||"en-US",region:t.region||"US"};t.imageFormat&&(i.imageFormat=t.imageFormat),t.scale&&(i.scale=t.scale),e&&(i.highDpi=!0),t.layerTypes&&(i.layerTypes=t.layerTypes),t.styles&&(i.styles=t.styles),t.overlay===!0&&(i.overlay=!0),this.sessionTokenRequest_=i,this.sessionTokenValue_,this.sessionRefreshId_,this.previousViewportAttribution_,this.previousViewportExtent_,this.createSession_()}getError(){return this.error_}fetchSessionToken(t,e){return fetch(t,e)}async createSession_(){const t=l5+"?key="+this.apiKey_,e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.sessionTokenRequest_)},n=await this.fetchSessionToken(t,e);if(!n.ok){try{const u=await n.json();this.error_=new Error(u.error.message)}catch{this.error_=new Error("Error fetching session token")}this.setState("error");return}const i=await n.json(),s=this.getTilePixelRatio(1),o=[i.tileWidth/s,i.tileHeight/s];this.tileGrid=Yi({extent:Wn(this.getProjection()),maxZoom:u5,tileSize:o});const a=i.session;this.sessionTokenValue_=a;const l=this.apiKey_;this.tileUrlFunction=function(u,d,g){const f=u[0],p=u[1],_=u[2];return`${h5}/${f}/${p}/${_}?session=${a}&key=${l}`};const h=parseInt(i.expiry,10)*1e3,c=Math.max(h-Date.now()-60*1e3,1);this.sessionRefreshId_=setTimeout(()=>this.createSession_(),c),this.setAttributions(this.fetchAttributions_.bind(this)),this.setState("ready")}async fetchAttributions_(t){if(t.viewHints[Jt.ANIMATING]||t.viewHints[Jt.INTERACTING]||t.animate)return this.previousViewportAttribution_;const[e,n]=of(_a(t.extent),t.viewState.projection),[i,s]=of(ya(t.extent),t.viewState.projection),o=`zoom=${this.getTileGrid().getZForResolution(t.viewState.resolution,this.zDirection)}&north=${s}&south=${n}&east=${i}&west=${e}`;if(this.previousViewportExtent_==o)return this.previousViewportAttribution_;this.previousViewportExtent_=o;const a=this.sessionTokenValue_,l=this.apiKey_,h=`${c5}?session=${a}&key=${l}&${o}`;return this.previousViewportAttribution_=await fetch(h).then(c=>c.json()).then(c=>c.copyright),this.previousViewportAttribution_}disposeInternal(){clearTimeout(this.sessionRefreshId_),super.disposeInternal()}}const g5=d5;let O1=class extends La{constructor(r,t,e,n,i,s,o){super(t,e,n,i,s,o),this.zoomifyImage_=null,this.tileSize_=r}getImage(){if(this.zoomifyImage_)return this.zoomifyImage_;const r=super.getImage();if(this.state==B.LOADED){const t=this.tileSize_;if(r.width==t[0]&&r.height==t[1])return this.zoomifyImage_=r,r;const e=Ht(t[0],t[1]);return e.drawImage(r,0,0),this.zoomifyImage_=e.canvas,e.canvas}return r}};class f5 extends Pr{constructor(t){const e=t.size,n=t.tierSizeCalculation!==void 0?t.tierSizeCalculation:"default",i=t.tilePixelRatio||1,s=e[0],o=e[1],a=[],l=t.tileSize||js;let h=l*i;switch(n){case"default":for(;s>h||o>h;)a.push([Math.ceil(s/h),Math.ceil(o/h)]),h+=h;break;case"truncated":let T=s,M=o;for(;T>h||M>h;)a.push([Math.ceil(T/h),Math.ceil(M/h)]),T>>=1,M>>=1;break;default:throw new Error("Unknown `tierSizeCalculation` configured")}a.push([1,1]),a.reverse();const c=[i],u=[0];for(let T=1,M=a.length;T{p=l,this.changed()}),E.src=S}}const p5=f5;function yo(r){return r.toLocaleString("en",{maximumFractionDigits:10})}class m5 extends Pr{constructor(t){const e=t||{};let n=e.url||"";n=n+(n.lastIndexOf("/")===n.length-1||n===""?"":"/");const i=e.version||fe.VERSION2,s=e.sizes||[],o=e.size;Rt(o!=null&&Array.isArray(o)&&o.length==2&&!isNaN(o[0])&&o[0]>0&&!isNaN(o[1])&&o[1]>0,"Missing or invalid `size`");const a=o[0],l=o[1],h=e.tileSize,c=e.tilePixelRatio||1,u=e.format||"jpg",d=e.quality||(e.version==fe.VERSION1?"native":"default");let g=e.resolutions||[];const f=e.supports||[],p=e.extent||[0,-l,a,0],_=s!=null&&Array.isArray(s)&&s.length>0,y=h!==void 0&&(typeof h=="number"&&Number.isInteger(h)&&h>0||Array.isArray(h)&&h.length>0),v=f!=null&&Array.isArray(f)&&(f.includes("regionByPx")||f.includes("regionByPct"))&&(f.includes("sizeByWh")||f.includes("sizeByH")||f.includes("sizeByW")||f.includes("sizeByPct"));let w,S,E;if(g.sort(function(P,G){return G-P}),y||v)if(h!=null&&(typeof h=="number"&&Number.isInteger(h)&&h>0?(w=h,S=h):Array.isArray(h)&&h.length>0&&((h.length==1||h[1]==null&&Number.isInteger(h[0]))&&(w=h[0],S=h[0]),h.length==2&&(Number.isInteger(h[0])&&Number.isInteger(h[1])?(w=h[0],S=h[1]):h[0]==null&&Number.isInteger(h[1])&&(w=h[1],S=h[1])))),(w===void 0||S===void 0)&&(w=js,S=js),g.length==0){E=Math.max(Math.ceil(Math.log(a/w)/Math.LN2),Math.ceil(Math.log(l/S)/Math.LN2));for(let P=E;P>=0;P--)g.push(Math.pow(2,P))}else{const P=Math.max(...g);E=Math.round(Math.log(P)/Math.LN2)}else if(w=a,S=l,g=[],_){s.sort(function(G,D){return G[0]-D[0]}),E=-1;const P=[];for(let G=0;G0&&g[g.length-1]==D){P.push(G);continue}g.push(D),E++}if(P.length>0)for(let G=0;GE)return;const b=P[1],R=P[2],L=g[x];if(!(b===void 0||R===void 0||L===void 0||b<0||Math.ceil(a/L/w)<=b||R<0||Math.ceil(l/L/S)<=R)){if(v||y){const N=b*w*L,k=R*S*L;let j=w*L,Z=S*L,Y=w,ot=S;if(N+j>a&&(j=a-N),k+Z>l&&(Z=l-k),N+w*L>a&&(Y=Math.floor((a-N+L-1)/L)),k+S*L>l&&(ot=Math.floor((l-k+L-1)/L)),N==0&&j==a&&k==0&&Z==l)z="full";else if(!v||f.includes("regionByPx"))z=N+","+k+","+j+","+Z;else if(f.includes("regionByPct")){const U=yo(N/a*100),nt=yo(k/l*100),ut=yo(j/a*100),_t=yo(Z/l*100);z="pct:"+U+","+nt+","+ut+","+_t}i==fe.VERSION3&&(!v||f.includes("sizeByWh"))?m=Y+","+ot:!v||f.includes("sizeByW")?m=Y+",":f.includes("sizeByH")?m=","+ot:f.includes("sizeByWh")?m=Y+","+ot:f.includes("sizeByPct")&&(m="pct:"+yo(100/L))}else if(z="full",_){const N=s[x][0],k=s[x][1];i==fe.VERSION3?N==a&&k==l?m="max":m=N+","+k:N==a?m="full":m=N+","}else m=i==fe.VERSION3?"max":"full";return n+z+"/"+m+"/0/"+d+"."+u}},C=O1.bind(null,ee(h||256).map(function(P){return P*c}));super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:e.state,tileClass:C,tileGrid:T,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:M,transition:e.transition}),this.zDirection=e.zDirection}}const _5=m5;function F1(r,t,e,n,i,s){const o=i.getCode().split(/:(?=\d+$)/).pop(),a=e/n,l=[vl(mt(t)/a,nn),vl(qt(t)/a,nn)];s.SIZE=l[0]+","+l[1],s.BBOX=t.join(","),s.BBOXSR=o,s.IMAGESR=o,s.DPI=Math.round(s.DPI?s.DPI*n:90*n);const h=r.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return Gn(h,s)}function N1(r){const t=r.load?r.load:mi,e=K(r.projection||"EPSG:3857");return function(n,i,s){s=r.hidpi?s:1;const o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};Object.assign(o,r.params),n=Xh(n,i,s,r.ratio);const a=F1(r.url,n,i,s,e,o),l=new Image;return r.crossOrigin!==null&&(l.crossOrigin=r.crossOrigin),t(l,a).then(h=>{const c=mt(n)/h.width*s;return{image:h,extent:n,resolution:c,pixelRatio:s}})}}class y5 extends xi{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:Bh,this.params_=Object.assign({},t.params),this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5,this.loaderProjection_=null}getParams(){return this.params_}getImageInternal(t,e,n,i){return this.url_===void 0?null:((!this.loader||this.loaderProjection_!==i)&&(this.loaderProjection_=i,this.loader=N1({crossOrigin:this.crossOrigin_,params:this.params_,projection:i,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(s,o)=>(this.image.setImage(s),this.imageLoadFunction_(this.image,o),mi(s))})),super.getImageInternal(t,e,n,i))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}}const x5=y5;class v5 extends xi{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions,state:t.state}),this.canvasFunction_=t.canvasFunction,this.canvas_=null,this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5}getImageInternal(t,e,n,i){e=this.findNearestResolution(e);let s=this.canvas_;if(s&&this.renderedRevision_==this.getRevision()&&s.getResolution()==e&&s.getPixelRatio()==n&&Ze(s.getExtent(),t))return s;t=t.slice(),Nm(t,this.ratio_);const o=mt(t)/e,a=qt(t)/e,l=[o*n,a*n],h=this.canvasFunction_.call(this,t,e,n,l,i);return h&&(s=new Kd(t,e,n,h)),this.canvas_=s,this.renderedRevision_=this.getRevision(),s}}const w5=v5;function S5(r,t,e,n){const i=mt(r),s=qt(r),o=t[0],a=t[1],l=.0254/n;return a*i>o*s?i*e/(o*l):s*e/(a*l)}function E5(r,t,e,n,i,s,o){const a=S5(e,n,s,o),l=Me(e),h={OPERATION:i?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:o,SETDISPLAYWIDTH:Math.round(n[0]),SETDISPLAYHEIGHT:Math.round(n[1]),SETVIEWSCALE:a,SETVIEWCENTERX:l[0],SETVIEWCENTERY:l[1]};return Object.assign(h,t),Gn(r,h)}function D1(r){const t=r.load||mi;return function(e,n,i){const s=new Image;r.crossOrigin!==null&&(s.crossOrigin=r.crossOrigin),e=Xh(e,n,i,r.ratio);const o=mt(e)/n,a=qt(e)/n,l=[o*i,a*i],h=E5(r.url,r.params,e,l,r.useOverlay,r.metersPerUnit||1,r.displayDpi||96);return t(s,h).then(c=>({image:c,extent:e,pixelRatio:i}))}}class b5 extends xi{constructor(t){super({interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.displayDpi_=t.displayDpi!==void 0?t.displayDpi:96,this.params_=Object.assign({},t.params),this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:Bh,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.metersPerUnit_=t.metersPerUnit!==void 0?t.metersPerUnit:1,this.ratio_=t.ratio!==void 0?t.ratio:1,this.useOverlay_=t.useOverlay!==void 0?t.useOverlay:!1,this.renderedRevision_=0,this.loaderProjection_=null}getParams(){return this.params_}getImageInternal(t,e,n,i){return this.url_===void 0?null:((!this.loader||this.loaderProjection_!==i)&&(this.loaderProjection_=i,this.loader=D1({crossOrigin:this.crossOrigin_,params:this.params_,hidpi:this.hidpi_,metersPerUnit:this.metersPerUnit_,url:this.url_,useOverlay:this.useOverlay_,ratio:this.ratio_,load:(s,o)=>(this.image.setImage(s),this.imageLoadFunction_(this.image,o),mi(s))})),super.getImageInternal(t,e,n,i))}getImageLoadFunction(){return this.imageLoadFunction_}updateParams(t){Object.assign(this.params_,t),this.changed()}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}changed(){this.image=null,super.changed()}}const T5=b5;class M5 extends xi{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:Bh,this.params_=Object.assign({},t.params),this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5,this.loaderProjection_=null}getFeatureInfoUrl(t,e,n,i){const s=K(n),o=this.getProjection();o&&o!==s&&(e=oa(o,s,t,e),t=ch(t,s,o));const a={url:this.url_,params:{...this.params_,...i},projection:o||s};return jL(a,t,e)}getLegendUrl(t,e){return zL({url:this.url_,params:{...this.params_,...e}},t)}getParams(){return this.params_}getImageInternal(t,e,n,i){return this.url_===void 0?null:((!this.loader||this.loaderProjection_!==i)&&(this.loaderProjection_=i,this.loader=By({crossOrigin:this.crossOrigin_,params:this.params_,projection:i,serverType:this.serverType_,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(s,o)=>(this.image.setImage(s),this.imageLoadFunction_(this.image,o),mi(s))})),super.getImageInternal(t,e,n,i))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}}const R5=M5,C5={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},I5={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function P5(r,t){let e,n;for(let i=0;iE.replace(/E|X|Lon/i,"e").replace(/N|Y|Lat/i,"n")).join(""):i.getAxisOrientation().substr(0,2))!=="en",a=t.tileMatrices,l={};for(let E=0;Em.maxTileCol||D.tileRowm.maxTileRow)return}Object.assign(D,v);const z=e.replace(/\{(\w+?)\}/g,function(m,x){return D[x]});return Gy(w,z)}return{grid:y,urlTemplate:e,urlFunction:S}}function L5(r,t){const e=t.tileMatrixSetLimits;let n;if(t.dataType==="map")n=P5(t.links,r.mediaType);else if(t.dataType==="vector")n=A5(t.links,r.mediaType,r.supportedMediaTypes);else throw new Error('Expected tileset data type to be "map" or "vector"');if(t.tileMatrixSet)return wm(r,t.tileMatrixSet,n,e);const i=t.links.find(a=>a.rel==="http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme");if(!i)throw new Error("Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet");const s=i.href,o=Gy(r.url,s);return ky(o).then(function(a){return wm(r,a,n,e)})}function k1(r){return ky(r.url).then(function(t){return L5(r,t)})}class O5 extends Pr{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition});const e={url:t.url,projection:this.getProjection(),mediaType:t.mediaType,context:t.context||null};k1(e).then(this.handleTileSetInfo_.bind(this)).catch(this.handleError_.bind(this))}handleTileSetInfo_(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState("ready")}handleError_(t){Sl(t),this.setState("error")}}const F5=O5;class N5 extends Wh{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,format:t.format,overlaps:t.overlaps,projection:t.projection,tileClass:t.tileClass,transition:t.transition,wrapX:t.wrapX,zDirection:t.zDirection,state:"loading"});const e={url:t.url,projection:this.getProjection(),mediaType:t.mediaType,supportedMediaTypes:t.format.supportedMediaTypes,context:t.context||null};k1(e).then(this.handleTileSetInfo_.bind(this)).catch(this.handleError_.bind(this))}handleTileSetInfo_(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState("ready")}handleError_(t){Sl(t),this.setState("error")}}const D5=N5,G1='© OpenStreetMap contributors.';class k5 extends zi{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[G1];const n=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",i=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:n,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:i,wrapX:t.wrapX,zDirection:t.zDirection})}}const G5=k5,Sm=1/0;class j5{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,qs(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,n=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const i=this.keyFunction_(n);return delete this.queuedElements_[i],n}enqueue(t){Rt(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=Sm?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,n=this.priorities_,i=e.length,s=e[t],o=n[t],a=t;for(;t>1;){const l=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),c=ht;){const a=this.getParentIndex_(e);if(i[a]>o)n[e]=n[a],i[e]=i[a],e=a;else break}n[e]=s,i[e]=o}reprioritize(){const t=this.priorityFunction_,e=this.elements_,n=this.priorities_;let i=0;const s=e.length;let o,a,l;for(a=0;a0;)s=this.dequeue()[0],o=s.getKey(),i=s.getState(),i===B.IDLE&&!(o in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,s.load())}}let j1=!0;try{new ImageData(10,10)}catch{j1=!1}let kc;function U5(r,t,e){if(j1)return new ImageData(r,t,e);kc||(kc=document.createElement("canvas").getContext("2d"));const n=kc.createImageData(t,e);return n.data.set(r),n}function z1(r){let t=!0;try{new ImageData(10,10)}catch{t=!1}function e(n,i,s){return t?new ImageData(n,i,s):{data:n,width:i,height:s}}return function(n){const i=n.buffers,s=n.meta,o=n.imageOps,a=n.width,l=n.height,h=i.length,c=i[0].byteLength;if(o){const f=new Array(h);for(let p=0;p"u"?"data:text/javascript;base64,"+Buffer.from(e.join(` -`),"binary").toString("base64"):URL.createObjectURL(new Blob(e,{type:"text/javascript"})));return n.addEventListener("message",t),n}function X5(r,t){const e=z1(r.operation);let n=!1;return{postMessage:function(i){setTimeout(function(){n||t({data:{buffer:e(i),meta:i.meta}})},0)},terminate:function(){n=!0}}}class W5 extends Pu{constructor(t){super(),this._imageOps=!!t.imageOps;let e;t.threads===0?e=0:this._imageOps?e=1:e=t.threads||1;const n=new Array(e);if(e)for(let i=0;ithis._maxQueueLength;)this._queue.shift().callback(null,null)}_dispatch(){if(this._running||this._queue.length===0)return;const t=this._queue.shift();this._job=t;const e=t.inputs[0].width,n=t.inputs[0].height,i=t.inputs.map(function(l){return l.data.buffer}),s=this._workers.length;if(this._running=s,s===1){this._workers[0].postMessage({buffers:i,meta:t.meta,imageOps:this._imageOps,width:e,height:n},i);return}const o=t.inputs[0].data.length,a=4*Math.ceil(o/4/s);for(let l=0;lStadia Maps',K5='© OpenMapTiles',J5='© Stamen Design',Q5={stamen_terrain:{extension:"png",opaque:!0},stamen_terrain_background:{extension:"png",opaque:!0},stamen_terrain_labels:{extension:"png",opaque:!1},stamen_terrain_lines:{extension:"png",opaque:!1},stamen_toner_background:{extension:"png",opaque:!0},stamen_toner:{extension:"png",opaque:!0},stamen_toner_labels:{extension:"png",opaque:!1},stamen_toner_lines:{extension:"png",opaque:!1},stamen_toner_lite:{extension:"png",opaque:!0},stamen_watercolor:{extension:"jpg",opaque:!0},alidade_smooth:{extension:"png",opaque:!0},alidade_smooth_dark:{extension:"png",opaque:!0},alidade_satellite:{extension:"png",opaque:!0},outdoors:{extension:"png",opaque:!0},osm_bright:{extension:"png",opaque:!0}},tk={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class ek extends zi{constructor(t){const e=t.layer.indexOf("-"),n=e==-1?t.layer:t.layer.slice(0,e),i=tk[n]||{minZoom:0,maxZoom:20,retina:!0},s=Q5[t.layer],o=t.apiKey?"?api_key="+t.apiKey:"",a=i.retina&&t.retina?"@2x":"",l=t.url!==void 0?t.url:"https://tiles.stadiamaps.com/tiles/"+t.layer+"/{z}/{x}/{y}"+a+"."+s.extension+o,h=[H5,K5,G1];t.layer.startsWith("stamen_")&&h.splice(1,0,J5),super({attributions:h,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:i.maxZoom,minZoom:t.minZoom!==void 0?t.minZoom:i.minZoom,opaque:s.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:l,tilePixelRatio:a?2:1,wrapX:t.wrapX,zDirection:t.zDirection})}}const rk=ek;class nk extends Pr{constructor(t){t=t||{},super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.params_=Object.assign({},t.params),this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=je(),this.setKey(this.getKeyForParams_())}getKeyForParams_(){let t=0;const e=[];for(const n in this.params_)e[t++]=n+"-"+this.params_[n];return e.join("/")}getParams(){return this.params_}getRequestUrl_(t,e,n,i,s,o){const a=this.urls;if(!a)return;let l;if(a.length==1)l=a[0];else{const h=an(qd(t),a.length);l=a[h]}return F1(l,n,(this.tileGrid||this.getTileGridForProjection(s)).getResolution(t[0]),i,s,o)}getTilePixelRatio(t){return this.hidpi_?t:1}updateParams(t){Object.assign(this.params_,t),this.setKey(this.getKeyForParams_())}tileUrlFunction(t,e,n){let i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(n)),i.getResolutions().length<=t[0])return;e!=1&&!this.hidpi_&&(e=1);const s=i.getTileCoordExtent(t,this.tmpExtent_);let o=ee(i.getTileSize(t[0]),this.tmpSize);e!=1&&(o=p0(o,e,this.tmpSize));const a={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return Object.assign(a,this.params_),this.getRequestUrl_(t,o,s,e,n,a)}}const ik=nk;class sk extends zi{constructor(t){t=t||{},super({opaque:!1,projection:t.projection,tileGrid:t.tileGrid,wrapX:t.wrapX!==void 0?t.wrapX:!0,zDirection:t.zDirection,url:t.template||"z:{z} x:{x} y:{y}",tileLoadFunction:(e,n)=>{const i=e.getTileCoord()[0],s=ee(this.tileGrid.getTileSize(i)),o=Ht(s[0],s[1]);o.strokeStyle="grey",o.strokeRect(.5,.5,s[0]+.5,s[1]+.5),o.fillStyle="grey",o.strokeStyle="white",o.textAlign="center",o.textBaseline="middle",o.font="24px sans-serif",o.lineWidth=4,o.strokeText(n,s[0]/2,s[1]/2,s[0]),o.fillText(n,s[0]/2,s[1]/2,s[0]),e.setImage(o.canvas)}})}}const ok=sk;class ak extends ro{constructor(t,e,n,i,s,o){super(t,e),this.src_=n,this.extent_=i,this.preemptive_=s,this.grid_=null,this.keys_=null,this.data_=null,this.jsonp_=o}getImage(){return null}getData(t){if(!this.grid_||!this.keys_)return null;const e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),n=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),i=this.grid_[Math.floor((1-n)*this.grid_.length)];if(typeof i!="string")return null;let s=i.charCodeAt(Math.floor(e*i.length));s>=93&&s--,s>=35&&s--,s-=32;let o=null;if(s in this.keys_){const a=this.keys_[s];this.data_&&a in this.data_?o=this.data_[a]:o=a}return o}forDataAtCoordinate(t,e,n){this.state==B.EMPTY&&n===!0?(this.state=B.IDLE,qo(this,Ct.CHANGE,function(i){e(this.getData(t))},this),this.loadInternal_()):n===!0?setTimeout(()=>{e(this.getData(t))},0):e(this.getData(t))}getKey(){return this.src_}handleError_(){this.state=B.ERROR,this.changed()}handleLoad_(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=B.LOADED,this.changed()}loadInternal_(){if(this.state==B.IDLE)if(this.state=B.LOADING,this.jsonp_)Mg(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{const t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let n;try{n=JSON.parse(e.responseText)}catch{this.handleError_();return}this.handleLoad_(n)}else this.handleError_()}onXHRError_(t){this.handleError_()}load(){this.preemptive_?this.loadInternal_():this.setState(B.EMPTY)}}class lk extends Fa{constructor(t){if(super({projection:K("EPSG:3857"),state:"loading",wrapX:t.wrapX!==void 0?t.wrapX:!0,zDirection:t.zDirection}),this.preemptive_=t.preemptive!==void 0?t.preemptive:!0,this.tileUrlFunction_=LL,this.template_=void 0,this.jsonp_=t.jsonp||!1,t.url)if(this.jsonp_)Mg(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else if(t.tileJSON)this.handleTileJSONResponse(t.tileJSON);else throw new Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let n;try{n=JSON.parse(e.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(n)}else this.handleTileJSONError()}onXHRError_(t){this.handleTileJSONError()}getTemplate(){return this.template_}forDataAtCoordinateAndResolution(t,e,n,i){if(this.tileGrid){const s=this.tileGrid.getZForResolution(e,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,s);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,n,i)}else i===!0?setTimeout(function(){n(null)},0):n(null)}handleTileJSONError(){this.setState("error")}handleTileJSONResponse(t){const e=K("EPSG:4326"),n=this.getProjection();let i;if(t.bounds!==void 0){const c=qi(e,n);i=Os(t.bounds,c)}const s=Wn(n),o=t.minzoom||0,a=t.maxzoom||22,l=Yi({extent:s,maxZoom:a,minZoom:o});this.tileGrid=l,this.template_=t.template;const h=t.grids;if(!h){this.setState("error");return}if(this.tileUrlFunction_=Sg(h,l),t.attribution){const c=i!==void 0?i:s;this.setAttributions(function(u){return Yt(c,u.extent)?[t.attribution]:null})}this.setState("ready")}getTile(t,e,n,i,s){const o=un(t,e,n);if(this.tileCache.containsKey(o))return this.tileCache.get(o);const a=[t,e,n],l=this.getTileCoordForTileUrlFunction(a,s),h=this.tileUrlFunction_(l,i,s),c=new ak(a,h!==void 0?B.IDLE:B.EMPTY,h!==void 0?h:"",this.tileGrid.getTileCoordExtent(a),this.preemptive_,this.jsonp_);return this.tileCache.set(o,c),c}useTile(t,e,n){const i=un(t,e,n);this.tileCache.containsKey(i)&&this.tileCache.get(i)}}const hk=lk;function ck(r,t){const e=new Zd(32),n=r.getExtent();return function(i,s){e.expireCache(),n&&(i=xe(n,i));const o=r.getZForResolution(s),a=[];return r.forEachTileCoord(i,o,l=>{const h=l.toString();if(!e.containsKey(h)){const c=t(l);e.set(h,c)}a.push(e.get(h))}),a}}const uk=Object.freeze(Object.defineProperty({__proto__:null,BingMaps:n5,CartoDB:s5,Cluster:a5,DataTile:ig,GeoTIFF:wg,Google:g5,IIIF:_5,Image:xi,ImageArcGISRest:x5,ImageCanvas:w5,ImageMapGuide:T5,ImageStatic:Dy,ImageWMS:R5,OGCMapTile:F5,OGCVectorTile:D5,OSM:G5,Raster:Y5,Source:eo,StadiaMaps:rk,Tile:Fa,TileArcGISRest:ik,TileDebug:ok,TileImage:Pr,TileJSON:jy,TileWMS:Xy,UTFGrid:hk,UrlTile:Tg,Vector:Lh,VectorTile:Wh,WMTS:Wy,XYZ:zi,Zoomify:p5,createArcGISRestLoader:N1,createMapGuideLoader:D1,createStaticLoader:Ny,createWMSLoader:By,sourcesFromTileGrid:ck},Symbol.toStringTag,{value:"Module"}));class dk extends Pr{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,tilePixelRatio:t.tilePixelRatio,transition:t.transition,interpolate:t.interpolate!==void 0?t.interpolate:!0,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection,wrapX:t.wrapX}),this.version_=t.version!==void 0?t?.version:"1.0.0",this.dimensions_=t.dimensions!==void 0?t.dimensions:{},this.layer_=t.layer,fetch(t.url).then(e=>e.text()).then(e=>new window.DOMParser().parseFromString(e,"application/xml")).then(e=>{this.handleCapabilitiesResponse(e,t)})}handleCapabilitiesResponse(t,e){const n=new Id().read(t),i=Zy(n,e);this.crossOrigin=i.crossOrigin,this.projection=i.projection,this.tileGrid=i.tileGrid,this.requestEncoding_=i.requestEncoding,this.matrixSet_=i.matrixSet,this.style_=i.style,this.format_=i.format,this.dimensions_=i.dimensions,this.setUrls(i.urls),this.urls&&this.urls.length>0&&(this.tileUrlFunction=Xs(this.urls.map(this.createFromWMTSTemplate.bind(this)))),this.setState("ready")}createFromWMTSTemplate(t){const e=this.requestEncoding_,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e=="KVP"&&Object.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e=="KVP"?Gn(t,n):t.replace(/\{(\w+?)\}/g,function(o,a){return a.toLowerCase()in n?n[a.toLowerCase()]:o});const i=this.tileGrid,s=this.dimensions_;return function(o){if(!o)return;const a={TileMatrix:i.getMatrixId(o[0]),TileCol:o[1],TileRow:o[2]};Object.assign(a,s);let l=t;return e=="KVP"?l=Gn(l,a):l=l.replace(/\{(\w+?)\}/g,function(h,c){return a[c]}),l}}}window.eoxMapAdvancedOlSources={...uk,WMTSCapabilities:dk};const gk={__name:"EodashMap",setup(r){const t=q1(Y1),e={class:"fill-height fill-width overflow-none",center:[15,48],layers:[{type:"Tile",source:{type:"OSM"}}]};wi&&wi.value&&wi.value.length===3&&(e.center=[wi.value?.[0],wi.value[1]],e.zoom=wi.value[2]);const n=()=>jn(()=>import("./eox-map-D_hDglwG.js"),[]),i=a=>{const l=a.map,[h,c]=l?.getView().getCenter()??[0,0],u=l?.getView().getZoom();!Number.isNaN(h)&&!Number.isNaN(c)&&!Number.isNaN(u)&&(wi.value=[h,c,u])},s=(a,l)=>{a?.map?.on("moveend",i);const{selectedStac:h}=H1(l);K1([h,J1],async([c,u])=>{if(c){const d=xl(`./${c.id}/collection.json`,t.stacEndpoint),g=xl(c.links[1].href,d),f=new px(g);u?a.layers=await f.createLayersJson(new Date(u)):a.layers=await f.createLayersJson()}},{immediate:!0})},o=(a,l)=>{a?.map?.un("moveend",i)};return(a,l)=>($1(),V1(ex,{link:n,"tag-name":"eox-map",properties:e,"on-mounted":s,"on-unmounted":o}))}},Pk=Object.freeze(Object.defineProperty({__proto__:null,default:gk},Symbol.toStringTag,{value:"Module"}));export{Ck as D,Pk as E,Ik as G,Hs as V}; diff --git a/pr-preview/pr-17/assets/EodashMap-U2uBfjLN.js b/pr-preview/pr-17/assets/EodashMap-U2uBfjLN.js new file mode 100644 index 0000000..3e5a919 --- /dev/null +++ b/pr-preview/pr-17/assets/EodashMap-U2uBfjLN.js @@ -0,0 +1,655 @@ +const __vite__fileDeps=["assets/raw-CMGvRjfu-Blplg0lv.js","assets/basedecoder-DHcBySSe-gdlnpIMU.js","assets/lzw-LAGDNbSC-uvu3SnH0.js","assets/jpeg-BAgeD1d3-DG6CHa_P.js","assets/deflate-BXt-9JA_-CoW5SAcn.js","assets/pako.esm-CB1uQYY0-DQSVoCko.js","assets/packbits-BlDR4Kj5-myqVpMVP.js","assets/lerc-DzVumYtB-CGEFV0hW.js","assets/index-B5c5Pwhg.js","assets/index-B_kK8D0N.css","assets/eodashSTAC-D8JkBEnM.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/DynamicWebComponent-CFpMl29n.js","assets/webimage-BM_pbLN3-BOB8pnha.js","assets/decoder-CP4lv0Kb-zThNjL1K.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +import{at as Fn,x as M1,b0 as vi,$ as R1,a0 as C1,W as I1,aU as P1,w as A1,a$ as L1}from"./index-B5c5Pwhg.js";import{t as O1,e as F1,E as N1}from"./eodashSTAC-D8JkBEnM.js";import D1 from"./DynamicWebComponent-CFpMl29n.js";var k1=Object.defineProperty,G1=(r,t,e)=>t in r?k1(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,gu=(r,t,e)=>G1(r,typeof t!="symbol"?t+"":t,e);class ln{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const fu={PROPERTYCHANGE:"propertychange"};class pu{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function j1(r,t,e){let n,i;e=e||tn;let s=0,o=r.length,a=!1;for(;s>1),i=+e(r[n],t),i<0?s=n+1:(o=n,a=!i);return a?s:~s}function tn(r,t){return r>t?1:rt?-1:0}function Hl(r,t,e){if(r[0]<=t)return 0;const n=r.length;if(t<=r[n-1])return n-1;if(typeof e=="function"){for(let i=1;i0?i-1:i}return n-1}if(e>0){for(let i=1;i0||o===0)})}function X1(){return!0}function zo(){}function am(r){let t=!1,e,n,i;return function(){const s=Array.prototype.slice.call(arguments);return(!t||this!==i||!Bi(s,n))&&(t=!0,i=this,n=s,e=r.apply(this,arguments)),e}}function lm(r){function t(){let e;try{e=r()}catch(n){return Promise.reject(n)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function qs(r){for(const t in r)delete r[t]}function In(r){let t;for(t in r)return!1;return!t}class ha extends pu{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const n=this.listeners_||(this.listeners_={}),i=n[t]||(n[t]=[]);i.includes(e)||i.push(e)}dispatchEvent(t){const e=typeof t=="string",n=e?t:t.type,i=this.listeners_&&this.listeners_[n];if(!i)return;const s=e?new ln(t):t;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,a[n]=0),++o[n];let l;for(let h=0,c=i.length;h0:!1}removeEventListener(t,e){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const i=n.indexOf(e);i!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[i]=zo,++this.pendingRemovals_[t]):(n.splice(i,1),n.length===0&&delete this.listeners_[t]))}}const Ct={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function ie(r,t,e,n,i){if(n&&n!==r&&(e=e.bind(n)),i){const o=e;e=function(){r.removeEventListener(t,e),o.apply(this,arguments)}}const s={target:r,type:t,listener:e};return r.addEventListener(t,e),s}function Uo(r,t,e,n){return ie(r,t,e,n,!0)}function ye(r){r&&r.target&&(r.target.removeEventListener(r.type,r.listener),qs(r))}class ca extends ha{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(Ct.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length,i=new Array(n);for(let s=0;sMath.round(t*Lg[e])/Lg[e]).join(", ")+")"}const Se={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function As(r){const t=je();for(let e=0,n=r.length;ei&&(l=l|Se.RIGHT),as&&(l=l|Se.ABOVE),l===Se.UNKNOWN&&(l=Se.INTERSECTING),l}function je(){return[1/0,1/0,-1/0,-1/0]}function Gr(r,t,e,n,i){return i?(i[0]=r,i[1]=t,i[2]=e,i[3]=n,i):[r,t,e,n]}function ua(r){return Gr(1/0,1/0,-1/0,-1/0,r)}function xu(r,t){const e=r[0],n=r[1];return Gr(e,n,e,n,t)}function vu(r,t,e,n,i){const s=ua(i);return um(s,r,t,e,n)}function Pn(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function Q1(r,t,e){return Math.abs(r[0]-t[0])r[2]&&(r[2]=t[2]),t[1]r[3]&&(r[3]=t[3]),r}function Ro(r,t){t[0]r[2]&&(r[2]=t[0]),t[1]r[3]&&(r[3]=t[1])}function um(r,t,e,n,i){for(;et[0]?n[0]=r[0]:n[0]=t[0],r[1]>t[1]?n[1]=r[1]:n[1]=t[1],r[2]=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function Dn(r){return r[2]=o&&m<=l),!n&&s&Se.RIGHT&&!(i&Se.RIGHT)&&(_=g-(d-l)*f,n=_>=a&&_<=h),!n&&s&Se.BELOW&&!(i&Se.BELOW)&&(m=d-(g-a)/f,n=m>=o&&m<=l),!n&&s&Se.LEFT&&!(i&Se.LEFT)&&(_=g-(d-o)*f,n=_>=a&&_<=h)}return n}function Ls(r,t,e,n){if(Dn(r))return ua(e);let i=[];if(n>1){const a=r[2]-r[0],l=r[3]-r[1];for(let h=0;h=e[2])){const i=pt(e),s=Math.floor((n[0]-e[0])/i)*i;r[0]-=s,r[2]-=s}return r}function Eu(r,t,e){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(r[0])||!isFinite(r[2]))return[[n[0],r[1],n[2],r[3]]];Su(r,t);const i=pt(n);if(pt(r)>i&&!e)return[[n[0],r[1],n[2],r[3]]];if(r[0]n[2])return[[r[0],r[1],n[2],r[3]],[n[0],r[1],r[2]-i,r[3]]]}return[r]}const ix={9001:"m",9002:"ft",9003:"us-ft",9101:"radians",9102:"degrees"};function Og(r){return ix[r]}const bu={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};let Os=class{constructor(r){this.code_=r.code,this.units_=r.units,this.extent_=r.extent!==void 0?r.extent:null,this.worldExtent_=r.worldExtent!==void 0?r.worldExtent:null,this.axisOrientation_=r.axisOrientation!==void 0?r.axisOrientation:"enu",this.global_=r.global!==void 0?r.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=r.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=r.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||bu[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(r){this.global_=r,this.canWrapX_=!!(r&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(r){this.defaultTileGrid_=r}setExtent(r){this.extent_=r,this.canWrapX_=!!(this.global_&&r)}setWorldExtent(r){this.worldExtent_=r}setGetPointResolution(r){this.getPointResolutionFunc_=r}getPointResolutionFunc(){return this.getPointResolutionFunc_}};const fa=6378137,ps=Math.PI*fa,sx=[-ps,-ps,ps,ps],ox=[-180,-85,180,85],Ga=fa*Math.log(Math.tan(Math.PI/2));class Ki extends Os{constructor(t){super({code:t,units:"m",extent:sx,global:!0,worldExtent:ox,getPointResolution:function(e,n){return e/Math.cosh(n[1]/fa)}})}}const Fg=[new Ki("EPSG:3857"),new Ki("EPSG:102100"),new Ki("EPSG:102113"),new Ki("EPSG:900913"),new Ki("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ki("http://www.opengis.net/gml/srs/epsg.xml#3857")];function ax(r,t,e){const n=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(n));for(let i=0;iGa?s=Ga:s<-Ga&&(s=-Ga),t[i+1]=s}return t}function lx(r,t,e){const n=r.length;e=e>1?e:2,t===void 0&&(e>2?t=r.slice():t=new Array(n));for(let i=0;i1?(e=i,n=s):l>0&&(e+=o*l,n+=a*l)}return Ii(r,t,e,n)}function Ii(r,t,e,n){const i=e-r,s=n-t;return i*i+s*s}function gx(r){const t=r.length;for(let n=0;ns&&(s=l,i=a)}if(s===0)return null;const o=r[i];r[i]=r[n],r[n]=o;for(let a=n+1;a=0;n--){e[n]=r[n][t]/r[n][n];for(let i=n-1;i>=0;i--)r[i][t]-=r[i][n]*e[n]}return e}function Co(r){return r*Math.PI/180}function en(r,t){const e=r%t;return e*t<0?e+t:e}function cr(r,t,e){return r+e*(t-r)}function pa(r,t){const e=Math.pow(10,t);return Math.round(r*e)/e}function dl(r,t){return Math.round(pa(r,t))}function ms(r,t){return Math.floor(pa(r,t))}function Jn(r,t){return Math.ceil(pa(r,t))}function bi(r,t,e){const n=e!==void 0?r.toFixed(e):""+r;let i=n.indexOf(".");return i=i===-1?n.length:i,i>t?n:new Array(1+t-i).join("0")+n}function Tu(r,t){const e=(""+r).split("."),n=(""+t).split(".");for(let i=0;io)return 1;if(o>s)return-1}return 0}function mm(r,t){return r[0]+=+t[0],r[1]+=+t[1],r}function kg(r,t,e){const n=en(t+180,360)-180,i=Math.abs(3600*n),s=e||0;let o=Math.floor(i/3600),a=Math.floor((i-o*3600)/60),l=pa(i-o*3600-a*60,s);l>=60&&(l=0,a+=1),a>=60&&(a=0,o+=1);let h=o+"°";return(a!==0||l!==0)&&(h+=" "+bi(a,2)+"′"),l!==0&&(h+=" "+bi(l,2,s)+"″"),n!==0&&(h+=" "+r.charAt(n<0?1:0)),h}function gl(r,t){let e=!0;for(let n=r.length-1;n>=0;--n)if(r[n]!=t[n]){e=!1;break}return e}function fx(r,t){const e=Math.cos(t),n=Math.sin(t),i=r[0]*e-r[1]*n,s=r[1]*e+r[0]*n;return r[0]=i,r[1]=s,r}function px(r,t){return r[0]*=t,r[1]*=t,r}function _m(r,t){if(t.canWrapX()){const e=pt(t.getExtent()),n=ym(r,t,e);n&&(r[0]-=n*e)}return r}function ym(r,t,e){const n=t.getExtent();let i=0;return t.canWrapX()&&(r[0]n[2])&&(e=e||pt(n),i=Math.floor((r[0]-n[0])/e)),i}const mx=63710088e-1;function Gg(r,t,e){e=e||mx;const n=Co(r[1]),i=Co(t[1]),s=(i-n)/2,o=Co(t[0]-r[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(i);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function _x(...r){console.warn(...r)}function Xo(...r){console.error(...r)}let Pc=!0;function yx(r){Pc=!1}function Mu(r,t){if(t!==void 0){for(let e=0,n=r.length;e=a?t[s+l]:o[l]}return e}}function wx(r,t,e,n){const i=K(r),s=K(t);Fs(i,s,zg(e)),Fs(s,i,zg(n))}function Ug(r,t){const e=Ql(r,t!==void 0?t:"EPSG:3857","EPSG:4326"),n=e[0];return(n<-180||n>180)&&(e[0]=en(n+180,360)-180),e}function Ie(r,t){if(r===t)return!0;const e=r.getUnits()===t.getUnits();return(r.getCode()===t.getCode()||qi(r,t)===Mu)&&e}function qi(r,t){const e=r.getCode(),n=t.getCode();let i=fm(e,n);return i||(i=xm),i}function nn(r,t){const e=K(r),n=K(t);return qi(e,n)}function Ql(r,t,e){return nn(t,e)(r,void 0,r.length)}function Cu(r,t,e,n){const i=nn(t,e);return Ls(r,i,void 0,n)}let Sx=null;function Ex(){return Sx}function Lc(r,t){return r}function Xn(r,t){return Pc&&!gl(r,[0,0])&&r[0]>=-180&&r[0]<=180&&r[1]>=-90&&r[1]<=90&&(Pc=!1,_x("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),r}function th(r,t){return r}function Or(r,t){return r}function Bg(r,t,e){return function(n){let i,s;if(r.canWrapX()){const o=r.getExtent(),a=pt(o);n=n.slice(0),s=ym(n,r,a),s&&(n[0]=n[0]-s*a),n[0]=xt(n[0],o[0],o[2]),n[1]=xt(n[1],o[1],o[3]),i=e(n)}else i=e(n);return s&&t.canWrapX()&&(i[0]+=s*pt(t.getExtent())),i}}function bx(){Ac(Fg),Ac(Dg),vx(Dg,Fg,ax,lx)}bx();function ii(r,t,e,n,i,s){s=s||[];let o=0;for(let a=t;a{if(!n)return this.getSimplifiedGeometry(e);const i=this.clone();return i.applyTransform(n),i.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return at()}closestPointXY(t,e,n,i){return at()}containsXY(t,e){const n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return at()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&ua(e),this.extentRevision_=this.getRevision()}return rx(this.extent_,t)}rotate(t,e){at()}scale(t,e,n){at()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return at()}getType(){return at()}applyTransform(t){at()}intersectsExtent(t){return at()}translate(t,e){at()}transform(t,e){const n=K(t),i=n.getUnits()=="tile-pixels"?function(s,o,a){const l=n.getExtent(),h=n.getWorldExtent(),c=Zt(h)/Zt(l);return Tr(Xg,h[0],h[3],c,-c,0,0,0),ii(s,0,s.length,a,Xg,o),nn(n,e)(s,o,a)}:nn(n,e);return this.applyTransform(i),this}}class Rx extends Iu{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return vu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return at()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().lengtht.clone())}const Ge=fl;function Wg(r,t,e,n,i,s,o){const a=r[t],l=r[t+1],h=r[e]-a,c=r[e+1]-l;let u;if(h===0&&c===0)u=t;else{const d=((i-a)*h+(s-l)*c)/(h*h+c*c);if(d>1)u=e;else if(d>0){for(let g=0;gi&&(i=h),s=a,o=l}return i}function Au(r,t,e,n,i){for(let s=0,o=e.length;s0;){const u=h.pop(),d=h.pop();let g=0;const f=r[d],m=r[d+1],_=r[u],y=r[u+1];for(let x=d+n;xg&&(c=x,g=E)}g>i&&(l[(c-t)/n]=1,d+n0&&m>g)&&(f<0&&_0&&_>f)){h=u,c=d;continue}s[o++]=h,s[o++]=c,a=h,l=c,h=u,c=d}return s[o++]=h,s[o++]=c,o}function Fu(r,t,e,n,i,s,o,a){for(let l=0,h=e.length;l1?o:2,s=s||new Array(o);for(let c=0;c>1;is&&(h-a)*(s-l)-(i-a)*(c-l)>0&&o++:c<=s&&(h-a)*(s-l)-(i-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function Nu(r,t,e,n,i,s){if(e.length===0||!Ti(r,t,e[0],n,i,s))return!1;for(let o=1,a=e.length;o=i[0]&&s[2]<=i[2]||s[1]>=i[1]&&s[3]<=i[3]?!0:Mm(r,t,e,n,function(o,a){return nx(i,o,a)}):!1}function Gx(r,t,e,n,i){for(let s=0,o=e.length;sy&&(h=(c+u)/2,Nu(r,t,e,n,h,f)&&(_=h,y=x)),c=u}return isNaN(_)&&(_=i[s]),o?(o.push(_,f,y),o):[_,f,y]}function Am(r,t,e,n,i){let s=[];for(let o=0,a=e.length;o0}function ku(r,t,e,n,i){i=i!==void 0?i:!1;for(let s=0,o=e.length;s{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const n=this.simplifiedGeometry_.getFlatCoordinates();let i;switch(this.type_){case"LineString":n.length=eh(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),i=[n.length];break;case"MultiLineString":i=[],n.length=Em(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,i);break;case"Polygon":i=[],n.length=Fu(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,i);break}return i&&(this.simplifiedGeometry_=new ke(this.type_,n,i,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}ke.prototype.getFlatCoordinates=ke.prototype.getOrientedFlatCoordinates;class Ux{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=ve,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let n=e.dataProjection?K(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()==="tile-pixels"&&(n=K(n),n.setWorldExtent(e.extent)),e={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},t)}getType(){return at()}readFeature(t,e){return at()}readFeatures(t,e){return at()}readGeometry(t,e){return at()}readProjection(t){return at()}writeFeature(t,e){return at()}writeFeatures(t,e){return at()}writeGeometry(t,e){return at()}}const ya=Ux;function re(r,t,e){const n=e?K(e.featureProjection):null,i=e?K(e.dataProjection):null;let s=r;if(n&&i&&!Ie(n,i)){t&&(s=r.clone());const o=t?n:i,a=t?i:n;o.getUnits()==="tile-pixels"?s.transform(o,a):s.applyTransform(nn(o,a))}if(t&&e&&e.decimals!==void 0){const o=Math.pow(10,e.decimals),a=function(l){for(let h=0,c=l.length;hNm({...r,geometry:o})).flat();const i=n.type==="MultiPolygon"?"Polygon":n.type;if(i==="GeometryCollection"||i==="Circle")throw new Error("Unsupported geometry type: "+i);const s=n.layout.length;return re(new ke(i,i==="Polygon"?Xx(n.flatCoordinates,n.ends,s):n.flatCoordinates,(e=n.ends)==null?void 0:e.flat(),s,r.properties||{},r.id).enableSimplifyTransformed(),!1,t)}function ju(r,t){if(!r)return null;if(Array.isArray(r)){const n=r.map(i=>ju(i,t));return new Ge(n)}const e=Bx[r.type];return re(new e(r.flatCoordinates,r.layout,r.ends),!1,t)}class zu extends ya{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(ja(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(ja(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return at()}readFeaturesFromObject(t,e){return at()}readGeometry(t,e){return this.readGeometryFromObject(ja(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return at()}readProjection(t){return this.readProjectionFromObject(ja(t))}readProjectionFromObject(t){return at()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return at()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return at()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return at()}}function ja(r){return typeof r=="string"?JSON.parse(r)||null:r!==null?r:null}const Wx={Point:$x,LineString:Vx,Polygon:Qx,MultiPoint:Kx,MultiLineString:Hx,MultiPolygon:Jx},qx={Point:tv,LineString:ev,Polygon:rv,MultiPoint:iv,MultiLineString:nv,MultiPolygon:sv};class Zx extends zu{constructor(t){t=t||{},super(),this.geometryName_=t.geometryName}readFeatureFromObject(t,e,n){const i=t,s=Yg(i.geometry,e),o=new ve;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(s),i.attributes){o.setProperties(i.attributes,!0);const a=i.attributes[n];a!==void 0&&o.setId(a)}return o}readFeaturesFromObject(t,e){if(e=e||{},t.features){const n=t,i=[],s=n.features;for(let o=0,a=s.length;o=0;s--){const h=n[s][0];if(We(new ai(h).getExtent(),new ai(a).getExtent())){n[s].push(a),l=!0;break}}l||n.push([a.reverse()])}return n}function $x(r){let t;return r.m!==void 0&&r.z!==void 0?t=new Ee([r.x,r.y,r.z,r.m],"XYZM"):r.z!==void 0?t=new Ee([r.x,r.y,r.z],"XYZ"):r.m!==void 0?t=new Ee([r.x,r.y,r.m],"XYM"):t=new Ee([r.x,r.y]),t}function Vx(r){const t=Ys(r);return new pe(r.paths[0],t)}function Hx(r){const t=Ys(r);return new sr(r.paths,t)}function Ys(r){let t="XY";return r.hasZ===!0&&r.hasM===!0?t="XYZM":r.hasZ===!0?t="XYZ":r.hasM===!0&&(t="XYM"),t}function Kx(r){const t=Ys(r);return new Br(r.points,t)}function Jx(r){const t=Ys(r);return new Mr(r.rings,t)}function Qx(r){const t=Ys(r);return new ze(r.rings,t)}function tv(r,t){const e=r.getCoordinates();let n;const i=r.getLayout();if(i==="XYZ")n={x:e[0],y:e[1],z:e[2]};else if(i==="XYM")n={x:e[0],y:e[1],m:e[2]};else if(i==="XYZM")n={x:e[0],y:e[1],z:e[2],m:e[3]};else if(i==="XY")n={x:e[0],y:e[1]};else throw new Error("Invalid geometry layout");return n}function xa(r){const t=r.getLayout();return{hasZ:t==="XYZ"||t==="XYZM",hasM:t==="XYM"||t==="XYZM"}}function ev(r,t){const e=xa(r);return{hasZ:e.hasZ,hasM:e.hasM,paths:[r.getCoordinates()]}}function rv(r,t){const e=xa(r);return{hasZ:e.hasZ,hasM:e.hasM,rings:r.getCoordinates(!1)}}function nv(r,t){const e=xa(r);return{hasZ:e.hasZ,hasM:e.hasM,paths:r.getCoordinates()}}function iv(r,t){const e=xa(r);return{hasZ:e.hasZ,hasM:e.hasM,points:r.getCoordinates()}}function sv(r,t){const e=xa(r),n=r.getCoordinates(!1),i=[];for(let s=0;s=0;o--)i.push(n[s][o]);return{hasZ:e.hasZ,hasM:e.hasM,rings:i}}function $g(r,t){const e=qx[r.getType()];return e(re(r,!0,t),t)}const ov=Zx;class av extends zu{constructor(t){t=t||{},super(),this.dataProjection=K(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=K(t.featureProjection)),t.featureClass&&(this.featureClass=t.featureClass),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let n=null;t.type==="Feature"?n=t:n={type:"Feature",geometry:t,properties:null};const i=Uu(n.geometry);if(this.featureClass===ke)return Nm({geometry:i,id:n.id,properties:n.properties},e);const s=new ve;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&s.setGeometryName(n.geometry_name),s.setGeometry(ju(i,e)),"id"in n&&s.setId(n.id),n.properties&&s.setProperties(n.properties,!0),s}readFeaturesFromObject(t,e){const n=t;let i=null;if(n.type==="FeatureCollection"){const s=t;i=[];const o=s.features;for(let a=0,l=o.length;a0?n[0]:null}readFeatureFromNode(t,e){return null}readFeatures(t,e){if(!t)return[];if(typeof t=="string"){const n=Er(t);return this.readFeaturesFromDocument(n,e)}return Sr(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}readFeaturesFromDocument(t,e){const n=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&It(n,this.readFeaturesFromNode(i,e));return n}readFeaturesFromNode(t,e){return at()}readGeometry(t,e){if(!t)return null;if(typeof t=="string"){const n=Er(t);return this.readGeometryFromDocument(n,e)}return Sr(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}readGeometryFromDocument(t,e){return null}readGeometryFromNode(t,e){return null}readProjection(t){if(!t)return null;if(typeof t=="string"){const e=Er(t);return this.readProjectionFromDocument(e)}return Sr(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}readProjectionFromDocument(t){return this.dataProjection}readProjectionFromNode(t){return this.dataProjection}writeFeature(t,e){const n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)}writeFeatureNode(t,e){return null}writeFeatures(t,e){const n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)}writeFeaturesNode(t,e){return null}writeGeometry(t,e){const n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)}writeGeometryNode(t,e){return null}}const Tn="http://www.opengis.net/gml",Tv=/^\s*$/;class et extends va{constructor(t){super(),t=t||{},this.featureType=t.featureType,this.featureNS=t.featureNS,this.srsName=t.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[this.namespace]={featureMember:rt(this.readFeaturesInternal),featureMembers:ot(this.readFeaturesInternal)},this.supportedMediaTypes=["application/gml+xml"]}readFeaturesInternal(t,e){const n=t.localName;let i=null;if(n=="FeatureCollection")i=q([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if(n=="featureMembers"||n=="featureMember"||n=="member"){const s=e[0];let o=s.featureType,a=s.featureNS;const l="p",h="p0";if(!o&&t.childNodes){o=[],a={};for(let d=0,g=t.childNodes.length;d0&&!(h instanceof Iu)){h={_content_:h};for(let d=0;d1,n=e&&r.imageInfo.profile[1].supports?r.imageInfo.profile[1].supports:[],i=e&&r.imageInfo.profile[1].formats?r.imageInfo.profile[1].formats:[],s=e&&r.imageInfo.profile[1].qualities?r.imageInfo.profile[1].qualities:[];return{url:r.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:r.imageInfo.sizes===void 0?void 0:r.imageInfo.sizes.map(function(o){return[o.width,o.height]}),tileSize:r.imageInfo.tiles===void 0?void 0:[r.imageInfo.tiles.map(function(o){return o.width})[0],r.imageInfo.tiles.map(function(o){return o.height===void 0?o.width:o.height})[0]],resolutions:r.imageInfo.tiles===void 0?void 0:r.imageInfo.tiles.map(function(o){return o.scaleFactors})[0],supports:[...t.supports,...n],formats:[...t.formats,...i],qualities:[...t.qualities,...s]}}function Pw(r){const t=r.getComplianceLevelSupportedFeatures(),e=r.imageInfo.extraFormats===void 0?t.formats:[...t.formats,...r.imageInfo.extraFormats],n=r.imageInfo.preferredFormats!==void 0&&Array.isArray(r.imageInfo.preferredFormats)&&r.imageInfo.preferredFormats.length>0?r.imageInfo.preferredFormats.filter(function(i){return["jpg","png","gif"].includes(i)}).reduce(function(i,s){return i===void 0&&e.includes(s)?s:i},void 0):void 0;return{url:r.imageInfo.id,sizes:r.imageInfo.sizes===void 0?void 0:r.imageInfo.sizes.map(function(i){return[i.width,i.height]}),tileSize:r.imageInfo.tiles===void 0?void 0:[r.imageInfo.tiles.map(function(i){return i.width})[0],r.imageInfo.tiles.map(function(i){return i.height})[0]],resolutions:r.imageInfo.tiles===void 0?void 0:r.imageInfo.tiles.map(function(i){return i.scaleFactors})[0],supports:r.imageInfo.extraFeatures===void 0?t.supports:[...t.supports,...r.imageInfo.extraFeatures],formats:e,qualities:r.imageInfo.extraQualities===void 0?t.qualities:[...t.qualities,...r.imageInfo.extraQualities],preferredFormat:n}}const oh={};oh[ge.VERSION1]=Cw;oh[ge.VERSION2]=Iw;oh[ge.VERSION3]=Pw;class Aw{constructor(t){this.setImageInfo(t)}setImageInfo(t){typeof t=="string"?this.imageInfo=JSON.parse(t):this.imageInfo=t}getImageApiVersion(){if(this.imageInfo===void 0)return;let t=this.imageInfo["@context"]||"ol-no-context";typeof t=="string"&&(t=[t]);for(let e=0;e0&&typeof this.imageInfo.profile[0]=="string"&&Vg.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0];break}}getComplianceLevelFromProfile(t){const e=this.getComplianceLevelEntryFromProfile(t);if(e===void 0)return;const n=e.match(/level[0-2](?:\.json)?$/g);return Array.isArray(n)?n[0].replace(".json",""):void 0}getComplianceLevelSupportedFeatures(){if(this.imageInfo===void 0)return;const t=this.getImageApiVersion(),e=this.getComplianceLevelFromProfile(t);return e===void 0?Ni.none.none:Ni[t][e]}getTileSourceOptions(t){const e=t||{},n=this.getImageApiVersion();if(n===void 0)return;const i=n===void 0?void 0:oh[n](this);if(i!==void 0)return{url:i.url,version:n,size:[this.imageInfo.width,this.imageInfo.height],sizes:i.sizes,format:e.format!==void 0&&i.formats.includes(e.format)?e.format:i.preferredFormat!==void 0?i.preferredFormat:"jpg",supports:i.supports,quality:e.quality&&i.qualities.includes(e.quality)?e.quality:i.qualities.includes("native")?"native":"default",resolutions:Array.isArray(i.resolutions)?i.resolutions.sort(function(s,o){return o-s}):void 0,tileSize:i.tileSize}}}const Lw=Aw,J={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},qo={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var Pe={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};Pe.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};Pe.max=Pe.whitepoint[2].D65;Pe.rgb=function(r,t){t=t||Pe.whitepoint[2].E;var e=r[0]/t[0],n=r[1]/t[1],i=r[2]/t[2],s,o,a;return s=e*3.240969941904521+n*-1.537383177570093+i*-.498610760293,o=e*-.96924363628087+n*1.87596750150772+i*.041555057407175,a=e*.055630079696993+n*-.20397695888897+i*1.056971514242878,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s=s*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[s*255,o*255,a*255]};qo.xyz=function(r,t){var e=r[0]/255,n=r[1]/255,i=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var s=e*.41239079926595+n*.35758433938387+i*.18048078840183,o=e*.21263900587151+n*.71516867876775+i*.072192315360733,a=e*.019330818715591+n*.11919477979462+i*.95053215224966;return t=t||Pe.whitepoint[2].E,[s*t[0],o*t[1],a*t[2]]};const $u={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(r,t,e){var n,i,s,o,a,l,h,c,u,d,g,f,m;if(s=r[0],o=r[1],a=r[2],s===0)return[0,0,0];var _=.0011070564598794539;return t=t||"D65",e=e||2,u=Pe.whitepoint[e][t][0],d=Pe.whitepoint[e][t][1],g=Pe.whitepoint[e][t][2],f=4*u/(u+15*d+3*g),m=9*d/(u+15*d+3*g),n=o/(13*s)+f||0,i=a/(13*s)+m||0,h=s>8?d*Math.pow((s+16)/116,3):d*s*_,l=h*9*n/(4*i)||0,c=h*(12-3*n-20*i)/(4*i)||0,[l,h,c]}};Pe.luv=function(r,t,e){var n,i,s,o,a,l,h,c,u,d,g,f,m,_=.008856451679035631,y=903.2962962962961;t=t||"D65",e=e||2,u=Pe.whitepoint[e][t][0],d=Pe.whitepoint[e][t][1],g=Pe.whitepoint[e][t][2],f=4*u/(u+15*d+3*g),m=9*d/(u+15*d+3*g),l=r[0],h=r[1],c=r[2],n=4*l/(l+15*h+3*c)||0,i=9*h/(l+15*h+3*c)||0;var x=h/d;return s=x<=_?y*x:116*Math.pow(x,1/3)-16,o=13*s*(n-f),a=13*s*(i-m),[s,o,a]};var Xm={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(r){var t=r[0],e=r[1],n=r[2],i,s,o;return o=n/360*2*Math.PI,i=e*Math.cos(o),s=e*Math.sin(o),[t,i,s]},xyz:function(r){return $u.xyz(Xm.luv(r))}};$u.lchuv=function(r){var t=r[0],e=r[1],n=r[2],i=Math.sqrt(e*e+n*n),s=Math.atan2(n,e),o=s*360/2/Math.PI;return o<0&&(o+=360),[t,i,o]};Pe.lchuv=function(r){return $u.lchuv(Pe.luv(r))};var Ai=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ow={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]};const Hg=Vs(Ow);var Kg={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Fw(r){var t,e,n,i=[],s=1,o;if(typeof r=="number")return{space:"rgb",values:[r>>>16,(r&65280)>>>8,r&255],alpha:1};if(typeof r=="number")return{space:"rgb",values:[r>>>16,(r&65280)>>>8,r&255],alpha:1};if(r=String(r).toLowerCase(),Hg[r])i=Hg[r].slice(),o="rgb";else if(r==="transparent")s=0,o="rgb",i=[0,0,0];else if(r[0]==="#"){var a=r.slice(1),l=a.length,h=l<=4;s=1,h?(i=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],l===4&&(s=parseInt(a[3]+a[3],16)/255)):(i=[parseInt(a[0]+a[1],16),parseInt(a[2]+a[3],16),parseInt(a[4]+a[5],16)],l===8&&(s=parseInt(a[6]+a[7],16)/255)),i[0]||(i[0]=0),i[1]||(i[1]=0),i[2]||(i[2]=0),o="rgb"}else if(n=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(r)){var c=n[1];o=c.replace(/a$/,"");var u=o==="cmyk"?4:o==="gray"?1:3;i=n[2].trim().split(/\s*[,\/]\s*|\s+/),o==="color"&&(o=i.shift()),i=i.map(function(d,g){if(d[d.length-1]==="%")return d=parseFloat(d)/100,g===3?d:o==="rgb"?d*255:o[0]==="h"||o[0]==="l"&&!g?d*100:o==="lab"?d*125:o==="lch"?g<2?d*150:d*360:o[0]==="o"&&!g?d:o==="oklab"?d*.4:o==="oklch"?g<2?d*.4:d*360:d;if(o[g]==="h"||g===2&&o[o.length-1]==="h"){if(Kg[d]!==void 0)return Kg[d];if(d.endsWith("deg"))return parseFloat(d);if(d.endsWith("turn"))return parseFloat(d)*360;if(d.endsWith("grad"))return parseFloat(d)*360/400;if(d.endsWith("rad"))return parseFloat(d)*180/Math.PI}return d==="none"?0:parseFloat(d)}),s=i.length>u?i.pop():1}else/[0-9](?:\s|\/|,)/.test(r)&&(i=r.match(/([0-9]+)/g).map(function(d){return parseFloat(d)}),o=((e=(t=r.match(/([a-z])/ig))==null?void 0:t.join(""))==null?void 0:e.toLowerCase())||"rgb");return{space:o,values:i,alpha:s}}const Zh={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(r){var t=r[0]/360,e=r[1]/100,n=r[2]/100,i,s,o,a,l,h=0;if(e===0)return l=n*255,[l,l,l];for(s=n<.5?n*(1+e):n+e-n*e,i=2*n-s,a=[0,0,0];h<3;)o=t+1/3*-(h-1),o<0?o++:o>1&&o--,l=6*o<1?i+(s-i)*6*o:2*o<1?s:3*o<2?i+(s-i)*(2/3-o)*6:i,a[h++]=l*255;return a}};qo.hsl=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255,i=Math.min(t,e,n),s=Math.max(t,e,n),o=s-i,a,l,h;return s===i?a=0:t===s?a=(e-n)/o:e===s?a=2+(n-t)/o:n===s&&(a=4+(t-e)/o),a=Math.min(a*60,360),a<0&&(a+=360),h=(i+s)/2,s===i?l=0:h<=.5?l=o/(s+i):l=o/(2-s-i),[a,l*100,h*100]};function Nw(r){Array.isArray(r)&&r.raw&&(r=String.raw(...arguments)),r instanceof Number&&(r=+r);var t,e=Fw(r);if(!e.space)return[];const n=e.space[0]==="h"?Zh.min:qo.min,i=e.space[0]==="h"?Zh.max:qo.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],n[0]),i[0]),t[1]=Math.min(Math.max(e.values[1],n[1]),i[1]),t[2]=Math.min(Math.max(e.values[2],n[2]),i[2]),e.space[0]==="h"&&(t=Zh.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}function Dw(r){return typeof r=="string"?r:Hu(r)}const kw=1024,lo={};let Yh=0;function Gw(r){if(r.length===4)return r;const t=r.slice();return t[3]=1,t}function Jg(r){const t=Pe.lchuv(qo.xyz(r));return t[3]=r[3],t}function jw(r){const t=Pe.rgb(Xm.xyz(r));return t[3]=r[3],t}function Vu(r){if(lo.hasOwnProperty(r))return lo[r];if(Yh>=kw){let e=0;for(const n in lo)e++&3||(delete lo[n],--Yh)}const t=Nw(r);if(t.length!==4)throw new Error('Failed to parse "'+r+'" as color');for(const e of t)if(isNaN(e))throw new Error('Failed to parse "'+r+'" as color');return Wm(t),lo[r]=t,++Yh,t}function jr(r){return Array.isArray(r)?r:Vu(r)}function Wm(r){return r[0]=xt(r[0]+.5|0,0,255),r[1]=xt(r[1]+.5|0,0,255),r[2]=xt(r[2]+.5|0,0,255),r[3]=xt(r[3],0,1),r}function Hu(r){let t=r[0];t!=(t|0)&&(t=t+.5|0);let e=r[1];e!=(e|0)&&(e=e+.5|0);let n=r[2];n!=(n|0)&&(n=n+.5|0);const i=r[3]===void 0?1:Math.round(r[3]*1e3)/1e3;return"rgba("+t+","+e+","+n+","+i+")"}function zw(r){try{return Vu(r),!0}catch{return!1}}const hi=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";hi.includes("firefox");const Uw=hi.includes("safari")&&!hi.includes("chrom"),Bw=Uw&&(hi.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(hi));hi.includes("webkit")&&hi.includes("edge");hi.includes("macintosh");const qm=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Ku=typeof Image<"u"&&Image.prototype.decode,Xw=typeof createImageBitmap=="function";(function(){let r=!1;try{const t=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return r})();function Vt(r,t,e,n){let i;return e&&e.length?i=e.shift():qm?i=new OffscreenCanvas(r||300,t||300):i=document.createElement("canvas"),r&&(i.width=r),t&&(i.height=t),i.getContext("2d",n)}let $h;function xl(){return $h||($h=Vt(1,1)),$h}function Di(r){const t=r.canvas;t.width=1,t.height=1,r.clearRect(0,0,1,1)}class ah extends ha{constructor(t,e,n,i){super(),this.extent=t,this.pixelRatio_=n,this.resolution=e,this.state=typeof i=="function"?J.IDLE:i,this.image_=null,this.loader=typeof i=="function"?i:null}changed(){this.dispatchEvent(Ct.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==J.IDLE&&this.loader){this.state=J.LOADING,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;lm(()=>this.loader(this.getExtent(),e,this.getPixelRatio())).then(n=>{"image"in n&&(this.image_=n.image),"extent"in n&&(this.extent=n.extent),"resolution"in n&&(this.resolution=n.resolution),"pixelRatio"in n&&(this.pixelRatio_=n.pixelRatio),(n instanceof HTMLImageElement||n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement)&&(this.image_=n),this.state=J.LOADED}).catch(n=>{this.state=J.ERROR,console.error(n)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function Ww(r,t,e){const n=r;let i=!0,s=!1,o=!1;const a=[Uo(n,Ct.LOAD,function(){o=!0,s||t()})];return n.src&&Ku?(s=!0,n.decode().then(function(){i&&t()}).catch(function(l){i&&(o?t():e())})):a.push(Uo(n,Ct.ERROR,e)),function(){i=!1,a.forEach(ye)}}function qw(r,t){return new Promise((e,n)=>{function i(){o(),e(r)}function s(){o(),n(new Error("Image load error"))}function o(){r.removeEventListener("load",i),r.removeEventListener("error",s)}r.addEventListener("load",i),r.addEventListener("error",s)})}function Zm(r,t){return t&&(r.src=t),r.src&&Ku?new Promise((e,n)=>r.decode().then(()=>e(r)).catch(i=>r.complete&&r.width?e(r):n(i))):qw(r)}function di(r,t){return t&&(r.src=t),r.src&&Ku&&Xw?r.decode().then(()=>createImageBitmap(r)).catch(e=>{if(r.complete&&r.width)return r;throw e}):Zm(r)}class Zw{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const n=this.cache_[e];!(t++&3)&&!n.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,n){const i=Vh(t,e,n);return i in this.cache_?this.cache_[i]:null}getPattern(t,e,n){const i=Vh(t,e,n);return i in this.patternCache_?this.patternCache_[i]:null}set(t,e,n,i,s){const o=Vh(t,e,n),a=o in this.cache_;this.cache_[o]=i,s&&(i.getImageState()===J.IDLE&&i.load(),i.getImageState()===J.LOADING?i.ready().then(()=>{this.patternCache_[o]=xl().createPattern(i.getImage(1),"repeat")}):this.patternCache_[o]=xl().createPattern(i.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Vh(r,t,e){const n=e?jr(e):"null";return t+":"+r+":"+n}const Qn=new Zw;let ho=null;class Yw extends ha{constructor(t,e,n,i,s){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=s,this.imageState_=i===void 0?J.IDLE:i,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===J.LOADED){ho||(ho=Vt(1,1,void 0,{willReadFrequently:!0})),ho.drawImage(this.image_,0,0);try{ho.getImageData(0,0,1,1),this.tainted_=!1}catch{ho=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(Ct.CHANGE)}handleImageError_(){this.imageState_=J.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=J.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=Vt(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===J.IDLE){this.image_||this.initializeImage_(),this.imageState_=J.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Zm(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==J.LOADED)return;const e=this.image_,n=document.createElement("canvas");n.width=Math.ceil(e.width*t),n.height=Math.ceil(e.height*t);const i=n.getContext("2d");i.scale(t,t),i.drawImage(e,0,0),i.globalCompositeOperation="multiply",i.fillStyle=Dw(this.color_),i.fillRect(0,0,n.width/t,n.height/t),i.globalCompositeOperation="destination-in",i.drawImage(e,0,0),this.canvas_[t]=n}ready(){return this.ready_||(this.ready_=new Promise(t=>{this.imageState_===J.LOADED||this.imageState_===J.ERROR?t():this.addEventListener(Ct.CHANGE,function e(){(this.imageState_===J.LOADED||this.imageState_===J.ERROR)&&(this.removeEventListener(Ct.CHANGE,e),t())})})),this.ready_}}function Ju(r,t,e,n,i,s){let o=t===void 0?void 0:Qn.get(t,e,i);return o||(o=new Yw(r,r&&"src"in r?r.src||void 0:t,e,n,i),Qn.set(t,e,i,o,s)),s&&o&&!Qn.getPattern(t,e,i)&&Qn.set(t,e,i,o,s),o}class zr{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,t.color!==void 0&&this.setColor(t.color)}clone(){const t=this.getColor();return new zr({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(t!==null&&typeof t=="object"&&"src"in t){const e=Ju(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),e.getImageState()===J.IDLE&&e.load(),e.getImageState()===J.LOADING&&(this.patternImage_=e)}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function Ym(r,t,e){return e===void 0&&(e=[0,0]),e[0]=r[0]*t+.5|0,e[1]=r[1]*t+.5|0,e}function Jt(r,t){return Array.isArray(r)?r:(t===void 0?t=[r,r]:(t[0]=r,t[1]=r),t)}class lh{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Jt(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new lh({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return at()}getImage(t){return at()}getHitDetectionImage(){return at()}getPixelRatio(t){return 1}getImageState(){return at()}getImageSize(){return at()}getOrigin(){return at()}getSize(){return at()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Jt(t)}listenImageChange(t){at()}load(){at()}unlistenImageChange(t){at()}ready(){return Promise.resolve()}}function Qg(r,t,e,n){return e!==void 0&&n!==void 0?[e/r,n/t]:e!==void 0?e/r:n!==void 0?n/t:1}class Qu extends lh{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,n=t.rotation!==void 0?t.rotation:0,i=t.scale!==void 0?t.scale:1,s=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:n,scale:i,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:s,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const o=t.img!==void 0?t.img:null;let a=t.src;Rt(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||tt(o)),Rt(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),Rt(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(t.src!==void 0?l=J.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?J.LOADED:J.IDLE:l=J.LOADING:l=J.LOADED),this.color_=t.color!==void 0?jr(t.color):null,this.iconImage_=Ju(o,a,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,t.width!==void 0||t.height!==void 0){let h,c;if(t.size)[h,c]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)h=u.width,c=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(Qg(g[0],g[1],t.width,t.height))};this.listenImageChange(d);return}}h!==void 0&&this.setScale(Qg(h,c,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new Qu({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const i=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!i)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=i[0]),this.anchorYUnits_=="fraction"&&(t[1]*=i[1])}if(this.anchorOrigin_!="top-left"){if(!i)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+i[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+i[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==J.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==J.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(Ct.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(Ct.CHANGE,t)}ready(){return this.iconImage_.ready()}}const hh=Qu;class td{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new td({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}const sn=td;function Kr(r){return r?Array.isArray(r)?Hu(r):typeof r=="object"&&"src"in r?$w(r):r:null}function $w(r){if(!r.offset||!r.size)return Qn.getPattern(r.src,"anonymous",r.color);const t=r.src+":"+r.offset,e=Qn.getPattern(t,void 0,r.color);if(e)return e;const n=Qn.get(r.src,"anonymous",null);if(n.getImageState()!==J.LOADED)return null;const i=Vt(r.size[0],r.size[1]);return i.drawImage(n.getImage(1),r.offset[0],r.offset[1],r.size[0],r.size[1],0,0,r.size[0],r.size[1]),Ju(i.canvas,t,void 0,J.LOADED,r.color,!0),Qn.getPattern(t,void 0,r.color)}const Vw=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),tf=["style","variant","weight","size","lineHeight","family"],$m=function(r){const t=r.match(Vw);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let n=0,i=tf.length;nMath.max(i,wl(r,s)),0);return e[t]=n,n}function Jw(r,t){const e=[],n=[],i=[];let s=0,o=0,a=0,l=0;for(let h=0,c=t.length;h<=c;h+=2){const u=t[h];if(u===` +`||h===c){s=Math.max(s,o),i.push(o),o=0,a+=l,l=0;continue}const d=t[h+1]||r.font,g=wl(d,u);e.push(g),o+=g;const f=Kw(d);n.push(f),l=Math.max(l,f)}return{width:s,height:a,widths:e,heights:n,lineWidths:i}}function Qw(r,t,e,n,i,s,o,a,l,h,c){r.save(),e!==1&&(r.globalAlpha===void 0?r.globalAlpha=u=>u.globalAlpha*=e:r.globalAlpha*=e),t&&r.transform.apply(r,t),n.contextInstructions?(r.translate(l,h),r.scale(c[0],c[1]),tS(n,r)):c[0]<0||c[1]<0?(r.translate(l,h),r.scale(c[0],c[1]),r.drawImage(n,i,s,o,a,0,0,o,a)):r.drawImage(n,i,s,o,a,l,h,o*c[0],a*c[1]),r.restore()}function tS(r,t){const e=r.contextInstructions;for(let n=0,i=e.length;nthis.imageState_=J.LOADED),this.render()}clone(){const t=this.getScale(),e=new ch({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const n=this.renderOptions_,i=Vt(n.size*t,n.size*t);this.draw_(n,i,t),e=i.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let i=this.radius_,s=this.radius2_===void 0?i:this.radius2_;if(i1?o.Document=t:t.length==1&&(o.Placemark=t[0]);const a=lS[n.namespaceURI],l=or(o,a);return ft(s,hS,Te,l,[e],a,this),n}}function gS(r,t){const e=[0,0];let n="start";const i=r.getImage();if(i){const o=i.getSize();if(o&&o.length==2){const a=i.getScaleArray(),l=i.getAnchor();e[0]=a[0]*(o[0]-l[0]),e[1]=a[1]*(o[1]/2-l[1]),n="left"}}let s=r.getText();return s?(s=s.clone(),s.setFont(s.getFont()||Ri.getFont()),s.setScale(s.getScale()||Ri.getScale()),s.setFill(s.getFill()||Ri.getFill()),s.setStroke(s.getStroke()||Xc)):s=Ri.clone(),s.setText(t),s.setOffsetX(e[0]),s.setOffsetY(e[1]),s.setTextAlign(n),new Ze({image:i,text:s})}function fS(r,t,e,n,i){return function(s,o){let a=i,l="",h=[];if(a){const u=s.getGeometry();if(u)if(u instanceof Ge)h=u.getGeometriesArrayRecursive().filter(function(d){const g=d.getType();return g==="Point"||g==="MultiPoint"}),a=h.length>0;else{const d=u.getType();a=d==="Point"||d==="MultiPoint"}}a&&(l=s.get("name"),a=a&&!!l,a&&/&[^&]+;/.test(l)&&(Ua||(Ua=document.createElement("textarea")),Ua.innerHTML=l,l=Ua.value));let c=e;if(r?c=r:t&&(c=Qm(t,e,n)),a){const u=gS(c[0],l);if(h.length>0){u.setGeometry(new Ge(h));const d=new Ze({geometry:c[0].getGeometry(),image:null,fill:c[0].getFill(),stroke:c[0].getStroke(),text:null});return[u,d].concat(c.slice(1))}return u}return c}}function Qm(r,t,e){return Array.isArray(r)?r:typeof r=="string"?Qm(e[r],t,e):t}function gh(r){const t=Ye(r,!1),e=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(t);if(e){const n=e[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function t0(r){let t=Ye(r,!1);const e=[];t=t.replace(/\s*,\s*/g,",");const n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;let i;for(;i=n.exec(t);){const s=parseFloat(i[1]),o=parseFloat(i[2]),a=i[3]?parseFloat(i[3]):0;e.push(s,o,a),t=t.substr(i[0].length)}if(t==="")return e}function e0(r){const t=Ye(r,!1).trim();let e=r.baseURI;return(!e||e=="about:blank")&&(e=window.location.href),e?new URL(t,e).href:t}function r0(r){const t=Ye(r,!1).trim().replace(/^(?!.*#)/,"#");let e=r.baseURI;return(!e||e=="about:blank")&&(e=window.location.href),e?new URL(t,e).href:t}function pS(r){const t=r.getAttribute("xunits"),e=r.getAttribute("yunits");let n;return t!=="insetPixels"?e!=="insetPixels"?n="bottom-left":n="top-left":e!=="insetPixels"?n="bottom-right":n="top-right",{x:parseFloat(r.getAttribute("x")),xunits:nf[t],y:parseFloat(r.getAttribute("y")),yunits:nf[e],origin:n}}function n0(r){return Mt(r)}const mS=B(it,{Pair:zS});function i0(r,t){return q(void 0,mS,r,t,this)}const _S=B(it,{Icon:I(AS),color:I(gh),heading:I(Mt),hotSpot:I(pS),scale:I(n0)});function yS(r,t){const e=q({},_S,r,t);if(!e)return;const n=t[t.length-1],i="Icon"in e?e.Icon:{},s=!("Icon"in e)||Object.keys(i).length>0;let o;const a=i.href;a?o=a:s&&(o=Sl);let l,h,c,u="bottom-left";const d=e.hotSpot;d?(l=[d.x,d.y],h=d.xunits,c=d.yunits,u=d.origin):/^https?:\/\/maps\.(?:google|gstatic)\.com\//.test(o)&&(o.includes("pushpin")?(l=zc,h=Io,c=Po):o.includes("arrow-reverse")?(l=[54,42],h=Io,c=Po):o.includes("paddle")&&(l=[32,1],h=Io,c=Po));let g;const f=i.x,m=i.y;f!==void 0&&m!==void 0&&(g=[f,m]);let _;const y=i.w,x=i.h;y!==void 0&&x!==void 0&&(_=[y,x]);let w;const S=e.heading;S!==void 0&&(w=Co(S));const E=e.scale,T=e.color;if(s){o==Sl&&(_=Ao);const R=new hh({anchor:l,anchorOrigin:u,anchorXUnits:h,anchorYUnits:c,crossOrigin:this.crossOrigin_,offset:g,offsetOrigin:"bottom-left",rotation:w,scale:E,size:_,src:this.iconUrlFunction_(o),color:T}),C=R.getScaleArray()[0],A=R.getSize();if(A===null){const k=R.getImageState();if(k===J.IDLE||k===J.LOADING){const F=function(){const z=R.getImageState();if(!(z===J.IDLE||z===J.LOADING)){const p=R.getSize();if(p&&p.length==2){const v=El(p);R.setScale(C*v)}R.unlistenImageChange(F)}};R.listenImageChange(F),k===J.IDLE&&R.load()}}else if(A.length==2){const k=El(A);R.setScale(C*k)}n.imageStyle=R}else n.imageStyle=ed}const xS=B(it,{color:I(gh),scale:I(n0)});function vS(r,t){const e=q({},xS,r,t);if(!e)return;const n=t[t.length-1],i=new ki({fill:new zr({color:"color"in e?e.color:Ts}),scale:e.scale});n.textStyle=i}const wS=B(it,{color:I(gh),width:I(Mt)});function SS(r,t){const e=q({},wS,r,t);if(!e)return;const n=t[t.length-1],i=new sn({color:"color"in e?e.color:Ts,width:"width"in e?e.width:1});n.strokeStyle=i}const ES=B(it,{color:I(gh),fill:I(li),outline:I(li)});function bS(r,t){const e=q({},ES,r,t);if(!e)return;const n=t[t.length-1],i=new zr({color:"color"in e?e.color:Ts});n.fillStyle=i;const s=e.fill;s!==void 0&&(n.fill=s);const o=e.outline;o!==void 0&&(n.outline=o)}const TS=B(it,{coordinates:ot(t0)});function s0(r,t){return q(null,TS,r,t)}function MS(r,t){const e=t[t.length-1].coordinates,n=Ye(r,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){const s=parseFloat(i[1]),o=parseFloat(i[2]),a=parseFloat(i[3]);e.push([s,o,a])}else e.push([])}const RS=B(kn,{Track:rt(o0)});function CS(r,t){const e=q([],RS,r,t);if(e)return new sr(e)}const IS=B(it,{when:tE},B(kn,{coord:MS}));function o0(r,t){const e=q({coordinates:[],whens:[]},IS,r,t);if(!e)return;const n=[],i=e.coordinates,s=e.whens;for(let o=0,a=Math.min(i.length,s.length);o0&&t[t.length-1].push(...e)}const KS=B(it,{LinearRing:ot(s0)});function JS(r,t){const e=q(void 0,KS,r,t);if(e){const n=t[t.length-1];n[0]=e}}function QS(r,t){ir(oS,r,t)}function tE(r,t){const e=t[t.length-1].whens,n=Ye(r,!1),i=Date.parse(n);e.push(isNaN(i)?0:i)}function ph(r,t){const e=jr(t),n=[(e.length==4?e[3]:1)*255,e[2],e[1],e[0]];for(let i=0;i<4;++i){const s=Math.floor(n[i]).toString(16);n[i]=s.length==1?"0"+s:s}dt(r,n.join(""))}function eE(r,t,e){const n=e[e.length-1],i=n.layout,s=n.stride;let o;if(i=="XY"||i=="XYM")o=2;else if(i=="XYZ"||i=="XYZM")o=3;else throw new Error("Invalid geometry layout");const a=t.length;let l="";if(a>0){l+=t[0];for(let h=1;h0){const g=or(i,o);ft(n,Jh,IE,[{names:o,values:g}],e)}const u=e[0];let d=t.getGeometry();d&&(d=re(d,!0,u)),ft(n,Jh,f0,[d],e)}const PE=B(it,["extrude","tessellate","altitudeMode","coordinates"]),AE=B(it,{extrude:P(Ns),tessellate:P(Ns),altitudeMode:P(dt),coordinates:P(eE)});function Ms(r,t,e){const n=t.getFlatCoordinates(),i={node:r};i.layout=t.getLayout(),i.stride=t.getStride();const s=t.getProperties();s.coordinates=n;const o=e[e.length-1].node,a=PE[o.namespaceURI],l=or(s,a);ft(i,AE,Te,l,e,a)}const LE=B(it,["color","fill","outline"]),hf=B(it,{outerBoundaryIs:P(lf),innerBoundaryIs:P(lf)}),OE=oe("innerBoundaryIs"),FE=oe("outerBoundaryIs");function _0(r,t,e){const n=t.getLinearRings(),i=n.shift(),s={node:r};ft(s,hf,OE,n,e),ft(s,hf,FE,[i],e)}const NE=B(it,{color:P(ph),fill:P(Ns),outline:P(Ns)});function DE(r,t,e){const n={node:r},i=t.getFill(),s=t.getStroke(),o={color:i?i.getColor():void 0,fill:i?void 0:!1,outline:s?void 0:!1},a=e[e.length-1].node,l=LE[a.namespaceURI],h=or(o,l);ft(n,NE,Te,h,e,l)}function y0(r,t){Qe(r,Math.round(t*1e6)/1e6)}const kE=B(it,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),GE=B(it,{IconStyle:P(fE),LabelStyle:P(_E),LineStyle:P(vE),PolyStyle:P(DE)});function jE(r,t,e){const n={node:r},i={};if(t.pointStyles.length){const l=t.pointStyles[0].getText();l&&(i.LabelStyle=l);const h=t.pointStyles[0].getImage();h&&typeof h.getSrc=="function"&&(i.IconStyle=h)}if(t.lineStyles.length){const l=t.lineStyles[0].getStroke();l&&(i.LineStyle=l)}if(t.polyStyles.length){const l=t.polyStyles[0].getStroke();l&&!i.LineStyle&&(i.LineStyle=l),i.PolyStyle=t.polyStyles[0]}const s=e[e.length-1].node,o=kE[s.namespaceURI],a=or(i,o);ft(n,GE,Te,a,e,o)}function zE(r,t){r.setAttribute("x",String(t.x)),r.setAttribute("y",String(t.y)),r.setAttribute("xunits",t.xunits),r.setAttribute("yunits",t.yunits)}const UE=dS;var id={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */id.read=function(r,t,e,n,i){var s,o,a=i*8-n-1,l=(1<>1,c=-7,u=e?i-1:0,d=e?-1:1,g=r[t+u];for(u+=d,s=g&(1<<-c)-1,g>>=-c,c+=a;c>0;s=s*256+r[t+u],u+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=o*256+r[t+u],u+=d,c-=8);if(s===0)s=1-h;else{if(s===l)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-h}return(g?-1:1)*o*Math.pow(2,s-n)};id.write=function(r,t,e,n,i,s){var o,a,l,h=s*8-i-1,c=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,f=n?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+u>=1?t+=d/l:t+=d*Math.pow(2,1-u),t*l>=2&&(o++,l/=2),o+u>=c?(a=0,o=c):o+u>=1?(a=(t*l-1)*Math.pow(2,i),o=o+u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[e+g]=a&255,g+=f,a/=256,i-=8);for(o=o<0;r[e+g]=o&255,g+=f,o/=256,h-=8);r[e+g-f]|=m*128};var BE=Nt,Ba=id;function Nt(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}Nt.Varint=0;Nt.Fixed64=1;Nt.Bytes=2;Nt.Fixed32=5;var qc=65536*65536,cf=1/qc,XE=12,x0=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Nt.prototype={destroy:function(){this.buf=null},readFields:function(r,t,e){for(e=e||this.length;this.pos>3,s=this.pos;this.type=n&7,r(i,t,this),this.pos===s&&this.skip(n)}return t},readMessage:function(r,t){return this.readFields(r,t,this.readVarint()+this.pos)},readFixed32:function(){var r=Xa(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=df(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=Xa(this.buf,this.pos)+Xa(this.buf,this.pos+4)*qc;return this.pos+=8,r},readSFixed64:function(){var r=Xa(this.buf,this.pos)+df(this.buf,this.pos+4)*qc;return this.pos+=8,r},readFloat:function(){var r=Ba.read(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=Ba.read(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var t=this.buf,e,n;return n=t[this.pos++],e=n&127,n<128||(n=t[this.pos++],e|=(n&127)<<7,n<128)||(n=t[this.pos++],e|=(n&127)<<14,n<128)||(n=t[this.pos++],e|=(n&127)<<21,n<128)?e:(n=t[this.pos],e|=(n&15)<<28,WE(e,r,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2===1?(r+1)/-2:r/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var r=this.readVarint()+this.pos,t=this.pos;return this.pos=r,r-t>=XE&&x0?s2(this.buf,t,r):i2(this.buf,t,r)},readBytes:function(){var r=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,r);return this.pos=r,t},readPackedVarint:function(r,t){if(this.type!==Nt.Bytes)return r.push(this.readVarint(t));var e=pn(this);for(r=r||[];this.pos127;);else if(t===Nt.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Nt.Fixed32)this.pos+=4;else if(t===Nt.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(r,t){this.writeVarint(r<<3|t)},realloc:function(r){for(var t=this.length||16;t268435455||r<0){ZE(r,this);return}this.realloc(4),this.buf[this.pos++]=r&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=(r>>>=7)&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=(r>>>=7)&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=r>>>7&127)))},writeSVarint:function(r){this.writeVarint(r<0?-r*2-1:r*2)},writeBoolean:function(r){this.writeVarint(!!r)},writeString:function(r){r=String(r),this.realloc(r.length*4),this.pos++;var t=this.pos;this.pos=o2(this.buf,r,this.pos);var e=this.pos-t;e>=128&&uf(t,e,this),this.pos=t-1,this.writeVarint(e),this.pos+=e},writeFloat:function(r){this.realloc(4),Ba.write(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),Ba.write(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var t=r.length;this.writeVarint(t),this.realloc(t);for(var e=0;e=128&&uf(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeMessage:function(r,t,e){this.writeTag(r,Nt.Bytes),this.writeRawMessage(t,e)},writePackedVarint:function(r,t){t.length&&this.writeMessage(r,VE,t)},writePackedSVarint:function(r,t){t.length&&this.writeMessage(r,HE,t)},writePackedBoolean:function(r,t){t.length&&this.writeMessage(r,QE,t)},writePackedFloat:function(r,t){t.length&&this.writeMessage(r,KE,t)},writePackedDouble:function(r,t){t.length&&this.writeMessage(r,JE,t)},writePackedFixed32:function(r,t){t.length&&this.writeMessage(r,t2,t)},writePackedSFixed32:function(r,t){t.length&&this.writeMessage(r,e2,t)},writePackedFixed64:function(r,t){t.length&&this.writeMessage(r,r2,t)},writePackedSFixed64:function(r,t){t.length&&this.writeMessage(r,n2,t)},writeBytesField:function(r,t){this.writeTag(r,Nt.Bytes),this.writeBytes(t)},writeFixed32Field:function(r,t){this.writeTag(r,Nt.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(r,t){this.writeTag(r,Nt.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(r,t){this.writeTag(r,Nt.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(r,t){this.writeTag(r,Nt.Fixed64),this.writeSFixed64(t)},writeVarintField:function(r,t){this.writeTag(r,Nt.Varint),this.writeVarint(t)},writeSVarintField:function(r,t){this.writeTag(r,Nt.Varint),this.writeSVarint(t)},writeStringField:function(r,t){this.writeTag(r,Nt.Bytes),this.writeString(t)},writeFloatField:function(r,t){this.writeTag(r,Nt.Fixed32),this.writeFloat(t)},writeDoubleField:function(r,t){this.writeTag(r,Nt.Fixed64),this.writeDouble(t)},writeBooleanField:function(r,t){this.writeVarintField(r,!!t)}};function WE(r,t,e){var n=e.buf,i,s;if(s=n[e.pos++],i=(s&112)>>4,s<128||(s=n[e.pos++],i|=(s&127)<<3,s<128)||(s=n[e.pos++],i|=(s&127)<<10,s<128)||(s=n[e.pos++],i|=(s&127)<<17,s<128)||(s=n[e.pos++],i|=(s&127)<<24,s<128)||(s=n[e.pos++],i|=(s&1)<<31,s<128))return qE(r,i,t);throw new Error("Expected varint not more than 10 bytes")}function pn(r){return r.type===Nt.Bytes?r.readVarint()+r.pos:r.pos+1}function qE(r,t,e){return e?t*4294967296+(r>>>0):(t>>>0)*4294967296+(r>>>0)}function ZE(r,t){var e,n;if(r>=0?(e=r%4294967296|0,n=r/4294967296|0):(e=~(-r%4294967296),n=~(-r/4294967296),e^4294967295?e=e+1|0:(e=0,n=n+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),YE(e,n,t),$E(n,t)}function YE(r,t,e){e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos++]=r&127|128,r>>>=7,e.buf[e.pos]=r&127}function $E(r,t){var e=(r&7)<<4;t.buf[t.pos++]|=e|((r>>>=3)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127|((r>>>=7)?128:0),r&&(t.buf[t.pos++]=r&127)))))}function uf(r,t,e){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));e.realloc(n);for(var i=e.pos-1;i>=r;i--)e.buf[i+n]=e.buf[i]}function VE(r,t){for(var e=0;e>>8,r[e+2]=t>>>16,r[e+3]=t>>>24}function df(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+(r[t+3]<<24)}function i2(r,t,e){for(var n="",i=t;i239?4:s>223?3:s>191?2:1;if(i+a>e)break;var l,h,c;a===1?s<128&&(o=s):a===2?(l=r[i+1],(l&192)===128&&(o=(s&31)<<6|l&63,o<=127&&(o=null))):a===3?(l=r[i+1],h=r[i+2],(l&192)===128&&(h&192)===128&&(o=(s&15)<<12|(l&63)<<6|h&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):a===4&&(l=r[i+1],h=r[i+2],c=r[i+3],(l&192)===128&&(h&192)===128&&(c&192)===128&&(o=(s&15)<<18|(l&63)<<12|(h&63)<<6|c&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,a=1):o>65535&&(o-=65536,n+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),n+=String.fromCharCode(o),i+=a}return n}function s2(r,t,e){return x0.decode(r.subarray(t,e))}function o2(r,t,e){for(var n=0,i,s;n55295&&i<57344)if(s)if(i<56320){r[e++]=239,r[e++]=191,r[e++]=189,s=i;continue}else i=s-55296<<10|i-56320|65536,s=null;else{i>56319||n+1===t.length?(r[e++]=239,r[e++]=191,r[e++]=189):s=i;continue}else s&&(r[e++]=239,r[e++]=191,r[e++]=189,s=null);i<128?r[e++]=i:(i<2048?r[e++]=i>>6|192:(i<65536?r[e++]=i>>12|224:(r[e++]=i>>18|240,r[e++]=i>>12&63|128),r[e++]=i>>6&63|128),r[e++]=i&63|128)}return e}const a2=Vs(BE);class l2 extends ya{constructor(t){super(),t=t||{},this.dataProjection=new Os({code:"",units:"tile-pixels"}),this.featureClass=t.featureClass?t.featureClass:ke,this.geometryName_=t.geometryName,this.layerName_=t.layerName?t.layerName:"layer",this.layers_=t.layers?t.layers:null,this.idProperty_=t.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(t,e,n,i){t.pos=e.geometry;const s=t.readVarint()+t.pos;let o=1,a=0,l=0,h=0,c=0,u=0;for(;t.pos>3}if(a--,o===1||o===2)l+=t.readSVarint(),h+=t.readSVarint(),o===1&&c>u&&(i.push(c),u=c),n.push(l,h),c+=2;else if(o===7)c>u&&(n.push(n[u],n[u+1]),c+=2);else throw new Error("Invalid command found in the PBF")}c>u&&(i.push(c),u=c)}createFeature_(t,e,n){const i=e.type;if(i===0)return null;let s;const o=e.properties;let a;this.idProperty_?(a=o[this.idProperty_],delete o[this.idProperty_]):a=e.id,o[this.layerName_]=e.layer.name;const l=[],h=[];this.readRawGeometry_(t,e,l,h);const c=g2(i,h.length);if(this.featureClass===ke)s=new this.featureClass(c,l,h,2,o,a),s.transform(n.dataProjection);else{let u;if(c=="Polygon"){const f=Om(l,h);u=f.length>1?new Mr(l,"XY",f):new ze(l,"XY",h)}else u=c==="Point"?new Ee(l,"XY"):c==="LineString"?new pe(l,"XY"):c==="MultiPoint"?new Br(l,"XY"):c==="MultiLineString"?new sr(l,"XY",h):null;const d=this.featureClass;s=new d,this.geometryName_&&s.setGeometryName(this.geometryName_);const g=re(u,!1,n);s.setGeometry(g),a!==void 0&&s.setId(a),s.setProperties(o,!0)}return s}getType(){return"arraybuffer"}readFeatures(t,e){const n=this.layers_;e=this.adaptOptions(e);const i=K(e.dataProjection);i.setWorldExtent(e.extent),e.dataProjection=i;const s=new a2(t),o=s.readFields(h2,{}),a=[];for(const l in o){if(n&&!n.includes(l))continue;const h=o[l],c=h?[0,0,h.extent,h.extent]:null;i.setExtent(c);for(let u=0,d=h.length;u>3,n=r===1?e.readString():r===2?e.readFloat():r===3?e.readDouble():r===4?e.readVarint64():r===5?e.readVarint():r===6?e.readSVarint():r===7?e.readBoolean():null;t.values.push(n)}}function u2(r,t,e){if(r==1)t.id=e.readVarint();else if(r==2){const n=e.readVarint()+e.pos;for(;e.pos>1):i>>1}return t}function K2(r){let t="";for(let e=0,n=r.length;e=32;)t=(32|r&31)+63,e+=String.fromCharCode(t),r>>=5;return t=r+63,e+=String.fromCharCode(t),e}const tb=W2;class eb extends zu{constructor(t){super(),t=t||{},this.layerName_=t.layerName,this.layers_=t.layers?t.layers:null,this.dataProjection=K(t.dataProjection?t.dataProjection:"EPSG:4326")}readFeaturesFromObject(t,e){if(t.type=="Topology"){const n=t;let i,s=null,o=null;n.transform&&(i=n.transform,s=i.scale,o=i.translate);const a=n.arcs;i&&cb(a,s,o);const l=[],h=n.objects,c=this.layerName_;let u;for(const d in h)this.layers_&&!this.layers_.includes(d)||(h[d].type==="GeometryCollection"?(u=h[d],l.push.apply(l,hb(u,a,s,o,c,d,e))):(u=h[d],l.push(S0(u,a,s,o,c,d,e))));return l}return[]}readProjectionFromObject(t){return this.dataProjection}}const rb={Point:nb,LineString:sb,Polygon:ab,MultiPoint:ib,MultiLineString:ob,MultiPolygon:lb};function mh(r,t){const e=[];let n;for(let i=0,s=r.length;i0&&e.pop(),n>=0){const o=t[n];for(let a=0,l=o.length;a=0;--a)e.push(o[a].slice(0))}return e}function nb(r,t,e){const n=r.coordinates;return t&&e&&od(n,t,e),new Ee(n)}function ib(r,t,e){const n=r.coordinates;if(t&&e)for(let i=0,s=n.length;i=2,"At least 2 conditions are required")}}class fb extends gb{constructor(t){super("And",Array.prototype.slice.call(arguments))}}const pb=fb;class mb extends E0{constructor(t,e,n){if(super("BBOX"),this.geometryName=t,this.extent=e,e.length!==4)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");this.srsName=n}}function _b(r){const t=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(pb,t))}function yb(r,t,e){return new mb(r,t,e)}const ff={"http://www.opengis.net/gml":{boundedBy:I(et.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:rt(et.prototype.readFeaturesInternal)}},xb={"http://www.opengis.net/wfs":{totalInserted:I(he),totalUpdated:I(he),totalDeleted:I(he)},"http://www.opengis.net/wfs/2.0":{totalInserted:I(he),totalUpdated:I(he),totalDeleted:I(he)}},vb={"http://www.opengis.net/wfs":{TransactionSummary:I(mf,"transactionSummary"),InsertResults:I(yf,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:I(mf,"transactionSummary"),InsertResults:I(yf,"insertIds")}},wb={"http://www.opengis.net/wfs":{PropertyName:P(dt)},"http://www.opengis.net/wfs/2.0":{PropertyName:P(dt)}},b0={"http://www.opengis.net/wfs":{Insert:P(xf),Update:P(wf),Delete:P(vf),Property:P(Sf),Native:P(Ef)},"http://www.opengis.net/wfs/2.0":{Insert:P(xf),Update:P(wf),Delete:P(vf),Property:P(Sf),Native:P(Ef)}},T0="feature",ld="http://www.w3.org/2000/xmlns/",hd={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},Zc={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},cd={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},pf={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},ud={"2.0.0":ad,"1.1.0":Et,"1.0.0":Tt},Sb="1.1.0";class Eb extends va{constructor(t){super(),t=t||{},this.version_=t.version?t.version:Sb,this.featureType_=t.featureType,this.featureNS_=t.featureNS,this.gmlFormat_=t.gmlFormat?t.gmlFormat:new ud[this.version_],this.schemaLocation_=t.schemaLocation?t.schemaLocation:pf[this.version_]}getFeatureType(){return this.featureType_}setFeatureType(t){this.featureType_=t}readFeaturesFromNode(t,e){const n={node:t};Object.assign(n,{featureType:this.featureType_,featureNS:this.featureNS_}),Object.assign(n,this.getReadOptions(t,e||{}));const i=[n];let s;this.version_==="2.0.0"?s=ff:s=this.gmlFormat_.FEATURE_COLLECTION_PARSERS;let o=q([],s,t,i,this.gmlFormat_);return o||(o=[]),o}readTransactionResponse(t){if(t){if(typeof t=="string"){const e=Er(t);return this.readTransactionResponseFromDocument(e)}return Sr(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}}readFeatureCollectionMetadata(t){if(t){if(typeof t=="string"){const e=Er(t);return this.readFeatureCollectionMetadataFromDocument(e)}return Sr(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}}readFeatureCollectionMetadataFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)}readFeatureCollectionMetadataFromNode(t){const e={},n=bn(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=n,q(e,ff,t,[],this.gmlFormat_)}readTransactionResponseFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)}readTransactionResponseFromNode(t){return q({},vb,t,[])}writeGetFeature(t){const e=mt(Zc[this.version_],"GetFeature");e.setAttribute("service","WFS"),e.setAttribute("version",this.version_),t.handle&&e.setAttribute("handle",t.handle),t.outputFormat&&e.setAttribute("outputFormat",t.outputFormat),t.maxFeatures!==void 0&&e.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&e.setAttribute("resultType",t.resultType),t.startIndex!==void 0&&e.setAttribute("startIndex",String(t.startIndex)),t.count!==void 0&&e.setAttribute("count",String(t.count)),t.viewParams!==void 0&&e.setAttribute("viewParams",t.viewParams),e.setAttributeNS(Fi,"xsi:schemaLocation",this.schemaLocation_);const n={node:e};if(Object.assign(n,{version:this.version_,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),Rt(Array.isArray(t.featureTypes),"`options.featureTypes` must be an Array"),typeof t.featureTypes[0]=="string"){let i=t.filter;t.bbox&&(Rt(t.geometryName,"`options.geometryName` must also be provided when `options.bbox` is set"),i=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,i)),Object.assign(n,{geometryName:t.geometryName,filter:i}),Of(e,t.featureTypes,[n])}else t.featureTypes.forEach(i=>{const s=this.combineBboxAndFilter(i.geometryName,i.bbox,t.srsName,t.filter);Object.assign(n,{geometryName:i.geometryName,filter:s}),Of(e,[i.name],[n])});return e}combineBboxAndFilter(t,e,n,i){const s=yb(t,e,n);return i?_b(i,s):s}writeTransaction(t,e,n,i){const s=[],o=i.version?i.version:this.version_,a=mt(Zc[o],"Transaction");a.setAttribute("service","WFS"),a.setAttribute("version",o);let l;i&&(l=i.gmlOptions?i.gmlOptions:{},i.handle&&a.setAttribute("handle",i.handle)),a.setAttributeNS(Fi,"xsi:schemaLocation",pf[o]);const h=bb(a,l,o,i);return t&&Wa("Insert",t,s,h),e&&Wa("Update",e,s,h),n&&Wa("Delete",n,s,h),i.nativeElements&&Wa("Native",i.nativeElements,s,h),a}readProjectionFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null}readProjectionFromNode(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild){t=t.firstElementChild.firstElementChild;for(let e=t.firstElementChild;e;e=e.nextElementSibling)if(!(e.childNodes.length===0||e.childNodes.length===1&&e.firstChild.nodeType===3)){const n=[{}];return this.gmlFormat_.readGeometryElement(e,n),K(n.pop().srsName)}}return null}}function bb(r,t,e,n){const i=n.featurePrefix?n.featurePrefix:T0;let s;return e==="1.0.0"?s=2:e==="1.1.0"?s=3:e==="2.0.0"&&(s=3.2),Object.assign({node:r},{version:e,featureNS:n.featureNS,featureType:n.featureType,featurePrefix:i,gmlVersion:s,hasZ:n.hasZ,srsName:n.srsName},t)}function Wa(r,t,e,n){ft(n,b0,oe(r),t,e)}function mf(r,t){return q({},xb,r,t)}const Tb={"http://www.opengis.net/ogc":{FeatureId:rt(function(r,t){return r.getAttribute("fid")})},"http://www.opengis.net/ogc/1.1":{FeatureId:rt(function(r,t){return r.getAttribute("fid")})}};function _f(r,t){ir(Tb,r,t)}const Mb={"http://www.opengis.net/wfs":{Feature:_f},"http://www.opengis.net/wfs/2.0":{Feature:_f}};function yf(r,t){return q([],Mb,r,t)}function xf(r,t,e){const n=e[e.length-1],i=n.featureType,s=n.featureNS,o=n.gmlVersion,a=mt(s,i);r.appendChild(a),o===2?Tt.prototype.writeFeatureElement(a,t,e):o===3?Et.prototype.writeFeatureElement(a,t,e):ad.prototype.writeFeatureElement(a,t,e)}function M0(r,t,e){const n=e[e.length-1].version,i=hd[n],s=mt(i,"Filter"),o=mt(i,"FeatureId");s.appendChild(o),o.setAttribute("fid",t),r.appendChild(s)}function dd(r,t){r=r||T0;const e=r+":";return t.startsWith(e)?t:e+t}function vf(r,t,e){const n=e[e.length-1];Rt(t.getId()!==void 0,"Features must have an id set");const i=n.featureType,s=n.featurePrefix,o=n.featureNS,a=dd(s,i);r.setAttribute("typeName",a),r.setAttributeNS(ld,"xmlns:"+s,o);const l=t.getId();l!==void 0&&M0(r,l,e)}function wf(r,t,e){const n=e[e.length-1];Rt(t.getId()!==void 0,"Features must have an id set");const i=n.version,s=n.featureType,o=n.featurePrefix,a=n.featureNS,l=dd(o,s),h=t.getGeometryName();r.setAttribute("typeName",l),r.setAttributeNS(ld,"xmlns:"+o,a);const c=t.getId();if(c!==void 0){const u=t.getKeys(),d=[];for(let g=0,f=u.length;g0,n=this.readUint32(e),i=Math.floor((n&268435455)/1e3),s=!!(n&2147483648)||i===1||i===3,o=!!(n&1073741824)||i===2||i===3,a=!!(n&536870912),l=(n&268435455)%1e3,h=["XY",s?"Z":"",o?"M":""].join(""),c=a?this.readUint32(e):null;if(t!==void 0&&t!==l)throw new Error("Unexpected WKB geometry type "+l);if(this.initialized_){if(this.isLittleEndian_!==e)throw new Error("Inconsistent endian");if(this.layout_!==h)throw new Error("Inconsistent geometry layout");if(c&&this.srid_!==c)throw new Error("Inconsistent coordinate system (SRID)")}else this.isLittleEndian_=e,this.hasZ_=s,this.hasM_=o,this.layout_=h,this.srid_=c,this.initialized_=!0;return l}readWkbPayload(t){switch(t){case Bt.POINT:return this.readPoint();case Bt.LINE_STRING:return this.readLineString();case Bt.POLYGON:case Bt.TRIANGLE:return this.readPolygon();case Bt.MULTI_POINT:return this.readMultiPoint();case Bt.MULTI_LINE_STRING:return this.readMultiLineString();case Bt.MULTI_POLYGON:case Bt.POLYHEDRAL_SURFACE:case Bt.TIN:return this.readMultiPolygon();case Bt.GEOMETRY_COLLECTION:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+t+" is found")}}readWkbBlock(t){return this.readWkbPayload(this.readWkbHeader(t))}readWkbCollection(t,e){const n=this.readUint32(),i=[];for(let s=0;s({[i]:t[s]})));for(const i of this.layout_)this.writeDouble(i in n?n[i]:this.nodata_[i])}writeLineString(t,e){this.writeUint32(t.length);for(let n=0;ni===s?i:i==="XYZM"?s:s==="XYZM"?i:"XY";if(t instanceof An)return n(t.getLayout(),e);if(t instanceof Ge){const i=t.getGeometriesArray();for(let s=0;ss+o[0],0),e=new ArrayBuffer(t),n=new DataView(e);let i=0;return this.writeQueue_.forEach(s=>{switch(s[0]){case 1:n.setUint8(i,s[1]);break;case 4:n.setUint32(i,s[1],this.isLittleEndian_);break;case 8:n.setFloat64(i,s[1],this.isLittleEndian_);break}i+=s[0]}),e}}class Ab extends ya{constructor(t){super(),t=t||{},this.splitCollection=!!t.splitCollection,this.viewCache_=null,this.hex_=t.hex!==!1,this.littleEndian_=t.littleEndian!==!1,this.ewkb_=t.ewkb!==!1,this.layout_=t.geometryLayout,this.nodataZ_=t.nodataZ||0,this.nodataM_=t.nodataM||0,this.srid_=t.srid}getType(){return this.hex_?"text":"arraybuffer"}readFeature(t,e){return new ve({geometry:this.readGeometry(t,e)})}readFeatures(t,e){let n=[];const i=this.readGeometry(t,e);return this.splitCollection&&i instanceof Ge?n=i.getGeometriesArray():n=[i],n.map(s=>new ve({geometry:s}))}readGeometry(t,e){const n=Nf(t);if(!n)return null;const i=new Ff(n).readGeometry();return this.viewCache_=n,e=this.getReadOptions(t,e),this.viewCache_=null,re(i,!1,e)}readProjection(t){const e=this.viewCache_||Nf(t);if(!e)return;const n=new Ff(e);return n.readWkbHeader(),n.getSrid()&&K("EPSG:"+n.getSrid())||void 0}writeFeature(t,e){return this.writeGeometry(t.getGeometry(),e)}writeFeatures(t,e){return this.writeGeometry(new Ge(t.map(n=>n.getGeometry())),e)}writeGeometry(t,e){e=this.adaptOptions(e);const n=new Pb({layout:this.layout_,littleEndian:this.littleEndian_,ewkb:this.ewkb_,nodata:{Z:this.nodataZ_,M:this.nodataM_}});let i=Number.isInteger(this.srid_)?Number(this.srid_):null;if(this.srid_!==!1&&!Number.isInteger(this.srid_)){const o=e.dataProjection&&K(e.dataProjection);if(o){const a=o.getCode();a.startsWith("EPSG:")&&(i=Number(a.substring(5)))}}n.writeGeometry(re(t,!0,e),i);const s=n.getBuffer();return this.hex_?Lb(s):s}}function Lb(r){const t=new Uint8Array(r);return Array.from(t.values()).map(e=>(e<16?"0":"")+Number(e).toString(16).toUpperCase()).join("")}function Ob(r){const t=new Uint8Array(r.length/2);for(let e=0;e="a"&&t<="z"||t>="A"&&t<="Z"}isNumeric_(t,e){return e=e!==void 0?e:!1,t>="0"&&t<="9"||t=="."&&!e}isWhiteSpace_(t){return t==" "||t==" "||t=="\r"||t==` +`}nextChar_(){return this.wkt.charAt(++this.index_)}nextToken(){const t=this.nextChar_(),e=this.index_;let n=t,i;if(t=="(")i=Dt.LEFT_PAREN;else if(t==",")i=Dt.COMMA;else if(t==")")i=Dt.RIGHT_PAREN;else if(this.isNumeric_(t)||t=="-")i=Dt.NUMBER,n=this.readNumber_();else if(this.isAlpha_(t))i=Dt.TEXT,n=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(t==="")i=Dt.EOF;else throw new Error("Unexpected character: "+t)}return{position:e,value:n,type:i}}readNumber_(){let t;const e=this.index_;let n=!1,i=!1;do t=="."?n=!0:(t=="e"||t=="E")&&(i=!0),t=this.nextChar_();while(this.isNumeric_(t,n)||!i&&(t=="e"||t=="E")||i&&(t=="-"||t=="+"));return parseFloat(this.wkt.substring(e,this.index_--))}readText_(){let t;const e=this.index_;do t=this.nextChar_();while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}let jb=class{constructor(r){this.lexer_=r,this.token_={position:0,type:Dt.START},this.layout_="XY"}consume_(){this.token_=this.lexer_.nextToken()}isTokenType(r){return this.token_.type==r}match(r){const t=this.isTokenType(r);return t&&this.consume_(),t}parse(){return this.consume_(),this.parseGeometry_()}parseGeometryLayout_(){let r="XY";const t=this.token_;if(this.isTokenType(Dt.TEXT)){const e=t.value;e===C0?r="XYZ":e===I0?r="XYM":e===Db&&(r="XYZM"),r!=="XY"&&this.consume_()}return r}parseGeometryCollectionText_(){if(this.match(Dt.LEFT_PAREN)){const r=[];do r.push(this.parseGeometry_());while(this.match(Dt.COMMA));if(this.match(Dt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(Dt.LEFT_PAREN)){const r=this.parsePoint_();if(this.match(Dt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(Dt.LEFT_PAREN)){const r=this.parsePointList_();if(this.match(Dt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(Dt.LEFT_PAREN)){const r=this.parseLineStringTextList_();if(this.match(Dt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(Dt.LEFT_PAREN)){let r;if(this.token_.type==Dt.LEFT_PAREN?r=this.parsePointTextList_():r=this.parsePointList_(),this.match(Dt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(Dt.LEFT_PAREN)){const r=this.parseLineStringTextList_();if(this.match(Dt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(Dt.LEFT_PAREN)){const r=this.parsePolygonTextList_();if(this.match(Dt.RIGHT_PAREN))return r}throw new Error(this.formatErrorMessage_())}parsePoint_(){const r=[],t=this.layout_.length;for(let e=0;e0&&(i+=" "+s)}return n.length===0?i+" "+R0:i+"("+n+")"}const Yb=zb,Ae=[null,"http://www.opengis.net/wms"],$b=B(Ae,{Service:I(pT),Capability:I(fT)}),Vb=B(Ae,{Request:I(ST),Exception:I(xT),Layer:I(vT)});class Hb extends sd{constructor(){super(),this.version=void 0}readFromNode(t){return this.version=t.getAttribute("version").trim(),q({version:this.version},$b,t,[])||null}}const Kb=B(Ae,{Name:I(Z),Title:I(Z),Abstract:I(Z),KeywordList:I(D0),OnlineResource:I(Hs),ContactInformation:I(mT),Fees:I(Z),AccessConstraints:I(Z),LayerLimit:I(he),MaxWidth:I(he),MaxHeight:I(he)}),Jb=B(Ae,{ContactPersonPrimary:I(_T),ContactPosition:I(Z),ContactAddress:I(yT),ContactVoiceTelephone:I(Z),ContactFacsimileTelephone:I(Z),ContactElectronicMailAddress:I(Z)}),Qb=B(Ae,{ContactPerson:I(Z),ContactOrganization:I(Z)}),tT=B(Ae,{AddressType:I(Z),Address:I(Z),City:I(Z),StateOrProvince:I(Z),PostCode:I(Z),Country:I(Z)}),eT=B(Ae,{Format:rt(Z)}),O0=B(Ae,{Name:I(Z),Title:I(Z),Abstract:I(Z),KeywordList:I(D0),CRS:Yt(Z),EX_GeographicBoundingBox:I(gT),BoundingBox:Yt(dT),Dimension:Yt(wT),Attribution:I(uT),AuthorityURL:Yt(TT),Identifier:Yt(Z),MetadataURL:Yt(MT),DataURL:Yt(Ln),FeatureListURL:Yt(Ln),Style:Yt(RT),MinScaleDenominator:I(Mt),MaxScaleDenominator:I(Mt),Layer:Yt(F0)}),rT=B(Ae,{Title:I(Z),OnlineResource:I(Hs),LogoURL:I(N0)}),nT=B(Ae,{westBoundLongitude:I(Mt),eastBoundLongitude:I(Mt),southBoundLatitude:I(Mt),northBoundLatitude:I(Mt)}),iT=B(Ae,{GetCapabilities:I(Qh),GetMap:I(Qh),GetFeatureInfo:I(Qh)}),sT=B(Ae,{Format:Yt(Z),DCPType:Yt(ET)}),oT=B(Ae,{HTTP:I(bT)}),aT=B(Ae,{Get:I(Ln),Post:I(Ln)}),lT=B(Ae,{Name:I(Z),Title:I(Z),Abstract:I(Z),LegendURL:Yt(N0),StyleSheetURL:I(Ln),StyleURL:I(Ln)}),hT=B(Ae,{Format:I(Z),OnlineResource:I(Hs)}),cT=B(Ae,{Keyword:rt(Z)});function uT(r,t){return q({},rT,r,t)}function dT(r,t){const e=[vn(r.getAttribute("minx")),vn(r.getAttribute("miny")),vn(r.getAttribute("maxx")),vn(r.getAttribute("maxy"))],n=[vn(r.getAttribute("resx")),vn(r.getAttribute("resy"))];return{crs:r.getAttribute("CRS"),extent:e,res:n}}function gT(r,t){const e=q({},nT,r,t);if(!e)return;const n=e.westBoundLongitude,i=e.southBoundLatitude,s=e.eastBoundLongitude,o=e.northBoundLatitude;if(!(n===void 0||i===void 0||s===void 0||o===void 0))return[n,i,s,o]}function fT(r,t){return q({},Vb,r,t)}function pT(r,t){return q({},Kb,r,t)}function mT(r,t){return q({},Jb,r,t)}function _T(r,t){return q({},Qb,r,t)}function yT(r,t){return q({},tT,r,t)}function xT(r,t){return q([],eT,r,t)}function vT(r,t){const e=q({},O0,r,t);return e.Layer===void 0?Object.assign(e,F0(r,t)):e}function F0(r,t){const e=t[t.length-1],n=q({},O0,r,t);if(!n)return;let i=Pi(r.getAttribute("queryable"));i===void 0&&(i=e.queryable),n.queryable=i!==void 0?i:!1;let s=bn(r.getAttribute("cascaded"));s===void 0&&(s=e.cascaded),n.cascaded=s;let o=Pi(r.getAttribute("opaque"));o===void 0&&(o=e.opaque),n.opaque=o!==void 0?o:!1;let a=Pi(r.getAttribute("noSubsets"));a===void 0&&(a=e.noSubsets),n.noSubsets=a!==void 0?a:!1;let l=vn(r.getAttribute("fixedWidth"));l||(l=e.fixedWidth),n.fixedWidth=l;let h=vn(r.getAttribute("fixedHeight"));return h||(h=e.fixedHeight),n.fixedHeight=h,["Style","CRS","AuthorityURL"].forEach(function(c){if(c in e){const u=n[c]||[];n[c]=u.concat(e[c])}}),["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(c){if(!(c in n)){const u=e[c];n[c]=u}}),n}function wT(r,t){return{name:r.getAttribute("name"),units:r.getAttribute("units"),unitSymbol:r.getAttribute("unitSymbol"),default:r.getAttribute("default"),multipleValues:Pi(r.getAttribute("multipleValues")),nearestValue:Pi(r.getAttribute("nearestValue")),current:Pi(r.getAttribute("current")),values:Z(r)}}function Ln(r,t){return q({},hT,r,t)}function ST(r,t){return q({},iT,r,t)}function ET(r,t){return q({},oT,r,t)}function bT(r,t){return q({},aT,r,t)}function Qh(r,t){return q({},sT,r,t)}function N0(r,t){const e=Ln(r,t);if(e){const n=[bn(r.getAttribute("width")),bn(r.getAttribute("height"))];return e.size=n,e}}function TT(r,t){const e=Ln(r,t);if(e)return e.name=r.getAttribute("name"),e}function MT(r,t){const e=Ln(r,t);if(e)return e.type=r.getAttribute("type"),e}function RT(r,t){return q({},lT,r,t)}function D0(r,t){return q([],cT,r,t)}const CT=Hb,IT="_feature",PT="_layer";class AT extends va{constructor(t){super(),t=t||{},this.featureNS_="http://mapserver.gis.umn.edu/mapserver",this.gmlFormat_=new Tt,this.layers_=t.layers?t.layers:null}getLayers(){return this.layers_}setLayers(t){this.layers_=t}readFeatures_(t,e){t.setAttribute("namespaceURI",this.featureNS_);const n=t.localName;let i=[];if(t.childNodes.length===0)return i;if(n=="msGMLOutput")for(let s=0,o=t.childNodes.length;s0;)this.pop()}extend(r){for(let t=0,e=r.length;tthis.getLength())throw new Error("Index out of bounds: "+r);this.unique_&&this.assertUnique_(t),this.array_.splice(r,0,t),this.updateLength_(),this.dispatchEvent(new Za(ti.ADD,t,r))}pop(){return this.removeAt(this.getLength()-1)}push(r){this.unique_&&this.assertUnique_(r);const t=this.getLength();return this.insertAt(t,r),this.getLength()}remove(r){const t=this.array_;for(let e=0,n=t.length;e=this.getLength())return;const t=this.array_[r];return this.array_.splice(r,1),this.updateLength_(),this.dispatchEvent(new Za(ti.REMOVE,t,r)),t}setAt(r,t){const e=this.getLength();if(r>=e){this.insertAt(r,t);return}if(r<0)throw new Error("Index out of bounds: "+r);this.unique_&&this.assertUnique_(t,r);const n=this.array_[r];this.array_[r]=t,this.dispatchEvent(new Za(ti.REMOVE,n,r)),this.dispatchEvent(new Za(ti.ADD,t,r))}updateLength_(){this.set(Df.LENGTH,this.array_.length)}assertUnique_(r,t){for(let e=0,n=this.array_.length;eg&&(d=(g+d)/2,g=d),f>m&&(f=(m+f)/2,m=f);let _=xt(n[0],d,g),y=xt(n[1],f,m);if(o&&e&&i){const x=30*i;_+=-x*Math.log(1+Math.max(0,d-n[0])/x)+x*Math.log(1+Math.max(0,n[0]-g)/x),y+=-x*Math.log(1+Math.max(0,f-n[1])/x)+x*Math.log(1+Math.max(0,n[1]-m)/x)}return[_,y]}}function nM(r){return r}function pd(r,t,e,n){const i=pt(t)/e[0],s=Zt(t)/e[1];return n?Math.min(r,Math.max(i,s)):Math.min(r,Math.min(i,s))}function md(r,t,e){let n=Math.min(r,t);const i=50;return n*=Math.log(1+i*Math.max(0,r/t-1))/i+1,e&&(n=Math.max(n,e),n/=Math.log(1+i*Math.max(0,e/r-1))/i+1),xt(n,e/2,t*2)}function iM(r,t,e,n){return t=t!==void 0?t:!0,function(i,s,o,a){if(i!==void 0){const l=r[0],h=r[r.length-1],c=e?pd(l,e,o,n):l;if(a)return t?md(i,c,h):xt(i,h,c);const u=Math.min(c,i),d=Math.floor(Hl(r,u,s));return r[d]>c&&d1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);let i=0;for(;i0}getInteracting(){return this.hints_[Kt.INTERACTING]>0}cancelAnimations(){this.setHint(Kt.ANIMATING,-this.hints_[Kt.ANIMATING]);let t;for(let e=0,n=this.animations_.length;e=0;--n){const i=this.animations_[n];let s=!0;for(let o=0,a=i.length;o0?h/l.duration:1;c>=1?(l.complete=!0,c=1):s=!1;const u=l.easing(c);if(l.sourceCenter){const d=l.sourceCenter[0],g=l.sourceCenter[1],f=l.targetCenter[0],m=l.targetCenter[1];this.nextCenter_=l.targetCenter;const _=d+u*(f-d),y=g+u*(m-g);this.targetCenter_=[_,y]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const g=this.getViewportSize_(this.getRotation()),f=this.constraints_.resolution(d,0,g,!0);this.targetCenter_=this.calculateCenterZoom(f,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?en(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const g=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(g,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(s){this.animations_[n]=null,this.setHint(Kt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=i[0].callback;o&&Ya(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let n;const i=this.getCenterInternal();return i!==void 0&&(n=[i[0]-e[0],i[1]-e[1]],fx(n,t-this.getRotation()),mm(n,e)),n}calculateCenterZoom(t,e){let n;const i=this.getCenterInternal(),s=this.getResolution();if(i!==void 0&&s!==void 0){const o=e[0]-t*(e[0]-i[0])/s,a=e[1]-t*(e[1]-i[1])/s;n=[o,a]}return n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0],i=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(i*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&Lc(t,this.getProjection())}getCenterInternal(){return this.get(Ir.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return th(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();Rt(e,"The view center is not defined");const n=this.getResolution();Rt(n!==void 0,"The view resolution is not defined");const i=this.getRotation();return Rt(i!==void 0,"The view rotation is not defined"),wu(e,n,i,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Ir.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Or(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=pt(t)/e[0],i=Zt(t)/e[1];return Math.max(n,i)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(e/n)/Math.log(t);return function(s){return e/Math.pow(t,s*i)}}getRotation(){return this.get(Ir.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,s=Math.log(n/i)/e;return function(o){return Math.log(n/o)/e/s}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),n=this.getRotation();let i=this.getCenterInternal();const s=this.padding_;if(s){const o=this.getViewportSizeMinusPadding_();i=ec(i,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],e,n)}return{center:i.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,n,i;if(this.resolutions_){const s=Hl(this.resolutions_,t,1);e=s,n=this.resolutions_[s],s==this.resolutions_.length-1?i=2:i=n/this.resolutions_[s+1]}else n=this.maxResolution_,i=this.zoomFactor_;return e+Math.log(n/t)/Math.log(i)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=xt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,xt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;if(Rt(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){Rt(!Dn(t),"Cannot fit empty extent provided as `geometry`");const i=Or(t,this.getProjection());n=qg(i)}else if(t.getType()==="Circle"){const i=Or(t.getExtent(),this.getProjection());n=qg(i),n.rotate(this.getRotation(),be(i))}else n=t;this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),n=Math.cos(e),i=Math.sin(-e),s=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,h=-1/0,c=-1/0;for(let u=0,d=s.length;u{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const n=this.getMapInternal();!t&&n&&(t=n.getView()),t instanceof zf?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let i;e.layerStatesArray?i=e.layerStatesArray.find(o=>o.layer===this):i=this.getLayerState();const s=this.getExtent();return mM(i,e.viewState)&&(!s||$t(s,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e;const n=this.getSource();if(n&&(e=n.getAttributions()),!e)return[];const i=t instanceof zf?t.getViewStateAndExtent():t;let s=e(i);return Array.isArray(s)||(s=[s]),s}render(t,e){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(kt.MAP,t)}getMapInternal(){return this.get(kt.MAP)}setMap(t){this.mapPrecomposeKey_&&(ye(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(ye(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=ie(t,er.PRECOMPOSE,function(e){const n=e.frameState.layerStatesArray,i=this.getLayerState(!1);Rt(!n.some(function(s){return s.layer===i.layer}),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),n.push(i)},this),this.mapRenderKey_=ie(this,Ct.CHANGE,t.render,t),this.changed())}setSource(t){this.set(kt.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function mM(r,t){if(!r.visible)return!1;const e=t.resolution;if(e=r.maxResolution)return!1;const n=t.zoom;return n>r.minZoom&&n<=r.maxZoom}const Sa=pM;function _M(r,t,e,n,i){B0(r,t,e||0,n||r.length-1,i||yM)}function B0(r,t,e,n,i){for(;n>e;){if(n-e>600){var s=n-e+1,o=t-e+1,a=Math.log(s),l=.5*Math.exp(2*a/3),h=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1),c=Math.max(e,Math.floor(t-o*l/s+h)),u=Math.min(n,Math.floor(t+(s-o)*l/s+h));B0(r,t,c,u,i)}var d=r[t],g=e,f=n;for(co(r,e,t),i(r[n],d)>0&&co(r,e,n);g0;)f--}i(r[e],d)===0?co(r,e,f):(f++,co(r,f,n)),f<=t&&(e=f+1),t<=f&&(n=f-1)}}function co(r,t,e){var n=r[t];r[t]=r[e],r[e]=n}function yM(r,t){return rt?1:0}let _d=class{constructor(r=9){this._maxEntries=Math.max(4,r),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(r){let t=this.data;const e=[];if(!Va(r,t))return e;const n=this.toBBox,i=[];for(;t;){for(let s=0;s=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(n,i,t)}_split(r,t){const e=r[t],n=e.children.length,i=this._minEntries;this._chooseSplitAxis(e,i,n);const s=this._chooseSplitIndex(e,i,n),o=hs(e.children.splice(s,e.children.length-s));o.height=e.height,o.leaf=e.leaf,Qi(e,this.toBBox),Qi(o,this.toBBox),t?r[t-1].children.push(o):this._splitRoot(e,o)}_splitRoot(r,t){this.data=hs([r,t]),this.data.height=r.height+1,this.data.leaf=!1,Qi(this.data,this.toBBox)}_chooseSplitIndex(r,t,e){let n,i=1/0,s=1/0;for(let o=t;o<=e-t;o++){const a=_o(r,0,o,this.toBBox),l=_o(r,o,e,this.toBBox),h=EM(a,l),c=rc(a)+rc(l);h=t;l--){const h=r.children[l];yo(o,r.leaf?i(h):h),a+=$a(o)}return a}_adjustParentBBoxes(r,t,e){for(let n=e;n>=0;n--)yo(t[n],r)}_condense(r){for(let t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():Qi(r[t],this.toBBox)}};function xM(r,t,e){if(!e)return t.indexOf(r);for(let n=0;n=r.minX&&t.maxY>=r.minY}function hs(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Uf(r,t,e,n,i){const s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=n)continue;const o=t+Math.ceil((e-t)/n/2)*n;_M(r,o,t,e,i),s.push(t,o,o,e)}}let Yi=0;const $i=0,Ht=1<",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string"},RM={[N.Get]:yt(([r,t])=>t!==void 0?MM(t.value):Fe,bt(1,2),CM),[N.Var]:yt(([r])=>r.type,bt(1,1),IM),[N.Id]:yt(V|_e,uo,PM),[N.Concat]:yt(_e,bt(2,1/0),At(Fe)),[N.GeometryType]:yt(_e,uo,AM),[N.Resolution]:yt(V,uo),[N.Zoom]:yt(V,uo),[N.Time]:yt(V,uo),[N.Any]:yt(Ht,bt(2,1/0),At(Ht)),[N.All]:yt(Ht,bt(2,1/0),At(Ht)),[N.Not]:yt(Ht,bt(1,1),At(Ht)),[N.Equal]:yt(Ht,bt(2,2),At(Fe),qn),[N.NotEqual]:yt(Ht,bt(2,2),At(Fe),qn),[N.GreaterThan]:yt(Ht,bt(2,2),At(Fe),qn),[N.GreaterThanOrEqualTo]:yt(Ht,bt(2,2),At(Fe),qn),[N.LessThan]:yt(Ht,bt(2,2),At(Fe),qn),[N.LessThanOrEqualTo]:yt(Ht,bt(2,2),At(Fe),qn),[N.Multiply]:yt(r=>{let t=V|jt;for(let e=0;e{let t=Fe;for(let e=1;e{let t=Fe;for(let e=2;e{let t=jt|V;for(let e=3;e{let t=Fe;for(let e=1;er.length===2?Me|Fr:r.length===3||r.length===4?Me|jt:Me,bt(1,1/0),At(V)),[N.Color]:yt(jt,bt(1,4),At(V)),[N.Band]:yt(V,bt(1,3),At(V)),[N.Palette]:yt(jt,bt(2,2),kM),[N.ToString]:yt(_e,bt(1,1),At(Ht|V|_e|jt))};function CM(r,t){const e=Gt(r[1],t);if(!(e instanceof ei))throw new Error("Expected a literal argument for get operation");if(typeof e.value!="string")throw new Error("Expected a string argument for get operation");if(t.properties.add(e.value),r.length===3){const n=Gt(r[2],t);return[e,n]}return[e]}function IM(r,t,e,n){const i=r[1];if(typeof i!="string")throw new Error("Expected a string argument for var operation");if(t.variables.add(i),!("variables"in t.style)||t.style.variables[i]===void 0)return[new ei(Fe,i)];const s=t.style.variables[i],o=Gt(s,t);if(o.value=i,n&&!Nr(n,o.type))throw new Error(`The variable ${i} has type ${xe(o.type)} but the following type was expected: ${xe(n)}`);return[o]}function PM(r,t){t.featureId=!0}function AM(r,t){t.geometryType=!0}function uo(r,t){const e=r[0];if(r.length!==1)throw new Error(`Expected no arguments for ${e} operation`);return[]}function bt(r,t){return function(e,n){const i=e[0],s=e.length-1;if(r===t){if(s!==r){const o=r===1?"":"s";throw new Error(`Expected ${r} argument${o} for ${i}, got ${s}`)}}else if(st){const o=t===1/0?`${r} or more`:`${r} to ${t}`;throw new Error(`Expected ${o} arguments for ${i}, got ${s}`)}}}function At(r){return function(t,e){const n=t[0],i=t.length-1,s=new Array(i);for(let o=0;on.featureId;case N.GeometryType:return n=>n.geometryType;case N.Concat:{const n=r.args.map(i=>Ur(i));return i=>"".concat(...n.map(s=>s(i).toString()))}case N.Resolution:return n=>n.resolution;case N.Any:case N.All:case N.Between:case N.In:case N.Not:return BM(r);case N.Equal:case N.NotEqual:case N.LessThan:case N.LessThanOrEqualTo:case N.GreaterThan:case N.GreaterThanOrEqualTo:return UM(r);case N.Multiply:case N.Divide:case N.Add:case N.Subtract:case N.Clamp:case N.Mod:case N.Pow:case N.Abs:case N.Floor:case N.Ceil:case N.Round:case N.Sin:case N.Cos:case N.Atan:case N.Sqrt:return XM(r);case N.Case:return WM(r);case N.Match:return qM(r);case N.Interpolate:return ZM(r);case N.ToString:return YM(r);default:throw new Error(`Unsupported operator ${e}`)}}function jM(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let s=0;s{for(let o=0;o{for(let o=0;on.properties[e];case N.Var:return n=>n.variables[e];default:throw new Error(`Unsupported accessor operator ${r.operator}`)}}function UM(r,t){const e=r.operator,n=Ur(r.args[0]),i=Ur(r.args[1]);switch(e){case N.Equal:return s=>n(s)===i(s);case N.NotEqual:return s=>n(s)!==i(s);case N.LessThan:return s=>n(s)n(s)<=i(s);case N.GreaterThan:return s=>n(s)>i(s);case N.GreaterThanOrEqualTo:return s=>n(s)>=i(s);default:throw new Error(`Unsupported comparison operator ${e}`)}}function BM(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let s=0;s{for(let o=0;o{for(let o=0;o{const o=i[0](s),a=i[1](s),l=i[2](s);return o>=a&&o<=l};case N.In:return s=>{const o=i[0](s);for(let a=1;a!i[0](s);default:throw new Error(`Unsupported logical operator ${e}`)}}function XM(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let s=0;s{let o=1;for(let a=0;ai[0](s)/i[1](s);case N.Add:return s=>{let o=0;for(let a=0;ai[0](s)-i[1](s);case N.Clamp:return s=>{const o=i[0](s),a=i[1](s);if(ol?l:o};case N.Mod:return s=>i[0](s)%i[1](s);case N.Pow:return s=>Math.pow(i[0](s),i[1](s));case N.Abs:return s=>Math.abs(i[0](s));case N.Floor:return s=>Math.floor(i[0](s));case N.Ceil:return s=>Math.ceil(i[0](s));case N.Round:return s=>Math.round(i[0](s));case N.Sin:return s=>Math.sin(i[0](s));case N.Cos:return s=>Math.cos(i[0](s));case N.Atan:return n===2?s=>Math.atan2(i[0](s),i[1](s)):s=>Math.atan(i[0](s));case N.Sqrt:return s=>Math.sqrt(i[0](s));default:throw new Error(`Unsupported numeric operator ${e}`)}}function WM(r,t){const e=r.args.length,n=new Array(e);for(let i=0;i{for(let s=0;s{const s=n[0](i);for(let o=1;o{const s=n[0](i),o=n[1](i);let a,l;for(let h=2;h=o)return h===2?u:d?$M(s,o,a,l,c,u):xo(s,o,a,l,c,u);a=c,l=u}return l}}function YM(r,t){const e=r.operator,n=r.args.length,i=new Array(n);for(let s=0;s{const o=i[0](s);return r.args[0].type===jt?Hu(o):o.toString()};default:throw new Error(`Unsupported convert operator ${e}`)}}function xo(r,t,e,n,i,s){const o=i-e;if(o===0)return n;const a=t-e,l=r===1?a/o:(Math.pow(r,a)-1)/(Math.pow(r,o)-1);return n+l*(s-n)}function $M(r,t,e,n,i,s){if(i-e===0)return n;const o=Jg(n),a=Jg(s);let l=a[2]-o[2];l>180?l-=360:l<-180&&(l+=360);const h=[xo(r,t,e,o[0],i,a[0]),xo(r,t,e,o[1],i,a[1]),o[2]+xo(r,t,e,0,i,l),xo(r,t,e,n[3],i,s[3])];return Wm(jw(h))}function VM(r){return!0}function HM(r){const t=yd(),e=KM(r,t),n=q0();return function(i,s){if(n.properties=i.getPropertiesInternal(),n.resolution=s,t.featureId){const o=i.getId();o!==void 0?n.featureId=o:n.featureId=null}return t.geometryType&&(n.geometryType=xd(i.getGeometry())),e(n)}}function Xf(r){const t=yd(),e=r.length,n=new Array(e);for(let o=0;o4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function V0(r,t){const e=ba(r,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}function lR(r,t){return typeof r=="number"?r:V0(r,t)}const Yf={RENDER_ORDER:"renderOrder"};class Ta extends Sa{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Yf.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const n=this.getDeclutter();n in t.declutter||(t.declutter[n]=new _d(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(Yf.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?Km:t;const e=hR(t);this.styleFunction_=t===null?void 0:eS(e),this.changed()}}function hR(r){if(r===void 0)return Km;if(!r)return null;if(typeof r=="function"||r instanceof Ze)return r;if(!Array.isArray(r))return Xf([r]);if(r.length===0)return[];const t=r.length,e=r[0];if(e instanceof Ze){const n=new Array(t);for(let i=0;il&&(this.instructions.push([ht.CUSTOM,l,c,t,n,En,s]),this.hitDetectionInstructions.push([ht.CUSTOM,l,c,t,i||n,En,s]));break;case"Point":h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),c=this.coordinates.length,this.instructions.push([ht.CUSTOM,l,c,t,n,void 0,s]),this.hitDetectionInstructions.push([ht.CUSTOM,l,c,t,i||n,void 0,s]);break}this.endGeometry(e)}beginGeometry(t,e,n){this.beginGeometryInstruction1_=[ht.BEGIN_GEOMETRY,e,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ht.BEGIN_GEOMETRY,e,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const n=t.length;let i,s,o=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0}createFill(t){const e=t.fillStyle,n=[ht.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[ht.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){const n=t.strokeStyle,i=t.lineCap,s=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=i||s!=t.currentLineDash&&!Bi(t.currentLineDash,s)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(n!==void 0&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=i,t.currentLineDash=s,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=h)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[ht.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=J1(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;br(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class cR extends Ma{constructor(t,e,n,i){super(t,e,n,i),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,n){if(!this.image_||this.maxExtent&&!gr(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,n);const i=t.getFlatCoordinates(),s=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(i,s);this.instructions.push([ht.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([ht.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,n){if(!this.image_)return;this.beginGeometry(t,e,n);const i=t.getFlatCoordinates(),s=[];for(let l=0,h=i.length;l=r){const f=(r-a+g)/g,m=cr(h,u,f),_=cr(c,d,f);l.push(m,_),s.push(l),l=[m,_],a==r&&(o+=i),a=0}else if(a0&&s.push(l),s}function mR(r,t,e,n,i){let s=e,o=e,a=0,l=0,h=e,c,u,d,g,f,m,_,y,x,w;for(u=e;ur&&(l>a&&(a=l,s=h,o=u),l=0,h=u-i)),d=g,_=x,y=w),f=S,m=E}return l+=g,l>a?[h,u]:[s,o]}const Il={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class _R extends Ma{constructor(t,e,n,i){super(t,e,n,i),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[tr]={fillStyle:tr},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,n){const i=this.textFillState_,s=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!i&&!s)return;const a=this.coordinates;let l=a.length;const h=t.getType();let c=null,u=t.getStride();if(o.placement==="line"&&(h=="LineString"||h=="MultiLineString"||h=="Polygon"||h=="MultiPolygon")){if(!$t(this.maxExtent,t.getExtent()))return;let d;if(c=t.getFlatCoordinates(),h=="LineString")d=[c.length];else if(h=="MultiLineString")d=t.getEnds();else if(h=="Polygon")d=t.getEnds().slice(0,1);else if(h=="MultiPolygon"){const _=t.getEndss();d=[];for(let y=0,x=_.length;y{const E=a[(x+S)*2]===c[S*u]&&a[(x+S)*2+1]===c[S*u+1];return E||--x,E})}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&this.updateFillStyle(this.state,this.createFill),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,n);let f=o.padding;if(f!=Mi&&(o.scale[0]<0||o.scale[1]<0)){let x=o.padding[0],w=o.padding[1],S=o.padding[2],E=o.padding[3];o.scale[0]<0&&(w=-w,E=-E),o.scale[1]<0&&(x=-x,S=-S),f=[x,w,S,E]}const m=this.pixelRatio;this.instructions.push([ht.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,f==Mi?Mi:f.map(function(x){return x*m}),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const _=1/m,y=this.state.fillStyle;o.backgroundFill&&(this.state.fillStyle=tr,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([ht.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterMode_,this.declutterImageWithText_,f,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?tr:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),o.backgroundFill&&(this.state.fillStyle=y,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,i=this.strokeKey_;t&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:e.font,textAlign:e.textAlign||$o,justify:e.justify,textBaseline:e.textBaseline||vl,scale:e.scale});const o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,i=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,h=Il[i.textBaseline],c=this.textOffsetY_*l,u=this.text_,d=n?n.lineWidth*Math.abs(i.scale[0])/2:0;this.instructions.push([ht.DRAW_CHARS,t,e,h,i.overflow,a,i.maxAngle,l,c,s,d*l,u,o,1,this.declutterMode_]),this.hitDetectionInstructions.push([ht.DRAW_CHARS,t,e,h,i.overflow,a&&tr,i.maxAngle,l,c,s,d*l,u,o,1/l,this.declutterMode_])}setTextStyle(t,e){let n,i,s;if(!t)this.text_="";else{const o=t.getFill();o?(i=this.textFillState_,i||(i={},this.textFillState_=i),i.fillStyle=Kr(o.getColor()||tr)):(i=null,this.textFillState_=i);const a=t.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const f=a.getLineDash(),m=a.getLineDashOffset(),_=a.getWidth(),y=a.getMiterLimit();s.lineCap=a.getLineCap()||Ds,s.lineDash=f?f.slice():Mn,s.lineDashOffset=m===void 0?Rn:m,s.lineJoin=a.getLineJoin()||ks,s.lineWidth=_===void 0?Vo:_,s.miterLimit=y===void 0?Zo:y,s.strokeStyle=Kr(a.getColor()||Yo)}n=this.textState_;const l=t.getFont()||Vm;Hw(l);const h=t.getScaleArray();n.overflow=t.getOverflow(),n.font=l,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||vl,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Mi,n.scale=h===void 0?[1,1]:h;const c=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textRotation_=g===void 0?0:g,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:tt(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=i&&i.fillStyle?typeof i.fillStyle=="string"?i.fillStyle:"|"+tt(i.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const yR={Circle:Vf,Default:Ma,Image:uR,LineString:gR,Polygon:Vf,Text:_R};class K0{constructor(t,e,n,i){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=i,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const i in n){const s=n[i].finish();t[e][i]=s}}return t}getBuilder(t,e){const n=t!==void 0?t.toString():"0";let i=this.buildersByZIndex_[n];i===void 0&&(i={},this.buildersByZIndex_[n]=i);let s=i[e];if(s===void 0){const o=yR[e];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[e]=s}return s}}class J0 extends ca{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t}getFeatures(t){return at()}getData(t){return null}prepareFrame(t){return at()}renderFrame(t,e){return at()}loadedTileCallback(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n}createLoadedTileFinder(t,e,n){return(i,s)=>{const o=this.loadedTileCallback.bind(this,n,i);return t.forEachLoadedTile(e,i,s,o)}}forEachFeatureAtCoordinate(t,e,n,i,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===J.LOADED||e.getState()===J.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=J.LOADED&&e!=J.ERROR&&t.addEventListener(Ct.CHANGE,this.boundHandleImageChange_),e==J.IDLE&&(t.load(),e=t.getState()),e==J.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class sl extends ln{constructor(t,e,n,i){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=i}}class wd{constructor(){gu(this,"pushMethodArgs_",(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this)),this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(xl(),{get:(t,e)=>{if(typeof xl()[e]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,n)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,n),!0)})}pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,i=e.length;nM[2]}else F=S>A;const z=Math.PI,p=[],v=T+n===t;t=T,_=0,y=R,d=r[t],g=r[t+1];let b;if(v){x(),b=Math.atan2(g-m,d-f),F&&(b+=b>0?-z:z);const M=(A+S)/2,L=(k+E)/2;return p[0]=[M,L,(C-s)/2,b,i],p}i=i.replace(/\n/g," ");for(let M=0,L=i.length;M0?-z:z),b!==void 0){let X=D-b;if(X+=X>z?-2*z:X<-z?2*z:0,Math.abs(X)>o)return null}b=D;const j=M;let G=0;for(;M0&&r.push(` +`,""),r.push(t,""),r}class SR{constructor(t,e,n,i,s){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=ue(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=s?new wd:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,n,i){const s=t+e+n+i;if(this.labels_[s])return this.labels_[s];const o=i?this.strokeStates[i]:null,a=n?this.fillStates[n]:null,l=this.textStates[e],h=this.pixelRatio,c=[l.scale[0]*h,l.scale[1]*h],u=Array.isArray(t),d=l.justify?Il[l.justify]:ic(Array.isArray(t)?t[0]:t,l.textAlign||$o),g=i&&o.lineWidth?o.lineWidth:0,f=u?t:t.split(` +`).reduce(wR,[]),{width:m,height:_,widths:y,heights:x,lineWidths:w}=Jw(l,f),S=m+g,E=[],T=(S+2)*c[0],R=(_+g)*c[1],C={width:T<0?Math.floor(T):Math.ceil(T),height:R<0?Math.floor(R):Math.ceil(R),contextInstructions:E};(c[0]!=1||c[1]!=1)&&E.push("scale",c),i&&(E.push("strokeStyle",o.strokeStyle),E.push("lineWidth",g),E.push("lineCap",o.lineCap),E.push("lineJoin",o.lineJoin),E.push("miterLimit",o.miterLimit),E.push("setLineDash",[o.lineDash]),E.push("lineDashOffset",o.lineDashOffset)),n&&E.push("fillStyle",a.fillStyle),E.push("textBaseline","middle"),E.push("textAlign","center");const A=.5-d;let k=d*S+A*g;const F=[],z=[];let p=0,v=0,b=0,M=0,L;for(let D=0,j=f.length;Dt?t-h:s,S=o+c>e?e-c:o,E=f[3]+w*d[0]+f[1],T=f[0]+S*d[1]+f[2],R=y-f[3],C=x-f[0];(m||u!==0)&&(Zn[0]=R,Yn[0]=R,Zn[1]=C,mn[1]=C,mn[0]=R+E,_n[0]=mn[0],_n[1]=C+T,Yn[1]=_n[1]);let A;return u!==0?(A=Tr(ue(),n,i,1,1,u,-n,-i),le(A,Zn),le(A,mn),le(A,_n),le(A,Yn),Gr(Math.min(Zn[0],mn[0],_n[0],Yn[0]),Math.min(Zn[1],mn[1],_n[1],Yn[1]),Math.max(Zn[0],mn[0],_n[0],Yn[0]),Math.max(Zn[1],mn[1],_n[1],Yn[1]),ts)):Gr(Math.min(R,R+E),Math.min(C,C+T),Math.max(R,R+E),Math.max(C,C+T),ts),g&&(y=Math.round(y),x=Math.round(x)),{drawImageX:y,drawImageY:x,drawImageW:w,drawImageH:S,originX:h,originY:c,declutterBox:{minX:ts[0],minY:ts[1],maxX:ts[2],maxY:ts[3],value:_},canvasTransform:A,scale:d}}replayImageOrLabel_(t,e,n,i,s,o,a){const l=!!(o||a),h=i.declutterBox,c=a?a[2]*i.scale[0]/2:0;return h.minX-c<=e[0]&&h.maxX+c>=0&&h.minY-c<=e[1]&&h.maxY+c>=0&&(l&&this.replayTextBackground_(t,Zn,mn,_n,Yn,o,a),Qw(t,i.canvasTransform,s,n,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const n=le(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(n[0]%i,n[1]%i),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,n,i){const s=this.textStates[e],o=this.createLabel(t,e,i,n),a=this.strokeStates[n],l=this.pixelRatio,h=ic(Array.isArray(t)?t[0]:t,s.textAlign||$o),c=Il[s.textBaseline||vl],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*s.scale[0],g=h*d+2*(.5-h)*u,f=c*o.height/l+2*(.5-c)*u;return{label:o,anchorX:g,anchorY:f}}execute_(t,e,n,i,s,o,a,l){const h=this.zIndexContext_;let c;this.pixelCoordinates_&&Bi(n,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=ii(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Y1(this.renderedTransform_,n));let u=0;const d=i.length;let g=0,f,m,_,y,x,w,S,E,T,R,C,A,k,F=0,z=0,p=null,v=null;const b=this.coordinateCache_,M=this.viewRotation_,L=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,D={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:M},j=this.instructions!=i||this.overlaps?0:200;let G,W,$,st;for(;uj&&(this.fill_(t),F=0),z>j&&(t.stroke(),z=0),!F&&!z&&(t.beginPath(),x=NaN,w=NaN),++u;break;case ht.CIRCLE:g=X[1];const lt=c[g],ct=c[g+1],gt=c[g+2],qt=c[g+3],Lt=gt-lt,Ut=qt-ct,Qt=Math.sqrt(Lt*Lt+Ut*Ut);t.moveTo(lt+Qt,ct),t.arc(lt,ct,Qt,0,2*Math.PI,!0),++u;break;case ht.CLOSE_PATH:t.closePath(),++u;break;case ht.CUSTOM:g=X[1],f=X[2];const me=X[3],de=X[4],Ve=X[5];D.geometry=me,D.feature=G,u in b||(b[u]=[]);const Oe=b[u];Ve?Ve(c,g,f,2,Oe):(Oe[0]=c[g],Oe[1]=c[g+1],Oe.length=2),h&&(h.zIndex=X[6]),de(Oe,D),++u;break;case ht.DRAW_IMAGE:g=X[1],f=X[2],T=X[3],m=X[4],_=X[5];let cn=X[6];const ka=X[7],jh=X[8],Cr=X[9],pr=X[10];let un=X[11];const mi=X[12];let _i=X[13];y=X[14]||"declutter";const Un=X[15];if(!T&&X.length>=20){R=X[19],C=X[20],A=X[21],k=X[22];const mr=this.drawLabelWithPointPlacement_(R,C,A,k);T=mr.label,X[3]=T;const xi=X[23];m=(mr.anchorX-xi)*this.pixelRatio,X[4]=m;const _r=X[24];_=(mr.anchorY-_r)*this.pixelRatio,X[5]=_,cn=T.height,X[6]=cn,_i=T.width,X[13]=_i}let yi;X.length>25&&(yi=X[25]);let Bn,Hi,Re;X.length>17?(Bn=X[16],Hi=X[17],Re=X[18]):(Bn=Mi,Hi=!1,Re=!1),pr&&L?un+=M:!pr&&!L&&(un-=M);let S1=0;for(;g!Pl.includes(r));class Q0{constructor(t,e,n,i,s,o,a){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=ue(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,a)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,e){for(const n in t){let i=this.executorsByZIndex_[n];i===void 0&&(i={},this.executorsByZIndex_[n]=i);const s=t[n];for(const o in s){const a=s[o];i[o]=new SR(this.resolution_,this.pixelRatio_,this.overlaps_,a,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let i=0,s=t.length;i0){if(!o||R==="none"||g!=="Image"&&g!=="Text"||o.includes(E)){const F=(d[A]-3)/4,z=i-F%a,p=i-(F/a|0),v=s(E,T,z*z+p*p);if(v)return v}c.clearRect(0,0,a,a);break}}const m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(tn);let _,y,x,w,S;for(_=m.length-1;_>=0;--_){const E=m[_].toString();for(x=this.executorsByZIndex_[E],y=_s.length-1;y>=0;--y)if(g=_s[y],w=x[g],w!==void 0&&(S=w.executeHitDetection(c,l,n,f,u),S))return S}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const n=e[0],i=e[1],s=e[2],o=e[3],a=[n,i,n,o,s,o,s,i];return ii(a,0,8,2,t,a),a}isEmpty(){return In(this.executorsByZIndex_)}execute(t,e,n,i,s,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(tn),o=o||_s;const h=_s.length;let c,u,d,g,f;for(a&&l.reverse(),c=0,u=l.length;cy.execute(E,e,n,i,s,a)),S&&w.restore(),x){x.offset();const E=l[c]*h+d;this.deferredZIndexContexts_[E]||(this.deferredZIndexContexts_[E]=[]),this.deferredZIndexContexts_[E].push(x)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(tn);for(let n=0,i=e.length;n{s.draw(this.renderedContext_),s.clear()}),t[e[n]].length=0}}const sc={};function bR(r){if(sc[r]!==void 0)return sc[r];const t=r*2+1,e=r*r,n=new Array(e+1);for(let s=0;s<=r;++s)for(let o=0;o<=r;++o){const a=s*s+o*o;if(a>e)break;let l=n[a];l||(l=[],n[a]=l),l.push(((r+s)*t+(r+o))*4+3),s>0&&l.push(((r-s)*t+(r+o))*4+3),o>0&&(l.push(((r+s)*t+(r-o))*4+3),s>0&&l.push(((r-s)*t+(r-o))*4+3))}const i=[];for(let s=0,o=n.length;su*this.pixelRatio_),lineDashOffset:(o||Rn)*this.pixelRatio_,lineJoin:a!==void 0?a:ks,lineWidth:(l!==void 0?l:Vo)*this.pixelRatio_,miterLimit:h!==void 0?h:Zo,strokeStyle:Kr(n||Yo)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const n=t.getPixelRatio(this.pixelRatio_),i=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*n,this.imageAnchorY_=i[1]*n,this.imageHeight_=e[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/n,o[1]*this.pixelRatio_/n],this.imageWidth_=e[0]*n}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const g=e.getColor();this.textFillState_={fillStyle:Kr(g||tr)}}const n=t.getStroke();if(!n)this.textStrokeState_=null;else{const g=n.getColor(),f=n.getLineCap(),m=n.getLineDash(),_=n.getLineDashOffset(),y=n.getLineJoin(),x=n.getWidth(),w=n.getMiterLimit();this.textStrokeState_={lineCap:f!==void 0?f:Ds,lineDash:m||Mn,lineDashOffset:_||Rn,lineJoin:y!==void 0?y:ks,lineWidth:x!==void 0?x:Vo,miterLimit:w!==void 0?w:Zo,strokeStyle:Kr(g||Yo)}}const i=t.getFont(),s=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),h=t.getScaleArray(),c=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:i!==void 0?i:Vm,textAlign:u!==void 0?u:$o,textBaseline:d!==void 0?d:vl},this.text_=c!==void 0?Array.isArray(c)?c.reduce((g,f,m)=>g+=m%2?" ":f,""):c:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}}}const t_=TR,ur=.5;function e_(r,t,e,n,i,s,o,a,l){const h=l?th(i):i,c=r[0]*ur,u=r[1]*ur,d=Vt(c,u);d.imageSmoothingEnabled=!1;const g=d.canvas,f=new t_(d,ur,i,null,o,a,l?qi(Ex(),l):null),m=e.length,_=Math.floor((256*256*256-1)/m),y={};for(let w=1;w<=m;++w){const S=e[w-1],E=S.getStyleFunction()||n;if(!E)continue;let T=E(S,s);if(!T)continue;Array.isArray(T)||(T=[T]);const R=(w*_).toString(16).padStart(7,"#00000");for(let C=0,A=T.length;C0;return u&&Promise.all(l).then(()=>i(null)),IR(r,t,e,n,s,o,a),u}function IR(r,t,e,n,i,s,o){const a=e.getGeometryFunction()(t);if(!a)return;const l=a.simplifyTransformed(n,i);if(e.getRenderer())s_(r,l,e,t,o);else{const h=n_[l.getType()];h(r,l,e,t,o,s)}}function s_(r,t,e,n,i){if(t.getType()=="GeometryCollection"){const s=t.getGeometries();for(let o=0,a=s.length;o{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const n=this.frameState.size.slice(),i=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,h=this.getLayer(),c=[],u=n[0]*ur,d=n[1]*ur;c.push(this.getRenderTransform(i,s,o,ur,u,d,0).slice());const g=h.getSource(),f=a.getExtent();if(g.getWrapX()&&a.canWrapX()&&!We(f,l)){let m=l[0];const _=pt(f);let y=0,x;for(;mf[2];)++y,x=_*y,c.push(this.getRenderTransform(i,s,o,ur,u,d,x).slice()),m-=_}this.hitDetectionImageData_=e_(n,c,this.renderedFeatures_,h.getStyleFunction(),l,s,o,Al(s,this.renderedPixelRatio_),null)}e(r_(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,i,s){if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),h={},c=function(f,m,_){const y=tt(f),x=h[y];if(x){if(x!==!0&&_u=f.forEachFeatureAtCoordinate(t,o,a,n,c,g&&e.declutter[g]?e.declutter[g].all().map(m=>m.value):null)),u}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),n=e.getSource();if(!n)return!1;const i=t.viewHints[Kt.ANIMATING],s=t.viewHints[Kt.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&i||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=t.extent,h=t.viewState,c=h.projection,u=h.resolution,d=t.pixelRatio,g=e.getRevision(),f=e.getRenderBuffer();let m=e.getRenderOrder();m===void 0&&(m=RR);const _=h.center.slice(),y=br(l,f*u),x=y.slice(),w=[y.slice()],S=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!We(S,t.extent)){const v=pt(S),b=Math.max(pt(y)/2,v);y[0]=S[0]-b,y[2]=S[2]+b,_m(_,c);const M=Su(w[0],c);M[0]S[0]&&M[2]>S[2]&&w.push([M[0]-v,M[1],M[2]-v,M[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==g&&this.renderedRenderOrder_==m&&this.renderedFrameDeclutter_===!!t.declutter&&We(this.wrappedRenderedExtent_,y))return Bi(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const E=new K0(i_(u,d),y,u,d);let T;for(let v=0,b=w.length;v{let M;const L=v.getStyleFunction()||e.getStyleFunction();if(L&&(M=L(v,u)),M){const D=this.renderFeature(v,R,M,E,T,this.getLayer().getDeclutter(),b);C=C&&!D}},k=th(y),F=n.getFeaturesInExtent(k);m&&F.sort(m);for(let v=0,b=F.length;v=200&&a.status<300){const h=t.getType();try{let c;h=="text"||h=="json"?c=a.responseText:h=="xml"?c=a.responseXML||a.responseText:h=="arraybuffer"&&(c=a.response),c?s(t.readFeatures(c,{extent:e,featureProjection:i}),t.readProjection(c)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function ep(r,t){return function(e,n,i,s,o){const a=this;a_(r,t,e,n,i,function(l,h){a.addFeatures(l),s!==void 0&&s(l)},o||zo)}}class $n extends ln{constructor(t,e,n){super(t),this.feature=e,this.features=n}}class wh extends Qs{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=zo,this.format_=t.format,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(Rt(this.format_,"`format` must be set when `url` is set"),this.loader_=ep(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:GR;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new Qf:null,this.loadedExtentsRtree_=new Qf,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,i;Array.isArray(t.features)?i=t.features:t.features&&(n=t.features,i=n.getArray()),!e&&n===void 0&&(n=new Ml(i)),i!==void 0&&this.addFeaturesInternal(i),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=tt(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const n=t.getGeometry();if(n){const i=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new $n(Ne.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof ke||(this.featureChangeKeys_[t]=[ie(e,Ct.CHANGE,this.handleFeatureChange_,this),ie(e,fu.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let n=!0;if(e.getId()!==void 0){const i=String(e.getId());if(!(i in this.idIndex_))this.idIndex_[i]=e;else if(e instanceof ke){const s=this.idIndex_[i];s instanceof ke?Array.isArray(s)?s.push(e):this.idIndex_[i]=[s,e]:n=!1}else n=!1}return n&&(Rt(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],n=[],i=[];for(let s=0,o=t.length;s{e||(e=!0,this.addFeature(n.element),e=!1)}),t.addEventListener(ti.REMOVE,n=>{e||(e=!0,this.removeFeature(n.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach(ye);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const n=i=>{this.removeFeatureInternal(i)};this.featuresRtree_.forEach(n);for(const i in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new $n(Ne.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(i){const s=i.getGeometry();if(s instanceof ke||s.intersectsCoordinate(t))return e(i)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(n){const i=n.getGeometry();if(i instanceof ke||i.intersectsExtent(t)){const s=e(n);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),In(this.nullGeometryFeatures_)||It(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){e.push(n)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const n=Eu(t,e);return[].concat(...n.map(i=>this.featuresRtree_.getInExtent(i)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const n=t[0],i=t[1];let s=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return e=e||X1,this.featuresRtree_.forEachInExtent(l,function(h){if(e(h)){const c=h.getGeometry(),u=a;if(a=c instanceof ke?0:c.closestPointXY(n,i,o,a),a{--this.loadingExtentsCount_,this.dispatchEvent(new $n(Ne.FEATURESLOADEND,void 0,h))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new $n(Ne.FEATURESLOADERROR))}),i.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let n;e.forEachInExtent(t,function(i){if(Pn(i.extent,t))return n=i,!0}),n&&e.remove(n)}removeFeatures(t){const e=[];for(let n=0,i=t.length;n0&&this.changed()}removeFeature(t){t&&this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=tt(t);if(!(e in this.uidIndex_))return;e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);const n=this.featureChangeKeys_[e];n?.forEach(ye),delete this.featureChangeKeys_[e];const i=t.getId();if(i!==void 0){const s=i.toString(),o=this.idIndex_[s];o===t?delete this.idIndex_[s]:Array.isArray(o)&&(o.splice(o.indexOf(t),1),o.length===1&&(this.idIndex_[s]=o[0]))}return delete this.uidIndex_[e],this.hasListener(Ne.REMOVEFEATURE)&&this.dispatchEvent(new $n(Ne.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const n in this.idIndex_){const i=this.idIndex_[n];if(t instanceof ke&&Array.isArray(i)&&i.includes(t))i.splice(i.indexOf(t),1);else if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}}return e}setLoader(t){this.loader_=t}setUrl(t){Rt(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(ep(t,this.format_))}}function zR(r){if(!(r.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");const t=r.inversePixelTransform[0],e=r.inversePixelTransform[1],n=Math.sqrt(t*t+e*e),i=r.frameState,s=Zs(r.inversePixelTransform.slice(),i.coordinateToPixelTransform),o=Al(i.viewState.resolution,n);let a;return new t_(r.context,n,i.extent,s,i.viewState.rotation,o,a)}function l_(r,t,e){const n=[];let i=r(0),s=r(1),o=t(i),a=t(s);const l=[s,i],h=[a,o],c=[1,0],u={};let d=1e5,g,f,m,_,y,x;for(;--d>0&&c.length>0;)m=c.pop(),i=l.pop(),o=h.pop(),x=m.toString(),x in u||(n.push(o[0],o[1]),u[x]=!0),_=c.pop(),s=l.pop(),a=h.pop(),y=(m+_)/2,g=r(y),f=t(g),pm(f[0],f[1],o[0],o[1],a[0],a[1]){const i=n.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(i),this.lonLabelStyleBase_},this.latLabelStyleBase_=new Ze({text:t.latLabelStyle!==void 0?t.latLabelStyle.clone():new ki({font:"12px Calibri,sans-serif",textAlign:"right",fill:new zr({color:"rgba(0,0,0,1)"}),stroke:new sn({color:"rgba(255,255,255,1)",width:3})})}),this.latLabelStyle_=n=>{const i=n.get("graticule_label");return this.latLabelStyleBase_.getText().setText(i),this.latLabelStyleBase_},this.meridiansLabels_=[],this.parallelsLabels_=[],this.addEventListener(er.POSTRENDER,this.drawLabels_.bind(this))),this.intervals_=t.intervals!==void 0?t.intervals:WR,this.setSource(new wh({loader:this.loaderFunction.bind(this),strategy:this.strategyFunction.bind(this),features:new Ml,overlaps:!1,useSpatialIndex:!1,wrapX:t.wrapX})),this.featurePool_=[],this.lineStyle_=new Ze({stroke:this.strokeStyle_}),this.loadedExtent_=null,this.renderedExtent_=null,this.renderedResolution_=null,this.setRenderOrder(null)}strategyFunction(t,e){let n=t.slice();return this.projection_&&this.getSource().getWrapX()&&Su(n,this.projection_),this.loadedExtent_&&(Q1(this.loadedExtent_,n,e)?n=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[n]}loaderFunction(t,e,n){this.loadedExtent_=t;const i=this.getSource(),s=this.getExtent()||[-1/0,-1/0,1/0,1/0],o=fe(s,t);if(this.renderedExtent_&&Pn(this.renderedExtent_,o)&&this.renderedResolution_===e||(this.renderedExtent_=o,this.renderedResolution_=e,Dn(o)))return;const a=be(o),l=e*e/4;(!this.projection_||!Ie(this.projection_,n))&&this.updateProjectionInfo_(n),this.createGraticule_(o,a,e,l);let h=this.meridians_.length+this.parallels_.length;this.meridiansLabels_&&(h+=this.meridians_.length),this.parallelsLabels_&&(h+=this.parallels_.length);let c;for(;h>this.featurePool_.length;)c=new ve,this.featurePool_.push(c);const u=i.getFeaturesCollection();u.clear();let d=0,g,f;for(g=0,f=this.meridians_.length;gMath.PI/2;c=c!==f}const g=zR(t);for(let f=l;f<=h;++f){let m=this.meridians_.length+this.parallels_.length,_,y,x,w;if(this.meridiansLabels_)for(y=0,x=this.meridiansLabels_.length;y=l?(t[0]=a[0],t[2]=a[2]):o=!0);const h=[xt(e[0],this.minX_,this.maxX_),xt(e[1],this.minY_,this.maxY_)],c=this.toLonLatTransform_(h);isNaN(c[1])&&(c[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);let u=xt(c[0],this.minLon_,this.maxLon_),d=xt(c[1],this.minLat_,this.maxLat_);const g=this.maxLines_;let f,m,_,y,x=t;o||(x=[xt(t[0],this.minX_,this.maxX_),xt(t[1],this.minY_,this.maxY_),xt(t[2],this.minX_,this.maxX_),xt(t[3],this.minY_,this.maxY_)]);const w=Ls(x,this.toLonLatTransform_,void 0,8);let S=w[3],E=w[2],T=w[1],R=w[0];if(o||(gr(x,this.bottomLeft_)&&(R=this.minLon_,T=this.minLat_),gr(x,this.bottomRight_)&&(E=this.maxLon_,T=this.minLat_),gr(x,this.topLeft_)&&(R=this.minLon_,S=this.maxLat_),gr(x,this.topRight_)&&(E=this.maxLon_,S=this.maxLat_),S=xt(S,d,this.maxLat_),E=xt(E,u,this.maxLon_),T=xt(T,this.minLat_,d),R=xt(R,this.minLon_,u)),u=Math.floor(u/s)*s,y=xt(u,this.minLon_,this.maxLon_),m=this.addMeridian_(y,T,S,i,t,0),f=0,o)for(;(y-=s)>=R&&f++i[o]&&(s=o,o=1);const a=Math.max(e[1],i[s]),l=Math.min(e[3],i[o]),h=xt(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,a,l),c=[i[s-1]+(i[o-1]-i[s-1])*(h-i[s])/(i[o]-i[s]),h],u=this.meridiansLabels_[n].geom;return u.setCoordinates(c),u}getMeridians(){return this.meridians_}getParallel_(t,e,n,i,s){const o=BR(t,e,n,this.projection_,i);let a=this.parallels_[s];return a?(a.setFlatCoordinates("XY",o),a.changed()):a=new pe(o,"XY"),a}getParallelPoint_(t,e,n){const i=t.getFlatCoordinates();let s=0,o=i.length-2;i[s]>i[o]&&(s=o,o=0);const a=Math.max(e[0],i[s]),l=Math.min(e[2],i[o]),h=xt(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,a,l),c=i[s+1]+(i[o+1]-i[s+1])*(h-i[s])/(i[o]-i[s]),u=[h,c],d=this.parallelsLabels_[n].geom;return d.setCoordinates(u),d}getParallels(){return this.parallels_}updateProjectionInfo_(t){const e=K("EPSG:4326"),n=t.getWorldExtent();this.maxLat_=n[3],this.maxLon_=n[2],this.minLat_=n[1],this.minLon_=n[0];const i=nn(t,e);if(this.minLon_=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t}}const ZR=qR;class es extends ln{constructor(t,e){super(t),this.layer=e}}const oc={LAYERS:"layers"};class Sh extends j0{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let n=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(oc.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new Ml(n.slice(),{unique:!0}):Rt(typeof n.getArray=="function","Expected `layers` to be an array or a `Collection`"):n=new Ml(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(ye),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(ie(t,ti.ADD,this.handleLayersAdd_,this),ie(t,ti.REMOVE,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(ye);qs(this.listenerKeys_);const e=t.getArray();for(let n=0,i=e.length;n{this.uniforms_.push({value:t.uniforms[o],location:e.getUniformLocation(this.renderTargetProgram_,o)})})}getGL(){return this.gl_}init(t){const e=this.getGL(),n=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),e.viewport(0,0,n[0],n[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==n[0]||this.renderTargetTextureSize_[1]!==n[1]){this.renderTargetTextureSize_=n;const i=0,s=e.RGBA,o=0,a=e.RGBA,l=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,i,s,n[0],n[1],o,a,l,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n[0],n[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}apply(t,e,n,i){const s=this.getGL(),o=t.size;if(s.bindFramebuffer(s.FRAMEBUFFER,e?e.getFrameBuffer():null),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.renderTargetTexture_),!e){const l=tt(s.canvas);if(!t.renderTargets[l]){const h=s.getContextAttributes();h&&h.preserveDrawingBuffer&&(s.clearColor(0,0,0,0),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT)),t.renderTargets[l]=!0}}s.disable(s.DEPTH_TEST),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.viewport(0,0,s.drawingBufferWidth,s.drawingBufferHeight),s.bindBuffer(s.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),s.useProgram(this.renderTargetProgram_),s.enableVertexAttribArray(this.renderTargetAttribLocation_),s.vertexAttribPointer(this.renderTargetAttribLocation_,2,s.FLOAT,!1,0,0),s.uniform2f(this.renderTargetUniformLocation_,o[0],o[1]),s.uniform1i(this.renderTargetTextureLocation_,0);const a=t.layerStatesArray[t.layerIndex].opacity;s.uniform1f(this.renderTargetOpacityLocation_,a),this.applyUniforms(t),n&&n(s,t),s.drawArrays(s.TRIANGLES,0,6),i&&i(s,t)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(t){const e=this.getGL();let n,i=1;this.uniforms_.forEach(function(s){if(n=typeof s.value=="function"?s.value(t):s.value,n instanceof HTMLCanvasElement||n instanceof ImageData)s.texture||(s.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${i}`]),e.bindTexture(e.TEXTURE_2D,s.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,n.width,n.height,0,e.UNSIGNED_BYTE,new Uint8Array(n.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n),e.uniform1i(s.location,i++);else if(Array.isArray(n))switch(n.length){case 2:e.uniform2f(s.location,n[0],n[1]);return;case 3:e.uniform3f(s.location,n[0],n[1],n[2]);return;case 4:e.uniform4f(s.location,n[0],n[1],n[2],n[3]);return;default:return}else typeof n=="number"&&e.uniform1f(s.location,n)})}}function c_(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function u_(r,t){return r[0]=t[0],r[1]=t[1],r[4]=t[2],r[5]=t[3],r[12]=t[4],r[13]=t[5],r}const xn={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},Vr={UNSIGNED_BYTE:$R,UNSIGNED_SHORT:VR,UNSIGNED_INT:HR,FLOAT:h_},Fl={};function ip(r){return"shared/"+r}let sp=0;function eC(){const r="unique/"+sp;return sp+=1,r}function rC(r){let t=Fl[r];if(!t){const e=document.createElement("canvas");e.width=1,e.height=1,e.style.position="absolute",e.style.left="0",t={users:0,context:KR(e)},Fl[r]=t}return t.users+=1,t.context}function nC(r){const t=Fl[r];if(!t||(t.users-=1,t.users>0))return;const e=t.context,n=e.getExtension("WEBGL_lose_context");n&&n.loseContext();const i=e.canvas;i.width=1,i.height=1,delete Fl[r]}class iC extends pu{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?ip(t.canvasCacheKey):eC(),this.gl_=rC(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(Ka.LOST,this.boundHandleWebGLContextLost_),e.addEventListener(Ka.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=ue(),this.offsetScaleMatrix_=ue(),this.tmpMat4_=c_(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map(n=>new np({webGlContext:this.gl_,scaleRatio:n.scaleRatio,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,uniforms:n.uniforms})):[new np({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===ip(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.gl_,n=tt(t);let i=this.bufferCache_[n];if(!i){const s=e.createBuffer();i={buffer:t,webGlBuffer:s},this.bufferCache_[n]=i}e.bindBuffer(t.getType(),i.webGlBuffer)}flushBufferData(t){const e=this.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=this.gl_,n=tt(t),i=this.bufferCache_[n];i&&!e.isContextLost()&&e.deleteBuffer(i.webGlBuffer),delete this.bufferCache_[n]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(Ka.LOST,this.boundHandleWebGLContextLost_),t.removeEventListener(Ka.RESTORED,this.boundHandleWebGLContextRestored_),nC(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,n){const i=this.gl_,s=this.getCanvas(),o=t.size,a=t.pixelRatio;(s.width!==o[0]*a||s.height!==o[1]*a)&&(s.width=o[0]*a,s.height=o[1]*a,s.style.width=o[0]+"px",s.style.height=o[1]+"px");for(let l=this.postProcessPasses_.length-1;l>=0;l--)this.postProcessPasses_[l].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.depthRange(0,1),i.clearDepth(1),i.clear(i.COLOR_BUFFER_BIT|i.DEPTH_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,e?i.ZERO:i.ONE_MINUS_SRC_ALPHA),n?(i.enable(i.DEPTH_TEST),i.depthFunc(i.LEQUAL)):i.disable(i.DEPTH_TEST)}bindTexture(t,e,n){const i=this.gl_;i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),i.uniform1i(this.getUniformLocation(n),e)}prepareDrawToRenderTarget(t,e,n,i){const s=this.gl_,o=e.getSize();s.bindFramebuffer(s.FRAMEBUFFER,e.getFramebuffer()),s.bindRenderbuffer(s.RENDERBUFFER,e.getDepthbuffer()),s.viewport(0,0,o[0],o[1]),s.bindTexture(s.TEXTURE_2D,e.getTexture()),s.clearColor(0,0,0,0),s.depthRange(0,1),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.enable(s.BLEND),s.blendFunc(s.ONE,n?s.ZERO:s.ONE_MINUS_SRC_ALPHA),i?(s.enable(s.DEPTH_TEST),s.depthFunc(s.LEQUAL)):s.disable(s.DEPTH_TEST)}drawElements(t,e){const n=this.gl_;this.getExtension("OES_element_index_uint");const i=n.UNSIGNED_INT,s=4,o=e-t,a=t*s;n.drawElements(n.TRIANGLES,o,i,a)}finalizeDraw(t,e,n){for(let i=0,s=this.postProcessPasses_.length;i{if(n=typeof s.value=="function"?s.value(t):s.value,n instanceof HTMLCanvasElement||n instanceof HTMLImageElement||n instanceof ImageData||n instanceof WebGLTexture){n instanceof WebGLTexture&&!s.texture?(s.prevValue=void 0,s.texture=n):s.texture||(s.prevValue=void 0,s.texture=e.createTexture()),this.bindTexture(s.texture,i,s.name),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);const o=!(n instanceof HTMLImageElement)||n.complete;!(n instanceof WebGLTexture)&&o&&s.prevValue!==n&&(s.prevValue=n,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),i++}else if(Array.isArray(n)&&n.length===6)this.setUniformMatrixValue(s.name,u_(this.tmpMat4_,n));else if(Array.isArray(n)&&n.length<=4)switch(n.length){case 2:e.uniform2f(this.getUniformLocation(s.name),n[0],n[1]);return;case 3:e.uniform3f(this.getUniformLocation(s.name),n[0],n[1],n[2]);return;case 4:e.uniform4f(this.getUniformLocation(s.name),n[0],n[1],n[2],n[3]);return;default:return}else typeof n=="number"&&e.uniform1f(this.getUniformLocation(s.name),n)})}useProgram(t,e){this.gl_.useProgram(t),this.currentProgram_=t,this.applyFrameState(e),this.applyUniforms(e)}compileShader(t,e){const n=this.gl_,i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}getProgram(t,e){const n=this.gl_,i=this.compileShader(t,n.FRAGMENT_SHADER),s=this.compileShader(e,n.VERTEX_SHADER),o=n.createProgram();if(n.attachShader(o,i),n.attachShader(o,s),n.linkProgram(o),!n.getShaderParameter(i,n.COMPILE_STATUS)){const a=`Fragment shader compilation failed: ${n.getShaderInfoLog(i)}`;throw new Error(a)}if(n.deleteShader(i),!n.getShaderParameter(s,n.COMPILE_STATUS)){const a=`Vertex shader compilation failed: ${n.getShaderInfoLog(s)}`;throw new Error(a)}if(n.deleteShader(s),!n.getProgramParameter(o,n.LINK_STATUS)){const a=`GL program linking failed: ${n.getProgramInfoLog(o)}`;throw new Error(a)}return o}getUniformLocation(t){const e=tt(this.currentProgram_);return this.uniformLocationsByProgram_[e]===void 0&&(this.uniformLocationsByProgram_[e]={}),this.uniformLocationsByProgram_[e][t]===void 0&&(this.uniformLocationsByProgram_[e][t]=this.gl_.getUniformLocation(this.currentProgram_,t)),this.uniformLocationsByProgram_[e][t]}getAttributeLocation(t){const e=tt(this.currentProgram_);return this.attribLocationsByProgram_[e]===void 0&&(this.attribLocationsByProgram_[e]={}),this.attribLocationsByProgram_[e][t]===void 0&&(this.attribLocationsByProgram_[e][t]=this.gl_.getAttribLocation(this.currentProgram_,t)),this.attribLocationsByProgram_[e][t]}makeProjectionTransform(t,e){const n=t.size,i=t.viewState.rotation,s=t.viewState.resolution,o=t.viewState.center;return Tr(e,0,0,2/(s*n[0]),2/(s*n[1]),-i,-o[0],-o[1]),e}setUniformFloatValue(t,e){this.gl_.uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.gl_.uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.gl_.uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.gl_.uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,n,i,s){const o=this.getAttributeLocation(t);o<0||(this.gl_.enableVertexAttribArray(o),this.gl_.vertexAttribPointer(o,e,n,!1,i,s))}enableAttributes(t){const e=sC(t);let n=0;for(let i=0;ithis.size_[0]||e>=this.size_[1])return Wr[0]=0,Wr[1]=0,Wr[2]=0,Wr[3]=0,Wr;this.readAll();const n=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Wr[0]=this.data_[n*4],Wr[1]=this.data_[n*4+1],Wr[2]=this.data_[n*4+2],Wr[3]=this.data_[n*4+3],Wr}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}getDepthbuffer(){return this.depthbuffer_}updateSize_(){const t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),e.bindRenderbuffer(e.RENDERBUFFER,this.depthbuffer_),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t[0],t[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthbuffer_),this.data_=new Uint8Array(t[0]*t[1]*4)}}const op={GENERATE_POLYGON_BUFFERS:"GENERATE_POLYGON_BUFFERS",GENERATE_POINT_BUFFERS:"GENERATE_POINT_BUFFERS",GENERATE_LINE_STRING_BUFFERS:"GENERATE_LINE_STRING_BUFFERS"};var g_={exports:{}};g_.exports=Mh;g_.exports.default=Mh;function Mh(r,t,e){e=e||2;var n=t&&t.length,i=n?t[0]*e:r.length,s=f_(r,0,i,e,!0),o=[];if(!s||s.next===s.prev)return o;var a,l,h,c,u,d,g;if(n&&(s=uC(r,t,s,e)),r.length>80*e){a=h=r[0],l=c=r[1];for(var f=e;fh&&(h=u),d>c&&(c=d);g=Math.max(h-a,c-l),g=g!==0?32767/g:0}return Qo(s,o,e,a,l,g,0),o}function f_(r,t,e,n,i){var s,o;if(i===Qc(r,t,e,n)>0)for(s=t;s=t;s-=n)o=ap(s,r[s],r[s+1],o);return o&&Rh(o,o.next)&&(ea(o),o=o.next),o}function Gi(r,t){if(!r)return r;t||(t=r);var e=r,n;do if(n=!1,!e.steiner&&(Rh(e,e.next)||se(e.prev,e,e.next)===0)){if(ea(e),e=t=e.prev,e===e.next)break;n=!0}else e=e.next;while(n||e!==t);return t}function Qo(r,t,e,n,i,s,o){if(r){!o&&s&&mC(r,n,i,s);for(var a=r,l,h;r.prev!==r.next;){if(l=r.prev,h=r.next,s?lC(r,n,i,s):aC(r)){t.push(l.i/e|0),t.push(r.i/e|0),t.push(h.i/e|0),ea(r),r=h.next,a=h.next;continue}if(r=h,r===a){o?o===1?(r=hC(Gi(r),t,e),Qo(r,t,e,n,i,s,2)):o===2&&cC(r,t,e,n,i,s):Qo(Gi(r),t,e,n,i,s,1);break}}}}function aC(r){var t=r.prev,e=r,n=r.next;if(se(t,e,n)>=0)return!1;for(var i=t.x,s=e.x,o=n.x,a=t.y,l=e.y,h=n.y,c=is?i>o?i:o:s>o?s:o,g=a>l?a>h?a:h:l>h?l:h,f=n.next;f!==t;){if(f.x>=c&&f.x<=d&&f.y>=u&&f.y<=g&&ys(i,a,s,l,o,h,f.x,f.y)&&se(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function lC(r,t,e,n){var i=r.prev,s=r,o=r.next;if(se(i,s,o)>=0)return!1;for(var a=i.x,l=s.x,h=o.x,c=i.y,u=s.y,d=o.y,g=al?a>h?a:h:l>h?l:h,_=c>u?c>d?c:d:u>d?u:d,y=Kc(g,f,t,e,n),x=Kc(m,_,t,e,n),w=r.prevZ,S=r.nextZ;w&&w.z>=y&&S&&S.z<=x;){if(w.x>=g&&w.x<=m&&w.y>=f&&w.y<=_&&w!==i&&w!==o&&ys(a,c,l,u,h,d,w.x,w.y)&&se(w.prev,w,w.next)>=0||(w=w.prevZ,S.x>=g&&S.x<=m&&S.y>=f&&S.y<=_&&S!==i&&S!==o&&ys(a,c,l,u,h,d,S.x,S.y)&&se(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;w&&w.z>=y;){if(w.x>=g&&w.x<=m&&w.y>=f&&w.y<=_&&w!==i&&w!==o&&ys(a,c,l,u,h,d,w.x,w.y)&&se(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;S&&S.z<=x;){if(S.x>=g&&S.x<=m&&S.y>=f&&S.y<=_&&S!==i&&S!==o&&ys(a,c,l,u,h,d,S.x,S.y)&&se(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function hC(r,t,e){var n=r;do{var i=n.prev,s=n.next.next;!Rh(i,s)&&p_(i,n,n.next,s)&&ta(i,s)&&ta(s,i)&&(t.push(i.i/e|0),t.push(n.i/e|0),t.push(s.i/e|0),ea(n),ea(n.next),n=r=s),n=n.next}while(n!==r);return Gi(n)}function cC(r,t,e,n,i,s){var o=r;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&xC(o,a)){var l=m_(o,a);o=Gi(o,o.next),l=Gi(l,l.next),Qo(o,t,e,n,i,s,0),Qo(l,t,e,n,i,s,0);return}a=a.next}o=o.next}while(o!==r)}function uC(r,t,e,n){var i=[],s,o,a,l,h;for(s=0,o=t.length;s=e.next.y&&e.next.y!==e.y){var a=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=n&&a>s&&(s=a,o=e.x=e.x&&e.x>=h&&n!==e.x&&ys(io.x||e.x===o.x&&pC(o,e)))&&(o=e,u=d)),e=e.next;while(e!==l);return o}function pC(r,t){return se(r.prev,r,t.prev)<0&&se(t.next,r,r.next)<0}function mC(r,t,e,n){var i=r;do i.z===0&&(i.z=Kc(i.x,i.y,t,e,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,_C(i)}function _C(r){var t,e,n,i,s,o,a,l,h=1;do{for(e=r,r=null,s=null,o=0;e;){for(o++,n=e,a=0,t=0;t0||l>0&&n;)a!==0&&(l===0||!n||e.z<=n.z)?(i=e,e=e.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;e=n}s.nextZ=null,h*=2}while(o>1);return r}function Kc(r,t,e,n,i){return r=(r-e)*i|0,t=(t-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function yC(r){var t=r,e=r;do(t.x=(r-o)*(s-a)&&(r-o)*(n-a)>=(e-o)*(t-a)&&(e-o)*(s-a)>=(i-o)*(n-a)}function xC(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!vC(r,t)&&(ta(r,t)&&ta(t,r)&&wC(r,t)&&(se(r.prev,r,t.prev)||se(r,t.prev,t))||Rh(r,t)&&se(r.prev,r,r.next)>0&&se(t.prev,t,t.next)>0)}function se(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function Rh(r,t){return r.x===t.x&&r.y===t.y}function p_(r,t,e,n){var i=Qa(se(r,t,e)),s=Qa(se(r,t,n)),o=Qa(se(e,n,r)),a=Qa(se(e,n,t));return!!(i!==s&&o!==a||i===0&&Ja(r,e,t)||s===0&&Ja(r,n,t)||o===0&&Ja(e,r,n)||a===0&&Ja(e,t,n))}function Ja(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function Qa(r){return r>0?1:r<0?-1:0}function vC(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&p_(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function ta(r,t){return se(r.prev,r,r.next)<0?se(r,t,r.next)>=0&&se(r,r.prev,t)>=0:se(r,t,r.prev)<0||se(r,r.next,t)<0}function wC(r,t){var e=r,n=!1,i=(r.x+t.x)/2,s=(r.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&i<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(n=!n),e=e.next;while(e!==r);return n}function m_(r,t){var e=new Jc(r.i,r.x,r.y),n=new Jc(t.i,t.x,t.y),i=r.next,s=t.prev;return r.next=t,t.prev=r,e.next=i,i.prev=e,n.next=e,e.prev=n,s.next=n,n.prev=s,n}function ap(r,t,e,n){var i=new Jc(r,t,e);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ea(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Jc(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Mh.deviation=function(r,t,e,n){var i=t&&t.length,s=i?t[0]*e:r.length,o=Math.abs(Qc(r,0,s,e));if(i)for(var a=0,l=t.length;a0&&(n+=r[i-1].length,e.holes.push(n))}return e};const lp=.985;function SC(r,t){t=t||[];const e=256,n=e-1;return t[0]=Math.floor(r/e/e/e)/n,t[1]=Math.floor(r/e/e)%e/n,t[2]=Math.floor(r/e)%e/n,t[3]=r%e/n,t}function EC(r){let t=0;const e=256,n=e-1;return t+=Math.round(r[0]*e*e*e*n),t+=Math.round(r[1]*e*e*n),t+=Math.round(r[2]*e*n),t+=Math.round(r[3]*n),t}function bC(){const r='const e="GENERATE_POLYGON_BUFFERS",t="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS";function r(e,t){const n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function x(e,t){const n=(r=t)[0]*r[3]-r[1]*r[2];var r;!function(e,t){if(!e)throw new Error(t)}(0!==n,"Transformation matrix cannot be inverted");const x=t[0],i=t[1],u=t[2],o=t[3],f=t[4],s=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-u/n,e[3]=x/n,e[4]=(u*s-o*f)/n,e[5]=-(x*s-i*f)/n,e}function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}new Array(6);var u={exports:{}};function o(e,t,n){n=n||2;var r,x,i,u,o,s,l,v=t&&t.length,h=v?t[0]*n:e.length,c=f(e,0,h,n,!0),g=[];if(!c||c.next===c.prev)return g;if(v&&(c=function(e,t,n,r){var x,i,u,o=[];for(x=0,i=t.length;x80*n){r=i=e[0],x=u=e[1];for(var b=n;bi&&(i=o),s>u&&(u=s);l=0!==(l=Math.max(i-r,u-x))?32767/l:0}return a(c,g,n,r,x,l,0),g}function f(e,t,n,r,x){var i,u;if(x===O(e,t,n,r)>0)for(i=t;i=t;i-=r)u=P(i,e[i],e[i+1],u);return u&&m(u,u.next)&&(B(u),u=u.next),u}function s(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!m(r,r.next)&&0!==w(r.prev,r,r.next))r=r.next;else{if(B(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function a(e,t,n,r,x,i,u){if(e){!u&&i&&function(e,t,n,r){var x=e;do{0===x.z&&(x.z=b(x.x,x.y,t,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,function(e){var t,n,r,x,i,u,o,f,s=1;do{for(n=e,e=null,i=null,u=0;n;){for(u++,r=n,o=0,t=0;t0||f>0&&r;)0!==o&&(0===f||!r||n.z<=r.z)?(x=n,n=n.nextZ,o--):(x=r,r=r.nextZ,f--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;n=r}i.nextZ=null,s*=2}while(u>1)}(x)}(e,r,x,i);for(var o,f,p=e;e.prev!==e.next;)if(o=e.prev,f=e.next,i?v(e,r,x,i):l(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(f.i/n|0),B(e),e=f.next,p=f.next;else if((e=f)===p){u?1===u?a(e=h(s(e),t,n),t,n,r,x,i,2):2===u&&c(e,t,n,r,x,i):a(s(e),t,n,r,x,i,1);break}}}function l(e){var t=e.prev,n=e,r=e.next;if(w(t,n,r)>=0)return!1;for(var x=t.x,i=n.x,u=r.x,o=t.y,f=n.y,s=r.y,a=xi?x>u?x:u:i>u?i:u,h=o>f?o>s?o:s:f>s?f:s,c=r.next;c!==t;){if(c.x>=a&&c.x<=v&&c.y>=l&&c.y<=h&&M(x,o,i,f,u,s,c.x,c.y)&&w(c.prev,c,c.next)>=0)return!1;c=c.next}return!0}function v(e,t,n,r){var x=e.prev,i=e,u=e.next;if(w(x,i,u)>=0)return!1;for(var o=x.x,f=i.x,s=u.x,a=x.y,l=i.y,v=u.y,h=of?o>s?o:s:f>s?f:s,y=a>l?a>v?a:v:l>v?l:v,g=b(h,c,t,n,r),d=b(p,y,t,n,r),Z=e.prevZ,m=e.nextZ;Z&&Z.z>=g&&m&&m.z<=d;){if(Z.x>=h&&Z.x<=p&&Z.y>=c&&Z.y<=y&&Z!==x&&Z!==u&&M(o,a,f,l,s,v,Z.x,Z.y)&&w(Z.prev,Z,Z.next)>=0)return!1;if(Z=Z.prevZ,m.x>=h&&m.x<=p&&m.y>=c&&m.y<=y&&m!==x&&m!==u&&M(o,a,f,l,s,v,m.x,m.y)&&w(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;Z&&Z.z>=g;){if(Z.x>=h&&Z.x<=p&&Z.y>=c&&Z.y<=y&&Z!==x&&Z!==u&&M(o,a,f,l,s,v,Z.x,Z.y)&&w(Z.prev,Z,Z.next)>=0)return!1;Z=Z.prevZ}for(;m&&m.z<=d;){if(m.x>=h&&m.x<=p&&m.y>=c&&m.y<=y&&m!==x&&m!==u&&M(o,a,f,l,s,v,m.x,m.y)&&w(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function h(e,t,n){var r=e;do{var x=r.prev,i=r.next.next;!m(x,i)&&A(x,r,r.next,i)&&z(x,i)&&z(i,x)&&(t.push(x.i/n|0),t.push(r.i/n|0),t.push(i.i/n|0),B(r),B(r.next),r=e=i),r=r.next}while(r!==e);return s(r)}function c(e,t,n,r,x,i){var u=e;do{for(var o=u.next.next;o!==u.prev;){if(u.i!==o.i&&Z(u,o)){var f=F(u,o);return u=s(u,u.next),f=s(f,f.next),a(u,t,n,r,x,i,0),void a(f,t,n,r,x,i,0)}o=o.next}u=u.next}while(u!==e)}function p(e,t){return e.x-t.x}function y(e,t){var n=function(e,t){var n,r=t,x=e.x,i=e.y,u=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var o=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=x&&o>u&&(u=o,n=r.x=r.x&&r.x>=a&&x!==r.x&&M(in.x||r.x===n.x&&g(n,r)))&&(n=r,v=f)),r=r.next}while(r!==s);return n}(e,t);if(!n)return t;var r=F(n,e);return s(r,r.next),s(n,n.next)}function g(e,t){return w(e.prev,e,t.prev)<0&&w(t.next,e,e.next)<0}function b(e,t,n,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*x|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*x|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function d(e){var t=e,n=e;do{(t.x=(e-u)*(i-o)&&(e-u)*(r-o)>=(n-u)*(t-o)&&(n-u)*(i-o)>=(x-u)*(r-o)}function Z(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&A(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(z(e,t)&&z(t,e)&&function(e,t){var n=e,r=!1,x=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&x<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(w(e.prev,e,t.prev)||w(e,t.prev,t))||m(e,t)&&w(e.prev,e,e.next)>0&&w(t.prev,t,t.next)>0)}function w(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function m(e,t){return e.x===t.x&&e.y===t.y}function A(e,t,n,r){var x=I(w(e,t,n)),i=I(w(e,t,r)),u=I(w(n,r,e)),o=I(w(n,r,t));return x!==i&&u!==o||(!(0!==x||!E(e,n,t))||(!(0!==i||!E(e,r,t))||(!(0!==u||!E(n,e,r))||!(0!==o||!E(n,t,r)))))}function E(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function I(e){return e>0?1:e<0?-1:0}function z(e,t){return w(e.prev,e,e.next)<0?w(e,t,e.next)>=0&&w(e,e.prev,t)>=0:w(e,t,e.prev)<0||w(e,e.next,t)<0}function F(e,t){var n=new _(e.i,e.x,e.y),r=new _(t.i,t.x,t.y),x=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=x,x.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function P(e,t,n,r){var x=new _(e,t,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function B(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function O(e,t,n,r){for(var x=0,i=t,u=n-r;i0&&(r+=e[x-1].length,n.holes.push(r))}return n};var N=i(u.exports);const R=[],S={vertexPosition:0,indexPosition:0};function T(e,t,n,r,x){e[t+0]=n,e[t+1]=r,e[t+2]=x}function U(e,t,n,r,x,i){const u=3+x,o=e[t+0],f=e[t+1],s=R;s.length=x;for(let n=0;n0?f:2*Math.PI-f}let d=-1,M=-1,Z=l;const w=null!==i;if(null!==x){d=b(y,g,r(s,[...[e[x],e[x+1]]])),Math.cos(d)<=.985&&(Z+=Math.tan((d-Math.PI)/2))}if(w){M=b(g,y,r(s,[...[e[i],e[i+1]]])),Math.cos(M)<=.985&&(Z+=Math.tan((Math.PI-M)/2))}function m(e,t){return 0===t?1e4*e:Math.sign(t)*(1e4*e+Math.abs(t))}return u.push(c[0],c[1],p[0],p[1],d,M,a,m(0,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(1,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(2,l)),u.push(...f),u.push(c[0],c[1],p[0],p[1],d,M,a,m(3,l)),u.push(...f),o.push(h,h+1,h+2,h+1,h+3,h+2),{length:a+Math.sqrt((g[0]-y[0])*(g[0]-y[0])+(g[1]-y[1])*(g[1]-y[1])),angle:Z}}function G(e,t,n,r,x){const i=2+x;let u=t;const o=e.slice(u,u+x);u+=x;const f=e[u++];let s=0;const a=new Array(f-1);for(let t=0;t{const i=r.data;switch(i.type){case t:{const e=3,t=2,n=i.customAttributesSize,r=t+n,x=new Float32Array(i.renderInstructions),u=x.length/r,o=4*u*(n+e),f=new Uint32Array(6*u),s=new Float32Array(o);let a;for(let e=0;e0?c=o+(n-1)*r:l&&(c=i-r);let p=null;n"u"?"data:application/javascript;base64,"+Buffer.from(r,"binary").toString("base64"):URL.createObjectURL(new Blob([r],{type:"application/javascript"})))}function TC(r,t){const e=r.viewState.projection,n=t.getSource().getWrapX()&&e.canWrapX(),i=e.getExtent(),s=r.extent,o=n?pt(i):null,a=n?Math.ceil((s[2]-i[2])/o)+1:1;return[n?Math.floor((s[0]-i[0])/o):0,a,o]}class __ extends Th{constructor(t,e){const n=e.uniforms||{},i=ue();n[xn.PROJECTION_MATRIX]=i,super(t,{uniforms:n,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.verticesBuffer_=new Ol(Eh,Hc),this.indicesBuffer_=new Ol(bh,Hc),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=e.hitDetectionEnabled??!0;const s=e.attributes?e.attributes.map(function(a){return{name:"a_prop_"+a.name,size:1,type:Vr.FLOAT}}):[];this.attributes=[{name:"a_position",size:2,type:Vr.FLOAT},{name:"a_index",size:1,type:Vr.FLOAT}],this.hitDetectionEnabled_&&(this.attributes.push({name:"a_prop_hitColor",size:4,type:Vr.FLOAT}),this.attributes.push({name:"a_featureUid",size:1,type:Vr.FLOAT})),this.attributes.push(...s),this.customAttributes=e.attributes?e.attributes:[],this.previousExtent_=je(),this.currentTransform_=i,this.renderTransform_=ue(),this.invertRenderTransform_=ue(),this.renderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.lastSentId=0,this.worker_=bC(),this.worker_.addEventListener("message",a=>{const l=a.data;if(l.type===op.GENERATE_POINT_BUFFERS){const h=l.projectionTransform;this.verticesBuffer_.fromArrayBuffer(l.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.fromArrayBuffer(l.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=h,hm(this.invertRenderTransform_,this.renderTransform_),this.renderInstructions_=new Float32Array(a.data.renderInstructions),l.id===this.lastSentId&&(this.ready=!0),this.getLayer().changed()}}),this.featureCache_={},this.featureCount_=0;const o=this.getLayer().getSource();this.sourceListenKeys_=[ie(o,Ne.ADDFEATURE,this.handleSourceFeatureAdded_,this),ie(o,Ne.CHANGEFEATURE,this.handleSourceFeatureChanged_,this),ie(o,Ne.REMOVEFEATURE,this.handleSourceFeatureDelete_,this),ie(o,Ne.CLEAR,this.handleSourceFeatureClear_,this)],o.forEachFeature(a=>{this.featureCache_[tt(a)]={feature:a,properties:a.getProperties(),geometry:a.getGeometry()},this.featureCount_++})}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new oC(this.helper))}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[tt(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[tt(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[tt(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[n,i,s]=TC(t,this.getLayer());return this.renderWorlds(t,!1,n,i,s),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent),this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,n,i,s),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),this.helper.getCanvas()}prepareFrameInternal(t){const e=this.getLayer(),n=e.getSource(),i=t.viewState,s=!t.viewHints[Kt.ANIMATING]&&!t.viewHints[Kt.INTERACTING],o=!Pn(this.previousExtent_,t.extent),a=this.sourceRevision_t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){at()}getAlpha(t,e){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;const i=e-n+1e3/60;return i>=this.transition_?1:U0(i/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}}function Nl(r){return r instanceof Image||r instanceof HTMLCanvasElement||r instanceof HTMLVideoElement||r instanceof ImageBitmap?r:null}function tu(r){return r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Float32Array||r instanceof DataView?r:null}let rs=null;function RC(r){rs||(rs=Vt(r.width,r.height,void 0,{willReadFrequently:!0}));const t=rs.canvas,e=r.width;t.width!==e&&(t.width=e);const n=r.height;return t.height!==n&&(t.height=n),rs.clearRect(0,0,e,n),rs.drawImage(r,0,0),rs.getImageData(0,0,e,n).data}const CC=[256,256];class Md extends to{constructor(t){const e=U.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null}getSize(){if(this.size_)return this.size_;const t=Nl(this.data_);return t?[t.width,t.height]:CC}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==U.IDLE&&this.state!==U.ERROR)return;this.state=U.LOADING,this.changed();const t=this;this.loader_().then(function(e){t.data_=e,t.state=U.LOADED,t.changed()}).catch(function(e){t.error_=e,t.state=U.ERROR,t.changed()})}}const IC=10,hp=.25;class Rd{constructor(t,e,n,i,s,o){this.sourceProj_=t,this.targetProj_=e;let a={};const l=nn(this.targetProj_,this.sourceProj_);this.transformInv_=function(x){const w=x[0]+"/"+x[1];return a[w]||(a[w]=l(x)),a[w]},this.maxSourceExtent_=i,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&pt(i)>=pt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?pt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?pt(this.targetProj_.getExtent()):null;const h=Nn(n),c=ga(n),u=Jl(n),d=da(n),g=this.transformInv_(h),f=this.transformInv_(c),m=this.transformInv_(u),_=this.transformInv_(d),y=IC+(o?Math.max(0,Math.ceil(Math.log2(Bo(n)/(o*o*256*256)))):0);if(this.addQuad_(h,c,u,d,g,f,m,_,y),this.wrapsXInSource_){let x=1/0;this.triangles_.forEach(function(w,S,E){x=Math.min(x,w.source[0][0],w.source[1][0],w.source[2][0])}),this.triangles_.forEach(w=>{if(Math.max(w.source[0][0],w.source[1][0],w.source[2][0])-x>this.sourceWorldWidth_/2){const S=[[w.source[0][0],w.source[0][1]],[w.source[1][0],w.source[1][1]],[w.source[2][0],w.source[2][1]]];S[0][0]-x>this.sourceWorldWidth_/2&&(S[0][0]-=this.sourceWorldWidth_),S[1][0]-x>this.sourceWorldWidth_/2&&(S[1][0]-=this.sourceWorldWidth_),S[2][0]-x>this.sourceWorldWidth_/2&&(S[2][0]-=this.sourceWorldWidth_);const E=Math.min(S[0][0],S[1][0],S[2][0]);Math.max(S[0][0],S[1][0],S[2][0])-E.5&&u<1;let f=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const _=As([t,e,n,i]);f=pt(_)/this.targetWorldWidth_>hp||f}!g&&this.sourceProj_.isGlobal()&&u&&(f=u>hp||f)}if(!f&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!$t(c,this.maxSourceExtent_))return;let m=0;if(!f&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(h>0)f=!0;else if(m=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(h>0){if(!f){const _=[(t[0]+n[0])/2,(t[1]+n[1])/2],y=this.transformInv_(_);let x;g?x=(en(s[0],d)+en(a[0],d))/2-en(y[0],d):x=(s[0]+a[0])/2-y[0];const w=(s[1]+a[1])/2-y[1];f=x*x+w*w>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const _=[(e[0]+n[0])/2,(e[1]+n[1])/2],y=this.transformInv_(_),x=[(i[0]+t[0])/2,(i[1]+t[1])/2],w=this.transformInv_(x);this.addQuad_(t,e,_,x,s,o,y,w,h-1),this.addQuad_(x,_,n,i,w,y,a,l,h-1)}else{const _=[(t[0]+e[0])/2,(t[1]+e[1])/2],y=this.transformInv_(_),x=[(n[0]+i[0])/2,(n[1]+i[1])/2],w=this.transformInv_(x);this.addQuad_(t,_,x,i,s,y,w,l,h-1),this.addQuad_(_,e,n,x,y,o,a,w,h-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(t,n,i,s,a,l),m&14||this.addTriangle_(t,n,e,s,a,o),m&&(m&13||this.addTriangle_(e,i,t,o,l,s),m&7||this.addTriangle_(e,i,n,o,l,a))}calculateSourceExtent(){const t=je();return this.triangles_.forEach(function(e,n,i){const s=e.source;Ro(t,s[0]),Ro(t,s[1]),Ro(t,s[2])}),t}getTriangles(){return this.triangles_}}let lc;const Cn=[];function cp(r,t,e,n,i){r.beginPath(),r.moveTo(0,0),r.lineTo(t,e),r.lineTo(n,i),r.closePath(),r.save(),r.clip(),r.fillRect(0,0,Math.max(t,n)+1,Math.max(e,i)),r.restore()}function hc(r,t){return Math.abs(r[t*4]-210)>2||Math.abs(r[t*4+3]-.75*255)>2}function PC(){if(lc===void 0){const r=Vt(6,6,Cn);r.globalCompositeOperation="lighter",r.fillStyle="rgba(210, 0, 0, 0.75)",cp(r,4,5,4,0),cp(r,4,5,0,5);const t=r.getImageData(0,0,3,3).data;lc=hc(t,0)||hc(t,4)||hc(t,8),Di(r),Cn.push(r.canvas)}return lc}function ra(r,t,e,n){const i=Ql(e,t,r);let s=jg(t,n,e);const o=t.getMetersPerUnit();o!==void 0&&(s*=o);const a=r.getMetersPerUnit();a!==void 0&&(s/=a);const l=r.getExtent();if(!l||gr(l,i)){const h=jg(r,s,i)/s;isFinite(h)&&h>0&&(s/=h)}return s}function y_(r,t,e,n){const i=be(e);let s=ra(r,t,i,n);return(!isFinite(s)||s<=0)&&dm(e,function(o){return s=ra(r,t,o,n),isFinite(s)&&s>0}),s}function Cd(r,t,e,n,i,s,o,a,l,h,c,u,d,g){const f=Vt(Math.round(e*r),Math.round(e*t),Cn);if(u||(f.imageSmoothingEnabled=!1),l.length===0)return f.canvas;f.scale(e,e);function m(E){return Math.round(E*e)/e}f.globalCompositeOperation="lighter";const _=je();l.forEach(function(E,T,R){cm(_,E.extent)});let y;const x=e/n,w=(u?1:1+Math.pow(2,-24))/x;if(!d||l.length!==1||h!==0){if(y=Vt(Math.round(pt(_)*x),Math.round(Zt(_)*x),Cn),u||(y.imageSmoothingEnabled=!1),i&&g){const E=(i[0]-_[0])*x,T=-(i[3]-_[3])*x,R=pt(i)*x,C=Zt(i)*x;y.rect(E,T,R,C),y.clip()}l.forEach(function(E,T,R){if(E.image.width>0&&E.image.height>0){if(E.clipExtent){y.save();const z=(E.clipExtent[0]-_[0])*x,p=-(E.clipExtent[3]-_[3])*x,v=pt(E.clipExtent)*x,b=Zt(E.clipExtent)*x;y.rect(u?z:Math.round(z),u?p:Math.round(p),u?v:Math.round(z+v)-Math.round(z),u?b:Math.round(p+b)-Math.round(p)),y.clip()}const C=(E.extent[0]-_[0])*x,A=-(E.extent[3]-_[3])*x,k=pt(E.extent)*x,F=Zt(E.extent)*x;y.drawImage(E.image,h,h,E.image.width-2*h,E.image.height-2*h,u?C:Math.round(C),u?A:Math.round(A),u?k:Math.round(C+k)-Math.round(C),u?F:Math.round(A+F)-Math.round(A)),E.clipExtent&&y.restore()}})}const S=Nn(o);return a.getTriangles().forEach(function(E,T,R){const C=E.source,A=E.target;let k=C[0][0],F=C[0][1],z=C[1][0],p=C[1][1],v=C[2][0],b=C[2][1];const M=m((A[0][0]-S[0])/s),L=m(-(A[0][1]-S[1])/s),D=m((A[1][0]-S[0])/s),j=m(-(A[1][1]-S[1])/s),G=m((A[2][0]-S[0])/s),W=m(-(A[2][1]-S[1])/s),$=k,st=F;k=0,F=0,z-=$,p-=st,v-=$,b-=st;const X=[[z,p,0,0,D-M],[v,b,0,0,G-M],[0,0,z,p,j-L],[0,0,v,b,W-L]],lt=gx(X);if(!lt)return;if(f.save(),f.beginPath(),PC()||!u){f.moveTo(D,j);const gt=4,qt=M-D,Lt=L-j;for(let Ut=0;UtPromise.resolve(new Uint8Array(4)),interpolate:t.interpolate,transition:t.transition}),this.pixelRatio_=t.pixelRatio,this.gutter_=t.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=t.sourceTileGrid,this.targetTileGrid_=t.targetTileGrid,this.wrappedTileCoord_=t.wrappedTileCoord||t.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const e=t.sourceProj,n=e.getExtent(),i=t.sourceTileGrid.getExtent();this.clipExtent_=e.canWrapX()?i?fe(n,i):n:i;const s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),o=this.targetTileGrid_.getExtent();let a=this.sourceTileGrid_.getExtent();const l=o?fe(s,o):s;if(Bo(l)===0){this.state=U.EMPTY;return}n&&(a?a=fe(a,n):a=n);const h=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),c=t.targetProj,u=y_(e,c,l,h);if(!isFinite(u)||u<=0){this.state=U.EMPTY;return}const d=t.errorThreshold!==void 0?t.errorThreshold:Td;if(this.triangulation_=new Rd(e,c,l,a,u*d,h),this.triangulation_.getTriangles().length===0){this.state=U.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let g=this.triangulation_.calculateSourceExtent();if(a&&(e.canWrapX()?(g[1]=xt(g[1],a[1],a[3]),g[3]=xt(g[3],a[1],a[3])):g=fe(g,a)),!Bo(g))this.state=U.EMPTY;else{let f=0,m=0;e.canWrapX()&&(f=pt(n),m=Math.floor((g[0]-n[0])/f)),Eu(g.slice(),e,!0).forEach(_=>{const y=this.sourceTileGrid_.getTileRangeForExtentAndZ(_,this.sourceZ_),x=t.getTileFunction;for(let w=y.minX;w<=y.maxX;w++)for(let S=y.minY;S<=y.maxY;S++){const E=x(this.sourceZ_,w,S,this.pixelRatio_);if(E){const T=m*f;this.sourceTiles_.push({tile:E,offset:T})}}++m}),this.sourceTiles_.length===0&&(this.state=U.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{var n;const i=e.tile;if(!i||i.getState()!==U.LOADED)return;const s=i.getSize(),o=this.gutter_;let a;const l=tu(i.getData());l?a=l:a=RC(Nl(i.getData()));const h=[s[0]+2*o,s[1]+2*o],c=a instanceof Float32Array,u=h[0]*h[1],d=c?Float32Array:Uint8Array,g=new d(a.buffer),f=d.BYTES_PER_ELEMENT,m=f*g.length/u,_=g.byteLength/h[1],y=Math.floor(_/f/h[0]),x=u*y;let w=g;if(g.length!==x){w=new d(x);let T=0,R=0;const C=h[0]*y;for(let A=0;A=0;--g){const f=[];for(let S=0,E=t.length;S{const n=e.getState();if(n!==U.IDLE&&n!==U.LOADING)return;t++;const i=ie(e,Ct.CHANGE,function(){const s=e.getState();(s==U.LOADED||s==U.ERROR||s==U.EMPTY)&&(ye(i),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(i)}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e}){e.getState()==U.IDLE&&e.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(ye),this.sourcesListenerKeys_=null}}class js extends to{constructor(t,e,n,i,s,o,a,l,h,c,u,d){super(s,U.IDLE,d),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=i,this.wrappedTileCoord_=o||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const g=i.getTileCoordExtent(this.wrappedTileCoord_),f=this.targetTileGrid_.getExtent();let m=this.sourceTileGrid_.getExtent();const _=f?fe(g,f):g;if(Bo(_)===0){this.state=U.EMPTY;return}const y=t.getExtent();y&&(m?m=fe(m,y):m=y);const x=i.getResolution(this.wrappedTileCoord_[0]),w=y_(t,n,_,x);if(!isFinite(w)||w<=0){this.state=U.EMPTY;return}const S=c!==void 0?c:Td;if(this.triangulation_=new Rd(t,n,_,m,w*S,x),this.triangulation_.getTriangles().length===0){this.state=U.EMPTY;return}this.sourceZ_=e.getZForResolution(w);let E=this.triangulation_.calculateSourceExtent();if(m&&(t.canWrapX()?(E[1]=xt(E[1],m[1],m[3]),E[3]=xt(E[3],m[1],m[3])):E=fe(E,m)),!Bo(E))this.state=U.EMPTY;else{let T=0,R=0;t.canWrapX()&&(T=pt(y),R=Math.floor((E[0]-y[0])/T)),Eu(E.slice(),t,!0).forEach(C=>{const A=e.getTileRangeForExtentAndZ(C,this.sourceZ_);for(let k=A.minX;k<=A.maxX;k++)for(let F=A.minY;F<=A.maxY;F++){const z=h(this.sourceZ_,k,F,a);if(z){const p=R*T;this.sourceTiles_.push({tile:z,offset:p})}}++R}),this.sourceTiles_.length===0&&(this.state=U.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{var n;const i=e.tile;if(i&&i.getState()==U.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);s[0]+=e.offset,s[2]+=e.offset;const o=(n=this.clipExtent_)==null?void 0:n.slice();o&&(o[0]+=e.offset,o[2]+=e.offset),t.push({extent:s,clipExtent:o,image:i.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=U.ERROR;else{const e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),i=typeof n=="number"?n:n[0],s=typeof n=="number"?n:n[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Cd(i,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=U.LOADED}this.changed()}load(){if(this.state==U.IDLE){this.state=U.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const n=e.getState();if(n==U.IDLE||n==U.LOADING){t++;const i=ie(e,Ct.CHANGE,function(s){const o=e.getState();(o==U.LOADED||o==U.ERROR||o==U.EMPTY)&&(ye(i),t--,t===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(i)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},n,i){e.getState()==U.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(ye),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Di(this.canvas_.getContext("2d")),Cn.push(this.canvas_),this.canvas_=null),super.release()}}class Ra extends to{constructor(t,e,n,i,s,o){super(t,e,o),this.crossOrigin_=i,this.src_=n,this.key=n,this.image_=new Image,i!==null&&(this.image_.crossOrigin=i),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t,this.state=U.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=U.ERROR,this.unlistenImage_(),this.image_=AC(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=U.LOADED:this.state=U.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==U.ERROR&&(this.state=U.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==U.IDLE&&(this.state=U.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ww(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function AC(){const r=Vt(1,1);return r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1),r.canvas}class LC extends ha{constructor(t){super(),this.tile,this.handleTileChange_=this.handleTileChange_.bind(this),this.gutter_=t.gutter||0,this.helper_=t.helper,this.loaded=!1,this.ready=!1}setTile(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(Ct.CHANGE,this.handleTileChange_),this.tile=t,this.loaded=t.getState()===U.LOADED,this.loaded)this.uploadTile();else{if(t instanceof Ra){const e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(Ct.CHANGE,this.handleTileChange_)}}uploadTile(){at()}setReady(){this.ready=!0,this.dispatchEvent(Ct.CHANGE)}handleTileChange_(){this.tile.getState()===U.LOADED&&(this.loaded=!0,this.uploadTile())}disposeInternal(){this.tile.removeEventListener(Ct.CHANGE,this.handleTileChange_)}}function x_(r,t,e){const n=e?r.LINEAR:r.NEAREST;r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,n),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,n)}function OC(r,t,e,n){x_(r,t,n),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)}function up(r,t,e,n,i,s){const o=r.getGL();let a,l;e instanceof Float32Array?(a=o.FLOAT,r.getExtension("OES_texture_float"),l=r.getExtension("OES_texture_float_linear")!==null):(a=o.UNSIGNED_BYTE,l=!0),x_(o,t,s&&l);const h=e.byteLength/n[1];let c=1;h%8===0?c=8:h%4===0?c=4:h%2===0&&(c=2);let u;switch(i){case 1:{u=o.LUMINANCE;break}case 2:{u=o.LUMINANCE_ALPHA;break}case 3:{u=o.RGB;break}case 4:{u=o.RGBA;break}default:throw new Error(`Unsupported number of bands: ${i}`)}const d=o.getParameter(o.UNPACK_ALIGNMENT);o.pixelStorei(o.UNPACK_ALIGNMENT,c),o.texImage2D(o.TEXTURE_2D,0,u,n[0],n[1],0,u,a,e),o.pixelStorei(o.UNPACK_ALIGNMENT,d)}let us=null;function FC(){us=Vt(1,1,void 0,{willReadFrequently:!0})}class NC extends LC{constructor(t){super(t),this.textures=[],this.renderSize_=Jt(t.grid.getTileSize(t.tile.tileCoord[0])),this.bandCount=NaN;const e=new Ol(Eh,bd);e.fromArray([0,1,1,1,1,0,0,0]),this.helper_.flushBufferData(e),this.coords=e,this.setTile(t.tile)}uploadTile(){const t=this.helper_,e=t.getGL(),n=this.tile;this.textures.length=0;let i;n instanceof Ra||n instanceof js?i=n.getImage():i=n.getData();const s=Nl(i);if(s){const x=e.createTexture();this.textures.push(x),this.bandCount=4,OC(e,x,s,n.interpolate),this.setReady();return}i=tu(i);const o=n.getSize(),a=[o[0]+2*this.gutter_,o[1]+2*this.gutter_],l=i instanceof Float32Array,h=a[0]*a[1],c=l?Float32Array:Uint8Array,u=c.BYTES_PER_ELEMENT,d=i.byteLength/a[1];this.bandCount=Math.floor(d/u/a[0]);const g=Math.ceil(this.bandCount/4);if(g===1){const x=e.createTexture();this.textures.push(x),up(t,x,i,a,this.bandCount,n.interpolate),this.setReady();return}const f=new Array(g);for(let x=0;x0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const n=this.entries_[t];return Rt(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(t){const e=this.entries_[t];return Rt(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.key_;return t}getValues(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){var e;return(e=this.entries_[t])==null?void 0:e.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){Rt(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}class Ch{constructor(t,e,n,i){this.minX=t,this.maxX=e,this.minY=n,this.maxY=i}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function ns(r,t,e,n,i){return i!==void 0?(i.minX=r,i.maxX=t,i.minY=e,i.maxY=n,i):new Ch(r,t,e,n)}function na(r,t,e,n){return n!==void 0?(n[0]=r,n[1]=t,n[2]=e,n):[r,t,e]}function on(r,t,e){return r+"/"+t+"/"+e}function Kn(r){return on(r[0],r[1],r[2])}function DC(r){const[t,e,n]=r.substring(r.lastIndexOf("/")+1,r.length).split(",").map(Number);return on(t,e,n)}function v_(r){return r.split("/").map(Number)}function Ad(r){return(r[1]<e||e>t.getMaxZoom())return!1;const s=t.getFullTileRange(e);return s?s.containsXY(n,i):!0}const GC={TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",RENDER_EXTENT:"u_renderExtent",PATTERN_ORIGIN:"u_patternOrigin",RESOLUTION:"u_resolution",ZOOM:"u_zoom",GLOBAL_ALPHA:"u_globalAlpha",PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix"},jC={};function dp(r){return 1/(r+2)}function zC(){return{tileIds:new Set,representationsByZ:{}}}function gp(r,t){return r.tileIds.has(tt(t))}function fp(r,t,e){const n=r.representationsByZ;e in n||(n[e]=new Set),n[e].add(t),r.tileIds.add(tt(t.tile))}function cc(r,t){const e=r.layerStatesArray[r.layerIndex];e.extent&&(t=fe(t,Or(e.extent,r.viewState.projection)));const n=e.layer.getRenderSource();if(!n.getWrapX()){const i=n.getTileGridForProjection(r.viewState.projection).getExtent();i&&(t=fe(t,i))}return t}function eu(r,t){return`${r.getKey()},${Kn(t)}`}class UC extends Th{constructor(t,e){super(t,{uniforms:e.uniforms,postProcesses:e.postProcesses}),this.renderComplete=!1,this.tileTransform_=ue(),this.tempMat4=c_(),this.tempTileRange_=new Ch(0,0,0,0),this.tempTileCoord_=na(0,0,0),this.tempSize_=[0,0];const n=e.cacheSize!==void 0?e.cacheSize:512;this.tileRepresentationCache=new Pd(n),this.frameState=null,this.projection_=void 0}reset(t){super.reset({uniforms:t.uniforms})}isDrawableTile_(t){const e=this.getLayer(),n=t.getState(),i=e.getUseInterimTilesOnError();return n==U.LOADED||n==U.EMPTY||n==U.ERROR&&!i}prepareFrameInternal(t){this.projection_?t.viewState.projection!==this.projection_&&(this.clearCache(),this.projection_=t.viewState.projection):this.projection_=t.viewState.projection;const e=this.getLayer().getRenderSource();return!e||Dn(cc(t,t.extent))?!1:e.getState()==="ready"}createTileRepresentation(t){return at()}enqueueTiles(t,e,n,i,s){const o=t.viewState,a=this.getLayer(),l=a.getRenderSource(),h=l.getTileGridForProjection(o.projection),c=l.getGutterForProjection(o.projection),u=tt(l);u in t.wantedTiles||(t.wantedTiles[u]={});const d=t.wantedTiles[u],g=this.tileRepresentationCache,f=a.getMapInternal(),m=Math.max(n-s,h.getMinZoom(),h.getZForResolution(Math.min(a.getMaxResolution(),f?f.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):h.getResolution(0)),l.zDirection));for(let _=n;_>=m;--_){const y=h.getTileRangeForExtentAndZ(e,_,this.tempTileRange_),x=h.getResolution(_);for(let w=y.minX;w<=y.maxX;++w)for(let S=y.minY;S<=y.maxY;++S){const E=na(_,w,S,this.tempTileCoord_),T=eu(l,E);let R,C;if(g.containsKey(T)&&(R=g.get(T),C=R.tile),(!R||R.tile.key!==l.getKey())&&(C=l.getTile(_,w,S,t.pixelRatio,o.projection)),gp(i,C))continue;if(!R)R=this.createTileRepresentation({tile:C,grid:h,helper:this.helper,gutter:c}),g.set(T,R);else if(this.isDrawableTile_(C))R.setTile(C);else{const k=C.getInterimTile();R.setTile(k)}fp(i,R,_);const A=C.getKey();d[A]=!0,C.getState()===U.IDLE&&(t.tileQueue.isKeyQueued(A)||t.tileQueue.enqueue([C,u,h.getTileCoordCenter(E),x]))}}}beforeTilesRender(t,e){this.helper.prepareDraw(this.frameState,!e,!0)}beforeTilesMaskRender(t){return!1}renderTile(t,e,n,i,s,o,a,l,h,c,u){}renderTileMask(t,e,n,i){}drawTile_(t,e,n,i,s,o,a){if(!e.ready)return;const l=e.tile.tileCoord,h=Kn(l),c=h in o?o[h]:1,u=a.getResolution(n),d=Jt(a.getTileSize(n),this.tempSize_),g=a.getOrigin(n),f=a.getTileCoordExtent(l),m=c<1?-1:dp(n);c<1&&(t.animate=!0);const _=t.viewState,y=_.center[0],x=_.center[1],w=d[0]+2*i,S=d[1]+2*i,E=w/S,T=(y-g[0])/(d[0]*u),R=(g[1]-x)/(d[1]*u),C=_.resolution/u,A=l[1],k=l[2];Mc(this.tileTransform_),Mo(this.tileTransform_,2/(t.size[0]*C/w),-2/(t.size[1]*C/w)),$1(this.tileTransform_,_.rotation),Mo(this.tileTransform_,1,1/E),_u(this.tileTransform_,(d[0]*(A-T)-i)/w,(d[1]*(k-R)-i)/S),this.renderTile(e,this.tileTransform_,t,s,u,d,g,f,m,i,c)}renderFrame(t){this.frameState=t,this.renderComplete=!0;const e=this.helper.getGL();this.preRender(e,t);const n=t.viewState,i=this.getLayer(),s=i.getRenderSource(),o=s.getTileGridForProjection(n.projection),a=s.getGutterForProjection(n.projection),l=cc(t,t.extent),h=o.getZForResolution(n.resolution,s.zDirection),c=zC(),u=i.getPreload();if(t.nextExtent){const E=o.getZForResolution(n.nextResolution,s.zDirection),T=cc(t,t.nextExtent);this.enqueueTiles(t,T,E,c,u)}this.enqueueTiles(t,l,h,c,0),u>0&&setTimeout(()=>{this.enqueueTiles(t,l,h-1,c,u-1)},0);const d={},g=tt(this),f=t.time;let m=!1;for(const E of c.representationsByZ[h]){const T=E.tile;if((T instanceof js||T instanceof Id)&&T.getState()===U.EMPTY)continue;const R=T.tileCoord;if(E.ready){const A=T.getAlpha(g,f);if(A===1){T.endTransition(g);continue}m=!0;const k=Kn(R);d[k]=A}if(this.renderComplete=!1,this.findAltTiles_(o,R,h+1,c))continue;const C=o.getMinZoom();for(let A=h-1;A>=C&&!this.findAltTiles_(o,R,A,c);--A);}const _=c.representationsByZ,y=Object.keys(_).map(Number).sort(z1);if(this.beforeTilesMaskRender(t))for(let E=0,T=y.length;Ee.dispose()),t.clear()}removeHelper(){this.helper&&this.clearCache(),super.removeHelper()}disposeInternal(){super.disposeInternal(),delete this.frameState}}const wt={...GC,TILE_TEXTURE_ARRAY:"u_tileTextures",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY"},ol={TEXTURE_COORD:"a_textureCoord"},BC=[{name:ol.TEXTURE_COORD,size:2,type:Vr.FLOAT}];class XC extends UC{constructor(t,e){super(t,e),this.program_,this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.indices_=new Ol(bh,bd),this.indices_.fromArray([0,1,3,1,2,3]),this.paletteTextures_=e.paletteTextures||[]}reset(t){if(super.reset(t),this.helper){const e=this.helper.getGL();for(const n of this.paletteTextures_)n.delete(e)}this.vertexShader_=t.vertexShader,this.fragmentShader_=t.fragmentShader,this.paletteTextures_=t.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)}removeHelper(){if(this.helper){const t=this.helper.getGL();for(const e of this.paletteTextures_)e.delete(t)}super.removeHelper()}createTileRepresentation(t){return new NC(t)}beforeTilesRender(t,e){super.beforeTilesRender(t,e),this.helper.useProgram(this.program_,t)}renderTile(t,e,n,i,s,o,a,l,h,c,u){const d=this.helper.getGL();this.helper.bindBuffer(t.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(BC);let g=0;for(;g0&&(S=l,fe(S,i,S)),this.helper.setUniformFloatVec4(wt.RENDER_EXTENT,S),this.helper.setUniformFloatValue(wt.RESOLUTION,f.resolution),this.helper.setUniformFloatValue(wt.ZOOM,f.zoom),this.helper.setUniformFloatValue(wt.TEXTURE_PIXEL_WIDTH,m),this.helper.setUniformFloatValue(wt.TEXTURE_PIXEL_HEIGHT,_),this.helper.setUniformFloatValue(wt.TEXTURE_RESOLUTION,s),this.helper.setUniformFloatValue(wt.TEXTURE_ORIGIN_X,a[0]+x*o[0]*s-c*s),this.helper.setUniformFloatValue(wt.TEXTURE_ORIGIN_Y,a[1]-w*o[1]*s+c*s),this.helper.drawElements(0,this.indices_.getSize())}getData(t){if(!this.helper.getGL())return null;const e=this.frameState;if(!e)return null;const n=this.getLayer(),i=le(e.pixelToCoordinateTransform,t.slice()),s=e.viewState,o=n.getExtent();if(o&&!gr(Or(o,s.projection),i))return null;const a=n.getSources(As([i]),s.resolution);let l,h,c;for(l=a.length-1;l>=0;--l)if(h=a[l],h.getState()==="ready"){if(c=h.getTileGridForProjection(s.projection),h.getWrapX())break;const d=c.getExtent();if(!d||gr(d,i))break}if(l<0)return null;const u=this.tileRepresentationCache;for(let d=c.getZForResolution(s.resolution);d>=c.getMinZoom();--d){const g=c.getTileCoordForCoordAndZ(i,d),f=eu(h,g);if(!u.containsKey(f))continue;const m=u.get(f),_=m.tile;if((_ instanceof js||_ instanceof Id)&&_.getState()===U.EMPTY)return null;if(!m.loaded)continue;const y=c.getOrigin(d),x=Jt(c.getTileSize(d)),w=c.getResolution(d),S=(i[0]-y[0])/w-g[1]*x[0],E=(y[1]-i[1])/w-g[2]*x[1];return m.getPixelData(S,E)}return null}disposeInternal(){const t=this.helper;if(t){const e=t.getGL();for(const n of this.paletteTextures_)n.delete(e);this.paletteTextures_.length=0,e.deleteProgram(this.program_),delete this.program_,t.deleteBuffer(this.indices_)}super.disposeInternal(),delete this.indices_}}function WC(r,t){return`operator_${r}_${Object.keys(t.functions).length}`}function Li(r){const t=r.toString();return t.includes(".")?t:t+".0"}function Ih(r){if(r.length<2||r.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${r.length}(${r.map(Li).join(", ")})`}function al(r){const t=jr(r),e=t.length>3?t[3]:1;return Ih([t[0]/255*e,t[1]/255*e,t[2]/255*e,e])}function qC(r){const t=Jt(r);return Ih(t)}const uc={};let ZC=0;function Dl(r){return r in uc||(uc[r]=ZC++),uc[r]}function Sn(r){return Li(Dl(r))}function Ld(r){return"u_var_"+r}function YC(){return{inFragmentShader:!1,variables:{},properties:{},functions:{},bandCount:0,style:{}}}const dc="getBandValue",w_="u_paletteTextures";function $C(r,t,e,n){const i=Gt(r,e,t);if(Ea(i.type,$i))throw new Error("No matching type was found");if(!Nr(t,i.type)){const s=xe(t),o=xe(i.type);throw new Error(`Expected expression to be of type ${s}, got ${o}`)}return Od(i,t,n)}function Ot(r){return(t,e,n)=>{const i=e.args.length,s=new Array(i);for(let o=0;o{const e=t.args[0].value;return e in r.properties||(r.properties[e]={name:e,type:t.type}),(r.inFragmentShader?"v_prop_":"a_prop_")+e},[N.GeometryType]:(r,t,e)=>{const n="geometryType";return n in r.properties||(r.properties[n]={name:n,type:_e,evaluator:i=>xd(i.getGeometry())}),(r.inFragmentShader?"v_prop_":"a_prop_")+n},[N.Var]:(r,t)=>{const e=t.args[0].value;return e in r.variables||(r.variables[e]={name:e,type:t.type}),Ld(e)},[N.Resolution]:()=>"u_resolution",[N.Zoom]:()=>"u_zoom",[N.Time]:()=>"u_time",[N.Any]:Ot(r=>`(${r.join(" || ")})`),[N.All]:Ot(r=>`(${r.join(" && ")})`),[N.Not]:Ot(([r])=>`(!${r})`),[N.Equal]:Ot(([r,t])=>`(${r} == ${t})`),[N.NotEqual]:Ot(([r,t])=>`(${r} != ${t})`),[N.GreaterThan]:Ot(([r,t])=>`(${r} > ${t})`),[N.GreaterThanOrEqualTo]:Ot(([r,t])=>`(${r} >= ${t})`),[N.LessThan]:Ot(([r,t])=>`(${r} < ${t})`),[N.LessThanOrEqualTo]:Ot(([r,t])=>`(${r} <= ${t})`),[N.Multiply]:Ot(r=>`(${r.join(" * ")})`),[N.Divide]:Ot(([r,t])=>`(${r} / ${t})`),[N.Add]:Ot(r=>`(${r.join(" + ")})`),[N.Subtract]:Ot(([r,t])=>`(${r} - ${t})`),[N.Clamp]:Ot(([r,t,e])=>`clamp(${r}, ${t}, ${e})`),[N.Mod]:Ot(([r,t])=>`mod(${r}, ${t})`),[N.Pow]:Ot(([r,t])=>`pow(${r}, ${t})`),[N.Abs]:Ot(([r])=>`abs(${r})`),[N.Floor]:Ot(([r])=>`floor(${r})`),[N.Ceil]:Ot(([r])=>`ceil(${r})`),[N.Round]:Ot(([r])=>`floor(${r} + 0.5)`),[N.Sin]:Ot(([r])=>`sin(${r})`),[N.Cos]:Ot(([r])=>`cos(${r})`),[N.Atan]:Ot(([r,t])=>t!==void 0?`atan(${r}, ${t})`:`atan(${r})`),[N.Sqrt]:Ot(([r])=>`sqrt(${r})`),[N.Match]:Ot(r=>{const t=r[0],e=r[r.length-1];let n=null;for(let i=r.length-3;i>=1;i-=2){const s=r[i],o=r[i+1];n=`(${t} == ${s} ? ${o} : ${n||e})`}return n}),[N.Between]:Ot(([r,t,e])=>`(${r} >= ${t} && ${r} <= ${e})`),[N.Interpolate]:Ot(([r,t,...e])=>{let n="";for(let i=0;i{const t=r[r.length-1];let e=null;for(let n=r.length-3;n>=0;n-=2){const i=r[n],s=r[n+1];e=`(${i} ? ${s} : ${e||t})`}return e}),[N.In]:Ot(([r,...t],e)=>{const n=WC("in",e),i=[];for(let s=0;s`vec${r.length}(${r.join(", ")})`),[N.Color]:Ot(r=>{if(r.length===1)return`vec4(vec3(${r[0]} / 255.0), 1.0)`;if(r.length===2)return`(${r[1]} * vec4(vec3(${r[0]} / 255.0), 1.0))`;const t=r.slice(0,3).map(e=>`${e} / 255.0`);return r.length===3?`vec4(${t.join(", ")}, 1.0)`:`(${r[3]} * vec4(${t.join(", ")}, 1.0))`}),[N.Band]:Ot(([r,t,e],n)=>{if(!(dc in n.functions)){let i="";const s=n.bandCount||1;for(let o=0;o{const[e,...n]=t.args,i=n.length,s=new Uint8Array(i*4);for(let h=0;h0)return Li(r.value);if((r.type&Ht)>0)return r.value.toString();if((r.type&_e)>0)return Sn(r.value.toString());if((r.type&jt)>0)return al(r.value);if((r.type&Me)>0)return Ih(r.value);if((r.type&Fr)>0)return qC(r.value);throw new Error(`Unexpected expression ${r.value} (expected type ${xe(t)})`)}function HC(){return{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"#3399CC","stroke-width":1.25,"circle-radius":5,"circle-fill-color":"rgba(255,255,255,0.4)","circle-stroke-width":1.25,"circle-stroke-color":"#3399CC"}}const is=`#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +uniform mat4 u_projectionMatrix; +uniform mat4 u_screenToWorldMatrix; +uniform vec2 u_viewportSizePx; +uniform float u_pixelRatio; +uniform float u_globalAlpha; +uniform float u_time; +uniform float u_zoom; +uniform float u_resolution; +uniform float u_rotation; +uniform vec4 u_renderExtent; +uniform vec2 u_patternOrigin; +uniform float u_depth; +uniform mediump int u_hitDetection; + +const float PI = 3.141592653589793238; +const float TWO_PI = 2.0 * PI; + +// this used to produce an alpha-premultiplied color from a texture +vec4 samplePremultiplied(sampler2D sampler, vec2 texCoord) { + vec4 color = texture2D(sampler, texCoord); + return vec4(color.rgb * color.a, color.a); +} +`,ss=HC();class S_{constructor(){this.uniforms_=[],this.attributes_=[],this.varyings_=[],this.hasSymbol_=!1,this.symbolSizeExpression_=`vec2(${Li(ss["circle-radius"])} + ${Li(ss["circle-stroke-width"]*.5)})`,this.symbolRotationExpression_="0.0",this.symbolOffsetExpression_="vec2(0.0)",this.symbolColorExpression_=al(ss["circle-fill-color"]),this.texCoordExpression_="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression_="false",this.symbolRotateWithView_=!1,this.hasStroke_=!1,this.strokeWidthExpression_=Li(ss["stroke-width"]),this.strokeColorExpression_=al(ss["stroke-color"]),this.strokeOffsetExpression_="0.",this.strokeCapExpression_=Sn("round"),this.strokeJoinExpression_=Sn("round"),this.strokeMiterLimitExpression_="10.",this.strokeDistanceFieldExpression_="-1000.",this.hasFill_=!1,this.fillColorExpression_=al(ss["fill-color"]),this.vertexShaderFunctions_=[],this.fragmentShaderFunctions_=[]}addUniform(t){return this.uniforms_.push(t),this}addAttribute(t){return this.attributes_.push(t),this}addVarying(t,e,n){return this.varyings_.push({name:t,type:e,expression:n}),this}setSymbolSizeExpression(t){return this.hasSymbol_=!0,this.symbolSizeExpression_=t,this}getSymbolSizeExpression(){return this.symbolSizeExpression_}setSymbolRotationExpression(t){return this.symbolRotationExpression_=t,this}setSymbolOffsetExpression(t){return this.symbolOffsetExpression_=t,this}getSymbolOffsetExpression(){return this.symbolOffsetExpression_}setSymbolColorExpression(t){return this.hasSymbol_=!0,this.symbolColorExpression_=t,this}getSymbolColorExpression(){return this.symbolColorExpression_}setTextureCoordinateExpression(t){return this.texCoordExpression_=t,this}setFragmentDiscardExpression(t){return this.discardExpression_=t,this}getFragmentDiscardExpression(){return this.discardExpression_}setSymbolRotateWithView(t){return this.symbolRotateWithView_=t,this}setStrokeWidthExpression(t){return this.hasStroke_=!0,this.strokeWidthExpression_=t,this}setStrokeColorExpression(t){return this.hasStroke_=!0,this.strokeColorExpression_=t,this}getStrokeColorExpression(){return this.strokeColorExpression_}setStrokeOffsetExpression(t){return this.strokeOffsetExpression_=t,this}setStrokeCapExpression(t){return this.strokeCapExpression_=t,this}setStrokeJoinExpression(t){return this.strokeJoinExpression_=t,this}setStrokeMiterLimitExpression(t){return this.strokeMiterLimitExpression_=t,this}setStrokeDistanceFieldExpression(t){return this.strokeDistanceFieldExpression_=t,this}setFillColorExpression(t){return this.hasFill_=!0,this.fillColorExpression_=t,this}getFillColorExpression(){return this.fillColorExpression_}addVertexShaderFunction(t){this.vertexShaderFunctions_.includes(t)||this.vertexShaderFunctions_.push(t)}addFragmentShaderFunction(t){this.fragmentShaderFunctions_.includes(t)||this.fragmentShaderFunctions_.push(t)}getSymbolVertexShader(){return this.hasSymbol_?`${is} +${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` +`)} +attribute vec2 a_position; +attribute float a_index; +attribute vec4 a_prop_hitColor; +${this.attributes_.map(function(t){return"attribute "+t+";"}).join(` +`)} +varying vec2 v_texCoord; +varying vec2 v_quadCoord; +varying vec4 v_prop_hitColor; +varying vec2 v_centerPx; +varying float v_angle; +varying vec2 v_quadSizePx; +${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` +`)} +${this.vertexShaderFunctions_.join(` +`)} +vec2 pxToScreen(vec2 coordPx) { + vec2 scaled = coordPx / u_viewportSizePx / 0.5; + return scaled; +} + +vec2 screenToPx(vec2 coordScreen) { + return (coordScreen * 0.5 + 0.5) * u_viewportSizePx; +} + +void main(void) { + v_quadSizePx = ${this.symbolSizeExpression_}; + vec2 halfSizePx = v_quadSizePx * 0.5; + vec2 centerOffsetPx = ${this.symbolOffsetExpression_}; + vec2 offsetPx = centerOffsetPx; + if (a_index == 0.0) { + offsetPx -= halfSizePx; + } else if (a_index == 1.0) { + offsetPx += halfSizePx * vec2(1., -1.); + } else if (a_index == 2.0) { + offsetPx += halfSizePx; + } else { + offsetPx += halfSizePx * vec2(-1., 1.); + } + float angle = ${this.symbolRotationExpression_}; + ${this.symbolRotateWithView_?"angle += u_rotation;":""} + float c = cos(-angle); + float s = sin(-angle); + offsetPx = vec2(c * offsetPx.x - s * offsetPx.y, s * offsetPx.x + c * offsetPx.y); + vec4 center = u_projectionMatrix * vec4(a_position, 0.0, 1.0); + gl_Position = center + vec4(pxToScreen(offsetPx), u_depth, 0.); + vec4 texCoord = ${this.texCoordExpression_}; + float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p; + float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q; + v_texCoord = vec2(u, v); + v_prop_hitColor = a_prop_hitColor; + v_angle = angle; + c = cos(-v_angle); + s = sin(-v_angle); + centerOffsetPx = vec2(c * centerOffsetPx.x - s * centerOffsetPx.y, s * centerOffsetPx.x + c * centerOffsetPx.y); + v_centerPx = screenToPx(center.xy) + centerOffsetPx; +${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(` +`)} +}`:null}getSymbolFragmentShader(){return this.hasSymbol_?`${is} +${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` +`)} +varying vec2 v_texCoord; +varying vec4 v_prop_hitColor; +varying vec2 v_centerPx; +varying float v_angle; +varying vec2 v_quadSizePx; +${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` +`)} +${this.fragmentShaderFunctions_.join(` +`)} + +void main(void) { + if (${this.discardExpression_}) { discard; } + vec2 coordsPx = gl_FragCoord.xy / u_pixelRatio - v_centerPx; // relative to center + float c = cos(v_angle); + float s = sin(v_angle); + coordsPx = vec2(c * coordsPx.x - s * coordsPx.y, s * coordsPx.x + c * coordsPx.y); + gl_FragColor = ${this.symbolColorExpression_}; + if (u_hitDetection > 0) { + if (gl_FragColor.a < 0.05) { discard; }; + gl_FragColor = v_prop_hitColor; + } +}`:null}getStrokeVertexShader(){return this.hasStroke_?`${is} +${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` +`)} +attribute vec2 a_position; +attribute float a_index; +attribute vec2 a_segmentStart; +attribute vec2 a_segmentEnd; +attribute float a_parameters; +attribute float a_distance; +attribute vec2 a_joinAngles; +attribute vec4 a_prop_hitColor; +${this.attributes_.map(function(t){return"attribute "+t+";"}).join(` +`)} +varying vec2 v_segmentStart; +varying vec2 v_segmentEnd; +varying float v_angleStart; +varying float v_angleEnd; +varying float v_width; +varying vec4 v_prop_hitColor; +varying float v_distanceOffsetPx; +${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` +`)} +${this.vertexShaderFunctions_.join(` +`)} +vec2 worldToPx(vec2 worldPos) { + vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0); + return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx; +} + +vec4 pxToScreen(vec2 pxPos) { + vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0; + return vec4(screenPos, u_depth, 1.0); +} + +bool isCap(float joinAngle) { + return joinAngle < -0.1; +} + +vec2 getJoinOffsetDirection(vec2 normalPx, float joinAngle) { + float halfAngle = joinAngle / 2.0; + float c = cos(halfAngle); + float s = sin(halfAngle); + vec2 angleBisectorNormal = vec2(s * normalPx.x + c * normalPx.y, -c * normalPx.x + s * normalPx.y); + float length = 1.0 / s; + return angleBisectorNormal * length; +} + +vec2 getOffsetPoint(vec2 point, vec2 normal, float joinAngle, float offsetPx) { + // if on a cap or the join angle is too high, offset the line along the segment normal + if (cos(joinAngle) > 0.998 || isCap(joinAngle)) { + return point - normal * offsetPx; + } + // offset is applied along the inverted normal (positive offset goes "right" relative to line direction) + return point - getJoinOffsetDirection(normal, joinAngle) * offsetPx; +} + +void main(void) { + v_angleStart = a_joinAngles.x; + v_angleEnd = a_joinAngles.y; + float vertexNumber = floor(abs(a_parameters) / 10000. + 0.5); + // we're reading the fractional part while keeping the sign (so -4.12 gives -0.12, 3.45 gives 0.45) + float angleTangentSum = fract(abs(a_parameters) / 10000.) * 10000. * sign(a_parameters); + + float lineWidth = ${this.strokeWidthExpression_}; + float lineOffsetPx = ${this.strokeOffsetExpression_}; + + // compute segment start/end in px with offset + vec2 segmentStartPx = worldToPx(a_segmentStart); + vec2 segmentEndPx = worldToPx(a_segmentEnd); + vec2 tangentPx = normalize(segmentEndPx - segmentStartPx); + vec2 normalPx = vec2(-tangentPx.y, tangentPx.x); + segmentStartPx = getOffsetPoint(segmentStartPx, normalPx, v_angleStart, lineOffsetPx), + segmentEndPx = getOffsetPoint(segmentEndPx, normalPx, v_angleEnd, lineOffsetPx); + + // compute current vertex position + float normalDir = vertexNumber < 0.5 || (vertexNumber > 1.5 && vertexNumber < 2.5) ? 1.0 : -1.0; + float tangentDir = vertexNumber < 1.5 ? 1.0 : -1.0; + float angle = vertexNumber < 1.5 ? v_angleStart : v_angleEnd; + vec2 joinDirection; + vec2 positionPx = vertexNumber < 1.5 ? segmentStartPx : segmentEndPx; + // if angle is too high, do not make a proper join + if (cos(angle) > ${lp} || isCap(angle)) { + joinDirection = normalPx * normalDir - tangentPx * tangentDir; + } else { + joinDirection = getJoinOffsetDirection(normalPx * normalDir, angle); + } + positionPx = positionPx + joinDirection * (lineWidth * 0.5 + 1.); // adding 1 pixel for antialiasing + gl_Position = pxToScreen(positionPx); + + v_segmentStart = segmentStartPx; + v_segmentEnd = segmentEndPx; + v_width = lineWidth; + v_prop_hitColor = a_prop_hitColor; + v_distanceOffsetPx = a_distance / u_resolution - (lineOffsetPx * angleTangentSum); +${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(` +`)} +}`:null}getStrokeFragmentShader(){return this.hasStroke_?`${is} +${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` +`)} +varying vec2 v_segmentStart; +varying vec2 v_segmentEnd; +varying float v_angleStart; +varying float v_angleEnd; +varying float v_width; +varying vec4 v_prop_hitColor; +varying float v_distanceOffsetPx; +${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` +`)} +${this.fragmentShaderFunctions_.join(` +`)} + +vec2 pxToWorld(vec2 pxPos) { + vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0; + return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy; +} + +bool isCap(float joinAngle) { + return joinAngle < -0.1; +} + +float segmentDistanceField(vec2 point, vec2 start, vec2 end, float width) { + vec2 tangent = normalize(end - start); + vec2 normal = vec2(-tangent.y, tangent.x); + vec2 startToPoint = point - start; + return abs(dot(startToPoint, normal)) - width * 0.5; +} + +float buttCapDistanceField(vec2 point, vec2 start, vec2 end) { + vec2 startToPoint = point - start; + vec2 tangent = normalize(end - start); + return dot(startToPoint, -tangent); +} + +float squareCapDistanceField(vec2 point, vec2 start, vec2 end, float width) { + return buttCapDistanceField(point, start, end) - width * 0.5; +} + +float roundCapDistanceField(vec2 point, vec2 start, vec2 end, float width) { + float onSegment = max(0., 1000. * dot(point - start, end - start)); // this is very high when inside the segment + return length(point - start) - width * 0.5 - onSegment; +} + +float roundJoinDistanceField(vec2 point, vec2 start, vec2 end, float width) { + return roundCapDistanceField(point, start, end, width); +} + +float bevelJoinField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) { + vec2 startToPoint = point - start; + vec2 tangent = normalize(end - start); + float c = cos(joinAngle * 0.5); + float s = sin(joinAngle * 0.5); + float direction = -sign(sin(joinAngle)); + vec2 bisector = vec2(c * tangent.x - s * tangent.y, s * tangent.x + c * tangent.y); + float radius = width * 0.5 * s; + return dot(startToPoint, bisector * direction) - radius; +} + +float miterJoinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) { + if (cos(joinAngle) > ${lp}) { // avoid risking a division by zero + return bevelJoinField(point, start, end, width, joinAngle); + } + float miterLength = 1. / sin(joinAngle * 0.5); + float miterLimit = ${this.strokeMiterLimitExpression_}; + if (miterLength > miterLimit) { + return bevelJoinField(point, start, end, width, joinAngle); + } + return -1000.; +} + +float capDistanceField(vec2 point, vec2 start, vec2 end, float width, float capType) { + if (capType == ${Sn("butt")}) { + return buttCapDistanceField(point, start, end); + } else if (capType == ${Sn("square")}) { + return squareCapDistanceField(point, start, end, width); + } + return roundCapDistanceField(point, start, end, width); +} + +float joinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float joinType) { + if (joinType == ${Sn("bevel")}) { + return bevelJoinField(point, start, end, width, joinAngle); + } else if (joinType == ${Sn("miter")}) { + return miterJoinDistanceField(point, start, end, width, joinAngle); + } + return roundJoinDistanceField(point, start, end, width); +} + +float computeSegmentPointDistance(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float capType, float joinType) { + if (isCap(joinAngle)) { + return capDistanceField(point, start, end, width, capType); + } + return joinDistanceField(point, start, end, width, joinAngle, joinType); +} + +void main(void) { + vec2 currentPoint = gl_FragCoord.xy / u_pixelRatio; + #ifdef GL_FRAGMENT_PRECISION_HIGH + vec2 worldPos = pxToWorld(currentPoint); + if ( + abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && ( + worldPos[0] < u_renderExtent[0] || + worldPos[1] < u_renderExtent[1] || + worldPos[0] > u_renderExtent[2] || + worldPos[1] > u_renderExtent[3] + ) + ) { + discard; + } + #endif + if (${this.discardExpression_}) { discard; } + + float segmentLength = length(v_segmentEnd - v_segmentStart); + vec2 segmentTangent = (v_segmentEnd - v_segmentStart) / segmentLength; + vec2 segmentNormal = vec2(-segmentTangent.y, segmentTangent.x); + vec2 startToPoint = currentPoint - v_segmentStart; + float currentLengthPx = max(0., min(dot(segmentTangent, startToPoint), segmentLength)) + v_distanceOffsetPx; + float currentRadiusPx = abs(dot(segmentNormal, startToPoint)); + float currentRadiusRatio = dot(segmentNormal, startToPoint) * 2. / v_width; + vec4 color = ${this.strokeColorExpression_} * u_globalAlpha; + float capType = ${this.strokeCapExpression_}; + float joinType = ${this.strokeJoinExpression_}; + float segmentStartDistance = computeSegmentPointDistance(currentPoint, v_segmentStart, v_segmentEnd, v_width, v_angleStart, capType, joinType); + float segmentEndDistance = computeSegmentPointDistance(currentPoint, v_segmentEnd, v_segmentStart, v_width, v_angleEnd, capType, joinType); + float distance = max( + segmentDistanceField(currentPoint, v_segmentStart, v_segmentEnd, v_width), + max(segmentStartDistance, segmentEndDistance) + ); + distance = max(distance, ${this.strokeDistanceFieldExpression_}); + gl_FragColor = color * smoothstep(0.5, -0.5, distance); + if (u_hitDetection > 0) { + if (gl_FragColor.a < 0.1) { discard; }; + gl_FragColor = v_prop_hitColor; + } +}`:null}getFillVertexShader(){return this.hasFill_?`${is} +${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` +`)} +attribute vec2 a_position; +attribute vec4 a_prop_hitColor; +${this.attributes_.map(function(t){return"attribute "+t+";"}).join(` +`)} +varying vec4 v_prop_hitColor; +${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` +`)} +${this.vertexShaderFunctions_.join(` +`)} +void main(void) { + gl_Position = u_projectionMatrix * vec4(a_position, u_depth, 1.0); + v_prop_hitColor = a_prop_hitColor; +${this.varyings_.map(function(t){return" "+t.name+" = "+t.expression+";"}).join(` +`)} +}`:null}getFillFragmentShader(){return this.hasFill_?`${is} +${this.uniforms_.map(function(t){return"uniform "+t+";"}).join(` +`)} +varying vec4 v_prop_hitColor; +${this.varyings_.map(function(t){return"varying "+t.type+" "+t.name+";"}).join(` +`)} +${this.fragmentShaderFunctions_.join(` +`)} +vec2 pxToWorld(vec2 pxPos) { + vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0; + return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy; +} + +vec2 worldToPx(vec2 worldPos) { + vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0); + return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx; +} + +void main(void) { + vec2 pxPos = gl_FragCoord.xy / u_pixelRatio; + vec2 pxOrigin = worldToPx(u_patternOrigin); + #ifdef GL_FRAGMENT_PRECISION_HIGH + vec2 worldPos = pxToWorld(pxPos); + if ( + abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && ( + worldPos[0] < u_renderExtent[0] || + worldPos[1] < u_renderExtent[1] || + worldPos[0] > u_renderExtent[2] || + worldPos[1] > u_renderExtent[3] + ) + ) { + discard; + } + #endif + if (${this.discardExpression_}) { discard; } + gl_FragColor = ${this.fillColorExpression_} * u_globalAlpha; + if (u_hitDetection > 0) { + if (gl_FragColor.a < 0.1) { discard; }; + gl_FragColor = v_prop_hitColor; + } +}`:null}}const Pr={BLUR:"blur",GRADIENT:"gradient",RADIUS:"radius"},KC=["#00f","#0ff","#0f0","#ff0","#f00"];class JC extends Ta{constructor(t){t=t||{};const e=Object.assign({},t);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,super(e),this.gradient_=null,this.addChangeListener(Pr.GRADIENT,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:KC),this.setBlur(t.blur!==void 0?t.blur:15),this.setRadius(t.radius!==void 0?t.radius:8);const n=t.weight?t.weight:"weight";typeof n=="string"?this.weightFunction_=function(i){return i.get(n)}:this.weightFunction_=n,this.setRenderOrder(null)}getBlur(){return this.get(Pr.BLUR)}getGradient(){return this.get(Pr.GRADIENT)}getRadius(){return this.get(Pr.RADIUS)}handleGradientChanged_(){this.gradient_=QC(this.getGradient())}setBlur(t){this.set(Pr.BLUR,t)}setGradient(t){this.set(Pr.GRADIENT,t)}setRadius(t){this.set(Pr.RADIUS,t)}createRenderer(){const t=new S_().addAttribute("float a_prop_weight").addVarying("v_prop_weight","float","a_prop_weight").addUniform("float u_size").addUniform("float u_blurSlope").setSymbolSizeExpression("vec2(u_size)").setSymbolColorExpression("vec4(smoothstep(0., 1., (1. - length(coordsPx * 2. / v_quadSizePx)) * u_blurSlope) * v_prop_weight)");return new __(this,{className:this.getClassName(),attributes:[{name:"weight",callback:e=>{const n=this.weightFunction_(e);return n!==void 0?xt(n,0,1):1}}],uniforms:{u_size:()=>(this.get(Pr.RADIUS)+this.get(Pr.BLUR))*2,u_blurSlope:()=>this.get(Pr.RADIUS)/Math.max(1,this.get(Pr.BLUR))},hitDetectionEnabled:!0,vertexShader:t.getSymbolVertexShader(),fragmentShader:t.getSymbolFragmentShader(),postProcesses:[{fragmentShader:` + precision mediump float; + + uniform sampler2D u_image; + uniform sampler2D u_gradientTexture; + uniform float u_opacity; + + varying vec2 v_texCoord; + + void main() { + vec4 color = texture2D(u_image, v_texCoord); + gl_FragColor.a = color.a * u_opacity; + gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb; + gl_FragColor.rgb *= gl_FragColor.a; + }`,uniforms:{u_gradientTexture:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}renderDeclutter(){}}function QC(r){const t=Vt(1,256),e=t.createLinearGradient(0,0,1,256),n=1/(r.length-1);for(let i=0,s=r.length;i=a.width)return null;const c=Zt(o),u=Math.floor(a.height*((o[3]-i[1])/c));return u<0||u>=a.height?null:this.getImageData(a,h,u)}renderFrame(t,e){const n=this.image_,i=n.getExtent(),s=n.getResolution(),[o,a]=Array.isArray(s)?s:[s,s],l=n.getPixelRatio(),h=t.layerStatesArray[t.layerIndex],c=t.pixelRatio,u=t.viewState,d=u.center,g=u.resolution,f=c*o/(g*l),m=c*a/(g*l);this.prepareContainer(t,e);const _=this.context.canvas.width,y=this.context.canvas.height,x=this.getRenderContext(t);let w=!1,S=!0;if(h.extent){const A=Or(h.extent,u.projection);S=$t(A,t.extent),w=S&&!We(A,t.extent),w&&this.clipUnrotated(x,t,A)}const E=n.getImage(),T=Tr(this.tempTransform,_/2,y/2,f,m,0,l*(i[0]-d[0])/o,l*(d[1]-i[3])/a);this.renderedResolution=a*c/l;const R=E.width*T[0],C=E.height*T[3];if(this.getLayer().getSource().getInterpolate()||(x.imageSmoothingEnabled=!1),this.preRender(x,t),S&&R>=.5&&C>=.5){const A=T[4],k=T[5],F=h.opacity;F!==1&&(x.save(),x.globalAlpha=F),x.drawImage(E,0,0,+E.width,+E.height,A,k,R,C),F!==1&&x.restore()}return this.postRender(this.context,t),w&&x.restore(),x.imageSmoothingEnabled=!0,this.container}}class Fd extends eI{constructor(t){super(t)}createRenderer(){return new E_(this)}getData(t){return super.getData(t)}}const ni={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class b_ extends Sa{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getPreload(){return this.get(ni.PRELOAD)}setPreload(t){this.set(ni.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(ni.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(ni.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}class T_ extends Sd{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=je(),this.tmpTileRange_=new Ch(0,0,0,0)}isDrawableTile(t){const e=this.getLayer(),n=t.getState(),i=e.getUseInterimTilesOnError();return n==U.LOADED||n==U.EMPTY||n==U.ERROR&&!i}getTile(t,e,n,i){const s=i.pixelRatio,o=i.viewState.projection,a=this.getLayer();let l=a.getSource().getTile(t,e,n,s,o);return l.getState()==U.ERROR&&a.getUseInterimTilesOnError()&&a.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(l)||(l=l.getInterimTile()),l}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),i=le(e.pixelToCoordinateTransform,t.slice()),s=n.getExtent();if(s&&!gr(s,i))return null;const o=e.pixelRatio,a=e.viewState.projection,l=e.viewState,h=n.getRenderSource(),c=h.getTileGridForProjection(l.projection),u=h.getTilePixelRatio(e.pixelRatio);for(let d=c.getZForResolution(l.resolution);d>=c.getMinZoom();--d){const g=c.getTileCoordForCoordAndZ(i,d),f=h.getTile(d,g[1],g[2],o,a);if(!(f instanceof Ra||f instanceof js)||f instanceof js&&f.getState()===U.EMPTY)return null;if(f.getState()!==U.LOADED)continue;const m=c.getOrigin(d),_=Jt(c.getTileSize(d)),y=c.getResolution(d),x=Math.floor(u*((i[0]-m[0])/y-g[1]*_[0])),w=Math.floor(u*((m[1]-i[1])/y-g[2]*_[1])),S=Math.round(u*h.getGutterForProjection(l.projection));return this.getImageData(f.getImage(),x+S,w+S)}return null}loadedTileCallback(t,e,n){return this.isDrawableTile(n)?super.loadedTileCallback(t,e,n):!1}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){const n=t.layerStatesArray[t.layerIndex],i=t.viewState,s=i.projection,o=i.resolution,a=i.center,l=i.rotation,h=t.pixelRatio,c=this.getLayer(),u=c.getSource(),d=u.getRevision(),g=u.getTileGridForProjection(s),f=g.getZForResolution(o,u.zDirection),m=g.getResolution(f);let _=t.extent;const y=t.viewState.resolution,x=u.getTilePixelRatio(h);this.prepareContainer(t,e);const w=this.context.canvas.width,S=this.context.canvas.height,E=n.extent&&Or(n.extent);E&&(_=fe(_,Or(n.extent)));const T=m*w/2/x,R=m*S/2/x,C=[a[0]-T,a[1]-R,a[0]+T,a[1]+R],A=g.getTileRangeForExtentAndZ(_,f),k={};k[f]={};const F=this.createLoadedTileFinder(u,s,k),z=this.tmpExtent,p=this.tmpTileRange_;this.newTiles_=!1;const v=l?Cc(i.center,y,l,t.size):void 0;for(let W=A.minX;W<=A.maxX;++W)for(let $=A.minY;$<=A.maxY;++$){if(l&&!g.tileCoordIntersectsViewport([f,W,$],v))continue;const st=this.getTile(f,W,$,t);if(this.isDrawableTile(st)){const ct=tt(this);if(st.getState()==U.LOADED){k[f][st.tileCoord.toString()]=st;let gt=st.inTransition(ct);gt&&n.opacity!==1&&(st.endTransition(ct),gt=!1),!this.newTiles_&&(gt||!this.renderedTiles.includes(st))&&(this.newTiles_=!0)}if(st.getAlpha(ct,t.time)===1)continue}const X=g.getTileCoordChildTileRange(st.tileCoord,p,z);let lt=!1;X&&(lt=F(f+1,X)),lt||g.forEachTileCoordParentTileRange(st.tileCoord,F,p,z)}const b=m/o*h/x,M=this.getRenderContext(t);Tr(this.tempTransform,w/2,S/2,b,b,0,-w/2,-S/2),E&&this.clipUnrotated(M,t,E),u.getInterpolate()||(M.imageSmoothingEnabled=!1),this.preRender(M,t),this.renderedTiles.length=0;let L=Object.keys(k).map(Number);L.sort(tn);let D,j,G;n.opacity===1&&(!this.containerReused||u.getOpaque(t.viewState.projection))?L=L.reverse():(D=[],j=[]);for(let W=L.length-1;W>=0;--W){const $=L[W],st=u.getTilePixelSize($,h,s),X=g.getResolution($)/m,lt=st[0]*X*b,ct=st[1]*X*b,gt=g.getTileCoordForCoordAndZ(Nn(C),$),qt=g.getTileCoordExtent(gt),Lt=le(this.tempTransform,[x*(qt[0]-C[0])/m,x*(C[3]-qt[3])/m]),Ut=x*u.getGutterForProjection(s),Qt=k[$];for(const me in Qt){const de=Qt[me],Ve=de.tileCoord,Oe=gt[1]-Ve[1],cn=Math.round(Lt[0]-(Oe-1)*lt),ka=gt[2]-Ve[2],jh=Math.round(Lt[1]-(ka-1)*ct),Cr=Math.round(Lt[0]-Oe*lt),pr=Math.round(Lt[1]-ka*ct),un=cn-Cr,mi=jh-pr,_i=f===$,Un=_i&&de.getAlpha(tt(this),t.time)!==1;let yi=!1;if(!Un)if(D){G=[Cr,pr,Cr+un,pr,Cr+un,pr+mi,Cr,pr+mi];for(let Bn=0,Hi=D.length;Bn{if(_.getState()!==J.LOADED)return;this.image_=m?null:_;const y=_.getPixelRatio(),x=Gl(_.getResolution())*e/y;this.renderedResolution=x,this.coordinateToVectorPixelTransform_=Tr(this.coordinateToVectorPixelTransform_,l/2,h/2,1/x,-1/x,0,-n.center[0],-n.center[1])}),_.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice()),!!this.image_}preRender(){}postRender(){}renderDeclutter(){}forEachFeatureAtCoordinate(t,e,n,i,s){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,e,n,i,s):super.forEachFeatureAtCoordinate(t,e,n,i,s)}}class nI extends Ta{constructor(t){t=t||{};const e=Object.assign({},t);delete e.imageRatio,super(e),this.imageRatio_=t.imageRatio!==void 0?t.imageRatio:1}getImageRatio(){return this.imageRatio_}createRenderer(){return new rI(this)}}const iI=nI,sI={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},pp={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class oI extends T_{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=ue(),this.tileClipContexts_=null}prepareTile(t,e,n){let i;const s=t.getState();return(s===U.LOADED||s===U.ERROR)&&(this.updateExecutorGroup_(t,e,n),this.tileImageNeedsRender_(t)&&(i=!0)),i}getTile(t,e,n,i){const s=i.pixelRatio,o=i.viewState,a=o.resolution,l=o.projection,h=this.getLayer(),c=h.getSource().getTile(t,e,n,s,l),u=i.viewHints,d=!(u[Kt.ANIMATING]||u[Kt.INTERACTING]);return(d||!c.wantedResolution)&&(c.wantedResolution=a),this.prepareTile(c,s,l)&&(d||Date.now()-i.time<8)&&h.getRenderMode()!=="vector"&&this.renderTileImage_(c,i),super.getTile(t,e,n,i)}isDrawableTile(t){const e=this.getLayer();return super.isDrawableTile(t)&&(e.getRenderMode()==="vector"?tt(e)in t.executorGroups:t.hasContext(e))}getTileImage(t){return t.getImage(this.getLayer())}prepareFrame(t){const e=this.getLayer().getRevision();return this.renderedLayerRevision_!==e&&(this.renderedLayerRevision_=e,this.renderedTiles.length=0),super.prepareFrame(t)}updateExecutorGroup_(t,e,n){const i=this.getLayer(),s=i.getRevision(),o=i.getRenderOrder()||null,a=t.wantedResolution,l=t.getReplayState(i);if(!l.dirty&&l.renderedResolution===a&&l.renderedRevision==s&&l.renderedRenderOrder==o)return;const h=i.getSource(),c=!!i.getDeclutter(),u=h.getTileGrid(),d=h.getTileGridForProjection(n).getTileCoordExtent(t.wrappedTileCoord),g=h.getSourceTiles(e,n,t),f=tt(i);delete t.hitDetectionImageData[f],t.executorGroups[f]=[],l.dirty=!1;for(let m=0,_=g.length;m<_;++m){const y=g[m];if(y.getState()!=U.LOADED)continue;const x=y.tileCoord,w=u.getTileCoordExtent(x),S=fe(d,w),E=br(S,i.getRenderBuffer()*a,this.tmpExtent),T=Pn(w,S)?null:E,R=new K0(0,S,a,e),C=Al(a,e),A=function(v,b){let M;const L=v.getStyleFunction()||i.getStyleFunction();if(L&&(M=L(v,a)),M){const D=this.renderFeature(v,C,M,R,c,b);l.dirty=l.dirty||D}},k=y.getFeatures();o&&o!==l.renderedRenderOrder&&k.sort(o);for(let v=0,b=k.length;v{const R=E?e.declutter[E].all().map(C=>C.value):null;for(let C=0,A=T.length;C{const i=this.getLayer(),s=tt(i),o=i.getSource(),a=this.renderedProjection,l=a.getExtent(),h=this.renderedResolution,c=o.getTileGridForProjection(a),u=le(this.renderedPixelToCoordinateTransform_,t.slice()),d=c.getTileCoordForCoordAndResolution(u,h);let g;for(let w=0,S=this.renderedTiles.length;w0){e([]);return}const f=c.getTileCoordExtent(g.wrappedTileCoord),m=Nn(f),_=[(u[0]-m[0])/h,(m[1]-u[1])/h],y=g.getSourceTiles().reduce(function(w,S){return w.concat(S.getFeatures())},[]);let x=g.hitDetectionImageData[s];if(!x){const w=Jt(c.getTileSize(c.getZForResolution(h,o.zDirection))),S=this.renderedRotation_,E=[this.getRenderTransform(c.getTileCoordCenter(g.wrappedTileCoord),h,0,ur,w[0]*ur,w[1]*ur,0)];x=e_(w,E,y,i.getStyleFunction(),c.getTileCoordExtent(g.wrappedTileCoord),g.getReplayState(i).renderedResolution,S),g.hitDetectionImageData[s]=x}e(r_(_,y,x))})}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.renderedLayerRevision_!==void 0&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}renderDeclutter(t,e){const n=this.context,i=n.globalAlpha;n.globalAlpha=e.opacity;const s=t.viewHints,o=!(s[Kt.ANIMATING]||s[Kt.INTERACTING]),a=this.renderedTiles;for(let l=0,h=a.length;l=0;--g)u[g].execute(this.context,[this.context.canvas.width,this.context.canvas.height],this.getTileRenderTransform(c,t),t.viewState.rotation,o,Pl,d?t.declutter[d]:void 0)}n.globalAlpha=i}renderDeferredInternal(t){const e=this.renderedTiles.reduce((s,o,a)=>(o.executorGroups[tt(this.getLayer())].forEach(l=>s.push({executorGroup:l,index:a})),s),[]),n=e.map(({executorGroup:s})=>s.getDeferredZIndexContexts()),i={};for(let s=0,o=e.length;s{n.forEach((o,a)=>{o[s]&&(o[s].forEach(l=>{const{executorGroup:h,index:c}=e[a],u=h.getRenderedContext(),d=u.globalAlpha;u.globalAlpha=this.renderedOpacity_;const g=this.tileClipContexts_[c];g&&g.draw(u),l.draw(u),g&&u.restore(),u.globalAlpha=d,l.clear()}),o[s].length=0)})})}getTileRenderTransform(t,e){const n=e.pixelRatio,i=e.viewState,s=i.center,o=i.resolution,a=i.rotation,l=e.size,h=Math.round(l[0]*n),c=Math.round(l[1]*n),u=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),d=t.tileCoord,g=u.getTileCoordExtent(t.wrappedTileCoord),f=u.getTileCoordExtent(d,this.tmpExtent)[0]-g[0];return Zs(Mo(this.inversePixelTransform.slice(),1/n,1/n),this.getRenderTransform(s,o,a,n,h,c,f))}postRender(t,e){var n;const i=e.viewHints,s=!(i[Kt.ANIMATING]||i[Kt.INTERACTING]);this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation,this.renderedOpacity_=e.layerStatesArray[e.layerIndex].opacity;const o=this.getLayer(),a=o.getRenderMode(),l=t.globalAlpha;t.globalAlpha=this.renderedOpacity_;const h=o.getDeclutter(),c=h?pp[a].filter(S=>!Pl.includes(S)):pp[a],u=e.viewState,d=u.rotation,g=o.getSource(),f=g.getTileGridForProjection(u.projection).getZForResolution(u.resolution,g.zDirection),m=this.renderedTiles,_=[],y=[],x=[];let w=!0;for(let S=m.length-1;S>=0;--S){const E=m[S];w=w&&!E.getReplayState(o).dirty;const T=E.executorGroups[tt(o)].filter(p=>p.hasExecutors(c));if(T.length===0)continue;const R=this.getTileRenderTransform(E,e),C=E.tileCoord[0];let A=!1;const k=T[0].getClipCoords(R);let F=t,z;if(k){z=new wd,F=z.getContext();for(let p=0,v=_.length;p1?`vec${t}`:"float"}function jl(r){return(JSON.stringify(r).split("").reduce((t,e)=>(t<<5)-t+e.charCodeAt(0),0)>>>0).toString()}function Dd(r,t,e,n){if(`${n}radius`in r&&n!=="icon-"){let i=_t(e,r[`${n}radius`],V);if(`${n}radius2`in r){const s=_t(e,r[`${n}radius2`],V);i=`max(${i}, ${s})`}`${n}stroke-width`in r&&(i=`(${i} + ${_t(e,r[`${n}stroke-width`],V)} * 0.5)`),t.setSymbolSizeExpression(`vec2(${i} * 2. + 0.5)`)}if(`${n}scale`in r){const i=_t(e,r[`${n}scale`],Fr);t.setSymbolSizeExpression(`${t.getSymbolSizeExpression()} * ${i}`)}`${n}displacement`in r&&t.setSymbolOffsetExpression(_t(e,r[`${n}displacement`],Me)),`${n}rotation`in r&&t.setSymbolRotationExpression(_t(e,r[`${n}rotation`],V)),`${n}rotate-with-view`in r&&t.setSymbolRotateWithView(!!r[`${n}rotate-with-view`])}function C_(r,t,e,n,i){let s="vec4(0.)";if(t!==null&&(s=t),e!==null&&n!==null){const l=`smoothstep(-${n} + 0.63, -${n} - 0.58, ${r})`;s=`mix(${e}, ${s}, ${l})`}const o=`(1.0 - smoothstep(-0.63, 0.58, ${r}))`;let a=`${s} * ${o}`;return i!==null&&(a=`${a} * ${i}`),a}function kd(r,t,e,n,i){const s=new Image;let o;return s.crossOrigin=r[`${n}cross-origin`]===void 0?"anonymous":r[`${n}cross-origin`],s.src=r[`${n}src`],s.complete&&s.width&&s.height?o=Ih([s.width,s.height]):(e[`u_texture${i}_size`]=()=>s.complete?[s.width,s.height]:[0,0],t.addUniform(`vec2 u_texture${i}_size`),o=`u_texture${i}_size`),e[`u_texture${i}`]=s,t.addUniform(`sampler2D u_texture${i}`),o}function Gd(r,t,e,n,i){let s=_t(e,r[`${t}offset`],Me);if(`${t}offset-origin`in r)switch(r[`${t}offset-origin`]){case"top-right":s=`vec2(${n}.x, 0.) + ${i} * vec2(-1., 0.) + ${s} * vec2(-1., 1.)`;break;case"bottom-left":s=`vec2(0., ${n}.y) + ${i} * vec2(0., -1.) + ${s} * vec2(1., -1.)`;break;case"bottom-right":s=`${n} - ${i} - ${s}`;break}return s}function lI(r,t,e,n,i){i.functions.circleDistanceField=`float circleDistanceField(vec2 point, float radius) { + return length(point) - radius; +}`,Dd(r,t,n,"circle-");let s=null;"circle-opacity"in r&&(s=_t(i,r["circle-opacity"],V));let o="coordsPx";"circle-scale"in r&&(o=`coordsPx / ${_t(i,r["circle-scale"],Fr)}`);let a=null;"circle-fill-color"in r&&(a=_t(i,r["circle-fill-color"],jt));let l=null;"circle-stroke-color"in r&&(l=_t(i,r["circle-stroke-color"],jt));let h=_t(i,r["circle-radius"],V),c=null;"circle-stroke-width"in r&&(c=_t(i,r["circle-stroke-width"],V),h=`(${h} + ${c} * 0.5)`);const u=`circleDistanceField(${o}, ${h})`,d=C_(u,a,l,c,s);t.setSymbolColorExpression(d)}function hI(r,t,e,n,i){i.functions.round=`float round(float v) { + return sign(v) * floor(abs(v) + 0.5); +}`,i.functions.starDistanceField=`float starDistanceField(vec2 point, float numPoints, float radius, float radius2, float angle) { + float startAngle = -PI * 0.5 + angle; // tip starts upwards and rotates clockwise with angle + float c = cos(startAngle); + float s = sin(startAngle); + vec2 pointRotated = vec2(c * point.x - s * point.y, s * point.x + c * point.y); + float alpha = TWO_PI / numPoints; // the angle of one sector + float beta = atan(pointRotated.y, pointRotated.x); + float gamma = round(beta / alpha) * alpha; // angle in sector + c = cos(-gamma); + s = sin(-gamma); + vec2 inSector = vec2(c * pointRotated.x - s * pointRotated.y, abs(s * pointRotated.x + c * pointRotated.y)); + vec2 tipToPoint = inSector + vec2(-radius, 0.); + vec2 edgeNormal = vec2(radius2 * sin(alpha * 0.5), -radius2 * cos(alpha * 0.5) + radius); + return dot(normalize(edgeNormal), tipToPoint); +}`,i.functions.regularDistanceField=`float regularDistanceField(vec2 point, float numPoints, float radius, float angle) { + float startAngle = -PI * 0.5 + angle; // tip starts upwards and rotates clockwise with angle + float c = cos(startAngle); + float s = sin(startAngle); + vec2 pointRotated = vec2(c * point.x - s * point.y, s * point.x + c * point.y); + float alpha = TWO_PI / numPoints; // the angle of one sector + float radiusIn = radius * cos(PI / numPoints); + float beta = atan(pointRotated.y, pointRotated.x); + float gamma = round((beta - alpha * 0.5) / alpha) * alpha + alpha * 0.5; // angle in sector from mid + c = cos(-gamma); + s = sin(-gamma); + vec2 inSector = vec2(c * pointRotated.x - s * pointRotated.y, abs(s * pointRotated.x + c * pointRotated.y)); + return inSector.x - radiusIn; +}`,Dd(r,t,n,"shape-");let s=null;"shape-opacity"in r&&(s=_t(i,r["shape-opacity"],V));let o="coordsPx";"shape-scale"in r&&(o=`coordsPx / ${_t(i,r["shape-scale"],Fr)}`);let a=null;"shape-fill-color"in r&&(a=_t(i,r["shape-fill-color"],jt));let l=null;"shape-stroke-color"in r&&(l=_t(i,r["shape-stroke-color"],jt));let h=null;"shape-stroke-width"in r&&(h=_t(i,r["shape-stroke-width"],V));const c=_t(i,r["shape-points"],V);let u="0.";"shape-angle"in r&&(u=_t(i,r["shape-angle"],V));let d,g=_t(i,r["shape-radius"],V);if(h!==null&&(g=`${g} + ${h} * 0.5`),"shape-radius2"in r){let m=_t(i,r["shape-radius2"],V);h!==null&&(m=`${m} + ${h} * 0.5`),d=`starDistanceField(${o}, ${c}, ${g}, ${m}, ${u})`}else d=`regularDistanceField(${o}, ${c}, ${g}, ${u})`;const f=C_(d,a,l,h,s);t.setSymbolColorExpression(f)}function cI(r,t,e,n,i){let s="vec4(1.0)";"icon-color"in r&&(s=_t(i,r["icon-color"],jt)),"icon-opacity"in r&&(s=`${s} * ${_t(i,r["icon-opacity"],V)}`);const o=jl(r["icon-src"]),a=kd(r,t,e,"icon-",o);if(t.setSymbolColorExpression(`${s} * samplePremultiplied(u_texture${o}, v_texCoord)`).setSymbolSizeExpression(a),"icon-width"in r&&"icon-height"in r&&t.setSymbolSizeExpression(`vec2(${_t(n,r["icon-width"],V)}, ${_t(n,r["icon-height"],V)})`),"icon-offset"in r&&"icon-size"in r){const l=_t(n,r["icon-size"],Me),h=t.getSymbolSizeExpression();t.setSymbolSizeExpression(l);const c=Gd(r,"icon-",n,"v_quadSizePx",l);t.setTextureCoordinateExpression(`(vec4((${c}).xyxy) + vec4(0., 0., ${l})) / (${h}).xyxy`)}if(Dd(r,t,n,"icon-"),"icon-anchor"in r){const l=_t(n,r["icon-anchor"],Me);let h="1.0";"icon-scale"in r&&(h=_t(n,r["icon-scale"],Fr));let c;r["icon-anchor-x-units"]==="pixels"&&r["icon-anchor-y-units"]==="pixels"?c=`${l} * ${h}`:r["icon-anchor-x-units"]==="pixels"?c=`${l} * vec2(vec2(${h}).x, v_quadSizePx.y)`:r["icon-anchor-y-units"]==="pixels"?c=`${l} * vec2(v_quadSizePx.x, vec2(${h}).x)`:c=`${l} * v_quadSizePx`;let u=`v_quadSizePx * vec2(0.5, -0.5) + ${c} * vec2(-1., 1.)`;if("icon-anchor-origin"in r)switch(r["icon-anchor-origin"]){case"top-right":u=`v_quadSizePx * -0.5 + ${c}`;break;case"bottom-left":u=`v_quadSizePx * 0.5 - ${c}`;break;case"bottom-right":u=`v_quadSizePx * vec2(-0.5, 0.5) + ${c} * vec2(1., -1.)`;break}t.setSymbolOffsetExpression(`${t.getSymbolOffsetExpression()} + ${u}`)}}function uI(r,t,e,n,i){if("stroke-color"in r&&t.setStrokeColorExpression(_t(i,r["stroke-color"],jt)),"stroke-pattern-src"in r){const s=jl(r["stroke-pattern-src"]),o=kd(r,t,e,"stroke-pattern-",s);let a=o,l="vec2(0.)";"stroke-pattern-offset"in r&&"stroke-pattern-size"in r&&(a=_t(i,r["stroke-pattern-size"],Me),l=Gd(r,"stroke-pattern-",i,o,a));let h="0.";"stroke-pattern-spacing"in r&&(h=_t(i,r["stroke-pattern-spacing"],V)),i.functions.sampleStrokePattern=`vec4 sampleStrokePattern(sampler2D texture, vec2 textureSize, vec2 textureOffset, vec2 sampleSize, float spacingPx, float currentLengthPx, float currentRadiusRatio, float lineWidth) { + float currentLengthScaled = currentLengthPx * sampleSize.y / lineWidth; + float spacingScaled = spacingPx * sampleSize.y / lineWidth; + float uCoordPx = mod(currentLengthScaled, (sampleSize.x + spacingScaled)); + // make sure that we're not sampling too close to the borders to avoid interpolation with outside pixels + uCoordPx = clamp(uCoordPx, 0.5, sampleSize.x - 0.5); + float vCoordPx = (-currentRadiusRatio * 0.5 + 0.5) * sampleSize.y; + vec2 texCoord = (vec2(uCoordPx, vCoordPx) + textureOffset) / textureSize; + return samplePremultiplied(texture, texCoord); +}`;const c=`u_texture${s}`;let u="1.";"stroke-color"in r&&(u=t.getStrokeColorExpression()),t.setStrokeColorExpression(`${u} * sampleStrokePattern(${c}, ${o}, ${l}, ${a}, ${h}, currentLengthPx, currentRadiusRatio, v_width)`)}if("stroke-width"in r&&t.setStrokeWidthExpression(_t(n,r["stroke-width"],V)),"stroke-offset"in r&&t.setStrokeOffsetExpression(_t(n,r["stroke-offset"],V)),"stroke-line-cap"in r&&t.setStrokeCapExpression(_t(n,r["stroke-line-cap"],_e)),"stroke-line-join"in r&&t.setStrokeJoinExpression(_t(n,r["stroke-line-join"],_e)),"stroke-miter-limit"in r&&t.setStrokeMiterLimitExpression(_t(n,r["stroke-miter-limit"],V)),"stroke-line-dash"in r){i.functions.getSingleDashDistance=`float getSingleDashDistance(float distance, float radius, float dashOffset, float dashLength, float dashLengthTotal, float capType) { + float localDistance = mod(distance, dashLengthTotal); + float distanceSegment = abs(localDistance - dashOffset - dashLength * 0.5) - dashLength * 0.5; + distanceSegment = min(distanceSegment, dashLengthTotal - localDistance); + if (capType == ${Sn("square")}) { + distanceSegment -= v_width * 0.5; + } else if (capType == ${Sn("round")}) { + distanceSegment = min(distanceSegment, sqrt(distanceSegment * distanceSegment + radius * radius) - v_width * 0.5); + } + return distanceSegment; +}`;let s=r["stroke-line-dash"].map(d=>_t(i,d,V));s.length%2===1&&(s=[...s,...s]);let o="0.";"stroke-line-dash-offset"in r&&(o=_t(n,r["stroke-line-dash-offset"],V));const a=`dashDistanceField_${jl(r["stroke-line-dash"])}`,l=s.map((d,g)=>`float dashLength${g} = ${d};`),h=s.map((d,g)=>`dashLength${g}`).join(" + ");let c="0.",u=`getSingleDashDistance(distance, radius, ${c}, dashLength0, totalDashLength, capType)`;for(let d=2;dDl(r.variables[a.name]):a.type===jt?h=()=>mp([...jr(r.variables[a.name]||"#eee")]):a.type===Ht?h=()=>r.variables[a.name]?1:0:h=()=>r.variables[a.name],i[l]=h}),Object.keys(e.properties).forEach(function(o){const a=e.properties[o];t.properties[o]||(t.properties[o]=a);let l=gc(a.type),h=`a_prop_${a.name}`;a.type===jt&&(l="vec4",h=`unpackColor(${h})`,n.addVertexShaderFunction(aI)),n.addVarying(`v_prop_${a.name}`,l,h)}),Object.keys(t.properties).forEach(function(o){const a=t.properties[o];n.addAttribute(`${gc(a.type)} a_prop_${a.name}`)});const s=Object.keys(t.properties).map(function(o){const a=t.properties[o];let l;return a.evaluator?l=a.evaluator:a.type===_e?l=h=>Dl(h.get(a.name)):a.type===jt?l=h=>mp([...jr(h.get(a.name)||"#eee")]):a.type===Ht?l=h=>h.get(a.name)?1:0:l=h=>h.get(a.name),{name:a.name,size:R_(a.type),callback:l}});for(const o in t.functions)n.addVertexShaderFunction(t.functions[o]);for(const o in e.functions)n.addFragmentShaderFunction(e.functions[o]);return{builder:n,attributes:s.reduce((o,a)=>({...o,[a.name]:{callback:a.callback,size:a.size}}),{}),uniforms:i}}class fI extends Sa{constructor(t){const e=Object.assign({},t);super(e),this.parseResult_=gI(t.style),this.styleVariables_=t.style.variables||{},this.hitDetectionDisabled_=!!t.disableHitDetection}createRenderer(){const t=Object.keys(this.parseResult_.attributes).map(e=>({name:e,...this.parseResult_.attributes[e]}));return new __(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitDetectionEnabled:!this.hitDetectionDisabled_,uniforms:this.parseResult_.uniforms,attributes:t})}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}}const pI=fI;function _p(r,t){const e=` + attribute vec2 ${ol.TEXTURE_COORD}; + uniform mat4 ${wt.TILE_TRANSFORM}; + uniform float ${wt.TEXTURE_PIXEL_WIDTH}; + uniform float ${wt.TEXTURE_PIXEL_HEIGHT}; + uniform float ${wt.TEXTURE_RESOLUTION}; + uniform float ${wt.TEXTURE_ORIGIN_X}; + uniform float ${wt.TEXTURE_ORIGIN_Y}; + uniform float ${wt.DEPTH}; + + varying vec2 v_textureCoord; + varying vec2 v_mapCoord; + + void main() { + v_textureCoord = ${ol.TEXTURE_COORD}; + v_mapCoord = vec2( + ${wt.TEXTURE_ORIGIN_X} + ${wt.TEXTURE_RESOLUTION} * ${wt.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0], + ${wt.TEXTURE_ORIGIN_Y} - ${wt.TEXTURE_RESOLUTION} * ${wt.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1] + ); + gl_Position = ${wt.TILE_TRANSFORM} * vec4(${ol.TEXTURE_COORD}, ${wt.DEPTH}, 1.0); + } + `,n={...YC(),inFragmentShader:!0,bandCount:t,style:r},i=[];if(r.color!==void 0){const u=_t(n,r.color,jt);i.push(`color = ${u};`)}if(r.contrast!==void 0){const u=_t(n,r.contrast,V);i.push(`color.rgb = clamp((${u} + 1.0) * color.rgb - (${u} / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(r.exposure!==void 0){const u=_t(n,r.exposure,V);i.push(`color.rgb = clamp((${u} + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(r.saturation!==void 0){const u=_t(n,r.saturation,V);i.push(` + float saturation = ${u} + 1.0; + float sr = (1.0 - saturation) * 0.2126; + float sg = (1.0 - saturation) * 0.7152; + float sb = (1.0 - saturation) * 0.0722; + mat3 saturationMatrix = mat3( + sr + saturation, sr, sr, + sg, sg + saturation, sg, + sb, sb, sb + saturation + ); + color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0)); + `)}if(r.gamma!==void 0){const u=_t(n,r.gamma,V);i.push(`color.rgb = pow(color.rgb, vec3(1.0 / ${u}));`)}if(r.brightness!==void 0){const u=_t(n,r.brightness,V);i.push(`color.rgb = clamp(color.rgb + ${u}, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}const s={},o=Object.keys(n.variables).length;if(o>1&&!r.variables)throw new Error(`Missing variables in style (expected ${n.variables})`);for(let u=0;u ${wt.RENDER_EXTENT}[2] || + v_mapCoord[1] > ${wt.RENDER_EXTENT}[3] + ) { + discard; + } + + vec4 color = texture2D(${wt.TILE_TEXTURE_ARRAY}[0], v_textureCoord); + + ${i.join(` +`)} + + gl_FragColor = color; + gl_FragColor.rgb *= gl_FragColor.a; + gl_FragColor *= ${wt.TRANSITION_ALPHA}; + }`;return{vertexShader:e,fragmentShader:c,uniforms:s,paletteTextures:n.paletteTextures}}class zl extends b_{constructor(t){t=t?Object.assign({},t):{};const e=t.style||{};delete t.style;const n=t.cacheSize;delete t.cacheSize,super(t),this.sources_=t.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=e,this.cacheSize_=n,this.styleVariables_=this.style_.variables||{},this.addChangeListener(kt.SOURCE,this.handleSourceUpdate_)}getSources(t,e){const n=this.getSource();return this.sources_?typeof this.sources_=="function"?this.sources_(t,e):this.sources_:n?[n]:[]}getRenderSource(){return this.renderedSource_||this.getSource()}getSourceState(){const t=this.getRenderSource();return t?t.getState():"undefined"}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache(),this.getSource()&&this.setStyle(this.style_)}getSourceBandCount_(){const t=Number.MAX_SAFE_INTEGER,e=this.getSources([-t,-t,t,t],t);return e&&e.length&&"bandCount"in e[0]?e[0].bandCount:4}createRenderer(){const t=_p(this.style_,this.getSourceBandCount_());return new XC(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.cacheSize_,paletteTextures:t.paletteTextures})}renderSources(t,e){const n=this.getRenderer();let i;for(let s=0,o=e.length;s{h.getState()=="ready"&&(h.removeEventListener("change",u),this.changed())};h.addEventListener("change",u)}s=s&&c=="ready"}const o=this.renderSources(t,i);if(this.getRenderer().renderComplete&&s)return this.renderedResolution_=n.resolution,o;if(this.renderedResolution_>.5*n.resolution){const a=this.getSources(t.extent,this.renderedResolution_).filter(l=>!i.includes(l));if(a.length>0)return this.renderSources(t,a)}return o}setStyle(t){this.styleVariables_=t.variables||{},this.style_=t;const e=_p(this.style_,this.getSourceBandCount_());this.getRenderer().reset({vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,paletteTextures:e.paletteTextures}),this.changed()}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}}zl.prototype.dispose;const mI=Object.freeze(Object.defineProperty({__proto__:null,Graticule:ZR,Group:Sh,Heatmap:tI,Image:Fd,Layer:Sa,Tile:kl,Vector:Ed,VectorImage:iI,VectorTile:M_,WebGLPoints:pI,WebGLTile:zl},Symbol.toStringTag,{value:"Module"}));var Xe=(r,t,e)=>new Promise((n,i)=>{var s=l=>{try{a(e.next(l))}catch(h){i(h)}},o=l=>{try{a(e.throw(l))}catch(h){i(h)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,o);a((e=e.apply(r,t)).next())}),dr=Uint8Array,Lo=Uint16Array,_I=Int32Array,I_=new dr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),P_=new dr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),yI=new dr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A_=function(r,t){for(var e=new Lo(31),n=0;n<31;++n)e[n]=t+=1<>1|(zt&21845)<<1,yn=(yn&52428)>>2|(yn&13107)<<2,yn=(yn&61680)>>4|(yn&3855)<<4,F_[zt]=((yn&65280)>>8|(yn&255)<<8)>>1;var yn,zt,Oo=function(r,t,e){for(var n=r.length,i=0,s=new Lo(t);i>l]=h}return a},Ca=new dr(288);for(zt=0;zt<144;++zt)Ca[zt]=8;var zt;for(zt=144;zt<256;++zt)Ca[zt]=9;var zt;for(zt=256;zt<280;++zt)Ca[zt]=7;var zt;for(zt=280;zt<288;++zt)Ca[zt]=8;var zt,N_=new dr(32);for(zt=0;zt<32;++zt)N_[zt]=5;var zt,SI=Oo(Ca,9),EI=Oo(N_,5),fc=function(r){for(var t=r[0],e=1;et&&(t=r[e]);return t},Ar=function(r,t,e){var n=t/8|0;return(r[n]|r[n+1]<<8)>>(t&7)&e},pc=function(r,t){var e=t/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(t&7)},bI=function(r){return(r+7)/8|0},TI=function(r,t,e){(e==null||e>r.length)&&(e=r.length);var n=new dr(e-t);return n.set(r.subarray(t,e)),n},MI=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],hr=function(r,t,e){var n=new Error(t||MI[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,hr),!e)throw n;return n},jd=function(r,t,e,n){var i=r.length,s=0;if(!i||t.f&&!t.l)return e||new dr(0);var o=!e||t.i!=2,a=t.i;e||(e=new dr(i*3));var l=function(Ut){var Qt=e.length;if(Ut>Qt){var me=new dr(Math.max(Qt*2,Ut));me.set(e),e=me}},h=t.f||0,c=t.p||0,u=t.b||0,d=t.l,g=t.d,f=t.m,m=t.n,_=i*8;do{if(!d){h=Ar(r,c,1);var y=Ar(r,c+1,3);if(c+=3,y)if(y==1)d=SI,g=EI,f=9,m=5;else if(y==2){var x=Ar(r,c,31)+257,w=Ar(r,c+10,15)+4,S=x+Ar(r,c+5,31)+1;c+=14;for(var E=new dr(S),T=new dr(19),R=0;R>4;if(z<16)E[R++]=z;else{var p=0,v=0;for(z==16?(v=3+Ar(r,c,3),c+=2,p=E[R-1]):z==17?(v=3+Ar(r,c,7),c+=3):z==18&&(v=11+Ar(r,c,127),c+=7);v--;)E[R++]=p}}var b=E.subarray(0,x),M=E.subarray(x);f=fc(b),m=fc(M),d=Oo(b,f),g=Oo(M,m)}else hr(1);else{var z=bI(c)+4,L=r[z-4]|r[z-3]<<8,D=z+L;if(D>i){a&&hr(0);break}o&&l(u+L),e.set(r.subarray(z,D),u),t.b=u+=L,t.p=c=D*8,t.f=h;continue}if(c>_){a&&hr(0);break}}o&&l(u+131072);for(var j=(1<>4;if(c+=p&15,c>_){a&&hr(0);break}if(p||hr(2),$<256)e[u++]=$;else if($==256){W=c,d=null;break}else{var st=$-254;if($>264){var R=$-257,X=I_[R];st=Ar(r,c,(1<>4;lt||hr(3),c+=lt&15;var M=wI[ct];if(ct>3){var X=P_[ct];M+=pc(r,c)&(1<_){a&&hr(0);break}o&&l(u+131072);var gt=u+st;if(u>3&1)+(t>>4&1);n>0;n-=!r[e++]);return e+(t&2)},II=function(r){var t=r.length;return(r[t-4]|r[t-3]<<8|r[t-2]<<16|r[t-1]<<24)>>>0},PI=function(r,t){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&hr(6,"invalid zlib data"),(r[1]>>5&1)==+!t&&hr(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function AI(r,t){return jd(r,{i:2},t,t)}function LI(r,t){var e=CI(r);return e+8>r.length&&hr(6,"invalid gzip data"),jd(r.subarray(e,-8),{i:2},new dr(II(r)),t)}function OI(r,t){return jd(r.subarray(PI(r,t),-4),{i:2},t,t)}function ru(r,t){return r[0]==31&&r[1]==139&&r[2]==8?LI(r,t):(r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31?AI(r,t):OI(r,t)}var FI=typeof TextDecoder<"u"&&new TextDecoder,NI=0;try{FI.decode(RI,{stream:!0}),NI=1}catch{}var D_=(r,t)=>r*Math.pow(2,t),go=(r,t)=>Math.floor(r/Math.pow(2,t)),Ul=(r,t)=>D_(r.getUint16(t+1,!0),8)+r.getUint8(t),k_=(r,t)=>D_(r.getUint32(t+2,!0),16)+r.getUint16(t,!0),DI=(r,t,e,n,i)=>{if(r!=n.getUint8(i))return r-n.getUint8(i);const s=Ul(n,i+1);if(t!=s)return t-s;const o=Ul(n,i+4);return e!=o?e-o:0},kI=(r,t,e,n)=>{const i=G_(r,t|128,e,n);return i?{z:t,x:e,y:n,offset:i[0],length:i[1],is_dir:!0}:null},yp=(r,t,e,n)=>{const i=G_(r,t,e,n);return i?{z:t,x:e,y:n,offset:i[0],length:i[1],is_dir:!1}:null},G_=(r,t,e,n)=>{let i=0,s=r.byteLength/17-1;for(;i<=s;){const o=s+i>>1,a=DI(t,e,n,r,o*17);if(a>0)i=o+1;else if(a<0)s=o-1;else return[k_(r,o*17+7),r.getUint32(o*17+13,!0)]}return null},GI=(r,t)=>r.is_dir&&!t.is_dir?1:!r.is_dir&&t.is_dir?-1:r.z!==t.z?r.z-t.z:r.x!==t.x?r.x-t.x:r.y-t.y,j_=(r,t)=>{const e=r.getUint8(t*17);return{z:e&127,x:Ul(r,t*17+1),y:Ul(r,t*17+4),offset:k_(r,t*17+7),length:r.getUint32(t*17+13,!0),is_dir:e>>7===1}},xp=r=>{const t=[],e=new DataView(r);for(let n=0;n{r.sort(GI);const t=new ArrayBuffer(17*r.length),e=new Uint8Array(t);for(let n=0;n>8&255,e[n*17+3]=i.x>>16&255,e[n*17+4]=i.y&255,e[n*17+5]=i.y>>8&255,e[n*17+6]=i.y>>16&255,e[n*17+7]=i.offset&255,e[n*17+8]=go(i.offset,8)&255,e[n*17+9]=go(i.offset,16)&255,e[n*17+10]=go(i.offset,24)&255,e[n*17+11]=go(i.offset,32)&255,e[n*17+12]=go(i.offset,48)&255,e[n*17+13]=i.length&255,e[n*17+14]=i.length>>8&255,e[n*17+15]=i.length>>16&255,e[n*17+16]=i.length>>24&255}return t},zI=(r,t)=>{if(r.byteLength<17)return null;const e=r.byteLength/17,n=j_(r,e-1);if(n.is_dir){const i=n.z,s=t.z-i,o=Math.trunc(t.x/(1<>>0)*4294967296+(r>>>0)}function WI(r,t){const e=t.buf;let n,i;if(i=e[t.pos++],n=(i&112)>>4,i<128||(i=e[t.pos++],n|=(i&127)<<3,i<128)||(i=e[t.pos++],n|=(i&127)<<10,i<128)||(i=e[t.pos++],n|=(i&127)<<17,i<128)||(i=e[t.pos++],n|=(i&127)<<24,i<128)||(i=e[t.pos++],n|=(i&1)<<31,i<128))return XI(r,n);throw new Error("Expected varint not more than 10 bytes")}function fo(r){const t=r.buf;let e,n;return n=t[r.pos++],e=n&127,n<128||(n=t[r.pos++],e|=(n&127)<<7,n<128)||(n=t[r.pos++],e|=(n&127)<<14,n<128)||(n=t[r.pos++],e|=(n&127)<<21,n<128)?e:(n=t[r.pos],e|=(n&15)<<28,WI(e,r))}function qI(r,t,e,n){if(n==0){e==1&&(t[0]=r-1-t[0],t[1]=r-1-t[1]);const i=t[0];t[0]=t[1],t[1]=i}}var ZI=[0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,0x5555555555555];function YI(r,t,e){if(r>26)throw Error("Tile zoom level exceeds max safe number limit (26)");if(t>Math.pow(2,r)-1||e>Math.pow(2,r)-1)throw Error("tile x/y outside zoom level bounds");const n=ZI[r],i=Math.pow(2,r);let s=0,o=0,a=0;const l=[t,e];let h=i/2;for(;h>0;)s=(l[0]&h)>0?1:0,o=(l[1]&h)>0?1:0,a+=h*h*(3*s^o),qI(h,l,s,o),h=h/2;return n+a}function U_(r,t){return Xe(this,null,function*(){if(t===1||t===0)return r;if(t===2){if(typeof globalThis.DecompressionStream>"u")return ru(new Uint8Array(r));{let e=new Response(r).body.pipeThrough(new globalThis.DecompressionStream("gzip"));return new Response(e).arrayBuffer()}}else throw Error("Compression method not supported")})}var ds=(r=>(r[r.Unknown=0]="Unknown",r[r.Mvt=1]="Mvt",r[r.Png=2]="Png",r[r.Jpeg=3]="Jpeg",r[r.Webp=4]="Webp",r[r.Avif=5]="Avif",r))(ds||{}),$I=127;function VI(r,t){let e=0,n=r.length-1;for(;e<=n;){const i=n+e>>1,s=t-r[i].tileId;if(s>0)e=i+1;else if(s<0)n=i-1;else return r[i]}return n>=0&&(r[n].runLength===0||t-r[n].tileId=300)throw Error("Bad response code: "+s.status);const o=s.headers.get("Content-Length");if(s.status===200&&(!o||+o>t))throw n&&n.abort(),Error("Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.");return{data:yield s.arrayBuffer(),etag:s.headers.get("ETag")||void 0,cacheControl:s.headers.get("Cache-Control")||void 0,expires:s.headers.get("Expires")||void 0}})}};function Lr(r,t){const e=r.getUint32(t+4,!0),n=r.getUint32(t+0,!0);return e*Math.pow(2,32)+n}function KI(r,t){const e=new DataView(r),n=e.getUint8(7);if(n>3)throw Error(`Archive is spec version ${n} but this library supports up to spec version 3`);return{specVersion:n,rootDirectoryOffset:Lr(e,8),rootDirectoryLength:Lr(e,16),jsonMetadataOffset:Lr(e,24),jsonMetadataLength:Lr(e,32),leafDirectoryOffset:Lr(e,40),leafDirectoryLength:Lr(e,48),tileDataOffset:Lr(e,56),tileDataLength:Lr(e,64),numAddressedTiles:Lr(e,72),numTileEntries:Lr(e,80),numTileContents:Lr(e,88),clustered:e.getUint8(96)===1,internalCompression:e.getUint8(97),tileCompression:e.getUint8(98),tileType:e.getUint8(99),minZoom:e.getUint8(100),maxZoom:e.getUint8(101),minLon:e.getInt32(102,!0)/1e7,minLat:e.getInt32(106,!0)/1e7,maxLon:e.getInt32(110,!0)/1e7,maxLat:e.getInt32(114,!0)/1e7,centerZoom:e.getUint8(118),centerLon:e.getInt32(119,!0)/1e7,centerLat:e.getInt32(123,!0)/1e7,etag:t}}function B_(r){const t={buf:new Uint8Array(r),pos:0},e=fo(t),n=[];let i=0;for(let s=0;s0?n[s].offset=n[s-1].offset+n[s-1].length:n[s].offset=o-1}return n}function JI(r){const t=new DataView(r);return t.getUint16(2,!0)===2?(console.warn("PMTiles spec version 2 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),2):t.getUint16(2,!0)===1?(console.warn("PMTiles spec version 1 has been deprecated; please see github.com/protomaps/PMTiles for tools to upgrade"),1):3}var xs=class extends Error{};function QI(r,t,e,n){return Xe(this,null,function*(){const i=yield r.getBytes(0,16384);if(new DataView(i.data).getUint16(0,!0)!==19792)throw new Error("Wrong magic number for PMTiles archive");if(JI(i.data)<3)return[yield z_.getHeader(r)];const s=i.data.slice(0,$I);let o=i.etag;n&&i.etag!=n&&(console.warn("ETag conflict detected; your HTTP server might not support content-based ETag headers. ETags disabled for "+r.getKey()),o=void 0);const a=KI(s,o);if(e){const l=i.data.slice(a.rootDirectoryOffset,a.rootDirectoryOffset+a.rootDirectoryLength),h=r.getKey()+"|"+(a.etag||"")+"|"+a.rootDirectoryOffset+"|"+a.rootDirectoryLength,c=B_(yield t(l,a.internalCompression));return[a,[h,c.length,c]]}return[a,void 0]})}function tP(r,t,e,n,i){return Xe(this,null,function*(){const s=yield r.getBytes(e,n);if(i.etag&&i.etag!==s.etag)throw new xs(s.etag);const o=yield t(s.data,i.internalCompression),a=B_(o);if(a.length===0)throw new Error("Empty directory is invalid");return a})}var eP=class{constructor(r=100,t=!0,e=U_){this.cache=new Map,this.maxCacheEntries=r,this.counter=1,this.prefetch=t,this.decompress=e}getHeader(r,t){return Xe(this,null,function*(){const e=r.getKey();if(this.cache.has(e))return this.cache.get(e).lastUsed=this.counter++,yield this.cache.get(e).data;const n=new Promise((i,s)=>{QI(r,this.decompress,this.prefetch,t).then(o=>{o[1]&&this.cache.set(o[1][0],{lastUsed:this.counter++,data:Promise.resolve(o[1][2])}),i(o[0]),this.prune()}).catch(o=>{s(o)})});return this.cache.set(e,{lastUsed:this.counter++,data:n}),n})}getDirectory(r,t,e,n){return Xe(this,null,function*(){const i=r.getKey()+"|"+(n.etag||"")+"|"+t+"|"+e;if(this.cache.has(i))return this.cache.get(i).lastUsed=this.counter++,yield this.cache.get(i).data;const s=new Promise((o,a)=>{tP(r,this.decompress,t,e,n).then(l=>{o(l),this.prune()}).catch(l=>{a(l)})});return this.cache.set(i,{lastUsed:this.counter++,data:s}),s})}getArrayBuffer(r,t,e,n){return Xe(this,null,function*(){const i=r.getKey()+"|"+(n.etag||"")+"|"+t+"|"+e;if(this.cache.has(i))return this.cache.get(i).lastUsed=this.counter++,yield this.cache.get(i).data;const s=new Promise((o,a)=>{r.getBytes(t,e).then(l=>{if(n.etag&&n.etag!==l.etag)throw new xs(l.etag);o(l.data),this.cache.has(i),this.prune()}).catch(l=>{a(l)})});return this.cache.set(i,{lastUsed:this.counter++,data:s}),s})}prune(){if(this.cache.size>=this.maxCacheEntries){let r=1/0,t;this.cache.forEach((e,n)=>{e.lastUseds.maxZoom)return;let o=s.rootDirectoryOffset,a=s.rootDirectoryLength;for(let l=0;l<=3;l++){const h=yield this.cache.getDirectory(this.source,o,a,s),c=VI(h,i);if(c)if(c.runLength>0){const u=yield this.source.getBytes(s.tileDataOffset+c.offset,c.length,n);if(s.etag&&s.etag!==u.etag)throw new xs(u.etag);return{data:yield this.decompress(u.data,s.tileCompression),cacheControl:u.cacheControl,expires:u.expires}}else o=s.leafDirectoryOffset+c.offset,a=c.length;else return}throw Error("Maximum directory depth exceeded")})}getZxy(r,t,e,n){return Xe(this,null,function*(){try{return yield this.getZxyAttempt(r,t,e,n)}catch(i){if(i instanceof xs)return this.cache.invalidate(this.source,i.message),yield this.getZxyAttempt(r,t,e,n);throw i}})}getMetadataAttempt(){return Xe(this,null,function*(){const r=yield this.cache.getHeader(this.source),t=yield this.source.getBytes(r.jsonMetadataOffset,r.jsonMetadataLength);if(r.etag&&r.etag!==t.etag)throw new xs(t.etag);const e=yield this.decompress(t.data,r.internalCompression),n=new TextDecoder("utf-8");return JSON.parse(n.decode(e))})}getMetadata(){return Xe(this,null,function*(){try{return yield this.getMetadataAttempt()}catch(r){if(r instanceof xs)return this.cache.invalidate(this.source,r.message),yield this.getMetadataAttempt();throw r}})}};class rP extends ln{constructor(t){super(Ct.ERROR),this.error=t}}class Ph extends Pd{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache()&&!(this.peekLast().getKey()in t);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;const t=this.peekFirstKey(),e=v_(t)[0];this.forEach(n=>{n.tileCoord[0]!==e&&(this.remove(Kn(n.tileCoord)),n.release())})}}const Rs={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},os=[0,0,0],Vn=5;class gi{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,Rt(B1(this.resolutions_,(i,s)=>s-i),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let i=0,s=this.resolutions_.length-1;i{const o=new Ch(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(n){const a=this.getTileRangeForExtentAndZ(n,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):n&&this.calculateTileRanges_(n)}forEachTileCoord(t,e,n){const i=this.getTileRangeForExtentAndZ(t,e);for(let s=i.minX,o=i.maxX;s<=o;++s)for(let a=i.minY,l=i.maxY;a<=l;++a)n([e,s,a])}forEachTileCoordParentTileRange(t,e,n,i){let s,o,a,l=null,h=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,i);h>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),s=ns(o,o,a,a,n)):s=this.getTileRangeForExtentAndZ(l,h,n),e(h,s))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,n){if(t[0]this.maxZoom||e0?S=e.find(function(E){return w[c]==E[h]?!0:w[c].includes(":")?!1:r[c]+":"+w[c]===E[h]}):S=!0,S){i.push(w[c]);const E=w[u]*28e-5/y,T=w[g],R=w[f];x?s.push([w[d][1],w[d][0]]):s.push(w[d]),n.push(E),o.push(T==R?T:[T,R]),a.push([w.MatrixWidth,w.MatrixHeight])}}),new nP({extent:t,origins:s,resolutions:n,matrixIds:i,tileSizes:o,sizes:a})}function Ud(r){let t=r.getDefaultTileGrid();return t||(t=aP(r),r.setDefaultTileGrid(t)),t}function sP(r,t,e){const n=t[0],i=r.getTileCoordCenter(t),s=jn(e);if(!gr(s,i)){const o=pt(s),a=Math.ceil((s[0]-i[0])/o);return i[0]+=o*a,r.getTileCoordForCoordAndZ(i,n)}return t}function oP(r,t,e,n){n=n!==void 0?n:"top-left";const i=X_(r,t,e);return new gi({extent:r,origin:ex(r,n),resolutions:i,tileSize:e})}function Vi(r){const t=r||{},e=t.extent||K("EPSG:3857").getExtent(),n={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:X_(e,t.maxZoom,t.tileSize,t.maxResolution)};return new gi(n)}function X_(r,t,e,n){t=t!==void 0?t:z0,e=Jt(e!==void 0?e:Gs);const i=Zt(r),s=pt(r);n=n>0?n:Math.max(s/e[0],i/e[1]);const o=t+1,a=new Array(o);for(let l=0;ln.highWaterMark&&(n.highWaterMark=t)}useTile(t,e,n,i){}}class W_ extends ln{constructor(t,e){super(t),this.tile=e}}const Ia=lP;class Bd extends Ia{constructor(t){const e=t.projection===void 0?"EPSG:3857":t.projection;let n=t.tileGrid;n===void 0&&e&&(n=Vi({extent:jn(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize})),super({cacheSize:.1,attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:e,tileGrid:n,opaque:t.opaque,state:t.state,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate}),this.gutter_=t.gutter!==void 0?t.gutter:0,this.tileSize_=t.tileSize?Jt(t.tileSize):null,this.tileSizes_=null,this.tileLoadingKeys_={},this.loader_=t.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=t.bandCount===void 0?4:t.bandCount,this.tileGridForProjection_={},this.tileCacheForProjection_={}}setTileSizes(t){this.tileSizes_=t}getTileSize(t){if(this.tileSizes_)return this.tileSizes_[t];if(this.tileSize_)return this.tileSize_;const e=this.getTileGrid();return e?Jt(e.getTileSize(t)):[256,256]}getGutterForProjection(t){const e=this.getProjection();return!e||Ie(e,t)?this.gutter_:0}setLoader(t){this.loader_=t}getReprojTile_(t,e,n,i,s){const o=this.getTileCacheForProjection(i),a=on(t,e,n);if(o.containsKey(a)){const _=o.get(a);if(_&&_.key==this.getKey())return _}const l=this.getTileGrid(),h=Math.max.apply(null,l.getResolutions().map((_,y)=>{const x=Jt(l.getTileSize(y)),w=this.getTileSize(y);return Math.max(w[0]/x[0],w[1]/x[1])})),c=this.getTileGridForProjection(s),u=this.getTileGridForProjection(i),d=[t,e,n],g=this.getTileCoordForTileUrlFunction(d,i),f=Object.assign({sourceProj:s,sourceTileGrid:c,targetProj:i,targetTileGrid:u,tileCoord:d,wrappedTileCoord:g,pixelRatio:h,gutter:this.getGutterForProjection(s),getTileFunction:(_,y,x,w)=>this.getTile(_,y,x,w,s)},this.tileOptions),m=new Id(f);return m.key=this.getKey(),m}getTile(t,e,n,i,s){const o=this.getProjection();if(o&&s&&!Ie(o,s))return this.getReprojTile_(t,e,n,s,o);const a=this.getTileSize(t),l=on(t,e,n);if(this.tileCache.containsKey(l))return this.tileCache.get(l);const h=this.loader_;function c(){return lm(function(){return h(t,e,n)})}const u=Object.assign({tileCoord:[t,e,n],loader:c,size:a},this.tileOptions),d=new Md(u);return d.key=this.getKey(),d.addEventListener(Ct.CHANGE,this.handleTileChange_),this.tileCache.set(l,d),d}handleTileChange_(t){const e=t.target,n=tt(e),i=e.getState();let s;i==U.LOADING?(this.tileLoadingKeys_[n]=!0,s=Rs.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],s=i==U.ERROR?Rs.TILELOADERROR:i==U.LOADED?Rs.TILELOADEND:void 0),s&&this.dispatchEvent(new W_(s,e))}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||Ie(e,t)))return this.tileGrid;const n=tt(t);return n in this.tileGridForProjection_||(this.tileGridForProjection_[n]=Ud(t)),this.tileGridForProjection_[n]}setTileGridForProjection(t,e){const n=K(t);if(n){const i=tt(n);i in this.tileGridForProjection_||(this.tileGridForProjection_[i]=e)}}getTileCacheForProjection(t){const e=this.getProjection();if(!e||Ie(e,t))return this.tileCache;const n=tt(t);return n in this.tileCacheForProjection_||(this.tileCacheForProjection_[n]=new Ph(.1)),this.tileCacheForProjection_[n]}expireCache(t,e){const n=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==n?e:{});for(const i in this.tileCacheForProjection_){const s=this.tileCacheForProjection_[i];s.expireCache(s==n?e:{})}}clear(){super.clear();for(const t in this.tileCacheForProjection_)this.tileCacheForProjection_[t].clear()}}function Le(r){return(t,...e)=>hP(r,t,e)}function eo(r,t){return Le(q_(r,t).get)}const{apply:hP,construct:j5,defineProperty:z5,get:U5,getOwnPropertyDescriptor:q_,getPrototypeOf:Xd,has:B5,ownKeys:cP,set:X5,setPrototypeOf:W5}=Reflect,{iterator:Pa,species:q5,toStringTag:uP,for:Z5}=Symbol,dP=Object,{create:Wd,defineProperty:gP,freeze:Y5,is:$5}=dP,fP=Array,pP=fP.prototype,Z_=pP[Pa],mP=Le(Z_),Y_=ArrayBuffer,_P=Y_.prototype;eo(_P,"byteLength");const vp=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;vp&&eo(vp.prototype,"byteLength");const $_=Xd(Uint8Array);$_.from;const $e=$_.prototype;$e[Pa];Le($e.keys);Le($e.values);Le($e.entries);Le($e.set);Le($e.reverse);Le($e.fill);Le($e.copyWithin);Le($e.sort);Le($e.slice);Le($e.subarray);eo($e,"buffer");eo($e,"byteOffset");eo($e,"length");eo($e,uP);const yP=Uint8Array,V_=Uint16Array,qd=Uint32Array,xP=Float32Array,ia=Xd([][Pa]()),H_=Le(ia.next),vP=Le(function*(){}().next),wP=Xd(ia),SP=DataView.prototype,EP=Le(SP.getUint16),Zd=WeakMap,K_=Zd.prototype,J_=Le(K_.get),bP=Le(K_.set),Q_=new Zd,TP=Wd(null,{next:{value:function(){const r=J_(Q_,this);return H_(r)}},[Pa]:{value:function(){return this}}});function MP(r){if(r[Pa]===Z_&&ia.next===H_)return r;const t=Wd(TP);return bP(Q_,t,mP(r)),t}const RP=new Zd,CP=Wd(wP,{next:{value:function(){const r=J_(RP,this);return vP(r)},writable:!0,configurable:!0}});for(const r of cP(ia))r!=="next"&&gP(CP,r,q_(ia,r));const ty=new Y_(4),IP=new xP(ty),PP=new qd(ty),qr=new V_(512),Zr=new yP(512);for(let r=0;r<256;++r){const t=r-127;t<-27?(qr[r]=0,qr[r|256]=32768,Zr[r]=24,Zr[r|256]=24):t<-14?(qr[r]=1024>>-t-14,qr[r|256]=1024>>-t-14|32768,Zr[r]=-t-1,Zr[r|256]=-t-1):t<=15?(qr[r]=t+15<<10,qr[r|256]=t+15<<10|32768,Zr[r]=13,Zr[r|256]=13):t<128?(qr[r]=31744,qr[r|256]=64512,Zr[r]=24,Zr[r|256]=24):(qr[r]=31744,qr[r|256]=64512,Zr[r]=13,Zr[r|256]=13)}const Yd=new qd(2048);for(let r=1;r<1024;++r){let t=r<<13,e=0;for(;!(t&8388608);)t<<=1,e-=8388608;t&=-8388609,e+=947912704,Yd[r]=t|e}for(let r=1024;r<2048;++r)Yd[r]=939524096+(r-1024<<13);const ro=new qd(64);for(let r=1;r<31;++r)ro[r]=r<<23;ro[31]=1199570944;ro[32]=2147483648;for(let r=33;r<63;++r)ro[r]=2147483648+(r-32<<23);ro[63]=3347054592;const ey=new V_(64);for(let r=1;r<64;++r)r!==32&&(ey[r]=1024);function AP(r){const t=r>>10;return PP[0]=Yd[ey[t]+(r&1023)]+ro[t],IP[0]}function ry(r,t,...e){return AP(EP(r,t,...MP(e)))}var $d={exports:{}};function ny(r,t,e){const n=e&&e.debug||!1;n&&console.log("[xml-utils] getting "+t+" in "+r);const i=typeof r=="object"?r.outer:r,s=i.slice(0,i.indexOf(">")+1),o=['"',"'"];for(let a=0;a/]`,s);if(n&&console.log("[xml-utils] start:",o),o===-1)return;const a=r.slice(o+t.length);let l=_c(a,"^[^<]*[ /]>",0);const h=l!==-1&&a[l-1]==="/";if(n&&console.log("[xml-utils] selfClosing:",h),h===!1)if(i){let g=0,f=1,m=0;for(;(l=_c(a,"[ /]"+t+">",g))!==-1;){const _=a.substring(g,l+1);if(f+=wp(_,"<"+t+`[ + >]`),m+=wp(_,""),m>=f)break;g=l}}else l=_c(a,"[ /]"+t+">",0);const c=o+t.length+l+1;if(n&&console.log("[xml-utils] end:",c),c===-1)return;const u=r.slice(o,c);let d;return h?d=null:d=u.slice(u.indexOf(">")+1,u.lastIndexOf("<")),{inner:d,outer:u,start:o,end:c}}Hd.exports=ay;Hd.exports.default=ay;var kP=Hd.exports;const GP=kP;function ly(r,t,e){const n=[],i=e&&e.debug||!1,s=e&&typeof e.nested=="boolean"?e.nested:!0;let o=e&&e.startIndex||0,a;for(;a=GP(r,t,{debug:i,startIndex:o});)s?o=a.start+1+t.length:o=a.end,n.push(a);return i&&console.log("findTagsByName found",n.length,"tags"),n}Vd.exports=ly;Vd.exports.default=ly;var jP=Vd.exports;const zP=Vs(jP),Fo={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},$r={};for(const r in Fo)Fo.hasOwnProperty(r)&&($r[Fo[r]]=parseInt(r,10));const UP=[$r.BitsPerSample,$r.ExtraSamples,$r.SampleFormat,$r.StripByteCounts,$r.StripOffsets,$r.StripRowCounts,$r.TileByteCounts,$r.TileOffsets,$r.SubIFDs],yc={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},St={};for(const r in yc)yc.hasOwnProperty(r)&&(St[yc[r]]=parseInt(r,10));const He={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},BP={Unspecified:0,Assocalpha:1,Unassalpha:2},V5={Version:0,AddCompression:1},H5={None:0,Deflate:1,Zstandard:2},XP={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function WP(r,t){const{width:e,height:n}=r,i=new Uint8Array(e*n*3);let s;for(let o=0,a=0;o>24,l=r[i+2]<<24>>24;let h=(o+16)/116,c=a/500+h,u=h-l/200,d,g,f;c=VP*(c*c*c>.008856?c*c*c:(c-16/116)/7.787),h=HP*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),u=KP*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),d=c*3.2406+h*-1.5372+u*-.4986,g=c*-.9689+h*1.8758+u*.0415,f=c*.0557+h*-.204+u*1.057,d=d>.0031308?1.055*d**(1/2.4)-.055:12.92*d,g=g>.0031308?1.055*g**(1/2.4)-.055:12.92*g,f=f>.0031308?1.055*f**(1/2.4)-.055:12.92*f,n[s]=Math.max(0,Math.min(1,d))*255,n[s+1]=Math.max(0,Math.min(1,g))*255,n[s+2]=Math.max(0,Math.min(1,f))*255}return n}const hy=new Map;function fi(r,t){Array.isArray(r)||(r=[r]),r.forEach(e=>hy.set(e,t))}async function cy(r){const t=hy.get(r.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${r.Compression}`);const e=await t();return new e(r)}fi([void 0,1],()=>Fn(()=>import("./raw-CMGvRjfu-Blplg0lv.js"),__vite__mapDeps([0,1])).then(r=>r.default));fi(5,()=>Fn(()=>import("./lzw-LAGDNbSC-uvu3SnH0.js"),__vite__mapDeps([2,1])).then(r=>r.default));fi(6,()=>{throw new Error("old style JPEG compression is not supported.")});fi(7,()=>Fn(()=>import("./jpeg-BAgeD1d3-DG6CHa_P.js"),__vite__mapDeps([3,1])).then(r=>r.default));fi([8,32946],()=>Fn(()=>import("./deflate-BXt-9JA_-CoW5SAcn.js"),__vite__mapDeps([4,5,1])).then(r=>r.default));fi(32773,()=>Fn(()=>import("./packbits-BlDR4Kj5-myqVpMVP.js"),__vite__mapDeps([6,1])).then(r=>r.default));fi(34887,()=>Fn(()=>import("./lerc-DzVumYtB-CGEFV0hW.js"),__vite__mapDeps([7,5,1,8,9,10,11,12])).then(async r=>(await r.zstd.init(),r)).then(r=>r.default));fi(50001,()=>Fn(()=>import("./webimage-BM_pbLN3-BOB8pnha.js"),__vite__mapDeps([13,1])).then(r=>r.default));function Ah(r,t,e,n=1){return new(Object.getPrototypeOf(r)).constructor(t*e*n)}function QP(r,t,e,n,i){const s=t/n,o=e/i;return r.map(a=>{const l=Ah(a,n,i);for(let h=0;h{const l=Ah(a,n,i);for(let h=0;h>8-i-T&u;else if(T+i<=16)c[S]=a.getUint16(E)>>16-i-T&u;else if(T+i<=24){const R=a.getUint16(E)<<8|a.getUint8(E+2);c[S]=R>>24-i-T&u}else c[S]=a.getUint32(E)>>32-i-T&u}}}}return c.buffer}class uy{constructor(t,e,n,i,s,o){this.fileDirectory=t,this.geoKeys=e,this.dataView=n,this.littleEndian=i,this.tiles=s?{}:null,this.isTiled=!t.StripOffsets;const a=t.PlanarConfiguration;if(this.planarConfiguration=typeof a>"u"?1:a,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let e=0;e=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}getReaderForSample(t){const e=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,n=this.fileDirectory.BitsPerSample[t];switch(e){case 1:if(n<=8)return DataView.prototype.getUint8;if(n<=16)return DataView.prototype.getUint16;if(n<=32)return DataView.prototype.getUint32;break;case 2:if(n<=8)return DataView.prototype.getInt8;if(n<=16)return DataView.prototype.getInt16;if(n<=32)return DataView.prototype.getInt32;break;case 3:switch(n){case 16:return function(i,s){return ry(this,i,s)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(t=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}getBitsPerSample(t=0){return this.fileDirectory.BitsPerSample[t]}getArrayForSample(t,e){const n=this.getSampleFormat(t),i=this.getBitsPerSample(t);return nu(n,i,e)}async getTileOrStrip(t,e,n,i,s){const o=Math.ceil(this.getWidth()/this.getTileWidth()),a=Math.ceil(this.getHeight()/this.getTileHeight());let l;const{tiles:h}=this;this.planarConfiguration===1?l=e*o+t:this.planarConfiguration===2&&(l=n*o*a+e*o+t);let c,u;this.isTiled?(c=this.fileDirectory.TileOffsets[l],u=this.fileDirectory.TileByteCounts[l]):(c=this.fileDirectory.StripOffsets[l],u=this.fileDirectory.StripByteCounts[l]);const d=(await this.source.fetch([{offset:c,length:u}],s))[0];let g;return h===null||!h[l]?(g=(async()=>{let f=await i.decode(this.fileDirectory,d);const m=this.getSampleFormat(),_=this.getBitsPerSample();return oA(m,_)&&(f=aA(f,m,this.planarConfiguration,this.getSamplesPerPixel(),_,this.getTileWidth(),this.getBlockHeight(e))),f})(),h!==null&&(h[l]=g)):g=h[l],{x:t,y:e,sample:n,data:await g}}async _readRaster(t,e,n,i,s,o,a,l,h){const c=this.getTileWidth(),u=this.getTileHeight(),d=this.getWidth(),g=this.getHeight(),f=Math.max(Math.floor(t[0]/c),0),m=Math.min(Math.ceil(t[2]/c),Math.ceil(d/c)),_=Math.max(Math.floor(t[1]/u),0),y=Math.min(Math.ceil(t[3]/u),Math.ceil(g/u)),x=t[2]-t[0];let w=this.getBytesPerPixel();const S=[],E=[];for(let C=0;C{const M=b.data,L=new DataView(M),D=this.getBlockHeight(b.y),j=b.y*u,G=b.x*c,W=j+D,$=(b.x+1)*c,st=E[z],X=Math.min(D,D-(W-t[3]),g-j),lt=Math.min(c,c-($-t[2]),d-G);for(let ct=Math.max(0,t[1]-j);ctc[2]||c[1]>c[3])throw new Error("Invalid subsets");const u=c[2]-c[0],d=c[3]-c[1],g=u*d,f=this.getSamplesPerPixel();if(!e||!e.length)for(let y=0;y=f)return Promise.reject(new RangeError(`Invalid sample index '${e[y]}'.`));let m;if(n){const y=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,x=Math.max.apply(null,this.fileDirectory.BitsPerSample);m=nu(y,x,g*e.length),l&&m.fill(l)}else{m=[];for(let y=0;yh[2]||h[1]>h[3])throw new Error("Invalid subsets");const c=this.fileDirectory.PhotometricInterpretation;if(c===He.RGB){let y=[0,1,2];if(this.fileDirectory.ExtraSamples!==BP.Unspecified&&a){y=[];for(let x=0;xmc(s,"sample")===void 0):i=i.filter(s=>Number(mc(s,"sample"))===t);for(let s=0;s[o+n*f+i*m,c+a*f+l*m]),d=u.map(f=>f[0]),g=u.map(f=>f[1]);return[Math.min(...d),Math.min(...g),Math.max(...d),Math.max(...g)]}else{const n=this.getOrigin(),i=this.getResolution(),s=n[0],o=n[1],a=s+i[0]*this.getWidth(),l=o+i[1]*this.getHeight();return[Math.min(s,a),Math.min(o,l),Math.max(s,a),Math.max(o,l)]}}}class lA{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,e){const n=this.getUint32(t,e),i=this.getUint32(t+4,e);let s;if(e){if(s=n+2**32*i,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}if(s=2**32*n+i,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}getInt64(t,e){let n=0;const i=(this._dataView.getUint8(t+(e?7:0))&128)>0;let s=!0;for(let o=0;o<8;o++){let a=this._dataView.getUint8(t+(e?o:7-o));i&&(s?a!==0&&(a=~(a-1)&255,s=!1):a=~a&255),n+=a*256**o}return i&&(n=-n),n}getUint8(t,e){return this._dataView.getUint8(t,e)}getInt8(t,e){return this._dataView.getInt8(t,e)}getUint16(t,e){return this._dataView.getUint16(t,e)}getInt16(t,e){return this._dataView.getInt16(t,e)}getUint32(t,e){return this._dataView.getUint32(t,e)}getInt32(t,e){return this._dataView.getInt32(t,e)}getFloat16(t,e){return ry(this._dataView,t,e)}getFloat32(t,e){return this._dataView.getFloat32(t,e)}getFloat64(t,e){return this._dataView.getFloat64(t,e)}}class hA{constructor(t,e,n,i){this._dataView=new DataView(t),this._sliceOffset=e,this._littleEndian=n,this._bigTiff=i}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,e){return this.sliceOffset<=t&&this.sliceTop>=t+e}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const e=this.readUint32(t),n=this.readUint32(t+4);let i;if(this._littleEndian){if(i=e+2**32*n,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}if(i=2**32*e+n,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}readInt64(t){let e=0;const n=(this._dataView.getUint8(t+(this._littleEndian?7:0))&128)>0;let i=!0;for(let s=0;s<8;s++){let o=this._dataView.getUint8(t+(this._littleEndian?s:7-s));n&&(i?o!==0&&(o=~(o-1)&255,i=!1):o=~o&255),e+=o*256**s}return n&&(e=-e),e}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const cA=typeof navigator<"u"&&navigator.hardwareConcurrency||2;class uA{constructor(t=cA,e){this.workers=null,this._awaitingDecoder=null,this.size=t,this.messageId=0,t&&(this._awaitingDecoder=e?Promise.resolve(e):new Promise(n=>{Fn(()=>import("./decoder-CP4lv0Kb-zThNjL1K.js"),__vite__mapDeps([14,8,9,10,11,12])).then(i=>{n(i.create)})}),this._awaitingDecoder.then(n=>{this._awaitingDecoder=null,this.workers=[];for(let i=0;in.decode(t,e)):new Promise(n=>{const i=this.workers.find(a=>a.idle)||this.workers[Math.floor(Math.random()*this.size)];i.idle=!1;const s=this.messageId++,o=a=>{a.data.id===s&&(i.idle=!0,n(a.data.decoded),i.worker.removeEventListener("message",o))};i.worker.addEventListener("message",o),i.worker.postMessage({fileDirectory:t,buffer:e,id:s},[e])})}destroy(){this.workers&&(this.workers.forEach(t=>{t.worker.terminate()}),this.workers=null)}}const Sp=`\r +\r +`;function dy(r){if(typeof Object.fromEntries<"u")return Object.fromEntries(r);const t={};for(const[e,n]of r)t[e.toLowerCase()]=n;return t}function dA(r){const t=r.split(`\r +`).map(e=>{const n=e.split(":").map(i=>i.trim());return n[0]=n[0].toLowerCase(),n});return dy(t)}function gA(r){const[t,...e]=r.split(";").map(i=>i.trim()),n=e.map(i=>i.split("="));return{type:t,params:dy(n)}}function iu(r){let t,e,n;return r&&([,t,e,n]=r.match(/bytes (\d+)-(\d+)\/(\d+)/),t=parseInt(t,10),e=parseInt(e,10),n=parseInt(n,10)),{start:t,end:e,total:n}}function fA(r,t){let e=null;const n=new TextDecoder("ascii"),i=[],s=`--${t}`,o=`${s}--`;for(let a=0;a<10;++a)n.decode(new Uint8Array(r,a,s.length))===s&&(e=a);if(e===null)throw new Error("Could not find initial boundary");for(;ethis.fetchSlice(n,e)))}async fetchSlice(t){throw new Error(`fetching of slice ${t} not possible, not implemented`)}get fileSize(){return null}async close(){}}class pA extends Map{constructor(t={}){if(super(),!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof t.maxAge=="number"&&t.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=t.maxSize,this.maxAge=t.maxAge||Number.POSITIVE_INFINITY,this.onEviction=t.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(t){if(typeof this.onEviction=="function")for(const[e,n]of t)this.onEviction(e,n.value)}_deleteIfExpired(t,e){return typeof e.expiry=="number"&&e.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(t,e.value),this.delete(t)):!1}_getOrDeleteIfExpired(t,e){if(this._deleteIfExpired(t,e)===!1)return e.value}_getItemValue(t,e){return e.expiry?this._getOrDeleteIfExpired(t,e):e.value}_peek(t,e){const n=e.get(t);return this._getItemValue(t,n)}_set(t,e){this.cache.set(t,e),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(t,e){this.oldCache.delete(t),this._set(t,e)}*_entriesAscending(){for(const t of this.oldCache){const[e,n]=t;this.cache.has(e)||this._deleteIfExpired(e,n)===!1&&(yield t)}for(const t of this.cache){const[e,n]=t;this._deleteIfExpired(e,n)===!1&&(yield t)}}get(t){if(this.cache.has(t)){const e=this.cache.get(t);return this._getItemValue(t,e)}if(this.oldCache.has(t)){const e=this.oldCache.get(t);if(this._deleteIfExpired(t,e)===!1)return this._moveToRecent(t,e),e.value}}set(t,e,{maxAge:n=this.maxAge}={}){const i=typeof n=="number"&&n!==Number.POSITIVE_INFINITY?Date.now()+n:void 0;return this.cache.has(t)?this.cache.set(t,{value:e,expiry:i}):this._set(t,{value:e,expiry:i}),this}has(t){return this.cache.has(t)?!this._deleteIfExpired(t,this.cache.get(t)):this.oldCache.has(t)?!this._deleteIfExpired(t,this.oldCache.get(t)):!1}peek(t){if(this.cache.has(t))return this._peek(t,this.cache);if(this.oldCache.has(t))return this._peek(t,this.oldCache)}delete(t){const e=this.cache.delete(t);return e&&this._size--,this.oldCache.delete(t)||e}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(t){if(!(t&&t>0))throw new TypeError("`maxSize` must be a number greater than 0");const e=[...this._entriesAscending()],n=e.length-t;n<0?(this.cache=new Map(e),this.oldCache=new Map,this._size=e.length):(n>0&&this._emitEvictions(e.slice(0,n)),this.oldCache=new Map(e.slice(n)),this.cache=new Map,this._size=0),this.maxSize=t}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache){const[e,n]=t;this._deleteIfExpired(e,n)===!1&&(yield[e,n.value])}for(const t of this.oldCache){const[e,n]=t;this.cache.has(e)||this._deleteIfExpired(e,n)===!1&&(yield[e,n.value])}}*entriesDescending(){let t=[...this.cache];for(let e=t.length-1;e>=0;--e){const n=t[e],[i,s]=n;this._deleteIfExpired(i,s)===!1&&(yield[i,s.value])}t=[...this.oldCache];for(let e=t.length-1;e>=0;--e){const n=t[e],[i,s]=n;this.cache.has(i)||this._deleteIfExpired(i,s)===!1&&(yield[i,s.value])}}*entriesAscending(){for(const[t,e]of this._entriesAscending())yield[t,e.value]}get size(){if(!this._size)return this.oldCache.size;let t=0;for(const e of this.oldCache.keys())this.cache.has(e)||t++;return Math.min(this._size+t,this.maxSize)}entries(){return this.entriesAscending()}forEach(t,e=this){for(const[n,i]of this.entriesAscending())t.call(e,i,n,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}async function mA(r){return new Promise(t=>setTimeout(t,r))}function _A(r,t){const e=Array.isArray(r)?r:Array.from(r),n=Array.isArray(t)?t:Array.from(t);return e.map((i,s)=>[i,n[s]])}class zs extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,zs),this.name="AbortError"}}class yA extends Error{constructor(t,e){super(e),this.errors=t,this.message=e,this.name="AggregateError"}}const xA=yA;class vA{constructor(t,e,n=null){this.offset=t,this.length=e,this.data=n}get top(){return this.offset+this.length}}class Ep{constructor(t,e,n){this.offset=t,this.length=e,this.blockIds=n}}class wA extends tg{constructor(t,{blockSize:e=65536,cacheSize:n=100}={}){super(),this.source=t,this.blockSize=e,this.blockCache=new pA({maxSize:n,onEviction:(i,s)=>{this.evictedBlocks.set(i,s)}}),this.evictedBlocks=new Map,this.blockRequests=new Map,this.blockIdsToFetch=new Set,this.abortedBlockIds=new Set}get fileSize(){return this.source.fileSize}async fetch(t,e){const n=[],i=[],s=[];this.evictedBlocks.clear();for(const{offset:d,length:g}of t){let f=d+g;const{fileSize:m}=this;m!==null&&(f=Math.min(f,m));const _=Math.floor(d/this.blockSize)*this.blockSize;for(let y=_;ythis.abortedBlockIds.has(d)||!this.blockCache.has(d));if(l.forEach(d=>this.blockIdsToFetch.add(d)),l.length>0&&e&&!e.aborted){this.fetchBlocks(null);for(const d of l){const g=this.blockRequests.get(d);if(!g)throw new Error(`Block ${d} is not in the block requests`);a.push(g)}await Promise.allSettled(a)}if(e&&e.aborted)throw new zs("Request was aborted");const h=s.map(d=>this.blockCache.get(d)||this.evictedBlocks.get(d)),c=h.filter(d=>!d);if(c.length)throw new xA(c,"Request failed");const u=new Map(_A(s,h));return this.readSliceData(t,u)}fetchBlocks(t){if(this.blockIdsToFetch.size>0){const e=this.groupBlocks(this.blockIdsToFetch),n=this.source.fetch(e,t);for(let i=0;i{try{const a=(await n)[i],l=o*this.blockSize,h=l-a.offset,c=Math.min(h+this.blockSize,a.data.byteLength),u=a.data.slice(h,c),d=new vA(l,u.byteLength,u,o);this.blockCache.set(o,d),this.abortedBlockIds.delete(o)}catch(a){if(a.name==="AbortError")a.signal=t,this.blockCache.delete(o),this.abortedBlockIds.add(o);else throw a}finally{this.blockRequests.delete(o)}})())}this.blockIdsToFetch.clear()}}groupBlocks(t){const e=Array.from(t).sort((o,a)=>o-a);if(e.length===0)return[];let n=[],i=null;const s=[];for(const o of e)i===null||i+1===o?(n.push(o),i=o):(s.push(new Ep(n[0]*this.blockSize,n.length*this.blockSize,n)),n=[o],i=o);return s.push(new Ep(n[0]*this.blockSize,n.length*this.blockSize,n)),s}readSliceData(t,e){return t.map(n=>{let i=n.offset+n.length;this.fileSize!==null&&(i=Math.min(this.fileSize,i));const s=Math.floor(n.offset/this.blockSize),o=Math.floor(i/this.blockSize),a=new ArrayBuffer(n.length),l=new Uint8Array(a);for(let h=s;h<=o;++h){const c=e.get(h),u=c.offset-n.offset,d=c.top-i;let g=0,f=0,m;u<0?g=-u:u>0&&(f=u),d<0?m=c.length-g:m=i-c.offset-g;const _=new Uint8Array(c.data,g,m);l.set(_,f)}return a})}}class eg{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(t){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class rg{constructor(t){this.url=t}async request({headers:t,credentials:e,signal:n}={}){throw new Error("request is not implemented")}}class SA extends eg{constructor(t){super(),this.response=t}get status(){return this.response.status}getHeader(t){return this.response.headers.get(t)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class EA extends rg{constructor(t,e){super(t),this.credentials=e}async request({headers:t,credentials:e,signal:n}={}){const i=await fetch(this.url,{headers:t,credentials:e,signal:n});return new SA(i)}}class bA extends eg{constructor(t,e){super(),this.xhr=t,this.data=e}get status(){return this.xhr.status}getHeader(t){return this.xhr.getResponseHeader(t)}async getData(){return this.data}}class TA extends rg{constructRequest(t,e){return new Promise((n,i)=>{const s=new XMLHttpRequest;s.open("GET",this.url),s.responseType="arraybuffer";for(const[o,a]of Object.entries(t))s.setRequestHeader(o,a);s.onload=()=>{const o=s.response;n(new bA(s,o))},s.onerror=i,s.onabort=()=>i(new zs("Request aborted")),s.send(),e&&(e.aborted&&s.abort(),e.addEventListener("abort",()=>s.abort()))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}const bp={};class MA extends eg{constructor(t,e){super(),this.response=t,this.dataPromise=e}get status(){return this.response.statusCode}getHeader(t){return this.response.headers[t]}async getData(){return await this.dataPromise}}class RA extends rg{constructor(t){super(t),this.parsedUrl=bp.parse(this.url),this.httpApi=(this.parsedUrl.protocol,bp)}constructRequest(t,e){return new Promise((n,i)=>{const s=this.httpApi.get({...this.parsedUrl,headers:t},o=>{const a=new Promise(l=>{const h=[];o.on("data",c=>{h.push(c)}),o.on("end",()=>{const c=Buffer.concat(h).buffer;l(c)}),o.on("error",i)});n(new MA(o,a))});s.on("error",i),e&&(e.aborted&&s.destroy(new zs("Request aborted")),e.addEventListener("abort",()=>s.destroy(new zs("Request aborted"))))})}async request({headers:t,signal:e}={}){return await this.constructRequest(t,e)}}class ng extends tg{constructor(t,e,n,i){super(),this.client=t,this.headers=e,this.maxRanges=n,this.allowFullFile=i,this._fileSize=null}async fetch(t,e){return this.maxRanges>=t.length?this.fetchSlices(t,e):(this.maxRanges>0&&t.length>1,Promise.all(t.map(n=>this.fetchSlice(n,e))))}async fetchSlices(t,e){const n=await this.client.request({headers:{...this.headers,Range:`bytes=${t.map(({offset:i,length:s})=>`${i}-${i+s}`).join(",")}`},signal:e});if(n.ok)if(n.status===206){const{type:i,params:s}=gA(n.getHeader("content-type"));if(i==="multipart/byteranges"){const u=fA(await n.getData(),s.boundary);return this._fileSize=u[0].fileSize||null,u}const o=await n.getData(),{start:a,end:l,total:h}=iu(n.getHeader("content-range"));this._fileSize=h||null;const c=[{data:o,offset:a,length:l-a}];if(t.length>1){const u=await Promise.all(t.slice(1).map(d=>this.fetchSlice(d,e)));return c.concat(u)}return c}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const i=await n.getData();return this._fileSize=i.byteLength,[{data:i,offset:0,length:i.byteLength}]}else throw new Error("Error fetching data.")}async fetchSlice(t,e){const{offset:n,length:i}=t,s=await this.client.request({headers:{...this.headers,Range:`bytes=${n}-${n+i}`},signal:e});if(s.ok)if(s.status===206){const o=await s.getData(),{total:a}=iu(s.getHeader("content-range"));return this._fileSize=a||null,{data:o,offset:n,length:i}}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const o=await s.getData();return this._fileSize=o.byteLength,{data:o,offset:0,length:o.byteLength}}else throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function ig(r,{blockSize:t,cacheSize:e}){return t===null?r:new wA(r,{blockSize:t,cacheSize:e})}function CA(r,{headers:t={},credentials:e,maxRanges:n=0,allowFullFile:i=!1,...s}={}){const o=new EA(r,e),a=new ng(o,t,n,i);return ig(a,s)}function IA(r,{headers:t={},maxRanges:e=0,allowFullFile:n=!1,...i}={}){const s=new TA(r),o=new ng(s,t,e,n);return ig(o,i)}function PA(r,{headers:t={},maxRanges:e=0,allowFullFile:n=!1,...i}={}){const s=new RA(r),o=new ng(s,t,e,n);return ig(o,i)}function su(r,{forceXHR:t=!1,...e}={}){return typeof fetch=="function"&&!t?CA(r,e):typeof XMLHttpRequest<"u"?IA(r,e):PA(r,e)}class AA extends tg{constructor(t){super(),this.file=t}async fetchSlice(t,e){return new Promise((n,i)=>{const s=this.file.slice(t.offset,t.offset+t.length),o=new FileReader;o.onload=a=>n(a.target.result),o.onerror=i,o.onabort=i,o.readAsArrayBuffer(s),e&&e.addEventListener("abort",()=>o.abort())})}}function LA(r){return new AA(r)}function ou(r){switch(r){case St.BYTE:case St.ASCII:case St.SBYTE:case St.UNDEFINED:return 1;case St.SHORT:case St.SSHORT:return 2;case St.LONG:case St.SLONG:case St.FLOAT:case St.IFD:return 4;case St.RATIONAL:case St.SRATIONAL:case St.DOUBLE:case St.LONG8:case St.SLONG8:case St.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${r}`)}}function OA(r){const t=r.GeoKeyDirectory;if(!t)return null;const e={};for(let n=4;n<=t[3]*4;n+=4){const i=XP[t[n]],s=t[n+1]?Fo[t[n+1]]:null,o=t[n+2],a=t[n+3];let l=null;if(!s)l=a;else{if(l=r[s],typeof l>"u"||l===null)throw new Error(`Could not get value of geoKey '${i}'.`);typeof l=="string"?l=l.substring(a,a+o-1):l.subarray&&(l=l.subarray(a,a+o),o===1&&(l=l[0]))}e[i]=l}return e}function as(r,t,e,n){let i=null,s=null;const o=ou(t);switch(t){case St.BYTE:case St.ASCII:case St.UNDEFINED:i=new Uint8Array(e),s=r.readUint8;break;case St.SBYTE:i=new Int8Array(e),s=r.readInt8;break;case St.SHORT:i=new Uint16Array(e),s=r.readUint16;break;case St.SSHORT:i=new Int16Array(e),s=r.readInt16;break;case St.LONG:case St.IFD:i=new Uint32Array(e),s=r.readUint32;break;case St.SLONG:i=new Int32Array(e),s=r.readInt32;break;case St.LONG8:case St.IFD8:i=new Array(e),s=r.readUint64;break;case St.SLONG8:i=new Array(e),s=r.readInt64;break;case St.RATIONAL:i=new Uint32Array(e*2),s=r.readUint32;break;case St.SRATIONAL:i=new Int32Array(e*2),s=r.readInt32;break;case St.FLOAT:i=new Float32Array(e),s=r.readFloat32;break;case St.DOUBLE:i=new Float64Array(e),s=r.readFloat64;break;default:throw new RangeError(`Invalid field type: ${t}`)}if(t===St.RATIONAL||t===St.SRATIONAL)for(let a=0;af.getWidth()-m.getWidth());for(let f=0;f_||o&&o>y)break}}let d=e;if(a){const[g,f]=l.getOrigin(),[m,_]=h.getResolution(l);d=[Math.round((a[0]-g)/m),Math.round((a[1]-f)/_),Math.round((a[2]-g)/m),Math.round((a[3]-f)/_)],d=[Math.min(d[0],d[2]),Math.min(d[1],d[3]),Math.max(d[0],d[2]),Math.max(d[1],d[3])]}return h.readRasters({...t,window:d})}}class Us extends gy{constructor(t,e,n,i,s={}){super(),this.source=t,this.littleEndian=e,this.bigTiff=n,this.firstIFDOffset=i,this.cache=s.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,e){const n=this.bigTiff?4048:1024;return new hA((await this.source.fetch([{offset:t,length:typeof e<"u"?e:n}]))[0],t,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(t){const e=this.bigTiff?20:12,n=this.bigTiff?8:2;let i=await this.getSlice(t);const s=this.bigTiff?i.readUint64(t):i.readUint16(t),o=s*e+(this.bigTiff?16:6);i.covers(t,o)||(i=await this.getSlice(t,o));const a={};let l=t+(this.bigTiff?8:2);for(let u=0;u{const e=await this.ifdRequests[t-1];if(e.nextIFDByteOffset===0)throw new tl(t);return this.parseFileDirectoryAt(e.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(t=0){const e=await this.requestIFD(t);return new uy(e.fileDirectory,e.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let t=0,e=!0;for(;e;)try{await this.requestIFD(t),++t}catch(n){if(n instanceof tl)e=!1;else throw n}return t}async getGhostValues(){const t=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const e="GDAL_STRUCTURAL_METADATA_SIZE=",n=e.length+100;let i=await this.getSlice(t,n);if(e===as(i,St.ASCII,e.length,t)){const s=as(i,St.ASCII,n,t).split(` +`)[0],o=Number(s.split("=")[1].split(" ")[0])+s.length;o>n&&(i=await this.getSlice(t,o));const a=as(i,St.ASCII,o,t);this.ghostValues={},a.split(` +`).filter(l=>l.length>0).map(l=>l.split("=")).forEach(([l,h])=>{this.ghostValues[l]=h})}return this.ghostValues}static async fromSource(t,e,n){const i=(await t.fetch([{offset:0,length:1024}],n))[0],s=new lA(i),o=s.getUint16(0,0);let a;if(o===18761)a=!0;else if(o===19789)a=!1;else throw new TypeError("Invalid byte order value.");const l=s.getUint16(2,a);let h;if(l===42)h=!1;else if(l===43){if(h=!0,s.getUint16(4,a)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const c=h?s.getUint64(8,a):s.getUint32(4,a);return new Us(t,a,h,c,e)}close(){return typeof this.source.close=="function"?this.source.close():!1}}class NA extends gy{constructor(t,e){super(),this.mainFile=t,this.overviewFiles=e,this.imageFiles=[t].concat(e),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const t=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map(e=>e.parseFileDirectoryAt(e.firstIFDOffset)));return this.fileDirectoriesPerFile=await Promise.all(t),this.fileDirectoriesPerFile}async getImage(t=0){await this.getImageCount(),await this.parseFileDirectoriesPerFile();let e=0,n=0;for(let i=0;ie.getImageCount()));return this.imageCounts=await Promise.all(t),this.imageCount=this.imageCounts.reduce((e,n)=>e+n,0),this.imageCount}}async function DA(r,t={},e){return Us.fromSource(su(r,t),e)}async function kA(r,t){return Us.fromSource(LA(r),t)}async function GA(r,t=[],e={},n){const i=await Us.fromSource(su(r,e),n),s=await Promise.all(t.map(o=>Us.fromSource(su(o,e))));return new NA(i,s)}function jA(r){return((r.fileDirectory.NewSubfileType||0)&4)===4}function zA(r,t){if(!r)return!1;if(r===!0)return!0;if(t.getSamplesPerPixel()!==3)return!1;const e=t.fileDirectory.PhotometricInterpretation,n=He;return e===n.CMYK||e===n.YCbCr||e===n.CIELab||e===n.ICCLab}const Tp="STATISTICS_MAXIMUM",Mp="STATISTICS_MINIMUM",xc=256;let vc;function UA(){return vc||(vc=new uA),vc}function BA(r){try{return r.getBoundingBox()}catch{return[0,0,r.getWidth(),r.getHeight()]}}function XA(r){try{return r.getOrigin().slice(0,2)}catch{return[0,r.getHeight()]}}function WA(r,t){try{return r.getResolution(t)}catch{return[t.getWidth()/r.getWidth(),t.getHeight()/r.getHeight()]}}function qA(r){const t=r.geoKeys;if(!t)return null;if(t.ProjectedCSTypeGeoKey&&t.ProjectedCSTypeGeoKey!==32767){const e="EPSG:"+t.ProjectedCSTypeGeoKey;let n=K(e);if(!n){const i=Og(t.ProjLinearUnitsGeoKey);i&&(n=new Os({code:e,units:i}))}return n}if(t.GeographicTypeGeoKey&&t.GeographicTypeGeoKey!==32767){const e="EPSG:"+t.GeographicTypeGeoKey;let n=K(e);if(!n){const i=Og(t.GeogAngularUnitsGeoKey);i&&(n=new Os({code:e,units:i}))}return n}return null}function ZA(r){return r.getImageCount().then(function(t){const e=new Array(t);for(let n=0;ne*r)throw new Error(n)}function $A(r){return r instanceof Int8Array?-128:r instanceof Int16Array?-32768:r instanceof Int32Array?-2147483648:r instanceof Float32Array?12e-39:0}function VA(r){return r instanceof Int8Array?127:r instanceof Uint8Array||r instanceof Uint8ClampedArray?255:r instanceof Int16Array?32767:r instanceof Uint16Array?65535:r instanceof Int32Array?2147483647:r instanceof Uint32Array?4294967295:r instanceof Float32Array?34e37:255}class sg extends Bd{constructor(t){super({state:"loading",tileGrid:null,projection:t.projection||null,opaque:t.opaque,transition:t.transition,interpolate:t.interpolate!==!1,wrapX:t.wrapX}),this.sourceInfo_=t.sources;const e=this.sourceInfo_.length;this.sourceOptions_=t.sourceOptions,this.sourceImagery_=new Array(e),this.sourceMasks_=new Array(e),this.resolutionFactors_=new Array(e),this.samplesPerPixel_,this.nodataValues_,this.metadata_,this.normalize_=t.normalize!==!1,this.addAlpha_=!1,this.error_=null,this.convertToRGB_=t.convertToRGB||!1,this.setKey(this.sourceInfo_.map(s=>s.url).join(","));const n=this,i=new Array(e);for(let s=0;s=0;--n){const i=e[n],s=qA(i);if(s){this.projection=s;break}}}configure_(t){let e,n,i,s,o;const a=new Array(t.length),l=new Array(t.length),h=new Array(t.length);let c=0;const u=t.length;for(let m=0;m{jA(C)?y.push(C):_.push(C)});const x=_.length;if(y.length>0&&y.length!==x)throw new Error(`Expected one mask per image found ${y.length} masks and ${x} images`);let w,S;const E=new Array(x),T=new Array(x),R=new Array(x);l[m]=new Array(x),h[m]=new Array(x);for(let C=0;CR.length&&(c=o.length-R.length);const C=o[o.length-1]/R[R.length-1];this.resolutionFactors_[m]=C;const A=R.map(F=>F*=C),k=`Resolution mismatch for source ${m}, got [${A}] but expected [${o}]`;vo(o.slice(c,o.length),A,.02,k,this.viewRejector)}i?vo(i.slice(c,i.length),T,.01,`Tile size mismatch for source ${m}`,this.viewRejector):i=T,s?vo(s.slice(c,s.length),E,0,`Tile size mismatch for source ${m}`,this.viewRejector):s=E,this.sourceImagery_[m]=_.reverse(),this.sourceMasks_[m]=y.reverse()}for(let m=0,_=this.sourceImagery_.length;m<_;++m){const y=this.sourceImagery_[m];for(;y.lengththis.getImageInternal(o,a,l,s),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,e,n,i){if(this.loader){const s=Oh(t,e,n,1),o=this.findNearestResolution(e);if(this.image&&(this.static_||this.wantedProjection_===i&&(this.wantedExtent_&&We(this.wantedExtent_,s)||We(this.image.getExtent(),s))&&(this.wantedResolution_&&Gl(this.wantedResolution_)===o||Gl(this.image.getResolution())===o)))return this.image;this.wantedProjection_=i,this.wantedExtent_=s,this.wantedResolution_=o,this.image=new ah(s,o,n,this.loader),this.image.addEventListener(Ct.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const e=t.target;let n;switch(e.getState()){case J.LOADING:this.loading=!0,n=wc.IMAGELOADSTART;break;case J.LOADED:this.loading=!1,n=wc.IMAGELOADEND;break;case J.ERROR:this.loading=!1,n=wc.IMAGELOADERROR;break;default:return}this.hasListener(n)&&this.dispatchEvent(new KA(n,e))}}function Lh(r,t){r.getImage().src=t}function Oh(r,t,e,n){const i=t/e,s=be(r),o=Jn(pt(r)/i,Jr),a=Jn(Zt(r)/i,Jr),l=Jn((n-1)*o/2,Jr),h=o+2*l,c=Jn((n-1)*a/2,Jr),u=a+2*c;return wu(s,i,0,[h,u])}const pi=JA;function fy(r){const t=r.load||di,e=r.imageExtent,n=new Image;return r.crossOrigin!==null&&(n.crossOrigin=r.crossOrigin),()=>t(n,r.url).then(i=>{const s=pt(e)/i.width,o=Zt(e)/i.height;return{image:i,extent:e,resolution:s!==o?[s,o]:o,pixelRatio:1}})}class py extends pi{constructor(t){const e=t.crossOrigin!==void 0?t.crossOrigin:null,n=t.imageLoadFunction!==void 0?t.imageLoadFunction:Lh;super({attributions:t.attributions,interpolate:t.interpolate,projection:K(t.projection)}),this.url_=t.url,this.imageExtent_=t.imageExtent,this.image=null,this.image=new ah(this.imageExtent_,void 0,1,fy({url:t.url,imageExtent:t.imageExtent,crossOrigin:e,load:(i,s)=>(this.image.setImage(i),n(this.image,s),di(i))})),this.image.addEventListener(Ct.CHANGE,this.handleImageChange.bind(this))}getImageExtent(){return this.imageExtent_}getImageInternal(t,e,n,i){return $t(t,this.image.getExtent())?this.image:null}getUrl(){return this.url_}}function QA(r,t){const e=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,s=/\{-y\}/g;return function(o,a,l){if(o)return r.replace(e,o[0].toString()).replace(n,o[1].toString()).replace(i,o[2].toString()).replace(s,function(){const h=o[0],c=t.getFullTileRange(h);if(!c)throw new Error("The {-y} placeholder requires a tile grid with extent");return(c.getHeight()-o[2]-1).toString()})}}function og(r,t){const e=r.length,n=new Array(e);for(let i=0;ithis.getTileInternal(_,y,x,w,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return m.key=u,h?(m.interimTile=h,m.refreshInterimChain(),a.replace(c,m)):a.set(c,m),m}getTileInternal(t,e,n,i,s){let o=null;const a=on(t,e,n),l=this.getKey();if(!this.tileCache.containsKey(a))o=this.createTile_(t,e,n,i,s,l),this.tileCache.set(a,o);else if(o=this.tileCache.get(a),o.key!=l){const h=o;o=this.createTile_(t,e,n,i,s,l),h.getState()==U.IDLE?o.interimTile=h.interimTile:o.interimTile=h,o.refreshInterimChain(),this.tileCache.replace(a,o)}return o}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(const e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(t,e){const n=K(t);if(n){const i=tt(n);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}}clear(){super.clear();for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}}function eL(r,t){r.getImage().src=t}function cg(r,t,e,n){const i=document.createElement("script"),s="olc_"+tt(t);function o(){delete window[s],i.parentNode.removeChild(i)}i.async=!0,i.src=r+(r.includes("?")?"&":"?")+"callback="+s;const a=setTimeout(function(){o(),e&&e()},1e4);window[s]=function(l){clearTimeout(a),o(),t(l)},document.head.appendChild(i)}class rL extends Error{constructor(t){const e="Unexpected response status: "+t.status;super(e),this.name="ResponseError",this.response=t}}class nL extends Error{constructor(t){super("Failed to issue request"),this.name="ClientError",this.client=t}}function my(r){return new Promise(function(t,e){function n(o){const a=o.target;if(!a.status||a.status>=200&&a.status<300){let l;try{l=JSON.parse(a.responseText)}catch(h){const c="Error parsing response text as JSON: "+h.message;e(new Error(c));return}t(l);return}e(new rL(a))}function i(o){e(new nL(o.target))}const s=new XMLHttpRequest;s.addEventListener("load",n),s.addEventListener("error",i),s.open("GET",r),s.setRequestHeader("Accept","application/json"),s.send()})}function _y(r,t){return t.includes("://")?t:new URL(t,r).href}class yy extends Rr{constructor(t){if(super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:K("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.tileJSON_=null,this.tileSize_=t.tileSize,t.url)if(t.jsonp)cg(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else if(t.tileJSON)this.handleTileJSONResponse(t.tileJSON);else throw new Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let n;try{n=JSON.parse(e.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(n)}else this.handleTileJSONError()}onXHRError_(t){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(t){const e=K("EPSG:4326"),n=this.getProjection();let i;if(t.bounds!==void 0){const h=qi(e,n);i=Ls(t.bounds,h)}const s=jn(n),o=t.minzoom||0,a=t.maxzoom||22,l=Vi({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=og(t.tiles,l),t.attribution&&!this.getAttributions()){const h=i!==void 0?i:s;this.setAttributions(function(c){return $t(h,c.extent)?[t.attribution]:null})}this.tileJSON_=t,this.setState("ready")}handleTileJSONError(){this.setState("error")}}let iL=class extends to{constructor(r,t,e,n,i,s){super(r,t,s),this.extent=null,this.format_=n,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=i,this.url_=e,this.key=e}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==U.IDLE&&(this.setState(U.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(r,t){this.setFeatures(r)}onError(){this.setState(U.ERROR)}setFeatures(r){this.features_=r,this.setState(U.LOADED)}setLoader(r){this.loader_=r}};const Rp=[];class sL extends to{constructor(t,e,n,i){super(t,e,{transition:0}),this.context_={},this.executorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=i.bind(void 0,this),this.wrappedTileCoord=n}getContext(t){const e=tt(t);return e in this.context_||(this.context_[e]=Vt(1,1,Rp)),this.context_[e]}hasContext(t){return tt(t)in this.context_}getImage(t){return this.hasContext(t)?this.getContext(t).canvas:null}getReplayState(t){const e=tt(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]}load(){this.getSourceTiles()}release(){for(const t in this.context_){const e=this.context_[t];Di(e),Rp.push(e.canvas),delete this.context_[t]}super.release()}}class Fh extends hg{constructor(t){const e=t.projection||"EPSG:3857",n=t.extent||jn(e),i=t.tileGrid||Vi({extent:n,maxResolution:t.maxResolution,maxZoom:t.maxZoom!==void 0?t.maxZoom:22,minZoom:t.minZoom,tileSize:t.tileSize||512});super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,interpolate:!0,opaque:!1,projection:e,state:t.state,tileGrid:i,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:oL,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX===void 0?!0:t.wrapX,transition:t.transition,zDirection:t.zDirection===void 0?1:t.zDirection}),this.format_=t.format?t.format:null,this.sourceTileCache=new Ph(this.tileCache.highWaterMark),this.overlaps_=t.overlaps==null?!0:t.overlaps,this.tileClass=t.tileClass?t.tileClass:iL,this.tileGrids_={}}getFeaturesInExtent(t){const e=[],n=this.tileCache;if(n.getCount()===0)return e;const i=v_(n.peekFirstKey())[0],s=this.tileGrid;return n.forEach(function(o){if(o.tileCoord[0]!==i||o.getState()!==U.LOADED)return;const a=o.getSourceTiles();for(let l=0,h=a.length;l{const a=DC(o),l=n.peek(a);if(l){const h=l.sourceTiles;for(let c=0,u=h.length;c{const g=this.tileUrlFunction(d,t,e),f=this.sourceTileCache.containsKey(g)?this.sourceTileCache.get(g):new this.tileClass(d,g?U.IDLE:U.EMPTY,g,this.format_,this.tileLoadFunction);n.sourceTiles.push(f);const m=f.getState();if(m{this.handleTileChange(y);const x=f.getState();if(x===U.LOADED||x===U.ERROR){const w=f.getKey();w in n.errorTileKeys?f.getState()===U.LOADED&&delete n.errorTileKeys[w]:n.loadingSourceTiles--,x===U.ERROR?n.errorTileKeys[w]=!0:f.removeEventListener(Ct.CHANGE,_),n.loadingSourceTiles===0&&n.setState(In(n.errorTileKeys)?U.LOADED:U.ERROR)}};f.addEventListener(Ct.CHANGE,_),n.loadingSourceTiles++}m===U.IDLE&&(f.extent=h.getTileCoordExtent(d),f.projection=e,f.resolution=h.getResolution(d[0]),this.sourceTileCache.set(g,f),f.load())}),n.loadingSourceTiles||n.setState(n.sourceTiles.some(d=>d.getState()===U.ERROR)?U.ERROR:U.LOADED)}return n.sourceTiles}getTile(t,e,n,i,s){const o=on(t,e,n),a=this.getKey();let l;if(this.tileCache.containsKey(o)&&(l=this.tileCache.get(o),l.key===a))return l;const h=[t,e,n];let c=this.getTileCoordForTileUrlFunction(h,s);const u=this.getTileGrid().getExtent(),d=this.getTileGridForProjection(s);if(c&&u){const m=d.getTileCoordExtent(c);br(m,-d.getResolution(t),m),$t(u,m)||(c=null)}let g=!0;if(c!==null){const m=this.tileGrid,_=d.getResolution(t),y=m.getZForResolution(_,1),x=d.getTileCoordExtent(c);br(x,-_,x),m.forEachTileCoord(x,y,w=>{g=g&&!this.tileUrlFunction(w,i,s)})}const f=new sL(h,g?U.EMPTY:U.IDLE,c,this.getSourceTiles.bind(this,i,s));return f.key=a,l?(f.interimTile=l,f.refreshInterimChain(),this.tileCache.replace(o,f)):this.tileCache.set(o,f),f}getTileGridForProjection(t){const e=t.getCode();let n=this.tileGrids_[e];if(!n){const i=this.tileGrid,s=i.getResolutions().slice(),o=s.map(function(h,c){return i.getOrigin(c)}),a=s.map(function(h,c){return i.getTileSize(c)}),l=z0+1;for(let h=s.length;h=0;return i[a?"CRS":"SRS"]=n.getCode(),a&&s.substr(0,2)=="ne"?o=[t[1],t[0],t[3],t[2]]:o=t,i.BBOX=o.join(","),On(r,i)}function vy(r,t,e,n,i,s,o){s=Object.assign({REQUEST:"GetMap"},s);const a=t/e,l=[dl(pt(r)/a,Jr),dl(Zt(r)/a,Jr)];if(e!=1)switch(o){case"geoserver":const h=90*e+.5|0;"FORMAT_OPTIONS"in s?s.FORMAT_OPTIONS+=";dpi:"+h:s.FORMAT_OPTIONS="dpi:"+h;break;case"mapserver":s.MAP_RESOLUTION=90*e;break;case"carmentaserver":case"qgis":s.DPI=90*e;break;default:throw new Error("Unknown `serverType` configured")}return xy(i,r,l,n,s)}function Xl(r,t){return Object.assign({REQUEST:t,SERVICE:"WMS",VERSION:Bl,FORMAT:"image/png",STYLES:"",TRANSPARENT:!0},r)}function wy(r){const t=r.hidpi===void 0?!0:r.hidpi,e=K(r.projection||"EPSG:3857"),n=r.ratio||1.5,i=r.load||di;return(s,o,a)=>{s=Oh(s,o,a,n),a!=1&&(!t||r.serverType===void 0)&&(a=1);const l=vy(s,o,a,e,r.url,Xl(r.params,"GetMap"),r.serverType),h=new Image;return r.crossOrigin!==null&&(h.crossOrigin=r.crossOrigin),i(h,l).then(c=>({image:c,extent:s,pixelRatio:a}))}}function aL(r,t,e){if(r.url===void 0)return;const n=K(r.projection||"EPSG:3857"),i=wu(t,e,0,Cp),s={QUERY_LAYERS:r.params.LAYERS,INFO_FORMAT:"application/json"};Object.assign(s,Xl(r.params,"GetFeatureInfo"),r.params);const o=ms((t[0]-i[0])/e,Jr),a=ms((i[3]-t[1])/e,Jr),l=Tu(s.VERSION,"1.3")>=0;return s[l?"I":"X"]=o,s[l?"J":"Y"]=a,xy(r.url,i,Cp,n,s)}function lL(r,t){if(r.url===void 0)return;const e={SERVICE:"WMS",VERSION:Bl,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(r.params===void 0||r.params.LAYER===void 0){const n=r.params.LAYERS;if(!(!Array.isArray(n)||n.length===1))return;e.LAYER=n}if(t!==void 0){const n=K(r.projection||"EPSG:3857").getMetersPerUnit()||1,i=28e-5;e.SCALE=t*n/i}return Object.assign(e,r.params),On(r.url,e)}class Sy extends Rr{constructor(t){t=t||{};const e=Object.assign({},t.params),n="TRANSPARENT"in e?e.TRANSPARENT:!0;super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:!n,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0,this.params_=e,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=je(),this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(t,e,n,i){const s=K(n),o=this.getProjection()||s;let a=this.getTileGrid();a||(a=this.getTileGridForProjection(o));const l=Ql(t,s,o),h=ra(o,s,t,e),c=a.getZForResolution(h,this.zDirection),u=a.getResolution(c),d=a.getTileCoordForCoordAndZ(l,c);if(a.getResolutions().length<=d[0])return;let g=a.getTileCoordExtent(d,this.tmpExtent_);const f=this.gutter_;f!==0&&(g=br(g,u*f,g));const m={QUERY_LAYERS:this.params_.LAYERS};Object.assign(m,Xl(this.params_,"GetFeatureInfo"),i);const _=Math.floor((l[0]-g[0])/u),y=Math.floor((g[3]-l[1])/u);return m[this.v13_?"I":"X"]=_,m[this.v13_?"J":"Y"]=y,this.getRequestUrl_(d,g,1,o||s,m)}getLegendUrl(t,e){if(this.urls[0]===void 0)return;const n={SERVICE:"WMS",VERSION:Bl,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(e===void 0||e.LAYER===void 0){const i=this.params_.LAYERS;if(!(!Array.isArray(i)||i.length===1))return;n.LAYER=i}if(t!==void 0){const i=this.getProjection()?this.getProjection().getMetersPerUnit():1,s=28e-5;n.SCALE=t*i/s}return Object.assign(n,e),On(this.urls[0],n)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,e,n,i,s){const o=this.urls;if(!o)return;let a;if(o.length==1)a=o[0];else{const l=en(Ad(t),o.length);a=o[l]}return vy(e,(this.tileGrid||this.getTileGridForProjection(i)).getResolution(t[0]),n,i,a,s,this.serverType_)}getTilePixelRatio(t){return!this.hidpi_||this.serverType_===void 0?1:t}getKeyForParams_(){let t=0;const e=[];for(const n in this.params_)e[t++]=n+"-"+this.params_[n];return e.join("/")}updateParams(t){Object.assign(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())}updateV13_(){const t=this.params_.VERSION||Bl;this.v13_=Tu(t,"1.3")>=0}tileUrlFunction(t,e,n){let i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(n)),i.getResolutions().length<=t[0])return;e!=1&&(!this.hidpi_||this.serverType_===void 0)&&(e=1);const s=i.getResolution(t[0]);let o=i.getTileCoordExtent(t,this.tmpExtent_);const a=this.gutter_;a!==0&&(o=br(o,s*a,o));const l=Object.assign({},Xl(this.params_,"GetMap"));return this.getRequestUrl_(t,o,e,n,l)}}class Ey extends Rr{constructor(t){const e=t.requestEncoding!==void 0?t.requestEncoding:"KVP",n=t.tileGrid;let i=t.urls;i===void 0&&t.url!==void 0&&(i=ag(t.url)),super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:i,wrapX:t.wrapX!==void 0?t.wrapX:!1,transition:t.transition,zDirection:t.zDirection}),this.version_=t.version!==void 0?t.version:"1.0.0",this.format_=t.format!==void 0?t.format:"image/jpeg",this.dimensions_=t.dimensions!==void 0?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=e,this.setKey(this.getKeyForDimensions_()),i&&i.length>0&&(this.tileUrlFunction=Bs(i.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const e=t.join(` +`);this.setTileUrlFunction(Bs(t.map(this.createFromWMTSTemplate.bind(this))),e)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){const t=this.urls?this.urls.slice(0):[];for(const e in this.dimensions_)t.push(e+"-"+this.dimensions_[e]);return t.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const e=this.requestEncoding_,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e=="KVP"&&Object.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e=="KVP"?On(t,n):t.replace(/\{(\w+?)\}/g,function(o,a){return a.toLowerCase()in n?n[a.toLowerCase()]:o});const i=this.tileGrid,s=this.dimensions_;return function(o,a,l){if(!o)return;const h={TileMatrix:i.getMatrixId(o[0]),TileCol:o[1],TileRow:o[2]};Object.assign(h,s);let c=t;return e=="KVP"?c=On(c,h):c=c.replace(/\{(\w+?)\}/g,function(u,d){return h[d]}),c}}}function by(r,t){const e=r.Contents.Layer,n=e?.find(function(F){return F.Identifier==t.layer});if(!n)return null;const i=r.Contents.TileMatrixSet;let s;n.TileMatrixSetLink.length>1?"projection"in t?s=n.TileMatrixSetLink.findIndex(function(F){const z=i.find(function(b){return b.Identifier==F.TileMatrixSet}).SupportedCRS,p=K(z),v=K(t.projection);return p&&v?Ie(p,v):z==t.projection}):s=n.TileMatrixSetLink.findIndex(function(F){return F.TileMatrixSet==t.matrixSet}):s=0,s<0&&(s=0);const o=n.TileMatrixSetLink[s].TileMatrixSet,a=n.TileMatrixSetLink[s].TileMatrixSetLimits;let l=n.Format[0];"format"in t&&(l=t.format),s=n.Style.findIndex(function(F){return"style"in t?F.Title==t.style:F.isDefault}),s<0&&(s=0);const h=n.Style[s].Identifier,c={};"Dimension"in n&&n.Dimension.forEach(function(F,z,p){const v=F.Identifier;let b=F.Default;b===void 0&&(b=F.Value[0]),c[v]=b});const u=r.Contents.TileMatrixSet.find(function(F){return F.Identifier==o});let d;const g=u.SupportedCRS;if(g&&(d=K(g)),"projection"in t){const F=K(t.projection);F&&(!d||Ie(F,d))&&(d=F)}let f=!1;const m=d.getAxisOrientation().substr(0,2)=="ne";let _=u.TileMatrix[0],y={MinTileCol:0,MinTileRow:0,MaxTileCol:_.MatrixWidth-1,MaxTileRow:_.MatrixHeight-1};if(a){y=a[a.length-1];const F=u.TileMatrix.find(z=>z.Identifier===y.TileMatrix||u.Identifier+":"+z.Identifier===y.TileMatrix);F&&(_=F)}const x=_.ScaleDenominator*28e-5/d.getMetersPerUnit(),w=m?[_.TopLeftCorner[1],_.TopLeftCorner[0]]:_.TopLeftCorner,S=_.TileWidth*x,E=_.TileHeight*x;let T=u.BoundingBox;T&&m&&(T=[T[1],T[0],T[3],T[2]]);let R=[w[0]+S*y.MinTileCol,w[1]-E*(1+y.MaxTileRow),w[0]+S*(1+y.MaxTileCol),w[1]-E*y.MinTileRow];if(T!==void 0&&!We(T,R)){const F=n.WGS84BoundingBox,z=K("EPSG:4326").getExtent();if(R=T,F)f=F[0]===z[0]&&F[2]===z[2];else{const p=Cu(T,u.SupportedCRS,"EPSG:4326");f=p[0]-1e-10<=z[0]&&p[2]+1e-10>=z[2]}}const C=iP(u,R,a),A=[];let k=t.requestEncoding;if(k=k!==void 0?k:"","OperationsMetadata"in r&&"GetTile"in r.OperationsMetadata){const F=r.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let z=0,p=F.length;zy)return 1;if(y>_)return-1}var x=g[g.length-1],w=f[f.length-1];if(x&&w){var S=x.split(".").map(s),E=w.split(".").map(s);for(m=0;mE[m])return 1;if(E[m]>S[m])return-1}}else if(x||w)return x?-1:1;return 0}var l=[">",">=","=","<","<="],h={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};function c(u){if(typeof u!="string")throw new TypeError("Invalid operator type, expected string but got "+typeof u);if(l.indexOf(u)===-1)throw new TypeError("Invalid operator, expected one of "+l.join("|"))}return a.validate=function(u){return typeof u=="string"&&e.test(u)},a.compare=function(u,d,g){c(g);var f=a(u,d);return h[g].indexOf(f)>-1},a})})(Ty);var hL=Ty.exports,au=hL;const ug="1.0.0",ut={classification:"https://stac-extensions.github.io/classification/v1.1.0/schema.json",datacube:"https://stac-extensions.github.io/datacube/v2.1.0/schema.json",eo:"https://stac-extensions.github.io/eo/v1.0.0/schema.json",file:"https://stac-extensions.github.io/file/v1.0.0/schema.json","item-assets":"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json",label:"https://stac-extensions.github.io/label/v1.0.1/schema.json",pointcloud:"https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json",processing:"https://stac-extensions.github.io/processing/v1.1.0/schema.json",projection:"https://stac-extensions.github.io/projection/v1.0.0/schema.json",raster:"https://stac-extensions.github.io/raster/v1.1.0/schema.json",sar:"https://stac-extensions.github.io/sar/v1.0.0/schema.json",sat:"https://stac-extensions.github.io/sat/v1.0.0/schema.json",scientific:"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",table:"https://stac-extensions.github.io/table/v1.2.0/schema.json",timestamps:"https://stac-extensions.github.io/timestamps/v1.0.0/schema.json",version:"https://stac-extensions.github.io/version/v1.0.0/schema.json",view:"https://stac-extensions.github.io/view/v1.0.0/schema.json"},Oi={itemAndCollection:{"cube:":ut.datacube,"eo:":ut.eo,"file:":ut.file,"label:":ut.label,"pc:":ut.pointcloud,"processing:":ut.processing,"proj:":ut.projection,"raster:":ut.raster,"sar:":ut.sar,"sat:":ut.sat,"sci:":ut.scientific,"view:":ut.view,version:ut.version,deprecated:ut.version,published:ut.timestamps,expires:ut.timestamps,unpublished:ut.timestamps},catalog:{},collection:{item_assets:ut["item-assets"]},item:{}};Oi.collection=Object.assign(Oi.collection,Oi.itemAndCollection);Oi.item=Object.assign(Oi.item,Oi.itemAndCollection);var wo={parseUrl(r){let t=r.match(/^https?:\/\/stac-extensions.github.io\/([^\/]+)\/v([^\/]+)\/[^.]+.json$/i);if(t)return{id:t[1],version:t[2]}}},Pt={version:ug,extensions:{},set(r){if(typeof r.stac_version!="string"?Pt.version="0.6.0":Pt.version=r.stac_version,Array.isArray(r.stac_extensions))for(let t of r.stac_extensions){let e=wo.parseUrl(t);e&&(Pt.extensions[e.id]=e.version)}},before(r,t=null){let e=t?Pt.extensions[t]:Pt.version;return typeof e>"u"?!1:au.compare(e,r,"<")}},O={type(r){let t=typeof r;if(t==="object"){if(r===null)return"null";if(Array.isArray(r))return"array"}return t},is(r,t){return O.type(r)===t},isDefined(r){return typeof r<"u"},isObject(r){return typeof r=="object"&&r===Object(r)&&!Array.isArray(r)},rename(r,t,e){return typeof r[t]<"u"&&typeof r[e]>"u"?(r[e]=r[t],delete r[t],!0):!1},forAll(r,t,e){if(r[t]&&typeof r[t]=="object")for(let n in r[t])e(r[t][n])},toArray(r,t){return typeof r[t]<"u"&&!Array.isArray(r[t])?(r[t]=[r[t]],!0):!1},flattenArray(r,t,e,n=!1){if(Array.isArray(r[t])){for(let i in r[t])if(typeof e[i]=="string"){let s=r[t][i];r[e[i]]=n?[s]:s}return delete r[t],!0}return!1},flattenOneElementArray(r,t,e=!1){return!e&&Array.isArray(r[t])?r[t].length===1?(r[t]=r[t][0],!0):!1:!0},removeFromArray(r,t,e){if(Array.isArray(r[t])){let n=r[t].indexOf(e);return n>-1&&r[t].splice(n,1),!0}return!1},ensure(r,t,e){return O.type(e)!==O.type(r[t])&&(r[t]=e),!0},upgradeExtension(r,t){let{id:e,version:n}=wo.parseUrl(t),i=r.stac_extensions.findIndex(s=>{let o=wo.parseUrl(s);return o&&o.id===e&&au.compare(o.version,n,"<")});return i!==-1?(r.stac_extensions[i]=t,!0):!1},addExtension(r,t){let{id:e,version:n}=wo.parseUrl(t),i=r.stac_extensions.findIndex(s=>{if(s===t)return!0;let o=wo.parseUrl(s);return!!(o&&o.id===e&&au.compare(o.version,n,"<"))});return i===-1?r.stac_extensions.push(t):r.stac_extensions[i]=t,r.stac_extensions.sort(),!0},removeExtension(r,t){return O.removeFromArray(r,"stac_extensions",t)},migrateExtensionShortnames(r){let t=Object.keys(ut),e=Object.values(ut);return O.mapValues(r,"stac_extensions",t,e)},populateExtensions(r,t){let e=[];(t=="catalog"||t=="collection")&&e.push(r),(t=="item"||t=="collection")&&O.isObject(r.assets)&&(e=e.concat(Object.values(r.assets))),t=="collection"&&O.isObject(r.item_assets)&&(e=e.concat(Object.values(r.item_assets))),t=="collection"&&O.isObject(r.summaries)&&e.push(r.summaries),t=="item"&&O.isObject(r.properties)&&e.push(r.properties);for(let n of e)Object.keys(n).forEach(i=>{let s=i.match(/^(\w+:|[^:]+$)/i);if(Array.isArray(s)){let o=Oi[t][s[0]];O.is(o,"string")&&O.addExtension(r,o)}})},mapValues(r,t,e,n){let i=s=>{let o=e.indexOf(s);return o>=0?n[o]:s};return Array.isArray(r[t])?r[t]=r[t].map(i):typeof r[t]<"u"&&(r[t]=i(r[t])),!0},mapObject(r,t){for(let e in r)r[e]=t(r[e],e)},moveTo(r,t,e,n=!1,i=!1){let s;return n?i?s=o=>Array.isArray(o):s=o=>Array.isArray(o)&&o.length===1:s=O.isDefined,s(r[t])?(e[t]=n&&!i?r[t][0]:r[t],delete r[t],!0):!1},runAll(r,t,e,n){for(let i in r)i.startsWith("migrate")||r[i](t,e,n)},toUTC(r,t){if(typeof r[t]=="string")try{return r[t]=this.toISOString(r[t]),!0}catch{}return delete r[t],!1},toISOString(r){return r instanceof Date||(r=new Date(r)),r.toISOString().replace(".000","")}},Hr={multihash:null,hexToUint8(r){if(r.length===0||r.length%2!==0)throw new Error(`The string "${r}" is not valid hex.`);return new Uint8Array(r.match(/.{1,2}/g).map(t=>parseInt(t,16)))},uint8ToHex(r){return r.reduce((t,e)=>t+e.toString(16).padStart(2,"0"),"")},toMultihash(r,t,e){if(!Hr.multihash||!O.is(r[t],"string"))return!1;try{const n=Hr.multihash.encode(Hr.hexToUint8(r[t]),e);return r[t]=Hr.uint8ToHex(n),!0}catch(n){return console.warn(n),!1}}},dg={migrate(r,t=!0){return Pt.set(r),t&&(r.stac_version=ug),r.type="Catalog",O.ensure(r,"stac_extensions",[]),Pt.before("1.0.0-rc.1")&&O.migrateExtensionShortnames(r),O.ensure(r,"id",""),O.ensure(r,"description",""),O.ensure(r,"links",[]),O.runAll(dg,r,r),Pt.before("0.8.0")&&O.populateExtensions(r,"catalog"),r}},gg={migrate(r,t=!0){return dg.migrate(r,t),r.type="Collection",Pt.before("1.0.0-rc.1")&&O.migrateExtensionShortnames(r),O.ensure(r,"license","proprietary"),O.ensure(r,"extent",{spatial:{bbox:[]},temporal:{interval:[]}}),O.runAll(gg,r,r),O.isObject(r.properties)&&(O.removeFromArray(r,"stac_extensions","commons"),delete r.properties),Pt.before("0.8.0")&&O.populateExtensions(r,"collection"),Pt.before("1.0.0-beta.1")&&O.mapValues(r,"stac_extensions",["assets"],["item-assets"]),r},extent(r){if(O.ensure(r,"extent",{}),Pt.before("0.8.0")&&(Array.isArray(r.extent.spatial)&&(r.extent.spatial={bbox:[r.extent.spatial]}),Array.isArray(r.extent.temporal)&&(r.extent.temporal={interval:[r.extent.temporal]})),O.ensure(r.extent,"spatial",{}),O.ensure(r.extent.spatial,"bbox",[]),O.ensure(r.extent,"temporal",{}),O.ensure(r.extent.temporal,"interval",[]),Pt.before("1.0.0-rc.3")){if(r.extent.temporal.interval.length>1){let t,e;for(let n of r.extent.temporal.interval){if(n[0]===null)t=null;else if(typeof n[0]=="string"&&t!==null)try{let i=new Date(n[0]);(typeof t>"u"||i"u"||i>e)&&(e=i)}catch{}}r.extent.temporal.interval.unshift([t?O.toISOString(t):null,e?O.toISOString(e):null])}if(r.extent.spatial.bbox.length>1){let t=r.extent.spatial.bbox.reduce((e,n)=>Array.isArray(n)?Math.max(n.length,e):e,4);if(t>=4){let e=new Array(t).fill(null),n=t/2;for(let i of r.extent.spatial.bbox){if(!Array.isArray(i)||i.length<4)break;for(let s in i){let o=i[s];e[s]===null?e[s]=o:si===null)===-1&&r.extent.spatial.bbox.unshift(e)}}}},collectionAssets(r){Pt.before("1.0.0-rc.1")&&O.removeExtension(r,"collection-assets"),sa.migrateAll(r)},itemAsset(r){Pt.before("1.0.0-beta.2")&&O.rename(r,"item_assets","assets"),sa.migrateAll(r,"item_assets")},summaries(r){if(O.ensure(r,"summaries",{}),Pt.before("0.8.0")&&O.isObject(r.other_properties)){for(let t in r.other_properties){let e=r.other_properties[t];Array.isArray(e.extent)&&e.extent.length===2?r.summaries[t]={minimum:e.extent[0],maximum:e.extent[1]}:Array.isArray(e.values)&&(e.values.filter(n=>Array.isArray(n)).length===e.values.length?r.summaries[t]=e.values.reduce((n,i)=>n.concat(i),[]):r.summaries[t]=e.values)}delete r.other_properties}if(Pt.before("1.0.0-beta.1")&&O.isObject(r.properties)&&!r.links.find(t=>["child","item"].includes(t.rel)))for(let t in r.properties){let e=r.properties[t];Array.isArray(e)||(e=[e]),r.summaries[t]=e}Pt.before("1.0.0-rc.1")&&O.mapObject(r.summaries,t=>(O.rename(t,"min","minimum"),O.rename(t,"max","maximum"),t)),Nh.migrate(r.summaries,r,!0),O.moveTo(r.summaries,"sci:doi",r,!0)&&O.addExtension(r,ut.scientific),O.moveTo(r.summaries,"sci:publications",r,!0,!0)&&O.addExtension(r,ut.scientific),O.moveTo(r.summaries,"sci:citation",r,!0)&&O.addExtension(r,ut.scientific),O.moveTo(r.summaries,"cube:dimensions",r,!0)&&O.addExtension(r,ut.datacube),Object.keys(r.summaries).length===0&&delete r.summaries}},fg={migrate(r,t=null,e=!0){Pt.set(r),e&&(r.stac_version=ug),O.ensure(r,"stac_extensions",[]),Pt.before("1.0.0-rc.1")&&O.migrateExtensionShortnames(r),O.ensure(r,"id",""),O.ensure(r,"type","Feature"),O.isObject(r.geometry)||(r.geometry=null),r.geometry!==null&&O.ensure(r,"bbox",[]),O.ensure(r,"properties",{}),O.ensure(r,"links",[]),O.ensure(r,"assets",{});let n=!1;return O.isObject(t)&&O.isObject(t.properties)&&(O.removeFromArray(r,"stac_extensions","commons"),r.properties=Object.assign({},t.properties,r.properties),n=!0),O.runAll(fg,r,r),Nh.migrate(r.properties,r),sa.migrateAll(r),(Pt.before("0.8.0")||n)&&O.populateExtensions(r,"item"),r}},My={migrate(r,t=!0){return O.ensure(r,"collections",[]),O.ensure(r,"links",[]),O.runAll(My,r,r),r.collections=r.collections.map(e=>gg.migrate(e,t)),r}},Ry={migrate(r,t=!0){return O.ensure(r,"type","FeatureCollection"),O.ensure(r,"features",[]),O.ensure(r,"links",[]),O.runAll(Ry,r,r),r.features=r.features.map(e=>fg.migrate(e,null,t)),r}},sa={migrateAll(r,t="assets"){for(let e in r[t])sa.migrate(r[t][e],r)},migrate(r,t){return O.runAll(sa,r,t),Nh.migrate(r,t),r},mediaTypes(r){O.is(r.type,"string")&&O.mapValues(r,"type",["image/vnd.stac.geotiff","image/vnd.stac.geotiff; cloud-optimized=true"],["image/tiff; application=geotiff","image/tiff; application=geotiff; profile=cloud-optimized"])},eo(r,t){let e=O.isObject(t.properties)&&Array.isArray(t.properties["eo:bands"])?t.properties["eo:bands"]:[];if(Array.isArray(r["eo:bands"]))for(let n in r["eo:bands"]){let i=r["eo:bands"][n];O.is(i,"number")&&O.isObject(e[i])?i=e[i]:O.isObject(i)||(i={}),r["eo:bands"][n]=i}}},Nh={migrate(r,t,e=!1){return O.runAll(Nh,r,t,e),r},_commonMetadata(r){Pt.before("1.0.0-rc.3")&&(O.toUTC(r,"created"),O.toUTC(r,"updated"))},_timestamps(r,t){O.toUTC(r,"published"),O.toUTC(r,"expires"),O.toUTC(r,"unpublished"),O.upgradeExtension(t,ut.timestamps)},_versioningIndicator(r,t){O.upgradeExtension(t,ut.version)},checksum(r,t){Pt.before("0.9.0")&&Hr.multihash&&(O.rename(r,"checksum:md5","checksum:multihash")&&Hr.toMultihash(r,"checksum:multihash","md5"),O.rename(r,"checksum:sha1","checksum:multihash")&&Hr.toMultihash(r,"checksum:multihash","sha1"),O.rename(r,"checksum:sha2","checksum:multihash")&&Hr.toMultihash(r,"checksum:multihash","sha2-256"),O.rename(r,"checksum:sha3","checksum:multihash")&&Hr.toMultihash(r,"checksum:multihash","sha3-256")),Pt.before("1.0.0-rc.1")&&O.rename(r,"checksum:multihash","file:checksum")&&O.addExtension(t,ut.file),O.removeExtension(t,"checksum")},classification(r,t){Pt.before("1.1.0","classification")&&O.forAll(r,"classification:classes",e=>O.rename(e,"color-hint","color_hint")),O.upgradeExtension(t,ut.classification)},cube(r,t){O.upgradeExtension(t,ut.datacube)},dtr(r,t){Pt.before("0.9.0")&&(O.rename(r,"dtr:start_datetime","start_datetime"),O.rename(r,"dtr:end_datetime","end_datetime"),O.removeExtension(t,"datetime-range"))},eo(r,t){Pt.before("0.9.0")&&(O.rename(r,"eo:epsg","proj:epsg")&&O.addExtension(t,ut.projection),O.rename(r,"eo:platform","platform"),O.rename(r,"eo:instrument","instruments")&&O.toArray(r,"instruments"),O.rename(r,"eo:constellation","constellation"),O.rename(r,"eo:off_nadir","view:off_nadir")&&O.addExtension(t,ut.view),O.rename(r,"eo:azimuth","view:azimuth")&&O.addExtension(t,ut.view),O.rename(r,"eo:incidence_angle","view:incidence_angle")&&O.addExtension(t,ut.view),O.rename(r,"eo:sun_azimuth","view:sun_azimuth")&&O.addExtension(t,ut.view),O.rename(r,"eo:sun_elevation","view:sun_elevation")&&O.addExtension(t,ut.view)),Pt.before("1.0.0-beta.1")&&O.rename(r,"eo:gsd","gsd"),O.upgradeExtension(t,ut.eo)},file(r,t){O.upgradeExtension(t,ut.file)},label(r,t){Pt.before("0.8.0")&&(O.rename(r,"label:property","label:properties"),O.rename(r,"label:task","label:tasks"),O.rename(r,"label:overview","label:overviews")&&O.toArray(r,"label:overviews"),O.rename(r,"label:method","label:methods"),O.toArray(r,"label:classes")),O.upgradeExtension(t,ut.label)},pc(r,t){Pt.before("0.8.0")&&O.rename(r,"pc:schema","pc:schemas"),O.upgradeExtension(t,ut.pointcloud)},processing(r,t){O.upgradeExtension(t,ut.processing)},proj(r,t){O.upgradeExtension(t,ut.projection)},raster(r,t){O.upgradeExtension(t,ut.raster)},sar(r,t,e){O.rename(r,"sar:incidence_angle","view:incidence_angle")&&O.addExtension(t,ut.view),O.rename(r,"sar:pass_direction","sat:orbit_state")&&O.mapValues(r,"sat:orbit_state",[null],["geostationary"])&&O.addExtension(t,ut.sat),Pt.before("0.7.0")&&(O.flattenArray(r,"sar:resolution",["sar:resolution_range","sar:resolution_azimuth"],e),O.flattenArray(r,"sar:pixel_spacing",["sar:pixel_spacing_range","sar:pixel_spacing_azimuth"],e),O.flattenArray(r,"sar:looks",["sar:looks_range","sar:looks_azimuth","sar:looks_equivalent_number"],e),O.rename(r,"sar:off_nadir","view:off_nadir")&&O.addExtension(t,ut.view)),Pt.before("0.9.0")&&(O.rename(r,"sar:platform","platform"),O.rename(r,"sar:instrument","instruments")&&O.toArray(r,"instruments"),O.rename(r,"sar:constellation","constellation"),O.rename(r,"sar:type","sar:product_type"),O.rename(r,"sar:polarization","sar:polarizations"),O.flattenOneElementArray(r,"sar:absolute_orbit",e)&&O.rename(r,"sar:absolute_orbit","sat:absolute_orbit")&&O.addExtension(t,ut.sat),O.flattenOneElementArray(r,"sar:relative_orbit",e)&&O.rename(r,"sar:relative_orbit","sat:relative_orbit")&&O.addExtension(t,ut.sat)),O.upgradeExtension(t,ut.sar)},sat(r,t){Pt.before("0.9.0")&&(O.rename(r,"sat:off_nadir_angle","sat:off_nadir"),O.rename(r,"sat:azimuth_angle","sat:azimuth"),O.rename(r,"sat:sun_azimuth_angle","sat:sun_azimuth"),O.rename(r,"sat:sun_elevation_angle","sat:sun_elevation")),O.upgradeExtension(t,ut.sat)},sci(r,t){O.upgradeExtension(t,ut.scientific)},item(r){Pt.before("0.8.0")&&(O.rename(r,"item:license","license"),O.rename(r,"item:providers","providers"))},table(r,t){O.upgradeExtension(t,ut.table)},view(r,t){O.upgradeExtension(t,ut.view)}},gs={item(r,t=null,e=!0){return fg.migrate(r,t,e)},catalog(r,t=!0){return dg.migrate(r,t)},collection(r,t=!0){return gg.migrate(r,t)},collectionCollection(r,t=!0){return My.migrate(r,t)},itemCollection(r,t=!0){return Ry.migrate(r,t)},stac(r,t=!0){return r.type==="Feature"?gs.item(r,null,t):r.type==="FeatureCollection"?gs.itemCollection(r,t):r.type==="Collection"||!r.type&&O.isDefined(r.extent)&&O.isDefined(r.license)?gs.collection(r,t):!r.type&&Array.isArray(r.collections)?gs.collectionCollection(r,t):gs.catalog(r,t)},enableMultihash(r){Hr.multihash=r}},cL=gs;const uL=Vs(cL);function no(r){let t=r.length>=6,e=r[0],n=r[t?3:2],i=r[1],s=r[t?4:3],o={west:e,east:n,south:i,north:s};return t&&(o.base=r[2],o.height=r[5]),o}function Sc(r){let{west:t,east:e,south:n,north:i}=no(r);return[[[t,i],[t,n],[e,n],[e,i],[t,i]]]}function dL(r){if(!Dr(r))return null;let t=no(r),e=[];if(Iy(r)){let n=(t.west+360+t.east)/2;n>180&&(n-=360),e.push(n)}else e.push((t.west+t.east)/2);return e.push((t.south+t.north)/2),typeof t.base<"u"&&e.push((t.base+t.height)/2),e}function Cy(r){if(Dr(r)?r=[r]:Array.isArray(r)&&(r=r.filter(n=>Dr(n))),!Array.isArray(r)||r.length===0)return null;let t=r.reduce((n,i)=>{if(Iy(i)){let{west:s,east:o,south:a,north:l}=no(i);n.push(Sc([-180,a,o,l])),n.push(Sc([s,a,180,l]))}else n.push(Sc(i));return n},[]),e=null;if(t.length===1?e={type:"Polygon",coordinates:t[0]}:t.length>1&&(e={type:"MultiPolygon",coordinates:t}),e)return{type:"Feature",geometry:e,properties:{}}}function Dr(r){if(!Array.isArray(r)||![4,6].includes(r.length)||r.some(s=>typeof s!="number"))return!1;let{west:t,east:e,south:n,north:i}=no(r);return n<=i&&t>=-180&&t<=180&&n>=-90&&e<=180&&e>=-180&&i<=90}function Iy(r){if(!Dr(r))return!1;let{west:t,east:e}=no(r);return t>e}function Py(r){if(!Array.isArray(r)||r.length===0)return null;let t={west:180,south:90,east:-180,north:-90};r.forEach(n=>{if(!Dr(n))return;let i=no(n),s=["west","south"];for(let o in i){let a=s.includes(o)?Math.min:Math.max;t[o]=a(t[o],i[o])}});let e=[t.west,t.south,t.east,t.north];return Dr(e)?e:null}function nr(r){return typeof r=="string"&&r.length>0}function Je(r){return typeof r=="object"&&r===Object(r)&&!Array.isArray(r)}function Ay(...r){if(r=r.filter(t=>Array.isArray(t)),r.length>1){let t=Math.max(...r.map(n=>n.length)),e=[];for(let n=0;ni[n])));return e}else if(r.length===1)return r[0];return[]}function gL(r){switch(r){case"int8":return-128;case"int16":return-32768;case"int32":return-2147483648}return r.startsWith("u")?0:null}function fL(r){switch(r){case"int8":return 127;case"uint8":return 255;case"int16":return 32767;case"uint16":return 65535;case"int32":return 2147483647;case"uint32":return 4294967295}return null}class Dh{constructor(t,e={},n=[]){if(!Je(t))throw new Error("Given data is not an object");if(t instanceof Dh){for(let i of n)this[i]=t[i];t=t.toJSON()}this._keyMap=e,this._privateKeys=["_keyMap","_privateKeys"].concat(n);for(let i in t)typeof this[i]>"u"&&(i in e?this[i]=e[i](t[i],this):this[i]=t[i])}isItem(){return this.type==="Feature"}isCatalog(){return this.type==="Catalog"}isCatalogLike(){return this.isCatalog()||this.isCollection()}isCollection(){return this.type==="Collection"}isItemCollection(){return this.type==="FeatureCollection"}isCollectionCollection(){return!1}isAsset(){return!1}isLink(){return!1}getObjectType(){}getAbsoluteUrl(){return null}getMetadata(t){return this[t]}toGeoJSON(){return null}getBoundingBox(){return null}getCenter(){return dL(this.getBoundingBox())}getBoundingBoxes(){return[]}toJSON(){let t={};return Object.keys(this).forEach(e=>{if(typeof this[e]=="function"||this._privateKeys.includes(e))return;let n=this[e];if(e in this._keyMap){let i=Array.isArray(n)?[]:{};for(let s in n)i[s]=n[s].toJSON();n=i}t[e]=n}),t}}var Ly={exports:{}},ll={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */ll.exports;var Ip;function pL(){return Ip||(Ip=1,function(r,t){(function(e){var n=t&&!t.nodeType&&t,i=r&&!r.nodeType&&r,s=typeof Ai=="object"&&Ai;(s.global===s||s.window===s||s.self===s)&&(e=s);var o,a=2147483647,l=36,h=1,c=26,u=38,d=700,g=72,f=128,m="-",_=/^xn--/,y=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=l-h,E=Math.floor,T=String.fromCharCode,R;function C(G){throw new RangeError(w[G])}function A(G,W){for(var $=G.length,st=[];$--;)st[$]=W(G[$]);return st}function k(G,W){var $=G.split("@"),st="";$.length>1&&(st=$[0]+"@",G=$[1]),G=G.replace(x,".");var X=G.split("."),lt=A(X,W).join(".");return st+lt}function F(G){for(var W=[],$=0,st=G.length,X,lt;$=55296&&X<=56319&&$65535&&(W-=65536,$+=T(W>>>10&1023|55296),W=56320|W&1023),$+=T(W),$}).join("")}function p(G){return G-48<10?G-22:G-65<26?G-65:G-97<26?G-97:l}function v(G,W){return G+22+75*(G<26)-((W!=0)<<5)}function b(G,W,$){var st=0;for(G=$?E(G/d):G>>1,G+=E(G/W);G>S*c>>1;st+=l)G=E(G/S);return E(st+(S+1)*G/(G+u))}function M(G){var W=[],$=G.length,st,X=0,lt=f,ct=g,gt,qt,Lt,Ut,Qt,me,de,Ve,Oe;for(gt=G.lastIndexOf(m),gt<0&&(gt=0),qt=0;qt=128&&C("not-basic"),W.push(G.charCodeAt(qt));for(Lt=gt>0?gt+1:0;Lt<$;){for(Ut=X,Qt=1,me=l;Lt>=$&&C("invalid-input"),de=p(G.charCodeAt(Lt++)),(de>=l||de>E((a-X)/Qt))&&C("overflow"),X+=de*Qt,Ve=me<=ct?h:me>=ct+c?c:me-ct,!(deE(a/Oe)&&C("overflow"),Qt*=Oe;st=W.length+1,ct=b(X-Ut,st,Ut==0),E(X/st)>a-lt&&C("overflow"),lt+=E(X/st),X%=st,W.splice(X++,0,lt)}return z(W)}function L(G){var W,$,st,X,lt,ct,gt,qt,Lt,Ut,Qt,me=[],de,Ve,Oe,cn;for(G=F(G),de=G.length,W=f,$=0,lt=g,ct=0;ct=W&&QtE((a-$)/Ve)&&C("overflow"),$+=(gt-W)*Ve,W=gt,ct=0;cta&&C("overflow"),Qt==W){for(qt=$,Lt=l;Ut=Lt<=lt?h:Lt>=lt+c?c:Lt-lt,!(qt1;g++)u.splice(0,1);a[d]=u.join("")}var f=-1,m=0,_=0,y=-1,x=!1;for(d=0;dm&&(f=y,m=_)):a[d]==="0"&&(x=!0,y=d,_=1);_>m&&(f=y,m=_),m>1&&a.splice(f,m,""),l=a.length;var w="";for(a[0]===""&&(w=":"),d=0;d=i.length-1)return!1;var o=i.lastIndexOf(".",s-1);if(o<=0||o>=s-1)return!1;var a=n.list[i.slice(s+1)];return a?a.indexOf(" "+i.slice(o+1,s)+" ")>=0:!1},is:function(i){var s=i.lastIndexOf(".");if(s<=0||s>=i.length-1)return!1;var o=i.lastIndexOf(".",s-1);if(o>=0)return!1;var a=n.list[i.slice(s+1)];return a?a.indexOf(" "+i.slice(0,s)+" ")>=0:!1},get:function(i){var s=i.lastIndexOf(".");if(s<=0||s>=i.length-1)return null;var o=i.lastIndexOf(".",s-1);if(o<=0||o>=s-1)return null;var a=n.list[i.slice(s+1)];return!a||a.indexOf(" "+i.slice(o+1,s)+" ")<0?null:i.slice(o+1)},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return n})}(Lp)),Lp.exports}/*! + * URI.js - Mutating URLs + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + */(function(r){(function(t,e){r.exports?r.exports=e(pL(),mL(),_L()):t.URI=e(t.punycode,t.IPv6,t.SecondLevelDomains,t)})(Ai,function(t,e,n,i){var s=i&&i.URI;function o(p,v){var b=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof o))return b?M?new o(p,v):new o(p):new o;if(p===void 0){if(b)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?p=location.href+"":p=""}if(p===null&&b)throw new TypeError("null is not a valid argument for URI");return this.href(p),v!==void 0?this.absoluteTo(v):this}function a(p){return/^[0-9]+$/.test(p)}o.version="1.19.11";var l=o.prototype,h=Object.prototype.hasOwnProperty;function c(p){return p.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(p){return p===void 0?"Undefined":String(Object.prototype.toString.call(p)).slice(8,-1)}function d(p){return u(p)==="Array"}function g(p,v){var b={},M,L;if(u(v)==="RegExp")b=null;else if(d(v))for(M=0,L=v.length;M]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(p){if(!(!p||!p.nodeName)){var v=p.nodeName.toLowerCase();if(!(v==="input"&&p.type!=="image"))return o.domAttributes[v]}};function y(p){return escape(p)}function x(p){return encodeURIComponent(p).replace(/[!'()*]/g,y).replace(/\*/g,"%2A")}o.encode=x,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=x,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(p,v){var b=o.encode(p+"");return v===void 0&&(v=o.escapeQuerySpace),v?b.replace(/%20/g,"+"):b},o.decodeQuery=function(p,v){p+="",v===void 0&&(v=o.escapeQuerySpace);try{return o.decode(v?p.replace(/\+/g,"%20"):p)}catch{return p}};var w={encode:"encode",decode:"decode"},S,E=function(p,v){return function(b){try{return o[v](b+"").replace(o.characters[p][v].expression,function(M){return o.characters[p][v].map[M]})}catch{return b}}};for(S in w)o[S+"PathSegment"]=E("pathname",w[S]),o[S+"UrnPathSegment"]=E("urnpath",w[S]);var T=function(p,v,b){return function(M){var L;b?L=function(W){return o[v](o[b](W))}:L=o[v];for(var D=(M+"").split(p),j=0,G=D.length;j-1&&(v.fragment=p.substring(b+1)||null,p=p.substring(0,b)),b=p.indexOf("?"),b>-1&&(v.query=p.substring(b+1)||null,p=p.substring(0,b)),p=p.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),p=p.replace(/^[/\\]{2,}/i,"//"),p.substring(0,2)==="//"?(v.protocol=null,p=p.substring(2),p=o.parseAuthority(p,v)):(b=p.indexOf(":"),b>-1&&(v.protocol=p.substring(0,b)||null,v.protocol&&!v.protocol.match(o.protocol_expression)?v.protocol=void 0:p.substring(b+1,b+3).replace(/\\/g,"/")==="//"?(p=p.substring(b+3),p=o.parseAuthority(p,v)):(p=p.substring(b+1),v.urn=!0))),v.path=p,v},o.parseHost=function(p,v){p||(p=""),p=p.replace(/\\/g,"/");var b=p.indexOf("/"),M,L;if(b===-1&&(b=p.length),p.charAt(0)==="[")M=p.indexOf("]"),v.hostname=p.substring(1,M)||null,v.port=p.substring(M+2,b)||null,v.port==="/"&&(v.port=null);else{var D=p.indexOf(":"),j=p.indexOf("/"),G=p.indexOf(":",D+1);G!==-1&&(j===-1||G-1?L:p.length-1),j;return D>-1&&(L===-1||D-1?lt=lt.slice(0,ct)+lt.slice(ct).replace(D,""):lt=lt.replace(D,""),!(lt.length<=W[0].length)&&!(b.ignore&&b.ignore.test(lt))){X=$+lt.length;var Lt=v(lt,$,X,p);if(Lt===void 0){M.lastIndex=X;continue}Lt=String(Lt),p=p.slice(0,$)+Lt+p.slice(X),M.lastIndex=$+Lt.length}}return M.lastIndex=0,p},o.ensureValidHostname=function(p,v){var b=!!p,M=!!v,L=!1;if(M&&(L=f(o.hostProtocols,v)),L&&!b)throw new TypeError("Hostname cannot be empty, if protocol is "+v);if(p&&p.match(o.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+p+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(p).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+p+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(p){if(p){var v=Number(p);if(!(a(v)&&v>0&&v<65536))throw new TypeError('Port "'+p+'" is not a valid port')}},o.noConflict=function(p){if(p){var v={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(v.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(v.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(v.SecondLevelDomains=i.SecondLevelDomains.noConflict()),v}else i.URI===this&&(i.URI=s);return this},l.build=function(p){return p===!0?this._deferred_build=!0:(p===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},l.clone=function(){return new o(this)},l.valueOf=l.toString=function(){return this.build(!1)._string};function R(p){return function(v,b){return v===void 0?this._parts[p]||"":(this._parts[p]=v||null,this.build(!b),this)}}function C(p,v){return function(b,M){return b===void 0?this._parts[p]||"":(b!==null&&(b=b+"",b.charAt(0)===v&&(b=b.substring(1))),this._parts[p]=b,this.build(!M),this)}}l.protocol=R("protocol"),l.username=R("username"),l.password=R("password"),l.hostname=R("hostname"),l.port=R("port"),l.query=C("query","?"),l.fragment=C("fragment","#"),l.search=function(p,v){var b=this.query(p,v);return typeof b=="string"&&b.length?"?"+b:b},l.hash=function(p,v){var b=this.fragment(p,v);return typeof b=="string"&&b.length?"#"+b:b},l.pathname=function(p,v){if(p===void 0||p===!0){var b=this._parts.path||(this._parts.hostname?"/":"");return p?(this._parts.urn?o.decodeUrnPath:o.decodePath)(b):b}else return this._parts.urn?this._parts.path=p?o.recodeUrnPath(p):"":this._parts.path=p?o.recodePath(p):"/",this.build(!v),this},l.path=l.pathname,l.href=function(p,v){var b;if(p===void 0)return this.toString();this._string="",this._parts=o._parts();var M=p instanceof o,L=typeof p=="object"&&(p.hostname||p.path||p.pathname);if(p.nodeName){var D=o.getDomAttribute(p);p=p[D]||"",L=!1}if(!M&&L&&p.pathname!==void 0&&(p=p.toString()),typeof p=="string"||p instanceof String)this._parts=o.parse(String(p),this._parts);else if(M||L){var j=M?p._parts:p;for(b in j)b!=="query"&&h.call(this._parts,b)&&(this._parts[b]=j[b]);j.query&&this.query(j.query,!1)}else throw new TypeError("invalid input");return this.build(!v),this},l.is=function(p){var v=!1,b=!1,M=!1,L=!1,D=!1,j=!1,G=!1,W=!this._parts.urn;switch(this._parts.hostname&&(W=!1,b=o.ip4_expression.test(this._parts.hostname),M=o.ip6_expression.test(this._parts.hostname),v=b||M,L=!v,D=L&&n&&n.has(this._parts.hostname),j=L&&o.idn_expression.test(this._parts.hostname),G=L&&o.punycode_expression.test(this._parts.hostname)),p.toLowerCase()){case"relative":return W;case"absolute":return!W;case"domain":case"name":return L;case"sld":return D;case"ip":return v;case"ip4":case"ipv4":case"inet4":return b;case"ip6":case"ipv6":case"inet6":return M;case"idn":return j;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return G}return null};var A=l.protocol,k=l.port,F=l.hostname;l.protocol=function(p,v){if(p&&(p=p.replace(/:(\/\/)?$/,""),!p.match(o.protocol_expression)))throw new TypeError('Protocol "'+p+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return A.call(this,p,v)},l.scheme=l.protocol,l.port=function(p,v){return this._parts.urn?p===void 0?"":this:(p!==void 0&&(p===0&&(p=null),p&&(p+="",p.charAt(0)===":"&&(p=p.substring(1)),o.ensureValidPort(p))),k.call(this,p,v))},l.hostname=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(p!==void 0){var b={preventInvalidHostname:this._parts.preventInvalidHostname},M=o.parseHost(p,b);if(M!=="/")throw new TypeError('Hostname "'+p+'" contains characters other than [A-Z0-9.-]');p=b.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(p,this._parts.protocol)}return F.call(this,p,v)},l.origin=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(p===void 0){var b=this.protocol(),M=this.authority();return M?(b?b+"://":"")+this.authority():""}else{var L=o(p);return this.protocol(L.protocol()).authority(L.authority()).build(!v),this}},l.host=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(p===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var b=o.parseHost(p,this._parts);if(b!=="/")throw new TypeError('Hostname "'+p+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},l.authority=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(p===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var b=o.parseAuthority(p,this._parts);if(b!=="/")throw new TypeError('Hostname "'+p+'" contains characters other than [A-Z0-9.-]');return this.build(!v),this},l.userinfo=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(p===void 0){var b=o.buildUserinfo(this._parts);return b&&b.substring(0,b.length-1)}else return p[p.length-1]!=="@"&&(p+="@"),o.parseUserinfo(p,this._parts),this.build(!v),this},l.resource=function(p,v){var b;return p===void 0?this.path()+this.search()+this.hash():(b=o.parse(p),this._parts.path=b.path,this._parts.query=b.query,this._parts.fragment=b.fragment,this.build(!v),this)},l.subdomain=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(p===void 0){if(!this._parts.hostname||this.is("IP"))return"";var b=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,b)||""}else{var M=this._parts.hostname.length-this.domain().length,L=this._parts.hostname.substring(0,M),D=new RegExp("^"+c(L));if(p&&p.charAt(p.length-1)!=="."&&(p+="."),p.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return p&&o.ensureValidHostname(p,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(D,p),this.build(!v),this}},l.domain=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(typeof p=="boolean"&&(v=p,p=void 0),p===void 0){if(!this._parts.hostname||this.is("IP"))return"";var b=this._parts.hostname.match(/\./g);if(b&&b.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(v).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!p)throw new TypeError("cannot set domain empty");if(p.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(p,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=p;else{var L=new RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(L,p)}return this.build(!v),this}},l.tld=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(typeof p=="boolean"&&(v=p,p=void 0),p===void 0){if(!this._parts.hostname||this.is("IP"))return"";var b=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(b+1);return v!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var L;if(p)if(p.match(/[^a-zA-Z0-9-]/))if(n&&n.is(p))L=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(L,p);else throw new TypeError('TLD "'+p+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");L=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(L,p)}else throw new TypeError("cannot set TLD empty");return this.build(!v),this}},l.directory=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(p===void 0||p===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var b=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,b)||(this._parts.hostname?"/":"");return p?o.decodePath(M):M}else{var L=this._parts.path.length-this.filename().length,D=this._parts.path.substring(0,L),j=new RegExp("^"+c(D));return this.is("relative")||(p||(p="/"),p.charAt(0)!=="/"&&(p="/"+p)),p&&p.charAt(p.length-1)!=="/"&&(p+="/"),p=o.recodePath(p),this._parts.path=this._parts.path.replace(j,p),this.build(!v),this}},l.filename=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(typeof p!="string"){if(!this._parts.path||this._parts.path==="/")return"";var b=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(b+1);return p?o.decodePathSegment(M):M}else{var L=!1;p.charAt(0)==="/"&&(p=p.substring(1)),p.match(/\.?\//)&&(L=!0);var D=new RegExp(c(this.filename())+"$");return p=o.recodePath(p),this._parts.path=this._parts.path.replace(D,p),L?this.normalizePath(v):this.build(!v),this}},l.suffix=function(p,v){if(this._parts.urn)return p===void 0?"":this;if(p===void 0||p===!0){if(!this._parts.path||this._parts.path==="/")return"";var b=this.filename(),M=b.lastIndexOf("."),L,D;return M===-1?"":(L=b.substring(M+1),D=/^[a-z0-9%]+$/i.test(L)?L:"",p?o.decodePathSegment(D):D)}else{p.charAt(0)==="."&&(p=p.substring(1));var j=this.suffix(),G;if(j)p?G=new RegExp(c(j)+"$"):G=new RegExp(c("."+j)+"$");else{if(!p)return this;this._parts.path+="."+o.recodePath(p)}return G&&(p=o.recodePath(p),this._parts.path=this._parts.path.replace(G,p)),this.build(!v),this}},l.segment=function(p,v,b){var M=this._parts.urn?":":"/",L=this.path(),D=L.substring(0,1)==="/",j=L.split(M);if(p!==void 0&&typeof p!="number"&&(b=v,v=p,p=void 0),p!==void 0&&typeof p!="number")throw new Error('Bad segment "'+p+'", must be 0-based integer');if(D&&j.shift(),p<0&&(p=Math.max(j.length+p,0)),v===void 0)return p===void 0?j:j[p];if(p===null||j[p]===void 0)if(d(v)){j=[];for(var G=0,W=v.length;G"u"?!0:typeof r!="string"?!1:(t=t.map(n=>n.toLowerCase()),t.includes(r.toLowerCase()))}function bL(r,t=!1){return pg(r,EL,t)}class Ny extends Dh{constructor(t,e=null,n={},i=[]){super(t,n,["_context"].concat(i)),this._context||(this._context=e)}getAbsoluteUrl(t=!0){return this._context?vL(this.href,this._context.getAbsoluteUrl(),t):this.href.includes("://")?this.href:null}getContext(){return this._context}canBrowserDisplayImage(t=!1){if(typeof this.href!="string"||!t&&typeof this.type>"u")return!1;let e=new lu(this.href),n=e.protocol().toLowerCase(),i=e.suffix().toLowerCase();return nr(n)&&!Fp.includes(n)?!1:nr(this.type)&&Np.includes(this.type.toLowerCase())?!0:!!(typeof this.type>"u"&&nr(i)&&(i==="jpg"||Np.includes("image/"+i)))}isType(t){return nr(this.type)&&pg(this.type,t)}isGeoTIFF(){return this.isType(Fy)}isCOG(){return this.isType(Oy)}isHTTP(){let t=this.getAbsoluteUrl(!1).protocol().toLowerCase();return nr(t)&&Fp.includes(t)}}class mg extends Ny{constructor(t,e=null){super(t,e)}isLink(){return!0}getObjectType(){return"Link"}static fromLinks(t,e=null){return Array.isArray(t)?t.map(n=>Je(n)?new mg(n,e):n):[]}}class Dy extends Dh{constructor(t,e=null,n={},i=[]){if(super(t,Object.assign({links:mg.fromLinks},n),["_url"].concat(i)),!this._url&&(this._url=e,!this._url)){let s=this.getSelfLink();s&&(this._url=s.href)}}getAbsoluteUrl(){return this._url}setAbsoluteUrl(t){this._url=t}getStacLinksWithRel(t,e=!0){return this.getLinksWithRels([t]).filter(n=>bL(n.type,e))}getStacLinkWithRel(t,e=!0){const n=this.getStacLinksWithRel(t,e);return n.length>0?n[0]:null}getLinks(){return Array.isArray(this.links)?this.links.filter(t=>Je(t)&&nr(t.href)):[]}getLinkWithRel(t){return this.getLinks().find(e=>e.rel===t)||null}getLinksWithRels(t){return this.getLinks().filter(e=>t.includes(e.rel))}getLinksWithOtherRels(t){return this.getLinks().filter(e=>!t.includes(e.rel))}getSelfLink(){return this.getStacLinkWithRel("self")}getRootLink(){return this.getStacLinkWithRel("root")}getParentLink(){return this.getStacLinkWithRel("parent")}}class ky extends Dy{constructor(t,e=null,n={},i=[]){super(t,e,n,i)}getAll(){return[]}}class si extends Ny{constructor(t,e=null,n=null){super(t,n,{},["_key"]),this._key||(this._key=e)}getObjectType(){return"Asset"}isAsset(){return!0}getAbsoluteUrl(t=!0){return this.isDefinition()?null:super.getAbsoluteUrl(t)}getKey(){return this._key}getMetadata(t){if(typeof this[t]<"u")return this[t];if(this._context)return this._context.getMetadata(t)}getBands(){return Ay(this["eo:bands"],this["raster:bands"])}findVisualBands(){let t={red:null,green:null,blue:null},e=this.getBands();for(let n in e){let i=parseInt(n,10),s=e[i];Je(s)&&nr(s.common_name)&&s.common_name in t&&(t[s.common_name]={index:i,band:s})}return Object.values(t).every(n=>n!==null)?t:null}findBand(t,e="name",n=null){Array.isArray(t)||(t=[t]),Je(n)||(n=this.getBands());let i=n.findIndex(s=>Je(s)&&t.includes(s[e]));return i>=0?{index:i,band:n[i]}:null}getBand(t){return Je(t)||t===null?t:this.getBands()[t]||null}getMinMaxValues(t=null){t=this.getBand(t);const e={minimum:null,maximum:null},n=a=>a.minimum!==null&&a.maximum!==null;if(t&&(Je(t.statistics)&&(typeof t.statistics.minimum=="number"&&(e.minimum=t.statistics.minimum),typeof t.statistics.maximum=="number"&&(e.maximum=t.statistics.maximum),n(e))||Je(t.histogram)&&(typeof t.histogram.min=="number"&&(e.minimum=t.histogram.min),typeof t.histogram.max=="number"&&(e.maximum=t.histogram.max),n(e))))return e;let i=this.getMetadata("classification:classes");if(Array.isArray(i)&&(i.reduce((a,l)=>(a.minimum=Math.min(a.minimum,l.value),a.maximum=Math.max(a.maximum,l.value),a),e),n(e)))return e;let s=this.getMetadata("file:values");if(Array.isArray(s)&&(s.reduce((a,l)=>(a.minimum=Math.min(a.minimum,...l.values),a.maximum=Math.max(a.maximum,...l.values),a),e),n(e)))return e;let o=Je(t)&&t.data_type||this.getMetadata("file:data_type");return o&&(e.minimum=gL(o),e.maximum=fL(o)),e}getNoDataValues(t=null){t=this.getBand(t);let e=[];if(t&&typeof t.nodata<"u")e.push(t.nodata);else{let n=this.getMetadata("file:nodata");if(typeof n<"u")e=n;else{let i=this.getMetadata("classification:classes");Array.isArray(i)&&(e=i.filter(s=>!!s.nodata).map(s=>s.value))}}return e.map(n=>n==="nan"?NaN:n==="+inf"?1/0:n==="-inf"?-1/0:n)}isDefinition(){return!nr(this.href)}isHTTP(){return this.isDefinition()?null:super.isHTTP()}hasRole(t,e=!1){return Array.isArray(t)||(t=[t]),e&&t.includes(this.getKey())?!0:Array.isArray(this.roles)&&!!this.roles.find(n=>t.includes(n))}static fromAssets(t,e=null){let n={};if(Je(t))for(let i in t)n[i]=new si(t[i],i,e);return n}}class Aa extends Dy{constructor(t,e=null,n={},i=[]){super(t,e,n,i)}getTemporalExtent(){return null}getTemporalExtents(){return[]}getIcons(t=!0){return this.getLinksWithRels(["icon"]).filter(e=>e.canBrowserDisplayImage(t))}getThumbnails(t=!0,e=null){let n=this.getAssetsWithRoles(["thumbnail","overview"],!0);if(n.length===0&&(n=this.getLinksWithRels(["preview"])),t&&(n=n.filter(i=>i.canBrowserDisplayImage())),e&&n.length>1){let i=s=>Array.isArray(s.roles)&&s.roles.includes(e)||s.getKey()===e;n=n.filter(i).concat(n.filter(s=>!i(s)))}return n}getDefaultGeoTIFF(t=!0,e=!1){var n;return(n=this.rankGeoTIFFs(t,e)[0])==null?void 0:n.asset}rankGeoTIFFs(t=!0,e=!1,n=null,i=null){Je(n)||(n={data:1,visual:2,thumbnail:2,overview:3});let s=[],o=this.getAssetsByTypes(Fy);t&&(o=o.filter(l=>l.isHTTP()&&(!e||l.isCOG())));let a=Object.entries(n);for(let l of o){let h=0;if(a.length>0){let c=a.filter(([u])=>l.hasRole(u,!0)).map(([,u])=>u);c.length>0&&(h+=Math.max(...c))}!e&&l.isCOG()&&(h+=2),l.findVisualBands()&&(h+=1),typeof i=="function"&&(h+=i(l)),s.push({asset:l,score:h})}return s.sort((l,h)=>h.score-l.score),s}findVisualAssets(){let t={red:null,green:null,blue:null},e=Object.keys(t),n=this.getAssets();for(let i of n){let s=i.getBands();if(s.length!==1)continue;let o=i.findBand(e,"common_name",s);o&&(t[o.band.common_name]=i)}return Object.values(t).every(i=>i!==null)?t:null}getAsset(t){return Je(this.assets)&&this.assets[t]||null}getAssets(){return Je(this.assets)?Object.values(this.assets):[]}getAssetsWithRoles(t,e=!1){return this.getAssets().filter(n=>n.hasRole(t,e))}getAssetWithRole(t,e=!1){return this.getAssetsWithRoles([t],e)[0]||null}getAssetsByTypes(t){return this.getAssets().filter(e=>pg(e.type,t))}equals(t){return this===t?!0:!(t instanceof Aa)||this.getObjectType()!==t.getObjectType()?!1:!!(this.id&&this.id===t.id)}}class Gy extends Aa{constructor(t,e=null,n={},i=[]){super(t,e,n,i)}getObjectType(){return this.type}getSearchLink(t=null){let e=this.getStacLinksWithRel("search");return t?e[0]||null:e.find(n=>n.method===t||!t&&!n.method)||null}getApiCollectionsLink(){return this.getStacLinkWithRel("data")}getApiItemsLink(){return this.getStacLinkWithRel("items")}getChildLinks(){return this.getStacLinksWithRel("child")}getItemLinks(){return this.getStacLinksWithRel("item")}}class TL extends Gy{constructor(t,e=null){super(t,e)}}function So(r){if(nr(r)&&r.length>=10)try{let t=r.match(/^(-?\d{1,})-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)(?:\.(\d*))?(?:Z|[+-]00:00)?$/i).slice(1).map(e=>parseInt(e,10));return new Date(Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5],t[6]||0))}catch{return null}return null}function ML(r,t){return new Date(r.valueOf()+(t-r)/2)}function jy(r){if(!Array.isArray(r)||r.length===0)return null;let t,e;const n=(i,s,o)=>typeof i>"u"?s:i===null||s===null?null:o(i,s);return r.forEach(([i,s])=>{t=n(t,i,Math.min),e=n(e,s,Math.max)}),[t===null?null:new Date(t),e===null?null:new Date(e)]}class zy extends Gy{constructor(t,e=null){const n={assets:si.fromAssets,item_assets:si.fromAssets};super(t,e,n)}toGeoJSON(){let t=Cy(this.getBoundingBoxes());return t&&(t.id=this.id),t}getBoundingBox(){let t=this.getRawBoundingBoxes();return t.length>0&&Dr(t[0])?t[0]:null}getBoundingBoxes(){let t=this.getRawBoundingBoxes();return t.length===1&&Dr(t[0])?t:t.length>1?t.filter((e,n)=>n>0&&Dr(e)):[]}getRawBoundingBoxes(){var t,e;let n=(e=(t=this.extent)==null?void 0:t.spatial)==null?void 0:e.bbox;return Array.isArray(n)&&n.length>0?n:[]}getTemporalExtent(){return this.getTemporalExtents()[0]||null}getTemporalExtents(){var t,e;let n=(e=(t=this.extent)==null?void 0:t.temporal)==null?void 0:e.interval;return Array.isArray(n)&&n.length>0?n.filter(i=>Array.isArray(i)&&(nr(i[0])||nr(i[1]))).map(i=>i.map(s=>So(s))):[]}getSummary(t){return this.summaries[t]}getBands(){let t=this.getSummary("eo:bands"),e=this.getSummary("raster:bands"),n=[t,e].filter(i=>Array.isArray(i));return n.length>=2?Ay(...n):n.length===1?n[0]:[]}}class RL extends ky{constructor(t,e=null){const n={collections:i=>i.map(s=>new zy(s))};super(t,e,n)}getObjectType(){return"CollectionCollection"}getAll(){return this.collections}isCollectionCollection(){return!0}toGeoJSON(){return{type:"FeatureCollection",features:this.collections.map(t=>t.toGeoJSON()).filter(t=>t!==null)}}getBoundingBox(){return Py(this.getBoundingBoxes())}getBoundingBoxes(){return this.collections.map(t=>t.getBoundingBox())}getTemporalExtent(){return jy(this.getTemporalExtents())}getTemporalExtents(){return this.collections.map(t=>t.getTemporalExtent())}}class Uy extends Aa{constructor(t,e=null){super(t,e,{assets:si.fromAssets})}getObjectType(){return"Item"}toGeoJSON(){return this.toJSON()}getBoundingBox(){return Dr(this.bbox)?this.bbox:null}getBoundingBoxes(){return Dr(this.bbox)?[this.bbox]:[]}getDateTime(){let t=So(this.properties.datetime);if(!t){let e=So(this.properties.start_datetime),n=So(this.properties.end_datetime);return e&&n?ML(e,n):e||n}return t}getTemporalExtent(){return this.getTemporalExtents()[0]||null}getTemporalExtents(){let t=[];return nr(this.properties.start_datetime)||nr(this.properties.end_datetime)?t=[[this.properties.start_datetime||null,this.properties.end_datetime||null]]:nr(this.properties.datetime)&&(t=[[this.properties.datetime,this.properties.datetime]]),t.map(e=>e.map(n=>So(n)))}getMetadata(t){return this.properties[t]}getBands(){let t=this.getMetadata("eo:bands");return Array.isArray(t)?t:[]}getCollectionLink(){return this.getStacLinkWithRel("collection")}}class CL extends ky{constructor(t,e=null){const n={features:i=>i.map(s=>new Uy(s))};super(t,e,n)}getObjectType(){return"ItemCollection"}getAll(){return this.features}toGeoJSON(){return this.toJSON()}getBoundingBox(){return Py(this.getBoundingBoxes())}getBoundingBoxes(){return this.features.map(t=>t.getBoundingBox())}getTemporalExtent(){return jy(this.getTemporalExtents())}getTemporalExtents(){return this.features.map(t=>t.getTemporalExtent())}}function IL(r,t=!0,e=!1){return t&&(r=uL.stac(r,e)),r.type==="Feature"?new Uy(r):r.type==="FeatureCollection"?new CL(r):r.type==="Collection"||!r.type&&typeof r.extent<"u"&&typeof r.license<"u"?new zy(r):!r.type&&Array.isArray(r.collections)?new RL(r):new TL(r)}class Dp extends Bd{constructor(t){super({...t,state:"loading"}),gu(this,"loadImage",n=>new Promise((i,s)=>{const o=new Image;o.addEventListener("load",()=>i(o)),o.addEventListener("error",()=>s(new Error("load failed"))),o.src=n}));const e=new zd(t.url);e.getHeader().then(n=>{this.tileGrid.minZoom=n.minZoom,this.tileGrid.maxZoom=n.maxZoom,this.setLoader(async(i,s,o)=>{const a=await e.getZxy(i,s,o),l=URL.createObjectURL(new Blob([a.data])),h=await this.loadImage(l);return URL.revokeObjectURL(l),h}),this.setState("ready")})}}class PL extends Fh{constructor(t){super({...t,state:"loading",url:"pmtiles://"+t.url+"/{z}/{x}/{y}",format:new v0}),gu(this,"tileLoadFunction",(e,n)=>{const i=new RegExp(/pmtiles:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),s=n.match(i),o=+s[2],a=+s[3],l=+s[4];e.setLoader((h,c,u)=>{e.setState(U.LOADING),this.pmtiles_.getZxy(o,a,l).then(d=>{if(d){const g=e.getFormat();e.setFeatures(g.readFeatures(d.data,{extent:h,featureProjection:u})),e.setState(U.LOADED)}else e.setFeatures([]),e.setState(U.EMPTY)}).catch(d=>{e.setFeatures([]),e.setState(U.ERROR)})})}),this.pmtiles_=new zd(t.url),this.pmtiles_.getHeader().then(e=>{this.tileGrid.minZoom=e.minZoom,this.tileGrid.maxZoom=e.maxZoom,this.setTileLoadFunction(this.tileLoadFunction),this.setState("ready")})}}let _g=null;function AL(){return!!_g}function By(r){_g=r;const t=Object.keys(r.defs),e=t.length;let n,i;for(n=0;n0&&(e.nodata=o[0]),t.length>0&&(e.bands=t),e}async function kp(r,t=void 0){let e=t;if(AL()){const n=r.getMetadata("proj:epsg");if(n)try{e=await OL(n)}catch{}}return e}function Gp(r,t){const e=r.clone();return t.hasOnlyBounds()||e.setFill(null),e}function kL(r){let t=r.href;if(t.includes("{s}"))if(Array.isArray(r["href:servers"])&&r["href:servers"].length>0){const e=Math.random()*r["href:servers"].length|0;t=t.replace("{s}",r["href:servers"][e])}else return null;return t}async function GL(r){try{const t=new URL(r);t.searchParams.set("service","wmts"),t.searchParams.set("request","GetCapabilities");const e=await fetch(t);return new fd().read(await e.text())}catch{return null}}class yg extends Sh{constructor(t){const e={};if(["opacity","visible","zIndex","minResolution","maxResolution","minZoom","maxZoom","properties"].forEach(n=>e[n]=t[n]),super(e),this.getSourceOptions_=t.getSourceOptions,this.data_,this.assets_=null,this.bands_=[],this.crossOrigin_=t.crossOrigin||null,this.displayFootprint_=t.displayFootprint!==!1,this.displayGeoTiffByDefault_=!!t.displayGeoTiffByDefault,this.displayPreview_=!!t.displayPreview,this.displayOverview_=t.displayOverview!==!1,this.displayWebMapLink_=t.displayWebMapLink||!1,this.buildTileUrlTemplate_=t.buildTileUrlTemplate||null,this.useTileLayerAsFallback_=t.useTileLayerAsFallback||!1,this.boundsStyle_=t.boundsStyle||FL,this.collectionStyle_=t.collectionStyle||NL,this.boundsLayer_=null,t.data){try{this.configure_(t.data,t.url,t.assets,t.bands)}catch(n){this.handleError_(n)}return}if(!t.url)throw new Error("Either url or data must be provided");fetch(t.url).then(n=>n.json()).then(n=>this.configure_(n,t.url,t.assets,t.bands)).catch(n=>this.handleError_(n))}getBoundsLayer(){return this.boundsLayer_}handleError_(t){this.dispatchEvent(new rP(t))}configure_(t,e=null,n=null,i=[]){t instanceof si||t instanceof Aa?this.data_=t:this.data_=IL(t),e&&e.includes("://")&&this.data_.setAbsoluteUrl(e),this.bands_=i,this.boundsLayer_=this.addFootprint_();const s=()=>{this.boundsLayer_&&this.boundsLayer_.setStyle(Gp(this.boundsStyle_,this))};this.getLayers().on("add",s),this.getLayers().on("remove",s),this.setAssets(n).then(()=>this.dispatchEvent("assetsready")).catch(o=>this.handleError_(o)),this.dispatchEvent("sourceready")}async addApiCollection_(){const t=this.getData().getAll().map(e=>{const n=new yg({data:e,crossOrigin:this.crossOrigin_,boundsStyle:this.collectionStyle_,displayGeoTiffByDefault:this.displayGeoTiffByDefault_,displayOverview:this.displayOverview_,displayPreview:this.displayPreview_,displayFootprint:this.displayFootprint_});return this.addLayer_(n),n});return await Promise.all(t)}async addStacAssets_(){let t=this.getAssets();if(t===null){t=[];const n=this.getData().getDefaultGeoTIFF(!0,!this.displayGeoTiffByDefault_);if(n)t.push(n);else{const i=this.getData().getThumbnails().filter(s=>!Array.isArray(s.roles)||!s.roles.includes("example"));i.length>0&&t.push(i[0])}}const e=t.map(n=>this.addImagery_(n));return await Promise.all(e)}async addImagery_(t){if(t){if(t.isGeoTIFF())return await this.addGeoTiff_(t);if(t.canBrowserDisplayImage())return await this.addThumbnail_(t)}}async addThumbnail_(t){if(!this.displayPreview_)return;let e={url:t.getAbsoluteUrl(),projection:await kp(t,"EPSG:4326"),imageExtent:t.getContext().getBoundingBox(),crossOrigin:this.crossOrigin_};this.getSourceOptions_&&(e=await this.getSourceOptions_(te.ImageStatic,e,t));const n=new Fd({source:new py(e)});return this.addLayer_(n,t),n}async addWebMapLinks_(){const t=this.getWebMapLinks();if(t.length>0)return await this.addLayerForLink(t[0])}async addLayerForLink(t){const e=kL(t);if(!e)return;const n={attributions:t.getMetadata("attribution")||this.data_.getMetadata("attribution"),crossOrigin:this.crossOrigin_,url:e},i=async(o,a)=>(this.getSourceOptions_&&(a=await this.getSourceOptions_(o,a,t)),a),s=[];switch(t.rel){case"pmtiles":const o=await new zd(n.url).getHeader();let a;switch(o.tileType){case ds.Mvt:a=new PL(await i(te.PMTilesVector,n));break;case ds.Avif:case ds.Jpeg:case ds.Png:case ds.Webp:a=new Dp(await i(te.PMTilesRaster,n));break;default:return}s.push(a);break;case"tilejson":s.push(new yy(await i(te.TileJSON,n)));break;case"wms":if(!Array.isArray(t["wms:layers"]))break;for(const c in t["wms:layers"]){const u=t["wms:layers"][c]||"";let d="";Array.isArray(t["wms:styles"])&&typeof t["wms:styles"][c]=="string"&&(d=t["wms:styles"][c]);const g=Object.assign({LAYERS:u,STYLES:d},t["wms:dimensions"]);typeof t["wms:transparent"]=="boolean"&&(g.TRANSPARENT=String(t["wms:transparent"])),typeof t.type=="string"&&t.type.startsWith("image/")&&(g.FORMAT=t.type);const f=await i(te.TileWMS,Object.assign({},n,{params:g}));s.push(new Sy(f))}break;case"wmts":const l=await GL(e);if(!l)return;const h=Array.isArray(t["wmts:layer"])?t["wmts:layer"]:[t["wmts:layer"]];for(const c of h){let u=Object.assign({},n,{layer:c});typeof t.type=="string"&&t.type.startsWith("image/")&&(u.format=t.type),u=await i(te.WMTS,u),s.push(new Ey(by(l,u)))}break;case"xyz":s.push(new ji(await i(te.XYZ,n)));break;default:return}return s.map(o=>{let a;return o instanceof Fh?a=new M_({source:o,declutter:!0}):o instanceof Dp?a=new zl({source:o}):a=new kl({source:o}),this.addLayer_(a,t),a})}async addGeoTiff_(t){if(!this.displayOverview_)return;if(this.buildTileUrlTemplate_&&!this.useTileLayerAsFallback_)return await this.addTileLayerForImagery_(t);let e={sources:[DL(t,this.bands_)]};const n=await kp(t);n&&(e.projection=n),this.getSourceOptions_&&(e=await this.getSourceOptions_(te.GeoTIFF,e,t));const i=async(s,o)=>(o&&this.getLayers().remove(o),await this.addTileLayerForImagery_(s));try{const s=new sg(e),o=new zl({source:s});if(this.useTileLayerAsFallback_){const a=()=>i(t,o);s.on("error",a),s.on("tileloaderror",a),s.on("change",()=>{s.getState()==="error"&&i(t,o)}),o.on("error",a),await s.getView()}return this.addLayer_(o,t),o}catch(s){if(this.useTileLayerAsFallback_)return await i(t,null);this.handleError_(s)}}async addTileLayerForImagery_(t){let e={crossOrigin:this.crossOrigin_,url:this.buildTileUrlTemplate_(t)};this.getSourceOptions_&&(e=await this.getSourceOptions_(te.XYZ,e,t));const n=new kl({source:new ji(e)});return this.addLayer_(n,t),n}addLayer_(t,e,n=0){t.set("stac",e),t.setZIndex(n),this.getLayers().push(t)}addFootprint_(){let t=null;const e=this.getData();if(e.isItemCollection()||e.isCollectionCollection()?t=Cy(e.getBoundingBox()):t=e.toGeoJSON(),t){const n=new Dm,i=new wh({format:n,loader:(o,a,l)=>{const h=n.readFeatures(t,{featureProjection:l});i.addFeatures(h)}}),s=new Ed({source:i,style:Gp(this.boundsStyle_,this),visible:this.displayFootprint_});return s.set("bounds",!0),this.addLayer_(s,e,1),s}return null}async updateLayers_(){const t=this.getLayers();for(let n=t.getLength()-1;n>=0;n--){const i=t.item(n).get("stac");i&&(i.isLink()||i.isAsset())&&t.removeAt(n)}const e=this.getData();e.isItemCollection()||e.isCollectionCollection()?await this.addApiCollection_():(e.isItem()||e.isCollection())&&await this.addStacAssets_(),this.displayWebMapLink_&&(Array.isArray(this.displayWebMapLink_)||this.hasOnlyBounds())&&await this.addWebMapLinks_()}hasOnlyBounds(){const t=this.getBoundsLayer();return typeof this.getLayersArray().find(e=>e!==t)>"u"}getWebMapLinks(){let t=["xyz","tilejson","pmtiles","wmts","wms"];typeof this.displayWebMapLink_=="string"&&(t=[this.displayWebMapLink_]);let e=this.data_.getLinksWithRels(t);return Array.isArray(this.displayWebMapLink_)?e=this.displayWebMapLink_.map(n=>typeof n=="string"?e.find(s=>s.id===n)||null:n).filter(n=>!!n):e.sort((n,i)=>{const s=t.indexOf(n.rel),o=t.indexOf(i.rel);return s-o}),e}async setAssets(t){Array.isArray(t)?this.assets_=t.map(e=>typeof e=="string"?this.getData().getAsset(e):e instanceof si?e:new si(e)):this.assets_=null,await this.updateLayers_()}getData(){return this.data_}getAssets(){return this.assets_}getExtent(){if(!this.boundsLayer_)return;const t=this.boundsLayer_.getMapInternal();if(!t)return;const e=t.getView();if(!e)return;const n=this.getData();if(!n)return;const i=n.getBoundingBox();if(i)return Cu(i,"EPSG:4326",e.getProjection())}}function jL(r){r("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),r("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),r("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),r.WGS84=r["EPSG:4326"],r["EPSG:3785"]=r["EPSG:3857"],r.GOOGLE=r["EPSG:3857"],r["EPSG:900913"]=r["EPSG:3857"],r["EPSG:102113"]=r["EPSG:3857"]}var zi=1,Ui=2,Is=3,zL=4,hu=5,jp=6378137,UL=6356752314e-3,zp=.0066943799901413165,No=484813681109536e-20,Y=Math.PI/2,BL=.16666666666666666,XL=.04722222222222222,WL=.022156084656084655,H=1e-10,Ce=.017453292519943295,Qr=57.29577951308232,Xt=Math.PI/4,oa=Math.PI*2,ce=3.14159265359,lr={};lr.greenwich=0;lr.lisbon=-9.131906111111;lr.paris=2.337229166667;lr.bogota=-74.080916666667;lr.madrid=-3.687938888889;lr.rome=12.452333333333;lr.bern=7.439583333333;lr.jakarta=106.807719444444;lr.ferro=-17.666666666667;lr.brussels=4.367975;lr.stockholm=18.058277777778;lr.athens=23.7163375;lr.oslo=10.722916666667;const qL={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var Up=/[\s_\-\/\(\)]/g;function ci(r,t){if(r[t])return r[t];for(var e=Object.keys(r),n=t.toLowerCase().replace(Up,""),i=-1,s,o;++i=this.text.length)return;r=this.text[this.place++]}switch(this.state){case aa:return this.neutral(r);case Xy:return this.keyword(r);case Wl:return this.quoted(r);case qy:return this.afterquote(r);case Wy:return this.number(r);case xg:return}};zn.prototype.afterquote=function(r){if(r==='"'){this.word+='"',this.state=Wl;return}if(kh.test(r)){this.word=this.word.trim(),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in afterquote yet, index '+this.place)};zn.prototype.afterItem=function(r){if(r===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=aa;return}if(r==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=aa,this.currentObject=this.stack.pop(),this.currentObject||(this.state=xg);return}};zn.prototype.number=function(r){if(Zy.test(r)){this.word+=r;return}if(kh.test(r)){this.word=parseFloat(this.word),this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in number yet, index '+this.place)};zn.prototype.quoted=function(r){if(r==='"'){this.state=qy;return}this.word+=r};zn.prototype.keyword=function(r){if($L.test(r)){this.word+=r;return}if(r==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=aa;return}if(kh.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in keyword yet, index '+this.place)};zn.prototype.neutral=function(r){if(YL.test(r)){this.word=r,this.state=Xy;return}if(r==='"'){this.word="",this.state=Wl;return}if(Zy.test(r)){this.word=r,this.state=Wy;return}if(kh.test(r)){this.afterItem(r);return}throw new Error(`havn't handled "`+r+'" in neutral yet, index '+this.place)};zn.prototype.output=function(){for(;this.place0?90:-90),r.lat_ts=r.lat1):!r.lat_ts&&r.lat0&&r.projName==="Polar_Stereographic"&&(r.lat_ts=r.lat0,r.lat0=Yr(r.lat0>0?90:-90))}function Yy(r){var t=VL(r),e=t.shift(),n=t.shift();t.unshift(["name",n]),t.unshift(["type",e]);var i={};return vs(t,i),JL(i),i}function Be(r){var t=this;if(arguments.length===2){var e=arguments[1];typeof e=="string"?e.charAt(0)==="+"?Be[r]=cu(arguments[1]):Be[r]=Yy(arguments[1]):Be[r]=e}else if(arguments.length===1){if(Array.isArray(r))return r.map(function(n){Array.isArray(n)?Be.apply(t,n):Be(n)});if(typeof r=="string"){if(r in Be)return Be[r]}else"EPSG"in r?Be["EPSG:"+r.EPSG]=r:"ESRI"in r?Be["ESRI:"+r.ESRI]=r:"IAU2000"in r?Be["IAU2000:"+r.IAU2000]=r:console.log(r);return}}jL(Be);function QL(r){return typeof r=="string"}function tO(r){return r in Be}var eO=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function rO(r){return eO.some(function(t){return r.indexOf(t)>-1})}var nO=["3857","900913","3785","102113"];function iO(r){var t=ci(r,"authority");if(t){var e=ci(t,"epsg");return e&&nO.indexOf(e)>-1}}function sO(r){var t=ci(r,"extension");if(t)return ci(t,"proj4")}function oO(r){return r[0]==="+"}function aO(r){if(QL(r)){if(tO(r))return Be[r];if(rO(r)){var t=Yy(r);if(iO(t))return Be["EPSG:3857"];var e=sO(t);return e?cu(e):t}if(oO(r))return cu(r)}else return r}function Xp(r,t){r=r||{};var e,n;if(!t)return r;for(n in t)e=t[n],e!==void 0&&(r[n]=e);return r}function an(r,t,e){var n=r*t;return e/Math.sqrt(1-n*n)}function La(r){return r<0?-1:1}function Q(r){return Math.abs(r)<=ce?r:r-La(r)*oa}function kr(r,t,e){var n=r*e,i=.5*r;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(Y-t))/n}function la(r,t){for(var e=.5*r,n,i,s=Y-2*Math.atan(t),o=0;o<=15;o++)if(n=r*Math.sin(s),i=Y-2*Math.atan(t*Math.pow((1-n)/(1+n),e))-s,s+=i,Math.abs(i)<=1e-10)return s;return-9999}function lO(){var r=this.b/this.a;this.es=1-r*r,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=an(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function hO(r){var t=r.x,e=r.y;if(e*Qr>90&&e*Qr<-90&&t*Qr>180&&t*Qr<-180)return null;var n,i;if(Math.abs(Math.abs(e)-Y)<=H)return null;if(this.sphere)n=this.x0+this.a*this.k0*Q(t-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(Xt+.5*e));else{var s=Math.sin(e),o=kr(this.e,e,s);n=this.x0+this.a*this.k0*Q(t-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return r.x=n,r.y=i,r}function cO(r){var t=r.x-this.x0,e=r.y-this.y0,n,i;if(this.sphere)i=Y-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var s=Math.exp(-e/(this.a*this.k0));if(i=la(this.e,s),i===-9999)return null}return n=Q(this.long0+t/(this.a*this.k0)),r.x=n,r.y=i,r}var uO=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const dO={init:lO,forward:hO,inverse:cO,names:uO};function gO(){}function Wp(r){return r}var fO=["longlat","identity"];const pO={init:gO,forward:Wp,inverse:Wp,names:fO};var mO=[dO,pO],hl={},ql=[];function $y(r,t){var e=ql.length;return r.names?(ql[e]=r,r.names.forEach(function(n){hl[n.toLowerCase()]=e}),this):(console.log(t),!0)}function _O(r){if(!r)return!1;var t=r.toLowerCase();if(typeof hl[t]<"u"&&ql[hl[t]])return ql[hl[t]]}function yO(){mO.forEach($y)}const xO={start:yO,add:$y,get:_O};var vt={};vt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};vt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};vt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};vt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};vt.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};vt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};vt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};vt.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};vt.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};vt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};vt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};vt.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};vt.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};vt.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};vt.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};vt.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};vt.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};vt.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};vt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};vt.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};vt.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};vt.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};vt.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};vt.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};vt.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};vt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};vt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};vt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};vt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};vt.hough={a:6378270,rf:297,ellipseName:"Hough"};vt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};vt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};vt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};vt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};vt.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};vt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};vt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};vt.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};vt.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};vt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};vt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};vt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var vO=vt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};vt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function wO(r,t,e,n){var i=r*r,s=t*t,o=(i-s)/i,a=0;n?(r*=1-o*(BL+o*(XL+o*WL)),i=r*r,o=0):a=Math.sqrt(o);var l=(i-s)/s;return{es:o,e:a,ep2:l}}function SO(r,t,e,n,i){if(!r){var s=ci(vt,n);s||(s=vO),r=s.a,t=s.b,e=s.rf}return e&&!t&&(t=(1-1/e)*r),(e===0||Math.abs(r-t)3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=Ui,a.datum_params[3]*=No,a.datum_params[4]*=No,a.datum_params[5]*=No,a.datum_params[6]=a.datum_params[6]/1e6+1)),o&&(a.datum_type=Is,a.grids=o),a.a=e,a.b=n,a.es=i,a.ep2=s,a}var Vy={};function bO(r,t){var e=new DataView(t),n=RO(e),i=CO(e,n),s=IO(e,i,n),o={header:i,subgrids:s};return Vy[r]=o,o}function TO(r){if(r===void 0)return null;var t=r.split(",");return t.map(MO)}function MO(r){if(r.length===0)return null;var t=r[0]==="@";return t&&(r=r.slice(1)),r==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:r,mandatory:!t,grid:Vy[r]||null,isNull:!1}}function ws(r){return r/3600*Math.PI/180}function RO(r){var t=r.getInt32(8,!1);return t===11?!1:(t=r.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function CO(r,t){return{nFields:r.getInt32(8,t),nSubgridFields:r.getInt32(24,t),nSubgrids:r.getInt32(40,t),shiftType:uu(r,56,64).trim(),fromSemiMajorAxis:r.getFloat64(120,t),fromSemiMinorAxis:r.getFloat64(136,t),toSemiMajorAxis:r.getFloat64(152,t),toSemiMinorAxis:r.getFloat64(168,t)}}function uu(r,t,e){return String.fromCharCode.apply(null,new Uint8Array(r.buffer.slice(t,e)))}function IO(r,t,e){for(var n=176,i=[],s=0;s5e-11?!1:r.datum_type===zi?r.datum_params[0]===t.datum_params[0]&&r.datum_params[1]===t.datum_params[1]&&r.datum_params[2]===t.datum_params[2]:r.datum_type===Ui?r.datum_params[0]===t.datum_params[0]&&r.datum_params[1]===t.datum_params[1]&&r.datum_params[2]===t.datum_params[2]&&r.datum_params[3]===t.datum_params[3]&&r.datum_params[4]===t.datum_params[4]&&r.datum_params[5]===t.datum_params[5]&&r.datum_params[6]===t.datum_params[6]:!0}function Hy(r,t,e){var n=r.x,i=r.y,s=r.z?r.z:0,o,a,l,h;if(i<-Y&&i>-1.001*Y)i=-Y;else if(i>Y&&i<1.001*Y)i=Y;else{if(i<-Y)return{x:-1/0,y:-1/0,z:r.z};if(i>Y)return{x:1/0,y:1/0,z:r.z}}return n>Math.PI&&(n-=2*Math.PI),a=Math.sin(i),h=Math.cos(i),l=a*a,o=e/Math.sqrt(1-t*l),{x:(o+s)*h*Math.cos(n),y:(o+s)*h*Math.sin(n),z:(o*(1-t)+s)*a}}function Ky(r,t,e,n){var i=1e-12,s=i*i,o=30,a,l,h,c,u,d,g,f,m,_,y,x,w,S=r.x,E=r.y,T=r.z?r.z:0,R,C,A;if(a=Math.sqrt(S*S+E*E),l=Math.sqrt(S*S+E*E+T*T),a/es&&wn.y||g>n.x||_a&&Math.abs(l.y)>a);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=Q(s.x+e.ll[0]),n.y=s.y+e.ll[1]}else isNaN(s.x)||(n.x=r.x+s.x,n.y=r.y+s.y);return n}function Zp(r,t){var e={x:r.x/t.del[0],y:r.y/t.del[1]},n={x:Math.floor(e.x),y:Math.floor(e.y)},i={x:e.x-1*n.x,y:e.y-1*n.y},s={x:Number.NaN,y:Number.NaN},o;if(n.x<0||n.x>=t.lim[0]||n.y<0||n.y>=t.lim[1])return s;o=n.y*t.lim[0]+n.x;var a={x:t.cvs[o][0],y:t.cvs[o][1]};o++;var l={x:t.cvs[o][0],y:t.cvs[o][1]};o+=t.lim[0];var h={x:t.cvs[o][0],y:t.cvs[o][1]};o--;var c={x:t.cvs[o][0],y:t.cvs[o][1]},u=i.x*i.y,d=i.x*(1-i.y),g=(1-i.x)*(1-i.y),f=(1-i.x)*i.y;return s.x=g*a.x+d*l.x+f*c.x+u*h.x,s.y=g*a.y+d*l.y+f*c.y+u*h.y,s}function Yp(r,t,e){var n=e.x,i=e.y,s=e.z||0,o,a,l,h={};for(l=0;l<3;l++)if(!(t&&l===2&&e.z===void 0))switch(l===0?(o=n,"ew".indexOf(r.axis[l])!==-1?a="x":a="y"):l===1?(o=i,"ns".indexOf(r.axis[l])!==-1?a="y":a="x"):(o=s,a="z"),r.axis[l]){case"e":h[a]=o;break;case"w":h[a]=-o;break;case"n":h[a]=o;break;case"s":h[a]=-o;break;case"u":e[a]!==void 0&&(h.z=o);break;case"d":e[a]!==void 0&&(h.z=-o);break;default:return null}return h}function Jy(r){var t={x:r[0],y:r[1]};return r.length>2&&(t.z=r[2]),r.length>3&&(t.m=r[3]),t}function GO(r){$p(r.x),$p(r.y)}function $p(r){if(typeof Number.isFinite=="function"){if(Number.isFinite(r))return;throw new TypeError("coordinates must be finite numbers")}if(typeof r!="number"||r!==r||!isFinite(r))throw new TypeError("coordinates must be finite numbers")}function jO(r,t){return(r.datum.datum_type===zi||r.datum.datum_type===Ui||r.datum.datum_type===Is)&&t.datumCode!=="WGS84"||(t.datum.datum_type===zi||t.datum.datum_type===Ui||t.datum.datum_type===Is)&&r.datumCode!=="WGS84"}function Zl(r,t,e,n){var i;Array.isArray(e)?e=Jy(e):e={x:e.x,y:e.y,z:e.z,m:e.m};var s=e.z!==void 0;if(GO(e),r.datum&&t.datum&&jO(r,t)&&(i=new rn("WGS84"),e=Zl(r,i,e,n),r=i),n&&r.axis!=="enu"&&(e=Yp(r,!1,e)),r.projName==="longlat")e={x:e.x*Ce,y:e.y*Ce,z:e.z||0};else if(r.to_meter&&(e={x:e.x*r.to_meter,y:e.y*r.to_meter,z:e.z||0}),e=r.inverse(e),!e)return;if(r.from_greenwich&&(e.x+=r.from_greenwich),e=DO(r.datum,t.datum,e),!!e)return t.from_greenwich&&(e={x:e.x-t.from_greenwich,y:e.y,z:e.z||0}),t.projName==="longlat"?e={x:e.x*Qr,y:e.y*Qr,z:e.z||0}:(e=t.forward(e),t.to_meter&&(e={x:e.x/t.to_meter,y:e.y/t.to_meter,z:e.z||0})),n&&t.axis!=="enu"?Yp(t,!0,e):(e&&!s&&delete e.z,e)}var Vp=rn("WGS84");function Ec(r,t,e,n){var i,s,o;return Array.isArray(e)?(i=Zl(r,t,e,n)||{x:NaN,y:NaN},e.length>2?typeof r.name<"u"&&r.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof i.z=="number"?[i.x,i.y,i.z].concat(e.splice(3)):[i.x,i.y,e[2]].concat(e.splice(3)):[i.x,i.y].concat(e.splice(2)):[i.x,i.y]):(s=Zl(r,t,e,n),o=Object.keys(e),o.length===2||o.forEach(function(a){if(typeof r.name<"u"&&r.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;s[a]=e[a]}),s)}function Hp(r){return r instanceof rn?r:r.oProj?r.oProj:rn(r)}function fr(r,t,e){r=Hp(r);var n=!1,i;return typeof t>"u"?(t=r,r=Vp,n=!0):(typeof t.x<"u"||Array.isArray(t))&&(e=t,t=r,r=Vp,n=!0),t=Hp(t),e?Ec(r,t,e):(i={forward:function(s,o){return Ec(r,t,s,o)},inverse:function(s,o){return Ec(t,r,s,o)}},n&&(i.oProj=t),i)}var Kp=6,Qy="AJSAJS",t1="AFAFAF",Ss=65,Ke=73,vr=79,Eo=86,bo=90;const zO={forward:e1,inverse:UO,toPoint:r1};function e1(r,t){return t=t||5,WO(BO({lat:r[1],lon:r[0]}),t)}function UO(r){var t=vg(i1(r.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function r1(r){var t=vg(i1(r.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function bc(r){return r*(Math.PI/180)}function Jp(r){return 180*(r/Math.PI)}function BO(r){var t=r.lat,e=r.lon,n=6378137,i=.00669438,s=.9996,o,a,l,h,c,u,d,g=bc(t),f=bc(e),m,_;_=Math.floor((e+180)/6)+1,e===180&&(_=60),t>=56&&t<64&&e>=3&&e<12&&(_=32),t>=72&&t<84&&(e>=0&&e<9?_=31:e>=9&&e<21?_=33:e>=21&&e<33?_=35:e>=33&&e<42&&(_=37)),o=(_-1)*6-180+3,m=bc(o),a=i/(1-i),l=n/Math.sqrt(1-i*Math.sin(g)*Math.sin(g)),h=Math.tan(g)*Math.tan(g),c=a*Math.cos(g)*Math.cos(g),u=Math.cos(g)*(f-m),d=n*((1-i/4-3*i*i/64-5*i*i*i/256)*g-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*g)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*g)-35*i*i*i/3072*Math.sin(6*g));var y=s*l*(u+(1-h+c)*u*u*u/6+(5-18*h+h*h+72*c-58*a)*u*u*u*u*u/120)+5e5,x=s*(d+l*Math.tan(g)*(u*u/2+(5-h+9*c+4*c*c)*u*u*u*u/24+(61-58*h+h*h+600*c-330*a)*u*u*u*u*u*u/720));return t<0&&(x+=1e7),{northing:Math.round(x),easting:Math.round(y),zoneNumber:_,zoneLetter:XO(t)}}function vg(r){var t=r.northing,e=r.easting,n=r.zoneLetter,i=r.zoneNumber;if(i<0||i>60)return null;var s=.9996,o=6378137,a=.00669438,l,h=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),c,u,d,g,f,m,_,y,x,w=e-5e5,S=t;n<"N"&&(S-=1e7),_=(i-1)*6-180+3,l=a/(1-a),m=S/s,y=m/(o*(1-a/4-3*a*a/64-5*a*a*a/256)),x=y+(3*h/2-27*h*h*h/32)*Math.sin(2*y)+(21*h*h/16-55*h*h*h*h/32)*Math.sin(4*y)+151*h*h*h/96*Math.sin(6*y),c=o/Math.sqrt(1-a*Math.sin(x)*Math.sin(x)),u=Math.tan(x)*Math.tan(x),d=l*Math.cos(x)*Math.cos(x),g=o*(1-a)/Math.pow(1-a*Math.sin(x)*Math.sin(x),1.5),f=w/(c*s);var E=x-c*Math.tan(x)/g*(f*f/2-(5+3*u+10*d-4*d*d-9*l)*f*f*f*f/24+(61+90*u+298*d+45*u*u-252*l-3*d*d)*f*f*f*f*f*f/720);E=Jp(E);var T=(f-(1+2*u+d)*f*f*f/6+(5-2*d+28*u-3*d*d+8*l+24*u*u)*f*f*f*f*f/120)/Math.cos(x);T=_+Jp(T);var R;if(r.accuracy){var C=vg({northing:r.northing+r.accuracy,easting:r.easting+r.accuracy,zoneLetter:r.zoneLetter,zoneNumber:r.zoneNumber});R={top:C.lat,right:C.lon,bottom:E,left:T}}else R={lat:E,lon:T};return R}function XO(r){var t="Z";return 84>=r&&r>=72?t="X":72>r&&r>=64?t="W":64>r&&r>=56?t="V":56>r&&r>=48?t="U":48>r&&r>=40?t="T":40>r&&r>=32?t="S":32>r&&r>=24?t="R":24>r&&r>=16?t="Q":16>r&&r>=8?t="P":8>r&&r>=0?t="N":0>r&&r>=-8?t="M":-8>r&&r>=-16?t="L":-16>r&&r>=-24?t="K":-24>r&&r>=-32?t="J":-32>r&&r>=-40?t="H":-40>r&&r>=-48?t="G":-48>r&&r>=-56?t="F":-56>r&&r>=-64?t="E":-64>r&&r>=-72?t="D":-72>r&&r>=-80&&(t="C"),t}function WO(r,t){var e="00000"+r.easting,n="00000"+r.northing;return r.zoneNumber+r.zoneLetter+qO(r.easting,r.northing,r.zoneNumber)+e.substr(e.length-5,t)+n.substr(n.length-5,t)}function qO(r,t,e){var n=n1(e),i=Math.floor(r/1e5),s=Math.floor(t/1e5)%20;return ZO(i,s,n)}function n1(r){var t=r%Kp;return t===0&&(t=Kp),t}function ZO(r,t,e){var n=e-1,i=Qy.charCodeAt(n),s=t1.charCodeAt(n),o=i+r-1,a=s+t,l=!1;o>bo&&(o=o-bo+Ss-1,l=!0),(o===Ke||iKe||(o>Ke||ivr||(o>vr||ibo&&(o=o-bo+Ss-1),a>Eo?(a=a-Eo+Ss-1,l=!0):l=!1,(a===Ke||sKe||(a>Ke||svr||(a>vr||sEo&&(a=a-Eo+Ss-1);var h=String.fromCharCode(o)+String.fromCharCode(a);return h}function i1(r){if(r&&r.length===0)throw"MGRSPoint coverting from nothing";for(var t=r.length,e=null,n="",i,s=0;!/[A-Z]/.test(i=r.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+r;n+=i,s++}var o=parseInt(n,10);if(s===0||s+3>t)throw"MGRSPoint bad conversion from: "+r;var a=r.charAt(s++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+r;e=r.substring(s,s+=2);for(var l=n1(o),h=YO(e.charAt(0),l),c=$O(e.charAt(1),l);c0&&(m=1e5/Math.pow(10,d),_=r.substring(s,s+d),g=parseFloat(_)*m,y=r.substring(s+d),f=parseFloat(y)*m),x=g+h,w=f+c,{easting:x,northing:w,zoneLetter:a,zoneNumber:o,accuracy:m}}function YO(r,t){for(var e=Qy.charCodeAt(t-1),n=1e5,i=!1;e!==r.charCodeAt(0);){if(e++,e===Ke&&e++,e===vr&&e++,e>bo){if(i)throw"Bad character: "+r;e=Ss,i=!0}n+=1e5}return n}function $O(r,t){if(r>"V")throw"MGRSPoint given invalid Northing "+r;for(var e=t1.charCodeAt(t-1),n=0,i=!1;e!==r.charCodeAt(0);){if(e++,e===Ke&&e++,e===vr&&e++,e>Eo){if(i)throw"Bad character: "+r;e=Ss,i=!0}n+=1e5}return n}function VO(r){var t;switch(r){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+r}function Xs(r,t,e){if(!(this instanceof Xs))return new Xs(r,t,e);if(Array.isArray(r))this.x=r[0],this.y=r[1],this.z=r[2]||0;else if(typeof r=="object")this.x=r.x,this.y=r.y,this.z=r.z||0;else if(typeof r=="string"&&typeof t>"u"){var n=r.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=r,this.y=t,this.z=e||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Xs.fromMGRS=function(r){return new Xs(r1(r))};Xs.prototype.toMGRS=function(r){return e1([this.x,this.y],r)};var HO=1,KO=.25,Qp=.046875,tm=.01953125,em=.01068115234375,JO=.75,QO=.46875,tF=.013020833333333334,eF=.007120768229166667,rF=.3645833333333333,nF=.005696614583333333,iF=.3076171875;function s1(r){var t=[];t[0]=HO-r*(KO+r*(Qp+r*(tm+r*em))),t[1]=r*(JO-r*(Qp+r*(tm+r*em)));var e=r*r;return t[2]=e*(QO-r*(tF+r*eF)),e*=r,t[3]=e*(rF-r*nF),t[4]=e*r*iF,t}function Gh(r,t,e,n){return e*=t,t*=t,n[0]*r-e*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var sF=20;function o1(r,t,e){for(var n=1/(1-t),i=r,s=sF;s;--s){var o=Math.sin(i),a=1-t*o*o;if(a=(Gh(i,o,Math.cos(i),e)-r)*(a*Math.sqrt(a))*n,i-=a,Math.abs(a)H?Math.tan(e):0,f=Math.pow(g,2),m=Math.pow(f,2);i=1-this.es*Math.pow(a,2),h=h/Math.sqrt(i);var _=Gh(e,a,l,this.en);s=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+m+14*u-58*f*u+c/42*(61+179*m-m*f-479*f)))))+this.x0,o=this.a*(this.k0*(_-this.ml0+a*n*h/2*(1+c/12*(5-f+9*u+4*d+c/30*(61+m-58*f+270*u-330*f*u+c/56*(1385+543*m-m*f-3111*f))))))+this.y0}else{var y=l*Math.sin(n);if(Math.abs(Math.abs(y)-1)=1){if(y-1>H)return 93;o=0}else o=Math.acos(o);e<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return r.x=s,r.y=o,r}function lF(r){var t,e,n,i,s=(r.x-this.x0)*(1/this.a),o=(r.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,e=o1(t,this.es,this.en),Math.abs(e)H?Math.tan(e):0,c=this.ep2*Math.pow(l,2),u=Math.pow(c,2),d=Math.pow(h,2),g=Math.pow(d,2);t=1-this.es*Math.pow(a,2);var f=s*Math.sqrt(t)/this.k0,m=Math.pow(f,2);t=t*h,n=e-t*m/(1-this.es)*.5*(1-m/12*(5+3*d-9*c*d+c-4*u-m/30*(61+90*d-252*c*d+45*g+46*c-m/56*(1385+3633*d+4095*g+1574*g*d)))),i=Q(this.long0+f*(1-m/6*(1+2*d+c-m/20*(5+28*d+24*g+8*c*d+6*c-m/42*(61+662*d+1320*g+720*g*d))))/l)}else n=Y*La(o),i=0;else{var _=Math.exp(s/this.k0),y=.5*(_-1/_),x=this.lat0+o/this.k0,w=Math.cos(x);t=Math.sqrt((1-Math.pow(w,2))/(1+Math.pow(y,2))),n=Math.asin(t),o<0&&(n=-n),y===0&&w===0?i=0:i=Q(Math.atan2(y,w)+this.long0)}return r.x=i,r.y=n,r}var hF=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const cl={init:oF,forward:aF,inverse:lF,names:hF};function a1(r){var t=Math.exp(r);return t=(t-1/t)/2,t}function wr(r,t){r=Math.abs(r),t=Math.abs(t);var e=Math.max(r,t),n=Math.min(r,t)/(e||1);return e*Math.sqrt(1+Math.pow(n,2))}function cF(r){var t=1+r,e=t-1;return e===0?r:r*Math.log(t)/e}function uF(r){var t=Math.abs(r);return t=cF(t*(1+t/(wr(1,t)+1))),r<0?-t:t}function wg(r,t){for(var e=2*Math.cos(2*t),n=r.length-1,i=r[n],s=0,o;--n>=0;)o=-s+e*i+r[n],s=i,i=o;return t+o*Math.sin(2*t)}function dF(r,t){for(var e=2*Math.cos(t),n=r.length-1,i=r[n],s=0,o;--n>=0;)o=-s+e*i+r[n],s=i,i=o;return Math.sin(t)*o}function gF(r){var t=Math.exp(r);return t=(t+1/t)/2,t}function l1(r,t,e){for(var n=Math.sin(t),i=Math.cos(t),s=a1(e),o=gF(e),a=2*i*o,l=-2*n*s,h=r.length-1,c=r[h],u=0,d=0,g=0,f,m;--h>=0;)f=d,m=u,d=c,u=g,c=-f+a*d-l*u+r[h],g=-m+l*d+a*u;return a=n*o,l=i*s,[a*c-l*g,a*g+l*c]}function fF(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(cl.init.apply(this),this.forward=cl.forward,this.inverse=cl.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var r=this.es/(1+Math.sqrt(1-this.es)),t=r/(2-r),e=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),e=e*t,this.cgb[1]=e*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=e*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),e=e*t,this.cgb[2]=e*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=e*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),e=e*t,this.cgb[3]=e*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=e*(1237/630+t*(-12/5+t*(-24832/14175))),e=e*t,this.cgb[4]=e*(4174/315+t*(-144838/6237)),this.cbg[4]=e*(-734/315+t*(109598/31185)),e=e*t,this.cgb[5]=e*(601676/22275),this.cbg[5]=e*(444337/155925),e=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+e*(1/4+e*(1/64+e/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=e*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=e*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),e=e*t,this.utg[2]=e*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=e*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),e=e*t,this.utg[3]=e*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=e*(49561/161280+t*(-179/168+t*(6601661/7257600))),e=e*t,this.utg[4]=e*(-4583/161280+t*(108847/3991680)),this.gtu[4]=e*(34729/80640+t*(-3418889/1995840)),e=e*t,this.utg[5]=e*(-20648693/638668800),this.gtu[5]=e*(212378941/319334400);var n=wg(this.cbg,this.lat0);this.Zb=-this.Qn*(n+dF(this.gtu,2*n))}function pF(r){var t=Q(r.x-this.long0),e=r.y;e=wg(this.cbg,e);var n=Math.sin(e),i=Math.cos(e),s=Math.sin(t),o=Math.cos(t);e=Math.atan2(n,o*i),t=Math.atan2(s*i,wr(n,i*o)),t=uF(Math.tan(t));var a=l1(this.gtu,2*e,2*t);e=e+a[0],t=t+a[1];var l,h;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,h=this.a*(this.Qn*e+this.Zb)+this.y0):(l=1/0,h=1/0),r.x=l,r.y=h,r}function mF(r){var t=(r.x-this.x0)*(1/this.a),e=(r.y-this.y0)*(1/this.a);e=(e-this.Zb)/this.Qn,t=t/this.Qn;var n,i;if(Math.abs(t)<=2.623395162778){var s=l1(this.utg,2*e,2*t);e=e+s[0],t=t+s[1],t=Math.atan(a1(t));var o=Math.sin(e),a=Math.cos(e),l=Math.sin(t),h=Math.cos(t);e=Math.atan2(o*h,wr(l,h*a)),t=Math.atan2(l,h*a),n=Q(t+this.long0),i=wg(this.cgb,e)}else n=1/0,i=1/0;return r.x=n,r.y=i,r}var _F=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const ul={init:fF,forward:pF,inverse:mF,names:_F};function yF(r,t){if(r===void 0){if(r=Math.floor((Q(t)+Math.PI)*30/Math.PI)+1,r<0)return 0;if(r>60)return 60}return r}var xF="etmerc";function vF(){var r=yF(this.zone,this.long0);if(r===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(r)-183)*Ce,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ul.init.apply(this),this.forward=ul.forward,this.inverse=ul.inverse}var wF=["Universal Transverse Mercator System","utm"];const SF={init:vF,names:wF,dependsOn:xF};function Sg(r,t){return Math.pow((1-r)/(1+r),t)}var EF=20;function bF(){var r=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*r*r),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(r/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Xt)/(Math.pow(Math.tan(.5*this.lat0+Xt),this.C)*Sg(this.e*r,this.ratexp))}function TF(r){var t=r.x,e=r.y;return r.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*e+Xt),this.C)*Sg(this.e*Math.sin(e),this.ratexp))-Y,r.x=this.C*t,r}function MF(r){for(var t=1e-14,e=r.x/this.C,n=r.y,i=Math.pow(Math.tan(.5*n+Xt)/this.K,1/this.C),s=EF;s>0&&(n=2*Math.atan(i*Sg(this.e*Math.sin(r.y),-.5*this.e))-Y,!(Math.abs(n-r.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=H&&Math.abs(Math.cos(this.lat_ts))>H&&(this.k0=.5*this.cons*an(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/kr(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=an(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Y,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function NF(r){var t=r.x,e=r.y,n=Math.sin(e),i=Math.cos(e),s,o,a,l,h,c,u=Q(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=H&&Math.abs(e+this.lat0)<=H?(r.x=NaN,r.y=NaN,r):this.sphere?(s=2*this.k0/(1+this.sinlat0*n+this.coslat0*i*Math.cos(u)),r.x=this.a*s*i*Math.sin(u)+this.x0,r.y=this.a*s*(this.coslat0*n-this.sinlat0*i*Math.cos(u))+this.y0,r):(o=2*Math.atan(this.ssfn_(e,n,this.e))-Y,l=Math.cos(o),a=Math.sin(o),Math.abs(this.coslat0)<=H?(h=kr(this.e,e*this.con,this.con*n),c=2*this.a*this.k0*h/this.cons,r.x=this.x0+c*Math.sin(t-this.long0),r.y=this.y0-this.con*c*Math.cos(t-this.long0),r):(Math.abs(this.sinlat0)0?t=Q(this.long0+Math.atan2(r.x,-1*r.y)):t=Q(this.long0+Math.atan2(r.x,r.y)):t=Q(this.long0+Math.atan2(r.x*Math.sin(a),o*this.coslat0*Math.cos(a)-r.y*this.sinlat0*Math.sin(a))),r.x=t,r.y=e,r)}else if(Math.abs(this.coslat0)<=H){if(o<=H)return e=this.lat0,t=this.long0,r.x=t,r.y=e,r;r.x*=this.con,r.y*=this.con,n=o*this.cons/(2*this.a*this.k0),e=this.con*la(this.e,n),t=this.con*Q(this.con*this.long0+Math.atan2(r.x,-1*r.y))}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=H?s=this.X0:(s=Math.asin(Math.cos(i)*this.sinX0+r.y*Math.sin(i)*this.cosX0/o),t=Q(this.long0+Math.atan2(r.x*Math.sin(i),o*this.cosX0*Math.cos(i)-r.y*this.sinX0*Math.sin(i)))),e=-1*la(this.e,Math.tan(.5*(Y+s)));return r.x=t,r.y=e,r}var kF=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const GF={init:FF,forward:NF,inverse:DF,names:kF,ssfn_:OF};function jF(){var r=this.lat0;this.lambda0=this.long0;var t=Math.sin(r),e=this.a,n=this.rf,i=1/n,s=2*i-Math.pow(i,2),o=this.e=Math.sqrt(s);this.R=this.k0*e*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(r),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+r/2)),h=Math.log((1+o*t)/(1-o*t));this.K=a-this.alpha*l+this.alpha*o/2*h}function zF(r){var t=Math.log(Math.tan(Math.PI/4-r.y/2)),e=this.e/2*Math.log((1+this.e*Math.sin(r.y))/(1-this.e*Math.sin(r.y))),n=-this.alpha*(t+e)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),s=this.alpha*(r.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(s));return r.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,r.x=this.R*o+this.x0,r}function UF(r){for(var t=r.x-this.x0,e=r.y-this.y0,n=t/this.R,i=2*(Math.atan(Math.exp(e/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+o/this.alpha,l=0,h=s,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return r.x=a,r.y=h,r}var BF=["somerc"];const XF={init:jF,forward:zF,inverse:UF,names:BF};var fs=1e-7;function WF(r){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],e=typeof r.PROJECTION=="object"?Object.keys(r.PROJECTION)[0]:r.PROJECTION;return"no_uoff"in r||"no_off"in r||t.indexOf(e)!==-1}function qF(){var r,t,e,n,i,s,o,a,l,h,c=0,u,d=0,g=0,f=0,m=0,_=0,y=0;this.no_off=WF(this),this.no_rot="no_rot"in this;var x=!1;"alpha"in this&&(x=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),x&&(y=this.alpha),w&&(c=this.rectified_grid_angle*Ce),x||w)d=this.longc;else if(g=this.long1,m=this.lat1,f=this.long2,_=this.lat2,Math.abs(m-_)<=fs||(r=Math.abs(m))<=fs||Math.abs(r-Y)<=fs||Math.abs(Math.abs(this.lat0)-Y)<=fs||Math.abs(Math.abs(_)-Y)<=fs)throw new Error;var S=1-this.es;t=Math.sqrt(S),Math.abs(this.lat0)>H?(a=Math.sin(this.lat0),e=Math.cos(this.lat0),r=1-this.es*a*a,this.B=e*e,this.B=Math.sqrt(1+this.es*this.B*this.B/S),this.A=this.B*this.k0*t/r,n=this.B*t/(e*Math.sqrt(r)),i=n*n-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(kr(this.e,this.lat0,a),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=i=1),x||w?(x?(u=Math.asin(Math.sin(y)/n),w||(c=y)):(u=c,y=Math.asin(n*Math.sin(u))),this.lam0=d-Math.asin(.5*(i-1/i)*Math.tan(u))/this.B):(s=Math.pow(kr(this.e,m,Math.sin(m)),this.B),o=Math.pow(kr(this.e,_,Math.sin(_)),this.B),i=this.E/s,l=(o-s)/(o+s),h=this.E*this.E,h=(h-o*s)/(h+o*s),r=g-f,r<-Math.pi?f-=oa:r>Math.pi&&(f+=oa),this.lam0=Q(.5*(g+f)-Math.atan(h*Math.tan(.5*this.B*(g-f))/l)/this.B),u=Math.atan(2*Math.sin(this.B*Q(g-this.lam0))/(i-1/i)),c=y=Math.asin(n*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(y))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(Xt-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(Xt+i))}function ZF(r){var t={},e,n,i,s,o,a,l,h;if(r.x=r.x-this.lam0,Math.abs(Math.abs(r.y)-Y)>H){if(o=this.E/Math.pow(kr(this.e,r.y,Math.sin(r.y)),this.B),a=1/o,e=.5*(o-a),n=.5*(o+a),s=Math.sin(this.B*r.x),i=(e*this.singam-s*this.cosgam)/n,Math.abs(Math.abs(i)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*r.y;return this.no_rot?(t.x=l,t.y=h):(l-=this.u_0,t.x=h*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-h*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function YF(r){var t,e,n,i,s,o,a,l={};if(r.x=(r.x-this.x0)*(1/this.a),r.y=(r.y-this.y0)*(1/this.a),this.no_rot?(e=r.y,t=r.x):(e=r.x*this.cosrot-r.y*this.sinrot,t=r.y*this.cosrot+r.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*e),i=.5*(n-1/n),s=.5*(n+1/n),o=Math.sin(this.BrA*t),a=(o*this.cosgam+i*this.singam)/s,Math.abs(Math.abs(a)-1)H?this.ns=Math.log(n/a)/Math.log(i/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function KF(r){var t=r.x,e=r.y;Math.abs(2*Math.abs(e)-Math.PI)<=H&&(e=La(e)*(Y-2*H));var n=Math.abs(Math.abs(e)-Y),i,s;if(n>H)i=kr(this.e,e,Math.sin(e)),s=this.a*this.f0*Math.pow(i,this.ns);else{if(n=e*this.ns,n<=0)return null;s=0}var o=this.ns*Q(t-this.long0);return r.x=this.k0*(s*Math.sin(o))+this.x0,r.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,r}function JF(r){var t,e,n,i,s,o=(r.x-this.x0)/this.k0,a=this.rh-(r.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+a*a),e=1):(t=-Math.sqrt(o*o+a*a),e=-1);var l=0;if(t!==0&&(l=Math.atan2(e*o,e*a)),t!==0||this.ns>0){if(e=1/this.ns,n=Math.pow(t/(this.a*this.f0),e),i=la(this.e,n),i===-9999)return null}else i=-Y;return s=Q(l/this.ns+this.long0),r.x=s,r.y=i,r}var QF=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const t3={init:HF,forward:KF,inverse:JF,names:QF};function e3(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function r3(r){var t,e,n,i,s,o,a,l=r.x,h=r.y,c=Q(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),n=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(n)),s=Math.asin(Math.cos(e)*Math.sin(n)/Math.cos(i)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),r.y=a*Math.cos(o)/1,r.x=a*Math.sin(o)/1,this.czech||(r.y*=-1,r.x*=-1),r}function n3(r){var t,e,n,i,s,o,a,l,h=r.x;r.x=r.y,r.y=h,this.czech||(r.y*=-1,r.x*=-1),o=Math.sqrt(r.x*r.x+r.y*r.y),s=Math.atan2(r.y,r.x),i=s/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),e=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(t)),r.x=this.long0-e/this.alfa,a=t,l=0;var c=0;do r.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-r.y)<1e-10&&(l=1),a=r.y,c+=1;while(l===0&&c<15);return c>=15?null:r}var i3=["Krovak","krovak"];const s3={init:e3,forward:r3,inverse:n3,names:i3};function qe(r,t,e,n,i){return r*i-t*Math.sin(2*i)+e*Math.sin(4*i)-n*Math.sin(6*i)}function Oa(r){return 1-.25*r*(1+r/16*(3+1.25*r))}function Fa(r){return .375*r*(1+.25*r*(1+.46875*r))}function Na(r){return .05859375*r*r*(1+.75*r)}function Da(r){return r*r*r*(35/3072)}function Ws(r,t,e){var n=t*e;return r/Math.sqrt(1-n*n)}function io(r){return Math.abs(r)1e-7?(e=r*t,(1-r*r)*(t/(1-e*e)-.5/r*Math.log((1-e)/(1+e)))):2*t}var u3=1,d3=2,g3=3,f3=4;function p3(){var r=Math.abs(this.lat0);if(Math.abs(r-Y)0){var t;switch(this.qp=oi(this.e,1),this.mmf=.5/(1-this.es),this.apa=b3(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=oi(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function m3(r){var t,e,n,i,s,o,a,l,h,c,u=r.x,d=r.y;if(u=Q(u-this.long0),this.sphere){if(s=Math.sin(d),c=Math.cos(d),n=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e=this.mode===this.EQUIT?1+c*n:1+this.sinph0*s+this.cosph0*c*n,e<=H)return null;e=Math.sqrt(2/e),t=e*c*Math.sin(u),e*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*c*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(d+this.lat0)=0?(t=(h=Math.sqrt(o))*i,e=n*(this.mode===this.S_POLE?h:-h)):t=e=0;break}}return r.x=this.a*t+this.x0,r.y=this.a*e+this.y0,r}function _3(r){r.x-=this.x0,r.y-=this.y0;var t=r.x/this.a,e=r.y/this.a,n,i,s,o,a,l,h;if(this.sphere){var c=0,u,d=0;if(u=Math.sqrt(t*t+e*e),i=u*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(d=Math.sin(i),c=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(u)<=H?0:Math.asin(e*d/u),t*=d,e=c*u;break;case this.OBLIQ:i=Math.abs(u)<=H?this.lat0:Math.asin(c*this.sinph0+e*d*this.cosph0/u),t*=d*this.cosph0,e=(c-Math.sin(i)*this.sinph0)*u;break;case this.N_POLE:e=-e,i=Y-i;break;case this.S_POLE:i-=Y;break}n=e===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,e)}else{if(h=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,e*=this.dd,l=Math.sqrt(t*t+e*e),l1&&(r=r>1?1:-1),Math.asin(r)}function C3(){Math.abs(this.lat1+this.lat2)H?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function I3(r){var t=r.x,e=r.y;this.sin_phi=Math.sin(e),this.cos_phi=Math.cos(e);var n=oi(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,s=this.ns0*Q(t-this.long0),o=i*Math.sin(s)+this.x0,a=this.rh-i*Math.cos(s)+this.y0;return r.x=o,r.y=a,r}function P3(r){var t,e,n,i,s,o;return r.x-=this.x0,r.y=this.rh-r.y+this.y0,this.ns0>=0?(t=Math.sqrt(r.x*r.x+r.y*r.y),n=1):(t=-Math.sqrt(r.x*r.x+r.y*r.y),n=-1),i=0,t!==0&&(i=Math.atan2(n*r.x,n*r.y)),n=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(e=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,e)),s=Q(i/this.ns0+this.long0),r.x=s,r.y=o,r}function A3(r,t){var e,n,i,s,o,a=ui(.5*t);if(r0||Math.abs(o)<=H?(a=this.x0+this.a*s*e*Math.sin(n)/o,l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*i)/o):(a=this.x0+this.infinity_dist*e*Math.sin(n),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*e*i)),r.x=a,r.y=l,r}function D3(r){var t,e,n,i,s,o;return r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,r.x/=this.k0,r.y/=this.k0,(t=Math.sqrt(r.x*r.x+r.y*r.y))?(i=Math.atan2(t,this.rc),e=Math.sin(i),n=Math.cos(i),o=ui(n*this.sin_p14+r.y*e*this.cos_p14/t),s=Math.atan2(r.x*e,t*this.cos_p14*n-r.y*this.sin_p14*e),s=Q(this.long0+s)):(o=this.phic0,s=0),r.x=s,r.y=o,r}var k3=["gnom"];const G3={init:F3,forward:N3,inverse:D3,names:k3};function j3(r,t){var e=1-(1-r*r)/(2*r)*Math.log((1-r)/(1+r));if(Math.abs(Math.abs(t)-e)<1e-6)return t<0?-1*Y:Y;for(var n=Math.asin(.5*t),i,s,o,a,l=0;l<30;l++)if(s=Math.sin(n),o=Math.cos(n),a=r*s,i=Math.pow(1-a*a,2)/(2*o)*(t/(1-r*r)-s/(1-a*a)+.5/r*Math.log((1-a)/(1+a))),n+=i,Math.abs(i)<=1e-10)return n;return NaN}function z3(){this.sphere||(this.k0=an(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function U3(r){var t=r.x,e=r.y,n,i,s=Q(t-this.long0);if(this.sphere)n=this.x0+this.a*s*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var o=oi(this.e,Math.sin(e));n=this.x0+this.a*this.k0*s,i=this.y0+this.a*o*.5/this.k0}return r.x=n,r.y=i,r}function B3(r){r.x-=this.x0,r.y-=this.y0;var t,e;return this.sphere?(t=Q(this.long0+r.x/this.a/Math.cos(this.lat_ts)),e=Math.asin(r.y/this.a*Math.cos(this.lat_ts))):(e=j3(this.e,2*r.y*this.k0/this.a),t=Q(this.long0+r.x/(this.a*this.k0))),r.x=t,r.y=e,r}var X3=["cea"];const W3={init:z3,forward:U3,inverse:B3,names:X3};function q3(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Z3(r){var t=r.x,e=r.y,n=Q(t-this.long0),i=io(e-this.lat0);return r.x=this.x0+this.a*n*this.rc,r.y=this.y0+this.a*i,r}function Y3(r){var t=r.x,e=r.y;return r.x=Q(this.long0+(t-this.x0)/(this.a*this.rc)),r.y=io(this.lat0+(e-this.y0)/this.a),r}var $3=["Equirectangular","Equidistant_Cylindrical","eqc"];const V3={init:q3,forward:Z3,inverse:Y3,names:$3};var rm=20;function H3(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Oa(this.es),this.e1=Fa(this.es),this.e2=Na(this.es),this.e3=Da(this.es),this.ml0=this.a*qe(this.e0,this.e1,this.e2,this.e3,this.lat0)}function K3(r){var t=r.x,e=r.y,n,i,s,o=Q(t-this.long0);if(s=o*Math.sin(e),this.sphere)Math.abs(e)<=H?(n=this.a*o,i=-1*this.a*this.lat0):(n=this.a*Math.sin(s)/Math.tan(e),i=this.a*(io(e-this.lat0)+(1-Math.cos(s))/Math.tan(e)));else if(Math.abs(e)<=H)n=this.a*o,i=-1*this.ml0;else{var a=Ws(this.a,this.e,Math.sin(e))/Math.tan(e);n=a*Math.sin(s),i=this.a*qe(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+a*(1-Math.cos(s))}return r.x=n+this.x0,r.y=i+this.y0,r}function J3(r){var t,e,n,i,s,o,a,l,h;if(n=r.x-this.x0,i=r.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=H)t=Q(n/this.a+this.long0),e=0;else{o=this.lat0+i/this.a,a=n*n/this.a/this.a+o*o,l=o;var c;for(s=rm;s;--s)if(c=Math.tan(l),h=-1*(o*(l*c+1)-l-.5*(l*l+a)*c)/((l-o)/c-1),l+=h,Math.abs(h)<=H){e=l;break}t=Q(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(e))}else if(Math.abs(i+this.ml0)<=H)e=0,t=Q(this.long0+n/this.a);else{o=(this.ml0+i)/this.a,a=n*n/this.a/this.a+o*o,l=o;var u,d,g,f,m;for(s=rm;s;--s)if(m=this.e*Math.sin(l),u=Math.sqrt(1-m*m)*Math.tan(l),d=this.a*qe(this.e0,this.e1,this.e2,this.e3,l),g=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),f=d/this.a,h=(o*(u*f+1)-f-.5*u*(f*f+a))/(this.es*Math.sin(2*l)*(f*f+a-2*o*f)/(4*u)+(o-f)*(u*g-2/Math.sin(2*l))-g),l-=h,Math.abs(h)<=H){e=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(e),2))*Math.tan(e),t=Q(this.long0+Math.asin(n*u/this.a)/Math.sin(e))}return r.x=t,r.y=e,r}var Q3=["Polyconic","poly"];const tN={init:H3,forward:K3,inverse:J3,names:Q3};function eN(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function rN(r){var t,e=r.x,n=r.y,i=n-this.lat0,s=e-this.long0,o=i/No*1e-5,a=s,l=1,h=0;for(t=1;t<=10;t++)l=l*o,h=h+this.A[t]*l;var c=h,u=a,d=1,g=0,f,m,_=0,y=0;for(t=1;t<=6;t++)f=d*c-g*u,m=g*c+d*u,d=f,g=m,_=_+this.B_re[t]*d-this.B_im[t]*g,y=y+this.B_im[t]*d+this.B_re[t]*g;return r.x=y*this.a+this.x0,r.y=_*this.a+this.y0,r}function nN(r){var t,e=r.x,n=r.y,i=e-this.x0,s=n-this.y0,o=s/this.a,a=i/this.a,l=1,h=0,c,u,d=0,g=0;for(t=1;t<=6;t++)c=l*o-h*a,u=h*o+l*a,l=c,h=u,d=d+this.C_re[t]*l-this.C_im[t]*h,g=g+this.C_im[t]*l+this.C_re[t]*h;for(var f=0;f.999999999999&&(e=.999999999999),t=Math.asin(e);var n=Q(this.long0+r.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),e=(2*t+Math.sin(2*t))/Math.PI,Math.abs(e)>1&&(e=1);var i=Math.asin(e);return r.x=n,r.y=i,r}var vN=["Mollweide","moll"];const wN={init:_N,forward:yN,inverse:xN,names:vN};function SN(){Math.abs(this.lat1+this.lat2)=0?(e=Math.sqrt(r.x*r.x+r.y*r.y),t=1):(e=-Math.sqrt(r.x*r.x+r.y*r.y),t=-1);var s=0;if(e!==0&&(s=Math.atan2(t*r.x,t*r.y)),this.sphere)return i=Q(this.long0+s/this.ns),n=io(this.g-e/this.a),r.x=i,r.y=n,r;var o=this.g-e/this.a;return n=Yl(o,this.e0,this.e1,this.e2,this.e3),i=Q(this.long0+s/this.ns),r.x=i,r.y=n,r}var TN=["Equidistant_Conic","eqdc"];const MN={init:SN,forward:EN,inverse:bN,names:TN};function RN(){this.R=this.a}function CN(r){var t=r.x,e=r.y,n=Q(t-this.long0),i,s;Math.abs(e)<=H&&(i=this.x0+this.R*n,s=this.y0);var o=ui(2*Math.abs(e/Math.PI));(Math.abs(n)<=H||Math.abs(Math.abs(e)-Y)<=H)&&(i=this.x0,e>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*o):s=this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/n-n/Math.PI),l=a*a,h=Math.sin(o),c=Math.cos(o),u=c/(h+c-1),d=u*u,g=u*(2/h-1),f=g*g,m=Math.PI*this.R*(a*(u-f)+Math.sqrt(l*(u-f)*(u-f)-(f+l)*(d-f)))/(f+l);n<0&&(m=-m),i=this.x0+m;var _=l+u;return m=Math.PI*this.R*(g*_-a*Math.sqrt((f+l)*(l+1)-_*_))/(f+l),e>=0?s=this.y0+m:s=this.y0-m,r.x=i,r.y=s,r}function IN(r){var t,e,n,i,s,o,a,l,h,c,u,d,g;return r.x-=this.x0,r.y-=this.y0,u=Math.PI*this.R,n=r.x/u,i=r.y/u,s=n*n+i*i,o=-Math.abs(i)*(1+s),a=o-2*i*i+n*n,l=-2*o+1+2*i*i+s*s,g=i*i/l+(2*a*a*a/l/l/l-9*o*a/l/l)/27,h=(o-a*a/3/l)/l,c=2*Math.sqrt(-h/3),u=3*g/h/c,Math.abs(u)>1&&(u>=0?u=1:u=-1),d=Math.acos(u)/3,r.y>=0?e=(-c*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI:e=-(-c*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI,Math.abs(n)2*Y*this.a?void 0:(e=t/this.a,n=Math.sin(e),i=Math.cos(e),s=this.long0,Math.abs(t)<=H?o=this.lat0:(o=ui(i*this.sin_p12+r.y*n*this.cos_p12/t),a=Math.abs(this.lat0)-Y,Math.abs(a)<=H?this.lat0>=0?s=Q(this.long0+Math.atan2(r.x,-r.y)):s=Q(this.long0-Math.atan2(-r.x,r.y)):s=Q(this.long0+Math.atan2(r.x*n,t*this.cos_p12*i-r.y*this.sin_p12*n))),r.x=s,r.y=o,r)):(l=Oa(this.es),h=Fa(this.es),c=Na(this.es),u=Da(this.es),Math.abs(this.sin_p12-1)<=H?(d=this.a*qe(l,h,c,u,Y),t=Math.sqrt(r.x*r.x+r.y*r.y),g=d-t,o=Yl(g/this.a,l,h,c,u),s=Q(this.long0+Math.atan2(r.x,-1*r.y)),r.x=s,r.y=o,r):Math.abs(this.sin_p12+1)<=H?(d=this.a*qe(l,h,c,u,Y),t=Math.sqrt(r.x*r.x+r.y*r.y),g=t-d,o=Yl(g/this.a,l,h,c,u),s=Q(this.long0+Math.atan2(r.x,r.y)),r.x=s,r.y=o,r):(t=Math.sqrt(r.x*r.x+r.y*r.y),_=Math.atan2(r.x,r.y),f=Ws(this.a,this.e,this.sin_p12),y=Math.cos(_),x=this.e*this.cos_p12*y,w=-x*x/(1-this.es),S=3*this.es*(1-w)*this.sin_p12*this.cos_p12*y/(1-this.es),E=t/f,T=E-w*(1+w)*Math.pow(E,3)/6-S*(1+3*w)*Math.pow(E,4)/24,R=1-w*T*T/2-E*T*T*T/6,m=Math.asin(this.sin_p12*Math.cos(T)+this.cos_p12*Math.sin(T)*y),s=Q(this.long0+Math.asin(Math.sin(_)*Math.sin(T)/Math.cos(m))),C=Math.sin(m),o=Math.atan2((C-this.es*R*this.sin_p12)*Math.tan(m),C*(1-this.es)),r.x=s,r.y=o,r))}var NN=["Azimuthal_Equidistant","aeqd"];const DN={init:LN,forward:ON,inverse:FN,names:NN};function kN(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function GN(r){var t,e,n,i,s,o,a,l,h=r.x,c=r.y;return n=Q(h-this.long0),t=Math.sin(c),e=Math.cos(c),i=Math.cos(n),o=this.sin_p14*t+this.cos_p14*e*i,s=1,(o>0||Math.abs(o)<=H)&&(a=this.a*s*e*Math.sin(n),l=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*e*i)),r.x=a,r.y=l,r}function jN(r){var t,e,n,i,s,o,a;return r.x-=this.x0,r.y-=this.y0,t=Math.sqrt(r.x*r.x+r.y*r.y),e=ui(t/this.a),n=Math.sin(e),i=Math.cos(e),o=this.long0,Math.abs(t)<=H?(a=this.lat0,r.x=o,r.y=a,r):(a=ui(i*this.sin_p14+r.y*n*this.cos_p14/t),s=Math.abs(this.lat0)-Y,Math.abs(s)<=H?(this.lat0>=0?o=Q(this.long0+Math.atan2(r.x,-r.y)):o=Q(this.long0-Math.atan2(-r.x,r.y)),r.x=o,r.y=a,r):(o=Q(this.long0+Math.atan2(r.x*n,t*this.cos_p14*i-r.y*this.sin_p14*n)),r.x=o,r.y=a,r))}var zN=["ortho"];const UN={init:kN,forward:GN,inverse:jN,names:zN};var ne={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Wt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function BN(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Y-Xt/2?this.face=ne.TOP:this.lat0<=-(Y-Xt/2)?this.face=ne.BOTTOM:Math.abs(this.long0)<=Xt?this.face=ne.FRONT:Math.abs(this.long0)<=Y+Xt?this.face=this.long0>0?ne.RIGHT:ne.LEFT:this.face=ne.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function XN(r){var t={x:0,y:0},e,n,i,s,o,a,l={value:0};if(r.x-=this.long0,this.es!==0?e=Math.atan(this.one_minus_f_squared*Math.tan(r.y)):e=r.y,n=r.x,this.face===ne.TOP)s=Y-e,n>=Xt&&n<=Y+Xt?(l.value=Wt.AREA_0,i=n-Y):n>Y+Xt||n<=-(Y+Xt)?(l.value=Wt.AREA_1,i=n>0?n-ce:n+ce):n>-(Y+Xt)&&n<=-Xt?(l.value=Wt.AREA_2,i=n+Y):(l.value=Wt.AREA_3,i=n);else if(this.face===ne.BOTTOM)s=Y+e,n>=Xt&&n<=Y+Xt?(l.value=Wt.AREA_0,i=-n+Y):n=-Xt?(l.value=Wt.AREA_1,i=-n):n<-Xt&&n>=-(Y+Xt)?(l.value=Wt.AREA_2,i=-n-Y):(l.value=Wt.AREA_3,i=n>0?-n+ce:-n-ce);else{var h,c,u,d,g,f,m;this.face===ne.RIGHT?n=Ps(n,+Y):this.face===ne.BACK?n=Ps(n,+ce):this.face===ne.LEFT&&(n=Ps(n,-Y)),d=Math.sin(e),g=Math.cos(e),f=Math.sin(n),m=Math.cos(n),h=g*m,c=g*f,u=d,this.face===ne.FRONT?(s=Math.acos(h),i=rl(s,u,c,l)):this.face===ne.RIGHT?(s=Math.acos(c),i=rl(s,u,-h,l)):this.face===ne.BACK?(s=Math.acos(-h),i=rl(s,u,-c,l)):this.face===ne.LEFT?(s=Math.acos(-c),i=rl(s,u,h,l)):(s=i=0,l.value=Wt.AREA_0)}return a=Math.atan(12/ce*(i+Math.acos(Math.sin(i)*Math.cos(Xt))-Y)),o=Math.sqrt((1-Math.cos(s))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Wt.AREA_1?a+=Y:l.value===Wt.AREA_2?a+=ce:l.value===Wt.AREA_3&&(a+=1.5*ce),t.x=o*Math.cos(a),t.y=o*Math.sin(a),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,r.x=t.x,r.y=t.y,r}function WN(r){var t={lam:0,phi:0},e,n,i,s,o,a,l,h,c,u={value:0};if(r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a,n=Math.atan(Math.sqrt(r.x*r.x+r.y*r.y)),e=Math.atan2(r.y,r.x),r.x>=0&&r.x>=Math.abs(r.y)?u.value=Wt.AREA_0:r.y>=0&&r.y>=Math.abs(r.x)?(u.value=Wt.AREA_1,e-=Y):r.x<0&&-r.x>=Math.abs(r.y)?(u.value=Wt.AREA_2,e=e<0?e+ce:e-ce):(u.value=Wt.AREA_3,e+=Y),c=ce/12*Math.tan(e),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),a=Math.atan(o),i=Math.cos(e),s=Math.tan(n),l=1-i*i*s*s*(1-Math.cos(Math.atan(1/Math.cos(a)))),l<-1?l=-1:l>1&&(l=1),this.face===ne.TOP)h=Math.acos(l),t.phi=Y-h,u.value===Wt.AREA_0?t.lam=a+Y:u.value===Wt.AREA_1?t.lam=a<0?a+ce:a-ce:u.value===Wt.AREA_2?t.lam=a-Y:t.lam=a;else if(this.face===ne.BOTTOM)h=Math.acos(l),t.phi=h-Y,u.value===Wt.AREA_0?t.lam=-a+Y:u.value===Wt.AREA_1?t.lam=-a:u.value===Wt.AREA_2?t.lam=-a-Y:t.lam=a<0?-a-ce:-a+ce;else{var d,g,f;d=l,c=d*d,c>=1?f=0:f=Math.sqrt(1-c)*Math.sin(a),c+=f*f,c>=1?g=0:g=Math.sqrt(1-c),u.value===Wt.AREA_1?(c=g,g=-f,f=c):u.value===Wt.AREA_2?(g=-g,f=-f):u.value===Wt.AREA_3&&(c=g,g=f,f=-c),this.face===ne.RIGHT?(c=d,d=-g,g=c):this.face===ne.BACK?(d=-d,g=-g):this.face===ne.LEFT&&(c=d,d=g,g=-c),t.phi=Math.acos(-f)-Y,t.lam=Math.atan2(g,d),this.face===ne.RIGHT?t.lam=Ps(t.lam,-Y):this.face===ne.BACK?t.lam=Ps(t.lam,-ce):this.face===ne.LEFT&&(t.lam=Ps(t.lam,+Y))}if(this.es!==0){var m,_,y;m=t.phi<0?1:0,_=Math.tan(t.phi),y=this.b/Math.sqrt(_*_+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-y*y)/(this.one_minus_f*y)),m&&(t.phi=-t.phi)}return t.lam+=this.long0,r.x=t.lam,r.y=t.phi,r}function rl(r,t,e,n){var i;return rXt&&i<=Y+Xt?(n.value=Wt.AREA_1,i-=Y):i>Y+Xt||i<=-(Y+Xt)?(n.value=Wt.AREA_2,i=i>=0?i-ce:i+ce):(n.value=Wt.AREA_3,i+=Y)),i}function Ps(r,t){var e=r+t;return e<-ce?e+=oa:e>+ce&&(e-=oa),e}var qN=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const ZN={init:BN,forward:XN,inverse:WN,names:qN};var du=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],To=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],h1=.8487,c1=1.3523,u1=Qr/5,YN=1/u1,Es=18,$l=function(r,t){return r[0]+t*(r[1]+t*(r[2]+t*r[3]))},$N=function(r,t){return r[1]+t*(2*r[2]+t*3*r[3])};function VN(r,t,e,n){for(var i=t;n;--n){var s=r(i);if(i-=s,Math.abs(s)=Es&&(n=Es-1),e=Qr*(e-YN*n);var i={x:$l(du[n],e)*t,y:$l(To[n],e)};return r.y<0&&(i.y=-i.y),i.x=i.x*this.a*h1+this.x0,i.y=i.y*this.a*c1+this.y0,i}function JN(r){var t={x:(r.x-this.x0)/(this.a*h1),y:Math.abs(r.y-this.y0)/(this.a*c1)};if(t.y>=1)t.x/=du[Es][0],t.y=r.y<0?-Y:Y;else{var e=Math.floor(t.y*Es);for(e<0?e=0:e>=Es&&(e=Es-1);;)if(To[e][0]>t.y)--e;else if(To[e+1][0]<=t.y)++e;else break;var n=To[e],i=5*(t.y-n[0])/(To[e+1][0]-n[0]);i=VN(function(s){return($l(n,s)-t.y)/$N(n,s)},i,H,100),t.x/=$l(du[e],i),t.y=(5*e+i)*Ce,r.y<0&&(t.y=-t.y)}return t.x=Q(t.x+this.long0),t}var QN=["Robinson","robin"];const tD={init:HN,forward:KN,inverse:JN,names:QN};function eD(){this.name="geocent"}function rD(r){var t=Hy(r,this.es,this.a);return t}function nD(r){var t=Ky(r,this.es,this.a,this.b);return t}var iD=["Geocentric","geocentric","geocent","Geocent"];const sD={init:eD,forward:rD,inverse:nD,names:iD};var De={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},po={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function oD(){if(Object.keys(po).forEach(function(e){if(typeof this[e]>"u")this[e]=po[e].def;else{if(po[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);po[e].num&&(this[e]=parseFloat(this[e]))}po[e].degrees&&(this[e]=this[e]*Ce)}.bind(this)),Math.abs(Math.abs(this.lat0)-Y)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var r=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(r),this.sw=Math.sin(r)}function aD(r){r.x-=this.long0;var t=Math.sin(r.y),e=Math.cos(r.y),n=Math.cos(r.x),i,s;switch(this.mode){case De.OBLIQ:s=this.sinph0*t+this.cosph0*e*n;break;case De.EQUIT:s=e*n;break;case De.S_POLE:s=-t;break;case De.N_POLE:s=t;break}switch(s=this.pn1/(this.p-s),i=s*e*Math.sin(r.x),this.mode){case De.OBLIQ:s*=this.cosph0*t-this.sinph0*e*n;break;case De.EQUIT:s*=t;break;case De.N_POLE:s*=-(e*n);break;case De.S_POLE:s*=e*n;break}var o,a;return o=s*this.cg+i*this.sg,a=1/(o*this.sw*this.h1+this.cw),i=(i*this.cg-s*this.sg)*this.cw*a,s=o*a,r.x=i*this.a,r.y=s*this.a,r}function lD(r){r.x/=this.a,r.y/=this.a;var t={x:r.x,y:r.y},e,n,i;i=1/(this.pn1-r.y*this.sw),e=this.pn1*r.x*i,n=this.pn1*r.y*this.cw*i,r.x=e*this.cg+n*this.sg,r.y=n*this.cg-e*this.sg;var s=wr(r.x,r.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var r=1-this.es,t=1/r;this.radius_p=Math.sqrt(r),this.radius_p2=r,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function dD(r){var t=r.x,e=r.y,n,i,s,o;if(t=t-this.long0,this.shape==="ellipse"){e=Math.atan(this.radius_p2*Math.tan(e));var a=this.radius_p/wr(this.radius_p*Math.cos(e),Math.sin(e));if(i=a*Math.cos(t)*Math.cos(e),s=a*Math.sin(t)*Math.cos(e),o=a*Math.sin(e),(this.radius_g-i)*i-s*s-o*o*this.radius_p_inv2<0)return r.x=Number.NaN,r.y=Number.NaN,r;n=this.radius_g-i,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/wr(o,n)),r.y=this.radius_g_1*Math.atan(o/n)):(r.x=this.radius_g_1*Math.atan(s/n),r.y=this.radius_g_1*Math.atan(o/wr(s,n)))}else this.shape==="sphere"&&(n=Math.cos(e),i=Math.cos(t)*n,s=Math.sin(t)*n,o=Math.sin(e),n=this.radius_g-i,this.flip_axis?(r.x=this.radius_g_1*Math.atan(s/wr(o,n)),r.y=this.radius_g_1*Math.atan(o/n)):(r.x=this.radius_g_1*Math.atan(s/n),r.y=this.radius_g_1*Math.atan(o/wr(s,n))));return r.x=r.x*this.a,r.y=r.y*this.a,r}function gD(r){var t=-1,e=0,n=0,i,s,o,a;if(r.x=r.x/this.a,r.y=r.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*wr(1,n)):(e=Math.tan(r.x/this.radius_g_1),n=Math.tan(r.y/this.radius_g_1)*wr(1,e));var l=n/this.radius_p;if(i=e*e+l*l+t*t,s=2*this.radius_g*t,o=s*s-4*i*this.C,o<0)return r.x=Number.NaN,r.y=Number.NaN,r;a=(-s-Math.sqrt(o))/(2*i),t=this.radius_g+a*t,e*=a,n*=a,r.x=Math.atan2(e,t),r.y=Math.atan(n*Math.cos(r.x)/t),r.y=Math.atan(this.radius_p_inv2*Math.tan(r.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(r.y/this.radius_g_1),e=Math.tan(r.x/this.radius_g_1)*Math.sqrt(1+n*n)):(e=Math.tan(r.x/this.radius_g_1),n=Math.tan(r.y/this.radius_g_1)*Math.sqrt(1+e*e)),i=e*e+n*n+t*t,s=2*this.radius_g*t,o=s*s-4*i*this.C,o<0)return r.x=Number.NaN,r.y=Number.NaN,r;a=(-s-Math.sqrt(o))/(2*i),t=this.radius_g+a*t,e*=a,n*=a,r.x=Math.atan2(e,t),r.y=Math.atan(n*Math.cos(r.x)/t)}return r.x=r.x+this.long0,r}var fD=["Geostationary Satellite View","Geostationary_Satellite","geos"];const pD={init:uD,forward:dD,inverse:gD,names:fD};var Do=1.340264,ko=-.081106,Go=893e-6,jo=.003796,Vl=Math.sqrt(3)/2;function mD(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function _D(r){var t=Q(r.x-this.long0),e=r.y,n=Math.asin(Vl*Math.sin(e)),i=n*n,s=i*i*i;return r.x=t*Math.cos(n)/(Vl*(Do+3*ko*i+s*(7*Go+9*jo*i))),r.y=n*(Do+ko*i+s*(Go+jo*i)),r.x=this.a*r.x+this.x0,r.y=this.a*r.y+this.y0,r}function yD(r){r.x=(r.x-this.x0)/this.a,r.y=(r.y-this.y0)/this.a;var t=1e-9,e=12,n=r.y,i,s,o,a,l,h;for(h=0;h>=1;return e.join("")}const ED='Terms of Use';class bD extends Rr{constructor(t){const e=t.hidpi!==void 0?t.hidpi:!1;super({cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,opaque:!0,projection:K("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,tilePixelRatio:e?2:1,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.hidpi_=e,this.culture_=t.culture!==void 0?t.culture:"en-us",this.maxZoom_=t.maxZoom!==void 0?t.maxZoom:-1,this.apiKey_=t.key,this.imagerySet_=t.imagerySet,this.placeholderTiles_=t.placeholderTiles;const n="https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+this.apiKey_+"&c="+this.culture_;fetch(n).then(i=>i.json()).then(i=>this.handleImageryMetadataResponse(i))}getApiKey(){return this.apiKey_}getImagerySet(){return this.imagerySet_}handleImageryMetadataResponse(t){if(t.statusCode!=200||t.statusDescription!="OK"||t.authenticationResultCode!="ValidCredentials"||t.resourceSets.length!=1||t.resourceSets[0].resources.length!=1){this.setState("error");return}const e=t.resourceSets[0].resources[0],n=this.maxZoom_==-1?e.zoomMax:this.maxZoom_,i=this.getProjection(),s=jn(i),o=this.hidpi_?2:1,a=e.imageWidth==e.imageHeight?e.imageWidth/o:[e.imageWidth/o,e.imageHeight/o],l=Vi({extent:s,minZoom:e.zoomMin,maxZoom:n,tileSize:a});this.tileGrid=l;const h=this.culture_,c=this.hidpi_,u=this.placeholderTiles_;if(this.tileUrlFunction=Bs(e.imageUrlSubdomains.map(function(d){const g=[0,0,0],f=e.imageUrl.replace("{subdomain}",d).replace("{culture}",h);return function(m,_,y){if(!m)return;na(m[0],m[1],m[2],g);const x=new URL(f.replace("{quadkey}",SD(g))),w=x.searchParams;return c&&(w.set("dpi","d1"),w.set("device","mobile")),u===!0?w.delete("n"):u===!1&&w.set("n","z"),x.toString()}})),e.imageryProviders){const d=qi(K("EPSG:4326"),this.getProjection());this.setAttributions(g=>{const f=[],m=g.viewState,_=this.getTileGrid(),y=_.getZForResolution(m.resolution,this.zDirection),x=_.getTileCoordForCoordAndZ(m.center,y)[0];return e.imageryProviders.map(function(w){let S=!1;const E=w.coverageAreas;for(let T=0,R=E.length;T=C.zoomMin&&x<=C.zoomMax){const A=C.bbox,k=[A[1],A[0],A[3],A[2]],F=Ls(k,d);if($t(F,g.extent)){S=!0;break}}}S&&f.push(w.attribution)}),f.push(ED),f})}this.setState("ready")}}const TD=bD;class MD extends ji{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,maxZoom:t.maxZoom!==void 0?t.maxZoom:18,minZoom:t.minZoom,projection:t.projection,transition:t.transition,wrapX:t.wrapX,zDirection:t.zDirection}),this.account_=t.account,this.mapId_=t.map||"",this.config_=t.config||{},this.templateCache_={},this.initializeMap_()}getConfig(){return this.config_}updateConfig(t){Object.assign(this.config_,t),this.initializeMap_()}setConfig(t){this.config_=t||{},this.initializeMap_()}initializeMap_(){const t=JSON.stringify(this.config_);if(this.templateCache_[t]){this.applyTemplate_(this.templateCache_[t]);return}let e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);const n=new XMLHttpRequest;n.addEventListener("load",this.handleInitResponse_.bind(this,t)),n.addEventListener("error",this.handleInitError_.bind(this)),n.open("POST",e),n.setRequestHeader("Content-type","application/json"),n.send(JSON.stringify(this.config_))}handleInitResponse_(t,e){const n=e.target;if(!n.status||n.status>=200&&n.status<300){let i;try{i=JSON.parse(n.responseText)}catch{this.setState("error");return}this.applyTemplate_(i),this.templateCache_[t]=i,this.setState("ready")}else this.setState("error")}handleInitError_(t){this.setState("error")}applyTemplate_(t){const e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)}}const RD=MD;class CD extends wh{constructor(t){t=t||{},super({attributions:t.attributions,wrapX:t.wrapX}),this.resolution=void 0,this.distance=t.distance!==void 0?t.distance:20,this.minDistance=t.minDistance||0,this.interpolationRatio=0,this.features=[],this.geometryFunction=t.geometryFunction||function(e){const n=e.getGeometry();return Rt(!n||n.getType()==="Point","The default `geometryFunction` can only handle `Point` or null geometries"),n},this.createCustomCluster_=t.createCluster,this.source=null,this.boundRefresh_=this.refresh.bind(this),this.updateDistance(this.distance,this.minDistance),this.setSource(t.source||null)}clear(t){this.features.length=0,super.clear(t)}getDistance(){return this.distance}getSource(){return this.source}loadFeatures(t,e,n){var i;(i=this.source)==null||i.loadFeatures(t,e,n),e!==this.resolution&&(this.resolution=e,this.refresh())}setDistance(t){this.updateDistance(t,this.minDistance)}setMinDistance(t){this.updateDistance(this.distance,t)}getMinDistance(){return this.minDistance}setSource(t){this.source&&this.source.removeEventListener(Ct.CHANGE,this.boundRefresh_),this.source=t,t&&t.addEventListener(Ct.CHANGE,this.boundRefresh_),this.refresh()}refresh(){this.clear(),this.cluster(),this.addFeatures(this.features)}updateDistance(t,e){const n=t===0?0:Math.min(e,t)/t,i=t!==this.distance||this.interpolationRatio!==n;this.distance=t,this.minDistance=e,this.interpolationRatio=n,i&&this.refresh()}cluster(){if(this.resolution===void 0||!this.source)return;const t=je(),e=this.distance*this.resolution,n=this.source.getFeatures(),i={};for(let s=0,o=n.length;s=0;--a){const l=this.geometryFunction(t[a]);l?mm(n,l.getCoordinates()):t.splice(a,1)}px(n,1/t.length);const i=be(e),s=this.interpolationRatio,o=new Ee([n[0]*(1-s)+i[0]*s,n[1]*(1-s)+i[1]*s]);return this.createCustomCluster_?this.createCustomCluster_(o,t):new ve({geometry:o,features:t})}}const ID=CD,PD="https://tile.googleapis.com/v1/createSession",AD="https://tile.googleapis.com/v1/2dtiles",LD="https://tile.googleapis.com/tile/v1/viewport",OD=22;class FD extends Rr{constructor(t){const e=!!t.highDpi,n=t.overlay!==!0;super({attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,opaque:n,projection:"EPSG:3857",reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,tilePixelRatio:e?2:1,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.apiKey_=t.key,this.error_=null;const i={mapType:t.mapType||"roadmap",language:t.language||"en-US",region:t.region||"US"};t.imageFormat&&(i.imageFormat=t.imageFormat),t.scale&&(i.scale=t.scale),e&&(i.highDpi=!0),t.layerTypes&&(i.layerTypes=t.layerTypes),t.styles&&(i.styles=t.styles),t.overlay===!0&&(i.overlay=!0),this.sessionTokenRequest_=i,this.sessionTokenValue_,this.sessionRefreshId_,this.previousViewportAttribution_,this.previousViewportExtent_,this.createSession_()}getError(){return this.error_}fetchSessionToken(t,e){return fetch(t,e)}async createSession_(){const t=PD+"?key="+this.apiKey_,e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.sessionTokenRequest_)},n=await this.fetchSessionToken(t,e);if(!n.ok){try{const u=await n.json();this.error_=new Error(u.error.message)}catch{this.error_=new Error("Error fetching session token")}this.setState("error");return}const i=await n.json(),s=this.getTilePixelRatio(1),o=[i.tileWidth/s,i.tileHeight/s];this.tileGrid=Vi({extent:jn(this.getProjection()),maxZoom:OD,tileSize:o});const a=i.session;this.sessionTokenValue_=a;const l=this.apiKey_;this.tileUrlFunction=function(u,d,g){const f=u[0],m=u[1],_=u[2];return`${AD}/${f}/${m}/${_}?session=${a}&key=${l}`};const h=parseInt(i.expiry,10)*1e3,c=Math.max(h-Date.now()-60*1e3,1);this.sessionRefreshId_=setTimeout(()=>this.createSession_(),c),this.setAttributions(this.fetchAttributions_.bind(this)),this.setState("ready")}async fetchAttributions_(t){if(t.viewHints[Kt.ANIMATING]||t.viewHints[Kt.INTERACTING]||t.animate)return this.previousViewportAttribution_;const[e,n]=Ug(da(t.extent),t.viewState.projection),[i,s]=Ug(ga(t.extent),t.viewState.projection),o=`zoom=${this.getTileGrid().getZForResolution(t.viewState.resolution,this.zDirection)}&north=${s}&south=${n}&east=${i}&west=${e}`;if(this.previousViewportExtent_==o)return this.previousViewportAttribution_;this.previousViewportExtent_=o;const a=this.sessionTokenValue_,l=this.apiKey_,h=`${LD}?session=${a}&key=${l}&${o}`;return this.previousViewportAttribution_=await fetch(h).then(c=>c.json()).then(c=>c.copyright),this.previousViewportAttribution_}disposeInternal(){clearTimeout(this.sessionRefreshId_),super.disposeInternal()}}const ND=FD;let d1=class extends Ra{constructor(r,t,e,n,i,s,o){super(t,e,n,i,s,o),this.zoomifyImage_=null,this.tileSize_=r}getImage(){if(this.zoomifyImage_)return this.zoomifyImage_;const r=super.getImage();if(this.state==U.LOADED){const t=this.tileSize_;if(r.width==t[0]&&r.height==t[1])return this.zoomifyImage_=r,r;const e=Vt(t[0],t[1]);return e.drawImage(r,0,0),this.zoomifyImage_=e.canvas,e.canvas}return r}};class DD extends Rr{constructor(t){const e=t.size,n=t.tierSizeCalculation!==void 0?t.tierSizeCalculation:"default",i=t.tilePixelRatio||1,s=e[0],o=e[1],a=[],l=t.tileSize||Gs;let h=l*i;switch(n){case"default":for(;s>h||o>h;)a.push([Math.ceil(s/h),Math.ceil(o/h)]),h+=h;break;case"truncated":let T=s,R=o;for(;T>h||R>h;)a.push([Math.ceil(T/h),Math.ceil(R/h)]),T>>=1,R>>=1;break;default:throw new Error("Unknown `tierSizeCalculation` configured")}a.push([1,1]),a.reverse();const c=[i],u=[0];for(let T=1,R=a.length;T{m=l,this.changed()}),E.src=S}}const kD=DD;function mo(r){return r.toLocaleString("en",{maximumFractionDigits:10})}class GD extends Rr{constructor(t){const e=t||{};let n=e.url||"";n=n+(n.lastIndexOf("/")===n.length-1||n===""?"":"/");const i=e.version||ge.VERSION2,s=e.sizes||[],o=e.size;Rt(o!=null&&Array.isArray(o)&&o.length==2&&!isNaN(o[0])&&o[0]>0&&!isNaN(o[1])&&o[1]>0,"Missing or invalid `size`");const a=o[0],l=o[1],h=e.tileSize,c=e.tilePixelRatio||1,u=e.format||"jpg",d=e.quality||(e.version==ge.VERSION1?"native":"default");let g=e.resolutions||[];const f=e.supports||[],m=e.extent||[0,-l,a,0],_=s!=null&&Array.isArray(s)&&s.length>0,y=h!==void 0&&(typeof h=="number"&&Number.isInteger(h)&&h>0||Array.isArray(h)&&h.length>0),x=f!=null&&Array.isArray(f)&&(f.includes("regionByPx")||f.includes("regionByPct"))&&(f.includes("sizeByWh")||f.includes("sizeByH")||f.includes("sizeByW")||f.includes("sizeByPct"));let w,S,E;if(g.sort(function(A,k){return k-A}),y||x)if(h!=null&&(typeof h=="number"&&Number.isInteger(h)&&h>0?(w=h,S=h):Array.isArray(h)&&h.length>0&&((h.length==1||h[1]==null&&Number.isInteger(h[0]))&&(w=h[0],S=h[0]),h.length==2&&(Number.isInteger(h[0])&&Number.isInteger(h[1])?(w=h[0],S=h[1]):h[0]==null&&Number.isInteger(h[1])&&(w=h[1],S=h[1])))),(w===void 0||S===void 0)&&(w=Gs,S=Gs),g.length==0){E=Math.max(Math.ceil(Math.log(a/w)/Math.LN2),Math.ceil(Math.log(l/S)/Math.LN2));for(let A=E;A>=0;A--)g.push(Math.pow(2,A))}else{const A=Math.max(...g);E=Math.round(Math.log(A)/Math.LN2)}else if(w=a,S=l,g=[],_){s.sort(function(k,F){return k[0]-F[0]}),E=-1;const A=[];for(let k=0;k0&&g[g.length-1]==F){A.push(k);continue}g.push(F),E++}if(A.length>0)for(let k=0;kE)return;const b=A[1],M=A[2],L=g[v];if(!(b===void 0||M===void 0||L===void 0||b<0||Math.ceil(a/L/w)<=b||M<0||Math.ceil(l/L/S)<=M)){if(x||y){const D=b*w*L,j=M*S*L;let G=w*L,W=S*L,$=w,st=S;if(D+G>a&&(G=a-D),j+W>l&&(W=l-j),D+w*L>a&&($=Math.floor((a-D+L-1)/L)),j+S*L>l&&(st=Math.floor((l-j+L-1)/L)),D==0&&G==a&&j==0&&W==l)z="full";else if(!x||f.includes("regionByPx"))z=D+","+j+","+G+","+W;else if(f.includes("regionByPct")){const X=mo(D/a*100),lt=mo(j/l*100),ct=mo(G/a*100),gt=mo(W/l*100);z="pct:"+X+","+lt+","+ct+","+gt}i==ge.VERSION3&&(!x||f.includes("sizeByWh"))?p=$+","+st:!x||f.includes("sizeByW")?p=$+",":f.includes("sizeByH")?p=","+st:f.includes("sizeByWh")?p=$+","+st:f.includes("sizeByPct")&&(p="pct:"+mo(100/L))}else if(z="full",_){const D=s[v][0],j=s[v][1];i==ge.VERSION3?D==a&&j==l?p="max":p=D+","+j:D==a?p="full":p=D+","}else p=i==ge.VERSION3?"max":"full";return n+z+"/"+p+"/0/"+d+"."+u}},C=d1.bind(null,Jt(h||256).map(function(A){return A*c}));super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:e.state,tileClass:C,tileGrid:T,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:R,transition:e.transition}),this.zDirection=e.zDirection}}const jD=GD;function g1(r,t,e,n,i,s){const o=i.getCode().split(/:(?=\d+$)/).pop(),a=e/n,l=[dl(pt(t)/a,Jr),dl(Zt(t)/a,Jr)];s.SIZE=l[0]+","+l[1],s.BBOX=t.join(","),s.BBOXSR=o,s.IMAGESR=o,s.DPI=Math.round(s.DPI?s.DPI*n:90*n);const h=r.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return On(h,s)}function f1(r){const t=r.load?r.load:di,e=K(r.projection||"EPSG:3857");return function(n,i,s){s=r.hidpi?s:1;const o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};Object.assign(o,r.params),n=Oh(n,i,s,r.ratio);const a=g1(r.url,n,i,s,e,o),l=new Image;return r.crossOrigin!==null&&(l.crossOrigin=r.crossOrigin),t(l,a).then(h=>{const c=pt(n)/h.width*s;return{image:h,extent:n,resolution:c,pixelRatio:s}})}}class zD extends pi{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:Lh,this.params_=Object.assign({},t.params),this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5,this.loaderProjection_=null}getParams(){return this.params_}getImageInternal(t,e,n,i){return this.url_===void 0?null:((!this.loader||this.loaderProjection_!==i)&&(this.loaderProjection_=i,this.loader=f1({crossOrigin:this.crossOrigin_,params:this.params_,projection:i,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(s,o)=>(this.image.setImage(s),this.imageLoadFunction_(this.image,o),di(s))})),super.getImageInternal(t,e,n,i))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}}const UD=zD;class BD extends pi{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions,state:t.state}),this.canvasFunction_=t.canvasFunction,this.canvas_=null,this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5}getImageInternal(t,e,n,i){e=this.findNearestResolution(e);let s=this.canvas_;if(s&&this.renderedRevision_==this.getRevision()&&s.getResolution()==e&&s.getPixelRatio()==n&&We(s.getExtent(),t))return s;t=t.slice(),gm(t,this.ratio_);const o=pt(t)/e,a=Zt(t)/e,l=[o*n,a*n],h=this.canvasFunction_.call(this,t,e,n,l,i);return h&&(s=new Nd(t,e,n,h)),this.canvas_=s,this.renderedRevision_=this.getRevision(),s}}const XD=BD;function WD(r,t,e,n){const i=pt(r),s=Zt(r),o=t[0],a=t[1],l=.0254/n;return a*i>o*s?i*e/(o*l):s*e/(a*l)}function qD(r,t,e,n,i,s,o){const a=WD(e,n,s,o),l=be(e),h={OPERATION:i?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:o,SETDISPLAYWIDTH:Math.round(n[0]),SETDISPLAYHEIGHT:Math.round(n[1]),SETVIEWSCALE:a,SETVIEWCENTERX:l[0],SETVIEWCENTERY:l[1]};return Object.assign(h,t),On(r,h)}function p1(r){const t=r.load||di;return function(e,n,i){const s=new Image;r.crossOrigin!==null&&(s.crossOrigin=r.crossOrigin),e=Oh(e,n,i,r.ratio);const o=pt(e)/n,a=Zt(e)/n,l=[o*i,a*i],h=qD(r.url,r.params,e,l,r.useOverlay,r.metersPerUnit||1,r.displayDpi||96);return t(s,h).then(c=>({image:c,extent:e,pixelRatio:i}))}}class ZD extends pi{constructor(t){super({interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.displayDpi_=t.displayDpi!==void 0?t.displayDpi:96,this.params_=Object.assign({},t.params),this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:Lh,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.metersPerUnit_=t.metersPerUnit!==void 0?t.metersPerUnit:1,this.ratio_=t.ratio!==void 0?t.ratio:1,this.useOverlay_=t.useOverlay!==void 0?t.useOverlay:!1,this.renderedRevision_=0,this.loaderProjection_=null}getParams(){return this.params_}getImageInternal(t,e,n,i){return this.url_===void 0?null:((!this.loader||this.loaderProjection_!==i)&&(this.loaderProjection_=i,this.loader=p1({crossOrigin:this.crossOrigin_,params:this.params_,hidpi:this.hidpi_,metersPerUnit:this.metersPerUnit_,url:this.url_,useOverlay:this.useOverlay_,ratio:this.ratio_,load:(s,o)=>(this.image.setImage(s),this.imageLoadFunction_(this.image,o),di(s))})),super.getImageInternal(t,e,n,i))}getImageLoadFunction(){return this.imageLoadFunction_}updateParams(t){Object.assign(this.params_,t),this.changed()}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}changed(){this.image=null,super.changed()}}const YD=ZD;class $D extends pi{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null,this.url_=t.url,this.imageLoadFunction_=t.imageLoadFunction!==void 0?t.imageLoadFunction:Lh,this.params_=Object.assign({},t.params),this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.renderedRevision_=0,this.ratio_=t.ratio!==void 0?t.ratio:1.5,this.loaderProjection_=null}getFeatureInfoUrl(t,e,n,i){const s=K(n),o=this.getProjection();o&&o!==s&&(e=ra(o,s,t,e),t=Ql(t,s,o));const a={url:this.url_,params:{...this.params_,...i},projection:o||s};return aL(a,t,e)}getLegendUrl(t,e){return lL({url:this.url_,params:{...this.params_,...e}},t)}getParams(){return this.params_}getImageInternal(t,e,n,i){return this.url_===void 0?null:((!this.loader||this.loaderProjection_!==i)&&(this.loaderProjection_=i,this.loader=wy({crossOrigin:this.crossOrigin_,params:this.params_,projection:i,serverType:this.serverType_,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(s,o)=>(this.image.setImage(s),this.imageLoadFunction_(this.image,o),di(s))})),super.getImageInternal(t,e,n,i))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}}const VD=$D,HD={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},KD={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function m1(r,t){if(!t.length)return r;const e=new URL(r,"file:/");if(e.pathname.split("/").includes("collections"))return Xo('The "collections" query parameter cannot be added to collection endpoints'),r;const n=t.map(o=>encodeURIComponent(o)).join(",");e.searchParams.append("collections",n);const i=r.split("?")[0],s=decodeURIComponent(e.searchParams.toString());return`${i}?${s}`}function JD(r,t,e){let n,i;for(let s=0;sE.replace(/E|X|Lon/i,"e").replace(/N|Y|Lat/i,"n")).join(""):i.getAxisOrientation().substr(0,2))!=="en",a=t.tileMatrices,l={};for(let E=0;Ep.maxTileCol||F.tileRowp.maxTileRow)return}Object.assign(F,x);const z=e.replace(/\{(\w+?)\}/g,function(p,v){return F[v]});return _y(w,z)}return{grid:y,urlTemplate:e,urlFunction:S}}function t5(r,t){const e=t.tileMatrixSetLimits;let n;if(t.dataType==="map")n=JD(t.links,r.mediaType,r.collections);else if(t.dataType==="vector")n=QD(t.links,r.mediaType,r.supportedMediaTypes,r.collections);else throw new Error('Expected tileset data type to be "map" or "vector"');if(t.tileMatrixSet)return nm(r,t.tileMatrixSet,n,e);const i=t.links.find(a=>a.rel==="http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme");if(!i)throw new Error("Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet");const s=i.href,o=_y(r.url,s);return my(o).then(function(a){return nm(r,a,n,e)})}function _1(r){return my(r.url).then(function(t){return t5(r,t)})}class e5 extends Rr{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition});const e={url:t.url,projection:this.getProjection(),mediaType:t.mediaType,context:t.context||null,collections:t.collections};_1(e).then(this.handleTileSetInfo_.bind(this)).catch(this.handleError_.bind(this))}handleTileSetInfo_(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState("ready")}handleError_(t){Xo(t),this.setState("error")}}const r5=e5;class n5 extends Fh{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,format:t.format,overlaps:t.overlaps,projection:t.projection,tileClass:t.tileClass,transition:t.transition,wrapX:t.wrapX,zDirection:t.zDirection,state:"loading"});const e={url:t.url,projection:this.getProjection(),mediaType:t.mediaType,supportedMediaTypes:t.format.supportedMediaTypes,context:t.context||null,collections:t.collections};_1(e).then(this.handleTileSetInfo_.bind(this)).catch(this.handleError_.bind(this))}handleTileSetInfo_(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState("ready")}handleError_(t){Xo(t),this.setState("error")}}const i5=n5,y1='© OpenStreetMap contributors.';class s5 extends ji{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[y1];const n=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",i=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:n,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,opaque:t.opaque!==void 0?t.opaque:!0,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:i,wrapX:t.wrapX,zDirection:t.zDirection})}}const o5=s5,im=1/0;class a5{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,qs(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,n=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const i=this.keyFunction_(n);return delete this.queuedElements_[i],n}enqueue(t){Rt(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=im?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,n=this.priorities_,i=e.length,s=e[t],o=n[t],a=t;for(;t>1;){const l=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),c=ht;){const a=this.getParentIndex_(e);if(i[a]>o)n[e]=n[a],i[e]=i[a],e=a;else break}n[e]=s,i[e]=o}reprioritize(){const t=this.priorityFunction_,e=this.elements_,n=this.priorities_;let i=0;const s=e.length;let o,a,l;for(a=0;a0;)s=this.dequeue()[0],o=s.getKey(),i=s.getState(),i===U.IDLE&&!(o in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,s.load())}}let x1=!0;try{new ImageData(10,10)}catch{x1=!1}let Tc;function h5(r,t,e){if(x1)return new ImageData(r,t,e);Tc||(Tc=document.createElement("canvas").getContext("2d"));const n=Tc.createImageData(t,e);return n.data.set(r),n}function v1(r){let t=!0;try{new ImageData(10,10)}catch{t=!1}function e(n,i,s){return t?new ImageData(n,i,s):{data:n,width:i,height:s}}return function(n){const i=n.buffers,s=n.meta,o=n.imageOps,a=n.width,l=n.height,h=i.length,c=i[0].byteLength;if(o){const f=new Array(h);for(let m=0;m"u"?"data:text/javascript;base64,"+Buffer.from(e.join(` +`),"binary").toString("base64"):URL.createObjectURL(new Blob(e,{type:"text/javascript"})));return n.addEventListener("message",t),n}function u5(r,t){const e=v1(r.operation);let n=!1;return{postMessage:function(i){setTimeout(function(){n||t({data:{buffer:e(i),meta:i.meta}})},0)},terminate:function(){n=!0}}}class d5 extends pu{constructor(t){super(),this._imageOps=!!t.imageOps;let e;t.threads===0?e=0:this._imageOps?e=1:e=t.threads||1;const n=new Array(e);if(e)for(let i=0;ithis._maxQueueLength;)this._queue.shift().callback(null,null)}_dispatch(){if(this._running||this._queue.length===0)return;const t=this._queue.shift();this._job=t;const e=t.inputs[0].width,n=t.inputs[0].height,i=t.inputs.map(function(l){return l.data.buffer}),s=this._workers.length;if(this._running=s,s===1){this._workers[0].postMessage({buffers:i,meta:t.meta,imageOps:this._imageOps,width:e,height:n},i);return}const o=t.inputs[0].data.length,a=4*Math.ceil(o/4/s);for(let l=0;lStadia Maps',x5='© OpenMapTiles',v5='© Stamen Design',w5={stamen_terrain:{extension:"png",opaque:!0},stamen_terrain_background:{extension:"png",opaque:!0},stamen_terrain_labels:{extension:"png",opaque:!1},stamen_terrain_lines:{extension:"png",opaque:!1},stamen_toner_background:{extension:"png",opaque:!0},stamen_toner:{extension:"png",opaque:!0},stamen_toner_labels:{extension:"png",opaque:!1},stamen_toner_lines:{extension:"png",opaque:!1},stamen_toner_lite:{extension:"png",opaque:!0},stamen_watercolor:{extension:"jpg",opaque:!0},alidade_smooth:{extension:"png",opaque:!0},alidade_smooth_dark:{extension:"png",opaque:!0},alidade_satellite:{extension:"png",opaque:!0},outdoors:{extension:"png",opaque:!0},osm_bright:{extension:"png",opaque:!0}},S5={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class E5 extends ji{constructor(t){const e=t.layer.indexOf("-"),n=e==-1?t.layer:t.layer.slice(0,e),i=S5[n]||{minZoom:0,maxZoom:20,retina:!0},s=w5[t.layer],o=t.apiKey?"?api_key="+t.apiKey:"",a=i.retina&&t.retina?"@2x":"",l=t.url!==void 0?t.url:"https://tiles.stadiamaps.com/tiles/"+t.layer+"/{z}/{x}/{y}"+a+"."+s.extension+o,h=[y5,x5,y1];t.layer.startsWith("stamen_")&&h.splice(1,0,v5),super({attributions:h,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:i.maxZoom,minZoom:t.minZoom!==void 0?t.minZoom:i.minZoom,opaque:s.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:l,tilePixelRatio:a?2:1,wrapX:t.wrapX,zDirection:t.zDirection})}}const b5=E5;class T5 extends Rr{constructor(t){t=t||{},super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.params_=Object.assign({},t.params),this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=je(),this.setKey(this.getKeyForParams_())}getKeyForParams_(){let t=0;const e=[];for(const n in this.params_)e[t++]=n+"-"+this.params_[n];return e.join("/")}getParams(){return this.params_}getRequestUrl_(t,e,n,i,s,o){const a=this.urls;if(!a)return;let l;if(a.length==1)l=a[0];else{const h=en(Ad(t),a.length);l=a[h]}return g1(l,n,(this.tileGrid||this.getTileGridForProjection(s)).getResolution(t[0]),i,s,o)}getTilePixelRatio(t){return this.hidpi_?t:1}updateParams(t){Object.assign(this.params_,t),this.setKey(this.getKeyForParams_())}tileUrlFunction(t,e,n){let i=this.getTileGrid();if(i||(i=this.getTileGridForProjection(n)),i.getResolutions().length<=t[0])return;e!=1&&!this.hidpi_&&(e=1);const s=i.getTileCoordExtent(t,this.tmpExtent_);let o=Jt(i.getTileSize(t[0]),this.tmpSize);e!=1&&(o=Ym(o,e,this.tmpSize));const a={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return Object.assign(a,this.params_),this.getRequestUrl_(t,o,s,e,n,a)}}const M5=T5;class R5 extends ji{constructor(t){t=t||{},super({opaque:!1,projection:t.projection,tileGrid:t.tileGrid,wrapX:t.wrapX!==void 0?t.wrapX:!0,zDirection:t.zDirection,url:t.template||"z:{z} x:{x} y:{y}",tileLoadFunction:(e,n)=>{const i=e.getTileCoord()[0],s=Jt(this.tileGrid.getTileSize(i)),o=Vt(s[0],s[1]);o.strokeStyle="grey",o.strokeRect(.5,.5,s[0]+.5,s[1]+.5),o.fillStyle="grey",o.strokeStyle="white",o.textAlign="center",o.textBaseline="middle",o.font="24px sans-serif",o.lineWidth=4,o.strokeText(n,s[0]/2,s[1]/2,s[0]),o.fillText(n,s[0]/2,s[1]/2,s[0]),e.setImage(o.canvas)}})}}const C5=R5;class I5 extends to{constructor(t,e,n,i,s,o){super(t,e),this.src_=n,this.extent_=i,this.preemptive_=s,this.grid_=null,this.keys_=null,this.data_=null,this.jsonp_=o}getImage(){return null}getData(t){if(!this.grid_||!this.keys_)return null;const e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),n=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),i=this.grid_[Math.floor((1-n)*this.grid_.length)];if(typeof i!="string")return null;let s=i.charCodeAt(Math.floor(e*i.length));s>=93&&s--,s>=35&&s--,s-=32;let o=null;if(s in this.keys_){const a=this.keys_[s];this.data_&&a in this.data_?o=this.data_[a]:o=a}return o}forDataAtCoordinate(t,e,n){this.state==U.EMPTY&&n===!0?(this.state=U.IDLE,Uo(this,Ct.CHANGE,function(i){e(this.getData(t))},this),this.loadInternal_()):n===!0?setTimeout(()=>{e(this.getData(t))},0):e(this.getData(t))}getKey(){return this.src_}handleError_(){this.state=U.ERROR,this.changed()}handleLoad_(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=U.LOADED,this.changed()}loadInternal_(){if(this.state==U.IDLE)if(this.state=U.LOADING,this.jsonp_)cg(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{const t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let n;try{n=JSON.parse(e.responseText)}catch{this.handleError_();return}this.handleLoad_(n)}else this.handleError_()}onXHRError_(t){this.handleError_()}load(){this.preemptive_?this.loadInternal_():this.setState(U.EMPTY)}}class P5 extends Ia{constructor(t){if(super({projection:K("EPSG:3857"),state:"loading",wrapX:t.wrapX!==void 0?t.wrapX:!0,zDirection:t.zDirection}),this.preemptive_=t.preemptive!==void 0?t.preemptive:!0,this.tileUrlFunction_=tL,this.template_=void 0,this.jsonp_=t.jsonp||!1,t.url)if(this.jsonp_)cg(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else if(t.tileJSON)this.handleTileJSONResponse(t.tileJSON);else throw new Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let n;try{n=JSON.parse(e.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(n)}else this.handleTileJSONError()}onXHRError_(t){this.handleTileJSONError()}getTemplate(){return this.template_}forDataAtCoordinateAndResolution(t,e,n,i){if(this.tileGrid){const s=this.tileGrid.getZForResolution(e,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,s);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,n,i)}else i===!0?setTimeout(function(){n(null)},0):n(null)}handleTileJSONError(){this.setState("error")}handleTileJSONResponse(t){const e=K("EPSG:4326"),n=this.getProjection();let i;if(t.bounds!==void 0){const c=qi(e,n);i=Ls(t.bounds,c)}const s=jn(n),o=t.minzoom||0,a=t.maxzoom||22,l=Vi({extent:s,maxZoom:a,minZoom:o});this.tileGrid=l,this.template_=t.template;const h=t.grids;if(!h){this.setState("error");return}if(this.tileUrlFunction_=og(h,l),t.attribution){const c=i!==void 0?i:s;this.setAttributions(function(u){return $t(c,u.extent)?[t.attribution]:null})}this.setState("ready")}getTile(t,e,n,i,s){const o=on(t,e,n);if(this.tileCache.containsKey(o))return this.tileCache.get(o);const a=[t,e,n],l=this.getTileCoordForTileUrlFunction(a,s),h=this.tileUrlFunction_(l,i,s),c=new I5(a,h!==void 0?U.IDLE:U.EMPTY,h!==void 0?h:"",this.tileGrid.getTileCoordExtent(a),this.preemptive_,this.jsonp_);return this.tileCache.set(o,c),c}useTile(t,e,n){const i=on(t,e,n);this.tileCache.containsKey(i)&&this.tileCache.get(i)}}const A5=P5;function L5(r,t){const e=new Pd(32),n=r.getExtent();return function(i,s){e.expireCache(),n&&(i=fe(n,i));const o=r.getZForResolution(s),a=[];return r.forEachTileCoord(i,o,l=>{const h=l.toString();if(!e.containsKey(h)){const c=t(l);e.set(h,c)}a.push(e.get(h))}),a}}const O5=Object.freeze(Object.defineProperty({__proto__:null,BingMaps:TD,CartoDB:RD,Cluster:ID,DataTile:Bd,GeoTIFF:sg,Google:ND,IIIF:jD,Image:pi,ImageArcGISRest:UD,ImageCanvas:XD,ImageMapGuide:YD,ImageStatic:py,ImageWMS:VD,OGCMapTile:r5,OGCVectorTile:i5,OSM:o5,Raster:_5,Source:Qs,StadiaMaps:b5,Tile:Ia,TileArcGISRest:M5,TileDebug:C5,TileImage:Rr,TileJSON:yy,TileWMS:Sy,UTFGrid:A5,UrlTile:hg,Vector:wh,VectorTile:Fh,WMTS:Ey,XYZ:ji,Zoomify:kD,createArcGISRestLoader:f1,createMapGuideLoader:p1,createStaticLoader:fy,createWMSLoader:wy,sourcesFromTileGrid:L5},Symbol.toStringTag,{value:"Module"}));class F5 extends Rr{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,tilePixelRatio:t.tilePixelRatio,transition:t.transition,interpolate:t.interpolate!==void 0?t.interpolate:!0,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection,wrapX:t.wrapX}),this.version_=t.version!==void 0?t?.version:"1.0.0",this.dimensions_=t.dimensions!==void 0?t.dimensions:{},this.layer_=t.layer,fetch(t.url).then(e=>e.text()).then(e=>new window.DOMParser().parseFromString(e,"application/xml")).then(e=>{this.handleCapabilitiesResponse(e,t)})}handleCapabilitiesResponse(t,e){const n=new fd().read(t),i=by(n,e);this.crossOrigin=i.crossOrigin,this.projection=i.projection,this.tileGrid=i.tileGrid,this.requestEncoding_=i.requestEncoding,this.matrixSet_=i.matrixSet,this.style_=i.style,this.format_=i.format,this.dimensions_=i.dimensions,this.setUrls(i.urls),this.urls&&this.urls.length>0&&(this.tileUrlFunction=Bs(this.urls.map(this.createFromWMTSTemplate.bind(this)))),this.setState("ready")}createFromWMTSTemplate(t){const e=this.requestEncoding_,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e=="KVP"&&Object.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e=="KVP"?On(t,n):t.replace(/\{(\w+?)\}/g,function(o,a){return a.toLowerCase()in n?n[a.toLowerCase()]:o});const i=this.tileGrid,s=this.dimensions_;return function(o){if(!o)return;const a={TileMatrix:i.getMatrixId(o[0]),TileCol:o[1],TileRow:o[2]};Object.assign(a,s);let l=t;return e=="KVP"?l=On(l,a):l=l.replace(/\{(\w+?)\}/g,function(h,c){return a[c]}),l}}}window.eoxMapAdvancedOlSources={...O5,WMTSCapabilities:F5};const N5={__name:"EodashMap",setup(r){const t=M1(I1),e={class:"fill-height fill-width overflow-none",center:[15,48],zoom:4,layers:[{type:"Vector",source:{type:"Vector",url:"https://openlayers.org/data/vector/ecoregions.json",format:"GeoJSON"}},{type:"Tile",properties:{id:"osm",title:"Background"},source:{type:"OSM"}}]};vi&&vi.value&&vi.value.length===3&&(e.center=[vi.value?.[0],vi.value[1]],e.zoom=vi.value[2]);const n=()=>Fn(()=>import("./eox-map-StGMmh9z.js"),[]),i=a=>{const l=a.map,[h,c]=l?.getView().getCenter()??[0,0],u=l?.getView().getZoom();!Number.isNaN(h)&&!Number.isNaN(c)&&!Number.isNaN(u)&&(vi.value=[h,c,u])},s=(a,l)=>{a?.map?.on("moveend",i);const{selectedStac:h}=P1(l);A1([h,L1],async([c,u])=>{if(c){const d=O1(`./${c.id}/collection.json`,t.stacEndpoint),g=F1(h.value,d),f=[];g.forEach(_=>{f.push(new N1(_))});const m=[];for(let _=0;_{a?.map?.un("moveend",i)};return(a,l)=>(R1(),C1(D1,{link:n,"tag-name":"eox-map",properties:e,"on-mounted":s,"on-unmounted":o}))}},K5=Object.freeze(Object.defineProperty({__proto__:null,default:N5},Symbol.toStringTag,{value:"Module"}));export{H5 as B,K5 as E,Vs as K,V5 as z}; diff --git a/pr-preview/pr-17/assets/Footer-CGLZwLts.css b/pr-preview/pr-17/assets/Footer-C_TvwO3n.css similarity index 92% rename from pr-preview/pr-17/assets/Footer-CGLZwLts.css rename to pr-preview/pr-17/assets/Footer-C_TvwO3n.css index 219eb54..fc954f4 100644 --- a/pr-preview/pr-17/assets/Footer-CGLZwLts.css +++ b/pr-preview/pr-17/assets/Footer-C_TvwO3n.css @@ -1 +1 @@ -.footer-text[data-v-11ca31b6]{font-size:.8rem}.v-footer{align-items:center;display:flex;flex:1 1 auto;padding:8px 16px;position:relative;transition:.2s cubic-bezier(.4,0,.2,1);transition-property:height,width,transform,max-width,left,right,top,bottom;border-color:rgba(var(--v-border-color),var(--v-border-opacity));border-style:solid;border-width:0;box-shadow:0 0 0 0 var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, .2)),0 0 0 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, .14)),0 0 0 0 var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, .12));border-radius:0;background:rgb(var(--v-theme-surface));color:rgba(var(--v-theme-on-surface),var(--v-high-emphasis-opacity))}.v-footer--border{border-width:thin;box-shadow:none}.v-footer--absolute{position:absolute}.v-footer--fixed{position:fixed}.v-footer--rounded{border-radius:4px} +.footer-text[data-v-7ea19f1b]{font-size:.8rem}.v-footer{align-items:center;display:flex;flex:1 1 auto;padding:8px 16px;position:relative;transition:.2s cubic-bezier(.4,0,.2,1);transition-property:height,width,transform,max-width,left,right,top,bottom;border-color:rgba(var(--v-border-color),var(--v-border-opacity));border-style:solid;border-width:0;box-shadow:0 0 0 0 var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, .2)),0 0 0 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, .14)),0 0 0 0 var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, .12));border-radius:0;background:rgb(var(--v-theme-surface));color:rgba(var(--v-theme-on-surface),var(--v-high-emphasis-opacity))}.v-footer--border{border-width:thin;box-shadow:none}.v-footer--absolute{position:absolute}.v-footer--fixed{position:fixed}.v-footer--rounded{border-radius:4px} diff --git a/pr-preview/pr-17/assets/Footer-ByyygyZe.js b/pr-preview/pr-17/assets/Footer-nHEvIjY9.js similarity index 97% rename from pr-preview/pr-17/assets/Footer-ByyygyZe.js rename to pr-preview/pr-17/assets/Footer-nHEvIjY9.js index 22620f7..e3156d0 100644 --- a/pr-preview/pr-17/assets/Footer-ByyygyZe.js +++ b/pr-preview/pr-17/assets/Footer-nHEvIjY9.js @@ -1 +1 @@ -import{p as y,ae as x,e as w,af as k,an as b,ag as C,f as I,h as S,g as R,i as B,Q as P,R as f,ah as z,ai as F,aj as M,s as V,J as T,c as e,ap as X,a as Z,b as j,C as L,_ as N,r as D,x as H,W as E,H as $,$ as A,a0 as J,a1 as K,a9 as t,aa as O,a3 as n,a8 as Q,ar as U,as as W}from"./index-DBoWNDl8.js";const q=y({app:Boolean,color:String,height:{type:[Number,String],default:"auto"},...x(),...w(),...k(),...b(),...C(),...I({tag:"footer"}),...S()},"VFooter"),G=R()({name:"VFooter",props:q(),setup(l,a){let{slots:s}=a;const{themeClasses:o}=B(l),{backgroundColorClasses:c,backgroundColorStyles:r}=P(f(l,"color")),{borderClasses:i}=z(l),{elevationClasses:g}=F(l),{roundedClasses:p}=M(l),d=V(32),{resizeRef:m}=T(u=>{u.length&&(d.value=u[0].target.clientHeight)}),h=e(()=>l.height==="auto"?d.value:parseInt(l.height,10)),{layoutItemStyles:v,layoutIsReady:_}=X({id:l.name,order:e(()=>parseInt(l.order,10)),position:e(()=>"bottom"),layoutSize:h,elementSize:e(()=>l.height==="auto"?void 0:h.value),active:e(()=>l.app),absolute:f(l,"absolute")});return Z(()=>j(l.tag,{ref:m,class:["v-footer",o.value,c.value,i.value,g.value,p.value,l.class],style:[r.value,l.app?v.value:{height:L(l.height)},l.style]},s)),l.app?_:{}}}),Y=l=>(U("data-v-11ca31b6"),l=l(),W(),l),l0={class:"pt-0 footer-text"},e0=Y(()=>t("a",{href:"https://github.com/eodash/eodash",class:"text-white",target:"_blank"},"eodash",-1)),t0={href:"https://eox.at",target:"_blank",class:"text-white"},a0=["src"],s0='',o0={__name:"Footer",setup(l){const a=D(null),s=H(E),{mdAndDown:o}=$(),c=window.btoa(s0);return(r,i)=>(A(),J(G,{ref_key:"footer",ref:a,height:n(o)?"48px":"auto",color:"secondary",app:"",class:"d-flex justify-space-between"},{default:K(()=>[t("p",l0,O(n(s).brand.footerText??""),1),t("div",null,[e0,Q(" by "),t("a",t0,[t("img",{src:`data:image/svg+xml;base64,${n(c)}`,height:"11px"},null,8,a0)])])]),_:1},8,["height"]))}},n0=N(o0,[["__scopeId","data-v-11ca31b6"]]);export{n0 as default}; +import{p as y,ae as x,e as w,af as k,an as b,ag as C,f as I,h as S,g as R,i as B,Q as P,R as f,ah as z,ai as F,aj as M,s as V,J as T,c as e,ap as X,a as Z,b as j,C as L,_ as N,r as D,x as H,W as E,H as $,$ as A,a0 as J,a1 as K,a9 as t,aa as O,a3 as n,a8 as Q,ar as U,as as W}from"./index-B5c5Pwhg.js";const q=y({app:Boolean,color:String,height:{type:[Number,String],default:"auto"},...x(),...w(),...k(),...b(),...C(),...I({tag:"footer"}),...S()},"VFooter"),G=R()({name:"VFooter",props:q(),setup(l,a){let{slots:s}=a;const{themeClasses:o}=B(l),{backgroundColorClasses:c,backgroundColorStyles:r}=P(f(l,"color")),{borderClasses:i}=z(l),{elevationClasses:g}=F(l),{roundedClasses:p}=M(l),d=V(32),{resizeRef:m}=T(u=>{u.length&&(d.value=u[0].target.clientHeight)}),h=e(()=>l.height==="auto"?d.value:parseInt(l.height,10)),{layoutItemStyles:v,layoutIsReady:_}=X({id:l.name,order:e(()=>parseInt(l.order,10)),position:e(()=>"bottom"),layoutSize:h,elementSize:e(()=>l.height==="auto"?void 0:h.value),active:e(()=>l.app),absolute:f(l,"absolute")});return Z(()=>j(l.tag,{ref:m,class:["v-footer",o.value,c.value,i.value,g.value,p.value,l.class],style:[r.value,l.app?v.value:{height:L(l.height)},l.style]},s)),l.app?_:{}}}),Y=l=>(U("data-v-7ea19f1b"),l=l(),W(),l),l0={class:"pt-0 footer-text"},e0=Y(()=>t("a",{href:"https://github.com/eodash/eodash",class:"text-white",target:"_blank"},"eodash",-1)),t0={href:"https://eox.at",target:"_blank",class:"text-white"},a0=["src"],s0='',o0={__name:"Footer",setup(l){const a=D(null),s=H(E),{mdAndDown:o}=$(),c=window.btoa(s0);return(r,i)=>(A(),J(G,{ref_key:"footer",ref:a,height:n(o)?"48px":"auto",color:"secondary",app:"",class:"d-flex justify-space-between"},{default:K(()=>[t("p",l0,O(n(s).brand.footerText??""),1),t("div",null,[e0,Q(" by "),t("a",t0,[t("img",{src:`data:image/svg+xml;base64,${n(c)}`,height:"11px"},null,8,a0)])])]),_:1},8,["height"]))}},n0=N(o0,[["__scopeId","data-v-7ea19f1b"]]);export{n0 as default}; diff --git a/pr-preview/pr-17/assets/Header-Br6hesNb.css b/pr-preview/pr-17/assets/Header-4JD2XOP7.css similarity index 97% rename from pr-preview/pr-17/assets/Header-Br6hesNb.css rename to pr-preview/pr-17/assets/Header-4JD2XOP7.css index f26b32f..94498ac 100644 --- a/pr-preview/pr-17/assets/Header-Br6hesNb.css +++ b/pr-preview/pr-17/assets/Header-4JD2XOP7.css @@ -1 +1 @@ -.logo[data-v-68395672]{max-width:140px}.v-app-bar{display:flex}.v-app-bar.v-toolbar{background:rgb(var(--v-theme-surface));color:rgba(var(--v-theme-on-surface),var(--v-high-emphasis-opacity))}.v-app-bar.v-toolbar:not(.v-toolbar--flat){box-shadow:0 2px 4px -1px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, .2)),0 4px 5px 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, .14)),0 1px 10px 0 var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, .12))}.v-app-bar:not(.v-toolbar--absolute){padding-inline-end:var(--v-scrollbar-offset)}.v-toolbar{align-items:flex-start;display:flex;flex:none;flex-direction:column;justify-content:space-between;max-width:100%;position:relative;transition:.2s cubic-bezier(.4,0,.2,1);transition-property:height,width,transform,max-width,left,right,top,bottom,box-shadow;width:100%;border-color:rgba(var(--v-border-color),var(--v-border-opacity));border-style:solid;border-width:0;box-shadow:0 0 0 0 var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, .2)),0 0 0 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, .14)),0 0 0 0 var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, .12));border-radius:0;background:rgb(var(--v-theme-surface-light));color:rgba(var(--v-theme-on-surface-light),var(--v-high-emphasis-opacity))}.v-toolbar--border{border-width:thin;box-shadow:none}.v-toolbar--absolute{position:absolute}.v-toolbar--collapse{max-width:112px;overflow:hidden;border-end-end-radius:24px}.v-toolbar--collapse .v-toolbar-title{display:none}.v-toolbar--flat{box-shadow:0 0 0 0 var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, .2)),0 0 0 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, .14)),0 0 0 0 var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, .12))}.v-toolbar--floating{display:inline-flex}.v-toolbar--rounded{border-radius:4px}.v-toolbar__content,.v-toolbar__extension{align-items:center;display:flex;flex:0 0 auto;position:relative;transition:inherit;width:100%}.v-toolbar__content{overflow:hidden}.v-toolbar__content>.v-btn:first-child{margin-inline-start:4px}.v-toolbar__content>.v-btn:last-child{margin-inline-end:4px}.v-toolbar__content>.v-toolbar-title{margin-inline-start:20px}.v-toolbar--density-prominent .v-toolbar__content{align-items:flex-start}.v-toolbar__image{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;opacity:var(--v-toolbar-image-opacity, 1);transition-property:opacity}.v-toolbar__prepend,.v-toolbar__append{align-items:center;align-self:stretch;display:flex}.v-toolbar__prepend{margin-inline:4px auto}.v-toolbar__append{margin-inline:auto 4px}.v-toolbar-title{flex:1 1;min-width:0;font-size:1.25rem;font-weight:400;letter-spacing:0;line-height:1.75rem;text-transform:none}.v-toolbar--density-prominent .v-toolbar-title{align-self:flex-end;padding-bottom:6px;font-size:1.5rem;font-weight:400;letter-spacing:0;line-height:2.25rem;text-transform:none}.v-toolbar-title__placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v-toolbar-items{display:flex;height:inherit;align-self:stretch}.v-toolbar-items>.v-btn{border-radius:0} +.logo[data-v-d3a5e05e]{max-width:140px}.v-app-bar{display:flex}.v-app-bar.v-toolbar{background:rgb(var(--v-theme-surface));color:rgba(var(--v-theme-on-surface),var(--v-high-emphasis-opacity))}.v-app-bar.v-toolbar:not(.v-toolbar--flat){box-shadow:0 2px 4px -1px var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, .2)),0 4px 5px 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, .14)),0 1px 10px 0 var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, .12))}.v-app-bar:not(.v-toolbar--absolute){padding-inline-end:var(--v-scrollbar-offset)}.v-toolbar{align-items:flex-start;display:flex;flex:none;flex-direction:column;justify-content:space-between;max-width:100%;position:relative;transition:.2s cubic-bezier(.4,0,.2,1);transition-property:height,width,transform,max-width,left,right,top,bottom,box-shadow;width:100%;border-color:rgba(var(--v-border-color),var(--v-border-opacity));border-style:solid;border-width:0;box-shadow:0 0 0 0 var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, .2)),0 0 0 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, .14)),0 0 0 0 var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, .12));border-radius:0;background:rgb(var(--v-theme-surface-light));color:rgba(var(--v-theme-on-surface-light),var(--v-high-emphasis-opacity))}.v-toolbar--border{border-width:thin;box-shadow:none}.v-toolbar--absolute{position:absolute}.v-toolbar--collapse{max-width:112px;overflow:hidden;border-end-end-radius:24px}.v-toolbar--collapse .v-toolbar-title{display:none}.v-toolbar--flat{box-shadow:0 0 0 0 var(--v-shadow-key-umbra-opacity, rgba(0, 0, 0, .2)),0 0 0 0 var(--v-shadow-key-penumbra-opacity, rgba(0, 0, 0, .14)),0 0 0 0 var(--v-shadow-key-ambient-opacity, rgba(0, 0, 0, .12))}.v-toolbar--floating{display:inline-flex}.v-toolbar--rounded{border-radius:4px}.v-toolbar__content,.v-toolbar__extension{align-items:center;display:flex;flex:0 0 auto;position:relative;transition:inherit;width:100%}.v-toolbar__content{overflow:hidden}.v-toolbar__content>.v-btn:first-child{margin-inline-start:4px}.v-toolbar__content>.v-btn:last-child{margin-inline-end:4px}.v-toolbar__content>.v-toolbar-title{margin-inline-start:20px}.v-toolbar--density-prominent .v-toolbar__content{align-items:flex-start}.v-toolbar__image{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;opacity:var(--v-toolbar-image-opacity, 1);transition-property:opacity}.v-toolbar__prepend,.v-toolbar__append{align-items:center;align-self:stretch;display:flex}.v-toolbar__prepend{margin-inline:4px auto}.v-toolbar__append{margin-inline:auto 4px}.v-toolbar-title{flex:1 1;min-width:0;font-size:1.25rem;font-weight:400;letter-spacing:0;line-height:1.75rem;text-transform:none}.v-toolbar--density-prominent .v-toolbar-title{align-self:flex-end;padding-bottom:6px;font-size:1.5rem;font-weight:400;letter-spacing:0;line-height:2.25rem;text-transform:none}.v-toolbar-title__placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v-toolbar-items{display:flex;height:inherit;align-self:stretch}.v-toolbar-items>.v-btn{border-radius:0} diff --git a/pr-preview/pr-17/assets/Header-Dfd8X5Yy.js b/pr-preview/pr-17/assets/Header-CsT-f4dc.js similarity index 96% rename from pr-preview/pr-17/assets/Header-Dfd8X5Yy.js rename to pr-preview/pr-17/assets/Header-CsT-f4dc.js index ec0ef95..8f6152c 100644 --- a/pr-preview/pr-17/assets/Header-Dfd8X5Yy.js +++ b/pr-preview/pr-17/assets/Header-CsT-f4dc.js @@ -1 +1 @@ -import{p as V,e as N,f as w,g as _,a as p,b as o,ae as z,af as F,ag as $,h as K,Q as O,R as k,ah as Q,ai as W,aj as Y,i as Z,j as G,s as y,c as r,S as J,ak as B,C as T,r as R,al as X,w as x,Z as ee,am as ae,an as te,y as le,ao as oe,ap as se,d as E,aq as ne,_ as re,x as ue,W as ie,$ as ce,a0 as de,a1 as P,a8 as ve,aa as me,a3 as C}from"./index-DBoWNDl8.js";import{V as A}from"./VImg-DhEwC7r1.js";import{a as ge}from"./index-Btx7hSs2.js";import{u as fe}from"./ssrBoot-CqR98f8O.js";import"./transition-C0IRM1SU.js";const L=V({text:String,...N(),...w()},"VToolbarTitle"),D=_()({name:"VToolbarTitle",props:L(),setup(e,u){let{slots:a}=u;return p(()=>{const i=!!(a.default||a.text||e.text);return o(e.tag,{class:["v-toolbar-title",e.class],style:e.style},{default:()=>[i&&o("div",{class:"v-toolbar-title__placeholder"},[a.text?a.text():e.text,a.default?.()])]})}),{}}}),he=[null,"prominent","default","comfortable","compact"],U=V({absolute:Boolean,collapse:Boolean,color:String,density:{type:String,default:"default",validator:e=>he.includes(e)},extended:Boolean,extensionHeight:{type:[Number,String],default:48},flat:Boolean,floating:Boolean,height:{type:[Number,String],default:64},image:String,title:String,...z(),...N(),...F(),...$(),...w({tag:"header"}),...K()},"VToolbar"),I=_()({name:"VToolbar",props:U(),setup(e,u){let{slots:a}=u;const{backgroundColorClasses:i,backgroundColorStyles:s}=O(k(e,"color")),{borderClasses:t}=Q(e),{elevationClasses:m}=W(e),{roundedClasses:d}=Y(e),{themeClasses:g}=Z(e),{rtlClasses:h}=G(),n=y(!!(e.extended||a.extension?.())),f=r(()=>parseInt(Number(e.height)+(e.density==="prominent"?Number(e.height):0)-(e.density==="comfortable"?8:0)-(e.density==="compact"?16:0),10)),v=r(()=>n.value?parseInt(Number(e.extensionHeight)+(e.density==="prominent"?Number(e.extensionHeight):0)-(e.density==="comfortable"?4:0)-(e.density==="compact"?8:0),10):0);return J({VBtn:{variant:"text"}}),p(()=>{const c=!!(e.title||a.title),b=!!(a.image||e.image),S=a.extension?.();return n.value=!!(e.extended||S),o(e.tag,{class:["v-toolbar",{"v-toolbar--absolute":e.absolute,"v-toolbar--collapse":e.collapse,"v-toolbar--flat":e.flat,"v-toolbar--floating":e.floating,[`v-toolbar--density-${e.density}`]:!0},i.value,t.value,m.value,d.value,g.value,h.value,e.class],style:[s.value,e.style]},{default:()=>[b&&o("div",{key:"image",class:"v-toolbar__image"},[a.image?o(B,{key:"image-defaults",disabled:!e.image,defaults:{VImg:{cover:!0,src:e.image}}},a.image):o(A,{key:"image-img",cover:!0,src:e.image},null)]),o(B,{defaults:{VTabs:{height:T(f.value)}}},{default:()=>[o("div",{class:"v-toolbar__content",style:{height:T(f.value)}},[a.prepend&&o("div",{class:"v-toolbar__prepend"},[a.prepend?.()]),c&&o(D,{key:"title",text:e.title},{text:a.title}),a.default?.(),a.append&&o("div",{class:"v-toolbar__append"},[a.append?.()])])]}),o(B,{defaults:{VTabs:{height:T(v.value)}}},{default:()=>[o(ge,null,{default:()=>[n.value&&o("div",{class:"v-toolbar__extension",style:{height:T(v.value)}},[S])]})]})]})}),{contentHeight:f,extensionHeight:v}}}),be=V({scrollTarget:{type:String},scrollThreshold:{type:[String,Number],default:300}},"scroll");function ye(e){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{canScroll:a}=u;let i=0;const s=R(null),t=y(0),m=y(0),d=y(0),g=y(!1),h=y(!1),n=r(()=>Number(e.scrollThreshold)),f=r(()=>X((n.value-t.value)/n.value||0)),v=()=>{const c=s.value;!c||a&&!a.value||(i=t.value,t.value="window"in c?c.pageYOffset:c.scrollTop,h.value=t.value{m.value=m.value||t.value}),x(g,()=>{m.value=0}),ee(()=>{x(()=>e.scrollTarget,c=>{const b=c?document.querySelector(c):window;b&&b!==s.value&&(s.value?.removeEventListener("scroll",v),s.value=b,s.value.addEventListener("scroll",v,{passive:!0}))},{immediate:!0})}),ae(()=>{s.value?.removeEventListener("scroll",v)}),a&&x(a,v,{immediate:!0}),{scrollThreshold:n,currentScroll:t,currentThreshold:d,isScrollActive:g,scrollRatio:f,isScrollingUp:h,savedScroll:m}}const Se=V({scrollBehavior:String,modelValue:{type:Boolean,default:!0},location:{type:String,default:"top",validator:e=>["top","bottom"].includes(e)},...U(),...te(),...be(),height:{type:[Number,String],default:64}},"VAppBar"),Te=_()({name:"VAppBar",props:Se(),emits:{"update:modelValue":e=>!0},setup(e,u){let{slots:a}=u;const i=R(),s=le(e,"modelValue"),t=r(()=>{const l=new Set(e.scrollBehavior?.split(" ")??[]);return{hide:l.has("hide"),fullyHide:l.has("fully-hide"),inverted:l.has("inverted"),collapse:l.has("collapse"),elevate:l.has("elevate"),fadeImage:l.has("fade-image")}}),m=r(()=>{const l=t.value;return l.hide||l.fullyHide||l.inverted||l.collapse||l.elevate||l.fadeImage||!s.value}),{currentScroll:d,scrollThreshold:g,isScrollingUp:h,scrollRatio:n}=ye(e,{canScroll:m}),f=r(()=>t.value.hide||t.value.fullyHide),v=r(()=>e.collapse||t.value.collapse&&(t.value.inverted?n.value>0:n.value===0)),c=r(()=>e.flat||t.value.fullyHide&&!s.value||t.value.elevate&&(t.value.inverted?d.value>0:d.value===0)),b=r(()=>t.value.fadeImage?t.value.inverted?1-n.value:n.value:void 0),S=r(()=>{const l=Number(i.value?.contentHeight??e.height),H=Number(i.value?.extensionHeight??0);return f.value?d.value!!e.scrollBehavior),()=>{ne(()=>{f.value?t.value.inverted?s.value=d.value>g.value:s.value=h.value||d.valueparseInt(e.order,10)),position:k(e,"location"),layoutSize:S,elementSize:y(void 0),active:s,absolute:k(e,"absolute")});return p(()=>{const l=I.filterProps(e);return o(I,E({ref:i,class:["v-app-bar",{"v-app-bar--bottom":e.location==="bottom"},e.class],style:[{...M.value,"--v-toolbar-image-opacity":b.value,height:void 0,...j.value},e.style]},l,{collapse:v.value,flat:c.value}),a)}),q}}),xe=_()({name:"VAppBarTitle",props:L(),setup(e,u){let{slots:a}=u;return p(()=>o(D,E(e,{class:"v-app-bar-title"}),a)),{}}}),Ve={__name:"Header",setup(e){const u=ue(ie),a=u.brand?.name;return(i,s)=>(ce(),de(Te,{color:"primary"},{default:P(()=>[o(xe,null,{default:P(()=>[ve(me(C(a)),1)]),_:1}),o(A,{class:"mx-12 logo",src:C(u).brand?.logo},null,8,["src"])]),_:1}))}},Pe=re(Ve,[["__scopeId","data-v-68395672"]]);export{Pe as default}; +import{p as V,e as N,f as w,g as _,a as p,b as o,ae as z,af as F,ag as $,h as K,Q as O,R as k,ah as Q,ai as W,aj as Y,i as Z,j as G,s as y,c as r,S as J,ak as B,C as T,r as R,al as X,w as x,Z as ee,am as ae,an as te,y as le,ao as oe,ap as se,d as E,aq as ne,_ as re,x as ue,W as ie,$ as ce,a0 as de,a1 as P,a8 as ve,aa as me,a3 as C}from"./index-B5c5Pwhg.js";import{V as A}from"./VImg-3feAnqWP.js";import{a as ge}from"./index-Dr4JVqt9.js";import{u as fe}from"./ssrBoot-n6JOT_u2.js";import"./transition-DCXsv86C.js";const L=V({text:String,...N(),...w()},"VToolbarTitle"),D=_()({name:"VToolbarTitle",props:L(),setup(e,u){let{slots:a}=u;return p(()=>{const i=!!(a.default||a.text||e.text);return o(e.tag,{class:["v-toolbar-title",e.class],style:e.style},{default:()=>[i&&o("div",{class:"v-toolbar-title__placeholder"},[a.text?a.text():e.text,a.default?.()])]})}),{}}}),he=[null,"prominent","default","comfortable","compact"],U=V({absolute:Boolean,collapse:Boolean,color:String,density:{type:String,default:"default",validator:e=>he.includes(e)},extended:Boolean,extensionHeight:{type:[Number,String],default:48},flat:Boolean,floating:Boolean,height:{type:[Number,String],default:64},image:String,title:String,...z(),...N(),...F(),...$(),...w({tag:"header"}),...K()},"VToolbar"),I=_()({name:"VToolbar",props:U(),setup(e,u){let{slots:a}=u;const{backgroundColorClasses:i,backgroundColorStyles:s}=O(k(e,"color")),{borderClasses:t}=Q(e),{elevationClasses:m}=W(e),{roundedClasses:d}=Y(e),{themeClasses:g}=Z(e),{rtlClasses:h}=G(),n=y(!!(e.extended||a.extension?.())),f=r(()=>parseInt(Number(e.height)+(e.density==="prominent"?Number(e.height):0)-(e.density==="comfortable"?8:0)-(e.density==="compact"?16:0),10)),v=r(()=>n.value?parseInt(Number(e.extensionHeight)+(e.density==="prominent"?Number(e.extensionHeight):0)-(e.density==="comfortable"?4:0)-(e.density==="compact"?8:0),10):0);return J({VBtn:{variant:"text"}}),p(()=>{const c=!!(e.title||a.title),b=!!(a.image||e.image),S=a.extension?.();return n.value=!!(e.extended||S),o(e.tag,{class:["v-toolbar",{"v-toolbar--absolute":e.absolute,"v-toolbar--collapse":e.collapse,"v-toolbar--flat":e.flat,"v-toolbar--floating":e.floating,[`v-toolbar--density-${e.density}`]:!0},i.value,t.value,m.value,d.value,g.value,h.value,e.class],style:[s.value,e.style]},{default:()=>[b&&o("div",{key:"image",class:"v-toolbar__image"},[a.image?o(B,{key:"image-defaults",disabled:!e.image,defaults:{VImg:{cover:!0,src:e.image}}},a.image):o(A,{key:"image-img",cover:!0,src:e.image},null)]),o(B,{defaults:{VTabs:{height:T(f.value)}}},{default:()=>[o("div",{class:"v-toolbar__content",style:{height:T(f.value)}},[a.prepend&&o("div",{class:"v-toolbar__prepend"},[a.prepend?.()]),c&&o(D,{key:"title",text:e.title},{text:a.title}),a.default?.(),a.append&&o("div",{class:"v-toolbar__append"},[a.append?.()])])]}),o(B,{defaults:{VTabs:{height:T(v.value)}}},{default:()=>[o(ge,null,{default:()=>[n.value&&o("div",{class:"v-toolbar__extension",style:{height:T(v.value)}},[S])]})]})]})}),{contentHeight:f,extensionHeight:v}}}),be=V({scrollTarget:{type:String},scrollThreshold:{type:[String,Number],default:300}},"scroll");function ye(e){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{canScroll:a}=u;let i=0;const s=R(null),t=y(0),m=y(0),d=y(0),g=y(!1),h=y(!1),n=r(()=>Number(e.scrollThreshold)),f=r(()=>X((n.value-t.value)/n.value||0)),v=()=>{const c=s.value;!c||a&&!a.value||(i=t.value,t.value="window"in c?c.pageYOffset:c.scrollTop,h.value=t.value{m.value=m.value||t.value}),x(g,()=>{m.value=0}),ee(()=>{x(()=>e.scrollTarget,c=>{const b=c?document.querySelector(c):window;b&&b!==s.value&&(s.value?.removeEventListener("scroll",v),s.value=b,s.value.addEventListener("scroll",v,{passive:!0}))},{immediate:!0})}),ae(()=>{s.value?.removeEventListener("scroll",v)}),a&&x(a,v,{immediate:!0}),{scrollThreshold:n,currentScroll:t,currentThreshold:d,isScrollActive:g,scrollRatio:f,isScrollingUp:h,savedScroll:m}}const Se=V({scrollBehavior:String,modelValue:{type:Boolean,default:!0},location:{type:String,default:"top",validator:e=>["top","bottom"].includes(e)},...U(),...te(),...be(),height:{type:[Number,String],default:64}},"VAppBar"),Te=_()({name:"VAppBar",props:Se(),emits:{"update:modelValue":e=>!0},setup(e,u){let{slots:a}=u;const i=R(),s=le(e,"modelValue"),t=r(()=>{const l=new Set(e.scrollBehavior?.split(" ")??[]);return{hide:l.has("hide"),fullyHide:l.has("fully-hide"),inverted:l.has("inverted"),collapse:l.has("collapse"),elevate:l.has("elevate"),fadeImage:l.has("fade-image")}}),m=r(()=>{const l=t.value;return l.hide||l.fullyHide||l.inverted||l.collapse||l.elevate||l.fadeImage||!s.value}),{currentScroll:d,scrollThreshold:g,isScrollingUp:h,scrollRatio:n}=ye(e,{canScroll:m}),f=r(()=>t.value.hide||t.value.fullyHide),v=r(()=>e.collapse||t.value.collapse&&(t.value.inverted?n.value>0:n.value===0)),c=r(()=>e.flat||t.value.fullyHide&&!s.value||t.value.elevate&&(t.value.inverted?d.value>0:d.value===0)),b=r(()=>t.value.fadeImage?t.value.inverted?1-n.value:n.value:void 0),S=r(()=>{const l=Number(i.value?.contentHeight??e.height),H=Number(i.value?.extensionHeight??0);return f.value?d.value!!e.scrollBehavior),()=>{ne(()=>{f.value?t.value.inverted?s.value=d.value>g.value:s.value=h.value||d.valueparseInt(e.order,10)),position:k(e,"location"),layoutSize:S,elementSize:y(void 0),active:s,absolute:k(e,"absolute")});return p(()=>{const l=I.filterProps(e);return o(I,E({ref:i,class:["v-app-bar",{"v-app-bar--bottom":e.location==="bottom"},e.class],style:[{...M.value,"--v-toolbar-image-opacity":b.value,height:void 0,...j.value},e.style]},l,{collapse:v.value,flat:c.value}),a)}),q}}),xe=_()({name:"VAppBarTitle",props:L(),setup(e,u){let{slots:a}=u;return p(()=>o(D,E(e,{class:"v-app-bar-title"}),a)),{}}}),Ve={__name:"Header",setup(e){const u=ue(ie),a=u.brand?.name;return(i,s)=>(ce(),de(Te,{color:"primary"},{default:P(()=>[o(xe,null,{default:P(()=>[ve(me(C(a)),1)]),_:1}),o(A,{class:"mx-12 logo",src:C(u).brand?.logo},null,8,["src"])]),_:1}))}},Pe=re(Ve,[["__scopeId","data-v-d3a5e05e"]]);export{Pe as default}; diff --git a/pr-preview/pr-17/assets/IframeWrapper-eYsaXiMX.js b/pr-preview/pr-17/assets/IframeWrapper-C4CvwRIS.js similarity index 73% rename from pr-preview/pr-17/assets/IframeWrapper-eYsaXiMX.js rename to pr-preview/pr-17/assets/IframeWrapper-C4CvwRIS.js index 6ea1a6f..6e4f1d9 100644 --- a/pr-preview/pr-17/assets/IframeWrapper-eYsaXiMX.js +++ b/pr-preview/pr-17/assets/IframeWrapper-C4CvwRIS.js @@ -1 +1 @@ -import{$ as r,a6 as t}from"./index-DBoWNDl8.js";const s=["src"],i={__name:"IframeWrapper",props:{src:{type:String,required:!0}},setup(e){return(c,a)=>(r(),t("iframe",{src:e.src,class:"fill-height fill-width"},null,8,s))}};export{i as default}; +import{$ as r,a6 as t}from"./index-B5c5Pwhg.js";const s=["src"],i={__name:"IframeWrapper",props:{src:{type:String,required:!0}},setup(e){return(c,a)=>(r(),t("iframe",{src:e.src,class:"fill-height fill-width"},null,8,s))}};export{i as default}; diff --git a/pr-preview/pr-17/assets/List--VIz7rR0.js b/pr-preview/pr-17/assets/List-C_m6Eil9.js similarity index 96% rename from pr-preview/pr-17/assets/List--VIz7rR0.js rename to pr-preview/pr-17/assets/List-C_m6Eil9.js index ba68973..ce1321d 100644 --- a/pr-preview/pr-17/assets/List--VIz7rR0.js +++ b/pr-preview/pr-17/assets/List-C_m6Eil9.js @@ -1 +1 @@ -import{g as V,e as A,S as _e,a as w,b as r,p as I,f as N,b2 as Te,I as L,O as W,ag as J,b3 as nt,h as q,b4 as Y,i as Q,b5 as oe,P as Z,aj as ee,b6 as lt,M as H,ak as j,b7 as de,F as U,ae as ve,ac as fe,af as me,b8 as it,b9 as st,ba as rt,bb as Oe,bc as Me,ah as ye,ad as ge,ai as be,bd as ct,be as ut,bf as ot,bg as Ne,c as m,t as Se,v as je,bh as dt,x as te,s as z,q as ae,aL as x,bi as Fe,r as p,y as se,am as De,aH as vt,R as h,aQ as ft,bj as mt,B as yt,bk as Ae,w as gt,bl as bt,u as Ge,C as we,d as Pe,bm as St,Q as ht,bn as kt,bo as $,o as Ct,bp as It,aU as Vt,au as pe,$ as re,a0 as Le,a1 as xe,a6 as At,a7 as wt}from"./index-DBoWNDl8.js";import{V as Re}from"./VImg-DhEwC7r1.js";import{a as Pt}from"./index-Btx7hSs2.js";import{u as pt}from"./ssrBoot-CqR98f8O.js";import{M as Lt}from"./transition-C0IRM1SU.js";const xt=V()({name:"VCardActions",props:A(),setup(e,i){let{slots:t}=i;return _e({VBtn:{slim:!0,variant:"text"}}),w(()=>r("div",{class:["v-card-actions",e.class],style:e.style},[t.default?.()])),{}}}),Bt=I({opacity:[Number,String],...A(),...N()},"VCardSubtitle"),_t=V()({name:"VCardSubtitle",props:Bt(),setup(e,i){let{slots:t}=i;return w(()=>r(e.tag,{class:["v-card-subtitle",e.class],style:[{"--v-card-subtitle-opacity":e.opacity},e.style]},t)),{}}}),Tt=Te("v-card-title"),Ot=I({start:Boolean,end:Boolean,icon:L,image:String,text:String,...A(),...W(),...J(),...nt(),...N(),...q(),...Y({variant:"flat"})},"VAvatar"),X=V()({name:"VAvatar",props:Ot(),setup(e,i){let{slots:t}=i;const{themeClasses:a}=Q(e),{colorClasses:l,colorStyles:n,variantClasses:s}=oe(e),{densityClasses:u}=Z(e),{roundedClasses:v}=ee(e),{sizeClasses:y,sizeStyles:d}=lt(e);return w(()=>r(e.tag,{class:["v-avatar",{"v-avatar--start":e.start,"v-avatar--end":e.end},a.value,l.value,u.value,v.value,y.value,s.value,e.class],style:[n.value,d.value,e.style]},{default:()=>[t.default?r(j,{key:"content-defaults",defaults:{VImg:{cover:!0,image:e.image},VIcon:{icon:e.icon}}},{default:()=>[t.default()]}):e.image?r(Re,{key:"image",src:e.image,alt:"",cover:!0},null):e.icon?r(H,{key:"icon",icon:e.icon},null):e.text,de(!1,"v-avatar")]})),{}}}),Mt=I({appendAvatar:String,appendIcon:L,prependAvatar:String,prependIcon:L,subtitle:[String,Number],title:[String,Number],...A(),...W()},"VCardItem"),Nt=V()({name:"VCardItem",props:Mt(),setup(e,i){let{slots:t}=i;return w(()=>{const a=!!(e.prependAvatar||e.prependIcon),l=!!(a||t.prepend),n=!!(e.appendAvatar||e.appendIcon),s=!!(n||t.append),u=!!(e.title!=null||t.title),v=!!(e.subtitle!=null||t.subtitle);return r("div",{class:["v-card-item",e.class],style:e.style},[l&&r("div",{key:"prepend",class:"v-card-item__prepend"},[t.prepend?r(j,{key:"prepend-defaults",disabled:!a,defaults:{VAvatar:{density:e.density,image:e.prependAvatar},VIcon:{density:e.density,icon:e.prependIcon}}},t.prepend):r(U,null,[e.prependAvatar&&r(X,{key:"prepend-avatar",density:e.density,image:e.prependAvatar},null),e.prependIcon&&r(H,{key:"prepend-icon",density:e.density,icon:e.prependIcon},null)])]),r("div",{class:"v-card-item__content"},[u&&r(Tt,{key:"title"},{default:()=>[t.title?.()??e.title]}),v&&r(_t,{key:"subtitle"},{default:()=>[t.subtitle?.()??e.subtitle]}),t.default?.()]),s&&r("div",{key:"append",class:"v-card-item__append"},[t.append?r(j,{key:"append-defaults",disabled:!n,defaults:{VAvatar:{density:e.density,image:e.appendAvatar},VIcon:{density:e.density,icon:e.appendIcon}}},t.append):r(U,null,[e.appendIcon&&r(H,{key:"append-icon",density:e.density,icon:e.appendIcon},null),e.appendAvatar&&r(X,{key:"append-avatar",density:e.density,image:e.appendAvatar},null)])])])}),{}}}),jt=I({opacity:[Number,String],...A(),...N()},"VCardText"),Ft=V()({name:"VCardText",props:jt(),setup(e,i){let{slots:t}=i;return w(()=>r(e.tag,{class:["v-card-text",e.class],style:[{"--v-card-text-opacity":e.opacity},e.style]},t)),{}}}),Dt=I({appendAvatar:String,appendIcon:L,disabled:Boolean,flat:Boolean,hover:Boolean,image:String,link:{type:Boolean,default:void 0},prependAvatar:String,prependIcon:L,ripple:{type:[Boolean,Object],default:!0},subtitle:[String,Number],text:[String,Number],title:[String,Number],...ve(),...A(),...W(),...fe(),...me(),...it(),...st(),...rt(),...J(),...Oe(),...N(),...q(),...Y({variant:"elevated"})},"VCard"),Gt=V()({name:"VCard",directives:{Ripple:Me},props:Dt(),setup(e,i){let{attrs:t,slots:a}=i;const{themeClasses:l}=Q(e),{borderClasses:n}=ye(e),{colorClasses:s,colorStyles:u,variantClasses:v}=oe(e),{densityClasses:y}=Z(e),{dimensionStyles:d}=ge(e),{elevationClasses:b}=be(e),{loaderClasses:S}=ct(e),{locationStyles:c}=ut(e),{positionClasses:o}=ot(e),{roundedClasses:f}=ee(e),g=Ne(e,t),B=m(()=>e.link!==!1&&g.isLink.value),_=m(()=>!e.disabled&&e.link!==!1&&(e.link||g.isClickable.value));return w(()=>{const P=B.value?"a":e.tag,O=!!(a.title||e.title!=null),M=!!(a.subtitle||e.subtitle!=null),F=O||M,D=!!(a.append||e.appendAvatar||e.appendIcon),G=!!(a.prepend||e.prependAvatar||e.prependIcon),R=!!(a.image||e.image),E=F||G||D,T=!!(a.text||e.text!=null);return Se(r(P,{class:["v-card",{"v-card--disabled":e.disabled,"v-card--flat":e.flat,"v-card--hover":e.hover&&!(e.disabled||e.flat),"v-card--link":_.value},l.value,n.value,s.value,y.value,b.value,S.value,o.value,f.value,v.value,e.class],style:[u.value,d.value,c.value,e.style],href:g.href.value,onClick:_.value&&g.navigate,tabindex:e.disabled?-1:void 0},{default:()=>[R&&r("div",{key:"image",class:"v-card__image"},[a.image?r(j,{key:"image-defaults",disabled:!e.image,defaults:{VImg:{cover:!0,src:e.image}}},a.image):r(Re,{key:"image-img",cover:!0,src:e.image},null)]),r(dt,{name:"v-card",active:!!e.loading,color:typeof e.loading=="boolean"?void 0:e.loading},{default:a.loader}),E&&r(Nt,{key:"item",prependAvatar:e.prependAvatar,prependIcon:e.prependIcon,title:e.title,subtitle:e.subtitle,appendAvatar:e.appendAvatar,appendIcon:e.appendIcon},{default:a.item,prepend:a.prepend,title:a.title,subtitle:a.subtitle,append:a.append}),T&&r(Ft,{key:"text"},{default:()=>[a.text?.()??e.text]}),a.default?.(),a.actions&&r(xt,null,{default:a.actions}),de(_.value,"v-card")]}),[[je("ripple"),_.value&&e.ripple]])}),{}}}),ce=Symbol.for("vuetify:list");function Ee(){const e=te(ce,{hasPrepend:z(!1),updateHasPrepend:()=>null}),i={hasPrepend:z(!1),updateHasPrepend:t=>{t&&(i.hasPrepend.value=t)}};return ae(ce,i),e}function $e(){return te(ce,null)}const he=e=>{const i={activate:t=>{let{id:a,value:l,activated:n}=t;return a=x(a),e&&!l&&n.size===1&&n.has(a)||(l?n.add(a):n.delete(a)),n},in:(t,a,l)=>{let n=new Set;if(t!=null)for(const s of Fe(t))n=i.activate({id:s,value:!0,activated:new Set(n),children:a,parents:l});return n},out:t=>Array.from(t)};return i},He=e=>{const i=he(e);return{activate:a=>{let{activated:l,id:n,...s}=a;n=x(n);const u=l.has(n)?new Set([n]):new Set;return i.activate({...s,id:n,activated:u})},in:(a,l,n)=>{let s=new Set;if(a!=null){const u=Fe(a);u.length&&(s=i.in(u.slice(0,1),l,n))}return s},out:(a,l,n)=>i.out(a,l,n)}},Rt=e=>{const i=he(e);return{activate:a=>{let{id:l,activated:n,children:s,...u}=a;return l=x(l),s.has(l)?n:i.activate({id:l,activated:n,children:s,...u})},in:i.in,out:i.out}},Et=e=>{const i=He(e);return{activate:a=>{let{id:l,activated:n,children:s,...u}=a;return l=x(l),s.has(l)?n:i.activate({id:l,activated:n,children:s,...u})},in:i.in,out:i.out}},$t={open:e=>{let{id:i,value:t,opened:a,parents:l}=e;if(t){const n=new Set;n.add(i);let s=l.get(i);for(;s!=null;)n.add(s),s=l.get(s);return n}else return a.delete(i),a},select:()=>null},Ue={open:e=>{let{id:i,value:t,opened:a,parents:l}=e;if(t){let n=l.get(i);for(a.add(i);n!=null&&n!==i;)a.add(n),n=l.get(n);return a}else a.delete(i);return a},select:()=>null},Ht={open:Ue.open,select:e=>{let{id:i,value:t,opened:a,parents:l}=e;if(!t)return a;const n=[];let s=l.get(i);for(;s!=null;)n.push(s),s=l.get(s);return new Set(n)}},ke=e=>{const i={select:t=>{let{id:a,value:l,selected:n}=t;if(a=x(a),e&&!l){const s=Array.from(n.entries()).reduce((u,v)=>{let[y,d]=v;return d==="on"&&u.push(y),u},[]);if(s.length===1&&s[0]===a)return n}return n.set(a,l?"on":"off"),n},in:(t,a,l)=>{let n=new Map;for(const s of t||[])n=i.select({id:s,value:!0,selected:new Map(n),children:a,parents:l});return n},out:t=>{const a=[];for(const[l,n]of t.entries())n==="on"&&a.push(l);return a}};return i},ze=e=>{const i=ke(e);return{select:a=>{let{selected:l,id:n,...s}=a;n=x(n);const u=l.has(n)?new Map([[n,l.get(n)]]):new Map;return i.select({...s,id:n,selected:u})},in:(a,l,n)=>{let s=new Map;return a?.length&&(s=i.in(a.slice(0,1),l,n)),s},out:(a,l,n)=>i.out(a,l,n)}},Ut=e=>{const i=ke(e);return{select:a=>{let{id:l,selected:n,children:s,...u}=a;return l=x(l),s.has(l)?n:i.select({id:l,selected:n,children:s,...u})},in:i.in,out:i.out}},zt=e=>{const i=ze(e);return{select:a=>{let{id:l,selected:n,children:s,...u}=a;return l=x(l),s.has(l)?n:i.select({id:l,selected:n,children:s,...u})},in:i.in,out:i.out}},Kt=e=>{const i={select:t=>{let{id:a,value:l,selected:n,children:s,parents:u}=t;a=x(a);const v=new Map(n),y=[a];for(;y.length;){const b=y.shift();n.set(b,l?"on":"off"),s.has(b)&&y.push(...s.get(b))}let d=u.get(a);for(;d;){const b=s.get(d),S=b.every(o=>n.get(o)==="on"),c=b.every(o=>!n.has(o)||n.get(o)==="off");n.set(d,S?"on":c?"off":"indeterminate"),d=u.get(d)}return e&&!l&&Array.from(n.entries()).reduce((S,c)=>{let[o,f]=c;return f==="on"&&S.push(o),S},[]).length===0?v:n},in:(t,a,l)=>{let n=new Map;for(const s of t||[])n=i.select({id:s,value:!0,selected:new Map(n),children:a,parents:l});return n},out:(t,a)=>{const l=[];for(const[n,s]of t.entries())s==="on"&&!a.has(n)&&l.push(n);return l}};return i},K=Symbol.for("vuetify:nested"),Ke={id:z(),root:{register:()=>null,unregister:()=>null,parents:p(new Map),children:p(new Map),open:()=>null,openOnSelect:()=>null,activate:()=>null,select:()=>null,activatable:p(!1),selectable:p(!1),opened:p(new Set),activated:p(new Set),selected:p(new Map),selectedValues:p([])}},Wt=I({activatable:Boolean,selectable:Boolean,activeStrategy:[String,Function,Object],selectStrategy:[String,Function,Object],openStrategy:[String,Object],opened:null,activated:null,selected:null,mandatory:Boolean},"nested"),qt=e=>{let i=!1;const t=p(new Map),a=p(new Map),l=se(e,"opened",e.opened,c=>new Set(c),c=>[...c.values()]),n=m(()=>{if(typeof e.activeStrategy=="object")return e.activeStrategy;if(typeof e.activeStrategy=="function")return e.activeStrategy(e.mandatory);switch(e.activeStrategy){case"leaf":return Rt(e.mandatory);case"single-leaf":return Et(e.mandatory);case"independent":return he(e.mandatory);case"single-independent":default:return He(e.mandatory)}}),s=m(()=>{if(typeof e.selectStrategy=="object")return e.selectStrategy;if(typeof e.selectStrategy=="function")return e.selectStrategy(e.mandatory);switch(e.selectStrategy){case"single-leaf":return zt(e.mandatory);case"leaf":return Ut(e.mandatory);case"independent":return ke(e.mandatory);case"single-independent":return ze(e.mandatory);case"classic":default:return Kt(e.mandatory)}}),u=m(()=>{if(typeof e.openStrategy=="object")return e.openStrategy;switch(e.openStrategy){case"list":return Ht;case"single":return $t;case"multiple":default:return Ue}}),v=se(e,"activated",e.activated,c=>n.value.in(c,t.value,a.value),c=>n.value.out(c,t.value,a.value)),y=se(e,"selected",e.selected,c=>s.value.in(c,t.value,a.value),c=>s.value.out(c,t.value,a.value));De(()=>{i=!0});function d(c){const o=[];let f=c;for(;f!=null;)o.unshift(f),f=a.value.get(f);return o}const b=vt("nested"),S={id:z(),root:{opened:l,activatable:h(e,"activatable"),selectable:h(e,"selectable"),activated:v,selected:y,selectedValues:m(()=>{const c=[];for(const[o,f]of y.value.entries())f==="on"&&c.push(o);return c}),register:(c,o,f)=>{o&&c!==o&&a.value.set(c,o),f&&t.value.set(c,[]),o!=null&&t.value.set(o,[...t.value.get(o)||[],c])},unregister:c=>{if(i)return;t.value.delete(c);const o=a.value.get(c);if(o){const f=t.value.get(o)??[];t.value.set(o,f.filter(g=>g!==c))}a.value.delete(c),l.value.delete(c)},open:(c,o,f)=>{b.emit("click:open",{id:c,value:o,path:d(c),event:f});const g=u.value.open({id:c,value:o,opened:new Set(l.value),children:t.value,parents:a.value,event:f});g&&(l.value=g)},openOnSelect:(c,o,f)=>{const g=u.value.select({id:c,value:o,selected:new Map(y.value),opened:new Set(l.value),children:t.value,parents:a.value,event:f});g&&(l.value=g)},select:(c,o,f)=>{b.emit("click:select",{id:c,value:o,path:d(c),event:f});const g=s.value.select({id:c,value:o,selected:new Map(y.value),children:t.value,parents:a.value,event:f});g&&(y.value=g),S.root.openOnSelect(c,o,f)},activate:(c,o,f)=>{if(!e.activatable)return S.root.select(c,!0,f);b.emit("click:activate",{id:c,value:o,path:d(c),event:f});const g=n.value.activate({id:c,value:o,activated:new Set(v.value),children:t.value,parents:a.value,event:f});g&&(v.value=g)},children:t,parents:a}};return ae(K,S),S.root},We=(e,i)=>{const t=te(K,Ke),a=Symbol(ft()),l=m(()=>e.value!==void 0?e.value:a),n={...t,id:l,open:(s,u)=>t.root.open(l.value,s,u),openOnSelect:(s,u)=>t.root.openOnSelect(l.value,s,u),isOpen:m(()=>t.root.opened.value.has(l.value)),parent:m(()=>t.root.parents.value.get(l.value)),activate:(s,u)=>t.root.activate(l.value,s,u),isActivated:m(()=>t.root.activated.value.has(x(l.value))),select:(s,u)=>t.root.select(l.value,s,u),isSelected:m(()=>t.root.selected.value.get(x(l.value))==="on"),isIndeterminate:m(()=>t.root.selected.value.get(l.value)==="indeterminate"),isLeaf:m(()=>!t.root.children.value.get(l.value)),isGroupActivator:t.isGroupActivator};return!t.isGroupActivator&&t.root.register(l.value,t.id.value,i),De(()=>{!t.isGroupActivator&&t.root.unregister(l.value)}),i&&ae(K,n),n},Qt=()=>{const e=te(K,Ke);ae(K,{...e,isGroupActivator:!0})},Xt=mt({name:"VListGroupActivator",setup(e,i){let{slots:t}=i;return Qt(),()=>t.default?.()}}),Jt=I({activeColor:String,baseColor:String,color:String,collapseIcon:{type:L,default:"$collapse"},expandIcon:{type:L,default:"$expand"},prependIcon:L,appendIcon:L,fluid:Boolean,subgroup:Boolean,title:String,value:null,...A(),...N()},"VListGroup"),Be=V()({name:"VListGroup",props:Jt(),setup(e,i){let{slots:t}=i;const{isOpen:a,open:l,id:n}=We(h(e,"value"),!0),s=m(()=>`v-list-group--id-${String(n.value)}`),u=$e(),{isBooted:v}=pt();function y(c){l(!a.value,c)}const d=m(()=>({onClick:y,class:"v-list-group__header",id:s.value})),b=m(()=>a.value?e.collapseIcon:e.expandIcon),S=m(()=>({VListItem:{active:a.value,activeColor:e.activeColor,baseColor:e.baseColor,color:e.color,prependIcon:e.prependIcon||e.subgroup&&b.value,appendIcon:e.appendIcon||!e.subgroup&&b.value,title:e.title,value:e.value}}));return w(()=>r(e.tag,{class:["v-list-group",{"v-list-group--prepend":u?.hasPrepend.value,"v-list-group--fluid":e.fluid,"v-list-group--subgroup":e.subgroup,"v-list-group--open":a.value},e.class],style:e.style},{default:()=>[t.activator&&r(j,{defaults:S.value},{default:()=>[r(Xt,null,{default:()=>[t.activator({props:d.value,isOpen:a.value})]})]}),r(Lt,{transition:{component:Pt},disabled:!v.value},{default:()=>[Se(r("div",{class:"v-list-group__items",role:"group","aria-labelledby":s.value},[t.default?.()]),[[yt,a.value]])]})]})),{isOpen:a}}}),Yt=I({opacity:[Number,String],...A(),...N()},"VListItemSubtitle"),Zt=V()({name:"VListItemSubtitle",props:Yt(),setup(e,i){let{slots:t}=i;return w(()=>r(e.tag,{class:["v-list-item-subtitle",e.class],style:[{"--v-list-item-subtitle-opacity":e.opacity},e.style]},t)),{}}}),ea=Te("v-list-item-title"),ta=I({active:{type:Boolean,default:void 0},activeClass:String,activeColor:String,appendAvatar:String,appendIcon:L,baseColor:String,disabled:Boolean,lines:[Boolean,String],link:{type:Boolean,default:void 0},nav:Boolean,prependAvatar:String,prependIcon:L,ripple:{type:[Boolean,Object],default:!0},slim:Boolean,subtitle:[String,Number],title:[String,Number],value:null,onClick:Ae(),onClickOnce:Ae(),...ve(),...A(),...W(),...fe(),...me(),...J(),...Oe(),...N(),...q(),...Y({variant:"text"})},"VListItem"),ue=V()({name:"VListItem",directives:{Ripple:Me},props:ta(),emits:{click:e=>!0},setup(e,i){let{attrs:t,slots:a,emit:l}=i;const n=Ne(e,t),s=m(()=>e.value===void 0?n.href.value:e.value),{activate:u,isActivated:v,select:y,isSelected:d,isIndeterminate:b,isGroupActivator:S,root:c,parent:o,openOnSelect:f}=We(s,!1),g=$e(),B=m(()=>e.active!==!1&&(e.active||n.isActive?.value||(c.activatable.value?v.value:d.value))),_=m(()=>e.link!==!1&&n.isLink.value),P=m(()=>!e.disabled&&e.link!==!1&&(e.link||n.isClickable.value||!!g&&(c.selectable.value||c.activatable.value||e.value!=null))),O=m(()=>e.rounded||e.nav),M=m(()=>e.color??e.activeColor),F=m(()=>({color:B.value?M.value??e.baseColor:e.baseColor,variant:e.variant}));gt(()=>n.isActive?.value,C=>{C&&o.value!=null&&c.open(o.value,!0),C&&f(C)},{immediate:!0});const{themeClasses:D}=Q(e),{borderClasses:G}=ye(e),{colorClasses:R,colorStyles:E,variantClasses:T}=oe(F),{densityClasses:k}=Z(e),{dimensionStyles:ne}=ge(e),{elevationClasses:Xe}=be(e),{roundedClasses:Je}=ee(O),Ye=m(()=>e.lines?`v-list-item--${e.lines}-line`:void 0),le=m(()=>({isActive:B.value,select:y,isSelected:d.value,isIndeterminate:b.value}));function Ce(C){l("click",C),P.value&&(n.navigate?.(C),!S&&(c.activatable.value?u(!v.value,C):(c.selectable.value||e.value!=null)&&y(!d.value,C)))}function Ze(C){(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),Ce(C))}return w(()=>{const C=_.value?"a":e.tag,et=a.title||e.title!=null,tt=a.subtitle||e.subtitle!=null,Ie=!!(e.appendAvatar||e.appendIcon),at=!!(Ie||a.append),Ve=!!(e.prependAvatar||e.prependIcon),ie=!!(Ve||a.prepend);return g?.updateHasPrepend(ie),e.activeColor&&bt("active-color",["color","base-color"]),Se(r(C,{class:["v-list-item",{"v-list-item--active":B.value,"v-list-item--disabled":e.disabled,"v-list-item--link":P.value,"v-list-item--nav":e.nav,"v-list-item--prepend":!ie&&g?.hasPrepend.value,"v-list-item--slim":e.slim,[`${e.activeClass}`]:e.activeClass&&B.value},D.value,G.value,R.value,k.value,Xe.value,Ye.value,Je.value,T.value,e.class],style:[E.value,ne.value,e.style],href:n.href.value,tabindex:P.value?g?-2:0:void 0,onClick:Ce,onKeydown:P.value&&!_.value&&Ze},{default:()=>[de(P.value||B.value,"v-list-item"),ie&&r("div",{key:"prepend",class:"v-list-item__prepend"},[a.prepend?r(j,{key:"prepend-defaults",disabled:!Ve,defaults:{VAvatar:{density:e.density,image:e.prependAvatar},VIcon:{density:e.density,icon:e.prependIcon},VListItemAction:{start:!0}}},{default:()=>[a.prepend?.(le.value)]}):r(U,null,[e.prependAvatar&&r(X,{key:"prepend-avatar",density:e.density,image:e.prependAvatar},null),e.prependIcon&&r(H,{key:"prepend-icon",density:e.density,icon:e.prependIcon},null)]),r("div",{class:"v-list-item__spacer"},null)]),r("div",{class:"v-list-item__content","data-no-activator":""},[et&&r(ea,{key:"title"},{default:()=>[a.title?.({title:e.title})??e.title]}),tt&&r(Zt,{key:"subtitle"},{default:()=>[a.subtitle?.({subtitle:e.subtitle})??e.subtitle]}),a.default?.(le.value)]),at&&r("div",{key:"append",class:"v-list-item__append"},[a.append?r(j,{key:"append-defaults",disabled:!Ie,defaults:{VAvatar:{density:e.density,image:e.appendAvatar},VIcon:{density:e.density,icon:e.appendIcon},VListItemAction:{end:!0}}},{default:()=>[a.append?.(le.value)]}):r(U,null,[e.appendIcon&&r(H,{key:"append-icon",density:e.density,icon:e.appendIcon},null),e.appendAvatar&&r(X,{key:"append-avatar",density:e.density,image:e.appendAvatar},null)]),r("div",{class:"v-list-item__spacer"},null)])]}),[[je("ripple"),P.value&&e.ripple]])}),{isGroupActivator:S,isSelected:d,list:g,select:y}}}),aa=I({color:String,inset:Boolean,sticky:Boolean,title:String,...A(),...N()},"VListSubheader"),na=V()({name:"VListSubheader",props:aa(),setup(e,i){let{slots:t}=i;const{textColorClasses:a,textColorStyles:l}=Ge(h(e,"color"));return w(()=>{const n=!!(t.default||e.title);return r(e.tag,{class:["v-list-subheader",{"v-list-subheader--inset":e.inset,"v-list-subheader--sticky":e.sticky},a.value,e.class],style:[{textColorStyles:l},e.style]},{default:()=>[n&&r("div",{class:"v-list-subheader__text"},[t.default?.()??e.title])]})}),{}}}),la=I({color:String,inset:Boolean,length:[Number,String],opacity:[Number,String],thickness:[Number,String],vertical:Boolean,...A(),...q()},"VDivider"),ia=V()({name:"VDivider",props:la(),setup(e,i){let{attrs:t,slots:a}=i;const{themeClasses:l}=Q(e),{textColorClasses:n,textColorStyles:s}=Ge(h(e,"color")),u=m(()=>{const v={};return e.length&&(v[e.vertical?"maxHeight":"maxWidth"]=we(e.length)),e.thickness&&(v[e.vertical?"borderRightWidth":"borderTopWidth"]=we(e.thickness)),v});return w(()=>{const v=r("hr",{class:[{"v-divider":!0,"v-divider--inset":e.inset,"v-divider--vertical":e.vertical},l.value,n.value,e.class],style:[u.value,s.value,{"--v-border-opacity":e.opacity},e.style],"aria-orientation":!t.role||t.role==="separator"?e.vertical?"vertical":"horizontal":void 0,role:`${t.role||"separator"}`},null);return a.default?r("div",{class:["v-divider__wrapper",{"v-divider__wrapper--vertical":e.vertical,"v-divider__wrapper--inset":e.inset}]},[v,r("div",{class:"v-divider__content"},[a.default()]),v]):v}),{}}}),sa=I({items:Array,returnObject:Boolean},"VListChildren"),qe=V()({name:"VListChildren",props:sa(),setup(e,i){let{slots:t}=i;return Ee(),()=>t.default?.()??e.items?.map(a=>{let{children:l,props:n,type:s,raw:u}=a;if(s==="divider")return t.divider?.({props:n})??r(ia,n,null);if(s==="subheader")return t.subheader?.({props:n})??r(na,n,null);const v={subtitle:t.subtitle?d=>t.subtitle?.({...d,item:u}):void 0,prepend:t.prepend?d=>t.prepend?.({...d,item:u}):void 0,append:t.append?d=>t.append?.({...d,item:u}):void 0,title:t.title?d=>t.title?.({...d,item:u}):void 0},y=Be.filterProps(n);return l?r(Be,Pe({value:n?.value},y),{activator:d=>{let{props:b}=d;const S={...n,...b,value:e.returnObject?u:n.value};return t.header?t.header({props:S}):r(ue,S,v)},default:()=>r(qe,{items:l,returnObject:e.returnObject},t)}):t.item?t.item({props:n}):r(ue,Pe(n,{value:e.returnObject?u:n.value}),v)})}}),ra=I({items:{type:Array,default:()=>[]},itemTitle:{type:[String,Array,Function],default:"title"},itemValue:{type:[String,Array,Function],default:"value"},itemChildren:{type:[Boolean,String,Array,Function],default:"children"},itemProps:{type:[Boolean,String,Array,Function],default:"props"},returnObject:Boolean,valueComparator:{type:Function,default:St}},"list-items");function ca(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ua(e,i){const t=$(i,e.itemType,"item"),a=ca(i)?i:$(i,e.itemTitle),l=$(i,e.itemValue,void 0),n=$(i,e.itemChildren),s=e.itemProps===!0?Ct(i,["children"]):$(i,e.itemProps),u={title:a,value:l,...s};return{type:t,title:u.title,value:u.value,props:u,children:t==="item"&&n?Qe(e,n):void 0,raw:i}}function Qe(e,i){const t=[];for(const a of i)t.push(ua(e,a));return t}function oa(e){return{items:m(()=>Qe(e,e.items))}}const da=I({baseColor:String,activeColor:String,activeClass:String,bgColor:String,disabled:Boolean,expandIcon:String,collapseIcon:String,lines:{type:[Boolean,String],default:"one"},slim:Boolean,nav:Boolean,...Wt({selectStrategy:"single-leaf",openStrategy:"list"}),...ve(),...A(),...W(),...fe(),...me(),itemType:{type:String,default:"type"},...ra(),...J(),...N(),...q(),...Y({variant:"text"})},"VList"),va=V()({name:"VList",props:da(),emits:{"update:selected":e=>!0,"update:activated":e=>!0,"update:opened":e=>!0,"click:open":e=>!0,"click:activate":e=>!0,"click:select":e=>!0},setup(e,i){let{slots:t}=i;const{items:a}=oa(e),{themeClasses:l}=Q(e),{backgroundColorClasses:n,backgroundColorStyles:s}=ht(h(e,"bgColor")),{borderClasses:u}=ye(e),{densityClasses:v}=Z(e),{dimensionStyles:y}=ge(e),{elevationClasses:d}=be(e),{roundedClasses:b}=ee(e),{children:S,open:c,parents:o,select:f}=qt(e),g=m(()=>e.lines?`v-list--${e.lines}-line`:void 0),B=h(e,"activeColor"),_=h(e,"baseColor"),P=h(e,"color");Ee(),_e({VListGroup:{activeColor:B,baseColor:_,color:P,expandIcon:h(e,"expandIcon"),collapseIcon:h(e,"collapseIcon")},VListItem:{activeClass:h(e,"activeClass"),activeColor:B,baseColor:_,color:P,density:h(e,"density"),disabled:h(e,"disabled"),lines:h(e,"lines"),nav:h(e,"nav"),slim:h(e,"slim"),variant:h(e,"variant")}});const O=z(!1),M=p();function F(k){O.value=!0}function D(k){O.value=!1}function G(k){!O.value&&!(k.relatedTarget&&M.value?.contains(k.relatedTarget))&&T()}function R(k){const ne=k.target;if(!(!M.value||["INPUT","TEXTAREA"].includes(ne.tagName))){if(k.key==="ArrowDown")T("next");else if(k.key==="ArrowUp")T("prev");else if(k.key==="Home")T("first");else if(k.key==="End")T("last");else return;k.preventDefault()}}function E(k){O.value=!0}function T(k){if(M.value)return kt(M.value,k)}return w(()=>r(e.tag,{ref:M,class:["v-list",{"v-list--disabled":e.disabled,"v-list--nav":e.nav,"v-list--slim":e.slim},l.value,n.value,u.value,v.value,d.value,g.value,b.value,e.class],style:[s.value,y.value,e.style],tabindex:e.disabled||O.value?-1:0,role:"listbox","aria-activedescendant":void 0,onFocusin:F,onFocusout:D,onFocus:G,onKeydown:R,onMousedown:E},{default:()=>[r(qe,{items:a.value,returnObject:e.returnObject},t)]})),{open:c,select:f,focus:T,children:S,parents:o}}}),Sa=It({__name:"List",props:{outlined:Boolean},setup(e){const{stac:i,selectedStac:t}=Vt(pe.stac.useSTAcStore()),{loadSelectedSTAC:a}=pe.stac.useSTAcStore(),l=m(()=>i.value.filter(s=>s?.rel=="child")),n=async s=>{const u=l.value[s];await a(u.href),console.log(t.value)};return(s,u)=>(re(),Le(Gt,{class:"mx-auto d-flex flex-column overflow-auto fill-height"},{default:xe(()=>[r(va,{lines:"one",class:"overflow-auto"},{default:xe(()=>[(re(!0),At(U,null,wt(l.value,(v,y)=>(re(),Le(ue,{key:y,onClick:d=>n(y),title:v.title,slim:"",variant:e.outlined?"outlined":"flat",color:"#fff"},null,8,["onClick","title","variant"]))),128))]),_:1})]),_:1}))}});export{Sa as default}; +import{g as V,e as A,S as _e,a as w,b as r,p as I,f as N,b3 as Te,I as L,O as W,ag as J,b4 as nt,h as q,b5 as Y,i as Q,b6 as oe,P as Z,aj as ee,b7 as lt,M as H,ak as j,b8 as de,F as U,ae as ve,ac as fe,af as me,b9 as it,ba as st,bb as rt,bc as Oe,bd as Me,ah as ye,ad as ge,ai as be,be as ct,bf as ut,bg as ot,bh as Ne,c as m,t as Se,v as je,bi as dt,x as te,s as z,q as ae,aL as x,bj as Fe,r as p,y as se,am as De,aH as vt,R as h,aQ as ft,bk as mt,B as yt,bl as Ae,w as gt,bm as bt,u as Ge,C as we,d as Pe,bn as St,Q as ht,bo as kt,bp as $,o as Ct,bq as It,aU as Vt,au as pe,$ as re,a0 as Le,a1 as xe,a6 as At,a7 as wt}from"./index-B5c5Pwhg.js";import{V as Re}from"./VImg-3feAnqWP.js";import{a as Pt}from"./index-Dr4JVqt9.js";import{u as pt}from"./ssrBoot-n6JOT_u2.js";import{M as Lt}from"./transition-DCXsv86C.js";const xt=V()({name:"VCardActions",props:A(),setup(e,i){let{slots:t}=i;return _e({VBtn:{slim:!0,variant:"text"}}),w(()=>r("div",{class:["v-card-actions",e.class],style:e.style},[t.default?.()])),{}}}),Bt=I({opacity:[Number,String],...A(),...N()},"VCardSubtitle"),_t=V()({name:"VCardSubtitle",props:Bt(),setup(e,i){let{slots:t}=i;return w(()=>r(e.tag,{class:["v-card-subtitle",e.class],style:[{"--v-card-subtitle-opacity":e.opacity},e.style]},t)),{}}}),Tt=Te("v-card-title"),Ot=I({start:Boolean,end:Boolean,icon:L,image:String,text:String,...A(),...W(),...J(),...nt(),...N(),...q(),...Y({variant:"flat"})},"VAvatar"),X=V()({name:"VAvatar",props:Ot(),setup(e,i){let{slots:t}=i;const{themeClasses:a}=Q(e),{colorClasses:l,colorStyles:n,variantClasses:s}=oe(e),{densityClasses:u}=Z(e),{roundedClasses:v}=ee(e),{sizeClasses:y,sizeStyles:d}=lt(e);return w(()=>r(e.tag,{class:["v-avatar",{"v-avatar--start":e.start,"v-avatar--end":e.end},a.value,l.value,u.value,v.value,y.value,s.value,e.class],style:[n.value,d.value,e.style]},{default:()=>[t.default?r(j,{key:"content-defaults",defaults:{VImg:{cover:!0,image:e.image},VIcon:{icon:e.icon}}},{default:()=>[t.default()]}):e.image?r(Re,{key:"image",src:e.image,alt:"",cover:!0},null):e.icon?r(H,{key:"icon",icon:e.icon},null):e.text,de(!1,"v-avatar")]})),{}}}),Mt=I({appendAvatar:String,appendIcon:L,prependAvatar:String,prependIcon:L,subtitle:[String,Number],title:[String,Number],...A(),...W()},"VCardItem"),Nt=V()({name:"VCardItem",props:Mt(),setup(e,i){let{slots:t}=i;return w(()=>{const a=!!(e.prependAvatar||e.prependIcon),l=!!(a||t.prepend),n=!!(e.appendAvatar||e.appendIcon),s=!!(n||t.append),u=!!(e.title!=null||t.title),v=!!(e.subtitle!=null||t.subtitle);return r("div",{class:["v-card-item",e.class],style:e.style},[l&&r("div",{key:"prepend",class:"v-card-item__prepend"},[t.prepend?r(j,{key:"prepend-defaults",disabled:!a,defaults:{VAvatar:{density:e.density,image:e.prependAvatar},VIcon:{density:e.density,icon:e.prependIcon}}},t.prepend):r(U,null,[e.prependAvatar&&r(X,{key:"prepend-avatar",density:e.density,image:e.prependAvatar},null),e.prependIcon&&r(H,{key:"prepend-icon",density:e.density,icon:e.prependIcon},null)])]),r("div",{class:"v-card-item__content"},[u&&r(Tt,{key:"title"},{default:()=>[t.title?.()??e.title]}),v&&r(_t,{key:"subtitle"},{default:()=>[t.subtitle?.()??e.subtitle]}),t.default?.()]),s&&r("div",{key:"append",class:"v-card-item__append"},[t.append?r(j,{key:"append-defaults",disabled:!n,defaults:{VAvatar:{density:e.density,image:e.appendAvatar},VIcon:{density:e.density,icon:e.appendIcon}}},t.append):r(U,null,[e.appendIcon&&r(H,{key:"append-icon",density:e.density,icon:e.appendIcon},null),e.appendAvatar&&r(X,{key:"append-avatar",density:e.density,image:e.appendAvatar},null)])])])}),{}}}),jt=I({opacity:[Number,String],...A(),...N()},"VCardText"),Ft=V()({name:"VCardText",props:jt(),setup(e,i){let{slots:t}=i;return w(()=>r(e.tag,{class:["v-card-text",e.class],style:[{"--v-card-text-opacity":e.opacity},e.style]},t)),{}}}),Dt=I({appendAvatar:String,appendIcon:L,disabled:Boolean,flat:Boolean,hover:Boolean,image:String,link:{type:Boolean,default:void 0},prependAvatar:String,prependIcon:L,ripple:{type:[Boolean,Object],default:!0},subtitle:[String,Number],text:[String,Number],title:[String,Number],...ve(),...A(),...W(),...fe(),...me(),...it(),...st(),...rt(),...J(),...Oe(),...N(),...q(),...Y({variant:"elevated"})},"VCard"),Gt=V()({name:"VCard",directives:{Ripple:Me},props:Dt(),setup(e,i){let{attrs:t,slots:a}=i;const{themeClasses:l}=Q(e),{borderClasses:n}=ye(e),{colorClasses:s,colorStyles:u,variantClasses:v}=oe(e),{densityClasses:y}=Z(e),{dimensionStyles:d}=ge(e),{elevationClasses:b}=be(e),{loaderClasses:S}=ct(e),{locationStyles:c}=ut(e),{positionClasses:o}=ot(e),{roundedClasses:f}=ee(e),g=Ne(e,t),B=m(()=>e.link!==!1&&g.isLink.value),_=m(()=>!e.disabled&&e.link!==!1&&(e.link||g.isClickable.value));return w(()=>{const P=B.value?"a":e.tag,O=!!(a.title||e.title!=null),M=!!(a.subtitle||e.subtitle!=null),F=O||M,D=!!(a.append||e.appendAvatar||e.appendIcon),G=!!(a.prepend||e.prependAvatar||e.prependIcon),R=!!(a.image||e.image),E=F||G||D,T=!!(a.text||e.text!=null);return Se(r(P,{class:["v-card",{"v-card--disabled":e.disabled,"v-card--flat":e.flat,"v-card--hover":e.hover&&!(e.disabled||e.flat),"v-card--link":_.value},l.value,n.value,s.value,y.value,b.value,S.value,o.value,f.value,v.value,e.class],style:[u.value,d.value,c.value,e.style],href:g.href.value,onClick:_.value&&g.navigate,tabindex:e.disabled?-1:void 0},{default:()=>[R&&r("div",{key:"image",class:"v-card__image"},[a.image?r(j,{key:"image-defaults",disabled:!e.image,defaults:{VImg:{cover:!0,src:e.image}}},a.image):r(Re,{key:"image-img",cover:!0,src:e.image},null)]),r(dt,{name:"v-card",active:!!e.loading,color:typeof e.loading=="boolean"?void 0:e.loading},{default:a.loader}),E&&r(Nt,{key:"item",prependAvatar:e.prependAvatar,prependIcon:e.prependIcon,title:e.title,subtitle:e.subtitle,appendAvatar:e.appendAvatar,appendIcon:e.appendIcon},{default:a.item,prepend:a.prepend,title:a.title,subtitle:a.subtitle,append:a.append}),T&&r(Ft,{key:"text"},{default:()=>[a.text?.()??e.text]}),a.default?.(),a.actions&&r(xt,null,{default:a.actions}),de(_.value,"v-card")]}),[[je("ripple"),_.value&&e.ripple]])}),{}}}),ce=Symbol.for("vuetify:list");function Ee(){const e=te(ce,{hasPrepend:z(!1),updateHasPrepend:()=>null}),i={hasPrepend:z(!1),updateHasPrepend:t=>{t&&(i.hasPrepend.value=t)}};return ae(ce,i),e}function $e(){return te(ce,null)}const he=e=>{const i={activate:t=>{let{id:a,value:l,activated:n}=t;return a=x(a),e&&!l&&n.size===1&&n.has(a)||(l?n.add(a):n.delete(a)),n},in:(t,a,l)=>{let n=new Set;if(t!=null)for(const s of Fe(t))n=i.activate({id:s,value:!0,activated:new Set(n),children:a,parents:l});return n},out:t=>Array.from(t)};return i},He=e=>{const i=he(e);return{activate:a=>{let{activated:l,id:n,...s}=a;n=x(n);const u=l.has(n)?new Set([n]):new Set;return i.activate({...s,id:n,activated:u})},in:(a,l,n)=>{let s=new Set;if(a!=null){const u=Fe(a);u.length&&(s=i.in(u.slice(0,1),l,n))}return s},out:(a,l,n)=>i.out(a,l,n)}},Rt=e=>{const i=he(e);return{activate:a=>{let{id:l,activated:n,children:s,...u}=a;return l=x(l),s.has(l)?n:i.activate({id:l,activated:n,children:s,...u})},in:i.in,out:i.out}},Et=e=>{const i=He(e);return{activate:a=>{let{id:l,activated:n,children:s,...u}=a;return l=x(l),s.has(l)?n:i.activate({id:l,activated:n,children:s,...u})},in:i.in,out:i.out}},$t={open:e=>{let{id:i,value:t,opened:a,parents:l}=e;if(t){const n=new Set;n.add(i);let s=l.get(i);for(;s!=null;)n.add(s),s=l.get(s);return n}else return a.delete(i),a},select:()=>null},Ue={open:e=>{let{id:i,value:t,opened:a,parents:l}=e;if(t){let n=l.get(i);for(a.add(i);n!=null&&n!==i;)a.add(n),n=l.get(n);return a}else a.delete(i);return a},select:()=>null},Ht={open:Ue.open,select:e=>{let{id:i,value:t,opened:a,parents:l}=e;if(!t)return a;const n=[];let s=l.get(i);for(;s!=null;)n.push(s),s=l.get(s);return new Set(n)}},ke=e=>{const i={select:t=>{let{id:a,value:l,selected:n}=t;if(a=x(a),e&&!l){const s=Array.from(n.entries()).reduce((u,v)=>{let[y,d]=v;return d==="on"&&u.push(y),u},[]);if(s.length===1&&s[0]===a)return n}return n.set(a,l?"on":"off"),n},in:(t,a,l)=>{let n=new Map;for(const s of t||[])n=i.select({id:s,value:!0,selected:new Map(n),children:a,parents:l});return n},out:t=>{const a=[];for(const[l,n]of t.entries())n==="on"&&a.push(l);return a}};return i},ze=e=>{const i=ke(e);return{select:a=>{let{selected:l,id:n,...s}=a;n=x(n);const u=l.has(n)?new Map([[n,l.get(n)]]):new Map;return i.select({...s,id:n,selected:u})},in:(a,l,n)=>{let s=new Map;return a?.length&&(s=i.in(a.slice(0,1),l,n)),s},out:(a,l,n)=>i.out(a,l,n)}},Ut=e=>{const i=ke(e);return{select:a=>{let{id:l,selected:n,children:s,...u}=a;return l=x(l),s.has(l)?n:i.select({id:l,selected:n,children:s,...u})},in:i.in,out:i.out}},zt=e=>{const i=ze(e);return{select:a=>{let{id:l,selected:n,children:s,...u}=a;return l=x(l),s.has(l)?n:i.select({id:l,selected:n,children:s,...u})},in:i.in,out:i.out}},Kt=e=>{const i={select:t=>{let{id:a,value:l,selected:n,children:s,parents:u}=t;a=x(a);const v=new Map(n),y=[a];for(;y.length;){const b=y.shift();n.set(b,l?"on":"off"),s.has(b)&&y.push(...s.get(b))}let d=u.get(a);for(;d;){const b=s.get(d),S=b.every(o=>n.get(o)==="on"),c=b.every(o=>!n.has(o)||n.get(o)==="off");n.set(d,S?"on":c?"off":"indeterminate"),d=u.get(d)}return e&&!l&&Array.from(n.entries()).reduce((S,c)=>{let[o,f]=c;return f==="on"&&S.push(o),S},[]).length===0?v:n},in:(t,a,l)=>{let n=new Map;for(const s of t||[])n=i.select({id:s,value:!0,selected:new Map(n),children:a,parents:l});return n},out:(t,a)=>{const l=[];for(const[n,s]of t.entries())s==="on"&&!a.has(n)&&l.push(n);return l}};return i},K=Symbol.for("vuetify:nested"),Ke={id:z(),root:{register:()=>null,unregister:()=>null,parents:p(new Map),children:p(new Map),open:()=>null,openOnSelect:()=>null,activate:()=>null,select:()=>null,activatable:p(!1),selectable:p(!1),opened:p(new Set),activated:p(new Set),selected:p(new Map),selectedValues:p([])}},Wt=I({activatable:Boolean,selectable:Boolean,activeStrategy:[String,Function,Object],selectStrategy:[String,Function,Object],openStrategy:[String,Object],opened:null,activated:null,selected:null,mandatory:Boolean},"nested"),qt=e=>{let i=!1;const t=p(new Map),a=p(new Map),l=se(e,"opened",e.opened,c=>new Set(c),c=>[...c.values()]),n=m(()=>{if(typeof e.activeStrategy=="object")return e.activeStrategy;if(typeof e.activeStrategy=="function")return e.activeStrategy(e.mandatory);switch(e.activeStrategy){case"leaf":return Rt(e.mandatory);case"single-leaf":return Et(e.mandatory);case"independent":return he(e.mandatory);case"single-independent":default:return He(e.mandatory)}}),s=m(()=>{if(typeof e.selectStrategy=="object")return e.selectStrategy;if(typeof e.selectStrategy=="function")return e.selectStrategy(e.mandatory);switch(e.selectStrategy){case"single-leaf":return zt(e.mandatory);case"leaf":return Ut(e.mandatory);case"independent":return ke(e.mandatory);case"single-independent":return ze(e.mandatory);case"classic":default:return Kt(e.mandatory)}}),u=m(()=>{if(typeof e.openStrategy=="object")return e.openStrategy;switch(e.openStrategy){case"list":return Ht;case"single":return $t;case"multiple":default:return Ue}}),v=se(e,"activated",e.activated,c=>n.value.in(c,t.value,a.value),c=>n.value.out(c,t.value,a.value)),y=se(e,"selected",e.selected,c=>s.value.in(c,t.value,a.value),c=>s.value.out(c,t.value,a.value));De(()=>{i=!0});function d(c){const o=[];let f=c;for(;f!=null;)o.unshift(f),f=a.value.get(f);return o}const b=vt("nested"),S={id:z(),root:{opened:l,activatable:h(e,"activatable"),selectable:h(e,"selectable"),activated:v,selected:y,selectedValues:m(()=>{const c=[];for(const[o,f]of y.value.entries())f==="on"&&c.push(o);return c}),register:(c,o,f)=>{o&&c!==o&&a.value.set(c,o),f&&t.value.set(c,[]),o!=null&&t.value.set(o,[...t.value.get(o)||[],c])},unregister:c=>{if(i)return;t.value.delete(c);const o=a.value.get(c);if(o){const f=t.value.get(o)??[];t.value.set(o,f.filter(g=>g!==c))}a.value.delete(c),l.value.delete(c)},open:(c,o,f)=>{b.emit("click:open",{id:c,value:o,path:d(c),event:f});const g=u.value.open({id:c,value:o,opened:new Set(l.value),children:t.value,parents:a.value,event:f});g&&(l.value=g)},openOnSelect:(c,o,f)=>{const g=u.value.select({id:c,value:o,selected:new Map(y.value),opened:new Set(l.value),children:t.value,parents:a.value,event:f});g&&(l.value=g)},select:(c,o,f)=>{b.emit("click:select",{id:c,value:o,path:d(c),event:f});const g=s.value.select({id:c,value:o,selected:new Map(y.value),children:t.value,parents:a.value,event:f});g&&(y.value=g),S.root.openOnSelect(c,o,f)},activate:(c,o,f)=>{if(!e.activatable)return S.root.select(c,!0,f);b.emit("click:activate",{id:c,value:o,path:d(c),event:f});const g=n.value.activate({id:c,value:o,activated:new Set(v.value),children:t.value,parents:a.value,event:f});g&&(v.value=g)},children:t,parents:a}};return ae(K,S),S.root},We=(e,i)=>{const t=te(K,Ke),a=Symbol(ft()),l=m(()=>e.value!==void 0?e.value:a),n={...t,id:l,open:(s,u)=>t.root.open(l.value,s,u),openOnSelect:(s,u)=>t.root.openOnSelect(l.value,s,u),isOpen:m(()=>t.root.opened.value.has(l.value)),parent:m(()=>t.root.parents.value.get(l.value)),activate:(s,u)=>t.root.activate(l.value,s,u),isActivated:m(()=>t.root.activated.value.has(x(l.value))),select:(s,u)=>t.root.select(l.value,s,u),isSelected:m(()=>t.root.selected.value.get(x(l.value))==="on"),isIndeterminate:m(()=>t.root.selected.value.get(l.value)==="indeterminate"),isLeaf:m(()=>!t.root.children.value.get(l.value)),isGroupActivator:t.isGroupActivator};return!t.isGroupActivator&&t.root.register(l.value,t.id.value,i),De(()=>{!t.isGroupActivator&&t.root.unregister(l.value)}),i&&ae(K,n),n},Qt=()=>{const e=te(K,Ke);ae(K,{...e,isGroupActivator:!0})},Xt=mt({name:"VListGroupActivator",setup(e,i){let{slots:t}=i;return Qt(),()=>t.default?.()}}),Jt=I({activeColor:String,baseColor:String,color:String,collapseIcon:{type:L,default:"$collapse"},expandIcon:{type:L,default:"$expand"},prependIcon:L,appendIcon:L,fluid:Boolean,subgroup:Boolean,title:String,value:null,...A(),...N()},"VListGroup"),Be=V()({name:"VListGroup",props:Jt(),setup(e,i){let{slots:t}=i;const{isOpen:a,open:l,id:n}=We(h(e,"value"),!0),s=m(()=>`v-list-group--id-${String(n.value)}`),u=$e(),{isBooted:v}=pt();function y(c){l(!a.value,c)}const d=m(()=>({onClick:y,class:"v-list-group__header",id:s.value})),b=m(()=>a.value?e.collapseIcon:e.expandIcon),S=m(()=>({VListItem:{active:a.value,activeColor:e.activeColor,baseColor:e.baseColor,color:e.color,prependIcon:e.prependIcon||e.subgroup&&b.value,appendIcon:e.appendIcon||!e.subgroup&&b.value,title:e.title,value:e.value}}));return w(()=>r(e.tag,{class:["v-list-group",{"v-list-group--prepend":u?.hasPrepend.value,"v-list-group--fluid":e.fluid,"v-list-group--subgroup":e.subgroup,"v-list-group--open":a.value},e.class],style:e.style},{default:()=>[t.activator&&r(j,{defaults:S.value},{default:()=>[r(Xt,null,{default:()=>[t.activator({props:d.value,isOpen:a.value})]})]}),r(Lt,{transition:{component:Pt},disabled:!v.value},{default:()=>[Se(r("div",{class:"v-list-group__items",role:"group","aria-labelledby":s.value},[t.default?.()]),[[yt,a.value]])]})]})),{isOpen:a}}}),Yt=I({opacity:[Number,String],...A(),...N()},"VListItemSubtitle"),Zt=V()({name:"VListItemSubtitle",props:Yt(),setup(e,i){let{slots:t}=i;return w(()=>r(e.tag,{class:["v-list-item-subtitle",e.class],style:[{"--v-list-item-subtitle-opacity":e.opacity},e.style]},t)),{}}}),ea=Te("v-list-item-title"),ta=I({active:{type:Boolean,default:void 0},activeClass:String,activeColor:String,appendAvatar:String,appendIcon:L,baseColor:String,disabled:Boolean,lines:[Boolean,String],link:{type:Boolean,default:void 0},nav:Boolean,prependAvatar:String,prependIcon:L,ripple:{type:[Boolean,Object],default:!0},slim:Boolean,subtitle:[String,Number],title:[String,Number],value:null,onClick:Ae(),onClickOnce:Ae(),...ve(),...A(),...W(),...fe(),...me(),...J(),...Oe(),...N(),...q(),...Y({variant:"text"})},"VListItem"),ue=V()({name:"VListItem",directives:{Ripple:Me},props:ta(),emits:{click:e=>!0},setup(e,i){let{attrs:t,slots:a,emit:l}=i;const n=Ne(e,t),s=m(()=>e.value===void 0?n.href.value:e.value),{activate:u,isActivated:v,select:y,isSelected:d,isIndeterminate:b,isGroupActivator:S,root:c,parent:o,openOnSelect:f}=We(s,!1),g=$e(),B=m(()=>e.active!==!1&&(e.active||n.isActive?.value||(c.activatable.value?v.value:d.value))),_=m(()=>e.link!==!1&&n.isLink.value),P=m(()=>!e.disabled&&e.link!==!1&&(e.link||n.isClickable.value||!!g&&(c.selectable.value||c.activatable.value||e.value!=null))),O=m(()=>e.rounded||e.nav),M=m(()=>e.color??e.activeColor),F=m(()=>({color:B.value?M.value??e.baseColor:e.baseColor,variant:e.variant}));gt(()=>n.isActive?.value,C=>{C&&o.value!=null&&c.open(o.value,!0),C&&f(C)},{immediate:!0});const{themeClasses:D}=Q(e),{borderClasses:G}=ye(e),{colorClasses:R,colorStyles:E,variantClasses:T}=oe(F),{densityClasses:k}=Z(e),{dimensionStyles:ne}=ge(e),{elevationClasses:Xe}=be(e),{roundedClasses:Je}=ee(O),Ye=m(()=>e.lines?`v-list-item--${e.lines}-line`:void 0),le=m(()=>({isActive:B.value,select:y,isSelected:d.value,isIndeterminate:b.value}));function Ce(C){l("click",C),P.value&&(n.navigate?.(C),!S&&(c.activatable.value?u(!v.value,C):(c.selectable.value||e.value!=null)&&y(!d.value,C)))}function Ze(C){(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),Ce(C))}return w(()=>{const C=_.value?"a":e.tag,et=a.title||e.title!=null,tt=a.subtitle||e.subtitle!=null,Ie=!!(e.appendAvatar||e.appendIcon),at=!!(Ie||a.append),Ve=!!(e.prependAvatar||e.prependIcon),ie=!!(Ve||a.prepend);return g?.updateHasPrepend(ie),e.activeColor&&bt("active-color",["color","base-color"]),Se(r(C,{class:["v-list-item",{"v-list-item--active":B.value,"v-list-item--disabled":e.disabled,"v-list-item--link":P.value,"v-list-item--nav":e.nav,"v-list-item--prepend":!ie&&g?.hasPrepend.value,"v-list-item--slim":e.slim,[`${e.activeClass}`]:e.activeClass&&B.value},D.value,G.value,R.value,k.value,Xe.value,Ye.value,Je.value,T.value,e.class],style:[E.value,ne.value,e.style],href:n.href.value,tabindex:P.value?g?-2:0:void 0,onClick:Ce,onKeydown:P.value&&!_.value&&Ze},{default:()=>[de(P.value||B.value,"v-list-item"),ie&&r("div",{key:"prepend",class:"v-list-item__prepend"},[a.prepend?r(j,{key:"prepend-defaults",disabled:!Ve,defaults:{VAvatar:{density:e.density,image:e.prependAvatar},VIcon:{density:e.density,icon:e.prependIcon},VListItemAction:{start:!0}}},{default:()=>[a.prepend?.(le.value)]}):r(U,null,[e.prependAvatar&&r(X,{key:"prepend-avatar",density:e.density,image:e.prependAvatar},null),e.prependIcon&&r(H,{key:"prepend-icon",density:e.density,icon:e.prependIcon},null)]),r("div",{class:"v-list-item__spacer"},null)]),r("div",{class:"v-list-item__content","data-no-activator":""},[et&&r(ea,{key:"title"},{default:()=>[a.title?.({title:e.title})??e.title]}),tt&&r(Zt,{key:"subtitle"},{default:()=>[a.subtitle?.({subtitle:e.subtitle})??e.subtitle]}),a.default?.(le.value)]),at&&r("div",{key:"append",class:"v-list-item__append"},[a.append?r(j,{key:"append-defaults",disabled:!Ie,defaults:{VAvatar:{density:e.density,image:e.appendAvatar},VIcon:{density:e.density,icon:e.appendIcon},VListItemAction:{end:!0}}},{default:()=>[a.append?.(le.value)]}):r(U,null,[e.appendIcon&&r(H,{key:"append-icon",density:e.density,icon:e.appendIcon},null),e.appendAvatar&&r(X,{key:"append-avatar",density:e.density,image:e.appendAvatar},null)]),r("div",{class:"v-list-item__spacer"},null)])]}),[[je("ripple"),P.value&&e.ripple]])}),{isGroupActivator:S,isSelected:d,list:g,select:y}}}),aa=I({color:String,inset:Boolean,sticky:Boolean,title:String,...A(),...N()},"VListSubheader"),na=V()({name:"VListSubheader",props:aa(),setup(e,i){let{slots:t}=i;const{textColorClasses:a,textColorStyles:l}=Ge(h(e,"color"));return w(()=>{const n=!!(t.default||e.title);return r(e.tag,{class:["v-list-subheader",{"v-list-subheader--inset":e.inset,"v-list-subheader--sticky":e.sticky},a.value,e.class],style:[{textColorStyles:l},e.style]},{default:()=>[n&&r("div",{class:"v-list-subheader__text"},[t.default?.()??e.title])]})}),{}}}),la=I({color:String,inset:Boolean,length:[Number,String],opacity:[Number,String],thickness:[Number,String],vertical:Boolean,...A(),...q()},"VDivider"),ia=V()({name:"VDivider",props:la(),setup(e,i){let{attrs:t,slots:a}=i;const{themeClasses:l}=Q(e),{textColorClasses:n,textColorStyles:s}=Ge(h(e,"color")),u=m(()=>{const v={};return e.length&&(v[e.vertical?"maxHeight":"maxWidth"]=we(e.length)),e.thickness&&(v[e.vertical?"borderRightWidth":"borderTopWidth"]=we(e.thickness)),v});return w(()=>{const v=r("hr",{class:[{"v-divider":!0,"v-divider--inset":e.inset,"v-divider--vertical":e.vertical},l.value,n.value,e.class],style:[u.value,s.value,{"--v-border-opacity":e.opacity},e.style],"aria-orientation":!t.role||t.role==="separator"?e.vertical?"vertical":"horizontal":void 0,role:`${t.role||"separator"}`},null);return a.default?r("div",{class:["v-divider__wrapper",{"v-divider__wrapper--vertical":e.vertical,"v-divider__wrapper--inset":e.inset}]},[v,r("div",{class:"v-divider__content"},[a.default()]),v]):v}),{}}}),sa=I({items:Array,returnObject:Boolean},"VListChildren"),qe=V()({name:"VListChildren",props:sa(),setup(e,i){let{slots:t}=i;return Ee(),()=>t.default?.()??e.items?.map(a=>{let{children:l,props:n,type:s,raw:u}=a;if(s==="divider")return t.divider?.({props:n})??r(ia,n,null);if(s==="subheader")return t.subheader?.({props:n})??r(na,n,null);const v={subtitle:t.subtitle?d=>t.subtitle?.({...d,item:u}):void 0,prepend:t.prepend?d=>t.prepend?.({...d,item:u}):void 0,append:t.append?d=>t.append?.({...d,item:u}):void 0,title:t.title?d=>t.title?.({...d,item:u}):void 0},y=Be.filterProps(n);return l?r(Be,Pe({value:n?.value},y),{activator:d=>{let{props:b}=d;const S={...n,...b,value:e.returnObject?u:n.value};return t.header?t.header({props:S}):r(ue,S,v)},default:()=>r(qe,{items:l,returnObject:e.returnObject},t)}):t.item?t.item({props:n}):r(ue,Pe(n,{value:e.returnObject?u:n.value}),v)})}}),ra=I({items:{type:Array,default:()=>[]},itemTitle:{type:[String,Array,Function],default:"title"},itemValue:{type:[String,Array,Function],default:"value"},itemChildren:{type:[Boolean,String,Array,Function],default:"children"},itemProps:{type:[Boolean,String,Array,Function],default:"props"},returnObject:Boolean,valueComparator:{type:Function,default:St}},"list-items");function ca(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function ua(e,i){const t=$(i,e.itemType,"item"),a=ca(i)?i:$(i,e.itemTitle),l=$(i,e.itemValue,void 0),n=$(i,e.itemChildren),s=e.itemProps===!0?Ct(i,["children"]):$(i,e.itemProps),u={title:a,value:l,...s};return{type:t,title:u.title,value:u.value,props:u,children:t==="item"&&n?Qe(e,n):void 0,raw:i}}function Qe(e,i){const t=[];for(const a of i)t.push(ua(e,a));return t}function oa(e){return{items:m(()=>Qe(e,e.items))}}const da=I({baseColor:String,activeColor:String,activeClass:String,bgColor:String,disabled:Boolean,expandIcon:String,collapseIcon:String,lines:{type:[Boolean,String],default:"one"},slim:Boolean,nav:Boolean,...Wt({selectStrategy:"single-leaf",openStrategy:"list"}),...ve(),...A(),...W(),...fe(),...me(),itemType:{type:String,default:"type"},...ra(),...J(),...N(),...q(),...Y({variant:"text"})},"VList"),va=V()({name:"VList",props:da(),emits:{"update:selected":e=>!0,"update:activated":e=>!0,"update:opened":e=>!0,"click:open":e=>!0,"click:activate":e=>!0,"click:select":e=>!0},setup(e,i){let{slots:t}=i;const{items:a}=oa(e),{themeClasses:l}=Q(e),{backgroundColorClasses:n,backgroundColorStyles:s}=ht(h(e,"bgColor")),{borderClasses:u}=ye(e),{densityClasses:v}=Z(e),{dimensionStyles:y}=ge(e),{elevationClasses:d}=be(e),{roundedClasses:b}=ee(e),{children:S,open:c,parents:o,select:f}=qt(e),g=m(()=>e.lines?`v-list--${e.lines}-line`:void 0),B=h(e,"activeColor"),_=h(e,"baseColor"),P=h(e,"color");Ee(),_e({VListGroup:{activeColor:B,baseColor:_,color:P,expandIcon:h(e,"expandIcon"),collapseIcon:h(e,"collapseIcon")},VListItem:{activeClass:h(e,"activeClass"),activeColor:B,baseColor:_,color:P,density:h(e,"density"),disabled:h(e,"disabled"),lines:h(e,"lines"),nav:h(e,"nav"),slim:h(e,"slim"),variant:h(e,"variant")}});const O=z(!1),M=p();function F(k){O.value=!0}function D(k){O.value=!1}function G(k){!O.value&&!(k.relatedTarget&&M.value?.contains(k.relatedTarget))&&T()}function R(k){const ne=k.target;if(!(!M.value||["INPUT","TEXTAREA"].includes(ne.tagName))){if(k.key==="ArrowDown")T("next");else if(k.key==="ArrowUp")T("prev");else if(k.key==="Home")T("first");else if(k.key==="End")T("last");else return;k.preventDefault()}}function E(k){O.value=!0}function T(k){if(M.value)return kt(M.value,k)}return w(()=>r(e.tag,{ref:M,class:["v-list",{"v-list--disabled":e.disabled,"v-list--nav":e.nav,"v-list--slim":e.slim},l.value,n.value,u.value,v.value,d.value,g.value,b.value,e.class],style:[s.value,y.value,e.style],tabindex:e.disabled||O.value?-1:0,role:"listbox","aria-activedescendant":void 0,onFocusin:F,onFocusout:D,onFocus:G,onKeydown:R,onMousedown:E},{default:()=>[r(qe,{items:a.value,returnObject:e.returnObject},t)]})),{open:c,select:f,focus:T,children:S,parents:o}}}),Sa=It({__name:"List",props:{outlined:Boolean},setup(e){const{stac:i,selectedStac:t}=Vt(pe.stac.useSTAcStore()),{loadSelectedSTAC:a}=pe.stac.useSTAcStore(),l=m(()=>i.value.filter(s=>s?.rel=="child")),n=async s=>{const u=l.value[s];await a(u.href),console.log(t.value)};return(s,u)=>(re(),Le(Gt,{class:"mx-auto d-flex flex-column overflow-auto fill-height"},{default:xe(()=>[r(va,{lines:"one",class:"overflow-auto"},{default:xe(()=>[(re(!0),At(U,null,wt(l.value,(v,y)=>(re(),Le(ue,{key:y,onClick:d=>n(y),title:v.title,slim:"",variant:e.outlined?"outlined":"flat",color:"#fff"},null,8,["onClick","title","variant"]))),128))]),_:1})]),_:1}))}});export{Sa as default}; diff --git a/pr-preview/pr-17/assets/MobileLayout-BDIG90KP.js b/pr-preview/pr-17/assets/MobileLayout-DWshgg7U.js similarity index 89% rename from pr-preview/pr-17/assets/MobileLayout-BDIG90KP.js rename to pr-preview/pr-17/assets/MobileLayout-DWshgg7U.js index 3afb676..1524ea6 100644 --- a/pr-preview/pr-17/assets/MobileLayout-BDIG90KP.js +++ b/pr-preview/pr-17/assets/MobileLayout-DWshgg7U.js @@ -1 +1 @@ -import{k as Ie,p as R,o as Pe,m as Xe,g as M,u as Ye,r as I,c as y,a as $,V as G,b as v,F as O,d as z,e as ie,f as ue,h as Ge,i as De,j as pe,l as Ue,n as Be,s as E,w as Ee,q as je,t as q,v as Ne,x as re,y as ze,z as qe,A as Ke,B as le,C as ae,D as Qe,I as fe,E as Je,G as Ze,H as et,J as me,K as tt,L as he,M as ge,N as nt,O as ot,P as st,Q as lt,R as W,S as at,T as it,_ as ut,U as rt,W as ct,X as be,Y as dt,Z as vt,$ as C,a0 as A,a1 as F,a2 as ye,a3 as X,a4 as Se,a5 as se,a6 as Y,a7 as we,a8 as xe,a9 as ft,aa as mt}from"./index-DBoWNDl8.js";import{f as ht,a as gt,s as bt,m as yt,u as St,b as wt}from"./forwardRefs-CYWtMhRJ.js";import{u as xt}from"./ssrBoot-CqR98f8O.js";import{M as kt}from"./transition-C0IRM1SU.js";import{V as ke}from"./index-Btx7hSs2.js";import{V as Tt}from"./VMain-XnWXrEcc.js";const Vt=e=>{const{touchstartX:n,touchendX:s,touchstartY:t,touchendY:l}=e,u=.5,o=16;e.offsetX=s-n,e.offsetY=l-t,Math.abs(e.offsetY)n+o&&e.right(e)),Math.abs(e.offsetX)t+o&&e.down(e))};function Ct(e,n){const s=e.changedTouches[0];n.touchstartX=s.clientX,n.touchstartY=s.clientY,n.start?.({originalEvent:e,...n})}function _t(e,n){const s=e.changedTouches[0];n.touchendX=s.clientX,n.touchendY=s.clientY,n.end?.({originalEvent:e,...n}),Vt(n)}function It(e,n){const s=e.changedTouches[0];n.touchmoveX=s.clientX,n.touchmoveY=s.clientY,n.move?.({originalEvent:e,...n})}function Pt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n={touchstartX:0,touchstartY:0,touchendX:0,touchendY:0,touchmoveX:0,touchmoveY:0,offsetX:0,offsetY:0,left:e.left,right:e.right,up:e.up,down:e.down,start:e.start,move:e.move,end:e.end};return{touchstart:s=>Ct(s,n),touchend:s=>_t(s,n),touchmove:s=>It(s,n)}}function pt(e,n){const s=n.value,t=s?.parent?e.parentElement:e,l=s?.options??{passive:!0},u=n.instance?.$.uid;if(!t||!u)return;const o=Pt(n.value);t._touchHandlers=t._touchHandlers??Object.create(null),t._touchHandlers[u]=o,Ie(o).forEach(f=>{t.addEventListener(f,o[f],l)})}function Bt(e,n){const s=n.value?.parent?e.parentElement:e,t=n.instance?.$.uid;if(!s?._touchHandlers||!t)return;const l=s._touchHandlers[t];Ie(l).forEach(u=>{s.removeEventListener(u,l[u])}),delete s._touchHandlers[t]}const We={mounted:pt,unmounted:Bt},Et=We,ce=Symbol.for("vuetify:v-tabs"),zt=R({fixed:Boolean,sliderColor:String,hideSlider:Boolean,direction:{type:String,default:"horizontal"},...Pe(Xe({selectedClass:"v-tab--selected",variant:"text"}),["active","block","flat","location","position","symbol"])},"VTab"),Re=M()({name:"VTab",props:zt(),setup(e,n){let{slots:s,attrs:t}=n;const{textColorClasses:l,textColorStyles:u}=Ye(e,"sliderColor"),o=I(),f=I(),r=y(()=>e.direction==="horizontal"),h=y(()=>o.value?.group?.isSelected.value??!1);function x(m){let{value:a}=m;if(a){const g=o.value?.$el.parentElement?.querySelector(".v-tab--selected .v-tab__slider"),d=f.value;if(!g||!d)return;const _=getComputedStyle(g).color,T=g.getBoundingClientRect(),V=d.getBoundingClientRect(),P=r.value?"x":"y",p=r.value?"X":"Y",b=r.value?"right":"bottom",S=r.value?"width":"height",k=T[P],H=V[P],B=k>H?T[b]-V[b]:T[P]-V[P],K=Math.sign(B)>0?r.value?"right":"bottom":Math.sign(B)<0?r.value?"left":"top":"center",Q=(Math.abs(B)+(Math.sign(B)<0?T[S]:V[S]))/Math.max(T[S],V[S])||0,j=T[S]/V[S]||0,N=1.5;gt(d,{backgroundColor:[_,"currentcolor"],transform:[`translate${p}(${B}px) scale${p}(${j})`,`translate${p}(${B/N}px) scale${p}(${(Q-1)/N+1})`,"none"],transformOrigin:Array(3).fill(K)},{duration:225,easing:bt})}}return $(()=>{const m=G.filterProps(e);return v(G,z({symbol:ce,ref:o,class:["v-tab",e.class],style:e.style,tabindex:h.value?0:-1,role:"tab","aria-selected":String(h.value),active:!1},m,t,{block:e.fixed,maxWidth:e.fixed?300:void 0,"onGroup:selected":x}),{...s,default:()=>v(O,null,[s.default?.()??e.text,!e.hideSlider&&v("div",{ref:f,class:["v-tab__slider",l.value],style:u.value},null)])})}),ht({},o)}}),Me=Symbol.for("vuetify:v-window"),$e=Symbol.for("vuetify:v-window-group"),He=R({continuous:Boolean,nextIcon:{type:[Boolean,String,Function,Object],default:"$next"},prevIcon:{type:[Boolean,String,Function,Object],default:"$prev"},reverse:Boolean,showArrows:{type:[Boolean,String],validator:e=>typeof e=="boolean"||e==="hover"},touch:{type:[Object,Boolean],default:void 0},direction:{type:String,default:"horizontal"},modelValue:null,disabled:Boolean,selectedClass:{type:String,default:"v-window-item--active"},mandatory:{type:[Boolean,String],default:"force"},...ie(),...ue(),...Ge()},"VWindow"),Te=M()({name:"VWindow",directives:{Touch:We},props:He(),emits:{"update:modelValue":e=>!0},setup(e,n){let{slots:s}=n;const{themeClasses:t}=De(e),{isRtl:l}=pe(),{t:u}=Ue(),o=Be(e,$e),f=I(),r=y(()=>l.value?!e.reverse:e.reverse),h=E(!1),x=y(()=>{const b=e.direction==="vertical"?"y":"x",k=(r.value?!h.value:h.value)?"-reverse":"";return`v-window-${b}${k}-transition`}),m=E(0),a=I(void 0),g=y(()=>o.items.value.findIndex(b=>o.selected.value.includes(b.id)));Ee(g,(b,S)=>{const k=o.items.value.length,H=k-1;k<=2?h.value=be.continuous||g.value!==0),_=y(()=>e.continuous||g.value!==o.items.value.length-1);function T(){d.value&&o.prev()}function V(){_.value&&o.next()}const P=y(()=>{const b=[],S={icon:l.value?e.nextIcon:e.prevIcon,class:`v-window__${r.value?"right":"left"}`,onClick:o.prev,"aria-label":u("$vuetify.carousel.prev")};b.push(d.value?s.prev?s.prev({props:S}):v(G,S,null):v("div",null,null));const k={icon:l.value?e.prevIcon:e.nextIcon,class:`v-window__${r.value?"left":"right"}`,onClick:o.next,"aria-label":u("$vuetify.carousel.next")};return b.push(_.value?s.next?s.next({props:k}):v(G,k,null):v("div",null,null)),b}),p=y(()=>e.touch===!1?e.touch:{...{left:()=>{r.value?T():V()},right:()=>{r.value?V():T()},start:S=>{let{originalEvent:k}=S;k.stopPropagation()}},...e.touch===!0?{}:e.touch});return $(()=>q(v(e.tag,{ref:f,class:["v-window",{"v-window--show-arrows-on-hover":e.showArrows==="hover"},t.value,e.class],style:e.style},{default:()=>[v("div",{class:"v-window__container",style:{height:a.value}},[s.default?.({group:o}),e.showArrows!==!1&&v("div",{class:"v-window__controls"},[P.value])]),s.additional?.({group:o})]}),[[Ne("touch"),p.value]])),{group:o}}}),Wt=R({...Pe(He(),["continuous","nextIcon","prevIcon","showArrows","touch","mandatory"])},"VTabsWindow"),Rt=M()({name:"VTabsWindow",props:Wt(),emits:{"update:modelValue":e=>!0},setup(e,n){let{slots:s}=n;const t=re(ce,null),l=ze(e,"modelValue"),u=y({get(){return l.value!=null||!t?l.value:t.items.value.find(o=>t.selected.value.includes(o.id))?.value},set(o){l.value=o}});return $(()=>{const o=Te.filterProps(e);return v(Te,z({_as:"VTabsWindow"},o,{modelValue:u.value,"onUpdate:modelValue":f=>u.value=f,class:["v-tabs-window",e.class],style:e.style,mandatory:!1,touch:!1}),s)}),{}}}),Ae=R({reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},...ie(),...qe(),...yt()},"VWindowItem"),Ve=M()({name:"VWindowItem",directives:{Touch:Et},props:Ae(),emits:{"group:selected":e=>!0},setup(e,n){let{slots:s}=n;const t=re(Me),l=Ke(e,$e),{isBooted:u}=xt();if(!t||!l)throw new Error("[Vuetify] VWindowItem must be used inside VWindow");const o=E(!1),f=y(()=>u.value&&(t.isReversed.value?e.reverseTransition!==!1:e.transition!==!1));function r(){!o.value||!t||(o.value=!1,t.transitionCount.value>0&&(t.transitionCount.value-=1,t.transitionCount.value===0&&(t.transitionHeight.value=void 0)))}function h(){o.value||!t||(o.value=!0,t.transitionCount.value===0&&(t.transitionHeight.value=ae(t.rootRef.value?.clientHeight)),t.transitionCount.value+=1)}function x(){r()}function m(d){o.value&&Qe(()=>{!f.value||!o.value||!t||(t.transitionHeight.value=ae(d.clientHeight))})}const a=y(()=>{const d=t.isReversed.value?e.reverseTransition:e.transition;return f.value?{name:typeof d!="string"?t.transition.value:d,onBeforeEnter:h,onAfterEnter:r,onEnterCancelled:x,onBeforeLeave:h,onAfterLeave:r,onLeaveCancelled:x,onEnter:m}:!1}),{hasContent:g}=St(e,l.isSelected);return $(()=>v(kt,{transition:a.value,disabled:!u.value},{default:()=>[q(v("div",{class:["v-window-item",l.selectedClass.value,e.class],style:e.style},[g.value&&s.default?.()]),[[le,l.isSelected.value]])]})),{groupItem:l}}}),Mt=R({...Ae()},"VTabsWindowItem"),$t=M()({name:"VTabsWindowItem",props:Mt(),setup(e,n){let{slots:s}=n;return $(()=>{const t=Ve.filterProps(e);return v(Ve,z({_as:"VTabsWindowItem"},t,{class:["v-tabs-window-item",e.class],style:e.style}),s)}),{}}});function Ht(e){let{selectedElement:n,containerElement:s,isRtl:t,isHorizontal:l}=e;const u=D(l,s),o=Fe(l,t,s),f=D(l,n),r=Oe(l,n),h=f*.4;return o>r?r-h:o+utypeof e=="boolean"||["always","desktop","mobile"].includes(e)},...ie(),...Je({mobile:null}),...ue(),...Ze({selectedClass:"v-slide-group-item--active"})},"VSlideGroup"),_e=M()({name:"VSlideGroup",props:Le(),emits:{"update:modelValue":e=>!0},setup(e,n){let{slots:s}=n;const{isRtl:t}=pe(),{displayClasses:l,mobile:u}=et(e),o=Be(e,e.symbol),f=E(!1),r=E(0),h=E(0),x=E(0),m=y(()=>e.direction==="horizontal"),{resizeRef:a,contentRect:g}=me(),{resizeRef:d,contentRect:_}=me(),T=tt(),V=y(()=>({container:a.el,duration:200,easing:"easeOutQuart"})),P=y(()=>o.selected.value.length?o.items.value.findIndex(i=>i.id===o.selected.value[0]):-1),p=y(()=>o.selected.value.length?o.items.value.findIndex(i=>i.id===o.selected.value[o.selected.value.length-1]):-1);if(he){let i=-1;Ee(()=>[o.selected.value,g.value,_.value,m.value],()=>{cancelAnimationFrame(i),i=requestAnimationFrame(()=>{if(g.value&&_.value){const c=m.value?"width":"height";h.value=g.value[c],x.value=_.value[c],f.value=h.value+1=0&&d.el){const c=d.el.children[p.value];S(c,e.centerActive)}})})}const b=E(!1);function S(i,c){let w=0;c?w=At({containerElement:a.el,isHorizontal:m.value,selectedElement:i}):w=Ht({containerElement:a.el,isHorizontal:m.value,isRtl:t.value,selectedElement:i}),k(w)}function k(i){if(!he||!a.el)return;const c=D(m.value,a.el),w=Fe(m.value,t.value,a.el);if(!(Ce(m.value,a.el)<=c||Math.abs(i-w)<16)){if(m.value&&t.value&&a.el){const{scrollWidth:ne,offsetWidth:oe}=a.el;i=ne-oe-i}m.value?T.horizontal(i,V.value):T(i,V.value)}}function H(i){const{scrollTop:c,scrollLeft:w}=i.target;r.value=m.value?w:c}function B(i){if(b.value=!0,!(!f.value||!d.el)){for(const c of i.composedPath())for(const w of d.el.children)if(w===c){S(w);return}}}function K(i){b.value=!1}let U=!1;function Q(i){!U&&!b.value&&!(i.relatedTarget&&d.el?.contains(i.relatedTarget))&&L(),U=!1}function j(){U=!0}function N(i){if(!d.el)return;function c(w){i.preventDefault(),L(w)}m.value?i.key==="ArrowRight"?c(t.value?"prev":"next"):i.key==="ArrowLeft"&&c(t.value?"next":"prev"):i.key==="ArrowDown"?c("next"):i.key==="ArrowUp"&&c("prev"),i.key==="Home"?c("first"):i.key==="End"&&c("last")}function L(i){if(!d.el)return;let c;if(!i)c=nt(d.el)[0];else if(i==="next"){if(c=d.el.querySelector(":focus")?.nextElementSibling,!c)return L("first")}else if(i==="prev"){if(c=d.el.querySelector(":focus")?.previousElementSibling,!c)return L("last")}else i==="first"?c=d.el.firstElementChild:i==="last"&&(c=d.el.lastElementChild);c&&c.focus({preventScroll:!0})}function J(i){const c=m.value&&t.value?-1:1,w=(i==="prev"?-c:c)*h.value;let te=r.value+w;if(m.value&&t.value&&a.el){const{scrollWidth:ne,offsetWidth:oe}=a.el;te+=ne-oe}k(te)}const Z=y(()=>({next:o.next,prev:o.prev,select:o.select,isSelected:o.isSelected})),ee=y(()=>{switch(e.showArrows){case"always":return!0;case"desktop":return!u.value;case!0:return f.value||Math.abs(r.value)>0;case"mobile":return u.value||f.value||Math.abs(r.value)>0;default:return!u.value&&(f.value||Math.abs(r.value)>0)}}),de=y(()=>Math.abs(r.value)>1),ve=y(()=>{if(!a.value)return!1;const i=Ce(m.value,a.el),c=Ft(m.value,a.el);return i-c-Math.abs(r.value)>1});return $(()=>v(e.tag,{class:["v-slide-group",{"v-slide-group--vertical":!m.value,"v-slide-group--has-affixes":ee.value,"v-slide-group--is-overflowing":f.value},l.value,e.class],style:e.style,tabindex:b.value||o.selected.value.length?-1:0,onFocus:Q},{default:()=>[ee.value&&v("div",{key:"prev",class:["v-slide-group__prev",{"v-slide-group__prev--disabled":!de.value}],onMousedown:j,onClick:()=>de.value&&J("prev")},[s.prev?.(Z.value)??v(ke,null,{default:()=>[v(ge,{icon:t.value?e.nextIcon:e.prevIcon},null)]})]),v("div",{key:"container",ref:a,class:"v-slide-group__container",onScroll:H},[v("div",{ref:d,class:"v-slide-group__content",onFocusin:B,onFocusout:K,onKeydown:N},[s.default?.(Z.value)])]),ee.value&&v("div",{key:"next",class:["v-slide-group__next",{"v-slide-group__next--disabled":!ve.value}],onMousedown:j,onClick:()=>ve.value&&J("next")},[s.next?.(Z.value)??v(ke,null,{default:()=>[v(ge,{icon:t.value?e.prevIcon:e.nextIcon},null)]})])]})),{selected:o.selected,scrollTo:J,scrollOffset:r,focus:L}}});function Lt(e){return e?e.map(n=>it(n)?n:{text:n,value:n}):[]}const Xt=R({alignTabs:{type:String,default:"start"},color:String,fixedTabs:Boolean,items:{type:Array,default:()=>[]},stacked:Boolean,bgColor:String,grow:Boolean,height:{type:[Number,String],default:void 0},hideSlider:Boolean,sliderColor:String,...Le({mandatory:"force",selectedClass:"v-tab-item--selected"}),...ot(),...ue()},"VTabs"),Yt=M()({name:"VTabs",props:Xt(),emits:{"update:modelValue":e=>!0},setup(e,n){let{attrs:s,slots:t}=n;const l=ze(e,"modelValue"),u=y(()=>Lt(e.items)),{densityClasses:o}=st(e),{backgroundColorClasses:f,backgroundColorStyles:r}=lt(W(e,"bgColor")),{scopeId:h}=wt();return at({VTab:{color:W(e,"color"),direction:W(e,"direction"),stacked:W(e,"stacked"),fixed:W(e,"fixedTabs"),sliderColor:W(e,"sliderColor"),hideSlider:W(e,"hideSlider")}}),$(()=>{const x=_e.filterProps(e),m=!!(t.window||e.items.length>0);return v(O,null,[v(_e,z(x,{modelValue:l.value,"onUpdate:modelValue":a=>l.value=a,class:["v-tabs",`v-tabs--${e.direction}`,`v-tabs--align-tabs-${e.alignTabs}`,{"v-tabs--fixed-tabs":e.fixedTabs,"v-tabs--grow":e.grow,"v-tabs--stacked":e.stacked},o.value,f.value,e.class],style:[{"--v-tabs-height":ae(e.height)},r.value,e.style],role:"tablist",symbol:ce},h,s),{default:()=>[t.default?.()??u.value.map(a=>t.tab?.({item:a})??v(Re,z(a,{key:a.text,value:a.value}),{default:()=>t[`tab.${a.value}`]?.({item:a})}))]}),m&&v(Rt,z({modelValue:l.value,"onUpdate:modelValue":a=>l.value=a,key:"tabs-window"},h),{default:()=>[u.value.map(a=>t.item?.({item:a})??v($t,{value:a.value},{default:()=>t[`item.${a.value}`]?.({item:a})})),t.window?.()]})])}),{}}}),Gt={key:0,id:"overlay",class:"pa-2 panel"},Dt={class:"component-container"},Ut={__name:"MobileLayout",setup(e){rt(m=>({"6d1d73a7":h.value,"0a8beb73":r.value,"6c22072d":x.value}));const n=re(ct),s=n.template.widgets,t=be(s),[l]=be([n.template?.background]),{mainRect:u}=dt(),o=I(-1),f=I(null),r=I(""),h=I(""),x=I("");return vt(()=>{h.value=u.value.top+"px",x.value=(u.value.bottom||48)+"px",r.value=u.value.bottom+(f.value?.$el?.clientHeight??0)+"px"}),(m,a)=>(C(),A(Tt,{class:"overflow-hidden main"},{default:F(()=>[(C(),A(ye,{suspensible:""},{default:F(()=>[X(l).component?(C(),A(Se(X(l).component),z({key:0,id:"bg-widget"},X(l).props),null,16)):se("v-if",!0)]),_:1})),(C(!0),Y(O,null,we(X(t),(g,d)=>(C(),Y(O,{key:d},[g.value.component?q((C(),Y("div",Gt,[v(G,{icon:"",variant:"text",class:"close-btn",onClick:a[0]||(a[0]=_=>o.value=-1)},{default:F(()=>[xe("✕")]),_:1}),(C(),A(ye,{suspensible:""},{default:F(()=>[q(ft("div",Dt,[(C(),A(Se(g.value.component),z({key:g.value.id,ref_for:!0},g.value.props),null,16))],512),[[le,o.value===d]])]),_:2},1024))],512)),[[le,o.value===d]]):se("v-if",!0)],64))),128)),v(Yt,{ref_key:"tabs",ref:f,"align-tabs":"center","bg-color":"surface",class:"tabs","show-arrows":"",modelValue:o.value,"onUpdate:modelValue":a[1]||(a[1]=g=>o.value=g)},{default:F(()=>[(C(!0),Y(O,null,we(X(t),(g,d)=>(C(),Y(O,{key:d},[g.value.component?(C(),A(Re,{key:0,value:d},{default:F(()=>[xe(mt(g.value.title),1)]),_:2},1032,["value"])):se("v-if",!0)],64))),128))]),_:1},8,["modelValue"])]),_:1}))}},Zt=ut(Ut,[["__scopeId","data-v-4fb3b04f"]]);export{Zt as default}; +import{k as Ie,p as R,o as Pe,m as Xe,g as M,u as Ye,r as I,c as y,a as $,V as G,b as v,F as O,d as z,e as ie,f as ue,h as Ge,i as De,j as pe,l as Ue,n as Be,s as E,w as Ee,q as je,t as q,v as Ne,x as re,y as ze,z as qe,A as Ke,B as le,C as ae,D as Qe,I as fe,E as Je,G as Ze,H as et,J as me,K as tt,L as he,M as ge,N as nt,O as ot,P as st,Q as lt,R as W,S as at,T as it,_ as ut,U as rt,W as ct,X as be,Y as dt,Z as vt,$ as C,a0 as A,a1 as F,a2 as ye,a3 as X,a4 as Se,a5 as se,a6 as Y,a7 as we,a8 as xe,a9 as ft,aa as mt}from"./index-B5c5Pwhg.js";import{f as ht,a as gt,s as bt,m as yt,u as St,b as wt}from"./forwardRefs-ayMwIJVs.js";import{u as xt}from"./ssrBoot-n6JOT_u2.js";import{M as kt}from"./transition-DCXsv86C.js";import{V as ke}from"./index-Dr4JVqt9.js";import{V as Tt}from"./VMain-Cp0gckiv.js";const Vt=e=>{const{touchstartX:n,touchendX:s,touchstartY:t,touchendY:l}=e,u=.5,o=16;e.offsetX=s-n,e.offsetY=l-t,Math.abs(e.offsetY)n+o&&e.right(e)),Math.abs(e.offsetX)t+o&&e.down(e))};function Ct(e,n){const s=e.changedTouches[0];n.touchstartX=s.clientX,n.touchstartY=s.clientY,n.start?.({originalEvent:e,...n})}function _t(e,n){const s=e.changedTouches[0];n.touchendX=s.clientX,n.touchendY=s.clientY,n.end?.({originalEvent:e,...n}),Vt(n)}function It(e,n){const s=e.changedTouches[0];n.touchmoveX=s.clientX,n.touchmoveY=s.clientY,n.move?.({originalEvent:e,...n})}function Pt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n={touchstartX:0,touchstartY:0,touchendX:0,touchendY:0,touchmoveX:0,touchmoveY:0,offsetX:0,offsetY:0,left:e.left,right:e.right,up:e.up,down:e.down,start:e.start,move:e.move,end:e.end};return{touchstart:s=>Ct(s,n),touchend:s=>_t(s,n),touchmove:s=>It(s,n)}}function pt(e,n){const s=n.value,t=s?.parent?e.parentElement:e,l=s?.options??{passive:!0},u=n.instance?.$.uid;if(!t||!u)return;const o=Pt(n.value);t._touchHandlers=t._touchHandlers??Object.create(null),t._touchHandlers[u]=o,Ie(o).forEach(f=>{t.addEventListener(f,o[f],l)})}function Bt(e,n){const s=n.value?.parent?e.parentElement:e,t=n.instance?.$.uid;if(!s?._touchHandlers||!t)return;const l=s._touchHandlers[t];Ie(l).forEach(u=>{s.removeEventListener(u,l[u])}),delete s._touchHandlers[t]}const We={mounted:pt,unmounted:Bt},Et=We,ce=Symbol.for("vuetify:v-tabs"),zt=R({fixed:Boolean,sliderColor:String,hideSlider:Boolean,direction:{type:String,default:"horizontal"},...Pe(Xe({selectedClass:"v-tab--selected",variant:"text"}),["active","block","flat","location","position","symbol"])},"VTab"),Re=M()({name:"VTab",props:zt(),setup(e,n){let{slots:s,attrs:t}=n;const{textColorClasses:l,textColorStyles:u}=Ye(e,"sliderColor"),o=I(),f=I(),r=y(()=>e.direction==="horizontal"),h=y(()=>o.value?.group?.isSelected.value??!1);function x(m){let{value:a}=m;if(a){const g=o.value?.$el.parentElement?.querySelector(".v-tab--selected .v-tab__slider"),d=f.value;if(!g||!d)return;const _=getComputedStyle(g).color,T=g.getBoundingClientRect(),V=d.getBoundingClientRect(),P=r.value?"x":"y",p=r.value?"X":"Y",b=r.value?"right":"bottom",S=r.value?"width":"height",k=T[P],H=V[P],B=k>H?T[b]-V[b]:T[P]-V[P],K=Math.sign(B)>0?r.value?"right":"bottom":Math.sign(B)<0?r.value?"left":"top":"center",Q=(Math.abs(B)+(Math.sign(B)<0?T[S]:V[S]))/Math.max(T[S],V[S])||0,j=T[S]/V[S]||0,N=1.5;gt(d,{backgroundColor:[_,"currentcolor"],transform:[`translate${p}(${B}px) scale${p}(${j})`,`translate${p}(${B/N}px) scale${p}(${(Q-1)/N+1})`,"none"],transformOrigin:Array(3).fill(K)},{duration:225,easing:bt})}}return $(()=>{const m=G.filterProps(e);return v(G,z({symbol:ce,ref:o,class:["v-tab",e.class],style:e.style,tabindex:h.value?0:-1,role:"tab","aria-selected":String(h.value),active:!1},m,t,{block:e.fixed,maxWidth:e.fixed?300:void 0,"onGroup:selected":x}),{...s,default:()=>v(O,null,[s.default?.()??e.text,!e.hideSlider&&v("div",{ref:f,class:["v-tab__slider",l.value],style:u.value},null)])})}),ht({},o)}}),Me=Symbol.for("vuetify:v-window"),$e=Symbol.for("vuetify:v-window-group"),He=R({continuous:Boolean,nextIcon:{type:[Boolean,String,Function,Object],default:"$next"},prevIcon:{type:[Boolean,String,Function,Object],default:"$prev"},reverse:Boolean,showArrows:{type:[Boolean,String],validator:e=>typeof e=="boolean"||e==="hover"},touch:{type:[Object,Boolean],default:void 0},direction:{type:String,default:"horizontal"},modelValue:null,disabled:Boolean,selectedClass:{type:String,default:"v-window-item--active"},mandatory:{type:[Boolean,String],default:"force"},...ie(),...ue(),...Ge()},"VWindow"),Te=M()({name:"VWindow",directives:{Touch:We},props:He(),emits:{"update:modelValue":e=>!0},setup(e,n){let{slots:s}=n;const{themeClasses:t}=De(e),{isRtl:l}=pe(),{t:u}=Ue(),o=Be(e,$e),f=I(),r=y(()=>l.value?!e.reverse:e.reverse),h=E(!1),x=y(()=>{const b=e.direction==="vertical"?"y":"x",k=(r.value?!h.value:h.value)?"-reverse":"";return`v-window-${b}${k}-transition`}),m=E(0),a=I(void 0),g=y(()=>o.items.value.findIndex(b=>o.selected.value.includes(b.id)));Ee(g,(b,S)=>{const k=o.items.value.length,H=k-1;k<=2?h.value=be.continuous||g.value!==0),_=y(()=>e.continuous||g.value!==o.items.value.length-1);function T(){d.value&&o.prev()}function V(){_.value&&o.next()}const P=y(()=>{const b=[],S={icon:l.value?e.nextIcon:e.prevIcon,class:`v-window__${r.value?"right":"left"}`,onClick:o.prev,"aria-label":u("$vuetify.carousel.prev")};b.push(d.value?s.prev?s.prev({props:S}):v(G,S,null):v("div",null,null));const k={icon:l.value?e.prevIcon:e.nextIcon,class:`v-window__${r.value?"left":"right"}`,onClick:o.next,"aria-label":u("$vuetify.carousel.next")};return b.push(_.value?s.next?s.next({props:k}):v(G,k,null):v("div",null,null)),b}),p=y(()=>e.touch===!1?e.touch:{...{left:()=>{r.value?T():V()},right:()=>{r.value?V():T()},start:S=>{let{originalEvent:k}=S;k.stopPropagation()}},...e.touch===!0?{}:e.touch});return $(()=>q(v(e.tag,{ref:f,class:["v-window",{"v-window--show-arrows-on-hover":e.showArrows==="hover"},t.value,e.class],style:e.style},{default:()=>[v("div",{class:"v-window__container",style:{height:a.value}},[s.default?.({group:o}),e.showArrows!==!1&&v("div",{class:"v-window__controls"},[P.value])]),s.additional?.({group:o})]}),[[Ne("touch"),p.value]])),{group:o}}}),Wt=R({...Pe(He(),["continuous","nextIcon","prevIcon","showArrows","touch","mandatory"])},"VTabsWindow"),Rt=M()({name:"VTabsWindow",props:Wt(),emits:{"update:modelValue":e=>!0},setup(e,n){let{slots:s}=n;const t=re(ce,null),l=ze(e,"modelValue"),u=y({get(){return l.value!=null||!t?l.value:t.items.value.find(o=>t.selected.value.includes(o.id))?.value},set(o){l.value=o}});return $(()=>{const o=Te.filterProps(e);return v(Te,z({_as:"VTabsWindow"},o,{modelValue:u.value,"onUpdate:modelValue":f=>u.value=f,class:["v-tabs-window",e.class],style:e.style,mandatory:!1,touch:!1}),s)}),{}}}),Ae=R({reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},...ie(),...qe(),...yt()},"VWindowItem"),Ve=M()({name:"VWindowItem",directives:{Touch:Et},props:Ae(),emits:{"group:selected":e=>!0},setup(e,n){let{slots:s}=n;const t=re(Me),l=Ke(e,$e),{isBooted:u}=xt();if(!t||!l)throw new Error("[Vuetify] VWindowItem must be used inside VWindow");const o=E(!1),f=y(()=>u.value&&(t.isReversed.value?e.reverseTransition!==!1:e.transition!==!1));function r(){!o.value||!t||(o.value=!1,t.transitionCount.value>0&&(t.transitionCount.value-=1,t.transitionCount.value===0&&(t.transitionHeight.value=void 0)))}function h(){o.value||!t||(o.value=!0,t.transitionCount.value===0&&(t.transitionHeight.value=ae(t.rootRef.value?.clientHeight)),t.transitionCount.value+=1)}function x(){r()}function m(d){o.value&&Qe(()=>{!f.value||!o.value||!t||(t.transitionHeight.value=ae(d.clientHeight))})}const a=y(()=>{const d=t.isReversed.value?e.reverseTransition:e.transition;return f.value?{name:typeof d!="string"?t.transition.value:d,onBeforeEnter:h,onAfterEnter:r,onEnterCancelled:x,onBeforeLeave:h,onAfterLeave:r,onLeaveCancelled:x,onEnter:m}:!1}),{hasContent:g}=St(e,l.isSelected);return $(()=>v(kt,{transition:a.value,disabled:!u.value},{default:()=>[q(v("div",{class:["v-window-item",l.selectedClass.value,e.class],style:e.style},[g.value&&s.default?.()]),[[le,l.isSelected.value]])]})),{groupItem:l}}}),Mt=R({...Ae()},"VTabsWindowItem"),$t=M()({name:"VTabsWindowItem",props:Mt(),setup(e,n){let{slots:s}=n;return $(()=>{const t=Ve.filterProps(e);return v(Ve,z({_as:"VTabsWindowItem"},t,{class:["v-tabs-window-item",e.class],style:e.style}),s)}),{}}});function Ht(e){let{selectedElement:n,containerElement:s,isRtl:t,isHorizontal:l}=e;const u=D(l,s),o=Fe(l,t,s),f=D(l,n),r=Oe(l,n),h=f*.4;return o>r?r-h:o+utypeof e=="boolean"||["always","desktop","mobile"].includes(e)},...ie(),...Je({mobile:null}),...ue(),...Ze({selectedClass:"v-slide-group-item--active"})},"VSlideGroup"),_e=M()({name:"VSlideGroup",props:Le(),emits:{"update:modelValue":e=>!0},setup(e,n){let{slots:s}=n;const{isRtl:t}=pe(),{displayClasses:l,mobile:u}=et(e),o=Be(e,e.symbol),f=E(!1),r=E(0),h=E(0),x=E(0),m=y(()=>e.direction==="horizontal"),{resizeRef:a,contentRect:g}=me(),{resizeRef:d,contentRect:_}=me(),T=tt(),V=y(()=>({container:a.el,duration:200,easing:"easeOutQuart"})),P=y(()=>o.selected.value.length?o.items.value.findIndex(i=>i.id===o.selected.value[0]):-1),p=y(()=>o.selected.value.length?o.items.value.findIndex(i=>i.id===o.selected.value[o.selected.value.length-1]):-1);if(he){let i=-1;Ee(()=>[o.selected.value,g.value,_.value,m.value],()=>{cancelAnimationFrame(i),i=requestAnimationFrame(()=>{if(g.value&&_.value){const c=m.value?"width":"height";h.value=g.value[c],x.value=_.value[c],f.value=h.value+1=0&&d.el){const c=d.el.children[p.value];S(c,e.centerActive)}})})}const b=E(!1);function S(i,c){let w=0;c?w=At({containerElement:a.el,isHorizontal:m.value,selectedElement:i}):w=Ht({containerElement:a.el,isHorizontal:m.value,isRtl:t.value,selectedElement:i}),k(w)}function k(i){if(!he||!a.el)return;const c=D(m.value,a.el),w=Fe(m.value,t.value,a.el);if(!(Ce(m.value,a.el)<=c||Math.abs(i-w)<16)){if(m.value&&t.value&&a.el){const{scrollWidth:ne,offsetWidth:oe}=a.el;i=ne-oe-i}m.value?T.horizontal(i,V.value):T(i,V.value)}}function H(i){const{scrollTop:c,scrollLeft:w}=i.target;r.value=m.value?w:c}function B(i){if(b.value=!0,!(!f.value||!d.el)){for(const c of i.composedPath())for(const w of d.el.children)if(w===c){S(w);return}}}function K(i){b.value=!1}let U=!1;function Q(i){!U&&!b.value&&!(i.relatedTarget&&d.el?.contains(i.relatedTarget))&&L(),U=!1}function j(){U=!0}function N(i){if(!d.el)return;function c(w){i.preventDefault(),L(w)}m.value?i.key==="ArrowRight"?c(t.value?"prev":"next"):i.key==="ArrowLeft"&&c(t.value?"next":"prev"):i.key==="ArrowDown"?c("next"):i.key==="ArrowUp"&&c("prev"),i.key==="Home"?c("first"):i.key==="End"&&c("last")}function L(i){if(!d.el)return;let c;if(!i)c=nt(d.el)[0];else if(i==="next"){if(c=d.el.querySelector(":focus")?.nextElementSibling,!c)return L("first")}else if(i==="prev"){if(c=d.el.querySelector(":focus")?.previousElementSibling,!c)return L("last")}else i==="first"?c=d.el.firstElementChild:i==="last"&&(c=d.el.lastElementChild);c&&c.focus({preventScroll:!0})}function J(i){const c=m.value&&t.value?-1:1,w=(i==="prev"?-c:c)*h.value;let te=r.value+w;if(m.value&&t.value&&a.el){const{scrollWidth:ne,offsetWidth:oe}=a.el;te+=ne-oe}k(te)}const Z=y(()=>({next:o.next,prev:o.prev,select:o.select,isSelected:o.isSelected})),ee=y(()=>{switch(e.showArrows){case"always":return!0;case"desktop":return!u.value;case!0:return f.value||Math.abs(r.value)>0;case"mobile":return u.value||f.value||Math.abs(r.value)>0;default:return!u.value&&(f.value||Math.abs(r.value)>0)}}),de=y(()=>Math.abs(r.value)>1),ve=y(()=>{if(!a.value)return!1;const i=Ce(m.value,a.el),c=Ft(m.value,a.el);return i-c-Math.abs(r.value)>1});return $(()=>v(e.tag,{class:["v-slide-group",{"v-slide-group--vertical":!m.value,"v-slide-group--has-affixes":ee.value,"v-slide-group--is-overflowing":f.value},l.value,e.class],style:e.style,tabindex:b.value||o.selected.value.length?-1:0,onFocus:Q},{default:()=>[ee.value&&v("div",{key:"prev",class:["v-slide-group__prev",{"v-slide-group__prev--disabled":!de.value}],onMousedown:j,onClick:()=>de.value&&J("prev")},[s.prev?.(Z.value)??v(ke,null,{default:()=>[v(ge,{icon:t.value?e.nextIcon:e.prevIcon},null)]})]),v("div",{key:"container",ref:a,class:"v-slide-group__container",onScroll:H},[v("div",{ref:d,class:"v-slide-group__content",onFocusin:B,onFocusout:K,onKeydown:N},[s.default?.(Z.value)])]),ee.value&&v("div",{key:"next",class:["v-slide-group__next",{"v-slide-group__next--disabled":!ve.value}],onMousedown:j,onClick:()=>ve.value&&J("next")},[s.next?.(Z.value)??v(ke,null,{default:()=>[v(ge,{icon:t.value?e.prevIcon:e.nextIcon},null)]})])]})),{selected:o.selected,scrollTo:J,scrollOffset:r,focus:L}}});function Lt(e){return e?e.map(n=>it(n)?n:{text:n,value:n}):[]}const Xt=R({alignTabs:{type:String,default:"start"},color:String,fixedTabs:Boolean,items:{type:Array,default:()=>[]},stacked:Boolean,bgColor:String,grow:Boolean,height:{type:[Number,String],default:void 0},hideSlider:Boolean,sliderColor:String,...Le({mandatory:"force",selectedClass:"v-tab-item--selected"}),...ot(),...ue()},"VTabs"),Yt=M()({name:"VTabs",props:Xt(),emits:{"update:modelValue":e=>!0},setup(e,n){let{attrs:s,slots:t}=n;const l=ze(e,"modelValue"),u=y(()=>Lt(e.items)),{densityClasses:o}=st(e),{backgroundColorClasses:f,backgroundColorStyles:r}=lt(W(e,"bgColor")),{scopeId:h}=wt();return at({VTab:{color:W(e,"color"),direction:W(e,"direction"),stacked:W(e,"stacked"),fixed:W(e,"fixedTabs"),sliderColor:W(e,"sliderColor"),hideSlider:W(e,"hideSlider")}}),$(()=>{const x=_e.filterProps(e),m=!!(t.window||e.items.length>0);return v(O,null,[v(_e,z(x,{modelValue:l.value,"onUpdate:modelValue":a=>l.value=a,class:["v-tabs",`v-tabs--${e.direction}`,`v-tabs--align-tabs-${e.alignTabs}`,{"v-tabs--fixed-tabs":e.fixedTabs,"v-tabs--grow":e.grow,"v-tabs--stacked":e.stacked},o.value,f.value,e.class],style:[{"--v-tabs-height":ae(e.height)},r.value,e.style],role:"tablist",symbol:ce},h,s),{default:()=>[t.default?.()??u.value.map(a=>t.tab?.({item:a})??v(Re,z(a,{key:a.text,value:a.value}),{default:()=>t[`tab.${a.value}`]?.({item:a})}))]}),m&&v(Rt,z({modelValue:l.value,"onUpdate:modelValue":a=>l.value=a,key:"tabs-window"},h),{default:()=>[u.value.map(a=>t.item?.({item:a})??v($t,{value:a.value},{default:()=>t[`item.${a.value}`]?.({item:a})})),t.window?.()]})])}),{}}}),Gt={key:0,id:"overlay",class:"pa-2 panel"},Dt={class:"component-container"},Ut={__name:"MobileLayout",setup(e){rt(m=>({a5e6ca1c:h.value,"369f1584":r.value,a7dda310:x.value}));const n=re(ct),s=n.template.widgets,t=be(s),[l]=be([n.template?.background]),{mainRect:u}=dt(),o=I(-1),f=I(null),r=I(""),h=I(""),x=I("");return vt(()=>{h.value=u.value.top+"px",x.value=(u.value.bottom||48)+"px",r.value=u.value.bottom+(f.value?.$el?.clientHeight??0)+"px"}),(m,a)=>(C(),A(Tt,{class:"overflow-hidden main"},{default:F(()=>[(C(),A(ye,{suspensible:""},{default:F(()=>[X(l).component?(C(),A(Se(X(l).component),z({key:0,id:"bg-widget"},X(l).props),null,16)):se("v-if",!0)]),_:1})),(C(!0),Y(O,null,we(X(t),(g,d)=>(C(),Y(O,{key:d},[g.value.component?q((C(),Y("div",Gt,[v(G,{icon:"",variant:"text",class:"close-btn",onClick:a[0]||(a[0]=_=>o.value=-1)},{default:F(()=>[xe("✕")]),_:1}),(C(),A(ye,{suspensible:""},{default:F(()=>[q(ft("div",Dt,[(C(),A(Se(g.value.component),z({key:g.value.id,ref_for:!0},g.value.props),null,16))],512),[[le,o.value===d]])]),_:2},1024))],512)),[[le,o.value===d]]):se("v-if",!0)],64))),128)),v(Yt,{ref_key:"tabs",ref:f,"align-tabs":"center","bg-color":"surface",class:"tabs","show-arrows":"",modelValue:o.value,"onUpdate:modelValue":a[1]||(a[1]=g=>o.value=g)},{default:F(()=>[(C(!0),Y(O,null,we(X(t),(g,d)=>(C(),Y(O,{key:d},[g.value.component?(C(),A(Re,{key:0,value:d},{default:F(()=>[xe(mt(g.value.title),1)]),_:2},1032,["value"])):se("v-if",!0)],64))),128))]),_:1},8,["modelValue"])]),_:1}))}},Zt=ut(Ut,[["__scopeId","data-v-a197a171"]]);export{Zt as default}; diff --git a/pr-preview/pr-17/assets/MobileLayout-But2eoJc.css b/pr-preview/pr-17/assets/MobileLayout-mAst2ZGH.css similarity index 93% rename from pr-preview/pr-17/assets/MobileLayout-But2eoJc.css rename to pr-preview/pr-17/assets/MobileLayout-mAst2ZGH.css index 062a32c..6bff55a 100644 --- a/pr-preview/pr-17/assets/MobileLayout-But2eoJc.css +++ b/pr-preview/pr-17/assets/MobileLayout-mAst2ZGH.css @@ -1 +1 @@ -.main[data-v-4fb3b04f]{height:91dvh}.panel[data-v-4fb3b04f]{top:var(--6d1d73a7);bottom:var(--0a8beb73);position:absolute;overflow:hidden;width:100%;left:0;z-index:1;background:rgb(var(--v-theme-surface))}.component-container[data-v-4fb3b04f]{height:90%}.close-btn[data-v-4fb3b04f]{height:5%;position:relative}.tabs[data-v-4fb3b04f]{bottom:var(--6c22072d);position:relative;z-index:10}.v-tab.v-tab.v-btn{height:var(--v-tabs-height);border-radius:0;min-width:90px}.v-slide-group--horizontal .v-tab{max-width:360px}.v-slide-group--vertical .v-tab{justify-content:start}.v-tab__slider{position:absolute;bottom:0;left:0;height:2px;width:100%;background:currentColor;pointer-events:none;opacity:0}.v-tab--selected .v-tab__slider{opacity:1}.v-slide-group--vertical .v-tab__slider{top:0;height:100%;width:2px}.v-tabs{display:flex;height:var(--v-tabs-height)}.v-tabs--density-default{--v-tabs-height: 48px}.v-tabs--density-default.v-tabs--stacked{--v-tabs-height: 72px}.v-tabs--density-comfortable{--v-tabs-height: 44px}.v-tabs--density-comfortable.v-tabs--stacked{--v-tabs-height: 68px}.v-tabs--density-compact{--v-tabs-height: 36px}.v-tabs--density-compact.v-tabs--stacked{--v-tabs-height: 60px}.v-tabs.v-slide-group--vertical{height:auto;flex:none;--v-tabs-height: 48px}.v-tabs--align-tabs-title:not(.v-slide-group--has-affixes) .v-tab:first-child{margin-inline-start:42px}.v-tabs--fixed-tabs .v-slide-group__content>*:last-child,.v-tabs--align-tabs-center .v-slide-group__content>*:last-child{margin-inline-end:auto}.v-tabs--fixed-tabs .v-slide-group__content>*:first-child,.v-tabs--align-tabs-center .v-slide-group__content>*:first-child{margin-inline-start:auto}.v-tabs--grow{flex-grow:1}.v-tabs--grow .v-tab{flex:1 0 auto;max-width:none}.v-tabs--align-tabs-end .v-tab:first-child{margin-inline-start:auto}.v-tabs--align-tabs-end .v-tab:last-child{margin-inline-end:0}@media (max-width: 1279.98px){.v-tabs.v-slide-group--is-overflowing.v-slide-group--horizontal:not(.v-slide-group--has-affixes) .v-tab:first-child{margin-inline-start:52px}.v-tabs.v-slide-group--is-overflowing.v-slide-group--horizontal:not(.v-slide-group--has-affixes) .v-tab:last-child{margin-inline-end:52px}}.v-window{overflow:hidden}.v-window__container{display:flex;flex-direction:column;height:inherit;position:relative;transition:.3s cubic-bezier(.25,.8,.5,1)}.v-window__controls{position:absolute;left:0;top:0;width:100%;height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 16px;pointer-events:none}.v-window__controls>*{pointer-events:auto}.v-window--show-arrows-on-hover{overflow:hidden}.v-window--show-arrows-on-hover .v-window__left{transform:translate(-200%)}.v-window--show-arrows-on-hover .v-window__right{transform:translate(200%)}.v-window--show-arrows-on-hover:hover .v-window__left,.v-window--show-arrows-on-hover:hover .v-window__right{transform:translate(0)}.v-window-x-transition-enter-active,.v-window-x-transition-leave-active,.v-window-x-reverse-transition-enter-active,.v-window-x-reverse-transition-leave-active,.v-window-y-transition-enter-active,.v-window-y-transition-leave-active,.v-window-y-reverse-transition-enter-active,.v-window-y-reverse-transition-leave-active{transition:.3s cubic-bezier(.25,.8,.5,1)}.v-window-x-transition-leave-from,.v-window-x-transition-leave-to,.v-window-x-reverse-transition-leave-from,.v-window-x-reverse-transition-leave-to,.v-window-y-transition-leave-from,.v-window-y-transition-leave-to,.v-window-y-reverse-transition-leave-from,.v-window-y-reverse-transition-leave-to{position:absolute!important;top:0;width:100%}.v-window-x-transition-enter-from{transform:translate(100%)}.v-window-x-transition-leave-to,.v-window-x-reverse-transition-enter-from{transform:translate(-100%)}.v-window-x-reverse-transition-leave-to{transform:translate(100%)}.v-window-y-transition-enter-from{transform:translateY(100%)}.v-window-y-transition-leave-to,.v-window-y-reverse-transition-enter-from{transform:translateY(-100%)}.v-window-y-reverse-transition-leave-to{transform:translateY(100%)}.v-slide-group{display:flex;overflow:hidden}.v-slide-group__next,.v-slide-group__prev{align-items:center;display:flex;flex:0 1 52px;justify-content:center;min-width:52px;cursor:pointer}.v-slide-group__next--disabled,.v-slide-group__prev--disabled{pointer-events:none;opacity:var(--v-disabled-opacity)}.v-slide-group__content{display:flex;flex:1 0 auto;position:relative;transition:.2s all cubic-bezier(.4,0,.2,1);white-space:nowrap}.v-slide-group__content>*{white-space:initial}.v-slide-group__container{contain:content;display:flex;flex:1 1 auto;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;scrollbar-color:rgba(0,0,0,0)}.v-slide-group__container::-webkit-scrollbar{display:none}.v-slide-group--vertical{max-height:inherit}.v-slide-group--vertical,.v-slide-group--vertical .v-slide-group__container,.v-slide-group--vertical .v-slide-group__content{flex-direction:column}.v-slide-group--vertical .v-slide-group__container{overflow-x:hidden;overflow-y:auto} +.main[data-v-a197a171]{height:91dvh}.panel[data-v-a197a171]{top:var(--a5e6ca1c);bottom:var(--369f1584);position:absolute;overflow:hidden;width:100%;left:0;z-index:1;background:rgb(var(--v-theme-surface))}.component-container[data-v-a197a171]{height:90%}.close-btn[data-v-a197a171]{height:5%;position:relative}.tabs[data-v-a197a171]{bottom:var(--a7dda310);position:relative;z-index:10}.v-tab.v-tab.v-btn{height:var(--v-tabs-height);border-radius:0;min-width:90px}.v-slide-group--horizontal .v-tab{max-width:360px}.v-slide-group--vertical .v-tab{justify-content:start}.v-tab__slider{position:absolute;bottom:0;left:0;height:2px;width:100%;background:currentColor;pointer-events:none;opacity:0}.v-tab--selected .v-tab__slider{opacity:1}.v-slide-group--vertical .v-tab__slider{top:0;height:100%;width:2px}.v-tabs{display:flex;height:var(--v-tabs-height)}.v-tabs--density-default{--v-tabs-height: 48px}.v-tabs--density-default.v-tabs--stacked{--v-tabs-height: 72px}.v-tabs--density-comfortable{--v-tabs-height: 44px}.v-tabs--density-comfortable.v-tabs--stacked{--v-tabs-height: 68px}.v-tabs--density-compact{--v-tabs-height: 36px}.v-tabs--density-compact.v-tabs--stacked{--v-tabs-height: 60px}.v-tabs.v-slide-group--vertical{height:auto;flex:none;--v-tabs-height: 48px}.v-tabs--align-tabs-title:not(.v-slide-group--has-affixes) .v-tab:first-child{margin-inline-start:42px}.v-tabs--fixed-tabs .v-slide-group__content>*:last-child,.v-tabs--align-tabs-center .v-slide-group__content>*:last-child{margin-inline-end:auto}.v-tabs--fixed-tabs .v-slide-group__content>*:first-child,.v-tabs--align-tabs-center .v-slide-group__content>*:first-child{margin-inline-start:auto}.v-tabs--grow{flex-grow:1}.v-tabs--grow .v-tab{flex:1 0 auto;max-width:none}.v-tabs--align-tabs-end .v-tab:first-child{margin-inline-start:auto}.v-tabs--align-tabs-end .v-tab:last-child{margin-inline-end:0}@media (max-width: 1279.98px){.v-tabs.v-slide-group--is-overflowing.v-slide-group--horizontal:not(.v-slide-group--has-affixes) .v-tab:first-child{margin-inline-start:52px}.v-tabs.v-slide-group--is-overflowing.v-slide-group--horizontal:not(.v-slide-group--has-affixes) .v-tab:last-child{margin-inline-end:52px}}.v-window{overflow:hidden}.v-window__container{display:flex;flex-direction:column;height:inherit;position:relative;transition:.3s cubic-bezier(.25,.8,.5,1)}.v-window__controls{position:absolute;left:0;top:0;width:100%;height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 16px;pointer-events:none}.v-window__controls>*{pointer-events:auto}.v-window--show-arrows-on-hover{overflow:hidden}.v-window--show-arrows-on-hover .v-window__left{transform:translate(-200%)}.v-window--show-arrows-on-hover .v-window__right{transform:translate(200%)}.v-window--show-arrows-on-hover:hover .v-window__left,.v-window--show-arrows-on-hover:hover .v-window__right{transform:translate(0)}.v-window-x-transition-enter-active,.v-window-x-transition-leave-active,.v-window-x-reverse-transition-enter-active,.v-window-x-reverse-transition-leave-active,.v-window-y-transition-enter-active,.v-window-y-transition-leave-active,.v-window-y-reverse-transition-enter-active,.v-window-y-reverse-transition-leave-active{transition:.3s cubic-bezier(.25,.8,.5,1)}.v-window-x-transition-leave-from,.v-window-x-transition-leave-to,.v-window-x-reverse-transition-leave-from,.v-window-x-reverse-transition-leave-to,.v-window-y-transition-leave-from,.v-window-y-transition-leave-to,.v-window-y-reverse-transition-leave-from,.v-window-y-reverse-transition-leave-to{position:absolute!important;top:0;width:100%}.v-window-x-transition-enter-from{transform:translate(100%)}.v-window-x-transition-leave-to,.v-window-x-reverse-transition-enter-from{transform:translate(-100%)}.v-window-x-reverse-transition-leave-to{transform:translate(100%)}.v-window-y-transition-enter-from{transform:translateY(100%)}.v-window-y-transition-leave-to,.v-window-y-reverse-transition-enter-from{transform:translateY(-100%)}.v-window-y-reverse-transition-leave-to{transform:translateY(100%)}.v-slide-group{display:flex;overflow:hidden}.v-slide-group__next,.v-slide-group__prev{align-items:center;display:flex;flex:0 1 52px;justify-content:center;min-width:52px;cursor:pointer}.v-slide-group__next--disabled,.v-slide-group__prev--disabled{pointer-events:none;opacity:var(--v-disabled-opacity)}.v-slide-group__content{display:flex;flex:1 0 auto;position:relative;transition:.2s all cubic-bezier(.4,0,.2,1);white-space:nowrap}.v-slide-group__content>*{white-space:initial}.v-slide-group__container{contain:content;display:flex;flex:1 1 auto;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;scrollbar-color:rgba(0,0,0,0)}.v-slide-group__container::-webkit-scrollbar{display:none}.v-slide-group--vertical{max-height:inherit}.v-slide-group--vertical,.v-slide-group--vertical .v-slide-group__container,.v-slide-group--vertical .v-slide-group__content{flex-direction:column}.v-slide-group--vertical .v-slide-group__container{overflow-x:hidden;overflow-y:auto} diff --git a/pr-preview/pr-17/assets/VImg-DhEwC7r1.js b/pr-preview/pr-17/assets/VImg-3feAnqWP.js similarity index 84% rename from pr-preview/pr-17/assets/VImg-DhEwC7r1.js rename to pr-preview/pr-17/assets/VImg-3feAnqWP.js index ed7b0ca..3ce270c 100644 --- a/pr-preview/pr-17/assets/VImg-DhEwC7r1.js +++ b/pr-preview/pr-17/assets/VImg-3feAnqWP.js @@ -1 +1 @@ -import{bq as O,p as W,e as D,ac as G,g as $,ad as J,a as q,b as n,c as h,ag as K,Q as X,R as Y,aj as Z,aH as p,s as f,r as ee,w as C,br as te,D as ne,am as re,t as U,v as ae,F as se,d as ie,C as le,B as oe}from"./index-DBoWNDl8.js";import{m as ue,M as b}from"./transition-C0IRM1SU.js";function ce(e,s){if(!O)return;const i=s.modifiers||{},l=s.value,{handler:v,options:R}=typeof l=="object"?l:{handler:l,options:{}},S=new IntersectionObserver(function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],_=arguments.length>1?arguments[1]:void 0;const r=e._observe?.[s.instance.$.uid];if(!r)return;const a=c.some(d=>d.isIntersecting);v&&(!i.quiet||r.init)&&(!i.once||a||r.init)&&v(a,c,_),a&&i.once?E(e,s):r.init=!0},R);e._observe=Object(e._observe),e._observe[s.instance.$.uid]={init:!1,observer:S},S.observe(e)}function E(e,s){const i=e._observe?.[s.instance.$.uid];i&&(i.observer.unobserve(e),delete e._observe[s.instance.$.uid])}const de={mounted:ce,unmounted:E};function ve(e){return{aspectStyles:h(()=>{const s=Number(e.aspectRatio);return s?{paddingBottom:String(1/s*100)+"%"}:void 0})}}const H=W({aspectRatio:[String,Number],contentClass:null,inline:Boolean,...D(),...G()},"VResponsive"),F=$()({name:"VResponsive",props:H(),setup(e,s){let{slots:i}=s;const{aspectStyles:l}=ve(e),{dimensionStyles:v}=J(e);return q(()=>n("div",{class:["v-responsive",{"v-responsive--inline":e.inline},e.class],style:[v.value,e.style]},[n("div",{class:"v-responsive__sizer",style:l.value},null),i.additional?.(),i.default&&n("div",{class:["v-responsive__content",e.contentClass]},[i.default()])])),{}}}),ge=W({alt:String,cover:Boolean,color:String,draggable:{type:[Boolean,String],default:void 0},eager:Boolean,gradient:String,lazySrc:String,options:{type:Object,default:()=>({root:void 0,rootMargin:void 0,threshold:void 0})},sizes:String,src:{type:[String,Object],default:""},crossorigin:String,referrerpolicy:String,srcset:String,position:String,...H(),...D(),...K(),...ue()},"VImg"),Se=$()({name:"VImg",directives:{intersect:de},props:ge(),emits:{loadstart:e=>!0,load:e=>!0,error:e=>!0},setup(e,s){let{emit:i,slots:l}=s;const{backgroundColorClasses:v,backgroundColorStyles:R}=X(Y(e,"color")),{roundedClasses:S}=Z(e),c=p("VImg"),_=f(""),r=ee(),a=f(e.eager?"loading":"idle"),d=f(),y=f(),o=h(()=>e.src&&typeof e.src=="object"?{src:e.src.src,srcset:e.srcset||e.src.srcset,lazySrc:e.lazySrc||e.src.lazySrc,aspect:Number(e.aspectRatio||e.src.aspect||0)}:{src:e.src,srcset:e.srcset,lazySrc:e.lazySrc,aspect:Number(e.aspectRatio||0)}),g=h(()=>o.value.aspect||d.value/y.value||0);C(()=>e.src,()=>{z(a.value!=="idle")}),C(g,(t,u)=>{!t&&u&&r.value&&m(r.value)}),te(()=>z());function z(t){if(!(e.eager&&t)&&!(O&&!t&&!e.eager)){if(a.value="loading",o.value.lazySrc){const u=new Image;u.src=o.value.lazySrc,m(u,null)}o.value.src&&ne(()=>{i("loadstart",r.value?.currentSrc||o.value.src),setTimeout(()=>{if(!c.isUnmounted)if(r.value?.complete){if(r.value.naturalWidth||w(),a.value==="error")return;g.value||m(r.value,null),a.value==="loading"&&P()}else g.value||m(r.value),k()})})}}function P(){c.isUnmounted||(k(),m(r.value),a.value="loaded",i("load",r.value?.currentSrc||o.value.src))}function w(){c.isUnmounted||(a.value="error",i("error",r.value?.currentSrc||o.value.src))}function k(){const t=r.value;t&&(_.value=t.currentSrc||t.src)}let I=-1;re(()=>{clearTimeout(I)});function m(t){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:100;const B=()=>{if(clearTimeout(I),c.isUnmounted)return;const{naturalHeight:j,naturalWidth:N}=t;j||N?(d.value=N,y.value=j):!t.complete&&a.value==="loading"&&u!=null?I=window.setTimeout(B,u):(t.currentSrc.endsWith(".svg")||t.currentSrc.startsWith("data:image/svg+xml"))&&(d.value=1,y.value=1)};B()}const T=h(()=>({"v-img__img--cover":e.cover,"v-img__img--contain":!e.cover})),M=()=>{if(!o.value.src||a.value==="idle")return null;const t=n("img",{class:["v-img__img",T.value],style:{objectPosition:e.position},src:o.value.src,srcset:o.value.srcset,alt:e.alt,crossorigin:e.crossorigin,referrerpolicy:e.referrerpolicy,draggable:e.draggable,sizes:e.sizes,ref:r,onLoad:P,onError:w},null),u=l.sources?.();return n(b,{transition:e.transition,appear:!0},{default:()=>[U(u?n("picture",{class:"v-img__picture"},[u,t]):t,[[oe,a.value==="loaded"]])]})},x=()=>n(b,{transition:e.transition},{default:()=>[o.value.lazySrc&&a.value!=="loaded"&&n("img",{class:["v-img__img","v-img__img--preload",T.value],style:{objectPosition:e.position},src:o.value.lazySrc,alt:e.alt,crossorigin:e.crossorigin,referrerpolicy:e.referrerpolicy,draggable:e.draggable},null)]}),A=()=>l.placeholder?n(b,{transition:e.transition,appear:!0},{default:()=>[(a.value==="loading"||a.value==="error"&&!l.error)&&n("div",{class:"v-img__placeholder"},[l.placeholder()])]}):null,L=()=>l.error?n(b,{transition:e.transition,appear:!0},{default:()=>[a.value==="error"&&n("div",{class:"v-img__error"},[l.error()])]}):null,Q=()=>e.gradient?n("div",{class:"v-img__gradient",style:{backgroundImage:`linear-gradient(${e.gradient})`}},null):null,V=f(!1);{const t=C(g,u=>{u&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{V.value=!0})}),t())})}return q(()=>{const t=F.filterProps(e);return U(n(F,ie({class:["v-img",{"v-img--booting":!V.value},v.value,S.value,e.class],style:[{width:le(e.width==="auto"?d.value:e.width)},R.value,e.style]},t,{aspectRatio:g.value,"aria-label":e.alt,role:e.alt?"img":void 0}),{additional:()=>n(se,null,[n(M,null,null),n(x,null,null),n(Q,null,null),n(A,null,null),n(L,null,null)]),default:l.default}),[[ae("intersect"),{handler:z,options:e.options},null,{once:!0}]])}),{currentSrc:_,image:r,state:a,naturalWidth:d,naturalHeight:y}}});export{Se as V}; +import{br as O,p as W,e as D,ac as G,g as $,ad as J,a as E,b as n,c as h,ag as K,Q as X,R as Y,aj as Z,aH as p,s as f,r as ee,w as C,bs as te,D as ne,am as re,t as U,v as ae,F as se,d as ie,C as le,B as oe}from"./index-B5c5Pwhg.js";import{m as ue,M as b}from"./transition-DCXsv86C.js";function ce(e,s){if(!O)return;const i=s.modifiers||{},l=s.value,{handler:v,options:R}=typeof l=="object"?l:{handler:l,options:{}},S=new IntersectionObserver(function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],_=arguments.length>1?arguments[1]:void 0;const r=e._observe?.[s.instance.$.uid];if(!r)return;const a=c.some(d=>d.isIntersecting);v&&(!i.quiet||r.init)&&(!i.once||a||r.init)&&v(a,c,_),a&&i.once?H(e,s):r.init=!0},R);e._observe=Object(e._observe),e._observe[s.instance.$.uid]={init:!1,observer:S},S.observe(e)}function H(e,s){const i=e._observe?.[s.instance.$.uid];i&&(i.observer.unobserve(e),delete e._observe[s.instance.$.uid])}const de={mounted:ce,unmounted:H};function ve(e){return{aspectStyles:h(()=>{const s=Number(e.aspectRatio);return s?{paddingBottom:String(1/s*100)+"%"}:void 0})}}const M=W({aspectRatio:[String,Number],contentClass:null,inline:Boolean,...D(),...G()},"VResponsive"),F=$()({name:"VResponsive",props:M(),setup(e,s){let{slots:i}=s;const{aspectStyles:l}=ve(e),{dimensionStyles:v}=J(e);return E(()=>n("div",{class:["v-responsive",{"v-responsive--inline":e.inline},e.class],style:[v.value,e.style]},[n("div",{class:"v-responsive__sizer",style:l.value},null),i.additional?.(),i.default&&n("div",{class:["v-responsive__content",e.contentClass]},[i.default()])])),{}}}),ge=W({alt:String,cover:Boolean,color:String,draggable:{type:[Boolean,String],default:void 0},eager:Boolean,gradient:String,lazySrc:String,options:{type:Object,default:()=>({root:void 0,rootMargin:void 0,threshold:void 0})},sizes:String,src:{type:[String,Object],default:""},crossorigin:String,referrerpolicy:String,srcset:String,position:String,...M(),...D(),...K(),...ue()},"VImg"),Se=$()({name:"VImg",directives:{intersect:de},props:ge(),emits:{loadstart:e=>!0,load:e=>!0,error:e=>!0},setup(e,s){let{emit:i,slots:l}=s;const{backgroundColorClasses:v,backgroundColorStyles:R}=X(Y(e,"color")),{roundedClasses:S}=Z(e),c=p("VImg"),_=f(""),r=ee(),a=f(e.eager?"loading":"idle"),d=f(),y=f(),o=h(()=>e.src&&typeof e.src=="object"?{src:e.src.src,srcset:e.srcset||e.src.srcset,lazySrc:e.lazySrc||e.src.lazySrc,aspect:Number(e.aspectRatio||e.src.aspect||0)}:{src:e.src,srcset:e.srcset,lazySrc:e.lazySrc,aspect:Number(e.aspectRatio||0)}),g=h(()=>o.value.aspect||d.value/y.value||0);C(()=>e.src,()=>{z(a.value!=="idle")}),C(g,(t,u)=>{!t&&u&&r.value&&m(r.value)}),te(()=>z());function z(t){if(!(e.eager&&t)&&!(O&&!t&&!e.eager)){if(a.value="loading",o.value.lazySrc){const u=new Image;u.src=o.value.lazySrc,m(u,null)}o.value.src&&ne(()=>{i("loadstart",r.value?.currentSrc||o.value.src),setTimeout(()=>{if(!c.isUnmounted)if(r.value?.complete){if(r.value.naturalWidth||w(),a.value==="error")return;g.value||m(r.value,null),a.value==="loading"&&P()}else g.value||m(r.value),k()})})}}function P(){c.isUnmounted||(k(),m(r.value),a.value="loaded",i("load",r.value?.currentSrc||o.value.src))}function w(){c.isUnmounted||(a.value="error",i("error",r.value?.currentSrc||o.value.src))}function k(){const t=r.value;t&&(_.value=t.currentSrc||t.src)}let I=-1;re(()=>{clearTimeout(I)});function m(t){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:100;const B=()=>{if(clearTimeout(I),c.isUnmounted)return;const{naturalHeight:j,naturalWidth:N}=t;j||N?(d.value=N,y.value=j):!t.complete&&a.value==="loading"&&u!=null?I=window.setTimeout(B,u):(t.currentSrc.endsWith(".svg")||t.currentSrc.startsWith("data:image/svg+xml"))&&(d.value=1,y.value=1)};B()}const T=h(()=>({"v-img__img--cover":e.cover,"v-img__img--contain":!e.cover})),q=()=>{if(!o.value.src||a.value==="idle")return null;const t=n("img",{class:["v-img__img",T.value],style:{objectPosition:e.position},src:o.value.src,srcset:o.value.srcset,alt:e.alt,crossorigin:e.crossorigin,referrerpolicy:e.referrerpolicy,draggable:e.draggable,sizes:e.sizes,ref:r,onLoad:P,onError:w},null),u=l.sources?.();return n(b,{transition:e.transition,appear:!0},{default:()=>[U(u?n("picture",{class:"v-img__picture"},[u,t]):t,[[oe,a.value==="loaded"]])]})},x=()=>n(b,{transition:e.transition},{default:()=>[o.value.lazySrc&&a.value!=="loaded"&&n("img",{class:["v-img__img","v-img__img--preload",T.value],style:{objectPosition:e.position},src:o.value.lazySrc,alt:e.alt,crossorigin:e.crossorigin,referrerpolicy:e.referrerpolicy,draggable:e.draggable},null)]}),A=()=>l.placeholder?n(b,{transition:e.transition,appear:!0},{default:()=>[(a.value==="loading"||a.value==="error"&&!l.error)&&n("div",{class:"v-img__placeholder"},[l.placeholder()])]}):null,L=()=>l.error?n(b,{transition:e.transition,appear:!0},{default:()=>[a.value==="error"&&n("div",{class:"v-img__error"},[l.error()])]}):null,Q=()=>e.gradient?n("div",{class:"v-img__gradient",style:{backgroundImage:`linear-gradient(${e.gradient})`}},null):null,V=f(!1);{const t=C(g,u=>{u&&(requestAnimationFrame(()=>{requestAnimationFrame(()=>{V.value=!0})}),t())})}return E(()=>{const t=F.filterProps(e);return U(n(F,ie({class:["v-img",{"v-img--booting":!V.value},v.value,S.value,e.class],style:[{width:le(e.width==="auto"?d.value:e.width)},R.value,e.style]},t,{aspectRatio:g.value,"aria-label":e.alt,role:e.alt?"img":void 0}),{additional:()=>n(se,null,[n(q,null,null),n(x,null,null),n(Q,null,null),n(A,null,null),n(L,null,null)]),default:l.default}),[[ae("intersect"),{handler:z,options:e.options},null,{once:!0}]])}),{currentSrc:_,image:r,state:a,naturalWidth:d,naturalHeight:y}}});export{Se as V}; diff --git a/pr-preview/pr-17/assets/VMain-XnWXrEcc.js b/pr-preview/pr-17/assets/VMain-Cp0gckiv.js similarity index 78% rename from pr-preview/pr-17/assets/VMain-XnWXrEcc.js rename to pr-preview/pr-17/assets/VMain-Cp0gckiv.js index d6a752c..3a6cf60 100644 --- a/pr-preview/pr-17/assets/VMain-XnWXrEcc.js +++ b/pr-preview/pr-17/assets/VMain-Cp0gckiv.js @@ -1 +1 @@ -import{p as i,e as m,ac as c,f as u,g as d,ad as y,Y as v,a as f,b as e}from"./index-DBoWNDl8.js";import{u as V}from"./ssrBoot-CqR98f8O.js";const b=i({scrollable:Boolean,...m(),...c(),...u({tag:"main"})},"VMain"),k=d()({name:"VMain",props:b(),setup(a,o){let{slots:s}=o;const{dimensionStyles:l}=y(a),{mainStyles:t,layoutIsReady:n}=v(),{ssrBootStyles:r}=V();return f(()=>e(a.tag,{class:["v-main",{"v-main--scrollable":a.scrollable},a.class],style:[t.value,r.value,l.value,a.style]},{default:()=>[a.scrollable?e("div",{class:"v-main__scroller"},[s.default?.()]):s.default?.()]})),n}});export{k as V}; +import{p as i,e as m,ac as c,f as u,g as d,ad as y,Y as v,a as f,b as e}from"./index-B5c5Pwhg.js";import{u as V}from"./ssrBoot-n6JOT_u2.js";const b=i({scrollable:Boolean,...m(),...c(),...u({tag:"main"})},"VMain"),k=d()({name:"VMain",props:b(),setup(a,o){let{slots:s}=o;const{dimensionStyles:l}=y(a),{mainStyles:t,layoutIsReady:n}=v(),{ssrBootStyles:r}=V();return f(()=>e(a.tag,{class:["v-main",{"v-main--scrollable":a.scrollable},a.class],style:[t.value,r.value,l.value,a.style]},{default:()=>[a.scrollable?e("div",{class:"v-main__scroller"},[s.default?.()]):s.default?.()]})),n}});export{k as V}; diff --git a/pr-preview/pr-17/assets/WidgetsContainer-UzPFYh1W.js b/pr-preview/pr-17/assets/WidgetsContainer-nsM0d-_k.js similarity index 94% rename from pr-preview/pr-17/assets/WidgetsContainer-UzPFYh1W.js rename to pr-preview/pr-17/assets/WidgetsContainer-nsM0d-_k.js index 9985865..8dbf675 100644 --- a/pr-preview/pr-17/assets/WidgetsContainer-UzPFYh1W.js +++ b/pr-preview/pr-17/assets/WidgetsContainer-nsM0d-_k.js @@ -1 +1 @@ -import{X as g,r as i,Y as y,Z as x,D as v,$ as n,a6 as m,a7 as E,a3 as H,F as k,a9 as f,aa as C,a0 as _,d as w,a4 as A,b1 as D}from"./index-DBoWNDl8.js";class F extends HTMLDetailsElement{constructor(){super()}connectedCallback(){this.el=this,this.summary=this.querySelector("summary"),this.content=this.lastElementChild,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.summary.addEventListener("click",e=>this.onClick(e))}onClick(e){e?.preventDefault(),this.el.style.overflow="hidden",this.isClosing||!this.el.open?this.doOpen():(this.isExpanding||this.el.open)&&this.shrink()}shrink(){this.isClosing=!0;const e=`${this.el.offsetHeight}px`,t=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[e,t]},{duration:300,easing:"ease-out"}),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}doOpen(){this.el.style.height=`${this.el.offsetHeight}px`,this.el.open=!0,window.requestAnimationFrame(()=>this.expand()),this.parentElement.querySelectorAll("details[open][exclusive]").forEach(t=>{t!==this&&t.onClick()})}expand(){this.isExpanding=!0;const e=`${this.el.offsetHeight}px`,t=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[e,t]},{duration:300,easing:"ease-out"}),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(e){this.el.open=e,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.el.style.height=this.el.style.overflow=""}}customElements.define("animated-details",F,{extends:"details"});const b={__name:"WidgetsContainer",props:{widgets:{type:Array,required:!0}},setup(a){const t=g(a.widgets),l=i([]),o=i([]),h=i(""),r=i(0),{mainRect:d}=y();return x(async()=>{await v(()=>{r.value=o.value.reduce((c,u)=>c+=u.clientHeight,0),h.value=(l.value[0].parentElement?.scrollHeight??0)-r.value-d.value.top+"px"})}),(c,u)=>(n(!0),m(k,null,E(H(t),(s,p)=>(n(),m("details",{is:"animated-details",ref_for:!0,ref_key:"detailsEls",ref:l,key:p,class:"overflow-auto",exclusive:""},[f("summary",{ref_for:!0,ref_key:"summaryEls",ref:o},C(s.value.title),513),f("span",{style:D({height:h.value}),class:"d-flex flex-column"},[(n(),_(A(s.value.component),w({ref_for:!0},s.value.props),null,16))],4)]))),128))}};export{b as default}; +import{X as g,r as i,Y as y,Z as x,D as v,$ as n,a6 as m,a7 as E,a3 as H,F as k,a9 as f,aa as C,a0 as _,d as w,a4 as A,b2 as D}from"./index-B5c5Pwhg.js";class F extends HTMLDetailsElement{constructor(){super()}connectedCallback(){this.el=this,this.summary=this.querySelector("summary"),this.content=this.lastElementChild,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.summary.addEventListener("click",e=>this.onClick(e))}onClick(e){e?.preventDefault(),this.el.style.overflow="hidden",this.isClosing||!this.el.open?this.doOpen():(this.isExpanding||this.el.open)&&this.shrink()}shrink(){this.isClosing=!0;const e=`${this.el.offsetHeight}px`,t=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[e,t]},{duration:300,easing:"ease-out"}),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}doOpen(){this.el.style.height=`${this.el.offsetHeight}px`,this.el.open=!0,window.requestAnimationFrame(()=>this.expand()),this.parentElement.querySelectorAll("details[open][exclusive]").forEach(t=>{t!==this&&t.onClick()})}expand(){this.isExpanding=!0;const e=`${this.el.offsetHeight}px`,t=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.el.animate({height:[e,t]},{duration:300,easing:"ease-out"}),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(e){this.el.open=e,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.el.style.height=this.el.style.overflow=""}}customElements.define("animated-details",F,{extends:"details"});const b={__name:"WidgetsContainer",props:{widgets:{type:Array,required:!0}},setup(a){const t=g(a.widgets),l=i([]),o=i([]),h=i(""),r=i(0),{mainRect:d}=y();return x(async()=>{await v(()=>{r.value=o.value.reduce((c,u)=>c+=u.clientHeight,0),h.value=(l.value[0].parentElement?.scrollHeight??0)-r.value-d.value.top+"px"})}),(c,u)=>(n(!0),m(k,null,E(H(t),(s,p)=>(n(),m("details",{is:"animated-details",ref_for:!0,ref_key:"detailsEls",ref:l,key:p,class:"overflow-auto",exclusive:""},[f("summary",{ref_for:!0,ref_key:"summaryEls",ref:o},C(s.value.title),513),f("span",{style:D({height:h.value}),class:"d-flex flex-column"},[(n(),_(A(s.value.component),w({ref_for:!0},s.value.props),null,16))],4)]))),128))}};export{b as default}; diff --git a/pr-preview/pr-17/assets/basedecoder-Qm25PwVp-gdlnpIMU.js b/pr-preview/pr-17/assets/basedecoder-DHcBySSe-gdlnpIMU.js similarity index 100% rename from pr-preview/pr-17/assets/basedecoder-Qm25PwVp-gdlnpIMU.js rename to pr-preview/pr-17/assets/basedecoder-DHcBySSe-gdlnpIMU.js diff --git a/pr-preview/pr-17/assets/decoder-CP4lv0Kb-zThNjL1K.js b/pr-preview/pr-17/assets/decoder-CP4lv0Kb-zThNjL1K.js new file mode 100644 index 0000000..a75f7dc --- /dev/null +++ b/pr-preview/pr-17/assets/decoder-CP4lv0Kb-zThNjL1K.js @@ -0,0 +1 @@ +import{K as e}from"./EodashMap-U2uBfjLN.js";import"./index-B5c5Pwhg.js";import"./eodashSTAC-D8JkBEnM.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./DynamicWebComponent-CFpMl29n.js";var t=Worker;const i=e(t);function o(){const A='function A(A,e,t,i,r,I,g){try{var n=A[I](g),a=n.value}catch(A){return void t(A)}n.done?e(a):Promise.resolve(a).then(i,r)}function e(e){return function(){var t=this,i=arguments;return new Promise((function(r,I){var g=e.apply(t,i);function n(e){A(g,r,I,n,a,"next",e)}function a(e){A(g,r,I,n,a,"throw",e)}n(void 0)}))}}function t(A){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},t(A)}var i={exports:{}};!function(A){var e=function(A){var e,i=Object.prototype,r=i.hasOwnProperty,I="function"==typeof Symbol?Symbol:{},g=I.iterator||"@@iterator",n=I.asyncIterator||"@@asyncIterator",a=I.toStringTag||"@@toStringTag";function o(A,e,t){return Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),A[e]}try{o({},"")}catch(A){o=function(A,e,t){return A[e]=t}}function B(A,e,t,i){var r=e&&e.prototype instanceof h?e:h,I=Object.create(r.prototype),g=new S(i||[]);return I._invoke=function(A,e,t){var i=Q;return function(r,I){if(i===s)throw new Error("Generator is already running");if(i===f){if("throw"===r)throw I;return R()}for(t.method=r,t.arg=I;;){var g=t.delegate;if(g){var n=m(g,t);if(n){if(n===c)continue;return n}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(i===Q)throw i=f,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);i=s;var a=C(A,e,t);if("normal"===a.type){if(i=t.done?f:E,a.arg===c)continue;return{value:a.arg,done:t.done}}"throw"===a.type&&(i=f,t.method="throw",t.arg=a.arg)}}}(A,t,g),I}function C(A,e,t){try{return{type:"normal",arg:A.call(e,t)}}catch(A){return{type:"throw",arg:A}}}A.wrap=B;var Q="suspendedStart",E="suspendedYield",s="executing",f="completed",c={};function h(){}function l(){}function u(){}var w={};o(w,g,(function(){return this}));var d=Object.getPrototypeOf,D=d&&d(d(v([])));D&&D!==i&&r.call(D,g)&&(w=D);var y=u.prototype=h.prototype=Object.create(w);function k(A){["next","throw","return"].forEach((function(e){o(A,e,(function(A){return this._invoke(e,A)}))}))}function p(A,e){function i(I,g,n,a){var o=C(A[I],A,g);if("throw"!==o.type){var B=o.arg,Q=B.value;return Q&&"object"===t(Q)&&r.call(Q,"__await")?e.resolve(Q.__await).then((function(A){i("next",A,n,a)}),(function(A){i("throw",A,n,a)})):e.resolve(Q).then((function(A){B.value=A,n(B)}),(function(A){return i("throw",A,n,a)}))}a(o.arg)}var I;this._invoke=function(A,t){function r(){return new e((function(e,r){i(A,t,e,r)}))}return I=I?I.then(r,r):r()}}function m(A,t){var i=A.iterator[t.method];if(i===e){if(t.delegate=null,"throw"===t.method){if(A.iterator.return&&(t.method="return",t.arg=e,m(A,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a \'throw\' method")}return c}var r=C(i,A.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var I=r.arg;return I?I.done?(t[A.resultName]=I.value,t.next=A.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,c):I:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function G(A){var e={tryLoc:A[0]};1 in A&&(e.catchLoc=A[1]),2 in A&&(e.finallyLoc=A[2],e.afterLoc=A[3]),this.tryEntries.push(e)}function F(A){var e=A.completion||{};e.type="normal",delete e.arg,A.completion=e}function S(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(G,this),this.reset(!0)}function v(A){if(A){var t=A[g];if(t)return t.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var i=-1,I=function t(){for(;++i=0;--I){var g=this.tryEntries[I],n=g.completion;if("root"===g.tryLoc)return i("end");if(g.tryLoc<=this.prev){var a=r.call(g,"catchLoc"),o=r.call(g,"finallyLoc");if(a&&o){if(this.prev=0;--t){var i=this.tryEntries[t];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===A)return this.complete(t.completion,t.afterLoc),F(t),c}},catch:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===A){var i=t.completion;if("throw"===i.type){var r=i.arg;F(t)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(A,t,i){return this.delegate={iterator:v(A),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=e),c}},A}(A.exports);try{regeneratorRuntime=e}catch(A){"object"===("undefined"==typeof globalThis?"undefined":t(globalThis))?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(i);var r=i.exports,I=new Map;function g(A,e){Array.isArray(A)||(A=[A]),A.forEach((function(A){return I.set(A,e)}))}function n(A){return a.apply(this,arguments)}function a(){return(a=e(r.mark((function A(e){var t,i;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(t=I.get(e.Compression)){A.next=3;break}throw new Error("Unknown compression method identifier: ".concat(e.Compression));case 3:return A.next=5,t();case 5:return i=A.sent,A.abrupt("return",new i(e));case 7:case"end":return A.stop()}}),A)})))).apply(this,arguments)}g([void 0,1],(function(){return Promise.resolve().then((function(){return y})).then((function(A){return A.default}))})),g(5,(function(){return Promise.resolve().then((function(){return F})).then((function(A){return A.default}))})),g(6,(function(){throw new Error("old style JPEG compression is not supported.")})),g(7,(function(){return Promise.resolve().then((function(){return N})).then((function(A){return A.default}))})),g([8,32946],(function(){return Promise.resolve().then((function(){return OA})).then((function(A){return A.default}))})),g(32773,(function(){return Promise.resolve().then((function(){return _A})).then((function(A){return A.default}))})),g(34887,(function(){return Promise.resolve().then((function(){return le})).then(function(){var A=e(r.mark((function A(e){return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,e.zstd.init();case 2:return A.abrupt("return",e);case 3:case"end":return A.stop()}}),A)})));return function(e){return A.apply(this,arguments)}}()).then((function(A){return A.default}))})),g(50001,(function(){return Promise.resolve().then((function(){return de})).then((function(A){return A.default}))}));var o=globalThis;function B(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function C(A,e){for(var t=0;t0;r--)A[i+e]+=A[i],i++;t-=e}while(t>0)}function l(A,e,t){for(var i=0,r=A.length,I=r/t;r>e;){for(var g=e;g>0;--g)A[i+e]+=A[i],++i;r-=e}for(var n=A.slice(),a=0;a=A.byteLength);++o){var B=void 0;if(2===e){switch(r[0]){case 8:B=new Uint8Array(A,o*a*t*n,a*t*n);break;case 16:B=new Uint16Array(A,o*a*t*n,a*t*n/2);break;case 32:B=new Uint32Array(A,o*a*t*n,a*t*n/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(r[0]," bits per sample."))}h(B,a)}else 3===e&&l(B=new Uint8Array(A,o*a*t*n,a*t*n),a,n)}return A}o.addEventListener("message",function(){var A=e(r.mark((function A(e){var t,i,I,g,a,B;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return t=e.data,i=t.id,I=t.fileDirectory,g=t.buffer,A.next=3,n(I);case 3:return a=A.sent,A.next=6,a.decode(I,g);case 6:B=A.sent,o.postMessage({decoded:B,id:i},[B]);case 8:case"end":return A.stop()}}),A)})));return function(e){return A.apply(this,arguments)}}());var w=function(){function A(){B(this,A)}var t;return Q(A,[{key:"decode",value:(t=e(r.mark((function A(e,t){var i,I,g,n,a;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.decodeBlock(t);case 2:if(i=A.sent,1===(I=e.Predictor||1)){A.next=9;break}return g=!e.StripOffsets,n=g?e.TileWidth:e.ImageWidth,a=g?e.TileLength:e.RowsPerStrip||e.ImageLength,A.abrupt("return",u(i,I,n,a,e.BitsPerSample,e.PlanarConfiguration));case 9:return A.abrupt("return",i);case 10:case"end":return A.stop()}}),A,this)}))),function(A,e){return t.apply(this,arguments)})}]),A}();function d(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var D=function(A){s(t,w);var e=d(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return A}}]),t}(),y=Object.freeze({__proto__:null,default:D});function k(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}function p(A,e){for(var t=e.length-1;t>=0;t--)A.push(e[t]);return A}function m(A){for(var e=new Uint16Array(4093),t=new Uint8Array(4093),i=0;i<=257;i++)e[i]=4096,t[i]=i;var r=258,I=9,g=0;function n(){r=258,I=9}function a(A){var e=function(A,e,t){var i=e%8,r=Math.floor(e/8),I=8-i,g=e+t-8*(r+1),n=8*(r+2)-(e+t),a=8*(r+2)-e;if(n=Math.max(0,n),r>=A.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var o=A[r]&Math.pow(2,8-i)-1,B=o<<=t-I;if(r+1>>n;B+=C<<=Math.max(0,t-a)}if(g>8&&r+2>>Q}return B}(A,g,I);return g+=I,e}function o(A,i){return t[r]=i,e[r]=A,++r-1}function B(A){for(var i=[],r=A;4096!==r;r=e[r])i.push(t[r]);return i}var C=[];n();for(var Q,E=new Uint8Array(A),s=a(E);257!==s;){if(256===s){for(n(),s=a(E);256===s;)s=a(E);if(257===s)break;if(s>256)throw new Error("corrupted code at scanline ".concat(s));p(C,B(s)),Q=s}else if(s=Math.pow(2,I)&&(12===I?Q=void 0:I++),s=a(E)}return new Uint8Array(C)}var G=function(A){s(t,w);var e=k(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return m(A).buffer}}]),t}(),F=Object.freeze({__proto__:null,default:G});function S(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var v=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function R(A,e){for(var t=0,i=[],r=16;r>0&&!A[r-1];)--r;i.push({children:[],index:0});for(var I,g=i[0],n=0;n0;)g=i.pop();for(g.index++,i.push(g);i.length<=n;)i.push(I={children:[],index:0}),g.children[g.index]=I.children,g=I;t++}n+10)return f--,s>>f&1;if(255===(s=A[E++])){var e=A[E++];if(e)throw new Error("unexpected marker: ".concat((s<<8|e).toString(16)))}return f=7,s>>>7}function h(A){for(var e,i=A;null!==(e=c());){if("number"==typeof(i=i[e]))return i;if("object"!==t(i))throw new Error("invalid huffman sequence")}return null}function l(A){for(var e=A,t=0;e>0;){var i=c();if(null===i)return;t=t<<1|i,--e}return t}function u(A){var e=l(A);return e>=1<0)w--;else for(var t=g,i=n;t<=i;){var r=h(A.huffmanTableAC),I=15&r,a=r>>4;if(0===I){if(a<15){w=l(a)+(1<>4,0===C)r<15?(w=l(r)+(1<>4;if(0===g){if(n<15)break;r+=16}else e[v[r+=n]]=u(g),r++}};var L,b,M=0;b=1===U?r[0].blocksPerLine*r[0].blocksPerColumn:B*i.mcusPerColumn;for(var N=I||b;M=65488&&L<=65495))break;E+=2}return E-Q}function L(A,e){var t=[],i=e.blocksPerLine,r=e.blocksPerColumn,I=i<<3,g=new Int32Array(64),n=new Uint8Array(64);function a(A,t,i){var r,I,g,n,a,o,B,C,Q,E,s=e.quantizationTable,f=i;for(E=0;E<64;E++)f[E]=A[E]*s[E];for(E=0;E<8;++E){var c=8*E;0!==f[1+c]||0!==f[2+c]||0!==f[3+c]||0!==f[4+c]||0!==f[5+c]||0!==f[6+c]||0!==f[7+c]?(r=5793*f[0+c]+128>>8,I=5793*f[4+c]+128>>8,g=f[2+c],n=f[6+c],a=2896*(f[1+c]-f[7+c])+128>>8,C=2896*(f[1+c]+f[7+c])+128>>8,o=f[3+c]<<4,Q=r-I+1>>1,r=r+I+1>>1,I=Q,Q=3784*g+1567*n+128>>8,g=1567*g-3784*n+128>>8,n=Q,Q=a-(B=f[5+c]<<4)+1>>1,a=a+B+1>>1,B=Q,Q=C+o+1>>1,o=C-o+1>>1,C=Q,Q=r-n+1>>1,r=r+n+1>>1,n=Q,Q=I-g+1>>1,I=I+g+1>>1,g=Q,Q=2276*a+3406*C+2048>>12,a=3406*a-2276*C+2048>>12,C=Q,Q=799*o+4017*B+2048>>12,o=4017*o-799*B+2048>>12,B=Q,f[0+c]=r+C,f[7+c]=r-C,f[1+c]=I+B,f[6+c]=I-B,f[2+c]=g+o,f[5+c]=g-o,f[3+c]=n+a,f[4+c]=n-a):(Q=5793*f[0+c]+512>>10,f[0+c]=Q,f[1+c]=Q,f[2+c]=Q,f[3+c]=Q,f[4+c]=Q,f[5+c]=Q,f[6+c]=Q,f[7+c]=Q)}for(E=0;E<8;++E){var h=E;0!==f[8+h]||0!==f[16+h]||0!==f[24+h]||0!==f[32+h]||0!==f[40+h]||0!==f[48+h]||0!==f[56+h]?(r=5793*f[0+h]+2048>>12,I=5793*f[32+h]+2048>>12,g=f[16+h],n=f[48+h],a=2896*(f[8+h]-f[56+h])+2048>>12,C=2896*(f[8+h]+f[56+h])+2048>>12,o=f[24+h],Q=r-I+1>>1,r=r+I+1>>1,I=Q,Q=3784*g+1567*n+2048>>12,g=1567*g-3784*n+2048>>12,n=Q,Q=a-(B=f[40+h])+1>>1,a=a+B+1>>1,B=Q,Q=C+o+1>>1,o=C-o+1>>1,C=Q,Q=r-n+1>>1,r=r+n+1>>1,n=Q,Q=I-g+1>>1,I=I+g+1>>1,g=Q,Q=2276*a+3406*C+2048>>12,a=3406*a-2276*C+2048>>12,C=Q,Q=799*o+4017*B+2048>>12,o=4017*o-799*B+2048>>12,B=Q,f[0+h]=r+C,f[56+h]=r-C,f[8+h]=I+B,f[48+h]=I-B,f[16+h]=g+o,f[40+h]=g-o,f[24+h]=n+a,f[32+h]=n-a):(Q=5793*i[E+0]+8192>>14,f[0+h]=Q,f[8+h]=Q,f[16+h]=Q,f[24+h]=Q,f[32+h]=Q,f[40+h]=Q,f[48+h]=Q,f[56+h]=Q)}for(E=0;E<64;++E){var l=128+(f[E]+8>>4);t[E]=l<0?0:l>255?255:l}}for(var o=0;o>4==0)for(var C=0;C<64;C++){B[v[C]]=A[e++]}else{if(o>>4!=1)throw new Error("DQT: invalid table spec");for(var Q=0;Q<64;Q++){B[v[Q]]=t()}}this.quantizationTables[15&o]=B}break;case 65472:case 65473:case 65474:t();for(var E={extended:65473===g,progressive:65474===g,precision:A[e++],scanLines:t(),samplesPerLine:t(),components:{},componentsOrder:[]},s=A[e++],f=void 0,c=0;c>4,l=15&A[e+1],u=A[e+2];E.componentsOrder.push(f),E.components[f]={h:h,v:l,quantizationIdx:u},e+=3}i(E),this.frames.push(E);break;case 65476:for(var w=t(),d=2;d>4==0?this.huffmanTablesDC[15&D]=R(y,m):this.huffmanTablesAC[15&D]=R(y,m)}break;case 65501:t(),this.resetInterval=t();break;case 65498:t();for(var F=A[e++],S=[],L=this.frames[0],b=0;b>4],M.huffmanTableAC=this.huffmanTablesAC[15&N],S.push(M)}var x=A[e++],J=A[e++],q=A[e++],Y=U(A,e,L,S,this.resetInterval,x,J,q>>4,15&q);e+=Y;break;case 65535:255!==A[e]&&e--;break;default:if(255===A[e-3]&&A[e-2]>=192&&A[e-2]<=254){e-=3;break}throw new Error("unknown JPEG marker ".concat(g.toString(16)))}g=t()}}},{key:"getResult",value:function(){var A=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var e=0;e=0;)A[e]=0}x(new Array(576)),x(new Array(60)),x(new Array(512)),x(new Array(256)),x(new Array(29)),x(new Array(30));var J=function(A,e,t,i){for(var r=65535&A|0,I=A>>>16&65535|0,g=0;0!==t;){t-=g=t>2e3?2e3:t;do{I=I+(r=r+e[i++]|0)|0}while(--g);r%=65521,I%=65521}return r|I<<16|0},q=new Uint32Array(function(){for(var A,e=[],t=0;t<256;t++){A=t;for(var i=0;i<8;i++)A=1&A?3988292384^A>>>1:A>>>1;e[t]=A}return e}()),Y=function(A,e,t,i){var r=q,I=i+t;A^=-1;for(var g=i;g>>8^r[255&(A^e[g])];return-1^A},K={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},H={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},O=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},P=function(A){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!==t(i))throw new TypeError(i+"must be non-object");for(var r in i)O(i,r)&&(A[r]=i[r])}}return A},T=function(A){for(var e=0,t=0,i=A.length;t=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;_[254]=_[254]=1;var Z=function(A){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(A);var e,t,i,r,I,g=A.length,n=0;for(r=0;r>>6,e[I++]=128|63&t):t<65536?(e[I++]=224|t>>>12,e[I++]=128|t>>>6&63,e[I++]=128|63&t):(e[I++]=240|t>>>18,e[I++]=128|t>>>12&63,e[I++]=128|t>>>6&63,e[I++]=128|63&t);return e},j=function(A,e){var t,i,r=e||A.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(A.subarray(0,e));var I=new Array(2*r);for(i=0,t=0;t4)I[i++]=65533,t+=n-1;else{for(g&=2===n?31:3===n?15:7;n>1&&t1?I[i++]=65533:g<65536?I[i++]=g:(g-=65536,I[i++]=55296|g>>10&1023,I[i++]=56320|1023&g)}}}return function(A,e){if(e<65534&&A.subarray&&V)return String.fromCharCode.apply(null,A.length===e?A:A.subarray(0,e));for(var t="",i=0;iA.length&&(e=A.length);for(var t=e-1;t>=0&&128==(192&A[t]);)t--;return t<0||0===t?e:t+_[A[t]]>e?t:e};var z=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(A,e){var t,i,r,I,g,n,a,o,B,C,Q,E,s,f,c,h,l,u,w,d,D,y,k,p,m=A.state;t=A.next_in,k=A.input,i=t+(A.avail_in-5),r=A.next_out,p=A.output,I=r-(e-A.avail_out),g=r+(A.avail_out-257),n=m.dmax,a=m.wsize,o=m.whave,B=m.wnext,C=m.window,Q=m.hold,E=m.bits,s=m.lencode,f=m.distcode,c=(1<>>=u=l>>>24,E-=u,0===(u=l>>>16&255))p[r++]=65535&l;else{if(!(16&u)){if(0==(64&u)){l=s[(65535&l)+(Q&(1<>>=u,E-=u),E<15&&(Q+=k[t++]<>>=u=l>>>24,E-=u,!(16&(u=l>>>16&255))){if(0==(64&u)){l=f[(65535&l)+(Q&(1<n){A.msg="invalid distance too far back",m.mode=30;break A}if(Q>>>=u,E-=u,d>(u=r-I)){if((u=d-u)>o&&m.sane){A.msg="invalid distance too far back",m.mode=30;break A}if(D=0,y=C,0===B){if(D+=a-u,u2;)p[r++]=y[D++],p[r++]=y[D++],p[r++]=y[D++],w-=3;w&&(p[r++]=y[D++],w>1&&(p[r++]=y[D++]))}else{D=r-d;do{p[r++]=p[D++],p[r++]=p[D++],p[r++]=p[D++],w-=3}while(w>2);w&&(p[r++]=p[D++],w>1&&(p[r++]=p[D++]))}break}}break}}while(t>3,Q&=(1<<(E-=w<<3))-1,A.next_in=t,A.next_out=r,A.avail_in=t=1&&0===v[d];d--);if(D>d&&(D=d),0===d)return r[I++]=20971520,r[I++]=20971520,n.bits=1,0;for(w=1;w0&&(0===A||1!==d))return-1;for(R[1]=0,l=1;l<15;l++)R[l+1]=R[l]+v[l];for(u=0;u852||2===A&&m>592)return 1;for(;;){s=l-k,g[u]E?(f=U[L+g[u]],c=F[S+g[u]]):(f=96,c=0),a=1<>k)+(o-=a)]=s<<24|f<<16|c|0}while(0!==o);for(a=1<>=1;if(0!==a?(G&=a-1,G+=a):G=0,u++,0==--v[l]){if(l===d)break;l=e[t+g[u]]}if(l>D&&(G&C)!==B){for(0===k&&(k=D),Q+=w,p=1<<(y=l-k);y+k852||2===A&&m>592)return 1;r[B=G&C]=D<<24|y<<16|Q-I|0}}return 0!==G&&(r[Q+G]=l-k<<24|64<<16|0),n.bits=D,0},IA=H.Z_FINISH,gA=H.Z_BLOCK,nA=H.Z_TREES,aA=H.Z_OK,oA=H.Z_STREAM_END,BA=H.Z_NEED_DICT,CA=H.Z_STREAM_ERROR,QA=H.Z_DATA_ERROR,EA=H.Z_MEM_ERROR,sA=H.Z_BUF_ERROR,fA=H.Z_DEFLATED,cA=function(A){return(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24)};function hA(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var lA,uA,wA=function(A){if(!A||!A.state)return CA;var e=A.state;return A.total_in=A.total_out=e.total=0,A.msg="",e.wrap&&(A.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,aA},dA=function(A){if(!A||!A.state)return CA;var e=A.state;return e.wsize=0,e.whave=0,e.wnext=0,wA(A)},DA=function(A,e){var t;if(!A||!A.state)return CA;var i=A.state;return e<0?(t=0,e=-e):(t=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?CA:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,dA(A))},yA=function(A,e){if(!A)return CA;var t=new hA;A.state=t,t.window=null;var i=DA(A,e);return i!==aA&&(A.state=null),i},kA=!0,pA=function(A){if(kA){lA=new Int32Array(512),uA=new Int32Array(32);for(var e=0;e<144;)A.lens[e++]=8;for(;e<256;)A.lens[e++]=9;for(;e<280;)A.lens[e++]=7;for(;e<288;)A.lens[e++]=8;for(rA(1,A.lens,0,288,lA,0,A.work,{bits:9}),e=0;e<32;)A.lens[e++]=5;rA(2,A.lens,0,32,uA,0,A.work,{bits:5}),kA=!1}A.lencode=lA,A.lenbits=9,A.distcode=uA,A.distbits=5},mA=function(A,e,t,i){var r,I=A.state;return null===I.window&&(I.wsize=1<=I.wsize?(I.window.set(e.subarray(t-I.wsize,t),0),I.wnext=0,I.whave=I.wsize):((r=I.wsize-I.wnext)>i&&(r=i),I.window.set(e.subarray(t-i,t-i+r),I.wnext),(i-=r)?(I.window.set(e.subarray(t-i,t),0),I.wnext=i,I.whave=I.wsize):(I.wnext+=r,I.wnext===I.wsize&&(I.wnext=0),I.whave>>8&255,t.check=Y(t.check,G,2,0),o=0,B=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&o)<<8)+(o>>8))%31){A.msg="incorrect header check",t.mode=30;break}if((15&o)!==fA){A.msg="unknown compression method",t.mode=30;break}if(B-=4,D=8+(15&(o>>>=4)),0===t.wbits)t.wbits=D;else if(D>t.wbits){A.msg="invalid window size",t.mode=30;break}t.dmax=1<>8&1),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0,t.mode=3;case 3:for(;B<32;){if(0===n)break A;n--,o+=i[I++]<>>8&255,G[2]=o>>>16&255,G[3]=o>>>24&255,t.check=Y(t.check,G,4,0)),o=0,B=0,t.mode=4;case 4:for(;B<16;){if(0===n)break A;n--,o+=i[I++]<>8),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0,t.mode=5;case 5:if(1024&t.flags){for(;B<16;){if(0===n)break A;n--,o+=i[I++]<>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((E=t.length)>n&&(E=n),E&&(t.head&&(D=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(I,I+E),D)),512&t.flags&&(t.check=Y(t.check,i,E,I)),n-=E,I+=E,t.length-=E),t.length))break A;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===n)break A;E=0;do{D=i[I+E++],t.head&&D&&t.length<65536&&(t.head.name+=String.fromCharCode(D))}while(D&&E>9&1,t.head.done=!0),A.adler=t.check=0,t.mode=12;break;case 10:for(;B<32;){if(0===n)break A;n--,o+=i[I++]<>>=7&B,B-=7&B,t.mode=27;break}for(;B<3;){if(0===n)break A;n--,o+=i[I++]<>>=1)){case 0:t.mode=14;break;case 1:if(pA(t),t.mode=20,e===nA){o>>>=2,B-=2;break A}break;case 2:t.mode=17;break;case 3:A.msg="invalid block type",t.mode=30}o>>>=2,B-=2;break;case 14:for(o>>>=7&B,B-=7&B;B<32;){if(0===n)break A;n--,o+=i[I++]<>>16^65535)){A.msg="invalid stored block lengths",t.mode=30;break}if(t.length=65535&o,o=0,B=0,t.mode=15,e===nA)break A;case 15:t.mode=16;case 16:if(E=t.length){if(E>n&&(E=n),E>a&&(E=a),0===E)break A;r.set(i.subarray(I,I+E),g),n-=E,I+=E,a-=E,g+=E,t.length-=E;break}t.mode=12;break;case 17:for(;B<14;){if(0===n)break A;n--,o+=i[I++]<>>=5,B-=5,t.ndist=1+(31&o),o>>>=5,B-=5,t.ncode=4+(15&o),o>>>=4,B-=4,t.nlen>286||t.ndist>30){A.msg="too many length or distance symbols",t.mode=30;break}t.have=0,t.mode=18;case 18:for(;t.have>>=3,B-=3}for(;t.have<19;)t.lens[F[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,k={bits:t.lenbits},y=rA(0,t.lens,0,19,t.lencode,0,t.work,k),t.lenbits=k.bits,y){A.msg="invalid code lengths set",t.mode=30;break}t.have=0,t.mode=19;case 19:for(;t.have>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>>=c,B-=c,t.lens[t.have++]=l;else{if(16===l){for(p=c+2;B>>=c,B-=c,0===t.have){A.msg="invalid bit length repeat",t.mode=30;break}D=t.lens[t.have-1],E=3+(3&o),o>>>=2,B-=2}else if(17===l){for(p=c+3;B>>=c)),o>>>=3,B-=3}else{for(p=c+7;B>>=c)),o>>>=7,B-=7}if(t.have+E>t.nlen+t.ndist){A.msg="invalid bit length repeat",t.mode=30;break}for(;E--;)t.lens[t.have++]=D}}if(30===t.mode)break;if(0===t.lens[256]){A.msg="invalid code -- missing end-of-block",t.mode=30;break}if(t.lenbits=9,k={bits:t.lenbits},y=rA(1,t.lens,0,t.nlen,t.lencode,0,t.work,k),t.lenbits=k.bits,y){A.msg="invalid literal/lengths set",t.mode=30;break}if(t.distbits=6,t.distcode=t.distdyn,k={bits:t.distbits},y=rA(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,k),t.distbits=k.bits,y){A.msg="invalid distances set",t.mode=30;break}if(t.mode=20,e===nA)break A;case 20:t.mode=21;case 21:if(n>=6&&a>=258){A.next_out=g,A.avail_out=a,A.next_in=I,A.avail_in=n,t.hold=o,t.bits=B,$(A,Q),g=A.next_out,r=A.output,a=A.avail_out,I=A.next_in,i=A.input,n=A.avail_in,o=t.hold,B=t.bits,12===t.mode&&(t.back=-1);break}for(t.back=0;h=(m=t.lencode[o&(1<>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>u)])>>>16&255,l=65535&m,!(u+(c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>>=u,B-=u,t.back+=u}if(o>>>=c,B-=c,t.back+=c,t.length=l,0===h){t.mode=26;break}if(32&h){t.back=-1,t.mode=12;break}if(64&h){A.msg="invalid literal/length code",t.mode=30;break}t.extra=15&h,t.mode=22;case 22:if(t.extra){for(p=t.extra;B>>=t.extra,B-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;h=(m=t.distcode[o&(1<>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>u)])>>>16&255,l=65535&m,!(u+(c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>>=u,B-=u,t.back+=u}if(o>>>=c,B-=c,t.back+=c,64&h){A.msg="invalid distance code",t.mode=30;break}t.offset=l,t.extra=15&h,t.mode=24;case 24:if(t.extra){for(p=t.extra;B>>=t.extra,B-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){A.msg="invalid distance too far back",t.mode=30;break}t.mode=25;case 25:if(0===a)break A;if(E=Q-a,t.offset>E){if((E=t.offset-E)>t.whave&&t.sane){A.msg="invalid distance too far back",t.mode=30;break}E>t.wnext?(E-=t.wnext,s=t.wsize-E):s=t.wnext-E,E>t.length&&(E=t.length),f=t.window}else f=r,s=g-t.offset,E=t.length;E>a&&(E=a),a-=E,t.length-=E;do{r[g++]=f[s++]}while(--E);0===t.length&&(t.mode=21);break;case 26:if(0===a)break A;r[g++]=t.length,a--,t.mode=21;break;case 27:if(t.wrap){for(;B<32;){if(0===n)break A;n--,o|=i[I++]<=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||A&&A.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new z,this.strm.avail_out=0;var t=GA.inflateInit2(this.strm,e.windowBits);if(t!==UA)throw new Error(K[t]);if(this.header=new FA,GA.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Z(e.dictionary):"[object ArrayBuffer]"===SA.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=GA.inflateSetDictionary(this.strm,e.dictionary))!==UA))throw new Error(K[t])}function qA(A,e){var t=new JA(e);if(t.push(A),t.err)throw t.msg||K[t.err];return t.result}JA.prototype.push=function(A,e){var t,i,r,I=this.strm,g=this.options.chunkSize,n=this.options.dictionary;if(this.ended)return!1;for(i=e===~~e?e:!0===e?RA:vA,"[object ArrayBuffer]"===SA.call(A)?I.input=new Uint8Array(A):I.input=A,I.next_in=0,I.avail_in=I.input.length;;){for(0===I.avail_out&&(I.output=new Uint8Array(g),I.next_out=0,I.avail_out=g),(t=GA.inflate(I,i))===bA&&n&&((t=GA.inflateSetDictionary(I,n))===UA?t=GA.inflate(I,i):t===NA&&(t=bA));I.avail_in>0&&t===LA&&I.state.wrap>0&&0!==A[I.next_in];)GA.inflateReset(I),t=GA.inflate(I,i);switch(t){case MA:case NA:case bA:case xA:return this.onEnd(t),this.ended=!0,!1}if(r=I.avail_out,I.next_out&&(0===I.avail_out||t===LA))if("string"===this.options.to){var a=W(I.output,I.next_out),o=I.next_out-a,B=j(I.output,a);I.next_out=o,I.avail_out=g-o,o&&I.output.set(I.output.subarray(a,a+o),0),this.onData(B)}else this.onData(I.output.length===I.next_out?I.output:I.output.subarray(0,I.next_out));if(t!==UA||0!==r){if(t===LA)return t=GA.inflateEnd(this.strm),this.onEnd(t),this.ended=!0,!0;if(0===I.avail_in)break}}return!0},JA.prototype.onData=function(A){this.chunks.push(A)},JA.prototype.onEnd=function(A){A===UA&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=T(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var YA={Inflate:JA,inflate:qA,inflateRaw:function(A,e){return(e=e||{}).raw=!0,qA(A,e)},ungzip:qA,constants:H}.inflate;function KA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var HA=function(A){s(t,w);var e=KA(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return YA(new Uint8Array(A)).buffer}}]),t}(),OA=Object.freeze({__proto__:null,default:HA});function PA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var TA,VA=function(A){s(t,w);var e=PA(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){for(var e=new DataView(A),t=[],i=0;i>3],m<<=7&G),c=0;c>3]),128&m?(a&&(a[G]=1),f=f>(g=S.encoding<2?y[k++]:p)?g:f,n[G++]=g):(a&&(a[G]=0),n[G++]=i),m<<=1;G+=F}else if(S.encoding<2)for(h=0;h(g=y[k++])?g:f,n[G++]=g;G+=F}else for(f=f>p?p:f,h=0;h0){var g=new Uint8Array(Math.ceil(i.width*i.height/8)),n=(I=new DataView(A,e,i.mask.numBytes)).getInt16(0,!0),a=2,o=0;do{if(n>0)for(;n--;)g[o++]=I.getUint8(a++);else{var B=I.getUint8(a++);for(n=-n;n--;)g[o++]=B}n=I.getInt16(a,!0),a+=2}while(a0?1:0),s=Q+(i.height%Q>0?1:0);i.pixels.blocks=new Array(E*s);for(var f=0,c=0;c3)throw"Invalid block encoding ("+w.encoding+")";if(2!==w.encoding){if(0!==d&&2!==d){if(d>>=6,w.offsetType=d,2===d)w.offset=I.getInt8(1),l++;else if(1===d)w.offset=I.getInt16(1,!0),l+=2;else{if(0!==d)throw"Invalid block offset type";w.offset=I.getFloat32(1,!0),l+=4}if(1===w.encoding)if(d=I.getUint8(l),l++,w.bitsPerPixel=63&d,d>>=6,w.numValidPixelsType=d,2===d)w.numValidPixels=I.getUint8(l),l++;else if(1===d)w.numValidPixels=I.getUint16(l,!0),l+=2;else{if(0!==d)throw"Invalid valid pixel count type";w.numValidPixels=I.getUint32(l,!0),l+=4}}var D;if(e+=l,3!==w.encoding)if(0===w.encoding){var y=(i.pixels.numBytes-1)/4;if(y!==Math.floor(y))throw"uncompressed block has invalid length";D=new ArrayBuffer(4*y),new Uint8Array(D).set(new Uint8Array(A,e,4*y));var k=new Float32Array(D);w.rawData=k,e+=4*y}else if(1===w.encoding){var p=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),m=Math.ceil(p/4);D=new ArrayBuffer(4*m),new Uint8Array(D).set(new Uint8Array(A,e,p)),w.stuffedData=new Uint32Array(D),e+=p}}else e++}return i.eofOffset=e,i},I=function(A,e,t,i,r,I,g){var n,a,o,B=(1<=e)a=o>>>Q-e&B,Q-=e;else{var f=e-Q;a=(o&B)<>>(Q=32-f)}I[n]=a=t?(o=B>>>f-t&E,f-=t):(o=(B&E)<<(C=t-f)&E,o+=(B=A[s++])>>>(f=32-C)),e[a]=r[o];else for(Q=Math.ceil((n-I)/g),a=0;a=t?(o=B>>>f-t&E,f-=t):(o=(B&E)<<(C=t-f)&E,o+=(B=A[s++])>>>(f=32-C)),e[a]=o=e?(Q=g>>>C-e&n,C-=e):(Q=(g&n)<<(B=e-C)&n,Q+=(g=A[a++])>>>(C=32-B)),E[o]=Q=t?(o=B>>>f&Q,s-=t,f+=t):(o=B>>>f&Q,s=32-(C=t-s),o|=((B=A[E++])&(1<=t?(o=B>>>f&Q,s-=t,f+=t):(o=B>>>f&Q,s=32-(C=t-s),o|=((B=A[E++])&(1<=e?(Q=g>>>E&n,C-=e,E+=e):(Q=g>>>E&n,C=32-(B=e-C),Q|=((g=A[a++])&(1<=t?(I=g>>>B-t&a,B-=t):(I=(g&a)<<(n=t-B)&a,I+=(g=A[o++])>>>(B=32-n)),e[r]=I;return e},C=function(A,e,t,i){var r,I,g,n,a=(1<=t?(I=g>>>C&a,B-=t,C+=t):(I=g>>>C&a,B=32-(n=t-B),I|=((g=A[o++])&(1<=359?359:r;r-=g;do{e+=A[I++]<<8,t+=e+=A[I++]}while(--g);e=(65535&e)+(e>>>16),t=(65535&t)+(t>>>16)}return 1&i&&(t+=e+=A[I]<<8),((t=(65535&t)+(t>>>16))<<16|(e=(65535&e)+(e>>>16)))>>>0},readHeaderInfo:function(A,e){var t=e.ptr,i=new Uint8Array(A,t,6),r={};if(r.fileIdentifierString=String.fromCharCode.apply(null,i),0!==r.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+r.fileIdentifierString;t+=6;var I,g=new DataView(A,t,8),n=g.getInt32(0,!0);if(r.fileVersion=n,t+=4,n>=3&&(r.checksum=g.getUint32(4,!0),t+=4),g=new DataView(A,t,12),r.height=g.getUint32(0,!0),r.width=g.getUint32(4,!0),t+=8,n>=4?(r.numDims=g.getUint32(8,!0),t+=4):r.numDims=1,g=new DataView(A,t,40),r.numValidPixel=g.getUint32(0,!0),r.microBlockSize=g.getInt32(4,!0),r.blobSize=g.getInt32(8,!0),r.imageType=g.getInt32(12,!0),r.maxZError=g.getFloat64(16,!0),r.zMin=g.getFloat64(24,!0),r.zMax=g.getFloat64(32,!0),t+=40,e.headerInfo=r,e.ptr=t,n>=3&&(I=n>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(A,t-I,r.blobSize-14))!==r.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(A,e){var t=e.headerInfo,i=this.getDataTypeArray(t.imageType),r=t.numDims*this.getDataTypeSize(t.imageType),I=this.readSubArray(A,e.ptr,i,r),g=this.readSubArray(A,e.ptr+r,i,r);e.ptr+=2*r;var n,a=!0;for(n=0;n0){t=new Uint8Array(Math.ceil(g/8));var B=(a=new DataView(A,r,o.numBytes)).getInt16(0,!0),C=2,Q=0,E=0;do{if(B>0)for(;B--;)t[Q++]=a.getUint8(C++);else for(E=a.getUint8(C++),B=-B;B--;)t[Q++]=E;B=a.getInt16(C,!0),C+=2}while(C>3],s<<=7&f):s=t[f>>3],128&s&&(i[f]=1);e.pixels.resultMask=i,o.bitset=t,r+=o.numBytes}return e.ptr=r,e.mask=o,!0},readDataOneSweep:function(A,e,t,i){var r,I=e.ptr,g=e.headerInfo,n=g.numDims,a=g.width*g.height,o=g.imageType,B=g.numValidPixel*Q.getDataTypeSize(o)*n,C=e.pixels.resultMask;if(t===Uint8Array)r=new Uint8Array(A,I,B);else{var E=new ArrayBuffer(B);new Uint8Array(E).set(new Uint8Array(A,I,B)),r=new t(E)}if(r.length===a*n)e.pixels.resultPixels=i?Q.swapDimensionOrder(r,a,n,t,!0):r;else{e.pixels.resultPixels=new t(a*n);var s=0,f=0,c=0,h=0;if(n>1){if(i){for(f=0;f=g)return!1;var n=new Uint32Array(g-I);Q.decodeBits(A,e,n);var a,o,B,C,s=[];for(a=I;a0&&(s[o].second=l<>>32-C,32-w>=C?32===(w+=C)&&(w=0,l=u[++d]):(w+=C-32,l=u[++d],s[o].second|=l>>>32-w));var D=0,y=0,k=new E;for(a=0;a=t?t:D;var p,m,G,F,S,v=[];for(a=I;a0)if(p=[C,o],C<=y)for(m=s[o].second<=0;F--)m>>>F&1?(S.right||(S.right=new E),S=S.right):(S.left||(S.left=new E),S=S.left),0!==F||S.val||(S.val=p[1]);return{decodeLut:v,numBitsLUTQick:y,numBitsLUT:D,tree:k,stuffedData:u,srcPtr:d,bitPos:w}},readHuffman:function(A,e,t,i){var r,I,g,n,a,o,B,C,E,s=e.headerInfo.numDims,f=e.headerInfo.height,c=e.headerInfo.width,h=c*f,l=this.readHuffmanTree(A,e),u=l.decodeLut,w=l.tree,d=l.stuffedData,D=l.srcPtr,y=l.bitPos,k=l.numBitsLUTQick,p=l.numBitsLUT,m=0===e.headerInfo.imageType?128:0,G=e.pixels.resultMask,F=0;y>0&&(D++,y=0);var S,v=d[D],R=1===e.encodeMode,U=new t(h*s),L=U;if(s<2||R){for(S=0;S1&&(L=new t(U.buffer,h*S,h),F=0),e.headerInfo.numValidPixel===c*f)for(C=0,o=0;o>>32-k,32-y>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<>>32-p,32-y>>64-y-p),r=w,E=0;E>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,R?(g+=B>0?F:o>0?L[C-c]:F,g&=255,L[C]=g,F=g):L[C]=g}else for(C=0,o=0;o>>32-k,32-y>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<>>32-p,32-y>>64-y-p),r=w,E=0;E>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,R?(B>0&&G[C-1]?g+=F:o>0&&G[C-c]?g+=L[C-c]:g+=F,g&=255,L[C]=g,F=g):L[C]=g}}else for(C=0,o=0;o>>32-k,32-y>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<>>32-p,32-y>>64-y-p),r=w,E=0;E>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,L[C]=g}e.ptr=e.ptr+4*(D+1)+(y>0?4:0),e.pixels.resultPixels=U,s>1&&!i&&(e.pixels.resultPixels=Q.swapDimensionOrder(U,h,s,t))},decodeBits:function(A,e,t,i,r){var I=e.headerInfo,Q=I.fileVersion,E=0,s=A.byteLength-e.ptr>=5?5:A.byteLength-e.ptr,f=new DataView(A,e.ptr,s),c=f.getUint8(0);E++;var h=c>>6,l=0===h?4:3-h,u=(32&c)>0,w=31&c,d=0;if(1===l)d=f.getUint8(E),E++;else if(2===l)d=f.getUint16(E,!0),E+=2;else{if(4!==l)throw"Invalid valid pixel count type";d=f.getUint32(E,!0),E+=4}var D,y,k,p,m,G,F,S,v,R=2*I.maxZError,U=I.numDims>1?I.maxValues[r]:I.zMax;if(u){for(e.counter.lut++,S=f.getUint8(E),E++,p=Math.ceil((S-1)*w/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),k=new Uint8Array(y),e.ptr+=E,k.set(new Uint8Array(A,e.ptr,p)),F=new Uint32Array(y),e.ptr+=p,v=0;S-1>>>v;)v++;p=Math.ceil(d*v/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),(k=new Uint8Array(y)).set(new Uint8Array(A,e.ptr,p)),D=new Uint32Array(y),e.ptr+=p,G=Q>=3?o(F,w,S-1,i,R,U):n(F,w,S-1,i,R,U),Q>=3?a(D,t,v,d,G):g(D,t,v,d,G)}else e.counter.bitstuffer++,v=w,e.ptr+=E,v>0&&(p=Math.ceil(d*v/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),(k=new Uint8Array(y)).set(new Uint8Array(A,e.ptr,p)),D=new Uint32Array(y),e.ptr+=p,Q>=3?null==i?C(D,t,v,d):a(D,t,v,d,!1,i,R,U):null==i?B(D,t,v,d):g(D,t,v,d,!1,i,R,U))},readTiles:function(A,e,t,i){var r=e.headerInfo,I=r.width,g=r.height,n=I*g,a=r.microBlockSize,o=r.imageType,B=Q.getDataTypeSize(o),C=Math.ceil(I/a),E=Math.ceil(g/a);e.pixels.numBlocksY=E,e.pixels.numBlocksX=C,e.pixels.ptr=0;var s,f,c,h,l,u,w,d,D,y,k=0,p=0,m=0,G=0,F=0,S=0,v=0,R=0,U=0,L=0,b=0,M=0,N=0,x=0,J=0,q=new t(a*a),Y=g%a||a,K=I%a||a,H=r.numDims,O=e.pixels.resultMask,P=e.pixels.resultPixels,T=r.fileVersion>=5?14:15,V=r.zMax;for(m=0;m1?(y=P,L=m*I*a+G*a,P=new t(e.pixels.resultPixels.buffer,n*d*B,n),V=r.maxValues[d]):y=null,v=A.byteLength-e.ptr,f={},J=0,R=(s=new DataView(A,e.ptr,Math.min(10,v))).getUint8(0),J++,D=r.fileVersion>=5?4&R:0,U=R>>6&255,(R>>2&T)!=(G*a>>3&T))throw"integrity issue";if(D&&0===d)throw"integrity issue";if((l=3&R)>3)throw e.ptr+=J,"Invalid block encoding ("+l+")";if(2!==l)if(0===l){if(D)throw"integrity issue";if(e.counter.uncompressed++,e.ptr+=J,M=(M=F*S*B)<(N=A.byteLength-e.ptr)?M:N,c=new ArrayBuffer(M%B==0?M:M+B-M%B),new Uint8Array(c).set(new Uint8Array(A,e.ptr,M)),h=new t(c),x=0,O)for(k=0;k1&&!i&&(e.pixels.resultPixels=Q.swapDimensionOrder(e.pixels.resultPixels,n,H,t))},formatFileInfo:function(A){return{fileIdentifierString:A.headerInfo.fileIdentifierString,fileVersion:A.headerInfo.fileVersion,imageType:A.headerInfo.imageType,height:A.headerInfo.height,width:A.headerInfo.width,numValidPixel:A.headerInfo.numValidPixel,microBlockSize:A.headerInfo.microBlockSize,blobSize:A.headerInfo.blobSize,maxZError:A.headerInfo.maxZError,pixelType:Q.getPixelType(A.headerInfo.imageType),eofOffset:A.eofOffset,mask:A.mask?{numBytes:A.mask.numBytes}:null,pixels:{numBlocksX:A.pixels.numBlocksX,numBlocksY:A.pixels.numBlocksY,maxValue:A.headerInfo.zMax,minValue:A.headerInfo.zMin,noDataValue:A.noDataValue}}},constructConstantSurface:function(A,e){var t=A.headerInfo.zMax,i=A.headerInfo.zMin,r=A.headerInfo.maxValues,I=A.headerInfo.numDims,g=A.headerInfo.height*A.headerInfo.width,n=0,a=0,o=0,B=A.pixels.resultMask,C=A.pixels.resultPixels;if(B)if(I>1){if(e)for(n=0;n1&&i!==t)if(e)for(n=0;n=-128&&e<=127;break;case 1:t=e>=0&&e<=255;break;case 2:t=e>=-32768&&e<=32767;break;case 3:t=e>=0&&e<=65536;break;case 4:t=e>=-2147483648&&e<=2147483647;break;case 5:t=e>=0&&e<=4294967296;break;case 6:t=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:t=e>=-17976931348623157e292&&e<=17976931348623157e292;break;default:t=!1}return t},getDataTypeSize:function(A){var e=0;switch(A){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=A}return e},getDataTypeUsed:function(A,e){var t=A;switch(A){case 2:case 4:t=A-e;break;case 3:case 5:t=A-2*e;break;case 6:t=0===e?A:1===e?2:1;break;case 7:t=0===e?A:A-2*e+1;break;default:t=A}return t},getOnePixel:function(A,e,t,i){var r=0;switch(t){case 0:r=i.getInt8(e);break;case 1:r=i.getUint8(e);break;case 2:r=i.getInt16(e,!0);break;case 3:r=i.getUint16(e,!0);break;case 4:r=i.getInt32(e,!0);break;case 5:r=i.getUInt32(e,!0);break;case 6:r=i.getFloat32(e,!0);break;case 7:r=i.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return r},swapDimensionOrder:function(A,e,t,i,r){var I=0,g=0,n=0,a=0,o=A;if(t>1)if(o=new i(e*t),r)for(I=0;I5)throw"unsupported lerc version 2."+g;Q.readMask(A,r),I.numValidPixel===I.width*I.height||r.pixels.resultMask||(r.pixels.resultMask=e.maskData);var a=I.width*I.height;r.pixels.resultPixels=new n(a*I.numDims),r.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var o,B=!e.returnPixelInterleavedDims;if(0!==I.numValidPixel)if(I.zMax===I.zMin)Q.constructConstantSurface(r,B);else if(g>=4&&Q.checkMinMaxRanges(A,r))Q.constructConstantSurface(r,B);else{var C=new DataView(A,r.ptr,2),E=C.getUint8(0);if(r.ptr++,E)Q.readDataOneSweep(A,r,n,B);else if(g>1&&I.imageType<=1&&Math.abs(I.maxZError-.5)<1e-5){var s=C.getUint8(1);if(r.ptr++,r.encodeMode=s,s>2||g<4&&s>1)throw"Invalid Huffman flag "+s;s?Q.readHuffman(A,r,n,B):Q.readTiles(A,r,n,B)}else Q.readTiles(A,r,n,B)}r.eofOffset=r.ptr,e.inputOffset?(o=r.headerInfo.blobSize+e.inputOffset-r.ptr,Math.abs(o)>=1&&(r.eofOffset=e.inputOffset+r.headerInfo.blobSize)):(o=r.headerInfo.blobSize-r.ptr,Math.abs(o)>=1&&(r.eofOffset=r.headerInfo.blobSize));var f={width:I.width,height:I.height,pixelData:r.pixels.resultPixels,minValue:I.zMin,maxValue:I.zMax,validPixelCount:I.numValidPixel,dimCount:I.numDims,dimStats:{minValues:I.minValues,maxValues:I.maxValues},maskData:r.pixels.resultMask};if(r.pixels.resultMask&&Q.isValidPixelValue(I.imageType,t)){var c=r.pixels.resultMask;for(i=0;i1&&(o&&f.push(o),d.fileInfo.mask&&d.fileInfo.mask.numBytes>0&&w++),E++,u.pixels.push(d.pixelData),u.statistics.push({minValue:d.minValue,maxValue:d.maxValue,noDataValue:d.noDataValue,dimStats:d.dimStats})}if(i>1&&w>1){for(Q=u.width*u.height,u.bandMasks=f,(o=new Uint8Array(Q)).set(f[0]),B=1;B1&&void 0!==arguments[1]?arguments[1]:0;if(!jA)throw new Error("ZSTDDecoder: Await .init() before decoding.");var t=A.byteLength,i=jA.exports.malloc(t);WA.set(A,i),e=e||Number(jA.exports.ZSTD_findDecompressedSize(i,t));var r=jA.exports.malloc(e),I=jA.exports.ZSTD_decompress(r,e,i,t),g=WA.slice(r,r+I);return jA.exports.free(i),jA.exports.free(r),g}}]),A}(),ee="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IAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQh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ASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigC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C0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdB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IAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY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wOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEE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",te={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},ie={};for(var re in te)te.hasOwnProperty(re)&&(ie[te[re]]=parseInt(re,10));ie.BitsPerSample,ie.ExtraSamples,ie.SampleFormat,ie.StripByteCounts,ie.StripOffsets,ie.StripRowCounts,ie.TileByteCounts,ie.TileOffsets,ie.SubIFDs;var Ie={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ge={};for(var ne in Ie)Ie.hasOwnProperty(ne)&&(ge[Ie[ne]]=parseInt(ne,10));var ae=1,oe=0,Be=1,Ce=2,Qe={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},Ee={};for(var se in Qe)Qe.hasOwnProperty(se)&&(Ee[Qe[se]]=parseInt(se,10));function fe(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var ce=new Ae,he=function(A){s(t,w);var e=fe(t);function t(A){var i;return B(this,t),(i=e.call(this)).planarConfiguration=void 0!==A.PlanarConfiguration?A.PlanarConfiguration:1,i.samplesPerPixel=void 0!==A.SamplesPerPixel?A.SamplesPerPixel:1,i.addCompression=A.LercParameters[ae],i}return Q(t,[{key:"decodeBlock",value:function(A){switch(this.addCompression){case oe:break;case Be:A=YA(new Uint8Array(A)).buffer;break;case Ce:A=ce.decode(new Uint8Array(A)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return zA.decode(A,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),t}(),le=Object.freeze({__proto__:null,zstd:ce,default:he});function ue(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var we=function(A){s(I,w);var t,i=ue(I);function I(){var A;if(B(this,I),A=i.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return A}return Q(I,[{key:"decode",value:(t=e(r.mark((function A(e,t){var i,I,g,n;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return i=new Blob([t]),A.next=3,createImageBitmap(i);case 3:return I=A.sent,"undefined"!=typeof document?((g=document.createElement("canvas")).width=I.width,g.height=I.height):g=new OffscreenCanvas(I.width,I.height),(n=g.getContext("2d")).drawImage(I,0,0),A.abrupt("return",n.getImageData(0,0,I.width,I.height).data.buffer);case 8:case"end":return A.stop()}}),A)}))),function(A,e){return t.apply(this,arguments)})}]),I}(),de=Object.freeze({__proto__:null,default:we});';return new i(typeof Buffer<"u"?"data:application/javascript;base64,"+Buffer.from(A,"binary").toString("base64"):URL.createObjectURL(new Blob([A],{type:"application/javascript"})))}export{o as create}; diff --git a/pr-preview/pr-17/assets/decoder-HRvnjnEI-Bgc3xmlZ.js b/pr-preview/pr-17/assets/decoder-HRvnjnEI-Bgc3xmlZ.js deleted file mode 100644 index 683247c..0000000 --- a/pr-preview/pr-17/assets/decoder-HRvnjnEI-Bgc3xmlZ.js +++ /dev/null @@ -1 +0,0 @@ -import{V as e}from"./EodashMap-0k6ZVzxF.js";import"./index-DBoWNDl8.js";import"./http-DqoOZdf6.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./DynamicWebComponent-Cx5W-nMa.js";var t=Worker;const i=e(t);function o(){const A='function A(A,e,t,i,r,I,g){try{var n=A[I](g),a=n.value}catch(A){return void t(A)}n.done?e(a):Promise.resolve(a).then(i,r)}function e(e){return function(){var t=this,i=arguments;return new Promise((function(r,I){var g=e.apply(t,i);function n(e){A(g,r,I,n,a,"next",e)}function a(e){A(g,r,I,n,a,"throw",e)}n(void 0)}))}}function t(A){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},t(A)}var i={exports:{}};!function(A){var e=function(A){var e,i=Object.prototype,r=i.hasOwnProperty,I="function"==typeof Symbol?Symbol:{},g=I.iterator||"@@iterator",n=I.asyncIterator||"@@asyncIterator",a=I.toStringTag||"@@toStringTag";function o(A,e,t){return Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),A[e]}try{o({},"")}catch(A){o=function(A,e,t){return A[e]=t}}function B(A,e,t,i){var r=e&&e.prototype instanceof h?e:h,I=Object.create(r.prototype),g=new S(i||[]);return I._invoke=function(A,e,t){var i=Q;return function(r,I){if(i===s)throw new Error("Generator is already running");if(i===f){if("throw"===r)throw I;return R()}for(t.method=r,t.arg=I;;){var g=t.delegate;if(g){var n=m(g,t);if(n){if(n===c)continue;return n}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(i===Q)throw i=f,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);i=s;var a=C(A,e,t);if("normal"===a.type){if(i=t.done?f:E,a.arg===c)continue;return{value:a.arg,done:t.done}}"throw"===a.type&&(i=f,t.method="throw",t.arg=a.arg)}}}(A,t,g),I}function C(A,e,t){try{return{type:"normal",arg:A.call(e,t)}}catch(A){return{type:"throw",arg:A}}}A.wrap=B;var Q="suspendedStart",E="suspendedYield",s="executing",f="completed",c={};function h(){}function l(){}function u(){}var w={};o(w,g,(function(){return this}));var d=Object.getPrototypeOf,D=d&&d(d(v([])));D&&D!==i&&r.call(D,g)&&(w=D);var y=u.prototype=h.prototype=Object.create(w);function k(A){["next","throw","return"].forEach((function(e){o(A,e,(function(A){return this._invoke(e,A)}))}))}function p(A,e){function i(I,g,n,a){var o=C(A[I],A,g);if("throw"!==o.type){var B=o.arg,Q=B.value;return Q&&"object"===t(Q)&&r.call(Q,"__await")?e.resolve(Q.__await).then((function(A){i("next",A,n,a)}),(function(A){i("throw",A,n,a)})):e.resolve(Q).then((function(A){B.value=A,n(B)}),(function(A){return i("throw",A,n,a)}))}a(o.arg)}var I;this._invoke=function(A,t){function r(){return new e((function(e,r){i(A,t,e,r)}))}return I=I?I.then(r,r):r()}}function m(A,t){var i=A.iterator[t.method];if(i===e){if(t.delegate=null,"throw"===t.method){if(A.iterator.return&&(t.method="return",t.arg=e,m(A,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a \'throw\' method")}return c}var r=C(i,A.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var I=r.arg;return I?I.done?(t[A.resultName]=I.value,t.next=A.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,c):I:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function G(A){var e={tryLoc:A[0]};1 in A&&(e.catchLoc=A[1]),2 in A&&(e.finallyLoc=A[2],e.afterLoc=A[3]),this.tryEntries.push(e)}function F(A){var e=A.completion||{};e.type="normal",delete e.arg,A.completion=e}function S(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(G,this),this.reset(!0)}function v(A){if(A){var t=A[g];if(t)return t.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var i=-1,I=function t(){for(;++i=0;--I){var g=this.tryEntries[I],n=g.completion;if("root"===g.tryLoc)return i("end");if(g.tryLoc<=this.prev){var a=r.call(g,"catchLoc"),o=r.call(g,"finallyLoc");if(a&&o){if(this.prev=0;--t){var i=this.tryEntries[t];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===A)return this.complete(t.completion,t.afterLoc),F(t),c}},catch:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===A){var i=t.completion;if("throw"===i.type){var r=i.arg;F(t)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(A,t,i){return this.delegate={iterator:v(A),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=e),c}},A}(A.exports);try{regeneratorRuntime=e}catch(A){"object"===("undefined"==typeof globalThis?"undefined":t(globalThis))?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(i);var r=i.exports,I=new Map;function g(A,e){Array.isArray(A)||(A=[A]),A.forEach((function(A){return I.set(A,e)}))}function n(A){return a.apply(this,arguments)}function a(){return(a=e(r.mark((function A(e){var t,i;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(t=I.get(e.Compression)){A.next=3;break}throw new Error("Unknown compression method identifier: ".concat(e.Compression));case 3:return A.next=5,t();case 5:return i=A.sent,A.abrupt("return",new i(e));case 7:case"end":return A.stop()}}),A)})))).apply(this,arguments)}g([void 0,1],(function(){return Promise.resolve().then((function(){return y})).then((function(A){return A.default}))})),g(5,(function(){return Promise.resolve().then((function(){return F})).then((function(A){return A.default}))})),g(6,(function(){throw new Error("old style JPEG compression is not supported.")})),g(7,(function(){return Promise.resolve().then((function(){return N})).then((function(A){return A.default}))})),g([8,32946],(function(){return Promise.resolve().then((function(){return OA})).then((function(A){return A.default}))})),g(32773,(function(){return Promise.resolve().then((function(){return _A})).then((function(A){return A.default}))})),g(34887,(function(){return Promise.resolve().then((function(){return le})).then(function(){var A=e(r.mark((function A(e){return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,e.zstd.init();case 2:return A.abrupt("return",e);case 3:case"end":return A.stop()}}),A)})));return function(e){return A.apply(this,arguments)}}()).then((function(A){return A.default}))})),g(50001,(function(){return Promise.resolve().then((function(){return de})).then((function(A){return A.default}))}));var o=globalThis;function B(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function C(A,e){for(var t=0;t0;r--)A[i+e]+=A[i],i++;t-=e}while(t>0)}function l(A,e,t){for(var i=0,r=A.length,I=r/t;r>e;){for(var g=e;g>0;--g)A[i+e]+=A[i],++i;r-=e}for(var n=A.slice(),a=0;a=A.byteLength);++o){var B=void 0;if(2===e){switch(r[0]){case 8:B=new Uint8Array(A,o*a*t*n,a*t*n);break;case 16:B=new Uint16Array(A,o*a*t*n,a*t*n/2);break;case 32:B=new Uint32Array(A,o*a*t*n,a*t*n/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(r[0]," bits per sample."))}h(B,a)}else 3===e&&l(B=new Uint8Array(A,o*a*t*n,a*t*n),a,n)}return A}o.addEventListener("message",function(){var A=e(r.mark((function A(e){var t,i,I,g,a,B;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return t=e.data,i=t.id,I=t.fileDirectory,g=t.buffer,A.next=3,n(I);case 3:return a=A.sent,A.next=6,a.decode(I,g);case 6:B=A.sent,o.postMessage({decoded:B,id:i},[B]);case 8:case"end":return A.stop()}}),A)})));return function(e){return A.apply(this,arguments)}}());var w=function(){function A(){B(this,A)}var t;return Q(A,[{key:"decode",value:(t=e(r.mark((function A(e,t){var i,I,g,n,a;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.decodeBlock(t);case 2:if(i=A.sent,1===(I=e.Predictor||1)){A.next=9;break}return g=!e.StripOffsets,n=g?e.TileWidth:e.ImageWidth,a=g?e.TileLength:e.RowsPerStrip||e.ImageLength,A.abrupt("return",u(i,I,n,a,e.BitsPerSample,e.PlanarConfiguration));case 9:return A.abrupt("return",i);case 10:case"end":return A.stop()}}),A,this)}))),function(A,e){return t.apply(this,arguments)})}]),A}();function d(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var D=function(A){s(t,w);var e=d(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return A}}]),t}(),y=Object.freeze({__proto__:null,default:D});function k(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}function p(A,e){for(var t=e.length-1;t>=0;t--)A.push(e[t]);return A}function m(A){for(var e=new Uint16Array(4093),t=new Uint8Array(4093),i=0;i<=257;i++)e[i]=4096,t[i]=i;var r=258,I=9,g=0;function n(){r=258,I=9}function a(A){var e=function(A,e,t){var i=e%8,r=Math.floor(e/8),I=8-i,g=e+t-8*(r+1),n=8*(r+2)-(e+t),a=8*(r+2)-e;if(n=Math.max(0,n),r>=A.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var o=A[r]&Math.pow(2,8-i)-1,B=o<<=t-I;if(r+1>>n;B+=C<<=Math.max(0,t-a)}if(g>8&&r+2>>Q}return B}(A,g,I);return g+=I,e}function o(A,i){return t[r]=i,e[r]=A,++r-1}function B(A){for(var i=[],r=A;4096!==r;r=e[r])i.push(t[r]);return i}var C=[];n();for(var Q,E=new Uint8Array(A),s=a(E);257!==s;){if(256===s){for(n(),s=a(E);256===s;)s=a(E);if(257===s)break;if(s>256)throw new Error("corrupted code at scanline ".concat(s));p(C,B(s)),Q=s}else if(s=Math.pow(2,I)&&(12===I?Q=void 0:I++),s=a(E)}return new Uint8Array(C)}var G=function(A){s(t,w);var e=k(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return m(A).buffer}}]),t}(),F=Object.freeze({__proto__:null,default:G});function S(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var v=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function R(A,e){for(var t=0,i=[],r=16;r>0&&!A[r-1];)--r;i.push({children:[],index:0});for(var I,g=i[0],n=0;n0;)g=i.pop();for(g.index++,i.push(g);i.length<=n;)i.push(I={children:[],index:0}),g.children[g.index]=I.children,g=I;t++}n+10)return f--,s>>f&1;if(255===(s=A[E++])){var e=A[E++];if(e)throw new Error("unexpected marker: ".concat((s<<8|e).toString(16)))}return f=7,s>>>7}function h(A){for(var e,i=A;null!==(e=c());){if("number"==typeof(i=i[e]))return i;if("object"!==t(i))throw new Error("invalid huffman sequence")}return null}function l(A){for(var e=A,t=0;e>0;){var i=c();if(null===i)return;t=t<<1|i,--e}return t}function u(A){var e=l(A);return e>=1<0)w--;else for(var t=g,i=n;t<=i;){var r=h(A.huffmanTableAC),I=15&r,a=r>>4;if(0===I){if(a<15){w=l(a)+(1<>4,0===C)r<15?(w=l(r)+(1<>4;if(0===g){if(n<15)break;r+=16}else e[v[r+=n]]=u(g),r++}};var L,b,M=0;b=1===U?r[0].blocksPerLine*r[0].blocksPerColumn:B*i.mcusPerColumn;for(var N=I||b;M=65488&&L<=65495))break;E+=2}return E-Q}function L(A,e){var t=[],i=e.blocksPerLine,r=e.blocksPerColumn,I=i<<3,g=new Int32Array(64),n=new Uint8Array(64);function a(A,t,i){var r,I,g,n,a,o,B,C,Q,E,s=e.quantizationTable,f=i;for(E=0;E<64;E++)f[E]=A[E]*s[E];for(E=0;E<8;++E){var c=8*E;0!==f[1+c]||0!==f[2+c]||0!==f[3+c]||0!==f[4+c]||0!==f[5+c]||0!==f[6+c]||0!==f[7+c]?(r=5793*f[0+c]+128>>8,I=5793*f[4+c]+128>>8,g=f[2+c],n=f[6+c],a=2896*(f[1+c]-f[7+c])+128>>8,C=2896*(f[1+c]+f[7+c])+128>>8,o=f[3+c]<<4,Q=r-I+1>>1,r=r+I+1>>1,I=Q,Q=3784*g+1567*n+128>>8,g=1567*g-3784*n+128>>8,n=Q,Q=a-(B=f[5+c]<<4)+1>>1,a=a+B+1>>1,B=Q,Q=C+o+1>>1,o=C-o+1>>1,C=Q,Q=r-n+1>>1,r=r+n+1>>1,n=Q,Q=I-g+1>>1,I=I+g+1>>1,g=Q,Q=2276*a+3406*C+2048>>12,a=3406*a-2276*C+2048>>12,C=Q,Q=799*o+4017*B+2048>>12,o=4017*o-799*B+2048>>12,B=Q,f[0+c]=r+C,f[7+c]=r-C,f[1+c]=I+B,f[6+c]=I-B,f[2+c]=g+o,f[5+c]=g-o,f[3+c]=n+a,f[4+c]=n-a):(Q=5793*f[0+c]+512>>10,f[0+c]=Q,f[1+c]=Q,f[2+c]=Q,f[3+c]=Q,f[4+c]=Q,f[5+c]=Q,f[6+c]=Q,f[7+c]=Q)}for(E=0;E<8;++E){var h=E;0!==f[8+h]||0!==f[16+h]||0!==f[24+h]||0!==f[32+h]||0!==f[40+h]||0!==f[48+h]||0!==f[56+h]?(r=5793*f[0+h]+2048>>12,I=5793*f[32+h]+2048>>12,g=f[16+h],n=f[48+h],a=2896*(f[8+h]-f[56+h])+2048>>12,C=2896*(f[8+h]+f[56+h])+2048>>12,o=f[24+h],Q=r-I+1>>1,r=r+I+1>>1,I=Q,Q=3784*g+1567*n+2048>>12,g=1567*g-3784*n+2048>>12,n=Q,Q=a-(B=f[40+h])+1>>1,a=a+B+1>>1,B=Q,Q=C+o+1>>1,o=C-o+1>>1,C=Q,Q=r-n+1>>1,r=r+n+1>>1,n=Q,Q=I-g+1>>1,I=I+g+1>>1,g=Q,Q=2276*a+3406*C+2048>>12,a=3406*a-2276*C+2048>>12,C=Q,Q=799*o+4017*B+2048>>12,o=4017*o-799*B+2048>>12,B=Q,f[0+h]=r+C,f[56+h]=r-C,f[8+h]=I+B,f[48+h]=I-B,f[16+h]=g+o,f[40+h]=g-o,f[24+h]=n+a,f[32+h]=n-a):(Q=5793*i[E+0]+8192>>14,f[0+h]=Q,f[8+h]=Q,f[16+h]=Q,f[24+h]=Q,f[32+h]=Q,f[40+h]=Q,f[48+h]=Q,f[56+h]=Q)}for(E=0;E<64;++E){var l=128+(f[E]+8>>4);t[E]=l<0?0:l>255?255:l}}for(var o=0;o>4==0)for(var C=0;C<64;C++){B[v[C]]=A[e++]}else{if(o>>4!=1)throw new Error("DQT: invalid table spec");for(var Q=0;Q<64;Q++){B[v[Q]]=t()}}this.quantizationTables[15&o]=B}break;case 65472:case 65473:case 65474:t();for(var E={extended:65473===g,progressive:65474===g,precision:A[e++],scanLines:t(),samplesPerLine:t(),components:{},componentsOrder:[]},s=A[e++],f=void 0,c=0;c>4,l=15&A[e+1],u=A[e+2];E.componentsOrder.push(f),E.components[f]={h:h,v:l,quantizationIdx:u},e+=3}i(E),this.frames.push(E);break;case 65476:for(var w=t(),d=2;d>4==0?this.huffmanTablesDC[15&D]=R(y,m):this.huffmanTablesAC[15&D]=R(y,m)}break;case 65501:t(),this.resetInterval=t();break;case 65498:t();for(var F=A[e++],S=[],L=this.frames[0],b=0;b>4],M.huffmanTableAC=this.huffmanTablesAC[15&N],S.push(M)}var x=A[e++],J=A[e++],q=A[e++],Y=U(A,e,L,S,this.resetInterval,x,J,q>>4,15&q);e+=Y;break;case 65535:255!==A[e]&&e--;break;default:if(255===A[e-3]&&A[e-2]>=192&&A[e-2]<=254){e-=3;break}throw new Error("unknown JPEG marker ".concat(g.toString(16)))}g=t()}}},{key:"getResult",value:function(){var A=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var e=0;e=0;)A[e]=0}x(new Array(576)),x(new Array(60)),x(new Array(512)),x(new Array(256)),x(new Array(29)),x(new Array(30));var J=function(A,e,t,i){for(var r=65535&A|0,I=A>>>16&65535|0,g=0;0!==t;){t-=g=t>2e3?2e3:t;do{I=I+(r=r+e[i++]|0)|0}while(--g);r%=65521,I%=65521}return r|I<<16|0},q=new Uint32Array(function(){for(var A,e=[],t=0;t<256;t++){A=t;for(var i=0;i<8;i++)A=1&A?3988292384^A>>>1:A>>>1;e[t]=A}return e}()),Y=function(A,e,t,i){var r=q,I=i+t;A^=-1;for(var g=i;g>>8^r[255&(A^e[g])];return-1^A},K={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},H={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},O=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},P=function(A){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!==t(i))throw new TypeError(i+"must be non-object");for(var r in i)O(i,r)&&(A[r]=i[r])}}return A},T=function(A){for(var e=0,t=0,i=A.length;t=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;_[254]=_[254]=1;var Z=function(A){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(A);var e,t,i,r,I,g=A.length,n=0;for(r=0;r>>6,e[I++]=128|63&t):t<65536?(e[I++]=224|t>>>12,e[I++]=128|t>>>6&63,e[I++]=128|63&t):(e[I++]=240|t>>>18,e[I++]=128|t>>>12&63,e[I++]=128|t>>>6&63,e[I++]=128|63&t);return e},j=function(A,e){var t,i,r=e||A.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(A.subarray(0,e));var I=new Array(2*r);for(i=0,t=0;t4)I[i++]=65533,t+=n-1;else{for(g&=2===n?31:3===n?15:7;n>1&&t1?I[i++]=65533:g<65536?I[i++]=g:(g-=65536,I[i++]=55296|g>>10&1023,I[i++]=56320|1023&g)}}}return function(A,e){if(e<65534&&A.subarray&&V)return String.fromCharCode.apply(null,A.length===e?A:A.subarray(0,e));for(var t="",i=0;iA.length&&(e=A.length);for(var t=e-1;t>=0&&128==(192&A[t]);)t--;return t<0||0===t?e:t+_[A[t]]>e?t:e};var z=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(A,e){var t,i,r,I,g,n,a,o,B,C,Q,E,s,f,c,h,l,u,w,d,D,y,k,p,m=A.state;t=A.next_in,k=A.input,i=t+(A.avail_in-5),r=A.next_out,p=A.output,I=r-(e-A.avail_out),g=r+(A.avail_out-257),n=m.dmax,a=m.wsize,o=m.whave,B=m.wnext,C=m.window,Q=m.hold,E=m.bits,s=m.lencode,f=m.distcode,c=(1<>>=u=l>>>24,E-=u,0===(u=l>>>16&255))p[r++]=65535&l;else{if(!(16&u)){if(0==(64&u)){l=s[(65535&l)+(Q&(1<>>=u,E-=u),E<15&&(Q+=k[t++]<>>=u=l>>>24,E-=u,!(16&(u=l>>>16&255))){if(0==(64&u)){l=f[(65535&l)+(Q&(1<n){A.msg="invalid distance too far back",m.mode=30;break A}if(Q>>>=u,E-=u,d>(u=r-I)){if((u=d-u)>o&&m.sane){A.msg="invalid distance too far back",m.mode=30;break A}if(D=0,y=C,0===B){if(D+=a-u,u2;)p[r++]=y[D++],p[r++]=y[D++],p[r++]=y[D++],w-=3;w&&(p[r++]=y[D++],w>1&&(p[r++]=y[D++]))}else{D=r-d;do{p[r++]=p[D++],p[r++]=p[D++],p[r++]=p[D++],w-=3}while(w>2);w&&(p[r++]=p[D++],w>1&&(p[r++]=p[D++]))}break}}break}}while(t>3,Q&=(1<<(E-=w<<3))-1,A.next_in=t,A.next_out=r,A.avail_in=t=1&&0===v[d];d--);if(D>d&&(D=d),0===d)return r[I++]=20971520,r[I++]=20971520,n.bits=1,0;for(w=1;w0&&(0===A||1!==d))return-1;for(R[1]=0,l=1;l<15;l++)R[l+1]=R[l]+v[l];for(u=0;u852||2===A&&m>592)return 1;for(;;){s=l-k,g[u]E?(f=U[L+g[u]],c=F[S+g[u]]):(f=96,c=0),a=1<>k)+(o-=a)]=s<<24|f<<16|c|0}while(0!==o);for(a=1<>=1;if(0!==a?(G&=a-1,G+=a):G=0,u++,0==--v[l]){if(l===d)break;l=e[t+g[u]]}if(l>D&&(G&C)!==B){for(0===k&&(k=D),Q+=w,p=1<<(y=l-k);y+k852||2===A&&m>592)return 1;r[B=G&C]=D<<24|y<<16|Q-I|0}}return 0!==G&&(r[Q+G]=l-k<<24|64<<16|0),n.bits=D,0},IA=H.Z_FINISH,gA=H.Z_BLOCK,nA=H.Z_TREES,aA=H.Z_OK,oA=H.Z_STREAM_END,BA=H.Z_NEED_DICT,CA=H.Z_STREAM_ERROR,QA=H.Z_DATA_ERROR,EA=H.Z_MEM_ERROR,sA=H.Z_BUF_ERROR,fA=H.Z_DEFLATED,cA=function(A){return(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24)};function hA(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var lA,uA,wA=function(A){if(!A||!A.state)return CA;var e=A.state;return A.total_in=A.total_out=e.total=0,A.msg="",e.wrap&&(A.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,aA},dA=function(A){if(!A||!A.state)return CA;var e=A.state;return e.wsize=0,e.whave=0,e.wnext=0,wA(A)},DA=function(A,e){var t;if(!A||!A.state)return CA;var i=A.state;return e<0?(t=0,e=-e):(t=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?CA:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,dA(A))},yA=function(A,e){if(!A)return CA;var t=new hA;A.state=t,t.window=null;var i=DA(A,e);return i!==aA&&(A.state=null),i},kA=!0,pA=function(A){if(kA){lA=new Int32Array(512),uA=new Int32Array(32);for(var e=0;e<144;)A.lens[e++]=8;for(;e<256;)A.lens[e++]=9;for(;e<280;)A.lens[e++]=7;for(;e<288;)A.lens[e++]=8;for(rA(1,A.lens,0,288,lA,0,A.work,{bits:9}),e=0;e<32;)A.lens[e++]=5;rA(2,A.lens,0,32,uA,0,A.work,{bits:5}),kA=!1}A.lencode=lA,A.lenbits=9,A.distcode=uA,A.distbits=5},mA=function(A,e,t,i){var r,I=A.state;return null===I.window&&(I.wsize=1<=I.wsize?(I.window.set(e.subarray(t-I.wsize,t),0),I.wnext=0,I.whave=I.wsize):((r=I.wsize-I.wnext)>i&&(r=i),I.window.set(e.subarray(t-i,t-i+r),I.wnext),(i-=r)?(I.window.set(e.subarray(t-i,t),0),I.wnext=i,I.whave=I.wsize):(I.wnext+=r,I.wnext===I.wsize&&(I.wnext=0),I.whave>>8&255,t.check=Y(t.check,G,2,0),o=0,B=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&o)<<8)+(o>>8))%31){A.msg="incorrect header check",t.mode=30;break}if((15&o)!==fA){A.msg="unknown compression method",t.mode=30;break}if(B-=4,D=8+(15&(o>>>=4)),0===t.wbits)t.wbits=D;else if(D>t.wbits){A.msg="invalid window size",t.mode=30;break}t.dmax=1<>8&1),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0,t.mode=3;case 3:for(;B<32;){if(0===n)break A;n--,o+=i[I++]<>>8&255,G[2]=o>>>16&255,G[3]=o>>>24&255,t.check=Y(t.check,G,4,0)),o=0,B=0,t.mode=4;case 4:for(;B<16;){if(0===n)break A;n--,o+=i[I++]<>8),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0,t.mode=5;case 5:if(1024&t.flags){for(;B<16;){if(0===n)break A;n--,o+=i[I++]<>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((E=t.length)>n&&(E=n),E&&(t.head&&(D=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(I,I+E),D)),512&t.flags&&(t.check=Y(t.check,i,E,I)),n-=E,I+=E,t.length-=E),t.length))break A;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===n)break A;E=0;do{D=i[I+E++],t.head&&D&&t.length<65536&&(t.head.name+=String.fromCharCode(D))}while(D&&E>9&1,t.head.done=!0),A.adler=t.check=0,t.mode=12;break;case 10:for(;B<32;){if(0===n)break A;n--,o+=i[I++]<>>=7&B,B-=7&B,t.mode=27;break}for(;B<3;){if(0===n)break A;n--,o+=i[I++]<>>=1)){case 0:t.mode=14;break;case 1:if(pA(t),t.mode=20,e===nA){o>>>=2,B-=2;break A}break;case 2:t.mode=17;break;case 3:A.msg="invalid block type",t.mode=30}o>>>=2,B-=2;break;case 14:for(o>>>=7&B,B-=7&B;B<32;){if(0===n)break A;n--,o+=i[I++]<>>16^65535)){A.msg="invalid stored block lengths",t.mode=30;break}if(t.length=65535&o,o=0,B=0,t.mode=15,e===nA)break A;case 15:t.mode=16;case 16:if(E=t.length){if(E>n&&(E=n),E>a&&(E=a),0===E)break A;r.set(i.subarray(I,I+E),g),n-=E,I+=E,a-=E,g+=E,t.length-=E;break}t.mode=12;break;case 17:for(;B<14;){if(0===n)break A;n--,o+=i[I++]<>>=5,B-=5,t.ndist=1+(31&o),o>>>=5,B-=5,t.ncode=4+(15&o),o>>>=4,B-=4,t.nlen>286||t.ndist>30){A.msg="too many length or distance symbols",t.mode=30;break}t.have=0,t.mode=18;case 18:for(;t.have>>=3,B-=3}for(;t.have<19;)t.lens[F[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,k={bits:t.lenbits},y=rA(0,t.lens,0,19,t.lencode,0,t.work,k),t.lenbits=k.bits,y){A.msg="invalid code lengths set",t.mode=30;break}t.have=0,t.mode=19;case 19:for(;t.have>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>>=c,B-=c,t.lens[t.have++]=l;else{if(16===l){for(p=c+2;B>>=c,B-=c,0===t.have){A.msg="invalid bit length repeat",t.mode=30;break}D=t.lens[t.have-1],E=3+(3&o),o>>>=2,B-=2}else if(17===l){for(p=c+3;B>>=c)),o>>>=3,B-=3}else{for(p=c+7;B>>=c)),o>>>=7,B-=7}if(t.have+E>t.nlen+t.ndist){A.msg="invalid bit length repeat",t.mode=30;break}for(;E--;)t.lens[t.have++]=D}}if(30===t.mode)break;if(0===t.lens[256]){A.msg="invalid code -- missing end-of-block",t.mode=30;break}if(t.lenbits=9,k={bits:t.lenbits},y=rA(1,t.lens,0,t.nlen,t.lencode,0,t.work,k),t.lenbits=k.bits,y){A.msg="invalid literal/lengths set",t.mode=30;break}if(t.distbits=6,t.distcode=t.distdyn,k={bits:t.distbits},y=rA(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,k),t.distbits=k.bits,y){A.msg="invalid distances set",t.mode=30;break}if(t.mode=20,e===nA)break A;case 20:t.mode=21;case 21:if(n>=6&&a>=258){A.next_out=g,A.avail_out=a,A.next_in=I,A.avail_in=n,t.hold=o,t.bits=B,$(A,Q),g=A.next_out,r=A.output,a=A.avail_out,I=A.next_in,i=A.input,n=A.avail_in,o=t.hold,B=t.bits,12===t.mode&&(t.back=-1);break}for(t.back=0;h=(m=t.lencode[o&(1<>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>u)])>>>16&255,l=65535&m,!(u+(c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>>=u,B-=u,t.back+=u}if(o>>>=c,B-=c,t.back+=c,t.length=l,0===h){t.mode=26;break}if(32&h){t.back=-1,t.mode=12;break}if(64&h){A.msg="invalid literal/length code",t.mode=30;break}t.extra=15&h,t.mode=22;case 22:if(t.extra){for(p=t.extra;B>>=t.extra,B-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;h=(m=t.distcode[o&(1<>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>u)])>>>16&255,l=65535&m,!(u+(c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<>>=u,B-=u,t.back+=u}if(o>>>=c,B-=c,t.back+=c,64&h){A.msg="invalid distance code",t.mode=30;break}t.offset=l,t.extra=15&h,t.mode=24;case 24:if(t.extra){for(p=t.extra;B>>=t.extra,B-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){A.msg="invalid distance too far back",t.mode=30;break}t.mode=25;case 25:if(0===a)break A;if(E=Q-a,t.offset>E){if((E=t.offset-E)>t.whave&&t.sane){A.msg="invalid distance too far back",t.mode=30;break}E>t.wnext?(E-=t.wnext,s=t.wsize-E):s=t.wnext-E,E>t.length&&(E=t.length),f=t.window}else f=r,s=g-t.offset,E=t.length;E>a&&(E=a),a-=E,t.length-=E;do{r[g++]=f[s++]}while(--E);0===t.length&&(t.mode=21);break;case 26:if(0===a)break A;r[g++]=t.length,a--,t.mode=21;break;case 27:if(t.wrap){for(;B<32;){if(0===n)break A;n--,o|=i[I++]<=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||A&&A.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new z,this.strm.avail_out=0;var t=GA.inflateInit2(this.strm,e.windowBits);if(t!==UA)throw new Error(K[t]);if(this.header=new FA,GA.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Z(e.dictionary):"[object ArrayBuffer]"===SA.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=GA.inflateSetDictionary(this.strm,e.dictionary))!==UA))throw new Error(K[t])}function qA(A,e){var t=new JA(e);if(t.push(A),t.err)throw t.msg||K[t.err];return t.result}JA.prototype.push=function(A,e){var t,i,r,I=this.strm,g=this.options.chunkSize,n=this.options.dictionary;if(this.ended)return!1;for(i=e===~~e?e:!0===e?RA:vA,"[object ArrayBuffer]"===SA.call(A)?I.input=new Uint8Array(A):I.input=A,I.next_in=0,I.avail_in=I.input.length;;){for(0===I.avail_out&&(I.output=new Uint8Array(g),I.next_out=0,I.avail_out=g),(t=GA.inflate(I,i))===bA&&n&&((t=GA.inflateSetDictionary(I,n))===UA?t=GA.inflate(I,i):t===NA&&(t=bA));I.avail_in>0&&t===LA&&I.state.wrap>0&&0!==A[I.next_in];)GA.inflateReset(I),t=GA.inflate(I,i);switch(t){case MA:case NA:case bA:case xA:return this.onEnd(t),this.ended=!0,!1}if(r=I.avail_out,I.next_out&&(0===I.avail_out||t===LA))if("string"===this.options.to){var a=W(I.output,I.next_out),o=I.next_out-a,B=j(I.output,a);I.next_out=o,I.avail_out=g-o,o&&I.output.set(I.output.subarray(a,a+o),0),this.onData(B)}else this.onData(I.output.length===I.next_out?I.output:I.output.subarray(0,I.next_out));if(t!==UA||0!==r){if(t===LA)return t=GA.inflateEnd(this.strm),this.onEnd(t),this.ended=!0,!0;if(0===I.avail_in)break}}return!0},JA.prototype.onData=function(A){this.chunks.push(A)},JA.prototype.onEnd=function(A){A===UA&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=T(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var YA={Inflate:JA,inflate:qA,inflateRaw:function(A,e){return(e=e||{}).raw=!0,qA(A,e)},ungzip:qA,constants:H}.inflate;function KA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var HA=function(A){s(t,w);var e=KA(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return YA(new Uint8Array(A)).buffer}}]),t}(),OA=Object.freeze({__proto__:null,default:HA});function PA(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var TA,VA=function(A){s(t,w);var e=PA(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){for(var e=new DataView(A),t=[],i=0;i>3],m<<=7&G),c=0;c>3]),128&m?(a&&(a[G]=1),f=f>(g=S.encoding<2?y[k++]:p)?g:f,n[G++]=g):(a&&(a[G]=0),n[G++]=i),m<<=1;G+=F}else if(S.encoding<2)for(h=0;h(g=y[k++])?g:f,n[G++]=g;G+=F}else for(f=f>p?p:f,h=0;h0){var g=new Uint8Array(Math.ceil(i.width*i.height/8)),n=(I=new DataView(A,e,i.mask.numBytes)).getInt16(0,!0),a=2,o=0;do{if(n>0)for(;n--;)g[o++]=I.getUint8(a++);else{var B=I.getUint8(a++);for(n=-n;n--;)g[o++]=B}n=I.getInt16(a,!0),a+=2}while(a0?1:0),s=Q+(i.height%Q>0?1:0);i.pixels.blocks=new Array(E*s);for(var f=0,c=0;c3)throw"Invalid block encoding ("+w.encoding+")";if(2!==w.encoding){if(0!==d&&2!==d){if(d>>=6,w.offsetType=d,2===d)w.offset=I.getInt8(1),l++;else if(1===d)w.offset=I.getInt16(1,!0),l+=2;else{if(0!==d)throw"Invalid block offset type";w.offset=I.getFloat32(1,!0),l+=4}if(1===w.encoding)if(d=I.getUint8(l),l++,w.bitsPerPixel=63&d,d>>=6,w.numValidPixelsType=d,2===d)w.numValidPixels=I.getUint8(l),l++;else if(1===d)w.numValidPixels=I.getUint16(l,!0),l+=2;else{if(0!==d)throw"Invalid valid pixel count type";w.numValidPixels=I.getUint32(l,!0),l+=4}}var D;if(e+=l,3!==w.encoding)if(0===w.encoding){var y=(i.pixels.numBytes-1)/4;if(y!==Math.floor(y))throw"uncompressed block has invalid length";D=new ArrayBuffer(4*y),new Uint8Array(D).set(new Uint8Array(A,e,4*y));var k=new Float32Array(D);w.rawData=k,e+=4*y}else if(1===w.encoding){var p=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),m=Math.ceil(p/4);D=new ArrayBuffer(4*m),new Uint8Array(D).set(new Uint8Array(A,e,p)),w.stuffedData=new Uint32Array(D),e+=p}}else e++}return i.eofOffset=e,i},I=function(A,e,t,i,r,I,g){var n,a,o,B=(1<=e)a=o>>>Q-e&B,Q-=e;else{var f=e-Q;a=(o&B)<>>(Q=32-f)}I[n]=a=t?(o=B>>>f-t&E,f-=t):(o=(B&E)<<(C=t-f)&E,o+=(B=A[s++])>>>(f=32-C)),e[a]=r[o];else for(Q=Math.ceil((n-I)/g),a=0;a=t?(o=B>>>f-t&E,f-=t):(o=(B&E)<<(C=t-f)&E,o+=(B=A[s++])>>>(f=32-C)),e[a]=o=e?(Q=g>>>C-e&n,C-=e):(Q=(g&n)<<(B=e-C)&n,Q+=(g=A[a++])>>>(C=32-B)),E[o]=Q=t?(o=B>>>f&Q,s-=t,f+=t):(o=B>>>f&Q,s=32-(C=t-s),o|=((B=A[E++])&(1<=t?(o=B>>>f&Q,s-=t,f+=t):(o=B>>>f&Q,s=32-(C=t-s),o|=((B=A[E++])&(1<=e?(Q=g>>>E&n,C-=e,E+=e):(Q=g>>>E&n,C=32-(B=e-C),Q|=((g=A[a++])&(1<=t?(I=g>>>B-t&a,B-=t):(I=(g&a)<<(n=t-B)&a,I+=(g=A[o++])>>>(B=32-n)),e[r]=I;return e},C=function(A,e,t,i){var r,I,g,n,a=(1<=t?(I=g>>>C&a,B-=t,C+=t):(I=g>>>C&a,B=32-(n=t-B),I|=((g=A[o++])&(1<=359?359:r;r-=g;do{e+=A[I++]<<8,t+=e+=A[I++]}while(--g);e=(65535&e)+(e>>>16),t=(65535&t)+(t>>>16)}return 1&i&&(t+=e+=A[I]<<8),((t=(65535&t)+(t>>>16))<<16|(e=(65535&e)+(e>>>16)))>>>0},readHeaderInfo:function(A,e){var t=e.ptr,i=new Uint8Array(A,t,6),r={};if(r.fileIdentifierString=String.fromCharCode.apply(null,i),0!==r.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+r.fileIdentifierString;t+=6;var I,g=new DataView(A,t,8),n=g.getInt32(0,!0);if(r.fileVersion=n,t+=4,n>=3&&(r.checksum=g.getUint32(4,!0),t+=4),g=new DataView(A,t,12),r.height=g.getUint32(0,!0),r.width=g.getUint32(4,!0),t+=8,n>=4?(r.numDims=g.getUint32(8,!0),t+=4):r.numDims=1,g=new DataView(A,t,40),r.numValidPixel=g.getUint32(0,!0),r.microBlockSize=g.getInt32(4,!0),r.blobSize=g.getInt32(8,!0),r.imageType=g.getInt32(12,!0),r.maxZError=g.getFloat64(16,!0),r.zMin=g.getFloat64(24,!0),r.zMax=g.getFloat64(32,!0),t+=40,e.headerInfo=r,e.ptr=t,n>=3&&(I=n>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(A,t-I,r.blobSize-14))!==r.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(A,e){var t=e.headerInfo,i=this.getDataTypeArray(t.imageType),r=t.numDims*this.getDataTypeSize(t.imageType),I=this.readSubArray(A,e.ptr,i,r),g=this.readSubArray(A,e.ptr+r,i,r);e.ptr+=2*r;var n,a=!0;for(n=0;n0){t=new Uint8Array(Math.ceil(g/8));var B=(a=new DataView(A,r,o.numBytes)).getInt16(0,!0),C=2,Q=0,E=0;do{if(B>0)for(;B--;)t[Q++]=a.getUint8(C++);else for(E=a.getUint8(C++),B=-B;B--;)t[Q++]=E;B=a.getInt16(C,!0),C+=2}while(C>3],s<<=7&f):s=t[f>>3],128&s&&(i[f]=1);e.pixels.resultMask=i,o.bitset=t,r+=o.numBytes}return e.ptr=r,e.mask=o,!0},readDataOneSweep:function(A,e,t,i){var r,I=e.ptr,g=e.headerInfo,n=g.numDims,a=g.width*g.height,o=g.imageType,B=g.numValidPixel*Q.getDataTypeSize(o)*n,C=e.pixels.resultMask;if(t===Uint8Array)r=new Uint8Array(A,I,B);else{var E=new ArrayBuffer(B);new Uint8Array(E).set(new Uint8Array(A,I,B)),r=new t(E)}if(r.length===a*n)e.pixels.resultPixels=i?Q.swapDimensionOrder(r,a,n,t,!0):r;else{e.pixels.resultPixels=new t(a*n);var s=0,f=0,c=0,h=0;if(n>1){if(i){for(f=0;f=g)return!1;var n=new Uint32Array(g-I);Q.decodeBits(A,e,n);var a,o,B,C,s=[];for(a=I;a0&&(s[o].second=l<>>32-C,32-w>=C?32===(w+=C)&&(w=0,l=u[++d]):(w+=C-32,l=u[++d],s[o].second|=l>>>32-w));var D=0,y=0,k=new E;for(a=0;a=t?t:D;var p,m,G,F,S,v=[];for(a=I;a0)if(p=[C,o],C<=y)for(m=s[o].second<=0;F--)m>>>F&1?(S.right||(S.right=new E),S=S.right):(S.left||(S.left=new E),S=S.left),0!==F||S.val||(S.val=p[1]);return{decodeLut:v,numBitsLUTQick:y,numBitsLUT:D,tree:k,stuffedData:u,srcPtr:d,bitPos:w}},readHuffman:function(A,e,t,i){var r,I,g,n,a,o,B,C,E,s=e.headerInfo.numDims,f=e.headerInfo.height,c=e.headerInfo.width,h=c*f,l=this.readHuffmanTree(A,e),u=l.decodeLut,w=l.tree,d=l.stuffedData,D=l.srcPtr,y=l.bitPos,k=l.numBitsLUTQick,p=l.numBitsLUT,m=0===e.headerInfo.imageType?128:0,G=e.pixels.resultMask,F=0;y>0&&(D++,y=0);var S,v=d[D],R=1===e.encodeMode,U=new t(h*s),L=U;if(s<2||R){for(S=0;S1&&(L=new t(U.buffer,h*S,h),F=0),e.headerInfo.numValidPixel===c*f)for(C=0,o=0;o>>32-k,32-y>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<>>32-p,32-y>>64-y-p),r=w,E=0;E>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,R?(g+=B>0?F:o>0?L[C-c]:F,g&=255,L[C]=g,F=g):L[C]=g}else for(C=0,o=0;o>>32-k,32-y>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<>>32-p,32-y>>64-y-p),r=w,E=0;E>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,R?(B>0&&G[C-1]?g+=F:o>0&&G[C-c]?g+=L[C-c]:g+=F,g&=255,L[C]=g,F=g):L[C]=g}}else for(C=0,o=0;o>>32-k,32-y>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<>>32-p,32-y>>64-y-p),r=w,E=0;E>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,L[C]=g}e.ptr=e.ptr+4*(D+1)+(y>0?4:0),e.pixels.resultPixels=U,s>1&&!i&&(e.pixels.resultPixels=Q.swapDimensionOrder(U,h,s,t))},decodeBits:function(A,e,t,i,r){var I=e.headerInfo,Q=I.fileVersion,E=0,s=A.byteLength-e.ptr>=5?5:A.byteLength-e.ptr,f=new DataView(A,e.ptr,s),c=f.getUint8(0);E++;var h=c>>6,l=0===h?4:3-h,u=(32&c)>0,w=31&c,d=0;if(1===l)d=f.getUint8(E),E++;else if(2===l)d=f.getUint16(E,!0),E+=2;else{if(4!==l)throw"Invalid valid pixel count type";d=f.getUint32(E,!0),E+=4}var D,y,k,p,m,G,F,S,v,R=2*I.maxZError,U=I.numDims>1?I.maxValues[r]:I.zMax;if(u){for(e.counter.lut++,S=f.getUint8(E),E++,p=Math.ceil((S-1)*w/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),k=new Uint8Array(y),e.ptr+=E,k.set(new Uint8Array(A,e.ptr,p)),F=new Uint32Array(y),e.ptr+=p,v=0;S-1>>>v;)v++;p=Math.ceil(d*v/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),(k=new Uint8Array(y)).set(new Uint8Array(A,e.ptr,p)),D=new Uint32Array(y),e.ptr+=p,G=Q>=3?o(F,w,S-1,i,R,U):n(F,w,S-1,i,R,U),Q>=3?a(D,t,v,d,G):g(D,t,v,d,G)}else e.counter.bitstuffer++,v=w,e.ptr+=E,v>0&&(p=Math.ceil(d*v/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),(k=new Uint8Array(y)).set(new Uint8Array(A,e.ptr,p)),D=new Uint32Array(y),e.ptr+=p,Q>=3?null==i?C(D,t,v,d):a(D,t,v,d,!1,i,R,U):null==i?B(D,t,v,d):g(D,t,v,d,!1,i,R,U))},readTiles:function(A,e,t,i){var r=e.headerInfo,I=r.width,g=r.height,n=I*g,a=r.microBlockSize,o=r.imageType,B=Q.getDataTypeSize(o),C=Math.ceil(I/a),E=Math.ceil(g/a);e.pixels.numBlocksY=E,e.pixels.numBlocksX=C,e.pixels.ptr=0;var s,f,c,h,l,u,w,d,D,y,k=0,p=0,m=0,G=0,F=0,S=0,v=0,R=0,U=0,L=0,b=0,M=0,N=0,x=0,J=0,q=new t(a*a),Y=g%a||a,K=I%a||a,H=r.numDims,O=e.pixels.resultMask,P=e.pixels.resultPixels,T=r.fileVersion>=5?14:15,V=r.zMax;for(m=0;m1?(y=P,L=m*I*a+G*a,P=new t(e.pixels.resultPixels.buffer,n*d*B,n),V=r.maxValues[d]):y=null,v=A.byteLength-e.ptr,f={},J=0,R=(s=new DataView(A,e.ptr,Math.min(10,v))).getUint8(0),J++,D=r.fileVersion>=5?4&R:0,U=R>>6&255,(R>>2&T)!=(G*a>>3&T))throw"integrity issue";if(D&&0===d)throw"integrity issue";if((l=3&R)>3)throw e.ptr+=J,"Invalid block encoding ("+l+")";if(2!==l)if(0===l){if(D)throw"integrity issue";if(e.counter.uncompressed++,e.ptr+=J,M=(M=F*S*B)<(N=A.byteLength-e.ptr)?M:N,c=new ArrayBuffer(M%B==0?M:M+B-M%B),new Uint8Array(c).set(new Uint8Array(A,e.ptr,M)),h=new t(c),x=0,O)for(k=0;k1&&!i&&(e.pixels.resultPixels=Q.swapDimensionOrder(e.pixels.resultPixels,n,H,t))},formatFileInfo:function(A){return{fileIdentifierString:A.headerInfo.fileIdentifierString,fileVersion:A.headerInfo.fileVersion,imageType:A.headerInfo.imageType,height:A.headerInfo.height,width:A.headerInfo.width,numValidPixel:A.headerInfo.numValidPixel,microBlockSize:A.headerInfo.microBlockSize,blobSize:A.headerInfo.blobSize,maxZError:A.headerInfo.maxZError,pixelType:Q.getPixelType(A.headerInfo.imageType),eofOffset:A.eofOffset,mask:A.mask?{numBytes:A.mask.numBytes}:null,pixels:{numBlocksX:A.pixels.numBlocksX,numBlocksY:A.pixels.numBlocksY,maxValue:A.headerInfo.zMax,minValue:A.headerInfo.zMin,noDataValue:A.noDataValue}}},constructConstantSurface:function(A,e){var t=A.headerInfo.zMax,i=A.headerInfo.zMin,r=A.headerInfo.maxValues,I=A.headerInfo.numDims,g=A.headerInfo.height*A.headerInfo.width,n=0,a=0,o=0,B=A.pixels.resultMask,C=A.pixels.resultPixels;if(B)if(I>1){if(e)for(n=0;n1&&i!==t)if(e)for(n=0;n=-128&&e<=127;break;case 1:t=e>=0&&e<=255;break;case 2:t=e>=-32768&&e<=32767;break;case 3:t=e>=0&&e<=65536;break;case 4:t=e>=-2147483648&&e<=2147483647;break;case 5:t=e>=0&&e<=4294967296;break;case 6:t=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:t=e>=-17976931348623157e292&&e<=17976931348623157e292;break;default:t=!1}return t},getDataTypeSize:function(A){var e=0;switch(A){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=A}return e},getDataTypeUsed:function(A,e){var t=A;switch(A){case 2:case 4:t=A-e;break;case 3:case 5:t=A-2*e;break;case 6:t=0===e?A:1===e?2:1;break;case 7:t=0===e?A:A-2*e+1;break;default:t=A}return t},getOnePixel:function(A,e,t,i){var r=0;switch(t){case 0:r=i.getInt8(e);break;case 1:r=i.getUint8(e);break;case 2:r=i.getInt16(e,!0);break;case 3:r=i.getUint16(e,!0);break;case 4:r=i.getInt32(e,!0);break;case 5:r=i.getUInt32(e,!0);break;case 6:r=i.getFloat32(e,!0);break;case 7:r=i.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return r},swapDimensionOrder:function(A,e,t,i,r){var I=0,g=0,n=0,a=0,o=A;if(t>1)if(o=new i(e*t),r)for(I=0;I5)throw"unsupported lerc version 2."+g;Q.readMask(A,r),I.numValidPixel===I.width*I.height||r.pixels.resultMask||(r.pixels.resultMask=e.maskData);var a=I.width*I.height;r.pixels.resultPixels=new n(a*I.numDims),r.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var o,B=!e.returnPixelInterleavedDims;if(0!==I.numValidPixel)if(I.zMax===I.zMin)Q.constructConstantSurface(r,B);else if(g>=4&&Q.checkMinMaxRanges(A,r))Q.constructConstantSurface(r,B);else{var C=new DataView(A,r.ptr,2),E=C.getUint8(0);if(r.ptr++,E)Q.readDataOneSweep(A,r,n,B);else if(g>1&&I.imageType<=1&&Math.abs(I.maxZError-.5)<1e-5){var s=C.getUint8(1);if(r.ptr++,r.encodeMode=s,s>2||g<4&&s>1)throw"Invalid Huffman flag "+s;s?Q.readHuffman(A,r,n,B):Q.readTiles(A,r,n,B)}else Q.readTiles(A,r,n,B)}r.eofOffset=r.ptr,e.inputOffset?(o=r.headerInfo.blobSize+e.inputOffset-r.ptr,Math.abs(o)>=1&&(r.eofOffset=e.inputOffset+r.headerInfo.blobSize)):(o=r.headerInfo.blobSize-r.ptr,Math.abs(o)>=1&&(r.eofOffset=r.headerInfo.blobSize));var f={width:I.width,height:I.height,pixelData:r.pixels.resultPixels,minValue:I.zMin,maxValue:I.zMax,validPixelCount:I.numValidPixel,dimCount:I.numDims,dimStats:{minValues:I.minValues,maxValues:I.maxValues},maskData:r.pixels.resultMask};if(r.pixels.resultMask&&Q.isValidPixelValue(I.imageType,t)){var c=r.pixels.resultMask;for(i=0;i1&&(o&&f.push(o),d.fileInfo.mask&&d.fileInfo.mask.numBytes>0&&w++),E++,u.pixels.push(d.pixelData),u.statistics.push({minValue:d.minValue,maxValue:d.maxValue,noDataValue:d.noDataValue,dimStats:d.dimStats})}if(i>1&&w>1){for(Q=u.width*u.height,u.bandMasks=f,(o=new Uint8Array(Q)).set(f[0]),B=1;B1&&void 0!==arguments[1]?arguments[1]:0;if(!jA)throw new Error("ZSTDDecoder: Await .init() before decoding.");var t=A.byteLength,i=jA.exports.malloc(t);WA.set(A,i),e=e||Number(jA.exports.ZSTD_findDecompressedSize(i,t));var r=jA.exports.malloc(e),I=jA.exports.ZSTD_decompress(r,e,i,t),g=WA.slice(r,r+I);return jA.exports.free(i),jA.exports.free(r),g}}]),A}(),ee="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IAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQh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ASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigC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C0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY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wOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEE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",te={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},ie={};for(var re in te)te.hasOwnProperty(re)&&(ie[te[re]]=parseInt(re,10));ie.BitsPerSample,ie.ExtraSamples,ie.SampleFormat,ie.StripByteCounts,ie.StripOffsets,ie.StripRowCounts,ie.TileByteCounts,ie.TileOffsets,ie.SubIFDs;var Ie={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ge={};for(var ne in Ie)Ie.hasOwnProperty(ne)&&(ge[Ie[ne]]=parseInt(ne,10));var ae=1,oe=0,Be=1,Ce=2,Qe={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},Ee={};for(var se in Qe)Qe.hasOwnProperty(se)&&(Ee[Qe[se]]=parseInt(se,10));function fe(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var ce=new Ae,he=function(A){s(t,w);var e=fe(t);function t(A){var i;return B(this,t),(i=e.call(this)).planarConfiguration=void 0!==A.PlanarConfiguration?A.PlanarConfiguration:1,i.samplesPerPixel=void 0!==A.SamplesPerPixel?A.SamplesPerPixel:1,i.addCompression=A.LercParameters[ae],i}return Q(t,[{key:"decodeBlock",value:function(A){switch(this.addCompression){case oe:break;case Be:A=YA(new Uint8Array(A)).buffer;break;case Ce:A=ce.decode(new Uint8Array(A)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return zA.decode(A,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),t}(),le=Object.freeze({__proto__:null,zstd:ce,default:he});function ue(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var we=function(A){s(I,w);var t,i=ue(I);function I(){var A;if(B(this,I),A=i.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return A}return Q(I,[{key:"decode",value:(t=e(r.mark((function A(e,t){var i,I,g,n;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return i=new Blob([t]),A.next=3,createImageBitmap(i);case 3:return I=A.sent,"undefined"!=typeof document?((g=document.createElement("canvas")).width=I.width,g.height=I.height):g=new OffscreenCanvas(I.width,I.height),(n=g.getContext("2d")).drawImage(I,0,0),A.abrupt("return",n.getImageData(0,0,I.width,I.height).data.buffer);case 8:case"end":return A.stop()}}),A)}))),function(A,e){return t.apply(this,arguments)})}]),I}(),de=Object.freeze({__proto__:null,default:we});';return new i(typeof Buffer<"u"?"data:application/javascript;base64,"+Buffer.from(A,"binary").toString("base64"):URL.createObjectURL(new Blob([A],{type:"application/javascript"})))}export{o as create}; diff --git a/pr-preview/pr-17/assets/deflate-BXt-9JA_-CoW5SAcn.js b/pr-preview/pr-17/assets/deflate-BXt-9JA_-CoW5SAcn.js new file mode 100644 index 0000000..76840c6 --- /dev/null +++ b/pr-preview/pr-17/assets/deflate-BXt-9JA_-CoW5SAcn.js @@ -0,0 +1 @@ +import{b as e}from"./pako.esm-CB1uQYY0-DQSVoCko.js";import{g as o}from"./basedecoder-DHcBySSe-gdlnpIMU.js";class f extends o{decodeBlock(r){return e(new Uint8Array(r)).buffer}}export{f as default}; diff --git a/pr-preview/pr-17/assets/deflate-Be2Arps5-XLmgg930.js b/pr-preview/pr-17/assets/deflate-Be2Arps5-XLmgg930.js deleted file mode 100644 index 63dc211..0000000 --- a/pr-preview/pr-17/assets/deflate-Be2Arps5-XLmgg930.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./pako.esm-C3kYPGGQ-DQSVoCko.js";import{g as o}from"./basedecoder-Qm25PwVp-gdlnpIMU.js";class f extends o{decodeBlock(r){return e(new Uint8Array(r)).buffer}}export{f as default}; diff --git a/pr-preview/pr-17/assets/eodashSTAC-D8JkBEnM.js b/pr-preview/pr-17/assets/eodashSTAC-D8JkBEnM.js new file mode 100644 index 0000000..926a41d --- /dev/null +++ b/pr-preview/pr-17/assets/eodashSTAC-D8JkBEnM.js @@ -0,0 +1,36 @@ +import{c as X,g as Te}from"./_commonjsHelpers-Cpj98o6Y.js";import{b1 as Ce}from"./index-B5c5Pwhg.js";var Ae={exports:{}},ee={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */ee.exports;var ve;function Oe(){return ve||(ve=1,function(f,r){(function(s){var a=r&&!r.nodeType&&r,u=f&&!f.nodeType&&f,m=typeof X=="object"&&X;(m.global===m||m.window===m||m.self===m)&&(s=m);var n,g=2147483647,l=36,x=1,k=26,b=38,v=700,T=72,P=128,w="-",F=/^xn--/,N=/[^\x20-\x7E]/,U=/[\x2E\u3002\uFF0E\uFF61]/g,L={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},R=l-x,j=Math.floor,W=String.fromCharCode,$;function V(d){throw new RangeError(L[d])}function ie(d,y){for(var _=d.length,I=[];_--;)I[_]=y(d[_]);return I}function se(d,y){var _=d.split("@"),I="";_.length>1&&(I=_[0]+"@",d=_[1]),d=d.replace(U,".");var A=d.split("."),z=ie(A,y).join(".");return I+z}function oe(d){for(var y=[],_=0,I=d.length,A,z;_=55296&&A<=56319&&_65535&&(y-=65536,_+=W(y>>>10&1023|55296),y=56320|y&1023),_+=W(y),_}).join("")}function e(d){return d-48<10?d-22:d-65<26?d-65:d-97<26?d-97:l}function t(d,y){return d+22+75*(d<26)-((y!=0)<<5)}function i(d,y,_){var I=0;for(d=_?j(d/v):d>>1,d+=j(d/y);d>R*k>>1;I+=l)d=j(d/R);return j(I+(R+1)*d/(d+b))}function o(d){var y=[],_=d.length,I,A=0,z=P,S=T,O,D,Q,G,E,M,H,Z,K;for(O=d.lastIndexOf(w),O<0&&(O=0),D=0;D=128&&V("not-basic"),y.push(d.charCodeAt(D));for(Q=O>0?O+1:0;Q<_;){for(G=A,E=1,M=l;Q>=_&&V("invalid-input"),H=e(d.charCodeAt(Q++)),(H>=l||H>j((g-A)/E))&&V("overflow"),A+=H*E,Z=M<=S?x:M>=S+k?k:M-S,!(Hj(g/K)&&V("overflow"),E*=K;I=y.length+1,S=i(A-G,I,G==0),j(A/I)>g-z&&V("overflow"),z+=j(A/I),A%=I,y.splice(A++,0,z)}return ae(y)}function c(d){var y,_,I,A,z,S,O,D,Q,G,E,M=[],H,Z,K,ce;for(d=oe(d),H=d.length,y=P,_=0,z=T,S=0;S=y&&Ej((g-_)/Z)&&V("overflow"),_+=(O-y)*Z,y=O,S=0;Sg&&V("overflow"),E==y){for(D=_,Q=l;G=Q<=z?x:Q>=z+k?k:Q-z,!(D1);T++)b.splice(0,1);g[v]=b.join("")}var P=-1,w=0,F=0,N=-1,U=!1;for(v=0;vw&&(P=N,w=F)):g[v]==="0"&&(U=!0,N=v,F=1);F>w&&(P=N,w=F),w>1&&g.splice(P,w,""),l=g.length;var L="";for(g[0]===""&&(L=":"),v=0;v=u.length-1)return!1;var n=u.lastIndexOf(".",m-1);if(n<=0||n>=m-1)return!1;var g=a.list[u.slice(m+1)];return g?g.indexOf(" "+u.slice(n+1,m)+" ")>=0:!1},is:function(u){var m=u.lastIndexOf(".");if(m<=0||m>=u.length-1)return!1;var n=u.lastIndexOf(".",m-1);if(n>=0)return!1;var g=a.list[u.slice(m+1)];return g?g.indexOf(" "+u.slice(0,m)+" ")>=0:!1},get:function(u){var m=u.lastIndexOf(".");if(m<=0||m>=u.length-1)return null;var n=u.lastIndexOf(".",m-1);if(n<=0||n>=m-1)return null;var g=a.list[u.slice(m+1)];return!g||g.indexOf(" "+u.slice(n+1,m)+" ")<0?null:u.slice(n+1)},noConflict:function(){return r.SecondLevelDomains===this&&(r.SecondLevelDomains=s),this}};return a})}(he)),he.exports}/*! + * URI.js - Mutating URLs + * + * Version: 1.19.11 + * + * Author: Rodney Rehm + * Web: http://medialize.github.io/URI.js/ + * + * Licensed under + * MIT License http://www.opensource.org/licenses/mit-license + * + */(function(f){(function(r,s){f.exports?f.exports=s(Oe(),Re(),Qe()):r.URI=s(r.punycode,r.IPv6,r.SecondLevelDomains,r)})(X,function(r,s,a,u){var m=u&&u.URI;function n(e,t){var i=arguments.length>=1,o=arguments.length>=2;if(!(this instanceof n))return i?o?new n(e,t):new n(e):new n;if(e===void 0){if(i)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?e=location.href+"":e=""}if(e===null&&i)throw new TypeError("null is not a valid argument for URI");return this.href(e),t!==void 0?this.absoluteTo(t):this}function g(e){return/^[0-9]+$/.test(e)}n.version="1.19.11";var l=n.prototype,x=Object.prototype.hasOwnProperty;function k(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function b(e){return e===void 0?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function v(e){return b(e)==="Array"}function T(e,t){var i={},o,c;if(b(t)==="RegExp")i=null;else if(v(t))for(o=0,c=t.length;o]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,n.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},n.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,n.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,n.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},n.hostProtocols=["http","https"],n.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,n.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},n.getDomAttribute=function(e){if(!(!e||!e.nodeName)){var t=e.nodeName.toLowerCase();if(!(t==="input"&&e.type!=="image"))return n.domAttributes[t]}};function N(e){return escape(e)}function U(e){return encodeURIComponent(e).replace(/[!'()*]/g,N).replace(/\*/g,"%2A")}n.encode=U,n.decode=decodeURIComponent,n.iso8859=function(){n.encode=escape,n.decode=unescape},n.unicode=function(){n.encode=U,n.decode=decodeURIComponent},n.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},n.encodeQuery=function(e,t){var i=n.encode(e+"");return t===void 0&&(t=n.escapeQuerySpace),t?i.replace(/%20/g,"+"):i},n.decodeQuery=function(e,t){e+="",t===void 0&&(t=n.escapeQuerySpace);try{return n.decode(t?e.replace(/\+/g,"%20"):e)}catch{return e}};var L={encode:"encode",decode:"decode"},R,j=function(e,t){return function(i){try{return n[t](i+"").replace(n.characters[e][t].expression,function(o){return n.characters[e][t].map[o]})}catch{return i}}};for(R in L)n[R+"PathSegment"]=j("pathname",L[R]),n[R+"UrnPathSegment"]=j("urnpath",L[R]);var W=function(e,t,i){return function(o){var c;i?c=function(y){return n[t](n[i](y))}:c=n[t];for(var h=(o+"").split(e),p=0,d=h.length;p-1&&(t.fragment=e.substring(i+1)||null,e=e.substring(0,i)),i=e.indexOf("?"),i>-1&&(t.query=e.substring(i+1)||null,e=e.substring(0,i)),e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),e=e.replace(/^[/\\]{2,}/i,"//"),e.substring(0,2)==="//"?(t.protocol=null,e=e.substring(2),e=n.parseAuthority(e,t)):(i=e.indexOf(":"),i>-1&&(t.protocol=e.substring(0,i)||null,t.protocol&&!t.protocol.match(n.protocol_expression)?t.protocol=void 0:e.substring(i+1,i+3).replace(/\\/g,"/")==="//"?(e=e.substring(i+3),e=n.parseAuthority(e,t)):(e=e.substring(i+1),t.urn=!0))),t.path=e,t},n.parseHost=function(e,t){e||(e=""),e=e.replace(/\\/g,"/");var i=e.indexOf("/"),o,c;if(i===-1&&(i=e.length),e.charAt(0)==="[")o=e.indexOf("]"),t.hostname=e.substring(1,o)||null,t.port=e.substring(o+2,i)||null,t.port==="/"&&(t.port=null);else{var h=e.indexOf(":"),p=e.indexOf("/"),d=e.indexOf(":",h+1);d!==-1&&(p===-1||d-1?c:e.length-1),p;return h>-1&&(c===-1||h-1?z=z.slice(0,S)+z.slice(S).replace(h,""):z=z.replace(h,""),!(z.length<=y[0].length)&&!(i.ignore&&i.ignore.test(z))){A=_+z.length;var Q=t(z,_,A,e);if(Q===void 0){o.lastIndex=A;continue}Q=String(Q),e=e.slice(0,_)+Q+e.slice(A),o.lastIndex=_+Q.length}}return o.lastIndex=0,e},n.ensureValidHostname=function(e,t){var i=!!e,o=!!t,c=!1;if(o&&(c=P(n.hostProtocols,t)),c&&!i)throw new TypeError("Hostname cannot be empty, if protocol is "+t);if(e&&e.match(n.invalid_hostname_characters)){if(!r)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(r.toASCII(e).match(n.invalid_hostname_characters))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_]')}},n.ensureValidPort=function(e){if(e){var t=Number(e);if(!(g(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},n.noConflict=function(e){if(e){var t={URI:this.noConflict()};return u.URITemplate&&typeof u.URITemplate.noConflict=="function"&&(t.URITemplate=u.URITemplate.noConflict()),u.IPv6&&typeof u.IPv6.noConflict=="function"&&(t.IPv6=u.IPv6.noConflict()),u.SecondLevelDomains&&typeof u.SecondLevelDomains.noConflict=="function"&&(t.SecondLevelDomains=u.SecondLevelDomains.noConflict()),t}else u.URI===this&&(u.URI=m);return this},l.build=function(e){return e===!0?this._deferred_build=!0:(e===void 0||this._deferred_build)&&(this._string=n.build(this._parts),this._deferred_build=!1),this},l.clone=function(){return new n(this)},l.valueOf=l.toString=function(){return this.build(!1)._string};function $(e){return function(t,i){return t===void 0?this._parts[e]||"":(this._parts[e]=t||null,this.build(!i),this)}}function V(e,t){return function(i,o){return i===void 0?this._parts[e]||"":(i!==null&&(i=i+"",i.charAt(0)===t&&(i=i.substring(1))),this._parts[e]=i,this.build(!o),this)}}l.protocol=$("protocol"),l.username=$("username"),l.password=$("password"),l.hostname=$("hostname"),l.port=$("port"),l.query=V("query","?"),l.fragment=V("fragment","#"),l.search=function(e,t){var i=this.query(e,t);return typeof i=="string"&&i.length?"?"+i:i},l.hash=function(e,t){var i=this.fragment(e,t);return typeof i=="string"&&i.length?"#"+i:i},l.pathname=function(e,t){if(e===void 0||e===!0){var i=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?n.decodeUrnPath:n.decodePath)(i):i}else return this._parts.urn?this._parts.path=e?n.recodeUrnPath(e):"":this._parts.path=e?n.recodePath(e):"/",this.build(!t),this},l.path=l.pathname,l.href=function(e,t){var i;if(e===void 0)return this.toString();this._string="",this._parts=n._parts();var o=e instanceof n,c=typeof e=="object"&&(e.hostname||e.path||e.pathname);if(e.nodeName){var h=n.getDomAttribute(e);e=e[h]||"",c=!1}if(!o&&c&&e.pathname!==void 0&&(e=e.toString()),typeof e=="string"||e instanceof String)this._parts=n.parse(String(e),this._parts);else if(o||c){var p=o?e._parts:e;for(i in p)i!=="query"&&x.call(this._parts,i)&&(this._parts[i]=p[i]);p.query&&this.query(p.query,!1)}else throw new TypeError("invalid input");return this.build(!t),this},l.is=function(e){var t=!1,i=!1,o=!1,c=!1,h=!1,p=!1,d=!1,y=!this._parts.urn;switch(this._parts.hostname&&(y=!1,i=n.ip4_expression.test(this._parts.hostname),o=n.ip6_expression.test(this._parts.hostname),t=i||o,c=!t,h=c&&a&&a.has(this._parts.hostname),p=c&&n.idn_expression.test(this._parts.hostname),d=c&&n.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return y;case"absolute":return!y;case"domain":case"name":return c;case"sld":return h;case"ip":return t;case"ip4":case"ipv4":case"inet4":return i;case"ip6":case"ipv6":case"inet6":return o;case"idn":return p;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return d}return null};var ie=l.protocol,se=l.port,oe=l.hostname;l.protocol=function(e,t){if(e&&(e=e.replace(/:(\/\/)?$/,""),!e.match(n.protocol_expression)))throw new TypeError('Protocol "'+e+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return ie.call(this,e,t)},l.scheme=l.protocol,l.port=function(e,t){return this._parts.urn?e===void 0?"":this:(e!==void 0&&(e===0&&(e=null),e&&(e+="",e.charAt(0)===":"&&(e=e.substring(1)),n.ensureValidPort(e))),se.call(this,e,t))},l.hostname=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(e!==void 0){var i={preventInvalidHostname:this._parts.preventInvalidHostname},o=n.parseHost(e,i);if(o!=="/")throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=i.hostname,this._parts.preventInvalidHostname&&n.ensureValidHostname(e,this._parts.protocol)}return oe.call(this,e,t)},l.origin=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(e===void 0){var i=this.protocol(),o=this.authority();return o?(i?i+"://":"")+this.authority():""}else{var c=n(e);return this.protocol(c.protocol()).authority(c.authority()).build(!t),this}},l.host=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(e===void 0)return this._parts.hostname?n.buildHost(this._parts):"";var i=n.parseHost(e,this._parts);if(i!=="/")throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},l.authority=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(e===void 0)return this._parts.hostname?n.buildAuthority(this._parts):"";var i=n.parseAuthority(e,this._parts);if(i!=="/")throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},l.userinfo=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(e===void 0){var i=n.buildUserinfo(this._parts);return i&&i.substring(0,i.length-1)}else return e[e.length-1]!=="@"&&(e+="@"),n.parseUserinfo(e,this._parts),this.build(!t),this},l.resource=function(e,t){var i;return e===void 0?this.path()+this.search()+this.hash():(i=n.parse(e),this._parts.path=i.path,this._parts.query=i.query,this._parts.fragment=i.fragment,this.build(!t),this)},l.subdomain=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(e===void 0){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,i)||""}else{var o=this._parts.hostname.length-this.domain().length,c=this._parts.hostname.substring(0,o),h=new RegExp("^"+k(c));if(e&&e.charAt(e.length-1)!=="."&&(e+="."),e.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return e&&n.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(h,e),this.build(!t),this}},l.domain=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(typeof e=="boolean"&&(t=e,e=void 0),e===void 0){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.match(/\./g);if(i&&i.length<2)return this._parts.hostname;var o=this._parts.hostname.length-this.tld(t).length-1;return o=this._parts.hostname.lastIndexOf(".",o-1)+1,this._parts.hostname.substring(o)||""}else{if(!e)throw new TypeError("cannot set domain empty");if(e.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(n.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var c=new RegExp(k(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(c,e)}return this.build(!t),this}},l.tld=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(typeof e=="boolean"&&(t=e,e=void 0),e===void 0){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(i+1);return t!==!0&&a&&a.list[o.toLowerCase()]&&a.get(this._parts.hostname)||o}else{var c;if(e)if(e.match(/[^a-zA-Z0-9-]/))if(a&&a.is(e))c=new RegExp(k(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(c,e);else throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");c=new RegExp(k(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(c,e)}else throw new TypeError("cannot set TLD empty");return this.build(!t),this}},l.directory=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(e===void 0||e===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var i=this._parts.path.length-this.filename().length-1,o=this._parts.path.substring(0,i)||(this._parts.hostname?"/":"");return e?n.decodePath(o):o}else{var c=this._parts.path.length-this.filename().length,h=this._parts.path.substring(0,c),p=new RegExp("^"+k(h));return this.is("relative")||(e||(e="/"),e.charAt(0)!=="/"&&(e="/"+e)),e&&e.charAt(e.length-1)!=="/"&&(e+="/"),e=n.recodePath(e),this._parts.path=this._parts.path.replace(p,e),this.build(!t),this}},l.filename=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(typeof e!="string"){if(!this._parts.path||this._parts.path==="/")return"";var i=this._parts.path.lastIndexOf("/"),o=this._parts.path.substring(i+1);return e?n.decodePathSegment(o):o}else{var c=!1;e.charAt(0)==="/"&&(e=e.substring(1)),e.match(/\.?\//)&&(c=!0);var h=new RegExp(k(this.filename())+"$");return e=n.recodePath(e),this._parts.path=this._parts.path.replace(h,e),c?this.normalizePath(t):this.build(!t),this}},l.suffix=function(e,t){if(this._parts.urn)return e===void 0?"":this;if(e===void 0||e===!0){if(!this._parts.path||this._parts.path==="/")return"";var i=this.filename(),o=i.lastIndexOf("."),c,h;return o===-1?"":(c=i.substring(o+1),h=/^[a-z0-9%]+$/i.test(c)?c:"",e?n.decodePathSegment(h):h)}else{e.charAt(0)==="."&&(e=e.substring(1));var p=this.suffix(),d;if(p)e?d=new RegExp(k(p)+"$"):d=new RegExp(k("."+p)+"$");else{if(!e)return this;this._parts.path+="."+n.recodePath(e)}return d&&(e=n.recodePath(e),this._parts.path=this._parts.path.replace(d,e)),this.build(!t),this}},l.segment=function(e,t,i){var o=this._parts.urn?":":"/",c=this.path(),h=c.substring(0,1)==="/",p=c.split(o);if(e!==void 0&&typeof e!="number"&&(i=t,t=e,e=void 0),e!==void 0&&typeof e!="number")throw new Error('Bad segment "'+e+'", must be 0-based integer');if(h&&p.shift(),e<0&&(e=Math.max(p.length+e,0)),t===void 0)return e===void 0?p:p[e];if(e===null||p[e]===void 0)if(v(t)){p=[];for(var d=0,y=t.length;dN)return 1;if(N>F)return-1}var U=T[T.length-1],L=P[P.length-1];if(U&&L){var R=U.split(".").map(m),j=L.split(".").map(m);for(w=0;wj[w])return 1;if(j[w]>R[w])return-1}}else if(U||L)return U?-1:1;return 0}var l=[">",">=","=","<","<="],x={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};function k(b){if(typeof b!="string")throw new TypeError("Invalid operator type, expected string but got "+typeof b);if(l.indexOf(b)===-1)throw new TypeError("Invalid operator, expected one of "+l.join("|"))}return g.validate=function(b){return typeof b=="string"&&s.test(b)},g.compare=function(b,v,T){k(T);var P=g(b,v);return x[T].indexOf(P)>-1},g})})(Ue);const C={classification:"https://stac-extensions.github.io/classification/v1.1.0/schema.json",datacube:"https://stac-extensions.github.io/datacube/v2.1.0/schema.json",eo:"https://stac-extensions.github.io/eo/v1.0.0/schema.json",file:"https://stac-extensions.github.io/file/v1.0.0/schema.json","item-assets":"https://stac-extensions.github.io/item-assets/v1.0.0/schema.json",label:"https://stac-extensions.github.io/label/v1.0.1/schema.json",pointcloud:"https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json",processing:"https://stac-extensions.github.io/processing/v1.1.0/schema.json",projection:"https://stac-extensions.github.io/projection/v1.0.0/schema.json",raster:"https://stac-extensions.github.io/raster/v1.1.0/schema.json",sar:"https://stac-extensions.github.io/sar/v1.0.0/schema.json",sat:"https://stac-extensions.github.io/sat/v1.0.0/schema.json",scientific:"https://stac-extensions.github.io/scientific/v1.0.0/schema.json",table:"https://stac-extensions.github.io/table/v1.2.0/schema.json",timestamps:"https://stac-extensions.github.io/timestamps/v1.0.0/schema.json",version:"https://stac-extensions.github.io/version/v1.0.0/schema.json",view:"https://stac-extensions.github.io/view/v1.0.0/schema.json"},Y={itemAndCollection:{"cube:":C.datacube,"eo:":C.eo,"file:":C.file,"label:":C.label,"pc:":C.pointcloud,"processing:":C.processing,"proj:":C.projection,"raster:":C.raster,"sar:":C.sar,"sat:":C.sat,"sci:":C.scientific,"view:":C.view,version:C.version,deprecated:C.version,published:C.timestamps,expires:C.timestamps,unpublished:C.timestamps},catalog:{},collection:{item_assets:C["item-assets"]},item:{}};Y.collection=Object.assign(Y.collection,Y.itemAndCollection);Y.item=Object.assign(Y.item,Y.itemAndCollection);function ne(f){let r=f.length>=6,s=f[0],a=f[r?3:2],u=f[1],m=f[r?4:3],n={west:s,east:a,south:u,north:m};return r&&(n.base=f[2],n.height=f[5]),n}function pe(f){let{west:r,east:s,south:a,north:u}=ne(f);return[[[r,u],[r,a],[s,a],[s,u],[r,u]]]}function Be(f){if(!J(f))return null;let r=ne(f),s=[];if(Ie(f)){let a=(r.west+360+r.east)/2;a>180&&(a-=360),s.push(a)}else s.push((r.west+r.east)/2);return s.push((r.south+r.north)/2),typeof r.base<"u"&&s.push((r.base+r.height)/2),s}function qe(f){if(J(f)?f=[f]:Array.isArray(f)&&(f=f.filter(a=>J(a))),!Array.isArray(f)||f.length===0)return null;let r=f.reduce((a,u)=>{if(Ie(u)){let{west:m,east:n,south:g,north:l}=ne(u);a.push(pe([-180,g,n,l])),a.push(pe([m,g,180,l]))}else a.push(pe(u));return a},[]),s=null;if(r.length===1?s={type:"Polygon",coordinates:r[0]}:r.length>1&&(s={type:"MultiPolygon",coordinates:r}),s)return{type:"Feature",geometry:s,properties:{}}}function J(f){if(!Array.isArray(f)||![4,6].includes(f.length)||f.some(m=>typeof m!="number"))return!1;let{west:r,east:s,south:a,north:u}=ne(f);return a<=u&&r>=-180&&r<=180&&a>=-90&&s<=180&&s>=-180&&u<=90}function Ie(f){if(!J(f))return!1;let{west:r,east:s}=ne(f);return r>s}function q(f){return typeof f=="string"&&f.length>0}function B(f){return typeof f=="object"&&f===Object(f)&&!Array.isArray(f)}function ze(...f){if(f=f.filter(r=>Array.isArray(r)),f.length>1){let r=Math.max(...f.map(a=>a.length)),s=[];for(let a=0;au[a])));return s}else if(f.length===1)return f[0];return[]}function De(f){switch(f){case"int8":return-128;case"int16":return-32768;case"int32":return-2147483648}return f.startsWith("u")?0:null}function Me(f){switch(f){case"int8":return 127;case"uint8":return 255;case"int16":return 32767;case"uint16":return 65535;case"int32":return 2147483647;case"uint32":return 4294967295}return null}class ue{constructor(r,s={},a=[]){if(!B(r))throw new Error("Given data is not an object");if(r instanceof ue){for(let u of a)this[u]=r[u];r=r.toJSON()}this._keyMap=s,this._privateKeys=["_keyMap","_privateKeys"].concat(a);for(let u in r)typeof this[u]>"u"&&(u in s?this[u]=s[u](r[u],this):this[u]=r[u])}isItem(){return this.type==="Feature"}isCatalog(){return this.type==="Catalog"}isCatalogLike(){return this.isCatalog()||this.isCollection()}isCollection(){return this.type==="Collection"}isItemCollection(){return this.type==="FeatureCollection"}isCollectionCollection(){return!1}isAsset(){return!1}isLink(){return!1}getObjectType(){}getAbsoluteUrl(){return null}getMetadata(r){return this[r]}toGeoJSON(){return null}getBoundingBox(){return null}getCenter(){return Be(this.getBoundingBox())}getBoundingBoxes(){return[]}toJSON(){let r={};return Object.keys(this).forEach(s=>{if(typeof this[s]=="function"||this._privateKeys.includes(s))return;let a=this[s];if(s in this._keyMap){let u=Array.isArray(a)?[]:{};for(let m in a)u[m]=a[m].toJSON();a=u}r[s]=a}),r}}const He="application/geo+json",Ne=["application/json",He,"text/json"],we=["image/gif","image/jpeg","image/apng","image/png","image/webp"],Se=["image/tiff; application=geotiff; profile=cloud-optimized","image/vnd.stac.geotiff; cloud-optimized=true"],Pe=["application/geotiff","image/tiff; application=geotiff","image/vnd.stac.geotiff"].concat(Se);function ge(f,r,s=!1){return Array.isArray(r)||(r=[r]),s&&typeof f>"u"?!0:typeof f!="string"?!1:(r=r.map(a=>a.toLowerCase()),r.includes(f.toLowerCase()))}function We(f,r=!1){return ge(f,Ne,r)}class je extends ue{constructor(r,s=null,a={},u=[]){super(r,a,["_context"].concat(u)),this._context||(this._context=s)}getAbsoluteUrl(r=!0){return this._context?me(this.href,this._context.getAbsoluteUrl(),r):this.href.includes("://")?this.href:null}getContext(){return this._context}canBrowserDisplayImage(r=!1){if(typeof this.href!="string")return!1;if(!r&&typeof this.type>"u")return!1;let s=new de(this.href),a=s.protocol().toLowerCase(),u=s.suffix().toLowerCase();return q(a)&&!xe.includes(a)?!1:q(this.type)&&we.includes(this.type.toLowerCase())?!0:!!(typeof this.type>"u"&&q(u)&&(u==="jpg"||we.includes("image/"+u)))}isType(r){return q(this.type)&&ge(this.type,r)}isGeoTIFF(){return this.isType(Pe)}isCOG(){return this.isType(Se)}isHTTP(){let s=this.getAbsoluteUrl(!1).protocol().toLowerCase();return q(s)&&xe.includes(s)}}class ye extends je{constructor(r,s=null){super(r,s)}isLink(){return!0}getObjectType(){return"Link"}static fromLinks(r,s=null){return Array.isArray(r)?r.map(a=>B(a)?new ye(a,s):a):[]}}class $e extends ue{constructor(r,s=null,a={},u=[]){if(super(r,Object.assign({links:ye.fromLinks},a),["_url"].concat(u)),!this._url&&(this._url=s,!this._url)){let m=this.getSelfLink();m&&(this._url=m.href)}}getAbsoluteUrl(){return this._url}setAbsoluteUrl(r){this._url=r}getStacLinksWithRel(r,s=!0){return this.getLinksWithRels([r]).filter(a=>We(a.type,s))}getStacLinkWithRel(r,s=!0){const a=this.getStacLinksWithRel(r,s);return a.length>0?a[0]:null}getLinks(){return Array.isArray(this.links)?this.links.filter(r=>B(r)&&q(r.href)):[]}getLinkWithRel(r){return this.getLinks().find(s=>s.rel===r)||null}getLinksWithRels(r){return this.getLinks().filter(s=>r.includes(s.rel))}getLinksWithOtherRels(r){return this.getLinks().filter(s=>!r.includes(s.rel))}getSelfLink(){return this.getStacLinkWithRel("self")}getRootLink(){return this.getStacLinkWithRel("root")}getParentLink(){return this.getStacLinkWithRel("parent")}}class re extends je{constructor(r,s=null,a=null){super(r,a,{},["_key"]),this._key||(this._key=s)}getObjectType(){return"Asset"}isAsset(){return!0}getAbsoluteUrl(r=!0){return this.isDefinition()?null:super.getAbsoluteUrl(r)}getKey(){return this._key}getMetadata(r){if(typeof this[r]<"u")return this[r];if(this._context)return this._context.getMetadata(r)}getBands(){return ze(this["eo:bands"],this["raster:bands"])}findVisualBands(){let r={red:null,green:null,blue:null},s=this.getBands();for(let u in s){let m=parseInt(u,10),n=s[m];B(n)&&q(n.common_name)&&n.common_name in r&&(r[n.common_name]={index:m,band:n})}return Object.values(r).every(u=>u!==null)?r:null}findBand(r,s="name",a=null){Array.isArray(r)||(r=[r]),B(a)||(a=this.getBands());let u=a.findIndex(m=>B(m)&&r.includes(m[s]));return u>=0?{index:u,band:a[u]}:null}getBand(r){return B(r)||r===null?r:this.getBands()[r]||null}getMinMaxValues(r=null){r=this.getBand(r);const s={minimum:null,maximum:null},a=g=>g.minimum!==null&&g.maximum!==null;if(r&&(B(r.statistics)&&(typeof r.statistics.minimum=="number"&&(s.minimum=r.statistics.minimum),typeof r.statistics.maximum=="number"&&(s.maximum=r.statistics.maximum),a(s))||B(r.histogram)&&(typeof r.histogram.min=="number"&&(s.minimum=r.histogram.min),typeof r.histogram.max=="number"&&(s.maximum=r.histogram.max),a(s))))return s;let u=this.getMetadata("classification:classes");if(Array.isArray(u)&&(u.reduce((g,l)=>(g.minimum=Math.min(g.minimum,l.value),g.maximum=Math.max(g.maximum,l.value),g),s),a(s)))return s;let m=this.getMetadata("file:values");if(Array.isArray(m)&&(m.reduce((g,l)=>(g.minimum=Math.min(g.minimum,...l.values),g.maximum=Math.max(g.maximum,...l.values),g),s),a(s)))return s;let n=B(r)&&r.data_type||this.getMetadata("file:data_type");return n&&(s.minimum=De(n),s.maximum=Me(n)),s}getNoDataValues(r=null){r=this.getBand(r);let s=[];if(r&&typeof r.nodata<"u")s.push(r.nodata);else{let a=this.getMetadata("file:nodata");if(typeof a<"u")s=a;else{let u=this.getMetadata("classification:classes");Array.isArray(u)&&(s=u.filter(m=>!!m.nodata).map(m=>m.value))}}return s.map(a=>a==="nan"?NaN:a==="+inf"?1/0:a==="-inf"?-1/0:a)}isDefinition(){return!q(this.href)}isHTTP(){return this.isDefinition()?null:super.isHTTP()}hasRole(r,s=!1){return Array.isArray(r)||(r=[r]),s&&r.includes(this.getKey())?!0:Array.isArray(this.roles)&&!!this.roles.find(a=>r.includes(a))}static fromAssets(r,s=null){let a={};if(B(r))for(let u in r)a[u]=new re(r[u],u,s);return a}}class le extends $e{constructor(r,s=null,a={},u=[]){super(r,s,a,u)}getTemporalExtent(){return null}getTemporalExtents(){return[]}getIcons(r=!0){return this.getLinksWithRels(["icon"]).filter(s=>s.canBrowserDisplayImage(r))}getThumbnails(r=!0,s=null){let a=this.getAssetsWithRoles(["thumbnail","overview"],!0);if(a.length===0&&(a=this.getLinksWithRels(["preview"])),r&&(a=a.filter(u=>u.canBrowserDisplayImage())),s&&a.length>1){let u=m=>Array.isArray(m.roles)&&m.roles.includes(s)||m.getKey()===s;a=a.filter(u).concat(a.filter(m=>!u(m)))}return a}getDefaultGeoTIFF(r=!0,s=!1){return this.rankGeoTIFFs(r,s)[0]?.asset}rankGeoTIFFs(r=!0,s=!1,a=null,u=null){B(a)||(a={data:1,visual:2,thumbnail:2,overview:3});let m=[],n=this.getAssetsByTypes(Pe);r&&(n=n.filter(l=>l.isHTTP()&&(!s||l.isCOG())));let g=Object.entries(a);for(let l of n){let x=0;if(g.length>0){let k=g.filter(([b])=>l.hasRole(b,!0)).map(([,b])=>b);k.length>0&&(x+=Math.max(...k))}!s&&l.isCOG()&&(x+=2),l.findVisualBands()&&(x+=1),typeof u=="function"&&(x+=u(l)),m.push({asset:l,score:x})}return m.sort((l,x)=>x.score-l.score),m}findVisualAssets(){let r={red:null,green:null,blue:null},s=Object.keys(r),a=this.getAssets();for(let m of a){let n=m.getBands();if(n.length!==1)continue;let g=m.findBand(s,"common_name",n);g&&(r[g.band.common_name]=m)}return Object.values(r).every(m=>m!==null)?r:null}getAsset(r){return B(this.assets)&&this.assets[r]||null}getAssets(){return B(this.assets)?Object.values(this.assets):[]}getAssetsWithRoles(r,s=!1){return this.getAssets().filter(a=>a.hasRole(r,s))}getAssetWithRole(r,s=!1){return this.getAssetsWithRoles([r],s)[0]||null}getAssetsByTypes(r){return this.getAssets().filter(s=>ge(s.type,r))}equals(r){return this===r?!0:!(r instanceof le)||this.getObjectType()!==r.getObjectType()?!1:!!(this.id&&this.id===r.id)}}class Ve extends le{constructor(r,s=null,a={},u=[]){super(r,s,a,u)}getObjectType(){return this.type}getSearchLink(r=null){let s=this.getStacLinksWithRel("search");return r?s[0]||null:s.find(a=>a.method===r||!r&&!a.method)||null}getApiCollectionsLink(){return this.getStacLinkWithRel("data")}getApiItemsLink(){return this.getStacLinkWithRel("items")}getChildLinks(){return this.getStacLinksWithRel("child")}getItemLinks(){return this.getStacLinksWithRel("item")}}function te(f){if(q(f)&&f.length>=10)try{let s=f.match(/^(-?\d{1,})-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)(?:\.(\d*))?(?:Z|[+-]00:00)?$/i).slice(1).map(a=>parseInt(a,10));return new Date(Date.UTC(s[0],s[1]-1,s[2],s[3],s[4],s[5],s[6]||0))}catch{return null}return null}function Ge(f,r){return new Date(f.valueOf()+(r-f)/2)}class ke extends Ve{constructor(r,s=null){const a={assets:re.fromAssets,item_assets:re.fromAssets};super(r,s,a)}toGeoJSON(){let r=qe(this.getBoundingBoxes());return r&&(r.id=this.id),r}getBoundingBox(){let r=this.getRawBoundingBoxes();return r.length>0&&J(r[0])?r[0]:null}getBoundingBoxes(){let r=this.getRawBoundingBoxes();return r.length===1&&J(r[0])?r:r.length>1?r.filter((s,a)=>a>0&&J(s)):[]}getRawBoundingBoxes(){let r=this.extent?.spatial?.bbox;return Array.isArray(r)&&r.length>0?r:[]}getTemporalExtent(){return this.getTemporalExtents()[0]||null}getTemporalExtents(){let r=this.extent?.temporal?.interval;return Array.isArray(r)&&r.length>0?r.filter(s=>Array.isArray(s)&&(q(s[0])||q(s[1]))).map(s=>s.map(a=>te(a))):[]}getSummary(r){return this.summaries[r]}getBands(){let r=this.getSummary("eo:bands"),s=this.getSummary("raster:bands"),a=[r,s].filter(u=>Array.isArray(u));return a.length>=2?ze(...a):a.length===1?a[0]:[]}}class Je extends le{constructor(r,s=null){super(r,s,{assets:re.fromAssets})}getObjectType(){return"Item"}toGeoJSON(){return this.toJSON()}getBoundingBox(){return J(this.bbox)?this.bbox:null}getBoundingBoxes(){return J(this.bbox)?[this.bbox]:[]}getDateTime(){let r=te(this.properties.datetime);if(!r){let s=te(this.properties.start_datetime),a=te(this.properties.end_datetime);return s&&a?Ge(s,a):s||a}return r}getTemporalExtent(){return this.getTemporalExtents()[0]||null}getTemporalExtents(){let r=[];return q(this.properties.start_datetime)||q(this.properties.end_datetime)?r=[[this.properties.start_datetime||null,this.properties.end_datetime||null]]:q(this.properties.datetime)&&(r=[[this.properties.datetime,this.properties.datetime]]),r.map(s=>s.map(a=>te(a)))}getMetadata(r){return this.properties[r]}getBands(){let r=this.getMetadata("eo:bands");return Array.isArray(r)?r:[]}getCollectionLink(){return this.getStacLinkWithRel("collection")}}function Ze(f){const r=[];return f.forEach(a=>{if(a.rel==="item"&&"latlng"in a){const[u,m]=a.latlng.split(",").map(n=>Number(n));r.push({type:"Feature",geometry:{type:"Point",coordinates:[m,u]}})}}),{type:"FeatureCollection",crs:{type:"name",properties:{name:"EPSG:4326"}},features:r}}function Ye(f,r){const s=[];return f?.links&&f?.links[1].rel==="item"?s.push(r):f?.links[1].rel==="child"&&f.links.forEach(a=>{a.rel==="child"&&s.push(me(a.href,r))}),s}class et{#t="";#e;selectedItem;constructor(r){this.#t=r}createLayersJson=async(r=null)=>{let s,a,u=[];if(this.#e||(a=await(await Ce.get(this.#t)).data,this.#e=new ke(a)),a&&a.endpointtype==="GeoDB"){const m=Ze(a.links);return u.unshift({type:"Vector",properties:{id:a.id},source:{type:"Vector",url:"data:,"+encodeURIComponent(JSON.stringify(m)),format:"GeoJSON"},style:{"circle-radius":5,"circle-fill-color":"#00417077","circle-stroke-color":"#004170","fill-color":"#00417077","stroke-color":"#004170"}}),u}else if(r instanceof Date?(s=this.getItems()?.sort((n,g)=>{const l=Math.abs(new Date(n.datetime).getTime()-r.getTime()),x=Math.abs(new Date(g.datetime).getTime()-r.getTime());return l-x})[0],this.selectedItem=s):s=r,a=await(await fetch(s?me(s.href,this.#t):this.#t)).json(),s){const n=new Je(a);return this.selectedItem=n,u.unshift(...this.buildJsonArray(n)),u}else{this.#e=new ke(a);const n=this.getItems();return this.selectedItem=n?.[n.length-1],this.selectedItem&&(u=await this.createLayersJson(this.selectedItem)),[]}};buildJsonArray(r){const s=[],a=r.links.find(u=>u.rel==="wms");if(a){let u={type:"Tile",properties:{id:r.id},source:{type:"TileWMS",url:a.href,params:{LAYERS:a["wms:layers"],TILED:!0}}};"wms:dimensions"in a&&(u.source.params.time=a["wms:dimensions"]),s.push(u)}else r.links.find(u=>u.rel==="wmts"||u.rel==="xyz")?s.push({type:"STAC",displayWebMapLink:!0,displayFootprint:!1,data:r,properties:{id:r.id}}):s.push({type:"Vector",source:{type:"Vector",url:"data:,"+encodeURIComponent(JSON.stringify(r.geometry)),format:"GeoJSON"},properties:{id:r.id}});return s}getItems(){return this.#e?.links.filter(r=>r.rel==="item").sort((r,s)=>r.datetimer.rel==="item").sort((r,s)=>r.datetimenew Date(r.datetime))}}export{et as E,Ye as e,me as t}; diff --git a/pr-preview/pr-17/assets/eox-itemfilter-DzNaeUZj.js b/pr-preview/pr-17/assets/eox-itemfilter-B6N0Xfw2.js similarity index 69% rename from pr-preview/pr-17/assets/eox-itemfilter-DzNaeUZj.js rename to pr-preview/pr-17/assets/eox-itemfilter-B6N0Xfw2.js index f6a8db5..10dce4e 100644 --- a/pr-preview/pr-17/assets/eox-itemfilter-DzNaeUZj.js +++ b/pr-preview/pr-17/assets/eox-itemfilter-B6N0Xfw2.js @@ -2,21 +2,21 @@ * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const xr=globalThis,Ai=xr.ShadowRoot&&(xr.ShadyCSS===void 0||xr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rs=Symbol(),xn=new WeakMap;let ra=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==rs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Ai&&t===void 0){const r=e!==void 0&&e.length===1;r&&(t=xn.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&xn.set(e,t))}return t}toString(){return this.cssText}};const ia=t=>new ra(typeof t=="string"?t:t+"",void 0,rs),na=(t,e)=>{if(Ai)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const i=document.createElement("style"),n=xr.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},wn=Ai?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return ia(r)})(t):t;/** + */const wr=globalThis,ki=wr.ShadowRoot&&(wr.ShadyCSS===void 0||wr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ns=Symbol(),$n=new WeakMap;let ia=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==ns)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(ki&&t===void 0){const r=e!==void 0&&e.length===1;r&&(t=$n.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&$n.set(e,t))}return t}toString(){return this.cssText}};const na=t=>new ia(typeof t=="string"?t:t+"",void 0,ns),sa=(t,e)=>{if(ki)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const i=document.createElement("style"),n=wr.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)}},_n=ki?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return na(r)})(t):t;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:sa,defineProperty:oa,getOwnPropertyDescriptor:aa,getOwnPropertyNames:la,getOwnPropertySymbols:ca,getPrototypeOf:ha}=Object,jt=globalThis,$n=jt.trustedTypes,ua=$n?$n.emptyScript:"",_n=jt.reactiveElementPolyfillSupport,Xt=(t,e)=>t,$r={toAttribute(t,e){switch(e){case Boolean:t=t?ua:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},ki=(t,e)=>!sa(t,e),En={attribute:!0,type:String,converter:$r,reflect:!1,hasChanged:ki};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),jt.litPropertyMetadata??(jt.litPropertyMetadata=new WeakMap);class kt extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=En){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&oa(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){const{get:n,set:s}=aa(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get(){return n?.call(this)},set(o){const l=n?.call(this);s.call(this,o),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??En}static _$Ei(){if(this.hasOwnProperty(Xt("elementProperties")))return;const e=ha(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Xt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Xt("properties"))){const r=this.properties,i=[...la(r),...ca(r)];for(const n of i)this.createProperty(n,r[n])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[r,i]of this.elementProperties){const n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)r.unshift(wn(n))}else e!==void 0&&r.push(wn(e));return r}static _$Eu(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return na(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostDisconnected)==null?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EC(e,r){var i;const n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){const o=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:$r).toAttribute(r,n.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,r){var i;const n=this.constructor,s=n._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const o=n.getPropertyOptions(s),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)==null?void 0:i.fromAttribute)!==void 0?o.converter:$r;this._$Em=s,this[s]=l.fromAttribute(r,o.type),this._$Em=null}}requestUpdate(e,r,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??ki)(this[e],r))return;this.P(e,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,r,i){this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[s,o]of n)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$EO)==null||e.forEach(n=>{var s;return(s=n.hostUpdate)==null?void 0:s.call(n)}),this.update(i)):this._$EU()}catch(n){throw r=!1,this._$EU(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(e){}firstUpdated(e){}}kt.elementStyles=[],kt.shadowRootOptions={mode:"open"},kt[Xt("elementProperties")]=new Map,kt[Xt("finalized")]=new Map,_n?.({ReactiveElement:kt}),(jt.reactiveElementVersions??(jt.reactiveElementVersions=[])).push("2.0.4");/** + */const{is:oa,defineProperty:aa,getOwnPropertyDescriptor:la,getOwnPropertyNames:ca,getOwnPropertySymbols:ha,getPrototypeOf:ua}=Object,jt=globalThis,En=jt.trustedTypes,da=En?En.emptyScript:"",Sn=jt.reactiveElementPolyfillSupport,Vt=(t,e)=>t,_r={toAttribute(t,e){switch(e){case Boolean:t=t?da:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Oi=(t,e)=>!oa(t,e),Mn={attribute:!0,type:String,converter:_r,reflect:!1,hasChanged:Oi};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),jt.litPropertyMetadata??(jt.litPropertyMetadata=new WeakMap);class kt extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=Mn){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(e,i,r);n!==void 0&&aa(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){const{get:n,set:s}=la(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get(){return n?.call(this)},set(o){const l=n?.call(this);s.call(this,o),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Mn}static _$Ei(){if(this.hasOwnProperty(Vt("elementProperties")))return;const e=ua(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Vt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Vt("properties"))){const r=this.properties,i=[...ca(r),...ha(r)];for(const n of i)this.createProperty(n,r[n])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[i,n]of r)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[r,i]of this.elementProperties){const n=this._$Eu(r,i);n!==void 0&&this._$Eh.set(n,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)r.unshift(_n(n))}else e!==void 0&&r.push(_n(e));return r}static _$Eu(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return sa(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostDisconnected)==null?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EC(e,r){var i;const n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){const o=(((i=n.converter)==null?void 0:i.toAttribute)!==void 0?n.converter:_r).toAttribute(r,n.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,r){var i;const n=this.constructor,s=n._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const o=n.getPropertyOptions(s),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((i=o.converter)==null?void 0:i.fromAttribute)!==void 0?o.converter:_r;this._$Em=s,this[s]=l.fromAttribute(r,o.type),this._$Em=null}}requestUpdate(e,r,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??Oi)(this[e],r))return;this.P(e,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,r,i){this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[s,o]of n)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$EO)==null||e.forEach(n=>{var s;return(s=n.hostUpdate)==null?void 0:s.call(n)}),this.update(i)):this._$EU()}catch(n){throw r=!1,this._$EU(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(e){}firstUpdated(e){}}kt.elementStyles=[],kt.shadowRootOptions={mode:"open"},kt[Vt("elementProperties")]=new Map,kt[Vt("finalized")]=new Map,Sn?.({ReactiveElement:kt}),(jt.reactiveElementVersions??(jt.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const _r=globalThis,Er=_r.trustedTypes,Sn=Er?Er.createPolicy("lit-html",{createHTML:t=>t}):void 0,Oi="$lit$",Ge=`lit$${(Math.random()+"").slice(9)}$`,Pi="?"+Ge,da=`<${Pi}>`,bt=document,Kt=()=>bt.createComment(""),Jt=t=>t===null||typeof t!="object"&&typeof t!="function",is=Array.isArray,ns=t=>is(t)||typeof t?.[Symbol.iterator]=="function",ci=`[ -\f\r]`,Wt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Mn=/-->/g,An=/>/g,gt=RegExp(`>|${ci}(?:([^\\s"'>=/]+)(${ci}*=${ci}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),kn=/'/g,On=/"/g,ss=/^(?:script|style|textarea|title)$/i,pa=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),F=pa(1),ot=Symbol.for("lit-noChange"),ae=Symbol.for("lit-nothing"),Pn=new WeakMap,vt=bt.createTreeWalker(bt,129);function os(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Sn!==void 0?Sn.createHTML(e):e}const as=(t,e)=>{const r=t.length-1,i=[];let n,s=e===2?"":"",o=Wt;for(let l=0;l"?(o=n??Wt,g=-1):p[1]===void 0?g=-2:(g=o.lastIndex-p[2].length,h=p[1],o=p[3]===void 0?gt:p[3]==='"'?On:kn):o===On||o===kn?o=gt:o===Mn||o===An?o=Wt:(o=gt,n=void 0);const m=o===gt&&t[l+1].startsWith("/>")?" ":"";s+=o===Wt?a+da:g>=0?(i.push(h),a.slice(0,g)+Oi+a.slice(g)+Ge+m):a+Ge+(g===-2?l:m)}return[os(t,s+(t[r]||"")+(e===2?"":"")),i]};class Zt{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0;const l=e.length-1,a=this.parts,[h,p]=as(e,r);if(this.el=Zt.createElement(h,i),vt.currentNode=this.el.content,r===2){const g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(n=vt.nextNode())!==null&&a.length0){n.textContent=Er?Er.emptyScript:"";for(let m=0;m2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ae}_$AI(e,r=this,i,n){const s=this.strings;let o=!1;if(s===void 0)e=xt(this,e,r,0),o=!Jt(e)||e!==this._$AH&&e!==ot,o&&(this._$AH=e);else{const l=e;let a,h;for(e=s[0],a=0;a{const i=r?.renderBefore??e;let n=i._$litPart$;if(n===void 0){const s=r?.renderBefore??null;i._$litPart$=n=new It(e.insertBefore(Kt(),s),s,void 0,r??{})}return n._$AI(t),n};/** + */const Er=globalThis,Sr=Er.trustedTypes,An=Sr?Sr.createPolicy("lit-html",{createHTML:t=>t}):void 0,Pi="$lit$",Qe=`lit$${(Math.random()+"").slice(9)}$`,Li="?"+Qe,pa=`<${Li}>`,bt=document,Jt=()=>bt.createComment(""),Zt=t=>t===null||typeof t!="object"&&typeof t!="function",ss=Array.isArray,os=t=>ss(t)||typeof t?.[Symbol.iterator]=="function",ci=`[ +\f\r]`,Yt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kn=/-->/g,On=/>/g,gt=RegExp(`>|${ci}(?:([^\\s"'>=/]+)(${ci}*=${ci}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Pn=/'/g,Ln=/"/g,as=/^(?:script|style|textarea|title)$/i,fa=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),F=fa(1),ot=Symbol.for("lit-noChange"),ae=Symbol.for("lit-nothing"),Cn=new WeakMap,vt=bt.createTreeWalker(bt,129);function ls(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return An!==void 0?An.createHTML(e):e}const cs=(t,e)=>{const r=t.length-1,i=[];let n,s=e===2?"":"",o=Yt;for(let l=0;l"?(o=n??Yt,g=-1):p[1]===void 0?g=-2:(g=o.lastIndex-p[2].length,h=p[1],o=p[3]===void 0?gt:p[3]==='"'?Ln:Pn):o===Ln||o===Pn?o=gt:o===kn||o===On?o=Yt:(o=gt,n=void 0);const m=o===gt&&t[l+1].startsWith("/>")?" ":"";s+=o===Yt?a+pa:g>=0?(i.push(h),a.slice(0,g)+Pi+a.slice(g)+Qe+m):a+Qe+(g===-2?l:m)}return[ls(t,s+(t[r]||"")+(e===2?"":"")),i]};class Gt{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,o=0;const l=e.length-1,a=this.parts,[h,p]=cs(e,r);if(this.el=Gt.createElement(h,i),vt.currentNode=this.el.content,r===2){const g=this.el.content.firstChild;g.replaceWith(...g.childNodes)}for(;(n=vt.nextNode())!==null&&a.length0){n.textContent=Sr?Sr.emptyScript:"";for(let m=0;m2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ae}_$AI(e,r=this,i,n){const s=this.strings;let o=!1;if(s===void 0)e=xt(this,e,r,0),o=!Zt(e)||e!==this._$AH&&e!==ot,o&&(this._$AH=e);else{const l=e;let a,h;for(e=s[0],a=0;a{const i=r?.renderBefore??e;let n=i._$litPart$;if(n===void 0){const s=r?.renderBefore??null;i._$litPart$=n=new It(e.insertBefore(Jt(),s),s,void 0,r??{})}return n._$AI(t),n};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let _e=class extends kt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ga(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return ot}};var Cn;_e._$litElement$=!0,_e.finalized=!0,(Cn=globalThis.litElementHydrateSupport)==null||Cn.call(globalThis,{LitElement:_e});const Rn=globalThis.litElementPolyfillSupport;Rn?.({LitElement:_e});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/** + */let _e=class extends kt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ya(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return ot}};var jn;_e._$litElement$=!0,_e.finalized=!0,(jn=globalThis.litElementHydrateSupport)==null||jn.call(globalThis,{LitElement:_e});const Tn=globalThis.litElementPolyfillSupport;Tn?.({LitElement:_e});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause @@ -24,7 +24,7 @@ * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const ya={attribute:!0,type:String,converter:$r,reflect:!1,hasChanged:ki},ma=(t=ya,e,r)=>{const{kind:i,metadata:n}=r;let s=globalThis.litPropertyMetadata.get(n);if(s===void 0&&globalThis.litPropertyMetadata.set(n,s=new Map),s.set(r.name,t),i==="accessor"){const{name:o}=r;return{set(l){const a=e.get.call(this);e.set.call(this,l),this.requestUpdate(o,a,t)},init(l){return l!==void 0&&this.P(o,void 0,t),l}}}if(i==="setter"){const{name:o}=r;return function(l){const a=this[o];e.call(this,l),this.requestUpdate(o,a,t)}}throw Error("Unsupported decorator location: "+i)};function G(t){return(e,r)=>typeof r=="object"?ma(t,e,r):((i,n,s)=>{const o=n.hasOwnProperty(s);return n.constructor.createProperty(s,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(n,s):void 0})(t,e,r)}/** + */const ma={attribute:!0,type:String,converter:_r,reflect:!1,hasChanged:Oi},va=(t=ma,e,r)=>{const{kind:i,metadata:n}=r;let s=globalThis.litPropertyMetadata.get(n);if(s===void 0&&globalThis.litPropertyMetadata.set(n,s=new Map),s.set(r.name,t),i==="accessor"){const{name:o}=r;return{set(l){const a=e.get.call(this);e.set.call(this,l),this.requestUpdate(o,a,t)},init(l){return l!==void 0&&this.P(o,void 0,t),l}}}if(i==="setter"){const{name:o}=r;return function(l){const a=this[o];e.call(this,l),this.requestUpdate(o,a,t)}}throw Error("Unsupported decorator location: "+i)};function G(t){return(e,r)=>typeof r=="object"?va(t,e,r):((i,n,s)=>{const o=n.hasOwnProperty(s);return n.constructor.createProperty(s,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(n,s):void 0})(t,e,r)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause @@ -36,27 +36,27 @@ * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function*Vt(t,e){if(t!==void 0){let r=0;for(const i of t)yield e(i,r++)}}/** + */function*Kt(t,e){if(t!==void 0){let r=0;for(const i of t)yield e(i,r++)}}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const ps={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},fs=t=>(...e)=>({_$litDirective$:t,values:e});let gs=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/** + */const gs={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ys=t=>(...e)=>({_$litDirective$:t,values:e});let ms=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{I:va}=fa,jn=()=>document.createComment(""),Yt=(t,e,r)=>{var i;const n=t._$AA.parentNode,s=e===void 0?t._$AB:e._$AA;if(r===void 0){const o=n.insertBefore(jn(),s),l=n.insertBefore(jn(),s);r=new va(o,l,t,t.options)}else{const o=r._$AB.nextSibling,l=r._$AM,a=l!==t;if(a){let h;(i=r._$AQ)==null||i.call(r,t),r._$AM=t,r._$AP!==void 0&&(h=t._$AU)!==l._$AU&&r._$AP(h)}if(o!==s||a){let h=r._$AA;for(;h!==o;){const p=h.nextSibling;n.insertBefore(h,s),h=p}}}return r},yt=(t,e,r=t)=>(t._$AI(e,r),t),ba={},xa=(t,e=ba)=>t._$AH=e,wa=t=>t._$AH,hi=t=>{var e;(e=t._$AP)==null||e.call(t,!1,!0);let r=t._$AA;const i=t._$AB.nextSibling;for(;r!==i;){const n=r.nextSibling;r.remove(),r=n}};/** + */const{I:ba}=ga,Dn=()=>document.createComment(""),Xt=(t,e,r)=>{var i;const n=t._$AA.parentNode,s=e===void 0?t._$AB:e._$AA;if(r===void 0){const o=n.insertBefore(Dn(),s),l=n.insertBefore(Dn(),s);r=new ba(o,l,t,t.options)}else{const o=r._$AB.nextSibling,l=r._$AM,a=l!==t;if(a){let h;(i=r._$AQ)==null||i.call(r,t),r._$AM=t,r._$AP!==void 0&&(h=t._$AU)!==l._$AU&&r._$AP(h)}if(o!==s||a){let h=r._$AA;for(;h!==o;){const p=h.nextSibling;n.insertBefore(h,s),h=p}}}return r},yt=(t,e,r=t)=>(t._$AI(e,r),t),xa={},wa=(t,e=xa)=>t._$AH=e,$a=t=>t._$AH,hi=t=>{var e;(e=t._$AP)==null||e.call(t,!1,!0);let r=t._$AA;const i=t._$AB.nextSibling;for(;r!==i;){const n=r.nextSibling;r.remove(),r=n}};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Tn=(t,e,r)=>{const i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},ys=fs(class extends gs{constructor(t){if(super(t),t.type!==ps.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let i;r===void 0?r=e:e!==void 0&&(i=e);const n=[],s=[];let o=0;for(const l of t)n[o]=i?i(l,o):o,s[o]=r(l,o),o++;return{values:s,keys:n}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,i]){const n=wa(t),{values:s,keys:o}=this.dt(e,r,i);if(!Array.isArray(n))return this.ut=o,s;const l=this.ut??(this.ut=[]),a=[];let h,p,g=0,b=n.length-1,m=0,_=s.length-1;for(;g<=b&&m<=_;)if(n[g]===null)g++;else if(n[b]===null)b--;else if(l[g]===o[m])a[m]=yt(n[g],s[m]),g++,m++;else if(l[b]===o[_])a[_]=yt(n[b],s[_]),b--,_--;else if(l[g]===o[_])a[_]=yt(n[g],s[_]),Yt(t,a[_+1],n[g]),g++,_--;else if(l[b]===o[m])a[m]=yt(n[b],s[m]),Yt(t,n[g],n[b]),b--,m++;else if(h===void 0&&(h=Tn(o,m,_),p=Tn(l,g,b)),h.has(l[g]))if(h.has(l[b])){const k=p.get(o[m]),z=k!==void 0?n[k]:null;if(z===null){const I=Yt(t,n[g]);yt(I,s[m]),a[m]=I}else a[m]=yt(z,s[m]),Yt(t,n[g],z),n[k]=null;m++}else hi(n[b]),b--;else hi(n[g]),g++;for(;m<=_;){const k=Yt(t,a[_+1]);yt(k,s[m]),a[m++]=k}for(;g<=b;){const k=n[g++];k!==null&&hi(k)}return this.ut=o,xa(t,a),ot}});/** + */const Nn=(t,e,r)=>{const i=new Map;for(let n=e;n<=r;n++)i.set(t[n],n);return i},vs=ys(class extends ms{constructor(t){if(super(t),t.type!==gs.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let i;r===void 0?r=e:e!==void 0&&(i=e);const n=[],s=[];let o=0;for(const l of t)n[o]=i?i(l,o):o,s[o]=r(l,o),o++;return{values:s,keys:n}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,i]){const n=$a(t),{values:s,keys:o}=this.dt(e,r,i);if(!Array.isArray(n))return this.ut=o,s;const l=this.ut??(this.ut=[]),a=[];let h,p,g=0,b=n.length-1,m=0,_=s.length-1;for(;g<=b&&m<=_;)if(n[g]===null)g++;else if(n[b]===null)b--;else if(l[g]===o[m])a[m]=yt(n[g],s[m]),g++,m++;else if(l[b]===o[_])a[_]=yt(n[b],s[_]),b--,_--;else if(l[g]===o[_])a[_]=yt(n[g],s[_]),Xt(t,a[_+1],n[g]),g++,_--;else if(l[b]===o[m])a[m]=yt(n[b],s[m]),Xt(t,n[g],n[b]),b--,m++;else if(h===void 0&&(h=Nn(o,m,_),p=Nn(l,g,b)),h.has(l[g]))if(h.has(l[b])){const k=p.get(o[m]),z=k!==void 0?n[k]:null;if(z===null){const I=Xt(t,n[g]);yt(I,s[m]),a[m]=I}else a[m]=yt(z,s[m]),Xt(t,n[g],z),n[k]=null;m++}else hi(n[b]),b--;else hi(n[g]),g++;for(;m<=_;){const k=Xt(t,a[_+1]);yt(k,s[m]),a[m++]=k}for(;g<=b;){const k=n[g++];k!==null&&hi(k)}return this.ut=o,wa(t,a),ot}});/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let pi=class extends gs{constructor(t){if(super(t),this.it=ae,t.type!==ps.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===ae||t==null)return this._t=void 0,this.it=t;if(t===ot)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};pi.directiveName="unsafeHTML",pi.resultType=1;const Dn=fs(pi);/** + */let fi=class extends ms{constructor(t){if(super(t),this.it=ae,t.type!==gs.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===ae||t==null)return this._t=void 0,this.it=t;if(t===ot)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};fi.directiveName="unsafeHTML",fi.resultType=1;const In=ys(fi);/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const ms=Symbol.for(""),$a=t=>{if(t?.r===ms)return t?._$litStatic$},Ot=t=>({_$litStatic$:t,r:ms}),Nn=new Map,_a=t=>(e,...r)=>{const i=r.length;let n,s;const o=[],l=[];let a,h=0,p=!1;for(;h{var t=Object.defineProperty,e=Math.pow,r=(c,d,x)=>d in c?t(c,d,{enumerable:!0,configurable:!0,writable:!0,value:x}):c[d]=x,i=(c,d,x)=>(r(c,typeof d!="symbol"?d+"":d,x),x),n=(c,d)=>` ${d&&d.length>0?d.map(x=>``).join(""):""}
`,s=":host{--width:300px;--height:.25rem;--opacity:.4;--panel-bg:#cbd5e1;--panel-bg-hover:#94a3b8;--panel-bg-fill:#475569;--panel-bg-border-radius:1rem;--pointer-width:1rem;--pointer-height:1rem;--pointer-bg:#fff;--pointer-bg-hover:#dcdcdc;--pointer-bg-focus:#dcdcdc;--pointer-shadow:0 0 2px rgba(0,0,0,0.8);--pointer-shadow-hover:0 0 2px #000;--pointer-shadow-focus:var(--pointer-shadow-hover);--pointer-border:1px solid hsla(0,0%,88%,0.5);--pointer-border-hover:1px solid #94a3b8;--pointer-border-focus:var(--pointer-border-hover);--pointer-border-radius:100%;--animate-onclick:.3s}:host{max-width:100%}.range-slider-box{display:flex;position:relative;flex-direction:column}.range-slider{position:relative;width:var(--width,100%);height:var(--height,0.25rem);touch-action:none;max-width:100%;box-sizing:border-box;cursor:pointer}.row{width:100%;display:flex;align-items:center}.range-slider.disabled{opacity:var(--opacity,0.4);cursor:default}.pointer.disabled{-webkit-filter:brightness(0.8);filter:brightness(0.8);cursor:default}.range-slider *{box-sizing:border-box}.container{position:absolute;width:100%;height:100%}.panel{position:absolute;z-index:10;width:100%;height:100%;background:var(--panel-bg,#2d4373);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;transition:.3s all ease}.panel-fill{background:var(--panel-bg-fill,#000);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;height:100%;position:absolute;z-index:10}.panel:hover{background:var(--panel-bg-hover,#5f79b7)}.disabled .panel:hover{background:var(--panel-bg,#5f79b7)}.pointer{position:absolute;z-index:20;outline:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;box-shadow:var(--pointer-shadow);border:var(--pointer-border);border-radius:var(--pointer-border-radius,100%);-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pointer-width,15px);height:var(--pointer-height,15px);transition:.3s all ease}.pointer-shape:hover{background:var(--pointer-bg-hover,#fff);background-size:contain;border:var(--pointer-border-hover);box-shadow:var(--pointer-shadow-hover)}.disabled .pointer-shape:hover{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.pointer:focus .pointer-shape{background:var(--pointer-bg-focus,#fff);background-size:contain;border:var(--pointer-border-focus);box-shadow:var(--pointer-shadow-focus)}.disabled .pointer:focus .pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.type-vertical .range-slider{--width:.25rem;--height:300px;max-height:100%}.type-vertical .range-slider .pointer{left:50%}.type-vertical .range-slider .panel-fill{width:100%}.type-vertical.range-slider-box{flex-direction:row}.type-vertical .row{flex-direction:column}.animate-on-click .pointer,.animate-on-click .panel-fill{transition:all var(--animate-onclick)}.range-dragging .panel-fill{cursor:move}",o="pointers-overlap",l="pointers-min-distance",a="pointers-max-distance",h="range-dragging",p="data",g="min",b="max",m="step",_="round",k="type",z="theme",I="rtl",f="btt",y="disabled",w="keyboard-disabled",E="mousewheel-disabled",S="slider-width",M="slider-height",L="slider-radius",B="slider-bg",U="slider-bg-hover",T="slider-bg-fill",re="pointer-width",Z="pointer-height",C="pointer-radius",O="pointer-bg",A="pointer-bg-hover",N="pointer-bg-focus",P="pointer-shadow",K="pointer-shadow-hover",W="pointer-shadow-focus",oe="pointer-border",ie="pointer-border-hover",me="pointer-border-focus",ve="animate-onclick",Me="css-links",xe="vertical",Ae="horizontal",Ze=(c,d,x,v,R)=>{let Y=d-c;return Y===0?x:(v-x)*(R-c)/Y+x},$e=c=>!isNaN(parseFloat(c))&&isFinite(c),ne=(c,d)=>$e(c)?Number(c):d,Ie=(c,d)=>d===0?0:Math.round(c/d)*d,dt=(c,d=1/0)=>{if(d===1/0)return c;let x=e(10,d);return Math.round(c*x)/x},pe=c=>c==null?!1:typeof c=="boolean"?c:c.trim().toLowerCase()==="true",no=(c,d)=>{c.dispatchEvent(new CustomEvent("onPointerClicked",{detail:{$pointer:d}}))},so=(c,d)=>{c.dispatchEvent(new CustomEvent("onMouseDown",{detail:{nativeEvent:d}}))},oo=(c,d)=>{c.dispatchEvent(new CustomEvent("onMouseUp",{detail:{nativeEvent:d}}))},ao=(c,d)=>{c.dispatchEvent(new CustomEvent("onKeyDown",{detail:{nativeEvent:d}}))},lo=(c,d)=>{if(!d||d.length<=0)return;let x=d.map(R=>$e(R)?ne(R,R):R),v={values:x||[]};v.value=x[0],v.value0=x[0],v.value1=x[0];for(let R=1;R{let v=0,R,Y,Q,j,D=!1,ee=(V,ue,we,be,fe,ge)=>{let ke=v;we!==void 0&&V>we&&(V=we),ue!==void 0&&VV===d||d.contains(V),H=(V,ue,we,be)=>{R=V,Y=ue,Q=we,j=be},ce=V=>{D=V,d.classList.toggle("disabled",D),D?d.setAttribute("aria-disabled","true"):d.hasAttribute("aria-disabled")&&d.removeAttribute("aria-disabled")},je=(V,ue)=>{ue==null?d.removeAttribute(V):d.setAttribute(V,ue)},Ee=V=>d.getAttribute(V),X=V=>{if(!D){switch(V.key){case"ArrowLeft":{V.preventDefault(),typeof R=="function"&&R(x);break}case"ArrowRight":{V.preventDefault(),typeof Y=="function"&&Y(x);break}case"ArrowUp":{V.preventDefault(),typeof Q=="function"&&Q(x);break}case"ArrowDown":{V.preventDefault(),typeof j=="function"&&j(x);break}}ao(c,V)}},te=()=>{D||no(c,d)};return d.className=`pointer pointer-${x}`,d.addEventListener("keydown",X),d.addEventListener("click",te),{$pointer:d,get percent(){return v},get disabled(){return D},set disabled(V){ce(V)},updatePosition:ee,isClicked:se,setCallbacks:H,setAttr:je,getAttr:Ee,destroy:()=>{d.removeEventListener("keydown",X),d.removeEventListener("click",te),d.remove()}}},co=c=>{if(c==null)return;if(Array.isArray(c))return c;if(c.trim()==="")return;let d=c.split(","),x=[],v=!0;for(let R=0;RNumber(R)):x},ho=(c,d)=>d?d.findIndex(x=>x===c||x.toString().trim()===c.toString().trim()):-1,uo=c=>({updatePosition:(d,x,v,R)=>{if(x.length<=0)return;let Y=x.length===1,Q=x[0],j=x[x.length-1];d===xe?(c.style.removeProperty("width"),c.style.removeProperty("right"),c.style.removeProperty("left"),Y?c.style.height=`${Q}%`:c.style.height=`${Math.abs(Q-j)}%`,R?(c.style.bottom="0%",Y?c.style.top="auto":c.style.top=`${Math.min(100-j,100-Q)}%`):(c.style.bottom="auto",Y?c.style.top="0%":c.style.top=`${Math.min(Q,j)}%`)):(c.style.removeProperty("height"),c.style.removeProperty("top"),c.style.removeProperty("bottom"),Y?c.style.width=`${Q}%`:c.style.width=`${Math.abs(Q-j)}%`,v?(c.style.right="0%",Y?c.style.left="auto":c.style.left=`${Math.min(100-j,100-Q)}%`):(c.style.right="auto",Y?c.style.left="0%":c.style.left=`${Math.min(Q,j)}%`))}}),Ki="--animate-onclick",po="--width",fo="--height",go="--panel-bg-border-radius",yo="--panel-bg",mo="--panel-bg-hover",vo="--panel-bg-fill",bo="--pointer-width",xo="--pointer-height",wo="--pointer-border-radius",$o="--pointer-bg",_o="--pointer-bg-hover",Eo="--pointer-bg-focus",So="--pointer-shadow",Mo="--pointer-shadow-hover",Ao="--pointer-shadow-focus",ko="--pointer-border",Oo="--pointer-border-hover",Po="--pointer-border-focus",or=(c,d,x)=>{let v=new Map;for(let R of c.attributes){let Y=R.nodeName.trim().toLowerCase();if(!d.test(Y))continue;let Q=Y.replace(/\D/g,"").trim(),j=Q===""||Q==="0"||Q==="1"?0:ne(Q,0)-1,D=x&&typeof x=="function"?x(R.value):R.value;v.set(j,D)}return v},Lo=c=>{if(!c)return null;let d=c.getAttribute(Me);if(!d)return null;let x=d.split(";"),v=[];for(let R of x)R.trim()!==""&&v.push(R.trim());return v},Ji=[[po,S,"sliderWidth",null],[fo,M,"sliderHeight",null],[go,L,"sliderRadius",null],[yo,B,"sliderBg",null],[mo,U,"sliderBgHover",null],[vo,T,"sliderBgFill",null],[bo,re,"pointer#Width",/^pointer([0-9]*)-width$/],[xo,Z,"pointer#Height",/^pointer([0-9]*)-height$/],[wo,C,"pointer#Radius",/^pointer([0-9]*)-radius$/],[$o,O,"pointer#Bg",/^pointer([0-9]*)-bg$/],[_o,A,"pointer#BgHover",/^pointer([0-9]*)-bg-hover$/],[Eo,N,"pointer#BgFocus",/^pointer([0-9]*)-bg-focus$/],[So,P,"pointer#Shadow",/^pointer([0-9]*)-shadow$/],[Mo,K,"pointer#ShadowHover",/^pointer([0-9]*)-shadow-hover$/],[Ao,W,"pointer#ShadowFocus",/^pointer([0-9]*)-shadow-focus$/],[ko,oe,"pointer#Border",/^pointer([0-9]*)-border$/],[Oo,ie,"pointer#BorderHover",/^pointer([0-9]*)-border-hover$/],[Po,me,"pointer#BorderFocus",/^pointer([0-9]*)-border-focus$/]],Co=(c,d,x)=>{let v=null,R=[],Y=new Map,Q=(X,te=d)=>{let V=[...te.classList];for(let ue of V)ue.startsWith(X)&&d.classList.remove(ue)},j=()=>{Q("shape");let X=d.querySelectorAll(".pointer");for(let te of X)Q("shape",te)},D=X=>{v=X,Q("theme-"),typeof X=="string"&&d.classList.add(`theme-${X}`)},ee=()=>{if(j(),!(R.length<=0)){d.classList.add("shape",`shape-${R[0]}`);for(let X=1;X{R[X]=te,ee()},H=()=>{j();let X=or(c,/^pointer([0-9]*)-shape$/);if(!(X.size<=0)){for(let te of X){let V=te[0];R[V]=te[1]}ee()}},ce=(X,te)=>`${X}-${te}`,je=(X,te,V)=>{let ue=x[V];if(!ue)return;let we=V===0?d:ue.$pointer;if(te==null){Y.has(ce(X,V))&&Y.delete(ce(X,V)),we.style.removeProperty(X);return}Y.set(ce(X,V),te),we.style.setProperty(X,te)},Ee=(X,te)=>Y.get(ce(X,te));return(()=>{for(let X of Ji){let[te,V,ue,we]=X;if(we){let fe=or(c,we);for(let ge of fe){let ke=ge[0],Oe=ge[1];je(te,Oe,ke)}}else{let fe=c.getAttribute(V);je(te,fe,0)}let be=[];if(ue.indexOf("#")===-1)be.push([ue,0]);else{be.push([ue.replace("#",""),0]),be.push([ue.replace("#","0"),0]),be.push([ue.replace("#","1"),0]);for(let fe=1;fe{je(te,Oe,ke)}})}catch(ge){console.error(ge)}}D(c.getAttribute(z)),H()})(),{setStyle:je,getStyle:Ee,get theme(){return v},set theme(X){D(X)},get pointerShapes(){return R},setPointerShape:se}},Et="animate-on-click",Zi="range-dragging",Ro=(c,d,x,v)=>{let R=[],Y=se=>{for(let H of R)H.update&&typeof H.update=="function"&&H.update(se)},Q=()=>{for(let se of R)se.destroy&&typeof se.destroy=="function"&&se.destroy()},j=(se,H)=>{for(let ce of R)ce.onAttrChange&&typeof ce.onAttrChange=="function"&&ce.onAttrChange(se,H)},D=se=>{if(se.gettersAndSetters){for(let H of se.gettersAndSetters)if(!(!H.name||!H.attributes))try{Object.prototype.hasOwnProperty.call(c,H.name)||Object.defineProperty(c,H.name,H.attributes)}catch(ce){console.error("defineSettersGetters error:",ce)}}},ee=se=>{var H;if(!se.css)return;let ce=(H=c.shadowRoot)==null?void 0:H.querySelector("style");!ce||(ce.innerHTML+=se.css)};return{init:()=>{if(window.tcRangeSliderPlugins)for(let se of window.tcRangeSliderPlugins){let H=se();R.push(H),H.init&&typeof H.init=="function"&&(H.init(c,d,x,v),D(H),ee(H))}},update:Y,onAttrChange:j,destroy:Q}},jo=10,Gi=20,To=(c,d)=>{let x=new Map,v=/^value([0-9]*)$/;for(let j of c.attributes){let D=j.nodeName.trim().toLowerCase();if(!v.test(D))continue;let ee=D.replace("value","").trim(),se=ee===""||ee==="0"||ee==="1"?0:ne(ee,0)-1,H=$e(j.value)?ne(j.value,0):j.value;x.set(se,H)}let R=Math.max(...Array.from(x.keys())),Y=[];Y.push([Ir(c,d,0),x.get(0)]);let Q=d;for(let j=1;j<=R;j++){let D=d.cloneNode(!0);Q.after(D),Q=D,Y.push([Ir(c,D,j),x.get(j)])}return Y},Qi=(c,d,x,v,R,Y,Q)=>{try{Object.defineProperty(c,v,{configurable:!0,get(){if(!d)return;let j=d.pointers[x];if(!j)return;let D=d.getTextValue(j.percent);return $e(D)?ne(D,D):D},set:j=>{d.pointers[x]?d?.setValue(j,x):d?.addPointer(j)}}),Object.defineProperty(c,R,{configurable:!0,get(){var j,D;return(D=(j=d?.pointers[x])==null?void 0:j.getAttr("aria-label"))!=null?D:void 0},set:j=>{!d||d.setAriaLabel(x,j)}}),Object.defineProperty(c,Y,{configurable:!0,get(){var j,D;return(D=(j=d?.styles)==null?void 0:j.pointerShapes[x])!=null?D:null},set:j=>{!d||!d.styles||d.styles.setPointerShape(x,j)}}),Object.defineProperty(c,Q,{configurable:!0,get(){var j;return(j=d?.pointers[x].disabled)!=null?j:!1},set:j=>{if(!d)return;let D=d?.pointers[x];!D||(D.disabled=j)}})}catch(j){console.error(j)}},Do=(c,d)=>{let x=[["value","ariaLabel","pointerShape","pointerDisabled",0],["value0","ariaLabel0","pointerShape0","pointer0Disabled",0],["value1","ariaLabel1","pointerShape1","pointer1Disabled",0]];for(let v=2;v{var v;let R=(v=x.shadowRoot)==null?void 0:v.querySelector(".container");if(R)for(let Y of c)d?R.prepend(Y.$pointer):R.append(Y.$pointer)},No=(c,d)=>{if(!(!d||c.length<=1)){for(let x of c)x.$pointer.style.zIndex=Gi.toString();d.$pointer.style.zIndex=(Gi*2).toString()}},qr=0,Ht=100,St=2,tn="0.3s",Io=(c,d,x)=>{let v=x.map(u=>u[0]),R=null,Y=null,Q=null,j=null,D=qr,ee=Ht,se,H,ce=Ae,je=St,Ee=!1,X=!1,te=!1,V=0,ue=1/0,we=!1,be,fe,ge=!1,ke=!1,Oe=!1,st=tn,rn=[],nn=u=>{ge||(u.preventDefault&&u.preventDefault(),pt(u),window.addEventListener("mousemove",pt),window.addEventListener("mouseup",ar),so(c,u))},ar=u=>{ge||(be=void 0,fe=void 0,window.removeEventListener("mousemove",pt),window.removeEventListener("mouseup",ar),st&&d.classList.add(Et),oo(c,u))},Uo=(u,$)=>{if(v.length<=0)return;if(v.length===1)return v[0].isClicked(u)&&st&&d.classList.remove(Et),v[0];let q=Fo(u);if(we){let le=$,qe=cr(le);qe!==void 0&&(le=Ie(le,qe)),q?(be=le,fe=0,st&&d.classList.remove(Et)):be!==void 0&&(fe=le-be,be=le)}if(!Ho(u)&&!q){for(let le of v)if(!(!le.isClicked(u)||le.disabled))return st&&d.classList.remove(Et),le;for(let le of v)if(R===le)return le}let he=1/0,ye=null;for(let le of v){if(le.disabled)continue;let qe=Math.abs($-le.percent);qev.findIndex(u=>R===u&&!u.disabled),pt=u=>{let $;if(ce===xe){let{height:he,top:ye}=d.getBoundingClientRect(),le=u.type.indexOf("mouse")!==-1?u.clientY:u.touches[0].clientY;$=Math.min(Math.max(0,le-ye),he)*100/he}else{let{width:he,left:ye}=d.getBoundingClientRect(),le=u.type.indexOf("mouse")!==-1?u.clientX:u.touches[0].clientX;$=Math.min(Math.max(0,le-ye),he)*100/he}if((Ee||X)&&($=100-$),R=Uo(u.target,$),R&&No(v,R),we&&v.length>1&&fe!==void 0){let he=v[0],ye=v[v.length-1],le=he.percent+fe<0,qe=ye.percent+fe>100;if(le||qe)return;for(let mr=0;mr{if(ge||document.activeElement!==c||R!=null&&R.disabled)return;u.stopPropagation(),u.preventDefault();let $=u.deltaY<0,q=Ee||X,he=$?!q:q,ye=sn();ye!==-1&&(he?Ft(ye,v[ye].percent):zt(ye,v[ye].percent))},on=u=>{ge||ke||(ce===xe?X?Pe(u,100):Pe(u,0):Ee?zt(u,v[u].percent):Ft(u,v[u].percent))},an=u=>{ge||ke||(ce===xe?X?Pe(u,0):Pe(u,100):Ee?Ft(u,v[u].percent):zt(u,v[u].percent))},ln=u=>{ge||ke||(ce===xe?X?zt(u,v[u].percent):Ft(u,v[u].percent):Ee?Pe(u,100):Pe(u,0))},cn=u=>{ge||ke||(ce===xe?X?Ft(u,v[u].percent):zt(u,v[u].percent):Ee?Pe(u,0):Pe(u,100))},Ho=u=>u.classList.contains("panel"),Fo=u=>u.classList.contains("panel-fill"),Ft=(u,$)=>{if($===void 0)return;let q=cr($);q==null&&(q=1),$-=q,$<0&&($=0),Pe(u,$)},zt=(u,$)=>{if($===void 0)return;let q=cr($);q==null&&(q=1),$+=q,$>100&&($=100),Pe(u,$)},ft=()=>{!j||j.update({percents:hn(),values:un(),$pointers:dn(),min:pn(),max:fn(),data:Hr(),step:Ur(),round:zr(),type:Fr(),textMin:hr(),textMax:ur(),rightToLeft:Xr(),bottomToTop:Vr(),pointersOverlap:Gr(),pointersMinDistance:Wr(),pointersMaxDistance:Yr(),rangeDragging:Qr(),disabled:Kr(),keyboardDisabled:Jr(),mousewheelDisabled:Zr()})},zo=()=>{ft()},Wo=u=>{if(!(te||v.length<=1||ee===D))if(u===0){let $=ue*100/(ee-D);return Math.max(0,v[u+1].percent-$)}else{let $=V*100/(ee-D);return Math.min(v[u-1].percent+$,100)}},Yo=u=>{if(!(te||v.length<=1||ee===D))if(u===v.length-1){let $=ue*100/(ee-D);return Math.min(v[u-1].percent+$,100)}else{let $=V*100/(ee-D);return Math.max(0,v[u+1].percent-$)}},cr=u=>{let $;if(typeof se=="function"){let q=Ze(0,100,D,ee,u);$=se(q,u)}else $=se;if($e($)){let q=ee-D;return $=q===0?0:$*100/q,$}},Mt=u=>{if(u===void 0)return;let $=Ze(0,100,D,ee,u);return H!==void 0?H[Math.round($)]:dt($,je)},hr=()=>H!==void 0?H[D]:D,ur=()=>H!==void 0?H[ee]:ee,Ur=()=>se,Xo=u=>{var $;return u<=0||te?hr():($=Mt(v[u-1].percent))!=null?$:""},Vo=u=>{var $;return v.length<=1||u>=v.length-1||te?ur():($=Mt(v[u+1].percent))!=null?$:""},hn=()=>v.map(u=>u.percent),un=()=>v.map(u=>Mt(u.percent)),dn=()=>v.map(u=>u.$pointer),pn=()=>D,fn=()=>ee,Hr=()=>H,Fr=()=>ce,zr=()=>je,Wr=()=>V,Yr=()=>ue,Ko=u=>rn[u],Xr=()=>Ee,Vr=()=>X,Kr=()=>ge,Jr=()=>ke,Zr=()=>Oe,Gr=()=>te,Qr=()=>we,Pe=(u,$)=>{if($===void 0)return;let q=cr($);q!==void 0&&($=Ie($,q));let he=v[u];if(!he)return;let ye=he.updatePosition($,Wo(u),Yo(u),ce,Ee,X);Y?.updatePosition(ce,v.map(le=>le.percent),Ee,X),ft();for(let le of v){let qe=Mt(le.percent);qe!==void 0&&(le.setAttr("aria-valuenow",qe.toString()),le.setAttr("aria-valuetext",qe.toString()))}Zo(),ye&&lo(c,v.map(le=>Mt(le.percent)))},Fe=()=>{for(let u=0;u{D=H!==void 0?0:ne(u,qr),ee=H!==void 0?H.length-1:ne($,Ht),dr(D),pr(ee)},Zo=()=>{var u,$;for(let q=0;q{D=ne(u,qr),D>ee&&(ee=D+Ht),Fe()},pr=u=>{ee=ne(u,Ht),ee{te=!0;for(let $=0;${let q;H!==void 0?(q=u==null?0:ho(u,H),q===-1&&(q=0)):(q=ne(u,D),qee&&(q=ee));let he=Ze(D,ee,0,100,q);Pe($,he)},gr=u=>{if(u==null){se=void 0;return}if(typeof u=="function"){se=u,Fe();return}if($e(u)){se=ne(u,1);let $=Math.abs(ee-D);se>$&&(se=void 0),Fe();return}se=void 0},ei=u=>{te=u,Fe()},ti=u=>{(!$e(u)||u<0)&&(u=0),V=u},ri=u=>{(!$e(u)||u<0)&&(u=1/0),ue=u},ii=u=>{ge=u,d.classList.toggle("disabled",ge),ge?d.setAttribute("aria-disabled","true"):d.hasAttribute("aria-disabled")&&d.removeAttribute("aria-disabled")},yn=u=>{ke=u},mn=u=>{Oe=u,Oe?document.removeEventListener("wheel",lr):document.addEventListener("wheel",lr,{passive:!1})},ni=u=>{if(u==null){H=void 0;return}if(H=co(u),H===void 0||H.length<=0){H=void 0;return}dr(0),pr(H.length-1),se===void 0&&gr(1)},si=u=>{var $;typeof u=="string"?ce=u.trim().toLowerCase()===xe?xe:Ae:ce=Ae;let q=($=c.shadowRoot)==null?void 0:$.querySelector(".range-slider-box");if(!q)return;q.className=`range-slider-box type-${ce}`,Fe();let he=ce===xe?"vertical":"horizontal";for(let ye of v)ye.setAttr("aria-orientation",he)},oi=u=>{Ee=u,v.length>1&&en(v,Ee,c),Fe(),ft()},ai=u=>{X=u,v.length>1&&en(v,X,c),Fe(),ft()},li=u=>{je=ne(u,St),je<0&&(je=St),ft()},vn=u=>{u==null||u.toString().trim().toLowerCase()==="false"?(st=void 0,d.style.removeProperty(Ki),d.classList.remove(Et)):(st=u.toString(),d.style.setProperty(Ki,st),d.classList.add(Et))},bn=(u,$)=>{let q=v[u];!q||(q.setAttr("aria-label",$),rn[u]=$)},yr=u=>{if(be=void 0,v.length<=1){we=!1,d.classList.remove(Zi);return}we=u,d.classList.toggle(Zi,we)},Go=()=>{ii(pe(c.getAttribute(y))),ke=pe(c.getAttribute(w)),Oe=pe(c.getAttribute(E));let u=or(c,/^pointer([0-9]*)-disabled$/,$=>pe($));for(let $ of u){let q=$[0];!v[q]||(v[q].disabled=$[1])}},Qo=()=>{let u=or(c,/^aria-label([0-9]*)$/);for(let $ of u){let q=$[0];bn(q,$[1])}},ea=u=>{let $=v.length,q=v[$-1].$pointer,he=q.cloneNode(!0);q.after(he);let ye=Ir(c,he,$);return ye.setCallbacks(on,an,ln,cn),v.push(ye),fr(u,$),Fe(),ft(),$},ta=()=>{let u=v.length,$=v[u-1];return $?($.destroy(),v.pop(),v.length<=1&&yr(!1),Fe(),ft(),u-1):-1};return(()=>{var u,$;for(let he of v)he.setCallbacks(on,an,ln,cn);let q=(u=c.shadowRoot)==null?void 0:u.querySelector(".panel-fill");q&&(Y=uo(q)),si(c.getAttribute(k)),oi(pe(c.getAttribute(I))),ai(pe(c.getAttribute(f))),Jo(c.getAttribute(g),c.getAttribute(b)),gr(c.getAttribute(m)),ni(c.getAttribute(p)),gn(x.map(he=>he[1])),ei(pe(c.getAttribute(o))),ti(ne(c.getAttribute(l),0)),ri(ne(c.getAttribute(a),1/0)),yr(pe(c.getAttribute(h))),li(ne(c.getAttribute(_),St)),Go(),Qo(),Q=Co(c,d,v),vn(($=c.getAttribute(ve))!=null?$:tn),d.addEventListener("mousedown",nn),d.addEventListener("mouseup",ar),d.addEventListener("touchmove",pt),d.addEventListener("touchstart",pt),Oe||document.addEventListener("wheel",lr,{passive:!1}),j=Ro(c,zo,{setValues:gn,setMin:dr,setMax:pr,setStep:gr,setPointersOverlap:ei,setPointersMinDistance:ti,setPointersMaxDistance:ri,setDisabled:ii,setType:si,setRightToLeft:oi,setBottomToTop:ai,setRound:li,setKeyboardDisabled:yn,setMousewheelDisabled:mn,setRangeDragging:yr,setData:ni},{getPercents:hn,getValues:un,getPointerElements:dn,getMin:pn,getMax:fn,getStep:Ur,getData:Hr,getType:Fr,getRound:zr,getTextMin:hr,getTextMax:ur,isRightToLeft:Xr,isBottomToTop:Vr,isDisabled:Kr,isKeyboardDisabled:Jr,isMousewheelDisabled:Zr,isPointersOverlap:Gr,isRangeDraggingEnabled:Qr,getPointersMinDistance:Wr,getPointersMaxDistance:Yr}),j.init()})(),{get pointers(){return v},get styles(){return Q},get pluginsManager(){return j},get min(){return hr()},get max(){return ur()},get step(){return Ur()},get pointersOverlap(){return Gr()},set pointersOverlap(u){ei(u)},get pointersMinDistance(){return Wr()},set pointersMinDistance(u){ti(u)},get pointersMaxDistance(){return Yr()},set pointersMaxDistance(u){ri(u)},get disabled(){return Kr()},set disabled(u){ii(u)},get data(){return Hr()},get type(){return Fr()},set type(u){si(u)},get rightToLeft(){return Xr()},set rightToLeft(u){oi(u)},get bottomToTop(){return Vr()},set bottomToTop(u){ai(u)},get round(){return zr()},set round(u){li(u)},get animateOnClick(){return st},set animateOnClick(u){vn(u)},get keyboardDisabled(){return Jr()},set keyboardDisabled(u){yn(u)},get mousewheelDisabled(){return Zr()},set mousewheelDisabled(u){mn(u)},get rangeDragging(){return Qr()},set rangeDragging(u){yr(u)},setMin:dr,setMax:pr,setValue:fr,setStep:gr,setData:ni,getTextValue:Mt,setAriaLabel:bn,getAriaLabel:Ko,addPointer:ea,removePointer:ta,destroy:()=>{d.removeEventListener("mousedown",nn),d.removeEventListener("mouseup",ar),d.removeEventListener("touchmove",pt),d.removeEventListener("touchstart",pt),document.removeEventListener("wheel",lr);for(let u of v)u.destroy();j?.destroy()}}},qo=(c,d,x)=>{let v=Ji.find(([j,D,ee,se])=>D.replace("#","")===d.replace(/\d+/g,""));if(v&&c.styles){let[j,D,ee,se]=v,H=d.replace(/\D/g,"").trim(),ce=H===""||H==="0"||H==="1"?0:ne(H,0)-1;c.styles.setStyle(j,x,ce);return}switch(c&&c.pluginsManager&&c.pluginsManager.onAttrChange(d,x),d){case g:{c.setMin(x);break}case b:{c.setMax(x);break}case m:{c.setStep(x);break}case o:{c.pointersOverlap=pe(x);break}case l:{c.pointersMinDistance=ne(x,0);break}case h:{c.rangeDragging=pe(x);break}case a:{c.pointersMaxDistance=ne(x,1/0);break}case y:{c.disabled=pe(x);break}case w:{c.keyboardDisabled=pe(x);break}case E:{c.mousewheelDisabled=pe(x);break}case p:{c.setData(x);break}case k:{c.type=x;break}case I:{c.rightToLeft=pe(x);break}case f:{c.bottomToTop=pe(x);break}case _:{c.round=ne(x,St);break}case z:{c.styles&&(c.styles.theme=x);break}case ve:{c.animateOnClick=x;break}}let R=null;if(/^value([0-9]*)$/.test(d)&&(R="value"),/^pointer([0-9]*)-disabled$/.test(d)&&(R="pointer-disabled"),/^aria-label([0-9]*)$/.test(d)&&(R="aria-label"),/^pointer([0-9]*)-shape$/.test(d)&&(R="pointer-shape"),!R)return;let Y=d.replace(/\D/g,"").trim(),Q=Y===""||Y==="0"||Y==="1"?0:ne(Y,0)-1;switch(R){case"value":{c.setValue(x,Q);break}case"pointer-disabled":{let j=c?.pointers[Q];if(!j)return;j.disabled=pe(x);break}case"aria-label":{c.setAriaLabel(Q,x);break}case"pointer-shape":{c.styles&&c.styles.setPointerShape(Q,x);break}}},Bo=class extends HTMLElement{constructor(){super(),i(this,"slider"),i(this,"_externalCSSList",[]),i(this,"_observer",null),this.attachShadow({mode:"open"})}set step(c){this.slider&&this.slider.setStep(c)}get step(){var c;return(c=this.slider)==null?void 0:c.step}set disabled(c){this.slider&&(this.slider.disabled=c)}get disabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.disabled)!=null?d:!1}set data(c){var d;(d=this.slider)==null||d.setData(c)}get data(){var c;return(c=this.slider)==null?void 0:c.data}set min(c){var d;(d=this.slider)==null||d.setMin(c)}get min(){var c;return(c=this.slider)==null?void 0:c.min}set max(c){var d;(d=this.slider)==null||d.setMax(c)}get max(){var c;return(c=this.slider)==null?void 0:c.max}set round(c){!this.slider||(this.slider.round=c)}get round(){var c,d;return(d=(c=this.slider)==null?void 0:c.round)!=null?d:St}set type(c){!this.slider||(this.slider.type=c??Ae)}get type(){var c;return((c=this.slider)==null?void 0:c.type)||Ae}set pointersOverlap(c){!this.slider||(this.slider.pointersOverlap=c)}get pointersOverlap(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersOverlap)!=null?d:!1}set pointersMinDistance(c){!this.slider||(this.slider.pointersMinDistance=c)}get pointersMinDistance(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersMinDistance)!=null?d:0}set pointersMaxDistance(c){!this.slider||(this.slider.pointersMaxDistance=c)}get pointersMaxDistance(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersMaxDistance)!=null?d:1/0}set theme(c){!this.slider||!this.slider.styles||(this.slider.styles.theme=c)}get theme(){var c,d,x;return(x=(d=(c=this.slider)==null?void 0:c.styles)==null?void 0:d.theme)!=null?x:null}set rtl(c){!this.slider||(this.slider.rightToLeft=c)}get rtl(){var c,d;return(d=(c=this.slider)==null?void 0:c.rightToLeft)!=null?d:!1}set btt(c){!this.slider||(this.slider.bottomToTop=c)}get btt(){var c,d;return(d=(c=this.slider)==null?void 0:c.bottomToTop)!=null?d:!1}set keyboardDisabled(c){!this.slider||(this.slider.keyboardDisabled=c)}get keyboardDisabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.keyboardDisabled)!=null?d:!1}set mousewheelDisabled(c){!this.slider||(this.slider.mousewheelDisabled=c)}get mousewheelDisabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.mousewheelDisabled)!=null?d:!1}set animateOnClick(c){!this.slider||(this.slider.animateOnClick=c)}get animateOnClick(){var c;return(c=this.slider)==null?void 0:c.animateOnClick}get rangeDragging(){var c,d;return(d=(c=this.slider)==null?void 0:c.rangeDragging)!=null?d:!1}set rangeDragging(c){this.slider&&(this.slider.rangeDragging=pe(c))}get externalCSSList(){return this._externalCSSList}addPointer(c){var d,x;if(!this.slider)return;let v=(x=(d=this.slider)==null?void 0:d.addPointer(c))!=null?x:0;Qi(this,this.slider,v,`value${v+1}`,`ariaLabel${v+1}`,`pointerShape${v+1}`,`pointer${v+1}Disabled`)}removePointer(){var c;!this.slider||(c=this.slider)==null||c.removePointer()}addCSS(c){if(!this.shadowRoot)return;let d=document.createElement("style");d.textContent=c,this.shadowRoot.appendChild(d)}connectedCallback(){var c,d;if(!this.shadowRoot)return;this._externalCSSList=Lo(this),this.shadowRoot.innerHTML=n(s,this._externalCSSList);let x=(c=this.shadowRoot)==null?void 0:c.querySelector(".pointer");if(!x)return;let v=(d=this.shadowRoot)==null?void 0:d.getElementById("range-slider");if(!v)return;let R=To(this,x);this.slider=Io(this,v,R),Do(this,this.slider),this._observer=new MutationObserver(Y=>{Y.forEach(Q=>{var j;if(!this.slider||Q.type!=="attributes")return;let D=Q.attributeName;!D||qo(this.slider,D,(j=this.getAttribute(D))!=null?j:"")})}),this._observer.observe(this,{attributes:!0})}disconnectedCallback(){this._observer&&this._observer.disconnect(),this.slider&&this.slider.destroy()}},Br=Bo;window.tcRangeSlider=Br,customElements.get("toolcool-range-slider")||customElements.define("toolcool-range-slider",Br),customElements.get("tc-range-slider")||customElements.define("tc-range-slider",class extends Br{})})();var Pt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Li(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ci(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var vs={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(Pt,function(){var r=1e3,i=6e4,n=36e5,s="millisecond",o="second",l="minute",a="hour",h="day",p="week",g="month",b="quarter",m="year",_="date",k="Invalid Date",z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(C){var O=["th","st","nd","rd"],A=C%100;return"["+C+(O[(A-20)%10]||O[A]||O[0])+"]"}},y=function(C,O,A){var N=String(C);return!N||N.length>=O?C:""+Array(O+1-N.length).join(A)+C},w={s:y,z:function(C){var O=-C.utcOffset(),A=Math.abs(O),N=Math.floor(A/60),P=A%60;return(O<=0?"+":"-")+y(N,2,"0")+":"+y(P,2,"0")},m:function C(O,A){if(O.date()1)return C(W[0])}else{var oe=O.name;S[oe]=O,P=oe}return!N&&P&&(E=P),P||!N&&E},U=function(C,O){if(L(C))return C.clone();var A=typeof O=="object"?O:{};return A.date=C,A.args=arguments,new re(A)},T=w;T.l=B,T.i=L,T.w=function(C,O){return U(C,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var re=function(){function C(A){this.$L=B(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[M]=!0}var O=C.prototype;return O.parse=function(A){this.$d=function(N){var P=N.date,K=N.utc;if(P===null)return new Date(NaN);if(T.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var W=P.match(z);if(W){var oe=W[2]-1||0,ie=(W[7]||"0").substring(0,3);return K?new Date(Date.UTC(W[1],oe,W[3]||1,W[4]||0,W[5]||0,W[6]||0,ie)):new Date(W[1],oe,W[3]||1,W[4]||0,W[5]||0,W[6]||0,ie)}}return new Date(P)}(A),this.init()},O.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},O.$utils=function(){return T},O.isValid=function(){return this.$d.toString()!==k},O.isSame=function(A,N){var P=U(A);return this.startOf(N)<=P&&P<=this.endOf(N)},O.isAfter=function(A,N){return U(A) `,s={[e]:{...r}};if(this._renderedTemplates.hasOwnProperty(i)){const{slot:l}=this._renderedTemplates[i];this.contains(l)&&this.removeChild(l)}const o=document.createElement("div");return o.slot=i,o.dataset.generated="template",this._renderTemplate(o,this.templates[e],s),this.appendChild(o),this._renderedTemplates[i]={context:s,slot:o},n}getTemplates(){const e={};for(let r=0;r{const s=this.evalInContext(n||this.trimExpression(i),r);return s?typeof s=="object"?JSON.stringify(s):s.toString():""})}get expression(){return this._expression||this.setBindingSyntax("{{","}}"),this._expression}escapeRegex(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}evalInContext(e,r){r={...r};const i=new Function("with(this) { return "+e+";}");let n;try{n=i.call(r)}catch{}return n}trimExpression(e){return e=e.trim(),e.startsWith(this._startExpression)&&e.endsWith(this._endExpression)&&(e=e.substr(this._startExpression.length,e.length-this._startExpression.length-this._endExpression.length),e=e.trim()),e}renderNode(e,r,i){if(e.nodeName==="#text")return e.textContent=this.expandExpressionsAsString(e.textContent,i),e;if(e.nodeName==="TEMPLATE")return e.$parentTemplateContext=i,e;for(let n=0;n{if(t?.r===bs)return t?._$litStatic$},Ot=t=>({_$litStatic$:t,r:bs}),qn=new Map,Ea=t=>(e,...r)=>{const i=r.length;let n,s;const o=[],l=[];let a,h=0,p=!1;for(;h{var t=Object.defineProperty,e=Math.pow,r=(c,d,x)=>d in c?t(c,d,{enumerable:!0,configurable:!0,writable:!0,value:x}):c[d]=x,i=(c,d,x)=>(r(c,typeof d!="symbol"?d+"":d,x),x),n=(c,d)=>` ${d&&d.length>0?d.map(x=>``).join(""):""}
`,s=":host{--width:300px;--height:.25rem;--opacity:.4;--panel-bg:#cbd5e1;--panel-bg-hover:#94a3b8;--panel-bg-fill:#475569;--panel-bg-border-radius:1rem;--pointer-width:1rem;--pointer-height:1rem;--pointer-bg:#fff;--pointer-bg-hover:#dcdcdc;--pointer-bg-focus:#dcdcdc;--pointer-shadow:0 0 2px rgba(0,0,0,0.8);--pointer-shadow-hover:0 0 2px #000;--pointer-shadow-focus:var(--pointer-shadow-hover);--pointer-border:1px solid hsla(0,0%,88%,0.5);--pointer-border-hover:1px solid #94a3b8;--pointer-border-focus:var(--pointer-border-hover);--pointer-border-radius:100%;--animate-onclick:.3s}:host{max-width:100%}.range-slider-box{display:flex;position:relative;flex-direction:column}.range-slider{position:relative;width:var(--width,100%);height:var(--height,0.25rem);touch-action:none;max-width:100%;box-sizing:border-box;cursor:pointer}.row{width:100%;display:flex;align-items:center}.range-slider.disabled{opacity:var(--opacity,0.4);cursor:default}.pointer.disabled{-webkit-filter:brightness(0.8);filter:brightness(0.8);cursor:default}.range-slider *{box-sizing:border-box}.container{position:absolute;width:100%;height:100%}.panel{position:absolute;z-index:10;width:100%;height:100%;background:var(--panel-bg,#2d4373);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;transition:.3s all ease}.panel-fill{background:var(--panel-bg-fill,#000);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;height:100%;position:absolute;z-index:10}.panel:hover{background:var(--panel-bg-hover,#5f79b7)}.disabled .panel:hover{background:var(--panel-bg,#5f79b7)}.pointer{position:absolute;z-index:20;outline:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;box-shadow:var(--pointer-shadow);border:var(--pointer-border);border-radius:var(--pointer-border-radius,100%);-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pointer-width,15px);height:var(--pointer-height,15px);transition:.3s all ease}.pointer-shape:hover{background:var(--pointer-bg-hover,#fff);background-size:contain;border:var(--pointer-border-hover);box-shadow:var(--pointer-shadow-hover)}.disabled .pointer-shape:hover{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.pointer:focus .pointer-shape{background:var(--pointer-bg-focus,#fff);background-size:contain;border:var(--pointer-border-focus);box-shadow:var(--pointer-shadow-focus)}.disabled .pointer:focus .pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.type-vertical .range-slider{--width:.25rem;--height:300px;max-height:100%}.type-vertical .range-slider .pointer{left:50%}.type-vertical .range-slider .panel-fill{width:100%}.type-vertical.range-slider-box{flex-direction:row}.type-vertical .row{flex-direction:column}.animate-on-click .pointer,.animate-on-click .panel-fill{transition:all var(--animate-onclick)}.range-dragging .panel-fill{cursor:move}",o="pointers-overlap",l="pointers-min-distance",a="pointers-max-distance",h="range-dragging",p="data",g="min",b="max",m="step",_="round",k="type",z="theme",I="rtl",f="btt",y="disabled",w="keyboard-disabled",E="mousewheel-disabled",S="slider-width",M="slider-height",L="slider-radius",B="slider-bg",U="slider-bg-hover",T="slider-bg-fill",re="pointer-width",Z="pointer-height",C="pointer-radius",O="pointer-bg",A="pointer-bg-hover",N="pointer-bg-focus",P="pointer-shadow",K="pointer-shadow-hover",W="pointer-shadow-focus",oe="pointer-border",ie="pointer-border-hover",me="pointer-border-focus",ve="animate-onclick",Me="css-links",xe="vertical",Ae="horizontal",Ge=(c,d,x,v,R)=>{let Y=d-c;return Y===0?x:(v-x)*(R-c)/Y+x},$e=c=>!isNaN(parseFloat(c))&&isFinite(c),ne=(c,d)=>$e(c)?Number(c):d,Ne=(c,d)=>d===0?0:Math.round(c/d)*d,dt=(c,d=1/0)=>{if(d===1/0)return c;let x=e(10,d);return Math.round(c*x)/x},pe=c=>c==null?!1:typeof c=="boolean"?c:c.trim().toLowerCase()==="true",so=(c,d)=>{c.dispatchEvent(new CustomEvent("onPointerClicked",{detail:{$pointer:d}}))},oo=(c,d)=>{c.dispatchEvent(new CustomEvent("onMouseDown",{detail:{nativeEvent:d}}))},ao=(c,d)=>{c.dispatchEvent(new CustomEvent("onMouseUp",{detail:{nativeEvent:d}}))},lo=(c,d)=>{c.dispatchEvent(new CustomEvent("onKeyDown",{detail:{nativeEvent:d}}))},co=(c,d)=>{if(!d||d.length<=0)return;let x=d.map(R=>$e(R)?ne(R,R):R),v={values:x||[]};v.value=x[0],v.value0=x[0],v.value1=x[0];for(let R=1;R{let v=0,R,Y,Q,j,D=!1,ee=(V,ue,we,be,fe,ge)=>{let ke=v;we!==void 0&&V>we&&(V=we),ue!==void 0&&VV===d||d.contains(V),H=(V,ue,we,be)=>{R=V,Y=ue,Q=we,j=be},ce=V=>{D=V,d.classList.toggle("disabled",D),D?d.setAttribute("aria-disabled","true"):d.hasAttribute("aria-disabled")&&d.removeAttribute("aria-disabled")},je=(V,ue)=>{ue==null?d.removeAttribute(V):d.setAttribute(V,ue)},Ee=V=>d.getAttribute(V),X=V=>{if(!D){switch(V.key){case"ArrowLeft":{V.preventDefault(),typeof R=="function"&&R(x);break}case"ArrowRight":{V.preventDefault(),typeof Y=="function"&&Y(x);break}case"ArrowUp":{V.preventDefault(),typeof Q=="function"&&Q(x);break}case"ArrowDown":{V.preventDefault(),typeof j=="function"&&j(x);break}}lo(c,V)}},te=()=>{D||so(c,d)};return d.className=`pointer pointer-${x}`,d.addEventListener("keydown",X),d.addEventListener("click",te),{$pointer:d,get percent(){return v},get disabled(){return D},set disabled(V){ce(V)},updatePosition:ee,isClicked:se,setCallbacks:H,setAttr:je,getAttr:Ee,destroy:()=>{d.removeEventListener("keydown",X),d.removeEventListener("click",te),d.remove()}}},ho=c=>{if(c==null)return;if(Array.isArray(c))return c;if(c.trim()==="")return;let d=c.split(","),x=[],v=!0;for(let R=0;RNumber(R)):x},uo=(c,d)=>d?d.findIndex(x=>x===c||x.toString().trim()===c.toString().trim()):-1,po=c=>({updatePosition:(d,x,v,R)=>{if(x.length<=0)return;let Y=x.length===1,Q=x[0],j=x[x.length-1];d===xe?(c.style.removeProperty("width"),c.style.removeProperty("right"),c.style.removeProperty("left"),Y?c.style.height=`${Q}%`:c.style.height=`${Math.abs(Q-j)}%`,R?(c.style.bottom="0%",Y?c.style.top="auto":c.style.top=`${Math.min(100-j,100-Q)}%`):(c.style.bottom="auto",Y?c.style.top="0%":c.style.top=`${Math.min(Q,j)}%`)):(c.style.removeProperty("height"),c.style.removeProperty("top"),c.style.removeProperty("bottom"),Y?c.style.width=`${Q}%`:c.style.width=`${Math.abs(Q-j)}%`,v?(c.style.right="0%",Y?c.style.left="auto":c.style.left=`${Math.min(100-j,100-Q)}%`):(c.style.right="auto",Y?c.style.left="0%":c.style.left=`${Math.min(Q,j)}%`))}}),Zi="--animate-onclick",fo="--width",go="--height",yo="--panel-bg-border-radius",mo="--panel-bg",vo="--panel-bg-hover",bo="--panel-bg-fill",xo="--pointer-width",wo="--pointer-height",$o="--pointer-border-radius",_o="--pointer-bg",Eo="--pointer-bg-hover",So="--pointer-bg-focus",Mo="--pointer-shadow",Ao="--pointer-shadow-hover",ko="--pointer-shadow-focus",Oo="--pointer-border",Po="--pointer-border-hover",Lo="--pointer-border-focus",ar=(c,d,x)=>{let v=new Map;for(let R of c.attributes){let Y=R.nodeName.trim().toLowerCase();if(!d.test(Y))continue;let Q=Y.replace(/\D/g,"").trim(),j=Q===""||Q==="0"||Q==="1"?0:ne(Q,0)-1,D=x&&typeof x=="function"?x(R.value):R.value;v.set(j,D)}return v},Co=c=>{if(!c)return null;let d=c.getAttribute(Me);if(!d)return null;let x=d.split(";"),v=[];for(let R of x)R.trim()!==""&&v.push(R.trim());return v},Gi=[[fo,S,"sliderWidth",null],[go,M,"sliderHeight",null],[yo,L,"sliderRadius",null],[mo,B,"sliderBg",null],[vo,U,"sliderBgHover",null],[bo,T,"sliderBgFill",null],[xo,re,"pointer#Width",/^pointer([0-9]*)-width$/],[wo,Z,"pointer#Height",/^pointer([0-9]*)-height$/],[$o,C,"pointer#Radius",/^pointer([0-9]*)-radius$/],[_o,O,"pointer#Bg",/^pointer([0-9]*)-bg$/],[Eo,A,"pointer#BgHover",/^pointer([0-9]*)-bg-hover$/],[So,N,"pointer#BgFocus",/^pointer([0-9]*)-bg-focus$/],[Mo,P,"pointer#Shadow",/^pointer([0-9]*)-shadow$/],[Ao,K,"pointer#ShadowHover",/^pointer([0-9]*)-shadow-hover$/],[ko,W,"pointer#ShadowFocus",/^pointer([0-9]*)-shadow-focus$/],[Oo,oe,"pointer#Border",/^pointer([0-9]*)-border$/],[Po,ie,"pointer#BorderHover",/^pointer([0-9]*)-border-hover$/],[Lo,me,"pointer#BorderFocus",/^pointer([0-9]*)-border-focus$/]],Ro=(c,d,x)=>{let v=null,R=[],Y=new Map,Q=(X,te=d)=>{let V=[...te.classList];for(let ue of V)ue.startsWith(X)&&d.classList.remove(ue)},j=()=>{Q("shape");let X=d.querySelectorAll(".pointer");for(let te of X)Q("shape",te)},D=X=>{v=X,Q("theme-"),typeof X=="string"&&d.classList.add(`theme-${X}`)},ee=()=>{if(j(),!(R.length<=0)){d.classList.add("shape",`shape-${R[0]}`);for(let X=1;X{R[X]=te,ee()},H=()=>{j();let X=ar(c,/^pointer([0-9]*)-shape$/);if(!(X.size<=0)){for(let te of X){let V=te[0];R[V]=te[1]}ee()}},ce=(X,te)=>`${X}-${te}`,je=(X,te,V)=>{let ue=x[V];if(!ue)return;let we=V===0?d:ue.$pointer;if(te==null){Y.has(ce(X,V))&&Y.delete(ce(X,V)),we.style.removeProperty(X);return}Y.set(ce(X,V),te),we.style.setProperty(X,te)},Ee=(X,te)=>Y.get(ce(X,te));return(()=>{for(let X of Gi){let[te,V,ue,we]=X;if(we){let fe=ar(c,we);for(let ge of fe){let ke=ge[0],Oe=ge[1];je(te,Oe,ke)}}else{let fe=c.getAttribute(V);je(te,fe,0)}let be=[];if(ue.indexOf("#")===-1)be.push([ue,0]);else{be.push([ue.replace("#",""),0]),be.push([ue.replace("#","0"),0]),be.push([ue.replace("#","1"),0]);for(let fe=1;fe{je(te,Oe,ke)}})}catch(ge){console.error(ge)}}D(c.getAttribute(z)),H()})(),{setStyle:je,getStyle:Ee,get theme(){return v},set theme(X){D(X)},get pointerShapes(){return R},setPointerShape:se}},Et="animate-on-click",Qi="range-dragging",jo=(c,d,x,v)=>{let R=[],Y=se=>{for(let H of R)H.update&&typeof H.update=="function"&&H.update(se)},Q=()=>{for(let se of R)se.destroy&&typeof se.destroy=="function"&&se.destroy()},j=(se,H)=>{for(let ce of R)ce.onAttrChange&&typeof ce.onAttrChange=="function"&&ce.onAttrChange(se,H)},D=se=>{if(se.gettersAndSetters){for(let H of se.gettersAndSetters)if(!(!H.name||!H.attributes))try{Object.prototype.hasOwnProperty.call(c,H.name)||Object.defineProperty(c,H.name,H.attributes)}catch(ce){console.error("defineSettersGetters error:",ce)}}},ee=se=>{var H;if(!se.css)return;let ce=(H=c.shadowRoot)==null?void 0:H.querySelector("style");!ce||(ce.innerHTML+=se.css)};return{init:()=>{if(window.tcRangeSliderPlugins)for(let se of window.tcRangeSliderPlugins){let H=se();R.push(H),H.init&&typeof H.init=="function"&&(H.init(c,d,x,v),D(H),ee(H))}},update:Y,onAttrChange:j,destroy:Q}},To=10,en=20,Do=(c,d)=>{let x=new Map,v=/^value([0-9]*)$/;for(let j of c.attributes){let D=j.nodeName.trim().toLowerCase();if(!v.test(D))continue;let ee=D.replace("value","").trim(),se=ee===""||ee==="0"||ee==="1"?0:ne(ee,0)-1,H=$e(j.value)?ne(j.value,0):j.value;x.set(se,H)}let R=Math.max(...Array.from(x.keys())),Y=[];Y.push([Ir(c,d,0),x.get(0)]);let Q=d;for(let j=1;j<=R;j++){let D=d.cloneNode(!0);Q.after(D),Q=D,Y.push([Ir(c,D,j),x.get(j)])}return Y},tn=(c,d,x,v,R,Y,Q)=>{try{Object.defineProperty(c,v,{configurable:!0,get(){if(!d)return;let j=d.pointers[x];if(!j)return;let D=d.getTextValue(j.percent);return $e(D)?ne(D,D):D},set:j=>{d.pointers[x]?d?.setValue(j,x):d?.addPointer(j)}}),Object.defineProperty(c,R,{configurable:!0,get(){var j,D;return(D=(j=d?.pointers[x])==null?void 0:j.getAttr("aria-label"))!=null?D:void 0},set:j=>{!d||d.setAriaLabel(x,j)}}),Object.defineProperty(c,Y,{configurable:!0,get(){var j,D;return(D=(j=d?.styles)==null?void 0:j.pointerShapes[x])!=null?D:null},set:j=>{!d||!d.styles||d.styles.setPointerShape(x,j)}}),Object.defineProperty(c,Q,{configurable:!0,get(){var j;return(j=d?.pointers[x].disabled)!=null?j:!1},set:j=>{if(!d)return;let D=d?.pointers[x];!D||(D.disabled=j)}})}catch(j){console.error(j)}},No=(c,d)=>{let x=[["value","ariaLabel","pointerShape","pointerDisabled",0],["value0","ariaLabel0","pointerShape0","pointer0Disabled",0],["value1","ariaLabel1","pointerShape1","pointer1Disabled",0]];for(let v=2;v{var v;let R=(v=x.shadowRoot)==null?void 0:v.querySelector(".container");if(R)for(let Y of c)d?R.prepend(Y.$pointer):R.append(Y.$pointer)},Io=(c,d)=>{if(!(!d||c.length<=1)){for(let x of c)x.$pointer.style.zIndex=en.toString();d.$pointer.style.zIndex=(en*2).toString()}},qr=0,Ft=100,St=2,nn="0.3s",qo=(c,d,x)=>{let v=x.map(u=>u[0]),R=null,Y=null,Q=null,j=null,D=qr,ee=Ft,se,H,ce=Ae,je=St,Ee=!1,X=!1,te=!1,V=0,ue=1/0,we=!1,be,fe,ge=!1,ke=!1,Oe=!1,st=nn,sn=[],on=u=>{ge||(u.preventDefault&&u.preventDefault(),pt(u),window.addEventListener("mousemove",pt),window.addEventListener("mouseup",lr),oo(c,u))},lr=u=>{ge||(be=void 0,fe=void 0,window.removeEventListener("mousemove",pt),window.removeEventListener("mouseup",lr),st&&d.classList.add(Et),ao(c,u))},Ho=(u,$)=>{if(v.length<=0)return;if(v.length===1)return v[0].isClicked(u)&&st&&d.classList.remove(Et),v[0];let q=zo(u);if(we){let le=$,Ie=hr(le);Ie!==void 0&&(le=Ne(le,Ie)),q?(be=le,fe=0,st&&d.classList.remove(Et)):be!==void 0&&(fe=le-be,be=le)}if(!Fo(u)&&!q){for(let le of v)if(!(!le.isClicked(u)||le.disabled))return st&&d.classList.remove(Et),le;for(let le of v)if(R===le)return le}let he=1/0,ye=null;for(let le of v){if(le.disabled)continue;let Ie=Math.abs($-le.percent);Iev.findIndex(u=>R===u&&!u.disabled),pt=u=>{let $;if(ce===xe){let{height:he,top:ye}=d.getBoundingClientRect(),le=u.type.indexOf("mouse")!==-1?u.clientY:u.touches[0].clientY;$=Math.min(Math.max(0,le-ye),he)*100/he}else{let{width:he,left:ye}=d.getBoundingClientRect(),le=u.type.indexOf("mouse")!==-1?u.clientX:u.touches[0].clientX;$=Math.min(Math.max(0,le-ye),he)*100/he}if((Ee||X)&&($=100-$),R=Ho(u.target,$),R&&Io(v,R),we&&v.length>1&&fe!==void 0){let he=v[0],ye=v[v.length-1],le=he.percent+fe<0,Ie=ye.percent+fe>100;if(le||Ie)return;for(let vr=0;vr{if(ge||document.activeElement!==c||R!=null&&R.disabled)return;u.stopPropagation(),u.preventDefault();let $=u.deltaY<0,q=Ee||X,he=$?!q:q,ye=an();ye!==-1&&(he?zt(ye,v[ye].percent):Wt(ye,v[ye].percent))},ln=u=>{ge||ke||(ce===xe?X?Pe(u,100):Pe(u,0):Ee?Wt(u,v[u].percent):zt(u,v[u].percent))},cn=u=>{ge||ke||(ce===xe?X?Pe(u,0):Pe(u,100):Ee?zt(u,v[u].percent):Wt(u,v[u].percent))},hn=u=>{ge||ke||(ce===xe?X?Wt(u,v[u].percent):zt(u,v[u].percent):Ee?Pe(u,100):Pe(u,0))},un=u=>{ge||ke||(ce===xe?X?zt(u,v[u].percent):Wt(u,v[u].percent):Ee?Pe(u,0):Pe(u,100))},Fo=u=>u.classList.contains("panel"),zo=u=>u.classList.contains("panel-fill"),zt=(u,$)=>{if($===void 0)return;let q=hr($);q==null&&(q=1),$-=q,$<0&&($=0),Pe(u,$)},Wt=(u,$)=>{if($===void 0)return;let q=hr($);q==null&&(q=1),$+=q,$>100&&($=100),Pe(u,$)},ft=()=>{!j||j.update({percents:dn(),values:pn(),$pointers:fn(),min:gn(),max:yn(),data:Hr(),step:Ur(),round:zr(),type:Fr(),textMin:ur(),textMax:dr(),rightToLeft:Xr(),bottomToTop:Vr(),pointersOverlap:Gr(),pointersMinDistance:Wr(),pointersMaxDistance:Yr(),rangeDragging:Qr(),disabled:Kr(),keyboardDisabled:Jr(),mousewheelDisabled:Zr()})},Wo=()=>{ft()},Yo=u=>{if(!(te||v.length<=1||ee===D))if(u===0){let $=ue*100/(ee-D);return Math.max(0,v[u+1].percent-$)}else{let $=V*100/(ee-D);return Math.min(v[u-1].percent+$,100)}},Xo=u=>{if(!(te||v.length<=1||ee===D))if(u===v.length-1){let $=ue*100/(ee-D);return Math.min(v[u-1].percent+$,100)}else{let $=V*100/(ee-D);return Math.max(0,v[u+1].percent-$)}},hr=u=>{let $;if(typeof se=="function"){let q=Ge(0,100,D,ee,u);$=se(q,u)}else $=se;if($e($)){let q=ee-D;return $=q===0?0:$*100/q,$}},Mt=u=>{if(u===void 0)return;let $=Ge(0,100,D,ee,u);return H!==void 0?H[Math.round($)]:dt($,je)},ur=()=>H!==void 0?H[D]:D,dr=()=>H!==void 0?H[ee]:ee,Ur=()=>se,Vo=u=>{var $;return u<=0||te?ur():($=Mt(v[u-1].percent))!=null?$:""},Ko=u=>{var $;return v.length<=1||u>=v.length-1||te?dr():($=Mt(v[u+1].percent))!=null?$:""},dn=()=>v.map(u=>u.percent),pn=()=>v.map(u=>Mt(u.percent)),fn=()=>v.map(u=>u.$pointer),gn=()=>D,yn=()=>ee,Hr=()=>H,Fr=()=>ce,zr=()=>je,Wr=()=>V,Yr=()=>ue,Jo=u=>sn[u],Xr=()=>Ee,Vr=()=>X,Kr=()=>ge,Jr=()=>ke,Zr=()=>Oe,Gr=()=>te,Qr=()=>we,Pe=(u,$)=>{if($===void 0)return;let q=hr($);q!==void 0&&($=Ne($,q));let he=v[u];if(!he)return;let ye=he.updatePosition($,Yo(u),Xo(u),ce,Ee,X);Y?.updatePosition(ce,v.map(le=>le.percent),Ee,X),ft();for(let le of v){let Ie=Mt(le.percent);Ie!==void 0&&(le.setAttr("aria-valuenow",Ie.toString()),le.setAttr("aria-valuetext",Ie.toString()))}Go(),ye&&co(c,v.map(le=>Mt(le.percent)))},Fe=()=>{for(let u=0;u{D=H!==void 0?0:ne(u,qr),ee=H!==void 0?H.length-1:ne($,Ft),pr(D),fr(ee)},Go=()=>{var u,$;for(let q=0;q{D=ne(u,qr),D>ee&&(ee=D+Ft),Fe()},fr=u=>{ee=ne(u,Ft),ee{te=!0;for(let $=0;${let q;H!==void 0?(q=u==null?0:uo(u,H),q===-1&&(q=0)):(q=ne(u,D),qee&&(q=ee));let he=Ge(D,ee,0,100,q);Pe($,he)},yr=u=>{if(u==null){se=void 0;return}if(typeof u=="function"){se=u,Fe();return}if($e(u)){se=ne(u,1);let $=Math.abs(ee-D);se>$&&(se=void 0),Fe();return}se=void 0},ei=u=>{te=u,Fe()},ti=u=>{(!$e(u)||u<0)&&(u=0),V=u},ri=u=>{(!$e(u)||u<0)&&(u=1/0),ue=u},ii=u=>{ge=u,d.classList.toggle("disabled",ge),ge?d.setAttribute("aria-disabled","true"):d.hasAttribute("aria-disabled")&&d.removeAttribute("aria-disabled")},vn=u=>{ke=u},bn=u=>{Oe=u,Oe?document.removeEventListener("wheel",cr):document.addEventListener("wheel",cr,{passive:!1})},ni=u=>{if(u==null){H=void 0;return}if(H=ho(u),H===void 0||H.length<=0){H=void 0;return}pr(0),fr(H.length-1),se===void 0&&yr(1)},si=u=>{var $;typeof u=="string"?ce=u.trim().toLowerCase()===xe?xe:Ae:ce=Ae;let q=($=c.shadowRoot)==null?void 0:$.querySelector(".range-slider-box");if(!q)return;q.className=`range-slider-box type-${ce}`,Fe();let he=ce===xe?"vertical":"horizontal";for(let ye of v)ye.setAttr("aria-orientation",he)},oi=u=>{Ee=u,v.length>1&&rn(v,Ee,c),Fe(),ft()},ai=u=>{X=u,v.length>1&&rn(v,X,c),Fe(),ft()},li=u=>{je=ne(u,St),je<0&&(je=St),ft()},xn=u=>{u==null||u.toString().trim().toLowerCase()==="false"?(st=void 0,d.style.removeProperty(Zi),d.classList.remove(Et)):(st=u.toString(),d.style.setProperty(Zi,st),d.classList.add(Et))},wn=(u,$)=>{let q=v[u];!q||(q.setAttr("aria-label",$),sn[u]=$)},mr=u=>{if(be=void 0,v.length<=1){we=!1,d.classList.remove(Qi);return}we=u,d.classList.toggle(Qi,we)},Qo=()=>{ii(pe(c.getAttribute(y))),ke=pe(c.getAttribute(w)),Oe=pe(c.getAttribute(E));let u=ar(c,/^pointer([0-9]*)-disabled$/,$=>pe($));for(let $ of u){let q=$[0];!v[q]||(v[q].disabled=$[1])}},ea=()=>{let u=ar(c,/^aria-label([0-9]*)$/);for(let $ of u){let q=$[0];wn(q,$[1])}},ta=u=>{let $=v.length,q=v[$-1].$pointer,he=q.cloneNode(!0);q.after(he);let ye=Ir(c,he,$);return ye.setCallbacks(ln,cn,hn,un),v.push(ye),gr(u,$),Fe(),ft(),$},ra=()=>{let u=v.length,$=v[u-1];return $?($.destroy(),v.pop(),v.length<=1&&mr(!1),Fe(),ft(),u-1):-1};return(()=>{var u,$;for(let he of v)he.setCallbacks(ln,cn,hn,un);let q=(u=c.shadowRoot)==null?void 0:u.querySelector(".panel-fill");q&&(Y=po(q)),si(c.getAttribute(k)),oi(pe(c.getAttribute(I))),ai(pe(c.getAttribute(f))),Zo(c.getAttribute(g),c.getAttribute(b)),yr(c.getAttribute(m)),ni(c.getAttribute(p)),mn(x.map(he=>he[1])),ei(pe(c.getAttribute(o))),ti(ne(c.getAttribute(l),0)),ri(ne(c.getAttribute(a),1/0)),mr(pe(c.getAttribute(h))),li(ne(c.getAttribute(_),St)),Qo(),ea(),Q=Ro(c,d,v),xn(($=c.getAttribute(ve))!=null?$:nn),d.addEventListener("mousedown",on),d.addEventListener("mouseup",lr),d.addEventListener("touchmove",pt),d.addEventListener("touchstart",pt),Oe||document.addEventListener("wheel",cr,{passive:!1}),j=jo(c,Wo,{setValues:mn,setMin:pr,setMax:fr,setStep:yr,setPointersOverlap:ei,setPointersMinDistance:ti,setPointersMaxDistance:ri,setDisabled:ii,setType:si,setRightToLeft:oi,setBottomToTop:ai,setRound:li,setKeyboardDisabled:vn,setMousewheelDisabled:bn,setRangeDragging:mr,setData:ni},{getPercents:dn,getValues:pn,getPointerElements:fn,getMin:gn,getMax:yn,getStep:Ur,getData:Hr,getType:Fr,getRound:zr,getTextMin:ur,getTextMax:dr,isRightToLeft:Xr,isBottomToTop:Vr,isDisabled:Kr,isKeyboardDisabled:Jr,isMousewheelDisabled:Zr,isPointersOverlap:Gr,isRangeDraggingEnabled:Qr,getPointersMinDistance:Wr,getPointersMaxDistance:Yr}),j.init()})(),{get pointers(){return v},get styles(){return Q},get pluginsManager(){return j},get min(){return ur()},get max(){return dr()},get step(){return Ur()},get pointersOverlap(){return Gr()},set pointersOverlap(u){ei(u)},get pointersMinDistance(){return Wr()},set pointersMinDistance(u){ti(u)},get pointersMaxDistance(){return Yr()},set pointersMaxDistance(u){ri(u)},get disabled(){return Kr()},set disabled(u){ii(u)},get data(){return Hr()},get type(){return Fr()},set type(u){si(u)},get rightToLeft(){return Xr()},set rightToLeft(u){oi(u)},get bottomToTop(){return Vr()},set bottomToTop(u){ai(u)},get round(){return zr()},set round(u){li(u)},get animateOnClick(){return st},set animateOnClick(u){xn(u)},get keyboardDisabled(){return Jr()},set keyboardDisabled(u){vn(u)},get mousewheelDisabled(){return Zr()},set mousewheelDisabled(u){bn(u)},get rangeDragging(){return Qr()},set rangeDragging(u){mr(u)},setMin:pr,setMax:fr,setValue:gr,setStep:yr,setData:ni,getTextValue:Mt,setAriaLabel:wn,getAriaLabel:Jo,addPointer:ta,removePointer:ra,destroy:()=>{d.removeEventListener("mousedown",on),d.removeEventListener("mouseup",lr),d.removeEventListener("touchmove",pt),d.removeEventListener("touchstart",pt),document.removeEventListener("wheel",cr);for(let u of v)u.destroy();j?.destroy()}}},Bo=(c,d,x)=>{let v=Gi.find(([j,D,ee,se])=>D.replace("#","")===d.replace(/\d+/g,""));if(v&&c.styles){let[j,D,ee,se]=v,H=d.replace(/\D/g,"").trim(),ce=H===""||H==="0"||H==="1"?0:ne(H,0)-1;c.styles.setStyle(j,x,ce);return}switch(c&&c.pluginsManager&&c.pluginsManager.onAttrChange(d,x),d){case g:{c.setMin(x);break}case b:{c.setMax(x);break}case m:{c.setStep(x);break}case o:{c.pointersOverlap=pe(x);break}case l:{c.pointersMinDistance=ne(x,0);break}case h:{c.rangeDragging=pe(x);break}case a:{c.pointersMaxDistance=ne(x,1/0);break}case y:{c.disabled=pe(x);break}case w:{c.keyboardDisabled=pe(x);break}case E:{c.mousewheelDisabled=pe(x);break}case p:{c.setData(x);break}case k:{c.type=x;break}case I:{c.rightToLeft=pe(x);break}case f:{c.bottomToTop=pe(x);break}case _:{c.round=ne(x,St);break}case z:{c.styles&&(c.styles.theme=x);break}case ve:{c.animateOnClick=x;break}}let R=null;if(/^value([0-9]*)$/.test(d)&&(R="value"),/^pointer([0-9]*)-disabled$/.test(d)&&(R="pointer-disabled"),/^aria-label([0-9]*)$/.test(d)&&(R="aria-label"),/^pointer([0-9]*)-shape$/.test(d)&&(R="pointer-shape"),!R)return;let Y=d.replace(/\D/g,"").trim(),Q=Y===""||Y==="0"||Y==="1"?0:ne(Y,0)-1;switch(R){case"value":{c.setValue(x,Q);break}case"pointer-disabled":{let j=c?.pointers[Q];if(!j)return;j.disabled=pe(x);break}case"aria-label":{c.setAriaLabel(Q,x);break}case"pointer-shape":{c.styles&&c.styles.setPointerShape(Q,x);break}}},Uo=class extends HTMLElement{constructor(){super(),i(this,"slider"),i(this,"_externalCSSList",[]),i(this,"_observer",null),this.attachShadow({mode:"open"})}set step(c){this.slider&&this.slider.setStep(c)}get step(){var c;return(c=this.slider)==null?void 0:c.step}set disabled(c){this.slider&&(this.slider.disabled=c)}get disabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.disabled)!=null?d:!1}set data(c){var d;(d=this.slider)==null||d.setData(c)}get data(){var c;return(c=this.slider)==null?void 0:c.data}set min(c){var d;(d=this.slider)==null||d.setMin(c)}get min(){var c;return(c=this.slider)==null?void 0:c.min}set max(c){var d;(d=this.slider)==null||d.setMax(c)}get max(){var c;return(c=this.slider)==null?void 0:c.max}set round(c){!this.slider||(this.slider.round=c)}get round(){var c,d;return(d=(c=this.slider)==null?void 0:c.round)!=null?d:St}set type(c){!this.slider||(this.slider.type=c??Ae)}get type(){var c;return((c=this.slider)==null?void 0:c.type)||Ae}set pointersOverlap(c){!this.slider||(this.slider.pointersOverlap=c)}get pointersOverlap(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersOverlap)!=null?d:!1}set pointersMinDistance(c){!this.slider||(this.slider.pointersMinDistance=c)}get pointersMinDistance(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersMinDistance)!=null?d:0}set pointersMaxDistance(c){!this.slider||(this.slider.pointersMaxDistance=c)}get pointersMaxDistance(){var c,d;return(d=(c=this.slider)==null?void 0:c.pointersMaxDistance)!=null?d:1/0}set theme(c){!this.slider||!this.slider.styles||(this.slider.styles.theme=c)}get theme(){var c,d,x;return(x=(d=(c=this.slider)==null?void 0:c.styles)==null?void 0:d.theme)!=null?x:null}set rtl(c){!this.slider||(this.slider.rightToLeft=c)}get rtl(){var c,d;return(d=(c=this.slider)==null?void 0:c.rightToLeft)!=null?d:!1}set btt(c){!this.slider||(this.slider.bottomToTop=c)}get btt(){var c,d;return(d=(c=this.slider)==null?void 0:c.bottomToTop)!=null?d:!1}set keyboardDisabled(c){!this.slider||(this.slider.keyboardDisabled=c)}get keyboardDisabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.keyboardDisabled)!=null?d:!1}set mousewheelDisabled(c){!this.slider||(this.slider.mousewheelDisabled=c)}get mousewheelDisabled(){var c,d;return(d=(c=this.slider)==null?void 0:c.mousewheelDisabled)!=null?d:!1}set animateOnClick(c){!this.slider||(this.slider.animateOnClick=c)}get animateOnClick(){var c;return(c=this.slider)==null?void 0:c.animateOnClick}get rangeDragging(){var c,d;return(d=(c=this.slider)==null?void 0:c.rangeDragging)!=null?d:!1}set rangeDragging(c){this.slider&&(this.slider.rangeDragging=pe(c))}get externalCSSList(){return this._externalCSSList}addPointer(c){var d,x;if(!this.slider)return;let v=(x=(d=this.slider)==null?void 0:d.addPointer(c))!=null?x:0;tn(this,this.slider,v,`value${v+1}`,`ariaLabel${v+1}`,`pointerShape${v+1}`,`pointer${v+1}Disabled`)}removePointer(){var c;!this.slider||(c=this.slider)==null||c.removePointer()}addCSS(c){if(!this.shadowRoot)return;let d=document.createElement("style");d.textContent=c,this.shadowRoot.appendChild(d)}connectedCallback(){var c,d;if(!this.shadowRoot)return;this._externalCSSList=Co(this),this.shadowRoot.innerHTML=n(s,this._externalCSSList);let x=(c=this.shadowRoot)==null?void 0:c.querySelector(".pointer");if(!x)return;let v=(d=this.shadowRoot)==null?void 0:d.getElementById("range-slider");if(!v)return;let R=Do(this,x);this.slider=qo(this,v,R),No(this,this.slider),this._observer=new MutationObserver(Y=>{Y.forEach(Q=>{var j;if(!this.slider||Q.type!=="attributes")return;let D=Q.attributeName;!D||Bo(this.slider,D,(j=this.getAttribute(D))!=null?j:"")})}),this._observer.observe(this,{attributes:!0})}disconnectedCallback(){this._observer&&this._observer.disconnect(),this.slider&&this.slider.destroy()}},Br=Uo;window.tcRangeSlider=Br,customElements.get("toolcool-range-slider")||customElements.define("toolcool-range-slider",Br),customElements.get("tc-range-slider")||customElements.define("tc-range-slider",class extends Br{})})();var Pt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ci(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ri(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var xs={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(Pt,function(){var r=1e3,i=6e4,n=36e5,s="millisecond",o="second",l="minute",a="hour",h="day",p="week",g="month",b="quarter",m="year",_="date",k="Invalid Date",z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,I=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(C){var O=["th","st","nd","rd"],A=C%100;return"["+C+(O[(A-20)%10]||O[A]||O[0])+"]"}},y=function(C,O,A){var N=String(C);return!N||N.length>=O?C:""+Array(O+1-N.length).join(A)+C},w={s:y,z:function(C){var O=-C.utcOffset(),A=Math.abs(O),N=Math.floor(A/60),P=A%60;return(O<=0?"+":"-")+y(N,2,"0")+":"+y(P,2,"0")},m:function C(O,A){if(O.date()1)return C(W[0])}else{var oe=O.name;S[oe]=O,P=oe}return!N&&P&&(E=P),P||!N&&E},U=function(C,O){if(L(C))return C.clone();var A=typeof O=="object"?O:{};return A.date=C,A.args=arguments,new re(A)},T=w;T.l=B,T.i=L,T.w=function(C,O){return U(C,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var re=function(){function C(A){this.$L=B(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[M]=!0}var O=C.prototype;return O.parse=function(A){this.$d=function(N){var P=N.date,K=N.utc;if(P===null)return new Date(NaN);if(T.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var W=P.match(z);if(W){var oe=W[2]-1||0,ie=(W[7]||"0").substring(0,3);return K?new Date(Date.UTC(W[1],oe,W[3]||1,W[4]||0,W[5]||0,W[6]||0,ie)):new Date(W[1],oe,W[3]||1,W[4]||0,W[5]||0,W[6]||0,ie)}}return new Date(P)}(A),this.init()},O.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},O.$utils=function(){return T},O.isValid=function(){return this.$d.toString()!==k},O.isSame=function(A,N){var P=U(A);return this.startOf(N)<=P&&P<=this.endOf(N)},O.isAfter=function(A,N){return U(A) `,s={[e]:{...r}};if(this._renderedTemplates.hasOwnProperty(i)){const{slot:l}=this._renderedTemplates[i];this.contains(l)&&this.removeChild(l)}const o=document.createElement("div");return o.slot=i,o.dataset.generated="template",this._renderTemplate(o,this.templates[e],s),this.appendChild(o),this._renderedTemplates[i]={context:s,slot:o},n}getTemplates(){const e={};for(let r=0;r{const s=this.evalInContext(n||this.trimExpression(i),r);return s?typeof s=="object"?JSON.stringify(s):s.toString():""})}get expression(){return this._expression||this.setBindingSyntax("{{","}}"),this._expression}escapeRegex(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}evalInContext(e,r){r={...r};const i=new Function("with(this) { return "+e+";}");let n;try{n=i.call(r)}catch{}return n}trimExpression(e){return e=e.trim(),e.startsWith(this._startExpression)&&e.endsWith(this._endExpression)&&(e=e.substr(this._startExpression.length,e.length-this._startExpression.length-this._endExpression.length),e=e.trim()),e}renderNode(e,r,i){if(e.nodeName==="#text")return e.textContent=this.expandExpressionsAsString(e.textContent,i),e;if(e.nodeName==="TEMPLATE")return e.$parentTemplateContext=i,e;for(let n=0;n{for(var n=i>1?void 0:i?Pa(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&Oa(e,r,n),n};let Sr=class extends _e{handleDetailsToggle(t){this.dispatchEvent(new CustomEvent("details-toggled",{detail:t,bubbles:!0,composed:!0}))}_resetFilter(){this.querySelector("[slot='filter']").reset()}render(){return F` + `;var Pa=Object.defineProperty,La=Object.getOwnPropertyDescriptor,Ni=(t,e,r,i)=>{for(var n=i>1?void 0:i?La(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&Pa(e,r,n),n};let Mr=class extends _e{handleDetailsToggle(t){this.dispatchEvent(new CustomEvent("details-toggled",{detail:t,bubbles:!0,composed:!0}))}_resetFilter(){this.querySelector("[slot='filter']").reset()}render(){return F`
- `}};Di([G({attribute:!1})],Sr.prototype,"filterObject",2);Di([G()],Sr.prototype,"unstyled",2);Sr=Di([Re("eox-itemfilter-expandcontainer")],Sr);const qt=t=>{if(!t.dirty)return null;switch(t.type){case"multiselect":for(const e in t.state)t.state[e]=!1;break;case"range":t.state.min=t.min,t.state.max=t.max;break;case"select":for(const e in t.state)t.state[e]=!1;break;case"spatial":t.state.geometry=void 0;break;case"text":t.keys.forEach(e=>{t.state[e]=void 0});break}return delete t.stringifiedState,delete t.dirty,t},fi=Math.min,Ct=Math.max,Mr=Math.round,vr=Math.floor,at=t=>({x:t,y:t});function bs(t){return t.split("-")[0]}function La(t){return t.split("-")[1]}function Ca(t){return t==="x"?"y":"x"}function Ra(t){return t==="y"?"height":"width"}function xs(t){return["top","bottom"].includes(bs(t))?"y":"x"}function ja(t){return Ca(xs(t))}function ws(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function In(t,e,r){let{reference:i,floating:n}=t;const s=xs(e),o=ja(e),l=Ra(o),a=bs(e),h=s==="y",p=i.x+i.width/2-n.width/2,g=i.y+i.height/2-n.height/2,b=i[l]/2-n[l]/2;let m;switch(a){case"top":m={x:p,y:i.y-n.height};break;case"bottom":m={x:p,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:g};break;case"left":m={x:i.x-n.width,y:g};break;default:m={x:i.x,y:i.y}}switch(La(e)){case"start":m[o]-=b*(r&&h?-1:1);break;case"end":m[o]+=b*(r&&h?-1:1);break}return m}const Ta=async(t,e,r)=>{const{placement:i="bottom",strategy:n="absolute",middleware:s=[],platform:o}=r,l=s.filter(Boolean),a=await(o.isRTL==null?void 0:o.isRTL(e));let h=await o.getElementRects({reference:t,floating:e,strategy:n}),{x:p,y:g}=In(h,i,a),b=i,m={},_=0;for(let k=0;k"u"?!1:t instanceof ShadowRoot||t instanceof Ce(t).ShadowRoot}function nr(t){const{overflow:e,overflowX:r,overflowY:i,display:n}=De(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+r)&&!["inline","contents"].includes(n)}function Da(t){return["table","td","th"].includes(lt(t))}function Ni(t){const e=Ii(),r=De(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(r.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(r.contain||"").includes(i))}function Na(t){let e=Tt(t);for(;Xe(e)&&!Cr(e);){if(Ni(e))return e;e=Tt(e)}return null}function Ii(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Cr(t){return["html","body","#document"].includes(lt(t))}function De(t){return Ce(t).getComputedStyle(t)}function Rr(t){return Qe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Tt(t){if(lt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||qn(t)&&t.host||it(t);return qn(e)?e.host:e}function _s(t){const e=Tt(t);return Cr(e)?t.ownerDocument?t.ownerDocument.body:t.body:Xe(e)&&nr(e)?e:_s(e)}function Gt(t,e,r){var i;e===void 0&&(e=[]),r===void 0&&(r=!0);const n=_s(t),s=n===((i=t.ownerDocument)==null?void 0:i.body),o=Ce(n);return s?e.concat(o,o.visualViewport||[],nr(n)?n:[],o.frameElement&&r?Gt(o.frameElement):[]):e.concat(n,Gt(n,[],r))}function Es(t){const e=De(t);let r=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const n=Xe(t),s=n?t.offsetWidth:r,o=n?t.offsetHeight:i,l=Mr(r)!==s||Mr(i)!==o;return l&&(r=s,i=o),{width:r,height:i,$:l}}function qi(t){return Qe(t)?t:t.contextElement}function Rt(t){const e=qi(t);if(!Xe(e))return at(1);const r=e.getBoundingClientRect(),{width:i,height:n,$:s}=Es(e);let o=(s?Mr(r.width):r.width)/i,l=(s?Mr(r.height):r.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Ia=at(0);function Ss(t){const e=Ce(t);return!Ii()||!e.visualViewport?Ia:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qa(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Ce(t)?!1:e}function wt(t,e,r,i){e===void 0&&(e=!1),r===void 0&&(r=!1);const n=t.getBoundingClientRect(),s=qi(t);let o=at(1);e&&(i?Qe(i)&&(o=Rt(i)):o=Rt(t));const l=qa(s,r,i)?Ss(s):at(0);let a=(n.left+l.x)/o.x,h=(n.top+l.y)/o.y,p=n.width/o.x,g=n.height/o.y;if(s){const b=Ce(s),m=i&&Qe(i)?Ce(i):i;let _=b,k=_.frameElement;for(;k&&i&&m!==_;){const z=Rt(k),I=k.getBoundingClientRect(),f=De(k),y=I.left+(k.clientLeft+parseFloat(f.paddingLeft))*z.x,w=I.top+(k.clientTop+parseFloat(f.paddingTop))*z.y;a*=z.x,h*=z.y,p*=z.x,g*=z.y,a+=y,h+=w,_=Ce(k),k=_.frameElement}}return ws({width:p,height:g,x:a,y:h})}const Ba=[":popover-open",":modal"];function Ms(t){return Ba.some(e=>{try{return t.matches(e)}catch{return!1}})}function Ua(t){let{elements:e,rect:r,offsetParent:i,strategy:n}=t;const s=n==="fixed",o=it(i),l=e?Ms(e.floating):!1;if(i===o||l&&s)return r;let a={scrollLeft:0,scrollTop:0},h=at(1);const p=at(0),g=Xe(i);if((g||!g&&!s)&&((lt(i)!=="body"||nr(o))&&(a=Rr(i)),Xe(i))){const b=wt(i);h=Rt(i),p.x=b.x+i.clientLeft,p.y=b.y+i.clientTop}return{width:r.width*h.x,height:r.height*h.y,x:r.x*h.x-a.scrollLeft*h.x+p.x,y:r.y*h.y-a.scrollTop*h.y+p.y}}function Ha(t){return Array.from(t.getClientRects())}function As(t){return wt(it(t)).left+Rr(t).scrollLeft}function Fa(t){const e=it(t),r=Rr(t),i=t.ownerDocument.body,n=Ct(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=Ct(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-r.scrollLeft+As(t);const l=-r.scrollTop;return De(i).direction==="rtl"&&(o+=Ct(e.clientWidth,i.clientWidth)-n),{width:n,height:s,x:o,y:l}}function za(t,e){const r=Ce(t),i=it(t),n=r.visualViewport;let s=i.clientWidth,o=i.clientHeight,l=0,a=0;if(n){s=n.width,o=n.height;const h=Ii();(!h||h&&e==="fixed")&&(l=n.offsetLeft,a=n.offsetTop)}return{width:s,height:o,x:l,y:a}}function Wa(t,e){const r=wt(t,!0,e==="fixed"),i=r.top+t.clientTop,n=r.left+t.clientLeft,s=Xe(t)?Rt(t):at(1),o=t.clientWidth*s.x,l=t.clientHeight*s.y,a=n*s.x,h=i*s.y;return{width:o,height:l,x:a,y:h}}function Bn(t,e,r){let i;if(e==="viewport")i=za(t,r);else if(e==="document")i=Fa(it(t));else if(Qe(e))i=Wa(e,r);else{const n=Ss(t);i={...e,x:e.x-n.x,y:e.y-n.y}}return ws(i)}function ks(t,e){const r=Tt(t);return r===e||!Qe(r)||Cr(r)?!1:De(r).position==="fixed"||ks(r,e)}function Ya(t,e){const r=e.get(t);if(r)return r;let i=Gt(t,[],!1).filter(l=>Qe(l)&<(l)!=="body"),n=null;const s=De(t).position==="fixed";let o=s?Tt(t):t;for(;Qe(o)&&!Cr(o);){const l=De(o),a=Ni(o);!a&&l.position==="fixed"&&(n=null),(s?!a&&!n:!a&&l.position==="static"&&n&&["absolute","fixed"].includes(n.position)||nr(o)&&!a&&ks(t,o))?i=i.filter(h=>h!==o):n=l,o=Tt(o)}return e.set(t,i),i}function Xa(t){let{element:e,boundary:r,rootBoundary:i,strategy:n}=t;const s=[...r==="clippingAncestors"?Ya(e,this._c):[].concat(r),i],o=s[0],l=s.reduce((a,h)=>{const p=Bn(e,h,n);return a.top=Ct(p.top,a.top),a.right=fi(p.right,a.right),a.bottom=fi(p.bottom,a.bottom),a.left=Ct(p.left,a.left),a},Bn(e,o,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Va(t){const{width:e,height:r}=Es(t);return{width:e,height:r}}function Ka(t,e,r){const i=Xe(e),n=it(e),s=r==="fixed",o=wt(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const a=at(0);if(i||!i&&!s)if((lt(e)!=="body"||nr(n))&&(l=Rr(e)),i){const g=wt(e,!0,s,e);a.x=g.x+e.clientLeft,a.y=g.y+e.clientTop}else n&&(a.x=As(n));const h=o.left+l.scrollLeft-a.x,p=o.top+l.scrollTop-a.y;return{x:h,y:p,width:o.width,height:o.height}}function Un(t,e){return!Xe(t)||De(t).position==="fixed"?null:e?e(t):t.offsetParent}function Os(t,e){const r=Ce(t);if(!Xe(t)||Ms(t))return r;let i=Un(t,e);for(;i&&Da(i)&&De(i).position==="static";)i=Un(i,e);return i&&(lt(i)==="html"||lt(i)==="body"&&De(i).position==="static"&&!Ni(i))?r:i||Na(t)||r}const Ja=async function(t){const e=this.getOffsetParent||Os,r=this.getDimensions;return{reference:Ka(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await r(t.floating)}}};function Za(t){return De(t).direction==="rtl"}const Ga={convertOffsetParentRelativeRectToViewportRelativeRect:Ua,getDocumentElement:it,getClippingRect:Xa,getOffsetParent:Os,getElementRects:Ja,getClientRects:Ha,getDimensions:Va,getScale:Rt,isElement:Qe,isRTL:Za};function Qa(t,e){let r=null,i;const n=it(t);function s(){var l;clearTimeout(i),(l=r)==null||l.disconnect(),r=null}function o(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();const{left:h,top:p,width:g,height:b}=t.getBoundingClientRect();if(l||e(),!g||!b)return;const m=vr(p),_=vr(n.clientWidth-(h+g)),k=vr(n.clientHeight-(p+b)),z=vr(h),I={rootMargin:-m+"px "+-_+"px "+-k+"px "+-z+"px",threshold:Ct(0,fi(1,a))||1};let f=!0;function y(w){const E=w[0].intersectionRatio;if(E!==a){if(!f)return o();E?o(!1,E):i=setTimeout(()=>{o(!1,1e-7)},100)}f=!1}try{r=new IntersectionObserver(y,{...I,root:n.ownerDocument})}catch{r=new IntersectionObserver(y,I)}r.observe(t)}return o(!0),s}function el(t,e,r,i){i===void 0&&(i={});const{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,h=qi(t),p=n||s?[...h?Gt(h):[],...Gt(e)]:[];p.forEach(I=>{n&&I.addEventListener("scroll",r,{passive:!0}),s&&I.addEventListener("resize",r)});const g=h&&l?Qa(h,r):null;let b=-1,m=null;o&&(m=new ResizeObserver(I=>{let[f]=I;f&&f.target===h&&m&&(m.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var y;(y=m)==null||y.observe(e)})),r()}),h&&!a&&m.observe(h),m.observe(e));let _,k=a?wt(t):null;a&&z();function z(){const I=wt(t);k&&(I.x!==k.x||I.y!==k.y||I.width!==k.width||I.height!==k.height)&&r(),k=I,_=requestAnimationFrame(z)}return r(),()=>{var I;p.forEach(f=>{n&&f.removeEventListener("scroll",r),s&&f.removeEventListener("resize",r)}),g?.(),(I=m)==null||I.disconnect(),m=null,a&&cancelAnimationFrame(_)}}const tl=(t,e,r)=>{const i=new Map,n={platform:Ga,...r},s={...n.platform,_c:i};return Ta(t,e,{...n,platform:s})};var rl=Object.defineProperty,il=Object.getOwnPropertyDescriptor,jr=(t,e,r,i)=>{for(var n=i>1?void 0:i?il(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&rl(e,r,n),n};let Qt=class extends _e{constructor(){super(...arguments),this.open=!1,this.parent=null,this.unstyled=!1,this._clickEventListener=()=>{this.open=!1},this._keyboardEventListener=t=>{const{code:e}=t;["Escape"].includes(e)&&this._handleKeyboard(e)}}_handleKeyboard(t){this.clientHeight}_overlayCleanup(){}connectedCallback(){super.connectedCallback(),this.unstyled||setTimeout(()=>{const t=this.parent||this.renderRoot.querySelector("[name=trigger]").assignedNodes()[0],e=this.renderRoot.querySelector("#dropdown"),r=()=>{e.classList.contains("open")&&tl(t,e,{strategy:"fixed"}).then(({x:i,y:n})=>{Object.assign(e.style,{left:`${i}px`,top:`${n}px`,width:`${t.getBoundingClientRect().width}px`})})};this._overlayCleanup=el(t,e,r)})}disconnectedCallback(){super.disconnectedCallback(),this._overlayCleanup(),this.getRootNode().removeEventListener("keydown",this._keyboardEventListener),window.removeEventListener("click",this._clickEventListener)}render(){return F` + `}};Ni([G({attribute:!1})],Mr.prototype,"filterObject",2);Ni([G()],Mr.prototype,"unstyled",2);Mr=Ni([Re("eox-itemfilter-expandcontainer")],Mr);const qt=t=>{if(!t.dirty)return null;switch(t.type){case"multiselect":for(const e in t.state)t.state[e]=!1;break;case"range":t.state.min=t.min,t.state.max=t.max;break;case"select":for(const e in t.state)t.state[e]=!1;break;case"spatial":t.state.geometry=void 0;break;case"text":t.keys.forEach(e=>{t.state[e]=void 0});break}return delete t.stringifiedState,delete t.dirty,t},gi=Math.min,Ct=Math.max,Ar=Math.round,br=Math.floor,at=t=>({x:t,y:t});function ws(t){return t.split("-")[0]}function Ca(t){return t.split("-")[1]}function Ra(t){return t==="x"?"y":"x"}function ja(t){return t==="y"?"height":"width"}function $s(t){return["top","bottom"].includes(ws(t))?"y":"x"}function Ta(t){return Ra($s(t))}function _s(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Bn(t,e,r){let{reference:i,floating:n}=t;const s=$s(e),o=Ta(e),l=ja(o),a=ws(e),h=s==="y",p=i.x+i.width/2-n.width/2,g=i.y+i.height/2-n.height/2,b=i[l]/2-n[l]/2;let m;switch(a){case"top":m={x:p,y:i.y-n.height};break;case"bottom":m={x:p,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:g};break;case"left":m={x:i.x-n.width,y:g};break;default:m={x:i.x,y:i.y}}switch(Ca(e)){case"start":m[o]-=b*(r&&h?-1:1);break;case"end":m[o]+=b*(r&&h?-1:1);break}return m}const Da=async(t,e,r)=>{const{placement:i="bottom",strategy:n="absolute",middleware:s=[],platform:o}=r,l=s.filter(Boolean),a=await(o.isRTL==null?void 0:o.isRTL(e));let h=await o.getElementRects({reference:t,floating:e,strategy:n}),{x:p,y:g}=Bn(h,i,a),b=i,m={},_=0;for(let k=0;k"u"?!1:t instanceof ShadowRoot||t instanceof Ce(t).ShadowRoot}function sr(t){const{overflow:e,overflowX:r,overflowY:i,display:n}=Be(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+r)&&!["inline","contents"].includes(n)}function Na(t){return["table","td","th"].includes(Bt(t))}function Ii(t){const e=qi(),r=Be(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(r.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(r.contain||"").includes(i))}function Ia(t){let e=lt(t);for(;Ve(e)&&!Tt(e);){if(Ii(e))return e;e=lt(e)}return null}function qi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Tt(t){return["html","body","#document"].includes(Bt(t))}function Be(t){return Ce(t).getComputedStyle(t)}function Rr(t){return Xe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function lt(t){if(Bt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Un(t)&&t.host||it(t);return Un(e)?e.host:e}function Ss(t){const e=lt(t);return Tt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ve(e)&&sr(e)?e:Ss(e)}function Qt(t,e,r){var i;e===void 0&&(e=[]),r===void 0&&(r=!0);const n=Ss(t),s=n===((i=t.ownerDocument)==null?void 0:i.body),o=Ce(n);return s?e.concat(o,o.visualViewport||[],sr(n)?n:[],o.frameElement&&r?Qt(o.frameElement):[]):e.concat(n,Qt(n,[],r))}function Ms(t){const e=Be(t);let r=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const n=Ve(t),s=n?t.offsetWidth:r,o=n?t.offsetHeight:i,l=Ar(r)!==s||Ar(i)!==o;return l&&(r=s,i=o),{width:r,height:i,$:l}}function Bi(t){return Xe(t)?t:t.contextElement}function Rt(t){const e=Bi(t);if(!Ve(e))return at(1);const r=e.getBoundingClientRect(),{width:i,height:n,$:s}=Ms(e);let o=(s?Ar(r.width):r.width)/i,l=(s?Ar(r.height):r.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const qa=at(0);function As(t){const e=Ce(t);return!qi()||!e.visualViewport?qa:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ba(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Ce(t)?!1:e}function wt(t,e,r,i){e===void 0&&(e=!1),r===void 0&&(r=!1);const n=t.getBoundingClientRect(),s=Bi(t);let o=at(1);e&&(i?Xe(i)&&(o=Rt(i)):o=Rt(t));const l=Ba(s,r,i)?As(s):at(0);let a=(n.left+l.x)/o.x,h=(n.top+l.y)/o.y,p=n.width/o.x,g=n.height/o.y;if(s){const b=Ce(s),m=i&&Xe(i)?Ce(i):i;let _=b,k=_.frameElement;for(;k&&i&&m!==_;){const z=Rt(k),I=k.getBoundingClientRect(),f=Be(k),y=I.left+(k.clientLeft+parseFloat(f.paddingLeft))*z.x,w=I.top+(k.clientTop+parseFloat(f.paddingTop))*z.y;a*=z.x,h*=z.y,p*=z.x,g*=z.y,a+=y,h+=w,_=Ce(k),k=_.frameElement}}return _s({width:p,height:g,x:a,y:h})}const Ua=[":popover-open",":modal"];function Ui(t){return Ua.some(e=>{try{return t.matches(e)}catch{return!1}})}function Ha(t){let{elements:e,rect:r,offsetParent:i,strategy:n}=t;const s=n==="fixed",o=it(i),l=e?Ui(e.floating):!1;if(i===o||l&&s)return r;let a={scrollLeft:0,scrollTop:0},h=at(1);const p=at(0),g=Ve(i);if((g||!g&&!s)&&((Bt(i)!=="body"||sr(o))&&(a=Rr(i)),Ve(i))){const b=wt(i);h=Rt(i),p.x=b.x+i.clientLeft,p.y=b.y+i.clientTop}return{width:r.width*h.x,height:r.height*h.y,x:r.x*h.x-a.scrollLeft*h.x+p.x,y:r.y*h.y-a.scrollTop*h.y+p.y}}function Fa(t){return Array.from(t.getClientRects())}function ks(t){return wt(it(t)).left+Rr(t).scrollLeft}function za(t){const e=it(t),r=Rr(t),i=t.ownerDocument.body,n=Ct(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=Ct(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-r.scrollLeft+ks(t);const l=-r.scrollTop;return Be(i).direction==="rtl"&&(o+=Ct(e.clientWidth,i.clientWidth)-n),{width:n,height:s,x:o,y:l}}function Wa(t,e){const r=Ce(t),i=it(t),n=r.visualViewport;let s=i.clientWidth,o=i.clientHeight,l=0,a=0;if(n){s=n.width,o=n.height;const h=qi();(!h||h&&e==="fixed")&&(l=n.offsetLeft,a=n.offsetTop)}return{width:s,height:o,x:l,y:a}}function Ya(t,e){const r=wt(t,!0,e==="fixed"),i=r.top+t.clientTop,n=r.left+t.clientLeft,s=Ve(t)?Rt(t):at(1),o=t.clientWidth*s.x,l=t.clientHeight*s.y,a=n*s.x,h=i*s.y;return{width:o,height:l,x:a,y:h}}function Hn(t,e,r){let i;if(e==="viewport")i=Wa(t,r);else if(e==="document")i=za(it(t));else if(Xe(e))i=Ya(e,r);else{const n=As(t);i={...e,x:e.x-n.x,y:e.y-n.y}}return _s(i)}function Os(t,e){const r=lt(t);return r===e||!Xe(r)||Tt(r)?!1:Be(r).position==="fixed"||Os(r,e)}function Xa(t,e){const r=e.get(t);if(r)return r;let i=Qt(t,[],!1).filter(l=>Xe(l)&&Bt(l)!=="body"),n=null;const s=Be(t).position==="fixed";let o=s?lt(t):t;for(;Xe(o)&&!Tt(o);){const l=Be(o),a=Ii(o);!a&&l.position==="fixed"&&(n=null),(s?!a&&!n:!a&&l.position==="static"&&n&&["absolute","fixed"].includes(n.position)||sr(o)&&!a&&Os(t,o))?i=i.filter(h=>h!==o):n=l,o=lt(o)}return e.set(t,i),i}function Va(t){let{element:e,boundary:r,rootBoundary:i,strategy:n}=t;const s=[...r==="clippingAncestors"?Ui(e)?[]:Xa(e,this._c):[].concat(r),i],o=s[0],l=s.reduce((a,h)=>{const p=Hn(e,h,n);return a.top=Ct(p.top,a.top),a.right=gi(p.right,a.right),a.bottom=gi(p.bottom,a.bottom),a.left=Ct(p.left,a.left),a},Hn(e,o,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ka(t){const{width:e,height:r}=Ms(t);return{width:e,height:r}}function Ja(t,e,r){const i=Ve(e),n=it(e),s=r==="fixed",o=wt(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const a=at(0);if(i||!i&&!s)if((Bt(e)!=="body"||sr(n))&&(l=Rr(e)),i){const g=wt(e,!0,s,e);a.x=g.x+e.clientLeft,a.y=g.y+e.clientTop}else n&&(a.x=ks(n));const h=o.left+l.scrollLeft-a.x,p=o.top+l.scrollTop-a.y;return{x:h,y:p,width:o.width,height:o.height}}function ui(t){return Be(t).position==="static"}function Fn(t,e){return!Ve(t)||Be(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ps(t,e){const r=Ce(t);if(Ui(t))return r;if(!Ve(t)){let n=lt(t);for(;n&&!Tt(n);){if(Xe(n)&&!ui(n))return n;n=lt(n)}return r}let i=Fn(t,e);for(;i&&Na(i)&&ui(i);)i=Fn(i,e);return i&&Tt(i)&&ui(i)&&!Ii(i)?r:i||Ia(t)||r}const Za=async function(t){const e=this.getOffsetParent||Ps,r=this.getDimensions,i=await r(t.floating);return{reference:Ja(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Ga(t){return Be(t).direction==="rtl"}const Qa={convertOffsetParentRelativeRectToViewportRelativeRect:Ha,getDocumentElement:it,getClippingRect:Va,getOffsetParent:Ps,getElementRects:Za,getClientRects:Fa,getDimensions:Ka,getScale:Rt,isElement:Xe,isRTL:Ga};function el(t,e){let r=null,i;const n=it(t);function s(){var l;clearTimeout(i),(l=r)==null||l.disconnect(),r=null}function o(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();const{left:h,top:p,width:g,height:b}=t.getBoundingClientRect();if(l||e(),!g||!b)return;const m=br(p),_=br(n.clientWidth-(h+g)),k=br(n.clientHeight-(p+b)),z=br(h),I={rootMargin:-m+"px "+-_+"px "+-k+"px "+-z+"px",threshold:Ct(0,gi(1,a))||1};let f=!0;function y(w){const E=w[0].intersectionRatio;if(E!==a){if(!f)return o();E?o(!1,E):i=setTimeout(()=>{o(!1,1e-7)},1e3)}f=!1}try{r=new IntersectionObserver(y,{...I,root:n.ownerDocument})}catch{r=new IntersectionObserver(y,I)}r.observe(t)}return o(!0),s}function tl(t,e,r,i){i===void 0&&(i={});const{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,h=Bi(t),p=n||s?[...h?Qt(h):[],...Qt(e)]:[];p.forEach(I=>{n&&I.addEventListener("scroll",r,{passive:!0}),s&&I.addEventListener("resize",r)});const g=h&&l?el(h,r):null;let b=-1,m=null;o&&(m=new ResizeObserver(I=>{let[f]=I;f&&f.target===h&&m&&(m.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var y;(y=m)==null||y.observe(e)})),r()}),h&&!a&&m.observe(h),m.observe(e));let _,k=a?wt(t):null;a&&z();function z(){const I=wt(t);k&&(I.x!==k.x||I.y!==k.y||I.width!==k.width||I.height!==k.height)&&r(),k=I,_=requestAnimationFrame(z)}return r(),()=>{var I;p.forEach(f=>{n&&f.removeEventListener("scroll",r),s&&f.removeEventListener("resize",r)}),g?.(),(I=m)==null||I.disconnect(),m=null,a&&cancelAnimationFrame(_)}}const rl=(t,e,r)=>{const i=new Map,n={platform:Qa,...r},s={...n.platform,_c:i};return Da(t,e,{...n,platform:s})};var il=Object.defineProperty,nl=Object.getOwnPropertyDescriptor,jr=(t,e,r,i)=>{for(var n=i>1?void 0:i?nl(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&il(e,r,n),n};let er=class extends _e{constructor(){super(...arguments),this.open=!1,this.parent=null,this.unstyled=!1,this._clickEventListener=()=>{this.open=!1},this._keyboardEventListener=t=>{const{code:e}=t;["Escape"].includes(e)&&this._handleKeyboard(e)}}_handleKeyboard(t){this.clientHeight}_overlayCleanup(){}connectedCallback(){super.connectedCallback(),this.unstyled||setTimeout(()=>{const t=this.parent||this.renderRoot.querySelector("[name=trigger]").assignedNodes()[0],e=this.renderRoot.querySelector("#dropdown"),r=()=>{e.classList.contains("open")&&rl(t,e,{strategy:"fixed"}).then(({x:i,y:n})=>{Object.assign(e.style,{left:`${i}px`,top:`${n}px`,width:`${t.getBoundingClientRect().width}px`})})};this._overlayCleanup=tl(t,e,r)})}disconnectedCallback(){super.disconnectedCallback(),this._overlayCleanup(),this.getRootNode().removeEventListener("keydown",this._keyboardEventListener),window.removeEventListener("click",this._clickEventListener)}render(){return F` - ${Vt(this.items,t=>F` + ${Kt(this.items,t=>F` {this.renderRoot.querySelectorAll(".chip").forEach(r=>{r.classList.remove("highlighted")}),e.target.classList.add("highlighted"),this.requestUpdate()}} @@ -559,7 +574,7 @@ eox-itemfilter-expandcontainer button.reset-icon:before { `)} - `}};Tr([G({type:Array})],er.prototype,"items",2);Tr([G()],er.prototype,"titleProperty",2);Tr([G({type:Boolean})],er.prototype,"unstyled",2);er=Tr([Re("eox-itemfilter-chips")],er);var ol=Object.defineProperty,al=Object.getOwnPropertyDescriptor,Ke=(t,e,r,i)=>{for(var n=i>1?void 0:i?al(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&ol(e,r,n),n};let Ue=class extends _e{constructor(){super(...arguments),this.idProperty="id",this.items=[],this.titleProperty="title",this.itemTitleProperty=this.titleProperty,this.multiple=!1,this.unstyled=!1,this.multiStep=!1,this.inputText="",this.selectedItems=[],this._keyboardEventListener=t=>{const{code:e}=t;["ArrowUp","ArrowDown","Escape","Backspace"].includes(e)&&this._handleKeyboard(e)}}_handleKeyboard(t){var e,r,i,n;if(this.clientHeight!==0){if(t==="Escape"){if(this.selectedItems.length<1||this.multiple){this.renderRoot.querySelector("input").value!==""?this.renderRoot.querySelector("input").value="":this.renderRoot.querySelector("eox-dropdown").open=!1;return}this.multiple||(this.renderRoot.querySelector("input").value!==this.selectedItems[0][this.titleProperty]?this.renderRoot.querySelector("input").value=this.selectedItems[0][this.titleProperty]:this.renderRoot.querySelector("eox-dropdown").open=!1);return}(t==="ArrowDown"||t==="ArrowUp")&&(this.renderRoot.querySelector("eox-dropdown").open=!0,(e=this.parentElement)!=null&&e.inline&&this.renderRoot.querySelector("eox-selectionlist")._handleKeyboard(t)),this.renderRoot.querySelector("input").select(),(r=this.parentElement)!=null&&r.inline&&(["ArrowUp","ArrowDown"].includes(t)||((n=(i=this.parentElement.parentElement)==null?void 0:i.parentElement)==null?void 0:n.querySelector("#inline-input")).focus())}}_handleHighlight(t){t[0]._inProgress||(this.renderRoot.querySelector("input").value=t[0][this.titleProperty]||"",this.renderRoot.querySelector("input").select())}_handleSelect(t){var e;t.length>0&&this.multiStep&&t.forEach(r=>{this.selectedItems.includes(r)||(r._inProgress=!0)}),this.selectedItems=t,t.length>0?this.multiple?(this.renderRoot.querySelector("input").value="",this.renderRoot.querySelector("input").focus()):(this.renderRoot.querySelector("input").value=t[0][this.titleProperty],t[0]._inProgress||(this.renderRoot.querySelector("eox-dropdown").open=!1)):(this.renderRoot.querySelector("input").select(),this.renderRoot.querySelector("input").focus()),this._dispatchEvent(),this.requestUpdate(),(e=this.renderRoot.querySelector("eox-itemfilter-chips"))==null||e.requestUpdate()}_dispatchEvent(){this.dispatchEvent(new CustomEvent("items-selected",{detail:this.selectedItems}))}disconnectedCallback(){super.disconnectedCallback(),this.getRootNode().removeEventListener("keydown",this._keyboardEventListener)}firstUpdated(){this.getRootNode().addEventListener("keydown",this._keyboardEventListener)}updated(t){t.has("selectedItems")&&this._handleSelect(this.selectedItems)}render(){return F` + `}};Tr([G({type:Array})],tr.prototype,"items",2);Tr([G()],tr.prototype,"titleProperty",2);Tr([G({type:Boolean})],tr.prototype,"unstyled",2);tr=Tr([Re("eox-itemfilter-chips")],tr);var al=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,Je=(t,e,r,i)=>{for(var n=i>1?void 0:i?ll(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&al(e,r,n),n};let Ue=class extends _e{constructor(){super(...arguments),this.idProperty="id",this.items=[],this.titleProperty="title",this.itemTitleProperty=this.titleProperty,this.multiple=!1,this.unstyled=!1,this.multiStep=!1,this.inputText="",this.selectedItems=[],this._keyboardEventListener=t=>{const{code:e}=t;["ArrowUp","ArrowDown","Escape","Backspace"].includes(e)&&this._handleKeyboard(e)}}_handleKeyboard(t){var e,r,i,n;if(this.clientHeight!==0){if(t==="Escape"){if(this.selectedItems.length<1||this.multiple){this.renderRoot.querySelector("input").value!==""?this.renderRoot.querySelector("input").value="":this.renderRoot.querySelector("eox-dropdown").open=!1;return}this.multiple||(this.renderRoot.querySelector("input").value!==this.selectedItems[0][this.titleProperty]?this.renderRoot.querySelector("input").value=this.selectedItems[0][this.titleProperty]:this.renderRoot.querySelector("eox-dropdown").open=!1);return}(t==="ArrowDown"||t==="ArrowUp")&&(this.renderRoot.querySelector("eox-dropdown").open=!0,(e=this.parentElement)!=null&&e.inline&&this.renderRoot.querySelector("eox-selectionlist")._handleKeyboard(t)),this.renderRoot.querySelector("input").select(),(r=this.parentElement)!=null&&r.inline&&(["ArrowUp","ArrowDown"].includes(t)||((n=(i=this.parentElement.parentElement)==null?void 0:i.parentElement)==null?void 0:n.querySelector("#inline-input")).focus())}}_handleHighlight(t){t[0]._inProgress||(this.renderRoot.querySelector("input").value=t[0][this.titleProperty]||"",this.renderRoot.querySelector("input").select())}_handleSelect(t){var e;t.length>0&&this.multiStep&&t.forEach(r=>{this.selectedItems.includes(r)||(r._inProgress=!0)}),this.selectedItems=t,t.length>0?this.multiple?(this.renderRoot.querySelector("input").value="",this.renderRoot.querySelector("input").focus()):(this.renderRoot.querySelector("input").value=t[0][this.titleProperty],t[0]._inProgress||(this.renderRoot.querySelector("eox-dropdown").open=!1)):(this.renderRoot.querySelector("input").select(),this.renderRoot.querySelector("input").focus()),this._dispatchEvent(),this.requestUpdate(),(e=this.renderRoot.querySelector("eox-itemfilter-chips"))==null||e.requestUpdate()}_dispatchEvent(){this.dispatchEvent(new CustomEvent("items-selected",{detail:this.selectedItems}))}disconnectedCallback(){super.disconnectedCallback(),this.getRootNode().removeEventListener("keydown",this._keyboardEventListener)}firstUpdated(){this.getRootNode().addEventListener("keydown",this._keyboardEventListener)}updated(t){t.has("selectedItems")&&this._handleSelect(this.selectedItems)}render(){return F`
    - ${ys(this.items.filter(t=>this.filter?t[this.titleProperty].toLowerCase().includes(this.filter.toLowerCase()):!0),t=>t[this.idProperty],t=>F` + ${vs(this.items.filter(t=>this.filter?t[this.titleProperty].toLowerCase().includes(this.filter.toLowerCase()):!0),t=>t[this.idProperty],t=>F`
  • `)}
- `}};Je([G()],He.prototype,"filter",2);Je([G()],He.prototype,"idProperty",2);Je([G()],He.prototype,"items",2);Je([G()],He.prototype,"titleProperty",2);Je([G({type:Boolean})],He.prototype,"multiple",2);Je([G()],He.prototype,"selectedItems",2);Je([G({type:Boolean})],He.prototype,"unstyled",2);Je([G({type:Boolean})],He.prototype,"noShadow",2);Je([rt()],He.prototype,"_currentHighlight",2);He=Je([Re("eox-selectionlist")],He);var hl=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,Dr=(t,e,r,i)=>{for(var n=i>1?void 0:i?ul(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&hl(e,r,n),n};let tr=class extends _e{constructor(){super(...arguments),this.inline=!1,this.unstyled=!1}reset(){this.renderRoot.querySelectorAll("input[type='checkbox']").forEach(t=>{t instanceof HTMLInputElement&&(t.checked=!1)}),qt(this.filterObject),this.requestUpdate()}createRenderRoot(){return this}_getItems(){const t="sort"in this.filterObject?this.filterObject.sort:(e,r)=>e.localeCompare(r);return Object.keys(this.filterObject.state).sort(t).map(e=>({id:e,title:e.replace(/^./,e[0].toUpperCase())}))}_getSelectedItems(){return Object.keys(this.filterObject.state).filter(t=>this.filterObject.state[t]).map(t=>({id:t,title:t.replace(/^./,t[0].toUpperCase())}))}_handleSelected(t){var e;Object.keys(this.filterObject.state).forEach(r=>{this.filterObject.state[r]=t.map(i=>i.id).includes(r)}),this.filterObject.stringifiedState=Object.keys(this.filterObject.state).filter(r=>this.filterObject.state[r]).join(", "),((e=this.filterObject.stringifiedState)==null?void 0:e.length)>0&&(this.filterObject.dirty=!0),this.dispatchEvent(new CustomEvent("filter"))}render(){return de(this.filterObject,()=>F` + `}};Ze([G()],He.prototype,"filter",2);Ze([G()],He.prototype,"idProperty",2);Ze([G()],He.prototype,"items",2);Ze([G()],He.prototype,"titleProperty",2);Ze([G({type:Boolean})],He.prototype,"multiple",2);Ze([G()],He.prototype,"selectedItems",2);Ze([G({type:Boolean})],He.prototype,"unstyled",2);Ze([G({type:Boolean})],He.prototype,"noShadow",2);Ze([rt()],He.prototype,"_currentHighlight",2);He=Ze([Re("eox-selectionlist")],He);var ul=Object.defineProperty,dl=Object.getOwnPropertyDescriptor,Dr=(t,e,r,i)=>{for(var n=i>1?void 0:i?dl(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&ul(e,r,n),n};let rr=class extends _e{constructor(){super(...arguments),this.inline=!1,this.unstyled=!1}reset(){this.renderRoot.querySelectorAll("input[type='checkbox']").forEach(t=>{t instanceof HTMLInputElement&&(t.checked=!1)}),qt(this.filterObject),this.requestUpdate()}createRenderRoot(){return this}_getItems(){const t="sort"in this.filterObject?this.filterObject.sort:(e,r)=>e.localeCompare(r);return Object.keys(this.filterObject.state).sort(t).map(e=>({id:e,title:e.replace(/^./,e[0].toUpperCase())}))}_getSelectedItems(){return Object.keys(this.filterObject.state).filter(t=>this.filterObject.state[t]).map(t=>({id:t,title:t.replace(/^./,t[0].toUpperCase())}))}_handleSelected(t){var e;Object.keys(this.filterObject.state).forEach(r=>{this.filterObject.state[r]=t.map(i=>i.id).includes(r)}),this.filterObject.stringifiedState=Object.keys(this.filterObject.state).filter(r=>this.filterObject.state[r]).join(", "),((e=this.filterObject.stringifiedState)==null?void 0:e.length)>0&&(this.filterObject.dirty=!0),this.dispatchEvent(new CustomEvent("filter"))}render(){return de(this.filterObject,()=>F` ${de(this.inline||Object.keys(this.filterObject.state).length>10,()=>F` this._handleSelected(t.detail)} > `)} - `)}};Dr([G()],tr.prototype,"filterObject",2);Dr([G({type:Boolean})],tr.prototype,"inline",2);Dr([G({type:Boolean})],tr.prototype,"unstyled",2);tr=Dr([Re("eox-itemfilter-multiselect")],tr);var dl="Expected a function",Hn=NaN,pl="[object Symbol]",fl=/^\s+|\s+$/g,gl=/^[-+]0x[0-9a-f]+$/i,yl=/^0b[01]+$/i,ml=/^0o[0-7]+$/i,vl=parseInt,bl=typeof Pt=="object"&&Pt&&Pt.Object===Object&&Pt,xl=typeof self=="object"&&self&&self.Object===Object&&self,wl=bl||xl||Function("return this")(),$l=Object.prototype,_l=$l.toString,El=Math.max,Sl=Math.min,ui=function(){return wl.Date.now()};function Ml(t,e,r){var i,n,s,o,l,a,h=0,p=!1,g=!1,b=!0;if(typeof t!="function")throw new TypeError(dl);e=Fn(e)||0,gi(r)&&(p=!!r.leading,g="maxWait"in r,s=g?El(Fn(r.maxWait)||0,e):s,b="trailing"in r?!!r.trailing:b);function m(S){var M=i,L=n;return i=n=void 0,h=S,o=t.apply(L,M),o}function _(S){return h=S,l=setTimeout(I,e),p?m(S):o}function k(S){var M=S-a,L=S-h,B=e-M;return g?Sl(B,s-L):B}function z(S){var M=S-a,L=S-h;return a===void 0||M>=e||M<0||g&&L>=s}function I(){var S=ui();if(z(S))return f(S);l=setTimeout(I,k(S))}function f(S){return l=void 0,b&&i?m(S):(i=n=void 0,o)}function y(){l!==void 0&&clearTimeout(l),h=0,i=a=n=l=void 0}function w(){return l===void 0?o:f(ui())}function E(){var S=ui(),M=z(S);if(i=arguments,n=this,a=S,M){if(l===void 0)return _(a);if(g)return l=setTimeout(I,e),m(a)}return l===void 0&&(l=setTimeout(I,e)),o}return E.cancel=y,E.flush=w,E}function gi(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Al(t){return!!t&&typeof t=="object"}function kl(t){return typeof t=="symbol"||Al(t)&&_l.call(t)==pl}function Fn(t){if(typeof t=="number")return t;if(kl(t))return Hn;if(gi(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=gi(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(fl,"");var r=yl.test(t);return r||ml.test(t)?vl(t.slice(2),r?2:8):gl.test(t)?Hn:+t}var Ol=Ml;const Ps=Li(Ol);var Pl=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,Ls=(t,e,r,i)=>{for(var n=i>1?void 0:i?Ll(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&Pl(e,r,n),n};let yi=class extends _e{constructor(){super(...arguments),this.inputHandler=t=>{const[e,r]=t.detail.values;(e!==this.filterObject.state.min||r!=this.filterObject.state.max)&&([this.filterObject.state.min,this.filterObject.state.max]=[e,r],this.filterObject.dirty=!0),this.filterObject.dirty&&(this.filterObject.stringifiedState=`${Lt(e)} - ${Lt(r)}`),this.dispatchEvent(new CustomEvent("filter")),this.requestUpdate()},this.debouncedInputHandler=Ps(this.inputHandler,0,{leading:!0})}reset(){qt(this.filterObject),this.requestUpdate()}createRenderRoot(){return this}render(){return de(this.filterObject,()=>F` + `)}};Dr([G()],rr.prototype,"filterObject",2);Dr([G({type:Boolean})],rr.prototype,"inline",2);Dr([G({type:Boolean})],rr.prototype,"unstyled",2);rr=Dr([Re("eox-itemfilter-multiselect")],rr);var pl="Expected a function",zn=NaN,fl="[object Symbol]",gl=/^\s+|\s+$/g,yl=/^[-+]0x[0-9a-f]+$/i,ml=/^0b[01]+$/i,vl=/^0o[0-7]+$/i,bl=parseInt,xl=typeof Pt=="object"&&Pt&&Pt.Object===Object&&Pt,wl=typeof self=="object"&&self&&self.Object===Object&&self,$l=xl||wl||Function("return this")(),_l=Object.prototype,El=_l.toString,Sl=Math.max,Ml=Math.min,di=function(){return $l.Date.now()};function Al(t,e,r){var i,n,s,o,l,a,h=0,p=!1,g=!1,b=!0;if(typeof t!="function")throw new TypeError(pl);e=Wn(e)||0,yi(r)&&(p=!!r.leading,g="maxWait"in r,s=g?Sl(Wn(r.maxWait)||0,e):s,b="trailing"in r?!!r.trailing:b);function m(S){var M=i,L=n;return i=n=void 0,h=S,o=t.apply(L,M),o}function _(S){return h=S,l=setTimeout(I,e),p?m(S):o}function k(S){var M=S-a,L=S-h,B=e-M;return g?Ml(B,s-L):B}function z(S){var M=S-a,L=S-h;return a===void 0||M>=e||M<0||g&&L>=s}function I(){var S=di();if(z(S))return f(S);l=setTimeout(I,k(S))}function f(S){return l=void 0,b&&i?m(S):(i=n=void 0,o)}function y(){l!==void 0&&clearTimeout(l),h=0,i=a=n=l=void 0}function w(){return l===void 0?o:f(di())}function E(){var S=di(),M=z(S);if(i=arguments,n=this,a=S,M){if(l===void 0)return _(a);if(g)return l=setTimeout(I,e),m(a)}return l===void 0&&(l=setTimeout(I,e)),o}return E.cancel=y,E.flush=w,E}function yi(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function kl(t){return!!t&&typeof t=="object"}function Ol(t){return typeof t=="symbol"||kl(t)&&El.call(t)==fl}function Wn(t){if(typeof t=="number")return t;if(Ol(t))return zn;if(yi(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=yi(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(gl,"");var r=ml.test(t);return r||vl.test(t)?bl(t.slice(2),r?2:8):yl.test(t)?zn:+t}var Pl=Al;const Ls=Ci(Pl);var Ll=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,Cs=(t,e,r,i)=>{for(var n=i>1?void 0:i?Cl(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&Ll(e,r,n),n};let mi=class extends _e{constructor(){super(...arguments),this.inputHandler=t=>{const[e,r]=t.detail.values;(e!==this.filterObject.state.min||r!=this.filterObject.state.max)&&([this.filterObject.state.min,this.filterObject.state.max]=[e,r],this.filterObject.dirty=!0),this.filterObject.dirty&&(this.filterObject.stringifiedState=`${Lt(e)} - ${Lt(r)}`),this.dispatchEvent(new CustomEvent("filter")),this.requestUpdate()},this.debouncedInputHandler=Ls(this.inputHandler,0,{leading:!0})}reset(){qt(this.filterObject),this.requestUpdate()}createRenderRoot(){return this}render(){return de(this.filterObject,()=>F`
${this.filterObject.format==="date"?Lt.unix(this.filterObject.state.min):this.filterObject.state.min}
@@ -709,7 +724,7 @@ eox-itemfilter-expandcontainer button.reset-icon:before {
${this.filterObject.format==="date"?Lt.unix(this.filterObject.state.max):this.filterObject.state.max}
- `)}};Ls([G()],yi.prototype,"filterObject",2);yi=Ls([Re("eox-itemfilter-range")],yi);var Cl=Object.defineProperty,Rl=Object.getOwnPropertyDescriptor,Nr=(t,e,r,i)=>{for(var n=i>1?void 0:i?Rl(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&Cl(e,r,n),n};let rr=class extends _e{constructor(){super(...arguments),this.inline=!1,this.unstyled=!1}reset(){this.renderRoot.querySelectorAll("input[type='radio']").forEach(t=>{t instanceof HTMLInputElement&&(t.checked=!1)}),qt(this.filterObject),this.requestUpdate()}createRenderRoot(){return this}_getItems(){const t="sort"in this.filterObject?this.filterObject.sort:(e,r)=>e.localeCompare(r);return Object.keys(this.filterObject.state).sort(t).map(e=>({id:e,title:e.replace(/^./,e[0].toUpperCase())}))}_getSelectedItems(){return Object.keys(this.filterObject.state).filter(t=>this.filterObject.state[t]).map(t=>({id:t,title:t.replace(/^./,t[0].toUpperCase())}))}_handleSelected(t){var e;Object.keys(this.filterObject.state).forEach(r=>{this.filterObject.state[r]=t.detail.map(i=>i.id).includes(r)}),this.filterObject.stringifiedState=Object.keys(this.filterObject.state).filter(r=>this.filterObject.state[r])[0],((e=this.filterObject.stringifiedState)==null?void 0:e.length)>0&&(this.filterObject.dirty=!0),this.dispatchEvent(new CustomEvent("filter"))}render(){return de(this.filterObject,()=>F` + `)}};Cs([G()],mi.prototype,"filterObject",2);mi=Cs([Re("eox-itemfilter-range")],mi);var Rl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Nr=(t,e,r,i)=>{for(var n=i>1?void 0:i?jl(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&Rl(e,r,n),n};let ir=class extends _e{constructor(){super(...arguments),this.inline=!1,this.unstyled=!1}reset(){this.renderRoot.querySelectorAll("input[type='radio']").forEach(t=>{t instanceof HTMLInputElement&&(t.checked=!1)}),qt(this.filterObject),this.requestUpdate()}createRenderRoot(){return this}_getItems(){const t="sort"in this.filterObject?this.filterObject.sort:(e,r)=>e.localeCompare(r);return Object.keys(this.filterObject.state).sort(t).map(e=>({id:e,title:e.replace(/^./,e[0].toUpperCase())}))}_getSelectedItems(){return Object.keys(this.filterObject.state).filter(t=>this.filterObject.state[t]).map(t=>({id:t,title:t.replace(/^./,t[0].toUpperCase())}))}_handleSelected(t){var e;Object.keys(this.filterObject.state).forEach(r=>{this.filterObject.state[r]=t.detail.map(i=>i.id).includes(r)}),this.filterObject.stringifiedState=Object.keys(this.filterObject.state).filter(r=>this.filterObject.state[r])[0],((e=this.filterObject.stringifiedState)==null?void 0:e.length)>0&&(this.filterObject.dirty=!0),this.dispatchEvent(new CustomEvent("filter"))}render(){return de(this.filterObject,()=>F` ${de(this.inline||Object.keys(this.filterObject.state).length>10,()=>F` this._handleSelected(t)} > `)} - `)}};Nr([G()],rr.prototype,"filterObject",2);Nr([G({type:Boolean})],rr.prototype,"inline",2);Nr([G({type:Boolean})],rr.prototype,"unstyled",2);rr=Nr([Re("eox-itemfilter-select")],rr);var Se=63710088e-1,Bi={centimeters:Se*100,centimetres:Se*100,degrees:Se/111325,feet:Se*3.28084,inches:Se*39.37,kilometers:Se/1e3,kilometres:Se/1e3,meters:Se,metres:Se,miles:Se/1609.344,millimeters:Se*1e3,millimetres:Se*1e3,nauticalmiles:Se/1852,radians:1,yards:Se*1.0936},jl={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Se,yards:1.0936133},mi={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Ne(t,e,r){r===void 0&&(r={});var i={type:"Feature"};return(r.id===0||r.id)&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.properties=e||{},i.geometry=t,i}function Tl(t,e,r){switch(t){case"Point":return We(e).geometry;case"LineString":return Be(e).geometry;case"Polygon":return Ui(e).geometry;case"MultiPoint":return Cs(e).geometry;case"MultiLineString":return Hi(e).geometry;case"MultiPolygon":return Rs(e).geometry;default:throw new Error(t+" is invalid")}}function We(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ar(t[0])||!Ar(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return Ne(i,e,r)}function Dl(t,e,r){return r===void 0&&(r={}),ct(t.map(function(i){return We(i,e)}),r)}function Ui(t,e,r){r===void 0&&(r={});for(var i=0,n=t;i=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}function js(t,e){e===void 0&&(e="kilometers");var r=Bi[e];if(!r)throw new Error(e+" units is invalid");return t*r}function Fi(t,e){e===void 0&&(e="kilometers");var r=Bi[e];if(!r)throw new Error(e+" units is invalid");return t/r}function Ul(t,e){return Ts(Fi(t,e))}function Hl(t){var e=t%360;return e<0&&(e+=360),e}function Ts(t){var e=t%(2*Math.PI);return e*180/Math.PI}function Fl(t){var e=t%360;return e*Math.PI/180}function zl(t,e,r){if(e===void 0&&(e="kilometers"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return js(Fi(t,e),r)}function Wl(t,e,r){if(e===void 0&&(e="meters"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=mi[e];if(!i)throw new Error("invalid original units");var n=mi[r];if(!n)throw new Error("invalid final units");return t/i*n}function Ar(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function zi(t){return!!t&&t.constructor===Object}function Yl(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(e){if(!Ar(e))throw new Error("bbox must only contain numbers")})}function Xl(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const Vl=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:mi,bearingToAzimuth:Hl,convertArea:Wl,convertLength:zl,degreesToRadians:Fl,earthRadius:Se,factors:Bi,feature:Ne,featureCollection:ct,geometry:Tl,geometryCollection:ql,isNumber:Ar,isObject:zi,lengthToDegrees:Ul,lengthToRadians:Fi,lineString:Be,lineStrings:Il,multiLineString:Hi,multiPoint:Cs,multiPolygon:Rs,point:We,points:Dl,polygon:Ui,polygons:Nl,radiansToDegrees:Ts,radiansToLength:js,round:Bl,unitsFactors:jl,validateBBox:Yl,validateId:Xl},Symbol.toStringTag,{value:"Module"}));function Ds(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Dt(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Nt(t){return t.type==="Feature"?t.geometry:t}function Te(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=Ds(t),n=Nt(e),s=n.type,o=e.bbox,l=n.coordinates;if(o&&Kl(i,o)===!1)return!1;s==="Polygon"&&(l=[l]);for(var a=!1,h=0;ht[1]!=h>t[1]&&t[0]<(a-o)*(t[1]-l)/(h-l)+o;g&&(i=!i)}return i}function Kl(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function Bt(t,e,r){if(t!==null)for(var i,n,s,o,l,a,h,p=0,g=0,b,m=t.type,_=m==="FeatureCollection",k=m==="Feature",z=_?t.features.length:1,I=0;Ia||_>h||k>p){l=g,a=i,h=_,p=k,s=0;return}var z=Be([l,g],r.properties);if(e(z,i,n,k,s)===!1)return!1;s++,l=g})===!1)return!1}}})}function rc(t,e,r){var i=r,n=!1;return Is(t,function(s,o,l,a,h){n===!1&&r===void 0?i=s:i=e(i,s,o,l,a,h),n=!0}),i}function qs(t,e){if(!t)throw new Error("geojson is required");et(t,function(r,i,n){if(r.geometry!==null){var s=r.geometry.type,o=r.geometry.coordinates;switch(s){case"LineString":if(e(r,i,n,0,0)===!1)return!1;break;case"Polygon":for(var l=0;ln?r:n,h=i>s?i:s;return[o,l,a,h]}var Yi={exports:{}},Bs={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(Pt,function(){function r(f,y,w,E,S){(function M(L,B,U,T,re){for(;T>U;){if(T-U>600){var Z=T-U+1,C=B-U+1,O=Math.log(Z),A=.5*Math.exp(2*O/3),N=.5*Math.sqrt(O*A*(Z-A)/Z)*(C-Z/2<0?-1:1),P=Math.max(U,Math.floor(B-C*A/Z+N)),K=Math.min(T,Math.floor(B+(Z-C)*A/Z+N));M(L,B,P,K,re)}var W=L[B],oe=U,ie=T;for(i(L,U,B),re(L[T],W)>0&&i(L,U,T);oe0;)ie--}re(L[U],W)===0?i(L,U,ie):i(L,++ie,T),ie<=B&&(U=ie+1),B<=ie&&(T=ie-1)}})(f,y,w||0,E||f.length-1,S||n)}function i(f,y,w){var E=f[y];f[y]=f[w],f[w]=E}function n(f,y){return fy?1:0}var s=function(f){f===void 0&&(f=9),this._maxEntries=Math.max(4,f),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(f,y,w){if(!w)return y.indexOf(f);for(var E=0;E=f.minX&&y.maxY>=f.minY}function z(f){return{children:f,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(f,y,w,E,S){for(var M=[y,w];M.length;)if(!((w=M.pop())-(y=M.pop())<=E)){var L=y+Math.ceil((w-y)/E/2)*E;r(f,L,y,w,S),M.push(y,L,L,w)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(f){var y=this.data,w=[];if(!k(f,y))return w;for(var E=this.toBBox,S=[];y;){for(var M=0;M=0&&S[y].children.length>this._maxEntries;)this._split(S,y),y--;this._adjustParentBBoxes(E,S,y)},s.prototype._split=function(f,y){var w=f[y],E=w.children.length,S=this._minEntries;this._chooseSplitAxis(w,S,E);var M=this._chooseSplitIndex(w,S,E),L=z(w.children.splice(M,w.children.length-M));L.height=w.height,L.leaf=w.leaf,l(w,this.toBBox),l(L,this.toBBox),y?f[y-1].children.push(L):this._splitRoot(w,L)},s.prototype._splitRoot=function(f,y){this.data=z([f,y]),this.data.height=f.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(f,y,w){for(var E,S,M,L,B,U,T,re=1/0,Z=1/0,C=y;C<=w-y;C++){var O=a(f,0,C,this.toBBox),A=a(f,C,w,this.toBBox),N=(S=O,M=A,L=void 0,B=void 0,U=void 0,T=void 0,L=Math.max(S.minX,M.minX),B=Math.max(S.minY,M.minY),U=Math.min(S.maxX,M.maxX),T=Math.min(S.maxY,M.maxY),Math.max(0,U-L)*Math.max(0,T-B)),P=b(O)+b(A);N=y;re--){var Z=f.children[re];h(L,f.leaf?S(Z):Z),B+=m(L)}return B},s.prototype._adjustParentBBoxes=function(f,y,w){for(var E=w;E>=0;E--)h(y[E],f)},s.prototype._condense=function(f){for(var y=f.length-1,w=void 0;y>=0;y--)f[y].children.length===0?y>0?(w=f[y-1].children).splice(w.indexOf(f[y]),1):this.clear():l(f[y],this.toBBox)},s})})(Bs);var hc=Bs.exports;const uc=Ci(Vl),dc=Ci(oc);function $t(t){var e=[1/0,1/0,-1/0,-1/0];return Bt(t,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2] line1 must only contain 2 coordinates");if(i.length!==2)throw new Error(" line2 must only contain 2 coordinates");var n=r[0][0],s=r[0][1],o=r[1][0],l=r[1][1],a=i[0][0],h=i[0][1],p=i[1][0],g=i[1][1],b=(g-h)*(o-n)-(p-a)*(l-s),m=(p-a)*(s-h)-(g-h)*(n-a),_=(o-n)*(s-h)-(l-s)*(n-a);if(b===0)return null;var k=m/b,z=_/b;if(k>=0&&k<=1&&z>=0&&z<=1){var I=n+k*(o-n),f=s+k*(l-s);return We([I,f])}return null}function vi(t,e){e===void 0&&(e={});var r=Nt(t);switch(!e.properties&&t.type==="Feature"&&(e.properties=t.properties),r.type){case"Polygon":return vc(r,e);case"MultiPolygon":return bc(r,e);default:throw new Error("invalid poly")}}function vc(t,e){e===void 0&&(e={});var r=Nt(t),i=r.coordinates,n=e.properties?e.properties:t.type==="Feature"?t.properties:{};return zs(i,n)}function bc(t,e){e===void 0&&(e={});var r=Nt(t),i=r.coordinates,n=e.properties?e.properties:t.type==="Feature"?t.properties:{},s=[];return i.forEach(function(o){s.push(zs(o,n))}),ct(s)}function zs(t,e){return t.length>1?Hi(t,e):Be(t[0],e)}function xc(t,e){var r=!0;return et(t,function(i){et(e,function(n){if(r===!1)return!1;r=wc(i.geometry,n.geometry)})}),r}function wc(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return!Sc(t.coordinates,e.coordinates);case"LineString":return!Vn(e,t);case"Polygon":return!Te(t,e)}break;case"LineString":switch(e.type){case"Point":return!Vn(t,e);case"LineString":return!$c(t,e);case"Polygon":return!Kn(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Te(e,t);case"LineString":return!Kn(t,e);case"Polygon":return!_c(e,t)}}return!1}function Vn(t,e){for(var r=0;r0}function Kn(t,e){for(var r=0,i=e.coordinates;r0}function _c(t,e){for(var r=0,i=t.coordinates[0];r0}function Ec(t,e,r){var i=r[0]-t[0],n=r[1]-t[1],s=e[0]-t[0],o=e[1]-t[1],l=i*o-n*s;return l!==0?!1:Math.abs(s)>=Math.abs(o)?s>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:o>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1]}function Sc(t,e){return t[0]===e[0]&&t[1]===e[1]}function Mc(t,e){var r=!1;return et(t,function(i){et(e,function(n){if(r===!0)return!0;r=!xc(i.geometry,n.geometry)})}),r}function Or(t,e,r){r===void 0&&(r={});for(var i=Ds(t),n=Dt(e),s=0;s"u"?null:r.epsilon))return!0}return!1}function Ac(t,e,r,i,n){var s=r[0],o=r[1],l=t[0],a=t[1],h=e[0],p=e[1],g=r[0]-l,b=r[1]-a,m=h-l,_=p-a,k=g*_-b*m;if(n!==null){if(Math.abs(k)>n)return!1}else if(k!==0)return!1;if(i){if(i==="start")return Math.abs(m)>=Math.abs(_)?m>0?l0?a=Math.abs(_)?m>0?l<=s&&s0?a<=o&&o=Math.abs(_)?m>0?l0?a=Math.abs(_)?m>0?l<=s&&s<=h:h<=s&&s<=l:_>0?a<=o&&o<=p:p<=o&&o<=a;return!1}function kc(t,e){var r=Nt(t),i=Nt(e),n=r.type,s=i.type;switch(n){case"Point":switch(s){case"MultiPoint":return Oc(r,i);case"LineString":return Or(r,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Te(r,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return Pc(r,i);case"LineString":return Lc(r,i);case"Polygon":case"MultiPolygon":return Cc(r,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return Rc(r,i);case"Polygon":case"MultiPolygon":return jc(r,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return Tc(r,i);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function Oc(t,e){var r,i=!1;for(r=0;re[0]||t[2]e[1]||t[3]{for(var n=i>1?void 0:i?Ic(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&Nc(e,r,n),n};const qc=(t,e)=>e?Mc(t,e):!0,Bc=(t,e)=>e?kc(t,e):!0;let bi=class extends _e{reset(){qt(this.filterObject),this.renderRoot.querySelector("eox-itemfilter-spatial-filter").reset(),this.requestUpdate()}createRenderRoot(){return this}render(){return de(this.filterObject,()=>{var t;return F` + `)}};Nr([G()],ir.prototype,"filterObject",2);Nr([G({type:Boolean})],ir.prototype,"inline",2);Nr([G({type:Boolean})],ir.prototype,"unstyled",2);ir=Nr([Re("eox-itemfilter-select")],ir);var Se=63710088e-1,Hi={centimeters:Se*100,centimetres:Se*100,degrees:Se/111325,feet:Se*3.28084,inches:Se*39.37,kilometers:Se/1e3,kilometres:Se/1e3,meters:Se,metres:Se,miles:Se/1609.344,millimeters:Se*1e3,millimetres:Se*1e3,nauticalmiles:Se/1852,radians:1,yards:Se*1.0936},Tl={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/Se,yards:1.0936133},vi={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function De(t,e,r){r===void 0&&(r={});var i={type:"Feature"};return(r.id===0||r.id)&&(i.id=r.id),r.bbox&&(i.bbox=r.bbox),i.properties=e||{},i.geometry=t,i}function Dl(t,e,r){switch(t){case"Point":return We(e).geometry;case"LineString":return qe(e).geometry;case"Polygon":return Fi(e).geometry;case"MultiPoint":return Rs(e).geometry;case"MultiLineString":return zi(e).geometry;case"MultiPolygon":return js(e).geometry;default:throw new Error(t+" is invalid")}}function We(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!kr(t[0])||!kr(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return De(i,e,r)}function Nl(t,e,r){return r===void 0&&(r={}),ct(t.map(function(i){return We(i,e)}),r)}function Fi(t,e,r){r===void 0&&(r={});for(var i=0,n=t;i=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}function Ts(t,e){e===void 0&&(e="kilometers");var r=Hi[e];if(!r)throw new Error(e+" units is invalid");return t*r}function Wi(t,e){e===void 0&&(e="kilometers");var r=Hi[e];if(!r)throw new Error(e+" units is invalid");return t/r}function Hl(t,e){return Ds(Wi(t,e))}function Fl(t){var e=t%360;return e<0&&(e+=360),e}function Ds(t){var e=t%(2*Math.PI);return e*180/Math.PI}function zl(t){var e=t%360;return e*Math.PI/180}function Wl(t,e,r){if(e===void 0&&(e="kilometers"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return Ts(Wi(t,e),r)}function Yl(t,e,r){if(e===void 0&&(e="meters"),r===void 0&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=vi[e];if(!i)throw new Error("invalid original units");var n=vi[r];if(!n)throw new Error("invalid final units");return t/i*n}function kr(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function Yi(t){return!!t&&t.constructor===Object}function Xl(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(e){if(!kr(e))throw new Error("bbox must only contain numbers")})}function Vl(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const Kl=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:vi,bearingToAzimuth:Fl,convertArea:Yl,convertLength:Wl,degreesToRadians:zl,earthRadius:Se,factors:Hi,feature:De,featureCollection:ct,geometry:Dl,geometryCollection:Bl,isNumber:kr,isObject:Yi,lengthToDegrees:Hl,lengthToRadians:Wi,lineString:qe,lineStrings:ql,multiLineString:zi,multiPoint:Rs,multiPolygon:js,point:We,points:Nl,polygon:Fi,polygons:Il,radiansToDegrees:Ds,radiansToLength:Ts,round:Ul,unitsFactors:Tl,validateBBox:Xl,validateId:Vl},Symbol.toStringTag,{value:"Module"}));function Ns(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Dt(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Nt(t){return t.type==="Feature"?t.geometry:t}function Te(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=Ns(t),n=Nt(e),s=n.type,o=e.bbox,l=n.coordinates;if(o&&Jl(i,o)===!1)return!1;s==="Polygon"&&(l=[l]);for(var a=!1,h=0;ht[1]!=h>t[1]&&t[0]<(a-o)*(t[1]-l)/(h-l)+o;g&&(i=!i)}return i}function Jl(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function Ut(t,e,r){if(t!==null)for(var i,n,s,o,l,a,h,p=0,g=0,b,m=t.type,_=m==="FeatureCollection",k=m==="Feature",z=_?t.features.length:1,I=0;Ia||_>h||k>p){l=g,a=i,h=_,p=k,s=0;return}var z=qe([l,g],r.properties);if(e(z,i,n,k,s)===!1)return!1;s++,l=g})===!1)return!1}}})}function ic(t,e,r){var i=r,n=!1;return qs(t,function(s,o,l,a,h){n===!1&&r===void 0?i=s:i=e(i,s,o,l,a,h),n=!0}),i}function Bs(t,e){if(!t)throw new Error("geojson is required");et(t,function(r,i,n){if(r.geometry!==null){var s=r.geometry.type,o=r.geometry.coordinates;switch(s){case"LineString":if(e(r,i,n,0,0)===!1)return!1;break;case"Polygon":for(var l=0;ln?r:n,h=i>s?i:s;return[o,l,a,h]}var Vi={exports:{}},Us={exports:{}};(function(t,e){(function(r,i){t.exports=i()})(Pt,function(){function r(f,y,w,E,S){(function M(L,B,U,T,re){for(;T>U;){if(T-U>600){var Z=T-U+1,C=B-U+1,O=Math.log(Z),A=.5*Math.exp(2*O/3),N=.5*Math.sqrt(O*A*(Z-A)/Z)*(C-Z/2<0?-1:1),P=Math.max(U,Math.floor(B-C*A/Z+N)),K=Math.min(T,Math.floor(B+(Z-C)*A/Z+N));M(L,B,P,K,re)}var W=L[B],oe=U,ie=T;for(i(L,U,B),re(L[T],W)>0&&i(L,U,T);oe0;)ie--}re(L[U],W)===0?i(L,U,ie):i(L,++ie,T),ie<=B&&(U=ie+1),B<=ie&&(T=ie-1)}})(f,y,w||0,E||f.length-1,S||n)}function i(f,y,w){var E=f[y];f[y]=f[w],f[w]=E}function n(f,y){return fy?1:0}var s=function(f){f===void 0&&(f=9),this._maxEntries=Math.max(4,f),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(f,y,w){if(!w)return y.indexOf(f);for(var E=0;E=f.minX&&y.maxY>=f.minY}function z(f){return{children:f,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function I(f,y,w,E,S){for(var M=[y,w];M.length;)if(!((w=M.pop())-(y=M.pop())<=E)){var L=y+Math.ceil((w-y)/E/2)*E;r(f,L,y,w,S),M.push(y,L,L,w)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(f){var y=this.data,w=[];if(!k(f,y))return w;for(var E=this.toBBox,S=[];y;){for(var M=0;M=0&&S[y].children.length>this._maxEntries;)this._split(S,y),y--;this._adjustParentBBoxes(E,S,y)},s.prototype._split=function(f,y){var w=f[y],E=w.children.length,S=this._minEntries;this._chooseSplitAxis(w,S,E);var M=this._chooseSplitIndex(w,S,E),L=z(w.children.splice(M,w.children.length-M));L.height=w.height,L.leaf=w.leaf,l(w,this.toBBox),l(L,this.toBBox),y?f[y-1].children.push(L):this._splitRoot(w,L)},s.prototype._splitRoot=function(f,y){this.data=z([f,y]),this.data.height=f.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(f,y,w){for(var E,S,M,L,B,U,T,re=1/0,Z=1/0,C=y;C<=w-y;C++){var O=a(f,0,C,this.toBBox),A=a(f,C,w,this.toBBox),N=(S=O,M=A,L=void 0,B=void 0,U=void 0,T=void 0,L=Math.max(S.minX,M.minX),B=Math.max(S.minY,M.minY),U=Math.min(S.maxX,M.maxX),T=Math.min(S.maxY,M.maxY),Math.max(0,U-L)*Math.max(0,T-B)),P=b(O)+b(A);N=y;re--){var Z=f.children[re];h(L,f.leaf?S(Z):Z),B+=m(L)}return B},s.prototype._adjustParentBBoxes=function(f,y,w){for(var E=w;E>=0;E--)h(y[E],f)},s.prototype._condense=function(f){for(var y=f.length-1,w=void 0;y>=0;y--)f[y].children.length===0?y>0?(w=f[y-1].children).splice(w.indexOf(f[y]),1):this.clear():l(f[y],this.toBBox)},s})})(Us);var uc=Us.exports;const dc=Ri(Kl),pc=Ri(ac);function $t(t){var e=[1/0,1/0,-1/0,-1/0];return Ut(t,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2] line1 must only contain 2 coordinates");if(i.length!==2)throw new Error(" line2 must only contain 2 coordinates");var n=r[0][0],s=r[0][1],o=r[1][0],l=r[1][1],a=i[0][0],h=i[0][1],p=i[1][0],g=i[1][1],b=(g-h)*(o-n)-(p-a)*(l-s),m=(p-a)*(s-h)-(g-h)*(n-a),_=(o-n)*(s-h)-(l-s)*(n-a);if(b===0)return null;var k=m/b,z=_/b;if(k>=0&&k<=1&&z>=0&&z<=1){var I=n+k*(o-n),f=s+k*(l-s);return We([I,f])}return null}function bi(t,e){e===void 0&&(e={});var r=Nt(t);switch(!e.properties&&t.type==="Feature"&&(e.properties=t.properties),r.type){case"Polygon":return bc(r,e);case"MultiPolygon":return xc(r,e);default:throw new Error("invalid poly")}}function bc(t,e){e===void 0&&(e={});var r=Nt(t),i=r.coordinates,n=e.properties?e.properties:t.type==="Feature"?t.properties:{};return Ws(i,n)}function xc(t,e){e===void 0&&(e={});var r=Nt(t),i=r.coordinates,n=e.properties?e.properties:t.type==="Feature"?t.properties:{},s=[];return i.forEach(function(o){s.push(Ws(o,n))}),ct(s)}function Ws(t,e){return t.length>1?zi(t,e):qe(t[0],e)}function wc(t,e){var r=!0;return et(t,function(i){et(e,function(n){if(r===!1)return!1;r=$c(i.geometry,n.geometry)})}),r}function $c(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return!Mc(t.coordinates,e.coordinates);case"LineString":return!Jn(e,t);case"Polygon":return!Te(t,e)}break;case"LineString":switch(e.type){case"Point":return!Jn(t,e);case"LineString":return!_c(t,e);case"Polygon":return!Zn(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Te(e,t);case"LineString":return!Zn(t,e);case"Polygon":return!Ec(e,t)}}return!1}function Jn(t,e){for(var r=0;r0}function Zn(t,e){for(var r=0,i=e.coordinates;r0}function Ec(t,e){for(var r=0,i=t.coordinates[0];r0}function Sc(t,e,r){var i=r[0]-t[0],n=r[1]-t[1],s=e[0]-t[0],o=e[1]-t[1],l=i*o-n*s;return l!==0?!1:Math.abs(s)>=Math.abs(o)?s>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:o>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1]}function Mc(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ac(t,e){var r=!1;return et(t,function(i){et(e,function(n){if(r===!0)return!0;r=!wc(i.geometry,n.geometry)})}),r}function Pr(t,e,r){r===void 0&&(r={});for(var i=Ns(t),n=Dt(e),s=0;s"u"?null:r.epsilon))return!0}return!1}function kc(t,e,r,i,n){var s=r[0],o=r[1],l=t[0],a=t[1],h=e[0],p=e[1],g=r[0]-l,b=r[1]-a,m=h-l,_=p-a,k=g*_-b*m;if(n!==null){if(Math.abs(k)>n)return!1}else if(k!==0)return!1;if(i){if(i==="start")return Math.abs(m)>=Math.abs(_)?m>0?l0?a=Math.abs(_)?m>0?l<=s&&s0?a<=o&&o=Math.abs(_)?m>0?l0?a=Math.abs(_)?m>0?l<=s&&s<=h:h<=s&&s<=l:_>0?a<=o&&o<=p:p<=o&&o<=a;return!1}function Oc(t,e){var r=Nt(t),i=Nt(e),n=r.type,s=i.type;switch(n){case"Point":switch(s){case"MultiPoint":return Pc(r,i);case"LineString":return Pr(r,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Te(r,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return Lc(r,i);case"LineString":return Cc(r,i);case"Polygon":case"MultiPolygon":return Rc(r,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return jc(r,i);case"Polygon":case"MultiPolygon":return Tc(r,i);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return Dc(r,i);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function Pc(t,e){var r,i=!1;for(r=0;re[0]||t[2]e[1]||t[3]{for(var n=i>1?void 0:i?qc(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&Ic(e,r,n),n};const Bc=(t,e)=>e?Ac(t,e):!0,Uc=(t,e)=>e?Oc(t,e):!0;let xi=class extends _e{reset(){qt(this.filterObject),this.renderRoot.querySelector("eox-itemfilter-spatial-filter").reset(),this.requestUpdate()}createRenderRoot(){return this}render(){return de(this.filterObject,()=>{var t;return F`
- ${Vt(["intersects","within"],e=>F` + ${Kt(["intersects","within"],e=>F`