@europeana/map 0.1.1 → 0.1.2-map.0

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,22 +1,22 @@
1
- var EuropeanaMap=(function(){"use strict";var pt;function xc(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Xe={},Rr=[],gn=()=>{},Jf=()=>!1,oa=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),aa=n=>n.startsWith("onUpdate:"),_t=Object.assign,vc=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},v0=Object.prototype.hasOwnProperty,Ne=(n,e)=>v0.call(n,e),Ee=Array.isArray,Is=n=>Ms(n)==="[object Map]",w0=n=>Ms(n)==="[object Set]",Qf=n=>Ms(n)==="[object Date]",ve=n=>typeof n=="function",st=n=>typeof n=="string",pn=n=>typeof n=="symbol",Ue=n=>n!==null&&typeof n=="object",ed=n=>(Ue(n)||ve(n))&&ve(n.then)&&ve(n.catch),E0=Object.prototype.toString,Ms=n=>E0.call(n),b0=n=>Ms(n).slice(8,-1),C0=n=>Ms(n)==="[object Object]",la=n=>st(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,As=xc(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ca=n=>{const e=Object.create(null);return(t=>e[t]||(e[t]=n(t)))},T0=/-\w/g,rn=ca(n=>n.replace(T0,e=>e.slice(1).toUpperCase())),R0=/\B([A-Z])/g,Wi=ca(n=>n.replace(R0,"-$1").toLowerCase()),td=ca(n=>n.charAt(0).toUpperCase()+n.slice(1)),wc=ca(n=>n?`on${td(n)}`:""),mn=(n,e)=>!Object.is(n,e),Ec=(n,...e)=>{for(let t=0;t<n.length;t++)n[t](...e)},nd=(n,e,t,i=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},S0=n=>{const e=parseFloat(n);return isNaN(e)?n:e};let id;const ua=()=>id||(id=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function bc(n){if(Ee(n)){const e={};for(let t=0;t<n.length;t++){const i=n[t],r=st(i)?P0(i):bc(i);if(r)for(const s in r)e[s]=r[s]}return e}else if(st(n)||Ue(n))return n}const I0=/;(?![^(]*\))/g,M0=/:([^]+)/,A0=/\/\*[^]*?\*\//g;function P0(n){const e={};return n.replace(A0,"").split(I0).forEach(t=>{if(t){const i=t.split(M0);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function ha(n){let e="";if(st(n))e=n;else if(Ee(n))for(let t=0;t<n.length;t++){const i=ha(n[t]);i&&(e+=i+" ")}else if(Ue(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}const F0=xc("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function rd(n){return!!n||n===""}function O0(n,e){if(n.length!==e.length)return!1;let t=!0;for(let i=0;t&&i<n.length;i++)t=Cc(n[i],e[i]);return t}function Cc(n,e){if(n===e)return!0;let t=Qf(n),i=Qf(e);if(t||i)return t&&i?n.getTime()===e.getTime():!1;if(t=pn(n),i=pn(e),t||i)return n===e;if(t=Ee(n),i=Ee(e),t||i)return t&&i?O0(n,e):!1;if(t=Ue(n),i=Ue(e),t||i){if(!t||!i)return!1;const r=Object.keys(n).length,s=Object.keys(e).length;if(r!==s)return!1;for(const o in n){const a=n.hasOwnProperty(o),l=e.hasOwnProperty(o);if(a&&!l||!a&&l||!Cc(n[o],e[o]))return!1}}return String(n)===String(e)}let ft;class L0{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&ft&&(ft.active?(this.parent=ft,this.index=(ft.scopes||(ft.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=ft;try{return ft=this,e()}finally{ft=t}}}on(){++this._on===1&&(this.prevScope=ft,ft=this)}off(){if(this._on>0&&--this._on===0){if(ft===this)ft=this.prevScope;else{let e=ft;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].stop();for(this.effects.length=0,t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function sd(){return ft}function D0(n,e=!1){ft&&ft.cleanups.push(n)}let Be;const Tc=new WeakSet;class od{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ft&&(ft.active?ft.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Tc.has(this)&&(Tc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ld(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,dd(this),cd(this);const e=Be,t=sn;Be=this,sn=!0;try{return this.fn()}finally{ud(this),Be=e,sn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Mc(e);this.deps=this.depsTail=void 0,dd(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Tc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ic(this)&&this.run()}get dirty(){return Ic(this)}}let ad=0,Ps,Fs;function ld(n,e=!1){if(n.flags|=8,e){n.next=Fs,Fs=n;return}n.next=Ps,Ps=n}function Rc(){ad++}function Sc(){if(--ad>0)return;if(Fs){let e=Fs;for(Fs=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Ps;){let e=Ps;for(Ps=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function cd(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function ud(n){let e,t=n.depsTail,i=t;for(;i;){const r=i.prevDep;i.version===-1?(i===t&&(t=r),Mc(i),k0(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}n.deps=e,n.depsTail=t}function Ic(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(hd(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function hd(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Os)||(n.globalVersion=Os,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!Ic(n))))return;n.flags|=2;const e=n.dep,t=Be,i=sn;Be=n,sn=!0;try{cd(n);const r=n.fn(n._value);(e.version===0||mn(r,n._value))&&(n.flags|=128,n._value=r,e.version++)}catch(r){throw e.version++,r}finally{Be=t,sn=i,ud(n),n.flags&=-3}}function Mc(n,e=!1){const{dep:t,prevSub:i,nextSub:r}=n;if(i&&(i.nextSub=r,n.prevSub=void 0),r&&(r.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let s=t.computed.deps;s;s=s.nextDep)Mc(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function k0(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let sn=!0;const fd=[];function yn(){fd.push(sn),sn=!1}function _n(){const n=fd.pop();sn=n===void 0?!0:n}function dd(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Be;Be=void 0;try{e()}finally{Be=t}}}let Os=0;class N0{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class fa{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Be||!sn||Be===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Be)t=this.activeLink=new N0(Be,this),Be.deps?(t.prevDep=Be.depsTail,Be.depsTail.nextDep=t,Be.depsTail=t):Be.deps=Be.depsTail=t,gd(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Be.depsTail,t.nextDep=void 0,Be.depsTail.nextDep=t,Be.depsTail=t,Be.deps===t&&(Be.deps=i)}return t}trigger(e){this.version++,Os++,this.notify(e)}notify(e){Rc();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Sc()}}}function gd(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)gd(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const da=new WeakMap,Vi=Symbol(""),Ac=Symbol(""),Ls=Symbol("");function xt(n,e,t){if(sn&&Be){let i=da.get(n);i||da.set(n,i=new Map);let r=i.get(t);r||(i.set(t,r=new fa),r.map=i,r.key=t),r.track()}}function Dn(n,e,t,i,r,s){const o=da.get(n);if(!o){Os++;return}const a=l=>{l&&l.trigger()};if(Rc(),e==="clear")o.forEach(a);else{const l=Ee(n),c=l&&la(t);if(l&&t==="length"){const u=Number(i);o.forEach((h,f)=>{(f==="length"||f===Ls||!pn(f)&&f>=u)&&a(h)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(Ls)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Vi)),Is(n)&&a(o.get(Ac)));break;case"delete":l||(a(o.get(Vi)),Is(n)&&a(o.get(Ac)));break;case"set":Is(n)&&a(o.get(Vi));break}}Sc()}function z0(n,e){const t=da.get(n);return t&&t.get(e)}function Sr(n){const e=Ae(n);return e===n?e:(xt(e,"iterate",Ls),Kt(n)?e:e.map(Nn))}function Pc(n){return xt(n=Ae(n),"iterate",Ls),n}function xn(n,e){return ui(n)?ks(Ir(n)?Nn(e):e):Nn(e)}const G0={__proto__:null,[Symbol.iterator](){return Fc(this,Symbol.iterator,n=>xn(this,n))},concat(...n){return Sr(this).concat(...n.map(e=>Ee(e)?Sr(e):e))},entries(){return Fc(this,"entries",n=>(n[1]=xn(this,n[1]),n))},every(n,e){return kn(this,"every",n,e,void 0,arguments)},filter(n,e){return kn(this,"filter",n,e,t=>t.map(i=>xn(this,i)),arguments)},find(n,e){return kn(this,"find",n,e,t=>xn(this,t),arguments)},findIndex(n,e){return kn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return kn(this,"findLast",n,e,t=>xn(this,t),arguments)},findLastIndex(n,e){return kn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return kn(this,"forEach",n,e,void 0,arguments)},includes(...n){return Oc(this,"includes",n)},indexOf(...n){return Oc(this,"indexOf",n)},join(n){return Sr(this).join(n)},lastIndexOf(...n){return Oc(this,"lastIndexOf",n)},map(n,e){return kn(this,"map",n,e,void 0,arguments)},pop(){return Ds(this,"pop")},push(...n){return Ds(this,"push",n)},reduce(n,...e){return pd(this,"reduce",n,e)},reduceRight(n,...e){return pd(this,"reduceRight",n,e)},shift(){return Ds(this,"shift")},some(n,e){return kn(this,"some",n,e,void 0,arguments)},splice(...n){return Ds(this,"splice",n)},toReversed(){return Sr(this).toReversed()},toSorted(n){return Sr(this).toSorted(n)},toSpliced(...n){return Sr(this).toSpliced(...n)},unshift(...n){return Ds(this,"unshift",n)},values(){return Fc(this,"values",n=>xn(this,n))}};function Fc(n,e,t){const i=Pc(n),r=i[e]();return i!==n&&!Kt(n)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=t(s.value)),s}),r}const j0=Array.prototype;function kn(n,e,t,i,r,s){const o=Pc(n),a=o!==n&&!Kt(n),l=o[e];if(l!==j0[e]){const h=l.apply(n,s);return a?Nn(h):h}let c=t;o!==n&&(a?c=function(h,f){return t.call(this,xn(n,h),f,n)}:t.length>2&&(c=function(h,f){return t.call(this,h,f,n)}));const u=l.call(o,c,i);return a&&r?r(u):u}function pd(n,e,t,i){const r=Pc(n),s=r!==n&&!Kt(n);let o=t,a=!1;r!==n&&(s?(a=i.length===0,o=function(c,u,h){return a&&(a=!1,c=xn(n,c)),t.call(this,c,xn(n,u),h,n)}):t.length>3&&(o=function(c,u,h){return t.call(this,c,u,h,n)}));const l=r[e](o,...i);return a?xn(n,l):l}function Oc(n,e,t){const i=Ae(n);xt(i,"iterate",Ls);const r=i[e](...t);return(r===-1||r===!1)&&va(t[0])?(t[0]=Ae(t[0]),i[e](...t)):r}function Ds(n,e,t=[]){yn(),Rc();const i=Ae(n)[e].apply(n,t);return Sc(),_n(),i}const W0=xc("__proto__,__v_isRef,__isVue"),md=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(pn));function V0(n){pn(n)||(n=String(n));const e=Ae(this);return xt(e,"has",n),e.hasOwnProperty(n)}class yd{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!r;if(t==="__v_isReadonly")return r;if(t==="__v_isShallow")return s;if(t==="__v_raw")return i===(r?s?bd:Ed:s?wd:vd).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=Ee(e);if(!r){let l;if(o&&(l=G0[t]))return l;if(t==="hasOwnProperty")return V0}const a=Reflect.get(e,t,tt(e)?e:i);if((pn(t)?md.has(t):W0(t))||(r||xt(e,"get",t),s))return a;if(tt(a)){const l=o&&la(t)?a:a.value;return r&&Ue(l)?_a(l):l}return Ue(a)?r?_a(a):ya(a):a}}class _d extends yd{constructor(e=!1){super(!1,e)}set(e,t,i,r){let s=e[t];const o=Ee(e)&&la(t);if(!this._isShallow){const c=ui(s);if(!Kt(i)&&!ui(i)&&(s=Ae(s),i=Ae(i)),!o&&tt(s)&&!tt(i))return c||(s.value=i),!0}const a=o?Number(t)<e.length:Ne(e,t),l=Reflect.set(e,t,i,tt(e)?e:r);return e===Ae(r)&&(a?mn(i,s)&&Dn(e,"set",t,i):Dn(e,"add",t,i)),l}deleteProperty(e,t){const i=Ne(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&i&&Dn(e,"delete",t,void 0),r}has(e,t){const i=Reflect.has(e,t);return(!pn(t)||!md.has(t))&&xt(e,"has",t),i}ownKeys(e){return xt(e,"iterate",Ee(e)?"length":Vi),Reflect.ownKeys(e)}}class xd extends yd{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const X0=new _d,U0=new xd,B0=new _d(!0),$0=new xd(!0),Lc=n=>n,ga=n=>Reflect.getPrototypeOf(n);function K0(n,e,t){return function(...i){const r=this.__v_raw,s=Ae(r),o=Is(s),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=r[n](...i),u=t?Lc:e?ks:Nn;return!e&&xt(s,"iterate",l?Ac:Vi),_t(Object.create(c),{next(){const{value:h,done:f}=c.next();return f?{value:h,done:f}:{value:a?[u(h[0]),u(h[1])]:u(h),done:f}}})}}function pa(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function Y0(n,e){const t={get(r){const s=this.__v_raw,o=Ae(s),a=Ae(r);n||(mn(r,a)&&xt(o,"get",r),xt(o,"get",a));const{has:l}=ga(o),c=e?Lc:n?ks:Nn;if(l.call(o,r))return c(s.get(r));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!n&&xt(Ae(r),"iterate",Vi),r.size},has(r){const s=this.__v_raw,o=Ae(s),a=Ae(r);return n||(mn(r,a)&&xt(o,"has",r),xt(o,"has",a)),r===a?s.has(r):s.has(r)||s.has(a)},forEach(r,s){const o=this,a=o.__v_raw,l=Ae(a),c=e?Lc:n?ks:Nn;return!n&&xt(l,"iterate",Vi),a.forEach((u,h)=>r.call(s,c(u),c(h),o))}};return _t(t,n?{add:pa("add"),set:pa("set"),delete:pa("delete"),clear:pa("clear")}:{add(r){const s=Ae(this),o=ga(s),a=Ae(r),l=!e&&!Kt(r)&&!ui(r)?a:r;return o.has.call(s,l)||mn(r,l)&&o.has.call(s,r)||mn(a,l)&&o.has.call(s,a)||(s.add(l),Dn(s,"add",l,l)),this},set(r,s){!e&&!Kt(s)&&!ui(s)&&(s=Ae(s));const o=Ae(this),{has:a,get:l}=ga(o);let c=a.call(o,r);c||(r=Ae(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?mn(s,u)&&Dn(o,"set",r,s):Dn(o,"add",r,s),this},delete(r){const s=Ae(this),{has:o,get:a}=ga(s);let l=o.call(s,r);l||(r=Ae(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&Dn(s,"delete",r,void 0),c},clear(){const r=Ae(this),s=r.size!==0,o=r.clear();return s&&Dn(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=K0(r,n,e)}),t}function ma(n,e){const t=Y0(n,e);return(i,r,s)=>r==="__v_isReactive"?!n:r==="__v_isReadonly"?n:r==="__v_raw"?i:Reflect.get(Ne(t,r)&&r in i?t:i,r,s)}const Z0={get:ma(!1,!1)},q0={get:ma(!1,!0)},H0={get:ma(!0,!1)},J0={get:ma(!0,!0)},vd=new WeakMap,wd=new WeakMap,Ed=new WeakMap,bd=new WeakMap;function Q0(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ya(n){return ui(n)?n:xa(n,!1,X0,Z0,vd)}function ex(n){return xa(n,!1,B0,q0,wd)}function _a(n){return xa(n,!0,U0,H0,Ed)}function Dc(n){return xa(n,!0,$0,J0,bd)}function xa(n,e,t,i,r){if(!Ue(n)||n.__v_raw&&!(e&&n.__v_isReactive)||n.__v_skip||!Object.isExtensible(n))return n;const s=r.get(n);if(s)return s;const o=Q0(b0(n));if(o===0)return n;const a=new Proxy(n,o===2?i:t);return r.set(n,a),a}function Ir(n){return ui(n)?Ir(n.__v_raw):!!(n&&n.__v_isReactive)}function ui(n){return!!(n&&n.__v_isReadonly)}function Kt(n){return!!(n&&n.__v_isShallow)}function va(n){return n?!!n.__v_raw:!1}function Ae(n){const e=n&&n.__v_raw;return e?Ae(e):n}function tx(n){return!Ne(n,"__v_skip")&&Object.isExtensible(n)&&nd(n,"__v_skip",!0),n}const Nn=n=>Ue(n)?ya(n):n,ks=n=>Ue(n)?_a(n):n;function tt(n){return n?n.__v_isRef===!0:!1}function kc(n){return Cd(n,!1)}function hi(n){return Cd(n,!0)}function Cd(n,e){return tt(n)?n:new nx(n,e)}class nx{constructor(e,t){this.dep=new fa,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Ae(e),this._value=t?e:Nn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||Kt(e)||ui(e);e=i?e:Ae(e),mn(e,t)&&(this._rawValue=e,this._value=i?e:Nn(e),this.dep.trigger())}}function Ns(n){return tt(n)?n.value:n}function fi(n){return ve(n)?n():Ns(n)}const ix={get:(n,e,t)=>e==="__v_raw"?n:Ns(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const r=n[e];return tt(r)&&!tt(t)?(r.value=t,!0):Reflect.set(n,e,t,i)}};function Td(n){return Ir(n)?n:new Proxy(n,ix)}class rx{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new fa,{get:i,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function sx(n){return new rx(n)}class ox{constructor(e,t,i){this._object=e,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=pn(t)?t:String(t),this._raw=Ae(e);let r=!0,s=e;if(!Ee(e)||pn(this._key)||!la(this._key))do r=!va(s)||Kt(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=Ns(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&tt(this._raw[this._key])){const t=this._object[this._key];if(tt(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return z0(this._raw,this._key)}}class ax{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function wa(n,e,t){return tt(n)?n:ve(n)?new ax(n):Ue(n)&&arguments.length>1?lx(n,e,t):kc(n)}function lx(n,e,t){return new ox(n,e,t)}class cx{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new fa(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Be!==this)return ld(this,!0),!0}get value(){const e=this.dep.track();return hd(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function ux(n,e,t=!1){let i,r;return ve(n)?i=n:(i=n.get,r=n.set),new cx(i,r,t)}const Ea={},ba=new WeakMap;let Xi;function hx(n,e=!1,t=Xi){if(t){let i=ba.get(t);i||ba.set(t,i=[]),i.push(n)}}function fx(n,e,t=Xe){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=t,c=x=>r?x:Kt(x)||r===!1||r===0?di(x,1):di(x);let u,h,f,d,g=!1,p=!1;if(tt(n)?(h=()=>n.value,g=Kt(n)):Ir(n)?(h=()=>c(n),g=!0):Ee(n)?(p=!0,g=n.some(x=>Ir(x)||Kt(x)),h=()=>n.map(x=>{if(tt(x))return x.value;if(Ir(x))return c(x);if(ve(x))return l?l(x,2):x()})):ve(n)?e?h=l?()=>l(n,2):n:h=()=>{if(f){yn();try{f()}finally{_n()}}const x=Xi;Xi=u;try{return l?l(n,3,[d]):n(d)}finally{Xi=x}}:h=gn,e&&r){const x=h,w=r===!0?1/0:r;h=()=>di(x(),w)}const m=sd(),y=()=>{u.stop(),m&&m.active&&vc(m.effects,u)};if(s&&e){const x=e;e=(...w)=>{const T=x(...w);return y(),T}}let _=p?new Array(n.length).fill(Ea):Ea;const v=x=>{if(!(!(u.flags&1)||!u.dirty&&!x))if(e){const w=u.run();if(x||r||g||(p?w.some((T,R)=>mn(T,_[R])):mn(w,_))){f&&f();const T=Xi;Xi=u;try{const R=[w,_===Ea?void 0:p&&_[0]===Ea?[]:_,d];_=w,l?l(e,3,R):e(...R)}finally{Xi=T}}}else u.run()};return a&&a(v),u=new od(h),u.scheduler=o?()=>o(v,!1):v,d=x=>hx(x,!1,u),f=u.onStop=()=>{const x=ba.get(u);if(x){if(l)l(x,4);else for(const w of x)w();ba.delete(u)}},e?i?v(!0):_=u.run():o?o(v.bind(null,!0),!0):u.run(),y.pause=u.pause.bind(u),y.resume=u.resume.bind(u),y.stop=y,y}function di(n,e=1/0,t){if(e<=0||!Ue(n)||n.__v_skip||(t=t||new Map,(t.get(n)||0)>=e))return n;if(t.set(n,e),e--,tt(n))di(n.value,e,t);else if(Ee(n))for(let i=0;i<n.length;i++)di(n[i],e,t);else if(w0(n)||Is(n))n.forEach(i=>{di(i,e,t)});else if(C0(n)){for(const i in n)di(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&di(n[i],e,t)}return n}const zs=[];let Nc=!1;function FI(n,...e){if(Nc)return;Nc=!0,yn();const t=zs.length?zs[zs.length-1].component:null,i=t&&t.appContext.config.warnHandler,r=dx();if(i)Mr(i,t,11,[n+e.map(s=>{var o,a;return(a=(o=s.toString)==null?void 0:o.call(s))!=null?a:JSON.stringify(s)}).join(""),t&&t.proxy,r.map(({vnode:s})=>`at <${vg(t,s.type)}>`).join(`
1
+ var EuropeanaMap=(function(){"use strict";var pt;function xc(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Xe={},Sr=[],pn=()=>{},Jf=()=>!1,oa=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),aa=n=>n.startsWith("onUpdate:"),xt=Object.assign,vc=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},v0=Object.prototype.hasOwnProperty,Ne=(n,e)=>v0.call(n,e),Ee=Array.isArray,Is=n=>Ms(n)==="[object Map]",w0=n=>Ms(n)==="[object Set]",Qf=n=>Ms(n)==="[object Date]",ve=n=>typeof n=="function",st=n=>typeof n=="string",mn=n=>typeof n=="symbol",Ue=n=>n!==null&&typeof n=="object",ed=n=>(Ue(n)||ve(n))&&ve(n.then)&&ve(n.catch),E0=Object.prototype.toString,Ms=n=>E0.call(n),b0=n=>Ms(n).slice(8,-1),C0=n=>Ms(n)==="[object Object]",la=n=>st(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,As=xc(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ca=n=>{const e=Object.create(null);return(t=>e[t]||(e[t]=n(t)))},T0=/-\w/g,rn=ca(n=>n.replace(T0,e=>e.slice(1).toUpperCase())),R0=/\B([A-Z])/g,Vi=ca(n=>n.replace(R0,"-$1").toLowerCase()),td=ca(n=>n.charAt(0).toUpperCase()+n.slice(1)),wc=ca(n=>n?`on${td(n)}`:""),yn=(n,e)=>!Object.is(n,e),Ec=(n,...e)=>{for(let t=0;t<n.length;t++)n[t](...e)},nd=(n,e,t,i=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},S0=n=>{const e=parseFloat(n);return isNaN(e)?n:e};let id;const ua=()=>id||(id=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function bc(n){if(Ee(n)){const e={};for(let t=0;t<n.length;t++){const i=n[t],r=st(i)?P0(i):bc(i);if(r)for(const s in r)e[s]=r[s]}return e}else if(st(n)||Ue(n))return n}const I0=/;(?![^(]*\))/g,M0=/:([^]+)/,A0=/\/\*[^]*?\*\//g;function P0(n){const e={};return n.replace(A0,"").split(I0).forEach(t=>{if(t){const i=t.split(M0);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function ha(n){let e="";if(st(n))e=n;else if(Ee(n))for(let t=0;t<n.length;t++){const i=ha(n[t]);i&&(e+=i+" ")}else if(Ue(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}const F0=xc("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function rd(n){return!!n||n===""}function O0(n,e){if(n.length!==e.length)return!1;let t=!0;for(let i=0;t&&i<n.length;i++)t=Cc(n[i],e[i]);return t}function Cc(n,e){if(n===e)return!0;let t=Qf(n),i=Qf(e);if(t||i)return t&&i?n.getTime()===e.getTime():!1;if(t=mn(n),i=mn(e),t||i)return n===e;if(t=Ee(n),i=Ee(e),t||i)return t&&i?O0(n,e):!1;if(t=Ue(n),i=Ue(e),t||i){if(!t||!i)return!1;const r=Object.keys(n).length,s=Object.keys(e).length;if(r!==s)return!1;for(const o in n){const a=n.hasOwnProperty(o),l=e.hasOwnProperty(o);if(a&&!l||!a&&l||!Cc(n[o],e[o]))return!1}}return String(n)===String(e)}let ft;class L0{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&ft&&(ft.active?(this.parent=ft,this.index=(ft.scopes||(ft.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=ft;try{return ft=this,e()}finally{ft=t}}}on(){++this._on===1&&(this.prevScope=ft,ft=this)}off(){if(this._on>0&&--this._on===0){if(ft===this)ft=this.prevScope;else{let e=ft;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].stop();for(this.effects.length=0,t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function sd(){return ft}function D0(n,e=!1){ft&&ft.cleanups.push(n)}let Be;const Tc=new WeakSet;class od{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ft&&(ft.active?ft.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Tc.has(this)&&(Tc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ld(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,dd(this),cd(this);const e=Be,t=sn;Be=this,sn=!0;try{return this.fn()}finally{ud(this),Be=e,sn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Mc(e);this.deps=this.depsTail=void 0,dd(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Tc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ic(this)&&this.run()}get dirty(){return Ic(this)}}let ad=0,Ps,Fs;function ld(n,e=!1){if(n.flags|=8,e){n.next=Fs,Fs=n;return}n.next=Ps,Ps=n}function Rc(){ad++}function Sc(){if(--ad>0)return;if(Fs){let e=Fs;for(Fs=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Ps;){let e=Ps;for(Ps=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function cd(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function ud(n){let e,t=n.depsTail,i=t;for(;i;){const r=i.prevDep;i.version===-1?(i===t&&(t=r),Mc(i),k0(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}n.deps=e,n.depsTail=t}function Ic(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(hd(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function hd(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Os)||(n.globalVersion=Os,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!Ic(n))))return;n.flags|=2;const e=n.dep,t=Be,i=sn;Be=n,sn=!0;try{cd(n);const r=n.fn(n._value);(e.version===0||yn(r,n._value))&&(n.flags|=128,n._value=r,e.version++)}catch(r){throw e.version++,r}finally{Be=t,sn=i,ud(n),n.flags&=-3}}function Mc(n,e=!1){const{dep:t,prevSub:i,nextSub:r}=n;if(i&&(i.nextSub=r,n.prevSub=void 0),r&&(r.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let s=t.computed.deps;s;s=s.nextDep)Mc(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function k0(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let sn=!0;const fd=[];function _n(){fd.push(sn),sn=!1}function xn(){const n=fd.pop();sn=n===void 0?!0:n}function dd(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Be;Be=void 0;try{e()}finally{Be=t}}}let Os=0;class N0{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class fa{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Be||!sn||Be===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Be)t=this.activeLink=new N0(Be,this),Be.deps?(t.prevDep=Be.depsTail,Be.depsTail.nextDep=t,Be.depsTail=t):Be.deps=Be.depsTail=t,gd(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Be.depsTail,t.nextDep=void 0,Be.depsTail.nextDep=t,Be.depsTail=t,Be.deps===t&&(Be.deps=i)}return t}trigger(e){this.version++,Os++,this.notify(e)}notify(e){Rc();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Sc()}}}function gd(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)gd(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const da=new WeakMap,Xi=Symbol(""),Ac=Symbol(""),Ls=Symbol("");function vt(n,e,t){if(sn&&Be){let i=da.get(n);i||da.set(n,i=new Map);let r=i.get(t);r||(i.set(t,r=new fa),r.map=i,r.key=t),r.track()}}function kn(n,e,t,i,r,s){const o=da.get(n);if(!o){Os++;return}const a=l=>{l&&l.trigger()};if(Rc(),e==="clear")o.forEach(a);else{const l=Ee(n),c=l&&la(t);if(l&&t==="length"){const u=Number(i);o.forEach((h,f)=>{(f==="length"||f===Ls||!mn(f)&&f>=u)&&a(h)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(Ls)),e){case"add":l?c&&a(o.get("length")):(a(o.get(Xi)),Is(n)&&a(o.get(Ac)));break;case"delete":l||(a(o.get(Xi)),Is(n)&&a(o.get(Ac)));break;case"set":Is(n)&&a(o.get(Xi));break}}Sc()}function z0(n,e){const t=da.get(n);return t&&t.get(e)}function Ir(n){const e=Ae(n);return e===n?e:(vt(e,"iterate",Ls),Yt(n)?e:e.map(zn))}function Pc(n){return vt(n=Ae(n),"iterate",Ls),n}function vn(n,e){return ui(n)?ks(Mr(n)?zn(e):e):zn(e)}const G0={__proto__:null,[Symbol.iterator](){return Fc(this,Symbol.iterator,n=>vn(this,n))},concat(...n){return Ir(this).concat(...n.map(e=>Ee(e)?Ir(e):e))},entries(){return Fc(this,"entries",n=>(n[1]=vn(this,n[1]),n))},every(n,e){return Nn(this,"every",n,e,void 0,arguments)},filter(n,e){return Nn(this,"filter",n,e,t=>t.map(i=>vn(this,i)),arguments)},find(n,e){return Nn(this,"find",n,e,t=>vn(this,t),arguments)},findIndex(n,e){return Nn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Nn(this,"findLast",n,e,t=>vn(this,t),arguments)},findLastIndex(n,e){return Nn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Nn(this,"forEach",n,e,void 0,arguments)},includes(...n){return Oc(this,"includes",n)},indexOf(...n){return Oc(this,"indexOf",n)},join(n){return Ir(this).join(n)},lastIndexOf(...n){return Oc(this,"lastIndexOf",n)},map(n,e){return Nn(this,"map",n,e,void 0,arguments)},pop(){return Ds(this,"pop")},push(...n){return Ds(this,"push",n)},reduce(n,...e){return pd(this,"reduce",n,e)},reduceRight(n,...e){return pd(this,"reduceRight",n,e)},shift(){return Ds(this,"shift")},some(n,e){return Nn(this,"some",n,e,void 0,arguments)},splice(...n){return Ds(this,"splice",n)},toReversed(){return Ir(this).toReversed()},toSorted(n){return Ir(this).toSorted(n)},toSpliced(...n){return Ir(this).toSpliced(...n)},unshift(...n){return Ds(this,"unshift",n)},values(){return Fc(this,"values",n=>vn(this,n))}};function Fc(n,e,t){const i=Pc(n),r=i[e]();return i!==n&&!Yt(n)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=t(s.value)),s}),r}const j0=Array.prototype;function Nn(n,e,t,i,r,s){const o=Pc(n),a=o!==n&&!Yt(n),l=o[e];if(l!==j0[e]){const h=l.apply(n,s);return a?zn(h):h}let c=t;o!==n&&(a?c=function(h,f){return t.call(this,vn(n,h),f,n)}:t.length>2&&(c=function(h,f){return t.call(this,h,f,n)}));const u=l.call(o,c,i);return a&&r?r(u):u}function pd(n,e,t,i){const r=Pc(n),s=r!==n&&!Yt(n);let o=t,a=!1;r!==n&&(s?(a=i.length===0,o=function(c,u,h){return a&&(a=!1,c=vn(n,c)),t.call(this,c,vn(n,u),h,n)}):t.length>3&&(o=function(c,u,h){return t.call(this,c,u,h,n)}));const l=r[e](o,...i);return a?vn(n,l):l}function Oc(n,e,t){const i=Ae(n);vt(i,"iterate",Ls);const r=i[e](...t);return(r===-1||r===!1)&&va(t[0])?(t[0]=Ae(t[0]),i[e](...t)):r}function Ds(n,e,t=[]){_n(),Rc();const i=Ae(n)[e].apply(n,t);return Sc(),xn(),i}const W0=xc("__proto__,__v_isRef,__isVue"),md=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(mn));function V0(n){mn(n)||(n=String(n));const e=Ae(this);return vt(e,"has",n),e.hasOwnProperty(n)}class yd{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!r;if(t==="__v_isReadonly")return r;if(t==="__v_isShallow")return s;if(t==="__v_raw")return i===(r?s?bd:Ed:s?wd:vd).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=Ee(e);if(!r){let l;if(o&&(l=G0[t]))return l;if(t==="hasOwnProperty")return V0}const a=Reflect.get(e,t,tt(e)?e:i);if((mn(t)?md.has(t):W0(t))||(r||vt(e,"get",t),s))return a;if(tt(a)){const l=o&&la(t)?a:a.value;return r&&Ue(l)?_a(l):l}return Ue(a)?r?_a(a):ya(a):a}}class _d extends yd{constructor(e=!1){super(!1,e)}set(e,t,i,r){let s=e[t];const o=Ee(e)&&la(t);if(!this._isShallow){const c=ui(s);if(!Yt(i)&&!ui(i)&&(s=Ae(s),i=Ae(i)),!o&&tt(s)&&!tt(i))return c||(s.value=i),!0}const a=o?Number(t)<e.length:Ne(e,t),l=Reflect.set(e,t,i,tt(e)?e:r);return e===Ae(r)&&(a?yn(i,s)&&kn(e,"set",t,i):kn(e,"add",t,i)),l}deleteProperty(e,t){const i=Ne(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&i&&kn(e,"delete",t,void 0),r}has(e,t){const i=Reflect.has(e,t);return(!mn(t)||!md.has(t))&&vt(e,"has",t),i}ownKeys(e){return vt(e,"iterate",Ee(e)?"length":Xi),Reflect.ownKeys(e)}}class xd extends yd{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const X0=new _d,U0=new xd,B0=new _d(!0),$0=new xd(!0),Lc=n=>n,ga=n=>Reflect.getPrototypeOf(n);function K0(n,e,t){return function(...i){const r=this.__v_raw,s=Ae(r),o=Is(s),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=r[n](...i),u=t?Lc:e?ks:zn;return!e&&vt(s,"iterate",l?Ac:Xi),xt(Object.create(c),{next(){const{value:h,done:f}=c.next();return f?{value:h,done:f}:{value:a?[u(h[0]),u(h[1])]:u(h),done:f}}})}}function pa(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function Y0(n,e){const t={get(r){const s=this.__v_raw,o=Ae(s),a=Ae(r);n||(yn(r,a)&&vt(o,"get",r),vt(o,"get",a));const{has:l}=ga(o),c=e?Lc:n?ks:zn;if(l.call(o,r))return c(s.get(r));if(l.call(o,a))return c(s.get(a));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!n&&vt(Ae(r),"iterate",Xi),r.size},has(r){const s=this.__v_raw,o=Ae(s),a=Ae(r);return n||(yn(r,a)&&vt(o,"has",r),vt(o,"has",a)),r===a?s.has(r):s.has(r)||s.has(a)},forEach(r,s){const o=this,a=o.__v_raw,l=Ae(a),c=e?Lc:n?ks:zn;return!n&&vt(l,"iterate",Xi),a.forEach((u,h)=>r.call(s,c(u),c(h),o))}};return xt(t,n?{add:pa("add"),set:pa("set"),delete:pa("delete"),clear:pa("clear")}:{add(r){const s=Ae(this),o=ga(s),a=Ae(r),l=!e&&!Yt(r)&&!ui(r)?a:r;return o.has.call(s,l)||yn(r,l)&&o.has.call(s,r)||yn(a,l)&&o.has.call(s,a)||(s.add(l),kn(s,"add",l,l)),this},set(r,s){!e&&!Yt(s)&&!ui(s)&&(s=Ae(s));const o=Ae(this),{has:a,get:l}=ga(o);let c=a.call(o,r);c||(r=Ae(r),c=a.call(o,r));const u=l.call(o,r);return o.set(r,s),c?yn(s,u)&&kn(o,"set",r,s):kn(o,"add",r,s),this},delete(r){const s=Ae(this),{has:o,get:a}=ga(s);let l=o.call(s,r);l||(r=Ae(r),l=o.call(s,r)),a&&a.call(s,r);const c=s.delete(r);return l&&kn(s,"delete",r,void 0),c},clear(){const r=Ae(this),s=r.size!==0,o=r.clear();return s&&kn(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=K0(r,n,e)}),t}function ma(n,e){const t=Y0(n,e);return(i,r,s)=>r==="__v_isReactive"?!n:r==="__v_isReadonly"?n:r==="__v_raw"?i:Reflect.get(Ne(t,r)&&r in i?t:i,r,s)}const Z0={get:ma(!1,!1)},q0={get:ma(!1,!0)},H0={get:ma(!0,!1)},J0={get:ma(!0,!0)},vd=new WeakMap,wd=new WeakMap,Ed=new WeakMap,bd=new WeakMap;function Q0(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ya(n){return ui(n)?n:xa(n,!1,X0,Z0,vd)}function ex(n){return xa(n,!1,B0,q0,wd)}function _a(n){return xa(n,!0,U0,H0,Ed)}function Dc(n){return xa(n,!0,$0,J0,bd)}function xa(n,e,t,i,r){if(!Ue(n)||n.__v_raw&&!(e&&n.__v_isReactive)||n.__v_skip||!Object.isExtensible(n))return n;const s=r.get(n);if(s)return s;const o=Q0(b0(n));if(o===0)return n;const a=new Proxy(n,o===2?i:t);return r.set(n,a),a}function Mr(n){return ui(n)?Mr(n.__v_raw):!!(n&&n.__v_isReactive)}function ui(n){return!!(n&&n.__v_isReadonly)}function Yt(n){return!!(n&&n.__v_isShallow)}function va(n){return n?!!n.__v_raw:!1}function Ae(n){const e=n&&n.__v_raw;return e?Ae(e):n}function tx(n){return!Ne(n,"__v_skip")&&Object.isExtensible(n)&&nd(n,"__v_skip",!0),n}const zn=n=>Ue(n)?ya(n):n,ks=n=>Ue(n)?_a(n):n;function tt(n){return n?n.__v_isRef===!0:!1}function kc(n){return Cd(n,!1)}function hi(n){return Cd(n,!0)}function Cd(n,e){return tt(n)?n:new nx(n,e)}class nx{constructor(e,t){this.dep=new fa,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Ae(e),this._value=t?e:zn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||Yt(e)||ui(e);e=i?e:Ae(e),yn(e,t)&&(this._rawValue=e,this._value=i?e:zn(e),this.dep.trigger())}}function Ns(n){return tt(n)?n.value:n}function fi(n){return ve(n)?n():Ns(n)}const ix={get:(n,e,t)=>e==="__v_raw"?n:Ns(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const r=n[e];return tt(r)&&!tt(t)?(r.value=t,!0):Reflect.set(n,e,t,i)}};function Td(n){return Mr(n)?n:new Proxy(n,ix)}class rx{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new fa,{get:i,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function sx(n){return new rx(n)}class ox{constructor(e,t,i){this._object=e,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=mn(t)?t:String(t),this._raw=Ae(e);let r=!0,s=e;if(!Ee(e)||mn(this._key)||!la(this._key))do r=!va(s)||Yt(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=Ns(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&tt(this._raw[this._key])){const t=this._object[this._key];if(tt(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return z0(this._raw,this._key)}}class ax{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function wa(n,e,t){return tt(n)?n:ve(n)?new ax(n):Ue(n)&&arguments.length>1?lx(n,e,t):kc(n)}function lx(n,e,t){return new ox(n,e,t)}class cx{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new fa(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Be!==this)return ld(this,!0),!0}get value(){const e=this.dep.track();return hd(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function ux(n,e,t=!1){let i,r;return ve(n)?i=n:(i=n.get,r=n.set),new cx(i,r,t)}const Ea={},ba=new WeakMap;let Ui;function hx(n,e=!1,t=Ui){if(t){let i=ba.get(t);i||ba.set(t,i=[]),i.push(n)}}function fx(n,e,t=Xe){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=t,c=x=>r?x:Yt(x)||r===!1||r===0?di(x,1):di(x);let u,h,f,d,g=!1,p=!1;if(tt(n)?(h=()=>n.value,g=Yt(n)):Mr(n)?(h=()=>c(n),g=!0):Ee(n)?(p=!0,g=n.some(x=>Mr(x)||Yt(x)),h=()=>n.map(x=>{if(tt(x))return x.value;if(Mr(x))return c(x);if(ve(x))return l?l(x,2):x()})):ve(n)?e?h=l?()=>l(n,2):n:h=()=>{if(f){_n();try{f()}finally{xn()}}const x=Ui;Ui=u;try{return l?l(n,3,[d]):n(d)}finally{Ui=x}}:h=pn,e&&r){const x=h,v=r===!0?1/0:r;h=()=>di(x(),v)}const m=sd(),y=()=>{u.stop(),m&&m.active&&vc(m.effects,u)};if(s&&e){const x=e;e=(...v)=>{const T=x(...v);return y(),T}}let _=p?new Array(n.length).fill(Ea):Ea;const w=x=>{if(!(!(u.flags&1)||!u.dirty&&!x))if(e){const v=u.run();if(x||r||g||(p?v.some((T,R)=>yn(T,_[R])):yn(v,_))){f&&f();const T=Ui;Ui=u;try{const R=[v,_===Ea?void 0:p&&_[0]===Ea?[]:_,d];_=v,l?l(e,3,R):e(...R)}finally{Ui=T}}}else u.run()};return a&&a(w),u=new od(h),u.scheduler=o?()=>o(w,!1):w,d=x=>hx(x,!1,u),f=u.onStop=()=>{const x=ba.get(u);if(x){if(l)l(x,4);else for(const v of x)v();ba.delete(u)}},e?i?w(!0):_=u.run():o?o(w.bind(null,!0),!0):u.run(),y.pause=u.pause.bind(u),y.resume=u.resume.bind(u),y.stop=y,y}function di(n,e=1/0,t){if(e<=0||!Ue(n)||n.__v_skip||(t=t||new Map,(t.get(n)||0)>=e))return n;if(t.set(n,e),e--,tt(n))di(n.value,e,t);else if(Ee(n))for(let i=0;i<n.length;i++)di(n[i],e,t);else if(w0(n)||Is(n))n.forEach(i=>{di(i,e,t)});else if(C0(n)){for(const i in n)di(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&di(n[i],e,t)}return n}const zs=[];let Nc=!1;function FI(n,...e){if(Nc)return;Nc=!0,_n();const t=zs.length?zs[zs.length-1].component:null,i=t&&t.appContext.config.warnHandler,r=dx();if(i)Ar(i,t,11,[n+e.map(s=>{var o,a;return(a=(o=s.toString)==null?void 0:o.call(s))!=null?a:JSON.stringify(s)}).join(""),t&&t.proxy,r.map(({vnode:s})=>`at <${vg(t,s.type)}>`).join(`
2
2
  `),r]);else{const s=[`[Vue warn]: ${n}`,...e];r.length&&s.push(`
3
- `,...gx(r)),console.warn(...s)}_n(),Nc=!1}function dx(){let n=zs[zs.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const i=n.component&&n.component.parent;n=i&&i.vnode}return e}function gx(n){const e=[];return n.forEach((t,i)=>{e.push(...i===0?[]:[`
4
- `],...px(t))}),e}function px({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",i=n.component?n.component.parent==null:!1,r=` at <${vg(n.component,n.type,i)}`,s=">"+t;return n.props?[r,...mx(n.props),s]:[r+s]}function mx(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(i=>{e.push(...Rd(i,n[i]))}),t.length>3&&e.push(" ..."),e}function Rd(n,e,t){return st(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:tt(e)?(e=Rd(n,Ae(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):ve(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=Ae(e),t?e:[`${n}=`,e])}function Mr(n,e,t,i){try{return i?n(...i):n()}catch(r){Ca(r,e,t)}}function on(n,e,t,i){if(ve(n)){const r=Mr(n,e,t,i);return r&&ed(r)&&r.catch(s=>{Ca(s,e,t)}),r}if(Ee(n)){const r=[];for(let s=0;s<n.length;s++)r.push(on(n[s],e,t,i));return r}}function Ca(n,e,t,i=!0){const r=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||Xe;if(e){let a=e.parent;const l=e.proxy,c=`https://vuejs.org/error-reference/#runtime-${t}`;for(;a;){const u=a.ec;if(u){for(let h=0;h<u.length;h++)if(u[h](n,l,c)===!1)return}a=a.parent}if(s){yn(),Mr(s,null,10,[n,l,c]),_n();return}}yx(n,t,r,i,o)}function yx(n,e,t,i=!0,r=!1){if(r)throw n;console.error(n)}const Rt=[];let vn=-1;const Ar=[];let gi=null,Pr=0;const Sd=Promise.resolve();let Ta=null;function zc(n){const e=Ta||Sd;return n?e.then(this?n.bind(this):n):e}function _x(n){let e=vn+1,t=Rt.length;for(;e<t;){const i=e+t>>>1,r=Rt[i],s=Gs(r);s<n||s===n&&r.flags&2?e=i+1:t=i}return e}function Gc(n){if(!(n.flags&1)){const e=Gs(n),t=Rt[Rt.length-1];!t||!(n.flags&2)&&e>=Gs(t)?Rt.push(n):Rt.splice(_x(e),0,n),n.flags|=1,Id()}}function Id(){Ta||(Ta=Sd.then(Pd))}function xx(n){Ee(n)?Ar.push(...n):gi&&n.id===-1?gi.splice(Pr+1,0,n):n.flags&1||(Ar.push(n),n.flags|=1),Id()}function Md(n,e,t=vn+1){for(;t<Rt.length;t++){const i=Rt[t];if(i&&i.flags&2){if(n&&i.id!==n.uid)continue;Rt.splice(t,1),t--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function Ad(n){if(Ar.length){const e=[...new Set(Ar)].sort((t,i)=>Gs(t)-Gs(i));if(Ar.length=0,gi){gi.push(...e);return}for(gi=e,Pr=0;Pr<gi.length;Pr++){const t=gi[Pr];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}gi=null,Pr=0}}const Gs=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Pd(n){try{for(vn=0;vn<Rt.length;vn++){const e=Rt[vn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Mr(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;vn<Rt.length;vn++){const e=Rt[vn];e&&(e.flags&=-2)}vn=-1,Rt.length=0,Ad(),Ta=null,(Rt.length||Ar.length)&&Pd()}}let wn=null,Fd=null;function Ra(n){const e=wn;return wn=n,Fd=n&&n.type.__scopeId||null,e}function vx(n,e=wn,t){if(!e||n._n)return n;const i=(...r)=>{i._d&&fg(-1);const s=Ra(e);let o;try{o=n(...r)}finally{Ra(s),i._d&&fg(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Ui(n,e,t,i){const r=n.dirs,s=e&&e.dirs;for(let o=0;o<r.length;o++){const a=r[o];s&&(a.oldValue=s[o].value);let l=a.dir[i];l&&(yn(),on(l,t,8,[n.el,a,n,e]),_n())}}function wx(n,e){if(It){let t=It.provides;const i=It.parent&&It.parent.provides;i===t&&(t=It.provides=Object.create(i)),t[n]=e}}function Fr(n,e,t=!1){const i=b1();if(i||Or){let r=Or?Or._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&n in r)return r[n];if(arguments.length>1)return t&&ve(e)?e.call(i&&i.proxy):e}}const Ex=Symbol.for("v-scx"),bx=()=>Fr(Ex);function Cx(n,e){return jc(n,null,e)}function pi(n,e,t){return jc(n,e,t)}function jc(n,e,t=Xe){const{immediate:i,deep:r,flush:s,once:o}=t,a=_t({},t),l=e&&i||!e&&s!=="post";let c;if(Ys){if(s==="sync"){const d=bx();c=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=gn,d.resume=gn,d.pause=gn,d}}const u=It;a.call=(d,g,p)=>on(d,u,g,p);let h=!1;s==="post"?a.scheduler=d=>{kt(d,u&&u.suspense)}:s!=="sync"&&(h=!0,a.scheduler=(d,g)=>{g?d():Gc(d)}),a.augmentJob=d=>{e&&(d.flags|=4),h&&(d.flags|=2,u&&(d.id=u.uid,d.i=u))};const f=fx(n,e,a);return Ys&&(c?c.push(f):l&&f()),f}function Tx(n,e,t){const i=this.proxy,r=st(n)?n.includes(".")?Od(i,n):()=>i[n]:n.bind(i,i);let s;ve(e)?s=e:(s=e.handler,t=e);const o=Ks(this),a=jc(r,s.bind(i),t);return o(),a}function Od(n,e){const t=e.split(".");return()=>{let i=n;for(let r=0;r<t.length&&i;r++)i=i[t[r]];return i}}const Rx=Symbol("_vte"),Sx=n=>n.__isTeleport,Wc=Symbol("_leaveCb");function Vc(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Vc(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function Ld(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}function Dd(n,e){let t;return!!((t=Object.getOwnPropertyDescriptor(n,e))&&!t.configurable)}const Sa=new WeakMap;function js(n,e,t,i,r=!1){if(Ee(n)){n.forEach((p,m)=>js(p,e&&(Ee(e)?e[m]:e),t,i,r));return}if(Ws(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&js(n,e,t,i.component.subTree);return}const s=i.shapeFlag&4?eu(i.component):i.el,o=r?null:s,{i:a,r:l}=n,c=e&&e.r,u=a.refs===Xe?a.refs={}:a.refs,h=a.setupState,f=Ae(h),d=h===Xe?Jf:p=>Dd(u,p)?!1:Ne(f,p),g=(p,m)=>!(m&&Dd(u,m));if(c!=null&&c!==l){if(kd(e),st(c))u[c]=null,d(c)&&(h[c]=null);else if(tt(c)){const p=e;g(c,p.k)&&(c.value=null),p.k&&(u[p.k]=null)}}if(ve(l))Mr(l,a,12,[o,u]);else{const p=st(l),m=tt(l);if(p||m){const y=()=>{if(n.f){const _=p?d(l)?h[l]:u[l]:g()||!n.k?l.value:u[n.k];if(r)Ee(_)&&vc(_,s);else if(Ee(_))_.includes(s)||_.push(s);else if(p)u[l]=[s],d(l)&&(h[l]=u[l]);else{const v=[s];g(l,n.k)&&(l.value=v),n.k&&(u[n.k]=v)}}else p?(u[l]=o,d(l)&&(h[l]=o)):m&&(g(l,n.k)&&(l.value=o),n.k&&(u[n.k]=o))};if(o){const _=()=>{y(),Sa.delete(n)};_.id=-1,Sa.set(n,_),kt(_,t)}else kd(n),y()}}}function kd(n){const e=Sa.get(n);e&&(e.flags|=8,Sa.delete(n))}ua().requestIdleCallback,ua().cancelIdleCallback;const Ws=n=>!!n.type.__asyncLoader,Nd=n=>n.type.__isKeepAlive;function Ix(n,e){zd(n,"a",e)}function Mx(n,e){zd(n,"da",e)}function zd(n,e,t=It){const i=n.__wdc||(n.__wdc=()=>{let r=t;for(;r;){if(r.isDeactivated)return;r=r.parent}return n()});if(Ia(e,i,t),t){let r=t.parent;for(;r&&r.parent;)Nd(r.parent.vnode)&&Ax(i,e,t,r),r=r.parent}}function Ax(n,e,t,i){const r=Ia(e,n,i,!0);jd(()=>{vc(i[e],r)},t)}function Ia(n,e,t=It,i=!1){if(t){const r=t[n]||(t[n]=[]),s=e.__weh||(e.__weh=(...o)=>{yn();const a=Ks(t),l=on(e,t,n,o);return a(),_n(),l});return i?r.unshift(s):r.push(s),s}}const zn=n=>(e,t=It)=>{(!Ys||n==="sp")&&Ia(n,(...i)=>e(...i),t)},Px=zn("bm"),Gd=zn("m"),Fx=zn("bu"),Ox=zn("u"),Lx=zn("bum"),jd=zn("um"),Dx=zn("sp"),kx=zn("rtg"),Nx=zn("rtc");function zx(n,e=It){Ia("ec",n,e)}const Gx=Symbol.for("v-ndc"),Xc=n=>n?yg(n)?eu(n):Xc(n.parent):null,Vs=_t(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>Xc(n.parent),$root:n=>Xc(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>Ud(n),$forceUpdate:n=>n.f||(n.f=()=>{Gc(n.update)}),$nextTick:n=>n.n||(n.n=zc.bind(n.proxy)),$watch:n=>Tx.bind(n)}),Uc=(n,e)=>n!==Xe&&!n.__isScriptSetup&&Ne(n,e),jx={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=n;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return r[e];case 4:return t[e];case 3:return s[e]}else{if(Uc(i,e))return o[e]=1,i[e];if(r!==Xe&&Ne(r,e))return o[e]=2,r[e];if(Ne(s,e))return o[e]=3,s[e];if(t!==Xe&&Ne(t,e))return o[e]=4,t[e];Bc&&(o[e]=0)}}const c=Vs[e];let u,h;if(c)return e==="$attrs"&&xt(n.attrs,"get",""),c(n);if((u=a.__cssModules)&&(u=u[e]))return u;if(t!==Xe&&Ne(t,e))return o[e]=4,t[e];if(h=l.config.globalProperties,Ne(h,e))return h[e]},set({_:n},e,t){const{data:i,setupState:r,ctx:s}=n;return Uc(r,e)?(r[e]=t,!0):i!==Xe&&Ne(i,e)?(i[e]=t,!0):Ne(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(s[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:r,props:s,type:o}},a){let l;return!!(t[a]||n!==Xe&&a[0]!=="$"&&Ne(n,a)||Uc(e,a)||Ne(s,a)||Ne(i,a)||Ne(Vs,a)||Ne(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Ne(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function Wd(n){return Ee(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let Bc=!0;function Wx(n){const e=Ud(n),t=n.proxy,i=n.ctx;Bc=!1,e.beforeCreate&&Vd(e.beforeCreate,n,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:h,mounted:f,beforeUpdate:d,updated:g,activated:p,deactivated:m,beforeDestroy:y,beforeUnmount:_,destroyed:v,unmounted:x,render:w,renderTracked:T,renderTriggered:R,errorCaptured:C,serverPrefetch:S,expose:L,inheritAttrs:B,components:K,directives:F,filters:P}=e;if(c&&Vx(c,i,null),o)for(const X in o){const z=o[X];ve(z)&&(i[X]=z.bind(t))}if(r){const X=r.call(t,t);Ue(X)&&(n.data=ya(X))}if(Bc=!0,s)for(const X in s){const z=s[X],M=ve(z)?z.bind(t,t):ve(z.get)?z.get.bind(t,t):gn,ne=!ve(z)&&ve(z.set)?z.set.bind(t):gn,le=Ki({get:M,set:ne});Object.defineProperty(i,X,{enumerable:!0,configurable:!0,get:()=>le.value,set:ge=>le.value=ge})}if(a)for(const X in a)Xd(a[X],i,t,X);if(l){const X=ve(l)?l.call(t):l;Reflect.ownKeys(X).forEach(z=>{wx(z,X[z])})}u&&Vd(u,n,"c");function W(X,z){Ee(z)?z.forEach(M=>X(M.bind(t))):z&&X(z.bind(t))}if(W(Px,h),W(Gd,f),W(Fx,d),W(Ox,g),W(Ix,p),W(Mx,m),W(zx,C),W(Nx,T),W(kx,R),W(Lx,_),W(jd,x),W(Dx,S),Ee(L))if(L.length){const X=n.exposed||(n.exposed={});L.forEach(z=>{Object.defineProperty(X,z,{get:()=>t[z],set:M=>t[z]=M,enumerable:!0})})}else n.exposed||(n.exposed={});w&&n.render===gn&&(n.render=w),B!=null&&(n.inheritAttrs=B),K&&(n.components=K),F&&(n.directives=F),S&&Ld(n)}function Vx(n,e,t=gn){Ee(n)&&(n=$c(n));for(const i in n){const r=n[i];let s;Ue(r)?"default"in r?s=Fr(r.from||i,r.default,!0):s=Fr(r.from||i):s=Fr(r),tt(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function Vd(n,e,t){on(Ee(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function Xd(n,e,t,i){let r=i.includes(".")?Od(t,i):()=>t[i];if(st(n)){const s=e[n];ve(s)&&pi(r,s)}else if(ve(n))pi(r,n.bind(t));else if(Ue(n))if(Ee(n))n.forEach(s=>Xd(s,e,t,i));else{const s=ve(n.handler)?n.handler.bind(t):e[n.handler];ve(s)&&pi(r,s,n)}}function Ud(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=n.appContext,a=s.get(e);let l;return a?l=a:!r.length&&!t&&!i?l=e:(l={},r.length&&r.forEach(c=>Ma(l,c,o,!0)),Ma(l,e,o)),Ue(e)&&s.set(e,l),l}function Ma(n,e,t,i=!1){const{mixins:r,extends:s}=e;s&&Ma(n,s,t,!0),r&&r.forEach(o=>Ma(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=Xx[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const Xx={data:Bd,props:$d,emits:$d,methods:Xs,computed:Xs,beforeCreate:St,created:St,beforeMount:St,mounted:St,beforeUpdate:St,updated:St,beforeDestroy:St,beforeUnmount:St,destroyed:St,unmounted:St,activated:St,deactivated:St,errorCaptured:St,serverPrefetch:St,components:Xs,directives:Xs,watch:Bx,provide:Bd,inject:Ux};function Bd(n,e){return e?n?function(){return _t(ve(n)?n.call(this,this):n,ve(e)?e.call(this,this):e)}:e:n}function Ux(n,e){return Xs($c(n),$c(e))}function $c(n){if(Ee(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function St(n,e){return n?[...new Set([].concat(n,e))]:e}function Xs(n,e){return n?_t(Object.create(null),n,e):e}function $d(n,e){return n?Ee(n)&&Ee(e)?[...new Set([...n,...e])]:_t(Object.create(null),Wd(n),Wd(e??{})):e}function Bx(n,e){if(!n)return e;if(!e)return n;const t=_t(Object.create(null),n);for(const i in e)t[i]=St(n[i],e[i]);return t}function Kd(){return{app:null,config:{isNativeTag:Jf,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let $x=0;function Kx(n,e){return function(i,r=null){ve(i)||(i=_t({},i)),r!=null&&!Ue(r)&&(r=null);const s=Kd(),o=new WeakSet,a=[];let l=!1;const c=s.app={_uid:$x++,_component:i,_props:r,_container:null,_context:s,_instance:null,version:F1,get config(){return s.config},set config(u){},use(u,...h){return o.has(u)||(u&&ve(u.install)?(o.add(u),u.install(c,...h)):ve(u)&&(o.add(u),u(c,...h))),c},mixin(u){return s.mixins.includes(u)||s.mixins.push(u),c},component(u,h){return h?(s.components[u]=h,c):s.components[u]},directive(u,h){return h?(s.directives[u]=h,c):s.directives[u]},mount(u,h,f){if(!l){const d=c._ceVNode||$i(i,r);return d.appContext=s,f===!0?f="svg":f===!1&&(f=void 0),n(d,u,f),l=!0,c._container=u,u.__vue_app__=c,eu(d.component)}},onUnmount(u){a.push(u)},unmount(){l&&(on(a,c._instance,16),n(null,c._container),delete c._container.__vue_app__)},provide(u,h){return s.provides[u]=h,c},runWithContext(u){const h=Or;Or=c;try{return u()}finally{Or=h}}};return c}}let Or=null;const Yx=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${rn(e)}Modifiers`]||n[`${Wi(e)}Modifiers`];function Zx(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||Xe;let r=t;const s=e.startsWith("update:"),o=s&&Yx(i,e.slice(7));o&&(o.trim&&(r=t.map(u=>st(u)?u.trim():u)),o.number&&(r=t.map(S0)));let a,l=i[a=wc(e)]||i[a=wc(rn(e))];!l&&s&&(l=i[a=wc(Wi(e))]),l&&on(l,n,6,r);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,on(c,n,6,r)}}const qx=new WeakMap;function Yd(n,e,t=!1){const i=t?qx:e.emitsCache,r=i.get(n);if(r!==void 0)return r;const s=n.emits;let o={},a=!1;if(!ve(n)){const l=c=>{const u=Yd(c,e,!0);u&&(a=!0,_t(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!s&&!a?(Ue(n)&&i.set(n,null),null):(Ee(s)?s.forEach(l=>o[l]=null):_t(o,s),Ue(n)&&i.set(n,o),o)}function Aa(n,e){return!n||!oa(e)?!1:(e=e.slice(2).replace(/Once$/,""),Ne(n,e[0].toLowerCase()+e.slice(1))||Ne(n,Wi(e))||Ne(n,e))}function OI(){}function Zd(n){const{type:e,vnode:t,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:h,data:f,setupState:d,ctx:g,inheritAttrs:p}=n,m=Ra(n);let y,_;try{if(t.shapeFlag&4){const x=r||i,w=x;y=En(c.call(w,x,u,h,d,f,g)),_=a}else{const x=e;y=En(x.length>1?x(h,{attrs:a,slots:o,emit:l}):x(h,null)),_=e.props?a:Hx(a)}}catch(x){Us.length=0,Ca(x,n,1),y=$i(Lr)}let v=y;if(_&&p!==!1){const x=Object.keys(_),{shapeFlag:w}=v;x.length&&w&7&&(s&&x.some(aa)&&(_=Jx(_,s)),v=Dr(v,_,!1,!0))}return t.dirs&&(v=Dr(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(t.dirs):t.dirs),t.transition&&Vc(v,t.transition),y=v,Ra(m),y}const Hx=n=>{let e;for(const t in n)(t==="class"||t==="style"||oa(t))&&((e||(e={}))[t]=n[t]);return e},Jx=(n,e)=>{const t={};for(const i in n)(!aa(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function Qx(n,e,t){const{props:i,children:r,component:s}=n,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?qd(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let h=0;h<u.length;h++){const f=u[h];if(Hd(o,i,f)&&!Aa(c,f))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:i===o?!1:i?o?qd(i,o,c):!0:!!o;return!1}function qd(n,e,t){const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!0;for(let r=0;r<i.length;r++){const s=i[r];if(Hd(e,n,s)&&!Aa(t,s))return!0}return!1}function Hd(n,e,t){const i=n[t],r=e[t];return t==="style"&&Ue(i)&&Ue(r)?!Cc(i,r):i!==r}function e1({vnode:n,parent:e,suspense:t},i){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===n&&(r.suspense.vnode.el=r.el=i,n=r),r===n)(n=e.vnode).el=i,e=e.parent;else break}t&&t.activeBranch===n&&(t.vnode.el=i)}const Jd={},Qd=()=>Object.create(Jd),eg=n=>Object.getPrototypeOf(n)===Jd;function t1(n,e,t,i=!1){const r={},s=Qd();n.propsDefaults=Object.create(null),tg(n,e,r,s);for(const o in n.propsOptions[0])o in r||(r[o]=void 0);t?n.props=i?r:ex(r):n.type.props?n.props=r:n.props=s,n.attrs=s}function n1(n,e,t,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=n,a=Ae(r),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let h=0;h<u.length;h++){let f=u[h];if(Aa(n.emitsOptions,f))continue;const d=e[f];if(l)if(Ne(s,f))d!==s[f]&&(s[f]=d,c=!0);else{const g=rn(f);r[g]=Kc(l,a,g,d,n,!1)}else d!==s[f]&&(s[f]=d,c=!0)}}}else{tg(n,e,r,s)&&(c=!0);let u;for(const h in a)(!e||!Ne(e,h)&&((u=Wi(h))===h||!Ne(e,u)))&&(l?t&&(t[h]!==void 0||t[u]!==void 0)&&(r[h]=Kc(l,a,h,void 0,n,!0)):delete r[h]);if(s!==a)for(const h in s)(!e||!Ne(e,h))&&(delete s[h],c=!0)}c&&Dn(n.attrs,"set","")}function tg(n,e,t,i){const[r,s]=n.propsOptions;let o=!1,a;if(e)for(let l in e){if(As(l))continue;const c=e[l];let u;r&&Ne(r,u=rn(l))?!s||!s.includes(u)?t[u]=c:(a||(a={}))[u]=c:Aa(n.emitsOptions,l)||(!(l in i)||c!==i[l])&&(i[l]=c,o=!0)}if(s){const l=Ae(t),c=a||Xe;for(let u=0;u<s.length;u++){const h=s[u];t[h]=Kc(r,l,h,c[h],n,!Ne(c,h))}}return o}function Kc(n,e,t,i,r,s){const o=n[t];if(o!=null){const a=Ne(o,"default");if(a&&i===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&ve(l)){const{propsDefaults:c}=r;if(t in c)i=c[t];else{const u=Ks(r);i=c[t]=l.call(null,e),u()}}else i=l;r.ce&&r.ce._setProp(t,i)}o[0]&&(s&&!a?i=!1:o[1]&&(i===""||i===Wi(t))&&(i=!0))}return i}const i1=new WeakMap;function ng(n,e,t=!1){const i=t?i1:e.propsCache,r=i.get(n);if(r)return r;const s=n.props,o={},a=[];let l=!1;if(!ve(n)){const u=h=>{l=!0;const[f,d]=ng(h,e,!0);_t(o,f),d&&a.push(...d)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!s&&!l)return Ue(n)&&i.set(n,Rr),Rr;if(Ee(s))for(let u=0;u<s.length;u++){const h=rn(s[u]);ig(h)&&(o[h]=Xe)}else if(s)for(const u in s){const h=rn(u);if(ig(h)){const f=s[u],d=o[h]=Ee(f)||ve(f)?{type:f}:_t({},f),g=d.type;let p=!1,m=!0;if(Ee(g))for(let y=0;y<g.length;++y){const _=g[y],v=ve(_)&&_.name;if(v==="Boolean"){p=!0;break}else v==="String"&&(m=!1)}else p=ve(g)&&g.name==="Boolean";d[0]=p,d[1]=m,(p||Ne(d,"default"))&&a.push(h)}}const c=[o,a];return Ue(n)&&i.set(n,c),c}function ig(n){return n[0]!=="$"&&!As(n)}const Yc=n=>n==="_"||n==="_ctx"||n==="$stable",Zc=n=>Ee(n)?n.map(En):[En(n)],r1=(n,e,t)=>{if(e._n)return e;const i=vx((...r)=>Zc(e(...r)),t);return i._c=!1,i},rg=(n,e,t)=>{const i=n._ctx;for(const r in n){if(Yc(r))continue;const s=n[r];if(ve(s))e[r]=r1(r,s,i);else if(s!=null){const o=Zc(s);e[r]=()=>o}}},sg=(n,e)=>{const t=Zc(e);n.slots.default=()=>t},og=(n,e,t)=>{for(const i in e)(t||!Yc(i))&&(n[i]=e[i])},s1=(n,e,t)=>{const i=n.slots=Qd();if(n.vnode.shapeFlag&32){const r=e._;r?(og(i,e,t),t&&nd(i,"_",r,!0)):rg(e,i)}else e&&sg(n,e)},o1=(n,e,t)=>{const{vnode:i,slots:r}=n;let s=!0,o=Xe;if(i.shapeFlag&32){const a=e._;a?t&&a===1?s=!1:og(r,e,t):(s=!e.$stable,rg(e,r)),o=e}else e&&(sg(n,e),o={default:1});if(s)for(const a in r)!Yc(a)&&o[a]==null&&delete r[a]},kt=h1;function a1(n){return l1(n)}function l1(n,e){const t=ua();t.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:h,nextSibling:f,setScopeId:d=gn,insertStaticContent:g}=n,p=(E,b,I,D=null,A=null,O=null,V=void 0,U=null,$=!!b.dynamicChildren)=>{if(E===b)return;E&&!$s(E,b)&&(D=Ie(E),ge(E,A,O,!0),E=null),b.patchFlag===-2&&($=!1,b.dynamicChildren=null);const{type:N,ref:ee,shapeFlag:Q}=b;switch(N){case Pa:m(E,b,I,D);break;case Lr:y(E,b,I,D);break;case Hc:E==null&&_(b,I,D,V);break;case Gn:K(E,b,I,D,A,O,V,U,$);break;default:Q&1?w(E,b,I,D,A,O,V,U,$):Q&6?F(E,b,I,D,A,O,V,U,$):(Q&64||Q&128)&&N.process(E,b,I,D,A,O,V,U,$,k)}ee!=null&&A?js(ee,E&&E.ref,O,b||E,!b):ee==null&&E&&E.ref!=null&&js(E.ref,null,O,E,!0)},m=(E,b,I,D)=>{if(E==null)i(b.el=a(b.children),I,D);else{const A=b.el=E.el;b.children!==E.children&&c(A,b.children)}},y=(E,b,I,D)=>{E==null?i(b.el=l(b.children||""),I,D):b.el=E.el},_=(E,b,I,D)=>{[E.el,E.anchor]=g(E.children,b,I,D,E.el,E.anchor)},v=({el:E,anchor:b},I,D)=>{let A;for(;E&&E!==b;)A=f(E),i(E,I,D),E=A;i(b,I,D)},x=({el:E,anchor:b})=>{let I;for(;E&&E!==b;)I=f(E),r(E),E=I;r(b)},w=(E,b,I,D,A,O,V,U,$)=>{if(b.type==="svg"?V="svg":b.type==="math"&&(V="mathml"),E==null)T(b,I,D,A,O,V,U,$);else{const N=E.el&&E.el._isVueCE?E.el:null;try{N&&N._beginPatch(),S(E,b,A,O,V,U,$)}finally{N&&N._endPatch()}}},T=(E,b,I,D,A,O,V,U)=>{let $,N;const{props:ee,shapeFlag:Q,transition:Y,dirs:Z}=E;if($=E.el=o(E.type,O,ee&&ee.is,ee),Q&8?u($,E.children):Q&16&&C(E.children,$,null,D,A,qc(E,O),V,U),Z&&Ui(E,null,D,"created"),R($,E,E.scopeId,V,D),ee){for(const ae in ee)ae!=="value"&&!As(ae)&&s($,ae,null,ee[ae],O,D);"value"in ee&&s($,"value",null,ee.value,O),(N=ee.onVnodeBeforeMount)&&bn(N,D,E)}Z&&Ui(E,null,D,"beforeMount");const q=c1(A,Y);q&&Y.beforeEnter($),i($,b,I),((N=ee&&ee.onVnodeMounted)||q||Z)&&kt(()=>{N&&bn(N,D,E),q&&Y.enter($),Z&&Ui(E,null,D,"mounted")},A)},R=(E,b,I,D,A)=>{if(I&&d(E,I),D)for(let O=0;O<D.length;O++)d(E,D[O]);if(A){let O=A.subTree;if(b===O||hg(O.type)&&(O.ssContent===b||O.ssFallback===b)){const V=A.vnode;R(E,V,V.scopeId,V.slotScopeIds,A.parent)}}},C=(E,b,I,D,A,O,V,U,$=0)=>{for(let N=$;N<E.length;N++){const ee=E[N]=U?jn(E[N]):En(E[N]);p(null,ee,b,I,D,A,O,V,U)}},S=(E,b,I,D,A,O,V)=>{const U=b.el=E.el;let{patchFlag:$,dynamicChildren:N,dirs:ee}=b;$|=E.patchFlag&16;const Q=E.props||Xe,Y=b.props||Xe;let Z;if(I&&Bi(I,!1),(Z=Y.onVnodeBeforeUpdate)&&bn(Z,I,b,E),ee&&Ui(b,E,I,"beforeUpdate"),I&&Bi(I,!0),(Q.innerHTML&&Y.innerHTML==null||Q.textContent&&Y.textContent==null)&&u(U,""),N?L(E.dynamicChildren,N,U,I,D,qc(b,A),O):V||z(E,b,U,null,I,D,qc(b,A),O,!1),$>0){if($&16)B(U,Q,Y,I,A);else if($&2&&Q.class!==Y.class&&s(U,"class",null,Y.class,A),$&4&&s(U,"style",Q.style,Y.style,A),$&8){const q=b.dynamicProps;for(let ae=0;ae<q.length;ae++){const ce=q[ae],se=Q[ce],fe=Y[ce];(fe!==se||ce==="value")&&s(U,ce,se,fe,A,I)}}$&1&&E.children!==b.children&&u(U,b.children)}else!V&&N==null&&B(U,Q,Y,I,A);((Z=Y.onVnodeUpdated)||ee)&&kt(()=>{Z&&bn(Z,I,b,E),ee&&Ui(b,E,I,"updated")},D)},L=(E,b,I,D,A,O,V)=>{for(let U=0;U<b.length;U++){const $=E[U],N=b[U],ee=$.el&&($.type===Gn||!$s($,N)||$.shapeFlag&198)?h($.el):I;p($,N,ee,null,D,A,O,V,!0)}},B=(E,b,I,D,A)=>{if(b!==I){if(b!==Xe)for(const O in b)!As(O)&&!(O in I)&&s(E,O,b[O],null,A,D);for(const O in I){if(As(O))continue;const V=I[O],U=b[O];V!==U&&O!=="value"&&s(E,O,U,V,A,D)}"value"in I&&s(E,"value",b.value,I.value,A)}},K=(E,b,I,D,A,O,V,U,$)=>{const N=b.el=E?E.el:a(""),ee=b.anchor=E?E.anchor:a("");let{patchFlag:Q,dynamicChildren:Y,slotScopeIds:Z}=b;Z&&(U=U?U.concat(Z):Z),E==null?(i(N,I,D),i(ee,I,D),C(b.children||[],I,ee,A,O,V,U,$)):Q>0&&Q&64&&Y&&E.dynamicChildren&&E.dynamicChildren.length===Y.length?(L(E.dynamicChildren,Y,I,A,O,V,U),(b.key!=null||A&&b===A.subTree)&&ag(E,b,!0)):z(E,b,I,ee,A,O,V,U,$)},F=(E,b,I,D,A,O,V,U,$)=>{b.slotScopeIds=U,E==null?b.shapeFlag&512?A.ctx.activate(b,I,D,V,$):P(b,I,D,A,O,V,$):oe(E,b,$)},P=(E,b,I,D,A,O,V)=>{const U=E.component=E1(E,D,A);if(Nd(E)&&(U.ctx.renderer=k),C1(U,!1,V),U.asyncDep){if(A&&A.registerDep(U,W,V),!E.el){const $=U.subTree=$i(Lr);y(null,$,b,I),E.placeholder=$.el}}else W(U,E,b,I,A,O,V)},oe=(E,b,I)=>{const D=b.component=E.component;if(Qx(E,b,I))if(D.asyncDep&&!D.asyncResolved){X(D,b,I);return}else D.next=b,D.update();else b.el=E.el,D.vnode=b},W=(E,b,I,D,A,O,V)=>{const U=()=>{if(E.isMounted){let{next:Q,bu:Y,u:Z,parent:q,vnode:ae}=E;{const Fe=lg(E);if(Fe){Q&&(Q.el=ae.el,X(E,Q,V)),Fe.asyncDep.then(()=>{kt(()=>{E.isUnmounted||N()},A)});return}}let ce=Q,se;Bi(E,!1),Q?(Q.el=ae.el,X(E,Q,V)):Q=ae,Y&&Ec(Y),(se=Q.props&&Q.props.onVnodeBeforeUpdate)&&bn(se,q,Q,ae),Bi(E,!0);const fe=Zd(E),Me=E.subTree;E.subTree=fe,p(Me,fe,h(Me.el),Ie(Me),E,A,O),Q.el=fe.el,ce===null&&e1(E,fe.el),Z&&kt(Z,A),(se=Q.props&&Q.props.onVnodeUpdated)&&kt(()=>bn(se,q,Q,ae),A)}else{let Q;const{el:Y,props:Z}=b,{bm:q,m:ae,parent:ce,root:se,type:fe}=E,Me=Ws(b);Bi(E,!1),q&&Ec(q),!Me&&(Q=Z&&Z.onVnodeBeforeMount)&&bn(Q,ce,b),Bi(E,!0);{se.ce&&se.ce._hasShadowRoot()&&se.ce._injectChildStyle(fe,E.parent?E.parent.type:void 0);const Fe=E.subTree=Zd(E);p(null,Fe,I,D,E,A,O),b.el=Fe.el}if(ae&&kt(ae,A),!Me&&(Q=Z&&Z.onVnodeMounted)){const Fe=b;kt(()=>bn(Q,ce,Fe),A)}(b.shapeFlag&256||ce&&Ws(ce.vnode)&&ce.vnode.shapeFlag&256)&&E.a&&kt(E.a,A),E.isMounted=!0,b=I=D=null}};E.scope.on();const $=E.effect=new od(U);E.scope.off();const N=E.update=$.run.bind($),ee=E.job=$.runIfDirty.bind($);ee.i=E,ee.id=E.uid,$.scheduler=()=>Gc(ee),Bi(E,!0),N()},X=(E,b,I)=>{b.component=E;const D=E.vnode.props;E.vnode=b,E.next=null,n1(E,b.props,D,I),o1(E,b.children,I),yn(),Md(E),_n()},z=(E,b,I,D,A,O,V,U,$=!1)=>{const N=E&&E.children,ee=E?E.shapeFlag:0,Q=b.children,{patchFlag:Y,shapeFlag:Z}=b;if(Y>0){if(Y&128){ne(N,Q,I,D,A,O,V,U,$);return}else if(Y&256){M(N,Q,I,D,A,O,V,U,$);return}}Z&8?(ee&16&&he(N,A,O),Q!==N&&u(I,Q)):ee&16?Z&16?ne(N,Q,I,D,A,O,V,U,$):he(N,A,O,!0):(ee&8&&u(I,""),Z&16&&C(Q,I,D,A,O,V,U,$))},M=(E,b,I,D,A,O,V,U,$)=>{E=E||Rr,b=b||Rr;const N=E.length,ee=b.length,Q=Math.min(N,ee);let Y;for(Y=0;Y<Q;Y++){const Z=b[Y]=$?jn(b[Y]):En(b[Y]);p(E[Y],Z,I,null,A,O,V,U,$)}N>ee?he(E,A,O,!0,!1,Q):C(b,I,D,A,O,V,U,$,Q)},ne=(E,b,I,D,A,O,V,U,$)=>{let N=0;const ee=b.length;let Q=E.length-1,Y=ee-1;for(;N<=Q&&N<=Y;){const Z=E[N],q=b[N]=$?jn(b[N]):En(b[N]);if($s(Z,q))p(Z,q,I,null,A,O,V,U,$);else break;N++}for(;N<=Q&&N<=Y;){const Z=E[Q],q=b[Y]=$?jn(b[Y]):En(b[Y]);if($s(Z,q))p(Z,q,I,null,A,O,V,U,$);else break;Q--,Y--}if(N>Q){if(N<=Y){const Z=Y+1,q=Z<ee?b[Z].el:D;for(;N<=Y;)p(null,b[N]=$?jn(b[N]):En(b[N]),I,q,A,O,V,U,$),N++}}else if(N>Y)for(;N<=Q;)ge(E[N],A,O,!0),N++;else{const Z=N,q=N,ae=new Map;for(N=q;N<=Y;N++){const ke=b[N]=$?jn(b[N]):En(b[N]);ke.key!=null&&ae.set(ke.key,N)}let ce,se=0;const fe=Y-q+1;let Me=!1,Fe=0;const $e=new Array(fe);for(N=0;N<fe;N++)$e[N]=0;for(N=Z;N<=Q;N++){const ke=E[N];if(se>=fe){ge(ke,A,O,!0);continue}let Ve;if(ke.key!=null)Ve=ae.get(ke.key);else for(ce=q;ce<=Y;ce++)if($e[ce-q]===0&&$s(ke,b[ce])){Ve=ce;break}Ve===void 0?ge(ke,A,O,!0):($e[Ve-q]=N+1,Ve>=Fe?Fe=Ve:Me=!0,p(ke,b[Ve],I,null,A,O,V,U,$),se++)}const Tt=Me?u1($e):Rr;for(ce=Tt.length-1,N=fe-1;N>=0;N--){const ke=q+N,Ve=b[ke],je=b[ke+1],ut=ke+1<ee?je.el||ug(je):D;$e[N]===0?p(null,Ve,I,ut,A,O,V,U,$):Me&&(ce<0||N!==Tt[ce]?le(Ve,I,ut,2):ce--)}}},le=(E,b,I,D,A=null)=>{const{el:O,type:V,transition:U,children:$,shapeFlag:N}=E;if(N&6){le(E.component.subTree,b,I,D);return}if(N&128){E.suspense.move(b,I,D);return}if(N&64){V.move(E,b,I,k);return}if(V===Gn){i(O,b,I);for(let Q=0;Q<$.length;Q++)le($[Q],b,I,D);i(E.anchor,b,I);return}if(V===Hc){v(E,b,I);return}if(D!==2&&N&1&&U)if(D===0)U.persisted&&!O[Wc]?i(O,b,I):(U.beforeEnter(O),i(O,b,I),kt(()=>U.enter(O),A));else{const{leave:Q,delayLeave:Y,afterLeave:Z}=U,q=()=>{E.ctx.isUnmounted?r(O):i(O,b,I)},ae=()=>{const ce=O._isLeaving||!!O[Wc];O._isLeaving&&O[Wc](!0),U.persisted&&!ce?q():Q(O,()=>{q(),Z&&Z()})};Y?Y(O,q,ae):ae()}else i(O,b,I)},ge=(E,b,I,D=!1,A=!1)=>{const{type:O,props:V,ref:U,children:$,dynamicChildren:N,shapeFlag:ee,patchFlag:Q,dirs:Y,cacheIndex:Z,memo:q}=E;if(Q===-2&&(A=!1),U!=null&&(yn(),js(U,null,I,E,!0),_n()),Z!=null&&(b.renderCache[Z]=void 0),ee&256){b.ctx.deactivate(E);return}const ae=ee&1&&Y,ce=!Ws(E);let se;if(ce&&(se=V&&V.onVnodeBeforeUnmount)&&bn(se,b,E),ee&6)xe(E.component,I,D);else{if(ee&128){E.suspense.unmount(I,D);return}ae&&Ui(E,null,b,"beforeUnmount"),ee&64?E.type.remove(E,b,I,k,D):N&&!N.hasOnce&&(O!==Gn||Q>0&&Q&64)?he(N,b,I,!1,!0):(O===Gn&&Q&384||!A&&ee&16)&&he($,b,I),D&&ze(E)}const fe=q!=null&&Z==null;(ce&&(se=V&&V.onVnodeUnmounted)||ae||fe)&&kt(()=>{se&&bn(se,b,E),ae&&Ui(E,null,b,"unmounted"),fe&&(E.el=null)},I)},ze=E=>{const{type:b,el:I,anchor:D,transition:A}=E;if(b===Gn){G(I,D);return}if(b===Hc){x(E);return}const O=()=>{r(I),A&&!A.persisted&&A.afterLeave&&A.afterLeave()};if(E.shapeFlag&1&&A&&!A.persisted){const{leave:V,delayLeave:U}=A,$=()=>V(I,O);U?U(E.el,O,$):$()}else O()},G=(E,b)=>{let I;for(;E!==b;)I=f(E),r(E),E=I;r(b)},xe=(E,b,I)=>{const{bum:D,scope:A,job:O,subTree:V,um:U,m:$,a:N}=E;cg($),cg(N),D&&Ec(D),A.stop(),O&&(O.flags|=8,ge(V,E,b,I)),U&&kt(U,b),kt(()=>{E.isUnmounted=!0},b)},he=(E,b,I,D=!1,A=!1,O=0)=>{for(let V=O;V<E.length;V++)ge(E[V],b,I,D,A)},Ie=E=>{if(E.shapeFlag&6)return Ie(E.component.subTree);if(E.shapeFlag&128)return E.suspense.next();const b=f(E.anchor||E.el),I=b&&b[Rx];return I?f(I):b};let Pe=!1;const ie=(E,b,I)=>{let D;E==null?b._vnode&&(ge(b._vnode,null,null,!0),D=b._vnode.component):p(b._vnode||null,E,b,null,null,null,I),b._vnode=E,Pe||(Pe=!0,Md(D),Ad(),Pe=!1)},k={p,um:ge,m:le,r:ze,mt:P,mc:C,pc:z,pbc:L,n:Ie,o:n};return{render:ie,hydrate:void 0,createApp:Kx(ie)}}function qc({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Bi({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function c1(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function ag(n,e,t=!1){const i=n.children,r=e.children;if(Ee(i)&&Ee(r))for(let s=0;s<i.length;s++){const o=i[s];let a=r[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=r[s]=jn(r[s]),a.el=o.el),!t&&a.patchFlag!==-2&&ag(o,a)),a.type===Pa&&(a.patchFlag===-1&&(a=r[s]=jn(a)),a.el=o.el),a.type===Lr&&!a.el&&(a.el=o.el)}}function u1(n){const e=n.slice(),t=[0];let i,r,s,o,a;const l=n.length;for(i=0;i<l;i++){const c=n[i];if(c!==0){if(r=t[t.length-1],n[r]<c){e[i]=r,t.push(i);continue}for(s=0,o=t.length-1;s<o;)a=s+o>>1,n[t[a]]<c?s=a+1:o=a;c<n[t[s]]&&(s>0&&(e[i]=t[s-1]),t[s]=i)}}for(s=t.length,o=t[s-1];s-- >0;)t[s]=o,o=e[o];return t}function lg(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:lg(e)}function cg(n){if(n)for(let e=0;e<n.length;e++)n[e].flags|=8}function ug(n){if(n.placeholder)return n.placeholder;const e=n.component;return e?ug(e.subTree):null}const hg=n=>n.__isSuspense;function h1(n,e){e&&e.pendingBranch?Ee(n)?e.effects.push(...n):e.effects.push(n):xx(n)}const Gn=Symbol.for("v-fgt"),Pa=Symbol.for("v-txt"),Lr=Symbol.for("v-cmt"),Hc=Symbol.for("v-stc"),Us=[];let Xt=null;function f1(n=!1){Us.push(Xt=n?null:[])}function d1(){Us.pop(),Xt=Us[Us.length-1]||null}let Bs=1;function fg(n,e=!1){Bs+=n,n<0&&Xt&&e&&(Xt.hasOnce=!0)}function g1(n){return n.dynamicChildren=Bs>0?Xt||Rr:null,d1(),Bs>0&&Xt&&Xt.push(n),n}function p1(n,e,t,i,r,s){return g1(pg(n,e,t,i,r,s,!0))}function dg(n){return n?n.__v_isVNode===!0:!1}function $s(n,e){return n.type===e.type&&n.key===e.key}const gg=({key:n})=>n??null,Fa=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?st(n)||tt(n)||ve(n)?{i:wn,r:n,k:e,f:!!t}:n:null);function pg(n,e=null,t=null,i=0,r=null,s=n===Gn?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&gg(e),ref:e&&Fa(e),scopeId:Fd,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:wn};return a?(Jc(l,t),s&128&&n.normalize(l)):t&&(l.shapeFlag|=st(t)?8:16),Bs>0&&!o&&Xt&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Xt.push(l),l}const $i=m1;function m1(n,e=null,t=null,i=0,r=null,s=!1){if((!n||n===Gx)&&(n=Lr),dg(n)){const a=Dr(n,e,!0);return t&&Jc(a,t),Bs>0&&!s&&Xt&&(a.shapeFlag&6?Xt[Xt.indexOf(n)]=a:Xt.push(a)),a.patchFlag=-2,a}if(P1(n)&&(n=n.__vccOpts),e){e=y1(e);let{class:a,style:l}=e;a&&!st(a)&&(e.class=ha(a)),Ue(l)&&(va(l)&&!Ee(l)&&(l=_t({},l)),e.style=bc(l))}const o=st(n)?1:hg(n)?128:Sx(n)?64:Ue(n)?4:ve(n)?2:0;return pg(n,e,t,i,r,o,s,!0)}function y1(n){return n?va(n)||eg(n)?_t({},n):n:null}function Dr(n,e,t=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=n,c=e?x1(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&gg(c),ref:e&&e.ref?t&&s?Ee(s)?s.concat(Fa(e)):[s,Fa(e)]:Fa(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Gn?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Dr(n.ssContent),ssFallback:n.ssFallback&&Dr(n.ssFallback),placeholder:n.placeholder,el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&Vc(u,l.clone(u)),u}function _1(n=" ",e=0){return $i(Pa,null,n,e)}function En(n){return n==null||typeof n=="boolean"?$i(Lr):Ee(n)?$i(Gn,null,n.slice()):dg(n)?jn(n):$i(Pa,null,String(n))}function jn(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:Dr(n)}function Jc(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(Ee(e))t=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),Jc(n,r()),r._c&&(r._d=!0));return}else{t=32;const r=e._;!r&&!eg(e)?e._ctx=wn:r===3&&wn&&(wn.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else ve(e)?(e={default:e,_ctx:wn},t=32):(e=String(e),i&64?(t=16,e=[_1(e)]):t=8);n.children=e,n.shapeFlag|=t}function x1(...n){const e={};for(let t=0;t<n.length;t++){const i=n[t];for(const r in i)if(r==="class")e.class!==i.class&&(e.class=ha([e.class,i.class]));else if(r==="style")e.style=bc([e.style,i.style]);else if(oa(r)){const s=e[r],o=i[r];o&&s!==o&&!(Ee(s)&&s.includes(o))?e[r]=s?[].concat(s,o):o:o==null&&s==null&&!aa(r)&&(e[r]=o)}else r!==""&&(e[r]=i[r])}return e}function bn(n,e,t,i=null){on(n,e,7,[t,i])}const v1=Kd();let w1=0;function E1(n,e,t){const i=n.type,r=(e?e.appContext:n.appContext)||v1,s={uid:w1++,vnode:n,type:i,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new L0(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ng(i,r),emitsOptions:Yd(i,r),emit:null,emitted:null,propsDefaults:Xe,inheritAttrs:i.inheritAttrs,ctx:Xe,data:Xe,props:Xe,attrs:Xe,slots:Xe,refs:Xe,setupState:Xe,setupContext:null,suspense:t,suspenseId:t?t.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=Zx.bind(null,s),n.ce&&n.ce(s),s}let It=null;const b1=()=>It||wn;let Oa,Qc;{const n=ua(),e=(t,i)=>{let r;return(r=n[t])||(r=n[t]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};Oa=e("__VUE_INSTANCE_SETTERS__",t=>It=t),Qc=e("__VUE_SSR_SETTERS__",t=>Ys=t)}const Ks=n=>{const e=It;return Oa(n),n.scope.on(),()=>{n.scope.off(),Oa(e)}},mg=()=>{It&&It.scope.off(),Oa(null)};function yg(n){return n.vnode.shapeFlag&4}let Ys=!1;function C1(n,e=!1,t=!1){e&&Qc(e);const{props:i,children:r}=n.vnode,s=yg(n);t1(n,i,s,e),s1(n,r,t||e);const o=s?T1(n,e):void 0;return e&&Qc(!1),o}function T1(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,jx);const{setup:i}=t;if(i){yn();const r=n.setupContext=i.length>1?S1(n):null,s=Ks(n),o=Mr(i,n,0,[n.props,r]),a=ed(o);if(_n(),s(),(a||n.sp)&&!Ws(n)&&Ld(n),a){if(o.then(mg,mg),e)return o.then(l=>{_g(n,l)}).catch(l=>{Ca(l,n,0)});n.asyncDep=o}else _g(n,o)}else xg(n)}function _g(n,e,t){ve(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:Ue(e)&&(n.setupState=Td(e)),xg(n)}function xg(n,e,t){const i=n.type;n.render||(n.render=i.render||gn);{const r=Ks(n);yn();try{Wx(n)}finally{_n(),r()}}}const R1={get(n,e){return xt(n,"get",""),n[e]}};function S1(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,R1),slots:n.slots,emit:n.emit,expose:e}}function eu(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(Td(tx(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in Vs)return Vs[t](n)},has(e,t){return t in e||t in Vs}})):n.proxy}const I1=/(?:^|[-_])\w/g,M1=n=>n.replace(I1,e=>e.toUpperCase()).replace(/[-_]/g,"");function A1(n,e=!0){return ve(n)?n.displayName||n.name:n.name||e&&n.__name}function vg(n,e,t=!1){let i=A1(e);if(!i&&e.__file){const r=e.__file.match(/([^/\\]+)\.\w+$/);r&&(i=r[1])}if(!i&&n){const r=s=>{for(const o in s)if(s[o]===e)return o};i=r(n.components)||n.parent&&r(n.parent.type.components)||r(n.appContext.components)}return i?M1(i):t?"App":"Anonymous"}function P1(n){return ve(n)&&"__vccOpts"in n}const Ki=(n,e)=>ux(n,e,Ys),F1="3.5.38";let tu;const wg=typeof window<"u"&&window.trustedTypes;if(wg)try{tu=wg.createPolicy("vue",{createHTML:n=>n})}catch{}const Eg=tu?n=>tu.createHTML(n):n=>n,O1="http://www.w3.org/2000/svg",L1="http://www.w3.org/1998/Math/MathML",Wn=typeof document<"u"?document:null,bg=Wn&&Wn.createElement("template"),D1={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const r=e==="svg"?Wn.createElementNS(O1,n):e==="mathml"?Wn.createElementNS(L1,n):t?Wn.createElement(n,{is:t}):Wn.createElement(n);return n==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:n=>Wn.createTextNode(n),createComment:n=>Wn.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>Wn.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,r,s){const o=t?t.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),t),!(r===s||!(r=r.nextSibling)););else{bg.innerHTML=Eg(i==="svg"?`<svg>${n}</svg>`:i==="mathml"?`<math>${n}</math>`:n);const a=bg.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},k1=Symbol("_vtc");function N1(n,e,t){const i=n[k1];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const Cg=Symbol("_vod"),z1=Symbol("_vsh"),G1=Symbol(""),j1=/(?:^|;)\s*display\s*:/;function W1(n,e,t){const i=n.style,r=st(t);let s=!1;if(t&&!r){if(e)if(st(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&Zs(i,a,"")}else for(const o in e)t[o]==null&&Zs(i,o,"");for(const o in t){o==="display"&&(s=!0);const a=t[o];a!=null?X1(n,o,!st(e)&&e?e[o]:void 0,a)||Zs(i,o,a):Zs(i,o,"")}}else if(r){if(e!==t){const o=i[G1];o&&(t+=";"+o),i.cssText=t,s=j1.test(t)}}else e&&n.removeAttribute("style");Cg in n&&(n[Cg]=s?i.display:"",n[z1]&&(i.display="none"))}const Tg=/\s*!important$/;function Zs(n,e,t){if(Ee(t))t.forEach(i=>Zs(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=V1(n,e);Tg.test(t)?n.setProperty(Wi(i),t.replace(Tg,""),"important"):n[i]=t}}const Rg=["Webkit","Moz","ms"],nu={};function V1(n,e){const t=nu[e];if(t)return t;let i=rn(e);if(i!=="filter"&&i in n)return nu[e]=i;i=td(i);for(let r=0;r<Rg.length;r++){const s=Rg[r]+i;if(s in n)return nu[e]=s}return e}function X1(n,e,t,i){return n.tagName==="TEXTAREA"&&(e==="width"||e==="height")&&st(i)&&t===i}const Sg="http://www.w3.org/1999/xlink";function Ig(n,e,t,i,r,s=F0(e)){i&&e.startsWith("xlink:")?t==null?n.removeAttributeNS(Sg,e.slice(6,e.length)):n.setAttributeNS(Sg,e,t):t==null||s&&!rd(t)?n.removeAttribute(e):n.setAttribute(e,s?"":pn(t)?String(t):t)}function Mg(n,e,t,i,r){if(e==="innerHTML"||e==="textContent"){t!=null&&(n[e]=e==="innerHTML"?Eg(t):t);return}const s=n.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?n.getAttribute("value")||"":n.value,l=t==null?n.type==="checkbox"?"on":"":String(t);(a!==l||!("_value"in n))&&(n.value=l),t==null&&n.removeAttribute(e),n._value=t;return}let o=!1;if(t===""||t==null){const a=typeof n[e];a==="boolean"?t=rd(t):t==null&&a==="string"?(t="",o=!0):a==="number"&&(t=0,o=!0)}try{n[e]=t}catch{}o&&n.removeAttribute(r||e)}function U1(n,e,t,i){n.addEventListener(e,t,i)}function B1(n,e,t,i){n.removeEventListener(e,t,i)}const Ag=Symbol("_vei");function $1(n,e,t,i,r=null){const s=n[Ag]||(n[Ag]={}),o=s[e];if(i&&o)o.value=i;else{const[a,l]=K1(e);if(i){const c=s[e]=q1(i,r);U1(n,a,c,l)}else o&&(B1(n,a,o,l),s[e]=void 0)}}const Pg=/(?:Once|Passive|Capture)$/;function K1(n){let e;if(Pg.test(n)){e={};let i;for(;i=n.match(Pg);)n=n.slice(0,n.length-i[0].length),e[i[0].toLowerCase()]=!0}return[n[2]===":"?n.slice(3):Wi(n.slice(2)),e]}let iu=0;const Y1=Promise.resolve(),Z1=()=>iu||(Y1.then(()=>iu=0),iu=Date.now());function q1(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;const r=t.value;if(Ee(r)){const s=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{s.call(i),i._stopped=!0};const o=r.slice(),a=[i];for(let l=0;l<o.length&&!i._stopped;l++){const c=o[l];c&&on(c,e,5,a)}}else on(r,e,5,[i])};return t.value=n,t.attached=Z1(),t}const Fg=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,H1=(n,e,t,i,r,s)=>{const o=r==="svg";e==="class"?N1(n,i,o):e==="style"?W1(n,t,i):oa(e)?aa(e)||$1(n,e,t,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):J1(n,e,i,o))?(Mg(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Ig(n,e,i,o,s,e!=="value")):n._isVueCE&&(Q1(n,e)||n._def.__asyncLoader&&(/[A-Z]/.test(e)||!st(i)))?Mg(n,rn(e),i,s,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),Ig(n,e,i,o))};function J1(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&Fg(e)&&ve(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&n.tagName==="IFRAME"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=n.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Fg(e)&&st(t)?!1:e in n}function Q1(n,e){const t=n._def.props;if(!t)return!1;const i=rn(e);return Array.isArray(t)?t.some(r=>rn(r)===i):Object.keys(t).some(r=>rn(r)===i)}const ev=_t({patchProp:H1},D1);let Og;function tv(){return Og||(Og=a1(ev))}const nv=((...n)=>{const e=tv().createApp(...n),{mount:t}=e;return e.mount=i=>{const r=rv(i);if(!r)return;const s=e._component;!ve(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=t(r,!1,iv(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e});function iv(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function rv(n){return st(n)?document.querySelector(n):n}const Nt={ADD:"add",REMOVE:"remove"},kr={PROPERTYCHANGE:"propertychange"};function qs(n){for(const e in n)delete n[e]}function mi(n){let e;for(e in n)return!1;return!e}function Te(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 La(n,e,t,i){return Te(n,e,t,i,!0)}function We(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),qs(n))}const de={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class Hs{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function sv(n,e,t){let i,r;t=t||Cn;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 Cn(n,e){return n>e?1:n<e?-1:0}function ov(n,e){return n<e?1:n>e?-1:0}function Da(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 av(n,e,t){for(;e<t;){const i=n[e];n[e]=n[t],n[t]=i,++e,--t}}function Tn(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 yi(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 lv(n,e,t){const i=e||Cn;return n.every(function(r,s){if(s===0)return!0;const o=i(n[s-1],r);return!(o>0||o===0)})}function Js(){return!0}function ka(){return!1}function Qs(){}function Lg(n){let e,t,i;return function(){const r=Array.prototype.slice.call(arguments);return(!t||this!==i||!yi(r,t))&&(i=this,t=r,e=n.apply(this,arguments)),e}}function Nr(n){function e(){let t;try{t=n()}catch(i){return Promise.reject(i)}return t instanceof Promise?t:Promise.resolve(t)}return e()}class an{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class eo extends Hs{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 an(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,u=r.length;c<u;++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,Qs);delete o[i]}return l}disposeInternal(){this.listeners_&&qs(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]=Qs,++this.pendingRemovals_[e]):(i.splice(r,1),i.length===0&&delete this.listeners_[e]))}}class to extends eo{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(de.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]=Te(this,e[s],t);return r}return Te(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]=La(this,e[s],t)}else i=La(this,e,t);return t.ol_key=i,i}unInternal(e,t){const i=t.ol_key;if(i)cv(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)}}to.prototype.on,to.prototype.once,to.prototype.un;function cv(n){if(Array.isArray(n))for(let e=0,t=n.length;e<t;++e)We(n[e]);else We(n)}function pe(){throw new Error("Unimplemented abstract method.")}let uv=0;function _e(n){return n.ol_uid||(n.ol_uid=String(++uv))}class Dg extends an{constructor(e,t,i){super(e),this.key=t,this.oldValue=i}}class Rn extends to{constructor(e){super(),this.on,this.once,this.un,_e(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 Dg(i,e,t)),i=kr.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new Dg(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],mi(this.values_)&&(this.values_=null),t||this.notify(e,i)}}}const kg={LENGTH:"length"};class Na extends an{constructor(e,t,i){super(e),this.element=t,this.index=i}}class Yt extends Rn{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(kg.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 Na(Nt.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 Na(Nt.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 Na(Nt.REMOVE,r,e)),this.dispatchEvent(new Na(Nt.ADD,t,e))}updateLength_(){this.set(kg.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 zr extends an{constructor(e,t,i){super(e),this.map=t,this.frameState=i!==void 0?i:null}}class _i extends zr{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 nt={SINGLECLICK:"singleclick",CLICK:de.CLICK,DBLCLICK:de.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Yi=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";Yi.includes("safari")&&!Yi.includes("chrom")&&(Yi.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Yi));const hv=Yi.includes("webkit")&&!Yi.includes("edge"),Ng=Yi.includes("macintosh"),fv=typeof devicePixelRatio<"u"?devicePixelRatio:1,vt=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,zg=typeof Image<"u"&&Image.prototype.decode,dv=typeof createImageBitmap=="function",Gg=(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})(),ru={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class gv extends eo{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_=Te(i,ru.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=Te(i,ru.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(de.TOUCHMOVE,this.boundHandleTouchMove_,Gg?{passive:!1}:!1)}emulateClick_(e){let t=new _i(nt.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new _i(nt.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new _i(nt.SINGLECLICK,this.map_,e);this.dispatchEvent(i)},250)}updateActivePointers_(e){const t=e,i=t.pointerId;if(t.type==nt.POINTERUP||t.type==nt.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==nt.POINTERDOWN||t.type==nt.POINTERMOVE)&&(this.trackedTouches_[i]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const t=new _i(nt.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(We),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 _i(nt.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(Te(i,nt.POINTERMOVE,this.handlePointerMove_,this),Te(i,nt.POINTERUP,this.handlePointerUp_,this),Te(this.element_,nt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(Te(this.element_.getRootNode(),nt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const t=new _i(nt.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 _i(nt.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_&&(We(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(de.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(We(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(We),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const xi={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},wt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},J={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Oe(n,e){if(!n)throw new Error(e)}const za=1/0;class pv{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,qs(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){Oe(!(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!=za?(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),u=c<r&&i[c]<i[l]?c:l;t[e]=t[u],i[e]=i[u],e=u}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==za?delete this.queuedElements_[this.keyFunction_(o)]:(i[r]=l,t[r++]=o);t.length=r,i.length=r,this.heapify_()}}class jg extends pv{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(de.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){const t=e.target,i=t.getState();if(i===J.LOADED||i===J.ERROR||i===J.EMPTY){i!==J.ERROR&&t.removeEventListener(de.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()===J.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,r.load())}}}function mv(n,e,t,i,r){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return za;const s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}const Ke={ANIMATING:0,INTERACTING:1},ln={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Ye(n,e,t){return Math.min(Math.max(n,e),t)}function yv(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 _v(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 Wg(n){return n*180/Math.PI}function vi(n){return n*Math.PI/180}function Gr(n,e){const t=n%e;return t*e<0?t+e:t}function Ut(n,e,t){return n+t*(e-n)}function Ga(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function ja(n,e){return Math.floor(Ga(n,e))}function wi(n,e){return Math.ceil(Ga(n,e))}function su(n,e,t){if(n>=e&&n<t)return n;const i=t-e;return((n-e)%i+i)%i+e}function Vg(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,u=a?a[0]:0,h=a?a[1]:0;let f=n[0]+l/2+u,d=n[2]-l/2+u,g=n[1]+c/2+h,p=n[3]-c/2+h;f>d&&(f=(d+f)/2,d=f),g>p&&(g=(p+g)/2,p=g);let m=Ye(i[0],f,d),y=Ye(i[1],g,p);if(o&&t&&r){const _=30*r;m+=-_*Math.log(1+Math.max(0,f-i[0])/_)+_*Math.log(1+Math.max(0,i[0]-d)/_),y+=-_*Math.log(1+Math.max(0,g-i[1])/_)+_*Math.log(1+Math.max(0,i[1]-p)/_)}return[m,y]})}function xv(n){return n}const gt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function ou(n){const e=Bt();for(let t=0,i=n.length;t<i;++t)no(e,n[t]);return e}function vv(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 Un(i,r,s,o,t)}function Vn(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 Xg(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n.slice()}function qi(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 Hi(n,e){return au(n,e[0],e[1])}function Xn(n,e){return n[0]<=e[0]&&e[2]<=n[2]&&n[1]<=e[1]&&e[3]<=n[3]}function au(n,e,t){return n[0]<=e&&e<=n[2]&&n[1]<=t&&t<=n[3]}function lu(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=e[0],a=e[1];let l=gt.UNKNOWN;return o<t?l=l|gt.LEFT:o>r&&(l=l|gt.RIGHT),a<i?l=l|gt.BELOW:a>s&&(l=l|gt.ABOVE),l===gt.UNKNOWN&&(l=gt.INTERSECTING),l}function Bt(){return[1/0,1/0,-1/0,-1/0]}function Un(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 jr(n){return Un(1/0,1/0,-1/0,-1/0,n)}function cu(n,e){const t=n[0],i=n[1];return Un(t,i,t,i,e)}function uu(n,e,t,i,r){const s=jr(r);return Bg(s,n,e,t,i)}function Bn(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function Ug(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 no(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 Bg(n,e,t,i,r){for(;t<i;t+=r)wv(n,e[t],e[t+1]);return n}function wv(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 $g(n,e){let t;return t=e(Wa(n)),t||(t=e(Va(n)),t)||(t=e(Ua(n)),t)||(t=e($n(n)),t)?t:!1}function hu(n){let e=0;return Ei(n)||(e=Se(n)*ot(n)),e}function Wa(n){return[n[0],n[1]]}function Va(n){return[n[2],n[1]]}function zt(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function Ev(n,e){let t;if(e==="bottom-left")t=Wa(n);else if(e==="bottom-right")t=Va(n);else if(e==="top-left")t=$n(n);else if(e==="top-right")t=Ua(n);else throw new Error("Invalid corner");return t}function Xa(n,e,t,i,r){const[s,o,a,l,c,u,h,f]=Kg(n,e,t,i);return Un(Math.min(s,a,c,h),Math.min(o,l,u,f),Math.max(s,a,c,h),Math.max(o,l,u,f),r)}function Kg(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,u=s*o,h=s*a,f=n[0],d=n[1];return[f-l+h,d-c-u,f-l-h,d-c+u,f+l-h,d+c+u,f+l+h,d+c-u,f-l+h,d-c-u]}function ot(n){return n[3]-n[1]}function cn(n,e,t){const i=t||Bt();return it(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]):jr(i),i}function $n(n){return[n[0],n[3]]}function Ua(n){return[n[2],n[3]]}function Se(n){return n[2]-n[0]}function it(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function Ei(n){return n[2]<n[0]||n[3]<n[1]}function bv(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n}function Cv(n,e,t){let i=!1;const r=lu(n,e),s=lu(n,t);if(r===gt.INTERSECTING||s===gt.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],c=n[3],u=e[0],h=e[1],f=t[0],d=t[1],g=(d-h)/(f-u);let p,m;s&gt.ABOVE&&!(r&gt.ABOVE)&&(p=f-(d-c)/g,i=p>=o&&p<=l),!i&&s&gt.RIGHT&&!(r&gt.RIGHT)&&(m=d-(f-l)*g,i=m>=a&&m<=c),!i&&s&gt.BELOW&&!(r&gt.BELOW)&&(p=f-(d-a)/g,i=p>=o&&p<=l),!i&&s&gt.LEFT&&!(r&gt.LEFT)&&(m=d-(f-o)*g,i=m>=a&&m<=c)}return i}function Yg(n,e,t,i){if(Ei(n))return jr(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 vv(s,o,t)}function Zg(n,e){const t=e.getExtent(),i=zt(n);if(e.canWrapX()&&(i[0]<t[0]||i[0]>=t[2])){const r=Se(t),o=Math.floor((i[0]-t[0])/r)*r;n[0]-=o,n[2]-=o}return n}function qg(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]]];Zg(n,e);const r=Se(i);if(Se(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 Hg(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function Ba(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 fu(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 Jg(n,e){return n[0]*=e,n[1]*=e,n}function Tv(n,e){const t=n[0]-e[0],i=n[1]-e[1];return t*t+i*i}function Rv(n,e){return Math.sqrt(Tv(n,e))}function du(n,e){if(e.canWrapX()){const t=Se(e.getExtent()),i=Sv(n,e,t);i&&(n[0]-=i*t)}return n}function Sv(n,e,t){const i=e.getExtent();let r=0;return e.canWrapX()&&(n[0]<i[0]||n[0]>i[2])&&(t=t||Se(i),r=Math.floor((n[0]-i[0])/t)),r}function Iv(n,e,t){const i=Math.sqrt((e[0]-n[0])*(e[0]-n[0])+(e[1]-n[1])*(e[1]-n[1])),r=[(e[0]-n[0])/i,(e[1]-n[1])/i],s=[-r[1],r[0]],o=Math.sqrt((t[0]-n[0])*(t[0]-n[0])+(t[1]-n[1])*(t[1]-n[1])),a=[(t[0]-n[0])/o,(t[1]-n[1])/o];let l=i===0||o===0?0:Math.acos(Ye(a[0]*r[0]+a[1]*r[1],-1,1));return l=Math.max(l,1e-5),a[0]*s[0]+a[1]*s[1]>0?l:Math.PI*2-l}function Qg(n){return Math.pow(n,3)}function Wr(n){return 1-Qg(1-n)}function Mv(n){return 3*n*n-2*n*n*n}function Av(n){return n}const Pv=63710088e-1;function ep(n,e,t){t=t||Pv;const i=vi(n[1]),r=vi(e[1]),s=(r-i)/2,o=vi(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 tp(...n){console.warn(...n)}const bi={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class $a{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_||bi[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 io=6378137,Vr=Math.PI*io,Fv=[-Vr,-Vr,Vr,Vr],Ov=[-180,-85,180,85],Ka=io*Math.log(Math.tan(Math.PI/2));class Xr extends $a{constructor(e){super({code:e,units:"m",extent:Fv,global:!0,worldExtent:Ov,getPointResolution:function(t,i){return t/Math.cosh(i[1]/io)}})}}const np=[new Xr("EPSG:3857"),new Xr("EPSG:102100"),new Xr("EPSG:102113"),new Xr("EPSG:900913"),new Xr("http://www.opengis.net/def/crs/EPSG/0/3857"),new Xr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Lv(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]=Vr*n[s]/180;let o=io*Math.log(Math.tan(Math.PI*(+n[s+1]+90)/360));o>Ka?o=Ka:o<-Ka&&(o=-Ka),e[s+1]=o}return e}function Dv(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]/Vr,e[s+1]=360*Math.atan(Math.exp(n[s+1]/io))/Math.PI-90;return e}const kv=6378137,ip=[-180,-90,180,90],Nv=Math.PI*kv/180;class Ji extends $a{constructor(e,t){super({code:e,units:"degrees",extent:ip,axisOrientation:t,global:!0,metersPerUnit:Nv,worldExtent:ip})}}const rp=[new Ji("CRS:84"),new Ji("EPSG:4326","neu"),new Ji("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ji("urn:ogc:def:crs:OGC:2:84"),new Ji("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Ji("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ji("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let gu={};function zv(n){return gu[n]||gu[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Gv(n,e){gu[n]=e}let Ur={};function ro(n,e,t){const i=n.getCode(),r=e.getCode();i in Ur||(Ur[i]={}),Ur[i][r]=t}function pu(n,e){return n in Ur&&e in Ur[n]?Ur[n][e]:null}const Ya=.9996,Zt=.00669438,Za=Zt*Zt,qa=Za*Zt,Qi=Zt/(1-Zt),sp=Math.sqrt(1-Zt),Br=(1-sp)/(1+sp),op=Br*Br,mu=op*Br,yu=mu*Br,ap=yu*Br,lp=1-Zt/4-3*Za/64-5*qa/256,jv=3*Zt/8+3*Za/32+45*qa/1024,Wv=15*Za/256+45*qa/1024,Vv=35*qa/3072,Xv=3/2*Br-27/32*mu+269/512*ap,Uv=21/16*op-55/32*yu,Bv=151/96*mu-417/128*ap,$v=1097/512*yu,Ha=6378137;function Kv(n,e,t){const i=n-5e5,o=(t.north?e:e-1e7)/Ya/(Ha*lp),a=o+Xv*Math.sin(2*o)+Uv*Math.sin(4*o)+Bv*Math.sin(6*o)+$v*Math.sin(8*o),l=Math.sin(a),c=l*l,u=Math.cos(a),h=l/u,f=h*h,d=f*f,g=1-Zt*c,p=Math.sqrt(1-Zt*c),m=Ha/p,y=(1-Zt)/g,_=Qi*u**2,v=_*_,x=i/(m*Ya),w=x*x,T=w*x,R=T*x,C=R*x,S=C*x,L=a-h/y*(w/2-R/24*(5+3*f+10*_-4*v-9*Qi))+S/720*(61+90*f+298*_+45*d-252*Qi-3*v);let B=(x-T/6*(1+2*f+_)+C/120*(5-2*_+28*f-3*v+8*Qi+24*d))/u;return B=su(B+vi(hp(t.number)),-Math.PI,Math.PI),[Wg(B),Wg(L)]}const cp=-80,up=84,Yv=-180,Zv=180;function qv(n,e,t){n=su(n,Yv,Zv),e<cp?e=cp:e>up&&(e=up);const i=vi(e),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,c=vi(n),u=hp(t.number),h=vi(u),f=Ha/Math.sqrt(1-Zt*r**2),d=Qi*s**2,g=s*su(c-h,-Math.PI,Math.PI),p=g*g,m=p*g,y=m*g,_=y*g,v=_*g,x=Ha*(lp*i-jv*Math.sin(2*i)+Wv*Math.sin(4*i)-Vv*Math.sin(6*i)),w=Ya*f*(g+m/6*(1-a+d)+_/120*(5-18*a+l+72*d-58*Qi))+5e5;let T=Ya*(x+f*o*(p/2+y/24*(5-a+9*d+4*d**2)+v/720*(61-58*a+l+600*d-330*Qi)));return t.north||(T+=1e7),[w,T]}function hp(n){return(n-1)*6-180+3}const Hv=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function fp(n){let e=0;for(const r of Hv){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 dp(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],u=n(l,c,e);i[a]=u[0],i[a+1]=u[1]}return i}}function Jv(n){return fp(n)?new $a({code:n,units:"m"}):null}function Qv(n){const e=fp(n.getCode());return e?{forward:dp(qv,e),inverse:dp(Kv,e)}:null}const ew=[Qv],tw=[Jv];let _u=!0;function gp(n){_u=!1}function xu(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 vu(n){Gv(n.getCode(),n),ro(n,n,xu)}function nw(n){n.forEach(vu)}function Le(n){if(typeof n!="string")return n;const e=zv(n);if(e)return e;for(const t of tw){const i=t(n);if(i)return i}return null}function wu(n,e,t,i){n=Le(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/bi[i])}}else{const o=n.getUnits();if(o=="degrees"&&!i||i=="degrees")r=e;else{const a=$r(n,Le("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 u=ep(c.slice(0,2),c.slice(2,4)),h=ep(c.slice(4,6),c.slice(6,8));r=(u+h)/2}const l=i?bi[i]:n.getMetersPerUnit();l!==void 0&&(r/=l)}}return r}function pp(n){nw(n),n.forEach(function(e){n.forEach(function(t){e!==t&&ro(e,t,xu)})})}function iw(n,e,t,i){n.forEach(function(r){e.forEach(function(s){ro(r,s,t),ro(s,r,i)})})}function Eu(n,e){return n?typeof n=="string"?Le(n):n:Le(e)}function rw(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,u=r;c<u;++c)t[o+c]=c>=l?e[o+c]:a[c]}return t})}function bu(n,e){return gp(),so(n,"EPSG:4326",e!==void 0?e:"EPSG:3857")}function Et(n,e){if(n===e)return!0;const t=n.getUnits()===e.getUnits();return(n.getCode()===e.getCode()||$r(n,e)===xu)&&t}function $r(n,e){const t=n.getCode(),i=e.getCode();let r=pu(t,i);if(r)return r;let s=null,o=null;for(const l of ew)s||(s=l(n)),o||(o=l(e));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=Cu(s.inverse,o.forward);else{const l=pu(t,a);l&&(r=Cu(l,o.forward))}else{const l=pu(a,i);l&&(r=Cu(s.inverse,l))}return r&&(vu(n),vu(e),ro(n,e,r)),r}function Cu(n,e){return function(t,i,r,s){return i=n(t,i,r,s),e(i,i,r,s)}}function er(n,e){const t=Le(n),i=Le(e);return $r(t,i)}function so(n,e,t){const i=er(e,t);if(!i){const r=Le(e).getCode(),s=Le(t).getCode();throw new Error(`No transform available between ${r} and ${s}`)}return i(n,void 0,n.length)}function Kr(n,e,t,i){const r=er(e,t);return Yg(n,r,void 0,i)}let qt=null;function sw(n){qt=Le(n)}function oo(){return qt}function ow(){sw("EPSG:4326")}function Tu(n,e){return qt?so(n,e,qt):n}function Kn(n,e){return qt?so(n,qt,e):(_u&&!Ba(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(_u=!1,tp("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n)}function Ja(n,e){return qt?Kr(n,e,qt):n}function Yn(n,e){return qt?Kr(n,qt,e):n}function aw(n,e){if(!qt)return n;const t=Le(e).getMetersPerUnit(),i=qt.getMetersPerUnit();return t&&i?n*t/i:n}function lw(){pp(np),pp(rp),iw(rp,np,Lv,Dv)}lw();const mp=new Array(6);function Gt(){return[1,0,0,1,0,0]}function yp(n){return Su(n,1,0,0,1,0,0)}function Ru(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],u=e[2],h=e[3],f=e[4],d=e[5];return n[0]=t*l+r*c,n[1]=i*l+s*c,n[2]=t*u+r*h,n[3]=i*u+s*h,n[4]=t*f+r*d+o,n[5]=i*f+s*d+a,n}function Su(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 cw(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 lt(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 Iu(n,e,t){return Ru(n,Su(mp,e,0,0,t,0,0))}function uw(n,e,t){return Ru(n,Su(mp,1,0,0,1,e,t))}function Sn(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 _p(n,e){const t=hw(e);Oe(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 hw(n){return n[0]*n[3]-n[1]*n[2]}const fw=[1e5,1e5,1e5,1e5,2,2];function dw(n){return"matrix("+n.join(", ")+")"}function Mu(n){return n.substring(7,n.length-1).split(",").map(parseFloat)}function gw(n,e){const t=Mu(n),i=Mu(e);for(let r=0;r<6;++r)if(Math.round((t[r]-i[r])*fw[r])!==0)return!1;return!0}function Ci(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],u=n[l+1];s[a++]=r[0]*c+r[2]*u+r[4],s[a++]=r[1]*c+r[3]*u+r[5];for(let h=2;h<o;h++)s[a++]=n[l+h]}return s&&s.length!=a&&(s.length=a),s}function xp(n,e,t,i,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),c=s[0],u=s[1];let h=0;for(let f=e;f<t;f+=i){const d=n[f]-c,g=n[f+1]-u;o[h++]=c+d*a-g*l,o[h++]=u+d*l+g*a;for(let p=f+2;p<f+i;++p)o[h++]=n[p]}return o&&o.length!=h&&(o.length=h),o}function pw(n,e,t,i,r,s,o,a){a=a||[];const l=o[0],c=o[1];let u=0;for(let h=e;h<t;h+=i){const f=n[h]-l,d=n[h+1]-c;a[u++]=l+r*f,a[u++]=c+s*d;for(let g=h+2;g<h+i;++g)a[u++]=n[g]}return a&&a.length!=u&&(a.length=u),a}function mw(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 vp=Gt(),yw=[NaN,NaN];class wp extends Rn{constructor(){super(),this.extent_=Bt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Lg((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 pe()}closestPointXY(e,t,i,r){return pe()}containsXY(e,t){return this.closestPointXY(e,t,yw,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 pe()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&jr(t),this.extentRevision_=this.getRevision()}return bv(this.extent_,e)}rotate(e,t){pe()}scale(e,t,i){pe()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return pe()}getType(){return pe()}applyTransform(e){pe()}intersectsExtent(e){return pe()}translate(e,t){pe()}transform(e,t){const i=Le(e),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),c=i.getWorldExtent(),u=ot(c)/ot(l);Sn(vp,c[0],c[3],u,-u,0,0,0);const h=Ci(s,0,s.length,a,vp,o),f=er(i,t);return f?f(h,h,a):h}:er(i,t);return this.applyTransform(r),this}}class tr extends wp{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return uu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return pe()}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=Ep(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){pe()}setLayout(e,t,i){let r;if(e)r=Ep(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=nr(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();xp(i,0,i.length,r,e,t,i),this.changed()}}scale(e,t,i){t===void 0&&(t=e),i||(i=zt(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();pw(r,0,r.length,s,e,t,i,r),this.changed()}}translate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();mw(i,0,i.length,r,e,t,i),this.changed()}}}function nr(n){let e;return n==2?e="XY":n==3?e="XYZ":n==4&&(e="XYZM"),e}function Ep(n){let e;return n=="XY"?e=2:n=="XYZ"||n=="XYM"?e=3:n=="XYZM"&&(e=4),e}function _w(n,e,t){const i=n.getFlatCoordinates();if(!i)return null;const r=n.getStride();return Ci(i,0,i.length,r,e,t)}function bp(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,u=n[e+1]-o;r+=l*c-a*u,a=c,l=u}return r/2}function Cp(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=bp(n,e,a,i),e=a}return r}function xw(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=Cp(n,e,a,i),e=a[a.length-1]}return r}function Tp(n,e,t,i,r,s,o){const a=n[e],l=n[e+1],c=n[t]-a,u=n[t+1]-l;let h;if(c===0&&u===0)h=e;else{const f=((r-a)*c+(s-l)*u)/(c*c+u*u);if(f>1)h=t;else if(f>0){for(let d=0;d<i;++d)o[d]=Ut(n[e+d],n[t+d],f);o.length=i;return}else h=e}for(let f=0;f<i;++f)o[f]=n[h+f];o.length=i}function Au(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 Pu(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=Au(n,e,a,i,r),e=a}return r}function vw(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=Pu(n,e,a,i,r),e=a[a.length-1]}return r}function Fu(n,e,t,i,r,s,o,a,l,c,u){if(e==t)return c;let h,f;if(r===0){if(f=Zi(o,a,n[e],n[e+1]),f<c){for(h=0;h<i;++h)l[h]=n[e+h];return l.length=i,f}return c}u=u||[NaN,NaN];let d=e+i;for(;d<t;)if(Tp(n,d-i,d,i,o,a,u),f=Zi(o,a,u[0],u[1]),f<c){for(c=f,h=0;h<i;++h)l[h]=u[h];l.length=i,d+=i}else d+=i*Math.max((Math.sqrt(f)-Math.sqrt(c))/r|0,1);if(s&&(Tp(n,t-i,e,i,o,a,u),f=Zi(o,a,u[0],u[1]),f<c)){for(c=f,h=0;h<i;++h)l[h]=u[h];l.length=i}return c}function Ou(n,e,t,i,r,s,o,a,l,c,u){u=u||[NaN,NaN];for(let h=0,f=t.length;h<f;++h){const d=t[h];c=Fu(n,e,d,i,r,s,o,a,l,c,u),e=d}return c}function ww(n,e,t,i,r,s,o,a,l,c,u){u=u||[NaN,NaN];for(let h=0,f=t.length;h<f;++h){const d=t[h];c=Ou(n,e,d,i,r,s,o,a,l,c,u),e=d[d.length-1]}return c}function Ew(n,e,t,i){for(let r=0,s=t.length;r<s;++r)n[e++]=t[r];return e}function Qa(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 ao(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=Qa(n,e,t[o],i);r[s++]=l,e=l}return r.length=s,r}function Rp(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=ao(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 Ti(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 lo(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++]=Ti(n,e,l,i,r[s]),e=l}return r.length=s,r}function Lu(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?[]:lo(n,e,l,i,r[s]),e=l[l.length-1]}return r.length=s,r}function el(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 u=0;for(;c.length>0;){const h=c.pop(),f=c.pop();let d=0;const g=n[f],p=n[f+1],m=n[h],y=n[h+1];for(let _=f+i;_<h;_+=i){const v=n[_],x=n[_+1],w=yv(v,x,g,p,m,y);w>d&&(u=_,d=w)}d>r&&(l[(u-e)/i]=1,f+i<u&&c.push(f,u),u+i<h&&c.push(u,h))}for(let h=0;h<a;++h)l[h]&&(s[o++]=n[e+h*i],s[o++]=n[e+h*i+1]);return o}function Sp(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const u=t[l];o=el(n,e,u,i,r,s,o),a.push(o),e=u}return o}function ir(n,e){return e*Math.round(n/e)}function bw(n,e,t,i,r,s,o){if(e==t)return o;let a=ir(n[e],r),l=ir(n[e+1],r);e+=i,s[o++]=a,s[o++]=l;let c,u;do if(c=ir(n[e],r),u=ir(n[e+1],r),e+=i,e==t)return s[o++]=c,s[o++]=u,o;while(c==a&&u==l);for(;e<t;){const h=ir(n[e],r),f=ir(n[e+1],r);if(e+=i,h==c&&f==u)continue;const d=c-a,g=u-l,p=h-a,m=f-l;if(d*m==g*p&&(d<0&&p<d||d==p||d>0&&p>d)&&(g<0&&m<g||g==m||g>0&&m>g)){c=h,u=f;continue}s[o++]=c,s[o++]=u,a=c,l=u,c=h,u=f}return s[o++]=c,s[o++]=u,o}function Du(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const u=t[l];o=bw(n,e,u,i,r,s,o),a.push(o),e=u}return o}function Cw(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const u=t[l],h=[];o=Du(n,e,u,i,r,s,o,h),a.push(h),e=u[u.length-1]}return o}class co extends tr{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 co(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,i,r){return r<qi(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Au(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))}getArea(){return bp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Ti(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=el(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new co(t,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Qa(this.flatCoordinates,0,e,this.stride),this.changed()}}class Zn extends tr{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){const e=new Zn(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 cu(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return au(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ew(this.flatCoordinates,0,e,this.stride),this.changed()}}function Tw(n,e,t,i,r){return!$g(r,function(o){return!rr(n,e,t,i,o[0],o[1])})}function rr(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],u=n[e+1];l<=s?u>s&&(c-a)*(s-l)-(r-a)*(u-l)>0&&o++:u<=s&&(c-a)*(s-l)-(r-a)*(u-l)<0&&o--,a=c,l=u}return o!==0}function ku(n,e,t,i,r,s){if(t.length===0||!rr(n,e,t[0],i,r,s))return!1;for(let o=1,a=t.length;o<a;++o)if(rr(n,t[o-1],t[o],i,r,s))return!1;return!0}function Rw(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(ku(n,e,l,i,r,s))return!0;e=l[l.length-1]}return!1}function Nu(n,e,t,i,r,s,o){let a,l,c,u,h,f,d;const g=r[s+1],p=[];for(let _=0,v=t.length;_<v;++_){const x=t[_];for(u=n[x-i],f=n[x-i+1],a=e;a<x;a+=i)h=n[a],d=n[a+1],(g<=f&&d<=g||f<=g&&g<=d)&&(c=(g-f)/(d-f)*(h-u)+u,p.push(c)),u=h,f=d}let m=NaN,y=-1/0;for(p.sort(Cn),u=p[0],a=1,l=p.length;a<l;++a){h=p[a];const _=Math.abs(h-u);_>y&&(c=(u+h)/2,ku(n,e,t,i,c,g)&&(m=c,y=_)),u=h}return isNaN(m)&&(m=r[s]),o?(o.push(m,g,y),o):[m,g,y]}function Ip(n,e,t,i,r){let s=[];for(let o=0,a=t.length;o<a;++o){const l=t[o];s=Nu(n,e,l,i,r,2*o,s),e=l[l.length-1]}return s}function Mp(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 tl(n,e,t,i,r,s){return s=s??Bg(Bt(),n,e,t,i),it(r,s)?s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Mp(n,e,t,i,function(o,a){return Cv(r,o,a)}):!1}function Sw(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){if(tl(n,e,t[s],i,r))return!0;e=t[s]}return!1}function Ap(n,e,t,i,r){return!!(tl(n,e,t,i,r)||rr(n,e,t,i,r[0],r[1])||rr(n,e,t,i,r[0],r[3])||rr(n,e,t,i,r[2],r[1])||rr(n,e,t,i,r[2],r[3]))}function Pp(n,e,t,i,r){if(!Ap(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(Tw(n,t[s-1],t[s],i,r)&&!tl(n,t[s-1],t[s],i,r))return!1;return!0}function Iw(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(Pp(n,e,a,i,r))return!0;e=a[a.length-1]}return!1}function Mw(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 zu(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 Gu(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=zu(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 Fp(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(!Gu(n,e,a,i,r))return!1;a.length&&(e=a[a.length-1])}return!0}function nl(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=zu(n,e,a,i);(s===0?r&&l||!r&&!l:r&&!l||!r&&l)&&Mw(n,e,a,i),e=a}return e}function ju(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s)e=nl(n,e,t[s],i,r);return e}function Op(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=zu(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 qn extends tr{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?Tn(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new qn(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<qi(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Pu(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ou(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return ku(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return Cp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),nl(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,lo(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=zt(this.getExtent());this.flatInteriorPoint_=Nu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Zn(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new co(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 co(t.slice(s,l),e);r.push(c),s=l}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Gu(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=nl(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Du(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,i),new qn(t,"XY",i)}getType(){return"Polygon"}intersectsExtent(e){return Pp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=ao(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Lp(n){if(Ei(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 qn(s,"XY",[s.length])}function Wu(n,e,t,i){const r=Se(e)/t[0],s=ot(e)/t[1];return i?Math.min(n,Math.max(r,s)):Math.min(n,Math.min(r,s))}function Vu(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),Ye(i,t/2,e*2)}function Aw(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],u=t?Wu(l,t,o,i):l;if(a)return e?Vu(r,u,c):Ye(r,c,u);const h=Math.min(u,r),f=Math.floor(Da(n,h,s));return n[f]>u&&f<n.length-1?n[f+1]:n[f]}})}function Pw(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 u=r?Wu(e,r,l,s):e;if(c)return i?Vu(o,u,t):Ye(o,t,u);const h=1e-9,f=Math.ceil(Math.log(e/u)/Math.log(n)-h),d=-a*(.5-h)+.5,g=Math.min(u,o),p=Math.floor(Math.log(e/g)/Math.log(n)+d),m=Math.max(f,p),y=e/Math.pow(n,m);return Ye(y,t,u)}})}function Dp(n,e,t,i,r){return t=t!==void 0?t:!0,(function(s,o,a,l){if(s!==void 0){const c=i?Wu(n,i,a,r):n;return!t||!l?Ye(s,e,c):Vu(s,c,e)}})}function Xu(n){if(n!==void 0)return 0}function kp(n){if(n!==void 0)return n}function Fw(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 Ow(n){const e=vi(5);return(function(t,i){return i||t===void 0?t:Math.abs(t)<=e?0:t})}const Np=42,Uu=256,Bu=0;class un extends Rn{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Eu(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&&gp(),e.center&&(e.center=Kn(e.center,this.projection_)),e.extent&&(e.extent=Yn(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){const t=Object.assign({},e);for(const a in ln)delete t[a];this.setProperties(t,!0);const i=Dw(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=Lw(e),s=i.constraint,o=kw(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=Kn(r.center,this.getProjection())),r.anchor&&(r=Object.assign({},r),r.anchor=Kn(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 u=arguments[r];u.center&&this.setCenterInternal(u.center),u.zoom!==void 0?this.setZoom(u.zoom):u.resolution&&this.setResolution(u.resolution),u.rotation!==void 0&&this.setRotation(u.rotation)}if(r===t){i&&il(i,!0);return}let s=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const c=[];for(;r<t;++r){const u=arguments[r],h={start:s,complete:!1,anchor:u.anchor,duration:u.duration!==void 0?u.duration:1e3,easing:u.easing||Mv,callback:i};if(u.center&&(h.sourceCenter=o,h.targetCenter=u.center.slice(),o=h.targetCenter),u.zoom!==void 0?(h.sourceResolution=a,h.targetResolution=this.getResolutionForZoom(u.zoom),a=h.targetResolution):u.resolution&&(h.sourceResolution=a,h.targetResolution=u.resolution,a=h.targetResolution),u.rotation!==void 0){h.sourceRotation=l;const f=Gr(u.rotation-l+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=l+f,l=h.targetRotation}Nw(h)?h.complete=!0:s+=h.duration,c.push(h)}this.animations_.push(c),this.setHint(Ke.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[Ke.ANIMATING]>0}getInteracting(){return this.hints_[Ke.INTERACTING]>0}cancelAnimations(){this.setHint(Ke.ANIMATING,-this.hints_[Ke.ANIMATING]);let e;for(let t=0,i=this.animations_.length;t<i;++t){const r=this.animations_[t];if(r[0].callback&&il(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 u=l.duration>0?c/l.duration:1;u>=1?(l.complete=!0,u=1):s=!1;const h=l.easing(u);if(l.sourceCenter){const f=l.sourceCenter[0],d=l.sourceCenter[1],g=l.targetCenter[0],p=l.targetCenter[1];this.nextCenter_=l.targetCenter;const m=f+h*(g-f),y=d+h*(p-d);this.targetCenter_=[m,y]}if(l.sourceResolution&&l.targetResolution){const f=h===1?l.targetResolution:l.sourceResolution+h*(l.targetResolution-l.sourceResolution);if(l.anchor){const d=this.getViewportSize_(this.getRotation()),g=this.constraints_.resolution(f,0,d,!0);this.targetCenter_=this.calculateCenterZoom(g,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=f,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const f=h===1?Gr(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+h*(l.targetRotation-l.sourceRotation);if(l.anchor){const d=this.constraints_.rotation(f,!0);this.targetCenter_=this.calculateCenterRotate(d,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=f}if(this.applyTargetState_(!0),t=!0,!l.complete)break}if(s){this.animations_[i]=null,this.setHint(Ke.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=r[0].callback;o&&il(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]],fu(i,e-this.getRotation()),Hg(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&&Tu(e,this.getProjection())}getCenterInternal(){return this.get(ln.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 Ja(t,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const t=this.getCenterInternal();Oe(t,"The view center is not defined");const i=this.getResolution();Oe(i!==void 0,"The view resolution is not defined");const r=this.getRotation();return Oe(r!==void 0,"The view rotation is not defined"),Xa(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(ln.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(Yn(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t=t||this.getViewportSizeMinusPadding_();const i=Se(e)/t[0],r=ot(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(ln.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=$u(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=Da(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){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const t=Ye(Math.floor(e),0,this.resolutions_.length-2),i=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/Math.pow(i,Ye(e-t,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,t){let i;if(Oe(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){Oe(!Ei(e),"Cannot fit empty extent provided as `geometry`");const r=Yn(e,this.getProjection());i=Lp(r)}else if(e.getType()==="Circle"){const r=Yn(e.getExtent(),this.getProjection());i=Lp(r),i.rotate(this.getRotation(),zt(r))}else{const r=oo();r?i=e.clone().transform(r,this.getProjection()):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,u=-1/0;for(let h=0,f=s.length;h<f;h+=o){const d=s[h]*i-s[h+1]*r,g=s[h]*r+s[h+1]*i;a=Math.min(a,d),l=Math.min(l,g),c=Math.max(c,d),u=Math.max(u,g)}return[a,l,c,u]}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(),u=Math.sin(c),h=Math.cos(c),f=zt(a);f[0]+=(r[1]-r[3])/2*l,f[1]+=(r[0]-r[2])/2*l;const d=f[0]*h-f[1]*u,g=f[1]*h+f[0]*u,p=this.getConstrainedCenter([d,g],l),m=t.callback?t.callback:Qs;t.duration!==void 0?this.animateInternal({resolution:l,center:p,duration:t.duration,easing:t.easing},m):(this.targetResolution_=l,this.targetCenter_=p,this.applyTargetState_(!1,!0),il(m,!0))}centerOn(e,t,i){this.centerOnInternal(Kn(e,this.getProjection()),t,i)}centerOnInternal(e,t,i){this.setCenterInternal($u(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=$u(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=Tu(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&&Kn(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=Kn(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&&Kn(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(ln.ROTATION)!==r&&this.set(ln.ROTATION,r),this.get(ln.RESOLUTION)!==o&&(this.set(ln.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(ln.CENTER)||!Ba(this.get(ln.CENTER),a))&&this.set(ln.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()||!Ba(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:l,resolution:a,duration:e,easing:Wr,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(Ke.INTERACTING,1)}endInteraction(e,t,i){i=i&&Kn(i,this.getProjection()),this.endInteractionInternal(e,t,i)}endInteractionInternal(e,t,i){this.getInteracting()&&(this.setHint(Ke.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 il(n,e){setTimeout(function(){n(e)},0)}function Lw(n){if(n.extent!==void 0){const t=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return Vg(n.extent,n.constrainOnlyCenter,t)}const e=Eu(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,Vg(t,!1,!1)}return xv}function Dw(n){let e,t,i,o=n.minZoom!==void 0?n.minZoom:Bu,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,u=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,h=n.showFullExtent!==void 0?n.showFullExtent:!1,f=Eu(n.projection,"EPSG:3857"),d=f.getExtent();let g=n.constrainOnlyCenter,p=n.extent;if(!c&&!p&&f.isGlobal()&&(g=!1,p=d),n.resolutions!==void 0){const m=n.resolutions;t=m[o],i=m[a]!==void 0?m[a]:m[m.length-1],n.constrainResolution?e=Aw(m,u,!g&&p,h):e=Dp(t,i,u,!g&&p,h)}else{const y=(d?Math.max(Se(d),ot(d)):360*bi.degrees/f.getMetersPerUnit())/Uu/Math.pow(2,Bu),_=y/Math.pow(2,28-Bu);t=n.maxResolution,t!==void 0?o=0:t=y/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=y/Math.pow(l,a):i=_),a=o+Math.floor(Math.log(t/i)/Math.log(l)),i=t/Math.pow(l,a-o),n.constrainResolution?e=Pw(l,t,i,u,!g&&p,h):e=Dp(t,i,u,!g&&p,h)}return{constraint:e,maxResolution:t,minResolution:i,minZoom:o,zoomFactor:l}}function kw(n){if(n.enableRotation!==void 0?n.enableRotation:!0){const t=n.constrainRotation;return t===void 0||t===!0?Ow():t===!1?kp:typeof t=="number"?Fw(t):kp}return Xu}function Nw(n){return!(n.sourceCenter&&n.targetCenter&&!Ba(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function $u(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,u=l*s+a*o;return[c,u]}const rl="ol-hidden",sl="ol-unselectable",Ku="ol-control",zp="ol-collapsed",zw=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"),Gp=["style","variant","weight","size","lineHeight","family"],Yu={normal:400,bold:700},Zu=function(n){const e=n.match(zw);if(!e)return null;const t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let i=0,r=Gp.length;i<r;++i){const s=e[i+1];s!==void 0&&(t[Gp[i]]=typeof s=="string"?s.trim():s)}return isNaN(Number(t.weight))&&t.weight in Yu&&(t.weight=Yu[t.weight]),t.families=t.family.split(/,\s?/).map(i=>i.trim().replace(/^['"]|['"]$/g,"")),t};function Ze(n,e,t,i){let r;return t&&t.length?r=t.shift():vt?r=new class extends OffscreenCanvas{style={}}(n??300,e??150):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("2d",i)}let qu;function ol(){return qu||(qu=Ze(1,1)),qu}function uo(n){const e=n.canvas;e.width=1,e.height=1,n.clearRect(0,0,1,1)}function jp(n,e){const t=e.parentNode;t&&t.replaceChild(n,e)}function Gw(n){for(;n.lastChild;)n.lastChild.remove()}function jw(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 Wp(){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 Ri(n){return typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas}class Hu extends Rn{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(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&this.element?.remove();for(let t=0,i=this.listenerKeys.length;t<i;++t)We(this.listenerKeys[t]);if(this.listenerKeys.length=0,this.map_=e,e){const t=this.target_??e.getOverlayContainerStopEvent();this.element&&t.appendChild(this.element),this.render!==Qs&&this.listenerKeys.push(Te(e,xi.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}class Ww extends Hu{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(de.CLICK,this.handleClick_.bind(this),!1);const c=t+" "+sl+" "+Ku+(this.collapsed_&&this.collapsible_?" "+zp:"")+(this.collapsible_?"":" ol-uncollapsible"),u=this.element;u.className=c,u.appendChild(this.toggleButton_),u.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=>s.getSource()?.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=>Nr(()=>r))),i=t.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!yi(t,this.renderedAttributions_)){Gw(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(zp),this.collapsed_?jp(this.collapseLabel_,this.label_):jp(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 Vw extends Hu{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(de.CLICK,this.handleClick_.bind(this),!1);const a=t+" "+sl+" "+Ku,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(rl)}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:Wr}):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(rl);!s&&i===0?this.element.classList.add(rl):s&&i!==0&&this.element.classList.remove(rl)}this.label_.style.transform=r}this.rotation_=i}}class Xw extends Hu{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",u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=l,u.appendChild(typeof o=="string"?document.createTextNode(o):o),u.addEventListener(de.CLICK,this.handleClick_.bind(this,i),!1);const h=document.createElement("button");h.className=s,h.setAttribute("type","button"),h.title=c,h.appendChild(typeof a=="string"?document.createTextNode(a):a),h.addEventListener(de.CLICK,this.handleClick_.bind(this,-i),!1);const f=t+" "+sl+" "+Ku,d=this.element;d.className=f,d.appendChild(u),d.appendChild(h),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:Wr})):i.setZoom(s)}}}function Uw(n){n=n||{};const e=new Yt;return(n.zoom===void 0||n.zoom)&&e.push(new Xw(n.zoomOptions)),(n.rotate===void 0||n.rotate)&&e.push(new Vw(n.rotateOptions)),(n.attribution===void 0||n.attribution)&&e.push(new Ww(n.attributionOptions)),e}class Bw{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<16.666666666666668)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 Vp={ACTIVE:"active"};class ho extends Rn{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(Vp.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Vp.ACTIVE,e)}setMap(e){this.map_=e}}function $w(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:Av,center:n.getConstrainedCenter(r)})}}function Ju(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:Wr})}class Kw extends ho{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==nt.DBLCLICK){const i=e.originalEvent,r=e.map,s=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();Ju(a,o,s,this.duration_),i.preventDefault(),t=!0}return!t}}function Qu(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 Yw=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Zw=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)},Xp=function(n){const e=n.map.getTargetElement(),t=e.getRootNode();return(t instanceof ShadowRoot?t.host:e).hasAttribute("tabindex")?Zw(n):!0},qw=Js,Up=function(n){const e=n.originalEvent;return"pointerId"in e&&e.button==0&&!(hv&&Ng&&e.ctrlKey)},Bp=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Hw=function(n){const e=n.originalEvent;return Ng?e.metaKey:e.ctrlKey},Jw=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},$p=function(n){const e=n.originalEvent,t=e.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"&&!e.target.isContentEditable},eh=function(n){const e=n.originalEvent;return"pointerId"in e&&e.pointerType=="mouse"},Qw=function(n){const e=n.originalEvent;return"pointerId"in e&&e.isPrimary&&e.button===0};class fo extends ho{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==nt.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==nt.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==nt.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,t=this.stopDown(i)}else e.type==nt.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 th(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 eE extends fo{constructor(e){super({stopDown:ka}),e=e||{},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const t=e.condition?e.condition:Qu(Bp,Qw);this.condition_=e.onFocusOnly?Qu(Xp,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(th(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();Jg(s,a.getResolution()),fu(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:Wr})}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 tE extends fo{constructor(e){e=e||{},super({stopDown:ka}),this.condition_=e.condition?e.condition:Yw,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!eh(e))return;const t=e.map,i=t.getView();if(i.getConstraints().rotation===Xu)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 eh(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return eh(e)&&Up(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class nE extends Hs{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 qn([r])}getGeometry(){return this.geometry_}}const Yr={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class go extends an{constructor(e,t,i){super(e),this.coordinate=t,this.mapBrowserEvent=i}}class iE extends fo{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new nE(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??Up,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 go(Yr.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 go(t?Yr.BOXEND:Yr.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 go(Yr.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new go(Yr.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new go(Yr.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}}class rE extends iE{constructor(e){e=e||{};const t=e.condition?e.condition:Jw;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:Wr})}}const sr={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class sE extends ho{constructor(e){super(),e=e||{},this.defaultCondition_=function(t){return Bp(t)&&$p(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==de.KEYDOWN){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==sr.DOWN||r==sr.LEFT||r==sr.RIGHT||r==sr.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;r==sr.DOWN?c=-a:r==sr.LEFT?l=-a:r==sr.RIGHT?l=a:c=a;const u=[l,c];fu(u,o.getRotation()),$w(o,u,this.duration_),i.preventDefault(),t=!0}}return!t}}class oE extends ho{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(t){return!Hw(t)&&$p(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==de.KEYDOWN||e.type==de.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();Ju(a,o,void 0,this.duration_),i.preventDefault(),t=!0}}return!t}}const aE=40,lE=300,cE=3;class uE extends ho{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:qw;this.condition_=e.onFocusOnly?Qu(Xp,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300,this.ctrlKeyPressed_=!1,this.ctrlKeyListenerKeys_=[]}setMap(e){if(this.ctrlKeyListenerKeys_.forEach(We),this.ctrlKeyListenerKeys_.length=0,this.ctrlKeyPressed_=!1,super.setMap(e),e){const t=e.getOwnerDocument();this.ctrlKeyListenerKeys_.push(Te(t,"keydown",i=>{i.key==="Control"&&(this.ctrlKeyPressed_=!0)}),Te(t,"keyup",i=>{i.key==="Control"&&(this.ctrlKeyPressed_=!1)}))}}endInteraction_(){this.trackpadTimeoutId_=void 0;const e=this.getMap();if(!e)return;const t=e.getView(),i=this.lastDelta_?this.lastDelta_>0?1:-1:0;t.endInteraction(this.constrainResolution_||t.getConstrainResolution()?100:void 0,i,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==de.WHEEL)return!0;const i=e.map,r=e.originalEvent;r.preventDefault();const s=r.ctrlKey&&!this.ctrlKeyPressed_;r.ctrlKey||(this.ctrlKeyPressed_=!1),this.useAnchor_&&(this.lastAnchor_=e.pixel);let o=r.deltaY;switch(r.deltaMode){case WheelEvent.DOM_DELTA_LINE:o*=aE;break;case WheelEvent.DOM_DELTA_PAGE:o*=lE;break}if(o===0)return!1;this.lastDelta_=o;const a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?"trackpad":"wheel");const l=i.getView();if(this.mode_==="trackpad")return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),s&&(o=o*cE),l.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=a,!1;this.totalDelta_+=o;const c=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1}handleWheelZoom_(e){const t=e.getView();t.getAnimating()&&t.cancelAnimations();let i=-Ye(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Ju(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 hE extends fo{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=ka),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!==Xu&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(th(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 fE extends fo{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=ka),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(th(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 dE(n){n=n||{};const e=new Yt,t=new Bw(-.005,.05,100);return(n.altShiftDragRotate===void 0||n.altShiftDragRotate)&&e.push(new tE),(n.doubleClickZoom===void 0||n.doubleClickZoom)&&e.push(new Kw({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan===void 0||n.dragPan)&&e.push(new eE({onFocusOnly:n.onFocusOnly,kinetic:t})),(n.pinchRotate===void 0||n.pinchRotate)&&e.push(new hE),(n.pinchZoom===void 0||n.pinchZoom)&&e.push(new fE({duration:n.zoomDuration})),(n.keyboard===void 0||n.keyboard)&&(e.push(new sE),e.push(new oE({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom===void 0||n.mouseWheelZoom)&&e.push(new uE({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom===void 0||n.shiftDragZoom)&&e.push(new rE({duration:n.zoomDuration})),e}const Ge={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 Kp extends Rn{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[Ge.OPACITY]=e.opacity!==void 0?e.opacity:1,Oe(typeof t[Ge.OPACITY]=="number","Layer opacity must be a number"),t[Ge.VISIBLE]=e.visible!==void 0?e.visible:!0,t[Ge.Z_INDEX]=e.zIndex,t[Ge.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,t[Ge.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,t[Ge.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,t[Ge.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=Ye(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 pe()}getLayerStatesArray(e){return pe()}getExtent(){return this.get(Ge.EXTENT)}getMaxResolution(){return this.get(Ge.MAX_RESOLUTION)}getMinResolution(){return this.get(Ge.MIN_RESOLUTION)}getMinZoom(){return this.get(Ge.MIN_ZOOM)}getMaxZoom(){return this.get(Ge.MAX_ZOOM)}getOpacity(){return this.get(Ge.OPACITY)}getSourceState(){return pe()}getVisible(){return this.get(Ge.VISIBLE)}getZIndex(){return this.get(Ge.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(Ge.EXTENT,e)}setMaxResolution(e){this.set(Ge.MAX_RESOLUTION,e)}setMinResolution(e){this.set(Ge.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(Ge.MAX_ZOOM,e)}setMinZoom(e){this.set(Ge.MIN_ZOOM,e)}setOpacity(e){Oe(typeof e=="number","Layer opacity must be a number"),this.set(Ge.OPACITY,e)}setVisible(e){this.set(Ge.VISIBLE,e)}setZIndex(e){this.set(Ge.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Si={ADDLAYER:"addlayer",REMOVELAYER:"removelayer"};class Ii extends an{constructor(e,t){super(e),this.layer=t}}const nh={LAYERS:"layers"};class Mi extends Kp{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(nh.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Yt(i.slice(),{unique:!0}):Oe(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Yt(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(We),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(Te(e,Nt.ADD,this.handleLayersAdd_,this),Te(e,Nt.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(We);qs(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 Ii(Si.ADDLAYER,s))}this.changed()}registerLayerListeners_(e){const t=[Te(e,kr.PROPERTYCHANGE,this.handleLayerChange_,this),Te(e,de.CHANGE,this.handleLayerChange_,this)];e instanceof Mi&&t.push(Te(e,Si.ADDLAYER,this.handleLayerGroupAdd_,this),Te(e,Si.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[_e(e)]=t}handleLayerGroupAdd_(e){this.dispatchEvent(new Ii(Si.ADDLAYER,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new Ii(Si.REMOVELAYER,e.layer))}handleLayersAdd_(e){const t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new Ii(Si.ADDLAYER,t)),this.changed()}handleLayersRemove_(e){const t=e.element,i=_e(t);this.listenerKeys_[i].forEach(We),delete this.listenerKeys_[i],this.dispatchEvent(new Ii(Si.REMOVELAYER,t)),this.changed()}getLayers(){return this.get(nh.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 Ii(Si.REMOVELAYER,i[r]))}this.set(nh.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=cn(l.extent,r.extent):l.extent=r.extent),l.zIndex===void 0&&(l.zIndex=s)}return t}getSourceState(){return"ready"}}const Ht={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class Zr extends Kp{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(Ge.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(Ge.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_&&(We(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const e=this.getSource();e&&(this.sourceChangeKey_=Te(e,de.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 un?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 ih(r,t.viewState)&&(!s||it(s,t.extent))}getAttributions(e){if(!this.isVisible(e))return[];const t=this.getSource()?.getAttributions();if(!t)return[];const i=e instanceof un?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(Ge.MAP,e)}getMapInternal(){return this.get(Ge.MAP)}setMap(e){this.mapPrecomposeKey_&&(We(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(We(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=Te(e,Ht.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=Te(this,de.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){const t=e.frameState.layerStatesArray,i=this.getLayerState(!1);Oe(!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(Ge.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 ih(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 Yp(n,e,t=0,i=n.length-1,r=gE){for(;i>t;){if(i-t>600){const l=i-t+1,c=e-t+1,u=Math.log(l),h=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),d=Math.max(t,Math.floor(e-c*h/l+f)),g=Math.min(i,Math.floor(e+(l-c)*h/l+f));Yp(n,e,d,g,r)}const s=n[e];let o=t,a=i;for(po(n,t,e),r(n[i],s)>0&&po(n,t,i);o<a;){for(po(n,o,a),o++,a--;r(n[o],s)<0;)o++;for(;r(n[a],s)>0;)a--}r(n[t],s)===0?po(n,t,a):(a++,po(n,a,i)),a<=e&&(t=a+1),e<=a&&(i=a-1)}}function po(n,e,t){const i=n[e];n[e]=n[t],n[t]=i}function gE(n,e){return n<e?-1:n>e?1:0}let Zp=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(!ll(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;ll(e,l)&&(t.leaf?i.push(a):sh(e,l)?this._all(a,i):s.push(a))}t=s.pop()}return i}collides(e){let t=this.data;if(!ll(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(ll(e,o)){if(t.leaf||sh(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=Hr([]),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 u=pE(e,i.children,t);if(u!==-1)return i.children.splice(u,1),s.push(i),this._condense(s),this}!c&&!i.leaf&&sh(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=Hr(e.slice(t,i+1)),qr(a,this.toBBox),a;r||(r=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,r-1))),a=Hr([]),a.leaf=!1,a.height=r;const l=Math.ceil(s/o),c=l*Math.ceil(Math.sqrt(o));qp(e,t,i,c,this.compareMinX);for(let u=t;u<=i;u+=c){const h=Math.min(u+c-1,i);qp(e,u,h,l,this.compareMinY);for(let f=u;f<=h;f+=l){const d=Math.min(f+l-1,h);a.children.push(this._build(e,f,d,r-1))}}return qr(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],u=rh(c),h=_E(e,c)-u;h<o?(o=h,s=u<s?u:s,a=c):h===o&&u<s&&(s=u,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),yo(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=Hr(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,qr(i,this.toBBox),qr(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=Hr([e,t]),this.data.height=e.height+1,this.data.leaf=!1,qr(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=mo(e,0,a,this.toBBox),c=mo(e,a,i,this.toBBox),u=xE(l,c),h=rh(l)+rh(c);u<s?(s=u,r=a,o=h<o?h:o):u===s&&h<o&&(o=h,r=a)}return r||i-t}_chooseSplitAxis(e,t,i){const r=e.leaf?this.compareMinX:mE,s=e.leaf?this.compareMinY:yE,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=mo(e,0,t,s),a=mo(e,i-t,i,s);let l=al(o)+al(a);for(let c=t;c<i-t;c++){const u=e.children[c];yo(o,e.leaf?s(u):u),l+=al(o)}for(let c=i-t-1;c>=t;c--){const u=e.children[c];yo(a,e.leaf?s(u):u),l+=al(a)}return l}_adjustParentBBoxes(e,t,i){for(let r=i;r>=0;r--)yo(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():qr(e[t],this.toBBox)}};function pE(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 qr(n,e){mo(n,0,n.children.length,e,n)}function mo(n,e,t,i,r){r||(r=Hr(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];yo(r,n.leaf?i(o):o)}return r}function yo(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 mE(n,e){return n.minX-e.minX}function yE(n,e){return n.minY-e.minY}function rh(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function al(n){return n.maxX-n.minX+(n.maxY-n.minY)}function _E(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 xE(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 sh(n,e){return n.minX<=e.minX&&n.minY<=e.minY&&e.maxX<=n.maxX&&e.maxY<=n.maxY}function ll(n,e){return e.minX<=n.maxX&&e.minY<=n.maxY&&e.maxX>=n.minX&&e.maxY>=n.minY}function Hr(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function qp(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;Yp(n,o,e,t,r),s.push(e,o,o,t)}}const oh=[NaN,NaN,NaN,0];let ah;function vE(){return ah||(ah=Ze(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),ah}const wE=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,EE=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,bE=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,CE=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function cl(n,e){return n.endsWith("%")?Number(n.substring(0,n.length-1))/e:Number(n)}function _o(n){throw new Error('failed to parse "'+n+'" as color')}function Hp(n){if(n.toLowerCase().startsWith("rgb")){const s=n.match(EE)||n.match(wE)||n.match(bE);if(s){const o=s[4],a=100/255;return[Ye(cl(s[1],a)+.5|0,0,255),Ye(cl(s[2],a)+.5|0,0,255),Ye(cl(s[3],a)+.5|0,0,255),o!==void 0?Ye(cl(o,100),0,1):1]}_o(n)}if(n.startsWith("#")){if(CE.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 u=parseInt(s.substring(l,l+o),16);o===1&&(u+=u<<4),a[l/o]=u}return a[3]=a[3]/255,a}_o(n)}const e=vE();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&&_o(n));const i=e.fillStyle;if(i.startsWith("#")||i.startsWith("rgba"))return Hp(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]=Ga(r[3]/255,3),r}function TE(n){return typeof n=="string"?n:dh(n)}const RE=1024,xo={};let lh=0;function SE(n){if(n.length===4)return n;const e=n.slice();return e[3]=1,e}function ch(n){return n>.0031308?Math.pow(n,.4166666666666667)*269.025-14.025:n*3294.6}function uh(n){return n>.2068965?Math.pow(n,3):(n-.13793103448275862)*.12841854934601665}function hh(n){return n>10.314724?Math.pow((n+14.025)/269.025,2.4):n/3294.6}function fh(n){return n>.0088564?Math.pow(n,.3333333333333333):n/.12841854934601665+.13793103448275862}function Jp(n){const e=hh(n[0]),t=hh(n[1]),i=hh(n[2]),r=fh(e*.222488403+t*.716873169+i*.06060791),s=500*(fh(e*.452247074+t*.399439023+i*.148375274)-r),o=200*(r-fh(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 IE(n){const e=(n[0]+16)/116,t=n[1],i=n[2]*Math.PI/180,r=uh(e),s=uh(e+t/500*Math.cos(i)),o=uh(e-t/200*Math.sin(i)),a=ch(s*3.021973625-r*1.617392459-o*.404875592),l=ch(s*-.943766287+r*1.916279586+o*.027607165),c=ch(s*.069407491-r*.22898585+o*1.159737864);return[Ye(a+.5|0,0,255),Ye(l+.5|0,0,255),Ye(c+.5|0,0,255),n[3]]}function ul(n){if(n==="none")return oh;if(xo.hasOwnProperty(n))return xo[n];if(lh>=RE){let t=0;for(const i in xo)(t++&3)===0&&(delete xo[i],--lh)}const e=Hp(n);e.length!==4&&_o(n);for(const t of e)isNaN(t)&&_o(n);return xo[n]=e,++lh,e}function or(n){return Array.isArray(n)?n:ul(n)}function dh(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 Qp(n){return n[0]>0&&n[1]>0}function ME(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 bt(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}let ar=0;const Mt=1<<ar++,Re=1<<ar++,jt=1<<ar++,hn=1<<ar++,lr=1<<ar++,vo=1<<ar++,hl=Math.pow(2,ar)-1,gh={[Mt]:"boolean",[Re]:"number",[jt]:"string",[hn]:"color",[lr]:"number[]",[vo]:"size"},AE=Object.keys(gh).map(Number).sort(Cn);function PE(n){return n in gh}function wo(n){const e=[];for(const t of AE)Eo(n,t)&&e.push(gh[t]);return e.length===0?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}function Eo(n,e){return(n&e)===e}function Ai(n,e){return n===e}class dt{constructor(e,t){if(!PE(e))throw new Error(`literal expressions must have a specific type, got ${wo(e)}`);this.type=e,this.value=t}}class FE{constructor(e,t,...i){this.type=e,this.operator=t,this.args=i}}function em(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mCoordinate:!1,mapState:!1}}function mt(n,e,t){switch(typeof n){case"boolean":{if(Ai(e,jt))return new dt(jt,n?"true":"false");if(!Eo(e,Mt))throw new Error(`got a boolean, but expected ${wo(e)}`);return new dt(Mt,n)}case"number":{if(Ai(e,vo))return new dt(vo,bt(n));if(Ai(e,Mt))return new dt(Mt,!!n);if(Ai(e,jt))return new dt(jt,n.toString());if(!Eo(e,Re))throw new Error(`got a number, but expected ${wo(e)}`);return new dt(Re,n)}case"string":{if(Ai(e,hn))return new dt(hn,ul(n));if(Ai(e,Mt))return new dt(Mt,!!n);if(!Eo(e,jt))throw new Error(`got a string, but expected ${wo(e)}`);return new dt(jt,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 UE(n,e,t);for(const i of n)if(typeof i!="number")throw new Error("expected an array of numbers");if(Ai(e,vo)){if(n.length!==2)throw new Error(`expected an array of two values for a size, got ${n.length}`);return new dt(vo,n)}if(Ai(e,hn)){if(n.length===3)return new dt(hn,[...n,1]);if(n.length===4)return new dt(hn,n);throw new Error(`expected an array of 3 or 4 values for a color, got ${n.length}`)}if(!Eo(e,lr))throw new Error(`got an array of numbers, but expected ${wo(e)}`);return new dt(lr,n)}const j={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"},OE={[j.Get]:me(Ce(1,1/0),tm),[j.Var]:me(Ce(1,1),LE),[j.Has]:me(Ce(1,1/0),tm),[j.Id]:me(DE,Jr),[j.Concat]:me(Ce(2,1/0),De(jt)),[j.GeometryType]:me(kE,Jr),[j.LineMetric]:me(NE,Jr),[j.Resolution]:me(ph,Jr),[j.Zoom]:me(ph,Jr),[j.Time]:me(ph,Jr),[j.Any]:me(Ce(2,1/0),De(Mt)),[j.All]:me(Ce(2,1/0),De(Mt)),[j.Not]:me(Ce(1,1),De(Mt)),[j.Equal]:me(Ce(2,2),De(hl)),[j.NotEqual]:me(Ce(2,2),De(hl)),[j.GreaterThan]:me(Ce(2,2),De(Re)),[j.GreaterThanOrEqualTo]:me(Ce(2,2),De(Re)),[j.LessThan]:me(Ce(2,2),De(Re)),[j.LessThanOrEqualTo]:me(Ce(2,2),De(Re)),[j.Multiply]:me(Ce(2,1/0),nm),[j.Coalesce]:me(Ce(2,1/0),nm),[j.Divide]:me(Ce(2,2),De(Re)),[j.Add]:me(Ce(2,1/0),De(Re)),[j.Subtract]:me(Ce(2,2),De(Re)),[j.Clamp]:me(Ce(3,3),De(Re)),[j.Mod]:me(Ce(2,2),De(Re)),[j.Pow]:me(Ce(2,2),De(Re)),[j.Abs]:me(Ce(1,1),De(Re)),[j.Floor]:me(Ce(1,1),De(Re)),[j.Ceil]:me(Ce(1,1),De(Re)),[j.Round]:me(Ce(1,1),De(Re)),[j.Sin]:me(Ce(1,1),De(Re)),[j.Cos]:me(Ce(1,1),De(Re)),[j.Atan]:me(Ce(1,2),De(Re)),[j.Sqrt]:me(Ce(1,1),De(Re)),[j.Match]:me(Ce(4,1/0),im,GE),[j.Between]:me(Ce(3,3),De(Re)),[j.Interpolate]:me(Ce(6,1/0),im,jE),[j.Case]:me(Ce(3,1/0),zE,WE),[j.In]:me(Ce(2,2),VE),[j.Number]:me(Ce(1,1/0),De(hl)),[j.String]:me(Ce(1,1/0),De(hl)),[j.Array]:me(Ce(1,1/0),De(Re)),[j.Color]:me(Ce(1,4),De(Re)),[j.Band]:me(Ce(1,3),De(Re)),[j.Palette]:me(Ce(2,2),XE),[j.ToString]:me(Ce(1,1),De(Mt|Re|jt|hn))};function tm(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 dt(Re,o);break}case"string":{r[s]=new dt(jt,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 LE(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 dt(jt,i)]}function DE(n,e,t){t.featureId=!0}function kE(n,e,t){t.geometryType=!0}function NE(n,e,t){t.mCoordinate=!0}function ph(n,e,t){t.mapState=!0}function Jr(n,e,t){const i=n[0];if(n.length!==1)throw new Error(`expected no arguments for ${i} operation`);return[]}function Ce(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 nm(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;s<i;++s){const o=mt(n[s+1],e,t);r[s]=o}return r}function De(n){return function(e,t,i){const r=e.length-1,s=new Array(r);for(let o=0;o<r;++o){const a=mt(e[o+1],n,i);s[o]=a}return s}}function zE(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 im(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 GE(n,e,t){const i=n.length-1,r=jt|Re|Mt,s=mt(n[1],r,t),o=mt(n[n.length-1],e,t),a=new Array(i-2);for(let l=0;l<i-2;l+=2){try{const c=mt(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=mt(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 jE(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 dt(Re,r);let o;try{o=mt(n[2],Re,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=mt(n[l+3],Re,t);a[l]=c}catch(c){throw new Error(`failed to parse argument ${l+2} for interpolate expression: ${c.message}`)}try{const c=mt(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 WE(n,e,t){const i=mt(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=mt(n[s+1],Mt,t);r[s]=o}catch(o){throw new Error(`failed to parse argument ${s} of case expression: ${o.message}`)}try{const o=mt(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 VE(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(i[0]==="literal"){if(i=i[1],!Array.isArray(i))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array')}else if(typeof i[0]=="string")throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');typeof i[0]=="string"?r=jt:r=Re;const s=new Array(i.length);for(let a=0;a<s.length;a++)try{const l=mt(i[a],r,t);s[a]=l}catch(l){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${l.message}`)}return[mt(n[1],r,t),...s]}function XE(n,e,t){let i;try{i=mt(n[1],Re,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=mt(r[o],hn,t)}catch(l){throw new Error(`failed to parse color at index ${o} in palette expression: ${l.message}`)}if(!(a instanceof dt))throw new Error(`the palette color at index ${o} must be a literal value`);s[o]=a}return[i,...s]}function me(...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 FE(t,r,...s)}}function UE(n,e,t){const i=n[0],r=OE[i];if(!r)throw new Error(`unknown operator: ${i}`);return r(n,e,t)}function rm(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 rm(n.getGeometries()[0]);default:return""}}function sm(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function In(n,e,t){const i=mt(n,e,t);return fn(i)}function fn(n,e){if(n instanceof dt){if(n.type===hn&&typeof n.value=="string"){const i=ul(n.value);return function(){return i}}return function(){return n.value}}const t=n.operator;switch(t){case j.Number:case j.String:case j.Coalesce:return BE(n);case j.Get:case j.Var:case j.Has:return $E(n);case j.Id:return i=>i.featureId;case j.GeometryType:return i=>i.geometryType;case j.Concat:{const i=n.args.map(r=>fn(r));return r=>"".concat(...i.map(s=>s(r).toString()))}case j.Resolution:return i=>i.resolution;case j.Any:case j.All:case j.Between:case j.In:case j.Not:return YE(n);case j.Equal:case j.NotEqual:case j.LessThan:case j.LessThanOrEqualTo:case j.GreaterThan:case j.GreaterThanOrEqualTo:return KE(n);case j.Multiply:case j.Divide:case j.Add:case j.Subtract:case j.Clamp:case j.Mod:case j.Pow:case j.Abs:case j.Floor:case j.Ceil:case j.Round:case j.Sin:case j.Cos:case j.Atan:case j.Sqrt:return ZE(n);case j.Case:return qE(n);case j.Match:return HE(n);case j.Interpolate:return JE(n);case j.ToString:return QE(n);default:throw new Error(`Unsupported operator ${t}`)}}function BE(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=fn(n.args[s]);switch(t){case j.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 j.Number:case j.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 $E(n,e){const i=n.args[0].value;switch(n.operator){case j.Get:return r=>{const s=n.args;let o=r.properties[i];for(let a=1,l=s.length;a<l;++a){const u=s[a].value;o=o[u]}return o};case j.Var:return r=>r.variables[i];case j.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 u=s[a].value;if(!o||!Object.hasOwn(o,u))return!1;o=o[u]}return!0};default:throw new Error(`Unsupported accessor operator ${n.operator}`)}}function KE(n,e){const t=n.operator,i=fn(n.args[0]),r=fn(n.args[1]);switch(t){case j.Equal:return s=>i(s)===r(s);case j.NotEqual:return s=>i(s)!==r(s);case j.LessThan:return s=>i(s)<r(s);case j.LessThanOrEqualTo:return s=>i(s)<=r(s);case j.GreaterThan:return s=>i(s)>r(s);case j.GreaterThanOrEqualTo:return s=>i(s)>=r(s);default:throw new Error(`Unsupported comparison operator ${t}`)}}function YE(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=fn(n.args[s]);switch(t){case j.Any:return s=>{for(let o=0;o<i;++o)if(r[o](s))return!0;return!1};case j.All:return s=>{for(let o=0;o<i;++o)if(!r[o](s))return!1;return!0};case j.Between:return s=>{const o=r[0](s),a=r[1](s),l=r[2](s);return o>=a&&o<=l};case j.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 j.Not:return s=>!r[0](s);default:throw new Error(`Unsupported logical operator ${t}`)}}function ZE(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=fn(n.args[s]);switch(t){case j.Multiply:return s=>{let o=1;for(let a=0;a<i;++a)o*=r[a](s);return o};case j.Divide:return s=>r[0](s)/r[1](s);case j.Add:return s=>{let o=0;for(let a=0;a<i;++a)o+=r[a](s);return o};case j.Subtract:return s=>r[0](s)-r[1](s);case j.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 j.Mod:return s=>r[0](s)%r[1](s);case j.Pow:return s=>Math.pow(r[0](s),r[1](s));case j.Abs:return s=>Math.abs(r[0](s));case j.Floor:return s=>Math.floor(r[0](s));case j.Ceil:return s=>Math.ceil(r[0](s));case j.Round:return s=>Math.round(r[0](s));case j.Sin:return s=>Math.sin(r[0](s));case j.Cos:return s=>Math.cos(r[0](s));case j.Atan:return i===2?s=>Math.atan2(r[0](s),r[1](s)):s=>Math.atan(r[0](s));case j.Sqrt:return s=>Math.sqrt(r[0](s));default:throw new Error(`Unsupported numeric operator ${t}`)}}function qE(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=fn(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 HE(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=fn(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 JE(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=fn(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 u=i[c](r);let h=i[c+1](r);const f=Array.isArray(h);if(f&&(h=SE(h)),u>=o)return c===2?h:f?eb(s,o,a,l,u,h):bo(s,o,a,l,u,h);a=u,l=h}return l}}function QE(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=fn(n.args[s]);if(t===j.ToString)return s=>{const o=r[0](s);return n.args[0].type===hn?dh(o):o.toString()};throw new Error(`Unsupported convert operator ${t}`)}function bo(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 eb(n,e,t,i,r,s){if(r-t===0)return i;const a=Jp(i),l=Jp(s);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const u=[bo(n,e,t,a[0],r,l[0]),bo(n,e,t,a[1],r,l[1]),a[2]+bo(n,e,t,0,r,c),bo(n,e,t,i[3],r,s[3])];return IE(u)}const re={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class mh extends eo{constructor(e,t,i,r){super(),this.extent=e,this.pixelRatio_=i,this.resolution=t,this.state=typeof r=="function"?re.IDLE:r,this.image_=null,this.loader=typeof r=="function"?r:null}changed(){this.dispatchEvent(de.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==re.IDLE&&this.loader){this.state=re.LOADING,this.changed();const e=this.getResolution(),t=Array.isArray(e)?e[0]:e;Nr(()=>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||dv&&i instanceof ImageBitmap||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement)&&(this.image_=i),this.state=re.LOADED}).catch(i=>{this.state=re.ERROR,console.error(i)}).finally(()=>this.changed())}}setImage(e){this.image_=e}setResolution(e){this.resolution=e}}function tb(n,e,t){const i=n;let r=!0,s=!1,o=!1;const a=[La(i,de.LOAD,function(){o=!0,s||e()})];return i.src&&zg?(s=!0,i.decode().then(function(){r&&e()}).catch(function(l){r&&(o?e():t())})):a.push(La(i,de.ERROR,t)),function(){r=!1,a.forEach(We)}}function nb(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 ib(n,e){return e&&(n.src=e),n.src&&zg?new Promise((t,i)=>n.decode().then(()=>t(n)).catch(r=>n.complete&&n.width?t(n):i(r))):nb(n)}class rb{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){const i=yh(e,t);return i in this.cache_?this.cache_[i]:null}getPattern(e,t){const i=yh(e,t);return i in this.patternCache_?this.patternCache_[i]:null}set(e,t,i,r){const s=yh(e,t),o=s in this.cache_;this.cache_[s]=i,r&&(i.getImageState()===re.IDLE&&i.load(),i.getImageState()===re.LOADING?i.ready().then(()=>{this.patternCache_[s]=ol().createPattern(i.getImage(1),"repeat")}):this.patternCache_[s]=ol().createPattern(i.getImage(1),"repeat")),o||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function yh(n,e){const t=e?or(e):"null";return n+":"+t}const Jt=new rb;let Co=null;class om extends eo{constructor(e,t,i,r,s){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=i?.crossOrigin,this.referrerPolicy_=i?.referrerPolicy,this.canvas_={},this.color_=s,this.imageState_=r===void 0?re.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_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===re.LOADED){Co||(Co=Ze(1,1,void 0,{willReadFrequently:!0})),Co.drawImage(this.image_,0,0);try{Co.getImageData(0,0,1,1),this.tainted_=!1}catch{Co=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(de.CHANGE)}handleImageError_(){this.imageState_=re.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=re.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_}setImage(e){this.image_=e}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=Ze(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_===re.IDLE){this.image_||this.initializeImage_(),this.imageState_=re.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&ib(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_!==re.LOADED)return;const t=this.image_,i=Ze(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=TE(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_===re.LOADED||this.imageState_===re.ERROR)e();else{const t=()=>{(this.imageState_===re.LOADED||this.imageState_===re.ERROR)&&(this.removeEventListener(de.CHANGE,t),e())};this.addEventListener(de.CHANGE,t)}})),this.ready_}}function To(n,e,t,i,r,s){let o=e===void 0?void 0:Jt.get(e,r);return o||(o=new om(n,n&&"src"in n?n.src||void 0:e,t,i,r),Jt.set(e,r,o,s)),s&&o&&!Jt.getPattern(e,r)&&Jt.set(e,r,o,s),o}function Mn(n){return n?Array.isArray(n)?dh(n):typeof n=="object"&&"src"in n?sb(n):n:null}function sb(n){if(!n.offset||!n.size)return Jt.getPattern(n.src,n.color);const e=n.src+":"+n.offset,t=Jt.getPattern(e,n.color);if(t)return t;const i=Jt.get(n.src,null);if(i.getImageState()!==re.LOADED)return null;const r=Ze(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]),To(r.canvas,e,void 0,re.LOADED,n.color,!0),Jt.getPattern(e,n.color)}const am="10px sans-serif",Wt="#000",Qr="round",Hn=[],Jn=0,es="round",Ro=10,ob=0,An="#000",So="center",fl="middle",cr=[0,0,0,0],Io=1,ur=new Rn;let Mo=null,lm;const _h={},ab=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function lb(n,e,t){return`${n} ${e} 16px "${t}"`}const cb=(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=Zu(s),l=a.families[0].toLowerCase(),c=a.weight;return o.some(u=>{const h=u.family.replace(/^['"]|['"]$/g,"").toLowerCase(),f=Yu[u.weight]||u.weight;return h===l&&u.style===a.style&&f==c})}async function r(){await t.ready;let s=!0;const o=ur.getProperties(),a=Object.keys(o).filter(l=>o[l]<100);for(let l=a.length-1;l>=0;--l){const c=a[l];let u=o[c];u<100&&(await i(c)?(qs(_h),ur.set(c,100)):(u+=10,ur.set(c,u,!0),u<100&&(s=!1)))}e=void 0,s||(e=setTimeout(r,100))}return async function(s){t||(t=vt?self.fonts:document.fonts);const o=Zu(s);if(!o)return;const a=o.families;let l=!1;for(const c of a){if(ab.has(c))continue;const u=lb(o.style,o.weight,c);ur.get(u)===void 0&&(ur.set(u,0,!0),l=!0)}l&&(clearTimeout(e),e=setTimeout(r,100))}})(),ub=(function(){let n;return function(e){let t=_h[e];if(t==null){if(vt){const i=Zu(e),r=cm(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);_h[e]=t}return t}})();function cm(n,e){return Mo||(Mo=Ze(1,1)),n!=lm&&(Mo.font=n,lm=Mo.font),Mo.measureText(e)}function um(n,e){return cm(n,e).width}function hm(n,e,t){if(e in t)return t[e];const i=e.split(`
3
+ `,...gx(r)),console.warn(...s)}xn(),Nc=!1}function dx(){let n=zs[zs.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const i=n.component&&n.component.parent;n=i&&i.vnode}return e}function gx(n){const e=[];return n.forEach((t,i)=>{e.push(...i===0?[]:[`
4
+ `],...px(t))}),e}function px({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",i=n.component?n.component.parent==null:!1,r=` at <${vg(n.component,n.type,i)}`,s=">"+t;return n.props?[r,...mx(n.props),s]:[r+s]}function mx(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(i=>{e.push(...Rd(i,n[i]))}),t.length>3&&e.push(" ..."),e}function Rd(n,e,t){return st(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:tt(e)?(e=Rd(n,Ae(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):ve(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=Ae(e),t?e:[`${n}=`,e])}function Ar(n,e,t,i){try{return i?n(...i):n()}catch(r){Ca(r,e,t)}}function on(n,e,t,i){if(ve(n)){const r=Ar(n,e,t,i);return r&&ed(r)&&r.catch(s=>{Ca(s,e,t)}),r}if(Ee(n)){const r=[];for(let s=0;s<n.length;s++)r.push(on(n[s],e,t,i));return r}}function Ca(n,e,t,i=!0){const r=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||Xe;if(e){let a=e.parent;const l=e.proxy,c=`https://vuejs.org/error-reference/#runtime-${t}`;for(;a;){const u=a.ec;if(u){for(let h=0;h<u.length;h++)if(u[h](n,l,c)===!1)return}a=a.parent}if(s){_n(),Ar(s,null,10,[n,l,c]),xn();return}}yx(n,t,r,i,o)}function yx(n,e,t,i=!0,r=!1){if(r)throw n;console.error(n)}const St=[];let wn=-1;const Pr=[];let gi=null,Fr=0;const Sd=Promise.resolve();let Ta=null;function zc(n){const e=Ta||Sd;return n?e.then(this?n.bind(this):n):e}function _x(n){let e=wn+1,t=St.length;for(;e<t;){const i=e+t>>>1,r=St[i],s=Gs(r);s<n||s===n&&r.flags&2?e=i+1:t=i}return e}function Gc(n){if(!(n.flags&1)){const e=Gs(n),t=St[St.length-1];!t||!(n.flags&2)&&e>=Gs(t)?St.push(n):St.splice(_x(e),0,n),n.flags|=1,Id()}}function Id(){Ta||(Ta=Sd.then(Pd))}function xx(n){Ee(n)?Pr.push(...n):gi&&n.id===-1?gi.splice(Fr+1,0,n):n.flags&1||(Pr.push(n),n.flags|=1),Id()}function Md(n,e,t=wn+1){for(;t<St.length;t++){const i=St[t];if(i&&i.flags&2){if(n&&i.id!==n.uid)continue;St.splice(t,1),t--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function Ad(n){if(Pr.length){const e=[...new Set(Pr)].sort((t,i)=>Gs(t)-Gs(i));if(Pr.length=0,gi){gi.push(...e);return}for(gi=e,Fr=0;Fr<gi.length;Fr++){const t=gi[Fr];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}gi=null,Fr=0}}const Gs=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Pd(n){try{for(wn=0;wn<St.length;wn++){const e=St[wn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Ar(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;wn<St.length;wn++){const e=St[wn];e&&(e.flags&=-2)}wn=-1,St.length=0,Ad(),Ta=null,(St.length||Pr.length)&&Pd()}}let En=null,Fd=null;function Ra(n){const e=En;return En=n,Fd=n&&n.type.__scopeId||null,e}function vx(n,e=En,t){if(!e||n._n)return n;const i=(...r)=>{i._d&&fg(-1);const s=Ra(e);let o;try{o=n(...r)}finally{Ra(s),i._d&&fg(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Bi(n,e,t,i){const r=n.dirs,s=e&&e.dirs;for(let o=0;o<r.length;o++){const a=r[o];s&&(a.oldValue=s[o].value);let l=a.dir[i];l&&(_n(),on(l,t,8,[n.el,a,n,e]),xn())}}function wx(n,e){if(Mt){let t=Mt.provides;const i=Mt.parent&&Mt.parent.provides;i===t&&(t=Mt.provides=Object.create(i)),t[n]=e}}function Or(n,e,t=!1){const i=b1();if(i||Lr){let r=Lr?Lr._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&n in r)return r[n];if(arguments.length>1)return t&&ve(e)?e.call(i&&i.proxy):e}}const Ex=Symbol.for("v-scx"),bx=()=>Or(Ex);function Cx(n,e){return jc(n,null,e)}function pi(n,e,t){return jc(n,e,t)}function jc(n,e,t=Xe){const{immediate:i,deep:r,flush:s,once:o}=t,a=xt({},t),l=e&&i||!e&&s!=="post";let c;if(Ys){if(s==="sync"){const d=bx();c=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=pn,d.resume=pn,d.pause=pn,d}}const u=Mt;a.call=(d,g,p)=>on(d,u,g,p);let h=!1;s==="post"?a.scheduler=d=>{kt(d,u&&u.suspense)}:s!=="sync"&&(h=!0,a.scheduler=(d,g)=>{g?d():Gc(d)}),a.augmentJob=d=>{e&&(d.flags|=4),h&&(d.flags|=2,u&&(d.id=u.uid,d.i=u))};const f=fx(n,e,a);return Ys&&(c?c.push(f):l&&f()),f}function Tx(n,e,t){const i=this.proxy,r=st(n)?n.includes(".")?Od(i,n):()=>i[n]:n.bind(i,i);let s;ve(e)?s=e:(s=e.handler,t=e);const o=Ks(this),a=jc(r,s.bind(i),t);return o(),a}function Od(n,e){const t=e.split(".");return()=>{let i=n;for(let r=0;r<t.length&&i;r++)i=i[t[r]];return i}}const Rx=Symbol("_vte"),Sx=n=>n.__isTeleport,Wc=Symbol("_leaveCb");function Vc(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Vc(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function Ld(n){n.ids=[n.ids[0]+n.ids[2]+++"-",0,0]}function Dd(n,e){let t;return!!((t=Object.getOwnPropertyDescriptor(n,e))&&!t.configurable)}const Sa=new WeakMap;function js(n,e,t,i,r=!1){if(Ee(n)){n.forEach((p,m)=>js(p,e&&(Ee(e)?e[m]:e),t,i,r));return}if(Ws(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&js(n,e,t,i.component.subTree);return}const s=i.shapeFlag&4?eu(i.component):i.el,o=r?null:s,{i:a,r:l}=n,c=e&&e.r,u=a.refs===Xe?a.refs={}:a.refs,h=a.setupState,f=Ae(h),d=h===Xe?Jf:p=>Dd(u,p)?!1:Ne(f,p),g=(p,m)=>!(m&&Dd(u,m));if(c!=null&&c!==l){if(kd(e),st(c))u[c]=null,d(c)&&(h[c]=null);else if(tt(c)){const p=e;g(c,p.k)&&(c.value=null),p.k&&(u[p.k]=null)}}if(ve(l))Ar(l,a,12,[o,u]);else{const p=st(l),m=tt(l);if(p||m){const y=()=>{if(n.f){const _=p?d(l)?h[l]:u[l]:g()||!n.k?l.value:u[n.k];if(r)Ee(_)&&vc(_,s);else if(Ee(_))_.includes(s)||_.push(s);else if(p)u[l]=[s],d(l)&&(h[l]=u[l]);else{const w=[s];g(l,n.k)&&(l.value=w),n.k&&(u[n.k]=w)}}else p?(u[l]=o,d(l)&&(h[l]=o)):m&&(g(l,n.k)&&(l.value=o),n.k&&(u[n.k]=o))};if(o){const _=()=>{y(),Sa.delete(n)};_.id=-1,Sa.set(n,_),kt(_,t)}else kd(n),y()}}}function kd(n){const e=Sa.get(n);e&&(e.flags|=8,Sa.delete(n))}ua().requestIdleCallback,ua().cancelIdleCallback;const Ws=n=>!!n.type.__asyncLoader,Nd=n=>n.type.__isKeepAlive;function Ix(n,e){zd(n,"a",e)}function Mx(n,e){zd(n,"da",e)}function zd(n,e,t=Mt){const i=n.__wdc||(n.__wdc=()=>{let r=t;for(;r;){if(r.isDeactivated)return;r=r.parent}return n()});if(Ia(e,i,t),t){let r=t.parent;for(;r&&r.parent;)Nd(r.parent.vnode)&&Ax(i,e,t,r),r=r.parent}}function Ax(n,e,t,i){const r=Ia(e,n,i,!0);jd(()=>{vc(i[e],r)},t)}function Ia(n,e,t=Mt,i=!1){if(t){const r=t[n]||(t[n]=[]),s=e.__weh||(e.__weh=(...o)=>{_n();const a=Ks(t),l=on(e,t,n,o);return a(),xn(),l});return i?r.unshift(s):r.push(s),s}}const Gn=n=>(e,t=Mt)=>{(!Ys||n==="sp")&&Ia(n,(...i)=>e(...i),t)},Px=Gn("bm"),Gd=Gn("m"),Fx=Gn("bu"),Ox=Gn("u"),Lx=Gn("bum"),jd=Gn("um"),Dx=Gn("sp"),kx=Gn("rtg"),Nx=Gn("rtc");function zx(n,e=Mt){Ia("ec",n,e)}const Gx=Symbol.for("v-ndc"),Xc=n=>n?yg(n)?eu(n):Xc(n.parent):null,Vs=xt(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>Xc(n.parent),$root:n=>Xc(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>Ud(n),$forceUpdate:n=>n.f||(n.f=()=>{Gc(n.update)}),$nextTick:n=>n.n||(n.n=zc.bind(n.proxy)),$watch:n=>Tx.bind(n)}),Uc=(n,e)=>n!==Xe&&!n.__isScriptSetup&&Ne(n,e),jx={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=n;if(e[0]!=="$"){const f=o[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return r[e];case 4:return t[e];case 3:return s[e]}else{if(Uc(i,e))return o[e]=1,i[e];if(r!==Xe&&Ne(r,e))return o[e]=2,r[e];if(Ne(s,e))return o[e]=3,s[e];if(t!==Xe&&Ne(t,e))return o[e]=4,t[e];Bc&&(o[e]=0)}}const c=Vs[e];let u,h;if(c)return e==="$attrs"&&vt(n.attrs,"get",""),c(n);if((u=a.__cssModules)&&(u=u[e]))return u;if(t!==Xe&&Ne(t,e))return o[e]=4,t[e];if(h=l.config.globalProperties,Ne(h,e))return h[e]},set({_:n},e,t){const{data:i,setupState:r,ctx:s}=n;return Uc(r,e)?(r[e]=t,!0):i!==Xe&&Ne(i,e)?(i[e]=t,!0):Ne(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(s[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:r,props:s,type:o}},a){let l;return!!(t[a]||n!==Xe&&a[0]!=="$"&&Ne(n,a)||Uc(e,a)||Ne(s,a)||Ne(i,a)||Ne(Vs,a)||Ne(r.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:Ne(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function Wd(n){return Ee(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}let Bc=!0;function Wx(n){const e=Ud(n),t=n.proxy,i=n.ctx;Bc=!1,e.beforeCreate&&Vd(e.beforeCreate,n,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:h,mounted:f,beforeUpdate:d,updated:g,activated:p,deactivated:m,beforeDestroy:y,beforeUnmount:_,destroyed:w,unmounted:x,render:v,renderTracked:T,renderTriggered:R,errorCaptured:C,serverPrefetch:S,expose:L,inheritAttrs:B,components:K,directives:F,filters:P}=e;if(c&&Vx(c,i,null),o)for(const X in o){const z=o[X];ve(z)&&(i[X]=z.bind(t))}if(r){const X=r.call(t,t);Ue(X)&&(n.data=ya(X))}if(Bc=!0,s)for(const X in s){const z=s[X],M=ve(z)?z.bind(t,t):ve(z.get)?z.get.bind(t,t):pn,ne=!ve(z)&&ve(z.set)?z.set.bind(t):pn,le=Yi({get:M,set:ne});Object.defineProperty(i,X,{enumerable:!0,configurable:!0,get:()=>le.value,set:ge=>le.value=ge})}if(a)for(const X in a)Xd(a[X],i,t,X);if(l){const X=ve(l)?l.call(t):l;Reflect.ownKeys(X).forEach(z=>{wx(z,X[z])})}u&&Vd(u,n,"c");function W(X,z){Ee(z)?z.forEach(M=>X(M.bind(t))):z&&X(z.bind(t))}if(W(Px,h),W(Gd,f),W(Fx,d),W(Ox,g),W(Ix,p),W(Mx,m),W(zx,C),W(Nx,T),W(kx,R),W(Lx,_),W(jd,x),W(Dx,S),Ee(L))if(L.length){const X=n.exposed||(n.exposed={});L.forEach(z=>{Object.defineProperty(X,z,{get:()=>t[z],set:M=>t[z]=M,enumerable:!0})})}else n.exposed||(n.exposed={});v&&n.render===pn&&(n.render=v),B!=null&&(n.inheritAttrs=B),K&&(n.components=K),F&&(n.directives=F),S&&Ld(n)}function Vx(n,e,t=pn){Ee(n)&&(n=$c(n));for(const i in n){const r=n[i];let s;Ue(r)?"default"in r?s=Or(r.from||i,r.default,!0):s=Or(r.from||i):s=Or(r),tt(s)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[i]=s}}function Vd(n,e,t){on(Ee(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function Xd(n,e,t,i){let r=i.includes(".")?Od(t,i):()=>t[i];if(st(n)){const s=e[n];ve(s)&&pi(r,s)}else if(ve(n))pi(r,n.bind(t));else if(Ue(n))if(Ee(n))n.forEach(s=>Xd(s,e,t,i));else{const s=ve(n.handler)?n.handler.bind(t):e[n.handler];ve(s)&&pi(r,s,n)}}function Ud(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=n.appContext,a=s.get(e);let l;return a?l=a:!r.length&&!t&&!i?l=e:(l={},r.length&&r.forEach(c=>Ma(l,c,o,!0)),Ma(l,e,o)),Ue(e)&&s.set(e,l),l}function Ma(n,e,t,i=!1){const{mixins:r,extends:s}=e;s&&Ma(n,s,t,!0),r&&r.forEach(o=>Ma(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=Xx[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const Xx={data:Bd,props:$d,emits:$d,methods:Xs,computed:Xs,beforeCreate:It,created:It,beforeMount:It,mounted:It,beforeUpdate:It,updated:It,beforeDestroy:It,beforeUnmount:It,destroyed:It,unmounted:It,activated:It,deactivated:It,errorCaptured:It,serverPrefetch:It,components:Xs,directives:Xs,watch:Bx,provide:Bd,inject:Ux};function Bd(n,e){return e?n?function(){return xt(ve(n)?n.call(this,this):n,ve(e)?e.call(this,this):e)}:e:n}function Ux(n,e){return Xs($c(n),$c(e))}function $c(n){if(Ee(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function It(n,e){return n?[...new Set([].concat(n,e))]:e}function Xs(n,e){return n?xt(Object.create(null),n,e):e}function $d(n,e){return n?Ee(n)&&Ee(e)?[...new Set([...n,...e])]:xt(Object.create(null),Wd(n),Wd(e??{})):e}function Bx(n,e){if(!n)return e;if(!e)return n;const t=xt(Object.create(null),n);for(const i in e)t[i]=It(n[i],e[i]);return t}function Kd(){return{app:null,config:{isNativeTag:Jf,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let $x=0;function Kx(n,e){return function(i,r=null){ve(i)||(i=xt({},i)),r!=null&&!Ue(r)&&(r=null);const s=Kd(),o=new WeakSet,a=[];let l=!1;const c=s.app={_uid:$x++,_component:i,_props:r,_container:null,_context:s,_instance:null,version:F1,get config(){return s.config},set config(u){},use(u,...h){return o.has(u)||(u&&ve(u.install)?(o.add(u),u.install(c,...h)):ve(u)&&(o.add(u),u(c,...h))),c},mixin(u){return s.mixins.includes(u)||s.mixins.push(u),c},component(u,h){return h?(s.components[u]=h,c):s.components[u]},directive(u,h){return h?(s.directives[u]=h,c):s.directives[u]},mount(u,h,f){if(!l){const d=c._ceVNode||Ki(i,r);return d.appContext=s,f===!0?f="svg":f===!1&&(f=void 0),n(d,u,f),l=!0,c._container=u,u.__vue_app__=c,eu(d.component)}},onUnmount(u){a.push(u)},unmount(){l&&(on(a,c._instance,16),n(null,c._container),delete c._container.__vue_app__)},provide(u,h){return s.provides[u]=h,c},runWithContext(u){const h=Lr;Lr=c;try{return u()}finally{Lr=h}}};return c}}let Lr=null;const Yx=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${rn(e)}Modifiers`]||n[`${Vi(e)}Modifiers`];function Zx(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||Xe;let r=t;const s=e.startsWith("update:"),o=s&&Yx(i,e.slice(7));o&&(o.trim&&(r=t.map(u=>st(u)?u.trim():u)),o.number&&(r=t.map(S0)));let a,l=i[a=wc(e)]||i[a=wc(rn(e))];!l&&s&&(l=i[a=wc(Vi(e))]),l&&on(l,n,6,r);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,on(c,n,6,r)}}const qx=new WeakMap;function Yd(n,e,t=!1){const i=t?qx:e.emitsCache,r=i.get(n);if(r!==void 0)return r;const s=n.emits;let o={},a=!1;if(!ve(n)){const l=c=>{const u=Yd(c,e,!0);u&&(a=!0,xt(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!s&&!a?(Ue(n)&&i.set(n,null),null):(Ee(s)?s.forEach(l=>o[l]=null):xt(o,s),Ue(n)&&i.set(n,o),o)}function Aa(n,e){return!n||!oa(e)?!1:(e=e.slice(2).replace(/Once$/,""),Ne(n,e[0].toLowerCase()+e.slice(1))||Ne(n,Vi(e))||Ne(n,e))}function OI(){}function Zd(n){const{type:e,vnode:t,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:h,data:f,setupState:d,ctx:g,inheritAttrs:p}=n,m=Ra(n);let y,_;try{if(t.shapeFlag&4){const x=r||i,v=x;y=bn(c.call(v,x,u,h,d,f,g)),_=a}else{const x=e;y=bn(x.length>1?x(h,{attrs:a,slots:o,emit:l}):x(h,null)),_=e.props?a:Hx(a)}}catch(x){Us.length=0,Ca(x,n,1),y=Ki(Dr)}let w=y;if(_&&p!==!1){const x=Object.keys(_),{shapeFlag:v}=w;x.length&&v&7&&(s&&x.some(aa)&&(_=Jx(_,s)),w=kr(w,_,!1,!0))}return t.dirs&&(w=kr(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(t.dirs):t.dirs),t.transition&&Vc(w,t.transition),y=w,Ra(m),y}const Hx=n=>{let e;for(const t in n)(t==="class"||t==="style"||oa(t))&&((e||(e={}))[t]=n[t]);return e},Jx=(n,e)=>{const t={};for(const i in n)(!aa(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function Qx(n,e,t){const{props:i,children:r,component:s}=n,{props:o,children:a,patchFlag:l}=e,c=s.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?qd(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let h=0;h<u.length;h++){const f=u[h];if(Hd(o,i,f)&&!Aa(c,f))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:i===o?!1:i?o?qd(i,o,c):!0:!!o;return!1}function qd(n,e,t){const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!0;for(let r=0;r<i.length;r++){const s=i[r];if(Hd(e,n,s)&&!Aa(t,s))return!0}return!1}function Hd(n,e,t){const i=n[t],r=e[t];return t==="style"&&Ue(i)&&Ue(r)?!Cc(i,r):i!==r}function e1({vnode:n,parent:e,suspense:t},i){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===n&&(r.suspense.vnode.el=r.el=i,n=r),r===n)(n=e.vnode).el=i,e=e.parent;else break}t&&t.activeBranch===n&&(t.vnode.el=i)}const Jd={},Qd=()=>Object.create(Jd),eg=n=>Object.getPrototypeOf(n)===Jd;function t1(n,e,t,i=!1){const r={},s=Qd();n.propsDefaults=Object.create(null),tg(n,e,r,s);for(const o in n.propsOptions[0])o in r||(r[o]=void 0);t?n.props=i?r:ex(r):n.type.props?n.props=r:n.props=s,n.attrs=s}function n1(n,e,t,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=n,a=Ae(r),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let h=0;h<u.length;h++){let f=u[h];if(Aa(n.emitsOptions,f))continue;const d=e[f];if(l)if(Ne(s,f))d!==s[f]&&(s[f]=d,c=!0);else{const g=rn(f);r[g]=Kc(l,a,g,d,n,!1)}else d!==s[f]&&(s[f]=d,c=!0)}}}else{tg(n,e,r,s)&&(c=!0);let u;for(const h in a)(!e||!Ne(e,h)&&((u=Vi(h))===h||!Ne(e,u)))&&(l?t&&(t[h]!==void 0||t[u]!==void 0)&&(r[h]=Kc(l,a,h,void 0,n,!0)):delete r[h]);if(s!==a)for(const h in s)(!e||!Ne(e,h))&&(delete s[h],c=!0)}c&&kn(n.attrs,"set","")}function tg(n,e,t,i){const[r,s]=n.propsOptions;let o=!1,a;if(e)for(let l in e){if(As(l))continue;const c=e[l];let u;r&&Ne(r,u=rn(l))?!s||!s.includes(u)?t[u]=c:(a||(a={}))[u]=c:Aa(n.emitsOptions,l)||(!(l in i)||c!==i[l])&&(i[l]=c,o=!0)}if(s){const l=Ae(t),c=a||Xe;for(let u=0;u<s.length;u++){const h=s[u];t[h]=Kc(r,l,h,c[h],n,!Ne(c,h))}}return o}function Kc(n,e,t,i,r,s){const o=n[t];if(o!=null){const a=Ne(o,"default");if(a&&i===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&ve(l)){const{propsDefaults:c}=r;if(t in c)i=c[t];else{const u=Ks(r);i=c[t]=l.call(null,e),u()}}else i=l;r.ce&&r.ce._setProp(t,i)}o[0]&&(s&&!a?i=!1:o[1]&&(i===""||i===Vi(t))&&(i=!0))}return i}const i1=new WeakMap;function ng(n,e,t=!1){const i=t?i1:e.propsCache,r=i.get(n);if(r)return r;const s=n.props,o={},a=[];let l=!1;if(!ve(n)){const u=h=>{l=!0;const[f,d]=ng(h,e,!0);xt(o,f),d&&a.push(...d)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!s&&!l)return Ue(n)&&i.set(n,Sr),Sr;if(Ee(s))for(let u=0;u<s.length;u++){const h=rn(s[u]);ig(h)&&(o[h]=Xe)}else if(s)for(const u in s){const h=rn(u);if(ig(h)){const f=s[u],d=o[h]=Ee(f)||ve(f)?{type:f}:xt({},f),g=d.type;let p=!1,m=!0;if(Ee(g))for(let y=0;y<g.length;++y){const _=g[y],w=ve(_)&&_.name;if(w==="Boolean"){p=!0;break}else w==="String"&&(m=!1)}else p=ve(g)&&g.name==="Boolean";d[0]=p,d[1]=m,(p||Ne(d,"default"))&&a.push(h)}}const c=[o,a];return Ue(n)&&i.set(n,c),c}function ig(n){return n[0]!=="$"&&!As(n)}const Yc=n=>n==="_"||n==="_ctx"||n==="$stable",Zc=n=>Ee(n)?n.map(bn):[bn(n)],r1=(n,e,t)=>{if(e._n)return e;const i=vx((...r)=>Zc(e(...r)),t);return i._c=!1,i},rg=(n,e,t)=>{const i=n._ctx;for(const r in n){if(Yc(r))continue;const s=n[r];if(ve(s))e[r]=r1(r,s,i);else if(s!=null){const o=Zc(s);e[r]=()=>o}}},sg=(n,e)=>{const t=Zc(e);n.slots.default=()=>t},og=(n,e,t)=>{for(const i in e)(t||!Yc(i))&&(n[i]=e[i])},s1=(n,e,t)=>{const i=n.slots=Qd();if(n.vnode.shapeFlag&32){const r=e._;r?(og(i,e,t),t&&nd(i,"_",r,!0)):rg(e,i)}else e&&sg(n,e)},o1=(n,e,t)=>{const{vnode:i,slots:r}=n;let s=!0,o=Xe;if(i.shapeFlag&32){const a=e._;a?t&&a===1?s=!1:og(r,e,t):(s=!e.$stable,rg(e,r)),o=e}else e&&(sg(n,e),o={default:1});if(s)for(const a in r)!Yc(a)&&o[a]==null&&delete r[a]},kt=h1;function a1(n){return l1(n)}function l1(n,e){const t=ua();t.__VUE__=!0;const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:h,nextSibling:f,setScopeId:d=pn,insertStaticContent:g}=n,p=(E,b,I,D=null,A=null,O=null,V=void 0,U=null,$=!!b.dynamicChildren)=>{if(E===b)return;E&&!$s(E,b)&&(D=Ie(E),ge(E,A,O,!0),E=null),b.patchFlag===-2&&($=!1,b.dynamicChildren=null);const{type:N,ref:ee,shapeFlag:Q}=b;switch(N){case Pa:m(E,b,I,D);break;case Dr:y(E,b,I,D);break;case Hc:E==null&&_(b,I,D,V);break;case jn:K(E,b,I,D,A,O,V,U,$);break;default:Q&1?v(E,b,I,D,A,O,V,U,$):Q&6?F(E,b,I,D,A,O,V,U,$):(Q&64||Q&128)&&N.process(E,b,I,D,A,O,V,U,$,k)}ee!=null&&A?js(ee,E&&E.ref,O,b||E,!b):ee==null&&E&&E.ref!=null&&js(E.ref,null,O,E,!0)},m=(E,b,I,D)=>{if(E==null)i(b.el=a(b.children),I,D);else{const A=b.el=E.el;b.children!==E.children&&c(A,b.children)}},y=(E,b,I,D)=>{E==null?i(b.el=l(b.children||""),I,D):b.el=E.el},_=(E,b,I,D)=>{[E.el,E.anchor]=g(E.children,b,I,D,E.el,E.anchor)},w=({el:E,anchor:b},I,D)=>{let A;for(;E&&E!==b;)A=f(E),i(E,I,D),E=A;i(b,I,D)},x=({el:E,anchor:b})=>{let I;for(;E&&E!==b;)I=f(E),r(E),E=I;r(b)},v=(E,b,I,D,A,O,V,U,$)=>{if(b.type==="svg"?V="svg":b.type==="math"&&(V="mathml"),E==null)T(b,I,D,A,O,V,U,$);else{const N=E.el&&E.el._isVueCE?E.el:null;try{N&&N._beginPatch(),S(E,b,A,O,V,U,$)}finally{N&&N._endPatch()}}},T=(E,b,I,D,A,O,V,U)=>{let $,N;const{props:ee,shapeFlag:Q,transition:Y,dirs:Z}=E;if($=E.el=o(E.type,O,ee&&ee.is,ee),Q&8?u($,E.children):Q&16&&C(E.children,$,null,D,A,qc(E,O),V,U),Z&&Bi(E,null,D,"created"),R($,E,E.scopeId,V,D),ee){for(const ae in ee)ae!=="value"&&!As(ae)&&s($,ae,null,ee[ae],O,D);"value"in ee&&s($,"value",null,ee.value,O),(N=ee.onVnodeBeforeMount)&&Cn(N,D,E)}Z&&Bi(E,null,D,"beforeMount");const q=c1(A,Y);q&&Y.beforeEnter($),i($,b,I),((N=ee&&ee.onVnodeMounted)||q||Z)&&kt(()=>{N&&Cn(N,D,E),q&&Y.enter($),Z&&Bi(E,null,D,"mounted")},A)},R=(E,b,I,D,A)=>{if(I&&d(E,I),D)for(let O=0;O<D.length;O++)d(E,D[O]);if(A){let O=A.subTree;if(b===O||hg(O.type)&&(O.ssContent===b||O.ssFallback===b)){const V=A.vnode;R(E,V,V.scopeId,V.slotScopeIds,A.parent)}}},C=(E,b,I,D,A,O,V,U,$=0)=>{for(let N=$;N<E.length;N++){const ee=E[N]=U?Wn(E[N]):bn(E[N]);p(null,ee,b,I,D,A,O,V,U)}},S=(E,b,I,D,A,O,V)=>{const U=b.el=E.el;let{patchFlag:$,dynamicChildren:N,dirs:ee}=b;$|=E.patchFlag&16;const Q=E.props||Xe,Y=b.props||Xe;let Z;if(I&&$i(I,!1),(Z=Y.onVnodeBeforeUpdate)&&Cn(Z,I,b,E),ee&&Bi(b,E,I,"beforeUpdate"),I&&$i(I,!0),(Q.innerHTML&&Y.innerHTML==null||Q.textContent&&Y.textContent==null)&&u(U,""),N?L(E.dynamicChildren,N,U,I,D,qc(b,A),O):V||z(E,b,U,null,I,D,qc(b,A),O,!1),$>0){if($&16)B(U,Q,Y,I,A);else if($&2&&Q.class!==Y.class&&s(U,"class",null,Y.class,A),$&4&&s(U,"style",Q.style,Y.style,A),$&8){const q=b.dynamicProps;for(let ae=0;ae<q.length;ae++){const ce=q[ae],se=Q[ce],fe=Y[ce];(fe!==se||ce==="value")&&s(U,ce,se,fe,A,I)}}$&1&&E.children!==b.children&&u(U,b.children)}else!V&&N==null&&B(U,Q,Y,I,A);((Z=Y.onVnodeUpdated)||ee)&&kt(()=>{Z&&Cn(Z,I,b,E),ee&&Bi(b,E,I,"updated")},D)},L=(E,b,I,D,A,O,V)=>{for(let U=0;U<b.length;U++){const $=E[U],N=b[U],ee=$.el&&($.type===jn||!$s($,N)||$.shapeFlag&198)?h($.el):I;p($,N,ee,null,D,A,O,V,!0)}},B=(E,b,I,D,A)=>{if(b!==I){if(b!==Xe)for(const O in b)!As(O)&&!(O in I)&&s(E,O,b[O],null,A,D);for(const O in I){if(As(O))continue;const V=I[O],U=b[O];V!==U&&O!=="value"&&s(E,O,U,V,A,D)}"value"in I&&s(E,"value",b.value,I.value,A)}},K=(E,b,I,D,A,O,V,U,$)=>{const N=b.el=E?E.el:a(""),ee=b.anchor=E?E.anchor:a("");let{patchFlag:Q,dynamicChildren:Y,slotScopeIds:Z}=b;Z&&(U=U?U.concat(Z):Z),E==null?(i(N,I,D),i(ee,I,D),C(b.children||[],I,ee,A,O,V,U,$)):Q>0&&Q&64&&Y&&E.dynamicChildren&&E.dynamicChildren.length===Y.length?(L(E.dynamicChildren,Y,I,A,O,V,U),(b.key!=null||A&&b===A.subTree)&&ag(E,b,!0)):z(E,b,I,ee,A,O,V,U,$)},F=(E,b,I,D,A,O,V,U,$)=>{b.slotScopeIds=U,E==null?b.shapeFlag&512?A.ctx.activate(b,I,D,V,$):P(b,I,D,A,O,V,$):oe(E,b,$)},P=(E,b,I,D,A,O,V)=>{const U=E.component=E1(E,D,A);if(Nd(E)&&(U.ctx.renderer=k),C1(U,!1,V),U.asyncDep){if(A&&A.registerDep(U,W,V),!E.el){const $=U.subTree=Ki(Dr);y(null,$,b,I),E.placeholder=$.el}}else W(U,E,b,I,A,O,V)},oe=(E,b,I)=>{const D=b.component=E.component;if(Qx(E,b,I))if(D.asyncDep&&!D.asyncResolved){X(D,b,I);return}else D.next=b,D.update();else b.el=E.el,D.vnode=b},W=(E,b,I,D,A,O,V)=>{const U=()=>{if(E.isMounted){let{next:Q,bu:Y,u:Z,parent:q,vnode:ae}=E;{const Fe=lg(E);if(Fe){Q&&(Q.el=ae.el,X(E,Q,V)),Fe.asyncDep.then(()=>{kt(()=>{E.isUnmounted||N()},A)});return}}let ce=Q,se;$i(E,!1),Q?(Q.el=ae.el,X(E,Q,V)):Q=ae,Y&&Ec(Y),(se=Q.props&&Q.props.onVnodeBeforeUpdate)&&Cn(se,q,Q,ae),$i(E,!0);const fe=Zd(E),Me=E.subTree;E.subTree=fe,p(Me,fe,h(Me.el),Ie(Me),E,A,O),Q.el=fe.el,ce===null&&e1(E,fe.el),Z&&kt(Z,A),(se=Q.props&&Q.props.onVnodeUpdated)&&kt(()=>Cn(se,q,Q,ae),A)}else{let Q;const{el:Y,props:Z}=b,{bm:q,m:ae,parent:ce,root:se,type:fe}=E,Me=Ws(b);$i(E,!1),q&&Ec(q),!Me&&(Q=Z&&Z.onVnodeBeforeMount)&&Cn(Q,ce,b),$i(E,!0);{se.ce&&se.ce._hasShadowRoot()&&se.ce._injectChildStyle(fe,E.parent?E.parent.type:void 0);const Fe=E.subTree=Zd(E);p(null,Fe,I,D,E,A,O),b.el=Fe.el}if(ae&&kt(ae,A),!Me&&(Q=Z&&Z.onVnodeMounted)){const Fe=b;kt(()=>Cn(Q,ce,Fe),A)}(b.shapeFlag&256||ce&&Ws(ce.vnode)&&ce.vnode.shapeFlag&256)&&E.a&&kt(E.a,A),E.isMounted=!0,b=I=D=null}};E.scope.on();const $=E.effect=new od(U);E.scope.off();const N=E.update=$.run.bind($),ee=E.job=$.runIfDirty.bind($);ee.i=E,ee.id=E.uid,$.scheduler=()=>Gc(ee),$i(E,!0),N()},X=(E,b,I)=>{b.component=E;const D=E.vnode.props;E.vnode=b,E.next=null,n1(E,b.props,D,I),o1(E,b.children,I),_n(),Md(E),xn()},z=(E,b,I,D,A,O,V,U,$=!1)=>{const N=E&&E.children,ee=E?E.shapeFlag:0,Q=b.children,{patchFlag:Y,shapeFlag:Z}=b;if(Y>0){if(Y&128){ne(N,Q,I,D,A,O,V,U,$);return}else if(Y&256){M(N,Q,I,D,A,O,V,U,$);return}}Z&8?(ee&16&&he(N,A,O),Q!==N&&u(I,Q)):ee&16?Z&16?ne(N,Q,I,D,A,O,V,U,$):he(N,A,O,!0):(ee&8&&u(I,""),Z&16&&C(Q,I,D,A,O,V,U,$))},M=(E,b,I,D,A,O,V,U,$)=>{E=E||Sr,b=b||Sr;const N=E.length,ee=b.length,Q=Math.min(N,ee);let Y;for(Y=0;Y<Q;Y++){const Z=b[Y]=$?Wn(b[Y]):bn(b[Y]);p(E[Y],Z,I,null,A,O,V,U,$)}N>ee?he(E,A,O,!0,!1,Q):C(b,I,D,A,O,V,U,$,Q)},ne=(E,b,I,D,A,O,V,U,$)=>{let N=0;const ee=b.length;let Q=E.length-1,Y=ee-1;for(;N<=Q&&N<=Y;){const Z=E[N],q=b[N]=$?Wn(b[N]):bn(b[N]);if($s(Z,q))p(Z,q,I,null,A,O,V,U,$);else break;N++}for(;N<=Q&&N<=Y;){const Z=E[Q],q=b[Y]=$?Wn(b[Y]):bn(b[Y]);if($s(Z,q))p(Z,q,I,null,A,O,V,U,$);else break;Q--,Y--}if(N>Q){if(N<=Y){const Z=Y+1,q=Z<ee?b[Z].el:D;for(;N<=Y;)p(null,b[N]=$?Wn(b[N]):bn(b[N]),I,q,A,O,V,U,$),N++}}else if(N>Y)for(;N<=Q;)ge(E[N],A,O,!0),N++;else{const Z=N,q=N,ae=new Map;for(N=q;N<=Y;N++){const ke=b[N]=$?Wn(b[N]):bn(b[N]);ke.key!=null&&ae.set(ke.key,N)}let ce,se=0;const fe=Y-q+1;let Me=!1,Fe=0;const $e=new Array(fe);for(N=0;N<fe;N++)$e[N]=0;for(N=Z;N<=Q;N++){const ke=E[N];if(se>=fe){ge(ke,A,O,!0);continue}let Ve;if(ke.key!=null)Ve=ae.get(ke.key);else for(ce=q;ce<=Y;ce++)if($e[ce-q]===0&&$s(ke,b[ce])){Ve=ce;break}Ve===void 0?ge(ke,A,O,!0):($e[Ve-q]=N+1,Ve>=Fe?Fe=Ve:Me=!0,p(ke,b[Ve],I,null,A,O,V,U,$),se++)}const Rt=Me?u1($e):Sr;for(ce=Rt.length-1,N=fe-1;N>=0;N--){const ke=q+N,Ve=b[ke],je=b[ke+1],ut=ke+1<ee?je.el||ug(je):D;$e[N]===0?p(null,Ve,I,ut,A,O,V,U,$):Me&&(ce<0||N!==Rt[ce]?le(Ve,I,ut,2):ce--)}}},le=(E,b,I,D,A=null)=>{const{el:O,type:V,transition:U,children:$,shapeFlag:N}=E;if(N&6){le(E.component.subTree,b,I,D);return}if(N&128){E.suspense.move(b,I,D);return}if(N&64){V.move(E,b,I,k);return}if(V===jn){i(O,b,I);for(let Q=0;Q<$.length;Q++)le($[Q],b,I,D);i(E.anchor,b,I);return}if(V===Hc){w(E,b,I);return}if(D!==2&&N&1&&U)if(D===0)U.persisted&&!O[Wc]?i(O,b,I):(U.beforeEnter(O),i(O,b,I),kt(()=>U.enter(O),A));else{const{leave:Q,delayLeave:Y,afterLeave:Z}=U,q=()=>{E.ctx.isUnmounted?r(O):i(O,b,I)},ae=()=>{const ce=O._isLeaving||!!O[Wc];O._isLeaving&&O[Wc](!0),U.persisted&&!ce?q():Q(O,()=>{q(),Z&&Z()})};Y?Y(O,q,ae):ae()}else i(O,b,I)},ge=(E,b,I,D=!1,A=!1)=>{const{type:O,props:V,ref:U,children:$,dynamicChildren:N,shapeFlag:ee,patchFlag:Q,dirs:Y,cacheIndex:Z,memo:q}=E;if(Q===-2&&(A=!1),U!=null&&(_n(),js(U,null,I,E,!0),xn()),Z!=null&&(b.renderCache[Z]=void 0),ee&256){b.ctx.deactivate(E);return}const ae=ee&1&&Y,ce=!Ws(E);let se;if(ce&&(se=V&&V.onVnodeBeforeUnmount)&&Cn(se,b,E),ee&6)xe(E.component,I,D);else{if(ee&128){E.suspense.unmount(I,D);return}ae&&Bi(E,null,b,"beforeUnmount"),ee&64?E.type.remove(E,b,I,k,D):N&&!N.hasOnce&&(O!==jn||Q>0&&Q&64)?he(N,b,I,!1,!0):(O===jn&&Q&384||!A&&ee&16)&&he($,b,I),D&&ze(E)}const fe=q!=null&&Z==null;(ce&&(se=V&&V.onVnodeUnmounted)||ae||fe)&&kt(()=>{se&&Cn(se,b,E),ae&&Bi(E,null,b,"unmounted"),fe&&(E.el=null)},I)},ze=E=>{const{type:b,el:I,anchor:D,transition:A}=E;if(b===jn){G(I,D);return}if(b===Hc){x(E);return}const O=()=>{r(I),A&&!A.persisted&&A.afterLeave&&A.afterLeave()};if(E.shapeFlag&1&&A&&!A.persisted){const{leave:V,delayLeave:U}=A,$=()=>V(I,O);U?U(E.el,O,$):$()}else O()},G=(E,b)=>{let I;for(;E!==b;)I=f(E),r(E),E=I;r(b)},xe=(E,b,I)=>{const{bum:D,scope:A,job:O,subTree:V,um:U,m:$,a:N}=E;cg($),cg(N),D&&Ec(D),A.stop(),O&&(O.flags|=8,ge(V,E,b,I)),U&&kt(U,b),kt(()=>{E.isUnmounted=!0},b)},he=(E,b,I,D=!1,A=!1,O=0)=>{for(let V=O;V<E.length;V++)ge(E[V],b,I,D,A)},Ie=E=>{if(E.shapeFlag&6)return Ie(E.component.subTree);if(E.shapeFlag&128)return E.suspense.next();const b=f(E.anchor||E.el),I=b&&b[Rx];return I?f(I):b};let Pe=!1;const ie=(E,b,I)=>{let D;E==null?b._vnode&&(ge(b._vnode,null,null,!0),D=b._vnode.component):p(b._vnode||null,E,b,null,null,null,I),b._vnode=E,Pe||(Pe=!0,Md(D),Ad(),Pe=!1)},k={p,um:ge,m:le,r:ze,mt:P,mc:C,pc:z,pbc:L,n:Ie,o:n};return{render:ie,hydrate:void 0,createApp:Kx(ie)}}function qc({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function $i({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function c1(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function ag(n,e,t=!1){const i=n.children,r=e.children;if(Ee(i)&&Ee(r))for(let s=0;s<i.length;s++){const o=i[s];let a=r[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=r[s]=Wn(r[s]),a.el=o.el),!t&&a.patchFlag!==-2&&ag(o,a)),a.type===Pa&&(a.patchFlag===-1&&(a=r[s]=Wn(a)),a.el=o.el),a.type===Dr&&!a.el&&(a.el=o.el)}}function u1(n){const e=n.slice(),t=[0];let i,r,s,o,a;const l=n.length;for(i=0;i<l;i++){const c=n[i];if(c!==0){if(r=t[t.length-1],n[r]<c){e[i]=r,t.push(i);continue}for(s=0,o=t.length-1;s<o;)a=s+o>>1,n[t[a]]<c?s=a+1:o=a;c<n[t[s]]&&(s>0&&(e[i]=t[s-1]),t[s]=i)}}for(s=t.length,o=t[s-1];s-- >0;)t[s]=o,o=e[o];return t}function lg(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:lg(e)}function cg(n){if(n)for(let e=0;e<n.length;e++)n[e].flags|=8}function ug(n){if(n.placeholder)return n.placeholder;const e=n.component;return e?ug(e.subTree):null}const hg=n=>n.__isSuspense;function h1(n,e){e&&e.pendingBranch?Ee(n)?e.effects.push(...n):e.effects.push(n):xx(n)}const jn=Symbol.for("v-fgt"),Pa=Symbol.for("v-txt"),Dr=Symbol.for("v-cmt"),Hc=Symbol.for("v-stc"),Us=[];let Xt=null;function f1(n=!1){Us.push(Xt=n?null:[])}function d1(){Us.pop(),Xt=Us[Us.length-1]||null}let Bs=1;function fg(n,e=!1){Bs+=n,n<0&&Xt&&e&&(Xt.hasOnce=!0)}function g1(n){return n.dynamicChildren=Bs>0?Xt||Sr:null,d1(),Bs>0&&Xt&&Xt.push(n),n}function p1(n,e,t,i,r,s){return g1(pg(n,e,t,i,r,s,!0))}function dg(n){return n?n.__v_isVNode===!0:!1}function $s(n,e){return n.type===e.type&&n.key===e.key}const gg=({key:n})=>n??null,Fa=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?st(n)||tt(n)||ve(n)?{i:En,r:n,k:e,f:!!t}:n:null);function pg(n,e=null,t=null,i=0,r=null,s=n===jn?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&gg(e),ref:e&&Fa(e),scopeId:Fd,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:En};return a?(Jc(l,t),s&128&&n.normalize(l)):t&&(l.shapeFlag|=st(t)?8:16),Bs>0&&!o&&Xt&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Xt.push(l),l}const Ki=m1;function m1(n,e=null,t=null,i=0,r=null,s=!1){if((!n||n===Gx)&&(n=Dr),dg(n)){const a=kr(n,e,!0);return t&&Jc(a,t),Bs>0&&!s&&Xt&&(a.shapeFlag&6?Xt[Xt.indexOf(n)]=a:Xt.push(a)),a.patchFlag=-2,a}if(P1(n)&&(n=n.__vccOpts),e){e=y1(e);let{class:a,style:l}=e;a&&!st(a)&&(e.class=ha(a)),Ue(l)&&(va(l)&&!Ee(l)&&(l=xt({},l)),e.style=bc(l))}const o=st(n)?1:hg(n)?128:Sx(n)?64:Ue(n)?4:ve(n)?2:0;return pg(n,e,t,i,r,o,s,!0)}function y1(n){return n?va(n)||eg(n)?xt({},n):n:null}function kr(n,e,t=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=n,c=e?x1(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&gg(c),ref:e&&e.ref?t&&s?Ee(s)?s.concat(Fa(e)):[s,Fa(e)]:Fa(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==jn?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&kr(n.ssContent),ssFallback:n.ssFallback&&kr(n.ssFallback),placeholder:n.placeholder,el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&Vc(u,l.clone(u)),u}function _1(n=" ",e=0){return Ki(Pa,null,n,e)}function bn(n){return n==null||typeof n=="boolean"?Ki(Dr):Ee(n)?Ki(jn,null,n.slice()):dg(n)?Wn(n):Ki(Pa,null,String(n))}function Wn(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:kr(n)}function Jc(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(Ee(e))t=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),Jc(n,r()),r._c&&(r._d=!0));return}else{t=32;const r=e._;!r&&!eg(e)?e._ctx=En:r===3&&En&&(En.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else ve(e)?(e={default:e,_ctx:En},t=32):(e=String(e),i&64?(t=16,e=[_1(e)]):t=8);n.children=e,n.shapeFlag|=t}function x1(...n){const e={};for(let t=0;t<n.length;t++){const i=n[t];for(const r in i)if(r==="class")e.class!==i.class&&(e.class=ha([e.class,i.class]));else if(r==="style")e.style=bc([e.style,i.style]);else if(oa(r)){const s=e[r],o=i[r];o&&s!==o&&!(Ee(s)&&s.includes(o))?e[r]=s?[].concat(s,o):o:o==null&&s==null&&!aa(r)&&(e[r]=o)}else r!==""&&(e[r]=i[r])}return e}function Cn(n,e,t,i=null){on(n,e,7,[t,i])}const v1=Kd();let w1=0;function E1(n,e,t){const i=n.type,r=(e?e.appContext:n.appContext)||v1,s={uid:w1++,vnode:n,type:i,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new L0(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ng(i,r),emitsOptions:Yd(i,r),emit:null,emitted:null,propsDefaults:Xe,inheritAttrs:i.inheritAttrs,ctx:Xe,data:Xe,props:Xe,attrs:Xe,slots:Xe,refs:Xe,setupState:Xe,setupContext:null,suspense:t,suspenseId:t?t.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=Zx.bind(null,s),n.ce&&n.ce(s),s}let Mt=null;const b1=()=>Mt||En;let Oa,Qc;{const n=ua(),e=(t,i)=>{let r;return(r=n[t])||(r=n[t]=[]),r.push(i),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};Oa=e("__VUE_INSTANCE_SETTERS__",t=>Mt=t),Qc=e("__VUE_SSR_SETTERS__",t=>Ys=t)}const Ks=n=>{const e=Mt;return Oa(n),n.scope.on(),()=>{n.scope.off(),Oa(e)}},mg=()=>{Mt&&Mt.scope.off(),Oa(null)};function yg(n){return n.vnode.shapeFlag&4}let Ys=!1;function C1(n,e=!1,t=!1){e&&Qc(e);const{props:i,children:r}=n.vnode,s=yg(n);t1(n,i,s,e),s1(n,r,t||e);const o=s?T1(n,e):void 0;return e&&Qc(!1),o}function T1(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,jx);const{setup:i}=t;if(i){_n();const r=n.setupContext=i.length>1?S1(n):null,s=Ks(n),o=Ar(i,n,0,[n.props,r]),a=ed(o);if(xn(),s(),(a||n.sp)&&!Ws(n)&&Ld(n),a){if(o.then(mg,mg),e)return o.then(l=>{_g(n,l)}).catch(l=>{Ca(l,n,0)});n.asyncDep=o}else _g(n,o)}else xg(n)}function _g(n,e,t){ve(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:Ue(e)&&(n.setupState=Td(e)),xg(n)}function xg(n,e,t){const i=n.type;n.render||(n.render=i.render||pn);{const r=Ks(n);_n();try{Wx(n)}finally{xn(),r()}}}const R1={get(n,e){return vt(n,"get",""),n[e]}};function S1(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,R1),slots:n.slots,emit:n.emit,expose:e}}function eu(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(Td(tx(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in Vs)return Vs[t](n)},has(e,t){return t in e||t in Vs}})):n.proxy}const I1=/(?:^|[-_])\w/g,M1=n=>n.replace(I1,e=>e.toUpperCase()).replace(/[-_]/g,"");function A1(n,e=!0){return ve(n)?n.displayName||n.name:n.name||e&&n.__name}function vg(n,e,t=!1){let i=A1(e);if(!i&&e.__file){const r=e.__file.match(/([^/\\]+)\.\w+$/);r&&(i=r[1])}if(!i&&n){const r=s=>{for(const o in s)if(s[o]===e)return o};i=r(n.components)||n.parent&&r(n.parent.type.components)||r(n.appContext.components)}return i?M1(i):t?"App":"Anonymous"}function P1(n){return ve(n)&&"__vccOpts"in n}const Yi=(n,e)=>ux(n,e,Ys),F1="3.5.38";let tu;const wg=typeof window<"u"&&window.trustedTypes;if(wg)try{tu=wg.createPolicy("vue",{createHTML:n=>n})}catch{}const Eg=tu?n=>tu.createHTML(n):n=>n,O1="http://www.w3.org/2000/svg",L1="http://www.w3.org/1998/Math/MathML",Vn=typeof document<"u"?document:null,bg=Vn&&Vn.createElement("template"),D1={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const r=e==="svg"?Vn.createElementNS(O1,n):e==="mathml"?Vn.createElementNS(L1,n):t?Vn.createElement(n,{is:t}):Vn.createElement(n);return n==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:n=>Vn.createTextNode(n),createComment:n=>Vn.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>Vn.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,r,s){const o=t?t.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),t),!(r===s||!(r=r.nextSibling)););else{bg.innerHTML=Eg(i==="svg"?`<svg>${n}</svg>`:i==="mathml"?`<math>${n}</math>`:n);const a=bg.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},k1=Symbol("_vtc");function N1(n,e,t){const i=n[k1];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const Cg=Symbol("_vod"),z1=Symbol("_vsh"),G1=Symbol(""),j1=/(?:^|;)\s*display\s*:/;function W1(n,e,t){const i=n.style,r=st(t);let s=!1;if(t&&!r){if(e)if(st(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&Zs(i,a,"")}else for(const o in e)t[o]==null&&Zs(i,o,"");for(const o in t){o==="display"&&(s=!0);const a=t[o];a!=null?X1(n,o,!st(e)&&e?e[o]:void 0,a)||Zs(i,o,a):Zs(i,o,"")}}else if(r){if(e!==t){const o=i[G1];o&&(t+=";"+o),i.cssText=t,s=j1.test(t)}}else e&&n.removeAttribute("style");Cg in n&&(n[Cg]=s?i.display:"",n[z1]&&(i.display="none"))}const Tg=/\s*!important$/;function Zs(n,e,t){if(Ee(t))t.forEach(i=>Zs(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=V1(n,e);Tg.test(t)?n.setProperty(Vi(i),t.replace(Tg,""),"important"):n[i]=t}}const Rg=["Webkit","Moz","ms"],nu={};function V1(n,e){const t=nu[e];if(t)return t;let i=rn(e);if(i!=="filter"&&i in n)return nu[e]=i;i=td(i);for(let r=0;r<Rg.length;r++){const s=Rg[r]+i;if(s in n)return nu[e]=s}return e}function X1(n,e,t,i){return n.tagName==="TEXTAREA"&&(e==="width"||e==="height")&&st(i)&&t===i}const Sg="http://www.w3.org/1999/xlink";function Ig(n,e,t,i,r,s=F0(e)){i&&e.startsWith("xlink:")?t==null?n.removeAttributeNS(Sg,e.slice(6,e.length)):n.setAttributeNS(Sg,e,t):t==null||s&&!rd(t)?n.removeAttribute(e):n.setAttribute(e,s?"":mn(t)?String(t):t)}function Mg(n,e,t,i,r){if(e==="innerHTML"||e==="textContent"){t!=null&&(n[e]=e==="innerHTML"?Eg(t):t);return}const s=n.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?n.getAttribute("value")||"":n.value,l=t==null?n.type==="checkbox"?"on":"":String(t);(a!==l||!("_value"in n))&&(n.value=l),t==null&&n.removeAttribute(e),n._value=t;return}let o=!1;if(t===""||t==null){const a=typeof n[e];a==="boolean"?t=rd(t):t==null&&a==="string"?(t="",o=!0):a==="number"&&(t=0,o=!0)}try{n[e]=t}catch{}o&&n.removeAttribute(r||e)}function U1(n,e,t,i){n.addEventListener(e,t,i)}function B1(n,e,t,i){n.removeEventListener(e,t,i)}const Ag=Symbol("_vei");function $1(n,e,t,i,r=null){const s=n[Ag]||(n[Ag]={}),o=s[e];if(i&&o)o.value=i;else{const[a,l]=K1(e);if(i){const c=s[e]=q1(i,r);U1(n,a,c,l)}else o&&(B1(n,a,o,l),s[e]=void 0)}}const Pg=/(?:Once|Passive|Capture)$/;function K1(n){let e;if(Pg.test(n)){e={};let i;for(;i=n.match(Pg);)n=n.slice(0,n.length-i[0].length),e[i[0].toLowerCase()]=!0}return[n[2]===":"?n.slice(3):Vi(n.slice(2)),e]}let iu=0;const Y1=Promise.resolve(),Z1=()=>iu||(Y1.then(()=>iu=0),iu=Date.now());function q1(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;const r=t.value;if(Ee(r)){const s=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{s.call(i),i._stopped=!0};const o=r.slice(),a=[i];for(let l=0;l<o.length&&!i._stopped;l++){const c=o[l];c&&on(c,e,5,a)}}else on(r,e,5,[i])};return t.value=n,t.attached=Z1(),t}const Fg=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,H1=(n,e,t,i,r,s)=>{const o=r==="svg";e==="class"?N1(n,i,o):e==="style"?W1(n,t,i):oa(e)?aa(e)||$1(n,e,t,i,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):J1(n,e,i,o))?(Mg(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Ig(n,e,i,o,s,e!=="value")):n._isVueCE&&(Q1(n,e)||n._def.__asyncLoader&&(/[A-Z]/.test(e)||!st(i)))?Mg(n,rn(e),i,s,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),Ig(n,e,i,o))};function J1(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&Fg(e)&&ve(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&n.tagName==="IFRAME"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=n.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Fg(e)&&st(t)?!1:e in n}function Q1(n,e){const t=n._def.props;if(!t)return!1;const i=rn(e);return Array.isArray(t)?t.some(r=>rn(r)===i):Object.keys(t).some(r=>rn(r)===i)}const ev=xt({patchProp:H1},D1);let Og;function tv(){return Og||(Og=a1(ev))}const nv=((...n)=>{const e=tv().createApp(...n),{mount:t}=e;return e.mount=i=>{const r=rv(i);if(!r)return;const s=e._component;!ve(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=t(r,!1,iv(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e});function iv(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function rv(n){return st(n)?document.querySelector(n):n}const Nt={ADD:"add",REMOVE:"remove"},Nr={PROPERTYCHANGE:"propertychange"};function qs(n){for(const e in n)delete n[e]}function mi(n){let e;for(e in n)return!1;return!e}function Te(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 La(n,e,t,i){return Te(n,e,t,i,!0)}function We(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),qs(n))}const de={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class Hs{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function sv(n,e,t){let i,r;t=t||Tn;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 Tn(n,e){return n>e?1:n<e?-1:0}function ov(n,e){return n<e?1:n>e?-1:0}function Da(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 av(n,e,t){for(;e<t;){const i=n[e];n[e]=n[t],n[t]=i,++e,--t}}function Rn(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 yi(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 lv(n,e,t){const i=e||Tn;return n.every(function(r,s){if(s===0)return!0;const o=i(n[s-1],r);return!(o>0||o===0)})}function Js(){return!0}function ka(){return!1}function Qs(){}function Lg(n){let e,t,i;return function(){const r=Array.prototype.slice.call(arguments);return(!t||this!==i||!yi(r,t))&&(i=this,t=r,e=n.apply(this,arguments)),e}}function zr(n){function e(){let t;try{t=n()}catch(i){return Promise.reject(i)}return t instanceof Promise?t:Promise.resolve(t)}return e()}class an{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class eo extends Hs{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 an(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,u=r.length;c<u;++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,Qs);delete o[i]}return l}disposeInternal(){this.listeners_&&qs(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]=Qs,++this.pendingRemovals_[e]):(i.splice(r,1),i.length===0&&delete this.listeners_[e]))}}class to extends eo{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(de.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]=Te(this,e[s],t);return r}return Te(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]=La(this,e[s],t)}else i=La(this,e,t);return t.ol_key=i,i}unInternal(e,t){const i=t.ol_key;if(i)cv(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)}}to.prototype.on,to.prototype.once,to.prototype.un;function cv(n){if(Array.isArray(n))for(let e=0,t=n.length;e<t;++e)We(n[e]);else We(n)}function pe(){throw new Error("Unimplemented abstract method.")}let uv=0;function _e(n){return n.ol_uid||(n.ol_uid=String(++uv))}class Dg extends an{constructor(e,t,i){super(e),this.key=t,this.oldValue=i}}class Sn extends to{constructor(e){super(),this.on,this.once,this.un,_e(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 Dg(i,e,t)),i=Nr.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new Dg(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],mi(this.values_)&&(this.values_=null),t||this.notify(e,i)}}}const kg={LENGTH:"length"};class Na extends an{constructor(e,t,i){super(e),this.element=t,this.index=i}}class Zt extends Sn{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(kg.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 Na(Nt.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 Na(Nt.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 Na(Nt.REMOVE,r,e)),this.dispatchEvent(new Na(Nt.ADD,t,e))}updateLength_(){this.set(kg.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 Gr extends an{constructor(e,t,i){super(e),this.map=t,this.frameState=i!==void 0?i:null}}class _i extends Gr{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 nt={SINGLECLICK:"singleclick",CLICK:de.CLICK,DBLCLICK:de.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Zi=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";Zi.includes("safari")&&!Zi.includes("chrom")&&(Zi.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Zi));const hv=Zi.includes("webkit")&&!Zi.includes("edge"),Ng=Zi.includes("macintosh"),fv=typeof devicePixelRatio<"u"?devicePixelRatio:1,wt=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,zg=typeof Image<"u"&&Image.prototype.decode,dv=typeof createImageBitmap=="function",Gg=(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})(),ru={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class gv extends eo{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_=Te(i,ru.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=Te(i,ru.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(de.TOUCHMOVE,this.boundHandleTouchMove_,Gg?{passive:!1}:!1)}emulateClick_(e){let t=new _i(nt.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new _i(nt.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new _i(nt.SINGLECLICK,this.map_,e);this.dispatchEvent(i)},250)}updateActivePointers_(e){const t=e,i=t.pointerId;if(t.type==nt.POINTERUP||t.type==nt.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==nt.POINTERDOWN||t.type==nt.POINTERMOVE)&&(this.trackedTouches_[i]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);const t=new _i(nt.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(We),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 _i(nt.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(Te(i,nt.POINTERMOVE,this.handlePointerMove_,this),Te(i,nt.POINTERUP,this.handlePointerUp_,this),Te(this.element_,nt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(Te(this.element_.getRootNode(),nt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;const t=new _i(nt.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 _i(nt.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_&&(We(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(de.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(We(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(We),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const xi={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Et={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},J={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Oe(n,e){if(!n)throw new Error(e)}const za=1/0;class pv{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,qs(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){Oe(!(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!=za?(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),u=c<r&&i[c]<i[l]?c:l;t[e]=t[u],i[e]=i[u],e=u}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==za?delete this.queuedElements_[this.keyFunction_(o)]:(i[r]=l,t[r++]=o);t.length=r,i.length=r,this.heapify_()}}class jg extends pv{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(de.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){const t=e.target,i=t.getState();if(i===J.LOADED||i===J.ERROR||i===J.EMPTY){i!==J.ERROR&&t.removeEventListener(de.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()===J.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,r.load())}}}function mv(n,e,t,i,r){if(!n||!(t in n.wantedTiles)||!n.wantedTiles[t][e.getKey()])return za;const s=n.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}const Ke={ANIMATING:0,INTERACTING:1},ln={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Ye(n,e,t){return Math.min(Math.max(n,e),t)}function yv(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 qi(n,e,t,i)}function qi(n,e,t,i){const r=t-n,s=i-e;return r*r+s*s}function _v(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 Wg(n){return n*180/Math.PI}function vi(n){return n*Math.PI/180}function jr(n,e){const t=n%e;return t*e<0?t+e:t}function Ut(n,e,t){return n+t*(e-n)}function Ga(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}function ja(n,e){return Math.floor(Ga(n,e))}function wi(n,e){return Math.ceil(Ga(n,e))}function su(n,e,t){if(n>=e&&n<t)return n;const i=t-e;return((n-e)%i+i)%i+e}function Vg(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,u=a?a[0]:0,h=a?a[1]:0;let f=n[0]+l/2+u,d=n[2]-l/2+u,g=n[1]+c/2+h,p=n[3]-c/2+h;f>d&&(f=(d+f)/2,d=f),g>p&&(g=(p+g)/2,p=g);let m=Ye(i[0],f,d),y=Ye(i[1],g,p);if(o&&t&&r){const _=30*r;m+=-_*Math.log(1+Math.max(0,f-i[0])/_)+_*Math.log(1+Math.max(0,i[0]-d)/_),y+=-_*Math.log(1+Math.max(0,g-i[1])/_)+_*Math.log(1+Math.max(0,i[1]-p)/_)}return[m,y]})}function xv(n){return n}const gt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function ou(n){const e=Bt();for(let t=0,i=n.length;t<i;++t)no(e,n[t]);return e}function vv(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 Bn(i,r,s,o,t)}function Xn(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 Xg(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n.slice()}function Hi(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 Ji(n,e){return au(n,e[0],e[1])}function Un(n,e){return n[0]<=e[0]&&e[2]<=n[2]&&n[1]<=e[1]&&e[3]<=n[3]}function au(n,e,t){return n[0]<=e&&e<=n[2]&&n[1]<=t&&t<=n[3]}function lu(n,e){const t=n[0],i=n[1],r=n[2],s=n[3],o=e[0],a=e[1];let l=gt.UNKNOWN;return o<t?l=l|gt.LEFT:o>r&&(l=l|gt.RIGHT),a<i?l=l|gt.BELOW:a>s&&(l=l|gt.ABOVE),l===gt.UNKNOWN&&(l=gt.INTERSECTING),l}function Bt(){return[1/0,1/0,-1/0,-1/0]}function Bn(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 Wr(n){return Bn(1/0,1/0,-1/0,-1/0,n)}function cu(n,e){const t=n[0],i=n[1];return Bn(t,i,t,i,e)}function uu(n,e,t,i,r){const s=Wr(r);return Bg(s,n,e,t,i)}function $n(n,e){return n[0]==e[0]&&n[2]==e[2]&&n[1]==e[1]&&n[3]==e[3]}function Ug(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 no(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 Bg(n,e,t,i,r){for(;t<i;t+=r)wv(n,e[t],e[t+1]);return n}function wv(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 $g(n,e){let t;return t=e(Wa(n)),t||(t=e(Va(n)),t)||(t=e(Ua(n)),t)||(t=e(Kn(n)),t)?t:!1}function hu(n){let e=0;return Ei(n)||(e=Se(n)*ot(n)),e}function Wa(n){return[n[0],n[1]]}function Va(n){return[n[2],n[1]]}function zt(n){return[(n[0]+n[2])/2,(n[1]+n[3])/2]}function Ev(n,e){let t;if(e==="bottom-left")t=Wa(n);else if(e==="bottom-right")t=Va(n);else if(e==="top-left")t=Kn(n);else if(e==="top-right")t=Ua(n);else throw new Error("Invalid corner");return t}function Xa(n,e,t,i,r){const[s,o,a,l,c,u,h,f]=Kg(n,e,t,i);return Bn(Math.min(s,a,c,h),Math.min(o,l,u,f),Math.max(s,a,c,h),Math.max(o,l,u,f),r)}function Kg(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,u=s*o,h=s*a,f=n[0],d=n[1];return[f-l+h,d-c-u,f-l-h,d-c+u,f+l-h,d+c+u,f+l+h,d+c-u,f-l+h,d-c-u]}function ot(n){return n[3]-n[1]}function cn(n,e,t){const i=t||Bt();return it(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]):Wr(i),i}function Kn(n){return[n[0],n[3]]}function Ua(n){return[n[2],n[3]]}function Se(n){return n[2]-n[0]}function it(n,e){return n[0]<=e[2]&&n[2]>=e[0]&&n[1]<=e[3]&&n[3]>=e[1]}function Ei(n){return n[2]<n[0]||n[3]<n[1]}function bv(n,e){return e?(e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e):n}function Cv(n,e,t){let i=!1;const r=lu(n,e),s=lu(n,t);if(r===gt.INTERSECTING||s===gt.INTERSECTING)i=!0;else{const o=n[0],a=n[1],l=n[2],c=n[3],u=e[0],h=e[1],f=t[0],d=t[1],g=(d-h)/(f-u);let p,m;s&gt.ABOVE&&!(r&gt.ABOVE)&&(p=f-(d-c)/g,i=p>=o&&p<=l),!i&&s&gt.RIGHT&&!(r&gt.RIGHT)&&(m=d-(f-l)*g,i=m>=a&&m<=c),!i&&s&gt.BELOW&&!(r&gt.BELOW)&&(p=f-(d-a)/g,i=p>=o&&p<=l),!i&&s&gt.LEFT&&!(r&gt.LEFT)&&(m=d-(f-o)*g,i=m>=a&&m<=c)}return i}function Yg(n,e,t,i){if(Ei(n))return Wr(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 vv(s,o,t)}function Zg(n,e){const t=e.getExtent(),i=zt(n);if(e.canWrapX()&&(i[0]<t[0]||i[0]>=t[2])){const r=Se(t),o=Math.floor((i[0]-t[0])/r)*r;n[0]-=o,n[2]-=o}return n}function qg(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]]];Zg(n,e);const r=Se(i);if(Se(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 Hg(n,e){return n[0]+=+e[0],n[1]+=+e[1],n}function Ba(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 fu(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 Jg(n,e){return n[0]*=e,n[1]*=e,n}function Tv(n,e){const t=n[0]-e[0],i=n[1]-e[1];return t*t+i*i}function Rv(n,e){return Math.sqrt(Tv(n,e))}function du(n,e){if(e.canWrapX()){const t=Se(e.getExtent()),i=Sv(n,e,t);i&&(n[0]-=i*t)}return n}function Sv(n,e,t){const i=e.getExtent();let r=0;return e.canWrapX()&&(n[0]<i[0]||n[0]>i[2])&&(t=t||Se(i),r=Math.floor((n[0]-i[0])/t)),r}function Iv(n,e,t){const i=Math.sqrt((e[0]-n[0])*(e[0]-n[0])+(e[1]-n[1])*(e[1]-n[1])),r=[(e[0]-n[0])/i,(e[1]-n[1])/i],s=[-r[1],r[0]],o=Math.sqrt((t[0]-n[0])*(t[0]-n[0])+(t[1]-n[1])*(t[1]-n[1])),a=[(t[0]-n[0])/o,(t[1]-n[1])/o];let l=i===0||o===0?0:Math.acos(Ye(a[0]*r[0]+a[1]*r[1],-1,1));return l=Math.max(l,1e-5),a[0]*s[0]+a[1]*s[1]>0?l:Math.PI*2-l}function Qg(n){return Math.pow(n,3)}function Vr(n){return 1-Qg(1-n)}function Mv(n){return 3*n*n-2*n*n*n}function Av(n){return n}const Pv=63710088e-1;function ep(n,e,t){t=t||Pv;const i=vi(n[1]),r=vi(e[1]),s=(r-i)/2,o=vi(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 tp(...n){console.warn(...n)}const bi={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class $a{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_||bi[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 io=6378137,Xr=Math.PI*io,Fv=[-Xr,-Xr,Xr,Xr],Ov=[-180,-85,180,85],Ka=io*Math.log(Math.tan(Math.PI/2));class Ur extends $a{constructor(e){super({code:e,units:"m",extent:Fv,global:!0,worldExtent:Ov,getPointResolution:function(t,i){return t/Math.cosh(i[1]/io)}})}}const np=[new Ur("EPSG:3857"),new Ur("EPSG:102100"),new Ur("EPSG:102113"),new Ur("EPSG:900913"),new Ur("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ur("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Lv(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]=Xr*n[s]/180;let o=io*Math.log(Math.tan(Math.PI*(+n[s+1]+90)/360));o>Ka?o=Ka:o<-Ka&&(o=-Ka),e[s+1]=o}return e}function Dv(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]/Xr,e[s+1]=360*Math.atan(Math.exp(n[s+1]/io))/Math.PI-90;return e}const kv=6378137,ip=[-180,-90,180,90],Nv=Math.PI*kv/180;class Qi extends $a{constructor(e,t){super({code:e,units:"degrees",extent:ip,axisOrientation:t,global:!0,metersPerUnit:Nv,worldExtent:ip})}}const rp=[new Qi("CRS:84"),new Qi("EPSG:4326","neu"),new Qi("urn:ogc:def:crs:OGC:1.3:CRS84"),new Qi("urn:ogc:def:crs:OGC:2:84"),new Qi("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Qi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Qi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let gu={};function zv(n){return gu[n]||gu[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Gv(n,e){gu[n]=e}let Br={};function ro(n,e,t){const i=n.getCode(),r=e.getCode();i in Br||(Br[i]={}),Br[i][r]=t}function pu(n,e){return n in Br&&e in Br[n]?Br[n][e]:null}const Ya=.9996,qt=.00669438,Za=qt*qt,qa=Za*qt,er=qt/(1-qt),sp=Math.sqrt(1-qt),$r=(1-sp)/(1+sp),op=$r*$r,mu=op*$r,yu=mu*$r,ap=yu*$r,lp=1-qt/4-3*Za/64-5*qa/256,jv=3*qt/8+3*Za/32+45*qa/1024,Wv=15*Za/256+45*qa/1024,Vv=35*qa/3072,Xv=3/2*$r-27/32*mu+269/512*ap,Uv=21/16*op-55/32*yu,Bv=151/96*mu-417/128*ap,$v=1097/512*yu,Ha=6378137;function Kv(n,e,t){const i=n-5e5,o=(t.north?e:e-1e7)/Ya/(Ha*lp),a=o+Xv*Math.sin(2*o)+Uv*Math.sin(4*o)+Bv*Math.sin(6*o)+$v*Math.sin(8*o),l=Math.sin(a),c=l*l,u=Math.cos(a),h=l/u,f=h*h,d=f*f,g=1-qt*c,p=Math.sqrt(1-qt*c),m=Ha/p,y=(1-qt)/g,_=er*u**2,w=_*_,x=i/(m*Ya),v=x*x,T=v*x,R=T*x,C=R*x,S=C*x,L=a-h/y*(v/2-R/24*(5+3*f+10*_-4*w-9*er))+S/720*(61+90*f+298*_+45*d-252*er-3*w);let B=(x-T/6*(1+2*f+_)+C/120*(5-2*_+28*f-3*w+8*er+24*d))/u;return B=su(B+vi(hp(t.number)),-Math.PI,Math.PI),[Wg(B),Wg(L)]}const cp=-80,up=84,Yv=-180,Zv=180;function qv(n,e,t){n=su(n,Yv,Zv),e<cp?e=cp:e>up&&(e=up);const i=vi(e),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,c=vi(n),u=hp(t.number),h=vi(u),f=Ha/Math.sqrt(1-qt*r**2),d=er*s**2,g=s*su(c-h,-Math.PI,Math.PI),p=g*g,m=p*g,y=m*g,_=y*g,w=_*g,x=Ha*(lp*i-jv*Math.sin(2*i)+Wv*Math.sin(4*i)-Vv*Math.sin(6*i)),v=Ya*f*(g+m/6*(1-a+d)+_/120*(5-18*a+l+72*d-58*er))+5e5;let T=Ya*(x+f*o*(p/2+y/24*(5-a+9*d+4*d**2)+w/720*(61-58*a+l+600*d-330*er)));return t.north||(T+=1e7),[v,T]}function hp(n){return(n-1)*6-180+3}const Hv=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function fp(n){let e=0;for(const r of Hv){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 dp(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],u=n(l,c,e);i[a]=u[0],i[a+1]=u[1]}return i}}function Jv(n){return fp(n)?new $a({code:n,units:"m"}):null}function Qv(n){const e=fp(n.getCode());return e?{forward:dp(qv,e),inverse:dp(Kv,e)}:null}const ew=[Qv],tw=[Jv];let _u=!0;function gp(n){_u=!1}function xu(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 vu(n){Gv(n.getCode(),n),ro(n,n,xu)}function nw(n){n.forEach(vu)}function Le(n){if(typeof n!="string")return n;const e=zv(n);if(e)return e;for(const t of tw){const i=t(n);if(i)return i}return null}function wu(n,e,t,i){n=Le(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/bi[i])}}else{const o=n.getUnits();if(o=="degrees"&&!i||i=="degrees")r=e;else{const a=Kr(n,Le("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 u=ep(c.slice(0,2),c.slice(2,4)),h=ep(c.slice(4,6),c.slice(6,8));r=(u+h)/2}const l=i?bi[i]:n.getMetersPerUnit();l!==void 0&&(r/=l)}}return r}function pp(n){nw(n),n.forEach(function(e){n.forEach(function(t){e!==t&&ro(e,t,xu)})})}function iw(n,e,t,i){n.forEach(function(r){e.forEach(function(s){ro(r,s,t),ro(s,r,i)})})}function Eu(n,e){return n?typeof n=="string"?Le(n):n:Le(e)}function rw(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,u=r;c<u;++c)t[o+c]=c>=l?e[o+c]:a[c]}return t})}function bu(n,e){return gp(),so(n,"EPSG:4326",e!==void 0?e:"EPSG:3857")}function bt(n,e){if(n===e)return!0;const t=n.getUnits()===e.getUnits();return(n.getCode()===e.getCode()||Kr(n,e)===xu)&&t}function Kr(n,e){const t=n.getCode(),i=e.getCode();let r=pu(t,i);if(r)return r;let s=null,o=null;for(const l of ew)s||(s=l(n)),o||(o=l(e));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=Cu(s.inverse,o.forward);else{const l=pu(t,a);l&&(r=Cu(l,o.forward))}else{const l=pu(a,i);l&&(r=Cu(s.inverse,l))}return r&&(vu(n),vu(e),ro(n,e,r)),r}function Cu(n,e){return function(t,i,r,s){return i=n(t,i,r,s),e(i,i,r,s)}}function tr(n,e){const t=Le(n),i=Le(e);return Kr(t,i)}function so(n,e,t){const i=tr(e,t);if(!i){const r=Le(e).getCode(),s=Le(t).getCode();throw new Error(`No transform available between ${r} and ${s}`)}return i(n,void 0,n.length)}function Yr(n,e,t,i){const r=tr(e,t);return Yg(n,r,void 0,i)}let Ht=null;function sw(n){Ht=Le(n)}function oo(){return Ht}function ow(){sw("EPSG:4326")}function Tu(n,e){return Ht?so(n,e,Ht):n}function Yn(n,e){return Ht?so(n,Ht,e):(_u&&!Ba(n,[0,0])&&n[0]>=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(_u=!1,tp("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n)}function Ja(n,e){return Ht?Yr(n,e,Ht):n}function Zn(n,e){return Ht?Yr(n,Ht,e):n}function aw(n,e){if(!Ht)return n;const t=Le(e).getMetersPerUnit(),i=Ht.getMetersPerUnit();return t&&i?n*t/i:n}function lw(){pp(np),pp(rp),iw(rp,np,Lv,Dv)}lw();const mp=new Array(6);function Gt(){return[1,0,0,1,0,0]}function yp(n){return Su(n,1,0,0,1,0,0)}function Ru(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],u=e[2],h=e[3],f=e[4],d=e[5];return n[0]=t*l+r*c,n[1]=i*l+s*c,n[2]=t*u+r*h,n[3]=i*u+s*h,n[4]=t*f+r*d+o,n[5]=i*f+s*d+a,n}function Su(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 cw(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 lt(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 Iu(n,e,t){return Ru(n,Su(mp,e,0,0,t,0,0))}function uw(n,e,t){return Ru(n,Su(mp,1,0,0,1,e,t))}function In(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 _p(n,e){const t=hw(e);Oe(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 hw(n){return n[0]*n[3]-n[1]*n[2]}const fw=[1e5,1e5,1e5,1e5,2,2];function dw(n){return"matrix("+n.join(", ")+")"}function Mu(n){return n.substring(7,n.length-1).split(",").map(parseFloat)}function gw(n,e){const t=Mu(n),i=Mu(e);for(let r=0;r<6;++r)if(Math.round((t[r]-i[r])*fw[r])!==0)return!1;return!0}function Ci(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],u=n[l+1];s[a++]=r[0]*c+r[2]*u+r[4],s[a++]=r[1]*c+r[3]*u+r[5];for(let h=2;h<o;h++)s[a++]=n[l+h]}return s&&s.length!=a&&(s.length=a),s}function xp(n,e,t,i,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),c=s[0],u=s[1];let h=0;for(let f=e;f<t;f+=i){const d=n[f]-c,g=n[f+1]-u;o[h++]=c+d*a-g*l,o[h++]=u+d*l+g*a;for(let p=f+2;p<f+i;++p)o[h++]=n[p]}return o&&o.length!=h&&(o.length=h),o}function pw(n,e,t,i,r,s,o,a){a=a||[];const l=o[0],c=o[1];let u=0;for(let h=e;h<t;h+=i){const f=n[h]-l,d=n[h+1]-c;a[u++]=l+r*f,a[u++]=c+s*d;for(let g=h+2;g<h+i;++g)a[u++]=n[g]}return a&&a.length!=u&&(a.length=u),a}function mw(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 vp=Gt(),yw=[NaN,NaN];class wp extends Sn{constructor(){super(),this.extent_=Bt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Lg((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 pe()}closestPointXY(e,t,i,r){return pe()}containsXY(e,t){return this.closestPointXY(e,t,yw,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 pe()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&Wr(t),this.extentRevision_=this.getRevision()}return bv(this.extent_,e)}rotate(e,t){pe()}scale(e,t,i){pe()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return pe()}getType(){return pe()}applyTransform(e){pe()}intersectsExtent(e){return pe()}translate(e,t){pe()}transform(e,t){const i=Le(e),r=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),c=i.getWorldExtent(),u=ot(c)/ot(l);In(vp,c[0],c[3],u,-u,0,0,0);const h=Ci(s,0,s.length,a,vp,o),f=tr(i,t);return f?f(h,h,a):h}:tr(i,t);return this.applyTransform(r),this}}class nr extends wp{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return uu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return pe()}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=Ep(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){pe()}setLayout(e,t,i){let r;if(e)r=Ep(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=ir(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();xp(i,0,i.length,r,e,t,i),this.changed()}}scale(e,t,i){t===void 0&&(t=e),i||(i=zt(this.getExtent()));const r=this.getFlatCoordinates();if(r){const s=this.getStride();pw(r,0,r.length,s,e,t,i,r),this.changed()}}translate(e,t){const i=this.getFlatCoordinates();if(i){const r=this.getStride();mw(i,0,i.length,r,e,t,i),this.changed()}}}function ir(n){let e;return n==2?e="XY":n==3?e="XYZ":n==4&&(e="XYZM"),e}function Ep(n){let e;return n=="XY"?e=2:n=="XYZ"||n=="XYM"?e=3:n=="XYZM"&&(e=4),e}function _w(n,e,t){const i=n.getFlatCoordinates();if(!i)return null;const r=n.getStride();return Ci(i,0,i.length,r,e,t)}function bp(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,u=n[e+1]-o;r+=l*c-a*u,a=c,l=u}return r/2}function Cp(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=bp(n,e,a,i),e=a}return r}function xw(n,e,t,i){let r=0;for(let s=0,o=t.length;s<o;++s){const a=t[s];r+=Cp(n,e,a,i),e=a[a.length-1]}return r}function Tp(n,e,t,i,r,s,o){const a=n[e],l=n[e+1],c=n[t]-a,u=n[t+1]-l;let h;if(c===0&&u===0)h=e;else{const f=((r-a)*c+(s-l)*u)/(c*c+u*u);if(f>1)h=t;else if(f>0){for(let d=0;d<i;++d)o[d]=Ut(n[e+d],n[t+d],f);o.length=i;return}else h=e}for(let f=0;f<i;++f)o[f]=n[h+f];o.length=i}function Au(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=qi(s,o,a,l);c>r&&(r=c),s=a,o=l}return r}function Pu(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=Au(n,e,a,i,r),e=a}return r}function vw(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];r=Pu(n,e,a,i,r),e=a[a.length-1]}return r}function Fu(n,e,t,i,r,s,o,a,l,c,u){if(e==t)return c;let h,f;if(r===0){if(f=qi(o,a,n[e],n[e+1]),f<c){for(h=0;h<i;++h)l[h]=n[e+h];return l.length=i,f}return c}u=u||[NaN,NaN];let d=e+i;for(;d<t;)if(Tp(n,d-i,d,i,o,a,u),f=qi(o,a,u[0],u[1]),f<c){for(c=f,h=0;h<i;++h)l[h]=u[h];l.length=i,d+=i}else d+=i*Math.max((Math.sqrt(f)-Math.sqrt(c))/r|0,1);if(s&&(Tp(n,t-i,e,i,o,a,u),f=qi(o,a,u[0],u[1]),f<c)){for(c=f,h=0;h<i;++h)l[h]=u[h];l.length=i}return c}function Ou(n,e,t,i,r,s,o,a,l,c,u){u=u||[NaN,NaN];for(let h=0,f=t.length;h<f;++h){const d=t[h];c=Fu(n,e,d,i,r,s,o,a,l,c,u),e=d}return c}function ww(n,e,t,i,r,s,o,a,l,c,u){u=u||[NaN,NaN];for(let h=0,f=t.length;h<f;++h){const d=t[h];c=Ou(n,e,d,i,r,s,o,a,l,c,u),e=d[d.length-1]}return c}function Ew(n,e,t,i){for(let r=0,s=t.length;r<s;++r)n[e++]=t[r];return e}function Qa(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 ao(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=Qa(n,e,t[o],i);r[s++]=l,e=l}return r.length=s,r}function Rp(n,e,t,i,r){r=r||[];let s=0;for(let o=0,a=t.length;o<a;++o){const l=ao(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 Ti(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 lo(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++]=Ti(n,e,l,i,r[s]),e=l}return r.length=s,r}function Lu(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?[]:lo(n,e,l,i,r[s]),e=l[l.length-1]}return r.length=s,r}function el(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 u=0;for(;c.length>0;){const h=c.pop(),f=c.pop();let d=0;const g=n[f],p=n[f+1],m=n[h],y=n[h+1];for(let _=f+i;_<h;_+=i){const w=n[_],x=n[_+1],v=yv(w,x,g,p,m,y);v>d&&(u=_,d=v)}d>r&&(l[(u-e)/i]=1,f+i<u&&c.push(f,u),u+i<h&&c.push(u,h))}for(let h=0;h<a;++h)l[h]&&(s[o++]=n[e+h*i],s[o++]=n[e+h*i+1]);return o}function Sp(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const u=t[l];o=el(n,e,u,i,r,s,o),a.push(o),e=u}return o}function rr(n,e){return e*Math.round(n/e)}function bw(n,e,t,i,r,s,o){if(e==t)return o;let a=rr(n[e],r),l=rr(n[e+1],r);e+=i,s[o++]=a,s[o++]=l;let c,u;do if(c=rr(n[e],r),u=rr(n[e+1],r),e+=i,e==t)return s[o++]=c,s[o++]=u,o;while(c==a&&u==l);for(;e<t;){const h=rr(n[e],r),f=rr(n[e+1],r);if(e+=i,h==c&&f==u)continue;const d=c-a,g=u-l,p=h-a,m=f-l;if(d*m==g*p&&(d<0&&p<d||d==p||d>0&&p>d)&&(g<0&&m<g||g==m||g>0&&m>g)){c=h,u=f;continue}s[o++]=c,s[o++]=u,a=c,l=u,c=h,u=f}return s[o++]=c,s[o++]=u,o}function Du(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const u=t[l];o=bw(n,e,u,i,r,s,o),a.push(o),e=u}return o}function Cw(n,e,t,i,r,s,o,a){for(let l=0,c=t.length;l<c;++l){const u=t[l],h=[];o=Du(n,e,u,i,r,s,o,h),a.push(h),e=u[u.length-1]}return o}class co extends nr{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 co(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,i,r){return r<Hi(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Au(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,i,r))}getArea(){return bp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Ti(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const t=[];return t.length=el(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new co(t,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Qa(this.flatCoordinates,0,e,this.stride),this.changed()}}class qn extends nr{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){const e=new qn(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){const s=this.flatCoordinates,o=qi(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 cu(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return au(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ew(this.flatCoordinates,0,e,this.stride),this.changed()}}function Tw(n,e,t,i,r){return!$g(r,function(o){return!sr(n,e,t,i,o[0],o[1])})}function sr(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],u=n[e+1];l<=s?u>s&&(c-a)*(s-l)-(r-a)*(u-l)>0&&o++:u<=s&&(c-a)*(s-l)-(r-a)*(u-l)<0&&o--,a=c,l=u}return o!==0}function ku(n,e,t,i,r,s){if(t.length===0||!sr(n,e,t[0],i,r,s))return!1;for(let o=1,a=t.length;o<a;++o)if(sr(n,t[o-1],t[o],i,r,s))return!1;return!0}function Rw(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(ku(n,e,l,i,r,s))return!0;e=l[l.length-1]}return!1}function Nu(n,e,t,i,r,s,o){let a,l,c,u,h,f,d;const g=r[s+1],p=[];for(let _=0,w=t.length;_<w;++_){const x=t[_];for(u=n[x-i],f=n[x-i+1],a=e;a<x;a+=i)h=n[a],d=n[a+1],(g<=f&&d<=g||f<=g&&g<=d)&&(c=(g-f)/(d-f)*(h-u)+u,p.push(c)),u=h,f=d}let m=NaN,y=-1/0;for(p.sort(Tn),u=p[0],a=1,l=p.length;a<l;++a){h=p[a];const _=Math.abs(h-u);_>y&&(c=(u+h)/2,ku(n,e,t,i,c,g)&&(m=c,y=_)),u=h}return isNaN(m)&&(m=r[s]),o?(o.push(m,g,y),o):[m,g,y]}function Ip(n,e,t,i,r){let s=[];for(let o=0,a=t.length;o<a;++o){const l=t[o];s=Nu(n,e,l,i,r,2*o,s),e=l[l.length-1]}return s}function Mp(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 tl(n,e,t,i,r,s){return s=s??Bg(Bt(),n,e,t,i),it(r,s)?s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]?!0:Mp(n,e,t,i,function(o,a){return Cv(r,o,a)}):!1}function Sw(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){if(tl(n,e,t[s],i,r))return!0;e=t[s]}return!1}function Ap(n,e,t,i,r){return!!(tl(n,e,t,i,r)||sr(n,e,t,i,r[0],r[1])||sr(n,e,t,i,r[0],r[3])||sr(n,e,t,i,r[2],r[1])||sr(n,e,t,i,r[2],r[3]))}function Pp(n,e,t,i,r){if(!Ap(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(Tw(n,t[s-1],t[s],i,r)&&!tl(n,t[s-1],t[s],i,r))return!1;return!0}function Iw(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(Pp(n,e,a,i,r))return!0;e=a[a.length-1]}return!1}function Mw(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 zu(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 Gu(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=zu(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 Fp(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s){const a=t[s];if(!Gu(n,e,a,i,r))return!1;a.length&&(e=a[a.length-1])}return!0}function nl(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=zu(n,e,a,i);(s===0?r&&l||!r&&!l:r&&!l||!r&&l)&&Mw(n,e,a,i),e=a}return e}function ju(n,e,t,i,r){for(let s=0,o=t.length;s<o;++s)e=nl(n,e,t[s],i,r);return e}function Op(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=zu(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 Hn extends nr{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?Rn(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Hn(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Hi(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Pu(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ou(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return ku(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return Cp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),nl(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,lo(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=zt(this.getExtent());this.flatInteriorPoint_=Nu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new qn(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new co(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 co(t.slice(s,l),e);r.push(c),s=l}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Gu(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=nl(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Du(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,i),new Hn(t,"XY",i)}getType(){return"Polygon"}intersectsExtent(e){return Pp(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=ao(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}function Lp(n){if(Ei(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 Hn(s,"XY",[s.length])}function Wu(n,e,t,i){const r=Se(e)/t[0],s=ot(e)/t[1];return i?Math.min(n,Math.max(r,s)):Math.min(n,Math.min(r,s))}function Vu(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),Ye(i,t/2,e*2)}function Aw(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],u=t?Wu(l,t,o,i):l;if(a)return e?Vu(r,u,c):Ye(r,c,u);const h=Math.min(u,r),f=Math.floor(Da(n,h,s));return n[f]>u&&f<n.length-1?n[f+1]:n[f]}})}function Pw(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 u=r?Wu(e,r,l,s):e;if(c)return i?Vu(o,u,t):Ye(o,t,u);const h=1e-9,f=Math.ceil(Math.log(e/u)/Math.log(n)-h),d=-a*(.5-h)+.5,g=Math.min(u,o),p=Math.floor(Math.log(e/g)/Math.log(n)+d),m=Math.max(f,p),y=e/Math.pow(n,m);return Ye(y,t,u)}})}function Dp(n,e,t,i,r){return t=t!==void 0?t:!0,(function(s,o,a,l){if(s!==void 0){const c=i?Wu(n,i,a,r):n;return!t||!l?Ye(s,e,c):Vu(s,c,e)}})}function Xu(n){if(n!==void 0)return 0}function kp(n){if(n!==void 0)return n}function Fw(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 Ow(n){const e=vi(5);return(function(t,i){return i||t===void 0?t:Math.abs(t)<=e?0:t})}const Np=42,Uu=256,Bu=0;class un extends Sn{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Eu(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&&gp(),e.center&&(e.center=Yn(e.center,this.projection_)),e.extent&&(e.extent=Zn(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){const t=Object.assign({},e);for(const a in ln)delete t[a];this.setProperties(t,!0);const i=Dw(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=Lw(e),s=i.constraint,o=kw(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=Yn(r.center,this.getProjection())),r.anchor&&(r=Object.assign({},r),r.anchor=Yn(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 u=arguments[r];u.center&&this.setCenterInternal(u.center),u.zoom!==void 0?this.setZoom(u.zoom):u.resolution&&this.setResolution(u.resolution),u.rotation!==void 0&&this.setRotation(u.rotation)}if(r===t){i&&il(i,!0);return}let s=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const c=[];for(;r<t;++r){const u=arguments[r],h={start:s,complete:!1,anchor:u.anchor,duration:u.duration!==void 0?u.duration:1e3,easing:u.easing||Mv,callback:i};if(u.center&&(h.sourceCenter=o,h.targetCenter=u.center.slice(),o=h.targetCenter),u.zoom!==void 0?(h.sourceResolution=a,h.targetResolution=this.getResolutionForZoom(u.zoom),a=h.targetResolution):u.resolution&&(h.sourceResolution=a,h.targetResolution=u.resolution,a=h.targetResolution),u.rotation!==void 0){h.sourceRotation=l;const f=jr(u.rotation-l+Math.PI,2*Math.PI)-Math.PI;h.targetRotation=l+f,l=h.targetRotation}Nw(h)?h.complete=!0:s+=h.duration,c.push(h)}this.animations_.push(c),this.setHint(Ke.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[Ke.ANIMATING]>0}getInteracting(){return this.hints_[Ke.INTERACTING]>0}cancelAnimations(){this.setHint(Ke.ANIMATING,-this.hints_[Ke.ANIMATING]);let e;for(let t=0,i=this.animations_.length;t<i;++t){const r=this.animations_[t];if(r[0].callback&&il(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 u=l.duration>0?c/l.duration:1;u>=1?(l.complete=!0,u=1):s=!1;const h=l.easing(u);if(l.sourceCenter){const f=l.sourceCenter[0],d=l.sourceCenter[1],g=l.targetCenter[0],p=l.targetCenter[1];this.nextCenter_=l.targetCenter;const m=f+h*(g-f),y=d+h*(p-d);this.targetCenter_=[m,y]}if(l.sourceResolution&&l.targetResolution){const f=h===1?l.targetResolution:l.sourceResolution+h*(l.targetResolution-l.sourceResolution);if(l.anchor){const d=this.getViewportSize_(this.getRotation()),g=this.constraints_.resolution(f,0,d,!0);this.targetCenter_=this.calculateCenterZoom(g,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=f,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const f=h===1?jr(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+h*(l.targetRotation-l.sourceRotation);if(l.anchor){const d=this.constraints_.rotation(f,!0);this.targetCenter_=this.calculateCenterRotate(d,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=f}if(this.applyTargetState_(!0),t=!0,!l.complete)break}if(s){this.animations_[i]=null,this.setHint(Ke.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=r[0].callback;o&&il(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]],fu(i,e-this.getRotation()),Hg(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&&Tu(e,this.getProjection())}getCenterInternal(){return this.get(ln.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 Ja(t,this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();const t=this.getCenterInternal();Oe(t,"The view center is not defined");const i=this.getResolution();Oe(i!==void 0,"The view resolution is not defined");const r=this.getRotation();return Oe(r!==void 0,"The view rotation is not defined"),Xa(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(ln.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(Zn(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t=t||this.getViewportSizeMinusPadding_();const i=Se(e)/t[0],r=ot(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(ln.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=$u(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=Da(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){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const t=Ye(Math.floor(e),0,this.resolutions_.length-2),i=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/Math.pow(i,Ye(e-t,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,t){let i;if(Oe(Array.isArray(e)||typeof e.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){Oe(!Ei(e),"Cannot fit empty extent provided as `geometry`");const r=Zn(e,this.getProjection());i=Lp(r)}else if(e.getType()==="Circle"){const r=Zn(e.getExtent(),this.getProjection());i=Lp(r),i.rotate(this.getRotation(),zt(r))}else{const r=oo();r?i=e.clone().transform(r,this.getProjection()):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,u=-1/0;for(let h=0,f=s.length;h<f;h+=o){const d=s[h]*i-s[h+1]*r,g=s[h]*r+s[h+1]*i;a=Math.min(a,d),l=Math.min(l,g),c=Math.max(c,d),u=Math.max(u,g)}return[a,l,c,u]}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(),u=Math.sin(c),h=Math.cos(c),f=zt(a);f[0]+=(r[1]-r[3])/2*l,f[1]+=(r[0]-r[2])/2*l;const d=f[0]*h-f[1]*u,g=f[1]*h+f[0]*u,p=this.getConstrainedCenter([d,g],l),m=t.callback?t.callback:Qs;t.duration!==void 0?this.animateInternal({resolution:l,center:p,duration:t.duration,easing:t.easing},m):(this.targetResolution_=l,this.targetCenter_=p,this.applyTargetState_(!1,!0),il(m,!0))}centerOn(e,t,i){this.centerOnInternal(Yn(e,this.getProjection()),t,i)}centerOnInternal(e,t,i){this.setCenterInternal($u(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=$u(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=Tu(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&&Yn(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=Yn(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&&Yn(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(ln.ROTATION)!==r&&this.set(ln.ROTATION,r),this.get(ln.RESOLUTION)!==o&&(this.set(ln.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(ln.CENTER)||!Ba(this.get(ln.CENTER),a))&&this.set(ln.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()||!Ba(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:s,center:l,resolution:a,duration:e,easing:Vr,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(Ke.INTERACTING,1)}endInteraction(e,t,i){i=i&&Yn(i,this.getProjection()),this.endInteractionInternal(e,t,i)}endInteractionInternal(e,t,i){this.getInteracting()&&(this.setHint(Ke.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 il(n,e){setTimeout(function(){n(e)},0)}function Lw(n){if(n.extent!==void 0){const t=n.smoothExtentConstraint!==void 0?n.smoothExtentConstraint:!0;return Vg(n.extent,n.constrainOnlyCenter,t)}const e=Eu(n.projection,"EPSG:3857");if(n.multiWorld!==!0&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,Vg(t,!1,!1)}return xv}function Dw(n){let e,t,i,o=n.minZoom!==void 0?n.minZoom:Bu,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,u=n.smoothResolutionConstraint!==void 0?n.smoothResolutionConstraint:!0,h=n.showFullExtent!==void 0?n.showFullExtent:!1,f=Eu(n.projection,"EPSG:3857"),d=f.getExtent();let g=n.constrainOnlyCenter,p=n.extent;if(!c&&!p&&f.isGlobal()&&(g=!1,p=d),n.resolutions!==void 0){const m=n.resolutions;t=m[o],i=m[a]!==void 0?m[a]:m[m.length-1],n.constrainResolution?e=Aw(m,u,!g&&p,h):e=Dp(t,i,u,!g&&p,h)}else{const y=(d?Math.max(Se(d),ot(d)):360*bi.degrees/f.getMetersPerUnit())/Uu/Math.pow(2,Bu),_=y/Math.pow(2,28-Bu);t=n.maxResolution,t!==void 0?o=0:t=y/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=y/Math.pow(l,a):i=_),a=o+Math.floor(Math.log(t/i)/Math.log(l)),i=t/Math.pow(l,a-o),n.constrainResolution?e=Pw(l,t,i,u,!g&&p,h):e=Dp(t,i,u,!g&&p,h)}return{constraint:e,maxResolution:t,minResolution:i,minZoom:o,zoomFactor:l}}function kw(n){if(n.enableRotation!==void 0?n.enableRotation:!0){const t=n.constrainRotation;return t===void 0||t===!0?Ow():t===!1?kp:typeof t=="number"?Fw(t):kp}return Xu}function Nw(n){return!(n.sourceCenter&&n.targetCenter&&!Ba(n.sourceCenter,n.targetCenter)||n.sourceResolution!==n.targetResolution||n.sourceRotation!==n.targetRotation)}function $u(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,u=l*s+a*o;return[c,u]}const rl="ol-hidden",sl="ol-unselectable",Ku="ol-control",zp="ol-collapsed",zw=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"),Gp=["style","variant","weight","size","lineHeight","family"],Yu={normal:400,bold:700},Zu=function(n){const e=n.match(zw);if(!e)return null;const t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let i=0,r=Gp.length;i<r;++i){const s=e[i+1];s!==void 0&&(t[Gp[i]]=typeof s=="string"?s.trim():s)}return isNaN(Number(t.weight))&&t.weight in Yu&&(t.weight=Yu[t.weight]),t.families=t.family.split(/,\s?/).map(i=>i.trim().replace(/^['"]|['"]$/g,"")),t};function Ze(n,e,t,i){let r;return t&&t.length?r=t.shift():wt?r=new class extends OffscreenCanvas{style={}}(n??300,e??150):r=document.createElement("canvas"),n&&(r.width=n),e&&(r.height=e),r.getContext("2d",i)}let qu;function ol(){return qu||(qu=Ze(1,1)),qu}function uo(n){const e=n.canvas;e.width=1,e.height=1,n.clearRect(0,0,1,1)}function jp(n,e){const t=e.parentNode;t&&t.replaceChild(n,e)}function Gw(n){for(;n.lastChild;)n.lastChild.remove()}function jw(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 Wp(){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 Ri(n){return typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas}class Hu extends Sn{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(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&this.element?.remove();for(let t=0,i=this.listenerKeys.length;t<i;++t)We(this.listenerKeys[t]);if(this.listenerKeys.length=0,this.map_=e,e){const t=this.target_??e.getOverlayContainerStopEvent();this.element&&t.appendChild(this.element),this.render!==Qs&&this.listenerKeys.push(Te(e,xi.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e=="string"?document.getElementById(e):e}}class Ww extends Hu{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(de.CLICK,this.handleClick_.bind(this),!1);const c=t+" "+sl+" "+Ku+(this.collapsed_&&this.collapsible_?" "+zp:"")+(this.collapsible_?"":" ol-uncollapsible"),u=this.element;u.className=c,u.appendChild(this.toggleButton_),u.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=>s.getSource()?.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=>zr(()=>r))),i=t.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!yi(t,this.renderedAttributions_)){Gw(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(zp),this.collapsed_?jp(this.collapseLabel_,this.label_):jp(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 Vw extends Hu{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(de.CLICK,this.handleClick_.bind(this),!1);const a=t+" "+sl+" "+Ku,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(rl)}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:Vr}):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(rl);!s&&i===0?this.element.classList.add(rl):s&&i!==0&&this.element.classList.remove(rl)}this.label_.style.transform=r}this.rotation_=i}}class Xw extends Hu{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",u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=l,u.appendChild(typeof o=="string"?document.createTextNode(o):o),u.addEventListener(de.CLICK,this.handleClick_.bind(this,i),!1);const h=document.createElement("button");h.className=s,h.setAttribute("type","button"),h.title=c,h.appendChild(typeof a=="string"?document.createTextNode(a):a),h.addEventListener(de.CLICK,this.handleClick_.bind(this,-i),!1);const f=t+" "+sl+" "+Ku,d=this.element;d.className=f,d.appendChild(u),d.appendChild(h),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:Vr})):i.setZoom(s)}}}function Uw(n){n=n||{};const e=new Zt;return(n.zoom===void 0||n.zoom)&&e.push(new Xw(n.zoomOptions)),(n.rotate===void 0||n.rotate)&&e.push(new Vw(n.rotateOptions)),(n.attribution===void 0||n.attribution)&&e.push(new Ww(n.attributionOptions)),e}class Bw{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<16.666666666666668)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 Vp={ACTIVE:"active"};class ho extends Sn{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(Vp.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(Vp.ACTIVE,e)}setMap(e){this.map_=e}}function $w(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:Av,center:n.getConstrainedCenter(r)})}}function Ju(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:Vr})}class Kw extends ho{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==nt.DBLCLICK){const i=e.originalEvent,r=e.map,s=e.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=r.getView();Ju(a,o,s,this.duration_),i.preventDefault(),t=!0}return!t}}function Qu(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 Yw=function(n){const e=n.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Zw=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)},Xp=function(n){const e=n.map.getTargetElement(),t=e.getRootNode();return(t instanceof ShadowRoot?t.host:e).hasAttribute("tabindex")?Zw(n):!0},qw=Js,Up=function(n){const e=n.originalEvent;return"pointerId"in e&&e.button==0&&!(hv&&Ng&&e.ctrlKey)},Bp=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Hw=function(n){const e=n.originalEvent;return Ng?e.metaKey:e.ctrlKey},Jw=function(n){const e=n.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},$p=function(n){const e=n.originalEvent,t=e.target.tagName;return t!=="INPUT"&&t!=="SELECT"&&t!=="TEXTAREA"&&!e.target.isContentEditable},eh=function(n){const e=n.originalEvent;return"pointerId"in e&&e.pointerType=="mouse"},Qw=function(n){const e=n.originalEvent;return"pointerId"in e&&e.isPrimary&&e.button===0};class fo extends ho{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==nt.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==nt.POINTERUP){const i=this.handleUpEvent(e);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(e.type==nt.POINTERDOWN){const i=this.handleDownEvent(e);this.handlingDownUpSequence=i,t=this.stopDown(i)}else e.type==nt.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 th(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 eE extends fo{constructor(e){super({stopDown:ka}),e=e||{},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const t=e.condition?e.condition:Qu(Bp,Qw);this.condition_=e.onFocusOnly?Qu(Xp,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(th(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();Jg(s,a.getResolution()),fu(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:Vr})}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 tE extends fo{constructor(e){e=e||{},super({stopDown:ka}),this.condition_=e.condition?e.condition:Yw,this.lastAngle_=void 0,this.duration_=e.duration!==void 0?e.duration:250}handleDragEvent(e){if(!eh(e))return;const t=e.map,i=t.getView();if(i.getConstraints().rotation===Xu)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 eh(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return eh(e)&&Up(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class nE extends Hs{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 Hn([r])}getGeometry(){return this.geometry_}}const Zr={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class go extends an{constructor(e,t,i){super(e),this.coordinate=t,this.mapBrowserEvent=i}}class iE extends fo{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new nE(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??Up,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 go(Zr.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 go(t?Zr.BOXEND:Zr.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 go(Zr.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new go(Zr.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new go(Zr.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}}class rE extends iE{constructor(e){e=e||{};const t=e.condition?e.condition:Jw;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:Vr})}}const or={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class sE extends ho{constructor(e){super(),e=e||{},this.defaultCondition_=function(t){return Bp(t)&&$p(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==de.KEYDOWN){const i=e.originalEvent,r=i.key;if(this.condition_(e)&&(r==or.DOWN||r==or.LEFT||r==or.RIGHT||r==or.UP)){const o=e.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;r==or.DOWN?c=-a:r==or.LEFT?l=-a:r==or.RIGHT?l=a:c=a;const u=[l,c];fu(u,o.getRotation()),$w(o,u,this.duration_),i.preventDefault(),t=!0}}return!t}}class oE extends ho{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(t){return!Hw(t)&&$p(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==de.KEYDOWN||e.type==de.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();Ju(a,o,void 0,this.duration_),i.preventDefault(),t=!0}}return!t}}const aE=40,lE=300,cE=3;class uE extends ho{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:qw;this.condition_=e.onFocusOnly?Qu(Xp,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300,this.ctrlKeyPressed_=!1,this.ctrlKeyListenerKeys_=[]}setMap(e){if(this.ctrlKeyListenerKeys_.forEach(We),this.ctrlKeyListenerKeys_.length=0,this.ctrlKeyPressed_=!1,super.setMap(e),e){const t=e.getOwnerDocument();this.ctrlKeyListenerKeys_.push(Te(t,"keydown",i=>{i.key==="Control"&&(this.ctrlKeyPressed_=!0)}),Te(t,"keyup",i=>{i.key==="Control"&&(this.ctrlKeyPressed_=!1)}))}}endInteraction_(){this.trackpadTimeoutId_=void 0;const e=this.getMap();if(!e)return;const t=e.getView(),i=this.lastDelta_?this.lastDelta_>0?1:-1:0;t.endInteraction(this.constrainResolution_||t.getConstrainResolution()?100:void 0,i,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==de.WHEEL)return!0;const i=e.map,r=e.originalEvent;r.preventDefault();const s=r.ctrlKey&&!this.ctrlKeyPressed_;r.ctrlKey||(this.ctrlKeyPressed_=!1),this.useAnchor_&&(this.lastAnchor_=e.pixel);let o=r.deltaY;switch(r.deltaMode){case WheelEvent.DOM_DELTA_LINE:o*=aE;break;case WheelEvent.DOM_DELTA_PAGE:o*=lE;break}if(o===0)return!1;this.lastDelta_=o;const a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(o)<4?"trackpad":"wheel");const l=i.getView();if(this.mode_==="trackpad")return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),s&&(o=o*cE),l.adjustZoom(-o/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=a,!1;this.totalDelta_+=o;const c=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),c),!1}handleWheelZoom_(e){const t=e.getView();t.getAnimating()&&t.cancelAnimations();let i=-Ye(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Ju(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 hE extends fo{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=ka),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!==Xu&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(th(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 fE extends fo{constructor(e){e=e||{};const t=e;t.stopDown||(t.stopDown=ka),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(th(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 dE(n){n=n||{};const e=new Zt,t=new Bw(-.005,.05,100);return(n.altShiftDragRotate===void 0||n.altShiftDragRotate)&&e.push(new tE),(n.doubleClickZoom===void 0||n.doubleClickZoom)&&e.push(new Kw({delta:n.zoomDelta,duration:n.zoomDuration})),(n.dragPan===void 0||n.dragPan)&&e.push(new eE({onFocusOnly:n.onFocusOnly,kinetic:t})),(n.pinchRotate===void 0||n.pinchRotate)&&e.push(new hE),(n.pinchZoom===void 0||n.pinchZoom)&&e.push(new fE({duration:n.zoomDuration})),(n.keyboard===void 0||n.keyboard)&&(e.push(new sE),e.push(new oE({delta:n.zoomDelta,duration:n.zoomDuration}))),(n.mouseWheelZoom===void 0||n.mouseWheelZoom)&&e.push(new uE({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(n.shiftDragZoom===void 0||n.shiftDragZoom)&&e.push(new rE({duration:n.zoomDuration})),e}const Ge={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 Kp extends Sn{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[Ge.OPACITY]=e.opacity!==void 0?e.opacity:1,Oe(typeof t[Ge.OPACITY]=="number","Layer opacity must be a number"),t[Ge.VISIBLE]=e.visible!==void 0?e.visible:!0,t[Ge.Z_INDEX]=e.zIndex,t[Ge.MAX_RESOLUTION]=e.maxResolution!==void 0?e.maxResolution:1/0,t[Ge.MIN_RESOLUTION]=e.minResolution!==void 0?e.minResolution:0,t[Ge.MIN_ZOOM]=e.minZoom!==void 0?e.minZoom:-1/0,t[Ge.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=Ye(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 pe()}getLayerStatesArray(e){return pe()}getExtent(){return this.get(Ge.EXTENT)}getMaxResolution(){return this.get(Ge.MAX_RESOLUTION)}getMinResolution(){return this.get(Ge.MIN_RESOLUTION)}getMinZoom(){return this.get(Ge.MIN_ZOOM)}getMaxZoom(){return this.get(Ge.MAX_ZOOM)}getOpacity(){return this.get(Ge.OPACITY)}getSourceState(){return pe()}getVisible(){return this.get(Ge.VISIBLE)}getZIndex(){return this.get(Ge.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(Ge.EXTENT,e)}setMaxResolution(e){this.set(Ge.MAX_RESOLUTION,e)}setMinResolution(e){this.set(Ge.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(Ge.MAX_ZOOM,e)}setMinZoom(e){this.set(Ge.MIN_ZOOM,e)}setOpacity(e){Oe(typeof e=="number","Layer opacity must be a number"),this.set(Ge.OPACITY,e)}setVisible(e){this.set(Ge.VISIBLE,e)}setZIndex(e){this.set(Ge.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Si={ADDLAYER:"addlayer",REMOVELAYER:"removelayer"};class Ii extends an{constructor(e,t){super(e),this.layer=t}}const nh={LAYERS:"layers"};class Mi extends Kp{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(nh.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new Zt(i.slice(),{unique:!0}):Oe(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new Zt(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(We),this.layersListenerKeys_.length=0;const e=this.getLayers();this.layersListenerKeys_.push(Te(e,Nt.ADD,this.handleLayersAdd_,this),Te(e,Nt.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(We);qs(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 Ii(Si.ADDLAYER,s))}this.changed()}registerLayerListeners_(e){const t=[Te(e,Nr.PROPERTYCHANGE,this.handleLayerChange_,this),Te(e,de.CHANGE,this.handleLayerChange_,this)];e instanceof Mi&&t.push(Te(e,Si.ADDLAYER,this.handleLayerGroupAdd_,this),Te(e,Si.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[_e(e)]=t}handleLayerGroupAdd_(e){this.dispatchEvent(new Ii(Si.ADDLAYER,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new Ii(Si.REMOVELAYER,e.layer))}handleLayersAdd_(e){const t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new Ii(Si.ADDLAYER,t)),this.changed()}handleLayersRemove_(e){const t=e.element,i=_e(t);this.listenerKeys_[i].forEach(We),delete this.listenerKeys_[i],this.dispatchEvent(new Ii(Si.REMOVELAYER,t)),this.changed()}getLayers(){return this.get(nh.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 Ii(Si.REMOVELAYER,i[r]))}this.set(nh.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=cn(l.extent,r.extent):l.extent=r.extent),l.zIndex===void 0&&(l.zIndex=s)}return t}getSourceState(){return"ready"}}const Jt={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class qr extends Kp{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(Ge.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(Ge.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_&&(We(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const e=this.getSource();e&&(this.sourceChangeKey_=Te(e,de.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 un?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 ih(r,t.viewState)&&(!s||it(s,t.extent))}getAttributions(e){if(!this.isVisible(e))return[];const t=this.getSource()?.getAttributions();if(!t)return[];const i=e instanceof un?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(Ge.MAP,e)}getMapInternal(){return this.get(Ge.MAP)}setMap(e){this.mapPrecomposeKey_&&(We(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(We(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=Te(e,Jt.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=Te(this,de.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){const t=e.frameState.layerStatesArray,i=this.getLayerState(!1);Oe(!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(Ge.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 ih(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 Yp(n,e,t=0,i=n.length-1,r=gE){for(;i>t;){if(i-t>600){const l=i-t+1,c=e-t+1,u=Math.log(l),h=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),d=Math.max(t,Math.floor(e-c*h/l+f)),g=Math.min(i,Math.floor(e+(l-c)*h/l+f));Yp(n,e,d,g,r)}const s=n[e];let o=t,a=i;for(po(n,t,e),r(n[i],s)>0&&po(n,t,i);o<a;){for(po(n,o,a),o++,a--;r(n[o],s)<0;)o++;for(;r(n[a],s)>0;)a--}r(n[t],s)===0?po(n,t,a):(a++,po(n,a,i)),a<=e&&(t=a+1),e<=a&&(i=a-1)}}function po(n,e,t){const i=n[e];n[e]=n[t],n[t]=i}function gE(n,e){return n<e?-1:n>e?1:0}let Zp=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(!ll(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;ll(e,l)&&(t.leaf?i.push(a):sh(e,l)?this._all(a,i):s.push(a))}t=s.pop()}return i}collides(e){let t=this.data;if(!ll(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(ll(e,o)){if(t.leaf||sh(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=Jr([]),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 u=pE(e,i.children,t);if(u!==-1)return i.children.splice(u,1),s.push(i),this._condense(s),this}!c&&!i.leaf&&sh(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=Jr(e.slice(t,i+1)),Hr(a,this.toBBox),a;r||(r=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,r-1))),a=Jr([]),a.leaf=!1,a.height=r;const l=Math.ceil(s/o),c=l*Math.ceil(Math.sqrt(o));qp(e,t,i,c,this.compareMinX);for(let u=t;u<=i;u+=c){const h=Math.min(u+c-1,i);qp(e,u,h,l,this.compareMinY);for(let f=u;f<=h;f+=l){const d=Math.min(f+l-1,h);a.children.push(this._build(e,f,d,r-1))}}return Hr(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],u=rh(c),h=_E(e,c)-u;h<o?(o=h,s=u<s?u:s,a=c):h===o&&u<s&&(s=u,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),yo(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=Jr(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,Hr(i,this.toBBox),Hr(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this.data=Jr([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Hr(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=mo(e,0,a,this.toBBox),c=mo(e,a,i,this.toBBox),u=xE(l,c),h=rh(l)+rh(c);u<s?(s=u,r=a,o=h<o?h:o):u===s&&h<o&&(o=h,r=a)}return r||i-t}_chooseSplitAxis(e,t,i){const r=e.leaf?this.compareMinX:mE,s=e.leaf?this.compareMinY:yE,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=mo(e,0,t,s),a=mo(e,i-t,i,s);let l=al(o)+al(a);for(let c=t;c<i-t;c++){const u=e.children[c];yo(o,e.leaf?s(u):u),l+=al(o)}for(let c=i-t-1;c>=t;c--){const u=e.children[c];yo(a,e.leaf?s(u):u),l+=al(a)}return l}_adjustParentBBoxes(e,t,i){for(let r=i;r>=0;r--)yo(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():Hr(e[t],this.toBBox)}};function pE(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 Hr(n,e){mo(n,0,n.children.length,e,n)}function mo(n,e,t,i,r){r||(r=Jr(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];yo(r,n.leaf?i(o):o)}return r}function yo(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 mE(n,e){return n.minX-e.minX}function yE(n,e){return n.minY-e.minY}function rh(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function al(n){return n.maxX-n.minX+(n.maxY-n.minY)}function _E(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 xE(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 sh(n,e){return n.minX<=e.minX&&n.minY<=e.minY&&e.maxX<=n.maxX&&e.maxY<=n.maxY}function ll(n,e){return e.minX<=n.maxX&&e.minY<=n.maxY&&e.maxX>=n.minX&&e.maxY>=n.minY}function Jr(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function qp(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;Yp(n,o,e,t,r),s.push(e,o,o,t)}}const oh=[NaN,NaN,NaN,0];let ah;function vE(){return ah||(ah=Ze(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),ah}const wE=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,EE=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,bE=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,CE=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function cl(n,e){return n.endsWith("%")?Number(n.substring(0,n.length-1))/e:Number(n)}function _o(n){throw new Error('failed to parse "'+n+'" as color')}function Hp(n){if(n.toLowerCase().startsWith("rgb")){const s=n.match(EE)||n.match(wE)||n.match(bE);if(s){const o=s[4],a=100/255;return[Ye(cl(s[1],a)+.5|0,0,255),Ye(cl(s[2],a)+.5|0,0,255),Ye(cl(s[3],a)+.5|0,0,255),o!==void 0?Ye(cl(o,100),0,1):1]}_o(n)}if(n.startsWith("#")){if(CE.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 u=parseInt(s.substring(l,l+o),16);o===1&&(u+=u<<4),a[l/o]=u}return a[3]=a[3]/255,a}_o(n)}const e=vE();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&&_o(n));const i=e.fillStyle;if(i.startsWith("#")||i.startsWith("rgba"))return Hp(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]=Ga(r[3]/255,3),r}function TE(n){return typeof n=="string"?n:dh(n)}const RE=1024,xo={};let lh=0;function SE(n){if(n.length===4)return n;const e=n.slice();return e[3]=1,e}function ch(n){return n>.0031308?Math.pow(n,.4166666666666667)*269.025-14.025:n*3294.6}function uh(n){return n>.2068965?Math.pow(n,3):(n-.13793103448275862)*.12841854934601665}function hh(n){return n>10.314724?Math.pow((n+14.025)/269.025,2.4):n/3294.6}function fh(n){return n>.0088564?Math.pow(n,.3333333333333333):n/.12841854934601665+.13793103448275862}function Jp(n){const e=hh(n[0]),t=hh(n[1]),i=hh(n[2]),r=fh(e*.222488403+t*.716873169+i*.06060791),s=500*(fh(e*.452247074+t*.399439023+i*.148375274)-r),o=200*(r-fh(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 IE(n){const e=(n[0]+16)/116,t=n[1],i=n[2]*Math.PI/180,r=uh(e),s=uh(e+t/500*Math.cos(i)),o=uh(e-t/200*Math.sin(i)),a=ch(s*3.021973625-r*1.617392459-o*.404875592),l=ch(s*-.943766287+r*1.916279586+o*.027607165),c=ch(s*.069407491-r*.22898585+o*1.159737864);return[Ye(a+.5|0,0,255),Ye(l+.5|0,0,255),Ye(c+.5|0,0,255),n[3]]}function ul(n){if(n==="none")return oh;if(xo.hasOwnProperty(n))return xo[n];if(lh>=RE){let t=0;for(const i in xo)(t++&3)===0&&(delete xo[i],--lh)}const e=Hp(n);e.length!==4&&_o(n);for(const t of e)isNaN(t)&&_o(n);return xo[n]=e,++lh,e}function ar(n){return Array.isArray(n)?n:ul(n)}function dh(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 Qp(n){return n[0]>0&&n[1]>0}function ME(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 Ct(n,e){return Array.isArray(n)?n:(e===void 0?e=[n,n]:(e[0]=n,e[1]=n),e)}let lr=0;const At=1<<lr++,Re=1<<lr++,jt=1<<lr++,hn=1<<lr++,cr=1<<lr++,vo=1<<lr++,hl=Math.pow(2,lr)-1,gh={[At]:"boolean",[Re]:"number",[jt]:"string",[hn]:"color",[cr]:"number[]",[vo]:"size"},AE=Object.keys(gh).map(Number).sort(Tn);function PE(n){return n in gh}function wo(n){const e=[];for(const t of AE)Eo(n,t)&&e.push(gh[t]);return e.length===0?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}function Eo(n,e){return(n&e)===e}function Ai(n,e){return n===e}class dt{constructor(e,t){if(!PE(e))throw new Error(`literal expressions must have a specific type, got ${wo(e)}`);this.type=e,this.value=t}}class FE{constructor(e,t,...i){this.type=e,this.operator=t,this.args=i}}function em(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mCoordinate:!1,mapState:!1}}function mt(n,e,t){switch(typeof n){case"boolean":{if(Ai(e,jt))return new dt(jt,n?"true":"false");if(!Eo(e,At))throw new Error(`got a boolean, but expected ${wo(e)}`);return new dt(At,n)}case"number":{if(Ai(e,vo))return new dt(vo,Ct(n));if(Ai(e,At))return new dt(At,!!n);if(Ai(e,jt))return new dt(jt,n.toString());if(!Eo(e,Re))throw new Error(`got a number, but expected ${wo(e)}`);return new dt(Re,n)}case"string":{if(Ai(e,hn))return new dt(hn,ul(n));if(Ai(e,At))return new dt(At,!!n);if(!Eo(e,jt))throw new Error(`got a string, but expected ${wo(e)}`);return new dt(jt,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 UE(n,e,t);for(const i of n)if(typeof i!="number")throw new Error("expected an array of numbers");if(Ai(e,vo)){if(n.length!==2)throw new Error(`expected an array of two values for a size, got ${n.length}`);return new dt(vo,n)}if(Ai(e,hn)){if(n.length===3)return new dt(hn,[...n,1]);if(n.length===4)return new dt(hn,n);throw new Error(`expected an array of 3 or 4 values for a color, got ${n.length}`)}if(!Eo(e,cr))throw new Error(`got an array of numbers, but expected ${wo(e)}`);return new dt(cr,n)}const j={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"},OE={[j.Get]:me(Ce(1,1/0),tm),[j.Var]:me(Ce(1,1),LE),[j.Has]:me(Ce(1,1/0),tm),[j.Id]:me(DE,Qr),[j.Concat]:me(Ce(2,1/0),De(jt)),[j.GeometryType]:me(kE,Qr),[j.LineMetric]:me(NE,Qr),[j.Resolution]:me(ph,Qr),[j.Zoom]:me(ph,Qr),[j.Time]:me(ph,Qr),[j.Any]:me(Ce(2,1/0),De(At)),[j.All]:me(Ce(2,1/0),De(At)),[j.Not]:me(Ce(1,1),De(At)),[j.Equal]:me(Ce(2,2),De(hl)),[j.NotEqual]:me(Ce(2,2),De(hl)),[j.GreaterThan]:me(Ce(2,2),De(Re)),[j.GreaterThanOrEqualTo]:me(Ce(2,2),De(Re)),[j.LessThan]:me(Ce(2,2),De(Re)),[j.LessThanOrEqualTo]:me(Ce(2,2),De(Re)),[j.Multiply]:me(Ce(2,1/0),nm),[j.Coalesce]:me(Ce(2,1/0),nm),[j.Divide]:me(Ce(2,2),De(Re)),[j.Add]:me(Ce(2,1/0),De(Re)),[j.Subtract]:me(Ce(2,2),De(Re)),[j.Clamp]:me(Ce(3,3),De(Re)),[j.Mod]:me(Ce(2,2),De(Re)),[j.Pow]:me(Ce(2,2),De(Re)),[j.Abs]:me(Ce(1,1),De(Re)),[j.Floor]:me(Ce(1,1),De(Re)),[j.Ceil]:me(Ce(1,1),De(Re)),[j.Round]:me(Ce(1,1),De(Re)),[j.Sin]:me(Ce(1,1),De(Re)),[j.Cos]:me(Ce(1,1),De(Re)),[j.Atan]:me(Ce(1,2),De(Re)),[j.Sqrt]:me(Ce(1,1),De(Re)),[j.Match]:me(Ce(4,1/0),im,GE),[j.Between]:me(Ce(3,3),De(Re)),[j.Interpolate]:me(Ce(6,1/0),im,jE),[j.Case]:me(Ce(3,1/0),zE,WE),[j.In]:me(Ce(2,2),VE),[j.Number]:me(Ce(1,1/0),De(hl)),[j.String]:me(Ce(1,1/0),De(hl)),[j.Array]:me(Ce(1,1/0),De(Re)),[j.Color]:me(Ce(1,4),De(Re)),[j.Band]:me(Ce(1,3),De(Re)),[j.Palette]:me(Ce(2,2),XE),[j.ToString]:me(Ce(1,1),De(At|Re|jt|hn))};function tm(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 dt(Re,o);break}case"string":{r[s]=new dt(jt,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 LE(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 dt(jt,i)]}function DE(n,e,t){t.featureId=!0}function kE(n,e,t){t.geometryType=!0}function NE(n,e,t){t.mCoordinate=!0}function ph(n,e,t){t.mapState=!0}function Qr(n,e,t){const i=n[0];if(n.length!==1)throw new Error(`expected no arguments for ${i} operation`);return[]}function Ce(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 nm(n,e,t){const i=n.length-1,r=new Array(i);for(let s=0;s<i;++s){const o=mt(n[s+1],e,t);r[s]=o}return r}function De(n){return function(e,t,i){const r=e.length-1,s=new Array(r);for(let o=0;o<r;++o){const a=mt(e[o+1],n,i);s[o]=a}return s}}function zE(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 im(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 GE(n,e,t){const i=n.length-1,r=jt|Re|At,s=mt(n[1],r,t),o=mt(n[n.length-1],e,t),a=new Array(i-2);for(let l=0;l<i-2;l+=2){try{const c=mt(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=mt(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 jE(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 dt(Re,r);let o;try{o=mt(n[2],Re,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=mt(n[l+3],Re,t);a[l]=c}catch(c){throw new Error(`failed to parse argument ${l+2} for interpolate expression: ${c.message}`)}try{const c=mt(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 WE(n,e,t){const i=mt(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=mt(n[s+1],At,t);r[s]=o}catch(o){throw new Error(`failed to parse argument ${s} of case expression: ${o.message}`)}try{const o=mt(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 VE(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(i[0]==="literal"){if(i=i[1],!Array.isArray(i))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array')}else if(typeof i[0]=="string")throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');typeof i[0]=="string"?r=jt:r=Re;const s=new Array(i.length);for(let a=0;a<s.length;a++)try{const l=mt(i[a],r,t);s[a]=l}catch(l){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${l.message}`)}return[mt(n[1],r,t),...s]}function XE(n,e,t){let i;try{i=mt(n[1],Re,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=mt(r[o],hn,t)}catch(l){throw new Error(`failed to parse color at index ${o} in palette expression: ${l.message}`)}if(!(a instanceof dt))throw new Error(`the palette color at index ${o} must be a literal value`);s[o]=a}return[i,...s]}function me(...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 FE(t,r,...s)}}function UE(n,e,t){const i=n[0],r=OE[i];if(!r)throw new Error(`unknown operator: ${i}`);return r(n,e,t)}function rm(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 rm(n.getGeometries()[0]);default:return""}}function sm(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function Mn(n,e,t){const i=mt(n,e,t);return fn(i)}function fn(n,e){if(n instanceof dt){if(n.type===hn&&typeof n.value=="string"){const i=ul(n.value);return function(){return i}}return function(){return n.value}}const t=n.operator;switch(t){case j.Number:case j.String:case j.Coalesce:return BE(n);case j.Get:case j.Var:case j.Has:return $E(n);case j.Id:return i=>i.featureId;case j.GeometryType:return i=>i.geometryType;case j.Concat:{const i=n.args.map(r=>fn(r));return r=>"".concat(...i.map(s=>s(r).toString()))}case j.Resolution:return i=>i.resolution;case j.Any:case j.All:case j.Between:case j.In:case j.Not:return YE(n);case j.Equal:case j.NotEqual:case j.LessThan:case j.LessThanOrEqualTo:case j.GreaterThan:case j.GreaterThanOrEqualTo:return KE(n);case j.Multiply:case j.Divide:case j.Add:case j.Subtract:case j.Clamp:case j.Mod:case j.Pow:case j.Abs:case j.Floor:case j.Ceil:case j.Round:case j.Sin:case j.Cos:case j.Atan:case j.Sqrt:return ZE(n);case j.Case:return qE(n);case j.Match:return HE(n);case j.Interpolate:return JE(n);case j.ToString:return QE(n);default:throw new Error(`Unsupported operator ${t}`)}}function BE(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=fn(n.args[s]);switch(t){case j.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 j.Number:case j.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 $E(n,e){const i=n.args[0].value;switch(n.operator){case j.Get:return r=>{const s=n.args;let o=r.properties[i];for(let a=1,l=s.length;a<l;++a){const u=s[a].value;o=o[u]}return o};case j.Var:return r=>r.variables[i];case j.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 u=s[a].value;if(!o||!Object.hasOwn(o,u))return!1;o=o[u]}return!0};default:throw new Error(`Unsupported accessor operator ${n.operator}`)}}function KE(n,e){const t=n.operator,i=fn(n.args[0]),r=fn(n.args[1]);switch(t){case j.Equal:return s=>i(s)===r(s);case j.NotEqual:return s=>i(s)!==r(s);case j.LessThan:return s=>i(s)<r(s);case j.LessThanOrEqualTo:return s=>i(s)<=r(s);case j.GreaterThan:return s=>i(s)>r(s);case j.GreaterThanOrEqualTo:return s=>i(s)>=r(s);default:throw new Error(`Unsupported comparison operator ${t}`)}}function YE(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=fn(n.args[s]);switch(t){case j.Any:return s=>{for(let o=0;o<i;++o)if(r[o](s))return!0;return!1};case j.All:return s=>{for(let o=0;o<i;++o)if(!r[o](s))return!1;return!0};case j.Between:return s=>{const o=r[0](s),a=r[1](s),l=r[2](s);return o>=a&&o<=l};case j.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 j.Not:return s=>!r[0](s);default:throw new Error(`Unsupported logical operator ${t}`)}}function ZE(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=fn(n.args[s]);switch(t){case j.Multiply:return s=>{let o=1;for(let a=0;a<i;++a)o*=r[a](s);return o};case j.Divide:return s=>r[0](s)/r[1](s);case j.Add:return s=>{let o=0;for(let a=0;a<i;++a)o+=r[a](s);return o};case j.Subtract:return s=>r[0](s)-r[1](s);case j.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 j.Mod:return s=>r[0](s)%r[1](s);case j.Pow:return s=>Math.pow(r[0](s),r[1](s));case j.Abs:return s=>Math.abs(r[0](s));case j.Floor:return s=>Math.floor(r[0](s));case j.Ceil:return s=>Math.ceil(r[0](s));case j.Round:return s=>Math.round(r[0](s));case j.Sin:return s=>Math.sin(r[0](s));case j.Cos:return s=>Math.cos(r[0](s));case j.Atan:return i===2?s=>Math.atan2(r[0](s),r[1](s)):s=>Math.atan(r[0](s));case j.Sqrt:return s=>Math.sqrt(r[0](s));default:throw new Error(`Unsupported numeric operator ${t}`)}}function qE(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=fn(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 HE(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=fn(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 JE(n,e){const t=n.args.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=fn(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 u=i[c](r);let h=i[c+1](r);const f=Array.isArray(h);if(f&&(h=SE(h)),u>=o)return c===2?h:f?eb(s,o,a,l,u,h):bo(s,o,a,l,u,h);a=u,l=h}return l}}function QE(n,e){const t=n.operator,i=n.args.length,r=new Array(i);for(let s=0;s<i;++s)r[s]=fn(n.args[s]);if(t===j.ToString)return s=>{const o=r[0](s);return n.args[0].type===hn?dh(o):o.toString()};throw new Error(`Unsupported convert operator ${t}`)}function bo(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 eb(n,e,t,i,r,s){if(r-t===0)return i;const a=Jp(i),l=Jp(s);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const u=[bo(n,e,t,a[0],r,l[0]),bo(n,e,t,a[1],r,l[1]),a[2]+bo(n,e,t,0,r,c),bo(n,e,t,i[3],r,s[3])];return IE(u)}const re={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class mh extends eo{constructor(e,t,i,r){super(),this.extent=e,this.pixelRatio_=i,this.resolution=t,this.state=typeof r=="function"?re.IDLE:r,this.image_=null,this.loader=typeof r=="function"?r:null}changed(){this.dispatchEvent(de.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==re.IDLE&&this.loader){this.state=re.LOADING,this.changed();const e=this.getResolution(),t=Array.isArray(e)?e[0]:e;zr(()=>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||dv&&i instanceof ImageBitmap||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement)&&(this.image_=i),this.state=re.LOADED}).catch(i=>{this.state=re.ERROR,console.error(i)}).finally(()=>this.changed())}}setImage(e){this.image_=e}setResolution(e){this.resolution=e}}function tb(n,e,t){const i=n;let r=!0,s=!1,o=!1;const a=[La(i,de.LOAD,function(){o=!0,s||e()})];return i.src&&zg?(s=!0,i.decode().then(function(){r&&e()}).catch(function(l){r&&(o?e():t())})):a.push(La(i,de.ERROR,t)),function(){r=!1,a.forEach(We)}}function nb(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 ib(n,e){return e&&(n.src=e),n.src&&zg?new Promise((t,i)=>n.decode().then(()=>t(n)).catch(r=>n.complete&&n.width?t(n):i(r))):nb(n)}class rb{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){const i=yh(e,t);return i in this.cache_?this.cache_[i]:null}getPattern(e,t){const i=yh(e,t);return i in this.patternCache_?this.patternCache_[i]:null}set(e,t,i,r){const s=yh(e,t),o=s in this.cache_;this.cache_[s]=i,r&&(i.getImageState()===re.IDLE&&i.load(),i.getImageState()===re.LOADING?i.ready().then(()=>{this.patternCache_[s]=ol().createPattern(i.getImage(1),"repeat")}):this.patternCache_[s]=ol().createPattern(i.getImage(1),"repeat")),o||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function yh(n,e){const t=e?ar(e):"null";return n+":"+t}const Qt=new rb;let Co=null;class om extends eo{constructor(e,t,i,r,s){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=i?.crossOrigin,this.referrerPolicy_=i?.referrerPolicy,this.canvas_={},this.color_=s,this.imageState_=r===void 0?re.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_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===re.LOADED){Co||(Co=Ze(1,1,void 0,{willReadFrequently:!0})),Co.drawImage(this.image_,0,0);try{Co.getImageData(0,0,1,1),this.tainted_=!1}catch{Co=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(de.CHANGE)}handleImageError_(){this.imageState_=re.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=re.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_}setImage(e){this.image_=e}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=Ze(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_===re.IDLE){this.image_||this.initializeImage_(),this.imageState_=re.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&ib(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_!==re.LOADED)return;const t=this.image_,i=Ze(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=TE(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_===re.LOADED||this.imageState_===re.ERROR)e();else{const t=()=>{(this.imageState_===re.LOADED||this.imageState_===re.ERROR)&&(this.removeEventListener(de.CHANGE,t),e())};this.addEventListener(de.CHANGE,t)}})),this.ready_}}function To(n,e,t,i,r,s){let o=e===void 0?void 0:Qt.get(e,r);return o||(o=new om(n,n&&"src"in n?n.src||void 0:e,t,i,r),Qt.set(e,r,o,s)),s&&o&&!Qt.getPattern(e,r)&&Qt.set(e,r,o,s),o}function An(n){return n?Array.isArray(n)?dh(n):typeof n=="object"&&"src"in n?sb(n):n:null}function sb(n){if(!n.offset||!n.size)return Qt.getPattern(n.src,n.color);const e=n.src+":"+n.offset,t=Qt.getPattern(e,n.color);if(t)return t;const i=Qt.get(n.src,null);if(i.getImageState()!==re.LOADED)return null;const r=Ze(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]),To(r.canvas,e,void 0,re.LOADED,n.color,!0),Qt.getPattern(e,n.color)}const am="10px sans-serif",Wt="#000",es="round",Jn=[],Qn=0,ts="round",Ro=10,ob=0,Pn="#000",So="center",fl="middle",ur=[0,0,0,0],Io=1,hr=new Sn;let Mo=null,lm;const _h={},ab=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function lb(n,e,t){return`${n} ${e} 16px "${t}"`}const cb=(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=Zu(s),l=a.families[0].toLowerCase(),c=a.weight;return o.some(u=>{const h=u.family.replace(/^['"]|['"]$/g,"").toLowerCase(),f=Yu[u.weight]||u.weight;return h===l&&u.style===a.style&&f==c})}async function r(){await t.ready;let s=!0;const o=hr.getProperties(),a=Object.keys(o).filter(l=>o[l]<100);for(let l=a.length-1;l>=0;--l){const c=a[l];let u=o[c];u<100&&(await i(c)?(qs(_h),hr.set(c,100)):(u+=10,hr.set(c,u,!0),u<100&&(s=!1)))}e=void 0,s||(e=setTimeout(r,100))}return async function(s){t||(t=wt?self.fonts:document.fonts);const o=Zu(s);if(!o)return;const a=o.families;let l=!1;for(const c of a){if(ab.has(c))continue;const u=lb(o.style,o.weight,c);hr.get(u)===void 0&&(hr.set(u,0,!0),l=!0)}l&&(clearTimeout(e),e=setTimeout(r,100))}})(),ub=(function(){let n;return function(e){let t=_h[e];if(t==null){if(wt){const i=Zu(e),r=cm(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);_h[e]=t}return t}})();function cm(n,e){return Mo||(Mo=Ze(1,1)),n!=lm&&(Mo.font=n,lm=Mo.font),Mo.measureText(e)}function um(n,e){return cm(n,e).width}function hm(n,e,t){if(e in t)return t[e];const i=e.split(`
5
5
  `).reduce((r,s)=>Math.max(r,um(n,s)),0);return t[e]=i,i}function hb(n,e){const t=[],i=[],r=[];let s=0,o=0,a=0,l=0;for(let c=0,u=e.length;c<=u;c+=2){const h=e[c];if(h===`
6
- `||c===u){s=Math.max(s,o),r.push(o),o=0,a+=l,l=0;continue}const f=e[c+1]||n.font,d=um(f,h);t.push(d),o+=d;const g=ub(f);i.push(g),l=Math.max(l,g)}return{width:s,height:a,widths:t,heights:i,lineWidths:r}}function fb(n,e,t,i,r,s,o,a,l,c,u){n.save(),t!==1&&(n.globalAlpha===void 0?n.globalAlpha=h=>h.globalAlpha*=t:n.globalAlpha*=t),e&&n.transform.apply(n,e),i.contextInstructions?(n.translate(l,c),n.scale(u[0],u[1]),db(i,n)):u[0]<0||u[1]<0?(n.translate(l,c),n.scale(u[0],u[1]),n.drawImage(i,r,s,o,a,0,0,o,a)):n.drawImage(i,r,s,o,a,l,c,o*u[0],a*u[1]),n.restore()}function db(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 dl{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=bt(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new dl({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 pe()}getImage(e){return pe()}getHitDetectionImage(){return pe()}getPixelRatio(e){return 1}getImageState(){return pe()}getImageSize(){return pe()}getOrigin(){return pe()}getSize(){return pe()}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_=bt(e)}listenImageChange(e){pe()}load(){pe()}unlistenImageChange(e){pe()}ready(){return Promise.resolve()}}class gl extends dl{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()?re.LOADING:re.LOADED,this.imageState_===re.LOADING&&this.ready().then(()=>this.imageState_=re.LOADED),this.render()}clone(){const e=this.getScale(),t=new gl({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){const t=this.fill_?.getKey(),i=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(",");let r=Jt.get(i,null)?.getImage(1);if(!r){const s=this.renderOptions_,o=Math.ceil(s.size*e),a=Ze(o,o);this.draw_(s,a,e),r=a.canvas;const l=new om(r,void 0,null,re.LOADED,null);Jt.set(i,null,l),createImageBitmap(r).then(c=>{l.setImage(c)})}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}setRadius(e){this.radius!==e&&(this.radius=e,this.render())}getRadius2(){return this.radius2_}setRadius2(e){this.radius2_!==e&&(this.radius2_=e,this.render())}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 T=r;r=s,s=T}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),u=r-c,h=Math.sqrt(l*l+u*u),f=h/l;if(e==="miter"&&f<=i)return f*t;const d=t/2/f,g=t/2*(u/h),m=Math.sqrt((r+d)*(r+d)+g*g)-r;if(this.radius2_===void 0||e==="bevel")return m*2;const y=r*Math.sin(a),_=Math.sqrt(r*r-y*y),v=s-_,w=Math.sqrt(y*y+v*v)/y;if(w<=i){const T=w*t/2-s-r;return 2*Math.max(m,T)}return m*2}createRenderOptions(){let e=Qr,t=es,i=0,r=null,s=0,o,a=0;this.stroke_&&(o=Mn(this.stroke_.getColor()??An),a=this.stroke_.getWidth()??Io,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,t=this.stroke_.getLineJoin()??es,e=this.stroke_.getLineCap()??Qr,i=this.stroke_.getMiterLimit()??Ro);const l=this.calculateLineJoinSize_(t,a,i),c=Math.max(this.radius,this.radius2_||0),u=Math.ceil(2*c+l);return{strokeStyle:o,strokeWidth:a,size:u,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=Wt),t.fillStyle=Mn(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=or(i)),i===null?r=1:Array.isArray(i)&&(r=i.length===4?i[3]:1),r===0&&(t=Ze(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=Wt,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 ts extends gl{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 ts({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}}class Qt{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 Qt({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=To(null,e.src,{crossOrigin:"anonymous"},void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then(()=>{this.patternImage_=null}),t.getImageState()===re.IDLE&&t.load(),t.getImageState()===re.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){const e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?_e(e):typeof e=="object"&&"src"in e?e.src+":"+e.offset:or(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function fm(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 hr extends dl{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,this.referrerPolicy_=e.referrerPolicy;const o=e.img!==void 0?e.img:null;let a=e.src;Oe(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||_e(o)),Oe(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),Oe(!((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=re.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?re.LOADED:re.IDLE:l=re.LOADING:l=re.LOADED),this.color_=e.color!==void 0?or(e.color):null,this.iconImage_=To(o,a,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},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,u;if(e.size)[c,u]=e.size;else{const h=this.getImage(1);if(h.width&&h.height)c=h.width,u=h.height;else if(h instanceof HTMLImageElement){this.initialOptions_=e;const f=()=>{if(this.unlistenImageChange(f),!this.initialOptions_)return;const d=this.iconImage_.getSize();this.setScale(fm(d[0],d[1],e.width,e.height))};this.listenImageChange(f);return}}c!==void 0&&this.setScale(fm(c,u,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 hr({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_,referrerPolicy:this.referrerPolicy_,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_}setColor(e){const t=e?or(e):null;if(this.color_===t||this.color_&&t&&this.color_.length===t.length&&this.color_.every((o,a)=>o===t[a]))return;this.color_=t;const i=this.getSrc(),r=i!==void 0?null:this.getHitDetectionImage(),s=i!==void 0?re.IDLE:this.iconImage_.getImageState();this.iconImage_=To(r,i,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},s,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_=To(null,e,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},re.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()==re.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()==re.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(de.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(de.CHANGE,e)}ready(){return this.iconImage_.ready()}}class Qn{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.offset_=e.offset,this.width_=e.width}clone(){const e=this.getColor();return new Qn({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(),offset:this.getOffset(),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_}getOffset(){return this.offset_}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}setOffset(e){this.offset_=e}setWidth(e){this.width_=e}}class At{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=gm,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 At({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_=gm,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function gb(n){let e;if(typeof n=="function")e=n;else{let t;Array.isArray(n)?t=n:(Oe(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),t=[n]),e=function(){return t}}return e}let xh=null;function dm(n,e){if(!xh){const t=new Qt({color:"rgba(255,255,255,0.4)"}),i=new Qn({color:"#3399CC",width:1.25});xh=[new At({image:new ts({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return xh}function gm(n){return n.getGeometry()}const pb="#333";class Ao{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_=bt(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 Qt({color:pb}),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 Ao({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 Qt?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_=bt(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 mb(n){return!0}function yb(n){const e=em(),t=_b(n,e),i=sm();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=rm(r.getGeometry())),t(i)}}function pm(n){const e=em(),t=n.length,i=new Array(t);for(let o=0;o<t;++o)i[o]=vh(n[o],e);const r=sm(),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 u=i[c](r);u&&(s[l]=u,l+=1)}return s.length=l,s}}function _b(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?In(s.filter,Mt,e):mb;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]=vh(s.style[c],e)}else a=[vh(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 u=c(r);u&&s.push(u)}}}return s}}function vh(n,e){const t=Po(n,"",e),i=Fo(n,"",e),r=xb(n,e),s=vb(n,e),o=yt(n,"z-index",e);if(!t&&!i&&!r&&!s&&!mi(n))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(n));const a=new At;return function(l){let c=!0;if(t){const u=t(l);u&&(c=!1),a.setFill(u)}if(i){const u=i(l);u&&(c=!1),a.setStroke(u)}if(r){const u=r(l);u&&(c=!1),a.setText(u)}if(s){const u=s(l);u&&(c=!1),a.setImage(u)}return o&&a.setZIndex(o(l)),c?null:a}}function Po(n,e,t){let i;if(e+"fill-pattern-src"in n)i=Cb(n,e+"fill-",t);else{if(n[e+"fill-color"]==="none")return s=>null;i=pl(n,e+"fill-color",t)}if(!i)return null;const r=new Qt;return function(s){const o=i(s);return o===oh?null:(r.setColor(o),r)}}function Fo(n,e,t){const i=yt(n,e+"stroke-width",t),r=pl(n,e+"stroke-color",t);if(!i&&!r)return null;const s=ti(n,e+"stroke-line-cap",t),o=ti(n,e+"stroke-line-join",t),a=mm(n,e+"stroke-line-dash",t),l=yt(n,e+"stroke-line-dash-offset",t),c=yt(n,e+"stroke-miter-limit",t),u=yt(n,e+"stroke-offset",t),h=new Qn;return function(f){if(r){const d=r(f);if(d===oh)return null;h.setColor(d)}if(i&&h.setWidth(i(f)),s){const d=s(f);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(f);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(f)),l&&h.setLineDashOffset(l(f)),c&&h.setMiterLimit(c(f)),u&&h.setOffset(u(f)),h}}function xb(n,e){const t="text-",i=ti(n,t+"value",e);if(!i)return null;const r=Po(n,t,e),s=Po(n,t+"background-",e),o=Fo(n,t,e),a=Fo(n,t+"background-",e),l=ti(n,t+"font",e),c=yt(n,t+"max-angle",e),u=yt(n,t+"offset-x",e),h=yt(n,t+"offset-y",e),f=ns(n,t+"overflow",e),d=ti(n,t+"placement",e),g=yt(n,t+"repeat",e),p=yl(n,t+"scale",e),m=ns(n,t+"rotate-with-view",e),y=yt(n,t+"rotation",e),_=ti(n,t+"align",e),v=ti(n,t+"justify",e),x=ti(n,t+"baseline",e),w=ns(n,t+"keep-upright",e),T=mm(n,t+"padding",e),R=_l(n,t+"declutter-mode"),C=new Ao({declutterMode:R});return function(S){if(C.setText(i(S)),r&&C.setFill(r(S)),s&&C.setBackgroundFill(s(S)),o&&C.setStroke(o(S)),a&&C.setBackgroundStroke(a(S)),l&&C.setFont(l(S)),c&&C.setMaxAngle(c(S)),u&&C.setOffsetX(u(S)),h&&C.setOffsetY(h(S)),f&&C.setOverflow(f(S)),d){const L=d(S);if(L!=="point"&&L!=="line")throw new Error("Expected point or line for text-placement");C.setPlacement(L)}if(g&&C.setRepeat(g(S)),p&&C.setScale(p(S)),m&&C.setRotateWithView(m(S)),y&&C.setRotation(y(S)),_){const L=_(S);if(L!=="left"&&L!=="center"&&L!=="right"&&L!=="end"&&L!=="start")throw new Error("Expected left, right, center, start, or end for text-align");C.setTextAlign(L)}if(v){const L=v(S);if(L!=="left"&&L!=="right"&&L!=="center")throw new Error("Expected left, right, or center for text-justify");C.setJustify(L)}if(x){const L=x(S);if(L!=="bottom"&&L!=="top"&&L!=="middle"&&L!=="alphabetic"&&L!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");C.setTextBaseline(L)}return T&&C.setPadding(T(S)),w&&C.setKeepUpright(w(S)),C}}function vb(n,e){return"icon-src"in n?wb(n,e):"shape-points"in n?Eb(n,e):"circle-radius"in n?bb(n,e):null}function wb(n,e){const t="icon-",i=t+"src",r=vm(n[i],i),s=ml(n,t+"anchor",e),o=yl(n,t+"scale",e),a=yt(n,t+"opacity",e),l=ml(n,t+"displacement",e),c=yt(n,t+"rotation",e),u=ns(n,t+"rotate-with-view",e),h=_m(n,t+"anchor-origin"),f=xm(n,t+"anchor-x-units"),d=xm(n,t+"anchor-y-units"),g=ei(n,t+"color");let p,m=null;g!==void 0&&(Array.isArray(g)&&g.length>0&&typeof g[0]=="string"?m=pl(n,t+"color",e):p=wm(g,t+"color"));const y=Rb(n,t+"cross-origin"),_=Sb(n,t+"offset"),v=_m(n,t+"offset-origin"),x=wh(n,t+"width"),w=wh(n,t+"height"),T=Tb(n,t+"size"),R=_l(n,t+"declutter-mode"),C={src:r,anchorOrigin:h,anchorXUnits:f,anchorYUnits:d,crossOrigin:y,offset:_,offsetOrigin:v,height:w,width:x,size:T,declutterMode:R};let S=null;return function(L){if(S)m&&S.setColor(m(L));else{const B=m?m(L):p;S=new hr(B!==void 0?Object.assign({},C,{color:B}):Object.assign({},C))}return a&&S.setOpacity(a(L)),l&&S.setDisplacement(l(L)),c&&S.setRotation(c(L)),u&&S.setRotateWithView(u(L)),o&&S.setScale(o(L)),s&&S.setAnchor(s(L)),S}}function Eb(n,e){const t="shape-",i=t+"points",r=t+"radius",s=Eh(n[i],i);if(!(r in n))throw new Error(`Expected a number for ${r}`);const o=yt(n,r,e),a=typeof n[r]=="number"?n[r]:5,l=t+"radius2",c=yt(n,l,e),u=typeof n[l]=="number"?n[l]:void 0,h=Po(n,t,e),f=Fo(n,t,e),d=yl(n,t+"scale",e),g=ml(n,t+"displacement",e),p=yt(n,t+"rotation",e),m=ns(n,t+"rotate-with-view",e),y=wh(n,t+"angle"),_=_l(n,t+"declutter-mode"),v=new gl({points:s,radius:a,radius2:u,angle:y,declutterMode:_});return function(x){return o&&v.setRadius(o(x)),c&&v.setRadius2(c(x)),h&&v.setFill(h(x)),f&&v.setStroke(f(x)),g&&v.setDisplacement(g(x)),p&&v.setRotation(p(x)),m&&v.setRotateWithView(m(x)),d&&v.setScale(d(x)),v}}function bb(n,e){const t="circle-",i=Po(n,t,e),r=Fo(n,t,e),s=yt(n,t+"radius",e),o=yl(n,t+"scale",e),a=ml(n,t+"displacement",e),l=yt(n,t+"rotation",e),c=ns(n,t+"rotate-with-view",e),u=_l(n,t+"declutter-mode"),h=new ts({radius:5,declutterMode:u});return function(f){return s&&h.setRadius(s(f)),i&&h.setFill(i(f)),r&&h.setStroke(r(f)),a&&h.setDisplacement(a(f)),l&&h.setRotation(l(f)),c&&h.setRotateWithView(c(f)),o&&h.setScale(o(f)),h}}function ei(n,e){if(!(e in n))return;const t=n[e];return t===void 0?void 0:t}function yt(n,e,t){const i=ei(n,e);if(i===void 0)return;const r=In(i,Re,t);return function(s){return Eh(r(s),e)}}function ti(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=In(i,jt,t);return function(s){return vm(r(s),e)}}function Cb(n,e,t){const i=ti(n,e+"pattern-src",t),r=ym(n,e+"pattern-offset",t),s=ym(n,e+"pattern-size",t),o=pl(n,e+"color",t);return function(a){return{src:i(a),offset:r&&r(a),size:s&&s(a),color:o&&o(a)}}}function ns(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=In(i,Mt,t);return function(s){const o=r(s);if(typeof o!="boolean")throw new Error(`Expected a boolean for ${e}`);return o}}function pl(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=In(i,hn,t);return function(s){return wm(r(s),e)}}function mm(n,e,t){const i=ei(n,e);if(i===void 0)return null;if(Array.isArray(i)&&(i.length===0||typeof i[0]!="string")){const s=i.map((o,a)=>{if(typeof o=="number")return()=>o;const l=In(o,Re,t);return function(c){return Eh(l(c),`${e}[${a}]`)}});return function(o){const a=new Array(s.length);for(let l=0;l<s.length;++l)a[l]=s[l](o);return a}}const r=In(i,lr,t);return function(s){return Oo(r(s),e)}}function ml(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=In(i,lr,t);return function(s){const o=Oo(r(s),e);if(o.length!==2)throw new Error(`Expected two numbers for ${e}`);return o}}function ym(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=In(i,lr,t);return function(s){return Em(r(s),e)}}function yl(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=In(i,lr|Re,t);return function(s){return Ib(r(s),e)}}function wh(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 Tb(n,e){const t=n[e];if(t!==void 0){if(typeof t=="number")return bt(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 Rb(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 _m(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 xm(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 Sb(n,e){const t=n[e];if(t!==void 0)return Oo(t,e)}function _l(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 Oo(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 vm(n,e){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);return n}function Eh(n,e){if(typeof n!="number")throw new Error(`Expected a number for ${e}`);return n}function wm(n,e){if(typeof n=="string")return n;const t=Oo(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 Em(n,e){const t=Oo(n,e);if(t.length!==2)throw new Error(`Expected an array of two numbers for ${e}`);return t}function Ib(n,e){return typeof n=="number"?n:Em(n,e)}const bm={RENDER_ORDER:"renderOrder"};class bh extends Zr{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(bm.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 Zp(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(bm.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?dm:e;const t=Mb(e);this.styleFunction_=e===null?void 0:gb(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}}function Mb(n){if(n===void 0)return dm;if(!n)return null;if(typeof n=="function"||n instanceof At)return n;if(!Array.isArray(n))return pm([n]);if(n.length===0)return[];const e=n.length,t=n[0];if(t instanceof At){const r=new Array(e);for(let s=0;s<e;++s){const o=n[s];if(!(o instanceof At))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 yb(r)}return pm(n)}class Cm extends an{constructor(e,t,i,r){super(e),this.inversePixelTransform=t,this.frameState=i,this.context=r}}class Ab extends Hs{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){pe()}calculateMatrices2D(e){const t=e.viewState,i=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;Sn(i,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),_p(r,i)}forEachFeatureAtCoordinate(e,t,i,r,s,o,a,l){let c;const u=t.viewState;function h(x,w,T,R){return s.call(o,w,x?T:null,R)}const f=u.projection,d=du(e.slice(),f),g=[[0,0]];if(f.canWrapX()&&r){const x=f.getExtent(),w=Se(x);g.push([-w,0],[w,0])}const p=t.layerStatesArray,m=p.length,y=[],_=[];for(let x=0;x<g.length;x++)for(let w=m-1;w>=0;--w){const T=p[w],R=T.layer;if(R.hasRenderer()&&ih(T,u)&&a.call(l,R)){const C=R.getRenderer(),S=R.getSource();if(C&&S){const L=S.getWrapX()?d:e,B=h.bind(null,T.managed);_[0]=L[0]+g[x][0],_[1]=L[1]+g[x][1],c=C.forEachFeatureAtCoordinate(_,t,i,B,y)}if(c)return c}}if(y.length===0)return;const v=1/y.length;return y.forEach((x,w)=>x.distanceSq+=w*v),y.sort((x,w)=>x.distanceSq-w.distanceSq),y.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,Js,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(e){pe()}scheduleExpireIconCache(e){Jt.canExpireCache()&&e.postRenderFunctions.push(Pb)}}function Pb(n,e){Jt.expire()}class Fb extends Ab{constructor(e){super(e),this.fontChangeListenerKey_=Te(ur,kr.PROPERTYCHANGE,e.redrawText,e),this.element_=vt?Wp():document.createElement("div");const t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=sl+" 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 Cm(e,void 0,t);i.dispatchEvent(r)}}disposeInternal(){We(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(Ht.PRECOMPOSE,e);const t=e.layerStatesArray.sort((c,u)=>c.zIndex-u.zIndex);t.some(c=>c.layer instanceof bh&&c.layer.getDeclutter())&&(e.declutter={});const r=e.viewState;this.children_.length=0;const s=[];let o=null;for(let c=0,u=t.length;c<u;++c){const h=t[c];e.layerIndex=c;const f=h.layer,d=f.getSourceState();if(!ih(h,r)||d!="ready"&&d!="undefined"){f.unrender();continue}const g=f.render(e,o);g&&(g!==o&&(this.children_.push(g),o=g),s.push(h))}this.declutter(e,s),jw(this.element_,this.children_);const l=this.getMap().getTargetElement();if(Ri(l)){const c=l.getContext("2d");for(const u of this.children_){const h=u.firstElementChild||u,f=u.style.backgroundColor;if(f&&(!Ri(h)||h.width>0)&&(c.fillStyle=f,c.fillRect(0,0,l.width,l.height)),Ri(h)&&h.width>0){c.save();const d=u.style.opacity||h.style.opacity;c.globalAlpha=d===""?1:Number(d);const g=h.style.transform;if(g)c.transform(...Mu(g));else{const p=parseFloat(h.style.width)/h.width,m=parseFloat(h.style.height)/h.height;c.transform(p,0,0,m,0,0)}c.drawImage(h,0,0),c.restore()}}}this.dispatchRenderEvent(Ht.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 Tm(n){if(n instanceof Zr){n.setMapInternal(null);return}n instanceof Mi&&n.getLayers().forEach(Tm)}function Rm(n,e){if(n instanceof Zr){n.setMapInternal(e);return}if(n instanceof Mi){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i)Rm(t[i],e)}}let is=class extends Rn{constructor(e){super(),e=e||{},this.on,this.once,this.un;const t=Ob(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:fv,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Gt(),this.pixelToCoordinateTransform_=Gt(),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 Yt:Uw()),this.interactions=t.interactions||(vt?new Yt:dE({onFocusOnly:!0})),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new jg(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(wt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(wt.VIEW,this.handleViewChanged_),this.addChangeListener(wt.SIZE,this.handleSizeChanged_),this.addChangeListener(wt.TARGET,this.handleTargetChanged_),this.setProperties(t.values);const i=this;e.view&&!(e.view instanceof un)&&e.view.then(function(r){i.setView(new un(r))}),this.controls.addEventListener(Nt.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(Nt.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(Nt.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(Nt.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(Nt.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(Nt.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){Rm(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_?.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,i){if(!this.frameState_||!this.renderer_)return;const r=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:Js,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 Mi?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:Js,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(wt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return Tu(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const t=this.frameState_;return t?lt(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(wt.LAYERGROUP)}setLayers(e){const t=this.getLayerGroup();if(e instanceof Yt){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=Kn(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){const t=this.frameState_;return t?lt(t.coordinateToPixelTransform,e.slice(0,2)):null}getPixelRatio(){return this.pixelRatio_}setPixelRatio(e){this.pixelRatio_!==e&&(this.pixelRatio_=e,this.render())}getRenderer(){return this.renderer_}getSize(){return this.get(wt.SIZE)}getView(){return this.get(wt.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 mv(this.frameState_,e,t,i,r)}handleBrowserEvent(e,t){t=t||e.type;const i=new _i(t,this,e);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(e){if(!this.frameState_)return;const t=e.originalEvent,i=t.type;if(i===ru.POINTERDOWN||i===de.WHEEL||i===de.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;const o=e?e.viewHints:void 0,a=o?o[Ke.ANIMATING]||o[Ke.INTERACTING]:!1;if(a){const l=Date.now()-e.time>8;r=l?0:8,s=l?0:2}t.getTilesLoading()<r&&(a&&t.reprioritize(),t.loadMoreTiles(r,s))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener(Ht.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Ht.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new zr(xi.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new zr(xi.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_(){if(this.mapBrowserEventHandler_){for(let i=0,r=this.targetChangeHandlerKeys_.length;i<r;++i)We(this.targetChangeHandlerKeys_[i]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(de.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(de.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!Ri(this.targetElement_)){this.resizeObserver_?.unobserve(this.targetElement_);const i=this.targetElement_.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.unobserve(i.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(Ri(t)||t.appendChild(this.viewport_),this.renderer_||(this.renderer_=new Fb(this)),!Ri(t)){this.mapBrowserEventHandler_=new gv(this,this.moveTolerance_);for(const r in nt)this.mapBrowserEventHandler_.addEventListener(nt[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(de.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(de.WHEEL,this.boundHandleBrowserEvent_,Gg?{passive:!1}:!1);let i;if(this.keyboardEventTarget_)i=this.keyboardEventTarget_;else{const r=t.getRootNode();i=r instanceof ShadowRoot?r.host:t}if(this.targetChangeHandlerKeys_=[Te(i,de.KEYDOWN,this.handleBrowserEvent,this),Te(i,de.KEYPRESS,this.handleBrowserEvent,this)],t instanceof HTMLElement){const r=t.getRootNode();r instanceof ShadowRoot&&this.resizeObserver_.observe(r.host),this.resizeObserver_?.observe(t)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(We(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(We(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=Te(e,kr.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Te(e,de.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(We),this.layerGroupPropertyListenerKeys_=null);const e=this.getLayerGroup();e&&(this.handleLayerAdd_(new Ii("addlayer",e)),this.layerGroupPropertyListenerKeys_=[Te(e,kr.PROPERTYCHANGE,this.render,this),Te(e,de.CHANGE,this.render,this),Te(e,"addlayer",this.handleLayerAdd_,this),Te(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){Tm(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&&Qp(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:Xa(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:_e(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;s.nextExtent=Xa(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_||!Ei(this.previousExtent_)&&!Bn(s.extent,this.previousExtent_))&&(this.dispatchEvent(new zr(xi.MOVESTART,this,r)),this.previousExtent_=jr(this.previousExtent_)),this.previousExtent_&&!s.viewHints[Ke.ANIMATING]&&!s.viewHints[Ke.INTERACTING]&&!Bn(s.extent,this.previousExtent_)&&(this.dispatchEvent(new zr(xi.MOVEEND,this,s)),Xg(s.extent,this.previousExtent_))),this.dispatchEvent(new zr(xi.POSTRENDER,this,s)),this.renderComplete_=(this.hasListener(xi.LOADSTART)||this.hasListener(xi.LOADEND)||this.hasListener(Ht.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 Ii("removelayer",t)),this.set(wt.LAYERGROUP,e)}setSize(e){this.set(wt.SIZE,e)}setTarget(e){this.set(wt.TARGET,e)}setView(e){if(!e||e instanceof un){this.set(wt.VIEW,e);return}this.set(wt.VIEW,new un);const t=this;e.then(function(i){t.setView(new un(i))})}updateSize(){const e=this.getTargetElement();let t;if(e){let r,s;if(Ri(e)){const o=e.getContext("2d").getTransform();r=e.width/o.a,s=e.height/o.d}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)],!Qp(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&tp("No map visible because the map container's width or height are 0."))}const i=this.getSize();t&&(!i||!yi(t,i))&&(this.updateViewportSize_(t),this.setSize(t))}updateViewportSize_(e){const t=this.getView();t&&t.setViewportSize(e)}};function Ob(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 Mi({layers:n.layers});t[wt.LAYERGROUP]=i,t[wt.TARGET]=n.target,t[wt.VIEW]=n.view instanceof un?n.view:new un;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new Yt(n.controls.slice()):(Oe(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 Yt(n.interactions.slice()):(Oe(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 Yt(n.overlays.slice()):(Oe(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new Yt,{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:t}}function Sm(n,e){return sd()?(D0(n,e),!0):!1}function Ch(){const n=new Set,e=s=>{n.delete(s)};return{on:s=>{n.add(s);const o=()=>e(s);return Sm(o),{off:o}},off:e,trigger:(...s)=>Promise.all(Array.from(n).map(o=>o(...s))),clear:()=>{n.clear()}}}const Im=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Lb=()=>{};function Th(...n){if(n.length!==1)return wa(...n);const e=n[0];return typeof e=="function"?_a(sx(()=>({get:e,set:Lb}))):kc(e)}function Mm(n,e=!1,t="Timeout"){return new Promise((i,r)=>{e?setTimeout(r,n,t):setTimeout(i,n)})}function Db(n,...e){return e.some(t=>t in n)}function Rh(n,e=!1){function t(h,{flush:f="sync",deep:d=!1,timeout:g,throwOnTimeout:p}={}){let m=null;const y=[new Promise(_=>{m=pi(n,v=>{h(v)!==e&&(m?m():zc(()=>m?.()),_(v))},{flush:f,deep:d,immediate:!0})})];return g!=null&&y.push(Mm(g,p).then(()=>fi(n)).finally(()=>m?.())),Promise.race(y)}function i(h,f){if(!tt(h))return t(v=>v===h,f);const{flush:d="sync",deep:g=!1,timeout:p,throwOnTimeout:m}=f??{};let y=null;const _=[new Promise(v=>{y=pi([n,h],([x,w])=>{e!==(x===w)&&(y?y():zc(()=>y?.()),v(x))},{flush:d,deep:g,immediate:!0})})];return p!=null&&_.push(Mm(p,m).then(()=>fi(n)).finally(()=>(y?.(),fi(n)))),Promise.race(_)}function r(h){return t(f=>!!f,h)}function s(h){return i(null,h)}function o(h){return i(void 0,h)}function a(h){return t(Number.isNaN,h)}function l(h,f){return t(d=>{const g=Array.from(d);return g.includes(h)||g.includes(fi(h))},f)}function c(h){return u(1,h)}function u(h=1,f){let d=-1;return t(()=>(d+=1,d>=h),f)}return Array.isArray(fi(n))?{toMatch:t,toContains:l,changed:c,changedTimes:u,get not(){return Rh(n,!e)}}:{toMatch:t,toBe:i,toBeTruthy:r,toBeNull:s,toBeNaN:a,toBeUndefined:o,changed:c,changedTimes:u,get not(){return Rh(n,!e)}}}function kb(n){return Rh(n)}function Nb(n,e,t={}){const{immediate:i=!0,immediateCallback:r=!1}=t,s=hi(!1);let o;function a(){o&&(clearTimeout(o),o=void 0)}function l(){s.value=!1,a()}function c(...u){r&&n(),a(),s.value=!0,o=setTimeout(()=>{s.value=!1,o=void 0,n(...u)},fi(e))}return i&&(s.value=!0,Im&&c()),Sm(l),{isPending:Dc(s),start:c,stop:l}}const Sh=Im?window:void 0,zb={json:"application/json",text:"text/plain"};function Am(n){return n&&Db(n,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch","updateDataOnError")}function Ih(n){return typeof Headers<"u"&&n instanceof Headers?Object.fromEntries(n.entries()):n}function Gb(n,...e){var t,i;const r=typeof AbortController=="function";let s={},o={immediate:!0,refetch:!1,timeout:0,updateDataOnError:!1};const a={method:"GET",type:"text",payload:void 0};e.length>0&&(Am(e[0])?o={...o,...e[0]}:s=e[0]),e.length>1&&Am(e[1])&&(o={...o,...e[1]});const{fetch:l=(t=Sh?.fetch)!==null&&t!==void 0?t:(i=globalThis)===null||i===void 0?void 0:i.fetch,initialData:c,timeout:u}=o,h=Ch(),f=Ch(),d=Ch(),g=hi(!1),p=hi(!1),m=hi(!1),y=hi(null),_=hi(null),v=hi(null),x=hi(c||null),w=Ki(()=>r&&p.value);let T,R;const C=X=>{r&&(T?.abort(X),T=new AbortController,T.signal.onabort=()=>m.value=!0,s={...s,signal:T.signal})},S=X=>{p.value=X,g.value=!X};u&&(R=Nb(C,u,{immediate:!1}));let L=0;const B=async(X=!1)=>{var z;C(),S(!0),v.value=null,y.value=null,m.value=!1,L+=1;const M=L,ne={method:a.method,headers:{}},le=fi(a.payload);if(le){var ge;const he=Ih(ne.headers),Ie=Object.getPrototypeOf(le);!a.payloadType&&le&&(Ie===Object.prototype||Array.isArray(Ie))&&!(le instanceof FormData)&&(a.payloadType="json"),a.payloadType&&(he["Content-Type"]=(ge=zb[a.payloadType])!==null&&ge!==void 0?ge:a.payloadType),ne.body=a.payloadType==="json"?JSON.stringify(le):le}let ze=!1;const G={url:fi(n),options:{...ne,...s},cancel:()=>{ze=!0}};if(o.beforeFetch&&Object.assign(G,await o.beforeFetch(G)),ze||!l)return S(!1),Promise.resolve(null);let xe=null;return R&&R.start(),l(G.url,{...ne,...G.options,headers:{...Ih(ne.headers),...Ih((z=G.options)===null||z===void 0?void 0:z.headers)}}).then(async he=>{if(_.value=he,y.value=he.status,xe=await he.clone()[a.type](),!he.ok)throw x.value=c||null,new Error(he.statusText);return o.afterFetch&&({data:xe}=await o.afterFetch({data:xe,response:he,context:G,execute:B})),x.value=xe,h.trigger(he),he}).catch(async he=>{let Ie=he.message||he.name;if(o.onFetchError&&({error:Ie,data:xe}=await o.onFetchError({data:xe,error:he,response:_.value,context:G,execute:B})),v.value=Ie,o.updateDataOnError&&(x.value=xe),f.trigger(he),X)throw he;return null}).finally(()=>{M===L&&S(!1),R&&R.stop(),d.trigger(null)})},K=Th(o.refetch);pi([K,Th(n)],([X])=>X&&B(),{deep:!0});const F={isFinished:Dc(g),isFetching:Dc(p),statusCode:y,response:_,error:v,data:x,canAbort:w,aborted:m,abort:C,execute:B,onFetchResponse:h.on,onFetchError:f.on,onFetchFinally:d.on,get:P("GET"),put:P("PUT"),post:P("POST"),delete:P("DELETE"),patch:P("PATCH"),head:P("HEAD"),options:P("OPTIONS"),json:W("json"),text:W("text"),blob:W("blob"),arrayBuffer:W("arrayBuffer"),formData:W("formData")};function P(X){return(z,M)=>{if(!p.value)return a.method=X,a.payload=z,a.payloadType=M,tt(a.payload)&&pi([K,Th(a.payload)],([ne])=>ne&&B(),{deep:!0}),{...F,then(ne,le){return oe().then(ne,le)}}}}function oe(){return new Promise((X,z)=>{kb(g).toBe(!0).then(()=>X(F)).catch(z)})}function W(X){return()=>{if(!p.value)return a.type=X,{...F,then(z,M){return oe().then(z,M)}}}}return o.immediate&&Promise.resolve().then(()=>B()),{...F,then(X,z){return oe().then(X,z)}}}class Lo extends eo{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(de.CHANGE)}release(){this.setState(J.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==J.EMPTY){if(this.state!==J.ERROR&&this.state>e)throw new Error("Tile load sequence violation");this.state=e,this.changed()}}load(){pe()}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:Qg(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()}}function Mh(n){return n instanceof Image||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof ImageBitmap?n:null}const jb=new Error("disposed"),Wb=[256,256];class Pm extends Lo{constructor(e){const t=J.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=Mh(this.data_);return e?[e.width,e.height]:Wb}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==J.IDLE&&this.state!==J.ERROR)return;this.state=J.LOADING,this.changed();const e=this;this.loader_().then(function(t){e.data_=t,e.state=J.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=J.ERROR,e.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(jb),this.controller_=null),super.disposeInternal()}}class Fm extends Lo{constructor(e,t,i,r,s,o){super(e,t,o),this.crossOrigin_=r?.crossOrigin,this.referrerPolicy_=r?.referrerPolicy,this.src_=i,this.key=i,this.image_,vt?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(e){this.image_=e,this.state=J.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}getReferrerPolicy(){return this.referrerPolicy_}handleImageError_(){this.state=J.ERROR,this.unlistenImage_(),this.image_=Vb(),this.changed()}handleImageLoad_(){if(vt)this.state=J.LOADED;else{const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=J.LOADED:this.state=J.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==J.ERROR&&(this.state=J.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.state==J.IDLE&&(this.state=J.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=tb(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 Vb(){const n=Ze(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}class Ah{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 rs(n,e,t,i,r){return r!==void 0?(r.minX=n,r.maxX=e,r.minY=t,r.maxY=i,r):new Ah(n,e,t,i)}let Ph;const ss=[];function Om(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 Fh(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-191.25)>2}function Xb(){if(Ph===void 0){const n=Ze(6,6,ss);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",Om(n,4,5,4,0),Om(n,4,5,0,5);const e=n.getImageData(0,0,3,3).data;Ph=Fh(e,0)||Fh(e,4)||Fh(e,8),uo(n),ss.push(n.canvas)}return Ph}function Oh(n,e,t,i){const r=so(t,e,n);let s=wu(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||Hi(l,r)){const c=wu(n,s,r)/s;isFinite(c)&&c>0&&(s/=c)}return s}function Ub(n,e,t,i){const r=zt(t);let s=Oh(n,e,r,i);return(!isFinite(s)||s<=0)&&$g(t,function(o){return s=Oh(n,e,o,i),isFinite(s)&&s>0}),s}function Lm(n,e,t,i,r,s,o,a,l,c,u,h,f,d){const g=Ze(Math.round(t*n),Math.round(t*e),ss);if(h||(g.imageSmoothingEnabled=!1),l.length===0)return g.canvas;g.scale(t,t);function p(w){return Math.round(w*t)/t}g.globalCompositeOperation="lighter";const m=Bt();l.forEach(function(w,T,R){Ug(m,w.extent)});let y;const _=t/i,v=(h?1:1+Math.pow(2,-24))/_;if(!f||l.length!==1||c!==0){if(y=Ze(Math.round(Se(m)*_),Math.round(ot(m)*_),ss),h||(y.imageSmoothingEnabled=!1),r&&d){const w=(r[0]-m[0])*_,T=-(r[3]-m[3])*_,R=Se(r)*_,C=ot(r)*_;y.rect(w,T,R,C),y.clip()}l.forEach(function(w,T,R){if(w.image.width>0&&w.image.height>0){if(w.clipExtent){y.save();const K=(w.clipExtent[0]-m[0])*_,F=-(w.clipExtent[3]-m[3])*_,P=Se(w.clipExtent)*_,oe=ot(w.clipExtent)*_;y.rect(h?K:Math.round(K),h?F:Math.round(F),h?P:Math.round(K+P)-Math.round(K),h?oe:Math.round(F+oe)-Math.round(F)),y.clip()}const C=(w.extent[0]-m[0])*_,S=-(w.extent[3]-m[3])*_,L=Se(w.extent)*_,B=ot(w.extent)*_;y.drawImage(w.image,c,c,w.image.width-2*c,w.image.height-2*c,h?C:Math.round(C),h?S:Math.round(S),h?L:Math.round(C+L)-Math.round(C),h?B:Math.round(S+B)-Math.round(S)),w.clipExtent&&y.restore()}})}const x=$n(o);return a.getTriangles().forEach(function(w,T,R){const C=w.source,S=w.target;let L=C[0][0],B=C[0][1],K=C[1][0],F=C[1][1],P=C[2][0],oe=C[2][1];const W=p((S[0][0]-x[0])/s),X=p(-(S[0][1]-x[1])/s),z=p((S[1][0]-x[0])/s),M=p(-(S[1][1]-x[1])/s),ne=p((S[2][0]-x[0])/s),le=p(-(S[2][1]-x[1])/s),ge=L,ze=B;L=0,B=0,K-=ge,F-=ze,P-=ge,oe-=ze;const G=[[K,F,0,0,z-W],[P,oe,0,0,ne-W],[0,0,K,F,M-X],[0,0,P,oe,le-X]],xe=_v(G);if(!xe)return;if(g.save(),g.beginPath(),Xb()||!h){g.moveTo(z,M);const Ie=4,Pe=W-z,ie=X-M;for(let k=0;k<Ie;k++)g.lineTo(z+p((k+1)*Pe/Ie),M+p(k*ie/(Ie-1))),k!=Ie-1&&g.lineTo(z+p((k+1)*Pe/Ie),M+p((k+1)*ie/(Ie-1)));g.lineTo(ne,le)}else g.moveTo(z,M),g.lineTo(W,X),g.lineTo(ne,le);g.clip(),g.transform(xe[0],xe[2],xe[1],xe[3],W,X),g.translate(m[0]-ge,m[3]-ze);let he;if(y)he=y.canvas,g.scale(v,-v);else{const Ie=l[0],Pe=Ie.extent;he=Ie.image,g.scale(Se(Pe)/he.width,-ot(Pe)/he.height)}g.drawImage(he,0,0),g.restore()}),y&&(uo(y),ss.push(y.canvas)),u&&(g.save(),g.globalCompositeOperation="source-over",g.strokeStyle="black",g.lineWidth=1,a.getTriangles().forEach(function(w,T,R){const C=w.target,S=(C[0][0]-x[0])/s,L=-(C[0][1]-x[1])/s,B=(C[1][0]-x[0])/s,K=-(C[1][1]-x[1])/s,F=(C[2][0]-x[0])/s,P=-(C[2][1]-x[1])/s;g.beginPath(),g.moveTo(B,K),g.lineTo(S,L),g.lineTo(F,P),g.closePath(),g.stroke()}),g.restore()),g.canvas}const Bb=10,Dm=.25;class km{constructor(e,t,i,r,s,o,a){this.sourceProj_=e,this.targetProj_=t;let l={};const c=a?rw(v=>lt(a,so(v,this.targetProj_,this.sourceProj_))):er(this.targetProj_,this.sourceProj_);this.transformInv_=function(v){const x=v[0]+"/"+v[1];return l[x]||(l[x]=c(v)),l[x]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&Se(r)>=Se(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Se(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Se(this.targetProj_.getExtent()):null;const u=$n(i),h=Ua(i),f=Va(i),d=Wa(i),g=this.transformInv_(u),p=this.transformInv_(h),m=this.transformInv_(f),y=this.transformInv_(d),_=Bb+(o?Math.max(0,Math.ceil(Math.log2(hu(i)/(o*o*256*256)))):0);if(this.addQuad_(u,h,f,d,g,p,m,y,_),this.wrapsXInSource_){let v=1/0;this.triangles_.forEach(function(x,w,T){v=Math.min(v,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])-v>this.sourceWorldWidth_/2){const w=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];w[0][0]-v>this.sourceWorldWidth_/2&&(w[0][0]-=this.sourceWorldWidth_),w[1][0]-v>this.sourceWorldWidth_/2&&(w[1][0]-=this.sourceWorldWidth_),w[2][0]-v>this.sourceWorldWidth_/2&&(w[2][0]-=this.sourceWorldWidth_);const T=Math.min(w[0][0],w[1][0],w[2][0]);Math.max(w[0][0],w[1][0],w[2][0])-T<this.sourceWorldWidth_/2&&(x.source=w)}})}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 u=ou([s,o,a,l]),h=this.sourceWorldWidth_?Se(u)/this.sourceWorldWidth_:null,f=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&h>.5&&h<1;let g=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const m=ou([e,t,i,r]);g=Se(m)/this.targetWorldWidth_>Dm||g}!d&&this.sourceProj_.isGlobal()&&h&&(g=h>Dm||g)}if(!g&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!it(u,this.maxSourceExtent_))return;let p=0;if(!g&&(!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)g=!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(!g){const m=[(e[0]+i[0])/2,(e[1]+i[1])/2],y=this.transformInv_(m);let _;d?_=(Gr(s[0],f)+Gr(a[0],f))/2-Gr(y[0],f):_=(s[0]+a[0])/2-y[0];const v=(s[1]+a[1])/2-y[1];g=_*_+v*v>this.errorThresholdSquared_}if(g){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){const m=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.transformInv_(m),_=[(r[0]+e[0])/2,(r[1]+e[1])/2],v=this.transformInv_(_);this.addQuad_(e,t,m,_,s,o,y,v,c-1),this.addQuad_(_,m,i,r,v,y,a,l,c-1)}else{const m=[(e[0]+t[0])/2,(e[1]+t[1])/2],y=this.transformInv_(m),_=[(i[0]+r[0])/2,(i[1]+r[1])/2],v=this.transformInv_(_);this.addQuad_(e,m,_,r,s,y,v,l,c-1),this.addQuad_(m,t,i,_,y,o,a,v,c-1)}return}}if(d){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=Bt();return this.triangles_.forEach(function(t,i,r){const s=t.source;no(e,s[0]),no(e,s[1]),no(e,s[2])}),e}getTriangles(){return this.triangles_}}const Nm=.5;class zm extends Lo{constructor(e,t,i,r,s,o,a,l,c,u,h,f){super(s,J.IDLE,f),this.renderEdges_=h!==void 0?h:!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 d=r.getTileCoordExtent(this.wrappedTileCoord_),g=this.targetTileGrid_.getExtent();let p=this.sourceTileGrid_.getExtent();const m=g?cn(d,g):d;if(hu(m)===0){this.state=J.EMPTY;return}const y=e.getExtent();y&&(p?p=cn(p,y):p=y);const _=r.getResolution(this.wrappedTileCoord_[0]),v=Ub(e,i,m,_);if(!isFinite(v)||v<=0){this.state=J.EMPTY;return}const x=u!==void 0?u:Nm;if(this.triangulation_=new km(e,i,m,p,v*x,_),this.triangulation_.getTriangles().length===0){this.state=J.EMPTY;return}this.sourceZ_=t.getZForResolution(v);let w=this.triangulation_.calculateSourceExtent();if(p&&(e.canWrapX()?(w[1]=Ye(w[1],p[1],p[3]),w[3]=Ye(w[3],p[1],p[3])):w=cn(w,p)),!hu(w))this.state=J.EMPTY;else{let T=0,R=0;e.canWrapX()&&(T=Se(y),R=Math.floor((w[0]-y[0])/T)),qg(w.slice(),e,!0).forEach(S=>{const L=t.getTileRangeForExtentAndZ(S,this.sourceZ_);for(let B=L.minX;B<=L.maxX;B++)for(let K=L.minY;K<=L.maxY;K++){const F=R*T;this.sourceTiles_.push({getTile:()=>c(this.sourceZ_,B,K,a),offset:F})}++R}),this.sourceTiles_.length===0&&(this.state=J.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(t=>{const i=t.tile;if(i&&i.getState()==J.LOADED){const r=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);r[0]+=t.offset,r[2]+=t.offset;const s=this.clipExtent_?.slice();s&&(s[0]+=t.offset,s[2]+=t.offset),e.push({extent:r,clipExtent:s,image:i.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=J.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_=Lm(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=J.LOADED}this.changed()}load(){for(const e of this.sourceTiles_)e.tile=e.getTile();if(this.state==J.IDLE){this.state=J.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{const i=t.getState();if(i==J.IDLE||i==J.LOADING){e++;const r=Te(t,de.CHANGE,s=>{const o=t.getState();(o==J.LOADED||o==J.ERROR||o==J.EMPTY)&&(We(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()==J.IDLE&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(We),this.sourcesListenerKeys_=null}release(){this.canvas_&&(uo(this.canvas_.getContext("2d")),ss.push(this.canvas_),this.canvas_=null),this.sourceTiles_.length=0,super.release()}}class Gm{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 Hs&&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 Oe(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 Oe(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){return this.entries_[e]?.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){Oe(!(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 xl(n,e,t,i){return i!==void 0?(i[0]=n,i[1]=e,i[2]=t,i):[n,e,t]}function $b(n,e,t){return n+"/"+e+"/"+t}function vl(n,e,t,i,r){return`${_e(n)},${e},${$b(t,i,r)}`}function Kb(n){return Yb(n[0],n[1],n[2])}function Yb(n,e,t){return(e<<n)+t}function Zb(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}class Lh{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(ol(),{get:(e,t)=>{if(typeof ol()[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)}pushMethodArgs_=(...e)=>(this.push_(e),this);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 qb=5;class Hb extends to{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=new Array,this.maxStaleKeys=qb}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return pe()}getData(e){return null}prepareFrame(e){return pe()}renderFrame(e,t){return pe()}forEachFeatureAtCoordinate(e,t,i,r,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){const t=e.target;(t.getState()===re.LOADED||t.getState()===re.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=re.LOADED&&t!=re.ERROR&&e.addEventListener(de.CHANGE,this.boundHandleImageChange_),t==re.IDLE&&(e.load(),t=e.getState()),t==re.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e&&e.getVisible()&&e.getSourceState()==="ready"&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const jm=[];let os=null;function Jb(){os=Ze(1,1,void 0,{willReadFrequently:!0})}class Dh extends Hb{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=Gt(),this.pixelTransform=Gt(),this.inversePixelTransform=Gt(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,i){os||Jb(),os.clearRect(0,0,1,1);let r;try{os.drawImage(e,t,i,1,1,0,0,1,1),r=os.getImageData(0,0,1,1).data}catch{return os=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&&yi(or(e.style.backgroundColor),or(i)))){const a=e.firstElementChild;Ri(a)&&(o=a.getContext("2d"))}if(o&&gw(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=vt?Wp():document.createElement("div"),s.className=r;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=Ze();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=$n(i),s=Ua(i),o=Va(i),a=Wa(i);lt(t.coordinateToPixelTransform,r),lt(t.coordinateToPixelTransform,s),lt(t.coordinateToPixelTransform,o),lt(t.coordinateToPixelTransform,a);const l=this.inversePixelTransform;lt(l,r),lt(l,s),lt(l,o),lt(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(Se(i)/r*o),l=Math.round(ot(i)/r*o);Sn(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/o,1/o,s,-a/2,-l/2),_p(this.inversePixelTransform,this.pixelTransform);const c=dw(this.pixelTransform);if(this.useContainer(t,c,this.getBackground(e)),!this.containerReused){const u=this.context.canvas;u.width!=a||u.height!=l?(u.width=a,u.height=l):this.context.clearRect(0,0,a,l),c!==u.style.transform&&(u.style.transform=c)}}dispatchRenderEvent_(e,t,i){const r=this.getLayer();if(r.hasListener(e)){const s=new Cm(e,this.inversePixelTransform,i,t);r.dispatchEvent(s)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_(Ht.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_(Ht.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new Lh),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(Ht.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(Ht.POSTRENDER,this.context,e))}getRenderTransform(e,t,i,r,s,o,a){const l=s/2,c=o/2,u=r/t,h=-u,f=-e[0]+a,d=-e[1];return Sn(this.tempTransform,l,c,u,h,-i,f,d)}disposeInternal(){delete this.frameState,super.disposeInternal()}}function kh(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 Qb(n,e,t){const i=n[t];return i?i.delete(e):!1}function Wm(n,e){const t=n.layerStatesArray[n.layerIndex];t.extent&&(e=cn(e,Yn(t.extent,n.viewState.projection)));const i=t.layer.getRenderSource();if(!i.getWrapX()){const r=i.getTileGridForProjection(n.viewState.projection).getExtent();r&&(e=cn(e,r))}return e}class Vm extends Dh{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=Bt(),this.tempTileRange_=new Ah(0,0,0,0),this.tempTileCoord_=xl(0,0,0);const i=t.cacheSize!==void 0?t.cacheSize:512;this.tileCache_=new Gm(i),this.sourceTileCache_=null,this.layerExtent=null,this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||(this.sourceTileCache_=new Gm(512)),this.sourceTileCache_}getOrCreateTile(e,t,i,r){const s=this.tileCache_,a=this.getLayer().getSource(),l=vl(a,a.getKey(),e,t,i);let c;if(s.containsKey(l))c=s.get(l);else{const u=r.viewState.projection,h=a.getProjection();if(c=a.getTile(e,t,i,r.pixelRatio,u,!h||Et(h,u)?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=lt(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!Hi(s,r))return null;const o=t.viewState,a=i.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(t.pixelRatio);for(let u=l.getZForResolution(o.resolution);u>=l.getMinZoom();--u){const h=l.getTileCoordForCoordAndZ(r,u),f=this.getTile(u,h[1],h[2],t);if(!f||f.getState()!==J.LOADED)continue;const d=l.getOrigin(u),g=bt(l.getTileSize(u)),p=l.getResolution(u);let m;if(f instanceof Fm||f instanceof zm)m=f.getImage();else if(f instanceof Pm){if(m=Mh(f.getData()),!m)continue}else continue;const y=Math.floor(c*((r[0]-d[0])/p-h[1]*g[0])),_=Math.floor(c*((d[1]-r[1])/p-h[2]*g[1])),v=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(m,y+v,_+v)}return null}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;const t=this.getLayer().getSource();if(!t)return!1;const i=t.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==i&&(this.renderedSourceRevision_=i,this.renderedSourceKey_===t.getKey()&&(this.tileCache_.clear(),this.sourceTileCache_?.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),u=_e(l);u in e.wantedTiles||(e.wantedTiles[u]={});const h=e.wantedTiles[u],f=a.getMapInternal(),d=Math.max(i-s,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),f?f.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection)),g=o.rotation,p=g?Kg(o.center,o.resolution,g,e.size):void 0;for(let m=i;m>=d;--m){const y=c.getTileRangeForExtentAndZ(t,m,this.tempTileRange_),_=c.getResolution(m);for(let v=y.minX;v<=y.maxX;++v)for(let x=y.minY;x<=y.maxY;++x){if(g&&!c.tileCoordIntersectsViewport([m,v,x],p))continue;const w=this.getTile(m,v,x,e);if(!w||!kh(r,w,m))continue;const R=w.getKey();if(h[R]=!0,w.getState()===J.IDLE&&!e.tileQueue.isKeyQueued(R)){const C=xl(m,v,x,this.tempTileCoord_);e.tileQueue.enqueue([w,u,c.getTileCoordCenter(C),_])}}}}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=vl(this.getLayer().getSource(),a[l],r,s,o);if(i.containsKey(c)){const u=i.peek(c);if(u.getState()===J.LOADED)return u.endTransition(_e(this)),kh(t,u,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 u=s.minX;u<=s.maxX;++u)for(let h=s.minY;h<=s.maxY;++h){const f=vl(l,c,i,u,h);let d=!1;if(a.containsKey(f)){const g=a.peek(f);g.getState()===J.LOADED&&(kh(r,g,i),d=!0)}d||(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(),u=c.getSource(),h=u.getTileGridForProjection(s),f=h.getZForResolution(o,u.zDirection),d=h.getResolution(f),g=u.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==g&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=g):this.renderedSourceKey_=g;let p=e.extent;const m=u.getTilePixelRatio(l);this.prepareContainer(e,t);const y=this.context.canvas.width,_=this.context.canvas.height;this.layerExtent=i.extent?Yn(i.extent,s):null,this.layerExtent&&(p=cn(p,this.layerExtent));const v=d*y/2/m,x=d*_/2/m,w=[a[0]-v,a[1]-x,a[0]+v,a[1]+x],T={};this.renderedTiles.length=0;const R=c.getPreload();if(e.nextExtent&&this.enqueueTilesForNextExtent()){const X=h.getZForResolution(r.nextResolution,u.zDirection),z=Wm(e,e.nextExtent);this.enqueueTiles(e,z,X,T,R)}const C=Wm(e,p);if(this.enqueueTiles(e,C,f,T,0),R>0&&setTimeout(()=>{this.enqueueTiles(e,C,f-1,T,R-1)},0),!(f in T))return this.container;const S=_e(this),L=e.time;for(const X of T[f]){const z=X.getState();if(z===J.EMPTY)continue;const M=X.tileCoord;if(z===J.LOADED&&X.getAlpha(S,L)===1){X.endTransition(S);continue}if(z!==J.ERROR&&(this.renderComplete=!1),this.findStaleTile_(M,T)){Qb(T,X,f),e.animate=!0;continue}if(this.findAltTiles_(h,M,f+1,T))continue;const ge=h.getMinZoom();for(let ze=f-1;ze>=ge&&!this.findAltTiles_(h,M,ze,T);--ze);}const B=d/o*l/m,K=this.getRenderContext(e);Sn(this.tempTransform,y/2,_/2,B,B,0,-y/2,-_/2),this.layerExtent&&this.clipUnrotated(K,e,this.layerExtent),u.getInterpolate()||(K.imageSmoothingEnabled=!1),this.preRender(K,e);const F=Object.keys(T).map(Number);F.sort(Cn);let P;const oe=[],W=[];for(let X=F.length-1;X>=0;--X){const z=F[X],M=u.getTilePixelSize(z,l,s),le=h.getResolution(z)/d,ge=M[0]*le*B,ze=M[1]*le*B,G=h.getTileCoordForCoordAndZ($n(w),z),xe=h.getTileCoordExtent(G),he=lt(this.tempTransform,[m*(xe[0]-w[0])/d,m*(w[3]-xe[3])/d]),Ie=m*u.getGutterForProjection(s);for(const Pe of T[z]){if(Pe.getState()!==J.LOADED)continue;const ie=Pe.tileCoord,k=G[1]-ie[1],He=Math.round(he[0]-(k-1)*ge),E=G[2]-ie[2],b=Math.round(he[1]-(E-1)*ze),I=Math.round(he[0]-k*ge),D=Math.round(he[1]-E*ze),A=He-I,O=b-D,V=F.length===1;let U=!1;P=[I,D,I+A,D,I+A,D+O,I,D+O];for(let $=0,N=oe.length;$<N;++$)if(!V&&z<W[$]){const ee=oe[$];it([I,D,I+A,D+O],[ee[0],ee[3],ee[4],ee[7]])&&(U||(K.save(),U=!0),K.beginPath(),K.moveTo(P[0],P[1]),K.lineTo(P[2],P[3]),K.lineTo(P[4],P[5]),K.lineTo(P[6],P[7]),K.moveTo(ee[6],ee[7]),K.lineTo(ee[4],ee[5]),K.lineTo(ee[2],ee[3]),K.lineTo(ee[0],ee[1]),K.clip())}oe.push(P),W.push(z),this.drawTile(Pe,e,I,D,A,O,Ie,V),U&&K.restore(),this.renderedTiles.unshift(Pe),this.updateUsedTiles(e.usedTiles,u,Pe)}}if(this.renderedResolution=d,this.extentChanged=!this.renderedExtent_||!Bn(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.postRender(this.context,e),this.layerExtent&&K.restore(),K.imageSmoothingEnabled=!0,this.renderComplete){const X=(z,M)=>{const ne=_e(u),le=M.wantedTiles[ne],ge=le?Object.keys(le).length:0;this.updateCacheSize(ge),this.tileCache_.expireCache(),this.sourceTileCache_?.expireCache()};e.postRenderFunctions.push(X)}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 Pm){if(c=Mh(e.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(e);if(!c)return;const u=this.getRenderContext(t),h=_e(this),f=t.layerStatesArray[t.layerIndex],d=f.opacity*(l?e.getAlpha(h,t.time):1),g=d!==u.globalAlpha;g&&(u.save(),u.globalAlpha=d),u.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,r,s,o),g&&u.restore(),d!==f.opacity?t.animate=!0:l&&e.endTransition(h)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,t,i){const r=_e(t);r in e||(e[r]={}),e[r][i.getKey()]=!0}}const Pi={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class eC extends Zr{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(Pi.PRELOAD)}setPreload(e){this.set(Pi.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Pi.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Pi.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}class Nh extends eC{constructor(e){super(e)}createRenderer(){return new Vm(this,{cacheSize:this.getCacheSize()})}}const as=[0,0,0],Fi=5;class wl{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,Oe(lv(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,Oe(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_=$n(i)),Oe(!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,Oe(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:Uu,Oe(!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 Ah(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=rs(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]}getOrigins(){return this.origins_}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 rs(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 rs(s,o,s,o,i);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,t-r),c=Math.floor(s*l),u=Math.floor(o*l);if(t<r)return rs(c,c,u,u,i);const h=Math.floor(l*(s+1))-1,f=Math.floor(l*(o+1))-1;return rs(c,h,u,f,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,as);const r=as[1],s=as[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,as);const o=as[1],a=as[2];return rs(r,o,s,a,i)}getTileCoordCenter(e){const t=this.getOrigin(e[0]),i=this.getResolution(e[0]),r=bt(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=bt(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 Un(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=bt(this.getTileSize(o),this.tmpSize_);let u=a*(e-l[0])/i/c[0],h=a*(l[1]-t)/i/c[1];return r?(u=wi(u,Fi)-1,h=wi(h,Fi)-1):(u=ja(u,Fi),h=ja(h,Fi)),xl(o,u,h,s)}getTileCoordForXYAndZ_(e,t,i,r,s){const o=this.getOrigin(i),a=this.getResolution(i),l=bt(this.getTileSize(i),this.tmpSize_);let c=(e-o[0])/a/l[0],u=(o[1]-t)/a/l[1];return r?(c=wi(c,Fi)-1,u=wi(u,Fi)-1):(c=ja(c,Fi),u=ja(u,Fi)),xl(i,c,u,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=Da(this.resolutions_,e,t||0);return Ye(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return Ap(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 zh(n){let e=n.getDefaultTileGrid();return e||(e=iC(n),n.setDefaultTileGrid(e)),e}function tC(n,e,t){const i=e[0],r=n.getTileCoordCenter(e),s=Do(t);if(!Hi(s,r)){const o=Se(s),a=Math.ceil((s[0]-r[0])/o);return r[0]+=o*a,n.getTileCoordForCoordAndZ(r,i)}return e}function nC(n,e,t,i){i=i!==void 0?i:"top-left";const r=Xm(n,e,t);return new wl({extent:n,origin:Ev(n,i),resolutions:r,tileSize:t})}function El(n){const e=n||{},t=e.extent||Le("EPSG:3857").getExtent(),i={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Xm(t,e.maxZoom,e.tileSize,e.maxResolution)};return new wl(i)}function Xm(n,e,t,i){e=e!==void 0?e:Np,t=bt(t!==void 0?t:Uu);const r=ot(n),s=Se(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 iC(n,e,t,i){const r=Do(n);return nC(r,e,t,i)}function Do(n){n=Le(n);let e=n.getExtent();if(!e){const t=180*bi.degrees/n.getMetersPerUnit();e=Un(-t,-t,t,t)}return e}const rC=/\{z\}/g,sC=/\{x\}/g,oC=/\{y\}/g,aC=/\{-y\}/g;function lC(n,e,t,i,r){return n.replace(rC,e.toString()).replace(sC,t.toString()).replace(oC,i.toString()).replace(aC,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 cC(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 uC(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 lC(n,o,t[1],t[2],s)})}function Um(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=uC(n[r],e);return hC(i)}function hC(n){return n.length===1?n[0]:(function(e,t,i){if(!e)return;const r=Kb(e),s=Gr(r,n.length);return n[s](e,t,i)})}class ls extends Rn{constructor(e){super(),this.projection=Le(e.projection),this.attributions_=Bm(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_=Bm(e),this.changed()}setState(e){this.state_=e,this.changed()}}function Bm(n){return n?typeof n=="function"?n:(Array.isArray(n)||(n=[n]),e=>n):null}class $m extends ls{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&&bt(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),t),this.tmpSize=[0,0],this.key_=e.key||_e(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 pe()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:zh(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=this.getTilePixelRatio(t),o=bt(r.getTileSize(e),this.tmpSize);return s==1?o:ME(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=tC(r,e,i)),Zb(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class fC extends an{constructor(e,t){super(e),this.tile=t}}const Gh={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class bl extends $m{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=_e(t),r=t.getState();let s;r==J.LOADING?(this.tileLoadingKeys_[i]=!0,s=Gh.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==J.ERROR?Gh.TILELOADERROR:r==J.LOADED?Gh.TILELOADEND:void 0),s!=null&&this.dispatchEvent(new fC(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=cC(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;const t=e.join(`
7
- `);this.generateTileUrlFunction_?this.setTileUrlFunction(Um(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,i){}}class Km 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:dC,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.referrerPolicy=e.referrerPolicy,this.tileClass=e.tileClass!==void 0?e.tileClass:Fm,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!Et(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||Et(t,e)))return this.tileGrid;const i=_e(e);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=zh(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,u=new this.tileClass(a,c!==void 0?J.IDLE:J.EMPTY,c!==void 0?c:"",{crossOrigin:this.crossOrigin,referrerPolicy:this.referrerPolicy},this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(de.CHANGE,this.handleTileChange.bind(this)),u}getTile(e,t,i,r,s,o){const a=this.getProjection();if(!a||!s||Et(a,s))return this.getTileInternal(e,t,i,r,a||s);const l=[e,t,i],c=this.getKey(),u=this.getTileGridForProjection(a),h=this.getTileGridForProjection(s),f=this.getTileCoordForTileUrlFunction(l,s),d=new zm(a,u,s,h,l,f,this.getTilePixelRatio(r),this.getGutter(),(g,p,m,y)=>this.getTileInternal(g,p,m,y,a,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=c,d}getTileInternal(e,t,i,r,s,o){const a=this.getKey(),l=vl(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?.set(l,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){const i=Le(e);if(i){const r=_e(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}}function dC(n,e){if(vt){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");const s={mode:i,credentials:r,referrerPolicy:n.getReferrerPolicy()};fetch(e,s).then(o=>{if(!o.ok)throw new Error(`HTTP ${o.status}`);return o.blob()}).then(o=>createImageBitmap(o)).then(o=>{const a=n.getImage();a.width=o.width,a.height=o.height,a.getContext("2d").drawImage(o,0,0),o.close?.(),a.dispatchEvent(new Event("load"))}).catch(()=>{n.getImage().dispatchEvent(new Event("error"))});return}n.getImage().src=e}class gC extends Km{constructor(e){e=e||{};const t=e.projection!==void 0?e.projection:"EPSG:3857",i=e.tileGrid!==void 0?e.tileGrid:El({extent:Do(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,referrerPolicy:e.referrerPolicy,interpolate:e.interpolate,projection:t,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const pC='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class mC extends gC{constructor(e){e=e||{};let t;e.attributions!==void 0?t=e.attributions:t=[pC];const i=e.url!==void 0?e.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:t,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin!==void 0?e.crossOrigin:"anonymous",referrerPolicy:e.referrerPolicy||"origin-when-cross-origin",interpolate:e.interpolate,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:i,wrapX:e.wrapX,zDirection:e.zDirection})}}var yC=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],_C=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],xC={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},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"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"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"}},layout:yC,layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"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","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:_C,paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const vC=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function wC(n,e){const t={};for(const i in n)i!=="ref"&&(t[i]=n[i]);return vC.forEach(i=>{i in e&&(t[i]=e[i])}),t}function Ym(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]=wC(n[t],e[n[t].ref]));return n}var Pn=class extends Error{constructor(n,e){super(e),this.message=e,this.key=n}},EC=class e0{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[i,r]of t)this.bindings[i]=r}concat(e){return new e0(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 Cl={kind:"null"},H={kind:"number"},ye={kind:"string"},be={kind:"boolean"},Fn={kind:"color"},Tl={kind:"projectionDefinition"},fr={kind:"object"},we={kind:"value"},bC={kind:"error"},Rl={kind:"collator"},Sl={kind:"formatted"},Il={kind:"padding"},ko={kind:"colorArray"},Ml={kind:"numberArray"},No={kind:"resolvedImage"},Al={kind:"variableAnchorOffsetCollection"};function Pt(n,e){return{kind:"array",itemType:n,N:e}}function qe(n){if(n.kind==="array"){const e=qe(n.itemType);return typeof n.N=="number"?`array<${e}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${e}>`}else return n.kind}const CC=[Cl,H,ye,be,Fn,Tl,Sl,fr,Pt(we),Il,Ml,ko,No,Al];function zo(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!zo(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 CC)if(!zo(t,e))return null}}return`Expected ${qe(n)} but found ${qe(e)} instead.`}function jh(n,e){return e.some(t=>t.kind===n.kind)}function dr(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 Oi(n,e){return n.kind==="array"&&e.kind==="array"?n.itemType.kind===e.itemType.kind&&typeof n.N=="number":n.kind===e.kind}const Zm=.96422,qm=1,Hm=.82521,Jm=4/29,cs=6/29,Qm=3*cs*cs,TC=cs*cs*cs,RC=Math.PI/180,SC=180/Math.PI;function ey(n){return n=n%360,n<0&&(n+=360),n}function ty([n,e,t,i]){n=Wh(n),e=Wh(e),t=Wh(t);let r,s;const o=Vh((.2225045*n+.7168786*e+.0606169*t)/qm);n===e&&e===t?r=s=o:(r=Vh((.4360747*n+.3850649*e+.1430804*t)/Zm),s=Vh((.0139322*n+.0971045*e+.7141733*t)/Hm));const a=116*o-16;return[a<0?0:a,500*(r-o),200*(o-s),i]}function Wh(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Vh(n){return n>TC?Math.pow(n,.3333333333333333):n/Qm+Jm}function ny([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=qm*Uh(r),s=Zm*Uh(s),o=Hm*Uh(o),[Xh(3.1338561*s-1.6168667*r-.4906146*o),Xh(-.9787684*s+1.9161415*r+.033454*o),Xh(.0719453*s-.2289914*r+1.4052427*o),i]}function Xh(n){return n=n<=.00304?12.92*n:1.055*Math.pow(n,.4166666666666667)-.055,n<0?0:n>1?1:n}function Uh(n){return n>cs?n*n*n:Qm*(n-Jm)}function IC(n){const[e,t,i,r]=ty(n),s=Math.sqrt(t*t+i*i);return[Math.round(s*1e4)?ey(Math.atan2(i,t)*SC):NaN,s,e,r]}function MC([n,e,t,i]){return n=isNaN(n)?0:n*RC,ny([t,Math.cos(n)*e,Math.sin(n)*e,i])}function AC([n,e,t,i]){n=ey(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 PC=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function iy(n,e){return PC(n,e)?n[e]:void 0}function FC(n){if(n=n.toLowerCase().trim(),n==="transparent")return[0,0,0,0];const e=iy(OC,n);if(e){const[i,r,s]=e;return[i/255,r/255,s/255,1]}if(n.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(n)){const i=n.length<6?1:2;let r=1;return[Pl(n.slice(r,r+=i)),Pl(n.slice(r,r+=i)),Pl(n.slice(r,r+=i)),Pl(n.slice(r,r+i)||"ff")]}if(n.startsWith("rgb")){const i=n.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){const[r,s,o,a,l,c,u,h,f,d,g,p]=i,m=[a||" ",u||" ",d].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){const y=[o,c,f].join(""),_=y==="%%%"?100:y===""?255:0;if(_){const v=[us(+s/_,0,1),us(+l/_,0,1),us(+h/_,0,1),g?ry(+g,p):1];if(sy(v))return v}}return}}const t=n.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){const[i,r,s,o,a,l,c,u,h]=t,f=[s||" ",a||" ",c].join("");if(f===" "||f===" /"||f===",,"||f===",,,"){const d=[+r,us(+o,0,100),us(+l,0,100),u?ry(+u,h):1];if(sy(d))return AC(d)}}}function Pl(n){return parseInt(n.padEnd(2,n),16)/255}function ry(n,e){return us(e?n/100:n,0,1)}function us(n,e,t){return Math.min(Math.max(e,n),t)}function sy(n){return!n.some(Number.isNaN)}const OC={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 gr(n,e,t){return n+t*(e-n)}function Go(n,e,t){return n.map((i,r)=>gr(i,e[r],t))}var Qe=(pt=class{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 pt)return e;if(typeof e!="string")return;const t=FC(e);if(t)return new pt(...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",IC(this.rgb))}get lab(){return this.overwriteGetter("lab",ty(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]=Go(e.rgb,t.rgb,i);return new pt(s,o,a,l,!1)}case"hcl":{const[s,o,a,l]=e.hcl,[c,u,h,f]=t.hcl;let d,g;if(!isNaN(s)&&!isNaN(c)){let v=c-s;c>s&&v>180?v-=360:c<s&&s-c>180&&(v+=360),d=s+i*v}else isNaN(s)?isNaN(c)?d=NaN:(d=c,(a===1||a===0)&&(g=u)):(d=s,(h===1||h===0)&&(g=o));const[p,m,y,_]=MC([d,g??gr(o,u,i),gr(a,h,i),gr(l,f,i)]);return new pt(p,m,y,_,!1)}case"lab":{const[s,o,a,l]=ny(Go(e.lab,t.lab,i));return new pt(s,o,a,l,!1)}}}},pt.black=new pt(0,0,0,1),pt.white=new pt(1,1,1,1),pt.transparent=new pt(0,0,0,0),pt.red=new pt(1,0,0,1),pt),Bh=class{constructor(n,e,t){n?this.sensitivity=e?"variant":"case":this.sensitivity=e?"accent":"base",this.locale=t,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(n,e){return this.collator.compare(n,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};const LC=["bottom","center","top"];var $h=class{constructor(n,e,t,i,r,s){this.text=n,this.image=e,this.scale=t,this.fontStack=i,this.textColor=r,this.verticalAlign=s}},jo=class pc{constructor(e){this.sections=e}static fromString(e){return new pc([new $h(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 pc?e:pc.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},hs=class na{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof na)return e;if(typeof e=="number")return new na([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 na(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){return new na(Go(e.values,t.values,i))}},fs=class ia{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ia)return e;if(typeof e=="number")return new ia([e]);if(Array.isArray(e)){for(const t of e)if(typeof t!="number")return;return new ia(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){return new ia(Go(e.values,t.values,i))}},Li=class ra{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ra)return e;if(typeof e=="string"){const i=Qe.parse(e);return i?new ra([i]):void 0}if(!Array.isArray(e))return;const t=[];for(const i of e){if(typeof i!="string")return;const r=Qe.parse(i);if(!r)return;t.push(r)}return new ra(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(Qe.interpolate(e.values[o],t.values[o],i,r));return new ra(s)}},et=class extends Error{constructor(n){super(n),this.name="RuntimeError"}toJSON(){return this.message}};const DC=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);var ds=class mc{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof mc)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"||!DC.has(i)||!Array.isArray(r)||r.length!==2||typeof r[0]!="number"||typeof r[1]!="number")return}return new mc(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 et(`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 et(`Cannot interpolate values containing mismatched anchors. from[${a}]: ${r[a]}, to[${a}]: ${s[a]}`);o.push(r[a]);const[l,c]=r[a+1],[u,h]=s[a+1];o.push([gr(l,u,i),gr(c,h,i)])}return new mc(o)}},gs=class t0{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new t0({name:e,available:!1}):null}},Wo=class Ss{constructor(e,t,i){this.from=e,this.to=t,this.transition=i}static interpolate(e,t,i){return new Ss(e,t,i)}static parse(e){if(e instanceof Ss)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new Ss(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new Ss(e.from,e.to,e.transition);if(typeof e=="string")return new Ss(e,e,1)}};function oy(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 Vo(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof Wo||n instanceof Qe||n instanceof Bh||n instanceof jo||n instanceof hs||n instanceof fs||n instanceof Li||n instanceof ds||n instanceof gs)return!0;if(Array.isArray(n)){for(const e of n)if(!Vo(e))return!1;return!0}else if(typeof n=="object"){for(const e in n)if(!Vo(n[e]))return!1;return!0}else return!1}function ct(n){if(n===null)return Cl;if(typeof n=="string")return ye;if(typeof n=="boolean")return be;if(typeof n=="number")return H;if(n instanceof Qe)return Fn;if(n instanceof Wo)return Tl;if(n instanceof Bh)return Rl;if(n instanceof jo)return Sl;if(n instanceof hs)return Il;if(n instanceof fs)return Ml;if(n instanceof Li)return ko;if(n instanceof ds)return Al;if(n instanceof gs)return No;if(Array.isArray(n)){const e=n.length;let t;for(const i of n){const r=ct(i);if(!t)t=r;else{if(t===r)continue;t=we;break}}return Pt(t||we,e)}else return fr}function Xo(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof Qe||n instanceof Wo||n instanceof jo||n instanceof hs||n instanceof fs||n instanceof Li||n instanceof ds||n instanceof gs?n.toString():JSON.stringify(n)}var Fl=class n0{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(!Vo(e[1]))return t.error("invalid value");const i=e[1];let r=ct(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 n0(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};const Ol={string:ye,number:H,boolean:be,object:fr};var ni=class i0{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 Ol)||c==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=Ol[c],i++}else a=we;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=Pt(a,l)}else{if(!Ol[s])throw new Error(`Types doesn't contain name = ${s}`);r=Ol[s]}const o=[];for(;i<e.length;i++){const a=t.parse(e[i],i,we);if(!a)return null;o.push(a)}return new i0(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const i=this.args[t].evaluate(e);if(zo(this.type,ct(i))){if(t===this.args.length-1)throw new et(`Expected value to be of type ${qe(this.type)}, but found ${qe(ct(i))} instead.`)}else return i}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};const ay={"to-boolean":be,"to-color":Fn,"to-number":H,"to-string":ye};var ps=class r0{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(!ay[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=ay[i],s=[];for(let o=1;o<e.length;o++){const a=t.parse(e[o],o,we);if(!a)return null;s.push(a)}return new r0(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 Qe)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=oy(t[0],t[1],t[2],t[3]),!i))return new Qe(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new et(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=hs.parse(t);if(r)return r}throw new et(`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=fs.parse(t);if(r)return r}throw new et(`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=Li.parse(t);if(r)return r}throw new et(`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=ds.parse(t);if(r)return r}throw new et(`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 et(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return jo.fromString(Xo(this.args[0].evaluate(e)));case"resolvedImage":return gs.fromString(Xo(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return Xo(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};const kC=["Unknown","Point","LineString","Polygon"];var ly=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"?kC[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(n){let e=this._parseColorCache.get(n);return e||(e=Qe.parse(n),this._parseColorCache.set(n,e)),e}},cy=class s0{constructor(e,t,i=[],r,s=new EC,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 ni(s,[r]):o==="coerce"?new ps(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 Fl)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){const a=new ly;try{o=new Fl(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 s0(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 Pn(i,e))}checkSubtype(e,t){const i=zo(e,t);return i&&this.error(i),i}},uy=class o0{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 o0(i,r):null}outputDefined(){return this.result.outputDefined()}},hy=class a0{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 a0(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}},NC=class l0{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,H),r=t.parse(e[2],2,Pt(t.expectedType||we));if(!i||!r)return null;const s=r.type;return new l0(s.itemType,i,r)}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new et(`Array index out of bounds: ${t} < 0.`);if(t>=i.length)throw new et(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t!==Math.floor(t))throw new et(`Array index must be an integer, but found ${t} instead.`);return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},zC=class c0{constructor(e,t){this.type=be,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,we),r=t.parse(e[2],2,we);return!i||!r?null:jh(i.type,[be,ye,H,Cl,we])?new c0(i,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${qe(i.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!dr(t,["boolean","string","number","null"]))throw new et(`Expected first argument to be of type boolean, string, number or null, but found ${qe(ct(t))} instead.`);if(!dr(i,["string","array"]))throw new et(`Expected second argument to be of type array or string, but found ${qe(ct(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},GC=class Yf{constructor(e,t,i){this.type=H,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,we),r=t.parse(e[2],2,we);if(!i||!r)return null;if(!jh(i.type,[be,ye,H,Cl,we]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${qe(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,H);return s?new Yf(i,r,s):null}else return new Yf(i,r)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!dr(t,["boolean","string","number","null"]))throw new et(`Expected first argument to be of type boolean, string, number or null, but found ${qe(ct(t))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),dr(i,["string"])){const s=i.indexOf(t,r);return s===-1?-1:[...i.slice(0,s)].length}else{if(dr(i,["array"]))return i.indexOf(t,r);throw new et(`Expected second argument to be of type array or string, but found ${qe(ct(i))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},jC=class u0{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 u=e[c];const h=e[c+1];Array.isArray(u)||(u=[u]);const f=t.concat(c);if(u.length===0)return f.error("Expected at least one branch label.");for(const g of u){if(typeof g!="number"&&typeof g!="string")return f.error("Branch labels must be numbers or strings.");if(typeof g=="number"&&Math.abs(g)>Number.MAX_SAFE_INTEGER)return f.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof g=="number"&&Math.floor(g)!==g)return f.error("Numeric branch labels must be integer values.");if(!i)i=ct(g);else if(f.checkSubtype(i,ct(g)))return null;if(typeof s[String(g)]<"u")return f.error("Branch labels must be unique.");s[String(g)]=o.length}const d=t.parse(h,c,r);if(!d)return null;r=r||d.type,o.push(d)}const a=t.parse(e[1],1,we);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 u0(i,r,a,s,o,l)}evaluate(e){const t=this.input.evaluate(e);return(ct(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()}},WC=class h0{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,be);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 h0(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()}},VC=class Zf{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 2 or 3 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,we),r=t.parse(e[2],2,H);if(!i||!r)return null;if(!jh(i.type,[Pt(we),ye,we]))return t.error(`Expected first argument to be of type array or string, but found ${qe(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,H);return s?new Zf(i.type,i,r,s):null}else return new Zf(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)),dr(t,["string"]))return[...t].slice(i,r).join("");if(dr(t,["array"]))return t.slice(i,r);throw new et(`Expected first argument to be of type array or string, but found ${qe(ct(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function fy(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 et("Input is not a number.");return 0}var dy=class f0{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,H);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,u=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 h=t.parse(l,u,s);if(!h)return null;s=s||h.type,r.push([a,h])}return new f0(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;return r>=t[s-1]?i[s-1].evaluate(e):i[fy(t,r)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function XC(n,e,t,i){const r=3*n,s=3*(t-n)-r,o=1-r-s,a=3*e,l=3*(i-e)-a,c=1-a-l;return function(h,f=1e-6){if(h<=0)return 0;if(h>=1)return 1;let d=h;for(let m=0;m<8;m++){const y=((o*d+s)*d+r)*d-h;if(Math.abs(y)<f)return((c*d+l)*d+a)*d;const _=(3*o*d+2*s)*d+r;if(Math.abs(_)<1e-6)break;d-=y/_}let g=0,p=1;d=h;for(let m=0;m<20;m++){const y=((o*d+s)*d+r)*d;if(Math.abs(y-h)<f)break;h>y?g=d:p=d,d=(g+p)*.5}return((c*d+l)*d+a)*d}}var pr=class qf{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=XC(o[0],o[1],o[2],o[3])(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(u=>typeof u!="number"||u<0||u>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,H),!s)return null;const a=[];let l=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&t.expectedType!=ko?l=Fn:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let c=0;c<o.length;c+=2){const u=o[c],h=o[c+1],f=c+3,d=c+4;if(typeof u!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(a.length&&a[a.length-1][0]>=u)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);const g=t.parse(h,d,l);if(!g)return null;l=l||g.type,a.push([u,g])}return!Oi(l,H)&&!Oi(l,Tl)&&!Oi(l,Fn)&&!Oi(l,Il)&&!Oi(l,Ml)&&!Oi(l,ko)&&!Oi(l,Al)&&!Oi(l,Pt(H))?t.error(`Type ${qe(l)} is not interpolatable.`):new qf(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=fy(t,r),a=t[o],l=t[o+1],c=qf.interpolationFactor(this.interpolation,r,a,l),u=i[o].evaluate(e),h=i[o+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return gr(u,h,c);case"color":return Qe.interpolate(u,h,c);case"padding":return hs.interpolate(u,h,c);case"colorArray":return Li.interpolate(u,h,c);case"numberArray":return fs.interpolate(u,h,c);case"variableAnchorOffsetCollection":return ds.interpolate(u,h,c);case"array":return Go(u,h,c);case"projectionDefinition":return Wo.interpolate(u,h,c)}case"interpolate-hcl":switch(this.type.kind){case"color":return Qe.interpolate(u,h,c,"hcl");case"colorArray":return Li.interpolate(u,h,c,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Qe.interpolate(u,h,c,"lab");case"colorArray":return Li.interpolate(u,h,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)}var gy=class Hf{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 o of e.slice(1)){const a=t.parse(o,1+s.length,i,void 0,{typeAnnotation:"omit"});if(!a)return null;i=i||a.type,s.push(a)}if(!i)throw new Error("No output type");return r&&s.some(o=>zo(r,o.type))?new Hf(we,s):new Hf(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 gs&&!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 py(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 UC(n,e,t){return e===t}function BC(n,e,t){return e!==t}function $C(n,e,t){return e<t}function KC(n,e,t){return e>t}function YC(n,e,t){return e<=t}function ZC(n,e,t){return e>=t}function my(n,e,t,i){return i.compare(e,t)===0}function qC(n,e,t,i){return!my(n,e,t,i)}function HC(n,e,t,i){return i.compare(e,t)<0}function JC(n,e,t,i){return i.compare(e,t)>0}function QC(n,e,t,i){return i.compare(e,t)<=0}function eT(n,e,t,i){return i.compare(e,t)>=0}function ms(n,e,t){const i=n!=="=="&&n!=="!=";return class d0{constructor(s,o,a){this.type=be,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,we);if(!l)return null;if(!py(a,l.type))return o.concat(1).error(`"${a}" comparisons are not supported for type '${qe(l.type)}'.`);let c=o.parse(s[2],2,we);if(!c)return null;if(!py(a,c.type))return o.concat(2).error(`"${a}" comparisons are not supported for type '${qe(c.type)}'.`);if(l.type.kind!==c.type.kind&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error(`Cannot compare types '${qe(l.type)}' and '${qe(c.type)}'.`);i&&(l.type.kind==="value"&&c.type.kind!=="value"?l=new ni(c.type,[l]):l.type.kind!=="value"&&c.type.kind==="value"&&(c=new ni(l.type,[c])));let u=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(u=o.parse(s[3],3,Rl),!u)return null}return new d0(l,c,u)}evaluate(s){const o=this.lhs.evaluate(s),a=this.rhs.evaluate(s);if(i&&this.hasUntypedArgument){const l=ct(o),c=ct(a);if(l.kind!==c.kind||!(l.kind==="string"||l.kind==="number"))throw new et(`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=ct(o),c=ct(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 tT=ms("==",UC,my),nT=ms("!=",BC,qC),iT=ms("<",$C,HC),rT=ms(">",KC,JC),sT=ms("<=",YC,QC),oT=ms(">=",ZC,eT);var yy=class g0{constructor(e,t,i){this.type=Rl,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,be);if(!r)return null;const s=t.parse(i["diacritic-sensitive"]===void 0?!1:i["diacritic-sensitive"],1,be);if(!s)return null;let o=null;return i.locale&&(o=t.parse(i.locale,1,ye),!o)?null:new g0(r,s,o)}evaluate(e){return new Bh(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}},aT=class p0{constructor(e,t,i,r,s,o){this.type=ye,this.number=e,this.locale=t,this.currency=i,this.unit=r,this.minFractionDigits=s,this.maxFractionDigits=o}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");const i=t.parse(e[1],1,H);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,ye),!s))return null;let o=null;if(r.currency&&(o=t.parse(r.currency,1,ye),!o))return null;let a=null;if(r.unit&&(a=t.parse(r.unit,1,ye),!a))return null;if(o&&a)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(r["min-fraction-digits"]&&(l=t.parse(r["min-fraction-digits"],1,H),!l))return null;let c=null;return r["max-fraction-digits"]&&(c=t.parse(r["max-fraction-digits"],1,H),!c)?null:new p0(i,s,o,a,l,c)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.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.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},lT=class m0{constructor(e){this.type=Sl,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,H),!l))return null;let c=null;if(a["text-font"]&&(c=t.parse(a["text-font"],1,Pt(ye)),!c))return null;let u=null;if(a["text-color"]&&(u=t.parse(a["text-color"],1,Fn),!u))return null;let h=null;if(a["vertical-align"]){if(typeof a["vertical-align"]=="string"&&!LC.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(h=t.parse(a["vertical-align"],1,ye),!h)return null}const f=r[r.length-1];f.scale=l,f.font=c,f.textColor=u,f.verticalAlign=h}else{const l=t.parse(e[o],1,we);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 m0(r)}evaluate(e){const t=i=>{const r=i.content.evaluate(e);return ct(r)===No?new $h("",r,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new $h(Xo(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 jo(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}},cT=class y0{constructor(e){this.type=No,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");const i=t.parse(e[1],1,ye);return i?new y0(i):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),i=gs.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},uT=class _0{constructor(e){this.type=H,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 ${qe(i.type)} instead.`):new _0(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 et(`Expected value to be of type string or array, but found ${qe(ct(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}};const On=8192;function hT(n,e){const t=fT(n[0]),i=gT(n[1]),r=Math.pow(2,e.z);return[Math.round(t*r*On),Math.round(i*r*On)]}function Yh(n,e){const t=Math.pow(2,e.z),i=(n[0]/On+e.x)/t,r=(n[1]/On+e.y)/t;return[dT(i),pT(r)]}function fT(n){return(180+n)/360}function dT(n){return n*360-180}function gT(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function pT(n){return 360/Math.PI*Math.atan(Math.exp((180-n*360)*Math.PI/180))-90}function Uo(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 Bo(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function mT(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 yT(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 Ll(n,e,t,i){const r=[e[0]-n[0],e[1]-n[1]];return wT([i[0]-t[0],i[1]-t[1]],r)===0?!1:!!(xy(n,e,t,i)&&xy(t,i,n,e))}function _T(n,e,t){for(const i of t)for(let r=0;r<i.length-1;++r)if(Ll(n,e,i[r],i[r+1]))return!0;return!1}function ys(n,e,t=!1){let i=!1;for(const r of e)for(let s=0;s<r.length-1;s++){if(yT(n,r[s],r[s+1]))return t;mT(n,r[s],r[s+1])&&(i=!i)}return i}function xT(n,e){for(const t of e)if(ys(n,t))return!0;return!1}function _y(n,e){for(const t of n)if(!ys(t,e))return!1;for(let t=0;t<n.length-1;++t)if(_T(n[t],n[t+1],e))return!1;return!0}function vT(n,e){for(const t of e)if(_y(n,t))return!0;return!1}function wT(n,e){return n[0]*e[1]-n[1]*e[0]}function xy(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],u=r*c-l*s,h=o*c-l*a;return u>0&&h<0||u<0&&h>0}function Zh(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=hT(n[r][o],t);Uo(e,a),s.push(a)}i.push(s)}return i}function vy(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=Zh(n[r],e,t);i.push(s)}return i}function wy(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}Uo(e,n)}function ET(n){n[0]=n[1]=1/0,n[2]=n[3]=-1/0}function Ey(n,e,t,i){const r=Math.pow(2,i.z)*On,s=[i.x*On,i.y*On],o=[];for(const a of n)for(const l of a){const c=[l.x+s[0],l.y+s[1]];wy(c,e,t,r),o.push(c)}return o}function by(n,e,t,i){const r=Math.pow(2,i.z)*On,s=[i.x*On,i.y*On],o=[];for(const a of n){const l=[];for(const c of a){const u=[c.x+s[0],c.y+s[1]];Uo(e,u),l.push(u)}o.push(l)}if(e[2]-e[0]<=r/2){ET(e);for(const a of o)for(const l of a)wy(l,e,t,r)}return o}function bT(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=Zh(e.coordinates,i,r),o=Ey(n.geometry(),t,i,r);if(!Bo(t,i))return!1;for(const a of o)if(!ys(a,s))return!1}if(e.type==="MultiPolygon"){const s=vy(e.coordinates,i,r),o=Ey(n.geometry(),t,i,r);if(!Bo(t,i))return!1;for(const a of o)if(!xT(a,s))return!1}return!0}function CT(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=Zh(e.coordinates,i,r),o=by(n.geometry(),t,i,r);if(!Bo(t,i))return!1;for(const a of o)if(!_y(a,s))return!1}if(e.type==="MultiPolygon"){const s=vy(e.coordinates,i,r),o=by(n.geometry(),t,i,r);if(!Bo(t,i))return!1;for(const a of o)if(!vT(a,s))return!1}return!0}var qh=class yc{constructor(e,t){this.type=be,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(Vo(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)return new yc(i,{type:"MultiPolygon",coordinates:r})}else if(i.type==="Feature"){const r=i.geometry.type;if(r==="Polygon"||r==="MultiPolygon")return new yc(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new yc(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 bT(e,this.geometries);if(e.geometryType()==="LineString")return CT(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Cy=class{constructor(n=[],e=(t,i)=>t<i?-1:t>i?1:0){if(this.data=n,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(n){this.data.push(n),this._up(this.length++)}pop(){if(this.length===0)return;const n=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),n}peek(){return this.data[0]}_up(n){const{data:e,compare:t}=this,i=e[n];for(;n>0;){const r=n-1>>1,s=e[r];if(t(i,s)>=0)break;e[n]=s,n=r}e[n]=i}_down(n){const{data:e,compare:t}=this,i=this.length>>1,r=e[n];for(;n<i;){let s=(n<<1)+1;const o=s+1;if(o<this.length&&t(e[o],e[s])<0&&(s=o),t(e[s],r)>=0)break;e[n]=e[s],n=s}e[n]=r}};function TT(n,e){if(n.length<=1)return[n];const t=[];let i,r;for(const s of n){const o=RT(s);o!==0&&(s.area=Math.abs(o),r===void 0&&(r=o<0),r===o<0?(i&&t.push(i),i=[s]):i.push(s))}return i&&t.push(i),t}function RT(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 ST=6378.137,Ty=1/298.257223563,Ry=Ty*(2-Ty),Sy=Math.PI/180;var Hh=class{constructor(n){const e=Sy*ST*1e3,t=Math.cos(n*Sy),i=1/(1-Ry*(1-t*t)),r=Math.sqrt(i);this.kx=e*r*t,this.ky=e*r*i*(1-Ry)}distance(n,e){const t=this.wrap(n[0]-e[0])*this.kx,i=(n[1]-e[1])*this.ky;return Math.sqrt(t*t+i*i)}pointOnLine(n,e){let t=1/0,i,r,s,o;for(let a=0;a<n.length-1;a++){let l=n[a][0],c=n[a][1],u=this.wrap(n[a+1][0]-l)*this.kx,h=(n[a+1][1]-c)*this.ky,f=0;(u!==0||h!==0)&&(f=(this.wrap(e[0]-l)*this.kx*u+(e[1]-c)*this.ky*h)/(u*u+h*h),f>1?(l=n[a+1][0],c=n[a+1][1]):f>0&&(l+=u/this.kx*f,c+=h/this.ky*f)),u=this.wrap(e[0]-l)*this.kx,h=(e[1]-c)*this.ky;const d=u*u+h*h;d<t&&(t=d,i=l,r=c,s=a,o=f)}return{point:[i,r],index:s,t:Math.max(0,Math.min(1,o))}}wrap(n){for(;n<-180;)n+=360;for(;n>180;)n-=360;return n}};const Jh=100,Qh=50;function Iy(n,e){return e[0]-n[0]}function Dl(n){return n[1]-n[0]+1}function ii(n,e){return n[1]>=n[0]&&n[1]<e}function ef(n,e){if(n[0]>n[1])return[null,null];const t=Dl(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 tf(n,e){if(!ii(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)Uo(t,n[i]);return t}function nf(n){const e=[1/0,1/0,-1/0,-1/0];for(const t of n)for(const i of t)Uo(e,i);return e}function My(n){return n[0]!==-1/0&&n[1]!==-1/0&&n[2]!==1/0&&n[3]!==1/0}function rf(n,e,t){if(!My(n)||!My(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 mr(n,e,t){const i=t.pointOnLine(e,n);return t.distance(n,i.point)}function sf(n,e,t,i,r){const s=Math.min(mr(n,[t,i],r),mr(e,[t,i],r)),o=Math.min(mr(t,[n,e],r),mr(i,[n,e],r));return Math.min(s,o)}function IT(n,e,t,i,r){if(!(ii(e,n.length)&&ii(i,t.length)))return 1/0;let s=1/0;for(let o=e[0];o<e[1];++o){const a=n[o],l=n[o+1];for(let c=i[0];c<i[1];++c){const u=t[c],h=t[c+1];if(Ll(a,l,u,h))return 0;s=Math.min(s,sf(a,l,u,h,r))}}return s}function MT(n,e,t,i,r){if(!(ii(e,n.length)&&ii(i,t.length)))return NaN;let s=1/0;for(let o=e[0];o<=e[1];++o)for(let a=i[0];a<=i[1];++a)if(s=Math.min(s,r.distance(n[o],t[a])),s===0)return s;return s}function AT(n,e,t){if(ys(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,mr(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 PT(n,e,t,i){if(!ii(e,n.length))return NaN;for(let s=e[0];s<=e[1];++s)if(ys(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,u=l.length,h=u-1;c<u;h=c++){const f=l[h],d=l[c];if(Ll(o,a,f,d))return 0;r=Math.min(r,sf(o,a,f,d,i))}}return r}function Ay(n,e){for(const t of n)for(const i of t)if(ys(i,e,!0))return!0;return!1}function FT(n,e,t,i=1/0){const r=nf(n),s=nf(e);if(i!==1/0&&rf(r,s,t)>=i)return i;if(Bo(r,s)){if(Ay(n,e))return 0}else if(Ay(e,n))return 0;let o=1/0;for(const a of n)for(let l=0,c=a.length,u=c-1;l<c;u=l++){const h=a[u],f=a[l];for(const d of e)for(let g=0,p=d.length,m=p-1;g<p;m=g++){const y=d[m],_=d[g];if(Ll(h,f,y,_))return 0;o=Math.min(o,sf(h,f,y,_,t))}}return o}function Py(n,e,t,i,r,s){if(!s)return;const o=rf(tf(i,s),r,t);o<e&&n.push([o,s,[0,0]])}function kl(n,e,t,i,r,s,o){if(!s||!o)return;const a=rf(tf(i,s),tf(r,o),t);a<e&&n.push([a,s,o])}function Nl(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 Cy([[0,[0,n.length-1],[0,0]]],Iy),a=nf(t);for(;o.length>0;){const l=o.pop();if(l[0]>=s)continue;const c=l[1],u=e?Qh:Jh;if(Dl(c)<=u){if(!ii(c,n.length))return NaN;if(e){const h=PT(n,c,t,i);if(isNaN(h)||h===0)return h;s=Math.min(s,h)}else for(let h=c[0];h<=c[1];++h){const f=AT(n[h],t,i);if(s=Math.min(s,f),s===0)return 0}}else{const h=ef(c,e);Py(o,s,i,n,a,h[0]),Py(o,s,i,n,a,h[1])}}return s}function zl(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 Cy([[0,[0,n.length-1],[0,t.length-1]]],Iy);for(;a.length>0;){const l=a.pop();if(l[0]>=o)continue;const c=l[1],u=l[2],h=e?Qh:Jh,f=i?Qh:Jh;if(Dl(c)<=h&&Dl(u)<=f){if(!ii(c,n.length)&&ii(u,t.length))return NaN;let d;if(e&&i)d=IT(n,c,t,u,r),o=Math.min(o,d);else if(e&&!i){const g=n.slice(c[0],c[1]+1);for(let p=u[0];p<=u[1];++p)if(d=mr(t[p],g,r),o=Math.min(o,d),o===0)return o}else if(!e&&i){const g=t.slice(u[0],u[1]+1);for(let p=c[0];p<=c[1];++p)if(d=mr(n[p],g,r),o=Math.min(o,d),o===0)return o}else d=MT(n,c,t,u,r),o=Math.min(o,d)}else{const d=ef(c,e),g=ef(u,i);kl(a,o,r,n,t,d[0],g[0]),kl(a,o,r,n,t,d[0],g[1]),kl(a,o,r,n,t,d[1],g[0]),kl(a,o,r,n,t,d[1],g[1])}}return o}function OT(n,e){const t=n.geometry(),i=t.flat().map(o=>Yh([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new Hh(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,zl(i,!1,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,zl(i,!1,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,Nl(i,!1,o.coordinates,r,s));break}if(s===0)return s}return s}function LT(n,e){const t=n.geometry(),i=t.flat().map(o=>Yh([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new Hh(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,zl(i,!0,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,zl(i,!0,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,Nl(i,!0,o.coordinates,r,s));break}if(s===0)return s}return s}function DT(n,e){const t=n.geometry();if(t.length===0||t[0].length===0)return NaN;const i=TT(t).map(o=>o.map(a=>a.map(l=>Yh([l.x,l.y],n.canonical)))),r=new Hh(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,Nl([o.coordinates],!1,a,r,s));break;case"LineString":s=Math.min(s,Nl(o.coordinates,!0,a,r,s));break;case"Polygon":s=Math.min(s,FT(a,o.coordinates,r,s));break}if(s===0)return s}return s}function of(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]}var af=class _c{constructor(e,t){this.type=H,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(Vo(e[1])){const i=e[1];if(i.type==="FeatureCollection")return new _c(i,i.features.map(r=>of(r.geometry)).flat());if(i.type==="Feature")return new _c(i,of(i.geometry));if("type"in i&&"coordinates"in i)return new _c(i,of(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 OT(e,this.geometries);if(e.geometryType()==="LineString")return LT(e,this.geometries);if(e.geometryType()==="Polygon")return DT(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},lf=class x0{constructor(e){this.type=we,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 x0(i)}evaluate(e){const t=e.globals?.globalState;return!t||Object.keys(t).length===0?null:iy(t,this.key)??null}eachChild(){}outputDefined(){return!1}};const Gl={"==":tT,"!=":nT,">":rT,"<":iT,">=":oT,"<=":sT,array:ni,at:NC,boolean:ni,case:WC,coalesce:gy,collator:yy,format:lT,image:cT,in:zC,"index-of":GC,interpolate:pr,"interpolate-hcl":pr,"interpolate-lab":pr,length:uT,let:uy,literal:Fl,match:jC,number:ni,"number-format":aT,object:ni,slice:VC,step:dy,string:ni,"to-boolean":ps,"to-color":ps,"to-number":ps,"to-string":ps,var:hy,within:qh,distance:af,"global-state":lf};var Di=class sa{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=sa.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,u]of a){l=new cy(t.registry,jl,t.path,null,t.scope);const h=[];let f=!1;for(let d=1;d<e.length;d++){const g=e[d],p=Array.isArray(c)?c[d-1]:c.type,m=l.parse(g,1+h.length,p);if(!m){f=!0;break}h.push(m)}if(!f){if(Array.isArray(c)&&c.length!==h.length){l.error(`Expected ${c.length} arguments, but found ${h.length} instead.`);continue}for(let d=0;d<h.length;d++){const g=Array.isArray(c)?c[d]:c.type,p=h[d];l.concat(d+1).checkSubtype(g,p.type)}if(l.errors.length===0)return new sa(i,s,u,h)}}if(a.length===1)t.errors.push(...l.errors);else{const c=(a.length?a:o).map(([h])=>NT(h)).join(" | "),u=[];for(let h=1;h<e.length;h++){const f=t.parse(e[h],1+u.length);if(!f)return null;u.push(qe(f.type))}t.error(`Expected arguments of type ${c}, but found (${u.join(", ")}) instead.`)}return null}static register(e,t){sa.definitions=t;for(const i in t)e[i]=sa}};function Fy(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=oy(e,t,i,s);if(o)throw new et(o);return new Qe(e/255,t/255,i/255,s,!1)}function Oy(n,e){return n in e}function cf(n,e){const t=e[n];return typeof t>"u"?null:t}function kT(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 yr(n){return{type:n}}Di.register(Gl,{error:[bC,[ye],(n,[e])=>{throw new et(e.evaluate(n))}],typeof:[ye,[we],(n,[e])=>qe(ct(e.evaluate(n)))],"to-rgba":[Pt(H,4),[Fn],(n,[e])=>{const[t,i,r,s]=e.evaluate(n).rgb;return[t*255,i*255,r*255,s]}],rgb:[Fn,[H,H,H],Fy],rgba:[Fn,[H,H,H,H],Fy],has:{type:be,overloads:[[[ye],(n,[e])=>Oy(e.evaluate(n),n.properties())],[[ye,fr],(n,[e,t])=>Oy(e.evaluate(n),t.evaluate(n))]]},get:{type:we,overloads:[[[ye],(n,[e])=>cf(e.evaluate(n),n.properties())],[[ye,fr],(n,[e,t])=>cf(e.evaluate(n),t.evaluate(n))]]},"feature-state":[we,[ye],(n,[e])=>cf(e.evaluate(n),n.featureState||{})],properties:[fr,[],n=>n.properties()],"geometry-type":[ye,[],n=>n.geometryType()],id:[we,[],n=>n.id()],zoom:[H,[],n=>n.globals.zoom],"heatmap-density":[H,[],n=>n.globals.heatmapDensity||0],elevation:[H,[],n=>n.globals.elevation||0],"line-progress":[H,[],n=>n.globals.lineProgress||0],accumulated:[we,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[H,yr(H),(n,e)=>{let t=0;for(const i of e)t+=i.evaluate(n);return t}],"*":[H,yr(H),(n,e)=>{let t=1;for(const i of e)t*=i.evaluate(n);return t}],"-":{type:H,overloads:[[[H,H],(n,[e,t])=>e.evaluate(n)-t.evaluate(n)],[[H],(n,[e])=>-e.evaluate(n)]]},"/":[H,[H,H],(n,[e,t])=>e.evaluate(n)/t.evaluate(n)],"%":[H,[H,H],(n,[e,t])=>e.evaluate(n)%t.evaluate(n)],ln2:[H,[],()=>Math.LN2],pi:[H,[],()=>Math.PI],e:[H,[],()=>Math.E],"^":[H,[H,H],(n,[e,t])=>Math.pow(e.evaluate(n),t.evaluate(n))],sqrt:[H,[H],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[H,[H],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[H,[H],(n,[e])=>Math.log(e.evaluate(n))],log2:[H,[H],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[H,[H],(n,[e])=>Math.sin(e.evaluate(n))],cos:[H,[H],(n,[e])=>Math.cos(e.evaluate(n))],tan:[H,[H],(n,[e])=>Math.tan(e.evaluate(n))],asin:[H,[H],(n,[e])=>Math.asin(e.evaluate(n))],acos:[H,[H],(n,[e])=>Math.acos(e.evaluate(n))],atan:[H,[H],(n,[e])=>Math.atan(e.evaluate(n))],min:[H,yr(H),(n,e)=>Math.min(...e.map(t=>t.evaluate(n)))],max:[H,yr(H),(n,e)=>Math.max(...e.map(t=>t.evaluate(n)))],abs:[H,[H],(n,[e])=>Math.abs(e.evaluate(n))],round:[H,[H],(n,[e])=>{const t=e.evaluate(n);return t<0?-Math.round(-t):Math.round(t)}],floor:[H,[H],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[H,[H],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[be,[ye,we],(n,[e,t])=>n.properties()[e.value]===t.value],"filter-id-==":[be,[we],(n,[e])=>n.id()===e.value],"filter-type-==":[be,[ye],(n,[e])=>n.geometryType()===e.value],"filter-<":[be,[ye,we],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<r}],"filter-id-<":[be,[we],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<i}],"filter->":[be,[ye,we],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>r}],"filter-id->":[be,[we],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>i}],"filter-<=":[be,[ye,we],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[be,[we],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<=i}],"filter->=":[be,[ye,we],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[be,[we],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>=i}],"filter-has":[be,[we],(n,[e])=>e.value in n.properties()],"filter-has-id":[be,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[be,[Pt(ye)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[be,[Pt(we)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[be,[ye,Pt(we)],(n,[e,t])=>t.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[be,[ye,Pt(we)],(n,[e,t])=>kT(n.properties()[e.value],t.value,0,t.value.length-1)],all:{type:be,overloads:[[[be,be],(n,[e,t])=>e.evaluate(n)&&t.evaluate(n)],[yr(be),(n,e)=>{for(const t of e)if(!t.evaluate(n))return!1;return!0}]]},any:{type:be,overloads:[[[be,be],(n,[e,t])=>e.evaluate(n)||t.evaluate(n)],[yr(be),(n,e)=>{for(const t of e)if(t.evaluate(n))return!0;return!1}]]},"!":[be,[be],(n,[e])=>!e.evaluate(n)],"is-supported-script":[be,[ye],(n,[e])=>{const t=n.globals&&n.globals.isSupportedScript;return t?t(e.evaluate(n)):!0}],upcase:[ye,[ye],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[ye,[ye],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[ye,yr(we),(n,e)=>e.map(t=>Xo(t.evaluate(n))).join("")],split:[Pt(ye),[ye,ye],(n,[e,t])=>e.evaluate(n).split(t.evaluate(n))],join:[ye,[Pt(ye),ye],(n,[e,t])=>e.evaluate(n).join(t.evaluate(n))],"resolved-locale":[ye,[Rl],(n,[e])=>e.evaluate(n).resolvedLocale()]});function NT(n){return Array.isArray(n)?`(${n.map(qe).join(", ")})`:`(${qe(n.type)}...)`}function jl(n){if(n instanceof hy)return jl(n.boundExpression);if(n instanceof Di&&n.name==="error")return!1;if(n instanceof yy)return!1;if(n instanceof qh)return!1;if(n instanceof af)return!1;if(n instanceof lf)return!1;const e=n instanceof ps||n instanceof ni;let t=!0;return n.eachChild(i=>{e?t=t&&jl(i):t=t&&i instanceof Fl}),t?uf(n)&&ff(n,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function uf(n){if(n instanceof Di){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 qh||n instanceof af)return!1;let e=!0;return n.eachChild(t=>{e&&!uf(t)&&(e=!1)}),e}function hf(n){if(n instanceof Di&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(t=>{e&&!hf(t)&&(e=!1)}),e}function ff(n,e){if(n instanceof Di&&e.indexOf(n.name)>=0)return!1;let t=!0;return n.eachChild(i=>{t&&!ff(i,e)&&(t=!1)}),t}function df(n){return{result:"success",value:n}}function _s(n){return{result:"error",value:n}}function zT(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function GT(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function jT(n){return!!n.expression&&n.expression.interpolated}function Wl(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&ct(n)===fr}var WT=class{constructor(n,e,t){this.expression=n,this._warningHistory={},this._evaluator=new ly,this._defaultValue=e?XT(e):null,this._enumValues=e&&e.type==="enum"?e.values:null,this._globalState=t}evaluateWithoutErrorHandling(n,e,t,i,r,s){return this._globalState&&(n=xs(n,this._globalState)),this._evaluator.globals=n,this._evaluator.feature=e,this._evaluator.featureState=t,this._evaluator.canonical=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=s,this.expression.evaluate(this._evaluator)}evaluate(n,e,t,i,r,s){this._globalState&&(n=xs(n,this._globalState)),this._evaluator.globals=n,this._evaluator.feature=e||null,this._evaluator.featureState=t||null,this._evaluator.canonical=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=s||null;try{const o=this.expression.evaluate(this._evaluator);if(o==null||typeof o=="number"&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new et(`Expected value to be one of ${Object.keys(this._enumValues).map(a=>JSON.stringify(a)).join(", ")}, but found ${JSON.stringify(o)} instead.`);return o}catch(o){return this._warningHistory[o.message]||(this._warningHistory[o.message]=!0,typeof console<"u"&&console.warn(o.message)),this._defaultValue}}};function Vl(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in Gl}function Ly(n,e,t){const i=new cy(Gl,jl,[],e?VT(e):void 0),r=i.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return r?df(new WT(r,e,t)):_s(i.errors)}var Dy=class{constructor(n,e,t){this.kind=n,this._styleExpression=e,this.isStateDependent=n!=="constant"&&!hf(e.expression),this.globalStateRefs=Ul(e.expression),this._globalState=t}evaluateWithoutErrorHandling(n,e,t,i,r,s){return this._globalState&&(n=xs(n,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(n,e,t,i,r,s)}evaluate(n,e,t,i,r,s){return this._globalState&&(n=xs(n,this._globalState)),this._styleExpression.evaluate(n,e,t,i,r,s)}},ky=class{constructor(n,e,t,i,r){this.kind=n,this.zoomStops=t,this._styleExpression=e,this.isStateDependent=n!=="camera"&&!hf(e.expression),this.globalStateRefs=Ul(e.expression),this.interpolationType=i,this._globalState=r}evaluateWithoutErrorHandling(n,e,t,i,r,s){return this._globalState&&(n=xs(n,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(n,e,t,i,r,s)}evaluate(n,e,t,i,r,s){return this._globalState&&(n=xs(n,this._globalState)),this._styleExpression.evaluate(n,e,t,i,r,s)}interpolationFactor(n,e,t){return this.interpolationType?pr.interpolationFactor(this.interpolationType,n,e,t):0}};function Ny(n,e,t){const i=Ly(n,e,t);if(i.result==="error")return i;const r=i.value.expression,s=uf(r);if(!s&&!zT(e))return _s([new Pn("","data expressions not supported")]);const o=ff(r,["zoom"]);if(!o&&!GT(e))return _s([new Pn("","zoom expressions not supported")]);const a=Xl(r);if(!a&&!o)return _s([new Pn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Pn)return _s([a]);if(a instanceof pr&&!jT(e))return _s([new Pn("",'"interpolate" expressions cannot be used with this property')]);if(!a)return df(s?new Dy("constant",i.value,t):new Dy("source",i.value,t));const l=a instanceof pr?a.interpolation:void 0;return df(s?new ky("camera",i.value,a.labels,l,t):new ky("composite",i.value,a.labels,l,t))}function Xl(n){let e=null;if(n instanceof uy)e=Xl(n.result);else if(n instanceof gy){for(const t of n.args)if(e=Xl(t),e)break}else(n instanceof dy||n instanceof pr)&&n.input instanceof Di&&n.input.name==="zoom"&&(e=n);return e instanceof Pn||n.eachChild(t=>{const i=Xl(t);i instanceof Pn?e=i:!e&&i?e=new Pn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Pn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Ul(n,e=new Set){return n instanceof lf&&e.add(n.key),n.eachChild(t=>{Ul(t,e)}),e}function VT(n){const e={color:Fn,string:ye,number:H,enum:ye,boolean:be,formatted:Sl,padding:Il,numberArray:Ml,colorArray:ko,projectionDefinition:Tl,resolvedImage:No,variableAnchorOffsetCollection:Al};return n.type==="array"?Pt(e[n.value]||we,n.length):e[n.type]}function XT(n){if(n.type==="color"&&Wl(n.default))return new Qe(0,0,0,0);switch(n.type){case"color":return Qe.parse(n.default)||null;case"padding":return hs.parse(n.default)||null;case"numberArray":return fs.parse(n.default)||null;case"colorArray":return Li.parse(n.default)||null;case"variableAnchorOffsetCollection":return ds.parse(n.default)||null;case"projectionDefinition":return Wo.parse(n.default)||null;default:return n.default===void 0?null:n.default}}function xs(n,e){const{zoom:t,heatmapDensity:i,elevation:r,lineProgress:s,isSupportedScript:o,accumulated:a}=n??{};return{zoom:t,heatmapDensity:i,elevation:r,lineProgress:s,isSupportedScript:o,accumulated:a,globalState:e}}function zy(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(!zy(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const UT={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function BT(n,e){if(n==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};zy(n)||(n=Bl(n));const t=Ly(n,UT,e);if(t.result==="error")throw new Error(t.value.map(i=>`${i.key}: ${i.message}`).join(", "));return{filter:(i,r,s)=>t.value.evaluate(i,r,{},s),needGeometry:Gy(n),getGlobalStateRefs:()=>Ul(t.value.expression)}}function $T(n,e){return n<e?-1:n>e?1:0}function Gy(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(Gy(n[e]))return!0;return!1}function Bl(n){if(!n)return!0;const e=n[0];return n.length<=1?e!=="any":e==="=="?gf(n[1],n[2],"=="):e==="!="?$l(gf(n[1],n[2],"==")):e==="<"||e===">"||e==="<="||e===">="?gf(n[1],n[2],e):e==="any"?KT(n.slice(1)):e==="all"?["all"].concat(n.slice(1).map(Bl)):e==="none"?["all"].concat(n.slice(1).map(Bl).map($l)):e==="in"?jy(n[1],n.slice(2)):e==="!in"?$l(jy(n[1],n.slice(2))):e==="has"?Wy(n[1]):e==="!has"?$l(Wy(n[1])):!0}function gf(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 KT(n){return["any"].concat(n.map(Bl))}function jy(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($T)]]:["filter-in-small",n,["literal",e]]}}function Wy(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function $l(n){return["!",n]}function $o(n){return typeof n=="object"?["literal",n]:n}function Vy(n,e){let t=n.stops;if(!t)return YT(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],JT(o[1])]:[o[0],$o(o[1])]),i?ZT(n,e,t):s?HT(n,e,t):mf(n,e,t)}function YT(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,$o(n.default)];return e.type==="array"&&i.splice(1,0,e.value,e.length||null),i}}function pf(n){switch(n.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function ZT(n,e,t){const i={},r={},s=[];for(let o=0;o<t.length;o++){const a=t[o],l=a[0].zoom;i[l]===void 0&&(i[l]={zoom:l,type:n.type,property:n.property,default:n.default},r[l]=[],s.push(l)),r[l].push([a[0].value,a[1]])}if(_f({},e)==="exponential"){const o=[pf(n),["linear"],["zoom"]];for(const a of s)vs(o,a,mf(i[a],e,r[a]),!1);return o}else{const o=["step",["zoom"]];for(const a of s)vs(o,a,mf(i[a],e,r[a]),!0);return yf(o),o}}function qT(n,e){if(n!==void 0)return n;if(e!==void 0)return e}function Xy(n,e){const t=$o(qT(n.default,e.default));return t===void 0&&e.type==="resolvedImage"?"":t}function mf(n,e,t){const i=_f(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(Xy(n,e)),s}else if(i==="categorical"){const s=["match",r];for(const o of t)vs(s,o[0],o[1],!1);return s.push(Xy(n,e)),s}else if(i==="interval"){const s=["step",["number",r]];for(const o of t)vs(s,o[0],o[1],!0);return yf(s),n.default===void 0?s:["case",["==",["typeof",r],"number"],s,$o(n.default)]}else if(i==="exponential"){const s=n.base!==void 0?n.base:1,o=[pf(n),s===1?["linear"]:["exponential",s],["number",r]];for(const a of t)vs(o,a[0],a[1],!1);return n.default===void 0?o:["case",["==",["typeof",r],"number"],o,$o(n.default)]}else throw new Error(`Unknown property function type ${i}`)}function HT(n,e,t,i=["zoom"]){const r=_f(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=[pf(n),a===1?["linear"]:["exponential",a],i]}else throw new Error(`Unknown zoom function type "${r}"`);for(const a of t)vs(s,a[0],a[1],o);return yf(s),s}function yf(n){n[0]==="step"&&n.length===3&&(n.push(0),n.push(n[3]))}function vs(n,e,t,i){n.length>3&&e===n[n.length-2]||(i&&n.length===2||n.push(e),n.push(t))}function _f(n,e){return n.type?n.type:e.expression.interpolated?"exponential":"interval"}function JT(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 Uy=xC;class ws extends Rn{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 ws,t=this.geometryName_;e.setGeometryName(t);const i=this.getPropertiesInternal();if(i){const s=this.getGeometry();for(const o in i)o===t&&s?e.set(o,s.clone()):e.set(o,i[o],!0)}const r=this.getStyle();return r&&e.setStyle(r),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_&&(We(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=Te(e,de.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?QT(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){e!==this.geometryName_&&(this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_())}}function QT(n){if(typeof n=="function")return n;let e;return Array.isArray(n)?e=n:(Oe(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[n]),function(){return e}}function Kl(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 u=n[e],h=n[e+1],f=0;const d=[0];for(let m=e+i;m<t;m+=i){const y=n[m],_=n[m+1];f+=Math.sqrt((y-u)*(y-u)+(_-h)*(_-h)),d.push(f),u=y,h=_}const g=r*f,p=sv(d,g);p<0?(l=(g-d[-p-2])/(d[-p-1]-d[-p-2]),a=e+(-p-2)*i):a=e+p*i}o=o>1?o:2,s=s||new Array(o);for(let u=0;u<o;++u)s[u]=a===void 0?NaN:l===void 0?n[a+u]:Ut(n[a+u],n[a+i+u],l);return s}function xf(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 f=a+l>>1;r<n[(f+1)*i-1]?l=f:a=f+1}const c=n[a*i-1];if(r==c)return n.slice((a-1)*i,(a-1)*i+i);const u=n[(a+1)*i-1],h=(r-c)/(u-c);o=[];for(let f=0;f<i-1;++f)o.push(Ut(n[(a-1)*i+f],n[a*i+f],h));return o.push(r),o}function eR(n,e,t,i,r,s,o){if(o)return xf(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 u=t[l];if(e!=u){if(r<n[e+i-1])return null;if(r<=n[u-1])return xf(n,e,u,i,r,!1);e=u}}return null}function vf(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 _r extends tr{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){Tn(this.flatCoordinates,e),this.changed()}clone(){const e=new _r(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<qi(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Au(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))}forEachSegment(e){return Mp(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,xf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return Ti(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return Kl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return vf(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=el(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new _r(t,"XY")}getType(){return"LineString"}intersectsExtent(e){return tl(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=Qa(this.flatCoordinates,0,e,this.stride),this.changed()}}class Ko extends tr{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 u=r[l];Tn(s,u.getFlatCoordinates()),o.push(s.length)}const a=r.length===0?this.getLayout():r[0].getLayout();this.setFlatCoordinates(a,s),this.ends_=o}}appendLineString(e){Tn(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Ko(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<qi(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Pu(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ou(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,eR(this.flatCoordinates,0,this.ends_,this.stride,e,t,i))}getCoordinates(){return lo(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new _r(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 _r(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+=vf(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=Kl(t,i,l,s,.5);Tn(e,c),i=l}return e}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Sp(this.flatCoordinates,0,this.ends_,this.stride,e,t,0,i),new Ko(t,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(e){return Sw(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=ao(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class Yo extends tr{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){Tn(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){const e=new Yo(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<qi(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 u=0;u<o;++u)i[u]=s[a+u];i.length=o}}return r}getCoordinates(){return Ti(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new Zn(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 Zn(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(au(e,o,a))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Qa(this.flatCoordinates,0,e,this.stride),this.changed()}}function By(n,e,t,i){const r=[];let s=Bt();for(let o=0,a=t.length;o<a;++o){const l=t[o];s=uu(n,e,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=l[l.length-1]}return r}class Zo extends tr{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],u=s.length,h=c.getEnds();for(let f=0,d=h.length;f<d;++f)h[f]+=u;Tn(s,c.getFlatCoordinates()),o.push(h)}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;Tn(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 Zo(this.flatCoordinates.slice(),this.layout,t);return i.applyProperties(this),i}closestPointXY(e,t,i,r){return r<qi(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(vw(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ww(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return Rw(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return xw(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),ju(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,Lu(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=By(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Ip(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Yo(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Fp(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=ju(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Cw(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),t,0,i),new Zo(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 qn(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 h=0,f=l.length;h<f;++h)l[h]-=s;const u=new qn(t.slice(s,c),e,l);r.push(u),s=c}return r}getType(){return"MultiPolygon"}intersectsExtent(e){return Iw(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Rp(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 $y=Gt();class Ct{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"?cu(this.flatCoordinates_):uu(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=zt(this.getExtent());this.flatInteriorPoints_=Nu(this.flatCoordinates_,0,this.ends_,this.stride_,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=Op(this.flatCoordinates_,this.ends_),t=By(this.flatCoordinates_,0,e,this.stride_);this.flatInteriorPoints_=Ip(this.flatCoordinates_,0,e,this.stride_,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Kl(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,.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=Kl(e,t,o,this.stride_,.5);Tn(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=Le(e);const t=e.getExtent(),i=e.getWorldExtent();if(t&&i){const r=ot(i)/ot(t);Sn($y,i[0],i[3],r,-r,0,0,0),Ci(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,$y,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new Ct(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=Lg((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=el(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=Sp(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,i,0,r);break;case"Polygon":r=[],i.length=Du(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),i,0,r);break}return r&&(this.simplifiedGeometry_=new Ct(this.type_,i,r,this.stride_,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}Ct.prototype.getFlatCoordinates=Ct.prototype.getOrientedFlatCoordinates;class Yl extends wp{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(We),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const e=this.geometries_;for(let t=0,i=e.length;t<i;++t)this.changeEventsKeys_.push(Te(e[t],de.CHANGE,this.changed,this))}clone(){const e=new Yl(wf(this.geometries_));return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<qi(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){jr(e);const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)Ug(e,t[i].getExtent());return e}getGeometries(){return wf(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 Yl(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=zt(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(wf(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 wf(n){return n.map(e=>e.clone())}class Ky{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=ws,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let i=t.dataProjection?Le(t.dataProjection):this.readProjection(e);t.extent&&i&&i.getUnits()==="tile-pixels"&&(i=Le(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 pe()}readFeature(e,t){return pe()}readFeatures(e,t){return pe()}readGeometry(e,t){return pe()}readProjection(e){return pe()}writeFeature(e,t){return pe()}writeFeatures(e,t){return pe()}writeGeometry(e,t){return pe()}}function Zl(n,e,t){const i=t?Le(t.featureProjection):null,r=t?Le(t.dataProjection):null;let s=n;if(i&&r&&!Et(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(er(o,a))}if(e&&t&&t.decimals!==void 0){const o=Math.pow(10,t.decimals),a=function(l){for(let c=0,u=l.length;c<u;++c)l[c]=Math.round(l[c]*o)/o;return l};s===n&&(s=n.clone()),s.applyTransform(a)}return s}const tR={Point:Zn,LineString:_r,Polygon:qn,MultiPoint:Yo,MultiLineString:Ko,MultiPolygon:Zo};function nR(n,e,t){return Array.isArray(e[0])?(Fp(n,0,e,t)||(n=n.slice(),ju(n,0,e,t)),n):(Gu(n,0,e,t)||(n=n.slice(),nl(n,0,e,t)),n)}function Yy(n,e){const t=n.geometry;if(!t)return[];if(Array.isArray(t))return t.map(s=>Yy({...n,geometry:s})).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 Zl(new Ct(i,i==="Polygon"?nR(t.flatCoordinates,t.ends,r):t.flatCoordinates,t.ends?.flat(),r,n.properties||{},n.id).enableSimplifyTransformed(),!1,e)}function Ef(n,e){if(!n)return null;if(Array.isArray(n)){const i=n.map(r=>Ef(r,e));return new Yl(i)}const t=tR[n.type];return Zl(new t(n.flatCoordinates,n.layout||"XY",n.ends),!1,e)}class iR extends Ky{constructor(){super()}getType(){return"json"}readFeature(e,t){return this.readFeatureFromObject(ql(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(ql(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return pe()}readFeaturesFromObject(e,t){return pe()}readGeometry(e,t){return this.readGeometryFromObject(ql(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return pe()}readProjection(e){return this.readProjectionFromObject(ql(e))}readProjectionFromObject(e){return pe()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return pe()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return pe()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return pe()}}function ql(n){if(typeof n=="string"){const e=JSON.parse(n);return e||null}return n!==null?n:null}class Zy extends iR{constructor(e){e=e||{},super(),this.dataProjection=Le(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=Le(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=bf(i.geometry);if(this.featureClass===Ct)return Yy({geometry:r,id:i.id,properties:i.properties},t);const s=new ws;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&i.geometry_name&&s.setGeometryName(i.geometry_name),s.setGeometry(Ef(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 rR(e,t)}readProjectionFromObject(e){const t=e.crs;let i;if(t)if(t.type=="name")i=Le(t.properties.name);else if(t.type==="EPSG")i=Le("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=Cf(o,t),delete s[e.getGeometryName()]),mi(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 Cf(e,this.adaptOptions(t))}}function bf(n,e){if(!n)return null;let t;switch(n.type){case"Point":{t=oR(n);break}case"LineString":{t=aR(n);break}case"Polygon":{t=hR(n);break}case"MultiPoint":{t=cR(n);break}case"MultiLineString":{t=lR(n);break}case"MultiPolygon":{t=uR(n);break}case"GeometryCollection":{t=sR(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return t}function rR(n,e){const t=bf(n);return Ef(t,e)}function sR(n,e){return n.geometries.map(function(i){return bf(i)})}function oR(n){const e=n.coordinates;return{type:"Point",flatCoordinates:e,layout:nr(e.length)}}function aR(n){const e=n.coordinates,t=e.flat();return{type:"LineString",flatCoordinates:t,ends:[t.length],layout:nr(e[0]?.length||2)}}function lR(n){const e=n.coordinates,t=e[0]?.[0]?.length||2,i=[],r=ao(i,0,e,t);return{type:"MultiLineString",flatCoordinates:i,ends:r,layout:nr(t)}}function cR(n){const e=n.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:nr(e[0]?.length||2)}}function uR(n){const e=n.coordinates,t=[],i=e[0]?.[0]?.[0].length||2,r=Rp(t,0,e,i);return{type:"MultiPolygon",flatCoordinates:t,ends:r,layout:nr(i)}}function hR(n){const e=n.coordinates,t=[],i=e[0]?.[0]?.length,r=ao(t,0,e,i);return{type:"Polygon",flatCoordinates:t,ends:r,layout:nr(i)}}function Cf(n,e){n=Zl(n,!0,e);const t=n.getType();let i;switch(t){case"Point":{i=yR(n);break}case"LineString":{i=dR(n);break}case"Polygon":{i=_R(n,e);break}case"MultiPoint":{i=pR(n);break}case"MultiLineString":{i=gR(n);break}case"MultiPolygon":{i=mR(n,e);break}case"GeometryCollection":{i=fR(n,e);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return i}function fR(n,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:n.getGeometriesArray().map(function(i){return Cf(i,e)})}}function dR(n,e){return{type:"LineString",coordinates:n.getCoordinates()}}function gR(n,e){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function pR(n,e){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function mR(n,e){let t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(t)}}function yR(n,e){return{type:"Point",coordinates:n.getCoordinates()}}function _R(n,e){let t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(t)}}const Tf=65536*65536,qy=1/Tf,xR=12,Hy=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Rf=0,Hl=1,qo=2,Jl=5;class vR{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)*Tf;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Tf;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,wR(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>=xR&&Hy?Hy.decode(this.buf.subarray(t,e)):LR(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===qo?this.readVarint()+this.pos:this.pos+1}skip(e){const t=e&7;if(t===Rf)for(;this.buf[this.pos++]>127;);else if(t===qo)this.pos=this.readVarint()+this.pos;else if(t===Jl)this.pos+=4;else if(t===Hl)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*qy),!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*qy),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){ER(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=DR(this.buf,e,this.pos);const i=this.pos-t;i>=128&&Jy(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&&Jy(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}writeMessage(e,t,i){this.writeTag(e,qo),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,TR,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,RR,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,MR,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,SR,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,IR,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,AR,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,PR,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,FR,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,OR,t)}writeBytesField(e,t){this.writeTag(e,qo),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,Jl),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,Jl),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,Hl),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,Hl),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,Rf),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,Rf),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,qo),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,Jl),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,Hl),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function wR(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 Es(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function Es(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function ER(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),bR(t,i,e),CR(i,e)}function bR(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 CR(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 Jy(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 TR(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t])}function RR(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t])}function SR(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t])}function IR(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t])}function MR(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t])}function AR(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t])}function PR(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t])}function FR(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t])}function OR(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t])}function LR(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,u;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],u=n[r+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(o=(s&15)<<18|(l&63)<<12|(c&63)<<6|u&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 DR(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 Qy extends Ky{constructor(e){super(),e=e||{},this.dataProjection=new $a({code:"",units:"tile-pixels"}),this.featureClass=e.featureClass?e.featureClass:Ct,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,u=0,h=0;for(;e.pos<s;){if(!a){const f=e.readVarint();o=f&7,a=f>>3}if(a--,o===1||o===2)l+=e.readSVarint(),c+=e.readSVarint(),o===1&&u>h&&(r.push(u),h=u),i.push(l,c),u+=2;else if(o===7)u>h&&(i.push(i[h],i[h+1]),u+=2);else throw new Error("Invalid command found in the PBF")}u>h&&(r.push(u),h=u)}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 u=jR(r,c.length);if(this.featureClass===Ct)s=new this.featureClass(u,l,c,2,o,a),s.transform(i.dataProjection);else{let h;if(u=="Polygon"){const g=Op(l,c);h=g.length>1?new Zo(l,"XY",g):new qn(l,"XY",c)}else h=u==="Point"?new Zn(l,"XY"):u==="LineString"?new _r(l,"XY"):u==="MultiPoint"?new Yo(l,"XY"):u==="MultiLineString"?new Ko(l,"XY",c):null;const f=this.featureClass;s=new f,this.geometryName_&&s.setGeometryName(this.geometryName_);const d=Zl(h,!1,i);s.setGeometry(d),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=Le(t.dataProjection);r.setWorldExtent(t.extent),t.dataProjection=r;const s=new vR(e),o=s.readFields(kR,{}),a=[];for(const l in o){if(i&&!i.includes(l))continue;const c=o[l],u=c?[0,0,c.extent,c.extent]:null;r.setExtent(u);for(let h=0,f=c.length;h<f;++h){const d=GR(s,c,h),g=this.createFeature_(s,d,t);g!==null&&a.push(g)}}return a}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}}function kR(n,e,t){if(n===3){const i={keys:[],values:[],features:[]},r=t.readVarint()+t.pos;t.readFields(NR,i,r),i.length=i.features.length,i.length&&(e[i.name]=i)}}function NR(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 zR(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 GR(n,e,t){n.pos=e.features[t];const i=n.readVarint()+n.pos,r={layer:e,type:0,properties:{}};return n.readFields(zR,r,i),r}function jR(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 e_{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){}}const ue={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},Ql=[ue.FILL],ki=[ue.STROKE],xr=[ue.BEGIN_PATH],t_=[ue.CLOSE_PATH];class Ho extends e_{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],Hi(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 u=e[t],h=e[t+1];const f=this.tmpCoordinate_;let d=!0,g,p,m;for(g=t+r;g<i;g+=r)f[0]=e[g],f[1]=e[g+1],m=lu(c,f),m!==p?(d&&(a[l++]=u,a[l++]=h,d=!1),a[l++]=f[0],a[l++]=f[1]):m===gt.INTERSECTING?(a[l++]=f[0],a[l++]=f[1],d=!1):d=!0,u=f[0],h=f[1],p=m;return(s&&d||g===t+r)&&(a[l++]=u,a[l++]=h),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,u,h,f,d;switch(o){case"MultiPolygon":c=e.getOrientedFlatCoordinates(),f=[];const g=e.getEndss();d=0;for(let p=0,m=g.length;p<m;++p){const y=[];d=this.drawCustomCoordinates_(c,d,g[p],a,y),f.push(y)}this.instructions.push([ue.CUSTOM,l,f,e,i,Lu,s]),this.hitDetectionInstructions.push([ue.CUSTOM,l,f,e,r||i,Lu,s]);break;case"Polygon":case"MultiLineString":h=[],c=o=="Polygon"?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),d=this.drawCustomCoordinates_(c,0,e.getEnds(),a,h),this.instructions.push([ue.CUSTOM,l,h,e,i,lo,s]),this.hitDetectionInstructions.push([ue.CUSTOM,l,h,e,r||i,lo,s]);break;case"LineString":case"Circle":c=e.getFlatCoordinates(),u=this.appendFlatLineCoordinates(c,0,c.length,a,!1,!1),this.instructions.push([ue.CUSTOM,l,u,e,i,Ti,s]),this.hitDetectionInstructions.push([ue.CUSTOM,l,u,e,r||i,Ti,s]);break;case"MultiPoint":c=e.getFlatCoordinates(),u=this.appendFlatPointCoordinates(c,a),u>l&&(this.instructions.push([ue.CUSTOM,l,u,e,i,Ti,s]),this.hitDetectionInstructions.push([ue.CUSTOM,l,u,e,r||i,Ti,s]));break;case"Point":c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([ue.CUSTOM,l,u,e,i,void 0,s]),this.hitDetectionInstructions.push([ue.CUSTOM,l,u,e,r||i,void 0,s]);break}this.endGeometry(t)}beginGeometry(e,t,i){this.beginGeometryInstruction1_=[ue.BEGIN_GEOMETRY,t,0,e,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ue.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==ue.END_GEOMETRY?o=t:s==ue.BEGIN_GEOMETRY&&(r[2]=t,av(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=Mn(i||Wt)??void 0}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){const i=e.getColor();t.strokeStyle=Mn(i||An);const r=e.getLineCap();t.lineCap=r!==void 0?r:Qr;const s=e.getLineDash();t.lineDash=s?s.slice():Hn;const o=e.getLineDashOffset();t.lineDashOffset=o||Jn;const a=e.getLineJoin();t.lineJoin=a!==void 0?a:es;const l=e.getWidth();t.lineWidth=l!==void 0?l:Io;const c=e.getMiterLimit();t.miterLimit=c!==void 0?c:Ro;const u=e.getOffset();t.strokeOffset=u??ob,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,t.strokeOffset=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=[ue.SET_FILL_STYLE,t];return typeof t!="string"&&i.push(e.fillPatternScale),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[ue.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;(i!==void 0&&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,u=e.strokeOffset;(e.currentStrokeStyle!=i||e.currentLineCap!=r||s!=e.currentLineDash&&!yi(e.currentLineDash,s)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=l||e.currentMiterLimit!=c||e.currentStrokeOffset!=u)&&(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,e.currentStrokeOffset=u)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const t=[ue.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Xg(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;Vn(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class WR extends Ho{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&&!Hi(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([ue.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([ue.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||Hi(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([ue.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([ue.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 VR extends Ho{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinates_(e,t,i,r,s){const o=this.coordinates.length,a=this.appendFlatLineCoordinates(e,t,i,r,!1,!1);return this.instructions.push([ue.MOVE_TO_LINE_TO,o,a,s*this.pixelRatio]),this.hitDetectionInstructions.push([ue.MOVE_TO_LINE_TO,o,a,s]),i}drawLineString(e,t,i){const r=this.state,s=r.strokeStyle,o=r.lineWidth,a=r.strokeOffset;if(s===void 0||o===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,i),this.hitDetectionInstructions.push([ue.SET_STROKE_STYLE,An,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hn,Jn],xr);const l=e.getFlatCoordinates(),c=e.getStride();this.drawFlatCoordinates_(l,0,l.length,c,a),this.hitDetectionInstructions.push(ki),this.endGeometry(t)}drawMultiLineString(e,t,i){const r=this.state,s=r.strokeStyle,o=r.lineWidth,a=r.strokeOffset;if(s===void 0||o===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,i),this.hitDetectionInstructions.push([ue.SET_STROKE_STYLE,An,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hn,Jn],xr);const l=e.getEnds(),c=e.getFlatCoordinates(),u=e.getStride();let h=0;for(let f=0,d=l.length;f<d;++f)h=this.drawFlatCoordinates_(c,h,l[f],u,a);this.hitDetectionInstructions.push(ki),this.endGeometry(t)}finish(){const e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(ki),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(ki),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(xr)}}class n_ extends Ho{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinatess_(e,t,i,r,s){const o=this.state,a=o.fillStyle!==void 0,l=o.strokeStyle!==void 0,c=i.length;this.instructions.push(xr),this.hitDetectionInstructions.push(xr);for(let u=0;u<c;++u){const h=i[u],f=this.coordinates.length,d=this.appendFlatLineCoordinates(e,t,h,r,!0,!l);this.instructions.push([ue.MOVE_TO_LINE_TO,f,d,s*this.pixelRatio,!0]),this.hitDetectionInstructions.push([ue.MOVE_TO_LINE_TO,f,d,s,!0]),l&&(this.instructions.push(t_),this.hitDetectionInstructions.push(t_)),t=h}return a&&(this.instructions.push(Ql),this.hitDetectionInstructions.push(Ql)),l&&(this.instructions.push(ki),this.hitDetectionInstructions.push(ki)),t}drawCircle(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle,a=r.strokeOffset;if(s===void 0&&o===void 0||this.handleStrokeOffset_(()=>this.drawCircle(e,t,i)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_FILL_STYLE,Wt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_STROKE_STYLE,An,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hn,Jn]);const l=e.getFlatCoordinates(),c=e.getStride(),u=this.coordinates.length;this.appendFlatLineCoordinates(l,0,l.length,c,!1,!1);const h=[ue.CIRCLE,u,a];this.instructions.push(xr,h),this.hitDetectionInstructions.push(xr,h),r.fillStyle!==void 0&&(this.instructions.push(Ql),this.hitDetectionInstructions.push(Ql)),r.strokeStyle!==void 0&&(this.instructions.push(ki),this.hitDetectionInstructions.push(ki)),this.endGeometry(t)}drawPolygon(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle,a=r.strokeOffset;if(s===void 0&&o===void 0||this.handleStrokeOffset_(()=>this.drawPolygon(e,t,i)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_FILL_STYLE,Wt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_STROKE_STYLE,An,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hn,Jn]);const l=e.getEnds(),c=e.getOrientedFlatCoordinates(),u=e.getStride();this.drawFlatCoordinatess_(c,0,l,u,a),this.endGeometry(t)}drawMultiPolygon(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle,a=r.strokeOffset;if(s===void 0&&o===void 0||this.handleStrokeOffset_(()=>this.drawMultiPolygon(e,t,i)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_FILL_STYLE,Wt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_STROKE_STYLE,An,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Hn,Jn]);const l=e.getEndss(),c=e.getOrientedFlatCoordinates(),u=e.getStride();let h=0;for(let f=0,d=l.length;f<d;++f)h=this.drawFlatCoordinatess_(c,h,l[f],u,a);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]=ir(t[i],e)}return super.finish()}setFillStrokeStyles_(){const e=this.state;this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke)}handleStrokeOffset_(e){const t=this.state,i=t.fillStyle,r=t.strokeStyle,s=t.strokeOffset;return Math.abs(s)>0&&i!==void 0&&r!==void 0?(t.strokeStyle=void 0,t.strokeOffset=0,e(),t.fillStyle=void 0,t.strokeStyle=r,t.strokeOffset=s,e(),t.fillStyle=i,!0):!1}}function XR(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,u]=l.slice(-2),h=e[o+r],f=e[o+r+1],d=Math.sqrt((h-c)*(h-c)+(f-u)*(f-u));if(a+=d,a>=n){const g=(n-a+d)/d,p=Ut(c,h,g),m=Ut(u,f,g);l.push(p,m),s.push(l),l=[p,m],a==n&&(o+=r),a=0}else if(a<n)l.push(e[o+r],e[o+r+1]),o+=r;else{const g=d-a,p=Ut(c,h,g/d),m=Ut(u,f,g/d);l.push(p,m),s.push(l),l=[p,m],a=0,o+=r}}return a>0&&s.push(l),s}function UR(n,e,t,i,r){let s=t,o=t,a=0,l=0,c=t,u,h,f,d,g,p,m,y,_,v;for(h=t;h<i;h+=r){const x=e[h],w=e[h+1];g!==void 0&&(_=x-g,v=w-p,d=Math.sqrt(_*_+v*v),m!==void 0&&(l+=f,u=Math.acos((m*_+y*v)/(f*d)),u>n&&(l>a&&(a=l,s=c,o=h),l=0,c=h-r)),f=d,m=_,y=v),g=x,p=w}return l+=d,l>a?[c,h]:[s,o]}const ec={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class BR extends Ho{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[Wt]={fillStyle:Wt},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 u=null,h=e.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!it(this.maxExtent,e.getExtent()))return;let f;if(u=e.getFlatCoordinates(),c=="LineString")f=[u.length];else if(c=="MultiLineString")f=e.getEnds();else if(c=="Polygon")f=e.getEnds().slice(0,1);else if(c=="MultiPolygon"){const m=e.getEndss();f=[];for(let y=0,_=m.length;y<_;++y)f.push(m[y][0])}this.beginGeometry(e,t,i);const d=o.repeat,g=d?void 0:o.textAlign;let p=0;for(let m=0,y=f.length;m<y;++m){let _;d?_=XR(d*this.resolution,u,p,f[m],h):_=[u.slice(p,f[m])];for(let v=0,x=_.length;v<x;++v){const w=_[v];let T=0,R=w.length;if(g==null){const S=UR(o.maxAngle,w,0,w.length,2);T=S[0],R=S[1]}for(let S=T;S<R;S+=h)a.push(w[S],w[S+1]);const C=a.length;p=f[m],this.drawChars_(l,C),l=C}}this.endGeometry(t)}else{let f=o.overflow?null:[];switch(c){case"Point":case"MultiPoint":u=e.getFlatCoordinates();break;case"LineString":u=e.getFlatMidpoint();break;case"Circle":u=e.getCenter();break;case"MultiLineString":u=e.getFlatMidpoints(),h=2;break;case"Polygon":u=e.getFlatInteriorPoint(),o.overflow||f.push(u[2]/this.resolution),h=3;break;case"MultiPolygon":const x=e.getFlatInteriorPoints();u=[];for(let w=0,T=x.length;w<T;w+=3)o.overflow||f.push(x[w+2]/this.resolution),u.push(x[w],x[w+1]);if(u.length===0)return;h=2;break}const d=this.appendFlatPointCoordinates(u,h);if(d===l)return;if(f&&(d-l)/2!==u.length/h){let x=l/2;f=f.filter((w,T)=>{const R=a[(x+T)*2]===u[T*h]&&a[(x+T)*2+1]===u[T*h+1];return R||--x,R})}this.saveTextStates_();const g=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 m=o.padding;if(m!=cr&&(o.scale[0]<0||o.scale[1]<0)){let x=o.padding[0],w=o.padding[1],T=o.padding[2],R=o.padding[3];o.scale[0]<0&&(w=-w,R=-R),o.scale[1]<0&&(x=-x,T=-T),m=[x,w,T,R]}const y=this.pixelRatio;this.instructions.push([ue.DRAW_IMAGE,l,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,m==cr?cr:m.map(function(x){return x*y}),g,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]);const _=1/y,v=g?g.slice(0):null;v&&(v[1]=Wt),this.hitDetectionInstructions.push([ue.DRAW_IMAGE,l,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterMode_,this.declutterImageWithText_,m,v,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Wt:this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]),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||So,justify:t.justify,textBaseline:t.textBaseline||fl,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=ec[r.textBaseline],u=this.textOffsetY_*l,h=this.text_,f=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([ue.DRAW_CHARS,e,t,c,r.overflow,a,r.maxAngle,l,u,s,f*l,h,o,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([ue.DRAW_CHARS,e,t,c,r.overflow,a&&Wt,r.maxAngle,l,u,s,f*l,h,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=Mn(o.getColor()||Wt)):(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(),m=a.getLineDashOffset(),y=a.getWidth(),_=a.getMiterLimit();s.lineCap=a.getLineCap()||Qr,s.lineDash=p?p.slice():Hn,s.lineDashOffset=m===void 0?Jn:m,s.lineJoin=a.getLineJoin()||es,s.lineWidth=y===void 0?Io:y,s.miterLimit=_===void 0?Ro:_,s.strokeStyle=Mn(a.getColor()||An)}i=this.textState_;const l=e.getFont()||am;cb(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()||fl,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||cr,i.scale=c===void 0?[1,1]:c;const u=e.getOffsetX(),h=e.getOffsetY(),f=e.getRotateWithView(),d=e.getKeepUpright(),g=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=u===void 0?0:u,this.textOffsetY_=h===void 0?0:h,this.textRotateWithView_=f===void 0?!1:f,this.textKeepUpright_=d===void 0?!0:d,this.textRotation_=g===void 0?0:g,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:_e(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:"|"+_e(r.fillStyle):""}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}const $R={Circle:n_,Default:Ho,Image:WR,LineString:VR,Polygon:n_,Text:BR};class i_{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=$R[t];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=s}return s}}function r_(n,e,t,i,r,s,o,a){o=o??[],a=a??i;const l=n[e+i],c=n[e+i+1],u=n[t-2*i],h=n[t-2*i+1];let f,d,g,p,m,y,_,v,x=0;for(let w=e;w<t;w+=i){g=f,p=d,m=void 0,y=void 0,w+i<t&&(m=n[w+i],y=n[w+i+1]),s&&w===e&&(g=u,p=h),s&&w===t-i&&(m=l,y=c),f=n[w],d=n[w+1],[_,v]=KR(f,d,g,p,m,y,r),o[x++]=_,o[x++]=v;for(let T=2;T<a;T++)o[x++]=n[w+T]}return o.length!=x&&(o.length=x),o}function KR(n,e,t,i,r,s,o){let a,l;t!==void 0&&i!==void 0?(a=n-t,l=e-i):r!==void 0&&s!==void 0?(a=r-n,l=s-e):(a=1,l=0);const c=Math.hypot(a,l),u=a/c,h=l/c;if(a=-h,l=u,t===void 0||i===void 0)return[n+a*o,e+l*o];if(r===void 0||s===void 0)return[n+a*o,e+l*o];const f=Iv([n,e],[t,i],[r,s]);if(Math.cos(f)>.998)return[n+u*o,e+h*o];const d=Math.cos(f/2),g=Math.sin(f/2),p=g*a+d*l,m=-d*a+g*l,y=p*(1/g),_=m*(1/g);return[n+y*o,e+_*o]}function s_(n,e){for(let t=0,i=n.length-2;t<i;t+=e)for(let r=n.length-2*e;r>t+e;r-=e){const s=n[t],o=n[t+1],a=n[t+e],l=n[t+e+1],c=n[r],u=n[r+1],h=n[r+e],f=n[r+e+1],d=(f-u)*(a-s)-(h-c)*(l-o);if(d===0)continue;const g=((h-c)*(o-u)-(f-u)*(s-c))/d,p=((a-s)*(o-u)-(l-o)*(s-c))/d;if(g>0&&g<1&&p>0&&p<1){const m=s+g*(a-s),y=o+g*(l-o);n[t+e]=m,n[t+e+1]=y,n.splice(t+2*e,r-t-e);break}}return n}function YR(n,e,t,i,r,s,o,a,l,c,u,h,f=!0){let d=n[e],g=n[e+1],p=0,m=0,y=0,_=0;function v(){p=d,m=g,e+=i,d=n[e],g=n[e+1],_+=y,y=Math.sqrt((d-p)*(d-p)+(g-m)*(g-m))}do v();while(e<t-i&&_+y<s);let x=y===0?0:(s-_)/y;const w=Ut(p,d,x),T=Ut(m,g,x),R=e-i,C=_,S=s+a*l(c,r,u);for(;e<t-i&&_+y<S;)v();x=y===0?0:(S-_)/y;const L=Ut(p,d,x),B=Ut(m,g,x);let K=!1;if(f)if(h){const X=[w,T,L,B];xp(X,0,4,2,h,X,X),K=X[0]>X[2]}else K=w>L;const F=Math.PI,P=[],oe=R+i===e;e=R,y=0,_=C,d=n[e],g=n[e+1];let W;if(oe){v(),W=Math.atan2(g-m,d-p),K&&(W+=W>0?-F:F);const X=(L+w)/2,z=(B+T)/2;return P[0]=[X,z,(S-s)/2,W,r],P}r=r.replace(/\n/g," ");for(let X=0,z=r.length;X<z;){v();let M=Math.atan2(g-m,d-p);if(K&&(M+=M>0?-F:F),W!==void 0){let xe=M-W;if(xe+=xe>F?-2*F:xe<-F?2*F:0,Math.abs(xe)>o)return null}W=M;const ne=X;let le=0;for(;X<z;++X){const xe=K?z-X-1:X,he=a*l(c,r[xe],u);if(e+i<t&&_+y<s+le+he/2)break;le+=he}if(X===ne)continue;const ge=K?r.substring(z-ne,z-X):r.substring(ne,X);x=y===0?0:(s+le/2-_)/y;const ze=Ut(p,d,x),G=Ut(m,g,x);P.push([ze,G,le/2,M,ge]),s+=le}return P}const bs=Bt(),Ni=[],ri=[],si=[],zi=[];function o_(n){return n[3].declutterBox}const a_=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ-࿿-]");function Sf(n,e){return e==="start"?e=a_.test(n)?"right":"left":e==="end"&&(e=a_.test(n)?"left":"right"),ec[e]}function ZR(n,e,t){return t>0&&n.push(`
6
+ `||c===u){s=Math.max(s,o),r.push(o),o=0,a+=l,l=0;continue}const f=e[c+1]||n.font,d=um(f,h);t.push(d),o+=d;const g=ub(f);i.push(g),l=Math.max(l,g)}return{width:s,height:a,widths:t,heights:i,lineWidths:r}}function fb(n,e,t,i,r,s,o,a,l,c,u){n.save(),t!==1&&(n.globalAlpha===void 0?n.globalAlpha=h=>h.globalAlpha*=t:n.globalAlpha*=t),e&&n.transform.apply(n,e),i.contextInstructions?(n.translate(l,c),n.scale(u[0],u[1]),db(i,n)):u[0]<0||u[1]<0?(n.translate(l,c),n.scale(u[0],u[1]),n.drawImage(i,r,s,o,a,0,0,o,a)):n.drawImage(i,r,s,o,a,l,c,o*u[0],a*u[1]),n.restore()}function db(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 dl{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=Ct(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new dl({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 pe()}getImage(e){return pe()}getHitDetectionImage(){return pe()}getPixelRatio(e){return 1}getImageState(){return pe()}getImageSize(){return pe()}getOrigin(){return pe()}getSize(){return pe()}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_=Ct(e)}listenImageChange(e){pe()}load(){pe()}unlistenImageChange(e){pe()}ready(){return Promise.resolve()}}class gl extends dl{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()?re.LOADING:re.LOADED,this.imageState_===re.LOADING&&this.ready().then(()=>this.imageState_=re.LOADED),this.render()}clone(){const e=this.getScale(),t=new gl({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){const t=this.fill_?.getKey(),i=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(",");let r=Qt.get(i,null)?.getImage(1);if(!r){const s=this.renderOptions_,o=Math.ceil(s.size*e),a=Ze(o,o);this.draw_(s,a,e),r=a.canvas;const l=new om(r,void 0,null,re.LOADED,null);Qt.set(i,null,l),createImageBitmap(r).then(c=>{l.setImage(c)})}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}setRadius(e){this.radius!==e&&(this.radius=e,this.render())}getRadius2(){return this.radius2_}setRadius2(e){this.radius2_!==e&&(this.radius2_=e,this.render())}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 T=r;r=s,s=T}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),u=r-c,h=Math.sqrt(l*l+u*u),f=h/l;if(e==="miter"&&f<=i)return f*t;const d=t/2/f,g=t/2*(u/h),m=Math.sqrt((r+d)*(r+d)+g*g)-r;if(this.radius2_===void 0||e==="bevel")return m*2;const y=r*Math.sin(a),_=Math.sqrt(r*r-y*y),w=s-_,v=Math.sqrt(y*y+w*w)/y;if(v<=i){const T=v*t/2-s-r;return 2*Math.max(m,T)}return m*2}createRenderOptions(){let e=es,t=ts,i=0,r=null,s=0,o,a=0;this.stroke_&&(o=An(this.stroke_.getColor()??Pn),a=this.stroke_.getWidth()??Io,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,t=this.stroke_.getLineJoin()??ts,e=this.stroke_.getLineCap()??es,i=this.stroke_.getMiterLimit()??Ro);const l=this.calculateLineJoinSize_(t,a,i),c=Math.max(this.radius,this.radius2_||0),u=Math.ceil(2*c+l);return{strokeStyle:o,strokeWidth:a,size:u,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=Wt),t.fillStyle=An(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=ar(i)),i===null?r=1:Array.isArray(i)&&(r=i.length===4?i[3]:1),r===0&&(t=Ze(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=Wt,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 fr extends gl{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 fr({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}}class $t{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 $t({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=To(null,e.src,{crossOrigin:"anonymous"},void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then(()=>{this.patternImage_=null}),t.getImageState()===re.IDLE&&t.load(),t.getImageState()===re.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){const e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?_e(e):typeof e=="object"&&"src"in e?e.src+":"+e.offset:ar(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function fm(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 dr extends dl{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,this.referrerPolicy_=e.referrerPolicy;const o=e.img!==void 0?e.img:null;let a=e.src;Oe(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||_e(o)),Oe(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),Oe(!((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=re.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?re.LOADED:re.IDLE:l=re.LOADING:l=re.LOADED),this.color_=e.color!==void 0?ar(e.color):null,this.iconImage_=To(o,a,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},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,u;if(e.size)[c,u]=e.size;else{const h=this.getImage(1);if(h.width&&h.height)c=h.width,u=h.height;else if(h instanceof HTMLImageElement){this.initialOptions_=e;const f=()=>{if(this.unlistenImageChange(f),!this.initialOptions_)return;const d=this.iconImage_.getSize();this.setScale(fm(d[0],d[1],e.width,e.height))};this.listenImageChange(f);return}}c!==void 0&&this.setScale(fm(c,u,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 dr({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_,referrerPolicy:this.referrerPolicy_,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_}setColor(e){const t=e?ar(e):null;if(this.color_===t||this.color_&&t&&this.color_.length===t.length&&this.color_.every((o,a)=>o===t[a]))return;this.color_=t;const i=this.getSrc(),r=i!==void 0?null:this.getHitDetectionImage(),s=i!==void 0?re.IDLE:this.iconImage_.getImageState();this.iconImage_=To(r,i,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},s,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_=To(null,e,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},re.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()==re.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()==re.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(de.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(de.CHANGE,e)}ready(){return this.iconImage_.ready()}}class dn{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.offset_=e.offset,this.width_=e.width}clone(){const e=this.getColor();return new dn({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(),offset:this.getOffset(),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_}getOffset(){return this.offset_}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}setOffset(e){this.offset_=e}setWidth(e){this.width_=e}}class yt{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=gm,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 yt({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_=gm,this.geometry_=e}setZIndex(e){this.zIndex_=e}}function gb(n){let e;if(typeof n=="function")e=n;else{let t;Array.isArray(n)?t=n:(Oe(typeof n.getZIndex=="function","Expected an `Style` or an array of `Style`"),t=[n]),e=function(){return t}}return e}let xh=null;function dm(n,e){if(!xh){const t=new $t({color:"rgba(255,255,255,0.4)"}),i=new dn({color:"#3399CC",width:1.25});xh=[new yt({image:new fr({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return xh}function gm(n){return n.getGeometry()}const pb="#333";class Ao{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_=Ct(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 $t({color:pb}),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 Ao({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 $t?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_=Ct(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 mb(n){return!0}function yb(n){const e=em(),t=_b(n,e),i=sm();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=rm(r.getGeometry())),t(i)}}function pm(n){const e=em(),t=n.length,i=new Array(t);for(let o=0;o<t;++o)i[o]=vh(n[o],e);const r=sm(),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 u=i[c](r);u&&(s[l]=u,l+=1)}return s.length=l,s}}function _b(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?Mn(s.filter,At,e):mb;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]=vh(s.style[c],e)}else a=[vh(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 u=c(r);u&&s.push(u)}}}return s}}function vh(n,e){const t=Po(n,"",e),i=Fo(n,"",e),r=xb(n,e),s=vb(n,e),o=_t(n,"z-index",e);if(!t&&!i&&!r&&!s&&!mi(n))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(n));const a=new yt;return function(l){let c=!0;if(t){const u=t(l);u&&(c=!1),a.setFill(u)}if(i){const u=i(l);u&&(c=!1),a.setStroke(u)}if(r){const u=r(l);u&&(c=!1),a.setText(u)}if(s){const u=s(l);u&&(c=!1),a.setImage(u)}return o&&a.setZIndex(o(l)),c?null:a}}function Po(n,e,t){let i;if(e+"fill-pattern-src"in n)i=Cb(n,e+"fill-",t);else{if(n[e+"fill-color"]==="none")return s=>null;i=pl(n,e+"fill-color",t)}if(!i)return null;const r=new $t;return function(s){const o=i(s);return o===oh?null:(r.setColor(o),r)}}function Fo(n,e,t){const i=_t(n,e+"stroke-width",t),r=pl(n,e+"stroke-color",t);if(!i&&!r)return null;const s=ti(n,e+"stroke-line-cap",t),o=ti(n,e+"stroke-line-join",t),a=mm(n,e+"stroke-line-dash",t),l=_t(n,e+"stroke-line-dash-offset",t),c=_t(n,e+"stroke-miter-limit",t),u=_t(n,e+"stroke-offset",t),h=new dn;return function(f){if(r){const d=r(f);if(d===oh)return null;h.setColor(d)}if(i&&h.setWidth(i(f)),s){const d=s(f);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(f);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(f)),l&&h.setLineDashOffset(l(f)),c&&h.setMiterLimit(c(f)),u&&h.setOffset(u(f)),h}}function xb(n,e){const t="text-",i=ti(n,t+"value",e);if(!i)return null;const r=Po(n,t,e),s=Po(n,t+"background-",e),o=Fo(n,t,e),a=Fo(n,t+"background-",e),l=ti(n,t+"font",e),c=_t(n,t+"max-angle",e),u=_t(n,t+"offset-x",e),h=_t(n,t+"offset-y",e),f=ns(n,t+"overflow",e),d=ti(n,t+"placement",e),g=_t(n,t+"repeat",e),p=yl(n,t+"scale",e),m=ns(n,t+"rotate-with-view",e),y=_t(n,t+"rotation",e),_=ti(n,t+"align",e),w=ti(n,t+"justify",e),x=ti(n,t+"baseline",e),v=ns(n,t+"keep-upright",e),T=mm(n,t+"padding",e),R=_l(n,t+"declutter-mode"),C=new Ao({declutterMode:R});return function(S){if(C.setText(i(S)),r&&C.setFill(r(S)),s&&C.setBackgroundFill(s(S)),o&&C.setStroke(o(S)),a&&C.setBackgroundStroke(a(S)),l&&C.setFont(l(S)),c&&C.setMaxAngle(c(S)),u&&C.setOffsetX(u(S)),h&&C.setOffsetY(h(S)),f&&C.setOverflow(f(S)),d){const L=d(S);if(L!=="point"&&L!=="line")throw new Error("Expected point or line for text-placement");C.setPlacement(L)}if(g&&C.setRepeat(g(S)),p&&C.setScale(p(S)),m&&C.setRotateWithView(m(S)),y&&C.setRotation(y(S)),_){const L=_(S);if(L!=="left"&&L!=="center"&&L!=="right"&&L!=="end"&&L!=="start")throw new Error("Expected left, right, center, start, or end for text-align");C.setTextAlign(L)}if(w){const L=w(S);if(L!=="left"&&L!=="right"&&L!=="center")throw new Error("Expected left, right, or center for text-justify");C.setJustify(L)}if(x){const L=x(S);if(L!=="bottom"&&L!=="top"&&L!=="middle"&&L!=="alphabetic"&&L!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");C.setTextBaseline(L)}return T&&C.setPadding(T(S)),v&&C.setKeepUpright(v(S)),C}}function vb(n,e){return"icon-src"in n?wb(n,e):"shape-points"in n?Eb(n,e):"circle-radius"in n?bb(n,e):null}function wb(n,e){const t="icon-",i=t+"src",r=vm(n[i],i),s=ml(n,t+"anchor",e),o=yl(n,t+"scale",e),a=_t(n,t+"opacity",e),l=ml(n,t+"displacement",e),c=_t(n,t+"rotation",e),u=ns(n,t+"rotate-with-view",e),h=_m(n,t+"anchor-origin"),f=xm(n,t+"anchor-x-units"),d=xm(n,t+"anchor-y-units"),g=ei(n,t+"color");let p,m=null;g!==void 0&&(Array.isArray(g)&&g.length>0&&typeof g[0]=="string"?m=pl(n,t+"color",e):p=wm(g,t+"color"));const y=Rb(n,t+"cross-origin"),_=Sb(n,t+"offset"),w=_m(n,t+"offset-origin"),x=wh(n,t+"width"),v=wh(n,t+"height"),T=Tb(n,t+"size"),R=_l(n,t+"declutter-mode"),C={src:r,anchorOrigin:h,anchorXUnits:f,anchorYUnits:d,crossOrigin:y,offset:_,offsetOrigin:w,height:v,width:x,size:T,declutterMode:R};let S=null;return function(L){if(S)m&&S.setColor(m(L));else{const B=m?m(L):p;S=new dr(B!==void 0?Object.assign({},C,{color:B}):Object.assign({},C))}return a&&S.setOpacity(a(L)),l&&S.setDisplacement(l(L)),c&&S.setRotation(c(L)),u&&S.setRotateWithView(u(L)),o&&S.setScale(o(L)),s&&S.setAnchor(s(L)),S}}function Eb(n,e){const t="shape-",i=t+"points",r=t+"radius",s=Eh(n[i],i);if(!(r in n))throw new Error(`Expected a number for ${r}`);const o=_t(n,r,e),a=typeof n[r]=="number"?n[r]:5,l=t+"radius2",c=_t(n,l,e),u=typeof n[l]=="number"?n[l]:void 0,h=Po(n,t,e),f=Fo(n,t,e),d=yl(n,t+"scale",e),g=ml(n,t+"displacement",e),p=_t(n,t+"rotation",e),m=ns(n,t+"rotate-with-view",e),y=wh(n,t+"angle"),_=_l(n,t+"declutter-mode"),w=new gl({points:s,radius:a,radius2:u,angle:y,declutterMode:_});return function(x){return o&&w.setRadius(o(x)),c&&w.setRadius2(c(x)),h&&w.setFill(h(x)),f&&w.setStroke(f(x)),g&&w.setDisplacement(g(x)),p&&w.setRotation(p(x)),m&&w.setRotateWithView(m(x)),d&&w.setScale(d(x)),w}}function bb(n,e){const t="circle-",i=Po(n,t,e),r=Fo(n,t,e),s=_t(n,t+"radius",e),o=yl(n,t+"scale",e),a=ml(n,t+"displacement",e),l=_t(n,t+"rotation",e),c=ns(n,t+"rotate-with-view",e),u=_l(n,t+"declutter-mode"),h=new fr({radius:5,declutterMode:u});return function(f){return s&&h.setRadius(s(f)),i&&h.setFill(i(f)),r&&h.setStroke(r(f)),a&&h.setDisplacement(a(f)),l&&h.setRotation(l(f)),c&&h.setRotateWithView(c(f)),o&&h.setScale(o(f)),h}}function ei(n,e){if(!(e in n))return;const t=n[e];return t===void 0?void 0:t}function _t(n,e,t){const i=ei(n,e);if(i===void 0)return;const r=Mn(i,Re,t);return function(s){return Eh(r(s),e)}}function ti(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=Mn(i,jt,t);return function(s){return vm(r(s),e)}}function Cb(n,e,t){const i=ti(n,e+"pattern-src",t),r=ym(n,e+"pattern-offset",t),s=ym(n,e+"pattern-size",t),o=pl(n,e+"color",t);return function(a){return{src:i(a),offset:r&&r(a),size:s&&s(a),color:o&&o(a)}}}function ns(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=Mn(i,At,t);return function(s){const o=r(s);if(typeof o!="boolean")throw new Error(`Expected a boolean for ${e}`);return o}}function pl(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=Mn(i,hn,t);return function(s){return wm(r(s),e)}}function mm(n,e,t){const i=ei(n,e);if(i===void 0)return null;if(Array.isArray(i)&&(i.length===0||typeof i[0]!="string")){const s=i.map((o,a)=>{if(typeof o=="number")return()=>o;const l=Mn(o,Re,t);return function(c){return Eh(l(c),`${e}[${a}]`)}});return function(o){const a=new Array(s.length);for(let l=0;l<s.length;++l)a[l]=s[l](o);return a}}const r=Mn(i,cr,t);return function(s){return Oo(r(s),e)}}function ml(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=Mn(i,cr,t);return function(s){const o=Oo(r(s),e);if(o.length!==2)throw new Error(`Expected two numbers for ${e}`);return o}}function ym(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=Mn(i,cr,t);return function(s){return Em(r(s),e)}}function yl(n,e,t){const i=ei(n,e);if(i===void 0)return null;const r=Mn(i,cr|Re,t);return function(s){return Ib(r(s),e)}}function wh(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 Tb(n,e){const t=n[e];if(t!==void 0){if(typeof t=="number")return Ct(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 Rb(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 _m(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 xm(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 Sb(n,e){const t=n[e];if(t!==void 0)return Oo(t,e)}function _l(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 Oo(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 vm(n,e){if(typeof n!="string")throw new Error(`Expected a string for ${e}`);return n}function Eh(n,e){if(typeof n!="number")throw new Error(`Expected a number for ${e}`);return n}function wm(n,e){if(typeof n=="string")return n;const t=Oo(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 Em(n,e){const t=Oo(n,e);if(t.length!==2)throw new Error(`Expected an array of two numbers for ${e}`);return t}function Ib(n,e){return typeof n=="number"?n:Em(n,e)}const bm={RENDER_ORDER:"renderOrder"};class bh extends qr{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(bm.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 Zp(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(bm.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?dm:e;const t=Mb(e);this.styleFunction_=e===null?void 0:gb(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}}function Mb(n){if(n===void 0)return dm;if(!n)return null;if(typeof n=="function"||n instanceof yt)return n;if(!Array.isArray(n))return pm([n]);if(n.length===0)return[];const e=n.length,t=n[0];if(t instanceof yt){const r=new Array(e);for(let s=0;s<e;++s){const o=n[s];if(!(o instanceof yt))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 yb(r)}return pm(n)}class Cm extends an{constructor(e,t,i,r){super(e),this.inversePixelTransform=t,this.frameState=i,this.context=r}}class Ab extends Hs{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){pe()}calculateMatrices2D(e){const t=e.viewState,i=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;In(i,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),_p(r,i)}forEachFeatureAtCoordinate(e,t,i,r,s,o,a,l){let c;const u=t.viewState;function h(x,v,T,R){return s.call(o,v,x?T:null,R)}const f=u.projection,d=du(e.slice(),f),g=[[0,0]];if(f.canWrapX()&&r){const x=f.getExtent(),v=Se(x);g.push([-v,0],[v,0])}const p=t.layerStatesArray,m=p.length,y=[],_=[];for(let x=0;x<g.length;x++)for(let v=m-1;v>=0;--v){const T=p[v],R=T.layer;if(R.hasRenderer()&&ih(T,u)&&a.call(l,R)){const C=R.getRenderer(),S=R.getSource();if(C&&S){const L=S.getWrapX()?d:e,B=h.bind(null,T.managed);_[0]=L[0]+g[x][0],_[1]=L[1]+g[x][1],c=C.forEachFeatureAtCoordinate(_,t,i,B,y)}if(c)return c}}if(y.length===0)return;const w=1/y.length;return y.forEach((x,v)=>x.distanceSq+=v*w),y.sort((x,v)=>x.distanceSq-v.distanceSq),y.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,Js,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(e){pe()}scheduleExpireIconCache(e){Qt.canExpireCache()&&e.postRenderFunctions.push(Pb)}}function Pb(n,e){Qt.expire()}class Fb extends Ab{constructor(e){super(e),this.fontChangeListenerKey_=Te(hr,Nr.PROPERTYCHANGE,e.redrawText,e),this.element_=wt?Wp():document.createElement("div");const t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=sl+" 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 Cm(e,void 0,t);i.dispatchEvent(r)}}disposeInternal(){We(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Jt.PRECOMPOSE,e);const t=e.layerStatesArray.sort((c,u)=>c.zIndex-u.zIndex);t.some(c=>c.layer instanceof bh&&c.layer.getDeclutter())&&(e.declutter={});const r=e.viewState;this.children_.length=0;const s=[];let o=null;for(let c=0,u=t.length;c<u;++c){const h=t[c];e.layerIndex=c;const f=h.layer,d=f.getSourceState();if(!ih(h,r)||d!="ready"&&d!="undefined"){f.unrender();continue}const g=f.render(e,o);g&&(g!==o&&(this.children_.push(g),o=g),s.push(h))}this.declutter(e,s),jw(this.element_,this.children_);const l=this.getMap().getTargetElement();if(Ri(l)){const c=l.getContext("2d");for(const u of this.children_){const h=u.firstElementChild||u,f=u.style.backgroundColor;if(f&&(!Ri(h)||h.width>0)&&(c.fillStyle=f,c.fillRect(0,0,l.width,l.height)),Ri(h)&&h.width>0){c.save();const d=u.style.opacity||h.style.opacity;c.globalAlpha=d===""?1:Number(d);const g=h.style.transform;if(g)c.transform(...Mu(g));else{const p=parseFloat(h.style.width)/h.width,m=parseFloat(h.style.height)/h.height;c.transform(p,0,0,m,0,0)}c.drawImage(h,0,0),c.restore()}}}this.dispatchRenderEvent(Jt.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 Tm(n){if(n instanceof qr){n.setMapInternal(null);return}n instanceof Mi&&n.getLayers().forEach(Tm)}function Rm(n,e){if(n instanceof qr){n.setMapInternal(e);return}if(n instanceof Mi){const t=n.getLayers().getArray();for(let i=0,r=t.length;i<r;++i)Rm(t[i],e)}}let is=class extends Sn{constructor(e){super(),e=e||{},this.on,this.once,this.un;const t=Ob(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:fv,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Gt(),this.pixelToCoordinateTransform_=Gt(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,wt||(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,wt||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=t.controls||(wt?new Zt:Uw()),this.interactions=t.interactions||(wt?new Zt:dE({onFocusOnly:!0})),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new jg(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Et.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Et.VIEW,this.handleViewChanged_),this.addChangeListener(Et.SIZE,this.handleSizeChanged_),this.addChangeListener(Et.TARGET,this.handleTargetChanged_),this.setProperties(t.values);const i=this;e.view&&!(e.view instanceof un)&&e.view.then(function(r){i.setView(new un(r))}),this.controls.addEventListener(Nt.ADD,r=>{r.element.setMap(this)}),this.controls.addEventListener(Nt.REMOVE,r=>{r.element.setMap(null)}),this.interactions.addEventListener(Nt.ADD,r=>{r.element.setMap(this)}),this.interactions.addEventListener(Nt.REMOVE,r=>{r.element.setMap(null)}),this.overlays_.addEventListener(Nt.ADD,r=>{this.addOverlayInternal_(r.element)}),this.overlays_.addEventListener(Nt.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){Rm(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){const t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_?.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,i){if(!this.frameState_||!this.renderer_)return;const r=this.getCoordinateFromPixelInternal(e);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:Js,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 Mi?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:Js,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(Et.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return Tu(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){const t=this.frameState_;return t?lt(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(Et.LAYERGROUP)}setLayers(e){const t=this.getLayerGroup();if(e instanceof Zt){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=Yn(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){const t=this.frameState_;return t?lt(t.coordinateToPixelTransform,e.slice(0,2)):null}getPixelRatio(){return this.pixelRatio_}setPixelRatio(e){this.pixelRatio_!==e&&(this.pixelRatio_=e,this.render())}getRenderer(){return this.renderer_}getSize(){return this.get(Et.SIZE)}getView(){return this.get(Et.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 mv(this.frameState_,e,t,i,r)}handleBrowserEvent(e,t){t=t||e.type;const i=new _i(t,this,e);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(e){if(!this.frameState_)return;const t=e.originalEvent,i=t.type;if(i===ru.POINTERDOWN||i===de.WHEEL||i===de.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;const o=e?e.viewHints:void 0,a=o?o[Ke.ANIMATING]||o[Ke.INTERACTING]:!1;if(a){const l=Date.now()-e.time>8;r=l?0:8,s=l?0:2}t.getTilesLoading()<r&&(a&&t.reprioritize(),t.loadMoreTiles(r,s))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener(Jt.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Jt.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new Gr(xi.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new Gr(xi.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_(){if(this.mapBrowserEventHandler_){for(let i=0,r=this.targetChangeHandlerKeys_.length;i<r;++i)We(this.targetChangeHandlerKeys_[i]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(de.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(de.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!Ri(this.targetElement_)){this.resizeObserver_?.unobserve(this.targetElement_);const i=this.targetElement_.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.unobserve(i.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(Ri(t)||t.appendChild(this.viewport_),this.renderer_||(this.renderer_=new Fb(this)),!Ri(t)){this.mapBrowserEventHandler_=new gv(this,this.moveTolerance_);for(const r in nt)this.mapBrowserEventHandler_.addEventListener(nt[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(de.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(de.WHEEL,this.boundHandleBrowserEvent_,Gg?{passive:!1}:!1);let i;if(this.keyboardEventTarget_)i=this.keyboardEventTarget_;else{const r=t.getRootNode();i=r instanceof ShadowRoot?r.host:t}if(this.targetChangeHandlerKeys_=[Te(i,de.KEYDOWN,this.handleBrowserEvent,this),Te(i,de.KEYPRESS,this.handleBrowserEvent,this)],t instanceof HTMLElement){const r=t.getRootNode();r instanceof ShadowRoot&&this.resizeObserver_.observe(r.host),this.resizeObserver_?.observe(t)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(We(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(We(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=Te(e,Nr.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Te(e,de.CHANGE,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(We),this.layerGroupPropertyListenerKeys_=null);const e=this.getLayerGroup();e&&(this.handleLayerAdd_(new Ii("addlayer",e)),this.layerGroupPropertyListenerKeys_=[Te(e,Nr.PROPERTYCHANGE,this.render,this),Te(e,de.CHANGE,this.render,this),Te(e,"addlayer",this.handleLayerAdd_,this),Te(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){Tm(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&&Qp(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:Xa(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:_e(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;s.nextExtent=Xa(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_||!Ei(this.previousExtent_)&&!$n(s.extent,this.previousExtent_))&&(this.dispatchEvent(new Gr(xi.MOVESTART,this,r)),this.previousExtent_=Wr(this.previousExtent_)),this.previousExtent_&&!s.viewHints[Ke.ANIMATING]&&!s.viewHints[Ke.INTERACTING]&&!$n(s.extent,this.previousExtent_)&&(this.dispatchEvent(new Gr(xi.MOVEEND,this,s)),Xg(s.extent,this.previousExtent_))),this.dispatchEvent(new Gr(xi.POSTRENDER,this,s)),this.renderComplete_=(this.hasListener(xi.LOADSTART)||this.hasListener(xi.LOADEND)||this.hasListener(Jt.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 Ii("removelayer",t)),this.set(Et.LAYERGROUP,e)}setSize(e){this.set(Et.SIZE,e)}setTarget(e){this.set(Et.TARGET,e)}setView(e){if(!e||e instanceof un){this.set(Et.VIEW,e);return}this.set(Et.VIEW,new un);const t=this;e.then(function(i){t.setView(new un(i))})}updateSize(){const e=this.getTargetElement();let t;if(e){let r,s;if(Ri(e)){const o=e.getContext("2d").getTransform();r=e.width/o.a,s=e.height/o.d}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)],!Qp(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&tp("No map visible because the map container's width or height are 0."))}const i=this.getSize();t&&(!i||!yi(t,i))&&(this.updateViewportSize_(t),this.setSize(t))}updateViewportSize_(e){const t=this.getView();t&&t.setViewportSize(e)}};function Ob(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 Mi({layers:n.layers});t[Et.LAYERGROUP]=i,t[Et.TARGET]=n.target,t[Et.VIEW]=n.view instanceof un?n.view:new un;let r;n.controls!==void 0&&(Array.isArray(n.controls)?r=new Zt(n.controls.slice()):(Oe(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 Zt(n.interactions.slice()):(Oe(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 Zt(n.overlays.slice()):(Oe(typeof n.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=n.overlays):o=new Zt,{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:t}}function Sm(n,e){return sd()?(D0(n,e),!0):!1}function Ch(){const n=new Set,e=s=>{n.delete(s)};return{on:s=>{n.add(s);const o=()=>e(s);return Sm(o),{off:o}},off:e,trigger:(...s)=>Promise.all(Array.from(n).map(o=>o(...s))),clear:()=>{n.clear()}}}const Im=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Lb=()=>{};function Th(...n){if(n.length!==1)return wa(...n);const e=n[0];return typeof e=="function"?_a(sx(()=>({get:e,set:Lb}))):kc(e)}function Mm(n,e=!1,t="Timeout"){return new Promise((i,r)=>{e?setTimeout(r,n,t):setTimeout(i,n)})}function Db(n,...e){return e.some(t=>t in n)}function Rh(n,e=!1){function t(h,{flush:f="sync",deep:d=!1,timeout:g,throwOnTimeout:p}={}){let m=null;const y=[new Promise(_=>{m=pi(n,w=>{h(w)!==e&&(m?m():zc(()=>m?.()),_(w))},{flush:f,deep:d,immediate:!0})})];return g!=null&&y.push(Mm(g,p).then(()=>fi(n)).finally(()=>m?.())),Promise.race(y)}function i(h,f){if(!tt(h))return t(w=>w===h,f);const{flush:d="sync",deep:g=!1,timeout:p,throwOnTimeout:m}=f??{};let y=null;const _=[new Promise(w=>{y=pi([n,h],([x,v])=>{e!==(x===v)&&(y?y():zc(()=>y?.()),w(x))},{flush:d,deep:g,immediate:!0})})];return p!=null&&_.push(Mm(p,m).then(()=>fi(n)).finally(()=>(y?.(),fi(n)))),Promise.race(_)}function r(h){return t(f=>!!f,h)}function s(h){return i(null,h)}function o(h){return i(void 0,h)}function a(h){return t(Number.isNaN,h)}function l(h,f){return t(d=>{const g=Array.from(d);return g.includes(h)||g.includes(fi(h))},f)}function c(h){return u(1,h)}function u(h=1,f){let d=-1;return t(()=>(d+=1,d>=h),f)}return Array.isArray(fi(n))?{toMatch:t,toContains:l,changed:c,changedTimes:u,get not(){return Rh(n,!e)}}:{toMatch:t,toBe:i,toBeTruthy:r,toBeNull:s,toBeNaN:a,toBeUndefined:o,changed:c,changedTimes:u,get not(){return Rh(n,!e)}}}function kb(n){return Rh(n)}function Nb(n,e,t={}){const{immediate:i=!0,immediateCallback:r=!1}=t,s=hi(!1);let o;function a(){o&&(clearTimeout(o),o=void 0)}function l(){s.value=!1,a()}function c(...u){r&&n(),a(),s.value=!0,o=setTimeout(()=>{s.value=!1,o=void 0,n(...u)},fi(e))}return i&&(s.value=!0,Im&&c()),Sm(l),{isPending:Dc(s),start:c,stop:l}}const Sh=Im?window:void 0,zb={json:"application/json",text:"text/plain"};function Am(n){return n&&Db(n,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch","updateDataOnError")}function Ih(n){return typeof Headers<"u"&&n instanceof Headers?Object.fromEntries(n.entries()):n}function Gb(n,...e){var t,i;const r=typeof AbortController=="function";let s={},o={immediate:!0,refetch:!1,timeout:0,updateDataOnError:!1};const a={method:"GET",type:"text",payload:void 0};e.length>0&&(Am(e[0])?o={...o,...e[0]}:s=e[0]),e.length>1&&Am(e[1])&&(o={...o,...e[1]});const{fetch:l=(t=Sh?.fetch)!==null&&t!==void 0?t:(i=globalThis)===null||i===void 0?void 0:i.fetch,initialData:c,timeout:u}=o,h=Ch(),f=Ch(),d=Ch(),g=hi(!1),p=hi(!1),m=hi(!1),y=hi(null),_=hi(null),w=hi(null),x=hi(c||null),v=Yi(()=>r&&p.value);let T,R;const C=X=>{r&&(T?.abort(X),T=new AbortController,T.signal.onabort=()=>m.value=!0,s={...s,signal:T.signal})},S=X=>{p.value=X,g.value=!X};u&&(R=Nb(C,u,{immediate:!1}));let L=0;const B=async(X=!1)=>{var z;C(),S(!0),w.value=null,y.value=null,m.value=!1,L+=1;const M=L,ne={method:a.method,headers:{}},le=fi(a.payload);if(le){var ge;const he=Ih(ne.headers),Ie=Object.getPrototypeOf(le);!a.payloadType&&le&&(Ie===Object.prototype||Array.isArray(Ie))&&!(le instanceof FormData)&&(a.payloadType="json"),a.payloadType&&(he["Content-Type"]=(ge=zb[a.payloadType])!==null&&ge!==void 0?ge:a.payloadType),ne.body=a.payloadType==="json"?JSON.stringify(le):le}let ze=!1;const G={url:fi(n),options:{...ne,...s},cancel:()=>{ze=!0}};if(o.beforeFetch&&Object.assign(G,await o.beforeFetch(G)),ze||!l)return S(!1),Promise.resolve(null);let xe=null;return R&&R.start(),l(G.url,{...ne,...G.options,headers:{...Ih(ne.headers),...Ih((z=G.options)===null||z===void 0?void 0:z.headers)}}).then(async he=>{if(_.value=he,y.value=he.status,xe=await he.clone()[a.type](),!he.ok)throw x.value=c||null,new Error(he.statusText);return o.afterFetch&&({data:xe}=await o.afterFetch({data:xe,response:he,context:G,execute:B})),x.value=xe,h.trigger(he),he}).catch(async he=>{let Ie=he.message||he.name;if(o.onFetchError&&({error:Ie,data:xe}=await o.onFetchError({data:xe,error:he,response:_.value,context:G,execute:B})),w.value=Ie,o.updateDataOnError&&(x.value=xe),f.trigger(he),X)throw he;return null}).finally(()=>{M===L&&S(!1),R&&R.stop(),d.trigger(null)})},K=Th(o.refetch);pi([K,Th(n)],([X])=>X&&B(),{deep:!0});const F={isFinished:Dc(g),isFetching:Dc(p),statusCode:y,response:_,error:w,data:x,canAbort:v,aborted:m,abort:C,execute:B,onFetchResponse:h.on,onFetchError:f.on,onFetchFinally:d.on,get:P("GET"),put:P("PUT"),post:P("POST"),delete:P("DELETE"),patch:P("PATCH"),head:P("HEAD"),options:P("OPTIONS"),json:W("json"),text:W("text"),blob:W("blob"),arrayBuffer:W("arrayBuffer"),formData:W("formData")};function P(X){return(z,M)=>{if(!p.value)return a.method=X,a.payload=z,a.payloadType=M,tt(a.payload)&&pi([K,Th(a.payload)],([ne])=>ne&&B(),{deep:!0}),{...F,then(ne,le){return oe().then(ne,le)}}}}function oe(){return new Promise((X,z)=>{kb(g).toBe(!0).then(()=>X(F)).catch(z)})}function W(X){return()=>{if(!p.value)return a.type=X,{...F,then(z,M){return oe().then(z,M)}}}}return o.immediate&&Promise.resolve().then(()=>B()),{...F,then(X,z){return oe().then(X,z)}}}class Lo extends eo{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(de.CHANGE)}release(){this.setState(J.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==J.EMPTY){if(this.state!==J.ERROR&&this.state>e)throw new Error("Tile load sequence violation");this.state=e,this.changed()}}load(){pe()}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:Qg(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()}}function Mh(n){return n instanceof Image||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement||n instanceof ImageBitmap?n:null}const jb=new Error("disposed"),Wb=[256,256];class Pm extends Lo{constructor(e){const t=J.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=Mh(this.data_);return e?[e.width,e.height]:Wb}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==J.IDLE&&this.state!==J.ERROR)return;this.state=J.LOADING,this.changed();const e=this;this.loader_().then(function(t){e.data_=t,e.state=J.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=J.ERROR,e.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(jb),this.controller_=null),super.disposeInternal()}}class Fm extends Lo{constructor(e,t,i,r,s,o){super(e,t,o),this.crossOrigin_=r?.crossOrigin,this.referrerPolicy_=r?.referrerPolicy,this.src_=i,this.key=i,this.image_,wt?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(e){this.image_=e,this.state=J.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}getReferrerPolicy(){return this.referrerPolicy_}handleImageError_(){this.state=J.ERROR,this.unlistenImage_(),this.image_=Vb(),this.changed()}handleImageLoad_(){if(wt)this.state=J.LOADED;else{const e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=J.LOADED:this.state=J.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==J.ERROR&&(this.state=J.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.state==J.IDLE&&(this.state=J.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=tb(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 Vb(){const n=Ze(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}class Ah{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 rs(n,e,t,i,r){return r!==void 0?(r.minX=n,r.maxX=e,r.minY=t,r.maxY=i,r):new Ah(n,e,t,i)}let Ph;const ss=[];function Om(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 Fh(n,e){return Math.abs(n[e*4]-210)>2||Math.abs(n[e*4+3]-191.25)>2}function Xb(){if(Ph===void 0){const n=Ze(6,6,ss);n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",Om(n,4,5,4,0),Om(n,4,5,0,5);const e=n.getImageData(0,0,3,3).data;Ph=Fh(e,0)||Fh(e,4)||Fh(e,8),uo(n),ss.push(n.canvas)}return Ph}function Oh(n,e,t,i){const r=so(t,e,n);let s=wu(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||Ji(l,r)){const c=wu(n,s,r)/s;isFinite(c)&&c>0&&(s/=c)}return s}function Ub(n,e,t,i){const r=zt(t);let s=Oh(n,e,r,i);return(!isFinite(s)||s<=0)&&$g(t,function(o){return s=Oh(n,e,o,i),isFinite(s)&&s>0}),s}function Lm(n,e,t,i,r,s,o,a,l,c,u,h,f,d){const g=Ze(Math.round(t*n),Math.round(t*e),ss);if(h||(g.imageSmoothingEnabled=!1),l.length===0)return g.canvas;g.scale(t,t);function p(v){return Math.round(v*t)/t}g.globalCompositeOperation="lighter";const m=Bt();l.forEach(function(v,T,R){Ug(m,v.extent)});let y;const _=t/i,w=(h?1:1+Math.pow(2,-24))/_;if(!f||l.length!==1||c!==0){if(y=Ze(Math.round(Se(m)*_),Math.round(ot(m)*_),ss),h||(y.imageSmoothingEnabled=!1),r&&d){const v=(r[0]-m[0])*_,T=-(r[3]-m[3])*_,R=Se(r)*_,C=ot(r)*_;y.rect(v,T,R,C),y.clip()}l.forEach(function(v,T,R){if(v.image.width>0&&v.image.height>0){if(v.clipExtent){y.save();const K=(v.clipExtent[0]-m[0])*_,F=-(v.clipExtent[3]-m[3])*_,P=Se(v.clipExtent)*_,oe=ot(v.clipExtent)*_;y.rect(h?K:Math.round(K),h?F:Math.round(F),h?P:Math.round(K+P)-Math.round(K),h?oe:Math.round(F+oe)-Math.round(F)),y.clip()}const C=(v.extent[0]-m[0])*_,S=-(v.extent[3]-m[3])*_,L=Se(v.extent)*_,B=ot(v.extent)*_;y.drawImage(v.image,c,c,v.image.width-2*c,v.image.height-2*c,h?C:Math.round(C),h?S:Math.round(S),h?L:Math.round(C+L)-Math.round(C),h?B:Math.round(S+B)-Math.round(S)),v.clipExtent&&y.restore()}})}const x=Kn(o);return a.getTriangles().forEach(function(v,T,R){const C=v.source,S=v.target;let L=C[0][0],B=C[0][1],K=C[1][0],F=C[1][1],P=C[2][0],oe=C[2][1];const W=p((S[0][0]-x[0])/s),X=p(-(S[0][1]-x[1])/s),z=p((S[1][0]-x[0])/s),M=p(-(S[1][1]-x[1])/s),ne=p((S[2][0]-x[0])/s),le=p(-(S[2][1]-x[1])/s),ge=L,ze=B;L=0,B=0,K-=ge,F-=ze,P-=ge,oe-=ze;const G=[[K,F,0,0,z-W],[P,oe,0,0,ne-W],[0,0,K,F,M-X],[0,0,P,oe,le-X]],xe=_v(G);if(!xe)return;if(g.save(),g.beginPath(),Xb()||!h){g.moveTo(z,M);const Ie=4,Pe=W-z,ie=X-M;for(let k=0;k<Ie;k++)g.lineTo(z+p((k+1)*Pe/Ie),M+p(k*ie/(Ie-1))),k!=Ie-1&&g.lineTo(z+p((k+1)*Pe/Ie),M+p((k+1)*ie/(Ie-1)));g.lineTo(ne,le)}else g.moveTo(z,M),g.lineTo(W,X),g.lineTo(ne,le);g.clip(),g.transform(xe[0],xe[2],xe[1],xe[3],W,X),g.translate(m[0]-ge,m[3]-ze);let he;if(y)he=y.canvas,g.scale(w,-w);else{const Ie=l[0],Pe=Ie.extent;he=Ie.image,g.scale(Se(Pe)/he.width,-ot(Pe)/he.height)}g.drawImage(he,0,0),g.restore()}),y&&(uo(y),ss.push(y.canvas)),u&&(g.save(),g.globalCompositeOperation="source-over",g.strokeStyle="black",g.lineWidth=1,a.getTriangles().forEach(function(v,T,R){const C=v.target,S=(C[0][0]-x[0])/s,L=-(C[0][1]-x[1])/s,B=(C[1][0]-x[0])/s,K=-(C[1][1]-x[1])/s,F=(C[2][0]-x[0])/s,P=-(C[2][1]-x[1])/s;g.beginPath(),g.moveTo(B,K),g.lineTo(S,L),g.lineTo(F,P),g.closePath(),g.stroke()}),g.restore()),g.canvas}const Bb=10,Dm=.25;class km{constructor(e,t,i,r,s,o,a){this.sourceProj_=e,this.targetProj_=t;let l={};const c=a?rw(w=>lt(a,so(w,this.targetProj_,this.sourceProj_))):tr(this.targetProj_,this.sourceProj_);this.transformInv_=function(w){const x=w[0]+"/"+w[1];return l[x]||(l[x]=c(w)),l[x]},this.maxSourceExtent_=r,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&Se(r)>=Se(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Se(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Se(this.targetProj_.getExtent()):null;const u=Kn(i),h=Ua(i),f=Va(i),d=Wa(i),g=this.transformInv_(u),p=this.transformInv_(h),m=this.transformInv_(f),y=this.transformInv_(d),_=Bb+(o?Math.max(0,Math.ceil(Math.log2(hu(i)/(o*o*256*256)))):0);if(this.addQuad_(u,h,f,d,g,p,m,y,_),this.wrapsXInSource_){let w=1/0;this.triangles_.forEach(function(x,v,T){w=Math.min(w,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])-w>this.sourceWorldWidth_/2){const v=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];v[0][0]-w>this.sourceWorldWidth_/2&&(v[0][0]-=this.sourceWorldWidth_),v[1][0]-w>this.sourceWorldWidth_/2&&(v[1][0]-=this.sourceWorldWidth_),v[2][0]-w>this.sourceWorldWidth_/2&&(v[2][0]-=this.sourceWorldWidth_);const T=Math.min(v[0][0],v[1][0],v[2][0]);Math.max(v[0][0],v[1][0],v[2][0])-T<this.sourceWorldWidth_/2&&(x.source=v)}})}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 u=ou([s,o,a,l]),h=this.sourceWorldWidth_?Se(u)/this.sourceWorldWidth_:null,f=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&h>.5&&h<1;let g=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const m=ou([e,t,i,r]);g=Se(m)/this.targetWorldWidth_>Dm||g}!d&&this.sourceProj_.isGlobal()&&h&&(g=h>Dm||g)}if(!g&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3])&&!it(u,this.maxSourceExtent_))return;let p=0;if(!g&&(!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)g=!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(!g){const m=[(e[0]+i[0])/2,(e[1]+i[1])/2],y=this.transformInv_(m);let _;d?_=(jr(s[0],f)+jr(a[0],f))/2-jr(y[0],f):_=(s[0]+a[0])/2-y[0];const w=(s[1]+a[1])/2-y[1];g=_*_+w*w>this.errorThresholdSquared_}if(g){if(Math.abs(e[0]-i[0])<=Math.abs(e[1]-i[1])){const m=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.transformInv_(m),_=[(r[0]+e[0])/2,(r[1]+e[1])/2],w=this.transformInv_(_);this.addQuad_(e,t,m,_,s,o,y,w,c-1),this.addQuad_(_,m,i,r,w,y,a,l,c-1)}else{const m=[(e[0]+t[0])/2,(e[1]+t[1])/2],y=this.transformInv_(m),_=[(i[0]+r[0])/2,(i[1]+r[1])/2],w=this.transformInv_(_);this.addQuad_(e,m,_,r,s,y,w,l,c-1),this.addQuad_(m,t,i,_,y,o,a,w,c-1)}return}}if(d){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=Bt();return this.triangles_.forEach(function(t,i,r){const s=t.source;no(e,s[0]),no(e,s[1]),no(e,s[2])}),e}getTriangles(){return this.triangles_}}const Nm=.5;class zm extends Lo{constructor(e,t,i,r,s,o,a,l,c,u,h,f){super(s,J.IDLE,f),this.renderEdges_=h!==void 0?h:!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 d=r.getTileCoordExtent(this.wrappedTileCoord_),g=this.targetTileGrid_.getExtent();let p=this.sourceTileGrid_.getExtent();const m=g?cn(d,g):d;if(hu(m)===0){this.state=J.EMPTY;return}const y=e.getExtent();y&&(p?p=cn(p,y):p=y);const _=r.getResolution(this.wrappedTileCoord_[0]),w=Ub(e,i,m,_);if(!isFinite(w)||w<=0){this.state=J.EMPTY;return}const x=u!==void 0?u:Nm;if(this.triangulation_=new km(e,i,m,p,w*x,_),this.triangulation_.getTriangles().length===0){this.state=J.EMPTY;return}this.sourceZ_=t.getZForResolution(w);let v=this.triangulation_.calculateSourceExtent();if(p&&(e.canWrapX()?(v[1]=Ye(v[1],p[1],p[3]),v[3]=Ye(v[3],p[1],p[3])):v=cn(v,p)),!hu(v))this.state=J.EMPTY;else{let T=0,R=0;e.canWrapX()&&(T=Se(y),R=Math.floor((v[0]-y[0])/T)),qg(v.slice(),e,!0).forEach(S=>{const L=t.getTileRangeForExtentAndZ(S,this.sourceZ_);for(let B=L.minX;B<=L.maxX;B++)for(let K=L.minY;K<=L.maxY;K++){const F=R*T;this.sourceTiles_.push({getTile:()=>c(this.sourceZ_,B,K,a),offset:F})}++R}),this.sourceTiles_.length===0&&(this.state=J.EMPTY)}}getImage(){return this.canvas_}reproject_(){const e=[];if(this.sourceTiles_.forEach(t=>{const i=t.tile;if(i&&i.getState()==J.LOADED){const r=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);r[0]+=t.offset,r[2]+=t.offset;const s=this.clipExtent_?.slice();s&&(s[0]+=t.offset,s[2]+=t.offset),e.push({extent:r,clipExtent:s,image:i.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=J.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_=Lm(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=J.LOADED}this.changed()}load(){for(const e of this.sourceTiles_)e.tile=e.getTile();if(this.state==J.IDLE){this.state=J.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{const i=t.getState();if(i==J.IDLE||i==J.LOADING){e++;const r=Te(t,de.CHANGE,s=>{const o=t.getState();(o==J.LOADED||o==J.ERROR||o==J.EMPTY)&&(We(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()==J.IDLE&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(We),this.sourcesListenerKeys_=null}release(){this.canvas_&&(uo(this.canvas_.getContext("2d")),ss.push(this.canvas_),this.canvas_=null),this.sourceTiles_.length=0,super.release()}}class Gm{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 Hs&&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 Oe(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 Oe(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){return this.entries_[e]?.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){Oe(!(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 xl(n,e,t,i){return i!==void 0?(i[0]=n,i[1]=e,i[2]=t,i):[n,e,t]}function $b(n,e,t){return n+"/"+e+"/"+t}function vl(n,e,t,i,r){return`${_e(n)},${e},${$b(t,i,r)}`}function Kb(n){return Yb(n[0],n[1],n[2])}function Yb(n,e,t){return(e<<n)+t}function Zb(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}class Lh{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(ol(),{get:(e,t)=>{if(typeof ol()[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)}pushMethodArgs_=(...e)=>(this.push_(e),this);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 qb=5;class Hb extends to{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=new Array,this.maxStaleKeys=qb}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return pe()}getData(e){return null}prepareFrame(e){return pe()}renderFrame(e,t){return pe()}forEachFeatureAtCoordinate(e,t,i,r,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){const t=e.target;(t.getState()===re.LOADED||t.getState()===re.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=re.LOADED&&t!=re.ERROR&&e.addEventListener(de.CHANGE,this.boundHandleImageChange_),t==re.IDLE&&(e.load(),t=e.getState()),t==re.LOADED}renderIfReadyAndVisible(){const e=this.getLayer();e&&e.getVisible()&&e.getSourceState()==="ready"&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const jm=[];let os=null;function Jb(){os=Ze(1,1,void 0,{willReadFrequently:!0})}class Dh extends Hb{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=Gt(),this.pixelTransform=Gt(),this.inversePixelTransform=Gt(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,i){os||Jb(),os.clearRect(0,0,1,1);let r;try{os.drawImage(e,t,i,1,1,0,0,1,1),r=os.getImageData(0,0,1,1).data}catch{return os=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&&yi(ar(e.style.backgroundColor),ar(i)))){const a=e.firstElementChild;Ri(a)&&(o=a.getContext("2d"))}if(o&&gw(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=wt?Wp():document.createElement("div"),s.className=r;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=Ze();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=Kn(i),s=Ua(i),o=Va(i),a=Wa(i);lt(t.coordinateToPixelTransform,r),lt(t.coordinateToPixelTransform,s),lt(t.coordinateToPixelTransform,o),lt(t.coordinateToPixelTransform,a);const l=this.inversePixelTransform;lt(l,r),lt(l,s),lt(l,o),lt(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(Se(i)/r*o),l=Math.round(ot(i)/r*o);In(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/o,1/o,s,-a/2,-l/2),_p(this.inversePixelTransform,this.pixelTransform);const c=dw(this.pixelTransform);if(this.useContainer(t,c,this.getBackground(e)),!this.containerReused){const u=this.context.canvas;u.width!=a||u.height!=l?(u.width=a,u.height=l):this.context.clearRect(0,0,a,l),c!==u.style.transform&&(u.style.transform=c)}}dispatchRenderEvent_(e,t,i){const r=this.getLayer();if(r.hasListener(e)){const s=new Cm(e,this.inversePixelTransform,i,t);r.dispatchEvent(s)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_(Jt.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_(Jt.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new Lh),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(Jt.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(Jt.POSTRENDER,this.context,e))}getRenderTransform(e,t,i,r,s,o,a){const l=s/2,c=o/2,u=r/t,h=-u,f=-e[0]+a,d=-e[1];return In(this.tempTransform,l,c,u,h,-i,f,d)}disposeInternal(){delete this.frameState,super.disposeInternal()}}function kh(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 Qb(n,e,t){const i=n[t];return i?i.delete(e):!1}function Wm(n,e){const t=n.layerStatesArray[n.layerIndex];t.extent&&(e=cn(e,Zn(t.extent,n.viewState.projection)));const i=t.layer.getRenderSource();if(!i.getWrapX()){const r=i.getTileGridForProjection(n.viewState.projection).getExtent();r&&(e=cn(e,r))}return e}class Vm extends Dh{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=Bt(),this.tempTileRange_=new Ah(0,0,0,0),this.tempTileCoord_=xl(0,0,0);const i=t.cacheSize!==void 0?t.cacheSize:512;this.tileCache_=new Gm(i),this.sourceTileCache_=null,this.layerExtent=null,this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||(this.sourceTileCache_=new Gm(512)),this.sourceTileCache_}getOrCreateTile(e,t,i,r){const s=this.tileCache_,a=this.getLayer().getSource(),l=vl(a,a.getKey(),e,t,i);let c;if(s.containsKey(l))c=s.get(l);else{const u=r.viewState.projection,h=a.getProjection();if(c=a.getTile(e,t,i,r.pixelRatio,u,!h||bt(h,u)?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=lt(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!Ji(s,r))return null;const o=t.viewState,a=i.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(t.pixelRatio);for(let u=l.getZForResolution(o.resolution);u>=l.getMinZoom();--u){const h=l.getTileCoordForCoordAndZ(r,u),f=this.getTile(u,h[1],h[2],t);if(!f||f.getState()!==J.LOADED)continue;const d=l.getOrigin(u),g=Ct(l.getTileSize(u)),p=l.getResolution(u);let m;if(f instanceof Fm||f instanceof zm)m=f.getImage();else if(f instanceof Pm){if(m=Mh(f.getData()),!m)continue}else continue;const y=Math.floor(c*((r[0]-d[0])/p-h[1]*g[0])),_=Math.floor(c*((d[1]-r[1])/p-h[2]*g[1])),w=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(m,y+w,_+w)}return null}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;const t=this.getLayer().getSource();if(!t)return!1;const i=t.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==i&&(this.renderedSourceRevision_=i,this.renderedSourceKey_===t.getKey()&&(this.tileCache_.clear(),this.sourceTileCache_?.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),u=_e(l);u in e.wantedTiles||(e.wantedTiles[u]={});const h=e.wantedTiles[u],f=a.getMapInternal(),d=Math.max(i-s,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),f?f.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection)),g=o.rotation,p=g?Kg(o.center,o.resolution,g,e.size):void 0;for(let m=i;m>=d;--m){const y=c.getTileRangeForExtentAndZ(t,m,this.tempTileRange_),_=c.getResolution(m);for(let w=y.minX;w<=y.maxX;++w)for(let x=y.minY;x<=y.maxY;++x){if(g&&!c.tileCoordIntersectsViewport([m,w,x],p))continue;const v=this.getTile(m,w,x,e);if(!v||!kh(r,v,m))continue;const R=v.getKey();if(h[R]=!0,v.getState()===J.IDLE&&!e.tileQueue.isKeyQueued(R)){const C=xl(m,w,x,this.tempTileCoord_);e.tileQueue.enqueue([v,u,c.getTileCoordCenter(C),_])}}}}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=vl(this.getLayer().getSource(),a[l],r,s,o);if(i.containsKey(c)){const u=i.peek(c);if(u.getState()===J.LOADED)return u.endTransition(_e(this)),kh(t,u,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 u=s.minX;u<=s.maxX;++u)for(let h=s.minY;h<=s.maxY;++h){const f=vl(l,c,i,u,h);let d=!1;if(a.containsKey(f)){const g=a.peek(f);g.getState()===J.LOADED&&(kh(r,g,i),d=!0)}d||(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(),u=c.getSource(),h=u.getTileGridForProjection(s),f=h.getZForResolution(o,u.zDirection),d=h.getResolution(f),g=u.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==g&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=g):this.renderedSourceKey_=g;let p=e.extent;const m=u.getTilePixelRatio(l);this.prepareContainer(e,t);const y=this.context.canvas.width,_=this.context.canvas.height;this.layerExtent=i.extent?Zn(i.extent,s):null,this.layerExtent&&(p=cn(p,this.layerExtent));const w=d*y/2/m,x=d*_/2/m,v=[a[0]-w,a[1]-x,a[0]+w,a[1]+x],T={};this.renderedTiles.length=0;const R=c.getPreload();if(e.nextExtent&&this.enqueueTilesForNextExtent()){const X=h.getZForResolution(r.nextResolution,u.zDirection),z=Wm(e,e.nextExtent);this.enqueueTiles(e,z,X,T,R)}const C=Wm(e,p);if(this.enqueueTiles(e,C,f,T,0),R>0&&setTimeout(()=>{this.enqueueTiles(e,C,f-1,T,R-1)},0),!(f in T))return this.container;const S=_e(this),L=e.time;for(const X of T[f]){const z=X.getState();if(z===J.EMPTY)continue;const M=X.tileCoord;if(z===J.LOADED&&X.getAlpha(S,L)===1){X.endTransition(S);continue}if(z!==J.ERROR&&(this.renderComplete=!1),this.findStaleTile_(M,T)){Qb(T,X,f),e.animate=!0;continue}if(this.findAltTiles_(h,M,f+1,T))continue;const ge=h.getMinZoom();for(let ze=f-1;ze>=ge&&!this.findAltTiles_(h,M,ze,T);--ze);}const B=d/o*l/m,K=this.getRenderContext(e);In(this.tempTransform,y/2,_/2,B,B,0,-y/2,-_/2),this.layerExtent&&this.clipUnrotated(K,e,this.layerExtent),u.getInterpolate()||(K.imageSmoothingEnabled=!1),this.preRender(K,e);const F=Object.keys(T).map(Number);F.sort(Tn);let P;const oe=[],W=[];for(let X=F.length-1;X>=0;--X){const z=F[X],M=u.getTilePixelSize(z,l,s),le=h.getResolution(z)/d,ge=M[0]*le*B,ze=M[1]*le*B,G=h.getTileCoordForCoordAndZ(Kn(v),z),xe=h.getTileCoordExtent(G),he=lt(this.tempTransform,[m*(xe[0]-v[0])/d,m*(v[3]-xe[3])/d]),Ie=m*u.getGutterForProjection(s);for(const Pe of T[z]){if(Pe.getState()!==J.LOADED)continue;const ie=Pe.tileCoord,k=G[1]-ie[1],He=Math.round(he[0]-(k-1)*ge),E=G[2]-ie[2],b=Math.round(he[1]-(E-1)*ze),I=Math.round(he[0]-k*ge),D=Math.round(he[1]-E*ze),A=He-I,O=b-D,V=F.length===1;let U=!1;P=[I,D,I+A,D,I+A,D+O,I,D+O];for(let $=0,N=oe.length;$<N;++$)if(!V&&z<W[$]){const ee=oe[$];it([I,D,I+A,D+O],[ee[0],ee[3],ee[4],ee[7]])&&(U||(K.save(),U=!0),K.beginPath(),K.moveTo(P[0],P[1]),K.lineTo(P[2],P[3]),K.lineTo(P[4],P[5]),K.lineTo(P[6],P[7]),K.moveTo(ee[6],ee[7]),K.lineTo(ee[4],ee[5]),K.lineTo(ee[2],ee[3]),K.lineTo(ee[0],ee[1]),K.clip())}oe.push(P),W.push(z),this.drawTile(Pe,e,I,D,A,O,Ie,V),U&&K.restore(),this.renderedTiles.unshift(Pe),this.updateUsedTiles(e.usedTiles,u,Pe)}}if(this.renderedResolution=d,this.extentChanged=!this.renderedExtent_||!$n(this.renderedExtent_,v),this.renderedExtent_=v,this.renderedPixelRatio=l,this.postRender(this.context,e),this.layerExtent&&K.restore(),K.imageSmoothingEnabled=!0,this.renderComplete){const X=(z,M)=>{const ne=_e(u),le=M.wantedTiles[ne],ge=le?Object.keys(le).length:0;this.updateCacheSize(ge),this.tileCache_.expireCache(),this.sourceTileCache_?.expireCache()};e.postRenderFunctions.push(X)}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 Pm){if(c=Mh(e.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(e);if(!c)return;const u=this.getRenderContext(t),h=_e(this),f=t.layerStatesArray[t.layerIndex],d=f.opacity*(l?e.getAlpha(h,t.time):1),g=d!==u.globalAlpha;g&&(u.save(),u.globalAlpha=d),u.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,r,s,o),g&&u.restore(),d!==f.opacity?t.animate=!0:l&&e.endTransition(h)}getImage(){const e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,t,i){const r=_e(t);r in e||(e[r]={}),e[r][i.getKey()]=!0}}const Pi={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class eC extends qr{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(Pi.PRELOAD)}setPreload(e){this.set(Pi.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Pi.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Pi.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}}class Nh extends eC{constructor(e){super(e)}createRenderer(){return new Vm(this,{cacheSize:this.getCacheSize()})}}const as=[0,0,0],Fi=5;class wl{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,Oe(lv(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,Oe(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_=Kn(i)),Oe(!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,Oe(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:Uu,Oe(!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 Ah(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=rs(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]}getOrigins(){return this.origins_}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 rs(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 rs(s,o,s,o,i);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,t-r),c=Math.floor(s*l),u=Math.floor(o*l);if(t<r)return rs(c,c,u,u,i);const h=Math.floor(l*(s+1))-1,f=Math.floor(l*(o+1))-1;return rs(c,h,u,f,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,as);const r=as[1],s=as[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,as);const o=as[1],a=as[2];return rs(r,o,s,a,i)}getTileCoordCenter(e){const t=this.getOrigin(e[0]),i=this.getResolution(e[0]),r=Ct(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=Ct(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 Bn(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=Ct(this.getTileSize(o),this.tmpSize_);let u=a*(e-l[0])/i/c[0],h=a*(l[1]-t)/i/c[1];return r?(u=wi(u,Fi)-1,h=wi(h,Fi)-1):(u=ja(u,Fi),h=ja(h,Fi)),xl(o,u,h,s)}getTileCoordForXYAndZ_(e,t,i,r,s){const o=this.getOrigin(i),a=this.getResolution(i),l=Ct(this.getTileSize(i),this.tmpSize_);let c=(e-o[0])/a/l[0],u=(o[1]-t)/a/l[1];return r?(c=wi(c,Fi)-1,u=wi(u,Fi)-1):(c=ja(c,Fi),u=ja(u,Fi)),xl(i,c,u,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=Da(this.resolutions_,e,t||0);return Ye(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return Ap(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 zh(n){let e=n.getDefaultTileGrid();return e||(e=iC(n),n.setDefaultTileGrid(e)),e}function tC(n,e,t){const i=e[0],r=n.getTileCoordCenter(e),s=Do(t);if(!Ji(s,r)){const o=Se(s),a=Math.ceil((s[0]-r[0])/o);return r[0]+=o*a,n.getTileCoordForCoordAndZ(r,i)}return e}function nC(n,e,t,i){i=i!==void 0?i:"top-left";const r=Xm(n,e,t);return new wl({extent:n,origin:Ev(n,i),resolutions:r,tileSize:t})}function El(n){const e=n||{},t=e.extent||Le("EPSG:3857").getExtent(),i={extent:t,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Xm(t,e.maxZoom,e.tileSize,e.maxResolution)};return new wl(i)}function Xm(n,e,t,i){e=e!==void 0?e:Np,t=Ct(t!==void 0?t:Uu);const r=ot(n),s=Se(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 iC(n,e,t,i){const r=Do(n);return nC(r,e,t,i)}function Do(n){n=Le(n);let e=n.getExtent();if(!e){const t=180*bi.degrees/n.getMetersPerUnit();e=Bn(-t,-t,t,t)}return e}const rC=/\{z\}/g,sC=/\{x\}/g,oC=/\{y\}/g,aC=/\{-y\}/g;function lC(n,e,t,i,r){return n.replace(rC,e.toString()).replace(sC,t.toString()).replace(oC,i.toString()).replace(aC,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 cC(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 uC(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 lC(n,o,t[1],t[2],s)})}function Um(n,e){const t=n.length,i=new Array(t);for(let r=0;r<t;++r)i[r]=uC(n[r],e);return hC(i)}function hC(n){return n.length===1?n[0]:(function(e,t,i){if(!e)return;const r=Kb(e),s=jr(r,n.length);return n[s](e,t,i)})}class ls extends Sn{constructor(e){super(),this.projection=Le(e.projection),this.attributions_=Bm(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_=Bm(e),this.changed()}setState(e){this.state_=e,this.changed()}}function Bm(n){return n?typeof n=="function"?n:(Array.isArray(n)||(n=[n]),e=>n):null}class $m extends ls{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&&Ct(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),t),this.tmpSize=[0,0],this.key_=e.key||_e(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 pe()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:zh(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,i){const r=this.getTileGridForProjection(i),s=this.getTilePixelRatio(t),o=Ct(r.getTileSize(e),this.tmpSize);return s==1?o:ME(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=tC(r,e,i)),Zb(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class fC extends an{constructor(e,t){super(e),this.tile=t}}const Gh={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class bl extends $m{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=_e(t),r=t.getState();let s;r==J.LOADING?(this.tileLoadingKeys_[i]=!0,s=Gh.TILELOADSTART):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],s=r==J.ERROR?Gh.TILELOADERROR:r==J.LOADED?Gh.TILELOADEND:void 0),s!=null&&this.dispatchEvent(new fC(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=cC(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;const t=e.join(`
7
+ `);this.generateTileUrlFunction_?this.setTileUrlFunction(Um(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,i){}}class Km 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:dC,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.referrerPolicy=e.referrerPolicy,this.tileClass=e.tileClass!==void 0?e.tileClass:Fm,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!bt(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||bt(t,e)))return this.tileGrid;const i=_e(e);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=zh(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,u=new this.tileClass(a,c!==void 0?J.IDLE:J.EMPTY,c!==void 0?c:"",{crossOrigin:this.crossOrigin,referrerPolicy:this.referrerPolicy},this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(de.CHANGE,this.handleTileChange.bind(this)),u}getTile(e,t,i,r,s,o){const a=this.getProjection();if(!a||!s||bt(a,s))return this.getTileInternal(e,t,i,r,a||s);const l=[e,t,i],c=this.getKey(),u=this.getTileGridForProjection(a),h=this.getTileGridForProjection(s),f=this.getTileCoordForTileUrlFunction(l,s),d=new zm(a,u,s,h,l,f,this.getTilePixelRatio(r),this.getGutter(),(g,p,m,y)=>this.getTileInternal(g,p,m,y,a,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=c,d}getTileInternal(e,t,i,r,s,o){const a=this.getKey(),l=vl(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?.set(l,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){const i=Le(e);if(i){const r=_e(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=t)}}}function dC(n,e){if(wt){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");const s={mode:i,credentials:r,referrerPolicy:n.getReferrerPolicy()};fetch(e,s).then(o=>{if(!o.ok)throw new Error(`HTTP ${o.status}`);return o.blob()}).then(o=>createImageBitmap(o)).then(o=>{const a=n.getImage();a.width=o.width,a.height=o.height,a.getContext("2d").drawImage(o,0,0),o.close?.(),a.dispatchEvent(new Event("load"))}).catch(()=>{n.getImage().dispatchEvent(new Event("error"))});return}n.getImage().src=e}class gC extends Km{constructor(e){e=e||{};const t=e.projection!==void 0?e.projection:"EPSG:3857",i=e.tileGrid!==void 0?e.tileGrid:El({extent:Do(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,referrerPolicy:e.referrerPolicy,interpolate:e.interpolate,projection:t,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const pC='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class mC extends gC{constructor(e){e=e||{};let t;e.attributions!==void 0?t=e.attributions:t=[pC];const i=e.url!==void 0?e.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:t,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin!==void 0?e.crossOrigin:"anonymous",referrerPolicy:e.referrerPolicy||"origin-when-cross-origin",interpolate:e.interpolate,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:i,wrapX:e.wrapX,zDirection:e.zDirection})}}var yC=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],_C=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],xC={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},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"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"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"}},layout:yC,layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"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","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:_C,paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const vC=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function wC(n,e){const t={};for(const i in n)i!=="ref"&&(t[i]=n[i]);return vC.forEach(i=>{i in e&&(t[i]=e[i])}),t}function Ym(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]=wC(n[t],e[n[t].ref]));return n}var Fn=class extends Error{constructor(n,e){super(e),this.message=e,this.key=n}},EC=class e0{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[i,r]of t)this.bindings[i]=r}concat(e){return new e0(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 Cl={kind:"null"},H={kind:"number"},ye={kind:"string"},be={kind:"boolean"},On={kind:"color"},Tl={kind:"projectionDefinition"},gr={kind:"object"},we={kind:"value"},bC={kind:"error"},Rl={kind:"collator"},Sl={kind:"formatted"},Il={kind:"padding"},ko={kind:"colorArray"},Ml={kind:"numberArray"},No={kind:"resolvedImage"},Al={kind:"variableAnchorOffsetCollection"};function Pt(n,e){return{kind:"array",itemType:n,N:e}}function qe(n){if(n.kind==="array"){const e=qe(n.itemType);return typeof n.N=="number"?`array<${e}, ${n.N}>`:n.itemType.kind==="value"?"array":`array<${e}>`}else return n.kind}const CC=[Cl,H,ye,be,On,Tl,Sl,gr,Pt(we),Il,Ml,ko,No,Al];function zo(n,e){if(e.kind==="error")return null;if(n.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!zo(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 CC)if(!zo(t,e))return null}}return`Expected ${qe(n)} but found ${qe(e)} instead.`}function jh(n,e){return e.some(t=>t.kind===n.kind)}function pr(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 Oi(n,e){return n.kind==="array"&&e.kind==="array"?n.itemType.kind===e.itemType.kind&&typeof n.N=="number":n.kind===e.kind}const Zm=.96422,qm=1,Hm=.82521,Jm=4/29,cs=6/29,Qm=3*cs*cs,TC=cs*cs*cs,RC=Math.PI/180,SC=180/Math.PI;function ey(n){return n=n%360,n<0&&(n+=360),n}function ty([n,e,t,i]){n=Wh(n),e=Wh(e),t=Wh(t);let r,s;const o=Vh((.2225045*n+.7168786*e+.0606169*t)/qm);n===e&&e===t?r=s=o:(r=Vh((.4360747*n+.3850649*e+.1430804*t)/Zm),s=Vh((.0139322*n+.0971045*e+.7141733*t)/Hm));const a=116*o-16;return[a<0?0:a,500*(r-o),200*(o-s),i]}function Wh(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Vh(n){return n>TC?Math.pow(n,.3333333333333333):n/Qm+Jm}function ny([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=qm*Uh(r),s=Zm*Uh(s),o=Hm*Uh(o),[Xh(3.1338561*s-1.6168667*r-.4906146*o),Xh(-.9787684*s+1.9161415*r+.033454*o),Xh(.0719453*s-.2289914*r+1.4052427*o),i]}function Xh(n){return n=n<=.00304?12.92*n:1.055*Math.pow(n,.4166666666666667)-.055,n<0?0:n>1?1:n}function Uh(n){return n>cs?n*n*n:Qm*(n-Jm)}function IC(n){const[e,t,i,r]=ty(n),s=Math.sqrt(t*t+i*i);return[Math.round(s*1e4)?ey(Math.atan2(i,t)*SC):NaN,s,e,r]}function MC([n,e,t,i]){return n=isNaN(n)?0:n*RC,ny([t,Math.cos(n)*e,Math.sin(n)*e,i])}function AC([n,e,t,i]){n=ey(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 PC=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function iy(n,e){return PC(n,e)?n[e]:void 0}function FC(n){if(n=n.toLowerCase().trim(),n==="transparent")return[0,0,0,0];const e=iy(OC,n);if(e){const[i,r,s]=e;return[i/255,r/255,s/255,1]}if(n.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(n)){const i=n.length<6?1:2;let r=1;return[Pl(n.slice(r,r+=i)),Pl(n.slice(r,r+=i)),Pl(n.slice(r,r+=i)),Pl(n.slice(r,r+i)||"ff")]}if(n.startsWith("rgb")){const i=n.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){const[r,s,o,a,l,c,u,h,f,d,g,p]=i,m=[a||" ",u||" ",d].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){const y=[o,c,f].join(""),_=y==="%%%"?100:y===""?255:0;if(_){const w=[us(+s/_,0,1),us(+l/_,0,1),us(+h/_,0,1),g?ry(+g,p):1];if(sy(w))return w}}return}}const t=n.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){const[i,r,s,o,a,l,c,u,h]=t,f=[s||" ",a||" ",c].join("");if(f===" "||f===" /"||f===",,"||f===",,,"){const d=[+r,us(+o,0,100),us(+l,0,100),u?ry(+u,h):1];if(sy(d))return AC(d)}}}function Pl(n){return parseInt(n.padEnd(2,n),16)/255}function ry(n,e){return us(e?n/100:n,0,1)}function us(n,e,t){return Math.min(Math.max(e,n),t)}function sy(n){return!n.some(Number.isNaN)}const OC={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 mr(n,e,t){return n+t*(e-n)}function Go(n,e,t){return n.map((i,r)=>mr(i,e[r],t))}var Qe=(pt=class{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 pt)return e;if(typeof e!="string")return;const t=FC(e);if(t)return new pt(...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",IC(this.rgb))}get lab(){return this.overwriteGetter("lab",ty(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]=Go(e.rgb,t.rgb,i);return new pt(s,o,a,l,!1)}case"hcl":{const[s,o,a,l]=e.hcl,[c,u,h,f]=t.hcl;let d,g;if(!isNaN(s)&&!isNaN(c)){let w=c-s;c>s&&w>180?w-=360:c<s&&s-c>180&&(w+=360),d=s+i*w}else isNaN(s)?isNaN(c)?d=NaN:(d=c,(a===1||a===0)&&(g=u)):(d=s,(h===1||h===0)&&(g=o));const[p,m,y,_]=MC([d,g??mr(o,u,i),mr(a,h,i),mr(l,f,i)]);return new pt(p,m,y,_,!1)}case"lab":{const[s,o,a,l]=ny(Go(e.lab,t.lab,i));return new pt(s,o,a,l,!1)}}}},pt.black=new pt(0,0,0,1),pt.white=new pt(1,1,1,1),pt.transparent=new pt(0,0,0,0),pt.red=new pt(1,0,0,1),pt),Bh=class{constructor(n,e,t){n?this.sensitivity=e?"variant":"case":this.sensitivity=e?"accent":"base",this.locale=t,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(n,e){return this.collator.compare(n,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};const LC=["bottom","center","top"];var $h=class{constructor(n,e,t,i,r,s){this.text=n,this.image=e,this.scale=t,this.fontStack=i,this.textColor=r,this.verticalAlign=s}},jo=class pc{constructor(e){this.sections=e}static fromString(e){return new pc([new $h(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 pc?e:pc.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},hs=class na{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof na)return e;if(typeof e=="number")return new na([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 na(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){return new na(Go(e.values,t.values,i))}},fs=class ia{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ia)return e;if(typeof e=="number")return new ia([e]);if(Array.isArray(e)){for(const t of e)if(typeof t!="number")return;return new ia(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,i){return new ia(Go(e.values,t.values,i))}},Li=class ra{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ra)return e;if(typeof e=="string"){const i=Qe.parse(e);return i?new ra([i]):void 0}if(!Array.isArray(e))return;const t=[];for(const i of e){if(typeof i!="string")return;const r=Qe.parse(i);if(!r)return;t.push(r)}return new ra(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(Qe.interpolate(e.values[o],t.values[o],i,r));return new ra(s)}},et=class extends Error{constructor(n){super(n),this.name="RuntimeError"}toJSON(){return this.message}};const DC=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);var ds=class mc{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof mc)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"||!DC.has(i)||!Array.isArray(r)||r.length!==2||typeof r[0]!="number"||typeof r[1]!="number")return}return new mc(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 et(`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 et(`Cannot interpolate values containing mismatched anchors. from[${a}]: ${r[a]}, to[${a}]: ${s[a]}`);o.push(r[a]);const[l,c]=r[a+1],[u,h]=s[a+1];o.push([mr(l,u,i),mr(c,h,i)])}return new mc(o)}},gs=class t0{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new t0({name:e,available:!1}):null}},Wo=class Ss{constructor(e,t,i){this.from=e,this.to=t,this.transition=i}static interpolate(e,t,i){return new Ss(e,t,i)}static parse(e){if(e instanceof Ss)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new Ss(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new Ss(e.from,e.to,e.transition);if(typeof e=="string")return new Ss(e,e,1)}};function oy(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 Vo(n){if(n===null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||n instanceof Wo||n instanceof Qe||n instanceof Bh||n instanceof jo||n instanceof hs||n instanceof fs||n instanceof Li||n instanceof ds||n instanceof gs)return!0;if(Array.isArray(n)){for(const e of n)if(!Vo(e))return!1;return!0}else if(typeof n=="object"){for(const e in n)if(!Vo(n[e]))return!1;return!0}else return!1}function ct(n){if(n===null)return Cl;if(typeof n=="string")return ye;if(typeof n=="boolean")return be;if(typeof n=="number")return H;if(n instanceof Qe)return On;if(n instanceof Wo)return Tl;if(n instanceof Bh)return Rl;if(n instanceof jo)return Sl;if(n instanceof hs)return Il;if(n instanceof fs)return Ml;if(n instanceof Li)return ko;if(n instanceof ds)return Al;if(n instanceof gs)return No;if(Array.isArray(n)){const e=n.length;let t;for(const i of n){const r=ct(i);if(!t)t=r;else{if(t===r)continue;t=we;break}}return Pt(t||we,e)}else return gr}function Xo(n){const e=typeof n;return n===null?"":e==="string"||e==="number"||e==="boolean"?String(n):n instanceof Qe||n instanceof Wo||n instanceof jo||n instanceof hs||n instanceof fs||n instanceof Li||n instanceof ds||n instanceof gs?n.toString():JSON.stringify(n)}var Fl=class n0{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(!Vo(e[1]))return t.error("invalid value");const i=e[1];let r=ct(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 n0(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};const Ol={string:ye,number:H,boolean:be,object:gr};var ni=class i0{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 Ol)||c==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=Ol[c],i++}else a=we;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=Pt(a,l)}else{if(!Ol[s])throw new Error(`Types doesn't contain name = ${s}`);r=Ol[s]}const o=[];for(;i<e.length;i++){const a=t.parse(e[i],i,we);if(!a)return null;o.push(a)}return new i0(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const i=this.args[t].evaluate(e);if(zo(this.type,ct(i))){if(t===this.args.length-1)throw new et(`Expected value to be of type ${qe(this.type)}, but found ${qe(ct(i))} instead.`)}else return i}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};const ay={"to-boolean":be,"to-color":On,"to-number":H,"to-string":ye};var ps=class r0{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(!ay[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=ay[i],s=[];for(let o=1;o<e.length;o++){const a=t.parse(e[o],o,we);if(!a)return null;s.push(a)}return new r0(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 Qe)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=oy(t[0],t[1],t[2],t[3]),!i))return new Qe(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new et(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=hs.parse(t);if(r)return r}throw new et(`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=fs.parse(t);if(r)return r}throw new et(`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=Li.parse(t);if(r)return r}throw new et(`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=ds.parse(t);if(r)return r}throw new et(`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 et(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return jo.fromString(Xo(this.args[0].evaluate(e)));case"resolvedImage":return gs.fromString(Xo(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return Xo(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};const kC=["Unknown","Point","LineString","Polygon"];var ly=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"?kC[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(n){let e=this._parseColorCache.get(n);return e||(e=Qe.parse(n),this._parseColorCache.set(n,e)),e}},cy=class s0{constructor(e,t,i=[],r,s=new EC,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 ni(s,[r]):o==="coerce"?new ps(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 Fl)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){const a=new ly;try{o=new Fl(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 s0(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 Fn(i,e))}checkSubtype(e,t){const i=zo(e,t);return i&&this.error(i),i}},uy=class o0{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 o0(i,r):null}outputDefined(){return this.result.outputDefined()}},hy=class a0{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 a0(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}},NC=class l0{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,H),r=t.parse(e[2],2,Pt(t.expectedType||we));if(!i||!r)return null;const s=r.type;return new l0(s.itemType,i,r)}evaluate(e){const t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new et(`Array index out of bounds: ${t} < 0.`);if(t>=i.length)throw new et(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t!==Math.floor(t))throw new et(`Array index must be an integer, but found ${t} instead.`);return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},zC=class c0{constructor(e,t){this.type=be,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,we),r=t.parse(e[2],2,we);return!i||!r?null:jh(i.type,[be,ye,H,Cl,we])?new c0(i,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${qe(i.type)} instead`)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!pr(t,["boolean","string","number","null"]))throw new et(`Expected first argument to be of type boolean, string, number or null, but found ${qe(ct(t))} instead.`);if(!pr(i,["string","array"]))throw new et(`Expected second argument to be of type array or string, but found ${qe(ct(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},GC=class Yf{constructor(e,t,i){this.type=H,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,we),r=t.parse(e[2],2,we);if(!i||!r)return null;if(!jh(i.type,[be,ye,H,Cl,we]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${qe(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,H);return s?new Yf(i,r,s):null}else return new Yf(i,r)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!pr(t,["boolean","string","number","null"]))throw new et(`Expected first argument to be of type boolean, string, number or null, but found ${qe(ct(t))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),pr(i,["string"])){const s=i.indexOf(t,r);return s===-1?-1:[...i.slice(0,s)].length}else{if(pr(i,["array"]))return i.indexOf(t,r);throw new et(`Expected second argument to be of type array or string, but found ${qe(ct(i))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},jC=class u0{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 u=e[c];const h=e[c+1];Array.isArray(u)||(u=[u]);const f=t.concat(c);if(u.length===0)return f.error("Expected at least one branch label.");for(const g of u){if(typeof g!="number"&&typeof g!="string")return f.error("Branch labels must be numbers or strings.");if(typeof g=="number"&&Math.abs(g)>Number.MAX_SAFE_INTEGER)return f.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof g=="number"&&Math.floor(g)!==g)return f.error("Numeric branch labels must be integer values.");if(!i)i=ct(g);else if(f.checkSubtype(i,ct(g)))return null;if(typeof s[String(g)]<"u")return f.error("Branch labels must be unique.");s[String(g)]=o.length}const d=t.parse(h,c,r);if(!d)return null;r=r||d.type,o.push(d)}const a=t.parse(e[1],1,we);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 u0(i,r,a,s,o,l)}evaluate(e){const t=this.input.evaluate(e);return(ct(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()}},WC=class h0{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,be);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 h0(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()}},VC=class Zf{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 2 or 3 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,we),r=t.parse(e[2],2,H);if(!i||!r)return null;if(!jh(i.type,[Pt(we),ye,we]))return t.error(`Expected first argument to be of type array or string, but found ${qe(i.type)} instead`);if(e.length===4){const s=t.parse(e[3],3,H);return s?new Zf(i.type,i,r,s):null}else return new Zf(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)),pr(t,["string"]))return[...t].slice(i,r).join("");if(pr(t,["array"]))return t.slice(i,r);throw new et(`Expected first argument to be of type array or string, but found ${qe(ct(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function fy(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 et("Input is not a number.");return 0}var dy=class f0{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,H);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,u=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 h=t.parse(l,u,s);if(!h)return null;s=s||h.type,r.push([a,h])}return new f0(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;return r>=t[s-1]?i[s-1].evaluate(e):i[fy(t,r)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function XC(n,e,t,i){const r=3*n,s=3*(t-n)-r,o=1-r-s,a=3*e,l=3*(i-e)-a,c=1-a-l;return function(h,f=1e-6){if(h<=0)return 0;if(h>=1)return 1;let d=h;for(let m=0;m<8;m++){const y=((o*d+s)*d+r)*d-h;if(Math.abs(y)<f)return((c*d+l)*d+a)*d;const _=(3*o*d+2*s)*d+r;if(Math.abs(_)<1e-6)break;d-=y/_}let g=0,p=1;d=h;for(let m=0;m<20;m++){const y=((o*d+s)*d+r)*d;if(Math.abs(y-h)<f)break;h>y?g=d:p=d,d=(g+p)*.5}return((c*d+l)*d+a)*d}}var yr=class qf{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=XC(o[0],o[1],o[2],o[3])(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(u=>typeof u!="number"||u<0||u>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,H),!s)return null;const a=[];let l=null;(i==="interpolate-hcl"||i==="interpolate-lab")&&t.expectedType!=ko?l=On:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let c=0;c<o.length;c+=2){const u=o[c],h=o[c+1],f=c+3,d=c+4;if(typeof u!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(a.length&&a[a.length-1][0]>=u)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);const g=t.parse(h,d,l);if(!g)return null;l=l||g.type,a.push([u,g])}return!Oi(l,H)&&!Oi(l,Tl)&&!Oi(l,On)&&!Oi(l,Il)&&!Oi(l,Ml)&&!Oi(l,ko)&&!Oi(l,Al)&&!Oi(l,Pt(H))?t.error(`Type ${qe(l)} is not interpolatable.`):new qf(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=fy(t,r),a=t[o],l=t[o+1],c=qf.interpolationFactor(this.interpolation,r,a,l),u=i[o].evaluate(e),h=i[o+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return mr(u,h,c);case"color":return Qe.interpolate(u,h,c);case"padding":return hs.interpolate(u,h,c);case"colorArray":return Li.interpolate(u,h,c);case"numberArray":return fs.interpolate(u,h,c);case"variableAnchorOffsetCollection":return ds.interpolate(u,h,c);case"array":return Go(u,h,c);case"projectionDefinition":return Wo.interpolate(u,h,c)}case"interpolate-hcl":switch(this.type.kind){case"color":return Qe.interpolate(u,h,c,"hcl");case"colorArray":return Li.interpolate(u,h,c,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Qe.interpolate(u,h,c,"lab");case"colorArray":return Li.interpolate(u,h,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)}var gy=class Hf{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 o of e.slice(1)){const a=t.parse(o,1+s.length,i,void 0,{typeAnnotation:"omit"});if(!a)return null;i=i||a.type,s.push(a)}if(!i)throw new Error("No output type");return r&&s.some(o=>zo(r,o.type))?new Hf(we,s):new Hf(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 gs&&!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 py(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 UC(n,e,t){return e===t}function BC(n,e,t){return e!==t}function $C(n,e,t){return e<t}function KC(n,e,t){return e>t}function YC(n,e,t){return e<=t}function ZC(n,e,t){return e>=t}function my(n,e,t,i){return i.compare(e,t)===0}function qC(n,e,t,i){return!my(n,e,t,i)}function HC(n,e,t,i){return i.compare(e,t)<0}function JC(n,e,t,i){return i.compare(e,t)>0}function QC(n,e,t,i){return i.compare(e,t)<=0}function eT(n,e,t,i){return i.compare(e,t)>=0}function ms(n,e,t){const i=n!=="=="&&n!=="!=";return class d0{constructor(s,o,a){this.type=be,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,we);if(!l)return null;if(!py(a,l.type))return o.concat(1).error(`"${a}" comparisons are not supported for type '${qe(l.type)}'.`);let c=o.parse(s[2],2,we);if(!c)return null;if(!py(a,c.type))return o.concat(2).error(`"${a}" comparisons are not supported for type '${qe(c.type)}'.`);if(l.type.kind!==c.type.kind&&l.type.kind!=="value"&&c.type.kind!=="value")return o.error(`Cannot compare types '${qe(l.type)}' and '${qe(c.type)}'.`);i&&(l.type.kind==="value"&&c.type.kind!=="value"?l=new ni(c.type,[l]):l.type.kind!=="value"&&c.type.kind==="value"&&(c=new ni(l.type,[c])));let u=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(u=o.parse(s[3],3,Rl),!u)return null}return new d0(l,c,u)}evaluate(s){const o=this.lhs.evaluate(s),a=this.rhs.evaluate(s);if(i&&this.hasUntypedArgument){const l=ct(o),c=ct(a);if(l.kind!==c.kind||!(l.kind==="string"||l.kind==="number"))throw new et(`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=ct(o),c=ct(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 tT=ms("==",UC,my),nT=ms("!=",BC,qC),iT=ms("<",$C,HC),rT=ms(">",KC,JC),sT=ms("<=",YC,QC),oT=ms(">=",ZC,eT);var yy=class g0{constructor(e,t,i){this.type=Rl,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,be);if(!r)return null;const s=t.parse(i["diacritic-sensitive"]===void 0?!1:i["diacritic-sensitive"],1,be);if(!s)return null;let o=null;return i.locale&&(o=t.parse(i.locale,1,ye),!o)?null:new g0(r,s,o)}evaluate(e){return new Bh(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}},aT=class p0{constructor(e,t,i,r,s,o){this.type=ye,this.number=e,this.locale=t,this.currency=i,this.unit=r,this.minFractionDigits=s,this.maxFractionDigits=o}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");const i=t.parse(e[1],1,H);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,ye),!s))return null;let o=null;if(r.currency&&(o=t.parse(r.currency,1,ye),!o))return null;let a=null;if(r.unit&&(a=t.parse(r.unit,1,ye),!a))return null;if(o&&a)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(r["min-fraction-digits"]&&(l=t.parse(r["min-fraction-digits"],1,H),!l))return null;let c=null;return r["max-fraction-digits"]&&(c=t.parse(r["max-fraction-digits"],1,H),!c)?null:new p0(i,s,o,a,l,c)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.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.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},lT=class m0{constructor(e){this.type=Sl,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,H),!l))return null;let c=null;if(a["text-font"]&&(c=t.parse(a["text-font"],1,Pt(ye)),!c))return null;let u=null;if(a["text-color"]&&(u=t.parse(a["text-color"],1,On),!u))return null;let h=null;if(a["vertical-align"]){if(typeof a["vertical-align"]=="string"&&!LC.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(h=t.parse(a["vertical-align"],1,ye),!h)return null}const f=r[r.length-1];f.scale=l,f.font=c,f.textColor=u,f.verticalAlign=h}else{const l=t.parse(e[o],1,we);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 m0(r)}evaluate(e){const t=i=>{const r=i.content.evaluate(e);return ct(r)===No?new $h("",r,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new $h(Xo(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 jo(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}},cT=class y0{constructor(e){this.type=No,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");const i=t.parse(e[1],1,ye);return i?new y0(i):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),i=gs.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}},uT=class _0{constructor(e){this.type=H,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 ${qe(i.type)} instead.`):new _0(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 et(`Expected value to be of type string or array, but found ${qe(ct(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}};const Ln=8192;function hT(n,e){const t=fT(n[0]),i=gT(n[1]),r=Math.pow(2,e.z);return[Math.round(t*r*Ln),Math.round(i*r*Ln)]}function Yh(n,e){const t=Math.pow(2,e.z),i=(n[0]/Ln+e.x)/t,r=(n[1]/Ln+e.y)/t;return[dT(i),pT(r)]}function fT(n){return(180+n)/360}function dT(n){return n*360-180}function gT(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360}function pT(n){return 360/Math.PI*Math.atan(Math.exp((180-n*360)*Math.PI/180))-90}function Uo(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 Bo(n,e){return!(n[0]<=e[0]||n[2]>=e[2]||n[1]<=e[1]||n[3]>=e[3])}function mT(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 yT(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 Ll(n,e,t,i){const r=[e[0]-n[0],e[1]-n[1]];return wT([i[0]-t[0],i[1]-t[1]],r)===0?!1:!!(xy(n,e,t,i)&&xy(t,i,n,e))}function _T(n,e,t){for(const i of t)for(let r=0;r<i.length-1;++r)if(Ll(n,e,i[r],i[r+1]))return!0;return!1}function ys(n,e,t=!1){let i=!1;for(const r of e)for(let s=0;s<r.length-1;s++){if(yT(n,r[s],r[s+1]))return t;mT(n,r[s],r[s+1])&&(i=!i)}return i}function xT(n,e){for(const t of e)if(ys(n,t))return!0;return!1}function _y(n,e){for(const t of n)if(!ys(t,e))return!1;for(let t=0;t<n.length-1;++t)if(_T(n[t],n[t+1],e))return!1;return!0}function vT(n,e){for(const t of e)if(_y(n,t))return!0;return!1}function wT(n,e){return n[0]*e[1]-n[1]*e[0]}function xy(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],u=r*c-l*s,h=o*c-l*a;return u>0&&h<0||u<0&&h>0}function Zh(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=hT(n[r][o],t);Uo(e,a),s.push(a)}i.push(s)}return i}function vy(n,e,t){const i=[];for(let r=0;r<n.length;r++){const s=Zh(n[r],e,t);i.push(s)}return i}function wy(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}Uo(e,n)}function ET(n){n[0]=n[1]=1/0,n[2]=n[3]=-1/0}function Ey(n,e,t,i){const r=Math.pow(2,i.z)*Ln,s=[i.x*Ln,i.y*Ln],o=[];for(const a of n)for(const l of a){const c=[l.x+s[0],l.y+s[1]];wy(c,e,t,r),o.push(c)}return o}function by(n,e,t,i){const r=Math.pow(2,i.z)*Ln,s=[i.x*Ln,i.y*Ln],o=[];for(const a of n){const l=[];for(const c of a){const u=[c.x+s[0],c.y+s[1]];Uo(e,u),l.push(u)}o.push(l)}if(e[2]-e[0]<=r/2){ET(e);for(const a of o)for(const l of a)wy(l,e,t,r)}return o}function bT(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=Zh(e.coordinates,i,r),o=Ey(n.geometry(),t,i,r);if(!Bo(t,i))return!1;for(const a of o)if(!ys(a,s))return!1}if(e.type==="MultiPolygon"){const s=vy(e.coordinates,i,r),o=Ey(n.geometry(),t,i,r);if(!Bo(t,i))return!1;for(const a of o)if(!xT(a,s))return!1}return!0}function CT(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=Zh(e.coordinates,i,r),o=by(n.geometry(),t,i,r);if(!Bo(t,i))return!1;for(const a of o)if(!_y(a,s))return!1}if(e.type==="MultiPolygon"){const s=vy(e.coordinates,i,r),o=by(n.geometry(),t,i,r);if(!Bo(t,i))return!1;for(const a of o)if(!vT(a,s))return!1}return!0}var qh=class yc{constructor(e,t){this.type=be,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(Vo(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)return new yc(i,{type:"MultiPolygon",coordinates:r})}else if(i.type==="Feature"){const r=i.geometry.type;if(r==="Polygon"||r==="MultiPolygon")return new yc(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new yc(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 bT(e,this.geometries);if(e.geometryType()==="LineString")return CT(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Cy=class{constructor(n=[],e=(t,i)=>t<i?-1:t>i?1:0){if(this.data=n,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(n){this.data.push(n),this._up(this.length++)}pop(){if(this.length===0)return;const n=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),n}peek(){return this.data[0]}_up(n){const{data:e,compare:t}=this,i=e[n];for(;n>0;){const r=n-1>>1,s=e[r];if(t(i,s)>=0)break;e[n]=s,n=r}e[n]=i}_down(n){const{data:e,compare:t}=this,i=this.length>>1,r=e[n];for(;n<i;){let s=(n<<1)+1;const o=s+1;if(o<this.length&&t(e[o],e[s])<0&&(s=o),t(e[s],r)>=0)break;e[n]=e[s],n=s}e[n]=r}};function TT(n,e){if(n.length<=1)return[n];const t=[];let i,r;for(const s of n){const o=RT(s);o!==0&&(s.area=Math.abs(o),r===void 0&&(r=o<0),r===o<0?(i&&t.push(i),i=[s]):i.push(s))}return i&&t.push(i),t}function RT(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 ST=6378.137,Ty=1/298.257223563,Ry=Ty*(2-Ty),Sy=Math.PI/180;var Hh=class{constructor(n){const e=Sy*ST*1e3,t=Math.cos(n*Sy),i=1/(1-Ry*(1-t*t)),r=Math.sqrt(i);this.kx=e*r*t,this.ky=e*r*i*(1-Ry)}distance(n,e){const t=this.wrap(n[0]-e[0])*this.kx,i=(n[1]-e[1])*this.ky;return Math.sqrt(t*t+i*i)}pointOnLine(n,e){let t=1/0,i,r,s,o;for(let a=0;a<n.length-1;a++){let l=n[a][0],c=n[a][1],u=this.wrap(n[a+1][0]-l)*this.kx,h=(n[a+1][1]-c)*this.ky,f=0;(u!==0||h!==0)&&(f=(this.wrap(e[0]-l)*this.kx*u+(e[1]-c)*this.ky*h)/(u*u+h*h),f>1?(l=n[a+1][0],c=n[a+1][1]):f>0&&(l+=u/this.kx*f,c+=h/this.ky*f)),u=this.wrap(e[0]-l)*this.kx,h=(e[1]-c)*this.ky;const d=u*u+h*h;d<t&&(t=d,i=l,r=c,s=a,o=f)}return{point:[i,r],index:s,t:Math.max(0,Math.min(1,o))}}wrap(n){for(;n<-180;)n+=360;for(;n>180;)n-=360;return n}};const Jh=100,Qh=50;function Iy(n,e){return e[0]-n[0]}function Dl(n){return n[1]-n[0]+1}function ii(n,e){return n[1]>=n[0]&&n[1]<e}function ef(n,e){if(n[0]>n[1])return[null,null];const t=Dl(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 tf(n,e){if(!ii(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)Uo(t,n[i]);return t}function nf(n){const e=[1/0,1/0,-1/0,-1/0];for(const t of n)for(const i of t)Uo(e,i);return e}function My(n){return n[0]!==-1/0&&n[1]!==-1/0&&n[2]!==1/0&&n[3]!==1/0}function rf(n,e,t){if(!My(n)||!My(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 _r(n,e,t){const i=t.pointOnLine(e,n);return t.distance(n,i.point)}function sf(n,e,t,i,r){const s=Math.min(_r(n,[t,i],r),_r(e,[t,i],r)),o=Math.min(_r(t,[n,e],r),_r(i,[n,e],r));return Math.min(s,o)}function IT(n,e,t,i,r){if(!(ii(e,n.length)&&ii(i,t.length)))return 1/0;let s=1/0;for(let o=e[0];o<e[1];++o){const a=n[o],l=n[o+1];for(let c=i[0];c<i[1];++c){const u=t[c],h=t[c+1];if(Ll(a,l,u,h))return 0;s=Math.min(s,sf(a,l,u,h,r))}}return s}function MT(n,e,t,i,r){if(!(ii(e,n.length)&&ii(i,t.length)))return NaN;let s=1/0;for(let o=e[0];o<=e[1];++o)for(let a=i[0];a<=i[1];++a)if(s=Math.min(s,r.distance(n[o],t[a])),s===0)return s;return s}function AT(n,e,t){if(ys(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,_r(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 PT(n,e,t,i){if(!ii(e,n.length))return NaN;for(let s=e[0];s<=e[1];++s)if(ys(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,u=l.length,h=u-1;c<u;h=c++){const f=l[h],d=l[c];if(Ll(o,a,f,d))return 0;r=Math.min(r,sf(o,a,f,d,i))}}return r}function Ay(n,e){for(const t of n)for(const i of t)if(ys(i,e,!0))return!0;return!1}function FT(n,e,t,i=1/0){const r=nf(n),s=nf(e);if(i!==1/0&&rf(r,s,t)>=i)return i;if(Bo(r,s)){if(Ay(n,e))return 0}else if(Ay(e,n))return 0;let o=1/0;for(const a of n)for(let l=0,c=a.length,u=c-1;l<c;u=l++){const h=a[u],f=a[l];for(const d of e)for(let g=0,p=d.length,m=p-1;g<p;m=g++){const y=d[m],_=d[g];if(Ll(h,f,y,_))return 0;o=Math.min(o,sf(h,f,y,_,t))}}return o}function Py(n,e,t,i,r,s){if(!s)return;const o=rf(tf(i,s),r,t);o<e&&n.push([o,s,[0,0]])}function kl(n,e,t,i,r,s,o){if(!s||!o)return;const a=rf(tf(i,s),tf(r,o),t);a<e&&n.push([a,s,o])}function Nl(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 Cy([[0,[0,n.length-1],[0,0]]],Iy),a=nf(t);for(;o.length>0;){const l=o.pop();if(l[0]>=s)continue;const c=l[1],u=e?Qh:Jh;if(Dl(c)<=u){if(!ii(c,n.length))return NaN;if(e){const h=PT(n,c,t,i);if(isNaN(h)||h===0)return h;s=Math.min(s,h)}else for(let h=c[0];h<=c[1];++h){const f=AT(n[h],t,i);if(s=Math.min(s,f),s===0)return 0}}else{const h=ef(c,e);Py(o,s,i,n,a,h[0]),Py(o,s,i,n,a,h[1])}}return s}function zl(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 Cy([[0,[0,n.length-1],[0,t.length-1]]],Iy);for(;a.length>0;){const l=a.pop();if(l[0]>=o)continue;const c=l[1],u=l[2],h=e?Qh:Jh,f=i?Qh:Jh;if(Dl(c)<=h&&Dl(u)<=f){if(!ii(c,n.length)&&ii(u,t.length))return NaN;let d;if(e&&i)d=IT(n,c,t,u,r),o=Math.min(o,d);else if(e&&!i){const g=n.slice(c[0],c[1]+1);for(let p=u[0];p<=u[1];++p)if(d=_r(t[p],g,r),o=Math.min(o,d),o===0)return o}else if(!e&&i){const g=t.slice(u[0],u[1]+1);for(let p=c[0];p<=c[1];++p)if(d=_r(n[p],g,r),o=Math.min(o,d),o===0)return o}else d=MT(n,c,t,u,r),o=Math.min(o,d)}else{const d=ef(c,e),g=ef(u,i);kl(a,o,r,n,t,d[0],g[0]),kl(a,o,r,n,t,d[0],g[1]),kl(a,o,r,n,t,d[1],g[0]),kl(a,o,r,n,t,d[1],g[1])}}return o}function OT(n,e){const t=n.geometry(),i=t.flat().map(o=>Yh([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new Hh(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,zl(i,!1,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,zl(i,!1,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,Nl(i,!1,o.coordinates,r,s));break}if(s===0)return s}return s}function LT(n,e){const t=n.geometry(),i=t.flat().map(o=>Yh([o.x,o.y],n.canonical));if(t.length===0)return NaN;const r=new Hh(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,zl(i,!0,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,zl(i,!0,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,Nl(i,!0,o.coordinates,r,s));break}if(s===0)return s}return s}function DT(n,e){const t=n.geometry();if(t.length===0||t[0].length===0)return NaN;const i=TT(t).map(o=>o.map(a=>a.map(l=>Yh([l.x,l.y],n.canonical)))),r=new Hh(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,Nl([o.coordinates],!1,a,r,s));break;case"LineString":s=Math.min(s,Nl(o.coordinates,!0,a,r,s));break;case"Polygon":s=Math.min(s,FT(a,o.coordinates,r,s));break}if(s===0)return s}return s}function of(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]}var af=class _c{constructor(e,t){this.type=H,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(Vo(e[1])){const i=e[1];if(i.type==="FeatureCollection")return new _c(i,i.features.map(r=>of(r.geometry)).flat());if(i.type==="Feature")return new _c(i,of(i.geometry));if("type"in i&&"coordinates"in i)return new _c(i,of(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 OT(e,this.geometries);if(e.geometryType()==="LineString")return LT(e,this.geometries);if(e.geometryType()==="Polygon")return DT(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},lf=class x0{constructor(e){this.type=we,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 x0(i)}evaluate(e){const t=e.globals?.globalState;return!t||Object.keys(t).length===0?null:iy(t,this.key)??null}eachChild(){}outputDefined(){return!1}};const Gl={"==":tT,"!=":nT,">":rT,"<":iT,">=":oT,"<=":sT,array:ni,at:NC,boolean:ni,case:WC,coalesce:gy,collator:yy,format:lT,image:cT,in:zC,"index-of":GC,interpolate:yr,"interpolate-hcl":yr,"interpolate-lab":yr,length:uT,let:uy,literal:Fl,match:jC,number:ni,"number-format":aT,object:ni,slice:VC,step:dy,string:ni,"to-boolean":ps,"to-color":ps,"to-number":ps,"to-string":ps,var:hy,within:qh,distance:af,"global-state":lf};var Di=class sa{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=sa.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,u]of a){l=new cy(t.registry,jl,t.path,null,t.scope);const h=[];let f=!1;for(let d=1;d<e.length;d++){const g=e[d],p=Array.isArray(c)?c[d-1]:c.type,m=l.parse(g,1+h.length,p);if(!m){f=!0;break}h.push(m)}if(!f){if(Array.isArray(c)&&c.length!==h.length){l.error(`Expected ${c.length} arguments, but found ${h.length} instead.`);continue}for(let d=0;d<h.length;d++){const g=Array.isArray(c)?c[d]:c.type,p=h[d];l.concat(d+1).checkSubtype(g,p.type)}if(l.errors.length===0)return new sa(i,s,u,h)}}if(a.length===1)t.errors.push(...l.errors);else{const c=(a.length?a:o).map(([h])=>NT(h)).join(" | "),u=[];for(let h=1;h<e.length;h++){const f=t.parse(e[h],1+u.length);if(!f)return null;u.push(qe(f.type))}t.error(`Expected arguments of type ${c}, but found (${u.join(", ")}) instead.`)}return null}static register(e,t){sa.definitions=t;for(const i in t)e[i]=sa}};function Fy(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=oy(e,t,i,s);if(o)throw new et(o);return new Qe(e/255,t/255,i/255,s,!1)}function Oy(n,e){return n in e}function cf(n,e){const t=e[n];return typeof t>"u"?null:t}function kT(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 xr(n){return{type:n}}Di.register(Gl,{error:[bC,[ye],(n,[e])=>{throw new et(e.evaluate(n))}],typeof:[ye,[we],(n,[e])=>qe(ct(e.evaluate(n)))],"to-rgba":[Pt(H,4),[On],(n,[e])=>{const[t,i,r,s]=e.evaluate(n).rgb;return[t*255,i*255,r*255,s]}],rgb:[On,[H,H,H],Fy],rgba:[On,[H,H,H,H],Fy],has:{type:be,overloads:[[[ye],(n,[e])=>Oy(e.evaluate(n),n.properties())],[[ye,gr],(n,[e,t])=>Oy(e.evaluate(n),t.evaluate(n))]]},get:{type:we,overloads:[[[ye],(n,[e])=>cf(e.evaluate(n),n.properties())],[[ye,gr],(n,[e,t])=>cf(e.evaluate(n),t.evaluate(n))]]},"feature-state":[we,[ye],(n,[e])=>cf(e.evaluate(n),n.featureState||{})],properties:[gr,[],n=>n.properties()],"geometry-type":[ye,[],n=>n.geometryType()],id:[we,[],n=>n.id()],zoom:[H,[],n=>n.globals.zoom],"heatmap-density":[H,[],n=>n.globals.heatmapDensity||0],elevation:[H,[],n=>n.globals.elevation||0],"line-progress":[H,[],n=>n.globals.lineProgress||0],accumulated:[we,[],n=>n.globals.accumulated===void 0?null:n.globals.accumulated],"+":[H,xr(H),(n,e)=>{let t=0;for(const i of e)t+=i.evaluate(n);return t}],"*":[H,xr(H),(n,e)=>{let t=1;for(const i of e)t*=i.evaluate(n);return t}],"-":{type:H,overloads:[[[H,H],(n,[e,t])=>e.evaluate(n)-t.evaluate(n)],[[H],(n,[e])=>-e.evaluate(n)]]},"/":[H,[H,H],(n,[e,t])=>e.evaluate(n)/t.evaluate(n)],"%":[H,[H,H],(n,[e,t])=>e.evaluate(n)%t.evaluate(n)],ln2:[H,[],()=>Math.LN2],pi:[H,[],()=>Math.PI],e:[H,[],()=>Math.E],"^":[H,[H,H],(n,[e,t])=>Math.pow(e.evaluate(n),t.evaluate(n))],sqrt:[H,[H],(n,[e])=>Math.sqrt(e.evaluate(n))],log10:[H,[H],(n,[e])=>Math.log(e.evaluate(n))/Math.LN10],ln:[H,[H],(n,[e])=>Math.log(e.evaluate(n))],log2:[H,[H],(n,[e])=>Math.log(e.evaluate(n))/Math.LN2],sin:[H,[H],(n,[e])=>Math.sin(e.evaluate(n))],cos:[H,[H],(n,[e])=>Math.cos(e.evaluate(n))],tan:[H,[H],(n,[e])=>Math.tan(e.evaluate(n))],asin:[H,[H],(n,[e])=>Math.asin(e.evaluate(n))],acos:[H,[H],(n,[e])=>Math.acos(e.evaluate(n))],atan:[H,[H],(n,[e])=>Math.atan(e.evaluate(n))],min:[H,xr(H),(n,e)=>Math.min(...e.map(t=>t.evaluate(n)))],max:[H,xr(H),(n,e)=>Math.max(...e.map(t=>t.evaluate(n)))],abs:[H,[H],(n,[e])=>Math.abs(e.evaluate(n))],round:[H,[H],(n,[e])=>{const t=e.evaluate(n);return t<0?-Math.round(-t):Math.round(t)}],floor:[H,[H],(n,[e])=>Math.floor(e.evaluate(n))],ceil:[H,[H],(n,[e])=>Math.ceil(e.evaluate(n))],"filter-==":[be,[ye,we],(n,[e,t])=>n.properties()[e.value]===t.value],"filter-id-==":[be,[we],(n,[e])=>n.id()===e.value],"filter-type-==":[be,[ye],(n,[e])=>n.geometryType()===e.value],"filter-<":[be,[ye,we],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<r}],"filter-id-<":[be,[we],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<i}],"filter->":[be,[ye,we],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>r}],"filter-id->":[be,[we],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>i}],"filter-<=":[be,[ye,we],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[be,[we],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t<=i}],"filter->=":[be,[ye,we],(n,[e,t])=>{const i=n.properties()[e.value],r=t.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[be,[we],(n,[e])=>{const t=n.id(),i=e.value;return typeof t==typeof i&&t>=i}],"filter-has":[be,[we],(n,[e])=>e.value in n.properties()],"filter-has-id":[be,[],n=>n.id()!==null&&n.id()!==void 0],"filter-type-in":[be,[Pt(ye)],(n,[e])=>e.value.indexOf(n.geometryType())>=0],"filter-id-in":[be,[Pt(we)],(n,[e])=>e.value.indexOf(n.id())>=0],"filter-in-small":[be,[ye,Pt(we)],(n,[e,t])=>t.value.indexOf(n.properties()[e.value])>=0],"filter-in-large":[be,[ye,Pt(we)],(n,[e,t])=>kT(n.properties()[e.value],t.value,0,t.value.length-1)],all:{type:be,overloads:[[[be,be],(n,[e,t])=>e.evaluate(n)&&t.evaluate(n)],[xr(be),(n,e)=>{for(const t of e)if(!t.evaluate(n))return!1;return!0}]]},any:{type:be,overloads:[[[be,be],(n,[e,t])=>e.evaluate(n)||t.evaluate(n)],[xr(be),(n,e)=>{for(const t of e)if(t.evaluate(n))return!0;return!1}]]},"!":[be,[be],(n,[e])=>!e.evaluate(n)],"is-supported-script":[be,[ye],(n,[e])=>{const t=n.globals&&n.globals.isSupportedScript;return t?t(e.evaluate(n)):!0}],upcase:[ye,[ye],(n,[e])=>e.evaluate(n).toUpperCase()],downcase:[ye,[ye],(n,[e])=>e.evaluate(n).toLowerCase()],concat:[ye,xr(we),(n,e)=>e.map(t=>Xo(t.evaluate(n))).join("")],split:[Pt(ye),[ye,ye],(n,[e,t])=>e.evaluate(n).split(t.evaluate(n))],join:[ye,[Pt(ye),ye],(n,[e,t])=>e.evaluate(n).join(t.evaluate(n))],"resolved-locale":[ye,[Rl],(n,[e])=>e.evaluate(n).resolvedLocale()]});function NT(n){return Array.isArray(n)?`(${n.map(qe).join(", ")})`:`(${qe(n.type)}...)`}function jl(n){if(n instanceof hy)return jl(n.boundExpression);if(n instanceof Di&&n.name==="error")return!1;if(n instanceof yy)return!1;if(n instanceof qh)return!1;if(n instanceof af)return!1;if(n instanceof lf)return!1;const e=n instanceof ps||n instanceof ni;let t=!0;return n.eachChild(i=>{e?t=t&&jl(i):t=t&&i instanceof Fl}),t?uf(n)&&ff(n,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}function uf(n){if(n instanceof Di){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 qh||n instanceof af)return!1;let e=!0;return n.eachChild(t=>{e&&!uf(t)&&(e=!1)}),e}function hf(n){if(n instanceof Di&&n.name==="feature-state")return!1;let e=!0;return n.eachChild(t=>{e&&!hf(t)&&(e=!1)}),e}function ff(n,e){if(n instanceof Di&&e.indexOf(n.name)>=0)return!1;let t=!0;return n.eachChild(i=>{t&&!ff(i,e)&&(t=!1)}),t}function df(n){return{result:"success",value:n}}function _s(n){return{result:"error",value:n}}function zT(n){return n["property-type"]==="data-driven"||n["property-type"]==="cross-faded-data-driven"}function GT(n){return!!n.expression&&n.expression.parameters.indexOf("zoom")>-1}function jT(n){return!!n.expression&&n.expression.interpolated}function Wl(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&ct(n)===gr}var WT=class{constructor(n,e,t){this.expression=n,this._warningHistory={},this._evaluator=new ly,this._defaultValue=e?XT(e):null,this._enumValues=e&&e.type==="enum"?e.values:null,this._globalState=t}evaluateWithoutErrorHandling(n,e,t,i,r,s){return this._globalState&&(n=xs(n,this._globalState)),this._evaluator.globals=n,this._evaluator.feature=e,this._evaluator.featureState=t,this._evaluator.canonical=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=s,this.expression.evaluate(this._evaluator)}evaluate(n,e,t,i,r,s){this._globalState&&(n=xs(n,this._globalState)),this._evaluator.globals=n,this._evaluator.feature=e||null,this._evaluator.featureState=t||null,this._evaluator.canonical=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=s||null;try{const o=this.expression.evaluate(this._evaluator);if(o==null||typeof o=="number"&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new et(`Expected value to be one of ${Object.keys(this._enumValues).map(a=>JSON.stringify(a)).join(", ")}, but found ${JSON.stringify(o)} instead.`);return o}catch(o){return this._warningHistory[o.message]||(this._warningHistory[o.message]=!0,typeof console<"u"&&console.warn(o.message)),this._defaultValue}}};function Vl(n){return Array.isArray(n)&&n.length>0&&typeof n[0]=="string"&&n[0]in Gl}function Ly(n,e,t){const i=new cy(Gl,jl,[],e?VT(e):void 0),r=i.parse(n,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return r?df(new WT(r,e,t)):_s(i.errors)}var Dy=class{constructor(n,e,t){this.kind=n,this._styleExpression=e,this.isStateDependent=n!=="constant"&&!hf(e.expression),this.globalStateRefs=Ul(e.expression),this._globalState=t}evaluateWithoutErrorHandling(n,e,t,i,r,s){return this._globalState&&(n=xs(n,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(n,e,t,i,r,s)}evaluate(n,e,t,i,r,s){return this._globalState&&(n=xs(n,this._globalState)),this._styleExpression.evaluate(n,e,t,i,r,s)}},ky=class{constructor(n,e,t,i,r){this.kind=n,this.zoomStops=t,this._styleExpression=e,this.isStateDependent=n!=="camera"&&!hf(e.expression),this.globalStateRefs=Ul(e.expression),this.interpolationType=i,this._globalState=r}evaluateWithoutErrorHandling(n,e,t,i,r,s){return this._globalState&&(n=xs(n,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(n,e,t,i,r,s)}evaluate(n,e,t,i,r,s){return this._globalState&&(n=xs(n,this._globalState)),this._styleExpression.evaluate(n,e,t,i,r,s)}interpolationFactor(n,e,t){return this.interpolationType?yr.interpolationFactor(this.interpolationType,n,e,t):0}};function Ny(n,e,t){const i=Ly(n,e,t);if(i.result==="error")return i;const r=i.value.expression,s=uf(r);if(!s&&!zT(e))return _s([new Fn("","data expressions not supported")]);const o=ff(r,["zoom"]);if(!o&&!GT(e))return _s([new Fn("","zoom expressions not supported")]);const a=Xl(r);if(!a&&!o)return _s([new Fn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Fn)return _s([a]);if(a instanceof yr&&!jT(e))return _s([new Fn("",'"interpolate" expressions cannot be used with this property')]);if(!a)return df(s?new Dy("constant",i.value,t):new Dy("source",i.value,t));const l=a instanceof yr?a.interpolation:void 0;return df(s?new ky("camera",i.value,a.labels,l,t):new ky("composite",i.value,a.labels,l,t))}function Xl(n){let e=null;if(n instanceof uy)e=Xl(n.result);else if(n instanceof gy){for(const t of n.args)if(e=Xl(t),e)break}else(n instanceof dy||n instanceof yr)&&n.input instanceof Di&&n.input.name==="zoom"&&(e=n);return e instanceof Fn||n.eachChild(t=>{const i=Xl(t);i instanceof Fn?e=i:!e&&i?e=new Fn("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Fn("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Ul(n,e=new Set){return n instanceof lf&&e.add(n.key),n.eachChild(t=>{Ul(t,e)}),e}function VT(n){const e={color:On,string:ye,number:H,enum:ye,boolean:be,formatted:Sl,padding:Il,numberArray:Ml,colorArray:ko,projectionDefinition:Tl,resolvedImage:No,variableAnchorOffsetCollection:Al};return n.type==="array"?Pt(e[n.value]||we,n.length):e[n.type]}function XT(n){if(n.type==="color"&&Wl(n.default))return new Qe(0,0,0,0);switch(n.type){case"color":return Qe.parse(n.default)||null;case"padding":return hs.parse(n.default)||null;case"numberArray":return fs.parse(n.default)||null;case"colorArray":return Li.parse(n.default)||null;case"variableAnchorOffsetCollection":return ds.parse(n.default)||null;case"projectionDefinition":return Wo.parse(n.default)||null;default:return n.default===void 0?null:n.default}}function xs(n,e){const{zoom:t,heatmapDensity:i,elevation:r,lineProgress:s,isSupportedScript:o,accumulated:a}=n??{};return{zoom:t,heatmapDensity:i,elevation:r,lineProgress:s,isSupportedScript:o,accumulated:a,globalState:e}}function zy(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(!zy(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const UT={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function BT(n,e){if(n==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};zy(n)||(n=Bl(n));const t=Ly(n,UT,e);if(t.result==="error")throw new Error(t.value.map(i=>`${i.key}: ${i.message}`).join(", "));return{filter:(i,r,s)=>t.value.evaluate(i,r,{},s),needGeometry:Gy(n),getGlobalStateRefs:()=>Ul(t.value.expression)}}function $T(n,e){return n<e?-1:n>e?1:0}function Gy(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(Gy(n[e]))return!0;return!1}function Bl(n){if(!n)return!0;const e=n[0];return n.length<=1?e!=="any":e==="=="?gf(n[1],n[2],"=="):e==="!="?$l(gf(n[1],n[2],"==")):e==="<"||e===">"||e==="<="||e===">="?gf(n[1],n[2],e):e==="any"?KT(n.slice(1)):e==="all"?["all"].concat(n.slice(1).map(Bl)):e==="none"?["all"].concat(n.slice(1).map(Bl).map($l)):e==="in"?jy(n[1],n.slice(2)):e==="!in"?$l(jy(n[1],n.slice(2))):e==="has"?Wy(n[1]):e==="!has"?$l(Wy(n[1])):!0}function gf(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 KT(n){return["any"].concat(n.map(Bl))}function jy(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($T)]]:["filter-in-small",n,["literal",e]]}}function Wy(n){switch(n){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",n]}}function $l(n){return["!",n]}function $o(n){return typeof n=="object"?["literal",n]:n}function Vy(n,e){let t=n.stops;if(!t)return YT(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],JT(o[1])]:[o[0],$o(o[1])]),i?ZT(n,e,t):s?HT(n,e,t):mf(n,e,t)}function YT(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,$o(n.default)];return e.type==="array"&&i.splice(1,0,e.value,e.length||null),i}}function pf(n){switch(n.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function ZT(n,e,t){const i={},r={},s=[];for(let o=0;o<t.length;o++){const a=t[o],l=a[0].zoom;i[l]===void 0&&(i[l]={zoom:l,type:n.type,property:n.property,default:n.default},r[l]=[],s.push(l)),r[l].push([a[0].value,a[1]])}if(_f({},e)==="exponential"){const o=[pf(n),["linear"],["zoom"]];for(const a of s)vs(o,a,mf(i[a],e,r[a]),!1);return o}else{const o=["step",["zoom"]];for(const a of s)vs(o,a,mf(i[a],e,r[a]),!0);return yf(o),o}}function qT(n,e){if(n!==void 0)return n;if(e!==void 0)return e}function Xy(n,e){const t=$o(qT(n.default,e.default));return t===void 0&&e.type==="resolvedImage"?"":t}function mf(n,e,t){const i=_f(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(Xy(n,e)),s}else if(i==="categorical"){const s=["match",r];for(const o of t)vs(s,o[0],o[1],!1);return s.push(Xy(n,e)),s}else if(i==="interval"){const s=["step",["number",r]];for(const o of t)vs(s,o[0],o[1],!0);return yf(s),n.default===void 0?s:["case",["==",["typeof",r],"number"],s,$o(n.default)]}else if(i==="exponential"){const s=n.base!==void 0?n.base:1,o=[pf(n),s===1?["linear"]:["exponential",s],["number",r]];for(const a of t)vs(o,a[0],a[1],!1);return n.default===void 0?o:["case",["==",["typeof",r],"number"],o,$o(n.default)]}else throw new Error(`Unknown property function type ${i}`)}function HT(n,e,t,i=["zoom"]){const r=_f(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=[pf(n),a===1?["linear"]:["exponential",a],i]}else throw new Error(`Unknown zoom function type "${r}"`);for(const a of t)vs(s,a[0],a[1],o);return yf(s),s}function yf(n){n[0]==="step"&&n.length===3&&(n.push(0),n.push(n[3]))}function vs(n,e,t,i){n.length>3&&e===n[n.length-2]||(i&&n.length===2||n.push(e),n.push(t))}function _f(n,e){return n.type?n.type:e.expression.interpolated?"exponential":"interval"}function JT(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 Uy=xC;class ws extends Sn{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 ws,t=this.geometryName_;e.setGeometryName(t);const i=this.getPropertiesInternal();if(i){const s=this.getGeometry();for(const o in i)o===t&&s?e.set(o,s.clone()):e.set(o,i[o],!0)}const r=this.getStyle();return r&&e.setStyle(r),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_&&(We(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=Te(e,de.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?QT(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){e!==this.geometryName_&&(this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_())}}function QT(n){if(typeof n=="function")return n;let e;return Array.isArray(n)?e=n:(Oe(typeof n.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[n]),function(){return e}}function Kl(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 u=n[e],h=n[e+1],f=0;const d=[0];for(let m=e+i;m<t;m+=i){const y=n[m],_=n[m+1];f+=Math.sqrt((y-u)*(y-u)+(_-h)*(_-h)),d.push(f),u=y,h=_}const g=r*f,p=sv(d,g);p<0?(l=(g-d[-p-2])/(d[-p-1]-d[-p-2]),a=e+(-p-2)*i):a=e+p*i}o=o>1?o:2,s=s||new Array(o);for(let u=0;u<o;++u)s[u]=a===void 0?NaN:l===void 0?n[a+u]:Ut(n[a+u],n[a+i+u],l);return s}function xf(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 f=a+l>>1;r<n[(f+1)*i-1]?l=f:a=f+1}const c=n[a*i-1];if(r==c)return n.slice((a-1)*i,(a-1)*i+i);const u=n[(a+1)*i-1],h=(r-c)/(u-c);o=[];for(let f=0;f<i-1;++f)o.push(Ut(n[(a-1)*i+f],n[a*i+f],h));return o.push(r),o}function eR(n,e,t,i,r,s,o){if(o)return xf(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 u=t[l];if(e!=u){if(r<n[e+i-1])return null;if(r<=n[u-1])return xf(n,e,u,i,r,!1);e=u}}return null}function vf(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 ki extends nr{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){Rn(this.flatCoordinates,e),this.changed()}clone(){const e=new ki(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Hi(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Au(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))}forEachSegment(e){return Mp(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,xf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return Ti(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return Kl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return vf(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=el(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0),new ki(t,"XY")}getType(){return"LineString"}intersectsExtent(e){return tl(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=Qa(this.flatCoordinates,0,e,this.stride),this.changed()}}class Ko extends nr{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 u=r[l];Rn(s,u.getFlatCoordinates()),o.push(s.length)}const a=r.length===0?this.getLayout():r[0].getLayout();this.setFlatCoordinates(a,s),this.ends_=o}}appendLineString(e){Rn(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Ko(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,t,i,r){return r<Hi(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Pu(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ou(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,eR(this.flatCoordinates,0,this.ends_,this.stride,e,t,i))}getCoordinates(){return lo(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new ki(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 ki(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+=vf(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=Kl(t,i,l,s,.5);Rn(e,c),i=l}return e}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Sp(this.flatCoordinates,0,this.ends_,this.stride,e,t,0,i),new Ko(t,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(e){return Sw(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=ao(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()}}class Yo extends nr{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){Rn(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){const e=new Yo(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<Hi(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=qi(e,t,s[a],s[a+1]);if(c<r){r=c;for(let u=0;u<o;++u)i[u]=s[a+u];i.length=o}}return r}getCoordinates(){return Ti(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new qn(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 qn(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(au(e,o,a))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Qa(this.flatCoordinates,0,e,this.stride),this.changed()}}function By(n,e,t,i){const r=[];let s=Bt();for(let o=0,a=t.length;o<a;++o){const l=t[o];s=uu(n,e,l[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=l[l.length-1]}return r}class Zo extends nr{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],u=s.length,h=c.getEnds();for(let f=0,d=h.length;f<d;++f)h[f]+=u;Rn(s,c.getFlatCoordinates()),o.push(h)}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;Rn(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 Zo(this.flatCoordinates.slice(),this.layout,t);return i.applyProperties(this),i}closestPointXY(e,t,i,r){return r<Hi(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(vw(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ww(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))}containsXY(e,t){return Rw(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return xw(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e!==void 0?(t=this.getOrientedFlatCoordinates().slice(),ju(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,Lu(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=By(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Ip(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Yo(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;Fp(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=ju(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const t=[],i=[];return t.length=Cw(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),t,0,i),new Zo(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 Hn(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 h=0,f=l.length;h<f;++h)l[h]-=s;const u=new Hn(t.slice(s,c),e,l);r.push(u),s=c}return r}getType(){return"MultiPolygon"}intersectsExtent(e){return Iw(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Rp(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 $y=Gt();class Tt{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"?cu(this.flatCoordinates_):uu(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=zt(this.getExtent());this.flatInteriorPoints_=Nu(this.flatCoordinates_,0,this.ends_,this.stride_,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=Op(this.flatCoordinates_,this.ends_),t=By(this.flatCoordinates_,0,e,this.stride_);this.flatInteriorPoints_=Ip(this.flatCoordinates_,0,e,this.stride_,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Kl(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,.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=Kl(e,t,o,this.stride_,.5);Rn(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=Le(e);const t=e.getExtent(),i=e.getWorldExtent();if(t&&i){const r=ot(i)/ot(t);In($y,i[0],i[3],r,-r,0,0,0),Ci(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,$y,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new Tt(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=Lg((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=el(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,i,0),r=[i.length];break;case"MultiLineString":r=[],i.length=Sp(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,i,0,r);break;case"Polygon":r=[],i.length=Du(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),i,0,r);break}return r&&(this.simplifiedGeometry_=new Tt(this.type_,i,r,this.stride_,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}Tt.prototype.getFlatCoordinates=Tt.prototype.getOrientedFlatCoordinates;class Yl extends wp{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(We),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const e=this.geometries_;for(let t=0,i=e.length;t<i;++t)this.changeEventsKeys_.push(Te(e[t],de.CHANGE,this.changed,this))}clone(){const e=new Yl(wf(this.geometries_));return e.applyProperties(this),e}closestPointXY(e,t,i,r){if(r<Hi(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){Wr(e);const t=this.geometries_;for(let i=0,r=t.length;i<r;++i)Ug(e,t[i].getExtent());return e}getGeometries(){return wf(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 Yl(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=zt(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(wf(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 wf(n){return n.map(e=>e.clone())}class Ky{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=ws,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let i=t.dataProjection?Le(t.dataProjection):this.readProjection(e);t.extent&&i&&i.getUnits()==="tile-pixels"&&(i=Le(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 pe()}readFeature(e,t){return pe()}readFeatures(e,t){return pe()}readGeometry(e,t){return pe()}readProjection(e){return pe()}writeFeature(e,t){return pe()}writeFeatures(e,t){return pe()}writeGeometry(e,t){return pe()}}function Zl(n,e,t){const i=t?Le(t.featureProjection):null,r=t?Le(t.dataProjection):null;let s=n;if(i&&r&&!bt(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(tr(o,a))}if(e&&t&&t.decimals!==void 0){const o=Math.pow(10,t.decimals),a=function(l){for(let c=0,u=l.length;c<u;++c)l[c]=Math.round(l[c]*o)/o;return l};s===n&&(s=n.clone()),s.applyTransform(a)}return s}const tR={Point:qn,LineString:ki,Polygon:Hn,MultiPoint:Yo,MultiLineString:Ko,MultiPolygon:Zo};function nR(n,e,t){return Array.isArray(e[0])?(Fp(n,0,e,t)||(n=n.slice(),ju(n,0,e,t)),n):(Gu(n,0,e,t)||(n=n.slice(),nl(n,0,e,t)),n)}function Yy(n,e){const t=n.geometry;if(!t)return[];if(Array.isArray(t))return t.map(s=>Yy({...n,geometry:s})).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 Zl(new Tt(i,i==="Polygon"?nR(t.flatCoordinates,t.ends,r):t.flatCoordinates,t.ends?.flat(),r,n.properties||{},n.id).enableSimplifyTransformed(),!1,e)}function Ef(n,e){if(!n)return null;if(Array.isArray(n)){const i=n.map(r=>Ef(r,e));return new Yl(i)}const t=tR[n.type];return Zl(new t(n.flatCoordinates,n.layout||"XY",n.ends),!1,e)}class iR extends Ky{constructor(){super()}getType(){return"json"}readFeature(e,t){return this.readFeatureFromObject(ql(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(ql(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return pe()}readFeaturesFromObject(e,t){return pe()}readGeometry(e,t){return this.readGeometryFromObject(ql(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return pe()}readProjection(e){return this.readProjectionFromObject(ql(e))}readProjectionFromObject(e){return pe()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return pe()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return pe()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return pe()}}function ql(n){if(typeof n=="string"){const e=JSON.parse(n);return e||null}return n!==null?n:null}class Zy extends iR{constructor(e){e=e||{},super(),this.dataProjection=Le(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=Le(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=bf(i.geometry);if(this.featureClass===Tt)return Yy({geometry:r,id:i.id,properties:i.properties},t);const s=new ws;return this.geometryName_?s.setGeometryName(this.geometryName_):this.extractGeometryName_&&i.geometry_name&&s.setGeometryName(i.geometry_name),s.setGeometry(Ef(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 rR(e,t)}readProjectionFromObject(e){const t=e.crs;let i;if(t)if(t.type=="name")i=Le(t.properties.name);else if(t.type==="EPSG")i=Le("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=Cf(o,t),delete s[e.getGeometryName()]),mi(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 Cf(e,this.adaptOptions(t))}}function bf(n,e){if(!n)return null;let t;switch(n.type){case"Point":{t=oR(n);break}case"LineString":{t=aR(n);break}case"Polygon":{t=hR(n);break}case"MultiPoint":{t=cR(n);break}case"MultiLineString":{t=lR(n);break}case"MultiPolygon":{t=uR(n);break}case"GeometryCollection":{t=sR(n);break}default:throw new Error("Unsupported GeoJSON type: "+n.type)}return t}function rR(n,e){const t=bf(n);return Ef(t,e)}function sR(n,e){return n.geometries.map(function(i){return bf(i)})}function oR(n){const e=n.coordinates;return{type:"Point",flatCoordinates:e,layout:ir(e.length)}}function aR(n){const e=n.coordinates,t=e.flat();return{type:"LineString",flatCoordinates:t,ends:[t.length],layout:ir(e[0]?.length||2)}}function lR(n){const e=n.coordinates,t=e[0]?.[0]?.length||2,i=[],r=ao(i,0,e,t);return{type:"MultiLineString",flatCoordinates:i,ends:r,layout:ir(t)}}function cR(n){const e=n.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:ir(e[0]?.length||2)}}function uR(n){const e=n.coordinates,t=[],i=e[0]?.[0]?.[0].length||2,r=Rp(t,0,e,i);return{type:"MultiPolygon",flatCoordinates:t,ends:r,layout:ir(i)}}function hR(n){const e=n.coordinates,t=[],i=e[0]?.[0]?.length,r=ao(t,0,e,i);return{type:"Polygon",flatCoordinates:t,ends:r,layout:ir(i)}}function Cf(n,e){n=Zl(n,!0,e);const t=n.getType();let i;switch(t){case"Point":{i=yR(n);break}case"LineString":{i=dR(n);break}case"Polygon":{i=_R(n,e);break}case"MultiPoint":{i=pR(n);break}case"MultiLineString":{i=gR(n);break}case"MultiPolygon":{i=mR(n,e);break}case"GeometryCollection":{i=fR(n,e);break}case"Circle":{i={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+t)}return i}function fR(n,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:n.getGeometriesArray().map(function(i){return Cf(i,e)})}}function dR(n,e){return{type:"LineString",coordinates:n.getCoordinates()}}function gR(n,e){return{type:"MultiLineString",coordinates:n.getCoordinates()}}function pR(n,e){return{type:"MultiPoint",coordinates:n.getCoordinates()}}function mR(n,e){let t;return e&&(t=e.rightHanded),{type:"MultiPolygon",coordinates:n.getCoordinates(t)}}function yR(n,e){return{type:"Point",coordinates:n.getCoordinates()}}function _R(n,e){let t;return e&&(t=e.rightHanded),{type:"Polygon",coordinates:n.getCoordinates(t)}}const Tf=65536*65536,qy=1/Tf,xR=12,Hy=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Rf=0,Hl=1,qo=2,Jl=5;class vR{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)*Tf;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Tf;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,wR(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>=xR&&Hy?Hy.decode(this.buf.subarray(t,e)):LR(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===qo?this.readVarint()+this.pos:this.pos+1}skip(e){const t=e&7;if(t===Rf)for(;this.buf[this.pos++]>127;);else if(t===qo)this.pos=this.readVarint()+this.pos;else if(t===Jl)this.pos+=4;else if(t===Hl)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*qy),!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*qy),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){ER(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=DR(this.buf,e,this.pos);const i=this.pos-t;i>=128&&Jy(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&&Jy(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}writeMessage(e,t,i){this.writeTag(e,qo),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,TR,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,RR,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,MR,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,SR,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,IR,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,AR,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,PR,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,FR,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,OR,t)}writeBytesField(e,t){this.writeTag(e,qo),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,Jl),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,Jl),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,Hl),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,Hl),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,Rf),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,Rf),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,qo),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,Jl),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,Hl),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function wR(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 Es(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function Es(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function ER(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),bR(t,i,e),CR(i,e)}function bR(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 CR(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 Jy(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 TR(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t])}function RR(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t])}function SR(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t])}function IR(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t])}function MR(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t])}function AR(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t])}function PR(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t])}function FR(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t])}function OR(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t])}function LR(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,u;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],u=n[r+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(o=(s&15)<<18|(l&63)<<12|(c&63)<<6|u&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 DR(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 Qy extends Ky{constructor(e){super(),e=e||{},this.dataProjection=new $a({code:"",units:"tile-pixels"}),this.featureClass=e.featureClass?e.featureClass:Tt,this.geometryName_=e.geometryName,this.layerName_=e.layerName?e.layerName:"layer",this.layers_=e.layers?e.layers:null,this.idProperty_=e.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(e,t,i,r){e.pos=t.geometry;const s=e.readVarint()+e.pos;let o=1,a=0,l=0,c=0,u=0,h=0;for(;e.pos<s;){if(!a){const f=e.readVarint();o=f&7,a=f>>3}if(a--,o===1||o===2)l+=e.readSVarint(),c+=e.readSVarint(),o===1&&u>h&&(r.push(u),h=u),i.push(l,c),u+=2;else if(o===7)u>h&&(i.push(i[h],i[h+1]),u+=2);else throw new Error("Invalid command found in the PBF")}u>h&&(r.push(u),h=u)}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 u=jR(r,c.length);if(this.featureClass===Tt)s=new this.featureClass(u,l,c,2,o,a),s.transform(i.dataProjection);else{let h;if(u=="Polygon"){const g=Op(l,c);h=g.length>1?new Zo(l,"XY",g):new Hn(l,"XY",c)}else h=u==="Point"?new qn(l,"XY"):u==="LineString"?new ki(l,"XY"):u==="MultiPoint"?new Yo(l,"XY"):u==="MultiLineString"?new Ko(l,"XY",c):null;const f=this.featureClass;s=new f,this.geometryName_&&s.setGeometryName(this.geometryName_);const d=Zl(h,!1,i);s.setGeometry(d),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=Le(t.dataProjection);r.setWorldExtent(t.extent),t.dataProjection=r;const s=new vR(e),o=s.readFields(kR,{}),a=[];for(const l in o){if(i&&!i.includes(l))continue;const c=o[l],u=c?[0,0,c.extent,c.extent]:null;r.setExtent(u);for(let h=0,f=c.length;h<f;++h){const d=GR(s,c,h),g=this.createFeature_(s,d,t);g!==null&&a.push(g)}}return a}readProjection(e){return this.dataProjection}setLayers(e){this.layers_=e}}function kR(n,e,t){if(n===3){const i={keys:[],values:[],features:[]},r=t.readVarint()+t.pos;t.readFields(NR,i,r),i.length=i.features.length,i.length&&(e[i.name]=i)}}function NR(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 zR(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 GR(n,e,t){n.pos=e.features[t];const i=n.readVarint()+n.pos,r={layer:e,type:0,properties:{}};return n.readFields(zR,r,i),r}function jR(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 e_{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){}}const ue={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},Ql=[ue.FILL],Ni=[ue.STROKE],vr=[ue.BEGIN_PATH],t_=[ue.CLOSE_PATH];class Ho extends e_{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],Ji(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 u=e[t],h=e[t+1];const f=this.tmpCoordinate_;let d=!0,g,p,m;for(g=t+r;g<i;g+=r)f[0]=e[g],f[1]=e[g+1],m=lu(c,f),m!==p?(d&&(a[l++]=u,a[l++]=h,d=!1),a[l++]=f[0],a[l++]=f[1]):m===gt.INTERSECTING?(a[l++]=f[0],a[l++]=f[1],d=!1):d=!0,u=f[0],h=f[1],p=m;return(s&&d||g===t+r)&&(a[l++]=u,a[l++]=h),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,u,h,f,d;switch(o){case"MultiPolygon":c=e.getOrientedFlatCoordinates(),f=[];const g=e.getEndss();d=0;for(let p=0,m=g.length;p<m;++p){const y=[];d=this.drawCustomCoordinates_(c,d,g[p],a,y),f.push(y)}this.instructions.push([ue.CUSTOM,l,f,e,i,Lu,s]),this.hitDetectionInstructions.push([ue.CUSTOM,l,f,e,r||i,Lu,s]);break;case"Polygon":case"MultiLineString":h=[],c=o=="Polygon"?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),d=this.drawCustomCoordinates_(c,0,e.getEnds(),a,h),this.instructions.push([ue.CUSTOM,l,h,e,i,lo,s]),this.hitDetectionInstructions.push([ue.CUSTOM,l,h,e,r||i,lo,s]);break;case"LineString":case"Circle":c=e.getFlatCoordinates(),u=this.appendFlatLineCoordinates(c,0,c.length,a,!1,!1),this.instructions.push([ue.CUSTOM,l,u,e,i,Ti,s]),this.hitDetectionInstructions.push([ue.CUSTOM,l,u,e,r||i,Ti,s]);break;case"MultiPoint":c=e.getFlatCoordinates(),u=this.appendFlatPointCoordinates(c,a),u>l&&(this.instructions.push([ue.CUSTOM,l,u,e,i,Ti,s]),this.hitDetectionInstructions.push([ue.CUSTOM,l,u,e,r||i,Ti,s]));break;case"Point":c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([ue.CUSTOM,l,u,e,i,void 0,s]),this.hitDetectionInstructions.push([ue.CUSTOM,l,u,e,r||i,void 0,s]);break}this.endGeometry(t)}beginGeometry(e,t,i){this.beginGeometryInstruction1_=[ue.BEGIN_GEOMETRY,t,0,e,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ue.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==ue.END_GEOMETRY?o=t:s==ue.BEGIN_GEOMETRY&&(r[2]=t,av(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=An(i||Wt)??void 0}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){const i=e.getColor();t.strokeStyle=An(i||Pn);const r=e.getLineCap();t.lineCap=r!==void 0?r:es;const s=e.getLineDash();t.lineDash=s?s.slice():Jn;const o=e.getLineDashOffset();t.lineDashOffset=o||Qn;const a=e.getLineJoin();t.lineJoin=a!==void 0?a:ts;const l=e.getWidth();t.lineWidth=l!==void 0?l:Io;const c=e.getMiterLimit();t.miterLimit=c!==void 0?c:Ro;const u=e.getOffset();t.strokeOffset=u??ob,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,t.strokeOffset=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=[ue.SET_FILL_STYLE,t];return typeof t!="string"&&i.push(e.fillPatternScale),i}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[ue.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;(i!==void 0&&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,u=e.strokeOffset;(e.currentStrokeStyle!=i||e.currentLineCap!=r||s!=e.currentLineDash&&!yi(e.currentLineDash,s)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=l||e.currentMiterLimit!=c||e.currentStrokeOffset!=u)&&(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,e.currentStrokeOffset=u)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const t=[ue.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Xg(this.maxExtent),this.maxLineWidth>0)){const e=this.resolution*(this.maxLineWidth+1)/2;Xn(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class WR extends Ho{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&&!Ji(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([ue.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([ue.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||Ji(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([ue.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([ue.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 VR extends Ho{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinates_(e,t,i,r,s){const o=this.coordinates.length,a=this.appendFlatLineCoordinates(e,t,i,r,!1,!1);return this.instructions.push([ue.MOVE_TO_LINE_TO,o,a,s*this.pixelRatio]),this.hitDetectionInstructions.push([ue.MOVE_TO_LINE_TO,o,a,s]),i}drawLineString(e,t,i){const r=this.state,s=r.strokeStyle,o=r.lineWidth,a=r.strokeOffset;if(s===void 0||o===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,i),this.hitDetectionInstructions.push([ue.SET_STROKE_STYLE,Pn,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Jn,Qn],vr);const l=e.getFlatCoordinates(),c=e.getStride();this.drawFlatCoordinates_(l,0,l.length,c,a),this.hitDetectionInstructions.push(Ni),this.endGeometry(t)}drawMultiLineString(e,t,i){const r=this.state,s=r.strokeStyle,o=r.lineWidth,a=r.strokeOffset;if(s===void 0||o===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,i),this.hitDetectionInstructions.push([ue.SET_STROKE_STYLE,Pn,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Jn,Qn],vr);const l=e.getEnds(),c=e.getFlatCoordinates(),u=e.getStride();let h=0;for(let f=0,d=l.length;f<d;++f)h=this.drawFlatCoordinates_(c,h,l[f],u,a);this.hitDetectionInstructions.push(Ni),this.endGeometry(t)}finish(){const e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Ni),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Ni),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(vr)}}class n_ extends Ho{constructor(e,t,i,r){super(e,t,i,r)}drawFlatCoordinatess_(e,t,i,r,s){const o=this.state,a=o.fillStyle!==void 0,l=o.strokeStyle!==void 0,c=i.length;this.instructions.push(vr),this.hitDetectionInstructions.push(vr);for(let u=0;u<c;++u){const h=i[u],f=this.coordinates.length,d=this.appendFlatLineCoordinates(e,t,h,r,!0,!l);this.instructions.push([ue.MOVE_TO_LINE_TO,f,d,s*this.pixelRatio,!0]),this.hitDetectionInstructions.push([ue.MOVE_TO_LINE_TO,f,d,s,!0]),l&&(this.instructions.push(t_),this.hitDetectionInstructions.push(t_)),t=h}return a&&(this.instructions.push(Ql),this.hitDetectionInstructions.push(Ql)),l&&(this.instructions.push(Ni),this.hitDetectionInstructions.push(Ni)),t}drawCircle(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle,a=r.strokeOffset;if(s===void 0&&o===void 0||this.handleStrokeOffset_(()=>this.drawCircle(e,t,i)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_FILL_STYLE,Wt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_STROKE_STYLE,Pn,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Jn,Qn]);const l=e.getFlatCoordinates(),c=e.getStride(),u=this.coordinates.length;this.appendFlatLineCoordinates(l,0,l.length,c,!1,!1);const h=[ue.CIRCLE,u,a];this.instructions.push(vr,h),this.hitDetectionInstructions.push(vr,h),r.fillStyle!==void 0&&(this.instructions.push(Ql),this.hitDetectionInstructions.push(Ql)),r.strokeStyle!==void 0&&(this.instructions.push(Ni),this.hitDetectionInstructions.push(Ni)),this.endGeometry(t)}drawPolygon(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle,a=r.strokeOffset;if(s===void 0&&o===void 0||this.handleStrokeOffset_(()=>this.drawPolygon(e,t,i)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_FILL_STYLE,Wt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_STROKE_STYLE,Pn,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Jn,Qn]);const l=e.getEnds(),c=e.getOrientedFlatCoordinates(),u=e.getStride();this.drawFlatCoordinatess_(c,0,l,u,a),this.endGeometry(t)}drawMultiPolygon(e,t,i){const r=this.state,s=r.fillStyle,o=r.strokeStyle,a=r.strokeOffset;if(s===void 0&&o===void 0||this.handleStrokeOffset_(()=>this.drawMultiPolygon(e,t,i)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,i),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_FILL_STYLE,Wt]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([ue.SET_STROKE_STYLE,Pn,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Jn,Qn]);const l=e.getEndss(),c=e.getOrientedFlatCoordinates(),u=e.getStride();let h=0;for(let f=0,d=l.length;f<d;++f)h=this.drawFlatCoordinatess_(c,h,l[f],u,a);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]=rr(t[i],e)}return super.finish()}setFillStrokeStyles_(){const e=this.state;this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke)}handleStrokeOffset_(e){const t=this.state,i=t.fillStyle,r=t.strokeStyle,s=t.strokeOffset;return Math.abs(s)>0&&i!==void 0&&r!==void 0?(t.strokeStyle=void 0,t.strokeOffset=0,e(),t.fillStyle=void 0,t.strokeStyle=r,t.strokeOffset=s,e(),t.fillStyle=i,!0):!1}}function XR(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,u]=l.slice(-2),h=e[o+r],f=e[o+r+1],d=Math.sqrt((h-c)*(h-c)+(f-u)*(f-u));if(a+=d,a>=n){const g=(n-a+d)/d,p=Ut(c,h,g),m=Ut(u,f,g);l.push(p,m),s.push(l),l=[p,m],a==n&&(o+=r),a=0}else if(a<n)l.push(e[o+r],e[o+r+1]),o+=r;else{const g=d-a,p=Ut(c,h,g/d),m=Ut(u,f,g/d);l.push(p,m),s.push(l),l=[p,m],a=0,o+=r}}return a>0&&s.push(l),s}function UR(n,e,t,i,r){let s=t,o=t,a=0,l=0,c=t,u,h,f,d,g,p,m,y,_,w;for(h=t;h<i;h+=r){const x=e[h],v=e[h+1];g!==void 0&&(_=x-g,w=v-p,d=Math.sqrt(_*_+w*w),m!==void 0&&(l+=f,u=Math.acos((m*_+y*w)/(f*d)),u>n&&(l>a&&(a=l,s=c,o=h),l=0,c=h-r)),f=d,m=_,y=w),g=x,p=v}return l+=d,l>a?[c,h]:[s,o]}const ec={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class BR extends Ho{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[Wt]={fillStyle:Wt},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 u=null,h=e.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!it(this.maxExtent,e.getExtent()))return;let f;if(u=e.getFlatCoordinates(),c=="LineString")f=[u.length];else if(c=="MultiLineString")f=e.getEnds();else if(c=="Polygon")f=e.getEnds().slice(0,1);else if(c=="MultiPolygon"){const m=e.getEndss();f=[];for(let y=0,_=m.length;y<_;++y)f.push(m[y][0])}this.beginGeometry(e,t,i);const d=o.repeat,g=d?void 0:o.textAlign;let p=0;for(let m=0,y=f.length;m<y;++m){let _;d?_=XR(d*this.resolution,u,p,f[m],h):_=[u.slice(p,f[m])];for(let w=0,x=_.length;w<x;++w){const v=_[w];let T=0,R=v.length;if(g==null){const S=UR(o.maxAngle,v,0,v.length,2);T=S[0],R=S[1]}for(let S=T;S<R;S+=h)a.push(v[S],v[S+1]);const C=a.length;p=f[m],this.drawChars_(l,C),l=C}}this.endGeometry(t)}else{let f=o.overflow?null:[];switch(c){case"Point":case"MultiPoint":u=e.getFlatCoordinates();break;case"LineString":u=e.getFlatMidpoint();break;case"Circle":u=e.getCenter();break;case"MultiLineString":u=e.getFlatMidpoints(),h=2;break;case"Polygon":u=e.getFlatInteriorPoint(),o.overflow||f.push(u[2]/this.resolution),h=3;break;case"MultiPolygon":const x=e.getFlatInteriorPoints();u=[];for(let v=0,T=x.length;v<T;v+=3)o.overflow||f.push(x[v+2]/this.resolution),u.push(x[v],x[v+1]);if(u.length===0)return;h=2;break}const d=this.appendFlatPointCoordinates(u,h);if(d===l)return;if(f&&(d-l)/2!==u.length/h){let x=l/2;f=f.filter((v,T)=>{const R=a[(x+T)*2]===u[T*h]&&a[(x+T)*2+1]===u[T*h+1];return R||--x,R})}this.saveTextStates_();const g=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 m=o.padding;if(m!=ur&&(o.scale[0]<0||o.scale[1]<0)){let x=o.padding[0],v=o.padding[1],T=o.padding[2],R=o.padding[3];o.scale[0]<0&&(v=-v,R=-R),o.scale[1]<0&&(x=-x,T=-T),m=[x,v,T,R]}const y=this.pixelRatio;this.instructions.push([ue.DRAW_IMAGE,l,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,m==ur?ur:m.map(function(x){return x*y}),g,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]);const _=1/y,w=g?g.slice(0):null;w&&(w[1]=Wt),this.hitDetectionInstructions.push([ue.DRAW_IMAGE,l,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterMode_,this.declutterImageWithText_,m,w,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Wt:this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]),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||So,justify:t.justify,textBaseline:t.textBaseline||fl,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=ec[r.textBaseline],u=this.textOffsetY_*l,h=this.text_,f=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([ue.DRAW_CHARS,e,t,c,r.overflow,a,r.maxAngle,l,u,s,f*l,h,o,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([ue.DRAW_CHARS,e,t,c,r.overflow,a&&Wt,r.maxAngle,l,u,s,f*l,h,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=An(o.getColor()||Wt)):(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(),m=a.getLineDashOffset(),y=a.getWidth(),_=a.getMiterLimit();s.lineCap=a.getLineCap()||es,s.lineDash=p?p.slice():Jn,s.lineDashOffset=m===void 0?Qn:m,s.lineJoin=a.getLineJoin()||ts,s.lineWidth=y===void 0?Io:y,s.miterLimit=_===void 0?Ro:_,s.strokeStyle=An(a.getColor()||Pn)}i=this.textState_;const l=e.getFont()||am;cb(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()||fl,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||ur,i.scale=c===void 0?[1,1]:c;const u=e.getOffsetX(),h=e.getOffsetY(),f=e.getRotateWithView(),d=e.getKeepUpright(),g=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=u===void 0?0:u,this.textOffsetY_=h===void 0?0:h,this.textRotateWithView_=f===void 0?!1:f,this.textKeepUpright_=d===void 0?!0:d,this.textRotation_=g===void 0?0:g,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:_e(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:"|"+_e(r.fillStyle):""}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}const $R={Circle:n_,Default:Ho,Image:WR,LineString:VR,Polygon:n_,Text:BR};class i_{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=$R[t];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=s}return s}}function r_(n,e,t,i,r,s,o,a){o=o??[],a=a??i;const l=n[e+i],c=n[e+i+1],u=n[t-2*i],h=n[t-2*i+1];let f,d,g,p,m,y,_,w,x=0;for(let v=e;v<t;v+=i){g=f,p=d,m=void 0,y=void 0,v+i<t&&(m=n[v+i],y=n[v+i+1]),s&&v===e&&(g=u,p=h),s&&v===t-i&&(m=l,y=c),f=n[v],d=n[v+1],[_,w]=KR(f,d,g,p,m,y,r),o[x++]=_,o[x++]=w;for(let T=2;T<a;T++)o[x++]=n[v+T]}return o.length!=x&&(o.length=x),o}function KR(n,e,t,i,r,s,o){let a,l;t!==void 0&&i!==void 0?(a=n-t,l=e-i):r!==void 0&&s!==void 0?(a=r-n,l=s-e):(a=1,l=0);const c=Math.hypot(a,l),u=a/c,h=l/c;if(a=-h,l=u,t===void 0||i===void 0)return[n+a*o,e+l*o];if(r===void 0||s===void 0)return[n+a*o,e+l*o];const f=Iv([n,e],[t,i],[r,s]);if(Math.cos(f)>.998)return[n+u*o,e+h*o];const d=Math.cos(f/2),g=Math.sin(f/2),p=g*a+d*l,m=-d*a+g*l,y=p*(1/g),_=m*(1/g);return[n+y*o,e+_*o]}function s_(n,e){for(let t=0,i=n.length-2;t<i;t+=e)for(let r=n.length-2*e;r>t+e;r-=e){const s=n[t],o=n[t+1],a=n[t+e],l=n[t+e+1],c=n[r],u=n[r+1],h=n[r+e],f=n[r+e+1],d=(f-u)*(a-s)-(h-c)*(l-o);if(d===0)continue;const g=((h-c)*(o-u)-(f-u)*(s-c))/d,p=((a-s)*(o-u)-(l-o)*(s-c))/d;if(g>0&&g<1&&p>0&&p<1){const m=s+g*(a-s),y=o+g*(l-o);n[t+e]=m,n[t+e+1]=y,n.splice(t+2*e,r-t-e);break}}return n}function YR(n,e,t,i,r,s,o,a,l,c,u,h,f=!0){let d=n[e],g=n[e+1],p=0,m=0,y=0,_=0;function w(){p=d,m=g,e+=i,d=n[e],g=n[e+1],_+=y,y=Math.sqrt((d-p)*(d-p)+(g-m)*(g-m))}do w();while(e<t-i&&_+y<s);let x=y===0?0:(s-_)/y;const v=Ut(p,d,x),T=Ut(m,g,x),R=e-i,C=_,S=s+a*l(c,r,u);for(;e<t-i&&_+y<S;)w();x=y===0?0:(S-_)/y;const L=Ut(p,d,x),B=Ut(m,g,x);let K=!1;if(f)if(h){const X=[v,T,L,B];xp(X,0,4,2,h,X,X),K=X[0]>X[2]}else K=v>L;const F=Math.PI,P=[],oe=R+i===e;e=R,y=0,_=C,d=n[e],g=n[e+1];let W;if(oe){w(),W=Math.atan2(g-m,d-p),K&&(W+=W>0?-F:F);const X=(L+v)/2,z=(B+T)/2;return P[0]=[X,z,(S-s)/2,W,r],P}r=r.replace(/\n/g," ");for(let X=0,z=r.length;X<z;){w();let M=Math.atan2(g-m,d-p);if(K&&(M+=M>0?-F:F),W!==void 0){let xe=M-W;if(xe+=xe>F?-2*F:xe<-F?2*F:0,Math.abs(xe)>o)return null}W=M;const ne=X;let le=0;for(;X<z;++X){const xe=K?z-X-1:X,he=a*l(c,r[xe],u);if(e+i<t&&_+y<s+le+he/2)break;le+=he}if(X===ne)continue;const ge=K?r.substring(z-ne,z-X):r.substring(ne,X);x=y===0?0:(s+le/2-_)/y;const ze=Ut(p,d,x),G=Ut(m,g,x);P.push([ze,G,le/2,M,ge]),s+=le}return P}const bs=Bt(),zi=[],ri=[],si=[],Gi=[];function o_(n){return n[3].declutterBox}const a_=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ-࿿-]");function Sf(n,e){return e==="start"?e=a_.test(n)?"right":"left":e==="end"&&(e=a_.test(n)?"left":"right"),ec[e]}function ZR(n,e,t){return t>0&&n.push(`
8
8
  `,""),n.push(e,""),n}function qR(n,e,t){return t%2===0&&(n+=e),n}class HR{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_=Gt(),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 Lh: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,u=[l.scale[0]*c,l.scale[1]*c],h=l.justify?ec[l.justify]:Sf(Array.isArray(e)?e[0]:e,l.textAlign||So),f=r&&o.lineWidth?o.lineWidth:0,d=Array.isArray(e)?e:String(e).split(`
9
- `).reduce(ZR,[]),{width:g,height:p,widths:m,heights:y,lineWidths:_}=hb(l,d),v=g+f,x=[],w=(v+2)*u[0],T=(p+f)*u[1],R={width:w<0?Math.floor(w):Math.ceil(w),height:T<0?Math.floor(T):Math.ceil(T),contextInstructions:x};(u[0]!=1||u[1]!=1)&&x.push("scale",u),r&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",f),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-h;let S=h*v+C*f;const L=[],B=[];let K=0,F=0,P=0,oe=0,W;for(let X=0,z=d.length;X<z;X+=2){const M=d[X];if(M===`
10
- `){F+=K,K=0,S=h*v+C*f,++oe;continue}const ne=d[X+1]||l.font;ne!==W&&(r&&L.push("font",ne),i&&B.push("font",ne),W=ne),K=Math.max(K,y[P]);const le=[M,S+C*m[P]+h*(m[P]-_[oe]),.5*(f+K)+F];S+=m[P],r&&L.push("strokeText",le),i&&B.push("fillText",le),++P}return Array.prototype.push.apply(x,L),Array.prototype.push.apply(x,B),this.labels_[s]=R,R}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,u,h,f,d,g,p,m){a*=f[0],l*=f[1];let y=i-a,_=r-l;const v=s+c>e?e-c:s,x=o+u>t?t-u:o,w=g[3]+v*f[0]+g[1],T=g[0]+x*f[1]+g[2],R=y-g[3],C=_-g[0];(p||h!==0)&&(Ni[0]=R,zi[0]=R,Ni[1]=C,ri[1]=C,ri[0]=R+w,si[0]=ri[0],si[1]=C+T,zi[1]=si[1]);let S;return h!==0?(S=Sn(Gt(),i,r,1,1,h,-i,-r),lt(S,Ni),lt(S,ri),lt(S,si),lt(S,zi),Un(Math.min(Ni[0],ri[0],si[0],zi[0]),Math.min(Ni[1],ri[1],si[1],zi[1]),Math.max(Ni[0],ri[0],si[0],zi[0]),Math.max(Ni[1],ri[1],si[1],zi[1]),bs)):Un(Math.min(R,R+w),Math.min(C,C+T),Math.max(R,R+w),Math.max(C,C+T),bs),d&&(y=Math.round(y),_=Math.round(_)),{drawImageX:y,drawImageY:_,drawImageW:v,drawImageH:x,originX:c,originY:u,declutterBox:{minX:bs[0],minY:bs[1],maxX:bs[2],maxY:bs[3],value:m},canvasTransform:S,scale:f}}replayImageOrLabel_(e,t,i,r,s,o,a){const l=!!(o||a),c=r.declutterBox,u=a?a[2]*r.scale[0]/2:0;return c.minX-u<=t[0]&&c.maxX+u>=0&&c.minY-u<=t[1]&&c.maxY+u>=0&&(l&&this.replayTextBackground_(e,Ni,ri,si,zi,o,a),fb(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=lt(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.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=Sf(Array.isArray(e)?e[0]:e,s.textAlign||So),u=ec[s.textBaseline||fl],h=a&&a.lineWidth?a.lineWidth:0,f=o.width/l-2*s.scale[0],d=c*f+2*(.5-c)*h,g=u*o.height/l+2*(.5-u)*h;return{label:o,anchorX:d,anchorY:g}}execute_(e,t,i,r,s,o,a,l){const c=this.zIndexContext_;let u;this.pixelCoordinates_&&yi(i,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=Ci(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),cw(this.renderedTransform_,i));let h=0;const f=r.length;let d=0,g;const p=[];let m,y,_,v,x,w,T,R,C,S,L,B,K,F=0,P=0;const oe=this.coordinateCache_,W=this.viewRotation_,X=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,z={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:W},M=this.instructions!=r||this.overlaps?0:200;let ne,le,ge,ze;for(;h<f;){const G=r[h];switch(G[0]){case ue.BEGIN_GEOMETRY:ne=G[1],ze=G[3],ne.getGeometry()?a!==void 0&&!it(a,ze.getExtent())?h=G[2]+1:++h:h=G[2],c&&(c.zIndex=G[4]);break;case ue.BEGIN_PATH:F>M&&(this.fill_(e),F=0),P>M&&(e.stroke(),P=0),!F&&!P&&(e.beginPath(),x=NaN,w=NaN),++h;break;case ue.CIRCLE:d=G[1],_=G[2]??0;const he=u[d],Ie=u[d+1],Pe=u[d+2]-_,ie=u[d+3]-_,k=Pe-he,He=ie-Ie,E=Math.sqrt(k*k+He*He);e.moveTo(he+E,Ie),e.arc(he,Ie,E,0,2*Math.PI,!0),++h;break;case ue.CLOSE_PATH:e.closePath(),++h;break;case ue.CUSTOM:d=G[1],g=G[2];const b=G[3],I=G[4],D=G[5];z.geometry=b,z.feature=ne,h in oe||(oe[h]=[]);const A=oe[h];D?D(u,d,g,2,A):(A[0]=u[d],A[1]=u[d+1],A.length=2),c&&(c.zIndex=G[6]),I(A,z),++h;break;case ue.DRAW_IMAGE:d=G[1],g=G[2],C=G[3],m=G[4],y=G[5];let O=G[6];const V=G[7],U=G[8],$=G[9],N=G[10];let ee=G[11];const Q=G[12];let Y=G[13];v=G[14]||"declutter";const Z=G[15];if(!C&&G.length>=20){S=G[19],L=G[20],B=G[21],K=G[22];const ht=this.drawLabelWithPointPlacement_(S,L,B,K);C=ht.label,G[3]=C;const Tr=G[23];m=(ht.anchorX-Tr)*this.pixelRatio,G[4]=m;const tn=G[24];y=(ht.anchorY-tn)*this.pixelRatio,G[5]=y,O=C.height,G[6]=O,Y=C.width,G[13]=Y}let q;G.length>25&&(q=G[25]);let ae,ce,se;G.length>17?(ae=G[16],ce=G[17],se=G[18]):(ae=cr,ce=null,se=null),N&&X?ee+=W:!N&&!X&&(ee-=W);let fe=0;for(;d<g;d+=2){if(q&&q[fe++]<Y/this.pixelRatio)continue;const ht=this.calculateImageOrLabelDimensions_(C.width,C.height,u[d],u[d+1],Y,O,m,y,U,$,ee,Q,s,ae,!!ce||!!se,ne),Tr=[e,t,C,ht,V,ce,se];if(l){let tn,Ln,nn;if(Z){const rt=g-d;if(!Z[rt]){Z[rt]={args:Tr,declutterMode:v};continue}const Dt=Z[rt];tn=Dt.args,Ln=Dt.declutterMode,delete Z[rt],nn=o_(tn)}let ai,li;if(tn&&(Ln!=="declutter"||!l.collides(nn))&&(ai=!0),(v!=="declutter"||!l.collides(ht.declutterBox))&&(li=!0),Ln==="declutter"&&v==="declutter"){const rt=ai&&li;ai=rt,li=rt}ai&&(Ln!=="none"&&l.insert(nn),this.replayImageOrLabel_.apply(this,tn)),li&&(v!=="none"&&l.insert(ht.declutterBox),this.replayImageOrLabel_.apply(this,Tr))}else this.replayImageOrLabel_.apply(this,Tr)}++h;break;case ue.DRAW_CHARS:const Me=G[1],Fe=G[2],$e=G[3],Tt=G[4];K=G[5];const ke=G[6],Ve=G[7],je=G[8];B=G[9];const ut=G[10];S=G[11],Array.isArray(S)&&(S=S.reduce(qR,"")),L=G[12];const Ot=[G[13],G[13]];v=G[14]||"declutter";const Lt=G[15],Je=this.textStates[L],Vt=Je.font,br=[Je.scale[0]*Ve,Je.scale[1]*Ve];let oi;Vt in this.widths_?oi=this.widths_[Vt]:(oi={},this.widths_[Vt]=oi);const fc=vf(u,Me,Fe,2),dc=Math.abs(br[0])*hm(Vt,S,oi);if(Tt||dc<=fc){const ht=this.textStates[L].textAlign,Tr=(fc-dc)*Sf(S,ht),tn=YR(u,Me,Fe,2,S,Tr,ke,Math.abs(br[0]),hm,Vt,oi,X?0:this.viewRotation_,Lt);e:if(tn){const Ln=[];let nn,ai,li,rt,Dt;if(B)for(nn=0,ai=tn.length;nn<ai;++nn){Dt=tn[nn],li=Dt[4],rt=this.createLabel(li,L,"",B),m=Dt[2]+(br[0]<0?-ut:ut),y=$e*rt.height+(.5-$e)*2*ut*br[1]/br[0]-je;const ci=this.calculateImageOrLabelDimensions_(rt.width,rt.height,Dt[0],Dt[1],rt.width,rt.height,m,y,0,0,Dt[3],Ot,!1,cr,!1,ne);if(l&&v==="declutter"&&l.collides(ci.declutterBox))break e;Ln.push([e,t,rt,ci,1,null,null])}if(K)for(nn=0,ai=tn.length;nn<ai;++nn){Dt=tn[nn],li=Dt[4],rt=this.createLabel(li,L,K,""),m=Dt[2],y=$e*rt.height-je;const ci=this.calculateImageOrLabelDimensions_(rt.width,rt.height,Dt[0],Dt[1],rt.width,rt.height,m,y,0,0,Dt[3],Ot,!1,cr,!1,ne);if(l&&v==="declutter"&&l.collides(ci.declutterBox))break e;Ln.push([e,t,rt,ci,1,null,null])}l&&v!=="none"&&l.load(Ln.map(o_));for(let ci=0,AI=Ln.length;ci<AI;++ci)this.replayImageOrLabel_.apply(this,Ln[ci])}}++h;break;case ue.END_GEOMETRY:if(o!==void 0){ne=G[1];const ht=o(ne,ze,v);if(ht)return ht}++h;break;case ue.FILL:M?F++:this.fill_(e),++h;break;case ue.MOVE_TO_LINE_TO:d=G[1],g=G[2],_=G[3];let Cr,ta,gc;if(_){const ht=G[4]??!1;r_(u,d,g,2,_,ht,p),s_(p,2),Cr=p,ta=0,gc=Cr.length}else Cr=u,ta=d,gc=g;le=Cr[ta],ge=Cr[ta+1],e.moveTo(le,ge),x=le+.5|0,w=ge+.5|0;for(let ht=ta+2;ht<gc;ht+=2)le=Cr[ht],ge=Cr[ht+1],T=le+.5|0,R=ge+.5|0,(ht==gc-2||T!==x||R!==w)&&(e.lineTo(le,ge),x=T,w=R);++h;break;case ue.SET_FILL_STYLE:this.alignAndScaleFill_=G[2],F?(this.fill_(e),F=0,P&&(e.stroke(),P=0)):P&&G[1]&&(e.stroke(),P=0),e.fillStyle=G[1],++h;break;case ue.SET_STROKE_STYLE:F&&G[1]&&(this.fill_(e),F=0),P&&(e.stroke(),P=0),this.setStrokeStyle_(e,G),++h;break;case ue.STROKE:M?P++:e.stroke(),++h;break;default:++h;break}}F&&this.fill_(e),P&&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 vr=["Polygon","Circle","LineString","Image","Text","Default"],tc=["Image","Text"],JR=vr.filter(n=>!tc.includes(n));let l_=!1,c_=!1;function QR(){let n=0;const e=i=>{const r=Ze(1,1,null,{willReadFrequently:i});let s=0;const o=performance.now();for(;performance.now()-o<50;++s)r.fillStyle=`rgba(255,0,${s%256},1)`,r.fillRect(0,0,1,1),r.getImageData(0,0,1,1);return n=s>n?s:n,s};l_={[e(!0)]:!0,[e(!1)]:!1,[e(void 0)]:void 0}[n],c_=!0}class u_{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_=Gt(),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 HR(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){c_===!1&&QR(),r=Math.round(r);const a=r*2+1,l=Sn(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=Ze(a,a,null,{willReadFrequently:l_}));const u=this.hitDetectionContext_;u.canvas.width!==a||u.canvas.height!==a?(u.canvas.width=a,u.canvas.height=a):c||u.clearRect(0,0,a,a);let h;this.renderBuffer_!==void 0&&(h=Bt(),no(h,e),Vn(h,t*(this.renderBuffer_+r),h));const f=eS(r);let d;function g(w,T,R){const C=u.getImageData(0,0,a,a).data;for(let S=0,L=f.length;S<L;S++)if(C[f[S]]>0){if(!o||R==="none"||d!=="Image"&&d!=="Text"||o.includes(w)){const B=(f[S]-3)/4,K=r-B%a,F=r-(B/a|0),P=s(w,T,K*K+F*F);if(P)return P}u.clearRect(0,0,a,a);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(Cn);let m,y,_,v,x;for(m=p.length-1;m>=0;--m){const w=p[m].toString();for(_=this.executorsByZIndex_[w],y=vr.length-1;y>=0;--y)if(d=vr[y],v=_[d],v!==void 0&&(x=v.executeHitDetection(u,l,i,g,h),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 Ci(a,0,8,2,e,a),a}isEmpty(){return mi(this.executorsByZIndex_)}execute(e,t,i,r,s,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?ov:Cn),o=o||vr;const c=vr.length;for(let u=0,h=l.length;u<h;++u){const f=l[u].toString(),d=this.executorsByZIndex_[f];for(let g=0,p=o.length;g<p;++g){const m=o[g],y=d[m];if(y!==void 0){const _=a===null?void 0:y.getZIndexContext(),v=_?_.getContext():e,x=this.maxExtent_&&m!=="Image"&&m!=="Text";if(x&&(v.save(),this.clip(v,i)),!_||m==="Text"||m==="Image"?y.execute(v,t,i,r,s,a):_.pushFunction(w=>y.execute(w,t,i,r,s,a)),x&&v.restore(),_){_.offset();const w=l[u]*c+vr.indexOf(m);this.deferredZIndexContexts_[w]||(this.deferredZIndexContexts_[w]=[]),this.deferredZIndexContexts_[w].push(_)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(Cn);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 If={};function eS(n){if(If[n]!==void 0)return If[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 If[n]=r,r}class tS extends e_{constructor(e,t,i,r,s,o,a){super(),this.context_=e,this.pixelRatio_=t,this.extent_=i,this.transform_=r,this.transformRotation_=r?Ga(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_=Gt()}drawImages_(e,t,i,r){if(!this.image_)return;const s=Ci(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 u=0,h=s.length;u<h;u+=2){const f=s[u]-this.imageAnchorX_,d=s[u+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const g=f+this.imageAnchorX_,p=d+this.imageAnchorY_;Sn(a,g,p,1,1,c,-g,-p),o.save(),o.transform.apply(o,a),o.translate(g,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_,f,d,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=Ci(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,o){const a=this.context_;let l=Ci(e,t,i,r,this.transform_,this.pixelCoordinates_);Math.abs(o)>0&&(l=r_(l,0,l.length,2,o,s,l),s_(l,2)),a.moveTo(l[0],l[1]);let c=l.length;s&&(c-=2);for(let u=2;u<c;u+=2)a.lineTo(l[u],l[u+1]);return s&&a.closePath(),i}drawRings_(e,t,i,r,s){for(let o=0,a=i.length;o<a;++o)t=this.moveToLineTo_(e,t,i[o],r,!0,s);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!it(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=_w(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_)),!!it(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,this.strokeState_.strokeOffset),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(it(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,this.strokeState_.strokeOffset);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_)),!!it(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.strokeState_?.strokeOffset),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_)),!!it(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.strokeState_?.strokeOffset)}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),yi(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:So;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:Mn(i||Wt)}}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(),u=s||Hn,h=t.getOffset();this.strokeState_={lineCap:r!==void 0?r:Qr,lineDash:this.pixelRatio_===1?u:u.map(f=>f*this.pixelRatio_),lineDashOffset:(o||Jn)*this.pixelRatio_,lineJoin:a!==void 0?a:es,lineWidth:(l!==void 0?l:Io)*this.pixelRatio_,miterLimit:c!==void 0?c:Ro,strokeStyle:Mn(i||An),strokeOffset:(h??0)*this.pixelRatio_}}}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 d=t.getColor();this.textFillState_={fillStyle:Mn(d||Wt)}}const i=e.getStroke();if(!i)this.textStrokeState_=null;else{const d=i.getColor(),g=i.getLineCap(),p=i.getLineDash(),m=i.getLineDashOffset(),y=i.getLineJoin(),_=i.getWidth(),v=i.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:Qr,lineDash:p||Hn,lineDashOffset:m||Jn,lineJoin:y!==void 0?y:es,lineWidth:_!==void 0?_:Io,miterLimit:v!==void 0?v:Ro,strokeStyle:Mn(d||An)}}const r=e.getFont(),s=e.getOffsetX(),o=e.getOffsetY(),a=e.getRotateWithView(),l=e.getRotation(),c=e.getScaleArray(),u=e.getText(),h=e.getTextAlign(),f=e.getTextBaseline();this.textState_={font:r!==void 0?r:am,textAlign:h!==void 0?h:So,textBaseline:f!==void 0?f:fl},this.text_=u!==void 0?Array.isArray(u)?u.reduce((d,g,p)=>d+=p%2?" ":g,""):u:"",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 $t=.5;function h_(n,e,t,i,r,s,o,a,l){const c=l?Ja(r,l):r,u=n[0]*$t,h=n[1]*$t,f=Ze(u,h);f.imageSmoothingEnabled=!1;const d=f.canvas,g=new tS(f,$t,r,null,o,a,l?$r(oo(),l):null),p=t.length,m=Math.floor((256*256*256-1)/p),y={};for(let v=1;v<=p;++v){const x=t[v-1],w=x.getStyleFunction()||i;if(!w)continue;let T=w(x,s);if(!T)continue;Array.isArray(T)||(T=[T]);const C=(v*m).toString(16).padStart(7,"#00000");for(let S=0,L=T.length;S<L;++S){const B=T[S],K=B.getGeometryFunction()(x);if(!K||!it(c,K.getExtent()))continue;const F=B.clone(),P=F.getFill();P&&P.setColor(C);const oe=F.getStroke();oe&&(oe.setColor(C),oe.setLineDash(null)),F.setText(void 0);const W=B.getImage();if(W){const ne=W.getImageSize();if(!ne)continue;const le=Ze(ne[0],ne[1],void 0,{alpha:!1}),ge=le.canvas;le.fillStyle=C,le.fillRect(0,0,ge.width,ge.height),F.setImage(new hr({img:ge,anchor:W.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:W.getOrigin(),opacity:1,size:W.getSize(),scale:W.getScale(),rotation:W.getRotation(),rotateWithView:W.getRotateWithView()}))}const X=F.getZIndex()||0;let z=y[X];z||(z={},y[X]=z,z.Polygon=[],z.Circle=[],z.LineString=[],z.Point=[]);const M=K.getType();if(M==="GeometryCollection"){const ne=K.getGeometriesArrayRecursive();for(let le=0,ge=ne.length;le<ge;++le){const ze=ne[le];z[ze.getType().replace("Multi","")].push(ze,F)}}else z[M.replace("Multi","")].push(K,F)}}const _=Object.keys(y).map(Number).sort(Cn);for(let v=0,x=_.length;v<x;++v){const w=y[_[v]];for(const T in w){const R=w[T];for(let C=0,S=R.length;C<S;C+=2){g.setStyle(R[C+1]);for(let L=0,B=e.length;L<B;++L)g.setTransform(e[L]),g.drawGeometry(R[C])}}}return f.getImageData(0,0,d.width,d.height)}function f_(n,e,t){const i=[];if(t){const r=Math.floor(Math.round(n[0])*$t),s=Math.floor(Math.round(n[1])*$t),o=(Ye(r,0,t.width-1)+Ye(s,0,t.height-1)*t.width)*4,a=t.data[o],l=t.data[o+1],u=t.data[o+2]+256*(l+256*a),h=Math.floor((256*256*256-1)/e.length);u&&u%h===0&&i.push(e[u/h-1])}return i}const nS=.5,d_={Point:uS,LineString:aS,Polygon:fS,MultiPoint:hS,MultiLineString:lS,MultiPolygon:cS,GeometryCollection:oS,Circle:rS};function iS(n,e){return parseInt(_e(n),10)-parseInt(_e(e),10)}function Mf(n,e){const t=g_(n,e);return t*t}function g_(n,e){return nS*n/e}function rS(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,r)}}function nc(n,e,t,i,r,s,o,a){const l=[],c=t.getImage();if(c){let f=!0;const d=c.getImageState();d==re.LOADED||d==re.ERROR?f=!1:d==re.IDLE&&c.load(),f&&l.push(c.ready())}const u=t.getFill();u&&u.loading()&&l.push(u.ready());const h=l.length>0;return h&&Promise.all(l).then(()=>r(null)),sS(n,e,t,i,s,o,a),h}function sS(n,e,t,i,r,s,o){const a=t.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(i,r);if(t.getRenderer())p_(n,l,t,e,o);else{const u=d_[l.getType()];u(n,l,t,e,o,s)}}function p_(n,e,t,i,r){if(e.getType()=="GeometryCollection"){const o=e.getGeometries();for(let a=0,l=o.length;a<l;++a)p_(n,o[a],t,i,r);return}n.getBuilder(t.getZIndex(),"Default").drawCustom(e,i,t.getRenderer(),t.getHitDetectionRenderer(),r)}function oS(n,e,t,i,r,s){const o=e.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a){const c=d_[o[a].getType()];c(n,o[a],t,i,r,s)}}function aS(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 lS(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 cS(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 uS(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()!=re.LOADED)return;const u=n.getBuilder(t.getZIndex(),"Image");u.setImageStyle(o,c),u.drawPoint(e,i,r)}if(l){const u=n.getBuilder(t.getZIndex(),"Text");u.setTextStyle(a,c),u.drawText(e,i,r)}}function hS(n,e,t,i,r,s){const o=t.getImage(),a=o&&o.getOpacity()!==0,l=t.getText(),c=l&&l.getText(),u=s&&a&&c?{}:void 0;if(a){if(o.getImageState()!=re.LOADED)return;const h=n.getBuilder(t.getZIndex(),"Image");h.setImageStyle(o,u),h.drawMultiPoint(e,i,r)}if(c){const h=n.getBuilder(t.getZIndex(),"Text");h.setTextStyle(l,u),h.drawText(e,i,r)}}function fS(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)}}class dS extends Dh{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipExtent_=null,this.extendX_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=Bt(),this.wrappedRenderedExtent_=Bt(),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,u=l.getExtent(),h=this.getLayer().getSource(),f=this.getLayer().getDeclutter(),d=t.pixelRatio,g=t.viewHints,p=!(g[Ke.ANIMATING]||g[Ke.INTERACTING]),m=this.context,y=Math.round(Se(r)/a*d),_=Math.round(ot(r)/a*d),v=h.getWrapX()&&l.canWrapX(),x=v?Se(u):null,w=v?Math.ceil((r[2]-u[2])/x)+(this.extendX_?2:1):1;let T=v?Math.floor((r[0]-u[0])/x)-(this.extendX_?1:0):0;do{let R=this.getRenderTransform(o,a,0,d,y,_,T*x);t.declutter&&(R=R.slice(0)),e.execute(m,[m.canvas.width,m.canvas.height],R,c,p,i===void 0?vr:i?tc:JR,i?f&&t.declutter[f]:void 0)}while(++T<w)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=Ze(this.context.canvas.width,this.context.canvas.height,jm))}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,uo(this.context),jm.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.clipExtent_&&this.clipUnrotated(this.context,e,this.clipExtent_),this.replayGroup_.renderDeferred(),this.clipExtent_&&(this.context.restore(),this.clipExtent_=null),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(Ht.PRERENDER)||this.getLayer().hasListener(Ht.POSTRENDER)))return this.container;this.setDrawContext_(),this.preRender(s,e);const l=r.projection;this.clipExtent_=null;let c=!1;if(a&&i.extent&&this.clipping){const u=Yn(i.extent,l);a=it(u,e.extent),a&&!Xn(u,e.extent)&&(e.declutter?this.clipExtent_=u:(this.clipUnrotated(s,e,u),c=!0))}return a&&this.renderWorlds(o,e,this.getLayer().getDeclutter()?!1:void 0),c&&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(),u=[],h=i[0]*$t,f=i[1]*$t;u.push(this.getRenderTransform(r,s,o,$t,h,f,0).slice());const d=c.getSource(),g=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!Xn(g,l)){let m=l[0];const y=Se(g);let _=0,v;for(;m<g[0];)--_,v=y*_,u.push(this.getRenderTransform(r,s,o,$t,h,f,v).slice()),m+=y;for(_=0,m=l[2];m>g[2];)++_,v=y*_,u.push(this.getRenderTransform(r,s,o,$t,h,f,v).slice()),m-=y}const p=oo();this.hitDetectionImageData_=h_(i,u,this.renderedFeatures_,c.getStyleFunction(),l,s,o,Mf(s,this.renderedPixelRatio_),p?a:null)}t(f_(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,i,r,s){if(!this.replayGroup_)return;const o=t.viewState.resolution,a=t.viewState.rotation,l=this.getLayer(),c={},u=function(f,d,g){const p=_e(f),m=c[p];if(m){if(m!==!0&&g<m.distanceSq){if(g===0)return c[p]=!0,s.splice(s.lastIndexOf(m),1),r(f,l,d);m.geometry=d,m.distanceSq=g}}else{if(g===0)return c[p]=!0,r(f,l,d);s.push(c[p]={feature:f,layer:l,geometry:d,distanceSq:g,callback:r})}},h=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,o,a,i,u,h?t.declutter?.[h]?.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[Ke.ANIMATING],s=e.viewHints[Ke.INTERACTING],o=t.getUpdateWhileAnimating(),a=t.getUpdateWhileInteracting();if(this.ready&&!o&&r||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=e.extent,c=e.viewState,u=c.projection,h=c.resolution,f=e.pixelRatio,d=t.getRevision(),g=t.getRenderBuffer();let p=t.getRenderOrder();p===void 0&&(p=iS);const m=c.center.slice(),y=Vn(l,g*h),_=y.slice(),v=[y.slice()],x=u.getExtent(),w=i.getWrapX()&&u.canWrapX();if(this.extendX_=!1,w){const W=i.getExtent();W&&!Ei(W)&&(this.extendX_=W[0]<x[0]||W[2]>x[2])}if(w&&(!Xn(x,e.extent)||this.extendX_)){const W=Se(x),X=Math.max(Se(y)/2,W);let z=x[0],M=x[2];this.extendX_&&(z-=W,M+=W),y[0]=z-X,y[2]=M+X,du(m,u);const ne=Zg(v[0],u);ne[0]<x[0]&&ne[2]<x[2]?v.push([ne[0]+W,ne[1],ne[2]+W,ne[3]]):ne[0]>x[0]&&ne[2]>x[2]&&v.push([ne[0]-W,ne[1],ne[2]-W,ne[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedPixelRatio_===f&&this.renderedRevision_==d&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!e.declutter&&Xn(this.wrappedRenderedExtent_,y))return yi(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const T=new i_(g_(h,f),y,h,f),R=oo();let C;if(R){for(let W=0,X=v.length;W<X;++W){const z=v[W],M=Ja(z,u);i.loadFeatures(M,aw(h,u),R)}C=$r(R,u)}else for(let W=0,X=v.length;W<X;++W)i.loadFeatures(v[W],h,u);const S=Mf(h,f);let L=!0;const B=(W,X)=>{let z;const M=W.getStyleFunction()||t.getStyleFunction();if(M&&(z=M(W,h)),z){const ne=this.renderFeature(W,S,z,T,C,this.getLayer().getDeclutter(),X);L=L&&!ne}},K=Ja(y,u),F=i.getFeaturesInExtent(K);p&&F.sort(p);for(let W=0,X=F.length;W<X;++W)B(F[W],W);this.renderedFeatures_=F,this.ready=L;const P=T.finish(),oe=new u_(y,h,f,i.getOverlaps(),P,t.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=h,this.renderedRevision_=d,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=_,this.wrappedRenderedExtent_=y,this.renderedCenter_=m,this.renderedProjection_=u,this.renderedPixelRatio_=f,this.replayGroup_=oe,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,u=i.length;c<u;++c)l=nc(r,e,i[c],t,this.boundHandleStyleImageChange_,s,o,a)||l;else l=nc(r,e,i,t,this.boundHandleStyleImageChange_,s,o,a);return l}}class ic extends bh{constructor(e){super(e)}createRenderer(){return new dS(this)}}const gS={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},m_={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class pS extends Vm{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=Gt(),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(),u=c.getTileGridForProjection(o.projection),h=!(l[Ke.ANIMATING]||l[Ke.INTERACTING]),f=u.getZForResolution(a,c.zDirection)===e;return h&&f?s.wantedResolution=a:s.wantedResolution||(s.wantedResolution=u.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.renderedPixelRatio===t&&l.renderedRenderOrder==o)return;const c=r.getSource(),u=!!r.getDeclutter(),h=c.getTileGrid(),d=c.getTileGridForProjection(i).getTileCoordExtent(e.wrappedTileCoord),g=c.getSourceTiles(t,i,e),p=_e(r);delete e.hitDetectionImageData[p],e.executorGroups[p]=[],l.dirty=!1;for(let m=0,y=g.length;m<y;++m){const _=g[m];if(_.getState()!=J.LOADED)continue;const v=c.getProjection(),x=_.tileCoord;let w=h.getTileCoordExtent(x);i&&v&&!Et(i,v)&&(w=Kr(w,v,i,32));const T=cn(d,w),R=Vn(T,r.getRenderBuffer()*a,this.tempExtent),C=Bn(w,T)?null:R,S=new i_(0,T,a,t),L=Mf(a,t),B=function(W,X){let z;const M=W.getStyleFunction()||r.getStyleFunction();if(M&&(z=M(W,a)),z){const ne=this.renderFeature(W,L,z,S,u,X);l.dirty=l.dirty||ne}},K=_.getFeatures();o&&o!==l.renderedRenderOrder&&K.sort(o);for(let W=0,X=K.length;W<X;++W){let z=K[W];i&&_.projection&&!Et(i,_.projection)&&(z=z.clone(),z.getGeometry().applyTransform(er(_.projection,i))),(!C||it(C,z.getGeometry().getExtent()))&&B.call(this,z,W)}const F=S.finish(),P=r.getRenderMode()!=="vector"&&u&&g.length===1?null:T,oe=new u_(P,a,t,c.getOverlaps(),F,r.getRenderBuffer(),!0);e.executorGroups[p].push(oe)}l.renderedRevision=s,l.renderedPixelRatio=t,l.renderedRenderOrder=o,l.renderedResolution=a}forEachFeatureAtCoordinate(e,t,i,r,s){const o=t.viewState.resolution,a=t.viewState.rotation;i=i??0;const l=this.getLayer(),u=l.getSource().getTileGridForProjection(t.viewState.projection),h=l.getRenderBuffer(),f=ou([e]);Vn(f,o*(h+i),f);const d={},g=function(x,w,T){let R=x.getId();R===void 0&&(R=_e(x));const C=d[R];if(C){if(C!==!0&&T<C.distanceSq){if(T===0)return d[R]=!0,s.splice(s.lastIndexOf(C),1),r(x,l,w);C.geometry=w,C.distanceSq=T}}else{if(T===0)return d[R]=!0,r(x,l,w);s.push(d[R]={feature:x,layer:l,geometry:w,distanceSq:T,callback:r})}},p=this.renderedTiles,m=_e(l),y=l.getDeclutter(),_=y?t.declutter?.[y]?.all().map(x=>x.value):null;let v;e:for(let x=p.length-1;x>=0;--x){const w=p[x],T=u.getTileCoordExtent(w.wrappedTileCoord);if(!it(T,f))continue;const R=w.executorGroups[m];for(let C=0,S=R.length;C<S;++C)if(v=R[C].forEachFeatureAtCoordinate(e,o,a,i,g,_),v)break e}return v}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),u=lt(this.renderedPixelToCoordinateTransform_,e.slice()),h=c.getTileCoordForCoordAndResolution(u,l).toString(),f=this.renderedTiles.find(v=>v.tileCoord.toString()===h&&v.getState()===J.LOADED);if(!f||f.loadingSourceTiles>0){t([]);return}s.getWrapX()&&o.canWrapX()&&!Xn(a,c.getTileCoordExtent(f.tileCoord))&&du(u,o);const d=_e(r),g=c.getTileCoordExtent(f.wrappedTileCoord),p=$n(g),m=[(u[0]-p[0])/l,(p[1]-u[1])/l],y=f.getSourceTiles().reduce((v,x)=>v.concat(x.getFeatures()),[]);let _=f.hitDetectionImageData[d];if(!_){const v=bt(c.getTileSize(c.getZForResolution(l,s.zDirection))),x=this.renderedRotation_,w=[this.getRenderTransform(c.getTileCoordCenter(f.wrappedTileCoord),l,0,$t,v[0]*$t,v[1]*$t,0)];_=h_(v,w,y,r.getStyleFunction(),c.getTileCoordExtent(f.wrappedTileCoord),f.getReplayState(r).renderedResolution,x),f.hitDetectionImageData[d]=_}t(f_(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()!==J.LOADED)return;const c=l.getSourceTiles();for(let u=0,h=c.length;u<h;++u){const f=c[u],d=f.getKey();if(d in a)continue;a[d]=!0;const g=f.tileCoord;if(it(e,s.getTileCoordExtent(g))){const p=f.getFeatures();if(p)for(let m=0,y=p.length;m<y;++m){const _=p[m],v=_.getGeometry();it(e,v.getExtent())&&t.push(_)}}}}),t}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e,t){const i=this.context,r=i.globalAlpha;i.globalAlpha=t.opacity;const s=e.viewHints,o=!(s[Ke.ANIMATING]||s[Ke.INTERACTING]),a=[this.context.canvas.width,this.context.canvas.height],l=this.getLayer().getDeclutter(),c=l?e.declutter?.[l]:void 0,u=_e(this.getLayer()),h=this.renderedTiles;for(let f=0,d=h.length;f<d;++f){const g=h[f],p=g.executorGroups[u];if(p)for(let m=p.length-1;m>=0;--m)p[m].execute(this.context,a,this.getTileRenderTransform(g,e),e.viewState.rotation,o,tc,c)}i.globalAlpha=r}renderDeferredInternal(e){const t=this.renderedTiles,i=_e(this.getLayer()),r=t.reduce((l,c,u)=>(c.executorGroups[i].forEach(h=>l.push({executorGroup:h,index:u})),l),[]),s=r.map(({executorGroup:l})=>l.getDeferredZIndexContexts()),o={};for(let l=0,c=r.length;l<c;++l){const u=r[l].executorGroup.getDeferredZIndexContexts();for(const h in u)o[h]=!0}const a=Object.keys(o).map(Number).sort(Cn);this.layerExtent&&this.clipUnrotated(this.context,e,this.layerExtent),a.forEach(l=>{s.forEach((c,u)=>{c[l]&&(c[l].forEach(h=>{const{executorGroup:f,index:d}=r[u],g=f.getRenderedContext(),p=g.globalAlpha;g.globalAlpha=this.renderedOpacity_;const m=this.tileClipContexts_[d];m&&m.draw(g),h.draw(g),m&&g.restore(),g.globalAlpha=p,h.clear()}),c[l].length=0)})}),this.layerExtent&&this.context.restore()}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),u=Math.round(l[1]*i),f=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),d=e.tileCoord,g=f.getTileCoordExtent(e.wrappedTileCoord),p=f.getTileCoordExtent(d,this.tempExtent)[0]-g[0];return Ru(Iu(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(s,o,a,i,c,u,p))}postRender(e,t){const i=t.viewHints,r=!(i[Ke.ANIMATING]||i[Ke.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;const s=this.getLayer(),o=s.getRenderMode(),a=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;const l=s.getDeclutter(),c=l?m_[o].filter(w=>!tc.includes(w)):m_[o],u=t.viewState,h=u.rotation;this.layerExtent&&this.clipUnrotated(e,t,this.layerExtent);const f=s.getSource(),g=f.getTileGridForProjection(u.projection).getZForResolution(u.resolution,f.zDirection),p=this.renderedTiles,m=[],y=[],_=[],v=_e(s);let x=!0;for(let w=p.length-1;w>=0;--w){const T=p[w];x=x&&!T.getReplayState(s).dirty;const R=T.executorGroups[v].filter(P=>P.hasExecutors(c));if(R.length===0)continue;const C=this.getTileRenderTransform(T,t),S=T.tileCoord[0];let L=!1;const B=R[0].getClipCoords(C);let K=e,F;if(B){F=new Lh,K=F.getContext();for(let P=0,oe=m.length;P<oe;++P)if(g!==S&&S<y[P]){const W=m[P];it([B[0],B[3],B[4],B[7]],[W[0],W[3],W[4],W[7]])&&(L||(K.save(),L=!0),K.beginPath(),K.moveTo(B[0],B[1]),K.lineTo(B[2],B[3]),K.lineTo(B[4],B[5]),K.lineTo(B[6],B[7]),K.moveTo(W[6],W[7]),K.lineTo(W[4],W[5]),K.lineTo(W[2],W[3]),K.lineTo(W[0],W[1]),K.clip())}m.push(B),y.push(S)}for(let P=0,oe=R.length;P<oe;++P)R[P].execute(e,[e.canvas.width,e.canvas.height],C,h,r,c,t.declutter?.[l]);L&&(K===e?K.restore():_[w]=F)}this.layerExtent&&e.restore(),e.globalAlpha=a,this.ready=x,this.tileClipContexts_=_,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=nc(r,e,i[l],t,this.boundHandleStyleImageChange_,void 0,s,o)||a;else a=nc(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[_e(i)];r.renderedTileRevision=s;const a=e.wrappedTileCoord,l=a[0],c=i.getSource();let u=t.pixelRatio;const f=t.viewState.projection,d=c.getTileGridForProjection(f),g=d.getResolution(e.tileCoord[0]),p=t.pixelRatio/e.wantedResolution*g,m=d.getResolution(l),y=e.getContext();u=Math.round(Math.max(u,p/u));const _=c.getTilePixelSize(l,u,f);y.canvas.width=_[0],y.canvas.height=_[1];const v=u/p;if(v!==1){const R=yp(this.tmpTransform_);Iu(R,v,v),y.setTransform.apply(y,R)}const x=d.getTileCoordExtent(a,this.tempExtent),w=p/m,T=yp(this.tmpTransform_);Iu(T,w,-w),uw(T,-x[0],-x[3]);for(let R=0,C=o.length;R<C;++R)o[R].execute(y,[y.canvas.width*v,y.canvas.height*v],T,0,!0,gS[i.getRenderMode()],null);r.renderedTileResolution=e.wantedResolution}}class Jo extends bh{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";Oe(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 pS(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(Pi.PRELOAD)}getUseInterimTilesOnError(){return this.get(Pi.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(Pi.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(Pi.USE_INTERIM_TILES_ON_ERROR,e)}}function mS(n,e){return[[-1/0,-1/0,1/0,1/0]]}function yS(n,e){return[n]}function _S(n,e,t,i){const r=document.createElement("script"),s="olc_"+_e(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)}class y_ extends Km{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:Le("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)_S(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=Le("EPSG:4326"),i=this.getProjection();let r;if(e.bounds!==void 0){const c=$r(t,i);r=Yg(e.bounds,c)}const s=Do(i),o=e.minzoom||0,a=e.maxzoom||22,l=El({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=Um(e.tiles,l),e.attribution&&!this.getAttributions()){const c=r!==void 0?r:s;this.setAttributions(function(u){return it(c,u.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState("ready")}handleTileJSONError(){this.setState("error")}}let xS=!1;function __(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=xS,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const c=e.getType();try{let u;c=="text"||c=="json"?u=a.responseText:c=="xml"?u=a.responseXML||a.responseText:c=="arraybuffer"&&(u=a.response),u?s(e.readFeatures(u,{extent:t,featureProjection:r}),e.readProjection(u)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function x_(n,e){return function(t,i,r,s,o){__(n,e,t,i,r,(a,l)=>{this.addFeatures(a),s!==void 0&&s(a)},()=>{this.changed(),o!==void 0&&o()})}}class v_{constructor(e){this.rbush_=new Zp(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_[_e(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_[_e(a)]=l}this.rbush_.load(i)}remove(e){const t=_e(e),i=this.items_[t];return delete this.items_[t],this.rbush_.remove(i)!==null}update(e,t){const i=this.items_[_e(t)],r=[i.minX,i.minY,i.maxX,i.maxY];Bn(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 mi(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const t=this.rbush_.toJSON();return Un(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]}}const en={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class Gi extends an{constructor(e,t,i){super(e),this.feature=t,this.features=i}}class Cs extends ls{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_=Qs,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&&(Oe(this.format_,"`format` must be set when `url` is set"),this.loader_=x_(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:mS;const t=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=t?new v_:null,this.loadedExtentsRtree_=new v_,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 Yt(r)),r!==void 0&&this.addFeaturesInternal(r),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const t=_e(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 Gi(en.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof Ct||(this.featureChangeKeys_[e]=[Te(t,de.CHANGE,this.handleFeatureChange_,this),Te(t,kr.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 Ct){const s=this.idIndex_[r];s instanceof Ct?Array.isArray(s)?s.push(t):this.idIndex_[r]=[s,t]:i=!1}else i=!1}return i&&(Oe(!(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=_e(a);this.addToIndex_(l,a)&&i.push(a)}for(let s=0,o=i.length;s<o;s++){const a=i[s],l=_e(a);this.setupChangeEvents_(l,a);const c=a.getGeometry();if(c){const u=c.getExtent();t.push(u),r.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(en.ADDFEATURE))for(let s=0,o=i.length;s<o;s++)this.dispatchEvent(new Gi(en.ADDFEATURE,i[s]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(en.ADDFEATURE,function(i){t||(t=!0,e.push(i.feature),t=!1)}),this.addEventListener(en.REMOVEFEATURE,function(i){t||(t=!0,e.remove(i.feature),t=!1)}),e.addEventListener(Nt.ADD,i=>{t||(t=!0,this.addFeature(i.element),t=!1)}),e.addEventListener(Nt.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(We);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 Gi(en.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 Ct||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 Ct||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(),mi(this.nullGeometryFeatures_)||Tn(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=qg(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||Js,this.featuresRtree_.forEachInExtent(l,function(c){if(t(c)){const u=c.getGeometry(),h=a;if(a=u instanceof Ct?0:u.closestPointXY(i,r,o,a),a<h){s=c;const f=Math.sqrt(a);l[0]=i-f,l[1]=r-f,l[2]=i+f,l[3]=r+f}}}),s}getExtent(e){return this.featuresRtree_?.getExtent(e)??null}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=_e(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 Gi(en.CHANGEFEATURE,t))}hasFeature(e){const t=e.getId();return t!==void 0?t in this.idIndex_:_e(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&mi(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];if(!r.forEachInExtent(l,function(u){return Xn(u.extent,l)})){this.loading=Number(this.loading)+1,this.dispatchEvent(new Gi(en.FEATURESLOADSTART));const u=g=>{this.loading=Number(this.loading)-1,this.dispatchEvent(new Gi(en.FEATURESLOADEND,void 0,g))},h=()=>{this.changed(),this.loading=Number(this.loading)-1,this.dispatchEvent(new Gi(en.FEATURESLOADERROR))};let f=!1;const d=this.loader_.call(this,l,t,i,g=>f||u(g),()=>f||h());d instanceof Promise?(f=!0,d.then(g=>{this.addFeatures(g),u(g)}).catch(h)):this.loader_.length<4&&(this.loading=!1),r.insert(l,{extent:l.slice()})}}}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const t=this.loadedExtentsRtree_,i=t.forEachInExtent(e,function(r){if(Bn(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=_e(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(We),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(en.REMOVEFEATURE)&&this.dispatchEvent(new Gi(en.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){Oe(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(x_(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}}const w_=[];class vS extends Lo{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_=Ze(1,1,w_)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){const t=_e(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedPixelRatio:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){this.context_&&(uo(this.context_),w_.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}let E_=class extends Lo{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==J.IDLE&&(this.setState(J.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(J.ERROR)}setFeatures(e){this.features_=e,this.setState(J.LOADED)}setLoader(e){this.loader_=e}};class Af extends bl{constructor(e){const t=e.projection||"EPSG:3857",i=e.extent||Do(t),r=e.tileGrid||El({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:b_,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:E_,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(e,t,i,r){if(i.getState()===J.IDLE){i.setState(J.LOADING);const s=i.wrappedTileCoord,o=this.getTileGridForProjection(t);let a=o.getTileCoordExtent(s);const l=s[0],c=o.getResolution(l);Vn(a,-c,a);const u=this.projection;t&&this.projection&&!Et(t,u)&&(a=Kr(a,t,u));const h=this.tileGrid,f=h.getExtent();f&&cn(a,f,a);let d=c;t&&u&&!Et(t,u)&&(d=c/u.getMetersPerUnit()/t.getMetersPerUnit());const g=h.getZForResolution(d,this.zDirection),p=r||this.tileUrlFunction;h.forEachTileCoord(a,g,m=>{const y=p(m,e,t);this.sourceTiles_[y]||(this.sourceTiles_[y]=new this.tileClass(m,y?J.IDLE:J.EMPTY,y,this.format_,this.tileLoadFunction));const _=this.sourceTiles_[y];i.sourceTiles.push(_),this.tileKeysBySourceTileUrl_[y]||(this.tileKeysBySourceTileUrl_[y]=[]),this.tileKeysBySourceTileUrl_[y].push(i.getKey());const v=_.getState();if(v<J.LOADED){const x=w=>{this.handleTileChange(w);const T=_.getState();if(T===J.LOADED||T===J.ERROR){const R=_.getKey();R in i.errorTileKeys?_.getState()===J.LOADED&&delete i.errorTileKeys[R]:i.loadingSourceTiles--,T===J.ERROR?i.errorTileKeys[R]=!0:_.removeEventListener(de.CHANGE,x),i.loadingSourceTiles===0&&i.setState(mi(i.errorTileKeys)?J.LOADED:J.ERROR)}};_.addEventListener(de.CHANGE,x),i.loadingSourceTiles++}v===J.IDLE&&(_.extent=h.getTileCoordExtent(m),_.projection=this.projection,_.resolution=h.getResolution(m[0]),_.load())}),i.loadingSourceTiles||i.setState(i.sourceTiles.some(m=>m.getState()===J.ERROR)?J.ERROR:J.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,u=this.getTileGridForProjection(s);if(a&&l){const g=u.getTileCoordExtent(a);Vn(g,-u.getResolution(e),g),it(l,!s||!c||Et(s,c)?g:Kr(g,s,c))||(a=null)}let h=!0;if(a!==null){const g=this.tileGrid,p=u.getResolution(e);let m=p;s&&c&&!Et(s,c)&&(m=p/c.getMetersPerUnit()/s.getMetersPerUnit());const y=g.getZForResolution(m,1),_=u.getTileCoordExtent(a);Vn(_,-p,_),g.forEachTileCoord(!s||!c||Et(s,c)?_:Kr(_,s,c),y,v=>{h=h&&!this.tileUrlFunction(v,r,c)})}const f=this.tileUrlFunction,d=new vS(o,h?J.EMPTY:J.IDLE,a,g=>this.getSourceTiles(r,s,g,f),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&&!Et(r,e))return zh(e);const s=this.tileGrid,o=s.getResolutions().slice(),a=o.map(function(u,h){return s.getOrigin(h)}),l=o.map(function(u,h){return s.getTileSize(h)}),c=Np+1;for(let u=o.length;u<c;++u)o.push(o[u-1]/2),a.push(a[u-1]),l.push(l[u-1]);i=new wl({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=bt(r.getTileSize(e),this.tmpSize);return[Math.round(s[0]*t),Math.round(s[1]*t)]}setOverlaps(e){this.overlaps_=e,this.changed()}}function b_(n,e){n.setLoader(function(t,i,r){__(e,n.getFormat(),t,i,r,n.onLoad.bind(n),n.onError.bind(n))})}function C_(n,e){const t=e[0].evaluate(n),i=e[1].evaluate(n),r=e[2].evaluate(n),s=e[3]?e[3].evaluate(n):1;return Qe.parse(`hsla(${t}, ${i}%, ${r}%, ${s})`)}function wS(n){const e=n[0]/255,t=n[1]/255,i=n[2]/255,r=n[3],s=Math.max(e,t,i),o=Math.min(e,t,i),a=(s+o)/2;let l,c;if(s===o)l=0,c=0;else{const u=s-o;switch(c=a>.5?u/(2-s-o):u/(s+o),s){case e:l=(t-i)/u+(t<i?6:0);break;case t:l=(i-e)/u+2;break;case i:l=(e-t)/u+4;break;default:l=0}l/=6}return[l*360,c*100,a*100,r]}function rc(n){if(Array.isArray(n)){if(n.length===0)return n;const e=n[0];if(e==="literal")return n;if(e==="image"&&n.length===3&&typeof n[2]=="object"&&n[2]!==null&&!Array.isArray(n[2]))return["image-config",rc(n[1]),["literal",n[2]]];const t=n.length;for(let i=1;i<t;++i){const r=n[i],s=rc(r);if(s!==r){const o=[e];for(let a=1;a<i;++a)o.push(n[a]);o.push(s);for(let a=i+1;a<t;++a)o.push(rc(n[a]));return o}}}return n}const Pf={},Ft={zoom:0,distanceFromCenter:0};Di.register(Gl,{...Di.definitions,pitch:[{kind:"number"},[],n=>Ft.pitch||0],"distance-from-center":[{kind:"number"},[],n=>Ft.distanceFromCenter||0],"to-hsla":[{kind:"array",itemType:{kind:"number"},N:4},[{kind:"string"}],(n,[e])=>wS(ul(e.evaluate(n)))],hsl:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"}],C_],hsla:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"},{kind:"number"}],C_],"image-config":[{kind:"value"},[{kind:"string"},{kind:"value"}],(n,[e,t])=>e.evaluate(n)],"measure-light":[{kind:"number"},[{kind:"value"}],()=>1],config:[{kind:"value"},[{kind:"string"}],(n,[e])=>{const t=Pf[e.evaluate(n)];return t===void 0?{}:t}]});const T_="https://api.mapbox.com";function Ff(n){const e="mapbox://";return n.indexOf(e)!==0?"":n.slice(e.length)}function ES(n,e,t){if(typeof n=="string")return[{id:"default",url:R_(n,e,t)}];for(const i of n)i.url=R_(i.url,e,t);return n}function R_(n,e,t){const i=Ff(n);if(!e||!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`${T_}/styles/v1/${s}/sprite?access_token=${e}`}function sc(n,e){const t=Ff(n);if(!t||!e)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`${T_}/styles/v1/${r}?&access_token=${e}`}const bS=["a","b","c","d"];function oc(n,e,t,i){const r=new URL(n,i||location.href),s=Ff(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 bS.map(o=>`https://${o}.tiles.mapbox.com/v4/${s}/{z}/{x}/{y}.vector.pbf?access_token=${e}`)}class CS extends Dh{constructor(e){super(e),this.image=null,this.renderedSourceRevision_=0}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=cn(l,Yn(t.extent,r.projection))),!a[Ke.ANIMATING]&&!a[Ke.INTERACTING]&&!Ei(l))if(o){!this.getLayer().rendered&&this.renderedSourceRevision_!==o.getRevision()&&(this.image=null),this.renderedSourceRevision_=o.getRevision();const c=r.projection,u=o.getImage(l,s,i,c);u&&(this.loadImage(u)?this.image=u:u.getState()===re.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=lt(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!Hi(s,r))return null;const o=this.image.getExtent(),a=this.image.getImage(),l=Se(o),c=Math.floor(a.width*((r[0]-o[0])/l));if(c<0||c>=a.width)return null;const u=ot(o),h=Math.floor(a.height*((o[3]-r[1])/u));return h<0||h>=a.height?null:this.getImageData(a,c,h)}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],u=e.pixelRatio,h=e.viewState,f=h.center,d=h.resolution,g=u*o/(d*l),p=u*a/(d*l);this.prepareContainer(e,t);const m=this.context.canvas.width,y=this.context.canvas.height,_=this.getRenderContext(e);let v=!1,x=!0;if(c.extent){const S=Yn(c.extent,h.projection);x=it(S,e.extent),v=x&&!Xn(S,e.extent),v&&this.clipUnrotated(_,e,S)}const w=i.getImage(),T=Sn(this.tempTransform,m/2,y/2,g,p,0,l*(r[0]-f[0])/o,l*(f[1]-r[3])/a);this.renderedResolution=a*u/l;const R=w.width*T[0],C=w.height*T[3];if(this.getLayer().getSource().getInterpolate()||(_.imageSmoothingEnabled=!1),this.preRender(_,e),x&&R>=.5&&C>=.5){const S=T[4],L=T[5],B=c.opacity;B!==1&&(_.save(),_.globalAlpha=B),_.drawImage(w,0,0,+w.width,+w.height,S,L,R,C),B!==1&&_.restore()}return this.postRender(this.context,e),v&&_.restore(),_.imageSmoothingEnabled=!0,this.container}}class TS extends Zr{constructor(e){e=e||{},super(e)}}class Of extends TS{constructor(e){super(e)}createRenderer(){return new CS(this)}getData(e){return super.getData(e)}}class RS extends mh{constructor(e,t,i,r,s){const o=s!==void 0?re.IDLE:re.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=re.ERROR):this.state=re.LOADED,this.changed()}load(){this.state==re.IDLE&&(this.state=re.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}function Lf(n){return Array.isArray(n)?Math.min(...n):n}class SS extends mh{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 u=c?cn(i,c):i,h=zt(u),f=Oh(e,t,h,r),d=Nm,g=new km(e,t,u,l,f*d,r),p=g.calculateSourceExtent(),m=Ei(p)?null:o(p,f,s),y=m?re.IDLE:re.EMPTY,_=m?m.getPixelRatio():1;super(i,r,_,y),this.targetProj_=t,this.maxSourceExtent_=l,this.triangulation_=g,this.targetResolution_=r,this.targetExtent_=i,this.sourceImage_=m,this.sourcePixelRatio_=_,this.interpolate_=a,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==re.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const e=this.sourceImage_.getState();if(e==re.LOADED){const t=Se(this.targetExtent_)/this.targetResolution_,i=ot(this.targetExtent_)/this.targetResolution_;this.canvas_=Lm(t,i,this.sourcePixelRatio_,Lf(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==re.IDLE){this.state=re.LOADING,this.changed();const e=this.sourceImage_.getState();e==re.LOADED||e==re.ERROR?this.reproject_():(this.sourceListenerKey_=Te(this.sourceImage_,de.CHANGE,t=>{const i=this.sourceImage_.getState();(i==re.LOADED||i==re.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){We(this.sourceListenerKey_),this.sourceListenerKey_=null}}const ac=4,Df={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class IS extends an{constructor(e,t){super(e),this.image=t}}class S_ extends ls{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=Da(t,e,0);e=t[i]}return e}getImage(e,t,i,r){const s=this.getProjection();if(!s||!r||Et(s,r))return s&&(r=s),this.getImageInternal(e,t,i,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Et(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&Bn(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new SS(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=MS(e,t,i,1),o=this.findNearestResolution(t);if(this.image&&(this.static_||this.wantedProjection_===r&&(this.wantedExtent_&&Xn(this.wantedExtent_,s)||Xn(this.image.getExtent(),s))&&(this.wantedResolution_&&Lf(this.wantedResolution_)===o||Lf(this.image.getResolution())===o)))return this.image;this.wantedProjection_=r,this.wantedExtent_=s,this.wantedResolution_=o,this.image=new mh(s,o,i,this.loader),this.image.addEventListener(de.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(e){const t=e.target;let i;switch(t.getState()){case re.LOADING:this.loading=!0,i=Df.IMAGELOADSTART;break;case re.LOADED:this.loading=!1,i=Df.IMAGELOADEND;break;case re.ERROR:this.loading=!1,i=Df.IMAGELOADERROR;break;default:return}this.hasListener(i)&&this.dispatchEvent(new IS(i,t))}}function MS(n,e,t,i){const r=e/t,s=zt(n),o=wi(Se(n)/r,ac),a=wi(ot(n)/r,ac),l=wi((i-1)*o/2,ac),c=o+2*l,u=wi((i-1)*a/2,ac),h=a+2*u;return Xa(s,r,0,[c,h])}function I_(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 f=new Array(a);for(let g=0;g<a;++g)f[g]=new ImageData(new Uint8ClampedArray(t[g]),s,o);return n(f,i).data.buffer}const c=new Uint8ClampedArray(l),u=new Array(a),h=new Array(a);for(let f=0;f<a;++f)u[f]=new Uint8ClampedArray(t[f]),h[f]=[0,0,0,0];for(let f=0;f<l;f+=4){for(let g=0;g<a;++g){const p=u[g];h[g][0]=p[f],h[g][1]=p[f+1],h[g][2]=p[f+2],h[g][3]=p[f+3]}const d=n(h,i);c[f]=d[0],c[f+1]=d[1],c[f+2]=d[2],c[f+3]=d[3]}return c.buffer}}function AS(n,e){const i=Object.keys(n.lib||{}).map(function(s){return"const "+s+" = "+n.lib[s].toString()+";"}).concat(["const __minion__ = ("+I_.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(`
11
- `),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",e),r}function PS(n,e){const t=I_(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 FS extends Hs{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]=AS(e,this.onWorkerMessage_.bind(this,r));else i[0]=PS(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,u=[];for(let h=0,f=r.length;h<f;++h)u.push(r[h].slice(c,c+a));this.workers_[l].postMessage({buffers:u,meta:e.meta,imageOps:this.imageOps_,width:t,height:i},u)}}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 M_={BEFOREOPERATIONS:"beforeoperations",AFTEROPERATIONS:"afteroperations"};class A_ extends an{constructor(e,t,i){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=i}}class kf extends S_{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_=DS(e.sources);const t=this.changed.bind(this);for(let i=0,r=this.layers_.length;i<r;++i)this.layers_[i].addEventListener(de.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new jg(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:Gt(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:LS(this.layers_),pixelRatio:1,pixelToCoordinateTransform:Gt(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:_e(this),renderTargets:{}},this.setAttributions(function(i){const r=[];for(let s=0,o=e.sources.length;s<o;++s){const a=e.sources[s],l=a instanceof ls?a:a.getSource();if(!l)continue;const c=l.getAttributions()?.(i);typeof c=="string"?r.push(c):c!==void 0&&r.push(...c)}return r}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new FS({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=zt(e);r.size[0]=Math.ceil(Se(e)/t),r.size[1]=Math.ceil(ot(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||!Bn(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=OS(this.layers_[s],e);if(o)i[s]=o;else return}const r={};this.dispatchEvent(new A_(M_.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||!Bn(s,this.requestedFrameState_.extent))return;let a;if(this.renderedImageCanvas_)a=this.renderedImageCanvas_.getImage().getContext("2d");else{const l=Math.round(Se(s)/o),c=Math.round(ot(s)/o);a=Ze(l,c),this.renderedImageCanvas_=new RS(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_(M_.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()}}kf.prototype.dispose;let wr=null;function OS(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(!wr)wr=Ze(i,r,void 0,{willReadFrequently:!0});else{const a=wr.canvas;a.width!==i||a.height!==r?wr=Ze(i,r,void 0,{willReadFrequently:!0}):wr.clearRect(0,0,i,r)}return wr.drawImage(o,0,0,i,r),wr.getImageData(0,0,i,r)}function LS(n){return n.map(function(e){return e.getLayerState()})}function DS(n){const e=n.length,t=new Array(e);for(let i=0;i<e;++i)t[i]=kS(n[i]);return t}function kS(n){let e;return n instanceof ls?n instanceof $m?e=new Nh({source:n}):n instanceof S_&&(e=new Of({source:n})):e=n,e}function NS(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,u=[0,0,0,0],h=Math.PI,f=e.encoding,d=e.exaggeration,g=e.zoom,p=e.method||"standard",m=e.accentColor,y=e.shadowColors||[e.shadowColor],_=e.highlightColors||[e.highlightColor],x=(e.azimuths||[e.sunAz]).map(ie=>ie*h/180),T=(e.altitudes||[45]).map(ie=>ie*h/180),R=Math.min(x.length,T.length,y.length,_.length,4),C=g<2?.4:g<4.5?.35:.3,S=g<15?Math.pow(2,(15-g)*C):1;function L(ie,k="mapbox"){return k==="mapbox"?(ie[0]*256*256+ie[1]*256+ie[2])*.1-1e4:k==="terrarium"?ie[0]*256+ie[1]+ie[2]/256-32768:0}function B(ie,k){return ie!==0?Math.atan2(k,-ie):h/2*(k>0?1:-1)}function K(ie,k){const He=x[0]+h,E=Math.atan(.625*Math.sqrt(ie*ie+k*k)),b=B(ie,k),I=1.875-d*1.75,D=.5*h,A=d!==.5?(Math.pow(I,E)-1)/(Math.pow(I,D)-1)*D:E,O=Math.cos(A),V=Math.min(Math.max(d*2,0),1),U=(1-O)*V,$=m,N=$.r*U,ee=$.g*U,Q=$.b*U,Y=$.a*U;let Z=(b+He)/h+.5;Z=Z%2,Z<0&&(Z+=2);const q=Math.abs(Z-1),ae=Math.sin(A)*V,ce=y[0],se=_[0],fe=(ce.r*(1-q)+se.r*q)*ae,Me=(ce.g*(1-q)+se.g*q)*ae,Fe=(ce.b*(1-q)+se.b*q)*ae,$e=(ce.a*(1-q)+se.a*q)*ae;return[N*(1-$e)+fe,ee*(1-$e)+Me,Q*(1-$e)+Fe,Y*(1-$e)+$e]}function F(ie,k){ie*=d*2,k*=d*2;const He=B(ie,k),E=x[0]+h,b=Math.atan(Math.sqrt(ie*ie+k*k))*(2/h);let I=(He+E)/h+.5;I=I%2,I<0&&(I+=2);const D=1-Math.abs(I-1),A=b*D,O=b*(1-D),V=y[0],U=_[0];return[V.r*A+U.r*O,V.g*A+U.g*O,V.b*A+U.b*O,V.a*A+U.a*O]}function P(ie,k){ie*=d*2,k*=d*2;const He=x[0]+h,E=Math.cos(He),b=Math.sin(He),I=Math.cos(T[0]),A=(Math.sin(T[0])-(k*E*I-ie*b*I))/Math.sqrt(1+ie*ie+k*k),O=Math.max(0,Math.min(1,A));if(O>.5){const $=2*O-1,N=_[0];return[N.r*$,N.g*$,N.b*$,N.a*$]}const V=1-2*O,U=y[0];return[U.r*V,U.g*V,U.b*V,U.a*V]}function oe(ie,k){ie*=d*2,k*=d*2;const He=x[0]+h,E=Math.cos(He),b=Math.sin(He),I=Math.cos(T[0]),D=Math.sin(T[0]);let A=Math.acos((D-(k*E*I-ie*b*I))/Math.sqrt(1+ie*ie+k*k));A=Math.max(0,Math.min(h/2,A));const O=Math.atan(Math.sqrt(ie*ie+k*k))*(4/h/h),V=A*O,U=(h/2-A)*O,$=y[0],N=_[0];return[$.r*V+N.r*U,$.g*V+N.g*U,$.b*V+N.b*U,$.a*V+N.a*U]}function W(ie,k){ie*=d*2,k*=d*2;const He=ie*ie+k*k,E=Math.sqrt(1+He);let b=0,I=0,D=0,A=0;for(let O=0;O<R;O++){const V=Math.cos(T[O]),U=Math.sin(T[O]),$=-Math.cos(x[O]),N=-Math.sin(x[O]),ee=(U-(k*$*V-ie*N*V))/E,Q=Math.max(0,Math.min(1,ee)),Y=y[Math.min(O,y.length-1)],Z=_[Math.min(O,_.length-1)];if(Q>.5){const q=(2*Q-1)/R;b+=Z.r*q,I+=Z.g*q,D+=Z.b*q,A+=Z.a*q}else{const q=(1-2*Q)/R;b+=Y.r*q,I+=Y.g*q,D+=Y.b*q,A+=Y.a*q}}return[b,I,D,A]}const X=p==="igor"?F:p==="basic"?P:p==="combined"?oe:p==="multidirectional"?W:K;let z,M,ne,le,ge,ze,G,xe,he,Ie,Pe;for(M=0;M<=c;++M)for(ge=M===0?0:M-1,ze=M===c?c:M+1,z=0;z<=l;++z){ne=z===0?0:z-1,le=z===l?l:z+1,G=(M*i+ne)*4,u[0]=s[G],u[1]=s[G+1],u[2]=s[G+2],u[3]=s[G+3],xe=L(u,f),G=(M*i+le)*4,u[0]=s[G],u[1]=s[G+1],u[2]=s[G+2],u[3]=s[G+3],he=L(u,f),Ie=(he-xe)/a*S,G=(ge*i+z)*4,u[0]=s[G],u[1]=s[G+1],u[2]=s[G+2],u[3]=s[G+3],xe=L(u,f),G=(ze*i+z)*4,u[0]=s[G],u[1]=s[G+1],u[2]=s[G+2],u[3]=s[G+3],he=L(u,f),Pe=(he-xe)/a*S;const ie=X(Ie,Pe),k=ie[3];G=(M*i+z)*4,k>0&&(o[G]=ie[0]/k*255,o[G+1]=ie[1]/k*255,o[G+2]=ie[2]/k*255),o[G+3]=k*255}return new ImageData(o,i,r)}function zS(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 u,h,f;function d(C){return C>0?1/(1-C):1+C}function g(C){return C>0?1-1/(1.001-C):-C}function p(C){C*=Math.PI/180;const S=Math.sin(C),L=Math.cos(C);return[(2*L+1)/3,(-Math.sqrt(3)*S-L+1)/3,(Math.sqrt(3)*S-L+1)/3]}const m=g(e.saturation),y=d(e.contrast),_=p(e.hueRotate),v=_,x=[_[2],_[0],_[1]],w=[_[1],_[2],_[0]],T=e.brightnessLow,R=e.brightnessHigh;for(h=0;h<=l;++h)for(u=0;u<=a;++u){f=(h*i+u)*4,c[0]=s[f],c[1]=s[f+1],c[2]=s[f+2],c[3]=s[f+3];const C=c[0],S=c[1],L=c[2],B=(W,X)=>{let z=0;for(let M=0;M<W.length;M++)z+=W[M]*X[M];return z};let K=B([C,S,L],v),F=B([C,S,L],x),P=B([C,S,L],w);const oe=(K+F+P)/3;K+=(oe-K)*m,F+=(oe-F)*m,P+=(oe-P)*m,K=(K-127.5)*y+127.5,F=(F-127.5)*y+127.5,P=(P-127.5)*y+127.5,K=T*(255-K)+R*K,F=T*(255-F)+R*F,P=T*(255-P)+R*P,o[f]=K,o[f+1]=F,o[f+2]=P,o[f+3]=c[3]}return new ImageData(o,i,r)}var P_={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},Qo=" ",F_=/(italic|oblique)$/i,O_={};function Nf(n,e,t){var i=O_[n];if(!i){Array.isArray(n)||(n=[n]);for(var r=400,s="normal",o=[],a,l,c=0,u=n.length;c<u;++c){var h=n[c],f=h.split(" "),d=f[f.length-1].toLowerCase();d=="normal"||d=="italic"||d=="oblique"?(s=l?s:d,l=!0,f.pop(),d=f[f.length-1].toLowerCase()):F_.test(d)&&(d=d.replace(F_,""),s=l?s:f[f.length-1].replace(d,""),l=!0);for(var g in P_){var p=f.length>1?f[f.length-2].toLowerCase():"";if(d==g||d==g.replace("-","")||p+"-"+d==g){r=a?r:P_[g],f.pop(),p&&g.startsWith(p)&&f.pop();break}}!a&&typeof d=="number"&&(r=d,a=!0);var m=f.join(Qo).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");m.indexOf(Qo)!==-1&&(m='"'+m+'"'),o.push(m)}i=O_[n]=[s,r,o]}return i[0]+Qo+i[1]+Qo+e+"px"+(t?"/"+t:"")+Qo+i[2]}const at=Object.freeze({}),L_={},D_={};let GS=0;function zf(n){return n.id||(n.id=GS++),n.id}function jS(n,e){return zf(n)+"."+_e(e)}function Gf(n){let e=L_[n.id];return e||(e={},L_[zf(n)]=e),e}function WS(n){let e=D_[n.id];return e||(e={},D_[zf(n)]=e),e}function jf(n){return n*Math.PI/180}const dn=(function(){const n=[];for(let e=78271.51696402048;n.length<=24;e/=2)n.push(e);return n})();function lc(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 cc(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 ea(n,e){const t=Math.floor(n),i=Math.pow(2,n-t);return e[t]/i}const Ts={};function Rs(n,e,t={},i){if(e in Ts)return i&&(i.url=Ts[e][0].url),Ts[e][1];const r=t.transformRequest&&t.transformRequest(e,n)||e,s=function(l){return delete Ts[e],Promise.reject(new Error("Error fetching source "+e))},o=function(l){return delete Ts[e],l.ok?l.json():Promise.reject(new Error("Error fetching source "+e))},a=Nr(()=>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 Ts[e]=[r,a],a}function k_(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=sc(n,e.accessToken),Rs("Style",n,e);else return Promise.resolve(n)}const N_={};function z_(n,e,t={}){const i=[e,JSON.stringify(n)].toString();let r=N_[i];if(!r||t.transformRequest){let s;t.transformRequest&&(s=(a,l)=>{const c=t.transformRequest&&t.transformRequest(l,"Tiles")||l;if(a instanceof E_)a.setLoader((u,h,f)=>{const d=function(g){g.arrayBuffer().then(p=>{const y=a.getFormat().readFeatures(p,{extent:u,featureProjection:f});a.setFeatures(y)})};Nr(()=>c).then(g=>{if(g instanceof Response)return d(g);fetch(g).then(d).catch(p=>a.setState(J.ERROR))}).catch(g=>a.setState(J.ERROR))});else{const u=a.getImage();Nr(()=>c).then(h=>{if(typeof h=="string"){u.src=h;return}const f=d=>d.blob().then(g=>{const p=URL.createObjectURL(g);u.addEventListener("load",()=>URL.revokeObjectURL(p)),u.addEventListener("error",()=>URL.revokeObjectURL(p)),u.src=p});if(h instanceof Response)return f(h);fetch(h).then(f).catch(d=>a.setState(J.ERROR))}).catch(h=>a.setState(J.ERROR))}});const o=n.url;if(o&&!n.tiles){const a=oc(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=Rs("Source",a[0],t,l).then(function(c){return c.tiles=c.tiles.map(function(u){return c.scheme==="tms"&&(u=u.replace("{y}","{-y}")),oc(u,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}")),oc(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`"));N_[i]=r}return r}function G_(n,e,t,i){const r=[2*t*e.pixelRatio+e.width,2*t*e.pixelRatio+e.height],s=lc(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,u=a.width;c<u;++c)for(let h=0,f=a.height;h<f;++h){const d=(h*u+c)*4;l[d+3]>0&&o.arc(c,h,t*e.pixelRatio,0,2*Math.PI)}return o.fill(),s}function VS(n,e,t){const i=Math.max(0,Math.min(1,(t-n)/(e-n)));return i*i*(3-2*i)}function j_(n,e,t){const i=lc(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,u=s.height;c<u;++c){const h=(c*l+a)*4,f=o[h+3]/255,d=.75,g=.1,p=VS(d-g,d+g,f);p>0?(o[h+0]=Math.round(255*t.r*p),o[h+1]=Math.round(255*t.g*p),o[h+2]=Math.round(255*t.b*p),o[h+3]=Math.round(255*p)):o[h+3]=0}return r.putImageData(s,0,0),i}const XS=Array(256).join(" ");function Wf(n,e){if(e>=.05){let t="";const i=n.split(`
9
+ `).reduce(ZR,[]),{width:g,height:p,widths:m,heights:y,lineWidths:_}=hb(l,d),w=g+f,x=[],v=(w+2)*u[0],T=(p+f)*u[1],R={width:v<0?Math.floor(v):Math.ceil(v),height:T<0?Math.floor(T):Math.ceil(T),contextInstructions:x};(u[0]!=1||u[1]!=1)&&x.push("scale",u),r&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",f),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-h;let S=h*w+C*f;const L=[],B=[];let K=0,F=0,P=0,oe=0,W;for(let X=0,z=d.length;X<z;X+=2){const M=d[X];if(M===`
10
+ `){F+=K,K=0,S=h*w+C*f,++oe;continue}const ne=d[X+1]||l.font;ne!==W&&(r&&L.push("font",ne),i&&B.push("font",ne),W=ne),K=Math.max(K,y[P]);const le=[M,S+C*m[P]+h*(m[P]-_[oe]),.5*(f+K)+F];S+=m[P],r&&L.push("strokeText",le),i&&B.push("fillText",le),++P}return Array.prototype.push.apply(x,L),Array.prototype.push.apply(x,B),this.labels_[s]=R,R}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,u,h,f,d,g,p,m){a*=f[0],l*=f[1];let y=i-a,_=r-l;const w=s+c>e?e-c:s,x=o+u>t?t-u:o,v=g[3]+w*f[0]+g[1],T=g[0]+x*f[1]+g[2],R=y-g[3],C=_-g[0];(p||h!==0)&&(zi[0]=R,Gi[0]=R,zi[1]=C,ri[1]=C,ri[0]=R+v,si[0]=ri[0],si[1]=C+T,Gi[1]=si[1]);let S;return h!==0?(S=In(Gt(),i,r,1,1,h,-i,-r),lt(S,zi),lt(S,ri),lt(S,si),lt(S,Gi),Bn(Math.min(zi[0],ri[0],si[0],Gi[0]),Math.min(zi[1],ri[1],si[1],Gi[1]),Math.max(zi[0],ri[0],si[0],Gi[0]),Math.max(zi[1],ri[1],si[1],Gi[1]),bs)):Bn(Math.min(R,R+v),Math.min(C,C+T),Math.max(R,R+v),Math.max(C,C+T),bs),d&&(y=Math.round(y),_=Math.round(_)),{drawImageX:y,drawImageY:_,drawImageW:w,drawImageH:x,originX:c,originY:u,declutterBox:{minX:bs[0],minY:bs[1],maxX:bs[2],maxY:bs[3],value:m},canvasTransform:S,scale:f}}replayImageOrLabel_(e,t,i,r,s,o,a){const l=!!(o||a),c=r.declutterBox,u=a?a[2]*r.scale[0]/2:0;return c.minX-u<=t[0]&&c.maxX+u>=0&&c.minY-u<=t[1]&&c.maxY+u>=0&&(l&&this.replayTextBackground_(e,zi,ri,si,Gi,o,a),fb(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=lt(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.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=Sf(Array.isArray(e)?e[0]:e,s.textAlign||So),u=ec[s.textBaseline||fl],h=a&&a.lineWidth?a.lineWidth:0,f=o.width/l-2*s.scale[0],d=c*f+2*(.5-c)*h,g=u*o.height/l+2*(.5-u)*h;return{label:o,anchorX:d,anchorY:g}}execute_(e,t,i,r,s,o,a,l){const c=this.zIndexContext_;let u;this.pixelCoordinates_&&yi(i,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=Ci(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),cw(this.renderedTransform_,i));let h=0;const f=r.length;let d=0,g;const p=[];let m,y,_,w,x,v,T,R,C,S,L,B,K,F=0,P=0;const oe=this.coordinateCache_,W=this.viewRotation_,X=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,z={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:W},M=this.instructions!=r||this.overlaps?0:200;let ne,le,ge,ze;for(;h<f;){const G=r[h];switch(G[0]){case ue.BEGIN_GEOMETRY:ne=G[1],ze=G[3],ne.getGeometry()?a!==void 0&&!it(a,ze.getExtent())?h=G[2]+1:++h:h=G[2],c&&(c.zIndex=G[4]);break;case ue.BEGIN_PATH:F>M&&(this.fill_(e),F=0),P>M&&(e.stroke(),P=0),!F&&!P&&(e.beginPath(),x=NaN,v=NaN),++h;break;case ue.CIRCLE:d=G[1],_=G[2]??0;const he=u[d],Ie=u[d+1],Pe=u[d+2]-_,ie=u[d+3]-_,k=Pe-he,He=ie-Ie,E=Math.sqrt(k*k+He*He);e.moveTo(he+E,Ie),e.arc(he,Ie,E,0,2*Math.PI,!0),++h;break;case ue.CLOSE_PATH:e.closePath(),++h;break;case ue.CUSTOM:d=G[1],g=G[2];const b=G[3],I=G[4],D=G[5];z.geometry=b,z.feature=ne,h in oe||(oe[h]=[]);const A=oe[h];D?D(u,d,g,2,A):(A[0]=u[d],A[1]=u[d+1],A.length=2),c&&(c.zIndex=G[6]),I(A,z),++h;break;case ue.DRAW_IMAGE:d=G[1],g=G[2],C=G[3],m=G[4],y=G[5];let O=G[6];const V=G[7],U=G[8],$=G[9],N=G[10];let ee=G[11];const Q=G[12];let Y=G[13];w=G[14]||"declutter";const Z=G[15];if(!C&&G.length>=20){S=G[19],L=G[20],B=G[21],K=G[22];const ht=this.drawLabelWithPointPlacement_(S,L,B,K);C=ht.label,G[3]=C;const Rr=G[23];m=(ht.anchorX-Rr)*this.pixelRatio,G[4]=m;const tn=G[24];y=(ht.anchorY-tn)*this.pixelRatio,G[5]=y,O=C.height,G[6]=O,Y=C.width,G[13]=Y}let q;G.length>25&&(q=G[25]);let ae,ce,se;G.length>17?(ae=G[16],ce=G[17],se=G[18]):(ae=ur,ce=null,se=null),N&&X?ee+=W:!N&&!X&&(ee-=W);let fe=0;for(;d<g;d+=2){if(q&&q[fe++]<Y/this.pixelRatio)continue;const ht=this.calculateImageOrLabelDimensions_(C.width,C.height,u[d],u[d+1],Y,O,m,y,U,$,ee,Q,s,ae,!!ce||!!se,ne),Rr=[e,t,C,ht,V,ce,se];if(l){let tn,Dn,nn;if(Z){const rt=g-d;if(!Z[rt]){Z[rt]={args:Rr,declutterMode:w};continue}const Dt=Z[rt];tn=Dt.args,Dn=Dt.declutterMode,delete Z[rt],nn=o_(tn)}let ai,li;if(tn&&(Dn!=="declutter"||!l.collides(nn))&&(ai=!0),(w!=="declutter"||!l.collides(ht.declutterBox))&&(li=!0),Dn==="declutter"&&w==="declutter"){const rt=ai&&li;ai=rt,li=rt}ai&&(Dn!=="none"&&l.insert(nn),this.replayImageOrLabel_.apply(this,tn)),li&&(w!=="none"&&l.insert(ht.declutterBox),this.replayImageOrLabel_.apply(this,Rr))}else this.replayImageOrLabel_.apply(this,Rr)}++h;break;case ue.DRAW_CHARS:const Me=G[1],Fe=G[2],$e=G[3],Rt=G[4];K=G[5];const ke=G[6],Ve=G[7],je=G[8];B=G[9];const ut=G[10];S=G[11],Array.isArray(S)&&(S=S.reduce(qR,"")),L=G[12];const Ot=[G[13],G[13]];w=G[14]||"declutter";const Lt=G[15],Je=this.textStates[L],Vt=Je.font,Cr=[Je.scale[0]*Ve,Je.scale[1]*Ve];let oi;Vt in this.widths_?oi=this.widths_[Vt]:(oi={},this.widths_[Vt]=oi);const fc=vf(u,Me,Fe,2),dc=Math.abs(Cr[0])*hm(Vt,S,oi);if(Rt||dc<=fc){const ht=this.textStates[L].textAlign,Rr=(fc-dc)*Sf(S,ht),tn=YR(u,Me,Fe,2,S,Rr,ke,Math.abs(Cr[0]),hm,Vt,oi,X?0:this.viewRotation_,Lt);e:if(tn){const Dn=[];let nn,ai,li,rt,Dt;if(B)for(nn=0,ai=tn.length;nn<ai;++nn){Dt=tn[nn],li=Dt[4],rt=this.createLabel(li,L,"",B),m=Dt[2]+(Cr[0]<0?-ut:ut),y=$e*rt.height+(.5-$e)*2*ut*Cr[1]/Cr[0]-je;const ci=this.calculateImageOrLabelDimensions_(rt.width,rt.height,Dt[0],Dt[1],rt.width,rt.height,m,y,0,0,Dt[3],Ot,!1,ur,!1,ne);if(l&&w==="declutter"&&l.collides(ci.declutterBox))break e;Dn.push([e,t,rt,ci,1,null,null])}if(K)for(nn=0,ai=tn.length;nn<ai;++nn){Dt=tn[nn],li=Dt[4],rt=this.createLabel(li,L,K,""),m=Dt[2],y=$e*rt.height-je;const ci=this.calculateImageOrLabelDimensions_(rt.width,rt.height,Dt[0],Dt[1],rt.width,rt.height,m,y,0,0,Dt[3],Ot,!1,ur,!1,ne);if(l&&w==="declutter"&&l.collides(ci.declutterBox))break e;Dn.push([e,t,rt,ci,1,null,null])}l&&w!=="none"&&l.load(Dn.map(o_));for(let ci=0,AI=Dn.length;ci<AI;++ci)this.replayImageOrLabel_.apply(this,Dn[ci])}}++h;break;case ue.END_GEOMETRY:if(o!==void 0){ne=G[1];const ht=o(ne,ze,w);if(ht)return ht}++h;break;case ue.FILL:M?F++:this.fill_(e),++h;break;case ue.MOVE_TO_LINE_TO:d=G[1],g=G[2],_=G[3];let Tr,ta,gc;if(_){const ht=G[4]??!1;r_(u,d,g,2,_,ht,p),s_(p,2),Tr=p,ta=0,gc=Tr.length}else Tr=u,ta=d,gc=g;le=Tr[ta],ge=Tr[ta+1],e.moveTo(le,ge),x=le+.5|0,v=ge+.5|0;for(let ht=ta+2;ht<gc;ht+=2)le=Tr[ht],ge=Tr[ht+1],T=le+.5|0,R=ge+.5|0,(ht==gc-2||T!==x||R!==v)&&(e.lineTo(le,ge),x=T,v=R);++h;break;case ue.SET_FILL_STYLE:this.alignAndScaleFill_=G[2],F?(this.fill_(e),F=0,P&&(e.stroke(),P=0)):P&&G[1]&&(e.stroke(),P=0),e.fillStyle=G[1],++h;break;case ue.SET_STROKE_STYLE:F&&G[1]&&(this.fill_(e),F=0),P&&(e.stroke(),P=0),this.setStrokeStyle_(e,G),++h;break;case ue.STROKE:M?P++:e.stroke(),++h;break;default:++h;break}}F&&this.fill_(e),P&&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 wr=["Polygon","Circle","LineString","Image","Text","Default"],tc=["Image","Text"],JR=wr.filter(n=>!tc.includes(n));let l_=!1,c_=!1;function QR(){let n=0;const e=i=>{const r=Ze(1,1,null,{willReadFrequently:i});let s=0;const o=performance.now();for(;performance.now()-o<50;++s)r.fillStyle=`rgba(255,0,${s%256},1)`,r.fillRect(0,0,1,1),r.getImageData(0,0,1,1);return n=s>n?s:n,s};l_={[e(!0)]:!0,[e(!1)]:!1,[e(void 0)]:void 0}[n],c_=!0}class u_{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_=Gt(),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 HR(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){c_===!1&&QR(),r=Math.round(r);const a=r*2+1,l=In(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=Ze(a,a,null,{willReadFrequently:l_}));const u=this.hitDetectionContext_;u.canvas.width!==a||u.canvas.height!==a?(u.canvas.width=a,u.canvas.height=a):c||u.clearRect(0,0,a,a);let h;this.renderBuffer_!==void 0&&(h=Bt(),no(h,e),Xn(h,t*(this.renderBuffer_+r),h));const f=eS(r);let d;function g(v,T,R){const C=u.getImageData(0,0,a,a).data;for(let S=0,L=f.length;S<L;S++)if(C[f[S]]>0){if(!o||R==="none"||d!=="Image"&&d!=="Text"||o.includes(v)){const B=(f[S]-3)/4,K=r-B%a,F=r-(B/a|0),P=s(v,T,K*K+F*F);if(P)return P}u.clearRect(0,0,a,a);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(Tn);let m,y,_,w,x;for(m=p.length-1;m>=0;--m){const v=p[m].toString();for(_=this.executorsByZIndex_[v],y=wr.length-1;y>=0;--y)if(d=wr[y],w=_[d],w!==void 0&&(x=w.executeHitDetection(u,l,i,g,h),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 Ci(a,0,8,2,e,a),a}isEmpty(){return mi(this.executorsByZIndex_)}execute(e,t,i,r,s,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?ov:Tn),o=o||wr;const c=wr.length;for(let u=0,h=l.length;u<h;++u){const f=l[u].toString(),d=this.executorsByZIndex_[f];for(let g=0,p=o.length;g<p;++g){const m=o[g],y=d[m];if(y!==void 0){const _=a===null?void 0:y.getZIndexContext(),w=_?_.getContext():e,x=this.maxExtent_&&m!=="Image"&&m!=="Text";if(x&&(w.save(),this.clip(w,i)),!_||m==="Text"||m==="Image"?y.execute(w,t,i,r,s,a):_.pushFunction(v=>y.execute(v,t,i,r,s,a)),x&&w.restore(),_){_.offset();const v=l[u]*c+wr.indexOf(m);this.deferredZIndexContexts_[v]||(this.deferredZIndexContexts_[v]=[]),this.deferredZIndexContexts_[v].push(_)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(Tn);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 If={};function eS(n){if(If[n]!==void 0)return If[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 If[n]=r,r}class tS extends e_{constructor(e,t,i,r,s,o,a){super(),this.context_=e,this.pixelRatio_=t,this.extent_=i,this.transform_=r,this.transformRotation_=r?Ga(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_=Gt()}drawImages_(e,t,i,r){if(!this.image_)return;const s=Ci(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 u=0,h=s.length;u<h;u+=2){const f=s[u]-this.imageAnchorX_,d=s[u+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const g=f+this.imageAnchorX_,p=d+this.imageAnchorY_;In(a,g,p,1,1,c,-g,-p),o.save(),o.transform.apply(o,a),o.translate(g,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_,f,d,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=Ci(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,o){const a=this.context_;let l=Ci(e,t,i,r,this.transform_,this.pixelCoordinates_);Math.abs(o)>0&&(l=r_(l,0,l.length,2,o,s,l),s_(l,2)),a.moveTo(l[0],l[1]);let c=l.length;s&&(c-=2);for(let u=2;u<c;u+=2)a.lineTo(l[u],l[u+1]);return s&&a.closePath(),i}drawRings_(e,t,i,r,s){for(let o=0,a=i.length;o<a;++o)t=this.moveToLineTo_(e,t,i[o],r,!0,s);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!it(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const t=_w(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_)),!!it(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,this.strokeState_.strokeOffset),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(it(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,this.strokeState_.strokeOffset);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_)),!!it(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.strokeState_?.strokeOffset),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_)),!!it(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.strokeState_?.strokeOffset)}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),yi(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:So;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:An(i||Wt)}}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(),u=s||Jn,h=t.getOffset();this.strokeState_={lineCap:r!==void 0?r:es,lineDash:this.pixelRatio_===1?u:u.map(f=>f*this.pixelRatio_),lineDashOffset:(o||Qn)*this.pixelRatio_,lineJoin:a!==void 0?a:ts,lineWidth:(l!==void 0?l:Io)*this.pixelRatio_,miterLimit:c!==void 0?c:Ro,strokeStyle:An(i||Pn),strokeOffset:(h??0)*this.pixelRatio_}}}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 d=t.getColor();this.textFillState_={fillStyle:An(d||Wt)}}const i=e.getStroke();if(!i)this.textStrokeState_=null;else{const d=i.getColor(),g=i.getLineCap(),p=i.getLineDash(),m=i.getLineDashOffset(),y=i.getLineJoin(),_=i.getWidth(),w=i.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:es,lineDash:p||Jn,lineDashOffset:m||Qn,lineJoin:y!==void 0?y:ts,lineWidth:_!==void 0?_:Io,miterLimit:w!==void 0?w:Ro,strokeStyle:An(d||Pn)}}const r=e.getFont(),s=e.getOffsetX(),o=e.getOffsetY(),a=e.getRotateWithView(),l=e.getRotation(),c=e.getScaleArray(),u=e.getText(),h=e.getTextAlign(),f=e.getTextBaseline();this.textState_={font:r!==void 0?r:am,textAlign:h!==void 0?h:So,textBaseline:f!==void 0?f:fl},this.text_=u!==void 0?Array.isArray(u)?u.reduce((d,g,p)=>d+=p%2?" ":g,""):u:"",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 Kt=.5;function h_(n,e,t,i,r,s,o,a,l){const c=l?Ja(r,l):r,u=n[0]*Kt,h=n[1]*Kt,f=Ze(u,h);f.imageSmoothingEnabled=!1;const d=f.canvas,g=new tS(f,Kt,r,null,o,a,l?Kr(oo(),l):null),p=t.length,m=Math.floor((256*256*256-1)/p),y={};for(let w=1;w<=p;++w){const x=t[w-1],v=x.getStyleFunction()||i;if(!v)continue;let T=v(x,s);if(!T)continue;Array.isArray(T)||(T=[T]);const C=(w*m).toString(16).padStart(7,"#00000");for(let S=0,L=T.length;S<L;++S){const B=T[S],K=B.getGeometryFunction()(x);if(!K||!it(c,K.getExtent()))continue;const F=B.clone(),P=F.getFill();P&&P.setColor(C);const oe=F.getStroke();oe&&(oe.setColor(C),oe.setLineDash(null)),F.setText(void 0);const W=B.getImage();if(W){const ne=W.getImageSize();if(!ne)continue;const le=Ze(ne[0],ne[1],void 0,{alpha:!1}),ge=le.canvas;le.fillStyle=C,le.fillRect(0,0,ge.width,ge.height),F.setImage(new dr({img:ge,anchor:W.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:W.getOrigin(),opacity:1,size:W.getSize(),scale:W.getScale(),rotation:W.getRotation(),rotateWithView:W.getRotateWithView()}))}const X=F.getZIndex()||0;let z=y[X];z||(z={},y[X]=z,z.Polygon=[],z.Circle=[],z.LineString=[],z.Point=[]);const M=K.getType();if(M==="GeometryCollection"){const ne=K.getGeometriesArrayRecursive();for(let le=0,ge=ne.length;le<ge;++le){const ze=ne[le];z[ze.getType().replace("Multi","")].push(ze,F)}}else z[M.replace("Multi","")].push(K,F)}}const _=Object.keys(y).map(Number).sort(Tn);for(let w=0,x=_.length;w<x;++w){const v=y[_[w]];for(const T in v){const R=v[T];for(let C=0,S=R.length;C<S;C+=2){g.setStyle(R[C+1]);for(let L=0,B=e.length;L<B;++L)g.setTransform(e[L]),g.drawGeometry(R[C])}}}return f.getImageData(0,0,d.width,d.height)}function f_(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=(Ye(r,0,t.width-1)+Ye(s,0,t.height-1)*t.width)*4,a=t.data[o],l=t.data[o+1],u=t.data[o+2]+256*(l+256*a),h=Math.floor((256*256*256-1)/e.length);u&&u%h===0&&i.push(e[u/h-1])}return i}const nS=.5,d_={Point:uS,LineString:aS,Polygon:fS,MultiPoint:hS,MultiLineString:lS,MultiPolygon:cS,GeometryCollection:oS,Circle:rS};function iS(n,e){return parseInt(_e(n),10)-parseInt(_e(e),10)}function Mf(n,e){const t=g_(n,e);return t*t}function g_(n,e){return nS*n/e}function rS(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,r)}}function nc(n,e,t,i,r,s,o,a){const l=[],c=t.getImage();if(c){let f=!0;const d=c.getImageState();d==re.LOADED||d==re.ERROR?f=!1:d==re.IDLE&&c.load(),f&&l.push(c.ready())}const u=t.getFill();u&&u.loading()&&l.push(u.ready());const h=l.length>0;return h&&Promise.all(l).then(()=>r(null)),sS(n,e,t,i,s,o,a),h}function sS(n,e,t,i,r,s,o){const a=t.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(i,r);if(t.getRenderer())p_(n,l,t,e,o);else{const u=d_[l.getType()];u(n,l,t,e,o,s)}}function p_(n,e,t,i,r){if(e.getType()=="GeometryCollection"){const o=e.getGeometries();for(let a=0,l=o.length;a<l;++a)p_(n,o[a],t,i,r);return}n.getBuilder(t.getZIndex(),"Default").drawCustom(e,i,t.getRenderer(),t.getHitDetectionRenderer(),r)}function oS(n,e,t,i,r,s){const o=e.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a){const c=d_[o[a].getType()];c(n,o[a],t,i,r,s)}}function aS(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 lS(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 cS(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 uS(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()!=re.LOADED)return;const u=n.getBuilder(t.getZIndex(),"Image");u.setImageStyle(o,c),u.drawPoint(e,i,r)}if(l){const u=n.getBuilder(t.getZIndex(),"Text");u.setTextStyle(a,c),u.drawText(e,i,r)}}function hS(n,e,t,i,r,s){const o=t.getImage(),a=o&&o.getOpacity()!==0,l=t.getText(),c=l&&l.getText(),u=s&&a&&c?{}:void 0;if(a){if(o.getImageState()!=re.LOADED)return;const h=n.getBuilder(t.getZIndex(),"Image");h.setImageStyle(o,u),h.drawMultiPoint(e,i,r)}if(c){const h=n.getBuilder(t.getZIndex(),"Text");h.setTextStyle(l,u),h.drawText(e,i,r)}}function fS(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)}}class dS extends Dh{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipExtent_=null,this.extendX_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=Bt(),this.wrappedRenderedExtent_=Bt(),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,u=l.getExtent(),h=this.getLayer().getSource(),f=this.getLayer().getDeclutter(),d=t.pixelRatio,g=t.viewHints,p=!(g[Ke.ANIMATING]||g[Ke.INTERACTING]),m=this.context,y=Math.round(Se(r)/a*d),_=Math.round(ot(r)/a*d),w=h.getWrapX()&&l.canWrapX(),x=w?Se(u):null,v=w?Math.ceil((r[2]-u[2])/x)+(this.extendX_?2:1):1;let T=w?Math.floor((r[0]-u[0])/x)-(this.extendX_?1:0):0;do{let R=this.getRenderTransform(o,a,0,d,y,_,T*x);t.declutter&&(R=R.slice(0)),e.execute(m,[m.canvas.width,m.canvas.height],R,c,p,i===void 0?wr:i?tc:JR,i?f&&t.declutter[f]:void 0)}while(++T<v)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=Ze(this.context.canvas.width,this.context.canvas.height,jm))}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,uo(this.context),jm.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.clipExtent_&&this.clipUnrotated(this.context,e,this.clipExtent_),this.replayGroup_.renderDeferred(),this.clipExtent_&&(this.context.restore(),this.clipExtent_=null),this.resetDrawContext_())}renderFrame(e,t){const i=e.layerStatesArray[e.layerIndex];this.opacity_=i.opacity;const r=e.viewState;this.prepareContainer(e,t);const s=this.context,o=this.replayGroup_;let a=o&&!o.isEmpty();if(!a&&!(this.getLayer().hasListener(Jt.PRERENDER)||this.getLayer().hasListener(Jt.POSTRENDER)))return this.container;this.setDrawContext_(),this.preRender(s,e);const l=r.projection;this.clipExtent_=null;let c=!1;if(a&&i.extent&&this.clipping){const u=Zn(i.extent,l);a=it(u,e.extent),a&&!Un(u,e.extent)&&(e.declutter?this.clipExtent_=u:(this.clipUnrotated(s,e,u),c=!0))}return a&&this.renderWorlds(o,e,this.getLayer().getDeclutter()?!1:void 0),c&&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(),u=[],h=i[0]*Kt,f=i[1]*Kt;u.push(this.getRenderTransform(r,s,o,Kt,h,f,0).slice());const d=c.getSource(),g=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!Un(g,l)){let m=l[0];const y=Se(g);let _=0,w;for(;m<g[0];)--_,w=y*_,u.push(this.getRenderTransform(r,s,o,Kt,h,f,w).slice()),m+=y;for(_=0,m=l[2];m>g[2];)++_,w=y*_,u.push(this.getRenderTransform(r,s,o,Kt,h,f,w).slice()),m-=y}const p=oo();this.hitDetectionImageData_=h_(i,u,this.renderedFeatures_,c.getStyleFunction(),l,s,o,Mf(s,this.renderedPixelRatio_),p?a:null)}t(f_(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,i,r,s){if(!this.replayGroup_)return;const o=t.viewState.resolution,a=t.viewState.rotation,l=this.getLayer(),c={},u=function(f,d,g){const p=_e(f),m=c[p];if(m){if(m!==!0&&g<m.distanceSq){if(g===0)return c[p]=!0,s.splice(s.lastIndexOf(m),1),r(f,l,d);m.geometry=d,m.distanceSq=g}}else{if(g===0)return c[p]=!0,r(f,l,d);s.push(c[p]={feature:f,layer:l,geometry:d,distanceSq:g,callback:r})}},h=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,o,a,i,u,h?t.declutter?.[h]?.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[Ke.ANIMATING],s=e.viewHints[Ke.INTERACTING],o=t.getUpdateWhileAnimating(),a=t.getUpdateWhileInteracting();if(this.ready&&!o&&r||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=e.extent,c=e.viewState,u=c.projection,h=c.resolution,f=e.pixelRatio,d=t.getRevision(),g=t.getRenderBuffer();let p=t.getRenderOrder();p===void 0&&(p=iS);const m=c.center.slice(),y=Xn(l,g*h),_=y.slice(),w=[y.slice()],x=u.getExtent(),v=i.getWrapX()&&u.canWrapX();if(this.extendX_=!1,v){const W=i.getExtent();W&&!Ei(W)&&(this.extendX_=W[0]<x[0]||W[2]>x[2])}if(v&&(!Un(x,e.extent)||this.extendX_)){const W=Se(x),X=Math.max(Se(y)/2,W);let z=x[0],M=x[2];this.extendX_&&(z-=W,M+=W),y[0]=z-X,y[2]=M+X,du(m,u);const ne=Zg(w[0],u);ne[0]<x[0]&&ne[2]<x[2]?w.push([ne[0]+W,ne[1],ne[2]+W,ne[3]]):ne[0]>x[0]&&ne[2]>x[2]&&w.push([ne[0]-W,ne[1],ne[2]-W,ne[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedPixelRatio_===f&&this.renderedRevision_==d&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!e.declutter&&Un(this.wrappedRenderedExtent_,y))return yi(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const T=new i_(g_(h,f),y,h,f),R=oo();let C;if(R){for(let W=0,X=w.length;W<X;++W){const z=w[W],M=Ja(z,u);i.loadFeatures(M,aw(h,u),R)}C=Kr(R,u)}else for(let W=0,X=w.length;W<X;++W)i.loadFeatures(w[W],h,u);const S=Mf(h,f);let L=!0;const B=(W,X)=>{let z;const M=W.getStyleFunction()||t.getStyleFunction();if(M&&(z=M(W,h)),z){const ne=this.renderFeature(W,S,z,T,C,this.getLayer().getDeclutter(),X);L=L&&!ne}},K=Ja(y,u),F=i.getFeaturesInExtent(K);p&&F.sort(p);for(let W=0,X=F.length;W<X;++W)B(F[W],W);this.renderedFeatures_=F,this.ready=L;const P=T.finish(),oe=new u_(y,h,f,i.getOverlaps(),P,t.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=h,this.renderedRevision_=d,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=_,this.wrappedRenderedExtent_=y,this.renderedCenter_=m,this.renderedProjection_=u,this.renderedPixelRatio_=f,this.replayGroup_=oe,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,u=i.length;c<u;++c)l=nc(r,e,i[c],t,this.boundHandleStyleImageChange_,s,o,a)||l;else l=nc(r,e,i,t,this.boundHandleStyleImageChange_,s,o,a);return l}}class ic extends bh{constructor(e){super(e)}createRenderer(){return new dS(this)}}const gS={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},m_={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class pS extends Vm{constructor(e,t){super(e,t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=Gt(),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(),u=c.getTileGridForProjection(o.projection),h=!(l[Ke.ANIMATING]||l[Ke.INTERACTING]),f=u.getZForResolution(a,c.zDirection)===e;return h&&f?s.wantedResolution=a:s.wantedResolution||(s.wantedResolution=u.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.renderedPixelRatio===t&&l.renderedRenderOrder==o)return;const c=r.getSource(),u=!!r.getDeclutter(),h=c.getTileGrid(),d=c.getTileGridForProjection(i).getTileCoordExtent(e.wrappedTileCoord),g=c.getSourceTiles(t,i,e),p=_e(r);delete e.hitDetectionImageData[p],e.executorGroups[p]=[],l.dirty=!1;for(let m=0,y=g.length;m<y;++m){const _=g[m];if(_.getState()!=J.LOADED)continue;const w=c.getProjection(),x=_.tileCoord;let v=h.getTileCoordExtent(x);i&&w&&!bt(i,w)&&(v=Yr(v,w,i,32));const T=cn(d,v),R=Xn(T,r.getRenderBuffer()*a,this.tempExtent),C=$n(v,T)?null:R,S=new i_(0,T,a,t),L=Mf(a,t),B=function(W,X){let z;const M=W.getStyleFunction()||r.getStyleFunction();if(M&&(z=M(W,a)),z){const ne=this.renderFeature(W,L,z,S,u,X);l.dirty=l.dirty||ne}},K=_.getFeatures();o&&o!==l.renderedRenderOrder&&K.sort(o);for(let W=0,X=K.length;W<X;++W){let z=K[W];i&&_.projection&&!bt(i,_.projection)&&(z=z.clone(),z.getGeometry().applyTransform(tr(_.projection,i))),(!C||it(C,z.getGeometry().getExtent()))&&B.call(this,z,W)}const F=S.finish(),P=r.getRenderMode()!=="vector"&&u&&g.length===1?null:T,oe=new u_(P,a,t,c.getOverlaps(),F,r.getRenderBuffer(),!0);e.executorGroups[p].push(oe)}l.renderedRevision=s,l.renderedPixelRatio=t,l.renderedRenderOrder=o,l.renderedResolution=a}forEachFeatureAtCoordinate(e,t,i,r,s){const o=t.viewState.resolution,a=t.viewState.rotation;i=i??0;const l=this.getLayer(),u=l.getSource().getTileGridForProjection(t.viewState.projection),h=l.getRenderBuffer(),f=ou([e]);Xn(f,o*(h+i),f);const d={},g=function(x,v,T){let R=x.getId();R===void 0&&(R=_e(x));const C=d[R];if(C){if(C!==!0&&T<C.distanceSq){if(T===0)return d[R]=!0,s.splice(s.lastIndexOf(C),1),r(x,l,v);C.geometry=v,C.distanceSq=T}}else{if(T===0)return d[R]=!0,r(x,l,v);s.push(d[R]={feature:x,layer:l,geometry:v,distanceSq:T,callback:r})}},p=this.renderedTiles,m=_e(l),y=l.getDeclutter(),_=y?t.declutter?.[y]?.all().map(x=>x.value):null;let w;e:for(let x=p.length-1;x>=0;--x){const v=p[x],T=u.getTileCoordExtent(v.wrappedTileCoord);if(!it(T,f))continue;const R=v.executorGroups[m];for(let C=0,S=R.length;C<S;++C)if(w=R[C].forEachFeatureAtCoordinate(e,o,a,i,g,_),w)break e}return w}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),u=lt(this.renderedPixelToCoordinateTransform_,e.slice()),h=c.getTileCoordForCoordAndResolution(u,l).toString(),f=this.renderedTiles.find(w=>w.tileCoord.toString()===h&&w.getState()===J.LOADED);if(!f||f.loadingSourceTiles>0){t([]);return}s.getWrapX()&&o.canWrapX()&&!Un(a,c.getTileCoordExtent(f.tileCoord))&&du(u,o);const d=_e(r),g=c.getTileCoordExtent(f.wrappedTileCoord),p=Kn(g),m=[(u[0]-p[0])/l,(p[1]-u[1])/l],y=f.getSourceTiles().reduce((w,x)=>w.concat(x.getFeatures()),[]);let _=f.hitDetectionImageData[d];if(!_){const w=Ct(c.getTileSize(c.getZForResolution(l,s.zDirection))),x=this.renderedRotation_,v=[this.getRenderTransform(c.getTileCoordCenter(f.wrappedTileCoord),l,0,Kt,w[0]*Kt,w[1]*Kt,0)];_=h_(w,v,y,r.getStyleFunction(),c.getTileCoordExtent(f.wrappedTileCoord),f.getReplayState(r).renderedResolution,x),f.hitDetectionImageData[d]=_}t(f_(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()!==J.LOADED)return;const c=l.getSourceTiles();for(let u=0,h=c.length;u<h;++u){const f=c[u],d=f.getKey();if(d in a)continue;a[d]=!0;const g=f.tileCoord;if(it(e,s.getTileCoordExtent(g))){const p=f.getFeatures();if(p)for(let m=0,y=p.length;m<y;++m){const _=p[m],w=_.getGeometry();it(e,w.getExtent())&&t.push(_)}}}}),t}handleFontsChanged(){const e=this.getLayer();e.getVisible()&&this.renderedLayerRevision_!==void 0&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}renderDeclutter(e,t){const i=this.context,r=i.globalAlpha;i.globalAlpha=t.opacity;const s=e.viewHints,o=!(s[Ke.ANIMATING]||s[Ke.INTERACTING]),a=[this.context.canvas.width,this.context.canvas.height],l=this.getLayer().getDeclutter(),c=l?e.declutter?.[l]:void 0,u=_e(this.getLayer()),h=this.renderedTiles;for(let f=0,d=h.length;f<d;++f){const g=h[f],p=g.executorGroups[u];if(p)for(let m=p.length-1;m>=0;--m)p[m].execute(this.context,a,this.getTileRenderTransform(g,e),e.viewState.rotation,o,tc,c)}i.globalAlpha=r}renderDeferredInternal(e){const t=this.renderedTiles,i=_e(this.getLayer()),r=t.reduce((l,c,u)=>(c.executorGroups[i].forEach(h=>l.push({executorGroup:h,index:u})),l),[]),s=r.map(({executorGroup:l})=>l.getDeferredZIndexContexts()),o={};for(let l=0,c=r.length;l<c;++l){const u=r[l].executorGroup.getDeferredZIndexContexts();for(const h in u)o[h]=!0}const a=Object.keys(o).map(Number).sort(Tn);this.layerExtent&&this.clipUnrotated(this.context,e,this.layerExtent),a.forEach(l=>{s.forEach((c,u)=>{c[l]&&(c[l].forEach(h=>{const{executorGroup:f,index:d}=r[u],g=f.getRenderedContext(),p=g.globalAlpha;g.globalAlpha=this.renderedOpacity_;const m=this.tileClipContexts_[d];m&&m.draw(g),h.draw(g),m&&g.restore(),g.globalAlpha=p,h.clear()}),c[l].length=0)})}),this.layerExtent&&this.context.restore()}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),u=Math.round(l[1]*i),f=this.getLayer().getSource().getTileGridForProjection(t.viewState.projection),d=e.tileCoord,g=f.getTileCoordExtent(e.wrappedTileCoord),p=f.getTileCoordExtent(d,this.tempExtent)[0]-g[0];return Ru(Iu(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(s,o,a,i,c,u,p))}postRender(e,t){const i=t.viewHints,r=!(i[Ke.ANIMATING]||i[Ke.INTERACTING]);this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.renderedRotation_=t.viewState.rotation,this.renderedOpacity_=t.layerStatesArray[t.layerIndex].opacity;const s=this.getLayer(),o=s.getRenderMode(),a=e.globalAlpha;e.globalAlpha=this.renderedOpacity_;const l=s.getDeclutter(),c=l?m_[o].filter(v=>!tc.includes(v)):m_[o],u=t.viewState,h=u.rotation;this.layerExtent&&this.clipUnrotated(e,t,this.layerExtent);const f=s.getSource(),g=f.getTileGridForProjection(u.projection).getZForResolution(u.resolution,f.zDirection),p=this.renderedTiles,m=[],y=[],_=[],w=_e(s);let x=!0;for(let v=p.length-1;v>=0;--v){const T=p[v];x=x&&!T.getReplayState(s).dirty;const R=T.executorGroups[w].filter(P=>P.hasExecutors(c));if(R.length===0)continue;const C=this.getTileRenderTransform(T,t),S=T.tileCoord[0];let L=!1;const B=R[0].getClipCoords(C);let K=e,F;if(B){F=new Lh,K=F.getContext();for(let P=0,oe=m.length;P<oe;++P)if(g!==S&&S<y[P]){const W=m[P];it([B[0],B[3],B[4],B[7]],[W[0],W[3],W[4],W[7]])&&(L||(K.save(),L=!0),K.beginPath(),K.moveTo(B[0],B[1]),K.lineTo(B[2],B[3]),K.lineTo(B[4],B[5]),K.lineTo(B[6],B[7]),K.moveTo(W[6],W[7]),K.lineTo(W[4],W[5]),K.lineTo(W[2],W[3]),K.lineTo(W[0],W[1]),K.clip())}m.push(B),y.push(S)}for(let P=0,oe=R.length;P<oe;++P)R[P].execute(e,[e.canvas.width,e.canvas.height],C,h,r,c,t.declutter?.[l]);L&&(K===e?K.restore():_[v]=F)}this.layerExtent&&e.restore(),e.globalAlpha=a,this.ready=x,this.tileClipContexts_=_,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=nc(r,e,i[l],t,this.boundHandleStyleImageChange_,void 0,s,o)||a;else a=nc(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[_e(i)];r.renderedTileRevision=s;const a=e.wrappedTileCoord,l=a[0],c=i.getSource();let u=t.pixelRatio;const f=t.viewState.projection,d=c.getTileGridForProjection(f),g=d.getResolution(e.tileCoord[0]),p=t.pixelRatio/e.wantedResolution*g,m=d.getResolution(l),y=e.getContext();u=Math.round(Math.max(u,p/u));const _=c.getTilePixelSize(l,u,f);y.canvas.width=_[0],y.canvas.height=_[1];const w=u/p;if(w!==1){const R=yp(this.tmpTransform_);Iu(R,w,w),y.setTransform.apply(y,R)}const x=d.getTileCoordExtent(a,this.tempExtent),v=p/m,T=yp(this.tmpTransform_);Iu(T,v,-v),uw(T,-x[0],-x[3]);for(let R=0,C=o.length;R<C;++R)o[R].execute(y,[y.canvas.width*w,y.canvas.height*w],T,0,!0,gS[i.getRenderMode()],null);r.renderedTileResolution=e.wantedResolution}}class Jo extends bh{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";Oe(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 pS(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(Pi.PRELOAD)}getUseInterimTilesOnError(){return this.get(Pi.USE_INTERIM_TILES_ON_ERROR)}setPreload(e){this.set(Pi.PRELOAD,e)}setUseInterimTilesOnError(e){this.set(Pi.USE_INTERIM_TILES_ON_ERROR,e)}}function mS(n,e){return[[-1/0,-1/0,1/0,1/0]]}function yS(n,e){return[n]}function _S(n,e,t,i){const r=document.createElement("script"),s="olc_"+_e(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)}class y_ extends Km{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:Le("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)_S(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=Le("EPSG:4326"),i=this.getProjection();let r;if(e.bounds!==void 0){const c=Kr(t,i);r=Yg(e.bounds,c)}const s=Do(i),o=e.minzoom||0,a=e.maxzoom||22,l=El({extent:s,maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=l,this.tileUrlFunction=Um(e.tiles,l),e.attribution&&!this.getAttributions()){const c=r!==void 0?r:s;this.setAttributions(function(u){return it(c,u.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState("ready")}handleTileJSONError(){this.setState("error")}}let xS=!1;function __(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=xS,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const c=e.getType();try{let u;c=="text"||c=="json"?u=a.responseText:c=="xml"?u=a.responseXML||a.responseText:c=="arraybuffer"&&(u=a.response),u?s(e.readFeatures(u,{extent:t,featureProjection:r}),e.readProjection(u)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function x_(n,e){return function(t,i,r,s,o){__(n,e,t,i,r,(a,l)=>{this.addFeatures(a),s!==void 0&&s(a)},()=>{this.changed(),o!==void 0&&o()})}}class v_{constructor(e){this.rbush_=new Zp(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_[_e(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_[_e(a)]=l}this.rbush_.load(i)}remove(e){const t=_e(e),i=this.items_[t];return delete this.items_[t],this.rbush_.remove(i)!==null}update(e,t){const i=this.items_[_e(t)],r=[i.minX,i.minY,i.maxX,i.maxY];$n(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 mi(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const t=this.rbush_.toJSON();return Bn(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]}}const en={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class ji extends an{constructor(e,t,i){super(e),this.feature=t,this.features=i}}class Cs extends ls{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_=Qs,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&&(Oe(this.format_,"`format` must be set when `url` is set"),this.loader_=x_(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:mS;const t=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=t?new v_:null,this.loadedExtentsRtree_=new v_,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 Zt(r)),r!==void 0&&this.addFeaturesInternal(r),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const t=_e(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 ji(en.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof Tt||(this.featureChangeKeys_[e]=[Te(t,de.CHANGE,this.handleFeatureChange_,this),Te(t,Nr.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let i=!0;if(t.getId()!==void 0){const r=String(t.getId());if(!(r in this.idIndex_))this.idIndex_[r]=t;else if(t instanceof Tt){const s=this.idIndex_[r];s instanceof Tt?Array.isArray(s)?s.push(t):this.idIndex_[r]=[s,t]:i=!1}else i=!1}return i&&(Oe(!(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=_e(a);this.addToIndex_(l,a)&&i.push(a)}for(let s=0,o=i.length;s<o;s++){const a=i[s],l=_e(a);this.setupChangeEvents_(l,a);const c=a.getGeometry();if(c){const u=c.getExtent();t.push(u),r.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(en.ADDFEATURE))for(let s=0,o=i.length;s<o;s++)this.dispatchEvent(new ji(en.ADDFEATURE,i[s]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(en.ADDFEATURE,function(i){t||(t=!0,e.push(i.feature),t=!1)}),this.addEventListener(en.REMOVEFEATURE,function(i){t||(t=!0,e.remove(i.feature),t=!1)}),e.addEventListener(Nt.ADD,i=>{t||(t=!0,this.addFeature(i.element),t=!1)}),e.addEventListener(Nt.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(We);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 ji(en.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){const i=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(i,function(r){const s=r.getGeometry();if(s instanceof Tt||s.intersectsCoordinate(e))return t(r)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(i){const r=i.getGeometry();if(r instanceof Tt||r.intersectsExtent(e)){const s=t(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),mi(this.nullGeometryFeatures_)||Rn(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=qg(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||Js,this.featuresRtree_.forEachInExtent(l,function(c){if(t(c)){const u=c.getGeometry(),h=a;if(a=u instanceof Tt?0:u.closestPointXY(i,r,o,a),a<h){s=c;const f=Math.sqrt(a);l[0]=i-f,l[1]=r-f,l[2]=i+f,l[3]=r+f}}}),s}getExtent(e){return this.featuresRtree_?.getExtent(e)??null}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=_e(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 ji(en.CHANGEFEATURE,t))}hasFeature(e){const t=e.getId();return t!==void 0?t in this.idIndex_:_e(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&mi(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];if(!r.forEachInExtent(l,function(u){return Un(u.extent,l)})){this.loading=Number(this.loading)+1,this.dispatchEvent(new ji(en.FEATURESLOADSTART));const u=g=>{this.loading=Number(this.loading)-1,this.dispatchEvent(new ji(en.FEATURESLOADEND,void 0,g))},h=()=>{this.changed(),this.loading=Number(this.loading)-1,this.dispatchEvent(new ji(en.FEATURESLOADERROR))};let f=!1;const d=this.loader_.call(this,l,t,i,g=>f||u(g),()=>f||h());d instanceof Promise?(f=!0,d.then(g=>{this.addFeatures(g),u(g)}).catch(h)):this.loader_.length<4&&(this.loading=!1),r.insert(l,{extent:l.slice()})}}}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const t=this.loadedExtentsRtree_,i=t.forEachInExtent(e,function(r){if($n(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=_e(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(We),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(en.REMOVEFEATURE)&&this.dispatchEvent(new ji(en.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){Oe(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(x_(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}}const w_=[];class vS extends Lo{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_=Ze(1,1,w_)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(e){const t=_e(e);return t in this.replayState_||(this.replayState_[t]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedPixelRatio:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[t]}load(){this.getSourceTiles()}release(){this.context_&&(uo(this.context_),w_.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}let E_=class extends Lo{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==J.IDLE&&(this.setState(J.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(J.ERROR)}setFeatures(e){this.features_=e,this.setState(J.LOADED)}setLoader(e){this.loader_=e}};class Af extends bl{constructor(e){const t=e.projection||"EPSG:3857",i=e.extent||Do(t),r=e.tileGrid||El({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:b_,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:E_,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(e,t,i,r){if(i.getState()===J.IDLE){i.setState(J.LOADING);const s=i.wrappedTileCoord,o=this.getTileGridForProjection(t);let a=o.getTileCoordExtent(s);const l=s[0],c=o.getResolution(l);Xn(a,-c,a);const u=this.projection;t&&this.projection&&!bt(t,u)&&(a=Yr(a,t,u));const h=this.tileGrid,f=h.getExtent();f&&cn(a,f,a);let d=c;t&&u&&!bt(t,u)&&(d=c/u.getMetersPerUnit()/t.getMetersPerUnit());const g=h.getZForResolution(d,this.zDirection),p=r||this.tileUrlFunction;h.forEachTileCoord(a,g,m=>{const y=p(m,e,t);this.sourceTiles_[y]||(this.sourceTiles_[y]=new this.tileClass(m,y?J.IDLE:J.EMPTY,y,this.format_,this.tileLoadFunction));const _=this.sourceTiles_[y];i.sourceTiles.push(_),this.tileKeysBySourceTileUrl_[y]||(this.tileKeysBySourceTileUrl_[y]=[]),this.tileKeysBySourceTileUrl_[y].push(i.getKey());const w=_.getState();if(w<J.LOADED){const x=v=>{this.handleTileChange(v);const T=_.getState();if(T===J.LOADED||T===J.ERROR){const R=_.getKey();R in i.errorTileKeys?_.getState()===J.LOADED&&delete i.errorTileKeys[R]:i.loadingSourceTiles--,T===J.ERROR?i.errorTileKeys[R]=!0:_.removeEventListener(de.CHANGE,x),i.loadingSourceTiles===0&&i.setState(mi(i.errorTileKeys)?J.LOADED:J.ERROR)}};_.addEventListener(de.CHANGE,x),i.loadingSourceTiles++}w===J.IDLE&&(_.extent=h.getTileCoordExtent(m),_.projection=this.projection,_.resolution=h.getResolution(m[0]),_.load())}),i.loadingSourceTiles||i.setState(i.sourceTiles.some(m=>m.getState()===J.ERROR)?J.ERROR:J.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,u=this.getTileGridForProjection(s);if(a&&l){const g=u.getTileCoordExtent(a);Xn(g,-u.getResolution(e),g),it(l,!s||!c||bt(s,c)?g:Yr(g,s,c))||(a=null)}let h=!0;if(a!==null){const g=this.tileGrid,p=u.getResolution(e);let m=p;s&&c&&!bt(s,c)&&(m=p/c.getMetersPerUnit()/s.getMetersPerUnit());const y=g.getZForResolution(m,1),_=u.getTileCoordExtent(a);Xn(_,-p,_),g.forEachTileCoord(!s||!c||bt(s,c)?_:Yr(_,s,c),y,w=>{h=h&&!this.tileUrlFunction(w,r,c)})}const f=this.tileUrlFunction,d=new vS(o,h?J.EMPTY:J.IDLE,a,g=>this.getSourceTiles(r,s,g,f),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&&!bt(r,e))return zh(e);const s=this.tileGrid,o=s.getResolutions().slice(),a=o.map(function(u,h){return s.getOrigin(h)}),l=o.map(function(u,h){return s.getTileSize(h)}),c=Np+1;for(let u=o.length;u<c;++u)o.push(o[u-1]/2),a.push(a[u-1]),l.push(l[u-1]);i=new wl({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=Ct(r.getTileSize(e),this.tmpSize);return[Math.round(s[0]*t),Math.round(s[1]*t)]}setOverlaps(e){this.overlaps_=e,this.changed()}}function b_(n,e){n.setLoader(function(t,i,r){__(e,n.getFormat(),t,i,r,n.onLoad.bind(n),n.onError.bind(n))})}function C_(n,e){const t=e[0].evaluate(n),i=e[1].evaluate(n),r=e[2].evaluate(n),s=e[3]?e[3].evaluate(n):1;return Qe.parse(`hsla(${t}, ${i}%, ${r}%, ${s})`)}function wS(n){const e=n[0]/255,t=n[1]/255,i=n[2]/255,r=n[3],s=Math.max(e,t,i),o=Math.min(e,t,i),a=(s+o)/2;let l,c;if(s===o)l=0,c=0;else{const u=s-o;switch(c=a>.5?u/(2-s-o):u/(s+o),s){case e:l=(t-i)/u+(t<i?6:0);break;case t:l=(i-e)/u+2;break;case i:l=(e-t)/u+4;break;default:l=0}l/=6}return[l*360,c*100,a*100,r]}function rc(n){if(Array.isArray(n)){if(n.length===0)return n;const e=n[0];if(e==="literal")return n;if(e==="image"&&n.length===3&&typeof n[2]=="object"&&n[2]!==null&&!Array.isArray(n[2]))return["image-config",rc(n[1]),["literal",n[2]]];const t=n.length;for(let i=1;i<t;++i){const r=n[i],s=rc(r);if(s!==r){const o=[e];for(let a=1;a<i;++a)o.push(n[a]);o.push(s);for(let a=i+1;a<t;++a)o.push(rc(n[a]));return o}}}return n}const Pf={},Ft={zoom:0,distanceFromCenter:0};Di.register(Gl,{...Di.definitions,pitch:[{kind:"number"},[],n=>Ft.pitch||0],"distance-from-center":[{kind:"number"},[],n=>Ft.distanceFromCenter||0],"to-hsla":[{kind:"array",itemType:{kind:"number"},N:4},[{kind:"string"}],(n,[e])=>wS(ul(e.evaluate(n)))],hsl:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"}],C_],hsla:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"},{kind:"number"}],C_],"image-config":[{kind:"value"},[{kind:"string"},{kind:"value"}],(n,[e,t])=>e.evaluate(n)],"measure-light":[{kind:"number"},[{kind:"value"}],()=>1],config:[{kind:"value"},[{kind:"string"}],(n,[e])=>{const t=Pf[e.evaluate(n)];return t===void 0?{}:t}]});const T_="https://api.mapbox.com";function Ff(n){const e="mapbox://";return n.indexOf(e)!==0?"":n.slice(e.length)}function ES(n,e,t){if(typeof n=="string")return[{id:"default",url:R_(n,e,t)}];for(const i of n)i.url=R_(i.url,e,t);return n}function R_(n,e,t){const i=Ff(n);if(!e||!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`${T_}/styles/v1/${s}/sprite?access_token=${e}`}function sc(n,e){const t=Ff(n);if(!t||!e)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`${T_}/styles/v1/${r}?&access_token=${e}`}const bS=["a","b","c","d"];function oc(n,e,t,i){const r=new URL(n,i||location.href),s=Ff(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 bS.map(o=>`https://${o}.tiles.mapbox.com/v4/${s}/{z}/{x}/{y}.vector.pbf?access_token=${e}`)}class CS extends Dh{constructor(e){super(e),this.image=null,this.renderedSourceRevision_=0}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=cn(l,Zn(t.extent,r.projection))),!a[Ke.ANIMATING]&&!a[Ke.INTERACTING]&&!Ei(l))if(o){!this.getLayer().rendered&&this.renderedSourceRevision_!==o.getRevision()&&(this.image=null),this.renderedSourceRevision_=o.getRevision();const c=r.projection,u=o.getImage(l,s,i,c);u&&(this.loadImage(u)?this.image=u:u.getState()===re.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=lt(t.pixelToCoordinateTransform,e.slice()),s=i.getExtent();if(s&&!Ji(s,r))return null;const o=this.image.getExtent(),a=this.image.getImage(),l=Se(o),c=Math.floor(a.width*((r[0]-o[0])/l));if(c<0||c>=a.width)return null;const u=ot(o),h=Math.floor(a.height*((o[3]-r[1])/u));return h<0||h>=a.height?null:this.getImageData(a,c,h)}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],u=e.pixelRatio,h=e.viewState,f=h.center,d=h.resolution,g=u*o/(d*l),p=u*a/(d*l);this.prepareContainer(e,t);const m=this.context.canvas.width,y=this.context.canvas.height,_=this.getRenderContext(e);let w=!1,x=!0;if(c.extent){const S=Zn(c.extent,h.projection);x=it(S,e.extent),w=x&&!Un(S,e.extent),w&&this.clipUnrotated(_,e,S)}const v=i.getImage(),T=In(this.tempTransform,m/2,y/2,g,p,0,l*(r[0]-f[0])/o,l*(f[1]-r[3])/a);this.renderedResolution=a*u/l;const R=v.width*T[0],C=v.height*T[3];if(this.getLayer().getSource().getInterpolate()||(_.imageSmoothingEnabled=!1),this.preRender(_,e),x&&R>=.5&&C>=.5){const S=T[4],L=T[5],B=c.opacity;B!==1&&(_.save(),_.globalAlpha=B),_.drawImage(v,0,0,+v.width,+v.height,S,L,R,C),B!==1&&_.restore()}return this.postRender(this.context,e),w&&_.restore(),_.imageSmoothingEnabled=!0,this.container}}class TS extends qr{constructor(e){e=e||{},super(e)}}class Of extends TS{constructor(e){super(e)}createRenderer(){return new CS(this)}getData(e){return super.getData(e)}}class RS extends mh{constructor(e,t,i,r,s){const o=s!==void 0?re.IDLE:re.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=re.ERROR):this.state=re.LOADED,this.changed()}load(){this.state==re.IDLE&&(this.state=re.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}function Lf(n){return Array.isArray(n)?Math.min(...n):n}class SS extends mh{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 u=c?cn(i,c):i,h=zt(u),f=Oh(e,t,h,r),d=Nm,g=new km(e,t,u,l,f*d,r),p=g.calculateSourceExtent(),m=Ei(p)?null:o(p,f,s),y=m?re.IDLE:re.EMPTY,_=m?m.getPixelRatio():1;super(i,r,_,y),this.targetProj_=t,this.maxSourceExtent_=l,this.triangulation_=g,this.targetResolution_=r,this.targetExtent_=i,this.sourceImage_=m,this.sourcePixelRatio_=_,this.interpolate_=a,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==re.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const e=this.sourceImage_.getState();if(e==re.LOADED){const t=Se(this.targetExtent_)/this.targetResolution_,i=ot(this.targetExtent_)/this.targetResolution_;this.canvas_=Lm(t,i,this.sourcePixelRatio_,Lf(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==re.IDLE){this.state=re.LOADING,this.changed();const e=this.sourceImage_.getState();e==re.LOADED||e==re.ERROR?this.reproject_():(this.sourceListenerKey_=Te(this.sourceImage_,de.CHANGE,t=>{const i=this.sourceImage_.getState();(i==re.LOADED||i==re.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){We(this.sourceListenerKey_),this.sourceListenerKey_=null}}const ac=4,Df={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class IS extends an{constructor(e,t){super(e),this.image=t}}class S_ extends ls{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=Da(t,e,0);e=t[i]}return e}getImage(e,t,i,r){const s=this.getProjection();if(!s||!r||bt(s,r))return s&&(r=s),this.getImageInternal(e,t,i,r);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&bt(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==t&&$n(this.reprojectedImage_.getExtent(),e))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new SS(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=MS(e,t,i,1),o=this.findNearestResolution(t);if(this.image&&(this.static_||this.wantedProjection_===r&&(this.wantedExtent_&&Un(this.wantedExtent_,s)||Un(this.image.getExtent(),s))&&(this.wantedResolution_&&Lf(this.wantedResolution_)===o||Lf(this.image.getResolution())===o)))return this.image;this.wantedProjection_=r,this.wantedExtent_=s,this.wantedResolution_=o,this.image=new mh(s,o,i,this.loader),this.image.addEventListener(de.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(e){const t=e.target;let i;switch(t.getState()){case re.LOADING:this.loading=!0,i=Df.IMAGELOADSTART;break;case re.LOADED:this.loading=!1,i=Df.IMAGELOADEND;break;case re.ERROR:this.loading=!1,i=Df.IMAGELOADERROR;break;default:return}this.hasListener(i)&&this.dispatchEvent(new IS(i,t))}}function MS(n,e,t,i){const r=e/t,s=zt(n),o=wi(Se(n)/r,ac),a=wi(ot(n)/r,ac),l=wi((i-1)*o/2,ac),c=o+2*l,u=wi((i-1)*a/2,ac),h=a+2*u;return Xa(s,r,0,[c,h])}function I_(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 f=new Array(a);for(let g=0;g<a;++g)f[g]=new ImageData(new Uint8ClampedArray(t[g]),s,o);return n(f,i).data.buffer}const c=new Uint8ClampedArray(l),u=new Array(a),h=new Array(a);for(let f=0;f<a;++f)u[f]=new Uint8ClampedArray(t[f]),h[f]=[0,0,0,0];for(let f=0;f<l;f+=4){for(let g=0;g<a;++g){const p=u[g];h[g][0]=p[f],h[g][1]=p[f+1],h[g][2]=p[f+2],h[g][3]=p[f+3]}const d=n(h,i);c[f]=d[0],c[f+1]=d[1],c[f+2]=d[2],c[f+3]=d[3]}return c.buffer}}function AS(n,e){const i=Object.keys(n.lib||{}).map(function(s){return"const "+s+" = "+n.lib[s].toString()+";"}).concat(["const __minion__ = ("+I_.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(`
11
+ `),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",e),r}function PS(n,e){const t=I_(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 FS extends Hs{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]=AS(e,this.onWorkerMessage_.bind(this,r));else i[0]=PS(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,u=[];for(let h=0,f=r.length;h<f;++h)u.push(r[h].slice(c,c+a));this.workers_[l].postMessage({buffers:u,meta:e.meta,imageOps:this.imageOps_,width:t,height:i},u)}}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 M_={BEFOREOPERATIONS:"beforeoperations",AFTEROPERATIONS:"afteroperations"};class A_ extends an{constructor(e,t,i){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=i}}class kf extends S_{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_=DS(e.sources);const t=this.changed.bind(this);for(let i=0,r=this.layers_.length;i<r;++i)this.layers_[i].addEventListener(de.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new jg(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:Gt(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:LS(this.layers_),pixelRatio:1,pixelToCoordinateTransform:Gt(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:_e(this),renderTargets:{}},this.setAttributions(function(i){const r=[];for(let s=0,o=e.sources.length;s<o;++s){const a=e.sources[s],l=a instanceof ls?a:a.getSource();if(!l)continue;const c=l.getAttributions()?.(i);typeof c=="string"?r.push(c):c!==void 0&&r.push(...c)}return r}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new FS({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=zt(e);r.size[0]=Math.ceil(Se(e)/t),r.size[1]=Math.ceil(ot(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||!$n(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=OS(this.layers_[s],e);if(o)i[s]=o;else return}const r={};this.dispatchEvent(new A_(M_.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||!$n(s,this.requestedFrameState_.extent))return;let a;if(this.renderedImageCanvas_)a=this.renderedImageCanvas_.getImage().getContext("2d");else{const l=Math.round(Se(s)/o),c=Math.round(ot(s)/o);a=Ze(l,c),this.renderedImageCanvas_=new RS(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_(M_.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()}}kf.prototype.dispose;let Er=null;function OS(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(!Er)Er=Ze(i,r,void 0,{willReadFrequently:!0});else{const a=Er.canvas;a.width!==i||a.height!==r?Er=Ze(i,r,void 0,{willReadFrequently:!0}):Er.clearRect(0,0,i,r)}return Er.drawImage(o,0,0,i,r),Er.getImageData(0,0,i,r)}function LS(n){return n.map(function(e){return e.getLayerState()})}function DS(n){const e=n.length,t=new Array(e);for(let i=0;i<e;++i)t[i]=kS(n[i]);return t}function kS(n){let e;return n instanceof ls?n instanceof $m?e=new Nh({source:n}):n instanceof S_&&(e=new Of({source:n})):e=n,e}function NS(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,u=[0,0,0,0],h=Math.PI,f=e.encoding,d=e.exaggeration,g=e.zoom,p=e.method||"standard",m=e.accentColor,y=e.shadowColors||[e.shadowColor],_=e.highlightColors||[e.highlightColor],x=(e.azimuths||[e.sunAz]).map(ie=>ie*h/180),T=(e.altitudes||[45]).map(ie=>ie*h/180),R=Math.min(x.length,T.length,y.length,_.length,4),C=g<2?.4:g<4.5?.35:.3,S=g<15?Math.pow(2,(15-g)*C):1;function L(ie,k="mapbox"){return k==="mapbox"?(ie[0]*256*256+ie[1]*256+ie[2])*.1-1e4:k==="terrarium"?ie[0]*256+ie[1]+ie[2]/256-32768:0}function B(ie,k){return ie!==0?Math.atan2(k,-ie):h/2*(k>0?1:-1)}function K(ie,k){const He=x[0]+h,E=Math.atan(.625*Math.sqrt(ie*ie+k*k)),b=B(ie,k),I=1.875-d*1.75,D=.5*h,A=d!==.5?(Math.pow(I,E)-1)/(Math.pow(I,D)-1)*D:E,O=Math.cos(A),V=Math.min(Math.max(d*2,0),1),U=(1-O)*V,$=m,N=$.r*U,ee=$.g*U,Q=$.b*U,Y=$.a*U;let Z=(b+He)/h+.5;Z=Z%2,Z<0&&(Z+=2);const q=Math.abs(Z-1),ae=Math.sin(A)*V,ce=y[0],se=_[0],fe=(ce.r*(1-q)+se.r*q)*ae,Me=(ce.g*(1-q)+se.g*q)*ae,Fe=(ce.b*(1-q)+se.b*q)*ae,$e=(ce.a*(1-q)+se.a*q)*ae;return[N*(1-$e)+fe,ee*(1-$e)+Me,Q*(1-$e)+Fe,Y*(1-$e)+$e]}function F(ie,k){ie*=d*2,k*=d*2;const He=B(ie,k),E=x[0]+h,b=Math.atan(Math.sqrt(ie*ie+k*k))*(2/h);let I=(He+E)/h+.5;I=I%2,I<0&&(I+=2);const D=1-Math.abs(I-1),A=b*D,O=b*(1-D),V=y[0],U=_[0];return[V.r*A+U.r*O,V.g*A+U.g*O,V.b*A+U.b*O,V.a*A+U.a*O]}function P(ie,k){ie*=d*2,k*=d*2;const He=x[0]+h,E=Math.cos(He),b=Math.sin(He),I=Math.cos(T[0]),A=(Math.sin(T[0])-(k*E*I-ie*b*I))/Math.sqrt(1+ie*ie+k*k),O=Math.max(0,Math.min(1,A));if(O>.5){const $=2*O-1,N=_[0];return[N.r*$,N.g*$,N.b*$,N.a*$]}const V=1-2*O,U=y[0];return[U.r*V,U.g*V,U.b*V,U.a*V]}function oe(ie,k){ie*=d*2,k*=d*2;const He=x[0]+h,E=Math.cos(He),b=Math.sin(He),I=Math.cos(T[0]),D=Math.sin(T[0]);let A=Math.acos((D-(k*E*I-ie*b*I))/Math.sqrt(1+ie*ie+k*k));A=Math.max(0,Math.min(h/2,A));const O=Math.atan(Math.sqrt(ie*ie+k*k))*(4/h/h),V=A*O,U=(h/2-A)*O,$=y[0],N=_[0];return[$.r*V+N.r*U,$.g*V+N.g*U,$.b*V+N.b*U,$.a*V+N.a*U]}function W(ie,k){ie*=d*2,k*=d*2;const He=ie*ie+k*k,E=Math.sqrt(1+He);let b=0,I=0,D=0,A=0;for(let O=0;O<R;O++){const V=Math.cos(T[O]),U=Math.sin(T[O]),$=-Math.cos(x[O]),N=-Math.sin(x[O]),ee=(U-(k*$*V-ie*N*V))/E,Q=Math.max(0,Math.min(1,ee)),Y=y[Math.min(O,y.length-1)],Z=_[Math.min(O,_.length-1)];if(Q>.5){const q=(2*Q-1)/R;b+=Z.r*q,I+=Z.g*q,D+=Z.b*q,A+=Z.a*q}else{const q=(1-2*Q)/R;b+=Y.r*q,I+=Y.g*q,D+=Y.b*q,A+=Y.a*q}}return[b,I,D,A]}const X=p==="igor"?F:p==="basic"?P:p==="combined"?oe:p==="multidirectional"?W:K;let z,M,ne,le,ge,ze,G,xe,he,Ie,Pe;for(M=0;M<=c;++M)for(ge=M===0?0:M-1,ze=M===c?c:M+1,z=0;z<=l;++z){ne=z===0?0:z-1,le=z===l?l:z+1,G=(M*i+ne)*4,u[0]=s[G],u[1]=s[G+1],u[2]=s[G+2],u[3]=s[G+3],xe=L(u,f),G=(M*i+le)*4,u[0]=s[G],u[1]=s[G+1],u[2]=s[G+2],u[3]=s[G+3],he=L(u,f),Ie=(he-xe)/a*S,G=(ge*i+z)*4,u[0]=s[G],u[1]=s[G+1],u[2]=s[G+2],u[3]=s[G+3],xe=L(u,f),G=(ze*i+z)*4,u[0]=s[G],u[1]=s[G+1],u[2]=s[G+2],u[3]=s[G+3],he=L(u,f),Pe=(he-xe)/a*S;const ie=X(Ie,Pe),k=ie[3];G=(M*i+z)*4,k>0&&(o[G]=ie[0]/k*255,o[G+1]=ie[1]/k*255,o[G+2]=ie[2]/k*255),o[G+3]=k*255}return new ImageData(o,i,r)}function zS(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 u,h,f;function d(C){return C>0?1/(1-C):1+C}function g(C){return C>0?1-1/(1.001-C):-C}function p(C){C*=Math.PI/180;const S=Math.sin(C),L=Math.cos(C);return[(2*L+1)/3,(-Math.sqrt(3)*S-L+1)/3,(Math.sqrt(3)*S-L+1)/3]}const m=g(e.saturation),y=d(e.contrast),_=p(e.hueRotate),w=_,x=[_[2],_[0],_[1]],v=[_[1],_[2],_[0]],T=e.brightnessLow,R=e.brightnessHigh;for(h=0;h<=l;++h)for(u=0;u<=a;++u){f=(h*i+u)*4,c[0]=s[f],c[1]=s[f+1],c[2]=s[f+2],c[3]=s[f+3];const C=c[0],S=c[1],L=c[2],B=(W,X)=>{let z=0;for(let M=0;M<W.length;M++)z+=W[M]*X[M];return z};let K=B([C,S,L],w),F=B([C,S,L],x),P=B([C,S,L],v);const oe=(K+F+P)/3;K+=(oe-K)*m,F+=(oe-F)*m,P+=(oe-P)*m,K=(K-127.5)*y+127.5,F=(F-127.5)*y+127.5,P=(P-127.5)*y+127.5,K=T*(255-K)+R*K,F=T*(255-F)+R*F,P=T*(255-P)+R*P,o[f]=K,o[f+1]=F,o[f+2]=P,o[f+3]=c[3]}return new ImageData(o,i,r)}var P_={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},Qo=" ",F_=/(italic|oblique)$/i,O_={};function Nf(n,e,t){var i=O_[n];if(!i){Array.isArray(n)||(n=[n]);for(var r=400,s="normal",o=[],a,l,c=0,u=n.length;c<u;++c){var h=n[c],f=h.split(" "),d=f[f.length-1].toLowerCase();d=="normal"||d=="italic"||d=="oblique"?(s=l?s:d,l=!0,f.pop(),d=f[f.length-1].toLowerCase()):F_.test(d)&&(d=d.replace(F_,""),s=l?s:f[f.length-1].replace(d,""),l=!0);for(var g in P_){var p=f.length>1?f[f.length-2].toLowerCase():"";if(d==g||d==g.replace("-","")||p+"-"+d==g){r=a?r:P_[g],f.pop(),p&&g.startsWith(p)&&f.pop();break}}!a&&typeof d=="number"&&(r=d,a=!0);var m=f.join(Qo).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");m.indexOf(Qo)!==-1&&(m='"'+m+'"'),o.push(m)}i=O_[n]=[s,r,o]}return i[0]+Qo+i[1]+Qo+e+"px"+(t?"/"+t:"")+Qo+i[2]}const at=Object.freeze({}),L_={},D_={};let GS=0;function zf(n){return n.id||(n.id=GS++),n.id}function jS(n,e){return zf(n)+"."+_e(e)}function Gf(n){let e=L_[n.id];return e||(e={},L_[zf(n)]=e),e}function WS(n){let e=D_[n.id];return e||(e={},D_[zf(n)]=e),e}function jf(n){return n*Math.PI/180}const gn=(function(){const n=[];for(let e=78271.51696402048;n.length<=24;e/=2)n.push(e);return n})();function lc(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 cc(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 ea(n,e){const t=Math.floor(n),i=Math.pow(2,n-t);return e[t]/i}const Ts={};function Rs(n,e,t={},i){if(e in Ts)return i&&(i.url=Ts[e][0].url),Ts[e][1];const r=t.transformRequest&&t.transformRequest(e,n)||e,s=function(l){return delete Ts[e],Promise.reject(new Error("Error fetching source "+e))},o=function(l){return delete Ts[e],l.ok?l.json():Promise.reject(new Error("Error fetching source "+e))},a=zr(()=>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 Ts[e]=[r,a],a}function k_(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=sc(n,e.accessToken),Rs("Style",n,e);else return Promise.resolve(n)}const N_={};function z_(n,e,t={}){const i=[e,JSON.stringify(n)].toString();let r=N_[i];if(!r||t.transformRequest){let s;t.transformRequest&&(s=(a,l)=>{const c=t.transformRequest&&t.transformRequest(l,"Tiles")||l;if(a instanceof E_)a.setLoader((u,h,f)=>{const d=function(g){g.arrayBuffer().then(p=>{const y=a.getFormat().readFeatures(p,{extent:u,featureProjection:f});a.setFeatures(y)})};zr(()=>c).then(g=>{if(g instanceof Response)return d(g);fetch(g).then(d).catch(p=>a.setState(J.ERROR))}).catch(g=>a.setState(J.ERROR))});else{const u=a.getImage();zr(()=>c).then(h=>{if(typeof h=="string"){u.src=h;return}const f=d=>d.blob().then(g=>{const p=URL.createObjectURL(g);u.addEventListener("load",()=>URL.revokeObjectURL(p)),u.addEventListener("error",()=>URL.revokeObjectURL(p)),u.src=p});if(h instanceof Response)return f(h);fetch(h).then(f).catch(d=>a.setState(J.ERROR))}).catch(h=>a.setState(J.ERROR))}});const o=n.url;if(o&&!n.tiles){const a=oc(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=Rs("Source",a[0],t,l).then(function(c){return c.tiles=c.tiles.map(function(u){return c.scheme==="tms"&&(u=u.replace("{y}","{-y}")),oc(u,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}")),oc(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`"));N_[i]=r}return r}function G_(n,e,t,i){const r=[2*t*e.pixelRatio+e.width,2*t*e.pixelRatio+e.height],s=lc(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,u=a.width;c<u;++c)for(let h=0,f=a.height;h<f;++h){const d=(h*u+c)*4;l[d+3]>0&&o.arc(c,h,t*e.pixelRatio,0,2*Math.PI)}return o.fill(),s}function VS(n,e,t){const i=Math.max(0,Math.min(1,(t-n)/(e-n)));return i*i*(3-2*i)}function j_(n,e,t){const i=lc(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,u=s.height;c<u;++c){const h=(c*l+a)*4,f=o[h+3]/255,d=.75,g=.1,p=VS(d-g,d+g,f);p>0?(o[h+0]=Math.round(255*t.r*p),o[h+1]=Math.round(255*t.g*p),o[h+2]=Math.round(255*t.b*p),o[h+3]=Math.round(255*p)):o[h+3]=0}return r.putImageData(s,0,0),i}const XS=Array(256).join(" ");function Wf(n,e){if(e>=.05){let t="";const i=n.split(`
12
12
  `),r=XS.slice(0,Math.round(e/.1));for(let s=0,o=i.length;s<o;++s)s>0&&(t+=`
13
- `),t+=i[s].split("").join(r);return t}return n}let Vf;function W_(){return Vf||(Vf=lc(1,1).getContext("2d")),Vf}function US(n,e){if(/\d+ \d+/.test(n)){const[t,i]=n.split(" ").map(Number);return t<=e&&e<=i}return n==e}function Er(n,e){return W_().measureText(n).width+(n.length-1)*e}const uc={};ur.on("propertychange",()=>{for(const n in uc)delete uc[n]});function Xf(n,e,t,i){if(n.indexOf(`
13
+ `),t+=i[s].split("").join(r);return t}return n}let Vf;function W_(){return Vf||(Vf=lc(1,1).getContext("2d")),Vf}function US(n,e){if(/\d+ \d+/.test(n)){const[t,i]=n.split(" ").map(Number);return t<=e&&e<=i}return n==e}function br(n,e){return W_().measureText(n).width+(n.length-1)*e}const uc={};hr.on("propertychange",()=>{for(const n in uc)delete uc[n]});function Xf(n,e,t,i){if(n.indexOf(`
14
14
  `)!==-1){const o=n.split(`
15
15
  `),a=[];for(let l=0,c=o.length;l<c;++l)a.push(Xf(o[l],e,t,i));return a.join(`
16
- `)}const r=t+","+e+","+n+","+i;let s=uc[r];if(!s){const o=n.split(" ");if(o.length>1){const a=W_();a.font=e;const c=a.measureText("M").width*t;let u="";const h=[];for(let f=0,d=o.length;f<d;++f){const g=o[f],p=u+(u?" ":"")+g;Er(p,i)<=c?u=p:(u&&h.push(u),u=g)}u&&h.push(u);for(let f=0,d=h.length;f<d&&d>1;++f){const g=h[f];if(Er(g,i)<c*.35){const p=f>0?Er(h[f-1],i):1/0,m=f<d-1?Er(h[f+1],i):1/0;h.splice(f,1),d-=1,p<m?(h[f-1]+=" "+g,f-=1):h[f]=g+" "+h[f]}}for(let f=0,d=h.length-1;f<d;++f){const g=h[f],p=h[f+1];if(Er(g,i)>c*.7&&Er(p,i)<c*.6){const m=g.split(" "),y=m.pop();Er(y,i)<c*.2&&(h[f]=m.join(" "),h[f+1]=y+" "+p),d-=1}}s=h.join(`
17
- `)}else s=n;s=Wf(s,i),uc[r]=s}return s}const BS=["Arial","Courier New","Times New Roman","Verdana","sans-serif","serif","monospace","cursive","fantasy"],V_={};function $S(n,e="https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css"){if(vt)return n;let t;for(let i=0,r=n.length;i<r;++i){const s=n[i];if(s in V_)continue;V_[s]=!0;const a=Nf(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(BS.includes(o))continue;const a=s[1],l=s[2];if(!(await document.fonts.load(`${l} ${a} 16px "${o}"`)).some(u=>u.family.replace(/^['"]|['"]$/g,"").toLowerCase()===o.toLowerCase()&&US(u.weight,a)&&u.style===l)){const u=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="'+u+'"]')){const h=document.createElement("link");h.href=u,h.rel="stylesheet",document.head.appendChild(h)}}}})(),n}const KS={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},YS={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]},X_=function(n,e){let t=Ny(n,e);if(t.result==="error"){const i=rc(n);i!==n&&(t=Ny(i,e))}if(t.result==="error"){const i=t.value[0];return console.error("Error parsing expression:",n,i.key,i.message),{evaluate:()=>e.default}}return t.value};let hc,Uf;function te(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]||at)[t];const c=Uy[`${e}_${n.type}`]&&Uy[`${e}_${n.type}`][t];l===void 0&&c&&(l=c.default);let u=Vl(l);if(!u&&Wl(l)&&(l=Vy(l,c),u=!0),u){const h=X_(l,c);a[t]=h.evaluate.bind(h)}else{const h=c?c.type:typeof l;(h==="color"||h==="colorArray")&&(l=Qe.parse(l));let f=!1;if(h==="array")for(let d=0;d<l.length;++d){const g=l[d];if(Vl(g)||Wl(g)){f=!0;break}}if(f){const d=Object.assign({},c,{type:c.value}),g=[];for(let p=0;p<l.length;++p){let m=l[p];if(!Vl(m)&&Wl(m)&&(m=Vy(m,d)),Vl(m)){const y=X_(m,d);g.push(y.evaluate.bind(y))}else g.push(function(){return m})}a[t]=function(p,m,y){const _=[];for(let v=0;v<g.length;++v)_[v]=g[v](p,m,y);return _}}else a[t]=function(){return l}}}return a[t](Ft,i,s)}function U_(n,e,t,i){return te(n,"layout",`${t}-allow-overlap`,e,i)?te(n,"layout",`${t}-ignore-placement`,e,i)?"none":"obstacle":"declutter"}function ZS(n,e,t,i){if(i||console.warn("No filterCache provided to evaluateFilter()"),!(n in i))try{i[n]=BT(e).filter}catch(r){console.warn("Filter will evaluate to false: "+r.message),i[n]=function(){return!1}}return i[n](Ft,t)}function ji(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 qS=/\{[^{}}]*\}/g;function Bf(n,e){return n.replace(qS,function(t){return e[t.slice(1,-1)]||""})}function B_(n,e){let t=n.split(":")[0];return t===n&&(t="default"),e[t]}const HS={};function JS(n,e,t,i=dn,r=void 0,s=void 0,o=void 0,a=void 0){if(typeof e=="string"&&(e=JSON.parse(e)),e.schema)for(const v in e.schema){const x=e.schema[v];"default"in x&&(Pf[v]=x.default)}if(e.version!=8)throw new Error("glStyle version 8 required.");HS[jS(e,n)]=Array.from(arguments);const l={};(typeof s=="string"||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const v in s){const x=s[v];Nr(()=>x).then(async w=>{let T;if(typeof Image<"u"){const R=new Image;if(typeof w=="string")R.crossOrigin="anonymous",R.src=w;else{let C;w instanceof Request?C=await fetch(w):w instanceof Response&&(C=w);const S=await C.blob();T=URL.createObjectURL(S),R.src=T}R.addEventListener("load",function C(){R.removeEventListener("load",C),l[v]={image:R,size:[R.width,R.height]},n.changed(),T&&URL.revokeObjectURL(T)}),R.addEventListener("error",function C(){URL.revokeObjectURL(T),R.removeEventListener("error",C)})}else if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){const R=self;R.postMessage({action:"loadImage",src:w}),R.addEventListener("message",function(S){S.data.action==="imageLoaded"&&S.data.src===w&&(l[v]={image:S.data.image,size:[S.data.image.width,S.data.image.height]})})}})}const c=Ym(e.layers),u={},h=[],f={},d={},g=Gf(e),p=WS(e);let m;for(let v=0,x=c.length;v<x;++v){const w=c[v],T=w.id;if(typeof t=="string"&&w.source==t||Array.isArray(t)&&t.indexOf(T)!==-1){const R=w["source-layer"];if(m){if(w.source!==m)throw new Error(`Layer "${T}" does not use source "${m}`)}else{m=w.source;const S=e.sources[m];if(!S)throw new Error(`Source "${m}" is not defined`);const L=S.type;if(L!=="vector"&&L!=="geojson")throw new Error(`Source "${m}" is not of type "vector" or "geojson", but "${L}"`)}let C=u[R];C||(C=[],u[R]=C),C.push({layer:w,index:v}),h.push(T)}}const y=[],_=function(v,x,w){const T=n.getSource?.()?.format_?.layerName_??"mvt:layer",R=v.getProperties(),C=u[R[T]];if(!C)return;let S=i.indexOf(x);S==-1&&(S=cc(x,i)),Ft.zoom=S,Ft.distanceFromCenter=0;const L=v.getGeometry(),B=KS[L.getType()],K=n.get("map");if(K&&K instanceof is&&B===1){const W=K.getSize();if(W){const X=K.getView().getCenter(),z=zt(L.getExtent());Ft.distanceFromCenter=Rv(X,z)/x/W[1]}}const F={id:v.getId(),properties:R,type:B},P=n.get("mapbox-featurestate")[v.getId()];let oe=-1;for(let W=0,X=C.length;W<X;++W){const z=C[W],M=z.layer,ne=M.id;if(w!==void 0&&w!==ne)continue;const le=M.layout||at,ge=M.paint||at;if(te(M,"layout","visibility",F,g,P)==="none"||"minzoom"in M&&S<M.minzoom||"maxzoom"in M&&S>=M.maxzoom)continue;const G=M.filter;if(!G||ZS(ne,G,F,p)){let xe,he,Ie,Pe,ie,k;const He=z.index;if(B==3&&(M.type=="fill"||M.type=="fill-extrusion")){if(he=te(M,"paint",M.type+"-opacity",F,g,P),M.type+"-pattern"in ge){const Y=te(M,"paint",M.type+"-pattern",F,g,P);if(Y){const Z=typeof Y=="string"?Bf(Y,R):Y.toString(),q=B_(Z,l);if(r&&r[Z]&&q){++oe,k=y[oe],(!k||!k.getFill()||k.getStroke()||k.getText())&&(k=new At({fill:new Qt}),y[oe]=k),Ie=k.getFill(),k.setZIndex(He);const ae=Z+"."+he;let ce=d[ae];if(!ce){const se=r[Z],fe=lc(se.width,se.height),Me=fe.getContext("2d");Me.globalAlpha=he,Me.drawImage(q.image,se.x,se.y,se.width,se.height,0,0,se.width,se.height),ce=Me.createPattern(fe,"repeat"),d[ae]=ce}Ie.setColor(ce)}}}else if(xe=ji(te(M,"paint",M.type+"-color",F,g,P),he),M.type+"-outline-color"in ge&&(ie=ji(te(M,"paint",M.type+"-outline-color",F,g,P),he)),ie||(ie=xe),xe||ie){if(++oe,k=y[oe],(!k||xe&&!k.getFill()||!xe&&k.getFill()||ie&&!k.getStroke()||!ie&&k.getStroke()||k.getText())&&(k=new At({fill:xe?new Qt:void 0,stroke:ie?new Qn:void 0}),y[oe]=k),xe&&(Ie=k.getFill(),Ie.setColor(xe)),M.type==="fill-extrusion"){const Y=te(M,"paint","fill-extrusion-height",F,g,P);if(Y>0){const Z=Math.max(.1,.9-Math.min(Y,225)/280);if(ie&&ie!=="transparent"){const q=Qe.parse(ie);ie=`rgba(${Math.round(q.r*255*Z)},${Math.round(q.g*255*Z)},${Math.round(q.b*255*Z)},${q.a})`}}}ie&&(Pe=k.getStroke(),Pe.setColor(ie),Pe.setWidth(.5)),k.setZIndex(He)}}if(B!=1&&M.type=="line"){"line-pattern"in ge?xe=void 0:xe=ji(te(M,"paint","line-color",F,g,P),te(M,"paint","line-opacity",F,g,P));const Y=te(M,"paint","line-width",F,g,P);xe&&Y>0&&(++oe,k=y[oe],(!k||!k.getStroke()||k.getFill()||k.getText())&&(k=new At({stroke:new Qn}),y[oe]=k),Pe=k.getStroke(),Pe.setLineCap(te(M,"layout","line-cap",F,g,P)),Pe.setLineJoin(te(M,"layout","line-join",F,g,P)),Pe.setMiterLimit(te(M,"layout","line-miter-limit",F,g,P)),Pe.setColor(xe),Pe.setWidth(Y),Pe.setLineDash(ge["line-dasharray"]?te(M,"paint","line-dasharray",F,g,P).map(function(Z){return Z*Y}):null),typeof Pe.setOffset=="function"&&Pe.setOffset(te(M,"paint","line-offset",F,g,P)),k.setZIndex(He))}let E=!1,b=null,I=0,D,A,O;if((B==1||B==2)&&"icon-image"in le){const Y=te(M,"layout","icon-image",F,g,P);if(Y){D=typeof Y=="string"?Bf(Y,R):Y.toString();let Z;const q=a?a(n,D):void 0,ae=B_(D,l);if(r&&r[D]&&ae||q){const ce=te(M,"layout","icon-rotation-alignment",F,g,P);if(B==2){const se=v.getGeometry();if(se.getFlatMidpoint||se.getFlatMidpoints){const fe=se.getExtent();if(Math.sqrt(Math.max(Math.pow((fe[2]-fe[0])/x,2),Math.pow((fe[3]-fe[1])/x,2)))>150){const Fe=se.getType()==="MultiLineString"?se.getFlatMidpoints():se.getFlatMidpoint();if(Uf||(hc=[NaN,NaN],Uf=new Ct("Point",hc,[],2,{},void 0)),Z=Uf,hc[0]=Fe[0],hc[1]=Fe[1],te(M,"layout","symbol-placement",F,g,P)==="line"&&ce==="map"){const Tt=se.getStride(),ke=se.getFlatCoordinates();for(let Ve=0,je=ke.length-Tt;Ve<je;Ve+=Tt){const ut=ke[Ve],Ot=ke[Ve+1],Lt=ke[Ve+Tt],Je=ke[Ve+Tt+1],Vt=Math.min(ut,Lt),br=Math.max(ut,Lt),oi=Fe[0],fc=Fe[1],dc=(Je-Ot)*(oi-ut)-(Lt-ut)*(fc-Ot);if(Math.abs(dc)<.001&&oi<=br&&oi>=Vt){I=Math.atan2(Ot-Je,Lt-ut);break}}}}}}if(B!==2||Z){const se=te(M,"layout","icon-size",F,g,P),fe=ge["icon-color"]!==void 0?te(M,"paint","icon-color",F,g,P):null;if(!fe||fe.a!==0){const Me=te(M,"paint","icon-halo-color",F,g,P),Fe=te(M,"paint","icon-halo-width",F,g,P);let $e=`${D}.${se}.${Fe}.${Me}`;if(fe!==null&&($e+=`.${fe}`),A=f[$e],!A){const Tt=U_(M,F,"icon",g);let ke;"icon-offset"in le&&(ke=te(M,"layout","icon-offset",F,g,P).slice(0),ke[0]*=se,ke[1]*=-se);let Ve=fe?[fe.r*255,fe.g*255,fe.b*255,fe.a]:void 0;if(q){const je={color:Ve,rotateWithView:ce==="map",displacement:ke,declutterMode:Tt,scale:se};typeof q=="string"?je.src=q:(je.img=q,je.imgSize=[q.width,q.height]),A=new hr(je)}else{const je=r[D];let ut,Ot,Lt;if(Fe)je.sdf?(ut=G_(j_(ae.image,je,fe||[0,0,0,1]),{x:0,y:0,width:je.width,height:je.height,pixelRatio:je.pixelRatio},Fe,Me),Ve=void 0):ut=G_(ae.image,je,Fe,Me);else{if(je.sdf&&!ae.unSDFed){const Je=j_(ae.image,{x:0,y:0,width:ae.size[0],height:ae.size[1]},{r:1,g:1,b:1});ae.image=Je,ae.unSDFed=!0}ut=ae.image,Ot=[je.width,je.height],Lt=[je.x,je.y]}A=new hr({color:Ve,img:ut,imgSize:ae.size,size:Ot,offset:Lt,rotateWithView:ce==="map",scale:se/je.pixelRatio,displacement:ke,declutterMode:Tt})}f[$e]=A}}A&&(++oe,k=y[oe],(!k||!k.getImage()||k.getFill()||k.getStroke())&&(k=new At,y[oe]=k),k.setGeometry(Z),A.setRotation(I+jf(te(M,"layout","icon-rotate",F,g,P))),A.setOpacity(te(M,"paint","icon-opacity",F,g,P)),A.setAnchor(YS[te(M,"layout","icon-anchor",F,g,P)]),k.setImage(A),b=k.getText(),k.setText(void 0),k.setZIndex(He),E=!0,O=!1)}else O=!0}}}if(B==1&&M.type==="circle"){++oe,k=y[oe],(!k||!k.getImage()||k.getFill()||k.getStroke())&&(k=new At,y[oe]=k);const Y="circle-radius"in ge?te(M,"paint","circle-radius",F,g,P):5,Z=ji(te(M,"paint","circle-stroke-color",F,g,P),te(M,"paint","circle-stroke-opacity",F,g,P)),q=te(M,"paint","circle-translate",F,g,P),ae=ji(te(M,"paint","circle-color",F,g,P),te(M,"paint","circle-opacity",F,g,P)),ce=te(M,"paint","circle-stroke-width",F,g,P),se=Y+"."+Z+"."+ae+"."+ce+"."+q[0]+"."+q[1];A=f[se],A||(A=new ts({radius:Y,displacement:[q[0],-q[1]],stroke:Z&&ce>0?new Qn({width:ce,color:Z}):void 0,fill:ae?new Qt({color:ae}):void 0,declutterMode:"none"}),f[se]=A),k.setImage(A),b=k.getText(),k.setText(void 0),k.setGeometry(void 0),k.setZIndex(He),E=!0}let V,U,$,N,ee,Q;if("text-field"in le){N=Math.round(te(M,"layout","text-size",F,g,P));const Y=te(M,"layout","text-font",F,g,P);$=te(M,"layout","text-line-height",F,g,P),U=Nf(o?o(Y,e.metadata?e.metadata["ol:webfonts"]:void 0):Y,N,$),U.includes("sans-serif")||(U+=",sans-serif"),ee=te(M,"layout","text-letter-spacing",F,g,P),Q=te(M,"layout","text-max-width",F,g,P);const Z=te(M,"layout","text-field",F,g,P);typeof Z=="object"&&Z.sections?Z.sections.length===1?V=Z.toString():V=Z.sections.reduce((q,ae,ce)=>{const se=ae.fontStack?ae.fontStack.split(","):Y,fe=Nf(o?o(se):se,N*(ae.scale||1),$);let Me=ae.text;if(Me===`
16
+ `)}const r=t+","+e+","+n+","+i;let s=uc[r];if(!s){const o=n.split(" ");if(o.length>1){const a=W_();a.font=e;const c=a.measureText("M").width*t;let u="";const h=[];for(let f=0,d=o.length;f<d;++f){const g=o[f],p=u+(u?" ":"")+g;br(p,i)<=c?u=p:(u&&h.push(u),u=g)}u&&h.push(u);for(let f=0,d=h.length;f<d&&d>1;++f){const g=h[f];if(br(g,i)<c*.35){const p=f>0?br(h[f-1],i):1/0,m=f<d-1?br(h[f+1],i):1/0;h.splice(f,1),d-=1,p<m?(h[f-1]+=" "+g,f-=1):h[f]=g+" "+h[f]}}for(let f=0,d=h.length-1;f<d;++f){const g=h[f],p=h[f+1];if(br(g,i)>c*.7&&br(p,i)<c*.6){const m=g.split(" "),y=m.pop();br(y,i)<c*.2&&(h[f]=m.join(" "),h[f+1]=y+" "+p),d-=1}}s=h.join(`
17
+ `)}else s=n;s=Wf(s,i),uc[r]=s}return s}const BS=["Arial","Courier New","Times New Roman","Verdana","sans-serif","serif","monospace","cursive","fantasy"],V_={};function $S(n,e="https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css"){if(wt)return n;let t;for(let i=0,r=n.length;i<r;++i){const s=n[i];if(s in V_)continue;V_[s]=!0;const a=Nf(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(BS.includes(o))continue;const a=s[1],l=s[2];if(!(await document.fonts.load(`${l} ${a} 16px "${o}"`)).some(u=>u.family.replace(/^['"]|['"]$/g,"").toLowerCase()===o.toLowerCase()&&US(u.weight,a)&&u.style===l)){const u=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="'+u+'"]')){const h=document.createElement("link");h.href=u,h.rel="stylesheet",document.head.appendChild(h)}}}})(),n}const KS={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},YS={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]},X_=function(n,e){let t=Ny(n,e);if(t.result==="error"){const i=rc(n);i!==n&&(t=Ny(i,e))}if(t.result==="error"){const i=t.value[0];return console.error("Error parsing expression:",n,i.key,i.message),{evaluate:()=>e.default}}return t.value};let hc,Uf;function te(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]||at)[t];const c=Uy[`${e}_${n.type}`]&&Uy[`${e}_${n.type}`][t];l===void 0&&c&&(l=c.default);let u=Vl(l);if(!u&&Wl(l)&&(l=Vy(l,c),u=!0),u){const h=X_(l,c);a[t]=h.evaluate.bind(h)}else{const h=c?c.type:typeof l;(h==="color"||h==="colorArray")&&(l=Qe.parse(l));let f=!1;if(h==="array")for(let d=0;d<l.length;++d){const g=l[d];if(Vl(g)||Wl(g)){f=!0;break}}if(f){const d=Object.assign({},c,{type:c.value}),g=[];for(let p=0;p<l.length;++p){let m=l[p];if(!Vl(m)&&Wl(m)&&(m=Vy(m,d)),Vl(m)){const y=X_(m,d);g.push(y.evaluate.bind(y))}else g.push(function(){return m})}a[t]=function(p,m,y){const _=[];for(let w=0;w<g.length;++w)_[w]=g[w](p,m,y);return _}}else a[t]=function(){return l}}}return a[t](Ft,i,s)}function U_(n,e,t,i){return te(n,"layout",`${t}-allow-overlap`,e,i)?te(n,"layout",`${t}-ignore-placement`,e,i)?"none":"obstacle":"declutter"}function ZS(n,e,t,i){if(i||console.warn("No filterCache provided to evaluateFilter()"),!(n in i))try{i[n]=BT(e).filter}catch(r){console.warn("Filter will evaluate to false: "+r.message),i[n]=function(){return!1}}return i[n](Ft,t)}function Wi(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 qS=/\{[^{}}]*\}/g;function Bf(n,e){return n.replace(qS,function(t){return e[t.slice(1,-1)]||""})}function B_(n,e){let t=n.split(":")[0];return t===n&&(t="default"),e[t]}const HS={};function JS(n,e,t,i=gn,r=void 0,s=void 0,o=void 0,a=void 0){if(typeof e=="string"&&(e=JSON.parse(e)),e.schema)for(const w in e.schema){const x=e.schema[w];"default"in x&&(Pf[w]=x.default)}if(e.version!=8)throw new Error("glStyle version 8 required.");HS[jS(e,n)]=Array.from(arguments);const l={};(typeof s=="string"||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const w in s){const x=s[w];zr(()=>x).then(async v=>{let T;if(typeof Image<"u"){const R=new Image;if(typeof v=="string")R.crossOrigin="anonymous",R.src=v;else{let C;v instanceof Request?C=await fetch(v):v instanceof Response&&(C=v);const S=await C.blob();T=URL.createObjectURL(S),R.src=T}R.addEventListener("load",function C(){R.removeEventListener("load",C),l[w]={image:R,size:[R.width,R.height]},n.changed(),T&&URL.revokeObjectURL(T)}),R.addEventListener("error",function C(){URL.revokeObjectURL(T),R.removeEventListener("error",C)})}else if(typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope){const R=self;R.postMessage({action:"loadImage",src:v}),R.addEventListener("message",function(S){S.data.action==="imageLoaded"&&S.data.src===v&&(l[w]={image:S.data.image,size:[S.data.image.width,S.data.image.height]})})}})}const c=Ym(e.layers),u={},h=[],f={},d={},g=Gf(e),p=WS(e);let m;for(let w=0,x=c.length;w<x;++w){const v=c[w],T=v.id;if(typeof t=="string"&&v.source==t||Array.isArray(t)&&t.indexOf(T)!==-1){const R=v["source-layer"];if(m){if(v.source!==m)throw new Error(`Layer "${T}" does not use source "${m}`)}else{m=v.source;const S=e.sources[m];if(!S)throw new Error(`Source "${m}" is not defined`);const L=S.type;if(L!=="vector"&&L!=="geojson")throw new Error(`Source "${m}" is not of type "vector" or "geojson", but "${L}"`)}let C=u[R];C||(C=[],u[R]=C),C.push({layer:v,index:w}),h.push(T)}}const y=[],_=function(w,x,v){const T=n.getSource?.()?.format_?.layerName_??"mvt:layer",R=w.getProperties(),C=u[R[T]];if(!C)return;let S=i.indexOf(x);S==-1&&(S=cc(x,i)),Ft.zoom=S,Ft.distanceFromCenter=0;const L=w.getGeometry(),B=KS[L.getType()],K=n.get("map");if(K&&K instanceof is&&B===1){const W=K.getSize();if(W){const X=K.getView().getCenter(),z=zt(L.getExtent());Ft.distanceFromCenter=Rv(X,z)/x/W[1]}}const F={id:w.getId(),properties:R,type:B},P=n.get("mapbox-featurestate")[w.getId()];let oe=-1;for(let W=0,X=C.length;W<X;++W){const z=C[W],M=z.layer,ne=M.id;if(v!==void 0&&v!==ne)continue;const le=M.layout||at,ge=M.paint||at;if(te(M,"layout","visibility",F,g,P)==="none"||"minzoom"in M&&S<M.minzoom||"maxzoom"in M&&S>=M.maxzoom)continue;const G=M.filter;if(!G||ZS(ne,G,F,p)){let xe,he,Ie,Pe,ie,k;const He=z.index;if(B==3&&(M.type=="fill"||M.type=="fill-extrusion")){if(he=te(M,"paint",M.type+"-opacity",F,g,P),M.type+"-pattern"in ge){const Y=te(M,"paint",M.type+"-pattern",F,g,P);if(Y){const Z=typeof Y=="string"?Bf(Y,R):Y.toString(),q=B_(Z,l);if(r&&r[Z]&&q){++oe,k=y[oe],(!k||!k.getFill()||k.getStroke()||k.getText())&&(k=new yt({fill:new $t}),y[oe]=k),Ie=k.getFill(),k.setZIndex(He);const ae=Z+"."+he;let ce=d[ae];if(!ce){const se=r[Z],fe=lc(se.width,se.height),Me=fe.getContext("2d");Me.globalAlpha=he,Me.drawImage(q.image,se.x,se.y,se.width,se.height,0,0,se.width,se.height),ce=Me.createPattern(fe,"repeat"),d[ae]=ce}Ie.setColor(ce)}}}else if(xe=Wi(te(M,"paint",M.type+"-color",F,g,P),he),M.type+"-outline-color"in ge&&(ie=Wi(te(M,"paint",M.type+"-outline-color",F,g,P),he)),ie||(ie=xe),xe||ie){if(++oe,k=y[oe],(!k||xe&&!k.getFill()||!xe&&k.getFill()||ie&&!k.getStroke()||!ie&&k.getStroke()||k.getText())&&(k=new yt({fill:xe?new $t:void 0,stroke:ie?new dn:void 0}),y[oe]=k),xe&&(Ie=k.getFill(),Ie.setColor(xe)),M.type==="fill-extrusion"){const Y=te(M,"paint","fill-extrusion-height",F,g,P);if(Y>0){const Z=Math.max(.1,.9-Math.min(Y,225)/280);if(ie&&ie!=="transparent"){const q=Qe.parse(ie);ie=`rgba(${Math.round(q.r*255*Z)},${Math.round(q.g*255*Z)},${Math.round(q.b*255*Z)},${q.a})`}}}ie&&(Pe=k.getStroke(),Pe.setColor(ie),Pe.setWidth(.5)),k.setZIndex(He)}}if(B!=1&&M.type=="line"){"line-pattern"in ge?xe=void 0:xe=Wi(te(M,"paint","line-color",F,g,P),te(M,"paint","line-opacity",F,g,P));const Y=te(M,"paint","line-width",F,g,P);xe&&Y>0&&(++oe,k=y[oe],(!k||!k.getStroke()||k.getFill()||k.getText())&&(k=new yt({stroke:new dn}),y[oe]=k),Pe=k.getStroke(),Pe.setLineCap(te(M,"layout","line-cap",F,g,P)),Pe.setLineJoin(te(M,"layout","line-join",F,g,P)),Pe.setMiterLimit(te(M,"layout","line-miter-limit",F,g,P)),Pe.setColor(xe),Pe.setWidth(Y),Pe.setLineDash(ge["line-dasharray"]?te(M,"paint","line-dasharray",F,g,P).map(function(Z){return Z*Y}):null),typeof Pe.setOffset=="function"&&Pe.setOffset(te(M,"paint","line-offset",F,g,P)),k.setZIndex(He))}let E=!1,b=null,I=0,D,A,O;if((B==1||B==2)&&"icon-image"in le){const Y=te(M,"layout","icon-image",F,g,P);if(Y){D=typeof Y=="string"?Bf(Y,R):Y.toString();let Z;const q=a?a(n,D):void 0,ae=B_(D,l);if(r&&r[D]&&ae||q){const ce=te(M,"layout","icon-rotation-alignment",F,g,P);if(B==2){const se=w.getGeometry();if(se.getFlatMidpoint||se.getFlatMidpoints){const fe=se.getExtent();if(Math.sqrt(Math.max(Math.pow((fe[2]-fe[0])/x,2),Math.pow((fe[3]-fe[1])/x,2)))>150){const Fe=se.getType()==="MultiLineString"?se.getFlatMidpoints():se.getFlatMidpoint();if(Uf||(hc=[NaN,NaN],Uf=new Tt("Point",hc,[],2,{},void 0)),Z=Uf,hc[0]=Fe[0],hc[1]=Fe[1],te(M,"layout","symbol-placement",F,g,P)==="line"&&ce==="map"){const Rt=se.getStride(),ke=se.getFlatCoordinates();for(let Ve=0,je=ke.length-Rt;Ve<je;Ve+=Rt){const ut=ke[Ve],Ot=ke[Ve+1],Lt=ke[Ve+Rt],Je=ke[Ve+Rt+1],Vt=Math.min(ut,Lt),Cr=Math.max(ut,Lt),oi=Fe[0],fc=Fe[1],dc=(Je-Ot)*(oi-ut)-(Lt-ut)*(fc-Ot);if(Math.abs(dc)<.001&&oi<=Cr&&oi>=Vt){I=Math.atan2(Ot-Je,Lt-ut);break}}}}}}if(B!==2||Z){const se=te(M,"layout","icon-size",F,g,P),fe=ge["icon-color"]!==void 0?te(M,"paint","icon-color",F,g,P):null;if(!fe||fe.a!==0){const Me=te(M,"paint","icon-halo-color",F,g,P),Fe=te(M,"paint","icon-halo-width",F,g,P);let $e=`${D}.${se}.${Fe}.${Me}`;if(fe!==null&&($e+=`.${fe}`),A=f[$e],!A){const Rt=U_(M,F,"icon",g);let ke;"icon-offset"in le&&(ke=te(M,"layout","icon-offset",F,g,P).slice(0),ke[0]*=se,ke[1]*=-se);let Ve=fe?[fe.r*255,fe.g*255,fe.b*255,fe.a]:void 0;if(q){const je={color:Ve,rotateWithView:ce==="map",displacement:ke,declutterMode:Rt,scale:se};typeof q=="string"?je.src=q:(je.img=q,je.imgSize=[q.width,q.height]),A=new dr(je)}else{const je=r[D];let ut,Ot,Lt;if(Fe)je.sdf?(ut=G_(j_(ae.image,je,fe||[0,0,0,1]),{x:0,y:0,width:je.width,height:je.height,pixelRatio:je.pixelRatio},Fe,Me),Ve=void 0):ut=G_(ae.image,je,Fe,Me);else{if(je.sdf&&!ae.unSDFed){const Je=j_(ae.image,{x:0,y:0,width:ae.size[0],height:ae.size[1]},{r:1,g:1,b:1});ae.image=Je,ae.unSDFed=!0}ut=ae.image,Ot=[je.width,je.height],Lt=[je.x,je.y]}A=new dr({color:Ve,img:ut,imgSize:ae.size,size:Ot,offset:Lt,rotateWithView:ce==="map",scale:se/je.pixelRatio,displacement:ke,declutterMode:Rt})}f[$e]=A}}A&&(++oe,k=y[oe],(!k||!k.getImage()||k.getFill()||k.getStroke())&&(k=new yt,y[oe]=k),k.setGeometry(Z),A.setRotation(I+jf(te(M,"layout","icon-rotate",F,g,P))),A.setOpacity(te(M,"paint","icon-opacity",F,g,P)),A.setAnchor(YS[te(M,"layout","icon-anchor",F,g,P)]),k.setImage(A),b=k.getText(),k.setText(void 0),k.setZIndex(He),E=!0,O=!1)}else O=!0}}}if(B==1&&M.type==="circle"){++oe,k=y[oe],(!k||!k.getImage()||k.getFill()||k.getStroke())&&(k=new yt,y[oe]=k);const Y="circle-radius"in ge?te(M,"paint","circle-radius",F,g,P):5,Z=Wi(te(M,"paint","circle-stroke-color",F,g,P),te(M,"paint","circle-stroke-opacity",F,g,P)),q=te(M,"paint","circle-translate",F,g,P),ae=Wi(te(M,"paint","circle-color",F,g,P),te(M,"paint","circle-opacity",F,g,P)),ce=te(M,"paint","circle-stroke-width",F,g,P),se=Y+"."+Z+"."+ae+"."+ce+"."+q[0]+"."+q[1];A=f[se],A||(A=new fr({radius:Y,displacement:[q[0],-q[1]],stroke:Z&&ce>0?new dn({width:ce,color:Z}):void 0,fill:ae?new $t({color:ae}):void 0,declutterMode:"none"}),f[se]=A),k.setImage(A),b=k.getText(),k.setText(void 0),k.setGeometry(void 0),k.setZIndex(He),E=!0}let V,U,$,N,ee,Q;if("text-field"in le){N=Math.round(te(M,"layout","text-size",F,g,P));const Y=te(M,"layout","text-font",F,g,P);$=te(M,"layout","text-line-height",F,g,P),U=Nf(o?o(Y,e.metadata?e.metadata["ol:webfonts"]:void 0):Y,N,$),U.includes("sans-serif")||(U+=",sans-serif"),ee=te(M,"layout","text-letter-spacing",F,g,P),Q=te(M,"layout","text-max-width",F,g,P);const Z=te(M,"layout","text-field",F,g,P);typeof Z=="object"&&Z.sections?Z.sections.length===1?V=Z.toString():V=Z.sections.reduce((q,ae,ce)=>{const se=ae.fontStack?ae.fontStack.split(","):Y,fe=Nf(o?o(se):se,N*(ae.scale||1),$);let Me=ae.text;if(Me===`
18
18
  `)return q.push(`
19
19
  `,""),q;if(B==2)return q.push(Wf(Me,ee),fe),q;Me=Xf(Me,fe,Q,ee).split(`
20
20
  `);for(let Fe=0,$e=Me.length;Fe<$e;++Fe)Fe>0&&q.push(`
21
- `,""),q.push(Me[Fe],fe);return q},[]):V=Bf(Z,R).trim(),he=te(M,"paint","text-opacity",F,g,P)}if(V&&he&&!O){E||(++oe,k=y[oe],(!k||!k.getText()||k.getFill()||k.getStroke())&&(k=new At,y[oe]=k),k.setImage(void 0),k.setGeometry(void 0));const Y=U_(M,F,"text",g);k.getText()||k.setText(b),b=k.getText(),(!b||"getDeclutterMode"in b&&b.getDeclutterMode()!==Y)&&(b=new Ao({padding:[2,2,2,2],declutterMode:Y}),k.setText(b));const Z=te(M,"layout","text-transform",F,g,P);Z=="uppercase"?V=Array.isArray(V)?V.map((Je,Vt)=>Vt%2?Je:Je.toUpperCase()):V.toUpperCase():Z=="lowercase"&&(V=Array.isArray(V)?V.map((Je,Vt)=>Vt%2?Je:Je.toLowerCase()):V.toLowerCase());const q=Array.isArray(V)?V:B==2?Wf(V,ee):Xf(V,U,Q,ee);if(b.setText(q),b.setFont(U),b.setRotation(jf(te(M,"layout","text-rotate",F,g,P))),typeof b.setKeepUpright=="function"){const Je=te(M,"layout","text-keep-upright",F,g,P);b.setKeepUpright(Je)}const ae=te(M,"layout","text-anchor",F,g,P),ce=E||B==1?"point":te(M,"layout","symbol-placement",F,g,P);let se;if(ce==="line-center"?(b.setPlacement("line"),se="center"):b.setPlacement(ce),ce==="line"&&typeof b.setRepeat=="function"){const Je=te(M,"layout","symbol-spacing",F,g,P);b.setRepeat(Je*2)}b.setOverflow(ce==="point");let fe=te(M,"paint","text-halo-width",F,g,P);const Me=te(M,"layout","text-offset",F,g,P),Fe=te(M,"paint","text-translate",F,g,P);let $e=0,Tt=0;if(ce=="point"){se="center",ae.indexOf("left")!==-1?(se="left",Tt=fe):ae.indexOf("right")!==-1&&(se="right",Tt=-fe);const Je=te(M,"layout","text-rotation-alignment",F,g,P);b.setRotateWithView(Je=="map")}else b.setMaxAngle(jf(te(M,"layout","text-max-angle",F,g,P))*V.length/q.length),b.setRotateWithView(!1);b.setTextAlign(se);let ke="middle";ae.indexOf("bottom")==0?(ke="bottom",$e=-fe-.5*($-1)*N):ae.indexOf("top")==0&&(ke="top",$e=fe+.5*($-1)*N),b.setTextBaseline(ke);const Ve=te(M,"layout","text-justify",F,g,P);b.setJustify(Ve==="auto"?void 0:Ve),b.setOffsetX(Me[0]*N+Tt+Fe[0]),b.setOffsetY(Me[1]*N+$e+Fe[1]);const je=b.getFill()||new Qt;je.setColor(ji(te(M,"paint","text-color",F,g,P),he)),b.setFill(je);const ut=ji(te(M,"paint","text-halo-color",F,g,P),he);if(ut&&fe>0){const Je=b.getStroke()||new Qn;Je.setColor(ut),fe*=2;const Vt=.5*N;Je.setWidth(fe<=Vt?fe:Vt),b.setStroke(Je)}else b.setStroke(void 0);const Ot=te(M,"layout","text-padding",F,g,P),Lt=b.getPadding();Ot!==Lt[0]&&(Lt[0]=Ot,Lt[1]=Ot,Lt[2]=Ot,Lt[3]=Ot),k.setZIndex(He)}}}if(oe>-1)return y.length=oe+1,y};return n.setStyle(_),n.set("mapbox-layers",h),n.set("mapbox-source",m),n.set("mapbox-featurestate",n.get("mapbox-featurestate")||{}),_}const QS=Qe.parse("#000000"),eI=Qe.parse("#FFFFFF"),tI=Qe.parse("#000000");function nI(n){return new Of({source:new kf({operationType:"image",operation:zS,sources:[n]})})}function iI(n){return new Of({source:new kf({operationType:"image",operation:NS,sources:[n]})})}function rI(n,e,t,i){n.getSource().on("beforeoperations",function(r){Ft.zoom=cc(r.resolution,t.resolutions||dn),Ft.distanceFromCenter=0;const s=r.data;s.saturation=te(e,"paint","raster-saturation",at,i),s.contrast=te(e,"paint","raster-contrast",at,i),s.brightnessHigh=te(e,"paint","raster-brightness-max",at,i),s.brightnessLow=te(e,"paint","raster-brightness-min",at,i),s.hueRotate=te(e,"paint","raster-hue-rotate",at,i)})}function sI(n,e,t,i,r){n.getSource().on("beforeoperations",function(s){const o=s.data;o.resolution=wu(i.projection||"EPSG:3857",s.resolution,zt(s.extent),"m");const a=cc(s.resolution,i.resolutions||dn);Ft.zoom=a,Ft.distanceFromCenter=0,o.zoom=a,o.encoding=e.encoding,o.method=te(t,"paint","hillshade-method",at,r)||"standard",o.exaggeration=te(t,"paint","hillshade-exaggeration",at,r);let l=te(t,"paint","hillshade-illumination-direction",at,r);l==null&&(l=335),o.azimuths=Array.isArray(l)?l:[l],o.sunAz=o.azimuths[0];let c=te(t,"paint","hillshade-illumination-altitude",at,r);c==null&&(c=45),o.altitudes=Array.isArray(c)?c:[c];function u(f){return f&&f.values?f.values[0]:f}function h(f){const d=t.paint?.[f];if(Array.isArray(d)&&d.length>0&&typeof d[0]=="string"&&Qe.parse(d[0])!==void 0)return d.map(p=>Qe.parse(p));let g=te(t,"paint",f,at,r);return g=u(g),g?[g]:void 0}o.highlightColors=h("hillshade-highlight-color"),o.highlightColor=o.highlightColors?.[0]||eI,o.highlightColors||(o.highlightColors=[o.highlightColor]),o.shadowColors=h("hillshade-shadow-color"),o.shadowColor=o.shadowColors?.[0]||QS,o.shadowColors||(o.shadowColors=[o.shadowColor]),o.accentColor=u(te(t,"paint","hillshade-accent-color",at,r))||tI})}const oI=["raster-saturation","raster-contrast","raster-brightness-max","raster-brightness-min","raster-hue-rotate"];function aI(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],lI(n,e,i,t))}}function lI(n,e,t,i){Ft.zoom=t,Ft.distanceFromCenter=0;const r=te(n,"paint","raster-opacity",at,i);e.setOpacity(r)}const cI=["background","circle","fill","fill-extrusion","line","symbol","raster","hillshade"];function uI(n,e=512){return n.getExtent()?El({extent:n.getExtent(),tileSize:e,maxZoom:22}).getResolutions():dn}function $_(n,e){return e.accessToken||(e=Object.assign({},e),new URL(n).searchParams.forEach((i,r)=>{e.accessToken=i,e.accessTokenParam=r})),e}function hI(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:sc(s,a.accessToken),a=$_(s,a)),new Promise(function(u,h){k_(e,a).then(function(f){if(f.version!=8)return h(new Error("glStyle version 8 required."));if(!(n instanceof ic||n instanceof Jo))return h(new Error("Can only apply to VectorLayer or VectorTileLayer"));const d=n instanceof Jo?"vector":"geojson";if(l?Array.isArray(l)?o=f.layers.find(function(x){return x.id===l[0]}).source:o=l:(o=f.layers.find(function(x){return x.source&&f.sources[x.source].type===d}).source,l=o),!o)return h(new Error(`No ${d} source found in the glStyle.`));function g(){if(!c)return Promise.resolve();if(n instanceof Jo)return Z_(f.sources[o],s,a).then(function(R){const C=n.getSource();C?R!==C&&(C.setTileUrlFunction(R.getTileUrlFunction()),typeof C.setUrls=="function"&&typeof R.getUrls=="function"&&C.setUrls(R.getUrls()),C.format_||(C.format_=R.format_),C.getAttributions()||C.setAttributions(R.getAttributions()),C.getTileLoadFunction()===b_&&C.setTileLoadFunction(R.getTileLoadFunction()),Et(C.getProjection(),R.getProjection())&&(C.tileGrid=R.getTileGrid())):n.setSource(R);const S=n.getSource().getTileGrid();!isFinite(n.getMaxResolution())&&!isFinite(n.getMinZoom())&&S.getMinZoom()>0&&n.setMaxResolution(ea(Math.max(0,S.getMinZoom()-1e-12),S.getResolutions()))});const x=f.sources[o];let w=n.getSource();(!w||w.get("mapbox-source")!==x)&&(w=H_(x,s,a));const T=n.getSource();return T?w!==T&&(T.getAttributions()||T.setAttributions(w.getAttributions()),T.format_||(T.format_=w.getFormat()),T.url_=w.getUrl()):n.setSource(w),Promise.resolve()}let p,m;const y={},_={};function v(){if(!m&&(!f.sprite||y)){if(a.projection&&!r){const R=Le(a.projection).getUnits();R!=="m"&&(r=dn.map(C=>C/bi[R]))}let x;const w=n.getSource();w instanceof Af&&w.format_ instanceof Qy&&(x=w.format_.layerName_),m=JS(n,f,l,r,y,_,(T,R=a.webfonts)=>$S(T,R),a.getImage,x),n.getStyle()?g().then(u).catch(h):h(new Error(`Nothing to show for source [${o}]`))}else m?(n.setStyle(m),g().then(u).catch(h)):h(new Error("Something went wrong trying to apply style."))}if(f.sprite){const x=ES(f.sprite,a.accessToken,s||location.href);p=vt?1:window.devicePixelRatio>=1.5?.5:1;const w=p==.5?"@2x":"";Promise.all(x.map(function(T){const R=new URL(T.url);let C=R.origin+R.pathname+w+".json"+R.search;return new Promise(function(S,L){Rs("Sprite",C,a).then(S).catch(function(B){C=R.origin+R.pathname+".json"+R.search,Rs("Sprite",C,a).then(S).catch(L)})}).then(function(S){S===void 0&&h(new Error("No sprites found."));let L;if(L=R.origin+R.pathname+w+".png"+R.search,a.transformRequest){const B=a.transformRequest(L,"SpriteImage")||L;(B instanceof Request||B instanceof Promise)&&(L=B)}_[T.id]=L;for(const B in S){const K=T.id=="default"?B:`${T.id}:${B}`;y[K]=S[B]}}).catch(function(S){h(new Error(`Sprites cannot be loaded: ${C}: ${S.message}`))})})).then(v).catch(h)}else v()}).catch(h)})}const fI=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function K_(n,e){if(!e.ref)return e;const t=n.find(r=>r.id===e.ref);if(!t)return e;const i=Object.assign({},e);for(const r of fI)!(r in i)&&r in t&&(i[r]=t[r]);return i}function dI(n,e){const t=n.bounds;if(t){const i=bu([t[0],t[1]],e),r=bu([t[2],t[3]],e);return[i[0],i[1],r[0],r[1]]}return Le(e).getExtent()}function Y_(n,e,t){const i=new y_({tileJSON:e,tileSize:n.tileSize||e.tileSize||512}),r=i.getTileJSON(),s=i.getTileGrid(),o=Le(t.projection||"EPSG:3857"),a=dI(r,o),l=o.getExtent(),c=r.minzoom||0,u=r.maxzoom||22,h={attributions:i.getAttributions(),projection:o,tileGrid:new wl({origin:l?$n(l):s.getOrigin(0),extent:a||s.getExtent(),minZoom:c,resolutions:uI(o,e.tileSize).slice(0,u+1),tileSize:s.getTileSize(0)})};return Array.isArray(r.tiles)?h.urls=r.tiles:h.url=r.tiles,h}function gI(n,e,t,i){const r={id:n.id,type:n.type},s=n.paint||{};r.paint=s,Ft.zoom=cc(e,t.resolutions||dn),Ft.distanceFromCenter=0;let o;const a=te(r,"paint","background-color",at,i);return s["background-opacity"]!==void 0&&(o=te(r,"paint","background-opacity",at,i)),te(r,"layout","visibility",at,i)==="none"?void 0:ji(a,o)}function pI(n,e,t){const i=vt?{style:{}}:document.createElement("div");return i.className="ol-mapbox-style-background",i.style.position="absolute",i.style.width="100%",i.style.height="100%",new Zr({source:new ls({}),render(r){const s=gI(n,r.viewState.resolution,e,t);return i.style.backgroundColor=s,i}})}function Z_(n,e,t){return new Promise(function(i,r){z_(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=Y_(n,s,t);a.tileLoadFunction=o,a.format=new Qy({layerName:"mvt:layer"});const l=new Af(a);l.set("mapbox-source",n),i(l)}).catch(r)})}function mI(n,e,t){const i=new Jo({declutter:!0,visible:!1});return Z_(n,e,t).then(function(r){i.setSource(r)}).catch(function(r){i.setSource(void 0)}),i}function q_(n){return`{bbox-${(n?n.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function yI(n,e,t){return new Promise(function(i,r){z_(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=new y_({interpolate:t.interpolate===void 0?!0:t.interpolate,transition:0,crossOrigin:"anonymous",tileJSON:s});a.tileGrid=Y_(n,s,t).tileGrid,t.projection&&(a.projection=Le(t.projection));const l=a.getTileUrlFunction();o&&a.setTileLoadFunction(o),a.setTileUrlFunction(function(c,u,h){const f=q_(h);let d=l(c,u,h);if(d.indexOf(f)!=-1){const g=a.getTileGrid().getTileCoordExtent(c);d=d.replace(f,g.toString())}return d}),a.set("mapbox-source",n),i(a)}).catch(function(s){r(s)})})}function $f(n,e,t){const i=new Nh;return yI(n,e,t).then(function(r){i.setSource(r)}).catch(function(){i.setSource(void 0)}),i}function H_(n,e,t){const i=t.projection?new Zy({dataProjection:t.projection}):new Zy,r=n.data,s={};if(typeof r=="string"){const[a]=oc(r,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(a)){const c=(h,f,d)=>{const g=q_(d);return a.replace(g,`${h.join(",")}`)},u=new Cs({attributions:n.attribution,format:i,loader:(h,f,d,g,p)=>{const m=typeof c=="function"?c(h,f,d):c;Rs("GeoJSON",m,t).then(y=>{const _=u.getFormat().readFeatures(y,{featureProjection:d});u.addFeatures(_),g(_)}).catch(y=>{u.removeLoadedExtent(h),p()})},strategy:yS});return u.set("mapbox-source",n),u}const l=new Cs({attributions:n.attribution,format:i,url:a,loader:(c,u,h,f,d)=>{Rs("GeoJSON",a,t).then(g=>{const p=l.getFormat().readFeatures(g,{featureProjection:h});l.addFeatures(p),f(p)}).catch(g=>{l.removeLoadedExtent(c),d()})}});return l}s.features=i.readFeatures(r,{featureProjection:oo()||"EPSG:3857"});const o=new Cs(Object.assign({attributions:n.attribution,format:i},s));return o.set("mapbox-source",n),o}function _I(n,e,t){return new ic({declutter:!0,source:H_(n,e,t),visible:!1})}function xI(n,e,t){function i(){const r=e.get("mapbox-style");if(!r)return;const s=Ym(r.layers),o=n.get("mapbox-layers"),a=s.filter(function(l){return o.includes(l.id)}).some(function(l){return!l.layout||te(l,"layout","visibility",at,t)==="visible"});n.get("visible")!==a&&n.setVisible(a)}n.on("change",i),i()}function vI(n,e,t,i){t=K_(n.layers,t);const r=Gf(n),s=t.type;let o=t.source;const a=n.sources[o];let l;if(s=="background")l=pI(t,i,r),o=void 0;else if(a.type=="vector")l=mI(a,e,i);else if(a.type=="raster"){if(!!Object.keys(t.paint||{}).find(u=>oI.includes(u))){const u=$f(a,e,i);l=nI(u),rI(l,t,i,r)}else l=$f(a,e,i);l.setVisible(t.layout?te(t,"layout","visibility",at,r)!=="none":!0),l.on("prerender",aI(t,l,r))}else if(a.type=="geojson")l=_I(a,e,i);else if(a.type=="raster-dem"&&t.type=="hillshade"){const c=$f(a,e,i);l=iI(c),sI(l,a,t,i,r),l.setVisible(t.layout?te(t,"layout","visibility",at,r)!=="none":!0)}return l&&l.set("mapbox-source",o),l}function J_(n,e,t,i){n.schema&&Object.assign(Pf,Object.keys(n.schema).reduce((h,f)=>(h[f]=n.schema[f]?.default,h),{}));const r=[];let s=null;if(e instanceof is){if(s=e.getView(),!s.isDef()&&!s.getRotation()&&!s.getResolutions()){const h=i.projection?Le(i.projection):s.getProjection();s=new un(Object.assign(s.getProperties(),{maxResolution:dn[0]/bi[h.getUnits()],projection:i.projection||s.getProjection()})),e.setView(s)}"center"in n&&!s.getCenter()&&s.setCenter(bu(n.center,s.getProjection())),"zoom"in n&&s.getZoom()===void 0&&s.setResolution(dn[0]/bi[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,u;for(let h=0,f=o.length;h<f;++h){const d=K_(o,o[h]),g=d.type;if(cI.includes(g))u=d.source,(!u||u!=c)&&(a.length&&(r.push(Q_(l,a,n,t,e,i)),a=[]),l=vI(n,t,d,i),l instanceof ic||l instanceof Jo||(a=[]),c=l.get("mapbox-source")),a.push(d.id);else{console.warn(`layers[${h}].type "${g}" not supported`);continue}}return r.push(Q_(l,a,n,t,e,i)),Promise.all(r)}function wI(n,e,t={}){let i,r;if(vt){if(!(n instanceof is)&&!(n instanceof Mi))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 is({target:n}):r=n;if(typeof e=="string"){const s=e.startsWith("data:")?location.href:sc(e,t.accessToken);t=$_(s,t),i=new Promise(function(o,a){k_(e,t).then(function(l){J_(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){J_(e,r,!t.styleUrl||t.styleUrl.startsWith("data:")?location.href:sc(t.styleUrl,t.accessToken),t).then(function(){s(r)}).catch(o)});return i}function Q_(n,e,t,i,r,s={}){let o=24,a=0;const l=t.layers;for(let c=0,u=l.length;c<u;++c){const h=l[c];e.indexOf(h.id)!==-1&&(o=Math.min("minzoom"in h?h.minzoom:0,o),a=Math.max("maxzoom"in h?h.maxzoom:24,a))}return new Promise(function(c,u){const h=function(){const d=n.getSource();if(!d||d.getState()==="error"){u(new Error("Error accessing data for source "+n.get("mapbox-source")));return}if("getTileGrid"in d){const g=d.getTileGrid();if(g){const p=g.getMinZoom();(o>0||p>0)&&n.setMaxResolution(Math.min(ea(Math.max(0,o-1e-12),dn),ea(Math.max(0,p-1e-12),g.getResolutions()))),a<24&&n.setMinResolution(ea(a,dn))}}else o>0&&n.setMaxResolution(ea(Math.max(0,o-1e-12),dn));d instanceof Cs||d instanceof Af?hI(n,t,e,Object.assign({styleUrl:i},s)).then(function(){xI(n,r,Gf(t)),c()}).catch(u):c()};n.set("mapbox-layers",e);const f=r.getLayers();f.getArray().indexOf(n)===-1&&f.push(n),n.getSource()?h():n.once("change:source",h)})}const EI="EPSG:3857",bI=[9.254419,50.102223],CI=({centre:n,map:e,style:t,target:i}={})=>{const r=wa(e);ow();const s=()=>{const l=Ns(t);if(l){const c=new Mi;return wI(c,l),c}else return new Nh({source:new mC})},o=()=>new un({center:Ns(n)||bI,minZoom:1,projection:EI,zoom:4}),a=()=>{r.value||(r.value=new is),r.value.setTarget(i),r.value.setView(o()),r.value.setLayers([s()])};return pi(wa(t),()=>{r.value?.setLayers([s()])}),Gd(()=>{a()}),{map:r}};class TI extends Cs{constructor(e){e=e||{},super({attributions:e.attributions,wrapX:e.wrapX}),this.resolution=void 0,this.distance=e.distance!==void 0?e.distance:20,this.minDistance=e.minDistance||0,this.interpolationRatio=0,this.features=[],this.geometryFunction=e.geometryFunction||function(t){const i=t.getGeometry();return Oe(!i||i.getType()==="Point","The default `geometryFunction` can only handle `Point` or null geometries"),i},this.createCustomCluster_=e.createCluster,this.source=null,this.boundRefresh_=this.refresh.bind(this),this.updateDistance(this.distance,this.minDistance),this.setSource(e.source||null)}clear(e){this.features.length=0,super.clear(e)}getDistance(){return this.distance}getSource(){return this.source}loadFeatures(e,t,i){this.source?.loadFeatures(e,t,i),t!==this.resolution&&(this.resolution=t,this.refresh())}setDistance(e){this.updateDistance(e,this.minDistance)}setMinDistance(e){this.updateDistance(this.distance,e)}getMinDistance(){return this.minDistance}setSource(e){this.source&&this.source.removeEventListener(de.CHANGE,this.boundRefresh_),this.source=e,e&&e.addEventListener(de.CHANGE,this.boundRefresh_),this.refresh()}refresh(){this.clear(),this.cluster(),this.addFeatures(this.features)}updateDistance(e,t){const i=e===0?0:Math.min(t,e)/e,r=e!==this.distance||this.interpolationRatio!==i;this.distance=e,this.minDistance=t,this.interpolationRatio=i,r&&this.refresh()}cluster(){if(this.resolution===void 0||!this.source)return;const e=Bt(),t=this.distance*this.resolution,i=this.source.getFeatures(),r={};for(let s=0,o=i.length;s<o;s++){const a=i[s];if(!(_e(a)in r)){const l=this.geometryFunction(a);if(l){const c=l.getCoordinates();cu(c,e),Vn(e,t,e);const u=this.source.getFeaturesInExtent(e).filter(function(h){const f=_e(h);return f in r?!1:(r[f]=!0,!0)});this.features.push(this.createCluster(u,e))}}}}createCluster(e,t){const i=[0,0];for(let a=e.length-1;a>=0;--a){const l=this.geometryFunction(e[a]);l?Hg(i,l.getCoordinates()):e.splice(a,1)}Jg(i,1/e.length);const r=zt(t),s=this.interpolationRatio,o=new Zn([i[0]*(1-s)+r[0]*s,i[1]*(1-s)+r[1]*s]);return this.createCustomCluster_?this.createCustomCluster_(o,e):new ws({geometry:o,features:e})}}const RI=({data:n,map:e,pointIconSrc:t}={})=>{const i=wa(e),r=Ki(()=>n.value.features.map(c=>new ws({geometry:new Zn(c.geometry.coordinates),name:c.id}))),s={},o=c=>{const h=c.get("features").length;return s[h]||(t&&h===1?s[h]=new At({image:new hr({src:t,width:32,height:32})}):s[h]=new At({image:new ts({radius:14,stroke:new Qn({color:"#000"}),fill:new Qt({color:"#000"})}),text:new Ao({text:h.toString(),fill:new Qt({color:"#fff"}),font:'700 0.875rem "Open Sans", "Arial", sans-serif'})})),s[h]},a=()=>new ic({source:new TI({distance:Number.parseInt(40,10),minDistance:Number.parseInt(20,10),source:new Cs({features:r.value})}),style:o}),l=()=>{n.value?.features?.length===1&&i.value.getView().setCenter(n.value.features[0].geometry.coordinates)};Cx(()=>{i.value&&n.value&&(i.value.addLayer(a()),l())})},SI="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2058_7122)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%2012C10.9%2012%2010%2011.1%2010%2010C10%208.9%2010.9%208%2012%208C13.1%208%2014%208.9%2014%2010C14%2011.1%2013.1%2012%2012%2012ZM12%202C16.2%202%2020%205.22%2020%2010.2C20%2013.52%2017.33%2017.45%2012%2022C6.67%2017.45%204%2013.52%204%2010.2C4%205.22%207.8%202%2012%202Z'%20fill='black'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2058_7122'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Kf="europeana-map-map",II={__name:"EuropeanaMap",props:{json:{type:String,default:null},style:{type:String,default:null},url:{type:String,default:null}},setup(n){const e=Fr("map",null),t=Fr("config",null),i=n,r=kc(null),s=Ki(()=>i.url||t?.value?.url),o=Ki(()=>i.json||t?.value?.json),a=Ki(()=>i.style||t?.value?.style);if(o.value)r.value=JSON.parse(o.value);else if(s.value)Gb(s.value).json().then(l=>{r.value=l.data.value});else throw new Error("No data JSON or URL supplied.");return CI({map:e,style:a,target:Kf}),RI({data:r,map:e,pointIconSrc:SI}),(l,c)=>(f1(),p1("div",{id:Kf,class:ha(Kf)}))}};class MI{#t;#n;#e=ya({});constructor(e,t={}){this.#n=new is,this.#e.url=t.url,this.#e.style=t.style,this.#e.json=t.json,this.#t=nv(II),this.#t.provide("config",Ki(()=>this.#e)),this.#t.provide("map",this.#n),this.#t.mount(e)}get config(){return this.#e}get app(){return this.#t}get olMap(){return this.#n}set(e,t){Object.hasOwn(this.#e,e)&&(this.#e[e]=t)}}return MI})();
21
+ `,""),q.push(Me[Fe],fe);return q},[]):V=Bf(Z,R).trim(),he=te(M,"paint","text-opacity",F,g,P)}if(V&&he&&!O){E||(++oe,k=y[oe],(!k||!k.getText()||k.getFill()||k.getStroke())&&(k=new yt,y[oe]=k),k.setImage(void 0),k.setGeometry(void 0));const Y=U_(M,F,"text",g);k.getText()||k.setText(b),b=k.getText(),(!b||"getDeclutterMode"in b&&b.getDeclutterMode()!==Y)&&(b=new Ao({padding:[2,2,2,2],declutterMode:Y}),k.setText(b));const Z=te(M,"layout","text-transform",F,g,P);Z=="uppercase"?V=Array.isArray(V)?V.map((Je,Vt)=>Vt%2?Je:Je.toUpperCase()):V.toUpperCase():Z=="lowercase"&&(V=Array.isArray(V)?V.map((Je,Vt)=>Vt%2?Je:Je.toLowerCase()):V.toLowerCase());const q=Array.isArray(V)?V:B==2?Wf(V,ee):Xf(V,U,Q,ee);if(b.setText(q),b.setFont(U),b.setRotation(jf(te(M,"layout","text-rotate",F,g,P))),typeof b.setKeepUpright=="function"){const Je=te(M,"layout","text-keep-upright",F,g,P);b.setKeepUpright(Je)}const ae=te(M,"layout","text-anchor",F,g,P),ce=E||B==1?"point":te(M,"layout","symbol-placement",F,g,P);let se;if(ce==="line-center"?(b.setPlacement("line"),se="center"):b.setPlacement(ce),ce==="line"&&typeof b.setRepeat=="function"){const Je=te(M,"layout","symbol-spacing",F,g,P);b.setRepeat(Je*2)}b.setOverflow(ce==="point");let fe=te(M,"paint","text-halo-width",F,g,P);const Me=te(M,"layout","text-offset",F,g,P),Fe=te(M,"paint","text-translate",F,g,P);let $e=0,Rt=0;if(ce=="point"){se="center",ae.indexOf("left")!==-1?(se="left",Rt=fe):ae.indexOf("right")!==-1&&(se="right",Rt=-fe);const Je=te(M,"layout","text-rotation-alignment",F,g,P);b.setRotateWithView(Je=="map")}else b.setMaxAngle(jf(te(M,"layout","text-max-angle",F,g,P))*V.length/q.length),b.setRotateWithView(!1);b.setTextAlign(se);let ke="middle";ae.indexOf("bottom")==0?(ke="bottom",$e=-fe-.5*($-1)*N):ae.indexOf("top")==0&&(ke="top",$e=fe+.5*($-1)*N),b.setTextBaseline(ke);const Ve=te(M,"layout","text-justify",F,g,P);b.setJustify(Ve==="auto"?void 0:Ve),b.setOffsetX(Me[0]*N+Rt+Fe[0]),b.setOffsetY(Me[1]*N+$e+Fe[1]);const je=b.getFill()||new $t;je.setColor(Wi(te(M,"paint","text-color",F,g,P),he)),b.setFill(je);const ut=Wi(te(M,"paint","text-halo-color",F,g,P),he);if(ut&&fe>0){const Je=b.getStroke()||new dn;Je.setColor(ut),fe*=2;const Vt=.5*N;Je.setWidth(fe<=Vt?fe:Vt),b.setStroke(Je)}else b.setStroke(void 0);const Ot=te(M,"layout","text-padding",F,g,P),Lt=b.getPadding();Ot!==Lt[0]&&(Lt[0]=Ot,Lt[1]=Ot,Lt[2]=Ot,Lt[3]=Ot),k.setZIndex(He)}}}if(oe>-1)return y.length=oe+1,y};return n.setStyle(_),n.set("mapbox-layers",h),n.set("mapbox-source",m),n.set("mapbox-featurestate",n.get("mapbox-featurestate")||{}),_}const QS=Qe.parse("#000000"),eI=Qe.parse("#FFFFFF"),tI=Qe.parse("#000000");function nI(n){return new Of({source:new kf({operationType:"image",operation:zS,sources:[n]})})}function iI(n){return new Of({source:new kf({operationType:"image",operation:NS,sources:[n]})})}function rI(n,e,t,i){n.getSource().on("beforeoperations",function(r){Ft.zoom=cc(r.resolution,t.resolutions||gn),Ft.distanceFromCenter=0;const s=r.data;s.saturation=te(e,"paint","raster-saturation",at,i),s.contrast=te(e,"paint","raster-contrast",at,i),s.brightnessHigh=te(e,"paint","raster-brightness-max",at,i),s.brightnessLow=te(e,"paint","raster-brightness-min",at,i),s.hueRotate=te(e,"paint","raster-hue-rotate",at,i)})}function sI(n,e,t,i,r){n.getSource().on("beforeoperations",function(s){const o=s.data;o.resolution=wu(i.projection||"EPSG:3857",s.resolution,zt(s.extent),"m");const a=cc(s.resolution,i.resolutions||gn);Ft.zoom=a,Ft.distanceFromCenter=0,o.zoom=a,o.encoding=e.encoding,o.method=te(t,"paint","hillshade-method",at,r)||"standard",o.exaggeration=te(t,"paint","hillshade-exaggeration",at,r);let l=te(t,"paint","hillshade-illumination-direction",at,r);l==null&&(l=335),o.azimuths=Array.isArray(l)?l:[l],o.sunAz=o.azimuths[0];let c=te(t,"paint","hillshade-illumination-altitude",at,r);c==null&&(c=45),o.altitudes=Array.isArray(c)?c:[c];function u(f){return f&&f.values?f.values[0]:f}function h(f){const d=t.paint?.[f];if(Array.isArray(d)&&d.length>0&&typeof d[0]=="string"&&Qe.parse(d[0])!==void 0)return d.map(p=>Qe.parse(p));let g=te(t,"paint",f,at,r);return g=u(g),g?[g]:void 0}o.highlightColors=h("hillshade-highlight-color"),o.highlightColor=o.highlightColors?.[0]||eI,o.highlightColors||(o.highlightColors=[o.highlightColor]),o.shadowColors=h("hillshade-shadow-color"),o.shadowColor=o.shadowColors?.[0]||QS,o.shadowColors||(o.shadowColors=[o.shadowColor]),o.accentColor=u(te(t,"paint","hillshade-accent-color",at,r))||tI})}const oI=["raster-saturation","raster-contrast","raster-brightness-max","raster-brightness-min","raster-hue-rotate"];function aI(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],lI(n,e,i,t))}}function lI(n,e,t,i){Ft.zoom=t,Ft.distanceFromCenter=0;const r=te(n,"paint","raster-opacity",at,i);e.setOpacity(r)}const cI=["background","circle","fill","fill-extrusion","line","symbol","raster","hillshade"];function uI(n,e=512){return n.getExtent()?El({extent:n.getExtent(),tileSize:e,maxZoom:22}).getResolutions():gn}function $_(n,e){return e.accessToken||(e=Object.assign({},e),new URL(n).searchParams.forEach((i,r)=>{e.accessToken=i,e.accessTokenParam=r})),e}function hI(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:sc(s,a.accessToken),a=$_(s,a)),new Promise(function(u,h){k_(e,a).then(function(f){if(f.version!=8)return h(new Error("glStyle version 8 required."));if(!(n instanceof ic||n instanceof Jo))return h(new Error("Can only apply to VectorLayer or VectorTileLayer"));const d=n instanceof Jo?"vector":"geojson";if(l?Array.isArray(l)?o=f.layers.find(function(x){return x.id===l[0]}).source:o=l:(o=f.layers.find(function(x){return x.source&&f.sources[x.source].type===d}).source,l=o),!o)return h(new Error(`No ${d} source found in the glStyle.`));function g(){if(!c)return Promise.resolve();if(n instanceof Jo)return Z_(f.sources[o],s,a).then(function(R){const C=n.getSource();C?R!==C&&(C.setTileUrlFunction(R.getTileUrlFunction()),typeof C.setUrls=="function"&&typeof R.getUrls=="function"&&C.setUrls(R.getUrls()),C.format_||(C.format_=R.format_),C.getAttributions()||C.setAttributions(R.getAttributions()),C.getTileLoadFunction()===b_&&C.setTileLoadFunction(R.getTileLoadFunction()),bt(C.getProjection(),R.getProjection())&&(C.tileGrid=R.getTileGrid())):n.setSource(R);const S=n.getSource().getTileGrid();!isFinite(n.getMaxResolution())&&!isFinite(n.getMinZoom())&&S.getMinZoom()>0&&n.setMaxResolution(ea(Math.max(0,S.getMinZoom()-1e-12),S.getResolutions()))});const x=f.sources[o];let v=n.getSource();(!v||v.get("mapbox-source")!==x)&&(v=H_(x,s,a));const T=n.getSource();return T?v!==T&&(T.getAttributions()||T.setAttributions(v.getAttributions()),T.format_||(T.format_=v.getFormat()),T.url_=v.getUrl()):n.setSource(v),Promise.resolve()}let p,m;const y={},_={};function w(){if(!m&&(!f.sprite||y)){if(a.projection&&!r){const R=Le(a.projection).getUnits();R!=="m"&&(r=gn.map(C=>C/bi[R]))}let x;const v=n.getSource();v instanceof Af&&v.format_ instanceof Qy&&(x=v.format_.layerName_),m=JS(n,f,l,r,y,_,(T,R=a.webfonts)=>$S(T,R),a.getImage,x),n.getStyle()?g().then(u).catch(h):h(new Error(`Nothing to show for source [${o}]`))}else m?(n.setStyle(m),g().then(u).catch(h)):h(new Error("Something went wrong trying to apply style."))}if(f.sprite){const x=ES(f.sprite,a.accessToken,s||location.href);p=wt?1:window.devicePixelRatio>=1.5?.5:1;const v=p==.5?"@2x":"";Promise.all(x.map(function(T){const R=new URL(T.url);let C=R.origin+R.pathname+v+".json"+R.search;return new Promise(function(S,L){Rs("Sprite",C,a).then(S).catch(function(B){C=R.origin+R.pathname+".json"+R.search,Rs("Sprite",C,a).then(S).catch(L)})}).then(function(S){S===void 0&&h(new Error("No sprites found."));let L;if(L=R.origin+R.pathname+v+".png"+R.search,a.transformRequest){const B=a.transformRequest(L,"SpriteImage")||L;(B instanceof Request||B instanceof Promise)&&(L=B)}_[T.id]=L;for(const B in S){const K=T.id=="default"?B:`${T.id}:${B}`;y[K]=S[B]}}).catch(function(S){h(new Error(`Sprites cannot be loaded: ${C}: ${S.message}`))})})).then(w).catch(h)}else w()}).catch(h)})}const fI=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function K_(n,e){if(!e.ref)return e;const t=n.find(r=>r.id===e.ref);if(!t)return e;const i=Object.assign({},e);for(const r of fI)!(r in i)&&r in t&&(i[r]=t[r]);return i}function dI(n,e){const t=n.bounds;if(t){const i=bu([t[0],t[1]],e),r=bu([t[2],t[3]],e);return[i[0],i[1],r[0],r[1]]}return Le(e).getExtent()}function Y_(n,e,t){const i=new y_({tileJSON:e,tileSize:n.tileSize||e.tileSize||512}),r=i.getTileJSON(),s=i.getTileGrid(),o=Le(t.projection||"EPSG:3857"),a=dI(r,o),l=o.getExtent(),c=r.minzoom||0,u=r.maxzoom||22,h={attributions:i.getAttributions(),projection:o,tileGrid:new wl({origin:l?Kn(l):s.getOrigin(0),extent:a||s.getExtent(),minZoom:c,resolutions:uI(o,e.tileSize).slice(0,u+1),tileSize:s.getTileSize(0)})};return Array.isArray(r.tiles)?h.urls=r.tiles:h.url=r.tiles,h}function gI(n,e,t,i){const r={id:n.id,type:n.type},s=n.paint||{};r.paint=s,Ft.zoom=cc(e,t.resolutions||gn),Ft.distanceFromCenter=0;let o;const a=te(r,"paint","background-color",at,i);return s["background-opacity"]!==void 0&&(o=te(r,"paint","background-opacity",at,i)),te(r,"layout","visibility",at,i)==="none"?void 0:Wi(a,o)}function pI(n,e,t){const i=wt?{style:{}}:document.createElement("div");return i.className="ol-mapbox-style-background",i.style.position="absolute",i.style.width="100%",i.style.height="100%",new qr({source:new ls({}),render(r){const s=gI(n,r.viewState.resolution,e,t);return i.style.backgroundColor=s,i}})}function Z_(n,e,t){return new Promise(function(i,r){z_(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=Y_(n,s,t);a.tileLoadFunction=o,a.format=new Qy({layerName:"mvt:layer"});const l=new Af(a);l.set("mapbox-source",n),i(l)}).catch(r)})}function mI(n,e,t){const i=new Jo({declutter:!0,visible:!1});return Z_(n,e,t).then(function(r){i.setSource(r)}).catch(function(r){i.setSource(void 0)}),i}function q_(n){return`{bbox-${(n?n.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function yI(n,e,t){return new Promise(function(i,r){z_(n,e,t).then(function({tileJson:s,tileLoadFunction:o}){const a=new y_({interpolate:t.interpolate===void 0?!0:t.interpolate,transition:0,crossOrigin:"anonymous",tileJSON:s});a.tileGrid=Y_(n,s,t).tileGrid,t.projection&&(a.projection=Le(t.projection));const l=a.getTileUrlFunction();o&&a.setTileLoadFunction(o),a.setTileUrlFunction(function(c,u,h){const f=q_(h);let d=l(c,u,h);if(d.indexOf(f)!=-1){const g=a.getTileGrid().getTileCoordExtent(c);d=d.replace(f,g.toString())}return d}),a.set("mapbox-source",n),i(a)}).catch(function(s){r(s)})})}function $f(n,e,t){const i=new Nh;return yI(n,e,t).then(function(r){i.setSource(r)}).catch(function(){i.setSource(void 0)}),i}function H_(n,e,t){const i=t.projection?new Zy({dataProjection:t.projection}):new Zy,r=n.data,s={};if(typeof r=="string"){const[a]=oc(r,t.accessToken,t.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(a)){const c=(h,f,d)=>{const g=q_(d);return a.replace(g,`${h.join(",")}`)},u=new Cs({attributions:n.attribution,format:i,loader:(h,f,d,g,p)=>{const m=typeof c=="function"?c(h,f,d):c;Rs("GeoJSON",m,t).then(y=>{const _=u.getFormat().readFeatures(y,{featureProjection:d});u.addFeatures(_),g(_)}).catch(y=>{u.removeLoadedExtent(h),p()})},strategy:yS});return u.set("mapbox-source",n),u}const l=new Cs({attributions:n.attribution,format:i,url:a,loader:(c,u,h,f,d)=>{Rs("GeoJSON",a,t).then(g=>{const p=l.getFormat().readFeatures(g,{featureProjection:h});l.addFeatures(p),f(p)}).catch(g=>{l.removeLoadedExtent(c),d()})}});return l}s.features=i.readFeatures(r,{featureProjection:oo()||"EPSG:3857"});const o=new Cs(Object.assign({attributions:n.attribution,format:i},s));return o.set("mapbox-source",n),o}function _I(n,e,t){return new ic({declutter:!0,source:H_(n,e,t),visible:!1})}function xI(n,e,t){function i(){const r=e.get("mapbox-style");if(!r)return;const s=Ym(r.layers),o=n.get("mapbox-layers"),a=s.filter(function(l){return o.includes(l.id)}).some(function(l){return!l.layout||te(l,"layout","visibility",at,t)==="visible"});n.get("visible")!==a&&n.setVisible(a)}n.on("change",i),i()}function vI(n,e,t,i){t=K_(n.layers,t);const r=Gf(n),s=t.type;let o=t.source;const a=n.sources[o];let l;if(s=="background")l=pI(t,i,r),o=void 0;else if(a.type=="vector")l=mI(a,e,i);else if(a.type=="raster"){if(!!Object.keys(t.paint||{}).find(u=>oI.includes(u))){const u=$f(a,e,i);l=nI(u),rI(l,t,i,r)}else l=$f(a,e,i);l.setVisible(t.layout?te(t,"layout","visibility",at,r)!=="none":!0),l.on("prerender",aI(t,l,r))}else if(a.type=="geojson")l=_I(a,e,i);else if(a.type=="raster-dem"&&t.type=="hillshade"){const c=$f(a,e,i);l=iI(c),sI(l,a,t,i,r),l.setVisible(t.layout?te(t,"layout","visibility",at,r)!=="none":!0)}return l&&l.set("mapbox-source",o),l}function J_(n,e,t,i){n.schema&&Object.assign(Pf,Object.keys(n.schema).reduce((h,f)=>(h[f]=n.schema[f]?.default,h),{}));const r=[];let s=null;if(e instanceof is){if(s=e.getView(),!s.isDef()&&!s.getRotation()&&!s.getResolutions()){const h=i.projection?Le(i.projection):s.getProjection();s=new un(Object.assign(s.getProperties(),{maxResolution:gn[0]/bi[h.getUnits()],projection:i.projection||s.getProjection()})),e.setView(s)}"center"in n&&!s.getCenter()&&s.setCenter(bu(n.center,s.getProjection())),"zoom"in n&&s.getZoom()===void 0&&s.setResolution(gn[0]/bi[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,u;for(let h=0,f=o.length;h<f;++h){const d=K_(o,o[h]),g=d.type;if(cI.includes(g))u=d.source,(!u||u!=c)&&(a.length&&(r.push(Q_(l,a,n,t,e,i)),a=[]),l=vI(n,t,d,i),l instanceof ic||l instanceof Jo||(a=[]),c=l.get("mapbox-source")),a.push(d.id);else{console.warn(`layers[${h}].type "${g}" not supported`);continue}}return r.push(Q_(l,a,n,t,e,i)),Promise.all(r)}function wI(n,e,t={}){let i,r;if(wt){if(!(n instanceof is)&&!(n instanceof Mi))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 is({target:n}):r=n;if(typeof e=="string"){const s=e.startsWith("data:")?location.href:sc(e,t.accessToken);t=$_(s,t),i=new Promise(function(o,a){k_(e,t).then(function(l){J_(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){J_(e,r,!t.styleUrl||t.styleUrl.startsWith("data:")?location.href:sc(t.styleUrl,t.accessToken),t).then(function(){s(r)}).catch(o)});return i}function Q_(n,e,t,i,r,s={}){let o=24,a=0;const l=t.layers;for(let c=0,u=l.length;c<u;++c){const h=l[c];e.indexOf(h.id)!==-1&&(o=Math.min("minzoom"in h?h.minzoom:0,o),a=Math.max("maxzoom"in h?h.maxzoom:24,a))}return new Promise(function(c,u){const h=function(){const d=n.getSource();if(!d||d.getState()==="error"){u(new Error("Error accessing data for source "+n.get("mapbox-source")));return}if("getTileGrid"in d){const g=d.getTileGrid();if(g){const p=g.getMinZoom();(o>0||p>0)&&n.setMaxResolution(Math.min(ea(Math.max(0,o-1e-12),gn),ea(Math.max(0,p-1e-12),g.getResolutions()))),a<24&&n.setMinResolution(ea(a,gn))}}else o>0&&n.setMaxResolution(ea(Math.max(0,o-1e-12),gn));d instanceof Cs||d instanceof Af?hI(n,t,e,Object.assign({styleUrl:i},s)).then(function(){xI(n,r,Gf(t)),c()}).catch(u):c()};n.set("mapbox-layers",e);const f=r.getLayers();f.getArray().indexOf(n)===-1&&f.push(n),n.getSource()?h():n.once("change:source",h)})}const EI="EPSG:3857",bI=[9.254419,50.102223],CI=({centre:n,map:e,style:t,target:i}={})=>{const r=wa(e);ow();const s=()=>{const l=Ns(t);if(l){const c=new Mi;return wI(c,l),c}else return new Nh({source:new mC})},o=()=>new un({center:Ns(n)||bI,minZoom:1,projection:EI,zoom:4}),a=()=>{r.value||(r.value=new is),r.value.setTarget(i),r.value.setView(o()),r.value.setLayers([s()])};return pi(wa(t),()=>{r.value?.setLayers([s()])}),Gd(()=>{a()}),{map:r}};class TI extends Cs{constructor(e){e=e||{},super({attributions:e.attributions,wrapX:e.wrapX}),this.resolution=void 0,this.distance=e.distance!==void 0?e.distance:20,this.minDistance=e.minDistance||0,this.interpolationRatio=0,this.features=[],this.geometryFunction=e.geometryFunction||function(t){const i=t.getGeometry();return Oe(!i||i.getType()==="Point","The default `geometryFunction` can only handle `Point` or null geometries"),i},this.createCustomCluster_=e.createCluster,this.source=null,this.boundRefresh_=this.refresh.bind(this),this.updateDistance(this.distance,this.minDistance),this.setSource(e.source||null)}clear(e){this.features.length=0,super.clear(e)}getDistance(){return this.distance}getSource(){return this.source}loadFeatures(e,t,i){this.source?.loadFeatures(e,t,i),t!==this.resolution&&(this.resolution=t,this.refresh())}setDistance(e){this.updateDistance(e,this.minDistance)}setMinDistance(e){this.updateDistance(this.distance,e)}getMinDistance(){return this.minDistance}setSource(e){this.source&&this.source.removeEventListener(de.CHANGE,this.boundRefresh_),this.source=e,e&&e.addEventListener(de.CHANGE,this.boundRefresh_),this.refresh()}refresh(){this.clear(),this.cluster(),this.addFeatures(this.features)}updateDistance(e,t){const i=e===0?0:Math.min(t,e)/e,r=e!==this.distance||this.interpolationRatio!==i;this.distance=e,this.minDistance=t,this.interpolationRatio=i,r&&this.refresh()}cluster(){if(this.resolution===void 0||!this.source)return;const e=Bt(),t=this.distance*this.resolution,i=this.source.getFeatures(),r={};for(let s=0,o=i.length;s<o;s++){const a=i[s];if(!(_e(a)in r)){const l=this.geometryFunction(a);if(l){const c=l.getCoordinates();cu(c,e),Xn(e,t,e);const u=this.source.getFeaturesInExtent(e).filter(function(h){const f=_e(h);return f in r?!1:(r[f]=!0,!0)});this.features.push(this.createCluster(u,e))}}}}createCluster(e,t){const i=[0,0];for(let a=e.length-1;a>=0;--a){const l=this.geometryFunction(e[a]);l?Hg(i,l.getCoordinates()):e.splice(a,1)}Jg(i,1/e.length);const r=zt(t),s=this.interpolationRatio,o=new qn([i[0]*(1-s)+r[0]*s,i[1]*(1-s)+r[1]*s]);return this.createCustomCluster_?this.createCustomCluster_(o,e):new ws({geometry:o,features:e})}}const RI=({data:n,map:e,pointIconSrc:t}={})=>{const i=wa(e),r=Yi(()=>n.value.features.map(u=>new ws({geometry:new qn(u.geometry.coordinates),name:u.id}))),s={};t&&(s[1]=new yt({image:new dr({src:t,width:32,height:32})}));function o(u){return u*(Math.PI/180)}const a=u=>{const h=u.get("features"),f=h?.length||0,d=i.value.getView().getZoom();return d>=16&&f>=2?h.map((p,m)=>{const y=.00425/d,_=o(360)/f*m,w=y*Math.sin(_),x=y*Math.cos(_),v=p.getGeometry().clone(),T=v.getCoordinates();v.translate(w,x);const R=v.getCoordinates(),C=s[1].clone();C.setGeometry(v);const S=new yt({geometry:new ki([T,R]),stroke:new dn({color:"#000",width:2})}),L=new yt({image:new fr({radius:4,stroke:new dn({color:"#000"}),fill:new $t({color:"#000"})}),geometry:p.getGeometry()});return[C,S,L]}).flat():(s[f]||(s[f]=new yt({image:new fr({radius:14,stroke:new dn({color:"#000"}),fill:new $t({color:"#000"})}),text:new Ao({text:f.toString(),fill:new $t({color:"#fff"}),font:'700 0.875rem "Open Sans", "Arial", sans-serif'})})),s[f])},l=()=>new ic({source:new TI({distance:40,minDistance:20,source:new Cs({features:r.value})}),style:a}),c=()=>{n.value?.features?.length===1&&i.value.getView().setCenter(n.value.features[0].geometry.coordinates)};Cx(()=>{i.value&&n.value&&(i.value.addLayer(l()),c())})},SI="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2058_7122)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%2012C10.9%2012%2010%2011.1%2010%2010C10%208.9%2010.9%208%2012%208C13.1%208%2014%208.9%2014%2010C14%2011.1%2013.1%2012%2012%2012ZM12%202C16.2%202%2020%205.22%2020%2010.2C20%2013.52%2017.33%2017.45%2012%2022C6.67%2017.45%204%2013.52%204%2010.2C4%205.22%207.8%202%2012%202Z'%20fill='black'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2058_7122'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Kf="europeana-map-map",II={__name:"EuropeanaMap",props:{json:{type:String,default:null},style:{type:String,default:null},url:{type:String,default:null}},setup(n){const e=Or("map",null),t=Or("config",null),i=n,r=kc(null),s=Yi(()=>i.url||t?.value?.url),o=Yi(()=>i.json||t?.value?.json),a=Yi(()=>i.style||t?.value?.style);if(o.value)r.value=JSON.parse(o.value);else if(s.value)Gb(s.value).json().then(l=>{r.value=l.data.value});else throw new Error("No data JSON or URL supplied.");return CI({map:e,style:a,target:Kf}),RI({data:r,map:e,pointIconSrc:SI}),(l,c)=>(f1(),p1("div",{id:Kf,class:ha(Kf)}))}};class MI{#t;#n;#e=ya({});constructor(e,t={}){this.#n=new is,this.#e.url=t.url,this.#e.style=t.style,this.#e.json=t.json,this.#t=nv(II),this.#t.provide("config",Yi(()=>this.#e)),this.#t.provide("map",this.#n),this.#t.mount(e)}get config(){return this.#e}get app(){return this.#t}get olMap(){return this.#n}set(e,t){Object.hasOwn(this.#e,e)&&(this.#e[e]=t)}}return MI})();
22
22
  //# sourceMappingURL=europeana-map.app.iife.js.map