yio-map 0.12.1 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +1,22 @@
1
- (function(Ae,Ee){typeof exports=="object"&&typeof module<"u"?module.exports=Ee():typeof define=="function"&&define.amd?define(Ee):(Ae=typeof globalThis<"u"?globalThis:Ae||self,Ae.YioMap=Ee())})(this,(function(){"use strict";var ZC=Object.defineProperty;var nm=Ae=>{throw TypeError(Ae)};var qC=(Ae,Ee,Ye)=>Ee in Ae?ZC(Ae,Ee,{enumerable:!0,configurable:!0,writable:!0,value:Ye}):Ae[Ee]=Ye;var Gt=(Ae,Ee,Ye)=>qC(Ae,typeof Ee!="symbol"?Ee+"":Ee,Ye),hd=(Ae,Ee,Ye)=>Ee.has(Ae)||nm("Cannot "+Ye);var M=(Ae,Ee,Ye)=>(hd(Ae,Ee,"read from private field"),Ye?Ye.call(Ae):Ee.get(Ae)),ae=(Ae,Ee,Ye)=>Ee.has(Ae)?nm("Cannot add the same private member more than once"):Ee instanceof WeakSet?Ee.add(Ae):Ee.set(Ae,Ye),pe=(Ae,Ee,Ye,Ls)=>(hd(Ae,Ee,"write to private field"),Ls?Ls.call(Ae,Ye):Ee.set(Ae,Ye),Ye),le=(Ae,Ee,Ye)=>(hd(Ae,Ee,"access private method"),Ye);/**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */var im,mi,zn,Ps,sm,om,Pr,ni,yi,Di,jn,Mr,_i,am,Ji,$i,lm,cm,en,ud,Ms,Fr,Lr,dd,hm,Yo,Fs,de,fd,um,Ql,dm,fm,gm,pm,Am,mm,ym,_m,xm,Em,wm,vm,st,Ko,kr,tn,Dr,Un,ri,Zo,qo,Or,Gr,Vn,Wn,Br,nn,Ct,Cm,gd,pd,bm,ql,Ad;const Ae=globalThis,Ee=Ae.ShadowRoot&&(Ae.ShadyCSS===void 0||Ae.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ye=Symbol(),Ls=new WeakMap;let md=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Ye)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(Ee&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Ls.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ls.set(t,e))}return e}toString(){return this.cssText}};const Qo=n=>new md(typeof n=="string"?n:n+"",void 0,Ye),yd=(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 md(t,n,Ye)},Tm=(n,e)=>{if(Ee)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),r=Ae.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},_d=Ee?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Qo(t)})(n):n;/**
6
- * @license
7
- * Copyright 2017 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:Rm,defineProperty:Sm,getOwnPropertyDescriptor:Im,getOwnPropertyNames:Pm,getOwnPropertySymbols:Mm,getPrototypeOf:Fm}=Object,cn=globalThis,xd=cn.trustedTypes,Lm=xd?xd.emptyScript:"",Jl=cn.reactiveElementPolyfillSupport,ks=(n,e)=>n,$l={toAttribute(n,e){switch(e){case Boolean:n=n?Lm: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}},Ed=(n,e)=>!Rm(n,e),wd={attribute:!0,type:String,converter:$l,reflect:!1,useDefault:!1,hasChanged:Ed};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),cn.litPropertyMetadata??(cn.litPropertyMetadata=new WeakMap);let Nr=class 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=wd){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&Sm(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){const{get:r,set:s}=Im(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:r,set(o){const a=r==null?void 0:r.call(this);s==null||s.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??wd}static _$Ei(){if(this.hasOwnProperty(ks("elementProperties")))return;const e=Fm(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ks("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ks("properties"))){const t=this.properties,i=[...Pm(t),...Mm(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(_d(r))}else e!==void 0&&t.push(_d(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 Tm(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)}_$ET(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:$l).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,t){var s,o;const i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const a=i.getPropertyOptions(r),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)==null?void 0:s.fromAttribute)!==void 0?a.converter:$l;this._$Em=r;const c=l.fromAttribute(t,a.type);this[r]=c??((o=this._$Ej)==null?void 0:o.get(r))??c,this._$Em=null}}requestUpdate(e,t,i,r=!1,s){var o;if(e!==void 0){const a=this.constructor;if(r===!1&&(s=this[e]),i??(i=a.getPropertyOptions(e)),!((i.hasChanged??Ed)(s,t)||i.useDefault&&i.reflect&&s===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(a._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:r,wrapped:s},o){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),r===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){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){const{wrapped:a}=o,l=this[s];a!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,o,l)}}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._$EM()}catch(r){throw e=!1,this._$EM(),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)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Nr.elementStyles=[],Nr.shadowRootOptions={mode:"open"},Nr[ks("elementProperties")]=new Map,Nr[ks("finalized")]=new Map,Jl==null||Jl({ReactiveElement:Nr}),(cn.reactiveElementVersions??(cn.reactiveElementVersions=[])).push("2.1.2");/**
10
- * @license
11
- * Copyright 2017 Google LLC
12
- * SPDX-License-Identifier: BSD-3-Clause
13
- */const Ds=globalThis,vd=n=>n,Jo=Ds.trustedTypes,Cd=Jo?Jo.createPolicy("lit-html",{createHTML:n=>n}):void 0,bd="$lit$",hn=`lit$${Math.random().toFixed(9).slice(2)}$`,Td="?"+hn,km=`<${Td}>`,Xn=document,Os=()=>Xn.createComment(""),Gs=n=>n===null||typeof n!="object"&&typeof n!="function",ec=Array.isArray,Dm=n=>ec(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",tc=`[
14
- \f\r]`,Bs=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Rd=/-->/g,Sd=/>/g,Yn=RegExp(`>|${tc}(?:([^\\s"'>=/]+)(${tc}*=${tc}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Id=/'/g,Pd=/"/g,Md=/^(?:script|style|textarea|title)$/i,Om=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),Bt=Om(1),zr=Symbol.for("lit-noChange"),lt=Symbol.for("lit-nothing"),Fd=new WeakMap,Kn=Xn.createTreeWalker(Xn,129);function Ld(n,e){if(!ec(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Cd!==void 0?Cd.createHTML(e):e}const Gm=(n,e)=>{const t=n.length-1,i=[];let r,s=e===2?"<svg>":e===3?"<math>":"",o=Bs;for(let a=0;a<t;a++){const l=n[a];let c,h,u=-1,d=0;for(;d<l.length&&(o.lastIndex=d,h=o.exec(l),h!==null);)d=o.lastIndex,o===Bs?h[1]==="!--"?o=Rd:h[1]!==void 0?o=Sd:h[2]!==void 0?(Md.test(h[2])&&(r=RegExp("</"+h[2],"g")),o=Yn):h[3]!==void 0&&(o=Yn):o===Yn?h[0]===">"?(o=r??Bs,u=-1):h[1]===void 0?u=-2:(u=o.lastIndex-h[2].length,c=h[1],o=h[3]===void 0?Yn:h[3]==='"'?Pd:Id):o===Pd||o===Id?o=Yn:o===Rd||o===Sd?o=Bs:(o=Yn,r=void 0);const g=o===Yn&&n[a+1].startsWith("/>")?" ":"";s+=o===Bs?l+km:u>=0?(i.push(c),l.slice(0,u)+bd+l.slice(u)+hn+g):l+hn+(u===-2?a:g)}return[Ld(n,s+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class Ns{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]=Gm(e,t);if(this.el=Ns.createElement(c,i),Kn.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(r=Kn.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const u of r.getAttributeNames())if(u.endsWith(bd)){const d=h[o++],g=r.getAttribute(u).split(hn),f=/([.?@])?(.*)/.exec(d);l.push({type:1,index:s,name:f[2],strings:g,ctor:f[1]==="."?Nm:f[1]==="?"?zm:f[1]==="@"?jm:$o}),r.removeAttribute(u)}else u.startsWith(hn)&&(l.push({type:6,index:s}),r.removeAttribute(u));if(Md.test(r.tagName)){const u=r.textContent.split(hn),d=u.length-1;if(d>0){r.textContent=Jo?Jo.emptyScript:"";for(let g=0;g<d;g++)r.append(u[g],Os()),Kn.nextNode(),l.push({type:2,index:++s});r.append(u[d],Os())}}}else if(r.nodeType===8)if(r.data===Td)l.push({type:2,index:s});else{let u=-1;for(;(u=r.data.indexOf(hn,u+1))!==-1;)l.push({type:7,index:s}),u+=hn.length-1}s++}}static createElement(e,t){const i=Xn.createElement("template");return i.innerHTML=e,i}}function jr(n,e,t=n,i){var o,a;if(e===zr)return e;let r=i!==void 0?(o=t._$Co)==null?void 0:o[i]:t._$Cl;const s=Gs(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==s&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=r:t._$Cl=r),r!==void 0&&(e=jr(n,r._$AS(n,e.values),r,i)),e}let Bm=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,r=((e==null?void 0:e.creationScope)??Xn).importNode(t,!0);Kn.currentNode=r;let s=Kn.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new zs(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new Um(s,this,e)),this._$AV.push(c),l=i[++a]}o!==(l==null?void 0:l.index)&&(s=Kn.nextNode(),o++)}return Kn.currentNode=Xn,r}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}};class zs{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=lt,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=jr(this,e,t),Gs(e)?e===lt||e==null||e===""?(this._$AH!==lt&&this._$AR(),this._$AH=lt):e!==this._$AH&&e!==zr&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Dm(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==lt&&Gs(this._$AH)?this._$AA.nextSibling.data=e:this.T(Xn.createTextNode(e)),this._$AH=e}$(e){var s;const{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Ns.createElement(Ld(i.h,i.h[0]),this.options)),i);if(((s=this._$AH)==null?void 0:s._$AD)===r)this._$AH.p(t);else{const o=new Bm(r,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Fd.get(e.strings);return t===void 0&&Fd.set(e.strings,t=new Ns(e)),t}k(e){ec(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,r=0;for(const s of e)r===t.length?t.push(i=new zs(this.O(Os()),this.O(Os()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const r=vd(e).nextSibling;vd(e).remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class $o{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=lt,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=lt}_$AI(e,t=this,i,r){const s=this.strings;let o=!1;if(s===void 0)e=jr(this,e,t,0),o=!Gs(e)||e!==this._$AH&&e!==zr,o&&(this._$AH=e);else{const a=e;let l,c;for(e=s[0],l=0;l<s.length-1;l++)c=jr(this,a[i+l],t,l),c===zr&&(c=this._$AH[l]),o||(o=!Gs(c)||c!==this._$AH[l]),c===lt?e=lt:e!==lt&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}o&&!r&&this.j(e)}j(e){e===lt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Nm extends $o{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===lt?void 0:e}}class zm extends $o{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==lt)}}class jm extends $o{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=jr(this,e,t,0)??lt)===zr)return;const i=this._$AH,r=e===lt&&i!==lt||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==lt&&(i===lt||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class Um{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){jr(this,e)}}const ic=Ds.litHtmlPolyfillSupport;ic==null||ic(Ns,zs),(Ds.litHtmlVersions??(Ds.litHtmlVersions=[])).push("3.3.2");const Vm=(n,e,t)=>{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 zs(e.insertBefore(Os(),s),s,void 0,t??{})}return r._$AI(n),r};/**
16
- * @license
17
- * Copyright 2017 Google LLC
18
- * SPDX-License-Identifier: BSD-3-Clause
19
- */const Zn=globalThis;class Ur extends Nr{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=Vm(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 zr}}Ur._$litElement$=!0,Ur.finalized=!0,(im=Zn.litElementHydrateSupport)==null||im.call(Zn,{LitElement:Ur});const nc=Zn.litElementPolyfillSupport;nc==null||nc({LitElement:Ur}),(Zn.litElementVersions??(Zn.litElementVersions=[])).push("4.2.2");const Wm=':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}',Hm=".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}",pt={ADD:"add",REMOVE:"remove"},Vr={PROPERTYCHANGE:"propertychange"},K={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class js{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Xm(n,e,t){let i,r;t=t||wi;let s=0,o=n.length,a=!1;for(;s<o;)i=s+(o-s>>1),r=+t(n[i],e),r<0?s=i+1:(o=i,a=!r);return a?s:~s}function wi(n,e){return n>e?1:n<e?-1:0}function Ym(n,e){return n<e?1:n>e?-1:0}function ea(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;r<i;++r){const s=n[r];if(s===e)return r;if(s<e)return t(e,n[r-1],s)>0?r-1:r}return i-1}if(t>0){for(let r=1;r<i;++r)if(n[r]<e)return r-1;return i-1}if(t<0){for(let r=1;r<i;++r)if(n[r]<=e)return r;return i-1}for(let r=1;r<i;++r){if(n[r]==e)return r;if(n[r]<e)return n[r-1]-e<e-n[r]?r-1:r}return i-1}function Km(n,e,t){for(;e<t;){const i=n[e];n[e]=n[t],n[t]=i,++e,--t}}function vi(n,e){const t=Array.isArray(e)?e:[e],i=t.length;for(let r=0;r<i;r++)n[n.length]=t[r]}function Bi(n,e){const t=n.length;if(t!==e.length)return!1;for(let i=0;i<t;i++)if(n[i]!==e[i])return!1;return!0}function Zm(n,e,t){const i=e||wi;return n.every(function(r,s){if(s===0)return!0;const o=i(n[s-1],r);return!(o>0||o===0)})}function Wr(){return!0}function Hr(){return!1}function Us(){}function kd(n){let e,t,i;return function(){const r=Array.prototype.slice.call(arguments);return(!t||this!==i||!Bi(r,t))&&(i=this,t=r,e=n.apply(this,arguments)),e}}function qn(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 Vs(n){for(const e in n)delete n[e]}function un(n){let e;for(e in n)return!1;return!e}class Nt{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class Ws extends js{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 Nt(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;c<h;++c)if("handleEvent"in r[c]?l=r[c].handleEvent(s):l=r[c].call(this,s),l===!1||s.propagationStopped){l=!1;break}if(--o[i]===0){let c=a[i];for(delete a[i];c--;)this.removeEventListener(i,Us);delete o[i]}return l}disposeInternal(){this.listeners_&&Vs(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!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]=Us,++this.pendingRemovals_[e]):(i.splice(r,1),i.length===0&&delete this.listeners_[e]))}}function ce(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 ta(n,e,t,i){return ce(n,e,t,i,!0)}function Re(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),Vs(n))}class Hs extends Ws{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(K.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){const i=e.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ce(this,e[s],t);return r}return ce(this,e,t)}onceInternal(e,t){let i;if(Array.isArray(e)){const r=e.length;i=new Array(r);for(let s=0;s<r;++s)i[s]=ta(this,e[s],t)}else i=ta(this,e,t);return t.ol_key=i,i}unInternal(e,t){const i=t.ol_key;if(i)qm(i);else if(Array.isArray(e))for(let r=0,s=e.length;r<s;++r)this.removeEventListener(e[r],t);else this.removeEventListener(e,t)}}Hs.prototype.on,Hs.prototype.once,Hs.prototype.un;function qm(n){if(Array.isArray(n))for(let e=0,t=n.length;e<t;++e)Re(n[e]);else Re(n)}function Q(){throw new Error("Unimplemented abstract method.")}let Qm=0;function Y(n){return n.ol_uid||(n.ol_uid=String(++Qm))}class Dd extends Nt{constructor(e,t,i){super(e),this.key=t,this.oldValue=i}}class Ci extends Hs{constructor(e){super(),this.on,this.once,this.un,Y(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,t){let i;i=`change:${e}`,this.hasListener(i)&&this.dispatchEvent(new Dd(i,e,t)),i=Vr.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new Dd(i,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,i){const r=this.values_||(this.values_={});if(i)r[e]=t;else{const s=r[e];r[e]=t,s!==t&&this.notify(e,s)}}setProperties(e,t){for(const i in e)this.set(i,e[i],t)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){const i=this.values_[e];delete this.values_[e],un(this.values_)&&(this.values_=null),t||this.notify(e,i)}}}const Od={LENGTH:"length"};class ia extends Nt{constructor(e,t,i){super(e),this.element=t,this.index=i}}class Rt extends Ci{constructor(e,t){if(super(),this.on,this.once,this.un,t=t||{},this.unique_=!!t.unique,this.array_=e??[],this.unique_)for(let i=1,r=this.array_.length;i<r;++i)this.assertUnique_(this.array_[i],i);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,i=e.length;t<i;++t)this.push(e[t]);return this}forEach(e){const t=this.array_;for(let i=0,r=t.length;i<r;++i)e(t[i],i,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(Od.LENGTH)}insertAt(e,t){if(e<0||e>this.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 ia(pt.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(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<r;++i)if(t[i]===e)return this.removeAt(i)}removeAt(e){if(e<0||e>=this.getLength())return;const t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new ia(pt.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 ia(pt.REMOVE,r,e)),this.dispatchEvent(new ia(pt.ADD,t,e))}updateLength_(){this.set(Od.LENGTH,this.array_.length)}assertUnique_(e,t){const i=this.array_;for(let r=0,s=i.length;r<s;++r)if(i[r]===e&&r!==t)throw new Error("Duplicate item added to a unique collection")}}class Xr extends Nt{constructor(e,t,i){super(e),this.map=t,this.frameState=i!==void 0?i:null}}class Ni extends Xr{constructor(e,t,i,r,s,o){super(e,t,s),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=r!==void 0?r:!1,this.activePointers=o}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const he={SINGLECLICK:"singleclick",CLICK:K.CLICK,DBLCLICK:K.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Qn=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";Qn.includes("safari")&&!Qn.includes("chrom")&&(Qn.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Qn));const Jm=Qn.includes("webkit")&&!Qn.includes("edge"),Gd=Qn.includes("macintosh"),$m=typeof devicePixelRatio<"u"?devicePixelRatio:1,ut=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Bd=typeof Image<"u"&&Image.prototype.decode,ey=typeof createImageBitmap=="function",Nd=(function(){let n=!1;try{const e=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return n})(),rc={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class ty extends Ws{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=ce(i,rc.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=ce(i,rc.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(K.TOUCHMOVE,this.boundHandleTouchMove_,Nd?{passive:!1}:!1)}emulateClick_(e){let t=new Ni(he.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new Ni(he.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new Ni(he.SINGLECLICK,this.map_,e);this.dispatchEvent(i)},250)}updateActivePointers_(e){const t=e,i=t.pointerId;if(t.type==he.POINTERUP||t.type==he.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==he.POINTERDOWN||t.type==he.POINTERMOVE)&&(this.trackedTouches_[i]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const t=new Ni(he.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(Re),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 Ni(he.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(ce(i,he.POINTERMOVE,this.handlePointerMove_,this),ce(i,he.POINTERUP,this.handlePointerUp_,this),ce(this.element_,he.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(ce(this.element_.getRootNode(),he.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const t=new Ni(he.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 Ni(he.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_&&(Re(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(K.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Re(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Re),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const dn={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 ye(n,e){if(!n)throw new Error(e)}const na=1/0;class iy{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Vs(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){ye(!(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!=na?(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<r>>1;){const l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),h=c<r&&i[c]<i[l]?c:l;t[e]=t[h],i[e]=i[h],e=h}t[e]=s,i[e]=o,this.siftDown_(a,e)}siftDown_(e,t){const i=this.elements_,r=this.priorities_,s=i[t],o=r[t];for(;t>e;){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;a<s;++a)o=t[a],l=e(o),l==na?delete this.queuedElements_[this.keyFunction_(o)]:(i[r]=l,t[r++]=o);t.length=r,i.length=r,this.heapify_()}}class zd extends iy{constructor(e,t){super(i=>e.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(K.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(K.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_<e&&i<t&&this.getCount()>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 ny(n,e,t,i,r){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return na;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 De={ANIMATING:0,INTERACTING:1},ai={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Pe(n,e,t){return Math.min(Math.max(n,e),t)}function ry(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 zi(n,e,t,i)}function zi(n,e,t,i){const r=t-n,s=i-e;return r*r+s*s}function sy(n){const e=n.length;for(let i=0;i<e;i++){let r=i,s=Math.abs(n[i][i]);for(let a=i+1;a<e;a++){const l=Math.abs(n[a][i]);l>s&&(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<e;a++){const l=-n[a][i]/n[i][i];for(let c=i;c<e+1;c++)i==c?n[a][c]=0:n[a][c]+=l*n[i][c]}}const t=new Array(e);for(let i=e-1;i>=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 jd(n){return n*180/Math.PI}function fn(n){return n*Math.PI/180}function gn(n,e){const t=n%e;return t*e<0?t+e:t}function zt(n,e,t){return n+t*(e-n)}function Xs(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function ra(n,e){return Math.floor(Xs(n,e))}function pn(n,e){return Math.ceil(Xs(n,e))}function sc(n,e,t){if(n>=e&&n<t)return n;const i=t-e;return((n-e)%i+i)%i+e}function Ud(n,e,t){return(function(i,r,s,o,a){if(!i)return;if(!r&&!e)return i;const l=e?0:s[0]*r,c=e?0:s[1]*r,h=a?a[0]:0,u=a?a[1]:0;let d=n[0]+l/2+h,g=n[2]-l/2+h,f=n[1]+c/2+u,p=n[3]-c/2+u;d>g&&(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 oy(n){return n}const ct={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function mt(n){const e=jt();for(let t=0,i=n.length;t<i;++t)Ks(e,n[t]);return e}function ay(n,e,t){const i=Math.min.apply(null,n),r=Math.min.apply(null,e),s=Math.max.apply(null,n),o=Math.max.apply(null,e);return bi(i,r,s,o,t)}function ji(n,e,t){return t?(t[0]=n[0]-e,t[1]=n[1]-e,t[2]=n[2]+e,t[3]=n[3]+e,t):[n[0]-e,n[1]-e,n[2]+e,n[3]+e]}function Vd(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n.slice()}function Jn(n,e,t){let i,r;return e<n[0]?i=n[0]-e:n[2]<e?i=e-n[2]:i=0,t<n[1]?r=n[1]-t:n[3]<t?r=t-n[3]:r=0,i*i+r*r}function $n(n,e){return oc(n,e[0],e[1])}function Ui(n,e){return n[0]<=e[0]&&e[2]<=n[2]&&n[1]<=e[1]&&e[3]<=n[3]}function oc(n,e,t){return n[0]<=e&&e<=n[2]&&n[1]<=t&&t<=n[3]}function ac(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=e[0],a=e[1];let l=ct.UNKNOWN;return o<t?l=l|ct.LEFT:o>r&&(l=l|ct.RIGHT),a<i?l=l|ct.BELOW:a>s&&(l=l|ct.ABOVE),l===ct.UNKNOWN&&(l=ct.INTERSECTING),l}function jt(){return[1/0,1/0,-1/0,-1/0]}function bi(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 Yr(n){return bi(1/0,1/0,-1/0,-1/0,n)}function Ys(n,e){const t=n[0],i=n[1];return bi(t,i,t,i,e)}function lc(n,e,t,i,r){const s=Yr(r);return Wd(s,n,e,t,i)}function Vi(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function cc(n,e){return e[0]<n[0]&&(n[0]=e[0]),e[2]>n[2]&&(n[2]=e[2]),e[1]<n[1]&&(n[1]=e[1]),e[3]>n[3]&&(n[3]=e[3]),n}function Ks(n,e){e[0]<n[0]&&(n[0]=e[0]),e[0]>n[2]&&(n[2]=e[0]),e[1]<n[1]&&(n[1]=e[1]),e[1]>n[3]&&(n[3]=e[1])}function Wd(n,e,t,i,r){for(;t<i;t+=r)ly(n,e[t],e[t+1]);return n}function ly(n,e,t){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}function hc(n,e){let t;return t=e(sa(n)),t||(t=e(oa(n)),t)||(t=e(la(n)),t)||(t=e(li(n)),t)?t:!1}function Zs(n){let e=0;return er(n)||(e=ne(n)*Oe(n)),e}function sa(n){return[n[0],n[1]]}function oa(n){return[n[2],n[1]]}function Ut(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function cy(n,e){let t;if(e==="bottom-left")t=sa(n);else if(e==="bottom-right")t=oa(n);else if(e==="top-left")t=li(n);else if(e==="top-right")t=la(n);else throw new Error("Invalid corner");return t}function aa(n,e,t,i,r){const[s,o,a,l,c,h,u,d]=Hd(n,e,t,i);return bi(Math.min(s,a,c,u),Math.min(o,l,h,d),Math.max(s,a,c,u),Math.max(o,l,h,d),r)}function Hd(n,e,t,i){const r=e*i[0]/2,s=e*i[1]/2,o=Math.cos(t),a=Math.sin(t),l=r*o,c=r*a,h=s*o,u=s*a,d=n[0],g=n[1];return[d-l+u,g-c-h,d-l-u,g-c+h,d+l-u,g+c+h,d+l+u,g+c-h,d-l+u,g-c-h]}function Oe(n){return n[3]-n[1]}function xt(n,e,t){const i=t||jt();return ze(n,e)?(n[0]>e[0]?i[0]=n[0]:i[0]=e[0],n[1]>e[1]?i[1]=n[1]:i[1]=e[1],n[2]<e[2]?i[2]=n[2]:i[2]=e[2],n[3]<e[3]?i[3]=n[3]:i[3]=e[3]):Yr(i),i}function li(n){return[n[0],n[3]]}function la(n){return[n[2],n[3]]}function ne(n){return n[2]-n[0]}function ze(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function er(n){return n[2]<n[0]||n[3]<n[1]}function hy(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n}function uy(n,e,t){let i=!1;const r=ac(n,e),s=ac(n,t);if(r===ct.INTERSECTING||s===ct.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],c=n[3],h=e[0],u=e[1],d=t[0],g=t[1],f=(g-u)/(d-h);let p,A;s&ct.ABOVE&&!(r&ct.ABOVE)&&(p=d-(g-c)/f,i=p>=o&&p<=l),!i&&s&ct.RIGHT&&!(r&ct.RIGHT)&&(A=g-(d-l)*f,i=A>=a&&A<=c),!i&&s&ct.BELOW&&!(r&ct.BELOW)&&(p=d-(g-a)/f,i=p>=o&&p<=l),!i&&s&ct.LEFT&&!(r&ct.LEFT)&&(A=g-(d-o)*f,i=A>=a&&A<=c)}return i}function Xd(n,e,t,i){if(er(n))return Yr(t);let r=[];if(i>1){const a=n[2]-n[0],l=n[3]-n[1];for(let c=0;c<i;++c)r.push(n[0]+a*c/i,n[1],n[2],n[1]+l*c/i,n[2]-a*c/i,n[3],n[0],n[3]-l*c/i)}else 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<l;a+=2)s.push(r[a]),o.push(r[a+1]);return ay(s,o,t)}function Yd(n,e){const t=e.getExtent(),i=Ut(n);if(e.canWrapX()&&(i[0]<t[0]||i[0]>=t[2])){const r=ne(t),o=Math.floor((i[0]-t[0])/r)*r;n[0]-=o,n[2]-=o}return n}function uc(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]]];Yd(n,e);const r=ne(i);if(ne(n)>r&&!t)return[[i[0],n[1],i[2],n[3]]];if(n[0]<i[0])return[[n[0]+r,n[1],i[2],n[3]],[i[0],n[1],n[2],n[3]]];if(n[2]>i[2])return[[n[0],n[1],i[2],n[3]],[i[0],n[1],n[2]-r,n[3]]]}return[n]}function dy(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function dc(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 Et(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 fc(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 fy(n,e){return n[0]*=e,n[1]*=e,n}function Kr(n,e){const t=n[0]-e[0],i=n[1]-e[1];return t*t+i*i}function tr(n,e){return Math.sqrt(Kr(n,e))}function gy(n,e){return Kr(n,dc(n,e))}function gc(n,e){if(e.canWrapX()){const t=ne(e.getExtent()),i=py(n,e,t);i&&(n[0]-=i*t)}return n}function py(n,e,t){const i=e.getExtent();let r=0;return e.canWrapX()&&(n[0]<i[0]||n[0]>i[2])&&(t=t||ne(i),r=Math.floor((n[0]-i[0])/t)),r}function Kd(n){return Math.pow(n,3)}function Zr(n){return 1-Kd(1-n)}function Ay(n){return 3*n*n-2*n*n*n}function my(n){return n}const yy=63710088e-1;function Zd(n,e,t){t=t||yy;const i=fn(n[1]),r=fn(e[1]),s=(r-i)/2,o=fn(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 qd(...n){console.warn(...n)}const An={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class ca{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_||An[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 qs=6378137,qr=Math.PI*qs,_y=[-qr,-qr,qr,qr],xy=[-180,-85,180,85],ha=qs*Math.log(Math.tan(Math.PI/2));class Qr extends ca{constructor(e){super({code:e,units:"m",extent:_y,global:!0,worldExtent:xy,getPointResolution:function(t,i){return t/Math.cosh(i[1]/qs)}})}}const Qd=[new Qr("EPSG:3857"),new Qr("EPSG:102100"),new Qr("EPSG:102113"),new Qr("EPSG:900913"),new Qr("http://www.opengis.net/def/crs/EPSG/0/3857"),new Qr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ey(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;s<r;s+=i){e[s]=qr*n[s]/180;let o=qs*Math.log(Math.tan(Math.PI*(+n[s+1]+90)/360));o>ha?o=ha:o<-ha&&(o=-ha),e[s+1]=o}return e}function wy(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;s<r;s+=i)e[s]=180*n[s]/qr,e[s+1]=360*Math.atan(Math.exp(n[s+1]/qs))/Math.PI-90;return e}const vy=6378137,Jd=[-180,-90,180,90],Cy=Math.PI*vy/180;class ir extends ca{constructor(e,t){super({code:e,units:"degrees",extent:Jd,axisOrientation:t,global:!0,metersPerUnit:Cy,worldExtent:Jd})}}const $d=[new ir("CRS:84"),new ir("EPSG:4326","neu"),new ir("urn:ogc:def:crs:OGC:1.3:CRS84"),new ir("urn:ogc:def:crs:OGC:2:84"),new ir("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new ir("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ir("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let pc={};function by(n){return pc[n]||pc[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Ty(n,e){pc[n]=e}let Jr={};function Qs(n,e,t){const i=n.getCode(),r=e.getCode();i in Jr||(Jr[i]={}),Jr[i][r]=t}function Ac(n,e){return n in Jr&&e in Jr[n]?Jr[n][e]:null}const ua=.9996,Qt=.00669438,da=Qt*Qt,fa=da*Qt,nr=Qt/(1-Qt),ef=Math.sqrt(1-Qt),$r=(1-ef)/(1+ef),tf=$r*$r,mc=tf*$r,yc=mc*$r,nf=yc*$r,rf=1-Qt/4-3*da/64-5*fa/256,Ry=3*Qt/8+3*da/32+45*fa/1024,Sy=15*da/256+45*fa/1024,Iy=35*fa/3072,Py=3/2*$r-27/32*mc+269/512*nf,My=21/16*tf-55/32*yc,Fy=151/96*mc-417/128*nf,Ly=1097/512*yc,ga=6378137;function ky(n,e,t){const i=n-5e5,o=(t.north?e:e-1e7)/ua/(ga*rf),a=o+Py*Math.sin(2*o)+My*Math.sin(4*o)+Fy*Math.sin(6*o)+Ly*Math.sin(8*o),l=Math.sin(a),c=l*l,h=Math.cos(a),u=l/h,d=u*u,g=d*d,f=1-Qt*c,p=Math.sqrt(1-Qt*c),A=ga/p,m=(1-Qt)/f,y=nr*h**2,E=y*y,x=i/(A*ua),_=x*x,w=_*x,v=w*x,C=v*x,b=C*x,T=a-u/m*(_/2-v/24*(5+3*d+10*y-4*E-9*nr))+b/720*(61+90*d+298*y+45*g-252*nr-3*E);let I=(x-w/6*(1+2*d+y)+C/120*(5-2*y+28*d-3*E+8*nr+24*g))/h;return I=sc(I+fn(af(t.number)),-Math.PI,Math.PI),[jd(I),jd(T)]}const sf=-80,of=84,Dy=-180,Oy=180;function Gy(n,e,t){n=sc(n,Dy,Oy),e<sf?e=sf:e>of&&(e=of);const i=fn(e),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,c=fn(n),h=af(t.number),u=fn(h),d=ga/Math.sqrt(1-Qt*r**2),g=nr*s**2,f=s*sc(c-u,-Math.PI,Math.PI),p=f*f,A=p*f,m=A*f,y=m*f,E=y*f,x=ga*(rf*i-Ry*Math.sin(2*i)+Sy*Math.sin(4*i)-Iy*Math.sin(6*i)),_=ua*d*(f+A/6*(1-a+g)+y/120*(5-18*a+l+72*g-58*nr))+5e5;let w=ua*(x+d*o*(p/2+m/24*(5-a+9*g+4*g**2)+E/720*(61-58*a+l+600*g-330*nr)));return t.north||(w+=1e7),[_,w]}function af(n){return(n-1)*6-180+3}const By=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function lf(n){let e=0;for(const r of By){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 cf(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<o;a+=s){const l=t[a],c=t[a+1],h=n(l,c,e);i[a]=h[0],i[a+1]=h[1]}return i}}function Ny(n){return lf(n)?new ca({code:n,units:"m"}):null}function zy(n){const e=lf(n.getCode());return e?{forward:cf(Gy,e),inverse:cf(ky,e)}:null}const jy=[zy],Uy=[Ny];let _c=!0;function hf(n){_c=!1}function xc(n,e){if(e!==void 0){for(let t=0,i=n.length;t<i;++t)e[t]=n[t];e=e}else e=n.slice();return e}function Ec(n){Ty(n.getCode(),n),Qs(n,n,xc)}function Vy(n){n.forEach(Ec)}function _e(n){if(typeof n!="string")return n;const e=by(n);if(e)return e;for(const t of Uy){const i=t(n);if(i)return i}return null}function wc(n,e,t,i){n=_e(n);let r;const s=n.getPointResolutionFunc();if(s){if(r=s(e,t),i&&i!==n.getUnits()){const o=n.getMetersPerUnit();o&&(r=r*o/An[i])}}else{const o=n.getUnits();if(o=="degrees"&&!i||i=="degrees")r=e;else{const a=eo(n,_e("EPSG:4326"));if(!a&&o!=="degrees")r=e*n.getMetersPerUnit();else{let c=[t[0]-e/2,t[1],t[0]+e/2,t[1],t[0],t[1]-e/2,t[0],t[1]+e/2];c=a(c,c,2);const h=Zd(c.slice(0,2),c.slice(2,4)),u=Zd(c.slice(4,6),c.slice(6,8));r=(h+u)/2}const l=i?An[i]:n.getMetersPerUnit();l!==void 0&&(r/=l)}}return r}function uf(n){Vy(n),n.forEach(function(e){n.forEach(function(t){e!==t&&Qs(e,t,xc)})})}function Wy(n,e,t,i){n.forEach(function(r){e.forEach(function(s){Qs(r,s,t),Qs(s,r,i)})})}function vc(n,e){return n?typeof n=="string"?_e(n):n:_e(e)}function Hy(n){return(function(e,t,i,r){const s=e.length;i=i!==void 0?i:2,r=r??i,t=t!==void 0?t:new Array(s);for(let o=0;o<s;o+=r){const a=n(e.slice(o,o+i)),l=a.length;for(let c=0,h=r;c<h;++c)t[o+c]=c>=l?e[o+c]:a[c]}return t})}function Js(n,e){return hf(),pa(n,"EPSG:4326",e!==void 0?e:"EPSG:3857")}function $s(n,e){const t=pa(n,"EPSG:3857","EPSG:4326"),i=t[0];return(i<-180||i>180)&&(t[0]=gn(i+180,360)-180),t}function tt(n,e){if(n===e)return!0;const t=n.getUnits()===e.getUnits();return(n.getCode()===e.getCode()||eo(n,e)===xc)&&t}function eo(n,e){const t=n.getCode(),i=e.getCode();let r=Ac(t,i);if(r)return r;let s=null,o=null;for(const l of jy)s||(s=l(n)),o||(o=l(e));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=Cc(s.inverse,o.forward);else{const l=Ac(t,a);l&&(r=Cc(l,o.forward))}else{const l=Ac(a,i);l&&(r=Cc(s.inverse,l))}return r&&(Ec(n),Ec(e),Qs(n,e,r)),r}function Cc(n,e){return function(t,i,r,s){return i=n(t,i,r,s),e(i,i,r,s)}}function rr(n,e){const t=_e(n),i=_e(e);return eo(t,i)}function pa(n,e,t){const i=rr(e,t);if(!i){const r=_e(e).getCode(),s=_e(t).getCode();throw new Error(`No transform available between ${r} and ${s}`)}return i(n,void 0,n.length)}function Aa(n,e,t,i){const r=rr(e,t);return Xd(n,r,void 0,i)}let Xy=null;function Yy(){return Xy}function sr(n,e){return n}function je(n,e){return _c&&!Et(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(_c=!1,qd("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function ma(n,e){return n}function ci(n,e){return n}function Ky(){uf(Qd),uf($d),Wy($d,Qd,Ey,wy)}Ky();const df=new Array(6);function St(){return[1,0,0,1,0,0]}function ff(n){return Tc(n,1,0,0,1,0,0)}function bc(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 Zy(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 $e(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 Rc(n,e,t){return bc(n,Tc(df,e,0,0,t,0,0))}function qy(n,e,t){return bc(n,Tc(df,1,0,0,1,e,t))}function Ti(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 gf(n,e){const t=Qy(e);ye(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 Qy(n){return n[0]*n[3]-n[1]*n[2]}const Jy=[1e5,1e5,1e5,1e5,2,2];function $y(n){return"matrix("+n.join(", ")+")"}function Sc(n){return n.substring(7,n.length-1).split(",").map(parseFloat)}function e0(n,e){const t=Sc(n),i=Sc(e);for(let r=0;r<6;++r)if(Math.round((t[r]-i[r])*Jy[r])!==0)return!1;return!0}function mn(n,e,t,i,r,s,o){s=s||[],o=o||2;let a=0;for(let l=e;l<t;l+=i){const c=n[l],h=n[l+1];s[a++]=r[0]*c+r[2]*h+r[4],s[a++]=r[1]*c+r[3]*h+r[5];for(let u=2;u<o;u++)s[a++]=n[l+u]}return s&&s.length!=a&&(s.length=a),s}function Ic(n,e,t,i,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),c=s[0],h=s[1];let u=0;for(let d=e;d<t;d+=i){const g=n[d]-c,f=n[d+1]-h;o[u++]=c+g*a-f*l,o[u++]=h+g*l+f*a;for(let p=d+2;p<d+i;++p)o[u++]=n[p]}return o&&o.length!=u&&(o.length=u),o}function t0(n,e,t,i,r,s,o,a){a=a||[];const l=o[0],c=o[1];let h=0;for(let u=e;u<t;u+=i){const d=n[u]-l,g=n[u+1]-c;a[h++]=l+r*d,a[h++]=c+s*g;for(let f=u+2;f<u+i;++f)a[h++]=n[f]}return a&&a.length!=h&&(a.length=h),a}function i0(n,e,t,i,r,s,o){o=o||[];let a=0;for(let l=e;l<t;l+=i){o[a++]=n[l]+r,o[a++]=n[l+1]+s;for(let c=l+2;c<l+i;++c)o[a++]=n[c]}return o&&o.length!=a&&(o.length=a),o}const pf=St(),n0=[NaN,NaN];class Af extends Ci{constructor(){super(),this.extent_=jt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=kd((e,t,i)=>{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,n0,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]))&&Yr(t),this.extentRevision_=this.getRevision()}return hy(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=_e(e),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),c=i.getWorldExtent(),h=Oe(c)/Oe(l);Ti(pf,c[0],c[3],h,-h,0,0,0);const u=mn(s,0,s.length,a,pf,o),d=rr(i,t);return d?d(u,u,a):u}:rr(i,t);return this.applyTransform(r),this}}class yn extends Af{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return lc(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().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=ya(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){Q()}setLayout(e,t,i){let r;if(e)r=ya(e);else{for(let s=0;s<i;++s){if(t.length===0){this.layout="XY",this.stride=2;return}t=t[0]}r=t.length,e=or(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();Ic(i,0,i.length,r,e,t,i),this.changed()}}scale(e,t,i){t===void 0&&(t=e),i||(i=Ut(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();t0(r,0,r.length,s,e,t,i,r),this.changed()}}translate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();i0(i,0,i.length,r,e,t,i),this.changed()}}}function or(n){let e;return n==2?e="XY":n==3?e="XYZ":n==4&&(e="XYZM"),e}function ya(n){let e;return n=="XY"?e=2:n=="XYZ"||n=="XYM"?e=3:n=="XYZM"&&(e=4),e}function r0(n,e,t){const i=n.getFlatCoordinates();if(!i)return null;const r=n.getStride();return mn(i,0,i.length,r,e,t)}function mf(n,e,t,i){let r=0;const s=n[t-i],o=n[t-i+1];let a=0,l=0;for(;e<t;e+=i){const c=n[e]-s,h=n[e+1]-o;r+=l*c-a*h,a=c,l=h}return r/2}function yf(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=mf(n,e,a,i),e=a}return r}function s0(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=yf(n,e,a,i),e=a[a.length-1]}return r}function _f(n,e,t,i,r,s,o){const a=n[e],l=n[e+1],c=n[t]-a,h=n[t+1]-l;let u;if(c===0&&h===0)u=e;else{const d=((r-a)*c+(s-l)*h)/(c*c+h*h);if(d>1)u=t;else if(d>0){for(let g=0;g<i;++g)o[g]=zt(n[e+g],n[t+g],d);o.length=i;return}else u=e}for(let d=0;d<i;++d)o[d]=n[u+d];o.length=i}function Pc(n,e,t,i,r){let s=n[e],o=n[e+1];for(e+=i;e<t;e+=i){const a=n[e],l=n[e+1],c=zi(s,o,a,l);c>r&&(r=c),s=a,o=l}return r}function Mc(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=Pc(n,e,a,i,r),e=a}return r}function o0(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=Mc(n,e,a,i,r),e=a[a.length-1]}return r}function Fc(n,e,t,i,r,s,o,a,l,c,h){if(e==t)return c;let u,d;if(r===0){if(d=zi(o,a,n[e],n[e+1]),d<c){for(u=0;u<i;++u)l[u]=n[e+u];return l.length=i,d}return c}h=h||[NaN,NaN];let g=e+i;for(;g<t;)if(_f(n,g-i,g,i,o,a,h),d=zi(o,a,h[0],h[1]),d<c){for(c=d,u=0;u<i;++u)l[u]=h[u];l.length=i,g+=i}else g+=i*Math.max((Math.sqrt(d)-Math.sqrt(c))/r|0,1);if(s&&(_f(n,t-i,e,i,o,a,h),d=zi(o,a,h[0],h[1]),d<c)){for(c=d,u=0;u<i;++u)l[u]=h[u];l.length=i}return c}function Lc(n,e,t,i,r,s,o,a,l,c,h){h=h||[NaN,NaN];for(let u=0,d=t.length;u<d;++u){const g=t[u];c=Fc(n,e,g,i,r,s,o,a,l,c,h),e=g}return c}function a0(n,e,t,i,r,s,o,a,l,c,h){h=h||[NaN,NaN];for(let u=0,d=t.length;u<d;++u){const g=t[u];c=Lc(n,e,g,i,r,s,o,a,l,c,h),e=g[g.length-1]}return c}function xf(n,e,t,i){for(let r=0,s=t.length;r<s;++r)n[e++]=t[r];return e}function _a(n,e,t,i){for(let r=0,s=t.length;r<s;++r){const o=t[r];for(let a=0;a<i;++a)n[e++]=o[a]}return e}function to(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=_a(n,e,t[o],i);r[s++]=l,e=l}return r.length=s,r}function Ef(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=to(n,e,t[o],i,r[s]);l.length===0&&(l[0]=e),r[s++]=l,e=l[l.length-1]}return r.length=s,r}function _n(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=e;o<t;o+=i)r[s++]=n.slice(o,o+i);return r.length=s,r}function io(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o];r[s++]=_n(n,e,l,i,r[s]),e=l}return r.length=s,r}function kc(n,e,t,i,r){r=r!==void 0?r:[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o];r[s++]=l.length===1&&l[0]===e?[]:io(n,e,l,i,r[s]),e=l[l.length-1]}return r.length=s,r}function xa(n,e,t,i,r,s,o){const a=(t-e)/i;if(a<3){for(;e<t;e+=i)s[o++]=n[e],s[o++]=n[e+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const c=[e,t-i];let h=0;for(;c.length>0;){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;y<u;y+=i){const E=n[y],x=n[y+1],_=ry(E,x,f,p,A,m);_>g&&(h=y,g=_)}g>r&&(l[(h-e)/i]=1,d+i<h&&c.push(d,h),h+i<u&&c.push(h,u))}for(let u=0;u<a;++u)l[u]&&(s[o++]=n[e+u*i],s[o++]=n[e+u*i+1]);return o}function wf(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const h=t[l];o=xa(n,e,h,i,r,s,o),a.push(o),e=h}return o}function ar(n,e){return e*Math.round(n/e)}function l0(n,e,t,i,r,s,o){if(e==t)return o;let a=ar(n[e],r),l=ar(n[e+1],r);e+=i,s[o++]=a,s[o++]=l;let c,h;do if(c=ar(n[e],r),h=ar(n[e+1],r),e+=i,e==t)return s[o++]=c,s[o++]=h,o;while(c==a&&h==l);for(;e<t;){const u=ar(n[e],r),d=ar(n[e+1],r);if(e+=i,u==c&&d==h)continue;const g=c-a,f=h-l,p=u-a,A=d-l;if(g*A==f*p&&(g<0&&p<g||g==p||g>0&&p>g)&&(f<0&&A<f||f==A||f>0&&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 Dc(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const h=t[l];o=l0(n,e,h,i,r,s,o),a.push(o),e=h}return o}function c0(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const h=t[l],u=[];o=Dc(n,e,h,i,r,s,o,u),a.push(u),e=h[h.length-1]}return o}class no extends yn{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new no(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,i,r){return r<Jn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Pc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))}getArea(){return mf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return _n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new no(t,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_a(this.flatCoordinates,0,e,this.stride),this.changed()}}class It extends yn{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){const e=new It(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=zi(e,t,s[0],s[1]);if(o<r){const a=this.stride;for(let l=0;l<a;++l)i[l]=s[l];return i.length=a,o}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return Ys(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return oc(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=xf(this.flatCoordinates,0,e,this.stride),this.changed()}}function h0(n,e,t,i,r){return!hc(r,function(o){return!lr(n,e,t,i,o[0],o[1])})}function lr(n,e,t,i,r,s){let o=0,a=n[t-i],l=n[t-i+1];for(;e<t;e+=i){const c=n[e],h=n[e+1];l<=s?h>s&&(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 Oc(n,e,t,i,r,s){if(t.length===0||!lr(n,e,t[0],i,r,s))return!1;for(let o=1,a=t.length;o<a;++o)if(lr(n,t[o-1],t[o],i,r,s))return!1;return!0}function u0(n,e,t,i,r,s){if(t.length===0)return!1;for(let o=0,a=t.length;o<a;++o){const l=t[o];if(Oc(n,e,l,i,r,s))return!0;e=l[l.length-1]}return!1}function Gc(n,e,t,i,r,s,o){let a,l,c,h,u,d,g;const f=r[s+1],p=[];for(let y=0,E=t.length;y<E;++y){const x=t[y];for(h=n[x-i],d=n[x-i+1],a=e;a<x;a+=i)u=n[a],g=n[a+1],(f<=d&&g<=f||d<=f&&f<=g)&&(c=(f-d)/(g-d)*(u-h)+h,p.push(c)),h=u,d=g}let A=NaN,m=-1/0;for(p.sort(wi),h=p[0],a=1,l=p.length;a<l;++a){u=p[a];const y=Math.abs(u-h);y>m&&(c=(h+u)/2,Oc(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 vf(n,e,t,i,r){let s=[];for(let o=0,a=t.length;o<a;++o){const l=t[o];s=Gc(n,e,l,i,r,2*o,s),e=l[l.length-1]}return s}function Cf(n,e,t,i,r){let s;for(e+=i;e<t;e+=i)if(s=r(n.slice(e-i,e),n.slice(e,e+i)),s)return s;return!1}function Ea(n,e,t,i,r,s){return s=s??Wd(jt(),n,e,t,i),ze(r,s)?s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Cf(n,e,t,i,function(o,a){return uy(r,o,a)}):!1}function d0(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){if(Ea(n,e,t[s],i,r))return!0;e=t[s]}return!1}function bf(n,e,t,i,r){return!!(Ea(n,e,t,i,r)||lr(n,e,t,i,r[0],r[1])||lr(n,e,t,i,r[0],r[3])||lr(n,e,t,i,r[2],r[1])||lr(n,e,t,i,r[2],r[3]))}function Tf(n,e,t,i,r){if(!bf(n,e,t[0],i,r))return!1;if(t.length===1)return!0;for(let s=1,o=t.length;s<o;++s)if(h0(n,t[s-1],t[s],i,r)&&!Ea(n,t[s-1],t[s],i,r))return!1;return!0}function f0(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(Tf(n,e,a,i,r))return!0;e=a[a.length-1]}return!1}function g0(n,e,t,i){for(;e<t-i;){for(let r=0;r<i;++r){const s=n[e+r];n[e+r]=n[t-i+r],n[t-i+r]=s}e+=i,t-=i}}function Bc(n,e,t,i){let r=0,s=n[t-i],o=n[t-i+1];for(;e<t;e+=i){const a=n[e],l=n[e+1];r+=(a-s)*(l+o),s=a,o=l}return r===0?void 0:r>0}function Nc(n,e,t,i,r){r=r!==void 0?r:!1;for(let s=0,o=t.length;s<o;++s){const a=t[s],l=Bc(n,e,a,i);if(s===0){if(r&&l||!r&&!l)return!1}else if(r&&!l||!r&&l)return!1;e=a}return!0}function Rf(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(!Nc(n,e,a,i,r))return!1;a.length&&(e=a[a.length-1])}return!0}function wa(n,e,t,i,r){r=r!==void 0?r:!1;for(let s=0,o=t.length;s<o;++s){const a=t[s],l=Bc(n,e,a,i);(s===0?r&&l||!r&&!l:r&&!l||!r&&l)&&g0(n,e,a,i),e=a}return e}function zc(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s)e=wa(n,e,t[s],i,r);return e}function jc(n,e){const t=[];let i=0,r=0,s;for(let o=0,a=e.length;o<a;++o){const l=e[o],c=Bc(n,i,l,2);if(s===void 0&&(s=c),c===s)t.push(e.slice(r,o+1));else{if(t.length===0)continue;t[t.length-1].push(e[r])}r=o+1,i=l}return t}class Jt extends yn{constructor(e,t,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&i?(this.setFlatCoordinates(t,e),this.ends_=i):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?vi(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Jt(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Jn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Mc(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Lc(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return Oc(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return yf(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),wa(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,io(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=Ut(this.getExtent());this.flatInteriorPoint_=Gc(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new It(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new no(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,t=this.flatCoordinates,i=this.ends_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o],c=new no(t.slice(s,l),e);r.push(c),s=l}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Nc(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=wa(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Dc(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,i),new Jt(t,"XY",i)}getType(){return"Polygon"}intersectsExtent(e){return Tf(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=to(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Sf(n){if(er(n))throw new Error("Cannot create polygon from empty extent");const e=n[0],t=n[1],i=n[2],r=n[3],s=[e,t,e,r,i,r,i,t,e,t];return new Jt(s,"XY",[s.length])}function Uc(n,e,t,i){const r=ne(e)/t[0],s=Oe(e)/t[1];return i?Math.min(n,Math.max(r,s)):Math.min(n,Math.min(r,s))}function Vc(n,e,t){let i=Math.min(n,e);const r=50;return i*=Math.log(1+r*Math.max(0,n/e-1))/r+1,t&&(i=Math.max(i,t),i/=Math.log(1+r*Math.max(0,t/n-1))/r+1),Pe(i,t/2,e*2)}function p0(n,e,t,i){return e=e!==void 0?e:!0,(function(r,s,o,a){if(r!==void 0){const l=n[0],c=n[n.length-1],h=t?Uc(l,t,o,i):l;if(a)return e?Vc(r,h,c):Pe(r,c,h);const u=Math.min(h,r),d=Math.floor(ea(n,u,s));return n[d]>h&&d<n.length-1?n[d+1]:n[d]}})}function A0(n,e,t,i,r,s){return i=i!==void 0?i:!0,t=t!==void 0?t:0,(function(o,a,l,c){if(o!==void 0){const h=r?Uc(e,r,l,s):e;if(c)return i?Vc(o,h,t):Pe(o,t,h);const u=1e-9,d=Math.ceil(Math.log(e/h)/Math.log(n)-u),g=-a*(.5-u)+.5,f=Math.min(h,o),p=Math.floor(Math.log(e/f)/Math.log(n)+g),A=Math.max(d,p),m=e/Math.pow(n,A);return Pe(m,t,h)}})}function If(n,e,t,i,r){return t=t!==void 0?t:!0,(function(s,o,a,l){if(s!==void 0){const c=i?Uc(n,i,a,r):n;return!t||!l?Pe(s,e,c):Vc(s,c,e)}})}function Wc(n){if(n!==void 0)return 0}function Pf(n){if(n!==void 0)return n}function m0(n){const e=2*Math.PI/n;return(function(t,i){if(i)return t;if(t!==void 0)return t=Math.floor(t/e+.5)*e,t})}function y0(n){const e=fn(5);return(function(t,i){return i||t===void 0?t:Math.abs(t)<=e?0:t})}const Mf=42,Hc=256,Xc=0;class Ri extends Ci{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=vc(e.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,e.projection&&hf(),e.center&&(e.center=je(e.center,this.projection_)),e.extent&&(e.extent=ci(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){const t=Object.assign({},e);for(const a in ai)delete t[a];this.setProperties(t,!0);const i=x0(e);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=i.minZoom;const r=_0(e),s=i.constraint,o=E0(e);this.constraints_={center:r,resolution:s,rotation:o},this.setRotation(e.rotation!==void 0?e.rotation:0),this.setCenterInternal(e.center!==void 0?e.center:null),e.resolution!==void 0?this.setResolution(e.resolution):e.zoom!==void 0&&this.setZoom(e.zoom)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;const i=this.getCenterInternal();if(i){const r=e||[0,0,0,0];t=t||[0,0,0,0];const s=this.getResolution(),o=s/2*(r[3]-t[3]+t[1]-r[1]),a=s/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([i[0]+o,i[1]-a])}}getUpdatedOptions_(e){const t=this.getProperties();return t.resolution!==void 0?t.resolution=this.getResolution():t.zoom=this.getZoom(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const t=new Array(arguments.length);for(let i=0;i<t.length;++i){let r=arguments[i];r.center&&(r=Object.assign({},r),r.center=je(r.center,this.getProjection())),r.anchor&&(r=Object.assign({},r),r.anchor=je(r.anchor,this.getProjection())),t[i]=r}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,i;t>1&&typeof arguments[t-1]=="function"&&(i=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){const h=arguments[r];h.center&&this.setCenterInternal(h.center),h.zoom!==void 0?this.setZoom(h.zoom):h.resolution&&this.setResolution(h.resolution),h.rotation!==void 0&&this.setRotation(h.rotation)}if(r===t){i&&va(i,!0);return}let s=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const c=[];for(;r<t;++r){const h=arguments[r],u={start:s,complete:!1,anchor:h.anchor,duration:h.duration!==void 0?h.duration:1e3,easing:h.easing||Ay,callback:i};if(h.center&&(u.sourceCenter=o,u.targetCenter=h.center.slice(),o=u.targetCenter),h.zoom!==void 0?(u.sourceResolution=a,u.targetResolution=this.getResolutionForZoom(h.zoom),a=u.targetResolution):h.resolution&&(u.sourceResolution=a,u.targetResolution=h.resolution,a=u.targetResolution),h.rotation!==void 0){u.sourceRotation=l;const d=gn(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=l+d,l=u.targetRotation}w0(u)?u.complete=!0:s+=u.duration,c.push(u)}this.animations_.push(c),this.setHint(De.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[De.ANIMATING]>0}getInteracting(){return this.hints_[De.INTERACTING]>0}cancelAnimations(){this.setHint(De.ANIMATING,-this.hints_[De.ANIMATING]);let e;for(let t=0,i=this.animations_.length;t<i;++t){const r=this.animations_[t];if(r[0].callback&&va(r[0].callback,!1),!e)for(let s=0,o=r.length;s<o;++s){const a=r[s];if(!a.complete){e=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const e=Date.now();let t=!1;for(let i=this.animations_.length-1;i>=0;--i){const r=this.animations_[i];let s=!0;for(let o=0,a=r.length;o<a;++o){const l=r[o];if(l.complete)continue;const c=e-l.start;let h=l.duration>0?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?gn(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(De.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=r[0].callback;o&&va(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]],fc(i,e-this.getRotation()),dy(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&&sr(e,this.getProjection())}getCenterInternal(){return this.get(ai.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 ma(t,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const t=this.getCenterInternal();ye(t,"The view center is not defined");const i=this.getResolution();ye(i!==void 0,"The view resolution is not defined");const r=this.getRotation();return ye(r!==void 0,"The view rotation is not defined"),aa(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(ai.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(ci(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t=t||this.getViewportSizeMinusPadding_();const i=ne(e)/t[0],r=Oe(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(ai.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=Yc(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=ea(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(ye(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){ye(!er(e),"Cannot fit empty extent provided as `geometry`");const r=ci(e,this.getProjection());i=Sf(r)}else if(e.getType()==="Circle"){const r=ci(e.getExtent(),this.getProjection());i=Sf(r),i.rotate(this.getRotation(),Ut(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;u<d;u+=o){const g=s[u]*i-s[u+1]*r,f=s[u]*r+s[u+1]*i;a=Math.min(a,g),l=Math.min(l,f),c=Math.max(c,g),h=Math.max(h,f)}return[a,l,c,h]}fitInternal(e,t){t=t||{};let i=t.size;i||(i=this.getViewportSizeMinusPadding_());const r=t.padding!==void 0?t.padding:[0,0,0,0],s=t.nearest!==void 0?t.nearest:!1;let o;t.minResolution!==void 0?o=t.minResolution:t.maxZoom!==void 0?o=this.getResolutionForZoom(t.maxZoom):o=0;const a=this.rotatedExtentForGeometry(e);let l=this.getResolutionForExtentInternal(a,[i[0]-r[1]-r[3],i[1]-r[0]-r[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,s?0:1);const c=this.getRotation(),h=Math.sin(c),u=Math.cos(c),d=Ut(a);d[0]+=(r[1]-r[3])/2*l,d[1]+=(r[0]-r[2])/2*l;const g=d[0]*u-d[1]*h,f=d[1]*u+d[0]*h,p=this.getConstrainedCenter([g,f],l),A=t.callback?t.callback:Us;t.duration!==void 0?this.animateInternal({resolution:l,center:p,duration:t.duration,easing:t.easing},A):(this.targetResolution_=l,this.targetCenter_=p,this.applyTargetState_(!1,!0),va(A,!0))}centerOn(e,t,i){this.centerOnInternal(je(e,this.getProjection()),t,i)}centerOnInternal(e,t,i){this.setCenterInternal(Yc(e,t,i,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,i,r){let s;const o=this.padding_;if(o&&e){const a=this.getViewportSizeMinusPadding_(-i),l=Yc(e,r,[a[0]/2+o[3],a[1]/2+o[0]],t,i);s=[e[0]-l[0],e[1]-l[1]]}return s}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){const t=sr(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){const t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t=t&&je(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),s=this.constraints_.resolution(this.targetResolution_*e,0,r,i);t&&(this.targetCenter_=this.calculateCenterZoom(s,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(Math.pow(this.zoomFactor_,-e),t)}adjustRotation(e,t){t&&(t=je(t,this.getProjection())),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){const i=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,i);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&je(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){const i=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,i),s=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,s,i),a=this.constraints_.center(this.targetCenter_,o,s,i,this.calculateCenterShift(this.targetCenter_,o,r,s));this.get(ai.ROTATION)!==r&&this.set(ai.ROTATION,r),this.get(ai.RESOLUTION)!==o&&(this.set(ai.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(ai.CENTER)||!Et(this.get(ai.CENTER),a))&&this.set(ai.CENTER,a),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,i){e=e!==void 0?e:200;const r=t||0,s=this.constraints_.rotation(this.targetRotation_),o=this.getViewportSize_(s),a=this.constraints_.resolution(this.targetResolution_,r,o),l=this.constraints_.center(this.targetCenter_,a,o,!1,this.calculateCenterShift(this.targetCenter_,a,s,o));if(e===0&&!this.cancelAnchor_){this.targetResolution_=a,this.targetRotation_=s,this.targetCenter_=l,this.applyTargetState_();return}i=i||(e===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==a||this.getRotation()!==s||!this.getCenterInternal()||!Et(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:l,resolution:a,duration:e,easing:Zr,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(De.INTERACTING,1)}endInteraction(e,t,i){i=i&&je(i,this.getProjection()),this.endInteractionInternal(e,t,i)}endInteractionInternal(e,t,i){this.getInteracting()&&(this.setHint(De.INTERACTING,-1),this.resolveConstraints(e,t,i))}getConstrainedCenter(e,t){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),i)}getConstrainedZoom(e,t){const i=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(i,t))}getConstrainedResolution(e,t){t=t||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,i)}}function va(n,e){setTimeout(function(){n(e)},0)}function _0(n){if(n.extent!==void 0){const t=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return Ud(n.extent,n.constrainOnlyCenter,t)}const e=vc(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,Ud(t,!1,!1)}return oy}function x0(n){let e,t,i,o=n.minZoom!==void 0?n.minZoom:Xc,a=n.maxZoom!==void 0?n.maxZoom:28;const l=n.zoomFactor!==void 0?n.zoomFactor:2,c=n.multiWorld!==void 0?n.multiWorld:!1,h=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,u=n.showFullExtent!==void 0?n.showFullExtent:!1,d=vc(n.projection,"EPSG:3857"),g=d.getExtent();let f=n.constrainOnlyCenter,p=n.extent;if(!c&&!p&&d.isGlobal()&&(f=!1,p=g),n.resolutions!==void 0){const A=n.resolutions;t=A[o],i=A[a]!==void 0?A[a]:A[A.length-1],n.constrainResolution?e=p0(A,h,!f&&p,u):e=If(t,i,h,!f&&p,u)}else{const m=(g?Math.max(ne(g),Oe(g)):360*An.degrees/d.getMetersPerUnit())/Hc/Math.pow(2,Xc),y=m/Math.pow(2,28-Xc);t=n.maxResolution,t!==void 0?o=0:t=m/Math.pow(l,o),i=n.minResolution,i===void 0&&(n.maxZoom!==void 0?n.maxResolution!==void 0?i=t/Math.pow(l,a):i=m/Math.pow(l,a):i=y),a=o+Math.floor(Math.log(t/i)/Math.log(l)),i=t/Math.pow(l,a-o),n.constrainResolution?e=A0(l,t,i,h,!f&&p,u):e=If(t,i,h,!f&&p,u)}return{constraint:e,maxResolution:t,minResolution:i,minZoom:o,zoomFactor:l}}function E0(n){if(n.enableRotation!==void 0?n.enableRotation:!0){const t=n.constrainRotation;return t===void 0||t===!0?y0():t===!1?Pf:typeof t=="number"?m0(t):Pf}return Wc}function w0(n){return!(n.sourceCenter&&n.targetCenter&&!Et(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function Yc(n,e,t,i,r){const s=Math.cos(-r);let o=Math.sin(-r),a=n[0]*s-n[1]*o,l=n[1]*s+n[0]*o;a+=(e[0]/2-t[0])*i,l+=(t[1]-e[1]/2)*i,o=-o;const c=a*s-l*o,h=l*s+a*o;return[c,h]}const Ca="ol-hidden",ba="ol-unselectable",Kc="ol-control",Ff="ol-collapsed",v0=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`].join(""),"i"),Lf=["style","variant","weight","size","lineHeight","family"],Zc={normal:400,bold:700},qc=function(n){const e=n.match(v0);if(!e)return null;const t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let i=0,r=Lf.length;i<r;++i){const s=e[i+1];s!==void 0&&(t[Lf[i]]=typeof s=="string"?s.trim():s)}return isNaN(Number(t.weight))&&t.weight in Zc&&(t.weight=Zc[t.weight]),t.families=t.family.split(/,\s?/).map(i=>i.trim().replace(/^['"]|['"]$/g,"")),t};function Me(n,e,t,i){let r;return t&&t.length?r=t.shift():ut?r=new class extends OffscreenCanvas{constructor(){super(...arguments);Gt(this,"style",{})}}(n??300,e??150):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("2d",i)}let Qc;function Ta(){return Qc||(Qc=Me(1,1)),Qc}function ro(n){const e=n.canvas;e.width=1,e.height=1,n.clearRect(0,0,1,1)}function kf(n,e){const t=e.parentNode;t&&t.replaceChild(n,e)}function C0(n){for(;n.lastChild;)n.lastChild.remove()}function b0(n,e){const t=n.childNodes;for(let i=0;;++i){const r=t[i],s=e[i];if(!r&&!s)break;if(r!==s){if(!r){n.appendChild(s);continue}if(!s){n.removeChild(r),--i;continue}n.insertBefore(s,r)}}}function Df(){return new Proxy({childNodes:[],appendChild:function(e){return this.childNodes.push(e),e},remove:function(){},removeChild:function(e){const t=this.childNodes.indexOf(e);if(t===-1)throw new Error("Node to remove was not found");return this.childNodes.splice(t,1),e},insertBefore:function(e,t){const i=this.childNodes.indexOf(t);if(i===-1)throw new Error("Reference node not found");return this.childNodes.splice(i,0,e),e},style:{}},{get(e,t,i){return t==="firstElementChild"?e.childNodes.length>0?e.childNodes[0]:null:Reflect.get(e,t,i)}})}function xn(n){return typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas}class so extends Ci{constructor(e){super();const t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents="auto"),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){var e;(e=this.element)==null||e.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){var t;this.map_&&((t=this.element)==null||t.remove());for(let i=0,r=this.listenerKeys.length;i<r;++i)Re(this.listenerKeys[i]);if(this.listenerKeys.length=0,this.map_=e,e){const i=this.target_??e.getOverlayContainerStopEvent();this.element&&i.appendChild(this.element),this.render!==Us&&this.listenerKeys.push(ce(e,dn.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}class Of extends so{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=e.collapsed!==void 0?e.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible!==void 0?e.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.attributions_=e.attributions;const t=e.className!==void 0?e.className:"ol-attribution",i=e.tipLabel!==void 0?e.tipLabel:"Attributions",r=e.expandClassName!==void 0?e.expandClassName:t+"-expand",s=e.collapseLabel!==void 0?e.collapseLabel:"›",o=e.collapseClassName!==void 0?e.collapseClassName:t+"-collapse";typeof s=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=s,this.collapseLabel_.className=o):this.collapseLabel_=s;const a=e.label!==void 0?e.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=r):this.label_=a;const l=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(K.CLICK,this.handleClick_.bind(this),!1);const c=t+" "+ba+" "+Kc+(this.collapsed_&&this.collapsible_?" "+Ff:"")+(this.collapsible_?"":" ol-uncollapsible"),h=this.element;h.className=c,h.appendChild(this.toggleButton_),h.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){const t=this.getMap().getAllLayers(),i=new Set(t.flatMap(r=>r.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=>qn(()=>r))),i=t.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!Bi(t,this.renderedAttributions_)){C0(this.ulElement_);for(let r=0,s=t.length;r<s;++r){const o=document.createElement("li");o.innerHTML=t[r],this.ulElement_.appendChild(o)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Ff),this.collapsed_?kf(this.collapseLabel_,this.label_):kf(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}}class T0 extends so{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target});const t=e.className!==void 0?e.className:"ol-rotate",i=e.label!==void 0?e.label:"⇧",r=e.compassClassName!==void 0?e.compassClassName:"ol-compass";this.label_=null,typeof i=="string"?(this.label_=document.createElement("span"),this.label_.className=r,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(r));const s=e.tipLabel?e.tipLabel:"Reset rotation",o=document.createElement("button");o.className=t+"-reset",o.setAttribute("type","button"),o.title=s,o.appendChild(this.label_),o.addEventListener(K.CLICK,this.handleClick_.bind(this),!1);const a=t+" "+ba+" "+Kc,l=this.element;l.className=a,l.appendChild(o),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration!==void 0?e.duration:250,this.autoHide_=e.autoHide!==void 0?e.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Ca)}handleClick_(e){e.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const i=t.getRotation();i!==void 0&&(this.duration_>0&&i%(2*Math.PI)!==0?t.animate({rotation:0,duration:this.duration_,easing:Zr}):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(Ca);!s&&i===0?this.element.classList.add(Ca):s&&i!==0&&this.element.classList.remove(Ca)}this.label_.style.transform=r}this.rotation_=i}}class R0 extends so{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(K.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(K.CLICK,this.handleClick_.bind(this,-i),!1);const d=t+" "+ba+" "+Kc,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:Zr})):i.setZoom(s)}}}function Gf(n){n=n||{};const e=new Rt;return(n.zoom!==void 0?n.zoom:!0)&&e.push(new R0(n.zoomOptions)),(n.rotate!==void 0?n.rotate:!0)&&e.push(new T0(n.rotateOptions)),(n.attribution!==void 0?n.attribution:!0)&&e.push(new Of(n.attributionOptions)),e}class S0{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]<e)return!1;let i=t-3;for(;i>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 Jc={ACTIVE:"active"};class En extends Ci{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(Jc.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Jc.ACTIVE,e)}setMap(e){this.map_=e}}function I0(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:my,center:n.getConstrainedCenter(r)})}}function $c(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:Zr})}class P0 extends En{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==he.DBLCLICK){const i=e.originalEvent,r=e.map,s=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();$c(a,o,s,this.duration_),i.preventDefault(),t=!0}return!t}}function eh(n){const e=arguments;return function(t){let i=!0;for(let r=0,s=e.length;r<s&&(i=i&&e[r](t),!!i);++r);return i}}const M0=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},F0=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},L0=function(n){const e=n.map.getTargetElement(),t=e.getRootNode(),i=n.map.getOwnerDocument().activeElement;return t instanceof ShadowRoot?t.host.contains(i):e.contains(i)},Bf=function(n){const e=n.map.getTargetElement(),t=e.getRootNode();return(t instanceof ShadowRoot?t.host:e).hasAttribute("tabindex")?L0(n):!0},es=Wr,Nf=function(n){const e=n.originalEvent;return"pointerId"in e&&e.button==0&&!(Jm&&Gd&&e.ctrlKey)},zf=Hr,k0=function(n){return n.type==he.SINGLECLICK},Ra=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},D0=function(n){const e=n.originalEvent;return Gd?e.metaKey:e.ctrlKey},th=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},jf=function(n){const e=n.originalEvent,t=e.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"&&!e.target.isContentEditable},ih=function(n){const e=n.originalEvent;return"pointerId"in e&&e.pointerType=="mouse"},nh=function(n){const e=n.originalEvent;return"pointerId"in e&&e.isPrimary&&e.button===0};class cr extends En{constructor(e){e=e||{},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==he.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==he.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==he.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,t=this.stopDown(i)}else e.type==he.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 rh(n){const e=n.length;let t=0,i=0;for(let r=0;r<e;r++)t+=n[r].clientX,i+=n[r].clientY;return{clientX:t/e,clientY:i/e}}class O0 extends cr{constructor(e){super({stopDown:Hr}),e=e||{},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const t=e.condition?e.condition:eh(Ra,nh);this.condition_=e.onFocusOnly?eh(Bf,t):t,this.noKinetic_=!1}handleDragEvent(e){const t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());const i=this.targetPointers,r=t.getEventPixel(rh(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){const s=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],a=e.map.getView();fy(s,a.getResolution()),fc(s,a.getRotation()),a.adjustCenterInternal(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=i.length,e.originalEvent.preventDefault()}handleUpEvent(e){const t=e.map,i=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const r=this.kinetic_.getDistance(),s=this.kinetic_.getAngle(),o=i.getCenterInternal(),a=t.getPixelFromCoordinateInternal(o),l=t.getCoordinateFromPixelInternal([a[0]-r*Math.cos(s),a[1]-r*Math.sin(s)]);i.animateInternal({center:i.getConstrainedCenter(l),duration:500,easing:Zr})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&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 G0 extends cr{constructor(e){e=e||{},super({stopDown:Hr}),this.condition_=e.condition?e.condition:F0,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!ih(e))return;const t=e.map,i=t.getView();if(i.getConstraints().rotation===Wc)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 ih(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return ih(e)&&Nf(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class B0 extends js{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 Jt([r])}getGeometry(){return this.geometry_}}const ts={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class oo extends Nt{constructor(e,t,i){super(e),this.coordinate=t,this.mapBrowserEvent=i}}class N0 extends cr{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new B0(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??Nf,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 oo(ts.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 oo(t?ts.BOXEND:ts.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 oo(ts.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new oo(ts.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new oo(ts.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}}class z0 extends N0{constructor(e){e=e||{};const t=e.condition?e.condition:th;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:Zr})}}const hr={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class j0 extends En{constructor(e){super(),e=e||{},this.defaultCondition_=function(t){return Ra(t)&&jf(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==K.KEYDOWN){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==hr.DOWN||r==hr.LEFT||r==hr.RIGHT||r==hr.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;r==hr.DOWN?c=-a:r==hr.LEFT?l=-a:r==hr.RIGHT?l=a:c=a;const h=[l,c];fc(h,o.getRotation()),I0(o,h,this.duration_),i.preventDefault(),t=!0}}return!t}}class U0 extends En{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(t){return!D0(t)&&jf(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==K.KEYDOWN||e.type==K.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();$c(a,o,void 0,this.duration_),i.preventDefault(),t=!0}}return!t}}const V0=40,W0=300;class H0 extends En{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:es;this.condition_=e.onFocusOnly?eh(Bf,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!==K.WHEEL)return!0;const i=e.map,r=e.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let s=r.deltaY;switch(r.deltaMode){case WheelEvent.DOM_DELTA_LINE:s*=V0;break;case WheelEvent.DOM_DELTA_PAGE:s*=W0;break}if(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),$c(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 X0 extends cr{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=Hr),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!==Wc&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(rh(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 Y0 extends cr{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=Hr),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(rh(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 K0(n){n=n||{};const e=new Rt,t=new S0(-.005,.05,100);return(n.altShiftDragRotate!==void 0?n.altShiftDragRotate:!0)&&e.push(new G0),(n.doubleClickZoom!==void 0?n.doubleClickZoom:!0)&&e.push(new P0({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan!==void 0?n.dragPan:!0)&&e.push(new O0({onFocusOnly:n.onFocusOnly,kinetic:t})),(n.pinchRotate!==void 0?n.pinchRotate:!0)&&e.push(new X0),(n.pinchZoom!==void 0?n.pinchZoom:!0)&&e.push(new Y0({duration:n.zoomDuration})),(n.keyboard!==void 0?n.keyboard:!0)&&(e.push(new j0),e.push(new U0({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom!==void 0?n.mouseWheelZoom:!0)&&e.push(new H0({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom!==void 0?n.shiftDragZoom:!0)&&e.push(new z0({duration:n.zoomDuration})),e}const ve={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 Ci{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[ve.OPACITY]=e.opacity!==void 0?e.opacity:1,ye(typeof t[ve.OPACITY]=="number","Layer opacity must be a number"),t[ve.VISIBLE]=e.visible!==void 0?e.visible:!0,t[ve.Z_INDEX]=e.zIndex,t[ve.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,t[ve.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,t[ve.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,t[ve.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(ve.EXTENT)}getMaxResolution(){return this.get(ve.MAX_RESOLUTION)}getMinResolution(){return this.get(ve.MIN_RESOLUTION)}getMinZoom(){return this.get(ve.MIN_ZOOM)}getMaxZoom(){return this.get(ve.MAX_ZOOM)}getOpacity(){return this.get(ve.OPACITY)}getSourceState(){return Q()}getVisible(){return this.get(ve.VISIBLE)}getZIndex(){return this.get(ve.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(ve.EXTENT,e)}setMaxResolution(e){this.set(ve.MAX_RESOLUTION,e)}setMinResolution(e){this.set(ve.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(ve.MAX_ZOOM,e)}setMinZoom(e){this.set(ve.MIN_ZOOM,e)}setOpacity(e){ye(typeof e=="number","Layer opacity must be a number"),this.set(ve.OPACITY,e)}setVisible(e){this.set(ve.VISIBLE,e)}setZIndex(e){this.set(ve.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const wn={ADDLAYER:"addlayer",REMOVELAYER:"removelayer"};class vn extends Nt{constructor(e,t){super(e),this.layer=t}}const sh={LAYERS:"layers"};class Si 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(sh.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Rt(i.slice(),{unique:!0}):ye(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Rt(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Re),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(ce(e,pt.ADD,this.handleLayersAdd_,this),ce(e,pt.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(Re);Vs(this.listenerKeys_);const t=e.getArray();for(let i=0,r=t.length;i<r;i++){const s=t[i];this.registerLayerListeners_(s),this.dispatchEvent(new vn(wn.ADDLAYER,s))}this.changed()}registerLayerListeners_(e){const t=[ce(e,Vr.PROPERTYCHANGE,this.handleLayerChange_,this),ce(e,K.CHANGE,this.handleLayerChange_,this)];e instanceof Si&&t.push(ce(e,wn.ADDLAYER,this.handleLayerGroupAdd_,this),ce(e,wn.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[Y(e)]=t}handleLayerGroupAdd_(e){this.dispatchEvent(new vn(wn.ADDLAYER,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new vn(wn.REMOVELAYER,e.layer))}handleLayersAdd_(e){const t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new vn(wn.ADDLAYER,t)),this.changed()}handleLayersRemove_(e){const t=e.element,i=Y(t);this.listenerKeys_[i].forEach(Re),delete this.listenerKeys_[i],this.dispatchEvent(new vn(wn.REMOVELAYER,t)),this.changed()}getLayers(){return this.get(sh.LAYERS)}setLayers(e){const t=this.getLayers();if(t){const i=t.getArray();for(let r=0,s=i.length;r<s;++r)this.dispatchEvent(new vn(wn.REMOVELAYER,i[r]))}this.set(sh.LAYERS,e)}getLayersArray(e){return e=e!==void 0?e:[],this.getLayers().forEach(function(t){t.getLayersArray(e)}),e}getLayerStatesArray(e){const t=e!==void 0?e:[],i=t.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(t)});const r=this.getLayerState();let s=r.zIndex;!e&&r.zIndex===void 0&&(s=0);for(let o=i,a=t.length;o<a;o++){const l=t[o];l.opacity*=r.opacity,l.visible=l.visible&&r.visible,l.maxResolution=Math.min(l.maxResolution,r.maxResolution),l.minResolution=Math.max(l.minResolution,r.minResolution),l.minZoom=Math.max(l.minZoom,r.minZoom),l.maxZoom=Math.min(l.maxZoom,r.maxZoom),r.extent!==void 0&&(l.extent!==void 0?l.extent=xt(l.extent,r.extent):l.extent=r.extent),l.zIndex===void 0&&(l.zIndex=s)}return t}getSourceState(){return"ready"}}const $t={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class is extends Uf{constructor(e){const t=Object.assign({},e);delete t.source,super(t),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(ve.SOURCE,this.handleSourcePropertyChange_);const i=e.source?e.source:null;this.setSource(i)}getLayersArray(e){return e=e||[],e.push(this),e}getLayerStatesArray(e){return e=e||[],e.push(this.getLayerState()),e}getSource(){return this.get(ve.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const e=this.getSource();return e?e.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(Re(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const e=this.getSource();e&&(this.sourceChangeKey_=ce(e,K.CHANGE,this.handleSourceChange_,this),e.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),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 Ri?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 oh(r,t.viewState)&&(!s||ze(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 Ri?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(ve.MAP,e)}getMapInternal(){return this.get(ve.MAP)}setMap(e){this.mapPrecomposeKey_&&(Re(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(Re(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=ce(e,$t.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=ce(this,K.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){const t=e.frameState.layerStatesArray,i=this.getLayerState(!1);ye(!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(ve.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 oh(n,e){if(!n.visible)return!1;const t=e.resolution;if(t<n.minResolution||t>=n.maxResolution)return!1;const i=e.zoom;return i>n.minZoom&&i<=n.maxZoom}function Vf(n,e,t=0,i=n.length-1,r=Z0){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));Vf(n,e,g,f,r)}const s=n[e];let o=t,a=i;for(ao(n,t,e),r(n[i],s)>0&&ao(n,t,i);o<a;){for(ao(n,o,a),o++,a--;r(n[o],s)<0;)o++;for(;r(n[a],s)>0;)a--}r(n[t],s)===0?ao(n,t,a):(a++,ao(n,a,i)),a<=e&&(t=a+1),e<=a&&(i=a-1)}}function ao(n,e,t){const i=n[e];n[e]=n[t],n[t]=i}function Z0(n,e){return n<e?-1:n>e?1:0}let Wf=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(!Ia(e,t))return i;const r=this.toBBox,s=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],l=t.leaf?r(a):a;Ia(e,l)&&(t.leaf?i.push(a):lh(e,l)?this._all(a,i):s.push(a))}t=s.pop()}return i}collides(e){let t=this.data;if(!Ia(e,t))return!1;const i=[];for(;t;){for(let r=0;r<t.children.length;r++){const s=t.children[r],o=t.leaf?this.toBBox(s):s;if(Ia(e,o)){if(t.leaf||lh(e,o))return!0;i.push(s)}}t=i.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let i=0;i<e.length;i++)this.insert(e[i]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const i=this.data;this.data=t,t=i}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=rs([]),this}remove(e,t){if(!e)return this;let i=this.data;const r=this.toBBox(e),s=[],o=[];let a,l,c;for(;i||s.length;){if(i||(i=s.pop(),l=s[s.length-1],a=o.pop(),c=!0),i.leaf){const h=q0(e,i.children,t);if(h!==-1)return i.children.splice(h,1),s.push(i),this._condense(s),this}!c&&!i.leaf&&lh(i,r)?(s.push(i),o.push(a),a=0,l=i,i=i.children[0]):l?(a++,i=l.children[a],c=!1):i=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const i=[];for(;e;)e.leaf?t.push(...e.children):i.push(...e.children),e=i.pop();return t}_build(e,t,i,r){const s=i-t+1;let o=this._maxEntries,a;if(s<=o)return a=rs(e.slice(t,i+1)),ns(a,this.toBBox),a;r||(r=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,r-1))),a=rs([]),a.leaf=!1,a.height=r;const l=Math.ceil(s/o),c=l*Math.ceil(Math.sqrt(o));Hf(e,t,i,c,this.compareMinX);for(let h=t;h<=i;h+=c){const u=Math.min(h+c-1,i);Hf(e,h,u,l,this.compareMinY);for(let d=h;d<=u;d+=l){const g=Math.min(d+l-1,u);a.children.push(this._build(e,d,g,r-1))}}return ns(a,this.toBBox),a}_chooseSubtree(e,t,i,r){for(;r.push(t),!(t.leaf||r.length-1===i);){let s=1/0,o=1/0,a;for(let l=0;l<t.children.length;l++){const c=t.children[l],h=ah(c),u=$0(e,c)-h;u<o?(o=u,s=h<s?h:s,a=c):u===o&&h<s&&(s=h,a=c)}t=a||t.children[0]}return t}_insert(e,t,i){const r=i?e:this.toBBox(e),s=[],o=this._chooseSubtree(r,this.data,t,s);for(o.children.push(e),co(o,r);t>=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=rs(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,ns(i,this.toBBox),ns(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=rs([e,t]),this.data.height=e.height+1,this.data.leaf=!1,ns(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=lo(e,0,a,this.toBBox),c=lo(e,a,i,this.toBBox),h=e_(l,c),u=ah(l)+ah(c);h<s?(s=h,r=a,o=u<o?u:o):h===s&&u<o&&(o=u,r=a)}return r||i-t}_chooseSplitAxis(e,t,i){const r=e.leaf?this.compareMinX:Q0,s=e.leaf?this.compareMinY:J0,o=this._allDistMargin(e,t,i,r),a=this._allDistMargin(e,t,i,s);o<a&&e.children.sort(r)}_allDistMargin(e,t,i,r){e.children.sort(r);const s=this.toBBox,o=lo(e,0,t,s),a=lo(e,i-t,i,s);let l=Sa(o)+Sa(a);for(let c=t;c<i-t;c++){const h=e.children[c];co(o,e.leaf?s(h):h),l+=Sa(o)}for(let c=i-t-1;c>=t;c--){const h=e.children[c];co(a,e.leaf?s(h):h),l+=Sa(a)}return l}_adjustParentBBoxes(e,t,i){for(let r=i;r>=0;r--)co(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():ns(e[t],this.toBBox)}};function q0(n,e,t){if(!t)return e.indexOf(n);for(let i=0;i<e.length;i++)if(t(n,e[i]))return i;return-1}function ns(n,e){lo(n,0,n.children.length,e,n)}function lo(n,e,t,i,r){r||(r=rs(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<t;s++){const o=n.children[s];co(r,n.leaf?i(o):o)}return r}function co(n,e){return n.minX=Math.min(n.minX,e.minX),n.minY=Math.min(n.minY,e.minY),n.maxX=Math.max(n.maxX,e.maxX),n.maxY=Math.max(n.maxY,e.maxY),n}function Q0(n,e){return n.minX-e.minX}function J0(n,e){return n.minY-e.minY}function ah(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function Sa(n){return n.maxX-n.minX+(n.maxY-n.minY)}function $0(n,e){return(Math.max(e.maxX,n.maxX)-Math.min(e.minX,n.minX))*(Math.max(e.maxY,n.maxY)-Math.min(e.minY,n.minY))}function e_(n,e){const t=Math.max(n.minX,e.minX),i=Math.max(n.minY,e.minY),r=Math.min(n.maxX,e.maxX),s=Math.min(n.maxY,e.maxY);return Math.max(0,r-t)*Math.max(0,s-i)}function lh(n,e){return n.minX<=e.minX&&n.minY<=e.minY&&e.maxX<=n.maxX&&e.maxY<=n.maxY}function Ia(n,e){return e.minX<=n.maxX&&e.minY<=n.maxY&&e.maxX>=n.minX&&e.maxY>=n.minY}function rs(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Hf(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;Vf(n,o,e,t,r),s.push(e,o,o,t)}}const ch=[NaN,NaN,NaN,0];let hh;function t_(){return hh||(hh=Me(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),hh}const i_=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,n_=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,r_=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,s_=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function Pa(n,e){return n.endsWith("%")?Number(n.substring(0,n.length-1))/e:Number(n)}function ho(n){throw new Error('failed to parse "'+n+'" as color')}function Xf(n){if(n.toLowerCase().startsWith("rgb")){const s=n.match(n_)||n.match(i_)||n.match(r_);if(s){const o=s[4],a=100/255;return[Pe(Pa(s[1],a)+.5|0,0,255),Pe(Pa(s[2],a)+.5|0,0,255),Pe(Pa(s[3],a)+.5|0,0,255),o!==void 0?Pe(Pa(o,100),0,1):1]}ho(n)}if(n.startsWith("#")){if(s_.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<c;l+=o){let h=parseInt(s.substring(l,l+o),16);o===1&&(h+=h<<4),a[l/o]=h}return a[3]=a[3]/255,a}ho(n)}const e=t_();e.fillStyle="#abcdef";let t=e.fillStyle;e.fillStyle=n,e.fillStyle===t&&(e.fillStyle="#fedcba",t=e.fillStyle,e.fillStyle=n,e.fillStyle===t&&ho(n));const i=e.fillStyle;if(i.startsWith("#")||i.startsWith("rgba"))return Xf(i);e.clearRect(0,0,1,1),e.fillRect(0,0,1,1);const r=Array.from(e.getImageData(0,0,1,1).data);return r[3]=Xs(r[3]/255,3),r}function o_(n){return typeof n=="string"?n:mh(n)}const a_=1024,uo={};let uh=0;function l_(n){if(n.length===4)return n;const e=n.slice();return e[3]=1,e}function dh(n){return n>.0031308?Math.pow(n,1/2.4)*269.025-14.025:n*3294.6}function fh(n){return n>.2068965?Math.pow(n,3):(n-4/29)*(108/841)}function gh(n){return n>10.314724?Math.pow((n+14.025)/269.025,2.4):n/3294.6}function ph(n){return n>.0088564?Math.pow(n,1/3):n/(108/841)+4/29}function Yf(n){const e=gh(n[0]),t=gh(n[1]),i=gh(n[2]),r=ph(e*.222488403+t*.716873169+i*.06060791),s=500*(ph(e*.452247074+t*.399439023+i*.148375274)-r),o=200*(r-ph(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 c_(n){const e=(n[0]+16)/116,t=n[1],i=n[2]*Math.PI/180,r=fh(e),s=fh(e+t/500*Math.cos(i)),o=fh(e-t/200*Math.sin(i)),a=dh(s*3.021973625-r*1.617392459-o*.404875592),l=dh(s*-.943766287+r*1.916279586+o*.027607165),c=dh(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 Ah(n){if(n==="none")return ch;if(uo.hasOwnProperty(n))return uo[n];if(uh>=a_){let t=0;for(const i in uo)(t++&3)===0&&(delete uo[i],--uh)}const e=Xf(n);e.length!==4&&ho(n);for(const t of e)isNaN(t)&&ho(n);return uo[n]=e,++uh,e}function ss(n){return Array.isArray(n)?n:Ah(n)}function mh(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 Kf(n){return n[0]>0&&n[1]>0}function h_(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 it(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}let ur=0;const wt=1<<ur++,ue=1<<ur++,Pt=1<<ur++,hi=1<<ur++,dr=1<<ur++,fo=1<<ur++,Ma=Math.pow(2,ur)-1,yh={[wt]:"boolean",[ue]:"number",[Pt]:"string",[hi]:"color",[dr]:"number[]",[fo]:"size"},u_=Object.keys(yh).map(Number).sort(wi);function d_(n){return n in yh}function go(n){const e=[];for(const t of u_)po(n,t)&&e.push(yh[t]);return e.length===0?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}function po(n,e){return(n&e)===e}function Cn(n,e){return n===e}class nt{constructor(e,t){if(!d_(e))throw new Error(`literal expressions must have a specific type, got ${go(e)}`);this.type=e,this.value=t}}class f_{constructor(e,t,...i){this.type=e,this.operator=t,this.args=i}}function Zf(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function dt(n,e,t){switch(typeof n){case"boolean":{if(Cn(e,Pt))return new nt(Pt,n?"true":"false");if(!po(e,wt))throw new Error(`got a boolean, but expected ${go(e)}`);return new nt(wt,n)}case"number":{if(Cn(e,fo))return new nt(fo,it(n));if(Cn(e,wt))return new nt(wt,!!n);if(Cn(e,Pt))return new nt(Pt,n.toString());if(!po(e,ue))throw new Error(`got a number, but expected ${go(e)}`);return new nt(ue,n)}case"string":{if(Cn(e,hi))return new nt(hi,Ah(n));if(Cn(e,wt))return new nt(wt,!!n);if(!po(e,Pt))throw new Error(`got a string, but expected ${go(e)}`);return new nt(Pt,n)}}if(!Array.isArray(n))throw new Error("expression must be an array or a primitive value");if(n.length===0)throw new Error("empty expression");if(typeof n[0]=="string")return C_(n,e,t);for(const i of n)if(typeof i!="number")throw new Error("expected an array of numbers");if(Cn(e,fo)){if(n.length!==2)throw new Error(`expected an array of two values for a size, got ${n.length}`);return new nt(fo,n)}if(Cn(e,hi)){if(n.length===3)return new nt(hi,[...n,1]);if(n.length===4)return new nt(hi,n);throw new Error(`expected an array of 3 or 4 values for a color, got ${n.length}`)}if(!po(e,dr))throw new Error(`got an array of numbers, but expected ${go(e)}`);return new nt(dr,n)}const k={Get:"get",Var:"var",Concat:"concat",GeometryType:"geometry-type",LineMetric:"line-metric",Any:"any",All:"all",Not:"!",Resolution:"resolution",Zoom:"zoom",Time:"time",Equal:"==",NotEqual:"!=",GreaterThan:">",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"},g_={[k.Get]:J(te(1,1/0),qf),[k.Var]:J(te(1,1),p_),[k.Has]:J(te(1,1/0),qf),[k.Id]:J(A_,os),[k.Concat]:J(te(2,1/0),xe(Pt)),[k.GeometryType]:J(m_,os),[k.LineMetric]:J(os),[k.Resolution]:J(_h,os),[k.Zoom]:J(_h,os),[k.Time]:J(_h,os),[k.Any]:J(te(2,1/0),xe(wt)),[k.All]:J(te(2,1/0),xe(wt)),[k.Not]:J(te(1,1),xe(wt)),[k.Equal]:J(te(2,2),xe(Ma)),[k.NotEqual]:J(te(2,2),xe(Ma)),[k.GreaterThan]:J(te(2,2),xe(ue)),[k.GreaterThanOrEqualTo]:J(te(2,2),xe(ue)),[k.LessThan]:J(te(2,2),xe(ue)),[k.LessThanOrEqualTo]:J(te(2,2),xe(ue)),[k.Multiply]:J(te(2,1/0),Qf),[k.Coalesce]:J(te(2,1/0),Qf),[k.Divide]:J(te(2,2),xe(ue)),[k.Add]:J(te(2,1/0),xe(ue)),[k.Subtract]:J(te(2,2),xe(ue)),[k.Clamp]:J(te(3,3),xe(ue)),[k.Mod]:J(te(2,2),xe(ue)),[k.Pow]:J(te(2,2),xe(ue)),[k.Abs]:J(te(1,1),xe(ue)),[k.Floor]:J(te(1,1),xe(ue)),[k.Ceil]:J(te(1,1),xe(ue)),[k.Round]:J(te(1,1),xe(ue)),[k.Sin]:J(te(1,1),xe(ue)),[k.Cos]:J(te(1,1),xe(ue)),[k.Atan]:J(te(1,2),xe(ue)),[k.Sqrt]:J(te(1,1),xe(ue)),[k.Match]:J(te(4,1/0),Jf,__),[k.Between]:J(te(3,3),xe(ue)),[k.Interpolate]:J(te(6,1/0),Jf,x_),[k.Case]:J(te(3,1/0),y_,E_),[k.In]:J(te(2,2),w_),[k.Number]:J(te(1,1/0),xe(Ma)),[k.String]:J(te(1,1/0),xe(Ma)),[k.Array]:J(te(1,1/0),xe(ue)),[k.Color]:J(te(1,4),xe(ue)),[k.Band]:J(te(1,3),xe(ue)),[k.Palette]:J(te(2,2),v_),[k.ToString]:J(te(1,1),xe(wt|ue|Pt|hi))};function qf(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;s<i;++s){const o=n[s+1];switch(typeof o){case"number":{r[s]=new nt(ue,o);break}case"string":{r[s]=new nt(Pt,o);break}default:throw new Error(`expected a string key or numeric array index for a get operation, got ${o}`)}s===0&&t.properties.add(String(o))}return r}function p_(n,e,t){const i=n[1];if(typeof i!="string")throw new Error("expected a string argument for var operation");return t.variables.add(i),[new nt(Pt,i)]}function A_(n,e,t){t.featureId=!0}function m_(n,e,t){t.geometryType=!0}function _h(n,e,t){t.mapState=!0}function os(n,e,t){const i=n[0];if(n.length!==1)throw new Error(`expected no arguments for ${i} operation`);return[]}function te(n,e){return function(t,i,r){const s=t[0],o=t.length-1;if(n===e){if(o!==n){const a=n===1?"":"s";throw new Error(`expected ${n} argument${a} for ${s}, got ${o}`)}}else if(o<n||o>e){const a=e===1/0?`${n} or more`:`${n} to ${e}`;throw new Error(`expected ${a} arguments for ${s}, got ${o}`)}}}function Qf(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;s<i;++s){const o=dt(n[s+1],e,t);r[s]=o}return r}function xe(n){return function(e,t,i){const r=e.length-1,s=new Array(r);for(let o=0;o<r;++o){const a=dt(e[o+1],n,i);s[o]=a}return s}}function y_(n,e,t){const i=n[0],r=n.length-1;if(r%2===0)throw new Error(`expected an odd number of arguments for ${i}, got ${r} instead`)}function Jf(n,e,t){const i=n[0],r=n.length-1;if(r%2===1)throw new Error(`expected an even number of arguments for operation ${i}, got ${r} instead`)}function __(n,e,t){const i=n.length-1,r=Pt|ue|wt,s=dt(n[1],r,t),o=dt(n[n.length-1],e,t),a=new Array(i-2);for(let l=0;l<i-2;l+=2){try{const c=dt(n[l+2],s.type,t);a[l]=c}catch(c){throw new Error(`failed to parse argument ${l+1} of match expression: ${c.message}`)}try{const c=dt(n[l+3],o.type,t);a[l+1]=c}catch(c){throw new Error(`failed to parse argument ${l+2} of match expression: ${c.message}`)}}return[s,...a,o]}function x_(n,e,t){const i=n[1];let r;switch(i[0]){case"linear":r=1;break;case"exponential":const l=i[1];if(typeof l!="number"||l<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(l)} instead`);r=l;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(i)}`)}const s=new nt(ue,r);let o;try{o=dt(n[2],ue,t)}catch(l){throw new Error(`failed to parse argument 1 in interpolate expression: ${l.message}`)}const a=new Array(n.length-3);for(let l=0;l<a.length;l+=2){try{const c=dt(n[l+3],ue,t);a[l]=c}catch(c){throw new Error(`failed to parse argument ${l+2} for interpolate expression: ${c.message}`)}try{const c=dt(n[l+4],e,t);a[l+1]=c}catch(c){throw new Error(`failed to parse argument ${l+3} for interpolate expression: ${c.message}`)}}return[s,o,...a]}function E_(n,e,t){const i=dt(n[n.length-1],e,t),r=new Array(n.length-1);for(let s=0;s<r.length-1;s+=2){try{const o=dt(n[s+1],wt,t);r[s]=o}catch(o){throw new Error(`failed to parse argument ${s} of case expression: ${o.message}`)}try{const o=dt(n[s+2],i.type,t);r[s+1]=o}catch(o){throw new Error(`failed to parse argument ${s+1} of case expression: ${o.message}`)}}return r[r.length-1]=i,r}function w_(n,e,t){let i=n[2];if(!Array.isArray(i))throw new Error('the second argument for the "in" operator must be an array');let r;if(typeof i[0]=="string"){if(i[0]!=="literal")throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(i[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');i=i[1],r=Pt}else r=ue;const s=new Array(i.length);for(let a=0;a<s.length;a++)try{const l=dt(i[a],r,t);s[a]=l}catch(l){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${l.message}`)}return[dt(n[1],r,t),...s]}function v_(n,e,t){let i;try{i=dt(n[1],ue,t)}catch(o){throw new Error(`failed to parse first argument in palette expression: ${o.message}`)}const r=n[2];if(!Array.isArray(r))throw new Error("the second argument of palette must be an array");const s=new Array(r.length);for(let o=0;o<s.length;o++){let a;try{a=dt(r[o],hi,t)}catch(l){throw new Error(`failed to parse color at index ${o} in palette expression: ${l.message}`)}if(!(a instanceof nt))throw new Error(`the palette color at index ${o} must be a literal value`);s[o]=a}return[i,...s]}function J(...n){return function(e,t,i){const r=e[0];let s;for(let o=0;o<n.length;o++){const a=n[o](e,t,i);if(o==n.length-1){if(!a)throw new Error("expected last argument validator to return the parsed args");s=a}}return new f_(t,r,...s)}}function C_(n,e,t){const i=n[0],r=g_[i];if(!r)throw new Error(`unknown operator: ${i}`);return r(n,e,t)}function $f(n){if(!n)return"";const e=n.getType();switch(e){case"Point":case"LineString":case"Polygon":return e;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return e.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return $f(n.getGeometries()[0]);default:return""}}function eg(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function Wi(n,e,t){const i=dt(n,e,t);return ui(i)}function ui(n,e){if(n instanceof nt){if(n.type===hi&&typeof n.value=="string"){const i=Ah(n.value);return function(){return i}}return function(){return n.value}}const t=n.operator;switch(t){case k.Number:case k.String:case k.Coalesce:return b_(n);case k.Get:case k.Var:case k.Has:return T_(n);case k.Id:return i=>i.featureId;case k.GeometryType:return i=>i.geometryType;case k.Concat:{const i=n.args.map(r=>ui(r));return r=>"".concat(...i.map(s=>s(r).toString()))}case k.Resolution:return i=>i.resolution;case k.Any:case k.All:case k.Between:case k.In:case k.Not:return S_(n);case k.Equal:case k.NotEqual:case k.LessThan:case k.LessThanOrEqualTo:case k.GreaterThan:case k.GreaterThanOrEqualTo:return R_(n);case k.Multiply:case k.Divide:case k.Add:case k.Subtract:case k.Clamp:case k.Mod:case k.Pow:case k.Abs:case k.Floor:case k.Ceil:case k.Round:case k.Sin:case k.Cos:case k.Atan:case k.Sqrt:return I_(n);case k.Case:return P_(n);case k.Match:return M_(n);case k.Interpolate:return F_(n);case k.ToString:return L_(n);default:throw new Error(`Unsupported operator ${t}`)}}function b_(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ui(n.args[s]);switch(t){case k.Coalesce:return s=>{for(let o=0;o<i;++o){const a=r[o](s);if(typeof a<"u"&&a!==null)return a}throw new Error("Expected one of the values to be non-null")};case k.Number:case k.String:return s=>{for(let o=0;o<i;++o){const a=r[o](s);if(typeof a===t)return a}throw new Error(`Expected one of the values to be a ${t}`)};default:throw new Error(`Unsupported assertion operator ${t}`)}}function T_(n,e){const i=n.args[0].value;switch(n.operator){case k.Get:return r=>{const s=n.args;let o=r.properties[i];for(let a=1,l=s.length;a<l;++a){const h=s[a].value;o=o[h]}return o};case k.Var:return r=>r.variables[i];case k.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;a<l;++a){const h=s[a].value;if(!o||!Object.hasOwn(o,h))return!1;o=o[h]}return!0};default:throw new Error(`Unsupported accessor operator ${n.operator}`)}}function R_(n,e){const t=n.operator,i=ui(n.args[0]),r=ui(n.args[1]);switch(t){case k.Equal:return s=>i(s)===r(s);case k.NotEqual:return s=>i(s)!==r(s);case k.LessThan:return s=>i(s)<r(s);case k.LessThanOrEqualTo:return s=>i(s)<=r(s);case k.GreaterThan:return s=>i(s)>r(s);case k.GreaterThanOrEqualTo:return s=>i(s)>=r(s);default:throw new Error(`Unsupported comparison operator ${t}`)}}function S_(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ui(n.args[s]);switch(t){case k.Any:return s=>{for(let o=0;o<i;++o)if(r[o](s))return!0;return!1};case k.All:return s=>{for(let o=0;o<i;++o)if(!r[o](s))return!1;return!0};case k.Between:return s=>{const o=r[0](s),a=r[1](s),l=r[2](s);return o>=a&&o<=l};case k.In:return s=>{const o=r[0](s);for(let a=1;a<i;++a)if(o===r[a](s))return!0;return!1};case k.Not:return s=>!r[0](s);default:throw new Error(`Unsupported logical operator ${t}`)}}function I_(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ui(n.args[s]);switch(t){case k.Multiply:return s=>{let o=1;for(let a=0;a<i;++a)o*=r[a](s);return o};case k.Divide:return s=>r[0](s)/r[1](s);case k.Add:return s=>{let o=0;for(let a=0;a<i;++a)o+=r[a](s);return o};case k.Subtract:return s=>r[0](s)-r[1](s);case k.Clamp:return s=>{const o=r[0](s),a=r[1](s);if(o<a)return a;const l=r[2](s);return o>l?l:o};case k.Mod:return s=>r[0](s)%r[1](s);case k.Pow:return s=>Math.pow(r[0](s),r[1](s));case k.Abs:return s=>Math.abs(r[0](s));case k.Floor:return s=>Math.floor(r[0](s));case k.Ceil:return s=>Math.ceil(r[0](s));case k.Round:return s=>Math.round(r[0](s));case k.Sin:return s=>Math.sin(r[0](s));case k.Cos:return s=>Math.cos(r[0](s));case k.Atan:return i===2?s=>Math.atan2(r[0](s),r[1](s)):s=>Math.atan(r[0](s));case k.Sqrt:return s=>Math.sqrt(r[0](s));default:throw new Error(`Unsupported numeric operator ${t}`)}}function P_(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ui(n.args[r]);return r=>{for(let s=0;s<t-1;s+=2)if(i[s](r))return i[s+1](r);return i[t-1](r)}}function M_(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ui(n.args[r]);return r=>{const s=i[0](r);for(let o=1;o<t-1;o+=2)if(s===i[o](r))return i[o+1](r);return i[t-1](r)}}function F_(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=ui(n.args[r]);return r=>{const s=i[0](r),o=i[1](r);let a,l;for(let c=2;c<t;c+=2){const h=i[c](r);let u=i[c+1](r);const d=Array.isArray(u);if(d&&(u=l_(u)),h>=o)return c===2?u:d?k_(s,o,a,l,h,u):Ao(s,o,a,l,h,u);a=h,l=u}return l}}function L_(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=ui(n.args[s]);switch(t){case k.ToString:return s=>{const o=r[0](s);return n.args[0].type===hi?mh(o):o.toString()};default:throw new Error(`Unsupported convert operator ${t}`)}}function Ao(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 k_(n,e,t,i,r,s){if(r-t===0)return i;const a=Yf(i),l=Yf(s);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const h=[Ao(n,e,t,a[0],r,l[0]),Ao(n,e,t,a[1],r,l[1]),a[2]+Ao(n,e,t,0,r,c),Ao(n,e,t,i[3],r,s[3])];return c_(h)}const W={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class xh extends Ws{constructor(e,t,i,r){super(),this.extent=e,this.pixelRatio_=i,this.resolution=t,this.state=typeof r=="function"?W.IDLE:r,this.image_=null,this.loader=typeof r=="function"?r:null}changed(){this.dispatchEvent(K.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==W.IDLE&&this.loader){this.state=W.LOADING,this.changed();const e=this.getResolution(),t=Array.isArray(e)?e[0]:e;qn(()=>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||ey&&i instanceof ImageBitmap||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement)&&(this.image_=i),this.state=W.LOADED}).catch(i=>{this.state=W.ERROR,console.error(i)}).finally(()=>this.changed())}}setImage(e){this.image_=e}setResolution(e){this.resolution=e}}function D_(n,e,t){const i=n;let r=!0,s=!1,o=!1;const a=[ta(i,K.LOAD,function(){o=!0,s||e()})];return i.src&&Bd?(s=!0,i.decode().then(function(){r&&e()}).catch(function(l){r&&(o?e():t())})):a.push(ta(i,K.ERROR,t)),function(){r=!1,a.forEach(Re)}}function O_(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 G_(n,e){return e&&(n.src=e),n.src&&Bd?new Promise((t,i)=>n.decode().then(()=>t(n)).catch(r=>n.complete&&n.width?t(n):i(r))):O_(n)}class B_{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=Eh(e,t,i);return r in this.cache_?this.cache_[r]:null}getPattern(e,t,i){const r=Eh(e,t,i);return r in this.patternCache_?this.patternCache_[r]:null}set(e,t,i,r,s){const o=Eh(e,t,i),a=o in this.cache_;this.cache_[o]=r,s&&(r.getImageState()===W.IDLE&&r.load(),r.getImageState()===W.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 Eh(n,e,t){const i=t?ss(t):"null";return e+":"+n+":"+i}const ei=new B_;let mo=null;class tg extends Ws{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?W.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_===W.LOADED){mo||(mo=Me(1,1,void 0,{willReadFrequently:!0})),mo.drawImage(this.image_,0,0);try{mo.getImageData(0,0,1,1),this.tainted_=!1}catch{mo=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(K.CHANGE)}handleImageError_(){this.imageState_=W.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=W.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=Me(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_===W.IDLE){this.image_||this.initializeImage_(),this.imageState_=W.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&G_(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_!==W.LOADED)return;const t=this.image_,i=Me(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=o_(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_===W.LOADED||this.imageState_===W.ERROR)e();else{const t=()=>{(this.imageState_===W.LOADED||this.imageState_===W.ERROR)&&(this.removeEventListener(K.CHANGE,t),e())};this.addEventListener(K.CHANGE,t)}})),this.ready_}}function Fa(n,e,t,i,r,s){let o=e===void 0?void 0:ei.get(e,t,r);return o||(o=new tg(n,n&&"src"in n?n.src||void 0:e,t,i,r),ei.set(e,t,r,o,s)),s&&o&&!ei.getPattern(e,t,r)&&ei.set(e,t,r,o,s),o}function Ii(n){return n?Array.isArray(n)?mh(n):typeof n=="object"&&"src"in n?N_(n):n:null}function N_(n){if(!n.offset||!n.size)return ei.getPattern(n.src,"anonymous",n.color);const e=n.src+":"+n.offset,t=ei.getPattern(e,void 0,n.color);if(t)return t;const i=ei.get(n.src,"anonymous",null);if(i.getImageState()!==W.LOADED)return null;const r=Me(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]),Fa(r.canvas,e,void 0,W.LOADED,n.color,!0),ei.getPattern(e,void 0,n.color)}const ig="10px sans-serif",Mt="#000",as="round",Hi=[],Xi=0,ls="round",yo=10,_o="#000",xo="center",La="middle",fr=[0,0,0,0],Eo=1,gr=new Ci;let wo=null,ng;const wh={},z_=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function j_(n,e,t){return`${n} ${e} 16px "${t}"`}const U_=(function(){let e,t;async function i(s){await t.ready;const o=await t.load(s);if(o.length===0)return!1;const a=qc(s),l=a.families[0].toLowerCase(),c=a.weight;return o.some(h=>{const u=h.family.replace(/^['"]|['"]$/g,"").toLowerCase(),d=Zc[h.weight]||h.weight;return u===l&&h.style===a.style&&d==c})}async function r(){await t.ready;let s=!0;const o=gr.getProperties(),a=Object.keys(o).filter(l=>o[l]<100);for(let l=a.length-1;l>=0;--l){const c=a[l];let h=o[c];h<100&&(await i(c)?(Vs(wh),gr.set(c,100)):(h+=10,gr.set(c,h,!0),h<100&&(s=!1)))}e=void 0,s||(e=setTimeout(r,100))}return async function(s){t||(t=ut?self.fonts:document.fonts);const o=qc(s);if(!o)return;const a=o.families;let l=!1;for(const c of a){if(z_.has(c))continue;const h=j_(o.style,o.weight,c);gr.get(h)===void 0&&(gr.set(h,0,!0),l=!0)}l&&(clearTimeout(e),e=setTimeout(r,100))}})(),V_=(function(){let n;return function(e){let t=wh[e];if(t==null){if(ut){const i=qc(e),r=rg(e,"Žg");t=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else n||(n=document.createElement("div"),n.innerHTML="M",n.style.minHeight="0",n.style.maxHeight="none",n.style.height="auto",n.style.padding="0",n.style.border="none",n.style.position="absolute",n.style.display="block",n.style.left="-99999px"),n.style.font=e,document.body.appendChild(n),t=n.offsetHeight,document.body.removeChild(n);wh[e]=t}return t}})();function rg(n,e){return wo||(wo=Me(1,1)),n!=ng&&(wo.font=n,ng=wo.font),wo.measureText(e)}function sg(n,e){return rg(n,e).width}function og(n,e,t){if(e in t)return t[e];const i=e.split(`
20
- `).reduce((r,s)=>Math.max(r,sg(n,s)),0);return t[e]=i,i}function W_(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===`
21
- `||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=sg(d,u);t.push(g),o+=g;const f=V_(d);i.push(f),l=Math.max(l,f)}return{width:s,height:a,widths:t,heights:i,lineWidths:r}}function H_(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]),X_(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 X_(n,e){const t=n.contextInstructions;for(let i=0,r=t.length;i<r;i+=2)Array.isArray(t[i+1])?e[t[i]].apply(e,t[i+1]):e[t[i]]=t[i+1]}class ka{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=it(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new ka({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return Q()}getImage(e){return Q()}getHitDetectionImage(){return Q()}getPixelRatio(e){return 1}getImageState(){return Q()}getImageSize(){return Q()}getOrigin(){return Q()}getSize(){return Q()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=it(e)}listenImageChange(e){Q()}load(){Q()}unlistenImageChange(e){Q()}ready(){return Promise.resolve()}}class Da extends ka{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,rotation:e.rotation!==void 0?e.rotation:0,scale:e.scale!==void 0?e.scale:1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill!==void 0?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle!==void 0?e.angle:0,this.stroke_=e.stroke!==void 0?e.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?W.LOADING:W.LOADED,this.imageState_===W.LOADING&&this.ready().then(()=>this.imageState_=W.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=ei.get(i,null,null))==null?void 0:o.getImage(1);if(!r){const a=this.renderOptions_,l=Math.ceil(a.size*e),c=Me(l,l);this.draw_(a,c,e),r=c.canvas,ei.set(i,null,null,new tg(r,void 0,null,W.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<s){const w=r;r=s,s=w}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=s*Math.sin(a),c=Math.sqrt(s*s-l*l),h=r-c,u=Math.sqrt(l*l+h*h),d=u/l;if(e==="miter"&&d<=i)return d*t;const g=t/2/d,f=t/2*(h/u),A=Math.sqrt((r+g)*(r+g)+f*f)-r;if(this.radius2_===void 0||e==="bevel")return A*2;const m=r*Math.sin(a),y=Math.sqrt(r*r-m*m),E=s-y,_=Math.sqrt(m*m+E*E)/m;if(_<=i){const w=_*t/2-s-r;return 2*Math.max(A,w)}return A*2}createRenderOptions(){let e=as,t=ls,i=0,r=null,s=0,o,a=0;this.stroke_&&(o=Ii(this.stroke_.getColor()??_o),a=this.stroke_.getWidth()??Eo,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,t=this.stroke_.getLineJoin()??ls,e=this.stroke_.getLineCap()??as,i=this.stroke_.getMiterLimit()??yo);const l=this.calculateLineJoinSize_(t,a,i),c=Math.max(this.radius,this.radius2_||0),h=Math.ceil(2*c+l);return{strokeStyle:o,strokeWidth:a,size:h,lineCap:e,lineDash:r,lineDashOffset:s,lineJoin:t,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,t,i){if(t.scale(i,i),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let r=this.fill_.getColor();r===null&&(r=Mt),t.fillStyle=Ii(r),t.fill()}e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){let t;if(this.fill_){let i=this.fill_.getColor(),r=0;typeof i=="string"&&(i=ss(i)),i===null?r=1:Array.isArray(i)&&(r=i.length===4?i[3]:1),r===0&&(t=Me(e.size,e.size),this.drawHitDetectionCanvas_(e,t))}return t?t.canvas:this.getImage(1)}createPath_(e){let t=this.points_;const i=this.radius;if(t===1/0)e.arc(0,0,i,0,2*Math.PI);else{const r=this.radius2_===void 0?i:this.radius2_;this.radius2_!==void 0&&(t*=2);const s=this.angle_-Math.PI/2,o=2*Math.PI/t;for(let a=0;a<t;a++){const l=s+a*o,c=a%2===0?i:r;e.lineTo(c*Math.cos(l),c*Math.sin(l))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=Mt,t.fill(),e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class pr extends Da{constructor(e){e=e||{radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale!==void 0?e.scale:1,rotation:e.rotation!==void 0?e.rotation:0,rotateWithView:e.rotateWithView!==void 0?e.rotateWithView:!1,displacement:e.displacement!==void 0?e.displacement:[0,0],declutterMode:e.declutterMode})}clone(){const e=this.getScale(),t=new pr({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return t.setOpacity(this.getOpacity()),t}setRadius(e){this.radius=e,this.render()}}class Vt{constructor(e){e=e||{},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){const e=this.getColor();return new Vt({color:Array.isArray(e)?e.slice():e||void 0})}getColor(){return this.color_}setColor(e){if(e!==null&&typeof e=="object"&&"src"in e){const t=Fa(null,e.src,"anonymous",void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then(()=>{this.patternImage_=null}),t.getImageState()===W.IDLE&&t.load(),t.getImageState()===W.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:ss(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function ag(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 Ar extends ka{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;ye(!(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)),ye(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),ye(!((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=W.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?W.LOADED:W.IDLE:l=W.LOADING:l=W.LOADED),this.color_=e.color!==void 0?ss(e.color):null,this.iconImage_=Fa(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(ag(g[0],g[1],e.width,e.height))};this.listenImageChange(d);return}}c!==void 0&&this.setScale(ag(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 Ar({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()}setSrc(e){this.iconImage_=Fa(null,e,this.crossOrigin_,W.IDLE,this.color_)}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()==W.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()==W.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(K.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(K.CHANGE,e)}ready(){return this.iconImage_.ready()}}class ti{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 ti({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 rt{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=hg,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 rt({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_=hg,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function Y_(n){let e;if(typeof n=="function")e=n;else{let t;Array.isArray(n)?t=n:(ye(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),t=[n]),e=function(){return t}}return e}let vh=null;function lg(n,e){if(!vh){const t=new Vt({color:"rgba(255,255,255,0.4)"}),i=new ti({color:"#3399CC",width:1.25});vh=[new rt({image:new pr({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return vh}function cg(){const n={},e=[255,255,255,1],t=[0,153,255,1],i=3;return n.Polygon=[new rt({fill:new Vt({color:[255,255,255,.5]})})],n.MultiPolygon=n.Polygon,n.LineString=[new rt({stroke:new ti({color:e,width:i+2})}),new rt({stroke:new ti({color:t,width:i})})],n.MultiLineString=n.LineString,n.Circle=n.Polygon.concat(n.LineString),n.Point=[new rt({image:new pr({radius:i*2,fill:new Vt({color:t}),stroke:new ti({color:e,width:i/2})}),zIndex:1/0})],n.MultiPoint=n.Point,n.GeometryCollection=n.Polygon.concat(n.LineString,n.Point),n}function hg(n){return n.getGeometry()}const K_="#333";class Oa{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_=it(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 Vt({color:K_}),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 Oa({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()instanceof Vt?this.getFill().clone():this.getFill(),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_=it(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 Z_(n){return!0}function q_(n){const e=Zf(),t=Q_(n,e),i=eg();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=$f(r.getGeometry())),t(i)}}function ug(n){const e=Zf(),t=n.length,i=new Array(t);for(let o=0;o<t;++o)i[o]=Ch(n[o],e);const r=eg(),s=new Array(t);return function(o,a){if(r.properties=o.getPropertiesInternal(),r.resolution=a,e.featureId){const c=o.getId();c!==void 0?r.featureId=c:r.featureId=null}let l=0;for(let c=0;c<t;++c){const h=i[c](r);h&&(s[l]=h,l+=1)}return s.length=l,s}}function Q_(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r){const s=n[r],o="filter"in s?Wi(s.filter,wt,e):Z_;let a;if(Array.isArray(s.style)){const l=s.style.length;a=new Array(l);for(let c=0;c<l;++c)a[c]=Ch(s.style[c],e)}else a=[Ch(s.style,e)];i[r]={filter:o,styles:a}}return function(r){const s=[];let o=!1;for(let a=0;a<t;++a){const l=i[a].filter;if(l(r)&&!(n[a].else&&o)){o=!0;for(const c of i[a].styles){const h=c(r);h&&s.push(h)}}}return s}}function Ch(n,e){const t=vo(n,"",e),i=Co(n,"",e),r=J_(n,e),s=$_(n,e),o=Ft(n,"z-index",e);if(!t&&!i&&!r&&!s&&!un(n))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(n));const a=new rt;return function(l){let c=!0;if(t){const h=t(l);h&&(c=!1),a.setFill(h)}if(i){const h=i(l);h&&(c=!1),a.setStroke(h)}if(r){const h=r(l);h&&(c=!1),a.setText(h)}if(s){const h=s(l);h&&(c=!1),a.setImage(h)}return o&&a.setZIndex(o(l)),c?null:a}}function vo(n,e,t){let i;if(e+"fill-pattern-src"in n)i=nx(n,e+"fill-",t);else{if(n[e+"fill-color"]==="none")return s=>null;i=bh(n,e+"fill-color",t)}if(!i)return null;const r=new Vt;return function(s){const o=i(s);return o===ch?null:(r.setColor(o),r)}}function Co(n,e,t){const i=Ft(n,e+"stroke-width",t),r=bh(n,e+"stroke-color",t);if(!i&&!r)return null;const s=Yi(n,e+"stroke-line-cap",t),o=Yi(n,e+"stroke-line-join",t),a=dg(n,e+"stroke-line-dash",t),l=Ft(n,e+"stroke-line-dash-offset",t),c=Ft(n,e+"stroke-miter-limit",t),h=new ti;return function(u){if(r){const d=r(u);if(d===ch)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 J_(n,e){const t="text-",i=Yi(n,t+"value",e);if(!i)return null;const r=vo(n,t,e),s=vo(n,t+"background-",e),o=Co(n,t,e),a=Co(n,t+"background-",e),l=Yi(n,t+"font",e),c=Ft(n,t+"max-angle",e),h=Ft(n,t+"offset-x",e),u=Ft(n,t+"offset-y",e),d=cs(n,t+"overflow",e),g=Yi(n,t+"placement",e),f=Ft(n,t+"repeat",e),p=Ba(n,t+"scale",e),A=cs(n,t+"rotate-with-view",e),m=Ft(n,t+"rotation",e),y=Yi(n,t+"align",e),E=Yi(n,t+"justify",e),x=Yi(n,t+"baseline",e),_=cs(n,t+"keep-upright",e),w=dg(n,t+"padding",e),v=za(n,t+"declutter-mode"),C=new Oa({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 $_(n,e){return"icon-src"in n?ex(n,e):"shape-points"in n?tx(n,e):"circle-radius"in n?ix(n,e):null}function ex(n,e){const t="icon-",i=t+"src",r=Ag(n[i],i),s=Ga(n,t+"anchor",e),o=Ba(n,t+"scale",e),a=Ft(n,t+"opacity",e),l=Ga(n,t+"displacement",e),c=Ft(n,t+"rotation",e),h=cs(n,t+"rotate-with-view",e),u=gg(n,t+"anchor-origin"),d=pg(n,t+"anchor-x-units"),g=pg(n,t+"anchor-y-units"),f=ax(n,t+"color"),p=sx(n,t+"cross-origin"),A=ox(n,t+"offset"),m=gg(n,t+"offset-origin"),y=Na(n,t+"width"),E=Na(n,t+"height"),x=rx(n,t+"size"),_=za(n,t+"declutter-mode"),w=new Ar({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 tx(n,e){const t="shape-",i=t+"points",r=t+"radius",s=Th(n[i],i),o=Th(n[r],r),a=vo(n,t,e),l=Co(n,t,e),c=Ba(n,t+"scale",e),h=Ga(n,t+"displacement",e),u=Ft(n,t+"rotation",e),d=cs(n,t+"rotate-with-view",e),g=Na(n,t+"radius2"),f=Na(n,t+"angle"),p=za(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 ix(n,e){const t="circle-",i=vo(n,t,e),r=Co(n,t,e),s=Ft(n,t+"radius",e),o=Ba(n,t+"scale",e),a=Ga(n,t+"displacement",e),l=Ft(n,t+"rotation",e),c=cs(n,t+"rotate-with-view",e),h=za(n,t+"declutter-mode"),u=new pr({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 Ft(n,e,t){if(!(e in n))return;const i=Wi(n[e],ue,t);return function(r){return Th(i(r),e)}}function Yi(n,e,t){if(!(e in n))return null;const i=Wi(n[e],Pt,t);return function(r){return Ag(i(r),e)}}function nx(n,e,t){const i=Yi(n,e+"pattern-src",t),r=fg(n,e+"pattern-offset",t),s=fg(n,e+"pattern-size",t),o=bh(n,e+"color",t);return function(a){return{src:i(a),offset:r&&r(a),size:s&&s(a),color:o&&o(a)}}}function cs(n,e,t){if(!(e in n))return null;const i=Wi(n[e],wt,t);return function(r){const s=i(r);if(typeof s!="boolean")throw new Error(`Expected a boolean for ${e}`);return s}}function bh(n,e,t){if(!(e in n))return null;const i=Wi(n[e],hi,t);return function(r){return mg(i(r),e)}}function dg(n,e,t){if(!(e in n))return null;const i=Wi(n[e],dr,t);return function(r){return bo(i(r),e)}}function Ga(n,e,t){if(!(e in n))return null;const i=Wi(n[e],dr,t);return function(r){const s=bo(i(r),e);if(s.length!==2)throw new Error(`Expected two numbers for ${e}`);return s}}function fg(n,e,t){if(!(e in n))return null;const i=Wi(n[e],dr,t);return function(r){return yg(i(r),e)}}function Ba(n,e,t){if(!(e in n))return null;const i=Wi(n[e],dr|ue,t);return function(r){return lx(i(r),e)}}function Na(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 rx(n,e){const t=n[e];if(t!==void 0){if(typeof t=="number")return it(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 sx(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 gg(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 pg(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 ox(n,e){const t=n[e];if(t!==void 0)return bo(t,e)}function za(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 ax(n,e){const t=n[e];if(t!==void 0)return mg(t,e)}function bo(n,e){if(!Array.isArray(n))throw new Error(`Expected an array for ${e}`);const t=n.length;for(let i=0;i<t;++i)if(typeof n[i]!="number")throw new Error(`Expected an array of numbers for ${e}`);return n}function Ag(n,e){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);return n}function Th(n,e){if(typeof n!="number")throw new Error(`Expected a number for ${e}`);return n}function mg(n,e){if(typeof n=="string")return n;const t=bo(n,e),i=t.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return t}function yg(n,e){const t=bo(n,e);if(t.length!==2)throw new Error(`Expected an array of two numbers for ${e}`);return t}function lx(n,e){return typeof n=="number"?n:yg(n,e)}const _g={RENDER_ORDER:"renderOrder"};class Rh extends is{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(_g.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 Wf(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(_g.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?lg:e;const t=cx(e);this.styleFunction_=e===null?void 0:Y_(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}}function cx(n){if(n===void 0)return lg;if(!n)return null;if(typeof n=="function"||n instanceof rt)return n;if(!Array.isArray(n))return ug([n]);if(n.length===0)return[];const e=n.length,t=n[0];if(t instanceof rt){const r=new Array(e);for(let s=0;s<e;++s){const o=n[s];if(!(o instanceof rt))throw new Error("Expected a list of style instances");r[s]=o}return r}if("style"in t){const r=new Array(e);for(let s=0;s<e;++s){const o=n[s];if(!("style"in o))throw new Error("Expected a list of rules with a style property");r[s]=o}return q_(r)}return ug(n)}class xg extends Nt{constructor(e,t,i,r){super(e),this.inversePixelTransform=t,this.frameState=i,this.context=r}}class hx extends js{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){Q()}calculateMatrices2D(e){const t=e.viewState,i=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;Ti(i,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),gf(r,i)}forEachFeatureAtCoordinate(e,t,i,r,s,o,a,l){let c;const h=t.viewState;function u(x,_,w,v){return s.call(o,_,x?w:null,v)}const d=h.projection,g=gc(e.slice(),d),f=[[0,0]];if(d.canWrapX()&&r){const x=d.getExtent(),_=ne(x);f.push([-_,0],[_,0])}const p=t.layerStatesArray,A=p.length,m=[],y=[];for(let x=0;x<f.length;x++)for(let _=A-1;_>=0;--_){const w=p[_],v=w.layer;if(v.hasRenderer()&&oh(w,h)&&a.call(l,v)){const C=v.getRenderer(),b=v.getSource();if(C&&b){const T=b.getWrapX()?g:e,I=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,I,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,Wr,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(e){Q()}scheduleExpireIconCache(e){ei.canExpireCache()&&e.postRenderFunctions.push(ux)}}function ux(n,e){ei.expire()}class dx extends hx{constructor(e){super(e),this.fontChangeListenerKey_=ce(gr,Vr.PROPERTYCHANGE,e.redrawText,e),this.element_=ut?Df():document.createElement("div");const t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=ba+" ol-layers";const i=e.getViewport();i&&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 xg(e,void 0,t);i.dispatchEvent(r)}}disposeInternal(){Re(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($t.PRECOMPOSE,e);const t=e.layerStatesArray.sort((c,h)=>c.zIndex-h.zIndex);t.some(c=>c.layer instanceof Rh&&c.layer.getDeclutter())&&(e.declutter={});const r=e.viewState;this.children_.length=0;const s=[];let o=null;for(let c=0,h=t.length;c<h;++c){const u=t[c];e.layerIndex=c;const d=u.layer,g=d.getSourceState();if(!oh(u,r)||g!="ready"&&g!="undefined"){d.unrender();continue}const f=d.render(e,o);f&&(f!==o&&(this.children_.push(f),o=f),s.push(u))}this.declutter(e,s),b0(this.element_,this.children_);const l=this.getMap().getTargetElement();if(xn(l)){const c=l.getContext("2d");for(const h of this.children_){const u=h.firstElementChild||h,d=h.style.backgroundColor;if(d&&(!xn(u)||u.width>0)&&(c.fillStyle=d,c.fillRect(0,0,l.width,l.height)),xn(u)&&u.width>0){const g=h.style.opacity||u.style.opacity;c.globalAlpha=g===""?1:Number(g);const f=u.style.transform;if(f)c.setTransform(...Sc(f));else{const p=parseFloat(u.style.width)/u.width,A=parseFloat(u.style.height)/u.height;c.setTransform(p,0,0,A,0,0)}c.drawImage(u,0,0)}}c.globalAlpha=1,c.setTransform(1,0,0,1,0,0)}this.dispatchRenderEvent($t.POSTCOMPOSE,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}declutter(e,t){if(e.declutter){for(let i=t.length-1;i>=0;--i){const r=t[i],s=r.layer;s.getDeclutter()&&s.renderDeclutter(e,r)}t.forEach(i=>i.layer.renderDeferred(e))}}}function Eg(n){if(n instanceof is){n.setMapInternal(null);return}n instanceof Si&&n.getLayers().forEach(Eg)}function wg(n,e){if(n instanceof is){n.setMapInternal(e);return}if(n instanceof Si){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i)wg(t[i],e)}}let To=class extends Ci{constructor(e){super(),e=e||{},this.on,this.once,this.un;const t=fx(e);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading!==void 0?e.maxTilesLoading:16,this.pixelRatio_=e.pixelRatio!==void 0?e.pixelRatio:$m,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=St(),this.pixelToCoordinateTransform_=St(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,ut||(this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_)),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,ut||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=t.controls||(ut?new Rt:Gf()),this.interactions=t.interactions||(ut?new Rt:K0({onFocusOnly:!0})),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new zd(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 Ri)&&e.view.then(function(r){i.setView(new Ri(r))}),this.controls.addEventListener(pt.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(pt.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(pt.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(pt.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(pt.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(pt.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){wg(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(){var e;this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),(e=this.resizeObserver_)==null||e.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:Wr,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 Si?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:Wr,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 sr(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const t=this.frameState_;return t?$e(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 Rt){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<i;++t){const r=e[t];if(!r.visible)continue;const s=r.layer.getRenderer();if(s&&!s.ready)return!0;const o=r.layer.getSource();if(o&&o.loading)return!0}return!1}getPixelFromCoordinate(e){const t=je(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){const t=this.frameState_;return t?$e(t.coordinateToPixelTransform,e.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(At.SIZE)}getView(){return this.get(At.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,i,r){return ny(this.frameState_,e,t,i,r)}handleBrowserEvent(e,t){t=t||e.type;const i=new Ni(t,this,e);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(e){if(!this.frameState_)return;const t=e.originalEvent,i=t.type;if(i===rc.POINTERDOWN||i===K.WHEEL||i===K.KEYDOWN){const r=this.getOwnerDocument(),s=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o=t.target,a=s instanceof ShadowRoot?s.host===o?s.host.ownerDocument:s:s===r?r.documentElement:s;if(this.overlayContainerStopEvent_.contains(o)||!a.contains(o))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){const r=this.getInteractions().getArray().slice();for(let s=r.length-1;s>=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[De.ANIMATING]||o[De.INTERACTING]){const a=Date.now()-e.time>8;r=a?0:8,s=a?0:2}}t.getTilesLoading()<r&&(t.reprioritize(),t.loadMoreTiles(r,s))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener($t.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent($t.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new Xr(dn.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new Xr(dn.LOADSTART,this,e))));const i=this.postRenderFunctions_;if(e)for(let r=0,s=i.length;r<s;++r)i[r](this,e);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){var i,r;if(this.mapBrowserEventHandler_){for(let s=0,o=this.targetChangeHandlerKeys_.length;s<o;++s)Re(this.targetChangeHandlerKeys_[s]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(K.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(K.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!xn(this.targetElement_)){(i=this.resizeObserver_)==null||i.unobserve(this.targetElement_);const s=this.targetElement_.getRootNode();s instanceof ShadowRoot&&this.resizeObserver_.unobserve(s.host),this.setSize(void 0)}const e=this.getTarget(),t=typeof e=="string"?document.getElementById(e):e;if(this.targetElement_=t,!t)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{if(xn(t)||t.appendChild(this.viewport_),this.renderer_||(this.renderer_=new dx(this)),!xn(t)){this.mapBrowserEventHandler_=new ty(this,this.moveTolerance_);for(const o in he)this.mapBrowserEventHandler_.addEventListener(he[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(K.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(K.WHEEL,this.boundHandleBrowserEvent_,Nd?{passive:!1}:!1);let s;if(this.keyboardEventTarget_)s=this.keyboardEventTarget_;else{const o=t.getRootNode();s=o instanceof ShadowRoot?o.host:t}if(this.targetChangeHandlerKeys_=[ce(s,K.KEYDOWN,this.handleBrowserEvent,this),ce(s,K.KEYPRESS,this.handleBrowserEvent,this)],t instanceof HTMLElement){const o=t.getRootNode();o instanceof ShadowRoot&&this.resizeObserver_.observe(o.host),(r=this.resizeObserver_)==null||r.observe(t)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(Re(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Re(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=ce(e,Vr.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=ce(e,K.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Re),this.layerGroupPropertyListenerKeys_=null);const e=this.getLayerGroup();e&&(this.handleLayerAdd_(new vn("addlayer",e)),this.layerGroupPropertyListenerKeys_=[ce(e,Vr.PROPERTYCHANGE,this.render,this),ce(e,K.CHANGE,this.render,this),ce(e,"addlayer",this.handleLayerAdd_,this),ce(e,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){if(!this.frameState_)return;const e=this.frameState_.layerStatesArray;for(let t=0,i=e.length;t<i;++t){const r=e[t].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){Eg(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){const t=this.getSize(),i=this.getView(),r=this.frameState_;let s=null;if(t!==void 0&&Kf(t)&&i&&i.isDef()){const o=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=i.getState();if(s={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:aa(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:Y(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;s.nextExtent=aa(a.nextCenter,a.nextResolution,l,t)}}this.frameState_=s,this.renderer_.renderFrame(s),s&&(s.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,s.postRenderFunctions),r&&(!this.previousExtent_||!er(this.previousExtent_)&&!Vi(s.extent,this.previousExtent_))&&(this.dispatchEvent(new Xr(dn.MOVESTART,this,r)),this.previousExtent_=Yr(this.previousExtent_)),this.previousExtent_&&!s.viewHints[De.ANIMATING]&&!s.viewHints[De.INTERACTING]&&!Vi(s.extent,this.previousExtent_)&&(this.dispatchEvent(new Xr(dn.MOVEEND,this,s)),Vd(s.extent,this.previousExtent_))),this.dispatchEvent(new Xr(dn.POSTRENDER,this,s)),this.renderComplete_=(this.hasListener(dn.LOADSTART)||this.hasListener(dn.LOADEND)||this.hasListener($t.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){const t=this.getLayerGroup();t&&this.handleLayerRemove_(new vn("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 Ri){this.set(At.VIEW,e);return}this.set(At.VIEW,new Ri);const t=this;e.then(function(i){t.setView(new Ri(i))})}updateSize(){const e=this.getTargetElement();let t;if(e){let r,s;if(xn(e))r=e.width,s=e.height;else{const o=getComputedStyle(e);r=e.offsetWidth-parseFloat(o.borderLeftWidth)-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight)-parseFloat(o.borderRightWidth),s=e.offsetHeight-parseFloat(o.borderTopWidth)-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom)-parseFloat(o.borderBottomWidth)}!isNaN(r)&&!isNaN(s)&&(t=[Math.max(0,r),Math.max(0,s)],!Kf(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&qd("No map visible because the map container's width or height are 0."))}const i=this.getSize();t&&(!i||!Bi(t,i))&&(this.setSize(t),this.updateViewportSize_(t))}updateViewportSize_(e){const t=this.getView();t&&t.setViewportSize(e)}};function fx(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 Si({layers:n.layers});t[At.LAYERGROUP]=i,t[At.TARGET]=n.target,t[At.VIEW]=n.view instanceof Ri?n.view:new Ri;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new Rt(n.controls.slice()):(ye(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 Rt(n.interactions.slice()):(ye(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 Rt(n.overlays.slice()):(ye(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new Rt,{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:t}}class Wt extends Ci{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 Wt(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_&&(Re(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=ce(e,K.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?gx(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 gx(n){if(typeof n=="function")return n;let e;return Array.isArray(n)?e=n:(ye(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[n]),function(){return e}}function vg(n,e,t,i){const r=[];let s=jt();for(let o=0,a=t.length;o<a;++o){const l=t[o];s=lc(n,e,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=l[l.length-1]}return r}function ja(n,e,t,i,r,s,o){let a,l;const c=(t-e)/i;if(c===1)a=e;else if(c===2)a=e,l=r;else if(c!==0){let h=n[e],u=n[e+1],d=0;const g=[0];for(let A=e+i;A<t;A+=i){const m=n[A],y=n[A+1];d+=Math.sqrt((m-h)*(m-h)+(y-u)*(y-u)),g.push(d),h=m,u=y}const f=r*d,p=Xm(g,f);p<0?(l=(f-g[-p-2])/(g[-p-1]-g[-p-2]),a=e+(-p-2)*i):a=e+p*i}o=o>1?o:2,s=s||new Array(o);for(let h=0;h<o;++h)s[h]=a===void 0?NaN:l===void 0?n[a+h]:zt(n[a+h],n[a+i+h],l);return s}function Sh(n,e,t,i,r,s){if(t==e)return null;let o;if(r<n[e+i-1])return s?(o=n.slice(e,e+i),o[i-1]=r,o):null;if(n[t-1]<r)return s?(o=n.slice(t-i,t),o[i-1]=r,o):null;if(r==n[e+i-1])return n.slice(e,e+i);let a=e/i,l=t/i;for(;a<l;){const d=a+l>>1;r<n[(d+1)*i-1]?l=d:a=d+1}const c=n[a*i-1];if(r==c)return n.slice((a-1)*i,(a-1)*i+i);const h=n[(a+1)*i-1],u=(r-c)/(h-c);o=[];for(let d=0;d<i-1;++d)o.push(zt(n[(a-1)*i+d],n[a*i+d],u));return o.push(r),o}function px(n,e,t,i,r,s,o){if(o)return Sh(n,e,t[t.length-1],i,r,s);let a;if(r<n[i-1])return s?(a=n.slice(0,i),a[i-1]=r,a):null;if(n[n.length-1]<r)return s?(a=n.slice(n.length-i),a[i-1]=r,a):null;for(let l=0,c=t.length;l<c;++l){const h=t[l];if(e!=h){if(r<n[e+i-1])return null;if(r<=n[h-1])return Sh(n,e,h,i,r,!1);e=h}}return null}class Ua extends yn{constructor(e,t,i){super(),i!==void 0&&t===void 0?this.setFlatCoordinates(i,e):(t=t||0,this.setCenterAndRadius(e,t,i))}clone(){const e=new Ua(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=e-s[0],a=t-s[1],l=o*o+a*a;if(l<r){if(l===0)for(let c=0;c<this.stride;++c)i[c]=s[c];else{const c=this.getRadius()/Math.sqrt(l);i[0]=s[0]+c*o,i[1]=s[1]+c*a;for(let h=2;h<this.stride;++h)i[h]=s[h]}return i.length=this.stride,l}return r}containsXY(e,t){const i=this.flatCoordinates,r=e-i[0],s=t-i[1];return r*r+s*s<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){const t=this.flatCoordinates,i=t[this.stride]-t[0];return bi(t[0]-i,t[1]-i,t[0]+i,t[1]+i,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return"Circle"}intersectsExtent(e){const t=this.getExtent();if(ze(e,t)){const i=this.getCenter();return e[0]<=i[0]&&e[2]>=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:hc(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;s<t;++s)r[t+s]=e[s];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,i){this.setLayout(i,e,0),this.flatCoordinates||(this.flatCoordinates=[]);const r=this.flatCoordinates;let s=xf(r,0,e,this.stride);r[s++]=r[0]+t;for(let o=1,a=this.stride;o<a;++o)r[s++]=r[o];r.length=s,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){const i=this.getCenter(),r=this.getStride();this.setCenter(Ic(i,0,i.length,r,e,t,i)),this.changed()}}Ua.prototype.transform;class Ro extends Af{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Re),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const e=this.geometries_;for(let t=0,i=e.length;t<i;++t)this.changeEventsKeys_.push(ce(e[t],K.CHANGE,this.changed,this))}clone(){const e=new Ro(Ih(this.geometries_));return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<Jn(this.getExtent(),e,t))return r;const s=this.geometries_;for(let o=0,a=s.length;o<a;++o)r=s[o].closestPointXY(e,t,i,r);return r}containsXY(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)if(i[r].containsXY(e,t))return!0;return!1}computeExtent(e){Yr(e);const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)cc(e,t[i].getExtent());return e}getGeometries(){return Ih(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[];const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)t[i].getType()===this.getType()?e=e.concat(t[i].getGeometriesArrayRecursive()):e.push(t[i]);return e}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=[],i=this.geometries_;let r=!1;for(let s=0,o=i.length;s<o;++s){const a=i[s],l=a.getSimplifiedGeometry(e);t.push(l),l!==a&&(r=!0)}return r?new Ro(t):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getType(){return"GeometryCollection"}intersectsExtent(e){const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)if(t[i].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].rotate(e,t);this.changed()}scale(e,t,i){i||(i=Ut(this.getExtent()));const r=this.geometries_;for(let s=0,o=r.length;s<o;++s)r[s].scale(e,t,i);this.changed()}setGeometries(e){this.setGeometriesArray(Ih(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)t[i].applyTransform(e);this.changed()}translate(e,t){const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function Ih(n){return n.map(e=>e.clone())}function Ph(n,e,t,i){let r=n[e],s=n[e+1],o=0;for(let a=e+i;a<t;a+=i){const l=n[a],c=n[a+1];o+=Math.sqrt((l-r)*(l-r)+(c-s)*(c-s)),r=l,s=c}return o}class ii extends yn{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){vi(this.flatCoordinates,e),this.changed()}clone(){const e=new ii(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Jn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Pc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))}forEachSegment(e){return Cf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return this.layout!="XYM"&&this.layout!="XYZM"?null:(t=t!==void 0?t:!1,Sh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return _n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return ja(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return Ph(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const t=[];return t.length=xa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new ii(t,"XY")}getType(){return"LineString"}intersectsExtent(e){return Ea(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_a(this.flatCoordinates,0,e,this.stride),this.changed()}}class bn extends yn{constructor(e,t,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&i)this.setFlatCoordinates(t,e),this.ends_=i;else{const r=e,s=[],o=[];for(let l=0,c=r.length;l<c;++l){const h=r[l];vi(s,h.getFlatCoordinates()),o.push(s.length)}const a=r.length===0?this.getLayout():r[0].getLayout();this.setFlatCoordinates(a,s),this.ends_=o}}appendLineString(e){vi(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new bn(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Jn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Mc(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Lc(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))}getCoordinateAtM(e,t,i){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(t=t!==void 0?t:!1,i=i!==void 0?i:!1,px(this.flatCoordinates,0,this.ends_,this.stride,e,t,i))}getCoordinates(){return io(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new ii(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){const e=this.flatCoordinates,t=this.ends_,i=this.layout,r=[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=t[o],c=new ii(e.slice(s,l),i);r.push(c),s=l}return r}getLength(){const e=this.ends_;let t=0,i=0;for(let r=0,s=e.length;r<s;++r)i+=Ph(this.flatCoordinates,t,e[r],this.stride),t=e[r];return i}getFlatMidpoints(){const e=[],t=this.flatCoordinates;let i=0;const r=this.ends_,s=this.stride;for(let o=0,a=r.length;o<a;++o){const l=r[o],c=ja(t,i,l,s,.5);vi(e,c),i=l}return e}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=wf(this.flatCoordinates,0,this.ends_,this.stride,e,t,0,i),new bn(t,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(e){return d0(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=to(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class mr extends yn{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){vi(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){const e=new mr(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<Jn(this.getExtent(),e,t))return r;const s=this.flatCoordinates,o=this.stride;for(let a=0,l=s.length;a<l;a+=o){const c=zi(e,t,s[a],s[a+1]);if(c<r){r=c;for(let h=0;h<o;++h)i[h]=s[a+h];i.length=o}}return r}getCoordinates(){return _n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new It(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){const e=this.flatCoordinates,t=this.layout,i=this.stride,r=[];for(let s=0,o=e.length;s<o;s+=i){const a=new It(e.slice(s,s+i),t);r.push(a)}return r}getType(){return"MultiPoint"}intersectsExtent(e){const t=this.flatCoordinates,i=this.stride;for(let r=0,s=t.length;r<s;r+=i){const o=t[r],a=t[r+1];if(oc(e,o,a))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=_a(this.flatCoordinates,0,e,this.stride),this.changed()}}class Tn extends yn{constructor(e,t,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(e[0])){const r=e,s=[],o=[];for(let a=0,l=r.length;a<l;++a){const c=r[a],h=s.length,u=c.getEnds();for(let d=0,g=u.length;d<g;++d)u[d]+=h;vi(s,c.getFlatCoordinates()),o.push(u)}t=r.length===0?this.getLayout():r[0].getLayout(),e=s,i=o}t!==void 0&&i?(this.setFlatCoordinates(t,e),this.endss_=i):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{const i=this.flatCoordinates.length;vi(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let r=0,s=t.length;r<s;++r)t[r]+=i}this.endss_.push(t),this.changed()}clone(){const e=this.endss_.length,t=new Array(e);for(let r=0;r<e;++r)t[r]=this.endss_[r].slice();const i=new Tn(this.flatCoordinates.slice(),this.layout,t);return i.applyProperties(this),i}closestPointXY(e,t,i,r){return r<Jn(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(o0(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),a0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return u0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return s0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),zc(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,kc(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=vg(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=vf(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new mr(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Rf(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=zc(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=c0(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),t,0,i),new Tn(t,"XY",i)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{const s=this.endss_[e-1];t=s[s.length-1]}const i=this.endss_[e].slice(),r=i[i.length-1];if(t!==0)for(let s=0,o=i.length;s<o;++s)i[s]-=t;return new Jt(this.flatCoordinates.slice(t,r),this.layout,i)}getPolygons(){const e=this.layout,t=this.flatCoordinates,i=this.endss_,r=[];let s=0;for(let o=0,a=i.length;o<a;++o){const l=i[o].slice(),c=l[l.length-1];if(s!==0)for(let u=0,d=l.length;u<d;++u)l[u]-=s;const h=new Jt(t.slice(s,c),e,l);r.push(h),s=c}return r}getType(){return"MultiPolygon"}intersectsExtent(e){return f0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Ef(this.flatCoordinates,0,e,this.stride,this.endss_);if(i.length===0)this.flatCoordinates.length=0;else{const r=i[i.length-1];this.flatCoordinates.length=r.length===0?0:r[r.length-1]}this.changed()}}const Cg=St();class ht{constructor(e,t,i,r,s,o){this.styleFunction,this.extent_,this.id_=o,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=s,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?Ys(this.flatCoordinates_):lc(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=Ut(this.getExtent());this.flatInteriorPoints_=Gc(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=jc(this.flatCoordinates_,this.ends_),t=vg(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=vf(this.flatCoordinates_,0,e,2,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=ja(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const e=this.flatCoordinates_;let t=0;const i=this.ends_;for(let r=0,s=i.length;r<s;++r){const o=i[r],a=ja(e,t,o,2,.5);vi(this.flatMidpoints_,a),t=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=_e(e);const t=e.getExtent(),i=e.getWorldExtent();if(t&&i){const r=Oe(i)/Oe(t);Ti(Cg,i[0],i[3],r,-r,0,0,0),mn(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Cg,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var e;return new ht(this.type_,this.flatCoordinates_.slice(),(e=this.ends_)==null?void 0:e.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=kd((e,t)=>{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=xa(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=wf(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,i,0,r);break;case"Polygon":r=[],i.length=Dc(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),i,0,r);break}return r&&(this.simplifiedGeometry_=new ht(this.type_,i,r,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}ht.prototype.getFlatCoordinates=ht.prototype.getOrientedFlatCoordinates;function Ax(n){const e=n.getType();switch(e){case"Point":return new It(n.getFlatCoordinates());case"MultiPoint":return new mr(n.getFlatCoordinates(),"XY");case"LineString":return new ii(n.getFlatCoordinates(),"XY");case"MultiLineString":return new bn(n.getFlatCoordinates(),"XY",n.getEnds());case"Polygon":const t=n.getFlatCoordinates(),i=n.getEnds(),r=jc(t,i);return r.length>1?new Tn(t,"XY",r):new Jt(t,"XY",i);default:throw new Error("Invalid geometry type:"+e)}}function bg(n,e){const t=n.getId(),i=Ax(n),r=n.getProperties(),s=new Wt;return s.setGeometry(i),t!==void 0&&s.setId(t),s.setProperties(r,!0),s}class Tg{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Wt,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let i=t.dataProjection?_e(t.dataProjection):this.readProjection(e);t.extent&&i&&i.getUnits()==="tile-pixels"&&(i=_e(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 Va(n,e,t){const i=t?_e(t.featureProjection):null,r=t?_e(t.dataProjection):null;let s=n;if(i&&r&&!tt(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(rr(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;c<h;++c)l[c]=Math.round(l[c]*o)/o;return l};s===n&&(s=n.clone()),s.applyTransform(a)}return s}const mx={Point:It,LineString:ii,Polygon:Jt,MultiPoint:mr,MultiLineString:bn,MultiPolygon:Tn};function yx(n,e,t){return Array.isArray(e[0])?(Rf(n,0,e,t)||(n=n.slice(),zc(n,0,e,t)),n):(Nc(n,0,e,t)||(n=n.slice(),wa(n,0,e,t)),n)}function Rg(n,e){var s;const t=n.geometry;if(!t)return[];if(Array.isArray(t))return t.map(o=>Rg({...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 Va(new ht(i,i==="Polygon"?yx(t.flatCoordinates,t.ends,r):t.flatCoordinates,(s=t.ends)==null?void 0:s.flat(),r,n.properties||{},n.id).enableSimplifyTransformed(),!1,e)}function Mh(n,e){if(!n)return null;if(Array.isArray(n)){const i=n.map(r=>Mh(r,e));return new Ro(i)}const t=mx[n.type];return Va(new t(n.flatCoordinates,n.layout||"XY",n.ends),!1,e)}class _x extends Tg{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 Fh extends _x{constructor(e){e=e||{},super(),this.dataProjection=_e(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=_e(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=Lh(i.geometry);if(this.featureClass===ht)return Rg({geometry:r,id:i.id,properties:i.properties},t);const s=new Wt;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&i.geometry_name&&s.setGeometryName(i.geometry_name),s.setGeometry(Mh(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<l;++a){const c=this.readFeatureFromObject(o[a],t);c&&r.push(c)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return xx(e,t)}readProjectionFromObject(e){const t=e.crs;let i;if(t)if(t.type=="name")i=_e(t.properties.name);else if(t.type==="EPSG")i=_e("EPSG:"+t.properties.code);else throw new Error("Unknown SRS type");else i=this.dataProjection;return i}writeFeatureObject(e,t){t=this.adaptOptions(t);const i={type:"Feature",geometry:null,properties:null},r=e.getId();if(r!==void 0&&(i.id=r),!e.hasProperties())return i;const s=e.getProperties(),o=e.getGeometry();return o&&(i.geometry=kh(o,t),delete s[e.getGeometryName()]),un(s)||(i.properties=s),i}writeFeaturesObject(e,t){t=this.adaptOptions(t);const i=[];for(let r=0,s=e.length;r<s;++r)i.push(this.writeFeatureObject(e[r],t));return{type:"FeatureCollection",features:i}}writeGeometryObject(e,t){return kh(e,this.adaptOptions(t))}}function Lh(n,e){if(!n)return null;let t;switch(n.type){case"Point":{t=wx(n);break}case"LineString":{t=vx(n);break}case"Polygon":{t=Rx(n);break}case"MultiPoint":{t=bx(n);break}case"MultiLineString":{t=Cx(n);break}case"MultiPolygon":{t=Tx(n);break}case"GeometryCollection":{t=Ex(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return t}function xx(n,e){const t=Lh(n);return Mh(t,e)}function Ex(n,e){return n.geometries.map(function(i){return Lh(i)})}function wx(n){const e=n.coordinates;return{type:"Point",flatCoordinates:e,layout:or(e.length)}}function vx(n){var i;const e=n.coordinates,t=e.flat();return{type:"LineString",flatCoordinates:t,ends:[t.length],layout:or(((i=e[0])==null?void 0:i.length)||2)}}function Cx(n){var s,o;const e=n.coordinates,t=((o=(s=e[0])==null?void 0:s[0])==null?void 0:o.length)||2,i=[],r=to(i,0,e,t);return{type:"MultiLineString",flatCoordinates:i,ends:r,layout:or(t)}}function bx(n){var t;const e=n.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:or(((t=e[0])==null?void 0:t.length)||2)}}function Tx(n){var s,o;const e=n.coordinates,t=[],i=((o=(s=e[0])==null?void 0:s[0])==null?void 0:o[0].length)||2,r=Ef(t,0,e,i);return{type:"MultiPolygon",flatCoordinates:t,ends:r,layout:or(i)}}function Rx(n){var s,o;const e=n.coordinates,t=[],i=(o=(s=e[0])==null?void 0:s[0])==null?void 0:o.length,r=to(t,0,e,i);return{type:"Polygon",flatCoordinates:t,ends:r,layout:or(i)}}function kh(n,e){n=Va(n,!0,e);const t=n.getType();let i;switch(t){case"Point":{i=Lx(n);break}case"LineString":{i=Ix(n);break}case"Polygon":{i=kx(n,e);break}case"MultiPoint":{i=Mx(n);break}case"MultiLineString":{i=Px(n);break}case"MultiPolygon":{i=Fx(n,e);break}case"GeometryCollection":{i=Sx(n,e);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return i}function Sx(n,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:n.getGeometriesArray().map(function(i){return kh(i,e)})}}function Ix(n,e){return{type:"LineString",coordinates:n.getCoordinates()}}function Px(n,e){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function Mx(n,e){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function Fx(n,e){let t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(t)}}function Lx(n,e){return{type:"Point",coordinates:n.getCoordinates()}}function kx(n,e){let t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(t)}}var Dx=8,Ox={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Gx={"*":{type:"source"}},Bx=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Nx={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},zx={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},jx={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Ux={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Vx={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Wx={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Hx={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},Xx=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],Yx={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Kx={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Zx={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},qx={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Qx={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Jx={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},$x={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},e1={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},t1={type:"array",value:"*"},i1={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},n1={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},r1={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},s1={type:"array",value:"*",minimum:1},o1={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}},a1={"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}},l1={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},c1={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},h1=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],u1={"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"}},d1={"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"}},f1={"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"}},g1={"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"}},p1={"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"}},A1={"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"}},m1={"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},y1={"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"}},_1={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},x1={"*":{type:"string"}},E1={$version:Dx,$root:Ox,sources:Gx,source:Bx,source_vector:Nx,source_raster:zx,source_raster_dem:jx,source_geojson:Ux,source_video:Vx,source_image:Wx,layer:Hx,layout:Xx,layout_background:Yx,layout_fill:Kx,layout_circle:Zx,layout_heatmap:qx,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Qx,layout_symbol:Jx,layout_raster:$x,layout_hillshade:e1,"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:t1,filter_operator:i1,geometry_type:n1,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:r1,expression:s1,light:o1,sky:a1,terrain:l1,projection:c1,paint:h1,paint_fill:u1,"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:d1,paint_circle:f1,paint_heatmap:g1,paint_symbol:p1,paint_raster:A1,paint_hillshade:m1,"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:y1,transition:_1,"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:x1};const w1=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function v1(n,e){const t={};for(const i in n)i!=="ref"&&(t[i]=n[i]);return w1.forEach(i=>{i in e&&(t[i]=e[i])}),t}function Sg(n){n=n.slice();const e=Object.create(null);for(let t=0;t<n.length;t++)e[n[t].id]=n[t];for(let t=0;t<n.length;t++)"ref"in n[t]&&(n[t]=v1(n[t],e[n[t].ref]));return n}class Pi extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class Dh{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[i,r]of t)this.bindings[i]=r}concat(e){return new Dh(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}}const Ha={kind:"null"},N={kind:"number"},ie={kind:"string"},ee={kind:"boolean"},Mi={kind:"color"},Xa={kind:"projectionDefinition"},yr={kind:"object"},$={kind:"value"},C1={kind:"error"},Ya={kind:"collator"},Ka={kind:"formatted"},Za={kind:"padding"},So={kind:"colorArray"},qa={kind:"numberArray"},Io={kind:"resolvedImage"},Qa={kind:"variableAnchorOffsetCollection"};function Ht(n,e){return{kind:"array",itemType:n,N:e}}function Ge(n){if(n.kind==="array"){const e=Ge(n.itemType);return typeof n.N=="number"?`array<${e}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${e}>`}else return n.kind}const b1=[Ha,N,ie,ee,Mi,Xa,Ka,yr,Ht($),Za,qa,So,Io,Qa];function Po(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Po(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 b1)if(!Po(t,e))return null}}return`Expected ${Ge(n)} but found ${Ge(e)} instead.`}function Oh(n,e){return e.some(t=>t.kind===n.kind)}function _r(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 Rn(n,e){return n.kind==="array"&&e.kind==="array"?n.itemType.kind===e.itemType.kind&&typeof n.N=="number":n.kind===e.kind}const Ig=.96422,Pg=1,Mg=.82521,Fg=4/29,hs=6/29,Lg=3*hs*hs,T1=hs*hs*hs,R1=Math.PI/180,S1=180/Math.PI;function kg(n){return n=n%360,n<0&&(n+=360),n}function Dg([n,e,t,i]){n=Gh(n),e=Gh(e),t=Gh(t);let r,s;const o=Bh((.2225045*n+.7168786*e+.0606169*t)/Pg);n===e&&e===t?r=s=o:(r=Bh((.4360747*n+.3850649*e+.1430804*t)/Ig),s=Bh((.0139322*n+.0971045*e+.7141733*t)/Mg));const a=116*o-16;return[a<0?0:a,500*(r-o),200*(o-s),i]}function Gh(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Bh(n){return n>T1?Math.pow(n,1/3):n/Lg+Fg}function Og([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=Pg*zh(r),s=Ig*zh(s),o=Mg*zh(o),[Nh(3.1338561*s-1.6168667*r-.4906146*o),Nh(-.9787684*s+1.9161415*r+.033454*o),Nh(.0719453*s-.2289914*r+1.4052427*o),i]}function Nh(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 zh(n){return n>hs?n*n*n:Lg*(n-Fg)}function I1(n){const[e,t,i,r]=Dg(n),s=Math.sqrt(t*t+i*i);return[Math.round(s*1e4)?kg(Math.atan2(i,t)*S1):NaN,s,e,r]}function P1([n,e,t,i]){return n=isNaN(n)?0:n*R1,Og([t,Math.cos(n)*e,Math.sin(n)*e,i])}function M1([n,e,t,i]){n=kg(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]}const F1=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Gg(n,e){return F1(n,e)?n[e]:void 0}function L1(n){if(n=n.toLowerCase().trim(),n==="transparent")return[0,0,0,0];const e=Gg(k1,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[Ja(n.slice(o,o+=s)),Ja(n.slice(o,o+=s)),Ja(n.slice(o,o+=s)),Ja(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 _=[us(+a/x,0,1),us(+h/x,0,1),us(+g/x,0,1),A?Bg(+A,m):1];if(Ng(_))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,us(+a,0,100),us(+c,0,100),u?Bg(+u,d):1];if(Ng(f))return M1(f)}}}function Ja(n){return parseInt(n.padEnd(2,n),16)/255}function Bg(n,e){return us(e?n/100:n,0,1)}function us(n,e,t){return Math.min(Math.max(e,n),t)}function Ng(n){return!n.some(Number.isNaN)}const k1={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 xr(n,e,t){return n+t*(e-n)}function Mo(n,e,t){return n.map((i,r)=>xr(i,e[r],t))}class we{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 we)return e;if(typeof e!="string")return;const t=L1(e);if(t)return new we(...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",I1(this.rgb))}get lab(){return this.overwriteGetter("lab",Dg(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]=Mo(e.rgb,t.rgb,i);return new we(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:c<s&&s-c>180&&(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]=P1([g,f??xr(o,h,i),xr(a,u,i),xr(l,d,i)]);return new we(p,A,m,y,!1)}case"lab":{const[s,o,a,l]=Og(Mo(e.lab,t.lab,i));return new we(s,o,a,l,!1)}}}}we.black=new we(0,0,0,1),we.white=new we(1,1,1,1),we.transparent=new we(0,0,0,0),we.red=new we(1,0,0,1);class jh{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 D1=["bottom","center","top"];class Uh{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 Ki{constructor(e){this.sections=e}static fromString(e){return new Ki([new Uh(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 Ki?e:Ki.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class di{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof di)return e;if(typeof e=="number")return new di([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 di(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){return new di(Mo(e.values,t.values,i))}}class fi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof fi)return e;if(typeof e=="number")return new fi([e]);if(Array.isArray(e)){for(const t of e)if(typeof t!="number")return;return new fi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){return new fi(Mo(e.values,t.values,i))}}class Xt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Xt)return e;if(typeof e=="string"){const i=we.parse(e);return i?new Xt([i]):void 0}if(!Array.isArray(e))return;const t=[];for(const i of e){if(typeof i!="string")return;const r=we.parse(i);if(!r)return;t.push(r)}return new Xt(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i,r="rgb"){const s=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let o=0;o<e.values.length;o++)s.push(we.interpolate(e.values[o],t.values[o],i,r));return new Xt(s)}}class Ue extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const O1=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Fi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Fi)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let t=0;t<e.length;t+=2){const i=e[t],r=e[t+1];if(typeof i!="string"||!O1.has(i)||!Array.isArray(r)||r.length!==2||typeof r[0]!="number"||typeof r[1]!="number")return}return new Fi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){const r=e.values,s=t.values;if(r.length!==s.length)throw new Ue(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const o=[];for(let a=0;a<r.length;a+=2){if(r[a]!==s[a])throw new Ue(`Cannot interpolate values containing mismatched anchors. from[${a}]: ${r[a]}, to[${a}]: ${s[a]}`);o.push(r[a]);const[l,c]=r[a+1],[h,u]=s[a+1];o.push([xr(l,h,i),xr(c,u,i)])}return new Fi(o)}}class Sn{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Sn({name:e,available:!1}):null}}class gi{constructor(e,t,i){this.from=e,this.to=t,this.transition=i}static interpolate(e,t,i){return new gi(e,t,i)}static parse(e){if(e instanceof gi)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new gi(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new gi(e.from,e.to,e.transition);if(typeof e=="string")return new gi(e,e,1)}}function zg(n,e,t,i){return typeof n=="number"&&n>=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 Fo(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof gi||n instanceof we||n instanceof jh||n instanceof Ki||n instanceof di||n instanceof fi||n instanceof Xt||n instanceof Fi||n instanceof Sn)return!0;if(Array.isArray(n)){for(const e of n)if(!Fo(e))return!1;return!0}else if(typeof n=="object"){for(const e in n)if(!Fo(n[e]))return!1;return!0}else return!1}function et(n){if(n===null)return Ha;if(typeof n=="string")return ie;if(typeof n=="boolean")return ee;if(typeof n=="number")return N;if(n instanceof we)return Mi;if(n instanceof gi)return Xa;if(n instanceof jh)return Ya;if(n instanceof Ki)return Ka;if(n instanceof di)return Za;if(n instanceof fi)return qa;if(n instanceof Xt)return So;if(n instanceof Fi)return Qa;if(n instanceof Sn)return Io;if(Array.isArray(n)){const e=n.length;let t;for(const i of n){const r=et(i);if(!t)t=r;else{if(t===r)continue;t=$;break}}return Ht(t||$,e)}else return yr}function Lo(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof we||n instanceof gi||n instanceof Ki||n instanceof di||n instanceof fi||n instanceof Xt||n instanceof Fi||n instanceof Sn?n.toString():JSON.stringify(n)}class ds{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(!Fo(e[1]))return t.error("invalid value");const i=e[1];let r=et(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 ds(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const $a={string:ie,number:N,boolean:ee,object:yr};class pi{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 $a)||c==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=$a[c],i++}else a=$;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=Ht(a,l)}else{if(!$a[s])throw new Error(`Types doesn't contain name = ${s}`);r=$a[s]}const o=[];for(;i<e.length;i++){const a=t.parse(e[i],i,$);if(!a)return null;o.push(a)}return new pi(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const i=this.args[t].evaluate(e);if(Po(this.type,et(i))){if(t===this.args.length-1)throw new Ue(`Expected value to be of type ${Ge(this.type)}, but found ${Ge(et(i))} instead.`)}else return i}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const jg={"to-boolean":ee,"to-color":Mi,"to-number":N,"to-string":ie};class In{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(!jg[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=jg[i],s=[];for(let o=1;o<e.length;o++){const a=t.parse(e[o],o,$);if(!a)return null;s.push(a)}return new In(r,s)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,i;for(const r of this.args){if(t=r.evaluate(e),i=null,t instanceof we)return t;if(typeof t=="string"){const s=e.parseColor(t);if(s)return s}else if(Array.isArray(t)&&(t.length<3||t.length>4?i=`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:i=zg(t[0],t[1],t[2],t[3]),!i))return new we(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ue(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=di.parse(t);if(r)return r}throw new Ue(`Could not parse padding from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const i of this.args){t=i.evaluate(e);const r=fi.parse(t);if(r)return r}throw new Ue(`Could not parse numberArray from value '${typeof t=="string"?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const i of this.args){t=i.evaluate(e);const r=Xt.parse(t);if(r)return r}throw new Ue(`Could not parse colorArray 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=Fi.parse(t);if(r)return r}throw new Ue(`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 Ue(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Ki.fromString(Lo(this.args[0].evaluate(e)));case"resolvedImage":return Sn.fromString(Lo(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return Lo(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const G1=["Unknown","Point","LineString","Polygon"];class Ug{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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"?G1[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.get(e);return t||(t=we.parse(e),this._parseColorCache.set(e,t)),t}}class el{constructor(e,t,i=[],r,s=new Dh,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 pi(s,[r]):o==="coerce"?new In(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"&&["string","array"].includes(l.kind)||["color","formatted","resolvedImage"].includes(a.kind)&&["value","string"].includes(l.kind)||["padding","numberArray"].includes(a.kind)&&["value","number","array"].includes(l.kind)||a.kind==="colorArray"&&["value","string","array"].includes(l.kind)||a.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(l.kind))o=i(o,a,t.typeAnnotation||"coerce");else if(this.checkSubtype(a,l))return null}if(!(o instanceof ds)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){const a=new Ug;try{o=new ds(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 el(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 Pi(i,e))}checkSubtype(e,t){const i=Po(e,t);return i&&this.error(i),i}}class tl{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<e.length-1;s+=2){const o=e[s];if(typeof o!="string")return t.error(`Expected string, but found ${typeof o} instead.`,s);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",s);const a=t.parse(e[s+1],s+1);if(!a)return null;i.push([o,a])}const r=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return r?new tl(i,r):null}outputDefined(){return this.result.outputDefined()}}class il{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");const i=e[1];return t.scope.has(i)?new il(i,t.scope.get(i)):t.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Vh{constructor(e,t,i){this.type=e,this.index=t,this.input=i}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,N),r=t.parse(e[2],2,Ht(t.expectedType||$));if(!i||!r)return null;const s=r.type;return new Vh(s.itemType,i,r)}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new Ue(`Array index out of bounds: ${t} < 0.`);if(t>=i.length)throw new Ue(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t!==Math.floor(t))throw new Ue(`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 Wh{constructor(e,t){this.type=ee,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,$),r=t.parse(e[2],2,$);return!i||!r?null:Oh(i.type,[ee,ie,N,Ha,$])?new Wh(i,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(i.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!_r(t,["boolean","string","number","null"]))throw new Ue(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(et(t))} instead.`);if(!_r(i,["string","array"]))throw new Ue(`Expected second argument to be of type array or string, but found ${Ge(et(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class nl{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,$),r=t.parse(e[2],2,$);if(!i||!r)return null;if(!Oh(i.type,[ee,ie,N,Ha,$]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,N);return s?new nl(i,r,s):null}else return new nl(i,r)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!_r(t,["boolean","string","number","null"]))throw new Ue(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(et(t))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),_r(i,["string"])){const s=i.indexOf(t,r);return s===-1?-1:[...i.slice(0,s)].length}else{if(_r(i,["array"]))return i.indexOf(t,r);throw new Ue(`Expected second argument to be of type array or string, but found ${Ge(et(i))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Hh{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;c<e.length-1;c+=2){let h=e[c];const u=e[c+1];Array.isArray(h)||(h=[h]);const d=t.concat(c);if(h.length===0)return d.error("Expected at least one branch label.");for(const f of h){if(typeof f!="number"&&typeof f!="string")return d.error("Branch labels must be numbers or strings.");if(typeof f=="number"&&Math.abs(f)>Number.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=et(f);else if(d.checkSubtype(i,et(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,$);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 Hh(i,r,a,s,o,l)}evaluate(e){const t=this.input.evaluate(e);return(et(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 Xh{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;o<e.length-1;o+=2){const a=t.parse(e[o],o,ee);if(!a)return null;const l=t.parse(e[o+1],o+1,i);if(!l)return null;r.push([a,l]),i=i||l.type}const s=t.parse(e[e.length-1],e.length-1,i);if(!s)return null;if(!i)throw new Error("Can't infer output type");return new Xh(i,r,s)}evaluate(e){for(const[t,i]of this.branches)if(t.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,i]of this.branches)e(t),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}}class rl{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,$),r=t.parse(e[2],2,N);if(!i||!r)return null;if(!Oh(i.type,[Ht($),ie,$]))return t.error(`Expected first argument to be of type array or string, but found ${Ge(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,N);return s?new rl(i.type,i,r,s):null}else return new rl(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)),_r(t,["string"]))return[...t].slice(i,r).join("");if(_r(t,["array"]))return t.slice(i,r);throw new Ue(`Expected first argument to be of type array or string, but found ${Ge(et(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Vg(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||e<a)return s;i=s+1}else if(o>e)r=s-1;else throw new Ue("Input is not a number.");return 0}class sl{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<e.length;o+=2){const a=o===1?-1/0:e[o],l=e[o+1],c=o,h=o+1;if(typeof a!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(r.length&&r[r.length-1][0]>=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 sl(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=Vg(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 B1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Yh,Wg;function N1(){if(Wg)return Yh;Wg=1,Yh=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)<t)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i=i-s/o}var a=0,l=1;for(i=e,r=0;r<20&&(s=this.sampleCurveX(i),!(Math.abs(s-e)<t));r++)e>s?a=i:l=i,i=(l-a)*.5+a;return i},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},Yh}var z1=N1(),j1=B1(z1);class Li{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=Kh(t,e.base,i,r);else if(e.name==="linear")s=Kh(t,1,i,r);else if(e.name==="cubic-bezier"){const o=e.controlPoints;s=new j1(o[0],o[1],o[2],o[3]).solve(Kh(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")&&t.expectedType!=So?l=Mi:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let c=0;c<o.length;c+=2){const h=o[c],u=o[c+1],d=c+3,g=c+4;if(typeof h!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',d);if(a.length&&a[a.length-1][0]>=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!Rn(l,N)&&!Rn(l,Xa)&&!Rn(l,Mi)&&!Rn(l,Za)&&!Rn(l,qa)&&!Rn(l,So)&&!Rn(l,Qa)&&!Rn(l,Ht(N))?t.error(`Type ${Ge(l)} is not interpolatable.`):new Li(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=Vg(t,r),a=t[o],l=t[o+1],c=Li.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 xr(h,u,c);case"color":return we.interpolate(h,u,c);case"padding":return di.interpolate(h,u,c);case"colorArray":return Xt.interpolate(h,u,c);case"numberArray":return fi.interpolate(h,u,c);case"variableAnchorOffsetCollection":return Fi.interpolate(h,u,c);case"array":return Mo(h,u,c);case"projectionDefinition":return gi.interpolate(h,u,c)}case"interpolate-hcl":switch(this.type.kind){case"color":return we.interpolate(h,u,c,"hcl");case"colorArray":return Xt.interpolate(h,u,c,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return we.interpolate(h,u,c,"lab");case"colorArray":return Xt.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 Kh(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 ko{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=>Po(r,a.type))?new ko($,s):new ko(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 Sn&&!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 Hg(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 U1(n,e,t){return e===t}function V1(n,e,t){return e!==t}function W1(n,e,t){return e<t}function H1(n,e,t){return e>t}function X1(n,e,t){return e<=t}function Y1(n,e,t){return e>=t}function Xg(n,e,t,i){return i.compare(e,t)===0}function K1(n,e,t,i){return!Xg(n,e,t,i)}function Z1(n,e,t,i){return i.compare(e,t)<0}function q1(n,e,t,i){return i.compare(e,t)>0}function Q1(n,e,t,i){return i.compare(e,t)<=0}function J1(n,e,t,i){return i.compare(e,t)>=0}function fs(n,e,t){const i=n!=="=="&&n!=="!=";return class rm{constructor(s,o,a){this.type=ee,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,$);if(!l)return null;if(!Hg(a,l.type))return o.concat(1).error(`"${a}" comparisons are not supported for type '${Ge(l.type)}'.`);let c=o.parse(s[2],2,$);if(!c)return null;if(!Hg(a,c.type))return o.concat(2).error(`"${a}" comparisons are not supported for type '${Ge(c.type)}'.`);if(l.type.kind!==c.type.kind&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error(`Cannot compare types '${Ge(l.type)}' and '${Ge(c.type)}'.`);i&&(l.type.kind==="value"&&c.type.kind!=="value"?l=new pi(c.type,[l]):l.type.kind!=="value"&&c.type.kind==="value"&&(c=new pi(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,Ya),!h)return null}return new rm(l,c,h)}evaluate(s){const o=this.lhs.evaluate(s),a=this.rhs.evaluate(s);if(i&&this.hasUntypedArgument){const l=et(o),c=et(a);if(l.kind!==c.kind||!(l.kind==="string"||l.kind==="number"))throw new Ue(`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=et(o),c=et(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 $1=fs("==",U1,Xg),eE=fs("!=",V1,K1),tE=fs("<",W1,Z1),iE=fs(">",H1,q1),nE=fs("<=",X1,Q1),rE=fs(">=",Y1,J1);class ol{constructor(e,t,i){this.type=Ya,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,ee);if(!r)return null;const s=t.parse(i["diacritic-sensitive"]===void 0?!1:i["diacritic-sensitive"],1,ee);if(!s)return null;let o=null;return i.locale&&(o=t.parse(i.locale,1,ie),!o)?null:new ol(r,s,o)}evaluate(e){return new jh(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 Zh{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 Zh(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 qh{constructor(e){this.type=Ka,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,Ht(ie)),!c))return null;let h=null;if(a["text-color"]&&(h=t.parse(a["text-color"],1,Mi),!h))return null;let u=null;if(a["vertical-align"]){if(typeof a["vertical-align"]=="string"&&!D1.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,$);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 qh(r)}evaluate(e){const t=i=>{const r=i.content.evaluate(e);return et(r)===Io?new Uh("",r,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new Uh(Lo(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 Ki(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 Qh{constructor(e){this.type=Io,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 Qh(i):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),i=Sn.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}}class Jh{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 ${Ge(i.type)} instead.`):new Jh(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 Ue(`Expected value to be of type string or array, but found ${Ge(et(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const ki=8192;function sE(n,e){const t=oE(n[0]),i=lE(n[1]),r=Math.pow(2,e.z);return[Math.round(t*r*ki),Math.round(i*r*ki)]}function $h(n,e){const t=Math.pow(2,e.z),i=(n[0]/ki+e.x)/t,r=(n[1]/ki+e.y)/t;return[aE(i),cE(r)]}function oE(n){return(180+n)/360}function aE(n){return n*360-180}function lE(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function cE(n){return 360/Math.PI*Math.atan(Math.exp((180-n*360)*Math.PI/180))-90}function Do(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 Oo(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function hE(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 uE(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 al(n,e,t,i){const r=[e[0]-n[0],e[1]-n[1]],s=[i[0]-t[0],i[1]-t[1]];return pE(s,r)===0?!1:!!(Kg(n,e,t,i)&&Kg(t,i,n,e))}function dE(n,e,t){for(const i of t)for(let r=0;r<i.length-1;++r)if(al(n,e,i[r],i[r+1]))return!0;return!1}function gs(n,e,t=!1){let i=!1;for(const r of e)for(let s=0;s<r.length-1;s++){if(uE(n,r[s],r[s+1]))return t;hE(n,r[s],r[s+1])&&(i=!i)}return i}function fE(n,e){for(const t of e)if(gs(n,t))return!0;return!1}function Yg(n,e){for(const t of n)if(!gs(t,e))return!1;for(let t=0;t<n.length-1;++t)if(dE(n[t],n[t+1],e))return!1;return!0}function gE(n,e){for(const t of e)if(Yg(n,t))return!0;return!1}function pE(n,e){return n[0]*e[1]-n[1]*e[0]}function Kg(n,e,t,i){const r=n[0]-t[0],s=n[1]-t[1],o=e[0]-t[0],a=e[1]-t[1],l=i[0]-t[0],c=i[1]-t[1],h=r*c-l*s,u=o*c-l*a;return h>0&&u<0||h<0&&u>0}function eu(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=[];for(let o=0;o<n[r].length;o++){const a=sE(n[r][o],t);Do(e,a),s.push(a)}i.push(s)}return i}function Zg(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=eu(n[r],e,t);i.push(s)}return i}function qg(n,e,t,i){if(n[0]<t[0]||n[0]>t[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}Do(e,n)}function AE(n){n[0]=n[1]=1/0,n[2]=n[3]=-1/0}function Qg(n,e,t,i){const r=Math.pow(2,i.z)*ki,s=[i.x*ki,i.y*ki],o=[];for(const a of n)for(const l of a){const c=[l.x+s[0],l.y+s[1]];qg(c,e,t,r),o.push(c)}return o}function Jg(n,e,t,i){const r=Math.pow(2,i.z)*ki,s=[i.x*ki,i.y*ki],o=[];for(const a of n){const l=[];for(const c of a){const h=[c.x+s[0],c.y+s[1]];Do(e,h),l.push(h)}o.push(l)}if(e[2]-e[0]<=r/2){AE(e);for(const a of o)for(const l of a)qg(l,e,t,r)}return o}function mE(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=eu(e.coordinates,i,r),o=Qg(n.geometry(),t,i,r);if(!Oo(t,i))return!1;for(const a of o)if(!gs(a,s))return!1}if(e.type==="MultiPolygon"){const s=Zg(e.coordinates,i,r),o=Qg(n.geometry(),t,i,r);if(!Oo(t,i))return!1;for(const a of o)if(!fE(a,s))return!1}return!0}function yE(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=eu(e.coordinates,i,r),o=Jg(n.geometry(),t,i,r);if(!Oo(t,i))return!1;for(const a of o)if(!Yg(a,s))return!1}if(e.type==="MultiPolygon"){const s=Zg(e.coordinates,i,r),o=Jg(n.geometry(),t,i,r);if(!Oo(t,i))return!1;for(const a of o)if(!gE(a,s))return!1}return!0}class Er{constructor(e,t){this.type=ee,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(Fo(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 Er(i,s)}}else if(i.type==="Feature"){const r=i.geometry.type;if(r==="Polygon"||r==="MultiPolygon")return new Er(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new Er(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 mE(e,this.geometries);if(e.geometryType()==="LineString")return yE(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class $g{constructor(e=[],t=(i,r)=>i<r?-1:i>r?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<r;){let o=(e<<1)+1;const a=o+1;if(a<this.length&&i(t[a],t[o])<0&&(o=a),i(t[o],s)>=0)break;t[e]=t[o],e=o}t[e]=s}}function _E(n,e){if(n.length<=1)return[n];const i=[];let r,s;for(const o of n){const a=xE(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 xE(n){let e=0;for(let t=0,i=n.length,r=i-1,s,o;t<i;r=t++)s=n[t],o=n[r],e+=(o.x-s.x)*(s.y+o.y);return e}const EE=6378.137,ep=1/298.257223563,tp=ep*(2-ep),ip=Math.PI/180;class tu{constructor(e){const t=ip*EE*1e3,i=Math.cos(e*ip),r=1/(1-tp*(1-i*i)),s=Math.sqrt(r);this.kx=t*s*i,this.ky=t*s*r*(1-tp)}distance(e,t){const i=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(e,t){let i=1/0,r,s,o,a;for(let l=0;l<e.length-1;l++){let c=e[l][0],h=e[l][1],u=this.wrap(e[l+1][0]-c)*this.kx,d=(e[l+1][1]-h)*this.ky,g=0;(u!==0||d!==0)&&(g=(this.wrap(t[0]-c)*this.kx*u+(t[1]-h)*this.ky*d)/(u*u+d*d),g>1?(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;f<i&&(i=f,r=c,s=h,o=l,a=g)}return{point:[r,s],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}const iu=100,nu=50;function np(n,e){return e[0]-n[0]}function ll(n){return n[1]-n[0]+1}function Zi(n,e){return n[1]>=n[0]&&n[1]<e}function ru(n,e){if(n[0]>n[1])return[null,null];const t=ll(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 su(n,e){if(!Zi(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)Do(t,n[i]);return t}function ou(n){const e=[1/0,1/0,-1/0,-1/0];for(const t of n)for(const i of t)Do(e,i);return e}function rp(n){return n[0]!==-1/0&&n[1]!==-1/0&&n[2]!==1/0&&n[3]!==1/0}function au(n,e,t){if(!rp(n)||!rp(e))return NaN;let i=0,r=0;return n[2]<e[0]&&(i=e[0]-n[2]),n[0]>e[2]&&(i=n[0]-e[2]),n[1]>e[3]&&(r=n[1]-e[3]),n[3]<e[1]&&(r=e[1]-n[3]),t.distance([0,0],[i,r])}function wr(n,e,t){const i=t.pointOnLine(e,n);return t.distance(n,i.point)}function lu(n,e,t,i,r){const s=Math.min(wr(n,[t,i],r),wr(e,[t,i],r)),o=Math.min(wr(t,[n,e],r),wr(i,[n,e],r));return Math.min(s,o)}function wE(n,e,t,i,r){if(!(Zi(e,n.length)&&Zi(i,t.length)))return 1/0;let o=1/0;for(let a=e[0];a<e[1];++a){const l=n[a],c=n[a+1];for(let h=i[0];h<i[1];++h){const u=t[h],d=t[h+1];if(al(l,c,u,d))return 0;o=Math.min(o,lu(l,c,u,d,r))}}return o}function vE(n,e,t,i,r){if(!(Zi(e,n.length)&&Zi(i,t.length)))return NaN;let o=1/0;for(let a=e[0];a<=e[1];++a)for(let l=i[0];l<=i[1];++l)if(o=Math.min(o,r.distance(n[a],t[l])),o===0)return o;return o}function CE(n,e,t){if(gs(n,e,!0))return 0;let i=1/0;for(const r of e){const s=r[0],o=r[r.length-1];if(s!==o&&(i=Math.min(i,wr(n,[o,s],t)),i===0))return i;const a=t.pointOnLine(r,n);if(i=Math.min(i,t.distance(n,a.point)),i===0)return i}return i}function bE(n,e,t,i){if(!Zi(e,n.length))return NaN;for(let s=e[0];s<=e[1];++s)if(gs(n[s],t,!0))return 0;let r=1/0;for(let s=e[0];s<e[1];++s){const o=n[s],a=n[s+1];for(const l of t)for(let c=0,h=l.length,u=h-1;c<h;u=c++){const d=l[u],g=l[c];if(al(o,a,d,g))return 0;r=Math.min(r,lu(o,a,d,g,i))}}return r}function sp(n,e){for(const t of n)for(const i of t)if(gs(i,e,!0))return!0;return!1}function TE(n,e,t,i=1/0){const r=ou(n),s=ou(e);if(i!==1/0&&au(r,s,t)>=i)return i;if(Oo(r,s)){if(sp(n,e))return 0}else if(sp(e,n))return 0;let o=1/0;for(const a of n)for(let l=0,c=a.length,h=c-1;l<c;h=l++){const u=a[h],d=a[l];for(const g of e)for(let f=0,p=g.length,A=p-1;f<p;A=f++){const m=g[A],y=g[f];if(al(u,d,m,y))return 0;o=Math.min(o,lu(u,d,m,y,t))}}return o}function op(n,e,t,i,r,s){if(!s)return;const o=au(su(i,s),r,t);o<e&&n.push([o,s,[0,0]])}function cl(n,e,t,i,r,s,o){if(!s||!o)return;const a=au(su(i,s),su(r,o),t);a<e&&n.push([a,s,o])}function hl(n,e,t,i,r=1/0){let s=Math.min(i.distance(n[0],t[0][0]),r);if(s===0)return s;const o=new $g([[0,[0,n.length-1],[0,0]]],np),a=ou(t);for(;o.length>0;){const l=o.pop();if(l[0]>=s)continue;const c=l[1],h=e?nu:iu;if(ll(c)<=h){if(!Zi(c,n.length))return NaN;if(e){const u=bE(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=CE(n[u],t,i);if(s=Math.min(s,d),s===0)return 0}}else{const u=ru(c,e);op(o,s,i,n,a,u[0]),op(o,s,i,n,a,u[1])}}return s}function ul(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]]],np);for(;a.length>0;){const l=a.pop();if(l[0]>=o)continue;const c=l[1],h=l[2],u=e?nu:iu,d=i?nu:iu;if(ll(c)<=u&&ll(h)<=d){if(!Zi(c,n.length)&&Zi(h,t.length))return NaN;let g;if(e&&i)g=wE(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=wr(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=wr(n[p],f,r),o=Math.min(o,g),o===0)return o}else g=vE(n,c,t,h,r),o=Math.min(o,g)}else{const g=ru(c,e),f=ru(h,i);cl(a,o,r,n,t,g[0],f[0]),cl(a,o,r,n,t,g[0],f[1]),cl(a,o,r,n,t,g[1],f[0]),cl(a,o,r,n,t,g[1],f[1])}}return o}function RE(n,e){const t=n.geometry(),i=t.flat().map(o=>$h([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new tu(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,ul(i,!1,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,ul(i,!1,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,hl(i,!1,o.coordinates,r,s));break}if(s===0)return s}return s}function SE(n,e){const t=n.geometry(),i=t.flat().map(o=>$h([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new tu(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,ul(i,!0,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,ul(i,!0,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,hl(i,!0,o.coordinates,r,s));break}if(s===0)return s}return s}function IE(n,e){const t=n.geometry();if(t.length===0||t[0].length===0)return NaN;const i=_E(t).map(o=>o.map(a=>a.map(l=>$h([l.x,l.y],n.canonical)))),r=new tu(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,hl([o.coordinates],!1,a,r,s));break;case"LineString":s=Math.min(s,hl(o.coordinates,!0,a,r,s));break;case"Polygon":s=Math.min(s,TE(a,o.coordinates,r,s));break}if(s===0)return s}return s}function cu(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 vr{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(Fo(e[1])){const i=e[1];if(i.type==="FeatureCollection")return new vr(i,i.features.map(r=>cu(r.geometry)).flat());if(i.type==="Feature")return new vr(i,cu(i.geometry));if("type"in i&&"coordinates"in i)return new vr(i,cu(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 RE(e,this.geometries);if(e.geometryType()==="LineString")return SE(e,this.geometries);if(e.geometryType()==="Polygon")return IE(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Go{constructor(e){this.type=$,this.key=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const i=e[1];return i==null?t.error("Global state property must be defined."):typeof i!="string"?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Go(i)}evaluate(e){var t;const i=(t=e.globals)===null||t===void 0?void 0:t.globalState;return!i||Object.keys(i).length===0?null:Gg(i,this.key)}eachChild(){}outputDefined(){return!1}}const dl={"==":$1,"!=":eE,">":iE,"<":tE,">=":rE,"<=":nE,array:pi,at:Vh,boolean:pi,case:Xh,coalesce:ko,collator:ol,format:qh,image:Qh,in:Wh,"index-of":nl,interpolate:Li,"interpolate-hcl":Li,"interpolate-lab":Li,length:Jh,let:tl,literal:ds,match:Hh,number:pi,"number-format":Zh,object:pi,slice:rl,step:sl,string:pi,"to-boolean":In,"to-color":In,"to-number":In,"to-string":In,var:il,within:Er,distance:vr,"global-state":Go};class Yt{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=Yt.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 el(t.registry,fl,t.path,null,t.scope);const u=[];let d=!1;for(let g=1;g<e.length;g++){const f=e[g],p=Array.isArray(c)?c[g-1]:c.type,A=l.parse(f,1+u.length,p);if(!A){d=!0;break}u.push(A)}if(!d){if(Array.isArray(c)&&c.length!==u.length){l.error(`Expected ${c.length} arguments, but found ${u.length} instead.`);continue}for(let g=0;g<u.length;g++){const f=Array.isArray(c)?c[g]:c.type,p=u[g];l.concat(g+1).checkSubtype(f,p.type)}if(l.errors.length===0)return new Yt(i,s,h,u)}}if(a.length===1)t.errors.push(...l.errors);else{const h=(a.length?a:o).map(([d])=>ME(d)).join(" | "),u=[];for(let d=1;d<e.length;d++){const g=t.parse(e[d],1+u.length);if(!g)return null;u.push(Ge(g.type))}t.error(`Expected arguments of type ${h}, but found (${u.join(", ")}) instead.`)}return null}static register(e,t){Yt.definitions=t;for(const i in t)e[i]=Yt}}function ap(n,[e,t,i,r]){e=e.evaluate(n),t=t.evaluate(n),i=i.evaluate(n);const s=r?r.evaluate(n):1,o=zg(e,t,i,s);if(o)throw new Ue(o);return new we(e/255,t/255,i/255,s,!1)}function lp(n,e){return n in e}function hu(n,e){const t=e[n];return typeof t>"u"?null:t}function PE(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 Cr(n){return{type:n}}Yt.register(dl,{error:[C1,[ie],(n,[e])=>{throw new Ue(e.evaluate(n))}],typeof:[ie,[$],(n,[e])=>Ge(et(e.evaluate(n)))],"to-rgba":[Ht(N,4),[Mi],(n,[e])=>{const[t,i,r,s]=e.evaluate(n).rgb;return[t*255,i*255,r*255,s]}],rgb:[Mi,[N,N,N],ap],rgba:[Mi,[N,N,N,N],ap],has:{type:ee,overloads:[[[ie],(n,[e])=>lp(e.evaluate(n),n.properties())],[[ie,yr],(n,[e,t])=>lp(e.evaluate(n),t.evaluate(n))]]},get:{type:$,overloads:[[[ie],(n,[e])=>hu(e.evaluate(n),n.properties())],[[ie,yr],(n,[e,t])=>hu(e.evaluate(n),t.evaluate(n))]]},"feature-state":[$,[ie],(n,[e])=>hu(e.evaluate(n),n.featureState||{})],properties:[yr,[],n=>n.properties()],"geometry-type":[ie,[],n=>n.geometryType()],id:[$,[],n=>n.id()],zoom:[N,[],n=>n.globals.zoom],"heatmap-density":[N,[],n=>n.globals.heatmapDensity||0],elevation:[N,[],n=>n.globals.elevation||0],"line-progress":[N,[],n=>n.globals.lineProgress||0],accumulated:[$,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[N,Cr(N),(n,e)=>{let t=0;for(const i of e)t+=i.evaluate(n);return t}],"*":[N,Cr(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,Cr(N),(n,e)=>Math.min(...e.map(t=>t.evaluate(n)))],max:[N,Cr(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-==":[ee,[ie,$],(n,[e,t])=>n.properties()[e.value]===t.value],"filter-id-==":[ee,[$],(n,[e])=>n.id()===e.value],"filter-type-==":[ee,[ie],(n,[e])=>n.geometryType()===e.value],"filter-<":[ee,[ie,$],(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->":[ee,[ie,$],(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-<=":[ee,[ie,$],(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->=":[ee,[ie,$],(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":[ee,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[ee,[Ht(ie)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[ee,[Ht($)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[ee,[ie,Ht($)],(n,[e,t])=>t.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[ee,[ie,Ht($)],(n,[e,t])=>PE(n.properties()[e.value],t.value,0,t.value.length-1)],all:{type:ee,overloads:[[[ee,ee],(n,[e,t])=>e.evaluate(n)&&t.evaluate(n)],[Cr(ee),(n,e)=>{for(const t of e)if(!t.evaluate(n))return!1;return!0}]]},any:{type:ee,overloads:[[[ee,ee],(n,[e,t])=>e.evaluate(n)||t.evaluate(n)],[Cr(ee),(n,e)=>{for(const t of e)if(t.evaluate(n))return!0;return!1}]]},"!":[ee,[ee],(n,[e])=>!e.evaluate(n)],"is-supported-script":[ee,[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,Cr($),(n,e)=>e.map(t=>Lo(t.evaluate(n))).join("")],"resolved-locale":[ie,[Ya],(n,[e])=>e.evaluate(n).resolvedLocale()]});function ME(n){return Array.isArray(n)?`(${n.map(Ge).join(", ")})`:`(${Ge(n.type)}...)`}function fl(n){if(n instanceof il)return fl(n.boundExpression);if(n instanceof Yt&&n.name==="error")return!1;if(n instanceof ol)return!1;if(n instanceof Er)return!1;if(n instanceof vr)return!1;if(n instanceof Go)return!1;const e=n instanceof In||n instanceof pi;let t=!0;return n.eachChild(i=>{e?t=t&&fl(i):t=t&&i instanceof ds}),t?uu(n)&&fu(n,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function uu(n){if(n instanceof Yt){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 Er||n instanceof vr)return!1;let e=!0;return n.eachChild(t=>{e&&!uu(t)&&(e=!1)}),e}function du(n){if(n instanceof Yt&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(t=>{e&&!du(t)&&(e=!1)}),e}function fu(n,e){if(n instanceof Yt&&e.indexOf(n.name)>=0)return!1;let t=!0;return n.eachChild(i=>{t&&!fu(i,e)&&(t=!1)}),t}function gu(n){return{result:"success",value:n}}function ps(n){return{result:"error",value:n}}function FE(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function LE(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function kE(n){return!!n.expression&&n.expression.interpolated}function cp(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&et(n)===yr}class DE{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Ug,this._defaultValue=t?NE(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 Ue(`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 OE(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in dl}function hp(n,e){const t=new el(dl,fl,[],e?BE(e):void 0),i=t.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return i?gu(new DE(i,e)):ps(t.errors)}class up{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!du(t.expression),this.globalStateRefs=pl(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 dp{constructor(e,t,i,r){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!du(t.expression),this.globalStateRefs=pl(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?Li.interpolationFactor(this.interpolationType,e,t,i):0}}function GE(n,e){const t=hp(n,e);if(t.result==="error")return t;const i=t.value.expression,r=uu(i);if(!r&&!FE(e))return ps([new Pi("","data expressions not supported")]);const s=fu(i,["zoom"]);if(!s&&!LE(e))return ps([new Pi("","zoom expressions not supported")]);const o=gl(i);if(!o&&!s)return ps([new Pi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Pi)return ps([o]);if(o instanceof Li&&!kE(e))return ps([new Pi("",'"interpolate" expressions cannot be used with this property')]);if(!o)return gu(r?new up("constant",t.value):new up("source",t.value));const a=o instanceof Li?o.interpolation:void 0;return gu(r?new dp("camera",t.value,o.labels,a):new dp("composite",t.value,o.labels,a))}function gl(n){let e=null;if(n instanceof tl)e=gl(n.result);else if(n instanceof ko){for(const t of n.args)if(e=gl(t),e)break}else(n instanceof sl||n instanceof Li)&&n.input instanceof Yt&&n.input.name==="zoom"&&(e=n);return e instanceof Pi||n.eachChild(t=>{const i=gl(t);i instanceof Pi?e=i:!e&&i?e=new Pi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Pi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function pl(n,e=new Set){return n instanceof Go&&e.add(n.key),n.eachChild(t=>{pl(t,e)}),e}function BE(n){const e={color:Mi,string:ie,number:N,enum:ie,boolean:ee,formatted:Ka,padding:Za,numberArray:qa,colorArray:So,projectionDefinition:Xa,resolvedImage:Io,variableAnchorOffsetCollection:Qa};return n.type==="array"?Ht(e[n.value]||$,n.length):e[n.type]}function NE(n){if(n.type==="color"&&cp(n.default))return new we(0,0,0,0);switch(n.type){case"color":return we.parse(n.default)||null;case"padding":return di.parse(n.default)||null;case"numberArray":return fi.parse(n.default)||null;case"colorArray":return Xt.parse(n.default)||null;case"variableAnchorOffsetCollection":return Fi.parse(n.default)||null;case"projectionDefinition":return gi.parse(n.default)||null;default:return n.default===void 0?null:n.default}}function fp(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(!fp(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const zE={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function jE(n){if(n==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};fp(n)||(n=Al(n));const e=hp(n,zE);if(e.result==="error")throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));{const t=gp(n);return{filter:(i,r,s)=>e.value.evaluate(i,r,{},s),needGeometry:t,getGlobalStateRefs:()=>pl(e.value.expression)}}}function UE(n,e){return n<e?-1:n>e?1:0}function gp(n){if(!Array.isArray(n))return!1;if(n[0]==="within"||n[0]==="distance")return!0;for(let e=1;e<n.length;e++)if(gp(n[e]))return!0;return!1}function Al(n){if(!n)return!0;const e=n[0];return n.length<=1?e!=="any":e==="=="?pu(n[1],n[2],"=="):e==="!="?ml(pu(n[1],n[2],"==")):e==="<"||e===">"||e==="<="||e===">="?pu(n[1],n[2],e):e==="any"?VE(n.slice(1)):e==="all"?["all"].concat(n.slice(1).map(Al)):e==="none"?["all"].concat(n.slice(1).map(Al).map(ml)):e==="in"?pp(n[1],n.slice(2)):e==="!in"?ml(pp(n[1],n.slice(2))):e==="has"?Ap(n[1]):e==="!has"?ml(Ap(n[1])):!0}function pu(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 VE(n){return["any"].concat(n.map(Al))}function pp(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(UE)]]:["filter-in-small",n,["literal",e]]}}function Ap(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function ml(n){return["!",n]}function Bo(n){return typeof n=="object"?["literal",n]:n}function WE(n,e){let t=n.stops;if(!t)return HE(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],ZE(o[1])]:[o[0],Bo(o[1])]),i?XE(n,e,t):s?KE(n,e,t):mu(n,e,t)}function HE(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,Bo(n.default)];return e.type==="array"&&i.splice(1,0,e.value,e.length||null),i}}function Au(n){switch(n.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function XE(n,e,t){const i={},r={},s=[];for(let a=0;a<t.length;a++){const l=t[a],c=l[0].zoom;i[c]===void 0&&(i[c]={zoom:c,type:n.type,property:n.property,default:n.default},r[c]=[],s.push(c)),r[c].push([l[0].value,l[1]])}if(_u({},e)==="exponential"){const a=[Au(n),["linear"],["zoom"]];for(const l of s){const c=mu(i[l],e,r[l]);As(a,l,c,!1)}return a}else{const a=["step",["zoom"]];for(const l of s){const c=mu(i[l],e,r[l]);As(a,l,c,!0)}return yu(a),a}}function YE(n,e){if(n!==void 0)return n;if(e!==void 0)return e}function mp(n,e){const t=Bo(YE(n.default,e.default));return t===void 0&&e.type==="resolvedImage"?"":t}function mu(n,e,t){const i=_u(n,e),r=["get",n.property];if(i==="categorical"&&typeof t[0][0]=="boolean"){const s=["case"];for(const o of t)s.push(["==",r,o[0]],o[1]);return s.push(mp(n,e)),s}else if(i==="categorical"){const s=["match",r];for(const o of t)As(s,o[0],o[1],!1);return s.push(mp(n,e)),s}else if(i==="interval"){const s=["step",["number",r]];for(const o of t)As(s,o[0],o[1],!0);return yu(s),n.default===void 0?s:["case",["==",["typeof",r],"number"],s,Bo(n.default)]}else if(i==="exponential"){const s=n.base!==void 0?n.base:1,o=[Au(n),s===1?["linear"]:["exponential",s],["number",r]];for(const a of t)As(o,a[0],a[1],!1);return n.default===void 0?o:["case",["==",["typeof",r],"number"],o,Bo(n.default)]}else throw new Error(`Unknown property function type ${i}`)}function KE(n,e,t,i=["zoom"]){const r=_u(n,e);let s,o=!1;if(r==="interval")s=["step",i],o=!0;else if(r==="exponential"){const a=n.base!==void 0?n.base:1;s=[Au(n),a===1?["linear"]:["exponential",a],i]}else throw new Error(`Unknown zoom function type "${r}"`);for(const a of t)As(s,a[0],a[1],o);return yu(s),s}function yu(n){n[0]==="step"&&n.length===3&&(n.push(0),n.push(n[3]))}function As(n,e,t,i){n.length>3&&e===n[n.length-2]||(i&&n.length===2||n.push(e),n.push(t))}function _u(n,e){return n.type?n.type:e.expression.interpolated?"exponential":"interval"}function ZE(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(i<n.length)e.push(n.slice(i));else if(e.length===2)return["to-string",e[1]];return e}const qE=E1;var yp={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},No=" ",_p=/(italic|oblique)$/i,xp={};function xu(n,e,t){var i=xp[n];if(!i){Array.isArray(n)||(n=[n]);for(var r=400,s="normal",o=[],a,l,c=0,h=n.length;c<h;++c){var u=n[c],d=u.split(" "),g=d[d.length-1].toLowerCase();g=="normal"||g=="italic"||g=="oblique"?(s=l?s:g,l=!0,d.pop(),g=d[d.length-1].toLowerCase()):_p.test(g)&&(g=g.replace(_p,""),s=l?s:d[d.length-1].replace(g,""),l=!0);for(var f in yp){var p=d.length>1?d[d.length-2].toLowerCase():"";if(g==f||g==f.replace("-","")||p+"-"+g==f){r=a?r:yp[f],d.pop(),p&&f.startsWith(p)&&d.pop();break}}!a&&typeof g=="number"&&(r=g,a=!0);var A=d.join(No).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");A.indexOf(No)!==-1&&(A='"'+A+'"'),o.push(A)}i=xp[n]=[s,r,o]}return i[0]+No+i[1]+No+e+"px"+(t?"/"+t:"")+No+i[2]}class Ep{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 QE extends Ep{constructor(e,t,i,r,s,o,a){super(),this.context_=e,this.pixelRatio_=t,this.extent_=i,this.transform_=r,this.transformRotation_=r?Xs(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_=St()}drawImages_(e,t,i,r){if(!this.image_)return;const s=mn(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;h<u;h+=2){const d=s[h]-this.imageAnchorX_,g=s[h+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const f=d+this.imageAnchorX_,p=g+this.imageAnchorY_;Ti(a,f,p,1,1,c,-f,-p),o.save(),o.transform.apply(o,a),o.translate(f,p),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.restore()}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,g,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(o.globalAlpha=l)}drawText_(e,t,i,r){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const s=mn(e,t,i,r,this.transform_,this.pixelCoordinates_),o=this.context_;let a=this.textRotation_;for(this.transformRotation_===0&&(a-=this.viewRotation_),this.textRotateWithView_&&(a+=this.viewRotation_);t<i;t+=r){const l=s[t]+this.textOffsetX_,c=s[t+1]+this.textOffsetY_;a!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(o.save(),o.translate(l-this.textOffsetX_,c-this.textOffsetY_),o.rotate(a),o.translate(this.textOffsetX_,this.textOffsetY_),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.restore()):(this.textStrokeState_&&o.strokeText(this.text_,l,c),this.textFillState_&&o.fillText(this.text_,l,c))}}moveToLineTo_(e,t,i,r,s){const o=this.context_,a=mn(e,t,i,r,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);let l=a.length;s&&(l-=2);for(let c=2;c<l;c+=2)o.lineTo(a[c],a[c+1]);return s&&o.closePath(),i}drawRings_(e,t,i,r){for(let s=0,o=i.length;s<o;++s)t=this.moveToLineTo_(e,t,i[s],r,!0);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ze(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=r0(e,this.transform_,this.pixelCoordinates_),i=t[2]-t[0],r=t[3]-t[1],s=Math.sqrt(i*i+r*r),o=this.context_;o.beginPath(),o.arc(t[0],t[1],s,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}this.text_!==""&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case"Point":this.drawPoint(e);break;case"LineString":this.drawLineString(e);break;case"Polygon":this.drawPolygon(e);break;case"MultiPoint":this.drawMultiPoint(e);break;case"MultiLineString":this.drawMultiLineString(e);break;case"MultiPolygon":this.drawMultiPolygon(e);break;case"GeometryCollection":this.drawGeometryCollection(e);break;case"Circle":this.drawCircle(e);break}}drawFeature(e,t){const i=t.getGeometryFunction()(e);i&&(this.setStyle(t),this.drawGeometry(i))}drawGeometryCollection(e){const t=e.getGeometriesArray();for(let i=0,r=t.length;i<r;++i)this.drawGeometry(t[i])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(t,0,t.length,i),this.text_!==""&&this.drawText_(t,0,t.length,i)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getFlatCoordinates(),i=e.getStride();this.image_&&this.drawImages_(t,0,t.length,i),this.text_!==""&&this.drawText_(t,0,t.length,i)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ze(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const t=this.context_,i=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(i,0,i.length,e.getStride(),!1),t.stroke()}if(this.text_!==""){const t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const t=e.getExtent();if(ze(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,r=e.getFlatCoordinates();let s=0;const o=e.getEnds(),a=e.getStride();i.beginPath();for(let l=0,c=o.length;l<c;++l)s=this.moveToLineTo_(r,s,o[l],a,!1);i.stroke()}if(this.text_!==""){const i=e.getFlatMidpoints();this.drawText_(i,0,i.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ze(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=this.context_;t.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride()),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==""){const t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!ze(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=this.context_,i=e.getOrientedFlatCoordinates();let r=0;const s=e.getEndss(),o=e.getStride();t.beginPath();for(let a=0,l=s.length;a<l;++a){const c=s[a];r=this.drawRings_(i,r,c,o)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==""){const t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){const t=this.context_,i=this.contextFillState_;i?i.fillStyle!=e.fillStyle&&(i.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){const t=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=e.lineCap&&(i.lineCap=e.lineCap,t.lineCap=e.lineCap),Bi(i.lineDash,e.lineDash)||t.setLineDash(i.lineDash=e.lineDash),i.lineDashOffset!=e.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset),i.lineJoin!=e.lineJoin&&(i.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),i.lineWidth!=e.lineWidth&&(i.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),i.miterLimit!=e.miterLimit&&(i.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),i.strokeStyle!=e.strokeStyle&&(i.strokeStyle=e.strokeStyle,t.strokeStyle=e.strokeStyle)):(t.lineCap=e.lineCap,t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){const t=this.context_,i=this.contextTextState_,r=e.textAlign?e.textAlign:xo;i?(i.font!=e.font&&(i.font=e.font,t.font=e.font),i.textAlign!=r&&(i.textAlign=r,t.textAlign=r),i.textBaseline!=e.textBaseline&&(i.textBaseline=e.textBaseline,t.textBaseline=e.textBaseline)):(t.font=e.font,t.textAlign=r,t.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:r,textBaseline:e.textBaseline})}setFillStrokeStyle(e,t){if(!e)this.fillState_=null;else{const i=e.getColor();this.fillState_={fillStyle:Ii(i||Mt)}}if(!t)this.strokeState_=null;else{const i=t.getColor(),r=t.getLineCap(),s=t.getLineDash(),o=t.getLineDashOffset(),a=t.getLineJoin(),l=t.getWidth(),c=t.getMiterLimit(),h=s||Hi;this.strokeState_={lineCap:r!==void 0?r:as,lineDash:this.pixelRatio_===1?h:h.map(u=>u*this.pixelRatio_),lineDashOffset:(o||Xi)*this.pixelRatio_,lineJoin:a!==void 0?a:ls,lineWidth:(l!==void 0?l:Eo)*this.pixelRatio_,miterLimit:c!==void 0?c:yo,strokeStyle:Ii(i||_o)}}}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:Ii(g||Mt)}}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:as,lineDash:p||Hi,lineDashOffset:A||Xi,lineJoin:m!==void 0?m:ls,lineWidth:y!==void 0?y:Eo,miterLimit:E!==void 0?E:yo,strokeStyle:Ii(g||_o)}}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:ig,textAlign:u!==void 0?u:xo,textBaseline:d!==void 0?d:La},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 JE=.5,wp={Point:ow,LineString:nw,Polygon:lw,MultiPoint:aw,MultiLineString:rw,MultiPolygon:sw,GeometryCollection:iw,Circle:ew};function $E(n,e){return parseInt(Y(n),10)-parseInt(Y(e),10)}function Eu(n,e){const t=vp(n,e);return t*t}function vp(n,e){return JE*n/e}function ew(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 yl(n,e,t,i,r,s,o,a){const l=[],c=t.getImage();if(c){let d=!0;const g=c.getImageState();g==W.LOADED||g==W.ERROR?d=!1:g==W.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)),tw(n,e,t,i,s,o,a),u}function tw(n,e,t,i,r,s,o){const a=t.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(i,r);if(t.getRenderer())Cp(n,l,t,e,o);else{const h=wp[l.getType()];h(n,l,t,e,o,s)}}function Cp(n,e,t,i,r){if(e.getType()=="GeometryCollection"){const o=e.getGeometries();for(let a=0,l=o.length;a<l;++a)Cp(n,o[a],t,i,r);return}n.getBuilder(t.getZIndex(),"Default").drawCustom(e,i,t.getRenderer(),t.getHitDetectionRenderer(),r)}function iw(n,e,t,i,r,s){const o=e.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a){const c=wp[o[a].getType()];c(n,o[a],t,i,r,s)}}function nw(n,e,t,i,r){const s=t.getStroke();if(s){const a=n.getBuilder(t.getZIndex(),"LineString");a.setFillStrokeStyle(null,s),a.drawLineString(e,i,r)}const o=t.getText();if(o&&o.getText()){const a=n.getBuilder(t.getZIndex(),"Text");a.setTextStyle(o),a.drawText(e,i,r)}}function rw(n,e,t,i,r){const s=t.getStroke();if(s){const a=n.getBuilder(t.getZIndex(),"LineString");a.setFillStrokeStyle(null,s),a.drawMultiLineString(e,i,r)}const o=t.getText();if(o&&o.getText()){const a=n.getBuilder(t.getZIndex(),"Text");a.setTextStyle(o),a.drawText(e,i,r)}}function sw(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(o||s){const l=n.getBuilder(t.getZIndex(),"Polygon");l.setFillStrokeStyle(s,o),l.drawMultiPolygon(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,r)}}function ow(n,e,t,i,r,s){const o=t.getImage(),a=t.getText(),l=a&&a.getText(),c=s&&o&&l?{}:void 0;if(o){if(o.getImageState()!=W.LOADED)return;const h=n.getBuilder(t.getZIndex(),"Image");h.setImageStyle(o,c),h.drawPoint(e,i,r)}if(l){const h=n.getBuilder(t.getZIndex(),"Text");h.setTextStyle(a,c),h.drawText(e,i,r)}}function aw(n,e,t,i,r,s){const o=t.getImage(),a=o&&o.getOpacity()!==0,l=t.getText(),c=l&&l.getText(),h=s&&a&&c?{}:void 0;if(a){if(o.getImageState()!=W.LOADED)return;const u=n.getBuilder(t.getZIndex(),"Image");u.setImageStyle(o,h),u.drawMultiPoint(e,i,r)}if(c){const u=n.getBuilder(t.getZIndex(),"Text");u.setTextStyle(l,h),u.drawText(e,i,r)}}function lw(n,e,t,i,r){const s=t.getFill(),o=t.getStroke();if(s||o){const l=n.getBuilder(t.getZIndex(),"Polygon");l.setFillStrokeStyle(s,o),l.drawPolygon(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,r)}}let cw=!1;function bp(n,e,t,i,r,s,o){const a=new XMLHttpRequest;a.open("GET",typeof n=="function"?n(t,i,r):n,!0),e.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=cw,a.onload=function(l){if(!a.status||a.status>=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 Tp(n,e){return function(t,i,r,s,o){bp(n,e,t,i,r,(a,l)=>{this.addFeatures(a),s!==void 0&&s(a)},()=>{this.changed(),o!==void 0&&o()})}}function hw(n,e){return[[-1/0,-1/0,1/0,1/0]]}function uw(n,e){return[n]}class wu{constructor(e){this.rbush_=new Wf(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;r<s;r++){const o=e[r],a=t[r],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};i[r]=l,this.items_[Y(a)]=l}this.rbush_.load(i)}remove(e){const t=Y(e),i=this.items_[t];return delete this.items_[t],this.rbush_.remove(i)!==null}update(e,t){const i=this.items_[Y(t)],r=[i.minX,i.minY,i.maxX,i.maxY];Vi(r,e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(t){return t.value})}getInExtent(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(r){return r.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let i;for(let r=0,s=e.length;r<s;r++)if(i=t(e[r]),i)return i;return i}isEmpty(){return un(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const t=this.rbush_.toJSON();return bi(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(const t in e.items_)this.items_[t]=e.items_[t]}}class ms extends Ci{constructor(e){super(),this.projection=_e(e.projection),this.attributions_=Rp(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state!==void 0?e.state:"ready",this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const t=this;this.viewPromise_=new Promise(function(i,r){t.viewResolver=i,t.viewRejector=r})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=Rp(e),this.changed()}setState(e){this.state_=e,this.changed()}}function Rp(n){return n?typeof n=="function"?n:(Array.isArray(n)||(n=[n]),e=>n):null}const Lt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class Pn extends Nt{constructor(e,t,i){super(e),this.feature=t,this.features=i}}class Mn extends ms{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_=Us,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&&(ye(this.format_,"`format` must be set when `url` is set"),this.loader_=Tp(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:hw;const t=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=t?new wu:null,this.loadedExtentsRtree_=new wu,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 Rt(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 Pn(Lt.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof ht||(this.featureChangeKeys_[e]=[ce(t,K.CHANGE,this.handleFeatureChange_,this),ce(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 ht){const s=this.idIndex_[r];s instanceof ht?Array.isArray(s)?s.push(t):this.idIndex_[r]=[s,t]:i=!1}else i=!1}return i&&(ye(!(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<o;s++){const a=e[s],l=Y(a);this.addToIndex_(l,a)&&i.push(a)}for(let s=0,o=i.length;s<o;s++){const a=i[s],l=Y(a);this.setupChangeEvents_(l,a);const c=a.getGeometry();if(c){const h=c.getExtent();t.push(h),r.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(Lt.ADDFEATURE))for(let s=0,o=i.length;s<o;s++)this.dispatchEvent(new Pn(Lt.ADDFEATURE,i[s]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(Lt.ADDFEATURE,function(i){t||(t=!0,e.push(i.feature),t=!1)}),this.addEventListener(Lt.REMOVEFEATURE,function(i){t||(t=!0,e.remove(i.feature),t=!1)}),e.addEventListener(pt.ADD,i=>{t||(t=!0,this.addFeature(i.element),t=!1)}),e.addEventListener(pt.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(Re);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 Pn(Lt.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 ht||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 ht||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(),un(this.nullGeometryFeatures_)||vi(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=uc(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||Wr,this.featuresRtree_.forEachInExtent(l,function(c){if(t(c)){const h=c.getGeometry(),u=a;if(a=h instanceof ht?0:h.closestPointXY(i,r,o,a),a<u){s=c;const d=Math.sqrt(a);l[0]=i-d,l[1]=r-d,l[2]=i+d,l[3]=r+d}}}),s}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){const t=this.idIndex_[e.toString()];return t!==void 0?t:null}getFeatureByUid(e){const t=this.uidIndex_[e];return t!==void 0?t:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){const t=e.target,i=Y(t),r=t.getGeometry();if(!r)i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[i]=t);else{const o=r.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,t)):this.featuresRtree_&&this.featuresRtree_.update(o,t)}const s=t.getId();if(s!==void 0){const o=s.toString();this.idIndex_[o]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[o]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[i]=t;this.changed(),this.dispatchEvent(new Pn(Lt.CHANGEFEATURE,t))}hasFeature(e){const t=e.getId();return t!==void 0?t in this.idIndex_:Y(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&un(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,t,i){const r=this.loadedExtentsRtree_,s=this.strategy_(e,t,i);for(let o=0,a=s.length;o<a;++o){const l=s[o];r.forEachInExtent(l,function(h){return Ui(h.extent,l)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Pn(Lt.FEATURESLOADSTART)),this.loader_.call(this,l,t,i,h=>{--this.loadingExtentsCount_,this.dispatchEvent(new Pn(Lt.FEATURESLOADEND,void 0,h))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Pn(Lt.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(Vi(r.extent,e))return r});i&&t.remove(i)}removeFeatures(e){let t=!1;for(let i=0,r=e.length;i<r;++i)t=this.removeFeatureInternal(e[i])||t;t&&this.changed()}removeFeature(e){if(!e)return;this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){const t=Y(e);if(!(t in this.uidIndex_))return!1;t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e);const i=this.featureChangeKeys_[t];i==null||i.forEach(Re),delete this.featureChangeKeys_[t];const r=e.getId();if(r!==void 0){const s=r.toString(),o=this.idIndex_[s];o===e?delete this.idIndex_[s]:Array.isArray(o)&&(o.splice(o.indexOf(e),1),o.length===1&&(this.idIndex_[s]=o[0]))}return delete this.uidIndex_[t],this.hasListener(Lt.REMOVEFEATURE)&&this.dispatchEvent(new Pn(Lt.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(const t in this.idIndex_)if(this.idIndex_[t]===e){delete this.idIndex_[t];break}}setLoader(e){this.loader_=e}setUrl(e){ye(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(Tp(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}}const Z={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},_l=[Z.FILL],Fn=[Z.STROKE],br=[Z.BEGIN_PATH],Sp=[Z.CLOSE_PATH];class zo extends Ep{constructor(e,t,i,r){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){const t=this.pixelRatio;return t==1?e:e.map(function(i){return i*t})}appendFlatPointCoordinates(e,t){const i=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,s=this.coordinates;let o=s.length;for(let a=0,l=e.length;a<l;a+=t)r[0]=e[a],r[1]=e[a+1],$n(i,r)&&(s[o++]=r[0],s[o++]=r[1]);return o}appendFlatLineCoordinates(e,t,i,r,s,o){const a=this.coordinates;let l=a.length;const c=this.getBufferedMaxExtent();o&&(t+=r);let h=e[t],u=e[t+1];const d=this.tmpCoordinate_;let g=!0,f,p,A;for(f=t+r;f<i;f+=r)d[0]=e[f],d[1]=e[f+1],A=ac(c,d),A!==p?(g&&(a[l++]=h,a[l++]=u,g=!1),a[l++]=d[0],a[l++]=d[1]):A===ct.INTERSECTING?(a[l++]=d[0],a[l++]=d[1],g=!1):g=!0,h=d[0],u=d[1],p=A;return(s&&g||f===t+r)&&(a[l++]=h,a[l++]=u),l}drawCustomCoordinates_(e,t,i,r,s){for(let o=0,a=i.length;o<a;++o){const l=i[o],c=this.appendFlatLineCoordinates(e,t,l,r,!1,!1);s.push(c),t=l}return t}drawCustom(e,t,i,r,s){this.beginGeometry(e,t,s);const o=e.getType(),a=e.getStride(),l=this.coordinates.length;let c,h,u,d,g;switch(o){case"MultiPolygon":c=e.getOrientedFlatCoordinates(),d=[];const f=e.getEndss();g=0;for(let p=0,A=f.length;p<A;++p){const m=[];g=this.drawCustomCoordinates_(c,g,f[p],a,m),d.push(m)}this.instructions.push([Z.CUSTOM,l,d,e,i,kc,s]),this.hitDetectionInstructions.push([Z.CUSTOM,l,d,e,r||i,kc,s]);break;case"Polygon":case"MultiLineString":u=[],c=o=="Polygon"?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),g=this.drawCustomCoordinates_(c,0,e.getEnds(),a,u),this.instructions.push([Z.CUSTOM,l,u,e,i,io,s]),this.hitDetectionInstructions.push([Z.CUSTOM,l,u,e,r||i,io,s]);break;case"LineString":case"Circle":c=e.getFlatCoordinates(),h=this.appendFlatLineCoordinates(c,0,c.length,a,!1,!1),this.instructions.push([Z.CUSTOM,l,h,e,i,_n,s]),this.hitDetectionInstructions.push([Z.CUSTOM,l,h,e,r||i,_n,s]);break;case"MultiPoint":c=e.getFlatCoordinates(),h=this.appendFlatPointCoordinates(c,a),h>l&&(this.instructions.push([Z.CUSTOM,l,h,e,i,_n,s]),this.hitDetectionInstructions.push([Z.CUSTOM,l,h,e,r||i,_n,s]));break;case"Point":c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),h=this.coordinates.length,this.instructions.push([Z.CUSTOM,l,h,e,i,void 0,s]),this.hitDetectionInstructions.push([Z.CUSTOM,l,h,e,r||i,void 0,s]);break}this.endGeometry(t)}beginGeometry(e,t,i){this.beginGeometryInstruction1_=[Z.BEGIN_GEOMETRY,t,0,e,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Z.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;t<i;++t)r=e[t],s=r[0],s==Z.END_GEOMETRY?o=t:s==Z.BEGIN_GEOMETRY&&(r[2]=t,Km(this.hitDetectionInstructions,o,t),o=-1)}fillStyleToState(e,t={}){if(e){const i=e.getColor();t.fillPatternScale=i&&typeof i=="object"&&"src"in i?this.pixelRatio:1,t.fillStyle=Ii(i||Mt)}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){const i=e.getColor();t.strokeStyle=Ii(i||_o);const r=e.getLineCap();t.lineCap=r!==void 0?r:as;const s=e.getLineDash();t.lineDash=s?s.slice():Hi;const o=e.getLineDashOffset();t.lineDashOffset=o||Xi;const a=e.getLineJoin();t.lineJoin=a!==void 0?a:ls;const l=e.getWidth();t.lineWidth=l!==void 0?l:Eo;const c=e.getMiterLimit();t.miterLimit=c!==void 0?c:yo,t.lineWidth>this.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=[Z.SET_FILL_STYLE,t];return typeof t!="string"&&i.push(e.fillPatternScale),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[Z.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)&&(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&&!Bi(e.currentLineDash,s)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=l||e.currentMiterLimit!=c)&&(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=[Z.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Vd(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;ji(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class dw extends zo{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&&!$n(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([Z.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([Z.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<c;l+=e.getStride())(!this.maxExtent||$n(this.maxExtent,r.slice(l,l+2)))&&s.push(r[l],r[l+1]);const o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,2);this.instructions.push([Z.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([Z.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)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(e,t){const i=e.getAnchor(),r=e.getSize(),s=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}class fw extends zo{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinates_(e,t,i,r){const s=this.coordinates.length,o=this.appendFlatLineCoordinates(e,t,i,r,!1,!1),a=[Z.MOVE_TO_LINE_TO,s,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i}drawLineString(e,t,i){const r=this.state,s=r.strokeStyle,o=r.lineWidth;if(s===void 0||o===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,i),this.hitDetectionInstructions.push([Z.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hi,Xi],br);const a=e.getFlatCoordinates(),l=e.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(Fn),this.endGeometry(t)}drawMultiLineString(e,t,i){const r=this.state,s=r.strokeStyle,o=r.lineWidth;if(s===void 0||o===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,i),this.hitDetectionInstructions.push([Z.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hi,Xi],br);const a=e.getEnds(),l=e.getFlatCoordinates(),c=e.getStride();let h=0;for(let u=0,d=a.length;u<d;++u)h=this.drawFlatCoordinates_(l,h,a[u],c);this.hitDetectionInstructions.push(Fn),this.endGeometry(t)}finish(){const e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Fn),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Fn),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(br)}}class Ip extends zo{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinatess_(e,t,i,r){const s=this.state,o=s.fillStyle!==void 0,a=s.strokeStyle!==void 0,l=i.length;this.instructions.push(br),this.hitDetectionInstructions.push(br);for(let c=0;c<l;++c){const h=i[c],u=this.coordinates.length,d=this.appendFlatLineCoordinates(e,t,h,r,!0,!a),g=[Z.MOVE_TO_LINE_TO,u,d];this.instructions.push(g),this.hitDetectionInstructions.push(g),a&&(this.instructions.push(Sp),this.hitDetectionInstructions.push(Sp)),t=h}return o&&(this.instructions.push(_l),this.hitDetectionInstructions.push(_l)),a&&(this.instructions.push(Fn),this.hitDetectionInstructions.push(Fn)),t}drawCircle(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle;if(s===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_FILL_STYLE,Mt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hi,Xi]);const a=e.getFlatCoordinates(),l=e.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,l,!1,!1);const h=[Z.CIRCLE,c];this.instructions.push(br,h),this.hitDetectionInstructions.push(br,h),r.fillStyle!==void 0&&(this.instructions.push(_l),this.hitDetectionInstructions.push(_l)),r.strokeStyle!==void 0&&(this.instructions.push(Fn),this.hitDetectionInstructions.push(Fn)),this.endGeometry(t)}drawPolygon(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle;if(s===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_FILL_STYLE,Mt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hi,Xi]);const a=e.getEnds(),l=e.getOrientedFlatCoordinates(),c=e.getStride();this.drawFlatCoordinatess_(l,0,a,c),this.endGeometry(t)}drawMultiPolygon(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle;if(s===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_FILL_STYLE,Mt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Z.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hi,Xi]);const a=e.getEndss(),l=e.getOrientedFlatCoordinates(),c=e.getStride();let h=0;for(let u=0,d=a.length;u<d;++u)h=this.drawFlatCoordinatess_(l,h,a[u],c);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const e=this.tolerance;if(e!==0){const t=this.coordinates;for(let i=0,r=t.length;i<r;++i)t[i]=ar(t[i],e)}return super.finish()}setFillStrokeStyles_(){const e=this.state;this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke)}}function gw(n,e,t,i,r){const s=[];let o=t,a=0,l=e.slice(t,2);for(;a<n&&o+r<i;){const[c,h]=l.slice(-2),u=e[o+r],d=e[o+r+1],g=Math.sqrt((u-c)*(u-c)+(d-h)*(d-h));if(a+=g,a>=n){const f=(n-a+g)/g,p=zt(c,u,f),A=zt(h,d,f);l.push(p,A),s.push(l),l=[p,A],a==n&&(o+=r),a=0}else if(a<n)l.push(e[o+r],e[o+r+1]),o+=r;else{const f=g-a,p=zt(c,u,f/g),A=zt(h,d,f/g);l.push(p,A),s.push(l),l=[p,A],a=0,o+=r}}return a>0&&s.push(l),s}function pw(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;u<i;u+=r){const x=e[u],_=e[u+1];f!==void 0&&(y=x-f,E=_-p,g=Math.sqrt(y*y+E*E),A!==void 0&&(l+=d,h=Math.acos((A*y+m*E)/(d*g)),h>n&&(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 xl={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class Aw extends zo{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[Mt]={fillStyle:Mt},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(!ze(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<y;++m)d.push(A[m][0])}this.beginGeometry(e,t,i);const g=o.repeat,f=g?void 0:o.textAlign;let p=0;for(let A=0,m=d.length;A<m;++A){let y;g?y=gw(g*this.resolution,h,p,d[A],u):y=[h.slice(p,d[A])];for(let E=0,x=y.length;E<x;++E){const _=y[E];let w=0,v=_.length;if(f==null){const b=pw(o.maxAngle,_,0,_.length,2);w=b[0],v=b[1]}for(let b=w;b<v;b+=u)a.push(_[b],_[b+1]);const C=a.length;p=d[A],this.drawChars_(l,C),l=C}}this.endGeometry(t)}else{let d=o.overflow?null:[];switch(c){case"Point":case"MultiPoint":h=e.getFlatCoordinates();break;case"LineString":h=e.getFlatMidpoint();break;case"Circle":h=e.getCenter();break;case"MultiLineString":h=e.getFlatMidpoints(),u=2;break;case"Polygon":h=e.getFlatInteriorPoint(),o.overflow||d.push(h[2]/this.resolution),u=3;break;case"MultiPolygon":const x=e.getFlatInteriorPoints();h=[];for(let _=0,w=x.length;_<w;_+=3)o.overflow||d.push(x[_+2]/this.resolution),h.push(x[_],x[_+1]);if(h.length===0)return;u=2;break}const g=this.appendFlatPointCoordinates(h,u);if(g===l)return;if(d&&(g-l)/2!==h.length/u){let x=l/2;d=d.filter((_,w)=>{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!=fr&&(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([Z.DRAW_IMAGE,l,g,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,A==fr?fr: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]=Mt),this.hitDetectionInstructions.push([Z.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_?Mt: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||xo,justify:t.justify,textBaseline:t.textBaseline||La,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=xl[r.textBaseline],h=this.textOffsetY_*l,u=this.text_,d=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([Z.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([Z.DRAW_CHARS,e,t,c,r.overflow,a&&Mt,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=Ii(o.getColor()||Mt)):(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()||as,s.lineDash=p?p.slice():Hi,s.lineDashOffset=A===void 0?Xi:A,s.lineJoin=a.getLineJoin()||ls,s.lineWidth=m===void 0?Eo:m,s.miterLimit=y===void 0?yo:y,s.strokeStyle=Ii(a.getColor()||_o)}i=this.textState_;const l=e.getFont()||ig;U_(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()||La,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||fr,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 mw={Circle:Ip,Default:zo,Image:dw,LineString:fw,Polygon:Ip,Text:Aw};class Pp{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=mw[t];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=s}return s}}function yw(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(e<t-i&&y+m<s);let x=m===0?0:(s-y)/m;const _=zt(p,g,x),w=zt(A,f,x),v=e-i,C=y,b=s+a*l(c,r,h);for(;e<t-i&&y+m<b;)E();x=m===0?0:(b-y)/m;const T=zt(p,g,x),I=zt(A,f,x);let F=!1;if(d)if(u){const L=[_,w,T,I];Ic(L,0,4,2,u,L,L),F=L[0]>L[2]}else F=_>T;const P=Math.PI,B=[],R=v+i===e;e=v,m=0,y=C,g=n[e],f=n[e+1];let S;if(R){E(),S=Math.atan2(f-A,g-p),F&&(S+=S>0?-P:P);const L=(T+_)/2,z=(I+w)/2;return B[0]=[L,z,(b-s)/2,S,r],B}r=r.replace(/\n/g," ");for(let L=0,z=r.length;L<z;){E();let V=Math.atan2(f-A,g-p);if(F&&(V+=V>0?-P:P),S!==void 0){let se=V-S;if(se+=se>P?-2*P:se<-P?2*P:0,Math.abs(se)>o)return null}S=V;const U=L;let X=0;for(;L<z;++L){const se=F?z-L-1:L,Ce=a*l(c,r[se],h);if(e+i<t&&y+m<s+X+Ce/2)break;X+=Ce}if(L===U)continue;const D=F?r.substring(z-U,z-L):r.substring(U,L);x=m===0?0:(s+X/2-y)/m;const q=zt(p,g,x),O=zt(A,f,x);B.push([q,O,X/2,V,D]),s+=X}return B}class vu{constructor(){Gt(this,"pushMethodArgs_",(...e)=>(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;i<r;++i){const s=t[i];if(typeof s=="function"){s(e);continue}const o=t[++i];if(typeof e[s]=="function")e[s](...o);else{if(typeof o=="function"){e[s]=o(e);continue}e[s]=o}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const ys=jt(),Ln=[],qi=[],Qi=[],kn=[];function Mp(n){return n[3].declutterBox}const Fp=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ-࿿-]");function Cu(n,e){return e==="start"?e=Fp.test(n)?"right":"left":e==="end"&&(e=Fp.test(n)?"left":"right"),xl[e]}function _w(n,e,t){return t>0&&n.push(`
22
- `,""),n.push(e,""),n}function xw(n,e,t){return t%2===0&&(n+=e),n}class Ew{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_=St(),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 vu: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?xl[l.justify]:Cu(Array.isArray(e)?e[0]:e,l.textAlign||xo),d=r&&o.lineWidth?o.lineWidth:0,g=Array.isArray(e)?e:String(e).split(`
23
- `).reduce(_w,[]),{width:f,height:p,widths:A,heights:m,lineWidths:y}=W_(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=[],I=[];let F=0,P=0,B=0,R=0,S;for(let L=0,z=g.length;L<z;L+=2){const V=g[L];if(V===`
24
- `){P+=F,F=0,b=u*E+C*d,++R;continue}const U=g[L+1]||l.font;U!==S&&(r&&T.push("font",U),i&&I.push("font",U),S=U),F=Math.max(F,m[B]);const X=[V,b+C*A[B]+u*(A[B]-y[R]),.5*(d+F)+P];b+=A[B],r&&T.push("strokeText",X),i&&I.push("fillText",X),++B}return Array.prototype.push.apply(x,T),Array.prototype.push.apply(x,I),this.labels_[s]=v,v}replayTextBackground_(e,t,i,r,s,o,a){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,s),e.lineTo.apply(e,t),o&&(this.alignAndScaleFill_=o[2],e.fillStyle=o[1],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())}calculateImageOrLabelDimensions_(e,t,i,r,s,o,a,l,c,h,u,d,g,f,p,A){a*=d[0],l*=d[1];let m=i-a,y=r-l;const E=s+c>e?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)&&(Ln[0]=v,kn[0]=v,Ln[1]=C,qi[1]=C,qi[0]=v+_,Qi[0]=qi[0],Qi[1]=C+w,kn[1]=Qi[1]);let b;return u!==0?(b=Ti(St(),i,r,1,1,u,-i,-r),$e(b,Ln),$e(b,qi),$e(b,Qi),$e(b,kn),bi(Math.min(Ln[0],qi[0],Qi[0],kn[0]),Math.min(Ln[1],qi[1],Qi[1],kn[1]),Math.max(Ln[0],qi[0],Qi[0],kn[0]),Math.max(Ln[1],qi[1],Qi[1],kn[1]),ys)):bi(Math.min(v,v+_),Math.min(C,C+w),Math.max(v,v+_),Math.max(C,C+w),ys),g&&(m=Math.round(m),y=Math.round(y)),{drawImageX:m,drawImageY:y,drawImageW:E,drawImageH:x,originX:c,originY:h,declutterBox:{minX:ys[0],minY:ys[1],maxX:ys[2],maxY:ys[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,Ln,qi,Qi,kn,o,a),H_(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=$e(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],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=Cu(Array.isArray(e)?e[0]:e,s.textAlign||xo),h=xl[s.textBaseline||La],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_&&Bi(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=mn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Zy(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,I=0,F=0;const P=this.coordinateCache_,B=this.viewRotation_,R=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,S={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:B},L=this.instructions!=r||this.overlaps?0:200;let z,V,U,X;for(;u<d;){const D=r[u];switch(D[0]){case Z.BEGIN_GEOMETRY:z=D[1],X=D[3],z.getGeometry()?a!==void 0&&!ze(a,X.getExtent())?u=D[2]+1:++u:u=D[2],c&&(c.zIndex=D[4]);break;case Z.BEGIN_PATH:I>L&&(this.fill_(e),I=0),F>L&&(e.stroke(),F=0),!I&&!F&&(e.beginPath(),y=NaN,E=NaN),++u;break;case Z.CIRCLE:g=D[1];const O=h[g],se=h[g+1],Ce=h[g+2],ge=h[g+3],We=Ce-O,be=ge-se,Fe=Math.sqrt(We*We+be*be);e.moveTo(O+Fe,se),e.arc(O,se,Fe,0,2*Math.PI,!0),++u;break;case Z.CLOSE_PATH:e.closePath(),++u;break;case Z.CUSTOM:g=D[1],f=D[2];const xi=D[3],_t=D[4],ft=D[5];S.geometry=xi,S.feature=z,u in P||(P[u]=[]);const j=P[u];ft?ft(h,g,f,2,j):(j[0]=h[g],j[1]=h[g+1],j.length=2),c&&(c.zIndex=D[6]),_t(j,S),++u;break;case Z.DRAW_IMAGE:g=D[1],f=D[2],w=D[3],p=D[4],A=D[5];let Ke=D[6];const gt=D[7],re=D[8],rn=D[9],si=D[10];let Ve=D[11];const Oi=D[12];let Be=D[13];m=D[14]||"declutter";const Ne=D[15];if(!w&&D.length>=20){v=D[19],C=D[20],b=D[21],T=D[22];const Je=this.drawLabelWithPointPlacement_(v,C,b,T);w=Je.label,D[3]=w;const on=D[23];p=(Je.anchorX-on)*this.pixelRatio,D[4]=p;const kt=D[24];A=(Je.anchorY-kt)*this.pixelRatio,D[5]=A,Ke=w.height,D[6]=Ke,Be=w.width,D[13]=Be}let sn;D.length>25&&(sn=D[25]);let oi,Gi,Hn;D.length>17?(oi=D[16],Gi=D[17],Hn=D[18]):(oi=fr,Gi=null,Hn=null),si&&R?Ve+=B:!si&&!R&&(Ve-=B);let Le=0;for(;g<f;g+=2){if(sn&&sn[Le++]<Be/this.pixelRatio)continue;const Je=this.calculateImageOrLabelDimensions_(w.width,w.height,h[g],h[g+1],Be,Ke,p,A,re,rn,Ve,Oi,s,oi,!!Gi||!!Hn,z),on=[e,t,w,Je,gt,Gi,Hn];if(l){let kt,Dt,Ot;if(Ne){const Xe=f-g;if(!Ne[Xe]){Ne[Xe]={args:on,declutterMode:m};continue}const Tt=Ne[Xe];kt=Tt.args,Dt=Tt.declutterMode,delete Ne[Xe],Ot=Mp(kt)}let Ei,an;if(kt&&(Dt!=="declutter"||!l.collides(Ot))&&(Ei=!0),(m!=="declutter"||!l.collides(Je.declutterBox))&&(an=!0),Dt==="declutter"&&m==="declutter"){const Xe=Ei&&an;Ei=Xe,an=Xe}Ei&&(Dt!=="none"&&l.insert(Ot),this.replayImageOrLabel_.apply(this,kt)),an&&(m!=="none"&&l.insert(Je.declutterBox),this.replayImageOrLabel_.apply(this,on))}else this.replayImageOrLabel_.apply(this,on)}++u;break;case Z.DRAW_CHARS:const Ie=D[1],Te=D[2],me=D[3],Ze=D[4];T=D[5];const oe=D[6],fe=D[7],qe=D[8];b=D[9];const Qe=D[10];v=D[11],Array.isArray(v)&&(v=v.reduce(xw,"")),C=D[12];const Zt=[D[13],D[13]];m=D[14]||"declutter";const qt=D[15],ot=this.textStates[C],at=ot.font,Se=[ot.scale[0]*fe,ot.scale[1]*fe];let He;at in this.widths_?He=this.widths_[at]:(He={},this.widths_[at]=He);const bt=Ph(h,Ie,Te,2),ke=Math.abs(Se[0])*og(at,v,He);if(Ze||ke<=bt){const Je=this.textStates[C].textAlign,on=(bt-ke)*Cu(v,Je),kt=yw(h,Ie,Te,2,v,on,oe,Math.abs(Se[0]),og,at,He,R?0:this.viewRotation_,qt);e:if(kt){const Dt=[];let Ot,Ei,an,Xe,Tt;if(b)for(Ot=0,Ei=kt.length;Ot<Ei;++Ot){Tt=kt[Ot],an=Tt[4],Xe=this.createLabel(an,C,"",b),p=Tt[2]+(Se[0]<0?-Qe:Qe),A=me*Xe.height+(.5-me)*2*Qe*Se[1]/Se[0]-qe;const ln=this.calculateImageOrLabelDimensions_(Xe.width,Xe.height,Tt[0],Tt[1],Xe.width,Xe.height,p,A,0,0,Tt[3],Zt,!1,fr,!1,z);if(l&&m==="declutter"&&l.collides(ln.declutterBox))break e;Dt.push([e,t,Xe,ln,1,null,null])}if(T)for(Ot=0,Ei=kt.length;Ot<Ei;++Ot){Tt=kt[Ot],an=Tt[4],Xe=this.createLabel(an,C,T,""),p=Tt[2],A=me*Xe.height-qe;const ln=this.calculateImageOrLabelDimensions_(Xe.width,Xe.height,Tt[0],Tt[1],Xe.width,Xe.height,p,A,0,0,Tt[3],Zt,!1,fr,!1,z);if(l&&m==="declutter"&&l.collides(ln.declutterBox))break e;Dt.push([e,t,Xe,ln,1,null,null])}l&&m!=="none"&&l.load(Dt.map(Mp));for(let ln=0,KC=Dt.length;ln<KC;++ln)this.replayImageOrLabel_.apply(this,Dt[ln])}}++u;break;case Z.END_GEOMETRY:if(o!==void 0){z=D[1];const Je=o(z,X,m);if(Je)return Je}++u;break;case Z.FILL:L?I++:this.fill_(e),++u;break;case Z.MOVE_TO_LINE_TO:for(g=D[1],f=D[2],V=h[g],U=h[g+1],e.moveTo(V,U),y=V+.5|0,E=U+.5|0,g+=2;g<f;g+=2)V=h[g],U=h[g+1],x=V+.5|0,_=U+.5|0,(g==f-2||x!==y||_!==E)&&(e.lineTo(V,U),y=x,E=_);++u;break;case Z.SET_FILL_STYLE:this.alignAndScaleFill_=D[2],I&&(this.fill_(e),I=0,F&&(e.stroke(),F=0)),e.fillStyle=D[1],++u;break;case Z.SET_STROKE_STYLE:F&&(e.stroke(),F=0),this.setStrokeStyle_(e,D),++u;break;case Z.STROKE:L?F++:e.stroke(),++u;break;default:++u;break}}I&&this.fill_(e),F&&e.stroke()}execute(e,t,i,r,s,o){this.viewRotation_=r,this.execute_(e,t,i,this.instructions,s,void 0,void 0,o)}executeHitDetection(e,t,i,r,s){return this.viewRotation_=i,this.execute_(e,[e.canvas.width,e.canvas.height],t,this.hitDetectionInstructions,!0,r,s)}}const Tr=["Polygon","Circle","LineString","Image","Text","Default"],El=["Image","Text"],ww=Tr.filter(n=>!El.includes(n));class Lp{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_=St(),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 Ew(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;r<s;++r)if(e[r]in i)return!0}return!1}forEachFeatureAtCoordinate(e,t,i,r,s,o){r=Math.round(r);const a=r*2+1,l=Ti(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=Me(a,a));const h=this.hitDetectionContext_;h.canvas.width!==a||h.canvas.height!==a?(h.canvas.width=a,h.canvas.height=a):c||h.clearRect(0,0,a,a);let u;this.renderBuffer_!==void 0&&(u=jt(),Ks(u,e),ji(u,t*(this.renderBuffer_+r),u));const d=vw(r);let g;function f(_,w,v){const C=h.getImageData(0,0,a,a).data;for(let b=0,T=d.length;b<T;b++)if(C[d[b]]>0){if(!o||v==="none"||g!=="Image"&&g!=="Text"||o.includes(_)){const I=(d[b]-3)/4,F=r-I%a,P=r-(I/a|0),B=s(_,w,F*F+P*P);if(B)return B}h.clearRect(0,0,a,a);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(wi);let A,m,y,E,x;for(A=p.length-1;A>=0;--A){const _=p[A].toString();for(y=this.executorsByZIndex_[_],m=Tr.length-1;m>=0;--m)if(g=Tr[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 mn(a,0,8,2,e,a),a}isEmpty(){return un(this.executorsByZIndex_)}execute(e,t,i,r,s,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?Ym:wi),o=o||Tr;const c=Tr.length;for(let h=0,u=l.length;h<u;++h){const d=l[h].toString(),g=this.executorsByZIndex_[d];for(let f=0,p=o.length;f<p;++f){const A=o[f],m=g[A];if(m!==void 0){const y=a===null?void 0:m.getZIndexContext(),E=y?y.getContext():e,x=this.maxExtent_&&A!=="Image"&&A!=="Text";if(x&&(E.save(),this.clip(E,i)),!y||A==="Text"||A==="Image"?m.execute(E,t,i,r,s,a):y.pushFunction(_=>m.execute(_,t,i,r,s,a)),x&&E.restore(),y){y.offset();const _=l[h]*c+Tr.indexOf(A);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(wi);for(let i=0,r=t.length;i<r;++i)e[t[i]].forEach(s=>{s.draw(this.renderedContext_),s.clear()}),e[t[i]].length=0}}const bu={};function vw(n){if(bu[n]!==void 0)return bu[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;s<o;++s)i[s]&&r.push(...i[s]);return bu[n]=r,r}const Kt=.5;function kp(n,e,t,i,r,s,o,a,l){const c=l?ma(r):r,h=n[0]*Kt,u=n[1]*Kt,d=Me(h,u);d.imageSmoothingEnabled=!1;const g=d.canvas,f=new QE(d,Kt,r,null,o,a,l?eo(Yy(),l):null),p=t.length,A=Math.floor((256*256*256-1)/p),m={};for(let E=1;E<=p;++E){const x=t[E-1],_=x.getStyleFunction()||i;if(!_)continue;let w=_(x,s);if(!w)continue;Array.isArray(w)||(w=[w]);const C=(E*A).toString(16).padStart(7,"#00000");for(let b=0,T=w.length;b<T;++b){const I=w[b],F=I.getGeometryFunction()(x);if(!F||!ze(c,F.getExtent()))continue;const P=I.clone(),B=P.getFill();B&&B.setColor(C);const R=P.getStroke();R&&(R.setColor(C),R.setLineDash(null)),P.setText(void 0);const S=I.getImage();if(S){const U=S.getImageSize();if(!U)continue;const X=Me(U[0],U[1],void 0,{alpha:!1}),D=X.canvas;X.fillStyle=C,X.fillRect(0,0,D.width,D.height),P.setImage(new Ar({img:D,anchor:S.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:S.getOrigin(),opacity:1,size:S.getSize(),scale:S.getScale(),rotation:S.getRotation(),rotateWithView:S.getRotateWithView()}))}const L=P.getZIndex()||0;let z=m[L];z||(z={},m[L]=z,z.Polygon=[],z.Circle=[],z.LineString=[],z.Point=[]);const V=F.getType();if(V==="GeometryCollection"){const U=F.getGeometriesArrayRecursive();for(let X=0,D=U.length;X<D;++X){const q=U[X];z[q.getType().replace("Multi","")].push(q,P)}}else z[V.replace("Multi","")].push(F,P)}}const y=Object.keys(m).map(Number).sort(wi);for(let E=0,x=y.length;E<x;++E){const _=m[y[E]];for(const w in _){const v=_[w];for(let C=0,b=v.length;C<b;C+=2){f.setStyle(v[C+1]);for(let T=0,I=e.length;T<I;++T)f.setTransform(e[T]),f.drawGeometry(v[C])}}}return d.getImageData(0,0,g.width,g.height)}function Dp(n,e,t){const i=[];if(t){const r=Math.floor(Math.round(n[0])*Kt),s=Math.floor(Math.round(n[1])*Kt),o=(Pe(r,0,t.width-1)+Pe(s,0,t.height-1)*t.width)*4,a=t.data[o],l=t.data[o+1],h=t.data[o+2]+256*(l+256*a),u=Math.floor((256*256*256-1)/e.length);h&&h%u===0&&i.push(e[h/u-1])}return i}const Cw=5;class bw extends Hs{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=new Array,this.maxStaleKeys=Cw}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.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()===W.LOADED||t.getState()===W.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=W.LOADED&&t!=W.ERROR&&e.addEventListener(K.CHANGE,this.boundHandleImageChange_),t==W.IDLE&&(e.load(),t=e.getState()),t==W.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e&&e.getVisible()&&e.getSourceState()==="ready"&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const Op=[];let _s=null;function Tw(){_s=Me(1,1,void 0,{willReadFrequently:!0})}class Tu extends bw{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=St(),this.pixelTransform=St(),this.inversePixelTransform=St(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,i){_s||Tw(),_s.clearRect(0,0,1,1);let r;try{_s.drawImage(e,t,i,1,1,0,0,1,1),r=_s.getImageData(0,0,1,1).data}catch{return _s=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&&Bi(ss(e.style.backgroundColor),ss(i)))){const a=e.firstElementChild;xn(a)&&(o=a.getContext("2d"))}if(o&&e0(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=ut?Df():document.createElement("div"),s.className=r;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=Me();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=li(i),s=la(i),o=oa(i),a=sa(i);$e(t.coordinateToPixelTransform,r),$e(t.coordinateToPixelTransform,s),$e(t.coordinateToPixelTransform,o),$e(t.coordinateToPixelTransform,a);const l=this.inversePixelTransform;$e(l,r),$e(l,s),$e(l,o),$e(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(Oe(i)/r*o);Ti(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/o,1/o,s,-a/2,-l/2),gf(this.inversePixelTransform,this.pixelTransform);const c=$y(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 xg(e,this.inversePixelTransform,i,t);r.dispatchEvent(s)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_($t.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_($t.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new vu),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_($t.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_($t.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 Ti(this.tempTransform,l,c,h,u,-i,d,g)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class Rw extends Tu{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_=jt(),this.wrappedRenderedExtent_=jt(),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[De.ANIMATING]||f[De.INTERACTING]),A=this.context,m=Math.round(ne(r)/a*g),y=Math.round(Oe(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?Tr:i?El:ww,i?d&&t.declutter[d]:void 0)}while(++w<_)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=Me(this.context.canvas.width,this.context.canvas.height,Op))}resetDrawContext_(){if(this.opacity_!==1&&this.targetContext_){const e=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=e,ro(this.context),Op.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($t.PRERENDER)||this.getLayer().hasListener($t.POSTRENDER)))return this.container;if(this.setDrawContext_(),this.preRender(s,e),r.projection,this.clipped_=!1,a&&i.extent&&this.clipping){const l=ci(i.extent);a=ze(l,e.extent),this.clipped_=a&&!Ui(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]*Kt,d=i[1]*Kt;h.push(this.getRenderTransform(r,s,o,Kt,u,d,0).slice());const g=c.getSource(),f=a.getExtent();if(g.getWrapX()&&a.canWrapX()&&!Ui(f,l)){let p=l[0];const A=ne(f);let m=0,y;for(;p<f[0];)--m,y=A*m,h.push(this.getRenderTransform(r,s,o,Kt,u,d,y).slice()),p+=A;for(m=0,p=l[2];p>f[2];)++m,y=A*m,h.push(this.getRenderTransform(r,s,o,Kt,u,d,y).slice()),p-=A}this.hitDetectionImageData_=kp(i,h,this.renderedFeatures_,c.getStyleFunction(),l,s,o,Eu(s,this.renderedPixelRatio_),null)}t(Dp(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&&A<y.distanceSq){if(A===0)return c[m]=!0,s.splice(s.lastIndexOf(y),1),r(f,l,p);y.geometry=p,y.distanceSq=A}}else{if(A===0)return c[m]=!0,r(f,l,p);s.push(c[m]={feature:f,layer:l,geometry:p,distanceSq:A,callback:r})}},u=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,o,a,i,h,u?(g=(d=t.declutter)==null?void 0:d[u])==null?void 0:g.all().map(f=>f.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[De.ANIMATING],s=e.viewHints[De.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=$E);const A=c.center.slice(),m=ji(l,f*u),y=m.slice(),E=[m.slice()],x=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!Ui(x,e.extent)){const B=ne(x),R=Math.max(ne(m)/2,B);m[0]=x[0]-R,m[2]=x[2]+R,gc(A,h);const S=Yd(E[0],h);S[0]<x[0]&&S[2]<x[2]?E.push([S[0]+B,S[1],S[2]+B,S[3]]):S[0]>x[0]&&S[2]>x[2]&&E.push([S[0]-B,S[1],S[2]-B,S[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==g&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!e.declutter&&Ui(this.wrappedRenderedExtent_,m))return Bi(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=A,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const _=new Pp(vp(u,d),m,u,d);let w;for(let B=0,R=E.length;B<R;++B)i.loadFeatures(E[B],u,h);const v=Eu(u,d);let C=!0;const b=(B,R)=>{let S;const L=B.getStyleFunction()||t.getStyleFunction();if(L&&(S=L(B,u)),S){const z=this.renderFeature(B,v,S,_,w,this.getLayer().getDeclutter(),R);C=C&&!z}},T=ma(m),I=i.getFeaturesInExtent(T);p&&I.sort(p);for(let B=0,R=I.length;B<R;++B)b(I[B],B);this.renderedFeatures_=I,this.ready=C;const F=_.finish(),P=new Lp(m,u,d,i.getOverlaps(),F,t.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=u,this.renderedRevision_=g,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=y,this.wrappedRenderedExtent_=m,this.renderedCenter_=A,this.renderedProjection_=h,this.renderedPixelRatio_=d,this.replayGroup_=P,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,i,r,s,o,a){if(!i)return!1;let l=!1;if(Array.isArray(i))for(let c=0,h=i.length;c<h;++c)l=yl(r,e,i[c],t,this.boundHandleStyleImageChange_,s,o,a)||l;else l=yl(r,e,i,t,this.boundHandleStyleImageChange_,s,o,a);return l}}class Dn extends Rh{constructor(e){super(e)}createRenderer(){return new Rw(this)}}class Sw extends xh{constructor(e,t,i,r,s){const o=s!==void 0?W.IDLE:W.LOADED;super(e,t,i,o),this.loader_=s!==void 0?s:null,this.canvas_=r,this.error_=null}getError(){return this.error_}handleLoad_(e){e?(this.error_=e,this.state=W.ERROR):this.state=W.LOADED,this.changed()}load(){this.state==W.IDLE&&(this.state=W.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}class jo extends Ws{constructor(e,t,i){super(),i=i||{},this.tileCoord=e,this.state=t,this.key="",this.transition_=i.transition===void 0?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(K.CHANGE)}release(){this.setState(G.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==G.EMPTY){if(this.state!==G.ERROR&&this.state>e)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:Kd(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 Gp extends jo{constructor(e,t,i,r,s,o){super(e,t,o),this.crossOrigin_=r,this.src_=i,this.key=i,this.image_,ut?this.image_=new OffscreenCanvas(1,1):(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()}getCrossOrigin(){return this.crossOrigin_}handleImageError_(){this.state=G.ERROR,this.unlistenImage_(),this.image_=Iw(),this.changed()}handleImageLoad_(){if(ut)this.state=G.LOADED;else{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_=D_(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 Iw(){const n=Me(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}class Ru{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.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.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 xs(n,e,t,i,r){return r!==void 0?(r.minX=n,r.maxX=e,r.minY=t,r.maxY=i,r):new Ru(n,e,t,i)}const Bp=[];class Pw extends jo{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_=Me(1,1,Bp)),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_&&(ro(this.context_),Bp.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}let Np=class extends jo{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 zp="https://api.mapbox.com";function Su(n){const e="mapbox://";return n.indexOf(e)!==0?"":n.slice(e.length)}function Mw(n,e,t){if(typeof n=="string")return[{id:"default",url:jp(n,e,t)}];for(const i of n)i.url=jp(i.url,e,t);return n}function jp(n,e,t){const i=Su(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`${zp}/styles/v1/${s}/sprite?access_token=${e}`}function wl(n,e){const t=Su(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`${zp}/styles/v1/${r}?&access_token=${e}`}const Fw=["a","b","c","d"];function vl(n,e,t,i){const r=new URL(n,i||location.href),s=Su(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 Fw.map(o=>`https://${o}.tiles.mapbox.com/v4/${s}/{z}/{x}/{y}.vector.pbf?access_token=${e}`)}const yt=Object.freeze({}),Up={},Vp={};let Lw=0;function Iu(n){return n.id||(n.id=Lw++),n.id}function Pu(n,e){return Iu(n)+"."+Y(e)}function Mu(n){let e=Up[n.id];return e||(e={},Up[Iu(n)]=e),e}function Wp(n){let e=Vp[n.id];return e||(e={},Vp[Iu(n)]=e),e}function Fu(n){return n*Math.PI/180}const Ai=(function(){const n=[];for(let e=78271.51696402048;n.length<=24;e/=2)n.push(e);return n})();function Cl(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 bl(n,e){let t=0;const i=e.length;for(;t<i;++t)if(e[t]<n&&t+1<i){const s=e[t]/e[t+1];return t+Math.log(e[t]/n)/Math.log(s)}return i-1}function Uo(n,e){const t=Math.floor(n),i=Math.pow(2,n-t);return e[t]/i}const Es={};function ws(n,e,t={},i){if(e in Es)return i&&(i.url=Es[e][0].url),Es[e][1];const r=t.transformRequest&&t.transformRequest(e,n)||e,s=function(l){return delete Es[e],Promise.reject(new Error("Error fetching source "+e))},o=function(l){return delete Es[e],l.ok?l.json():Promise.reject(new Error("Error fetching source "+e))},a=qn(()=>r).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 Es[e]=[r,a],a}function Hp(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=wl(n,e.accessToken),ws("Style",n,e);else return Promise.resolve(n)}const Xp={};function Yp(n,e,t={}){const i=[e,JSON.stringify(n)].toString();let r=Xp[i];if(!r||t.transformRequest){let s;t.transformRequest&&(s=(a,l)=>{const c=t.transformRequest&&t.transformRequest(l,"Tiles")||l;if(a instanceof Np)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)})};qn(()=>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();qn(()=>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=vl(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=ws("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}")),vl(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}")),vl(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`"));Xp[i]=r}return r}function Kp(n,e,t,i){const r=[2*t*e.pixelRatio+e.width,2*t*e.pixelRatio+e.height],s=Cl(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;c<h;++c)for(let u=0,d=a.height;u<d;++u){const g=(u*h+c)*4;l[g+3]>0&&o.arc(c,u,t*e.pixelRatio,0,2*Math.PI)}return o.fill(),s}function kw(n,e,t){const i=Math.max(0,Math.min(1,(t-n)/(e-n)));return i*i*(3-2*i)}function Zp(n,e,t){const i=Cl(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;a<l;++a)for(let c=0,h=s.height;c<h;++c){const u=(c*l+a)*4,d=o[u+3]/255,g=.75,f=.1,p=kw(g-f,g+f,d);p>0?(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 Dw=Array(256).join(" ");function Lu(n,e){if(e>=.05){let t="";const i=n.split(`
25
- `),r=Dw.slice(0,Math.round(e/.1));for(let s=0,o=i.length;s<o;++s)s>0&&(t+=`
26
- `),t+=i[s].split("").join(r);return t}return n}let ku;function qp(){return ku||(ku=Cl(1,1).getContext("2d")),ku}function Rr(n,e){return qp().measureText(n).width+(n.length-1)*e}const Tl={};gr.on("propertychange",()=>{for(const n in Tl)delete Tl[n]});function Du(n,e,t,i){if(n.indexOf(`
27
- `)!==-1){const o=n.split(`
28
- `),a=[];for(let l=0,c=o.length;l<c;++l)a.push(Du(o[l],e,t,i));return a.join(`
29
- `)}const r=t+","+e+","+n+","+i;let s=Tl[r];if(!s){const o=n.split(" ");if(o.length>1){const a=qp();a.font=e;const c=a.measureText("M").width*t;let h="";const u=[];for(let d=0,g=o.length;d<g;++d){const f=o[d],p=h+(h?" ":"")+f;Rr(p,i)<=c?h=p:(h&&u.push(h),h=f)}h&&u.push(h);for(let d=0,g=u.length;d<g&&g>1;++d){const f=u[d];if(Rr(f,i)<c*.35){const p=d>0?Rr(u[d-1],i):1/0,A=d<g-1?Rr(u[d+1],i):1/0;u.splice(d,1),g-=1,p<A?(u[d-1]+=" "+f,d-=1):u[d]=f+" "+u[d]}}for(let d=0,g=u.length-1;d<g;++d){const f=u[d],p=u[d+1];if(Rr(f,i)>c*.7&&Rr(p,i)<c*.6){const A=f.split(" "),m=A.pop();Rr(m,i)<c*.2&&(u[d]=A.join(" "),u[d+1]=m+" "+p),g-=1}}s=u.join(`
30
- `)}else s=n;s=Lu(s,i),Tl[r]=s}return s}const Ow=["Arial","Courier New","Times New Roman","Verdana","sans-serif","serif","monospace","cursive","fantasy"],Qp={};function Gw(n,e="https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css"){if(ut)return n;let t;for(let i=0,r=n.length;i<r;++i){const s=n[i];if(s in Qp)continue;Qp[s]=!0;const a=xu(s,16).split(" ");t||(t=[]),t.push([a.slice(3).join(" ").replace(/"/g,""),a[1],a[0]])}return t&&(async()=>{await document.fonts.ready;for(let i=0,r=t.length;i<r;++i){const s=t[i],o=s[0];if(Ow.includes(o))continue;const a=s[1],l=s[2];if(!(await document.fonts.load(`${l} ${a} 16px "${o}"`)).some(h=>h.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 Bw={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Nw={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]},zw=function(n,e){const t=GE(n,e);if(t.result==="error")throw new Error(t.value.map(i=>`${i.key}: ${i.message}`).join(", "));return t.value},vt={zoom:0,distanceFromCenter:0};Yt.register(dl,{...Yt.definitions,pitch:[{kind:"number"},[],n=>vt.pitch||90],"distance-from-center":[{kind:"number"},[],n=>vt.distanceFromCenter||0]});let Rl,Ou;function H(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]||yt)[t];const c=qE[`${e}_${n.type}`][t];l===void 0&&(l=c.default);let h=OE(l);if(!h&&cp(l)&&(l=WE(l,c),h=!0),h){const u=zw(l,c);a[t]=u.evaluate.bind(u)}else{const u=c.type;(u==="color"||u==="colorArray")&&(l=we.parse(l)),a[t]=function(){return l}}}return a[t](vt,i,s)}function Jp(n,e,t,i){return H(n,"layout",`${t}-allow-overlap`,e,i)?H(n,"layout",`${t}-ignore-placement`,e,i)?"none":"obstacle":"declutter"}function jw(n,e,t,i){if(i||console.warn("No filterCache provided to evaluateFilter()"),!(n in i))try{i[n]=jE(e).filter}catch(r){console.warn("Filter will evaluate to false: "+r.message),i[n]=function(){return!1}}return i[n](vt,t)}function On(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 Uw=/\{[^{}}]*\}/g;function Gu(n,e){return n.replace(Uw,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 Bu={};function Nu(n,e,t,i=Ai,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.");Bu[Pu(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[_];qn(()=>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 I=await T.blob();C=URL.createObjectURL(I),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(I){I.data.action==="imageLoaded"&&I.data.src===v&&(l[_]={image:I.data.image,size:[I.data.image.width,I.data.image.height]})})}})}const c=Sg(e.layers),h={},u=[],d={},g={},f=Mu(e),p=Wp(e);let A;for(let _=0,w=c.length;_<w;++_){const v=c[_],C=v.id;if(typeof t=="string"&&v.source==t||Array.isArray(t)&&t.indexOf(C)!==-1){const b=v["source-layer"];if(A){if(v.source!==A)throw new Error(`Layer "${C}" does not use source "${A}`)}else{A=v.source;const I=e.sources[A];if(!I)throw new Error(`Source "${A}" is not defined`);const F=I.type;if(F!=="vector"&&F!=="geojson")throw new Error(`Source "${A}" is not of type "vector" or "geojson", but "${F}"`)}let T=h[b];T||(T=[],h[b]=T),T.push({layer:v,index:_}),u.push(C)}}const m=new ti,y=new Vt,E=[],x=function(_,w,v){var z,V,U;const C=((U=(V=(z=n.getSource)==null?void 0:z.call(n))==null?void 0:V.format_)==null?void 0:U.layerName_)??"mvt:layer",b=_.getProperties(),T=h[b[C]];if(!T)return;let I=i.indexOf(w);I==-1&&(I=bl(w,i)),vt.zoom=I,vt.distanceFromCenter=0;const F=_.getGeometry(),P=Bw[F.getType()],B=n.get("map");if(B&&B instanceof To&&P===1){const X=B.getSize();if(X){const D=B.getView().getCenter(),q=Ut(F.getExtent());vt.distanceFromCenter=tr(D,q)/w/X[1]}}const R={id:_.getId(),properties:b,type:P},S=n.get("mapbox-featurestate")[_.getId()];let L=-1;for(let X=0,D=T.length;X<D;++X){const q=T[X],O=q.layer,se=O.id;if(v!==void 0&&v!==se)continue;const Ce=O.layout||yt,ge=O.paint||yt;if(Ce.visibility==="none"||"minzoom"in O&&I<O.minzoom||"maxzoom"in O&&I>=O.maxzoom)continue;const We=O.filter;if(!We||jw(se,We,R,p)){let be,Fe,xi,_t,ft,j;const Ke=q.index;if(P==3&&(O.type=="fill"||O.type=="fill-extrusion"))if(Fe=H(O,"paint",O.type+"-opacity",R,f,S),O.type+"-pattern"in ge){const Le=H(O,"paint",O.type+"-pattern",R,f,S);if(Le){const Ie=typeof Le=="string"?Gu(Le,b):Le.toString(),Te=$p(Ie,l);if(r&&r[Ie]&&Te){++L,j=E[L],(!j||!j.getFill()||j.getStroke()||j.getText())&&(j=new rt({fill:new Vt}),E[L]=j),xi=j.getFill(),j.setZIndex(Ke);const me=Ie+"."+Fe;let Ze=g[me];if(!Ze){const oe=r[Ie],fe=Cl(oe.width,oe.height),qe=fe.getContext("2d");qe.globalAlpha=Fe,qe.drawImage(Te.image,oe.x,oe.y,oe.width,oe.height,0,0,oe.width,oe.height),Ze=qe.createPattern(fe,"repeat"),g[me]=Ze}xi.setColor(Ze)}}}else be=On(H(O,"paint",O.type+"-color",R,f,S),Fe),O.type+"-outline-color"in ge&&(ft=On(H(O,"paint",O.type+"-outline-color",R,f,S),Fe)),ft||(ft=be),(be||ft)&&(++L,j=E[L],(!j||be&&!j.getFill()||!be&&j.getFill()||ft&&!j.getStroke()||!ft&&j.getStroke()||j.getText())&&(j=new rt({fill:be?new Vt:void 0,stroke:ft?new ti:void 0}),E[L]=j),be&&(xi=j.getFill(),xi.setColor(be)),ft&&(_t=j.getStroke(),_t.setColor(ft),_t.setWidth(.5)),j.setZIndex(Ke));if(P!=1&&O.type=="line"){"line-pattern"in ge?be=void 0:be=On(H(O,"paint","line-color",R,f,S),H(O,"paint","line-opacity",R,f,S));const Le=H(O,"paint","line-width",R,f,S);be&&Le>0&&(++L,j=E[L],(!j||!j.getStroke()||j.getFill()||j.getText())&&(j=new rt({stroke:new ti}),E[L]=j),_t=j.getStroke(),_t.setLineCap(H(O,"layout","line-cap",R,f,S)),_t.setLineJoin(H(O,"layout","line-join",R,f,S)),_t.setMiterLimit(H(O,"layout","line-miter-limit",R,f,S)),_t.setColor(be),_t.setWidth(Le),_t.setLineDash(ge["line-dasharray"]?H(O,"paint","line-dasharray",R,f,S).map(function(Ie){return Ie*Le}):null),j.setZIndex(Ke))}let gt=!1,re=null,rn=0,si,Ve,Oi;if((P==1||P==2)&&"icon-image"in Ce){const Le=H(O,"layout","icon-image",R,f,S);if(Le){si=typeof Le=="string"?Gu(Le,b):Le.toString();let Ie;const Te=a?a(n,si):void 0,me=$p(si,l);if(r&&r[si]&&me||Te){const Ze=H(O,"layout","icon-rotation-alignment",R,f,S);if(P==2){const oe=_.getGeometry();if(oe.getFlatMidpoint||oe.getFlatMidpoints){const fe=oe.getExtent();if(Math.sqrt(Math.max(Math.pow((fe[2]-fe[0])/w,2),Math.pow((fe[3]-fe[1])/w,2)))>150){const Qe=oe.getType()==="MultiLineString"?oe.getFlatMidpoints():oe.getFlatMidpoint();if(Ou||(Rl=[NaN,NaN],Ou=new ht("Point",Rl,[],2,{},void 0)),Ie=Ou,Rl[0]=Qe[0],Rl[1]=Qe[1],H(O,"layout","symbol-placement",R,f,S)==="line"&&Ze==="map"){const qt=oe.getStride(),ot=oe.getFlatCoordinates();for(let at=0,Se=ot.length-qt;at<Se;at+=qt){const He=ot[at],bt=ot[at+1],ke=ot[at+qt],Je=ot[at+qt+1],on=Math.min(He,ke),kt=Math.max(He,ke),Dt=Qe[0],Ot=Qe[1],Ei=(Je-bt)*(Dt-He)-(ke-He)*(Ot-bt);if(Math.abs(Ei)<.001&&Dt<=kt&&Dt>=on){rn=Math.atan2(bt-Je,ke-He);break}}}}}}if(P!==2||Ie){const oe=H(O,"layout","icon-size",R,f,S),fe=ge["icon-color"]!==void 0?H(O,"paint","icon-color",R,f,S):null;if(!fe||fe.a!==0){const qe=H(O,"paint","icon-halo-color",R,f,S),Qe=H(O,"paint","icon-halo-width",R,f,S);let Zt=`${si}.${oe}.${Qe}.${qe}`;if(fe!==null&&(Zt+=`.${fe}`),Ve=d[Zt],!Ve){const qt=Jp(O,R,"icon",f);let ot;"icon-offset"in Ce&&(ot=H(O,"layout","icon-offset",R,f,S).slice(0),ot[0]*=oe,ot[1]*=-oe);let at=fe?[fe.r*255,fe.g*255,fe.b*255,fe.a]:void 0;if(Te){const Se={color:at,rotateWithView:Ze==="map",displacement:ot,declutterMode:qt,scale:oe};typeof Te=="string"?Se.src=Te:(Se.img=Te,Se.imgSize=[Te.width,Te.height]),Ve=new Ar(Se)}else{const Se=r[si];let He,bt,ke;if(Qe)Se.sdf?(He=Kp(Zp(me.image,Se,fe||[0,0,0,1]),{x:0,y:0,width:Se.width,height:Se.height,pixelRatio:Se.pixelRatio},Qe,qe),at=void 0):He=Kp(me.image,Se,Qe,qe);else{if(Se.sdf&&!me.unSDFed){const Je=Zp(me.image,{x:0,y:0,width:me.size[0],height:me.size[1]},{r:1,g:1,b:1});me.image=Je,me.unSDFed=!0}He=me.image,bt=[Se.width,Se.height],ke=[Se.x,Se.y]}Ve=new Ar({color:at,img:He,imgSize:me.size,size:bt,offset:ke,rotateWithView:Ze==="map",scale:oe/Se.pixelRatio,displacement:ot,declutterMode:qt})}d[Zt]=Ve}}Ve&&(++L,j=E[L],(!j||!j.getImage()||j.getFill()||j.getStroke())&&(j=new rt,E[L]=j),j.setGeometry(Ie),Ve.setRotation(rn+Fu(H(O,"layout","icon-rotate",R,f,S))),Ve.setOpacity(H(O,"paint","icon-opacity",R,f,S)),Ve.setAnchor(Nw[H(O,"layout","icon-anchor",R,f,S)]),j.setImage(Ve),re=j.getText(),j.setText(void 0),j.setZIndex(Ke),gt=!0,Oi=!1)}else Oi=!0}}}if(P==1&&O.type==="circle"){++L,j=E[L],(!j||!j.getImage()||j.getFill()||j.getStroke())&&(j=new rt,E[L]=j);const Le="circle-radius"in ge?H(O,"paint","circle-radius",R,f,S):5,Ie=On(H(O,"paint","circle-stroke-color",R,f,S),H(O,"paint","circle-stroke-opacity",R,f,S)),Te=H(O,"paint","circle-translate",R,f,S),me=On(H(O,"paint","circle-color",R,f,S),H(O,"paint","circle-opacity",R,f,S)),Ze=H(O,"paint","circle-stroke-width",R,f,S),oe=Le+"."+Ie+"."+me+"."+Ze+"."+Te[0]+"."+Te[1];Ve=d[oe],Ve||(Ve=new pr({radius:Le,displacement:[Te[0],-Te[1]],stroke:Ie&&Ze>0?new ti({width:Ze,color:Ie}):void 0,fill:me?new Vt({color:me}):void 0,declutterMode:"none"}),d[oe]=Ve),j.setImage(Ve),re=j.getText(),j.setText(void 0),j.setGeometry(void 0),j.setZIndex(Ke),gt=!0}let Be,Ne,sn,oi,Gi,Hn;if("text-field"in Ce){oi=Math.round(H(O,"layout","text-size",R,f,S));const Le=H(O,"layout","text-font",R,f,S);sn=H(O,"layout","text-line-height",R,f,S),Ne=xu(o?o(Le,e.metadata?e.metadata["ol:webfonts"]:void 0):Le,oi,sn),Ne.includes("sans-serif")||(Ne+=",sans-serif"),Gi=H(O,"layout","text-letter-spacing",R,f,S),Hn=H(O,"layout","text-max-width",R,f,S);const Ie=H(O,"layout","text-field",R,f,S);typeof Ie=="object"&&Ie.sections?Ie.sections.length===1?Be=Ie.toString():Be=Ie.sections.reduce((Te,me,Ze)=>{const oe=me.fontStack?me.fontStack.split(","):Le,fe=xu(o?o(oe):oe,oi*(me.scale||1),sn);let qe=me.text;if(qe===`
31
- `)return Te.push(`
32
- `,""),Te;if(P==2)return Te.push(Lu(qe,Gi),fe),Te;qe=Du(qe,fe,Hn,Gi).split(`
33
- `);for(let Qe=0,Zt=qe.length;Qe<Zt;++Qe)Qe>0&&Te.push(`
34
- `,""),Te.push(qe[Qe],fe);return Te},[]):Be=Gu(Ie,b).trim(),Fe=H(O,"paint","text-opacity",R,f,S)}if(Be&&Fe&&!Oi){gt||(++L,j=E[L],(!j||!j.getText()||j.getFill()||j.getStroke())&&(j=new rt,E[L]=j),j.setImage(void 0),j.setGeometry(void 0));const Le=Jp(O,R,"text",f);j.getText()||j.setText(re),re=j.getText(),(!re||"getDeclutterMode"in re&&re.getDeclutterMode()!==Le)&&(re=new Oa({padding:[2,2,2,2],declutterMode:Le}),j.setText(re));const Ie=H(O,"layout","text-transform",R,f,S);Ie=="uppercase"?Be=Array.isArray(Be)?Be.map((ke,Je)=>Je%2?ke:ke.toUpperCase()):Be.toUpperCase():Ie=="lowercase"&&(Be=Array.isArray(Be)?Be.map((ke,Je)=>Je%2?ke:ke.toLowerCase()):Be.toLowerCase());const Te=Array.isArray(Be)?Be:P==2?Lu(Be,Gi):Du(Be,Ne,Hn,Gi);if(re.setText(Te),re.setFont(Ne),re.setRotation(Fu(H(O,"layout","text-rotate",R,f,S))),typeof re.setKeepUpright=="function"){const ke=H(O,"layout","text-keep-upright",R,f,S);re.setKeepUpright(ke)}const me=H(O,"layout","text-anchor",R,f,S),Ze=gt||P==1?"point":H(O,"layout","symbol-placement",R,f,S);let oe;if(Ze==="line-center"?(re.setPlacement("line"),oe="center"):re.setPlacement(Ze),Ze==="line"&&typeof re.setRepeat=="function"){const ke=H(O,"layout","symbol-spacing",R,f,S);re.setRepeat(ke*2)}re.setOverflow(Ze==="point");let fe=H(O,"paint","text-halo-width",R,f,S);const qe=H(O,"layout","text-offset",R,f,S),Qe=H(O,"paint","text-translate",R,f,S);let Zt=0,qt=0;if(Ze=="point"){oe="center",me.indexOf("left")!==-1?(oe="left",qt=fe):me.indexOf("right")!==-1&&(oe="right",qt=-fe);const ke=H(O,"layout","text-rotation-alignment",R,f,S);re.setRotateWithView(ke=="map")}else re.setMaxAngle(Fu(H(O,"layout","text-max-angle",R,f,S))*Be.length/Te.length),re.setRotateWithView(!1);re.setTextAlign(oe);let ot="middle";me.indexOf("bottom")==0?(ot="bottom",Zt=-fe-.5*(sn-1)*oi):me.indexOf("top")==0&&(ot="top",Zt=fe+.5*(sn-1)*oi),re.setTextBaseline(ot);const at=H(O,"layout","text-justify",R,f,S);re.setJustify(at==="auto"?void 0:at),re.setOffsetX(qe[0]*oi+qt+Qe[0]),re.setOffsetY(qe[1]*oi+Zt+Qe[1]),y.setColor(On(H(O,"paint","text-color",R,f,S),Fe)),re.setFill(y);const Se=On(H(O,"paint","text-halo-color",R,f,S),Fe);if(Se&&fe>0){m.setColor(Se),fe*=2;const ke=.5*oi;m.setWidth(fe<=ke?fe:ke),re.setStroke(m)}else re.setStroke(void 0);const He=H(O,"layout","text-padding",R,f,S),bt=re.getPadding();He!==bt[0]&&(bt[0]=He,bt[1]=He,bt[2]=He,bt[3]=He),j.setZIndex(Ke)}}}if(L>-1)return E.length=L+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 zu=65536*65536,eA=1/zu,Vw=12,tA=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),ju=0,Sl=1,Vo=2,Il=5;class Ww{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<i;){const r=this.readVarint(),s=r>>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)*zu;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*zu;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,Hw(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>=Vw&&tA?tA.decode(this.buf.subarray(t,e)):rv(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.pos<i;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===Vo?this.readVarint()+this.pos:this.pos+1}skip(e){const t=e&7;if(t===ju)for(;this.buf[this.pos++]>127;);else if(t===Vo)this.pos=this.readVarint()+this.pos;else if(t===Il)this.pos+=4;else if(t===Sl)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(;t<this.pos+e;)t*=2;if(t!==this.length){const i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*eA),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*eA),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Xw(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=sv(this.buf,e,this.pos);const i=this.pos-t;i>=128&&iA(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<t;i++)this.buf[this.pos++]=e[i]}writeRawMessage(e,t){this.pos++;const i=this.pos;e(t,this);const r=this.pos-i;r>=128&&iA(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}writeMessage(e,t,i){this.writeTag(e,Vo),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,Zw,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,qw,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,$w,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,Qw,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Jw,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,ev,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,tv,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,iv,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,nv,t)}writeBytesField(e,t){this.writeTag(e,Vo),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,Il),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,Il),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,Sl),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,Sl),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,ju),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,ju),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,Vo),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,Il),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,Sl),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function Hw(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 vs(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function vs(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function Xw(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),Yw(t,i,e),Kw(i,e)}function Yw(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 Kw(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 iA(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 Zw(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t])}function qw(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t])}function Qw(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t])}function Jw(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t])}function $w(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t])}function ev(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t])}function tv(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t])}function iv(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t])}function nv(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t])}function rv(n,e,t){let i="",r=e;for(;r<t;){const s=n[r];let o=null,a=s>239?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 sv(n,e,t){for(let i=0,r,s;i<e.length;i++){if(r=e.charCodeAt(i),r>55295&&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 nA extends Tg{constructor(e){super(),e=e||{},this.dataProjection=new ca({code:"",units:"tile-pixels"}),this.featureClass=e.featureClass?e.featureClass:ht,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<s;){if(!a){const d=e.readVarint();o=d&7,a=d>>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=hv(r,c.length);if(this.featureClass===ht)s=new this.featureClass(h,l,c,2,o,a),s.transform(i.dataProjection);else{let u;if(h=="Polygon"){const f=jc(l,c);u=f.length>1?new Tn(l,"XY",f):new Jt(l,"XY",c)}else u=h==="Point"?new It(l,"XY"):h==="LineString"?new ii(l,"XY"):h==="MultiPoint"?new mr(l,"XY"):h==="MultiLineString"?new bn(l,"XY",c):null;const d=this.featureClass;s=new d,this.geometryName_&&s.setGeometryName(this.geometryName_);const g=Va(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=_e(t.dataProjection);r.setWorldExtent(t.extent),t.dataProjection=r;const s=new Ww(e),o=s.readFields(ov,{}),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<d;++u){const g=cv(s,c,u),f=this.createFeature_(s,g,t);f!==null&&a.push(f)}}return a}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}}function ov(n,e,t){if(n===3){const i={keys:[],values:[],features:[]},r=t.readVarint()+t.pos;t.readFields(av,i,r),i.length=i.features.length,i.length&&(e[i.name]=i)}}function av(n,e,t){if(n===15)e.version=t.readVarint();else if(n===1)e.name=t.readString();else if(n===5)e.extent=t.readVarint();else if(n===2)e.features.push(t.pos);else if(n===3)e.keys.push(t.readString());else if(n===4){let i=null;const r=t.readVarint()+t.pos;for(;t.pos<r;)n=t.readVarint()>>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 lv(n,e,t){if(n==1)e.id=t.readVarint();else if(n==2){const i=t.readVarint()+t.pos;for(;t.pos<i;){const r=e.layer.keys[t.readVarint()],s=e.layer.values[t.readVarint()];e.properties[r]=s}}else n==3?e.type=t.readVarint():n==4&&(e.geometry=t.pos)}function cv(n,e,t){n.pos=e.features[t];const i=n.readVarint()+n.pos,r={layer:e,type:0,properties:{}};return n.readFields(lv,r,i),r}function hv(n,e){let t;return n===1?t=e===1?"Point":"MultiPoint":n===2?t=e===1?"LineString":"MultiLineString":n===3&&(t="Polygon"),t}class uv extends Tu{constructor(e){super(e),this.image=null}getImage(){return this.image?this.image.getImage():null}prepareFrame(e){const t=e.layerStatesArray[e.layerIndex],i=e.pixelRatio,r=e.viewState,s=r.resolution,o=this.getLayer().getSource(),a=e.viewHints;let l=e.extent;if(t.extent!==void 0&&(l=xt(l,ci(t.extent,r.projection))),!a[De.ANIMATING]&&!a[De.INTERACTING]&&!er(l))if(o){const c=r.projection,h=o.getImage(l,s,i,c);h&&(this.loadImage(h)?this.image=h:h.getState()===W.EMPTY&&(this.image=null))}else this.image=null;return!!this.image}getData(e){const t=this.frameState;if(!t)return null;const i=this.getLayer(),r=$e(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!$n(s,r))return null;const o=this.image.getExtent(),a=this.image.getImage(),l=ne(o),c=Math.floor(a.width*((r[0]-o[0])/l));if(c<0||c>=a.width)return null;const h=Oe(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=ci(c.extent,u.projection);x=ze(b,e.extent),E=x&&!Ui(b,e.extent),E&&this.clipUnrotated(y,e,b)}const _=i.getImage(),w=Ti(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],I=c.opacity;I!==1&&(y.save(),y.globalAlpha=I),y.drawImage(_,0,0,+_.width,+_.height,b,T,v,C),I!==1&&y.restore()}return this.postRender(this.context,e),E&&y.restore(),y.imageSmoothingEnabled=!0,this.container}}class dv extends is{constructor(e){e=e||{},super(e)}}class Uu extends dv{constructor(e){super(e)}createRenderer(){return new uv(this)}getData(e){return super.getData(e)}}function Pl(n){return n instanceof Image||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof ImageBitmap?n:null}function fv(n){return n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Float32Array||n instanceof DataView?n:null}const gv=new Error("disposed");let Cs=null;function pv(n){Cs||(Cs=Me(n.width,n.height,void 0,{willReadFrequently:!0}));const e=Cs.canvas,t=n.width;e.width!==t&&(e.width=t);const i=n.height;return e.height!==i&&(e.height=i),Cs.clearRect(0,0,t,i),Cs.drawImage(n,0,0),Cs.getImageData(0,0,t,i).data}const Av=[256,256];class Ml extends jo{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=Pl(this.data_);return e?[e.width,e.height]:Av}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(gv),this.controller_=null),super.disposeInternal()}}let Vu;const bs=[];function rA(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 Wu(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-.75*255)>2}function mv(){if(Vu===void 0){const n=Me(6,6,bs);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",rA(n,4,5,4,0),rA(n,4,5,0,5);const e=n.getImageData(0,0,3,3).data;Vu=Wu(e,0)||Wu(e,4)||Wu(e,8),ro(n),bs.push(n.canvas)}return Vu}function Hu(n,e,t,i){const r=pa(t,e,n);let s=wc(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||$n(l,r)){const c=wc(n,s,r)/s;isFinite(c)&&c>0&&(s/=c)}return s}function sA(n,e,t,i){const r=Ut(t);let s=Hu(n,e,r,i);return(!isFinite(s)||s<=0)&&hc(t,function(o){return s=Hu(n,e,o,i),isFinite(s)&&s>0}),s}function oA(n,e,t,i,r,s,o,a,l,c,h,u,d,g){const f=Me(Math.round(t*n),Math.round(t*e),bs);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=jt();l.forEach(function(_,w,v){cc(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=Me(Math.round(ne(A)*y),Math.round(Oe(A)*y),bs),u||(m.imageSmoothingEnabled=!1),r&&g){const _=(r[0]-A[0])*y,w=-(r[3]-A[3])*y,v=ne(r)*y,C=Oe(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 F=(_.clipExtent[0]-A[0])*y,P=-(_.clipExtent[3]-A[3])*y,B=ne(_.clipExtent)*y,R=Oe(_.clipExtent)*y;m.rect(u?F:Math.round(F),u?P:Math.round(P),u?B:Math.round(F+B)-Math.round(F),u?R:Math.round(P+R)-Math.round(P)),m.clip()}const C=(_.extent[0]-A[0])*y,b=-(_.extent[3]-A[3])*y,T=ne(_.extent)*y,I=Oe(_.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?I:Math.round(b+I)-Math.round(b)),_.clipExtent&&m.restore()}})}const x=li(o);return a.getTriangles().forEach(function(_,w,v){const C=_.source,b=_.target;let T=C[0][0],I=C[0][1],F=C[1][0],P=C[1][1],B=C[2][0],R=C[2][1];const S=p((b[0][0]-x[0])/s),L=p(-(b[0][1]-x[1])/s),z=p((b[1][0]-x[0])/s),V=p(-(b[1][1]-x[1])/s),U=p((b[2][0]-x[0])/s),X=p(-(b[2][1]-x[1])/s),D=T,q=I;T=0,I=0,F-=D,P-=q,B-=D,R-=q;const O=[[F,P,0,0,z-S],[B,R,0,0,U-S],[0,0,F,P,V-L],[0,0,B,R,X-L]],se=sy(O);if(!se)return;if(f.save(),f.beginPath(),mv()||!u){f.moveTo(z,V);const ge=4,We=S-z,be=L-V;for(let Fe=0;Fe<ge;Fe++)f.lineTo(z+p((Fe+1)*We/ge),V+p(Fe*be/(ge-1))),Fe!=ge-1&&f.lineTo(z+p((Fe+1)*We/ge),V+p((Fe+1)*be/(ge-1)));f.lineTo(U,X)}else f.moveTo(z,V),f.lineTo(S,L),f.lineTo(U,X);f.clip(),f.transform(se[0],se[2],se[1],se[3],S,L),f.translate(A[0]-D,A[3]-q);let Ce;if(m)Ce=m.canvas,f.scale(E,-E);else{const ge=l[0],We=ge.extent;Ce=ge.image,f.scale(ne(We)/Ce.width,-Oe(We)/Ce.height)}f.drawImage(Ce,0,0),f.restore()}),m&&(ro(m),bs.push(m.canvas)),h&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach(function(_,w,v){const C=_.target,b=(C[0][0]-x[0])/s,T=-(C[0][1]-x[1])/s,I=(C[1][0]-x[0])/s,F=-(C[1][1]-x[1])/s,P=(C[2][0]-x[0])/s,B=-(C[2][1]-x[1])/s;f.beginPath(),f.moveTo(I,F),f.lineTo(b,T),f.lineTo(P,B),f.closePath(),f.stroke()}),f.restore()),f.canvas}const yv=10,aA=.25;class Xu{constructor(e,t,i,r,s,o,a){this.sourceProj_=e,this.targetProj_=t;let l={};const c=a?Hy(E=>$e(a,pa(E,this.targetProj_,this.sourceProj_))):rr(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=li(i),u=la(i),d=oa(i),g=sa(i),f=this.transformInv_(h),p=this.transformInv_(u),A=this.transformInv_(d),m=this.transformInv_(g),y=yv+(o?Math.max(0,Math.ceil(Math.log2(Zs(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<this.sourceWorldWidth_/2&&(x.source=_)}})}l={}}addTriangle_(e,t,i,r,s,o){this.triangles_.push({source:[r,s,o],target:[e,t,i]})}addQuad_(e,t,i,r,s,o,a,l,c){const h=mt([s,o,a,l]),u=this.sourceWorldWidth_?ne(h)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,g=this.sourceProj_.canWrapX()&&u>.5&&u<1;let f=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const A=mt([e,t,i,r]);f=ne(A)/this.targetWorldWidth_>aA||f}!g&&this.sourceProj_.isGlobal()&&u&&(f=u>aA||f)}if(!f&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!ze(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=(gn(s[0],d)+gn(a[0],d))/2-gn(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=jt();return this.triangles_.forEach(function(t,i,r){const s=t.source;Ks(e,s[0]),Ks(e,s[1]),Ks(e,s[2])}),e}getTriangles(){return this.triangles_}}const Yu=.5;class lA extends jo{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?xt(g,f):g;if(Zs(A)===0){this.state=G.EMPTY;return}const m=e.getExtent();m&&(p?p=xt(p,m):p=m);const y=r.getResolution(this.wrappedTileCoord_[0]),E=sA(e,i,A,y);if(!isFinite(E)||E<=0){this.state=G.EMPTY;return}const x=h!==void 0?h:Yu;if(this.triangulation_=new Xu(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])):_=xt(_,p)),!Zs(_))this.state=G.EMPTY;else{let w=0,v=0;e.canWrapX()&&(w=ne(m),v=Math.floor((_[0]-m[0])/w)),uc(_.slice(),e,!0).forEach(b=>{const T=t.getTileRangeForExtentAndZ(b,this.sourceZ_);for(let I=T.minX;I<=T.maxX;I++)for(let F=T.minY;F<=T.maxY;F++){const P=c(this.sourceZ_,I,F,a);if(P){const B=v*w;this.sourceTiles_.push({tile:P,offset:B})}}++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_=oA(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=ce(t,K.CHANGE,s=>{const o=t.getState();(o==G.LOADED||o==G.ERROR||o==G.EMPTY)&&(Re(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(Re),this.sourcesListenerKeys_=null}release(){this.canvas_&&(ro(this.canvas_.getContext("2d")),bs.push(this.canvas_),this.canvas_=null),super.release()}}class cA{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 js&&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 ye(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 ye(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){ye(!(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 Fl(n,e,t,i){return i!==void 0?(i[0]=n,i[1]=e,i[2]=t,i):[n,e,t]}function _v(n,e,t){return n+"/"+e+"/"+t}function Wo(n,e,t,i,r){return`${Y(n)},${e},${_v(t,i,r)}`}function xv(n){return hA(n[0],n[1],n[2])}function hA(n,e,t){return(e<<n)+t}function Ev(n,e){const t=n[0],i=n[1],r=n[2];if(e.getMinZoom()>t||t>e.getMaxZoom())return!1;const s=e.getFullTileRange(t);return s?s.containsXY(i,r):!0}function Ku(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 wv(n,e,t){const i=n[t];return i?i.delete(e):!1}function uA(n,e){const t=n.layerStatesArray[n.layerIndex];t.extent&&(e=xt(e,ci(t.extent,n.viewState.projection)));const i=t.layer.getRenderSource();if(!i.getWrapX()){const r=i.getTileGridForProjection(n.viewState.projection).getExtent();r&&(e=xt(e,r))}return e}class dA extends Tu{constructor(e,t){super(e),t=t||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=jt(),this.tempTileRange_=new Ru(0,0,0,0),this.tempTileCoord_=Fl(0,0,0);const i=t.cacheSize!==void 0?t.cacheSize:512;this.tileCache_=new cA(i),this.sourceTileCache_=null,this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||(this.sourceTileCache_=new cA(512)),this.sourceTileCache_}getOrCreateTile(e,t,i,r){const s=this.tileCache_,a=this.getLayer().getSource(),l=Wo(a,a.getKey(),e,t,i);let c;if(s.containsKey(l))c=s.get(l);else{const h=r.viewState.projection,u=a.getProjection();if(c=a.getTile(e,t,i,r.pixelRatio,h,!u||tt(u,h)?void 0:this.getSourceTileCache()),!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=$e(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!$n(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=it(l.getTileSize(h)),p=l.getResolution(h);let A;if(d instanceof Gp||d instanceof lA)A=d.getImage();else if(d instanceof Ml){if(A=Pl(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){var r;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.renderedSourceRevision_?this.renderedSourceRevision_!==i&&(this.renderedSourceRevision_=i,this.renderedSourceKey_===t.getKey()&&(this.tileCache_.clear(),(r=this.sourceTileCache_)==null||r.clear())):this.renderedSourceRevision_=i,!0}enqueueTilesForNextExtent(){return!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?Hd(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(!_||!Ku(r,_,A))continue;const v=_.getKey();if(u[v]=!0,_.getState()===G.IDLE&&!e.tileQueue.isKeyQueued(v)){const C=Fl(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;l<a.length;++l){const c=Wo(this.getLayer().getSource(),a[l],r,s,o);if(i.containsKey(c)){const h=i.peek(c);if(h.getState()===G.LOADED)return h.endTransition(Y(this)),Ku(t,h,r),!0}}return!1}findAltTiles_(e,t,i,r){const s=e.getTileRangeForTileCoordAndZ(t,i,this.tempTileRange_);if(!s)return!1;let o=!0;const a=this.tileCache_,l=this.getLayer().getRenderSource(),c=l.getKey();for(let h=s.minX;h<=s.maxX;++h)for(let u=s.minY;u<=s.maxY;++u){const d=Wo(l,c,i,h,u);let g=!1;if(a.containsKey(d)){const f=a.peek(d);f.getState()===G.LOADED&&(Ku(r,f,i),g=!0)}g||(o=!1)}return o}renderFrame(e,t){this.renderComplete=!0;const i=e.layerStatesArray[e.layerIndex],r=e.viewState,s=r.projection,o=r.resolution,a=r.center,l=e.pixelRatio,c=this.getLayer(),h=c.getSource(),u=h.getTileGridForProjection(s),d=u.getZForResolution(o,h.zDirection),g=u.getResolution(d),f=h.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==f&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=f):this.renderedSourceKey_=f;let p=e.extent;const A=h.getTilePixelRatio(l);this.prepareContainer(e,t);const m=this.context.canvas.width,y=this.context.canvas.height,E=i.extent&&ci(i.extent);E&&(p=xt(p,ci(i.extent)));const x=g*m/2/A,_=g*y/2/A,w=[a[0]-x,a[1]-_,a[0]+x,a[1]+_],v={};this.renderedTiles.length=0;const C=c.getPreload();if(e.nextExtent&&this.enqueueTilesForNextExtent()){const z=u.getZForResolution(r.nextResolution,h.zDirection),V=uA(e,e.nextExtent);this.enqueueTiles(e,V,z,v,C)}const b=uA(e,p);if(this.enqueueTiles(e,b,d,v,0),C>0&&setTimeout(()=>{this.enqueueTiles(e,b,d-1,v,C-1)},0),!(d in v))return this.container;const T=Y(this),I=e.time;for(const z of v[d]){const V=z.getState();if(V===G.EMPTY)continue;const U=z.tileCoord;if(V===G.LOADED&&z.getAlpha(T,I)===1){z.endTransition(T);continue}if(V!==G.ERROR&&(this.renderComplete=!1),this.findStaleTile_(U,v)){wv(v,z,d),e.animate=!0;continue}if(this.findAltTiles_(u,U,d+1,v))continue;const q=u.getMinZoom();for(let O=d-1;O>=q&&!this.findAltTiles_(u,U,O,v);--O);}const F=g/o*l/A,P=this.getRenderContext(e);Ti(this.tempTransform,m/2,y/2,F,F,0,-m/2,-y/2),i.extent&&this.clipUnrotated(P,e,E),h.getInterpolate()||(P.imageSmoothingEnabled=!1),this.preRender(P,e);const B=Object.keys(v).map(Number);B.sort(wi);let R;const S=[],L=[];for(let z=B.length-1;z>=0;--z){const V=B[z],U=h.getTilePixelSize(V,l,s),D=u.getResolution(V)/g,q=U[0]*D*F,O=U[1]*D*F,se=u.getTileCoordForCoordAndZ(li(w),V),Ce=u.getTileCoordExtent(se),ge=$e(this.tempTransform,[A*(Ce[0]-w[0])/g,A*(w[3]-Ce[3])/g]),We=A*h.getGutterForProjection(s);for(const be of v[V]){if(be.getState()!==G.LOADED)continue;const Fe=be.tileCoord,xi=se[1]-Fe[1],_t=Math.round(ge[0]-(xi-1)*q),ft=se[2]-Fe[2],j=Math.round(ge[1]-(ft-1)*O),Ke=Math.round(ge[0]-xi*q),gt=Math.round(ge[1]-ft*O),re=_t-Ke,rn=j-gt,si=B.length===1;let Ve=!1;R=[Ke,gt,Ke+re,gt,Ke+re,gt+rn,Ke,gt+rn];for(let Oi=0,Be=S.length;Oi<Be;++Oi)if(!si&&V<L[Oi]){const Ne=S[Oi];ze([Ke,gt,Ke+re,gt+rn],[Ne[0],Ne[3],Ne[4],Ne[7]])&&(Ve||(P.save(),Ve=!0),P.beginPath(),P.moveTo(R[0],R[1]),P.lineTo(R[2],R[3]),P.lineTo(R[4],R[5]),P.lineTo(R[6],R[7]),P.moveTo(Ne[6],Ne[7]),P.lineTo(Ne[4],Ne[5]),P.lineTo(Ne[2],Ne[3]),P.lineTo(Ne[0],Ne[1]),P.clip())}S.push(R),L.push(V),this.drawTile(be,e,Ke,gt,re,rn,We,si),Ve&&P.restore(),this.renderedTiles.unshift(be),this.updateUsedTiles(e.usedTiles,h,be)}}if(this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!Vi(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.postRender(this.context,e),i.extent&&P.restore(),P.imageSmoothingEnabled=!0,this.renderComplete){const z=(V,U)=>{var O;const X=Y(h),D=U.wantedTiles[X],q=D?Object.keys(D).length:0;this.updateCacheSize(q),this.tileCache_.expireCache(),(O=this.sourceTileCache_)==null||O.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 Ml){if(c=Pl(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 Gn={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class vv extends is{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(Gn.PRELOAD)}setPreload(e){this.set(Gn.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Gn.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Gn.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}class Ll extends vv{constructor(e){super(e)}createRenderer(){return new dA(this,{cacheSize:this.getCacheSize()})}}const Cv={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},fA={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class bv extends dA{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=St(),this.tileClipContexts_=null}enqueueTilesForNextExtent(){return this.getLayer().getRenderMode()!=="vector"}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 o=r.viewState,a=o.resolution,l=r.viewHints,c=this.getLayer().getSource(),h=c.getTileGridForProjection(o.projection),u=!(l[De.ANIMATING]||l[De.INTERACTING]),d=h.getZForResolution(a,c.zDirection)===e;return u&&d?s.wantedResolution=a:s.wantedResolution||(s.wantedResolution=h.getResolution(e)),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<m;++A){const y=f[A];if(y.getState()!=G.LOADED)continue;const E=c.getProjection(),x=y.tileCoord;let _=u.getTileCoordExtent(x);i&&E&&!tt(i,E)&&(_=Aa(_,E,i,32));const w=xt(g,_),v=ji(w,r.getRenderBuffer()*a,this.tempExtent),C=Vi(_,w)?null:v,b=new Pp(0,w,a,t),T=Eu(a,t),I=function(S,L){let z;const V=S.getStyleFunction()||r.getStyleFunction();if(V&&(z=V(S,a)),z){const U=this.renderFeature(S,T,z,b,h,L);l.dirty=l.dirty||U}},F=y.getFeatures();o&&o!==l.renderedRenderOrder&&F.sort(o);for(let S=0,L=F.length;S<L;++S){let z=F[S];i&&y.projection&&!tt(i,y.projection)&&(z=z.clone(),z.getGeometry().applyTransform(rr(y.projection,i))),(!C||ze(C,z.getGeometry().getExtent()))&&I.call(this,z,S)}const P=b.finish(),B=r.getRenderMode()!=="vector"&&h&&f.length===1?null:w,R=new Lp(B,a,t,c.getOverlaps(),P,r.getRenderBuffer(),!0);e.executorGroups[p].push(R)}l.renderedRevision=s,l.renderedRenderOrder=o,l.renderedResolution=a}forEachFeatureAtCoordinate(e,t,i,r,s){var E,x;const o=t.viewState.resolution,a=t.viewState.rotation;i=i??0;const l=this.getLayer(),h=l.getSource().getTileGridForProjection(t.viewState.projection),u=mt([e]);ji(u,o*i,u);const d={},g=function(_,w,v){let C=_.getId();C===void 0&&(C=Y(_));const b=d[C];if(b){if(b!==!0&&v<b.distanceSq){if(v===0)return d[C]=!0,s.splice(s.lastIndexOf(b),1),r(_,l,w);b.geometry=w,b.distanceSq=v}}else{if(v===0)return d[C]=!0,r(_,l,w);s.push(d[C]={feature:_,layer:l,geometry:w,distanceSq:v,callback:r})}},f=this.renderedTiles,p=Y(l),A=l.getDeclutter(),m=A?(x=(E=t.declutter)==null?void 0:E[A])==null?void 0:x.all().map(_=>_.value):null;let y;e:for(let _=0,w=f.length;_<w;++_){const v=f[_],C=h.getTileCoordExtent(v.wrappedTileCoord);if(!ze(C,u))continue;const b=v.executorGroups[p];for(let T=0,I=b.length;T<I;++T)if(y=b[T].forEachFeatureAtCoordinate(e,o,a,i,g,m),y)break e}return y}getFeatures(e){return this.renderedTiles.length===0?Promise.resolve([]):new Promise((t,i)=>{const r=this.getLayer(),s=r.getSource(),o=this.renderedProjection,a=o.getExtent(),l=this.renderedResolution,c=s.getTileGridForProjection(o),h=$e(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()&&!Ui(a,c.getTileCoordExtent(d.tileCoord))&&gc(h,o);const g=Y(r),f=c.getTileCoordExtent(d.wrappedTileCoord),p=li(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=it(c.getTileSize(c.getZForResolution(l,s.zDirection))),x=this.renderedRotation_,_=[this.getRenderTransform(c.getTileCoordCenter(d.wrappedTileCoord),l,0,Kt,E[0]*Kt,E[1]*Kt,0)];y=kp(E,_,m,r.getStyleFunction(),c.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(r).renderedResolution,x),d.hitDetectionImageData[g]=y}t(Dp(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<u;++h){const d=c[h],g=d.getKey();if(g in a)continue;a[g]=!0;const f=d.tileCoord;if(ze(e,s.getTileCoordExtent(f))){const p=d.getFeatures();if(p)for(let A=0,m=p.length;A<m;++A){const y=p[A],E=y.getGeometry();ze(e,E.getExtent())&&t.push(y)}}}}),t}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e,t){var d;const i=this.context,r=i.globalAlpha;i.globalAlpha=t.opacity;const s=e.viewHints,o=!(s[De.ANIMATING]||s[De.INTERACTING]),a=[this.context.canvas.width,this.context.canvas.height],l=this.getLayer().getDeclutter(),c=l?(d=e.declutter)==null?void 0:d[l]:void 0,h=Y(this.getLayer()),u=this.renderedTiles;for(let g=0,f=u.length;g<f;++g){const p=u[g],A=p.executorGroups[h];if(A)for(let m=A.length-1;m>=0;--m)A[m].execute(this.context,a,this.getTileRenderTransform(p,e),e.viewState.rotation,o,El,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<c;++l){const h=r[l].executorGroup.getDeferredZIndexContexts();for(const u in h)o[u]=!0}Object.keys(o).map(Number).sort(wi).forEach(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 bc(Rc(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[De.ANIMATING]||i[De.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?fA[o].filter(w=>!El.includes(w)):fA[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 I=!1;const F=C[0].getClipCoords(b);let P=e,B;if(F){B=new vu,P=B.getContext();for(let R=0,S=A.length;R<S;++R)if(f!==T&&T<m[R]){const L=A[R];ze([F[0],F[3],F[4],F[7]],[L[0],L[3],L[4],L[7]])&&(I||(P.save(),I=!0),P.beginPath(),P.moveTo(F[0],F[1]),P.lineTo(F[2],F[3]),P.lineTo(F[4],F[5]),P.lineTo(F[6],F[7]),P.moveTo(L[6],L[7]),P.lineTo(L[4],L[5]),P.lineTo(L[2],L[3]),P.lineTo(L[0],L[1]),P.clip())}A.push(F),m.push(T)}for(let R=0,S=C.length;R<S;++R)C[R].execute(e,[e.canvas.width,e.canvas.height],b,u,r,c,(_=t.declutter)==null?void 0:_[l]);I&&(P===e?P.restore():y[w]=B)}e.globalAlpha=a,this.ready=x,this.tileClipContexts_=y,t.declutter||this.renderDeferredInternal(t),super.postRender(e,t)}renderFeature(e,t,i,r,s,o){if(!i)return!1;let a=!1;if(Array.isArray(i))for(let l=0,c=i.length;l<c;++l)a=yl(r,e,i[l],t,this.boundHandleStyleImageChange_,void 0,s,o)||a;else a=yl(r,e,i,t,this.boundHandleStyleImageChange_,void 0,s,o);return a}tileImageNeedsRender_(e){const t=this.getLayer();if(t.getRenderMode()==="vector")return!1;const i=e.getReplayState(t),r=t.getRevision(),s=e.wantedResolution;return i.renderedTileResolution!==s||i.renderedTileRevision!==r}renderTileImage_(e,t){const i=this.getLayer(),r=e.getReplayState(i),s=i.getRevision(),o=e.executorGroups[Y(i)];r.renderedTileRevision=s;const a=e.wrappedTileCoord,l=a[0],c=i.getSource();let h=t.pixelRatio;const d=t.viewState.projection,g=c.getTileGridForProjection(d),f=g.getResolution(e.tileCoord[0]),p=t.pixelRatio/e.wantedResolution*f,A=g.getResolution(l),m=e.getContext();h=Math.round(Math.max(h,p/h));const y=c.getTilePixelSize(l,h,d);m.canvas.width=y[0],m.canvas.height=y[1];const E=h/p;if(E!==1){const v=ff(this.tmpTransform_);Rc(v,E,E),m.setTransform.apply(m,v)}const x=g.getTileCoordExtent(a,this.tempExtent),_=p/A,w=ff(this.tmpTransform_);Rc(w,_,-_),qy(w,-x[0],-x[3]);for(let v=0,C=o.length;v<C;++v)o[v].execute(m,[m.canvas.width*E,m.canvas.height*E],w,0,!0,Cv[i.getRenderMode()],null);r.renderedTileResolution=e.wantedResolution}}class Sr extends Rh{constructor(e){e=e||{};const t=Object.assign({},e);delete t.preload;const i=e.cacheSize===void 0?0:e.cacheSize;delete e.cacheSize,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=i;const r=e.renderMode||"hybrid";ye(r=="hybrid"||r=="vector","`renderMode` must be `'hybrid'` or `'vector'`"),this.renderMode_=r,this.setPreload(e.preload?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError!==void 0?e.useInterimTilesOnError:!0),this.getBackground,this.setBackground}createRenderer(){return new bv(this,{cacheSize:this.cacheSize_})}getFeatures(e){return super.getFeatures(e)}getFeaturesInExtent(e){return this.getRenderer().getFeaturesInExtent(e)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(Gn.PRELOAD)}getUseInterimTilesOnError(){return this.get(Gn.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(Gn.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(Gn.USE_INTERIM_TILES_ON_ERROR,e)}}function Zu(n){return Array.isArray(n)?Math.min(...n):n}class Tv extends xh{constructor(e,t,i,r,s,o,a){let l=e.getExtent();l&&e.canWrapX()&&(l=l.slice(),l[0]=-1/0,l[2]=1/0);let c=t.getExtent();c&&t.canWrapX()&&(c=c.slice(),c[0]=-1/0,c[2]=1/0);const h=c?xt(i,c):i,u=Ut(h),d=Hu(e,t,u,r),g=Yu,f=new Xu(e,t,h,l,d*g,r),p=f.calculateSourceExtent(),A=er(p)?null:o(p,d,s),m=A?W.IDLE:W.EMPTY,y=A?A.getPixelRatio():1;super(i,r,y,m),this.targetProj_=t,this.maxSourceExtent_=l,this.triangulation_=f,this.targetResolution_=r,this.targetExtent_=i,this.sourceImage_=A,this.sourcePixelRatio_=y,this.interpolate_=a,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==W.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const e=this.sourceImage_.getState();if(e==W.LOADED){const t=ne(this.targetExtent_)/this.targetResolution_,i=Oe(this.targetExtent_)/this.targetResolution_;this.canvas_=oA(t,i,this.sourcePixelRatio_,Zu(this.sourceImage_.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_,!0)}this.state=e,this.changed()}load(){if(this.state==W.IDLE){this.state=W.LOADING,this.changed();const e=this.sourceImage_.getState();e==W.LOADED||e==W.ERROR?this.reproject_():(this.sourceListenerKey_=ce(this.sourceImage_,K.CHANGE,t=>{const i=this.sourceImage_.getState();(i==W.LOADED||i==W.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){Re(this.sourceListenerKey_),this.sourceListenerKey_=null}}const kl=4,qu={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class Rv extends Nt{constructor(e,t){super(e),this.image=t}}class gA extends ms{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=ea(t,e,0);e=t[i]}return e}getImage(e,t,i,r){const s=this.getProjection();if(!s||!r||tt(s,r))return s&&(r=s),this.getImageInternal(e,t,i,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&tt(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&Vi(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Tv(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=Sv(e,t,i,1),o=this.findNearestResolution(t);if(this.image&&(this.static_||this.wantedProjection_===r&&(this.wantedExtent_&&Ui(this.wantedExtent_,s)||Ui(this.image.getExtent(),s))&&(this.wantedResolution_&&Zu(this.wantedResolution_)===o||Zu(this.image.getResolution())===o)))return this.image;this.wantedProjection_=r,this.wantedExtent_=s,this.wantedResolution_=o,this.image=new xh(s,o,i,this.loader),this.image.addEventListener(K.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(e){const t=e.target;let i;switch(t.getState()){case W.LOADING:this.loading=!0,i=qu.IMAGELOADSTART;break;case W.LOADED:this.loading=!1,i=qu.IMAGELOADEND;break;case W.ERROR:this.loading=!1,i=qu.IMAGELOADERROR;break;default:return}this.hasListener(i)&&this.dispatchEvent(new Rv(i,t))}}function Sv(n,e,t,i){const r=e/t,s=Ut(n),o=pn(ne(n)/r,kl),a=pn(Oe(n)/r,kl),l=pn((i-1)*o/2,kl),c=o+2*l,h=pn((i-1)*a/2,kl),u=a+2*h;return aa(s,r,0,[c,u])}const Ts=[0,0,0],Bn=5;class Dl{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,ye(Zm(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<s;++r)if(!t)t=this.resolutions_[r]/this.resolutions_[r+1];else if(this.resolutions_[r]/this.resolutions_[r+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,ye(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=e.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=li(i)),ye(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,ye(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:Hc,ye(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=i!==void 0?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((r,s)=>{const o=new Ru(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=xs(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){if(this.zoomFactor_===2){const s=e[1]*2,o=e[2]*2;return xs(s,s+1,o,o+1,t)}const r=this.getTileCoordExtent(e,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,i){if(t>this.maxZoom||t<this.minZoom)return null;const r=e[0],s=e[1],o=e[2];if(t===r)return xs(s,o,s,o,i);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,t-r),c=Math.floor(s*l),h=Math.floor(o*l);if(t<r)return xs(c,c,h,h,i);const u=Math.floor(l*(s+1))-1,d=Math.floor(l*(o+1))-1;return xs(c,u,h,d,i)}const a=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,t,i)}getTileRangeForExtentAndZ(e,t,i){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,Ts);const r=Ts[1],s=Ts[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,Ts);const o=Ts[1],a=Ts[2];return xs(r,o,s,a,i)}getTileCoordCenter(e){const t=this.getOrigin(e[0]),i=this.getResolution(e[0]),r=it(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*i,t[1]-(e[2]+.5)*r[1]*i]}getTileCoordExtent(e,t){const i=this.getOrigin(e[0]),r=this.getResolution(e[0]),s=it(this.getTileSize(e[0]),this.tmpSize_),o=i[0]+e[1]*s[0]*r,a=i[1]-(e[2]+1)*s[1]*r,l=o+s[0]*r,c=a+s[1]*r;return bi(o,a,l,c,t)}getTileCoordForCoordAndResolution(e,t,i){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,i)}getTileCoordForXYAndResolution_(e,t,i,r,s){const o=this.getZForResolution(i),a=i/this.getResolution(o),l=this.getOrigin(o),c=it(this.getTileSize(o),this.tmpSize_);let h=a*(e-l[0])/i/c[0],u=a*(l[1]-t)/i/c[1];return r?(h=pn(h,Bn)-1,u=pn(u,Bn)-1):(h=ra(h,Bn),u=ra(u,Bn)),Fl(o,h,u,s)}getTileCoordForXYAndZ_(e,t,i,r,s){const o=this.getOrigin(i),a=this.getResolution(i),l=it(this.getTileSize(i),this.tmpSize_);let c=(e-o[0])/a/l[0],h=(o[1]-t)/a/l[1];return r?(c=pn(c,Bn)-1,h=pn(h,Bn)-1):(c=ra(c,Bn),h=ra(h,Bn)),Fl(i,c,h,s)}getTileCoordForCoordAndZ(e,t,i){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,i)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){const i=ea(this.resolutions_,e,t||0);return Pe(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return bf(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const t=this.resolutions_.length,i=new Array(t);for(let r=this.minZoom;r<t;++r)i[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=i}}function Ol(n){let e=n.getDefaultTileGrid();return e||(e=Mv(n),n.setDefaultTileGrid(e)),e}function Iv(n,e,t){const i=e[0],r=n.getTileCoordCenter(e),s=Ho(t);if(!$n(s,r)){const o=ne(s),a=Math.ceil((s[0]-r[0])/o);return r[0]+=o*a,n.getTileCoordForCoordAndZ(r,i)}return e}function Pv(n,e,t,i){i=i!==void 0?i:"top-left";const r=pA(n,e,t);return new Dl({extent:n,origin:cy(n,i),resolutions:r,tileSize:t})}function Gl(n){const e=n||{},t=e.extent||_e("EPSG:3857").getExtent(),i={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:pA(t,e.maxZoom,e.tileSize,e.maxResolution)};return new Dl(i)}function pA(n,e,t,i){e=e!==void 0?e:Mf,t=it(t!==void 0?t:Hc);const r=Oe(n),s=ne(n);i=i>0?i:Math.max(s/t[0],r/t[1]);const o=e+1,a=new Array(o);for(let l=0;l<o;++l)a[l]=i/Math.pow(2,l);return a}function Mv(n,e,t,i){const r=Ho(n);return Pv(r,e,t,i)}function Ho(n){n=_e(n);let e=n.getExtent();if(!e){const t=180*An.degrees/n.getMetersPerUnit();e=bi(-t,-t,t,t)}return e}class Qu extends ms{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const t=[256,256];this.tileGrid&&it(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),t),this.tmpSize=[0,0],this.key_=e.key||Y(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,i,r,s,o){return Q()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:Ol(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=this.getTilePixelRatio(t),o=it(r.getTileSize(e),this.tmpSize);return s==1?o:h_(o,s,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){const i=t!==void 0?t:this.getProjection(),r=t!==void 0?this.getTileGridForProjection(i):this.tileGrid||this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(e=Iv(r,e,i)),Ev(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class AA extends Nt{constructor(e,t){super(e),this.tile=t}}function mA(n){return function(e){const t=e.buffers,i=e.meta,r=e.imageOps,s=e.width,o=e.height,a=t.length,l=t[0].byteLength;if(r){const d=new Array(a);for(let f=0;f<a;++f)d[f]=new ImageData(new Uint8ClampedArray(t[f]),s,o);return n(d,i).data.buffer}const c=new Uint8ClampedArray(l),h=new Array(a),u=new Array(a);for(let d=0;d<a;++d)h[d]=new Uint8ClampedArray(t[d]),u[d]=[0,0,0,0];for(let d=0;d<l;d+=4){for(let f=0;f<a;++f){const p=h[f];u[f][0]=p[d],u[f][1]=p[d+1],u[f][2]=p[d+2],u[f][3]=p[d+3]}const g=n(u,i);c[d]=g[0],c[d+1]=g[1],c[d+2]=g[2],c[d+3]=g[3]}return c.buffer}}function Fv(n,e){const i=Object.keys(n.lib||{}).map(function(s){return"const "+s+" = "+n.lib[s].toString()+";"}).concat(["const __minion__ = ("+mA.toString()+")(",n.operation.toString(),");",'self.addEventListener("message", function(event) {'," const buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Worker(typeof Blob>"u"?"data:text/javascript;base64,"+Buffer.from(i.join(`
35
- `),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",e),r}function Lv(n,e){const t=mA(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 kv extends js{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;r<t;++r)i[r]=Fv(e,this.onWorkerMessage_.bind(this,r));else i[0]=Lv(e,this.onWorkerMessage_.bind(this,0));this.workers_=i,this.queue_=[],this.maxQueueLength_=e.queue||1/0,this.running_=0,this.dataLookup_={},this.job_=null}process(e,t,i){this.enqueue_({inputs:e,meta:t,callback:i}),this.dispatch_()}enqueue_(e){for(this.queue_.push(e);this.queue_.length>this.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;l<s;++l){const c=l*a,h=[];for(let u=0,d=r.length;u<d;++u)h.push(r[u].slice(c,c+a));this.workers_[l].postMessage({buffers:h,meta:e.meta,imageOps:this.imageOps_,width:t,height:i},h)}}onWorkerMessage_(e,t){this.disposed||(this.dataLookup_[e]=t.data,--this.running_,this.running_===0&&this.resolveJob_())}resolveJob_(){const e=this.job_,t=this.workers_.length;let i,r;if(t===1)i=new Uint8ClampedArray(this.dataLookup_[0].buffer),r=this.dataLookup_[0].meta;else{const s=e.inputs[0].data.length;i=new Uint8ClampedArray(s),r=new Array(t);const o=4*Math.ceil(s/4/t);for(let a=0;a<t;++a){const l=this.dataLookup_[a].buffer,c=a*o;i.set(new Uint8ClampedArray(l),c),r[a]=this.dataLookup_[a].meta}}this.job_=null,this.dataLookup_={},e.callback(null,new ImageData(i,e.inputs[0].width,e.inputs[0].height),r),this.dispatch_()}disposeInternal(){for(let e=0;e<this.workers_.length;++e)this.workers_[e].terminate();this.workers_.length=0}}const yA={BEFOREOPERATIONS:"beforeoperations",AFTEROPERATIONS:"afteroperations"};class _A extends Nt{constructor(e,t,i){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=i}}class Ju extends gA{constructor(e){super({projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=e.operationType!==void 0?e.operationType:"pixel",this.threads_=e.threads!==void 0?e.threads:1,this.layers_=Gv(e.sources);const t=this.changed.bind(this);for(let i=0,r=this.layers_.length;i<r;++i)this.layers_[i].addEventListener(K.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new zd(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:St(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:Ov(this.layers_),pixelRatio:1,pixelToCoordinateTransform:St(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:Y(this),renderTargets:{}},this.setAttributions(function(i){var s;const r=[];for(let o=0,a=e.sources.length;o<a;++o){const l=e.sources[o],c=l instanceof ms?l:l.getSource();if(!c)continue;const h=(s=c.getAttributions())==null?void 0:s(i);typeof h=="string"?r.push(h):h!==void 0&&r.push(...h)}return r}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new kv({operation:e,imageOps:this.operationType_==="image",queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,i){const r=Object.assign({},this.frameState_);r.viewState=Object.assign({},r.viewState);const s=Ut(e);r.size[0]=Math.ceil(ne(e)/t),r.size[1]=Math.ceil(Oe(e)/t),r.extent=[s[0]-r.size[0]*t/2,s[1]-r.size[1]*t/2,s[0]+r.size[0]*t/2,s[1]+r.size[1]*t/2],r.time=Date.now();const o=r.viewState;return o.center=s,o.projection=i,o.resolution=t,r}allSourcesReady_(){let e=!0,t;for(let i=0,r=this.layers_.length;i<r;++i)if(t=this.layers_[i].getSource(),!t||t.getState()!=="ready"){e=!1;break}return e}getImage(e,t,i,r){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16),t=this.findNearestResolution(t);const s=this.updateFrameState_(e,t,r);if(this.requestedFrameState_=s,this.renderedImageCanvas_){const o=this.renderedImageCanvas_.getResolution(),a=this.renderedImageCanvas_.getExtent();(t!==o||!Vi(s.extent,a))&&(this.renderedImageCanvas_=null)}return(!this.renderedImageCanvas_||this.getRevision()!==this.renderedRevision_)&&this.processSources_(),s.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){const e=this.requestedFrameState_,t=this.layers_.length,i=new Array(t);for(let s=0;s<t;++s){e.layerIndex=s,e.renderTargets={};const o=Dv(this.layers_[s],e);if(o)i[s]=o;else return}const r={};this.dispatchEvent(new _A(yA.BEFOREOPERATIONS,e,r)),this.processor_.process(i,r,this.onWorkerComplete_.bind(this,e))}onWorkerComplete_(e,t,i,r){if(t||!i)return;const s=e.extent,o=e.viewState.resolution;if(o!==this.requestedFrameState_.viewState.resolution||!Vi(s,this.requestedFrameState_.extent))return;let a;if(this.renderedImageCanvas_)a=this.renderedImageCanvas_.getImage().getContext("2d");else{const l=Math.round(ne(s)/o),c=Math.round(Oe(s)/o);a=Me(l,c),this.renderedImageCanvas_=new Sw(s,o,1,a.canvas)}a.putImageData(i,0,0),e.animate?requestAnimationFrame(this.changed.bind(this)):this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new _A(yA.AFTEROPERATIONS,e,r))}getResolutions(e){if(!this.useResolutions_)return null;let t=super.getResolutions();if(!t)for(let i=0,r=this.layers_.length;i<r&&(t=this.layers_[i].getSource().getResolutions(e),!t);++i);return t}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}}Ju.prototype.dispose;let Ir=null;function Dv(n,e){const t=n.getRenderer();if(!t)throw new Error("Unsupported layer type: "+n);if(!t.prepareFrame(e))return null;const i=e.size[0],r=e.size[1];if(i===0||r===0)return null;const s=t.renderFrame(e,null);let o;if(s instanceof HTMLCanvasElement)o=s;else{if(s&&(o=s.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===i&&o.height===r)return o.getContext("2d").getImageData(0,0,i,r)}if(!Ir)Ir=Me(i,r,void 0,{willReadFrequently:!0});else{const a=Ir.canvas;a.width!==i||a.height!==r?Ir=Me(i,r,void 0,{willReadFrequently:!0}):Ir.clearRect(0,0,i,r)}return Ir.drawImage(o,0,0,i,r),Ir.getImageData(0,0,i,r)}function Ov(n){return n.map(function(e){return e.getLayerState()})}function Gv(n){const e=n.length,t=new Array(e);for(let i=0;i<e;++i)t[i]=Bv(n[i]);return t}function Bv(n){let e;return n instanceof ms?n instanceof Qu?e=new Ll({source:n}):n instanceof gA&&(e=new Uu({source:n})):e=n,e}function Nv(n,e,t,i){const r=document.createElement("script"),s="olc_"+Y(e);function o(){delete window[s],r.parentNode.removeChild(r)}r.async=!0,r.src=n+(n.includes("?")?"&":"?")+"callback="+s;const a=setTimeout(function(){o(),t&&t()},1e4);window[s]=function(l){clearTimeout(a),o(),e(l)},document.head.appendChild(r)}const zv=/\{z\}/g,jv=/\{x\}/g,Uv=/\{y\}/g,Vv=/\{-y\}/g;function xA(n,e,t,i,r){return n.replace(zv,e.toString()).replace(jv,t.toString()).replace(Uv,i.toString()).replace(Vv,function(){if(r===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(r-i).toString()})}function Wv(n,e,t,i){const r=hA(e,t,i),s=gn(r,n.length);return n[s]}function EA(n){const e=[];let t=/\{([a-z])-([a-z])\}/.exec(n);if(t){const i=t[1].charCodeAt(0),r=t[2].charCodeAt(0);let s;for(s=i;s<=r;++s)e.push(n.replace(t[0],String.fromCharCode(s)));return e}if(t=/\{(\d+)-(\d+)\}/.exec(n),t){const i=parseInt(t[2],10);for(let r=parseInt(t[1],10);r<=i;r++)e.push(n.replace(t[0],r.toString()));return e}return e.push(n),e}function Hv(n,e){return(function(t,i,r){if(!t)return;let s;const o=t[0];if(e){const a=e.getFullTileRange(o);a&&(s=a.getHeight()-1)}return xA(n,o,t[1],t[2],s)})}function wA(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=Hv(n[r],e);return Xv(i)}function Xv(n){return n.length===1?n[0]:(function(e,t,i){if(!e)return;const r=xv(e),s=gn(r,n.length);return n[s](e,t,i)})}const Rs={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Bl extends Qu{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===Bl.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const t=e.target,i=Y(t),r=t.getState();let s;r==G.LOADING?(this.tileLoadingKeys_[i]=!0,s=Rs.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==G.ERROR?Rs.TILELOADERROR:r==G.LOADED?Rs.TILELOADEND:void 0),s!=null&&this.dispatchEvent(new AA(s,t))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,typeof t<"u"?this.setKey(t):this.changed()}setUrl(e){const t=EA(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;const t=e.join(`
36
- `);this.generateTileUrlFunction_?this.setTileUrlFunction(wA(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,i){}}class Yv extends Bl{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Kv,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:Gp,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!tt(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||tt(t,e)))return this.tileGrid;const i=Y(e);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Ol(e)),this.tileGridForProjection[i]}createTile_(e,t,i,r,s,o){const a=[e,t,i],l=this.getTileCoordForTileUrlFunction(a,s),c=l?this.tileUrlFunction(l,r,s):void 0,h=new this.tileClass(a,c!==void 0?G.IDLE:G.EMPTY,c!==void 0?c:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=o,h.addEventListener(K.CHANGE,this.handleTileChange.bind(this)),h}getTile(e,t,i,r,s,o){const a=this.getProjection();if(!a||!s||tt(a,s))return this.getTileInternal(e,t,i,r,a||s);const l=[e,t,i],c=this.getKey(),h=this.getTileGridForProjection(a),u=this.getTileGridForProjection(s),d=this.getTileCoordForTileUrlFunction(l,s),g=new lA(a,h,s,u,l,d,this.getTilePixelRatio(r),this.getGutter(),(f,p,A,m)=>this.getTileInternal(f,p,A,m,a,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return g.key=c,g}getTileInternal(e,t,i,r,s,o){const a=this.getKey(),l=Wo(this,a,e,t,i);if(o&&o.containsKey(l))return o.get(l);const c=this.createTile_(e,t,i,r,s,a);return o==null||o.set(l,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){const i=_e(e);if(i){const r=Y(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}}function Kv(n,e){if(ut){const t=n.getCrossOrigin();let i="same-origin",r="same-origin";t==="anonymous"||t===""?(i="cors",r="omit"):t==="use-credentials"&&(i="cors",r="include"),fetch(e,{mode:i,credentials:r}).then(s=>{if(!s.ok)throw new Error(`HTTP ${s.status}`);return s.blob()}).then(s=>createImageBitmap(s)).then(s=>{var l;const o=n.getImage();o.width=s.width,o.height=s.height,o.getContext("2d").drawImage(s,0,0),(l=s.close)==null||l.call(s),o.dispatchEvent(new Event("load"))}).catch(()=>{n.getImage().dispatchEvent(new Event("error"))});return}n.getImage().src=e}class vA extends Yv{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:_e("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)Nv(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=_e("EPSG:4326"),i=this.getProjection();let r;if(e.bounds!==void 0){const c=eo(t,i);r=Xd(e.bounds,c)}const s=Ho(i),o=e.minzoom||0,a=e.maxzoom||22,l=Gl({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=wA(e.tiles,l),e.attribution&&!this.getAttributions()){const c=r!==void 0?r:s;this.setAttributions(function(h){return ze(c,h.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState("ready")}handleTileJSONError(){this.setState("error")}}class $u extends Bl{constructor(e){const t=e.projection||"EPSG:3857",i=e.extent||Ho(t),r=e.tileGrid||Gl({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:CA,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:Np,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);let o=s.getTileCoordExtent(r);const a=r[0],l=s.getResolution(a);ji(o,-l,o);const c=this.projection;t&&this.projection&&!tt(t,c)&&(o=Aa(o,t,c));const h=this.tileGrid,u=h.getExtent();u&&xt(o,u,o);let d=l;t&&c&&!tt(t,c)&&(d=l/c.getMetersPerUnit()/t.getMetersPerUnit());const g=h.getZForResolution(d,this.zDirection);h.forEachTileCoord(o,g,f=>{const p=this.tileUrlFunction(f,e,t);this.sourceTiles_[p]||(this.sourceTiles_[p]=new this.tileClass(f,p?G.IDLE:G.EMPTY,p,this.format_,this.tileLoadFunction));const A=this.sourceTiles_[p];i.sourceTiles.push(A),this.tileKeysBySourceTileUrl_[p]||(this.tileKeysBySourceTileUrl_[p]=[]),this.tileKeysBySourceTileUrl_[p].push(i.getKey());const m=A.getState();if(m<G.LOADED){const y=E=>{this.handleTileChange(E);const x=A.getState();if(x===G.LOADED||x===G.ERROR){const _=A.getKey();_ in i.errorTileKeys?A.getState()===G.LOADED&&delete i.errorTileKeys[_]:i.loadingSourceTiles--,x===G.ERROR?i.errorTileKeys[_]=!0:A.removeEventListener(K.CHANGE,y),i.loadingSourceTiles===0&&i.setState(un(i.errorTileKeys)?G.LOADED:G.ERROR)}};A.addEventListener(K.CHANGE,y),i.loadingSourceTiles++}m===G.IDLE&&(A.extent=h.getTileCoordExtent(f),A.projection=this.projection,A.resolution=h.getResolution(f[0]),A.load())}),i.loadingSourceTiles||i.setState(i.sourceTiles.some(f=>f.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<s;++r){const o=i[r].getTileUrl();if(!this.tileKeysBySourceTileUrl_[o])return;const a=this.tileKeysBySourceTileUrl_[o].indexOf(t);a!==-1&&(this.tileKeysBySourceTileUrl_[o].splice(a,1),this.tileKeysBySourceTileUrl_[o].length===0&&(delete this.tileKeysBySourceTileUrl_[o],delete this.sourceTiles_[o]))}}getTile(e,t,i,r,s){const o=[e,t,i];let a=this.getTileCoordForTileUrlFunction(o,s);const l=this.getTileGrid().getExtent(),c=this.projection,h=this.getTileGridForProjection(s);if(a&&l){const g=h.getTileCoordExtent(a);ji(g,-h.getResolution(e),g),ze(l,!s||!c||tt(s,c)?g:Aa(g,s,c))||(a=null)}let u=!0;if(a!==null){const g=this.tileGrid,f=h.getResolution(e);let p=f;s&&c&&!tt(s,c)&&(p=f/c.getMetersPerUnit()/s.getMetersPerUnit());const A=g.getZForResolution(p,1),m=h.getTileCoordExtent(a);ji(m,-f,m),g.forEachTileCoord(!s||!c||tt(s,c)?m:Aa(m,s,c),A,y=>{u=u&&!this.tileUrlFunction(y,r,c)})}const d=new Pw(o,u?G.EMPTY:G.IDLE,a,this.getSourceTiles.bind(this,r,s),this.removeSourceTiles.bind(this));return d.key=this.getKey(),d}getTileGridForProjection(e){const t=e.getCode();let i=this.tileGrids_[t];if(!i){const r=this.projection;if(r!==null&&!tt(r,e))return Ol(e);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=Mf+1;for(let h=o.length;h<c;++h)o.push(o[h-1]/2),a.push(a[h-1]),l.push(l[h-1]);i=new Dl({extent:s.getExtent(),origins:a,resolutions:o,tileSizes:l}),this.tileGrids_[t]=i}return i}getTilePixelRatio(e){return e}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=it(r.getTileSize(e),this.tmpSize);return[Math.round(s[0]*t),Math.round(s[1]*t)]}setOverlaps(e){this.overlaps_=e,this.changed()}}function CA(n,e){n.setLoader(function(t,i,r){bp(e,n.getFormat(),t,i,r,n.onLoad.bind(n),n.onError.bind(n))})}function Zv(n,e){const t=n[0],i=t.width,r=t.height,s=t.data,o=new Uint8ClampedArray(s.length),a=e.resolution*2,l=i-1,c=r-1,h=[0,0,0,0],u=2*Math.PI,d=Math.PI/2,g=Math.PI*e.sunEl/180,f=Math.PI*e.sunAz/180,p=Math.cos(g),A=Math.sin(g),m=e.highlightColor,y=e.shadowColor,E=e.accentColor,x=e.encoding;let _,w,v,C,b,T,I,F,P,B,R,S,L,z,V,U,X,D,q,O,se,Ce;function ge(We,be="mapbox"){if(be==="mapbox")return(We[0]*256*256+We[1]*256+We[2])*.1-1e4;if(be==="terrarium")return We[0]*256+We[1]+We[2]/256-32768}for(w=0;w<=c;++w)for(b=w===0?0:w-1,T=w===c?c:w+1,_=0;_<=l;++_)v=_===0?0:_-1,C=_===l?l:_+1,I=(w*i+v)*4,h[0]=s[I],h[1]=s[I+1],h[2]=s[I+2],h[3]=s[I+3],F=e.vert*ge(h,x),I=(w*i+C)*4,h[0]=s[I],h[1]=s[I+1],h[2]=s[I+2],h[3]=s[I+3],P=e.vert*ge(h,x),B=(P-F)/a,I=(b*i+_)*4,h[0]=s[I],h[1]=s[I+1],h[2]=s[I+2],h[3]=s[I+3],F=e.vert*ge(h,x),I=(T*i+_)*4,h[0]=s[I],h[1]=s[I+1],h[2]=s[I+2],h[3]=s[I+3],P=e.vert*ge(h,x),R=(P-F)/a,L=Math.atan2(R,-B),L<0?L=d-L:L>d?L=u-L+d:L=d-L,S=Math.atan(Math.sqrt(B*B+R*R)),Ce=A*Math.cos(S)+p*Math.sin(S)*Math.cos(f-L),z=Math.cos(S),V=255*Ce,q=Math.min(Math.max(2*e.sunEl,0),1),O=1.875-e.opacity*1.75,se=e.opacity!==.5?d*((Math.pow(O,S)-1)/(Math.pow(O,d)-1)):S,X={r:(1-z)*E.r*q*255,g:(1-z)*E.g*q*255,b:(1-z)*E.b*q*255,a:(1-z)*E.a*q*255},U=Math.abs(((L+f)/Math.PI+.5)%2-1),D={r:(m.r*(1-U)+y.r*U)*V,g:(m.g*(1-U)+y.g*U)*V,b:(m.b*(1-U)+y.b*U)*V,a:(m.a*(1-U)+y.a*U)*V},I=(w*i+_)*4,o[I]=X.r*(1-U)+D.r,o[I+1]=X.g*(1-U)+D.g,o[I+2]=X.b*(1-U)+D.b,o[I+3]=s[I+3]*e.opacity*q*Math.sin(se);return new ImageData(o,i,r)}function qv(n,e){const t=n[0],i=t.width,r=t.height,s=t.data,o=new Uint8ClampedArray(s.length),a=i-1,l=r-1,c=[0,0,0,0];let h,u,d;function g(C){return C>0?1/(1-C):1+C}function f(C){return C>0?1-1/(1.001-C):-C}function p(C){C*=Math.PI/180;const b=Math.sin(C),T=Math.cos(C);return[(2*T+1)/3,(-Math.sqrt(3)*b-T+1)/3,(Math.sqrt(3)*b-T+1)/3]}const A=f(e.saturation),m=g(e.contrast),y=p(e.hueRotate),E=y,x=[y[2],y[0],y[1]],_=[y[1],y[2],y[0]],w=e.brightnessLow,v=e.brightnessHigh;for(u=0;u<=l;++u)for(h=0;h<=a;++h){d=(u*i+h)*4,c[0]=s[d],c[1]=s[d+1],c[2]=s[d+2],c[3]=s[d+3];const C=c[0],b=c[1],T=c[2],I=(S,L)=>{let z=0;for(let V=0;V<S.length;V++)z+=S[V]*L[V];return z};let F=I([C,b,T],E),P=I([C,b,T],x),B=I([C,b,T],_);const R=(F+P+B)/3;F+=(R-F)*A,P+=(R-P)*A,B+=(R-B)*A,F=(F-.5)*m+.5,P=(P-.5)*m+.5,B=(B-.5)*m+.5,F=w*(255-F)+v*F,P=w*(255-P)+v*P,B=w*(255-B)+v*B,o[d]=F,o[d+1]=P,o[d+2]=B,o[d+3]=c[3]}return new ImageData(o,i,r)}function Qv(n,e=512){return n.getExtent()?Gl({extent:n.getExtent(),tileSize:e,maxZoom:22}).getResolutions():Ai}function bA(n,e){return e.accessToken||(e=Object.assign({},e),new URL(n).searchParams.forEach((i,r)=>{e.accessToken=i,e.accessTokenParam=r})),e}function Jv(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:wl(s,a.accessToken),a=bA(s,a)),new Promise(function(h,u){Hp(e,a).then(function(d){if(d.version!=8)return u(new Error("glStyle version 8 required."));if(!(n instanceof Dn||n instanceof Sr))return u(new Error("Can only apply to VectorLayer or VectorTileLayer"));const g=n instanceof Sr?"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 Sr)return ed(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()===CA&&C.setTileLoadFunction(v.getTileLoadFunction()),tt(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(Uo(Math.max(0,b.getMinZoom()-1e-12),b.getResolutions()))});const x=d.sources[o];let _=n.getSource();(!_||_.get("mapbox-source")!==x)&&(_=id(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 v=_e(a.projection).getUnits();v!=="m"&&(r=Ai.map(C=>C/An[v]))}let x;const _=n.getSource();_ instanceof $u&&_.format_ instanceof nA&&(x=_.format_.layerName_),A=Nu(n,d,l,r,m,y,(w,v=a.webfonts)=>Gw(w,v),a.getImage,x),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=Mw(d.sprite,a.accessToken,s||location.href);p=ut?1: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){ws("Sprite",C,a).then(b).catch(function(I){C=v.origin+v.pathname+".json"+v.search,ws("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 I=a.transformRequest(T,"SpriteImage")||T;(I instanceof Request||I instanceof Promise)&&(T=I)}y[w.id]=T;for(const I in b){const F=w.id=="default"?I:`${w.id}:${I}`;m[F]=b[I]}}).catch(function(b){u(new Error(`Sprites cannot be loaded: ${C}: ${b.message}`))})})).then(E).catch(u)}else E()}).catch(u)})}function TA(n,e){let t;return n.some(function(i){if(i.id==e)return t=i.source,!0}),t}function $v(n,e){const t=n.bounds;if(t){const i=Js([t[0],t[1]],e),r=Js([t[2],t[3]],e);return[i[0],i[1],r[0],r[1]]}return _e(e).getExtent()}function RA(n,e,t){const i=new vA({tileJSON:e,tileSize:n.tileSize||e.tileSize||512}),r=i.getTileJSON(),s=i.getTileGrid(),o=_e(t.projection||"EPSG:3857"),a=$v(r,o),l=o.getExtent(),c=r.minzoom||0,h=r.maxzoom||22,u={attributions:i.getAttributions(),projection:o,tileGrid:new Dl({origin:l?li(l):s.getOrigin(0),extent:a||s.getExtent(),minZoom:c,resolutions:Qv(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 eC(n,e,t,i){const r={id:n.id,type:n.type},s=n.layout||{},o=n.paint||{};r.paint=o,vt.zoom=bl(e,t.resolutions||Ai),vt.distanceFromCenter=0;let a;const l=H(r,"paint","background-color",yt,i);return o["background-opacity"]!==void 0&&(a=H(r,"paint","background-opacity",yt,i)),s.visibility=="none"?void 0:On(l,a)}function tC(n,e,t){const i=ut?{style:{}}:document.createElement("div");return i.className="ol-mapbox-style-background",i.style.position="absolute",i.style.width="100%",i.style.height="100%",new is({source:new ms({}),render(r){const s=eC(n,r.viewState.resolution,e,t);return i.style.backgroundColor=s,i}})}function ed(n,e,t){return new Promise(function(i,r){Yp(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=RA(n,s,t);a.tileLoadFunction=o,a.format=new nA({layerName:"mvt:layer"});const l=new $u(a);l.set("mapbox-source",n),i(l)}).catch(r)})}function iC(n,e,t){const i=new Sr({declutter:!0,visible:!1});return ed(n,e,t).then(function(r){i.setSource(r)}).catch(function(r){i.setSource(void 0)}),i}function SA(n){return`{bbox-${(n?n.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function IA(n,e,t){return new Promise(function(i,r){Yp(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=new vA({interpolate:t.interpolate===void 0?!0:t.interpolate,transition:0,crossOrigin:"anonymous",tileJSON:s});a.tileGrid=RA(n,s,t).tileGrid,t.projection&&(a.projection=_e(t.projection));const l=a.getTileUrlFunction();o&&a.setTileLoadFunction(o),a.setTileUrlFunction(function(c,h,u){const d=SA(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 td(n,e,t){const i=new Ll;return IA(n,e,t).then(function(r){i.setSource(r)}).catch(function(){i.setSource(void 0)}),i}function nC(n,e,t){const i=td(n,e,t);return new Uu({source:new Ju({operationType:"image",operation:qv,sources:[i]})})}function rC(n,e,t){const i=td(n,e,t);return new Uu({source:new Ju({operationType:"image",operation:Zv,sources:[i]})})}function id(n,e,t){const i=t.projection?new Fh({dataProjection:t.projection}):new Fh,r=n.data,s={};if(typeof r=="string"){const[a]=vl(r,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(a)){const c=(u,d,g)=>{const f=SA(g);return a.replace(f,`${u.join(",")}`)},h=new Mn({attributions:n.attribution,format:i,loader:(u,d,g,f,p)=>{const A=typeof c=="function"?c(u,d,g):c;ws("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:uw});return h.set("mapbox-source",n),h}const l=new Mn({attributions:n.attribution,format:i,url:a,loader:(c,h,u,d,g)=>{ws("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 Mn(Object.assign({attributions:n.attribution,format:i},s));return o.set("mapbox-source",n),o}function sC(n,e,t){return new Dn({declutter:!0,source:id(n,e,t),visible:!1})}function oC(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],aC(n,e,i,t))}}function aC(n,e,t,i){vt.zoom=t,vt.distanceFromCenter=0;const r=H(n,"paint","raster-opacity",yt,i);e.setOpacity(r)}function lC(n,e){function t(){const i=e.get("mapbox-style");if(!i)return;const r=Sg(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 PA(n,e,t,i){const r=Mu(n),s=n.layers,o=t.type,a=t.source||TA(s,t.ref),l=n.sources[a];let c;if(o=="background")c=tC(t,i,r);else if(l.type=="vector")c=iC(l,e,i);else if(l.type=="raster"){const u=["raster-saturation","raster-contrast","raster-brightness-max","raster-brightness-min","raster-hue-rotate"];!!Object.keys(t.paint||{}).find(g=>u.includes(g))?(c=nC(l,e,i),c.getSource().on("beforeoperations",function(g){vt.zoom=bl(g.resolution,i.resolutions||Ai),vt.distanceFromCenter=0;const f=g.data;f.saturation=H(t,"paint","raster-saturation",yt,r),f.contrast=H(t,"paint","raster-contrast",yt,r),f.brightnessHigh=H(t,"paint","raster-brightness-max",yt,r),f.brightnessLow=H(t,"paint","raster-brightness-min",yt,r),f.hueRotate=H(t,"paint","raster-hue-rotate",yt,r)})):c=td(l,e,i),c.setVisible(t.layout?t.layout.visibility!=="none":!0),c.on("prerender",oC(t,c,r))}else if(l.type=="geojson")c=sC(l,e,i);else if(l.type=="raster-dem"&&t.type=="hillshade"){const u=rC(l,e,i);c=u,u.getSource().on("beforeoperations",function(d){const g=d.data;g.resolution=wc(i.projection||"EPSG:3857",d.resolution,Ut(d.extent),"m"),vt.zoom=bl(d.resolution,i.resolutions||Ai),vt.distanceFromCenter=0,g.encoding=l.encoding,g.vert=5*H(t,"paint","hillshade-exaggeration",yt,r),g.sunAz=H(t,"paint","hillshade-illumination-direction",yt,r),g.sunEl=35,g.opacity=.3,g.highlightColor=H(t,"paint","hillshade-highlight-color",yt,r),g.shadowColor=H(t,"paint","hillshade-shadow-color",yt,r),g.accentColor=H(t,"paint","hillshade-accent-color",yt,r)}),c.setVisible(t.layout?t.layout.visibility!=="none":!0)}const h=a;return c&&c.set("mapbox-source",h),c}function MA(n,e,t,i){const r=[];let s=null;if(e instanceof To){if(s=e.getView(),!s.isDef()&&!s.getRotation()&&!s.getResolutions()){const u=i.projection?_e(i.projection):s.getProjection();s=new Ri(Object.assign(s.getProperties(),{maxResolution:Ai[0]/An[u.getUnits()],projection:i.projection||s.getProjection()})),e.setView(s)}"center"in n&&!s.getCenter()&&s.setCenter(Js(n.center,s.getProjection())),"zoom"in n&&s.getZoom()===void 0&&s.setResolution(Ai[0]/An[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;u<d;++u){const g=o[u],f=g.type;if(f=="heatmap"){console.debug(`layers[${u}].type "${f}" not supported`);continue}else h=g.source||TA(o,g.ref),(!h||h!=c)&&(a.length&&(r.push(Nl(l,a,n,t,e,i)),a=[]),l=PA(n,t,g,i),l instanceof Dn||l instanceof Sr||(a=[]),c=l.get("mapbox-source")),a.push(g.id)}return r.push(Nl(l,a,n,t,e,i)),Promise.all(r)}function FA(n,e,t={}){let i,r;if(ut){if(!(n instanceof To)&&!(n instanceof Si))throw new Error("ol-mapbox-style in a web worker requires a Map or a LayerGroup as first argument");r=n}else typeof n=="string"||n instanceof HTMLElement?r=new To({target:n}):r=n;if(typeof e=="string"){const s=e.startsWith("data:")?location.href:wl(e,t.accessToken);t=bA(s,t),i=new Promise(function(o,a){Hp(e,t).then(function(l){MA(l,r,s,t).then(function(){o(r)}).catch(a)}).catch(function(l){a(new Error(`Could not load ${e}: ${l.message}`))})})}else i=new Promise(function(s,o){MA(e,r,!t.styleUrl||t.styleUrl.startsWith("data:")?location.href:wl(t.styleUrl,t.accessToken),t).then(function(){s(r)}).catch(o)});return i}function Nl(n,e,t,i,r,s={}){let o=24,a=0;const l=t.layers;for(let c=0,h=l.length;c<h;++c){const u=l[c];e.indexOf(u.id)!==-1&&(o=Math.min("minzoom"in u?u.minzoom:0,o),a=Math.max("maxzoom"in u?u.maxzoom:24,a))}return new Promise(function(c,h){const u=function(){const g=n.getSource();if(!g||g.getState()==="error"){h(new Error("Error accessing data for source "+n.get("mapbox-source")));return}if("getTileGrid"in g){const f=g.getTileGrid();if(f){const p=f.getMinZoom();(o>0||p>0)&&n.setMaxResolution(Math.min(Uo(Math.max(0,o-1e-12),Ai),Uo(Math.max(0,p-1e-12),f.getResolutions()))),a<24&&n.setMinResolution(Uo(a,Ai))}}else o>0&&n.setMaxResolution(Uo(Math.max(0,o-1e-12),Ai));g instanceof Mn||g instanceof $u?Jv(n,t,e,Object.assign({styleUrl:i},s)).then(function(){lC(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 cC(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):s<r.length&&r[s].source===e.source&&(o=s,a=0),o===-1){const{options:h,styleUrl:u}=n.get("mapbox-metadata"),d=PA(i,u,e,h);return r.splice(s,0,e),Nl(d,[e.id],i,u,n,h)}if(r.some(h=>h.id===e.id))throw new Error(`Layer with id "${e.id}" already exists.`);const l=r[o].id,c=Bu[Pu(n.get("mapbox-style"),zl(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)}Nu(h,u,d,g,f,p,A,m)}else zl(n,r[o].id).changed();return Promise.resolve()}function hC(n,e){const t=n.get("mapbox-style"),i=t.layers,r=i.findIndex(function(h){return h.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 Mu(t)[e.id],delete Wp(t)[e.id],i[r]=e;const o=Bu[Pu(n.get("mapbox-style"),zl(n,e.id))];if(o)return Nu.apply(void 0,o),Promise.resolve();const a=zl(n,e.id),{options:l,styleUrl:c}=n.get("mapbox-metadata");return Nl(a,[e.id],t,c,n,l)}function uC(n,e,t){const i=kA(n,e),r=n.getLayers().getArray().filter(function(a){return(a instanceof Dn||a instanceof Ll||a instanceof Sr)&&a.getSource()===i}),s=n.get("mapbox-metadata");let o;switch(t.type){case"vector":o=ed(t,s.styleUrl,s.options);break;case"geojson":o=Promise.resolve(id(t,s.styleUrl,s.options));break;case"raster":case"raster-dem":o=IA(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 zl(n,e){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i){const s=t[i].get("mapbox-layers");if(s&&s.indexOf(e)!==-1)return t[i]}}function LA(n,e){const t=[],i=n.getLayers().getArray();for(let r=0,s=i.length;r<s;++r)i[r].get("mapbox-source")===e&&t.push(i[r]);return t}function kA(n,e){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i){const s=t[i].getSource();if(t[i].get("mapbox-source")===e)return s}}function jl(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function nd(n,e,t,i,r,s,o){o=o??jl();const a=1/(n-e),l=1/(t-i),c=1/(r-s);return o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*l,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*c,o[11]=0,o[12]=(n+e)*a,o[13]=(i+t)*l,o[14]=(s+r)*c,o[15]=1,o}function DA(n,e,t,i,r){return r=r??jl(),r[0]=n[0]*e,r[1]=n[1]*e,r[2]=n[2]*e,r[3]=n[3]*e,r[4]=n[4]*t,r[5]=n[5]*t,r[6]=n[6]*t,r[7]=n[7]*t,r[8]=n[8]*i,r[9]=n[9]*i,r[10]=n[10]*i,r[11]=n[11]*i,r[12]=n[12],r[13]=n[13],r[14]=n[14],r[15]=n[15],r}function dC(n,e,t,i,r){r=r??jl();let s,o,a,l,c,h,u,d,g,f,p,A;return n===r?(r[12]=n[0]*e+n[4]*t+n[8]*i+n[12],r[13]=n[1]*e+n[5]*t+n[9]*i+n[13],r[14]=n[2]*e+n[6]*t+n[10]*i+n[14],r[15]=n[3]*e+n[7]*t+n[11]*i+n[15]):(s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],h=n[5],u=n[6],d=n[7],g=n[8],f=n[9],p=n[10],A=n[11],r[0]=s,r[1]=o,r[2]=a,r[3]=l,r[4]=c,r[5]=h,r[6]=u,r[7]=d,r[8]=g,r[9]=f,r[10]=p,r[11]=A,r[12]=s*e+c*t+g*i+n[12],r[13]=o*e+h*t+f*i+n[13],r[14]=a*e+u*t+p*i+n[14],r[15]=l*e+d*t+A*i+n[15]),r}function fC(n,e,t,i){return i=i??jl(),i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=n,i[13]=e,i[14]=t,i[15]=1,i}const gC=`
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.YioMap=t())})(this,function(){var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap,i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,n=this.t;if(t&&e===void 0){let t=n!==void 0&&n.length===1;t&&(e=r.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}},a=e=>new i(typeof e==`string`?e:e+``,void 0,n),o=(e,...t)=>new i(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,n),s=(n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let t of r){let r=document.createElement(`style`),i=e.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=t.cssText,n.appendChild(r)}},c=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return a(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:f,getOwnPropertySymbols:p,getPrototypeOf:m}=Object,h=globalThis,g=h.trustedTypes,_=g?g.emptyScript:``,v=h.reactiveElementPolyfillSupport,y=(e,t)=>e,b={toAttribute(e,t){switch(t){case Boolean:e=e?_:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},x=(e,t)=>!l(e,t),S={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol(`metadata`),h.litPropertyMetadata??=new WeakMap;var C=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=S){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??S}static _$Ei(){if(this.hasOwnProperty(y(`elementProperties`)))return;let e=m(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y(`properties`))){let e=this.properties,t=[...f(e),...p(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n: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(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?b:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?b:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??x)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};C.elementStyles=[],C.shadowRootOptions={mode:`open`},C[y(`elementProperties`)]=new Map,C[y(`finalized`)]=new Map,v?.({ReactiveElement:C}),(h.reactiveElementVersions??=[]).push(`2.1.2`);var w=globalThis,T=e=>e,E=w.trustedTypes,D=E?E.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,O=`$lit$`,k=`lit$${Math.random().toFixed(9).slice(2)}$`,A=`?`+k,ee=`<${A}>`,j=document,te=()=>j.createComment(``),ne=e=>e===null||typeof e!=`object`&&typeof e!=`function`,re=Array.isArray,ie=e=>re(e)||typeof e?.[Symbol.iterator]==`function`,ae=`[
2
+ \f\r]`,oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,se=/-->/g,ce=/>/g,le=RegExp(`>|${ae}(?:([^\\s"'>=/]+)(${ae}*=${ae}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ue=/'/g,de=/"/g,fe=/^(?:script|style|textarea|title)$/i,pe=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),me=Symbol.for(`lit-noChange`),he=Symbol.for(`lit-nothing`),ge=new WeakMap,_e=j.createTreeWalker(j,129);function ve(e,t){if(!re(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return D===void 0?t:D.createHTML(t)}var ye=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=oe;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===oe?c[1]===`!--`?o=se:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=le):(fe.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=le):o=ce:o===le?c[0]===`>`?(o=i??oe,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?le:c[3]===`"`?de:ue):o===de||o===ue?o=le:o===se||o===ce?o=oe:(o=le,i=void 0);let d=o===le&&e[t+1].startsWith(`/>`)?` `:``;a+=o===oe?n+ee:l>=0?(r.push(s),n.slice(0,l)+O+n.slice(l)+k+d):n+k+(l===-2?t:d)}return[ve(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},be=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=ye(t,n);if(this.el=e.createElement(l,r),_e.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=_e.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(O)){let t=u[o++],n=i.getAttribute(e).split(k),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Te:r[1]===`?`?Ee:r[1]===`@`?De:we}),i.removeAttribute(e)}else e.startsWith(k)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(fe.test(i.tagName)){let e=i.textContent.split(k),t=e.length-1;if(t>0){i.textContent=E?E.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],te()),_e.nextNode(),c.push({type:2,index:++a});i.append(e[t],te())}}}else if(i.nodeType===8)if(i.data===A)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(k,e+1))!==-1;)c.push({type:7,index:a}),e+=k.length-1}a++}}static createElement(e,t){let n=j.createElement(`template`);return n.innerHTML=e,n}};function xe(e,t,n=e,r){if(t===me)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=ne(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=xe(e,i._$AS(e,t.values),i,r)),t}var Se=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??j).importNode(t,!0);_e.currentNode=r;let i=_e.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Ce(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Oe(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=_e.nextNode(),a++)}return _e.currentNode=j,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Ce=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=he,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=xe(this,e,t),ne(e)?e===he||e==null||e===``?(this._$AH!==he&&this._$AR(),this._$AH=he):e!==this._$AH&&e!==me&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ie(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==he&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(j.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=be.createElement(ve(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Se(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=ge.get(e.strings);return t===void 0&&ge.set(e.strings,t=new be(e)),t}k(t){re(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(te()),this.O(te()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=T(e).nextSibling;T(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},we=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=he,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=he}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=xe(this,e,t,0),a=!ne(e)||e!==this._$AH&&e!==me,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=xe(this,r[n+o],t,o),s===me&&(s=this._$AH[o]),a||=!ne(s)||s!==this._$AH[o],s===he?e=he:e!==he&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===he?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Te=class extends we{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===he?void 0:e}},Ee=class extends we{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==he)}},De=class extends we{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=xe(this,e,t,0)??he)===me)return;let n=this._$AH,r=e===he&&n!==he||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==he&&(n===he||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Oe=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){xe(this,e)}},ke=w.litHtmlPolyfillSupport;ke?.(be,Ce),(w.litHtmlVersions??=[]).push(`3.3.2`);var Ae=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Ce(t.insertBefore(te(),e),e,void 0,n??{})}return i._$AI(e),i},je=globalThis,Me=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ae(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return me}};Me._$litElement$=!0,Me.finalized=!0,je.litElementHydrateSupport?.({LitElement:Me});var Ne=je.litElementPolyfillSupport;Ne?.({LitElement:Me}),(je.litElementVersions??=[]).push(`4.2.2`);var Pe=`:root,:host{--ol-background-color:white;--ol-accent-background-color:#f5f5f5;--ol-subtle-background-color:#80808040;--ol-partial-background-color:#ffffffbf;--ol-foreground-color:#333;--ol-subtle-foreground-color:#666;--ol-brand-color:#0af}.ol-box{box-sizing:border-box;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color);border-radius:2px}.ol-mouse-position{position:absolute;top:8px;right:8px}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;padding:2px;position:absolute;bottom:8px;left:8px}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color);text-align:center;will-change:contents, width;border-top:none;margin:1px;font-size:10px;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{background-color:var(--ol-foreground-color);float:right;z-index:10;width:1px;height:15px}.ol-scale-step-text{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);font-size:10px;position:absolute;bottom:-5px}.ol-scale-text{text-align:center;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);font-size:12px;position:absolute;bottom:25px}.ol-scale-singlebar{z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color);height:10px;position:relative}.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;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;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{background-color:var(--ol-subtle-background-color);border-radius:4px;position:absolute}.ol-zoom{top:.5em;left:.5em}.ol-rotate{transition:opacity .25s linear,visibility linear;top:.5em;right:.5em}.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{top:.5em;right:.5em}.ol-control button{color:var(--ol-subtle-foreground-color);font-weight:700;font-size:inherit;text-align:center;background-color:var(--ol-background-color);border:none;border-radius:2px;width:1.375em;height:1.375em;margin:1px;padding:0;line-height:.4em;text-decoration:none;display:block}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{will-change:transform;font-weight:400;display:block}.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{outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color);text-decoration:none}.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;flex-flow:row-reverse;align-items:center;max-width:calc(100% - 1.3em);display:flex;bottom:.5em;right:.5em}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);margin:0;padding:1px .5em;font-size:12px}.ol-attribution li{list-style:none;display:inline}.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{border-radius:4px 0 0;bottom:0;right:0}.ol-attribution.ol-uncollapsible img{max-height:1.6em;margin-top:-.2em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{height:200px;top:4.5em;left:.5em}.ol-zoomslider button{height:10px;position:relative}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{bottom:.5em;left:.5em}.ol-overviewmap.ol-uncollapsible{border-radius:0 4px 0 0;bottom:0;left:0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);width:150px;height:150px}.ol-overviewmap:not(.ol-collapsed) button{position:absolute;bottom:0;left:0}.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}`,Fe=`.layer-control{bottom:.5em;left:.5em}.layer-control>button{cursor:pointer;justify-content:center;align-items:center;display:flex}.svgContainer{width:22px;height:22px;scale:.8}.ol-touch .ol-control button>.svgContainer{scale:1.2}.layer-selection{z-index:10;background-color:#fff;border:1px solid #ccc;border-radius:4px;align-items:center;padding:10px 0 10px 10px;display:flex;position:absolute;bottom:0}.layer-selection.fade-out{opacity:0;transition:opacity .15s ease-out}.layer-selection.hidden{display:none}.image-box{cursor:pointer;text-align:center;border:2px solid #bdbdbd;border-radius:4px;width:100px;height:100px;margin-right:10px}.image-box.selected{border:2px solid #474747}.image-box:hover{box-shadow:0 0 6px #949494}.image-box img{pointer-events:none;object-fit:cover;border-radius:4px;width:100px;height:100px}`,Ie={ADD:`add`,REMOVE:`remove`},Le={PROPERTYCHANGE:`propertychange`},M={CHANGE:`change`,ERROR:`error`,BLUR:`blur`,CLEAR:`clear`,CONTEXTMENU:`contextmenu`,CLICK:`click`,DBLCLICK:`dblclick`,DRAGENTER:`dragenter`,DRAGOVER:`dragover`,DROP:`drop`,FOCUS:`focus`,KEYDOWN:`keydown`,KEYPRESS:`keypress`,LOAD:`load`,RESIZE:`resize`,TOUCHMOVE:`touchmove`,WHEEL:`wheel`},Re=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function ze(e,t,n){let r,i;n||=Be;let a=0,o=e.length,s=!1;for(;a<o;)r=a+(o-a>>1),i=+n(e[r],t),i<0?a=r+1:(o=r,s=!i);return s?a:~a}function Be(e,t){return e>t?1:e<t?-1:0}function Ve(e,t){return e<t?1:e>t?-1:0}function He(e,t,n){if(e[0]<=t)return 0;let r=e.length;if(t<=e[r-1])return r-1;if(typeof n==`function`){for(let i=1;i<r;++i){let r=e[i];if(r===t)return i;if(r<t)return n(t,e[i-1],r)>0?i-1:i}return r-1}if(n>0){for(let n=1;n<r;++n)if(e[n]<t)return n-1;return r-1}if(n<0){for(let n=1;n<r;++n)if(e[n]<=t)return n;return r-1}for(let n=1;n<r;++n){if(e[n]==t)return n;if(e[n]<t)return e[n-1]-t<t-e[n]?n-1:n}return r-1}function Ue(e,t,n){for(;t<n;){let r=e[t];e[t]=e[n],e[n]=r,++t,--n}}function We(e,t){let n=Array.isArray(t)?t:[t],r=n.length;for(let t=0;t<r;t++)e[e.length]=n[t]}function Ge(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Ke(e,t,n){let r=t||Be;return e.every(function(t,i){if(i===0)return!0;let a=r(e[i-1],t);return!(a>0||n&&a===0)})}function qe(){return!0}function Je(){return!1}function Ye(){}function Xe(e){let t,n,r;return function(){let i=Array.prototype.slice.call(arguments);return(!n||this!==r||!Ge(i,n))&&(r=this,n=i,t=e.apply(this,arguments)),t}}function Ze(e){function t(){let t;try{t=e()}catch(e){return Promise.reject(e)}return t instanceof Promise?t:Promise.resolve(t)}return t()}function Qe(e){for(let t in e)delete e[t]}function $e(e){let t;for(t in e)return!1;return!t}var et=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},tt=class extends Re{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let n=this.listeners_||={},r=n[e]||(n[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){let t=typeof e==`string`,n=t?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let i=t?new et(e):e;i.target||=this.eventTarget_||this;let a=this.dispatching_||={},o=this.pendingRemovals_||={};n in a||(a[n]=0,o[n]=0),++a[n];let s;for(let e=0,t=r.length;e<t;++e)if(s=`handleEvent`in r[e]?r[e].handleEvent(i):r[e].call(this,i),s===!1||i.propagationStopped){s=!1;break}if(--a[n]===0){let e=o[n];for(delete o[n];e--;)this.removeEventListener(n,Ye);delete a[n]}return s}disposeInternal(){this.listeners_&&Qe(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;let n=this.listeners_[e];if(!n)return;let r=n.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=Ye,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}};function N(e,t,n,r,i){if(i){let i=n;n=function(a){return e.removeEventListener(t,n),i.call(r??this,a)}}else r&&r!==e&&(n=n.bind(r));let a={target:e,type:t,listener:n};return e.addEventListener(t,n),a}function nt(e,t,n,r){return N(e,t,n,r,!0)}function rt(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),Qe(e))}var it=class extends tt{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(M.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=N(this,e[i],t);return r}return N(this,e,t)}onceInternal(e,t){let n;if(Array.isArray(e)){let r=e.length;n=Array(r);for(let i=0;i<r;++i)n[i]=nt(this,e[i],t)}else n=nt(this,e,t);return t.ol_key=n,n}unInternal(e,t){let n=t.ol_key;if(n)at(n);else if(Array.isArray(e))for(let n=0,r=e.length;n<r;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}};it.prototype.on,it.prototype.once,it.prototype.un;function at(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)rt(e[t]);else rt(e)}function P(){throw Error(`Unimplemented abstract method.`)}var ot=0;function F(e){return e.ol_uid||=String(++ot)}var st=class extends et{constructor(e,t,n){super(e),this.key=t,this.oldValue=n}},ct=class extends it{constructor(e){super(),this.on,this.once,this.un,F(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,t){let n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new st(n,e,t)),n=Le.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new st(n,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,n){let r=this.values_||={};if(n)r[e]=t;else{let n=r[e];r[e]=t,n!==t&&this.notify(e,n)}}setProperties(e,t){for(let n in e)this.set(n,e[n],t)}applyProperties(e){e.values_&&Object.assign(this.values_||={},e.values_)}unset(e,t){if(this.values_&&e in this.values_){let n=this.values_[e];delete this.values_[e],$e(this.values_)&&(this.values_=null),t||this.notify(e,n)}}},lt={LENGTH:`length`},ut=class extends et{constructor(e,t,n){super(e),this.element=t,this.index=n}},dt=class extends ct{constructor(e,t){if(super(),this.on,this.once,this.un,t||={},this.unique_=!!t.unique,this.array_=e??[],this.unique_)for(let e=1,t=this.array_.length;e<t;++e)this.assertUnique_(this.array_[e],e);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,n=e.length;t<n;++t)this.push(e[t]);return this}forEach(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)e(t[n],n,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(lt.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new ut(Ie.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){let t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)if(t[n]===e)return this.removeAt(n)}removeAt(e){if(e<0||e>=this.getLength())return;let t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new ut(Ie.REMOVE,t,e)),t}setAt(e,t){if(e>=this.getLength()){this.insertAt(e,t);return}if(e<0)throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t,e);let n=this.array_[e];this.array_[e]=t,this.dispatchEvent(new ut(Ie.REMOVE,n,e)),this.dispatchEvent(new ut(Ie.ADD,t,e))}updateLength_(){this.set(lt.LENGTH,this.array_.length)}assertUnique_(e,t){let n=this.array_;for(let r=0,i=n.length;r<i;++r)if(n[r]===e&&r!==t)throw Error(`Duplicate item added to a unique collection`)}},ft=class extends et{constructor(e,t,n){super(e),this.map=t,this.frameState=n===void 0?null:n}},pt=class extends ft{constructor(e,t,n,r,i,a){super(e,t,i),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=r===void 0?!1:r,this.activePointers=a}get pixel(){return this.pixel_||=this.map.getEventPixel(this.originalEvent),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||=this.map.getCoordinateFromPixel(this.pixel),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),`preventDefault`in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),`stopPropagation`in this.originalEvent&&this.originalEvent.stopPropagation()}},I={SINGLECLICK:`singleclick`,CLICK:M.CLICK,DBLCLICK:M.DBLCLICK,POINTERDRAG:`pointerdrag`,POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},mt=typeof navigator<`u`&&navigator.userAgent!==void 0?navigator.userAgent.toLowerCase():``;mt.includes(`safari`)&&!mt.includes(`chrom`)&&(mt.includes(`version/15.4`)||/cpu (os|iphone os) 15_4 like mac os x/.test(mt));var ht=mt.includes(`webkit`)&&!mt.includes(`edge`),gt=mt.includes(`macintosh`),_t=typeof devicePixelRatio<`u`?devicePixelRatio:1,vt=typeof WorkerGlobalScope<`u`&&typeof OffscreenCanvas<`u`&&self instanceof WorkerGlobalScope,yt=typeof Image<`u`&&Image.prototype.decode,bt=typeof createImageBitmap==`function`,xt=(function(){let e=!1;try{let t=Object.defineProperty({},`passive`,{get:function(){e=!0}});window.addEventListener(`_`,null,t),window.removeEventListener(`_`,null,t)}catch{}return e})(),St={POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},Ct=class extends tt{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;let n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=N(n,St.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=N(n,St.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(M.TOUCHMOVE,this.boundHandleTouchMove_,xt?{passive:!1}:!1)}emulateClick_(e){let t=new pt(I.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_===void 0?this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;let t=new pt(I.SINGLECLICK,this.map_,e);this.dispatchEvent(t)},250):(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new pt(I.DBLCLICK,this.map_,e),this.dispatchEvent(t))}updateActivePointers_(e){let t=e,n=t.pointerId;if(t.type==I.POINTERUP||t.type==I.POINTERCANCEL){delete this.trackedTouches_[n];for(let e in this.trackedTouches_)if(this.trackedTouches_[e].target!==t.target){delete this.trackedTouches_[e];break}}else (t.type==I.POINTERDOWN||t.type==I.POINTERMOVE)&&(this.trackedTouches_[n]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);let t=new pt(I.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(rt),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);let t=new pt(I.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){let e=this.map_.getOwnerDocument();this.dragListenerKeys_.push(N(e,I.POINTERMOVE,this.handlePointerMove_,this),N(e,I.POINTERUP,this.handlePointerUp_,this),N(this.element_,I.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==e&&this.dragListenerKeys_.push(N(this.element_.getRootNode(),I.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;let t=new pt(I.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;let t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new pt(I.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){let 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_&&=(rt(this.relayedListenerKey_),null),this.element_.removeEventListener(M.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&=(rt(this.pointerdownListenerKey_),null),this.dragListenerKeys_.forEach(rt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},wt={POSTRENDER:`postrender`,MOVESTART:`movestart`,MOVEEND:`moveend`,LOADSTART:`loadstart`,LOADEND:`loadend`},Tt={LAYERGROUP:`layergroup`,SIZE:`size`,TARGET:`target`,VIEW:`view`},L={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function R(e,t){if(!e)throw Error(t)}var Et=1/0,Dt=class{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Qe(this.queuedElements_)}dequeue(){let e=this.elements_,t=this.priorities_,n=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));let r=this.keyFunction_(n);return delete this.queuedElements_[r],n}enqueue(e){R(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let t=this.priorityFunction_(e);return t==1/0?!1:(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}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){let t=this.elements_,n=this.priorities_,r=t.length,i=t[e],a=n[e],o=e;for(;e<r>>1;){let i=this.getLeftChildIndex_(e),a=this.getRightChildIndex_(e),o=a<r&&n[a]<n[i]?a:i;t[e]=t[o],n[e]=n[o],e=o}t[e]=i,n[e]=a,this.siftDown_(o,e)}siftDown_(e,t){let n=this.elements_,r=this.priorities_,i=n[t],a=r[t];for(;t>e;){let e=this.getParentIndex_(t);if(r[e]>a)n[t]=n[e],r[t]=r[e],t=e;else break}n[t]=i,r[t]=a}reprioritize(){let e=this.priorityFunction_,t=this.elements_,n=this.priorities_,r=0,i=t.length,a,o,s;for(o=0;o<i;++o)a=t[o],s=e(a),s==1/0?delete this.queuedElements_[this.keyFunction_(a)]:(n[r]=s,t[r++]=a);t.length=r,n.length=r,this.heapify_()}},Ot=class extends Dt{constructor(e,t){super(t=>e.apply(null,t),e=>e[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){let t=super.enqueue(e);return t&&e[0].addEventListener(M.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){let t=e.target,n=t.getState();if(n===L.LOADED||n===L.ERROR||n===L.EMPTY){n!==L.ERROR&&t.removeEventListener(M.CHANGE,this.boundHandleTileChange_);let e=t.getKey();e in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[e],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let n=0;for(;this.tilesLoading_<e&&n<t&&this.getCount()>0;){let e=this.dequeue()[0],t=e.getKey();e.getState()===L.IDLE&&!(t in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[t]=!0,++this.tilesLoading_,++n,e.load())}}};function kt(e,t,n,r,i){if(!e||!(n in e.wantedTiles)||!e.wantedTiles[n][t.getKey()])return Et;let a=e.viewState.center,o=r[0]-a[0],s=r[1]-a[1];return 65536*Math.log(i)+Math.sqrt(o*o+s*s)/i}var At={ANIMATING:0,INTERACTING:1},jt={CENTER:`center`,RESOLUTION:`resolution`,ROTATION:`rotation`};function Mt(e,t,n){return Math.min(Math.max(e,t),n)}function Nt(e,t,n,r,i,a){let o=i-n,s=a-r;if(o!==0||s!==0){let c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return Pt(e,t,n,r)}function Pt(e,t,n,r){let i=n-e,a=r-t;return i*i+a*a}function Ft(e){let t=e.length;for(let n=0;n<t;n++){let r=n,i=Math.abs(e[n][n]);for(let a=n+1;a<t;a++){let t=Math.abs(e[a][n]);t>i&&(i=t,r=a)}if(i===0)return null;let a=e[r];e[r]=e[n],e[n]=a;for(let r=n+1;r<t;r++){let i=-e[r][n]/e[n][n];for(let a=n;a<t+1;a++)n==a?e[r][a]=0:e[r][a]+=i*e[n][a]}}let n=Array(t);for(let r=t-1;r>=0;r--){n[r]=e[r][t]/e[r][r];for(let i=r-1;i>=0;i--)e[i][t]-=e[i][r]*n[r]}return n}function It(e){return e*180/Math.PI}function Lt(e){return e*Math.PI/180}function Rt(e,t){let n=e%t;return n*t<0?n+t:n}function zt(e,t,n){return e+n*(t-e)}function Bt(e,t){let n=10**t;return Math.round(e*n)/n}function Vt(e,t){return Math.floor(Bt(e,t))}function Ht(e,t){return Math.ceil(Bt(e,t))}function Ut(e,t,n){if(e>=t&&e<n)return e;let r=n-t;return((e-t)%r+r)%r+t}function Wt(e,t,n){return(function(r,i,a,o,s){if(!r)return;if(!i&&!t)return r;let c=t?0:a[0]*i,l=t?0:a[1]*i,u=s?s[0]:0,d=s?s[1]:0,f=e[0]+c/2+u,p=e[2]-c/2+u,m=e[1]+l/2+d,h=e[3]-l/2+d;f>p&&(f=(p+f)/2,p=f),m>h&&(m=(h+m)/2,h=m);let g=Mt(r[0],f,p),_=Mt(r[1],m,h);if(o&&n&&i){let e=30*i;g+=-e*Math.log(1+Math.max(0,f-r[0])/e)+e*Math.log(1+Math.max(0,r[0]-p)/e),_+=-e*Math.log(1+Math.max(0,m-r[1])/e)+e*Math.log(1+Math.max(0,r[1]-h)/e)}return[g,_]})}function Gt(e){return e}var Kt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function qt(e){let t=nn();for(let n=0,r=e.length;n<r;++n)un(t,e[n]);return t}function Jt(e,t,n){return rn(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),n)}function Yt(e,t,n){return n?(n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function Xt(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function Zt(e,t,n){let r,i;return r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0,i=n<e[1]?e[1]-n:e[3]<n?n-e[3]:0,r*r+i*i}function Qt(e,t){return en(e,t[0],t[1])}function $t(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function en(e,t,n){return e[0]<=t&&t<=e[2]&&e[1]<=n&&n<=e[3]}function tn(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=Kt.UNKNOWN;return o<n?c|=Kt.LEFT:o>i&&(c|=Kt.RIGHT),s<r?c|=Kt.BELOW:s>a&&(c|=Kt.ABOVE),c===Kt.UNKNOWN&&(c=Kt.INTERSECTING),c}function nn(){return[1/0,1/0,-1/0,-1/0]}function rn(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function an(e){return rn(1/0,1/0,-1/0,-1/0,e)}function on(e,t){let n=e[0],r=e[1];return rn(n,r,n,r,t)}function sn(e,t,n,r,i){return dn(an(i),e,t,n,r)}function cn(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function ln(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function un(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function dn(e,t,n,r,i){for(;n<r;n+=i)fn(e,t[n],t[n+1]);return e}function fn(e,t,n){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],n)}function pn(e,t){let n;return n=t(hn(e)),n||(n=t(gn(e)),n)||(n=t(wn(e)),n)||(n=t(Cn(e)),n)?n:!1}function mn(e){let t=0;return En(e)||(t=z(e)*xn(e)),t}function hn(e){return[e[0],e[1]]}function gn(e){return[e[2],e[1]]}function _n(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function vn(e,t){let n;if(t===`bottom-left`)n=hn(e);else if(t===`bottom-right`)n=gn(e);else if(t===`top-left`)n=Cn(e);else if(t===`top-right`)n=wn(e);else throw Error(`Invalid corner`);return n}function yn(e,t,n,r,i){let[a,o,s,c,l,u,d,f]=bn(e,t,n,r);return rn(Math.min(a,s,l,d),Math.min(o,c,u,f),Math.max(a,s,l,d),Math.max(o,c,u,f),i)}function bn(e,t,n,r){let i=t*r[0]/2,a=t*r[1]/2,o=Math.cos(n),s=Math.sin(n),c=i*o,l=i*s,u=a*o,d=a*s,f=e[0],p=e[1];return[f-c+d,p-l-u,f-c-d,p-l+u,f+c-d,p+l+u,f+c+d,p+l-u,f-c+d,p-l-u]}function xn(e){return e[3]-e[1]}function Sn(e,t,n){let r=n||nn();return Tn(e,t)?(e[0]>t[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]<t[2]?r[2]=e[2]:r[2]=t[2],e[3]<t[3]?r[3]=e[3]:r[3]=t[3]):an(r),r}function Cn(e){return[e[0],e[3]]}function wn(e){return[e[2],e[3]]}function z(e){return e[2]-e[0]}function Tn(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function En(e){return e[2]<e[0]||e[3]<e[1]}function Dn(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}function On(e,t,n){let r=!1,i=tn(e,t),a=tn(e,n);if(i===Kt.INTERSECTING||a===Kt.INTERSECTING)r=!0;else{let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=n[0],p=n[1],m=(p-d)/(f-u),h,g;a&Kt.ABOVE&&!(i&Kt.ABOVE)&&(h=f-(p-l)/m,r=h>=o&&h<=c),!r&&a&Kt.RIGHT&&!(i&Kt.RIGHT)&&(g=p-(f-c)*m,r=g>=s&&g<=l),!r&&a&Kt.BELOW&&!(i&Kt.BELOW)&&(h=f-(p-s)/m,r=h>=o&&h<=c),!r&&a&Kt.LEFT&&!(i&Kt.LEFT)&&(g=p-(f-o)*m,r=g>=s&&g<=l)}return r}function kn(e,t,n,r){if(En(e))return an(n);let i=[];if(r>1){let t=e[2]-e[0],n=e[3]-e[1];for(let a=0;a<r;++a)i.push(e[0]+t*a/r,e[1],e[2],e[1]+n*a/r,e[2]-t*a/r,e[3],e[0],e[3]-n*a/r)}else i=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]];t(i,i,2);let a=[],o=[];for(let e=0,t=i.length;e<t;e+=2)a.push(i[e]),o.push(i[e+1]);return Jt(a,o,n)}function An(e,t){let n=t.getExtent(),r=_n(e);if(t.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){let t=z(n),i=Math.floor((r[0]-n[0])/t)*t;e[0]-=i,e[2]-=i}return e}function jn(e,t,n){if(t.canWrapX()){let r=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[r[0],e[1],r[2],e[3]]];An(e,t);let i=z(r);if(z(e)>i&&!n)return[[r[0],e[1],r[2],e[3]]];if(e[0]<r[0])return[[e[0]+i,e[1],r[2],e[3]],[r[0],e[1],e[2],e[3]]];if(e[2]>r[2])return[[e[0],e[1],r[2],e[3]],[r[0],e[1],e[2]-i,e[3]]]}return[e]}function Mn(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function Nn(e,t){let n=e[0],r=e[1],i=t[0],a=t[1],o=i[0],s=i[1],c=a[0],l=a[1],u=c-o,d=l-s,f=u===0&&d===0?0:(u*(n-o)+d*(r-s))/(u*u+d*d||0),p,m;return f<=0?(p=o,m=s):f>=1?(p=c,m=l):(p=o+f*u,m=s+f*d),[p,m]}function Pn(e,t){let n=!0;for(let r=e.length-1;r>=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function Fn(e,t){let n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,a=e[1]*n+e[0]*r;return e[0]=i,e[1]=a,e}function In(e,t){return e[0]*=t,e[1]*=t,e}function Ln(e,t){let n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function Rn(e,t){return Math.sqrt(Ln(e,t))}function zn(e,t){return Ln(e,Nn(e,t))}function Bn(e,t){if(t.canWrapX()){let n=z(t.getExtent()),r=Vn(e,t,n);r&&(e[0]-=r*n)}return e}function Vn(e,t,n){let r=t.getExtent(),i=0;return t.canWrapX()&&(e[0]<r[0]||e[0]>r[2])&&(n||=z(r),i=Math.floor((e[0]-r[0])/n)),i}function Hn(e){return e**3}function Un(e){return 1-Hn(1-e)}function Wn(e){return 3*e*e-2*e*e*e}function Gn(e){return e}function Kn(e,t,n){n||=6371008.8;let r=Lt(e[1]),i=Lt(t[1]),a=(i-r)/2,o=Lt(t[0]-e[0])/2,s=Math.sin(a)*Math.sin(a)+Math.sin(o)*Math.sin(o)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}var qn={info:1,warn:2,error:3,none:4},Jn=qn.info;function Yn(...e){Jn>qn.warn||console.warn(...e)}var Xn={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},Zn=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent===void 0?null:e.extent,this.worldExtent_=e.worldExtent===void 0?null:e.worldExtent,this.axisOrientation_=e.axisOrientation===void 0?`enu`:e.axisOrientation,this.global_=e.global===void 0?!1:e.global,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_||Xn[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_}},Qn=6378137,$n=Math.PI*Qn,er=[-$n,-$n,$n,$n],tr=[-180,-85,180,85],nr=Qn*Math.log(Math.tan(Math.PI/2)),rr=class extends Zn{constructor(e){super({code:e,units:`m`,extent:er,global:!0,worldExtent:tr,getPointResolution:function(e,t){return e/Math.cosh(t[1]/Qn)}})}},ir=[new rr(`EPSG:3857`),new rr(`EPSG:102100`),new rr(`EPSG:102113`),new rr(`EPSG:900913`),new rr(`http://www.opengis.net/def/crs/EPSG/0/3857`),new rr(`http://www.opengis.net/gml/srs/epsg.xml#3857`)];function ar(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r){t[n]=$n*e[n]/180;let r=Qn*Math.log(Math.tan(Math.PI*(+e[n+1]+90)/360));r>nr?r=nr:r<-nr&&(r=-nr),t[n+1]=r}return t}function or(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r)t[n]=180*e[n]/$n,t[n+1]=360*Math.atan(Math.exp(e[n+1]/Qn))/Math.PI-90;return t}var sr=6378137,cr=[-180,-90,180,90],lr=Math.PI*sr/180,ur=class extends Zn{constructor(e,t){super({code:e,units:`degrees`,extent:cr,axisOrientation:t,global:!0,metersPerUnit:lr,worldExtent:cr})}},dr=[new ur(`CRS:84`),new ur(`EPSG:4326`,`neu`),new ur(`urn:ogc:def:crs:OGC:1.3:CRS84`),new ur(`urn:ogc:def:crs:OGC:2:84`),new ur(`http://www.opengis.net/def/crs/OGC/1.3/CRS84`),new ur(`http://www.opengis.net/gml/srs/epsg.xml#4326`,`neu`),new ur(`http://www.opengis.net/def/crs/EPSG/0/4326`,`neu`)],fr={};function pr(e){return fr[e]||fr[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,`EPSG:$3`)]||null}function mr(e,t){fr[e]=t}var hr={};function gr(e,t,n){let r=e.getCode(),i=t.getCode();r in hr||(hr[r]={}),hr[r][i]=n}function _r(e,t){return e in hr&&t in hr[e]?hr[e][t]:null}var vr=.9996,yr=.00669438,br=yr*yr,xr=br*yr,Sr=yr/(1-yr),Cr=Math.sqrt(1-yr),wr=(1-Cr)/(1+Cr),Tr=wr*wr,Er=Tr*wr,Dr=Er*wr,Or=Dr*wr,kr=1-yr/4-3*br/64-5*xr/256,Ar=3*yr/8+3*br/32+45*xr/1024,jr=15*br/256+45*xr/1024,Mr=35*xr/3072,Nr=3/2*wr-27/32*Er+269/512*Or,Pr=21/16*Tr-55/32*Dr,Fr=151/96*Er-417/128*Or,Ir=1097/512*Dr,Lr=6378137;function Rr(e,t,n){let r=e-5e5,i=(n.north?t:t-1e7)/vr/(Lr*kr),a=i+Nr*Math.sin(2*i)+Pr*Math.sin(4*i)+Fr*Math.sin(6*i)+Ir*Math.sin(8*i),o=Math.sin(a),s=o*o,c=Math.cos(a),l=o/c,u=l*l,d=u*u,f=1-yr*s,p=Lr/Math.sqrt(1-yr*s),m=(1-yr)/f,h=Sr*c**2,g=h*h,_=r/(p*vr),v=_*_,y=v*_,b=y*_,x=b*_,S=x*_,C=a-l/m*(v/2-b/24*(5+3*u+10*h-4*g-9*Sr))+S/720*(61+90*u+298*h+45*d-252*Sr-3*g),w=(_-y/6*(1+2*u+h)+x/120*(5-2*h+28*u-3*g+8*Sr+24*d))/c;return w=Ut(w+Lt(Wr(n.number)),-Math.PI,Math.PI),[It(w),It(C)]}var zr=-80,Br=84,Vr=-180,Hr=180;function Ur(e,t,n){e=Ut(e,Vr,Hr),t<zr?t=zr:t>Br&&(t=Br);let r=Lt(t),i=Math.sin(r),a=Math.cos(r),o=i/a,s=o*o,c=s*s,l=Lt(e),u=Lt(Wr(n.number)),d=Lr/Math.sqrt(1-yr*i**2),f=Sr*a**2,p=a*Ut(l-u,-Math.PI,Math.PI),m=p*p,h=m*p,g=h*p,_=g*p,v=_*p,y=Lr*(kr*r-Ar*Math.sin(2*r)+jr*Math.sin(4*r)-Mr*Math.sin(6*r)),b=vr*d*(p+h/6*(1-s+f)+_/120*(5-18*s+c+72*f-58*Sr))+5e5,x=vr*(y+d*o*(m/2+g/24*(5-s+9*f+4*f**2)+v/720*(61-58*s+c+600*f-330*Sr)));return n.north||(x+=1e7),[b,x]}function Wr(e){return(e-1)*6-180+3}var Gr=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Kr(e){let t=0;for(let n of Gr){let r=e.match(n);if(r){t=parseInt(r[1]);break}}if(!t)return null;let n=0,r=!1;return t>32700&&t<32761?n=t-32700:t>32600&&t<32661&&(r=!0,n=t-32600),n?{number:n,north:r}:null}function qr(e,t){return function(n,r,i,a){let o=n.length;i=i>1?i:2,a??=i,r||=i>2?n.slice():Array(o);for(let i=0;i<o;i+=a){let a=n[i],o=n[i+1],s=e(a,o,t);r[i]=s[0],r[i+1]=s[1]}return r}}function Jr(e){return Kr(e)?new Zn({code:e,units:`m`}):null}function Yr(e){let t=Kr(e.getCode());return t?{forward:qr(Ur,t),inverse:qr(Rr,t)}:null}var Xr=[Yr],Zr=[Jr],Qr=!0;function $r(e){Qr=!(e===void 0||e)}function ei(e,t){if(t!==void 0){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];t=t}else t=e.slice();return t}function ti(e){mr(e.getCode(),e),gr(e,e,ei)}function ni(e){e.forEach(ti)}function B(e){if(typeof e!=`string`)return e;let t=pr(e);if(t)return t;for(let t of Zr){let n=t(e);if(n)return n}return null}function ri(e,t,n,r){e=B(e);let i,a=e.getPointResolutionFunc();if(a){if(i=a(t,n),r&&r!==e.getUnits()){let t=e.getMetersPerUnit();t&&(i=i*t/Xn[r])}}else{let a=e.getUnits();if(a==`degrees`&&!r||r==`degrees`)i=t;else{let o=di(e,B(`EPSG:4326`));if(!o&&a!==`degrees`)i=t*e.getMetersPerUnit();else{let e=[n[0]-t/2,n[1],n[0]+t/2,n[1],n[0],n[1]-t/2,n[0],n[1]+t/2];e=o(e,e,2),i=(Kn(e.slice(0,2),e.slice(2,4))+Kn(e.slice(4,6),e.slice(6,8)))/2}let s=r?Xn[r]:e.getMetersPerUnit();s!==void 0&&(i/=s)}}return i}function ii(e){ni(e),e.forEach(function(t){e.forEach(function(e){t!==e&&gr(t,e,ei)})})}function ai(e,t,n,r){e.forEach(function(e){t.forEach(function(t){gr(e,t,n),gr(t,e,r)})})}function oi(e,t){return e?typeof e==`string`?B(e):e:B(t)}function si(e){return(function(t,n,r,i){let a=t.length;r=r===void 0?2:r,i??=r,n=n===void 0?Array(a):n;for(let o=0;o<a;o+=i){let a=e(t.slice(o,o+r)),s=a.length;for(let e=0,r=i;e<r;++e)n[o+e]=e>=s?t[o+e]:a[e]}return n})}function ci(e,t){return $r(),mi(e,`EPSG:4326`,t===void 0?`EPSG:3857`:t)}function li(e,t){let n=mi(e,t===void 0?`EPSG:3857`:t,`EPSG:4326`),r=n[0];return(r<-180||r>180)&&(n[0]=Rt(r+180,360)-180),n}function ui(e,t){if(e===t)return!0;let n=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||di(e,t)===ei)&&n}function di(e,t){let n=e.getCode(),r=t.getCode(),i=_r(n,r);if(i)return i;let a=null,o=null;for(let n of Xr)a||=n(e),o||=n(t);if(!a&&!o)return null;let s=`EPSG:4326`;if(!o){let e=_r(s,r);e&&(i=fi(a.inverse,e))}else if(a)i=fi(a.inverse,o.forward);else{let e=_r(n,s);e&&(i=fi(e,o.forward))}return i&&(ti(e),ti(t),gr(e,t,i)),i}function fi(e,t){return function(n,r,i,a){return r=e(n,r,i,a),t(r,r,i,a)}}function pi(e,t){return di(B(e),B(t))}function mi(e,t,n){let r=pi(t,n);if(!r){let e=B(t).getCode(),r=B(n).getCode();throw Error(`No transform available between ${e} and ${r}`)}return r(e,void 0,e.length)}function hi(e,t,n,r){return kn(e,pi(t,n),void 0,r)}var gi=null;function _i(){return gi}function vi(e,t){return gi?mi(e,t,gi):e}function yi(e,t){return gi?mi(e,gi,t):(Qr&&!Pn(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(Qr=!1,Yn(`Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.`)),e)}function bi(e,t){return gi?hi(e,t,gi):e}function xi(e,t){return gi?hi(e,gi,t):e}function Si(e,t){if(!gi)return e;let n=B(t).getMetersPerUnit(),r=gi.getMetersPerUnit();return n&&r?e*n/r:e}function Ci(){ii(ir),ii(dr),ai(dr,ir,ar,or)}Ci();var wi=[,,,,,,];function Ti(){return[1,0,0,1,0,0]}function Ei(e){return Oi(e,1,0,0,1,0,0)}function Di(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return e[0]=n*c+i*l,e[1]=r*c+a*l,e[2]=n*u+i*d,e[3]=r*u+a*d,e[4]=n*f+i*p+o,e[5]=r*f+a*p+s,e}function Oi(e,t,n,r,i,a,o){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=a,e[5]=o,e}function ki(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Ai(e,t){let n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function ji(e,t,n){return Di(e,Oi(wi,t,0,0,n,0,0))}function Mi(e,t,n){return Di(e,Oi(wi,1,0,0,1,t,n))}function Ni(e,t,n,r,i,a,o,s){let c=Math.sin(a),l=Math.cos(a);return e[0]=r*l,e[1]=i*c,e[2]=-r*c,e[3]=i*l,e[4]=o*r*l-s*r*c+t,e[5]=o*i*c+s*i*l+n,e}function Pi(e,t){let n=Fi(t);R(n!==0,`Transformation matrix cannot be inverted`);let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-a/n,e[3]=r/n,e[4]=(a*c-o*s)/n,e[5]=-(r*c-i*s)/n,e}function Fi(e){return e[0]*e[3]-e[1]*e[2]}var Ii=[1e5,1e5,1e5,1e5,2,2];function Li(e){return`matrix(`+e.join(`, `)+`)`}function Ri(e){return e.substring(7,e.length-1).split(`,`).map(parseFloat)}function zi(e,t){let n=Ri(e),r=Ri(t);for(let e=0;e<6;++e)if(Math.round((n[e]-r[e])*Ii[e])!==0)return!1;return!0}function Bi(e,t,n,r,i,a,o){a||=[],o||=2;let s=0;for(let c=t;c<n;c+=r){let t=e[c],n=e[c+1];a[s++]=i[0]*t+i[2]*n+i[4],a[s++]=i[1]*t+i[3]*n+i[5];for(let t=2;t<o;t++)a[s++]=e[c+t]}return a&&a.length!=s&&(a.length=s),a}function Vi(e,t,n,r,i,a,o){o||=[];let s=Math.cos(i),c=Math.sin(i),l=a[0],u=a[1],d=0;for(let i=t;i<n;i+=r){let t=e[i]-l,n=e[i+1]-u;o[d++]=l+t*s-n*c,o[d++]=u+t*c+n*s;for(let t=i+2;t<i+r;++t)o[d++]=e[t]}return o&&o.length!=d&&(o.length=d),o}function Hi(e,t,n,r,i,a,o,s){s||=[];let c=o[0],l=o[1],u=0;for(let o=t;o<n;o+=r){let t=e[o]-c,n=e[o+1]-l;s[u++]=c+i*t,s[u++]=l+a*n;for(let t=o+2;t<o+r;++t)s[u++]=e[t]}return s&&s.length!=u&&(s.length=u),s}function Ui(e,t,n,r,i,a,o){o||=[];let s=0;for(let c=t;c<n;c+=r){o[s++]=e[c]+i,o[s++]=e[c+1]+a;for(let t=c+2;t<c+r;++t)o[s++]=e[t]}return o&&o.length!=s&&(o.length=s),o}var Wi=Ti(),Gi=[NaN,NaN],Ki=class extends ct{constructor(){super(),this.extent_=nn(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Xe((e,t,n)=>{if(!n)return this.getSimplifiedGeometry(t);let r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return P()}closestPointXY(e,t,n,r){return P()}containsXY(e,t){return this.closestPointXY(e,t,Gi,Number.MIN_VALUE)===0}getClosestPoint(e,t){return 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 P()}getExtent(e){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&an(e),this.extentRevision_=this.getRevision()}return Dn(this.extent_,e)}rotate(e,t){P()}scale(e,t,n){P()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return P()}getType(){return P()}applyTransform(e){P()}intersectsExtent(e){return P()}translate(e,t){P()}transform(e,t){let n=B(e),r=n.getUnits()==`tile-pixels`?function(e,r,i){let a=n.getExtent(),o=n.getWorldExtent(),s=xn(o)/xn(a);Ni(Wi,o[0],o[3],s,-s,0,0,0);let c=Bi(e,0,e.length,i,Wi,r),l=pi(n,t);return l?l(c,c,i):c}:pi(n,t);return this.applyTransform(r),this}},qi=class extends Ki{constructor(){super(),this.layout=`XY`,this.stride=2,this.flatCoordinates}computeExtent(e){return sn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return P()}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;let t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=Yi(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){P()}setLayout(e,t,n){let r;if(e)r=Yi(e);else{for(let e=0;e<n;++e){if(t.length===0){this.layout=`XY`,this.stride=2;return}t=t[0]}r=t.length,e=Ji(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith(`XYZ`)?3:2,this.stride),this.changed())}rotate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();Vi(n,0,n.length,r,e,t,n),this.changed()}}scale(e,t,n){t===void 0&&(t=e),n||=_n(this.getExtent());let r=this.getFlatCoordinates();if(r){let i=this.getStride();Hi(r,0,r.length,i,e,t,n,r),this.changed()}}translate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();Ui(n,0,n.length,r,e,t,n),this.changed()}}};function Ji(e){let t;return e==2?t=`XY`:e==3?t=`XYZ`:e==4&&(t=`XYZM`),t}function Yi(e){let t;return e==`XY`?t=2:e==`XYZ`||e==`XYM`?t=3:e==`XYZM`&&(t=4),t}function Xi(e,t,n){let r=e.getFlatCoordinates();if(!r)return null;let i=e.getStride();return Bi(r,0,r.length,i,t,n)}function Zi(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1],s=0,c=0;for(;t<n;t+=r){let n=e[t]-a,r=e[t+1]-o;i+=c*n-s*r,s=n,c=r}return i/2}function Qi(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=Zi(e,t,o,r),t=o}return i}function $i(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=Qi(e,t,o,r),t=o[o.length-1]}return i}function ea(e,t,n,r,i,a,o){let s=e[t],c=e[t+1],l=e[n]-s,u=e[n+1]-c,d;if(l===0&&u===0)d=t;else{let f=((i-s)*l+(a-c)*u)/(l*l+u*u);if(f>1)d=n;else if(f>0){for(let i=0;i<r;++i)o[i]=zt(e[t+i],e[n+i],f);o.length=r;return}else d=t}for(let t=0;t<r;++t)o[t]=e[d+t];o.length=r}function ta(e,t,n,r,i){let a=e[t],o=e[t+1];for(t+=r;t<n;t+=r){let n=e[t],r=e[t+1],s=Pt(a,o,n,r);s>i&&(i=s),a=n,o=r}return i}function na(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=ta(e,t,o,r,i),t=o}return i}function ra(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=na(e,t,o,r,i),t=o[o.length-1]}return i}function ia(e,t,n,r,i,a,o,s,c,l,u){if(t==n)return l;let d,f;if(i===0){if(f=Pt(o,s,e[t],e[t+1]),f<l){for(d=0;d<r;++d)c[d]=e[t+d];return c.length=r,f}return l}u||=[NaN,NaN];let p=t+r;for(;p<n;)if(ea(e,p-r,p,r,o,s,u),f=Pt(o,s,u[0],u[1]),f<l){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r,p+=r}else p+=r*Math.max((Math.sqrt(f)-Math.sqrt(l))/i|0,1);if(a&&(ea(e,n-r,t,r,o,s,u),f=Pt(o,s,u[0],u[1]),f<l)){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r}return l}function aa(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=ia(e,t,f,r,i,a,o,s,c,l,u),t=f}return l}function oa(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=aa(e,t,f,r,i,a,o,s,c,l,u),t=f[f.length-1]}return l}function sa(e,t,n,r){for(let r=0,i=n.length;r<i;++r)e[t++]=n[r];return t}function ca(e,t,n,r){for(let i=0,a=n.length;i<a;++i){let a=n[i];for(let n=0;n<r;++n)e[t++]=a[n]}return t}function la(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=ca(e,t,n[o],r);i[a++]=s,t=s}return i.length=a,i}function ua(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=la(e,t,n[o],r,i[a]);s.length===0&&(s[0]=t),i[a++]=s,t=s[s.length-1]}return i.length=a,i}function da(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=t;o<n;o+=r)i[a++]=e.slice(o,o+r);return i.length=a,i}function fa(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=da(e,t,s,r,i[a]),t=s}return i.length=a,i}function pa(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=s.length===1&&s[0]===t?[]:fa(e,t,s,r,i[a]),t=s[s.length-1]}return i.length=a,i}function ma(e,t,n,r,i,a,o){let s=(n-t)/r;if(s<3){for(;t<n;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}let c=Array(s);c[0]=1,c[s-1]=1;let l=[t,n-r],u=0;for(;l.length>0;){let n=l.pop(),a=l.pop(),o=0,s=e[a],d=e[a+1],f=e[n],p=e[n+1];for(let t=a+r;t<n;t+=r){let n=e[t],r=e[t+1],i=Nt(n,r,s,d,f,p);i>o&&(u=t,o=i)}o>i&&(c[(u-t)/r]=1,a+r<u&&l.push(a,u),u+r<n&&l.push(u,n))}for(let n=0;n<s;++n)c[n]&&(a[o++]=e[t+n*r],a[o++]=e[t+n*r+1]);return o}function ha(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=ma(e,t,l,r,i,a,o),s.push(o),t=l}return o}function ga(e,t){return t*Math.round(e/t)}function _a(e,t,n,r,i,a,o){if(t==n)return o;let s=ga(e[t],i),c=ga(e[t+1],i);t+=r,a[o++]=s,a[o++]=c;let l,u;do if(l=ga(e[t],i),u=ga(e[t+1],i),t+=r,t==n)return a[o++]=l,a[o++]=u,o;while(l==s&&u==c);for(;t<n;){let n=ga(e[t],i),d=ga(e[t+1],i);if(t+=r,n==l&&d==u)continue;let f=l-s,p=u-c,m=n-s,h=d-c;if(f*h==p*m&&(f<0&&m<f||f==m||f>0&&m>f)&&(p<0&&h<p||p==h||p>0&&h>p)){l=n,u=d;continue}a[o++]=l,a[o++]=u,s=l,c=u,l=n,u=d}return a[o++]=l,a[o++]=u,o}function va(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=_a(e,t,l,r,i,a,o),s.push(o),t=l}return o}function ya(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c],u=[];o=va(e,t,l,r,i,a,o,u),s.push(u),t=l[l.length-1]}return o}var ba=class e extends qi{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new e(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,n,r){return r<Zt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,n,r))}getArea(){return Zi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){let n=[];return n.length=ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LinearRing`}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=ca(this.flatCoordinates,0,e,this.stride),this.changed()}},xa=class e extends qi{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=Pt(e,t,i[0],i[1]);if(a<r){let e=this.stride;for(let t=0;t<e;++t)n[t]=i[t];return n.length=e,a}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return on(this.flatCoordinates,e)}getType(){return`Point`}intersectsExtent(e){return en(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||=[],this.flatCoordinates.length=sa(this.flatCoordinates,0,e,this.stride),this.changed()}};function Sa(e,t,n,r,i){return!pn(i,function(i){return!Ca(e,t,n,r,i[0],i[1])})}function Ca(e,t,n,r,i,a){let o=0,s=e[n-r],c=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];c<=a?r>a&&(n-s)*(a-c)-(i-s)*(r-c)>0&&o++:r<=a&&(n-s)*(a-c)-(i-s)*(r-c)<0&&o--,s=n,c=r}return o!==0}function wa(e,t,n,r,i,a){if(n.length===0||!Ca(e,t,n[0],r,i,a))return!1;for(let t=1,o=n.length;t<o;++t)if(Ca(e,n[t-1],n[t],r,i,a))return!1;return!0}function Ta(e,t,n,r,i,a){if(n.length===0)return!1;for(let o=0,s=n.length;o<s;++o){let s=n[o];if(wa(e,t,s,r,i,a))return!0;t=s[s.length-1]}return!1}function Ea(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m=i[a+1],h=[];for(let i=0,a=n.length;i<a;++i){let a=n[i];for(u=e[a-r],f=e[a-r+1],s=t;s<a;s+=r)d=e[s],p=e[s+1],(m<=f&&p<=m||f<=m&&m<=p)&&(l=(m-f)/(p-f)*(d-u)+u,h.push(l)),u=d,f=p}let g=NaN,_=-1/0;for(h.sort(Be),u=h[0],s=1,c=h.length;s<c;++s){d=h[s];let i=Math.abs(d-u);i>_&&(l=(u+d)/2,wa(e,t,n,r,l,m)&&(g=l,_=i)),u=d}return isNaN(g)&&(g=i[a]),o?(o.push(g,m,_),o):[g,m,_]}function Da(e,t,n,r,i){let a=[];for(let o=0,s=n.length;o<s;++o){let s=n[o];a=Ea(e,t,s,r,i,2*o,a),t=s[s.length-1]}return a}function Oa(e,t,n,r,i){let a;for(t+=r;t<n;t+=r)if(a=i(e.slice(t-r,t),e.slice(t,t+r)),a)return a;return!1}function ka(e,t,n,r,i,a){return a??=dn(nn(),e,t,n,r),Tn(i,a)?a[0]>=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]?!0:Oa(e,t,n,r,function(e,t){return On(i,e,t)}):!1}function Aa(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){if(ka(e,t,n[a],r,i))return!0;t=n[a]}return!1}function ja(e,t,n,r,i){return!!(ka(e,t,n,r,i)||Ca(e,t,n,r,i[0],i[1])||Ca(e,t,n,r,i[0],i[3])||Ca(e,t,n,r,i[2],i[1])||Ca(e,t,n,r,i[2],i[3]))}function Ma(e,t,n,r,i){if(!ja(e,t,n[0],r,i))return!1;if(n.length===1)return!0;for(let t=1,a=n.length;t<a;++t)if(Sa(e,n[t-1],n[t],r,i)&&!ka(e,n[t-1],n[t],r,i))return!1;return!0}function Na(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(Ma(e,t,o,r,i))return!0;t=o[o.length-1]}return!1}function Pa(e,t,n,r){for(;t<n-r;){for(let i=0;i<r;++i){let a=e[t+i];e[t+i]=e[n-r+i],e[n-r+i]=a}t+=r,n-=r}}function Fa(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];i+=(n-a)*(r+o),a=n,o=r}return i===0?void 0:i>0}function Ia(e,t,n,r,i){i=i===void 0?!1:i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=Fa(e,t,o,r);if(a===0){if(i&&s||!i&&!s)return!1}else if(i&&!s||!i&&s)return!1;t=o}return!0}function La(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(!Ia(e,t,o,r,i))return!1;o.length&&(t=o[o.length-1])}return!0}function Ra(e,t,n,r,i){i=i===void 0?!1:i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=Fa(e,t,o,r);(a===0?i&&s||!i&&!s:i&&!s||!i&&s)&&Pa(e,t,o,r),t=o}return t}function za(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a)t=Ra(e,t,n[a],r,i);return t}function Ba(e,t){let n=[],r=0,i=0,a;for(let o=0,s=t.length;o<s;++o){let s=t[o],c=Fa(e,r,s,2);if(a===void 0&&(a=c),c===a)n.push(t.slice(i,o+1));else{if(n.length===0)continue;n[n.length-1].push(t[i])}i=o+1,r=s}return n}var Va=class e extends qi{constructor(e,t,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&n?(this.setFlatCoordinates(t,e),this.ends_=n):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?We(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Zt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(na(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),aa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return wa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return Qi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),Ra(t,0,this.ends_,this.stride,e)),fa(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){let e=_n(this.getExtent());this.flatInteriorPoint_=Ea(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new xa(this.getFlatInteriorPoint(),`XYM`)}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new ba(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){let e=this.layout,t=this.flatCoordinates,n=this.ends_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=new ba(t.slice(i,o),e);r.push(s),i=o}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;Ia(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Ra(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=va(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getType(){return`Polygon`}intersectsExtent(e){return Ma(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=la(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}};function Ha(e){if(En(e))throw Error(`Cannot create polygon from empty extent`);let t=e[0],n=e[1],r=e[2],i=e[3],a=[t,n,t,i,r,i,r,n,t,n];return new Va(a,`XY`,[a.length])}function Ua(e,t,n){t||=32;let r=e.getStride(),i=e.getLayout(),a=e.getCenter(),o=r*(t+1),s=Array(o);for(let e=0;e<o;e+=r){s[e]=0,s[e+1]=0;for(let t=2;t<r;t++)s[e+t]=a[t]}let c=new Va(s,i,[s.length]);return Wa(c,a,e.getRadius(),n),c}function Wa(e,t,n,r){let i=e.getFlatCoordinates(),a=e.getStride(),o=i.length/a-1,s=r||0;for(let e=0;e<=o;++e){let r=e*a,c=s+Rt(e,o)*2*Math.PI/o;i[r]=t[0]+n*Math.cos(c),i[r+1]=t[1]+n*Math.sin(c)}e.changed()}function Ga(e,t,n,r){let i=z(t)/n[0],a=xn(t)/n[1];return r?Math.min(e,Math.max(i,a)):Math.min(e,Math.min(i,a))}function Ka(e,t,n){let r=Math.min(e,t);return r*=Math.log(1+50*Math.max(0,e/t-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/e-1))/50+1),Mt(r,n/2,t*2)}function qa(e,t,n,r){return t=t===void 0?!0:t,(function(i,a,o,s){if(i!==void 0){let c=e[0],l=e[e.length-1],u=n?Ga(c,n,o,r):c;if(s)return t?Ka(i,u,l):Mt(i,l,u);let d=Math.floor(He(e,Math.min(u,i),a));return e[d]>u&&d<e.length-1?e[d+1]:e[d]}})}function Ja(e,t,n,r,i,a){return r=r===void 0?!0:r,n=n===void 0?0:n,(function(o,s,c,l){if(o!==void 0){let u=i?Ga(t,i,c,a):t;if(l)return r?Ka(o,u,n):Mt(o,n,u);let d=1e-9,f=Math.ceil(Math.log(t/u)/Math.log(e)-d),p=-s*(.5-d)+.5,m=Math.floor(Math.log(t/Math.min(u,o))/Math.log(e)+p);return Mt(t/e**+Math.max(f,m),n,u)}})}function Ya(e,t,n,r,i){return n=n===void 0?!0:n,(function(a,o,s,c){if(a!==void 0){let o=r?Ga(e,r,s,i):e;return!n||!c?Mt(a,t,o):Ka(a,o,t)}})}function Xa(e){if(e!==void 0)return 0}function Za(e){if(e!==void 0)return e}function Qa(e){let t=2*Math.PI/e;return(function(e,n){if(n)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e})}function $a(e){let t=e===void 0?Lt(5):e;return(function(e,n){return n||e===void 0?e:Math.abs(e)<=t?0:e})}var eo=0,to=class extends ct{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=oi(e.projection,`EPSG:3857`),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,e.projection&&$r(),e.center&&=yi(e.center,this.projection_),e.extent&&=xi(e.extent,this.projection_),this.applyOptions_(e)}applyOptions_(e){let t=Object.assign({},e);for(let e in jt)delete t[e];this.setProperties(t,!0);let n=io(e);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=n.minZoom,this.constraints_={center:ro(e),resolution:n.constraint,rotation:ao(e)},this.setRotation(e.rotation===void 0?0:e.rotation),this.setCenterInternal(e.center===void 0?null:e.center),e.resolution===void 0?e.zoom!==void 0&&this.setZoom(e.zoom):this.setResolution(e.resolution)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;let n=this.getCenterInternal();if(n){let r=e||[0,0,0,0];t||=[0,0,0,0];let i=this.getResolution(),a=i/2*(r[3]-t[3]+t[1]-r[1]),o=i/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([n[0]+a,n[1]-o])}}getUpdatedOptions_(e){let t=this.getProperties();return t.resolution===void 0?t.zoom=this.getZoom():t.resolution=this.getResolution(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);let t=Array(arguments.length);for(let e=0;e<t.length;++e){let n=arguments[e];n.center&&(n=Object.assign({},n),n.center=yi(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=yi(n.anchor,this.getProjection())),t[e]=n}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,n;t>1&&typeof arguments[t-1]==`function`&&(n=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){let e=arguments[r];e.center&&this.setCenterInternal(e.center),e.zoom===void 0?e.resolution&&this.setResolution(e.resolution):this.setZoom(e.zoom),e.rotation!==void 0&&this.setRotation(e.rotation)}if(r===t){n&&no(n,!0);return}let i=Date.now(),a=this.targetCenter_.slice(),o=this.targetResolution_,s=this.targetRotation_,c=[];for(;r<t;++r){let e=arguments[r],t={start:i,complete:!1,anchor:e.anchor,duration:e.duration===void 0?1e3:e.duration,easing:e.easing||Wn,callback:n};if(e.center&&(t.sourceCenter=a,t.targetCenter=e.center.slice(),a=t.targetCenter),e.zoom===void 0?e.resolution&&(t.sourceResolution=o,t.targetResolution=e.resolution,o=t.targetResolution):(t.sourceResolution=o,t.targetResolution=this.getResolutionForZoom(e.zoom),o=t.targetResolution),e.rotation!==void 0){t.sourceRotation=s;let n=Rt(e.rotation-s+Math.PI,2*Math.PI)-Math.PI;t.targetRotation=s+n,s=t.targetRotation}oo(t)?t.complete=!0:i+=t.duration,c.push(t)}this.animations_.push(c),this.setHint(At.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[At.ANIMATING]>0}getInteracting(){return this.hints_[At.INTERACTING]>0}cancelAnimations(){this.setHint(At.ANIMATING,-this.hints_[At.ANIMATING]);let e;for(let t=0,n=this.animations_.length;t<n;++t){let n=this.animations_[t];if(n[0].callback&&no(n[0].callback,!1),!e)for(let t=0,r=n.length;t<r;++t){let r=n[t];if(!r.complete){e=r.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;let e=Date.now(),t=!1;for(let n=this.animations_.length-1;n>=0;--n){let r=this.animations_[n],i=!0;for(let n=0,a=r.length;n<a;++n){let a=r[n];if(a.complete)continue;let o=e-a.start,s=a.duration>0?o/a.duration:1;s>=1?(a.complete=!0,s=1):i=!1;let c=a.easing(s);if(a.sourceCenter){let e=a.sourceCenter[0],t=a.sourceCenter[1],n=a.targetCenter[0],r=a.targetCenter[1];this.nextCenter_=a.targetCenter,this.targetCenter_=[e+c*(n-e),t+c*(r-t)]}if(a.sourceResolution&&a.targetResolution){let e=c===1?a.targetResolution:a.sourceResolution+c*(a.targetResolution-a.sourceResolution);if(a.anchor){let t=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(e,0,t,!0);this.targetCenter_=this.calculateCenterZoom(n,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=e,this.applyTargetState_(!0)}if(a.sourceRotation!==void 0&&a.targetRotation!==void 0){let e=c===1?Rt(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+c*(a.targetRotation-a.sourceRotation);if(a.anchor){let t=this.constraints_.rotation(e,!0);this.targetCenter_=this.calculateCenterRotate(t,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=e}if(this.applyTargetState_(!0),t=!0,!a.complete)break}if(i){this.animations_[n]=null,this.setHint(At.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let e=r[0].callback;e&&no(e,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let n,r=this.getCenterInternal();return r!==void 0&&(n=[r[0]-t[0],r[1]-t[1]],Fn(n,e-this.getRotation()),Mn(n,t)),n}calculateCenterZoom(e,t){let n,r=this.getCenterInternal(),i=this.getResolution();return r!==void 0&&i!==void 0&&(n=[t[0]-e*(t[0]-r[0])/i,t[1]-e*(t[1]-r[1])/i]),n}getViewportSize_(e){let t=this.viewportSize_;if(e){let n=t[0],r=t[1];return[Math.abs(n*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(n*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(){let e=this.getCenterInternal();return e&&vi(e,this.getProjection())}getCenterInternal(){return this.get(jt.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get(`constrainResolution`)}getHints(e){return e===void 0?this.hints_.slice():(e[0]=this.hints_[0],e[1]=this.hints_[1],e)}calculateExtent(e){return bi(this.calculateExtentInternal(e),this.getProjection())}calculateExtentInternal(e){e||=this.getViewportSizeMinusPadding_();let t=this.getCenterInternal();R(t,`The view center is not defined`);let n=this.getResolution();R(n!==void 0,`The view resolution is not defined`);let r=this.getRotation();return R(r!==void 0,`The view rotation is not defined`),yn(t,n,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(jt.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(xi(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t||=this.getViewportSizeMinusPadding_();let n=z(e)/t[0],r=xn(e)/t[1];return Math.max(n,r)}getResolutionForValueFunction(e){e||=2;let t=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(t/n)/Math.log(e);return(function(n){return t/e**+(n*r)})}getRotation(){return this.get(jt.ROTATION)}getValueForResolutionFunction(e){let t=Math.log(e||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/t;return(function(e){return Math.log(n/e)/t/i})}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e),n=this.padding_;return n&&(t=[t[0]-n[1]-n[3],t[1]-n[0]-n[2]]),t}getState(){let e=this.getProjection(),t=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){let e=this.getViewportSizeMinusPadding_();r=so(r,this.getViewportSize_(),[e[0]/2+i[3],e[1]/2+i[0]],t,n)}return{center:r.slice(0),projection:e===void 0?null:e,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e,t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,n,r;if(this.resolutions_){let i=He(this.resolutions_,e,1);t=i,n=this.resolutions_[i],r=i==this.resolutions_.length-1?2:n/this.resolutions_[i+1]}else n=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(n/e)/Math.log(r)}getResolutionForZoom(e){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];let t=Mt(Math.floor(e),0,this.resolutions_.length-2),n=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/n**+Mt(e-t,0,1)}return this.maxResolution_/this.zoomFactor_**+(e-this.minZoom_)}fit(e,t){let n;if(R(Array.isArray(e)||typeof e.getSimplifiedGeometry==`function`,"Invalid extent or geometry provided as `geometry`"),Array.isArray(e))R(!En(e),"Cannot fit empty extent provided as `geometry`"),n=Ha(xi(e,this.getProjection()));else if(e.getType()===`Circle`){let t=xi(e.getExtent(),this.getProjection());n=Ha(t),n.rotate(this.getRotation(),_n(t))}else{let t=_i();n=t?e.clone().transform(t,this.getProjection()):e}this.fitInternal(n,t)}rotatedExtentForGeometry(e){let t=this.getRotation(),n=Math.cos(t),r=Math.sin(-t),i=e.getFlatCoordinates(),a=e.getStride(),o=1/0,s=1/0,c=-1/0,l=-1/0;for(let e=0,t=i.length;e<t;e+=a){let t=i[e]*n-i[e+1]*r,a=i[e]*r+i[e+1]*n;o=Math.min(o,t),s=Math.min(s,a),c=Math.max(c,t),l=Math.max(l,a)}return[o,s,c,l]}fitInternal(e,t){t||={};let n=t.size;n||=this.getViewportSizeMinusPadding_();let r=t.padding===void 0?[0,0,0,0]:t.padding,i=t.nearest===void 0?!1:t.nearest,a;a=t.minResolution===void 0?t.maxZoom===void 0?0:this.getResolutionForZoom(t.maxZoom):t.minResolution;let o=this.rotatedExtentForGeometry(e),s=this.getResolutionForExtentInternal(o,[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);s=isNaN(s)?a:Math.max(s,a),s=this.getConstrainedResolution(s,i?0:1);let c=this.getRotation(),l=Math.sin(c),u=Math.cos(c),d=_n(o);d[0]+=(r[1]-r[3])/2*s,d[1]+=(r[0]-r[2])/2*s;let f=d[0]*u-d[1]*l,p=d[1]*u+d[0]*l,m=this.getConstrainedCenter([f,p],s),h=t.callback?t.callback:Ye;t.duration===void 0?(this.targetResolution_=s,this.targetCenter_=m,this.applyTargetState_(!1,!0),no(h,!0)):this.animateInternal({resolution:s,center:m,duration:t.duration,easing:t.easing},h)}centerOn(e,t,n){this.centerOnInternal(yi(e,this.getProjection()),t,n)}centerOnInternal(e,t,n){this.setCenterInternal(so(e,t,n,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,n,r){let i,a=this.padding_;if(a&&e){let o=this.getViewportSizeMinusPadding_(-n),s=so(e,r,[o[0]/2+a[3],o[1]/2+a[0]],t,n);i=[e[0]-s[0],e[1]-s[1]]}return i}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){let t=vi(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){let t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t&&=yi(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){let n=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*e,0,r,n);t&&(this.targetCenter_=this.calculateCenterZoom(i,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(this.zoomFactor_**+-e,t)}adjustRotation(e,t){t&&=yi(t,this.getProjection()),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){let n=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,n);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&yi(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){let n=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,n),i=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,0,i,n),o=this.constraints_.center(this.targetCenter_,a,i,n,this.calculateCenterShift(this.targetCenter_,a,r,i));this.get(jt.ROTATION)!==r&&this.set(jt.ROTATION,r),this.get(jt.RESOLUTION)!==a&&(this.set(jt.RESOLUTION,a),this.set(`zoom`,this.getZoom(),!0)),(!o||!this.get(jt.CENTER)||!Pn(this.get(jt.CENTER),o))&&this.set(jt.CENTER,o),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,n){e=e===void 0?200:e;let r=t||0,i=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(i),o=this.constraints_.resolution(this.targetResolution_,r,a),s=this.constraints_.center(this.targetCenter_,o,a,!1,this.calculateCenterShift(this.targetCenter_,o,i,a));if(e===0&&!this.cancelAnchor_){this.targetResolution_=o,this.targetRotation_=i,this.targetCenter_=s,this.applyTargetState_();return}n||=e===0?this.cancelAnchor_:void 0,this.cancelAnchor_=void 0,(this.getResolution()!==o||this.getRotation()!==i||!this.getCenterInternal()||!Pn(this.getCenterInternal(),s))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:i,center:s,resolution:o,duration:e,easing:Un,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(At.INTERACTING,1)}endInteraction(e,t,n){n&&=yi(n,this.getProjection()),this.endInteractionInternal(e,t,n)}endInteractionInternal(e,t,n){this.getInteracting()&&(this.setHint(At.INTERACTING,-1),this.resolveConstraints(e,t,n))}getConstrainedCenter(e,t){let n=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),n)}getConstrainedZoom(e,t){let n=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(n,t))}getConstrainedResolution(e,t){t||=0;let n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,n)}};function no(e,t){setTimeout(function(){e(t)},0)}function ro(e){if(e.extent!==void 0){let t=e.smoothExtentConstraint===void 0?!0:e.smoothExtentConstraint;return Wt(e.extent,e.constrainOnlyCenter,t)}let t=oi(e.projection,`EPSG:3857`);if(e.multiWorld!==!0&&t.isGlobal()){let e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Wt(e,!1,!1)}return Gt}function io(e){let t,n,r,i=e.minZoom===void 0?eo:e.minZoom,a=e.maxZoom===void 0?28:e.maxZoom,o=e.zoomFactor===void 0?2:e.zoomFactor,s=e.multiWorld===void 0?!1:e.multiWorld,c=e.smoothResolutionConstraint===void 0?!0:e.smoothResolutionConstraint,l=e.showFullExtent===void 0?!1:e.showFullExtent,u=oi(e.projection,`EPSG:3857`),d=u.getExtent(),f=e.constrainOnlyCenter,p=e.extent;if(!s&&!p&&u.isGlobal()&&(f=!1,p=d),e.resolutions!==void 0){let o=e.resolutions;n=o[i],r=o[a]===void 0?o[o.length-1]:o[a],t=e.constrainResolution?qa(o,c,!f&&p,l):Ya(n,r,c,!f&&p,l)}else{let s=(d?Math.max(z(d),xn(d)):360*Xn.degrees/u.getMetersPerUnit())/256/2**eo,m=s/2**(28-eo);n=e.maxResolution,n===void 0?n=s/o**+i:i=0,r=e.minResolution,r===void 0&&(r=e.maxZoom===void 0?m:e.maxResolution===void 0?s/o**+a:n/o**+a),a=i+Math.floor(Math.log(n/r)/Math.log(o)),r=n/o**+(a-i),t=e.constrainResolution?Ja(o,n,r,c,!f&&p,l):Ya(n,r,c,!f&&p,l)}return{constraint:t,maxResolution:n,minResolution:r,minZoom:i,zoomFactor:o}}function ao(e){if(e.enableRotation===void 0||e.enableRotation){let t=e.constrainRotation;return t===void 0||t===!0?$a():t===!1?Za:typeof t==`number`?Qa(t):Za}return Xa}function oo(e){return!(e.sourceCenter&&e.targetCenter&&!Pn(e.sourceCenter,e.targetCenter)||e.sourceResolution!==e.targetResolution||e.sourceRotation!==e.targetRotation)}function so(e,t,n,r,i){let a=Math.cos(-i),o=Math.sin(-i),s=e[0]*a-e[1]*o,c=e[1]*a+e[0]*o;return s+=(t[0]/2-n[0])*r,c+=(n[1]-t[1]/2)*r,o=-o,[s*a-c*o,c*a+s*o]}var co=`ol-hidden`,lo=`ol-unselectable`,uo=`ol-control`,fo=`ol-collapsed`,po=new RegExp([`^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)`,`(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)`,`(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)`,`(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?`,`(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))`,`(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))`,`?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`].join(``),`i`),mo=[`style`,`variant`,`weight`,`size`,`lineHeight`,`family`],ho={normal:400,bold:700},go=function(e){let t=e.match(po);if(!t)return null;let n={lineHeight:`normal`,size:`1.2em`,style:`normal`,weight:`400`,variant:`normal`};for(let e=0,r=mo.length;e<r;++e){let r=t[e+1];r!==void 0&&(n[mo[e]]=typeof r==`string`?r.trim():r)}return isNaN(Number(n.weight))&&n.weight in ho&&(n.weight=ho[n.weight]),n.families=n.family.split(/,\s?/).map(e=>e.trim().replace(/^['"]|['"]$/g,``)),n};function _o(e,t,n,r){let i;return i=n&&n.length?n.shift():vt?new class extends OffscreenCanvas{style={}}(e??300,t??150):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`2d`,r)}var vo;function yo(){return vo||=_o(1,1),vo}function bo(e){let t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function xo(e,t){let n=t.parentNode;n&&n.replaceChild(e,t)}function So(e){for(;e.lastChild;)e.lastChild.remove()}function Co(e,t){let n=e.childNodes;for(let r=0;;++r){let i=n[r],a=t[r];if(!i&&!a)break;if(i!==a){if(!i){e.appendChild(a);continue}if(!a){e.removeChild(i),--r;continue}e.insertBefore(a,i)}}}function wo(){return new Proxy({childNodes:[],appendChild:function(e){return this.childNodes.push(e),e},remove:function(){},removeChild:function(e){let t=this.childNodes.indexOf(e);if(t===-1)throw Error(`Node to remove was not found`);return this.childNodes.splice(t,1),e},insertBefore:function(e,t){let n=this.childNodes.indexOf(t);if(n===-1)throw Error(`Reference node not found`);return this.childNodes.splice(n,0,e),e},style:{}},{get(e,t,n){return t===`firstElementChild`?e.childNodes.length>0?e.childNodes[0]:null:Reflect.get(e,t,n)}})}function To(e){return typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas}var Eo=class extends ct{constructor(e){super();let t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents=`auto`),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&this.element?.remove();for(let e=0,t=this.listenerKeys.length;e<t;++e)rt(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=e,e){let t=this.target_??e.getOverlayContainerStopEvent();this.element&&t.appendChild(this.element),this.render!==Ye&&this.listenerKeys.push(N(e,wt.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e==`string`?document.getElementById(e):e}},Do=class extends Eo{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target}),this.ulElement_=document.createElement(`ul`),this.collapsed_=e.collapsed===void 0?!0:e.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible===void 0?!0:e.collapsible,this.collapsible_||(this.collapsed_=!1),this.attributions_=e.attributions;let t=e.className===void 0?`ol-attribution`:e.className,n=e.tipLabel===void 0?`Attributions`:e.tipLabel,r=e.expandClassName===void 0?t+`-expand`:e.expandClassName,i=e.collapseLabel===void 0?`›`:e.collapseLabel,a=e.collapseClassName===void 0?t+`-collapse`:e.collapseClassName;typeof i==`string`?(this.collapseLabel_=document.createElement(`span`),this.collapseLabel_.textContent=i,this.collapseLabel_.className=a):this.collapseLabel_=i;let o=e.label===void 0?`i`:e.label;typeof o==`string`?(this.label_=document.createElement(`span`),this.label_.textContent=o,this.label_.className=r):this.label_=o;let s=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement(`button`),this.toggleButton_.setAttribute(`type`,`button`),this.toggleButton_.setAttribute(`aria-expanded`,String(!this.collapsed_)),this.toggleButton_.title=n,this.toggleButton_.appendChild(s),this.toggleButton_.addEventListener(M.CLICK,this.handleClick_.bind(this),!1);let c=t+` `+lo+` `+uo+(this.collapsed_&&this.collapsible_?` `+fo:``)+(this.collapsible_?``:` ol-uncollapsible`),l=this.element;l.className=c,l.appendChild(this.toggleButton_),l.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){let t=this.getMap().getAllLayers(),n=new Set(t.flatMap(t=>t.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(e=>n.add(e)):n.add(this.attributions_)),!this.overrideCollapsible_){let e=!t.some(e=>e.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(e)}return Array.from(n)}async updateElement_(e){if(!e){this.renderedVisible_&&=(this.element.style.display=`none`,!1);return}let t=await Promise.all(this.collectSourceAttributions_(e).map(e=>Ze(()=>e))),n=t.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?``:`none`,this.renderedVisible_=n),!Ge(t,this.renderedAttributions_)){So(this.ulElement_);for(let e=0,n=t.length;e<n;++e){let n=document.createElement(`li`);n.innerHTML=t[e],this.ulElement_.appendChild(n)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(fo),this.collapsed_?xo(this.collapseLabel_,this.label_):xo(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute(`aria-expanded`,String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle(`ol-uncollapsible`),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}},Oo=class extends Eo{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target});let t=e.className===void 0?`ol-rotate`:e.className,n=e.label===void 0?`⇧`:e.label,r=e.compassClassName===void 0?`ol-compass`:e.compassClassName;this.label_=null,typeof n==`string`?(this.label_=document.createElement(`span`),this.label_.className=r,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(r));let i=e.tipLabel?e.tipLabel:`Reset rotation`,a=document.createElement(`button`);a.className=t+`-reset`,a.setAttribute(`type`,`button`),a.title=i,a.appendChild(this.label_),a.addEventListener(M.CLICK,this.handleClick_.bind(this),!1);let o=t+` `+lo+` `+uo,s=this.element;s.className=o,s.appendChild(a),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration===void 0?250:e.duration,this.autoHide_=e.autoHide===void 0?!0:e.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(co)}handleClick_(e){e.preventDefault(),this.callResetNorth_===void 0?this.resetNorth_():this.callResetNorth_()}resetNorth_(){let e=this.getMap().getView();if(!e)return;let t=e.getRotation();t!==void 0&&(this.duration_>0&&t%(2*Math.PI)!=0?e.animate({rotation:0,duration:this.duration_,easing:Un}):e.setRotation(0))}render(e){let t=e.frameState;if(!t)return;let n=t.viewState.rotation;if(n!=this.rotation_){let e=`rotate(`+n+`rad)`;if(this.autoHide_){let e=this.element.classList.contains(co);!e&&n===0?this.element.classList.add(co):e&&n!==0&&this.element.classList.remove(co)}this.label_.style.transform=e}this.rotation_=n}},ko=class extends Eo{constructor(e){e||={},super({element:document.createElement(`div`),target:e.target});let t=e.className===void 0?`ol-zoom`:e.className,n=e.delta===void 0?1:e.delta,r=e.zoomInClassName===void 0?t+`-in`:e.zoomInClassName,i=e.zoomOutClassName===void 0?t+`-out`:e.zoomOutClassName,a=e.zoomInLabel===void 0?`+`:e.zoomInLabel,o=e.zoomOutLabel===void 0?`–`:e.zoomOutLabel,s=e.zoomInTipLabel===void 0?`Zoom in`:e.zoomInTipLabel,c=e.zoomOutTipLabel===void 0?`Zoom out`:e.zoomOutTipLabel,l=document.createElement(`button`);l.className=r,l.setAttribute(`type`,`button`),l.title=s,l.appendChild(typeof a==`string`?document.createTextNode(a):a),l.addEventListener(M.CLICK,this.handleClick_.bind(this,n),!1);let u=document.createElement(`button`);u.className=i,u.setAttribute(`type`,`button`),u.title=c,u.appendChild(typeof o==`string`?document.createTextNode(o):o),u.addEventListener(M.CLICK,this.handleClick_.bind(this,-n),!1);let d=t+` `+lo+` `+uo,f=this.element;f.className=d,f.appendChild(l),f.appendChild(u),this.duration_=e.duration===void 0?250:e.duration}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){let t=this.getMap().getView();if(!t)return;let n=t.getZoom();if(n!==void 0){let r=t.getConstrainedZoom(n+e);this.duration_>0?(t.getAnimating()&&t.cancelAnimations(),t.animate({zoom:r,duration:this.duration_,easing:Un})):t.setZoom(r)}}};function Ao(e){e||={};let t=new dt;return(e.zoom===void 0||e.zoom)&&t.push(new ko(e.zoomOptions)),(e.rotate===void 0||e.rotate)&&t.push(new Oo(e.rotateOptions)),(e.attribution===void 0||e.attribution)&&t.push(new Do(e.attributionOptions)),t}var jo=class{constructor(e,t,n){this.decay_=e,this.minVelocity_=t,this.delay_=n,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;let e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let n=t-3;for(;n>0&&this.points_[n+2]>e;)n-=3;let r=this.points_[t+2]-this.points_[n+2];if(r<1e3/60)return!1;let i=this.points_[t]-this.points_[n],a=this.points_[t+1]-this.points_[n+1];return this.angle_=Math.atan2(a,i),this.initialVelocity_=Math.sqrt(i*i+a*a)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},Mo={ACTIVE:`active`},No=class extends ct{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(Mo.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Mo.ACTIVE,e)}setMap(e){this.map_=e}};function Po(e,t,n){let r=e.getCenterInternal();if(r){let i=[r[0]+t[0],r[1]+t[1]];e.animateInternal({duration:n===void 0?250:n,easing:Gn,center:e.getConstrainedCenter(i)})}}function Fo(e,t,n,r){let i=e.getZoom();if(i===void 0)return;let a=e.getConstrainedZoom(i+t),o=e.getResolutionForZoom(a);e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:o,anchor:n,duration:r===void 0?250:r,easing:Un})}var Io=class extends No{constructor(e){super(),e||={},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?250:e.duration}handleEvent(e){let t=!1;if(e.type==I.DBLCLICK){let n=e.originalEvent,r=e.map,i=e.coordinate,a=n.shiftKey?-this.delta_:this.delta_;Fo(r.getView(),a,i,this.duration_),n.preventDefault(),t=!0}return!t}};function Lo(e){let t=arguments;return function(e){let n=!0;for(let r=0,i=t.length;r<i&&(n&&=t[r](e),n);++r);return n}}var Ro=function(e){let t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},zo=function(e){let t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Bo=function(e){let t=e.map.getTargetElement(),n=t.getRootNode(),r=e.map.getOwnerDocument().activeElement;return n instanceof ShadowRoot?n.host.contains(r):t.contains(r)},Vo=function(e){let t=e.map.getTargetElement(),n=t.getRootNode();return(n instanceof ShadowRoot?n.host:t).hasAttribute(`tabindex`)?Bo(e):!0},Ho=qe,Uo=function(e){let t=e.originalEvent;return`pointerId`in t&&t.button==0&&!(ht&&gt&&t.ctrlKey)},Wo=Je,Go=function(e){return e.type==I.SINGLECLICK},Ko=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},qo=function(e){let t=e.originalEvent;return gt?t.metaKey:t.ctrlKey},Jo=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Yo=function(e){let t=e.originalEvent,n=t.target.tagName;return n!==`INPUT`&&n!==`SELECT`&&n!==`TEXTAREA`&&!t.target.isContentEditable},Xo=function(e){let t=e.originalEvent;return`pointerId`in t&&t.pointerType==`mouse`},Zo=function(e){let t=e.originalEvent;return`pointerId`in t&&t.isPrimary&&t.button===0},Qo=class extends No{constructor(e){e||={},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence)e.type==I.POINTERDRAG?(this.handleDragEvent(e),e.originalEvent.preventDefault()):e.type==I.POINTERUP&&(this.handlingDownUpSequence=this.handleUpEvent(e)&&this.targetPointers.length>0);else if(e.type==I.POINTERDOWN){let n=this.handleDownEvent(e);this.handlingDownUpSequence=n,t=this.stopDown(n)}else e.type==I.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 $o(e){let t=e.length,n=0,r=0;for(let i=0;i<t;i++)n+=e[i].clientX,r+=e[i].clientY;return{clientX:n/t,clientY:r/t}}var es=class extends Qo{constructor(e){super({stopDown:Je}),e||={},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;let t=e.condition?e.condition:Lo(Ko,Zo);this.condition_=e.onFocusOnly?Lo(Vo,t):t,this.noKinetic_=!1}handleDragEvent(e){let t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());let n=this.targetPointers,r=t.getEventPixel($o(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){let t=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],n=e.map.getView();In(t,n.getResolution()),Fn(t,n.getRotation()),n.adjustCenterInternal(t)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=n.length,e.originalEvent.preventDefault()}handleUpEvent(e){let t=e.map,n=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){let e=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),i=n.getCenterInternal(),a=t.getPixelFromCoordinateInternal(i),o=t.getCoordinateFromPixelInternal([a[0]-e*Math.cos(r),a[1]-e*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(o),duration:500,easing:Un})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){let t=e.map.getView();return this.lastCentroid=null,t.getAnimating()&&t.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},ts=class extends Qo{constructor(e){e||={},super({stopDown:Je}),this.condition_=e.condition?e.condition:zo,this.lastAngle_=void 0,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){if(!Xo(e))return;let t=e.map,n=t.getView();if(n.getConstraints().rotation===Xa)return;let r=t.getSize(),i=e.pixel,a=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(this.lastAngle_!==void 0){let e=a-this.lastAngle_;n.adjustRotationInternal(-e)}this.lastAngle_=a}handleUpEvent(e){return Xo(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return Xo(e)&&Uo(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}},ns=class extends Re{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_(){let e=this.startPixel_,t=this.endPixel_,n=this.element_.style;n.left=Math.min(e[0],t[0])+`px`,n.top=Math.min(e[1],t[1])+`px`,n.width=Math.abs(t[0]-e[0])+`px`,n.height=Math.abs(t[1]-e[1])+`px`}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let e=this.element_.style;e.left=`inherit`,e.top=`inherit`,e.width=`inherit`,e.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;let e=this.startPixel_,t=this.endPixel_,n=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new Va([n])}getGeometry(){return this.geometry_}},rs={BOXSTART:`boxstart`,BOXDRAG:`boxdrag`,BOXEND:`boxend`,BOXCANCEL:`boxcancel`},is=class extends et{constructor(e,t,n){super(e),this.coordinate=t,this.mapBrowserEvent=n}},as=class extends Qo{constructor(e){super(),this.on,this.once,this.un,e??={},this.box_=new ns(e.className||`ol-dragbox`),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??Uo,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,n){let r=n[0]-t[0],i=n[1]-t[1];return r*r+i*i>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new is(rs.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;let t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new is(t?rs.BOXEND:rs.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 is(rs.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&=(this.dispatchEvent(new is(rs.BOXCANCEL,this.startPixel_,null)),null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&=(this.dispatchEvent(new is(rs.BOXCANCEL,this.startPixel_,null)),null)),super.setMap(e)}},os=class extends as{constructor(e){e||={};let t=e.condition?e.condition:Jo;super({condition:t,className:e.className||`ol-dragzoom`,minArea:e.minArea}),this.duration_=e.duration===void 0?200:e.duration,this.out_=e.out===void 0?!1:e.out}onBoxEnd(e){let t=this.getMap().getView(),n=this.getGeometry();if(this.out_){let e=t.rotatedExtentForGeometry(n),r=t.getResolutionForExtentInternal(e),i=t.getResolution()/r;n=n.clone(),n.scale(i*i)}t.fitInternal(n,{duration:this.duration_,easing:Un})}},ss={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,DOWN:`ArrowDown`},cs=class extends No{constructor(e){super(),e||={},this.defaultCondition_=function(e){return Ko(e)&&Yo(e)},this.condition_=e.condition===void 0?this.defaultCondition_:e.condition,this.duration_=e.duration===void 0?100:e.duration,this.pixelDelta_=e.pixelDelta===void 0?128:e.pixelDelta}handleEvent(e){let t=!1;if(e.type==M.KEYDOWN){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r==ss.DOWN||r==ss.LEFT||r==ss.RIGHT||r==ss.UP)){let i=e.map.getView(),a=i.getResolution()*this.pixelDelta_,o=0,s=0;r==ss.DOWN?s=-a:r==ss.LEFT?o=-a:r==ss.RIGHT?o=a:s=a;let c=[o,s];Fn(c,i.getRotation()),Po(i,c,this.duration_),n.preventDefault(),t=!0}}return!t}},ls=class extends No{constructor(e){super(),e||={},this.condition_=e.condition?e.condition:function(e){return!qo(e)&&Yo(e)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?100:e.duration}handleEvent(e){let t=!1;if(e.type==M.KEYDOWN||e.type==M.KEYPRESS){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r===`+`||r===`-`)){let i=e.map,a=r===`+`?this.delta_:-this.delta_;Fo(i.getView(),a,void 0,this.duration_),n.preventDefault(),t=!0}}return!t}},us=40,ds=300,fs=class extends No{constructor(e){e||={},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta===void 0?1:e.maxDelta,this.duration_=e.duration===void 0?250:e.duration,this.timeout_=e.timeout===void 0?80:e.timeout,this.useAnchor_=e.useAnchor===void 0?!0:e.useAnchor,this.constrainResolution_=e.constrainResolution===void 0?!1:e.constrainResolution;let t=e.condition?e.condition:Ho;this.condition_=e.onFocusOnly?Lo(Vo,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;let e=this.getMap();e&&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!==M.WHEEL)return!0;let t=e.map,n=e.originalEvent;n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let r=n.deltaY;switch(n.deltaMode){case WheelEvent.DOM_DELTA_LINE:r*=us;break;case WheelEvent.DOM_DELTA_PAGE:r*=ds;break;default:}if(r===0)return!1;this.lastDelta_=r;let i=Date.now();this.startTime_===void 0&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?`trackpad`:`wheel`);let a=t.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(-r/this.deltaPerZoom_,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=i,!1;this.totalDelta_+=r;let o=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,t),o),!1}handleWheelZoom_(e){let t=e.getView();t.getAnimating()&&t.cancelAnimations();let n=-Mt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Fo(t,n,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)}},ps=class extends Qo{constructor(e){e||={};let t=e;t.stopDown||=Je,super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold===void 0?.3:e.threshold,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){let t=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(this.lastAngle_!==void 0){let e=i-this.lastAngle_;this.rotationDelta_+=e,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=e}this.lastAngle_=i;let a=e.map,o=a.getView();o.getConstraints().rotation!==Xa&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel($o(this.targetPointers))),this.rotating_&&(a.render(),o.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){let 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}},ms=class extends Qo{constructor(e){e||={};let t=e;t.stopDown||=Je,super(t),this.anchor_=null,this.duration_=e.duration===void 0?400:e.duration,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,a=n.clientY-r.clientY,o=Math.sqrt(i*i+a*a);this.lastDistance_!==void 0&&(t=this.lastDistance_/o),this.lastDistance_=o;let s=e.map,c=s.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=s.getCoordinateFromPixelInternal(s.getEventPixel($o(this.targetPointers))),s.render(),c.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){let t=e.map.getView(),n=this.lastScaleDelta_>1?1:-1;return t.endInteraction(this.duration_,n),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}};function hs(e){e||={};let t=new dt,n=new jo(-.005,.05,100);return(e.altShiftDragRotate===void 0||e.altShiftDragRotate)&&t.push(new ts),(e.doubleClickZoom===void 0||e.doubleClickZoom)&&t.push(new Io({delta:e.zoomDelta,duration:e.zoomDuration})),(e.dragPan===void 0||e.dragPan)&&t.push(new es({onFocusOnly:e.onFocusOnly,kinetic:n})),(e.pinchRotate===void 0||e.pinchRotate)&&t.push(new ps),(e.pinchZoom===void 0||e.pinchZoom)&&t.push(new ms({duration:e.zoomDuration})),(e.keyboard===void 0||e.keyboard)&&(t.push(new cs),t.push(new ls({delta:e.zoomDelta,duration:e.zoomDuration}))),(e.mouseWheelZoom===void 0||e.mouseWheelZoom)&&t.push(new fs({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(e.shiftDragZoom===void 0||e.shiftDragZoom)&&t.push(new os({duration:e.zoomDuration})),t}var gs={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`},_s=class extends ct{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;let t=Object.assign({},e);typeof e.properties==`object`&&(delete t.properties,Object.assign(t,e.properties)),t[gs.OPACITY]=e.opacity===void 0?1:e.opacity,R(typeof t[gs.OPACITY]==`number`,`Layer opacity must be a number`),t[gs.VISIBLE]=e.visible===void 0?!0:e.visible,t[gs.Z_INDEX]=e.zIndex,t[gs.MAX_RESOLUTION]=e.maxResolution===void 0?1/0:e.maxResolution,t[gs.MIN_RESOLUTION]=e.minResolution===void 0?0:e.minResolution,t[gs.MIN_ZOOM]=e.minZoom===void 0?-1/0:e.minZoom,t[gs.MAX_ZOOM]=e.maxZoom===void 0?1/0:e.maxZoom,this.className_=t.className===void 0?`ol-layer`:t.className,delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){let t=this.state_||{layer:this,managed:e===void 0?!0:e},n=this.getZIndex();return t.opacity=Mt(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=n===void 0&&!t.managed?1/0:n,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 P()}getLayerStatesArray(e){return P()}getExtent(){return this.get(gs.EXTENT)}getMaxResolution(){return this.get(gs.MAX_RESOLUTION)}getMinResolution(){return this.get(gs.MIN_RESOLUTION)}getMinZoom(){return this.get(gs.MIN_ZOOM)}getMaxZoom(){return this.get(gs.MAX_ZOOM)}getOpacity(){return this.get(gs.OPACITY)}getSourceState(){return P()}getVisible(){return this.get(gs.VISIBLE)}getZIndex(){return this.get(gs.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(gs.EXTENT,e)}setMaxResolution(e){this.set(gs.MAX_RESOLUTION,e)}setMinResolution(e){this.set(gs.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(gs.MAX_ZOOM,e)}setMinZoom(e){this.set(gs.MIN_ZOOM,e)}setOpacity(e){R(typeof e==`number`,`Layer opacity must be a number`),this.set(gs.OPACITY,e)}setVisible(e){this.set(gs.VISIBLE,e)}setZIndex(e){this.set(gs.Z_INDEX,e)}disposeInternal(){this.state_&&=(this.state_.layer=null,null),super.disposeInternal()}},vs={ADDLAYER:`addlayer`,REMOVELAYER:`removelayer`},ys=class extends et{constructor(e,t){super(e),this.layer=t}},bs={LAYERS:`layers`},xs=class e extends _s{constructor(e){e||={};let t=Object.assign({},e);delete t.layers;let n=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(bs.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new dt(n.slice(),{unique:!0}):R(typeof n.getArray==`function`,"Expected `layers` to be an array or a `Collection`"):n=new dt(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(rt),this.layersListenerKeys_.length=0;let e=this.getLayers();this.layersListenerKeys_.push(N(e,Ie.ADD,this.handleLayersAdd_,this),N(e,Ie.REMOVE,this.handleLayersRemove_,this));for(let e in this.listenerKeys_)this.listenerKeys_[e].forEach(rt);Qe(this.listenerKeys_);let t=e.getArray();for(let e=0,n=t.length;e<n;e++){let n=t[e];this.registerLayerListeners_(n),this.dispatchEvent(new ys(vs.ADDLAYER,n))}this.changed()}registerLayerListeners_(t){let n=[N(t,Le.PROPERTYCHANGE,this.handleLayerChange_,this),N(t,M.CHANGE,this.handleLayerChange_,this)];t instanceof e&&n.push(N(t,vs.ADDLAYER,this.handleLayerGroupAdd_,this),N(t,vs.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[F(t)]=n}handleLayerGroupAdd_(e){this.dispatchEvent(new ys(vs.ADDLAYER,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new ys(vs.REMOVELAYER,e.layer))}handleLayersAdd_(e){let t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new ys(vs.ADDLAYER,t)),this.changed()}handleLayersRemove_(e){let t=e.element,n=F(t);this.listenerKeys_[n].forEach(rt),delete this.listenerKeys_[n],this.dispatchEvent(new ys(vs.REMOVELAYER,t)),this.changed()}getLayers(){return this.get(bs.LAYERS)}setLayers(e){let t=this.getLayers();if(t){let e=t.getArray();for(let t=0,n=e.length;t<n;++t)this.dispatchEvent(new ys(vs.REMOVELAYER,e[t]))}this.set(bs.LAYERS,e)}getLayersArray(e){return e=e===void 0?[]:e,this.getLayers().forEach(function(t){t.getLayersArray(e)}),e}getLayerStatesArray(e){let t=e===void 0?[]:e,n=t.length;this.getLayers().forEach(function(e){e.getLayerStatesArray(t)});let r=this.getLayerState(),i=r.zIndex;!e&&r.zIndex===void 0&&(i=0);for(let e=n,a=t.length;e<a;e++){let n=t[e];n.opacity*=r.opacity,n.visible=n.visible&&r.visible,n.maxResolution=Math.min(n.maxResolution,r.maxResolution),n.minResolution=Math.max(n.minResolution,r.minResolution),n.minZoom=Math.max(n.minZoom,r.minZoom),n.maxZoom=Math.min(n.maxZoom,r.maxZoom),r.extent!==void 0&&(n.extent===void 0?n.extent=r.extent:n.extent=Sn(n.extent,r.extent)),n.zIndex===void 0&&(n.zIndex=i)}return t}getSourceState(){return`ready`}},Ss={PRERENDER:`prerender`,POSTRENDER:`postrender`,PRECOMPOSE:`precompose`,POSTCOMPOSE:`postcompose`,RENDERCOMPLETE:`rendercomplete`},Cs=class extends _s{constructor(e){let t=Object.assign({},e);delete t.source,super(t),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(gs.SOURCE,this.handleSourcePropertyChange_);let n=e.source?e.source:null;this.setSource(n)}getLayersArray(e){return e||=[],e.push(this),e}getLayerStatesArray(e){return e||=[],e.push(this.getLayerState()),e}getSource(){return this.get(gs.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){let e=this.getSource();return e?e.getState():`undefined`}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!==`ready`)&&(this.sourceReady_=!0,this.dispatchEvent(`sourceready`))}handleSourcePropertyChange_(){this.sourceChangeKey_&&=(rt(this.sourceChangeKey_),null),this.sourceReady_=!1;let e=this.getSource();e&&(this.sourceChangeKey_=N(e,M.CHANGE,this.handleSourceChange_,this),e.getState()===`ready`&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent(`sourceready`)},0))),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,n=this.getMapInternal();!e&&n&&(e=n.getView()),t=e instanceof to?{viewState:e.getState(),extent:e.calculateExtent()}:e,!t.layerStatesArray&&n&&(t.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let r;if(t.layerStatesArray){if(r=t.layerStatesArray.find(e=>e.layer===this),!r)return!1}else r=this.getLayerState();let i=this.getExtent();return ws(r,t.viewState)&&(!i||Tn(i,t.extent))}getAttributions(e){if(!this.isVisible(e))return[];let t=this.getSource()?.getAttributions();if(!t)return[];let n=t(e instanceof to?e.getViewStateAndExtent():e);return Array.isArray(n)||(n=[n]),n}render(e,t){let n=this.getRenderer();return n.prepareFrame(e)?(this.rendered=!0,n.renderFrame(e,t)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,t){}renderDeferred(e){let t=this.getRenderer();t&&t.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(gs.MAP,e)}getMapInternal(){return this.get(gs.MAP)}setMap(e){this.mapPrecomposeKey_&&=(rt(this.mapPrecomposeKey_),null),e||this.changed(),this.mapRenderKey_&&=(rt(this.mapRenderKey_),null),e&&(this.mapPrecomposeKey_=N(e,Ss.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=N(this,M.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){let t=e.frameState.layerStatesArray,n=this.getLayerState(!1);R(!t.some(e=>e.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),t.push(n)}setSource(e){this.set(gs.SOURCE,e)}getRenderer(){return 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 ws(e,t){if(!e.visible)return!1;let n=t.resolution;if(n<e.minResolution||n>=e.maxResolution)return!1;let r=t.zoom;return r>e.minZoom&&r<=e.maxZoom}function Ts(e,t,n=0,r=e.length-1,i=Ds){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);Ts(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(Es(e,n,t),i(e[r],a)>0&&Es(e,n,r);o<s;){for(Es(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?Es(e,n,s):(s++,Es(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function Es(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Ds(e,t){return e<t?-1:e>t?1:0}var Os=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,n=[];if(!Bs(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let o=t.children[a],s=t.leaf?r(o):o;Bs(e,s)&&(t.leaf?n.push(o):zs(e,s)?this._all(o,n):i.push(o))}t=i.pop()}return n}collides(e){let t=this.data;if(!Bs(e,t))return!1;let n=[];for(;t;){for(let r=0;r<t.children.length;r++){let i=t.children[r],a=t.leaf?this.toBBox(i):i;if(Bs(e,a)){if(t.leaf||zs(e,a))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=Vs([]),this}remove(e,t){if(!e)return this;let n=this.data,r=this.toBBox(e),i=[],a=[],o,s,c;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],o=a.pop(),c=!0),n.leaf){let r=ks(e,n.children,t);if(r!==-1)return n.children.splice(r,1),i.push(n),this._condense(i),this}!c&&!n.leaf&&zs(n,r)?(i.push(n),a.push(o),o=0,s=n,n=n.children[0]):s?(o++,n=s.children[o],c=!1):n=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){let i=n-t+1,a=this._maxEntries,o;if(i<=a)return o=Vs(e.slice(t,n+1)),As(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/a**(r-1))),o=Vs([]),o.leaf=!1,o.height=r;let s=Math.ceil(i/a),c=s*Math.ceil(Math.sqrt(a));Hs(e,t,n,c,this.compareMinX);for(let i=t;i<=n;i+=c){let t=Math.min(i+c-1,n);Hs(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){let i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return As(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!(t.leaf||r.length-1===n);){let n=1/0,r=1/0,i;for(let a=0;a<t.children.length;a++){let o=t.children[a],s=Fs(o),c=Ls(e,o)-s;c<r?(r=c,n=s<n?s:n,i=o):c===r&&s<n&&(n=s,i=o)}t=i||t.children[0]}return t}_insert(e,t,n){let r=n?e:this.toBBox(e),i=[],a=this._chooseSubtree(r,this.data,t,i);for(a.children.push(e),Ms(a,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let a=this._chooseSplitIndex(n,i,r),o=Vs(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,As(n,this.toBBox),As(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(n,o)}_splitRoot(e,t){this.data=Vs([e,t]),this.data.height=e.height+1,this.data.leaf=!1,As(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,a=1/0;for(let o=t;o<=n-t;o++){let t=js(e,0,o,this.toBBox),s=js(e,o,n,this.toBBox),c=Rs(t,s),l=Fs(t)+Fs(s);c<i?(i=c,r=o,a=l<a?l:a):c===i&&l<a&&(a=l,r=o)}return r||n-t}_chooseSplitAxis(e,t,n){let r=e.leaf?this.compareMinX:Ns,i=e.leaf?this.compareMinY:Ps;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);let i=this.toBBox,a=js(e,0,t,i),o=js(e,n-t,n,i),s=Is(a)+Is(o);for(let r=t;r<n-t;r++){let t=e.children[r];Ms(a,e.leaf?i(t):t),s+=Is(a)}for(let r=n-t-1;r>=t;r--){let t=e.children[r];Ms(o,e.leaf?i(t):t),s+=Is(o)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)Ms(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():As(e[t],this.toBBox)}};function ks(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function As(e,t){js(e,0,e.children.length,t,e)}function js(e,t,n,r,i){i||=Vs(null),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let a=t;a<n;a++){let t=e.children[a];Ms(i,e.leaf?r(t):t)}return i}function Ms(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Ns(e,t){return e.minX-t.minX}function Ps(e,t){return e.minY-t.minY}function Fs(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Is(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Ls(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Rs(e,t){let n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function zs(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Bs(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Vs(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Hs(e,t,n,r,i){let a=[t,n];for(;a.length;){if(n=a.pop(),t=a.pop(),n-t<=r)continue;let o=t+Math.ceil((n-t)/r/2)*r;Ts(e,o,t,n,i),a.push(t,o,o,n)}}var Us=[NaN,NaN,NaN,0],Ws;function Gs(){return Ws||=_o(1,1,void 0,{willReadFrequently:!0,desynchronized:!0}),Ws}var Ks=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,qs=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Js=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Ys=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function Xs(e,t){return e.endsWith(`%`)?Number(e.substring(0,e.length-1))/t:Number(e)}function Zs(e){throw Error(`failed to parse "`+e+`" as color`)}function Qs(e){if(e.toLowerCase().startsWith(`rgb`)){let t=e.match(qs)||e.match(Ks)||e.match(Js);if(t){let e=t[4],n=100/255;return[Mt(Xs(t[1],n)+.5|0,0,255),Mt(Xs(t[2],n)+.5|0,0,255),Mt(Xs(t[3],n)+.5|0,0,255),e===void 0?1:Mt(Xs(e,100),0,1)]}Zs(e)}if(e.startsWith(`#`)){if(Ys.test(e)){let t=e.substring(1),n=t.length<=4?1:2,r=[0,0,0,255];for(let e=0,i=t.length;e<i;e+=n){let i=parseInt(t.substring(e,e+n),16);n===1&&(i+=i<<4),r[e/n]=i}return r[3]/=255,r}Zs(e)}let t=Gs();t.fillStyle=`#abcdef`;let n=t.fillStyle;t.fillStyle=e,t.fillStyle===n&&(t.fillStyle=`#fedcba`,n=t.fillStyle,t.fillStyle=e,t.fillStyle===n&&Zs(e));let r=t.fillStyle;if(r.startsWith(`#`)||r.startsWith(`rgba`))return Qs(r);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let i=Array.from(t.getImageData(0,0,1,1).data);return i[3]=Bt(i[3]/255,3),i}function $s(e){return typeof e==`string`?e:fc(e)}var ec=1024,tc={},nc=0;function rc(e){if(e.length===4)return e;let t=e.slice();return t[3]=1,t}function ic(e){return e>.0031308?e**(1/2.4)*269.025-14.025:e*3294.6}function ac(e){return e>.2068965?e**3:(e-4/29)*(108/841)}function oc(e){return e>10.314724?((e+14.025)/269.025)**2.4:e/3294.6}function sc(e){return e>.0088564?e**(1/3):e/(108/841)+4/29}function cc(e){let t=oc(e[0]),n=oc(e[1]),r=oc(e[2]),i=sc(t*.222488403+n*.716873169+r*.06060791),a=500*(sc(t*.452247074+n*.399439023+r*.148375274)-i),o=200*(i-sc(t*.016863605+n*.117638439+r*.865350722)),s=180/Math.PI*Math.atan2(o,a);return[116*i-16,Math.sqrt(a*a+o*o),s<0?s+360:s,e[3]]}function lc(e){let t=(e[0]+16)/116,n=e[1],r=e[2]*Math.PI/180,i=ac(t),a=ac(t+n/500*Math.cos(r)),o=ac(t-n/200*Math.sin(r)),s=ic(a*3.021973625-i*1.617392459-o*.404875592),c=ic(a*-.943766287+i*1.916279586+o*.027607165),l=ic(a*.069407491-i*.22898585+o*1.159737864);return[Mt(s+.5|0,0,255),Mt(c+.5|0,0,255),Mt(l+.5|0,0,255),e[3]]}function uc(e){if(e===`none`)return Us;if(tc.hasOwnProperty(e))return tc[e];if(nc>=ec){let e=0;for(let t in tc)e++&3||(delete tc[t],--nc)}let t=Qs(e);t.length!==4&&Zs(e);for(let n of t)isNaN(n)&&Zs(e);return tc[e]=t,++nc,t}function dc(e){return Array.isArray(e)?e:uc(e)}function fc(e){let t=e[0];t!=(t|0)&&(t=t+.5|0);let n=e[1];n!=(n|0)&&(n=n+.5|0);let r=e[2];r!=(r|0)&&(r=r+.5|0);let i=e[3]===void 0?1:Math.round(e[3]*1e3)/1e3;return`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`}function pc(e){return e[0]>0&&e[1]>0}function mc(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function hc(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}var gc=0,_c=1<<gc++,V=1<<gc++,vc=1<<gc++,yc=1<<gc++,bc=1<<gc++,xc=1<<gc++,Sc=2**gc-1,Cc={[_c]:`boolean`,[V]:`number`,[vc]:`string`,[yc]:`color`,[bc]:`number[]`,[xc]:`size`},wc=Object.keys(Cc).map(Number).sort(Be);function Tc(e){return e in Cc}function Ec(e){let t=[];for(let n of wc)Dc(e,n)&&t.push(Cc[n]);return t.length===0?`untyped`:t.length<3?t.join(` or `):t.slice(0,-1).join(`, `)+`, or `+t[t.length-1]}function Dc(e,t){return(e&t)===t}function Oc(e,t){return e===t}var kc=class{constructor(e,t){if(!Tc(e))throw Error(`literal expressions must have a specific type, got ${Ec(e)}`);this.type=e,this.value=t}},Ac=class{constructor(e,t,...n){this.type=e,this.operator=t,this.args=n}};function jc(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function Mc(e,t,n){switch(typeof e){case`boolean`:if(Oc(t,vc))return new kc(vc,e?`true`:`false`);if(!Dc(t,_c))throw Error(`got a boolean, but expected ${Ec(t)}`);return new kc(_c,e);case`number`:if(Oc(t,xc))return new kc(xc,hc(e));if(Oc(t,_c))return new kc(_c,!!e);if(Oc(t,vc))return new kc(vc,e.toString());if(!Dc(t,V))throw Error(`got a number, but expected ${Ec(t)}`);return new kc(V,e);case`string`:if(Oc(t,yc))return new kc(yc,uc(e));if(Oc(t,_c))return new kc(_c,!!e);if(!Dc(t,vc))throw Error(`got a string, but expected ${Ec(t)}`);return new kc(vc,e);default:}if(!Array.isArray(e))throw Error(`expression must be an array or a primitive value`);if(e.length===0)throw Error(`empty expression`);if(typeof e[0]==`string`)return Yc(e,t,n);for(let t of e)if(typeof t!=`number`)throw Error(`expected an array of numbers`);if(Oc(t,xc)){if(e.length!==2)throw Error(`expected an array of two values for a size, got ${e.length}`);return new kc(xc,e)}if(Oc(t,yc)){if(e.length===3)return new kc(yc,[...e,1]);if(e.length===4)return new kc(yc,e);throw Error(`expected an array of 3 or 4 values for a color, got ${e.length}`)}if(!Dc(t,bc))throw Error(`got an array of numbers, but expected ${Ec(t)}`);return new kc(bc,e)}var H={Get:`get`,Var:`var`,Concat:`concat`,GeometryType:`geometry-type`,LineMetric:`line-metric`,Any:`any`,All:`all`,Not:`!`,Resolution:`resolution`,Zoom:`zoom`,Time:`time`,Equal:`==`,NotEqual:`!=`,GreaterThan:`>`,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`},Nc={[H.Get]:W(U(1,1/0),Pc),[H.Var]:W(U(1,1),Fc),[H.Has]:W(U(1,1/0),Pc),[H.Id]:W(Ic,zc),[H.Concat]:W(U(2,1/0),Vc(vc)),[H.GeometryType]:W(Lc,zc),[H.LineMetric]:W(zc),[H.Resolution]:W(Rc,zc),[H.Zoom]:W(Rc,zc),[H.Time]:W(Rc,zc),[H.Any]:W(U(2,1/0),Vc(_c)),[H.All]:W(U(2,1/0),Vc(_c)),[H.Not]:W(U(1,1),Vc(_c)),[H.Equal]:W(U(2,2),Vc(Sc)),[H.NotEqual]:W(U(2,2),Vc(Sc)),[H.GreaterThan]:W(U(2,2),Vc(V)),[H.GreaterThanOrEqualTo]:W(U(2,2),Vc(V)),[H.LessThan]:W(U(2,2),Vc(V)),[H.LessThanOrEqualTo]:W(U(2,2),Vc(V)),[H.Multiply]:W(U(2,1/0),Bc),[H.Coalesce]:W(U(2,1/0),Bc),[H.Divide]:W(U(2,2),Vc(V)),[H.Add]:W(U(2,1/0),Vc(V)),[H.Subtract]:W(U(2,2),Vc(V)),[H.Clamp]:W(U(3,3),Vc(V)),[H.Mod]:W(U(2,2),Vc(V)),[H.Pow]:W(U(2,2),Vc(V)),[H.Abs]:W(U(1,1),Vc(V)),[H.Floor]:W(U(1,1),Vc(V)),[H.Ceil]:W(U(1,1),Vc(V)),[H.Round]:W(U(1,1),Vc(V)),[H.Sin]:W(U(1,1),Vc(V)),[H.Cos]:W(U(1,1),Vc(V)),[H.Atan]:W(U(1,2),Vc(V)),[H.Sqrt]:W(U(1,1),Vc(V)),[H.Match]:W(U(4,1/0),Uc,Wc),[H.Between]:W(U(3,3),Vc(V)),[H.Interpolate]:W(U(6,1/0),Uc,Gc),[H.Case]:W(U(3,1/0),Hc,Kc),[H.In]:W(U(2,2),qc),[H.Number]:W(U(1,1/0),Vc(Sc)),[H.String]:W(U(1,1/0),Vc(Sc)),[H.Array]:W(U(1,1/0),Vc(V)),[H.Color]:W(U(1,4),Vc(V)),[H.Band]:W(U(1,3),Vc(V)),[H.Palette]:W(U(2,2),Jc),[H.ToString]:W(U(1,1),Vc(_c|V|vc|yc))};function Pc(e,t,n){let r=e.length-1,i=Array(r);for(let t=0;t<r;++t){let r=e[t+1];switch(typeof r){case`number`:i[t]=new kc(V,r);break;case`string`:i[t]=new kc(vc,r);break;default:throw Error(`expected a string key or numeric array index for a get operation, got ${r}`)}t===0&&n.properties.add(String(r))}return i}function Fc(e,t,n){let r=e[1];if(typeof r!=`string`)throw Error(`expected a string argument for var operation`);return n.variables.add(r),[new kc(vc,r)]}function Ic(e,t,n){n.featureId=!0}function Lc(e,t,n){n.geometryType=!0}function Rc(e,t,n){n.mapState=!0}function zc(e,t,n){let r=e[0];if(e.length!==1)throw Error(`expected no arguments for ${r} operation`);return[]}function U(e,t){return function(n,r,i){let a=n[0],o=n.length-1;if(e===t){if(o!==e)throw Error(`expected ${e} argument${e===1?``:`s`} for ${a}, got ${o}`)}else if(o<e||o>t){let n=t===1/0?`${e} or more`:`${e} to ${t}`;throw Error(`expected ${n} arguments for ${a}, got ${o}`)}}}function Bc(e,t,n){let r=e.length-1,i=Array(r);for(let a=0;a<r;++a)i[a]=Mc(e[a+1],t,n);return i}function Vc(e){return function(t,n,r){let i=t.length-1,a=Array(i);for(let n=0;n<i;++n)a[n]=Mc(t[n+1],e,r);return a}}function Hc(e,t,n){let r=e[0],i=e.length-1;if(i%2==0)throw Error(`expected an odd number of arguments for ${r}, got ${i} instead`)}function Uc(e,t,n){let r=e[0],i=e.length-1;if(i%2==1)throw Error(`expected an even number of arguments for operation ${r}, got ${i} instead`)}function Wc(e,t,n){let r=e.length-1,i=vc|V|_c,a=Mc(e[1],i,n),o=Mc(e[e.length-1],t,n),s=Array(r-2);for(let t=0;t<r-2;t+=2){try{s[t]=Mc(e[t+2],a.type,n)}catch(e){throw Error(`failed to parse argument ${t+1} of match expression: ${e.message}`)}try{let r=Mc(e[t+3],o.type,n);s[t+1]=r}catch(e){throw Error(`failed to parse argument ${t+2} of match expression: ${e.message}`)}}return[a,...s,o]}function Gc(e,t,n){let r=e[1],i;switch(r[0]){case`linear`:i=1;break;case`exponential`:let e=r[1];if(typeof e!=`number`||e<=0)throw Error(`expected a number base for exponential interpolation, got ${JSON.stringify(e)} instead`);i=e;break;default:throw Error(`invalid interpolation type: ${JSON.stringify(r)}`)}let a=new kc(V,i),o;try{o=Mc(e[2],V,n)}catch(e){throw Error(`failed to parse argument 1 in interpolate expression: ${e.message}`)}let s=Array(e.length-3);for(let r=0;r<s.length;r+=2){try{s[r]=Mc(e[r+3],V,n)}catch(e){throw Error(`failed to parse argument ${r+2} for interpolate expression: ${e.message}`)}try{let i=Mc(e[r+4],t,n);s[r+1]=i}catch(e){throw Error(`failed to parse argument ${r+3} for interpolate expression: ${e.message}`)}}return[a,o,...s]}function Kc(e,t,n){let r=Mc(e[e.length-1],t,n),i=Array(e.length-1);for(let t=0;t<i.length-1;t+=2){try{i[t]=Mc(e[t+1],_c,n)}catch(e){throw Error(`failed to parse argument ${t} of case expression: ${e.message}`)}try{let a=Mc(e[t+2],r.type,n);i[t+1]=a}catch(e){throw Error(`failed to parse argument ${t+1} of case expression: ${e.message}`)}}return i[i.length-1]=r,i}function qc(e,t,n){let r=e[2];if(!Array.isArray(r))throw Error(`the second argument for the "in" operator must be an array`);let i;if(typeof r[0]==`string`){if(r[0]!==`literal`)throw Error(`for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions`);if(!Array.isArray(r[1]))throw Error(`failed to parse "in" expression: the literal operator must be followed by an array`);r=r[1],i=vc}else i=V;let a=Array(r.length);for(let e=0;e<a.length;e++)try{a[e]=Mc(r[e],i,n)}catch(t){throw Error(`failed to parse haystack item ${e} for "in" expression: ${t.message}`)}return[Mc(e[1],i,n),...a]}function Jc(e,t,n){let r;try{r=Mc(e[1],V,n)}catch(e){throw Error(`failed to parse first argument in palette expression: ${e.message}`)}let i=e[2];if(!Array.isArray(i))throw Error(`the second argument of palette must be an array`);let a=Array(i.length);for(let e=0;e<a.length;e++){let t;try{t=Mc(i[e],yc,n)}catch(t){throw Error(`failed to parse color at index ${e} in palette expression: ${t.message}`)}if(!(t instanceof kc))throw Error(`the palette color at index ${e} must be a literal value`);a[e]=t}return[r,...a]}function W(...e){return function(t,n,r){let i=t[0],a;for(let i=0;i<e.length;i++){let o=e[i](t,n,r);if(i==e.length-1){if(!o)throw Error(`expected last argument validator to return the parsed args`);a=o}}return new Ac(n,i,...a)}}function Yc(e,t,n){let r=e[0],i=Nc[r];if(!i)throw Error(`unknown operator: ${r}`);return i(e,t,n)}function Xc(e){if(!e)return``;let t=e.getType();switch(t){case`Point`:case`LineString`:case`Polygon`:return t;case`MultiPoint`:case`MultiLineString`:case`MultiPolygon`:return t.substring(5);case`Circle`:return`Polygon`;case`GeometryCollection`:return Xc(e.getGeometries()[0]);default:return``}}function Zc(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:``}}function Qc(e,t,n){return $c(Mc(e,t,n),n)}function $c(e,t){if(e instanceof kc){if(e.type===yc&&typeof e.value==`string`){let t=uc(e.value);return function(){return t}}return function(){return e.value}}let n=e.operator;switch(n){case H.Number:case H.String:case H.Coalesce:return el(e,t);case H.Get:case H.Var:case H.Has:return tl(e,t);case H.Id:return e=>e.featureId;case H.GeometryType:return e=>e.geometryType;case H.Concat:{let n=e.args.map(e=>$c(e,t));return e=>``.concat(...n.map(t=>t(e).toString()))}case H.Resolution:return e=>e.resolution;case H.Any:case H.All:case H.Between:case H.In:case H.Not:return rl(e,t);case H.Equal:case H.NotEqual:case H.LessThan:case H.LessThanOrEqualTo:case H.GreaterThan:case H.GreaterThanOrEqualTo:return nl(e,t);case H.Multiply:case H.Divide:case H.Add:case H.Subtract:case H.Clamp:case H.Mod:case H.Pow:case H.Abs:case H.Floor:case H.Ceil:case H.Round:case H.Sin:case H.Cos:case H.Atan:case H.Sqrt:return il(e,t);case H.Case:return al(e,t);case H.Match:return ol(e,t);case H.Interpolate:return sl(e,t);case H.ToString:return cl(e,t);default:throw Error(`Unsupported operator ${n}`)}}function el(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=$c(e.args[n],t);switch(n){case H.Coalesce:return e=>{for(let t=0;t<r;++t){let n=i[t](e);if(n!=null)return n}throw Error(`Expected one of the values to be non-null`)};case H.Number:case H.String:return e=>{for(let t=0;t<r;++t){let r=i[t](e);if(typeof r===n)return r}throw Error(`Expected one of the values to be a ${n}`)};default:throw Error(`Unsupported assertion operator ${n}`)}}function tl(e,t){let n=e.args[0].value;switch(e.operator){case H.Get:return t=>{let r=e.args,i=t.properties[n];for(let e=1,t=r.length;e<t;++e){let t=r[e].value;i=i[t]}return i};case H.Var:return e=>e.variables[n];case H.Has:return t=>{let r=e.args;if(!(n in t.properties))return!1;let i=t.properties[n];for(let e=1,t=r.length;e<t;++e){let t=r[e].value;if(!i||!Object.hasOwn(i,t))return!1;i=i[t]}return!0};default:throw Error(`Unsupported accessor operator ${e.operator}`)}}function nl(e,t){let n=e.operator,r=$c(e.args[0],t),i=$c(e.args[1],t);switch(n){case H.Equal:return e=>r(e)===i(e);case H.NotEqual:return e=>r(e)!==i(e);case H.LessThan:return e=>r(e)<i(e);case H.LessThanOrEqualTo:return e=>r(e)<=i(e);case H.GreaterThan:return e=>r(e)>i(e);case H.GreaterThanOrEqualTo:return e=>r(e)>=i(e);default:throw Error(`Unsupported comparison operator ${n}`)}}function rl(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=$c(e.args[n],t);switch(n){case H.Any:return e=>{for(let t=0;t<r;++t)if(i[t](e))return!0;return!1};case H.All:return e=>{for(let t=0;t<r;++t)if(!i[t](e))return!1;return!0};case H.Between:return e=>{let t=i[0](e),n=i[1](e),r=i[2](e);return t>=n&&t<=r};case H.In:return e=>{let t=i[0](e);for(let n=1;n<r;++n)if(t===i[n](e))return!0;return!1};case H.Not:return e=>!i[0](e);default:throw Error(`Unsupported logical operator ${n}`)}}function il(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=$c(e.args[n],t);switch(n){case H.Multiply:return e=>{let t=1;for(let n=0;n<r;++n)t*=i[n](e);return t};case H.Divide:return e=>i[0](e)/i[1](e);case H.Add:return e=>{let t=0;for(let n=0;n<r;++n)t+=i[n](e);return t};case H.Subtract:return e=>i[0](e)-i[1](e);case H.Clamp:return e=>{let t=i[0](e),n=i[1](e);if(t<n)return n;let r=i[2](e);return t>r?r:t};case H.Mod:return e=>i[0](e)%i[1](e);case H.Pow:return e=>i[0](e)**+i[1](e);case H.Abs:return e=>Math.abs(i[0](e));case H.Floor:return e=>Math.floor(i[0](e));case H.Ceil:return e=>Math.ceil(i[0](e));case H.Round:return e=>Math.round(i[0](e));case H.Sin:return e=>Math.sin(i[0](e));case H.Cos:return e=>Math.cos(i[0](e));case H.Atan:return r===2?e=>Math.atan2(i[0](e),i[1](e)):e=>Math.atan(i[0](e));case H.Sqrt:return e=>Math.sqrt(i[0](e));default:throw Error(`Unsupported numeric operator ${n}`)}}function al(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=$c(e.args[i],t);return e=>{for(let t=0;t<n-1;t+=2)if(r[t](e))return r[t+1](e);return r[n-1](e)}}function ol(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=$c(e.args[i],t);return e=>{let t=r[0](e);for(let i=1;i<n-1;i+=2)if(t===r[i](e))return r[i+1](e);return r[n-1](e)}}function sl(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=$c(e.args[i],t);return e=>{let t=r[0](e),i=r[1](e),a,o;for(let s=2;s<n;s+=2){let n=r[s](e),c=r[s+1](e),l=Array.isArray(c);if(l&&(c=rc(c)),n>=i)return s===2?c:l?ul(t,i,a,o,n,c):ll(t,i,a,o,n,c);a=n,o=c}return o}}function cl(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=$c(e.args[n],t);switch(n){case H.ToString:return t=>{let n=i[0](t);return e.args[0].type===yc?fc(n):n.toString()};default:throw Error(`Unsupported convert operator ${n}`)}}function ll(e,t,n,r,i,a){let o=i-n;if(o===0)return r;let s=t-n;return r+(e===1?s/o:(e**+s-1)/(e**+o-1))*(a-r)}function ul(e,t,n,r,i,a){if(i-n===0)return r;let o=cc(r),s=cc(a),c=s[2]-o[2];return c>180?c-=360:c<-180&&(c+=360),lc([ll(e,t,n,o[0],i,s[0]),ll(e,t,n,o[1],i,s[1]),o[2]+ll(e,t,n,0,i,c),ll(e,t,n,r[3],i,a[3])])}var G={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},dl=class extends tt{constructor(e,t,n,r){super(),this.extent=e,this.pixelRatio_=n,this.resolution=t,this.state=typeof r==`function`?G.IDLE:r,this.image_=null,this.loader=typeof r==`function`?r:null}changed(){this.dispatchEvent(M.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==G.IDLE&&this.loader){this.state=G.LOADING,this.changed();let e=this.getResolution(),t=Array.isArray(e)?e[0]:e;Ze(()=>this.loader(this.getExtent(),t,this.getPixelRatio())).then(e=>{`image`in e&&(this.image_=e.image),`extent`in e&&(this.extent=e.extent),`resolution`in e&&(this.resolution=e.resolution),`pixelRatio`in e&&(this.pixelRatio_=e.pixelRatio),(e instanceof HTMLImageElement||bt&&e instanceof ImageBitmap||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement)&&(this.image_=e),this.state=G.LOADED}).catch(e=>{this.state=G.ERROR,console.error(e)}).finally(()=>this.changed())}}setImage(e){this.image_=e}setResolution(e){this.resolution=e}};function fl(e,t,n){let r=e,i=!0,a=!1,o=!1,s=[nt(r,M.LOAD,function(){o=!0,a||t()})];return r.src&&yt?(a=!0,r.decode().then(function(){i&&t()}).catch(function(e){i&&(o?t():n())})):s.push(nt(r,M.ERROR,n)),function(){i=!1,s.forEach(rt)}}function pl(e,t){return new Promise((n,r)=>{function i(){o(),n(e)}function a(){o(),r(Error(`Image load error`))}function o(){e.removeEventListener(`load`,i),e.removeEventListener(`error`,a)}e.addEventListener(`load`,i),e.addEventListener(`error`,a),t&&(e.src=t)})}function ml(e,t){return t&&(e.src=t),e.src&&yt?new Promise((t,n)=>e.decode().then(()=>t(e)).catch(r=>e.complete&&e.width?t(e):n(r))):pl(e)}var hl=class{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(let t in this.cache_){let n=this.cache_[t];!(e++&3)&&!n.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t,n){let r=gl(e,t,n);return r in this.cache_?this.cache_[r]:null}getPattern(e,t,n){let r=gl(e,t,n);return r in this.patternCache_?this.patternCache_[r]:null}set(e,t,n,r,i){let a=gl(e,t,n),o=a in this.cache_;this.cache_[a]=r,i&&(r.getImageState()===G.IDLE&&r.load(),r.getImageState()===G.LOADING?r.ready().then(()=>{this.patternCache_[a]=yo().createPattern(r.getImage(1),`repeat`)}):this.patternCache_[a]=yo().createPattern(r.getImage(1),`repeat`)),o||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}};function gl(e,t,n){let r=n?dc(n):`null`;return t+`:`+e+`:`+r}var _l=new hl,vl=null,yl=class extends tt{constructor(e,t,n,r,i){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=n,this.canvas_={},this.color_=i,this.imageState_=r===void 0?G.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_===G.LOADED){vl||=_o(1,1,void 0,{willReadFrequently:!0}),vl.drawImage(this.image_,0,0);try{vl.getImageData(0,0,1,1),this.tainted_=!1}catch{vl=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(M.CHANGE)}handleImageError_(){this.imageState_=G.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=G.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_()){let e=this.size_[0],t=this.size_[1],n=_o(e,t);n.fillRect(0,0,e,t),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===G.IDLE){this.image_||this.initializeImage_(),this.imageState_=G.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&ml(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_!==G.LOADED)return;let t=this.image_,n=_o(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=n.canvas;n.scale(e,e),n.drawImage(t,0,0),n.globalCompositeOperation=`multiply`,n.fillStyle=$s(this.color_),n.fillRect(0,0,r.width/e,r.height/e),n.globalCompositeOperation=`destination-in`,n.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||=new Promise(e=>{if(this.imageState_===G.LOADED||this.imageState_===G.ERROR)e();else{let t=()=>{(this.imageState_===G.LOADED||this.imageState_===G.ERROR)&&(this.removeEventListener(M.CHANGE,t),e())};this.addEventListener(M.CHANGE,t)}}),this.ready_}};function bl(e,t,n,r,i,a){let o=t===void 0?void 0:_l.get(t,n,i);return o||(o=new yl(e,e&&`src`in e?e.src||void 0:t,n,r,i),_l.set(t,n,i,o,a)),a&&o&&!_l.getPattern(t,n,i)&&_l.set(t,n,i,o,a),o}function xl(e){return e?Array.isArray(e)?fc(e):typeof e==`object`&&`src`in e?Sl(e):e:null}function Sl(e){if(!e.offset||!e.size)return _l.getPattern(e.src,`anonymous`,e.color);let t=e.src+`:`+e.offset,n=_l.getPattern(t,void 0,e.color);if(n)return n;let r=_l.get(e.src,`anonymous`,null);if(r.getImageState()!==G.LOADED)return null;let i=_o(e.size[0],e.size[1]);return i.drawImage(r.getImage(1),e.offset[0],e.offset[1],e.size[0],e.size[1],0,0,e.size[0],e.size[1]),bl(i.canvas,t,void 0,G.LOADED,e.color,!0),_l.getPattern(t,void 0,e.color)}var Cl=`10px sans-serif`,wl=`#000`,Tl=`round`,El=[],Dl=`round`,Ol=`#000`,kl=`center`,Al=`middle`,jl=[0,0,0,0],Ml=new ct,Nl=null,Pl,Fl={},Il=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`emoji`,`math`,`fangsong`]);function Ll(e,t,n){return`${e} ${t} 16px "${n}"`}var Rl=(function(){let e,t;async function n(e){await t.ready;let n=await t.load(e);if(n.length===0)return!1;let r=go(e),i=r.families[0].toLowerCase(),a=r.weight;return n.some(e=>{let t=e.family.replace(/^['"]|['"]$/g,``).toLowerCase(),n=ho[e.weight]||e.weight;return t===i&&e.style===r.style&&n==a})}async function r(){await t.ready;let i=!0,a=Ml.getProperties(),o=Object.keys(a).filter(e=>a[e]<100);for(let e=o.length-1;e>=0;--e){let t=o[e],r=a[t];r<100&&(await n(t)?(Qe(Fl),Ml.set(t,100)):(r+=10,Ml.set(t,r,!0),r<100&&(i=!1)))}e=void 0,i||(e=setTimeout(r,100))}return async function(n){t||=vt?self.fonts:document.fonts;let i=go(n);if(!i)return;let a=i.families,o=!1;for(let e of a){if(Il.has(e))continue;let t=Ll(i.style,i.weight,e);Ml.get(t)===void 0&&(Ml.set(t,0,!0),o=!0)}o&&(clearTimeout(e),e=setTimeout(r,100))}})(),zl=(function(){let e;return function(t){let n=Fl[t];if(n==null){if(vt){let e=go(t),r=Bl(t,`Žg`);n=(isNaN(Number(e.lineHeight))?1.2:Number(e.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else e||(e=document.createElement(`div`),e.innerHTML=`M`,e.style.minHeight=`0`,e.style.maxHeight=`none`,e.style.height=`auto`,e.style.padding=`0`,e.style.border=`none`,e.style.position=`absolute`,e.style.display=`block`,e.style.left=`-99999px`),e.style.font=t,document.body.appendChild(e),n=e.offsetHeight,document.body.removeChild(e);Fl[t]=n}return n}})();function Bl(e,t){return Nl||=_o(1,1),e!=Pl&&(Nl.font=e,Pl=Nl.font),Nl.measureText(t)}function Vl(e,t){return Bl(e,t).width}function Hl(e,t,n){if(t in n)return n[t];let r=t.split(`
3
+ `).reduce((t,n)=>Math.max(t,Vl(e,n)),0);return n[t]=r,r}function Ul(e,t){let n=[],r=[],i=[],a=0,o=0,s=0,c=0;for(let l=0,u=t.length;l<=u;l+=2){let d=t[l];if(d===`
4
+ `||l===u){a=Math.max(a,o),i.push(o),o=0,s+=c,c=0;continue}let f=t[l+1]||e.font,p=Vl(f,d);n.push(p),o+=p;let m=zl(f);r.push(m),c=Math.max(c,m)}return{width:a,height:s,widths:n,heights:r,lineWidths:i}}function Wl(e,t,n,r,i,a,o,s,c,l,u){e.save(),n!==1&&(e.globalAlpha===void 0?e.globalAlpha=e=>e.globalAlpha*=n:e.globalAlpha*=n),t&&e.transform.apply(e,t),r.contextInstructions?(e.translate(c,l),e.scale(u[0],u[1]),Gl(r,e)):u[0]<0||u[1]<0?(e.translate(c,l),e.scale(u[0],u[1]),e.drawImage(r,i,a,o,s,0,0,o,s)):e.drawImage(r,i,a,o,s,c,l,o*u[0],s*u[1]),e.restore()}function Gl(e,t){let n=e.contextInstructions;for(let e=0,r=n.length;e<r;e+=2)Array.isArray(n[e+1])?t[n[e]].apply(t,n[e+1]):t[n[e]]=n[e+1]}var Kl=class e{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=hc(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return P()}getImage(e){return P()}getHitDetectionImage(){return P()}getPixelRatio(e){return 1}getImageState(){return P()}getImageSize(){return P()}getOrigin(){return P()}getSize(){return P()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=hc(e)}listenImageChange(e){P()}load(){P()}unlistenImageChange(e){P()}ready(){return Promise.resolve()}},ql=class e extends Kl{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView===void 0?!1:e.rotateWithView,rotation:e.rotation===void 0?0:e.rotation,scale:e.scale===void 0?1:e.scale,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill===void 0?null:e.fill,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle===void 0?0:e.angle,this.stroke_=e.stroke===void 0?null:e.stroke,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?G.LOADING:G.LOADED,this.imageState_===G.LOADING&&this.ready().then(()=>this.imageState_=G.LOADED),this.render()}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){let e=this.size_,t=this.getDisplacement(),n=this.getScaleArray();return[e[0]/2-t[0]/n[0],e[1]/2+t[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||=this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let t=this.fill_?.getKey(),n=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(`,`),r=_l.get(n,null,null)?.getImage(1);if(!r){let t=this.renderOptions_,i=Math.ceil(t.size*e),a=_o(i,i);this.draw_(t,a,e),r=a.canvas,_l.set(n,null,null,new yl(r,void 0,null,G.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,n){if(t===0||this.points_===1/0||e!==`bevel`&&e!==`miter`)return t;let r=this.radius,i=this.radius2_===void 0?r:this.radius2_;if(r<i){let e=r;r=i,i=e}let a=this.radius2_===void 0?this.points_:this.points_*2,o=2*Math.PI/a,s=i*Math.sin(o),c=Math.sqrt(i*i-s*s),l=r-c,u=Math.sqrt(s*s+l*l),d=u/s;if(e===`miter`&&d<=n)return d*t;let f=t/2/d,p=t/2*(l/u),m=Math.sqrt((r+f)*(r+f)+p*p)-r;if(this.radius2_===void 0||e===`bevel`)return m*2;let h=r*Math.sin(o),g=Math.sqrt(r*r-h*h),_=i-g,v=Math.sqrt(h*h+_*_)/h;if(v<=n){let e=v*t/2-i-r;return 2*Math.max(m,e)}return m*2}createRenderOptions(){let e=Tl,t=Dl,n=0,r=null,i=0,a,o=0;this.stroke_&&(a=xl(this.stroke_.getColor()??`#000`),o=this.stroke_.getWidth()??1,r=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset()??0,t=this.stroke_.getLineJoin()??`round`,e=this.stroke_.getLineCap()??`round`,n=this.stroke_.getMiterLimit()??10);let s=this.calculateLineJoinSize_(t,o,n),c=Math.max(this.radius,this.radius2_||0),l=Math.ceil(2*c+s);return{strokeStyle:a,strokeWidth:o,size:l,lineCap:e,lineDash:r,lineDashOffset:i,lineJoin:t,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();let e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,t,n){if(t.scale(n,n),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let e=this.fill_.getColor();e===null&&(e=wl),t.fillStyle=xl(e),t.fill()}e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){let t;if(this.fill_){let n=this.fill_.getColor(),r=0;typeof n==`string`&&(n=dc(n)),n===null?r=1:Array.isArray(n)&&(r=n.length===4?n[3]:1),r===0&&(t=_o(e.size,e.size),this.drawHitDetectionCanvas_(e,t))}return t?t.canvas:this.getImage(1)}createPath_(e){let t=this.points_,n=this.radius;if(t===1/0)e.arc(0,0,n,0,2*Math.PI);else{let r=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(t*=2);let i=this.angle_-Math.PI/2,a=2*Math.PI/t;for(let o=0;o<t;o++){let t=i+o*a,s=o%2==0?n:r;e.lineTo(s*Math.cos(t),s*Math.sin(t))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=wl,t.fill(),e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}},Jl=class e extends ql{constructor(e){e||={radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale===void 0?1:e.scale,rotation:e.rotation===void 0?0:e.rotation,rotateWithView:e.rotateWithView===void 0?!1:e.rotateWithView,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode})}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}setRadius(e){this.radius=e,this.render()}},Yl=class e{constructor(e){e||={},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(e){if(typeof e==`object`&&e&&`src`in e){let t=bl(null,e.src,`anonymous`,void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then(()=>{this.patternImage_=null}),t.getImageState()===G.IDLE&&t.load(),t.getImageState()===G.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){let e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?F(e):typeof e==`object`&&`src`in e?e.src+`:`+e.offset:dc(e).toString():``}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}};function Xl(e,t,n,r){return n!==void 0&&r!==void 0?[n/e,r/t]:n===void 0?r===void 0?1:r/t:n/e}var Zl=class e extends Kl{constructor(e){e||={};let t=e.opacity===void 0?1:e.opacity,n=e.rotation===void 0?0:e.rotation,r=e.scale===void 0?1:e.scale,i=e.rotateWithView===void 0?!1:e.rotateWithView;super({opacity:t,rotation:n,scale:r,displacement:e.displacement===void 0?[0,0]:e.displacement,rotateWithView:i,declutterMode:e.declutterMode}),this.anchor_=e.anchor===void 0?[.5,.5]:e.anchor,this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin===void 0?`top-left`:e.anchorOrigin,this.anchorXUnits_=e.anchorXUnits===void 0?`fraction`:e.anchorXUnits,this.anchorYUnits_=e.anchorYUnits===void 0?`fraction`:e.anchorYUnits,this.crossOrigin_=e.crossOrigin===void 0?null:e.crossOrigin;let a=e.img===void 0?null:e.img,o=e.src;R(!(o!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(o===void 0||o.length===0)&&a&&(o=a.src||F(a)),R(o!==void 0&&o.length>0,"A defined and non-empty `src` or `image` must be provided"),R(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let s;if(e.src===void 0?a!==void 0&&(s=`complete`in a?a.complete?a.src?G.LOADED:G.IDLE:G.LOADING:G.LOADED):s=G.IDLE,this.color_=e.color===void 0?null:dc(e.color),this.iconImage_=bl(a,o,this.crossOrigin_,s,this.color_),this.offset_=e.offset===void 0?[0,0]:e.offset,this.offsetOrigin_=e.offsetOrigin===void 0?`top-left`:e.offsetOrigin,this.origin_=null,this.size_=e.size===void 0?null:e.size,this.initialOptions_,e.width!==void 0||e.height!==void 0){let t,n;if(e.size)[t,n]=e.size;else{let r=this.getImage(1);if(r.width&&r.height)t=r.width,n=r.height;else if(r instanceof HTMLImageElement){this.initialOptions_=e;let t=()=>{if(this.unlistenImageChange(t),!this.initialOptions_)return;let n=this.iconImage_.getSize();this.setScale(Xl(n[0],n[1],e.width,e.height))};this.listenImageChange(t);return}}t!==void 0&&this.setScale(Xl(t,n,e.width,e.height))}}clone(){let t,n,r;return this.initialOptions_?(n=this.initialOptions_.width,r=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:n,height:r,size:this.size_===null?void 0:this.size_.slice(),src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;let t=this.getSize();if(this.anchorXUnits_==`fraction`||this.anchorYUnits_==`fraction`){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==`fraction`&&(e[0]*=t[0]),this.anchorYUnits_==`fraction`&&(e[1]*=t[1])}if(this.anchorOrigin_!=`top-left`){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_==`top-right`||this.anchorOrigin_==`bottom-right`)&&(e[0]=-e[0]+t[0]),(this.anchorOrigin_==`bottom-left`||this.anchorOrigin_==`bottom-right`)&&(e[1]=-e[1]+t[1])}this.normalizedAnchor_=e}let t=this.getDisplacement(),n=this.getScaleArray();return[e[0]-t[0]/n[0],e[1]+t[1]/n[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`){let t=this.getSize(),n=this.iconImage_.getSize();if(!t||!n)return null;e=e.slice(),(this.offsetOrigin_==`top-right`||this.offsetOrigin_==`bottom-right`)&&(e[0]=n[0]-t[0]-e[0]),(this.offsetOrigin_==`bottom-left`||this.offsetOrigin_==`bottom-right`)&&(e[1]=n[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(e){this.iconImage_=bl(null,e,this.crossOrigin_,G.IDLE,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){let e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==G.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){let e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==G.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(M.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(M.CHANGE,e)}ready(){return this.iconImage_.ready()}},Ql=class e{constructor(e){e||={},this.color_=e.color===void 0?null:e.color,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash===void 0?null:e.lineDash,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(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}},$l=class e{constructor(e){e||={},this.geometry_=null,this.geometryFunction_=iu,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill===void 0?null:e.fill,this.image_=e.image===void 0?null:e.image,this.renderer_=e.renderer===void 0?null:e.renderer,this.hitDetectionRenderer_=e.hitDetectionRenderer===void 0?null:e.hitDetectionRenderer,this.stroke_=e.stroke===void 0?null:e.stroke,this.text_=e.text===void 0?null:e.text,this.zIndex_=e.zIndex}clone(){let t=this.getGeometry();return t&&typeof t==`object`&&(t=t.clone()),new e({geometry:t??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_=iu,this.geometry_=e}setZIndex(e){this.zIndex_=e}};function eu(e){let t;if(typeof e==`function`)t=e;else{let n;Array.isArray(e)?n=e:(R(typeof e.getZIndex==`function`,"Expected an `Style` or an array of `Style`"),n=[e]),t=function(){return n}}return t}var tu=null;function nu(e,t){if(!tu){let e=new Yl({color:`rgba(255,255,255,0.4)`}),t=new Ql({color:`#3399CC`,width:1.25});tu=[new $l({image:new Jl({fill:e,stroke:t,radius:5}),fill:e,stroke:t})]}return tu}function ru(){let e={},t=[255,255,255,1],n=[0,153,255,1];return e.Polygon=[new $l({fill:new Yl({color:[255,255,255,.5]})})],e.MultiPolygon=e.Polygon,e.LineString=[new $l({stroke:new Ql({color:t,width:5})}),new $l({stroke:new Ql({color:n,width:3})})],e.MultiLineString=e.LineString,e.Circle=e.Polygon.concat(e.LineString),e.Point=[new $l({image:new Jl({radius:6,fill:new Yl({color:n}),stroke:new Ql({color:t,width:3/2})}),zIndex:1/0})],e.MultiPoint=e.Point,e.GeometryCollection=e.Polygon.concat(e.LineString,e.Point),e}function iu(e){return e.getGeometry()}var au=`#333`,ou=class e{constructor(e){e||={},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=hc(e.scale===void 0?1:e.scale),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?new Yl({color:au}):e.fill,this.maxAngle_=e.maxAngle===void 0?Math.PI/4:e.maxAngle,this.placement_=e.placement===void 0?`point`:e.placement,this.overflow_=!!e.overflow,this.stroke_=e.stroke===void 0?null:e.stroke,this.offsetX_=e.offsetX===void 0?0:e.offsetX,this.offsetY_=e.offsetY===void 0?0:e.offsetY,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(){let t=this.getScale();return new e({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(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof Yl?this.getFill().clone():this.getFill(),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_=hc(e===void 0?1:e)}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 su(e){return!0}function cu(e){let t=jc(),n=uu(e,t),r=Zc();return function(e,i){if(r.properties=e.getPropertiesInternal(),r.resolution=i,t.featureId){let t=e.getId();t===void 0?r.featureId=null:r.featureId=t}return t.geometryType&&(r.geometryType=Xc(e.getGeometry())),n(r)}}function lu(e){let t=jc(),n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=du(e[i],t);let i=Zc(),a=Array(n);return function(e,o){if(i.properties=e.getPropertiesInternal(),i.resolution=o,t.featureId){let t=e.getId();t===void 0?i.featureId=null:i.featureId=t}let s=0;for(let e=0;e<n;++e){let t=r[e](i);t&&(a[s]=t,s+=1)}return a.length=s,a}}function uu(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i){let n=e[i],a=`filter`in n?Qc(n.filter,_c,t):su,o;if(Array.isArray(n.style)){let e=n.style.length;o=Array(e);for(let r=0;r<e;++r)o[r]=du(n.style[r],t)}else o=[du(n.style,t)];r[i]={filter:a,styles:o}}return function(t){let i=[],a=!1;for(let o=0;o<n;++o){let n=r[o].filter;if(n(t)&&!(e[o].else&&a)){a=!0;for(let e of r[o].styles){let n=e(t);n&&i.push(n)}}}return i}}function du(e,t){let n=fu(e,``,t),r=pu(e,``,t),i=mu(e,t),a=hu(e,t),o=yu(e,`z-index`,t);if(!n&&!r&&!i&&!a&&!$e(e))throw Error(`No fill, stroke, point, or text symbolizer properties in style: `+JSON.stringify(e));let s=new $l;return function(e){let t=!0;if(n){let r=n(e);r&&(t=!1),s.setFill(r)}if(r){let n=r(e);n&&(t=!1),s.setStroke(n)}if(i){let n=i(e);n&&(t=!1),s.setText(n)}if(a){let n=a(e);n&&(t=!1),s.setImage(n)}return o&&s.setZIndex(o(e)),t?null:s}}function fu(e,t,n){let r;if(t+`fill-pattern-src`in e)r=xu(e,t+`fill-`,n);else{if(e[t+`fill-color`]===`none`)return e=>null;r=Cu(e,t+`fill-color`,n)}if(!r)return null;let i=new Yl;return function(e){let t=r(e);return t===Us?null:(i.setColor(t),i)}}function pu(e,t,n){let r=yu(e,t+`stroke-width`,n),i=Cu(e,t+`stroke-color`,n);if(!r&&!i)return null;let a=bu(e,t+`stroke-line-cap`,n),o=bu(e,t+`stroke-line-join`,n),s=wu(e,t+`stroke-line-dash`,n),c=yu(e,t+`stroke-line-dash-offset`,n),l=yu(e,t+`stroke-miter-limit`,n),u=new Ql;return function(e){if(i){let t=i(e);if(t===Us)return null;u.setColor(t)}if(r&&u.setWidth(r(e)),a){let t=a(e);if(t!==`butt`&&t!==`round`&&t!==`square`)throw Error(`Expected butt, round, or square line cap`);u.setLineCap(t)}if(o){let t=o(e);if(t!==`bevel`&&t!==`round`&&t!==`miter`)throw Error(`Expected bevel, round, or miter line join`);u.setLineJoin(t)}return s&&u.setLineDash(s(e)),c&&u.setLineDashOffset(c(e)),l&&u.setMiterLimit(l(e)),u}}function mu(e,t){let n=`text-`,r=bu(e,n+`value`,t);if(!r)return null;let i=fu(e,n,t),a=fu(e,n+`background-`,t),o=pu(e,n,t),s=pu(e,n+`background-`,t),c=bu(e,n+`font`,t),l=yu(e,n+`max-angle`,t),u=yu(e,n+`offset-x`,t),d=yu(e,n+`offset-y`,t),f=Su(e,n+`overflow`,t),p=bu(e,n+`placement`,t),m=yu(e,n+`repeat`,t),h=Du(e,n+`scale`,t),g=Su(e,n+`rotate-with-view`,t),_=yu(e,n+`rotation`,t),v=bu(e,n+`align`,t),y=bu(e,n+`justify`,t),b=bu(e,n+`baseline`,t),x=Su(e,n+`keep-upright`,t),S=wu(e,n+`padding`,t),C=new ou({declutterMode:Pu(e,n+`declutter-mode`)});return function(e){if(C.setText(r(e)),i&&C.setFill(i(e)),a&&C.setBackgroundFill(a(e)),o&&C.setStroke(o(e)),s&&C.setBackgroundStroke(s(e)),c&&C.setFont(c(e)),l&&C.setMaxAngle(l(e)),u&&C.setOffsetX(u(e)),d&&C.setOffsetY(d(e)),f&&C.setOverflow(f(e)),p){let t=p(e);if(t!==`point`&&t!==`line`)throw Error(`Expected point or line for text-placement`);C.setPlacement(t)}if(m&&C.setRepeat(m(e)),h&&C.setScale(h(e)),g&&C.setRotateWithView(g(e)),_&&C.setRotation(_(e)),v){let t=v(e);if(t!==`left`&&t!==`center`&&t!==`right`&&t!==`end`&&t!==`start`)throw Error(`Expected left, right, center, start, or end for text-align`);C.setTextAlign(t)}if(y){let t=y(e);if(t!==`left`&&t!==`right`&&t!==`center`)throw Error(`Expected left, right, or center for text-justify`);C.setJustify(t)}if(b){let t=b(e);if(t!==`bottom`&&t!==`top`&&t!==`middle`&&t!==`alphabetic`&&t!==`hanging`)throw Error(`Expected bottom, top, middle, alphabetic, or hanging for text-baseline`);C.setTextBaseline(t)}return S&&C.setPadding(S(e)),x&&C.setKeepUpright(x(e)),C}}function hu(e,t){return`icon-src`in e?gu(e,t):`shape-points`in e?_u(e,t):`circle-radius`in e?vu(e,t):null}function gu(e,t){let n=`icon-`,r=n+`src`,i=Lu(e[r],r),a=Tu(e,n+`anchor`,t),o=Du(e,n+`scale`,t),s=yu(e,n+`opacity`,t),c=Tu(e,n+`displacement`,t),l=yu(e,n+`rotation`,t),u=Su(e,n+`rotate-with-view`,t),d=ju(e,n+`anchor-origin`),f=Mu(e,n+`anchor-x-units`),p=Mu(e,n+`anchor-y-units`),m=Fu(e,n+`color`),h=Au(e,n+`cross-origin`),g=Nu(e,n+`offset`),_=ju(e,n+`offset-origin`),v=Ou(e,n+`width`),y=new Zl({src:i,anchorOrigin:d,anchorXUnits:f,anchorYUnits:p,color:m,crossOrigin:h,offset:g,offsetOrigin:_,height:Ou(e,n+`height`),width:v,size:ku(e,n+`size`),declutterMode:Pu(e,n+`declutter-mode`)});return function(e){return s&&y.setOpacity(s(e)),c&&y.setDisplacement(c(e)),l&&y.setRotation(l(e)),u&&y.setRotateWithView(u(e)),o&&y.setScale(o(e)),a&&y.setAnchor(a(e)),y}}function _u(e,t){let n=`shape-`,r=n+`points`,i=n+`radius`,a=Ru(e[r],r),o=Ru(e[i],i),s=fu(e,n,t),c=pu(e,n,t),l=Du(e,n+`scale`,t),u=Tu(e,n+`displacement`,t),d=yu(e,n+`rotation`,t),f=Su(e,n+`rotate-with-view`,t),p=new ql({points:a,radius:o,radius2:Ou(e,n+`radius2`),angle:Ou(e,n+`angle`),declutterMode:Pu(e,n+`declutter-mode`)});return function(e){return s&&p.setFill(s(e)),c&&p.setStroke(c(e)),u&&p.setDisplacement(u(e)),d&&p.setRotation(d(e)),f&&p.setRotateWithView(f(e)),l&&p.setScale(l(e)),p}}function vu(e,t){let n=`circle-`,r=fu(e,n,t),i=pu(e,n,t),a=yu(e,n+`radius`,t),o=Du(e,n+`scale`,t),s=Tu(e,n+`displacement`,t),c=yu(e,n+`rotation`,t),l=Su(e,n+`rotate-with-view`,t),u=new Jl({radius:5,declutterMode:Pu(e,n+`declutter-mode`)});return function(e){return a&&u.setRadius(a(e)),r&&u.setFill(r(e)),i&&u.setStroke(i(e)),s&&u.setDisplacement(s(e)),c&&u.setRotation(c(e)),l&&u.setRotateWithView(l(e)),o&&u.setScale(o(e)),u}}function yu(e,t,n){if(!(t in e))return;let r=Qc(e[t],V,n);return function(e){return Ru(r(e),t)}}function bu(e,t,n){if(!(t in e))return null;let r=Qc(e[t],vc,n);return function(e){return Lu(r(e),t)}}function xu(e,t,n){let r=bu(e,t+`pattern-src`,n),i=Eu(e,t+`pattern-offset`,n),a=Eu(e,t+`pattern-size`,n),o=Cu(e,t+`color`,n);return function(e){return{src:r(e),offset:i&&i(e),size:a&&a(e),color:o&&o(e)}}}function Su(e,t,n){if(!(t in e))return null;let r=Qc(e[t],_c,n);return function(e){let n=r(e);if(typeof n!=`boolean`)throw Error(`Expected a boolean for ${t}`);return n}}function Cu(e,t,n){if(!(t in e))return null;let r=Qc(e[t],yc,n);return function(e){return zu(r(e),t)}}function wu(e,t,n){if(!(t in e))return null;let r=Qc(e[t],bc,n);return function(e){return Iu(r(e),t)}}function Tu(e,t,n){if(!(t in e))return null;let r=Qc(e[t],bc,n);return function(e){let n=Iu(r(e),t);if(n.length!==2)throw Error(`Expected two numbers for ${t}`);return n}}function Eu(e,t,n){if(!(t in e))return null;let r=Qc(e[t],bc,n);return function(e){return Bu(r(e),t)}}function Du(e,t,n){if(!(t in e))return null;let r=Qc(e[t],bc|V,n);return function(e){return Vu(r(e),t)}}function Ou(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`number`)throw Error(`Expected a number for ${t}`);return n}}function ku(e,t){let n=e[t];if(n!==void 0){if(typeof n==`number`)return hc(n);if(!Array.isArray(n)||n.length!==2||typeof n[0]!=`number`||typeof n[1]!=`number`)throw Error(`Expected a number or size array for ${t}`);return n}}function Au(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`string`)throw Error(`Expected a string for ${t}`);return n}}function ju(e,t){let n=e[t];if(n!==void 0){if(n!==`bottom-left`&&n!==`bottom-right`&&n!==`top-left`&&n!==`top-right`)throw Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return n}}function Mu(e,t){let n=e[t];if(n!==void 0){if(n!==`pixels`&&n!==`fraction`)throw Error(`Expected pixels or fraction for ${t}`);return n}}function Nu(e,t){let n=e[t];if(n!==void 0)return Iu(n,t)}function Pu(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`string`)throw Error(`Expected a string for ${t}`);if(n!==`declutter`&&n!==`obstacle`&&n!==`none`)throw Error(`Expected declutter, obstacle, or none for ${t}`);return n}}function Fu(e,t){let n=e[t];if(n!==void 0)return zu(n,t)}function Iu(e,t){if(!Array.isArray(e))throw Error(`Expected an array for ${t}`);let n=e.length;for(let r=0;r<n;++r)if(typeof e[r]!=`number`)throw Error(`Expected an array of numbers for ${t}`);return e}function Lu(e,t){if(typeof e!=`string`)throw Error(`Expected a string for ${t}`);return e}function Ru(e,t){if(typeof e!=`number`)throw Error(`Expected a number for ${t}`);return e}function zu(e,t){if(typeof e==`string`)return e;let n=Iu(e,t),r=n.length;if(r<3||r>4)throw Error(`Expected a color with 3 or 4 values for ${t}`);return n}function Bu(e,t){let n=Iu(e,t);if(n.length!==2)throw Error(`Expected an array of two numbers for ${t}`);return n}function Vu(e,t){return typeof e==`number`?e:Bu(e,t)}var Hu={RENDER_ORDER:`renderOrder`},Uu=class extends Cs{constructor(e){e||={};let 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?100:e.renderBuffer,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating===void 0?!1:e.updateWhileAnimating,this.updateWhileInteracting_=e.updateWhileInteracting===void 0?!1:e.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Hu.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,t){let n=this.getDeclutter();n in e.declutter||(e.declutter[n]=new Os(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(Hu.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?nu:e;let t=Wu(e);this.styleFunction_=e===null?void 0:eu(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}};function Wu(e){if(e===void 0)return nu;if(!e)return null;if(typeof e==`function`||e instanceof $l)return e;if(!Array.isArray(e))return lu([e]);if(e.length===0)return[];let t=e.length,n=e[0];if(n instanceof $l){let n=Array(t);for(let r=0;r<t;++r){let t=e[r];if(!(t instanceof $l))throw Error(`Expected a list of style instances`);n[r]=t}return n}if(`style`in n){let n=Array(t);for(let r=0;r<t;++r){let t=e[r];if(!(`style`in t))throw Error(`Expected a list of rules with a style property`);n[r]=t}return cu(n)}return lu(e)}var Gu=class extends et{constructor(e,t,n,r){super(e),this.inversePixelTransform=t,this.frameState=n,this.context=r}},Ku=class extends Re{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){P()}calculateMatrices2D(e){let t=e.viewState,n=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;Ni(n,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),Pi(r,n)}forEachFeatureAtCoordinate(e,t,n,r,i,a,o,s){let c,l=t.viewState;function u(e,t,n,r){return i.call(a,t,e?n:null,r)}let d=l.projection,f=Bn(e.slice(),d),p=[[0,0]];if(d.canWrapX()&&r){let e=z(d.getExtent());p.push([-e,0],[e,0])}let m=t.layerStatesArray,h=m.length,g=[],_=[];for(let r=0;r<p.length;r++)for(let i=h-1;i>=0;--i){let a=m[i],d=a.layer;if(d.hasRenderer()&&ws(a,l)&&o.call(s,d)){let i=d.getRenderer(),o=d.getSource();if(i&&o){let s=o.getWrapX()?f:e,l=u.bind(null,a.managed);_[0]=s[0]+p[r][0],_[1]=s[1]+p[r][1],c=i.forEachFeatureAtCoordinate(_,t,n,l,g)}if(c)return c}}if(g.length===0)return;let v=1/g.length;return g.forEach((e,t)=>e.distanceSq+=t*v),g.sort((e,t)=>e.distanceSq-t.distanceSq),g.some(e=>c=e.callback(e.feature,e.layer,e.geometry)),c}hasFeatureAtCoordinate(e,t,n,r,i,a){return this.forEachFeatureAtCoordinate(e,t,n,r,qe,this,i,a)!==void 0}getMap(){return this.map_}renderFrame(e){P()}scheduleExpireIconCache(e){_l.canExpireCache()&&e.postRenderFunctions.push(qu)}};function qu(e,t){_l.expire()}var Ju=class extends Ku{constructor(e){super(e),this.fontChangeListenerKey_=N(Ml,Le.PROPERTYCHANGE,e.redrawText,e),this.element_=vt?wo():document.createElement(`div`);let t=this.element_.style;t.position=`absolute`,t.width=`100%`,t.height=`100%`,t.zIndex=`0`,this.element_.className=lo+` ol-layers`;let n=e.getViewport();n&&n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){let n=this.getMap();if(n.hasListener(e)){let r=new Gu(e,void 0,t);n.dispatchEvent(r)}}disposeInternal(){rt(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&=(this.element_.style.display=`none`,!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Ss.PRECOMPOSE,e);let t=e.layerStatesArray.sort((e,t)=>e.zIndex-t.zIndex);t.some(e=>e.layer instanceof Uu&&e.layer.getDeclutter())&&(e.declutter={});let n=e.viewState;this.children_.length=0;let r=[],i=null;for(let a=0,o=t.length;a<o;++a){let o=t[a];e.layerIndex=a;let s=o.layer,c=s.getSourceState();if(!ws(o,n)||c!=`ready`&&c!=`undefined`){s.unrender();continue}let l=s.render(e,i);l&&(l!==i&&(this.children_.push(l),i=l),r.push(o))}this.declutter(e,r),Co(this.element_,this.children_);let a=this.getMap().getTargetElement();if(To(a)){let e=a.getContext(`2d`);for(let t of this.children_){let n=t.firstElementChild||t,r=t.style.backgroundColor;if(r&&(!To(n)||n.width>0)&&(e.fillStyle=r,e.fillRect(0,0,a.width,a.height)),To(n)&&n.width>0){let r=t.style.opacity||n.style.opacity;e.globalAlpha=r===``?1:Number(r);let i=n.style.transform;if(i)e.setTransform(...Ri(i));else{let t=parseFloat(n.style.width)/n.width,r=parseFloat(n.style.height)/n.height;e.setTransform(t,0,0,r,0,0)}e.drawImage(n,0,0)}}e.globalAlpha=1,e.setTransform(1,0,0,1,0,0)}this.dispatchRenderEvent(Ss.POSTCOMPOSE,e),this.renderedVisible_||=(this.element_.style.display=``,!0),this.scheduleExpireIconCache(e)}declutter(e,t){if(e.declutter){for(let n=t.length-1;n>=0;--n){let r=t[n],i=r.layer;i.getDeclutter()&&i.renderDeclutter(e,r)}t.forEach(t=>t.layer.renderDeferred(e))}}};function Yu(e){if(e instanceof Cs){e.setMapInternal(null);return}e instanceof xs&&e.getLayers().forEach(Yu)}function Xu(e,t){if(e instanceof Cs){e.setMapInternal(t);return}if(e instanceof xs){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e)Xu(n[e],t)}}var Zu=class extends ct{constructor(e){super(),e||={},this.on,this.once,this.un;let t=Qu(e);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading===void 0?16:e.maxTilesLoading,this.pixelRatio_=e.pixelRatio===void 0?_t:e.pixelRatio,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Ti(),this.pixelToCoordinateTransform_=Ti(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,vt||(this.viewport_=document.createElement(`div`),this.viewport_.className=`ol-viewport`+(`ontouchstart`in window?` ol-touch`:``),this.viewport_.style.position=`relative`,this.viewport_.style.overflow=`hidden`,this.viewport_.style.width=`100%`,this.viewport_.style.height=`100%`,this.overlayContainer_=document.createElement(`div`),this.overlayContainer_.style.position=`absolute`,this.overlayContainer_.style.zIndex=`0`,this.overlayContainer_.style.width=`100%`,this.overlayContainer_.style.height=`100%`,this.overlayContainer_.style.pointerEvents=`none`,this.overlayContainer_.className=`ol-overlaycontainer`,this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement(`div`),this.overlayContainerStopEvent_.style.position=`absolute`,this.overlayContainerStopEvent_.style.zIndex=`0`,this.overlayContainerStopEvent_.style.width=`100%`,this.overlayContainerStopEvent_.style.height=`100%`,this.overlayContainerStopEvent_.style.pointerEvents=`none`,this.overlayContainerStopEvent_.className=`ol-overlaycontainer-stopevent`,this.viewport_.appendChild(this.overlayContainerStopEvent_)),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,vt||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=t.controls||(vt?new dt:Ao()),this.interactions=t.interactions||(vt?new dt:hs({onFocusOnly:!0})),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Ot(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Tt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Tt.VIEW,this.handleViewChanged_),this.addChangeListener(Tt.SIZE,this.handleSizeChanged_),this.addChangeListener(Tt.TARGET,this.handleTargetChanged_),this.setProperties(t.values);let n=this;e.view&&!(e.view instanceof to)&&e.view.then(function(e){n.setView(new to(e))}),this.controls.addEventListener(Ie.ADD,e=>{e.element.setMap(this)}),this.controls.addEventListener(Ie.REMOVE,e=>{e.element.setMap(null)}),this.interactions.addEventListener(Ie.ADD,e=>{e.element.setMap(this)}),this.interactions.addEventListener(Ie.REMOVE,e=>{e.element.setMap(null)}),this.overlays_.addEventListener(Ie.ADD,e=>{this.addOverlayInternal_(e.element)}),this.overlays_.addEventListener(Ie.REMOVE,e=>{let t=e.element.getId();t!==void 0&&delete this.overlayIdIndex_[t.toString()],e.element.setMap(null)}),this.controls.forEach(e=>{e.setMap(this)}),this.interactions.forEach(e=>{e.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){Xu(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){let 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,n){if(!this.frameState_||!this.renderer_)return;let r=this.getCoordinateFromPixelInternal(e);n=n===void 0?{}:n;let i=n.hitTolerance===void 0?0:n.hitTolerance,a=n.layerFilter===void 0?qe:n.layerFilter,o=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,o,t,null,a,null)}getFeaturesAtPixel(e,t){let n=[];return this.forEachFeatureAtPixel(e,function(e){n.push(e)},t),n}getAllLayers(){let e=[];function t(n){n.forEach(function(n){n instanceof xs?t(n.getLayers()):e.push(n)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;let n=this.getCoordinateFromPixelInternal(e);t=t===void 0?{}:t;let r=t.layerFilter===void 0?qe:t.layerFilter,i=t.hitTolerance===void 0?0:t.hitTolerance,a=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,a,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){let t=this.viewport_.getBoundingClientRect(),n=this.getSize(),r=t.width/n[0],i=t.height/n[1],a=`changedTouches`in e?e.changedTouches[0]:e;return[(a.clientX-t.left)/r,(a.clientY-t.top)/i]}getTarget(){return this.get(Tt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return vi(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){let t=this.frameState_;return t?Ai(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){let t=this.overlayIdIndex_[e.toString()];return t===void 0?null:t}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Tt.LAYERGROUP)}setLayers(e){let t=this.getLayerGroup();if(e instanceof dt){t.setLayers(e);return}let n=t.getLayers();n.clear(),n.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){let e=this.getLayerGroup().getLayerStatesArray();for(let t=0,n=e.length;t<n;++t){let n=e[t];if(!n.visible)continue;let r=n.layer.getRenderer();if(r&&!r.ready)return!0;let i=n.layer.getSource();if(i&&i.loading)return!0}return!1}getPixelFromCoordinate(e){let t=yi(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){let t=this.frameState_;return t?Ai(t.coordinateToPixelTransform,e.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(Tt.SIZE)}getView(){return this.get(Tt.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){let e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,n,r){return kt(this.frameState_,e,t,n,r)}handleBrowserEvent(e,t){t||=e.type;let n=new pt(t,this,e);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(e){if(!this.frameState_)return;let t=e.originalEvent,n=t.type;if(n===St.POINTERDOWN||n===M.WHEEL||n===M.KEYDOWN){let e=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():e,r=t.target,i=n instanceof ShadowRoot?n.host===r?n.host.ownerDocument:n:n===e?e.documentElement:n;if(this.overlayContainerStopEvent_.contains(r)||!i.contains(r))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){let t=this.getInteractions().getArray().slice();for(let n=t.length-1;n>=0;n--){let r=t[n];if(!(r.getMap()!==this||!r.getActive()||!this.getTargetElement())&&(!r.handleEvent(e)||e.propagationStopped))break}}}handlePostRender(){let e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let n=this.maxTilesLoading_,r=n;if(e){let t=e.viewHints;if(t[At.ANIMATING]||t[At.INTERACTING]){let t=Date.now()-e.time>8;n=t?0:8,r=t?0:2}}t.getTilesLoading()<n&&(t.reprioritize(),t.loadMoreTiles(n,r))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener(Ss.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Ss.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new ft(wt.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new ft(wt.LOADSTART,this,e))));let n=this.postRenderFunctions_;if(e)for(let t=0,r=n.length;t<r;++t)n[t](this,e);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let e=0,t=this.targetChangeHandlerKeys_.length;e<t;++e)rt(this.targetChangeHandlerKeys_[e]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(M.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(M.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!To(this.targetElement_)){this.resizeObserver_?.unobserve(this.targetElement_);let e=this.targetElement_.getRootNode();e instanceof ShadowRoot&&this.resizeObserver_.unobserve(e.host),this.setSize(void 0)}let e=this.getTarget(),t=typeof e==`string`?document.getElementById(e):e;if(this.targetElement_=t,!t)this.renderer_&&=(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),null),this.animationDelayKey_&&=(cancelAnimationFrame(this.animationDelayKey_),void 0);else{if(To(t)||t.appendChild(this.viewport_),this.renderer_||=new Ju(this),!To(t)){this.mapBrowserEventHandler_=new Ct(this,this.moveTolerance_);for(let e in I)this.mapBrowserEventHandler_.addEventListener(I[e],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(M.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(M.WHEEL,this.boundHandleBrowserEvent_,xt?{passive:!1}:!1);let e;if(this.keyboardEventTarget_)e=this.keyboardEventTarget_;else{let n=t.getRootNode();e=n instanceof ShadowRoot?n.host:t}if(this.targetChangeHandlerKeys_=[N(e,M.KEYDOWN,this.handleBrowserEvent,this),N(e,M.KEYPRESS,this.handleBrowserEvent,this)],t instanceof HTMLElement){let e=t.getRootNode();e instanceof ShadowRoot&&this.resizeObserver_.observe(e.host),this.resizeObserver_?.observe(t)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&=(rt(this.viewPropertyListenerKey_),null),this.viewChangeListenerKey_&&=(rt(this.viewChangeListenerKey_),null);let e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=N(e,Le.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=N(e,M.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&=(this.layerGroupPropertyListenerKeys_.forEach(rt),null);let e=this.getLayerGroup();e&&(this.handleLayerAdd_(new ys(`addlayer`,e)),this.layerGroupPropertyListenerKeys_=[N(e,Le.PROPERTYCHANGE,this.render,this),N(e,M.CHANGE,this.render,this),N(e,`addlayer`,this.handleLayerAdd_,this),N(e,`removelayer`,this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){if(!this.frameState_)return;let e=this.frameState_.layerStatesArray;for(let t=0,n=e.length;t<n;++t){let n=e[t].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){Yu(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){let t=this.getSize(),n=this.getView(),r=this.frameState_,i=null;if(t!==void 0&&pc(t)&&n&&n.isDef()){let r=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(i={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:yn(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:r,wantedTiles:{},mapId:F(this),renderTargets:{}},a.nextCenter&&a.nextResolution){let e=isNaN(a.nextRotation)?a.rotation:a.nextRotation;i.nextExtent=yn(a.nextCenter,a.nextResolution,e,t)}}this.frameState_=i,this.renderer_.renderFrame(i),i&&(i.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,i.postRenderFunctions),r&&(!this.previousExtent_||!En(this.previousExtent_)&&!cn(i.extent,this.previousExtent_))&&(this.dispatchEvent(new ft(wt.MOVESTART,this,r)),this.previousExtent_=an(this.previousExtent_)),this.previousExtent_&&!i.viewHints[At.ANIMATING]&&!i.viewHints[At.INTERACTING]&&!cn(i.extent,this.previousExtent_)&&(this.dispatchEvent(new ft(wt.MOVEEND,this,i)),Xt(i.extent,this.previousExtent_))),this.dispatchEvent(new ft(wt.POSTRENDER,this,i)),this.renderComplete_=(this.hasListener(wt.LOADSTART)||this.hasListener(wt.LOADEND)||this.hasListener(Ss.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0)}setLayerGroup(e){let t=this.getLayerGroup();t&&this.handleLayerRemove_(new ys(`removelayer`,t)),this.set(Tt.LAYERGROUP,e)}setSize(e){this.set(Tt.SIZE,e)}setTarget(e){this.set(Tt.TARGET,e)}setView(e){if(!e||e instanceof to){this.set(Tt.VIEW,e);return}this.set(Tt.VIEW,new to);let t=this;e.then(function(e){t.setView(new to(e))})}updateSize(){let e=this.getTargetElement(),t;if(e){let n,r;if(To(e))n=e.width,r=e.height;else{let t=getComputedStyle(e);n=e.offsetWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)-parseFloat(t.borderRightWidth),r=e.offsetHeight-parseFloat(t.borderTopWidth)-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)-parseFloat(t.borderBottomWidth)}!isNaN(n)&&!isNaN(r)&&(t=[Math.max(0,n),Math.max(0,r)],!pc(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&Yn(`No map visible because the map container's width or height are 0.`))}let n=this.getSize();t&&(!n||!Ge(t,n))&&(this.setSize(t),this.updateViewportSize_(t))}updateViewportSize_(e){let t=this.getView();t&&t.setViewportSize(e)}};function Qu(e){let t=null;e.keyboardEventTarget!==void 0&&(t=typeof e.keyboardEventTarget==`string`?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);let n={},r=e.layers&&typeof e.layers.getLayers==`function`?e.layers:new xs({layers:e.layers});n[Tt.LAYERGROUP]=r,n[Tt.TARGET]=e.target,n[Tt.VIEW]=e.view instanceof to?e.view:new to;let i;e.controls!==void 0&&(Array.isArray(e.controls)?i=new dt(e.controls.slice()):(R(typeof e.controls.getArray==`function`,"Expected `controls` to be an array or an `ol/Collection.js`"),i=e.controls));let a;e.interactions!==void 0&&(Array.isArray(e.interactions)?a=new dt(e.interactions.slice()):(R(typeof e.interactions.getArray==`function`,"Expected `interactions` to be an array or an `ol/Collection.js`"),a=e.interactions));let o;return e.overlays===void 0?o=new dt:Array.isArray(e.overlays)?o=new dt(e.overlays.slice()):(R(typeof e.overlays.getArray==`function`,"Expected `overlays` to be an array or an `ol/Collection.js`"),o=e.overlays),{controls:i,interactions:a,keyboardEventTarget:t,overlays:o,values:n}}var $u=class e extends ct{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`){let t=e;this.setGeometry(t)}else{let t=e;this.setProperties(t)}}clone(){let t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());let n=this.getGeometry();n&&t.setGeometry(n.clone());let r=this.getStyle();return r&&t.setStyle(r),t}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_&&=(rt(this.geometryChangeKey_),null);let e=this.getGeometry();e&&(this.geometryChangeKey_=N(e,M.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?ed(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 ed(e){if(typeof e==`function`)return e;let t;return Array.isArray(e)?t=e:(R(typeof e.getZIndex==`function`,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[e]),function(){return t}}function td(e,t,n,r){let i=[],a=nn();for(let o=0,s=n.length;o<s;++o){let s=n[o];a=sn(e,t,s[0],r),i.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=s[s.length-1]}return i}function nd(e,t,n,r,i,a,o){let s,c,l=(n-t)/r;if(l===1)s=t;else if(l===2)s=t,c=i;else if(l!==0){let a=e[t],o=e[t+1],l=0,u=[0];for(let i=t+r;i<n;i+=r){let t=e[i],n=e[i+1];l+=Math.sqrt((t-a)*(t-a)+(n-o)*(n-o)),u.push(l),a=t,o=n}let d=i*l,f=ze(u,d);f<0?(c=(d-u[-f-2])/(u[-f-1]-u[-f-2]),s=t+(-f-2)*r):s=t+f*r}o=o>1?o:2,a||=Array(o);for(let t=0;t<o;++t)a[t]=s===void 0?NaN:c===void 0?e[s+t]:zt(e[s+t],e[s+r+t],c);return a}function rd(e,t,n,r,i,a){if(n==t)return null;let o;if(i<e[t+r-1])return a?(o=e.slice(t,t+r),o[r-1]=i,o):null;if(e[n-1]<i)return a?(o=e.slice(n-r,n),o[r-1]=i,o):null;if(i==e[t+r-1])return e.slice(t,t+r);let s=t/r,c=n/r;for(;s<c;){let t=s+c>>1;i<e[(t+1)*r-1]?c=t:s=t+1}let l=e[s*r-1];if(i==l)return e.slice((s-1)*r,(s-1)*r+r);let u=e[(s+1)*r-1],d=(i-l)/(u-l);o=[];for(let t=0;t<r-1;++t)o.push(zt(e[(s-1)*r+t],e[s*r+t],d));return o.push(i),o}function id(e,t,n,r,i,a,o){if(o)return rd(e,t,n[n.length-1],r,i,a);let s;if(i<e[r-1])return a?(s=e.slice(0,r),s[r-1]=i,s):null;if(e[e.length-1]<i)return a?(s=e.slice(e.length-r),s[r-1]=i,s):null;for(let a=0,o=n.length;a<o;++a){let o=n[a];if(t!=o){if(i<e[t+r-1])return null;if(i<=e[o-1])return rd(e,t,o,r,i,!1);t=o}}return null}var ad=class e extends qi{constructor(e,t,n){super(),n!==void 0&&t===void 0?this.setFlatCoordinates(n,e):(t||=0,this.setCenterAndRadius(e,t,n))}clone(){let t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=e-i[0],o=t-i[1],s=a*a+o*o;if(s<r){if(s===0)for(let e=0;e<this.stride;++e)n[e]=i[e];else{let e=this.getRadius()/Math.sqrt(s);n[0]=i[0]+e*a,n[1]=i[1]+e*o;for(let e=2;e<this.stride;++e)n[e]=i[e]}return n.length=this.stride,s}return r}containsXY(e,t){let n=this.flatCoordinates,r=e-n[0],i=t-n[1];return r*r+i*i<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){let t=this.flatCoordinates,n=t[this.stride]-t[0];return rn(t[0]-n,t[1]-n,t[0]+n,t[1]+n,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){let e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return`Circle`}intersectsExtent(e){if(Tn(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]?!0:pn(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){let t=this.stride,n=this.flatCoordinates[t]-this.flatCoordinates[0],r=e.slice();r[t]=r[0]+n;for(let n=1;n<t;++n)r[t+n]=e[n];this.setFlatCoordinates(this.layout,r),this.changed()}setCenterAndRadius(e,t,n){this.setLayout(n,e,0),this.flatCoordinates||=[];let r=this.flatCoordinates,i=sa(r,0,e,this.stride);r[i++]=r[0]+t;for(let e=1,t=this.stride;e<t;++e)r[i++]=r[e];r.length=i,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){let n=this.getCenter(),r=this.getStride();this.setCenter(Vi(n,0,n.length,r,e,t,n)),this.changed()}};ad.prototype.transform;var od=class e extends Ki{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(rt),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,n=e.length;t<n;++t)this.changeEventsKeys_.push(N(e[t],M.CHANGE,this.changed,this))}clone(){let t=new e(sd(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<Zt(this.getExtent(),e,t))return r;let i=this.geometries_;for(let a=0,o=i.length;a<o;++a)r=i[a].closestPointXY(e,t,n,r);return r}containsXY(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].containsXY(e,t))return!0;return!1}computeExtent(e){an(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)ln(e,t[n].getExtent());return e}getGeometries(){return sd(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[],t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].getType()===this.getType()?e=e.concat(t[n].getGeometriesArrayRecursive()):e.push(t[n]);return e}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let n=[],r=this.geometries_,i=!1;for(let e=0,a=r.length;e<a;++e){let a=r[e],o=a.getSimplifiedGeometry(t);n.push(o),o!==a&&(i=!0)}return i?new e(n):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return`GeometryCollection`}intersectsExtent(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)if(t[n].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].rotate(e,t);this.changed()}scale(e,t,n){n||=_n(this.getExtent());let r=this.geometries_;for(let i=0,a=r.length;i<a;++i)r[i].scale(e,t,n);this.changed()}setGeometries(e){this.setGeometriesArray(sd(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].applyTransform(e);this.changed()}translate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function sd(e){return e.map(e=>e.clone())}function cd(e,t,n,r){let i=e[t],a=e[t+1],o=0;for(let s=t+r;s<n;s+=r){let t=e[s],n=e[s+1];o+=Math.sqrt((t-i)*(t-i)+(n-a)*(n-a)),i=t,a=n}return o}var ld=class e extends qi{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){We(this.flatCoordinates,e),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Zt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ia(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,n,r))}forEachSegment(e){return Oa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return this.layout!=`XYM`&&this.layout!=`XYZM`?null:(t=t===void 0?!1:t,rd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return nd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return cd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){let n=[];return n.length=ma(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LineString`}intersectsExtent(e){return ka(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=ca(this.flatCoordinates,0,e,this.stride),this.changed()}},ud=class e extends qi{constructor(e,t,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&n)this.setFlatCoordinates(t,e),this.ends_=n;else{let t=e,n=[],r=[];for(let e=0,i=t.length;e<i;++e){let i=t[e];We(n,i.getFlatCoordinates()),r.push(n.length)}let i=t.length===0?this.getLayout():t[0].getLayout();this.setFlatCoordinates(i,n),this.ends_=r}}appendLineString(e){We(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Zt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(na(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),aa(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,n,r))}getCoordinateAtM(e,t,n){return this.layout!=`XYM`&&this.layout!=`XYZM`||this.flatCoordinates.length===0?null:(t=t===void 0?!1:t,n=n===void 0?!1:n,id(this.flatCoordinates,0,this.ends_,this.stride,e,t,n))}getCoordinates(){return fa(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new ld(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){let e=this.flatCoordinates,t=this.ends_,n=this.layout,r=[],i=0;for(let a=0,o=t.length;a<o;++a){let o=t[a],s=new ld(e.slice(i,o),n);r.push(s),i=o}return r}getLength(){let e=this.ends_,t=0,n=0;for(let r=0,i=e.length;r<i;++r)n+=cd(this.flatCoordinates,t,e[r],this.stride),t=e[r];return n}getFlatMidpoints(){let e=[],t=this.flatCoordinates,n=0,r=this.ends_,i=this.stride;for(let a=0,o=r.length;a<o;++a){let o=r[a];We(e,nd(t,n,o,i,.5)),n=o}return e}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=ha(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,`XY`,r)}getType(){return`MultiLineString`}intersectsExtent(e){return Aa(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=la(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}},dd=class e extends qi{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){We(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<Zt(this.getExtent(),e,t))return r;let i=this.flatCoordinates,a=this.stride;for(let o=0,s=i.length;o<s;o+=a){let s=Pt(e,t,i[o],i[o+1]);if(s<r){r=s;for(let e=0;e<a;++e)n[e]=i[o+e];n.length=a}}return r}getCoordinates(){return da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){let t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new xa(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){let e=this.flatCoordinates,t=this.layout,n=this.stride,r=[];for(let i=0,a=e.length;i<a;i+=n){let a=new xa(e.slice(i,i+n),t);r.push(a)}return r}getType(){return`MultiPoint`}intersectsExtent(e){let t=this.flatCoordinates,n=this.stride;for(let r=0,i=t.length;r<i;r+=n){let n=t[r],i=t[r+1];if(en(e,n,i))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=ca(this.flatCoordinates,0,e,this.stride),this.changed()}},fd=class e extends qi{constructor(e,t,n){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){let r=e,i=[],a=[];for(let e=0,t=r.length;e<t;++e){let t=r[e],n=i.length,o=t.getEnds();for(let e=0,t=o.length;e<t;++e)o[e]+=n;We(i,t.getFlatCoordinates()),a.push(o)}t=r.length===0?this.getLayout():r[0].getLayout(),e=i,n=a}t!==void 0&&n?(this.setFlatCoordinates(t,e),this.endss_=n):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{let n=this.flatCoordinates.length;We(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let e=0,r=t.length;e<r;++e)t[e]+=n}this.endss_.push(t),this.changed()}clone(){let t=this.endss_.length,n=Array(t);for(let e=0;e<t;++e)n[e]=this.endss_[e].slice();let r=new e(this.flatCoordinates.slice(),this.layout,n);return r.applyProperties(this),r}closestPointXY(e,t,n,r){return r<Zt(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ra(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),oa(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return Ta(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return $i(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),za(t,0,this.endss_,this.stride,e)),pa(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){let e=td(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Da(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new dd(this.getFlatInteriorPoints().slice(),`XYM`)}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;La(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=za(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=ya(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{let n=this.endss_[e-1];t=n[n.length-1]}let n=this.endss_[e].slice(),r=n[n.length-1];if(t!==0)for(let e=0,r=n.length;e<r;++e)n[e]-=t;return new Va(this.flatCoordinates.slice(t,r),this.layout,n)}getPolygons(){let e=this.layout,t=this.flatCoordinates,n=this.endss_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a].slice(),s=o[o.length-1];if(i!==0)for(let e=0,t=o.length;e<t;++e)o[e]-=i;let c=new Va(t.slice(i,s),e,o);r.push(c),i=s}return r}getType(){return`MultiPolygon`}intersectsExtent(e){return Na(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||=[];let n=ua(this.flatCoordinates,0,e,this.stride,this.endss_);if(n.length===0)this.flatCoordinates.length=0;else{let e=n[n.length-1];this.flatCoordinates.length=e.length===0?0:e[e.length-1]}this.changed()}},pd=Ti(),md=class e{constructor(e,t,n,r,i,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=i,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||=this.type_===`Point`?on(this.flatCoordinates_):sn(this.flatCoordinates_,0,this.flatCoordinates_.length,2),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){let e=_n(this.getExtent());this.flatInteriorPoints_=Ea(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){let e=Ba(this.flatCoordinates_,this.ends_),t=td(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=Da(this.flatCoordinates_,0,e,2,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||=nd(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];let e=this.flatCoordinates_,t=0,n=this.ends_;for(let r=0,i=n.length;r<i;++r){let i=n[r],a=nd(e,t,i,2,.5);We(this.flatMidpoints_,a),t=i}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=B(e);let t=e.getExtent(),n=e.getWorldExtent();if(t&&n){let e=xn(n)/xn(t);Ni(pd,n[0],n[3],e,-e,0,0,0),Bi(this.flatCoordinates_,0,this.flatCoordinates_.length,2,pd,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new e(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=Xe((t,n)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);let r=this.simplifiedGeometry_.getFlatCoordinates(),i;switch(this.type_){case`LineString`:r.length=ma(r,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,r,0),i=[r.length];break;case`MultiLineString`:i=[],r.length=ha(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,r,0,i);break;case`Polygon`:i=[],r.length=va(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),r,0,i);break;default:}return i&&(this.simplifiedGeometry_=new e(this.type_,r,i,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}};md.prototype.getFlatCoordinates=md.prototype.getOrientedFlatCoordinates;function hd(e){let t=e.getType();switch(t){case`Point`:return new xa(e.getFlatCoordinates());case`MultiPoint`:return new dd(e.getFlatCoordinates(),`XY`);case`LineString`:return new ld(e.getFlatCoordinates(),`XY`);case`MultiLineString`:return new ud(e.getFlatCoordinates(),`XY`,e.getEnds());case`Polygon`:let n=e.getFlatCoordinates(),r=e.getEnds(),i=Ba(n,r);return i.length>1?new fd(n,`XY`,i):new Va(n,`XY`,r);default:throw Error(`Invalid geometry type:`+t)}}function gd(e,t){let n=e.getId(),r=hd(e),i=e.getProperties(),a=new $u;return t!==void 0&&a.setGeometryName(t),a.setGeometry(r),n!==void 0&&a.setId(n),a.setProperties(i,!0),a}var _d=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=$u,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?B(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=B(n),n.setWorldExtent(t.extent)),t={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return P()}readFeature(e,t){return P()}readFeatures(e,t){return P()}readGeometry(e,t){return P()}readProjection(e){return P()}writeFeature(e,t){return P()}writeFeatures(e,t){return P()}writeGeometry(e,t){return P()}};function vd(e,t,n){let r=n?B(n.featureProjection):null,i=n?B(n.dataProjection):null,a=e;if(r&&i&&!ui(r,i)){t&&(a=e.clone());let n=t?r:i,o=t?i:r;n.getUnits()===`tile-pixels`?a.transform(n,o):a.applyTransform(pi(n,o))}if(t&&n&&n.decimals!==void 0){let t=10**n.decimals;a===e&&(a=e.clone()),a.applyTransform(function(e){for(let n=0,r=e.length;n<r;++n)e[n]=Math.round(e[n]*t)/t;return e})}return a}var yd={Point:xa,LineString:ld,Polygon:Va,MultiPoint:dd,MultiLineString:ud,MultiPolygon:fd};function bd(e,t,n){return Array.isArray(t[0])?(La(e,0,t,n)||(e=e.slice(),za(e,0,t,n)),e):(Ia(e,0,t,n)||(e=e.slice(),Ra(e,0,t,n)),e)}function xd(e,t){let n=e.geometry;if(!n)return[];if(Array.isArray(n))return n.map(t=>xd({...e,geometry:t})).flat();let r=n.type===`MultiPolygon`?`Polygon`:n.type;if(r===`GeometryCollection`||r===`Circle`)throw Error(`Unsupported geometry type: `+r);let i=n.layout.length;return vd(new md(r,r===`Polygon`?bd(n.flatCoordinates,n.ends,i):n.flatCoordinates,n.ends?.flat(),i,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function Sd(e,t){if(!e)return null;if(Array.isArray(e))return new od(e.map(e=>Sd(e,t)));let n=yd[e.type];return vd(new n(e.flatCoordinates,e.layout||`XY`,e.ends),!1,t)}var Cd=class extends _d{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(wd(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(wd(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return P()}readFeaturesFromObject(e,t){return P()}readGeometry(e,t){return this.readGeometryFromObject(wd(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return P()}readProjection(e){return this.readProjectionFromObject(wd(e))}readProjectionFromObject(e){return P()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return P()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return P()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return P()}};function wd(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var Td=class extends Cd{constructor(e){e||={},super(),this.dataProjection=B(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=B(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 n=null;n=e.type===`Feature`?e:{type:`Feature`,geometry:e,properties:null};let r=Ed(n.geometry,t);if(this.featureClass===md)return xd({geometry:r,id:n.id,properties:n.properties},t);let i=new $u;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&i.setGeometryName(n.geometry_name),i.setGeometry(Sd(r,t)),`id`in n&&i.setId(n.id),n.properties&&i.setProperties(n.properties,!0),i}readFeaturesFromObject(e,t){let n=e,r=null;if(n.type===`FeatureCollection`){let n=e;r=[];let i=n.features;for(let e=0,n=i.length;e<n;++e){let n=this.readFeatureFromObject(i[e],t);n&&r.push(n)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return Dd(e,t)}readProjectionFromObject(e){let t=e.crs,n;if(t)if(t.type==`name`)n=B(t.properties.name);else if(t.type===`EPSG`)n=B(`EPSG:`+t.properties.code);else throw Error(`Unknown SRS type`);else n=this.dataProjection;return n}writeFeatureObject(e,t){t=this.adaptOptions(t);let n={type:`Feature`,geometry:null,properties:null},r=e.getId();if(r!==void 0&&(n.id=r),!e.hasProperties())return n;let i=e.getProperties(),a=e.getGeometry();return a&&(n.geometry=Fd(a,t),delete i[e.getGeometryName()]),$e(i)||(n.properties=i),n}writeFeaturesObject(e,t){t=this.adaptOptions(t);let n=[];for(let r=0,i=e.length;r<i;++r)n.push(this.writeFeatureObject(e[r],t));return{type:`FeatureCollection`,features:n}}writeGeometryObject(e,t){return Fd(e,this.adaptOptions(t))}};function Ed(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=kd(e);break;case`LineString`:n=Ad(e);break;case`Polygon`:n=Pd(e);break;case`MultiPoint`:n=Md(e);break;case`MultiLineString`:n=jd(e);break;case`MultiPolygon`:n=Nd(e);break;case`GeometryCollection`:n=Od(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return n}function Dd(e,t){return Sd(Ed(e,t),t)}function Od(e,t){return e.geometries.map(function(e){return Ed(e,t)})}function kd(e){let t=e.coordinates;return{type:`Point`,flatCoordinates:t,layout:Ji(t.length)}}function Ad(e){let t=e.coordinates,n=t.flat();return{type:`LineString`,flatCoordinates:n,ends:[n.length],layout:Ji(t[0]?.length||2)}}function jd(e){let t=e.coordinates,n=t[0]?.[0]?.length||2,r=[];return{type:`MultiLineString`,flatCoordinates:r,ends:la(r,0,t,n),layout:Ji(n)}}function Md(e){let t=e.coordinates;return{type:`MultiPoint`,flatCoordinates:t.flat(),layout:Ji(t[0]?.length||2)}}function Nd(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.[0].length||2;return{type:`MultiPolygon`,flatCoordinates:n,ends:ua(n,0,t,r),layout:Ji(r)}}function Pd(e){let t=e.coordinates,n=[],r=t[0]?.[0]?.length;return{type:`Polygon`,flatCoordinates:n,ends:la(n,0,t,r),layout:Ji(r)}}function Fd(e,t){e=vd(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=Vd(e,t);break;case`LineString`:r=Ld(e,t);break;case`Polygon`:r=Hd(e,t);break;case`MultiPoint`:r=zd(e,t);break;case`MultiLineString`:r=Rd(e,t);break;case`MultiPolygon`:r=Bd(e,t);break;case`GeometryCollection`:r=Id(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function Id(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return Fd(e,t)})}}function Ld(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function Rd(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function zd(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function Bd(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function Vd(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function Hd(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}var Ud=8,Wd={version:{required:!0,type:`enum`,values:[8]},name:{type:`string`},metadata:{type:`*`},center:{type:`array`,value:`number`},centerAltitude:{type:`number`},zoom:{type:`number`},bearing:{type:`number`,default:0,period:360,units:`degrees`},pitch:{type:`number`,default:0,units:`degrees`},roll:{type:`number`,default:0,units:`degrees`},state:{type:`state`,default:{}},light:{type:`light`},sky:{type:`sky`},projection:{type:`projection`},terrain:{type:`terrain`},sources:{required:!0,type:`sources`},sprite:{type:`sprite`},glyphs:{type:`string`},transition:{type:`transition`},layers:{required:!0,type:`array`,value:`layer`}},Gd={"*":{type:`source`}},Kd=[`source_vector`,`source_raster`,`source_raster_dem`,`source_geojson`,`source_video`,`source_image`],qd={type:{required:!0,type:`enum`,values:{vector:{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:`enum`,values:{xyz:{},tms:{}},default:`xyz`},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},attribution:{type:`string`},promoteId:{type:`promoteId`},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},Jd={type:{required:!0,type:`enum`,values:{raster:{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},tileSize:{type:`number`,default:512,units:`pixels`},scheme:{type:`enum`,values:{xyz:{},tms:{}},default:`xyz`},attribution:{type:`string`},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},Yd={type:{required:!0,type:`enum`,values:{"raster-dem":{}}},url:{type:`string`},tiles:{type:`array`,value:`string`},bounds:{type:`array`,value:`number`,length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:`number`,default:0},maxzoom:{type:`number`,default:22},tileSize:{type:`number`,default:512,units:`pixels`},attribution:{type:`string`},encoding:{type:`enum`,values:{terrarium:{},mapbox:{},custom:{}},default:`mapbox`},redFactor:{type:`number`,default:1},blueFactor:{type:`number`,default:1},greenFactor:{type:`number`,default:1},baseShift:{type:`number`,default:0},volatile:{type:`boolean`,default:!1},"*":{type:`*`}},Xd={type:{required:!0,type:`enum`,values:{geojson:{}}},data:{required:!0,type:`*`},maxzoom:{type:`number`,default:18},attribution:{type:`string`},buffer:{type:`number`,default:128,maximum:512,minimum:0},filter:{type:`*`},tolerance:{type:`number`,default:.375},cluster:{type:`boolean`,default:!1},clusterRadius:{type:`number`,default:50,minimum:0},clusterMaxZoom:{type:`number`},clusterMinPoints:{type:`number`},clusterProperties:{type:`*`},lineMetrics:{type:`boolean`,default:!1},generateId:{type:`boolean`,default:!1},promoteId:{type:`promoteId`}},Zd={type:{required:!0,type:`enum`,values:{video:{}}},urls:{required:!0,type:`array`,value:`string`},coordinates:{required:!0,type:`array`,length:4,value:{type:`array`,length:2,value:`number`}}},Qd={type:{required:!0,type:`enum`,values:{image:{}}},url:{required:!0,type:`string`},coordinates:{required:!0,type:`array`,length:4,value:{type:`array`,length:2,value:`number`}}},$d={id:{type:`string`,required:!0},type:{type:`enum`,values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:`*`},source:{type:`string`},"source-layer":{type:`string`},minzoom:{type:`number`,minimum:0,maximum:24},maxzoom:{type:`number`,minimum:0,maximum:24},filter:{type:`filter`},layout:{type:`layout`},paint:{type:`paint`}},ef=[`layout_fill`,`layout_line`,`layout_circle`,`layout_heatmap`,`layout_fill-extrusion`,`layout_symbol`,`layout_raster`,`layout_hillshade`,`layout_color-relief`,`layout_background`],tf={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},nf={"fill-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},rf={"circle-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},af={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},of={"line-cap":{type:`enum`,values:{butt:{},round:{},square:{}},default:`butt`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"line-join":{type:`enum`,values:{bevel:{},round:{},miter:{}},default:`miter`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"line-miter-limit":{type:`number`,default:2,requires:[{"line-join":`miter`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"line-round-limit":{type:`number`,default:1.05,requires:[{"line-join":`round`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"line-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},sf={"symbol-placement":{type:`enum`,values:{point:{},line:{},"line-center":{}},default:`point`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-spacing":{type:`number`,default:250,minimum:1,units:`pixels`,requires:[{"symbol-placement":`line`}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-avoid-edges":{type:`boolean`,default:!1,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"symbol-sort-key":{type:`number`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"symbol-z-order":{type:`enum`,values:{auto:{},"viewport-y":{},source:{}},default:`auto`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-allow-overlap":{type:`boolean`,default:!1,requires:[`icon-image`,{"!":`icon-overlap`}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-overlap":{type:`enum`,values:{never:{},always:{},cooperative:{}},requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-ignore-placement":{type:`boolean`,default:!1,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-optional":{type:`boolean`,default:!1,requires:[`icon-image`,`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-rotation-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-size":{type:`number`,default:1,minimum:0,units:`factor of the original icon size`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-text-fit":{type:`enum`,values:{none:{},width:{},height:{},both:{}},default:`none`,requires:[`icon-image`,`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-text-fit-padding":{type:`array`,value:`number`,length:4,default:[0,0,0,0],units:`pixels`,requires:[`icon-image`,`text-field`,{"icon-text-fit":[`both`,`width`,`height`]}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-image":{type:`resolvedImage`,tokens:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-rotate":{type:`number`,default:0,period:360,units:`degrees`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-padding":{type:`padding`,default:[2],units:`pixels`,requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-keep-upright":{type:`boolean`,default:!1,requires:[`icon-image`,{"icon-rotation-alignment":`map`},{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"icon-offset":{type:`array`,value:`number`,length:2,default:[0,0],requires:[`icon-image`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-anchor":{type:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:`center`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"icon-pitch-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-pitch-alignment":{type:`enum`,values:{map:{},viewport:{},auto:{}},default:`auto`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-rotation-alignment":{type:`enum`,values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:`auto`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-field":{type:`formatted`,default:``,tokens:!0,expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-font":{type:`array`,value:`string`,default:[`Open Sans Regular`,`Arial Unicode MS Regular`],requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-size":{type:`number`,default:16,minimum:0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-max-width":{type:`number`,default:10,minimum:0,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-line-height":{type:`number`,default:1.2,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-letter-spacing":{type:`number`,default:0,units:`ems`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-justify":{type:`enum`,values:{auto:{},left:{},center:{},right:{}},default:`center`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-radial-offset":{type:`number`,units:`ems`,default:0,requires:[`text-field`],"property-type":`data-driven`,expression:{interpolated:!0,parameters:[`zoom`,`feature`]}},"text-variable-anchor":{type:`array`,value:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-variable-anchor-offset":{type:`variableAnchorOffsetCollection`,requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-anchor":{type:`enum`,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:`center`,requires:[`text-field`,{"!":`text-variable-anchor`}],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-max-angle":{type:`number`,default:45,units:`degrees`,requires:[`text-field`,{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-writing-mode":{type:`array`,value:`enum`,values:{horizontal:{},vertical:{}},requires:[`text-field`,{"symbol-placement":[`point`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-rotate":{type:`number`,default:0,period:360,units:`degrees`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-padding":{type:`number`,default:2,minimum:0,units:`pixels`,requires:[`text-field`],expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"text-keep-upright":{type:`boolean`,default:!0,requires:[`text-field`,{"text-rotation-alignment":`map`},{"symbol-placement":[`line`,`line-center`]}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-transform":{type:`enum`,values:{none:{},uppercase:{},lowercase:{}},default:`none`,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-offset":{type:`array`,value:`number`,units:`ems`,length:2,default:[0,0],requires:[`text-field`,{"!":`text-radial-offset`}],expression:{interpolated:!0,parameters:[`zoom`,`feature`]},"property-type":`data-driven`},"text-allow-overlap":{type:`boolean`,default:!1,requires:[`text-field`,{"!":`text-overlap`}],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-overlap":{type:`enum`,values:{never:{},always:{},cooperative:{}},requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-ignore-placement":{type:`boolean`,default:!1,requires:[`text-field`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-optional":{type:`boolean`,default:!1,requires:[`text-field`,`icon-image`],expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},cf={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},lf={visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},uf={type:`array`,value:`*`},df={type:`enum`,values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},ff={type:`enum`,values:{Point:{},LineString:{},Polygon:{}}},pf={type:`array`,minimum:0,maximum:24,value:[`number`,`color`],length:2},mf={type:`array`,value:`*`,minimum:1},hf={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}},gf={"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}},_f={source:{type:`string`,required:!0},exaggeration:{type:`number`,minimum:0,default:1}},vf={type:{type:`projectionDefinition`,default:`mercator`,"property-type":`data-constant`,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]}}},yf=[`paint_fill`,`paint_line`,`paint_circle`,`paint_heatmap`,`paint_fill-extrusion`,`paint_symbol`,`paint_raster`,`paint_hillshade`,`paint_color-relief`,`paint_background`],bf={"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`}},xf={"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`}},Sf={"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`}},Cf={"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`}},wf={"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`}},Tf={"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`}},Ef={"hillshade-illumination-direction":{type:`numberArray`,default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-illumination-altitude":{type:`numberArray`,default:45,minimum:0,maximum:90,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:`colorArray`,default:`#000000`,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-highlight-color":{type:`colorArray`,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`},"hillshade-method":{type:`enum`,values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:`standard`,expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},Df={"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`}},Of={duration:{type:`number`,default:300,minimum:0,units:`milliseconds`},delay:{type:`number`,default:0,minimum:0,units:`milliseconds`}},kf={"*":{type:`string`}},Af={$version:Ud,$root:Wd,sources:Gd,source:Kd,source_vector:qd,source_raster:Jd,source_raster_dem:Yd,source_geojson:Xd,source_video:Zd,source_image:Qd,layer:$d,layout:ef,layout_background:tf,layout_fill:nf,layout_circle:rf,layout_heatmap:af,"layout_fill-extrusion":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},layout_line:of,layout_symbol:sf,layout_raster:cf,layout_hillshade:lf,"layout_color-relief":{visibility:{type:`enum`,values:{visible:{},none:{}},default:`visible`,"property-type":`constant`}},filter:uf,filter_operator:df,geometry_type:ff,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:pf,expression:mf,light:hf,sky:gf,terrain:_f,projection:vf,paint:yf,paint_fill:bf,"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:xf,paint_circle:Sf,paint_heatmap:Cf,paint_symbol:wf,paint_raster:Tf,paint_hillshade:Ef,"paint_color-relief":{"color-relief-opacity":{type:`number`,default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"color-relief-color":{type:`color`,transition:!1,expression:{interpolated:!0,parameters:[`elevation`]},"property-type":`color-ramp`}},paint_background:Df,transition:Of,"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:kf},jf=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`];function Mf(e,t){let n={};for(let t in e)t!==`ref`&&(n[t]=e[t]);return jf.forEach(e=>{e in t&&(n[e]=t[e])}),n}function Nf(e){e=e.slice();let t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].id]=e[n];for(let n=0;n<e.length;n++)`ref`in e[n]&&(e[n]=Mf(e[n],t[e[n].ref]));return e}var K=class{constructor(e,t,n,r){this.message=(e?`${e}: `:``)+n,r&&(this.identifier=r),t!=null&&t.__line__&&(this.line=t.__line__)}};function Pf(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}var Ff=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},If=class e{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,n]of t)this.bindings[e]=n}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},Lf={kind:`null`},q={kind:`number`},J={kind:`string`},Y={kind:`boolean`},Rf={kind:`color`},zf={kind:`projectionDefinition`},Bf={kind:`object`},X={kind:`value`},Vf={kind:`error`},Hf={kind:`collator`},Uf={kind:`formatted`},Wf={kind:`padding`},Gf={kind:`colorArray`},Kf={kind:`numberArray`},qf={kind:`resolvedImage`},Jf={kind:`variableAnchorOffsetCollection`};function Yf(e,t){return{kind:`array`,itemType:e,N:t}}function Xf(e){if(e.kind===`array`){let t=Xf(e.itemType);return typeof e.N==`number`?`array<${t}, ${e.N}>`:e.itemType.kind===`value`?`array`:`array<${t}>`}else return e.kind}var Zf=[Lf,q,J,Y,Rf,zf,Uf,Bf,Yf(X),Wf,Kf,Gf,qf,Jf];function Qf(e,t){if(t.kind===`error`)return null;if(e.kind===`array`){if(t.kind===`array`&&(t.N===0&&t.itemType.kind===`value`||!Qf(e.itemType,t.itemType))&&(typeof e.N!=`number`||e.N===t.N))return null}else if(e.kind===t.kind)return null;else if(e.kind===`value`){for(let e of Zf)if(!Qf(e,t))return null}return`Expected ${Xf(e)} but found ${Xf(t)} instead.`}function $f(e,t){return t.some(t=>t.kind===e.kind)}function ep(e,t){return t.some(t=>t===`null`?e===null:t===`array`?Array.isArray(e):t===`object`?e&&!Array.isArray(e)&&typeof e==`object`:t===typeof e)}function tp(e,t){return e.kind===`array`&&t.kind===`array`?e.itemType.kind===t.itemType.kind&&typeof e.N==`number`:e.kind===t.kind}var np=.96422,rp=1,ip=.82521,ap=4/29,op=6/29,sp=3*op*op,cp=op*op*op,lp=Math.PI/180,up=180/Math.PI;function dp(e){return e%=360,e<0&&(e+=360),e}function fp([e,t,n,r]){e=pp(e),t=pp(t),n=pp(n);let i,a,o=mp((.2225045*e+.7168786*t+.0606169*n)/rp);e===t&&t===n?i=a=o:(i=mp((.4360747*e+.3850649*t+.1430804*n)/np),a=mp((.0139322*e+.0971045*t+.7141733*n)/ip));let s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),r]}function pp(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function mp(e){return e>cp?e**(1/3):e/sp+ap}function hp([e,t,n,r]){let i=(e+16)/116,a=isNaN(t)?i:i+t/500,o=isNaN(n)?i:i-n/200;return i=rp*_p(i),a=np*_p(a),o=ip*_p(o),[gp(3.1338561*a-1.6168667*i-.4906146*o),gp(-.9787684*a+1.9161415*i+.033454*o),gp(.0719453*a-.2289914*i+1.4052427*o),r]}function gp(e){return e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055,e<0?0:e>1?1:e}function _p(e){return e>op?e*e*e:sp*(e-ap)}function vp(e){let[t,n,r,i]=fp(e),a=Math.sqrt(n*n+r*r);return[Math.round(a*1e4)?dp(Math.atan2(r,n)*up):NaN,a,t,i]}function yp([e,t,n,r]){return e=isNaN(e)?0:e*lp,hp([n,Math.cos(e)*t,Math.sin(e)*t,r])}function bp([e,t,n,r]){e=dp(e),t/=100,n/=100;function i(r){let i=(r+e/30)%12,a=t*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4),r]}var xp=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Sp(e,t){return xp(e,t)?e[t]:void 0}function Cp(e){if(e=e.toLowerCase().trim(),e===`transparent`)return[0,0,0,0];let t=Sp(Op,e);if(t){let[e,n,r]=t;return[e/255,n/255,r/255,1]}if(e.startsWith(`#`)&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,n=1;return[wp(e.slice(n,n+=t)),wp(e.slice(n,n+=t)),wp(e.slice(n,n+=t)),wp(e.slice(n,n+t)||`ff`)]}if(e.startsWith(`rgb`)){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,n,r,i,a,o,s,c,l,u,d,f]=t,p=[i||` `,s||` `,u].join(``);if(p===` `||p===` /`||p===`,,`||p===`,,,`){let e=[r,o,l].join(``),t=e===`%%%`?100:e===``?255:0;if(t){let e=[Ep(+n/t,0,1),Ep(+a/t,0,1),Ep(+c/t,0,1),d?Tp(+d,f):1];if(Dp(e))return e}}return}}let n=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(n){let[e,t,r,i,a,o,s,c,l]=n,u=[r||` `,a||` `,s].join(``);if(u===` `||u===` /`||u===`,,`||u===`,,,`){let e=[+t,Ep(+i,0,100),Ep(+o,0,100),c?Tp(+c,l):1];if(Dp(e))return bp(e)}}}function wp(e){return parseInt(e.padEnd(2,e),16)/255}function Tp(e,t){return Ep(t?e/100:e,0,1)}function Ep(e,t,n){return Math.min(Math.max(t,e),n)}function Dp(e){return!e.some(Number.isNaN)}var Op={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 kp(e,t,n){return e+n*(t-e)}function Ap(e,t,n){return e.map((e,r)=>kp(e,t[r],n))}var jp=class e{constructor(e,t,n,r=1,i=!0){this.r=e,this.g=t,this.b=n,this.a=r,i||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter(`rgb`,[e,t,n,r]))}static parse(t){if(t instanceof e)return t;if(typeof t!=`string`)return;let n=Cp(t);if(n)return new e(...n,!1)}get rgb(){let{r:e,g:t,b:n,a:r}=this,i=r||1/0;return this.overwriteGetter(`rgb`,[e/i,t/i,n/i,r])}get hcl(){return this.overwriteGetter(`hcl`,vp(this.rgb))}get lab(){return this.overwriteGetter(`lab`,fp(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,n,r]=this.rgb;return`rgba(${[e,t,n].map(e=>Math.round(e*255)).join(`,`)},${r})`}static interpolate(t,n,r,i=`rgb`){switch(i){case`rgb`:{let[i,a,o,s]=Ap(t.rgb,n.rgb,r);return new e(i,a,o,s,!1)}case`hcl`:{let[i,a,o,s]=t.hcl,[c,l,u,d]=n.hcl,f,p;if(!isNaN(i)&&!isNaN(c)){let e=c-i;c>i&&e>180?e-=360:c<i&&i-c>180&&(e+=360),f=i+r*e}else isNaN(i)?isNaN(c)?f=NaN:(f=c,(o===1||o===0)&&(p=l)):(f=i,(u===1||u===0)&&(p=a));let[m,h,g,_]=yp([f,p??kp(a,l,r),kp(o,u,r),kp(s,d,r)]);return new e(m,h,g,_,!1)}case`lab`:{let[i,a,o,s]=hp(Ap(t.lab,n.lab,r));return new e(i,a,o,s,!1)}}}};jp.black=new jp(0,0,0,1),jp.white=new jp(1,1,1,1),jp.transparent=new jp(0,0,0,0),jp.red=new jp(1,0,0,1);var Mp=class{constructor(e,t,n){e?this.sensitivity=t?`variant`:`case`:this.sensitivity=t?`accent`:`base`,this.locale=n,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}},Np=[`bottom`,`center`,`top`],Pp=class{constructor(e,t,n,r,i,a){this.text=e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i,this.verticalAlign=a}},Fp=class e{constructor(e){this.sections=e}static fromString(t){return new e([new Pp(t,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(t){return t instanceof e?t:e.fromString(t)}toString(){return this.sections.length===0?``:this.sections.map(e=>e.text).join(``)}},Ip=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`number`)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if(typeof e!=`number`)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]];break}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){return new e(Ap(t.values,n.values,r))}},Lp=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`number`)return new e([t]);if(Array.isArray(t)){for(let e of t)if(typeof e!=`number`)return;return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){return new e(Ap(t.values,n.values,r))}},Rp=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(typeof t==`string`){let n=jp.parse(t);return n?new e([n]):void 0}if(!Array.isArray(t))return;let n=[];for(let e of t){if(typeof e!=`string`)return;let t=jp.parse(e);if(!t)return;n.push(t)}return new e(n)}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r,i=`rgb`){let a=[];if(t.values.length!=n.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${n.values.length}), cannot interpolate.`);for(let e=0;e<t.values.length;e++)a.push(jp.interpolate(t.values[e],n.values[e],r,i));return new e(a)}},zp=class extends Error{constructor(e){super(e),this.name=`RuntimeError`}toJSON(){return this.message}},Bp=new Set([`center`,`left`,`right`,`top`,`bottom`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]),Vp=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let e=0;e<t.length;e+=2){let n=t[e],r=t[e+1];if(typeof n!=`string`||!Bp.has(n)||!Array.isArray(r)||r.length!==2||typeof r[0]!=`number`||typeof r[1]!=`number`)return}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,n,r){let i=t.values,a=n.values;if(i.length!==a.length)throw new zp(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${n.toString()}`);let o=[];for(let e=0;e<i.length;e+=2){if(i[e]!==a[e])throw new zp(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${i[e]}, to[${e}]: ${a[e]}`);o.push(i[e]);let[t,n]=i[e+1],[s,c]=a[e+1];o.push([kp(t,s,r),kp(n,c,r)])}return new e(o)}},Hp=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}},Up=class e{constructor(e,t,n){this.from=e,this.to=t,this.transition=n}static interpolate(t,n,r){return new e(t,n,r)}static parse(t){if(t instanceof e)return t;if(Array.isArray(t)&&t.length===3&&typeof t[0]==`string`&&typeof t[1]==`string`&&typeof t[2]==`number`)return new e(t[0],t[1],t[2]);if(typeof t==`object`&&typeof t.from==`string`&&typeof t.to==`string`&&typeof t.transition==`number`)return new e(t.from,t.to,t.transition);if(typeof t==`string`)return new e(t,t,1)}};function Wp(e,t,n,r){return typeof e==`number`&&e>=0&&e<=255&&typeof t==`number`&&t>=0&&t<=255&&typeof n==`number`&&n>=0&&n<=255?r===void 0||typeof r==`number`&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,n,r].join(`, `)}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r==`number`?[e,t,n,r]:[e,t,n]).join(`, `)}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Gp(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||e instanceof Up||e instanceof jp||e instanceof Mp||e instanceof Fp||e instanceof Ip||e instanceof Lp||e instanceof Rp||e instanceof Vp||e instanceof Hp)return!0;if(Array.isArray(e)){for(let t of e)if(!Gp(t))return!1;return!0}else if(typeof e==`object`){for(let t in e)if(!Gp(e[t]))return!1;return!0}else return!1}function Kp(e){if(e===null)return Lf;if(typeof e==`string`)return J;if(typeof e==`boolean`)return Y;if(typeof e==`number`)return q;if(e instanceof jp)return Rf;if(e instanceof Up)return zf;if(e instanceof Mp)return Hf;if(e instanceof Fp)return Uf;if(e instanceof Ip)return Wf;if(e instanceof Lp)return Kf;if(e instanceof Rp)return Gf;if(e instanceof Vp)return Jf;if(e instanceof Hp)return qf;if(Array.isArray(e)){let t=e.length,n;for(let t of e){let e=Kp(t);if(!n)n=e;else if(n===e)continue;else{n=X;break}}return Yf(n||X,t)}else return Bf}function qp(e){let t=typeof e;return e===null?``:t===`string`||t===`number`||t===`boolean`?String(e):e instanceof jp||e instanceof Up||e instanceof Fp||e instanceof Ip||e instanceof Lp||e instanceof Rp||e instanceof Vp||e instanceof Hp?e.toString():JSON.stringify(e)}var Jp=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,n){if(t.length!==2)return n.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Gp(t[1]))return n.error(`invalid value`);let r=t[1],i=Kp(r),a=n.expectedType;return i.kind===`array`&&i.N===0&&a&&a.kind===`array`&&(typeof a.N!=`number`||a.N===0)&&(i=a),new e(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},Yp={string:J,number:q,boolean:Y,object:Bf},Xp=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=1,i,a=t[0];if(a===`array`){let e;if(t.length>2){let i=t[1];if(typeof i!=`string`||!(i in Yp)||i===`object`)return n.error(`The item type argument of "array" must be one of string, number, boolean`,1);e=Yp[i],r++}else e=X;let a;if(t.length>3){if(t[2]!==null&&(typeof t[2]!=`number`||t[2]<0||t[2]!==Math.floor(t[2])))return n.error(`The length argument to "array" must be a positive integer literal`,2);a=t[2],r++}i=Yf(e,a)}else{if(!Yp[a])throw Error(`Types doesn't contain name = ${a}`);i=Yp[a]}let o=[];for(;r<t.length;r++){let e=n.parse(t[r],r,X);if(!e)return null;o.push(e)}return new e(i,o)}evaluate(e){for(let t=0;t<this.args.length;t++){let n=this.args[t].evaluate(e);if(!Qf(this.type,Kp(n)))return n;if(t===this.args.length-1)throw new zp(`Expected value to be of type ${Xf(this.type)}, but found ${Xf(Kp(n))} instead.`)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Zp={"to-boolean":Y,"to-color":Rf,"to-number":q,"to-string":J},Qp=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=t[0];if(!Zp[r])throw Error(`Can't parse ${r} as it is not part of the known types`);if((r===`to-boolean`||r===`to-string`)&&t.length!==2)return n.error(`Expected one argument.`);let i=Zp[r],a=[];for(let e=1;e<t.length;e++){let r=n.parse(t[e],e,X);if(!r)return null;a.push(r)}return new e(i,a)}evaluate(e){switch(this.type.kind){case`boolean`:return!!this.args[0].evaluate(e);case`color`:{let t,n;for(let r of this.args){if(t=r.evaluate(e),n=null,t instanceof jp)return t;if(typeof t==`string`){let n=e.parseColor(t);if(n)return n}else if(Array.isArray(t)&&(n=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Wp(t[0],t[1],t[2],t[3]),!n))return new jp(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new zp(n||`Could not parse color from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`padding`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Ip.parse(t);if(r)return r}throw new zp(`Could not parse padding from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`numberArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Lp.parse(t);if(r)return r}throw new zp(`Could not parse numberArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`colorArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Rp.parse(t);if(r)return r}throw new zp(`Could not parse colorArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`variableAnchorOffsetCollection`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Vp.parse(t);if(r)return r}throw new zp(`Could not parse variableAnchorOffsetCollection from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`number`:{let t=null;for(let n of this.args){if(t=n.evaluate(e),t===null)return 0;let r=Number(t);if(!isNaN(r))return r}throw new zp(`Could not convert ${JSON.stringify(t)} to number.`)}case`formatted`:return Fp.fromString(qp(this.args[0].evaluate(e)));case`resolvedImage`:return Hp.fromString(qp(this.args[0].evaluate(e)));case`projectionDefinition`:return this.args[0].evaluate(e);default:return qp(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},$p=[`Unknown`,`Point`,`LineString`,`Polygon`],em=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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`?$p[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.get(e);return t||(t=jp.parse(e),this._parseColorCache.set(e,t)),t}},tm=class e{constructor(e,t,n=[],r,i=new If,a=[]){this.registry=e,this.path=n,this.key=n.map(e=>`[${e}]`).join(``),this.scope=i,this.errors=a,this.expectedType=r,this._isConstant=t}parse(e,t,n,r,i={}){return t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)}_parse(e,t){(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`)&&(e=[`literal`,e]);function n(e,t,n){return n===`assert`?new Xp(t,[e]):n===`coerce`?new Qp(t,[e]):e}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", []].`);let 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;let i=this.registry[r];if(i){let r=i.parse(e,this);if(!r)return null;if(this.expectedType){let e=this.expectedType,i=r.type;if((e.kind===`string`||e.kind===`number`||e.kind===`boolean`||e.kind===`object`||e.kind===`array`)&&i.kind===`value`)r=n(r,e,t.typeAnnotation||`assert`);else if(e.kind===`projectionDefinition`&&[`string`,`array`].includes(i.kind)||[`color`,`formatted`,`resolvedImage`].includes(e.kind)&&[`value`,`string`].includes(i.kind)||[`padding`,`numberArray`].includes(e.kind)&&[`value`,`number`,`array`].includes(i.kind)||e.kind===`colorArray`&&[`value`,`string`,`array`].includes(i.kind)||e.kind===`variableAnchorOffsetCollection`&&[`value`,`array`].includes(i.kind))r=n(r,e,t.typeAnnotation||`coerce`);else if(this.checkSubtype(e,i))return null}if(!(r instanceof Jp)&&r.type.kind!==`resolvedImage`&&this._isConstant(r)){let e=new em;try{r=new Jp(r.type,r.evaluate(e))}catch(e){return this.error(e.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}else if(e===void 0)return this.error(`'undefined' value invalid. Use null instead.`);else if(typeof e==`object`)return this.error(`Bare objects invalid. Use ["literal", {...}] instead.`);else return this.error(`Expected an array, but found ${typeof e} instead.`)}concat(t,n,r){let i=typeof t==`number`?this.path.concat(t):this.path,a=r?this.scope.concat(r):this.scope;return new e(this.registry,this._isConstant,i,n||null,a,this.errors)}error(e,...t){let n=`${this.key}${t.map(e=>`[${e}]`).join(``)}`;this.errors.push(new Ff(n,e))}checkSubtype(e,t){let n=Qf(e,t);return n&&this.error(n),n}},nm=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let r=[];for(let e=1;e<t.length-1;e+=2){let i=t[e];if(typeof i!=`string`)return n.error(`Expected string, but found ${typeof i} instead.`,e);if(/[^a-zA-Z0-9_]/.test(i))return n.error(`Variable names must contain only alphanumeric characters or '_'.`,e);let a=n.parse(t[e+1],e+1);if(!a)return null;r.push([i,a])}let i=n.parse(t[t.length-1],t.length-1,n.expectedType,r);return i?new e(r,i):null}outputDefined(){return this.result.outputDefined()}},rm=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,n){if(t.length!==2||typeof t[1]!=`string`)return n.error(`'var' expression requires exactly one string literal argument.`);let r=t[1];return n.scope.has(r)?new e(r,n.scope.get(r)):n.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},im=class e{constructor(e,t,n){this.type=e,this.index=t,this.input=n}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,q),i=n.parse(t[2],2,Yf(n.expectedType||X));if(!r||!i)return null;let a=i.type;return new e(a.itemType,r,i)}evaluate(e){let t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new zp(`Array index out of bounds: ${t} < 0.`);if(t>=n.length)throw new zp(`Array index out of bounds: ${t} > ${n.length-1}.`);if(t!==Math.floor(t))throw new zp(`Array index must be an integer, but found ${t} instead.`);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},am=class e{constructor(e,t){this.type=Y,this.needle=e,this.haystack=t}static parse(t,n){if(t.length!==3)return n.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,X),i=n.parse(t[2],2,X);return!r||!i?null:$f(r.type,[Y,J,q,Lf,X])?new e(r,i):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xf(r.type)} instead`)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!ep(t,[`boolean`,`string`,`number`,`null`]))throw new zp(`Expected first argument to be of type boolean, string, number or null, but found ${Xf(Kp(t))} instead.`);if(!ep(n,[`string`,`array`]))throw new zp(`Expected second argument to be of type array or string, but found ${Xf(Kp(n))} instead.`);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},om=class e{constructor(e,t,n){this.type=q,this.needle=e,this.haystack=t,this.fromIndex=n}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,X),i=n.parse(t[2],2,X);if(!r||!i)return null;if(!$f(r.type,[Y,J,q,Lf,X]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xf(r.type)} instead`);if(t.length===4){let a=n.parse(t[3],3,q);return a?new e(r,i,a):null}else return new e(r,i)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!ep(t,[`boolean`,`string`,`number`,`null`]))throw new zp(`Expected first argument to be of type boolean, string, number or null, but found ${Xf(Kp(t))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),ep(n,[`string`])){let e=n.indexOf(t,r);return e===-1?-1:[...n.slice(0,e)].length}else if(ep(n,[`array`]))return n.indexOf(t,r);else throw new zp(`Expected second argument to be of type array or string, but found ${Xf(Kp(n))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},sm=class e{constructor(e,t,n,r,i,a){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=a}static parse(t,n){if(t.length<5)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return n.error(`Expected an even number of arguments.`);let r,i;n.expectedType&&n.expectedType.kind!==`value`&&(i=n.expectedType);let a={},o=[];for(let e=2;e<t.length-1;e+=2){let s=t[e],c=t[e+1];Array.isArray(s)||(s=[s]);let l=n.concat(e);if(s.length===0)return l.error(`Expected at least one branch label.`);for(let e of s){if(typeof e!=`number`&&typeof e!=`string`)return l.error(`Branch labels must be numbers or strings.`);if(typeof e==`number`&&Math.abs(e)>2**53-1)return l.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof e==`number`&&Math.floor(e)!==e)return l.error(`Numeric branch labels must be integer values.`);if(!r)r=Kp(e);else if(l.checkSubtype(r,Kp(e)))return null;if(a[String(e)]!==void 0)return l.error(`Branch labels must be unique.`);a[String(e)]=o.length}let u=n.parse(c,e,i);if(!u)return null;i||=u.type,o.push(u)}let s=n.parse(t[1],1,X);if(!s)return null;let c=n.parse(t[t.length-1],t.length-1,i);return!c||s.type.kind!==`value`&&n.concat(1).checkSubtype(r,s.type)?null:new e(r,i,s,a,o,c)}evaluate(e){let t=this.input.evaluate(e);return(Kp(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()}},cm=class e{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(t,n){if(t.length<4)return n.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return n.error(`Expected an odd number of arguments.`);let r;n.expectedType&&n.expectedType.kind!==`value`&&(r=n.expectedType);let i=[];for(let e=1;e<t.length-1;e+=2){let a=n.parse(t[e],e,Y);if(!a)return null;let o=n.parse(t[e+1],e+1,r);if(!o)return null;i.push([a,o]),r||=o.type}let a=n.parse(t[t.length-1],t.length-1,r);if(!a)return null;if(!r)throw Error(`Can't infer output type`);return new e(r,i,a)}evaluate(e){for(let[t,n]of this.branches)if(t.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,n]of this.branches)e(t),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}},lm=class e{constructor(e,t,n,r){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=r}static parse(t,n){if(t.length<=2||t.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);let r=n.parse(t[1],1,X),i=n.parse(t[2],2,q);if(!r||!i)return null;if(!$f(r.type,[Yf(X),J,X]))return n.error(`Expected first argument to be of type array or string, but found ${Xf(r.type)} instead`);if(t.length===4){let a=n.parse(t[3],3,q);return a?new e(r.type,r,i,a):null}else return new e(r.type,r,i)}evaluate(e){let t=this.input.evaluate(e),n=this.beginIndex.evaluate(e),r;if(this.endIndex&&(r=this.endIndex.evaluate(e)),ep(t,[`string`]))return[...t].slice(n,r).join(``);if(ep(t,[`array`]))return t.slice(n,r);throw new zp(`Expected first argument to be of type array or string, but found ${Xf(Kp(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function um(e,t){let n=e.length-1,r=0,i=n,a=0,o,s;for(;r<=i;)if(a=Math.floor((r+i)/2),o=e[a],s=e[a+1],o<=t){if(a===n||t<s)return a;r=a+1}else if(o>t)i=a-1;else throw new zp(`Input is not a number.`);return 0}var dm=class e{constructor(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(let[e,t]of n)this.labels.push(e),this.outputs.push(t)}static parse(t,n){if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error(`Expected an even number of arguments.`);let r=n.parse(t[1],1,q);if(!r)return null;let i=[],a=null;n.expectedType&&n.expectedType.kind!==`value`&&(a=n.expectedType);for(let e=1;e<t.length;e+=2){let r=e===1?-1/0:t[e],o=t[e+1],s=e,c=e+1;if(typeof r!=`number`)return n.error(`Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,s);if(i.length&&i[i.length-1][0]>=r)return n.error(`Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.`,s);let l=n.parse(o,c,a);if(!l)return null;a||=l.type,i.push([r,l])}return new e(a,r,i)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);let i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[um(t,r)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function fm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var pm,mm;function hm(){if(mm)return pm;mm=1,pm=e;function e(e,t,n,r){this.cx=3*e,this.bx=3*(n-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=n,this.p2y=r}return e.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 n=e,r=0;r<8;r++){var i=this.sampleCurveX(n)-e;if(Math.abs(i)<t)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n-=i/a}var o=0,s=1;for(n=e,r=0;r<20&&(i=this.sampleCurveX(n),!(Math.abs(i-e)<t));r++)e>i?o=n:s=n,n=(s-o)*.5+o;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},pm}var gm=fm(hm()),_m=class e{constructor(e,t,n,r,i){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(let[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,n,r){let i=0;if(e.name===`exponential`)i=vm(t,e.base,n,r);else if(e.name===`linear`)i=vm(t,1,n,r);else if(e.name===`cubic-bezier`){let a=e.controlPoints;i=new gm(a[0],a[1],a[2],a[3]).solve(vm(t,1,n,r))}return i}static parse(t,n){let[r,i,a,...o]=t;if(!Array.isArray(i)||i.length===0)return n.error(`Expected an interpolation type expression.`,1);if(i[0]===`linear`)i={name:`linear`};else if(i[0]===`exponential`){let e=i[1];if(typeof e!=`number`)return n.error(`Exponential interpolation requires a numeric base.`,1,1);i={name:`exponential`,base:e}}else if(i[0]===`cubic-bezier`){let e=i.slice(1);if(e.length!==4||e.some(e=>typeof e!=`number`||e<0||e>1))return n.error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.`,1);i={name:`cubic-bezier`,controlPoints:e}}else return n.error(`Unknown interpolation type ${String(i[0])}`,1,0);if(t.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return n.error(`Expected an even number of arguments.`);if(a=n.parse(a,2,q),!a)return null;let s=[],c=null;(r===`interpolate-hcl`||r===`interpolate-lab`)&&n.expectedType!=Gf?c=Rf:n.expectedType&&n.expectedType.kind!==`value`&&(c=n.expectedType);for(let e=0;e<o.length;e+=2){let t=o[e],r=o[e+1],i=e+3,a=e+4;if(typeof t!=`number`)return n.error(`Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,i);if(s.length&&s[s.length-1][0]>=t)return n.error(`Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.`,i);let l=n.parse(r,a,c);if(!l)return null;c||=l.type,s.push([t,l])}return!tp(c,q)&&!tp(c,zf)&&!tp(c,Rf)&&!tp(c,Wf)&&!tp(c,Kf)&&!tp(c,Gf)&&!tp(c,Jf)&&!tp(c,Yf(q))?n.error(`Type ${Xf(c)} is not interpolatable.`):new e(c,r,i,a,s)}evaluate(t){let n=this.labels,r=this.outputs;if(n.length===1)return r[0].evaluate(t);let i=this.input.evaluate(t);if(i<=n[0])return r[0].evaluate(t);let a=n.length;if(i>=n[a-1])return r[a-1].evaluate(t);let o=um(n,i),s=n[o],c=n[o+1],l=e.interpolationFactor(this.interpolation,i,s,c),u=r[o].evaluate(t),d=r[o+1].evaluate(t);switch(this.operator){case`interpolate`:switch(this.type.kind){case`number`:return kp(u,d,l);case`color`:return jp.interpolate(u,d,l);case`padding`:return Ip.interpolate(u,d,l);case`colorArray`:return Rp.interpolate(u,d,l);case`numberArray`:return Lp.interpolate(u,d,l);case`variableAnchorOffsetCollection`:return Vp.interpolate(u,d,l);case`array`:return Ap(u,d,l);case`projectionDefinition`:return Up.interpolate(u,d,l)}case`interpolate-hcl`:switch(this.type.kind){case`color`:return jp.interpolate(u,d,l,`hcl`);case`colorArray`:return Rp.interpolate(u,d,l,`hcl`)}case`interpolate-lab`:switch(this.type.kind){case`color`:return jp.interpolate(u,d,l,`lab`);case`colorArray`:return Rp.interpolate(u,d,l,`lab`)}}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function vm(e,t,n,r){let i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}jp.interpolate,Ip.interpolate,Lp.interpolate,Rp.interpolate,Vp.interpolate;var ym=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=null,i=n.expectedType;i&&i.kind!==`value`&&(r=i);let a=[];for(let e of t.slice(1)){let t=n.parse(e,1+a.length,r,void 0,{typeAnnotation:`omit`});if(!t)return null;r||=t.type,a.push(t)}if(!r)throw Error(`No output type`);return i&&a.some(e=>Qf(i,e.type))?new e(X,a):new e(r,a)}evaluate(e){let t=null,n=0,r;for(let i of this.args)if(n++,t=i.evaluate(e),t&&t instanceof Hp&&!t.available&&(r||=t.name,t=null,n===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 bm(e,t){return e===`==`||e===`!=`?t.kind===`boolean`||t.kind===`string`||t.kind===`number`||t.kind===`null`||t.kind===`value`:t.kind===`string`||t.kind===`number`||t.kind===`value`}function xm(e,t,n){return t===n}function Sm(e,t,n){return t!==n}function Cm(e,t,n){return t<n}function wm(e,t,n){return t>n}function Tm(e,t,n){return t<=n}function Em(e,t,n){return t>=n}function Dm(e,t,n,r){return r.compare(t,n)===0}function Om(e,t,n,r){return!Dm(e,t,n,r)}function km(e,t,n,r){return r.compare(t,n)<0}function Am(e,t,n,r){return r.compare(t,n)>0}function jm(e,t,n,r){return r.compare(t,n)<=0}function Mm(e,t,n,r){return r.compare(t,n)>=0}function Nm(e,t,n){let r=e!==`==`&&e!==`!=`;return class i{constructor(e,t,n){this.type=Y,this.lhs=e,this.rhs=t,this.collator=n,this.hasUntypedArgument=e.type.kind===`value`||t.type.kind===`value`}static parse(e,t){if(e.length!==3&&e.length!==4)return t.error(`Expected two or three arguments.`);let n=e[0],a=t.parse(e[1],1,X);if(!a)return null;if(!bm(n,a.type))return t.concat(1).error(`"${n}" comparisons are not supported for type '${Xf(a.type)}'.`);let o=t.parse(e[2],2,X);if(!o)return null;if(!bm(n,o.type))return t.concat(2).error(`"${n}" comparisons are not supported for type '${Xf(o.type)}'.`);if(a.type.kind!==o.type.kind&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot compare types '${Xf(a.type)}' and '${Xf(o.type)}'.`);r&&(a.type.kind===`value`&&o.type.kind!==`value`?a=new Xp(o.type,[a]):a.type.kind!==`value`&&o.type.kind===`value`&&(o=new Xp(a.type,[o])));let s=null;if(e.length===4){if(a.type.kind!==`string`&&o.type.kind!==`string`&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot use collator to compare non-string types.`);if(s=t.parse(e[3],3,Hf),!s)return null}return new i(a,o,s)}evaluate(i){let a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){let t=Kp(a),n=Kp(o);if(t.kind!==n.kind||!(t.kind===`string`||t.kind===`number`))throw new zp(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${n.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){let e=Kp(a),n=Kp(o);if(e.kind!==`string`||n.kind!==`string`)return t(i,a,o)}return this.collator?n(i,a,o,this.collator.evaluate(i)):t(i,a,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}var Pm=Nm(`==`,xm,Dm),Fm=Nm(`!=`,Sm,Om),Im=Nm(`<`,Cm,km),Lm=Nm(`>`,wm,Am),Rm=Nm(`<=`,Tm,jm),zm=Nm(`>=`,Em,Mm),Bm=class e{constructor(e,t,n){this.type=Hf,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,n){if(t.length!==2)return n.error(`Expected one argument.`);let r=t[1];if(typeof r!=`object`||Array.isArray(r))return n.error(`Collator options argument must be an object.`);let i=n.parse(r[`case-sensitive`]===void 0?!1:r[`case-sensitive`],1,Y);if(!i)return null;let a=n.parse(r[`diacritic-sensitive`]===void 0?!1:r[`diacritic-sensitive`],1,Y);if(!a)return null;let o=null;return r.locale&&(o=n.parse(r.locale,1,J),!o)?null:new e(i,a,o)}evaluate(e){return new Mp(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}},Vm=class e{constructor(e,t,n,r,i){this.type=J,this.number=e,this.locale=t,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i}static parse(t,n){if(t.length!==3)return n.error(`Expected two arguments.`);let r=n.parse(t[1],1,q);if(!r)return null;let i=t[2];if(typeof i!=`object`||Array.isArray(i))return n.error(`NumberFormat options argument must be an object.`);let a=null;if(i.locale&&(a=n.parse(i.locale,1,J),!a))return null;let o=null;if(i.currency&&(o=n.parse(i.currency,1,J),!o))return null;let s=null;if(i[`min-fraction-digits`]&&(s=n.parse(i[`min-fraction-digits`],1,q),!s))return null;let c=null;return i[`max-fraction-digits`]&&(c=n.parse(i[`max-fraction-digits`],1,q),!c)?null:new e(r,a,o,s,c)}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}},Hm=class e{constructor(e){this.type=Uf,this.sections=e}static parse(t,n){if(t.length<2)return n.error(`Expected at least one argument.`);let r=t[1];if(!Array.isArray(r)&&typeof r==`object`)return n.error(`First argument must be an image or text section.`);let i=[],a=!1;for(let e=1;e<=t.length-1;++e){let r=t[e];if(a&&typeof r==`object`&&!Array.isArray(r)){a=!1;let e=null;if(r[`font-scale`]&&(e=n.parse(r[`font-scale`],1,q),!e))return null;let t=null;if(r[`text-font`]&&(t=n.parse(r[`text-font`],1,Yf(J)),!t))return null;let o=null;if(r[`text-color`]&&(o=n.parse(r[`text-color`],1,Rf),!o))return null;let s=null;if(r[`vertical-align`]){if(typeof r[`vertical-align`]==`string`&&!Np.includes(r[`vertical-align`]))return n.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${r[`vertical-align`]}' instead.`);if(s=n.parse(r[`vertical-align`],1,J),!s)return null}let c=i[i.length-1];c.scale=e,c.font=t,c.textColor=o,c.verticalAlign=s}else{let r=n.parse(t[e],1,X);if(!r)return null;let o=r.type.kind;if(o!==`string`&&o!==`value`&&o!==`null`&&o!==`resolvedImage`)return n.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);a=!0,i.push({content:r,scale:null,font:null,textColor:null,verticalAlign:null})}}return new e(i)}evaluate(e){return new Fp(this.sections.map(t=>{let n=t.content.evaluate(e);return Kp(n)===qf?new Pp(``,n,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Pp(qp(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(`,`):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let 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}},Um=class e{constructor(e){this.type=qf,this.input=e}static parse(t,n){if(t.length!==2)return n.error(`Expected two arguments.`);let r=n.parse(t[1],1,J);return r?new e(r):n.error(`No image name provided.`)}evaluate(e){let t=this.input.evaluate(e),n=Hp.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},Wm=class e{constructor(e){this.type=q,this.input=e}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=n.parse(t[1],1);return r?r.type.kind!==`array`&&r.type.kind!==`string`&&r.type.kind!==`value`?n.error(`Expected argument of type string or array, but found ${Xf(r.type)} instead.`):new e(r):null}evaluate(e){let t=this.input.evaluate(e);if(typeof t==`string`)return[...t].length;if(Array.isArray(t))return t.length;throw new zp(`Expected value to be of type string or array, but found ${Xf(Kp(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}},Gm=8192;function Km(e,t){let n=Jm(e[0]),r=Xm(e[1]),i=2**t.z;return[Math.round(n*i*Gm),Math.round(r*i*Gm)]}function qm(e,t){let n=2**t.z,r=(e[0]/Gm+t.x)/n,i=(e[1]/Gm+t.y)/n;return[Ym(r),Zm(i)]}function Jm(e){return(180+e)/360}function Ym(e){return e*360-180}function Xm(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Zm(e){return 360/Math.PI*Math.atan(Math.exp((180-e*360)*Math.PI/180))-90}function Qm(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function $m(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function eh(e,t,n){return t[1]>e[1]!=n[1]>e[1]&&e[0]<(n[0]-t[0])*(e[1]-t[1])/(n[1]-t[1])+t[0]}function th(e,t,n){let r=e[0]-t[0],i=e[1]-t[1],a=e[0]-n[0],o=e[1]-n[1];return r*o-a*i===0&&r*a<=0&&i*o<=0}function nh(e,t,n,r){let i=[t[0]-e[0],t[1]-e[1]];return ch([r[0]-n[0],r[1]-n[1]],i)===0?!1:!!(lh(e,t,n,r)&&lh(n,r,e,t))}function rh(e,t,n){for(let r of n)for(let n=0;n<r.length-1;++n)if(nh(e,t,r[n],r[n+1]))return!0;return!1}function ih(e,t,n=!1){let r=!1;for(let i of t)for(let t=0;t<i.length-1;t++){if(th(e,i[t],i[t+1]))return n;eh(e,i[t],i[t+1])&&(r=!r)}return r}function ah(e,t){for(let n of t)if(ih(e,n))return!0;return!1}function oh(e,t){for(let n of e)if(!ih(n,t))return!1;for(let n=0;n<e.length-1;++n)if(rh(e[n],e[n+1],t))return!1;return!0}function sh(e,t){for(let n of t)if(oh(e,n))return!0;return!1}function ch(e,t){return e[0]*t[1]-e[1]*t[0]}function lh(e,t,n,r){let i=e[0]-n[0],a=e[1]-n[1],o=t[0]-n[0],s=t[1]-n[1],c=r[0]-n[0],l=r[1]-n[1],u=i*l-c*a,d=o*l-c*s;return u>0&&d<0||u<0&&d>0}function uh(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=[];for(let r=0;r<e[i].length;r++){let o=Km(e[i][r],n);Qm(t,o),a.push(o)}r.push(a)}return r}function dh(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=uh(e[i],t,n);r.push(a)}return r}function fh(e,t,n,r){if(e[0]<n[0]||e[0]>n[2]){let t=r*.5,i=e[0]-n[0]>t?-r:n[0]-e[0]>t?r:0;i===0&&(i=e[0]-n[2]>t?-r:n[2]-e[0]>t?r:0),e[0]+=i}Qm(t,e)}function ph(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function mh(e,t,n,r){let i=2**r.z*Gm,a=[r.x*Gm,r.y*Gm],o=[];for(let r of e)for(let e of r){let r=[e.x+a[0],e.y+a[1]];fh(r,t,n,i),o.push(r)}return o}function hh(e,t,n,r){let i=2**r.z*Gm,a=[r.x*Gm,r.y*Gm],o=[];for(let n of e){let e=[];for(let r of n){let n=[r.x+a[0],r.y+a[1]];Qm(t,n),e.push(n)}o.push(e)}if(t[2]-t[0]<=i/2){ph(t);for(let e of o)for(let r of e)fh(r,t,n,i)}return o}function gh(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=uh(t.coordinates,r,i),o=mh(e.geometry(),n,r,i);if(!$m(n,r))return!1;for(let e of o)if(!ih(e,a))return!1}if(t.type===`MultiPolygon`){let a=dh(t.coordinates,r,i),o=mh(e.geometry(),n,r,i);if(!$m(n,r))return!1;for(let e of o)if(!ah(e,a))return!1}return!0}function _h(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=uh(t.coordinates,r,i),o=hh(e.geometry(),n,r,i);if(!$m(n,r))return!1;for(let e of o)if(!oh(e,a))return!1}if(t.type===`MultiPolygon`){let a=dh(t.coordinates,r,i),o=hh(e.geometry(),n,r,i);if(!$m(n,r))return!1;for(let e of o)if(!sh(e,a))return!1}return!0}var vh=class e{constructor(e,t){this.type=Y,this.geojson=e,this.geometries=t}static parse(t,n){if(t.length!==2)return n.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Gp(t[1])){let n=t[1];if(n.type===`FeatureCollection`){let t=[];for(let e of n.features){let{type:n,coordinates:r}=e.geometry;n===`Polygon`&&t.push(r),n===`MultiPolygon`&&t.push(...r)}if(t.length)return new e(n,{type:`MultiPolygon`,coordinates:t})}else if(n.type===`Feature`){let t=n.geometry.type;if(t===`Polygon`||t===`MultiPolygon`)return new e(n,n.geometry)}else if(n.type===`Polygon`||n.type===`MultiPolygon`)return new e(n,n)}return n.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 gh(e,this.geometries);if(e.geometryType()===`LineString`)return _h(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},yh=class{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let 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){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=(e<<1)+1,a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}};function bh(e,t,n=0,r=e.length-1,i=Sh){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);bh(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(xh(e,n,t),i(e[r],a)>0&&xh(e,n,r);o<s;){for(xh(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?xh(e,n,s):(s++,xh(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function xh(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Sh(e,t){return e<t?-1:e>t?1:0}function Ch(e,t){if(e.length<=1)return[e];let n=[],r,i;for(let t of e){let e=Th(t);e!==0&&(t.area=Math.abs(e),i===void 0&&(i=e<0),i===e<0?(r&&n.push(r),r=[t]):r.push(t))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(bh(n[e],t,1,n[e].length-1,wh),n[e]=n[e].slice(0,t));return n}function wh(e,t){return t.area-e.area}function Th(e){let t=0;for(let n=0,r=e.length,i=r-1,a,o;n<r;i=n++)a=e[n],o=e[i],t+=(o.x-a.x)*(a.y+o.y);return t}var Eh=6378.137,Dh=1/298.257223563,Oh=Dh*(2-Dh),kh=Math.PI/180,Ah=class{constructor(e){let t=kh*Eh*1e3,n=Math.cos(e*kh),r=1/(1-Oh*(1-n*n)),i=Math.sqrt(r);this.kx=t*i*n,this.ky=t*i*r*(1-Oh)}distance(e,t){let n=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(n*n+r*r)}pointOnLine(e,t){let n=1/0,r,i,a,o;for(let s=0;s<e.length-1;s++){let c=e[s][0],l=e[s][1],u=this.wrap(e[s+1][0]-c)*this.kx,d=(e[s+1][1]-l)*this.ky,f=0;(u!==0||d!==0)&&(f=(this.wrap(t[0]-c)*this.kx*u+(t[1]-l)*this.ky*d)/(u*u+d*d),f>1?(c=e[s+1][0],l=e[s+1][1]):f>0&&(c+=u/this.kx*f,l+=d/this.ky*f)),u=this.wrap(t[0]-c)*this.kx,d=(t[1]-l)*this.ky;let p=u*u+d*d;p<n&&(n=p,r=c,i=l,a=s,o=f)}return{point:[r,i],index:a,t:Math.max(0,Math.min(1,o))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}},jh=100,Mh=50;function Nh(e,t){return t[0]-e[0]}function Ph(e){return e[1]-e[0]+1}function Fh(e,t){return e[1]>=e[0]&&e[1]<t}function Ih(e,t){if(e[0]>e[1])return[null,null];let n=Ph(e);if(t){if(n===2)return[e,null];let t=Math.floor(n/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(n===1)return[e,null];let r=Math.floor(n/2)-1;return[[e[0],e[0]+r],[e[0]+r+1,e[1]]]}function Lh(e,t){if(!Fh(t,e.length))return[1/0,1/0,-1/0,-1/0];let n=[1/0,1/0,-1/0,-1/0];for(let r=t[0];r<=t[1];++r)Qm(n,e[r]);return n}function Rh(e){let t=[1/0,1/0,-1/0,-1/0];for(let n of e)for(let e of n)Qm(t,e);return t}function zh(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Bh(e,t,n){if(!zh(e)||!zh(t))return NaN;let r=0,i=0;return e[2]<t[0]&&(r=t[0]-e[2]),e[0]>t[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),n.distance([0,0],[r,i])}function Vh(e,t,n){let r=n.pointOnLine(t,e);return n.distance(e,r.point)}function Hh(e,t,n,r,i){let a=Math.min(Vh(e,[n,r],i),Vh(t,[n,r],i)),o=Math.min(Vh(n,[e,t],i),Vh(r,[e,t],i));return Math.min(a,o)}function Uh(e,t,n,r,i){if(!(Fh(t,e.length)&&Fh(r,n.length)))return 1/0;let a=1/0;for(let o=t[0];o<t[1];++o){let t=e[o],s=e[o+1];for(let e=r[0];e<r[1];++e){let r=n[e],o=n[e+1];if(nh(t,s,r,o))return 0;a=Math.min(a,Hh(t,s,r,o,i))}}return a}function Wh(e,t,n,r,i){if(!(Fh(t,e.length)&&Fh(r,n.length)))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let t=r[0];t<=r[1];++t)if(a=Math.min(a,i.distance(e[o],n[t])),a===0)return a;return a}function Gh(e,t,n){if(ih(e,t,!0))return 0;let r=1/0;for(let i of t){let t=i[0],a=i[i.length-1];if(t!==a&&(r=Math.min(r,Vh(e,[a,t],n)),r===0))return r;let o=n.pointOnLine(i,e);if(r=Math.min(r,n.distance(e,o.point)),r===0)return r}return r}function Kh(e,t,n,r){if(!Fh(t,e.length))return NaN;for(let r=t[0];r<=t[1];++r)if(ih(e[r],n,!0))return 0;let i=1/0;for(let a=t[0];a<t[1];++a){let t=e[a],o=e[a+1];for(let e of n)for(let n=0,a=e.length,s=a-1;n<a;s=n++){let a=e[s],c=e[n];if(nh(t,o,a,c))return 0;i=Math.min(i,Hh(t,o,a,c,r))}}return i}function qh(e,t){for(let n of e)for(let e of n)if(ih(e,t,!0))return!0;return!1}function Jh(e,t,n,r=1/0){let i=Rh(e),a=Rh(t);if(r!==1/0&&Bh(i,a,n)>=r)return r;if($m(i,a)){if(qh(e,t))return 0}else if(qh(t,e))return 0;let o=1/0;for(let r of e)for(let e=0,i=r.length,a=i-1;e<i;a=e++){let i=r[a],s=r[e];for(let e of t)for(let t=0,r=e.length,a=r-1;t<r;a=t++){let r=e[a],c=e[t];if(nh(i,s,r,c))return 0;o=Math.min(o,Hh(i,s,r,c,n))}}return o}function Yh(e,t,n,r,i,a){if(!a)return;let o=Bh(Lh(r,a),i,n);o<t&&e.push([o,a,[0,0]])}function Xh(e,t,n,r,i,a,o){if(!a||!o)return;let s=Bh(Lh(r,a),Lh(i,o),n);s<t&&e.push([s,a,o])}function Zh(e,t,n,r,i=1/0){let a=Math.min(r.distance(e[0],n[0][0]),i);if(a===0)return a;let o=new yh([[0,[0,e.length-1],[0,0]]],Nh),s=Rh(n);for(;o.length>0;){let i=o.pop();if(i[0]>=a)continue;let c=i[1],l=t?Mh:jh;if(Ph(c)<=l){if(!Fh(c,e.length))return NaN;if(t){let t=Kh(e,c,n,r);if(isNaN(t)||t===0)return t;a=Math.min(a,t)}else for(let t=c[0];t<=c[1];++t){let i=Gh(e[t],n,r);if(a=Math.min(a,i),a===0)return 0}}else{let n=Ih(c,t);Yh(o,a,r,e,s,n[0]),Yh(o,a,r,e,s,n[1])}}return a}function Qh(e,t,n,r,i,a=1/0){let o=Math.min(a,i.distance(e[0],n[0]));if(o===0)return o;let s=new yh([[0,[0,e.length-1],[0,n.length-1]]],Nh);for(;s.length>0;){let a=s.pop();if(a[0]>=o)continue;let c=a[1],l=a[2],u=t?Mh:jh,d=r?Mh:jh;if(Ph(c)<=u&&Ph(l)<=d){if(!Fh(c,e.length)&&Fh(l,n.length))return NaN;let a;if(t&&r)a=Uh(e,c,n,l,i),o=Math.min(o,a);else if(t&&!r){let t=e.slice(c[0],c[1]+1);for(let e=l[0];e<=l[1];++e)if(a=Vh(n[e],t,i),o=Math.min(o,a),o===0)return o}else if(!t&&r){let t=n.slice(l[0],l[1]+1);for(let n=c[0];n<=c[1];++n)if(a=Vh(e[n],t,i),o=Math.min(o,a),o===0)return o}else a=Wh(e,c,n,l,i),o=Math.min(o,a)}else{let a=Ih(c,t),u=Ih(l,r);Xh(s,o,i,e,n,a[0],u[0]),Xh(s,o,i,e,n,a[0],u[1]),Xh(s,o,i,e,n,a[1],u[0]),Xh(s,o,i,e,n,a[1],u[1])}}return o}function $h(e,t){let n=e.geometry(),r=n.flat().map(t=>qm([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new Ah(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,Qh(r,!1,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,Qh(r,!1,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,Zh(r,!1,e.coordinates,i,a));break}if(a===0)return a}return a}function eg(e,t){let n=e.geometry(),r=n.flat().map(t=>qm([t.x,t.y],e.canonical));if(n.length===0)return NaN;let i=new Ah(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,Qh(r,!0,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,Qh(r,!0,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,Zh(r,!0,e.coordinates,i,a));break}if(a===0)return a}return a}function tg(e,t){let n=e.geometry();if(n.length===0||n[0].length===0)return NaN;let r=Ch(n,0).map(t=>t.map(t=>t.map(t=>qm([t.x,t.y],e.canonical)))),i=new Ah(r[0][0][0][1]),a=1/0;for(let e of t)for(let t of r){switch(e.type){case`Point`:a=Math.min(a,Zh([e.coordinates],!1,t,i,a));break;case`LineString`:a=Math.min(a,Zh(e.coordinates,!0,t,i,a));break;case`Polygon`:a=Math.min(a,Jh(t,e.coordinates,i,a));break}if(a===0)return a}return a}function ng(e){return e.type===`MultiPolygon`?e.coordinates.map(e=>({type:`Polygon`,coordinates:e})):e.type===`MultiLineString`?e.coordinates.map(e=>({type:`LineString`,coordinates:e})):e.type===`MultiPoint`?e.coordinates.map(e=>({type:`Point`,coordinates:e})):[e]}var rg=class e{constructor(e,t){this.type=q,this.geojson=e,this.geometries=t}static parse(t,n){if(t.length!==2)return n.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Gp(t[1])){let n=t[1];if(n.type===`FeatureCollection`)return new e(n,n.features.map(e=>ng(e.geometry)).flat());if(n.type===`Feature`)return new e(n,ng(n.geometry));if(`type`in n&&`coordinates`in n)return new e(n,ng(n))}return n.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 $h(e,this.geometries);if(e.geometryType()===`LineString`)return eg(e,this.geometries);if(e.geometryType()===`Polygon`)return tg(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},ig=class e{constructor(e){this.type=X,this.key=e}static parse(t,n){if(t.length!==2)return n.error(`Expected 1 argument, but found ${t.length-1} instead.`);let r=t[1];return r==null?n.error(`Global state property must be defined.`):typeof r==`string`?new e(r):n.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(e){let t=e.globals?.globalState;return!t||Object.keys(t).length===0?null:Sp(t,this.key)}eachChild(){}outputDefined(){return!1}},ag={"==":Pm,"!=":Fm,">":Lm,"<":Im,">=":zm,"<=":Rm,array:Xp,at:im,boolean:Xp,case:cm,coalesce:ym,collator:Bm,format:Hm,image:Um,in:am,"index-of":om,interpolate:_m,"interpolate-hcl":_m,"interpolate-lab":_m,length:Wm,let:nm,literal:Jp,match:sm,number:Xp,"number-format":Vm,object:Xp,slice:lm,step:dm,string:Xp,"to-boolean":Qp,"to-color":Qp,"to-number":Qp,"to-string":Qp,var:rm,within:vh,distance:rg,"global-state":ig},og=class e{constructor(e,t,n,r){this.name=e,this.type=t,this._evaluate=n,this.args=r}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,n){let r=t[0],i=e.definitions[r];if(!i)return n.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1),c=null;for(let[i,o]of s){c=new tm(n.registry,pg,n.path,null,n.scope);let s=[],l=!1;for(let e=1;e<t.length;e++){let n=t[e],r=Array.isArray(i)?i[e-1]:i.type,a=c.parse(n,1+s.length,r);if(!a){l=!0;break}s.push(a)}if(!l){if(Array.isArray(i)&&i.length!==s.length){c.error(`Expected ${i.length} arguments, but found ${s.length} instead.`);continue}for(let e=0;e<s.length;e++){let t=Array.isArray(i)?i[e]:i.type,n=s[e];c.concat(e+1).checkSubtype(t,n.type)}if(c.errors.length===0)return new e(r,a,o,s)}}if(s.length===1)n.errors.push(...c.errors);else{let e=(s.length?s:o).map(([e])=>fg(e)).join(` | `),r=[];for(let e=1;e<t.length;e++){let i=n.parse(t[e],1+r.length);if(!i)return null;r.push(Xf(i.type))}n.error(`Expected arguments of type ${e}, but found (${r.join(`, `)}) instead.`)}return null}static register(t,n){e.definitions=n;for(let r in n)t[r]=e}};function sg(e,[t,n,r,i]){t=t.evaluate(e),n=n.evaluate(e),r=r.evaluate(e);let a=i?i.evaluate(e):1,o=Wp(t,n,r,a);if(o)throw new zp(o);return new jp(t/255,n/255,r/255,a,!1)}function cg(e,t){return e in t}function lg(e,t){let n=t[e];return n===void 0?null:n}function ug(e,t,n,r){for(;n<=r;){let i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}function dg(e){return{type:e}}og.register(ag,{error:[Vf,[J],(e,[t])=>{throw new zp(t.evaluate(e))}],typeof:[J,[X],(e,[t])=>Xf(Kp(t.evaluate(e)))],"to-rgba":[Yf(q,4),[Rf],(e,[t])=>{let[n,r,i,a]=t.evaluate(e).rgb;return[n*255,r*255,i*255,a]}],rgb:[Rf,[q,q,q],sg],rgba:[Rf,[q,q,q,q],sg],has:{type:Y,overloads:[[[J],(e,[t])=>cg(t.evaluate(e),e.properties())],[[J,Bf],(e,[t,n])=>cg(t.evaluate(e),n.evaluate(e))]]},get:{type:X,overloads:[[[J],(e,[t])=>lg(t.evaluate(e),e.properties())],[[J,Bf],(e,[t,n])=>lg(t.evaluate(e),n.evaluate(e))]]},"feature-state":[X,[J],(e,[t])=>lg(t.evaluate(e),e.featureState||{})],properties:[Bf,[],e=>e.properties()],"geometry-type":[J,[],e=>e.geometryType()],id:[X,[],e=>e.id()],zoom:[q,[],e=>e.globals.zoom],"heatmap-density":[q,[],e=>e.globals.heatmapDensity||0],elevation:[q,[],e=>e.globals.elevation||0],"line-progress":[q,[],e=>e.globals.lineProgress||0],accumulated:[X,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[q,dg(q),(e,t)=>{let n=0;for(let r of t)n+=r.evaluate(e);return n}],"*":[q,dg(q),(e,t)=>{let n=1;for(let r of t)n*=r.evaluate(e);return n}],"-":{type:q,overloads:[[[q,q],(e,[t,n])=>t.evaluate(e)-n.evaluate(e)],[[q],(e,[t])=>-t.evaluate(e)]]},"/":[q,[q,q],(e,[t,n])=>t.evaluate(e)/n.evaluate(e)],"%":[q,[q,q],(e,[t,n])=>t.evaluate(e)%n.evaluate(e)],ln2:[q,[],()=>Math.LN2],pi:[q,[],()=>Math.PI],e:[q,[],()=>Math.E],"^":[q,[q,q],(e,[t,n])=>t.evaluate(e)**+n.evaluate(e)],sqrt:[q,[q],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[q,[q],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[q,[q],(e,[t])=>Math.log(t.evaluate(e))],log2:[q,[q],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[q,[q],(e,[t])=>Math.sin(t.evaluate(e))],cos:[q,[q],(e,[t])=>Math.cos(t.evaluate(e))],tan:[q,[q],(e,[t])=>Math.tan(t.evaluate(e))],asin:[q,[q],(e,[t])=>Math.asin(t.evaluate(e))],acos:[q,[q],(e,[t])=>Math.acos(t.evaluate(e))],atan:[q,[q],(e,[t])=>Math.atan(t.evaluate(e))],min:[q,dg(q),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[q,dg(q),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[q,[q],(e,[t])=>Math.abs(t.evaluate(e))],round:[q,[q],(e,[t])=>{let n=t.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[q,[q],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[q,[q],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[Y,[J,X],(e,[t,n])=>e.properties()[t.value]===n.value],"filter-id-==":[Y,[X],(e,[t])=>e.id()===t.value],"filter-type-==":[Y,[J],(e,[t])=>e.geometryType()===t.value],"filter-<":[Y,[J,X],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<i}],"filter-id-<":[Y,[X],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<r}],"filter->":[Y,[J,X],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>i}],"filter-id->":[Y,[X],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>r}],"filter-<=":[Y,[J,X],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[Y,[X],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<=r}],"filter->=":[Y,[J,X],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[Y,[X],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>=r}],"filter-has":[Y,[X],(e,[t])=>t.value in e.properties()],"filter-has-id":[Y,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[Y,[Yf(J)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[Y,[Yf(X)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[Y,[J,Yf(X)],(e,[t,n])=>n.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[Y,[J,Yf(X)],(e,[t,n])=>ug(e.properties()[t.value],n.value,0,n.value.length-1)],all:{type:Y,overloads:[[[Y,Y],(e,[t,n])=>t.evaluate(e)&&n.evaluate(e)],[dg(Y),(e,t)=>{for(let n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:Y,overloads:[[[Y,Y],(e,[t,n])=>t.evaluate(e)||n.evaluate(e)],[dg(Y),(e,t)=>{for(let n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[Y,[Y],(e,[t])=>!t.evaluate(e)],"is-supported-script":[Y,[J],(e,[t])=>{let n=e.globals&&e.globals.isSupportedScript;return n?n(t.evaluate(e)):!0}],upcase:[J,[J],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[J,[J],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[J,dg(X),(e,t)=>t.map(t=>qp(t.evaluate(e))).join(``)],"resolved-locale":[J,[Hf],(e,[t])=>t.evaluate(e).resolvedLocale()]});function fg(e){return Array.isArray(e)?`(${e.map(Xf).join(`, `)})`:`(${Xf(e.type)}...)`}function pg(e){if(e instanceof rm)return pg(e.boundExpression);if(e instanceof og&&e.name===`error`||e instanceof Bm||e instanceof vh||e instanceof rg||e instanceof ig)return!1;let t=e instanceof Qp||e instanceof Xp,n=!0;return e.eachChild(e=>{t?n&&=pg(e):n&&=e instanceof Jp}),n?mg(e)&&gg(e,[`zoom`,`heatmap-density`,`elevation`,`line-progress`,`accumulated`,`is-supported-script`]):!1}function mg(e){if(e instanceof og&&(e.name===`get`&&e.args.length===1||e.name===`feature-state`||e.name===`has`&&e.args.length===1||e.name===`properties`||e.name===`geometry-type`||e.name===`id`||/^filter-/.test(e.name))||e instanceof vh||e instanceof rg)return!1;let t=!0;return e.eachChild(e=>{t&&!mg(e)&&(t=!1)}),t}function hg(e){if(e instanceof og&&e.name===`feature-state`)return!1;let t=!0;return e.eachChild(e=>{t&&!hg(e)&&(t=!1)}),t}function gg(e,t){if(e instanceof og&&t.indexOf(e.name)>=0)return!1;let n=!0;return e.eachChild(e=>{n&&!gg(e,t)&&(n=!1)}),n}function _g(e){return{result:`success`,value:e}}function vg(e){return{result:`error`,value:e}}function yg(e){return e[`property-type`]===`data-driven`||e[`property-type`]===`cross-faded-data-driven`}function bg(e){return!!e.expression&&e.expression.parameters.indexOf(`zoom`)>-1}function xg(e){return!!e.expression&&e.expression.interpolated}function Z(e){return e instanceof Number?`number`:e instanceof String?`string`:e instanceof Boolean?`boolean`:Array.isArray(e)?`array`:e===null?`null`:typeof e}function Sg(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Kp(e)===Bf}var Cg=class{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new em,this._defaultValue=t?Mg(t):null,this._enumValues=t&&t.type===`enum`?t.values:null}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,r,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(e==null||typeof e==`number`&&e!==e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new zp(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(`, `)}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<`u`&&console.warn(e.message)),this._defaultValue}}};function wg(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`string`&&e[0]in ag}function Tg(e,t){let n=new tm(ag,pg,[],t?jg(t):void 0),r=n.parse(e,void 0,void 0,void 0,t&&t.type===`string`?{typeAnnotation:`coerce`}:void 0);return r?_g(new Cg(r,t)):vg(n.errors)}var Eg=class{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!==`constant`&&!hg(t.expression),this.globalStateRefs=Ag(t.expression)}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)}},Dg=class{constructor(e,t,n,r){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!==`camera`&&!hg(t.expression),this.globalStateRefs=Ag(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._styleExpression.evaluate(e,t,n,r,i,a)}interpolationFactor(e,t,n){return this.interpolationType?_m.interpolationFactor(this.interpolationType,e,t,n):0}};function Og(e,t){let n=Tg(e,t);if(n.result===`error`)return n;let r=n.value.expression,i=mg(r);if(!i&&!yg(t))return vg([new Ff(``,`data expressions not supported`)]);let a=gg(r,[`zoom`]);if(!a&&!bg(t))return vg([new Ff(``,`zoom expressions not supported`)]);let o=kg(r);if(!o&&!a)return vg([new Ff(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`)]);if(o instanceof Ff)return vg([o]);if(o instanceof _m&&!xg(t))return vg([new Ff(``,`"interpolate" expressions cannot be used with this property`)]);if(!o)return _g(i?new Eg(`constant`,n.value):new Eg(`source`,n.value));let s=o instanceof _m?o.interpolation:void 0;return _g(i?new Dg(`camera`,n.value,o.labels,s):new Dg(`composite`,n.value,o.labels,s))}function kg(e){let t=null;if(e instanceof nm)t=kg(e.result);else if(e instanceof ym){for(let n of e.args)if(t=kg(n),t)break}else (e instanceof dm||e instanceof _m)&&e.input instanceof og&&e.input.name===`zoom`&&(t=e);return t instanceof Ff||e.eachChild(e=>{let n=kg(e);n instanceof Ff?t=n:!t&&n?t=new Ff(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`):t&&n&&t!==n&&(t=new Ff(``,`Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.`))}),t}function Ag(e,t=new Set){return e instanceof ig&&t.add(e.key),e.eachChild(e=>{Ag(e,t)}),t}function jg(e){let t={color:Rf,string:J,number:q,enum:J,boolean:Y,formatted:Uf,padding:Wf,numberArray:Kf,colorArray:Gf,projectionDefinition:zf,resolvedImage:qf,variableAnchorOffsetCollection:Jf};return e.type===`array`?Yf(t[e.value]||X,e.length):t[e.type]}function Mg(e){if(e.type===`color`&&Sg(e.default))return new jp(0,0,0,0);switch(e.type){case`color`:return jp.parse(e.default)||null;case`padding`:return Ip.parse(e.default)||null;case`numberArray`:return Lp.parse(e.default)||null;case`colorArray`:return Rp.parse(e.default)||null;case`variableAnchorOffsetCollection`:return Vp.parse(e.default)||null;case`projectionDefinition`:return Up.parse(e.default)||null;default:return e.default===void 0?null:e.default}}function Ng(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case`has`:return e.length>=2&&e[1]!==`$id`&&e[1]!==`$type`;case`in`:return e.length>=3&&(typeof e[1]!=`string`||Array.isArray(e[2]));case`!in`:case`!has`:case`none`:return!1;case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case`any`:case`all`:for(let t of e.slice(1))if(!Ng(t)&&typeof t!=`boolean`)return!1;return!0;default:return!0}}var Pg={type:`boolean`,default:!1,transition:!1,"property-type":`data-driven`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]}};function Fg(e){if(e==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};Ng(e)||(e=Rg(e));let t=Tg(e,Pg);if(t.result===`error`)throw Error(t.value.map(e=>`${e.key}: ${e.message}`).join(`, `));return{filter:(e,n,r)=>t.value.evaluate(e,n,{},r),needGeometry:Lg(e),getGlobalStateRefs:()=>Ag(t.value.expression)}}function Ig(e,t){return e<t?-1:e>t?1:0}function Lg(e){if(!Array.isArray(e))return!1;if(e[0]===`within`||e[0]===`distance`)return!0;for(let t=1;t<e.length;t++)if(Lg(e[t]))return!0;return!1}function Rg(e){if(!e)return!0;let t=e[0];return e.length<=1?t!==`any`:t===`==`?zg(e[1],e[2],`==`):t===`!=`?Ug(zg(e[1],e[2],`==`)):t===`<`||t===`>`||t===`<=`||t===`>=`?zg(e[1],e[2],t):t===`any`?Bg(e.slice(1)):t===`all`?[`all`].concat(e.slice(1).map(Rg)):t===`none`?[`all`].concat(e.slice(1).map(Rg).map(Ug)):t===`in`?Vg(e[1],e.slice(2)):t===`!in`?Ug(Vg(e[1],e.slice(2))):t===`has`?Hg(e[1]):t===`!has`?Ug(Hg(e[1])):!0}function zg(e,t,n){switch(e){case`$type`:return[`filter-type-${n}`,t];case`$id`:return[`filter-id-${n}`,t];default:return[`filter-${n}`,e,t]}}function Bg(e){return[`any`].concat(e.map(Rg))}function Vg(e,t){if(t.length===0)return!1;switch(e){case`$type`:return[`filter-type-in`,[`literal`,t]];case`$id`:return[`filter-id-in`,[`literal`,t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?[`filter-in-large`,e,[`literal`,t.sort(Ig)]]:[`filter-in-small`,e,[`literal`,t]]}}function Hg(e){switch(e){case`$type`:return!0;case`$id`:return[`filter-has-id`];default:return[`filter-has`,e]}}function Ug(e){return[`!`,e]}function Wg(e){return typeof e==`object`?[`literal`,e]:e}function Gg(e,t){let n=e.stops;if(!n)return Kg(e,t);let r=n&&typeof n[0][0]==`object`,i=r||e.property!==void 0,a=r||!i;return n=n.map(e=>!i&&t.tokens&&typeof e[1]==`string`?[e[0],n_(e[1])]:[e[0],Wg(e[1])]),r?Jg(e,t,n):a?Qg(e,t,n):Zg(e,t,n)}function Kg(e,t){let n=[`get`,e.property];if(e.default===void 0)return t.type===`string`?[`string`,n]:n;if(t.type===`enum`)return[`match`,n,Object.keys(t.values),n,e.default];{let r=[t.type===`color`?`to-color`:t.type,n,Wg(e.default)];return t.type===`array`&&r.splice(1,0,t.value,t.length||null),r}}function qg(e){switch(e.colorSpace){case`hcl`:return`interpolate-hcl`;case`lab`:return`interpolate-lab`;default:return`interpolate`}}function Jg(e,t,n){let r={},i={},a=[];for(let t=0;t<n.length;t++){let o=n[t],s=o[0].zoom;r[s]===void 0&&(r[s]={zoom:s,type:e.type,property:e.property,default:e.default},i[s]=[],a.push(s)),i[s].push([o[0].value,o[1]])}if(t_({},t)===`exponential`){let n=[qg(e),[`linear`],[`zoom`]];for(let e of a)e_(n,e,Zg(r[e],t,i[e]),!1);return n}else{let e=[`step`,[`zoom`]];for(let n of a)e_(e,n,Zg(r[n],t,i[n]),!0);return $g(e),e}}function Yg(e,t){if(e!==void 0)return e;if(t!==void 0)return t}function Xg(e,t){let n=Wg(Yg(e.default,t.default));return n===void 0&&t.type===`resolvedImage`?``:n}function Zg(e,t,n){let r=t_(e,t),i=[`get`,e.property];if(r===`categorical`&&typeof n[0][0]==`boolean`){let r=[`case`];for(let e of n)r.push([`==`,i,e[0]],e[1]);return r.push(Xg(e,t)),r}else if(r===`categorical`){let r=[`match`,i];for(let e of n)e_(r,e[0],e[1],!1);return r.push(Xg(e,t)),r}else if(r===`interval`){let t=[`step`,[`number`,i]];for(let e of n)e_(t,e[0],e[1],!0);return $g(t),e.default===void 0?t:[`case`,[`==`,[`typeof`,i],`number`],t,Wg(e.default)]}else if(r===`exponential`){let t=e.base===void 0?1:e.base,r=[qg(e),t===1?[`linear`]:[`exponential`,t],[`number`,i]];for(let e of n)e_(r,e[0],e[1],!1);return e.default===void 0?r:[`case`,[`==`,[`typeof`,i],`number`],r,Wg(e.default)]}else throw Error(`Unknown property function type ${r}`)}function Qg(e,t,n,r=[`zoom`]){let i=t_(e,t),a,o=!1;if(i===`interval`)a=[`step`,r],o=!0;else if(i===`exponential`){let t=e.base===void 0?1:e.base;a=[qg(e),t===1?[`linear`]:[`exponential`,t],r]}else throw Error(`Unknown zoom function type "${i}"`);for(let e of n)e_(a,e[0],e[1],o);return $g(a),a}function $g(e){e[0]===`step`&&e.length===3&&(e.push(0),e.push(e[3]))}function e_(e,t,n,r){e.length>3&&t===e[e.length-2]||(r&&e.length===2||e.push(t),e.push(n))}function t_(e,t){return e.type?e.type:t.expression.interpolated?`exponential`:`interval`}function n_(e){let t=[`concat`],n=/{([^{}]+)}/g,r=0;for(let i=n.exec(e);i!==null;i=n.exec(e)){let a=e.slice(r,n.lastIndex-i[0].length);r=n.lastIndex,a.length>0&&t.push(a),t.push([`get`,i[1]])}if(t.length===1)return e;if(r<e.length)t.push(e.slice(r));else if(t.length===2)return[`to-string`,t[1]];return t}function r_(e){let t=e.key,n=e.value;return n?[new K(t,n,`constants have been deprecated as of v8`)]:[]}function i_(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function a_(e){if(Array.isArray(e))return e.map(a_);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let n in e)t[n]=a_(e[n]);return t}return i_(e)}function o_(e){let t=e.key,n=e.value,r=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec,c=[],l=Z(n);if(l!==`object`)return[new K(t,n,`object expected, ${l} found`)];for(let e in n){let l=e.split(`.`)[0],u=Sp(r,l)||r[`*`],d;if(Sp(i,l))d=i[l];else if(Sp(r,l))d=s;else if(i[`*`])d=i[`*`];else if(r[`*`])d=s;else{c.push(new K(t,n[e],`unknown property "${e}"`));continue}c=c.concat(d({key:(t&&`${t}.`)+e,value:n[e],valueSpec:u,style:a,styleSpec:o,object:n,objectKey:e,validateSpec:s},n))}for(let e in r)i[e]||r[e].required&&r[e].default===void 0&&n[e]===void 0&&c.push(new K(t,n,`missing required property "${e}"`));return c}function s_(e){let t=e.value,n=e.valueSpec,r=e.validateSpec,i=e.style,a=e.styleSpec,o=e.key,s=e.arrayElementValidator||r;if(Z(t)!==`array`)return[new K(o,t,`array expected, ${Z(t)} found`)];if(n.length&&t.length!==n.length)return[new K(o,t,`array length ${n.length} expected, length ${t.length} found`)];if(n[`min-length`]&&t.length<n[`min-length`])return[new K(o,t,`array length at least ${n[`min-length`]} expected, length ${t.length} found`)];let c={type:n.value,values:n.values};a.$version<7&&(c.function=n.function),Z(n.value)===`object`&&(c=n.value);let l=[];for(let n=0;n<t.length;n++)l=l.concat(s({array:t,arrayIndex:n,value:t[n],valueSpec:c,validateSpec:e.validateSpec,style:i,styleSpec:a,key:`${o}[${n}]`}));return l}function c_(e){let t=e.key,n=e.value,r=e.valueSpec,i=Z(n);return i===`number`&&n!==n&&(i=`NaN`),i===`number`?`minimum`in r&&n<r.minimum?[new K(t,n,`${n} is less than the minimum value ${r.minimum}`)]:`maximum`in r&&n>r.maximum?[new K(t,n,`${n} is greater than the maximum value ${r.maximum}`)]:[]:[new K(t,n,`number expected, ${i} found`)]}function l_(e){let t=e.valueSpec,n=i_(e.value.type),r,i={},a,o,s=n!==`categorical`&&e.value.property===void 0,c=!s,l=Z(e.value.stops)===`array`&&Z(e.value.stops[0])===`array`&&Z(e.value.stops[0][0])===`object`,u=o_({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:d,default:m}});return n===`identity`&&s&&u.push(new K(e.key,e.value,`missing required property "property"`)),n!==`identity`&&!e.value.stops&&u.push(new K(e.key,e.value,`missing required property "stops"`)),n===`exponential`&&e.valueSpec.expression&&!xg(e.valueSpec)&&u.push(new K(e.key,e.value,`exponential functions not supported`)),e.styleSpec.$version>=8&&(c&&!yg(e.valueSpec)?u.push(new K(e.key,e.value,`property functions not supported`)):s&&!bg(e.valueSpec)&&u.push(new K(e.key,e.value,`zoom functions not supported`))),(n===`categorical`||l)&&e.value.property===void 0&&u.push(new K(e.key,e.value,`"property" property is required`)),u;function d(e){if(n===`identity`)return[new K(e.key,e.value,`identity function may not have a "stops" property`)];let t=[],r=e.value;return t=t.concat(s_({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:f})),Z(r)===`array`&&r.length===0&&t.push(new K(e.key,r,`array must have at least one stop`)),t}function f(e){let n=[],r=e.value,s=e.key;if(Z(r)!==`array`)return[new K(s,r,`array expected, ${Z(r)} found`)];if(r.length!==2)return[new K(s,r,`array length 2 expected, length ${r.length} found`)];if(l){if(Z(r[0])!==`object`)return[new K(s,r,`object expected, ${Z(r[0])} found`)];if(r[0].zoom===void 0)return[new K(s,r,`object stop key must have zoom`)];if(r[0].value===void 0)return[new K(s,r,`object stop key must have value`)];if(o&&o>i_(r[0].zoom))return[new K(s,r[0].zoom,`stop zoom values must appear in ascending order`)];i_(r[0].zoom)!==o&&(o=i_(r[0].zoom),a=void 0,i={}),n=n.concat(o_({key:`${s}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:c_,value:p}}))}else n=n.concat(p({key:`${s}[0]`,value:r[0],validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},r));return wg(a_(r[1]))?n.concat([new K(`${s}[1]`,r[1],`expressions are not allowed in function stops.`)]):n.concat(e.validateSpec({key:`${s}[1]`,value:r[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function p(e,o){let s=Z(e.value),c=i_(e.value),l=e.value===null?o:e.value;if(!r)r=s;else if(s!==r)return[new K(e.key,l,`${s} stop domain type must match previous stop domain type ${r}`)];if(s!==`number`&&s!==`string`&&s!==`boolean`)return[new K(e.key,l,`stop domain value must be a number, string, or boolean`)];if(s!==`number`&&n!==`categorical`){let r=`number expected, ${s} found`;return yg(t)&&n===void 0&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new K(e.key,l,r)]}return n===`categorical`&&s===`number`&&(!isFinite(c)||Math.floor(c)!==c)?[new K(e.key,l,`integer expected, found ${c}`)]:n!==`categorical`&&s===`number`&&a!==void 0&&c<a?[new K(e.key,l,`stop domain values must appear in ascending order`)]:(a=c,n===`categorical`&&c in i?[new K(e.key,l,`stop domain values must be unique`)]:(i[c]=!0,[]))}function m(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}function u_(e){let t=(e.expressionContext===`property`?Og:Tg)(a_(e.value),e.valueSpec);if(t.result===`error`)return t.value.map(t=>new K(`${e.key}${t.key}`,e.value,t.message));let n=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext===`property`&&e.propertyKey===`text-font`&&!n.outputDefined())return[new K(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext===`property`&&e.propertyType===`layout`&&!hg(n))return[new K(e.key,e.value,`"feature-state" data expressions are not supported with layout properties.`)];if(e.expressionContext===`filter`&&!hg(n))return[new K(e.key,e.value,`"feature-state" data expressions are not supported with filters.`)];if(e.expressionContext&&e.expressionContext.indexOf(`cluster`)===0){if(!gg(n,[`zoom`,`feature-state`]))return[new K(e.key,e.value,`"zoom" and "feature-state" expressions are not supported with cluster properties.`)];if(e.expressionContext===`cluster-initial`&&!mg(n))return[new K(e.key,e.value,`Feature data expressions are not supported with initial expression part of cluster properties.`)]}return[]}function d_(e){let t=e.value,n=e.key,r=Z(t);return r===`boolean`?[]:[new K(n,t,`boolean expected, ${r} found`)]}function f_(e){let t=e.key,n=e.value,r=Z(n);return r===`string`?jp.parse(String(n))?[]:[new K(t,n,`color expected, "${n}" found`)]:[new K(t,n,`color expected, ${r} found`)]}function p_(e){let t=e.key,n=e.value,r=e.valueSpec,i=[];return Array.isArray(r.values)?r.values.indexOf(i_(n))===-1&&i.push(new K(t,n,`expected one of [${r.values.join(`, `)}], ${JSON.stringify(n)} found`)):Object.keys(r.values).indexOf(i_(n))===-1&&i.push(new K(t,n,`expected one of [${Object.keys(r.values).join(`, `)}], ${JSON.stringify(n)} found`)),i}function m_(e){return Ng(a_(e.value))?u_(Pf({},e,{expressionContext:`filter`,valueSpec:{value:`boolean`}})):h_(e)}function h_(e){let t=e.value,n=e.key;if(Z(t)!==`array`)return[new K(n,t,`array expected, ${Z(t)} found`)];let r=e.styleSpec,i,a=[];if(t.length<1)return[new K(n,t,`filter array must have at least 1 element`)];switch(a=a.concat(p_({key:`${n}[0]`,value:t[0],valueSpec:r.filter_operator,style:e.style,styleSpec:e.styleSpec})),i_(t[0])){case`<`:case`<=`:case`>`:case`>=`:t.length>=2&&i_(t[1])===`$type`&&a.push(new K(n,t,`"$type" cannot be use with operator "${t[0]}"`));case`==`:case`!=`:t.length!==3&&a.push(new K(n,t,`filter array for operator "${t[0]}" must have 3 elements`));case`in`:case`!in`:t.length>=2&&(i=Z(t[1]),i!==`string`&&a.push(new K(`${n}[1]`,t[1],`string expected, ${i} found`)));for(let o=2;o<t.length;o++)i=Z(t[o]),i_(t[1])===`$type`?a=a.concat(p_({key:`${n}[${o}]`,value:t[o],valueSpec:r.geometry_type,style:e.style,styleSpec:e.styleSpec})):i!==`string`&&i!==`number`&&i!==`boolean`&&a.push(new K(`${n}[${o}]`,t[o],`string, number, or boolean expected, ${i} found`));break;case`any`:case`all`:case`none`:for(let r=1;r<t.length;r++)a=a.concat(h_({key:`${n}[${r}]`,value:t[r],style:e.style,styleSpec:e.styleSpec}));break;case`has`:case`!has`:i=Z(t[1]),t.length===2?i!==`string`&&a.push(new K(`${n}[1]`,t[1],`string expected, ${i} found`)):a.push(new K(n,t,`filter array for "${t[0]}" operator must have 2 elements`));break}return a}function g_(e,t){let n=e.key,r=e.validateSpec,i=e.style,a=e.styleSpec,o=e.value,s=e.objectKey,c=a[`${t}_${e.layerType}`];if(!c)return[];let l=s.match(/^(.*)-transition$/);if(t===`paint`&&l&&c[l[1]]&&c[l[1]].transition)return r({key:n,value:o,valueSpec:a.transition,style:i,styleSpec:a});let u=e.valueSpec||c[s];if(!u)return[new K(n,o,`unknown property "${s}"`)];let d;if(Z(o)===`string`&&yg(u)&&!u.tokens&&(d=/^{([^}]+)}$/.exec(o)))return[new K(n,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(d[1])} }\`.`)];let f=[];return e.layerType===`symbol`&&(s===`text-field`&&i&&!i.glyphs&&f.push(new K(n,o,`use of "text-field" requires a style "glyphs" property`)),s===`text-font`&&Sg(a_(o))&&i_(o.type)===`identity`&&f.push(new K(n,o,`"text-font" does not support identity functions`))),f.concat(r({key:e.key,value:o,valueSpec:u,style:i,styleSpec:a,expressionContext:`property`,propertyType:t,propertyKey:s}))}function __(e){return g_(e,`paint`)}function v_(e){return g_(e,`layout`)}function y_(e){let t=[],n=e.value,r=e.key,i=e.style,a=e.styleSpec;if(Z(n)!==`object`)return[new K(r,n,`object expected, ${Z(n)} found`)];!n.type&&!n.ref&&t.push(new K(r,n,`either "type" or "ref" is required`));let o=i_(n.type),s=i_(n.ref);if(n.id){let a=i_(n.id);for(let o=0;o<e.arrayIndex;o++){let e=i.layers[o];i_(e.id)===a&&t.push(new K(r,n.id,`duplicate layer id "${n.id}", previously used at line ${e.id.__line__}`))}}if(`ref`in n){[`type`,`source`,`source-layer`,`filter`,`layout`].forEach(e=>{e in n&&t.push(new K(r,n[e],`"${e}" is prohibited for ref layers`))});let e;i.layers.forEach(t=>{i_(t.id)===s&&(e=t)}),e?e.ref?t.push(new K(r,n.ref,`ref cannot reference another ref layer`)):o=i_(e.type):t.push(new K(r,n.ref,`ref layer "${s}" not found`))}else if(o!==`background`)if(!n.source)t.push(new K(r,n,`missing required property "source"`));else{let e=i.sources&&i.sources[n.source],a=e&&i_(e.type);e?a===`vector`&&o===`raster`?t.push(new K(r,n.source,`layer "${n.id}" requires a raster source`)):a!==`raster-dem`&&o===`hillshade`||a!==`raster-dem`&&o===`color-relief`?t.push(new K(r,n.source,`layer "${n.id}" requires a raster-dem source`)):a===`raster`&&o!==`raster`?t.push(new K(r,n.source,`layer "${n.id}" requires a vector source`)):a===`vector`&&!n[`source-layer`]?t.push(new K(r,n,`layer "${n.id}" must specify a "source-layer"`)):a===`raster-dem`&&o!==`hillshade`&&o!==`color-relief`?t.push(new K(r,n.source,`raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.`)):o===`line`&&n.paint&&n.paint[`line-gradient`]&&(a!==`geojson`||!e.lineMetrics)&&t.push(new K(r,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new K(r,n.source,`source "${n.source}" not found`))}return t=t.concat(o_({key:r,value:n,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:`${r}.type`,value:n.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:n,objectKey:`type`})},filter:m_,layout(e){return o_({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(e){return v_(Pf({layerType:o},e))}}})},paint(e){return o_({layer:n,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(e){return __(Pf({layerType:o},e))}}})}}})),t}function b_(e){let t=e.value,n=e.key,r=Z(t);return r===`string`?[]:[new K(n,t,`string expected, ${r} found`)]}function x_(e){let t=e.sourceName??``,n=e.value,r=e.styleSpec,i=r.source_raster_dem,a=e.style,o=[],s=Z(n);if(n===void 0)return o;if(s!==`object`)return o.push(new K(`source_raster_dem`,n,`object expected, ${s} found`)),o;let c=i_(n.encoding)===`custom`,l=[`redFactor`,`greenFactor`,`blueFactor`,`baseShift`],u=e.value.encoding?`"${e.value.encoding}"`:`Default`;for(let s in n)!c&&l.includes(s)?o.push(new K(s,n[s],`In "${t}": "${s}" is only valid when "encoding" is set to "custom". ${u} encoding found`)):i[s]?o=o.concat(e.validateSpec({key:s,value:n[s],valueSpec:i[s],validateSpec:e.validateSpec,style:a,styleSpec:r})):o.push(new K(s,n[s],`unknown property "${s}"`));return o}var S_={promoteId:w_};function C_(e){let t=e.value,n=e.key,r=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new K(n,t,`"type" is required`)];let o=i_(t.type),s;switch(o){case`vector`:case`raster`:return s=o_({key:n,value:t,valueSpec:r[`source_${o.replace(`-`,`_`)}`],style:e.style,styleSpec:r,objectElementValidators:S_,validateSpec:a}),s;case`raster-dem`:return s=x_({sourceName:n,value:t,style:e.style,styleSpec:r,validateSpec:a}),s;case`geojson`:if(s=o_({key:n,value:t,valueSpec:r.source_geojson,style:i,styleSpec:r,validateSpec:a,objectElementValidators:S_}),t.cluster)for(let e in t.clusterProperties){let[r,i]=t.clusterProperties[e],a=typeof r==`string`?[r,[`accumulated`],[`get`,e]]:r;s.push(...u_({key:`${n}.${e}.map`,value:i,expressionContext:`cluster-map`})),s.push(...u_({key:`${n}.${e}.reduce`,value:a,expressionContext:`cluster-reduce`}))}return s;case`video`:return o_({key:n,value:t,valueSpec:r.source_video,style:i,validateSpec:a,styleSpec:r});case`image`:return o_({key:n,value:t,valueSpec:r.source_image,style:i,validateSpec:a,styleSpec:r});case`canvas`:return[new K(n,null,`Please use runtime APIs to add canvas sources, rather than including them in stylesheets.`,`source.canvas`)];default:return p_({key:`${n}.type`,value:t.type,valueSpec:{values:[`vector`,`raster`,`raster-dem`,`geojson`,`video`,`image`]}})}}function w_({key:e,value:t}){if(Z(t)===`string`)return b_({key:e,value:t});{let n=[];for(let r in t)n.push(...b_({key:`${e}.${r}`,value:t[r]}));return n}}function T_(e){let t=e.value,n=e.styleSpec,r=n.light,i=e.style,a=[],o=Z(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new K(`light`,t,`object expected, ${o} found`)]),a;for(let o in t){let s=o.match(/^(.*)-transition$/);a=s&&r[s[1]]&&r[s[1]].transition?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:n.transition,validateSpec:e.validateSpec,style:i,styleSpec:n})):r[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n})):a.concat([new K(o,t[o],`unknown property "${o}"`)])}return a}function E_(e){let t=e.value,n=e.styleSpec,r=n.sky,i=e.style,a=Z(t);if(t===void 0)return[];if(a!==`object`)return[new K(`sky`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=r[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n})):o.concat([new K(a,t[a],`unknown property "${a}"`)]);return o}function D_(e){let t=e.value,n=e.styleSpec,r=n.terrain,i=e.style,a=[],o=Z(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new K(`terrain`,t,`object expected, ${o} found`)]),a;for(let o in t)a=r[o]?a.concat(e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n})):a.concat([new K(o,t[o],`unknown property "${o}"`)]);return a}function O_(e){return b_(e).length===0?[]:u_(e)}function k_(e){return b_(e).length===0?[]:u_(e)}function A_(e){let t=e.key,n=e.value;if(Z(n)===`array`){if(n.length<1||n.length>4)return[new K(t,n,`padding requires 1 to 4 values; ${n.length} values found`)];let r={type:`number`},i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}else return c_({key:t,value:n,valueSpec:{}})}function j_(e){let t=e.key,n=e.value;if(Z(n)===`array`){let r={type:`number`};if(n.length<1)return[new K(t,n,`array length at least 1 expected, length 0 found`)];let i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}else return c_({key:t,value:n,valueSpec:{}})}function M_(e){let t=e.key,n=e.value;if(Z(n)===`array`){if(n.length<1)return[new K(t,n,`array length at least 1 expected, length 0 found`)];let e=[];for(let r=0;r<n.length;r++)e=e.concat(f_({key:`${t}[${r}]`,value:n[r]}));return e}else return f_({key:t,value:n})}function N_(e){let t=e.key,n=e.value,r=Z(n),i=e.styleSpec;if(r!==`array`||n.length<1||n.length%2!=0)return[new K(t,n,`variableAnchorOffsetCollection requires a non-empty array of even length`)];let a=[];for(let r=0;r<n.length;r+=2)a=a.concat(p_({key:`${t}[${r}]`,value:n[r],valueSpec:i.layout_symbol[`text-anchor`]})),a=a.concat(s_({key:`${t}[${r+1}]`,value:n[r+1],valueSpec:{length:2,value:`number`},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return a}function P_(e){let t=[],n=e.value,r=e.key;if(Array.isArray(n)){let i=[],a=[];for(let o in n)n[o].id&&i.includes(n[o].id)&&t.push(new K(r,n,`all the sprites' ids must be unique, but ${n[o].id} is duplicated`)),i.push(n[o].id),n[o].url&&a.includes(n[o].url)&&t.push(new K(r,n,`all the sprites' URLs must be unique, but ${n[o].url} is duplicated`)),a.push(n[o].url),t=t.concat(o_({key:`${r}[${o}]`,value:n[o],valueSpec:{id:{type:`string`,required:!0},url:{type:`string`,required:!0}},validateSpec:e.validateSpec}));return t}else return b_({key:r,value:n})}function F_(e){let t=e.value,n=e.styleSpec,r=n.projection,i=e.style,a=Z(t);if(t===void 0)return[];if(a!==`object`)return[new K(`projection`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=r[a]?o.concat(e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n})):o.concat([new K(a,t[a],`unknown property "${a}"`)]);return o}function I_(e){let t=e.key,n=e.value;n=n instanceof String?n.valueOf():n;let r=Z(n);return r===`array`&&!R_(n)&&!L_(n)?[new K(t,n,`projection expected, invalid array ${JSON.stringify(n)} found`)]:[`array`,`string`].includes(r)?[]:[new K(t,n,`projection expected, invalid type "${r}" found`)]}function L_(e){return!![`interpolate`,`step`,`literal`].includes(e[0])}function R_(e){return Array.isArray(e)&&e.length===3&&typeof e[0]==`string`&&typeof e[1]==`string`&&typeof e[2]==`number`}function z_(e){return!!e&&e.constructor===Object}function B_(e){return z_(e.value)?[]:[new K(e.key,e.value,`object expected, ${Z(e.value)} found`)]}var V_={"*"(){return[]},array:s_,boolean:d_,number:c_,color:f_,constants:r_,enum:p_,filter:m_,function:l_,layer:y_,object:o_,source:C_,light:T_,sky:E_,terrain:D_,projection:F_,projectionDefinition:I_,string:b_,formatted:O_,resolvedImage:k_,padding:A_,numberArray:j_,colorArray:M_,variableAnchorOffsetCollection:N_,sprite:P_,state:B_};function H_(e){let t=e.value,n=e.valueSpec,r=e.styleSpec;return e.validateSpec=H_,n.expression&&Sg(i_(t))?l_(e):n.expression&&wg(a_(t))?u_(e):n.type&&V_[n.type]?V_[n.type](e):o_(Pf({},e,{valueSpec:n.type?r[n.type]:n}))}function U_(e){let t=e.value,n=e.key,r=b_(e);return r.length?r:(t.indexOf(`{fontstack}`)===-1&&r.push(new K(n,t,`"glyphs" url must include a "{fontstack}" token`)),t.indexOf(`{range}`)===-1&&r.push(new K(n,t,`"glyphs" url must include a "{range}" token`)),r)}function W_(e,t=Af){let n=[];return n=n.concat(H_({key:``,value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:H_,objectElementValidators:{glyphs:U_,"*"(){return[]}}})),e.constants&&(n=n.concat(r_({key:`constants`,value:e.constants}))),K_(n)}W_.source=q_(G_(C_)),W_.sprite=q_(G_(P_)),W_.glyphs=q_(G_(U_)),W_.light=q_(G_(T_)),W_.sky=q_(G_(E_)),W_.terrain=q_(G_(D_)),W_.state=q_(G_(B_)),W_.layer=q_(G_(y_)),W_.filter=q_(G_(m_)),W_.paintProperty=q_(G_(__)),W_.layoutProperty=q_(G_(v_));function G_(e){return function(t){return e({...t,validateSpec:H_})}}function K_(e){return[].concat(e).sort((e,t)=>e.line-t.line)}function q_(e){return function(...t){return K_(e.apply(this,t))}}var J_=Af,Y_={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},X_=` `,Z_=/(italic|oblique)$/i,Q_={};function $_(e,t,n){var r=Q_[e];if(!r){Array.isArray(e)||(e=[e]);for(var i=400,a=`normal`,o=[],s,c,l=0,u=e.length;l<u;++l){var d=e[l].split(` `),f=d[d.length-1].toLowerCase();for(var p in f==`normal`||f==`italic`||f==`oblique`?(a=c?a:f,c=!0,d.pop(),f=d[d.length-1].toLowerCase()):Z_.test(f)&&(f=f.replace(Z_,``),a=c?a:d[d.length-1].replace(f,``),c=!0),Y_){var m=d.length>1?d[d.length-2].toLowerCase():``;if(f==p||f==p.replace(`-`,``)||m+`-`+f==p){i=s?i:Y_[p],d.pop(),m&&p.startsWith(m)&&d.pop();break}}!s&&typeof f==`number`&&(i=f,s=!0);var h=d.join(X_).replace(`Klokantech Noto Sans`,`Noto Sans`).replace(`DIN Pro`,`Barlow`).replace(`Arial Unicode MS`,`Arial`);h.indexOf(X_)!==-1&&(h=`"`+h+`"`),o.push(h)}r=Q_[e]=[a,i,o]}return r[0]+X_+r[1]+X_+t+`px`+(n?`/`+n:``)+X_+r[2]}var ev=class{drawCustom(e,t,n,r,i){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,n){}drawFeature(e,t,n){}drawGeometryCollection(e,t,n){}drawLineString(e,t,n){}drawMultiLineString(e,t,n){}drawMultiPoint(e,t,n){}drawMultiPolygon(e,t,n){}drawPoint(e,t,n){}drawPolygon(e,t,n){}drawText(e,t,n){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}},tv=class extends ev{constructor(e,t,n,r,i,a,o){super(),this.context_=e,this.pixelRatio_=t,this.extent_=n,this.transform_=r,this.transformRotation_=r?Bt(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=i,this.squaredTolerance_=a,this.userTransform_=o,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_=Ti()}drawImages_(e,t,n,r){if(!this.image_)return;let i=Bi(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.tmpLocalTransform_,s=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=s*this.imageOpacity_);let c=this.imageRotation_;this.transformRotation_===0&&(c-=this.viewRotation_),this.imageRotateWithView_&&(c+=this.viewRotation_);for(let e=0,t=i.length;e<t;e+=2){let t=i[e]-this.imageAnchorX_,n=i[e+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){let e=t+this.imageAnchorX_,r=n+this.imageAnchorY_;Ni(o,e,r,1,1,c,-e,-r),a.save(),a.transform.apply(a,o),a.translate(e,r),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,t,n,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=s)}drawText_(e,t,n,r){if(!this.textState_||this.text_===``)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);let i=Bi(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.textRotation_;for(this.transformRotation_===0&&(o-=this.viewRotation_),this.textRotateWithView_&&(o+=this.viewRotation_);t<n;t+=r){let e=i[t]+this.textOffsetX_,n=i[t+1]+this.textOffsetY_;o!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(e-this.textOffsetX_,n-this.textOffsetY_),a.rotate(o),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,e,n),this.textFillState_&&a.fillText(this.text_,e,n))}}moveToLineTo_(e,t,n,r,i){let a=this.context_,o=Bi(e,t,n,r,this.transform_,this.pixelCoordinates_);a.moveTo(o[0],o[1]);let s=o.length;i&&(s-=2);for(let e=2;e<s;e+=2)a.lineTo(o[e],o[e+1]);return i&&a.closePath(),n}drawRings_(e,t,n,r){for(let i=0,a=n.length;i<a;++i)t=this.moveToLineTo_(e,t,n[i],r,!0);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Tn(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=Xi(e,this.transform_,this.pixelCoordinates_),n=t[2]-t[0],r=t[3]-t[1],i=Math.sqrt(n*n+r*r),a=this.context_;a.beginPath(),a.arc(t[0],t[1],i,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==``&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case`Point`:this.drawPoint(e);break;case`LineString`:this.drawLineString(e);break;case`Polygon`:this.drawPolygon(e);break;case`MultiPoint`:this.drawMultiPoint(e);break;case`MultiLineString`:this.drawMultiLineString(e);break;case`MultiPolygon`:this.drawMultiPolygon(e);break;case`GeometryCollection`:this.drawGeometryCollection(e);break;case`Circle`:this.drawCircle(e);break;default:}}drawFeature(e,t){let n=t.getGeometryFunction()(e);n&&(this.setStyle(t),this.drawGeometry(n))}drawGeometryCollection(e){let t=e.getGeometriesArray();for(let e=0,n=t.length;e<n;++e)this.drawGeometry(t[e])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Tn(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(n,0,n.length,e.getStride(),!1),t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getExtent();if(Tn(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates(),r=0,i=e.getEnds(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e)r=this.moveToLineTo_(n,r,i[e],a,!1);t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoints();this.drawText_(t,0,t.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Tn(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_;t.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride()),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Tn(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getOrientedFlatCoordinates(),r=0,i=e.getEndss(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e){let t=i[e];r=this.drawRings_(n,r,t,a)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){let t=this.context_,n=this.contextFillState_;n?n.fillStyle!=e.fillStyle&&(n.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){let t=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=e.lineCap&&(n.lineCap=e.lineCap,t.lineCap=e.lineCap),Ge(n.lineDash,e.lineDash)||t.setLineDash(n.lineDash=e.lineDash),n.lineDashOffset!=e.lineDashOffset&&(n.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset),n.lineJoin!=e.lineJoin&&(n.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),n.lineWidth!=e.lineWidth&&(n.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),n.miterLimit!=e.miterLimit&&(n.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),n.strokeStyle!=e.strokeStyle&&(n.strokeStyle=e.strokeStyle,t.strokeStyle=e.strokeStyle)):(t.lineCap=e.lineCap,t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){let t=this.context_,n=this.contextTextState_,r=e.textAlign?e.textAlign:kl;n?(n.font!=e.font&&(n.font=e.font,t.font=e.font),n.textAlign!=r&&(n.textAlign=r,t.textAlign=r),n.textBaseline!=e.textBaseline&&(n.textBaseline=e.textBaseline,t.textBaseline=e.textBaseline)):(t.font=e.font,t.textAlign=r,t.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:r,textBaseline:e.textBaseline})}setFillStrokeStyle(e,t){if(e?this.fillState_={fillStyle:xl(e.getColor()||wl)}:this.fillState_=null,!t)this.strokeState_=null;else{let e=t.getColor(),n=t.getLineCap(),r=t.getLineDash(),i=t.getLineDashOffset(),a=t.getLineJoin(),o=t.getWidth(),s=t.getMiterLimit(),c=r||El;this.strokeState_={lineCap:n===void 0?Tl:n,lineDash:this.pixelRatio_===1?c:c.map(e=>e*this.pixelRatio_),lineDashOffset:(i||0)*this.pixelRatio_,lineJoin:a===void 0?Dl:a,lineWidth:(o===void 0?1:o)*this.pixelRatio_,miterLimit:s===void 0?10:s,strokeStyle:xl(e||Ol)}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}let n=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),i=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*n,this.imageAnchorY_=r[1]*n,this.imageHeight_=t[1]*n,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=i[0],this.imageOriginY_=i[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();let a=e.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/n,a[1]*this.pixelRatio_/n],this.imageWidth_=t[0]*n}setTextStyle(e){if(!e)this.text_=``;else{let t=e.getFill();t?this.textFillState_={fillStyle:xl(t.getColor()||wl)}:this.textFillState_=null;let n=e.getStroke();if(!n)this.textStrokeState_=null;else{let e=n.getColor(),t=n.getLineCap(),r=n.getLineDash(),i=n.getLineDashOffset(),a=n.getLineJoin(),o=n.getWidth(),s=n.getMiterLimit();this.textStrokeState_={lineCap:t===void 0?Tl:t,lineDash:r||El,lineDashOffset:i||0,lineJoin:a===void 0?Dl:a,lineWidth:o===void 0?1:o,miterLimit:s===void 0?10:s,strokeStyle:xl(e||Ol)}}let r=e.getFont(),i=e.getOffsetX(),a=e.getOffsetY(),o=e.getRotateWithView(),s=e.getRotation(),c=e.getScaleArray(),l=e.getText(),u=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r===void 0?Cl:r,textAlign:u===void 0?kl:u,textBaseline:d===void 0?Al:d},this.text_=l===void 0?``:Array.isArray(l)?l.reduce((e,t,n)=>e+=n%2?` `:t,``):l,this.textOffsetX_=i===void 0?0:this.pixelRatio_*i,this.textOffsetY_=a===void 0?0:this.pixelRatio_*a,this.textRotateWithView_=o===void 0?!1:o,this.textRotation_=s===void 0?0:s,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}},nv=.5,rv={Point:hv,LineString:fv,Polygon:_v,MultiPoint:gv,MultiLineString:pv,MultiPolygon:mv,GeometryCollection:dv,Circle:sv};function iv(e,t){return parseInt(F(e),10)-parseInt(F(t),10)}function av(e,t){let n=ov(e,t);return n*n}function ov(e,t){return nv*e/t}function sv(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Circle`);s.setFillStrokeStyle(a,o),s.drawCircle(t,r,i)}let s=n.getText();if(s&&s.getText()){let i=e.getBuilder(n.getZIndex(),`Text`);i.setTextStyle(s),i.drawText(t,r)}}function cv(e,t,n,r,i,a,o,s){let c=[],l=n.getImage();if(l){let e=!0,t=l.getImageState();t==G.LOADED||t==G.ERROR?e=!1:t==G.IDLE&&l.load(),e&&c.push(l.ready())}let u=n.getFill();u&&u.loading()&&c.push(u.ready());let d=c.length>0;return d&&Promise.all(c).then(()=>i(null)),lv(e,t,n,r,a,o,s),d}function lv(e,t,n,r,i,a,o){let s=n.getGeometryFunction()(t);if(!s)return;let c=s.simplifyTransformed(r,i);if(n.getRenderer())uv(e,c,n,t,o);else{let r=rv[c.getType()];r(e,c,n,t,o,a)}}function uv(e,t,n,r,i){if(t.getType()==`GeometryCollection`){let a=t.getGeometries();for(let t=0,o=a.length;t<o;++t)uv(e,a[t],n,r,i);return}e.getBuilder(n.getZIndex(),`Default`).drawCustom(t,r,n.getRenderer(),n.getHitDetectionRenderer(),i)}function dv(e,t,n,r,i,a){let o=t.getGeometriesArray(),s,c;for(s=0,c=o.length;s<c;++s){let t=rv[o[s].getType()];t(e,o[s],n,r,i,a)}}function fv(e,t,n,r,i){let a=n.getStroke();if(a){let o=e.getBuilder(n.getZIndex(),`LineString`);o.setFillStrokeStyle(null,a),o.drawLineString(t,r,i)}let o=n.getText();if(o&&o.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r,i)}}function pv(e,t,n,r,i){let a=n.getStroke();if(a){let o=e.getBuilder(n.getZIndex(),`LineString`);o.setFillStrokeStyle(null,a),o.drawMultiLineString(t,r,i)}let o=n.getText();if(o&&o.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r,i)}}function mv(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(o||a){let s=e.getBuilder(n.getZIndex(),`Polygon`);s.setFillStrokeStyle(a,o),s.drawMultiPolygon(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}function hv(e,t,n,r,i,a){let o=n.getImage(),s=n.getText(),c=s&&s.getText(),l=a&&o&&c?{}:void 0;if(o){if(o.getImageState()!=G.LOADED)return;let a=e.getBuilder(n.getZIndex(),`Image`);a.setImageStyle(o,l),a.drawPoint(t,r,i)}if(c){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s,l),a.drawText(t,r,i)}}function gv(e,t,n,r,i,a){let o=n.getImage(),s=o&&o.getOpacity()!==0,c=n.getText(),l=c&&c.getText(),u=a&&s&&l?{}:void 0;if(s){if(o.getImageState()!=G.LOADED)return;let a=e.getBuilder(n.getZIndex(),`Image`);a.setImageStyle(o,u),a.drawMultiPoint(t,r,i)}if(l){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(c,u),a.drawText(t,r,i)}}function _v(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Polygon`);s.setFillStrokeStyle(a,o),s.drawPolygon(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}var vv=!1;function yv(e,t,n,r,i,a,o){let s=new XMLHttpRequest;s.open(`GET`,typeof e==`function`?e(n,r,i):e,!0),t.getType()==`arraybuffer`&&(s.responseType=`arraybuffer`),s.withCredentials=vv,s.onload=function(e){if(!s.status||s.status>=200&&s.status<300){let e=t.getType();try{let r;e==`text`||e==`json`?r=s.responseText:e==`xml`?r=s.responseXML||s.responseText:e==`arraybuffer`&&(r=s.response),r?a(t.readFeatures(r,{extent:n,featureProjection:i}),t.readProjection(r)):o()}catch{o()}}else o()},s.onerror=o,s.send()}function bv(e,t){return function(n,r,i,a,o){yv(e,t,n,r,i,(e,t)=>{this.addFeatures(e),a!==void 0&&a(e)},()=>{this.changed(),o!==void 0&&o()})}}function xv(e,t){return[[-1/0,-1/0,1/0,1/0]]}function Sv(e,t){return[e]}var Cv=class{constructor(e){this.rbush_=new Os(e),this.items_={}}insert(e,t){let n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(n),this.items_[F(t)]=n}load(e,t){let n=Array(t.length);for(let r=0,i=t.length;r<i;r++){let i=e[r],a=t[r],o={minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],value:a};n[r]=o,this.items_[F(a)]=o}this.rbush_.load(n)}remove(e){let t=F(e),n=this.items_[t];return delete this.items_[t],this.rbush_.remove(n)!==null}update(e,t){let n=this.items_[F(t)];cn([n.minX,n.minY,n.maxX,n.maxY],e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(e){let t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(e){return e.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let n;for(let r=0,i=e.length;r<i;r++)if(n=t(e[r]),n)return n;return n}isEmpty(){return $e(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){let t=this.rbush_.toJSON();return rn(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(let t in e.items_)this.items_[t]=e.items_[t]}},wv=class extends ct{constructor(e){super(),this.projection=B(e.projection),this.attributions_=Tv(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state===void 0?`ready`:e.state,this.wrapX_=e.wrapX===void 0?!1:e.wrapX,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;let t=this;this.viewPromise_=new Promise(function(e,n){t.viewResolver=e,t.viewRejector=n})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=Tv(e),this.changed()}setState(e){this.state_=e,this.changed()}};function Tv(e){return e?typeof e==`function`?e:(Array.isArray(e)||(e=[e]),t=>e):null}var Ev={ADDFEATURE:`addfeature`,CHANGEFEATURE:`changefeature`,CLEAR:`clear`,REMOVEFEATURE:`removefeature`,FEATURESLOADSTART:`featuresloadstart`,FEATURESLOADEND:`featuresloadend`,FEATURESLOADERROR:`featuresloaderror`},Dv=class extends et{constructor(e,t,n){super(e),this.feature=t,this.features=n}},Ov=class extends wv{constructor(e){e||={},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:`ready`,wrapX:e.wrapX===void 0?!0:e.wrapX}),this.on,this.once,this.un,this.loader_=Ye,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader===void 0?this.url_!==void 0&&(R(this.format_,"`format` must be set when `url` is set"),this.loader_=bv(this.url_,this.format_)):this.loader_=e.loader,this.strategy_=e.strategy===void 0?xv:e.strategy;let t=e.useSpatialIndex===void 0?!0:e.useSpatialIndex;this.featuresRtree_=t?new Cv:null,this.loadedExtentsRtree_=new Cv,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,r;Array.isArray(e.features)?r=e.features:e.features&&(n=e.features,r=n.getArray()),!t&&n===void 0&&(n=new dt(r)),r!==void 0&&this.addFeaturesInternal(r),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){let t=F(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);let n=e.getGeometry();if(n){let t=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(t,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new Dv(Ev.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof md||(this.featureChangeKeys_[e]=[N(t,M.CHANGE,this.handleFeatureChange_,this),N(t,Le.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let n=!0;if(t.getId()!==void 0){let e=String(t.getId());if(!(e in this.idIndex_))this.idIndex_[e]=t;else if(t instanceof md){let r=this.idIndex_[e];r instanceof md?Array.isArray(r)?r.push(t):this.idIndex_[e]=[r,t]:n=!1}else n=!1}return n&&(R(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),n}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){let t=[],n=[],r=[];for(let t=0,r=e.length;t<r;t++){let r=e[t],i=F(r);this.addToIndex_(i,r)&&n.push(r)}for(let e=0,i=n.length;e<i;e++){let i=n[e],a=F(i);this.setupChangeEvents_(a,i);let o=i.getGeometry();if(o){let e=o.getExtent();t.push(e),r.push(i)}else this.nullGeometryFeatures_[a]=i}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(Ev.ADDFEATURE))for(let e=0,t=n.length;e<t;e++)this.dispatchEvent(new Dv(Ev.ADDFEATURE,n[e]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(Ev.ADDFEATURE,function(n){t||=(t=!0,e.push(n.feature),!1)}),this.addEventListener(Ev.REMOVEFEATURE,function(n){t||=(t=!0,e.remove(n.feature),!1)}),e.addEventListener(Ie.ADD,e=>{t||=(t=!0,this.addFeature(e.element),!1)}),e.addEventListener(Ie.REMOVE,e=>{t||=(t=!0,this.removeFeature(e.element),!1)}),this.featuresCollection_=e}clear(e){if(e){for(let e in this.featureChangeKeys_)this.featureChangeKeys_[e].forEach(rt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(e=>{this.removeFeatureInternal(e)});for(let e in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[e])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let t=new Dv(Ev.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){let n=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(n,function(n){let r=n.getGeometry();if(r instanceof md||r.intersectsCoordinate(e))return t(n)})}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(n){let r=n.getGeometry();if(r instanceof md||r.intersectsExtent(e)){let e=t(n);if(e)return e}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),$e(this.nullGeometryFeatures_)||We(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){let t=[];return this.forEachFeatureAtCoordinateDirect(e,function(e){t.push(e)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);let n=jn(e,t);return[].concat(...n.map(e=>this.featuresRtree_.getInExtent(e)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){let n=e[0],r=e[1],i=null,a=[NaN,NaN],o=1/0,s=[-1/0,-1/0,1/0,1/0];return t||=qe,this.featuresRtree_.forEachInExtent(s,function(e){if(t(e)){let t=e.getGeometry(),c=o;if(o=t instanceof md?0:t.closestPointXY(n,r,a,o),o<c){i=e;let t=Math.sqrt(o);s[0]=n-t,s[1]=r-t,s[2]=n+t,s[3]=r+t}}}),i}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){let t=this.idIndex_[e.toString()];return t===void 0?null:t}getFeatureByUid(e){let t=this.uidIndex_[e];return t===void 0?null:t}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){let t=e.target,n=F(t),r=t.getGeometry();if(!r)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[n]=t);else{let e=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(e,t)):this.featuresRtree_&&this.featuresRtree_.update(e,t)}let i=t.getId();if(i!==void 0){let e=i.toString();this.idIndex_[e]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[e]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[n]=t;this.changed(),this.dispatchEvent(new Dv(Ev.CHANGEFEATURE,t))}hasFeature(e){let t=e.getId();return t===void 0?F(e)in this.uidIndex_:t in this.idIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&$e(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,t,n){let r=this.loadedExtentsRtree_,i=this.strategy_(e,t,n);for(let e=0,a=i.length;e<a;++e){let a=i[e];r.forEachInExtent(a,function(e){return $t(e.extent,a)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Dv(Ev.FEATURESLOADSTART)),this.loader_.call(this,a,t,n,e=>{--this.loadingExtentsCount_,this.dispatchEvent(new Dv(Ev.FEATURESLOADEND,void 0,e))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Dv(Ev.FEATURESLOADERROR))}),r.insert(a,{extent:a.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){let t=this.loadedExtentsRtree_,n=t.forEachInExtent(e,function(t){if(cn(t.extent,e))return t});n&&t.remove(n)}removeFeatures(e){let t=!1;for(let n=0,r=e.length;n<r;++n)t=this.removeFeatureInternal(e[n])||t;t&&this.changed()}removeFeature(e){e&&this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){let t=F(e);if(!(t in this.uidIndex_))return!1;t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.featureChangeKeys_[t]?.forEach(rt),delete this.featureChangeKeys_[t];let n=e.getId();if(n!==void 0){let t=n.toString(),r=this.idIndex_[t];r===e?delete this.idIndex_[t]:Array.isArray(r)&&(r.splice(r.indexOf(e),1),r.length===1&&(this.idIndex_[t]=r[0]))}return delete this.uidIndex_[t],this.hasListener(Ev.REMOVEFEATURE)&&this.dispatchEvent(new Dv(Ev.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(let t in this.idIndex_)if(this.idIndex_[t]===e){delete this.idIndex_[t];break}}setLoader(e){this.loader_=e}setUrl(e){R(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(bv(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}},Q={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},kv=[Q.FILL],Av=[Q.STROKE],jv=[Q.BEGIN_PATH],Mv=[Q.CLOSE_PATH],Nv=class extends ev{constructor(e,t,n,r){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){let t=this.pixelRatio;return t==1?e:e.map(function(e){return e*t})}appendFlatPointCoordinates(e,t){let n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,a=i.length;for(let o=0,s=e.length;o<s;o+=t)r[0]=e[o],r[1]=e[o+1],Qt(n,r)&&(i[a++]=r[0],i[a++]=r[1]);return a}appendFlatLineCoordinates(e,t,n,r,i,a){let o=this.coordinates,s=o.length,c=this.getBufferedMaxExtent();a&&(t+=r);let l=e[t],u=e[t+1],d=this.tmpCoordinate_,f=!0,p,m,h;for(p=t+r;p<n;p+=r)d[0]=e[p],d[1]=e[p+1],h=tn(c,d),h===m?h===Kt.INTERSECTING?(o[s++]=d[0],o[s++]=d[1],f=!1):f=!0:(f&&=(o[s++]=l,o[s++]=u,!1),o[s++]=d[0],o[s++]=d[1]),l=d[0],u=d[1],m=h;return(i&&f||p===t+r)&&(o[s++]=l,o[s++]=u),s}drawCustomCoordinates_(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a],s=this.appendFlatLineCoordinates(e,t,o,r,!1,!1);i.push(s),t=o}return t}drawCustom(e,t,n,r,i){this.beginGeometry(e,t,i);let a=e.getType(),o=e.getStride(),s=this.coordinates.length,c,l,u,d,f;switch(a){case`MultiPolygon`:c=e.getOrientedFlatCoordinates(),d=[];let t=e.getEndss();f=0;for(let e=0,n=t.length;e<n;++e){let n=[];f=this.drawCustomCoordinates_(c,f,t[e],o,n),d.push(n)}this.instructions.push([Q.CUSTOM,s,d,e,n,pa,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,d,e,r||n,pa,i]);break;case`Polygon`:case`MultiLineString`:u=[],c=a==`Polygon`?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),f=this.drawCustomCoordinates_(c,0,e.getEnds(),o,u),this.instructions.push([Q.CUSTOM,s,u,e,n,fa,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,u,e,r||n,fa,i]);break;case`LineString`:case`Circle`:c=e.getFlatCoordinates(),l=this.appendFlatLineCoordinates(c,0,c.length,o,!1,!1),this.instructions.push([Q.CUSTOM,s,l,e,n,da,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,l,e,r||n,da,i]);break;case`MultiPoint`:c=e.getFlatCoordinates(),l=this.appendFlatPointCoordinates(c,o),l>s&&(this.instructions.push([Q.CUSTOM,s,l,e,n,da,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,l,e,r||n,da,i]));break;case`Point`:c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),l=this.coordinates.length,this.instructions.push([Q.CUSTOM,s,l,e,n,void 0,i]),this.hitDetectionInstructions.push([Q.CUSTOM,s,l,e,r||n,void 0,i]);break;default:}this.endGeometry(t)}beginGeometry(e,t,n){this.beginGeometryInstruction1_=[Q.BEGIN_GEOMETRY,t,0,e,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Q.BEGIN_GEOMETRY,t,0,e,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let e=this.hitDetectionInstructions;e.reverse();let t,n=e.length,r,i,a=-1;for(t=0;t<n;++t)r=e[t],i=r[0],i==Q.END_GEOMETRY?a=t:i==Q.BEGIN_GEOMETRY&&(r[2]=t,Ue(this.hitDetectionInstructions,a,t),a=-1)}fillStyleToState(e,t={}){if(e){let n=e.getColor();t.fillPatternScale=n&&typeof n==`object`&&`src`in n?this.pixelRatio:1,t.fillStyle=xl(n||wl)}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){t.strokeStyle=xl(e.getColor()||Ol);let n=e.getLineCap();t.lineCap=n===void 0?Tl:n;let r=e.getLineDash();t.lineDash=r?r.slice():El,t.lineDashOffset=e.getLineDashOffset()||0;let i=e.getLineJoin();t.lineJoin=i===void 0?Dl:i;let a=e.getWidth();t.lineWidth=a===void 0?1:a;let o=e.getMiterLimit();t.miterLimit=o===void 0?10:o,t.lineWidth>this.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){let n=this.state;this.fillStyleToState(e,n),this.strokeStyleToState(t,n)}createFill(e){let t=e.fillStyle,n=[Q.SET_FILL_STYLE,t];return typeof t!=`string`&&n.push(e.fillPatternScale),n}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[Q.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){let n=e.fillStyle;(typeof n!=`string`||e.currentFillStyle!=n)&&(this.instructions.push(t.call(this,e)),e.currentFillStyle=n)}updateStrokeStyle(e,t){let n=e.strokeStyle,r=e.lineCap,i=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,c=e.miterLimit;(e.currentStrokeStyle!=n||e.currentLineCap!=r||i!=e.currentLineDash&&!Ge(e.currentLineDash,i)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=s||e.currentMiterLimit!=c)&&(t.call(this,e),e.currentStrokeStyle=n,e.currentLineCap=r,e.currentLineDash=i,e.currentLineDashOffset=a,e.currentLineJoin=o,e.currentLineWidth=s,e.currentMiterLimit=c)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let t=[Q.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Xt(this.maxExtent),this.maxLineWidth>0)){let e=this.resolution*(this.maxLineWidth+1)/2;Yt(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},Pv=class extends Nv{constructor(e,t,n,r){super(e,t,n,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,n){if(!this.image_||this.maxExtent&&!Qt(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,t,n);let r=e.getFlatCoordinates(),i=e.getStride(),a=this.coordinates.length,o=this.appendFlatPointCoordinates(r,i);this.instructions.push([Q.DRAW_IMAGE,a,o,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([Q.DRAW_IMAGE,a,o,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,n){if(!this.image_)return;this.beginGeometry(e,t,n);let r=e.getFlatCoordinates(),i=[];for(let t=0,n=r.length;t<n;t+=e.getStride())(!this.maxExtent||Qt(this.maxExtent,r.slice(t,t+2)))&&i.push(r[t],r[t+1]);let a=this.coordinates.length,o=this.appendFlatPointCoordinates(i,2);this.instructions.push([Q.DRAW_IMAGE,a,o,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([Q.DRAW_IMAGE,a,o,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)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(e,t){let n=e.getAnchor(),r=e.getSize(),i=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}},Fv=class extends Nv{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinates_(e,t,n,r){let i=this.coordinates.length,a=this.appendFlatLineCoordinates(e,t,n,r,!1,!1),o=[Q.MOVE_TO_LINE_TO,i,a];return this.instructions.push(o),this.hitDetectionInstructions.push(o),n}drawLineString(e,t,n){let r=this.state,i=r.strokeStyle,a=r.lineWidth;if(i===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,n),this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,El,0],jv);let o=e.getFlatCoordinates(),s=e.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Av),this.endGeometry(t)}drawMultiLineString(e,t,n){let r=this.state,i=r.strokeStyle,a=r.lineWidth;if(i===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,n),this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,El,0],jv);let o=e.getEnds(),s=e.getFlatCoordinates(),c=e.getStride(),l=0;for(let e=0,t=o.length;e<t;++e)l=this.drawFlatCoordinates_(s,l,o[e],c);this.hitDetectionInstructions.push(Av),this.endGeometry(t)}finish(){let e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Av),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Av),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(jv)}},Iv=class extends Nv{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinatess_(e,t,n,r){let i=this.state,a=i.fillStyle!==void 0,o=i.strokeStyle!==void 0,s=n.length;this.instructions.push(jv),this.hitDetectionInstructions.push(jv);for(let i=0;i<s;++i){let a=n[i],s=this.coordinates.length,c=this.appendFlatLineCoordinates(e,t,a,r,!0,!o),l=[Q.MOVE_TO_LINE_TO,s,c];this.instructions.push(l),this.hitDetectionInstructions.push(l),o&&(this.instructions.push(Mv),this.hitDetectionInstructions.push(Mv)),t=a}return a&&(this.instructions.push(kv),this.hitDetectionInstructions.push(kv)),o&&(this.instructions.push(Av),this.hitDetectionInstructions.push(Av)),t}drawCircle(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle;if(i===void 0&&a===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,wl]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,El,0]);let o=e.getFlatCoordinates(),s=e.getStride(),c=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);let l=[Q.CIRCLE,c];this.instructions.push(jv,l),this.hitDetectionInstructions.push(jv,l),r.fillStyle!==void 0&&(this.instructions.push(kv),this.hitDetectionInstructions.push(kv)),r.strokeStyle!==void 0&&(this.instructions.push(Av),this.hitDetectionInstructions.push(Av)),this.endGeometry(t)}drawPolygon(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle;if(i===void 0&&a===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,wl]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,El,0]);let o=e.getEnds(),s=e.getOrientedFlatCoordinates(),c=e.getStride();this.drawFlatCoordinatess_(s,0,o,c),this.endGeometry(t)}drawMultiPolygon(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle;if(i===void 0&&a===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_FILL_STYLE,wl]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([Q.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,El,0]);let o=e.getEndss(),s=e.getOrientedFlatCoordinates(),c=e.getStride(),l=0;for(let e=0,t=o.length;e<t;++e)l=this.drawFlatCoordinatess_(s,l,o[e],c);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;let e=this.tolerance;if(e!==0){let t=this.coordinates;for(let n=0,r=t.length;n<r;++n)t[n]=ga(t[n],e)}return super.finish()}setFillStrokeStyles_(){let e=this.state;this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke)}};function Lv(e,t,n,r,i){let a=[],o=n,s=0,c=t.slice(n,2);for(;s<e&&o+i<r;){let[n,r]=c.slice(-2),l=t[o+i],u=t[o+i+1],d=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r));if(s+=d,s>=e){let t=(e-s+d)/d,f=zt(n,l,t),p=zt(r,u,t);c.push(f,p),a.push(c),c=[f,p],s==e&&(o+=i),s=0}else if(s<e)c.push(t[o+i],t[o+i+1]),o+=i;else{let e=d-s,t=zt(n,l,e/d),f=zt(r,u,e/d);c.push(t,f),a.push(c),c=[t,f],s=0,o+=i}}return s>0&&a.push(c),a}function Rv(e,t,n,r,i){let a=n,o=n,s=0,c=0,l=n,u,d,f,p,m,h,g,_,v,y;for(d=n;d<r;d+=i){let n=t[d],r=t[d+1];m!==void 0&&(v=n-m,y=r-h,p=Math.sqrt(v*v+y*y),g!==void 0&&(c+=f,u=Math.acos((g*v+_*y)/(f*p)),u>e&&(c>s&&(s=c,a=l,o=d),c=0,l=d-i)),f=p,g=v,_=y),m=n,h=r}return c+=p,c>s?[l,d]:[a,o]}var zv={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Bv={Circle:Iv,Default:Nv,Image:Pv,LineString:Fv,Polygon:Iv,Text:class extends Nv{constructor(e,t,n,r){super(e,t,n,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[wl]={fillStyle:wl},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_=``,this.fillKey_=``,this.strokeKey_=``,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){let e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t,n){let r=this.textFillState_,i=this.textStrokeState_,a=this.textState_;if(this.text_===``||!a||!r&&!i)return;let o=this.coordinates,s=o.length,c=e.getType(),l=null,u=e.getStride();if(a.placement===`line`&&(c==`LineString`||c==`MultiLineString`||c==`Polygon`||c==`MultiPolygon`)){if(!Tn(this.maxExtent,e.getExtent()))return;let r;if(l=e.getFlatCoordinates(),c==`LineString`)r=[l.length];else if(c==`MultiLineString`)r=e.getEnds();else if(c==`Polygon`)r=e.getEnds().slice(0,1);else if(c==`MultiPolygon`){let t=e.getEndss();r=[];for(let e=0,n=t.length;e<n;++e)r.push(t[e][0])}this.beginGeometry(e,t,n);let i=a.repeat,d=i?void 0:a.textAlign,f=0;for(let e=0,t=r.length;e<t;++e){let t;t=i?Lv(i*this.resolution,l,f,r[e],u):[l.slice(f,r[e])];for(let n=0,i=t.length;n<i;++n){let i=t[n],c=0,l=i.length;if(d==null){let e=Rv(a.maxAngle,i,0,i.length,2);c=e[0],l=e[1]}for(let e=c;e<l;e+=u)o.push(i[e],i[e+1]);let p=o.length;f=r[e],this.drawChars_(s,p),s=p}}this.endGeometry(t)}else{let r=a.overflow?null:[];switch(c){case`Point`:case`MultiPoint`:l=e.getFlatCoordinates();break;case`LineString`:l=e.getFlatMidpoint();break;case`Circle`:l=e.getCenter();break;case`MultiLineString`:l=e.getFlatMidpoints(),u=2;break;case`Polygon`:l=e.getFlatInteriorPoint(),a.overflow||r.push(l[2]/this.resolution),u=3;break;case`MultiPolygon`:let t=e.getFlatInteriorPoints();l=[];for(let e=0,n=t.length;e<n;e+=3)a.overflow||r.push(t[e+2]/this.resolution),l.push(t[e],t[e+1]);if(l.length===0)return;u=2;break;default:}let i=this.appendFlatPointCoordinates(l,u);if(i===s)return;if(r&&(i-s)/2!==l.length/u){let e=s/2;r=r.filter((t,n)=>{let r=o[(e+n)*2]===l[n*u]&&o[(e+n)*2+1]===l[n*u+1];return r||--e,r})}this.saveTextStates_();let d=a.backgroundFill?this.createFill(this.fillStyleToState(a.backgroundFill)):null,f=a.backgroundStroke?this.createStroke(this.strokeStyleToState(a.backgroundStroke)):null;this.beginGeometry(e,t,n);let p=a.padding;if(p!=jl&&(a.scale[0]<0||a.scale[1]<0)){let e=a.padding[0],t=a.padding[1],n=a.padding[2],r=a.padding[3];a.scale[0]<0&&(t=-t,r=-r),a.scale[1]<0&&(e=-e,n=-n),p=[e,t,n,r]}let m=this.pixelRatio;this.instructions.push([Q.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,p==jl?jl:p.map(function(e){return e*m}),d,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]);let h=1/m,g=d?d.slice(0):null;g&&(g[1]=wl),this.hitDetectionInstructions.push([Q.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[h,h],NaN,this.declutterMode_,this.declutterImageWithText_,p,g,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?wl:this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]),this.endGeometry(t)}}saveTextStates_(){let e=this.textStrokeState_,t=this.textState_,n=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}));let i=this.textKey_;i in this.textStates||(this.textStates[i]={font:t.font,textAlign:t.textAlign||`center`,justify:t.justify,textBaseline:t.textBaseline||`middle`,scale:t.scale});let a=this.fillKey_;n&&(a in this.fillStates||(this.fillStates[a]={fillStyle:n.fillStyle}))}drawChars_(e,t){let n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,a=this.textKey_,o=this.fillKey_;this.saveTextStates_();let s=this.pixelRatio,c=zv[r.textBaseline],l=this.textOffsetY_*s,u=this.text_,d=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([Q.DRAW_CHARS,e,t,c,r.overflow,o,r.maxAngle,s,l,i,d*s,u,a,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([Q.DRAW_CHARS,e,t,c,r.overflow,o&&wl,r.maxAngle,s,l,i,d*s,u,a,1/s,this.declutterMode_,this.textKeepUpright_])}setTextStyle(e,t){let n,r,i;if(!e)this.text_=``;else{let t=e.getFill();t?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=xl(t.getColor()||`#000`)):(r=null,this.textFillState_=r);let a=e.getStroke();if(!a)i=null,this.textStrokeState_=i;else{i=this.textStrokeState_,i||(i={},this.textStrokeState_=i);let e=a.getLineDash(),t=a.getLineDashOffset(),n=a.getWidth(),r=a.getMiterLimit();i.lineCap=a.getLineCap()||`round`,i.lineDash=e?e.slice():El,i.lineDashOffset=t===void 0?0:t,i.lineJoin=a.getLineJoin()||`round`,i.lineWidth=n===void 0?1:n,i.miterLimit=r===void 0?10:r,i.strokeStyle=xl(a.getColor()||`#000`)}n=this.textState_;let o=e.getFont()||`10px sans-serif`;Rl(o);let s=e.getScaleArray();n.overflow=e.getOverflow(),n.font=o,n.maxAngle=e.getMaxAngle(),n.placement=e.getPlacement(),n.textAlign=e.getTextAlign(),n.repeat=e.getRepeat(),n.justify=e.getJustify(),n.textBaseline=e.getTextBaseline()||`middle`,n.backgroundFill=e.getBackgroundFill(),n.backgroundStroke=e.getBackgroundStroke(),n.padding=e.getPadding()||jl,n.scale=s===void 0?[1,1]:s;let c=e.getOffsetX(),l=e.getOffsetY(),u=e.getRotateWithView(),d=e.getKeepUpright(),f=e.getRotation();this.text_=e.getText()||``,this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=l===void 0?0:l,this.textRotateWithView_=u===void 0?!1:u,this.textKeepUpright_=d===void 0?!0:d,this.textRotation_=f===void 0?0:f,this.strokeKey_=i?(typeof i.strokeStyle==`string`?i.strokeStyle:F(i.strokeStyle))+i.lineCap+i.lineDashOffset+`|`+i.lineWidth+i.lineJoin+i.miterLimit+`[`+i.lineDash.join()+`]`:``,this.textKey_=n.font+n.scale+(n.textAlign||`?`)+(n.repeat||`?`)+(n.justify||`?`)+(n.textBaseline||`?`),this.fillKey_=r&&r.fillStyle?typeof r.fillStyle==`string`?r.fillStyle:`|`+F(r.fillStyle):``}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}},Vv=class{constructor(e,t,n,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}finish(){let e={};for(let t in this.buildersByZIndex_){e[t]=e[t]||{};let n=this.buildersByZIndex_[t];for(let r in n){let i=n[r].finish();e[t][r]=i}}return e}getBuilder(e,t){let n=e===void 0?`0`:e.toString(),r=this.buildersByZIndex_[n];r===void 0&&(r={},this.buildersByZIndex_[n]=r);let i=r[t];if(i===void 0){let e=Bv[t];i=new e(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=i}return i}};function Hv(e,t,n,r,i,a,o,s,c,l,u,d,f=!0){let p=e[t],m=e[t+1],h=0,g=0,_=0,v=0;function y(){h=p,g=m,t+=r,p=e[t],m=e[t+1],v+=_,_=Math.sqrt((p-h)*(p-h)+(m-g)*(m-g))}do y();while(t<n-r&&v+_<a);let b=_===0?0:(a-v)/_,x=zt(h,p,b),S=zt(g,m,b),C=t-r,w=v,T=a+s*c(l,i,u);for(;t<n-r&&v+_<T;)y();b=_===0?0:(T-v)/_;let E=zt(h,p,b),D=zt(g,m,b),O=!1;if(f)if(d){let e=[x,S,E,D];Vi(e,0,4,2,d,e,e),O=e[0]>e[2]}else O=x>E;let k=Math.PI,A=[],ee=C+r===t;t=C,_=0,v=w,p=e[t],m=e[t+1];let j;if(ee)return y(),j=Math.atan2(m-g,p-h),O&&(j+=j>0?-k:k),A[0]=[(E+x)/2,(D+S)/2,(T-a)/2,j,i],A;i=i.replace(/\n/g,` `);for(let e=0,d=i.length;e<d;){y();let f=Math.atan2(m-g,p-h);if(O&&(f+=f>0?-k:k),j!==void 0){let e=f-j;if(e+=e>k?-2*k:e<-k?2*k:0,Math.abs(e)>o)return null}j=f;let x=e,S=0;for(;e<d;++e){let o=O?d-e-1:e,f=s*c(l,i[o],u);if(t+r<n&&v+_<a+S+f/2)break;S+=f}if(e===x)continue;let C=O?i.substring(d-x,d-e):i.substring(x,e);b=_===0?0:(a+S/2-v)/_;let w=zt(h,p,b),T=zt(g,m,b);A.push([w,T,S/2,f,C]),a+=S}return A}var Uv=class{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(yo(),{get:(e,t)=>{if(typeof yo()[t]==`function`)return this.push_(t),this.pushMethodArgs_},set:(e,t,n)=>(this.push_(t,n),!0)})}push_(...e){let t=this.instructions_,n=this.zIndex+this.offset_;t[n]||(t[n]=[]),t[n].push(...e)}pushMethodArgs_=(...e)=>(this.push_(e),this);pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(t=>{for(let n=0,r=t.length;n<r;++n){let r=t[n];if(typeof r==`function`){r(e);continue}let i=t[++n];if(typeof e[r]==`function`)e[r](...i);else{if(typeof i==`function`){e[r]=i(e);continue}e[r]=i}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}},Wv=nn(),Gv=[],Kv=[],qv=[],Jv=[];function Yv(e){return e[3].declutterBox}var Xv=RegExp(`[֑-ࣿיִ-﷿ﹰ-ﻼࠀ-࿿-]`);function Zv(e,t){return t===`start`?t=Xv.test(e)?`right`:`left`:t===`end`&&(t=Xv.test(e)?`left`:`right`),zv[t]}function Qv(e,t,n){return n>0&&e.push(`
5
+ `,``),e.push(t,``),e}function $v(e,t,n){return n%2==0&&(e+=t),e}var ey=class{constructor(e,t,n,r,i){this.overlaps=n,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=Ti(),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_=i?new Uv:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,n,r){let i=e+t+n+r;if(this.labels_[i])return this.labels_[i];let a=r?this.strokeStates[r]:null,o=n?this.fillStates[n]:null,s=this.textStates[t],c=this.pixelRatio,l=[s.scale[0]*c,s.scale[1]*c],u=s.justify?zv[s.justify]:Zv(Array.isArray(e)?e[0]:e,s.textAlign||`center`),d=r&&a.lineWidth?a.lineWidth:0,f=Array.isArray(e)?e:String(e).split(`
6
+ `).reduce(Qv,[]),{width:p,height:m,widths:h,heights:g,lineWidths:_}=Ul(s,f),v=p+d,y=[],b=(v+2)*l[0],x=(m+d)*l[1],S={width:b<0?Math.floor(b):Math.ceil(b),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:y};(l[0]!=1||l[1]!=1)&&y.push(`scale`,l),r&&(y.push(`strokeStyle`,a.strokeStyle),y.push(`lineWidth`,d),y.push(`lineCap`,a.lineCap),y.push(`lineJoin`,a.lineJoin),y.push(`miterLimit`,a.miterLimit),y.push(`setLineDash`,[a.lineDash]),y.push(`lineDashOffset`,a.lineDashOffset)),n&&y.push(`fillStyle`,o.fillStyle),y.push(`textBaseline`,`middle`),y.push(`textAlign`,`center`);let C=.5-u,w=u*v+C*d,T=[],E=[],D=0,O=0,k=0,A=0,ee;for(let e=0,t=f.length;e<t;e+=2){let t=f[e];if(t===`
7
+ `){O+=D,D=0,w=u*v+C*d,++A;continue}let i=f[e+1]||s.font;i!==ee&&(r&&T.push(`font`,i),n&&E.push(`font`,i),ee=i),D=Math.max(D,g[k]);let a=[t,w+C*h[k]+u*(h[k]-_[A]),.5*(d+D)+O];w+=h[k],r&&T.push(`strokeText`,a),n&&E.push(`fillText`,a),++k}return Array.prototype.push.apply(y,T),Array.prototype.push.apply(y,E),this.labels_[i]=S,S}replayTextBackground_(e,t,n,r,i,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,t),a&&(this.alignAndScaleFill_=a[2],e.fillStyle=a[1],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())}calculateImageOrLabelDimensions_(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){o*=d[0],s*=d[1];let g=n-o,_=r-s,v=i+c>e?e-c:i,y=a+l>t?t-l:a,b=p[3]+v*d[0]+p[1],x=p[0]+y*d[1]+p[2],S=g-p[3],C=_-p[0];(m||u!==0)&&(Gv[0]=S,Jv[0]=S,Gv[1]=C,Kv[1]=C,Kv[0]=S+b,qv[0]=Kv[0],qv[1]=C+x,Jv[1]=qv[1]);let w;return u===0?rn(Math.min(S,S+b),Math.min(C,C+x),Math.max(S,S+b),Math.max(C,C+x),Wv):(w=Ni(Ti(),n,r,1,1,u,-n,-r),Ai(w,Gv),Ai(w,Kv),Ai(w,qv),Ai(w,Jv),rn(Math.min(Gv[0],Kv[0],qv[0],Jv[0]),Math.min(Gv[1],Kv[1],qv[1],Jv[1]),Math.max(Gv[0],Kv[0],qv[0],Jv[0]),Math.max(Gv[1],Kv[1],qv[1],Jv[1]),Wv)),f&&(g=Math.round(g),_=Math.round(_)),{drawImageX:g,drawImageY:_,drawImageW:v,drawImageH:y,originX:c,originY:l,declutterBox:{minX:Wv[0],minY:Wv[1],maxX:Wv[2],maxY:Wv[3],value:h},canvasTransform:w,scale:d}}replayImageOrLabel_(e,t,n,r,i,a,o){let s=!!(a||o),c=r.declutterBox,l=o?o[2]*r.scale[0]/2:0;return c.minX-l<=t[0]&&c.maxX+l>=0&&c.minY-l<=t[1]&&c.maxY+l>=0&&(s&&this.replayTextBackground_(e,Gv,Kv,qv,Jv,a,o),Wl(e,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){let t=this.alignAndScaleFill_;if(t){let n=Ai(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),t!==1&&e.scale(t,t),e.rotate(this.viewRotation_)}e.fill(),t&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],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,n,r){let i=this.textStates[t],a=this.createLabel(e,t,r,n),o=this.strokeStates[n],s=this.pixelRatio,c=Zv(Array.isArray(e)?e[0]:e,i.textAlign||`center`),l=zv[i.textBaseline||`middle`],u=o&&o.lineWidth?o.lineWidth:0;return{label:a,anchorX:c*(a.width/s-2*i.scale[0])+2*(.5-c)*u,anchorY:l*a.height/s+2*(.5-l)*u}}execute_(e,t,n,r,i,a,o,s){let c=this.zIndexContext_,l;this.pixelCoordinates_&&Ge(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||=[],l=Bi(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),ki(this.renderedTransform_,n));let u=0,d=r.length,f=0,p,m,h,g,_,v,y,b,x,S,C,w,T,E=0,D=0,O=this.coordinateCache_,k=this.viewRotation_,A=Math.round(Math.atan2(-n[1],n[0])*0xe8d4a51000)/0xe8d4a51000,ee={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},j=this.instructions!=r||this.overlaps?0:200,te,ne,re,ie;for(;u<d;){let n=r[u];switch(n[0]){case Q.BEGIN_GEOMETRY:te=n[1],ie=n[3],te.getGeometry()?o!==void 0&&!Tn(o,ie.getExtent())?u=n[2]+1:++u:u=n[2],c&&(c.zIndex=n[4]);break;case Q.BEGIN_PATH:E>j&&(this.fill_(e),E=0),D>j&&(e.stroke(),D=0),!E&&!D&&(e.beginPath(),_=NaN,v=NaN),++u;break;case Q.CIRCLE:f=n[1];let r=l[f],d=l[f+1],ae=l[f+2],oe=l[f+3],se=ae-r,ce=oe-d,le=Math.sqrt(se*se+ce*ce);e.moveTo(r+le,d),e.arc(r,d,le,0,2*Math.PI,!0),++u;break;case Q.CLOSE_PATH:e.closePath(),++u;break;case Q.CUSTOM:f=n[1],p=n[2];let ue=n[3],de=n[4],fe=n[5];ee.geometry=ue,ee.feature=te,u in O||(O[u]=[]);let pe=O[u];fe?fe(l,f,p,2,pe):(pe[0]=l[f],pe[1]=l[f+1],pe.length=2),c&&(c.zIndex=n[6]),de(pe,ee),++u;break;case Q.DRAW_IMAGE:f=n[1],p=n[2],x=n[3],m=n[4],h=n[5];let me=n[6],he=n[7],ge=n[8],_e=n[9],ve=n[10],ye=n[11],be=n[12],xe=n[13];g=n[14]||`declutter`;let Se=n[15];if(!x&&n.length>=20){S=n[19],C=n[20],w=n[21],T=n[22];let e=this.drawLabelWithPointPlacement_(S,C,w,T);x=e.label,n[3]=x;let t=n[23];m=(e.anchorX-t)*this.pixelRatio,n[4]=m;let r=n[24];h=(e.anchorY-r)*this.pixelRatio,n[5]=h,me=x.height,n[6]=me,xe=x.width,n[13]=xe}let Ce;n.length>25&&(Ce=n[25]);let we,Te,Ee;n.length>17?(we=n[16],Te=n[17],Ee=n[18]):(we=jl,Te=null,Ee=null),ve&&A?ye+=k:!ve&&!A&&(ye-=k);let De=0;for(;f<p;f+=2){if(Ce&&Ce[De++]<xe/this.pixelRatio)continue;let n=this.calculateImageOrLabelDimensions_(x.width,x.height,l[f],l[f+1],xe,me,m,h,ge,_e,ye,be,i,we,!!Te||!!Ee,te),r=[e,t,x,n,he,Te,Ee];if(s){let e,t,i;if(Se){let n=p-f;if(!Se[n]){Se[n]={args:r,declutterMode:g};continue}let a=Se[n];e=a.args,t=a.declutterMode,delete Se[n],i=Yv(e)}let a,o;if(e&&(t!==`declutter`||!s.collides(i))&&(a=!0),(g!==`declutter`||!s.collides(n.declutterBox))&&(o=!0),t===`declutter`&&g===`declutter`){let e=a&&o;a=e,o=e}a&&(t!==`none`&&s.insert(i),this.replayImageOrLabel_.apply(this,e)),o&&(g!==`none`&&s.insert(n.declutterBox),this.replayImageOrLabel_.apply(this,r))}else this.replayImageOrLabel_.apply(this,r)}++u;break;case Q.DRAW_CHARS:let Oe=n[1],ke=n[2],Ae=n[3],je=n[4];T=n[5];let Me=n[6],Ne=n[7],Pe=n[8];w=n[9];let Fe=n[10];S=n[11],Array.isArray(S)&&(S=S.reduce($v,``)),C=n[12];let Ie=[n[13],n[13]];g=n[14]||`declutter`;let Le=n[15],M=this.textStates[C],Re=M.font,ze=[M.scale[0]*Ne,M.scale[1]*Ne],Be;Re in this.widths_?Be=this.widths_[Re]:(Be={},this.widths_[Re]=Be);let Ve=cd(l,Oe,ke,2),He=Math.abs(ze[0])*Hl(Re,S,Be);if(je||He<=Ve){let n=this.textStates[C].textAlign,r=(Ve-He)*Zv(S,n),i=Hv(l,Oe,ke,2,S,r,Me,Math.abs(ze[0]),Hl,Re,Be,A?0:this.viewRotation_,Le);drawChars:if(i){let n=[],r,a,o,c,l;if(w)for(r=0,a=i.length;r<a;++r){l=i[r],o=l[4],c=this.createLabel(o,C,``,w),m=l[2]+(ze[0]<0?-Fe:Fe),h=Ae*c.height+(.5-Ae)*2*Fe*ze[1]/ze[0]-Pe;let a=this.calculateImageOrLabelDimensions_(c.width,c.height,l[0],l[1],c.width,c.height,m,h,0,0,l[3],Ie,!1,jl,!1,te);if(s&&g===`declutter`&&s.collides(a.declutterBox))break drawChars;n.push([e,t,c,a,1,null,null])}if(T)for(r=0,a=i.length;r<a;++r){l=i[r],o=l[4],c=this.createLabel(o,C,T,``),m=l[2],h=Ae*c.height-Pe;let a=this.calculateImageOrLabelDimensions_(c.width,c.height,l[0],l[1],c.width,c.height,m,h,0,0,l[3],Ie,!1,jl,!1,te);if(s&&g===`declutter`&&s.collides(a.declutterBox))break drawChars;n.push([e,t,c,a,1,null,null])}s&&g!==`none`&&s.load(n.map(Yv));for(let e=0,t=n.length;e<t;++e)this.replayImageOrLabel_.apply(this,n[e])}}++u;break;case Q.END_GEOMETRY:if(a!==void 0){te=n[1];let e=a(te,ie,g);if(e)return e}++u;break;case Q.FILL:j?E++:this.fill_(e),++u;break;case Q.MOVE_TO_LINE_TO:for(f=n[1],p=n[2],ne=l[f],re=l[f+1],e.moveTo(ne,re),_=ne+.5|0,v=re+.5|0,f+=2;f<p;f+=2)ne=l[f],re=l[f+1],y=ne+.5|0,b=re+.5|0,(f==p-2||y!==_||b!==v)&&(e.lineTo(ne,re),_=y,v=b);++u;break;case Q.SET_FILL_STYLE:this.alignAndScaleFill_=n[2],E&&(this.fill_(e),E=0,D&&=(e.stroke(),0)),e.fillStyle=n[1],++u;break;case Q.SET_STROKE_STYLE:D&&=(e.stroke(),0),this.setStrokeStyle_(e,n),++u;break;case Q.STROKE:j?D++:e.stroke(),++u;break;default:++u;break}}E&&this.fill_(e),D&&e.stroke()}execute(e,t,n,r,i,a){this.viewRotation_=r,this.execute_(e,t,n,this.instructions,i,void 0,void 0,a)}executeHitDetection(e,t,n,r,i){return this.viewRotation_=n,this.execute_(e,[e.canvas.width,e.canvas.height],t,this.hitDetectionInstructions,!0,r,i)}},ty=[`Polygon`,`Circle`,`LineString`,`Image`,`Text`,`Default`],ny=[`Image`,`Text`],ry=ty.filter(e=>!ny.includes(e)),iy=class{constructor(e,t,n,r,i,a,o){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=t,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Ti(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(i,o)}clip(e,t){let n=this.getClipCoords(t);e.beginPath(),e.moveTo(n[0],n[1]),e.lineTo(n[2],n[3]),e.lineTo(n[4],n[5]),e.lineTo(n[6],n[7]),e.clip()}createExecutors_(e,t){for(let n in e){let r=this.executorsByZIndex_[n];r===void 0&&(r={},this.executorsByZIndex_[n]=r);let i=e[n];for(let e in i){let n=i[e];r[e]=new ey(this.resolution_,this.pixelRatio_,this.overlaps_,n,t)}}}hasExecutors(e){for(let t in this.executorsByZIndex_){let n=this.executorsByZIndex_[t];for(let t=0,r=e.length;t<r;++t)if(e[t]in n)return!0}return!1}forEachFeatureAtCoordinate(e,t,n,r,i,a){r=Math.round(r);let o=r*2+1,s=Ni(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-n,-e[0],-e[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=_o(o,o));let l=this.hitDetectionContext_;l.canvas.width!==o||l.canvas.height!==o?(l.canvas.width=o,l.canvas.height=o):c||l.clearRect(0,0,o,o);let u;this.renderBuffer_!==void 0&&(u=nn(),un(u,e),Yt(u,t*(this.renderBuffer_+r),u));let d=oy(r),f;function p(e,t,n){let s=l.getImageData(0,0,o,o).data;for(let c=0,u=d.length;c<u;c++)if(s[d[c]]>0){if(!a||n===`none`||f!==`Image`&&f!==`Text`||a.includes(e)){let n=(d[c]-3)/4,a=r-n%o,s=r-(n/o|0),l=i(e,t,a*a+s*s);if(l)return l}l.clearRect(0,0,o,o);break}}let m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(Be);let h,g,_,v,y;for(h=m.length-1;h>=0;--h){let e=m[h].toString();for(_=this.executorsByZIndex_[e],g=ty.length-1;g>=0;--g)if(f=ty[g],v=_[f],v!==void 0&&(y=v.executeHitDetection(l,s,n,p,u),y))return y}}getClipCoords(e){let t=this.maxExtent_;if(!t)return null;let n=t[0],r=t[1],i=t[2],a=t[3],o=[n,r,n,a,i,a,i,r];return Bi(o,0,8,2,e,o),o}isEmpty(){return $e(this.executorsByZIndex_)}execute(e,t,n,r,i,a,o){let s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(o?Ve:Be),a||=ty;let c=ty.length;for(let l=0,u=s.length;l<u;++l){let u=s[l].toString(),d=this.executorsByZIndex_[u];for(let u=0,f=a.length;u<f;++u){let f=a[u],p=d[f];if(p!==void 0){let a=o===null?void 0:p.getZIndexContext(),u=a?a.getContext():e,d=this.maxExtent_&&f!==`Image`&&f!==`Text`;if(d&&(u.save(),this.clip(u,n)),!a||f===`Text`||f===`Image`?p.execute(u,t,n,r,i,o):a.pushFunction(e=>p.execute(e,t,n,r,i,o)),d&&u.restore(),a){a.offset();let e=s[l]*c+ty.indexOf(f);this.deferredZIndexContexts_[e]||(this.deferredZIndexContexts_[e]=[]),this.deferredZIndexContexts_[e].push(a)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){let e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(Be);for(let n=0,r=t.length;n<r;++n)e[t[n]].forEach(e=>{e.draw(this.renderedContext_),e.clear()}),e[t[n]].length=0}},ay={};function oy(e){if(ay[e]!==void 0)return ay[e];let t=e*2+1,n=e*e,r=Array(n+1);for(let i=0;i<=e;++i)for(let a=0;a<=e;++a){let o=i*i+a*a;if(o>n)break;let s=r[o];s||(s=[],r[o]=s),s.push(((e+i)*t+(e+a))*4+3),i>0&&s.push(((e-i)*t+(e+a))*4+3),a>0&&(s.push(((e+i)*t+(e-a))*4+3),i>0&&s.push(((e-i)*t+(e-a))*4+3))}let i=[];for(let e=0,t=r.length;e<t;++e)r[e]&&i.push(...r[e]);return ay[e]=i,i}var sy=.5;function cy(e,t,n,r,i,a,o,s,c){let l=c?bi(i,c):i,u=_o(e[0]*sy,e[1]*sy);u.imageSmoothingEnabled=!1;let d=u.canvas,f=new tv(u,sy,i,null,o,s,c?di(_i(),c):null),p=n.length,m=Math.floor((256*256*256-1)/p),h={};for(let e=1;e<=p;++e){let t=n[e-1],i=t.getStyleFunction()||r;if(!i)continue;let o=i(t,a);if(!o)continue;Array.isArray(o)||(o=[o]);let s=(e*m).toString(16).padStart(7,`#00000`);for(let e=0,n=o.length;e<n;++e){let n=o[e],r=n.getGeometryFunction()(t);if(!r||!Tn(l,r.getExtent()))continue;let i=n.clone(),a=i.getFill();a&&a.setColor(s);let c=i.getStroke();c&&(c.setColor(s),c.setLineDash(null)),i.setText(void 0);let u=n.getImage();if(u){let e=u.getImageSize();if(!e)continue;let t=_o(e[0],e[1],void 0,{alpha:!1}),n=t.canvas;t.fillStyle=s,t.fillRect(0,0,n.width,n.height),i.setImage(new Zl({img:n,anchor:u.getAnchor(),anchorXUnits:`pixels`,anchorYUnits:`pixels`,offset:u.getOrigin(),opacity:1,size:u.getSize(),scale:u.getScale(),rotation:u.getRotation(),rotateWithView:u.getRotateWithView()}))}let d=i.getZIndex()||0,f=h[d];f||(f={},h[d]=f,f.Polygon=[],f.Circle=[],f.LineString=[],f.Point=[]);let p=r.getType();if(p===`GeometryCollection`){let e=r.getGeometriesArrayRecursive();for(let t=0,n=e.length;t<n;++t){let n=e[t];f[n.getType().replace(`Multi`,``)].push(n,i)}}else f[p.replace(`Multi`,``)].push(r,i)}}let g=Object.keys(h).map(Number).sort(Be);for(let e=0,n=g.length;e<n;++e){let n=h[g[e]];for(let e in n){let r=n[e];for(let e=0,n=r.length;e<n;e+=2){f.setStyle(r[e+1]);for(let n=0,i=t.length;n<i;++n)f.setTransform(t[n]),f.drawGeometry(r[e])}}}return u.getImageData(0,0,d.width,d.height)}function ly(e,t,n){let r=[];if(n){let i=Math.floor(Math.round(e[0])*sy),a=Math.floor(Math.round(e[1])*sy),o=(Mt(i,0,n.width-1)+Mt(a,0,n.height-1)*n.width)*4,s=n.data[o],c=n.data[o+1],l=n.data[o+2]+256*(c+256*s),u=Math.floor((256*256*256-1)/t.length);l&&l%u===0&&r.push(t[l/u-1])}return r}var uy=5,dy=class extends it{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=[],this.maxStaleKeys=uy}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return P()}getData(e){return null}prepareFrame(e){return P()}renderFrame(e,t){return P()}forEachFeatureAtCoordinate(e,t,n,r,i){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){let t=e.target;(t.getState()===G.LOADED||t.getState()===G.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=G.LOADED&&t!=G.ERROR&&e.addEventListener(M.CHANGE,this.boundHandleImageChange_),t==G.IDLE&&(e.load(),t=e.getState()),t==G.LOADED}renderIfReadyAndVisible(){let e=this.getLayer();e&&e.getVisible()&&e.getSourceState()===`ready`&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}},fy=[],py=null;function my(){py=_o(1,1,void 0,{willReadFrequently:!0})}var hy=class extends dy{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=Ti(),this.pixelTransform=Ti(),this.inversePixelTransform=Ti(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,n){py||my(),py.clearRect(0,0,1,1);let r;try{py.drawImage(e,t,n,1,1,0,0,1,1),r=py.getImageData(0,0,1,1).data}catch{return py=null,null}return r}getBackground(e){let t=this.getLayer().getBackground();return typeof t==`function`&&(t=t(e.viewState.resolution)),t||void 0}useContainer(e,t,n){let r=this.getLayer().getClassName(),i,a;if(e&&e.className===r&&(!n||e&&e.style.backgroundColor&&Ge(dc(e.style.backgroundColor),dc(n)))){let t=e.firstElementChild;To(t)&&(a=t.getContext(`2d`))}if(a&&zi(a.canvas.style.transform,t)?(this.container=e,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){i=vt?wo():document.createElement(`div`),i.className=r;let e=i.style;e.position=`absolute`,e.width=`100%`,e.height=`100%`,a=_o();let t=a.canvas;i.appendChild(t),e=t.style,e.position=`absolute`,e.left=`0`,e.transformOrigin=`top left`,this.container=i,this.context=a}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(e,t,n){let r=Cn(n),i=wn(n),a=gn(n),o=hn(n);Ai(t.coordinateToPixelTransform,r),Ai(t.coordinateToPixelTransform,i),Ai(t.coordinateToPixelTransform,a),Ai(t.coordinateToPixelTransform,o);let s=this.inversePixelTransform;Ai(s,r),Ai(s,i),Ai(s,a),Ai(s,o),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(i[0]),Math.round(i[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.clip()}prepareContainer(e,t){let n=e.extent,r=e.viewState.resolution,i=e.viewState.rotation,a=e.pixelRatio,o=Math.round(z(n)/r*a),s=Math.round(xn(n)/r*a);Ni(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/a,1/a,i,-o/2,-s/2),Pi(this.inversePixelTransform,this.pixelTransform);let c=Li(this.pixelTransform);if(this.useContainer(t,c,this.getBackground(e)),!this.containerReused){let e=this.context.canvas;e.width!=o||e.height!=s?(e.width=o,e.height=s):this.context.clearRect(0,0,o,s),c!==e.style.transform&&(e.style.transform=c)}}dispatchRenderEvent_(e,t,n){let r=this.getLayer();if(r.hasListener(e)){let i=new Gu(e,this.inversePixelTransform,n,t);r.dispatchEvent(i)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_(Ss.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_(Ss.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new Uv),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(Ss.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(Ss.POSTRENDER,this.context,e))}getRenderTransform(e,t,n,r,i,a,o){let s=i/2,c=a/2,l=r/t,u=-l,d=-e[0]+o,f=-e[1];return Ni(this.tempTransform,s,c,l,u,-n,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}},gy=class extends hy{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_=nn(),this.wrappedRenderedExtent_=nn(),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,n){let r=t.extent,i=t.viewState,a=i.center,o=i.resolution,s=i.projection,c=i.rotation,l=s.getExtent(),u=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),f=t.pixelRatio,p=t.viewHints,m=!(p[At.ANIMATING]||p[At.INTERACTING]),h=this.context,g=Math.round(z(r)/o*f),_=Math.round(xn(r)/o*f),v=u.getWrapX()&&s.canWrapX(),y=v?z(l):null,b=v?Math.ceil((r[2]-l[2])/y)+1:1,x=v?Math.floor((r[0]-l[0])/y):0;do{let r=this.getRenderTransform(a,o,0,f,g,_,x*y);t.declutter&&(r=r.slice(0)),e.execute(h,[h.canvas.width,h.canvas.height],r,c,m,n===void 0?ty:n?ny:ry,n?d&&t.declutter[d]:void 0)}while(++x<b)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=_o(this.context.canvas.width,this.context.canvas.height,fy))}resetDrawContext_(){if(this.opacity_!==1&&this.targetContext_){let e=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=e,bo(this.context),fy.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){let n=e.layerStatesArray[e.layerIndex];this.opacity_=n.opacity;let r=e.viewState;this.prepareContainer(e,t);let i=this.context,a=this.replayGroup_,o=a&&!a.isEmpty();if(!o&&!(this.getLayer().hasListener(Ss.PRERENDER)||this.getLayer().hasListener(Ss.POSTRENDER)))return this.container;this.setDrawContext_(),this.preRender(i,e);let s=r.projection;if(this.clipped_=!1,o&&n.extent&&this.clipping){let t=xi(n.extent,s);o=Tn(t,e.extent),this.clipped_=o&&!$t(t,e.extent),this.clipped_&&this.clipUnrotated(i,e,t)}return o&&this.renderWorlds(a,e,this.getLayer().getDeclutter()?!1:void 0),!e.declutter&&this.clipped_&&i.restore(),this.postRender(i,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_){let e=this.frameState.size.slice(),t=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,i=this.renderedProjection_,a=this.wrappedRenderedExtent_,o=this.getLayer(),s=[],c=e[0]*sy,l=e[1]*sy;s.push(this.getRenderTransform(t,n,r,sy,c,l,0).slice());let u=o.getSource(),d=i.getExtent();if(u.getWrapX()&&i.canWrapX()&&!$t(d,a)){let e=a[0],i=z(d),o=0,u;for(;e<d[0];)--o,u=i*o,s.push(this.getRenderTransform(t,n,r,sy,c,l,u).slice()),e+=i;for(o=0,e=a[2];e>d[2];)++o,u=i*o,s.push(this.getRenderTransform(t,n,r,sy,c,l,u).slice()),e-=i}let f=_i();this.hitDetectionImageData_=cy(e,s,this.renderedFeatures_,o.getStyleFunction(),a,n,r,av(n,this.renderedPixelRatio_),f?i:null)}t(ly(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,n,r,i){if(!this.replayGroup_)return;let a=t.viewState.resolution,o=t.viewState.rotation,s=this.getLayer(),c={},l=function(e,t,n){let a=F(e),o=c[a];if(!o){if(n===0)return c[a]=!0,r(e,s,t);i.push(c[a]={feature:e,layer:s,geometry:t,distanceSq:n,callback:r})}else if(o!==!0&&n<o.distanceSq){if(n===0)return c[a]=!0,i.splice(i.lastIndexOf(o),1),r(e,s,t);o.geometry=t,o.distanceSq=n}},u=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,a,o,n,l,u?t.declutter?.[u]?.all().map(e=>e.value):null)}handleFontsChanged(){let e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){let t=this.getLayer(),n=t.getSource();if(!n)return!1;let r=e.viewHints[At.ANIMATING],i=e.viewHints[At.INTERACTING],a=t.getUpdateWhileAnimating(),o=t.getUpdateWhileInteracting();if(this.ready&&!a&&r||!o&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;let s=e.extent,c=e.viewState,l=c.projection,u=c.resolution,d=e.pixelRatio,f=t.getRevision(),p=t.getRenderBuffer(),m=t.getRenderOrder();m===void 0&&(m=iv);let h=c.center.slice(),g=Yt(s,p*u),_=g.slice(),v=[g.slice()],y=l.getExtent();if(n.getWrapX()&&l.canWrapX()&&!$t(y,e.extent)){let e=z(y),t=Math.max(z(g)/2,e);g[0]=y[0]-t,g[2]=y[2]+t,Bn(h,l);let n=An(v[0],l);n[0]<y[0]&&n[2]<y[2]?v.push([n[0]+e,n[1],n[2]+e,n[3]]):n[0]>y[0]&&n[2]>y[2]&&v.push([n[0]-e,n[1],n[2]-e,n[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==m&&this.renderedFrameDeclutter_===!!e.declutter&&$t(this.wrappedRenderedExtent_,g))return Ge(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=h,this.replayGroupChanged=!1,!0;this.replayGroup_=null;let b=new Vv(ov(u,d),g,u,d),x=_i(),S;if(x){for(let e=0,t=v.length;e<t;++e){let t=v[e],r=bi(t,l);n.loadFeatures(r,Si(u,l),x)}S=di(x,l)}else for(let e=0,t=v.length;e<t;++e)n.loadFeatures(v[e],u,l);let C=av(u,d),w=!0,T=(e,n)=>{let r,i=e.getStyleFunction()||t.getStyleFunction();if(i&&(r=i(e,u)),r){let t=this.renderFeature(e,C,r,b,S,this.getLayer().getDeclutter(),n);w&&=!t}},E=bi(g,l),D=n.getFeaturesInExtent(E);m&&D.sort(m);for(let e=0,t=D.length;e<t;++e)T(D[e],e);this.renderedFeatures_=D,this.ready=w;let O=b.finish(),k=new iy(g,u,d,n.getOverlaps(),O,t.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=u,this.renderedRevision_=f,this.renderedRenderOrder_=m,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=_,this.wrappedRenderedExtent_=g,this.renderedCenter_=h,this.renderedProjection_=l,this.renderedPixelRatio_=d,this.replayGroup_=k,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,n,r,i,a,o){if(!n)return!1;let s=!1;if(Array.isArray(n))for(let c=0,l=n.length;c<l;++c)s=cv(r,e,n[c],t,this.boundHandleStyleImageChange_,i,a,o)||s;else s=cv(r,e,n,t,this.boundHandleStyleImageChange_,i,a,o);return s}},_y=class extends Uu{constructor(e){super(e)}createRenderer(){return new gy(this)}},vy=class extends dl{constructor(e,t,n,r,i){let a=i===void 0?G.LOADED:G.IDLE;super(e,t,n,a),this.loader_=i===void 0?null:i,this.canvas_=r,this.error_=null}getError(){return this.error_}handleLoad_(e){e?(this.error_=e,this.state=G.ERROR):this.state=G.LOADED,this.changed()}load(){this.state==G.IDLE&&(this.state=G.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}},yy=class extends tt{constructor(e,t,n){super(),n||={},this.tileCoord=e,this.state=t,this.key=``,this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(M.CHANGE)}release(){this.setState(L.EMPTY)}getKey(){return this.key+`/`+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==L.EMPTY){if(this.state!==L.ERROR&&this.state>e)throw Error(`Tile load sequence violation`);this.state=e,this.changed()}}load(){P()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;let r=t-n+1e3/60;return r>=this.transition_?1:Hn(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()}},by=class extends yy{constructor(e,t,n,r,i,a){super(e,t,a),this.crossOrigin_=r,this.src_=n,this.key=n,this.image_,vt?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,r!==null&&(this.image_.crossOrigin=r)),this.unlisten_=null,this.tileLoadFunction_=i}getImage(){return this.image_}setImage(e){this.image_=e,this.state=L.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}handleImageError_(){this.state=L.ERROR,this.unlistenImage_(),this.image_=xy(),this.changed()}handleImageLoad_(){if(vt)this.state=L.LOADED;else{let e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=L.LOADED:this.state=L.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==L.ERROR&&(this.state=L.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==L.IDLE&&(this.state=L.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=fl(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&=(this.unlisten_(),null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};function xy(){let e=_o(1,1);return e.fillStyle=`rgba(0,0,0,0)`,e.fillRect(0,0,1,1),e.canvas}var Sy=class{constructor(e,t,n,r){this.minX=e,this.maxX=t,this.minY=n,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.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.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 Cy(e,t,n,r,i){return i===void 0?new Sy(e,t,n,r):(i.minX=e,i.maxX=t,i.minY=n,i.maxY=r,i)}var wy=[],Ty=class extends yy{constructor(e,t,n,r,i){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_=i,this.wrappedTileCoord=n}getContext(){return this.context_||=_o(1,1,wy),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){let t=F(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_&&=(bo(this.context_),wy.push(this.context_.canvas),null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}},Ey=class extends yy{constructor(e,t,n,r,i,a){super(e,t,a),this.extent=null,this.format_=r,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=i,this.url_=n,this.key=n}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==L.IDLE&&(this.setState(L.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(L.ERROR)}setFeatures(e){this.features_=e,this.setState(L.LOADED)}setLoader(e){this.loader_=e}},Dy=`https://api.mapbox.com`;function Oy(e){return e.indexOf(`mapbox://`)===0?e.slice(9):``}function ky(e,t,n){if(typeof e==`string`)return[{id:`default`,url:Ay(e,t,n)}];for(let r of e)r.url=Ay(r.url,t,n);return e}function Ay(e,t,n){let r=Oy(e);if(!r)return decodeURI(new URL(e,n).href);if(r.indexOf(`sprites/`)!==0)throw Error(`unexpected sprites url: ${e}`);return`${Dy}/styles/v1/${r.slice(8)}/sprite?access_token=${t}`}function jy(e,t){let n=Oy(e);if(!n)return decodeURI(new URL(e,location.href).href);if(n.indexOf(`styles/`)!==0)throw Error(`unexpected style url: ${e}`);return`${Dy}/styles/v1/${n.slice(7)}?&access_token=${t}`}var My=[`a`,`b`,`c`,`d`];function Ny(e,t,n,r){let i=new URL(e,r||location.href),a=Oy(e);return a?a===`mapbox.satellite`?[`https://api.mapbox.com/v4/${a}/{z}/{x}/{y}${window.devicePixelRatio>=1.5?`@2x`:``}.webp?access_token=${t}`]:My.map(e=>`https://${e}.tiles.mapbox.com/v4/${a}/{z}/{x}/{y}.vector.pbf?access_token=${t}`):(t&&(i.searchParams.has(n)||i.searchParams.set(n,t)),[decodeURI(i.href)])}var Py=Object.freeze({}),Fy={},Iy={},Ly=0;function Ry(e){return e.id||=Ly++,e.id}function zy(e,t){return Ry(e)+`.`+F(t)}function By(e){let t=Fy[e.id];return t||(t={},Fy[Ry(e)]=t),t}function Vy(e){let t=Iy[e.id];return t||(t={},Iy[Ry(e)]=t),t}function Hy(e){return e*Math.PI/180}var Uy=(function(){let e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e})();function Wy(e,t){if(typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof OffscreenCanvas<`u`)return new OffscreenCanvas(e,t);let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}function Gy(e,t){let n=0,r=t.length;for(;n<r;++n)if(t[n]<e&&n+1<r){let r=t[n]/t[n+1];return n+Math.log(t[n]/e)/Math.log(r)}return r-1}function Ky(e,t){let n=Math.floor(e),r=2**(e-n);return t[n]/r}var qy={};function Jy(e,t,n={},r){if(t in qy)return r&&(r.url=qy[t][0].url),qy[t][1];let i=n.transformRequest&&n.transformRequest(t,e)||t,a=function(e){return delete qy[t],Promise.reject(Error(`Error fetching source `+t))},o=function(e){return delete qy[t],e.ok?e.json():Promise.reject(Error(`Error fetching source `+t))},s=Ze(()=>i).then(e=>e instanceof Response?(r&&(r.url=e.url),o(e)):(e instanceof Request||(e=new Request(e)),e.headers.get(`Accept`)||e.headers.set(`Accept`,`application/json`),r&&(r.url=e.url),fetch(e).then(o).catch(a))).catch(a);return qy[t]=[i,s],s}function Yy(e,t){if(typeof e==`string`)if(e.trim().startsWith(`{`))try{let t=JSON.parse(e);return Promise.resolve(t)}catch(e){return Promise.reject(e)}else return e=jy(e,t.accessToken),Jy(`Style`,e,t);else return Promise.resolve(e)}var Xy={};function Zy(e,t,n={}){let r=[t,JSON.stringify(e)].toString(),i=Xy[r];if(!i||n.transformRequest){let a;n.transformRequest&&(a=(e,t)=>{let r=n.transformRequest&&n.transformRequest(t,`Tiles`)||t;if(e instanceof Ey)e.setLoader((t,n,i)=>{let a=function(n){n.arrayBuffer().then(n=>{let r=e.getFormat().readFeatures(n,{extent:t,featureProjection:i});e.setFeatures(r)})};Ze(()=>r).then(t=>{if(t instanceof Response)return a(t);fetch(t).then(a).catch(t=>e.setState(L.ERROR))}).catch(t=>e.setState(L.ERROR))});else{let t=e.getImage();Ze(()=>r).then(n=>{if(typeof n==`string`){t.src=n;return}let r=e=>e.blob().then(e=>{let n=URL.createObjectURL(e);t.addEventListener(`load`,()=>URL.revokeObjectURL(n)),t.addEventListener(`error`,()=>URL.revokeObjectURL(n)),t.src=n});if(n instanceof Response)return r(n);fetch(n).then(r).catch(t=>e.setState(L.ERROR))}).catch(t=>e.setState(L.ERROR))}});let o=e.url;if(o&&!e.tiles){let r=Ny(o,n.accessToken,n.accessTokenParam||`access_token`,t||location.href);if(o.startsWith(`mapbox://`))i=Promise.resolve({tileJson:Object.assign({},e,{url:void 0,tiles:r}),tileLoadFunction:a});else{let e={};i=Jy(`Source`,r[0],n,e).then(function(t){return t.tiles=t.tiles.map(function(r){return t.scheme===`tms`&&(r=r.replace(`{y}`,`{-y}`)),Ny(r,n.accessToken,n.accessTokenParam||`access_token`,e.url)[0]}),Promise.resolve({tileJson:t,tileLoadFunction:a})})}}else e.tiles?(e=Object.assign({},e,{tiles:e.tiles.map(function(r){return e.scheme===`tms`&&(r=r.replace(`{y}`,`{-y}`)),Ny(r,n.accessToken,n.accessTokenParam||`access_token`,t||location.href)[0]})}),i=Promise.resolve({tileJson:Object.assign({},e),tileLoadFunction:a})):i=Promise.reject(Error("source has no `tiles` nor `url`"));Xy[r]=i}return i}function Qy(e,t,n,r){let i=[2*n*t.pixelRatio+t.width,2*n*t.pixelRatio+t.height],a=Wy(i[0],i[1]),o=a.getContext(`2d`);o.drawImage(e,t.x,t.y,t.width,t.height,n*t.pixelRatio,n*t.pixelRatio,t.width,t.height);let s=o.getImageData(0,0,i[0],i[1]);o.globalCompositeOperation=`destination-over`,o.fillStyle=`rgba(${r.r*255},${r.g*255},${r.b*255},${r.a})`;let c=s.data;for(let e=0,r=s.width;e<r;++e)for(let i=0,a=s.height;i<a;++i)c[(i*r+e)*4+3]>0&&o.arc(e,i,n*t.pixelRatio,0,2*Math.PI);return o.fill(),a}function $y(e,t,n){let r=Math.max(0,Math.min(1,(n-e)/(t-e)));return r*r*(3-2*r)}function eb(e,t,n){let r=Wy(t.width,t.height),i=r.getContext(`2d`);i.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);let a=i.getImageData(0,0,t.width,t.height),o=a.data;for(let e=0,t=a.width;e<t;++e)for(let r=0,i=a.height;r<i;++r){let i=(r*t+e)*4,a=o[i+3]/255,s=.75,c=.1,l=$y(s-c,s+c,a);l>0?(o[i+0]=Math.round(255*n.r*l),o[i+1]=Math.round(255*n.g*l),o[i+2]=Math.round(255*n.b*l),o[i+3]=Math.round(255*l)):o[i+3]=0}return i.putImageData(a,0,0),r}var tb=Array(256).join(` `);function nb(e,t){if(t>=.05){let n=``,r=e.split(`
8
+ `),i=tb.slice(0,Math.round(t/.1));for(let e=0,t=r.length;e<t;++e)e>0&&(n+=`
9
+ `),n+=r[e].split(``).join(i);return n}return e}var rb;function ib(){return rb||=Wy(1,1).getContext(`2d`),rb}function ab(e,t){return ib().measureText(e).width+(e.length-1)*t}var ob={};Ml.on(`propertychange`,()=>{for(let e in ob)delete ob[e]});function sb(e,t,n,r){if(e.indexOf(`
10
+ `)!==-1){let i=e.split(`
11
+ `),a=[];for(let e=0,o=i.length;e<o;++e)a.push(sb(i[e],t,n,r));return a.join(`
12
+ `)}let i=n+`,`+t+`,`+e+`,`+r,a=ob[i];if(!a){let o=e.split(` `);if(o.length>1){let e=ib();e.font=t;let i=e.measureText(`M`).width*n,s=``,c=[];for(let e=0,t=o.length;e<t;++e){let t=o[e],n=s+(s?` `:``)+t;ab(n,r)<=i?s=n:(s&&c.push(s),s=t)}s&&c.push(s);for(let e=0,t=c.length;e<t&&t>1;++e){let n=c[e];if(ab(n,r)<i*.35){let i=e>0?ab(c[e-1],r):1/0,a=e<t-1?ab(c[e+1],r):1/0;c.splice(e,1),--t,i<a?(c[e-1]+=` `+n,--e):c[e]=n+` `+c[e]}}for(let e=0,t=c.length-1;e<t;++e){let n=c[e],a=c[e+1];if(ab(n,r)>i*.7&&ab(a,r)<i*.6){let o=n.split(` `),s=o.pop();ab(s,r)<i*.2&&(c[e]=o.join(` `),c[e+1]=s+` `+a),--t}}a=c.join(`
13
+ `)}else a=e;a=nb(a,r),ob[i]=a}return a}var cb=[`Arial`,`Courier New`,`Times New Roman`,`Verdana`,`sans-serif`,`serif`,`monospace`,`cursive`,`fantasy`],lb={};function ub(e,t=`https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css`){if(vt)return e;let n;for(let t=0,r=e.length;t<r;++t){let r=e[t];if(r in lb)continue;lb[r]=!0;let i=$_(r,16).split(` `);n||=[],n.push([i.slice(3).join(` `).replace(/"/g,``),i[1],i[0]])}return n&&(async()=>{await document.fonts.ready;for(let e=0,r=n.length;e<r;++e){let r=n[e],i=r[0];if(cb.includes(i))continue;let a=r[1],o=r[2];if(!(await document.fonts.load(`${o} ${a} 16px "${i}"`)).some(e=>e.family.replace(/^['"]|['"]$/g,``).toLowerCase()===i.toLowerCase()&&e.weight==a&&e.style===o)){let e=t.replace(`{font-family}`,i.replace(/ /g,`-`).toLowerCase()).replace(`{Font+Family}`,i.replace(/ /g,`+`)).replace(`{fontweight}`,a).replace(`{-fontstyle}`,o.replace(`normal`,``).replace(/(.+)/,`-$1`)).replace(`{fontstyle}`,o);if(!document.querySelector(`link[href="`+e+`"]`)){let t=document.createElement(`link`);t.href=e,t.rel=`stylesheet`,document.head.appendChild(t)}}}})(),e}var db={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},fb={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]},pb=function(e,t){let n=Og(e,t);if(n.result===`error`)throw Error(n.value.map(e=>`${e.key}: ${e.message}`).join(`, `));return n.value},mb={zoom:0,distanceFromCenter:0};og.register(ag,{...og.definitions,pitch:[{kind:`number`},[],e=>mb.pitch||90],"distance-from-center":[{kind:`number`},[],e=>mb.distanceFromCenter||0]});var hb,gb;function $(e,t,n,r,i,a){let o=e.id;i||(i={},console.warn(`No functionCache provided to getValue()`)),i[o]||(i[o]={});let s=i[o];if(!s[n]){let r=(e[t]||Py)[n],i=J_[`${t}_${e.type}`][n];r===void 0&&(r=i.default);let a=wg(r);if(!a&&Sg(r)&&(r=Gg(r,i),a=!0),a){let e=pb(r,i);s[n]=e.evaluate.bind(e)}else{let e=i.type;(e===`color`||e===`colorArray`)&&(r=jp.parse(r)),s[n]=function(){return r}}}return s[n](mb,r,a)}function _b(e,t,n,r){return $(e,`layout`,`${n}-allow-overlap`,t,r)?$(e,`layout`,`${n}-ignore-placement`,t,r)?`none`:`obstacle`:`declutter`}function vb(e,t,n,r){if(r||console.warn(`No filterCache provided to evaluateFilter()`),!(e in r))try{r[e]=Fg(t).filter}catch(t){console.warn(`Filter will evaluate to false: `+t.message),r[e]=function(){return!1}}return r[e](mb,n)}var yb=!1;function bb(e,t){if(e){if(!yb&&(e.a===0||t===0))return;let n=e.a;return t=t===void 0?1:t,n===0?`transparent`:`rgba(`+Math.round(e.r*255/n)+`,`+Math.round(e.g*255/n)+`,`+Math.round(e.b*255/n)+`,`+n*t+`)`}return e}var xb=/\{[^{}}]*\}/g;function Sb(e,t){return e.replace(xb,function(e){return t[e.slice(1,-1)]||``})}function Cb(e,t){let n=e.split(`:`)[0];return n===e&&(n=`default`),t[n]}var wb=!1,Tb={};function Eb(e,t,n,r=Uy,i=void 0,a=void 0,o=void 0,s=void 0){if(typeof t==`string`&&(t=JSON.parse(t)),t.version!=8)throw Error(`glStyle version 8 required.`);Tb[zy(t,e)]=Array.from(arguments);let c={};(typeof a==`string`||a instanceof Request||a instanceof Response||a instanceof Promise)&&(a={default:a});for(let t in a){let n=a[t];Ze(()=>n).then(async n=>{let r;if(typeof Image<`u`){let i=new Image;if(typeof n==`string`)i.crossOrigin=`anonymous`,i.src=n;else{let e;n instanceof Request?e=await fetch(n):n instanceof Response&&(e=n);let t=await e.blob();r=URL.createObjectURL(t),i.src=r}i.addEventListener(`load`,function n(){i.removeEventListener(`load`,n),c[t]={image:i,size:[i.width,i.height]},e.changed(),r&&URL.revokeObjectURL(r)}),i.addEventListener(`error`,function e(){URL.revokeObjectURL(r),i.removeEventListener(`error`,e)})}else if(typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope){let e=self;e.postMessage({action:`loadImage`,src:n}),e.addEventListener(`message`,function(e){e.data.action===`imageLoaded`&&e.data.src===n&&(c[t]={image:e.data.image,size:[e.data.image.width,e.data.image.height]})})}})}let l=Nf(t.layers),u={},d=[],f={},p={},m=By(t),h=Vy(t),g;for(let e=0,r=l.length;e<r;++e){let r=l[e],i=r.id;if(typeof n==`string`&&r.source==n||Array.isArray(n)&&n.indexOf(i)!==-1){let n=r[`source-layer`];if(!g){g=r.source;let e=t.sources[g];if(!e)throw Error(`Source "${g}" is not defined`);let n=e.type;if(n!==`vector`&&n!==`geojson`)throw Error(`Source "${g}" is not of type "vector" or "geojson", but "${n}"`)}else if(r.source!==g)throw Error(`Layer "${i}" does not use source "${g}`);let a=u[n];a||(a=[],u[n]=a),a.push({layer:r,index:e}),d.push(i)}}let _=new Ql,v=new Yl,y=[],b=function(n,a,l){let d=e.getSource?.()?.format_?.layerName_??`mvt:layer`,g=n.getProperties(),b=u[g[d]];if(!b)return;let x=r.indexOf(a);x==-1&&(x=Gy(a,r)),mb.zoom=x,mb.distanceFromCenter=0;let S=n.getGeometry(),C=db[S.getType()],w=e.get(`map`);if(w&&w instanceof Zu&&C===1){let e=w.getSize();e&&(mb.distanceFromCenter=Rn(w.getView().getCenter(),_n(S.getExtent()))/a/e[1])}let T={id:n.getId(),properties:g,type:C},E=e.get(`mapbox-featurestate`)[n.getId()],D=-1,O;for(let r=0,u=b.length;r<u;++r){let u=b[r],d=u.layer,S=d.id;if(l!==void 0&&l!==S)continue;let w=d.layout||Py,k=d.paint||Py;if(w.visibility===`none`||`minzoom`in d&&x<d.minzoom||`maxzoom`in d&&x>=d.maxzoom)continue;let A=d.filter;if(!A||vb(S,A,T,h)){O=d;let r,l,h,b,x,S,A=u.index;if(C==3&&(d.type==`fill`||d.type==`fill-extrusion`))if(l=$(d,`paint`,d.type+`-opacity`,T,m,E),d.type+`-pattern`in k){let e=$(d,`paint`,d.type+`-pattern`,T,m,E);if(e){let t=typeof e==`string`?Sb(e,g):e.toString(),n=Cb(t,c);if(i&&i[t]&&n){++D,S=y[D],(!S||!S.getFill()||S.getStroke()||S.getText())&&(S=new $l({fill:new Yl}),y[D]=S),h=S.getFill(),S.setZIndex(A);let e=t+`.`+l,r=p[e];if(!r){let a=i[t],o=Wy(a.width,a.height),s=o.getContext(`2d`);s.globalAlpha=l,s.drawImage(n.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=s.createPattern(o,`repeat`),p[e]=r}h.setColor(r)}}}else r=bb($(d,`paint`,d.type+`-color`,T,m,E),l),d.type+`-outline-color`in k&&(x=bb($(d,`paint`,d.type+`-outline-color`,T,m,E),l)),x||=r,(r||x)&&(++D,S=y[D],(!S||r&&!S.getFill()||!r&&S.getFill()||x&&!S.getStroke()||!x&&S.getStroke()||S.getText())&&(S=new $l({fill:r?new Yl:void 0,stroke:x?new Ql:void 0}),y[D]=S),r&&(h=S.getFill(),h.setColor(r)),x&&(b=S.getStroke(),b.setColor(x),b.setWidth(.5)),S.setZIndex(A));if(C!=1&&d.type==`line`){r=`line-pattern`in k?void 0:bb($(d,`paint`,`line-color`,T,m,E),$(d,`paint`,`line-opacity`,T,m,E));let e=$(d,`paint`,`line-width`,T,m,E);r&&e>0&&(++D,S=y[D],(!S||!S.getStroke()||S.getFill()||S.getText())&&(S=new $l({stroke:new Ql}),y[D]=S),b=S.getStroke(),b.setLineCap($(d,`layout`,`line-cap`,T,m,E)),b.setLineJoin($(d,`layout`,`line-join`,T,m,E)),b.setMiterLimit($(d,`layout`,`line-miter-limit`,T,m,E)),b.setColor(r),b.setWidth(e),b.setLineDash(k[`line-dasharray`]?$(d,`paint`,`line-dasharray`,T,m,E).map(function(t){return t*e}):null),S.setZIndex(A))}let ee=!1,j=null,te=0,ne,re,ie;if((C==1||C==2)&&`icon-image`in w){let t=$(d,`layout`,`icon-image`,T,m,E);if(t){ne=typeof t==`string`?Sb(t,g):t.toString();let r,o=s?s(e,ne):void 0,l=Cb(ne,c);if(i&&i[ne]&&l||o){let e=$(d,`layout`,`icon-rotation-alignment`,T,m,E);if(C==2){let t=n.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){let n=t.getExtent();if(Math.sqrt(Math.max(((n[2]-n[0])/a)**2,((n[3]-n[1])/a)**2))>150){let n=t.getType()===`MultiLineString`?t.getFlatMidpoints():t.getFlatMidpoint();if(gb||=(hb=[NaN,NaN],new md(`Point`,hb,[],2,{},void 0)),r=gb,hb[0]=n[0],hb[1]=n[1],$(d,`layout`,`symbol-placement`,T,m,E)===`line`&&e===`map`){let e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,i=r.length-e;t<i;t+=e){let i=r[t],a=r[t+1],o=r[t+e],s=r[t+e+1],c=Math.min(i,o),l=Math.max(i,o),u=n[0],d=n[1],f=(s-a)*(u-i)-(o-i)*(d-a);if(Math.abs(f)<.001&&u<=l&&u>=c){te=Math.atan2(a-s,o-i);break}}}}}}if(C!==2||r){let t=$(d,`layout`,`icon-size`,T,m,E),n=k[`icon-color`]===void 0?null:$(d,`paint`,`icon-color`,T,m,E);if(!n||n.a!==0){let r=$(d,`paint`,`icon-halo-color`,T,m,E),a=$(d,`paint`,`icon-halo-width`,T,m,E),s=`${ne}.${t}.${a}.${r}`;if(n!==null&&(s+=`.${n}`),re=f[s],!re){let c=_b(d,T,`icon`,m),u;`icon-offset`in w&&(u=$(d,`layout`,`icon-offset`,T,m,E).slice(0),u[0]*=t,u[1]*=-t);let p=n?[n.r*255,n.g*255,n.b*255,n.a]:void 0;if(o){let n={color:p,rotateWithView:e===`map`,displacement:u,declutterMode:c,scale:t};typeof o==`string`?n.src=o:(n.img=o,n.imgSize=[o.width,o.height]),re=new Zl(n)}else{let o=i[ne],s,d,f;a?o.sdf?(s=Qy(eb(l.image,o,n||[0,0,0,1]),{x:0,y:0,width:o.width,height:o.height,pixelRatio:o.pixelRatio},a,r),p=void 0):s=Qy(l.image,o,a,r):(o.sdf&&(l.unSDFed||=(l.image=eb(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1,a:1}),!0)),s=l.image,d=[o.width,o.height],f=[o.x,o.y]),re=new Zl({color:p,img:s,imgSize:l.size,size:d,offset:f,rotateWithView:e===`map`,scale:t/o.pixelRatio,displacement:u,declutterMode:c})}f[s]=re}}re&&(++D,S=y[D],(!S||!S.getImage()||S.getFill()||S.getStroke())&&(S=new $l,y[D]=S),S.setGeometry(r),re.setRotation(te+Hy($(d,`layout`,`icon-rotate`,T,m,E))),re.setOpacity($(d,`paint`,`icon-opacity`,T,m,E)),re.setAnchor(fb[$(d,`layout`,`icon-anchor`,T,m,E)]),S.setImage(re),j=S.getText(),S.setText(void 0),S.setZIndex(A),ee=!0,ie=!1)}else ie=!0}}}if(C==1&&d.type===`circle`){++D,S=y[D],(!S||!S.getImage()||S.getFill()||S.getStroke())&&(S=new $l,y[D]=S);let e=`circle-radius`in k?$(d,`paint`,`circle-radius`,T,m,E):5,t=bb($(d,`paint`,`circle-stroke-color`,T,m,E),$(d,`paint`,`circle-stroke-opacity`,T,m,E)),n=$(d,`paint`,`circle-translate`,T,m,E),r=bb($(d,`paint`,`circle-color`,T,m,E),$(d,`paint`,`circle-opacity`,T,m,E)),i=$(d,`paint`,`circle-stroke-width`,T,m,E),a=e+`.`+t+`.`+r+`.`+i+`.`+n[0]+`.`+n[1];re=f[a],re||(re=new Jl({radius:e,displacement:[n[0],-n[1]],stroke:t&&i>0?new Ql({width:i,color:t}):void 0,fill:r?new Yl({color:r}):void 0,declutterMode:`none`}),f[a]=re),S.setImage(re),j=S.getText(),S.setText(void 0),S.setGeometry(void 0),S.setZIndex(A),ee=!0}let ae,oe,se,ce,le,ue;if(`text-field`in w){ce=Math.round($(d,`layout`,`text-size`,T,m,E));let e=$(d,`layout`,`text-font`,T,m,E);se=$(d,`layout`,`text-line-height`,T,m,E),oe=$_(o?o(e,t.metadata?t.metadata[`ol:webfonts`]:void 0):e,ce,se),oe.includes(`sans-serif`)||(oe+=`,sans-serif`),le=$(d,`layout`,`text-letter-spacing`,T,m,E),ue=$(d,`layout`,`text-max-width`,T,m,E);let n=$(d,`layout`,`text-field`,T,m,E);ae=typeof n==`object`&&n.sections?n.sections.length===1?n.toString():n.sections.reduce((t,n,r)=>{let i=n.fontStack?n.fontStack.split(`,`):e,a=$_(o?o(i):i,ce*(n.scale||1),se),s=n.text;if(s===`
14
+ `)return t.push(`
15
+ `,``),t;if(C==2)return t.push(nb(s,le),a),t;s=sb(s,a,ue,le).split(`
16
+ `);for(let e=0,n=s.length;e<n;++e)e>0&&t.push(`
17
+ `,``),t.push(s[e],a);return t},[]):Sb(n,g).trim(),l=$(d,`paint`,`text-opacity`,T,m,E)}if(ae&&l&&!ie){ee||(++D,S=y[D],(!S||!S.getText()||S.getFill()||S.getStroke())&&(S=new $l,y[D]=S),S.setImage(void 0),S.setGeometry(void 0));let e=_b(d,T,`text`,m);S.getText()||S.setText(j),j=S.getText(),(!j||`getDeclutterMode`in j&&j.getDeclutterMode()!==e)&&(j=new ou({padding:[2,2,2,2],declutterMode:e}),S.setText(j));let t=$(d,`layout`,`text-transform`,T,m,E);t==`uppercase`?ae=Array.isArray(ae)?ae.map((e,t)=>t%2?e:e.toUpperCase()):ae.toUpperCase():t==`lowercase`&&(ae=Array.isArray(ae)?ae.map((e,t)=>t%2?e:e.toLowerCase()):ae.toLowerCase());let n=Array.isArray(ae)?ae:C==2?nb(ae,le):sb(ae,oe,ue,le);if(j.setText(n),j.setFont(oe),j.setRotation(Hy($(d,`layout`,`text-rotate`,T,m,E))),typeof j.setKeepUpright==`function`){let e=$(d,`layout`,`text-keep-upright`,T,m,E);j.setKeepUpright(e)}let r=$(d,`layout`,`text-anchor`,T,m,E),i=ee||C==1?`point`:$(d,`layout`,`symbol-placement`,T,m,E),a;if(i===`line-center`?(j.setPlacement(`line`),a=`center`):j.setPlacement(i),i===`line`&&typeof j.setRepeat==`function`){let e=$(d,`layout`,`symbol-spacing`,T,m,E);j.setRepeat(e*2)}j.setOverflow(i===`point`);let o=$(d,`paint`,`text-halo-width`,T,m,E),s=$(d,`layout`,`text-offset`,T,m,E),c=$(d,`paint`,`text-translate`,T,m,E),u=0,f=0;if(i==`point`){a=`center`,r.indexOf(`left`)===-1?r.indexOf(`right`)!==-1&&(a=`right`,f=-o):(a=`left`,f=o);let e=$(d,`layout`,`text-rotation-alignment`,T,m,E);j.setRotateWithView(e==`map`)}else j.setMaxAngle(Hy($(d,`layout`,`text-max-angle`,T,m,E))*ae.length/n.length),j.setRotateWithView(!1);j.setTextAlign(a);let p=`middle`;r.indexOf(`bottom`)==0?(p=`bottom`,u=-o-.5*(se-1)*ce):r.indexOf(`top`)==0&&(p=`top`,u=o+.5*(se-1)*ce),j.setTextBaseline(p);let h=$(d,`layout`,`text-justify`,T,m,E);j.setJustify(h===`auto`?void 0:h),j.setOffsetX(s[0]*ce+f+c[0]),j.setOffsetY(s[1]*ce+u+c[1]),v.setColor(bb($(d,`paint`,`text-color`,T,m,E),l)),j.setFill(v);let g=bb($(d,`paint`,`text-halo-color`,T,m,E),l);if(g&&o>0){_.setColor(g),o*=2;let e=.5*ce;_.setWidth(o<=e?o:e),j.setStroke(_)}else j.setStroke(void 0);let b=$(d,`layout`,`text-padding`,T,m,E),x=j.getPadding();b!==x[0]&&(x[0]=b,x[1]=b,x[2]=b,x[3]=b),S.setZIndex(A)}}}if(D>-1)return y.length=D+1,wb&&(`set`in n?n.set(`mapbox-layer`,O):n.getProperties()[`mapbox-layer`]=O),y};return e.setStyle(b),e.set(`mapbox-layers`,d),e.set(`mapbox-source`,g),e.set(`mapbox-featurestate`,e.get(`mapbox-featurestate`)||{}),b}var Db=65536*65536,Ob=1/Db,kb=12,Ab=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`),jb=0,Mb=1,Nb=2,Pb=5,Fb=class{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,n=this.length){for(;this.pos<n;){let n=this.readVarint(),r=n>>3,i=this.pos;this.type=n&7,e(r,t,this),this.pos===i&&this.skip(n)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Db;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Db;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,n,r;return r=t[this.pos++],n=r&127,r<128||(r=t[this.pos++],n|=(r&127)<<7,r<128)||(r=t[this.pos++],n|=(r&127)<<14,r<128)||(r=t[this.pos++],n|=(r&127)<<21,r<128)?n:(r=t[this.pos],n|=(r&15)<<28,Ib(n,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=kb&&Ab?Ab.decode(this.buf.subarray(t,e)):Zb(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===Nb?this.readVarint()+this.pos:this.pos+1}skip(e){let t=e&7;if(t===jb)for(;this.buf[this.pos++]>127;);else if(t===Nb)this.pos=this.readVarint()+this.pos;else if(t===Pb)this.pos+=4;else if(t===Mb)this.pos+=8;else throw Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){let e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Ob),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Ob),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Rb(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++;let t=this.pos;this.pos=Qb(this.buf,e,this.pos);let n=this.pos-t;n>=128&&Vb(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n}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){let t=e.length;this.writeVarint(t),this.realloc(t);for(let n=0;n<t;n++)this.buf[this.pos++]=e[n]}writeRawMessage(e,t){this.pos++;let n=this.pos;e(t,this);let r=this.pos-n;r>=128&&Vb(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeMessage(e,t,n){this.writeTag(e,Nb),this.writeRawMessage(t,n)}writePackedVarint(e,t){t.length&&this.writeMessage(e,Hb,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,Ub,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,Kb,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,Wb,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Gb,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,qb,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Jb,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Yb,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Xb,t)}writeBytesField(e,t){this.writeTag(e,Nb),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,Pb),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,Pb),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,Mb),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,Mb),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,jb),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,jb),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,Nb),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,Pb),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,Mb),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}};function Ib(e,t,n){let r=n.buf,i,a;if(a=r[n.pos++],i=(a&112)>>4,a<128||(a=r[n.pos++],i|=(a&127)<<3,a<128)||(a=r[n.pos++],i|=(a&127)<<10,a<128)||(a=r[n.pos++],i|=(a&127)<<17,a<128)||(a=r[n.pos++],i|=(a&127)<<24,a<128)||(a=r[n.pos++],i|=(a&1)<<31,a<128))return Lb(e,i,t);throw Error(`Expected varint not more than 10 bytes`)}function Lb(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Rb(e,t){let n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(n=~(-e%4294967296),r=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw Error(`Given varint doesn't fit into 10 bytes`);t.realloc(10),zb(n,r,t),Bb(r,t)}function zb(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function Bb(e,t){let n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Vb(e,t,n){let r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(r);for(let t=n.pos-1;t>=e;t--)n.buf[t+r]=n.buf[t]}function Hb(e,t){for(let n=0;n<e.length;n++)t.writeVarint(e[n])}function Ub(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function Wb(e,t){for(let n=0;n<e.length;n++)t.writeFloat(e[n])}function Gb(e,t){for(let n=0;n<e.length;n++)t.writeDouble(e[n])}function Kb(e,t){for(let n=0;n<e.length;n++)t.writeBoolean(e[n])}function qb(e,t){for(let n=0;n<e.length;n++)t.writeFixed32(e[n])}function Jb(e,t){for(let n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Yb(e,t){for(let n=0;n<e.length;n++)t.writeFixed64(e[n])}function Xb(e,t){for(let n=0;n<e.length;n++)t.writeSFixed64(e[n])}function Zb(e,t,n){let r=``,i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o>n)break;let s,c,l;o===1?t<128&&(a=t):o===2?(s=e[i+1],(s&192)==128&&(a=(t&31)<<6|s&63,a<=127&&(a=null))):o===3?(s=e[i+1],c=e[i+2],(s&192)==128&&(c&192)==128&&(a=(t&15)<<12|(s&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):o===4&&(s=e[i+1],c=e[i+2],l=e[i+3],(s&192)==128&&(c&192)==128&&(l&192)==128&&(a=(t&15)<<18|(s&63)<<12|(c&63)<<6|l&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,o=1):a>65535&&(a-=65536,r+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),r+=String.fromCharCode(a),i+=o}return r}function Qb(e,t,n){for(let r=0,i,a;r<t.length;r++){if(i=t.charCodeAt(r),i>55295&&i<57344)if(a)if(i<56320){e[n++]=239,e[n++]=191,e[n++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||r+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):a=i;continue}else a&&=(e[n++]=239,e[n++]=191,e[n++]=189,null);i<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:(i<65536?e[n++]=i>>12|224:(e[n++]=i>>18|240,e[n++]=i>>12&63|128),e[n++]=i>>6&63|128),e[n++]=i&63|128)}return n}var $b=class extends _d{constructor(e){super(),e||={},this.dataProjection=new Zn({code:``,units:`tile-pixels`}),this.featureClass=e.featureClass?e.featureClass:md,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,n,r){e.pos=t.geometry;let i=e.readVarint()+e.pos,a=1,o=0,s=0,c=0,l=0,u=0;for(;e.pos<i;){if(!o){let t=e.readVarint();a=t&7,o=t>>3}if(o--,a===1||a===2)s+=e.readSVarint(),c+=e.readSVarint(),a===1&&l>u&&(r.push(l),u=l),n.push(s,c),l+=2;else if(a===7)l>u&&(n.push(n[u],n[u+1]),l+=2);else throw Error(`Invalid command found in the PBF`)}l>u&&(r.push(l),u=l)}createFeature_(e,t,n){let r=t.type;if(r===0)return null;let i,a=t.properties,o;this.idProperty_?(o=a[this.idProperty_],delete a[this.idProperty_]):o=t.id,a[this.layerName_]=t.layer.name;let s=[],c=[];this.readRawGeometry_(e,t,s,c);let l=ix(r,c.length);if(this.featureClass===md)i=new this.featureClass(l,s,c,2,a,o),i.transform(n.dataProjection);else{let e;if(l==`Polygon`){let t=Ba(s,c);e=t.length>1?new fd(s,`XY`,t):new Va(s,`XY`,c)}else e=l===`Point`?new xa(s,`XY`):l===`LineString`?new ld(s,`XY`):l===`MultiPoint`?new dd(s,`XY`):l===`MultiLineString`?new ud(s,`XY`,c):null;let t=this.featureClass;i=new t,this.geometryName_&&i.setGeometryName(this.geometryName_);let r=vd(e,!1,n);i.setGeometry(r),o!==void 0&&i.setId(o),i.setProperties(a,!0)}return i}getType(){return`arraybuffer`}readFeatures(e,t){let n=this.layers_;t=this.adaptOptions(t);let r=B(t.dataProjection);r.setWorldExtent(t.extent),t.dataProjection=r;let i=new Fb(e),a=i.readFields(ex,{}),o=[];for(let e in a){if(n&&!n.includes(e))continue;let s=a[e],c=s?[0,0,s.extent,s.extent]:null;r.setExtent(c);for(let e=0,n=s.length;e<n;++e){let n=rx(i,s,e),r=this.createFeature_(i,n,t);r!==null&&o.push(r)}}return o}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}};function ex(e,t,n){if(e===3){let e={keys:[],values:[],features:[]},r=n.readVarint()+n.pos;n.readFields(tx,e,r),e.length=e.features.length,e.length&&(t[e.name]=e)}}function tx(e,t,n){if(e===15)t.version=n.readVarint();else if(e===1)t.name=n.readString();else if(e===5)t.extent=n.readVarint();else if(e===2)t.features.push(n.pos);else if(e===3)t.keys.push(n.readString());else if(e===4){let r=null,i=n.readVarint()+n.pos;for(;n.pos<i;)e=n.readVarint()>>3,r=e===1?n.readString():e===2?n.readFloat():e===3?n.readDouble():e===4?n.readVarint64():e===5?n.readVarint():e===6?n.readSVarint():e===7?n.readBoolean():null;t.values.push(r)}}function nx(e,t,n){if(e==1)t.id=n.readVarint();else if(e==2){let e=n.readVarint()+n.pos;for(;n.pos<e;){let e=t.layer.keys[n.readVarint()],r=t.layer.values[n.readVarint()];t.properties[e]=r}}else e==3?t.type=n.readVarint():e==4&&(t.geometry=n.pos)}function rx(e,t,n){e.pos=t.features[n];let r=e.readVarint()+e.pos,i={layer:t,type:0,properties:{}};return e.readFields(nx,i,r),i}function ix(e,t){let n;return e===1?n=t===1?`Point`:`MultiPoint`:e===2?n=t===1?`LineString`:`MultiLineString`:e===3&&(n=`Polygon`),n}var ax=class extends hy{constructor(e){super(e),this.image=null}getImage(){return this.image?this.image.getImage():null}prepareFrame(e){let t=e.layerStatesArray[e.layerIndex],n=e.pixelRatio,r=e.viewState,i=r.resolution,a=this.getLayer().getSource(),o=e.viewHints,s=e.extent;if(t.extent!==void 0&&(s=Sn(s,xi(t.extent,r.projection))),!o[At.ANIMATING]&&!o[At.INTERACTING]&&!En(s))if(a){let e=r.projection,t=a.getImage(s,i,n,e);t&&(this.loadImage(t)?this.image=t:t.getState()===G.EMPTY&&(this.image=null))}else this.image=null;return!!this.image}getData(e){let t=this.frameState;if(!t)return null;let n=this.getLayer(),r=Ai(t.pixelToCoordinateTransform,e.slice()),i=n.getExtent();if(i&&!Qt(i,r))return null;let a=this.image.getExtent(),o=this.image.getImage(),s=z(a),c=Math.floor(o.width*((r[0]-a[0])/s));if(c<0||c>=o.width)return null;let l=xn(a),u=Math.floor(o.height*((a[3]-r[1])/l));return u<0||u>=o.height?null:this.getImageData(o,c,u)}renderFrame(e,t){let n=this.image,r=n.getExtent(),i=n.getResolution(),[a,o]=Array.isArray(i)?i:[i,i],s=n.getPixelRatio(),c=e.layerStatesArray[e.layerIndex],l=e.pixelRatio,u=e.viewState,d=u.center,f=u.resolution,p=l*a/(f*s),m=l*o/(f*s);this.prepareContainer(e,t);let h=this.context.canvas.width,g=this.context.canvas.height,_=this.getRenderContext(e),v=!1,y=!0;if(c.extent){let t=xi(c.extent,u.projection);y=Tn(t,e.extent),v=y&&!$t(t,e.extent),v&&this.clipUnrotated(_,e,t)}let b=n.getImage(),x=Ni(this.tempTransform,h/2,g/2,p,m,0,s*(r[0]-d[0])/a,s*(d[1]-r[3])/o);this.renderedResolution=o*l/s;let S=b.width*x[0],C=b.height*x[3];if(this.getLayer().getSource().getInterpolate()||(_.imageSmoothingEnabled=!1),this.preRender(_,e),y&&S>=.5&&C>=.5){let e=x[4],t=x[5],n=c.opacity;n!==1&&(_.save(),_.globalAlpha=n),_.drawImage(b,0,0,+b.width,+b.height,e,t,S,C),n!==1&&_.restore()}return this.postRender(this.context,e),v&&_.restore(),_.imageSmoothingEnabled=!0,this.container}},ox=class extends Cs{constructor(e){e||={},super(e)}},sx=class extends ox{constructor(e){super(e)}createRenderer(){return new ax(this)}getData(e){return super.getData(e)}};function cx(e){return e instanceof Image||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageBitmap?e:null}function lx(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e instanceof DataView?e:null}var ux=Error(`disposed`),dx=null;function fx(e){dx||=_o(e.width,e.height,void 0,{willReadFrequently:!0});let t=dx.canvas,n=e.width;t.width!==n&&(t.width=n);let r=e.height;return t.height!==r&&(t.height=r),dx.clearRect(0,0,n,r),dx.drawImage(e,0,0),dx.getImageData(0,0,n,r).data}var px=[256,256],mx=class extends yy{constructor(e){let t=L.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_;let e=cx(this.data_);return e?[e.width,e.height]:px}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==L.IDLE&&this.state!==L.ERROR)return;this.state=L.LOADING,this.changed();let e=this;this.loader_().then(function(t){e.data_=t,e.state=L.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=L.ERROR,e.changed()})}disposeInternal(){this.controller_&&=(this.controller_.abort(ux),null),super.disposeInternal()}},hx,gx=[];function _x(e,t,n,r,i){e.beginPath(),e.moveTo(0,0),e.lineTo(t,n),e.lineTo(r,i),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,r)+1,Math.max(n,i)),e.restore()}function vx(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-.75*255)>2}function yx(){if(hx===void 0){let e=_o(6,6,gx);e.globalCompositeOperation=`lighter`,e.fillStyle=`rgba(210, 0, 0, 0.75)`,_x(e,4,5,4,0),_x(e,4,5,0,5);let t=e.getImageData(0,0,3,3).data;hx=vx(t,0)||vx(t,4)||vx(t,8),bo(e),gx.push(e.canvas)}return hx}function bx(e,t,n,r){let i=mi(n,t,e),a=ri(t,r,n),o=t.getMetersPerUnit();o!==void 0&&(a*=o);let s=e.getMetersPerUnit();s!==void 0&&(a/=s);let c=e.getExtent();if(!c||Qt(c,i)){let t=ri(e,a,i)/a;isFinite(t)&&t>0&&(a/=t)}return a}function xx(e,t,n,r){let i=bx(e,t,_n(n),r);return(!isFinite(i)||i<=0)&&pn(n,function(n){return i=bx(e,t,n,r),isFinite(i)&&i>0}),i}function Sx(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=_o(Math.round(n*e),Math.round(n*t),gx);if(d||(m.imageSmoothingEnabled=!1),c.length===0)return m.canvas;m.scale(n,n);function h(e){return Math.round(e*n)/n}m.globalCompositeOperation=`lighter`;let g=nn();c.forEach(function(e,t,n){ln(g,e.extent)});let _,v=n/r,y=(d?1:1+2**-24)/v;if(!f||c.length!==1||l!==0){if(_=_o(Math.round(z(g)*v),Math.round(xn(g)*v),gx),d||(_.imageSmoothingEnabled=!1),i&&p){let e=(i[0]-g[0])*v,t=-(i[3]-g[3])*v,n=z(i)*v,r=xn(i)*v;_.rect(e,t,n,r),_.clip()}c.forEach(function(e,t,n){if(e.image.width>0&&e.image.height>0){if(e.clipExtent){_.save();let t=(e.clipExtent[0]-g[0])*v,n=-(e.clipExtent[3]-g[3])*v,r=z(e.clipExtent)*v,i=xn(e.clipExtent)*v;_.rect(d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),_.clip()}let t=(e.extent[0]-g[0])*v,n=-(e.extent[3]-g[3])*v,r=z(e.extent)*v,i=xn(e.extent)*v;_.drawImage(e.image,l,l,e.image.width-2*l,e.image.height-2*l,d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),e.clipExtent&&_.restore()}})}let b=Cn(o);return s.getTriangles().forEach(function(e,t,n){let r=e.source,i=e.target,o=r[0][0],s=r[0][1],l=r[1][0],u=r[1][1],f=r[2][0],p=r[2][1],v=h((i[0][0]-b[0])/a),x=h(-(i[0][1]-b[1])/a),S=h((i[1][0]-b[0])/a),C=h(-(i[1][1]-b[1])/a),w=h((i[2][0]-b[0])/a),T=h(-(i[2][1]-b[1])/a),E=o,D=s;o=0,s=0,l-=E,u-=D,f-=E,p-=D;let O=Ft([[l,u,0,0,S-v],[f,p,0,0,w-v],[0,0,l,u,C-x],[0,0,f,p,T-x]]);if(!O)return;if(m.save(),m.beginPath(),yx()||!d){m.moveTo(S,C);let e=v-S,t=x-C;for(let n=0;n<4;n++)m.lineTo(S+h((n+1)*e/4),C+h(n*t/3)),n!=3&&m.lineTo(S+h((n+1)*e/4),C+h((n+1)*t/3));m.lineTo(w,T)}else m.moveTo(S,C),m.lineTo(v,x),m.lineTo(w,T);m.clip(),m.transform(O[0],O[2],O[1],O[3],v,x),m.translate(g[0]-E,g[3]-D);let k;if(_)k=_.canvas,m.scale(y,-y);else{let e=c[0],t=e.extent;k=e.image,m.scale(z(t)/k.width,-xn(t)/k.height)}m.drawImage(k,0,0),m.restore()}),_&&(bo(_),gx.push(_.canvas)),u&&(m.save(),m.globalCompositeOperation=`source-over`,m.strokeStyle=`black`,m.lineWidth=1,s.getTriangles().forEach(function(e,t,n){let r=e.target,i=(r[0][0]-b[0])/a,o=-(r[0][1]-b[1])/a,s=(r[1][0]-b[0])/a,c=-(r[1][1]-b[1])/a,l=(r[2][0]-b[0])/a,u=-(r[2][1]-b[1])/a;m.beginPath(),m.moveTo(s,c),m.lineTo(i,o),m.lineTo(l,u),m.closePath(),m.stroke()}),m.restore()),m.canvas}var Cx=10,wx=.25,Tx=class{constructor(e,t,n,r,i,a,o){this.sourceProj_=e,this.targetProj_=t;let s={},c=o?si(e=>Ai(o,mi(e,this.targetProj_,this.sourceProj_))):pi(this.targetProj_,this.sourceProj_);this.transformInv_=function(e){let t=e[0]+`/`+e[1];return s[t]||(s[t]=c(e)),s[t]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&z(r)>=z(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?z(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?z(this.targetProj_.getExtent()):null;let l=Cn(n),u=wn(n),d=gn(n),f=hn(n),p=this.transformInv_(l),m=this.transformInv_(u),h=this.transformInv_(d),g=this.transformInv_(f),_=Cx+(a?Math.max(0,Math.ceil(Math.log2(mn(n)/(a*a*256*256)))):0);if(this.addQuad_(l,u,d,f,p,m,h,g,_),this.wrapsXInSource_){let e=1/0;this.triangles_.forEach(function(t,n,r){e=Math.min(e,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(t=>{if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-e>this.sourceWorldWidth_/2){let n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-e>this.sourceWorldWidth_/2&&(n[0][0]-=this.sourceWorldWidth_),n[1][0]-e>this.sourceWorldWidth_/2&&(n[1][0]-=this.sourceWorldWidth_),n[2][0]-e>this.sourceWorldWidth_/2&&(n[2][0]-=this.sourceWorldWidth_);let r=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-r<this.sourceWorldWidth_/2&&(t.source=n)}})}s={}}addTriangle_(e,t,n,r,i,a){this.triangles_.push({source:[r,i,a],target:[e,t,n]})}addQuad_(e,t,n,r,i,a,o,s,c){let l=qt([i,a,o,s]),u=this.sourceWorldWidth_?z(l)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&u>.5&&u<1,p=!1;if(c>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(p=z(qt([e,t,n,r]))/this.targetWorldWidth_>wx||p),!f&&this.sourceProj_.isGlobal()&&u&&(p=u>wx||p)),!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3])&&!Tn(l,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(i[0])||!isFinite(i[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1]))){if(c>0)p=!0;else if(m=(!isFinite(i[0])||!isFinite(i[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+(!isFinite(s[0])||!isFinite(s[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){let t=[(e[0]+n[0])/2,(e[1]+n[1])/2],r=this.transformInv_(t),a;a=f?(Rt(i[0],d)+Rt(o[0],d))/2-Rt(r[0],d):(i[0]+o[0])/2-r[0];let s=(i[1]+o[1])/2-r[1];p=a*a+s*s>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-n[0])<=Math.abs(e[1]-n[1])){let l=[(t[0]+n[0])/2,(t[1]+n[1])/2],u=this.transformInv_(l),d=[(r[0]+e[0])/2,(r[1]+e[1])/2],f=this.transformInv_(d);this.addQuad_(e,t,l,d,i,a,u,f,c-1),this.addQuad_(d,l,n,r,f,u,o,s,c-1)}else{let l=[(e[0]+t[0])/2,(e[1]+t[1])/2],u=this.transformInv_(l),d=[(n[0]+r[0])/2,(n[1]+r[1])/2],f=this.transformInv_(d);this.addQuad_(e,l,d,r,i,u,f,s,c-1),this.addQuad_(l,t,n,d,u,a,o,f,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(e,n,r,i,o,s),m&14||this.addTriangle_(e,n,t,i,o,a),m&&(m&13||this.addTriangle_(t,r,e,a,s,i),m&7||this.addTriangle_(t,r,n,a,s,o))}calculateSourceExtent(){let e=nn();return this.triangles_.forEach(function(t,n,r){let i=t.source;un(e,i[0]),un(e,i[1]),un(e,i[2])}),e}getTriangles(){return this.triangles_}},Ex=.5,Dx=class extends yy{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(i,L.IDLE,d),this.renderEdges_=u===void 0?!1:u,this.pixelRatio_=o,this.gutter_=s,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=a||i,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;let f=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent(),m=this.sourceTileGrid_.getExtent(),h=p?Sn(f,p):f;if(mn(h)===0){this.state=L.EMPTY;return}let g=e.getExtent();g&&(m=m?Sn(m,g):g);let _=r.getResolution(this.wrappedTileCoord_[0]),v=xx(e,n,h,_);if(!isFinite(v)||v<=0){this.state=L.EMPTY;return}if(this.triangulation_=new Tx(e,n,h,m,v*(l===void 0?Ex:l),_),this.triangulation_.getTriangles().length===0){this.state=L.EMPTY;return}this.sourceZ_=t.getZForResolution(v);let y=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(y[1]=Mt(y[1],m[1],m[3]),y[3]=Mt(y[3],m[1],m[3])):y=Sn(y,m)),!mn(y))this.state=L.EMPTY;else{let n=0,r=0;e.canWrapX()&&(n=z(g),r=Math.floor((y[0]-g[0])/n)),jn(y.slice(),e,!0).forEach(e=>{let i=t.getTileRangeForExtentAndZ(e,this.sourceZ_);for(let e=i.minX;e<=i.maxX;e++)for(let t=i.minY;t<=i.maxY;t++){let i=c(this.sourceZ_,e,t,o);if(i){let e=r*n;this.sourceTiles_.push({tile:i,offset:e})}}++r}),this.sourceTiles_.length===0&&(this.state=L.EMPTY)}}getImage(){return this.canvas_}reproject_(){let e=[];if(this.sourceTiles_.forEach(t=>{let n=t.tile;if(n&&n.getState()==L.LOADED){let r=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);r[0]+=t.offset,r[2]+=t.offset;let i=this.clipExtent_?.slice();i&&(i[0]+=t.offset,i[2]+=t.offset),e.push({extent:r,clipExtent:i,image:n.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=L.ERROR;else{let t=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(t),r=typeof n==`number`?n:n[0],i=typeof n==`number`?n:n[1],a=this.targetTileGrid_.getResolution(t),o=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Sx(r,i,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),a,s,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=L.LOADED}this.changed()}load(){if(this.state==L.IDLE){this.state=L.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{let n=t.getState();if(n==L.IDLE||n==L.LOADING){e++;let n=N(t,M.CHANGE,r=>{let i=t.getState();(i==L.LOADED||i==L.ERROR||i==L.EMPTY)&&(rt(n),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(n)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},t,n){e.getState()==L.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(rt),this.sourcesListenerKeys_=null}release(){this.canvas_&&=(bo(this.canvas_.getContext(`2d`)),gx.push(this.canvas_),null),super.release()}},Ox=class{constructor(e){this.highWaterMark=e===void 0?2048:e,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){let e=this.pop();e instanceof Re&&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){let n=this.entries_[e];return R(n!==void 0,`Tried to get a value for a key that does not exist in the cache`),n===this.newest_?n.value_:(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n,n.value_)}remove(e){let t=this.entries_[e];return R(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(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.key_;return e}getValues(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){return this.entries_[e]?.value_}pop(){let 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){R(!(e in this.entries_),`Tried to set a value for a key that is used already`);let n={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[e]=n,++this.count_}setSize(e){this.highWaterMark=e}};function kx(e,t,n,r){return r===void 0?[e,t,n]:(r[0]=e,r[1]=t,r[2]=n,r)}function Ax(e,t,n){return e+`/`+t+`/`+n}function jx(e,t,n,r,i){return`${F(e)},${t},${Ax(n,r,i)}`}function Mx(e){return Nx(e[0],e[1],e[2])}function Nx(e,t,n){return(t<<e)+n}function Px(e,t){let n=e[0],r=e[1],i=e[2];if(t.getMinZoom()>n||n>t.getMaxZoom())return!1;let a=t.getFullTileRange(n);return a?a.containsXY(r,i):!0}function Fx(e,t,n){if(!(n in e))return e[n]=new Set([t]),!0;let r=e[n],i=r.has(t);return i||r.add(t),!i}function Ix(e,t,n){let r=e[n];return r?r.delete(t):!1}function Lx(e,t){let n=e.layerStatesArray[e.layerIndex];n.extent&&(t=Sn(t,xi(n.extent,e.viewState.projection)));let r=n.layer.getRenderSource();if(!r.getWrapX()){let n=r.getTileGridForProjection(e.viewState.projection).getExtent();n&&(t=Sn(t,n))}return t}var Rx=class extends hy{constructor(e,t){super(e),t||={},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=nn(),this.tempTileRange_=new Sy(0,0,0,0),this.tempTileCoord_=kx(0,0,0);let n=t.cacheSize===void 0?512:t.cacheSize;this.tileCache_=new Ox(n),this.sourceTileCache_=null,this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||=new Ox(512),this.sourceTileCache_}getOrCreateTile(e,t,n,r){let i=this.tileCache_,a=this.getLayer().getSource(),o=jx(a,a.getKey(),e,t,n),s;if(i.containsKey(o))s=i.get(o);else{let c=r.viewState.projection,l=a.getProjection();if(s=a.getTile(e,t,n,r.pixelRatio,c,!l||ui(l,c)?void 0:this.getSourceTileCache()),!s)return null;i.set(o,s)}return s}getTile(e,t,n,r){return this.getOrCreateTile(e,t,n,r)||null}getData(e){let t=this.frameState;if(!t)return null;let n=this.getLayer(),r=Ai(t.pixelToCoordinateTransform,e.slice()),i=n.getExtent();if(i&&!Qt(i,r))return null;let a=t.viewState,o=n.getRenderSource(),s=o.getTileGridForProjection(a.projection),c=o.getTilePixelRatio(t.pixelRatio);for(let e=s.getZForResolution(a.resolution);e>=s.getMinZoom();--e){let n=s.getTileCoordForCoordAndZ(r,e),i=this.getTile(e,n[1],n[2],t);if(!i||i.getState()!==L.LOADED)continue;let l=s.getOrigin(e),u=hc(s.getTileSize(e)),d=s.getResolution(e),f;if(i instanceof by||i instanceof Dx)f=i.getImage();else if(i instanceof mx){if(f=cx(i.getData()),!f)continue}else continue;let p=Math.floor(c*((r[0]-l[0])/d-n[1]*u[0])),m=Math.floor(c*((l[1]-r[1])/d-n[2]*u[1])),h=Math.round(c*o.getGutterForProjection(a.projection));return this.getImageData(f,p+h,m+h)}return null}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;let t=this.getLayer().getSource();if(!t)return!1;let n=t.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==n&&(this.renderedSourceRevision_=n,this.renderedSourceKey_===t.getKey()&&(this.tileCache_.clear(),this.sourceTileCache_?.clear())):this.renderedSourceRevision_=n,!0}enqueueTilesForNextExtent(){return!0}enqueueTiles(e,t,n,r,i){let a=e.viewState,o=this.getLayer(),s=o.getRenderSource(),c=s.getTileGridForProjection(a.projection),l=F(s);l in e.wantedTiles||(e.wantedTiles[l]={});let u=e.wantedTiles[l],d=o.getMapInternal(),f=Math.max(n-i,c.getMinZoom(),c.getZForResolution(Math.min(o.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):c.getResolution(0)),s.zDirection)),p=a.rotation,m=p?bn(a.center,a.resolution,p,e.size):void 0;for(let i=n;i>=f;--i){let n=c.getTileRangeForExtentAndZ(t,i,this.tempTileRange_),a=c.getResolution(i);for(let t=n.minX;t<=n.maxX;++t)for(let o=n.minY;o<=n.maxY;++o){if(p&&!c.tileCoordIntersectsViewport([i,t,o],m))continue;let n=this.getTile(i,t,o,e);if(!n||!Fx(r,n,i))continue;let s=n.getKey();if(u[s]=!0,n.getState()===L.IDLE&&!e.tileQueue.isKeyQueued(s)){let r=kx(i,t,o,this.tempTileCoord_);e.tileQueue.enqueue([n,l,c.getTileCoordCenter(r),a])}}}}findStaleTile_(e,t){let n=this.tileCache_,r=e[0],i=e[1],a=e[2],o=this.getStaleKeys();for(let e=0;e<o.length;++e){let s=jx(this.getLayer().getSource(),o[e],r,i,a);if(n.containsKey(s)){let e=n.peek(s);if(e.getState()===L.LOADED)return e.endTransition(F(this)),Fx(t,e,r),!0}}return!1}findAltTiles_(e,t,n,r){let i=e.getTileRangeForTileCoordAndZ(t,n,this.tempTileRange_);if(!i)return!1;let a=!0,o=this.tileCache_,s=this.getLayer().getRenderSource(),c=s.getKey();for(let e=i.minX;e<=i.maxX;++e)for(let t=i.minY;t<=i.maxY;++t){let i=jx(s,c,n,e,t),l=!1;if(o.containsKey(i)){let e=o.peek(i);e.getState()===L.LOADED&&(Fx(r,e,n),l=!0)}l||(a=!1)}return a}renderFrame(e,t){this.renderComplete=!0;let n=e.layerStatesArray[e.layerIndex],r=e.viewState,i=r.projection,a=r.resolution,o=r.center,s=e.pixelRatio,c=this.getLayer(),l=c.getSource(),u=l.getTileGridForProjection(i),d=u.getZForResolution(a,l.zDirection),f=u.getResolution(d),p=l.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==p&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=p):this.renderedSourceKey_=p;let m=e.extent,h=l.getTilePixelRatio(s);this.prepareContainer(e,t);let g=this.context.canvas.width,_=this.context.canvas.height,v=n.extent&&xi(n.extent,i);v&&(m=Sn(m,xi(n.extent,i)));let y=f*g/2/h,b=f*_/2/h,x=[o[0]-y,o[1]-b,o[0]+y,o[1]+b],S={};this.renderedTiles.length=0;let C=c.getPreload();if(e.nextExtent&&this.enqueueTilesForNextExtent()){let t=u.getZForResolution(r.nextResolution,l.zDirection),n=Lx(e,e.nextExtent);this.enqueueTiles(e,n,t,S,C)}let w=Lx(e,m);if(this.enqueueTiles(e,w,d,S,0),C>0&&setTimeout(()=>{this.enqueueTiles(e,w,d-1,S,C-1)},0),!(d in S))return this.container;let T=F(this),E=e.time;for(let t of S[d]){let n=t.getState();if(n===L.EMPTY)continue;let r=t.tileCoord;if(n===L.LOADED&&t.getAlpha(T,E)===1){t.endTransition(T);continue}if(n!==L.ERROR&&(this.renderComplete=!1),this.findStaleTile_(r,S)){Ix(S,t,d),e.animate=!0;continue}if(this.findAltTiles_(u,r,d+1,S))continue;let i=u.getMinZoom();for(let e=d-1;e>=i&&!this.findAltTiles_(u,r,e,S);--e);}let D=f/a*s/h,O=this.getRenderContext(e);Ni(this.tempTransform,g/2,_/2,D,D,0,-g/2,-_/2),n.extent&&this.clipUnrotated(O,e,v),l.getInterpolate()||(O.imageSmoothingEnabled=!1),this.preRender(O,e);let k=Object.keys(S).map(Number);k.sort(Be);let A,ee=[],j=[];for(let t=k.length-1;t>=0;--t){let n=k[t],r=l.getTilePixelSize(n,s,i),a=u.getResolution(n)/f,o=r[0]*a*D,c=r[1]*a*D,d=u.getTileCoordForCoordAndZ(Cn(x),n),p=u.getTileCoordExtent(d),m=Ai(this.tempTransform,[h*(p[0]-x[0])/f,h*(x[3]-p[3])/f]),g=h*l.getGutterForProjection(i);for(let t of S[n]){if(t.getState()!==L.LOADED)continue;let r=t.tileCoord,i=d[1]-r[1],a=Math.round(m[0]-(i-1)*o),s=d[2]-r[2],u=Math.round(m[1]-(s-1)*c),f=Math.round(m[0]-i*o),p=Math.round(m[1]-s*c),h=a-f,_=u-p,v=k.length===1,y=!1;A=[f,p,f+h,p,f+h,p+_,f,p+_];for(let e=0,t=ee.length;e<t;++e)if(!v&&n<j[e]){let t=ee[e];Tn([f,p,f+h,p+_],[t[0],t[3],t[4],t[7]])&&(y||=(O.save(),!0),O.beginPath(),O.moveTo(A[0],A[1]),O.lineTo(A[2],A[3]),O.lineTo(A[4],A[5]),O.lineTo(A[6],A[7]),O.moveTo(t[6],t[7]),O.lineTo(t[4],t[5]),O.lineTo(t[2],t[3]),O.lineTo(t[0],t[1]),O.clip())}ee.push(A),j.push(n),this.drawTile(t,e,f,p,h,_,g,v),y&&O.restore(),this.renderedTiles.unshift(t),this.updateUsedTiles(e.usedTiles,l,t)}}return this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!cn(this.renderedExtent_,x),this.renderedExtent_=x,this.renderedPixelRatio=s,this.postRender(this.context,e),n.extent&&O.restore(),O.imageSmoothingEnabled=!0,this.renderComplete&&e.postRenderFunctions.push((e,t)=>{let n=F(l),r=t.wantedTiles[n],i=r?Object.keys(r).length:0;this.updateCacheSize(i),this.tileCache_.expireCache(),this.sourceTileCache_?.expireCache()}),this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,t,n,r,i,a,o,s){let c;if(e instanceof mx){if(c=cx(e.getData()),!c)throw Error(`Rendering array data is not yet supported`)}else c=this.getTileImage(e);if(!c)return;let l=this.getRenderContext(t),u=F(this),d=t.layerStatesArray[t.layerIndex],f=d.opacity*(s?e.getAlpha(u,t.time):1),p=f!==l.globalAlpha;p&&(l.save(),l.globalAlpha=f),l.drawImage(c,o,o,c.width-2*o,c.height-2*o,n,r,i,a),p&&l.restore(),f===d.opacity?s&&e.endTransition(u):t.animate=!0}getImage(){let e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,t,n){let r=F(t);r in e||(e[r]={}),e[r][n.getKey()]=!0}},zx={PRELOAD:`preload`,USE_INTERIM_TILES_ON_ERROR:`useInterimTilesOnError`},Bx=class extends Cs{constructor(e){e||={};let t=Object.assign({},e),n=e.cacheSize;delete e.cacheSize,delete t.preload,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(e.preload===void 0?0:e.preload),this.setUseInterimTilesOnError(e.useInterimTilesOnError===void 0?!0:e.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(zx.PRELOAD)}setPreload(e){this.set(zx.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(zx.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(zx.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}},Vx=class extends Bx{constructor(e){super(e)}createRenderer(){return new Rx(this,{cacheSize:this.getCacheSize()})}},Hx={image:[`Polygon`,`Circle`,`LineString`,`Image`,`Text`],hybrid:[`Polygon`,`LineString`],vector:[]},Ux={hybrid:[`Image`,`Text`,`Default`],vector:[`Polygon`,`Circle`,`LineString`,`Image`,`Text`,`Default`]},Wx=class extends Rx{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=Ti(),this.tileClipContexts_=null}enqueueTilesForNextExtent(){return this.getLayer().getRenderMode()!==`vector`}drawTile(e,t,n,r,i,a,o,s){this.updateExecutorGroup_(e,t.pixelRatio,t.viewState.projection),this.tileImageNeedsRender_(e)&&this.renderTileImage_(e,t),super.drawTile(e,t,n,r,i,a,o,s)}getTile(e,t,n,r){let i=this.getOrCreateTile(e,t,n,r);if(!i)return null;let a=r.viewState,o=a.resolution,s=r.viewHints,c=this.getLayer().getSource(),l=c.getTileGridForProjection(a.projection),u=!(s[At.ANIMATING]||s[At.INTERACTING]),d=l.getZForResolution(o,c.zDirection)===e;return u&&d?i.wantedResolution=o:i.wantedResolution||=l.getResolution(e),i}prepareFrame(e){let t=this.getLayer().getRevision();return this.renderedLayerRevision_!==t&&(this.renderedLayerRevision_=t,this.renderedTiles.length=0),super.prepareFrame(e)}updateExecutorGroup_(e,t,n){let r=this.getLayer(),i=r.getRevision(),a=r.getRenderOrder()||null,o=e.wantedResolution,s=e.getReplayState(r);if(!s.dirty&&s.renderedResolution===o&&s.renderedRevision==i&&s.renderedRenderOrder==a)return;let c=r.getSource(),l=!!r.getDeclutter(),u=c.getTileGrid(),d=c.getTileGridForProjection(n).getTileCoordExtent(e.wrappedTileCoord),f=c.getSourceTiles(t,n,e),p=F(r);delete e.hitDetectionImageData[p],e.executorGroups[p]=[],s.dirty=!1;for(let i=0,m=f.length;i<m;++i){let m=f[i];if(m.getState()!=L.LOADED)continue;let h=c.getProjection(),g=m.tileCoord,_=u.getTileCoordExtent(g);n&&h&&!ui(n,h)&&(_=hi(_,h,n,32));let v=Sn(d,_),y=Yt(v,r.getRenderBuffer()*o,this.tempExtent),b=cn(_,v)?null:y,x=new Vv(0,v,o,t),S=av(o,t),C=function(e,t){let n,i=e.getStyleFunction()||r.getStyleFunction();if(i&&(n=i(e,o)),n){let r=this.renderFeature(e,S,n,x,l,t);s.dirty=s.dirty||r}},w=m.getFeatures();a&&a!==s.renderedRenderOrder&&w.sort(a);for(let e=0,t=w.length;e<t;++e){let t=w[e];n&&m.projection&&!ui(n,m.projection)&&(t=t.clone(),t.getGeometry().applyTransform(pi(m.projection,n))),(!b||Tn(b,t.getGeometry().getExtent()))&&C.call(this,t,e)}let T=x.finish(),E=new iy(r.getRenderMode()!==`vector`&&l&&f.length===1?null:v,o,t,c.getOverlaps(),T,r.getRenderBuffer(),!0);e.executorGroups[p].push(E)}s.renderedRevision=i,s.renderedRenderOrder=a,s.renderedResolution=o}forEachFeatureAtCoordinate(e,t,n,r,i){let a=t.viewState.resolution,o=t.viewState.rotation;n??=0;let s=this.getLayer(),c=s.getSource().getTileGridForProjection(t.viewState.projection),l=qt([e]);Yt(l,a*n,l);let u={},d=function(e,t,n){let a=e.getId();a===void 0&&(a=F(e));let o=u[a];if(!o){if(n===0)return u[a]=!0,r(e,s,t);i.push(u[a]={feature:e,layer:s,geometry:t,distanceSq:n,callback:r})}else if(o!==!0&&n<o.distanceSq){if(n===0)return u[a]=!0,i.splice(i.lastIndexOf(o),1),r(e,s,t);o.geometry=t,o.distanceSq=n}},f=this.renderedTiles,p=F(s),m=s.getDeclutter(),h=m?t.declutter?.[m]?.all().map(e=>e.value):null,g;foundFeature:for(let t=0,r=f.length;t<r;++t){let r=f[t];if(!Tn(c.getTileCoordExtent(r.wrappedTileCoord),l))continue;let i=r.executorGroups[p];for(let t=0,r=i.length;t<r;++t)if(g=i[t].forEachFeatureAtCoordinate(e,a,o,n,d,h),g)break foundFeature}return g}getFeatures(e){return this.renderedTiles.length===0?Promise.resolve([]):new Promise((t,n)=>{let r=this.getLayer(),i=r.getSource(),a=this.renderedProjection,o=a.getExtent(),s=this.renderedResolution,c=i.getTileGridForProjection(a),l=Ai(this.renderedPixelToCoordinateTransform_,e.slice()),u=c.getTileCoordForCoordAndResolution(l,s).toString(),d=this.renderedTiles.find(e=>e.tileCoord.toString()===u&&e.getState()===L.LOADED);if(!d||d.loadingSourceTiles>0){t([]);return}i.getWrapX()&&a.canWrapX()&&!$t(o,c.getTileCoordExtent(d.tileCoord))&&Bn(l,a);let f=F(r),p=Cn(c.getTileCoordExtent(d.wrappedTileCoord)),m=[(l[0]-p[0])/s,(p[1]-l[1])/s],h=d.getSourceTiles().reduce((e,t)=>e.concat(t.getFeatures()),[]),g=d.hitDetectionImageData[f];if(!g){let e=hc(c.getTileSize(c.getZForResolution(s,i.zDirection))),t=this.renderedRotation_;g=cy(e,[this.getRenderTransform(c.getTileCoordCenter(d.wrappedTileCoord),s,0,sy,e[0]*sy,e[1]*sy,0)],h,r.getStyleFunction(),c.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(r).renderedResolution,t),d.hitDetectionImageData[f]=g}t(ly(m,h,g))})}getFeaturesInExtent(e){let t=[],n=this.getTileCache();if(n.getCount()===0)return t;let r=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),i=r.getZForResolution(this.renderedResolution),a={};return n.forEach(n=>{if(n.tileCoord[0]!==i||n.getState()!==L.LOADED)return;let o=n.getSourceTiles();for(let n=0,i=o.length;n<i;++n){let i=o[n],s=i.getKey();if(s in a)continue;a[s]=!0;let c=i.tileCoord;if(Tn(e,r.getTileCoordExtent(c))){let n=i.getFeatures();if(n)for(let r=0,i=n.length;r<i;++r){let i=n[r];Tn(e,i.getGeometry().getExtent())&&t.push(i)}}}}),t}handleFontsChanged(){let e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e,t){let n=this.context,r=n.globalAlpha;n.globalAlpha=t.opacity;let i=e.viewHints,a=!(i[At.ANIMATING]||i[At.INTERACTING]),o=[this.context.canvas.width,this.context.canvas.height],s=this.getLayer().getDeclutter(),c=s?e.declutter?.[s]:void 0,l=F(this.getLayer()),u=this.renderedTiles;for(let t=0,n=u.length;t<n;++t){let n=u[t],r=n.executorGroups[l];if(r)for(let t=r.length-1;t>=0;--t)r[t].execute(this.context,o,this.getTileRenderTransform(n,e),e.viewState.rotation,a,ny,c)}n.globalAlpha=r}renderDeferredInternal(e){let t=this.renderedTiles,n=F(this.getLayer()),r=t.reduce((e,t,r)=>(t.executorGroups[n].forEach(t=>e.push({executorGroup:t,index:r})),e),[]),i=r.map(({executorGroup:e})=>e.getDeferredZIndexContexts()),a={};for(let e=0,t=r.length;e<t;++e){let t=r[e].executorGroup.getDeferredZIndexContexts();for(let e in t)a[e]=!0}Object.keys(a).map(Number).sort(Be).forEach(e=>{i.forEach((t,n)=>{t[e]&&(t[e].forEach(e=>{let{executorGroup:t,index:i}=r[n],a=t.getRenderedContext(),o=a.globalAlpha;a.globalAlpha=this.renderedOpacity_;let s=this.tileClipContexts_[i];s&&s.draw(a),e.draw(a),s&&a.restore(),a.globalAlpha=o,e.clear()}),t[e].length=0)})})}getTileRenderTransform(e,t){let n=t.pixelRatio,r=t.viewState,i=r.center,a=r.resolution,o=r.rotation,s=t.size,c=Math.round(s[0]*n),l=Math.round(s[1]*n),u=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),d=e.tileCoord,f=u.getTileCoordExtent(e.wrappedTileCoord),p=u.getTileCoordExtent(d,this.tempExtent)[0]-f[0];return Di(ji(this.inversePixelTransform.slice(),1/n,1/n),this.getRenderTransform(i,a,o,n,c,l,p))}postRender(e,t){let n=t.viewHints,r=!(n[At.ANIMATING]||n[At.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;let i=this.getLayer(),a=i.getRenderMode(),o=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;let s=i.getDeclutter(),c=s?Ux[a].filter(e=>!ny.includes(e)):Ux[a],l=t.viewState,u=l.rotation,d=i.getSource(),f=d.getTileGridForProjection(l.projection).getZForResolution(l.resolution,d.zDirection),p=this.renderedTiles,m=[],h=[],g=[],_=F(i),v=!0;for(let n=p.length-1;n>=0;--n){let a=p[n];v&&=!a.getReplayState(i).dirty;let o=a.executorGroups[_].filter(e=>e.hasExecutors(c));if(o.length===0)continue;let l=this.getTileRenderTransform(a,t),d=a.tileCoord[0],y=!1,b=o[0].getClipCoords(l),x=e,S;if(b){S=new Uv,x=S.getContext();for(let e=0,t=m.length;e<t;++e)if(f!==d&&d<h[e]){let t=m[e];Tn([b[0],b[3],b[4],b[7]],[t[0],t[3],t[4],t[7]])&&(y||=(x.save(),!0),x.beginPath(),x.moveTo(b[0],b[1]),x.lineTo(b[2],b[3]),x.lineTo(b[4],b[5]),x.lineTo(b[6],b[7]),x.moveTo(t[6],t[7]),x.lineTo(t[4],t[5]),x.lineTo(t[2],t[3]),x.lineTo(t[0],t[1]),x.clip())}m.push(b),h.push(d)}for(let n=0,i=o.length;n<i;++n)o[n].execute(e,[e.canvas.width,e.canvas.height],l,u,r,c,t.declutter?.[s]);y&&(x===e?x.restore():g[n]=S)}e.globalAlpha=o,this.ready=v,this.tileClipContexts_=g,t.declutter||this.renderDeferredInternal(t),super.postRender(e,t)}renderFeature(e,t,n,r,i,a){if(!n)return!1;let o=!1;if(Array.isArray(n))for(let s=0,c=n.length;s<c;++s)o=cv(r,e,n[s],t,this.boundHandleStyleImageChange_,void 0,i,a)||o;else o=cv(r,e,n,t,this.boundHandleStyleImageChange_,void 0,i,a);return o}tileImageNeedsRender_(e){let t=this.getLayer();if(t.getRenderMode()===`vector`)return!1;let n=e.getReplayState(t),r=t.getRevision(),i=e.wantedResolution;return n.renderedTileResolution!==i||n.renderedTileRevision!==r}renderTileImage_(e,t){let n=this.getLayer(),r=e.getReplayState(n),i=n.getRevision(),a=e.executorGroups[F(n)];r.renderedTileRevision=i;let o=e.wrappedTileCoord,s=o[0],c=n.getSource(),l=t.pixelRatio,u=t.viewState.projection,d=c.getTileGridForProjection(u),f=d.getResolution(e.tileCoord[0]),p=t.pixelRatio/e.wantedResolution*f,m=d.getResolution(s),h=e.getContext();l=Math.round(Math.max(l,p/l));let g=c.getTilePixelSize(s,l,u);h.canvas.width=g[0],h.canvas.height=g[1];let _=l/p;if(_!==1){let e=Ei(this.tmpTransform_);ji(e,_,_),h.setTransform.apply(h,e)}let v=d.getTileCoordExtent(o,this.tempExtent),y=p/m,b=Ei(this.tmpTransform_);ji(b,y,-y),Mi(b,-v[0],-v[3]);for(let e=0,t=a.length;e<t;++e)a[e].execute(h,[h.canvas.width*_,h.canvas.height*_],b,0,!0,Hx[n.getRenderMode()],null);r.renderedTileResolution=e.wantedResolution}},Gx=class extends Uu{constructor(e){e||={};let t=Object.assign({},e);delete t.preload;let n=e.cacheSize===void 0?0:e.cacheSize;delete e.cacheSize,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=n;let r=e.renderMode||`hybrid`;R(r==`hybrid`||r==`vector`,"`renderMode` must be `'hybrid'` or `'vector'`"),this.renderMode_=r,this.setPreload(e.preload?e.preload:0),this.setUseInterimTilesOnError(e.useInterimTilesOnError===void 0?!0:e.useInterimTilesOnError),this.getBackground,this.setBackground}createRenderer(){return new Wx(this,{cacheSize:this.cacheSize_})}getFeatures(e){return super.getFeatures(e)}getFeaturesInExtent(e){return this.getRenderer().getFeaturesInExtent(e)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(zx.PRELOAD)}getUseInterimTilesOnError(){return this.get(zx.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(zx.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(zx.USE_INTERIM_TILES_ON_ERROR,e)}};function Kx(e){return Array.isArray(e)?Math.min(...e):e}var qx=class extends dl{constructor(e,t,n,r,i,a,o){let s=e.getExtent();s&&e.canWrapX()&&(s=s.slice(),s[0]=-1/0,s[2]=1/0);let c=t.getExtent();c&&t.canWrapX()&&(c=c.slice(),c[0]=-1/0,c[2]=1/0);let l=c?Sn(n,c):n,u=bx(e,t,_n(l),r),d=new Tx(e,t,l,s,u*Ex,r),f=d.calculateSourceExtent(),p=En(f)?null:a(f,u,i),m=p?G.IDLE:G.EMPTY,h=p?p.getPixelRatio():1;super(n,r,h,m),this.targetProj_=t,this.maxSourceExtent_=s,this.triangulation_=d,this.targetResolution_=r,this.targetExtent_=n,this.sourceImage_=p,this.sourcePixelRatio_=h,this.interpolate_=o,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==G.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){let e=this.sourceImage_.getState();e==G.LOADED&&(this.canvas_=Sx(z(this.targetExtent_)/this.targetResolution_,xn(this.targetExtent_)/this.targetResolution_,this.sourcePixelRatio_,Kx(this.sourceImage_.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_,!0)),this.state=e,this.changed()}load(){if(this.state==G.IDLE){this.state=G.LOADING,this.changed();let e=this.sourceImage_.getState();e==G.LOADED||e==G.ERROR?this.reproject_():(this.sourceListenerKey_=N(this.sourceImage_,M.CHANGE,e=>{let t=this.sourceImage_.getState();(t==G.LOADED||t==G.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){rt(this.sourceListenerKey_),this.sourceListenerKey_=null}},Jx={IMAGELOADSTART:`imageloadstart`,IMAGELOADEND:`imageloadend`,IMAGELOADERROR:`imageloaderror`},Yx=class extends et{constructor(e,t){super(e),this.image=t}},Xx=class extends wv{constructor(e){super({attributions:e.attributions,projection:e.projection,state:e.state,interpolate:e.interpolate===void 0?!0:e.interpolate}),this.on,this.once,this.un,this.loader=e.loader||null,this.resolutions_=e.resolutions===void 0?null:e.resolutions,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){let t=this.getResolutions();return t&&(e=t[He(t,e,0)]),e}getImage(e,t,n,r){let i=this.getProjection();if(!i||!r||ui(i,r))return i&&(r=i),this.getImageInternal(e,t,n,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&ui(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&cn(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new qx(i,r,e,t,n,(e,t,n)=>this.getImageInternal(e,t,n,i),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(e,t,n,r){if(this.loader){let i=Zx(e,t,n,1),a=this.findNearestResolution(t);if(this.image&&(this.static_||this.wantedProjection_===r&&(this.wantedExtent_&&$t(this.wantedExtent_,i)||$t(this.image.getExtent(),i))&&(this.wantedResolution_&&Kx(this.wantedResolution_)===a||Kx(this.image.getResolution())===a)))return this.image;this.wantedProjection_=r,this.wantedExtent_=i,this.wantedResolution_=a,this.image=new dl(i,a,n,this.loader),this.image.addEventListener(M.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(e){let t=e.target,n;switch(t.getState()){case G.LOADING:this.loading=!0,n=Jx.IMAGELOADSTART;break;case G.LOADED:this.loading=!1,n=Jx.IMAGELOADEND;break;case G.ERROR:this.loading=!1,n=Jx.IMAGELOADERROR;break;default:return}this.hasListener(n)&&this.dispatchEvent(new Yx(n,t))}};function Zx(e,t,n,r){let i=t/n,a=_n(e),o=Ht(z(e)/i,4),s=Ht(xn(e)/i,4);return yn(a,i,0,[o+2*Ht((r-1)*o/2,4),s+2*Ht((r-1)*s/2,4)])}var Qx=[0,0,0],$x=5,eS=class{constructor(e){this.minZoom=e.minZoom===void 0?0:e.minZoom,this.resolutions_=e.resolutions,R(Ke(this.resolutions_,(e,t)=>t-e,!0),"`resolutions` must be sorted in descending order");let t;if(!e.origins){for(let e=0,n=this.resolutions_.length-1;e<n;++e)if(!t)t=this.resolutions_[e]/this.resolutions_[e+1];else if(this.resolutions_[e]/this.resolutions_[e+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin===void 0?null:e.origin,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,R(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));let n=e.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=Cn(n)),R(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,R(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize===void 0?this.tileSizes_?null:256:e.tileSize,R(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=n===void 0?null:n,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes===void 0?n&&this.calculateTileRanges_(n):this.fullTileRanges_=e.sizes.map((e,t)=>{let r=new Sy(Math.min(0,e[0]),Math.max(e[0]-1,-1),Math.min(0,e[1]),Math.max(e[1]-1,-1));if(n){let e=this.getTileRangeForExtentAndZ(n,t);r.minX=Math.max(e.minX,r.minX),r.maxX=Math.min(e.maxX,r.maxX),r.minY=Math.max(e.minY,r.minY),r.maxY=Math.min(e.maxY,r.maxY)}return r})}forEachTileCoord(e,t,n){let r=this.getTileRangeForExtentAndZ(e,t);for(let e=r.minX,i=r.maxX;e<=i;++e)for(let i=r.minY,a=r.maxY;i<=a;++i)n([t,e,i])}forEachTileCoordParentTileRange(e,t,n,r){let i,a,o,s=null,c=e[0]-1;for(this.zoomFactor_===2?(a=e[1],o=e[2]):s=this.getTileCoordExtent(e,r);c>=this.minZoom;){if(a!==void 0&&o!==void 0?(a=Math.floor(a/2),o=Math.floor(o/2),i=Cy(a,a,o,o,n)):i=this.getTileRangeForExtentAndZ(s,c,n),t(c,i))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,n){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){let n=e[1]*2,r=e[2]*2;return Cy(n,n+1,r,r+1,t)}let r=this.getTileCoordExtent(e,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,n){if(t>this.maxZoom||t<this.minZoom)return null;let r=e[0],i=e[1],a=e[2];if(t===r)return Cy(i,a,i,a,n);if(this.zoomFactor_){let e=this.zoomFactor_**+(t-r),o=Math.floor(i*e),s=Math.floor(a*e);return t<r?Cy(o,o,s,s,n):Cy(o,Math.floor(e*(i+1))-1,s,Math.floor(e*(a+1))-1,n)}let o=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t,n)}getTileRangeForExtentAndZ(e,t,n){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,Qx);let r=Qx[1],i=Qx[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,Qx);let a=Qx[1],o=Qx[2];return Cy(r,a,i,o,n)}getTileCoordCenter(e){let t=this.getOrigin(e[0]),n=this.getResolution(e[0]),r=hc(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*n,t[1]-(e[2]+.5)*r[1]*n]}getTileCoordExtent(e,t){let n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=hc(this.getTileSize(e[0]),this.tmpSize_),a=n[0]+e[1]*i[0]*r,o=n[1]-(e[2]+1)*i[1]*r;return rn(a,o,a+i[0]*r,o+i[1]*r,t)}getTileCoordForCoordAndResolution(e,t,n){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,n)}getTileCoordForXYAndResolution_(e,t,n,r,i){let a=this.getZForResolution(n),o=n/this.getResolution(a),s=this.getOrigin(a),c=hc(this.getTileSize(a),this.tmpSize_),l=o*(e-s[0])/n/c[0],u=o*(s[1]-t)/n/c[1];return r?(l=Ht(l,$x)-1,u=Ht(u,$x)-1):(l=Vt(l,$x),u=Vt(u,$x)),kx(a,l,u,i)}getTileCoordForXYAndZ_(e,t,n,r,i){let a=this.getOrigin(n),o=this.getResolution(n),s=hc(this.getTileSize(n),this.tmpSize_),c=(e-a[0])/o/s[0],l=(a[1]-t)/o/s[1];return r?(c=Ht(c,$x)-1,l=Ht(l,$x)-1):(c=Vt(c,$x),l=Vt(l,$x)),kx(n,c,l,i)}getTileCoordForCoordAndZ(e,t,n){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,n)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){return Mt(He(this.resolutions_,e,t||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return ja(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){let t=this.resolutions_.length,n=Array(t);for(let r=this.minZoom;r<t;++r)n[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=n}};function tS(e){let t=e.getDefaultTileGrid();return t||(t=oS(e),e.setDefaultTileGrid(t)),t}function nS(e,t,n){let r=t[0],i=e.getTileCoordCenter(t),a=sS(n);if(!Qt(a,i)){let t=z(a),n=Math.ceil((a[0]-i[0])/t);return i[0]+=t*n,e.getTileCoordForCoordAndZ(i,r)}return t}function rS(e,t,n,r){r=r===void 0?`top-left`:r;let i=aS(e,t,n);return new eS({extent:e,origin:vn(e,r),resolutions:i,tileSize:n})}function iS(e){let t=e||{},n=t.extent||B(`EPSG:3857`).getExtent();return new eS({extent:n,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:aS(n,t.maxZoom,t.tileSize,t.maxResolution)})}function aS(e,t,n,r){t=t===void 0?42:t,n=hc(n===void 0?256:n);let i=xn(e),a=z(e);r=r>0?r:Math.max(a/n[0],i/n[1]);let o=t+1,s=Array(o);for(let e=0;e<o;++e)s[e]=r/2**e;return s}function oS(e,t,n,r){return rS(sS(e),t,n,r)}function sS(e){e=B(e);let t=e.getExtent();if(!t){let n=180*Xn.degrees/e.getMetersPerUnit();t=rn(-n,-n,n,n)}return t}var cS=class extends wv{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio===void 0?1:e.tilePixelRatio,this.tileGrid=e.tileGrid===void 0?null:e.tileGrid,this.tileGrid&&hc(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=e.key||F(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){let t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,n,r,i,a){return P()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:tS(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,n){let r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(t),a=hc(r.getTileSize(e),this.tmpSize);return i==1?a:mc(a,i,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){let n=t===void 0?this.getProjection():t,r=t===void 0&&this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(e=nS(r,e,n)),Px(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}},lS=class extends et{constructor(e,t){super(e),this.tile=t}};function uS(e){return function(t){let n=t.buffers,r=t.meta,i=t.imageOps,a=t.width,o=t.height,s=n.length,c=n[0].byteLength;if(i){let t=Array(s);for(let e=0;e<s;++e)t[e]=new ImageData(new Uint8ClampedArray(n[e]),a,o);return e(t,r).data.buffer}let l=new Uint8ClampedArray(c),u=Array(s),d=Array(s);for(let e=0;e<s;++e)u[e]=new Uint8ClampedArray(n[e]),d[e]=[0,0,0,0];for(let t=0;t<c;t+=4){for(let e=0;e<s;++e){let n=u[e];d[e][0]=n[t],d[e][1]=n[t+1],d[e][2]=n[t+2],d[e][3]=n[t+3]}let n=e(d,r);l[t]=n[0],l[t+1]=n[1],l[t+2]=n[2],l[t+3]=n[3]}return l.buffer}}function dS(e,t){let n=Object.keys(e.lib||{}).map(function(t){return`const `+t+` = `+e.lib[t].toString()+`;`}).concat([`const __minion__ = (`+uS.toString()+`)(`,e.operation.toString(),`);`,`self.addEventListener("message", function(event) {`,` const buffer = __minion__(event.data);`,` self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);`,`});`]),r=new Worker(typeof Blob>`u`?`data:text/javascript;base64,`+Buffer.from(n.join(`
18
+ `),`binary`).toString(`base64`):URL.createObjectURL(new Blob(n,{type:`text/javascript`})));return r.addEventListener(`message`,t),r}function fS(e,t){let n=uS(e.operation),r=!1;return{postMessage:function(e){setTimeout(function(){r||t({data:{buffer:n(e),meta:e.meta}})},0)},terminate:function(){r=!0}}}var pS=class extends Re{constructor(e){super(),this.imageOps_=!!e.imageOps;let t;t=e.threads===0?0:this.imageOps_?1:e.threads||1;let n=Array(t);if(t)for(let r=0;r<t;++r)n[r]=dS(e,this.onWorkerMessage_.bind(this,r));else n[0]=fS(e,this.onWorkerMessage_.bind(this,0));this.workers_=n,this.queue_=[],this.maxQueueLength_=e.queue||1/0,this.running_=0,this.dataLookup_={},this.job_=null}process(e,t,n){this.enqueue_({inputs:e,meta:t,callback:n}),this.dispatch_()}enqueue_(e){for(this.queue_.push(e);this.queue_.length>this.maxQueueLength_;)this.queue_.shift().callback(null,null)}dispatch_(){if(this.running_||this.queue_.length===0)return;let e=this.queue_.shift();this.job_=e;let t=e.inputs[0].width,n=e.inputs[0].height,r=e.inputs.map(function(e){return e.data.buffer}),i=this.workers_.length;if(this.running_=i,i===1){this.workers_[0].postMessage({buffers:r,meta:e.meta,imageOps:this.imageOps_,width:t,height:n},r);return}let a=e.inputs[0].data.length,o=4*Math.ceil(a/4/i);for(let a=0;a<i;++a){let i=a*o,s=[];for(let e=0,t=r.length;e<t;++e)s.push(r[e].slice(i,i+o));this.workers_[a].postMessage({buffers:s,meta:e.meta,imageOps:this.imageOps_,width:t,height:n},s)}}onWorkerMessage_(e,t){this.disposed||(this.dataLookup_[e]=t.data,--this.running_,this.running_===0&&this.resolveJob_())}resolveJob_(){let e=this.job_,t=this.workers_.length,n,r;if(t===1)n=new Uint8ClampedArray(this.dataLookup_[0].buffer),r=this.dataLookup_[0].meta;else{let i=e.inputs[0].data.length;n=new Uint8ClampedArray(i),r=Array(t);let a=4*Math.ceil(i/4/t);for(let e=0;e<t;++e){let t=this.dataLookup_[e].buffer,i=e*a;n.set(new Uint8ClampedArray(t),i),r[e]=this.dataLookup_[e].meta}}this.job_=null,this.dataLookup_={},e.callback(null,new ImageData(n,e.inputs[0].width,e.inputs[0].height),r),this.dispatch_()}disposeInternal(){for(let e=0;e<this.workers_.length;++e)this.workers_[e].terminate();this.workers_.length=0}},mS={BEFOREOPERATIONS:`beforeoperations`,AFTEROPERATIONS:`afteroperations`},hS=class extends et{constructor(e,t,n){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=n}},gS=class extends Xx{constructor(e){super({projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=e.operationType===void 0?`pixel`:e.operationType,this.threads_=e.threads===void 0?1:e.threads,this.layers_=bS(e.sources);let t=this.changed.bind(this);for(let e=0,n=this.layers_.length;e<n;++e)this.layers_[e].addEventListener(M.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new Ot(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:Ti(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:yS(this.layers_),pixelRatio:1,pixelToCoordinateTransform:Ti(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:F(this),renderTargets:{}},this.setAttributions(function(t){let n=[];for(let r=0,i=e.sources.length;r<i;++r){let i=e.sources[r],a=i instanceof wv?i:i.getSource();if(!a)continue;let o=a.getAttributions()?.(t);typeof o==`string`?n.push(o):o!==void 0&&n.push(...o)}return n}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new pS({operation:e,imageOps:this.operationType_===`image`,queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,n){let r=Object.assign({},this.frameState_);r.viewState=Object.assign({},r.viewState);let i=_n(e);r.size[0]=Math.ceil(z(e)/t),r.size[1]=Math.ceil(xn(e)/t),r.extent=[i[0]-r.size[0]*t/2,i[1]-r.size[1]*t/2,i[0]+r.size[0]*t/2,i[1]+r.size[1]*t/2],r.time=Date.now();let a=r.viewState;return a.center=i,a.projection=n,a.resolution=t,r}allSourcesReady_(){let e=!0,t;for(let n=0,r=this.layers_.length;n<r;++n)if(t=this.layers_[n].getSource(),!t||t.getState()!==`ready`){e=!1;break}return e}getImage(e,t,n,r){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16),t=this.findNearestResolution(t);let i=this.updateFrameState_(e,t,r);if(this.requestedFrameState_=i,this.renderedImageCanvas_){let e=this.renderedImageCanvas_.getResolution(),n=this.renderedImageCanvas_.getExtent();(t!==e||!cn(i.extent,n))&&(this.renderedImageCanvas_=null)}return(!this.renderedImageCanvas_||this.getRevision()!==this.renderedRevision_)&&this.processSources_(),i.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){let e=this.requestedFrameState_,t=this.layers_.length,n=Array(t);for(let r=0;r<t;++r){e.layerIndex=r,e.renderTargets={};let t=vS(this.layers_[r],e);if(t)n[r]=t;else return}let r={};this.dispatchEvent(new hS(mS.BEFOREOPERATIONS,e,r)),this.processor_.process(n,r,this.onWorkerComplete_.bind(this,e))}onWorkerComplete_(e,t,n,r){if(t||!n)return;let i=e.extent,a=e.viewState.resolution;if(a!==this.requestedFrameState_.viewState.resolution||!cn(i,this.requestedFrameState_.extent))return;let o;this.renderedImageCanvas_?o=this.renderedImageCanvas_.getImage().getContext(`2d`):(o=_o(Math.round(z(i)/a),Math.round(xn(i)/a)),this.renderedImageCanvas_=new vy(i,a,1,o.canvas)),o.putImageData(n,0,0),e.animate?requestAnimationFrame(this.changed.bind(this)):this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new hS(mS.AFTEROPERATIONS,e,r))}getResolutions(e){if(!this.useResolutions_)return null;let t=super.getResolutions();if(!t)for(let n=0,r=this.layers_.length;n<r&&(t=this.layers_[n].getSource().getResolutions(e),!t);++n);return t}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}};gS.prototype.dispose;var _S=null;function vS(e,t){let n=e.getRenderer();if(!n)throw Error(`Unsupported layer type: `+e);if(!n.prepareFrame(t))return null;let r=t.size[0],i=t.size[1];if(r===0||i===0)return null;let a=n.renderFrame(t,null),o;if(a instanceof HTMLCanvasElement)o=a;else{if(a&&(o=a.firstElementChild),!(o instanceof HTMLCanvasElement))throw Error(`Unsupported rendered element: `+o);if(o.width===r&&o.height===i)return o.getContext(`2d`).getImageData(0,0,r,i)}if(!_S)_S=_o(r,i,void 0,{willReadFrequently:!0});else{let e=_S.canvas;e.width!==r||e.height!==i?_S=_o(r,i,void 0,{willReadFrequently:!0}):_S.clearRect(0,0,r,i)}return _S.drawImage(o,0,0,r,i),_S.getImageData(0,0,r,i)}function yS(e){return e.map(function(e){return e.getLayerState()})}function bS(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=xS(e[r]);return n}function xS(e){let t;return e instanceof wv?e instanceof cS?t=new Vx({source:e}):e instanceof Xx&&(t=new sx({source:e})):t=e,t}function SS(e,t,n,r){let i=document.createElement(`script`),a=`olc_`+F(t);function o(){delete window[a],i.parentNode.removeChild(i)}i.async=!0,i.src=e+(e.includes(`?`)?`&`:`?`)+(r||`callback`)+`=`+a;let s=setTimeout(function(){o(),n&&n()},1e4);window[a]=function(e){clearTimeout(s),o(),t(e)},document.head.appendChild(i)}var CS=/\{z\}/g,wS=/\{x\}/g,TS=/\{y\}/g,ES=/\{-y\}/g;function DS(e,t,n,r,i){return e.replace(CS,t.toString()).replace(wS,n.toString()).replace(TS,r.toString()).replace(ES,function(){if(i===void 0)throw Error(`If the URL template has a {-y} placeholder, the grid extent must be known`);return(i-r).toString()})}function OS(e,t,n,r){return e[Rt(Nx(t,n,r),e.length)]}function kS(e){let t=[],n=/\{([a-z])-([a-z])\}/.exec(e);if(n){let r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),a;for(a=r;a<=i;++a)t.push(e.replace(n[0],String.fromCharCode(a)));return t}if(n=/\{(\d+)-(\d+)\}/.exec(e),n){let r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)t.push(e.replace(n[0],i.toString()));return t}return t.push(e),t}function AS(e,t){return(function(n,r,i){if(!n)return;let a,o=n[0];if(t){let e=t.getFullTileRange(o);e&&(a=e.getHeight()-1)}return DS(e,o,n[1],n[2],a)})}function jS(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=AS(e[i],t);return MS(r)}function MS(e){return e.length===1?e[0]:(function(t,n,r){if(t)return e[Rt(Mx(t),e.length)](t,n,r)})}var NS={TILELOADSTART:`tileloadstart`,TILELOADEND:`tileloadend`,TILELOADERROR:`tileloaderror`},PS=class e extends cS{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===e.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){let t=e.target,n=F(t),r=t.getState(),i;r==L.LOADING?(this.tileLoadingKeys_[n]=!0,i=NS.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],i=r==L.ERROR?NS.TILELOADERROR:r==L.LOADED?NS.TILELOADEND:void 0),i!=null&&this.dispatchEvent(new lS(i,t))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,t===void 0?this.changed():this.setKey(t)}setUrl(e){let t=kS(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;let t=e.join(`
19
+ `);this.generateTileUrlFunction_?this.setTileUrlFunction(jS(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}},FS=class extends PS{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:IS,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate===void 0?!0:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin===void 0?null:e.crossOrigin,this.tileClass=e.tileClass===void 0?by:e.tileClass,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!ui(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=`:disable-interpolation`),e}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||ui(t,e)))return this.tileGrid;let n=F(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=tS(e)),this.tileGridForProjection[n]}createTile_(e,t,n,r,i,a){let o=[e,t,n],s=this.getTileCoordForTileUrlFunction(o,i),c=s?this.tileUrlFunction(s,r,i):void 0,l=new this.tileClass(o,c===void 0?L.EMPTY:L.IDLE,c===void 0?``:c,this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=a,l.addEventListener(M.CHANGE,this.handleTileChange.bind(this)),l}getTile(e,t,n,r,i,a){let o=this.getProjection();if(!o||!i||ui(o,i))return this.getTileInternal(e,t,n,r,o||i);let s=[e,t,n],c=this.getKey(),l=new Dx(o,this.getTileGridForProjection(o),i,this.getTileGridForProjection(i),s,this.getTileCoordForTileUrlFunction(s,i),this.getTilePixelRatio(r),this.getGutter(),(e,t,n,r)=>this.getTileInternal(e,t,n,r,o,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return l.key=c,l}getTileInternal(e,t,n,r,i,a){let o=this.getKey(),s=jx(this,o,e,t,n);if(a&&a.containsKey(s))return a.get(s);let c=this.createTile_(e,t,n,r,i,o);return a?.set(s,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){let n=B(e);if(n){let e=F(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}};function IS(e,t){if(vt){let n=e.getCrossOrigin(),r=`same-origin`,i=`same-origin`;n===`anonymous`||n===``?(r=`cors`,i=`omit`):n===`use-credentials`&&(r=`cors`,i=`include`),fetch(t,{mode:r,credentials:i}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.blob()}).then(e=>createImageBitmap(e)).then(t=>{let n=e.getImage();n.width=t.width,n.height=t.height,n.getContext(`2d`).drawImage(t,0,0),t.close?.(),n.dispatchEvent(new Event(`load`))}).catch(()=>{e.getImage().dispatchEvent(new Event(`error`))});return}e.getImage().src=t}var LS=class extends FS{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:B(`EPSG:3857`),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:`loading`,tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,zDirection:e.zDirection}),this.tileJSON_=null,this.tileSize_=e.tileSize,e.url)if(e.jsonp)SS(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{let 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 Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(e){let t=e.target;if(!t.status||t.status>=200&&t.status<300){let e;try{e=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(e)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){let t=B(`EPSG:4326`),n=this.getProjection(),r;if(e.bounds!==void 0){let i=di(t,n);r=kn(e.bounds,i)}let i=sS(n),a=e.minzoom||0,o=iS({extent:i,maxZoom:e.maxzoom||22,minZoom:a,tileSize:this.tileSize_});if(this.tileGrid=o,this.tileUrlFunction=jS(e.tiles,o),e.attribution&&!this.getAttributions()){let t=r===void 0?i:r;this.setAttributions(function(n){return Tn(t,n.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState(`ready`)}handleTileJSONError(){this.setState(`error`)}},RS=class extends PS{constructor(e){let t=e.projection||`EPSG:3857`,n=e.extent||sS(t),r=e.tileGrid||iS({extent:n,maxResolution:e.maxResolution,maxZoom:e.maxZoom===void 0?22:e.maxZoom,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:zS,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:Ey,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(e,t,n){if(n.getState()===L.IDLE){n.setState(L.LOADING);let r=n.wrappedTileCoord,i=this.getTileGridForProjection(t),a=i.getTileCoordExtent(r),o=r[0],s=i.getResolution(o);Yt(a,-s,a);let c=this.projection;t&&this.projection&&!ui(t,c)&&(a=hi(a,t,c));let l=this.tileGrid,u=l.getExtent();u&&Sn(a,u,a);let d=s;t&&c&&!ui(t,c)&&(d=s/c.getMetersPerUnit()/t.getMetersPerUnit());let f=l.getZForResolution(d,this.zDirection);l.forEachTileCoord(a,f,r=>{let i=this.tileUrlFunction(r,e,t);this.sourceTiles_[i]||(this.sourceTiles_[i]=new this.tileClass(r,i?L.IDLE:L.EMPTY,i,this.format_,this.tileLoadFunction));let a=this.sourceTiles_[i];n.sourceTiles.push(a),this.tileKeysBySourceTileUrl_[i]||(this.tileKeysBySourceTileUrl_[i]=[]),this.tileKeysBySourceTileUrl_[i].push(n.getKey());let o=a.getState();if(o<L.LOADED){let e=t=>{this.handleTileChange(t);let r=a.getState();if(r===L.LOADED||r===L.ERROR){let t=a.getKey();t in n.errorTileKeys?a.getState()===L.LOADED&&delete n.errorTileKeys[t]:n.loadingSourceTiles--,r===L.ERROR?n.errorTileKeys[t]=!0:a.removeEventListener(M.CHANGE,e),n.loadingSourceTiles===0&&n.setState($e(n.errorTileKeys)?L.LOADED:L.ERROR)}};a.addEventListener(M.CHANGE,e),n.loadingSourceTiles++}o===L.IDLE&&(a.extent=l.getTileCoordExtent(r),a.projection=this.projection,a.resolution=l.getResolution(r[0]),a.load())}),n.loadingSourceTiles||n.setState(n.sourceTiles.some(e=>e.getState()===L.ERROR)?L.ERROR:L.LOADED)}return n.sourceTiles}removeSourceTiles(e){let t=e.getKey(),n=e.sourceTiles;for(let e=0,r=n.length;e<r;++e){let r=n[e].getTileUrl();if(!this.tileKeysBySourceTileUrl_[r])return;let i=this.tileKeysBySourceTileUrl_[r].indexOf(t);i!==-1&&(this.tileKeysBySourceTileUrl_[r].splice(i,1),this.tileKeysBySourceTileUrl_[r].length===0&&(delete this.tileKeysBySourceTileUrl_[r],delete this.sourceTiles_[r]))}}getTile(e,t,n,r,i){let a=[e,t,n],o=this.getTileCoordForTileUrlFunction(a,i),s=this.getTileGrid().getExtent(),c=this.projection,l=this.getTileGridForProjection(i);if(o&&s){let t=l.getTileCoordExtent(o);Yt(t,-l.getResolution(e),t),Tn(s,!i||!c||ui(i,c)?t:hi(t,i,c))||(o=null)}let u=!0;if(o!==null){let t=this.tileGrid,n=l.getResolution(e),a=n;i&&c&&!ui(i,c)&&(a=n/c.getMetersPerUnit()/i.getMetersPerUnit());let s=t.getZForResolution(a,1),d=l.getTileCoordExtent(o);Yt(d,-n,d),t.forEachTileCoord(!i||!c||ui(i,c)?d:hi(d,i,c),s,e=>{u&&=!this.tileUrlFunction(e,r,c)})}let d=new Ty(a,u?L.EMPTY:L.IDLE,o,this.getSourceTiles.bind(this,r,i),this.removeSourceTiles.bind(this));return d.key=this.getKey(),d}getTileGridForProjection(e){let t=e.getCode(),n=this.tileGrids_[t];if(!n){let r=this.projection;if(r!==null&&!ui(r,e))return tS(e);let i=this.tileGrid,a=i.getResolutions().slice(),o=a.map(function(e,t){return i.getOrigin(t)}),s=a.map(function(e,t){return i.getTileSize(t)});for(let e=a.length;e<43;++e)a.push(a[e-1]/2),o.push(o[e-1]),s.push(s[e-1]);n=new eS({extent:i.getExtent(),origins:o,resolutions:a,tileSizes:s}),this.tileGrids_[t]=n}return n}getTilePixelRatio(e){return e}getTilePixelSize(e,t,n){let r=hc(this.getTileGridForProjection(n).getTileSize(e),this.tmpSize);return[Math.round(r[0]*t),Math.round(r[1]*t)]}setOverlaps(e){this.overlaps_=e,this.changed()}};function zS(e,t){e.setLoader(function(n,r,i){yv(t,e.getFormat(),n,r,i,e.onLoad.bind(e),e.onError.bind(e))})}function BS(e,t){let n=e[0],r=n.width,i=n.height,a=n.data,o=new Uint8ClampedArray(a.length),s=t.resolution*2,c=r-1,l=i-1,u=[0,0,0,0],d=2*Math.PI,f=Math.PI/2,p=Math.PI*t.sunEl/180,m=Math.PI*t.sunAz/180,h=Math.cos(p),g=Math.sin(p),_=t.highlightColor,v=t.shadowColor,y=t.accentColor,b=t.encoding,x,S,C,w,T,E,D,O,k,A,ee,j,te,ne,re,ie,ae,oe,se,ce,le,ue;function de(e,t=`mapbox`){if(t===`mapbox`)return(e[0]*256*256+e[1]*256+e[2])*.1-1e4;if(t===`terrarium`)return e[0]*256+e[1]+e[2]/256-32768}for(S=0;S<=l;++S)for(T=S===0?0:S-1,E=S===l?l:S+1,x=0;x<=c;++x)C=x===0?0:x-1,w=x===c?c:x+1,D=(S*r+C)*4,u[0]=a[D],u[1]=a[D+1],u[2]=a[D+2],u[3]=a[D+3],O=t.vert*de(u,b),D=(S*r+w)*4,u[0]=a[D],u[1]=a[D+1],u[2]=a[D+2],u[3]=a[D+3],k=t.vert*de(u,b),A=(k-O)/s,D=(T*r+x)*4,u[0]=a[D],u[1]=a[D+1],u[2]=a[D+2],u[3]=a[D+3],O=t.vert*de(u,b),D=(E*r+x)*4,u[0]=a[D],u[1]=a[D+1],u[2]=a[D+2],u[3]=a[D+3],k=t.vert*de(u,b),ee=(k-O)/s,te=Math.atan2(ee,-A),te=te<0?f-te:te>f?d-te+f:f-te,j=Math.atan(Math.sqrt(A*A+ee*ee)),ue=g*Math.cos(j)+h*Math.sin(j)*Math.cos(m-te),ne=Math.cos(j),re=255*ue,se=Math.min(Math.max(2*t.sunEl,0),1),ce=1.875-t.opacity*1.75,le=t.opacity===.5?j:f*((ce**+j-1)/(ce**+f-1)),ae={r:(1-ne)*y.r*se*255,g:(1-ne)*y.g*se*255,b:(1-ne)*y.b*se*255,a:(1-ne)*y.a*se*255},ie=Math.abs(((te+m)/Math.PI+.5)%2-1),oe={r:(_.r*(1-ie)+v.r*ie)*re,g:(_.g*(1-ie)+v.g*ie)*re,b:(_.b*(1-ie)+v.b*ie)*re,a:(_.a*(1-ie)+v.a*ie)*re},D=(S*r+x)*4,o[D]=ae.r*(1-ie)+oe.r,o[D+1]=ae.g*(1-ie)+oe.g,o[D+2]=ae.b*(1-ie)+oe.b,o[D+3]=a[D+3]*t.opacity*se*Math.sin(le);return new ImageData(o,r,i)}function VS(e,t){let n=e[0],r=n.width,i=n.height,a=n.data,o=new Uint8ClampedArray(a.length),s=r-1,c=i-1,l=[0,0,0,0],u,d,f;function p(e){return e>0?1/(1-e):1+e}function m(e){return e>0?1-1/(1.001-e):-e}function h(e){e*=Math.PI/180;let t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}let g=m(t.saturation),_=p(t.contrast),v=h(t.hueRotate),y=v,b=[v[2],v[0],v[1]],x=[v[1],v[2],v[0]],S=t.brightnessLow,C=t.brightnessHigh;for(d=0;d<=c;++d)for(u=0;u<=s;++u){f=(d*r+u)*4,l[0]=a[f],l[1]=a[f+1],l[2]=a[f+2],l[3]=a[f+3];let e=l[0],t=l[1],n=l[2],i=(e,t)=>{let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n},s=i([e,t,n],y),c=i([e,t,n],b),p=i([e,t,n],x),m=(s+c+p)/3;s+=(m-s)*g,c+=(m-c)*g,p+=(m-p)*g,s=(s-.5)*_+.5,c=(c-.5)*_+.5,p=(p-.5)*_+.5,s=S*(255-s)+C*s,c=S*(255-c)+C*c,p=S*(255-p)+C*p,o[f]=s,o[f+1]=c,o[f+2]=p,o[f+3]=l[3]}return new ImageData(o,r,i)}function HS(e,t=512){return e.getExtent()?iS({extent:e.getExtent(),tileSize:t,maxZoom:22}).getResolutions():Uy}function US(e,t){return t.accessToken||(t=Object.assign({},t),new URL(e).searchParams.forEach((e,n)=>{t.accessToken=e,t.accessTokenParam=n})),t}function WS(e,t,n=``,r={},i=void 0){let a,o,s,c,l=!0;return typeof n!=`string`&&!Array.isArray(n)?(s=n,c=s.source||s.layers,r=s):c=n,typeof r==`string`?(a=r,s={}):(a=r.styleUrl,s=r),s.updateSource===!1&&(l=!1),i||=s.resolutions,!a&&typeof t==`string`&&!t.trim().startsWith(`{`)&&(a=t),a&&(a=a.startsWith(`data:`)?location.href:jy(a,s.accessToken),s=US(a,s)),new Promise(function(n,r){Yy(t,s).then(function(t){if(t.version!=8)return r(Error(`glStyle version 8 required.`));if(!(e instanceof _y||e instanceof Gx))return r(Error(`Can only apply to VectorLayer or VectorTileLayer`));let u=e instanceof Gx?`vector`:`geojson`;if(c?o=Array.isArray(c)?t.layers.find(function(e){return e.id===c[0]}).source:c:(o=t.layers.find(function(e){return e.source&&t.sources[e.source].type===u}).source,c=o),!o)return r(Error(`No ${u} source found in the glStyle.`));function d(){if(!l)return Promise.resolve();if(e instanceof Gx)return XS(t.sources[o],a,s).then(function(t){let n=e.getSource();n?t!==n&&(n.setTileUrlFunction(t.getTileUrlFunction()),typeof n.setUrls==`function`&&typeof t.getUrls==`function`&&n.setUrls(t.getUrls()),n.format_||=t.format_,n.getAttributions()||n.setAttributions(t.getAttributions()),n.getTileLoadFunction()===zS&&n.setTileLoadFunction(t.getTileLoadFunction()),ui(n.getProjection(),t.getProjection())&&(n.tileGrid=t.getTileGrid())):e.setSource(t);let r=e.getSource().getTileGrid();!isFinite(e.getMaxResolution())&&!isFinite(e.getMinZoom())&&r.getMinZoom()>0&&e.setMaxResolution(Ky(Math.max(0,r.getMinZoom()-1e-12),r.getResolutions()))});let n=t.sources[o],r=e.getSource();(!r||r.get(`mapbox-source`)!==n)&&(r=rC(n,a,s));let i=e.getSource();return i?r!==i&&(i.getAttributions()||i.setAttributions(r.getAttributions()),i.format_||=r.getFormat(),i.url_=r.getUrl()):e.setSource(r),Promise.resolve()}let f,p,m={},h={};function g(){if(!p&&(!t.sprite||m)){if(s.projection&&!i){let e=B(s.projection).getUnits();e!==`m`&&(i=Uy.map(t=>t/Xn[e]))}let a,l=e.getSource();l instanceof RS&&l.format_ instanceof $b&&(a=l.format_.layerName_),p=Eb(e,t,c,i,m,h,(e,t=s.webfonts)=>ub(e,t),s.getImage,a),e.getStyle()?d().then(n).catch(r):r(Error(`Nothing to show for source [${o}]`))}else p?(e.setStyle(p),d().then(n).catch(r)):r(Error(`Something went wrong trying to apply style.`))}if(t.sprite){let e=ky(t.sprite,s.accessToken,a||location.href);f=vt?1:window.devicePixelRatio>=1.5?.5:1;let n=f==.5?`@2x`:``;Promise.all(e.map(function(e){let t=new URL(e.url),i=t.origin+t.pathname+n+`.json`+t.search;return new Promise(function(e,n){Jy(`Sprite`,i,s).then(e).catch(function(r){i=t.origin+t.pathname+`.json`+t.search,Jy(`Sprite`,i,s).then(e).catch(n)})}).then(function(i){i===void 0&&r(Error(`No sprites found.`));let a;if(a=t.origin+t.pathname+n+`.png`+t.search,s.transformRequest){let e=s.transformRequest(a,`SpriteImage`)||a;(e instanceof Request||e instanceof Promise)&&(a=e)}h[e.id]=a;for(let t in i){let n=e.id==`default`?t:`${e.id}:${t}`;m[n]=i[t]}}).catch(function(e){r(Error(`Sprites cannot be loaded: ${i}: ${e.message}`))})})).then(g).catch(r)}else g()}).catch(r)})}function GS(e,t){let n;return e.some(function(e){if(e.id==t)return n=e.source,!0}),n}function KS(e,t){let n=e.bounds;if(n){let e=ci([n[0],n[1]],t),r=ci([n[2],n[3]],t);return[e[0],e[1],r[0],r[1]]}return B(t).getExtent()}function qS(e,t,n){let r=new LS({tileJSON:t,tileSize:e.tileSize||t.tileSize||512}),i=r.getTileJSON(),a=r.getTileGrid(),o=B(n.projection||`EPSG:3857`),s=KS(i,o),c=o.getExtent(),l=i.minzoom||0,u=i.maxzoom||22,d={attributions:r.getAttributions(),projection:o,tileGrid:new eS({origin:c?Cn(c):a.getOrigin(0),extent:s||a.getExtent(),minZoom:l,resolutions:HS(o,t.tileSize).slice(0,u+1),tileSize:a.getTileSize(0)})};return Array.isArray(i.tiles)?d.urls=i.tiles:d.url=i.tiles,d}function JS(e,t,n,r){let i={id:e.id,type:e.type},a=e.layout||{},o=e.paint||{};i.paint=o,mb.zoom=Gy(t,n.resolutions||Uy),mb.distanceFromCenter=0;let s,c=$(i,`paint`,`background-color`,Py,r);return o[`background-opacity`]!==void 0&&(s=$(i,`paint`,`background-opacity`,Py,r)),a.visibility==`none`?void 0:bb(c,s)}function YS(e,t,n){let r=vt?{style:{}}:document.createElement(`div`);return r.className=`ol-mapbox-style-background`,r.style.position=`absolute`,r.style.width=`100%`,r.style.height=`100%`,new Cs({source:new wv({}),render(i){let a=JS(e,i.viewState.resolution,t,n);return r.style.backgroundColor=a,r}})}function XS(e,t,n){return new Promise(function(r,i){Zy(e,t,n).then(function({tileJson:t,tileLoadFunction:i}){let a=qS(e,t,n);a.tileLoadFunction=i,a.format=new $b({layerName:`mvt:layer`});let o=new RS(a);o.set(`mapbox-source`,e),r(o)}).catch(i)})}function ZS(e,t,n){let r=new Gx({declutter:!0,visible:!1});return XS(e,t,n).then(function(e){r.setSource(e)}).catch(function(e){r.setSource(void 0)}),r}function QS(e){return`{bbox-${(e?e.getCode():`EPSG:3857`).toLowerCase().replace(/[^a-z0-9]/g,`-`)}}`}function $S(e,t,n){return new Promise(function(r,i){Zy(e,t,n).then(function({tileJson:t,tileLoadFunction:i}){let a=new LS({interpolate:n.interpolate===void 0?!0:n.interpolate,transition:0,crossOrigin:`anonymous`,tileJSON:t});a.tileGrid=qS(e,t,n).tileGrid,n.projection&&(a.projection=B(n.projection));let o=a.getTileUrlFunction();i&&a.setTileLoadFunction(i),a.setTileUrlFunction(function(e,t,n){let r=QS(n),i=o(e,t,n);if(i.indexOf(r)!=-1){let t=a.getTileGrid().getTileCoordExtent(e);i=i.replace(r,t.toString())}return i}),a.set(`mapbox-source`,e),r(a)}).catch(function(e){i(e)})})}function eC(e,t,n){let r=new Vx;return $S(e,t,n).then(function(e){r.setSource(e)}).catch(function(){r.setSource(void 0)}),r}function tC(e,t,n){return new sx({source:new gS({operationType:`image`,operation:VS,sources:[eC(e,t,n)]})})}function nC(e,t,n){return new sx({source:new gS({operationType:`image`,operation:BS,sources:[eC(e,t,n)]})})}function rC(e,t,n){let r=n.projection?new Td({dataProjection:n.projection}):new Td,i=e.data,a={};if(typeof i==`string`){let[a]=Ny(i,n.accessToken,n.accessTokenParam||`access_token`,t||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(a)){let t=(e,t,n)=>{let r=QS(n);return a.replace(r,`${e.join(`,`)}`)},i=new Ov({attributions:e.attribution,format:r,loader:(e,r,a,o,s)=>{Jy(`GeoJSON`,typeof t==`function`?t(e,r,a):t,n).then(e=>{let t=i.getFormat().readFeatures(e,{featureProjection:a});i.addFeatures(t),o(t)}).catch(t=>{i.removeLoadedExtent(e),s()})},strategy:Sv});return i.set(`mapbox-source`,e),i}let o=new Ov({attributions:e.attribution,format:r,url:a,loader:(e,t,r,i,s)=>{Jy(`GeoJSON`,a,n).then(e=>{let t=o.getFormat().readFeatures(e,{featureProjection:r});o.addFeatures(t),i(t)}).catch(t=>{o.removeLoadedExtent(e),s()})}});return o}a.features=r.readFeatures(i,{featureProjection:_i()||`EPSG:3857`});let o=new Ov(Object.assign({attributions:e.attribution,format:r},a));return o.set(`mapbox-source`,e),o}function iC(e,t,n){return new _y({declutter:!0,source:rC(e,t,n),visible:!1})}function aC(e,t,n){let r=null;return function(i){e.paint&&`raster-opacity`in e.paint&&i.frameState.viewState.zoom!==r&&(r=i.frameState.viewState.zoom,delete n[e.id],oC(e,t,r,n))}}function oC(e,t,n,r){mb.zoom=n,mb.distanceFromCenter=0;let i=$(e,`paint`,`raster-opacity`,Py,r);t.setOpacity(i)}function sC(e,t){function n(){let n=t.get(`mapbox-style`);if(!n)return;let r=Nf(n.layers),i=e.get(`mapbox-layers`),a=r.filter(function(e){return i.includes(e.id)}).some(function(e){return!e.layout||!e.layout.visibility||e.layout.visibility===`visible`});e.get(`visible`)!==a&&e.setVisible(a)}e.on(`change`,n),n()}function cC(e,t,n,r){let i=By(e),a=e.layers,o=n.type,s=n.source||GS(a,n.ref),c=e.sources[s],l;if(o==`background`)l=YS(n,r,i);else if(c.type==`vector`)l=ZS(c,t,r);else if(c.type==`raster`){let e=[`raster-saturation`,`raster-contrast`,`raster-brightness-max`,`raster-brightness-min`,`raster-hue-rotate`];Object.keys(n.paint||{}).find(t=>e.includes(t))?(l=tC(c,t,r),l.getSource().on(`beforeoperations`,function(e){mb.zoom=Gy(e.resolution,r.resolutions||Uy),mb.distanceFromCenter=0;let t=e.data;t.saturation=$(n,`paint`,`raster-saturation`,Py,i),t.contrast=$(n,`paint`,`raster-contrast`,Py,i),t.brightnessHigh=$(n,`paint`,`raster-brightness-max`,Py,i),t.brightnessLow=$(n,`paint`,`raster-brightness-min`,Py,i),t.hueRotate=$(n,`paint`,`raster-hue-rotate`,Py,i)})):l=eC(c,t,r),l.setVisible(n.layout?n.layout.visibility!==`none`:!0),l.on(`prerender`,aC(n,l,i))}else if(c.type==`geojson`)l=iC(c,t,r);else if(c.type==`raster-dem`&&n.type==`hillshade`){let e=nC(c,t,r);l=e,e.getSource().on(`beforeoperations`,function(e){let t=e.data;t.resolution=ri(r.projection||`EPSG:3857`,e.resolution,_n(e.extent),`m`),mb.zoom=Gy(e.resolution,r.resolutions||Uy),mb.distanceFromCenter=0,t.encoding=c.encoding,t.vert=5*$(n,`paint`,`hillshade-exaggeration`,Py,i),t.sunAz=$(n,`paint`,`hillshade-illumination-direction`,Py,i),t.sunEl=35,t.opacity=.3,t.highlightColor=$(n,`paint`,`hillshade-highlight-color`,Py,i),t.shadowColor=$(n,`paint`,`hillshade-shadow-color`,Py,i),t.accentColor=$(n,`paint`,`hillshade-accent-color`,Py,i)}),l.setVisible(n.layout?n.layout.visibility!==`none`:!0)}let u=s;return l&&l.set(`mapbox-source`,u),l}function lC(e,t,n,r){let i=[],a=null;if(t instanceof Zu){if(a=t.getView(),!a.isDef()&&!a.getRotation()&&!a.getResolutions()){let e=r.projection?B(r.projection):a.getProjection();a=new to(Object.assign(a.getProperties(),{maxResolution:Uy[0]/Xn[e.getUnits()],projection:r.projection||a.getProjection()})),t.setView(a)}`center`in e&&!a.getCenter()&&a.setCenter(ci(e.center,a.getProjection())),`zoom`in e&&a.getZoom()===void 0&&a.setResolution(Uy[0]/Xn[a.getProjection().getUnits()]/2**e.zoom),(!a.getCenter()||a.getZoom()===void 0)&&a.fit(a.getProjection().getExtent(),{nearest:!0,size:t.getSize()})}t.set(`mapbox-style`,e),t.set(`mapbox-metadata`,{styleUrl:n,options:r});let o=e.layers,s=[],c,l,u;for(let a=0,d=o.length;a<d;++a){let d=o[a],f=d.type;if(f==`heatmap`){console.debug(`layers[${a}].type "${f}" not supported`);continue}else u=d.source||GS(o,d.ref),(!u||u!=l)&&(s.length&&(i.push(dC(c,s,e,n,t,r)),s=[]),c=cC(e,n,d,r),c instanceof _y||c instanceof Gx||(s=[]),l=c.get(`mapbox-source`)),s.push(d.id)}return i.push(dC(c,s,e,n,t,r)),Promise.all(i)}function uC(e,t,n={}){let r,i;if(vt){if(!(e instanceof Zu)&&!(e instanceof xs))throw Error(`ol-mapbox-style in a web worker requires a Map or a LayerGroup as first argument`);i=e}else i=typeof e==`string`||e instanceof HTMLElement?new Zu({target:e}):e;if(typeof t==`string`){let e=t.startsWith(`data:`)?location.href:jy(t,n.accessToken);n=US(e,n),r=new Promise(function(r,a){Yy(t,n).then(function(t){lC(t,i,e,n).then(function(){r(i)}).catch(a)}).catch(function(e){a(Error(`Could not load ${t}: ${e.message}`))})})}else r=new Promise(function(e,r){lC(t,i,!n.styleUrl||n.styleUrl.startsWith(`data:`)?location.href:jy(n.styleUrl,n.accessToken),n).then(function(){e(i)}).catch(r)});return r}function dC(e,t,n,r,i,a={}){let o=24,s=0,c=n.layers;for(let e=0,n=c.length;e<n;++e){let n=c[e];t.indexOf(n.id)!==-1&&(o=Math.min(`minzoom`in n?n.minzoom:0,o),s=Math.max(`maxzoom`in n?n.maxzoom:24,s))}return new Promise(function(c,l){let u=function(){let u=e.getSource();if(!u||u.getState()===`error`){l(Error(`Error accessing data for source `+e.get(`mapbox-source`)));return}if(`getTileGrid`in u){let t=u.getTileGrid();if(t){let n=t.getMinZoom();(o>0||n>0)&&e.setMaxResolution(Math.min(Ky(Math.max(0,o-1e-12),Uy),Ky(Math.max(0,n-1e-12),t.getResolutions()))),s<24&&e.setMinResolution(Ky(s,Uy))}}else o>0&&e.setMaxResolution(Ky(Math.max(0,o-1e-12),Uy));u instanceof Ov||u instanceof RS?WS(e,n,t,Object.assign({styleUrl:r},a)).then(function(){sC(e,i),c()}).catch(l):c()};e.set(`mapbox-layers`,t);let d=i.getLayers();d.getArray().indexOf(e)===-1&&d.push(e),e.getSource()?u():e.once(`change:source`,u)})}function fC(e,t){return e.get(`mapbox-style`).layers.find(function(e){return e.id===t})}function pC(e,t,n){let r=e.get(`mapbox-style`),i=r.layers,a,o=-1;if(n!==void 0){let t=fC(e,n);if(t===void 0)throw Error(`Layer with id "${n}" not found.`);a=i.indexOf(t)}else a=i.length;let s;if(a>0&&i[a-1].source===t.source?(o=a-1,s=-1):a<i.length&&i[a].source===t.source&&(o=a,s=0),o===-1){let{options:o,styleUrl:s}=e.get(`mapbox-metadata`),c=cC(r,s,t,o);if(n){let t=gC(e,n),r=e.getLayers().getArray().indexOf(t);e.getLayers().insertAt(r,c)}return i.splice(a,0,t),dC(c,[t.id],r,s,e,o)}if(i.some(e=>e.id===t.id))throw Error(`Layer with id "${t.id}" already exists.`);let c=i[o].id,l=Tb[zy(e.get(`mapbox-style`),gC(e,c))];if(i.splice(a,0,t),l){let[e,n,r,i,a,o,u,d]=l;if(Array.isArray(r)){let e=r.indexOf(c)+s;r.splice(e,0,t.id)}Eb(e,n,r,i,a,o,u,d)}else gC(e,i[o].id).changed();return Promise.resolve()}function mC(e,t){let n=e.get(`mapbox-style`),r=n.layers,i=r.findIndex(function(e){return e.id===t.id});if(i===-1)throw Error(`Layer with id "${t.id}" not found.`);if(r[i].source!==t.source)throw Error(`Updated layer and previous version must use the same source.`);delete By(n)[t.id],delete Vy(n)[t.id],r[i]=t;let a=Tb[zy(e.get(`mapbox-style`),gC(e,t.id))];if(a)return Eb.apply(void 0,a),Promise.resolve();let o=gC(e,t.id),{options:s,styleUrl:c}=e.get(`mapbox-metadata`);return dC(o,[t.id],n,c,e,s)}function hC(e,t,n){let r=vC(e,t),i=e.getLayers().getArray().filter(function(e){return(e instanceof _y||e instanceof Vx||e instanceof Gx)&&e.getSource()===r}),a=e.get(`mapbox-metadata`),o;switch(n.type){case`vector`:o=XS(n,a.styleUrl,a.options);break;case`geojson`:o=Promise.resolve(rC(n,a.styleUrl,a.options));break;case`raster`:case`raster-dem`:o=$S(n,a.styleUrl,a.options);break;default:return Promise.reject(Error(`Unsupported source type `+n.type))}return o.then(function(e){i.forEach(function(t){t.setSource(e)})}),o}function gC(e,t){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e){let r=n[e].get(`mapbox-layers`);if(r&&r.indexOf(t)!==-1)return n[e]}}function _C(e,t){let n=[],r=e.getLayers().getArray();for(let e=0,i=r.length;e<i;++e)r[e].get(`mapbox-source`)===t&&n.push(r[e]);return n}function vC(e,t){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e){let r=n[e].getSource();if(n[e].get(`mapbox-source`)===t)return r}}function yC(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function bC(e,t,n,r,i,a,o){o??=yC();let s=1/(e-t),c=1/(n-r),l=1/(i-a);return o[0]=-2*s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*c,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(e+t)*s,o[13]=(r+n)*c,o[14]=(a+i)*l,o[15]=1,o}function xC(e,t,n,r,i){return i??=yC(),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*n,i[5]=e[5]*n,i[6]=e[6]*n,i[7]=e[7]*n,i[8]=e[8]*r,i[9]=e[9]*r,i[10]=e[10]*r,i[11]=e[11]*r,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i}function SC(e,t,n,r,i){i??=yC();let a,o,s,c,l,u,d,f,p,m,h,g;return e===i?(i[12]=e[0]*t+e[4]*n+e[8]*r+e[12],i[13]=e[1]*t+e[5]*n+e[9]*r+e[13],i[14]=e[2]*t+e[6]*n+e[10]*r+e[14],i[15]=e[3]*t+e[7]*n+e[11]*r+e[15]):(a=e[0],o=e[1],s=e[2],c=e[3],l=e[4],u=e[5],d=e[6],f=e[7],p=e[8],m=e[9],h=e[10],g=e[11],i[0]=a,i[1]=o,i[2]=s,i[3]=c,i[4]=l,i[5]=u,i[6]=d,i[7]=f,i[8]=p,i[9]=m,i[10]=h,i[11]=g,i[12]=a*t+l*n+p*r+e[12],i[13]=o*t+u*n+m*r+e[13],i[14]=s*t+d*n+h*r+e[14],i[15]=c*t+f*n+g*r+e[15]),i}function CC(e,t,n,r){return r??=yC(),r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=e,r[13]=t,r[14]=n,r[15]=1,r}var wC=`
37
20
  attribute vec4 a_position;
38
21
  attribute vec4 a_texcoord;
39
22
 
@@ -47,7 +30,7 @@
47
30
  vec2 texcoord = (u_textureMatrix * a_texcoord).xy;
48
31
  v_texcoord = texcoord;
49
32
  }
50
- `,pC=`
33
+ `,TC=`
51
34
  precision mediump float;
52
35
 
53
36
  varying vec2 v_texcoord;
@@ -65,7 +48,7 @@
65
48
  }
66
49
  gl_FragColor = texture2D(u_texture, v_texcoord);
67
50
  }
68
- `;class AC{constructor(e){this.gl_=e,this.program_=rd(e,pC,gC),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=nd(0,d,0,g,-1,1);p=dC(p,l,c,0),p=DA(p,h,u,1),f.uniformMatrix4fv(this.matrixLocation,!1,p);let A=fC(r/t,s/i,0);A=DA(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 OA(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 rd(n,e,t){const i=n.createProgram(),r=OA(n,n.VERTEX_SHADER,t),s=OA(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 mC=`
51
+ `,EC=class{constructor(e){this.gl_=e,this.program_=OC(e,TC,wC),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,n,r,i,a,o,s,c,l,u,d,f){let p=this.gl_;s===void 0&&(s=r),c===void 0&&(c=i),a===void 0&&(a=t),o===void 0&&(o=n),l===void 0&&(l=a),u===void 0&&(u=o),d===void 0&&(d=p.canvas.width),f===void 0&&(f=p.canvas.height),p.bindTexture(p.TEXTURE_2D,e),p.useProgram(this.program_),p.bindBuffer(p.ARRAY_BUFFER,this.positionBuffer),p.enableVertexAttribArray(this.positionLocation),p.vertexAttribPointer(this.positionLocation,2,p.FLOAT,!1,0,0),p.bindBuffer(p.ARRAY_BUFFER,this.texcoordBuffer),p.enableVertexAttribArray(this.texcoordLocation),p.vertexAttribPointer(this.texcoordLocation,2,p.FLOAT,!1,0,0);let m=bC(0,d,0,f,-1,1);m=SC(m,s,c,0),m=xC(m,l,u,1),p.uniformMatrix4fv(this.matrixLocation,!1,m);let h=CC(r/t,i/n,0);h=xC(h,a/t,o/n,1),p.uniformMatrix4fv(this.textureMatrixLocation,!1,h),p.uniform1i(this.textureLocation,0),p.drawArrays(p.TRIANGLES,0,this.positions.length/2)}};function DC(e,t,n){let r=e.createShader(t);if(r===null)throw Error(`Shader compilation failed`);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(r);throw Error(t===null?`Shader info log creation failed`:t)}return r}function OC(e,t,n){let r=e.createProgram(),i=DC(e,e.VERTEX_SHADER,n),a=DC(e,e.FRAGMENT_SHADER,t);if(r===null)throw Error(`Program creation failed`);if(e.attachShader(r,i),e.attachShader(r,a),e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS))throw e.getProgramInfoLog(r)===null?Error(`Program info log creation failed`):Error();return r}var kC=`
69
52
  attribute vec4 a_position;
70
53
 
71
54
  uniform mat4 u_matrix;
@@ -73,14 +56,14 @@
73
56
  void main() {
74
57
  gl_Position = u_matrix * a_position;
75
58
  }
76
- `,yC=`
59
+ `,AC=`
77
60
  precision mediump float;
78
61
 
79
62
  uniform vec4 u_val;
80
63
  void main() {
81
64
  gl_FragColor = u_val;
82
65
  }
83
- `,_C=`
66
+ `,jC=`
84
67
  attribute vec4 a_position;
85
68
  attribute vec2 a_texcoord;
86
69
 
@@ -92,7 +75,7 @@
92
75
  gl_Position = u_matrix * a_position;
93
76
  v_texcoord = a_texcoord;
94
77
  }
95
- `,xC=`
78
+ `,MC=`
96
79
  precision mediump float;
97
80
 
98
81
  varying vec2 v_texcoord;
@@ -105,35 +88,22 @@
105
88
  }
106
89
  gl_FragColor = texture2D(u_texture, v_texcoord);
107
90
  }
108
- `;function EC(n,e,t,i){let r;return t&&t.length?r=t.shift():ut?r=new OffscreenCanvas(n||300,e||300):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("webgl",i)}function wC(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 GA=[];function vC(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=jt();l.forEach(function(T,I,F){cc(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(Oe(y)*w);const T=n.getParameter(n.MAX_TEXTURE_SIZE),I=Math.max(x,_),F=I>T?T/I:1,P=Math.round(x*F),B=Math.round(_*F);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,P,B,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 S=new AC(n);l.forEach(function(L,z,V){const U=(L.extent[0]-y[0])*w*F,X=-(L.extent[3]-y[3])*w*F,D=ne(L.extent)*w*F,q=Oe(L.extent)*w*F;if(n.bindFramebuffer(n.FRAMEBUFFER,R),n.viewport(0,0,P,B),L.clipExtent){const O=(L.clipExtent[0]-y[0])*w*F,se=-(L.clipExtent[3]-y[3])*w*F,Ce=ne(L.clipExtent)*w*F,ge=Oe(L.clipExtent)*w*F;n.enable(n.SCISSOR_TEST),n.scissor(d?O:Math.round(O),d?se:Math.round(se),d?Ce:Math.round(O+Ce)-Math.round(O),d?ge:Math.round(se+ge)-Math.round(se))}S.drawImage(L.texture,L.width,L.height,c,c,L.width-2*c,L.height-2*c,d?U:Math.round(U),d?X:Math.round(X),d?D:Math.round(U+D)-Math.round(U),d?q:Math.round(X+q)-Math.round(X),P,B),n.disable(n.SCISSOR_TEST)}),n.deleteFramebuffer(R)}const v=li(o),C=li(y),b=T=>{const I=(T[0][0]-v[0])/s*i,F=-(T[0][1]-v[1])/s*i,P=(T[1][0]-v[0])/s*i,B=-(T[1][1]-v[1])/s*i,R=(T[2][0]-v[0])/s*i,S=-(T[2][1]-v[1])/s*i;return{u1:P,v1:B,u0:I,v0:F,u2:R,v2:S}};n.bindFramebuffer(n.FRAMEBUFFER,A),n.viewport(0,0,f,p);{const T=[],I=[],F=rd(n,xC,_C);n.useProgram(F);const P=n.getUniformLocation(F,"u_texture");n.bindTexture(n.TEXTURE_2D,E),n.uniform1i(P,0),a.getTriangles().forEach(function(U,X,D){const q=U.source,O=U.target,{u1:se,v1:Ce,u0:ge,v0:We,u2:be,v2:Fe}=b(O),xi=(q[0][0]-C[0])/r/x,_t=-(q[0][1]-C[1])/r/_,ft=(q[1][0]-C[0])/r/x,j=-(q[1][1]-C[1])/r/_,Ke=(q[2][0]-C[0])/r/x,gt=-(q[2][1]-C[1])/r/_;T.push(se,Ce,ge,We,be,Fe),I.push(ft,j,xi,_t,Ke,gt)});const B=nd(0,f,p,0,-1,1),R=n.getUniformLocation(F,"u_matrix");n.uniformMatrix4fv(R,!1,B);const S=n.getAttribLocation(F,"a_position"),L=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,L),n.bufferData(n.ARRAY_BUFFER,new Float32Array(T),n.STATIC_DRAW),n.vertexAttribPointer(S,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(S);const z=n.getAttribLocation(F,"a_texcoord"),V=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,V),n.bufferData(n.ARRAY_BUFFER,new Float32Array(I),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=rd(n,yC,mC);n.useProgram(T);const I=nd(0,f,p,0,-1,1),F=n.getUniformLocation(T,"u_matrix");n.uniformMatrix4fv(F,!1,I);const P=Array.isArray(u)?u:[0,0,0,255],B=n.getUniformLocation(T,"u_val");n.uniform4fv(B,P);const R=n.getAttribLocation(T,"a_position"),S=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,S),n.vertexAttribPointer(R,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(R);const L=a.getTriangles().reduce(function(z,V){const U=V.target,{u1:X,v1:D,u0:q,v0:O,u2:se,v2:Ce}=b(U);return z.concat([X,D,q,O,q,O,se,Ce,se,Ce,X,D])},[]);n.bufferData(n.ARRAY_BUFFER,new Float32Array(L),n.STATIC_DRAW),n.drawArrays(n.LINES,0,L.length/2)}return{width:f,height:p,framebuffer:A,texture:m}}class CC extends Ml{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?xt(i,r):i:r;const s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),o=this.targetTileGrid_.getExtent();let a=this.sourceTileGrid_.getExtent();const l=o?xt(s,o):s;if(Zs(l)===0){this.state=G.EMPTY;return}i&&(a?a=xt(a,i):a=i);const c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),h=e.targetProj,u=sA(t,h,l,c);if(!isFinite(u)||u<=0){this.state=G.EMPTY;return}const d=e.errorThreshold!==void 0?e.errorThreshold:Yu;if(this.triangulation_=new Xu(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=xt(g,a)),!Zs(g))this.state=G.EMPTY;else{let f=0,p=0;t.canWrapX()&&(f=ne(i),p=Math.floor((g[0]-i[0])/f)),uc(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=fv(_.getData());b?C=b:(t=!0,C=pv(Pl(_.getData())));const T=[w[0]+2*v,w[1]+2*v],I=C instanceof Float32Array,F=T[0]*T[1],P=I?Float32Array:Uint8ClampedArray,B=new P(C.buffer),R=P.BYTES_PER_ELEMENT,S=R*B.length/F,L=B.byteLength/T[1],z=Math.floor(L/R/T[0]),V=this.sourceTileGrid_.getTileCoordExtent(_.tileCoord);V[0]+=x.offset,V[2]+=x.offset;const U=(X=this.clipExtent_)==null?void 0:X.slice();U&&(U[0]+=x.offset,U[2]+=x.offset),e.push({extent:V,clipExtent:U,data:B,dataType:P,bytesPerPixel:S,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=Math.round(s*this.pixelRatio_),l=Math.round(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=EC(a,l,GA,{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 P=0,B=e.length;P<B;++P){const R=e[P],S=R.pixelSize,L=S[0],z=S[1],V=new R.dataType(y*L*z),U=R.data;let X=x*y;for(let q=0,O=V.length;q<O;q+=y)V[q]=U[X],V[q+1]=U[X+1],V[q+2]=U[X+2],V[q+3]=U[X+3],X+=d;const D=f.createTexture();f.bindTexture(f.TEXTURE_2D,D),p?(f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR)):(f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST)),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texImage2D(f.TEXTURE_2D,0,A,L,z,0,A,m,V),_.push({extent:R.extent,clipExtent:R.clipExtent,texture:D,width:L,height:z})}const{framebuffer:w,width:v,height:C}=vC(f,s,o,this.pixelRatio_,h,c,u,this.triangulation_,_,this.gutter_,m,this.renderEdges_,p),b=v,T=C*y,I=new e[0].dataType(b*T);f.bindFramebuffer(f.FRAMEBUFFER,w),f.readPixels(0,0,v,C,f.RGBA,m,I);let F=x*y;for(let P=0,B=I.length;P<B;P+=y){const R=(b-1-(P/T|0))*T+P%T;g[F]=I[R],g[F+1]=I[R+1],g[F+2]=I[R+2],g[F+3]=I[R+3],F+=d}}if(wC(f),GA.push(f.canvas),t){const x=Me(s,o),_=new ImageData(g,s);x.putImageData(_,0,0),this.reprojData_=x.canvas}else this.reprojData_=g;this.reprojSize_=[a,l],this.state=G.LOADED,this.changed()}load(){if(this.state!==G.IDLE&&this.state!==G.ERROR)return;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)return;e++;const r=ce(t,K.CHANGE,()=>{const s=t.getState();(s==G.LOADED||s==G.ERROR||s==G.EMPTY)&&(Re(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(Re),this.sourcesListenerKeys_=null}}class bC extends Qu{constructor(e){const t=e.projection===void 0?"EPSG:3857":e.projection;let i=e.tileGrid;i===void 0&&t&&(i=Gl({extent:Ho(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?it(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?it(t.getTileSize(e)):[256,256]}getGutterForProjection(e){const t=this.getProjection();return(!t||tt(t,e))&&!this.transformMatrix?this.gutter_:0}setLoader(e){this.loader_=e}getReprojTile_(e,t,i,r,s,o){const a=this.tileGrid||this.getTileGridForProjection(s||r),l=Math.max.apply(null,a.getResolutions().map((f,p)=>{const A=it(a.getTileSize(p)),m=this.getTileSize(p);return Math.max(m[0]/A[0],m[1]/A[1])})),c=this.getTileGridForProjection(r),h=[e,t,i],u=this.getTileCoordForTileUrlFunction(h,r),d=Object.assign({sourceProj:s||r,sourceTileGrid:a,targetProj:r,targetTileGrid:c,tileCoord:h,wrappedTileCoord:u,pixelRatio:l,gutter:this.gutter_,getTileFunction:(f,p,A,m)=>this.getTile(f,p,A,m,void 0,o),transformMatrix:this.transformMatrix},this.tileOptions),g=new CC(d);return g.key=this.getKey(),g}getTile(e,t,i,r,s,o){var w;const a=this.getProjection();if(s&&(a&&!tt(a,s)||this.transformMatrix))return this.getReprojTile_(e,t,i,s,a,o);const l=this.getTileSize(e),c=this.loader_,h=new AbortController,u={signal:h.signal,crossOrigin:this.crossOrigin_},d=this.getTileCoordForTileUrlFunction([e,t,i]);if(!d)return null;const g=this.getKey(),f=Wo(this,g,e,t,i);if(o&&o.containsKey(f))return o.get(f);const p=d[0],A=d[1],m=d[2],y=(w=this.getTileGrid())==null?void 0:w.getFullTileRange(p);y&&(u.maxY=y.getHeight()-1);function E(){return qn(function(){return c(p,A,m,u)})}const x=Object.assign({tileCoord:[e,t,i],loader:E,size:l,controller:h},this.tileOptions),_=new Ml(x);return _.key=this.getKey(),_.addEventListener(K.CHANGE,this.handleTileChange_),o==null||o.set(f,_),_}handleTileChange_(e){const t=e.target,i=Y(t),r=t.getState();let s;r==G.LOADING?(this.tileLoadingKeys_[i]=!0,s=Rs.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==G.ERROR?Rs.TILELOADERROR:r==G.LOADED?Rs.TILELOADEND:void 0),s&&this.dispatchEvent(new AA(s,t))}getTileGridForProjection(e){const t=this.getProjection();if(this.tileGrid&&(!t||tt(t,e))&&!this.transformMatrix)return this.tileGrid;const i=Y(e);return i in this.tileGridForProjection_||(this.tileGridForProjection_[i]=Ol(e)),this.tileGridForProjection_[i]}setTileGridForProjection(e,t){const i=_e(e);if(i){const r=Y(i);r in this.tileGridForProjection_||(this.tileGridForProjection_[r]=t)}}}const TC=new Error("Image failed to load");function BA(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(TC)),a.src=xA(n,e,t,i,r.maxY)})}function NA(n){return function(e,t,i,r){const s=Wv(n,e,t,i);return BA(s,e,t,i,r)}}function RC(n){return function(e,t,i,r){const s=n(e,t,i,r);return BA(s,e,t,i,r)}}function zA(n){let e;if(Array.isArray(n))e=NA(n);else if(typeof n=="string"){const t=EA(n);e=NA(t)}else if(typeof n=="function")e=RC(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 jA=0;function UA(n){return Array.isArray(n)?n.join(`
109
- `):typeof n=="string"?n:(++jA,"url-function-key-"+jA)}class SC extends bC{constructor(e){e=e||{};let t=e.loader,i;e.url&&(t=zA(e.url),i=UA(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=zA(e);this.setLoader(t),this.setKey(UA(e)),this.getState()!=="ready"&&this.setState("ready")}}const IC="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCeRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOShgAHAAAAEgAAAISgAgAEAAAAAQAAAMigAwAEAAAAAQAAAMgAAAAAQVNDSUkAAABTY3JlZW5zaG90/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/iDShJQ0NfUFJPRklMRQABAQAADRhhcHBsAhAAAG1udHJSR0IgWFlaIAfpAAIAHAAJAB4AD2Fjc3BBUFBMAAAAAEFQUEwAAAAAAAAAAAAAAAAAAAAAAAD21gABAAAAANMtYXBwbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWRlc2MAAAFQAAAAYmRzY20AAAG0AAAB9GNwcnQAAAOoAAAAI3d0cHQAAAPMAAAAFHJYWVoAAAPgAAAAFGdYWVoAAAP0AAAAFGJYWVoAAAQIAAAAFHJUUkMAAAQcAAAIDGFhcmcAAAwoAAAAIHZjZ3QAAAxIAAAAMG5kaW4AAAx4AAAAPm1tb2QAAAy4AAAAKHZjZ3AAAAzgAAAAOGJUUkMAAAQcAAAIDGdUUkMAAAQcAAAIDGFhYmcAAAwoAAAAIGFhZ2cAAAwoAAAAIGRlc2MAAAAAAAAACERpc3BsYXkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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aFZc15JOxttNIaTOGk6pH659W9F/PApW06Nsm6uJZl7h32rx6hQoP41GL6Lb9m0iJZynHy/LEn1YDH4Lk+1Zwgt1r+Q2x0zDTrWOzs/nnkysYY5JbqzsfQZ3Mfw6kCpIoPsATadyHAkJ6lv759yev/1qltbVocy3EnnTv1bGAB2VRzgD0/EkmrbKrqUYZDDBB7g1lWd1Zff5kzhdaC1HNDFcRPBOgkjkBVlYZVlPBBB6g1FAxQm3c5ZPun1Xt+XQ/n3qzWUXdFQldXObEv8AwjgWK6ctppIVJXOTBnosjHnZ2Vz06N2NWP8AhJ/Df/QWtP8AwIj/AMa2nRJEaORQysCCCMgg9QRVH+ydK/584f8Av2v+FMo//9P91tHsrm5MOqaoWZ41/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 FC extends so{constructor(t){const i=t||{},r=document.createElement("button");r.innerHTML=`<div class="svgContainer"><svg width="22" height="22" viewBox="0 0 22 22" fill="rgb(102, 102, 102)" xmlns="http://www.w3.org/2000/svg">
91
+ `;function NC(e,t,n,r){let i;return i=n&&n.length?n.shift():vt?new OffscreenCanvas(e||300,t||300):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`webgl`,r)}function PC(e){let t=e.canvas;t.width=1,t.height=1,e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)}var FC=[];function IC(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=Math.round(r*t),h=Math.round(r*n);e.canvas.width=m,e.canvas.height=h;let g,_;if(_=e.createTexture(),e.bindTexture(e.TEXTURE_2D,_),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),f?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST)),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,m,h,0,e.RGBA,u,null),g=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,g),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,_,0),g===null)throw Error(`Could not create framebuffer`);if(_===null)throw Error(`Could not create texture`);if(c.length===0)return{width:m,height:h,framebuffer:g,texture:_};let v=nn();c.forEach(function(e,t,n){ln(v,e.extent)});let y,b,x,S=1/i;if(!p||c.length!==1||l!==0){if(y=e.createTexture(),_===null)throw Error(`Could not create texture`);b=Math.round(z(v)*S),x=Math.round(xn(v)*S);let t=e.getParameter(e.MAX_TEXTURE_SIZE),n=Math.max(b,x),r=n>t?t/n:1,i=Math.round(b*r),a=Math.round(x*r);e.bindTexture(e.TEXTURE_2D,y),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),f?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST)),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,i,a,0,e.RGBA,u,null);let o=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,y,0);let s=new EC(e);c.forEach(function(t,n,c){let u=(t.extent[0]-v[0])*S*r,d=-(t.extent[3]-v[3])*S*r,p=z(t.extent)*S*r,m=xn(t.extent)*S*r;if(e.bindFramebuffer(e.FRAMEBUFFER,o),e.viewport(0,0,i,a),t.clipExtent){let n=(t.clipExtent[0]-v[0])*S*r,i=-(t.clipExtent[3]-v[3])*S*r,a=z(t.clipExtent)*S*r,o=xn(t.clipExtent)*S*r;e.enable(e.SCISSOR_TEST),e.scissor(f?n:Math.round(n),f?i:Math.round(i),f?a:Math.round(n+a)-Math.round(n),f?o:Math.round(i+o)-Math.round(i))}s.drawImage(t.texture,t.width,t.height,l,l,t.width-2*l,t.height-2*l,f?u:Math.round(u),f?d:Math.round(d),f?p:Math.round(u+p)-Math.round(u),f?m:Math.round(d+m)-Math.round(d),i,a),e.disable(e.SCISSOR_TEST)}),e.deleteFramebuffer(o)}else y=c[0].texture,b=c[0].width,x=c[0].width;let C=Cn(o),w=Cn(v),T=e=>{let t=(e[0][0]-C[0])/a*r,n=-(e[0][1]-C[1])/a*r;return{u1:(e[1][0]-C[0])/a*r,v1:-(e[1][1]-C[1])/a*r,u0:t,v0:n,u2:(e[2][0]-C[0])/a*r,v2:-(e[2][1]-C[1])/a*r}};e.bindFramebuffer(e.FRAMEBUFFER,g),e.viewport(0,0,m,h);{let t=[],n=[],r=OC(e,MC,jC);e.useProgram(r);let a=e.getUniformLocation(r,`u_texture`);e.bindTexture(e.TEXTURE_2D,y),e.uniform1i(a,0),s.getTriangles().forEach(function(e,r,a){let o=e.source,s=e.target,{u1:c,v1:l,u0:u,v0:d,u2:f,v2:p}=T(s),m=(o[0][0]-w[0])/i/b,h=-(o[0][1]-w[1])/i/x,g=(o[1][0]-w[0])/i/b,_=-(o[1][1]-w[1])/i/x,v=(o[2][0]-w[0])/i/b,y=-(o[2][1]-w[1])/i/x;t.push(c,l,u,d,f,p),n.push(g,_,m,h,v,y)});let o=bC(0,m,h,0,-1,1),c=e.getUniformLocation(r,`u_matrix`);e.uniformMatrix4fv(c,!1,o);let l=e.getAttribLocation(r,`a_position`),u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,new Float32Array(t),e.STATIC_DRAW),e.vertexAttribPointer(l,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(l);let d=e.getAttribLocation(r,`a_texcoord`),f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f),e.bufferData(e.ARRAY_BUFFER,new Float32Array(n),e.STATIC_DRAW),e.vertexAttribPointer(d,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(d),e.drawArrays(e.TRIANGLES,0,t.length/2)}if(d){let t=OC(e,AC,kC);e.useProgram(t);let n=bC(0,m,h,0,-1,1),r=e.getUniformLocation(t,`u_matrix`);e.uniformMatrix4fv(r,!1,n);let i=Array.isArray(d)?d:[0,0,0,255],a=e.getUniformLocation(t,`u_val`);e.uniform4fv(a,i);let o=e.getAttribLocation(t,`a_position`),c=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,c),e.vertexAttribPointer(o,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o);let l=s.getTriangles().reduce(function(e,t){let n=t.target,{u1:r,v1:i,u0:a,v0:o,u2:s,v2:c}=T(n);return e.concat([r,i,a,o,a,o,s,c,s,c,r,i])},[]);e.bufferData(e.ARRAY_BUFFER,new Float32Array(l),e.STATIC_DRAW),e.drawArrays(e.LINES,0,l.length/2)}return{width:m,height:h,framebuffer:g,texture:_}}var LC=class extends mx{constructor(e){super({tileCoord:e.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:e.interpolate,transition:e.transition}),this.renderEdges_=e.renderEdges===void 0?!1:e.renderEdges,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;let t=e.sourceProj,n=t.getExtent(),r=e.sourceTileGrid.getExtent();this.clipExtent_=t.canWrapX()?r?Sn(n,r):n:r;let i=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),a=this.targetTileGrid_.getExtent(),o=this.sourceTileGrid_.getExtent(),s=a?Sn(i,a):i;if(mn(s)===0){this.state=L.EMPTY;return}n&&(o=o?Sn(o,n):n);let c=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),l=e.targetProj,u=xx(t,l,s,c);if(!isFinite(u)||u<=0){this.state=L.EMPTY;return}let d=e.errorThreshold===void 0?Ex:e.errorThreshold;if(this.triangulation_=new Tx(t,l,s,o,u*d,c,e.transformMatrix),this.triangulation_.getTriangles().length===0){this.state=L.EMPTY;return}this.sourceZ_=this.sourceTileGrid_.getZForResolution(u);let f=this.triangulation_.calculateSourceExtent();if(o&&(t.canWrapX()?(f[1]=Mt(f[1],o[1],o[3]),f[3]=Mt(f[3],o[1],o[3])):f=Sn(f,o)),!mn(f))this.state=L.EMPTY;else{let r=0,i=0;t.canWrapX()&&(r=z(n),i=Math.floor((f[0]-n[0])/r)),jn(f.slice(),t,!0).forEach(t=>{let n=this.sourceTileGrid_.getTileRangeForExtentAndZ(t,this.sourceZ_),a=e.getTileFunction;for(let e=n.minX;e<=n.maxX;e++)for(let t=n.minY;t<=n.maxY;t++){let n=a(this.sourceZ_,e,t,this.pixelRatio_);if(n){let e=i*r;this.sourceTiles_.push({tile:n,offset:e})}}++i}),this.sourceTiles_.length===0&&(this.state=L.EMPTY)}}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){let e=[],t=!1;if(this.sourceTiles_.forEach(n=>{let r=n.tile;if(!r||r.getState()!==L.LOADED)return;let i=r.getSize(),a=this.gutter_,o,s=lx(r.getData());s?o=s:(t=!0,o=fx(cx(r.getData())));let c=[i[0]+2*a,i[1]+2*a],l=o instanceof Float32Array,u=c[0]*c[1],d=l?Float32Array:Uint8ClampedArray,f=new d(o.buffer),p=d.BYTES_PER_ELEMENT,m=p*f.length/u,h=f.byteLength/c[1],g=Math.floor(h/p/c[0]),_=this.sourceTileGrid_.getTileCoordExtent(r.tileCoord);_[0]+=n.offset,_[2]+=n.offset;let v=this.clipExtent_?.slice();v&&(v[0]+=n.offset,v[2]+=n.offset),e.push({extent:_,clipExtent:v,data:f,dataType:d,bytesPerPixel:m,pixelSize:c,bandCount:g})}),this.sourceTiles_.length=0,e.length===0){this.state=L.ERROR,this.changed();return}let n=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(n),i=typeof r==`number`?r:r[0],a=typeof r==`number`?r:r[1],o=Math.round(i*this.pixelRatio_),s=Math.round(a*this.pixelRatio_),c=this.targetTileGrid_.getResolution(n),l=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),d=e[0].bandCount,f=new e[0].dataType(d*o*s),p=NC(o,s,FC,{premultipliedAlpha:!1,antialias:!1}),m,h=p.RGBA,g;e[0].dataType==Float32Array?(g=p.FLOAT,p.getExtension(`WEBGL_color_buffer_float`),p.getExtension(`OES_texture_float`),p.getExtension(`EXT_float_blend`),m=p.getExtension(`OES_texture_float_linear`)!==null&&this.interpolate):(g=p.UNSIGNED_BYTE,m=this.interpolate);let _=Math.ceil(d/4);for(let t=_-1;t>=0;--t){let n=[];for(let r=0,i=e.length;r<i;++r){let i=e[r],a=i.pixelSize,o=a[0],s=a[1],c=new i.dataType(4*o*s),l=i.data,u=t*4;for(let e=0,t=c.length;e<t;e+=4)c[e]=l[u],c[e+1]=l[u+1],c[e+2]=l[u+2],c[e+3]=l[u+3],u+=d;let f=p.createTexture();p.bindTexture(p.TEXTURE_2D,f),m?(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.LINEAR)):(p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST)),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texImage2D(p.TEXTURE_2D,0,h,o,s,0,h,g,c),n.push({extent:i.extent,clipExtent:i.clipExtent,texture:f,width:o,height:s})}let{framebuffer:r,width:o,height:s}=IC(p,i,a,this.pixelRatio_,l,c,u,this.triangulation_,n,this.gutter_,g,this.renderEdges_,m),_=o,v=s*4,y=new e[0].dataType(_*v);p.bindFramebuffer(p.FRAMEBUFFER,r),p.readPixels(0,0,o,s,p.RGBA,g,y);let b=t*4;for(let e=0,t=y.length;e<t;e+=4){let t=(_-1-(e/v|0))*v+e%v;f[b]=y[t],f[b+1]=y[t+1],f[b+2]=y[t+2],f[b+3]=y[t+3],b+=d}}if(PC(p),FC.push(p.canvas),t){let e=_o(i,a),t=new ImageData(f,i);e.putImageData(t,0,0),this.reprojData_=e.canvas}else this.reprojData_=f;this.reprojSize_=[o,s],this.state=L.LOADED,this.changed()}load(){if(this.state!==L.IDLE&&this.state!==L.ERROR)return;this.state=L.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{let n=t.getState();if(n!==L.IDLE&&n!==L.LOADING)return;e++;let r=N(t,M.CHANGE,()=>{let n=t.getState();(n==L.LOADED||n==L.ERROR||n==L.EMPTY)&&(rt(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:e}){e.getState()==L.IDLE&&e.load()})}unlistenSources_(){this.sourcesListenerKeys_.forEach(rt),this.sourcesListenerKeys_=null}},RC=class extends cS{constructor(e){let t=e.projection===void 0?`EPSG:3857`:e.projection,n=e.tileGrid;n===void 0&&t&&(n=iS({extent:sS(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:n,state:e.state,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,zDirection:e.zDirection}),this.gutter_=e.gutter===void 0?0:e.gutter,this.tileSize_=e.tileSize?hc(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_;let t=this.getTileGrid();return t?hc(t.getTileSize(e)):[256,256]}getGutterForProjection(e){let t=this.getProjection();return(!t||ui(t,e))&&!this.transformMatrix?this.gutter_:0}setLoader(e){this.loader_=e}getReprojTile_(e,t,n,r,i,a){let o=this.tileGrid||this.getTileGridForProjection(i||r),s=Math.max.apply(null,o.getResolutions().map((e,t)=>{let n=hc(o.getTileSize(t)),r=this.getTileSize(t);return Math.max(r[0]/n[0],r[1]/n[1])})),c=this.getTileGridForProjection(r),l=[e,t,n],u=this.getTileCoordForTileUrlFunction(l,r),d=new LC(Object.assign({sourceProj:i||r,sourceTileGrid:o,targetProj:r,targetTileGrid:c,tileCoord:l,wrappedTileCoord:u,pixelRatio:s,gutter:this.gutter_,getTileFunction:(e,t,n,r)=>this.getTile(e,t,n,r,void 0,a),transformMatrix:this.transformMatrix},this.tileOptions));return d.key=this.getKey(),d}getTile(e,t,n,r,i,a){let o=this.getProjection();if(i&&(o&&!ui(o,i)||this.transformMatrix))return this.getReprojTile_(e,t,n,i,o,a);let s=this.getTileSize(e),c=this.loader_,l=new AbortController,u={signal:l.signal,crossOrigin:this.crossOrigin_},d=this.getTileCoordForTileUrlFunction([e,t,n]);if(!d)return null;let f=this.getKey(),p=jx(this,f,e,t,n);if(a&&a.containsKey(p))return a.get(p);let m=d[0],h=d[1],g=d[2],_=this.getTileGrid()?.getFullTileRange(m);_&&(u.maxY=_.getHeight()-1);function v(){return Ze(function(){return c(m,h,g,u)})}let y=new mx(Object.assign({tileCoord:[e,t,n],loader:v,size:s,controller:l},this.tileOptions));return y.key=this.getKey(),y.addEventListener(M.CHANGE,this.handleTileChange_),a?.set(p,y),y}handleTileChange_(e){let t=e.target,n=F(t),r=t.getState(),i;r==L.LOADING?(this.tileLoadingKeys_[n]=!0,i=NS.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],i=r==L.ERROR?NS.TILELOADERROR:r==L.LOADED?NS.TILELOADEND:void 0),i&&this.dispatchEvent(new lS(i,t))}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||ui(t,e))&&!this.transformMatrix)return this.tileGrid;let n=F(e);return n in this.tileGridForProjection_||(this.tileGridForProjection_[n]=tS(e)),this.tileGridForProjection_[n]}setTileGridForProjection(e,t){let n=B(e);if(n){let e=F(n);e in this.tileGridForProjection_||(this.tileGridForProjection_[e]=t)}}},zC=Error(`Image failed to load`);function BC(e,t,n,r,i){return new Promise((a,o)=>{let s=new Image;s.crossOrigin=i.crossOrigin??null,s.addEventListener(`load`,()=>a(s)),s.addEventListener(`error`,()=>o(zC)),s.src=DS(e,t,n,r,i.maxY)})}function VC(e){return function(t,n,r,i){return BC(OS(e,t,n,r),t,n,r,i)}}function HC(e){return function(t,n,r,i){return BC(e(t,n,r,i),t,n,r,i)}}function UC(e){let t;if(Array.isArray(e))t=VC(e);else if(typeof e==`string`)t=VC(kS(e));else if(typeof e==`function`)t=HC(e);else throw Error(`The url option must be a single template, an array of templates, or a function for getting a URL`);return t}var WC=0;function GC(e){return Array.isArray(e)?e.join(`
92
+ `):typeof e==`string`?e:(++WC,`url-function-key-`+WC)}var KC=class extends RC{constructor(e){e||={};let t=e.loader,n;e.url&&(t=UC(e.url),n=GC(e.url));let r=t?e.state:`loading`,i=e.wrapX===void 0?!0:e.wrapX;super({loader:t,key:n,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:i,transition:e.transition,interpolate:e.interpolate!==!1,crossOrigin:e.crossOrigin,zDirection:e.zDirection})}setUrl(e){let t=UC(e);this.setLoader(t),this.setKey(GC(e)),this.getState()!==`ready`&&this.setState(`ready`)}},qC=`data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCeRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAA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BnosjHnZ2Vz06N2NWP8AhJ/Df/QWtP8AwIj/AMa2nRJEaORQysCCCMgg9QRVH+ydK/584f8Av2v+FMo//9P91tHsrm5MOqaoWZ41/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==`,XC=class extends Eo{constructor(e){let t=e||{},n=document.createElement(`button`);n.innerHTML=`<div class="svgContainer"><svg width="22" height="22" viewBox="0 0 22 22" fill="rgb(102, 102, 102)" xmlns="http://www.w3.org/2000/svg">
110
93
  <path d="M11 4.7 16.9 9.4 11 14.1 5.1 9.4 11 4.7ZM11 16.7 20.4 9.4 11 2.1 1.6 9.4 11 16.7M11 19.3 3.5 13.3 1.6 14.7 11 21.9 20.4 14.7 18.5 13.3 11 19.3"/>
111
- </svg></div>`;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});Gt(this,"baseLayers",[{name:"positron",image:IC,styleUrl:"https://tiles.openfreemap.org/styles/positron"},{name:"orthofoto",image:PC,layer:new Ll({visible:!1,source:new SC({maxZoom:19,url:"https://mapsneu.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpg",attributions:'<a href="https://basemap.at">© basemap.at</a>'})}),visible:!1},{name:"kataster",image:MC,styleUrl:"https://kataster.bev.gv.at/styles/kataster/style_basic.json"}].map((t,i)=>{t.styleUrl&&(t.layer=new Si({visible:i===0}),t.styleUrl&&FA(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}));Gt(this,"baseLayerGroup");Gt(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 Si({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 LC extends En{constructor(t){super();ae(this,Ps);ae(this,mi,null);ae(this,zn,new Dn({source:new Mn}));pe(this,mi,t.yioMap);const i=M(this,zn).getSource();i.addEventListener("change",r=>{M(this,mi).userSelect=i.getFeatures().map(s=>s.getProperties())})}setMap(t){const i=this.getMap();i&&i.removeLayer(M(this,zn)),t&&(t.addLayer(M(this,zn)),super.setMap(t))}handleEvent(t){return t.type==="pointermove"&&le(this,Ps,sm).call(this,t),t.type==="click"?le(this,Ps,om).call(this,t):!0}setActive(t){super.setActive(t),t||(M(this,zn).getSource().clear(),M(this,mi)&&(M(this,mi).userSelect.length=0))}}mi=new WeakMap,zn=new WeakMap,Ps=new WeakSet,sm=function(t){const i=this.getMap(),r=M(this,mi)._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")},om=function(t){const i=this.getMap(),r=M(this,mi)._getContentLayer(),s=M(this,zn).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 ht?bg(a):a)),M(this,mi).notifyNextChange=!0,M(this,mi)._handleClick(t.originalEvent),o.length===0};function Nn(n,e){const t=n.length;return e<0?n[e+t]:e>=t?n[e-t]:n[e]}function Ss(n,e){const t=n.length;let i=Math.floor(e);const r=e-i;i>=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]}const Ul={index:-1,endIndex:NaN,closestTargetDistance:1/0};function VA(n,e,t,i){const r=n[0],s=n[1];let o=1/0,a=-1,l=NaN;for(let u=0;u<e.targets.length;++u){const d=e.targets[u],g=d.coordinates;let f=1/0,p;for(let A=0;A<g.length-1;++A){const m=g[A],y=g[A+1],E=XA(r,s,m,y);E.squaredDistance<f&&(f=E.squaredDistance,p=A+E.along)}f<o&&(o=f,d.ring&&e.targetIndex===u&&(d.endIndex>d.startIndex?p<d.startIndex&&(p+=g.length):d.endIndex<d.startIndex&&p>d.startIndex&&(p-=g.length)),l=p,a=u)}const c=e.targets[a];let h=c.ring;if(e.targetIndex===a&&h){const u=Ss(c.coordinates,l),d=t.getPixelFromCoordinate(u),g=t.getPixelFromCoordinate(e.startCoord);tr(d,g)>i&&(h=!1)}if(h){const u=c.coordinates,d=u.length,g=c.startIndex,f=l;if(g<f){const p=Hl(u,g,f);Hl(u,g,f-d)<p&&(l-=d)}else{const p=Hl(u,g,f);Hl(u,g,f+d)<p&&(l+=d)}}return Ul.index=a,Ul.endIndex=l,Ul.closestTargetDistance=o,Ul}function WA(n,e){const t=[];for(let i=0;i<e.length;++i){const s=e[i].getGeometry();HA(n,s,t)}return t}function HA(n,e,t){if(e instanceof ii){Vl(n,e.getCoordinates(),!1,t);return}if(e instanceof bn){const i=e.getCoordinates();for(let r=0,s=i.length;r<s;++r)Vl(n,i[r],!1,t);return}if(e instanceof Jt){const i=e.getCoordinates();for(let r=0,s=i.length;r<s;++r)Vl(n,i[r],!0,t);return}if(e instanceof Tn){const i=e.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length;a<l;++a)Vl(n,o[a],!0,t)}return}if(e instanceof Ro){const i=e.getGeometries();for(let r=0;r<i.length;++r)HA(n,i[r],t);return}}function Vl(n,e,t,i){const r=n[0],s=n[1];for(let o=0,a=e.length-1;o<a;++o){const l=e[o],c=e[o+1],h=XA(r,s,l,c);if(h.squaredDistance===0){const u=o+h.along;i.push({coordinates:e,ring:t,startIndex:u,endIndex:u});return}}}function Wl(n,e){return zi(n[0],n[1],e[0],e[1])}function Hl(n,e,t){let i,r;e<t?(i=e,r=t):(i=t,r=e);const s=Math.ceil(i),o=Math.floor(r);if(s>o){const l=Ss(n,i),c=Ss(n,r);return Wl(l,c)}let a=0;if(i<s){const l=Ss(n,i),c=Nn(n,s);a+=Wl(l,c)}if(o<r){const l=Nn(n,o),c=Ss(n,r);a+=Wl(l,c)}for(let l=s;l<o-1;++l){const c=Nn(n,l),h=Nn(n,l+1);a+=Wl(c,h)}return a}const sd={along:0,squaredDistance:0};function XA(n,e,t,i){const r=t[0],s=t[1],o=i[0],a=i[1],l=o-r,c=a-s;let h=0,u=r,d=s;return(l!==0||c!==0)&&(h=Pe(((n-r)*l+(e-s)*c)/(l*l+c*c),0,1),u+=l*h,d+=c*h),sd.along=h,sd.squaredDistance=Xs(zi(n,e,u,d),10),sd}const Xl={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class Yl extends Nt{constructor(e,t){super(e),this.feature=t}}class kC extends cr{constructor(e){const t=e;t.stopDown||(t.stopDown=Hr),super(t),this.on,this.once,this.un,this.options_=e,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_=OC(this.type_),this.stopClick_=!!e.stopClick,this.ignoreNextUpEvent_=!1,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:Wr,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 Ua([NaN,NaN]),c=je(s[0]),h=Kr(c,je(s[s.length-1]));return l.setCenterAndRadius(c,Math.sqrt(h),this.geometryLayout_),l};else{let s;r==="Point"?s=It:r==="LineString"?s=ii:r==="Polygon"&&(s=Jt),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 Dn({source:new Mn({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:DC(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Ra,this.freehandCondition_,e.freehand?this.freehandCondition_=es:this.freehandCondition_=e.freehandCondition?e.freehandCondition:th,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Jc.ACTIVE,this.updateState_)}setTrace(e){let t;e?e===!0?t=es:t=e:t=zf,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehand_?this.freehandCondition_=es:this.freehandCondition_=this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:th}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===K.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(e);let t=e.type===he.POINTERMOVE,i=!0;return!this.freehand_&&this.lastDragTime_&&e.type===he.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===he.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),i=!1):this.freehand_&&e.type===he.POINTERDOWN?i=!1:t&&this.getPointerCount()<2?(i=e.type===he.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType==="mouse"||e.type===he.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===he.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 Ni(he.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=mt([i,r]),o=this.traceSource_.getFeaturesInExtent(s);if(o.length===0)return;const a=WA(e.coordinate,o);a.length&&(this.traceState_={active:!0,startCoord:e.coordinate.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&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(i&&t<e.endIndex||!i&&t>e.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(e<t){const r=Math.ceil(e);let s=Math.floor(t);s===t&&(s-=1),i=s-r+1}else{const r=Math.floor(e);let s=Math.ceil(t);s===t&&(s+=1),i=r-s+1}i>0&&this.removeLastPoints_(i)}addTracedCoordinates_(e,t,i){if(t===i)return;const r=[];if(t<i){const s=Math.ceil(t);let o=Math.floor(i);o===i&&(o-=1);for(let a=s;a<=o;++a)r.push(Nn(e.coordinates,a))}else{const s=Math.floor(t);let o=Math.ceil(i);o===i&&(o+=1);for(let a=s;a>=o;--a)r.push(Nn(e.coordinates,a))}r.length&&this.appendCoordinates(r)}updateTrace_(e){const t=this.traceState_;if(!t.active)return;if(t.targetIndex===-1){const a=e.map.getPixelFromCoordinate(t.startCoord);if(tr(a,e.pixel)<this.snapTolerance_)return}const i=VA(e.coordinate,t,this.getMap(),this.snapTolerance_);if(t.targetIndex!==i.index){if(t.targetIndex!==-1){const l=t.targets[t.targetIndex];this.removeTracedCoordinates_(l.startIndex,l.endIndex)}const a=t.targets[i.index];this.addTracedCoordinates_(a,a.startIndex,i.endIndex)}else{const a=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(a,i.endIndex)}t.targetIndex=i.index;const r=t.targets[t.targetIndex];r.endIndex=i.endIndex;const s=Ss(r.coordinates,r.endIndex),o=this.getMap().getPixelFromCoordinate(s);e.coordinate=s,e.pixel=[Math.round(o[0]),Math.round(o[1])]}handleDragEvent(e){this.ignoreNextUpEvent_=!0,super.handleDragEvent(e)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(e);const i=this.traceState_.active;if(this.ignoreNextUpEvent_||this.toggleTraceState_(e),this.shouldHandle_){const r=!this.finishCoordinate_;r&&this.startDrawing_(e.coordinate),!r&&this.freehand_?this.finishDrawing():!this.freehand_&&(!r||this.mode_==="Point")&&(this.atFinish_(e.pixel,i)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing()}return this.ignoreNextUpEvent_=!1,!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const t=this.downPx_,i=e.pixel,r=t[0]-i[0],s=t[1]-i[1],o=r*r+s*s;if(this.shouldHandle_=this.freehand_?o>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<c;l++){const h=s[l],u=a.getPixelFromCoordinate(h),d=e[0]-u[0],g=e[1]-u[1],f=this.freehand_?1:this.snapTolerance_;if(i=Math.sqrt(d*d+g*g)<=f,i){this.finishCoordinate_=h;break}}}}return i}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new Wt(new It(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||(this.sketchLine_=new Wt);const t=e.getLinearRing(0);let i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),i.changed()):(i=new ii(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(i))}startDrawing_(e){const t=this.getMap().getView().getProjection(),i=ya(this.geometryLayout_);for(;e.length<i;)e.push(0);this.finishCoordinate_=e,this.mode_==="Point"?this.sketchCoords_=e.slice():this.mode_==="Polygon"?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Wt(new ii(this.sketchLineCoords_)));const r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new Wt,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new Yl(Xl.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){const t=this.getMap(),i=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),s=ya(this.geometryLayout_);let o,a;for(;e.length<s;)e.push(0);this.mode_==="Point"?a=this.sketchCoords_:this.mode_==="Polygon"?(o=this.sketchCoords_[0],a=o[o.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(o=this.sketchCoords_,a=o[o.length-1]),a[0]=e[0],a[1]=e[1],this.geometryFunction_(this.sketchCoords_,i,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),i.getType()==="Polygon"&&this.mode_!=="Polygon"?this.createOrUpdateCustomSketchLine_(i):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){const t=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();let r,s;const o=this.mode_;return o==="LineString"||o==="Circle"?(this.finishCoordinate_=e.slice(),s=this.sketchCoords_,s.length>=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<e;++s){let o;if(r==="LineString"||r==="Circle"){if(o=this.sketchCoords_,o.splice(-2,1),o.length>=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 mr([t])):this.type_==="MultiLineString"?e.setGeometry(new bn([t])):this.type_==="MultiPolygon"&&e.setGeometry(new Tn([t])),this.dispatchEvent(new Yl(Xl.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 Yl(Xl.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<e.length;o++)this.addToDrawing_(e[o]);const s=e[e.length-1];this.sketchFeature_=this.addToDrawing_(s),this.modifyDrawing_(s)}extend(e){const i=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=i.getCoordinates();const r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new Wt(new It(r)),this.updateSketchFeatures_(),this.dispatchEvent(new Yl(Xl.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);const t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){const e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}}function DC(){const n=cg();return function(e,t){return n[e.getGeometry().getType()]}}function OC(n){switch(n){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+n)}}const YA=0,Xo=1,KA=[0,0,0,0],Is=[],od={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};function ad(n,e,t){let i;switch(e){case"LineString":i=n;break;case"MultiLineString":case"Polygon":i=n[t[0]];break;case"MultiPolygon":i=n[t[1]][t[0]];break}return i}class ld extends Nt{constructor(e,t,i){super(e),this.features=t,this.mapBrowserEvent=i}}class GC extends cr{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:nh,this.defaultDeleteCondition_=function(i){return M0(i)&&k0(i)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:es,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new wu,this.pixelTolerance_=e.pixelTolerance!==void 0?e.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new Dn({source:new Mn({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:NC(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.traceSource_=e.traceSource||e.source||null,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSegments_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new Rt(this.source_.getFeatures()),this.source_.addEventListener(Lt.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Lt.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw new Error("The modify interaction requires features, a source or a layer");e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(pt.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(pt.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}setTrace(e){let t;e?e===!0?t=es:t=e:t=zf,this.traceCondition_=t}addFeature_(e){const t=e.getGeometry();if(t){const r=this.SEGMENT_WRITERS_[t.getType()];r&&r(e,t)}const i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_),e.addEventListener(K.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Rt;const i=this.featuresBeingModified_.getArray();for(let r=0,s=t.length;r<s;++r){const o=t[r].feature;o&&!i.includes(o)&&this.featuresBeingModified_.push(o)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new ld(od.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.getLength()===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.removeEventListener(K.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(e){const t=this.rBush_,i=[];t.forEach(function(r){e===r.feature&&i.push(r)});for(let r=i.length-1;r>=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;r<s;++r){const o=i[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length-1;r<s;++r){const o=i.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:o};this.rBush_.insert(mt(o),a)}}writeMultiLineStringGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length-1;a<l;++a){const c=o.slice(a,a+2),h={feature:e,geometry:t,depth:[r],index:a,segment:c};this.rBush_.insert(mt(c),h)}}}writePolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length-1;a<l;++a){const c=o.slice(a,a+2),h={feature:e,geometry:t,depth:[r],index:a,segment:c};this.rBush_.insert(mt(c),h)}}}writeMultiPolygonGeometry_(e,t){const i=t.getCoordinates();for(let r=0,s=i.length;r<s;++r){const o=i[r];for(let a=0,l=o.length;a<l;++a){const c=o[a];for(let h=0,u=c.length-1;h<u;++h){const d=c.slice(h,h+2),g={feature:e,geometry:t,depth:[a,r],index:h,segment:d};this.rBush_.insert(mt(d),g)}}}}writeCircleGeometry_(e,t){const i=t.getCenter(),r={feature:e,geometry:t,index:YA,segment:[i,i]},s={feature:e,geometry:t,index:Xo,segment:[i,i]},o=[r,s];r.featureSegments=o,s.featureSegments=o,this.rBush_.insert(Ys(i),r);let a=t;this.rBush_.insert(a.getExtent(),s)}writeGeometryCollectionGeometry_(e,t){const i=t.getGeometriesArray();for(let r=0;r<i.length;++r){const s=i[r],o=this.SEGMENT_WRITERS_[s.getType()];o(e,s)}}createOrUpdateVertexFeature_(e,t,i,r){let s=this.vertexFeature_;return s?s.getGeometry().setCoordinates(e):(s=new Wt(new It(e)),this.vertexFeature_=s,this.overlay_.getSource().addFeature(s)),s.set("features",t),s.set("geometries",i),s.set("existing",r),s}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==he.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(e.type!=he.SINGLECLICK||!this.ignoreNextSingleClick_?t=this.removePoint():t=!0),e.type==he.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){if(this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null,!this.vertexFeature_)return;this.getMap().getView().getProjection();const i=[],r=this.vertexFeature_.getGeometry().getCoordinates(),s=mt([r]),o=this.rBush_.getInExtent(s),a={};o.sort(BC);for(let l=0,c=o.length;l<c;++l){const h=o[l],u=h.segment;let d=Y(h.geometry);const g=h.depth;if(g&&(d+="-"+g.join("-")),a[d]||(a[d]=new Array(2)),h.geometry.getType()==="Circle"&&h.index===Xo){const f=qA(e,h);Et(f,r)&&!a[d][0]&&(this.dragSegments_.push([h,0]),a[d][0]=h);continue}if(Et(u[0],r)&&!a[d][0]){this.dragSegments_.push([h,0]),a[d][0]=h;continue}if(Et(u[1],r)&&!a[d][1]){if(a[d][0]&&a[d][0].index===0){let f=h.geometry.getCoordinates();switch(h.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":f=f[g[1]];case"Polygon":if(h.index!==f[g[0]].length-2)continue;break}}this.dragSegments_.push([h,1]),a[d][1]=h;continue}Y(u)in this.vertexSegments_&&!a[d][0]&&!a[d][1]&&i.push(h)}return i}deactivateTrace_(){this.traceState_={active:!1}}updateTrace_(e){const t=this.traceState_;if(!t.active)return;if(t.targetIndex===-1){const s=e.map.getPixelFromCoordinate(t.startCoord);if(tr(s,e.pixel)<this.pixelTolerance_)return}const i=VA(e.coordinate,t,e.map,this.pixelTolerance_);if(t.targetIndex===-1&&Math.sqrt(i.closestTargetDistance)/e.map.getView().getResolution()>this.pixelTolerance_)return;if(t.targetIndex!==i.index){if(t.targetIndex!==-1){const o=t.targets[t.targetIndex];this.removeTracedCoordinates_(o.startIndex,o.endIndex)}else for(const o of this.traceSegments_){const a=o[0],l=a.geometry,c=o[1],h=l.getCoordinates();ad(h,l.getType(),a.depth).splice(a.index+c,1),l.setCoordinates(h),c===0&&(a.index-=1)}const s=t.targets[i.index];this.addTracedCoordinates_(s,s.startIndex,i.endIndex)}else{const s=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(s,i.endIndex)}t.targetIndex=i.index;const r=t.targets[t.targetIndex];r.endIndex=i.endIndex}getTraceCandidates_(e){const t=this.getMap(),i=this.pixelTolerance_,r=t.getCoordinateFromPixel([e.pixel[0]-i,e.pixel[1]+i]),s=t.getCoordinateFromPixel([e.pixel[0]+i,e.pixel[1]-i]),o=mt([r,s]);return this.traceSource_.getFeaturesInExtent(o)}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_(),this.traceSegments_=null;return}const t=this.getTraceCandidates_(e);if(t.length===0)return;const i=WA(e.coordinate,t);i.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:i,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){const i=e.startIndex<=e.endIndex,r=e.startIndex<=t;i===r?i&&t>e.endIndex||!i&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(i&&t<e.endIndex||!i&&t>e.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(e<t){const r=Math.ceil(e);let s=Math.floor(t);s===t&&(s-=1),i=s-r+1}else{const r=Math.floor(e);let s=Math.ceil(t);s===t&&(s+=1),i=r-s+1}if(i>0)for(const r of this.traceSegments_){const s=r[0],o=s.geometry,a=r[1];let l=r[0].index+1;a===1&&(l-=i);const c=o.getCoordinates();ad(c,o.getType(),s.depth).splice(l,i),o.setCoordinates(c),a===1&&(s.index-=i)}}addTracedCoordinates_(e,t,i){if(t===i)return;const r=[];if(t<i){const s=Math.ceil(t);let o=Math.floor(i);o===i&&(o-=1);for(let a=s;a<=o;++a)r.push(Nn(e.coordinates,a))}else{const s=Math.floor(t);let o=Math.ceil(i);o===i&&(o+=1);for(let a=s;a>=o;--a)r.push(Nn(e.coordinates,a))}if(r.length)for(const s of this.traceSegments_){const o=s[0],a=o.geometry,l=s[1],c=o.index+1;l===0&&r.reverse();const h=a.getCoordinates();ad(h,a.getType(),o.depth).splice(c,0,...r),a.setCoordinates(h),l===1&&(o.index+=r.length)}}updateGeometry_(e,t){const i=t[0],r=i.depth;let s;const o=i.segment,a=i.geometry,l=t[1];for(;e.length<a.getStride();)e.push(o[l][e.length]);switch(a.getType()){case"Point":s=e,o[0]=e,o[1]=e;break;case"MultiPoint":s=a.getCoordinates(),s[i.index]=e,o[0]=e,o[1]=e;break;case"LineString":s=a.getCoordinates(),s[i.index+l]=e,o[l]=e;break;case"MultiLineString":s=a.getCoordinates(),s[r[0]][i.index+l]=e,o[l]=e;break;case"Polygon":s=a.getCoordinates(),s[r[0]][i.index+l]=e,o[l]=e;break;case"MultiPolygon":s=a.getCoordinates(),s[r[1]][r[0]][i.index+l]=e,o[l]=e;break;case"Circle":const c=a;if(o[0]=e,o[1]=e,i.index===YA)this.changingFeature_=!0,c.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0,this.getMap().getView().getProjection();let h=tr(je(c.getCenter()),je(e));c.setRadius(h),this.changingFeature_=!1}break}s&&this.setGeometryCoordinates_(a,s)}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([o])=>o));const t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],i=[],r=[],s=this.traceState_.active&&!this.traceSegments_?this.traceState_.startCoord:null;if(s){this.traceSegments_=[];for(const o of this.dragSegments_){const a=o[0];tr(dc(s,a.segment),s)/e.map.getView().getResolution()<1&&this.traceSegments_.push(o)}}for(let o=0,a=this.dragSegments_.length;o<a;++o){const l=this.dragSegments_[o],c=l[0],h=c.feature;i.includes(h)||i.push(h);const u=c.geometry;r.includes(u)||r.push(u),this.updateGeometry_(t,l)}this.updateTrace_(e),this.createOrUpdateVertexFeature_(t,i,r,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;const t=e.coordinate,i=this.findInsertVerticesAndUpdateDragSegments_(t);if(i!=null&&i.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,i),this.vertexFeature_)){const r=this.vertexFeature_.getGeometry().getCoordinates();for(let s=i.length-1;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(Ys(o),a);let c=s;this.rBush_.update(c.getExtent(),l)}else this.rBush_.update(mt(i.segment),i)}return this.featuresBeingModified_&&(this.toggleTraceState_(e),this.dispatchEvent(new ld(od.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null),!1}handlePointerMove_(e){this.lastCoordinate_=e.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(e){const t=this.getMap(),i=t.getPixelFromCoordinate(e);t.getView().getProjection();const r=function(a,l){return ZA(e,a)-ZA(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 It(sr(h.getCoordinates())));const u=h||l.getGeometry();if(u&&u.getType()==="Point"&&l instanceof Wt&&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=ci(Ys(e,KA)),l=t.getView().getResolution()*this.pixelTolerance_,c=ma(ji(a,l,KA));s=this.rBush_.getInExtent(c)}if(s&&s.length>0){const a=s.sort(r)[0],l=a.segment;let c=qA(e,a);const h=t.getPixelFromCoordinate(c);let u=tr(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===Xo)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=Kr(h,g),A=Kr(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;y<E;++y){const x=s[y].segment;if(Et(l[0],x[0])&&Et(l[1],x[1])||Et(l[0],x[1])&&Et(l[1],x[0])){const _=Y(s[y].geometry);_ in m||(m[_]=!0,d[Y(x)]=!0)}else break}}this.vertexSegments_=d;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(e,t){const i=e.segment,r=e.feature,s=e.geometry,o=e.depth,a=e.index;let l;for(;t.length<s.getStride();)t.push(0);switch(s.getType()){case"MultiLineString":l=s.getCoordinates(),l[o[0]].splice(a+1,0,t);break;case"Polygon":l=s.getCoordinates(),l[o[0]].splice(a+1,0,t);break;case"MultiPolygon":l=s.getCoordinates(),l[o[1]][o[0]].splice(a+1,0,t);break;case"LineString":l=s.getCoordinates(),l.splice(a+1,0,t);break;default:return!1}this.setGeometryCoordinates_(s,l);const c=this.rBush_;c.remove(e),this.updateSegmentIndices_(s,a,o,1);const h={segment:[i[0],t],feature:r,geometry:s,depth:o,index:a};c.insert(mt(h.segment),h),this.dragSegments_.push([h,1]);const u={segment:[t,i[1]],feature:r,geometry:s,depth:o,index:a+1};return c.insert(mt(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(e){var t;return e&&this.findInsertVerticesAndUpdateDragSegments_(e),(t=this.vertexFeature_)==null?void 0:t.getGeometry().getCoordinates()}getPoint(){var t;const e=(t=this.vertexFeature_)==null?void 0:t.getGeometry().getCoordinates();return e?sr(e,this.getMap().getView().getProjection()):null}canRemovePoint(){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(mt([e])).some(({segment:i})=>Et(i[0],e)||Et(i[1],e))}removePoint(e){if(e&&(e=je(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=he.POINTERDRAG){const t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_.map(([r])=>r));const i=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new ld(od.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(mt(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(mt([e])).some(({segment:i})=>!(Et(i[0],e)||Et(i[1],e)))}insertPoint(e){var r;const t=e?je(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||Bi(s.depth,i))&&s.index>t&&(s.index+=r)})}}function BC(n,e){return n.index-e.index}function ZA(n,e,t){const i=e.geometry;if(i.getType()==="Circle"){let s=i;if(e.index===Xo){const o=Kr(s.getCenter(),je(n)),a=Math.sqrt(o)-s.getRadius();return a*a}}const r=je(n);return Is[0]=je(e.segment[0]),Is[1]=je(e.segment[1]),gy(r,Is)}function qA(n,e,t){const i=e.geometry;if(i.getType()==="Circle"&&e.index===Xo)return sr(i.getClosestPoint(je(n)));const r=je(n);return Is[0]=je(e.segment[0]),Is[1]=je(e.segment[1]),sr(dc(r,Is))}function NC(){const n=cg();return function(e,t){return n.Point}}const QA=new Vt({color:"rgba(255,255,255,0.4)"}),JA=new ti({color:"#3399CC",width:1.25}),$A=[new rt({image:new pr({fill:QA,stroke:JA,radius:5}),fill:QA,stroke:JA})],zC=`
94
+ </svg></div>`;let r=document.createElement(`div`);r.className=`layer-control ol-unselectable ol-control`,r.appendChild(n);let i=document.createElement(`div`);i.classList.add(`layer-selection`,`hidden`),r.appendChild(i),super({element:r,target:t.target}),this.baseLayers.forEach(e=>{i.appendChild(e.thumbnailBox)}),this.layerControlElement=i,n.addEventListener(`click`,this.toggleLayerSelection.bind(this),!1)}baseLayers=[{name:`positron`,image:qC,styleUrl:`https://tiles.openfreemap.org/styles/positron`},{name:`orthofoto`,image:JC,layer:new Vx({visible:!1,source:new KC({maxZoom:19,url:`https://mapsneu.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpg`,attributions:`<a href="https://basemap.at">© basemap.at</a>`})}),visible:!1},{name:`kataster`,image:YC,styleUrl:`https://kataster.bev.gv.at/styles/kataster/style_basic.json`}].map((e,t)=>{e.styleUrl&&(e.layer=new xs({visible:t===0}),e.styleUrl&&uC(e.layer,e.styleUrl));let n=document.createElement(`div`);n.classList.add(`image-box`),t===0&&n.classList.add(`selected`);let r=document.createElement(`img`);return r.src=e.image,r.alt=e.name,n.appendChild(r),n.addEventListener(`click`,t=>{this.baseLayers.forEach(e=>{t.target===e.thumbnailBox?e.thumbnailBox.classList.add(`selected`):e.thumbnailBox.classList.remove(`selected`)}),this.baseLayers.forEach(t=>{t.layer.setVisible(t.name===e.name)})}),e.thumbnailBox=n,e});baseLayerGroup;setMap(e){this.getMap()&&this.getMap().removeLayer(this.baseLayerGroup),e&&(this.baseLayerGroup=new xs({layers:this.baseLayers.map(e=>e.layer)}),e.addLayer(this.baseLayerGroup)),super.setMap(e)}layerControlElement=null;set displayLayerSelection(e){if(e){this.layerControlElement.classList.remove(`hidden`);let e=()=>{this.displayLayerSelection=!1,this.getMap().getTargetElement().removeEventListener(`click`,e)};setTimeout(()=>{this.getMap().getTargetElement().addEventListener(`click`,e)}),this.getMap().once(`moveend`,()=>{this.displayLayerSelection&&(this.displayLayerSelection=!1,document.body.removeEventListener(`click`,e))})}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)}},ZC=class extends No{#e=null;#t=new _y({source:new Ov});constructor(e){super(),this.#e=e.yioMap;let t=this.#t.getSource();t.addEventListener(`change`,e=>{this.#e.userSelect=t.getFeatures().map(e=>e.getProperties())})}setMap(e){let t=this.getMap();t&&t.removeLayer(this.#t),e&&(e.addLayer(this.#t),super.setMap(e))}#n(e){let t=this.getMap(),n=this.#e._getContentLayer();t.getFeaturesAtPixel(e.pixel,{layerFilter:e=>n.getLayers().getArray().includes(e)}).filter(e=>e.get(`id`)!==void 0).length?t.getTargetElement().classList.add(`cursor-pointer`):t.getTargetElement().classList.remove(`cursor-pointer`)}#r(e){let t=this.getMap(),n=this.#e._getContentLayer(),r=this.#t.getSource(),i=t.getFeaturesAtPixel(e.pixel,{layerFilter:e=>n.getLayers().getArray().includes(e)}).filter(e=>e.get(`id`)!==void 0);return r.clear(),r.addFeatures(i.map(e=>e instanceof md?gd(e):e)),this.#e.notifyNextChange=!0,this.#e._handleClick(e.originalEvent),i.length===0}handleEvent(e){return e.type===`pointermove`&&this.#n(e),e.type===`click`?this.#r(e):!0}setActive(e){super.setActive(e),e||(this.#t.getSource().clear(),this.#e&&(this.#e.userSelect.length=0))}};function QC(e,t){let n=e.length;return t<0?e[t+n]:t>=n?e[t-n]:e[t]}function $C(e,t){let n=e.length,r=Math.floor(t),i=t-r;r>=n?r-=n:r<0&&(r+=n);let a=r+1;a>=n&&(a-=n);let o=e[r],s=o[0],c=o[1],l=e[a],u=l[0]-s,d=l[1]-c;return[s+u*i,c+d*i]}var ew={index:-1,endIndex:NaN,closestTargetDistance:1/0};function tw(e,t,n,r){let i=e[0],a=e[1],o=1/0,s=-1,c=NaN;for(let e=0;e<t.targets.length;++e){let n=t.targets[e],r=n.coordinates,l=1/0,u;for(let e=0;e<r.length-1;++e){let t=r[e],n=r[e+1],o=cw(i,a,t,n);o.squaredDistance<l&&(l=o.squaredDistance,u=e+o.along)}l<o&&(o=l,n.ring&&t.targetIndex===e&&(n.endIndex>n.startIndex?u<n.startIndex&&(u+=r.length):n.endIndex<n.startIndex&&u>n.startIndex&&(u-=r.length)),c=u,s=e)}let l=t.targets[s],u=l.ring;if(t.targetIndex===s&&u){let e=$C(l.coordinates,c);Rn(n.getPixelFromCoordinate(e),n.getPixelFromCoordinate(t.startCoord))>r&&(u=!1)}if(u){let e=l.coordinates,t=e.length,n=l.startIndex,r=c;if(n<r){let i=ow(e,n,r);ow(e,n,r-t)<i&&(c-=t)}else{let i=ow(e,n,r);ow(e,n,r+t)<i&&(c+=t)}}return ew.index=s,ew.endIndex=c,ew.closestTargetDistance=o,ew}function nw(e,t){let n=[];for(let r=0;r<t.length;++r)rw(e,t[r].getGeometry(),n);return n}function rw(e,t,n){if(t instanceof ld){iw(e,t.getCoordinates(),!1,n);return}if(t instanceof ud){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)iw(e,r[t],!1,n);return}if(t instanceof Va){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t)iw(e,r[t],!0,n);return}if(t instanceof fd){let r=t.getCoordinates();for(let t=0,i=r.length;t<i;++t){let i=r[t];for(let t=0,r=i.length;t<r;++t)iw(e,i[t],!0,n)}return}if(t instanceof od){let r=t.getGeometries();for(let t=0;t<r.length;++t)rw(e,r[t],n);return}}function iw(e,t,n,r){let i=e[0],a=e[1];for(let e=0,o=t.length-1;e<o;++e){let o=t[e],s=t[e+1],c=cw(i,a,o,s);if(c.squaredDistance===0){let i=e+c.along;r.push({coordinates:t,ring:n,startIndex:i,endIndex:i});return}}}function aw(e,t){return Pt(e[0],e[1],t[0],t[1])}function ow(e,t,n){let r,i;t<n?(r=t,i=n):(r=n,i=t);let a=Math.ceil(r),o=Math.floor(i);if(a>o)return aw($C(e,r),$C(e,i));let s=0;if(r<a){let t=$C(e,r),n=QC(e,a);s+=aw(t,n)}if(o<i){let t=QC(e,o),n=$C(e,i);s+=aw(t,n)}for(let t=a;t<o-1;++t){let n=QC(e,t),r=QC(e,t+1);s+=aw(n,r)}return s}var sw={along:0,squaredDistance:0};function cw(e,t,n,r){let i=n[0],a=n[1],o=r[0],s=r[1],c=o-i,l=s-a,u=0,d=i,f=a;return(c!==0||l!==0)&&(u=Mt(((e-i)*c+(t-a)*l)/(c*c+l*l),0,1),d+=c*u,f+=l*u),sw.along=u,sw.squaredDistance=Bt(Pt(e,t,d,f),10),sw}var lw={DRAWSTART:`drawstart`,DRAWEND:`drawend`,DRAWABORT:`drawabort`},uw=class extends et{constructor(e,t){super(e),this.feature=t}},dw=class extends Qo{constructor(e){let t=e;t.stopDown||=Je,super(t),this.on,this.once,this.un,this.options_=e,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_=pw(this.type_),this.stopClick_=!!e.stopClick,this.ignoreNextUpEvent_=!1,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:qe,this.geometryLayout_=e.geometryLayout?e.geometryLayout:`XY`;let n=e.geometryFunction;if(!n){let e=this.mode_;if(e===`Circle`)n=(e,t,n)=>{let r=t||new ad([NaN,NaN]),i=yi(e[0],n),a=Ln(i,yi(e[e.length-1],n));r.setCenterAndRadius(i,Math.sqrt(a),this.geometryLayout_);let o=_i();return o&&r.transform(n,o),r};else{let t;e===`Point`?t=xa:e===`LineString`?t=ld:e===`Polygon`&&(t=Va),n=(n,r,i)=>(r?e===`Polygon`?n[0].length?r.setCoordinates([n[0].concat([n[0][0]])],this.geometryLayout_):r.setCoordinates([],this.geometryLayout_):r.setCoordinates(n,this.geometryLayout_):r=new t(n,this.geometryLayout_),r)}}this.geometryFunction_=n,this.dragVertexDelay_=e.dragVertexDelay===void 0?500:e.dragVertexDelay,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 _y({source:new Ov({useSpatialIndex:!1,wrapX:e.wrapX?e.wrapX:!1}),style:e.style?e.style:fw(),updateWhileInteracting:!0}),this.geometryName_=e.geometryName,this.condition_=e.condition?e.condition:Ko,this.freehandCondition_,e.freehand?this.freehandCondition_=Ho:this.freehandCondition_=e.freehandCondition?e.freehandCondition:Jo,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSource_=e.traceSource||e.source||null,this.addChangeListener(Mo.ACTIVE,this.updateState_)}setTrace(e){let t;t=e?e===!0?Ho:e:Wo,this.traceCondition_=t}setMap(e){super.setMap(e),this.updateState_()}setFreehand(e){this.freehand_=e,this.freehand_?this.freehandCondition_=Ho:this.freehandCondition_=this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:Jo}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(e){e.originalEvent.type===M.CONTEXTMENU&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==`Point`&&this.freehandCondition_(e);let t=e.type===I.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&e.type===I.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===I.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===I.POINTERDOWN?n=!1:t&&this.getPointerCount()<2?(n=e.type===I.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):(e.originalEvent.pointerType===`mouse`||e.type===I.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(e)):e.type===I.DBLCLICK&&(n=!1),super.handleEvent(e)&&n}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 pt(I.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}let t=this.getMap(),n=qt([t.getCoordinateFromPixel([e.pixel[0]-this.snapTolerance_,e.pixel[1]+this.snapTolerance_]),t.getCoordinateFromPixel([e.pixel[0]+this.snapTolerance_,e.pixel[1]-this.snapTolerance_])]),r=this.traceSource_.getFeaturesInExtent(n);if(r.length===0)return;let i=nw(e.coordinate,r);i.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:i,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.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 n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}n>0&&this.removeLastPoints_(n)}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(QC(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(QC(e.coordinates,t))}r.length&&this.appendCoordinates(r)}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&Rn(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.snapTolerance_)return;let n=tw(e.coordinate,t,this.getMap(),this.snapTolerance_);if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index;let r=t.targets[t.targetIndex];r.endIndex=n.endIndex;let i=$C(r.coordinates,r.endIndex),a=this.getMap().getPixelFromCoordinate(i);e.coordinate=i,e.pixel=[Math.round(a[0]),Math.round(a[1])]}handleDragEvent(e){this.ignoreNextUpEvent_=!0,super.handleDragEvent(e)}handleUpEvent(e){let t=!0;if(this.getPointerCount()===0){this.downTimeout_&&=(clearTimeout(this.downTimeout_),void 0),this.handlePointerMove_(e);let n=this.traceState_.active;if(this.ignoreNextUpEvent_||this.toggleTraceState_(e),this.shouldHandle_){let r=!this.finishCoordinate_;r&&this.startDrawing_(e.coordinate),!r&&this.freehand_?this.finishDrawing():!this.freehand_&&(!r||this.mode_===`Point`)&&(this.atFinish_(e.pixel,n)?this.finishCondition_(e)&&this.finishDrawing():this.addToDrawing_(e.coordinate)),t=!1}else this.freehand_&&this.abortDrawing()}return this.ignoreNextUpEvent_=!1,!t&&this.stopClick_&&e.preventDefault(),t}handlePointerMove_(e){if(this.pointerType_=e.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){let t=this.downPx_,n=e.pixel,r=t[0]-n[0],i=t[1]-n[1],a=r*r+i*i;if(this.shouldHandle_=this.freehand_?a>this.squaredClickTolerance_:a<=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 n=!1;if(this.sketchFeature_){let r=!1,i=[this.finishCoordinate_],a=this.mode_;if(a===`Point`)n=!0;else if(a===`Circle`)n=this.sketchCoords_.length===2;else if(a===`LineString`)r=!t&&this.sketchCoords_.length>this.minPoints_;else if(a===`Polygon`){let e=this.sketchCoords_;r=e[0].length>this.minPoints_,i=[e[0][0],e[0][e[0].length-2]],i=t?[e[0][0]]:[e[0][0],e[0][e[0].length-2]]}if(r){let t=this.getMap();for(let r=0,a=i.length;r<a;r++){let a=i[r],o=t.getPixelFromCoordinate(a),s=e[0]-o[0],c=e[1]-o[1],l=this.freehand_?1:this.snapTolerance_;if(n=Math.sqrt(s*s+c*c)<=l,n){this.finishCoordinate_=a;break}}}}return n}createOrUpdateSketchPoint_(e){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new $u(new xa(e)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(e){this.sketchLine_||=new $u;let t=e.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(t.getLayout(),t.getFlatCoordinates()),n.changed()):(n=new ld(t.getFlatCoordinates(),t.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(e){let t=this.getMap().getView().getProjection(),n=Yi(this.geometryLayout_);for(;e.length<n;)e.push(0);this.finishCoordinate_=e,this.mode_===`Point`?this.sketchCoords_=e.slice():this.mode_===`Polygon`?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new $u(new ld(this.sketchLineCoords_)));let r=this.geometryFunction_(this.sketchCoords_,void 0,t);this.sketchFeature_=new $u,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new uw(lw.DRAWSTART,this.sketchFeature_))}modifyDrawing_(e){let t=this.getMap(),n=this.sketchFeature_.getGeometry(),r=t.getView().getProjection(),i=Yi(this.geometryLayout_),a,o;for(;e.length<i;)e.push(0);this.mode_===`Point`?o=this.sketchCoords_:this.mode_===`Polygon`?(a=this.sketchCoords_[0],o=a[a.length-1],this.atFinish_(t.getPixelFromCoordinate(e))&&(e=this.finishCoordinate_.slice())):(a=this.sketchCoords_,o=a[a.length-1]),o[0]=e[0],o[1]=e[1],this.geometryFunction_(this.sketchCoords_,n,r),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(e),n.getType()===`Polygon`&&this.mode_!==`Polygon`?this.createOrUpdateCustomSketchLine_(n):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(e){let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r,i,a=this.mode_;return a===`LineString`||a===`Circle`?(this.finishCoordinate_=e.slice(),i=this.sketchCoords_,i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),this.geometryFunction_(i,t,n)):a===`Polygon`&&(i=this.sketchCoords_[0],i.length>=this.maxPoints_&&(this.freehand_?i.pop():r=!0),i.push(e.slice()),r&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,t,n)),this.createOrUpdateSketchPoint_(e.slice()),this.updateSketchFeatures_(),r?this.finishDrawing():this.sketchFeature_}removeLastPoints_(e){if(!this.sketchFeature_)return;let t=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;for(let i=0;i<e;++i){let e;if(r===`LineString`||r===`Circle`){if(e=this.sketchCoords_,e.splice(-2,1),e.length>=2){this.finishCoordinate_=e[e.length-2].slice();let t=this.finishCoordinate_.slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}this.geometryFunction_(e,t,n),t.getType()===`Polygon`&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(t)}else if(r===`Polygon`){e=this.sketchCoords_[0],e.splice(-2,1);let r=this.sketchLine_.getGeometry();if(e.length>=2){let t=e[e.length-2].slice();e[e.length-1]=t,this.createOrUpdateSketchPoint_(t)}r.setCoordinates(e),this.geometryFunction_(this.sketchCoords_,t,n)}if(e.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){let e=this.abortDrawing_();if(!e)return null;let t=this.sketchCoords_,n=e.getGeometry(),r=this.getMap().getView().getProjection();return this.mode_===`LineString`?(t.pop(),this.geometryFunction_(t,n,r)):this.mode_===`Polygon`&&(t[0].pop(),this.geometryFunction_(t,n,r),t=n.getCoordinates()),this.type_===`MultiPoint`?e.setGeometry(new dd([t])):this.type_===`MultiLineString`?e.setGeometry(new ud([t])):this.type_===`MultiPolygon`&&e.setGeometry(new fd([t])),this.dispatchEvent(new uw(lw.DRAWEND,e)),this.features_&&this.features_.push(e),this.source_&&this.source_.addFeature(e),e}abortDrawing_(){this.finishCoordinate_=null;let e=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),e}abortDrawing(){let e=this.abortDrawing_();e&&this.dispatchEvent(new uw(lw.DRAWABORT,e))}appendCoordinates(e){let t=this.mode_,n=!this.sketchFeature_;n&&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;n&&r.shift(),r.pop();for(let t=0;t<e.length;t++)this.addToDrawing_(e[t]);let i=e[e.length-1];this.sketchFeature_=this.addToDrawing_(i),this.modifyDrawing_(i)}extend(e){let t=e.getGeometry();this.sketchFeature_=e,this.sketchCoords_=t.getCoordinates();let n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new $u(new xa(n)),this.updateSketchFeatures_(),this.dispatchEvent(new uw(lw.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){let e=[];this.sketchFeature_&&e.push(this.sketchFeature_),this.sketchLine_&&e.push(this.sketchLine_),this.sketchPoint_&&e.push(this.sketchPoint_);let t=this.overlay_.getSource();t.clear(!0),t.addFeatures(e)}updateState_(){let e=this.getMap(),t=this.getActive();(!e||!t)&&this.abortDrawing(),this.overlay_.setMap(t?e:null)}};function fw(){let e=ru();return function(t,n){return e[t.getGeometry().getType()]}}function pw(e){switch(e){case`Point`:case`MultiPoint`:return`Point`;case`LineString`:case`MultiLineString`:return`LineString`;case`Polygon`:case`MultiPolygon`:return`Polygon`;case`Circle`:return`Circle`;default:throw Error(`Invalid type: `+e)}}var mw=0,hw=1,gw=[0,0,0,0],_w=[],vw={MODIFYSTART:`modifystart`,MODIFYEND:`modifyend`};function yw(e,t,n){let r;switch(t){case`LineString`:r=e;break;case`MultiLineString`:case`Polygon`:r=e[n[0]];break;case`MultiPolygon`:r=e[n[1]][n[0]];break;default:}return r}var bw=class extends et{constructor(e,t,n){super(e),this.features=t,this.mapBrowserEvent=n}},xw=class extends Qo{constructor(e){super(e),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=e.condition?e.condition:Zo,this.defaultDeleteCondition_=function(e){return Ro(e)&&Go(e)},this.deleteCondition_=e.deleteCondition?e.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Ho,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new Cv,this.pixelTolerance_=e.pixelTolerance===void 0?10:e.pixelTolerance,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new _y({source:new Ov({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Tw(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.traceSource_=e.traceSource||e.source||null,this.traceCondition_,this.setTrace(e.trace||!1),this.traceState_={active:!1},this.traceSegments_=null,this.hitDetection_=null;let t;if(e.features?t=e.features:e.source&&(this.source_=e.source,t=new dt(this.source_.getFeatures()),this.source_.addEventListener(Ev.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Ev.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!t)throw Error(`The modify interaction requires features, a source or a layer`);e.hitDetection&&(this.hitDetection_=e.hitDetection),this.features_=t,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(Ie.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(Ie.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=e.snapToPointer===void 0?!this.hitDetection_:e.snapToPointer}setTrace(e){let t;t=e?e===!0?Ho:e:Wo,this.traceCondition_=t}addFeature_(e){let t=e.getGeometry();if(t){let n=this.SEGMENT_WRITERS_[t.getType()];n&&n(e,t)}let n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_),e.addEventListener(M.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(e,t){if(!this.featuresBeingModified_){this.featuresBeingModified_=new dt;let n=this.featuresBeingModified_.getArray();for(let e=0,r=t.length;e<r;++e){let r=t[e].feature;r&&!n.includes(r)&&this.featuresBeingModified_.push(r)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new bw(vw.MODIFYSTART,this.featuresBeingModified_,e))}}removeFeature_(e){this.removeFeatureSegmentData_(e),this.vertexFeature_&&this.features_.getLength()===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),e.removeEventListener(M.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(e){let t=this.rBush_,n=[];t.forEach(function(t){e===t.feature&&n.push(t)});for(let e=n.length-1;e>=0;--e){let r=n[e];for(let e=this.dragSegments_.length-1;e>=0;--e)this.dragSegments_[e][0]===r&&this.dragSegments_.splice(e,1);t.remove(r)}}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_){let t=e.target;this.removeFeature_(t),this.addFeature_(t)}}handleFeatureRemove_(e){this.removeFeature_(e.element)}writePointGeometry_(e,t){let n=t.getCoordinates(),r={feature:e,geometry:t,segment:[n,n]};this.rBush_.insert(t.getExtent(),r)}writeMultiPointGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r],a={feature:e,geometry:t,depth:[r],index:r,segment:[i,i]};this.rBush_.insert(t.getExtent(),a)}}writeLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length-1;r<i;++r){let i=n.slice(r,r+2),a={feature:e,geometry:t,index:r,segment:i};this.rBush_.insert(qt(i),a)}}writeMultiLineStringGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(qt(a),o)}}}writePolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length-1;n<a;++n){let a=i.slice(n,n+2),o={feature:e,geometry:t,depth:[r],index:n,segment:a};this.rBush_.insert(qt(a),o)}}}writeMultiPolygonGeometry_(e,t){let n=t.getCoordinates();for(let r=0,i=n.length;r<i;++r){let i=n[r];for(let n=0,a=i.length;n<a;++n){let a=i[n];for(let i=0,o=a.length-1;i<o;++i){let o=a.slice(i,i+2),s={feature:e,geometry:t,depth:[n,r],index:i,segment:o};this.rBush_.insert(qt(o),s)}}}}writeCircleGeometry_(e,t){let n=t.getCenter(),r={feature:e,geometry:t,index:mw,segment:[n,n]},i={feature:e,geometry:t,index:hw,segment:[n,n]},a=[r,i];r.featureSegments=a,i.featureSegments=a,this.rBush_.insert(on(n),r);let o=t,s=_i();if(s&&this.getMap()){let e=this.getMap().getView().getProjection();o=o.clone().transform(s,e),o=Ua(o).transform(e,s)}this.rBush_.insert(o.getExtent(),i)}writeGeometryCollectionGeometry_(e,t){let n=t.getGeometriesArray();for(let t=0;t<n.length;++t){let r=n[t],i=this.SEGMENT_WRITERS_[r.getType()];i(e,r)}}createOrUpdateVertexFeature_(e,t,n,r){let i=this.vertexFeature_;return i?i.getGeometry().setCoordinates(e):(i=new $u(new xa(e)),this.vertexFeature_=i,this.overlay_.getSource().addFeature(i)),i.set(`features`,t),i.set(`geometries`,n),i.set(`existing`,r),i}handleEvent(e){if(!e.originalEvent)return!0;this.lastPointerEvent_=e;let t;return!e.map.getView().getInteracting()&&e.type==I.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(t=e.type!=I.SINGLECLICK||!this.ignoreNextSingleClick_?this.removePoint():!0),e.type==I.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(e)&&!t}findInsertVerticesAndUpdateDragSegments_(e){if(this.handlePointerAtPixel_(e),this.dragSegments_.length=0,this.featuresBeingModified_=null,!this.vertexFeature_)return;let t=this.getMap().getView().getProjection(),n=[],r=this.vertexFeature_.getGeometry().getCoordinates(),i=qt([r]),a=this.rBush_.getInExtent(i),o={};a.sort(Sw);for(let i=0,s=a.length;i<s;++i){let s=a[i],c=s.segment,l=F(s.geometry),u=s.depth;if(u&&(l+=`-`+u.join(`-`)),o[l]||(o[l]=[,,]),s.geometry.getType()===`Circle`&&s.index===hw){Pn(ww(e,s,t),r)&&!o[l][0]&&(this.dragSegments_.push([s,0]),o[l][0]=s);continue}if(Pn(c[0],r)&&!o[l][0]){this.dragSegments_.push([s,0]),o[l][0]=s;continue}if(Pn(c[1],r)&&!o[l][1]){if(o[l][0]&&o[l][0].index===0){let e=s.geometry.getCoordinates();switch(s.geometry.getType()){case`LineString`:case`MultiLineString`:continue;case`MultiPolygon`:e=e[u[1]];case`Polygon`:if(s.index!==e[u[0]].length-2)continue;break;default:}}this.dragSegments_.push([s,1]),o[l][1]=s;continue}F(c)in this.vertexSegments_&&!o[l][0]&&!o[l][1]&&n.push(s)}return n}deactivateTrace_(){this.traceState_={active:!1}}updateTrace_(e){let t=this.traceState_;if(!t.active||t.targetIndex===-1&&Rn(e.map.getPixelFromCoordinate(t.startCoord),e.pixel)<this.pixelTolerance_)return;let n=tw(e.coordinate,t,e.map,this.pixelTolerance_);if(t.targetIndex===-1&&Math.sqrt(n.closestTargetDistance)/e.map.getView().getResolution()>this.pixelTolerance_)return;if(t.targetIndex!==n.index){if(t.targetIndex!==-1){let e=t.targets[t.targetIndex];this.removeTracedCoordinates_(e.startIndex,e.endIndex)}else for(let e of this.traceSegments_){let t=e[0],n=t.geometry,r=e[1],i=n.getCoordinates();yw(i,n.getType(),t.depth).splice(t.index+r,1),n.setCoordinates(i),r===0&&--t.index}let e=t.targets[n.index];this.addTracedCoordinates_(e,e.startIndex,n.endIndex)}else{let e=t.targets[t.targetIndex];this.addOrRemoveTracedCoordinates_(e,n.endIndex)}t.targetIndex=n.index;let r=t.targets[t.targetIndex];r.endIndex=n.endIndex}getTraceCandidates_(e){let t=this.getMap(),n=this.pixelTolerance_,r=qt([t.getCoordinateFromPixel([e.pixel[0]-n,e.pixel[1]+n]),t.getCoordinateFromPixel([e.pixel[0]+n,e.pixel[1]-n])]);return this.traceSource_.getFeaturesInExtent(r)}toggleTraceState_(e){if(!this.traceSource_||!this.traceCondition_(e))return;if(this.traceState_.active){this.deactivateTrace_(),this.traceSegments_=null;return}let t=this.getTraceCandidates_(e);if(t.length===0)return;let n=nw(e.coordinate,t);n.length&&(this.traceState_={active:!0,startCoord:e.coordinate.slice(),targets:n,targetIndex:-1})}addOrRemoveTracedCoordinates_(e,t){let n=e.startIndex<=e.endIndex;n===e.startIndex<=t?n&&t>e.endIndex||!n&&t<e.endIndex?this.addTracedCoordinates_(e,e.endIndex,t):(n&&t<e.endIndex||!n&&t>e.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 n=0;if(e<t){let r=Math.ceil(e),i=Math.floor(t);i===t&&--i,n=i-r+1}else{let r=Math.floor(e),i=Math.ceil(t);i===t&&(i+=1),n=r-i+1}if(n>0)for(let e of this.traceSegments_){let t=e[0],r=t.geometry,i=e[1],a=e[0].index+1;i===1&&(a-=n);let o=r.getCoordinates();yw(o,r.getType(),t.depth).splice(a,n),r.setCoordinates(o),i===1&&(t.index-=n)}}addTracedCoordinates_(e,t,n){if(t===n)return;let r=[];if(t<n){let i=Math.ceil(t),a=Math.floor(n);a===n&&--a;for(let t=i;t<=a;++t)r.push(QC(e.coordinates,t))}else{let i=Math.floor(t),a=Math.ceil(n);a===n&&(a+=1);for(let t=i;t>=a;--t)r.push(QC(e.coordinates,t))}if(r.length)for(let e of this.traceSegments_){let t=e[0],n=t.geometry,i=e[1],a=t.index+1;i===0&&r.reverse();let o=n.getCoordinates();yw(o,n.getType(),t.depth).splice(a,0,...r),n.setCoordinates(o),i===1&&(t.index+=r.length)}}updateGeometry_(e,t){let n=t[0],r=n.depth,i,a=n.segment,o=n.geometry,s=t[1];for(;e.length<o.getStride();)e.push(a[s][e.length]);switch(o.getType()){case`Point`:i=e,a[0]=e,a[1]=e;break;case`MultiPoint`:i=o.getCoordinates(),i[n.index]=e,a[0]=e,a[1]=e;break;case`LineString`:i=o.getCoordinates(),i[n.index+s]=e,a[s]=e;break;case`MultiLineString`:i=o.getCoordinates(),i[r[0]][n.index+s]=e,a[s]=e;break;case`Polygon`:i=o.getCoordinates(),i[r[0]][n.index+s]=e,a[s]=e;break;case`MultiPolygon`:i=o.getCoordinates(),i[r[1]][r[0]][n.index+s]=e,a[s]=e;break;case`Circle`:let t=o;if(a[0]=e,a[1]=e,n.index===mw)this.changingFeature_=!0,t.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;let n=this.getMap().getView().getProjection(),r=Rn(yi(t.getCenter(),n),yi(e,n)),i=_i();if(i){let e=t.clone().transform(i,n);e.setRadius(r),r=e.transform(n,i).getRadius()}t.setRadius(r),this.changingFeature_=!1}break;default:}i&&this.setGeometryCoordinates_(o,i)}handleDragEvent(e){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=[e.coordinate[0]+this.delta_[0],e.coordinate[1]+this.delta_[1]],n=[],r=[],i=this.traceState_.active&&!this.traceSegments_?this.traceState_.startCoord:null;if(i){this.traceSegments_=[];for(let t of this.dragSegments_){let n=t[0];Rn(Nn(i,n.segment),i)/e.map.getView().getResolution()<1&&this.traceSegments_.push(t)}}for(let e=0,i=this.dragSegments_.length;e<i;++e){let i=this.dragSegments_[e],a=i[0],o=a.feature;n.includes(o)||n.push(o);let s=a.geometry;r.includes(s)||r.push(s),this.updateGeometry_(t,i)}this.updateTrace_(e),this.createOrUpdateVertexFeature_(t,n,r,!0)}handleDownEvent(e){if(!this.condition_(e))return!1;let t=e.coordinate,n=this.findInsertVerticesAndUpdateDragSegments_(t);if(n?.length&&this.insertVertexCondition_(e)&&(this.willModifyFeatures_(e,n),this.vertexFeature_)){let e=this.vertexFeature_.getGeometry().getCoordinates();for(let t=n.length-1;t>=0;--t)this.insertVertex_(n[t],e);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(e){for(let t=this.dragSegments_.length-1;t>=0;--t){let n=this.dragSegments_[t][0],r=n.geometry;if(r.getType()===`Circle`){let t=r,i=t.getCenter(),a=n.featureSegments[0],o=n.featureSegments[1];a.segment[0]=i,a.segment[1]=i,o.segment[0]=i,o.segment[1]=i,this.rBush_.update(on(i),a);let s=t,c=_i();if(c){let t=e.map.getView().getProjection();s=s.clone().transform(c,t),s=Ua(s).transform(t,c)}this.rBush_.update(s.getExtent(),o)}else this.rBush_.update(qt(n.segment),n)}return this.featuresBeingModified_&&=(this.toggleTraceState_(e),this.dispatchEvent(new bw(vw.MODIFYEND,this.featuresBeingModified_,e)),null),!1}handlePointerMove_(e){this.lastCoordinate_=e.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(e){let t=this.getMap(),n=t.getPixelFromCoordinate(e),r=t.getView().getProjection(),i=function(t,n){return Cw(e,t,r)-Cw(e,n,r)},a,o;if(this.hitDetection_){let e=typeof this.hitDetection_==`object`?e=>e===this.hitDetection_:void 0;t.forEachFeatureAtPixel(n,(e,t,n)=>{n&&n.getType()===`Point`&&(n=new xa(vi(n.getCoordinates(),r)));let i=n||e.getGeometry();if(i&&i.getType()===`Point`&&e instanceof $u&&this.features_.getArray().includes(e)){o=i;let t=e.getGeometry().getFlatCoordinates().slice(0,2);a=[{feature:e,geometry:o,segment:[t,t]}]}return!0},{layerFilter:e})}if(!a){let n=bi(Yt(xi(on(e,gw),r),t.getView().getResolution()*this.pixelTolerance_,gw),r);a=this.rBush_.getInExtent(n)}if(a&&a.length>0){let s=a.sort(i)[0],c=s.segment,l=ww(e,s,r),u=t.getPixelFromCoordinate(l),d=Rn(n,u);if(o||d<=this.pixelTolerance_){let n={};if(n[F(c)]=!0,this.snapToPointer_||(this.delta_[0]=l[0]-e[0],this.delta_[1]=l[1]-e[1]),s.geometry.getType()===`Circle`&&s.index===hw)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);else{let e=t.getPixelFromCoordinate(c[0]),r=t.getPixelFromCoordinate(c[1]),i=Ln(u,e),o=Ln(u,r);if(d=Math.sqrt(Math.min(i,o)),this.snappedToVertex_=d<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null);return}this.snappedToVertex_&&(l=i>o?c[1]:c[0]),this.createOrUpdateVertexFeature_(l,[s.feature],[s.geometry],this.snappedToVertex_);let f={};f[F(s.geometry)]=!0;for(let e=1,t=a.length;e<t;++e){let t=a[e].segment;if(Pn(c[0],t[0])&&Pn(c[1],t[1])||Pn(c[0],t[1])&&Pn(c[1],t[0])){let r=F(a[e].geometry);r in f||(f[r]=!0,n[F(t)]=!0)}else break}}this.vertexSegments_=n;return}}this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null)}insertVertex_(e,t){let n=e.segment,r=e.feature,i=e.geometry,a=e.depth,o=e.index,s;for(;t.length<i.getStride();)t.push(0);switch(i.getType()){case`MultiLineString`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`Polygon`:s=i.getCoordinates(),s[a[0]].splice(o+1,0,t);break;case`MultiPolygon`:s=i.getCoordinates(),s[a[1]][a[0]].splice(o+1,0,t);break;case`LineString`:s=i.getCoordinates(),s.splice(o+1,0,t);break;default:return!1}this.setGeometryCoordinates_(i,s);let c=this.rBush_;c.remove(e),this.updateSegmentIndices_(i,o,a,1);let l={segment:[n[0],t],feature:r,geometry:i,depth:a,index:o};c.insert(qt(l.segment),l),this.dragSegments_.push([l,1]);let u={segment:[t,n[1]],feature:r,geometry:i,depth:a,index:o+1};return c.insert(qt(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(e){return e&&this.findInsertVerticesAndUpdateDragSegments_(e),this.vertexFeature_?.getGeometry().getCoordinates()}getPoint(){let e=this.vertexFeature_?.getGeometry().getCoordinates();return e?vi(e,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(qt([e])).some(({segment:t})=>Pn(t[0],e)||Pn(t[1],e))}removePoint(e){if(e&&(e=yi(e,this.getMap().getView().getProjection()),this.updatePointer_(e)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=I.POINTERDRAG){let e=this.lastPointerEvent_;this.willModifyFeatures_(e,this.dragSegments_.map(([e])=>e));let t=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new bw(vw.MODIFYEND,this.featuresBeingModified_,e)),this.featuresBeingModified_=null,t}return!1}removeVertex_(){let e=this.dragSegments_,t={},n=!1,r,i,a,o,s,c,l,u,d,f,p;for(s=e.length-1;s>=0;--s)a=e[s],f=a[0],p=F(f.feature),f.depth&&(p+=`-`+f.depth.join(`-`)),p in t||(t[p]={}),a[1]===0?(t[p].right=f,t[p].index=f.index):a[1]==1&&(t[p].left=f,t[p].index=f.index+1);for(p in t){switch(d=t[p].right,l=t[p].left,c=t[p].index,u=c-1,f=l===void 0?d:l,u<0&&(u=0),o=f.geometry,i=o.getCoordinates(),r=i,n=!1,o.getType()){case`MultiLineString`:i[f.depth[0]].length>2&&(i[f.depth[0]].splice(c,1),n=!0);break;case`LineString`:i.length>2&&(i.splice(c,1),n=!0);break;case`MultiPolygon`:r=r[f.depth[1]];case`Polygon`:r=r[f.depth[0]],r.length>4&&(c==r.length-1&&(c=0),r.splice(c,1),n=!0,c===0&&(r.pop(),r.push(r[0]),u=r.length-1));break;default:}if(n){this.setGeometryCoordinates_(o,i);let t=[];if(l!==void 0&&(this.rBush_.remove(l),t.push(l.segment[0])),d!==void 0&&(this.rBush_.remove(d),t.push(d.segment[1])),l!==void 0&&d!==void 0){let e={depth:f.depth,feature:f.feature,geometry:f.geometry,index:u,segment:t};this.rBush_.insert(qt(e.segment),e)}this.updateSegmentIndices_(o,c,f.depth,-1),this.vertexFeature_&&=(this.overlay_.getSource().removeFeature(this.vertexFeature_),null),e.length=0}}return n}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get(`geometries`).every(e=>e.getType()===`Circle`||e.getType().endsWith(`Point`)))return!1;let e=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(qt([e])).some(({segment:t})=>!(Pn(t[0],e)||Pn(t[1],e)))}insertPoint(e){let t=e?yi(e,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return t?this.findInsertVerticesAndUpdateDragSegments_(t).reduce((e,n)=>e||this.insertVertex_(n,t),!1):!1}setGeometryCoordinates_(e,t){this.changingFeature_=!0,e.setCoordinates(t),this.changingFeature_=!1}updateSegmentIndices_(e,t,n,r){this.rBush_.forEachInExtent(e.getExtent(),function(i){i.geometry===e&&(n===void 0||i.depth===void 0||Ge(i.depth,n))&&i.index>t&&(i.index+=r)})}};function Sw(e,t){return e.index-t.index}function Cw(e,t,n){let r=t.geometry;if(r.getType()===`Circle`){let i=r;if(t.index===hw){let t=_i();t&&(i=i.clone().transform(t,n));let r=Ln(i.getCenter(),yi(e,n)),a=Math.sqrt(r)-i.getRadius();return a*a}}let i=yi(e,n);return _w[0]=yi(t.segment[0],n),_w[1]=yi(t.segment[1],n),zn(i,_w)}function ww(e,t,n){let r=t.geometry;if(r.getType()===`Circle`&&t.index===hw){let t=r,i=_i();return i&&(t=t.clone().transform(i,n)),vi(t.getClosestPoint(yi(e,n)),n)}let i=yi(e,n);return _w[0]=yi(t.segment[0],n),_w[1]=yi(t.segment[1],n),vi(Nn(i,_w),n)}function Tw(){let e=ru();return function(t,n){return e.Point}}var Ew=new Yl({color:`rgba(255,255,255,0.4)`}),Dw=new Ql({color:`#3399CC`,width:1.25}),Ow=[new $l({image:new Jl({fill:Ew,stroke:Dw,radius:5}),fill:Ew,stroke:Dw})],kw=new $l({image:new Zl({opacity:1,src:`data:image/svg+xml;utf8,
112
95
  <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="%23dc4b6f" viewBox="0 0 24 24">
113
96
  <path fill-rule="evenodd" d="M11.906 1.994a8.002 8.002 0 0 1 8.09 8.421 7.996 7.996 0 0 1-1.297 3.957.996.996 0 0 1-.133.204l-.108.129c-.178.243-.37.477-.573.699l-5.112 6.224a1 1 0 0 1-1.545 0L5.982 15.26l-.002-.002a18.146 18.146 0 0 1-.309-.38l-.133-.163a.999.999 0 0 1-.13-.202 7.995 7.995 0 0 1 6.498-12.518ZM15 9.997a3 3 0 1 1-5.999 0 3 3 0 0 1 5.999 0Z" clip-rule="evenodd" />
114
97
  </svg>
115
- `,jC=new rt({image:new Ar({opacity:1,src:"data:image/svg+xml;utf8,"+zC,anchor:[.5,1]})});class UC extends En{constructor(t){super();ae(this,_i);ae(this,Pr,null);ae(this,ni,null);ae(this,yi,null);ae(this,Di);ae(this,jn,null);ae(this,Mr,new Set);Gt(this,"drawInteraction");Gt(this,"modifyInteraction");ae(this,Ji,null);ae(this,$i,!1);ae(this,en,null);pe(this,Pr,t.yioMap)}getEditLayer(){return M(this,ni)}clearModifiedFeatures(){const t=M(this,ni).getSource(),i=t.getFeatures().filter(r=>r.get("id")!==void 0);t.removeFeatures(i),M(this,Mr).clear()}clearCreatedFeatures(){const t=M(this,ni).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 M(this,Pr)._getContentLayerPromise();if(!LA(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 cC(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}})}pe(this,ni,LA(s,"edits")[0]),pe(this,yi,M(this,Pr)._getContentLayer().getLayers().getArray().filter(a=>a instanceof Sr).pop()),M(this,Ji)||(pe(this,Ji,M(this,yi).getStyle()),M(this,yi).setStyle((a,l)=>{if(!M(this,Mr).has(a.get("id")))return M(this,Ji).call(this,a,l)})),M(this,en)||(pe(this,en,a=>{if(!this.modifyEnabled)return i.getTargetElement().style.cursor="",pe(this,$i,!1),null;pe(this,$i,!!le(this,_i,ud).call(this,a.pixel)),M(this,$i)?i.getTargetElement().classList.add("cursor-move"):i.getTargetElement().classList.remove("cursor-move")}),i.on("pointermove",M(this,en))),le(this,_i,lm).call(this)}else M(this,Ji)&&(M(this,yi).setStyle(M(this,Ji)),pe(this,Ji,null)),pe(this,Di,null),M(this,en)&&(i.un("pointermove",M(this,en)),pe(this,en,null)),le(this,_i,cm).call(this);super.setActive(t)}}get createEnabled(){return!!M(this,Di)}async setCreateEnabled(t){pe(this,Di,t||void 0),t||(this.clearCreatedFeatures(),M(this,yi).getSource().refresh()),await this.setActive(!!t||!!M(this,jn)),this.drawInteraction&&this.drawInteraction.setMap(t?this.getMap():null),this.modifyInteraction&&this.modifyInteraction.setMap(t||M(this,jn)?this.getMap():null)}get modifyEnabled(){return!!M(this,jn)||!!M(this,Di)}async setModifyEnabled(t){t&&t.length===0&&(t=null),t||(this.clearModifiedFeatures(),M(this,yi).getSource().refresh()),pe(this,jn,t),await this.setActive(!!t||!!M(this,Di)),this.modifyInteraction&&this.modifyInteraction.setMap(t||M(this,Di)?this.getMap():null)}handleEvent(t){let i=!0;if(t.type==="pointerdown"){const r=le(this,_i,ud).call(this,t.pixel);if(r&&r instanceof ht&&this.modifyEnabled){const s=r.get("id");M(this,Mr).has(s)||M(this,Mr).add(s),M(this,yi).changed();const o=bg(r);M(this,ni).getSource().addFeature(o)}}return i&&this.modifyEnabled&&(i=this.modifyInteraction.handleEvent(t)),i&&this.createEnabled&&(i=this.drawInteraction.handleEvent(t)),i&&t.type==="click"&&le(this,_i,am).call(this,t),i}}Pr=new WeakMap,ni=new WeakMap,yi=new WeakMap,Di=new WeakMap,jn=new WeakMap,Mr=new WeakMap,_i=new WeakSet,am=function(t){M(this,Pr)._handleClick(t.originalEvent)},Ji=new WeakMap,$i=new WeakMap,lm=function(){this.drawInteraction=new kC({source:M(this,ni).getSource(),condition:t=>Ra(t)?this.createEnabled&&!M(this,$i):!1,type:"Point",style:()=>M(this,$i)?null:$A}),this.getMap().addInteraction(this.drawInteraction),this.drawInteraction.on("drawend",t=>{t.feature.set("mvt:layer",M(this,Di))}),this.modifyInteraction=new GC({source:M(this,ni).getSource(),condition:t=>nh(t)?this.modifyEnabled:!1,style:()=>M(this,$i)?null:$A}),this.getMap().addInteraction(this.modifyInteraction)},cm=function(){this.drawInteraction&&(this.drawInteraction.setMap(null),this.drawInteraction=null),this.modifyInteraction&&(this.modifyInteraction.setMap(null),this.modifyInteraction=null)},en=new WeakMap,ud=function(t){const r=this.getMap().getFeaturesAtPixel(t,{layerFilter:s=>s===M(this,ni)||s==M(this,yi)}).filter(s=>{var o;return s.getGeometry().getType()==="Point"&&(M(this,ni).getSource().hasFeature(s)||((o=M(this,jn))==null?void 0:o.includes(s.get("id"))))});return r.length?r[0]:null};class VC extends En{constructor(t){super();ae(this,Lr);ae(this,Ms,null);ae(this,Fr,new Dn({source:new Mn}));pe(this,Ms,t.yioMap),this.setActive(!1)}setMap(t){const i=this.getMap();i&&i.removeLayer(M(this,Fr)),t&&(t.addLayer(M(this,Fr)),super.setMap(t))}setActive(t){t||M(this,Fr).getSource().clear(),super.setActive(t)}setPin(t){le(this,Lr,dd).call(this,t)}handleEvent(t){return t.type==="click"&&le(this,Lr,hm).call(this,t),!0}}Ms=new WeakMap,Fr=new WeakMap,Lr=new WeakSet,dd=function(t){const i=M(this,Fr).getSource();i.clear();const r=new Wt(new It(t));r.setStyle(jC),i.addFeature(r),M(this,Ms).dispatchEvent(new CustomEvent("pin",{composed:!0,bubbles:!0,detail:{coordinate:$s(t)}}))},hm=function(t){const i=this.getMap(),r=M(this,Ms)._getContentLayer();i.getFeaturesAtPixel(t.pixel,{layerFilter:o=>r.getLayers().getArray().includes(o)}).length===0&&le(this,Lr,dd).call(this,t.coordinate)};const WC="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",Kl=document.createElement("img");Kl.src=WC,Kl.alt="yio.at",Kl.style.height="1em";const HC=new Of({label:Kl,render:function(n){const e=this.element;if(!e||!n.frameState)return;const t=this.collectSourceAttributions_(n.frameState)??[],i=[];i.push(`
98
+ `,anchor:[.5,1]})}),Aw=class extends No{#e=null;#t=null;#n=null;getEditLayer(){return this.#t}clearModifiedFeatures(){let e=this.#t.getSource(),t=e.getFeatures().filter(e=>e.get(`id`)!==void 0);e.removeFeatures(t),this.#a.clear()}clearCreatedFeatures(){let e=this.#t.getSource(),t=e.getFeatures().filter(e=>e.get(`id`)===void 0);e.removeFeatures(t)}#r;#i=null;#a=new Set;constructor(e){super(),this.#e=e.yioMap}drawInteraction;modifyInteraction;#o(e){this.#e._handleClick(e.originalEvent)}#s=null;#c=!1;#l(){this.drawInteraction=new dw({source:this.#t.getSource(),condition:e=>Ko(e)?this.createEnabled&&!this.#c:!1,type:`Point`,style:()=>this.#c?null:Ow}),this.getMap().addInteraction(this.drawInteraction),this.drawInteraction.on(`drawend`,e=>{e.feature.set(`mvt:layer`,this.#r)}),this.modifyInteraction=new xw({source:this.#t.getSource(),condition:e=>Zo(e)?this.modifyEnabled:!1,style:()=>this.#c?null:Ow}),this.getMap().addInteraction(this.modifyInteraction)}#u(){this.drawInteraction&&=(this.drawInteraction.setMap(null),null),this.modifyInteraction&&=(this.modifyInteraction.setMap(null),null)}async setActive(e){if(e===this.getActive())return;let t=this.getMap();if(t){if(e){let e=await this.#e._getContentLayerPromise();if(!_C(e,`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.`);let t=e.get(`mapbox-style`);t.sources.edits={type:`geojson`,data:{type:`FeatureCollection`,features:[]}};for(let n of t.layers)t.sources[n.source]?.type!==`vector`&&(n.type!==`circle`||n.type!==`symbol`)||await pC(e,{id:`edits-`+n.id,source:`edits`,"source-layer":n[`source-layer`],type:`circle`,paint:{"circle-radius":5,"circle-color":`#ff0000`,"circle-stroke-width":1}})}this.#t=_C(e,`edits`)[0],this.#n=this.#e._getContentLayer().getLayers().getArray().filter(e=>e instanceof Gx).pop(),this.#s||(this.#s=this.#n.getStyle(),this.#n.setStyle((e,t)=>{if(!this.#a.has(e.get(`id`)))return this.#s(e,t)})),this.#d||(this.#d=e=>{if(!this.modifyEnabled)return t.getTargetElement().style.cursor=``,this.#c=!1,null;this.#c=!!this.#f(e.pixel),this.#c?t.getTargetElement().classList.add(`cursor-move`):t.getTargetElement().classList.remove(`cursor-move`)},t.on(`pointermove`,this.#d)),this.#l()}else this.#s&&=(this.#n.setStyle(this.#s),null),this.#r=null,this.#d&&=(t.un(`pointermove`,this.#d),null),this.#u();super.setActive(e)}}get createEnabled(){return!!this.#r}async setCreateEnabled(e){this.#r=e||void 0,e||(this.clearCreatedFeatures(),this.#n.getSource().refresh()),await this.setActive(!!e||!!this.#i),this.drawInteraction&&this.drawInteraction.setMap(e?this.getMap():null),this.modifyInteraction&&this.modifyInteraction.setMap(e||this.#i?this.getMap():null)}get modifyEnabled(){return!!this.#i||!!this.#r}async setModifyEnabled(e){e&&e.length===0&&(e=null),e||(this.clearModifiedFeatures(),this.#n.getSource().refresh()),this.#i=e,await this.setActive(!!e||!!this.#r),this.modifyInteraction&&this.modifyInteraction.setMap(e||this.#r?this.getMap():null)}#d=null;#f(e){let t=this.getMap().getFeaturesAtPixel(e,{layerFilter:e=>e===this.#t||e==this.#n}).filter(e=>e.getGeometry().getType()===`Point`&&(this.#t.getSource().hasFeature(e)||this.#i?.includes(e.get(`id`))));return t.length?t[0]:null}handleEvent(e){let t=!0;if(e.type===`pointerdown`){let t=this.#f(e.pixel);if(t&&t instanceof md&&this.modifyEnabled){let e=t.get(`id`);this.#a.has(e)||this.#a.add(e),this.#n.changed();let n=gd(t);this.#t.getSource().addFeature(n)}}return t&&this.modifyEnabled&&(t=this.modifyInteraction.handleEvent(e)),t&&this.createEnabled&&(t=this.drawInteraction.handleEvent(e)),t&&e.type===`click`&&this.#o(e),t}},jw=class extends No{#e=null;#t=new _y({source:new Ov});constructor(e){super(),this.#e=e.yioMap,this.setActive(!1)}setMap(e){let t=this.getMap();t&&t.removeLayer(this.#t),e&&(e.addLayer(this.#t),super.setMap(e))}#n(e){let t=this.#t.getSource();t.clear();let n=new $u(new xa(e));n.setStyle(kw),t.addFeature(n),this.#e.dispatchEvent(new CustomEvent(`pin`,{composed:!0,bubbles:!0,detail:{coordinate:li(e)}}))}#r(e){let t=this.getMap(),n=this.#e._getContentLayer();t.getFeaturesAtPixel(e.pixel,{layerFilter:e=>n.getLayers().getArray().includes(e)}).length===0&&this.#n(e.coordinate)}setActive(e){e||this.#t.getSource().clear(),super.setActive(e)}setPin(e){this.#n(e)}handleEvent(e){return e.type===`click`&&this.#r(e),!0}},Mw=`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`,Nw={name:`yio-map`,description:`Web component for interactive maps using LitElement and OpenLayers`,license:`MIT`,author:`yio-map`,repository:{type:`git`,url:`https://github.com/yiogmbh/yio-map`},version:`0.14.1`,type:`module`,files:[`dist`],exports:{".":{import:`./dist/yio-map.js`,types:`./dist/index.d.ts`}},scripts:{start:`vite`,build:`vite build && vite -c vite.config-umd.js build && tsc src/index.js --outDir dist --skipLibCheck --allowJS --declaration --declarationMap --emitDeclarationOnly`,prepublish:`npm run build`,prepublishOnly:`npm run build`,lint:`eslint --ext .js,.html . && prettier "**/*.(js|html)" --check --ignore-path .gitignore`,format:`eslint --ext .js,.html . --fix && prettier "**/*.(js|html)" --write --ignore-path .gitignore`,prepare:`husky`,pretest:`tsc --noEmit && npx playwright install chromium-headless-shell`,test:`vitest run --silent`,"test:watch":`npm run pretest && vitest watch`,storybook:`storybook dev -p 6006`,"storybook:build":`storybook build`},dependencies:{lit:`^3.3.2`},peerDependencies:{ol:`^10.7.0`,"ol-mapbox-style":`^13.2.0`},devDependencies:{"@chromatic-com/storybook":`^5.1.1`,"@storybook/addon-docs":`10.3.5`,"@storybook/web-components":`^10.3.5`,"@storybook/web-components-vite":`^10.3.5`,"@types/node":`^25.0.10`,"@vitest/browser":`^4.1.4`,"@vitest/browser-playwright":`^4.1.4`,eslint:`^9.39.2`,"eslint-config-flat-gitignore":`^2.1.0`,"eslint-config-prettier":`^10.1.8`,"eslint-plugin-html":`^8.1.4`,"eslint-plugin-storybook":`^10.3.5`,husky:`^9.1.7`,"lint-staged":`^15.5.2`,playwright:`^1.58.0`,prettier:`^3.8.1`,"rollup-plugin-peer-deps-external":`^2.2.4`,storybook:`10.3.5`,typescript:`^5.9.3`,vite:`8.0.5`,vitest:`^4.1.4`},"lint-staged":{"*.js":[`eslint --fix`,`prettier --write`]}},Pw=document.createElement(`img`);Pw.src=Mw,Pw.alt=`yio.at`,Pw.style.height=`1em`;var Fw=new Do({label:Pw,render:function(e){let t=this.element;if(!t||!e.frameState)return;let n=this.collectSourceAttributions_(e.frameState)??[],r=[];r.push(`
116
99
  <a href="https://yio.at" target="_blank" rel="noopener">
117
100
  <b>yio gmbh</b>
118
- </a>
119
- `);for(const o of t)i.push(o);const r=i.map((o,a)=>a===0?`<li>${o}</li>`:`<li><span style="margin: 0 4px 0 2px;">|</span>${o}</li>`).join("");let s=e.querySelector("ul");s||(s=document.createElement("ul"),e.appendChild(s)),s.innerHTML=r}}),XC=".address-search{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px}.search-container{position:relative;width:100%;flex-direction:column;display:flex}.search-input-wrapper{display:flex;align-items:center;background:#fff;border:1px solid #ccc;border-radius:4px;padding:0 10px}.search-icon{width:16px;height:16px;margin-right:8px;fill:#666;flex-shrink:0}.search-input{flex:1;border:none;outline:none;padding:10px 0;font-size:14px;background:transparent}.search-input::placeholder{color:#999}.loading-indicator{width:16px;height:16px;border:2px solid #e0e0e0;border-top-color:#666;border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}@keyframes spin{to{transform:rotate(360deg)}}.results-dropdown{display:none;margin-top:4px;background:#fff;border:1px solid #ccc;border-radius:4px}.search-container:focus-within .results-dropdown{display:block}.results-list{list-style:none;margin:0;padding:0;overflow-y:auto;max-height:300px}@container (width >= 10px){.results-list{max-height:70cqh}}.result-item{display:flex;align-items:stretch;padding:10px 12px;cursor:pointer;border-bottom:1px solid #eee;transition:background-color .15s}.result-item:last-child{border-bottom:none}.result-item:hover{background-color:#f5f5f5}.result-icon{width:20px;height:20px;margin-right:10px;flex-shrink:0;fill:#666}.result-icon.special{fill:#df486e}.result-content{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center}.result-title{font-weight:500;color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.result-subtitle{font-size:12px;color:#666;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.result-distance{font-size:12px;color:#999;margin-left:8px;flex-shrink:0;white-space:nowrap}.results-footer{padding:8px 12px;border-top:1px solid #eee;background:#fafafa;font-size:12px;color:#666}.prefer-close-label{display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}.prefer-close-label input{margin-right:3px;margin-left:0}.no-results{padding:16px 12px;text-align:center;color:#666}.no-results.error{color:#c62828}.result-count-input{width:28px;padding:1px 2px;border:1px solid #ccc;border-radius:3px;font-size:12px;text-align:center;-moz-appearance:textfield}.result-count-input::-webkit-inner-spin-button,.result-count-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}",em="https://srv.doris.at/solr/searchservice/search/all2",tm=250;class cd extends Ur{constructor(){super();ae(this,de);ae(this,Yo,null);ae(this,Fs,null);this.placeholder="Search Address...",this.resultCount=5,this.sortByDistance=!1,this.minSearchLength=3,this.mapCenter=null,this._query="",this._results=[],this._loading=!1,this._showResults=!1,this._error=null,this._totalResults=0}render(){return Bt`
120
- <div class="address-search">
121
- <div class="search-container" tabindex="1">
122
- <div class="search-input-wrapper">
123
- ${le(this,de,_m).call(this)}
124
- <input
125
- type="text"
126
- class="search-input"
127
- .placeholder=${this.placeholder}
128
- .value=${this._query}
129
- @input=${le(this,de,um)}
130
- />
131
- ${this._loading?Bt`<div class="loading-indicator"></div>`:null}
132
- </div>
133
- ${le(this,de,vm).call(this)}
134
- </div>
135
- </div>
136
- `}}Yo=new WeakMap,Fs=new WeakMap,de=new WeakSet,fd=function(t,i){clearTimeout(M(this,Yo)),pe(this,Yo,setTimeout(t,i))},um=function(t){this._query=t.target.value,le(this,de,fd).call(this,()=>le(this,de,Ql).call(this),tm)},Ql=async function(){var t;if(this._query.length<this.minSearchLength){this._results=[],this._showResults=!1;return}(t=M(this,Fs))==null||t.abort(),pe(this,Fs,new AbortController),this._loading=!0,this._showResults=!0,this._error=null;try{this._results=await le(this,de,dm).call(this,this._query)}catch(i){i.name!=="AbortError"&&(console.error("Search error:",i),this._results=[],this._error="Search failed. Please try again.")}finally{this._loading=!1}},dm=async function(t){var a;const i=new URLSearchParams({q:t,wt:"json2",rows:String(this.resultCount)});let r=`${em}/?${i}`;if(this.sortByDistance&&this.mapCenter){const[l,c]=this.mapCenter;i.set("pt",`${c},${l}`),r=`${em}/geo/?${i}`}const s=await fetch(r,{signal:M(this,Fs).signal});if(!s.ok)throw new Error(`HTTP ${s.status}`);const o=await s.json();return this._totalResults=((a=o==null?void 0:o.response)==null?void 0:a.numFound)||0,le(this,de,fm).call(this,o)},fm=function(t){var r;return(((r=t==null?void 0:t.response)==null?void 0:r.docs)||[]).map(s=>{s.type;const o=le(this,de,gm).call(this,s);return{type:s.type==="GeonamAT"?"special":"address",title:s.textsuggest,subtitle:s.subtext,distance:s._dist_?le(this,de,pm).call(this,s._dist_):null,coordinates:o,raw:s}})},gm=function(t){if(t.x&&t.y)return[parseFloat(t.x),parseFloat(t.y)];if(Array.isArray(t.geo)){const i=t.geo[0].match(/POINT\s*\(\s*([\d.]+)\s+([\d.]+)\s*\)/i);if(i)return[parseFloat(i[1]),parseFloat(i[2])]}if(t.geo instanceof String){const i=t.geo.match(/POINT\s*\(\s*([\d.]+)\s+([\d.]+)\s*\)/i);if(i)return[parseFloat(i[1]),parseFloat(i[2])]}return null},pm=function(t){return t<1e3?`${Math.round(t)} m`:`${(t/1e3).toFixed(1)} km`},Am=function(t){var i;t.coordinates&&((i=document.activeElement)==null||i.blur(),this._query=t.title,this.dispatchEvent(new CustomEvent("select",{detail:{coordinates:t.coordinates,result:t},bubbles:!0,composed:!0})))},mm=function(t){this.sortByDistance=t.target.checked,this._query.length>=this.minSearchLength&&le(this,de,Ql).call(this)},ym=function(t){const i=parseInt(t.target.value,10);!i||i<1||(this.resultCount=Math.min(i,100),le(this,de,fd).call(this,()=>{this._query.length>=this.minSearchLength&&le(this,de,Ql).call(this)},tm))},_m=function(){return Bt`
101
+ </a> v${Nw.version}
102
+ `);for(let e of n)r.push(e);let i=r.map((e,t)=>t===0?`<li>${e}</li>`:`<li><span style="margin: 0 4px 0 2px;">|</span>${e}</li>`).join(``),a=t.querySelector(`ul`);a||(a=document.createElement(`ul`),t.appendChild(a)),a.innerHTML=i}}),Iw=`.address-search{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:14px}.search-container{flex-direction:column;width:100%;display:flex;position:relative}.search-input-wrapper{background:#fff;border:1px solid #ccc;border-radius:4px;align-items:center;padding:0 10px;display:flex}.search-icon{fill:#666;flex-shrink:0;width:16px;height:16px;margin-right:8px}.search-input{background:0 0;border:none;outline:none;flex:1;padding:10px 0;font-size:14px}.search-input::placeholder{color:#999}.loading-indicator{border:2px solid #e0e0e0;border-top-color:#666;border-radius:50%;flex-shrink:0;width:16px;height:16px;animation:.8s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.results-dropdown{background:#fff;border:1px solid #ccc;border-radius:4px;margin-top:4px;display:none}.search-container:focus-within .results-dropdown{display:block}.results-list{max-height:300px;margin:0;padding:0;list-style:none;overflow-y:auto}@container (width>=10px){.results-list{max-height:70cqh}}.result-item{cursor:pointer;border-bottom:1px solid #eee;align-items:stretch;padding:10px 12px;transition:background-color .15s;display:flex}.result-item:last-child{border-bottom:none}.result-item:hover{background-color:#f5f5f5}.result-icon{fill:#666;flex-shrink:0;width:20px;height:20px;margin-right:10px}.result-icon.special{fill:#df486e}.result-content{flex-direction:column;flex:1;justify-content:center;min-width:0;display:flex}.result-title{color:#333;white-space:nowrap;text-overflow:ellipsis;font-weight:500;overflow:hidden}.result-subtitle{color:#666;white-space:nowrap;text-overflow:ellipsis;margin-top:2px;font-size:12px;overflow:hidden}.result-distance{color:#999;white-space:nowrap;flex-shrink:0;margin-left:8px;font-size:12px}.results-footer{color:#666;background:#fafafa;border-top:1px solid #eee;padding:8px 12px;font-size:12px}.prefer-close-label{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;display:flex}.prefer-close-label input{margin-left:0;margin-right:3px}.no-results{text-align:center;color:#666;padding:16px 12px}.no-results.error{color:#c62828}.result-count-input{text-align:center;-moz-appearance:textfield;border:1px solid #ccc;border-radius:3px;width:28px;padding:1px 2px;font-size:12px}.result-count-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.result-count-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}`,Lw={en:{addressSearch:{placeholder:`Search Address`,searchFailed:`Search failed. Please try again.`,showing:`Showing`,of:`of`,results:`results`,preferNearby:`Prefer nearby`,noResults:`No results`}},de:{addressSearch:{placeholder:`Adresse suchen`,searchFailed:`Suche fehlgeschlagen. Bitte erneut versuchen.`,showing:`Zeige`,of:`von`,results:`Ergebnisse`,preferNearby:`Nächstgelegene bevorzugen`,noResults:`Keine Ergebnisse`}}};function Rw(e){return(e||document.documentElement.lang||navigator.language||`en`).split(`-`)[0].toLowerCase()}function zw(e,t){return(Lw[Rw(t)]??Lw.en)[e]??Lw.en[e]}var Bw=`https://srv.doris.at/solr/searchservice/search/all2`,Vw=250,Hw=class extends Me{static styles=[a(Iw),o`
103
+ :host {
104
+ display: block;
105
+ }
106
+ `];static properties={lang:{type:String},placeholder:{type:String},resultCount:{type:Number},sortByDistance:{type:Boolean},minSearchLength:{type:Number},mapCenter:{type:Array},_query:{state:!0},_results:{state:!0},_loading:{state:!0},_showResults:{state:!0},_error:{state:!0},_totalResults:{state:!0}};get#e(){return zw(`addressSearch`,this.lang)}#t=null;#n=null;constructor(){super(),this.resultCount=5,this.sortByDistance=!1,this.minSearchLength=3,this.mapCenter=null,this._query=``,this._results=[],this._loading=!1,this._showResults=!1,this._error=null,this._totalResults=0}#r(e,t){clearTimeout(this.#t),this.#t=setTimeout(e,t)}#i(e){this._query=e.target.value,this.#r(()=>this.#a(),Vw)}async#a(){if(this._query.length<this.minSearchLength){this._results=[],this._showResults=!1;return}this.#n?.abort(),this.#n=new AbortController,this._loading=!0,this._showResults=!0,this._error=null;try{this._results=await this.#o(this._query)}catch(e){e.name!==`AbortError`&&(console.error(`Search error:`,e),this._results=[],this._error=this.#e.searchFailed)}finally{this._loading=!1}}async#o(e){let t=new URLSearchParams({q:e,wt:`json2`,rows:String(this.resultCount)}),n=`${Bw}/?${t}`;if(this.sortByDistance&&this.mapCenter){let[e,r]=this.mapCenter;t.set(`pt`,`${r},${e}`),n=`${Bw}/geo/?${t}`}let r=await fetch(n,{signal:this.#n.signal});if(!r.ok)throw Error(`HTTP ${r.status}`);let i=await r.json();return this._totalResults=i?.response?.numFound||0,this.#s(i)}#s(e){return(e?.response?.docs||[]).map(e=>{e.type;let t=this.#c(e);return{type:e.type===`GeonamAT`?`special`:`address`,title:e.textsuggest,subtitle:e.subtext,distance:e._dist_?this.#l(e._dist_):null,coordinates:t,raw:e}})}#c(e){if(e.x&&e.y)return[parseFloat(e.x),parseFloat(e.y)];if(Array.isArray(e.geo)){let t=e.geo[0].match(/POINT\s*\(\s*([\d.]+)\s+([\d.]+)\s*\)/i);if(t)return[parseFloat(t[1]),parseFloat(t[2])]}if(e.geo instanceof String){let t=e.geo.match(/POINT\s*\(\s*([\d.]+)\s+([\d.]+)\s*\)/i);if(t)return[parseFloat(t[1]),parseFloat(t[2])]}return null}#l(e){return e<1e3?`${Math.round(e)} m`:`${(e/1e3).toFixed(1)} km`}#u(e){e.coordinates&&(document.activeElement?.blur(),this._query=e.title,this.dispatchEvent(new CustomEvent(`select`,{detail:{coordinates:e.coordinates,result:e},bubbles:!0,composed:!0})))}#d(e){this.sortByDistance=e.target.checked,this._query.length>=this.minSearchLength&&this.#a()}#f(e){let t=parseInt(e.target.value,10);!t||t<1||(this.resultCount=Math.min(t,100),this.#r(()=>{this._query.length>=this.minSearchLength&&this.#a()},Vw))}#p(){return pe`
137
107
  <svg
138
108
  class="search-icon"
139
109
  viewBox="0 0 24 24"
@@ -143,7 +113,7 @@
143
113
  d="M10 3a7 7 0 1 0 4.9 12l4.35 4.35a1 1 0 0 0 1.4-1.4L16.35 13.6A7 7 0 0 0 10 3Zm0 2a5 5 0 1 1 0 10 5 5 0 0 1 0-10Z"
144
114
  />
145
115
  </svg>
146
- `},xm=function(){return Bt`
116
+ `}#m(){return pe`
147
117
  <svg
148
118
  class="result-icon"
149
119
  viewBox="0 0 24 24"
@@ -153,7 +123,7 @@
153
123
  d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7Zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5Z"
154
124
  />
155
125
  </svg>
156
- `},Em=function(){return Bt`
126
+ `}#h(){return pe`
157
127
  <svg
158
128
  class="result-icon special"
159
129
  viewBox="0 0 24 24"
@@ -163,59 +133,72 @@
163
133
  d="M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 17l-6.2 4.3 2.4-7.4L2 9.4h7.6L12 2Z"
164
134
  />
165
135
  </svg>
166
- `},wm=function(){return Bt`
136
+ `}#g(){return pe`
167
137
  <div class="results-footer">
168
138
  <span class="result-count-display">
169
- Showing
139
+ ${this.#e.showing}
170
140
  <input
171
141
  type="number"
172
142
  class="result-count-input"
173
143
  .value=${String(this.resultCount)}
174
- @input=${le(this,de,ym)}
144
+ @input=${this.#f}
175
145
  min="1"
176
146
  max="100"
177
147
  />
178
- of ${this._totalResults} results
148
+ ${this.#e.of} ${this._totalResults} ${this.#e.results}
179
149
  </span>
180
150
  <label class="prefer-close-label">
181
151
  <input
182
152
  type="checkbox"
183
153
  .checked=${this.sortByDistance}
184
- @change=${le(this,de,mm)}
154
+ @change=${this.#d}
185
155
  />
186
- Prefer nearby
156
+ ${this.#e.preferNearby}
187
157
  </label>
188
158
  </div>
189
- `},vm=function(){return this._showResults?Bt`
159
+ `}#_(){return this._showResults?pe`
190
160
  <div class="results-dropdown">
191
161
  <ul class="results-list">
192
- ${this._error?Bt`<div class="no-results error">${this._error}</div>`:null}
193
- ${this._results.length===0&&!this._error?Bt`<div class="no-results">No results</div>`:null}
194
- ${this._results.map(t=>Bt`
162
+ ${this._error?pe`<div class="no-results error">${this._error}</div>`:null}
163
+ ${this._results.length===0&&!this._error?pe`<div class="no-results">${this.#e.noResults}</div>`:null}
164
+ ${this._results.map(e=>pe`
195
165
  <li
196
166
  class="result-item"
197
- @click=${()=>le(this,de,Am).call(this,t)}
167
+ @click=${()=>this.#u(e)}
198
168
  >
199
- ${t.type==="special"?le(this,de,Em).call(this):le(this,de,xm).call(this)}
169
+ ${e.type===`special`?this.#h():this.#m()}
200
170
  <div class="result-content">
201
- <div class="result-title">${t.title}</div>
202
- ${t.subtitle?Bt`<div class="result-subtitle">
203
- ${t.subtitle}
171
+ <div class="result-title">${e.title}</div>
172
+ ${e.subtitle?pe`<div class="result-subtitle">
173
+ ${e.subtitle}
204
174
  </div>`:null}
205
175
  </div>
206
- ${t.distance?Bt`<span class="result-distance"
207
- >${t.distance}</span
176
+ ${e.distance?pe`<span class="result-distance"
177
+ >${e.distance}</span
208
178
  >`:null}
209
179
  </li>
210
180
  `)}
211
181
  </ul>
212
- ${le(this,de,wm).call(this)}
182
+ ${this.#g()}
213
183
  </div>
214
- `:null},Gt(cd,"styles",[Qo(XC),yd`
215
- :host {
216
- display: block;
217
- }
218
- `]),Gt(cd,"properties",{placeholder:{type:String},resultCount:{type:Number},sortByDistance:{type:Boolean},minSearchLength:{type:Number},mapCenter:{type:Array},_query:{state:!0},_results:{state:!0},_loading:{state:!0},_showResults:{state:!0},_error:{state:!0},_totalResults:{state:!0}}),customElements.define("yio-address-search",cd);class YC extends so{constructor(t={}){const i=document.createElement("yio-address-search");i.className="ol-address-search ol-unselectable ol-control";super({element:i,target:t.target});Gt(this,"searchElement");this.searchElement=i,t.onSelect&&i.addEventListener("select",t.onSelect)}setMap(t){if(super.setMap(t),t){const i=t.getView(),r=i.getCenter();r&&(this.searchElement.mapCenter=$s(r)),i.on("change:center",()=>{this.searchElement.mapCenter=i.getCenter()})}}}class Zl extends Ur{constructor(){super();ae(this,Ct);Gt(this,"notifyNextChange",!1);ae(this,st,null);ae(this,Ko,"");ae(this,kr,new Si);ae(this,tn,null);ae(this,Dr,null);ae(this,Un,null);ae(this,ri,null);ae(this,Zo,null);ae(this,qo,null);ae(this,Or,!1);ae(this,Gr,!1);ae(this,Vn,null);ae(this,Wn,null);ae(this,Br,!1);ae(this,nn,null);ae(this,ql,t=>{const{coordinates:i}=t.detail,r=$s(i);i&&(this.center=r,this.zoom=18),this.enablePinning&&this.setPin(r)});this.center=[0,0],this.zoom=2,this.userSelect=[],pe(this,tn,new UC({yioMap:this})),pe(this,Dr,new LC({yioMap:this})),pe(this,Un,new VC({yioMap:this}))}_getContentLayer(){return M(this,kr)}_getContentLayerPromise(){return M(this,ri)}_handleClick(t){t instanceof PointerEvent&&(this.lastClickCoordinate=$s(M(this,st).getEventCoordinate(t))),this.dispatchEvent(new PointerEvent("click",t))}get contentMap(){return M(this,Ko)}set contentMap(t){pe(this,Ko,t),le(this,Ct,Cm).call(this)}get editCreate(){return M(this,Zo)}set editCreate(t){pe(this,Zo,t),M(this,tn).setCreateEnabled(t)}set editModify(t){pe(this,qo,t),M(this,tn).setModifyEnabled(t)}get editModify(){return M(this,qo)}get enableSelect(){return M(this,Or)}set enableSelect(t){pe(this,Or,t),M(this,Dr).setActive(!!M(this,Or))}get enablePinning(){return M(this,Gr)}set enablePinning(t){pe(this,Gr,t),M(this,Un).setActive(!!M(this,Gr))}get geojsonSources(){return M(this,Vn)}set geojsonSources(t){pe(this,Vn,t)}get sourceLayerVisibility(){return M(this,Wn)}set sourceLayerVisibility(t){pe(this,Wn,t)}get enableSearch(){return M(this,Br)}set enableSearch(t){pe(this,Br,t),le(this,Ct,Ad).call(this)}get editFeatures(){var r,s;const t=(s=(r=M(this,tn).getEditLayer())==null?void 0:r.getSource())==null?void 0:s.getFeatures();return t?new Fh().writeFeaturesObject(t,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"}):null}firstUpdated(t){super.firstUpdated(t),le(this,Ct,bm).call(this);const i=this.shadowRoot.querySelector(".map");this.shadowRoot.addEventListener("click",r=>r.stopPropagation()),M(this,st).setTarget(i)}updated(t){super.updated(t),t.has("sourceLayerVisibility")&&!t.has("contentMap")&&M(this,ri)&&le(this,Ct,pd).call(this),t.has("geojsonSources")&&!t.has("contentMap")&&M(this,ri)&&le(this,Ct,gd).call(this),!this.notifyNextChange&&(t.has("center")||t.has("zoom"))&&M(this,st).getView().animate({center:Js(this.center),zoom:this.zoom,duration:500}),this.notifyNextChange&&(this.notifyNextChange=!1,this.dispatchEvent(new CustomEvent("change",{composed:!0,bubbles:!0,detail:{changedProperties:t}})))}setPin(t){M(this,Un).setPin(Js(t))}render(){return Bt`<div class="map"></div>`}}return st=new WeakMap,Ko=new WeakMap,kr=new WeakMap,tn=new WeakMap,Dr=new WeakMap,Un=new WeakMap,ri=new WeakMap,Zo=new WeakMap,qo=new WeakMap,Or=new WeakMap,Gr=new WeakMap,Vn=new WeakMap,Wn=new WeakMap,Br=new WeakMap,nn=new WeakMap,Ct=new WeakSet,Cm=async function(){await M(this,ri),M(this,kr).getLayers().clear(),pe(this,ri,null),this.contentMap&&(pe(this,ri,FA(M(this,kr),this.contentMap).catch(t=>{console.error("Error applying content to yiomap:",t)})),await M(this,ri),await le(this,Ct,pd).call(this),await le(this,Ct,gd).call(this))},gd=async function(){if(!M(this,Vn))return;const t=await M(this,ri);if(!t)return;const i=Object.keys(M(this,Vn));try{await Promise.all(i.map(r=>{const s=M(this,Vn)[r];if(!kA(t,r))throw new Error("Geojson source '"+r+"' does not exist.");return uC(t,r,{type:"geojson",data:s})}))}catch(r){console.error("Error updating GeoJSON sources:",r)}},pd=async function(){if(!M(this,Wn))return;const t=await M(this,ri);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 M(this,Wn)))return;const l=M(this,Wn)[a]?"visible":"none";hC(t,{...o,layout:{...o.layout,visibility:l}})}))}catch(s){console.error("Error updating source layer visibility:",s)}},bm=function(){pe(this,st,new To({controls:Gf({attribution:!1})})),M(this,st).addControl(HC),M(this,st).addControl(new FC({map:M(this,st)})),le(this,Ct,Ad).call(this),M(this,st).addLayer(M(this,kr)),M(this,st).addInteraction(M(this,Dr)),M(this,Dr).setActive(M(this,Or)),M(this,st).addInteraction(M(this,Un)),M(this,Un).setActive(M(this,Gr)),M(this,st).addInteraction(M(this,tn)),M(this,tn).setActive(!!this.editCreate||!!this.editModify);let t=!0;M(this,st).on("moveend",()=>{if(t){t=!1;return}const i=M(this,st).getView();this.notifyNextChange=!0,this.center=$s(i.getCenter()),this.zoom=i.getZoom()})},ql=new WeakMap,Ad=function(){M(this,st)&&(M(this,Br)&&!M(this,nn)?(pe(this,nn,new YC({onSelect:M(this,ql)})),M(this,st).addControl(M(this,nn))):!M(this,Br)&&M(this,nn)&&(M(this,st).removeControl(M(this,nn)),pe(this,nn,null)))},Gt(Zl,"styles",[Qo(Wm),Qo(Hm),yd`
184
+ `:null}render(){return pe`
185
+ <div class="address-search">
186
+ <div class="search-container" tabindex="1">
187
+ <div class="search-input-wrapper">
188
+ ${this.#p()}
189
+ <input
190
+ type="text"
191
+ class="search-input"
192
+ .placeholder=${this.#e.placeholder}
193
+ .value=${this._query}
194
+ @input=${this.#i}
195
+ />
196
+ ${this._loading?pe`<div class="loading-indicator"></div>`:null}
197
+ </div>
198
+ ${this.#_()}
199
+ </div>
200
+ </div>
201
+ `}};customElements.define(`yio-address-search`,Hw);var Uw=class extends Eo{searchElement;constructor(e={}){let t=document.createElement(`yio-address-search`);t.className=`ol-address-search ol-unselectable ol-control`,super({element:t,target:e.target}),this.searchElement=t,e.onSelect&&t.addEventListener(`select`,e.onSelect)}set lang(e){this.searchElement.lang=e}setMap(e){if(super.setMap(e),e){let t=e.getView(),n=t.getCenter();n&&(this.searchElement.mapCenter=li(n)),t.on(`change:center`,()=>{this.searchElement.mapCenter=t.getCenter()})}}},Ww=class extends Me{static styles=[a(Pe),a(Fe),o`
219
202
  :host {
220
203
  display: block;
221
204
  height: 200px;
@@ -246,4 +229,4 @@
246
229
  max-width: 300px;
247
230
  background-color: transparent;
248
231
  }
249
- `]),Gt(Zl,"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},enableSearch:{type:Boolean},geojsonSources:{type:Object},editFeatures:{attribute:!1},lastClickCoordinate:{type:Array,attribute:!1},userSelect:{attribute:!1},sourceLayerVisibility:{type:Object}}),window.customElements.define("yio-map",Zl),Zl}));
232
+ `];static 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},enableSearch:{type:Boolean},lang:{type:String},geojsonSources:{type:Object},editFeatures:{attribute:!1},lastClickCoordinate:{type:Array,attribute:!1},userSelect:{attribute:!1},sourceLayerVisibility:{type:Object}};notifyNextChange=!1;#e=null;#t=``;#n=new xs;#r=null;#i=null;#a=null;#o=null;#s=null;#c=null;#l=!1;#u=!1;#d=null;#f=null;#p=!1;#m=null;#h=null;constructor(){super(),this.center=[0,0],this.zoom=2,this.userSelect=[],this.#r=new Aw({yioMap:this}),this.#i=new ZC({yioMap:this}),this.#a=new jw({yioMap:this})}_getContentLayer(){return this.#n}_getContentLayerPromise(){return this.#o}_handleClick(e){e instanceof PointerEvent&&(this.lastClickCoordinate=li(this.#e.getEventCoordinate(e))),this.dispatchEvent(new PointerEvent(`click`,e))}get contentMap(){return this.#t}set contentMap(e){this.#t=e,this.#g()}get editCreate(){return this.#s}set editCreate(e){this.#s=e,this.#r.setCreateEnabled(e)}set editModify(e){this.#c=e,this.#r.setModifyEnabled(e)}get editModify(){return this.#c}get enableSelect(){return this.#l}set enableSelect(e){this.#l=e,this.#i.setActive(!!this.#l)}get enablePinning(){return this.#u}set enablePinning(e){this.#u=e,this.#a.setActive(!!this.#u)}get geojsonSources(){return this.#d}set geojsonSources(e){this.#d=e}get sourceLayerVisibility(){return this.#f}set sourceLayerVisibility(e){this.#f=e}get enableSearch(){return this.#p}set enableSearch(e){this.#p=e,this.#x()}get lang(){return this.#m}set lang(e){this.#m=e,this.#h&&(this.#h.lang=e)}get editFeatures(){let e=this.#r.getEditLayer()?.getSource()?.getFeatures();return e?new Td().writeFeaturesObject(e,{dataProjection:`EPSG:4326`,featureProjection:`EPSG:3857`}):null}async#g(){await this.#o,this.#n.getLayers().clear(),this.#o=null,this.contentMap&&(this.#o=uC(this.#n,this.contentMap).catch(e=>{console.error(`Error applying content to yiomap:`,e)}),await this.#o,await this.#v(),await this.#_())}async#_(){if(!this.#d)return;let e=await this.#o;if(!e)return;let t=Object.keys(this.#d);try{await Promise.all(t.map(t=>{let n=this.#d[t];if(!vC(e,t))throw Error(`Geojson source '`+t+`' does not exist.`);return hC(e,t,{type:`geojson`,data:n})}))}catch(e){console.error(`Error updating GeoJSON sources:`,e)}}async#v(){if(!this.#f)return;let e=await this.#o;if(!e)return;let t=e.get(`mapbox-style`),n=Object.keys(t.layers);try{await Promise.all(n.map(n=>{let r=t.layers[n],i=r[`source-layer`];if(!i||!(i in this.#f))return;let a=this.#f[i]?`visible`:`none`;mC(e,{...r,layout:{...r.layout,visibility:a}})}))}catch(e){console.error(`Error updating source layer visibility:`,e)}}#y(){this.#e=new Zu({controls:Ao({attribution:!1})}),this.#e.addControl(Fw),this.#e.addControl(new XC({map:this.#e})),this.#x(),this.#e.addLayer(this.#n),this.#e.addInteraction(this.#i),this.#i.setActive(this.#l),this.#e.addInteraction(this.#a),this.#a.setActive(this.#u),this.#e.addInteraction(this.#r),this.#r.setActive(!!this.editCreate||!!this.editModify);let e=!0;this.#e.on(`moveend`,()=>{if(e){e=!1;return}let t=this.#e.getView();this.notifyNextChange=!0,this.center=li(t.getCenter()),this.zoom=t.getZoom()})}firstUpdated(e){super.firstUpdated(e),this.#y();let t=this.shadowRoot.querySelector(`.map`);this.shadowRoot.addEventListener(`click`,e=>e.stopPropagation()),this.#e.setTarget(t)}updated(e){super.updated(e),e.has(`sourceLayerVisibility`)&&!e.has(`contentMap`)&&this.#o&&this.#v(),e.has(`geojsonSources`)&&!e.has(`contentMap`)&&this.#o&&this.#_(),!this.notifyNextChange&&(e.has(`center`)||e.has(`zoom`))&&this.#e.getView().animate({center:ci(this.center),zoom:this.zoom,duration:500}),this.notifyNextChange&&(this.notifyNextChange=!1,this.dispatchEvent(new CustomEvent(`change`,{composed:!0,bubbles:!0,detail:{changedProperties:e}})))}#b=e=>{let{coordinates:t}=e.detail,n=li(t);t&&(this.center=n,this.zoom=18),this.enablePinning&&this.setPin(n)};setPin(e){this.#a.setPin(ci(e))}#x(){this.#e&&(this.#p&&!this.#h?(this.#h=new Uw({onSelect:this.#b}),this.#m&&(this.#h.lang=this.#m),this.#e.addControl(this.#h)):!this.#p&&this.#h&&(this.#e.removeControl(this.#h),this.#h=null))}render(){return pe`<div class="map"></div>`}};return window.customElements.define(`yio-map`,Ww),Ww});