(function(fe,xe){typeof exports=="object"&&typeof module<"u"?module.exports=xe():typeof define=="function"&&define.amd?define(xe):(fe=typeof globalThis<"u"?globalThis:fe||self,fe["yio-map"]=xe())})(this,function(){"use strict";var eC=Object.defineProperty;var EA=fe=>{throw TypeError(fe)};var tC=(fe,xe,Ve)=>xe in fe?eC(fe,xe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):fe[xe]=Ve;var Mi=(fe,xe,Ve)=>tC(fe,typeof xe!="symbol"?xe+"":xe,Ve),Ou=(fe,xe,Ve)=>xe.has(fe)||EA("Cannot "+Ve);var L=(fe,xe,Ve)=>(Ou(fe,xe,"read from private field"),Ve?Ve.call(fe):xe.get(fe)),_e=(fe,xe,Ve)=>xe.has(fe)?EA("Cannot add the same private member more than once"):xe instanceof WeakSet?xe.add(fe):xe.set(fe,Ve),Re=(fe,xe,Ve,As)=>(Ou(fe,xe,"write to private field"),As?As.call(fe,Ve):xe.set(fe,Ve),Ve),At=(fe,xe,Ve)=>(Ou(fe,xe,"access private method"),Ve);/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/var xA,ci,In,gs,CA,bA,ur,Ht,hi,Ri,Pn,dr,ui,TA,Yi,Ki,RA,SA,Zi,Gu,vo,fr,vl,IA,lt,Co,gr,Qi,pr,Ar,Xt,bo,To,mr,yr,Mn,Fn,Yt,PA,Bu,Nu,MA;const fe=globalThis,xe=fe.ShadowRoot&&(fe.ShadyCSS===void 0||fe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ve=Symbol(),As=new WeakMap;let ju=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Ve)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(xe&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=As.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&As.set(t,e))}return e}toString(){return this.cssText}};const bl=n=>new ju(typeof n=="string"?n:n+"",void 0,Ve),FA=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((i,r,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[s+1],n[0]);return new ju(t,n,Ve)},LA=(n,e)=>{if(xe)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),r=fe.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},zu=xe?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return bl(t)})(n):n;/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{is:kA,defineProperty:DA,getOwnPropertyDescriptor:OA,getOwnPropertyNames:GA,getOwnPropertySymbols:BA,getPrototypeOf:NA}=Object,tn=globalThis,Uu=tn.trustedTypes,jA=Uu?Uu.emptyScript:"",Tl=tn.reactiveElementPolyfillSupport,ms=(n,e)=>n,Rl={toAttribute(n,e){switch(e){case Boolean:n=n?jA:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Vu=(n,e)=>!kA(n,e),Wu={attribute:!0,type:String,converter:Rl,reflect:!1,hasChanged:Vu};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),tn.litPropertyMetadata??(tn.litPropertyMetadata=new WeakMap);class xr 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,t=Wu){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&DA(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:s}=OA(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);s.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Wu}static _$Ei(){if(this.hasOwnProperty(ms("elementProperties")))return;const e=NA(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ms("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ms("properties"))){const t=this.properties,i=[...GA(t),...BA(t)];for(const r of i)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const r of i)t.unshift(zu(r))}else e!==void 0&&t.push(zu(e));return t}static _$Eu(e,t){const i=t.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(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.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 LA(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var s;const i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){const o=(((s=i.converter)==null?void 0:s.toAttribute)!==void 0?i.converter:Rl).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var s;const i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:Rl;this._$Em=r,this[r]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??Vu)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;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 r=this.constructor.elementProperties;if(r.size>0)for(const[s,o]of r)o.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],o)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(r=>{var s;return(s=r.hostUpdate)==null?void 0:s.call(r)}),this.update(t)):this._$EU()}catch(r){throw e=!1,this._$EU(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.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(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}xr.elementStyles=[],xr.shadowRootOptions={mode:"open"},xr[ms("elementProperties")]=new Map,xr[ms("finalized")]=new Map,Tl==null||Tl({ReactiveElement:xr}),(tn.reactiveElementVersions??(tn.reactiveElementVersions=[])).push("2.0.4");/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const ys=globalThis,Ro=ys.trustedTypes,Hu=Ro?Ro.createPolicy("lit-html",{createHTML:n=>n}):void 0,Xu="$lit$",nn=`lit$${Math.random().toFixed(9).slice(2)}$`,Yu="?"+nn,zA=`<${Yu}>`,Ln=document,_s=()=>Ln.createComment(""),xs=n=>n===null||typeof n!="object"&&typeof n!="function",Sl=Array.isArray,UA=n=>Sl(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Il=`[
\f\r]`,Es=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ku=/-->/g,Zu=/>/g,kn=RegExp(`>|${Il}(?:([^\\s"'>=/]+)(${Il}*=${Il}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),Qu=/'/g,qu=/"/g,Ju=/^(?:script|style|textarea|title)$/i,VA=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),WA=VA(1),Er=Symbol.for("lit-noChange"),$e=Symbol.for("lit-nothing"),$u=new WeakMap,Dn=Ln.createTreeWalker(Ln,129);function ed(n,e){if(!Sl(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Hu!==void 0?Hu.createHTML(e):e}const HA=(n,e)=>{const t=n.length-1,i=[];let r,s=e===2?"":e===3?"":"")),i]};class ws{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,o=0;const a=e.length-1,l=this.parts,[c,h]=HA(e,t);if(this.el=ws.createElement(c,i),Dn.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=Dn.nextNode())!==null&&l.length0){r.textContent=Ro?Ro.emptyScript:"";for(let g=0;g2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$e}_$AI(e,t=this,i,r){const s=this.strings;let o=!1;if(s===void 0)e=wr(this,e,t,0),o=!xs(e)||e!==this._$AH&&e!==Er,o&&(this._$AH=e);else{const a=e;let l,c;for(e=s[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let r=i._$litPart$;if(r===void 0){const s=(t==null?void 0:t.renderBefore)??null;i._$litPart$=r=new Pl(e.insertBefore(_s(),s),s,void 0,t??{})}return r._$AI(n),r};/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/class vs extends xr{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(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=qA(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Er}}vs._$litElement$=!0,vs.finalized=!0,(xA=globalThis.litElementHydrateSupport)==null||xA.call(globalThis,{LitElement:vs});const Fl=globalThis.litElementPolyfillSupport;Fl==null||Fl({LitElement:vs}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");const JA=':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}',$A=".layer-control{bottom:.5em;left:.5em}.layer-control>button{cursor:pointer;display:flex;align-items:center;justify-content:center}.svgContainer{width:22px;height:22px;scale:.8}.ol-touch .ol-control button>.svgContainer{scale:1.2}.layer-selection{position:absolute;bottom:0;display:flex;align-items:center;border:1px solid #ccc;border-radius:4px;z-index:10;padding:10px 0 10px 10px;background-color:#fff}.layer-selection.fade-out{opacity:0;transition:opacity .15s ease-out}.layer-selection.hidden{display:none}.image-box{cursor:pointer;text-align:center;width:100px;height:100px;margin-right:10px;border-radius:4px;border:2px solid #bdbdbd}.image-box.selected{border:2px solid #474747}.image-box:hover{box-shadow:0 0 6px #949494}.image-box img{pointer-events:none;width:100px;height:100px;border-radius:4px;object-fit:cover}",ot={ADD:"add",REMOVE:"remove"},vr={PROPERTYCHANGE:"propertychange"},H={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class Cs{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function em(n,e,t){let i,r;t=t||fi;let s=0,o=n.length,a=!1;for(;s>1),r=+t(n[i],e),r<0?s=i+1:(o=i,a=!r);return a?s:~s}function fi(n,e){return n>e?1:ne?-1:0}function Io(n,e,t){if(n[0]<=e)return 0;const i=n.length;if(e<=n[i-1])return i-1;if(typeof t=="function"){for(let r=1;r0?r-1:r}return i-1}if(t>0){for(let r=1;r0||o===0)})}function Cr(){return!0}function br(){return!1}function bs(){}function td(n){let e,t,i;return function(){const r=Array.prototype.slice.call(arguments);return(!t||this!==i||!Fi(r,t))&&(i=this,t=r,e=n.apply(this,arguments)),e}}function On(n){function e(){let t;try{t=n()}catch(i){return Promise.reject(i)}return t instanceof Promise?t:Promise.resolve(t)}return e()}function Ts(n){for(const e in n)delete n[e]}function rn(n){let e;for(e in n)return!1;return!e}class Tt{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class Rs extends Cs{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;const i=this.listeners_||(this.listeners_={}),r=i[e]||(i[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){const t=typeof e=="string",i=t?e:e.type,r=this.listeners_&&this.listeners_[i];if(!r)return;const s=t?new Tt(e):e;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let c=0,h=r.length;c0:!1}removeEventListener(e,t){if(!this.listeners_)return;const i=this.listeners_[e];if(!i)return;const r=i.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(i[r]=bs,++this.pendingRemovals_[e]):(i.splice(r,1),i.length===0&&delete this.listeners_[e]))}}function oe(n,e,t,i,r){if(r){const o=t;t=function(a){return n.removeEventListener(e,t),o.call(i??this,a)}}else i&&i!==n&&(t=t.bind(i));const s={target:n,type:e,listener:t};return n.addEventListener(e,t),s}function Po(n,e,t,i){return oe(n,e,t,i,!0)}function ve(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),Ts(n))}class Ss extends Rs{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(H.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){const i=e.length,r=new Array(i);for(let s=0;s0;)this.pop()}extend(e){for(let t=0,i=e.length;tthis.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new Mo(ot.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){const t=this.array_;for(let i=0,r=t.length;i=this.getLength())return;const t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new Mo(ot.REMOVE,t,e)),t}setAt(e,t){const i=this.getLength();if(e>=i){this.insertAt(e,t);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t,e);const r=this.array_[e];this.array_[e]=t,this.dispatchEvent(new Mo(ot.REMOVE,r,e)),this.dispatchEvent(new Mo(ot.ADD,t,e))}updateLength_(){this.set(nd.LENGTH,this.array_.length)}assertUnique_(e,t){for(let i=0,r=this.array_.length;i{this.clickTimeoutId_=void 0;const i=new Li(ae.SINGLECLICK,this.map_,e);this.dispatchEvent(i)},250)}updateActivePointers_(e){const t=e,i=t.pointerId;if(t.type==ae.POINTERUP||t.type==ae.POINTERCANCEL){delete this.trackedTouches_[i];for(const r in this.trackedTouches_)if(this.trackedTouches_[r].target!==t.target){delete this.trackedTouches_[r];break}}else(t.type==ae.POINTERDOWN||t.type==ae.POINTERMOVE)&&(this.trackedTouches_[i]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const t=new Li(ae.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(ve),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);const t=new Li(ae.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);if(this.dispatchEvent(t),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,"target",{writable:!1,value:e.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(oe(i,ae.POINTERMOVE,this.handlePointerMove_,this),oe(i,ae.POINTERUP,this.handlePointerUp_,this),oe(this.element_,ae.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(oe(this.element_.getRootNode(),ae.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const t=new Li(ae.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;const t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new Li(ae.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){const t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&(typeof e.cancelable!="boolean"||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(ve(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(H.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(ve(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(ve),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const sn={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},at={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},G={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function ge(n,e){if(!n)throw new Error(e)}const Fo=1/0;class hm{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Ts(this.queuedElements_)}dequeue(){const e=this.elements_,t=this.priorities_,i=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));const r=this.keyFunction_(i);return delete this.queuedElements_[r],i}enqueue(e){ge(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const t=this.priorityFunction_(e);return t!=Fo?(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){const t=this.elements_,i=this.priorities_,r=t.length,s=t[e],o=i[e],a=e;for(;e>1;){const l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),h=ce;){const a=this.getParentIndex_(t);if(r[a]>o)i[t]=i[a],r[t]=r[a],t=a;else break}i[t]=s,r[t]=o}reprioritize(){const e=this.priorityFunction_,t=this.elements_,i=this.priorities_;let r=0;const s=t.length;let o,a,l;for(a=0;ae.apply(null,i),i=>i[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){const t=super.enqueue(e);return t&&e[0].addEventListener(H.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){const t=e.target,i=t.getState();if(i===G.LOADED||i===G.ERROR||i===G.EMPTY){i!==G.ERROR&&t.removeEventListener(H.CHANGE,this.boundHandleTileChange_);const r=t.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let i=0;for(;this.tilesLoading_0;){const r=this.dequeue()[0],s=r.getKey();r.getState()===G.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,r.load())}}}function um(n,e,t,i,r){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return Fo;const s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}const ke={ANIMATING:0,INTERACTING:1},$t={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Pe(n,e,t){return Math.min(Math.max(n,e),t)}function dm(n,e,t,i,r,s){const o=r-t,a=s-i;if(o!==0||a!==0){const l=((n-t)*o+(e-i)*a)/(o*o+a*a);l>1?(t=r,i=s):l>0&&(t+=o*l,i+=a*l)}return ki(n,e,t,i)}function ki(n,e,t,i){const r=t-n,s=i-e;return r*r+s*s}function fm(n){const e=n.length;for(let i=0;is&&(s=l,r=a)}if(s===0)return null;const o=n[r];n[r]=n[i],n[i]=o;for(let a=i+1;a=0;i--){t[i]=n[i][e]/n[i][i];for(let r=i-1;r>=0;r--)n[r][e]-=n[r][i]*t[i]}return t}function ld(n){return n*180/Math.PI}function on(n){return n*Math.PI/180}function an(n,e){const t=n%e;return t*e<0?t+e:t}function Rt(n,e,t){return n+t*(e-n)}function Is(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function Lo(n,e){return Math.floor(Is(n,e))}function ln(n,e){return Math.ceil(Is(n,e))}function Dl(n,e,t){if(n>=e&&ng&&(d=(g+d)/2,g=d),f>p&&(f=(p+f)/2,p=f);let A=Pe(i[0],d,g),m=Pe(i[1],f,p);if(o&&t&&r){const y=30*r;A+=-y*Math.log(1+Math.max(0,d-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-g)/y),m+=-y*Math.log(1+Math.max(0,f-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-p)/y)}return[A,m]}}function gm(n){return n}const et={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function ht(n){const e=St();for(let t=0,i=n.length;tr&&(l=l|et.RIGHT),as&&(l=l|et.ABOVE),l===et.UNKNOWN&&(l=et.INTERSECTING),l}function St(){return[1/0,1/0,-1/0,-1/0]}function Ai(n,e,t,i,r){return r?(r[0]=n,r[1]=e,r[2]=t,r[3]=i,r):[n,e,t,i]}function Rr(n){return Ai(1/0,1/0,-1/0,-1/0,n)}function Ps(n,e){const t=n[0],i=n[1];return Ai(t,i,t,i,e)}function Bl(n,e,t,i,r){const s=Rr(r);return ud(s,n,e,t,i)}function Gi(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function Nl(n,e){return e[0]n[2]&&(n[2]=e[2]),e[1]n[3]&&(n[3]=e[3]),n}function Ms(n,e){e[0]n[2]&&(n[2]=e[0]),e[1]n[3]&&(n[3]=e[1])}function ud(n,e,t,i,r){for(;te[0]?i[0]=n[0]:i[0]=e[0],n[1]>e[1]?i[1]=n[1]:i[1]=e[1],n[2]=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function jn(n){return n[2]=o&&p<=l),!i&&s&et.RIGHT&&!(r&et.RIGHT)&&(A=g-(d-l)*f,i=A>=a&&A<=c),!i&&s&et.BELOW&&!(r&et.BELOW)&&(p=d-(g-a)/f,i=p>=o&&p<=l),!i&&s&et.LEFT&&!(r&et.LEFT)&&(A=g-(d-o)*f,i=A>=a&&A<=c)}return i}function xm(n,e,t,i){if(jn(n))return Rr(t);let r=[];r=[n[0],n[1],n[2],n[1],n[2],n[3],n[0],n[3]],e(r,r,2);const s=[],o=[];for(let a=0,l=r.length;a=t[2])){const r=ne(t),o=Math.floor((i[0]-t[0])/r)*r;n[0]-=o,n[2]-=o}return n}function zl(n,e,t){if(e.canWrapX()){const i=e.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[i[0],n[1],i[2],n[3]]];fd(n,e);const r=ne(i);if(ne(n)>r&&!t)return[[i[0],n[1],i[2],n[3]]];if(n[0]i[2])return[[n[0],n[1],i[2],n[3]],[i[0],n[1],n[2]-r,n[3]]]}return[n]}function Em(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function gd(n,e){const t=n[0],i=n[1],r=e[0],s=e[1],o=r[0],a=r[1],l=s[0],c=s[1],h=l-o,u=c-a,d=h===0&&u===0?0:(h*(t-o)+u*(i-a))/(h*h+u*u||0);let g,f;return d<=0?(g=o,f=a):d>=1?(g=l,f=c):(g=o+d*h,f=a+d*u),[g,f]}function dt(n,e){let t=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=e[i]){t=!1;break}return t}function Ul(n,e){const t=Math.cos(e),i=Math.sin(e),r=n[0]*t-n[1]*i,s=n[1]*t+n[0]*i;return n[0]=r,n[1]=s,n}function wm(n,e){return n[0]*=e,n[1]*=e,n}function Sr(n,e){const t=n[0]-e[0],i=n[1]-e[1];return t*t+i*i}function Ls(n,e){return Math.sqrt(Sr(n,e))}function vm(n,e){return Sr(n,gd(n,e))}function Vl(n,e){if(e.canWrapX()){const t=ne(e.getExtent()),i=Cm(n,e,t);i&&(n[0]-=i*t)}return n}function Cm(n,e,t){const i=e.getExtent();let r=0;return e.canWrapX()&&(n[0]i[2])&&(t=t||ne(i),r=Math.floor((n[0]-i[0])/t)),r}function pd(n){return Math.pow(n,3)}function Ir(n){return 1-pd(1-n)}function bm(n){return 3*n*n-2*n*n*n}function Tm(n){return n}const Rm=63710088e-1;function Ad(n,e,t){t=t||Rm;const i=on(n[1]),r=on(e[1]),s=(r-i)/2,o=on(e[0]-n[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(r);return 2*t*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function md(...n){console.warn(...n)}const cn={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Bo{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||cn[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const ks=6378137,Pr=Math.PI*ks,Sm=[-Pr,-Pr,Pr,Pr],Im=[-180,-85,180,85],No=ks*Math.log(Math.tan(Math.PI/2));class Mr extends Bo{constructor(e){super({code:e,units:"m",extent:Sm,global:!0,worldExtent:Im,getPointResolution:function(t,i){return t/Math.cosh(i[1]/ks)}})}}const yd=[new Mr("EPSG:3857"),new Mr("EPSG:102100"),new Mr("EPSG:102113"),new Mr("EPSG:900913"),new Mr("http://www.opengis.net/def/crs/EPSG/0/3857"),new Mr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Pm(n,e,t,i){const r=n.length;t=t>1?t:2,i=i??t,e===void 0&&(t>2?e=n.slice():e=new Array(r));for(let s=0;sNo?o=No:o<-No&&(o=-No),e[s+1]=o}return e}function Mm(n,e,t,i){const r=n.length;t=t>1?t:2,i=i??t,e===void 0&&(t>2?e=n.slice():e=new Array(r));for(let s=0;sTd&&(e=Td);const i=on(e),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,c=on(n),h=Rd(t.number),u=on(h),d=Vo/Math.sqrt(1-Bt*r**2),g=Un*s**2,f=s*Dl(c-u,-Math.PI,Math.PI),p=f*f,A=p*f,m=A*f,y=m*f,E=y*f,x=Vo*(Cd*i-Om*Math.sin(2*i)+Gm*Math.sin(4*i)-Bm*Math.sin(6*i)),_=jo*d*(f+A/6*(1-a+g)+y/120*(5-18*a+l+72*g-58*Un))+5e5;let w=jo*(x+d*o*(p/2+m/24*(5-a+9*g+4*g**2)+E/720*(61-58*a+l+600*g-330*Un)));return t.north||(w+=1e7),[_,w]}function Rd(n){return(n-1)*6-180+3}const Ym=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Sd(n){let e=0;for(const r of Ym){const s=n.match(r);if(s){e=parseInt(s[1]);break}}if(!e)return null;let t=0,i=!1;return e>32700&&e<32761?t=e-32700:e>32600&&e<32661&&(i=!0,t=e-32600),t?{number:t,north:i}:null}function Id(n,e){return function(t,i,r,s){const o=t.length;r=r>1?r:2,s=s??r,i||(r>2?i=t.slice():i=new Array(o));for(let a=0;a=l?e[o+c]:a[c]}return t}}function Wo(n,e){return Pd(),Ho(n,"EPSG:4326",e!==void 0?e:"EPSG:3857")}function Fd(n,e){const t=Ho(n,"EPSG:3857","EPSG:4326"),i=t[0];return(i<-180||i>180)&&(t[0]=an(i+180,360)-180),t}function ti(n,e){if(n===e)return!0;const t=n.getUnits()===e.getUnits();return(n.getCode()===e.getCode()||Os(n,e)===Zl)&&t}function Os(n,e){const t=n.getCode(),i=e.getCode();let r=Hl(t,i);if(r)return r;let s=null,o=null;for(const l of Qm)s||(s=l(n)),o||(o=l(e));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=$l(s.inverse,o.forward);else{const l=Hl(t,a);l&&(r=$l(l,o.forward))}else{const l=Hl(a,i);l&&(r=$l(s.inverse,l))}return r&&(Ql(n),Ql(e),Ds(n,e,r)),r}function $l(n,e){return function(t,i,r,s){return i=n(t,i,r,s),e(i,i,r,s)}}function Gs(n,e){const t=pe(n),i=pe(e);return Os(t,i)}function Ho(n,e,t){const i=Gs(e,t);if(!i){const r=pe(e).getCode(),s=pe(t).getCode();throw new Error(`No transform available between ${r} and ${s}`)}return i(n,void 0,n.length)}let ty=null;function iy(){return ty}function Vn(n,e){return n}function Ne(n,e){return Kl&&!dt(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Kl=!1,md("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function Xo(n,e){return n}function ii(n,e){return n}function ny(){Md(yd),Md(xd),$m(xd,yd,Pm,Mm)}ny();const Ld=new Array(6);function mt(){return[1,0,0,1,0,0]}function kd(n){return tc(n,1,0,0,1,0,0)}function ec(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=n[4],a=n[5],l=e[0],c=e[1],h=e[2],u=e[3],d=e[4],g=e[5];return n[0]=t*l+r*c,n[1]=i*l+s*c,n[2]=t*h+r*u,n[3]=i*h+s*u,n[4]=t*d+r*g+o,n[5]=i*d+s*g+a,n}function tc(n,e,t,i,r,s,o){return n[0]=e,n[1]=t,n[2]=i,n[3]=r,n[4]=s,n[5]=o,n}function ry(n,e){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n}function Ye(n,e){const t=e[0],i=e[1];return e[0]=n[0]*t+n[2]*i+n[4],e[1]=n[1]*t+n[3]*i+n[5],e}function ic(n,e,t){return ec(n,tc(Ld,e,0,0,t,0,0))}function sy(n,e,t){return ec(n,tc(Ld,1,0,0,1,e,t))}function mi(n,e,t,i,r,s,o,a){const l=Math.sin(s),c=Math.cos(s);return n[0]=i*c,n[1]=r*l,n[2]=-i*l,n[3]=r*c,n[4]=o*i*c-a*i*l+e,n[5]=o*r*l+a*r*c+t,n}function Dd(n,e){const t=oy(e);ge(t!==0,"Transformation matrix cannot be inverted");const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5];return n[0]=o/t,n[1]=-r/t,n[2]=-s/t,n[3]=i/t,n[4]=(s*l-o*a)/t,n[5]=-(i*l-r*a)/t,n}function oy(n){return n[0]*n[3]-n[1]*n[2]}const ay=[1e5,1e5,1e5,1e5,2,2];function ly(n){return"matrix("+n.join(", ")+")"}function Od(n){return n.substring(7,n.length-1).split(",").map(parseFloat)}function cy(n,e){const t=Od(n),i=Od(e);for(let r=0;r<6;++r)if(Math.round((t[r]-i[r])*ay[r])!==0)return!1;return!0}function hn(n,e,t,i,r,s,o){s=s||[],o=o||2;let a=0;for(let l=e;l{if(!i)return this.getSimplifiedGeometry(t);const r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return Q()}closestPointXY(e,t,i,r){return Q()}containsXY(e,t){return this.closestPointXY(e,t,dy,Number.MIN_VALUE)===0}getClosestPoint(e,t){return t=t||[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return Q()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&Rr(t),this.extentRevision_=this.getRevision()}return ym(this.extent_,e)}rotate(e,t){Q()}scale(e,t,i){Q()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return Q()}getType(){return Q()}applyTransform(e){Q()}intersectsExtent(e){return Q()}translate(e,t){Q()}transform(e,t){const i=pe(e),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),c=i.getWorldExtent(),h=De(c)/De(l);mi(Gd,c[0],c[3],h,-h,0,0,0);const u=hn(s,0,s.length,a,Gd,o),d=Gs(i,t);return d?d(u,u,a):u}:Gs(i,t);return this.applyTransform(r),this}}class un extends Bd{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return Bl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return Q()}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(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length1)u=t;else if(d>0){for(let g=0;gr&&(r=c),s=a,o=l}return r}function sc(n,e,t,i,r){for(let s=0,o=t.length;s0;){const u=c.pop(),d=c.pop();let g=0;const f=n[d],p=n[d+1],A=n[u],m=n[u+1];for(let y=d+i;yg&&(h=y,g=_)}g>r&&(l[(h-e)/i]=1,d+i0&&p>g)&&(f<0&&A0&&A>f)){c=u,h=d;continue}s[o++]=c,s[o++]=h,a=c,l=h,c=u,h=d}return s[o++]=c,s[o++]=h,o}function cc(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;ls&&(c-a)*(s-l)-(r-a)*(h-l)>0&&o++:h<=s&&(c-a)*(s-l)-(r-a)*(h-l)<0&&o--,a=c,l=h}return o!==0}function hc(n,e,t,i,r,s){if(t.length===0||!Xn(n,e,t[0],i,r,s))return!1;for(let o=1,a=t.length;om&&(c=(h+u)/2,hc(n,e,t,i,c,f)&&(A=c,m=y)),h=u}return isNaN(A)&&(A=r[s]),o?(o.push(A,f,m),o):[A,f,m]}function Hd(n,e,t,i,r){let s=[];for(let o=0,a=t.length;o=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Xd(n,e,t,i,function(o,a){return _m(r,o,a)}):!1}function Ey(n,e,t,i,r){for(let s=0,o=t.length;s0}function fc(n,e,t,i,r){r=r!==void 0?r:!1;for(let s=0,o=t.length;sh&&d1&&typeof arguments[t-1]=="function"&&(i=arguments[t-1],--t);let r=0;for(;r0}getInteracting(){return this.hints_[ke.INTERACTING]>0}cancelAnimations(){this.setHint(ke.ANIMATING,-this.hints_[ke.ANIMATING]);let e;for(let t=0,i=this.animations_.length;t=0;--i){const r=this.animations_[i];let s=!0;for(let o=0,a=r.length;o0?c/l.duration:1;h>=1?(l.complete=!0,h=1):s=!1;const u=l.easing(h);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 A=d+u*(f-d),m=g+u*(p-g);this.targetCenter_=[A,m]}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),t=!0,!l.complete)break}if(s){this.animations_[i]=null,this.setHint(ke.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=r[0].callback;o&&Jo(o,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let i;const r=this.getCenterInternal();return r!==void 0&&(i=[r[0]-t[0],r[1]-t[1]],Ul(i,e-this.getRotation()),Em(i,t)),i}calculateCenterZoom(e,t){let i;const r=this.getCenterInternal(),s=this.getResolution();if(r!==void 0&&s!==void 0){const o=t[0]-e*(t[0]-r[0])/s,a=t[1]-e*(t[1]-r[1])/s;i=[o,a]}return i}getViewportSize_(e){const t=this.viewportSize_;if(e){const i=t[0],r=t[1];return[Math.abs(i*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(i*Math.sin(e))+Math.abs(r*Math.cos(e))]}return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const e=this.getCenterInternal();return e&&Vn(e,this.getProjection())}getCenterInternal(){return this.get($t.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return e!==void 0?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){const t=this.calculateExtentInternal(e);return Xo(t,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const t=this.getCenterInternal();ge(t,"The view center is not defined");const i=this.getResolution();ge(i!==void 0,"The view resolution is not defined");const r=this.getRotation();return ge(r!==void 0,"The view rotation is not defined"),Oo(t,i,r,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get($t.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(ii(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t=t||this.getViewportSizeMinusPadding_();const i=ne(e)/t[0],r=De(e)/t[1];return Math.max(i,r)}getResolutionForValueFunction(e){e=e||2;const t=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(t/i)/Math.log(e);return function(s){return t/Math.pow(e,s*r)}}getRotation(){return this.get($t.ROTATION)}getValueForResolutionFunction(e){const t=Math.log(e||2),i=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,s=Math.log(i/r)/t;return function(o){return Math.log(i/o)/t/s}}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e);const i=this.padding_;return i&&(t=[t[0]-i[1]-i[3],t[1]-i[0]-i[2]]),t}getState(){const e=this.getProjection(),t=this.getResolution(),i=this.getRotation();let r=this.getCenterInternal();const s=this.padding_;if(s){const o=this.getViewportSizeMinusPadding_();r=Ec(r,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],t,i)}return{center:r.slice(0),projection:e!==void 0?e:null,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e;const t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,i,r;if(this.resolutions_){const s=Io(this.resolutions_,e,1);t=s,i=this.resolutions_[s],s==this.resolutions_.length-1?r=2:r=i/this.resolutions_[s+1]}else i=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(i/e)/Math.log(r)}getResolutionForZoom(e){var t;if((t=this.resolutions_)!=null&&t.length){if(this.resolutions_.length===1)return this.resolutions_[0];const i=Pe(Math.floor(e),0,this.resolutions_.length-2),r=this.resolutions_[i]/this.resolutions_[i+1];return this.resolutions_[i]/Math.pow(r,Pe(e-i,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,t){let i;if(ge(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){ge(!jn(e),"Cannot fit empty extent provided as `geometry`");const r=ii(e,this.getProjection());i=Qd(r)}else if(e.getType()==="Circle"){const r=ii(e.getExtent(),this.getProjection());i=Qd(r),i.rotate(this.getRotation(),It(r))}else i=e;this.fitInternal(i,t)}rotatedExtentForGeometry(e){const t=this.getRotation(),i=Math.cos(t),r=Math.sin(-t),s=e.getFlatCoordinates(),o=e.getStride();let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let u=0,d=s.length;ur.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(r=>i.add(r)):i.add(this.attributions_)),!this.overrideCollapsible_){const r=!t.some(s=>{var o;return((o=s.getSource())==null?void 0:o.getAttributionsCollapsible())===!1});this.setCollapsible(r)}return Array.from(i)}async updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const t=await Promise.all(this.collectSourceAttributions_(e).map(r=>On(()=>r))),i=t.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Fi(t,this.renderedAttributions_)){Ly(this.ulElement_);for(let r=0,s=t.length;r0&&i%(2*Math.PI)!==0?t.animate({rotation:0,duration:this.duration_,easing:Ir}):t.setRotation(0))}render(e){const t=e.frameState;if(!t)return;const i=t.viewState.rotation;if(i!=this.rotation_){const r="rotate("+i+"rad)";if(this.autoHide_){const s=this.element.classList.contains($o);!s&&i===0?this.element.classList.add($o):s&&i!==0&&this.element.classList.remove($o)}this.label_.style.transform=r}this.rotation_=i}}class Oy extends ia{constructor(e){e=e||{},super({element:document.createElement("div"),target:e.target});const t=e.className!==void 0?e.className:"ol-zoom",i=e.delta!==void 0?e.delta:1,r=e.zoomInClassName!==void 0?e.zoomInClassName:t+"-in",s=e.zoomOutClassName!==void 0?e.zoomOutClassName:t+"-out",o=e.zoomInLabel!==void 0?e.zoomInLabel:"+",a=e.zoomOutLabel!==void 0?e.zoomOutLabel:"–",l=e.zoomInTipLabel!==void 0?e.zoomInTipLabel:"Zoom in",c=e.zoomOutTipLabel!==void 0?e.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=r,h.setAttribute("type","button"),h.title=l,h.appendChild(typeof o=="string"?document.createTextNode(o):o),h.addEventListener(H.CLICK,this.handleClick_.bind(this,i),!1);const u=document.createElement("button");u.className=s,u.setAttribute("type","button"),u.title=c,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(H.CLICK,this.handleClick_.bind(this,-i),!1);const d=t+" "+ea+" "+wc,g=this.element;g.className=d,g.appendChild(h),g.appendChild(u),this.duration_=e.duration!==void 0?e.duration:250}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){const i=this.getMap().getView();if(!i)return;const r=i.getZoom();if(r!==void 0){const s=i.getConstrainedZoom(r+e);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:Ir})):i.setZoom(s)}}}function of(n){n=n||{};const e=new Gt;return(n.zoom!==void 0?n.zoom:!0)&&e.push(new Oy(n.zoomOptions)),(n.rotate!==void 0?n.rotate:!0)&&e.push(new Dy(n.rotateOptions)),(n.attribution!==void 0?n.attribution:!0)&&e.push(new sf(n.attributionOptions)),e}class Gy{constructor(e,t,i){this.decay_=e,this.minVelocity_=t,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;const e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]0&&this.points_[i+2]>e;)i-=3;const r=this.points_[t+2]-this.points_[i+2];if(r<1e3/60)return!1;const s=this.points_[t]-this.points_[i],o=this.points_[t+1]-this.points_[i+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const Cc={ACTIVE:"active"};class fn extends pi{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(Cc.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Cc.ACTIVE,e)}setMap(e){this.map_=e}}function By(n,e,t){const i=n.getCenterInternal();if(i){const r=[i[0]+e[0],i[1]+e[1]];n.animateInternal({duration:t!==void 0?t:250,easing:Tm,center:n.getConstrainedCenter(r)})}}function bc(n,e,t,i){const r=n.getZoom();if(r===void 0)return;const s=n.getConstrainedZoom(r+e),o=n.getResolutionForZoom(s);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:o,anchor:t,duration:i!==void 0?i:250,easing:Ir})}class Ny extends fn{constructor(e){super(),e=e||{},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:250}handleEvent(e){let t=!1;if(e.type==ae.DBLCLICK){const i=e.originalEvent,r=e.map,s=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();bc(a,o,s,this.duration_),i.preventDefault(),t=!0}return!t}}function Tc(n){const e=arguments;return function(t){let i=!0;for(let r=0,s=e.length;r0}}else if(e.type==ae.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,t=this.stopDown(i)}else e.type==ae.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}}function Ic(n){const e=n.length;let t=0,i=0;for(let r=0;r0&&this.condition_(e)){const i=e.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class Yy extends Yn{constructor(e){e=e||{},super({stopDown:br}),this.condition_=e.condition?e.condition:zy,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!Rc(e))return;const t=e.map,i=t.getView();if(i.getConstraints().rotation===yc)return;const r=t.getSize(),s=e.pixel,o=Math.atan2(r[1]/2-s[1],s[0]-r[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(e){return Rc(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return Rc(e)&&lf(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class Ky extends Cs{constructor(e){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const e=this.startPixel_,t=this.endPixel_,i="px",r=this.element_.style;r.left=Math.min(e[0],t[0])+i,r.top=Math.min(e[1],t[1])+i,r.width=Math.abs(t[0]-e[0])+i,r.height=Math.abs(t[1]-e[1])+i}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const e=this.startPixel_,t=this.endPixel_,r=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new Nt([r])}getGeometry(){return this.geometry_}}const kr={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Us extends Tt{constructor(e,t,i){super(e),this.coordinate=t,this.mapBrowserEvent=i}}class Zy extends Yn{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new Ky(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??lf,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,i){const r=i[0]-t[0],s=i[1]-t[1];return r*r+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new Us(kr.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;const t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new Us(t?kr.BOXEND:kr.BOXCANCEL,e.coordinate,e)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Us(kr.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Us(kr.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Us(kr.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}}class Qy extends Zy{constructor(e){e=e||{};const t=e.condition?e.condition:cf;super({condition:t,className:e.className||"ol-dragzoom",minArea:e.minArea}),this.duration_=e.duration!==void 0?e.duration:200,this.out_=e.out!==void 0?e.out:!1}onBoxEnd(e){const i=this.getMap().getView();let r=this.getGeometry();if(this.out_){const s=i.rotatedExtentForGeometry(r),o=i.getResolutionForExtentInternal(s),a=i.getResolution()/o;r=r.clone(),r.scale(a*a)}i.fitInternal(r,{duration:this.duration_,easing:Ir})}}const Kn={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class qy extends fn{constructor(e){super(),e=e||{},this.defaultCondition_=function(t){return ra(t)&&hf(t)},this.condition_=e.condition!==void 0?e.condition:this.defaultCondition_,this.duration_=e.duration!==void 0?e.duration:100,this.pixelDelta_=e.pixelDelta!==void 0?e.pixelDelta:128}handleEvent(e){let t=!1;if(e.type==H.KEYDOWN){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==Kn.DOWN||r==Kn.LEFT||r==Kn.RIGHT||r==Kn.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;r==Kn.DOWN?c=-a:r==Kn.LEFT?l=-a:r==Kn.RIGHT?l=a:c=a;const h=[l,c];Ul(h,o.getRotation()),By(o,h,this.duration_),i.preventDefault(),t=!0}}return!t}}class Jy extends fn{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(t){return!Hy(t)&&hf(t)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration!==void 0?e.duration:100}handleEvent(e){let t=!1;if(e.type==H.KEYDOWN||e.type==H.KEYPRESS){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==="+"||r==="-")){const s=e.map,o=r==="+"?this.delta_:-this.delta_,a=s.getView();bc(a,o,void 0,this.duration_),i.preventDefault(),t=!0}}return!t}}class $y extends fn{constructor(e){e=e||{},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta!==void 0?e.maxDelta:1,this.duration_=e.duration!==void 0?e.duration:250,this.timeout_=e.timeout!==void 0?e.timeout:80,this.useAnchor_=e.useAnchor!==void 0?e.useAnchor:!0,this.constrainResolution_=e.constrainResolution!==void 0?e.constrainResolution:!1;const t=e.condition?e.condition:na;this.condition_=e.onFocusOnly?Tc(af,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const e=this.getMap();if(!e)return;e.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==H.WHEEL)return!0;const i=e.map,r=e.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let s;if(e.type==H.WHEEL&&(s=r.deltaY,r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)),s===0)return!1;this.lastDelta_=s;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");const a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=s;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(e){const t=e.getView();t.getAnimating()&&t.cancelAnimations();let i=-Pe(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),bc(t,i,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}}class e0 extends Yn{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=br),super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold!==void 0?e.threshold:.3,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){let t=0;const i=this.targetPointers[0],r=this.targetPointers[1],s=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(this.lastAngle_!==void 0){const l=s-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=l}this.lastAngle_=s;const o=e.map,a=o.getView();a.getConstraints().rotation!==yc&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(Ic(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(t,this.anchor_)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}}class t0 extends Yn{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=br),super(t),this.anchor_=null,this.duration_=e.duration!==void 0?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1;const i=this.targetPointers[0],r=this.targetPointers[1],s=i.clientX-r.clientX,o=i.clientY-r.clientY,a=Math.sqrt(s*s+o*o);this.lastDistance_!==void 0&&(t=this.lastDistance_/a),this.lastDistance_=a;const l=e.map,c=l.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(Ic(this.targetPointers))),l.render(),c.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){const i=e.map.getView(),r=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,r),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){const t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}}function i0(n){n=n||{};const e=new Gt,t=new Gy(-.005,.05,100);return(n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0)&&e.push(new Yy),(n.doubleClickZoom!==void 0?n.doubleClickZoom:!0)&&e.push(new Ny({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan!==void 0?n.dragPan:!0)&&e.push(new Xy({onFocusOnly:n.onFocusOnly,kinetic:t})),(n.pinchRotate!==void 0?n.pinchRotate:!0)&&e.push(new e0),(n.pinchZoom!==void 0?n.pinchZoom:!0)&&e.push(new t0({duration:n.zoomDuration})),(n.keyboard!==void 0?n.keyboard:!0)&&(e.push(new qy),e.push(new Jy({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0)&&e.push(new $y({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom!==void 0?n.shiftDragZoom:!0)&&e.push(new Qy({duration:n.zoomDuration})),e}const we={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};class uf extends pi{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;const t=Object.assign({},e);typeof e.properties=="object"&&(delete t.properties,Object.assign(t,e.properties)),t[we.OPACITY]=e.opacity!==void 0?e.opacity:1,ge(typeof t[we.OPACITY]=="number","Layer opacity must be a number"),t[we.VISIBLE]=e.visible!==void 0?e.visible:!0,t[we.Z_INDEX]=e.zIndex,t[we.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,t[we.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,t[we.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,t[we.MAX_ZOOM]=e.maxZoom!==void 0?e.maxZoom:1/0,this.className_=t.className!==void 0?t.className:"ol-layer",delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){const t=this.state_||{layer:this,managed:e===void 0?!0:e},i=this.getZIndex();return t.opacity=Pe(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=i===void 0&&!t.managed?1/0:i,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),t.minZoom=this.getMinZoom(),t.maxZoom=this.getMaxZoom(),this.state_=t,t}getLayersArray(e){return Q()}getLayerStatesArray(e){return Q()}getExtent(){return this.get(we.EXTENT)}getMaxResolution(){return this.get(we.MAX_RESOLUTION)}getMinResolution(){return this.get(we.MIN_RESOLUTION)}getMinZoom(){return this.get(we.MIN_ZOOM)}getMaxZoom(){return this.get(we.MAX_ZOOM)}getOpacity(){return this.get(we.OPACITY)}getSourceState(){return Q()}getVisible(){return this.get(we.VISIBLE)}getZIndex(){return this.get(we.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(we.EXTENT,e)}setMaxResolution(e){this.set(we.MAX_RESOLUTION,e)}setMinResolution(e){this.set(we.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(we.MAX_ZOOM,e)}setMinZoom(e){this.set(we.MIN_ZOOM,e)}setOpacity(e){ge(typeof e=="number","Layer opacity must be a number"),this.set(we.OPACITY,e)}setVisible(e){this.set(we.VISIBLE,e)}setZIndex(e){this.set(we.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}class gn extends Tt{constructor(e,t){super(e),this.layer=t}}const Pc={LAYERS:"layers"};class Bi extends uf{constructor(e){e=e||{};const t=Object.assign({},e);delete t.layers;let i=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Pc.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Gt(i.slice(),{unique:!0}):ge(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Gt(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(ve),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(oe(e,ot.ADD,this.handleLayersAdd_,this),oe(e,ot.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(ve);Ts(this.listenerKeys_);const t=e.getArray();for(let i=0,r=t.length;i{this.dispatchEvent("sourceready")},0)),this.clearRenderer()),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}isVisible(e){let t;const i=this.getMapInternal();!e&&i&&(e=i.getView()),e instanceof yi?t={viewState:e.getState(),extent:e.calculateExtent()}:t=e,!t.layerStatesArray&&i&&(t.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let r;if(t.layerStatesArray){if(r=t.layerStatesArray.find(o=>o.layer===this),!r)return!1}else r=this.getLayerState();const s=this.getExtent();return Mc(r,t.viewState)&&(!s||Be(s,t.extent))}getAttributions(e){var s;if(!this.isVisible(e))return[];const t=(s=this.getSource())==null?void 0:s.getAttributions();if(!t)return[];const i=e instanceof yi?e.getViewStateAndExtent():e;let r=t(i);return Array.isArray(r)||(r=[r]),r}render(e,t){const i=this.getRenderer();return i.prepareFrame(e)?(this.rendered=!0,i.renderFrame(e,t)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,t){}renderDeferred(e){const t=this.getRenderer();t&&t.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(we.MAP,e)}getMapInternal(){return this.get(we.MAP)}setMap(e){this.mapPrecomposeKey_&&(ve(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(ve(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=oe(e,jt.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=oe(this,H.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){const t=e.frameState.layerStatesArray,i=this.getLayerState(!1);ge(!t.some(r=>r.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),t.push(i)}setSource(e){this.set(we.SOURCE,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}}function Mc(n,e){if(!n.visible)return!1;const t=e.resolution;if(t=n.maxResolution)return!1;const i=e.zoom;return i>n.minZoom&&i<=n.maxZoom}function df(n,e,t=0,i=n.length-1,r=n0){for(;i>t;){if(i-t>600){const l=i-t+1,c=e-t+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),g=Math.max(t,Math.floor(e-c*u/l+d)),f=Math.min(i,Math.floor(e+(l-c)*u/l+d));df(n,e,g,f,r)}const s=n[e];let o=t,a=i;for(Vs(n,t,e),r(n[i],s)>0&&Vs(n,t,i);o0;)a--}r(n[t],s)===0?Vs(n,t,a):(a++,Vs(n,a,i)),a<=e&&(t=a+1),e<=a&&(i=a-1)}}function Vs(n,e,t){const i=n[e];n[e]=n[t],n[t]=i}function n0(n,e){return ne?1:0}let ff=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const i=[];if(!oa(e,t))return i;const r=this.toBBox,s=[];for(;t;){for(let o=0;o=0&&s[t].children.length>this._maxEntries;)this._split(s,t),t--;this._adjustParentBBoxes(r,s,t)}_split(e,t){const i=e[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);const o=this._chooseSplitIndex(i,s,r),a=Gr(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,Or(i,this.toBBox),Or(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=Gr([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Or(this.data,this.toBBox)}_chooseSplitIndex(e,t,i){let r,s=1/0,o=1/0;for(let a=t;a<=i-t;a++){const l=Ws(e,0,a,this.toBBox),c=Ws(e,a,i,this.toBBox),h=l0(l,c),u=Fc(l)+Fc(c);h=t;c--){const h=e.children[c];Hs(a,e.leaf?s(h):h),l+=sa(a)}return l}_adjustParentBBoxes(e,t,i){for(let r=i;r>=0;r--)Hs(t[r],e)}_condense(e){for(let t=e.length-1,i;t>=0;t--)e[t].children.length===0?t>0?(i=e[t-1].children,i.splice(i.indexOf(e[t]),1)):this.clear():Or(e[t],this.toBBox)}};function r0(n,e,t){if(!t)return e.indexOf(n);for(let i=0;i=n.minX&&e.maxY>=n.minY}function Gr(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function gf(n,e,t,i,r){const s=[e,t];for(;s.length;){if(t=s.pop(),e=s.pop(),t-e<=i)continue;const o=e+Math.ceil((t-e)/i/2)*i;df(n,o,e,t,r),s.push(e,o,o,t)}}const kc=[NaN,NaN,NaN,0];let Dc;function c0(){return Dc||(Dc=Fe(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),Dc}const h0=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,u0=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,d0=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,f0=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function aa(n,e){return n.endsWith("%")?Number(n.substring(0,n.length-1))/e:Number(n)}function Xs(n){throw new Error('failed to parse "'+n+'" as color')}function pf(n){if(n.toLowerCase().startsWith("rgb")){const s=n.match(u0)||n.match(h0)||n.match(d0);if(s){const o=s[4],a=100/255;return[Pe(aa(s[1],a)+.5|0,0,255),Pe(aa(s[2],a)+.5|0,0,255),Pe(aa(s[3],a)+.5|0,0,255),o!==void 0?Pe(aa(o,100),0,1):1]}Xs(n)}if(n.startsWith("#")){if(f0.test(n)){const s=n.substring(1),o=s.length<=4?1:2,a=[0,0,0,255];for(let l=0,c=s.length;l.0031308?Math.pow(n,1/2.4)*269.025-14.025:n*3294.6}function Bc(n){return n>.2068965?Math.pow(n,3):(n-4/29)*(108/841)}function Nc(n){return n>10.314724?Math.pow((n+14.025)/269.025,2.4):n/3294.6}function jc(n){return n>.0088564?Math.pow(n,1/3):n/(108/841)+4/29}function Af(n){const e=Nc(n[0]),t=Nc(n[1]),i=Nc(n[2]),r=jc(e*.222488403+t*.716873169+i*.06060791),s=500*(jc(e*.452247074+t*.399439023+i*.148375274)-r),o=200*(r-jc(e*.016863605+t*.117638439+i*.865350722)),a=Math.atan2(o,s)*(180/Math.PI);return[116*r-16,Math.sqrt(s*s+o*o),a<0?a+360:a,n[3]]}function m0(n){const e=(n[0]+16)/116,t=n[1],i=n[2]*Math.PI/180,r=Bc(e),s=Bc(e+t/500*Math.cos(i)),o=Bc(e-t/200*Math.sin(i)),a=Gc(s*3.021973625-r*1.617392459-o*.404875592),l=Gc(s*-.943766287+r*1.916279586+o*.027607165),c=Gc(s*.069407491-r*.22898585+o*1.159737864);return[Pe(a+.5|0,0,255),Pe(l+.5|0,0,255),Pe(c+.5|0,0,255),n[3]]}function zc(n){if(n==="none")return kc;if(Ys.hasOwnProperty(n))return Ys[n];if(Oc>=p0){let t=0;for(const i in Ys)(t++&3)===0&&(delete Ys[i],--Oc)}const e=pf(n);e.length!==4&&Xs(n);for(const t of e)isNaN(t)&&Xs(n);return Ys[n]=e,++Oc,e}function Br(n){return Array.isArray(n)?n:zc(n)}function Uc(n){let e=n[0];e!=(e|0)&&(e=e+.5|0);let t=n[1];t!=(t|0)&&(t=t+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const r=n[3]===void 0?1:Math.round(n[3]*1e3)/1e3;return"rgba("+e+","+t+","+i+","+r+")"}function mf(n){return n[0]>0&&n[1]>0}function y0(n,e,t){return t===void 0&&(t=[0,0]),t[0]=n[0]*e+.5|0,t[1]=n[1]*e+.5|0,t}function Ke(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}let Zn=0;const ft=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",Has:"has"},w0={[F.Get]:q(te(1,1/0),_f),[F.Var]:q(te(1,1),v0),[F.Has]:q(te(1,1/0),_f),[F.Id]:q(C0,Nr),[F.Concat]:q(te(2,1/0),Ae(_t)),[F.GeometryType]:q(b0,Nr),[F.LineMetric]:q(Nr),[F.Resolution]:q(Wc,Nr),[F.Zoom]:q(Wc,Nr),[F.Time]:q(Wc,Nr),[F.Any]:q(te(2,1/0),Ae(ft)),[F.All]:q(te(2,1/0),Ae(ft)),[F.Not]:q(te(1,1),Ae(ft)),[F.Equal]:q(te(2,2),Ae(la)),[F.NotEqual]:q(te(2,2),Ae(la)),[F.GreaterThan]:q(te(2,2),Ae(le)),[F.GreaterThanOrEqualTo]:q(te(2,2),Ae(le)),[F.LessThan]:q(te(2,2),Ae(le)),[F.LessThanOrEqualTo]:q(te(2,2),Ae(le)),[F.Multiply]:q(te(2,1/0),xf),[F.Coalesce]:q(te(2,1/0),xf),[F.Divide]:q(te(2,2),Ae(le)),[F.Add]:q(te(2,1/0),Ae(le)),[F.Subtract]:q(te(2,2),Ae(le)),[F.Clamp]:q(te(3,3),Ae(le)),[F.Mod]:q(te(2,2),Ae(le)),[F.Pow]:q(te(2,2),Ae(le)),[F.Abs]:q(te(1,1),Ae(le)),[F.Floor]:q(te(1,1),Ae(le)),[F.Ceil]:q(te(1,1),Ae(le)),[F.Round]:q(te(1,1),Ae(le)),[F.Sin]:q(te(1,1),Ae(le)),[F.Cos]:q(te(1,1),Ae(le)),[F.Atan]:q(te(1,2),Ae(le)),[F.Sqrt]:q(te(1,1),Ae(le)),[F.Match]:q(te(4,1/0),Ef,R0),[F.Between]:q(te(3,3),Ae(le)),[F.Interpolate]:q(te(6,1/0),Ef,S0),[F.Case]:q(te(3,1/0),T0,I0),[F.In]:q(te(2,2),P0),[F.Number]:q(te(1,1/0),Ae(la)),[F.String]:q(te(1,1/0),Ae(la)),[F.Array]:q(te(1,1/0),Ae(le)),[F.Color]:q(te(1,4),Ae(le)),[F.Band]:q(te(1,3),Ae(le)),[F.Palette]:q(te(2,2),M0),[F.ToString]:q(te(1,1),Ae(ft|le|_t|ni))};function _f(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;se){const a=e===1/0?`${n} or more`:`${n} to ${e}`;throw new Error(`expected ${a} arguments for ${s}, got ${o}`)}}}function xf(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;si.featureId;case F.GeometryType:return i=>i.geometryType;case F.Concat:{const i=n.args.map(r=>ri(r));return r=>"".concat(...i.map(s=>s(r).toString()))}case F.Resolution:return i=>i.resolution;case F.Any:case F.All:case F.Between:case F.In:case F.Not:return O0(n);case F.Equal:case F.NotEqual:case F.LessThan:case F.LessThanOrEqualTo:case F.GreaterThan:case F.GreaterThanOrEqualTo:return D0(n);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 G0(n);case F.Case:return B0(n);case F.Match:return N0(n);case F.Interpolate:return j0(n);case F.ToString:return z0(n);default:throw new Error(`Unsupported operator ${t}`)}}function L0(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s{for(let o=0;o{for(let o=0;o{const s=n.args;let o=r.properties[i];for(let a=1,l=s.length;ar.variables[i];case F.Has:return r=>{const s=n.args;if(!(i in r.properties))return!1;let o=r.properties[i];for(let a=1,l=s.length;ai(s)===r(s);case F.NotEqual:return s=>i(s)!==r(s);case F.LessThan:return s=>i(s)i(s)<=r(s);case F.GreaterThan:return s=>i(s)>r(s);case F.GreaterThanOrEqualTo:return s=>i(s)>=r(s);default:throw new Error(`Unsupported comparison operator ${t}`)}}function O0(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s{for(let o=0;o{for(let o=0;o{const o=r[0](s),a=r[1](s),l=r[2](s);return o>=a&&o<=l};case F.In:return s=>{const o=r[0](s);for(let a=1;a!r[0](s);default:throw new Error(`Unsupported logical operator ${t}`)}}function G0(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s{let o=1;for(let a=0;ar[0](s)/r[1](s);case F.Add:return s=>{let o=0;for(let a=0;ar[0](s)-r[1](s);case F.Clamp:return s=>{const o=r[0](s),a=r[1](s);if(ol?l:o};case F.Mod:return s=>r[0](s)%r[1](s);case F.Pow:return s=>Math.pow(r[0](s),r[1](s));case F.Abs:return s=>Math.abs(r[0](s));case F.Floor:return s=>Math.floor(r[0](s));case F.Ceil:return s=>Math.ceil(r[0](s));case F.Round:return s=>Math.round(r[0](s));case F.Sin:return s=>Math.sin(r[0](s));case F.Cos:return s=>Math.cos(r[0](s));case F.Atan:return i===2?s=>Math.atan2(r[0](s),r[1](s)):s=>Math.atan(r[0](s));case F.Sqrt:return s=>Math.sqrt(r[0](s));default:throw new Error(`Unsupported numeric operator ${t}`)}}function B0(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r{for(let s=0;s{const s=i[0](r);for(let o=1;o{const s=i[0](r),o=i[1](r);let a,l;for(let c=2;c=o)return c===2?u:d?U0(s,o,a,l,h,u):qs(s,o,a,l,h,u);a=h,l=u}return l}}function z0(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s{const o=r[0](s);return n.args[0].type===ni?Uc(o):o.toString()};default:throw new Error(`Unsupported convert operator ${t}`)}}function qs(n,e,t,i,r,s){const o=r-t;if(o===0)return i;const a=e-t,l=n===1?a/o:(Math.pow(n,a)-1)/(Math.pow(n,o)-1);return i+l*(s-i)}function U0(n,e,t,i,r,s){if(r-t===0)return i;const a=Af(i),l=Af(s);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const h=[qs(n,e,t,a[0],r,l[0]),qs(n,e,t,a[1],r,l[1]),a[2]+qs(n,e,t,0,r,c),qs(n,e,t,i[3],r,s[3])];return m0(h)}const V={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Hc extends Rs{constructor(e,t,i,r){super(),this.extent=e,this.pixelRatio_=i,this.resolution=t,this.state=typeof r=="function"?V.IDLE:r,this.image_=null,this.loader=typeof r=="function"?r:null}changed(){this.dispatchEvent(H.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==V.IDLE&&this.loader){this.state=V.LOADING,this.changed();const e=this.getResolution(),t=Array.isArray(e)?e[0]:e;On(()=>this.loader(this.getExtent(),t,this.getPixelRatio())).then(i=>{"image"in i&&(this.image_=i.image),"extent"in i&&(this.extent=i.extent),"resolution"in i&&(this.resolution=i.resolution),"pixelRatio"in i&&(this.pixelRatio_=i.pixelRatio),(i instanceof HTMLImageElement||lm&&i instanceof ImageBitmap||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement)&&(this.image_=i),this.state=V.LOADED}).catch(i=>{this.state=V.ERROR,console.error(i)}).finally(()=>this.changed())}}setImage(e){this.image_=e}setResolution(e){this.resolution=e}}function V0(n,e,t){const i=n;let r=!0,s=!1,o=!1;const a=[Po(i,H.LOAD,function(){o=!0,s||e()})];return i.src&&sd?(s=!0,i.decode().then(function(){r&&e()}).catch(function(l){r&&(o?e():t())})):a.push(Po(i,H.ERROR,t)),function(){r=!1,a.forEach(ve)}}function W0(n,e){return new Promise((t,i)=>{function r(){o(),t(n)}function s(){o(),i(new Error("Image load error"))}function o(){n.removeEventListener("load",r),n.removeEventListener("error",s)}n.addEventListener("load",r),n.addEventListener("error",s)})}function H0(n,e){return e&&(n.src=e),n.src&&sd?new Promise((t,i)=>n.decode().then(()=>t(n)).catch(r=>n.complete&&n.width?t(n):i(r))):W0(n)}class X0{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const t in this.cache_){const i=this.cache_[t];(e++&3)===0&&!i.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t,i){const r=Xc(e,t,i);return r in this.cache_?this.cache_[r]:null}getPattern(e,t,i){const r=Xc(e,t,i);return r in this.patternCache_?this.patternCache_[r]:null}set(e,t,i,r,s){const o=Xc(e,t,i),a=o in this.cache_;this.cache_[o]=r,s&&(r.getImageState()===V.IDLE&&r.load(),r.getImageState()===V.LOADING?r.ready().then(()=>{this.patternCache_[o]=ta().createPattern(r.getImage(1),"repeat")}):this.patternCache_[o]=ta().createPattern(r.getImage(1),"repeat")),a||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function Xc(n,e,t){const i=t?Br(t):"null";return e+":"+n+":"+i}const zt=new X0;let Js=null;class Cf extends Rs{constructor(e,t,i,r,s){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=i,this.canvas_={},this.color_=s,this.imageState_=r===void 0?V.IDLE:r,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=t,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_===V.LOADED){Js||(Js=Fe(1,1,void 0,{willReadFrequently:!0})),Js.drawImage(this.image_,0,0);try{Js.getImageData(0,0,1,1),this.tainted_=!1}catch{Js=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(H.CHANGE)}handleImageError_(){this.imageState_=V.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=V.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],t=this.size_[1],i=Fe(e,t);i.fillRect(0,0,e,t),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===V.IDLE){this.image_||this.initializeImage_(),this.imageState_=V.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&H0(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==V.LOADED)return;const t=this.image_,i=Fe(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=i.canvas;i.scale(e,e),i.drawImage(t,0,0),i.globalCompositeOperation="multiply",i.fillStyle=g0(this.color_),i.fillRect(0,0,r.width/e,r.height/e),i.globalCompositeOperation="destination-in",i.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===V.LOADED||this.imageState_===V.ERROR)e();else{const t=()=>{(this.imageState_===V.LOADED||this.imageState_===V.ERROR)&&(this.removeEventListener(H.CHANGE,t),e())};this.addEventListener(H.CHANGE,t)}})),this.ready_}}function Yc(n,e,t,i,r,s){let o=e===void 0?void 0:zt.get(e,t,r);return o||(o=new Cf(n,n&&"src"in n?n.src||void 0:e,t,i,r),zt.set(e,t,r,o,s)),s&&o&&!zt.getPattern(e,t,r)&&zt.set(e,t,r,o,s),o}function _i(n){return n?Array.isArray(n)?Uc(n):typeof n=="object"&&"src"in n?Y0(n):n:null}function Y0(n){if(!n.offset||!n.size)return zt.getPattern(n.src,"anonymous",n.color);const e=n.src+":"+n.offset,t=zt.getPattern(e,void 0,n.color);if(t)return t;const i=zt.get(n.src,"anonymous",null);if(i.getImageState()!==V.LOADED)return null;const r=Fe(n.size[0],n.size[1]);return r.drawImage(i.getImage(1),n.offset[0],n.offset[1],n.size[0],n.size[1],0,0,n.size[0],n.size[1]),Yc(r.canvas,e,void 0,V.LOADED,n.color,!0),zt.getPattern(e,void 0,n.color)}const bf="10px sans-serif",xt="#000",jr="round",ji=[],zi=0,zr="round",$s=10,eo="#000",to="center",ca="middle",qn=[0,0,0,0],io=1,xi=new pi;let Ur=null,Kc;const Zc={},K0=function(){const e="32px ",t=["monospace","serif"],i=t.length,r="wmytzilWMYTZIL@#/&?$%10";let s,o;function a(c,h,u){let d=!0;for(let g=0;gMath.max(r,ha(n,s)),0);return t[e]=i,i}function Q0(n,e){const t=[],i=[],r=[];let s=0,o=0,a=0,l=0;for(let c=0,h=e.length;c<=h;c+=2){const u=e[c];if(u===`
`||c===h){s=Math.max(s,o),r.push(o),o=0,a+=l,l=0;continue}const d=e[c+1]||n.font,g=ha(d,u);t.push(g),o+=g;const f=Z0(d);i.push(f),l=Math.max(l,f)}return{width:s,height:a,widths:t,heights:i,lineWidths:r}}function q0(n,e,t,i,r,s,o,a,l,c,h){n.save(),t!==1&&(n.globalAlpha===void 0?n.globalAlpha=u=>u.globalAlpha*=t:n.globalAlpha*=t),e&&n.transform.apply(n,e),i.contextInstructions?(n.translate(l,c),n.scale(h[0],h[1]),J0(i,n)):h[0]<0||h[1]<0?(n.translate(l,c),n.scale(h[0],h[1]),n.drawImage(i,r,s,o,a,0,0,o,a)):n.drawImage(i,r,s,o,a,l,c,o*h[0],a*h[1]),n.restore()}function J0(n,e){const t=n.contextInstructions;for(let i=0,r=t.length;ithis.imageState_=V.LOADED),this.render()}clone(){const e=this.getScale(),t=new da({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(e)?e.slice():e,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return t.setOpacity(this.getOpacity()),t}getAnchor(){const e=this.size_,t=this.getDisplacement(),i=this.getScaleArray();return[e[0]/2-t[0]/i[0],e[1]/2+t[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(e){var s,o;const t=(s=this.fill_)==null?void 0:s.getKey(),i=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(",");let r=(o=zt.get(i,null,null))==null?void 0:o.getImage(1);if(!r){const a=this.renderOptions_,l=Math.ceil(a.size*e),c=Fe(l,l);this.draw_(a,c,e),r=c.canvas,zt.set(i,null,null,new Cf(r,void 0,null,V.LOADED,null))}return r}getPixelRatio(e){return e}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(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,i){if(t===0||this.points_===1/0||e!=="bevel"&&e!=="miter")return t;let r=this.radius,s=this.radius2_===void 0?r:this.radius2_;if(r{this.patternImage_=null}),t.getImageState()===V.IDLE&&t.load(),t.getImageState()===V.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){const e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?Y(e):typeof e=="object"&&"src"in e?e.src+":"+e.offset:Br(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function Sf(n,e,t,i){return t!==void 0&&i!==void 0?[t/n,i/e]:t!==void 0?t/n:i!==void 0?i/e:1}class $n extends ua{constructor(e){e=e||{};const t=e.opacity!==void 0?e.opacity:1,i=e.rotation!==void 0?e.rotation:0,r=e.scale!==void 0?e.scale:1,s=e.rotateWithView!==void 0?e.rotateWithView:!1;super({opacity:t,rotation:i,scale:r,displacement:e.displacement!==void 0?e.displacement:[0,0],rotateWithView:s,declutterMode:e.declutterMode}),this.anchor_=e.anchor!==void 0?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin!==void 0?e.anchorOrigin:"top-left",this.anchorXUnits_=e.anchorXUnits!==void 0?e.anchorXUnits:"fraction",this.anchorYUnits_=e.anchorYUnits!==void 0?e.anchorYUnits:"fraction",this.crossOrigin_=e.crossOrigin!==void 0?e.crossOrigin:null;const o=e.img!==void 0?e.img:null;let a=e.src;ge(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||Y(o)),ge(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),ge(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(e.src!==void 0?l=V.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?V.LOADED:V.IDLE:l=V.LOADING:l=V.LOADED),this.color_=e.color!==void 0?Br(e.color):null,this.iconImage_=Yc(o,a,this.crossOrigin_,l,this.color_),this.offset_=e.offset!==void 0?e.offset:[0,0],this.offsetOrigin_=e.offsetOrigin!==void 0?e.offsetOrigin:"top-left",this.origin_=null,this.size_=e.size!==void 0?e.size:null,this.initialOptions_,e.width!==void 0||e.height!==void 0){let c,h;if(e.size)[c,h]=e.size;else{const u=this.getImage(1);if(u.width&&u.height)c=u.width,h=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=e;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const g=this.iconImage_.getSize();this.setScale(Sf(g[0],g[1],e.width,e.height))};this.listenImageChange(d);return}}c!==void 0&&this.setScale(Sf(c,h,e.width,e.height))}}clone(){let e,t,i;return this.initialOptions_?(t=this.initialOptions_.width,i=this.initialOptions_.height):(e=this.getScale(),e=Array.isArray(e)?e.slice():e),new $n({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:e,width:t,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;const r=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!r)return null;e=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(e[0]*=r[0]),this.anchorYUnits_=="fraction"&&(e[1]*=r[1])}if(this.anchorOrigin_!="top-left"){if(!r)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(e[0]=-e[0]+r[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(e[1]=-e[1]+r[1])}this.normalizedAnchor_=e}const t=this.getDisplacement(),i=this.getScaleArray();return[e[0]-t[0]/i[0],e[1]+t[1]/i[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!="top-left"){const t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(e[0]=i[0]-t[0]-e[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==V.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){const e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==V.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(H.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(H.CHANGE,e)}ready(){return this.iconImage_.ready()}}class Vt{constructor(e){e=e||{},this.color_=e.color!==void 0?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash!==void 0?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){const e=this.getColor();return new Vt({color:Array.isArray(e)?e.slice():e||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(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}}class Qe{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=Mf,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill!==void 0?e.fill:null,this.image_=e.image!==void 0?e.image:null,this.renderer_=e.renderer!==void 0?e.renderer:null,this.hitDetectionRenderer_=e.hitDetectionRenderer!==void 0?e.hitDetectionRenderer:null,this.stroke_=e.stroke!==void 0?e.stroke:null,this.text_=e.text!==void 0?e.text:null,this.zIndex_=e.zIndex}clone(){let e=this.getGeometry();return e&&typeof e=="object"&&(e=e.clone()),new Qe({geometry:e??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e=="function"?this.geometryFunction_=e:typeof e=="string"?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=Mf,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function $0(n){let e;if(typeof n=="function")e=n;else{let t;Array.isArray(n)?t=n:(ge(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),t=[n]),e=function(){return t}}return e}let Qc=null;function If(n,e){if(!Qc){const t=new Ut({color:"rgba(255,255,255,0.4)"}),i=new Vt({color:"#3399CC",width:1.25});Qc=[new Qe({image:new Jn({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return Qc}function Pf(){const n={},e=[255,255,255,1],t=[0,153,255,1],i=3;return n.Polygon=[new Qe({fill:new Ut({color:[255,255,255,.5]})})],n.MultiPolygon=n.Polygon,n.LineString=[new Qe({stroke:new Vt({color:e,width:i+2})}),new Qe({stroke:new Vt({color:t,width:i})})],n.MultiLineString=n.LineString,n.Circle=n.Polygon.concat(n.LineString),n.Point=[new Qe({image:new Jn({radius:i*2,fill:new Ut({color:t}),stroke:new Vt({color:e,width:i/2})}),zIndex:1/0})],n.MultiPoint=n.Point,n.GeometryCollection=n.Polygon.concat(n.LineString,n.Point),n}function Mf(n){return n.getGeometry()}const e_="#333";class fa{constructor(e){e=e||{},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=Ke(e.scale!==void 0?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill!==void 0?e.fill:new Ut({color:e_}),this.maxAngle_=e.maxAngle!==void 0?e.maxAngle:Math.PI/4,this.placement_=e.placement!==void 0?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=e.stroke!==void 0?e.stroke:null,this.offsetX_=e.offsetX!==void 0?e.offsetX:0,this.offsetY_=e.offsetY!==void 0?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new fa({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setKeepUpright(e){this.keepUpright_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=Ke(e!==void 0?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}}function t_(n){return!0}function i_(n){const e=yf(),t=n_(n,e),i=vf();return function(r,s){if(i.properties=r.getPropertiesInternal(),i.resolution=s,e.featureId){const o=r.getId();o!==void 0?i.featureId=o:i.featureId=null}return e.geometryType&&(i.geometryType=wf(r.getGeometry())),t(i)}}function Ff(n){const e=yf(),t=n.length,i=new Array(t);for(let o=0;onull;i=Jc(n,e+"fill-color",t)}if(!i)return null;const r=new Ut;return function(s){const o=i(s);return o===kc?null:(r.setColor(o),r)}}function ro(n,e,t){const i=Et(n,e+"stroke-width",t),r=Jc(n,e+"stroke-color",t);if(!i&&!r)return null;const s=Ui(n,e+"stroke-line-cap",t),o=Ui(n,e+"stroke-line-join",t),a=Lf(n,e+"stroke-line-dash",t),l=Et(n,e+"stroke-line-dash-offset",t),c=Et(n,e+"stroke-miter-limit",t),h=new Vt;return function(u){if(r){const d=r(u);if(d===kc)return null;h.setColor(d)}if(i&&h.setWidth(i(u)),s){const d=s(u);if(d!=="butt"&&d!=="round"&&d!=="square")throw new Error("Expected butt, round, or square line cap");h.setLineCap(d)}if(o){const d=o(u);if(d!=="bevel"&&d!=="round"&&d!=="miter")throw new Error("Expected bevel, round, or miter line join");h.setLineJoin(d)}return a&&h.setLineDash(a(u)),l&&h.setLineDashOffset(l(u)),c&&h.setMiterLimit(c(u)),h}}function r_(n,e){const t="text-",i=Ui(n,t+"value",e);if(!i)return null;const r=no(n,t,e),s=no(n,t+"background-",e),o=ro(n,t,e),a=ro(n,t+"background-",e),l=Ui(n,t+"font",e),c=Et(n,t+"max-angle",e),h=Et(n,t+"offset-x",e),u=Et(n,t+"offset-y",e),d=Vr(n,t+"overflow",e),g=Ui(n,t+"placement",e),f=Et(n,t+"repeat",e),p=pa(n,t+"scale",e),A=Vr(n,t+"rotate-with-view",e),m=Et(n,t+"rotation",e),y=Ui(n,t+"align",e),E=Ui(n,t+"justify",e),x=Ui(n,t+"baseline",e),_=Vr(n,t+"keep-upright",e),w=Lf(n,t+"padding",e),v=ma(n,t+"declutter-mode"),C=new fa({declutterMode:v});return function(b){if(C.setText(i(b)),r&&C.setFill(r(b)),s&&C.setBackgroundFill(s(b)),o&&C.setStroke(o(b)),a&&C.setBackgroundStroke(a(b)),l&&C.setFont(l(b)),c&&C.setMaxAngle(c(b)),h&&C.setOffsetX(h(b)),u&&C.setOffsetY(u(b)),d&&C.setOverflow(d(b)),g){const T=g(b);if(T!=="point"&&T!=="line")throw new Error("Expected point or line for text-placement");C.setPlacement(T)}if(f&&C.setRepeat(f(b)),p&&C.setScale(p(b)),A&&C.setRotateWithView(A(b)),m&&C.setRotation(m(b)),y){const T=y(b);if(T!=="left"&&T!=="center"&&T!=="right"&&T!=="end"&&T!=="start")throw new Error("Expected left, right, center, start, or end for text-align");C.setTextAlign(T)}if(E){const T=E(b);if(T!=="left"&&T!=="right"&&T!=="center")throw new Error("Expected left, right, or center for text-justify");C.setJustify(T)}if(x){const T=x(b);if(T!=="bottom"&&T!=="top"&&T!=="middle"&&T!=="alphabetic"&&T!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");C.setTextBaseline(T)}return w&&C.setPadding(w(b)),_&&C.setKeepUpright(_(b)),C}}function s_(n,e){return"icon-src"in n?o_(n,e):"shape-points"in n?a_(n,e):"circle-radius"in n?l_(n,e):null}function o_(n,e){const t="icon-",i=t+"src",r=Gf(n[i],i),s=ga(n,t+"anchor",e),o=pa(n,t+"scale",e),a=Et(n,t+"opacity",e),l=ga(n,t+"displacement",e),c=Et(n,t+"rotation",e),h=Vr(n,t+"rotate-with-view",e),u=Df(n,t+"anchor-origin"),d=Of(n,t+"anchor-x-units"),g=Of(n,t+"anchor-y-units"),f=f_(n,t+"color"),p=u_(n,t+"cross-origin"),A=d_(n,t+"offset"),m=Df(n,t+"offset-origin"),y=Aa(n,t+"width"),E=Aa(n,t+"height"),x=h_(n,t+"size"),_=ma(n,t+"declutter-mode"),w=new $n({src:r,anchorOrigin:u,anchorXUnits:d,anchorYUnits:g,color:f,crossOrigin:p,offset:A,offsetOrigin:m,height:E,width:y,size:x,declutterMode:_});return function(v){return a&&w.setOpacity(a(v)),l&&w.setDisplacement(l(v)),c&&w.setRotation(c(v)),h&&w.setRotateWithView(h(v)),o&&w.setScale(o(v)),s&&w.setAnchor(s(v)),w}}function a_(n,e){const t="shape-",i=t+"points",r=t+"radius",s=$c(n[i],i),o=$c(n[r],r),a=no(n,t,e),l=ro(n,t,e),c=pa(n,t+"scale",e),h=ga(n,t+"displacement",e),u=Et(n,t+"rotation",e),d=Vr(n,t+"rotate-with-view",e),g=Aa(n,t+"radius2"),f=Aa(n,t+"angle"),p=ma(n,t+"declutter-mode"),A=new da({points:s,radius:o,radius2:g,angle:f,declutterMode:p});return function(m){return a&&A.setFill(a(m)),l&&A.setStroke(l(m)),h&&A.setDisplacement(h(m)),u&&A.setRotation(u(m)),d&&A.setRotateWithView(d(m)),c&&A.setScale(c(m)),A}}function l_(n,e){const t="circle-",i=no(n,t,e),r=ro(n,t,e),s=Et(n,t+"radius",e),o=pa(n,t+"scale",e),a=ga(n,t+"displacement",e),l=Et(n,t+"rotation",e),c=Vr(n,t+"rotate-with-view",e),h=ma(n,t+"declutter-mode"),u=new Jn({radius:5,declutterMode:h});return function(d){return s&&u.setRadius(s(d)),i&&u.setFill(i(d)),r&&u.setStroke(r(d)),a&&u.setDisplacement(a(d)),l&&u.setRotation(l(d)),c&&u.setRotateWithView(c(d)),o&&u.setScale(o(d)),u}}function Et(n,e,t){if(!(e in n))return;const i=Ni(n[e],le,t);return function(r){return $c(i(r),e)}}function Ui(n,e,t){if(!(e in n))return null;const i=Ni(n[e],_t,t);return function(r){return Gf(i(r),e)}}function c_(n,e,t){const i=Ui(n,e+"pattern-src",t),r=kf(n,e+"pattern-offset",t),s=kf(n,e+"pattern-size",t),o=Jc(n,e+"color",t);return function(a){return{src:i(a),offset:r&&r(a),size:s&&s(a),color:o&&o(a)}}}function Vr(n,e,t){if(!(e in n))return null;const i=Ni(n[e],ft,t);return function(r){const s=i(r);if(typeof s!="boolean")throw new Error(`Expected a boolean for ${e}`);return s}}function Jc(n,e,t){if(!(e in n))return null;const i=Ni(n[e],ni,t);return function(r){return Bf(i(r),e)}}function Lf(n,e,t){if(!(e in n))return null;const i=Ni(n[e],Qn,t);return function(r){return so(i(r),e)}}function ga(n,e,t){if(!(e in n))return null;const i=Ni(n[e],Qn,t);return function(r){const s=so(i(r),e);if(s.length!==2)throw new Error(`Expected two numbers for ${e}`);return s}}function kf(n,e,t){if(!(e in n))return null;const i=Ni(n[e],Qn,t);return function(r){return Nf(i(r),e)}}function pa(n,e,t){if(!(e in n))return null;const i=Ni(n[e],Qn|le,t);return function(r){return g_(i(r),e)}}function Aa(n,e){const t=n[e];if(t!==void 0){if(typeof t!="number")throw new Error(`Expected a number for ${e}`);return t}}function h_(n,e){const t=n[e];if(t!==void 0){if(typeof t=="number")return Ke(t);if(!Array.isArray(t))throw new Error(`Expected a number or size array for ${e}`);if(t.length!==2||typeof t[0]!="number"||typeof t[1]!="number")throw new Error(`Expected a number or size array for ${e}`);return t}}function u_(n,e){const t=n[e];if(t!==void 0){if(typeof t!="string")throw new Error(`Expected a string for ${e}`);return t}}function Df(n,e){const t=n[e];if(t!==void 0){if(t!=="bottom-left"&&t!=="bottom-right"&&t!=="top-left"&&t!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return t}}function Of(n,e){const t=n[e];if(t!==void 0){if(t!=="pixels"&&t!=="fraction")throw new Error(`Expected pixels or fraction for ${e}`);return t}}function d_(n,e){const t=n[e];if(t!==void 0)return so(t,e)}function ma(n,e){const t=n[e];if(t!==void 0){if(typeof t!="string")throw new Error(`Expected a string for ${e}`);if(t!=="declutter"&&t!=="obstacle"&&t!=="none")throw new Error(`Expected declutter, obstacle, or none for ${e}`);return t}}function f_(n,e){const t=n[e];if(t!==void 0)return Bf(t,e)}function so(n,e){if(!Array.isArray(n))throw new Error(`Expected an array for ${e}`);const t=n.length;for(let i=0;i4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return t}function Nf(n,e){const t=so(n,e);if(t.length!==2)throw new Error(`Expected an array of two numbers for ${e}`);return t}function g_(n,e){return typeof n=="number"?n:Nf(n,e)}const jf={RENDER_ORDER:"renderOrder"};class eh extends Dr{constructor(e){e=e||{};const t=Object.assign({},e);delete t.style,delete t.renderBuffer,delete t.updateWhileAnimating,delete t.updateWhileInteracting,super(t),this.declutter_=e.declutter?String(e.declutter):void 0,this.renderBuffer_=e.renderBuffer!==void 0?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating!==void 0?e.updateWhileAnimating:!1,this.updateWhileInteracting_=e.updateWhileInteracting!==void 0?e.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(jf.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,t){const i=this.getDeclutter();i in e.declutter||(e.declutter[i]=new ff(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(jf.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?If:e;const t=p_(e);this.styleFunction_=e===null?void 0:$0(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}}function p_(n){if(n===void 0)return If;if(!n)return null;if(typeof n=="function"||n instanceof Qe)return n;if(!Array.isArray(n))return Ff([n]);if(n.length===0)return[];const e=n.length,t=n[0];if(t instanceof Qe){const r=new Array(e);for(let s=0;s=0;--_){const w=p[_],v=w.layer;if(v.hasRenderer()&&Mc(w,h)&&a.call(l,v)){const C=v.getRenderer(),b=v.getSource();if(C&&b){const T=b.getWrapX()?g:e,P=u.bind(null,w.managed);y[0]=T[0]+f[x][0],y[1]=T[1]+f[x][1],c=C.forEachFeatureAtCoordinate(y,t,i,P,m)}if(c)return c}}if(m.length===0)return;const E=1/m.length;return m.forEach((x,_)=>x.distanceSq+=_*E),m.sort((x,_)=>x.distanceSq-_.distanceSq),m.some(x=>c=x.callback(x.feature,x.layer,x.geometry)),c}hasFeatureAtCoordinate(e,t,i,r,s,o){return this.forEachFeatureAtCoordinate(e,t,i,r,Cr,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(e){Q()}scheduleExpireIconCache(e){zt.canExpireCache()&&e.postRenderFunctions.push(m_)}}function m_(n,e){zt.expire()}class y_ extends A_{constructor(e){super(e),this.fontChangeListenerKey_=oe(xi,vr.PROPERTYCHANGE,e.redrawText,e),this.element_=document.createElement("div");const t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=ea+" ol-layers";const i=e.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){const i=this.getMap();if(i.hasListener(e)){const r=new zf(e,void 0,t);i.dispatchEvent(r)}}disposeInternal(){ve(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(jt.PRECOMPOSE,e);const t=e.layerStatesArray.sort((a,l)=>a.zIndex-l.zIndex);t.some(a=>a.layer instanceof eh&&a.layer.getDeclutter())&&(e.declutter={});const r=e.viewState;this.children_.length=0;const s=[];let o=null;for(let a=0,l=t.length;a=0;--i){const r=t[i],s=r.layer;s.getDeclutter()&&s.renderDeclutter(e,r)}t.forEach(i=>i.layer.renderDeferred(e))}}}function Uf(n){if(n instanceof Dr){n.setMapInternal(null);return}n instanceof Bi&&n.getLayers().forEach(Uf)}function Vf(n,e){if(n instanceof Dr){n.setMapInternal(e);return}if(n instanceof Bi){const t=n.getLayers().getArray();for(let i=0,r=t.length;ithis.updateSize()),this.controls=t.controls||of(),this.interactions=t.interactions||i0({onFocusOnly:!0}),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new ad(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(at.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(at.VIEW,this.handleViewChanged_),this.addChangeListener(at.SIZE,this.handleSizeChanged_),this.addChangeListener(at.TARGET,this.handleTargetChanged_),this.setProperties(t.values);const i=this;e.view&&!(e.view instanceof yi)&&e.view.then(function(r){i.setView(new yi(r))}),this.controls.addEventListener(ot.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(ot.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(ot.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(ot.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(ot.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(ot.REMOVE,r=>{const s=r.element.getId();s!==void 0&&delete this.overlayIdIndex_[s.toString()],r.element.setMap(null)}),this.controls.forEach(r=>{r.setMap(this)}),this.interactions.forEach(r=>{r.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){Vf(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,i){if(!this.frameState_||!this.renderer_)return;const r=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:Cr,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,s,a,t,null,o,null)}getFeaturesAtPixel(e,t){const i=[];return this.forEachFeatureAtPixel(e,function(r){i.push(r)},t),i}getAllLayers(){const e=[];function t(i){i.forEach(function(r){r instanceof Bi?t(r.getLayers()):e.push(r)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(e);t=t!==void 0?t:{};const r=t.layerFilter!==void 0?t.layerFilter:Cr,s=t.hitTolerance!==void 0?t.hitTolerance:0,o=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,o,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){const i=this.viewport_.getBoundingClientRect(),r=this.getSize(),s=i.width/r[0],o=i.height/r[1],a="changedTouches"in e?e.changedTouches[0]:e;return[(a.clientX-i.left)/s,(a.clientY-i.top)/o]}getTarget(){return this.get(at.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return Vn(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const t=this.frameState_;return t?Ye(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){const t=this.overlayIdIndex_[e.toString()];return t!==void 0?t:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(at.LAYERGROUP)}setLayers(e){const t=this.getLayerGroup();if(e instanceof Gt){t.setLayers(e);return}const i=t.getLayers();i.clear(),i.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const e=this.getLayerGroup().getLayerStatesArray();for(let t=0,i=e.length;t=0;s--){const o=r[s];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(e)||e.propagationStopped)break}}}handlePostRender(){const e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let r=this.maxTilesLoading_,s=r;if(e){const o=e.viewHints;if(o[ke.ANIMATING]||o[ke.INTERACTING]){const a=Date.now()-e.time>8;r=a?0:8,s=a?0:2}}t.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const t=this.getLayerGroup();t&&this.handleLayerRemove_(new gn("removelayer",t)),this.set(at.LAYERGROUP,e)}setSize(e){this.set(at.SIZE,e)}setTarget(e){this.set(at.TARGET,e)}setView(e){if(!e||e instanceof yi){this.set(at.VIEW,e);return}this.set(at.VIEW,new yi);const t=this;e.then(function(i){t.setView(new yi(i))})}updateSize(){const e=this.getTargetElement();let t;if(e){const r=getComputedStyle(e),s=e.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),o=e.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);!isNaN(s)&&!isNaN(o)&&(t=[Math.max(0,s),Math.max(0,o)],!mf(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&md("No map visible because the map container's width or height are 0."))}const i=this.getSize();t&&(!i||!Fi(t,i))&&(this.setSize(t),this.updateViewportSize_(t))}updateViewportSize_(e){const t=this.getView();t&&t.setViewportSize(e)}};function __(n){let e=null;n.keyboardEventTarget!==void 0&&(e=typeof n.keyboardEventTarget=="string"?document.getElementById(n.keyboardEventTarget):n.keyboardEventTarget);const t={},i=n.layers&&typeof n.layers.getLayers=="function"?n.layers:new Bi({layers:n.layers});t[at.LAYERGROUP]=i,t[at.TARGET]=n.target,t[at.VIEW]=n.view instanceof yi?n.view:new yi;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new Gt(n.controls.slice()):(ge(typeof n.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),r=n.controls));let s;n.interactions!==void 0&&(Array.isArray(n.interactions)?s=new Gt(n.interactions.slice()):(ge(typeof n.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),s=n.interactions));let o;return n.overlays!==void 0?Array.isArray(n.overlays)?o=new Gt(n.overlays.slice()):(ge(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new Gt,{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:t}}class Pt extends pi{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const t=e;this.setGeometry(t)}else{const t=e;this.setProperties(t)}}clone(){const e=new Pt(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const t=this.getGeometry();t&&e.setGeometry(t.clone());const i=this.getStyle();return i&&e.setStyle(i),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(ve(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=oe(e,H.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?x_(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function x_(n){if(typeof n=="function")return n;let e;return Array.isArray(n)?e=n:(ge(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[n]),function(){return e}}function Wf(n,e,t,i){const r=[];let s=St();for(let o=0,a=t.length;o1?o:2,s=s||new Array(o);for(let h=0;h>1;r=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:jl(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+i;for(let s=1;se.clone())}function nh(n,e,t,i){let r=n[e],s=n[e+1],o=0;for(let a=e+i;a{if(e===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),t&&this.simplifiedGeometry_.applyTransform(t);const i=this.simplifiedGeometry_.getFlatCoordinates();let r;switch(this.type_){case"LineString":i.length=Zo(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=Wd(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,i,0,r);break;case"Polygon":r=[],i.length=cc(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),i,0,r);break}return r&&(this.simplifiedGeometry_=new tt(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}tt.prototype.getFlatCoordinates=tt.prototype.getOrientedFlatCoordinates;function w_(n){const e=n.getType();switch(e){case"Point":return new yt(n.getFlatCoordinates());case"MultiPoint":return new er(n.getFlatCoordinates(),"XY");case"LineString":return new Wt(n.getFlatCoordinates(),"XY");case"MultiLineString":return new An(n.getFlatCoordinates(),"XY",n.getEnds());case"Polygon":const t=n.getFlatCoordinates(),i=n.getEnds(),r=pc(t,i);return r.length>1?new mn(t,"XY",r):new Nt(t,"XY",i);default:throw new Error("Invalid geometry type:"+e)}}function Xf(n,e){const t=n.getId(),i=w_(n),r=n.getProperties(),s=new Pt;return s.setGeometry(i),t!==void 0&&s.setId(t),s.setProperties(r,!0),s}class Yf{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Pt,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let i=t.dataProjection?pe(t.dataProjection):this.readProjection(e);t.extent&&i&&i.getUnits()==="tile-pixels"&&(i=pe(i),i.setWorldExtent(t.extent)),t={dataProjection:i,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return Q()}readFeature(e,t){return Q()}readFeatures(e,t){return Q()}readGeometry(e,t){return Q()}readProjection(e){return Q()}writeFeature(e,t){return Q()}writeFeatures(e,t){return Q()}writeGeometry(e,t){return Q()}}function Ea(n,e,t){const i=t?pe(t.featureProjection):null,r=t?pe(t.dataProjection):null;let s=n;if(i&&r&&!ti(i,r)){e&&(s=n.clone());const o=e?i:r,a=e?r:i;o.getUnits()==="tile-pixels"?s.transform(o,a):s.applyTransform(Gs(o,a))}if(e&&t&&t.decimals!==void 0){const o=Math.pow(10,t.decimals),a=function(l){for(let c=0,h=l.length;cKf({...n,geometry:o})).flat();const i=t.type==="MultiPolygon"?"Polygon":t.type;if(i==="GeometryCollection"||i==="Circle")throw new Error("Unsupported geometry type: "+i);const r=t.layout.length;return Ea(new tt(i,i==="Polygon"?C_(t.flatCoordinates,t.ends,r):t.flatCoordinates,(s=t.ends)==null?void 0:s.flat(),r,n.properties||{},n.id).enableSimplifyTransformed(),!1,e)}function rh(n,e){if(!n)return null;if(Array.isArray(n)){const i=n.map(r=>rh(r,e));return new oo(i)}const t=v_[n.type];return Ea(new t(n.flatCoordinates,n.layout||"XY",n.ends),!1,e)}class b_ extends Yf{constructor(){super()}getType(){return"json"}readFeature(e,t){return this.readFeatureFromObject(wa(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(wa(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return Q()}readFeaturesFromObject(e,t){return Q()}readGeometry(e,t){return this.readGeometryFromObject(wa(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return Q()}readProjection(e){return this.readProjectionFromObject(wa(e))}readProjectionFromObject(e){return Q()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return Q()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return Q()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return Q()}}function wa(n){if(typeof n=="string"){const e=JSON.parse(n);return e||null}return n!==null?n:null}class sh extends b_{constructor(e){e=e||{},super(),this.dataProjection=pe(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=pe(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,t){let i=null;e.type==="Feature"?i=e:i={type:"Feature",geometry:e,properties:null};const r=oh(i.geometry);if(this.featureClass===tt)return Kf({geometry:r,id:i.id,properties:i.properties},t);const s=new Pt;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&i.geometry_name&&s.setGeometryName(i.geometry_name),s.setGeometry(rh(r,t)),"id"in i&&s.setId(i.id),i.properties&&s.setProperties(i.properties,!0),s}readFeaturesFromObject(e,t){const i=e;let r=null;if(i.type==="FeatureCollection"){const s=e;r=[];const o=s.features;for(let a=0,l=o.length;a":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},cx={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},hx={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},ux={type:"array",value:"*",minimum:1},dx={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},fx={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},gx={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},px={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},Ax=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],mx={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},yx={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},_x={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},xx={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Ex={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},wx={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},vx={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Cx={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},bx={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Tx={"*":{type:"string"}},Rx={$version:z_,$root:U_,sources:V_,source:W_,source_vector:H_,source_raster:X_,source_raster_dem:Y_,source_geojson:K_,source_video:Z_,source_image:Q_,layer:q_,layout:J_,layout_background:$_,layout_fill:ex,layout_circle:tx,layout_heatmap:ix,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:nx,layout_symbol:rx,layout_raster:sx,layout_hillshade:ox,filter:ax,filter_operator:lx,geometry_type:cx,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:hx,expression:ux,light:dx,sky:fx,terrain:gx,projection:px,paint:Ax,paint_fill:mx,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:yx,paint_circle:_x,paint_heatmap:xx,paint_symbol:Ex,paint_raster:wx,paint_hillshade:vx,paint_background:Cx,transition:bx,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:Tx};const Sx=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Ix(n,e){const t={};for(const i in n)i!=="ref"&&(t[i]=n[i]);return Sx.forEach(i=>{i in e&&(t[i]=e[i])}),t}function Zf(n){n=n.slice();const e=Object.create(null);for(let t=0;t`:n.itemType.kind==="value"?"array":`array<${e}>`}else return n.kind}const Mx=[va,N,ie,$,wi,Ca,Ta,Wr,Mt(ee),Ra,ao,Sa];function lo(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!lo(n.itemType,e.itemType))&&(typeof n.N!="number"||n.N===e.N))return null}else{if(n.kind===e.kind)return null;if(n.kind==="value"){for(const t of Mx)if(!lo(t,e))return null}}return`Expected ${Oe(n)} but found ${Oe(e)} instead.`}function ch(n,e){return e.some(t=>t.kind===n.kind)}function tr(n,e){return e.some(t=>t==="null"?n===null:t==="array"?Array.isArray(n):t==="object"?n&&!Array.isArray(n)&&typeof n=="object":t===typeof n)}function Hr(n,e){return n.kind==="array"&&e.kind==="array"?n.itemType.kind===e.itemType.kind&&typeof n.N=="number":n.kind===e.kind}const Qf=.96422,qf=1,Jf=.82521,$f=4/29,Xr=6/29,eg=3*Xr*Xr,Fx=Xr*Xr*Xr,Lx=Math.PI/180,kx=180/Math.PI;function tg(n){return n=n%360,n<0&&(n+=360),n}function ig([n,e,t,i]){n=hh(n),e=hh(e),t=hh(t);let r,s;const o=uh((.2225045*n+.7168786*e+.0606169*t)/qf);n===e&&e===t?r=s=o:(r=uh((.4360747*n+.3850649*e+.1430804*t)/Qf),s=uh((.0139322*n+.0971045*e+.7141733*t)/Jf));const a=116*o-16;return[a<0?0:a,500*(r-o),200*(o-s),i]}function hh(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function uh(n){return n>Fx?Math.pow(n,1/3):n/eg+$f}function ng([n,e,t,i]){let r=(n+16)/116,s=isNaN(e)?r:r+e/500,o=isNaN(t)?r:r-t/200;return r=qf*fh(r),s=Qf*fh(s),o=Jf*fh(o),[dh(3.1338561*s-1.6168667*r-.4906146*o),dh(-.9787684*s+1.9161415*r+.033454*o),dh(.0719453*s-.2289914*r+1.4052427*o),i]}function dh(n){return n=n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055,n<0?0:n>1?1:n}function fh(n){return n>Xr?n*n*n:eg*(n-$f)}function Dx(n){const[e,t,i,r]=ig(n),s=Math.sqrt(t*t+i*i);return[Math.round(s*1e4)?tg(Math.atan2(i,t)*kx):NaN,s,e,r]}function Ox([n,e,t,i]){return n=isNaN(n)?0:n*Lx,ng([t,Math.cos(n)*e,Math.sin(n)*e,i])}function Gx([n,e,t,i]){n=tg(n),e/=100,t/=100;function r(s){const o=(s+n/30)%12,a=e*Math.min(t,1-t);return t-a*Math.max(-1,Math.min(o-3,9-o,1))}return[r(0),r(8),r(4),i]}function Bx(n){if(n=n.toLowerCase().trim(),n==="transparent")return[0,0,0,0];const e=Nx[n];if(e){const[r,s,o]=e;return[r/255,s/255,o/255,1]}if(n.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(n)){const s=n.length<6?1:2;let o=1;return[Ia(n.slice(o,o+=s)),Ia(n.slice(o,o+=s)),Ia(n.slice(o,o+=s)),Ia(n.slice(o,o+s)||"ff")]}if(n.startsWith("rgb")){const r=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,s=n.match(r);if(s){const[o,a,l,c,h,u,d,g,f,p,A,m]=s,y=[c||" ",d||" ",p].join("");if(y===" "||y===" /"||y===",,"||y===",,,"){const E=[l,u,f].join(""),x=E==="%%%"?100:E===""?255:0;if(x){const _=[Yr(+a/x,0,1),Yr(+h/x,0,1),Yr(+g/x,0,1),A?rg(+A,m):1];if(sg(_))return _}}return}}const t=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,i=n.match(t);if(i){const[r,s,o,a,l,c,h,u,d]=i,g=[o||" ",l||" ",h].join("");if(g===" "||g===" /"||g===",,"||g===",,,"){const f=[+s,Yr(+a,0,100),Yr(+c,0,100),u?rg(+u,d):1];if(sg(f))return Gx(f)}}}function Ia(n){return parseInt(n.padEnd(2,n),16)/255}function rg(n,e){return Yr(e?n/100:n,0,1)}function Yr(n,e,t){return Math.min(Math.max(e,n),t)}function sg(n){return!n.some(Number.isNaN)}const Nx={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]};function ir(n,e,t){return n+t*(e-n)}function Pa(n,e,t){return n.map((i,r)=>ir(i,e[r],t))}class Se{constructor(e,t,i,r=1,s=!0){this.r=e,this.g=t,this.b=i,this.a=r,s||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[e,t,i,r]))}static parse(e){if(e instanceof Se)return e;if(typeof e!="string")return;const t=Bx(e);if(t)return new Se(...t,!1)}get rgb(){const{r:e,g:t,b:i,a:r}=this,s=r||1/0;return this.overwriteGetter("rgb",[e/s,t/s,i/s,r])}get hcl(){return this.overwriteGetter("hcl",Dx(this.rgb))}get lab(){return this.overwriteGetter("lab",ig(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,i,r]=this.rgb;return`rgba(${[e,t,i].map(s=>Math.round(s*255)).join(",")},${r})`}static interpolate(e,t,i,r="rgb"){switch(r){case"rgb":{const[s,o,a,l]=Pa(e.rgb,t.rgb,i);return new Se(s,o,a,l,!1)}case"hcl":{const[s,o,a,l]=e.hcl,[c,h,u,d]=t.hcl;let g,f;if(!isNaN(s)&&!isNaN(c)){let E=c-s;c>s&&E>180?E-=360:c180&&(E+=360),g=s+i*E}else isNaN(s)?isNaN(c)?g=NaN:(g=c,(a===1||a===0)&&(f=h)):(g=s,(u===1||u===0)&&(f=o));const[p,A,m,y]=Ox([g,f??ir(o,h,i),ir(a,u,i),ir(l,d,i)]);return new Se(p,A,m,y,!1)}case"lab":{const[s,o,a,l]=ng(Pa(e.lab,t.lab,i));return new Se(s,o,a,l,!1)}}}}Se.black=new Se(0,0,0,1),Se.white=new Se(1,1,1,1),Se.transparent=new Se(0,0,0,0),Se.red=new Se(1,0,0,1);class gh{constructor(e,t,i){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const jx=["bottom","center","top"];class ph{constructor(e,t,i,r,s,o){this.text=e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=s,this.verticalAlign=o}}class Vi{constructor(e){this.sections=e}static fromString(e){return new Vi([new ph(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Vi?e:Vi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class si{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof si)return e;if(typeof e=="number")return new si([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if(typeof t!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]];break}return new si(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){return new si(Pa(e.values,t.values,i))}}class We{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const zx=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class vi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof vi)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let t=0;t=0&&n<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255?typeof i>"u"||typeof i=="number"&&i>=0&&i<=1?null:`Invalid rgba value [${[n,e,t,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof i=="number"?[n,e,t,i]:[n,e,t]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function co(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof oi||n instanceof Se||n instanceof gh||n instanceof Vi||n instanceof si||n instanceof vi||n instanceof yn)return!0;if(Array.isArray(n)){for(const e of n)if(!co(e))return!1;return!0}else if(typeof n=="object"){for(const e in n)if(!co(n[e]))return!1;return!0}else return!1}function qe(n){if(n===null)return va;if(typeof n=="string")return ie;if(typeof n=="boolean")return $;if(typeof n=="number")return N;if(n instanceof Se)return wi;if(n instanceof oi)return Ca;if(n instanceof gh)return ba;if(n instanceof Vi)return Ta;if(n instanceof si)return Ra;if(n instanceof vi)return Sa;if(n instanceof yn)return ao;if(Array.isArray(n)){const e=n.length;let t;for(const i of n){const r=qe(i);if(!t)t=r;else{if(t===r)continue;t=ee;break}}return Mt(t||ee,e)}else return Wr}function ho(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof Se||n instanceof oi||n instanceof Vi||n instanceof si||n instanceof vi||n instanceof yn?n.toString():JSON.stringify(n)}class Kr{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!co(e[1]))return t.error("invalid value");const i=e[1];let r=qe(i);const s=t.expectedType;return r.kind==="array"&&r.N===0&&s&&s.kind==="array"&&(typeof s.N!="number"||s.N===0)&&(r=s),new Kr(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Ma={string:ie,number:N,boolean:$,object:Wr};class ai{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=1,r;const s=e[0];if(s==="array"){let a;if(e.length>2){const c=e[1];if(typeof c!="string"||!(c in Ma)||c==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=Ma[c],i++}else a=ee;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);l=e[2],i++}r=Mt(a,l)}else{if(!Ma[s])throw new Error(`Types doesn't contain name = ${s}`);r=Ma[s]}const o=[];for(;ie.outputDefined())}}const ag={"to-boolean":$,"to-color":wi,"to-number":N,"to-string":ie};class _n{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[0];if(!ag[i])throw new Error(`Can't parse ${i} as it is not part of the known types`);if((i==="to-boolean"||i==="to-string")&&e.length!==2)return t.error("Expected one argument.");const r=ag[i],s=[];for(let o=1;o4?i=`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:i=og(t[0],t[1],t[2],t[3]),!i))return new Se(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new We(i||`Could not parse color from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const i of this.args){t=i.evaluate(e);const r=si.parse(t);if(r)return r}throw new We(`Could not parse padding from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const i of this.args){t=i.evaluate(e);const r=vi.parse(t);if(r)return r}throw new We(`Could not parse variableAnchorOffsetCollection from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const i of this.args){if(t=i.evaluate(e),t===null)return 0;const r=Number(t);if(!isNaN(r))return r}throw new We(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Vi.fromString(ho(this.args[0].evaluate(e)));case"resolvedImage":return yn.fromString(ho(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return ho(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const Ux=["Unknown","Point","LineString","Polygon"];class lg{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ux[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Se.parse(e)),t}}class Fa{constructor(e,t,i=[],r,s=new lh,o=[]){this.registry=e,this.path=i,this.key=i.map(a=>`[${a}]`).join(""),this.scope=s,this.errors=o,this.expectedType=r,this._isConstant=t}parse(e,t,i,r,s={}){return t?this.concat(t,i,r)._parse(e,s):this._parse(e,s)}_parse(e,t){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function i(r,s,o){return o==="assert"?new ai(s,[r]):o==="coerce"?new _n(s,[r]):r}if(Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=e[0];if(typeof r!="string")return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const s=this.registry[r];if(s){let o=s.parse(e,this);if(!o)return null;if(this.expectedType){const a=this.expectedType,l=o.type;if((a.kind==="string"||a.kind==="number"||a.kind==="boolean"||a.kind==="object"||a.kind==="array")&&l.kind==="value")o=i(o,a,t.typeAnnotation||"assert");else if(a.kind==="projectionDefinition"&&(l.kind==="string"||l.kind==="array"))o=i(o,a,t.typeAnnotation||"coerce");else if((a.kind==="color"||a.kind==="formatted"||a.kind==="resolvedImage")&&(l.kind==="value"||l.kind==="string"))o=i(o,a,t.typeAnnotation||"coerce");else if(a.kind==="padding"&&(l.kind==="value"||l.kind==="number"||l.kind==="array"))o=i(o,a,t.typeAnnotation||"coerce");else if(a.kind==="variableAnchorOffsetCollection"&&(l.kind==="value"||l.kind==="array"))o=i(o,a,t.typeAnnotation||"coerce");else if(this.checkSubtype(a,l))return null}if(!(o instanceof Kr)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){const a=new lg;try{o=new Kr(o.type,o.evaluate(a))}catch(l){return this.error(l.message),null}}return o}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,i){const r=typeof e=="number"?this.path.concat(e):this.path,s=i?this.scope.concat(i):this.scope;return new Fa(this.registry,this._isConstant,r,t||null,s,this.errors)}error(e,...t){const i=`${this.key}${t.map(r=>`[${r}]`).join("")}`;this.errors.push(new Ei(i,e))}checkSubtype(e,t){const i=lo(e,t);return i&&this.error(i),i}}class La{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const i=[];for(let s=1;s=i.length)throw new We(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t!==Math.floor(t))throw new We(`Array index must be an integer, but found ${t} instead.`);return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class mh{constructor(e,t){this.type=$,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,ee),r=t.parse(e[2],2,ee);return!i||!r?null:ch(i.type,[$,ie,N,va,ee])?new mh(i,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Oe(i.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!tr(t,["boolean","string","number","null"]))throw new We(`Expected first argument to be of type boolean, string, number or null, but found ${Oe(qe(t))} instead.`);if(!tr(i,["string","array"]))throw new We(`Expected second argument to be of type array or string, but found ${Oe(qe(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Da{constructor(e,t,i){this.type=N,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,ee),r=t.parse(e[2],2,ee);if(!i||!r)return null;if(!ch(i.type,[$,ie,N,va,ee]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Oe(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,N);return s?new Da(i,r,s):null}else return new Da(i,r)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!tr(t,["boolean","string","number","null"]))throw new We(`Expected first argument to be of type boolean, string, number or null, but found ${Oe(qe(t))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),tr(i,["string"])){const s=i.indexOf(t,r);return s===-1?-1:[...i.slice(0,s)].length}else{if(tr(i,["array"]))return i.indexOf(t,r);throw new We(`Expected second argument to be of type array or string, but found ${Oe(qe(i))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class yh{constructor(e,t,i,r,s,o){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=s,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!==1)return t.error("Expected an even number of arguments.");let i,r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);const s={},o=[];for(let c=2;cNumber.MAX_SAFE_INTEGER)return d.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof f=="number"&&Math.floor(f)!==f)return d.error("Numeric branch labels must be integer values.");if(!i)i=qe(f);else if(d.checkSubtype(i,qe(f)))return null;if(typeof s[String(f)]<"u")return d.error("Branch labels must be unique.");s[String(f)]=o.length}const g=t.parse(u,c,r);if(!g)return null;r=r||g.type,o.push(g)}const a=t.parse(e[1],1,ee);if(!a)return null;const l=t.parse(e[e.length-1],e.length-1,r);return!l||a.type.kind!=="value"&&t.concat(1).checkSubtype(i,a.type)?null:new yh(i,r,a,s,o,l)}evaluate(e){const t=this.input.evaluate(e);return(qe(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class _h{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!==0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);const r=[];for(let o=1;ot.outputDefined())&&this.otherwise.outputDefined()}}class Oa{constructor(e,t,i,r){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,ee),r=t.parse(e[2],2,N);if(!i||!r)return null;if(!ch(i.type,[Mt(ee),ie,ee]))return t.error(`Expected first argument to be of type array or string, but found ${Oe(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,N);return s?new Oa(i.type,i,r,s):null}else return new Oa(i.type,i,r)}evaluate(e){const t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);let r;if(this.endIndex&&(r=this.endIndex.evaluate(e)),tr(t,["string"]))return[...t].slice(i,r).join("");if(tr(t,["array"]))return t.slice(i,r);throw new We(`Expected first argument to be of type array or string, but found ${Oe(qe(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function cg(n,e){const t=n.length-1;let i=0,r=t,s=0,o,a;for(;i<=r;)if(s=Math.floor((i+r)/2),o=n[s],a=n[s+1],o<=e){if(s===t||ee)r=s-1;else throw new We("Input is not a number.");return 0}class Ga{constructor(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[r,s]of i)this.labels.push(r),this.outputs.push(s)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");const i=t.parse(e[1],1,N);if(!i)return null;const r=[];let s=null;t.expectedType&&t.expectedType.kind!=="value"&&(s=t.expectedType);for(let o=1;o=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);const u=t.parse(l,h,s);if(!u)return null;s=s||u.type,r.push([a,u])}return new Ga(s,i,r)}evaluate(e){const t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const s=t.length;if(r>=t[s-1])return i[s-1].evaluate(e);const o=cg(t,r);return i[o].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Vx(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var xh,hg;function Wx(){if(hg)return xh;hg=1,xh=n;function n(e,t,i,r){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=i,this.p2y=r}return n.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(t===void 0&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var i=e,r=0;r<8;r++){var s=this.sampleCurveX(i)-e;if(Math.abs(s)s?a=i:l=i,i=(l-a)*.5+a;return i},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},xh}var Hx=Wx(),Xx=Vx(Hx);class Ci{constructor(e,t,i,r,s){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[o,a]of s)this.labels.push(o),this.outputs.push(a)}static interpolationFactor(e,t,i,r){let s=0;if(e.name==="exponential")s=Eh(t,e.base,i,r);else if(e.name==="linear")s=Eh(t,1,i,r);else if(e.name==="cubic-bezier"){const o=e.controlPoints;s=new Xx(o[0],o[1],o[2],o[3]).solve(Eh(t,1,i,r))}return s}static parse(e,t){let[i,r,s,...o]=e;if(!Array.isArray(r)||r.length===0)return t.error("Expected an interpolation type expression.",1);if(r[0]==="linear")r={name:"linear"};else if(r[0]==="exponential"){const c=r[1];if(typeof c!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:c}}else if(r[0]==="cubic-bezier"){const c=r.slice(1);if(c.length!==4||c.some(h=>typeof h!="number"||h<0||h>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:c}}else return t.error(`Unknown interpolation type ${String(r[0])}`,1,0);if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(s=t.parse(s,2,N),!s)return null;const a=[];let l=null;i==="interpolate-hcl"||i==="interpolate-lab"?l=wi:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let c=0;c=h)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);const f=t.parse(u,g,l);if(!f)return null;l=l||f.type,a.push([h,f])}return!Hr(l,N)&&!Hr(l,Ca)&&!Hr(l,wi)&&!Hr(l,Ra)&&!Hr(l,Sa)&&!Hr(l,Mt(N))?t.error(`Type ${Oe(l)} is not interpolatable.`):new Ci(l,i,r,s,a)}evaluate(e){const t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const s=t.length;if(r>=t[s-1])return i[s-1].evaluate(e);const o=cg(t,r),a=t[o],l=t[o+1],c=Ci.interpolationFactor(this.interpolation,r,a,l),h=i[o].evaluate(e),u=i[o+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return ir(h,u,c);case"color":return Se.interpolate(h,u,c);case"padding":return si.interpolate(h,u,c);case"variableAnchorOffsetCollection":return vi.interpolate(h,u,c);case"array":return Pa(h,u,c);case"projectionDefinition":return oi.interpolate(h,u,c)}case"interpolate-hcl":return Se.interpolate(h,u,c,"hcl");case"interpolate-lab":return Se.interpolate(h,u,c,"lab")}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Eh(n,e,t,i){const r=i-t,s=n-t;return r===0?0:e===1?s/r:(Math.pow(e,s)-1)/(Math.pow(e,r)-1)}class uo{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=null;const r=t.expectedType;r&&r.kind!=="value"&&(i=r);const s=[];for(const a of e.slice(1)){const l=t.parse(a,1+s.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,s.push(l)}if(!i)throw new Error("No output type");return r&&s.some(a=>lo(r,a.type))?new uo(ee,s):new uo(i,s)}evaluate(e){let t=null,i=0,r;for(const s of this.args)if(i++,t=s.evaluate(e),t&&t instanceof yn&&!t.available&&(r||(r=t.name),t=null,i===this.args.length&&(t=r)),t!==null)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function ug(n,e){return n==="=="||n==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Yx(n,e,t){return e===t}function Kx(n,e,t){return e!==t}function Zx(n,e,t){return et}function qx(n,e,t){return e<=t}function Jx(n,e,t){return e>=t}function dg(n,e,t,i){return i.compare(e,t)===0}function $x(n,e,t,i){return!dg(n,e,t,i)}function eE(n,e,t,i){return i.compare(e,t)<0}function tE(n,e,t,i){return i.compare(e,t)>0}function iE(n,e,t,i){return i.compare(e,t)<=0}function nE(n,e,t,i){return i.compare(e,t)>=0}function Zr(n,e,t){const i=n!=="=="&&n!=="!=";return class vA{constructor(s,o,a){this.type=$,this.lhs=s,this.rhs=o,this.collator=a,this.hasUntypedArgument=s.type.kind==="value"||o.type.kind==="value"}static parse(s,o){if(s.length!==3&&s.length!==4)return o.error("Expected two or three arguments.");const a=s[0];let l=o.parse(s[1],1,ee);if(!l)return null;if(!ug(a,l.type))return o.concat(1).error(`"${a}" comparisons are not supported for type '${Oe(l.type)}'.`);let c=o.parse(s[2],2,ee);if(!c)return null;if(!ug(a,c.type))return o.concat(2).error(`"${a}" comparisons are not supported for type '${Oe(c.type)}'.`);if(l.type.kind!==c.type.kind&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error(`Cannot compare types '${Oe(l.type)}' and '${Oe(c.type)}'.`);i&&(l.type.kind==="value"&&c.type.kind!=="value"?l=new ai(c.type,[l]):l.type.kind!=="value"&&c.type.kind==="value"&&(c=new ai(l.type,[c])));let h=null;if(s.length===4){if(l.type.kind!=="string"&&c.type.kind!=="string"&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error("Cannot use collator to compare non-string types.");if(h=o.parse(s[3],3,ba),!h)return null}return new vA(l,c,h)}evaluate(s){const o=this.lhs.evaluate(s),a=this.rhs.evaluate(s);if(i&&this.hasUntypedArgument){const l=qe(o),c=qe(a);if(l.kind!==c.kind||!(l.kind==="string"||l.kind==="number"))throw new We(`Expected arguments for "${n}" to be (string, string) or (number, number), but found (${l.kind}, ${c.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const l=qe(o),c=qe(a);if(l.kind!=="string"||c.kind!=="string")return e(s,o,a)}return this.collator?t(s,o,a,this.collator.evaluate(s)):e(s,o,a)}eachChild(s){s(this.lhs),s(this.rhs),this.collator&&s(this.collator)}outputDefined(){return!0}}}const rE=Zr("==",Yx,dg),sE=Zr("!=",Kx,$x),oE=Zr("<",Zx,eE),aE=Zr(">",Qx,tE),lE=Zr("<=",qx,iE),cE=Zr(">=",Jx,nE);class Ba{constructor(e,t,i){this.type=ba,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(e.length!==2)return t.error("Expected one argument.");const i=e[1];if(typeof i!="object"||Array.isArray(i))return t.error("Collator options argument must be an object.");const r=t.parse(i["case-sensitive"]===void 0?!1:i["case-sensitive"],1,$);if(!r)return null;const s=t.parse(i["diacritic-sensitive"]===void 0?!1:i["diacritic-sensitive"],1,$);if(!s)return null;let o=null;return i.locale&&(o=t.parse(i.locale,1,ie),!o)?null:new Ba(r,s,o)}evaluate(e){return new gh(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class wh{constructor(e,t,i,r,s){this.type=ie,this.number=e,this.locale=t,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=s}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");const i=t.parse(e[1],1,N);if(!i)return null;const r=e[2];if(typeof r!="object"||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");let s=null;if(r.locale&&(s=t.parse(r.locale,1,ie),!s))return null;let o=null;if(r.currency&&(o=t.parse(r.currency,1,ie),!o))return null;let a=null;if(r["min-fraction-digits"]&&(a=t.parse(r["min-fraction-digits"],1,N),!a))return null;let l=null;return r["max-fraction-digits"]&&(l=t.parse(r["max-fraction-digits"],1,N),!l)?null:new wh(i,s,o,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class vh{constructor(e){this.type=Ta,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[1];if(!Array.isArray(i)&&typeof i=="object")return t.error("First argument must be an image or text section.");const r=[];let s=!1;for(let o=1;o<=e.length-1;++o){const a=e[o];if(s&&typeof a=="object"&&!Array.isArray(a)){s=!1;let l=null;if(a["font-scale"]&&(l=t.parse(a["font-scale"],1,N),!l))return null;let c=null;if(a["text-font"]&&(c=t.parse(a["text-font"],1,Mt(ie)),!c))return null;let h=null;if(a["text-color"]&&(h=t.parse(a["text-color"],1,wi),!h))return null;let u=null;if(a["vertical-align"]){if(typeof a["vertical-align"]=="string"&&!jx.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(u=t.parse(a["vertical-align"],1,ie),!u)return null}const d=r[r.length-1];d.scale=l,d.font=c,d.textColor=h,d.verticalAlign=u}else{const l=t.parse(e[o],1,ee);if(!l)return null;const c=l.type.kind;if(c!=="string"&&c!=="value"&&c!=="null"&&c!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");s=!0,r.push({content:l,scale:null,font:null,textColor:null,verticalAlign:null})}}return new vh(r)}evaluate(e){const t=i=>{const r=i.content.evaluate(e);return qe(r)===ao?new ph("",r,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new ph(ho(r),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)};return new Vi(this.sections.map(t))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Ch{constructor(e){this.type=ao,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");const i=t.parse(e[1],1,ie);return i?new Ch(i):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),i=yn.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}}class bh{constructor(e){this.type=N,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const i=t.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?t.error(`Expected argument of type string or array, but found ${Oe(i.type)} instead.`):new bh(i):null}evaluate(e){const t=this.input.evaluate(e);if(typeof t=="string")return[...t].length;if(Array.isArray(t))return t.length;throw new We(`Expected value to be of type string or array, but found ${Oe(qe(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const bi=8192;function hE(n,e){const t=uE(n[0]),i=fE(n[1]),r=Math.pow(2,e.z);return[Math.round(t*r*bi),Math.round(i*r*bi)]}function Th(n,e){const t=Math.pow(2,e.z),i=(n[0]/bi+e.x)/t,r=(n[1]/bi+e.y)/t;return[dE(i),gE(r)]}function uE(n){return(180+n)/360}function dE(n){return n*360-180}function fE(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function gE(n){return 360/Math.PI*Math.atan(Math.exp((180-n*360)*Math.PI/180))-90}function fo(n,e){n[0]=Math.min(n[0],e[0]),n[1]=Math.min(n[1],e[1]),n[2]=Math.max(n[2],e[0]),n[3]=Math.max(n[3],e[1])}function go(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function pE(n,e,t){return e[1]>n[1]!=t[1]>n[1]&&n[0]<(t[0]-e[0])*(n[1]-e[1])/(t[1]-e[1])+e[0]}function AE(n,e,t){const i=n[0]-e[0],r=n[1]-e[1],s=n[0]-t[0],o=n[1]-t[1];return i*o-s*r===0&&i*s<=0&&r*o<=0}function Na(n,e,t,i){const r=[e[0]-n[0],e[1]-n[1]],s=[i[0]-t[0],i[1]-t[1]];return xE(s,r)===0?!1:!!(gg(n,e,t,i)&&gg(t,i,n,e))}function mE(n,e,t){for(const i of t)for(let r=0;r0&&u<0||h<0&&u>0}function Rh(n,e,t){const i=[];for(let r=0;rt[2]){const r=i*.5;let s=n[0]-t[0]>r?-i:t[0]-n[0]>r?i:0;s===0&&(s=n[0]-t[2]>r?-i:t[2]-n[0]>r?i:0),n[0]+=s}fo(e,n)}function EE(n){n[0]=n[1]=1/0,n[2]=n[3]=-1/0}function mg(n,e,t,i){const r=Math.pow(2,i.z)*bi,s=[i.x*bi,i.y*bi],o=[];for(const a of n)for(const l of a){const c=[l.x+s[0],l.y+s[1]];Ag(c,e,t,r),o.push(c)}return o}function yg(n,e,t,i){const r=Math.pow(2,i.z)*bi,s=[i.x*bi,i.y*bi],o=[];for(const a of n){const l=[];for(const c of a){const h=[c.x+s[0],c.y+s[1]];fo(e,h),l.push(h)}o.push(l)}if(e[2]-e[0]<=r/2){EE(e);for(const a of o)for(const l of a)Ag(l,e,t,r)}return o}function wE(n,e){const t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=n.canonicalID();if(e.type==="Polygon"){const s=Rh(e.coordinates,i,r),o=mg(n.geometry(),t,i,r);if(!go(t,i))return!1;for(const a of o)if(!Qr(a,s))return!1}if(e.type==="MultiPolygon"){const s=pg(e.coordinates,i,r),o=mg(n.geometry(),t,i,r);if(!go(t,i))return!1;for(const a of o)if(!yE(a,s))return!1}return!0}function vE(n,e){const t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=n.canonicalID();if(e.type==="Polygon"){const s=Rh(e.coordinates,i,r),o=yg(n.geometry(),t,i,r);if(!go(t,i))return!1;for(const a of o)if(!fg(a,s))return!1}if(e.type==="MultiPolygon"){const s=pg(e.coordinates,i,r),o=yg(n.geometry(),t,i,r);if(!go(t,i))return!1;for(const a of o)if(!_E(a,s))return!1}return!0}class nr{constructor(e,t){this.type=$,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(co(e[1])){const i=e[1];if(i.type==="FeatureCollection"){const r=[];for(const s of i.features){const{type:o,coordinates:a}=s.geometry;o==="Polygon"&&r.push(a),o==="MultiPolygon"&&r.push(...a)}if(r.length){const s={type:"MultiPolygon",coordinates:r};return new nr(i,s)}}else if(i.type==="Feature"){const r=i.geometry.type;if(r==="Polygon"||r==="MultiPolygon")return new nr(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new nr(i,i)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return wE(e,this.geometries);if(e.geometryType()==="LineString")return vE(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class _g{constructor(e=[],t=(i,r)=>ir?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:i}=this,r=t[e];for(;e>0;){const s=e-1>>1,o=t[s];if(i(r,o)>=0)break;t[e]=o,e=s}t[e]=r}_down(e){const{data:t,compare:i}=this,r=this.length>>1,s=t[e];for(;e=0)break;t[e]=t[o],e=o}t[e]=s}}function CE(n,e){if(n.length<=1)return[n];const i=[];let r,s;for(const o of n){const a=bE(o);a!==0&&(o.area=Math.abs(a),s===void 0&&(s=a<0),s===a<0?(r&&i.push(r),r=[o]):r.push(o))}return r&&i.push(r),i}function bE(n){let e=0;for(let t=0,i=n.length,r=i-1,s,o;t1?(c=e[l+1][0],h=e[l+1][1]):g>0&&(c+=u/this.kx*g,h+=d/this.ky*g)),u=this.wrap(t[0]-c)*this.kx,d=(t[1]-h)*this.ky;const f=u*u+d*d;f180;)e-=360;return e}}const Ih=100,Ph=50;function vg(n,e){return e[0]-n[0]}function ja(n){return n[1]-n[0]+1}function Wi(n,e){return n[1]>=n[0]&&n[1]n[1])return[null,null];const t=ja(n);if(e){if(t===2)return[n,null];const r=Math.floor(t/2);return[[n[0],n[0]+r],[n[0]+r,n[1]]]}if(t===1)return[n,null];const i=Math.floor(t/2)-1;return[[n[0],n[0]+i],[n[0]+i+1,n[1]]]}function Fh(n,e){if(!Wi(e,n.length))return[1/0,1/0,-1/0,-1/0];const t=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)fo(t,n[i]);return t}function Lh(n){const e=[1/0,1/0,-1/0,-1/0];for(const t of n)for(const i of t)fo(e,i);return e}function Cg(n){return n[0]!==-1/0&&n[1]!==-1/0&&n[2]!==1/0&&n[3]!==1/0}function kh(n,e,t){if(!Cg(n)||!Cg(e))return NaN;let i=0,r=0;return n[2]e[2]&&(i=n[0]-e[2]),n[1]>e[3]&&(r=n[1]-e[3]),n[3]=i)return i;if(go(r,s)){if(bg(n,e))return 0}else if(bg(e,n))return 0;let o=1/0;for(const a of n)for(let l=0,c=a.length,h=c-1;l0;){const l=o.pop();if(l[0]>=s)continue;const c=l[1],h=e?Ph:Ih;if(ja(c)<=h){if(!Wi(c,n.length))return NaN;if(e){const u=PE(n,c,t,i);if(isNaN(u)||u===0)return u;s=Math.min(s,u)}else for(let u=c[0];u<=c[1];++u){const d=IE(n[u],t,i);if(s=Math.min(s,d),s===0)return 0}}else{const u=Mh(c,e);Tg(o,s,i,n,a,u[0]),Tg(o,s,i,n,a,u[1])}}return s}function Va(n,e,t,i,r,s=1/0){let o=Math.min(s,r.distance(n[0],t[0]));if(o===0)return o;const a=new _g([[0,[0,n.length-1],[0,t.length-1]]],vg);for(;a.length>0;){const l=a.pop();if(l[0]>=o)continue;const c=l[1],h=l[2],u=e?Ph:Ih,d=i?Ph:Ih;if(ja(c)<=u&&ja(h)<=d){if(!Wi(c,n.length)&&Wi(h,t.length))return NaN;let g;if(e&&i)g=RE(n,c,t,h,r),o=Math.min(o,g);else if(e&&!i){const f=n.slice(c[0],c[1]+1);for(let p=h[0];p<=h[1];++p)if(g=rr(t[p],f,r),o=Math.min(o,g),o===0)return o}else if(!e&&i){const f=t.slice(h[0],h[1]+1);for(let p=c[0];p<=c[1];++p)if(g=rr(n[p],f,r),o=Math.min(o,g),o===0)return o}else g=SE(n,c,t,h,r),o=Math.min(o,g)}else{const g=Mh(c,e),f=Mh(h,i);za(a,o,r,n,t,g[0],f[0]),za(a,o,r,n,t,g[0],f[1]),za(a,o,r,n,t,g[1],f[0]),za(a,o,r,n,t,g[1],f[1])}}return o}function FE(n,e){const t=n.geometry(),i=t.flat().map(o=>Th([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new Sh(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,Va(i,!1,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,Va(i,!1,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,Ua(i,!1,o.coordinates,r,s));break}if(s===0)return s}return s}function LE(n,e){const t=n.geometry(),i=t.flat().map(o=>Th([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new Sh(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,Va(i,!0,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,Va(i,!0,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,Ua(i,!0,o.coordinates,r,s));break}if(s===0)return s}return s}function kE(n,e){const t=n.geometry();if(t.length===0||t[0].length===0)return NaN;const i=CE(t).map(o=>o.map(a=>a.map(l=>Th([l.x,l.y],n.canonical)))),r=new Sh(i[0][0][0][1]);let s=1/0;for(const o of e)for(const a of i){switch(o.type){case"Point":s=Math.min(s,Ua([o.coordinates],!1,a,r,s));break;case"LineString":s=Math.min(s,Ua(o.coordinates,!0,a,r,s));break;case"Polygon":s=Math.min(s,ME(a,o.coordinates,r,s));break}if(s===0)return s}return s}function Oh(n){return n.type==="MultiPolygon"?n.coordinates.map(e=>({type:"Polygon",coordinates:e})):n.type==="MultiLineString"?n.coordinates.map(e=>({type:"LineString",coordinates:e})):n.type==="MultiPoint"?n.coordinates.map(e=>({type:"Point",coordinates:e})):[n]}class sr{constructor(e,t){this.type=N,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(co(e[1])){const i=e[1];if(i.type==="FeatureCollection")return new sr(i,i.features.map(r=>Oh(r.geometry)).flat());if(i.type==="Feature")return new sr(i,Oh(i.geometry));if("type"in i&&"coordinates"in i)return new sr(i,Oh(i))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return FE(e,this.geometries);if(e.geometryType()==="LineString")return LE(e,this.geometries);if(e.geometryType()==="Polygon")return kE(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Wa={"==":rE,"!=":sE,">":aE,"<":oE,">=":cE,"<=":lE,array:ai,at:Ah,boolean:ai,case:_h,coalesce:uo,collator:Ba,format:vh,image:Ch,in:mh,"index-of":Da,interpolate:Ci,"interpolate-hcl":Ci,"interpolate-lab":Ci,length:bh,let:La,literal:Kr,match:yh,number:ai,"number-format":wh,object:ai,slice:Oa,step:Ga,string:ai,"to-boolean":_n,"to-color":_n,"to-number":_n,"to-string":_n,var:ka,within:nr,distance:sr};class Ft{constructor(e,t,i,r){this.name=e,this.type=t,this._evaluate=i,this.args=r}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const i=e[0],r=Ft.definitions[i];if(!r)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const s=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter(([c])=>!Array.isArray(c)||c.length===e.length-1);let l=null;for(const[c,h]of a){l=new Fa(t.registry,Ha,t.path,null,t.scope);const u=[];let d=!1;for(let g=1;gOE(d)).join(" | "),u=[];for(let d=1;d"u"?null:t}function DE(n,e,t,i){for(;t<=i;){const r=t+i>>1;if(e[r]===n)return!0;e[r]>n?i=r-1:t=r+1}return!1}function or(n){return{type:n}}Ft.register(Wa,{error:[Px,[ie],(n,[e])=>{throw new We(e.evaluate(n))}],typeof:[ie,[ee],(n,[e])=>Oe(qe(e.evaluate(n)))],"to-rgba":[Mt(N,4),[wi],(n,[e])=>{const[t,i,r,s]=e.evaluate(n).rgb;return[t*255,i*255,r*255,s]}],rgb:[wi,[N,N,N],Rg],rgba:[wi,[N,N,N,N],Rg],has:{type:$,overloads:[[[ie],(n,[e])=>Sg(e.evaluate(n),n.properties())],[[ie,Wr],(n,[e,t])=>Sg(e.evaluate(n),t.evaluate(n))]]},get:{type:ee,overloads:[[[ie],(n,[e])=>Gh(e.evaluate(n),n.properties())],[[ie,Wr],(n,[e,t])=>Gh(e.evaluate(n),t.evaluate(n))]]},"feature-state":[ee,[ie],(n,[e])=>Gh(e.evaluate(n),n.featureState||{})],properties:[Wr,[],n=>n.properties()],"geometry-type":[ie,[],n=>n.geometryType()],id:[ee,[],n=>n.id()],zoom:[N,[],n=>n.globals.zoom],"heatmap-density":[N,[],n=>n.globals.heatmapDensity||0],"line-progress":[N,[],n=>n.globals.lineProgress||0],accumulated:[ee,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[N,or(N),(n,e)=>{let t=0;for(const i of e)t+=i.evaluate(n);return t}],"*":[N,or(N),(n,e)=>{let t=1;for(const i of e)t*=i.evaluate(n);return t}],"-":{type:N,overloads:[[[N,N],(n,[e,t])=>e.evaluate(n)-t.evaluate(n)],[[N],(n,[e])=>-e.evaluate(n)]]},"/":[N,[N,N],(n,[e,t])=>e.evaluate(n)/t.evaluate(n)],"%":[N,[N,N],(n,[e,t])=>e.evaluate(n)%t.evaluate(n)],ln2:[N,[],()=>Math.LN2],pi:[N,[],()=>Math.PI],e:[N,[],()=>Math.E],"^":[N,[N,N],(n,[e,t])=>Math.pow(e.evaluate(n),t.evaluate(n))],sqrt:[N,[N],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[N,[N],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[N,[N],(n,[e])=>Math.log(e.evaluate(n))],log2:[N,[N],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[N,[N],(n,[e])=>Math.sin(e.evaluate(n))],cos:[N,[N],(n,[e])=>Math.cos(e.evaluate(n))],tan:[N,[N],(n,[e])=>Math.tan(e.evaluate(n))],asin:[N,[N],(n,[e])=>Math.asin(e.evaluate(n))],acos:[N,[N],(n,[e])=>Math.acos(e.evaluate(n))],atan:[N,[N],(n,[e])=>Math.atan(e.evaluate(n))],min:[N,or(N),(n,e)=>Math.min(...e.map(t=>t.evaluate(n)))],max:[N,or(N),(n,e)=>Math.max(...e.map(t=>t.evaluate(n)))],abs:[N,[N],(n,[e])=>Math.abs(e.evaluate(n))],round:[N,[N],(n,[e])=>{const t=e.evaluate(n);return t<0?-Math.round(-t):Math.round(t)}],floor:[N,[N],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[N,[N],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[$,[ie,ee],(n,[e,t])=>n.properties()[e.value]===t.value],"filter-id-==":[$,[ee],(n,[e])=>n.id()===e.value],"filter-type-==":[$,[ie],(n,[e])=>n.geometryType()===e.value],"filter-<":[$,[ie,ee],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i{const t=n.id(),i=e.value;return typeof t==typeof i&&t":[$,[ie,ee],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>r}],"filter-id->":[$,[ee],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>i}],"filter-<=":[$,[ie,ee],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[$,[ee],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<=i}],"filter->=":[$,[ie,ee],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[$,[ee],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>=i}],"filter-has":[$,[ee],(n,[e])=>e.value in n.properties()],"filter-has-id":[$,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[$,[Mt(ie)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[$,[Mt(ee)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[$,[ie,Mt(ee)],(n,[e,t])=>t.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[$,[ie,Mt(ee)],(n,[e,t])=>DE(n.properties()[e.value],t.value,0,t.value.length-1)],all:{type:$,overloads:[[[$,$],(n,[e,t])=>e.evaluate(n)&&t.evaluate(n)],[or($),(n,e)=>{for(const t of e)if(!t.evaluate(n))return!1;return!0}]]},any:{type:$,overloads:[[[$,$],(n,[e,t])=>e.evaluate(n)||t.evaluate(n)],[or($),(n,e)=>{for(const t of e)if(t.evaluate(n))return!0;return!1}]]},"!":[$,[$],(n,[e])=>!e.evaluate(n)],"is-supported-script":[$,[ie],(n,[e])=>{const t=n.globals&&n.globals.isSupportedScript;return t?t(e.evaluate(n)):!0}],upcase:[ie,[ie],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[ie,[ie],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[ie,or(ee),(n,e)=>e.map(t=>ho(t.evaluate(n))).join("")],"resolved-locale":[ie,[ba],(n,[e])=>e.evaluate(n).resolvedLocale()]});function OE(n){return Array.isArray(n)?`(${n.map(Oe).join(", ")})`:`(${Oe(n.type)}...)`}function Ha(n){if(n instanceof ka)return Ha(n.boundExpression);if(n instanceof Ft&&n.name==="error")return!1;if(n instanceof Ba)return!1;if(n instanceof nr)return!1;if(n instanceof sr)return!1;const e=n instanceof _n||n instanceof ai;let t=!0;return n.eachChild(i=>{e?t=t&&Ha(i):t=t&&i instanceof Kr}),t?Bh(n)&&jh(n,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Bh(n){if(n instanceof Ft){if(n.name==="get"&&n.args.length===1)return!1;if(n.name==="feature-state")return!1;if(n.name==="has"&&n.args.length===1)return!1;if(n.name==="properties"||n.name==="geometry-type"||n.name==="id")return!1;if(/^filter-/.test(n.name))return!1}if(n instanceof nr||n instanceof sr)return!1;let e=!0;return n.eachChild(t=>{e&&!Bh(t)&&(e=!1)}),e}function Nh(n){if(n instanceof Ft&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(t=>{e&&!Nh(t)&&(e=!1)}),e}function jh(n,e){if(n instanceof Ft&&e.indexOf(n.name)>=0)return!1;let t=!0;return n.eachChild(i=>{t&&!jh(i,e)&&(t=!1)}),t}function zh(n){return{result:"success",value:n}}function qr(n){return{result:"error",value:n}}function GE(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function BE(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function NE(n){return!!n.expression&&n.expression.interpolated}function Ig(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}class jE{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new lg,this._defaultValue=t?WE(t):null,this._enumValues=t&&t.type==="enum"?t.values:null}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,t,i,r,s,o){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=o||null;try{const a=this.expression.evaluate(this._evaluator);if(a==null||typeof a=="number"&&a!==a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new We(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", ")}, but found ${JSON.stringify(a)} instead.`);return a}catch(a){return this._warningHistory[a.message]||(this._warningHistory[a.message]=!0,typeof console<"u"&&console.warn(a.message)),this._defaultValue}}}function zE(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in Wa}function Pg(n,e){const t=new Fa(Wa,Ha,[],e?VE(e):void 0),i=t.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return i?zh(new jE(i,e)):qr(t.errors)}class Mg{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Nh(t.expression)}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,s,o)}evaluate(e,t,i,r,s,o){return this._styleExpression.evaluate(e,t,i,r,s,o)}}class Fg{constructor(e,t,i,r){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Nh(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,i,r,s,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,s,o)}evaluate(e,t,i,r,s,o){return this._styleExpression.evaluate(e,t,i,r,s,o)}interpolationFactor(e,t,i){return this.interpolationType?Ci.interpolationFactor(this.interpolationType,e,t,i):0}}function UE(n,e){const t=Pg(n,e);if(t.result==="error")return t;const i=t.value.expression,r=Bh(i);if(!r&&!GE(e))return qr([new Ei("","data expressions not supported")]);const s=jh(i,["zoom"]);if(!s&&!BE(e))return qr([new Ei("","zoom expressions not supported")]);const o=Xa(i);if(!o&&!s)return qr([new Ei("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Ei)return qr([o]);if(o instanceof Ci&&!NE(e))return qr([new Ei("",'"interpolate" expressions cannot be used with this property')]);if(!o)return zh(r?new Mg("constant",t.value):new Mg("source",t.value));const a=o instanceof Ci?o.interpolation:void 0;return zh(r?new Fg("camera",t.value,o.labels,a):new Fg("composite",t.value,o.labels,a))}function Xa(n){let e=null;if(n instanceof La)e=Xa(n.result);else if(n instanceof uo){for(const t of n.args)if(e=Xa(t),e)break}else(n instanceof Ga||n instanceof Ci)&&n.input instanceof Ft&&n.input.name==="zoom"&&(e=n);return e instanceof Ei||n.eachChild(t=>{const i=Xa(t);i instanceof Ei?e=i:!e&&i?e=new Ei("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Ei("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function VE(n){const e={color:wi,string:ie,number:N,enum:ie,boolean:$,formatted:Ta,padding:Ra,projectionDefinition:Ca,resolvedImage:ao,variableAnchorOffsetCollection:Sa};return n.type==="array"?Mt(e[n.value]||ee,n.length):e[n.type]}function WE(n){return n.type==="color"&&Ig(n.default)?new Se(0,0,0,0):n.type==="color"?Se.parse(n.default)||null:n.type==="padding"?si.parse(n.default)||null:n.type==="variableAnchorOffsetCollection"?vi.parse(n.default)||null:n.type==="projectionDefinition"?oi.parse(n.default)||null:n.default===void 0?null:n.default}function Lg(n){if(n===!0||n===!1)return!0;if(!Array.isArray(n)||n.length===0)return!1;switch(n[0]){case"has":return n.length>=2&&n[1]!=="$id"&&n[1]!=="$type";case"in":return n.length>=3&&(typeof n[1]!="string"||Array.isArray(n[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return n.length!==3||Array.isArray(n[1])||Array.isArray(n[2]);case"any":case"all":for(const e of n.slice(1))if(!Lg(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const HE={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function XE(n){if(n==null)return{filter:()=>!0,needGeometry:!1};Lg(n)||(n=Ya(n));const e=Pg(n,HE);if(e.result==="error")throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));{const t=kg(n);return{filter:(i,r,s)=>e.value.evaluate(i,r,{},s),needGeometry:t}}}function YE(n,e){return ne?1:0}function kg(n){if(!Array.isArray(n))return!1;if(n[0]==="within"||n[0]==="distance")return!0;for(let e=1;e"||e==="<="||e===">="?Uh(n[1],n[2],e):e==="any"?KE(n.slice(1)):e==="all"?["all"].concat(n.slice(1).map(Ya)):e==="none"?["all"].concat(n.slice(1).map(Ya).map(Ka)):e==="in"?Dg(n[1],n.slice(2)):e==="!in"?Ka(Dg(n[1],n.slice(2))):e==="has"?Og(n[1]):e==="!has"?Ka(Og(n[1])):!0}function Uh(n,e,t){switch(n){case"$type":return[`filter-type-${t}`,e];case"$id":return[`filter-id-${t}`,e];default:return[`filter-${t}`,n,e]}}function KE(n){return["any"].concat(n.map(Ya))}function Dg(n,e){if(e.length===0)return!1;switch(n){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",n,["literal",e.sort(YE)]]:["filter-in-small",n,["literal",e]]}}function Og(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function Ka(n){return["!",n]}function po(n){return typeof n=="object"?["literal",n]:n}function ZE(n,e){let t=n.stops;if(!t)return QE(n,e);const i=t&&typeof t[0][0]=="object",r=i||n.property!==void 0,s=i||!r;return t=t.map(o=>!r&&e.tokens&&typeof o[1]=="string"?[o[0],e1(o[1])]:[o[0],po(o[1])]),i?qE(n,e,t):s?$E(n,e,t):Wh(n,e,t)}function QE(n,e){const t=["get",n.property];if(n.default===void 0)return e.type==="string"?["string",t]:t;if(e.type==="enum")return["match",t,Object.keys(e.values),t,n.default];{const i=[e.type==="color"?"to-color":e.type,t,po(n.default)];return e.type==="array"&&i.splice(1,0,e.value,e.length||null),i}}function Vh(n){switch(n.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function qE(n,e,t){const i={},r={},s=[];for(let a=0;a3&&e===n[n.length-2]||(i&&n.length===2||n.push(e),n.push(t))}function Xh(n,e){return n.type?n.type:e.expression.interpolated?"exponential":"interval"}function e1(n){const e=["concat"],t=/{([^{}]+)}/g;let i=0;for(let r=t.exec(n);r!==null;r=t.exec(n)){const s=n.slice(i,t.lastIndex-r[0].length);i=t.lastIndex,s.length>0&&e.push(s),e.push(["get",r[1]])}if(e.length===1)return n;if(i1?d[d.length-2].toLowerCase():"";if(g==f||g==f.replace("-","")||p+"-"+g==f){r=a?r:Bg[f],d.pop(),p&&f.startsWith(p)&&d.pop();break}}!a&&typeof g=="number"&&(r=g,a=!0);var A=d.join(Ao).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");A.indexOf(Ao)!==-1&&(A='"'+A+'"'),o.push(A)}i=jg[n]=[s,r,o]}return i[0]+Ao+i[1]+Ao+e+"px"+(t?"/"+t:"")+Ao+i[2]}class zg{drawCustom(e,t,i,r,s){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,i){}drawFeature(e,t,i){}drawGeometryCollection(e,t,i){}drawLineString(e,t,i){}drawMultiLineString(e,t,i){}drawMultiPoint(e,t,i){}drawMultiPolygon(e,t,i){}drawPoint(e,t,i){}drawPolygon(e,t,i){}drawText(e,t,i){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}}class i1 extends zg{constructor(e,t,i,r,s,o,a){super(),this.context_=e,this.pixelRatio_=t,this.extent_=i,this.transform_=r,this.transformRotation_=r?Is(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=s,this.squaredTolerance_=o,this.userTransform_=a,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=mt()}drawImages_(e,t,i,r){if(!this.image_)return;const s=hn(e,t,i,r,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=l*this.imageOpacity_);let c=this.imageRotation_;this.transformRotation_===0&&(c-=this.viewRotation_),this.imageRotateWithView_&&(c+=this.viewRotation_);for(let h=0,u=s.length;hu*this.pixelRatio_),lineDashOffset:(o||zi)*this.pixelRatio_,lineJoin:a!==void 0?a:zr,lineWidth:(l!==void 0?l:io)*this.pixelRatio_,miterLimit:c!==void 0?c:$s,strokeStyle:_i(i||eo)}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}const i=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),s=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*i,this.imageAnchorY_=r[1]*i,this.imageHeight_=t[1]*i,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();const o=e.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=t[0]*i}setTextStyle(e){if(!e)this.text_="";else{const t=e.getFill();if(!t)this.textFillState_=null;else{const g=t.getColor();this.textFillState_={fillStyle:_i(g||xt)}}const i=e.getStroke();if(!i)this.textStrokeState_=null;else{const g=i.getColor(),f=i.getLineCap(),p=i.getLineDash(),A=i.getLineDashOffset(),m=i.getLineJoin(),y=i.getWidth(),E=i.getMiterLimit();this.textStrokeState_={lineCap:f!==void 0?f:jr,lineDash:p||ji,lineDashOffset:A||zi,lineJoin:m!==void 0?m:zr,lineWidth:y!==void 0?y:io,miterLimit:E!==void 0?E:$s,strokeStyle:_i(g||eo)}}const r=e.getFont(),s=e.getOffsetX(),o=e.getOffsetY(),a=e.getRotateWithView(),l=e.getRotation(),c=e.getScaleArray(),h=e.getText(),u=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r!==void 0?r:bf,textAlign:u!==void 0?u:to,textBaseline:d!==void 0?d:ca},this.text_=h!==void 0?Array.isArray(h)?h.reduce((g,f,p)=>g+=p%2?" ":f,""):h:"",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_*c[0],this.pixelRatio_*c[1]]}}}const n1=.5,Ug={Point:u1,LineString:l1,Polygon:f1,MultiPoint:d1,MultiLineString:c1,MultiPolygon:h1,GeometryCollection:a1,Circle:s1};function r1(n,e){return parseInt(Y(n),10)-parseInt(Y(e),10)}function Kh(n,e){const t=Vg(n,e);return t*t}function Vg(n,e){return n1*n/e}function s1(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(s||o){const l=n.getBuilder(t.getZIndex(),"Circle");l.setFillStrokeStyle(s,o),l.drawCircle(e,i,r)}const a=t.getText();if(a&&a.getText()){const l=n.getBuilder(t.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,i)}}function Za(n,e,t,i,r,s,o,a){const l=[],c=t.getImage();if(c){let d=!0;const g=c.getImageState();g==V.LOADED||g==V.ERROR?d=!1:g==V.IDLE&&c.load(),d&&l.push(c.ready())}const h=t.getFill();h&&h.loading()&&l.push(h.ready());const u=l.length>0;return u&&Promise.all(l).then(()=>r(null)),o1(n,e,t,i,s,o,a),u}function o1(n,e,t,i,r,s,o){const a=t.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(i,r);if(t.getRenderer())Wg(n,l,t,e,o);else{const h=Ug[l.getType()];h(n,l,t,e,o,s)}}function Wg(n,e,t,i,r){if(e.getType()=="GeometryCollection"){const o=e.getGeometries();for(let a=0,l=o.length;a=200&&a.status<300){const c=e.getType();try{let h;c=="text"||c=="json"?h=a.responseText:c=="xml"?h=a.responseXML||a.responseText:c=="arraybuffer"&&(h=a.response),h?s(e.readFeatures(h,{extent:t,featureProjection:r}),e.readProjection(h)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function Xg(n,e){return function(t,i,r,s,o){Hg(n,e,t,i,r,(a,l)=>{this.addFeatures(a),s!==void 0&&s(a)},()=>{this.changed(),o!==void 0&&o()})}}function p1(n,e){return[[-1/0,-1/0,1/0,1/0]]}function A1(n,e){return[n]}class Zh{constructor(e){this.rbush_=new ff(e),this.items_={}}insert(e,t){const i={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(i),this.items_[Y(t)]=i}load(e,t){const i=new Array(t.length);for(let r=0,s=t.length;rn):null}const wt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class xn extends Tt{constructor(e,t,i){super(e),this.feature=t,this.features=i}}class En extends $r{constructor(e){e=e||{},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0}),this.on,this.once,this.un,this.loader_=bs,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader!==void 0?this.loader_=e.loader:this.url_!==void 0&&(ge(this.format_,"`format` must be set when `url` is set"),this.loader_=Xg(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:p1;const t=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=t?new Zh:null,this.loadedExtentsRtree_=new Zh,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,r;Array.isArray(e.features)?r=e.features:e.features&&(i=e.features,r=i.getArray()),!t&&i===void 0&&(i=new Gt(r)),r!==void 0&&this.addFeaturesInternal(r),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const t=Y(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);const i=e.getGeometry();if(i){const r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new xn(wt.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof tt||(this.featureChangeKeys_[e]=[oe(t,H.CHANGE,this.handleFeatureChange_,this),oe(t,vr.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let i=!0;if(t.getId()!==void 0){const r=String(t.getId());if(!(r in this.idIndex_))this.idIndex_[r]=t;else if(t instanceof tt){const s=this.idIndex_[r];s instanceof tt?Array.isArray(s)?s.push(t):this.idIndex_[r]=[s,t]:i=!1}else i=!1}return i&&(ge(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),i}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const t=[],i=[],r=[];for(let s=0,o=e.length;s{t||(t=!0,this.addFeature(i.element),t=!1)}),e.addEventListener(ot.REMOVE,i=>{t||(t=!0,this.removeFeature(i.element),t=!1)}),this.featuresCollection_=e}clear(e){if(e){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(ve);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(i=>{this.removeFeatureInternal(i)});for(const i in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const t=new xn(wt.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){const i=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(i,function(r){const s=r.getGeometry();if(s instanceof tt||s.intersectsCoordinate(e))return t(r)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(i){const r=i.getGeometry();if(r instanceof tt||r.intersectsExtent(e)){const s=t(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),rn(this.nullGeometryFeatures_)||gi(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const t=[];return this.forEachFeatureAtCoordinateDirect(e,function(i){t.push(i)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);const r=zl(e,t);return[].concat(...r.map(s=>this.featuresRtree_.getInExtent(s)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){const i=e[0],r=e[1];let s=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return t=t||Cr,this.featuresRtree_.forEachInExtent(l,function(c){if(t(c)){const h=c.getGeometry(),u=a;if(a=h instanceof tt?0:h.closestPointXY(i,r,o,a),a{--this.loadingExtentsCount_,this.dispatchEvent(new xn(wt.FEATURESLOADEND,void 0,h))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new xn(wt.FEATURESLOADERROR))}),r.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(e){const t=this.loadedExtentsRtree_,i=t.forEachInExtent(e,function(r){if(Gi(r.extent,e))return r});i&&t.remove(i)}removeFeatures(e){let t=!1;for(let i=0,r=e.length;il&&(this.instructions.push([K.CUSTOM,l,h,e,i,dn,s]),this.hitDetectionInstructions.push([K.CUSTOM,l,h,e,r||i,dn,s]));break;case"Point":c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),h=this.coordinates.length,this.instructions.push([K.CUSTOM,l,h,e,i,void 0,s]),this.hitDetectionInstructions.push([K.CUSTOM,l,h,e,r||i,void 0,s]);break}this.endGeometry(t)}beginGeometry(e,t,i){this.beginGeometryInstruction1_=[K.BEGIN_GEOMETRY,t,0,e,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[K.BEGIN_GEOMETRY,t,0,e,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const e=this.hitDetectionInstructions;e.reverse();let t;const i=e.length;let r,s,o=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=t.lineWidth,this.bufferedMaxExtent_=null)}else t.strokeStyle=void 0,t.lineCap=void 0,t.lineDash=null,t.lineDashOffset=void 0,t.lineJoin=void 0,t.lineWidth=void 0,t.miterLimit=void 0;return t}setFillStrokeStyle(e,t){const i=this.state;this.fillStyleToState(e,i),this.strokeStyleToState(t,i)}createFill(e){const t=e.fillStyle,i=[K.SET_FILL_STYLE,t];return typeof t!="string"&&i.push(e.fillPatternScale),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[K.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash?this.applyPixelRatio(e.lineDash):null,e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,t){const i=e.fillStyle;(typeof i!="string"||e.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(t.call(this,e)),e.currentFillStyle=i)}updateStrokeStyle(e,t){const i=e.strokeStyle,r=e.lineCap,s=e.lineDash,o=e.lineDashOffset,a=e.lineJoin,l=e.lineWidth,c=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||s!=e.currentLineDash&&!Fi(e.currentLineDash,s)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=l||e.currentMiterLimit!=c)&&(i!==void 0&&t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=s,e.currentLineDashOffset=o,e.currentLineJoin=a,e.currentLineWidth=l,e.currentMiterLimit=c)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const t=[K.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=hd(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;Di(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class m1 extends mo{constructor(e,t,i,r){super(e,t,i,r),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(e,t,i){if(!this.image_||this.maxExtent&&!Nn(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,t,i);const r=e.getFlatCoordinates(),s=e.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(r,s);this.instructions.push([K.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([K.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(t)}drawMultiPoint(e,t,i){if(!this.image_)return;this.beginGeometry(e,t,i);const r=e.getFlatCoordinates(),s=[];for(let l=0,c=r.length;l=n){const f=(n-a+g)/g,p=Rt(c,u,f),A=Rt(h,d,f);l.push(p,A),s.push(l),l=[p,A],a==n&&(o+=r),a=0}else if(a0&&s.push(l),s}function x1(n,e,t,i,r){let s=t,o=t,a=0,l=0,c=t,h,u,d,g,f,p,A,m,y,E;for(u=t;un&&(l>a&&(a=l,s=c,o=u),l=0,c=u-r)),d=g,A=y,m=E),f=x,p=_}return l+=g,l>a?[c,u]:[s,o]}const qa={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class E1 extends mo{constructor(e,t,i,r){super(e,t,i,r),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[xt]={fillStyle:xt},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 e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t,i){const r=this.textFillState_,s=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!r&&!s)return;const a=this.coordinates;let l=a.length;const c=e.getType();let h=null,u=e.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!Be(this.maxExtent,e.getExtent()))return;let d;if(h=e.getFlatCoordinates(),c=="LineString")d=[h.length];else if(c=="MultiLineString")d=e.getEnds();else if(c=="Polygon")d=e.getEnds().slice(0,1);else if(c=="MultiPolygon"){const A=e.getEndss();d=[];for(let m=0,y=A.length;m{const v=a[(x+w)*2]===h[w*u]&&a[(x+w)*2+1]===h[w*u+1];return v||--x,v})}this.saveTextStates_();const f=o.backgroundFill?this.createFill(this.fillStyleToState(o.backgroundFill)):null,p=o.backgroundStroke?this.createStroke(this.strokeStyleToState(o.backgroundStroke)):null;this.beginGeometry(e,t,i);let A=o.padding;if(A!=qn&&(o.scale[0]<0||o.scale[1]<0)){let x=o.padding[0],_=o.padding[1],w=o.padding[2],v=o.padding[3];o.scale[0]<0&&(_=-_,v=-v),o.scale[1]<0&&(x=-x,w=-w),A=[x,_,w,v]}const m=this.pixelRatio;this.instructions.push([K.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,A==qn?qn:A.map(function(x){return x*m}),f,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const y=1/m,E=f?f.slice(0):null;E&&(E[1]=xt),this.hitDetectionInstructions.push([K.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[y,y],NaN,this.declutterMode_,this.declutterImageWithText_,A,E,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?xt:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),this.endGeometry(t)}}saveTextStates_(){const e=this.textStrokeState_,t=this.textState_,i=this.textFillState_,r=this.strokeKey_;e&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:t.font,textAlign:t.textAlign||to,justify:t.justify,textBaseline:t.textBaseline||ca,scale:t.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(e,t){const i=this.textStrokeState_,r=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,c=qa[r.textBaseline],h=this.textOffsetY_*l,u=this.text_,d=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([K.DRAW_CHARS,e,t,c,r.overflow,a,r.maxAngle,l,h,s,d*l,u,o,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([K.DRAW_CHARS,e,t,c,r.overflow,a&&xt,r.maxAngle,l,h,s,d*l,u,o,1/l,this.declutterMode_,this.textKeepUpright_])}setTextStyle(e,t){let i,r,s;if(!e)this.text_="";else{const o=e.getFill();o?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=_i(o.getColor()||xt)):(r=null,this.textFillState_=r);const a=e.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const p=a.getLineDash(),A=a.getLineDashOffset(),m=a.getWidth(),y=a.getMiterLimit();s.lineCap=a.getLineCap()||jr,s.lineDash=p?p.slice():ji,s.lineDashOffset=A===void 0?zi:A,s.lineJoin=a.getLineJoin()||zr,s.lineWidth=m===void 0?io:m,s.miterLimit=y===void 0?$s:y,s.strokeStyle=_i(a.getColor()||eo)}i=this.textState_;const l=e.getFont()||bf;K0(l);const c=e.getScaleArray();i.overflow=e.getOverflow(),i.font=l,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.repeat=e.getRepeat(),i.justify=e.getJustify(),i.textBaseline=e.getTextBaseline()||ca,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||qn,i.scale=c===void 0?[1,1]:c;const h=e.getOffsetX(),u=e.getOffsetY(),d=e.getRotateWithView(),g=e.getKeepUpright(),f=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=h===void 0?0:h,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textKeepUpright_=g===void 0?!0:g,this.textRotation_=f===void 0?0:f,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:Y(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=r&&r.fillStyle?typeof r.fillStyle=="string"?r.fillStyle:"|"+Y(r.fillStyle):""}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}const w1={Circle:Zg,Default:mo,Image:m1,LineString:y1,Polygon:Zg,Text:E1};class Qg{constructor(e,t,i,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=i,this.buildersByZIndex_={}}finish(){const e={};for(const t in this.buildersByZIndex_){e[t]=e[t]||{};const i=this.buildersByZIndex_[t];for(const r in i){const s=i[r].finish();e[t][r]=s}}return e}getBuilder(e,t){const i=e!==void 0?e.toString():"0";let r=this.buildersByZIndex_[i];r===void 0&&(r={},this.buildersByZIndex_[i]=r);let s=r[t];if(s===void 0){const o=w1[t];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=s}return s}}function v1(n,e,t,i,r,s,o,a,l,c,h,u,d=!0){let g=n[e],f=n[e+1],p=0,A=0,m=0,y=0;function E(){p=g,A=f,e+=i,g=n[e],f=n[e+1],y+=m,m=Math.sqrt((g-p)*(g-p)+(f-A)*(f-A))}do E();while(eD[2]}else M=_>T;const k=Math.PI,I=[],R=v+i===e;e=v,m=0,y=C,g=n[e],f=n[e+1];let B;if(R){E(),B=Math.atan2(f-A,g-p),M&&(B+=B>0?-k:k);const D=(T+_)/2,z=(P+w)/2;return I[0]=[D,z,(b-s)/2,B,r],I}r=r.replace(/\n/g," ");for(let D=0,z=r.length;D0?-k:k),B!==void 0){let J=U-B;if(J+=J>k?-2*k:J<-k?2*k:0,Math.abs(J)>o)return null}B=U;const S=D;let X=0;for(;D(this.push_(e),this));this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(ta(),{get:(e,t)=>{if(typeof ta()[t]=="function")return this.push_(t),this.pushMethodArgs_},set:(e,t,i)=>(this.push_(t,i),!0)})}push_(...e){const t=this.instructions_,i=this.zIndex+this.offset_;t[i]||(t[i]=[]),t[i].push(...e)}pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(t=>{for(let i=0,r=t.length;i0&&n.push(`
`,""),n.push(e,""),n}function b1(n,e,t){return t%2===0&&(n+=e),n}class T1{constructor(e,t,i,r,s){this.overlaps=i,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=mt(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=s?new Qh:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,i,r){const s=e+t+i+r;if(this.labels_[s])return this.labels_[s];const o=r?this.strokeStates[r]:null,a=i?this.fillStates[i]:null,l=this.textStates[t],c=this.pixelRatio,h=[l.scale[0]*c,l.scale[1]*c],u=l.justify?qa[l.justify]:qh(Array.isArray(e)?e[0]:e,l.textAlign||to),d=r&&o.lineWidth?o.lineWidth:0,g=Array.isArray(e)?e:String(e).split(`
`).reduce(C1,[]),{width:f,height:p,widths:A,heights:m,lineWidths:y}=Q0(l,g),E=f+d,x=[],_=(E+2)*h[0],w=(p+d)*h[1],v={width:_<0?Math.floor(_):Math.ceil(_),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:x};(h[0]!=1||h[1]!=1)&&x.push("scale",h),r&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",d),x.push("lineCap",o.lineCap),x.push("lineJoin",o.lineJoin),x.push("miterLimit",o.miterLimit),x.push("setLineDash",[o.lineDash]),x.push("lineDashOffset",o.lineDashOffset)),i&&x.push("fillStyle",a.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");const C=.5-u;let b=u*E+C*d;const T=[],P=[];let M=0,k=0,I=0,R=0,B;for(let D=0,z=g.length;De?e-c:s,x=o+h>t?t-h:o,_=f[3]+E*d[0]+f[1],w=f[0]+x*d[1]+f[2],v=m-f[3],C=y-f[0];(p||u!==0)&&(vn[0]=v,Cn[0]=v,vn[1]=C,Hi[1]=C,Hi[0]=v+_,Xi[0]=Hi[0],Xi[1]=C+w,Cn[1]=Xi[1]);let b;return u!==0?(b=mi(mt(),i,r,1,1,u,-i,-r),Ye(b,vn),Ye(b,Hi),Ye(b,Xi),Ye(b,Cn),Ai(Math.min(vn[0],Hi[0],Xi[0],Cn[0]),Math.min(vn[1],Hi[1],Xi[1],Cn[1]),Math.max(vn[0],Hi[0],Xi[0],Cn[0]),Math.max(vn[1],Hi[1],Xi[1],Cn[1]),es)):Ai(Math.min(v,v+_),Math.min(C,C+w),Math.max(v,v+_),Math.max(C,C+w),es),g&&(m=Math.round(m),y=Math.round(y)),{drawImageX:m,drawImageY:y,drawImageW:E,drawImageH:x,originX:c,originY:h,declutterBox:{minX:es[0],minY:es[1],maxX:es[2],maxY:es[3],value:A},canvasTransform:b,scale:d}}replayImageOrLabel_(e,t,i,r,s,o,a){const l=!!(o||a),c=r.declutterBox,h=a?a[2]*r.scale[0]/2:0;return c.minX-h<=t[0]&&c.maxX+h>=0&&c.minY-h<=t[1]&&c.maxY+h>=0&&(l&&this.replayTextBackground_(e,vn,Hi,Xi,Cn,o,a),q0(e,r.canvasTransform,s,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){const t=this.alignAndScaleFill_;if(t){const i=Ye(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(i[0]%r,i[1]%r),t!==1&&e.scale(t,t),e.rotate(this.viewRotation_)}e.fill(),t&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.lineDashOffset=t[7],e.setLineDash(t[6])}drawLabelWithPointPlacement_(e,t,i,r){const s=this.textStates[t],o=this.createLabel(e,t,r,i),a=this.strokeStates[i],l=this.pixelRatio,c=qh(Array.isArray(e)?e[0]:e,s.textAlign||to),h=qa[s.textBaseline||ca],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*s.scale[0],g=c*d+2*(.5-c)*u,f=h*o.height/l+2*(.5-h)*u;return{label:o,anchorX:g,anchorY:f}}execute_(e,t,i,r,s,o,a,l){const c=this.zIndexContext_;let h;this.pixelCoordinates_&&Fi(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=hn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),ry(this.renderedTransform_,i));let u=0;const d=r.length;let g=0,f,p,A,m,y,E,x,_,w,v,C,b,T,P=0,M=0;const k=this.coordinateCache_,I=this.viewRotation_,R=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,B={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},D=this.instructions!=r||this.overlaps?0:200;let z,U,S,X;for(;uD&&(this.fill_(e),P=0),M>D&&(e.stroke(),M=0),!P&&!M&&(e.beginPath(),y=NaN,E=NaN),++u;break;case K.CIRCLE:g=O[1];const ce=h[g],J=h[g+1],he=h[g+2],me=h[g+3],Ee=he-ce,Me=me-J,j=Math.sqrt(Ee*Ee+Me*Me);e.moveTo(ce+j,J),e.arc(ce,J,j,0,2*Math.PI,!0),++u;break;case K.CLOSE_PATH:e.closePath(),++u;break;case K.CUSTOM:g=O[1],f=O[2];const Dt=O[3],Si=O[4],re=O[5];B.geometry=Dt,B.feature=z,u in k||(k[u]=[]);const Kt=k[u];re?re(h,g,f,2,Kt):(Kt[0]=h[g],Kt[1]=h[g+1],Kt.length=2),c&&(c.zIndex=O[6]),Si(Kt,B),++u;break;case K.DRAW_IMAGE:g=O[1],f=O[2],w=O[3],p=O[4],A=O[5];let He=O[6];const Ce=O[7],Ii=O[8],Ge=O[9],di=O[10];let Ot=O[11];const gt=O[12];let Zt=O[13];m=O[14]||"declutter";const je=O[15];if(!w&&O.length>=20){v=O[19],C=O[20],b=O[21],T=O[22];const bt=this.drawLabelWithPointPlacement_(v,C,b,T);w=bt.label,O[3]=w;const qi=O[23];p=(bt.anchorX-qi)*this.pixelRatio,O[4]=p;const qt=O[24];A=(bt.anchorY-qt)*this.pixelRatio,O[5]=A,He=w.height,O[6]=He,Zt=w.width,O[13]=Zt}let Ie;O.length>25&&(Ie=O[25]);let be,ye,de;O.length>17?(be=O[16],ye=O[17],de=O[18]):(be=qn,ye=null,de=null),di&&R?Ot+=I:!di&&!R&&(Ot-=I);let Xe=0;for(;g!Ja.includes(n));class $g{constructor(e,t,i,r,s,o,a){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=i,this.resolution_=t,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=mt(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,a)}clip(e,t){const i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()}createExecutors_(e,t){for(const i in e){let r=this.executorsByZIndex_[i];r===void 0&&(r={},this.executorsByZIndex_[i]=r);const s=e[i];for(const o in s){const a=s[o];r[o]=new T1(this.resolution_,this.pixelRatio_,this.overlaps_,a,t)}}}hasExecutors(e){for(const t in this.executorsByZIndex_){const i=this.executorsByZIndex_[t];for(let r=0,s=e.length;r0){if(!o||v==="none"||g!=="Image"&&g!=="Text"||o.includes(_)){const P=(d[b]-3)/4,M=r-P%a,k=r-(P/a|0),I=s(_,w,M*M+k*k);if(I)return I}h.clearRect(0,0,a,a);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(fi);let A,m,y,E,x;for(A=p.length-1;A>=0;--A){const _=p[A].toString();for(y=this.executorsByZIndex_[_],m=ts.length-1;m>=0;--m)if(g=ts[m],E=y[g],E!==void 0&&(x=E.executeHitDetection(h,l,i,f,u),x))return x}}getClipCoords(e){const t=this.maxExtent_;if(!t)return null;const i=t[0],r=t[1],s=t[2],o=t[3],a=[i,r,i,o,s,o,s,r];return hn(a,0,8,2,e,a),a}isEmpty(){return rn(this.executorsByZIndex_)}execute(e,t,i,r,s,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?tm:fi),o=o||ts;const c=ts.length;for(let h=0,u=l.length;hm.execute(_,t,i,r,s,a)),x&&E.restore(),y){y.offset();const _=l[h]*c+f;this.deferredZIndexContexts_[_]||(this.deferredZIndexContexts_[_]=[]),this.deferredZIndexContexts_[_].push(y)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(fi);for(let i=0,r=t.length;i{s.draw(this.renderedContext_),s.clear()}),e[t[i]].length=0}}const Jh={};function S1(n){if(Jh[n]!==void 0)return Jh[n];const e=n*2+1,t=n*n,i=new Array(t+1);for(let s=0;s<=n;++s)for(let o=0;o<=n;++o){const a=s*s+o*o;if(a>t)break;let l=i[a];l||(l=[],i[a]=l),l.push(((n+s)*e+(n+o))*4+3),s>0&&l.push(((n-s)*e+(n+o))*4+3),o>0&&(l.push(((n+s)*e+(n-o))*4+3),s>0&&l.push(((n-s)*e+(n-o))*4+3))}const r=[];for(let s=0,o=i.length;sthis.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return Q()}getData(e){return null}prepareFrame(e){return Q()}renderFrame(e,t){return Q()}forEachFeatureAtCoordinate(e,t,i,r,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){const t=e.target;(t.getState()===V.LOADED||t.getState()===V.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=V.LOADED&&t!=V.ERROR&&e.addEventListener(H.CHANGE,this.boundHandleImageChange_),t==V.IDLE&&(e.load(),t=e.getState()),t==V.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e&&e.getVisible()&&e.getSourceState()==="ready"&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const ip=[];let is=null;function M1(){is=Fe(1,1,void 0,{willReadFrequently:!0})}class $h extends P1{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=mt(),this.pixelTransform=mt(),this.inversePixelTransform=mt(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,i){is||M1(),is.clearRect(0,0,1,1);let r;try{is.drawImage(e,t,i,1,1,0,0,1,1),r=is.getImageData(0,0,1,1).data}catch{return is=null,null}return r}getBackground(e){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(e.viewState.resolution)),i||void 0}useContainer(e,t,i){const r=this.getLayer().getClassName();let s,o;if(e&&e.className===r&&(!i||e&&e.style.backgroundColor&&Fi(Br(e.style.backgroundColor),Br(i)))){const a=e.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&cy(o.canvas.style.transform,t)?(this.container=e,this.context=o,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=document.createElement("div"),s.className=r;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=Fe();const l=o.canvas;s.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=s,this.context=o}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(e,t,i){const r=ei(i),s=Go(i),o=Do(i),a=ko(i);Ye(t.coordinateToPixelTransform,r),Ye(t.coordinateToPixelTransform,s),Ye(t.coordinateToPixelTransform,o),Ye(t.coordinateToPixelTransform,a);const l=this.inversePixelTransform;Ye(l,r),Ye(l,s),Ye(l,o),Ye(l,a),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(s[0]),Math.round(s[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.clip()}prepareContainer(e,t){const i=e.extent,r=e.viewState.resolution,s=e.viewState.rotation,o=e.pixelRatio,a=Math.round(ne(i)/r*o),l=Math.round(De(i)/r*o);mi(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/o,1/o,s,-a/2,-l/2),Dd(this.inversePixelTransform,this.pixelTransform);const c=ly(this.pixelTransform);if(this.useContainer(t,c,this.getBackground(e)),!this.containerReused){const h=this.context.canvas;h.width!=a||h.height!=l?(h.width=a,h.height=l):this.context.clearRect(0,0,a,l),c!==h.style.transform&&(h.style.transform=c)}}dispatchRenderEvent_(e,t,i){const r=this.getLayer();if(r.hasListener(e)){const s=new zf(e,this.inversePixelTransform,i,t);r.dispatchEvent(s)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_(jt.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_(jt.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new Qh),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(jt.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(jt.POSTRENDER,this.context,e))}getRenderTransform(e,t,i,r,s,o,a){const l=s/2,c=o/2,h=r/t,u=-h,d=-e[0]+a,g=-e[1];return mi(this.tempTransform,l,c,h,u,-i,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class F1 extends $h{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=St(),this.wrappedRenderedExtent_=St(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(e,t,i){const r=t.extent,s=t.viewState,o=s.center,a=s.resolution,l=s.projection,c=s.rotation,h=l.getExtent(),u=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),g=t.pixelRatio,f=t.viewHints,p=!(f[ke.ANIMATING]||f[ke.INTERACTING]),A=this.context,m=Math.round(ne(r)/a*g),y=Math.round(De(r)/a*g),E=u.getWrapX()&&l.canWrapX(),x=E?ne(h):null,_=E?Math.ceil((r[2]-h[2])/x)+1:1;let w=E?Math.floor((r[0]-h[0])/x):0;do{let v=this.getRenderTransform(o,a,0,g,m,y,w*x);t.declutter&&(v=v.slice(0)),e.execute(A,[A.canvas.width,A.canvas.height],v,c,p,i===void 0?ts:i?Ja:R1,i?d&&t.declutter[d]:void 0)}while(++w<_)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=Fe(this.context.canvas.width,this.context.canvas.height,ip))}resetDrawContext_(){if(this.opacity_!==1){const e=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=e,zs(this.context),ip.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(e){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,e,!0)}renderDeferredInternal(e){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(e,t){const i=e.layerStatesArray[e.layerIndex];this.opacity_=i.opacity;const r=e.viewState;this.prepareContainer(e,t);const s=this.context,o=this.replayGroup_;let a=o&&!o.isEmpty();if(!a&&!(this.getLayer().hasListener(jt.PRERENDER)||this.getLayer().hasListener(jt.POSTRENDER)))return this.container;if(this.setDrawContext_(),this.preRender(s,e),r.projection,this.clipped_=!1,a&&i.extent&&this.clipping){const l=ii(i.extent);a=Be(l,e.extent),this.clipped_=a&&!Oi(l,e.extent),this.clipped_&&this.clipUnrotated(s,e,l)}return a&&this.renderWorlds(o,e,this.getLayer().getDeclutter()?!1:void 0),!e.declutter&&this.clipped_&&s.restore(),this.postRender(s,e),this.renderedRotation_!==r.rotation&&(this.renderedRotation_=r.rotation,this.hitDetectionImageData_=null),e.declutter||this.resetDrawContext_(),this.container}getFeatures(e){return new Promise(t=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=this.frameState.size.slice(),r=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,c=this.getLayer(),h=[],u=i[0]*Lt,d=i[1]*Lt;h.push(this.getRenderTransform(r,s,o,Lt,u,d,0).slice());const g=c.getSource(),f=a.getExtent();if(g.getWrapX()&&a.canWrapX()&&!Oi(f,l)){let p=l[0];const A=ne(f);let m=0,y;for(;pf[2];)++m,y=A*m,h.push(this.getRenderTransform(r,s,o,Lt,u,d,y).slice()),p-=A}this.hitDetectionImageData_=ep(i,h,this.renderedFeatures_,c.getStyleFunction(),l,s,o,Kh(s,this.renderedPixelRatio_),null)}t(tp(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,i,r,s){var d,g;if(!this.replayGroup_)return;const o=t.viewState.resolution,a=t.viewState.rotation,l=this.getLayer(),c={},h=function(f,p,A){const m=Y(f),y=c[m];if(y){if(y!==!0&&Af.value):null)}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){const t=this.getLayer(),i=t.getSource();if(!i)return!1;const r=e.viewHints[ke.ANIMATING],s=e.viewHints[ke.INTERACTING],o=t.getUpdateWhileAnimating(),a=t.getUpdateWhileInteracting();if(this.ready&&!o&&r||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=e.extent,c=e.viewState,h=c.projection,u=c.resolution,d=e.pixelRatio,g=t.getRevision(),f=t.getRenderBuffer();let p=t.getRenderOrder();p===void 0&&(p=r1);const A=c.center.slice(),m=Di(l,f*u),y=m.slice(),E=[m.slice()],x=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!Oi(x,e.extent)){const I=ne(x),R=Math.max(ne(m)/2,I);m[0]=x[0]-R,m[2]=x[2]+R,Vl(A,h);const B=fd(E[0],h);B[0]x[0]&&B[2]>x[2]&&E.push([B[0]-I,B[1],B[2]-I,B[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==g&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!e.declutter&&Oi(this.wrappedRenderedExtent_,m))return Fi(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=A,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const _=new Qg(Vg(u,d),m,u,d);let w;for(let I=0,R=E.length;I{let B;const D=I.getStyleFunction()||t.getStyleFunction();if(D&&(B=D(I,u)),B){const z=this.renderFeature(I,v,B,_,w,this.getLayer().getDeclutter(),R);C=C&&!z}},T=Xo(m),P=i.getFeaturesInExtent(T);p&&P.sort(p);for(let I=0,R=P.length;Ie)throw new Error("Tile load sequence violation");this.state=e,this.changed()}}load(){Q()}getAlpha(e,t){if(!this.transition_)return 1;let i=this.transitionStarts_[e];if(!i)i=t,this.transitionStarts_[e]=i;else if(i===-1)return 1;const r=t-i+1e3/60;return r>=this.transition_?1:pd(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}class np extends yo{constructor(e,t,i,r,s,o){super(e,t,o),this.crossOrigin_=r,this.src_=i,this.key=i,this.image_=new Image,r!==null&&(this.image_.crossOrigin=r),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(e){this.image_=e,this.state=G.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=G.ERROR,this.unlistenImage_(),this.image_=k1(),this.changed()}handleImageLoad_(){const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=G.LOADED:this.state=G.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==G.ERROR&&(this.state=G.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==G.IDLE&&(this.state=G.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=V0(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function k1(){const n=Fe(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}class eu{constructor(e,t,i,r){this.minX=e,this.maxX=t,this.minY=i,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minXthis.maxX&&(this.maxX=e.maxX),e.minYthis.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}}function ns(n,e,t,i,r){return r!==void 0?(r.minX=n,r.maxX=e,r.minY=t,r.maxY=i,r):new eu(n,e,t,i)}const rp=[];class D1 extends yo{constructor(e,t,i,r,s){super(e,t,{transition:0}),this.context_=null,this.executorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=r.bind(void 0,this),this.removeSourceTiles_=s,this.wrappedTileCoord=i}getContext(){return this.context_||(this.context_=Fe(1,1,rp)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){const t=Y(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){this.context_&&(zs(this.context_),rp.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}let sp=class extends yo{constructor(e,t,i,r,s,o){super(e,t,o),this.extent=null,this.format_=r,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=s,this.url_=i,this.key=i}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==G.IDLE&&(this.setState(G.LOADING),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(e,t){this.setFeatures(e)}onError(){this.setState(G.ERROR)}setFeatures(e){this.features_=e,this.setState(G.LOADED)}setLoader(e){this.loader_=e}};const op="https://api.mapbox.com";function tu(n){const e="mapbox://";return n.indexOf(e)!==0?"":n.slice(e.length)}function O1(n,e,t){if(typeof n=="string")return[{id:"default",url:ap(n,e,t)}];for(const i of n)i.url=ap(i.url,e,t);return n}function ap(n,e,t){const i=tu(n);if(!i)return decodeURI(new URL(n,t).href);const r="sprites/";if(i.indexOf(r)!==0)throw new Error(`unexpected sprites url: ${n}`);const s=i.slice(r.length);return`${op}/styles/v1/${s}/sprite?access_token=${e}`}function $a(n,e){const t=tu(n);if(!t)return decodeURI(new URL(n,location.href).href);const i="styles/";if(t.indexOf(i)!==0)throw new Error(`unexpected style url: ${n}`);const r=t.slice(i.length);return`${op}/styles/v1/${r}?&access_token=${e}`}const G1=["a","b","c","d"];function el(n,e,t,i){const r=new URL(n,i||location.href),s=tu(n);if(!s)return e?(r.searchParams.has(t)||r.searchParams.set(t,e),[decodeURI(r.href)]):[decodeURI(r.href)];if(s==="mapbox.satellite"){const o=window.devicePixelRatio>=1.5?"@2x":"";return[`https://api.mapbox.com/v4/${s}/{z}/{x}/{y}${o}.webp?access_token=${e}`]}return G1.map(o=>`https://${o}.tiles.mapbox.com/v4/${s}/{z}/{x}/{y}.vector.pbf?access_token=${e}`)}const li=Object.freeze({}),lp={},cp={};let B1=0;function iu(n){return n.id||(n.id=B1++),n.id}function nu(n,e){return iu(n)+"."+Y(e)}function ru(n){let e=lp[n.id];return e||(e={},lp[iu(n)]=e),e}function hp(n){let e=cp[n.id];return e||(e={},cp[iu(n)]=e),e}function su(n){return n*Math.PI/180}const Ti=function(){const n=[];for(let e=78271.51696402048;n.length<=24;e/=2)n.push(e);return n}();function tl(n,e){if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas<"u")return new OffscreenCanvas(n,e);const t=document.createElement("canvas");return t.width=n,t.height=e,t}function ou(n,e){let t=0;const i=e.length;for(;tr).then(l=>l instanceof Response?(i&&(i.url=l.url),o(l)):(l instanceof Request||(l=new Request(l)),l.headers.get("Accept")||l.headers.set("Accept","application/json"),i&&(i.url=l.url),fetch(l).then(o).catch(s))).catch(s);return rs[e]=[r,a],a}function up(n,e){if(typeof n=="string")if(n.trim().startsWith("{"))try{const t=JSON.parse(n);return Promise.resolve(t)}catch(t){return Promise.reject(t)}else return n=$a(n,e.accessToken),ss("Style",n,e);else return Promise.resolve(n)}const dp={};function fp(n,e,t={}){const i=[e,JSON.stringify(n)].toString();let r=dp[i];if(!r||t.transformRequest){let s;t.transformRequest&&(s=(a,l)=>{const c=t.transformRequest&&t.transformRequest(l,"Tiles")||l;if(a instanceof sp)a.setLoader((h,u,d)=>{const g=function(f){f.arrayBuffer().then(p=>{const m=a.getFormat().readFeatures(p,{extent:h,featureProjection:d});a.setFeatures(m)})};On(()=>c).then(f=>{if(f instanceof Response)return g(f);fetch(f).then(g).catch(p=>a.setState(G.ERROR))}).catch(f=>a.setState(G.ERROR))});else{const h=a.getImage();On(()=>c).then(u=>{if(typeof u=="string"){h.src=u;return}const d=g=>g.blob().then(f=>{const p=URL.createObjectURL(f);h.addEventListener("load",()=>URL.revokeObjectURL(p)),h.addEventListener("error",()=>URL.revokeObjectURL(p)),h.src=p});if(u instanceof Response)return d(u);fetch(u).then(d).catch(g=>a.setState(G.ERROR))}).catch(u=>a.setState(G.ERROR))}});const o=n.url;if(o&&!n.tiles){const a=el(o,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(o.startsWith("mapbox://"))r=Promise.resolve({tileJson:Object.assign({},n,{url:void 0,tiles:a}),tileLoadFunction:s});else{const l={};r=ss("Source",a[0],t,l).then(function(c){return c.tiles=c.tiles.map(function(h){return c.scheme==="tms"&&(h=h.replace("{y}","{-y}")),el(h,t.accessToken,t.accessTokenParam||"access_token",l.url)[0]}),Promise.resolve({tileJson:c,tileLoadFunction:s})})}}else n.tiles?(n=Object.assign({},n,{tiles:n.tiles.map(function(a){return n.scheme==="tms"&&(a=a.replace("{y}","{-y}")),el(a,t.accessToken,t.accessTokenParam||"access_token",e||location.href)[0]})}),r=Promise.resolve({tileJson:Object.assign({},n),tileLoadFunction:s})):r=Promise.reject(new Error("source has no `tiles` nor `url`"));dp[i]=r}return r}function gp(n,e,t,i){const r=[2*t*e.pixelRatio+e.width,2*t*e.pixelRatio+e.height],s=tl(r[0],r[1]),o=s.getContext("2d");o.drawImage(n,e.x,e.y,e.width,e.height,t*e.pixelRatio,t*e.pixelRatio,e.width,e.height);const a=o.getImageData(0,0,r[0],r[1]);o.globalCompositeOperation="destination-over",o.fillStyle=`rgba(${i.r*255},${i.g*255},${i.b*255},${i.a})`;const l=a.data;for(let c=0,h=a.width;c0&&o.arc(c,u,t*e.pixelRatio,0,2*Math.PI)}return o.fill(),s}function N1(n,e,t){const i=Math.max(0,Math.min(1,(t-n)/(e-n)));return i*i*(3-2*i)}function pp(n,e,t){const i=tl(e.width,e.height),r=i.getContext("2d");r.drawImage(n,e.x,e.y,e.width,e.height,0,0,e.width,e.height);const s=r.getImageData(0,0,e.width,e.height),o=s.data;for(let a=0,l=s.width;a0?(o[u+0]=Math.round(255*t.r*p),o[u+1]=Math.round(255*t.g*p),o[u+2]=Math.round(255*t.b*p),o[u+3]=Math.round(255*p)):o[u+3]=0}return r.putImageData(s,0,0),i}const j1=Array(256).join(" ");function au(n,e){if(e>=.05){let t="";const i=n.split(`
`),r=j1.slice(0,Math.round(e/.1));for(let s=0,o=i.length;s0&&(t+=`
`),t+=i[s].split("").join(r);return t}return n}let lu;function Ap(){return lu||(lu=tl(1,1).getContext("2d")),lu}function lr(n,e){return Ap().measureText(n).width+(n.length-1)*e}const il={};xi.on("propertychange",()=>{for(const n in il)delete il[n]});function cu(n,e,t,i){if(n.indexOf(`
`)!==-1){const o=n.split(`
`),a=[];for(let l=0,c=o.length;l1){const a=Ap();a.font=e;const c=a.measureText("M").width*t;let h="";const u=[];for(let d=0,g=o.length;d1;++d){const f=u[d];if(lr(f,i)0?lr(u[d-1],i):1/0,A=dc*.7&&lr(p,i){await document.fonts.ready;for(let i=0,r=t.length;ih.family.replace(/^['"]|['"]$/g,"").toLowerCase()===o.toLowerCase()&&h.weight==a&&h.style===l)){const h=e.replace("{font-family}",o.replace(/ /g,"-").toLowerCase()).replace("{Font+Family}",o.replace(/ /g,"+")).replace("{fontweight}",a).replace("{-fontstyle}",l.replace("normal","").replace(/(.+)/,"-$1")).replace("{fontstyle}",l);if(!document.querySelector('link[href="'+h+'"]')){const u=document.createElement("link");u.href=h,u.rel="stylesheet",document.head.appendChild(u)}}}})(),n}const V1={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},W1={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},H1=function(n,e){const t=UE(n,e);if(t.result==="error")throw new Error(t.value.map(i=>`${i.key}: ${i.message}`).join(", "));return t.value},kt={zoom:0,distanceFromCenter:0};Ft.register(Wa,{...Ft.definitions,pitch:[{kind:"number"},[],n=>kt.pitch||90],"distance-from-center":[{kind:"number"},[],n=>kt.distanceFromCenter||0]});let nl,hu;function W(n,e,t,i,r,s){const o=n.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[o]||(r[o]={});const a=r[o];if(!a[t]){let l=(n[e]||li)[t];const c=t1[`${e}_${n.type}`][t];l===void 0&&(l=c.default);let h=zE(l);if(!h&&Ig(l)&&(l=ZE(l,c),h=!0),h){const u=H1(l,c);a[t]=u.evaluate.bind(u)}else c.type=="color"&&(l=Se.parse(l)),a[t]=function(){return l}}return a[t](kt,i,s)}function yp(n,e,t,i){return W(n,"layout",`${t}-allow-overlap`,e,i)?W(n,"layout",`${t}-ignore-placement`,e,i)?"none":"obstacle":"declutter"}function X1(n,e,t,i){if(i||console.warn("No filterCache provided to evaluateFilter()"),!(n in i))try{i[n]=XE(e).filter}catch(r){console.warn("Filter will evaluate to false: "+r.message),i[n]=function(){return!1}}return i[n](kt,t)}function Tn(n,e){if(n){if(n.a===0||e===0)return;const t=n.a;return e=e===void 0?1:e,t===0?"transparent":"rgba("+Math.round(n.r*255/t)+","+Math.round(n.g*255/t)+","+Math.round(n.b*255/t)+","+t*e+")"}return n}const Y1=/\{[^{}}]*\}/g;function uu(n,e){return n.replace(Y1,function(t){return e[t.slice(1,-1)]||""})}function _p(n,e){let t=n.split(":")[0];return t===n&&(t="default"),e[t]}const du={};function fu(n,e,t,i=Ti,r=void 0,s=void 0,o=void 0,a=void 0){if(typeof e=="string"&&(e=JSON.parse(e)),e.version!=8)throw new Error("glStyle version 8 required.");du[nu(e,n)]=Array.from(arguments);const l={};(typeof s=="string"||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const _ in s){const w=s[_];On(()=>w).then(async v=>{let C;if(typeof Image<"u"){const b=new Image;if(typeof v=="string")b.crossOrigin="anonymous",b.src=v;else{let T;v instanceof Request?T=await fetch(v):v instanceof Response&&(T=v);const P=await T.blob();C=URL.createObjectURL(P),b.src=C}b.addEventListener("load",function T(){b.removeEventListener("load",T),l[_]={image:b,size:[b.width,b.height]},n.changed(),C&&URL.revokeObjectURL(C)}),b.addEventListener("error",function T(){URL.revokeObjectURL(C),b.removeEventListener("error",T)})}else if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){const b=self;b.postMessage({action:"loadImage",src:v}),b.addEventListener("message",function(P){P.data.action==="imageLoaded"&&P.data.src===v&&(l[_]={image:P.data.image,size:[P.data.image.width,P.data.image.height]})})}})}const c=Zf(e.layers),h={},u=[],d={},g={},f=ru(e),p=hp(e);let A;for(let _=0,w=c.length;_=S.maxzoom)continue;const ce=S.filter;if(!ce||X1(X,ce,I,p)){let J,he,me,Ee,Me,j;const Dt=U.index;if(M==3&&(S.type=="fill"||S.type=="fill-extrusion"))if(he=W(S,"paint",S.type+"-opacity",I,f,R),S.type+"-pattern"in Z){const Ie=W(S,"paint",S.type+"-pattern",I,f,R);if(Ie){const be=typeof Ie=="string"?uu(Ie,C):Ie.toString(),ye=_p(be,l);if(r&&r[be]&&ye){++B,j=E[B],(!j||!j.getFill()||j.getStroke()||j.getText())&&(j=new Qe({fill:new Ut}),E[B]=j),me=j.getFill(),j.setZIndex(Dt);const de=be+"."+he;let Xe=g[de];if(!Xe){const se=r[be],ue=tl(se.width,se.height),ze=ue.getContext("2d");ze.globalAlpha=he,ze.drawImage(ye.image,se.x,se.y,se.width,se.height,0,0,se.width,se.height),Xe=ze.createPattern(ue,"repeat"),g[de]=Xe}me.setColor(Xe)}}}else J=Tn(W(S,"paint",S.type+"-color",I,f,R),he),S.type+"-outline-color"in Z&&(Me=Tn(W(S,"paint",S.type+"-outline-color",I,f,R),he)),Me||(Me=J),(J||Me)&&(++B,j=E[B],(!j||J&&!j.getFill()||!J&&j.getFill()||Me&&!j.getStroke()||!Me&&j.getStroke()||j.getText())&&(j=new Qe({fill:J?new Ut:void 0,stroke:Me?new Vt:void 0}),E[B]=j),J&&(me=j.getFill(),me.setColor(J)),Me&&(Ee=j.getStroke(),Ee.setColor(Me),Ee.setWidth(.5)),j.setZIndex(Dt));if(M!=1&&S.type=="line"){"line-pattern"in Z?J=void 0:J=Tn(W(S,"paint","line-color",I,f,R),W(S,"paint","line-opacity",I,f,R));const Ie=W(S,"paint","line-width",I,f,R);J&&Ie>0&&(++B,j=E[B],(!j||!j.getStroke()||j.getFill()||j.getText())&&(j=new Qe({stroke:new Vt}),E[B]=j),Ee=j.getStroke(),Ee.setLineCap(W(S,"layout","line-cap",I,f,R)),Ee.setLineJoin(W(S,"layout","line-join",I,f,R)),Ee.setMiterLimit(W(S,"layout","line-miter-limit",I,f,R)),Ee.setColor(J),Ee.setWidth(Ie),Ee.setLineDash(Z["line-dasharray"]?W(S,"paint","line-dasharray",I,f,R).map(function(be){return be*Ie}):null),j.setZIndex(Dt))}let Si=!1,re=null,Kt=0,He,Ce,Ii;if((M==1||M==2)&&"icon-image"in O){const Ie=W(S,"layout","icon-image",I,f,R);if(Ie){He=typeof Ie=="string"?uu(Ie,C):Ie.toString();let be;const ye=a?a(n,He):void 0,de=_p(He,l);if(r&&r[He]&&de||ye){const Xe=W(S,"layout","icon-rotation-alignment",I,f,R);if(M==2){const se=_.getGeometry();if(se.getFlatMidpoint||se.getFlatMidpoints){const ue=se.getExtent();if(Math.sqrt(Math.max(Math.pow((ue[2]-ue[0])/w,2),Math.pow((ue[3]-ue[1])/w,2)))>150){const Je=se.getType()==="MultiLineString"?se.getFlatMidpoints():se.getFlatMidpoint();if(hu||(nl=[NaN,NaN],hu=new tt("Point",nl,[],2,{},void 0)),be=hu,nl[0]=Je[0],nl[1]=Je[1],W(S,"layout","symbol-placement",I,f,R)==="line"&&Xe==="map"){const vt=se.getStride(),it=se.getFlatCoordinates();for(let st=0,Le=it.length-vt;st=_r){Kt=Math.atan2(ct-Ct,Te-nt);break}}}}}}if(M!==2||be){const se=W(S,"layout","icon-size",I,f,R),ue=Z["icon-color"]!==void 0?W(S,"paint","icon-color",I,f,R):null;if(!ue||ue.a!==0){const ze=W(S,"paint","icon-halo-color",I,f,R),Je=W(S,"paint","icon-halo-width",I,f,R);let Qt=`${He}.${se}.${Je}.${ze}`;if(ue!==null&&(Qt+=`.${ue}`),Ce=d[Qt],!Ce){const vt=yp(S,I,"icon",f);let it;"icon-offset"in O&&(it=W(S,"layout","icon-offset",I,f,R).slice(0),it[0]*=se,it[1]*=-se);let st=ue?[ue.r*255,ue.g*255,ue.b*255,ue.a]:void 0;if(ye){const Le={color:st,rotateWithView:Xe==="map",displacement:it,declutterMode:vt,scale:se};typeof ye=="string"?Le.src=ye:(Le.img=ye,Le.imgSize=[ye.width,ye.height]),Ce=new $n(Le)}else{const Le=r[He];let nt,ct,Te;if(Je)Le.sdf?(nt=gp(pp(de.image,Le,ue||[0,0,0,1]),{x:0,y:0,width:Le.width,height:Le.height,pixelRatio:Le.pixelRatio},Je,ze),st=void 0):nt=gp(de.image,Le,Je,ze);else{if(Le.sdf&&!de.unSDFed){const Ct=pp(de.image,{x:0,y:0,width:de.size[0],height:de.size[1]},{r:1,g:1,b:1});de.image=Ct,de.unSDFed=!0}nt=de.image,ct=[Le.width,Le.height],Te=[Le.x,Le.y]}Ce=new $n({color:st,img:nt,imgSize:de.size,size:ct,offset:Te,rotateWithView:Xe==="map",scale:se/Le.pixelRatio,displacement:it,declutterMode:vt})}d[Qt]=Ce}}Ce&&(++B,j=E[B],(!j||!j.getImage()||j.getFill()||j.getStroke())&&(j=new Qe,E[B]=j),j.setGeometry(be),Ce.setRotation(Kt+su(W(S,"layout","icon-rotate",I,f,R))),Ce.setOpacity(W(S,"paint","icon-opacity",I,f,R)),Ce.setAnchor(W1[W(S,"layout","icon-anchor",I,f,R)]),j.setImage(Ce),re=j.getText(),j.setText(void 0),j.setZIndex(Dt),Si=!0,Ii=!1)}else Ii=!0}}}if(M==1&&S.type==="circle"){++B,j=E[B],(!j||!j.getImage()||j.getFill()||j.getStroke())&&(j=new Qe,E[B]=j);const Ie="circle-radius"in Z?W(S,"paint","circle-radius",I,f,R):5,be=Tn(W(S,"paint","circle-stroke-color",I,f,R),W(S,"paint","circle-stroke-opacity",I,f,R)),ye=W(S,"paint","circle-translate",I,f,R),de=Tn(W(S,"paint","circle-color",I,f,R),W(S,"paint","circle-opacity",I,f,R)),Xe=W(S,"paint","circle-stroke-width",I,f,R),se=Ie+"."+be+"."+de+"."+Xe+"."+ye[0]+"."+ye[1];Ce=d[se],Ce||(Ce=new Jn({radius:Ie,displacement:[ye[0],-ye[1]],stroke:be&&Xe>0?new Vt({width:Xe,color:be}):void 0,fill:de?new Ut({color:de}):void 0,declutterMode:"none"}),d[se]=Ce),j.setImage(Ce),re=j.getText(),j.setText(void 0),j.setGeometry(void 0),j.setZIndex(Dt),Si=!0}let Ge,di,Ot,gt,Zt,je;if("text-field"in O){gt=Math.round(W(S,"layout","text-size",I,f,R));const Ie=W(S,"layout","text-font",I,f,R);Ot=W(S,"layout","text-line-height",I,f,R),di=Yh(o?o(Ie,e.metadata?e.metadata["ol:webfonts"]:void 0):Ie,gt,Ot),di.includes("sans-serif")||(di+=",sans-serif"),Zt=W(S,"layout","text-letter-spacing",I,f,R),je=W(S,"layout","text-max-width",I,f,R);const be=W(S,"layout","text-field",I,f,R);typeof be=="object"&&be.sections?be.sections.length===1?Ge=be.toString():Ge=be.sections.reduce((ye,de,Xe)=>{const se=de.fontStack?de.fontStack.split(","):Ie,ue=Yh(o?o(se):se,gt*(de.scale||1),Ot);let ze=de.text;if(ze===`
`)return ye.push(`
`,""),ye;if(M==2)return ye.push(au(ze,Zt),ue),ye;ze=cu(ze,ue,je,Zt).split(`
`);for(let Je=0,Qt=ze.length;Je0&&ye.push(`
`,""),ye.push(ze[Je],ue);return ye},[]):Ge=uu(be,C).trim(),he=W(S,"paint","text-opacity",I,f,R)}if(Ge&&he&&!Ii){Si||(++B,j=E[B],(!j||!j.getText()||j.getFill()||j.getStroke())&&(j=new Qe,E[B]=j),j.setImage(void 0),j.setGeometry(void 0));const Ie=yp(S,I,"text",f);j.getText()||j.setText(re),re=j.getText(),(!re||"getDeclutterMode"in re&&re.getDeclutterMode()!==Ie)&&(re=new fa({padding:[2,2,2,2],declutterMode:Ie}),j.setText(re));const be=W(S,"layout","text-transform",I,f,R);be=="uppercase"?Ge=Array.isArray(Ge)?Ge.map((Te,Ct)=>Ct%2?Te:Te.toUpperCase()):Ge.toUpperCase():be=="lowercase"&&(Ge=Array.isArray(Ge)?Ge.map((Te,Ct)=>Ct%2?Te:Te.toLowerCase()):Ge.toLowerCase());const ye=Array.isArray(Ge)?Ge:M==2?au(Ge,Zt):cu(Ge,di,je,Zt);if(re.setText(ye),re.setFont(di),re.setRotation(su(W(S,"layout","text-rotate",I,f,R))),typeof re.setKeepUpright=="function"){const Te=W(S,"layout","text-keep-upright",I,f,R);re.setKeepUpright(Te)}const de=W(S,"layout","text-anchor",I,f,R),Xe=Si||M==1?"point":W(S,"layout","symbol-placement",I,f,R);let se;if(Xe==="line-center"?(re.setPlacement("line"),se="center"):re.setPlacement(Xe),Xe==="line"&&typeof re.setRepeat=="function"){const Te=W(S,"layout","symbol-spacing",I,f,R);re.setRepeat(Te*2)}re.setOverflow(Xe==="point");let ue=W(S,"paint","text-halo-width",I,f,R);const ze=W(S,"layout","text-offset",I,f,R),Je=W(S,"paint","text-translate",I,f,R);let Qt=0,vt=0;if(Xe=="point"){se="center",de.indexOf("left")!==-1?(se="left",vt=ue):de.indexOf("right")!==-1&&(se="right",vt=-ue);const Te=W(S,"layout","text-rotation-alignment",I,f,R);re.setRotateWithView(Te=="map")}else re.setMaxAngle(su(W(S,"layout","text-max-angle",I,f,R))*Ge.length/ye.length),re.setRotateWithView(!1);re.setTextAlign(se);let it="middle";de.indexOf("bottom")==0?(it="bottom",Qt=-ue-.5*(Ot-1)*gt):de.indexOf("top")==0&&(it="top",Qt=ue+.5*(Ot-1)*gt),re.setTextBaseline(it);const st=W(S,"layout","text-justify",I,f,R);re.setJustify(st==="auto"?void 0:st),re.setOffsetX(ze[0]*gt+vt+Je[0]),re.setOffsetY(ze[1]*gt+Qt+Je[1]),y.setColor(Tn(W(S,"paint","text-color",I,f,R),he)),re.setFill(y);const Le=Tn(W(S,"paint","text-halo-color",I,f,R),he);if(Le&&ue>0){m.setColor(Le),ue*=2;const Te=.5*gt;m.setWidth(ue<=Te?ue:Te),re.setStroke(m)}else re.setStroke(void 0);const nt=W(S,"layout","text-padding",I,f,R),ct=re.getPadding();nt!==ct[0]&&(ct[0]=nt,ct[1]=nt,ct[2]=nt,ct[3]=nt),j.setZIndex(Dt)}}}if(B>-1)return E.length=B+1,E};return n.setStyle(x),n.set("mapbox-layers",u),n.set("mapbox-source",A),n.set("mapbox-featurestate",n.get("mapbox-featurestate")||{}),x}const gu=65536*65536,xp=1/gu,K1=12,Ep=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),pu=0,rl=1,xo=2,sl=5;class Z1{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,i=this.length){for(;this.pos>3,o=this.pos;this.type=r&7,e(s,t,this),this.pos===o&&this.skip(r)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*gu;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*gu;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf;let i,r;return r=t[this.pos++],i=r&127,r<128||(r=t[this.pos++],i|=(r&127)<<7,r<128)||(r=t[this.pos++],i|=(r&127)<<14,r<128)||(r=t[this.pos++],i|=(r&127)<<21,r<128)?i:(r=t[this.pos],i|=(r&15)<<28,Q1(i,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=K1&&Ep?Ep.decode(this.buf.subarray(t,e)):cw(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const i=this.readPackedEnd();for(;this.pos127;);else if(t===xo)this.pos=this.readVarint()+this.pos;else if(t===sl)this.pos+=4;else if(t===rl)this.pos+=8;else throw new Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t268435455||e<0){q1(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;const t=this.pos;this.pos=hw(this.buf,e,this.pos);const i=this.pos-t;i>=128&&wp(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t);for(let i=0;i=128&&wp(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}writeMessage(e,t,i){this.writeTag(e,xo),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,ew,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,tw,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,rw,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,iw,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,nw,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,sw,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,ow,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,aw,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,lw,t)}writeBytesField(e,t){this.writeTag(e,xo),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,sl),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,sl),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,rl),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,rl),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,pu),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,pu),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,xo),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,sl),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,rl),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function Q1(n,e,t){const i=t.buf;let r,s;if(s=i[t.pos++],r=(s&112)>>4,s<128||(s=i[t.pos++],r|=(s&127)<<3,s<128)||(s=i[t.pos++],r|=(s&127)<<10,s<128)||(s=i[t.pos++],r|=(s&127)<<17,s<128)||(s=i[t.pos++],r|=(s&127)<<24,s<128)||(s=i[t.pos++],r|=(s&1)<<31,s<128))return os(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function os(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function q1(n,e){let t,i;if(n>=0?(t=n%4294967296|0,i=n/4294967296|0):(t=~(-n%4294967296),i=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,i=i+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),J1(t,i,e),$1(i,e)}function J1(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127}function $1(n,e){const t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))))}function wp(n,e,t){const i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(i);for(let r=t.pos-1;r>=n;r--)t.buf[r+i]=t.buf[r]}function ew(n,e){for(let t=0;t239?4:s>223?3:s>191?2:1;if(r+a>t)break;let l,c,h;a===1?s<128&&(o=s):a===2?(l=n[r+1],(l&192)===128&&(o=(s&31)<<6|l&63,o<=127&&(o=null))):a===3?(l=n[r+1],c=n[r+2],(l&192)===128&&(c&192)===128&&(o=(s&15)<<12|(l&63)<<6|c&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):a===4&&(l=n[r+1],c=n[r+2],h=n[r+3],(l&192)===128&&(c&192)===128&&(h&192)===128&&(o=(s&15)<<18|(l&63)<<12|(c&63)<<6|h&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,a=1):o>65535&&(o-=65536,i+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),i+=String.fromCharCode(o),r+=a}return i}function hw(n,e,t){for(let i=0,r,s;i55295&&r<57344)if(s)if(r<56320){n[t++]=239,n[t++]=191,n[t++]=189,s=r;continue}else r=s-55296<<10|r-56320|65536,s=null;else{r>56319||i+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):s=r;continue}else s&&(n[t++]=239,n[t++]=191,n[t++]=189,s=null);r<128?n[t++]=r:(r<2048?n[t++]=r>>6|192:(r<65536?n[t++]=r>>12|224:(n[t++]=r>>18|240,n[t++]=r>>12&63|128),n[t++]=r>>6&63|128),n[t++]=r&63|128)}return t}class uw extends Yf{constructor(e){super(),e=e||{},this.dataProjection=new Bo({code:"",units:"tile-pixels"}),this.featureClass=e.featureClass?e.featureClass:tt,this.geometryName_=e.geometryName,this.layerName_=e.layerName?e.layerName:"layer",this.layers_=e.layers?e.layers:null,this.idProperty_=e.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(e,t,i,r){e.pos=t.geometry;const s=e.readVarint()+e.pos;let o=1,a=0,l=0,c=0,h=0,u=0;for(;e.pos>3}if(a--,o===1||o===2)l+=e.readSVarint(),c+=e.readSVarint(),o===1&&h>u&&(r.push(h),u=h),i.push(l,c),h+=2;else if(o===7)h>u&&(i.push(i[u],i[u+1]),h+=2);else throw new Error("Invalid command found in the PBF")}h>u&&(r.push(h),u=h)}createFeature_(e,t,i){const r=t.type;if(r===0)return null;let s;const o=t.properties;let a;this.idProperty_?(a=o[this.idProperty_],delete o[this.idProperty_]):a=t.id,o[this.layerName_]=t.layer.name;const l=[],c=[];this.readRawGeometry_(e,t,l,c);const h=Aw(r,c.length);if(this.featureClass===tt)s=new this.featureClass(h,l,c,2,o,a),s.transform(i.dataProjection);else{let u;if(h=="Polygon"){const f=pc(l,c);u=f.length>1?new mn(l,"XY",f):new Nt(l,"XY",c)}else u=h==="Point"?new yt(l,"XY"):h==="LineString"?new Wt(l,"XY"):h==="MultiPoint"?new er(l,"XY"):h==="MultiLineString"?new An(l,"XY",c):null;const d=this.featureClass;s=new d,this.geometryName_&&s.setGeometryName(this.geometryName_);const g=Ea(u,!1,i);s.setGeometry(g),a!==void 0&&s.setId(a),s.setProperties(o,!0)}return s}getType(){return"arraybuffer"}readFeatures(e,t){const i=this.layers_;t=this.adaptOptions(t);const r=pe(t.dataProjection);r.setWorldExtent(t.extent),t.dataProjection=r;const s=new Z1(e),o=s.readFields(dw,{}),a=[];for(const l in o){if(i&&!i.includes(l))continue;const c=o[l],h=c?[0,0,c.extent,c.extent]:null;r.setExtent(h);for(let u=0,d=c.length;u>3,i=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null;e.values.push(i)}}function gw(n,e,t){if(n==1)e.id=t.readVarint();else if(n==2){const i=t.readVarint()+t.pos;for(;t.pos=a.width)return null;const h=De(o),u=Math.floor(a.height*((o[3]-r[1])/h));return u<0||u>=a.height?null:this.getImageData(a,c,u)}renderFrame(e,t){const i=this.image,r=i.getExtent(),s=i.getResolution(),[o,a]=Array.isArray(s)?s:[s,s],l=i.getPixelRatio(),c=e.layerStatesArray[e.layerIndex],h=e.pixelRatio,u=e.viewState,d=u.center,g=u.resolution,f=h*o/(g*l),p=h*a/(g*l);this.prepareContainer(e,t);const A=this.context.canvas.width,m=this.context.canvas.height,y=this.getRenderContext(e);let E=!1,x=!0;if(c.extent){const b=ii(c.extent,u.projection);x=Be(b,e.extent),E=x&&!Oi(b,e.extent),E&&this.clipUnrotated(y,e,b)}const _=i.getImage(),w=mi(this.tempTransform,A/2,m/2,f,p,0,l*(r[0]-d[0])/o,l*(d[1]-r[3])/a);this.renderedResolution=a*h/l;const v=_.width*w[0],C=_.height*w[3];if(this.getLayer().getSource().getInterpolate()||(y.imageSmoothingEnabled=!1),this.preRender(y,e),x&&v>=.5&&C>=.5){const b=w[4],T=w[5],P=c.opacity;P!==1&&(y.save(),y.globalAlpha=P),y.drawImage(_,0,0,+_.width,+_.height,b,T,v,C),P!==1&&y.restore()}return this.postRender(this.context,e),E&&y.restore(),y.imageSmoothingEnabled=!0,this.container}}class yw extends Dr{constructor(e){e=e||{},super(e)}}class vp extends yw{constructor(e){super(e)}createRenderer(){return new mw(this)}getData(e){return super.getData(e)}}function ol(n){return n instanceof Image||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof ImageBitmap?n:null}function _w(n){return n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Float32Array||n instanceof DataView?n:null}const xw=new Error("disposed");let as=null;function Ew(n){as||(as=Fe(n.width,n.height,void 0,{willReadFrequently:!0}));const e=as.canvas,t=n.width;e.width!==t&&(e.width=t);const i=n.height;return e.height!==i&&(e.height=i),as.clearRect(0,0,t,i),as.drawImage(n,0,0),as.getImageData(0,0,t,i).data}const ww=[256,256];class al extends yo{constructor(e){const t=G.IDLE;super(e.tileCoord,t,{transition:e.transition,interpolate:e.interpolate}),this.loader_=e.loader,this.data_=null,this.error_=null,this.size_=e.size||null,this.controller_=e.controller||null}getSize(){if(this.size_)return this.size_;const e=ol(this.data_);return e?[e.width,e.height]:ww}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==G.IDLE&&this.state!==G.ERROR)return;this.state=G.LOADING,this.changed();const e=this;this.loader_().then(function(t){e.data_=t,e.state=G.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=G.ERROR,e.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(xw),this.controller_=null),super.disposeInternal()}}let Au;const ls=[];function Cp(n,e,t,i,r){n.beginPath(),n.moveTo(0,0),n.lineTo(e,t),n.lineTo(i,r),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(e,i)+1,Math.max(t,r)),n.restore()}function mu(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-.75*255)>2}function vw(){if(Au===void 0){const n=Fe(6,6,ls);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",Cp(n,4,5,4,0),Cp(n,4,5,0,5);const e=n.getImageData(0,0,3,3).data;Au=mu(e,0)||mu(e,4)||mu(e,8),zs(n),ls.push(n.canvas)}return Au}function yu(n,e,t,i){const r=Ho(t,e,n);let s=ql(e,i,t);const o=e.getMetersPerUnit();o!==void 0&&(s*=o);const a=n.getMetersPerUnit();a!==void 0&&(s/=a);const l=n.getExtent();if(!l||Nn(l,r)){const c=ql(n,s,r)/s;isFinite(c)&&c>0&&(s/=c)}return s}function bp(n,e,t,i){const r=It(t);let s=yu(n,e,r,i);return(!isFinite(s)||s<=0)&&jl(t,function(o){return s=yu(n,e,o,i),isFinite(s)&&s>0}),s}function Tp(n,e,t,i,r,s,o,a,l,c,h,u,d,g){const f=Fe(Math.round(t*n),Math.round(t*e),ls);if(u||(f.imageSmoothingEnabled=!1),l.length===0)return f.canvas;f.scale(t,t);function p(_){return Math.round(_*t)/t}f.globalCompositeOperation="lighter";const A=St();l.forEach(function(_,w,v){Nl(A,_.extent)});let m;const y=t/i,E=(u?1:1+Math.pow(2,-24))/y;if(!d||l.length!==1||c!==0){if(m=Fe(Math.round(ne(A)*y),Math.round(De(A)*y),ls),u||(m.imageSmoothingEnabled=!1),r&&g){const _=(r[0]-A[0])*y,w=-(r[3]-A[3])*y,v=ne(r)*y,C=De(r)*y;m.rect(_,w,v,C),m.clip()}l.forEach(function(_,w,v){if(_.image.width>0&&_.image.height>0){if(_.clipExtent){m.save();const M=(_.clipExtent[0]-A[0])*y,k=-(_.clipExtent[3]-A[3])*y,I=ne(_.clipExtent)*y,R=De(_.clipExtent)*y;m.rect(u?M:Math.round(M),u?k:Math.round(k),u?I:Math.round(M+I)-Math.round(M),u?R:Math.round(k+R)-Math.round(k)),m.clip()}const C=(_.extent[0]-A[0])*y,b=-(_.extent[3]-A[3])*y,T=ne(_.extent)*y,P=De(_.extent)*y;m.drawImage(_.image,c,c,_.image.width-2*c,_.image.height-2*c,u?C:Math.round(C),u?b:Math.round(b),u?T:Math.round(C+T)-Math.round(C),u?P:Math.round(b+P)-Math.round(b)),_.clipExtent&&m.restore()}})}const x=ei(o);return a.getTriangles().forEach(function(_,w,v){const C=_.source,b=_.target;let T=C[0][0],P=C[0][1],M=C[1][0],k=C[1][1],I=C[2][0],R=C[2][1];const B=p((b[0][0]-x[0])/s),D=p(-(b[0][1]-x[1])/s),z=p((b[1][0]-x[0])/s),U=p(-(b[1][1]-x[1])/s),S=p((b[2][0]-x[0])/s),X=p(-(b[2][1]-x[1])/s),O=T,Z=P;T=0,P=0,M-=O,k-=Z,I-=O,R-=Z;const ce=[[M,k,0,0,z-B],[I,R,0,0,S-B],[0,0,M,k,U-D],[0,0,I,R,X-D]],J=fm(ce);if(!J)return;if(f.save(),f.beginPath(),vw()||!u){f.moveTo(z,U);const me=4,Ee=B-z,Me=D-U;for(let j=0;jYe(a,Ho(E,this.targetProj_,this.sourceProj_))):Gs(this.targetProj_,this.sourceProj_);this.transformInv_=function(E){const x=E[0]+"/"+E[1];return l[x]||(l[x]=c(E)),l[x]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&ne(r)>=ne(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ne(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ne(this.targetProj_.getExtent()):null;const h=ei(i),u=Go(i),d=Do(i),g=ko(i),f=this.transformInv_(h),p=this.transformInv_(u),A=this.transformInv_(d),m=this.transformInv_(g),y=Cw+(o?Math.max(0,Math.ceil(Math.log2(Fs(i)/(o*o*256*256)))):0);if(this.addQuad_(h,u,d,g,f,p,A,m,y),this.wrapsXInSource_){let E=1/0;this.triangles_.forEach(function(x,_,w){E=Math.min(E,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(x=>{if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-E>this.sourceWorldWidth_/2){const _=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];_[0][0]-E>this.sourceWorldWidth_/2&&(_[0][0]-=this.sourceWorldWidth_),_[1][0]-E>this.sourceWorldWidth_/2&&(_[1][0]-=this.sourceWorldWidth_),_[2][0]-E>this.sourceWorldWidth_/2&&(_[2][0]-=this.sourceWorldWidth_);const w=Math.min(_[0][0],_[1][0],_[2][0]);Math.max(_[0][0],_[1][0],_[2][0])-w.5&&u<1;let f=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const A=ht([e,t,i,r]);f=ne(A)/this.targetWorldWidth_>Rp||f}!g&&this.sourceProj_.isGlobal()&&u&&(f=u>Rp||f)}if(!f&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!Be(h,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(c>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(c>0){if(!f){const A=[(e[0]+i[0])/2,(e[1]+i[1])/2],m=this.transformInv_(A);let y;g?y=(an(s[0],d)+an(a[0],d))/2-an(m[0],d):y=(s[0]+a[0])/2-m[0];const E=(s[1]+a[1])/2-m[1];f=y*y+E*E>this.errorThresholdSquared_}if(f){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){const A=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(A),y=[(r[0]+e[0])/2,(r[1]+e[1])/2],E=this.transformInv_(y);this.addQuad_(e,t,A,y,s,o,m,E,c-1),this.addQuad_(y,A,i,r,E,m,a,l,c-1)}else{const A=[(e[0]+t[0])/2,(e[1]+t[1])/2],m=this.transformInv_(A),y=[(i[0]+r[0])/2,(i[1]+r[1])/2],E=this.transformInv_(y);this.addQuad_(e,A,y,r,s,m,E,l,c-1),this.addQuad_(A,t,i,y,m,o,a,E,c-1)}return}}if(g){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(p&11)==0&&this.addTriangle_(e,i,r,s,a,l),(p&14)==0&&this.addTriangle_(e,i,t,s,a,o),p&&((p&13)==0&&this.addTriangle_(t,r,e,o,l,s),(p&7)==0&&this.addTriangle_(t,r,i,o,l,a))}calculateSourceExtent(){const e=St();return this.triangles_.forEach(function(t,i,r){const s=t.source;Ms(e,s[0]),Ms(e,s[1]),Ms(e,s[2])}),e}getTriangles(){return this.triangles_}}const xu=.5;class Sp extends yo{constructor(e,t,i,r,s,o,a,l,c,h,u,d){super(s,G.IDLE,d),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=o||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;const g=r.getTileCoordExtent(this.wrappedTileCoord_),f=this.targetTileGrid_.getExtent();let p=this.sourceTileGrid_.getExtent();const A=f?ut(g,f):g;if(Fs(A)===0){this.state=G.EMPTY;return}const m=e.getExtent();m&&(p?p=ut(p,m):p=m);const y=r.getResolution(this.wrappedTileCoord_[0]),E=bp(e,i,A,y);if(!isFinite(E)||E<=0){this.state=G.EMPTY;return}const x=h!==void 0?h:xu;if(this.triangulation_=new _u(e,i,A,p,E*x,y),this.triangulation_.getTriangles().length===0){this.state=G.EMPTY;return}this.sourceZ_=t.getZForResolution(E);let _=this.triangulation_.calculateSourceExtent();if(p&&(e.canWrapX()?(_[1]=Pe(_[1],p[1],p[3]),_[3]=Pe(_[3],p[1],p[3])):_=ut(_,p)),!Fs(_))this.state=G.EMPTY;else{let w=0,v=0;e.canWrapX()&&(w=ne(m),v=Math.floor((_[0]-m[0])/w)),zl(_.slice(),e,!0).forEach(b=>{const T=t.getTileRangeForExtentAndZ(b,this.sourceZ_);for(let P=T.minX;P<=T.maxX;P++)for(let M=T.minY;M<=T.maxY;M++){const k=c(this.sourceZ_,P,M,a);if(k){const I=v*w;this.sourceTiles_.push({tile:k,offset:I})}}++v}),this.sourceTiles_.length===0&&(this.state=G.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(t=>{var r;const i=t.tile;if(i&&i.getState()==G.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);s[0]+=t.offset,s[2]+=t.offset;const o=(r=this.clipExtent_)==null?void 0:r.slice();o&&(o[0]+=t.offset,o[2]+=t.offset),e.push({extent:s,clipExtent:o,image:i.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=G.ERROR;else{const t=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(t),r=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(t),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Tp(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=G.LOADED}this.changed()}load(){if(this.state==G.IDLE){this.state=G.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{const i=t.getState();if(i==G.IDLE||i==G.LOADING){e++;const r=oe(t,H.CHANGE,s=>{const o=t.getState();(o==G.LOADED||o==G.ERROR||o==G.EMPTY)&&(ve(r),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(r)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:t},i,r){t.getState()==G.IDLE&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(ve),this.sourcesListenerKeys_=null}release(){this.canvas_&&(zs(this.canvas_.getContext("2d")),ls.push(this.canvas_),this.canvas_=null),super.release()}}class bw{constructor(e){this.highWaterMark=e!==void 0?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const e=this.pop();e instanceof Cs&&e.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let t=this.oldest_;for(;t;)e(t.value_,t.key_,this),t=t.newer}get(e,t){const i=this.entries_[e];return ge(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(e){const t=this.entries_[e];return ge(t!==void 0,"Tried to get a value for a key that does not exist in the cache"),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_}getCount(){return this.count_}getKeys(){const e=new Array(this.count_);let t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.key_;return e}getValues(){const e=new Array(this.count_);let t=0,i;for(i=this.newest_;i;i=i.older)e[t++]=i.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){var t;return(t=this.entries_[e])==null?void 0:t.value_}pop(){const e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,t){this.get(e),this.entries_[e].value_=t}set(e,t){ge(!(e in this.entries_),"Tried to set a value for a key that is used already");const i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_}setSize(e){this.highWaterMark=e}}function ll(n,e,t,i){return i!==void 0?(i[0]=n,i[1]=e,i[2]=t,i):[n,e,t]}function Tw(n,e,t){return n+"/"+e+"/"+t}function Rw(n){return Ip(n[0],n[1],n[2])}function Ip(n,e,t){return(e<t||t>e.getMaxZoom())return!1;const s=e.getFullTileRange(t);return s?s.containsXY(i,r):!0}function Eu(n,e,t,i){return`${n},${Tw(e,t,i)}`}function wu(n,e,t){if(!(t in n))return n[t]=new Set([e]),!0;const i=n[t],r=i.has(e);return r||i.add(e),!r}function Iw(n,e,t){const i=n[t];return i?i.delete(e):!1}function Pp(n,e){const t=n.layerStatesArray[n.layerIndex];t.extent&&(e=ut(e,ii(t.extent,n.viewState.projection)));const i=t.layer.getRenderSource();if(!i.getWrapX()){const r=i.getTileGridForProjection(n.viewState.projection).getExtent();r&&(e=ut(e,r))}return e}class Mp extends $h{constructor(e,t){super(e),t=t||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision_,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=St(),this.tempTileRange_=new eu(0,0,0,0),this.tempTileCoord_=ll(0,0,0);const i=t.cacheSize!==void 0?t.cacheSize:512;this.tileCache_=new bw(i),this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getOrCreateTile(e,t,i,r){const s=this.tileCache_,a=this.getLayer().getSource(),l=Eu(a.getKey(),e,t,i);let c;if(s.containsKey(l))c=s.get(l);else{if(c=a.getTile(e,t,i,r.pixelRatio,r.viewState.projection),!c)return null;s.set(l,c)}return c}getTile(e,t,i,r){const s=this.getOrCreateTile(e,t,i,r);return s||null}getData(e){const t=this.frameState;if(!t)return null;const i=this.getLayer(),r=Ye(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!Nn(s,r))return null;const o=t.viewState,a=i.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(t.pixelRatio);for(let h=l.getZForResolution(o.resolution);h>=l.getMinZoom();--h){const u=l.getTileCoordForCoordAndZ(r,h),d=this.getTile(h,u[1],u[2],t);if(!d||d.getState()!==G.LOADED)continue;const g=l.getOrigin(h),f=Ke(l.getTileSize(h)),p=l.getResolution(h);let A;if(d instanceof np||d instanceof Sp)A=d.getImage();else if(d instanceof al){if(A=ol(d.getData()),!A)continue}else continue;const m=Math.floor(c*((r[0]-g[0])/p-u[1]*f[0])),y=Math.floor(c*((g[1]-r[1])/p-u[2]*f[1])),E=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(A,m+E,y+E)}return null}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;const t=this.getLayer().getSource();if(!t)return!1;const i=t.getRevision();return this.renderedRevision_?this.renderedRevision_!==i&&(this.renderedRevision_=i,this.renderedSourceKey_===t.getKey()&&this.tileCache_.clear()):this.renderedRevision_=i,!0}enqueueTiles(e,t,i,r,s){const o=e.viewState,a=this.getLayer(),l=a.getRenderSource(),c=l.getTileGridForProjection(o.projection),h=Y(l);h in e.wantedTiles||(e.wantedTiles[h]={});const u=e.wantedTiles[h],d=a.getMapInternal(),g=Math.max(i-s,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection)),f=o.rotation,p=f?dd(o.center,o.resolution,f,e.size):void 0;for(let A=i;A>=g;--A){const m=c.getTileRangeForExtentAndZ(t,A,this.tempTileRange_),y=c.getResolution(A);for(let E=m.minX;E<=m.maxX;++E)for(let x=m.minY;x<=m.maxY;++x){if(f&&!c.tileCoordIntersectsViewport([A,E,x],p))continue;const _=this.getTile(A,E,x,e);if(!_||!wu(r,_,A))continue;const v=_.getKey();if(u[v]=!0,_.getState()===G.IDLE&&!e.tileQueue.isKeyQueued(v)){const C=ll(A,E,x,this.tempTileCoord_);e.tileQueue.enqueue([_,h,c.getTileCoordCenter(C),y])}}}}findStaleTile_(e,t){const i=this.tileCache_,r=e[0],s=e[1],o=e[2],a=this.getStaleKeys();for(let l=0;l0&&setTimeout(()=>{this.enqueueTiles(e,b,d-1,v,C-1)},0),!(d in v))return this.container;const T=Y(this),P=e.time;for(const z of v[d]){const U=z.getState();if(U===G.EMPTY)continue;const S=z.tileCoord;if(U===G.LOADED&&z.getAlpha(T,P)===1){z.endTransition(T);continue}if(U!==G.ERROR&&(this.renderComplete=!1),this.findStaleTile_(S,v)){Iw(v,z,d),e.animate=!0;continue}if(this.findAltTiles_(u,S,d+1,v))continue;const Z=u.getMinZoom();for(let ce=d-1;ce>=Z&&!this.findAltTiles_(u,S,ce,v);--ce);}const M=g/o*l/A,k=this.getRenderContext(e);mi(this.tempTransform,m/2,y/2,M,M,0,-m/2,-y/2),i.extent&&this.clipUnrotated(k,e,E),h.getInterpolate()||(k.imageSmoothingEnabled=!1),this.preRender(k,e);const I=Object.keys(v).map(Number);I.sort(fi);let R;const B=[],D=[];for(let z=I.length-1;z>=0;--z){const U=I[z],S=h.getTilePixelSize(U,l,s),O=u.getResolution(U)/g,Z=S[0]*O*M,ce=S[1]*O*M,J=u.getTileCoordForCoordAndZ(ei(w),U),he=u.getTileCoordExtent(J),me=Ye(this.tempTransform,[A*(he[0]-w[0])/g,A*(w[3]-he[3])/g]),Ee=A*h.getGutterForProjection(s);for(const Me of v[U]){if(Me.getState()!==G.LOADED)continue;const j=Me.tileCoord,Dt=J[1]-j[1],Si=Math.round(me[0]-(Dt-1)*Z),re=J[2]-j[2],Kt=Math.round(me[1]-(re-1)*ce),He=Math.round(me[0]-Dt*Z),Ce=Math.round(me[1]-re*ce),Ii=Si-He,Ge=Kt-Ce,di=I.length===1;let Ot=!1;R=[He,Ce,He+Ii,Ce,He+Ii,Ce+Ge,He,Ce+Ge];for(let gt=0,Zt=B.length;gt{const X=Y(h),O=S.wantedTiles[X],Z=O?Object.keys(O).length:0;this.updateCacheSize(Z),this.tileCache_.expireCache()};e.postRenderFunctions.push(z)}return this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,t,i,r,s,o,a,l){let c;if(e instanceof al){if(c=ol(e.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(e);if(!c)return;const h=this.getRenderContext(t),u=Y(this),d=t.layerStatesArray[t.layerIndex],g=d.opacity*(l?e.getAlpha(u,t.time):1),f=g!==h.globalAlpha;f&&(h.save(),h.globalAlpha=g),h.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,r,s,o),f&&h.restore(),g!==d.opacity?t.animate=!0:l&&e.endTransition(u)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,t,i){const r=Y(t);r in e||(e[r]={}),e[r][i.getKey()]=!0}}const Rn={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class Pw extends Dr{constructor(e){e=e||{};const t=Object.assign({},e),i=e.cacheSize;delete e.cacheSize,delete t.preload,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(e.preload!==void 0?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Rn.PRELOAD)}setPreload(e){this.set(Rn.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Rn.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Rn.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}class cl extends Pw{constructor(e){super(e)}createRenderer(){return new Mp(this,{cacheSize:this.getCacheSize()})}}const Mw={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},Fp={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class Fw extends Mp{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=mt(),this.tileClipContexts_=null}drawTile(e,t,i,r,s,o,a,l){this.updateExecutorGroup_(e,t.pixelRatio,t.viewState.projection),this.tileImageNeedsRender_(e)&&this.renderTileImage_(e,t),super.drawTile(e,t,i,r,s,o,a,l)}getTile(e,t,i,r){const s=this.getOrCreateTile(e,t,i,r);if(!s)return null;const a=r.viewState.resolution,l=r.viewHints;return(!(l[ke.ANIMATING]||l[ke.INTERACTING])||!s.wantedResolution)&&(s.wantedResolution=a),s}prepareFrame(e){const t=this.getLayer().getRevision();return this.renderedLayerRevision_!==t&&(this.renderedLayerRevision_=t,this.renderedTiles.length=0),super.prepareFrame(e)}updateExecutorGroup_(e,t,i){const r=this.getLayer(),s=r.getRevision(),o=r.getRenderOrder()||null,a=e.wantedResolution,l=e.getReplayState(r);if(!l.dirty&&l.renderedResolution===a&&l.renderedRevision==s&&l.renderedRenderOrder==o)return;const c=r.getSource(),h=!!r.getDeclutter(),u=c.getTileGrid(),g=c.getTileGridForProjection(i).getTileCoordExtent(e.wrappedTileCoord),f=c.getSourceTiles(t,i,e),p=Y(r);delete e.hitDetectionImageData[p],e.executorGroups[p]=[],l.dirty=!1;for(let A=0,m=f.length;A_.value):null;let y;e:for(let _=0,w=f.length;_{const r=this.getLayer(),s=r.getSource(),o=this.renderedProjection,a=o.getExtent(),l=this.renderedResolution,c=s.getTileGridForProjection(o),h=Ye(this.renderedPixelToCoordinateTransform_,e.slice()),u=c.getTileCoordForCoordAndResolution(h,l).toString(),d=this.renderedTiles.find(E=>E.tileCoord.toString()===u&&E.getState()===G.LOADED);if(!d||d.loadingSourceTiles>0){t([]);return}s.getWrapX()&&o.canWrapX()&&!Oi(a,c.getTileCoordExtent(d.tileCoord))&&Vl(h,o);const g=Y(r),f=c.getTileCoordExtent(d.wrappedTileCoord),p=ei(f),A=[(h[0]-p[0])/l,(p[1]-h[1])/l],m=d.getSourceTiles().reduce((E,x)=>E.concat(x.getFeatures()),[]);let y=d.hitDetectionImageData[g];if(!y){const E=Ke(c.getTileSize(c.getZForResolution(l,s.zDirection))),x=this.renderedRotation_,_=[this.getRenderTransform(c.getTileCoordCenter(d.wrappedTileCoord),l,0,Lt,E[0]*Lt,E[1]*Lt,0)];y=ep(E,_,m,r.getStyleFunction(),c.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(r).renderedResolution,x),d.hitDetectionImageData[g]=y}t(tp(A,m,y))})}getFeaturesInExtent(e){const t=[],i=this.getTileCache();if(i.getCount()===0)return t;const s=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),o=s.getZForResolution(this.renderedResolution),a={};return i.forEach(l=>{if(l.tileCoord[0]!==o||l.getState()!==G.LOADED)return;const c=l.getSourceTiles();for(let h=0,u=c.length;h=0;--m)A[m].execute(this.context,a,this.getTileRenderTransform(p,e),e.viewState.rotation,o,Ja,c)}i.globalAlpha=r}renderDeferredInternal(e){const t=this.renderedTiles,i=Y(this.getLayer()),r=t.reduce((l,c,h)=>(c.executorGroups[i].forEach(u=>l.push({executorGroup:u,index:h})),l),[]),s=r.map(({executorGroup:l})=>l.getDeferredZIndexContexts()),o={};for(let l=0,c=r.length;l{s.forEach((c,h)=>{c[l]&&(c[l].forEach(u=>{const{executorGroup:d,index:g}=r[h],f=d.getRenderedContext(),p=f.globalAlpha;f.globalAlpha=this.renderedOpacity_;const A=this.tileClipContexts_[g];A&&A.draw(f),u.draw(f),A&&f.restore(),f.globalAlpha=p,u.clear()}),c[l].length=0)})})}getTileRenderTransform(e,t){const i=t.pixelRatio,r=t.viewState,s=r.center,o=r.resolution,a=r.rotation,l=t.size,c=Math.round(l[0]*i),h=Math.round(l[1]*i),d=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),g=e.tileCoord,f=d.getTileCoordExtent(e.wrappedTileCoord),p=d.getTileCoordExtent(g,this.tempExtent)[0]-f[0];return ec(ic(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(s,o,a,i,c,h,p))}postRender(e,t){var _;const i=t.viewHints,r=!(i[ke.ANIMATING]||i[ke.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;const s=this.getLayer(),o=s.getRenderMode(),a=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;const l=s.getDeclutter(),c=l?Fp[o].filter(w=>!Ja.includes(w)):Fp[o],h=t.viewState,u=h.rotation,d=s.getSource(),f=d.getTileGridForProjection(h.projection).getZForResolution(h.resolution,d.zDirection),p=this.renderedTiles,A=[],m=[],y=[],E=Y(s);let x=!0;for(let w=p.length-1;w>=0;--w){const v=p[w];x=x&&!v.getReplayState(s).dirty;const C=v.executorGroups[E].filter(R=>R.hasExecutors(c));if(C.length===0)continue;const b=this.getTileRenderTransform(v,t),T=v.tileCoord[0];let P=!1;const M=C[0].getClipCoords(b);let k=e,I;if(M){I=new Qh,k=I.getContext();for(let R=0,B=A.length;R{const i=this.sourceImage_.getState();(i==V.LOADED||i==V.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){ve(this.sourceListenerKey_),this.sourceListenerKey_=null}}const hl=4,Cu={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class kw extends Tt{constructor(e,t){super(e),this.image=t}}class Lp extends $r{constructor(e){super({attributions:e.attributions,projection:e.projection,state:e.state,interpolate:e.interpolate!==void 0?e.interpolate:!0}),this.on,this.once,this.un,this.loader=e.loader||null,this.resolutions_=e.resolutions!==void 0?e.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=e.loader?e.loader.length===0:!1,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(e){this.resolutions_=e}findNearestResolution(e){const t=this.getResolutions();if(t){const i=Io(t,e,0);e=t[i]}return e}getImage(e,t,i,r){const s=this.getProjection();if(!s||!r||ti(s,r))return s&&(r=s),this.getImageInternal(e,t,i,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&ti(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&Gi(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Lw(s,r,e,t,i,(o,a,l)=>this.getImageInternal(o,a,l,s),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(e,t,i,r){if(this.loader){const s=Dw(e,t,i,1),o=this.findNearestResolution(t);if(this.image&&(this.static_||this.wantedProjection_===r&&(this.wantedExtent_&&Oi(this.wantedExtent_,s)||Oi(this.image.getExtent(),s))&&(this.wantedResolution_&&vu(this.wantedResolution_)===o||vu(this.image.getResolution())===o)))return this.image;this.wantedProjection_=r,this.wantedExtent_=s,this.wantedResolution_=o,this.image=new Hc(s,o,i,this.loader),this.image.addEventListener(H.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(e){const t=e.target;let i;switch(t.getState()){case V.LOADING:this.loading=!0,i=Cu.IMAGELOADSTART;break;case V.LOADED:this.loading=!1,i=Cu.IMAGELOADEND;break;case V.ERROR:this.loading=!1,i=Cu.IMAGELOADERROR;break;default:return}this.hasListener(i)&&this.dispatchEvent(new kw(i,t))}}function Dw(n,e,t,i){const r=e/t,s=It(n),o=ln(ne(n)/r,hl),a=ln(De(n)/r,hl),l=ln((i-1)*o/2,hl),c=o+2*l,h=ln((i-1)*a/2,hl),u=a+2*h;return Oo(s,r,0,[c,u])}const cs=[0,0,0],Sn=5;class ul{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,ge(nm(this.resolutions_,(r,s)=>s-r),"`resolutions` must be sorted in descending order");let t;if(!e.origins){for(let r=0,s=this.resolutions_.length-1;r{const o=new eu(Math.min(0,r[0]),Math.max(r[0]-1,-1),Math.min(0,r[1]),Math.max(r[1]-1,-1));if(i){const a=this.getTileRangeForExtentAndZ(i,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}):i&&this.calculateTileRanges_(i)}forEachTileCoord(e,t,i){const r=this.getTileRangeForExtentAndZ(e,t);for(let s=r.minX,o=r.maxX;s<=o;++s)for(let a=r.minY,l=r.maxY;a<=l;++a)i([t,s,a])}forEachTileCoordParentTileRange(e,t,i,r){let s,o,a,l=null,c=e[0]-1;for(this.zoomFactor_===2?(o=e[1],a=e[2]):l=this.getTileCoordExtent(e,r);c>=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,i)):s=this.getTileRangeForExtentAndZ(l,c,i),t(c,s))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,i){if(e[0]this.maxZoom||t0?i:Math.max(s/t[0],r/t[1]);const o=e+1,a=new Array(o);for(let l=0;l"u"?"data:text/javascript;base64,"+Buffer.from(i.join(`
`),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",e),r}function jw(n,e){const t=Op(n.operation);let i=!1;return{postMessage:function(r){setTimeout(function(){i||e({data:{buffer:t(r),meta:r.meta}})},0)},terminate:function(){i=!0}}}class zw extends Cs{constructor(e){super(),this.imageOps_=!!e.imageOps;let t;e.threads===0?t=0:this.imageOps_?t=1:t=e.threads||1;const i=new Array(t);if(t)for(let r=0;rthis.maxQueueLength_;)this.queue_.shift().callback(null,null)}dispatch_(){if(this.running_||this.queue_.length===0)return;const e=this.queue_.shift();this.job_=e;const t=e.inputs[0].width,i=e.inputs[0].height,r=e.inputs.map(function(l){return l.data.buffer}),s=this.workers_.length;if(this.running_=s,s===1){this.workers_[0].postMessage({buffers:r,meta:e.meta,imageOps:this.imageOps_,width:t,height:i},r);return}const o=e.inputs[0].data.length,a=4*Math.ceil(o/4/s);for(let l=0;lthis.getTileInternal(g,f,p,A,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=l,d}getTileInternal(e,t,i,r,s){const o=this.getKey();return this.createTile_(e,t,i,r,s,o)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){const i=pe(e);if(i){const r=Y(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}}function tv(n,e){n.getImage().src=e}class Vp extends ev{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:pe("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:"loading",tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,zDirection:e.zDirection}),this.tileJSON_=null,this.tileSize_=e.tileSize,e.url)if(e.jsonp)Xw(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",e.url),t.send()}else if(e.tileJSON)this.handleTileJSONResponse(e.tileJSON);else throw new Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(e){const t=e.target;if(!t.status||t.status>=200&&t.status<300){let i;try{i=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(i)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){const t=pe("EPSG:4326"),i=this.getProjection();let r;if(e.bounds!==void 0){const c=Os(t,i);r=xm(e.bounds,c)}const s=Eo(i),o=e.minzoom||0,a=e.maxzoom||22,l=dl({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=Up(e.tiles,l),e.attribution&&!this.getAttributions()){const c=r!==void 0?r:s;this.setAttributions(function(h){return Be(c,h.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState("ready")}handleTileJSONError(){this.setState("error")}}class Wp extends fl{constructor(e){const t=e.projection||"EPSG:3857",i=e.extent||Eo(t),r=e.tileGrid||dl({extent:i,maxResolution:e.maxResolution,maxZoom:e.maxZoom!==void 0?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,projection:t,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Hp,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,zDirection:e.zDirection===void 0?1:e.zDirection}),this.format_=e.format?e.format:null,this.tileKeysBySourceTileUrl_={},this.sourceTiles_={},this.overlaps_=e.overlaps==null?!0:e.overlaps,this.tileClass=e.tileClass?e.tileClass:sp,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(e,t,i){if(i.getState()===G.IDLE){i.setState(G.LOADING);const r=i.wrappedTileCoord,s=this.getTileGridForProjection(t),o=s.getTileCoordExtent(r),a=r[0],l=s.getResolution(a);Di(o,-l,o);const c=this.tileGrid,h=c.getExtent();h&&ut(o,h,o);const u=c.getZForResolution(l,this.zDirection);c.forEachTileCoord(o,u,d=>{const g=this.tileUrlFunction(d,e,t);this.sourceTiles_[g]||(this.sourceTiles_[g]=new this.tileClass(d,g?G.IDLE:G.EMPTY,g,this.format_,this.tileLoadFunction));const f=this.sourceTiles_[g];i.sourceTiles.push(f),this.tileKeysBySourceTileUrl_[g]||(this.tileKeysBySourceTileUrl_[g]=[]),this.tileKeysBySourceTileUrl_[g].push(i.getKey());const p=f.getState();if(p{this.handleTileChange(m);const y=f.getState();if(y===G.LOADED||y===G.ERROR){const E=f.getKey();E in i.errorTileKeys?f.getState()===G.LOADED&&delete i.errorTileKeys[E]:i.loadingSourceTiles--,y===G.ERROR?i.errorTileKeys[E]=!0:f.removeEventListener(H.CHANGE,A),i.loadingSourceTiles===0&&i.setState(rn(i.errorTileKeys)?G.LOADED:G.ERROR)}};f.addEventListener(H.CHANGE,A),i.loadingSourceTiles++}p===G.IDLE&&(f.extent=c.getTileCoordExtent(d),f.projection=t,f.resolution=c.getResolution(d[0]),f.load())}),i.loadingSourceTiles||i.setState(i.sourceTiles.some(d=>d.getState()===G.ERROR)?G.ERROR:G.LOADED)}return i.sourceTiles}removeSourceTiles(e){const t=e.getKey(),i=e.sourceTiles;for(let r=0,s=i.length;r{h=h&&!this.tileUrlFunction(A,r,s)})}const u=new D1(o,h?G.EMPTY:G.IDLE,a,this.getSourceTiles.bind(this,r,s),this.removeSourceTiles.bind(this));return u.key=this.getKey(),u}getTileGridForProjection(e){const t=e.getCode();let i=this.tileGrids_[t];if(!i){const r=this.getProjection();ge(r===null||ti(r,e),"A VectorTile source can only be rendered if it has a projection compatible with the view projection.");const s=this.tileGrid,o=s.getResolutions().slice(),a=o.map(function(h,u){return s.getOrigin(u)}),l=o.map(function(h,u){return s.getTileSize(u)}),c=$d+1;for(let h=o.length;hd?D=u-D+d:D=d-D,B=Math.atan(Math.sqrt(I*I+R*R)),he=A*Math.cos(B)+p*Math.sin(B)*Math.cos(f-D),z=Math.cos(B),U=255*he,Z=Math.min(Math.max(2*e.sunEl,0),1),ce=1.875-e.opacity*1.75,J=e.opacity!==.5?d*((Math.pow(ce,B)-1)/(Math.pow(ce,d)-1)):B,X={r:(1-z)*E.r*Z*255,g:(1-z)*E.g*Z*255,b:(1-z)*E.b*Z*255,a:(1-z)*E.a*Z*255},S=Math.abs(((D+f)/Math.PI+.5)%2-1),O={r:(m.r*(1-S)+y.r*S)*U,g:(m.g*(1-S)+y.g*S)*U,b:(m.b*(1-S)+y.b*S)*U,a:(m.a*(1-S)+y.a*S)*U},P=(w*i+_)*4,o[P]=X.r*(1-S)+O.r,o[P+1]=X.g*(1-S)+O.g,o[P+2]=X.b*(1-S)+O.b,o[P+3]=s[P+3]*e.opacity*Z*Math.sin(J);return new ImageData(o,i,r)}function nv(n,e=512){return n.getExtent()?dl({extent:n.getExtent(),tileSize:e,maxZoom:22}).getResolutions():Ti}function Xp(n,e){return e.accessToken||(e=Object.assign({},e),new URL(n).searchParams.forEach((i,r)=>{e.accessToken=i,e.accessTokenParam=r})),e}function rv(n,e,t="",i={},r=void 0){let s,o,a,l,c=!0;return typeof t!="string"&&!Array.isArray(t)?(a=t,l=a.source||a.layers,i=a):l=t,typeof i=="string"?(s=i,a={}):(s=i.styleUrl,a=i),a.updateSource===!1&&(c=!1),r||(r=a.resolutions),!s&&typeof e=="string"&&!e.trim().startsWith("{")&&(s=e),s&&(s=s.startsWith("data:")?location.href:$a(s,a.accessToken),a=Xp(s,a)),new Promise(function(h,u){up(e,a).then(function(d){if(d.version!=8)return u(new Error("glStyle version 8 required."));if(!(n instanceof bn||n instanceof cr))return u(new Error("Can only apply to VectorLayer or VectorTileLayer"));const g=n instanceof cr?"vector":"geojson";if(l?Array.isArray(l)?o=d.layers.find(function(x){return x.id===l[0]}).source:o=l:(o=d.layers.find(function(x){return x.source&&d.sources[x.source].type===g}).source,l=o),!o)return u(new Error(`No ${g} source found in the glStyle.`));function f(){if(!c)return Promise.resolve();if(n instanceof cr)return Ru(d.sources[o],s,a).then(function(v){const C=n.getSource();C?v!==C&&(C.setTileUrlFunction(v.getTileUrlFunction()),typeof C.setUrls=="function"&&typeof v.getUrls=="function"&&C.setUrls(v.getUrls()),C.format_||(C.format_=v.format_),C.getAttributions()||C.setAttributions(v.getAttributions()),C.getTileLoadFunction()===Hp&&C.setTileLoadFunction(v.getTileLoadFunction()),ti(C.getProjection(),v.getProjection())&&(C.tileGrid=v.getTileGrid())):n.setSource(v);const b=n.getSource().getTileGrid();!isFinite(n.getMaxResolution())&&!isFinite(n.getMinZoom())&&b.getMinZoom()>0&&n.setMaxResolution(_o(Math.max(0,b.getMinZoom()-1e-12),b.getResolutions()))});const x=d.sources[o];let _=n.getSource();(!_||_.get("mapbox-source")!==x)&&(_=Su(x,s,a));const w=n.getSource();return w?_!==w&&(w.getAttributions()||w.setAttributions(_.getAttributions()),w.format_||(w.format_=_.getFormat()),w.url_=_.getUrl()):n.setSource(_),Promise.resolve()}let p,A;const m={},y={};function E(){if(!A&&(!d.sprite||m)){if(a.projection&&!r){const _=pe(a.projection).getUnits();_!=="m"&&(r=Ti.map(w=>w/cn[_]))}A=fu(n,d,l,r,m,y,(x,_=a.webfonts)=>U1(x,_),a.getImage),n.getStyle()?f().then(h).catch(u):u(new Error(`Nothing to show for source [${o}]`))}else A?(n.setStyle(A),f().then(h).catch(u)):u(new Error("Something went wrong trying to apply style."))}if(d.sprite){const x=O1(d.sprite,a.accessToken,s||location.href);p=window.devicePixelRatio>=1.5?.5:1;const _=p==.5?"@2x":"";Promise.all(x.map(function(w){const v=new URL(w.url);let C=v.origin+v.pathname+_+".json"+v.search;return new Promise(function(b,T){ss("Sprite",C,a).then(b).catch(function(P){C=v.origin+v.pathname+".json"+v.search,ss("Sprite",C,a).then(b).catch(T)})}).then(function(b){b===void 0&&u(new Error("No sprites found."));let T;if(T=v.origin+v.pathname+_+".png"+v.search,a.transformRequest){const P=a.transformRequest(T,"SpriteImage")||T;(P instanceof Request||P instanceof Promise)&&(T=P)}y[w.id]=T;for(const P in b){const M=w.id=="default"?P:`${w.id}:${P}`;m[M]=b[P]}}).catch(function(b){u(new Error(`Sprites cannot be loaded: ${C}: ${b.message}`))})})).then(E).catch(u)}else E()}).catch(u)})}function Yp(n,e){let t;return n.some(function(i){if(i.id==e)return t=i.source,!0}),t}function sv(n,e){const t=n.bounds;if(t){const i=Wo([t[0],t[1]],e),r=Wo([t[2],t[3]],e);return[i[0],i[1],r[0],r[1]]}return pe(e).getExtent()}function Kp(n,e,t){const i=new Vp({tileJSON:e,tileSize:n.tileSize||e.tileSize||512}),r=i.getTileJSON(),s=i.getTileGrid(),o=pe(t.projection||"EPSG:3857"),a=sv(r,o),l=o.getExtent(),c=r.minzoom||0,h=r.maxzoom||22,u={attributions:i.getAttributions(),projection:o,tileGrid:new ul({origin:l?ei(l):s.getOrigin(0),extent:a||s.getExtent(),minZoom:c,resolutions:nv(o,e.tileSize).slice(0,h+1),tileSize:s.getTileSize(0)})};return Array.isArray(r.tiles)?u.urls=r.tiles:u.url=r.tiles,u}function ov(n,e,t,i){const r={id:n.id,type:n.type},s=n.layout||{},o=n.paint||{};r.paint=o,kt.zoom=ou(e,t.resolutions||Ti),kt.distanceFromCenter=0;let a;const l=W(r,"paint","background-color",li,i);return o["background-opacity"]!==void 0&&(a=W(r,"paint","background-opacity",li,i)),s.visibility=="none"?void 0:Tn(l,a)}function av(n,e,t){const i=document.createElement("div");return i.className="ol-mapbox-style-background",i.style.position="absolute",i.style.width="100%",i.style.height="100%",new Dr({source:new $r({}),render(r){const s=ov(n,r.viewState.resolution,e,t);return i.style.backgroundColor=s,i}})}function Ru(n,e,t){return new Promise(function(i,r){fp(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=Kp(n,s,t);a.tileLoadFunction=o,a.format=new uw({layerName:"mvt:layer"});const l=new Wp(a);l.set("mapbox-source",n),i(l)}).catch(r)})}function lv(n,e,t){const i=new cr({declutter:!0,visible:!1});return Ru(n,e,t).then(function(r){i.setSource(r)}).catch(function(r){i.setSource(void 0)}),i}function Zp(n){return`{bbox-${(n?n.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function Qp(n,e,t){return new Promise(function(i,r){fp(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=new Vp({interpolate:t.interpolate===void 0?!0:t.interpolate,transition:0,crossOrigin:"anonymous",tileJSON:s});a.tileGrid=Kp(n,s,t).tileGrid,t.projection&&(a.projection=pe(t.projection));const l=a.getTileUrlFunction();o&&a.setTileLoadFunction(o),a.setTileUrlFunction(function(c,h,u){const d=Zp(u);let g=l(c,h,u);if(g.indexOf(d)!=-1){const f=a.getTileGrid().getTileCoordExtent(c);g=g.replace(d,f.toString())}return g}),a.set("mapbox-source",n),i(a)}).catch(function(s){r(s)})})}function qp(n,e,t){const i=new cl;return Qp(n,e,t).then(function(r){i.setSource(r)}).catch(function(){i.setSource(void 0)}),i}function cv(n,e,t){const i=qp(n,e,t);return new vp({source:new Np({operationType:"image",operation:iv,sources:[i]})})}function Su(n,e,t){const i=t.projection?new sh({dataProjection:t.projection}):new sh,r=n.data,s={};if(typeof r=="string"){const[a]=el(r,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(a)){const c=(u,d,g)=>{const f=Zp(g);return a.replace(f,`${u.join(",")}`)},h=new En({attributions:n.attribution,format:i,loader:(u,d,g,f,p)=>{const A=typeof c=="function"?c(u,d,g):c;ss("GeoJSON",A,t).then(m=>{const y=h.getFormat().readFeatures(m,{featureProjection:g});h.addFeatures(y),f(y)}).catch(m=>{h.removeLoadedExtent(u),p()})},strategy:A1});return h.set("mapbox-source",n),h}const l=new En({attributions:n.attribution,format:i,url:a,loader:(c,h,u,d,g)=>{ss("GeoJSON",a,t).then(f=>{const p=l.getFormat().readFeatures(f,{featureProjection:u});l.addFeatures(p),d(p)}).catch(f=>{l.removeLoadedExtent(c),g()})}});return l}s.features=i.readFeatures(r,{featureProjection:"EPSG:3857"});const o=new En(Object.assign({attributions:n.attribution,format:i},s));return o.set("mapbox-source",n),o}function hv(n,e,t){return new bn({declutter:!0,source:Su(n,e,t),visible:!1})}function uv(n,e,t){let i=null;return function(r){n.paint&&"raster-opacity"in n.paint&&r.frameState.viewState.zoom!==i&&(i=r.frameState.viewState.zoom,delete t[n.id],dv(n,e,i,t))}}function dv(n,e,t,i){kt.zoom=t,kt.distanceFromCenter=0;const r=W(n,"paint","raster-opacity",li,i);e.setOpacity(r)}function fv(n,e){function t(){const i=e.get("mapbox-style");if(!i)return;const r=Zf(i.layers),s=n.get("mapbox-layers"),o=r.filter(function(a){return s.includes(a.id)}).some(function(a){return!a.layout||!a.layout.visibility||a.layout.visibility==="visible"});n.get("visible")!==o&&n.setVisible(o)}n.on("change",t),t()}function Jp(n,e,t,i){const r=ru(n),s=n.layers,o=t.type,a=t.source||Yp(s,t.ref),l=n.sources[a];let c;if(o=="background")c=av(t,i,r);else if(l.type=="vector")c=lv(l,e,i);else if(l.type=="raster")c=qp(l,e,i),c.setVisible(t.layout?t.layout.visibility!=="none":!0),c.on("prerender",uv(t,c,r));else if(l.type=="geojson")c=hv(l,e,i);else if(l.type=="raster-dem"&&t.type=="hillshade"){const u=cv(l,e,i);c=u,u.getSource().on("beforeoperations",function(d){const g=d.data;g.resolution=ql(i.projection||"EPSG:3857",d.resolution,It(d.extent),"m"),kt.zoom=ou(d.resolution,i.resolutions||Ti),kt.distanceFromCenter=0,g.encoding=l.encoding,g.vert=5*W(t,"paint","hillshade-exaggeration",li,r),g.sunAz=W(t,"paint","hillshade-illumination-direction",li,r),g.sunEl=35,g.opacity=.3,g.highlightColor=W(t,"paint","hillshade-highlight-color",li,r),g.shadowColor=W(t,"paint","hillshade-shadow-color",li,r),g.accentColor=W(t,"paint","hillshade-accent-color",li,r)}),c.setVisible(t.layout?t.layout.visibility!=="none":!0)}const h=a;return c&&c.set("mapbox-source",h),c}function $p(n,e,t,i){const r=[];let s=null;if(e instanceof ya){if(s=e.getView(),!s.isDef()&&!s.getRotation()&&!s.getResolutions()){const u=i.projection?pe(i.projection):s.getProjection();s=new yi(Object.assign(s.getProperties(),{maxResolution:Ti[0]/cn[u.getUnits()],projection:i.projection||s.getProjection()})),e.setView(s)}"center"in n&&!s.getCenter()&&s.setCenter(Wo(n.center,s.getProjection())),"zoom"in n&&s.getZoom()===void 0&&s.setResolution(Ti[0]/cn[s.getProjection().getUnits()]/Math.pow(2,n.zoom)),(!s.getCenter()||s.getZoom()===void 0)&&s.fit(s.getProjection().getExtent(),{nearest:!0,size:e.getSize()})}e.set("mapbox-style",n),e.set("mapbox-metadata",{styleUrl:t,options:i});const o=n.layers;let a=[],l,c,h;for(let u=0,d=o.length;u0||p>0)&&n.setMaxResolution(Math.min(_o(Math.max(0,o-1e-12),Ti),_o(Math.max(0,p-1e-12),f.getResolutions()))),a<24&&n.setMinResolution(_o(a,Ti))}}else o>0&&n.setMaxResolution(_o(Math.max(0,o-1e-12),Ti));g instanceof En||g instanceof Wp?rv(n,t,e,Object.assign({styleUrl:i},s)).then(function(){fv(n,r),c()}).catch(h):c()};n.set("mapbox-layers",e);const d=r.getLayers();d.getArray().indexOf(n)===-1&&d.push(n),n.getSource()?u():n.once("change:source",u)})}function gv(n,e,t){const i=n.get("mapbox-style"),r=i.layers;let s,o=-1;s=r.length;let a;if(s>0&&r[s-1].source===e.source?(o=s-1,a=-1):sh.id===e.id))throw new Error(`Layer with id "${e.id}" already exists.`);const l=r[o].id,c=du[nu(n.get("mapbox-style"),gl(n,l))];if(r.splice(s,0,e),c){const[h,u,d,g,f,p,A,m]=c;if(Array.isArray(d)){const y=d.indexOf(l)+a;d.splice(y,0,e.id)}fu(h,u,d,g,f,p,A,m)}else gl(n,r[o].id).changed();return Promise.resolve()}function pv(n,e){const t=n.get("mapbox-style"),i=t.layers,r=i.findIndex(function(a){return a.id===e.id});if(r===-1)throw new Error(`Layer with id "${e.id}" not found.`);if(i[r].source!==e.source)throw new Error("Updated layer and previous version must use the same source.");delete ru(t)[e.id],delete hp(t)[e.id],i[r]=e;const o=du[nu(n.get("mapbox-style"),gl(n,e.id))];o?fu.apply(void 0,o):gl(n,e.id).changed()}function Av(n,e,t){const i=iA(n,e),r=n.getLayers().getArray().filter(function(a){return(a instanceof bn||a instanceof cl||a instanceof cr)&&a.getSource()===i}),s=n.get("mapbox-metadata");let o;switch(t.type){case"vector":o=Ru(t,s.styleUrl,s.options);break;case"geojson":o=Promise.resolve(Su(t,s.styleUrl,s.options));break;case"raster":case"raster-dem":o=Qp(t,s.styleUrl,s.options);break;default:return Promise.reject(new Error("Unsupported source type "+t.type))}return o.then(function(a){r.forEach(function(l){l.setSource(a)})}),o}function gl(n,e){const t=n.getLayers().getArray();for(let i=0,r=t.length;i 1.0 ||
v_texcoord.y > 1.0
) {
discard;
}
gl_FragColor = texture2D(u_texture, v_texcoord);
}
`;class Ev{constructor(e){this.gl_=e,this.program_=Mu(e,xv,_v),this.positionLocation=e.getAttribLocation(this.program_,"a_position"),this.texcoordLocation=e.getAttribLocation(this.program_,"a_texcoord"),this.matrixLocation=e.getUniformLocation(this.program_,"u_matrix"),this.textureMatrixLocation=e.getUniformLocation(this.program_,"u_textureMatrix"),this.textureLocation=e.getUniformLocation(this.program_,"u_texture"),this.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.positionBuffer),this.positions=[0,0,0,1,1,0,1,0,0,1,1,1],e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.positions),e.STATIC_DRAW),this.texcoordBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.texcoordBuffer),this.texcoords=[0,0,0,1,1,0,1,0,0,1,1,1],e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.texcoords),e.STATIC_DRAW)}drawImage(e,t,i,r,s,o,a,l,c,h,u,d,g){const f=this.gl_;l===void 0&&(l=r),c===void 0&&(c=s),o===void 0&&(o=t),a===void 0&&(a=i),h===void 0&&(h=o),u===void 0&&(u=a),d===void 0&&(d=f.canvas.width),g===void 0&&(g=f.canvas.height),f.bindTexture(f.TEXTURE_2D,e),f.useProgram(this.program_),f.bindBuffer(f.ARRAY_BUFFER,this.positionBuffer),f.enableVertexAttribArray(this.positionLocation),f.vertexAttribPointer(this.positionLocation,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,this.texcoordBuffer),f.enableVertexAttribArray(this.texcoordLocation),f.vertexAttribPointer(this.texcoordLocation,2,f.FLOAT,!1,0,0);let p=Pu(0,d,0,g,-1,1);p=mv(p,l,c,0),p=nA(p,h,u,1),f.uniformMatrix4fv(this.matrixLocation,!1,p);let A=yv(r/t,s/i,0);A=nA(A,o/t,a/i,1),f.uniformMatrix4fv(this.textureMatrixLocation,!1,A),f.uniform1i(this.textureLocation,0),f.drawArrays(f.TRIANGLES,0,this.positions.length/2)}}function rA(n,e,t){const i=n.createShader(e);if(i===null)throw new Error("Shader compilation failed");if(n.shaderSource(i,t),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){const r=n.getShaderInfoLog(i);throw r===null?new Error("Shader info log creation failed"):new Error(r)}return i}function Mu(n,e,t){const i=n.createProgram(),r=rA(n,n.VERTEX_SHADER,t),s=rA(n,n.FRAGMENT_SHADER,e);if(i===null)throw new Error("Program creation failed");if(n.attachShader(i,r),n.attachShader(i,s),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS))throw n.getProgramInfoLog(i)===null?new Error("Program info log creation failed"):new Error;return i}const wv=`
attribute vec4 a_position;
uniform mat4 u_matrix;
void main() {
gl_Position = u_matrix * a_position;
}
`,vv=`
precision mediump float;
uniform vec4 u_val;
void main() {
gl_FragColor = u_val;
}
`,Cv=`
attribute vec4 a_position;
attribute vec2 a_texcoord;
varying vec2 v_texcoord;
uniform mat4 u_matrix;
void main() {
gl_Position = u_matrix * a_position;
v_texcoord = a_texcoord;
}
`,bv=`
precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D u_texture;
void main() {
if (v_texcoord.x < 0.0 || v_texcoord.x > 1.0 || v_texcoord.y < 0.0 || v_texcoord.y > 1.0) {
discard;
}
gl_FragColor = texture2D(u_texture, v_texcoord);
}
`;function Tv(n,e,t,i){let r;return t&&t.length?r=t.shift():Ll?r=new OffscreenCanvas(n||300,e||300):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("webgl",i)}function Rv(n){const e=n.canvas;e.width=1,e.height=1,n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT|n.STENCIL_BUFFER_BIT)}const sA=[];function Sv(n,e,t,i,r,s,o,a,l,c,h,u,d,g){const f=Math.round(i*e),p=Math.round(i*t);n.canvas.width=f,n.canvas.height=p;let A,m;if(m=n.createTexture(),n.bindTexture(n.TEXTURE_2D,m),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),d?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR)):(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST)),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,f,p,0,n.RGBA,h,null),A=n.createFramebuffer(),n.bindFramebuffer(n.FRAMEBUFFER,A),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,m,0),A===null)throw new Error("Could not create framebuffer");if(m===null)throw new Error("Could not create texture");if(l.length===0)return{width:f,height:p,framebuffer:A,texture:m};const y=St();l.forEach(function(T,P,M){Nl(y,T.extent)});let E,x,_;const w=1/r;{if(E=n.createTexture(),m===null)throw new Error("Could not create texture");x=Math.round(ne(y)*w),_=Math.round(De(y)*w);const T=n.getParameter(n.MAX_TEXTURE_SIZE),P=Math.max(x,_),M=P>T?T/P:1,k=Math.round(x*M),I=Math.round(_*M);n.bindTexture(n.TEXTURE_2D,E),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),d?(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR)):(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST)),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,k,I,0,n.RGBA,h,null);const R=n.createFramebuffer();n.bindFramebuffer(n.FRAMEBUFFER,R),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,E,0);const B=new Ev(n);l.forEach(function(D,z,U){const S=(D.extent[0]-y[0])*w*M,X=-(D.extent[3]-y[3])*w*M,O=ne(D.extent)*w*M,Z=De(D.extent)*w*M;if(n.bindFramebuffer(n.FRAMEBUFFER,R),n.viewport(0,0,k,I),D.clipExtent){const ce=(D.clipExtent[0]-y[0])*w*M,J=-(D.clipExtent[3]-y[3])*w*M,he=ne(D.clipExtent)*w*M,me=De(D.clipExtent)*w*M;n.enable(n.SCISSOR_TEST),n.scissor(d?ce:Math.round(ce),d?J:Math.round(J),d?he:Math.round(ce+he)-Math.round(ce),d?me:Math.round(J+me)-Math.round(J))}B.drawImage(D.texture,D.width,D.height,c,c,D.width-2*c,D.height-2*c,d?S:Math.round(S),d?X:Math.round(X),d?O:Math.round(S+O)-Math.round(S),d?Z:Math.round(X+Z)-Math.round(X),k,I),n.disable(n.SCISSOR_TEST)}),n.deleteFramebuffer(R)}const v=ei(o),C=ei(y),b=T=>{const P=(T[0][0]-v[0])/s*i,M=-(T[0][1]-v[1])/s*i,k=(T[1][0]-v[0])/s*i,I=-(T[1][1]-v[1])/s*i,R=(T[2][0]-v[0])/s*i,B=-(T[2][1]-v[1])/s*i;return{u1:k,v1:I,u0:P,v0:M,u2:R,v2:B}};n.bindFramebuffer(n.FRAMEBUFFER,A),n.viewport(0,0,f,p);{const T=[],P=[],M=Mu(n,bv,Cv);n.useProgram(M);const k=n.getUniformLocation(M,"u_texture");n.bindTexture(n.TEXTURE_2D,E),n.uniform1i(k,0),a.getTriangles().forEach(function(S,X,O){const Z=S.source,ce=S.target,{u1:J,v1:he,u0:me,v0:Ee,u2:Me,v2:j}=b(ce),Dt=(Z[0][0]-C[0])/r/x,Si=-(Z[0][1]-C[1])/r/_,re=(Z[1][0]-C[0])/r/x,Kt=-(Z[1][1]-C[1])/r/_,He=(Z[2][0]-C[0])/r/x,Ce=-(Z[2][1]-C[1])/r/_;T.push(J,he,me,Ee,Me,j),P.push(re,Kt,Dt,Si,He,Ce)});const I=Pu(0,f,p,0,-1,1),R=n.getUniformLocation(M,"u_matrix");n.uniformMatrix4fv(R,!1,I);const B=n.getAttribLocation(M,"a_position"),D=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,D),n.bufferData(n.ARRAY_BUFFER,new Float32Array(T),n.STATIC_DRAW),n.vertexAttribPointer(B,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(B);const z=n.getAttribLocation(M,"a_texcoord"),U=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,U),n.bufferData(n.ARRAY_BUFFER,new Float32Array(P),n.STATIC_DRAW),n.vertexAttribPointer(z,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(z),n.drawArrays(n.TRIANGLES,0,T.length/2)}if(u){const T=Mu(n,vv,wv);n.useProgram(T);const P=Pu(0,f,p,0,-1,1),M=n.getUniformLocation(T,"u_matrix");n.uniformMatrix4fv(M,!1,P);const k=Array.isArray(u)?u:[0,0,0,255],I=n.getUniformLocation(T,"u_val");n.uniform4fv(I,k);const R=n.getAttribLocation(T,"a_position"),B=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,B),n.vertexAttribPointer(R,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(R);const D=a.getTriangles().reduce(function(z,U){const S=U.target,{u1:X,v1:O,u0:Z,v0:ce,u2:J,v2:he}=b(S);return z.concat([X,O,Z,ce,Z,ce,J,he,J,he,X,O])},[]);n.bufferData(n.ARRAY_BUFFER,new Float32Array(D),n.STATIC_DRAW),n.drawArrays(n.LINES,0,D.length/2)}return{width:f,height:p,framebuffer:A,texture:m}}class Iv extends al{constructor(e){super({tileCoord:e.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:e.interpolate,transition:e.transition}),this.renderEdges_=e.renderEdges!==void 0?e.renderEdges:!1,this.pixelRatio_=e.pixelRatio,this.gutter_=e.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=e.sourceTileGrid,this.targetTileGrid_=e.targetTileGrid,this.wrappedTileCoord_=e.wrappedTileCoord||e.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const t=e.sourceProj,i=t.getExtent(),r=e.sourceTileGrid.getExtent();this.clipExtent_=t.canWrapX()?r?ut(i,r):i:r;const s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),o=this.targetTileGrid_.getExtent();let a=this.sourceTileGrid_.getExtent();const l=o?ut(s,o):s;if(Fs(l)===0){this.state=G.EMPTY;return}i&&(a?a=ut(a,i):a=i);const c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),h=e.targetProj,u=bp(t,h,l,c);if(!isFinite(u)||u<=0){this.state=G.EMPTY;return}const d=e.errorThreshold!==void 0?e.errorThreshold:xu;if(this.triangulation_=new _u(t,h,l,a,u*d,c,e.transformMatrix),this.triangulation_.getTriangles().length===0){this.state=G.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let g=this.triangulation_.calculateSourceExtent();if(a&&(t.canWrapX()?(g[1]=Pe(g[1],a[1],a[3]),g[3]=Pe(g[3],a[1],a[3])):g=ut(g,a)),!Fs(g))this.state=G.EMPTY;else{let f=0,p=0;t.canWrapX()&&(f=ne(i),p=Math.floor((g[0]-i[0])/f)),zl(g.slice(),t,!0).forEach(m=>{const y=this.sourceTileGrid_.getTileRangeForExtentAndZ(m,this.sourceZ_),E=e.getTileFunction;for(let x=y.minX;x<=y.maxX;x++)for(let _=y.minY;_<=y.maxY;_++){const w=E(this.sourceZ_,x,_,this.pixelRatio_);if(w){const v=p*f;this.sourceTiles_.push({tile:w,offset:v})}}++p}),this.sourceTiles_.length===0&&(this.state=G.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const e=[];let t=!1;if(this.sourceTiles_.forEach(x=>{var X;const _=x.tile;if(!_||_.getState()!==G.LOADED)return;const w=_.getSize(),v=this.gutter_;let C;const b=_w(_.getData());b?C=b:(t=!0,C=Ew(ol(_.getData())));const T=[w[0]+2*v,w[1]+2*v],P=C instanceof Float32Array,M=T[0]*T[1],k=P?Float32Array:Uint8ClampedArray,I=new k(C.buffer),R=k.BYTES_PER_ELEMENT,B=R*I.length/M,D=I.byteLength/T[1],z=Math.floor(D/R/T[0]),U=this.sourceTileGrid_.getTileCoordExtent(_.tileCoord);U[0]+=x.offset,U[2]+=x.offset;const S=(X=this.clipExtent_)==null?void 0:X.slice();S&&(S[0]+=x.offset,S[2]+=x.offset),e.push({extent:U,clipExtent:S,data:I,dataType:k,bytesPerPixel:B,pixelSize:T,bandCount:z})}),this.sourceTiles_.length=0,e.length===0){this.state=G.ERROR,this.changed();return}const i=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(i),s=typeof r=="number"?r:r[0],o=typeof r=="number"?r:r[1],a=s*this.pixelRatio_,l=o*this.pixelRatio_,c=this.targetTileGrid_.getResolution(i),h=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),d=e[0].bandCount,g=new e[0].dataType(d*a*l),f=Tv(a,l,sA,{premultipliedAlpha:!1,antialias:!1});let p;const A=f.RGBA;let m;e[0].dataType==Float32Array?(m=f.FLOAT,f.getExtension("WEBGL_color_buffer_float"),f.getExtension("OES_texture_float"),f.getExtension("EXT_float_blend"),p=f.getExtension("OES_texture_float_linear")!==null&&this.interpolate):(m=f.UNSIGNED_BYTE,p=this.interpolate);const y=4,E=Math.ceil(d/y);for(let x=E-1;x>=0;--x){const _=[];for(let k=0,I=e.length;k{const i=t.getState();if(i!==G.IDLE&&i!==G.LOADING)return;e++;const r=oe(t,H.CHANGE,()=>{const s=t.getState();(s==G.LOADED||s==G.ERROR||s==G.EMPTY)&&(ve(r),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(r)}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:t}){t.getState()==G.IDLE&&t.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(ve),this.sourcesListenerKeys_=null}}class Pv extends Tu{constructor(e){const t=e.projection===void 0?"EPSG:3857":e.projection;let i=e.tileGrid;i===void 0&&t&&(i=dl({extent:Eo(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize})),super({cacheSize:.1,attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:t,tileGrid:i,state:e.state,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0,this.tileSize_=e.tileSize?Ke(e.tileSize):null,this.tileSizes_=null,this.tileLoadingKeys_={},this.loader_=e.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=e.bandCount===void 0?4:e.bandCount,this.tileGridForProjection_={},this.crossOrigin_=e.crossOrigin||"anonymous",this.transformMatrix=null}setTileSizes(e){this.tileSizes_=e}getTileSize(e){if(this.tileSizes_)return this.tileSizes_[e];if(this.tileSize_)return this.tileSize_;const t=this.getTileGrid();return t?Ke(t.getTileSize(e)):[256,256]}getGutterForProjection(e){const t=this.getProjection();return(!t||ti(t,e))&&!this.transformMatrix?this.gutter_:0}setLoader(e){this.loader_=e}getReprojTile_(e,t,i,r,s){const o=this.tileGrid||this.getTileGridForProjection(s||r),a=Math.max.apply(null,o.getResolutions().map((g,f)=>{const p=Ke(o.getTileSize(f)),A=this.getTileSize(f);return Math.max(A[0]/p[0],A[1]/p[1])})),l=this.getTileGridForProjection(r),c=[e,t,i],h=this.getTileCoordForTileUrlFunction(c,r),u=Object.assign({sourceProj:s||r,sourceTileGrid:o,targetProj:r,targetTileGrid:l,tileCoord:c,wrappedTileCoord:h,pixelRatio:a,gutter:this.gutter_,getTileFunction:(g,f,p,A)=>this.getTile(g,f,p,A),transformMatrix:this.transformMatrix},this.tileOptions),d=new Iv(u);return d.key=this.getKey(),d}getTile(e,t,i,r,s){var E;const o=this.getProjection();if(s&&(o&&!ti(o,s)||this.transformMatrix))return this.getReprojTile_(e,t,i,s,o);const a=this.getTileSize(e),l=this.loader_,c=new AbortController,h={signal:c.signal,crossOrigin:this.crossOrigin_},u=this.getTileCoordForTileUrlFunction([e,t,i]);if(!u)return null;const d=u[0],g=u[1],f=u[2],p=(E=this.getTileGrid())==null?void 0:E.getFullTileRange(d);p&&(h.maxY=p.getHeight()-1);function A(){return On(function(){return l(d,g,f,h)})}const m=Object.assign({tileCoord:[e,t,i],loader:A,size:a,controller:c},this.tileOptions),y=new al(m);return y.key=this.getKey(),y.addEventListener(H.CHANGE,this.handleTileChange_),y}handleTileChange_(e){const t=e.target,i=Y(t),r=t.getState();let s;r==G.LOADING?(this.tileLoadingKeys_[i]=!0,s=hs.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==G.ERROR?hs.TILELOADERROR:r==G.LOADED?hs.TILELOADEND:void 0),s&&this.dispatchEvent(new Dp(s,t))}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||ti(t,e))&&!this.transformMatrix)return this.tileGrid;const i=Y(e);return i in this.tileGridForProjection_||(this.tileGridForProjection_[i]=bu(e)),this.tileGridForProjection_[i]}setTileGridForProjection(e,t){const i=pe(e);if(i){const r=Y(i);r in this.tileGridForProjection_||(this.tileGridForProjection_[r]=t)}}}const Mv=new Error("Image failed to load");function oA(n,e,t,i,r){return new Promise((s,o)=>{const a=new Image;a.crossOrigin=r.crossOrigin??null,a.addEventListener("load",()=>s(a)),a.addEventListener("error",()=>o(Mv)),a.src=jp(n,e,t,i,r.maxY)})}function aA(n){return function(e,t,i,r){const s=qw(n,e,t,i);return oA(s,e,t,i,r)}}function Fv(n){return function(e,t,i,r){const s=n(e,t,i,r);return oA(s,e,t,i,r)}}function lA(n){let e;if(Array.isArray(n))e=aA(n);else if(typeof n=="string"){const t=zp(n);e=aA(t)}else if(typeof n=="function")e=Fv(n);else throw new Error("The url option must be a single template, an array of templates, or a function for getting a URL");return e}let cA=0;function hA(n){return Array.isArray(n)?n.join(`
`):typeof n=="string"?n:(++cA,"url-function-key-"+cA)}class Lv extends Pv{constructor(e){e=e||{};let t=e.loader,i;e.url&&(t=lA(e.url),i=hA(e.url));const r=t?e.state:"loading",s=e.wrapX===void 0?!0:e.wrapX;super({loader:t,key:i,attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize,gutter:e.gutter,maxResolution:e.maxResolution,projection:e.projection,tileGrid:e.tileGrid,state:r,wrapX:s,transition:e.transition,interpolate:e.interpolate!==!1,crossOrigin:e.crossOrigin,zDirection:e.zDirection})}setUrl(e){const t=lA(e);this.setLoader(t),this.setKey(hA(e)),this.getState()!=="ready"&&this.setState("ready")}}const kv="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCeRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOShgAHAAAAEgAAAISgAgAEAAAAAQAAAMigAwAEAAAAAQAAAMgAAAAAQVNDSUkAAABTY3JlZW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P91tHsrm5MOqaoWZ41/wBHSQYdAwwzuOgkf0/gX5R/FnpqRfuj6UtJKysTGKikkU9RuPslhc3WceTG759Nqk0zS4Da6baWx4MUUaf98qBVXxH/AMi/qf8A17Tf+gGtdPuL9BU/aOx6UV5v8l/wR1NZgqlmOAOTTqguv+PaX/cb+RqzmitTM8PK40e3lkG17gNOw9GmYyEfhurarP0n/kF2f/XGP/0EVoVMPhRvi3erN+b/ADI/KiznYMn29aBFEuCqAYyRx0z1qSiqOcKzNQS6UpdWkYldFZChOOHK5IPtjOO9adFRUjdWMq9Pmg1cqWIKWscRVl8pQnzAAnaMZwCat0UU4LRDpK0Ugqu1tGXMseY3PUr3+o6H+dWKKbinuVKClujkNUgfT531A232i1fLXMSpvDYH+tReSHAHIH3h33AZ2YLHTrm3jntXcwyqrIY5nClSOCMN0xVu/wD+PKf/AHG/lWZ4V/5FjSP+vSD/ANFinTqzTcUzGm3zuL6F7+y7FiDLH5uP+ejGQfkxIq+AFGFGAKWiqlNvdnRYKKKKkCCdGIEkX+sj5Hv6j8akjkWVFkTowzT6q2X/AB7J+P8AOo+0ZbT9f0sWqKKKs1P/2Q==";class Gv extends ia{constructor(t){const i=t||{},r=document.createElement("button");r.innerHTML=``;const s=document.createElement("div");s.className="layer-control ol-unselectable ol-control",s.appendChild(r);const o=document.createElement("div");o.classList.add("layer-selection","hidden"),s.appendChild(o);super({element:s,target:i.target});Mi(this,"baseLayers",[{name:"positron",image:kv,styleUrl:"https://tiles.openfreemap.org/styles/positron"},{name:"orthofoto",image:Dv,layer:new cl({visible:!1,source:new Lv({maxZoom:19,url:"https://mapsneu.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpg",attributions:'© basemap.at'})}),visible:!1},{name:"kataster",image:Ov,styleUrl:"https://kataster.bev.gv.at/styles/kataster/style_basic.json"}].map((t,i)=>{t.styleUrl&&(t.layer=new Bi({visible:i===0}),t.styleUrl&&eA(t.layer,t.styleUrl));const r=document.createElement("div");r.classList.add("image-box"),i===0&&r.classList.add("selected");const s=document.createElement("img");return s.src=t.image,s.alt=t.name,r.appendChild(s),r.addEventListener("click",o=>{this.baseLayers.forEach(a=>{o.target===a.thumbnailBox?a.thumbnailBox.classList.add("selected"):a.thumbnailBox.classList.remove("selected")}),this.baseLayers.forEach(a=>{a.layer.setVisible(a.name===t.name)})}),t.thumbnailBox=r,t}));Mi(this,"baseLayerGroup");Mi(this,"layerControlElement",null);this.baseLayers.forEach(a=>{o.appendChild(a.thumbnailBox)}),this.layerControlElement=o,r.addEventListener("click",this.toggleLayerSelection.bind(this),!1)}setMap(t){this.getMap()&&this.getMap().removeLayer(this.baseLayerGroup),t&&(this.baseLayerGroup=new Bi({layers:this.baseLayers.map(i=>i.layer)}),t.addLayer(this.baseLayerGroup)),super.setMap(t)}set displayLayerSelection(t){if(t){this.layerControlElement.classList.remove("hidden");const i=()=>{this.displayLayerSelection=!1,this.getMap().getTargetElement().removeEventListener("click",i)};setTimeout(()=>{this.getMap().getTargetElement().addEventListener("click",i)}),this.getMap().once("moveend",()=>{this.displayLayerSelection&&(this.displayLayerSelection=!1,document.body.removeEventListener("click",i))})}else this.fadeOutAndHide()}get displayLayerSelection(){return!this.layerControlElement.classList.contains("hidden")}toggleLayerSelection(){this.displayLayerSelection=!this.displayLayerSelection}fadeOutAndHide(){this.layerControlElement.classList.add("fade-out"),setTimeout(()=>{this.layerControlElement.classList.remove("fade-out"),this.layerControlElement.classList.add("hidden")},150)}}class Bv extends fn{constructor(t){super();_e(this,gs);_e(this,ci,null);_e(this,In,new bn({source:new En}));Re(this,ci,t.yioMap);const i=L(this,In).getSource();i.addEventListener("change",r=>{L(this,ci).userSelect=i.getFeatures().map(s=>s.getProperties())})}setMap(t){const i=this.getMap();i&&i.removeLayer(L(this,In)),t&&(t.addLayer(L(this,In)),super.setMap(t))}handleEvent(t){return t.type==="pointermove"&&At(this,gs,CA).call(this,t),t.type==="click"?At(this,gs,bA).call(this,t):!0}setActive(t){super.setActive(t),t||(L(this,In).getSource().clear(),L(this,ci)&&(L(this,ci).userSelect.length=0))}}ci=new WeakMap,In=new WeakMap,gs=new WeakSet,CA=function(t){const i=this.getMap(),r=L(this,ci)._getContentLayer();i.getFeaturesAtPixel(t.pixel,{layerFilter:o=>r.getLayers().getArray().includes(o)}).filter(o=>o.get("id")!==void 0).length?i.getTargetElement().classList.add("cursor-pointer"):i.getTargetElement().classList.remove("cursor-pointer")},bA=function(t){const i=this.getMap(),r=L(this,ci)._getContentLayer(),s=L(this,In).getSource(),o=i.getFeaturesAtPixel(t.pixel,{layerFilter:a=>r.getLayers().getArray().includes(a)}).filter(a=>a.get("id")!==void 0);return s.clear(),s.addFeatures(o.map(a=>a instanceof tt?Xf(a):a)),L(this,ci).notifyNextChange=!0,L(this,ci)._handleClick(t.originalEvent),o.length===0};const Al={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class ml extends Tt{constructor(e,t){super(e),this.feature=t}}function Nv(n,e){const t=[];for(let i=0;i=t?n[e-t]:n[e]}function _l(n,e,t){let i,r;eo){const l=ds(n,i),c=ds(n,r);return yl(l,c)}let a=0;if(id.startIndex?pd.startIndex&&(p-=g.length)),l=p,a=u)}const c=e.targets[a];let h=c.ring;if(e.targetIndex===a&&h){const u=ds(c.coordinates,l),d=t.getPixelFromCoordinate(u);Ls(d,e.startPx)>i&&(h=!1)}if(h){const u=c.coordinates,d=u.length,g=c.startIndex,f=l;if(g=t?i-=t:i<0&&(i+=t);let s=i+1;s>=t&&(s-=t);const o=n[i],a=o[0],l=o[1],c=n[s],h=c[0]-a,u=c[1]-l;return[a+h*r,l+u*r]}class zv extends Yn{constructor(e){const t=e;t.stopDown||(t.stopDown=br),super(t),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=e.source?e.source:null,this.features_=e.features?e.features:null,this.snapTolerance_=e.snapTolerance?e.snapTolerance:12,this.type_=e.type,this.mode_=Vv(this.type_),this.stopClick_=!!e.stopClick,this.minPoints_=e.minPoints?e.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:e.maxPoints?e.maxPoints:1/0,this.finishCondition_=e.finishCondition?e.finishCondition:Cr,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY";let i=e.geometryFunction;if(!i){const r=this.mode_;if(r==="Circle")i=(s,o,a)=>{const l=o||new xa([NaN,NaN]),c=Ne(s[0]),h=Sr(c,Ne(s[s.length-1]));return l.setCenterAndRadius(c,Math.sqrt(h),this.geometryLayout_),l};else{let s;r==="Point"?s=yt:r==="LineString"?s=Wt:r==="Polygon"&&(s=Nt),i=(o,a,l)=>(a?r==="Polygon"?o[0].length?a.setCoordinates([o[0].concat([o[0][0]])],this.geometryLayout_):a.setCoordinates([],this.geometryLayout_):a.setCoordinates(o,this.geometryLayout_):a=new s(o,this.geometryLayout_),a)}}this.geometryFunction_=i,this.dragVertexDelay_=e.dragVertexDelay!==void 0?e.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,this.overlay_=new bn({source:new En({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:Uv(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:ra,this.freehandCondition_,e.freehand?this.freehandCondition_=na:this.freehandCondition_=e.freehandCondition?e.freehandCondition:cf,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Cc.ACTIVE,this.updateState_)}setTrace(e){let t;e?e===!0?t=na:t=e:t=Vy,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(e){e.originalEvent.type===H.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let t=e.type===ae.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&e.type===ae.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,t=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&e.type===ae.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===ae.POINTERDOWN?i=!1:t&&this.getPointerCount()<2?(i=e.type===ae.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===ae.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===ae.DBLCLICK&&(i=!1),super.handleEvent(e)&&i}handleDownEvent(e){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=e.pixel,this.finishCoordinate_||this.startDrawing_(e.coordinate),!0):this.condition_(e)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new Li(ae.POINTERMOVE,e.map,e.originalEvent,!1,e.frameState))},this.dragVertexDelay_),this.downPx_=e.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_();return}const t=this.getMap(),i=t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),r=t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_]),s=ht([i,r]),o=this.traceSource_.getFeaturesInExtent(s);if(o.length===0)return;const a=Nv(e.coordinate,o);a.length&&(this.traceState_={active:!0,startPx:e.pixel.slice(),targets:a,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){const i=e.startIndex<=e.endIndex,r=e.startIndex<=t;i===r?i&&t>e.endIndex||!i&&te.endIndex)&&this.removeTracedCoordinates_(t,e.endIndex):(this.removeTracedCoordinates_(e.startIndex,e.endIndex),this.addTracedCoordinates_(e,e.startIndex,t))}removeTracedCoordinates_(e,t){if(e===t)return;let i=0;if(e0&&this.removeLastPoints_(i)}addTracedCoordinates_(e,t,i){if(t===i)return;const r=[];if(t=o;--a)r.push(us(e.coordinates,a))}r.length&&this.appendCoordinates(r)}updateTrace_(e){const t=this.traceState_;if(!t.active||t.targetIndex===-1&&Ls(t.startPx,e.pixel)this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(e.coordinate.slice());return}this.updateTrace_(e),this.modifyDrawing_(e.coordinate)}atFinish_(e,t){let i=!1;if(this.sketchFeature_){let r=!1,s=[this.finishCoordinate_];const o=this.mode_;if(o==="Point")i=!0;else if(o==="Circle")i=this.sketchCoords_.length===2;else if(o==="LineString")r=!t&&this.sketchCoords_.length>this.minPoints_;else if(o==="Polygon"){const a=this.sketchCoords_;r=a[0].length>this.minPoints_,s=[a[0][0],a[0][a[0].length-2]],t?s=[a[0][0]]:s=[a[0][0],a[0][a[0].length-2]]}if(r){const a=this.getMap();for(let l=0,c=s.length;l=this.maxPoints_&&(this.freehand_?s.pop():r=!0),s.push(e.slice()),this.geometryFunction_(s,t,i)):o==="Polygon"&&(s=this.sketchCoords_[0],s.length>=this.maxPoints_&&(this.freehand_?s.pop():r=!0),s.push(e.slice()),r&&(this.finishCoordinate_=s[0]),this.geometryFunction_(this.sketchCoords_,t,i)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),r=this.mode_;for(let s=0;s=2){this.finishCoordinate_=o[o.length-2].slice();const a=this.finishCoordinate_.slice();o[o.length-1]=a,this.createOrUpdateSketchPoint_(a)}this.geometryFunction_(o,t,i),t.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(r==="Polygon"){o=this.sketchCoords_[0],o.splice(-2,1);const a=this.sketchLine_.getGeometry();if(o.length>=2){const l=o[o.length-2].slice();o[o.length-1]=l,this.createOrUpdateSketchPoint_(l)}a.setCoordinates(o),this.geometryFunction_(this.sketchCoords_,t,i)}if(o.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_;const i=e.getGeometry(),r=this.getMap().getView().getProjection();return this.mode_==="LineString"?(t.pop(),this.geometryFunction_(t,i,r)):this.mode_==="Polygon"&&(t[0].pop(),this.geometryFunction_(t,i,r),t=i.getCoordinates()),this.type_==="MultiPoint"?e.setGeometry(new er([t])):this.type_==="MultiLineString"?e.setGeometry(new An([t])):this.type_==="MultiPolygon"&&e.setGeometry(new mn([t])),this.dispatchEvent(new ml(Al.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;const e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){const e=this.abortDrawing_();e&&this.dispatchEvent(new ml(Al.DRAWABORT,e))}appendCoordinates(e){const t=this.mode_,i=!this.sketchFeature_;i&&this.startDrawing_(e[0]);let r;if(t==="LineString"||t==="Circle")r=this.sketchCoords_;else if(t==="Polygon")r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;i&&r.shift(),r.pop();for(let o=0;o=0;--r){const s=i[r];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===s&&this.dragSegments_.splice(o,1);t.remove(s)}}setActive(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(e)}setMap(e){this.overlay_.setMap(e),super.setMap(e)}getOverlay(){return this.overlay_}handleSourceAdd_(e){e.feature&&this.features_.push(e.feature)}handleSourceRemove_(e){e.feature&&this.features_.remove(e.feature)}handleFeatureAdd_(e){this.addFeature_(e.element)}handleFeatureChange_(e){if(!this.changingFeature_){const t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){this.removeFeature_(e.element)}writePointGeometry_(e,t){const i=t.getCoordinates(),r={feature:e,geometry:t,segment:[i,i]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;rs));const t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],i=[],r=[];for(let s=0,o=this.dragSegments_.length;s=0;--s)this.insertVertex_(i[s],r);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){const i=this.dragSegments_[t][0],r=i.geometry;if(r.getType()==="Circle"){const s=r,o=s.getCenter(),a=i.featureSegments[0],l=i.featureSegments[1];a.segment[0]=o,a.segment[1]=o,l.segment[0]=o,l.segment[1]=o,this.rBush_.update(Ps(o),a);let c=s;this.rBush_.update(c.getExtent(),l)}else this.rBush_.update(ht(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Du(ku.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastPixel_=e.pixel,this.handlePointerAtPixel_(e.coordinate)}handlePointerAtPixel_(e){const t=this.getMap(),i=t.getPixelFromCoordinate(e);t.getView().getProjection();const r=function(a,l){return pA(e,a)-pA(e,l)};let s,o;if(this.hitDetection_){const a=typeof this.hitDetection_=="object"?l=>l===this.hitDetection_:void 0;t.forEachFeatureAtPixel(i,(l,c,h)=>{h&&h.getType()==="Point"&&(h=new yt(Vn(h.getCoordinates())));const u=h||l.getGeometry();if(u&&u.getType()==="Point"&&l instanceof Pt&&this.features_.getArray().includes(l)){o=u;const d=l.getGeometry().getFlatCoordinates().slice(0,2);s=[{feature:l,geometry:o,segment:[d,d]}]}return!0},{layerFilter:a})}if(!s){const a=ii(Ps(e,gA)),l=t.getView().getResolution()*this.pixelTolerance_,c=Xo(Di(a,l,gA));s=this.rBush_.getInExtent(c)}if(s&&s.length>0){const a=s.sort(r)[0],l=a.segment;let c=AA(e,a);const h=t.getPixelFromCoordinate(c);let u=Ls(i,h);if(o||u<=this.pixelTolerance_){const d={};if(d[Y(l)]=!0,this.snapToPointer_||(this.delta_[0]=c[0]-e[0],this.delta_[1]=c[1]-e[1]),a.geometry.getType()==="Circle"&&a.index===wo)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(c,[a.feature],[a.geometry],this.snappedToVertex_);else{const g=t.getPixelFromCoordinate(l[0]),f=t.getPixelFromCoordinate(l[1]),p=Sr(h,g),A=Sr(h,f);if(u=Math.sqrt(Math.min(p,A)),this.snappedToVertex_=u<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);return}this.snappedToVertex_&&(c=p>A?l[1]:l[0]),this.createOrUpdateVertexFeature_(c,[a.feature],[a.geometry],this.snappedToVertex_);const m={};m[Y(a.geometry)]=!0;for(let y=1,E=s.length;yi.getType()==="Circle"||i.getType().endsWith("Point")))return!1;const e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(ht([e])).some(({segment:i})=>dt(i[0],e)||dt(i[1],e))}removePoint(e){if(e&&(e=Ne(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=ae.POINTERDRAG){const t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_.map(([r])=>r));const i=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new Du(ku.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,i}return!1}removeVertex_(){const e=this.dragSegments_,t={};let i=!1,r,s,o,a,l,c,h,u,d,g,f;for(l=e.length-1;l>=0;--l)o=e[l],g=o[0],f=Y(g.feature),g.depth&&(f+="-"+g.depth.join("-")),f in t||(t[f]={}),o[1]===0?(t[f].right=g,t[f].index=g.index):o[1]==1&&(t[f].left=g,t[f].index=g.index+1);for(f in t){switch(d=t[f].right,h=t[f].left,c=t[f].index,u=c-1,h!==void 0?g=h:g=d,u<0&&(u=0),a=g.geometry,s=a.getCoordinates(),r=s,i=!1,a.getType()){case"MultiLineString":s[g.depth[0]].length>2&&(s[g.depth[0]].splice(c,1),i=!0);break;case"LineString":s.length>2&&(s.splice(c,1),i=!0);break;case"MultiPolygon":r=r[g.depth[1]];case"Polygon":r=r[g.depth[0]],r.length>4&&(c==r.length-1&&(c=0),r.splice(c,1),i=!0,c===0&&(r.pop(),r.push(r[0]),u=r.length-1));break}if(i){this.setGeometryCoordinates_(a,s);const p=[];if(h!==void 0&&(this.rBush_.remove(h),p.push(h.segment[0])),d!==void 0&&(this.rBush_.remove(d),p.push(d.segment[1])),h!==void 0&&d!==void 0){const A={depth:g.depth,feature:g.feature,geometry:g.geometry,index:u,segment:p};this.rBush_.insert(ht(A.segment),A)}this.updateSegmentIndices_(a,c,g.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.length=0}}return i}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(i=>i.getType()==="Circle"||i.getType().endsWith("Point")))return!1;const e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(ht([e])).some(({segment:i})=>!(dt(i[0],e)||dt(i[1],e)))}insertPoint(e){var r;const t=e?Ne(e,this.getMap().getView().getProjection()):(r=this.vertexFeature_)==null?void 0:r.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((s,o)=>s||this.insertVertex_(o,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,i,r){this.rBush_.forEachInExtent(e.getExtent(),function(s){s.geometry===e&&(i===void 0||s.depth===void 0||Fi(s.depth,i))&&s.index>t&&(s.index+=r)})}}function Hv(n,e){return n.index-e.index}function pA(n,e,t){const i=e.geometry;if(i.getType()==="Circle"){let s=i;if(e.index===wo){const o=Sr(s.getCenter(),Ne(n)),a=Math.sqrt(o)-s.getRadius();return a*a}}const r=Ne(n);return fs[0]=Ne(e.segment[0]),fs[1]=Ne(e.segment[1]),vm(r,fs)}function AA(n,e,t){const i=e.geometry;if(i.getType()==="Circle"&&e.index===wo)return Vn(i.getClosestPoint(Ne(n)));const r=Ne(n);return fs[0]=Ne(e.segment[0]),fs[1]=Ne(e.segment[1]),Vn(gd(r,fs))}function Xv(){const n=Pf();return function(e,t){return n.Point}}const mA=new Ut({color:"rgba(255,255,255,0.4)"}),yA=new Vt({color:"#3399CC",width:1.25}),_A=[new Qe({image:new Jn({fill:mA,stroke:yA,radius:5}),fill:mA,stroke:yA})],Yv=`
`,Kv=new Qe({image:new $n({opacity:1,src:"data:image/svg+xml;utf8,"+Yv,anchor:[.5,1]})});class Zv extends fn{constructor(t){super();_e(this,ui);_e(this,ur,null);_e(this,Ht,null);_e(this,hi,null);_e(this,Ri);_e(this,Pn,null);_e(this,dr,new Set);Mi(this,"drawInteraction");Mi(this,"modifyInteraction");_e(this,Yi,null);_e(this,Ki,!1);_e(this,Zi,null);Re(this,ur,t.yioMap)}getEditLayer(){return L(this,Ht)}clearModifiedFeatures(){const t=L(this,Ht).getSource(),i=t.getFeatures().filter(r=>r.get("id")!==void 0);t.removeFeatures(i),L(this,dr).clear()}clearCreatedFeatures(){const t=L(this,Ht).getSource(),i=t.getFeatures().filter(r=>r.get("id")===void 0);t.removeFeatures(i)}async setActive(t){var r;if(t===this.getActive())return;const i=this.getMap();if(i){if(t){const s=await L(this,ur)._getContentLayerPromise();if(!tA(s,"edits").length){console.warn('No edits source found in content layer. Please add a source with key "edits" and at least one layer that uses it.');const a=s.get("mapbox-style");a.sources.edits={type:"geojson",data:{type:"FeatureCollection",features:[]}};for(const l of a.layers)((r=a.sources[l.source])==null?void 0:r.type)!=="vector"&&(l.type!=="circle"||l.type!=="symbol")||await gv(s,{id:"edits-"+l.id,source:"edits","source-layer":l["source-layer"],type:"circle",paint:{"circle-radius":5,"circle-color":"#ff0000","circle-stroke-width":1}})}Re(this,Ht,tA(s,"edits")[0]),Re(this,hi,L(this,ur)._getContentLayer().getLayers().getArray().filter(a=>a instanceof cr).pop()),L(this,Yi)||(Re(this,Yi,L(this,hi).getStyle()),L(this,hi).setStyle((a,l)=>{if(!L(this,dr).has(a.get("id")))return L(this,Yi).call(this,a,l)})),L(this,Zi)||(Re(this,Zi,a=>{if(!this.modifyEnabled)return i.getTargetElement().style.cursor="",Re(this,Ki,!1),null;Re(this,Ki,!!At(this,ui,Gu).call(this,a.pixel)),L(this,Ki)?i.getTargetElement().classList.add("cursor-move"):i.getTargetElement().classList.remove("cursor-move")}),i.on("pointermove",L(this,Zi))),At(this,ui,RA).call(this)}else L(this,Yi)&&(L(this,hi).setStyle(L(this,Yi)),Re(this,Yi,null)),Re(this,Ri,null),L(this,Zi)&&(i.un("pointermove",L(this,Zi)),Re(this,Zi,null)),At(this,ui,SA).call(this);super.setActive(t)}}get createEnabled(){return!!L(this,Ri)}async setCreateEnabled(t){Re(this,Ri,t||void 0),t||(this.clearCreatedFeatures(),L(this,hi).getSource().refresh()),await this.setActive(!!t||!!L(this,Pn)),this.drawInteraction&&this.drawInteraction.setMap(t?this.getMap():null),this.modifyInteraction&&this.modifyInteraction.setMap(t||L(this,Pn)?this.getMap():null)}get modifyEnabled(){return!!L(this,Pn)||!!L(this,Ri)}async setModifyEnabled(t){t&&t.length===0&&(t=null),t||(this.clearModifiedFeatures(),L(this,hi).getSource().refresh()),Re(this,Pn,t),await this.setActive(!!t||!!L(this,Ri)),this.modifyInteraction&&this.modifyInteraction.setMap(t||L(this,Ri)?this.getMap():null)}handleEvent(t){let i=!0;if(t.type==="pointerdown"){const r=At(this,ui,Gu).call(this,t.pixel);if(r&&r instanceof tt&&this.modifyEnabled){const s=r.get("id");L(this,dr).has(s)||L(this,dr).add(s),L(this,hi).changed();const o=Xf(r);L(this,Ht).getSource().addFeature(o)}}return i&&this.modifyEnabled&&(i=this.modifyInteraction.handleEvent(t)),i&&this.createEnabled&&(i=this.drawInteraction.handleEvent(t)),i&&t.type==="click"&&At(this,ui,TA).call(this,t),i}}ur=new WeakMap,Ht=new WeakMap,hi=new WeakMap,Ri=new WeakMap,Pn=new WeakMap,dr=new WeakMap,ui=new WeakSet,TA=function(t){L(this,ur)._handleClick(t.originalEvent)},Yi=new WeakMap,Ki=new WeakMap,RA=function(){this.drawInteraction=new zv({source:L(this,Ht).getSource(),condition:t=>ra(t)?this.createEnabled&&!L(this,Ki):!1,type:"Point",style:()=>L(this,Ki)?null:_A}),this.getMap().addInteraction(this.drawInteraction),this.drawInteraction.on("drawend",t=>{t.feature.set("mvt:layer",L(this,Ri))}),this.modifyInteraction=new Wv({source:L(this,Ht).getSource(),condition:t=>Sc(t)?this.modifyEnabled:!1,style:()=>L(this,Ki)?null:_A}),this.getMap().addInteraction(this.modifyInteraction)},SA=function(){this.drawInteraction&&(this.drawInteraction.setMap(null),this.drawInteraction=null),this.modifyInteraction&&(this.modifyInteraction.setMap(null),this.modifyInteraction=null)},Zi=new WeakMap,Gu=function(t){const r=this.getMap().getFeaturesAtPixel(t,{layerFilter:s=>s===L(this,Ht)||s==L(this,hi)}).filter(s=>{var o;return s.getGeometry().getType()==="Point"&&(L(this,Ht).getSource().hasFeature(s)||((o=L(this,Pn))==null?void 0:o.includes(s.get("id"))))});return r.length?r[0]:null};class Qv extends fn{constructor(t){super();_e(this,vl);_e(this,vo,null);_e(this,fr,new bn({source:new En}));Re(this,vo,t.yioMap),this.setActive(!1)}setMap(t){const i=this.getMap();i&&i.removeLayer(L(this,fr)),t&&(t.addLayer(L(this,fr)),super.setMap(t))}setActive(t){t||L(this,fr).getSource().clear(),super.setActive(t)}handleEvent(t){return t.type==="click"&&At(this,vl,IA).call(this,t),!0}}vo=new WeakMap,fr=new WeakMap,vl=new WeakSet,IA=function(t){const i=this.getMap(),r=L(this,vo)._getContentLayer(),s=L(this,fr).getSource(),o=i.getFeaturesAtPixel(t.pixel,{layerFilter:a=>r.getLayers().getArray().includes(a)});if(s.clear(),o.length===0){const a=new Pt(new yt(t.coordinate));a.setStyle(Kv),s.addFeature(a)}};const qv="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20width='100%25'%20height='100%25'%20viewBox='0%200%20256%20256'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xml:space='preserve'%20xmlns:serif='http://www.serif.com/'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3e%3cg%3e%3cg%20id='favicon'%3e%3crect%20x='0'%20y='0'%20width='256'%20height='256'%20style='fill:none;'/%3e%3cg%3e%3cpath%20d='M54.77,244.669C59.16,246.864%2071.078,250.001%2083.623,250.001C125.022,250.001%20142.585,223.029%20152.621,191.98L212.21,6L163.284,6L146.662,66.216C140.076,90.051%20135.999,112.005%20133.49,128L132.235,128C130.04,112.946%20123.14,86.288%20116.554,66.216L96.796,6L43.793,6L110.282,182.571C108.713,200.448%2098.677,210.17%2081.742,210.17C73.901,210.17%2067.315,208.288%2062.61,205.779L54.77,244.669Z'%20style='fill:rgb(223,72,110);fill-rule:nonzero;'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",El=document.createElement("img");El.src=qv,El.alt="yio.at",El.style.height="1em";const Jv=new sf({label:El,render:function(n){const e=this.element;if(!e||!n.frameState)return;const t=this.collectSourceAttributions_(n.frameState)??[],i=[];i.push(`
yio gmbh
`);for(const o of t)i.push(o);const r=i.map((o,a)=>a===0?`${o}`:`|${o}`).join("");let s=e.querySelector("ul");s||(s=document.createElement("ul"),e.appendChild(s)),s.innerHTML=r}});class wl extends vs{constructor(){super();_e(this,Yt);Mi(this,"notifyNextChange",!1);_e(this,lt,null);_e(this,Co,"");_e(this,gr,new Bi);_e(this,Qi,null);_e(this,pr,null);_e(this,Ar,null);_e(this,Xt,null);_e(this,bo,null);_e(this,To,null);_e(this,mr,!1);_e(this,yr,!1);_e(this,Mn,null);_e(this,Fn,null);this.center=[0,0],this.zoom=2,this.userSelect=[],Re(this,Qi,new Zv({yioMap:this})),Re(this,pr,new Bv({yioMap:this})),Re(this,Ar,new Qv({yioMap:this}))}_getContentLayer(){return L(this,gr)}_getContentLayerPromise(){return L(this,Xt)}_handleClick(t){t instanceof PointerEvent&&(this.lastClickCoordinate=Fd(L(this,lt).getEventCoordinate(t))),this.dispatchEvent(new PointerEvent("click",t))}get contentMap(){return L(this,Co)}set contentMap(t){Re(this,Co,t),At(this,Yt,PA).call(this)}get editCreate(){return L(this,bo)}set editCreate(t){Re(this,bo,t),L(this,Qi).setCreateEnabled(t)}set editModify(t){Re(this,To,t),L(this,Qi).setModifyEnabled(t)}get editModify(){return L(this,To)}get enableSelect(){return L(this,mr)}set enableSelect(t){Re(this,mr,t),L(this,pr).setActive(!!L(this,mr))}get enablePinning(){return L(this,yr)}set enablePinning(t){Re(this,yr,t),L(this,Ar).setActive(!!L(this,yr))}get geojsonSources(){return L(this,Mn)}set geojsonSources(t){Re(this,Mn,t)}get sourceLayerVisibility(){return L(this,Fn)}set sourceLayerVisibility(t){Re(this,Fn,t)}get editFeatures(){var r,s;const t=(s=(r=L(this,Qi).getEditLayer())==null?void 0:r.getSource())==null?void 0:s.getFeatures();return t?new sh().writeFeaturesObject(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}):null}firstUpdated(t){super.firstUpdated(t),At(this,Yt,MA).call(this);const i=this.shadowRoot.querySelector(".map");this.shadowRoot.addEventListener("click",r=>r.stopPropagation()),L(this,lt).setTarget(i)}updated(t){super.updated(t),t.has("sourceLayerVisibility")&&!t.has("contentMap")&&L(this,Xt)&&At(this,Yt,Nu).call(this),t.has("geojsonSources")&&!t.has("contentMap")&&L(this,Xt)&&At(this,Yt,Bu).call(this),!this.notifyNextChange&&(t.has("center")||t.has("zoom"))&&L(this,lt).getView().animate({center:Wo(this.center),zoom:this.zoom,duration:500}),this.notifyNextChange&&(this.notifyNextChange=!1,this.dispatchEvent(new CustomEvent("change",{composed:!0,bubbles:!0,detail:{changedProperties:t}})))}render(){return WA` `}}return lt=new WeakMap,Co=new WeakMap,gr=new WeakMap,Qi=new WeakMap,pr=new WeakMap,Ar=new WeakMap,Xt=new WeakMap,bo=new WeakMap,To=new WeakMap,mr=new WeakMap,yr=new WeakMap,Mn=new WeakMap,Fn=new WeakMap,Yt=new WeakSet,PA=async function(){await L(this,Xt),L(this,gr).getLayers().clear(),Re(this,Xt,null),this.contentMap&&(Re(this,Xt,eA(L(this,gr),this.contentMap).catch(t=>{console.error("Error applying content to yiomap:",t)})),await L(this,Xt),await At(this,Yt,Nu).call(this),await At(this,Yt,Bu).call(this))},Bu=async function(){if(!L(this,Mn))return;const t=await L(this,Xt);if(!t)return;const i=Object.keys(L(this,Mn));try{await Promise.all(i.map(r=>{const s=L(this,Mn)[r];if(!iA(t,r))throw new Error("Geojson source '"+r+"' does not exist.");return Av(t,r,{type:"geojson",data:s})}))}catch(r){console.error("Error updating GeoJSON sources:",r)}},Nu=async function(){if(!L(this,Fn))return;const t=await L(this,Xt);if(!t)return;const i=t.get("mapbox-style"),r=Object.keys(i.layers);try{await Promise.all(r.map(s=>{const o=i.layers[s],a=o["source-layer"];if(!a||!(a in L(this,Fn)))return;const l=L(this,Fn)[a]?"visible":"none";pv(t,{...o,layout:{...o.layout,visibility:l}})}))}catch(s){console.error("Error updating source layer visibility:",s)}},MA=function(){Re(this,lt,new ya({controls:of({attribution:!1})})),L(this,lt).addControl(Jv),L(this,lt).addControl(new Gv({map:L(this,lt)})),L(this,lt).addLayer(L(this,gr)),L(this,lt).addInteraction(L(this,pr)),L(this,pr).setActive(L(this,mr)),L(this,lt).addInteraction(L(this,Ar)),L(this,Ar).setActive(L(this,yr)),L(this,lt).addInteraction(L(this,Qi)),L(this,Qi).setActive(!!this.editCreate||!!this.editModify);let t=!0;L(this,lt).on("moveend",()=>{if(t){t=!1;return}const i=L(this,lt).getView();this.notifyNextChange=!0,this.center=Fd(i.getCenter()),this.zoom=i.getZoom()})},Mi(wl,"styles",[bl(JA),bl($A),FA`
:host {
display: block;
height: 200px;
}
.map {
width: 100%;
height: 100%;
}
.cursor-pointer {
cursor: pointer;
}
.cursor-move {
cursor: move;
}
.cursor-pointer.cursor-move {
cursor: grab;
}
`]),Mi(wl,"properties",{center:{type:Array,reflect:!0},zoom:{type:Number,reflect:!0},contentMap:{type:String},editCreate:{type:String},editModify:{type:Array},enablePinning:{type:Boolean},enableSelect:{type:Boolean},geojsonSources:{type:Object},editFeatures:{attribute:!1},lastClickCoordinate:{type:Array,attribute:!1},userSelect:{attribute:!1},sourceLayerVisibility:{type:Object}}),window.customElements.define("yio-map",wl),wl});