@delta10/atlas-sdk 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Example.vue.d.ts +3 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/assets/icons/layers.svg.js +23 -0
- package/dist/assets/icons/map.svg.js +21 -0
- package/dist/assets/icons/minus.svg.js +20 -0
- package/dist/assets/icons/plus.svg.js +20 -0
- package/dist/components/Map.vue.d.ts +100 -0
- package/dist/components/Map.vue.js +7 -0
- package/dist/components/Map.vue2.js +559 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/panels/BaseLayers.vue.d.ts +23 -0
- package/dist/components/panels/BaseLayers.vue.js +7 -0
- package/dist/components/panels/BaseLayers.vue2.js +50 -0
- package/dist/components/panels/Layers.vue.d.ts +23 -0
- package/dist/components/panels/Layers.vue.js +7 -0
- package/dist/components/panels/Layers.vue2.js +35 -0
- package/dist/data/demo-data.d.ts +15 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10 -0
- package/dist/main.d.ts +1 -0
- package/dist/{assets/index-DTZ2AlyB.css → style.css} +1 -1
- package/dist/utils/projections.d.ts +5 -0
- package/dist/utils/projections.js +8 -0
- package/package.json +1 -1
- package/dist/assets/index-BxWjC_eB.js +0 -12
- package/dist/index.html +0 -14
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function i(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(s){if(s.ep)return;s.ep=!0;const r=i(s);fetch(s.href,r)}})();function hu(e){const t=Object.create(null);for(const i of e.split(","))t[i]=1;return i=>i in t}const kt={},dr=[],Xi=()=>{},Wg=()=>!1,Nl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),cu=e=>e.startsWith("onUpdate:"),ge=Object.assign,uu=(e,t)=>{const i=e.indexOf(t);i>-1&&e.splice(i,1)},u1=Object.prototype.hasOwnProperty,Rt=(e,t)=>u1.call(e,t),lt=Array.isArray,gr=e=>kl(e)==="[object Map]",Ug=e=>kl(e)==="[object Set]",ft=e=>typeof e=="function",ne=e=>typeof e=="string",Tn=e=>typeof e=="symbol",zt=e=>e!==null&&typeof e=="object",Vg=e=>(zt(e)||ft(e))&&ft(e.then)&&ft(e.catch),Xg=Object.prototype.toString,kl=e=>Xg.call(e),f1=e=>kl(e).slice(8,-1),$g=e=>kl(e)==="[object Object]",fu=e=>ne(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,go=hu(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),jl=e=>{const t=Object.create(null);return(i=>t[i]||(t[i]=e(i)))},d1=/-\w/g,ns=jl(e=>e.replace(d1,t=>t.slice(1).toUpperCase())),g1=/\B([A-Z])/g,Ns=jl(e=>e.replace(g1,"-$1").toLowerCase()),Kg=jl(e=>e.charAt(0).toUpperCase()+e.slice(1)),Sh=jl(e=>e?`on${Kg(e)}`:""),Zn=(e,t)=>!Object.is(e,t),Mh=(e,...t)=>{for(let i=0;i<e.length;i++)e[i](...t)},Yg=(e,t,i,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:i})},_1=e=>{const t=parseFloat(e);return isNaN(t)?e:t},m1=e=>{const t=ne(e)?Number(e):NaN;return isNaN(t)?e:t};let Of;const Bl=()=>Of||(Of=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function zl(e){if(lt(e)){const t={};for(let i=0;i<e.length;i++){const n=e[i],s=ne(n)?x1(n):zl(n);if(s)for(const r in s)t[r]=s[r]}return t}else if(ne(e)||zt(e))return e}const p1=/;(?![^(]*\))/g,y1=/:([^]+)/,v1=/\/\*[^]*?\*\//g;function x1(e){const t={};return e.replace(v1,"").split(p1).forEach(i=>{if(i){const n=i.split(y1);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Po(e){let t="";if(ne(e))t=e;else if(lt(e))for(let i=0;i<e.length;i++){const n=Po(e[i]);n&&(t+=n+" ")}else if(zt(e))for(const i in e)e[i]&&(t+=i+" ");return t.trim()}const E1="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",S1=hu(E1);function qg(e){return!!e||e===""}const Hg=e=>!!(e&&e.__v_isRef===!0),ea=e=>ne(e)?e:e==null?"":lt(e)||zt(e)&&(e.toString===Xg||!ft(e.toString))?Hg(e)?ea(e.value):JSON.stringify(e,Zg,2):String(e),Zg=(e,t)=>Hg(t)?Zg(e,t.value):gr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((i,[n,s],r)=>(i[wh(n,r)+" =>"]=s,i),{})}:Ug(t)?{[`Set(${t.size})`]:[...t.values()].map(i=>wh(i))}:Tn(t)?wh(t):zt(t)&&!lt(t)&&!$g(t)?String(t):t,wh=(e,t="")=>{var i;return Tn(e)?`Symbol(${(i=e.description)!=null?i:t})`:e};let $e;class M1{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=$e,!t&&$e&&(this.index=($e.scopes||($e.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,i;if(this.scopes)for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].pause();for(t=0,i=this.effects.length;t<i;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,i;if(this.scopes)for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].resume();for(t=0,i=this.effects.length;t<i;t++)this.effects[t].resume()}}run(t){if(this._active){const i=$e;try{return $e=this,t()}finally{$e=i}}}on(){++this._on===1&&(this.prevScope=$e,$e=this)}off(){this._on>0&&--this._on===0&&($e=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let i,n;for(i=0,n=this.effects.length;i<n;i++)this.effects[i].stop();for(this.effects.length=0,i=0,n=this.cleanups.length;i<n;i++)this.cleanups[i]();if(this.cleanups.length=0,this.scopes){for(i=0,n=this.scopes.length;i<n;i++)this.scopes[i].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function w1(){return $e}let Dt;const Ch=new WeakSet;class Jg{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,$e&&$e.active&&$e.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ch.has(this)&&(Ch.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||t_(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ff(this),e_(this);const t=Dt,i=Pi;Dt=this,Pi=!0;try{return this.fn()}finally{i_(this),Dt=t,Pi=i,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)_u(t);this.deps=this.depsTail=void 0,Ff(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ch.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){pc(this)&&this.run()}get dirty(){return pc(this)}}let Qg=0,_o,mo;function t_(e,t=!1){if(e.flags|=8,t){e.next=mo,mo=e;return}e.next=_o,_o=e}function du(){Qg++}function gu(){if(--Qg>0)return;if(mo){let t=mo;for(mo=void 0;t;){const i=t.next;t.next=void 0,t.flags&=-9,t=i}}let e;for(;_o;){let t=_o;for(_o=void 0;t;){const i=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=i}}if(e)throw e}function e_(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function i_(e){let t,i=e.depsTail,n=i;for(;n;){const s=n.prevDep;n.version===-1?(n===i&&(i=s),_u(n),C1(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=s}e.deps=t,e.depsTail=i}function pc(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(n_(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function n_(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===bo)||(e.globalVersion=bo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!pc(e))))return;e.flags|=2;const t=e.dep,i=Dt,n=Pi;Dt=e,Pi=!0;try{e_(e);const s=e.fn(e._value);(t.version===0||Zn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{Dt=i,Pi=n,i_(e),e.flags&=-3}}function _u(e,t=!1){const{dep:i,prevSub:n,nextSub:s}=e;if(n&&(n.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=n,e.nextSub=void 0),i.subs===e&&(i.subs=n,!n&&i.computed)){i.computed.flags&=-5;for(let r=i.computed.deps;r;r=r.nextDep)_u(r,!0)}!t&&!--i.sc&&i.map&&i.map.delete(i.key)}function C1(e){const{prevDep:t,nextDep:i}=e;t&&(t.nextDep=i,e.prevDep=void 0),i&&(i.prevDep=t,e.nextDep=void 0)}let Pi=!0;const s_=[];function Sn(){s_.push(Pi),Pi=!1}function Mn(){const e=s_.pop();Pi=e===void 0?!0:e}function Ff(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const i=Dt;Dt=void 0;try{t()}finally{Dt=i}}}let bo=0;class T1{constructor(t,i){this.sub=t,this.dep=i,this.version=i.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class mu{constructor(t){this.computed=t,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(t){if(!Dt||!Pi||Dt===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==Dt)i=this.activeLink=new T1(Dt,this),Dt.deps?(i.prevDep=Dt.depsTail,Dt.depsTail.nextDep=i,Dt.depsTail=i):Dt.deps=Dt.depsTail=i,r_(i);else if(i.version===-1&&(i.version=this.version,i.nextDep)){const n=i.nextDep;n.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=n),i.prevDep=Dt.depsTail,i.nextDep=void 0,Dt.depsTail.nextDep=i,Dt.depsTail=i,Dt.deps===i&&(Dt.deps=n)}return i}trigger(t){this.version++,bo++,this.notify(t)}notify(t){du();try{for(let i=this.subs;i;i=i.prevSub)i.sub.notify()&&i.sub.dep.notify()}finally{gu()}}}function r_(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)r_(n)}const i=e.dep.subs;i!==e&&(e.prevSub=i,i&&(i.nextSub=e)),e.dep.subs=e}}const tl=new WeakMap,Ps=Symbol(""),yc=Symbol(""),Ao=Symbol("");function Le(e,t,i){if(Pi&&Dt){let n=tl.get(e);n||tl.set(e,n=new Map);let s=n.get(i);s||(n.set(i,s=new mu),s.map=n,s.key=i),s.track()}}function un(e,t,i,n,s,r){const o=tl.get(e);if(!o){bo++;return}const a=l=>{l&&l.trigger()};if(du(),t==="clear")o.forEach(a);else{const l=lt(e),h=l&&fu(i);if(l&&i==="length"){const c=Number(n);o.forEach((u,f)=>{(f==="length"||f===Ao||!Tn(f)&&f>=c)&&a(u)})}else switch((i!==void 0||o.has(void 0))&&a(o.get(i)),h&&a(o.get(Ao)),t){case"add":l?h&&a(o.get("length")):(a(o.get(Ps)),gr(e)&&a(o.get(yc)));break;case"delete":l||(a(o.get(Ps)),gr(e)&&a(o.get(yc)));break;case"set":gr(e)&&a(o.get(Ps));break}}gu()}function R1(e,t){const i=tl.get(e);return i&&i.get(t)}function Vs(e){const t=Mt(e);return t===e?t:(Le(t,"iterate",Ao),vi(e)?t:t.map(Se))}function Wl(e){return Le(e=Mt(e),"iterate",Ao),e}const I1={__proto__:null,[Symbol.iterator](){return Th(this,Symbol.iterator,Se)},concat(...e){return Vs(this).concat(...e.map(t=>lt(t)?Vs(t):t))},entries(){return Th(this,"entries",e=>(e[1]=Se(e[1]),e))},every(e,t){return tn(this,"every",e,t,void 0,arguments)},filter(e,t){return tn(this,"filter",e,t,i=>i.map(Se),arguments)},find(e,t){return tn(this,"find",e,t,Se,arguments)},findIndex(e,t){return tn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return tn(this,"findLast",e,t,Se,arguments)},findLastIndex(e,t){return tn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return tn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Rh(this,"includes",e)},indexOf(...e){return Rh(this,"indexOf",e)},join(e){return Vs(this).join(e)},lastIndexOf(...e){return Rh(this,"lastIndexOf",e)},map(e,t){return tn(this,"map",e,t,void 0,arguments)},pop(){return qr(this,"pop")},push(...e){return qr(this,"push",e)},reduce(e,...t){return Gf(this,"reduce",e,t)},reduceRight(e,...t){return Gf(this,"reduceRight",e,t)},shift(){return qr(this,"shift")},some(e,t){return tn(this,"some",e,t,void 0,arguments)},splice(...e){return qr(this,"splice",e)},toReversed(){return Vs(this).toReversed()},toSorted(e){return Vs(this).toSorted(e)},toSpliced(...e){return Vs(this).toSpliced(...e)},unshift(...e){return qr(this,"unshift",e)},values(){return Th(this,"values",Se)}};function Th(e,t,i){const n=Wl(e),s=n[t]();return n!==e&&!vi(e)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.done||(r.value=i(r.value)),r}),s}const P1=Array.prototype;function tn(e,t,i,n,s,r){const o=Wl(e),a=o!==e&&!vi(e),l=o[t];if(l!==P1[t]){const u=l.apply(e,r);return a?Se(u):u}let h=i;o!==e&&(a?h=function(u,f){return i.call(this,Se(u),f,e)}:i.length>2&&(h=function(u,f){return i.call(this,u,f,e)}));const c=l.call(o,h,n);return a&&s?s(c):c}function Gf(e,t,i,n){const s=Wl(e);let r=i;return s!==e&&(vi(e)?i.length>3&&(r=function(o,a,l){return i.call(this,o,a,l,e)}):r=function(o,a,l){return i.call(this,o,Se(a),l,e)}),s[t](r,...n)}function Rh(e,t,i){const n=Mt(e);Le(n,"iterate",Ao);const s=n[t](...i);return(s===-1||s===!1)&&vu(i[0])?(i[0]=Mt(i[0]),n[t](...i)):s}function qr(e,t,i=[]){Sn(),du();const n=Mt(e)[t].apply(e,i);return gu(),Mn(),n}const b1=hu("__proto__,__v_isRef,__isVue"),o_=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Tn));function A1(e){Tn(e)||(e=String(e));const t=Mt(this);return Le(t,"has",e),t.hasOwnProperty(e)}class a_{constructor(t=!1,i=!1){this._isReadonly=t,this._isShallow=i}get(t,i,n){if(i==="__v_skip")return t.__v_skip;const s=this._isReadonly,r=this._isShallow;if(i==="__v_isReactive")return!s;if(i==="__v_isReadonly")return s;if(i==="__v_isShallow")return r;if(i==="__v_raw")return n===(s?r?z1:u_:r?c_:h_).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=lt(t);if(!s){let l;if(o&&(l=I1[i]))return l;if(i==="hasOwnProperty")return A1}const a=Reflect.get(t,i,de(t)?t:n);if((Tn(i)?o_.has(i):b1(i))||(s||Le(t,"get",i),r))return a;if(de(a)){const l=o&&fu(i)?a:a.value;return s&&zt(l)?xc(l):l}return zt(a)?s?xc(a):ia(a):a}}class l_ extends a_{constructor(t=!1){super(!1,t)}set(t,i,n,s){let r=t[i];if(!this._isShallow){const l=ss(r);if(!vi(n)&&!ss(n)&&(r=Mt(r),n=Mt(n)),!lt(t)&&de(r)&&!de(n))return l||(r.value=n),!0}const o=lt(t)&&fu(i)?Number(i)<t.length:Rt(t,i),a=Reflect.set(t,i,n,de(t)?t:s);return t===Mt(s)&&(o?Zn(n,r)&&un(t,"set",i,n):un(t,"add",i,n)),a}deleteProperty(t,i){const n=Rt(t,i);t[i];const s=Reflect.deleteProperty(t,i);return s&&n&&un(t,"delete",i,void 0),s}has(t,i){const n=Reflect.has(t,i);return(!Tn(i)||!o_.has(i))&&Le(t,"has",i),n}ownKeys(t){return Le(t,"iterate",lt(t)?"length":Ps),Reflect.ownKeys(t)}}class L1 extends a_{constructor(t=!1){super(!0,t)}set(t,i){return!0}deleteProperty(t,i){return!0}}const O1=new l_,F1=new L1,G1=new l_(!0);const vc=e=>e,pa=e=>Reflect.getPrototypeOf(e);function D1(e,t,i){return function(...n){const s=this.__v_raw,r=Mt(s),o=gr(r),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,h=s[e](...n),c=i?vc:t?el:Se;return!t&&Le(r,"iterate",l?yc:Ps),{next(){const{value:u,done:f}=h.next();return f?{value:u,done:f}:{value:a?[c(u[0]),c(u[1])]:c(u),done:f}},[Symbol.iterator](){return this}}}}function ya(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function N1(e,t){const i={get(s){const r=this.__v_raw,o=Mt(r),a=Mt(s);e||(Zn(s,a)&&Le(o,"get",s),Le(o,"get",a));const{has:l}=pa(o),h=t?vc:e?el:Se;if(l.call(o,s))return h(r.get(s));if(l.call(o,a))return h(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!e&&Le(Mt(s),"iterate",Ps),s.size},has(s){const r=this.__v_raw,o=Mt(r),a=Mt(s);return e||(Zn(s,a)&&Le(o,"has",s),Le(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=Mt(a),h=t?vc:e?el:Se;return!e&&Le(l,"iterate",Ps),a.forEach((c,u)=>s.call(r,h(c),h(u),o))}};return ge(i,e?{add:ya("add"),set:ya("set"),delete:ya("delete"),clear:ya("clear")}:{add(s){!t&&!vi(s)&&!ss(s)&&(s=Mt(s));const r=Mt(this);return pa(r).has.call(r,s)||(r.add(s),un(r,"add",s,s)),this},set(s,r){!t&&!vi(r)&&!ss(r)&&(r=Mt(r));const o=Mt(this),{has:a,get:l}=pa(o);let h=a.call(o,s);h||(s=Mt(s),h=a.call(o,s));const c=l.call(o,s);return o.set(s,r),h?Zn(r,c)&&un(o,"set",s,r):un(o,"add",s,r),this},delete(s){const r=Mt(this),{has:o,get:a}=pa(r);let l=o.call(r,s);l||(s=Mt(s),l=o.call(r,s)),a&&a.call(r,s);const h=r.delete(s);return l&&un(r,"delete",s,void 0),h},clear(){const s=Mt(this),r=s.size!==0,o=s.clear();return r&&un(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{i[s]=D1(s,e,t)}),i}function pu(e,t){const i=N1(e,t);return(n,s,r)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?n:Reflect.get(Rt(i,s)&&s in n?i:n,s,r)}const k1={get:pu(!1,!1)},j1={get:pu(!1,!0)},B1={get:pu(!0,!1)};const h_=new WeakMap,c_=new WeakMap,u_=new WeakMap,z1=new WeakMap;function W1(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function U1(e){return e.__v_skip||!Object.isExtensible(e)?0:W1(f1(e))}function ia(e){return ss(e)?e:yu(e,!1,O1,k1,h_)}function V1(e){return yu(e,!1,G1,j1,c_)}function xc(e){return yu(e,!0,F1,B1,u_)}function yu(e,t,i,n,s){if(!zt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=U1(e);if(r===0)return e;const o=s.get(e);if(o)return o;const a=new Proxy(e,r===2?n:i);return s.set(e,a),a}function _r(e){return ss(e)?_r(e.__v_raw):!!(e&&e.__v_isReactive)}function ss(e){return!!(e&&e.__v_isReadonly)}function vi(e){return!!(e&&e.__v_isShallow)}function vu(e){return e?!!e.__v_raw:!1}function Mt(e){const t=e&&e.__v_raw;return t?Mt(t):e}function X1(e){return!Rt(e,"__v_skip")&&Object.isExtensible(e)&&Yg(e,"__v_skip",!0),e}const Se=e=>zt(e)?ia(e):e,el=e=>zt(e)?xc(e):e;function de(e){return e?e.__v_isRef===!0:!1}function Nt(e){return f_(e,!1)}function Lo(e){return f_(e,!0)}function f_(e,t){return de(e)?e:new $1(e,t)}class $1{constructor(t,i){this.dep=new mu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=i?t:Mt(t),this._value=i?t:Se(t),this.__v_isShallow=i}get value(){return this.dep.track(),this._value}set value(t){const i=this._rawValue,n=this.__v_isShallow||vi(t)||ss(t);t=n?t:Mt(t),Zn(t,i)&&(this._rawValue=t,this._value=n?t:Se(t),this.dep.trigger())}}function Ut(e){return de(e)?e.value:e}const K1={get:(e,t,i)=>t==="__v_raw"?e:Ut(Reflect.get(e,t,i)),set:(e,t,i,n)=>{const s=e[t];return de(s)&&!de(i)?(s.value=i,!0):Reflect.set(e,t,i,n)}};function d_(e){return _r(e)?e:new Proxy(e,K1)}function Ul(e){const t=lt(e)?new Array(e.length):{};for(const i in e)t[i]=q1(e,i);return t}class Y1{constructor(t,i,n){this._object=t,this._key=i,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return R1(Mt(this._object),this._key)}}function q1(e,t,i){const n=e[t];return de(n)?n:new Y1(e,t,i)}class H1{constructor(t,i,n){this.fn=t,this.setter=i,this._value=void 0,this.dep=new mu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=bo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!i,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Dt!==this)return t_(this,!0),!0}get value(){const t=this.dep.track();return n_(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Z1(e,t,i=!1){let n,s;return ft(e)?n=e:(n=e.get,s=e.set),new H1(n,s,i)}const va={},il=new WeakMap;let xs;function J1(e,t=!1,i=xs){if(i){let n=il.get(i);n||il.set(i,n=[]),n.push(e)}}function Q1(e,t,i=kt){const{immediate:n,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=i,h=v=>s?v:vi(v)||s===!1||s===0?Un(v,1):Un(v);let c,u,f,d,g=!1,_=!1;if(de(e)?(u=()=>e.value,g=vi(e)):_r(e)?(u=()=>h(e),g=!0):lt(e)?(_=!0,g=e.some(v=>_r(v)||vi(v)),u=()=>e.map(v=>{if(de(v))return v.value;if(_r(v))return h(v);if(ft(v))return l?l(v,2):v()})):ft(e)?t?u=l?()=>l(e,2):e:u=()=>{if(f){Sn();try{f()}finally{Mn()}}const v=xs;xs=c;try{return l?l(e,3,[d]):e(d)}finally{xs=v}}:u=Xi,t&&s){const v=u,M=s===!0?1/0:s;u=()=>Un(v(),M)}const m=w1(),p=()=>{c.stop(),m&&m.active&&uu(m.effects,c)};if(r&&t){const v=t;t=(...M)=>{v(...M),p()}}let y=_?new Array(e.length).fill(va):va;const S=v=>{if(!(!(c.flags&1)||!c.dirty&&!v))if(t){const M=c.run();if(s||g||(_?M.some((C,P)=>Zn(C,y[P])):Zn(M,y))){f&&f();const C=xs;xs=c;try{const P=[M,y===va?void 0:_&&y[0]===va?[]:y,d];y=M,l?l(t,3,P):t(...P)}finally{xs=C}}}else c.run()};return a&&a(S),c=new Jg(u),c.scheduler=o?()=>o(S,!1):S,d=v=>J1(v,!1,c),f=c.onStop=()=>{const v=il.get(c);if(v){if(l)l(v,4);else for(const M of v)M();il.delete(c)}},t?n?S(!0):y=c.run():o?o(S.bind(null,!0),!0):c.run(),p.pause=c.pause.bind(c),p.resume=c.resume.bind(c),p.stop=p,p}function Un(e,t=1/0,i){if(t<=0||!zt(e)||e.__v_skip||(i=i||new Map,(i.get(e)||0)>=t))return e;if(i.set(e,t),t--,de(e))Un(e.value,t,i);else if(lt(e))for(let n=0;n<e.length;n++)Un(e[n],t,i);else if(Ug(e)||gr(e))e.forEach(n=>{Un(n,t,i)});else if($g(e)){for(const n in e)Un(e[n],t,i);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Un(e[n],t,i)}return e}function na(e,t,i,n){try{return n?e(...n):e()}catch(s){Vl(s,t,i)}}function Oi(e,t,i,n){if(ft(e)){const s=na(e,t,i,n);return s&&Vg(s)&&s.catch(r=>{Vl(r,t,i)}),s}if(lt(e)){const s=[];for(let r=0;r<e.length;r++)s.push(Oi(e[r],t,i,n));return s}}function Vl(e,t,i,n=!0){const s=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||kt;if(t){let a=t.parent;const l=t.proxy,h=`https://vuejs.org/error-reference/#runtime-${i}`;for(;a;){const c=a.ec;if(c){for(let u=0;u<c.length;u++)if(c[u](e,l,h)===!1)return}a=a.parent}if(r){Sn(),na(r,null,10,[e,l,h]),Mn();return}}tp(e,i,s,n,o)}function tp(e,t,i,n=!0,s=!1){if(s)throw e;console.error(e)}const je=[];let ji=-1;const mr=[];let Bn=null,Qs=0;const g_=Promise.resolve();let nl=null;function __(e){const t=nl||g_;return e?t.then(this?e.bind(this):e):t}function ep(e){let t=ji+1,i=je.length;for(;t<i;){const n=t+i>>>1,s=je[n],r=Oo(s);r<e||r===e&&s.flags&2?t=n+1:i=n}return t}function xu(e){if(!(e.flags&1)){const t=Oo(e),i=je[je.length-1];!i||!(e.flags&2)&&t>=Oo(i)?je.push(e):je.splice(ep(t),0,e),e.flags|=1,m_()}}function m_(){nl||(nl=g_.then(y_))}function ip(e){lt(e)?mr.push(...e):Bn&&e.id===-1?Bn.splice(Qs+1,0,e):e.flags&1||(mr.push(e),e.flags|=1),m_()}function Df(e,t,i=ji+1){for(;i<je.length;i++){const n=je[i];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;je.splice(i,1),i--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function p_(e){if(mr.length){const t=[...new Set(mr)].sort((i,n)=>Oo(i)-Oo(n));if(mr.length=0,Bn){Bn.push(...t);return}for(Bn=t,Qs=0;Qs<Bn.length;Qs++){const i=Bn[Qs];i.flags&4&&(i.flags&=-2),i.flags&8||i(),i.flags&=-2}Bn=null,Qs=0}}const Oo=e=>e.id==null?e.flags&2?-1:1/0:e.id;function y_(e){try{for(ji=0;ji<je.length;ji++){const t=je[ji];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),na(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ji<je.length;ji++){const t=je[ji];t&&(t.flags&=-2)}ji=-1,je.length=0,p_(),nl=null,(je.length||mr.length)&&y_()}}let Je=null,v_=null;function sl(e){const t=Je;return Je=e,v_=e&&e.type.__scopeId||null,t}function jn(e,t=Je,i){if(!t||e._n)return e;const n=(...s)=>{n._d&&ll(-1);const r=sl(t);let o;try{o=e(...s)}finally{sl(r),n._d&&ll(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function gs(e,t,i,n){const s=e.dirs,r=t&&t.dirs;for(let o=0;o<s.length;o++){const a=s[o];r&&(a.oldValue=r[o].value);let l=a.dir[n];l&&(Sn(),Oi(l,i,8,[e.el,a,e,t]),Mn())}}const np=Symbol("_vte"),x_=e=>e.__isTeleport,hn=Symbol("_leaveCb"),xa=Symbol("_enterCb");function sp(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ei(()=>{e.isMounted=!0}),Eu(()=>{e.isUnmounting=!0}),e}const di=[Function,Array],E_={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:di,onEnter:di,onAfterEnter:di,onEnterCancelled:di,onBeforeLeave:di,onLeave:di,onAfterLeave:di,onLeaveCancelled:di,onBeforeAppear:di,onAppear:di,onAfterAppear:di,onAppearCancelled:di},S_=e=>{const t=e.subTree;return t.component?S_(t.component):t},rp={name:"BaseTransition",props:E_,setup(e,{slots:t}){const i=ql(),n=sp();return()=>{const s=t.default&&C_(t.default(),!0);if(!s||!s.length)return;const r=M_(s),o=Mt(e),{mode:a}=o;if(n.isLeaving)return Ih(r);const l=Nf(r);if(!l)return Ih(r);let h=Ec(l,o,n,i,u=>h=u);l.type!==Oe&&Fo(l,h);let c=i.subTree&&Nf(i.subTree);if(c&&c.type!==Oe&&!Ms(c,l)&&S_(i).type!==Oe){let u=Ec(c,o,n,i);if(Fo(c,u),a==="out-in"&&l.type!==Oe)return n.isLeaving=!0,u.afterLeave=()=>{n.isLeaving=!1,i.job.flags&8||i.update(),delete u.afterLeave,c=void 0},Ih(r);a==="in-out"&&l.type!==Oe?u.delayLeave=(f,d,g)=>{const _=w_(n,c);_[String(c.key)]=c,f[hn]=()=>{d(),f[hn]=void 0,delete h.delayedLeave,c=void 0},h.delayedLeave=()=>{g(),delete h.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return r}}};function M_(e){let t=e[0];if(e.length>1){for(const i of e)if(i.type!==Oe){t=i;break}}return t}const op=rp;function w_(e,t){const{leavingVNodes:i}=e;let n=i.get(t.type);return n||(n=Object.create(null),i.set(t.type,n)),n}function Ec(e,t,i,n,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:h,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:f,onLeave:d,onAfterLeave:g,onLeaveCancelled:_,onBeforeAppear:m,onAppear:p,onAfterAppear:y,onAppearCancelled:S}=t,v=String(e.key),M=w_(i,e),C=(T,k)=>{T&&Oi(T,n,9,k)},P=(T,k)=>{const U=k[1];C(T,k),lt(T)?T.every(A=>A.length<=1)&&U():T.length<=1&&U()},b={mode:o,persisted:a,beforeEnter(T){let k=l;if(!i.isMounted)if(r)k=m||l;else return;T[hn]&&T[hn](!0);const U=M[v];U&&Ms(e,U)&&U.el[hn]&&U.el[hn](),C(k,[T])},enter(T){let k=h,U=c,A=u;if(!i.isMounted)if(r)k=p||h,U=y||c,A=S||u;else return;let L=!1;const V=T[xa]=tt=>{L||(L=!0,tt?C(A,[T]):C(U,[T]),b.delayedLeave&&b.delayedLeave(),T[xa]=void 0)};k?P(k,[T,V]):V()},leave(T,k){const U=String(e.key);if(T[xa]&&T[xa](!0),i.isUnmounting)return k();C(f,[T]);let A=!1;const L=T[hn]=V=>{A||(A=!0,k(),V?C(_,[T]):C(g,[T]),T[hn]=void 0,M[U]===e&&delete M[U])};M[U]=e,d?P(d,[T,L]):L()},clone(T){const k=Ec(T,t,i,n,s);return s&&s(k),k}};return b}function Ih(e){if(Xl(e))return e=rs(e),e.children=null,e}function Nf(e){if(!Xl(e))return x_(e.type)&&e.children?M_(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:i}=e;if(i){if(t&16)return i[0];if(t&32&&ft(i.default))return i.default()}}function Fo(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Fo(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function C_(e,t=!1,i){let n=[],s=0;for(let r=0;r<e.length;r++){let o=e[r];const a=i==null?o.key:String(i)+String(o.key!=null?o.key:r);o.type===ce?(o.patchFlag&128&&s++,n=n.concat(C_(o.children,t,a))):(t||o.type!==Oe)&&n.push(a!=null?rs(o,{key:a}):o)}if(s>1)for(let r=0;r<n.length;r++)n[r].patchFlag=-2;return n}function _e(e,t){return ft(e)?ge({name:e.name},t,{setup:e}):e}function T_(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const rl=new WeakMap;function po(e,t,i,n,s=!1){if(lt(e)){e.forEach((g,_)=>po(g,t&&(lt(t)?t[_]:t),i,n,s));return}if(pr(n)&&!s){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&po(e,t,i,n.component.subTree);return}const r=n.shapeFlag&4?Tu(n.component):n.el,o=s?null:r,{i:a,r:l}=e,h=t&&t.r,c=a.refs===kt?a.refs={}:a.refs,u=a.setupState,f=Mt(u),d=u===kt?Wg:g=>Rt(f,g);if(h!=null&&h!==l){if(kf(t),ne(h))c[h]=null,d(h)&&(u[h]=null);else if(de(h)){h.value=null;const g=t;g.k&&(c[g.k]=null)}}if(ft(l))na(l,a,12,[o,c]);else{const g=ne(l),_=de(l);if(g||_){const m=()=>{if(e.f){const p=g?d(l)?u[l]:c[l]:l.value;if(s)lt(p)&&uu(p,r);else if(lt(p))p.includes(r)||p.push(r);else if(g)c[l]=[r],d(l)&&(u[l]=c[l]);else{const y=[r];l.value=y,e.k&&(c[e.k]=y)}}else g?(c[l]=o,d(l)&&(u[l]=o)):_&&(l.value=o,e.k&&(c[e.k]=o))};if(o){const p=()=>{m(),rl.delete(e)};p.id=-1,rl.set(e,p),ri(p,i)}else kf(e),m()}}}function kf(e){const t=rl.get(e);t&&(t.flags|=8,rl.delete(e))}Bl().requestIdleCallback;Bl().cancelIdleCallback;const pr=e=>!!e.type.__asyncLoader,Xl=e=>e.type.__isKeepAlive;function ap(e,t){R_(e,"a",t)}function lp(e,t){R_(e,"da",t)}function R_(e,t,i=ze){const n=e.__wdc||(e.__wdc=()=>{let s=i;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if($l(t,n,i),i){let s=i.parent;for(;s&&s.parent;)Xl(s.parent.vnode)&&hp(n,t,i,s),s=s.parent}}function hp(e,t,i,n){const s=$l(t,e,n,!0);wi(()=>{uu(n[t],s)},i)}function $l(e,t,i=ze,n=!1){if(i){const s=i[e]||(i[e]=[]),r=t.__weh||(t.__weh=(...o)=>{Sn();const a=sa(i),l=Oi(t,i,e,o);return a(),Mn(),l});return n?s.unshift(r):s.push(r),r}}const Rn=e=>(t,i=ze)=>{(!No||e==="sp")&&$l(e,(...n)=>t(...n),i)},cp=Rn("bm"),ei=Rn("m"),up=Rn("bu"),fp=Rn("u"),Eu=Rn("bum"),wi=Rn("um"),dp=Rn("sp"),gp=Rn("rtg"),_p=Rn("rtc");function mp(e,t=ze){$l("ec",e,t)}const pp=Symbol.for("v-ndc");function ol(e,t,i,n){let s;const r=i,o=lt(e);if(o||ne(e)){const a=o&&_r(e);let l=!1,h=!1;a&&(l=!vi(e),h=ss(e),e=Wl(e)),s=new Array(e.length);for(let c=0,u=e.length;c<u;c++)s[c]=t(l?h?el(Se(e[c])):Se(e[c]):e[c],c,void 0,r)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,r)}else if(zt(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,r));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,h=a.length;l<h;l++){const c=a[l];s[l]=t(e[c],c,l,r)}}else s=[];return s}function qi(e,t,i={},n,s){if(Je.ce||Je.parent&&pr(Je.parent)&&Je.parent.ce){const h=Object.keys(i).length>0;return dt(),Re(ce,null,[Vt("slot",i,n)],h?-2:64)}let r=e[t];r&&r._c&&(r._d=!1),dt();const o=r&&I_(r(i)),a=i.key||o&&o.key,l=Re(ce,{key:(a&&!Tn(a)?a:`_${t}`)+(!o&&n?"_fb":"")},o||[],o&&e._===1?64:-2);return l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),r&&r._c&&(r._d=!0),l}function I_(e){return e.some(t=>Do(t)?!(t.type===Oe||t.type===ce&&!I_(t.children)):!0)?e:null}const Sc=e=>e?Y_(e)?Tu(e):Sc(e.parent):null,yo=ge(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Sc(e.parent),$root:e=>Sc(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>A_(e),$forceUpdate:e=>e.f||(e.f=()=>{xu(e.update)}),$nextTick:e=>e.n||(e.n=__.bind(e.proxy)),$watch:e=>jp.bind(e)}),Ph=(e,t)=>e!==kt&&!e.__isScriptSetup&&Rt(e,t),yp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:i,setupState:n,data:s,props:r,accessCache:o,type:a,appContext:l}=e;let h;if(t[0]!=="$"){const d=o[t];if(d!==void 0)switch(d){case 1:return n[t];case 2:return s[t];case 4:return i[t];case 3:return r[t]}else{if(Ph(n,t))return o[t]=1,n[t];if(s!==kt&&Rt(s,t))return o[t]=2,s[t];if((h=e.propsOptions[0])&&Rt(h,t))return o[t]=3,r[t];if(i!==kt&&Rt(i,t))return o[t]=4,i[t];wc&&(o[t]=0)}}const c=yo[t];let u,f;if(c)return t==="$attrs"&&Le(e.attrs,"get",""),c(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(i!==kt&&Rt(i,t))return o[t]=4,i[t];if(f=l.config.globalProperties,Rt(f,t))return f[t]},set({_:e},t,i){const{data:n,setupState:s,ctx:r}=e;return Ph(s,t)?(s[t]=i,!0):n!==kt&&Rt(n,t)?(n[t]=i,!0):Rt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=i,!0)},has({_:{data:e,setupState:t,accessCache:i,ctx:n,appContext:s,propsOptions:r,type:o}},a){let l,h;return!!(i[a]||e!==kt&&a[0]!=="$"&&Rt(e,a)||Ph(t,a)||(l=r[0])&&Rt(l,a)||Rt(n,a)||Rt(yo,a)||Rt(s.config.globalProperties,a)||(h=o.__cssModules)&&h[a])},defineProperty(e,t,i){return i.get!=null?e._.accessCache[t]=0:Rt(i,"value")&&this.set(e,t,i.value,null),Reflect.defineProperty(e,t,i)}};function Mc(e){return lt(e)?e.reduce((t,i)=>(t[i]=null,t),{}):e}function P_(e,t){const i=Mc(e);for(const n in t){if(n.startsWith("__skip"))continue;let s=i[n];s?lt(s)||ft(s)?s=i[n]={type:s,default:t[n]}:s.default=t[n]:s===null&&(s=i[n]={default:t[n]}),s&&t[`__skip_${n}`]&&(s.skipFactory=!0)}return i}let wc=!0;function vp(e){const t=A_(e),i=e.proxy,n=e.ctx;wc=!1,t.beforeCreate&&jf(t.beforeCreate,e,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:h,created:c,beforeMount:u,mounted:f,beforeUpdate:d,updated:g,activated:_,deactivated:m,beforeDestroy:p,beforeUnmount:y,destroyed:S,unmounted:v,render:M,renderTracked:C,renderTriggered:P,errorCaptured:b,serverPrefetch:T,expose:k,inheritAttrs:U,components:A,directives:L,filters:V}=t;if(h&&xp(h,n,null),o)for(const K in o){const X=o[K];ft(X)&&(n[K]=X.bind(i))}if(s){const K=s.call(i,i);zt(K)&&(e.data=ia(K))}if(wc=!0,r)for(const K in r){const X=r[K],rt=ft(X)?X.bind(i,i):ft(X.get)?X.get.bind(i,i):Xi,ut=!ft(X)&&ft(X.set)?X.set.bind(i):Xi,mt=Ee({get:rt,set:ut});Object.defineProperty(n,K,{enumerable:!0,configurable:!0,get:()=>mt.value,set:B=>mt.value=B})}if(a)for(const K in a)b_(a[K],n,i,K);if(l){const K=ft(l)?l.call(i):l;Reflect.ownKeys(K).forEach(X=>{Mi(X,K[X])})}c&&jf(c,e,"c");function $(K,X){lt(X)?X.forEach(rt=>K(rt.bind(i))):X&&K(X.bind(i))}if($(cp,u),$(ei,f),$(up,d),$(fp,g),$(ap,_),$(lp,m),$(mp,b),$(_p,C),$(gp,P),$(Eu,y),$(wi,v),$(dp,T),lt(k))if(k.length){const K=e.exposed||(e.exposed={});k.forEach(X=>{Object.defineProperty(K,X,{get:()=>i[X],set:rt=>i[X]=rt,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===Xi&&(e.render=M),U!=null&&(e.inheritAttrs=U),A&&(e.components=A),L&&(e.directives=L),T&&T_(e)}function xp(e,t,i=Xi){lt(e)&&(e=Cc(e));for(const n in e){const s=e[n];let r;zt(s)?"default"in s?r=Xt(s.from||n,s.default,!0):r=Xt(s.from||n):r=Xt(s),de(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[n]=r}}function jf(e,t,i){Oi(lt(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,i)}function b_(e,t,i,n){let s=n.includes(".")?U_(i,n):()=>i[n];if(ne(e)){const r=t[e];ft(r)&&ie(s,r)}else if(ft(e))ie(s,e.bind(i));else if(zt(e))if(lt(e))e.forEach(r=>b_(r,t,i,n));else{const r=ft(e.handler)?e.handler.bind(i):t[e.handler];ft(r)&&ie(s,r,e)}}function A_(e){const t=e.type,{mixins:i,extends:n}=t,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=e.appContext,a=r.get(t);let l;return a?l=a:!s.length&&!i&&!n?l=t:(l={},s.length&&s.forEach(h=>al(l,h,o,!0)),al(l,t,o)),zt(t)&&r.set(t,l),l}function al(e,t,i,n=!1){const{mixins:s,extends:r}=t;r&&al(e,r,i,!0),s&&s.forEach(o=>al(e,o,i,!0));for(const o in t)if(!(n&&o==="expose")){const a=Ep[o]||i&&i[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Ep={data:Bf,props:zf,emits:zf,methods:no,computed:no,beforeCreate:De,created:De,beforeMount:De,mounted:De,beforeUpdate:De,updated:De,beforeDestroy:De,beforeUnmount:De,destroyed:De,unmounted:De,activated:De,deactivated:De,errorCaptured:De,serverPrefetch:De,components:no,directives:no,watch:Mp,provide:Bf,inject:Sp};function Bf(e,t){return t?e?function(){return ge(ft(e)?e.call(this,this):e,ft(t)?t.call(this,this):t)}:t:e}function Sp(e,t){return no(Cc(e),Cc(t))}function Cc(e){if(lt(e)){const t={};for(let i=0;i<e.length;i++)t[e[i]]=e[i];return t}return e}function De(e,t){return e?[...new Set([].concat(e,t))]:t}function no(e,t){return e?ge(Object.create(null),e,t):t}function zf(e,t){return e?lt(e)&<(t)?[...new Set([...e,...t])]:ge(Object.create(null),Mc(e),Mc(t??{})):t}function Mp(e,t){if(!e)return t;if(!t)return e;const i=ge(Object.create(null),e);for(const n in t)i[n]=De(e[n],t[n]);return i}function L_(){return{app:null,config:{isNativeTag:Wg,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 wp=0;function Cp(e,t){return function(n,s=null){ft(n)||(n=ge({},n)),s!=null&&!zt(s)&&(s=null);const r=L_(),o=new WeakSet,a=[];let l=!1;const h=r.app={_uid:wp++,_component:n,_props:s,_container:null,_context:r,_instance:null,version:ly,get config(){return r.config},set config(c){},use(c,...u){return o.has(c)||(c&&ft(c.install)?(o.add(c),c.install(h,...u)):ft(c)&&(o.add(c),c(h,...u))),h},mixin(c){return r.mixins.includes(c)||r.mixins.push(c),h},component(c,u){return u?(r.components[c]=u,h):r.components[c]},directive(c,u){return u?(r.directives[c]=u,h):r.directives[c]},mount(c,u,f){if(!l){const d=h._ceVNode||Vt(n,s);return d.appContext=r,f===!0?f="svg":f===!1&&(f=void 0),e(d,c,f),l=!0,h._container=c,c.__vue_app__=h,Tu(d.component)}},onUnmount(c){a.push(c)},unmount(){l&&(Oi(a,h._instance,16),e(null,h._container),delete h._container.__vue_app__)},provide(c,u){return r.provides[c]=u,h},runWithContext(c){const u=yr;yr=h;try{return c()}finally{yr=u}}};return h}}let yr=null;function Mi(e,t){if(ze){let i=ze.provides;const n=ze.parent&&ze.parent.provides;n===i&&(i=ze.provides=Object.create(n)),i[e]=t}}function Xt(e,t,i=!1){const n=ql();if(n||yr){let s=yr?yr._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return i&&ft(t)?t.call(n&&n.proxy):t}}const O_={},F_=()=>Object.create(O_),G_=e=>Object.getPrototypeOf(e)===O_;function Tp(e,t,i,n=!1){const s={},r=F_();e.propsDefaults=Object.create(null),D_(e,t,s,r);for(const o in e.propsOptions[0])o in s||(s[o]=void 0);i?e.props=n?s:V1(s):e.type.props?e.props=s:e.props=r,e.attrs=r}function Rp(e,t,i,n){const{props:s,attrs:r,vnode:{patchFlag:o}}=e,a=Mt(s),[l]=e.propsOptions;let h=!1;if((n||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let u=0;u<c.length;u++){let f=c[u];if(Kl(e.emitsOptions,f))continue;const d=t[f];if(l)if(Rt(r,f))d!==r[f]&&(r[f]=d,h=!0);else{const g=ns(f);s[g]=Tc(l,a,g,d,e,!1)}else d!==r[f]&&(r[f]=d,h=!0)}}}else{D_(e,t,s,r)&&(h=!0);let c;for(const u in a)(!t||!Rt(t,u)&&((c=Ns(u))===u||!Rt(t,c)))&&(l?i&&(i[u]!==void 0||i[c]!==void 0)&&(s[u]=Tc(l,a,u,void 0,e,!0)):delete s[u]);if(r!==a)for(const u in r)(!t||!Rt(t,u))&&(delete r[u],h=!0)}h&&un(e.attrs,"set","")}function D_(e,t,i,n){const[s,r]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(go(l))continue;const h=t[l];let c;s&&Rt(s,c=ns(l))?!r||!r.includes(c)?i[c]=h:(a||(a={}))[c]=h:Kl(e.emitsOptions,l)||(!(l in n)||h!==n[l])&&(n[l]=h,o=!0)}if(r){const l=Mt(i),h=a||kt;for(let c=0;c<r.length;c++){const u=r[c];i[u]=Tc(s,l,u,h[u],e,!Rt(h,u))}}return o}function Tc(e,t,i,n,s,r){const o=e[i];if(o!=null){const a=Rt(o,"default");if(a&&n===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&ft(l)){const{propsDefaults:h}=s;if(i in h)n=h[i];else{const c=sa(s);n=h[i]=l.call(null,t),c()}}else n=l;s.ce&&s.ce._setProp(i,n)}o[0]&&(r&&!a?n=!1:o[1]&&(n===""||n===Ns(i))&&(n=!0))}return n}const Ip=new WeakMap;function N_(e,t,i=!1){const n=i?Ip:t.propsCache,s=n.get(e);if(s)return s;const r=e.props,o={},a=[];let l=!1;if(!ft(e)){const c=u=>{l=!0;const[f,d]=N_(u,t,!0);ge(o,f),d&&a.push(...d)};!i&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!r&&!l)return zt(e)&&n.set(e,dr),dr;if(lt(r))for(let c=0;c<r.length;c++){const u=ns(r[c]);Wf(u)&&(o[u]=kt)}else if(r)for(const c in r){const u=ns(c);if(Wf(u)){const f=r[c],d=o[u]=lt(f)||ft(f)?{type:f}:ge({},f),g=d.type;let _=!1,m=!0;if(lt(g))for(let p=0;p<g.length;++p){const y=g[p],S=ft(y)&&y.name;if(S==="Boolean"){_=!0;break}else S==="String"&&(m=!1)}else _=ft(g)&&g.name==="Boolean";d[0]=_,d[1]=m,(_||Rt(d,"default"))&&a.push(u)}}const h=[o,a];return zt(e)&&n.set(e,h),h}function Wf(e){return e[0]!=="$"&&!go(e)}const Su=e=>e==="_"||e==="_ctx"||e==="$stable",Mu=e=>lt(e)?e.map(Bi):[Bi(e)],Pp=(e,t,i)=>{if(t._n)return t;const n=jn((...s)=>Mu(t(...s)),i);return n._c=!1,n},k_=(e,t,i)=>{const n=e._ctx;for(const s in e){if(Su(s))continue;const r=e[s];if(ft(r))t[s]=Pp(s,r,n);else if(r!=null){const o=Mu(r);t[s]=()=>o}}},j_=(e,t)=>{const i=Mu(t);e.slots.default=()=>i},B_=(e,t,i)=>{for(const n in t)(i||!Su(n))&&(e[n]=t[n])},bp=(e,t,i)=>{const n=e.slots=F_();if(e.vnode.shapeFlag&32){const s=t._;s?(B_(n,t,i),i&&Yg(n,"_",s,!0)):k_(t,n)}else t&&j_(e,t)},Ap=(e,t,i)=>{const{vnode:n,slots:s}=e;let r=!0,o=kt;if(n.shapeFlag&32){const a=t._;a?i&&a===1?r=!1:B_(s,t,i):(r=!t.$stable,k_(t,s)),o=t}else t&&(j_(e,t),o={default:1});if(r)for(const a in s)!Su(a)&&o[a]==null&&delete s[a]},ri=Kp;function Lp(e){return Op(e)}function Op(e,t){const i=Bl();i.__VUE__=!0;const{insert:n,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:h,setElementText:c,parentNode:u,nextSibling:f,setScopeId:d=Xi,insertStaticContent:g}=e,_=(E,w,O,j=null,N=null,x=null,I=void 0,R=null,F=!!w.dynamicChildren)=>{if(E===w)return;E&&!Ms(E,w)&&(j=Kt(E),B(E,N,x,!0),E=null),w.patchFlag===-2&&(F=!1,w.dynamicChildren=null);const{type:G,ref:q,shapeFlag:z}=w;switch(G){case Yl:m(E,w,O,j);break;case Oe:p(E,w,O,j);break;case Ah:E==null&&y(w,O,j,I);break;case ce:A(E,w,O,j,N,x,I,R,F);break;default:z&1?M(E,w,O,j,N,x,I,R,F):z&6?L(E,w,O,j,N,x,I,R,F):(z&64||z&128)&&G.process(E,w,O,j,N,x,I,R,F,Z)}q!=null&&N?po(q,E&&E.ref,x,w||E,!w):q==null&&E&&E.ref!=null&&po(E.ref,null,x,E,!0)},m=(E,w,O,j)=>{if(E==null)n(w.el=a(w.children),O,j);else{const N=w.el=E.el;w.children!==E.children&&h(N,w.children)}},p=(E,w,O,j)=>{E==null?n(w.el=l(w.children||""),O,j):w.el=E.el},y=(E,w,O,j)=>{[E.el,E.anchor]=g(E.children,w,O,j,E.el,E.anchor)},S=({el:E,anchor:w},O,j)=>{let N;for(;E&&E!==w;)N=f(E),n(E,O,j),E=N;n(w,O,j)},v=({el:E,anchor:w})=>{let O;for(;E&&E!==w;)O=f(E),s(E),E=O;s(w)},M=(E,w,O,j,N,x,I,R,F)=>{if(w.type==="svg"?I="svg":w.type==="math"&&(I="mathml"),E==null)C(w,O,j,N,x,I,R,F);else{const G=E.el&&E.el._isVueCE?E.el:null;try{G&&G._beginPatch(),T(E,w,N,x,I,R,F)}finally{G&&G._endPatch()}}},C=(E,w,O,j,N,x,I,R)=>{let F,G;const{props:q,shapeFlag:z,transition:J,dirs:Q}=E;if(F=E.el=o(E.type,x,q&&q.is,q),z&8?c(F,E.children):z&16&&b(E.children,F,null,j,N,bh(E,x),I,R),Q&&gs(E,null,j,"created"),P(F,E,E.scopeId,I,j),q){for(const pt in q)pt!=="value"&&!go(pt)&&r(F,pt,null,q[pt],x,j);"value"in q&&r(F,"value",null,q.value,x),(G=q.onVnodeBeforeMount)&&ki(G,j,E)}Q&&gs(E,null,j,"beforeMount");const ot=Fp(N,J);ot&&J.beforeEnter(F),n(F,w,O),((G=q&&q.onVnodeMounted)||ot||Q)&&ri(()=>{G&&ki(G,j,E),ot&&J.enter(F),Q&&gs(E,null,j,"mounted")},N)},P=(E,w,O,j,N)=>{if(O&&d(E,O),j)for(let x=0;x<j.length;x++)d(E,j[x]);if(N){let x=N.subTree;if(w===x||X_(x.type)&&(x.ssContent===w||x.ssFallback===w)){const I=N.vnode;P(E,I,I.scopeId,I.slotScopeIds,N.parent)}}},b=(E,w,O,j,N,x,I,R,F=0)=>{for(let G=F;G<E.length;G++){const q=E[G]=R?zn(E[G]):Bi(E[G]);_(null,q,w,O,j,N,x,I,R)}},T=(E,w,O,j,N,x,I)=>{const R=w.el=E.el;let{patchFlag:F,dynamicChildren:G,dirs:q}=w;F|=E.patchFlag&16;const z=E.props||kt,J=w.props||kt;let Q;if(O&&_s(O,!1),(Q=J.onVnodeBeforeUpdate)&&ki(Q,O,w,E),q&&gs(w,E,O,"beforeUpdate"),O&&_s(O,!0),(z.innerHTML&&J.innerHTML==null||z.textContent&&J.textContent==null)&&c(R,""),G?k(E.dynamicChildren,G,R,O,j,bh(w,N),x):I||X(E,w,R,null,O,j,bh(w,N),x,!1),F>0){if(F&16)U(R,z,J,O,N);else if(F&2&&z.class!==J.class&&r(R,"class",null,J.class,N),F&4&&r(R,"style",z.style,J.style,N),F&8){const ot=w.dynamicProps;for(let pt=0;pt<ot.length;pt++){const wt=ot[pt],ye=z[wt],ve=J[wt];(ve!==ye||wt==="value")&&r(R,wt,ye,ve,N,O)}}F&1&&E.children!==w.children&&c(R,w.children)}else!I&&G==null&&U(R,z,J,O,N);((Q=J.onVnodeUpdated)||q)&&ri(()=>{Q&&ki(Q,O,w,E),q&&gs(w,E,O,"updated")},j)},k=(E,w,O,j,N,x,I)=>{for(let R=0;R<w.length;R++){const F=E[R],G=w[R],q=F.el&&(F.type===ce||!Ms(F,G)||F.shapeFlag&198)?u(F.el):O;_(F,G,q,null,j,N,x,I,!0)}},U=(E,w,O,j,N)=>{if(w!==O){if(w!==kt)for(const x in w)!go(x)&&!(x in O)&&r(E,x,w[x],null,N,j);for(const x in O){if(go(x))continue;const I=O[x],R=w[x];I!==R&&x!=="value"&&r(E,x,R,I,N,j)}"value"in O&&r(E,"value",w.value,O.value,N)}},A=(E,w,O,j,N,x,I,R,F)=>{const G=w.el=E?E.el:a(""),q=w.anchor=E?E.anchor:a("");let{patchFlag:z,dynamicChildren:J,slotScopeIds:Q}=w;Q&&(R=R?R.concat(Q):Q),E==null?(n(G,O,j),n(q,O,j),b(w.children||[],O,q,N,x,I,R,F)):z>0&&z&64&&J&&E.dynamicChildren?(k(E.dynamicChildren,J,O,N,x,I,R),(w.key!=null||N&&w===N.subTree)&&z_(E,w,!0)):X(E,w,O,q,N,x,I,R,F)},L=(E,w,O,j,N,x,I,R,F)=>{w.slotScopeIds=R,E==null?w.shapeFlag&512?N.ctx.activate(w,O,j,I,F):V(w,O,j,N,x,I,F):tt(E,w,F)},V=(E,w,O,j,N,x,I)=>{const R=E.component=ey(E,j,N);if(Xl(E)&&(R.ctx.renderer=Z),iy(R,!1,I),R.asyncDep){if(N&&N.registerDep(R,$,I),!E.el){const F=R.subTree=Vt(Oe);p(null,F,w,O),E.placeholder=F.el}}else $(R,E,w,O,N,x,I)},tt=(E,w,O)=>{const j=w.component=E.component;if(Xp(E,w,O))if(j.asyncDep&&!j.asyncResolved){K(j,w,O);return}else j.next=w,j.update();else w.el=E.el,j.vnode=w},$=(E,w,O,j,N,x,I)=>{const R=()=>{if(E.isMounted){let{next:z,bu:J,u:Q,parent:ot,vnode:pt}=E;{const hi=W_(E);if(hi){z&&(z.el=pt.el,K(E,z,I)),hi.asyncDep.then(()=>{E.isUnmounted||R()});return}}let wt=z,ye;_s(E,!1),z?(z.el=pt.el,K(E,z,I)):z=pt,J&&Mh(J),(ye=z.props&&z.props.onVnodeBeforeUpdate)&&ki(ye,ot,z,pt),_s(E,!0);const ve=Vf(E),Ue=E.subTree;E.subTree=ve,_(Ue,ve,u(Ue.el),Kt(Ue),E,N,x),z.el=ve.el,wt===null&&$p(E,ve.el),Q&&ri(Q,N),(ye=z.props&&z.props.onVnodeUpdated)&&ri(()=>ki(ye,ot,z,pt),N)}else{let z;const{el:J,props:Q}=w,{bm:ot,m:pt,parent:wt,root:ye,type:ve}=E,Ue=pr(w);_s(E,!1),ot&&Mh(ot),!Ue&&(z=Q&&Q.onVnodeBeforeMount)&&ki(z,wt,w),_s(E,!0);{ye.ce&&ye.ce._def.shadowRoot!==!1&&ye.ce._injectChildStyle(ve);const hi=E.subTree=Vf(E);_(null,hi,O,j,E,N,x),w.el=hi.el}if(pt&&ri(pt,N),!Ue&&(z=Q&&Q.onVnodeMounted)){const hi=w;ri(()=>ki(z,wt,hi),N)}(w.shapeFlag&256||wt&&pr(wt.vnode)&&wt.vnode.shapeFlag&256)&&E.a&&ri(E.a,N),E.isMounted=!0,w=O=j=null}};E.scope.on();const F=E.effect=new Jg(R);E.scope.off();const G=E.update=F.run.bind(F),q=E.job=F.runIfDirty.bind(F);q.i=E,q.id=E.uid,F.scheduler=()=>xu(q),_s(E,!0),G()},K=(E,w,O)=>{w.component=E;const j=E.vnode.props;E.vnode=w,E.next=null,Rp(E,w.props,j,O),Ap(E,w.children,O),Sn(),Df(E),Mn()},X=(E,w,O,j,N,x,I,R,F=!1)=>{const G=E&&E.children,q=E?E.shapeFlag:0,z=w.children,{patchFlag:J,shapeFlag:Q}=w;if(J>0){if(J&128){ut(G,z,O,j,N,x,I,R,F);return}else if(J&256){rt(G,z,O,j,N,x,I,R,F);return}}Q&8?(q&16&&$t(G,N,x),z!==G&&c(O,z)):q&16?Q&16?ut(G,z,O,j,N,x,I,R,F):$t(G,N,x,!0):(q&8&&c(O,""),Q&16&&b(z,O,j,N,x,I,R,F))},rt=(E,w,O,j,N,x,I,R,F)=>{E=E||dr,w=w||dr;const G=E.length,q=w.length,z=Math.min(G,q);let J;for(J=0;J<z;J++){const Q=w[J]=F?zn(w[J]):Bi(w[J]);_(E[J],Q,O,null,N,x,I,R,F)}G>q?$t(E,N,x,!0,!1,z):b(w,O,j,N,x,I,R,F,z)},ut=(E,w,O,j,N,x,I,R,F)=>{let G=0;const q=w.length;let z=E.length-1,J=q-1;for(;G<=z&&G<=J;){const Q=E[G],ot=w[G]=F?zn(w[G]):Bi(w[G]);if(Ms(Q,ot))_(Q,ot,O,null,N,x,I,R,F);else break;G++}for(;G<=z&&G<=J;){const Q=E[z],ot=w[J]=F?zn(w[J]):Bi(w[J]);if(Ms(Q,ot))_(Q,ot,O,null,N,x,I,R,F);else break;z--,J--}if(G>z){if(G<=J){const Q=J+1,ot=Q<q?w[Q].el:j;for(;G<=J;)_(null,w[G]=F?zn(w[G]):Bi(w[G]),O,ot,N,x,I,R,F),G++}}else if(G>J)for(;G<=z;)B(E[G],N,x,!0),G++;else{const Q=G,ot=G,pt=new Map;for(G=ot;G<=J;G++){const Ce=w[G]=F?zn(w[G]):Bi(w[G]);Ce.key!=null&&pt.set(Ce.key,G)}let wt,ye=0;const ve=J-ot+1;let Ue=!1,hi=0;const fs=new Array(ve);for(G=0;G<ve;G++)fs[G]=0;for(G=Q;G<=z;G++){const Ce=E[G];if(ye>=ve){B(Ce,N,x,!0);continue}let Ve;if(Ce.key!=null)Ve=pt.get(Ce.key);else for(wt=ot;wt<=J;wt++)if(fs[wt-ot]===0&&Ms(Ce,w[wt])){Ve=wt;break}Ve===void 0?B(Ce,N,x,!0):(fs[Ve-ot]=G+1,Ve>=hi?hi=Ve:Ue=!0,_(Ce,w[Ve],O,null,N,x,I,R,F),ye++)}const Vr=Ue?Gp(fs):dr;for(wt=Vr.length-1,G=ve-1;G>=0;G--){const Ce=ot+G,Ve=w[Ce],Xr=w[Ce+1],ma=Ce+1<q?Xr.el||Xr.placeholder:j;fs[G]===0?_(null,Ve,O,ma,N,x,I,R,F):Ue&&(wt<0||G!==Vr[wt]?mt(Ve,O,ma,2):wt--)}}},mt=(E,w,O,j,N=null)=>{const{el:x,type:I,transition:R,children:F,shapeFlag:G}=E;if(G&6){mt(E.component.subTree,w,O,j);return}if(G&128){E.suspense.move(w,O,j);return}if(G&64){I.move(E,w,O,Z);return}if(I===ce){n(x,w,O);for(let z=0;z<F.length;z++)mt(F[z],w,O,j);n(E.anchor,w,O);return}if(I===Ah){S(E,w,O);return}if(j!==2&&G&1&&R)if(j===0)R.beforeEnter(x),n(x,w,O),ri(()=>R.enter(x),N);else{const{leave:z,delayLeave:J,afterLeave:Q}=R,ot=()=>{E.ctx.isUnmounted?s(x):n(x,w,O)},pt=()=>{x._isLeaving&&x[hn](!0),z(x,()=>{ot(),Q&&Q()})};J?J(x,ot,pt):pt()}else n(x,w,O)},B=(E,w,O,j=!1,N=!1)=>{const{type:x,props:I,ref:R,children:F,dynamicChildren:G,shapeFlag:q,patchFlag:z,dirs:J,cacheIndex:Q}=E;if(z===-2&&(N=!1),R!=null&&(Sn(),po(R,null,O,E,!0),Mn()),Q!=null&&(w.renderCache[Q]=void 0),q&256){w.ctx.deactivate(E);return}const ot=q&1&&J,pt=!pr(E);let wt;if(pt&&(wt=I&&I.onVnodeBeforeUnmount)&&ki(wt,w,E),q&6)Gt(E.component,O,j);else{if(q&128){E.suspense.unmount(O,j);return}ot&&gs(E,null,w,"beforeUnmount"),q&64?E.type.remove(E,w,O,Z,j):G&&!G.hasOnce&&(x!==ce||z>0&&z&64)?$t(G,w,O,!1,!0):(x===ce&&z&384||!N&&q&16)&&$t(F,w,O),j&&Ht(E)}(pt&&(wt=I&&I.onVnodeUnmounted)||ot)&&ri(()=>{wt&&ki(wt,w,E),ot&&gs(E,null,w,"unmounted")},O)},Ht=E=>{const{type:w,el:O,anchor:j,transition:N}=E;if(w===ce){se(O,j);return}if(w===Ah){v(E);return}const x=()=>{s(O),N&&!N.persisted&&N.afterLeave&&N.afterLeave()};if(E.shapeFlag&1&&N&&!N.persisted){const{leave:I,delayLeave:R}=N,F=()=>I(O,x);R?R(E.el,x,F):F()}else x()},se=(E,w)=>{let O;for(;E!==w;)O=f(E),s(E),E=O;s(w)},Gt=(E,w,O)=>{const{bum:j,scope:N,job:x,subTree:I,um:R,m:F,a:G}=E;Uf(F),Uf(G),j&&Mh(j),N.stop(),x&&(x.flags|=8,B(I,E,w,O)),R&&ri(R,w),ri(()=>{E.isUnmounted=!0},w)},$t=(E,w,O,j=!1,N=!1,x=0)=>{for(let I=x;I<E.length;I++)B(E[I],w,O,j,N)},Kt=E=>{if(E.shapeFlag&6)return Kt(E.component.subTree);if(E.shapeFlag&128)return E.suspense.next();const w=f(E.anchor||E.el),O=w&&w[np];return O?f(O):w};let me=!1;const pe=(E,w,O)=>{E==null?w._vnode&&B(w._vnode,null,null,!0):_(w._vnode||null,E,w,null,null,null,O),w._vnode=E,me||(me=!0,Df(),p_(),me=!1)},Z={p:_,um:B,m:mt,r:Ht,mt:V,mc:b,pc:X,pbc:k,n:Kt,o:e};return{render:pe,hydrate:void 0,createApp:Cp(pe)}}function bh({type:e,props:t},i){return i==="svg"&&e==="foreignObject"||i==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:i}function _s({effect:e,job:t},i){i?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Fp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function z_(e,t,i=!1){const n=e.children,s=t.children;if(lt(n)&<(s))for(let r=0;r<n.length;r++){const o=n[r];let a=s[r];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[r]=zn(s[r]),a.el=o.el),!i&&a.patchFlag!==-2&&z_(o,a)),a.type===Yl&&a.patchFlag!==-1&&(a.el=o.el),a.type===Oe&&!a.el&&(a.el=o.el)}}function Gp(e){const t=e.slice(),i=[0];let n,s,r,o,a;const l=e.length;for(n=0;n<l;n++){const h=e[n];if(h!==0){if(s=i[i.length-1],e[s]<h){t[n]=s,i.push(n);continue}for(r=0,o=i.length-1;r<o;)a=r+o>>1,e[i[a]]<h?r=a+1:o=a;h<e[i[r]]&&(r>0&&(t[n]=i[r-1]),i[r]=n)}}for(r=i.length,o=i[r-1];r-- >0;)i[r]=o,o=t[o];return i}function W_(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:W_(t)}function Uf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const Dp=Symbol.for("v-scx"),Np=()=>Xt(Dp);function kp(e,t){return wu(e,null,t)}function ie(e,t,i){return wu(e,t,i)}function wu(e,t,i=kt){const{immediate:n,deep:s,flush:r,once:o}=i,a=ge({},i),l=t&&n||!t&&r!=="post";let h;if(No){if(r==="sync"){const d=Np();h=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=Xi,d.resume=Xi,d.pause=Xi,d}}const c=ze;a.call=(d,g,_)=>Oi(d,c,g,_);let u=!1;r==="post"?a.scheduler=d=>{ri(d,c&&c.suspense)}:r!=="sync"&&(u=!0,a.scheduler=(d,g)=>{g?d():xu(d)}),a.augmentJob=d=>{t&&(d.flags|=4),u&&(d.flags|=2,c&&(d.id=c.uid,d.i=c))};const f=Q1(e,t,a);return No&&(h?h.push(f):l&&f()),f}function jp(e,t,i){const n=this.proxy,s=ne(e)?e.includes(".")?U_(n,e):()=>n[e]:e.bind(n,n);let r;ft(t)?r=t:(r=t.handler,i=t);const o=sa(this),a=wu(s,r.bind(n),i);return o(),a}function U_(e,t){const i=t.split(".");return()=>{let n=e;for(let s=0;s<i.length&&n;s++)n=n[i[s]];return n}}const Bp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ns(t)}Modifiers`]||e[`${Ns(t)}Modifiers`];function zp(e,t,...i){if(e.isUnmounted)return;const n=e.vnode.props||kt;let s=i;const r=t.startsWith("update:"),o=r&&Bp(n,t.slice(7));o&&(o.trim&&(s=i.map(c=>ne(c)?c.trim():c)),o.number&&(s=i.map(_1)));let a,l=n[a=Sh(t)]||n[a=Sh(ns(t))];!l&&r&&(l=n[a=Sh(Ns(t))]),l&&Oi(l,e,6,s);const h=n[a+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Oi(h,e,6,s)}}const Wp=new WeakMap;function V_(e,t,i=!1){const n=i?Wp:t.emitsCache,s=n.get(e);if(s!==void 0)return s;const r=e.emits;let o={},a=!1;if(!ft(e)){const l=h=>{const c=V_(h,t,!0);c&&(a=!0,ge(o,c))};!i&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!r&&!a?(zt(e)&&n.set(e,null),null):(lt(r)?r.forEach(l=>o[l]=null):ge(o,r),zt(e)&&n.set(e,o),o)}function Kl(e,t){return!e||!Nl(t)?!1:(t=t.slice(2).replace(/Once$/,""),Rt(e,t[0].toLowerCase()+t.slice(1))||Rt(e,Ns(t))||Rt(e,t))}function Vf(e){const{type:t,vnode:i,proxy:n,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:h,renderCache:c,props:u,data:f,setupState:d,ctx:g,inheritAttrs:_}=e,m=sl(e);let p,y;try{if(i.shapeFlag&4){const v=s||n,M=v;p=Bi(h.call(M,v,c,u,d,f,g)),y=a}else{const v=t;p=Bi(v.length>1?v(u,{attrs:a,slots:o,emit:l}):v(u,null)),y=t.props?a:Up(a)}}catch(v){vo.length=0,Vl(v,e,1),p=Vt(Oe)}let S=p;if(y&&_!==!1){const v=Object.keys(y),{shapeFlag:M}=S;v.length&&M&7&&(r&&v.some(cu)&&(y=Vp(y,r)),S=rs(S,y,!1,!0))}return i.dirs&&(S=rs(S,null,!1,!0),S.dirs=S.dirs?S.dirs.concat(i.dirs):i.dirs),i.transition&&Fo(S,i.transition),p=S,sl(m),p}const Up=e=>{let t;for(const i in e)(i==="class"||i==="style"||Nl(i))&&((t||(t={}))[i]=e[i]);return t},Vp=(e,t)=>{const i={};for(const n in e)(!cu(n)||!(n.slice(9)in t))&&(i[n]=e[n]);return i};function Xp(e,t,i){const{props:n,children:s,component:r}=e,{props:o,children:a,patchFlag:l}=t,h=r.emitsOptions;if(t.dirs||t.transition)return!0;if(i&&l>=0){if(l&1024)return!0;if(l&16)return n?Xf(n,o,h):!!o;if(l&8){const c=t.dynamicProps;for(let u=0;u<c.length;u++){const f=c[u];if(o[f]!==n[f]&&!Kl(h,f))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:n===o?!1:n?o?Xf(n,o,h):!0:!!o;return!1}function Xf(e,t,i){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let s=0;s<n.length;s++){const r=n[s];if(t[r]!==e[r]&&!Kl(i,r))return!0}return!1}function $p({vnode:e,parent:t},i){for(;t;){const n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.el=e.el),n===e)(e=t.vnode).el=i,t=t.parent;else break}}const X_=e=>e.__isSuspense;function Kp(e,t){t&&t.pendingBranch?lt(e)?t.effects.push(...e):t.effects.push(e):ip(e)}const ce=Symbol.for("v-fgt"),Yl=Symbol.for("v-txt"),Oe=Symbol.for("v-cmt"),Ah=Symbol.for("v-stc"),vo=[];let ai=null;function dt(e=!1){vo.push(ai=e?null:[])}function Yp(){vo.pop(),ai=vo[vo.length-1]||null}let Go=1;function ll(e,t=!1){Go+=e,e<0&&ai&&t&&(ai.hasOnce=!0)}function $_(e){return e.dynamicChildren=Go>0?ai||dr:null,Yp(),Go>0&&ai&&ai.push(e),e}function jt(e,t,i,n,s,r){return $_(Ot(e,t,i,n,s,r,!0))}function Re(e,t,i,n,s){return $_(Vt(e,t,i,n,s,!0))}function Do(e){return e?e.__v_isVNode===!0:!1}function Ms(e,t){return e.type===t.type&&e.key===t.key}const K_=({key:e})=>e??null,Xa=({ref:e,ref_key:t,ref_for:i})=>(typeof e=="number"&&(e=""+e),e!=null?ne(e)||de(e)||ft(e)?{i:Je,r:e,k:t,f:!!i}:e:null);function Ot(e,t=null,i=null,n=0,s=null,r=e===ce?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&K_(t),ref:t&&Xa(t),scopeId:v_,slotScopeIds:null,children:i,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:r,patchFlag:n,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Je};return a?(Cu(l,i),r&128&&e.normalize(l)):i&&(l.shapeFlag|=ne(i)?8:16),Go>0&&!o&&ai&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&ai.push(l),l}const Vt=qp;function qp(e,t=null,i=null,n=0,s=null,r=!1){if((!e||e===pp)&&(e=Oe),Do(e)){const a=rs(e,t,!0);return i&&Cu(a,i),Go>0&&!r&&ai&&(a.shapeFlag&6?ai[ai.indexOf(e)]=a:ai.push(a)),a.patchFlag=-2,a}if(oy(e)&&(e=e.__vccOpts),t){t=Hp(t);let{class:a,style:l}=t;a&&!ne(a)&&(t.class=Po(a)),zt(l)&&(vu(l)&&!lt(l)&&(l=ge({},l)),t.style=zl(l))}const o=ne(e)?1:X_(e)?128:x_(e)?64:zt(e)?4:ft(e)?2:0;return Ot(e,t,i,n,s,o,r,!0)}function Hp(e){return e?vu(e)||G_(e)?ge({},e):e:null}function rs(e,t,i=!1,n=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=e,h=t?Jp(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&K_(h),ref:t&&t.ref?i&&r?lt(r)?r.concat(Xa(t)):[r,Xa(t)]:Xa(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ce?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&rs(e.ssContent),ssFallback:e.ssFallback&&rs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&n&&Fo(c,l.clone(c)),c}function Zp(e=" ",t=0){return Vt(Yl,null,e,t)}function re(e="",t=!1){return t?(dt(),Re(Oe,null,e)):Vt(Oe,null,e)}function Bi(e){return e==null||typeof e=="boolean"?Vt(Oe):lt(e)?Vt(ce,null,e.slice()):Do(e)?zn(e):Vt(Yl,null,String(e))}function zn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:rs(e)}function Cu(e,t){let i=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(lt(t))i=16;else if(typeof t=="object")if(n&65){const s=t.default;s&&(s._c&&(s._d=!1),Cu(e,s()),s._c&&(s._d=!0));return}else{i=32;const s=t._;!s&&!G_(t)?t._ctx=Je:s===3&&Je&&(Je.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ft(t)?(t={default:t,_ctx:Je},i=32):(t=String(t),n&64?(i=16,t=[Zp(t)]):i=8);e.children=t,e.shapeFlag|=i}function Jp(...e){const t={};for(let i=0;i<e.length;i++){const n=e[i];for(const s in n)if(s==="class")t.class!==n.class&&(t.class=Po([t.class,n.class]));else if(s==="style")t.style=zl([t.style,n.style]);else if(Nl(s)){const r=t[s],o=n[s];o&&r!==o&&!(lt(r)&&r.includes(o))&&(t[s]=r?[].concat(r,o):o)}else s!==""&&(t[s]=n[s])}return t}function ki(e,t,i,n=null){Oi(e,t,7,[i,n])}const Qp=L_();let ty=0;function ey(e,t,i){const n=e.type,s=(t?t.appContext:e.appContext)||Qp,r={uid:ty++,vnode:e,type:n,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new M1(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:N_(n,s),emitsOptions:V_(n,s),emit:null,emitted:null,propsDefaults:kt,inheritAttrs:n.inheritAttrs,ctx:kt,data:kt,props:kt,attrs:kt,slots:kt,refs:kt,setupState:kt,setupContext:null,suspense:i,suspenseId:i?i.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 r.ctx={_:r},r.root=t?t.root:r,r.emit=zp.bind(null,r),e.ce&&e.ce(r),r}let ze=null;const ql=()=>ze||Je;let hl,Rc;{const e=Bl(),t=(i,n)=>{let s;return(s=e[i])||(s=e[i]=[]),s.push(n),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};hl=t("__VUE_INSTANCE_SETTERS__",i=>ze=i),Rc=t("__VUE_SSR_SETTERS__",i=>No=i)}const sa=e=>{const t=ze;return hl(e),e.scope.on(),()=>{e.scope.off(),hl(t)}},$f=()=>{ze&&ze.scope.off(),hl(null)};function Y_(e){return e.vnode.shapeFlag&4}let No=!1;function iy(e,t=!1,i=!1){t&&Rc(t);const{props:n,children:s}=e.vnode,r=Y_(e);Tp(e,n,r,t),bp(e,s,i||t);const o=r?ny(e,t):void 0;return t&&Rc(!1),o}function ny(e,t){const i=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,yp);const{setup:n}=i;if(n){Sn();const s=e.setupContext=n.length>1?ry(e):null,r=sa(e),o=na(n,e,0,[e.props,s]),a=Vg(o);if(Mn(),r(),(a||e.sp)&&!pr(e)&&T_(e),a){if(o.then($f,$f),t)return o.then(l=>{Kf(e,l)}).catch(l=>{Vl(l,e,0)});e.asyncDep=o}else Kf(e,o)}else q_(e)}function Kf(e,t,i){ft(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:zt(t)&&(e.setupState=d_(t)),q_(e)}function q_(e,t,i){const n=e.type;e.render||(e.render=n.render||Xi);{const s=sa(e);Sn();try{vp(e)}finally{Mn(),s()}}}const sy={get(e,t){return Le(e,"get",""),e[t]}};function ry(e){const t=i=>{e.exposed=i||{}};return{attrs:new Proxy(e.attrs,sy),slots:e.slots,emit:e.emit,expose:t}}function Tu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(d_(X1(e.exposed)),{get(t,i){if(i in t)return t[i];if(i in yo)return yo[i](e)},has(t,i){return i in t||i in yo}})):e.proxy}function oy(e){return ft(e)&&"__vccOpts"in e}const Ee=(e,t)=>Z1(e,t,No);function ay(e,t,i){try{ll(-1);const n=arguments.length;return n===2?zt(t)&&!lt(t)?Do(t)?Vt(e,null,[t]):Vt(e,t):Vt(e,null,t):(n>3?i=Array.prototype.slice.call(arguments,2):n===3&&Do(i)&&(i=[i]),Vt(e,t,i))}finally{ll(1)}}const ly="3.5.24";let Ic;const Yf=typeof window<"u"&&window.trustedTypes;if(Yf)try{Ic=Yf.createPolicy("vue",{createHTML:e=>e})}catch{}const H_=Ic?e=>Ic.createHTML(e):e=>e,hy="http://www.w3.org/2000/svg",cy="http://www.w3.org/1998/Math/MathML",on=typeof document<"u"?document:null,qf=on&&on.createElement("template"),uy={insert:(e,t,i)=>{t.insertBefore(e,i||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,i,n)=>{const s=t==="svg"?on.createElementNS(hy,e):t==="mathml"?on.createElementNS(cy,e):i?on.createElement(e,{is:i}):on.createElement(e);return e==="select"&&n&&n.multiple!=null&&s.setAttribute("multiple",n.multiple),s},createText:e=>on.createTextNode(e),createComment:e=>on.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>on.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,i,n,s,r){const o=i?i.previousSibling:t.lastChild;if(s&&(s===r||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),i),!(s===r||!(s=s.nextSibling)););else{qf.innerHTML=H_(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const a=qf.content;if(n==="svg"||n==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,i)}return[o?o.nextSibling:t.firstChild,i?i.previousSibling:t.lastChild]}},Ln="transition",Hr="animation",ko=Symbol("_vtc"),Z_={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},fy=ge({},E_,Z_),dy=e=>(e.displayName="Transition",e.props=fy,e),Hf=dy((e,{slots:t})=>ay(op,gy(e),t)),ms=(e,t=[])=>{lt(e)?e.forEach(i=>i(...t)):e&&e(...t)},Zf=e=>e?lt(e)?e.some(t=>t.length>1):e.length>1:!1;function gy(e){const t={};for(const A in e)A in Z_||(t[A]=e[A]);if(e.css===!1)return t;const{name:i="v",type:n,duration:s,enterFromClass:r=`${i}-enter-from`,enterActiveClass:o=`${i}-enter-active`,enterToClass:a=`${i}-enter-to`,appearFromClass:l=r,appearActiveClass:h=o,appearToClass:c=a,leaveFromClass:u=`${i}-leave-from`,leaveActiveClass:f=`${i}-leave-active`,leaveToClass:d=`${i}-leave-to`}=e,g=_y(s),_=g&&g[0],m=g&&g[1],{onBeforeEnter:p,onEnter:y,onEnterCancelled:S,onLeave:v,onLeaveCancelled:M,onBeforeAppear:C=p,onAppear:P=y,onAppearCancelled:b=S}=t,T=(A,L,V,tt)=>{A._enterCancelled=tt,ps(A,L?c:a),ps(A,L?h:o),V&&V()},k=(A,L)=>{A._isLeaving=!1,ps(A,u),ps(A,d),ps(A,f),L&&L()},U=A=>(L,V)=>{const tt=A?P:y,$=()=>T(L,A,V);ms(tt,[L,$]),Jf(()=>{ps(L,A?l:r),en(L,A?c:a),Zf(tt)||Qf(L,n,_,$)})};return ge(t,{onBeforeEnter(A){ms(p,[A]),en(A,r),en(A,o)},onBeforeAppear(A){ms(C,[A]),en(A,l),en(A,h)},onEnter:U(!1),onAppear:U(!0),onLeave(A,L){A._isLeaving=!0;const V=()=>k(A,L);en(A,u),A._enterCancelled?(en(A,f),id(A)):(id(A),en(A,f)),Jf(()=>{A._isLeaving&&(ps(A,u),en(A,d),Zf(v)||Qf(A,n,m,V))}),ms(v,[A,V])},onEnterCancelled(A){T(A,!1,void 0,!0),ms(S,[A])},onAppearCancelled(A){T(A,!0,void 0,!0),ms(b,[A])},onLeaveCancelled(A){k(A),ms(M,[A])}})}function _y(e){if(e==null)return null;if(zt(e))return[Lh(e.enter),Lh(e.leave)];{const t=Lh(e);return[t,t]}}function Lh(e){return m1(e)}function en(e,t){t.split(/\s+/).forEach(i=>i&&e.classList.add(i)),(e[ko]||(e[ko]=new Set)).add(t)}function ps(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const i=e[ko];i&&(i.delete(t),i.size||(e[ko]=void 0))}function Jf(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let my=0;function Qf(e,t,i,n){const s=e._endId=++my,r=()=>{s===e._endId&&n()};if(i!=null)return setTimeout(r,i);const{type:o,timeout:a,propCount:l}=py(e,t);if(!o)return n();const h=o+"end";let c=0;const u=()=>{e.removeEventListener(h,f),r()},f=d=>{d.target===e&&++c>=l&&u()};setTimeout(()=>{c<l&&u()},a+1),e.addEventListener(h,f)}function py(e,t){const i=window.getComputedStyle(e),n=g=>(i[g]||"").split(", "),s=n(`${Ln}Delay`),r=n(`${Ln}Duration`),o=td(s,r),a=n(`${Hr}Delay`),l=n(`${Hr}Duration`),h=td(a,l);let c=null,u=0,f=0;t===Ln?o>0&&(c=Ln,u=o,f=r.length):t===Hr?h>0&&(c=Hr,u=h,f=l.length):(u=Math.max(o,h),c=u>0?o>h?Ln:Hr:null,f=c?c===Ln?r.length:l.length:0);const d=c===Ln&&/\b(?:transform|all)(?:,|$)/.test(n(`${Ln}Property`).toString());return{type:c,timeout:u,propCount:f,hasTransform:d}}function td(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((i,n)=>ed(i)+ed(e[n])))}function ed(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function id(e){return(e?e.ownerDocument:document).body.offsetHeight}function yy(e,t,i){const n=e[ko];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):i?e.setAttribute("class",t):e.className=t}const nd=Symbol("_vod"),vy=Symbol("_vsh"),xy=Symbol(""),Ey=/(?:^|;)\s*display\s*:/;function Sy(e,t,i){const n=e.style,s=ne(i);let r=!1;if(i&&!s){if(t)if(ne(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();i[a]==null&&$a(n,a,"")}else for(const o in t)i[o]==null&&$a(n,o,"");for(const o in i)o==="display"&&(r=!0),$a(n,o,i[o])}else if(s){if(t!==i){const o=n[xy];o&&(i+=";"+o),n.cssText=i,r=Ey.test(i)}}else t&&e.removeAttribute("style");nd in e&&(e[nd]=r?n.display:"",e[vy]&&(n.display="none"))}const sd=/\s*!important$/;function $a(e,t,i){if(lt(i))i.forEach(n=>$a(e,t,n));else if(i==null&&(i=""),t.startsWith("--"))e.setProperty(t,i);else{const n=My(e,t);sd.test(i)?e.setProperty(Ns(n),i.replace(sd,""),"important"):e[n]=i}}const rd=["Webkit","Moz","ms"],Oh={};function My(e,t){const i=Oh[t];if(i)return i;let n=ns(t);if(n!=="filter"&&n in e)return Oh[t]=n;n=Kg(n);for(let s=0;s<rd.length;s++){const r=rd[s]+n;if(r in e)return Oh[t]=r}return t}const od="http://www.w3.org/1999/xlink";function ad(e,t,i,n,s,r=S1(t)){n&&t.startsWith("xlink:")?i==null?e.removeAttributeNS(od,t.slice(6,t.length)):e.setAttributeNS(od,t,i):i==null||r&&!qg(i)?e.removeAttribute(t):e.setAttribute(t,r?"":Tn(i)?String(i):i)}function ld(e,t,i,n,s){if(t==="innerHTML"||t==="textContent"){i!=null&&(e[t]=t==="innerHTML"?H_(i):i);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const a=r==="OPTION"?e.getAttribute("value")||"":e.value,l=i==null?e.type==="checkbox"?"on":"":String(i);(a!==l||!("_value"in e))&&(e.value=l),i==null&&e.removeAttribute(t),e._value=i;return}let o=!1;if(i===""||i==null){const a=typeof e[t];a==="boolean"?i=qg(i):i==null&&a==="string"?(i="",o=!0):a==="number"&&(i=0,o=!0)}try{e[t]=i}catch{}o&&e.removeAttribute(s||t)}function wy(e,t,i,n){e.addEventListener(t,i,n)}function Cy(e,t,i,n){e.removeEventListener(t,i,n)}const hd=Symbol("_vei");function Ty(e,t,i,n,s=null){const r=e[hd]||(e[hd]={}),o=r[t];if(n&&o)o.value=n;else{const[a,l]=Ry(t);if(n){const h=r[t]=by(n,s);wy(e,a,h,l)}else o&&(Cy(e,a,o,l),r[t]=void 0)}}const cd=/(?:Once|Passive|Capture)$/;function Ry(e){let t;if(cd.test(e)){t={};let n;for(;n=e.match(cd);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ns(e.slice(2)),t]}let Fh=0;const Iy=Promise.resolve(),Py=()=>Fh||(Iy.then(()=>Fh=0),Fh=Date.now());function by(e,t){const i=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=i.attached)return;Oi(Ay(n,i.value),t,5,[n])};return i.value=e,i.attached=Py(),i}function Ay(e,t){if(lt(t)){const i=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{i.call(e),e._stopped=!0},t.map(n=>s=>!s._stopped&&n&&n(s))}else return t}const ud=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ly=(e,t,i,n,s,r)=>{const o=s==="svg";t==="class"?yy(e,n,o):t==="style"?Sy(e,i,n):Nl(t)?cu(t)||Ty(e,t,i,n,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Oy(e,t,n,o))?(ld(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&ad(e,t,n,o,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!ne(n))?ld(e,ns(t),n,r,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),ad(e,t,n,o))};function Oy(e,t,i,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&ud(t)&&ft(i));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return ud(t)&&ne(i)?!1:t in e}const Fy=ge({patchProp:Ly},uy);let fd;function Gy(){return fd||(fd=Lp(Fy))}const Dy=((...e)=>{const t=Gy().createApp(...e),{mount:i}=t;return t.mount=n=>{const s=ky(n);if(!s)return;const r=t._component;!ft(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=i(s,!1,Ny(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},t});function Ny(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ky(e){return ne(e)?document.querySelector(e):e}const Tr={PROPERTYCHANGE:"propertychange"},at={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class Hl{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function jy(e,t,i){let n,s;i=i||gn;let r=0,o=e.length,a=!1;for(;r<o;)n=r+(o-r>>1),s=+i(e[n],t),s<0?r=n+1:(o=n,a=!s);return a?r:~r}function gn(e,t){return e>t?1:e<t?-1:0}function By(e,t){return e<t?1:e>t?-1:0}function Zl(e,t,i){if(e[0]<=t)return 0;const n=e.length;if(t<=e[n-1])return n-1;if(typeof i=="function"){for(let s=1;s<n;++s){const r=e[s];if(r===t)return s;if(r<t)return i(t,e[s-1],r)>0?s-1:s}return n-1}if(i>0){for(let s=1;s<n;++s)if(e[s]<t)return s-1;return n-1}if(i<0){for(let s=1;s<n;++s)if(e[s]<=t)return s;return n-1}for(let s=1;s<n;++s){if(e[s]==t)return s;if(e[s]<t)return e[s-1]-t<t-e[s]?s-1:s}return n-1}function zy(e,t,i){for(;t<i;){const n=e[t];e[t]=e[i],e[i]=n,++t,--i}}function xi(e,t){const i=Array.isArray(t)?t:[t],n=i.length;for(let s=0;s<n;s++)e[e.length]=i[s]}function In(e,t){const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Wy(e,t,i){const n=t||gn;return e.every(function(s,r){if(r===0)return!0;const o=n(e[r-1],s);return!(o>0||o===0)})}function wn(){return!0}function ks(){return!1}function jo(){}function J_(e){let t,i,n;return function(){const s=Array.prototype.slice.call(arguments);return(!i||this!==n||!In(s,i))&&(n=this,i=s,t=e.apply(this,arguments)),t}}function Q_(e){function t(){let i;try{i=e()}catch(n){return Promise.reject(n)}return i instanceof Promise?i:Promise.resolve(i)}return t()}function js(e){for(const t in e)delete e[t]}function Rr(e){let t;for(t in e)return!1;return!t}class ii{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class ra extends Hl{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,i){if(!t||!i)return;const n=this.listeners_||(this.listeners_={}),s=n[t]||(n[t]=[]);s.includes(i)||s.push(i)}dispatchEvent(t){const i=typeof t=="string",n=i?t:t.type,s=this.listeners_&&this.listeners_[n];if(!s)return;const r=i?new ii(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,a[n]=0),++o[n];let l;for(let h=0,c=s.length;h<c;++h)if("handleEvent"in s[h]?l=s[h].handleEvent(r):l=s[h].call(this,r),l===!1||r.propagationStopped){l=!1;break}if(--o[n]===0){let h=a[n];for(delete a[n];h--;)this.removeEventListener(n,jo);delete o[n]}return l}disposeInternal(){this.listeners_&&js(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,i){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const s=n.indexOf(i);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[s]=jo,++this.pendingRemovals_[t]):(n.splice(s,1),n.length===0&&delete this.listeners_[t]))}}function _t(e,t,i,n,s){if(s){const o=i;i=function(a){return e.removeEventListener(t,i),o.call(n??this,a)}}else n&&n!==e&&(i=i.bind(n));const r={target:e,type:t,listener:i};return e.addEventListener(t,i),r}function cl(e,t,i,n){return _t(e,t,i,n,!0)}function Tt(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),js(e))}class oa extends ra{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(at.CHANGE)}getRevision(){return this.revision_}onInternal(t,i){if(Array.isArray(t)){const n=t.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=_t(this,t[r],i);return s}return _t(this,t,i)}onceInternal(t,i){let n;if(Array.isArray(t)){const s=t.length;n=new Array(s);for(let r=0;r<s;++r)n[r]=cl(this,t[r],i)}else n=cl(this,t,i);return i.ol_key=n,n}unInternal(t,i){const n=i.ol_key;if(n)t0(n);else if(Array.isArray(t))for(let s=0,r=t.length;s<r;++s)this.removeEventListener(t[s],i);else this.removeEventListener(t,i)}}oa.prototype.on;oa.prototype.once;oa.prototype.un;function t0(e){if(Array.isArray(e))for(let t=0,i=e.length;t<i;++t)Tt(e[t]);else Tt(e)}function St(){throw new Error("Unimplemented abstract method.")}let Uy=0;function ht(e){return e.ol_uid||(e.ol_uid=String(++Uy))}class dd extends ii{constructor(t,i,n){super(t),this.key=i,this.oldValue=n}}class Di extends oa{constructor(t){super(),this.on,this.once,this.un,ht(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let i;return this.values_&&this.values_.hasOwnProperty(t)&&(i=this.values_[t]),i}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(t,i){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new dd(n,t,i)),n=Tr.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new dd(n,t,i))}addChangeListener(t,i){this.addEventListener(`change:${t}`,i)}removeChangeListener(t,i){this.removeEventListener(`change:${t}`,i)}set(t,i,n){const s=this.values_||(this.values_={});if(n)s[t]=i;else{const r=s[t];s[t]=i,r!==i&&this.notify(t,r)}}setProperties(t,i){for(const n in t)this.set(n,t[n],i)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,i){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t],Rr(this.values_)&&(this.values_=null),i||this.notify(t,n)}}}function bt(e,t){if(!e)throw new Error(t)}class _i extends Di{constructor(t){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_),t)if(typeof t.getSimplifiedGeometry=="function"){const i=t;this.setGeometry(i)}else{const i=t;this.setProperties(i)}}clone(){const t=new _i(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const i=this.getGeometry();i&&t.setGeometry(i.clone());const n=this.getStyle();return n&&t.setStyle(n),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(Tt(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=_t(t,at.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?Vy(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function Vy(e){if(typeof e=="function")return e;let t;return Array.isArray(e)?t=e:(bt(typeof e.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[e]),function(){return t}}const le={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Qt(e){const t=ti();for(let i=0,n=e.length;i<n;++i)Eo(t,e[i]);return t}function Xy(e,t,i){const n=Math.min.apply(null,e),s=Math.min.apply(null,t),r=Math.max.apply(null,e),o=Math.max.apply(null,t);return $i(n,s,r,o,i)}function bs(e,t,i){return i?(i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]+t,i[3]=e[3]+t,i):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function e0(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function Bs(e,t,i){let n,s;return t<e[0]?n=e[0]-t:e[2]<t?n=t-e[2]:n=0,i<e[1]?s=e[1]-i:e[3]<i?s=i-e[3]:s=0,n*n+s*s}function Ir(e,t){return Ru(e,t[0],t[1])}function fn(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function Ru(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]}function Pc(e,t){const i=e[0],n=e[1],s=e[2],r=e[3],o=t[0],a=t[1];let l=le.UNKNOWN;return o<i?l=l|le.LEFT:o>s&&(l=l|le.RIGHT),a<n?l=l|le.BELOW:a>r&&(l=l|le.ABOVE),l===le.UNKNOWN&&(l=le.INTERSECTING),l}function ti(){return[1/0,1/0,-1/0,-1/0]}function $i(e,t,i,n,s){return s?(s[0]=e,s[1]=t,s[2]=i,s[3]=n,s):[e,t,i,n]}function Gr(e){return $i(1/0,1/0,-1/0,-1/0,e)}function xo(e,t){const i=e[0],n=e[1];return $i(i,n,i,n,t)}function Iu(e,t,i,n,s){const r=Gr(s);return n0(r,e,t,i,n)}function Pr(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function i0(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function Eo(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function n0(e,t,i,n,s){for(;i<n;i+=s)$y(e,t[i],t[i+1]);return e}function $y(e,t,i){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}function Pu(e,t){let i;return i=t(Jl(e)),i||(i=t(Ql(e)),i)||(i=t(th(e)),i)||(i=t(zs(e)),i)?i:!1}function bc(e){let t=0;return Dr(e)||(t=xt(e)*ue(e)),t}function Jl(e){return[e[0],e[1]]}function Ql(e){return[e[2],e[1]]}function Ki(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function Ky(e,t){let i;if(t==="bottom-left")i=Jl(e);else if(t==="bottom-right")i=Ql(e);else if(t==="top-left")i=zs(e);else if(t==="top-right")i=th(e);else throw new Error("Invalid corner");return i}function ul(e,t,i,n,s){const[r,o,a,l,h,c,u,f]=s0(e,t,i,n);return $i(Math.min(r,a,h,u),Math.min(o,l,c,f),Math.max(r,a,h,u),Math.max(o,l,c,f),s)}function s0(e,t,i,n){const s=t*n[0]/2,r=t*n[1]/2,o=Math.cos(i),a=Math.sin(i),l=s*o,h=s*a,c=r*o,u=r*a,f=e[0],d=e[1];return[f-l+u,d-h-c,f-l-u,d-h+c,f+l-u,d+h+c,f+l+u,d+h-c,f-l+u,d-h-c]}function ue(e){return e[3]-e[1]}function Jn(e,t,i){const n=i||ti();return Fe(e,t)?(e[0]>t[0]?n[0]=e[0]:n[0]=t[0],e[1]>t[1]?n[1]=e[1]:n[1]=t[1],e[2]<t[2]?n[2]=e[2]:n[2]=t[2],e[3]<t[3]?n[3]=e[3]:n[3]=t[3]):Gr(n),n}function zs(e){return[e[0],e[3]]}function th(e){return[e[2],e[3]]}function xt(e){return e[2]-e[0]}function Fe(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Dr(e){return e[2]<e[0]||e[3]<e[1]}function Yy(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}function qy(e,t,i){let n=!1;const s=Pc(e,t),r=Pc(e,i);if(s===le.INTERSECTING||r===le.INTERSECTING)n=!0;else{const o=e[0],a=e[1],l=e[2],h=e[3],c=t[0],u=t[1],f=i[0],d=i[1],g=(d-u)/(f-c);let _,m;r&le.ABOVE&&!(s&le.ABOVE)&&(_=f-(d-h)/g,n=_>=o&&_<=l),!n&&r&le.RIGHT&&!(s&le.RIGHT)&&(m=d-(f-l)*g,n=m>=a&&m<=h),!n&&r&le.BELOW&&!(s&le.BELOW)&&(_=f-(d-a)/g,n=_>=o&&_<=l),!n&&r&le.LEFT&&!(s&le.LEFT)&&(m=d-(f-o)*g,n=m>=a&&m<=h)}return n}function Hy(e,t,i,n){if(Dr(e))return Gr(i);let s=[];s=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]],t(s,s,2);const r=[],o=[];for(let a=0,l=s.length;a<l;a+=2)r.push(s[a]),o.push(s[a+1]);return Xy(r,o,i)}function r0(e,t){const i=t.getExtent(),n=Ki(e);if(t.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){const s=xt(i),o=Math.floor((n[0]-i[0])/s)*s;e[0]-=o,e[2]-=o}return e}function o0(e,t,i){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[n[0],e[1],n[2],e[3]]];r0(e,t);const s=xt(n);if(xt(e)>s&&!i)return[[n[0],e[1],n[2],e[3]]];if(e[0]<n[0])return[[e[0]+s,e[1],n[2],e[3]],[n[0],e[1],e[2],e[3]]];if(e[2]>n[2])return[[e[0],e[1],n[2],e[3]],[n[0],e[1],e[2]-s,e[3]]]}return[e]}function a0(...e){console.warn(...e)}function Bt(e,t,i){return Math.min(Math.max(e,t),i)}function Zy(e,t,i,n,s,r){const o=s-i,a=r-n;if(o!==0||a!==0){const l=((e-i)*o+(t-n)*a)/(o*o+a*a);l>1?(i=s,n=r):l>0&&(i+=o*l,n+=a*l)}return _n(e,t,i,n)}function _n(e,t,i,n){const s=i-e,r=n-t;return s*s+r*r}function Jy(e){const t=e.length;for(let n=0;n<t;n++){let s=n,r=Math.abs(e[n][n]);for(let a=n+1;a<t;a++){const l=Math.abs(e[a][n]);l>r&&(r=l,s=a)}if(r===0)return null;const o=e[s];e[s]=e[n],e[n]=o;for(let a=n+1;a<t;a++){const l=-e[a][n]/e[n][n];for(let h=n;h<t+1;h++)n==h?e[a][h]=0:e[a][h]+=l*e[n][h]}}const i=new Array(t);for(let n=t-1;n>=0;n--){i[n]=e[n][t]/e[n][n];for(let s=n-1;s>=0;s--)e[s][t]-=e[s][n]*i[n]}return i}function gd(e){return e*180/Math.PI}function Qn(e){return e*Math.PI/180}function ts(e,t){const i=e%t;return i*t<0?i+t:i}function oi(e,t,i){return e+i*(t-e)}function Nr(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}function _d(e,t){return Math.round(Nr(e,t))}function Ea(e,t){return Math.floor(Nr(e,t))}function Vn(e,t){return Math.ceil(Nr(e,t))}function Ac(e,t,i){if(e>=t&&e<i)return e;const n=i-t;return((e-t)%n+n)%n+t}function l0(e,t){const i=(""+e).split("."),n=(""+t).split(".");for(let s=0;s<Math.max(i.length,n.length);s++){const r=parseInt(i[s]||"0",10),o=parseInt(n[s]||"0",10);if(r>o)return 1;if(o>r)return-1}return 0}function Qy(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function tv(e,t){const i=t.getRadius(),n=t.getCenter(),s=n[0],r=n[1],o=e[0],a=e[1];let l=o-s;const h=a-r;l===0&&h===0&&(l=1);const c=Math.sqrt(l*l+h*h),u=s+i*l/c,f=r+i*h/c;return[u,f]}function eh(e,t){const i=e[0],n=e[1],s=t[0],r=t[1],o=s[0],a=s[1],l=r[0],h=r[1],c=l-o,u=h-a,f=c===0&&u===0?0:(c*(i-o)+u*(n-a))/(c*c+u*u||0);let d,g;return f<=0?(d=o,g=a):f>=1?(d=l,g=h):(d=o+f*c,g=a+f*u),[d,g]}function Ne(e,t){let i=!0;for(let n=e.length-1;n>=0;--n)if(e[n]!=t[n]){i=!1;break}return i}function bu(e,t){const i=Math.cos(t),n=Math.sin(t),s=e[0]*i-e[1]*n,r=e[1]*i+e[0]*n;return e[0]=s,e[1]=r,e}function ev(e,t){return e[0]*=t,e[1]*=t,e}function mn(e,t){const i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function rr(e,t){return Math.sqrt(mn(e,t))}function iv(e,t){return mn(e,eh(e,t))}function h0(e,t){if(t.canWrapX()){const i=xt(t.getExtent()),n=c0(e,t,i);n&&(e[0]-=n*i)}return e}function c0(e,t,i){const n=t.getExtent();let s=0;return t.canWrapX()&&(e[0]<n[0]||e[0]>n[2])&&(i=i||xt(n),s=Math.floor((e[0]-n[0])/i)),s}const Au={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};let As=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Au[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}};const aa=6378137,or=Math.PI*aa,nv=[-or,-or,or,or],sv=[-180,-85,180,85],Sa=aa*Math.log(Math.tan(Math.PI/2));class Xs extends As{constructor(t){super({code:t,units:"m",extent:nv,global:!0,worldExtent:sv,getPointResolution:function(i,n){return i/Math.cosh(n[1]/aa)}})}}const md=[new Xs("EPSG:3857"),new Xs("EPSG:102100"),new Xs("EPSG:102113"),new Xs("EPSG:900913"),new Xs("http://www.opengis.net/def/crs/EPSG/0/3857"),new Xs("http://www.opengis.net/gml/srs/epsg.xml#3857")];function rv(e,t,i,n){const s=e.length;i=i>1?i:2,n=n??i,t===void 0&&(i>2?t=e.slice():t=new Array(s));for(let r=0;r<s;r+=n){t[r]=or*e[r]/180;let o=aa*Math.log(Math.tan(Math.PI*(+e[r+1]+90)/360));o>Sa?o=Sa:o<-Sa&&(o=-Sa),t[r+1]=o}return t}function ov(e,t,i,n){const s=e.length;i=i>1?i:2,n=n??i,t===void 0&&(i>2?t=e.slice():t=new Array(s));for(let r=0;r<s;r+=n)t[r]=180*e[r]/or,t[r+1]=360*Math.atan(Math.exp(e[r+1]/aa))/Math.PI-90;return t}const av=6378137,pd=[-180,-90,180,90],lv=Math.PI*av/180;class ys extends As{constructor(t,i){super({code:t,units:"degrees",extent:pd,axisOrientation:i,global:!0,metersPerUnit:lv,worldExtent:pd})}}const yd=[new ys("CRS:84"),new ys("EPSG:4326","neu"),new ys("urn:ogc:def:crs:OGC:1.3:CRS84"),new ys("urn:ogc:def:crs:OGC:2:84"),new ys("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new ys("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ys("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Lc={};function Ka(e){return Lc[e]||Lc[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function hv(e,t){Lc[e]=t}let vr={};function Ls(e,t,i){const n=e.getCode(),s=t.getCode();n in vr||(vr[n]={}),vr[n][s]=i}function Ya(e,t){return e in vr&&t in vr[e]?vr[e][t]:null}const fl=.9996,Ei=.00669438,ih=Ei*Ei,nh=ih*Ei,Cs=Ei/(1-Ei),vd=Math.sqrt(1-Ei),br=(1-vd)/(1+vd),u0=br*br,Lu=u0*br,Ou=Lu*br,f0=Ou*br,d0=1-Ei/4-3*ih/64-5*nh/256,cv=3*Ei/8+3*ih/32+45*nh/1024,uv=15*ih/256+45*nh/1024,fv=35*nh/3072,dv=3/2*br-27/32*Lu+269/512*f0,gv=21/16*u0-55/32*Ou,_v=151/96*Lu-417/128*f0,mv=1097/512*Ou,dl=6378137;function pv(e,t,i){const n=e-5e5,o=(i.north?t:t-1e7)/fl/(dl*d0),a=o+dv*Math.sin(2*o)+gv*Math.sin(4*o)+_v*Math.sin(6*o)+mv*Math.sin(8*o),l=Math.sin(a),h=l*l,c=Math.cos(a),u=l/c,f=u*u,d=f*f,g=1-Ei*h,_=Math.sqrt(1-Ei*h),m=dl/_,p=(1-Ei)/g,y=Cs*c**2,S=y*y,v=n/(m*fl),M=v*v,C=M*v,P=C*v,b=P*v,T=b*v,k=a-u/p*(M/2-P/24*(5+3*f+10*y-4*S-9*Cs))+T/720*(61+90*f+298*y+45*d-252*Cs-3*S);let U=(v-C/6*(1+2*f+y)+b/120*(5-2*y+28*f-3*S+8*Cs+24*d))/c;return U=Ac(U+Qn(g0(i.number)),-Math.PI,Math.PI),[gd(U),gd(k)]}const xd=-80,Ed=84,yv=-180,vv=180;function xv(e,t,i){e=Ac(e,yv,vv),t<xd?t=xd:t>Ed&&(t=Ed);const n=Qn(t),s=Math.sin(n),r=Math.cos(n),o=s/r,a=o*o,l=a*a,h=Qn(e),c=g0(i.number),u=Qn(c),f=dl/Math.sqrt(1-Ei*s**2),d=Cs*r**2,g=r*Ac(h-u,-Math.PI,Math.PI),_=g*g,m=_*g,p=m*g,y=p*g,S=y*g,v=dl*(d0*n-cv*Math.sin(2*n)+uv*Math.sin(4*n)-fv*Math.sin(6*n)),M=fl*f*(g+m/6*(1-a+d)+y/120*(5-18*a+l+72*d-58*Cs))+5e5;let C=fl*(v+f*o*(_/2+p/24*(5-a+9*d+4*d**2)+S/720*(61-58*a+l+600*d-330*Cs)));return i.north||(C+=1e7),[M,C]}function g0(e){return(e-1)*6-180+3}const Ev=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function _0(e){let t=0;for(const s of Ev){const r=e.match(s);if(r){t=parseInt(r[1]);break}}if(!t)return null;let i=0,n=!1;return t>32700&&t<32761?i=t-32700:t>32600&&t<32661&&(n=!0,i=t-32600),i?{number:i,north:n}:null}function Sd(e,t){return function(i,n,s,r){const o=i.length;s=s>1?s:2,r=r??s,n||(s>2?n=i.slice():n=new Array(o));for(let a=0;a<o;a+=r){const l=i[a],h=i[a+1],c=e(l,h,t);n[a]=c[0],n[a+1]=c[1]}return n}}function Sv(e){return _0(e)?new As({code:e,units:"m"}):null}function Mv(e){const t=_0(e.getCode());return t?{forward:Sd(xv,t),inverse:Sd(pv,t)}:null}const wv=63710088e-1;function Md(e,t,i){i=i||wv;const n=Qn(e[1]),s=Qn(t[1]),r=(s-n)/2,o=Qn(t[0]-e[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(s);return 2*i*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}const Cv=[Mv],Tv=[Sv];let Oc=!0;function Rv(e){Oc=!1}function Fu(e,t){if(t!==void 0){for(let i=0,n=e.length;i<n;++i)t[i]=e[i];t=t}else t=e.slice();return t}function gl(e){hv(e.getCode(),e),Ls(e,e,Fu)}function Iv(e){e.forEach(gl)}function Yt(e){if(typeof e!="string")return e;const t=Ka(e);if(t)return t;for(const i of Tv){const n=i(e);if(n)return n}return null}function wd(e,t,i,n){e=Yt(e);let s;const r=e.getPointResolutionFunc();if(r)s=r(t,i);else{const o=e.getUnits();if(o=="degrees"&&!n||n=="degrees")s=t;else{const a=Du(e,Yt("EPSG:4326"));if(!a&&o!=="degrees")s=t*e.getMetersPerUnit();else{let h=[i[0]-t/2,i[1],i[0]+t/2,i[1],i[0],i[1]-t/2,i[0],i[1]+t/2];h=a(h,h,2);const c=Md(h.slice(0,2),h.slice(2,4)),u=Md(h.slice(4,6),h.slice(6,8));s=(c+u)/2}const l=e.getMetersPerUnit();l!==void 0&&(s/=l)}}return s}function Fc(e){Iv(e),e.forEach(function(t){e.forEach(function(i){t!==i&&Ls(t,i,Fu)})})}function Pv(e,t,i,n){e.forEach(function(s){t.forEach(function(r){Ls(s,r,i),Ls(r,s,n)})})}function Gu(e,t){return e?typeof e=="string"?Yt(e):e:Yt(t)}function Gc(e){return(function(t,i,n,s){const r=t.length;n=n!==void 0?n:2,s=s??n,i=i!==void 0?i:new Array(r);for(let o=0;o<r;o+=s){const a=e(t.slice(o,o+n)),l=a.length;for(let h=0,c=s;h<c;++h)i[o+h]=h>=l?t[o+h]:a[h]}return i})}function bv(e,t,i,n){const s=Yt(e),r=Yt(t);Ls(s,r,Gc(i)),Ls(r,s,Gc(n))}function pn(e,t){if(e===t)return!0;const i=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||Du(e,t)===Fu)&&i}function Du(e,t){const i=e.getCode(),n=t.getCode();let s=Ya(i,n);if(s)return s;let r=null,o=null;for(const l of Cv)r||(r=l(e)),o||(o=l(t));if(!r&&!o)return null;const a="EPSG:4326";if(o)if(r)s=Gh(r.inverse,o.forward);else{const l=Ya(i,a);l&&(s=Gh(l,o.forward))}else{const l=Ya(a,n);l&&(s=Gh(r.inverse,l))}return s&&(gl(e),gl(t),Ls(e,t,s)),s}function Gh(e,t){return function(i,n,s,r){return n=e(i,n,s,r),t(n,n,s,r)}}function Bo(e,t){const i=Yt(e),n=Yt(t);return Du(i,n)}function Nu(e,t,i){const n=Bo(t,i);if(!n){const s=Yt(t).getCode(),r=Yt(i).getCode();throw new Error(`No transform available between ${s} and ${r}`)}return n(e,void 0,e.length)}function Av(e,t,i,n){const s=Bo(t,i);return Hy(e,s,void 0)}function os(e,t){return e}function Ft(e,t){return Oc&&!Ne(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(Oc=!1,a0("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),e}function sh(e,t){return e}function dn(e,t){return e}function Cd(e,t,i){return function(n){let s,r;if(e.canWrapX()){const o=e.getExtent(),a=xt(o);n=n.slice(0),r=c0(n,e,a),r&&(n[0]=n[0]-r*a),n[0]=Bt(n[0],o[0],o[2]),n[1]=Bt(n[1],o[1],o[3]),s=i(n)}else s=i(n);return r&&t.canWrapX()&&(s[0]+=r*xt(t.getExtent())),s}}function Lv(){Fc(md),Fc(yd),Pv(yd,md,rv,ov)}Lv();new Array(6);function bi(){return[1,0,0,1,0,0]}function Ov(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function he(e,t){const i=t[0],n=t[1];return t[0]=e[0]*i+e[2]*n+e[4],t[1]=e[1]*i+e[3]*n+e[5],t}function Cn(e,t,i,n,s,r,o,a){const l=Math.sin(r),h=Math.cos(r);return e[0]=n*h,e[1]=s*l,e[2]=-n*l,e[3]=s*h,e[4]=o*n*h-a*n*l+t,e[5]=o*s*l+a*s*h+i,e}function m0(e,t){const i=Fv(t);bt(i!==0,"Transformation matrix cannot be inverted");const n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],l=t[5];return e[0]=o/i,e[1]=-s/i,e[2]=-r/i,e[3]=n/i,e[4]=(r*l-o*a)/i,e[5]=-(n*l-s*a)/i,e}function Fv(e){return e[0]*e[3]-e[1]*e[2]}const Gv=[1e5,1e5,1e5,1e5,2,2];function Dv(e){return"matrix("+e.join(", ")+")"}function Dc(e){return e.substring(7,e.length-1).split(",").map(parseFloat)}function Nv(e,t){const i=Dc(e),n=Dc(t);for(let s=0;s<6;++s)if(Math.round((i[s]-n[s])*Gv[s])!==0)return!1;return!0}function es(e,t,i,n,s,r,o){r=r||[],o=o||2;let a=0;for(let l=t;l<i;l+=n){const h=e[l],c=e[l+1];r[a++]=s[0]*h+s[2]*c+s[4],r[a++]=s[1]*h+s[3]*c+s[5];for(let u=2;u<o;u++)r[a++]=e[l+u]}return r&&r.length!=a&&(r.length=a),r}function ku(e,t,i,n,s,r,o){o=o||[];const a=Math.cos(s),l=Math.sin(s),h=r[0],c=r[1];let u=0;for(let f=t;f<i;f+=n){const d=e[f]-h,g=e[f+1]-c;o[u++]=h+d*a-g*l,o[u++]=c+d*l+g*a;for(let _=f+2;_<f+n;++_)o[u++]=e[_]}return o&&o.length!=u&&(o.length=u),o}function kv(e,t,i,n,s,r,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let u=t;u<i;u+=n){const f=e[u]-l,d=e[u+1]-h;a[c++]=l+s*f,a[c++]=h+r*d;for(let g=u+2;g<u+n;++g)a[c++]=e[g]}return a&&a.length!=c&&(a.length=c),a}function jv(e,t,i,n,s,r,o){o=o||[];let a=0;for(let l=t;l<i;l+=n){o[a++]=e[l]+s,o[a++]=e[l+1]+r;for(let h=l+2;h<l+n;++h)o[a++]=e[h]}return o&&o.length!=a&&(o.length=a),o}const Td=bi(),Bv=[NaN,NaN];class ju extends Di{constructor(){super(),this.extent_=ti(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=J_((t,i,n)=>{if(!n)return this.getSimplifiedGeometry(i);const s=this.clone();return s.applyTransform(n),s.getSimplifiedGeometry(i)})}simplifyTransformed(t,i){return this.simplifyTransformedInternal(this.getRevision(),t,i)}clone(){return St()}closestPointXY(t,i,n,s){return St()}containsXY(t,i){return this.closestPointXY(t,i,Bv,Number.MIN_VALUE)===0}getClosestPoint(t,i){return i=i||[NaN,NaN],this.closestPointXY(t[0],t[1],i,1/0),i}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return St()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const i=this.computeExtent(this.extent_);(isNaN(i[0])||isNaN(i[1]))&&Gr(i),this.extentRevision_=this.getRevision()}return Yy(this.extent_,t)}rotate(t,i){St()}scale(t,i,n){St()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return St()}getType(){return St()}applyTransform(t){St()}intersectsExtent(t){return St()}translate(t,i){St()}transform(t,i){const n=Yt(t),s=n.getUnits()=="tile-pixels"?function(r,o,a){const l=n.getExtent(),h=n.getWorldExtent(),c=ue(h)/ue(l);Cn(Td,h[0],h[3],c,-c,0,0,0);const u=es(r,0,r.length,a,Td,o),f=Bo(n,i);return f?f(u,u,a):u}:Bo(n,i);return this.applyTransform(s),this}}const zv=_e({__name:"OlFeature",props:{properties:{}},setup(e,{expose:t}){const i=e,n=Xt("vectorSource"),s=Xt("vectorLayer",null),o=Xt("heatmapLayer",null)||s,a=Xt("animation",null),l=Nt(new _i({...i.properties}));return ie(()=>i.properties,h=>{h instanceof ju?(l.value.setGeometry(h),l.value.setProperties({})):typeof h<"u"?(l.value.setGeometry(void 0),l.value.setProperties(h)):(l.value.setGeometry(void 0),l.value.setProperties({}))}),ie(()=>n,(h,c)=>{c?.value?.removeFeature(l.value),h?.value?.addFeature(l.value),h?.value?.changed()}),ei(()=>{a?.value&&o?.value?.animateFeature(l.value,a.value),__(()=>{n?.value?.addFeature(l.value)})}),wi(()=>{n?.value?.removeFeature(l.value)}),Mi("feature",l),Mi("stylable",l),t({feature:l}),(h,c)=>qi(h.$slots,"default")}});class hs extends ju{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return Iu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return St()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const i=this.getSimplifiedGeometryInternal(t);return i.getFlatCoordinates().length<this.flatCoordinates.length?i:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,i){this.stride=_l(t),this.layout=t,this.flatCoordinates=i}setCoordinates(t,i){St()}setLayout(t,i,n){let s;if(t)s=_l(t);else{for(let r=0;r<n;++r){if(i.length===0){this.layout="XY",this.stride=2;return}i=i[0]}s=i.length,t=Wv(s)}this.layout=t,this.stride=s}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,i){const n=this.getFlatCoordinates();if(n){const s=this.getStride();ku(n,0,n.length,s,t,i,n),this.changed()}}scale(t,i,n){i===void 0&&(i=t),n||(n=Ki(this.getExtent()));const s=this.getFlatCoordinates();if(s){const r=this.getStride();kv(s,0,s.length,r,t,i,n,s),this.changed()}}translate(t,i){const n=this.getFlatCoordinates();if(n){const s=this.getStride();jv(n,0,n.length,s,t,i,n),this.changed()}}}function Wv(e){let t;return e==2?t="XY":e==3?t="XYZ":e==4&&(t="XYZM"),t}function _l(e){let t;return e=="XY"?t=2:e=="XYZ"||e=="XYM"?t=3:e=="XYZM"&&(t=4),t}function Uv(e,t,i){const n=e.getFlatCoordinates();if(!n)return null;const s=e.getStride();return es(n,0,n.length,s,t,i)}function p0(e,t,i,n){let s=0;const r=e[i-n],o=e[i-n+1];let a=0,l=0;for(;t<i;t+=n){const h=e[t]-r,c=e[t+1]-o;s+=l*h-a*c,a=h,l=c}return s/2}function y0(e,t,i,n){let s=0;for(let r=0,o=i.length;r<o;++r){const a=i[r];s+=p0(e,t,a,n),t=a}return s}function Vv(e,t,i,n){let s=0;for(let r=0,o=i.length;r<o;++r){const a=i[r];s+=y0(e,t,a,n),t=a[a.length-1]}return s}function Rd(e,t,i,n,s,r,o){const a=e[t],l=e[t+1],h=e[i]-a,c=e[i+1]-l;let u;if(h===0&&c===0)u=t;else{const f=((s-a)*h+(r-l)*c)/(h*h+c*c);if(f>1)u=i;else if(f>0){for(let d=0;d<n;++d)o[d]=oi(e[t+d],e[i+d],f);o.length=n;return}else u=t}for(let f=0;f<n;++f)o[f]=e[u+f];o.length=n}function Bu(e,t,i,n,s){let r=e[t],o=e[t+1];for(t+=n;t<i;t+=n){const a=e[t],l=e[t+1],h=_n(r,o,a,l);h>s&&(s=h),r=a,o=l}return s}function zu(e,t,i,n,s){for(let r=0,o=i.length;r<o;++r){const a=i[r];s=Bu(e,t,a,n,s),t=a}return s}function Xv(e,t,i,n,s){for(let r=0,o=i.length;r<o;++r){const a=i[r];s=zu(e,t,a,n,s),t=a[a.length-1]}return s}function Wu(e,t,i,n,s,r,o,a,l,h,c){if(t==i)return h;let u,f;if(s===0){if(f=_n(o,a,e[t],e[t+1]),f<h){for(u=0;u<n;++u)l[u]=e[t+u];return l.length=n,f}return h}c=c||[NaN,NaN];let d=t+n;for(;d<i;)if(Rd(e,d-n,d,n,o,a,c),f=_n(o,a,c[0],c[1]),f<h){for(h=f,u=0;u<n;++u)l[u]=c[u];l.length=n,d+=n}else d+=n*Math.max((Math.sqrt(f)-Math.sqrt(h))/s|0,1);if(r&&(Rd(e,i-n,t,n,o,a,c),f=_n(o,a,c[0],c[1]),f<h)){for(h=f,u=0;u<n;++u)l[u]=c[u];l.length=n}return h}function Uu(e,t,i,n,s,r,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,f=i.length;u<f;++u){const d=i[u];h=Wu(e,t,d,n,s,r,o,a,l,h,c),t=d}return h}function $v(e,t,i,n,s,r,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,f=i.length;u<f;++u){const d=i[u];h=Uu(e,t,d,n,s,r,o,a,l,h,c),t=d[d.length-1]}return h}function v0(e,t,i,n){for(let s=0,r=i.length;s<r;++s)e[t++]=i[s];return t}function rh(e,t,i,n){for(let s=0,r=i.length;s<r;++s){const o=i[s];for(let a=0;a<n;++a)e[t++]=o[a]}return t}function Vu(e,t,i,n,s){s=s||[];let r=0;for(let o=0,a=i.length;o<a;++o){const l=rh(e,t,i[o],n);s[r++]=l,t=l}return s.length=r,s}function Kv(e,t,i,n,s){s=s||[];let r=0;for(let o=0,a=i.length;o<a;++o){const l=Vu(e,t,i[o],n,s[r]);l.length===0&&(l[0]=t),s[r++]=l,t=l[l.length-1]}return s.length=r,s}function Xn(e,t,i,n,s){s=s!==void 0?s:[];let r=0;for(let o=t;o<i;o+=n)s[r++]=e.slice(o,o+n);return s.length=r,s}function zo(e,t,i,n,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=i.length;o<a;++o){const l=i[o];s[r++]=Xn(e,t,l,n,s[r]),t=l}return s.length=r,s}function Nc(e,t,i,n,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=i.length;o<a;++o){const l=i[o];s[r++]=l.length===1&&l[0]===t?[]:zo(e,t,l,n,s[r]),t=l[l.length-1]}return s.length=r,s}function oh(e,t,i,n,s,r,o){const a=(i-t)/n;if(a<3){for(;t<i;t+=n)r[o++]=e[t],r[o++]=e[t+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[t,i-n];let c=0;for(;h.length>0;){const u=h.pop(),f=h.pop();let d=0;const g=e[f],_=e[f+1],m=e[u],p=e[u+1];for(let y=f+n;y<u;y+=n){const S=e[y],v=e[y+1],M=Zy(S,v,g,_,m,p);M>d&&(c=y,d=M)}d>s&&(l[(c-t)/n]=1,f+n<c&&h.push(f,c),c+n<u&&h.push(c,u))}for(let u=0;u<a;++u)l[u]&&(r[o++]=e[t+u*n],r[o++]=e[t+u*n+1]);return o}function x0(e,t,i,n,s,r,o,a){for(let l=0,h=i.length;l<h;++l){const c=i[l];o=oh(e,t,c,n,s,r,o),a.push(o),t=c}return o}function Es(e,t){return t*Math.round(e/t)}function Yv(e,t,i,n,s,r,o){if(t==i)return o;let a=Es(e[t],s),l=Es(e[t+1],s);t+=n,r[o++]=a,r[o++]=l;let h,c;do if(h=Es(e[t],s),c=Es(e[t+1],s),t+=n,t==i)return r[o++]=h,r[o++]=c,o;while(h==a&&c==l);for(;t<i;){const u=Es(e[t],s),f=Es(e[t+1],s);if(t+=n,u==h&&f==c)continue;const d=h-a,g=c-l,_=u-a,m=f-l;if(d*m==g*_&&(d<0&&_<d||d==_||d>0&&_>d)&&(g<0&&m<g||g==m||g>0&&m>g)){h=u,c=f;continue}r[o++]=h,r[o++]=c,a=h,l=c,h=u,c=f}return r[o++]=h,r[o++]=c,o}function Xu(e,t,i,n,s,r,o,a){for(let l=0,h=i.length;l<h;++l){const c=i[l];o=Yv(e,t,c,n,s,r,o),a.push(o),t=c}return o}function qv(e,t,i,n,s,r,o,a){for(let l=0,h=i.length;l<h;++l){const c=i[l],u=[];o=Xu(e,t,c,n,s,r,o,u),a.push(u),t=c[c.length-1]}return o}class Wo extends hs{constructor(t,i){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,i!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(i,t):this.setCoordinates(t,i)}clone(){return new Wo(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,i,n,s){return s<Bs(this.getExtent(),t,i)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Bu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,i,n,s))}getArea(){return p0(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Xn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const i=[];return i.length=oh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new Wo(i,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,i){this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=rh(this.flatCoordinates,0,t,this.stride),this.changed()}}let yn=class E0 extends hs{constructor(t,i){super(),this.setCoordinates(t,i)}clone(){const t=new E0(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,i,n,s){const r=this.flatCoordinates,o=_n(t,i,r[0],r[1]);if(o<s){const a=this.stride;for(let l=0;l<a;++l)n[l]=r[l];return n.length=a,o}return s}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return xo(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return Ru(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=v0(this.flatCoordinates,0,t,this.stride),this.changed()}};function Hv(e,t,i,n,s){return!Pu(s,function(o){return!Ts(e,t,i,n,o[0],o[1])})}function Ts(e,t,i,n,s,r){let o=0,a=e[i-n],l=e[i-n+1];for(;t<i;t+=n){const h=e[t],c=e[t+1];l<=r?c>r&&(h-a)*(r-l)-(s-a)*(c-l)>0&&o++:c<=r&&(h-a)*(r-l)-(s-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function $u(e,t,i,n,s,r){if(i.length===0||!Ts(e,t,i[0],n,s,r))return!1;for(let o=1,a=i.length;o<a;++o)if(Ts(e,i[o-1],i[o],n,s,r))return!1;return!0}function Zv(e,t,i,n,s,r){if(i.length===0)return!1;for(let o=0,a=i.length;o<a;++o){const l=i[o];if($u(e,t,l,n,s,r))return!0;t=l[l.length-1]}return!1}function Ku(e,t,i,n,s,r,o){let a,l,h,c,u,f,d;const g=s[r+1],_=[];for(let y=0,S=i.length;y<S;++y){const v=i[y];for(c=e[v-n],f=e[v-n+1],a=t;a<v;a+=n)u=e[a],d=e[a+1],(g<=f&&d<=g||f<=g&&g<=d)&&(h=(g-f)/(d-f)*(u-c)+c,_.push(h)),c=u,f=d}let m=NaN,p=-1/0;for(_.sort(gn),c=_[0],a=1,l=_.length;a<l;++a){u=_[a];const y=Math.abs(u-c);y>p&&(h=(c+u)/2,$u(e,t,i,n,h,g)&&(m=h,p=y)),c=u}return isNaN(m)&&(m=s[r]),o?(o.push(m,g,p),o):[m,g,p]}function S0(e,t,i,n,s){let r=[];for(let o=0,a=i.length;o<a;++o){const l=i[o];r=Ku(e,t,l,n,s,2*o,r),t=l[l.length-1]}return r}function M0(e,t,i,n,s){let r;for(t+=n;t<i;t+=n)if(r=s(e.slice(t-n,t),e.slice(t,t+n)),r)return r;return!1}function Id(e,t){const[i,n]=e,[s,r]=t,o=((i[0]-s[0])*(s[1]-r[1])-(i[1]-s[1])*(s[0]-r[0]))/((i[0]-n[0])*(s[1]-r[1])-(i[1]-n[1])*(s[0]-r[0])),a=((i[0]-s[0])*(i[1]-n[1])-(i[1]-s[1])*(i[0]-n[0]))/((i[0]-n[0])*(s[1]-r[1])-(i[1]-n[1])*(s[0]-r[0]));if(0<=o&&o<=1&&0<=a&&a<=1)return[i[0]+o*(n[0]-i[0]),i[1]+o*(n[1]-i[1])]}function ah(e,t,i,n,s,r){return r=r??n0(ti(),e,t,i,n),Fe(s,r)?r[0]>=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:M0(e,t,i,n,function(o,a){return qy(s,o,a)}):!1}function Jv(e,t,i,n,s){for(let r=0,o=i.length;r<o;++r){if(ah(e,t,i[r],n,s))return!0;t=i[r]}return!1}function w0(e,t,i,n,s){return!!(ah(e,t,i,n,s)||Ts(e,t,i,n,s[0],s[1])||Ts(e,t,i,n,s[0],s[3])||Ts(e,t,i,n,s[2],s[1])||Ts(e,t,i,n,s[2],s[3]))}function C0(e,t,i,n,s){if(!w0(e,t,i[0],n,s))return!1;if(i.length===1)return!0;for(let r=1,o=i.length;r<o;++r)if(Hv(e,i[r-1],i[r],n,s)&&!ah(e,i[r-1],i[r],n,s))return!1;return!0}function Qv(e,t,i,n,s){for(let r=0,o=i.length;r<o;++r){const a=i[r];if(C0(e,t,a,n,s))return!0;t=a[a.length-1]}return!1}function tx(e,t,i,n){for(;t<i-n;){for(let s=0;s<n;++s){const r=e[t+s];e[t+s]=e[i-n+s],e[i-n+s]=r}t+=n,i-=n}}function Yu(e,t,i,n){let s=0,r=e[i-n],o=e[i-n+1];for(;t<i;t+=n){const a=e[t],l=e[t+1];s+=(a-r)*(l+o),r=a,o=l}return s===0?void 0:s>0}function T0(e,t,i,n,s){s=s!==void 0?s:!1;for(let r=0,o=i.length;r<o;++r){const a=i[r],l=Yu(e,t,a,n);if(r===0){if(s&&l||!s&&!l)return!1}else if(s&&!l||!s&&l)return!1;t=a}return!0}function ex(e,t,i,n,s){for(let r=0,o=i.length;r<o;++r){const a=i[r];if(!T0(e,t,a,n,s))return!1;a.length&&(t=a[a.length-1])}return!0}function kc(e,t,i,n,s){s=s!==void 0?s:!1;for(let r=0,o=i.length;r<o;++r){const a=i[r],l=Yu(e,t,a,n);(r===0?s&&l||!s&&!l:s&&!l||!s&&l)&&tx(e,t,a,n),t=a}return t}function Pd(e,t,i,n,s){for(let r=0,o=i.length;r<o;++r)t=kc(e,t,i[r],n,s);return t}function ix(e,t){const i=[];let n=0,s=0,r;for(let o=0,a=t.length;o<a;++o){const l=t[o],h=Yu(e,n,l,2);if(r===void 0&&(r=h),h===r)i.push(t.slice(s,o+1));else{if(i.length===0)continue;i[i.length-1].push(t[s])}s=o+1,n=l}return i}class Fi extends hs{constructor(t,i,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,i!==void 0&&n?(this.setFlatCoordinates(i,t),this.ends_=n):this.setCoordinates(t,i)}appendLinearRing(t){this.flatCoordinates?xi(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Fi(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,i,n,s){return s<Bs(this.getExtent(),t,i)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(zu(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Uu(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,i,n,s))}containsXY(t,i){return $u(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)}getArea(){return y0(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let i;return t!==void 0?(i=this.getOrientedFlatCoordinates().slice(),kc(i,0,this.ends_,this.stride,t)):i=this.flatCoordinates,zo(i,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Ki(this.getExtent());this.flatInteriorPoint_=Ku(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new yn(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new Wo(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,i=this.flatCoordinates,n=this.ends_,s=[];let r=0;for(let o=0,a=n.length;o<a;++o){const l=n[o],h=new Wo(i.slice(r,l),t);s.push(h),r=l}return s}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;T0(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=kc(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const i=[],n=[];return i.length=Xu(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,n),new Fi(i,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return C0(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,i){this.setLayout(i,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=Vu(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}}function bd(e){if(Dr(e))throw new Error("Cannot create polygon from empty extent");const t=e[0],i=e[1],n=e[2],s=e[3],r=[t,i,t,s,n,s,n,i,t,i];return new Fi(r,"XY",[r.length])}function nx(e,t,i){t=t||32;const n=e.getStride(),s=e.getLayout(),r=e.getCenter(),o=n*(t+1),a=new Array(o);for(let c=0;c<o;c+=n){a[c]=0,a[c+1]=0;for(let u=2;u<n;u++)a[c+u]=r[u]}const l=[a.length],h=new Fi(a,s,l);return sx(h,r,e.getRadius()),h}function sx(e,t,i,n){const s=e.getFlatCoordinates(),r=e.getStride(),o=s.length/r-1,a=0;for(let l=0;l<=o;++l){const h=l*r,c=a+ts(l,o)*2*Math.PI/o;s[h]=t[0]+i*Math.cos(c),s[h+1]=t[1]+i*Math.sin(c)}e.changed()}function rx(e){if("styles"in e){const{styles:t,...i}=Ul(ia(e));return{style:t,...i}}else return e}function Pn(e){const t=ql();let i={debug:!1};t&&(i=Xt("ol-options",i));const n=rx(e),s=ia(n);return i?.debug&&console.debug("[Vue3-OpenLayers Debug] PROPS",{in:e,out:s}),s}const R0=["change","error","propertychange"],ox=["change:extent","change:maxResolution","change:maxZoom","change:minResolution","change:minZoom","change:opacity","change:source","change:visible","change:zIndex","postrender","prerender","sourceready"],ax=["tileloadend","tileloaderror","tileloadstart"],lx=["imageloadend","imageloaderror","imageloadstart"],hx=["addfeature","changefeature","clear","featuresloadend","featuresloaderror","featuresloadstart","removefeature"];function kr(e,t){const i=ql();let n={debug:!1};i&&(n=Xt("ol-options",n));function s(){[...R0,...t].forEach(r=>{let o;de(e)?o=e.value:o=e,o.on(r,(...a)=>{n?.debug&&console.debug("[Vue3-OpenLayers Debug] EVENT",r,{eventName:r,args:a,source:e}),i?.emit(r,...a)})})}return i&&ei(()=>{s()}),{updateOpenLayersEventHandlers:s}}const te={ADD:"add",REMOVE:"remove"},Ad={LENGTH:"length"};class Ma extends ii{constructor(t,i,n){super(t),this.element=i,this.index=n}}class Me extends Di{constructor(t,i){if(super(),this.on,this.once,this.un,i=i||{},this.unique_=!!i.unique,this.array_=t??[],this.unique_)for(let n=1,s=this.array_.length;n<s;++n)this.assertUnique_(this.array_[n],n);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let i=0,n=t.length;i<n;++i)this.push(t[i]);return this}forEach(t){const i=this.array_;for(let n=0,s=i.length;n<s;++n)t(i[n],n,i)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(Ad.LENGTH)}insertAt(t,i){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(i),this.array_.splice(t,0,i),this.updateLength_(),this.dispatchEvent(new Ma(te.ADD,i,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){const i=this.getLength();return this.insertAt(i,t),this.getLength()}remove(t){const i=this.array_;for(let n=0,s=i.length;n<s;++n)if(i[n]===t)return this.removeAt(n)}removeAt(t){if(t<0||t>=this.getLength())return;const i=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Ma(te.REMOVE,i,t)),i}setAt(t,i){const n=this.getLength();if(t>=n){this.insertAt(t,i);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(i,t);const s=this.array_[t];this.array_[t]=i,this.dispatchEvent(new Ma(te.REMOVE,s,t)),this.dispatchEvent(new Ma(te.ADD,i,t))}updateLength_(){this.set(Ad.LENGTH,this.array_.length)}assertUnique_(t,i){const n=this.array_;for(let s=0,r=n.length;s<r;++s)if(n[s]===t&&s!==i)throw new Error("Duplicate item added to a unique collection")}}class tr extends ii{constructor(t,i,n){super(t),this.map=i,this.frameState=n!==void 0?n:null}}class an extends tr{constructor(t,i,n,s,r,o){super(t,i,r),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=s!==void 0?s:!1,this.activePointers=o}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const vt={SINGLECLICK:"singleclick",CLICK:at.CLICK,DBLCLICK:at.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Os=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",cx=Os.includes("safari")&&!Os.includes("chrom");cx&&(Os.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Os));const ux=Os.includes("webkit")&&!Os.includes("edge"),I0=Os.includes("macintosh"),fx=typeof devicePixelRatio<"u"?devicePixelRatio:1,mi=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,P0=typeof Image<"u"&&Image.prototype.decode,dx=typeof createImageBitmap=="function",b0=(function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return e})(),jc={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class gx extends ra{constructor(t,i){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=i===void 0?1:i,this.down_=null;const n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=_t(n,jc.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=_t(n,jc.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(at.TOUCHMOVE,this.boundHandleTouchMove_,b0?{passive:!1}:!1)}emulateClick_(t){let i=new an(vt.CLICK,this.map_,t);this.dispatchEvent(i),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,i=new an(vt.DBLCLICK,this.map_,t),this.dispatchEvent(i)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const n=new an(vt.SINGLECLICK,this.map_,t);this.dispatchEvent(n)},250)}updateActivePointers_(t){const i=t,n=i.pointerId;if(i.type==vt.POINTERUP||i.type==vt.POINTERCANCEL){delete this.trackedTouches_[n];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==i.target){delete this.trackedTouches_[s];break}}else(i.type==vt.POINTERDOWN||i.type==vt.POINTERMOVE)&&(this.trackedTouches_[n]=i);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const i=new an(vt.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(i),this.emulateClicks_&&!i.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(Tt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const i=new an(vt.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(i),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(_t(n,vt.POINTERMOVE,this.handlePointerMove_,this),_t(n,vt.POINTERUP,this.handlePointerUp_,this),_t(this.element_,vt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(_t(this.element_.getRootNode(),vt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const i=new an(vt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(i)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const i=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new an(vt.POINTERMOVE,this.map_,t,i))}handleTouchMove_(t){const i=this.originalPointerMoveEvent_;(!i||i.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(Tt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(at.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Tt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Tt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const ln={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},Ie={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},nt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},ml=1/0;class _x{constructor(t,i){this.priorityFunction_=t,this.keyFunction_=i,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,js(this.queuedElements_)}dequeue(){const t=this.elements_,i=this.priorities_,n=t[0];t.length==1?(t.length=0,i.length=0):(t[0]=t.pop(),i[0]=i.pop(),this.siftUp_(0));const s=this.keyFunction_(n);return delete this.queuedElements_[s],n}enqueue(t){bt(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const i=this.priorityFunction_(t);return i!=ml?(this.elements_.push(t),this.priorities_.push(i),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const i=this.elements_,n=this.priorities_,s=i.length,r=i[t],o=n[t],a=t;for(;t<s>>1;){const l=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),c=h<s&&n[h]<n[l]?h:l;i[t]=i[c],n[t]=n[c],t=c}i[t]=r,n[t]=o,this.siftDown_(a,t)}siftDown_(t,i){const n=this.elements_,s=this.priorities_,r=n[i],o=s[i];for(;i>t;){const a=this.getParentIndex_(i);if(s[a]>o)n[i]=n[a],s[i]=s[a],i=a;else break}n[i]=r,s[i]=o}reprioritize(){const t=this.priorityFunction_,i=this.elements_,n=this.priorities_;let s=0;const r=i.length;let o,a,l;for(a=0;a<r;++a)o=i[a],l=t(o),l==ml?delete this.queuedElements_[this.keyFunction_(o)]:(n[s]=l,i[s++]=o);i.length=s,n.length=s,this.heapify_()}}class mx extends _x{constructor(t,i){super(n=>t.apply(null,n),n=>n[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=i,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const i=super.enqueue(t);return i&&t[0].addEventListener(at.CHANGE,this.boundHandleTileChange_),i}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const i=t.target,n=i.getState();if(n===nt.LOADED||n===nt.ERROR||n===nt.EMPTY){n!==nt.ERROR&&i.removeEventListener(at.CHANGE,this.boundHandleTileChange_);const s=i.getKey();s in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[s],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,i){let n=0;for(;this.tilesLoading_<t&&n<i&&this.getCount()>0;){const s=this.dequeue()[0],r=s.getKey();s.getState()===nt.IDLE&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++n,s.load())}}}function px(e,t,i,n,s){if(!e||!(i in e.wantedTiles)||!e.wantedTiles[i][t.getKey()])return ml;const r=e.viewState.center,o=n[0]-r[0],a=n[1]-r[1];return 65536*Math.log(s)+Math.sqrt(o*o+a*a)/s}const be={ANIMATING:0,INTERACTING:1},Ci={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function Ld(e,t,i){return(function(n,s,r,o,a){if(!n)return;if(!s&&!t)return n;const l=t?0:r[0]*s,h=t?0:r[1]*s,c=a?a[0]:0,u=a?a[1]:0;let f=e[0]+l/2+c,d=e[2]-l/2+c,g=e[1]+h/2+u,_=e[3]-h/2+u;f>d&&(f=(d+f)/2,d=f),g>_&&(g=(_+g)/2,_=g);let m=Bt(n[0],f,d),p=Bt(n[1],g,_);if(o&&i&&s){const y=30*s;m+=-y*Math.log(1+Math.max(0,f-n[0])/y)+y*Math.log(1+Math.max(0,n[0]-d)/y),p+=-y*Math.log(1+Math.max(0,g-n[1])/y)+y*Math.log(1+Math.max(0,n[1]-_)/y)}return[m,p]})}function yx(e){return e}function A0(e){return Math.pow(e,3)}function jr(e){return 1-A0(1-e)}function vx(e){return 3*e*e-2*e*e*e}function xx(e){return e}function qu(e,t,i,n){const s=xt(t)/i[0],r=ue(t)/i[1];return n?Math.min(e,Math.max(s,r)):Math.min(e,Math.min(s,r))}function Hu(e,t,i){let n=Math.min(e,t);const s=50;return n*=Math.log(1+s*Math.max(0,e/t-1))/s+1,i&&(n=Math.max(n,i),n/=Math.log(1+s*Math.max(0,i/e-1))/s+1),Bt(n,i/2,t*2)}function Ex(e,t,i,n){return t=t!==void 0?t:!0,(function(s,r,o,a){if(s!==void 0){const l=e[0],h=e[e.length-1],c=i?qu(l,i,o,n):l;if(a)return t?Hu(s,c,h):Bt(s,h,c);const u=Math.min(c,s),f=Math.floor(Zl(e,u,r));return e[f]>c&&f<e.length-1?e[f+1]:e[f]}})}function Sx(e,t,i,n,s,r){return n=n!==void 0?n:!0,i=i!==void 0?i:0,(function(o,a,l,h){if(o!==void 0){const c=s?qu(t,s,l,r):t;if(h)return n?Hu(o,c,i):Bt(o,i,c);const u=1e-9,f=Math.ceil(Math.log(t/c)/Math.log(e)-u),d=-a*(.5-u)+.5,g=Math.min(c,o),_=Math.floor(Math.log(t/g)/Math.log(e)+d),m=Math.max(f,_),p=t/Math.pow(e,m);return Bt(p,i,c)}})}function Od(e,t,i,n,s){return i=i!==void 0?i:!0,(function(r,o,a,l){if(r!==void 0){const h=n?qu(e,n,a,s):e;return!i||!l?Bt(r,t,h):Hu(r,h,t)}})}function Zu(e){if(e!==void 0)return 0}function Fd(e){if(e!==void 0)return e}function Mx(e){const t=2*Math.PI/e;return(function(i,n){if(n)return i;if(i!==void 0)return i=Math.floor(i/t+.5)*t,i})}function wx(e){const t=Qn(5);return(function(i,n){return n||i===void 0?i:Math.abs(i)<=t?0:i})}const Cx=42,Ju=256,Dh=0;class zi extends Di{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Gu(t.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,t.projection&&Rv(),t.center&&(t.center=Ft(t.center,this.projection_)),t.extent&&(t.extent=dn(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const i=Object.assign({},t);for(const a in Ci)delete i[a];this.setProperties(i,!0);const n=Rx(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;const s=Tx(t),r=n.constraint,o=Ix(t);this.constraints_={center:s,resolution:r,rotation:o},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let i=this.padding_;this.padding_=t;const n=this.getCenterInternal();if(n){const s=t||[0,0,0,0];i=i||[0,0,0,0];const r=this.getResolution(),o=r/2*(s[3]-i[3]+i[1]-s[1]),a=r/2*(s[0]-i[0]+i[2]-s[2]);this.setCenterInternal([n[0]+o,n[1]-a])}}getUpdatedOptions_(t){const i=this.getProperties();return i.resolution!==void 0?i.resolution=this.getResolution():i.zoom=this.getZoom(),i.center=this.getCenterInternal(),i.rotation=this.getRotation(),Object.assign({},i,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const i=new Array(arguments.length);for(let n=0;n<i.length;++n){let s=arguments[n];s.center&&(s=Object.assign({},s),s.center=Ft(s.center,this.getProjection())),s.anchor&&(s=Object.assign({},s),s.anchor=Ft(s.anchor,this.getProjection())),i[n]=s}this.animateInternal.apply(this,i)}animateInternal(t){let i=arguments.length,n;i>1&&typeof arguments[i-1]=="function"&&(n=arguments[i-1],--i);let s=0;for(;s<i&&!this.isDef();++s){const c=arguments[s];c.center&&this.setCenterInternal(c.center),c.zoom!==void 0?this.setZoom(c.zoom):c.resolution&&this.setResolution(c.resolution),c.rotation!==void 0&&this.setRotation(c.rotation)}if(s===i){n&&wa(n,!0);return}let r=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const h=[];for(;s<i;++s){const c=arguments[s],u={start:r,complete:!1,anchor:c.anchor,duration:c.duration!==void 0?c.duration:1e3,easing:c.easing||vx,callback:n};if(c.center&&(u.sourceCenter=o,u.targetCenter=c.center.slice(),o=u.targetCenter),c.zoom!==void 0?(u.sourceResolution=a,u.targetResolution=this.getResolutionForZoom(c.zoom),a=u.targetResolution):c.resolution&&(u.sourceResolution=a,u.targetResolution=c.resolution,a=u.targetResolution),c.rotation!==void 0){u.sourceRotation=l;const f=ts(c.rotation-l+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=l+f,l=u.targetRotation}Px(u)?u.complete=!0:r+=u.duration,h.push(u)}this.animations_.push(h),this.setHint(be.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[be.ANIMATING]>0}getInteracting(){return this.hints_[be.INTERACTING]>0}cancelAnimations(){this.setHint(be.ANIMATING,-this.hints_[be.ANIMATING]);let t;for(let i=0,n=this.animations_.length;i<n;++i){const s=this.animations_[i];if(s[0].callback&&wa(s[0].callback,!1),!t)for(let r=0,o=s.length;r<o;++r){const a=s[r];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,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 t=Date.now();let i=!1;for(let n=this.animations_.length-1;n>=0;--n){const s=this.animations_[n];let r=!0;for(let o=0,a=s.length;o<a;++o){const l=s[o];if(l.complete)continue;const h=t-l.start;let c=l.duration>0?h/l.duration:1;c>=1?(l.complete=!0,c=1):r=!1;const u=l.easing(c);if(l.sourceCenter){const f=l.sourceCenter[0],d=l.sourceCenter[1],g=l.targetCenter[0],_=l.targetCenter[1];this.nextCenter_=l.targetCenter;const m=f+u*(g-f),p=d+u*(_-d);this.targetCenter_=[m,p]}if(l.sourceResolution&&l.targetResolution){const f=u===1?l.targetResolution:l.sourceResolution+u*(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=u===1?ts(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(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),i=!0,!l.complete)break}if(r){this.animations_[n]=null,this.setHint(be.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&wa(o,!0)}}this.animations_=this.animations_.filter(Boolean),i&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,i){let n;const s=this.getCenterInternal();return s!==void 0&&(n=[s[0]-i[0],s[1]-i[1]],bu(n,t-this.getRotation()),Qy(n,i)),n}calculateCenterZoom(t,i){let n;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=i[0]-t*(i[0]-s[0])/r,a=i[1]-t*(i[1]-s[1])/r;n=[o,a]}return n}getViewportSize_(t){const i=this.viewportSize_;if(t){const n=i[0],s=i[1];return[Math.abs(n*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(s*Math.cos(t))]}return i}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&os(t,this.getProjection())}getCenterInternal(){return this.get(Ci.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const i=this.calculateExtentInternal(t);return sh(i,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const i=this.getCenterInternal();bt(i,"The view center is not defined");const n=this.getResolution();bt(n!==void 0,"The view resolution is not defined");const s=this.getRotation();return bt(s!==void 0,"The view rotation is not defined"),ul(i,n,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Ci.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,i){return this.getResolutionForExtentInternal(dn(t,this.getProjection()),i)}getResolutionForExtentInternal(t,i){i=i||this.getViewportSizeMinusPadding_();const n=xt(t)/i[0],s=ue(t)/i[1];return Math.max(n,s)}getResolutionForValueFunction(t){t=t||2;const i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(i/n)/Math.log(t);return(function(r){return i/Math.pow(t,r*s)})}getRotation(){return this.get(Ci.ROTATION)}getValueForResolutionFunction(t){const i=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(n/s)/i;return(function(o){return Math.log(n/o)/i/r})}getViewportSizeMinusPadding_(t){let i=this.getViewportSize_(t);const n=this.padding_;return n&&(i=[i[0]-n[1]-n[3],i[1]-n[0]-n[2]]),i}getState(){const t=this.getProjection(),i=this.getResolution(),n=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=Nh(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],i,n)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:i,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const i=this.getResolution();return i!==void 0&&(t=this.getZoomForResolution(i)),t}getZoomForResolution(t){let i=this.minZoom_||0,n,s;if(this.resolutions_){const r=Zl(this.resolutions_,t,1);i=r,n=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=n/this.resolutions_[r+1]}else n=this.maxResolution_,s=this.zoomFactor_;return i+Math.log(n/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const i=Bt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[i]/this.resolutions_[i+1];return this.resolutions_[i]/Math.pow(n,Bt(t-i,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,i){let n;if(bt(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){bt(!Dr(t),"Cannot fit empty extent provided as `geometry`");const s=dn(t,this.getProjection());n=bd(s)}else if(t.getType()==="Circle"){const s=dn(t.getExtent(),this.getProjection());n=bd(s),n.rotate(this.getRotation(),Ki(s))}else n=t;this.fitInternal(n,i)}rotatedExtentForGeometry(t){const i=this.getRotation(),n=Math.cos(i),s=Math.sin(-i),r=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,h=-1/0,c=-1/0;for(let u=0,f=r.length;u<f;u+=o){const d=r[u]*n-r[u+1]*s,g=r[u]*s+r[u+1]*n;a=Math.min(a,d),l=Math.min(l,g),h=Math.max(h,d),c=Math.max(c,g)}return[a,l,h,c]}fitInternal(t,i){i=i||{};let n=i.size;n||(n=this.getViewportSizeMinusPadding_());const s=i.padding!==void 0?i.padding:[0,0,0,0],r=i.nearest!==void 0?i.nearest:!1;let o;i.minResolution!==void 0?o=i.minResolution:i.maxZoom!==void 0?o=this.getResolutionForZoom(i.maxZoom):o=0;const a=this.rotatedExtentForGeometry(t);let l=this.getResolutionForExtentInternal(a,[n[0]-s[1]-s[3],n[1]-s[0]-s[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,r?0:1);const h=this.getRotation(),c=Math.sin(h),u=Math.cos(h),f=Ki(a);f[0]+=(s[1]-s[3])/2*l,f[1]+=(s[0]-s[2])/2*l;const d=f[0]*u-f[1]*c,g=f[1]*u+f[0]*c,_=this.getConstrainedCenter([d,g],l),m=i.callback?i.callback:jo;i.duration!==void 0?this.animateInternal({resolution:l,center:_,duration:i.duration,easing:i.easing},m):(this.targetResolution_=l,this.targetCenter_=_,this.applyTargetState_(!1,!0),wa(m,!0))}centerOn(t,i,n){this.centerOnInternal(Ft(t,this.getProjection()),i,n)}centerOnInternal(t,i,n){this.setCenterInternal(Nh(t,i,n,this.getResolution(),this.getRotation()))}calculateCenterShift(t,i,n,s){let r;const o=this.padding_;if(o&&t){const a=this.getViewportSizeMinusPadding_(-n),l=Nh(t,s,[a[0]/2+o[3],a[1]/2+o[0]],i,n);r=[t[0]-l[0],t[1]-l[1]]}return r}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const i=os(this.targetCenter_,this.getProjection());this.setCenter([i[0]+t[0],i[1]+t[1]])}adjustCenterInternal(t){const i=this.targetCenter_;this.setCenterInternal([i[0]+t[0],i[1]+t[1]])}adjustResolution(t,i){i=i&&Ft(i,this.getProjection()),this.adjustResolutionInternal(t,i)}adjustResolutionInternal(t,i){const n=this.getAnimating()||this.getInteracting(),s=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,s,n);i&&(this.targetCenter_=this.calculateCenterZoom(r,i)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,i){this.adjustResolution(Math.pow(this.zoomFactor_,-t),i)}adjustRotation(t,i){i&&(i=Ft(i,this.getProjection())),this.adjustRotationInternal(t,i)}adjustRotationInternal(t,i){const n=this.getAnimating()||this.getInteracting(),s=this.constraints_.rotation(this.targetRotation_+t,n);i&&(this.targetCenter_=this.calculateCenterRotate(s,i)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&Ft(t,this.getProjection()))}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,i){return this.hints_[t]+=i,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,i){const n=this.getAnimating()||this.getInteracting()||i,s=this.constraints_.rotation(this.targetRotation_,n),r=this.getViewportSize_(s),o=this.constraints_.resolution(this.targetResolution_,0,r,n),a=this.constraints_.center(this.targetCenter_,o,r,n,this.calculateCenterShift(this.targetCenter_,o,s,r));this.get(Ci.ROTATION)!==s&&this.set(Ci.ROTATION,s),this.get(Ci.RESOLUTION)!==o&&(this.set(Ci.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(Ci.CENTER)||!Ne(this.get(Ci.CENTER),a))&&this.set(Ci.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,i,n){t=t!==void 0?t:200;const s=i||0,r=this.constraints_.rotation(this.targetRotation_),o=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,s,o),l=this.constraints_.center(this.targetCenter_,a,o,!1,this.calculateCenterShift(this.targetCenter_,a,r,o));if(t===0&&!this.cancelAnchor_){this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=l,this.applyTargetState_();return}n=n||(t===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==a||this.getRotation()!==r||!this.getCenterInternal()||!Ne(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:a,duration:t,easing:jr,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(be.INTERACTING,1)}endInteraction(t,i,n){n=n&&Ft(n,this.getProjection()),this.endInteractionInternal(t,i,n)}endInteractionInternal(t,i,n){this.getInteracting()&&(this.setHint(be.INTERACTING,-1),this.resolveConstraints(t,i,n))}getConstrainedCenter(t,i){const n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,i||this.getResolution(),n)}getConstrainedZoom(t,i){const n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,i))}getConstrainedResolution(t,i){i=i||0;const n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,n)}}function wa(e,t){setTimeout(function(){e(t)},0)}function Tx(e){if(e.extent!==void 0){const i=e.smoothExtentConstraint!==void 0?e.smoothExtentConstraint:!0;return Ld(e.extent,e.constrainOnlyCenter,i)}const t=Gu(e.projection,"EPSG:3857");if(e.multiWorld!==!0&&t.isGlobal()){const i=t.getExtent().slice();return i[0]=-1/0,i[2]=1/0,Ld(i,!1,!1)}return yx}function Rx(e){let t,i,n,o=e.minZoom!==void 0?e.minZoom:Dh,a=e.maxZoom!==void 0?e.maxZoom:28;const l=e.zoomFactor!==void 0?e.zoomFactor:2,h=e.multiWorld!==void 0?e.multiWorld:!1,c=e.smoothResolutionConstraint!==void 0?e.smoothResolutionConstraint:!0,u=e.showFullExtent!==void 0?e.showFullExtent:!1,f=Gu(e.projection,"EPSG:3857"),d=f.getExtent();let g=e.constrainOnlyCenter,_=e.extent;if(!h&&!_&&f.isGlobal()&&(g=!1,_=d),e.resolutions!==void 0){const m=e.resolutions;i=m[o],n=m[a]!==void 0?m[a]:m[m.length-1],e.constrainResolution?t=Ex(m,c,!g&&_,u):t=Od(i,n,c,!g&&_,u)}else{const p=(d?Math.max(xt(d),ue(d)):360*Au.degrees/f.getMetersPerUnit())/Ju/Math.pow(2,Dh),y=p/Math.pow(2,28-Dh);i=e.maxResolution,i!==void 0?o=0:i=p/Math.pow(l,o),n=e.minResolution,n===void 0&&(e.maxZoom!==void 0?e.maxResolution!==void 0?n=i/Math.pow(l,a):n=p/Math.pow(l,a):n=y),a=o+Math.floor(Math.log(i/n)/Math.log(l)),n=i/Math.pow(l,a-o),e.constrainResolution?t=Sx(l,i,n,c,!g&&_,u):t=Od(i,n,c,!g&&_,u)}return{constraint:t,maxResolution:i,minResolution:n,minZoom:o,zoomFactor:l}}function Ix(e){if(e.enableRotation!==void 0?e.enableRotation:!0){const i=e.constrainRotation;return i===void 0||i===!0?wx():i===!1?Fd:typeof i=="number"?Mx(i):Fd}return Zu}function Px(e){return!(e.sourceCenter&&e.targetCenter&&!Ne(e.sourceCenter,e.targetCenter)||e.sourceResolution!==e.targetResolution||e.sourceRotation!==e.targetRotation)}function Nh(e,t,i,n,s){const r=Math.cos(-s);let o=Math.sin(-s),a=e[0]*r-e[1]*o,l=e[1]*r+e[0]*o;a+=(t[0]/2-i[0])*n,l+=(i[1]-t[1]/2)*n,o=-o;const h=a*r-l*o,c=l*r+a*o;return[h,c]}const Ca="ol-hidden",bx="ol-selectable",lh="ol-unselectable",Qu="ol-control",Gd="ol-collapsed",Ax=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"),Dd=["style","variant","weight","size","lineHeight","family"],Bc={normal:400,bold:700},zc=function(e){const t=e.match(Ax);if(!t)return null;const i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let n=0,s=Dd.length;n<s;++n){const r=t[n+1];r!==void 0&&(i[Dd[n]]=typeof r=="string"?r.trim():r)}return isNaN(Number(i.weight))&&i.weight in Bc&&(i.weight=Bc[i.weight]),i.families=i.family.split(/,\s?/).map(n=>n.trim().replace(/^['"]|['"]$/g,"")),i};function ae(e,t,i,n){let s;return i&&i.length?s=i.shift():mi?s=new class extends OffscreenCanvas{style={}}(e??300,t??150):s=document.createElement("canvas"),e&&(s.width=e),t&&(s.height=t),s.getContext("2d",n)}let kh;function pl(){return kh||(kh=ae(1,1)),kh}function hh(e){const t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function Lx(e){let t=e.offsetWidth;const i=getComputedStyle(e);return t+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10),t}function Ox(e){let t=e.offsetHeight;const i=getComputedStyle(e);return t+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10),t}function Nd(e,t){const i=t.parentNode;i&&i.replaceChild(e,t)}function L0(e){for(;e.lastChild;)e.lastChild.remove()}function Fx(e,t){const i=e.childNodes;for(let n=0;;++n){const s=i[n],r=t[n];if(!s&&!r)break;if(s!==r){if(!s){e.appendChild(r);continue}if(!r){e.removeChild(s),--n;continue}e.insertBefore(r,s)}}}function O0(){return new Proxy({childNodes:[],appendChild:function(t){return this.childNodes.push(t),t},remove:function(){},removeChild:function(t){const i=this.childNodes.indexOf(t);if(i===-1)throw new Error("Node to remove was not found");return this.childNodes.splice(i,1),t},insertBefore:function(t,i){const n=this.childNodes.indexOf(i);if(n===-1)throw new Error("Reference node not found");return this.childNodes.splice(n,0,t),t},style:{}},{get(t,i,n){return i==="firstElementChild"?t.childNodes.length>0?t.childNodes[0]:null:Reflect.get(t,i,n)}})}function $n(e){return typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}class tf extends Di{constructor(t){super();const i=t.element;i&&!t.target&&!i.style.pointerEvents&&(i.style.pointerEvents="auto"),this.element=i||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let i=0,n=this.listenerKeys.length;i<n;++i)Tt(this.listenerKeys[i]);if(this.listenerKeys.length=0,this.map_=t,t){const i=this.target_??t.getOverlayContainerStopEvent();this.element&&i.appendChild(this.element),this.render!==jo&&this.listenerKeys.push(_t(t,ln.POSTRENDER,this.render,this)),t.render()}}render(t){}setTarget(t){this.target_=typeof t=="string"?document.getElementById(t):t}}class Gx extends tf{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.attributions_=t.attributions;const i=t.className!==void 0?t.className:"ol-attribution",n=t.tipLabel!==void 0?t.tipLabel:"Attributions",s=t.expandClassName!==void 0?t.expandClassName:i+"-expand",r=t.collapseLabel!==void 0?t.collapseLabel:"›",o=t.collapseClassName!==void 0?t.collapseClassName:i+"-collapse";typeof r=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r,this.collapseLabel_.className=o):this.collapseLabel_=r;const a=t.label!==void 0?t.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=s):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=n,this.toggleButton_.appendChild(l),this.toggleButton_.addEventListener(at.CLICK,this.handleClick_.bind(this),!1);const h=i+" "+lh+" "+Qu+(this.collapsed_&&this.collapsible_?" "+Gd:"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=h,c.appendChild(this.toggleButton_),c.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const i=this.getMap().getAllLayers(),n=new Set(i.flatMap(s=>s.getAttributions(t)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(s=>n.add(s)):n.add(this.attributions_)),!this.overrideCollapsible_){const s=!i.some(r=>r.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(s)}return Array.from(n)}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const i=await Promise.all(this.collectSourceAttributions_(t).map(s=>Q_(()=>s))),n=i.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!In(i,this.renderedAttributions_)){L0(this.ulElement_);for(let s=0,r=i.length;s<r;++s){const o=document.createElement("li");o.innerHTML=i[s],this.ulElement_.appendChild(o)}this.renderedAttributions_=i}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Gd),this.collapsed_?Nd(this.collapseLabel_,this.label_):Nd(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(t){this.userCollapsed_=t,!(!this.collapsible_||this.collapsed_===t)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}}class Dx extends tf{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const i=t.className!==void 0?t.className:"ol-rotate",n=t.label!==void 0?t.label:"⇧",s=t.compassClassName!==void 0?t.compassClassName:"ol-compass";this.label_=null,typeof n=="string"?(this.label_=document.createElement("span"),this.label_.className=s,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(s));const r=t.tipLabel?t.tipLabel:"Reset rotation",o=document.createElement("button");o.className=i+"-reset",o.setAttribute("type","button"),o.title=r,o.appendChild(this.label_),o.addEventListener(at.CLICK,this.handleClick_.bind(this),!1);const a=i+" "+lh+" "+Qu,l=this.element;l.className=a,l.appendChild(o),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=t.duration!==void 0?t.duration:250,this.autoHide_=t.autoHide!==void 0?t.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Ca)}handleClick_(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const i=this.getMap().getView();if(!i)return;const n=i.getRotation();n!==void 0&&(this.duration_>0&&n%(2*Math.PI)!==0?i.animate({rotation:0,duration:this.duration_,easing:jr}):i.setRotation(0))}render(t){const i=t.frameState;if(!i)return;const n=i.viewState.rotation;if(n!=this.rotation_){const s="rotate("+n+"rad)";if(this.autoHide_){const r=this.element.classList.contains(Ca);!r&&n===0?this.element.classList.add(Ca):r&&n!==0&&this.element.classList.remove(Ca)}this.label_.style.transform=s}this.rotation_=n}}class Nx extends tf{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const i=t.className!==void 0?t.className:"ol-zoom",n=t.delta!==void 0?t.delta:1,s=t.zoomInClassName!==void 0?t.zoomInClassName:i+"-in",r=t.zoomOutClassName!==void 0?t.zoomOutClassName:i+"-out",o=t.zoomInLabel!==void 0?t.zoomInLabel:"+",a=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",l=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",h=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=l,c.appendChild(typeof o=="string"?document.createTextNode(o):o),c.addEventListener(at.CLICK,this.handleClick_.bind(this,n),!1);const u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=h,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(at.CLICK,this.handleClick_.bind(this,-n),!1);const f=i+" "+lh+" "+Qu,d=this.element;d.className=f,d.appendChild(c),d.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,i){i.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const n=this.getMap().getView();if(!n)return;const s=n.getZoom();if(s!==void 0){const r=n.getConstrainedZoom(s+t);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.duration_,easing:jr})):n.setZoom(r)}}}function kx(e){e=e||{};const t=new Me;return(e.zoom!==void 0?e.zoom:!0)&&t.push(new Nx(e.zoomOptions)),(e.rotate!==void 0?e.rotate:!0)&&t.push(new Dx(e.rotateOptions)),(e.attribution!==void 0?e.attribution:!0)&&t.push(new Gx(e.attributionOptions)),t}class jx{constructor(t,i,n){this.decay_=t,this.minVelocity_=i,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,i){this.points_.push(t,i,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,i=this.points_.length-3;if(this.points_[i+2]<t)return!1;let n=i-3;for(;n>0&&this.points_[n+2]>t;)n-=3;const s=this.points_[i+2]-this.points_[n+2];if(s<1e3/60)return!1;const r=this.points_[i]-this.points_[n],o=this.points_[i+1]-this.points_[n+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const Wc={ACTIVE:"active"};class Br extends Di{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(Wc.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(Wc.ACTIVE,t)}setMap(t){this.map_=t}}function Bx(e,t,i){const n=e.getCenterInternal();if(n){const s=[n[0]+t[0],n[1]+t[1]];e.animateInternal({duration:i!==void 0?i:250,easing:xx,center:e.getConstrainedCenter(s)})}}function ef(e,t,i,n){const s=e.getZoom();if(s===void 0)return;const r=e.getConstrainedZoom(s+t),o=e.getResolutionForZoom(r);e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:o,anchor:i,duration:n!==void 0?n:250,easing:jr})}class zx extends Br{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let i=!1;if(t.type==vt.DBLCLICK){const n=t.originalEvent,s=t.map,r=t.coordinate,o=n.shiftKey?-this.delta_:this.delta_,a=s.getView();ef(a,o,r,this.duration_),n.preventDefault(),i=!0}return!i}}function Uc(e){const t=arguments;return function(i){let n=!0;for(let s=0,r=t.length;s<r&&(n=n&&t[s](i),!!n);++s);return n}}const Wx=function(e){const t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Ux=function(e){const t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Vx=function(e){const t=e.map.getTargetElement(),i=t.getRootNode(),n=e.map.getOwnerDocument().activeElement;return i instanceof ShadowRoot?i.host.contains(n):t.contains(n)},F0=function(e){const t=e.map.getTargetElement(),i=t.getRootNode();return(i instanceof ShadowRoot?i.host:t).hasAttribute("tabindex")?Vx(e):!0},xr=wn,G0=function(e){const t=e.originalEvent;return"pointerId"in t&&t.button==0&&!(ux&&I0&&t.ctrlKey)},yl=ks,D0=function(e){return e.type==vt.SINGLECLICK},nf=function(e){const t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Xx=function(e){const t=e.originalEvent;return I0?t.metaKey:t.ctrlKey},vl=function(e){const t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},N0=function(e){const t=e.originalEvent,i=t.target.tagName;return i!=="INPUT"&&i!=="SELECT"&&i!=="TEXTAREA"&&!t.target.isContentEditable},jh=function(e){const t=e.originalEvent;return"pointerId"in t&&t.pointerType=="mouse"},k0=function(e){const t=e.originalEvent;return"pointerId"in t&&t.isPrimary&&t.button===0};class cs extends Br{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let i=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==vt.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==vt.POINTERUP){const n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==vt.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n,i=this.stopDown(n)}else t.type==vt.POINTERMOVE&&this.handleMoveEvent(t);return!i}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function sf(e){const t=e.length;let i=0,n=0;for(let s=0;s<t;s++)i+=e[s].clientX,n+=e[s].clientY;return{clientX:i/t,clientY:n/t}}class $x extends cs{constructor(t){super({stopDown:ks}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const i=t.condition?t.condition:Uc(nf,k0);this.condition_=t.onFocusOnly?Uc(F0,i):i,this.noKinetic_=!1}handleDragEvent(t){const i=t.map;this.panning_||(this.panning_=!0,i.getView().beginInteraction());const n=this.targetPointers,s=i.getEventPixel(sf(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){const r=[this.lastCentroid[0]-s[0],s[1]-this.lastCentroid[1]],a=t.map.getView();ev(r,a.getResolution()),bu(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()}handleUpEvent(t){const i=t.map,n=i.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const s=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=n.getCenterInternal(),a=i.getPixelFromCoordinateInternal(o),l=i.getCoordinateFromPixelInternal([a[0]-s*Math.cos(r),a[1]-s*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(l),duration:500,easing:jr})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class Kx extends cs{constructor(t){t=t||{},super({stopDown:ks}),this.condition_=t.condition?t.condition:Ux,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!jh(t))return;const i=t.map,n=i.getView();if(n.getConstraints().rotation===Zu)return;const s=i.getSize(),r=t.pixel,o=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;n.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(t){return jh(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return jh(t)&&G0(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class Yx extends Hl{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,i=this.endPixel_,n="px",s=this.element_.style;s.left=Math.min(t[0],i[0])+n,s.top=Math.min(t[1],i[1])+n,s.width=Math.abs(i[0]-t[0])+n,s.height=Math.abs(i[1]-t[1])+n}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const i=this.element_.style;i.left="inherit",i.top="inherit",i.width="inherit",i.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,i){this.startPixel_=t,this.endPixel_=i,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,i=this.endPixel_,s=[t,[t[0],i[1]],i,[i[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new Fi([s])}getGeometry(){return this.geometry_}}const $s={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class Zr extends ii{constructor(t,i,n){super(t),this.coordinate=i,this.mapBrowserEvent=n}}class qx extends cs{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new Yx(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??G0,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,i,n){const s=n[0]-i[0],r=n[1]-i[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Zr($s.BOXDRAG,t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const i=this.boxEndCondition_(t,this.startPixel_,t.pixel);return i&&this.onBoxEnd(t),this.dispatchEvent(new Zr(i?$s.BOXEND:$s.BOXCANCEL,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Zr($s.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Zr($s.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Zr($s.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}class Hx extends qx{constructor(t){t=t||{};const i=t.condition?t.condition:vl;super({condition:i,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const n=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=n.rotatedExtentForGeometry(s),o=n.getResolutionForExtentInternal(r),a=n.getResolution()/o;s=s.clone(),s.scale(a*a)}n.fitInternal(s,{duration:this.duration_,easing:jr})}}const vs={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class Zx extends Br{constructor(t){super(),t=t||{},this.defaultCondition_=function(i){return nf(i)&&N0(i)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let i=!1;if(t.type==at.KEYDOWN){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==vs.DOWN||s==vs.LEFT||s==vs.RIGHT||s==vs.UP)){const o=t.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,h=0;s==vs.DOWN?h=-a:s==vs.LEFT?l=-a:s==vs.RIGHT?l=a:h=a;const c=[l,h];bu(c,o.getRotation()),Bx(o,c,this.duration_),n.preventDefault(),i=!0}}return!i}}class Jx extends Br{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(i){return!Xx(i)&&N0(i)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let i=!1;if(t.type==at.KEYDOWN||t.type==at.KEYPRESS){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==="+"||s==="-")){const r=t.map,o=s==="+"?this.delta_:-this.delta_,a=r.getView();ef(a,o,void 0,this.duration_),n.preventDefault(),i=!0}}return!i}}const Qx=40,tE=300;class eE extends Br{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const i=t.condition?t.condition:xr;this.condition_=t.onFocusOnly?Uc(F0,i):i,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t)||t.type!==at.WHEEL)return!0;const n=t.map,s=t.originalEvent;s.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let r=s.deltaY;switch(s.deltaMode){case WheelEvent.DOM_DELTA_LINE:r*=Qx;break;case WheelEvent.DOM_DELTA_PAGE:r*=tE;break}if(r===0)return!1;this.lastDelta_=r;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel");const a=n.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_?n.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=r;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),l),!1}handleWheelZoom_(t){const i=t.getView();i.getAnimating()&&i.cancelAnimations();let n=-Bt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(i.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),ef(i,n,this.lastAnchor_?t.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(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}class iE extends cs{constructor(t){t=t||{};const i=t;i.stopDown||(i.stopDown=ks),super(i),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let i=0;const n=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-n.clientY,s.clientX-n.clientX);if(this.lastAngle_!==void 0){const l=r-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),i=l}this.lastAngle_=r;const o=t.map,a=o.getView();a.getConstraints().rotation!==Zu&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(sf(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(i,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const i=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||i.getView().beginInteraction(),!0}return!1}}class nE extends cs{constructor(t){t=t||{};const i=t;i.stopDown||(i.stopDown=ks),super(i),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let i=1;const n=this.targetPointers[0],s=this.targetPointers[1],r=n.clientX-s.clientX,o=n.clientY-s.clientY,a=Math.sqrt(r*r+o*o);this.lastDistance_!==void 0&&(i=this.lastDistance_/a),this.lastDistance_=a;const l=t.map,h=l.getView();i!=1&&(this.lastScaleDelta_=i),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(sf(this.targetPointers))),l.render(),h.adjustResolutionInternal(i,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const n=t.map.getView(),s=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,s),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const i=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||i.getView().beginInteraction(),!0}return!1}}function sE(e){e=e||{};const t=new Me,i=new jx(-.005,.05,100);return(e.altShiftDragRotate!==void 0?e.altShiftDragRotate:!0)&&t.push(new Kx),(e.doubleClickZoom!==void 0?e.doubleClickZoom:!0)&&t.push(new zx({delta:e.zoomDelta,duration:e.zoomDuration})),(e.dragPan!==void 0?e.dragPan:!0)&&t.push(new $x({onFocusOnly:e.onFocusOnly,kinetic:i})),(e.pinchRotate!==void 0?e.pinchRotate:!0)&&t.push(new iE),(e.pinchZoom!==void 0?e.pinchZoom:!0)&&t.push(new nE({duration:e.zoomDuration})),(e.keyboard!==void 0?e.keyboard:!0)&&(t.push(new Zx),t.push(new Jx({delta:e.zoomDelta,duration:e.zoomDuration}))),(e.mouseWheelZoom!==void 0?e.mouseWheelZoom:!0)&&t.push(new eE({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(e.shiftDragZoom!==void 0?e.shiftDragZoom:!0)&&t.push(new Hx({duration:e.zoomDuration})),t}const Lt={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 j0 extends Di{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const i=Object.assign({},t);typeof t.properties=="object"&&(delete i.properties,Object.assign(i,t.properties)),i[Lt.OPACITY]=t.opacity!==void 0?t.opacity:1,bt(typeof i[Lt.OPACITY]=="number","Layer opacity must be a number"),i[Lt.VISIBLE]=t.visible!==void 0?t.visible:!0,i[Lt.Z_INDEX]=t.zIndex,i[Lt.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,i[Lt.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,i[Lt.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,i[Lt.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=i.className!==void 0?i.className:"ol-layer",delete i.className,this.setProperties(i),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const i=this.state_||{layer:this,managed:t===void 0?!0:t},n=this.getZIndex();return i.opacity=Bt(Math.round(this.getOpacity()*100)/100,0,1),i.visible=this.getVisible(),i.extent=this.getExtent(),i.zIndex=n===void 0&&!i.managed?1/0:n,i.maxResolution=this.getMaxResolution(),i.minResolution=Math.max(this.getMinResolution(),0),i.minZoom=this.getMinZoom(),i.maxZoom=this.getMaxZoom(),this.state_=i,i}getLayersArray(t){return St()}getLayerStatesArray(t){return St()}getExtent(){return this.get(Lt.EXTENT)}getMaxResolution(){return this.get(Lt.MAX_RESOLUTION)}getMinResolution(){return this.get(Lt.MIN_RESOLUTION)}getMinZoom(){return this.get(Lt.MIN_ZOOM)}getMaxZoom(){return this.get(Lt.MAX_ZOOM)}getOpacity(){return this.get(Lt.OPACITY)}getSourceState(){return St()}getVisible(){return this.get(Lt.VISIBLE)}getZIndex(){return this.get(Lt.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(Lt.EXTENT,t)}setMaxResolution(t){this.set(Lt.MAX_RESOLUTION,t)}setMinResolution(t){this.set(Lt.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(Lt.MAX_ZOOM,t)}setMinZoom(t){this.set(Lt.MIN_ZOOM,t)}setOpacity(t){bt(typeof t=="number","Layer opacity must be a number"),this.set(Lt.OPACITY,t)}setVisible(t){this.set(Lt.VISIBLE,t)}setZIndex(t){this.set(Lt.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const On={ADDLAYER:"addlayer",REMOVELAYER:"removelayer"};class Wn extends ii{constructor(t,i){super(t),this.layer=i}}const Bh={LAYERS:"layers"};class zr extends j0{constructor(t){t=t||{};const i=Object.assign({},t);delete i.layers;let n=t.layers;super(i),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Bh.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new Me(n.slice(),{unique:!0}):bt(typeof n.getArray=="function","Expected `layers` to be an array or a `Collection`"):n=new Me(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Tt),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(_t(t,te.ADD,this.handleLayersAdd_,this),_t(t,te.REMOVE,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(Tt);js(this.listenerKeys_);const i=t.getArray();for(let n=0,s=i.length;n<s;n++){const r=i[n];this.registerLayerListeners_(r),this.dispatchEvent(new Wn(On.ADDLAYER,r))}this.changed()}registerLayerListeners_(t){const i=[_t(t,Tr.PROPERTYCHANGE,this.handleLayerChange_,this),_t(t,at.CHANGE,this.handleLayerChange_,this)];t instanceof zr&&i.push(_t(t,On.ADDLAYER,this.handleLayerGroupAdd_,this),_t(t,On.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[ht(t)]=i}handleLayerGroupAdd_(t){this.dispatchEvent(new Wn(On.ADDLAYER,t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new Wn(On.REMOVELAYER,t.layer))}handleLayersAdd_(t){const i=t.element;this.registerLayerListeners_(i),this.dispatchEvent(new Wn(On.ADDLAYER,i)),this.changed()}handleLayersRemove_(t){const i=t.element,n=ht(i);this.listenerKeys_[n].forEach(Tt),delete this.listenerKeys_[n],this.dispatchEvent(new Wn(On.REMOVELAYER,i)),this.changed()}getLayers(){return this.get(Bh.LAYERS)}setLayers(t){const i=this.getLayers();if(i){const n=i.getArray();for(let s=0,r=n.length;s<r;++s)this.dispatchEvent(new Wn(On.REMOVELAYER,n[s]))}this.set(Bh.LAYERS,t)}getLayersArray(t){return t=t!==void 0?t:[],this.getLayers().forEach(function(i){i.getLayersArray(t)}),t}getLayerStatesArray(t){const i=t!==void 0?t:[],n=i.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(i)});const s=this.getLayerState();let r=s.zIndex;!t&&s.zIndex===void 0&&(r=0);for(let o=n,a=i.length;o<a;o++){const l=i[o];l.opacity*=s.opacity,l.visible=l.visible&&s.visible,l.maxResolution=Math.min(l.maxResolution,s.maxResolution),l.minResolution=Math.max(l.minResolution,s.minResolution),l.minZoom=Math.max(l.minZoom,s.minZoom),l.maxZoom=Math.min(l.maxZoom,s.maxZoom),s.extent!==void 0&&(l.extent!==void 0?l.extent=Jn(l.extent,s.extent):l.extent=s.extent),l.zIndex===void 0&&(l.zIndex=r)}return i}getSourceState(){return"ready"}}const pi={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class ch extends j0{constructor(t){const i=Object.assign({},t);delete i.source,super(i),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(Lt.SOURCE,this.handleSourcePropertyChange_);const n=t.source?t.source:null;this.setSource(n)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(Lt.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(Tt(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=_t(t,at.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let i;const n=this.getMapInternal();!t&&n&&(t=n.getView()),t instanceof zi?i={viewState:t.getState(),extent:t.calculateExtent()}:i=t,!i.layerStatesArray&&n&&(i.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let s;if(i.layerStatesArray){if(s=i.layerStatesArray.find(o=>o.layer===this),!s)return!1}else s=this.getLayerState();const r=this.getExtent();return rf(s,i.viewState)&&(!r||Fe(r,i.extent))}getAttributions(t){if(!this.isVisible(t))return[];const i=this.getSource()?.getAttributions();if(!i)return[];const n=t instanceof zi?t.getViewStateAndExtent():t;let s=i(n);return Array.isArray(s)||(s=[s]),s}render(t,i){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,i)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,i){}renderDeferred(t){const i=this.getRenderer();i&&i.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(Lt.MAP,t)}getMapInternal(){return this.get(Lt.MAP)}setMap(t){this.mapPrecomposeKey_&&(Tt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Tt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=_t(t,pi.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=_t(this,at.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const i=t.frameState.layerStatesArray,n=this.getLayerState(!1);bt(!i.some(s=>s.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),i.push(n)}setSource(t){this.set(Lt.SOURCE,t)}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 rf(e,t){if(!e.visible)return!1;const i=t.resolution;if(i<e.minResolution||i>=e.maxResolution)return!1;const n=t.zoom;return n>e.minZoom&&n<=e.maxZoom}function B0(e,t,i=0,n=e.length-1,s=rE){for(;n>i;){if(n-i>600){const l=n-i+1,h=t-i+1,c=Math.log(l),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(l-u)/l)*(h-l/2<0?-1:1),d=Math.max(i,Math.floor(t-h*u/l+f)),g=Math.min(n,Math.floor(t+(l-h)*u/l+f));B0(e,t,d,g,s)}const r=e[t];let o=i,a=n;for(Jr(e,i,t),s(e[n],r)>0&&Jr(e,i,n);o<a;){for(Jr(e,o,a),o++,a--;s(e[o],r)<0;)o++;for(;s(e[a],r)>0;)a--}s(e[i],r)===0?Jr(e,i,a):(a++,Jr(e,a,n)),a<=t&&(i=a+1),t<=a&&(n=a-1)}}function Jr(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function rE(e,t){return e<t?-1:e>t?1:0}let z0=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let i=this.data;const n=[];if(!Ra(t,i))return n;const s=this.toBBox,r=[];for(;i;){for(let o=0;o<i.children.length;o++){const a=i.children[o],l=i.leaf?s(a):a;Ra(t,l)&&(i.leaf?n.push(a):Wh(t,l)?this._all(a,n):r.push(a))}i=r.pop()}return n}collides(t){let i=this.data;if(!Ra(t,i))return!1;const n=[];for(;i;){for(let s=0;s<i.children.length;s++){const r=i.children[s],o=i.leaf?this.toBBox(r):r;if(Ra(t,o)){if(i.leaf||Wh(t,o))return!0;n.push(r)}}i=n.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let i=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=i;else if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){const n=this.data;this.data=i,i=n}this._insert(i,this.data.height-i.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=er([]),this}remove(t,i){if(!t)return this;let n=this.data;const s=this.toBBox(t),r=[],o=[];let a,l,h;for(;n||r.length;){if(n||(n=r.pop(),l=r[r.length-1],a=o.pop(),h=!0),n.leaf){const c=oE(t,n.children,i);if(c!==-1)return n.children.splice(c,1),r.push(n),this._condense(r),this}!h&&!n.leaf&&Wh(n,s)?(r.push(n),o.push(a),a=0,l=n,n=n.children[0]):l?(a++,n=l.children[a],h=!1):n=null}return this}toBBox(t){return t}compareMinX(t,i){return t.minX-i.minX}compareMinY(t,i){return t.minY-i.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,i){const n=[];for(;t;)t.leaf?i.push(...t.children):n.push(...t.children),t=n.pop();return i}_build(t,i,n,s){const r=n-i+1;let o=this._maxEntries,a;if(r<=o)return a=er(t.slice(i,n+1)),Ks(a,this.toBBox),a;s||(s=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/Math.pow(o,s-1))),a=er([]),a.leaf=!1,a.height=s;const l=Math.ceil(r/o),h=l*Math.ceil(Math.sqrt(o));kd(t,i,n,h,this.compareMinX);for(let c=i;c<=n;c+=h){const u=Math.min(c+h-1,n);kd(t,c,u,l,this.compareMinY);for(let f=c;f<=u;f+=l){const d=Math.min(f+l-1,u);a.children.push(this._build(t,f,d,s-1))}}return Ks(a,this.toBBox),a}_chooseSubtree(t,i,n,s){for(;s.push(i),!(i.leaf||s.length-1===n);){let r=1/0,o=1/0,a;for(let l=0;l<i.children.length;l++){const h=i.children[l],c=zh(h),u=hE(t,h)-c;u<o?(o=u,r=c<r?c:r,a=h):u===o&&c<r&&(r=c,a=h)}i=a||i.children[0]}return i}_insert(t,i,n){const s=n?t:this.toBBox(t),r=[],o=this._chooseSubtree(s,this.data,i,r);for(o.children.push(t),ro(o,s);i>=0&&r[i].children.length>this._maxEntries;)this._split(r,i),i--;this._adjustParentBBoxes(s,r,i)}_split(t,i){const n=t[i],s=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,s);const o=this._chooseSplitIndex(n,r,s),a=er(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Ks(n,this.toBBox),Ks(a,this.toBBox),i?t[i-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,i){this.data=er([t,i]),this.data.height=t.height+1,this.data.leaf=!1,Ks(this.data,this.toBBox)}_chooseSplitIndex(t,i,n){let s,r=1/0,o=1/0;for(let a=i;a<=n-i;a++){const l=so(t,0,a,this.toBBox),h=so(t,a,n,this.toBBox),c=cE(l,h),u=zh(l)+zh(h);c<r?(r=c,s=a,o=u<o?u:o):c===r&&u<o&&(o=u,s=a)}return s||n-i}_chooseSplitAxis(t,i,n){const s=t.leaf?this.compareMinX:aE,r=t.leaf?this.compareMinY:lE,o=this._allDistMargin(t,i,n,s),a=this._allDistMargin(t,i,n,r);o<a&&t.children.sort(s)}_allDistMargin(t,i,n,s){t.children.sort(s);const r=this.toBBox,o=so(t,0,i,r),a=so(t,n-i,n,r);let l=Ta(o)+Ta(a);for(let h=i;h<n-i;h++){const c=t.children[h];ro(o,t.leaf?r(c):c),l+=Ta(o)}for(let h=n-i-1;h>=i;h--){const c=t.children[h];ro(a,t.leaf?r(c):c),l+=Ta(a)}return l}_adjustParentBBoxes(t,i,n){for(let s=n;s>=0;s--)ro(i[s],t)}_condense(t){for(let i=t.length-1,n;i>=0;i--)t[i].children.length===0?i>0?(n=t[i-1].children,n.splice(n.indexOf(t[i]),1)):this.clear():Ks(t[i],this.toBBox)}};function oE(e,t,i){if(!i)return t.indexOf(e);for(let n=0;n<t.length;n++)if(i(e,t[n]))return n;return-1}function Ks(e,t){so(e,0,e.children.length,t,e)}function so(e,t,i,n,s){s||(s=er(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let r=t;r<i;r++){const o=e.children[r];ro(s,e.leaf?n(o):o)}return s}function ro(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function aE(e,t){return e.minX-t.minX}function lE(e,t){return e.minY-t.minY}function zh(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Ta(e){return e.maxX-e.minX+(e.maxY-e.minY)}function hE(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function cE(e,t){const i=Math.max(e.minX,t.minX),n=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,s-i)*Math.max(0,r-n)}function Wh(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Ra(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function er(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function kd(e,t,i,n,s){const r=[t,i];for(;r.length;){if(i=r.pop(),t=r.pop(),i-t<=n)continue;const o=t+Math.ceil((i-t)/n/2)*n;B0(e,o,t,i,s),r.push(t,o,o,i)}}const of=[NaN,NaN,NaN,0];let Uh;function uE(){return Uh||(Uh=ae(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),Uh}const fE=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,dE=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,gE=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,_E=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function Ia(e,t){return e.endsWith("%")?Number(e.substring(0,e.length-1))/t:Number(e)}function So(e){throw new Error('failed to parse "'+e+'" as color')}function W0(e){if(e.toLowerCase().startsWith("rgb")){const r=e.match(dE)||e.match(fE)||e.match(gE);if(r){const o=r[4],a=100/255;return[Bt(Ia(r[1],a)+.5|0,0,255),Bt(Ia(r[2],a)+.5|0,0,255),Bt(Ia(r[3],a)+.5|0,0,255),o!==void 0?Bt(Ia(o,100),0,1):1]}So(e)}if(e.startsWith("#")){if(_E.test(e)){const r=e.substring(1),o=r.length<=4?1:2,a=[0,0,0,255];for(let l=0,h=r.length;l<h;l+=o){let c=parseInt(r.substring(l,l+o),16);o===1&&(c+=c<<4),a[l/o]=c}return a[3]=a[3]/255,a}So(e)}const t=uE();t.fillStyle="#abcdef";let i=t.fillStyle;t.fillStyle=e,t.fillStyle===i&&(t.fillStyle="#fedcba",i=t.fillStyle,t.fillStyle=e,t.fillStyle===i&&So(e));const n=t.fillStyle;if(n.startsWith("#")||n.startsWith("rgba"))return W0(n);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);const s=Array.from(t.getImageData(0,0,1,1).data);return s[3]=Nr(s[3]/255,3),s}function mE(e){return typeof e=="string"?e:lf(e)}const pE=1024,Qr={};let Vh=0;function yE(e){if(e.length===4)return e;const t=e.slice();return t[3]=1,t}function Xh(e){return e>.0031308?Math.pow(e,1/2.4)*269.025-14.025:e*3294.6}function $h(e){return e>.2068965?Math.pow(e,3):(e-4/29)*(108/841)}function Kh(e){return e>10.314724?Math.pow((e+14.025)/269.025,2.4):e/3294.6}function Yh(e){return e>.0088564?Math.pow(e,1/3):e/(108/841)+4/29}function jd(e){const t=Kh(e[0]),i=Kh(e[1]),n=Kh(e[2]),s=Yh(t*.222488403+i*.716873169+n*.06060791),r=500*(Yh(t*.452247074+i*.399439023+n*.148375274)-s),o=200*(s-Yh(t*.016863605+i*.117638439+n*.865350722)),a=Math.atan2(o,r)*(180/Math.PI);return[116*s-16,Math.sqrt(r*r+o*o),a<0?a+360:a,e[3]]}function vE(e){const t=(e[0]+16)/116,i=e[1],n=e[2]*Math.PI/180,s=$h(t),r=$h(t+i/500*Math.cos(n)),o=$h(t-i/200*Math.sin(n)),a=Xh(r*3.021973625-s*1.617392459-o*.404875592),l=Xh(r*-.943766287+s*1.916279586+o*.027607165),h=Xh(r*.069407491-s*.22898585+o*1.159737864);return[Bt(a+.5|0,0,255),Bt(l+.5|0,0,255),Bt(h+.5|0,0,255),e[3]]}function af(e){if(e==="none")return of;if(Qr.hasOwnProperty(e))return Qr[e];if(Vh>=pE){let i=0;for(const n in Qr)(i++&3)===0&&(delete Qr[n],--Vh)}const t=W0(e);t.length!==4&&So(e);for(const i of t)isNaN(i)&&So(e);return Qr[e]=t,++Vh,t}function Ar(e){return Array.isArray(e)?e:af(e)}function lf(e){let t=e[0];t!=(t|0)&&(t=t+.5|0);let i=e[1];i!=(i|0)&&(i=i+.5|0);let n=e[2];n!=(n|0)&&(n=n+.5|0);const s=e[3]===void 0?1:Math.round(e[3]*1e3)/1e3;return"rgba("+t+","+i+","+n+","+s+")"}function Bd(e){return e[0]>0&&e[1]>0}function xE(e,t,i){return i===void 0&&(i=[0,0]),i[0]=e[0]*t+.5|0,i[1]=e[1]*t+.5|0,i}function Qe(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}let Ws=0;const Be=1<<Ws++,yt=1<<Ws++,Ke=1<<Ws++,Ii=1<<Ws++,Fs=1<<Ws++,oo=1<<Ws++,Pa=Math.pow(2,Ws)-1,hf={[Be]:"boolean",[yt]:"number",[Ke]:"string",[Ii]:"color",[Fs]:"number[]",[oo]:"size"},EE=Object.keys(hf).map(Number).sort(gn);function SE(e){return e in hf}function ao(e){const t=[];for(const i of EE)lo(e,i)&&t.push(hf[i]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function lo(e,t){return(e&t)===t}function Fn(e,t){return e===t}class oe{constructor(t,i){if(!SE(t))throw new Error(`literal expressions must have a specific type, got ${ao(t)}`);this.type=t,this.value=i}}class ME{constructor(t,i,...n){this.type=t,this.operator=i,this.args=n}}function U0(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function we(e,t,i){switch(typeof e){case"boolean":{if(Fn(t,Ke))return new oe(Ke,e?"true":"false");if(!lo(t,Be))throw new Error(`got a boolean, but expected ${ao(t)}`);return new oe(Be,e)}case"number":{if(Fn(t,oo))return new oe(oo,Qe(e));if(Fn(t,Be))return new oe(Be,!!e);if(Fn(t,Ke))return new oe(Ke,e.toString());if(!lo(t,yt))throw new Error(`got a number, but expected ${ao(t)}`);return new oe(yt,e)}case"string":{if(Fn(t,Ii))return new oe(Ii,af(e));if(Fn(t,Be))return new oe(Be,!!e);if(!lo(t,Ke))throw new Error(`got a string, but expected ${ao(t)}`);return new oe(Ke,e)}}if(!Array.isArray(e))throw new Error("expression must be an array or a primitive value");if(e.length===0)throw new Error("empty expression");if(typeof e[0]=="string")return FE(e,t,i);for(const n of e)if(typeof n!="number")throw new Error("expected an array of numbers");if(Fn(t,oo)){if(e.length!==2)throw new Error(`expected an array of two values for a size, got ${e.length}`);return new oe(oo,e)}if(Fn(t,Ii)){if(e.length===3)return new oe(Ii,[...e,1]);if(e.length===4)return new oe(Ii,e);throw new Error(`expected an array of 3 or 4 values for a color, got ${e.length}`)}if(!lo(t,Fs))throw new Error(`got an array of numbers, but expected ${ao(t)}`);return new oe(Fs,e)}const D={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"},wE={[D.Get]:ct(gt(1,1/0),zd),[D.Var]:ct(gt(1,1),CE),[D.Has]:ct(gt(1,1/0),zd),[D.Id]:ct(TE,Ys),[D.Concat]:ct(gt(2,1/0),Ct(Ke)),[D.GeometryType]:ct(RE,Ys),[D.LineMetric]:ct(Ys),[D.Resolution]:ct(qh,Ys),[D.Zoom]:ct(qh,Ys),[D.Time]:ct(qh,Ys),[D.Any]:ct(gt(2,1/0),Ct(Be)),[D.All]:ct(gt(2,1/0),Ct(Be)),[D.Not]:ct(gt(1,1),Ct(Be)),[D.Equal]:ct(gt(2,2),Ct(Pa)),[D.NotEqual]:ct(gt(2,2),Ct(Pa)),[D.GreaterThan]:ct(gt(2,2),Ct(yt)),[D.GreaterThanOrEqualTo]:ct(gt(2,2),Ct(yt)),[D.LessThan]:ct(gt(2,2),Ct(yt)),[D.LessThanOrEqualTo]:ct(gt(2,2),Ct(yt)),[D.Multiply]:ct(gt(2,1/0),Wd),[D.Coalesce]:ct(gt(2,1/0),Wd),[D.Divide]:ct(gt(2,2),Ct(yt)),[D.Add]:ct(gt(2,1/0),Ct(yt)),[D.Subtract]:ct(gt(2,2),Ct(yt)),[D.Clamp]:ct(gt(3,3),Ct(yt)),[D.Mod]:ct(gt(2,2),Ct(yt)),[D.Pow]:ct(gt(2,2),Ct(yt)),[D.Abs]:ct(gt(1,1),Ct(yt)),[D.Floor]:ct(gt(1,1),Ct(yt)),[D.Ceil]:ct(gt(1,1),Ct(yt)),[D.Round]:ct(gt(1,1),Ct(yt)),[D.Sin]:ct(gt(1,1),Ct(yt)),[D.Cos]:ct(gt(1,1),Ct(yt)),[D.Atan]:ct(gt(1,2),Ct(yt)),[D.Sqrt]:ct(gt(1,1),Ct(yt)),[D.Match]:ct(gt(4,1/0),Ud,PE),[D.Between]:ct(gt(3,3),Ct(yt)),[D.Interpolate]:ct(gt(6,1/0),Ud,bE),[D.Case]:ct(gt(3,1/0),IE,AE),[D.In]:ct(gt(2,2),LE),[D.Number]:ct(gt(1,1/0),Ct(Pa)),[D.String]:ct(gt(1,1/0),Ct(Pa)),[D.Array]:ct(gt(1,1/0),Ct(yt)),[D.Color]:ct(gt(1,4),Ct(yt)),[D.Band]:ct(gt(1,3),Ct(yt)),[D.Palette]:ct(gt(2,2),OE),[D.ToString]:ct(gt(1,1),Ct(Be|yt|Ke|Ii))};function zd(e,t,i){const n=e.length-1,s=new Array(n);for(let r=0;r<n;++r){const o=e[r+1];switch(typeof o){case"number":{s[r]=new oe(yt,o);break}case"string":{s[r]=new oe(Ke,o);break}default:throw new Error(`expected a string key or numeric array index for a get operation, got ${o}`)}r===0&&i.properties.add(String(o))}return s}function CE(e,t,i){const n=e[1];if(typeof n!="string")throw new Error("expected a string argument for var operation");return i.variables.add(n),[new oe(Ke,n)]}function TE(e,t,i){i.featureId=!0}function RE(e,t,i){i.geometryType=!0}function qh(e,t,i){i.mapState=!0}function Ys(e,t,i){const n=e[0];if(e.length!==1)throw new Error(`expected no arguments for ${n} operation`);return[]}function gt(e,t){return function(i,n,s){const r=i[0],o=i.length-1;if(e===t){if(o!==e){const a=e===1?"":"s";throw new Error(`expected ${e} argument${a} for ${r}, got ${o}`)}}else if(o<e||o>t){const a=t===1/0?`${e} or more`:`${e} to ${t}`;throw new Error(`expected ${a} arguments for ${r}, got ${o}`)}}}function Wd(e,t,i){const n=e.length-1,s=new Array(n);for(let r=0;r<n;++r){const o=we(e[r+1],t,i);s[r]=o}return s}function Ct(e){return function(t,i,n){const s=t.length-1,r=new Array(s);for(let o=0;o<s;++o){const a=we(t[o+1],e,n);r[o]=a}return r}}function IE(e,t,i){const n=e[0],s=e.length-1;if(s%2===0)throw new Error(`expected an odd number of arguments for ${n}, got ${s} instead`)}function Ud(e,t,i){const n=e[0],s=e.length-1;if(s%2===1)throw new Error(`expected an even number of arguments for operation ${n}, got ${s} instead`)}function PE(e,t,i){const n=e.length-1,s=Ke|yt|Be,r=we(e[1],s,i),o=we(e[e.length-1],t,i),a=new Array(n-2);for(let l=0;l<n-2;l+=2){try{const h=we(e[l+2],r.type,i);a[l]=h}catch(h){throw new Error(`failed to parse argument ${l+1} of match expression: ${h.message}`)}try{const h=we(e[l+3],o.type,i);a[l+1]=h}catch(h){throw new Error(`failed to parse argument ${l+2} of match expression: ${h.message}`)}}return[r,...a,o]}function bE(e,t,i){const n=e[1];let s;switch(n[0]){case"linear":s=1;break;case"exponential":const l=n[1];if(typeof l!="number"||l<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(l)} instead`);s=l;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(n)}`)}const r=new oe(yt,s);let o;try{o=we(e[2],yt,i)}catch(l){throw new Error(`failed to parse argument 1 in interpolate expression: ${l.message}`)}const a=new Array(e.length-3);for(let l=0;l<a.length;l+=2){try{const h=we(e[l+3],yt,i);a[l]=h}catch(h){throw new Error(`failed to parse argument ${l+2} for interpolate expression: ${h.message}`)}try{const h=we(e[l+4],t,i);a[l+1]=h}catch(h){throw new Error(`failed to parse argument ${l+3} for interpolate expression: ${h.message}`)}}return[r,o,...a]}function AE(e,t,i){const n=we(e[e.length-1],t,i),s=new Array(e.length-1);for(let r=0;r<s.length-1;r+=2){try{const o=we(e[r+1],Be,i);s[r]=o}catch(o){throw new Error(`failed to parse argument ${r} of case expression: ${o.message}`)}try{const o=we(e[r+2],n.type,i);s[r+1]=o}catch(o){throw new Error(`failed to parse argument ${r+1} of case expression: ${o.message}`)}}return s[s.length-1]=n,s}function LE(e,t,i){let n=e[2];if(!Array.isArray(n))throw new Error('the second argument for the "in" operator must be an array');let s;if(typeof n[0]=="string"){if(n[0]!=="literal")throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(n[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');n=n[1],s=Ke}else s=yt;const r=new Array(n.length);for(let a=0;a<r.length;a++)try{const l=we(n[a],s,i);r[a]=l}catch(l){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${l.message}`)}return[we(e[1],s,i),...r]}function OE(e,t,i){let n;try{n=we(e[1],yt,i)}catch(o){throw new Error(`failed to parse first argument in palette expression: ${o.message}`)}const s=e[2];if(!Array.isArray(s))throw new Error("the second argument of palette must be an array");const r=new Array(s.length);for(let o=0;o<r.length;o++){let a;try{a=we(s[o],Ii,i)}catch(l){throw new Error(`failed to parse color at index ${o} in palette expression: ${l.message}`)}if(!(a instanceof oe))throw new Error(`the palette color at index ${o} must be a literal value`);r[o]=a}return[n,...r]}function ct(...e){return function(t,i,n){const s=t[0];let r;for(let o=0;o<e.length;o++){const a=e[o](t,i,n);if(o==e.length-1){if(!a)throw new Error("expected last argument validator to return the parsed args");r=a}}return new ME(i,s,...r)}}function FE(e,t,i){const n=e[0],s=wE[n];if(!s)throw new Error(`unknown operator: ${n}`);return s(e,t,i)}function V0(e){if(!e)return"";const t=e.getType();switch(t){case"Point":case"LineString":case"Polygon":return t;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return t.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return V0(e.getGeometries()[0]);default:return""}}function X0(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function bn(e,t,i){const n=we(e,t,i);return Gi(n)}function Gi(e,t){if(e instanceof oe){if(e.type===Ii&&typeof e.value=="string"){const n=af(e.value);return function(){return n}}return function(){return e.value}}const i=e.operator;switch(i){case D.Number:case D.String:case D.Coalesce:return GE(e);case D.Get:case D.Var:case D.Has:return DE(e);case D.Id:return n=>n.featureId;case D.GeometryType:return n=>n.geometryType;case D.Concat:{const n=e.args.map(s=>Gi(s));return s=>"".concat(...n.map(r=>r(s).toString()))}case D.Resolution:return n=>n.resolution;case D.Any:case D.All:case D.Between:case D.In:case D.Not:return kE(e);case D.Equal:case D.NotEqual:case D.LessThan:case D.LessThanOrEqualTo:case D.GreaterThan:case D.GreaterThanOrEqualTo:return NE(e);case D.Multiply:case D.Divide:case D.Add:case D.Subtract:case D.Clamp:case D.Mod:case D.Pow:case D.Abs:case D.Floor:case D.Ceil:case D.Round:case D.Sin:case D.Cos:case D.Atan:case D.Sqrt:return jE(e);case D.Case:return BE(e);case D.Match:return zE(e);case D.Interpolate:return WE(e);case D.ToString:return UE(e);default:throw new Error(`Unsupported operator ${i}`)}}function GE(e,t){const i=e.operator,n=e.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Gi(e.args[r]);switch(i){case D.Coalesce:return r=>{for(let o=0;o<n;++o){const a=s[o](r);if(typeof a<"u"&&a!==null)return a}throw new Error("Expected one of the values to be non-null")};case D.Number:case D.String:return r=>{for(let o=0;o<n;++o){const a=s[o](r);if(typeof a===i)return a}throw new Error(`Expected one of the values to be a ${i}`)};default:throw new Error(`Unsupported assertion operator ${i}`)}}function DE(e,t){const n=e.args[0].value;switch(e.operator){case D.Get:return s=>{const r=e.args;let o=s.properties[n];for(let a=1,l=r.length;a<l;++a){const c=r[a].value;o=o[c]}return o};case D.Var:return s=>s.variables[n];case D.Has:return s=>{const r=e.args;if(!(n in s.properties))return!1;let o=s.properties[n];for(let a=1,l=r.length;a<l;++a){const c=r[a].value;if(!o||!Object.hasOwn(o,c))return!1;o=o[c]}return!0};default:throw new Error(`Unsupported accessor operator ${e.operator}`)}}function NE(e,t){const i=e.operator,n=Gi(e.args[0]),s=Gi(e.args[1]);switch(i){case D.Equal:return r=>n(r)===s(r);case D.NotEqual:return r=>n(r)!==s(r);case D.LessThan:return r=>n(r)<s(r);case D.LessThanOrEqualTo:return r=>n(r)<=s(r);case D.GreaterThan:return r=>n(r)>s(r);case D.GreaterThanOrEqualTo:return r=>n(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${i}`)}}function kE(e,t){const i=e.operator,n=e.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Gi(e.args[r]);switch(i){case D.Any:return r=>{for(let o=0;o<n;++o)if(s[o](r))return!0;return!1};case D.All:return r=>{for(let o=0;o<n;++o)if(!s[o](r))return!1;return!0};case D.Between:return r=>{const o=s[0](r),a=s[1](r),l=s[2](r);return o>=a&&o<=l};case D.In:return r=>{const o=s[0](r);for(let a=1;a<n;++a)if(o===s[a](r))return!0;return!1};case D.Not:return r=>!s[0](r);default:throw new Error(`Unsupported logical operator ${i}`)}}function jE(e,t){const i=e.operator,n=e.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Gi(e.args[r]);switch(i){case D.Multiply:return r=>{let o=1;for(let a=0;a<n;++a)o*=s[a](r);return o};case D.Divide:return r=>s[0](r)/s[1](r);case D.Add:return r=>{let o=0;for(let a=0;a<n;++a)o+=s[a](r);return o};case D.Subtract:return r=>s[0](r)-s[1](r);case D.Clamp:return r=>{const o=s[0](r),a=s[1](r);if(o<a)return a;const l=s[2](r);return o>l?l:o};case D.Mod:return r=>s[0](r)%s[1](r);case D.Pow:return r=>Math.pow(s[0](r),s[1](r));case D.Abs:return r=>Math.abs(s[0](r));case D.Floor:return r=>Math.floor(s[0](r));case D.Ceil:return r=>Math.ceil(s[0](r));case D.Round:return r=>Math.round(s[0](r));case D.Sin:return r=>Math.sin(s[0](r));case D.Cos:return r=>Math.cos(s[0](r));case D.Atan:return n===2?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case D.Sqrt:return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${i}`)}}function BE(e,t){const i=e.args.length,n=new Array(i);for(let s=0;s<i;++s)n[s]=Gi(e.args[s]);return s=>{for(let r=0;r<i-1;r+=2)if(n[r](s))return n[r+1](s);return n[i-1](s)}}function zE(e,t){const i=e.args.length,n=new Array(i);for(let s=0;s<i;++s)n[s]=Gi(e.args[s]);return s=>{const r=n[0](s);for(let o=1;o<i-1;o+=2)if(r===n[o](s))return n[o+1](s);return n[i-1](s)}}function WE(e,t){const i=e.args.length,n=new Array(i);for(let s=0;s<i;++s)n[s]=Gi(e.args[s]);return s=>{const r=n[0](s),o=n[1](s);let a,l;for(let h=2;h<i;h+=2){const c=n[h](s);let u=n[h+1](s);const f=Array.isArray(u);if(f&&(u=yE(u)),c>=o)return h===2?u:f?VE(r,o,a,l,c,u):ho(r,o,a,l,c,u);a=c,l=u}return l}}function UE(e,t){const i=e.operator,n=e.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Gi(e.args[r]);switch(i){case D.ToString:return r=>{const o=s[0](r);return e.args[0].type===Ii?lf(o):o.toString()};default:throw new Error(`Unsupported convert operator ${i}`)}}function ho(e,t,i,n,s,r){const o=s-i;if(o===0)return n;const a=t-i,l=e===1?a/o:(Math.pow(e,a)-1)/(Math.pow(e,o)-1);return n+l*(r-n)}function VE(e,t,i,n,s,r){if(s-i===0)return n;const a=jd(n),l=jd(r);let h=l[2]-a[2];h>180?h-=360:h<-180&&(h+=360);const c=[ho(e,t,i,a[0],s,l[0]),ho(e,t,i,a[1],s,l[1]),a[2]+ho(e,t,i,0,s,h),ho(e,t,i,n[3],s,r[3])];return vE(c)}const et={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class $0 extends ra{constructor(t,i,n,s){super(),this.extent=t,this.pixelRatio_=n,this.resolution=i,this.state=typeof s=="function"?et.IDLE:s,this.image_=null,this.loader=typeof s=="function"?s:null}changed(){this.dispatchEvent(at.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==et.IDLE&&this.loader){this.state=et.LOADING,this.changed();const t=this.getResolution(),i=Array.isArray(t)?t[0]:t;Q_(()=>this.loader(this.getExtent(),i,this.getPixelRatio())).then(n=>{"image"in n&&(this.image_=n.image),"extent"in n&&(this.extent=n.extent),"resolution"in n&&(this.resolution=n.resolution),"pixelRatio"in n&&(this.pixelRatio_=n.pixelRatio),(n instanceof HTMLImageElement||dx&&n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement)&&(this.image_=n),this.state=et.LOADED}).catch(n=>{this.state=et.ERROR,console.error(n)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function XE(e,t,i){const n=e;let s=!0,r=!1,o=!1;const a=[cl(n,at.LOAD,function(){o=!0,r||t()})];return n.src&&P0?(r=!0,n.decode().then(function(){s&&t()}).catch(function(l){s&&(o?t():i())})):a.push(cl(n,at.ERROR,i)),function(){s=!1,a.forEach(Tt)}}function $E(e,t){return new Promise((i,n)=>{function s(){o(),i(e)}function r(){o(),n(new Error("Image load error"))}function o(){e.removeEventListener("load",s),e.removeEventListener("error",r)}e.addEventListener("load",s),e.addEventListener("error",r)})}function KE(e,t){return t&&(e.src=t),e.src&&P0?new Promise((i,n)=>e.decode().then(()=>i(e)).catch(s=>e.complete&&e.width?i(e):n(s))):$E(e)}class YE{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 t=0;for(const i in this.cache_){const n=this.cache_[i];(t++&3)===0&&!n.hasListener()&&(delete this.cache_[i],delete this.patternCache_[i],--this.cacheSize_)}}}get(t,i,n){const s=Hh(t,i,n);return s in this.cache_?this.cache_[s]:null}getPattern(t,i,n){const s=Hh(t,i,n);return s in this.patternCache_?this.patternCache_[s]:null}set(t,i,n,s,r){const o=Hh(t,i,n),a=o in this.cache_;this.cache_[o]=s,r&&(s.getImageState()===et.IDLE&&s.load(),s.getImageState()===et.LOADING?s.ready().then(()=>{this.patternCache_[o]=pl().createPattern(s.getImage(1),"repeat")}):this.patternCache_[o]=pl().createPattern(s.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Hh(e,t,i){const n=i?Ar(i):"null";return t+":"+e+":"+n}const yi=new YE;let to=null;class K0 extends ra{constructor(t,i,n,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=r,this.imageState_=s===void 0?et.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=i,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===et.LOADED){to||(to=ae(1,1,void 0,{willReadFrequently:!0})),to.drawImage(this.image_,0,0);try{to.getImageData(0,0,1,1),this.tainted_=!1}catch{to=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(at.CHANGE)}handleImageError_(){this.imageState_=et.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=et.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],i=this.size_[1],n=ae(t,i);n.fillRect(0,0,t,i),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===et.IDLE){this.image_||this.initializeImage_(),this.imageState_=et.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&KE(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==et.LOADED)return;const i=this.image_,n=ae(Math.ceil(i.width*t),Math.ceil(i.height*t)),s=n.canvas;n.scale(t,t),n.drawImage(i,0,0),n.globalCompositeOperation="multiply",n.fillStyle=mE(this.color_),n.fillRect(0,0,s.width/t,s.height/t),n.globalCompositeOperation="destination-in",n.drawImage(i,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===et.LOADED||this.imageState_===et.ERROR)t();else{const i=()=>{(this.imageState_===et.LOADED||this.imageState_===et.ERROR)&&(this.removeEventListener(at.CHANGE,i),t())};this.addEventListener(at.CHANGE,i)}})),this.ready_}}function xl(e,t,i,n,s,r){let o=t===void 0?void 0:yi.get(t,i,s);return o||(o=new K0(e,e&&"src"in e?e.src||void 0:t,i,n,s),yi.set(t,i,s,o,r)),r&&o&&!yi.getPattern(t,i,s)&&yi.set(t,i,s,o,r),o}function Ui(e){return e?Array.isArray(e)?lf(e):typeof e=="object"&&"src"in e?qE(e):e:null}function qE(e){if(!e.offset||!e.size)return yi.getPattern(e.src,"anonymous",e.color);const t=e.src+":"+e.offset,i=yi.getPattern(t,void 0,e.color);if(i)return i;const n=yi.get(e.src,"anonymous",null);if(n.getImageState()!==et.LOADED)return null;const s=ae(e.size[0],e.size[1]);return s.drawImage(n.getImage(1),e.offset[0],e.offset[1],e.size[0],e.size[1],0,0,e.size[0],e.size[1]),xl(s.canvas,t,void 0,et.LOADED,e.color,!0),yi.getPattern(t,void 0,e.color)}const Y0="10px sans-serif",Ye="#000",Lr="round",vn=[],xn=0,Or="round",Uo=10,Vo="#000",Xo="center",El="middle",Rs=[0,0,0,0],$o=1,ir=new Di;let eo=null,Vd;const Vc={},HE=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function ZE(e,t,i){return`${e} ${t} 16px "${i}"`}const JE=(function(){let t,i;async function n(r){await i.ready;const o=await i.load(r);if(o.length===0)return!1;const a=zc(r),l=a.families[0].toLowerCase(),h=a.weight;return o.some(c=>{const u=c.family.replace(/^['"]|['"]$/g,"").toLowerCase(),f=Bc[c.weight]||c.weight;return u===l&&c.style===a.style&&f==h})}async function s(){await i.ready;let r=!0;const o=ir.getProperties(),a=Object.keys(o).filter(l=>o[l]<100);for(let l=a.length-1;l>=0;--l){const h=a[l];let c=o[h];c<100&&(await n(h)?(js(Vc),ir.set(h,100)):(c+=10,ir.set(h,c,!0),c<100&&(r=!1)))}t=void 0,r||(t=setTimeout(s,100))}return async function(r){i||(i=mi?self.fonts:document.fonts);const o=zc(r);if(!o)return;const a=o.families;let l=!1;for(const h of a){if(HE.has(h))continue;const c=ZE(o.style,o.weight,h);ir.get(c)===void 0&&(ir.set(c,0,!0),l=!0)}l&&(clearTimeout(t),t=setTimeout(s,100))}})(),QE=(function(){let e;return function(t){let i=Vc[t];if(i==null){if(mi){const n=zc(t),s=q0(t,"Žg");i=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent)}else e||(e=document.createElement("div"),e.innerHTML="M",e.style.minHeight="0",e.style.maxHeight="none",e.style.height="auto",e.style.padding="0",e.style.border="none",e.style.position="absolute",e.style.display="block",e.style.left="-99999px"),e.style.font=t,document.body.appendChild(e),i=e.offsetHeight,document.body.removeChild(e);Vc[t]=i}return i}})();function q0(e,t){return eo||(eo=ae(1,1)),e!=Vd&&(eo.font=e,Vd=eo.font),eo.measureText(t)}function H0(e,t){return q0(e,t).width}function Xd(e,t,i){if(t in i)return i[t];const n=t.split(`
|
|
2
|
-
`).reduce((s,r)=>Math.max(s,H0(e,r)),0);return i[t]=n,n}function tS(e,t){const i=[],n=[],s=[];let r=0,o=0,a=0,l=0;for(let h=0,c=t.length;h<=c;h+=2){const u=t[h];if(u===`
|
|
3
|
-
`||h===c){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const f=t[h+1]||e.font,d=H0(f,u);i.push(d),o+=d;const g=QE(f);n.push(g),l=Math.max(l,g)}return{width:r,height:a,widths:i,heights:n,lineWidths:s}}function eS(e,t,i,n,s,r,o,a,l,h,c){e.save(),i!==1&&(e.globalAlpha===void 0?e.globalAlpha=u=>u.globalAlpha*=i:e.globalAlpha*=i),t&&e.transform.apply(e,t),n.contextInstructions?(e.translate(l,h),e.scale(c[0],c[1]),iS(n,e)):c[0]<0||c[1]<0?(e.translate(l,h),e.scale(c[0],c[1]),e.drawImage(n,s,r,o,a,0,0,o,a)):e.drawImage(n,s,r,o,a,l,h,o*c[0],a*c[1]),e.restore()}function iS(e,t){const i=e.contextInstructions;for(let n=0,s=i.length;n<s;n+=2)Array.isArray(i[n+1])?t[i[n]].apply(t,i[n+1]):t[i[n]]=i[n+1]}class uh{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Qe(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new uh({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return St()}getImage(t){return St()}getHitDetectionImage(){return St()}getPixelRatio(t){return 1}getImageState(){return St()}getImageSize(){return St()}getOrigin(){return St()}getSize(){return St()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Qe(t)}listenImageChange(t){St()}load(){St()}unlistenImageChange(t){St()}ready(){return Promise.resolve()}}class fh extends uh{constructor(t){super({opacity:1,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?et.LOADING:et.LOADED,this.imageState_===et.LOADING&&this.ready().then(()=>this.imageState_=et.LOADED),this.render()}clone(){const t=this.getScale(),i=new fh({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return i.setOpacity(this.getOpacity()),i}getAnchor(){const t=this.size_,i=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-i[0]/n[0],t[1]/2+i[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){const i=this.fill_?.getKey(),n=`${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${i}`+Object.values(this.renderOptions_).join(",");let s=yi.get(n,null,null)?.getImage(1);if(!s){const r=this.renderOptions_,o=Math.ceil(r.size*t),a=ae(o,o);this.draw_(r,a,t),s=a.canvas,yi.set(n,null,null,new K0(s,void 0,null,et.LOADED,null))}return s}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,i,n){if(i===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return i;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(s<r){const C=s;s=r,r=C}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=r*Math.sin(a),h=Math.sqrt(r*r-l*l),c=s-h,u=Math.sqrt(l*l+c*c),f=u/l;if(t==="miter"&&f<=n)return f*i;const d=i/2/f,g=i/2*(c/u),m=Math.sqrt((s+d)*(s+d)+g*g)-s;if(this.radius2_===void 0||t==="bevel")return m*2;const p=s*Math.sin(a),y=Math.sqrt(s*s-p*p),S=r-y,M=Math.sqrt(p*p+S*S)/p;if(M<=n){const C=M*i/2-r-s;return 2*Math.max(m,C)}return m*2}createRenderOptions(){let t=Lr,i=Or,n=0,s=null,r=0,o,a=0;this.stroke_&&(o=Ui(this.stroke_.getColor()??Vo),a=this.stroke_.getWidth()??$o,s=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset()??0,i=this.stroke_.getLineJoin()??Or,t=this.stroke_.getLineCap()??Lr,n=this.stroke_.getMiterLimit()??Uo);const l=this.calculateLineJoinSize_(i,a,n),h=Math.max(this.radius,this.radius2_||0),c=Math.ceil(2*h+l);return{strokeStyle:o,strokeWidth:a,size:c,lineCap:t,lineDash:s,lineDashOffset:r,lineJoin:i,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[t,t]}draw_(t,i,n){if(i.scale(n,n),i.translate(t.size/2,t.size/2),this.createPath_(i),this.fill_){let s=this.fill_.getColor();s===null&&(s=Ye),i.fillStyle=Ui(s),i.fill()}t.strokeStyle&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineCap=t.lineCap,i.lineJoin=t.lineJoin,i.miterLimit=t.miterLimit,i.stroke())}createHitDetectionCanvas_(t){let i;if(this.fill_){let n=this.fill_.getColor(),s=0;typeof n=="string"&&(n=Ar(n)),n===null?s=1:Array.isArray(n)&&(s=n.length===4?n[3]:1),s===0&&(i=ae(t.size,t.size),this.drawHitDetectionCanvas_(t,i))}return i?i.canvas:this.getImage(1)}createPath_(t){let i=this.points_;const n=this.radius;if(i===1/0)t.arc(0,0,n,0,2*Math.PI);else{const s=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(i*=2);const r=this.angle_-Math.PI/2,o=2*Math.PI/i;for(let a=0;a<i;a++){const l=r+a*o,h=a%2===0?n:s;t.lineTo(h*Math.cos(l),h*Math.sin(l))}t.closePath()}}drawHitDetectionCanvas_(t,i){i.translate(t.size/2,t.size/2),this.createPath_(i),i.fillStyle=Ye,i.fill(),t.strokeStyle&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineJoin=t.lineJoin,i.miterLimit=t.miterLimit,i.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class Us extends fh{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),i=new Us({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return i.setOpacity(this.getOpacity()),i}setRadius(t){this.radius=t,this.render()}}class li{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,t.color!==void 0&&this.setColor(t.color)}clone(){const t=this.getColor();return new li({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(t!==null&&typeof t=="object"&&"src"in t){const i=xl(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));i.ready().then(()=>{this.patternImage_=null}),i.getImageState()===et.IDLE&&i.load(),i.getImageState()===et.LOADING&&(this.patternImage_=i)}this.color_=t}getKey(){const t=this.getColor();return t?t instanceof CanvasPattern||t instanceof CanvasGradient?ht(t):typeof t=="object"&&"src"in t?t.src+":"+t.offset:Ar(t).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function $d(e,t,i,n){return i!==void 0&&n!==void 0?[i/e,n/t]:i!==void 0?i/e:n!==void 0?n/t:1}class dh extends uh{constructor(t){t=t||{};const i=t.opacity!==void 0?t.opacity:1,n=t.rotation!==void 0?t.rotation:0,s=t.scale!==void 0?t.scale:1,r=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:i,rotation:n,scale:s,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const o=t.img!==void 0?t.img:null;let a=t.src;bt(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||ht(o)),bt(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),bt(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(t.src!==void 0?l=et.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?et.LOADED:et.IDLE:l=et.LOADING:l=et.LOADED),this.color_=t.color!==void 0?Ar(t.color):null,this.iconImage_=xl(o,a,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,this.initialOptions_,t.width!==void 0||t.height!==void 0){let h,c;if(t.size)[h,c]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)h=u.width,c=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const f=()=>{if(this.unlistenImageChange(f),!this.initialOptions_)return;const d=this.iconImage_.getSize();this.setScale($d(d[0],d[1],t.width,t.height))};this.listenImageChange(f);return}}h!==void 0&&this.setScale($d(h,c,t.width,t.height))}}clone(){let t,i,n;return this.initialOptions_?(i=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new dh({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:i,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const s=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!s)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=s[0]),this.anchorYUnits_=="fraction"&&(t[1]*=s[1])}if(this.anchorOrigin_!="top-left"){if(!s)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+s[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+s[1])}this.normalizedAnchor_=t}const i=this.getDisplacement(),n=this.getScaleArray();return[t[0]-i[0]/n[0],t[1]+i[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const i=this.getSize(),n=this.iconImage_.getSize();if(!i||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-i[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-i[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(t){this.iconImage_=xl(null,t,this.crossOrigin_,et.IDLE,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==et.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==et.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(at.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(at.CHANGE,t)}ready(){return this.iconImage_.ready()}}class Si{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new Si({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}class fe{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Kd,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new fe({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(i){return i.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Kd,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function nS(e){let t;if(typeof e=="function")t=e;else{let i;Array.isArray(e)?i=e:(bt(typeof e.getZIndex=="function","Expected an `Style` or an array of `Style`"),i=[e]),t=function(){return i}}return t}let Zh=null;function Z0(e,t){if(!Zh){const i=new li({color:"rgba(255,255,255,0.4)"}),n=new Si({color:"#3399CC",width:1.25});Zh=[new fe({image:new Us({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return Zh}function cf(){const e={},t=[255,255,255,1],i=[0,153,255,1],n=3;return e.Polygon=[new fe({fill:new li({color:[255,255,255,.5]})})],e.MultiPolygon=e.Polygon,e.LineString=[new fe({stroke:new Si({color:t,width:n+2})}),new fe({stroke:new Si({color:i,width:n})})],e.MultiLineString=e.LineString,e.Circle=e.Polygon.concat(e.LineString),e.Point=[new fe({image:new Us({radius:n*2,fill:new li({color:i}),stroke:new Si({color:t,width:n/2})}),zIndex:1/0})],e.MultiPoint=e.Point,e.GeometryCollection=e.Polygon.concat(e.LineString,e.Point),e}function Kd(e){return e.getGeometry()}const sS="#333";class la{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.keepUpright_=t.keepUpright,this.scale_=t.scale,this.scaleArray_=Qe(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new li({color:sS}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new la({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof li?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(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setKeepUpright(t){this.keepUpright_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Qe(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}function rS(e){return!0}function oS(e){const t=U0(),i=aS(e,t),n=X0();return function(s,r){if(n.properties=s.getPropertiesInternal(),n.resolution=r,t.featureId){const o=s.getId();o!==void 0?n.featureId=o:n.featureId=null}return t.geometryType&&(n.geometryType=V0(s.getGeometry())),i(n)}}function Yd(e){const t=U0(),i=e.length,n=new Array(i);for(let o=0;o<i;++o)n[o]=Xc(e[o],t);const s=X0(),r=new Array(i);return function(o,a){if(s.properties=o.getPropertiesInternal(),s.resolution=a,t.featureId){const h=o.getId();h!==void 0?s.featureId=h:s.featureId=null}let l=0;for(let h=0;h<i;++h){const c=n[h](s);c&&(r[l]=c,l+=1)}return r.length=l,r}}function aS(e,t){const i=e.length,n=new Array(i);for(let s=0;s<i;++s){const r=e[s],o="filter"in r?bn(r.filter,Be,t):rS;let a;if(Array.isArray(r.style)){const l=r.style.length;a=new Array(l);for(let h=0;h<l;++h)a[h]=Xc(r.style[h],t)}else a=[Xc(r.style,t)];n[s]={filter:o,styles:a}}return function(s){const r=[];let o=!1;for(let a=0;a<i;++a){const l=n[a].filter;if(l(s)&&!(e[a].else&&o)){o=!0;for(const h of n[a].styles){const c=h(s);c&&r.push(c)}}}return r}}function Xc(e,t){const i=Ko(e,"",t),n=Yo(e,"",t),s=lS(e,t),r=hS(e,t),o=He(e,"z-index",t);if(!i&&!n&&!s&&!r&&!Rr(e))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(e));const a=new fe;return function(l){let h=!0;if(i){const c=i(l);c&&(h=!1),a.setFill(c)}if(n){const c=n(l);c&&(h=!1),a.setStroke(c)}if(s){const c=s(l);c&&(h=!1),a.setText(c)}if(r){const c=r(l);c&&(h=!1),a.setImage(c)}return o&&a.setZIndex(o(l)),h?null:a}}function Ko(e,t,i){let n;if(t+"fill-pattern-src"in e)n=dS(e,t+"fill-",i);else{if(e[t+"fill-color"]==="none")return r=>null;n=uf(e,t+"fill-color",i)}if(!n)return null;const s=new li;return function(r){const o=n(r);return o===of?null:(s.setColor(o),s)}}function Yo(e,t,i){const n=He(e,t+"stroke-width",i),s=uf(e,t+"stroke-color",i);if(!n&&!s)return null;const r=cn(e,t+"stroke-line-cap",i),o=cn(e,t+"stroke-line-join",i),a=J0(e,t+"stroke-line-dash",i),l=He(e,t+"stroke-line-dash-offset",i),h=He(e,t+"stroke-miter-limit",i),c=new Si;return function(u){if(s){const f=s(u);if(f===of)return null;c.setColor(f)}if(n&&c.setWidth(n(u)),r){const f=r(u);if(f!=="butt"&&f!=="round"&&f!=="square")throw new Error("Expected butt, round, or square line cap");c.setLineCap(f)}if(o){const f=o(u);if(f!=="bevel"&&f!=="round"&&f!=="miter")throw new Error("Expected bevel, round, or miter line join");c.setLineJoin(f)}return a&&c.setLineDash(a(u)),l&&c.setLineDashOffset(l(u)),h&&c.setMiterLimit(h(u)),c}}function lS(e,t){const i="text-",n=cn(e,i+"value",t);if(!n)return null;const s=Ko(e,i,t),r=Ko(e,i+"background-",t),o=Yo(e,i,t),a=Yo(e,i+"background-",t),l=cn(e,i+"font",t),h=He(e,i+"max-angle",t),c=He(e,i+"offset-x",t),u=He(e,i+"offset-y",t),f=Er(e,i+"overflow",t),d=cn(e,i+"placement",t),g=He(e,i+"repeat",t),_=gh(e,i+"scale",t),m=Er(e,i+"rotate-with-view",t),p=He(e,i+"rotation",t),y=cn(e,i+"align",t),S=cn(e,i+"justify",t),v=cn(e,i+"baseline",t),M=Er(e,i+"keep-upright",t),C=J0(e,i+"padding",t),P=_h(e,i+"declutter-mode"),b=new la({declutterMode:P});return function(T){if(b.setText(n(T)),s&&b.setFill(s(T)),r&&b.setBackgroundFill(r(T)),o&&b.setStroke(o(T)),a&&b.setBackgroundStroke(a(T)),l&&b.setFont(l(T)),h&&b.setMaxAngle(h(T)),c&&b.setOffsetX(c(T)),u&&b.setOffsetY(u(T)),f&&b.setOverflow(f(T)),d){const k=d(T);if(k!=="point"&&k!=="line")throw new Error("Expected point or line for text-placement");b.setPlacement(k)}if(g&&b.setRepeat(g(T)),_&&b.setScale(_(T)),m&&b.setRotateWithView(m(T)),p&&b.setRotation(p(T)),y){const k=y(T);if(k!=="left"&&k!=="center"&&k!=="right"&&k!=="end"&&k!=="start")throw new Error("Expected left, right, center, start, or end for text-align");b.setTextAlign(k)}if(S){const k=S(T);if(k!=="left"&&k!=="right"&&k!=="center")throw new Error("Expected left, right, or center for text-justify");b.setJustify(k)}if(v){const k=v(T);if(k!=="bottom"&&k!=="top"&&k!=="middle"&&k!=="alphabetic"&&k!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");b.setTextBaseline(k)}return C&&b.setPadding(C(T)),M&&b.setKeepUpright(M(T)),b}}function hS(e,t){return"icon-src"in e?cS(e,t):"shape-points"in e?uS(e,t):"circle-radius"in e?fS(e,t):null}function cS(e,t){const i="icon-",n=i+"src",s=Q0(e[n],n),r=Sl(e,i+"anchor",t),o=gh(e,i+"scale",t),a=He(e,i+"opacity",t),l=Sl(e,i+"displacement",t),h=He(e,i+"rotation",t),c=Er(e,i+"rotate-with-view",t),u=Hd(e,i+"anchor-origin"),f=Zd(e,i+"anchor-x-units"),d=Zd(e,i+"anchor-y-units"),g=pS(e,i+"color"),_=_S(e,i+"cross-origin"),m=mS(e,i+"offset"),p=Hd(e,i+"offset-origin"),y=Ml(e,i+"width"),S=Ml(e,i+"height"),v=gS(e,i+"size"),M=_h(e,i+"declutter-mode"),C=new dh({src:s,anchorOrigin:u,anchorXUnits:f,anchorYUnits:d,color:g,crossOrigin:_,offset:m,offsetOrigin:p,height:S,width:y,size:v,declutterMode:M});return function(P){return a&&C.setOpacity(a(P)),l&&C.setDisplacement(l(P)),h&&C.setRotation(h(P)),c&&C.setRotateWithView(c(P)),o&&C.setScale(o(P)),r&&C.setAnchor(r(P)),C}}function uS(e,t){const i="shape-",n=i+"points",s=i+"radius",r=$c(e[n],n),o=$c(e[s],s),a=Ko(e,i,t),l=Yo(e,i,t),h=gh(e,i+"scale",t),c=Sl(e,i+"displacement",t),u=He(e,i+"rotation",t),f=Er(e,i+"rotate-with-view",t),d=Ml(e,i+"radius2"),g=Ml(e,i+"angle"),_=_h(e,i+"declutter-mode"),m=new fh({points:r,radius:o,radius2:d,angle:g,declutterMode:_});return function(p){return a&&m.setFill(a(p)),l&&m.setStroke(l(p)),c&&m.setDisplacement(c(p)),u&&m.setRotation(u(p)),f&&m.setRotateWithView(f(p)),h&&m.setScale(h(p)),m}}function fS(e,t){const i="circle-",n=Ko(e,i,t),s=Yo(e,i,t),r=He(e,i+"radius",t),o=gh(e,i+"scale",t),a=Sl(e,i+"displacement",t),l=He(e,i+"rotation",t),h=Er(e,i+"rotate-with-view",t),c=_h(e,i+"declutter-mode"),u=new Us({radius:5,declutterMode:c});return function(f){return r&&u.setRadius(r(f)),n&&u.setFill(n(f)),s&&u.setStroke(s(f)),a&&u.setDisplacement(a(f)),l&&u.setRotation(l(f)),h&&u.setRotateWithView(h(f)),o&&u.setScale(o(f)),u}}function He(e,t,i){if(!(t in e))return;const n=bn(e[t],yt,i);return function(s){return $c(n(s),t)}}function cn(e,t,i){if(!(t in e))return null;const n=bn(e[t],Ke,i);return function(s){return Q0(n(s),t)}}function dS(e,t,i){const n=cn(e,t+"pattern-src",i),s=qd(e,t+"pattern-offset",i),r=qd(e,t+"pattern-size",i),o=uf(e,t+"color",i);return function(a){return{src:n(a),offset:s&&s(a),size:r&&r(a),color:o&&o(a)}}}function Er(e,t,i){if(!(t in e))return null;const n=bn(e[t],Be,i);return function(s){const r=n(s);if(typeof r!="boolean")throw new Error(`Expected a boolean for ${t}`);return r}}function uf(e,t,i){if(!(t in e))return null;const n=bn(e[t],Ii,i);return function(s){return tm(n(s),t)}}function J0(e,t,i){if(!(t in e))return null;const n=bn(e[t],Fs,i);return function(s){return ha(n(s),t)}}function Sl(e,t,i){if(!(t in e))return null;const n=bn(e[t],Fs,i);return function(s){const r=ha(n(s),t);if(r.length!==2)throw new Error(`Expected two numbers for ${t}`);return r}}function qd(e,t,i){if(!(t in e))return null;const n=bn(e[t],Fs,i);return function(s){return em(n(s),t)}}function gh(e,t,i){if(!(t in e))return null;const n=bn(e[t],Fs|yt,i);return function(s){return yS(n(s),t)}}function Ml(e,t){const i=e[t];if(i!==void 0){if(typeof i!="number")throw new Error(`Expected a number for ${t}`);return i}}function gS(e,t){const i=e[t];if(i!==void 0){if(typeof i=="number")return Qe(i);if(!Array.isArray(i))throw new Error(`Expected a number or size array for ${t}`);if(i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return i}}function _S(e,t){const i=e[t];if(i!==void 0){if(typeof i!="string")throw new Error(`Expected a string for ${t}`);return i}}function Hd(e,t){const i=e[t];if(i!==void 0){if(i!=="bottom-left"&&i!=="bottom-right"&&i!=="top-left"&&i!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return i}}function Zd(e,t){const i=e[t];if(i!==void 0){if(i!=="pixels"&&i!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return i}}function mS(e,t){const i=e[t];if(i!==void 0)return ha(i,t)}function _h(e,t){const i=e[t];if(i!==void 0){if(typeof i!="string")throw new Error(`Expected a string for ${t}`);if(i!=="declutter"&&i!=="obstacle"&&i!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return i}}function pS(e,t){const i=e[t];if(i!==void 0)return tm(i,t)}function ha(e,t){if(!Array.isArray(e))throw new Error(`Expected an array for ${t}`);const i=e.length;for(let n=0;n<i;++n)if(typeof e[n]!="number")throw new Error(`Expected an array of numbers for ${t}`);return e}function Q0(e,t){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}function $c(e,t){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}function tm(e,t){if(typeof e=="string")return e;const i=ha(e,t),n=i.length;if(n<3||n>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return i}function em(e,t){const i=ha(e,t);if(i.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return i}function yS(e,t){return typeof e=="number"?e:em(e,t)}const Jd={RENDER_ORDER:"renderOrder"};class im extends ch{constructor(t){t=t||{};const i=Object.assign({},t);delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,super(i),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Jd.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,i){const n=this.getDeclutter();n in t.declutter||(t.declutter[n]=new z0(9)),this.getRenderer().renderDeclutter(t,i)}setRenderOrder(t){this.set(Jd.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?Z0:t;const i=vS(t);this.styleFunction_=t===null?void 0:nS(i),this.changed()}setDeclutter(t){this.declutter_=t?String(t):void 0,this.changed()}}function vS(e){if(e===void 0)return Z0;if(!e)return null;if(typeof e=="function"||e instanceof fe)return e;if(!Array.isArray(e))return Yd([e]);if(e.length===0)return[];const t=e.length,i=e[0];if(i instanceof fe){const s=new Array(t);for(let r=0;r<t;++r){const o=e[r];if(!(o instanceof fe))throw new Error("Expected a list of style instances");s[r]=o}return s}if("style"in i){const s=new Array(t);for(let r=0;r<t;++r){const o=e[r];if(!("style"in o))throw new Error("Expected a list of rules with a style property");s[r]=o}return oS(s)}return Yd(e)}class nm extends ii{constructor(t,i,n,s){super(t),this.inversePixelTransform=i,this.frameState=n,this.context=s}}class xS extends Hl{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,i){St()}calculateMatrices2D(t){const i=t.viewState,n=t.coordinateToPixelTransform,s=t.pixelToCoordinateTransform;Cn(n,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]),m0(s,n)}forEachFeatureAtCoordinate(t,i,n,s,r,o,a,l){let h;const c=i.viewState;function u(v,M,C,P){return r.call(o,M,v?C:null,P)}const f=c.projection,d=h0(t.slice(),f),g=[[0,0]];if(f.canWrapX()&&s){const v=f.getExtent(),M=xt(v);g.push([-M,0],[M,0])}const _=i.layerStatesArray,m=_.length,p=[],y=[];for(let v=0;v<g.length;v++)for(let M=m-1;M>=0;--M){const C=_[M],P=C.layer;if(P.hasRenderer()&&rf(C,c)&&a.call(l,P)){const b=P.getRenderer(),T=P.getSource();if(b&&T){const k=T.getWrapX()?d:t,U=u.bind(null,C.managed);y[0]=k[0]+g[v][0],y[1]=k[1]+g[v][1],h=b.forEachFeatureAtCoordinate(y,i,n,U,p)}if(h)return h}}if(p.length===0)return;const S=1/p.length;return p.forEach((v,M)=>v.distanceSq+=M*S),p.sort((v,M)=>v.distanceSq-M.distanceSq),p.some(v=>h=v.callback(v.feature,v.layer,v.geometry)),h}hasFeatureAtCoordinate(t,i,n,s,r,o){return this.forEachFeatureAtCoordinate(t,i,n,s,wn,this,r,o)!==void 0}getMap(){return this.map_}renderFrame(t){St()}scheduleExpireIconCache(t){yi.canExpireCache()&&t.postRenderFunctions.push(ES)}}function ES(e,t){yi.expire()}class SS extends xS{constructor(t){super(t),this.fontChangeListenerKey_=_t(ir,Tr.PROPERTYCHANGE,t.redrawText,t),this.element_=mi?O0():document.createElement("div");const i=this.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",this.element_.className=lh+" ol-layers";const n=t.getViewport();n&&n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,i){const n=this.getMap();if(n.hasListener(t)){const s=new nm(t,void 0,i);n.dispatchEvent(s)}}disposeInternal(){Tt(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(pi.PRECOMPOSE,t);const i=t.layerStatesArray.sort((h,c)=>h.zIndex-c.zIndex);i.some(h=>h.layer instanceof im&&h.layer.getDeclutter())&&(t.declutter={});const s=t.viewState;this.children_.length=0;const r=[];let o=null;for(let h=0,c=i.length;h<c;++h){const u=i[h];t.layerIndex=h;const f=u.layer,d=f.getSourceState();if(!rf(u,s)||d!="ready"&&d!="undefined"){f.unrender();continue}const g=f.render(t,o);g&&(g!==o&&(this.children_.push(g),o=g),r.push(u))}this.declutter(t,r),Fx(this.element_,this.children_);const l=this.getMap().getTargetElement();if($n(l)){const h=l.getContext("2d");for(const c of this.children_){const u=c.firstElementChild||c,f=c.style.backgroundColor;if(f&&(!$n(u)||u.width>0)&&(h.fillStyle=f,h.fillRect(0,0,l.width,l.height)),$n(u)&&u.width>0){const d=c.style.opacity||u.style.opacity;h.globalAlpha=d===""?1:Number(d);const g=u.style.transform;if(g)h.setTransform(...Dc(g));else{const _=parseFloat(u.style.width)/u.width,m=parseFloat(u.style.height)/u.height;h.setTransform(_,0,0,m,0,0)}h.drawImage(u,0,0)}}h.globalAlpha=1,h.setTransform(1,0,0,1,0,0)}this.dispatchRenderEvent(pi.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}declutter(t,i){if(t.declutter){for(let n=i.length-1;n>=0;--n){const s=i[n],r=s.layer;r.getDeclutter()&&r.renderDeclutter(t,s)}i.forEach(n=>n.layer.renderDeferred(t))}}}function sm(e){if(e instanceof ch){e.setMapInternal(null);return}e instanceof zr&&e.getLayers().forEach(sm)}function rm(e,t){if(e instanceof ch){e.setMapInternal(t);return}if(e instanceof zr){const i=e.getLayers().getArray();for(let n=0,s=i.length;n<s;++n)rm(i[n],t)}}let MS=class extends Di{constructor(t){super(),t=t||{},this.on,this.once,this.un;const i=wS(t);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=t.maxTilesLoading!==void 0?t.maxTilesLoading:16,this.pixelRatio_=t.pixelRatio!==void 0?t.pixelRatio:fx,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=bi(),this.pixelToCoordinateTransform_=bi(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,mi||(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_=t.moveTolerance,this.keyboardEventTarget_=i.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,mi||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=i.controls||(mi?new Me:kx()),this.interactions=i.interactions||(mi?new Me:sE({onFocusOnly:!0})),this.overlays_=i.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new mx(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Ie.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Ie.VIEW,this.handleViewChanged_),this.addChangeListener(Ie.SIZE,this.handleSizeChanged_),this.addChangeListener(Ie.TARGET,this.handleTargetChanged_),this.setProperties(i.values);const n=this;t.view&&!(t.view instanceof zi)&&t.view.then(function(s){n.setView(new zi(s))}),this.controls.addEventListener(te.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener(te.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener(te.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener(te.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener(te.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener(te.REMOVE,s=>{const r=s.element.getId();r!==void 0&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){rm(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const i=t.getId();i!==void 0&&(this.overlayIdIndex_[i.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_?.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,i,n){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(t);n=n!==void 0?n:{};const r=n.hitTolerance!==void 0?n.hitTolerance:0,o=n.layerFilter!==void 0?n.layerFilter:wn,a=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,a,i,null,o,null)}getFeaturesAtPixel(t,i){const n=[];return this.forEachFeatureAtPixel(t,function(s){n.push(s)},i),n}getAllLayers(){const t=[];function i(n){n.forEach(function(s){s instanceof zr?i(s.getLayers()):t.push(s)})}return i(this.getLayers()),t}hasFeatureAtPixel(t,i){if(!this.frameState_||!this.renderer_)return!1;const n=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};const s=i.layerFilter!==void 0?i.layerFilter:wn,r=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,r,o,s,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const n=this.viewport_.getBoundingClientRect(),s=this.getSize(),r=n.width/s[0],o=n.height/s[1],a="changedTouches"in t?t.changedTouches[0]:t;return[(a.clientX-n.left)/r,(a.clientY-n.top)/o]}getTarget(){return this.get(Ie.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return os(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const i=this.frameState_;return i?he(i.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const i=this.overlayIdIndex_[t.toString()];return i!==void 0?i:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Ie.LAYERGROUP)}setLayers(t){const i=this.getLayerGroup();if(t instanceof Me){i.setLayers(t);return}const n=i.getLayers();n.clear(),n.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let i=0,n=t.length;i<n;++i){const s=t[i];if(!s.visible)continue;const r=s.layer.getRenderer();if(r&&!r.ready)return!0;const o=s.layer.getSource();if(o&&o.loading)return!0}return!1}getPixelFromCoordinate(t){const i=Ft(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(i)}getPixelFromCoordinateInternal(t){const i=this.frameState_;return i?he(i.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(Ie.SIZE)}getView(){return this.get(Ie.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,i,n,s){return px(this.frameState_,t,i,n,s)}handleBrowserEvent(t,i){i=i||t.type;const n=new an(i,this,t);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(t){if(!this.frameState_)return;const i=t.originalEvent,n=i.type;if(n===jc.POINTERDOWN||n===at.WHEEL||n===at.KEYDOWN){const s=this.getOwnerDocument(),r=this.viewport_.getRootNode?this.viewport_.getRootNode():s,o=i.target,a=r instanceof ShadowRoot?r.host===o?r.host.ownerDocument:r:r===s?s.documentElement:r;if(this.overlayContainerStopEvent_.contains(o)||!a.contains(o))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1){const s=this.getInteractions().getArray().slice();for(let r=s.length-1;r>=0;r--){const o=s[r];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,i=this.tileQueue_;if(!i.isEmpty()){let s=this.maxTilesLoading_,r=s;if(t){const o=t.viewHints;if(o[be.ANIMATING]||o[be.INTERACTING]){const a=Date.now()-t.time>8;s=a?0:8,r=a?0:2}}i.getTilesLoading()<s&&(i.reprioritize(),i.loadMoreTiles(s,r))}t&&this.renderer_&&!t.animate&&(this.renderComplete_?(this.hasListener(pi.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(pi.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new tr(ln.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new tr(ln.LOADSTART,this,t))));const n=this.postRenderFunctions_;if(t)for(let s=0,r=n.length;s<r;++s)n[s](this,t);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let n=0,s=this.targetChangeHandlerKeys_.length;n<s;++n)Tt(this.targetChangeHandlerKeys_[n]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(at.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(at.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!$n(this.targetElement_)){this.resizeObserver_?.unobserve(this.targetElement_);const n=this.targetElement_.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.unobserve(n.host),this.setSize(void 0)}const t=this.getTarget(),i=typeof t=="string"?document.getElementById(t):t;if(this.targetElement_=i,!i)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($n(i)||i.appendChild(this.viewport_),this.renderer_||(this.renderer_=new SS(this)),!$n(i)){this.mapBrowserEventHandler_=new gx(this,this.moveTolerance_);for(const s in vt)this.mapBrowserEventHandler_.addEventListener(vt[s],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(at.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(at.WHEEL,this.boundHandleBrowserEvent_,b0?{passive:!1}:!1);let n;if(this.keyboardEventTarget_)n=this.keyboardEventTarget_;else{const s=i.getRootNode();n=s instanceof ShadowRoot?s.host:i}if(this.targetChangeHandlerKeys_=[_t(n,at.KEYDOWN,this.handleBrowserEvent,this),_t(n,at.KEYPRESS,this.handleBrowserEvent,this)],i instanceof HTMLElement){const s=i.getRootNode();s instanceof ShadowRoot&&this.resizeObserver_.observe(s.host),this.resizeObserver_?.observe(i)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(Tt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Tt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=_t(t,Tr.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=_t(t,at.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Tt),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Wn("addlayer",t)),this.layerGroupPropertyListenerKeys_=[_t(t,Tr.PROPERTYCHANGE,this.render,this),_t(t,at.CHANGE,this.render,this),_t(t,"addlayer",this.handleLayerAdd_,this),_t(t,"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 t=this.frameState_.layerStatesArray;for(let i=0,n=t.length;i<n;++i){const s=t[i].layer;s.hasRenderer()&&s.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){sm(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const i=this.getSize(),n=this.getView(),s=this.frameState_;let r=null;if(i!==void 0&&Bd(i)&&n&&n.isDef()){const o=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:ul(a.center,a.resolution,a.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:ht(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;r.nextExtent=ul(a.nextCenter,a.nextResolution,l,i)}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),s&&(!this.previousExtent_||!Dr(this.previousExtent_)&&!Pr(r.extent,this.previousExtent_))&&(this.dispatchEvent(new tr(ln.MOVESTART,this,s)),this.previousExtent_=Gr(this.previousExtent_)),this.previousExtent_&&!r.viewHints[be.ANIMATING]&&!r.viewHints[be.INTERACTING]&&!Pr(r.extent,this.previousExtent_)&&(this.dispatchEvent(new tr(ln.MOVEEND,this,r)),e0(r.extent,this.previousExtent_))),this.dispatchEvent(new tr(ln.POSTRENDER,this,r)),this.renderComplete_=(this.hasListener(ln.LOADSTART)||this.hasListener(ln.LOADEND)||this.hasListener(pi.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const i=this.getLayerGroup();i&&this.handleLayerRemove_(new Wn("removelayer",i)),this.set(Ie.LAYERGROUP,t)}setSize(t){this.set(Ie.SIZE,t)}setTarget(t){this.set(Ie.TARGET,t)}setView(t){if(!t||t instanceof zi){this.set(Ie.VIEW,t);return}this.set(Ie.VIEW,new zi);const i=this;t.then(function(n){i.setView(new zi(n))})}updateSize(){const t=this.getTargetElement();let i;if(t){let s,r;if($n(t))s=t.width,r=t.height;else{const o=getComputedStyle(t);s=t.offsetWidth-parseFloat(o.borderLeftWidth)-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight)-parseFloat(o.borderRightWidth),r=t.offsetHeight-parseFloat(o.borderTopWidth)-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom)-parseFloat(o.borderBottomWidth)}!isNaN(s)&&!isNaN(r)&&(i=[Math.max(0,s),Math.max(0,r)],!Bd(i)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&a0("No map visible because the map container's width or height are 0."))}const n=this.getSize();i&&(!n||!In(i,n))&&(this.setSize(i),this.updateViewportSize_(i))}updateViewportSize_(t){const i=this.getView();i&&i.setViewportSize(t)}};function wS(e){let t=null;e.keyboardEventTarget!==void 0&&(t=typeof e.keyboardEventTarget=="string"?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);const i={},n=e.layers&&typeof e.layers.getLayers=="function"?e.layers:new zr({layers:e.layers});i[Ie.LAYERGROUP]=n,i[Ie.TARGET]=e.target,i[Ie.VIEW]=e.view instanceof zi?e.view:new zi;let s;e.controls!==void 0&&(Array.isArray(e.controls)?s=new Me(e.controls.slice()):(bt(typeof e.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),s=e.controls));let r;e.interactions!==void 0&&(Array.isArray(e.interactions)?r=new Me(e.interactions.slice()):(bt(typeof e.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),r=e.interactions));let o;return e.overlays!==void 0?Array.isArray(e.overlays)?o=new Me(e.overlays.slice()):(bt(typeof e.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=e.overlays):o=new Me,{controls:s,interactions:r,keyboardEventTarget:t,overlays:o,values:i}}function CS(e,t){for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&t[i]!==void 0&&(e[i]=t[i]);return e}const TS=_e({__name:"OlMap",props:{controls:{},pixelRatio:{},interactions:{},keyboardEventTarget:{},layers:{},maxTilesLoading:{},moveTolerance:{},overlays:{},target:{},view:{},instance:{}},emits:["change","error","propertychange","change:layerGroup","change:size","change:target","change:view","click","dblclick","singleclick","loadstart","loadend","pointerdrag","pointermove","movestart","moveend","postrender","precompose","postcompose","rendercomplete"],setup(e,{expose:t,emit:i}){const n=e,s=i,r=Pn({...n,instance:void 0}),o=Nt(void 0);let a=n.instance||new MS({...r});ie(r,()=>{const f=n.instance?CS(r,n.instance.getProperties()):r;a?.setProperties(f)},{immediate:!0}),ei(()=>{n.instance||a?.setTarget(o.value)}),Eu(()=>{n.instance||a?.setTarget(void 0)}),wi(()=>{a=void 0}),Mi("map",a);const l=(f,d,g)=>a?.forEachFeatureAtPixel(f,d,g),h=f=>a?.getCoordinateFromPixel(f),c=()=>a?.render(),u=()=>a?.updateSize();return a.on("change",f=>s("change",f)),a.on("error",f=>s("error",f)),a.on("propertychange",f=>s("propertychange",f)),a.on("click",f=>s("click",f)),a.on("change:size",f=>s("change:size",f)),a.on("change:target",f=>s("change:target",f)),a.on("change:view",f=>s("change:view",f)),a.on("dblclick",f=>s("dblclick",f)),a.on("singleclick",f=>s("singleclick",f)),a.on("pointerdrag",f=>s("pointerdrag",f)),a.on("pointermove",f=>s("pointermove",f)),a.on("movestart",f=>s("movestart",f)),a.on("moveend",f=>s("moveend",f)),a.on("postrender",f=>s("postrender",f)),a.on("precompose",f=>s("precompose",f)),a.on("postcompose",f=>s("postcompose",f)),a.on("rendercomplete",f=>s("rendercomplete",f)),a.on("loadstart",f=>{a?.getTargetElement().classList.add("ol-map"),a?.getTargetElement().classList.add("ol-map-loading"),a?.getTargetElement().classList.remove("ol-map-fully-loaded"),s("loadstart",f)}),a.on("loadend",f=>{a?.getTargetElement().classList.add("ol-map-fully-loaded"),a?.getTargetElement().classList.remove("ol-map-loading"),s("loadend",f)}),t({map:a,mapRef:o,forEachFeatureAtPixel:l,getCoordinateFromPixel:h,render:c,updateSize:u}),(f,d)=>(dt(),jt("div",{ref_key:"mapRef",ref:o},[qi(f.$slots,"default")],512))}}),Te={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};class RS extends Di{constructor(t){super(),this.on,this.once,this.un,this.options=t,this.id=t.id,this.insertFirst=t.insertFirst!==void 0?t.insertFirst:!0,this.stopEvent=t.stopEvent!==void 0?t.stopEvent:!0,this.element=document.createElement("div"),this.element.className=t.className!==void 0?t.className:"ol-overlay-container "+bx,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=t.autoPan===!0?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(Te.ELEMENT,this.handleElementChanged),this.addChangeListener(Te.MAP,this.handleMapChanged),this.addChangeListener(Te.OFFSET,this.handleOffsetChanged),this.addChangeListener(Te.POSITION,this.handlePositionChanged),this.addChangeListener(Te.POSITIONING,this.handlePositioningChanged),t.element!==void 0&&this.setElement(t.element),this.setOffset(t.offset!==void 0?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),t.position!==void 0&&this.setPosition(t.position)}getElement(){return this.get(Te.ELEMENT)}getId(){return this.id}getMap(){return this.get(Te.MAP)||null}getOffset(){return this.get(Te.OFFSET)}getPosition(){return this.get(Te.POSITION)}getPositioning(){return this.get(Te.POSITIONING)}handleElementChanged(){L0(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(this.element?.remove(),Tt(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=_t(t,ln.POSTRENDER,this.render,this),this.updatePixelPosition();const i=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?i.insertBefore(this.element,i.childNodes[0]||null):i.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set(Te.ELEMENT,t)}setMap(t){this.set(Te.MAP,t)}setOffset(t){this.set(Te.OFFSET,t)}setPosition(t){this.set(Te.POSITION,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const i=this.getMap();if(!i||!i.getTargetElement()||!this.get(Te.POSITION))return;const n=this.getRect(i.getTargetElement(),i.getSize()),s=this.getElement(),r=this.getRect(s,[Lx(s),Ox(s)]);t=t||{};const o=t.margin===void 0?20:t.margin;if(!fn(n,r)){const a=r[0]-n[0],l=n[2]-r[2],h=r[1]-n[1],c=n[3]-r[3],u=[0,0];if(a<0?u[0]=a-o:l<0&&(u[0]=Math.abs(l)+o),h<0?u[1]=h-o:c<0&&(u[1]=Math.abs(c)+o),u[0]!==0||u[1]!==0){const f=i.getView().getCenterInternal(),d=i.getPixelFromCoordinateInternal(f);if(!d)return;const g=[d[0]+u[0],d[1]+u[1]],_=t.animation||{};i.getView().animateInternal({center:i.getCoordinateFromPixelInternal(g),duration:_.duration,easing:_.easing})}}}getRect(t,i){const n=t.getBoundingClientRect(),s=n.left+window.pageXOffset,r=n.top+window.pageYOffset;return[s,r,s+i[0],r+i[1]]}setPositioning(t){this.set(Te.POSITIONING,t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){const t=this.getMap(),i=this.getPosition();if(!t||!t.isRendered()||!i){this.setVisible(!1);return}const n=t.getPixelFromCoordinate(i),s=t.getSize();this.updateRenderedPosition(n,s)}updateRenderedPosition(t,i){const n=this.element.style,s=this.getOffset(),r=this.getPositioning();this.setVisible(!0);const o=`${t[0]+s[0]}px`,a=`${t[1]+s[1]}px`;let l="0%",h="0%";r=="bottom-right"||r=="center-right"||r=="top-right"?l="-100%":(r=="bottom-center"||r=="center-center"||r=="top-center")&&(l="-50%"),r=="bottom-left"||r=="bottom-center"||r=="bottom-right"?h="-100%":(r=="center-left"||r=="center-center"||r=="center-right")&&(h="-50%");const c=`translate(${l}, ${h}) translate(${o}, ${a})`;this.rendered.transform_!=c&&(this.rendered.transform_=c,n.transform=c)}getOptions(){return this.options}}const IS=_e({inheritAttrs:!1,__name:"OlOverlay",props:{id:{},element:{},offset:{},position:{},positioning:{},stopEvent:{type:Boolean,default:!0},insertFirst:{type:Boolean,default:!0},autoPan:{type:[Boolean,Object]},className:{}},emits:["change","error","propertychange","change:element","change:map","change:offset","change:position","change:positioning"],setup(e,{expose:t}){const i=e,n=Xt("map"),s=Nt(),r=Pn(i),o=Lo(new RS(r));kr(o,["change:element","change:map","change:offset","change:position","change:positioning"]);const a=()=>o.value.getOffset(),l=()=>o.value.getPosition(),h=()=>o.value.getPositioning(),c=m=>o.value.panIntoView(m),u=m=>o.value.setElement(m),f=m=>o.value.setOffset(m),d=m=>o.value.setPosition(m),g=m=>o.value.setPositioning(m);function _(m){n?.removeOverlay(m)||console.warn("couldn't find matching overlay to remove",o.value)}return ei(()=>{n?.addOverlay(o.value)}),wi(()=>_(o.value)),ie(()=>r,m=>{for(const p in m){const y=p;m[y]!==void 0&&o.value.set(p,m[y])}},{deep:!0}),kp(()=>{u(s.value)},{flush:"post"}),t({overlay:o,htmlContent:s,getOffset:a,getPosition:l,getPositioning:h,panIntoView:c,setElement:u,setOffset:f,setPosition:d,setPositioning:g}),(m,p)=>(dt(),jt("div",{ref_key:"htmlContent",ref:s},[qi(m.$slots,"default",{position:m.position})],512))}});function PS(e){const t=Object.keys(e.defs),i=t.length;let n,s;for(n=0;n<i;++n){const r=t[n];if(!Ka(r)){const o=e.defs(r);let a=o.units;!a&&o.projName==="longlat"&&(a="degrees"),gl(new As({code:r,axisOrientation:o.axis,metersPerUnit:o.to_meter,units:a}))}}for(n=0;n<i;++n){const r=t[n],o=Ka(r);for(s=0;s<i;++s){const a=t[s],l=Ka(a);if(!Ya(r,a))if(e.defs[r]===e.defs[a])Fc([o,l]);else{const h=e(r,a);bv(o,l,Cd(o,l,h.forward),Cd(l,o,h.inverse))}}}}function bS(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var t=1;t<=60;++t)e("EPSG:"+(32600+t),"+proj=utm +zone="+t+" +datum=WGS84 +units=m"),e("EPSG:"+(32700+t),"+proj=utm +zone="+t+" +south +datum=WGS84 +units=m");e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}var Gs=1,Ds=2,Sr=3,AS=4,Kc=5,Qd=6378137,LS=6356752314e-3,tg=.0066943799901413165,Mo=484813681109536e-20,W=Math.PI/2,OS=.16666666666666666,FS=.04722222222222222,GS=.022156084656084655,Y=1e-10,xe=.017453292519943295,Vi=57.29577951308232,It=Math.PI/4,qo=Math.PI*2,ee=3.14159265359,ni={};ni.greenwich=0;ni.lisbon=-9.131906111111;ni.paris=2.337229166667;ni.bogota=-74.080916666667;ni.madrid=-3.687938888889;ni.rome=12.452333333333;ni.bern=7.439583333333;ni.jakarta=106.807719444444;ni.ferro=-17.666666666667;ni.brussels=4.367975;ni.stockholm=18.058277777778;ni.athens=23.7163375;ni.oslo=10.722916666667;const DS={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var eg=/[\s_\-\/\(\)]/g;function as(e,t){if(e[t])return e[t];for(var i=Object.keys(e),n=t.toLowerCase().replace(eg,""),s=-1,r,o;++s<i.length;)if(r=i[s],o=r.toLowerCase().replace(eg,""),o===n)return e[r]}function Yc(e){var t={},i=e.split("+").map(function(a){return a.trim()}).filter(function(a){return a}).reduce(function(a,l){var h=l.split("=");return h.push(!0),a[h[0].toLowerCase()]=h[1],a},{}),n,s,r,o={proj:"projName",datum:"datumCode",rf:function(a){t.rf=parseFloat(a)},lat_0:function(a){t.lat0=a*xe},lat_1:function(a){t.lat1=a*xe},lat_2:function(a){t.lat2=a*xe},lat_ts:function(a){t.lat_ts=a*xe},lon_0:function(a){t.long0=a*xe},lon_1:function(a){t.long1=a*xe},lon_2:function(a){t.long2=a*xe},alpha:function(a){t.alpha=parseFloat(a)*xe},gamma:function(a){t.rectified_grid_angle=parseFloat(a)*xe},lonc:function(a){t.longc=a*xe},x_0:function(a){t.x0=parseFloat(a)},y_0:function(a){t.y0=parseFloat(a)},k_0:function(a){t.k0=parseFloat(a)},k:function(a){t.k0=parseFloat(a)},a:function(a){t.a=parseFloat(a)},b:function(a){t.b=parseFloat(a)},r:function(a){t.a=t.b=parseFloat(a)},r_a:function(){t.R_A=!0},zone:function(a){t.zone=parseInt(a,10)},south:function(){t.utmSouth=!0},towgs84:function(a){t.datum_params=a.split(",").map(function(l){return parseFloat(l)})},to_meter:function(a){t.to_meter=parseFloat(a)},units:function(a){t.units=a;var l=as(DS,a);l&&(t.to_meter=l.to_meter)},from_greenwich:function(a){t.from_greenwich=a*xe},pm:function(a){var l=as(ni,a);t.from_greenwich=(l||parseFloat(a))*xe},nadgrids:function(a){a==="@null"?t.datumCode="none":t.nadgrids=a},axis:function(a){var l="ewnsud";a.length===3&&l.indexOf(a.substr(0,1))!==-1&&l.indexOf(a.substr(1,1))!==-1&&l.indexOf(a.substr(2,1))!==-1&&(t.axis=a)},approx:function(){t.approx=!0}};for(n in i)s=i[n],n in o?(r=o[n],typeof r=="function"?r(s):t[r]=s):t[n]=s;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}class om{static getId(t){const i=t.find(n=>Array.isArray(n)&&n[0]==="ID");return i&&i.length>=3?{authority:i[1],code:parseInt(i[2],10)}:null}static convertUnit(t,i="unit"){if(!t||t.length<3)return{type:i,name:"unknown",conversion_factor:null};const n=t[1],s=parseFloat(t[2])||null,r=t.find(a=>Array.isArray(a)&&a[0]==="ID"),o=r?{authority:r[1],code:parseInt(r[2],10)}:null;return{type:i,name:n,conversion_factor:s,id:o}}static convertAxis(t){const i=t[1]||"Unknown";let n;const s=i.match(/^\((.)\)$/);if(s){const h=s[1].toUpperCase();if(h==="E")n="east";else if(h==="N")n="north";else if(h==="U")n="up";else throw new Error(`Unknown axis abbreviation: ${h}`)}else n=t[2]?t[2].toLowerCase():"unknown";const r=t.find(h=>Array.isArray(h)&&h[0]==="ORDER"),o=r?parseInt(r[1],10):null,a=t.find(h=>Array.isArray(h)&&(h[0]==="LENGTHUNIT"||h[0]==="ANGLEUNIT"||h[0]==="SCALEUNIT")),l=this.convertUnit(a);return{name:i,direction:n,unit:l,order:o}}static extractAxes(t){return t.filter(i=>Array.isArray(i)&&i[0]==="AXIS").map(i=>this.convertAxis(i)).sort((i,n)=>(i.order||0)-(n.order||0))}static convert(t,i={}){switch(t[0]){case"PROJCRS":i.type="ProjectedCRS",i.name=t[1],i.base_crs=t.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="BASEGEOGCRS")):null,i.conversion=t.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="CONVERSION")):null;const n=t.find(f=>Array.isArray(f)&&f[0]==="CS");n&&(i.coordinate_system={type:n[1],axis:this.extractAxes(t)});const s=t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT");if(s){const f=this.convertUnit(s);i.coordinate_system.unit=f}i.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":i.type="GeographicCRS",i.name=t[1];const r=t.find(f=>Array.isArray(f)&&(f[0]==="DATUM"||f[0]==="ENSEMBLE"));if(r){const f=this.convert(r);r[0]==="ENSEMBLE"?i.datum_ensemble=f:i.datum=f;const d=t.find(g=>Array.isArray(g)&&g[0]==="PRIMEM");d&&d[1]!=="Greenwich"&&(f.prime_meridian={name:d[1],longitude:parseFloat(d[2])})}i.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},i.id=this.getId(t);break;case"DATUM":i.type="GeodeticReferenceFrame",i.name=t[1],i.ellipsoid=t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":i.type="DatumEnsemble",i.name=t[1],i.members=t.filter(f=>Array.isArray(f)&&f[0]==="MEMBER").map(f=>({type:"DatumEnsembleMember",name:f[1],id:this.getId(f)}));const o=t.find(f=>Array.isArray(f)&&f[0]==="ENSEMBLEACCURACY");o&&(i.accuracy=parseFloat(o[1]));const a=t.find(f=>Array.isArray(f)&&f[0]==="ELLIPSOID");a&&(i.ellipsoid=this.convert(a)),i.id=this.getId(t);break;case"ELLIPSOID":i.type="Ellipsoid",i.name=t[1],i.semi_major_axis=parseFloat(t[2]),i.inverse_flattening=parseFloat(t[3]),t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT")&&this.convert(t.find(f=>Array.isArray(f)&&f[0]==="LENGTHUNIT"),i);break;case"CONVERSION":i.type="Conversion",i.name=t[1],i.method=t.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,i.parameters=t.filter(f=>Array.isArray(f)&&f[0]==="PARAMETER").map(f=>this.convert(f));break;case"METHOD":i.type="Method",i.name=t[1],i.id=this.getId(t);break;case"PARAMETER":i.type="Parameter",i.name=t[1],i.value=parseFloat(t[2]),i.unit=this.convertUnit(t.find(f=>Array.isArray(f)&&(f[0]==="LENGTHUNIT"||f[0]==="ANGLEUNIT"||f[0]==="SCALEUNIT"))),i.id=this.getId(t);break;case"BOUNDCRS":i.type="BoundCRS";const l=t.find(f=>Array.isArray(f)&&f[0]==="SOURCECRS");if(l){const f=l.find(d=>Array.isArray(d));i.source_crs=f?this.convert(f):null}const h=t.find(f=>Array.isArray(f)&&f[0]==="TARGETCRS");if(h){const f=h.find(d=>Array.isArray(d));i.target_crs=f?this.convert(f):null}const c=t.find(f=>Array.isArray(f)&&f[0]==="ABRIDGEDTRANSFORMATION");c?i.transformation=this.convert(c):i.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(i.type="Transformation",i.name=t[1],i.method=t.find(f=>Array.isArray(f)&&f[0]==="METHOD")?this.convert(t.find(f=>Array.isArray(f)&&f[0]==="METHOD")):null,i.parameters=t.filter(f=>Array.isArray(f)&&(f[0]==="PARAMETER"||f[0]==="PARAMETERFILE")).map(f=>{if(f[0]==="PARAMETER")return this.convert(f);if(f[0]==="PARAMETERFILE")return{name:f[1],value:f[2],id:{authority:"EPSG",code:8656}}}),i.parameters.length===7){const f=i.parameters[6];f.name==="Scale difference"&&(f.value=Math.round((f.value-1)*1e12)/1e6)}i.id=this.getId(t);break;case"AXIS":i.coordinate_system||(i.coordinate_system={type:"unspecified",axis:[]}),i.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const u=this.convertUnit(t,"LinearUnit");i.coordinate_system&&i.coordinate_system.axis&&i.coordinate_system.axis.forEach(f=>{f.unit||(f.unit=u)}),u.conversion_factor&&u.conversion_factor!==1&&i.semi_major_axis&&(i.semi_major_axis={value:i.semi_major_axis,unit:u});break;default:i.keyword=t[0];break}return i}}class NS extends om{static convert(t,i={}){return super.convert(t,i),i.coordinate_system&&i.coordinate_system.subtype==="Cartesian"&&delete i.coordinate_system,i.usage&&delete i.usage,i}}class kS extends om{static convert(t,i={}){super.convert(t,i);const n=t.find(r=>Array.isArray(r)&&r[0]==="CS");n&&(i.coordinate_system={subtype:n[1],axis:this.extractAxes(t)});const s=t.find(r=>Array.isArray(r)&&r[0]==="USAGE");if(s){const r=s.find(l=>Array.isArray(l)&&l[0]==="SCOPE"),o=s.find(l=>Array.isArray(l)&&l[0]==="AREA"),a=s.find(l=>Array.isArray(l)&&l[0]==="BBOX");i.usage={},r&&(i.usage.scope=r[1]),o&&(i.usage.area=o[1]),a&&(i.usage.bbox=a.slice(1))}return i}}function jS(e){return e.find(t=>Array.isArray(t)&&t[0]==="USAGE")?"2019":(e.find(t=>Array.isArray(t)&&t[0]==="CS")||e[0]==="BOUNDCRS"||e[0]==="PROJCRS"||e[0]==="GEOGCRS","2015")}function BS(e){return(jS(e)==="2019"?kS:NS).convert(e)}function zS(e){const t=e.toUpperCase();return t.includes("PROJCRS")||t.includes("GEOGCRS")||t.includes("BOUNDCRS")||t.includes("VERTCRS")||t.includes("LENGTHUNIT")||t.includes("ANGLEUNIT")||t.includes("SCALEUNIT")?"WKT2":(t.includes("PROJCS")||t.includes("GEOGCS")||t.includes("LOCAL_CS")||t.includes("VERT_CS")||t.includes("UNIT"),"WKT1")}var Ho=1,am=2,lm=3,wl=4,hm=5,ff=-1,WS=/\s/,US=/[A-Za-z]/,VS=/[A-Za-z84_]/,mh=/[,\]]/,cm=/[\d\.E\-\+]/;function An(e){if(typeof e!="string")throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Ho}An.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==wl)for(;WS.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case Ho:return this.neutral(e);case am:return this.keyword(e);case wl:return this.quoted(e);case hm:return this.afterquote(e);case lm:return this.number(e);case ff:return}};An.prototype.afterquote=function(e){if(e==='"'){this.word+='"',this.state=wl;return}if(mh.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in afterquote yet, index '+this.place)};An.prototype.afterItem=function(e){if(e===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Ho;return}if(e==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Ho,this.currentObject=this.stack.pop(),this.currentObject||(this.state=ff);return}};An.prototype.number=function(e){if(cm.test(e)){this.word+=e;return}if(mh.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in number yet, index '+this.place)};An.prototype.quoted=function(e){if(e==='"'){this.state=hm;return}this.word+=e};An.prototype.keyword=function(e){if(VS.test(e)){this.word+=e;return}if(e==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=Ho;return}if(mh.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in keyword yet, index '+this.place)};An.prototype.neutral=function(e){if(US.test(e)){this.word=e,this.state=am;return}if(e==='"'){this.word="",this.state=wl;return}if(cm.test(e)){this.word=e,this.state=lm;return}if(mh.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in neutral yet, index '+this.place)};An.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===ff)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function XS(e){var t=new An(e);return t.output()}function Jh(e,t,i){Array.isArray(t)&&(i.unshift(t),t=null);var n=t?{}:e,s=i.reduce(function(r,o){return ar(o,r),r},n);t&&(e[t]=s)}function ar(e,t){if(!Array.isArray(e)){t[e]=!0;return}var i=e.shift();if(i==="PARAMETER"&&(i=e.shift()),e.length===1){if(Array.isArray(e[0])){t[i]={},ar(e[0],t[i]);return}t[i]=e[0];return}if(!e.length){t[i]=!0;return}if(i==="TOWGS84"){t[i]=e;return}if(i==="AXIS"){i in t||(t[i]=[]),t[i].push(e);return}Array.isArray(i)||(t[i]={});var n;switch(i){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[i]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&ar(e[2],t[i]);return;case"SPHEROID":case"ELLIPSOID":t[i]={name:e[0],a:e[1],rf:e[2]},e.length===4&&ar(e[3],t[i]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":e[0]=["name",e[0]],Jh(t,i,e);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":e[0]=["name",e[0]],Jh(t,i,e),t[i].type=i;return;default:for(n=-1;++n<e.length;)if(!Array.isArray(e[n]))return ar(e,t[i]);return Jh(t,i,e)}}var $S=.017453292519943295;function Ti(e){return e*$S}function um(e){const t=(e.projName||"").toLowerCase().replace(/_/g," ");!e.long0&&e.longc&&(t==="albers conic equal area"||t==="lambert azimuthal equal area")&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(t==="stereographic south pole"||t==="polar stereographic (variant b)")?(e.lat0=Ti(e.lat1>0?90:-90),e.lat_ts=e.lat1,delete e.lat1):!e.lat_ts&&e.lat0&&(t==="polar stereographic"||t==="polar stereographic (variant a)")&&(e.lat_ts=e.lat0,e.lat0=Ti(e.lat0>0?90:-90),delete e.lat1)}function ig(e){let t={units:null,to_meter:void 0};return typeof e=="string"?(t.units=e.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.units==="meter"&&(t.to_meter=1)):e&&e.name&&(t.units=e.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.to_meter=e.conversion_factor),t}function ng(e){return typeof e=="object"?e.value*e.unit.conversion_factor:e}function sg(e,t){e.ellipsoid.radius?(t.a=e.ellipsoid.radius,t.rf=0):(t.a=ng(e.ellipsoid.semi_major_axis),e.ellipsoid.inverse_flattening!==void 0?t.rf=e.ellipsoid.inverse_flattening:e.ellipsoid.semi_major_axis!==void 0&&e.ellipsoid.semi_minor_axis!==void 0&&(t.rf=t.a/(t.a-ng(e.ellipsoid.semi_minor_axis))))}function Cl(e,t={}){return!e||typeof e!="object"?e:e.type==="BoundCRS"?(Cl(e.source_crs,t),e.transformation&&(e.transformation.method&&e.transformation.method.name==="NTv2"?t.nadgrids=e.transformation.parameters[0].value:t.datum_params=e.transformation.parameters.map(i=>i.value)),t):(Object.keys(e).forEach(i=>{const n=e[i];if(n!==null)switch(i){case"name":if(t.srsCode)break;t.name=n,t.srsCode=n;break;case"type":n==="GeographicCRS"?t.projName="longlat":n==="ProjectedCRS"&&e.conversion&&e.conversion.method&&(t.projName=e.conversion.method.name);break;case"datum":case"datum_ensemble":n.ellipsoid&&(t.ellps=n.ellipsoid.name,sg(n,t)),n.prime_meridian&&(t.from_greenwich=n.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":t.ellps=n.name,sg(n,t);break;case"prime_meridian":t.long0=(n.longitude||0)*Math.PI/180;break;case"coordinate_system":if(n.axis){if(t.axis=n.axis.map(s=>{const r=s.direction;if(r==="east")return"e";if(r==="north")return"n";if(r==="west")return"w";if(r==="south")return"s";throw new Error(`Unknown axis direction: ${r}`)}).join("")+"u",n.unit){const{units:s,to_meter:r}=ig(n.unit);t.units=s,t.to_meter=r}else if(n.axis[0]&&n.axis[0].unit){const{units:s,to_meter:r}=ig(n.axis[0].unit);t.units=s,t.to_meter=r}}break;case"id":n.authority&&n.code&&(t.title=n.authority+":"+n.code);break;case"conversion":n.method&&n.method.name&&(t.projName=n.method.name),n.parameters&&n.parameters.forEach(s=>{const r=s.name.toLowerCase().replace(/\s+/g,"_"),o=s.value;s.unit&&s.unit.conversion_factor?t[r]=o*s.unit.conversion_factor:s.unit==="degree"?t[r]=o*Math.PI/180:t[r]=o});break;case"unit":n.name&&(t.units=n.name.toLowerCase(),t.units==="metre"&&(t.units="meter")),n.conversion_factor&&(t.to_meter=n.conversion_factor);break;case"base_crs":Cl(n,t),t.datumCode=n.id?n.id.authority+"_"+n.id.code:n.name;break}}),t.latitude_of_false_origin!==void 0&&(t.lat0=t.latitude_of_false_origin),t.longitude_of_false_origin!==void 0&&(t.long0=t.longitude_of_false_origin),t.latitude_of_standard_parallel!==void 0&&(t.lat0=t.latitude_of_standard_parallel,t.lat1=t.latitude_of_standard_parallel),t.latitude_of_1st_standard_parallel!==void 0&&(t.lat1=t.latitude_of_1st_standard_parallel),t.latitude_of_2nd_standard_parallel!==void 0&&(t.lat2=t.latitude_of_2nd_standard_parallel),t.latitude_of_projection_centre!==void 0&&(t.lat0=t.latitude_of_projection_centre),t.longitude_of_projection_centre!==void 0&&(t.longc=t.longitude_of_projection_centre),t.easting_at_false_origin!==void 0&&(t.x0=t.easting_at_false_origin),t.northing_at_false_origin!==void 0&&(t.y0=t.northing_at_false_origin),t.latitude_of_natural_origin!==void 0&&(t.lat0=t.latitude_of_natural_origin),t.longitude_of_natural_origin!==void 0&&(t.long0=t.longitude_of_natural_origin),t.longitude_of_origin!==void 0&&(t.long0=t.longitude_of_origin),t.false_easting!==void 0&&(t.x0=t.false_easting),t.easting_at_projection_centre&&(t.x0=t.easting_at_projection_centre),t.false_northing!==void 0&&(t.y0=t.false_northing),t.northing_at_projection_centre&&(t.y0=t.northing_at_projection_centre),t.standard_parallel_1!==void 0&&(t.lat1=t.standard_parallel_1),t.standard_parallel_2!==void 0&&(t.lat2=t.standard_parallel_2),t.scale_factor_at_natural_origin!==void 0&&(t.k0=t.scale_factor_at_natural_origin),t.scale_factor_at_projection_centre!==void 0&&(t.k0=t.scale_factor_at_projection_centre),t.scale_factor_on_pseudo_standard_parallel!==void 0&&(t.k0=t.scale_factor_on_pseudo_standard_parallel),t.azimuth!==void 0&&(t.alpha=t.azimuth),t.azimuth_at_projection_centre!==void 0&&(t.alpha=t.azimuth_at_projection_centre),t.angle_from_rectified_to_skew_grid&&(t.rectified_grid_angle=t.angle_from_rectified_to_skew_grid),um(t),t)}var KS=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function YS(e,t){var i=t[0],n=t[1];!(i in e)&&n in e&&(e[i]=e[n],t.length===3&&(e[i]=t[2](e[i])))}function fm(e){for(var t=Object.keys(e),i=0,n=t.length;i<n;++i){var s=t[i];KS.indexOf(s)!==-1&&qS(e[s]),typeof e[s]=="object"&&fm(e[s])}}function qS(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+":"+e.AUTHORITY[t])}if(e.type==="GEOGCS"?e.projName="longlat":e.type==="LOCAL_CS"?(e.projName="identity",e.local=!0):typeof e.PROJECTION=="object"?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var i="",n=0,s=e.AXIS.length;n<s;++n){var r=[e.AXIS[n][0].toLowerCase(),e.AXIS[n][1].toLowerCase()];r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"?i+="n":r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"?i+="s":r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"?i+="e":(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west")&&(i+="w")}i.length===2&&(i+="u"),i.length===3&&(e.axis=i)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.UNIT.convert&&(e.type==="GEOGCS"?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;e.type==="GEOGCS"&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),e.datumCode.slice(0,2)==="d_"&&(e.datumCode=e.datumCode.slice(2)),e.datumCode==="new_zealand_1949"&&(e.datumCode="nzgd49"),(e.datumCode==="wgs_1984"||e.datumCode==="world_geodetic_system_1984")&&(e.PROJECTION==="Mercator_Auxiliary_Sphere"&&(e.sphere=!0),e.datumCode="wgs84"),e.datumCode==="belge_1972"&&(e.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),e.ellps.toLowerCase().slice(0,13)==="international"&&(e.ellps="intl"),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),e.datumCode==="ch1903+"&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),e.rectified_grid_angle&&(e.rectified_grid_angle=Ti(e.rectified_grid_angle));function a(c){var u=e.to_meter||1;return c*u}var l=function(c){return YS(e,c)},h=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Ti],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Ti],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",Ti],["lat0","latitude_of_origin",Ti],["lat0","standard_parallel_1",Ti],["lat1","standard_parallel_1",Ti],["lat2","standard_parallel_2",Ti],["azimuth","Azimuth"],["alpha","azimuth",Ti],["srsCode","name"]];h.forEach(l),um(e)}function qc(e){if(typeof e=="object")return Cl(e);const t=zS(e);var i=XS(e);if(t==="WKT2"){const r=BS(i);return Cl(r)}var n=i[0],s={};return ar(i,s),fm(s),s[n]}function ke(e){var t=this;if(arguments.length===2){var i=arguments[1];typeof i=="string"?i.charAt(0)==="+"?ke[e]=Yc(arguments[1]):ke[e]=qc(arguments[1]):ke[e]=i}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(n){return Array.isArray(n)?ke.apply(t,n):ke(n)});if(typeof e=="string"){if(e in ke)return ke[e]}else"EPSG"in e?ke["EPSG:"+e.EPSG]=e:"ESRI"in e?ke["ESRI:"+e.ESRI]=e:"IAU2000"in e?ke["IAU2000:"+e.IAU2000]=e:console.log(e);return}}bS(ke);function HS(e){return typeof e=="string"}function ZS(e){return e in ke}function JS(e){return e.indexOf("+")!==0&&e.indexOf("[")!==-1||typeof e=="object"&&!("srsCode"in e)}var QS=["3857","900913","3785","102113"];function tM(e){var t=as(e,"authority");if(t){var i=as(t,"epsg");return i&&QS.indexOf(i)>-1}}function eM(e){var t=as(e,"extension");if(t)return as(t,"proj4")}function iM(e){return e[0]==="+"}function nM(e){if(HS(e)){if(ZS(e))return ke[e];if(JS(e)){var t=qc(e);if(tM(t))return ke["EPSG:3857"];var i=eM(t);return i?Yc(i):t}if(iM(e))return Yc(e)}else return"projName"in e?e:qc(e)}function rg(e,t){e=e||{};var i,n;if(!t)return e;for(n in t)i=t[n],i!==void 0&&(e[n]=i);return e}function Yi(e,t,i){var n=e*t;return i/Math.sqrt(1-n*n)}function ca(e){return e<0?-1:1}function H(e){return Math.abs(e)<=ee?e:e-ca(e)*qo}function Ai(e,t,i){var n=e*i,s=.5*e;return n=Math.pow((1-n)/(1+n),s),Math.tan(.5*(W-t))/n}function Zo(e,t){for(var i=.5*e,n,s,r=W-2*Math.atan(t),o=0;o<=15;o++)if(n=e*Math.sin(r),s=W-2*Math.atan(t*Math.pow((1-n)/(1+n),i))-r,r+=s,Math.abs(s)<=1e-10)return r;return-9999}function sM(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Yi(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function rM(e){var t=e.x,i=e.y;if(i*Vi>90&&i*Vi<-90&&t*Vi>180&&t*Vi<-180)return null;var n,s;if(Math.abs(Math.abs(i)-W)<=Y)return null;if(this.sphere)n=this.x0+this.a*this.k0*H(t-this.long0),s=this.y0+this.a*this.k0*Math.log(Math.tan(It+.5*i));else{var r=Math.sin(i),o=Ai(this.e,i,r);n=this.x0+this.a*this.k0*H(t-this.long0),s=this.y0-this.a*this.k0*Math.log(o)}return e.x=n,e.y=s,e}function oM(e){var t=e.x-this.x0,i=e.y-this.y0,n,s;if(this.sphere)s=W-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var r=Math.exp(-i/(this.a*this.k0));if(s=Zo(this.e,r),s===-9999)return null}return n=H(this.long0+t/(this.a*this.k0)),e.x=n,e.y=s,e}var aM=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const lM={init:sM,forward:rM,inverse:oM,names:aM};function hM(){}function og(e){return e}var cM=["longlat","identity"];const uM={init:hM,forward:og,inverse:og,names:cM};var fM=[lM,uM],Ss={},lr=[];function dm(e,t){var i=lr.length;return e.names?(lr[i]=e,e.names.forEach(function(n){Ss[n.toLowerCase()]=i}),this):(console.log(t),!0)}function gm(e){return e.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function dM(e){if(!e)return!1;var t=e.toLowerCase();if(typeof Ss[t]<"u"&&lr[Ss[t]]||(t=gm(t),t in Ss&&lr[Ss[t]]))return lr[Ss[t]]}function gM(){fM.forEach(dm)}const _M={start:gM,add:dm,get:dM};var _m={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const mM=_m.WGS84;function pM(e,t,i,n){var s=e*e,r=t*t,o=(s-r)/s,a=0;n?(e*=1-o*(OS+o*(FS+o*GS)),s=e*e,o=0):a=Math.sqrt(o);var l=(s-r)/r;return{es:o,e:a,ep2:l}}function yM(e,t,i,n,s){if(!e){var r=as(_m,n);r||(r=mM),e=r.a,t=r.b,i=r.rf}return i&&!t&&(t=(1-1/i)*e),(i===0||Math.abs(e-t)<Y)&&(s=!0,t=e),{a:e,b:t,rf:i,sphere:s}}var qa={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var vM in qa){var Qh=qa[vM];Qh.datumName&&(qa[Qh.datumName]=Qh)}function xM(e,t,i,n,s,r,o){var a={};return e===void 0||e==="none"?a.datum_type=Kc:a.datum_type=AS,t&&(a.datum_params=t.map(parseFloat),(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0)&&(a.datum_type=Gs),a.datum_params.length>3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=Ds,a.datum_params[3]*=Mo,a.datum_params[4]*=Mo,a.datum_params[5]*=Mo,a.datum_params[6]=a.datum_params[6]/1e6+1)),o&&(a.datum_type=Sr,a.grids=o),a.a=i,a.b=n,a.es=s,a.ep2=r,a}var df={};function EM(e,t,i){return t instanceof ArrayBuffer?SM(e,t,i):{ready:MM(e,t)}}function SM(e,t,i){var n=!0;i!==void 0&&i.includeErrorFields===!1&&(n=!1);var s=new DataView(t),r=TM(s),o=RM(s,r),a=IM(s,o,r,n),l={header:o,subgrids:a};return df[e]=l,l}async function MM(e,t){for(var i=[],n=await t.getImageCount(),s=n-1;s>=0;s--){var r=await t.getImage(s),o=await r.readRasters(),a=o,l=[r.getWidth(),r.getHeight()],h=r.getBoundingBox().map(ag),c=[r.fileDirectory.ModelPixelScale[0],r.fileDirectory.ModelPixelScale[1]].map(ag),u=h[0]+(l[0]-1)*c[0],f=h[3]-(l[1]-1)*c[1],d=a[0],g=a[1],_=[];for(let y=l[1]-1;y>=0;y--)for(let S=l[0]-1;S>=0;S--){var m=y*l[0]+S;_.push([-Kn(g[m]),Kn(d[m])])}i.push({del:c,lim:l,ll:[-u,f],cvs:_})}var p={header:{nSubgrids:n},subgrids:i};return df[e]=p,p}function wM(e){if(e===void 0)return null;var t=e.split(",");return t.map(CM)}function CM(e){if(e.length===0)return null;var t=e[0]==="@";return t&&(e=e.slice(1)),e==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:df[e]||null,isNull:!1}}function ag(e){return e*Math.PI/180}function Kn(e){return e/3600*Math.PI/180}function TM(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function RM(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:Hc(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function Hc(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function IM(e,t,i,n){for(var s=176,r=[],o=0;o<t.nSubgrids;o++){var a=bM(e,s,i),l=AM(e,s,a,i,n),h=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),c=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);r.push({ll:[Kn(a.lowerLongitude),Kn(a.lowerLatitude)],del:[Kn(a.longitudeInterval),Kn(a.latitudeInterval)],lim:[h,c],count:a.gridNodeCount,cvs:PM(l)});var u=16;n===!1&&(u=8),s+=176+a.gridNodeCount*u}return r}function PM(e){return e.map(function(t){return[Kn(t.longitudeShift),Kn(t.latitudeShift)]})}function bM(e,t,i){return{name:Hc(e,t+8,t+16).trim(),parent:Hc(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,i),upperLatitude:e.getFloat64(t+88,i),lowerLongitude:e.getFloat64(t+104,i),upperLongitude:e.getFloat64(t+120,i),latitudeInterval:e.getFloat64(t+136,i),longitudeInterval:e.getFloat64(t+152,i),gridNodeCount:e.getInt32(t+168,i)}}function AM(e,t,i,n,s){var r=t+176,o=16;s===!1&&(o=8);for(var a=[],l=0;l<i.gridNodeCount;l++){var h={latitudeShift:e.getFloat32(r+l*o,n),longitudeShift:e.getFloat32(r+l*o+4,n)};s!==!1&&(h.latitudeAccuracy=e.getFloat32(r+l*o+8,n),h.longitudeAccuracy=e.getFloat32(r+l*o+12,n)),a.push(h)}return a}function Li(e,t){if(!(this instanceof Li))return new Li(e);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,t=t||function(h){if(h)throw h};var i=nM(e);if(typeof i!="object"){t("Could not parse to valid json: "+e);return}var n=Li.projections.get(i.projName);if(!n){t("Could not get projection name from: "+e);return}if(i.datumCode&&i.datumCode!=="none"){var s=as(qa,i.datumCode);s&&(i.datum_params=i.datum_params||(s.towgs84?s.towgs84.split(","):null),i.ellps=s.ellipse,i.datumName=s.datumName?s.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var r=yM(i.a,i.b,i.rf,i.ellps,i.sphere),o=pM(r.a,r.b,r.rf,i.R_A),a=wM(i.nadgrids),l=i.datum||xM(i.datumCode,i.datum_params,r.a,r.b,o.es,o.ep2,a);rg(this,i),rg(this,n),this.a=r.a,this.b=r.b,this.rf=r.rf,this.sphere=r.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=l,"init"in this&&typeof this.init=="function"&&this.init(),t(null,this)}Li.projections=_M;Li.projections.start();function LM(e,t){return e.datum_type!==t.datum_type||e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===Gs?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===Ds?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0}function mm(e,t,i){var n=e.x,s=e.y,r=e.z?e.z:0,o,a,l,h;if(s<-W&&s>-1.001*W)s=-W;else if(s>W&&s<1.001*W)s=W;else{if(s<-W)return{x:-1/0,y:-1/0,z:e.z};if(s>W)return{x:1/0,y:1/0,z:e.z}}return n>Math.PI&&(n-=2*Math.PI),a=Math.sin(s),h=Math.cos(s),l=a*a,o=i/Math.sqrt(1-t*l),{x:(o+r)*h*Math.cos(n),y:(o+r)*h*Math.sin(n),z:(o*(1-t)+r)*a}}function pm(e,t,i,n){var s=1e-12,r=s*s,o=30,a,l,h,c,u,f,d,g,_,m,p,y,S,v=e.x,M=e.y,C=e.z?e.z:0,P,b,T;if(a=Math.sqrt(v*v+M*M),l=Math.sqrt(v*v+M*M+C*C),a/i<s){if(P=0,l/i<s)return b=W,T=-n,{x:e.x,y:e.y,z:e.z}}else P=Math.atan2(M,v);h=C/l,c=a/l,u=1/Math.sqrt(1-t*(2-t)*c*c),g=c*(1-t)*u,_=h*u,S=0;do S++,d=i/Math.sqrt(1-t*_*_),T=a*g+C*_-d*(1-t*_*_),f=t*d/(d+T),u=1/Math.sqrt(1-f*(2-f)*c*c),m=c*(1-f)*u,p=h*u,y=p*g-m*_,g=m,_=p;while(y*y>r&&S<o);return b=Math.atan(p/Math.abs(m)),{x:P,y:b,z:T}}function OM(e,t,i){if(t===Gs)return{x:e.x+i[0],y:e.y+i[1],z:e.z+i[2]};if(t===Ds){var n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],l=i[5],h=i[6];return{x:h*(e.x-l*e.y+a*e.z)+n,y:h*(l*e.x+e.y-o*e.z)+s,z:h*(-a*e.x+o*e.y+e.z)+r}}}function FM(e,t,i){if(t===Gs)return{x:e.x-i[0],y:e.y-i[1],z:e.z-i[2]};if(t===Ds){var n=i[0],s=i[1],r=i[2],o=i[3],a=i[4],l=i[5],h=i[6],c=(e.x-n)/h,u=(e.y-s)/h,f=(e.z-r)/h;return{x:c+l*u-a*f,y:-l*c+u+o*f,z:a*c-o*u+f}}}function ba(e){return e===Gs||e===Ds}function GM(e,t,i){if(LM(e,t)||e.datum_type===Kc||t.datum_type===Kc)return i;var n=e.a,s=e.es;if(e.datum_type===Sr){var r=lg(e,!1,i);if(r!==0)return;n=Qd,s=tg}var o=t.a,a=t.b,l=t.es;if(t.datum_type===Sr&&(o=Qd,a=LS,l=tg),s===l&&n===o&&!ba(e.datum_type)&&!ba(t.datum_type))return i;if(i=mm(i,s,n),ba(e.datum_type)&&(i=OM(i,e.datum_type,e.datum_params)),ba(t.datum_type)&&(i=FM(i,t.datum_type,t.datum_params)),i=pm(i,l,o,a),t.datum_type===Sr){var h=lg(t,!0,i);if(h!==0)return}return i}function lg(e,t,i){if(e.grids===null||e.grids.length===0)return console.log("Grid shift grids not found"),-1;var n={x:-i.x,y:i.y},s={x:Number.NaN,y:Number.NaN},r=[];t:for(var o=0;o<e.grids.length;o++){var a=e.grids[o];if(r.push(a.name),a.isNull){s=n;break}if(a.grid===null){if(a.mandatory)return console.log("Unable to find mandatory grid '"+a.name+"'"),-1;continue}for(var l=a.grid.subgrids,h=0,c=l.length;h<c;h++){var u=l[h],f=(Math.abs(u.del[1])+Math.abs(u.del[0]))/1e4,d=u.ll[0]-f,g=u.ll[1]-f,_=u.ll[0]+(u.lim[0]-1)*u.del[0]+f,m=u.ll[1]+(u.lim[1]-1)*u.del[1]+f;if(!(g>n.y||d>n.x||m<n.y||_<n.x)&&(s=DM(n,t,u),!isNaN(s.x)))break t}}return isNaN(s.x)?(console.log("Failed to find a grid shift table for location '"+-n.x*Vi+" "+n.y*Vi+" tried: '"+r+"'"),-1):(i.x=-s.x,i.y=s.y,0)}function DM(e,t,i){var n={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return n;var s={x:e.x,y:e.y};s.x-=i.ll[0],s.y-=i.ll[1],s.x=H(s.x-Math.PI)+Math.PI;var r=hg(s,i);if(t){if(isNaN(r.x))return n;r.x=s.x-r.x,r.y=s.y-r.y;var o=9,a=1e-12,l,h;do{if(h=hg(r,i),isNaN(h.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}l={x:s.x-(h.x+r.x),y:s.y-(h.y+r.y)},r.x+=l.x,r.y+=l.y}while(o--&&Math.abs(l.x)>a&&Math.abs(l.y)>a);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=H(r.x+i.ll[0]),n.y=r.y+i.ll[1]}else isNaN(r.x)||(n.x=e.x+r.x,n.y=e.y+r.y);return n}function hg(e,t){var i={x:e.x/t.del[0],y:e.y/t.del[1]},n={x:Math.floor(i.x),y:Math.floor(i.y)},s={x:i.x-1*n.x,y:i.y-1*n.y},r={x:Number.NaN,y:Number.NaN},o;if(n.x<0||n.x>=t.lim[0]||n.y<0||n.y>=t.lim[1])return r;o=n.y*t.lim[0]+n.x;var a={x:t.cvs[o][0],y:t.cvs[o][1]};o++;var l={x:t.cvs[o][0],y:t.cvs[o][1]};o+=t.lim[0];var h={x:t.cvs[o][0],y:t.cvs[o][1]};o--;var c={x:t.cvs[o][0],y:t.cvs[o][1]},u=s.x*s.y,f=s.x*(1-s.y),d=(1-s.x)*(1-s.y),g=(1-s.x)*s.y;return r.x=d*a.x+f*l.x+g*c.x+u*h.x,r.y=d*a.y+f*l.y+g*c.y+u*h.y,r}function cg(e,t,i){var n=i.x,s=i.y,r=i.z||0,o,a,l,h={};for(l=0;l<3;l++)if(!(t&&l===2&&i.z===void 0))switch(l===0?(o=n,"ew".indexOf(e.axis[l])!==-1?a="x":a="y"):l===1?(o=s,"ns".indexOf(e.axis[l])!==-1?a="y":a="x"):(o=r,a="z"),e.axis[l]){case"e":h[a]=o;break;case"w":h[a]=-o;break;case"n":h[a]=o;break;case"s":h[a]=-o;break;case"u":i[a]!==void 0&&(h.z=o);break;case"d":i[a]!==void 0&&(h.z=-o);break;default:return null}return h}function ym(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function NM(e){ug(e.x),ug(e.y)}function ug(e){if(typeof Number.isFinite=="function"){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if(typeof e!="number"||e!==e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function kM(e,t){return(e.datum.datum_type===Gs||e.datum.datum_type===Ds||e.datum.datum_type===Sr)&&t.datumCode!=="WGS84"||(t.datum.datum_type===Gs||t.datum.datum_type===Ds||t.datum.datum_type===Sr)&&e.datumCode!=="WGS84"}function Tl(e,t,i,n){var s;Array.isArray(i)?i=ym(i):i={x:i.x,y:i.y,z:i.z,m:i.m};var r=i.z!==void 0;if(NM(i),e.datum&&t.datum&&kM(e,t)&&(s=new Li("WGS84"),i=Tl(e,s,i,n),e=s),n&&e.axis!=="enu"&&(i=cg(e,!1,i)),e.projName==="longlat")i={x:i.x*xe,y:i.y*xe,z:i.z||0};else if(e.to_meter&&(i={x:i.x*e.to_meter,y:i.y*e.to_meter,z:i.z||0}),i=e.inverse(i),!i)return;if(e.from_greenwich&&(i.x+=e.from_greenwich),i=GM(e.datum,t.datum,i),!!i)return i=i,t.from_greenwich&&(i={x:i.x-t.from_greenwich,y:i.y,z:i.z||0}),t.projName==="longlat"?i={x:i.x*Vi,y:i.y*Vi,z:i.z||0}:(i=t.forward(i),t.to_meter&&(i={x:i.x/t.to_meter,y:i.y/t.to_meter,z:i.z||0})),n&&t.axis!=="enu"?cg(t,!0,i):(i&&!r&&delete i.z,i)}var fg=Li("WGS84");function tc(e,t,i,n){var s,r,o;return Array.isArray(i)?(s=Tl(e,t,i,n)||{x:NaN,y:NaN},i.length>2?typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof s.z=="number"?[s.x,s.y,s.z].concat(i.slice(3)):[s.x,s.y,i[2]].concat(i.slice(3)):[s.x,s.y].concat(i.slice(2)):[s.x,s.y]):(r=Tl(e,t,i,n),o=Object.keys(i),o.length===2||o.forEach(function(a){if(typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;r[a]=i[a]}),r)}function Aa(e){return e instanceof Li?e:typeof e=="object"&&"oProj"in e?e.oProj:Li(e)}function jM(e,t,i){var n,s,r=!1,o;return typeof t>"u"?(s=Aa(e),n=fg,r=!0):(typeof t.x<"u"||Array.isArray(t))&&(i=t,s=Aa(e),n=fg,r=!0),n||(n=Aa(e)),s||(s=Aa(t)),i?tc(n,s,i):(o={forward:function(a,l){return tc(n,s,a,l)},inverse:function(a,l){return tc(s,n,a,l)}},r&&(o.oProj=s),o)}var dg=6,vm="AJSAJS",xm="AFAFAF",hr=65,Xe=73,gi=79,co=86,uo=90;const BM={forward:Em,inverse:zM,toPoint:Sm};function Em(e,t){return t=t||5,VM(WM({lat:e[1],lon:e[0]}),t)}function zM(e){var t=gf(wm(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function Sm(e){var t=gf(wm(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function ec(e){return e*(Math.PI/180)}function gg(e){return 180*(e/Math.PI)}function WM(e){var t=e.lat,i=e.lon,n=6378137,s=.00669438,r=.9996,o,a,l,h,c,u,f,d=ec(t),g=ec(i),_,m;m=Math.floor((i+180)/6)+1,i===180&&(m=60),t>=56&&t<64&&i>=3&&i<12&&(m=32),t>=72&&t<84&&(i>=0&&i<9?m=31:i>=9&&i<21?m=33:i>=21&&i<33?m=35:i>=33&&i<42&&(m=37)),o=(m-1)*6-180+3,_=ec(o),a=s/(1-s),l=n/Math.sqrt(1-s*Math.sin(d)*Math.sin(d)),h=Math.tan(d)*Math.tan(d),c=a*Math.cos(d)*Math.cos(d),u=Math.cos(d)*(g-_),f=n*((1-s/4-3*s*s/64-5*s*s*s/256)*d-(3*s/8+3*s*s/32+45*s*s*s/1024)*Math.sin(2*d)+(15*s*s/256+45*s*s*s/1024)*Math.sin(4*d)-35*s*s*s/3072*Math.sin(6*d));var p=r*l*(u+(1-h+c)*u*u*u/6+(5-18*h+h*h+72*c-58*a)*u*u*u*u*u/120)+5e5,y=r*(f+l*Math.tan(d)*(u*u/2+(5-h+9*c+4*c*c)*u*u*u*u/24+(61-58*h+h*h+600*c-330*a)*u*u*u*u*u*u/720));return t<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(p),zoneNumber:m,zoneLetter:UM(t)}}function gf(e){var t=e.northing,i=e.easting,n=e.zoneLetter,s=e.zoneNumber;if(s<0||s>60)return null;var r=.9996,o=6378137,a=.00669438,l,h=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),c,u,f,d,g,_,m,p,y,S=i-5e5,v=t;n<"N"&&(v-=1e7),m=(s-1)*6-180+3,l=a/(1-a),_=v/r,p=_/(o*(1-a/4-3*a*a/64-5*a*a*a/256)),y=p+(3*h/2-27*h*h*h/32)*Math.sin(2*p)+(21*h*h/16-55*h*h*h*h/32)*Math.sin(4*p)+151*h*h*h/96*Math.sin(6*p),c=o/Math.sqrt(1-a*Math.sin(y)*Math.sin(y)),u=Math.tan(y)*Math.tan(y),f=l*Math.cos(y)*Math.cos(y),d=o*(1-a)/Math.pow(1-a*Math.sin(y)*Math.sin(y),1.5),g=S/(c*r);var M=y-c*Math.tan(y)/d*(g*g/2-(5+3*u+10*f-4*f*f-9*l)*g*g*g*g/24+(61+90*u+298*f+45*u*u-252*l-3*f*f)*g*g*g*g*g*g/720);M=gg(M);var C=(g-(1+2*u+f)*g*g*g/6+(5-2*f+28*u-3*f*f+8*l+24*u*u)*g*g*g*g*g/120)/Math.cos(y);C=m+gg(C);var P;if(e.accuracy){var b=gf({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});P={top:b.lat,right:b.lon,bottom:M,left:C}}else P={lat:M,lon:C};return P}function UM(e){var t="Z";return 84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C"),t}function VM(e,t){var i="00000"+e.easting,n="00000"+e.northing;return e.zoneNumber+e.zoneLetter+XM(e.easting,e.northing,e.zoneNumber)+i.substr(i.length-5,t)+n.substr(n.length-5,t)}function XM(e,t,i){var n=Mm(i),s=Math.floor(e/1e5),r=Math.floor(t/1e5)%20;return $M(s,r,n)}function Mm(e){var t=e%dg;return t===0&&(t=dg),t}function $M(e,t,i){var n=i-1,s=vm.charCodeAt(n),r=xm.charCodeAt(n),o=s+e-1,a=r+t,l=!1;o>uo&&(o=o-uo+hr-1,l=!0),(o===Xe||s<Xe&&o>Xe||(o>Xe||s<Xe)&&l)&&o++,(o===gi||s<gi&&o>gi||(o>gi||s<gi)&&l)&&(o++,o===Xe&&o++),o>uo&&(o=o-uo+hr-1),a>co?(a=a-co+hr-1,l=!0):l=!1,(a===Xe||r<Xe&&a>Xe||(a>Xe||r<Xe)&&l)&&a++,(a===gi||r<gi&&a>gi||(a>gi||r<gi)&&l)&&(a++,a===Xe&&a++),a>co&&(a=a-co+hr-1);var h=String.fromCharCode(o)+String.fromCharCode(a);return h}function wm(e){if(e&&e.length===0)throw"MGRSPoint coverting from nothing";for(var t=e.length,i=null,n="",s,r=0;!/[A-Z]/.test(s=e.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+e;n+=s,r++}var o=parseInt(n,10);if(r===0||r+3>t)throw"MGRSPoint bad conversion from: "+e;var a=e.charAt(r++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+e;i=e.substring(r,r+=2);for(var l=Mm(o),h=KM(i.charAt(0),l),c=YM(i.charAt(1),l);c<qM(a);)c+=2e6;var u=t-r;if(u%2!==0)throw`MGRSPoint has to have an even number
|
|
4
|
-
of digits after the zone letter and two 100km letters - front
|
|
5
|
-
half for easting meters, second half for
|
|
6
|
-
northing meters`+e;var f=u/2,d=0,g=0,_,m,p,y,S;return f>0&&(_=1e5/Math.pow(10,f),m=e.substring(r,r+f),d=parseFloat(m)*_,p=e.substring(r+f),g=parseFloat(p)*_),y=d+h,S=g+c,{easting:y,northing:S,zoneLetter:a,zoneNumber:o,accuracy:_}}function KM(e,t){for(var i=vm.charCodeAt(t-1),n=1e5,s=!1;i!==e.charCodeAt(0);){if(i++,i===Xe&&i++,i===gi&&i++,i>uo){if(s)throw"Bad character: "+e;i=hr,s=!0}n+=1e5}return n}function YM(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var i=xm.charCodeAt(t-1),n=0,s=!1;i!==e.charCodeAt(0);){if(i++,i===Xe&&i++,i===gi&&i++,i>co){if(s)throw"Bad character: "+e;i=hr,s=!0}n+=1e5}return n}function qM(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function Fr(e,t,i){if(!(this instanceof Fr))return new Fr(e,t,i);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e=="object")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e=="string"&&typeof t>"u"){var n=e.split(",");this.x=parseFloat(n[0]),this.y=parseFloat(n[1]),this.z=parseFloat(n[2])||0}else this.x=e,this.y=t,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Fr.fromMGRS=function(e){return new Fr(Sm(e))};Fr.prototype.toMGRS=function(e){return Em([this.x,this.y],e)};var HM=1,ZM=.25,_g=.046875,mg=.01953125,pg=.01068115234375,JM=.75,QM=.46875,t2=.013020833333333334,e2=.007120768229166667,i2=.3645833333333333,n2=.005696614583333333,s2=.3076171875;function _f(e){var t=[];t[0]=HM-e*(ZM+e*(_g+e*(mg+e*pg))),t[1]=e*(JM-e*(_g+e*(mg+e*pg)));var i=e*e;return t[2]=i*(QM-e*(t2+e*e2)),i*=e,t[3]=i*(i2-e*n2),t[4]=i*e*s2,t}function Wr(e,t,i,n){return i*=t,t*=t,n[0]*e-i*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var r2=20;function mf(e,t,i){for(var n=1/(1-t),s=e,r=r2;r;--r){var o=Math.sin(s),a=1-t*o*o;if(a=(Wr(s,o,Math.cos(s),i)-e)*(a*Math.sqrt(a))*n,s-=a,Math.abs(a)<Y)return s}return s}function o2(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=_f(this.es),this.ml0=Wr(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function a2(e){var t=e.x,i=e.y,n=H(t-this.long0),s,r,o,a=Math.sin(i),l=Math.cos(i);if(this.es){var c=l*n,u=Math.pow(c,2),f=this.ep2*Math.pow(l,2),d=Math.pow(f,2),g=Math.abs(l)>Y?Math.tan(i):0,_=Math.pow(g,2),m=Math.pow(_,2);s=1-this.es*Math.pow(a,2),c=c/Math.sqrt(s);var p=Wr(i,a,l,this.en);r=this.a*(this.k0*c*(1+u/6*(1-_+f+u/20*(5-18*_+m+14*f-58*_*f+u/42*(61+179*m-m*_-479*_)))))+this.x0,o=this.a*(this.k0*(p-this.ml0+a*n*c/2*(1+u/12*(5-_+9*f+4*d+u/30*(61+m-58*_+270*f-330*_*f+u/56*(1385+543*m-m*_-3111*_))))))+this.y0}else{var h=l*Math.sin(n);if(Math.abs(Math.abs(h)-1)<Y)return 93;if(r=.5*this.a*this.k0*Math.log((1+h)/(1-h))+this.x0,o=l*Math.cos(n)/Math.sqrt(1-Math.pow(h,2)),h=Math.abs(o),h>=1){if(h-1>Y)return 93;o=0}else o=Math.acos(o);i<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return e.x=r,e.y=o,e}function l2(e){var t,i,n,s,r=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,i=mf(t,this.es,this.en),Math.abs(i)<W){var u=Math.sin(i),f=Math.cos(i),d=Math.abs(f)>Y?Math.tan(i):0,g=this.ep2*Math.pow(f,2),_=Math.pow(g,2),m=Math.pow(d,2),p=Math.pow(m,2);t=1-this.es*Math.pow(u,2);var y=r*Math.sqrt(t)/this.k0,S=Math.pow(y,2);t=t*d,n=i-t*S/(1-this.es)*.5*(1-S/12*(5+3*m-9*g*m+g-4*_-S/30*(61+90*m-252*g*m+45*p+46*g-S/56*(1385+3633*m+4095*p+1574*p*m)))),s=H(this.long0+y*(1-S/6*(1+2*m+g-S/20*(5+28*m+24*p+8*g*m+6*g-S/42*(61+662*m+1320*p+720*p*m))))/f)}else n=W*ca(o),s=0;else{var a=Math.exp(r/this.k0),l=.5*(a-1/a),h=this.lat0+o/this.k0,c=Math.cos(h);t=Math.sqrt((1-Math.pow(c,2))/(1+Math.pow(l,2))),n=Math.asin(t),o<0&&(n=-n),l===0&&c===0?s=0:s=H(Math.atan2(l,c)+this.long0)}return e.x=s,e.y=n,e}var h2=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const Ha={init:o2,forward:a2,inverse:l2,names:h2};function Cm(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function Ze(e,t){e=Math.abs(e),t=Math.abs(t);var i=Math.max(e,t),n=Math.min(e,t)/(i||1);return i*Math.sqrt(1+Math.pow(n,2))}function c2(e){var t=1+e,i=t-1;return i===0?e:e*Math.log(t)/i}function u2(e){var t=Math.abs(e);return t=c2(t*(1+t/(Ze(1,t)+1))),e<0?-t:t}function pf(e,t){for(var i=2*Math.cos(2*t),n=e.length-1,s=e[n],r=0,o;--n>=0;)o=-r+i*s+e[n],r=s,s=o;return t+o*Math.sin(2*t)}function f2(e,t){for(var i=2*Math.cos(t),n=e.length-1,s=e[n],r=0,o;--n>=0;)o=-r+i*s+e[n],r=s,s=o;return Math.sin(t)*o}function d2(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function Tm(e,t,i){for(var n=Math.sin(t),s=Math.cos(t),r=Cm(i),o=d2(i),a=2*s*o,l=-2*n*r,h=e.length-1,c=e[h],u=0,f=0,d=0,g,_;--h>=0;)g=f,_=u,f=c,u=d,c=-g+a*f-l*u+e[h],d=-_+l*f+a*u;return a=n*o,l=s*r,[a*c-l*d,a*d+l*c]}function g2(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Ha.init.apply(this),this.forward=Ha.forward,this.inverse=Ha.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),i=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),i=i*t,this.cgb[1]=i*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=i*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),i=i*t,this.cgb[2]=i*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=i*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),i=i*t,this.cgb[3]=i*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=i*(1237/630+t*(-12/5+t*(-24832/14175))),i=i*t,this.cgb[4]=i*(4174/315+t*(-144838/6237)),this.cbg[4]=i*(-734/315+t*(109598/31185)),i=i*t,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=i*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=i*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),i=i*t,this.utg[2]=i*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=i*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),i=i*t,this.utg[3]=i*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=i*(49561/161280+t*(-179/168+t*(6601661/7257600))),i=i*t,this.utg[4]=i*(-4583/161280+t*(108847/3991680)),this.gtu[4]=i*(34729/80640+t*(-3418889/1995840)),i=i*t,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=i*(212378941/319334400);var n=pf(this.cbg,this.lat0);this.Zb=-this.Qn*(n+f2(this.gtu,2*n))}function _2(e){var t=H(e.x-this.long0),i=e.y;i=pf(this.cbg,i);var n=Math.sin(i),s=Math.cos(i),r=Math.sin(t),o=Math.cos(t);i=Math.atan2(n,o*s),t=Math.atan2(r*s,Ze(n,s*o)),t=u2(Math.tan(t));var a=Tm(this.gtu,2*i,2*t);i=i+a[0],t=t+a[1];var l,h;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,h=this.a*(this.Qn*i+this.Zb)+this.y0):(l=1/0,h=1/0),e.x=l,e.y=h,e}function m2(e){var t=(e.x-this.x0)*(1/this.a),i=(e.y-this.y0)*(1/this.a);i=(i-this.Zb)/this.Qn,t=t/this.Qn;var n,s;if(Math.abs(t)<=2.623395162778){var r=Tm(this.utg,2*i,2*t);i=i+r[0],t=t+r[1],t=Math.atan(Cm(t));var o=Math.sin(i),a=Math.cos(i),l=Math.sin(t),h=Math.cos(t);i=Math.atan2(o*h,Ze(l,h*a)),t=Math.atan2(l,h*a),n=H(t+this.long0),s=pf(this.cgb,i)}else n=1/0,s=1/0;return e.x=n,e.y=s,e}var p2=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const Za={init:g2,forward:_2,inverse:m2,names:p2};function y2(e,t){if(e===void 0){if(e=Math.floor((H(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var v2="etmerc";function x2(){var e=y2(this.zone,this.long0);if(e===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*xe,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Za.init.apply(this),this.forward=Za.forward,this.inverse=Za.inverse}var E2=["Universal Transverse Mercator System","utm"];const S2={init:x2,names:E2,dependsOn:v2};function yf(e,t){return Math.pow((1-e)/(1+e),t)}var M2=20;function w2(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+It)/(Math.pow(Math.tan(.5*this.lat0+It),this.C)*yf(this.e*e,this.ratexp))}function C2(e){var t=e.x,i=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+It),this.C)*yf(this.e*Math.sin(i),this.ratexp))-W,e.x=this.C*t,e}function T2(e){for(var t=1e-14,i=e.x/this.C,n=e.y,s=Math.pow(Math.tan(.5*n+It)/this.K,1/this.C),r=M2;r>0&&(n=2*Math.atan(s*yf(this.e*Math.sin(e.y),-.5*this.e))-W,!(Math.abs(n-e.y)<t));--r)e.y=n;return r?(e.x=i,e.y=n,e):null}const vf={init:w2,forward:C2,inverse:T2};function R2(){vf.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function I2(e){var t,i,n,s;return e.x=H(e.x-this.long0),vf.forward.apply(this,[e]),t=Math.sin(e.y),i=Math.cos(e.y),n=Math.cos(e.x),s=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*i*n),e.x=s*i*Math.sin(e.x),e.y=s*(this.cosc0*t-this.sinc0*i*n),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function P2(e){var t,i,n,s,r;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,r=Ze(e.x,e.y)){var o=2*Math.atan2(r,this.R2);t=Math.sin(o),i=Math.cos(o),s=Math.asin(i*this.sinc0+e.y*t*this.cosc0/r),n=Math.atan2(e.x*t,r*this.cosc0*i-e.y*this.sinc0*t)}else s=this.phic0,n=0;return e.x=n,e.y=s,vf.inverse.apply(this,[e]),e.x=H(e.x+this.long0),e}var b2=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const A2={init:R2,forward:I2,inverse:P2,names:b2};function xf(e,t,i){return t*=i,Math.tan(.5*(W+e))*Math.pow((1-t)/(1+t),.5*i)}function L2(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Y&&(this.k0=.5*(1+ca(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Y&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Y&&Math.abs(Math.cos(this.lat_ts))>Y&&(this.k0=.5*this.cons*Yi(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ai(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Yi(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(xf(this.lat0,this.sinlat0,this.e))-W,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function O2(e){var t=e.x,i=e.y,n=Math.sin(i),s=Math.cos(i),r,o,a,l,h,c,u=H(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=Y&&Math.abs(i+this.lat0)<=Y?(e.x=NaN,e.y=NaN,e):this.sphere?(r=2*this.k0/(1+this.sinlat0*n+this.coslat0*s*Math.cos(u)),e.x=this.a*r*s*Math.sin(u)+this.x0,e.y=this.a*r*(this.coslat0*n-this.sinlat0*s*Math.cos(u))+this.y0,e):(o=2*Math.atan(xf(i,n,this.e))-W,l=Math.cos(o),a=Math.sin(o),Math.abs(this.coslat0)<=Y?(h=Ai(this.e,i*this.con,this.con*n),c=2*this.a*this.k0*h/this.cons,e.x=this.x0+c*Math.sin(t-this.long0),e.y=this.y0-this.con*c*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<Y?(r=2*this.a*this.k0/(1+l*Math.cos(u)),e.y=r*a):(r=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*l*Math.cos(u))),e.y=r*(this.cosX0*a-this.sinX0*l*Math.cos(u))+this.y0),e.x=r*l*Math.sin(u)+this.x0,e))}function F2(e){e.x-=this.x0,e.y-=this.y0;var t,i,n,s,r,o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var a=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,i=this.lat0,o<=Y?(e.x=t,e.y=i,e):(i=Math.asin(Math.cos(a)*this.sinlat0+e.y*Math.sin(a)*this.coslat0/o),Math.abs(this.coslat0)<Y?this.lat0>0?t=H(this.long0+Math.atan2(e.x,-1*e.y)):t=H(this.long0+Math.atan2(e.x,e.y)):t=H(this.long0+Math.atan2(e.x*Math.sin(a),o*this.coslat0*Math.cos(a)-e.y*this.sinlat0*Math.sin(a))),e.x=t,e.y=i,e)}else if(Math.abs(this.coslat0)<=Y){if(o<=Y)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,n=o*this.cons/(2*this.a*this.k0),i=this.con*Zo(this.e,n),t=this.con*H(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else s=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=Y?r=this.X0:(r=Math.asin(Math.cos(s)*this.sinX0+e.y*Math.sin(s)*this.cosX0/o),t=H(this.long0+Math.atan2(e.x*Math.sin(s),o*this.cosX0*Math.cos(s)-e.y*this.sinX0*Math.sin(s)))),i=-1*Zo(this.e,Math.tan(.5*(W+r)));return e.x=t,e.y=i,e}var G2=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const D2={init:L2,forward:O2,inverse:F2,names:G2,ssfn_:xf};function N2(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,n=this.rf,s=1/n,r=2*s-Math.pow(s,2),o=this.e=Math.sqrt(r);this.R=this.k0*i*Math.sqrt(1-r)/(1-r*Math.pow(t,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+e/2)),h=Math.log((1+o*t)/(1-o*t));this.K=a-this.alpha*l+this.alpha*o/2*h}function k2(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),n=-this.alpha*(t+i)+this.K,s=2*(Math.atan(Math.exp(n))-Math.PI/4),r=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(r))),a=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(r));return e.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,e.x=this.R*o+this.x0,e}function j2(e){for(var t=e.x-this.x0,i=e.y-this.y0,n=t/this.R,s=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(s))),a=this.lambda0+o/this.alpha,l=0,h=r,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=a,e.y=h,e}var B2=["somerc"];const z2={init:N2,forward:k2,inverse:j2,names:B2};var nr=1e-7;function W2(e){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],i=typeof e.projName=="object"?Object.keys(e.projName)[0]:e.projName;return"no_uoff"in e||"no_off"in e||t.indexOf(i)!==-1||t.indexOf(gm(i))!==-1}function U2(){var e,t,i,n,s,r,o,a,l,h,c=0,u,f=0,d=0,g=0,_=0,m=0,p=0;this.no_off=W2(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),y&&(p=this.alpha),S&&(c=this.rectified_grid_angle),y||S)f=this.longc;else if(d=this.long1,_=this.lat1,g=this.long2,m=this.lat2,Math.abs(_-m)<=nr||(e=Math.abs(_))<=nr||Math.abs(e-W)<=nr||Math.abs(Math.abs(this.lat0)-W)<=nr||Math.abs(Math.abs(m)-W)<=nr)throw new Error;var v=1-this.es;t=Math.sqrt(v),Math.abs(this.lat0)>Y?(a=Math.sin(this.lat0),i=Math.cos(this.lat0),e=1-this.es*a*a,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/v),this.A=this.B*this.k0*t/e,n=this.B*t/(i*Math.sqrt(e)),s=n*n-1,s<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=n,this.E*=Math.pow(Ai(this.e,this.lat0,a),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=s=1),y||S?(y?(u=Math.asin(Math.sin(p)/n),S||(c=p)):(u=c,p=Math.asin(n*Math.sin(u))),this.lam0=f-Math.asin(.5*(s-1/s)*Math.tan(u))/this.B):(r=Math.pow(Ai(this.e,_,Math.sin(_)),this.B),o=Math.pow(Ai(this.e,m,Math.sin(m)),this.B),s=this.E/r,l=(o-r)/(o+r),h=this.E*this.E,h=(h-o*r)/(h+o*r),e=d-g,e<-Math.PI?g-=qo:e>Math.PI&&(g+=qo),this.lam0=H(.5*(d+g)-Math.atan(h*Math.tan(.5*this.B*(d-g))/l)/this.B),u=Math.atan(2*Math.sin(this.B*H(d-this.lam0))/(s-1/s)),c=p=Math.asin(n*Math.sin(u))),this.singam=Math.sin(u),this.cosgam=Math.cos(u),this.sinrot=Math.sin(c),this.cosrot=Math.cos(c),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(p))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*u,this.v_pole_n=this.ArB*Math.log(Math.tan(It-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(It+s))}function V2(e){var t={},i,n,s,r,o,a,l,h;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-W)>Y){if(o=this.E/Math.pow(Ai(this.e,e.y,Math.sin(e.y)),this.B),a=1/o,i=.5*(o-a),n=.5*(o+a),r=Math.sin(this.B*e.x),s=(i*this.singam-r*this.cosgam)/n,Math.abs(Math.abs(s)-1)<Y)throw new Error;h=.5*this.ArB*Math.log((1-s)/(1+s)),a=Math.cos(this.B*e.x),Math.abs(a)<nr?l=this.A*e.x:l=this.ArB*Math.atan2(i*this.cosgam+r*this.singam,a)}else h=e.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*e.y;return this.no_rot?(t.x=l,t.y=h):(l-=this.u_0,t.x=h*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-h*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function X2(e){var t,i,n,s,r,o,a,l={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(i=e.y,t=e.x):(i=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*i),s=.5*(n-1/n),r=.5*(n+1/n),o=Math.sin(this.BrA*t),a=(o*this.cosgam+s*this.singam)/r,Math.abs(Math.abs(a)-1)<Y)l.x=0,l.y=a<0?-W:W;else{if(l.y=this.E/Math.sqrt((1+a)/(1-a)),l.y=Zo(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(s*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l}var $2=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const K2={init:U2,forward:V2,inverse:X2,names:$2};function Y2(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Y)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),i=Math.cos(this.lat1),n=Yi(this.e,t,i),s=Ai(this.e,this.lat1,t),r=Math.sin(this.lat2),o=Math.cos(this.lat2),a=Yi(this.e,r,o),l=Ai(this.e,this.lat2,r),h=Math.abs(Math.abs(this.lat0)-W)<Y?0:Ai(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Y?this.ns=Math.log(n/a)/Math.log(s/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function q2(e){var t=e.x,i=e.y;Math.abs(2*Math.abs(i)-Math.PI)<=Y&&(i=ca(i)*(W-2*Y));var n=Math.abs(Math.abs(i)-W),s,r;if(n>Y)s=Ai(this.e,i,Math.sin(i)),r=this.a*this.f0*Math.pow(s,this.ns);else{if(n=i*this.ns,n<=0)return null;r=0}var o=this.ns*H(t-this.long0);return e.x=this.k0*(r*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-r*Math.cos(o))+this.y0,e}function H2(e){var t,i,n,s,r,o=(e.x-this.x0)/this.k0,a=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+a*a),i=1):(t=-Math.sqrt(o*o+a*a),i=-1);var l=0;if(t!==0&&(l=Math.atan2(i*o,i*a)),t!==0||this.ns>0){if(i=1/this.ns,n=Math.pow(t/(this.a*this.f0),i),s=Zo(this.e,n),s===-9999)return null}else s=-W;return r=H(l/this.ns+this.long0),e.x=r,e.y=s,e}var Z2=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const J2={init:Y2,forward:q2,inverse:H2,names:Z2};function Q2(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function tw(e){var t,i,n,s,r,o,a,l=e.x,h=e.y,c=H(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),n=-c*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),r=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(s)),o=this.n*r,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),e.y=a*Math.cos(o)/1,e.x=a*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e}function ew(e){var t,i,n,s,r,o,a,l,h=e.x;e.x=e.y,e.y=h,this.czech||(e.y*=-1,e.x*=-1),o=Math.sqrt(e.x*e.x+e.y*e.y),r=Math.atan2(e.y,e.x),s=r/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(s)),i=Math.asin(Math.cos(n)*Math.sin(s)/Math.cos(t)),e.x=this.long0-i/this.alfa,a=t,l=0;var c=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-e.y)<1e-10&&(l=1),a=e.y,c+=1;while(l===0&&c<15);return c>=15?null:e}var iw=["Krovak","krovak"];const nw={init:Q2,forward:tw,inverse:ew,names:iw};function We(e,t,i,n,s){return e*s-t*Math.sin(2*s)+i*Math.sin(4*s)-n*Math.sin(6*s)}function ua(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function fa(e){return .375*e*(1+.25*e*(1+.46875*e))}function da(e){return .05859375*e*e*(1+.75*e)}function ga(e){return e*e*e*(35/3072)}function Ef(e,t,i){var n=t*i;return e/Math.sqrt(1-n*n)}function us(e){return Math.abs(e)<W?e:e-ca(e)*Math.PI}function Rl(e,t,i,n,s){var r,o;r=e/t;for(var a=0;a<15;a++)if(o=(e-(t*r-i*Math.sin(2*r)+n*Math.sin(4*r)-s*Math.sin(6*r)))/(t-2*i*Math.cos(2*r)+4*n*Math.cos(4*r)-6*s*Math.cos(6*r)),r+=o,Math.abs(o)<=1e-10)return r;return NaN}function sw(){this.sphere||(this.e0=ua(this.es),this.e1=fa(this.es),this.e2=da(this.es),this.e3=ga(this.es),this.ml0=this.a*We(this.e0,this.e1,this.e2,this.e3,this.lat0))}function rw(e){var t,i,n=e.x,s=e.y;if(n=H(n-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(s)*Math.sin(n)),i=this.a*(Math.atan2(Math.tan(s),Math.cos(n))-this.lat0);else{var r=Math.sin(s),o=Math.cos(s),a=Ef(this.a,this.e,r),l=Math.tan(s)*Math.tan(s),h=n*Math.cos(s),c=h*h,u=this.es*o*o/(1-this.es),f=this.a*We(this.e0,this.e1,this.e2,this.e3,s);t=a*h*(1-c*l*(1/6-(8-l+8*u)*c/120)),i=f-this.ml0+a*r/o*c*(.5+(5-l+6*u)*c/24)}return e.x=t+this.x0,e.y=i+this.y0,e}function ow(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,i=e.y/this.a,n,s;if(this.sphere){var r=i+this.lat0;n=Math.asin(Math.sin(r)*Math.cos(t)),s=Math.atan2(Math.tan(t),Math.cos(r))}else{var o=this.ml0/this.a+i,a=Rl(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-W)<=Y)return e.x=this.long0,e.y=W,i<0&&(e.y*=-1),e;var l=Ef(this.a,this.e,Math.sin(a)),h=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(a),2),u=t*this.a/l,f=u*u;n=a-l*Math.tan(a)/h*u*u*(.5-(1+3*c)*u*u/24),s=u*(1-f*(c/3+(1+3*c)*c*f/15))/Math.cos(a)}return e.x=H(s+this.long0),e.y=us(n),e}var aw=["Cassini","Cassini_Soldner","cass"];const lw={init:sw,forward:rw,inverse:ow,names:aw};function is(e,t){var i;return e>1e-7?(i=e*t,(1-e*e)*(t/(1-i*i)-.5/e*Math.log((1-i)/(1+i)))):2*t}var Zc=1,Jc=2,Qc=3,Ja=4;function hw(){var e=Math.abs(this.lat0);if(Math.abs(e-W)<Y?this.mode=this.lat0<0?Zc:Jc:Math.abs(e)<Y?this.mode=Qc:this.mode=Ja,this.es>0){var t;switch(this.qp=is(this.e,1),this.mmf=.5/(1-this.es),this.apa=yw(this.es),this.mode){case Jc:this.dd=1;break;case Zc:this.dd=1;break;case Qc:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case Ja:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=is(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===Ja&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function cw(e){var t,i,n,s,r,o,a,l,h,c,u=e.x,f=e.y;if(u=H(u-this.long0),this.sphere){if(r=Math.sin(f),c=Math.cos(f),n=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i=this.mode===this.EQUIT?1+c*n:1+this.sinph0*r+this.cosph0*c*n,i<=Y)return null;i=Math.sqrt(2/i),t=i*c*Math.sin(u),i*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*c*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(f+this.lat0)<Y)return null;i=It-f*.5,i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)),t=i*Math.sin(u),i*=n}}else{switch(a=0,l=0,h=0,n=Math.cos(u),s=Math.sin(u),r=Math.sin(f),o=is(this.e,r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(a=o/this.qp,l=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:h=1+this.sinb1*a+this.cosb1*l*n;break;case this.EQUIT:h=1+l*n;break;case this.N_POLE:h=W+f,o=this.qp-o;break;case this.S_POLE:h=f-W,o=this.qp+o;break}if(Math.abs(h)<Y)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),this.mode===this.OBLIQ?i=this.ymf*h*(this.cosb1*a-this.sinb1*l*n):i=(h=Math.sqrt(2/(1+l*n)))*a*this.ymf,t=this.xmf*h*l*s;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(h=Math.sqrt(o))*s,i=n*(this.mode===this.S_POLE?h:-h)):t=i=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*i+this.y0,e}function uw(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,i=e.y/this.a,n,s,r,o,a,l,h;if(this.sphere){var c=0,u,f=0;if(u=Math.sqrt(t*t+i*i),s=u*.5,s>1)return null;switch(s=2*Math.asin(s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(f=Math.sin(s),c=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(u)<=Y?0:Math.asin(i*f/u),t*=f,i=c*u;break;case this.OBLIQ:s=Math.abs(u)<=Y?this.lat0:Math.asin(c*this.sinph0+i*f*this.cosph0/u),t*=f*this.cosph0,i=(c-Math.sin(s)*this.sinph0)*u;break;case this.N_POLE:i=-i,s=W-s;break;case this.S_POLE:s-=W;break}n=i===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,i)}else{if(h=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,i*=this.dd,l=Math.sqrt(t*t+i*i),l<Y)return e.x=this.long0,e.y=this.lat0,e;o=2*Math.asin(.5*l/this.rq),r=Math.cos(o),t*=o=Math.sin(o),this.mode===this.OBLIQ?(h=r*this.sinb1+i*o*this.cosb1/l,a=this.qp*h,i=l*this.cosb1*r-i*this.sinb1*o):(h=i*o/l,a=this.qp*h,i=l*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),a=t*t+i*i,!a)return e.x=this.long0,e.y=this.lat0,e;h=1-a/this.qp,this.mode===this.S_POLE&&(h=-h)}n=Math.atan2(t,i),s=vw(Math.asin(h),this.apa)}return e.x=H(this.long0+n),e.y=s,e}var fw=.3333333333333333,dw=.17222222222222222,gw=.10257936507936508,_w=.06388888888888888,mw=.0664021164021164,pw=.016415012942191543;function yw(e){var t,i=[];return i[0]=e*fw,t=e*e,i[0]+=t*dw,i[1]=t*_w,t*=e,i[0]+=t*gw,i[1]+=t*mw,i[2]=t*pw,i}function vw(e,t){var i=e+e;return e+t[0]*Math.sin(i)+t[1]*Math.sin(i+i)+t[2]*Math.sin(i+i+i)}var xw=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const Ew={init:hw,forward:cw,inverse:uw,names:xw,S_POLE:Zc,N_POLE:Jc,EQUIT:Qc,OBLIQ:Ja};function ls(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function Sw(){Math.abs(this.lat1+this.lat2)<Y||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Yi(this.e3,this.sin_po,this.cos_po),this.qs1=is(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Yi(this.e3,this.sin_po,this.cos_po),this.qs2=is(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=is(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>Y?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Mw(e){var t=e.x,i=e.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var n=is(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,r=this.ns0*H(t-this.long0),o=s*Math.sin(r)+this.x0,a=this.rh-s*Math.cos(r)+this.y0;return e.x=o,e.y=a,e}function ww(e){var t,i,n,s,r,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),n=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),n=-1),s=0,t!==0&&(s=Math.atan2(n*e.x,n*e.y)),n=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-n*n)/(2*this.ns0)):(i=(this.c-n*n)/this.ns0,o=this.phi1z(this.e3,i)),r=H(s/this.ns0+this.long0),e.x=r,e.y=o,e}function Cw(e,t){var i,n,s,r,o,a=ls(.5*t);if(e<Y)return a;for(var l=e*e,h=1;h<=25;h++)if(i=Math.sin(a),n=Math.cos(a),s=e*i,r=1-s*s,o=.5*r*r/n*(t/(1-l)-i/r+.5/e*Math.log((1-s)/(1+s))),a=a+o,Math.abs(o)<=1e-7)return a;return null}var Tw=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const Rw={init:Sw,forward:Mw,inverse:ww,names:Tw,phi1z:Cw};function Iw(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Pw(e){var t,i,n,s,r,o,a,l,h=e.x,c=e.y;return n=H(h-this.long0),t=Math.sin(c),i=Math.cos(c),s=Math.cos(n),o=this.sin_p14*t+this.cos_p14*i*s,r=1,o>0||Math.abs(o)<=Y?(a=this.x0+this.a*r*i*Math.sin(n)/o,l=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*i*s)/o):(a=this.x0+this.infinity_dist*i*Math.sin(n),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*s)),e.x=a,e.y=l,e}function bw(e){var t,i,n,s,r,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(s=Math.atan2(t,this.rc),i=Math.sin(s),n=Math.cos(s),o=ls(n*this.sin_p14+e.y*i*this.cos_p14/t),r=Math.atan2(e.x*i,t*this.cos_p14*n-e.y*this.sin_p14*i),r=H(this.long0+r)):(o=this.phic0,r=0),e.x=r,e.y=o,e}var Aw=["gnom"];const Lw={init:Iw,forward:Pw,inverse:bw,names:Aw};function Ow(e,t){var i=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-i)<1e-6)return t<0?-1*W:W;for(var n=Math.asin(.5*t),s,r,o,a,l=0;l<30;l++)if(r=Math.sin(n),o=Math.cos(n),a=e*r,s=Math.pow(1-a*a,2)/(2*o)*(t/(1-e*e)-r/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),n+=s,Math.abs(s)<=1e-10)return n;return NaN}function Fw(){this.sphere||(this.k0=Yi(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function Gw(e){var t=e.x,i=e.y,n,s,r=H(t-this.long0);if(this.sphere)n=this.x0+this.a*r*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var o=is(this.e,Math.sin(i));n=this.x0+this.a*this.k0*r,s=this.y0+this.a*o*.5/this.k0}return e.x=n,e.y=s,e}function Dw(e){e.x-=this.x0,e.y-=this.y0;var t,i;return this.sphere?(t=H(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=Ow(this.e,2*e.y*this.k0/this.a),t=H(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e}var Nw=["cea"];const kw={init:Fw,forward:Gw,inverse:Dw,names:Nw};function jw(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Bw(e){var t=e.x,i=e.y,n=H(t-this.long0),s=us(i-this.lat0);return e.x=this.x0+this.a*n*this.rc,e.y=this.y0+this.a*s,e}function zw(e){var t=e.x,i=e.y;return e.x=H(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=us(this.lat0+(i-this.y0)/this.a),e}var Ww=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const Uw={init:jw,forward:Bw,inverse:zw,names:Ww};var yg=20;function Vw(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ua(this.es),this.e1=fa(this.es),this.e2=da(this.es),this.e3=ga(this.es),this.ml0=this.a*We(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Xw(e){var t=e.x,i=e.y,n,s,r,o=H(t-this.long0);if(r=o*Math.sin(i),this.sphere)Math.abs(i)<=Y?(n=this.a*o,s=-1*this.a*this.lat0):(n=this.a*Math.sin(r)/Math.tan(i),s=this.a*(us(i-this.lat0)+(1-Math.cos(r))/Math.tan(i)));else if(Math.abs(i)<=Y)n=this.a*o,s=-1*this.ml0;else{var a=Ef(this.a,this.e,Math.sin(i))/Math.tan(i);n=a*Math.sin(r),s=this.a*We(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+a*(1-Math.cos(r))}return e.x=n+this.x0,e.y=s+this.y0,e}function $w(e){var t,i,n,s,r,o,a,l,h;if(n=e.x-this.x0,s=e.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=Y)t=H(n/this.a+this.long0),i=0;else{o=this.lat0+s/this.a,a=n*n/this.a/this.a+o*o,l=o;var c;for(r=yg;r;--r)if(c=Math.tan(l),h=-1*(o*(l*c+1)-l-.5*(l*l+a)*c)/((l-o)/c-1),l+=h,Math.abs(h)<=Y){i=l;break}t=H(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(s+this.ml0)<=Y)i=0,t=H(this.long0+n/this.a);else{o=(this.ml0+s)/this.a,a=n*n/this.a/this.a+o*o,l=o;var u,f,d,g,_;for(r=yg;r;--r)if(_=this.e*Math.sin(l),u=Math.sqrt(1-_*_)*Math.tan(l),f=this.a*We(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),g=f/this.a,h=(o*(u*g+1)-g-.5*u*(g*g+a))/(this.es*Math.sin(2*l)*(g*g+a-2*o*g)/(4*u)+(o-g)*(u*d-2/Math.sin(2*l))-d),l-=h,Math.abs(h)<=Y){i=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=H(this.long0+Math.asin(n*u/this.a)/Math.sin(i))}return e.x=t,e.y=i,e}var Kw=["Polyconic","American_Polyconic","poly"];const Yw={init:Vw,forward:Xw,inverse:$w,names:Kw};function qw(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Hw(e){var t,i=e.x,n=e.y,s=n-this.lat0,r=i-this.long0,o=s/Mo*1e-5,a=r,l=1,h=0;for(t=1;t<=10;t++)l=l*o,h=h+this.A[t]*l;var c=h,u=a,f=1,d=0,g,_,m=0,p=0;for(t=1;t<=6;t++)g=f*c-d*u,_=d*c+f*u,f=g,d=_,m=m+this.B_re[t]*f-this.B_im[t]*d,p=p+this.B_im[t]*f+this.B_re[t]*d;return e.x=p*this.a+this.x0,e.y=m*this.a+this.y0,e}function Zw(e){var t,i=e.x,n=e.y,s=i-this.x0,r=n-this.y0,o=r/this.a,a=s/this.a,l=1,h=0,c,u,f=0,d=0;for(t=1;t<=6;t++)c=l*o-h*a,u=h*o+l*a,l=c,h=u,f=f+this.C_re[t]*l-this.C_im[t]*h,d=d+this.C_im[t]*l+this.C_re[t]*h;for(var g=0;g<this.iterations;g++){var _=f,m=d,p,y,S=o,v=a;for(t=2;t<=6;t++)p=_*f-m*d,y=m*f+_*d,_=p,m=y,S=S+(t-1)*(this.B_re[t]*_-this.B_im[t]*m),v=v+(t-1)*(this.B_im[t]*_+this.B_re[t]*m);_=1,m=0;var M=this.B_re[1],C=this.B_im[1];for(t=2;t<=6;t++)p=_*f-m*d,y=m*f+_*d,_=p,m=y,M=M+t*(this.B_re[t]*_-this.B_im[t]*m),C=C+t*(this.B_im[t]*_+this.B_re[t]*m);var P=M*M+C*C;f=(S*M+v*C)/P,d=(v*M-S*C)/P}var b=f,T=d,k=1,U=0;for(t=1;t<=9;t++)k=k*b,U=U+this.D[t]*k;var A=this.lat0+U*Mo*1e5,L=this.long0+T;return e.x=L,e.y=A,e}var Jw=["New_Zealand_Map_Grid","nzmg"];const Qw={init:qw,forward:Hw,inverse:Zw,names:Jw};function tC(){}function eC(e){var t=e.x,i=e.y,n=H(t-this.long0),s=this.x0+this.a*n,r=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return e.x=s,e.y=r,e}function iC(e){e.x-=this.x0,e.y-=this.y0;var t=H(this.long0+e.x/this.a),i=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=i,e}var nC=["Miller_Cylindrical","mill"];const sC={init:tC,forward:eC,inverse:iC,names:nC};var rC=20;function oC(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=_f(this.es)}function aC(e){var t,i,n=e.x,s=e.y;if(n=H(n-this.long0),this.sphere){if(!this.m)s=this.n!==1?Math.asin(this.n*Math.sin(s)):s;else for(var r=this.n*Math.sin(s),o=rC;o;--o){var a=(this.m*s+Math.sin(s)-r)/(this.m+Math.cos(s));if(s-=a,Math.abs(a)<Y)break}t=this.a*this.C_x*n*(this.m+Math.cos(s)),i=this.a*this.C_y*s}else{var l=Math.sin(s),h=Math.cos(s);i=this.a*Wr(s,l,h,this.en),t=this.a*n*h/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=i,e}function lC(e){var t,i,n,s;return e.x-=this.x0,n=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(t))),this.m?t=ls((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=ls(Math.sin(t)/this.n)),n=H(n+this.long0),t=us(t)):(t=mf(e.y/this.a,this.es,this.en),s=Math.abs(t),s<W?(s=Math.sin(t),i=this.long0+e.x*Math.sqrt(1-this.es*s*s)/(this.a*Math.cos(t)),n=H(i)):s-Y<W&&(n=this.long0)),e.x=n,e.y=t,e}var hC=["Sinusoidal","sinu"];const cC={init:oC,forward:aC,inverse:lC,names:hC};function uC(){}function fC(e){for(var t=e.x,i=e.y,n=H(t-this.long0),s=i,r=Math.PI*Math.sin(i);;){var o=-(s+Math.sin(s)-r)/(1+Math.cos(s));if(s+=o,Math.abs(o)<Y)break}s/=2,Math.PI/2-Math.abs(i)<Y&&(n=0);var a=.900316316158*this.a*n*Math.cos(s)+this.x0,l=1.4142135623731*this.a*Math.sin(s)+this.y0;return e.x=a,e.y=l,e}function dC(e){var t,i;e.x-=this.x0,e.y-=this.y0,i=e.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),t=Math.asin(i);var n=H(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),i=(2*t+Math.sin(2*t))/Math.PI,Math.abs(i)>1&&(i=1);var s=Math.asin(i);return e.x=n,e.y=s,e}var gC=["Mollweide","moll"];const _C={init:uC,forward:fC,inverse:dC,names:gC};function mC(){Math.abs(this.lat1+this.lat2)<Y||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ua(this.es),this.e1=fa(this.es),this.e2=da(this.es),this.e3=ga(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=Yi(this.e,this.sin_phi,this.cos_phi),this.ml1=We(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Y?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Yi(this.e,this.sin_phi,this.cos_phi),this.ml2=We(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=We(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function pC(e){var t=e.x,i=e.y,n;if(this.sphere)n=this.a*(this.g-i);else{var s=We(this.e0,this.e1,this.e2,this.e3,i);n=this.a*(this.g-s)}var r=this.ns*H(t-this.long0),o=this.x0+n*Math.sin(r),a=this.y0+this.rh-n*Math.cos(r);return e.x=o,e.y=a,e}function yC(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,i,n,s;this.ns>=0?(i=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(i=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var r=0;if(i!==0&&(r=Math.atan2(t*e.x,t*e.y)),this.sphere)return s=H(this.long0+r/this.ns),n=us(this.g-i/this.a),e.x=s,e.y=n,e;var o=this.g-i/this.a;return n=Rl(o,this.e0,this.e1,this.e2,this.e3),s=H(this.long0+r/this.ns),e.x=s,e.y=n,e}var vC=["Equidistant_Conic","eqdc"];const xC={init:mC,forward:pC,inverse:yC,names:vC};function EC(){this.R=this.a}function SC(e){var t=e.x,i=e.y,n=H(t-this.long0),s,r;Math.abs(i)<=Y&&(s=this.x0+this.R*n,r=this.y0);var o=ls(2*Math.abs(i/Math.PI));(Math.abs(n)<=Y||Math.abs(Math.abs(i)-W)<=Y)&&(s=this.x0,i>=0?r=this.y0+Math.PI*this.R*Math.tan(.5*o):r=this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/n-n/Math.PI),l=a*a,h=Math.sin(o),c=Math.cos(o),u=c/(h+c-1),f=u*u,d=u*(2/h-1),g=d*d,_=Math.PI*this.R*(a*(u-g)+Math.sqrt(l*(u-g)*(u-g)-(g+l)*(f-g)))/(g+l);n<0&&(_=-_),s=this.x0+_;var m=l+u;return _=Math.PI*this.R*(d*m-a*Math.sqrt((g+l)*(l+1)-m*m))/(g+l),i>=0?r=this.y0+_:r=this.y0-_,e.x=s,e.y=r,e}function MC(e){var t,i,n,s,r,o,a,l,h,c,u,f,d;return e.x-=this.x0,e.y-=this.y0,u=Math.PI*this.R,n=e.x/u,s=e.y/u,r=n*n+s*s,o=-Math.abs(s)*(1+r),a=o-2*s*s+n*n,l=-2*o+1+2*s*s+r*r,d=s*s/l+(2*a*a*a/l/l/l-9*o*a/l/l)/27,h=(o-a*a/3/l)/l,c=2*Math.sqrt(-h/3),u=3*d/h/c,Math.abs(u)>1&&(u>=0?u=1:u=-1),f=Math.acos(u)/3,e.y>=0?i=(-c*Math.cos(f+Math.PI/3)-a/3/l)*Math.PI:i=-(-c*Math.cos(f+Math.PI/3)-a/3/l)*Math.PI,Math.abs(n)<Y?t=this.long0:t=H(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(n*n-s*s)+r*r))/2/n),e.x=t,e.y=i,e}var wC=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const CC={init:EC,forward:SC,inverse:MC,names:wC};function TC(e,t,i,n,s,r){const o=n-t,a=Math.atan((1-r)*Math.tan(e)),l=Math.atan((1-r)*Math.tan(i)),h=Math.sin(a),c=Math.cos(a),u=Math.sin(l),f=Math.cos(l);let d=o,g,_=100,m,p,y,S,v,M,C,P,b,T,k,U,A,L;do{if(m=Math.sin(d),p=Math.cos(d),y=Math.sqrt(f*m*(f*m)+(c*u-h*f*p)*(c*u-h*f*p)),y===0)return{azi1:0,s12:0};S=h*u+c*f*p,v=Math.atan2(y,S),M=c*f*m/y,C=1-M*M,P=C!==0?S-2*h*u/C:0,b=r/16*C*(4+r*(4-3*C)),g=d,d=o+(1-b)*r*M*(v+b*y*(P+b*S*(-1+2*P*P)))}while(Math.abs(d-g)>1e-12&&--_>0);return _===0?{azi1:NaN,s12:NaN}:(T=C*(s*s-s*(1-r)*(s*(1-r)))/(s*(1-r)*(s*(1-r))),k=1+T/16384*(4096+T*(-768+T*(320-175*T))),U=T/1024*(256+T*(-128+T*(74-47*T))),A=U*y*(P+U/4*(S*(-1+2*P*P)-U/6*P*(-3+4*y*y)*(-3+4*P*P))),L=s*(1-r)*k*(v-A),{azi1:Math.atan2(f*m,c*u-h*f*p),s12:L})}function RC(e,t,i,n,s,r){const o=Math.atan((1-r)*Math.tan(e)),a=Math.sin(o),l=Math.cos(o),h=Math.sin(i),c=Math.cos(i),u=Math.atan2(a,l*c),f=l*h,d=1-f*f,g=d*(s*s-s*(1-r)*(s*(1-r)))/(s*(1-r)*(s*(1-r))),_=1+g/16384*(4096+g*(-768+g*(320-175*g))),m=g/1024*(256+g*(-128+g*(74-47*g)));let p=n/(s*(1-r)*_),y,S=100,v,M,C,P;do v=Math.cos(2*u+p),M=Math.sin(p),C=Math.cos(p),P=m*M*(v+m/4*(C*(-1+2*v*v)-m/6*v*(-3+4*M*M)*(-3+4*v*v))),y=p,p=n/(s*(1-r)*_)+P;while(Math.abs(p-y)>1e-12&&--S>0);if(S===0)return{lat2:NaN,lon2:NaN};const b=a*M-l*C*c,T=Math.atan2(a*C+l*M*c,(1-r)*Math.sqrt(f*f+b*b)),k=Math.atan2(M*h,l*C-a*M*c),U=r/16*d*(4+r*(4-3*d)),A=k-(1-U)*r*f*(p+U*M*(v+U*C*(-1+2*v*v))),L=t+A;return{lat2:T,lon2:L}}function IC(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function PC(e){var t=e.x,i=e.y,n=Math.sin(e.y),s=Math.cos(e.y),r=H(t-this.long0),o,a,l,h,c,u,f,d,g,_,m;return this.sphere?Math.abs(this.sin_p12-1)<=Y?(e.x=this.x0+this.a*(W-i)*Math.sin(r),e.y=this.y0-this.a*(W-i)*Math.cos(r),e):Math.abs(this.sin_p12+1)<=Y?(e.x=this.x0+this.a*(W+i)*Math.sin(r),e.y=this.y0+this.a*(W+i)*Math.cos(r),e):(g=this.sin_p12*n+this.cos_p12*s*Math.cos(r),f=Math.acos(g),d=f?f/Math.sin(f):1,e.x=this.x0+this.a*d*s*Math.sin(r),e.y=this.y0+this.a*d*(this.cos_p12*n-this.sin_p12*s*Math.cos(r)),e):(o=ua(this.es),a=fa(this.es),l=da(this.es),h=ga(this.es),Math.abs(this.sin_p12-1)<=Y?(c=this.a*We(o,a,l,h,W),u=this.a*We(o,a,l,h,i),e.x=this.x0+(c-u)*Math.sin(r),e.y=this.y0-(c-u)*Math.cos(r),e):Math.abs(this.sin_p12+1)<=Y?(c=this.a*We(o,a,l,h,W),u=this.a*We(o,a,l,h,i),e.x=this.x0+(c+u)*Math.sin(r),e.y=this.y0+(c+u)*Math.cos(r),e):Math.abs(t)<Y&&Math.abs(i-this.lat0)<Y?(e.x=e.y=0,e):(_=TC(this.lat0,this.long0,i,t,this.a,this.f),m=_.azi1,e.x=_.s12*Math.sin(m),e.y=_.s12*Math.cos(m),e))}function bC(e){e.x-=this.x0,e.y-=this.y0;var t,i,n,s,r,o,a,l,h,c,u,f,d,g,_,m;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*W*this.a?void 0:(i=t/this.a,n=Math.sin(i),s=Math.cos(i),r=this.long0,Math.abs(t)<=Y?o=this.lat0:(o=ls(s*this.sin_p12+e.y*n*this.cos_p12/t),a=Math.abs(this.lat0)-W,Math.abs(a)<=Y?this.lat0>=0?r=H(this.long0+Math.atan2(e.x,-e.y)):r=H(this.long0-Math.atan2(-e.x,e.y)):r=H(this.long0+Math.atan2(e.x*n,t*this.cos_p12*s-e.y*this.sin_p12*n))),e.x=r,e.y=o,e)):(l=ua(this.es),h=fa(this.es),c=da(this.es),u=ga(this.es),Math.abs(this.sin_p12-1)<=Y?(f=this.a*We(l,h,c,u,W),t=Math.sqrt(e.x*e.x+e.y*e.y),d=f-t,o=Rl(d/this.a,l,h,c,u),r=H(this.long0+Math.atan2(e.x,-1*e.y)),e.x=r,e.y=o,e):Math.abs(this.sin_p12+1)<=Y?(f=this.a*We(l,h,c,u,W),t=Math.sqrt(e.x*e.x+e.y*e.y),d=t-f,o=Rl(d/this.a,l,h,c,u),r=H(this.long0+Math.atan2(e.x,e.y)),e.x=r,e.y=o,e):(g=Math.atan2(e.x,e.y),_=Math.sqrt(e.x*e.x+e.y*e.y),m=RC(this.lat0,this.long0,g,_,this.a,this.f),e.x=m.lon2,e.y=m.lat2,e))}var AC=["Azimuthal_Equidistant","aeqd"];const LC={init:IC,forward:PC,inverse:bC,names:AC};function OC(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function FC(e){var t,i,n,s,r,o,a,l,h=e.x,c=e.y;return n=H(h-this.long0),t=Math.sin(c),i=Math.cos(c),s=Math.cos(n),o=this.sin_p14*t+this.cos_p14*i*s,r=1,(o>0||Math.abs(o)<=Y)&&(a=this.a*r*i*Math.sin(n),l=this.y0+this.a*r*(this.cos_p14*t-this.sin_p14*i*s)),e.x=a,e.y=l,e}function GC(e){var t,i,n,s,r,o,a;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=ls(t/this.a),n=Math.sin(i),s=Math.cos(i),o=this.long0,Math.abs(t)<=Y?(a=this.lat0,e.x=o,e.y=a,e):(a=ls(s*this.sin_p14+e.y*n*this.cos_p14/t),r=Math.abs(this.lat0)-W,Math.abs(r)<=Y?(this.lat0>=0?o=H(this.long0+Math.atan2(e.x,-e.y)):o=H(this.long0-Math.atan2(-e.x,e.y)),e.x=o,e.y=a,e):(o=H(this.long0+Math.atan2(e.x*n,t*this.cos_p14*s-e.y*this.sin_p14*n)),e.x=o,e.y=a,e))}var DC=["ortho"];const NC={init:OC,forward:FC,inverse:GC,names:DC};var qt={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Pt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function kC(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=W-It/2?this.face=qt.TOP:this.lat0<=-(W-It/2)?this.face=qt.BOTTOM:Math.abs(this.long0)<=It?this.face=qt.FRONT:Math.abs(this.long0)<=W+It?this.face=this.long0>0?qt.RIGHT:qt.LEFT:this.face=qt.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function jC(e){var t={x:0,y:0},i,n,s,r,o,a,l={value:0};if(e.x-=this.long0,this.es!==0?i=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):i=e.y,n=e.x,this.face===qt.TOP)r=W-i,n>=It&&n<=W+It?(l.value=Pt.AREA_0,s=n-W):n>W+It||n<=-(W+It)?(l.value=Pt.AREA_1,s=n>0?n-ee:n+ee):n>-(W+It)&&n<=-It?(l.value=Pt.AREA_2,s=n+W):(l.value=Pt.AREA_3,s=n);else if(this.face===qt.BOTTOM)r=W+i,n>=It&&n<=W+It?(l.value=Pt.AREA_0,s=-n+W):n<It&&n>=-It?(l.value=Pt.AREA_1,s=-n):n<-It&&n>=-(W+It)?(l.value=Pt.AREA_2,s=-n-W):(l.value=Pt.AREA_3,s=n>0?-n+ee:-n-ee);else{var h,c,u,f,d,g,_;this.face===qt.RIGHT?n=Mr(n,+W):this.face===qt.BACK?n=Mr(n,+ee):this.face===qt.LEFT&&(n=Mr(n,-W)),f=Math.sin(i),d=Math.cos(i),g=Math.sin(n),_=Math.cos(n),h=d*_,c=d*g,u=f,this.face===qt.FRONT?(r=Math.acos(h),s=La(r,u,c,l)):this.face===qt.RIGHT?(r=Math.acos(c),s=La(r,u,-h,l)):this.face===qt.BACK?(r=Math.acos(-h),s=La(r,u,-c,l)):this.face===qt.LEFT?(r=Math.acos(-c),s=La(r,u,h,l)):(r=s=0,l.value=Pt.AREA_0)}return a=Math.atan(12/ee*(s+Math.acos(Math.sin(s)*Math.cos(It))-W)),o=Math.sqrt((1-Math.cos(r))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(s))))),l.value===Pt.AREA_1?a+=W:l.value===Pt.AREA_2?a+=ee:l.value===Pt.AREA_3&&(a+=1.5*ee),t.x=o*Math.cos(a),t.y=o*Math.sin(a),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function BC(e){var t={lam:0,phi:0},i,n,s,r,o,a,l,h,c,u={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,n=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),i=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?u.value=Pt.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(u.value=Pt.AREA_1,i-=W):e.x<0&&-e.x>=Math.abs(e.y)?(u.value=Pt.AREA_2,i=i<0?i+ee:i-ee):(u.value=Pt.AREA_3,i+=W),c=ee/12*Math.tan(i),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),a=Math.atan(o),s=Math.cos(i),r=Math.tan(n),l=1-s*s*r*r*(1-Math.cos(Math.atan(1/Math.cos(a)))),l<-1?l=-1:l>1&&(l=1),this.face===qt.TOP)h=Math.acos(l),t.phi=W-h,u.value===Pt.AREA_0?t.lam=a+W:u.value===Pt.AREA_1?t.lam=a<0?a+ee:a-ee:u.value===Pt.AREA_2?t.lam=a-W:t.lam=a;else if(this.face===qt.BOTTOM)h=Math.acos(l),t.phi=h-W,u.value===Pt.AREA_0?t.lam=-a+W:u.value===Pt.AREA_1?t.lam=-a:u.value===Pt.AREA_2?t.lam=-a-W:t.lam=a<0?-a-ee:-a+ee;else{var f,d,g;f=l,c=f*f,c>=1?g=0:g=Math.sqrt(1-c)*Math.sin(a),c+=g*g,c>=1?d=0:d=Math.sqrt(1-c),u.value===Pt.AREA_1?(c=d,d=-g,g=c):u.value===Pt.AREA_2?(d=-d,g=-g):u.value===Pt.AREA_3&&(c=d,d=g,g=-c),this.face===qt.RIGHT?(c=f,f=-d,d=c):this.face===qt.BACK?(f=-f,d=-d):this.face===qt.LEFT&&(c=f,f=d,d=-c),t.phi=Math.acos(-g)-W,t.lam=Math.atan2(d,f),this.face===qt.RIGHT?t.lam=Mr(t.lam,-W):this.face===qt.BACK?t.lam=Mr(t.lam,-ee):this.face===qt.LEFT&&(t.lam=Mr(t.lam,+W))}if(this.es!==0){var _,m,p;_=t.phi<0?1:0,m=Math.tan(t.phi),p=this.b/Math.sqrt(m*m+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),_&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function La(e,t,i,n){var s;return e<Y?(n.value=Pt.AREA_0,s=0):(s=Math.atan2(t,i),Math.abs(s)<=It?n.value=Pt.AREA_0:s>It&&s<=W+It?(n.value=Pt.AREA_1,s-=W):s>W+It||s<=-(W+It)?(n.value=Pt.AREA_2,s=s>=0?s-ee:s+ee):(n.value=Pt.AREA_3,s+=W)),s}function Mr(e,t){var i=e+t;return i<-ee?i+=qo:i>+ee&&(i-=qo),i}var zC=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const WC={init:kC,forward:jC,inverse:BC,names:zC};var tu=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],fo=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Rm=.8487,Im=1.3523,Pm=Vi/5,UC=1/Pm,cr=18,Il=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},VC=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function XC(e,t,i,n){for(var s=t;n;--n){var r=e(s);if(s-=r,Math.abs(r)<i)break}return s}function $C(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function KC(e){var t=H(e.x-this.long0),i=Math.abs(e.y),n=Math.floor(i*Pm);n<0?n=0:n>=cr&&(n=cr-1),i=Vi*(i-UC*n);var s={x:Il(tu[n],i)*t,y:Il(fo[n],i)};return e.y<0&&(s.y=-s.y),s.x=s.x*this.a*Rm+this.x0,s.y=s.y*this.a*Im+this.y0,s}function YC(e){var t={x:(e.x-this.x0)/(this.a*Rm),y:Math.abs(e.y-this.y0)/(this.a*Im)};if(t.y>=1)t.x/=tu[cr][0],t.y=e.y<0?-W:W;else{var i=Math.floor(t.y*cr);for(i<0?i=0:i>=cr&&(i=cr-1);;)if(fo[i][0]>t.y)--i;else if(fo[i+1][0]<=t.y)++i;else break;var n=fo[i],s=5*(t.y-n[0])/(fo[i+1][0]-n[0]);s=XC(function(r){return(Il(n,r)-t.y)/VC(n,r)},s,Y,100),t.x/=Il(tu[i],s),t.y=(5*i+s)*xe,e.y<0&&(t.y=-t.y)}return t.x=H(t.x+this.long0),t}var qC=["Robinson","robin"];const HC={init:$C,forward:KC,inverse:YC,names:qC};function ZC(){this.name="geocent"}function JC(e){var t=mm(e,this.es,this.a);return t}function QC(e){var t=pm(e,this.es,this.a,this.b);return t}var t4=["Geocentric","geocentric","geocent","Geocent"];const e4={init:ZC,forward:JC,inverse:QC,names:t4};var Ae={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},io={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function i4(){if(Object.keys(io).forEach((function(i){if(typeof this[i]>"u")this[i]=io[i].def;else{if(io[i].num&&isNaN(this[i]))throw new Error("Invalid parameter value, must be numeric "+i+" = "+this[i]);io[i].num&&(this[i]=parseFloat(this[i]))}io[i].degrees&&(this[i]=this[i]*xe)}).bind(this)),Math.abs(Math.abs(this.lat0)-W)<Y?this.mode=this.lat0<0?Ae.S_POLE:Ae.N_POLE:Math.abs(this.lat0)<Y?this.mode=Ae.EQUIT:(this.mode=Ae.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function n4(e){e.x-=this.long0;var t=Math.sin(e.y),i=Math.cos(e.y),n=Math.cos(e.x),s,r;switch(this.mode){case Ae.OBLIQ:r=this.sinph0*t+this.cosph0*i*n;break;case Ae.EQUIT:r=i*n;break;case Ae.S_POLE:r=-t;break;case Ae.N_POLE:r=t;break}switch(r=this.pn1/(this.p-r),s=r*i*Math.sin(e.x),this.mode){case Ae.OBLIQ:r*=this.cosph0*t-this.sinph0*i*n;break;case Ae.EQUIT:r*=t;break;case Ae.N_POLE:r*=-(i*n);break;case Ae.S_POLE:r*=i*n;break}var o,a;return o=r*this.cg+s*this.sg,a=1/(o*this.sw*this.h1+this.cw),s=(s*this.cg-r*this.sg)*this.cw*a,r=o*a,e.x=s*this.a,e.y=r*this.a,e}function s4(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},i,n,s;s=1/(this.pn1-e.y*this.sw),i=this.pn1*e.x*s,n=this.pn1*e.y*this.cw*s,e.x=i*this.cg+n*this.sg,e.y=n*this.cg-i*this.sg;var r=Ze(e.x,e.y);if(Math.abs(r)<Y)t.x=0,t.y=e.y;else{var o,a;switch(a=1-r*r*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/r+r/this.pn1),o=Math.sqrt(1-a*a),this.mode){case Ae.OBLIQ:t.y=Math.asin(o*this.sinph0+e.y*a*this.cosph0/r),e.y=(o-this.sinph0*Math.sin(t.y))*r,e.x*=a*this.cosph0;break;case Ae.EQUIT:t.y=Math.asin(e.y*a/r),e.y=o*r,e.x*=a;break;case Ae.N_POLE:t.y=Math.asin(o),e.y=-e.y;break;case Ae.S_POLE:t.y=-Math.asin(o);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var r4=["Tilted_Perspective","tpers"];const o4={init:i4,forward:n4,inverse:s4,names:r4};function a4(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function l4(e){var t=e.x,i=e.y,n,s,r,o;if(t=t-this.long0,this.shape==="ellipse"){i=Math.atan(this.radius_p2*Math.tan(i));var a=this.radius_p/Ze(this.radius_p*Math.cos(i),Math.sin(i));if(s=a*Math.cos(t)*Math.cos(i),r=a*Math.sin(t)*Math.cos(i),o=a*Math.sin(i),(this.radius_g-s)*s-r*r-o*o*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=this.radius_g-s,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/Ze(o,n)),e.y=this.radius_g_1*Math.atan(o/n)):(e.x=this.radius_g_1*Math.atan(r/n),e.y=this.radius_g_1*Math.atan(o/Ze(r,n)))}else this.shape==="sphere"&&(n=Math.cos(i),s=Math.cos(t)*n,r=Math.sin(t)*n,o=Math.sin(i),n=this.radius_g-s,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/Ze(o,n)),e.y=this.radius_g_1*Math.atan(o/n)):(e.x=this.radius_g_1*Math.atan(r/n),e.y=this.radius_g_1*Math.atan(o/Ze(r,n))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function h4(e){var t=-1,i=0,n=0,s,r,o,a;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(e.y/this.radius_g_1),i=Math.tan(e.x/this.radius_g_1)*Ze(1,n)):(i=Math.tan(e.x/this.radius_g_1),n=Math.tan(e.y/this.radius_g_1)*Ze(1,i));var l=n/this.radius_p;if(s=i*i+l*l+t*t,r=2*this.radius_g*t,o=r*r-4*s*this.C,o<0)return e.x=Number.NaN,e.y=Number.NaN,e;a=(-r-Math.sqrt(o))/(2*s),t=this.radius_g+a*t,i*=a,n*=a,e.x=Math.atan2(i,t),e.y=Math.atan(n*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(e.y/this.radius_g_1),i=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+n*n)):(i=Math.tan(e.x/this.radius_g_1),n=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+i*i)),s=i*i+n*n+t*t,r=2*this.radius_g*t,o=r*r-4*s*this.C,o<0)return e.x=Number.NaN,e.y=Number.NaN,e;a=(-r-Math.sqrt(o))/(2*s),t=this.radius_g+a*t,i*=a,n*=a,e.x=Math.atan2(i,t),e.y=Math.atan(n*Math.cos(e.x)/t)}return e.x=e.x+this.long0,e}var c4=["Geostationary Satellite View","Geostationary_Satellite","geos"];const u4={init:a4,forward:l4,inverse:h4,names:c4};var wo=1.340264,Co=-.081106,To=893e-6,Ro=.003796,Pl=Math.sqrt(3)/2;function f4(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function d4(e){var t=H(e.x-this.long0),i=e.y,n=Math.asin(Pl*Math.sin(i)),s=n*n,r=s*s*s;return e.x=t*Math.cos(n)/(Pl*(wo+3*Co*s+r*(7*To+9*Ro*s))),e.y=n*(wo+Co*s+r*(To+Ro*s)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function g4(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t=1e-9,i=12,n=e.y,s,r,o,a,l,h;for(h=0;h<i&&(s=n*n,r=s*s*s,o=n*(wo+Co*s+r*(To+Ro*s))-e.y,a=wo+3*Co*s+r*(7*To+9*Ro*s),n-=l=o/a,!(Math.abs(l)<t));++h);return s=n*n,r=s*s*s,e.x=Pl*e.x*(wo+3*Co*s+r*(7*To+9*Ro*s))/Math.cos(n),e.y=Math.asin(Math.sin(n)/Pl),e.x=H(e.x+this.long0),e}var _4=["eqearth","Equal Earth","Equal_Earth"];const m4={init:f4,forward:d4,inverse:g4,names:_4};var Jo=1e-10;function p4(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<Jo)throw new Error;this.es?(this.en=_f(this.es),this.m1=Wr(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=v4,this.forward=y4):(Math.abs(this.phi1)+Jo>=W?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=E4,this.forward=x4)}function y4(e){var t=H(e.x-(this.long0||0)),i=e.y,n,s,r;return n=this.am1+this.m1-Wr(i,s=Math.sin(i),r=Math.cos(i),this.en),s=r*t/(n*Math.sqrt(1-this.es*s*s)),e.x=n*Math.sin(s),e.y=this.am1-n*Math.cos(s),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function v4(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,i,n,s;if(i=Ze(e.x,e.y=this.am1-e.y),s=mf(this.am1+this.m1-i,this.es,this.en),(t=Math.abs(s))<W)t=Math.sin(s),n=i*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*t*t)/Math.cos(s);else if(Math.abs(t-W)<=Jo)n=0;else throw new Error;return e.x=H(n+(this.long0||0)),e.y=us(s),e}function x4(e){var t=H(e.x-(this.long0||0)),i=e.y,n,s;return s=this.cphi1+this.phi1-i,Math.abs(s)>Jo?(e.x=s*Math.sin(n=t*Math.cos(i)/s),e.y=this.cphi1-s*Math.cos(n)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function E4(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,i,n=Ze(e.x,e.y=this.cphi1-e.y);if(i=this.cphi1+this.phi1-n,Math.abs(i)>W)throw new Error;return Math.abs(Math.abs(i)-W)<=Jo?t=0:t=n*Math.atan2(e.x,e.y)/Math.cos(i),e.x=H(t+(this.long0||0)),e.y=us(i),e}var S4=["bonne","Bonne (Werner lat_1=90)"];const M4={init:p4,names:S4};function w4(e){e.Proj.projections.add(Ha),e.Proj.projections.add(Za),e.Proj.projections.add(S2),e.Proj.projections.add(A2),e.Proj.projections.add(D2),e.Proj.projections.add(z2),e.Proj.projections.add(K2),e.Proj.projections.add(J2),e.Proj.projections.add(nw),e.Proj.projections.add(lw),e.Proj.projections.add(Ew),e.Proj.projections.add(Rw),e.Proj.projections.add(Lw),e.Proj.projections.add(kw),e.Proj.projections.add(Uw),e.Proj.projections.add(Yw),e.Proj.projections.add(Qw),e.Proj.projections.add(sC),e.Proj.projections.add(cC),e.Proj.projections.add(_C),e.Proj.projections.add(xC),e.Proj.projections.add(CC),e.Proj.projections.add(LC),e.Proj.projections.add(NC),e.Proj.projections.add(WC),e.Proj.projections.add(HC),e.Proj.projections.add(e4),e.Proj.projections.add(o4),e.Proj.projections.add(u4),e.Proj.projections.add(m4),e.Proj.projections.add(M4)}const eu=Object.assign(jM,{defaultDatum:"WGS84",Proj:Li,WGS84:new Li("WGS84"),Point:Fr,toPoint:ym,defs:ke,nadgrid:EM,transform:Tl,mgrs:BM,version:"__VERSION__"});w4(eu);const C4=_e({__name:"OlProjectionRegister",props:{projectionName:{},projectionDef:{},projectionExtent:{}},setup(e,{expose:t}){const i=e,{projectionName:n,projectionDef:s,projectionExtent:r}=Ul(i);eu.defs(n.value,s.value),PS(eu);const o=new As({code:n.value,extent:r.value});return t({projection:o}),(a,l)=>re("",!0)}});function bm(e){if(e)return typeof e=="string"||e instanceof As?e:new As(e)}const T4=_e({inheritAttrs:!1,__name:"OlView",props:{center:{},constrainRotation:{type:[Number,Boolean]},enableRotation:{type:Boolean,default:!0},extent:{},constrainOnlyCenter:{type:Boolean},smoothExtentConstraint:{type:Boolean,default:!0},maxResolution:{},minResolution:{},maxZoom:{},minZoom:{},multiWorld:{type:Boolean},constrainResolution:{type:Boolean},smoothResolutionConstraint:{type:Boolean,default:!0},showFullExtent:{type:Boolean},projection:{},resolution:{},resolutions:{},rotation:{},zoom:{},zoomFactor:{},padding:{}},emits:["change","error","propertychange","change:center","change:resolution","change:rotation"],setup(e,{expose:t}){const i=e,n=Xt("map"),s=Pn(i),r=()=>({...s,projection:bm(s.projection)}),o=new zi(r());return kr(o,["change:center","change:resolution","change:rotation"]),ei(()=>{n?.setView(o)}),ie(s,()=>{const Z=r();o.setProperties(Z),o.applyOptions_(Z)}),t({view:o,adjustCenter:Z=>o.adjustCenter(Z),adjustResolution:(Z,Zt)=>o.adjustResolution(Z,Zt),adjustRotation:(Z,Zt)=>o.adjustRotation(Z,Zt),adjustZoom:(Z,Zt)=>o.adjustZoom(Z,Zt),animate:(...Z)=>o.animate(...Z),beginInteraction:()=>o.beginInteraction(),calculateExtent:Z=>o.calculateExtent(Z),cancelAnimations:()=>o.cancelAnimations(),centerOn:(Z,Zt,E)=>o.centerOn(Z,Zt,E),changed:()=>o.changed(),dispatchEvent:Z=>o.dispatchEvent(Z),endInteraction:(Z,Zt,E)=>o.endInteraction(Z,Zt,E),fit:(Z,Zt)=>o.fit(Z,Zt),get:Z=>o.get(Z),getAnimating:()=>o.getAnimating(),getCenter:()=>o.getCenter(),getInteracting:()=>o.getInteracting(),getKeys:()=>o.getKeys(),getMaxResolution:()=>o.getMaxResolution(),getMaxZoom:()=>o.getMaxZoom(),getMinResolution:()=>o.getMinResolution(),getMinZoom:()=>o.getMinZoom(),getProjection:()=>o.getProjection(),getProperties:()=>o.getProperties(),getResolution:()=>o.getResolution(),getResolutionForExtent:(Z,Zt)=>o.getResolutionForExtent(Z,Zt),getResolutionForZoom:Z=>o.getResolutionForZoom(Z),getResolutions:()=>o.getResolutions(),getRevision:()=>o.getRevision(),getRotation:()=>o.getRotation(),getZoom:()=>o.getZoom(),getZoomForResolution:Z=>o.getZoomForResolution(Z),setCenter:Z=>o.setCenter(Z),setConstrainResolution:Z=>o.setConstrainResolution(Z),setMaxZoom:Z=>o.setMaxZoom(Z),setMinZoom:Z=>o.setMinZoom(Z),setResolution:Z=>o.setResolution(Z),setRotation:Z=>o.setRotation(Z),setZoom:Z=>o.setZoom(Z)}),(Z,Zt)=>re("",!0)}}),R4={className:"ol-layer",opacity:1,visible:!0,properties:()=>({}),displayInLayerSwitcher:!0};function Am(e){return{...R4,...e}}class vg{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const t=this.pop();t instanceof Hl&&t.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let i=this.oldest_;for(;i;)t(i.value_,i.key_,this),i=i.newer}get(t,i){const n=this.entries_[t];return bt(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(t){const i=this.entries_[t];return bt(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_?(this.newest_=i.older,this.newest_&&(this.newest_.newer=null)):i===this.oldest_?(this.oldest_=i.newer,this.oldest_&&(this.oldest_.older=null)):(i.newer.older=i.older,i.older.newer=i.newer),delete this.entries_[t],--this.count_,i.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let i=0,n;for(n=this.newest_;n;n=n.older)t[i++]=n.key_;return t}getValues(){const t=new Array(this.count_);let i=0,n;for(n=this.newest_;n;n=n.older)t[i++]=n.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,i){this.get(t),this.entries_[t].value_=i}set(t,i){bt(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:i};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}function bl(e,t,i,n){return n!==void 0?(n[0]=e,n[1]=t,n[2]=i,n):[e,t,i]}function I4(e,t,i){return e+"/"+t+"/"+i}function Qa(e,t,i,n,s){return`${ht(e)},${t},${I4(i,n,s)}`}function Lm(e){return P4(e[0],e[1],e[2])}function P4(e,t,i){return(t<<e)+i}function b4(e,t){const i=e[0],n=e[1],s=e[2];if(t.getMinZoom()>i||i>t.getMaxZoom())return!1;const r=t.getFullTileRange(i);return r?r.containsXY(n,s):!0}class Sf{constructor(t,i,n,s){this.minX=t,this.maxX=i,this.minY=n,this.maxY=s}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function qs(e,t,i,n,s){return s!==void 0?(s.minX=e,s.maxX=t,s.minY=i,s.maxY=n,s):new Sf(e,t,i,n)}const Hs=[0,0,0],Gn=5;class Om{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,bt(Wy(this.resolutions_,(s,r)=>r-s),"`resolutions` must be sorted in descending order");let i;if(!t.origins){for(let s=0,r=this.resolutions_.length-1;s<r;++s)if(!i)i=this.resolutions_[s]/this.resolutions_[s+1];else if(this.resolutions_[s]/this.resolutions_[s+1]!==i){i=void 0;break}}this.zoomFactor_=i,this.maxZoom=this.resolutions_.length-1,this.origin_=t.origin!==void 0?t.origin:null,this.origins_=null,t.origins!==void 0&&(this.origins_=t.origins,bt(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const n=t.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=zs(n)),bt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,t.tileSizes!==void 0&&(this.tileSizes_=t.tileSizes,bt(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=t.tileSize!==void 0?t.tileSize:this.tileSizes_?null:Ju,bt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=n!==void 0?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],t.sizes!==void 0?this.fullTileRanges_=t.sizes.map((s,r)=>{const o=new Sf(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(n){const a=this.getTileRangeForExtentAndZ(n,r);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):n&&this.calculateTileRanges_(n)}forEachTileCoord(t,i,n){const s=this.getTileRangeForExtentAndZ(t,i);for(let r=s.minX,o=s.maxX;r<=o;++r)for(let a=s.minY,l=s.maxY;a<=l;++a)n([i,r,a])}forEachTileCoordParentTileRange(t,i,n,s){let r,o,a,l=null,h=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,s);h>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),r=qs(o,o,a,a,n)):r=this.getTileRangeForExtentAndZ(l,h,n),i(h,r))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,i,n){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){const r=t[1]*2,o=t[2]*2;return qs(r,r+1,o,o+1,i)}const s=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(s,t[0]+1,i)}return null}getTileRangeForTileCoordAndZ(t,i,n){if(i>this.maxZoom||i<this.minZoom)return null;const s=t[0],r=t[1],o=t[2];if(i===s)return qs(r,o,r,o,n);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,i-s),h=Math.floor(r*l),c=Math.floor(o*l);if(i<s)return qs(h,h,c,c,n);const u=Math.floor(l*(r+1))-1,f=Math.floor(l*(o+1))-1;return qs(h,u,c,f,n)}const a=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,i,n)}getTileRangeForExtentAndZ(t,i,n){this.getTileCoordForXYAndZ_(t[0],t[3],i,!1,Hs);const s=Hs[1],r=Hs[2];this.getTileCoordForXYAndZ_(t[2],t[1],i,!0,Hs);const o=Hs[1],a=Hs[2];return qs(s,o,r,a,n)}getTileCoordCenter(t){const i=this.getOrigin(t[0]),n=this.getResolution(t[0]),s=Qe(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*s[0]*n,i[1]-(t[2]+.5)*s[1]*n]}getTileCoordExtent(t,i){const n=this.getOrigin(t[0]),s=this.getResolution(t[0]),r=Qe(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*r[0]*s,a=n[1]-(t[2]+1)*r[1]*s,l=o+r[0]*s,h=a+r[1]*s;return $i(o,a,l,h,i)}getTileCoordForCoordAndResolution(t,i,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,!1,n)}getTileCoordForXYAndResolution_(t,i,n,s,r){const o=this.getZForResolution(n),a=n/this.getResolution(o),l=this.getOrigin(o),h=Qe(this.getTileSize(o),this.tmpSize_);let c=a*(t-l[0])/n/h[0],u=a*(l[1]-i)/n/h[1];return s?(c=Vn(c,Gn)-1,u=Vn(u,Gn)-1):(c=Ea(c,Gn),u=Ea(u,Gn)),bl(o,c,u,r)}getTileCoordForXYAndZ_(t,i,n,s,r){const o=this.getOrigin(n),a=this.getResolution(n),l=Qe(this.getTileSize(n),this.tmpSize_);let h=(t-o[0])/a/l[0],c=(o[1]-i)/a/l[1];return s?(h=Vn(h,Gn)-1,c=Vn(c,Gn)-1):(h=Ea(h,Gn),c=Ea(c,Gn)),bl(n,h,c,r)}getTileCoordForCoordAndZ(t,i,n){return this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,n)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]}getFullTileRange(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}getZForResolution(t,i){const n=Zl(this.resolutions_,t,i||0);return Bt(n,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,i){return w0(i,0,i.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const i=this.resolutions_.length,n=new Array(i);for(let s=this.minZoom;s<i;++s)n[s]=this.getTileRangeForExtentAndZ(t,s);this.fullTileRanges_=n}}class A4 extends Om{constructor(t){super({extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes}),this.matrixIds_=t.matrixIds}getMatrixId(t){return this.matrixIds_[t]}getMatrixIds(){return this.matrixIds_}}function L4(e,t,i){const n=[],s=[],r=[],o=[],a=[];i=i!==void 0?i:[];const l="SupportedCRS",h="TileMatrix",c="Identifier",u="ScaleDenominator",f="TopLeftCorner",d="TileWidth",g="TileHeight",_=e[l],m=Yt(_),p=m.getMetersPerUnit(),y=m.getAxisOrientation().startsWith("ne");return e[h].sort(function(S,v){return v[u]-S[u]}),e[h].forEach(function(S){let v;if(i.length>0?v=i.find(function(M){return S[c]==M[h]?!0:S[c].includes(":")?!1:e[c]+":"+S[c]===M[h]}):v=!0,v){s.push(S[c]);const M=S[u]*28e-5/p,C=S[d],P=S[g];y?r.push([S[f][1],S[f][0]]):r.push(S[f]),n.push(M),o.push(C==P?C:[C,P]),a.push([S.MatrixWidth,S.MatrixHeight])}}),new A4({extent:t,origins:r,resolutions:n,matrixIds:s,tileSizes:o,sizes:a})}function Fm(e){let t=e.getDefaultTileGrid();return t||(t=D4(e),e.setDefaultTileGrid(t)),t}function O4(e,t,i){const n=t[0],s=e.getTileCoordCenter(t),r=Gm(i);if(!Ir(r,s)){const o=xt(r),a=Math.ceil((r[0]-s[0])/o);return s[0]+=o*a,e.getTileCoordForCoordAndZ(s,n)}return t}function F4(e,t,i,n){n=n!==void 0?n:"top-left";const s=G4(e,t,i);return new Om({extent:e,origin:Ky(e,n),resolutions:s,tileSize:i})}function G4(e,t,i,n){t=t!==void 0?t:Cx,i=Qe(i!==void 0?i:Ju);const s=ue(e),r=xt(e);n=n>0?n:Math.max(r/i[0],s/i[1]);const o=t+1,a=new Array(o);for(let l=0;l<o;++l)a[l]=n/Math.pow(2,l);return a}function D4(e,t,i,n){const s=Gm(e);return F4(s,t,i,n)}function Gm(e){e=Yt(e);let t=e.getExtent();if(!t){const i=180*Au.degrees/e.getMetersPerUnit();t=$i(-i,-i,i,i)}return t}function Al(e,t){const i=[];Object.keys(t).forEach(function(s){t[s]!==null&&t[s]!==void 0&&i.push(s+"="+encodeURIComponent(t[s]))});const n=i.join("&");return e=e.replace(/[?&]$/,""),e+=e.includes("?")?"&":"?",e+n}const N4=/\{z\}/g,k4=/\{x\}/g,j4=/\{y\}/g,B4=/\{-y\}/g;function z4(e,t,i,n,s){return e.replace(N4,t.toString()).replace(k4,i.toString()).replace(j4,n.toString()).replace(B4,function(){if(s===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(s-n).toString()})}function Dm(e){const t=[];let i=/\{([a-z])-([a-z])\}/.exec(e);if(i){const n=i[1].charCodeAt(0),s=i[2].charCodeAt(0);let r;for(r=n;r<=s;++r)t.push(e.replace(i[0],String.fromCharCode(r)));return t}if(i=/\{(\d+)-(\d+)\}/.exec(e),i){const n=parseInt(i[2],10);for(let s=parseInt(i[1],10);s<=n;s++)t.push(e.replace(i[0],s.toString()));return t}return t.push(e),t}function W4(e,t){return(function(i,n,s){if(!i)return;let r;const o=i[0];if(t){const a=t.getFullTileRange(o);a&&(r=a.getHeight()-1)}return z4(e,o,i[1],i[2],r)})}function U4(e,t){const i=e.length,n=new Array(i);for(let s=0;s<i;++s)n[s]=W4(e[s],t);return iu(n)}function iu(e){return e.length===1?e[0]:(function(t,i,n){if(!t)return;const s=Lm(t),r=ts(s,e.length);return e[r](t,i,n)})}class Mf extends ra{constructor(t,i,n){super(),n=n||{},this.tileCoord=t,this.state=i,this.key="",this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(at.CHANGE)}release(){this.setState(nt.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==nt.EMPTY){if(this.state!==nt.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}}load(){St()}getAlpha(t,i){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(!n)n=i,this.transitionStarts_[t]=n;else if(n===-1)return 1;const s=i-n+1e3/60;return s>=this.transition_?1:A0(s/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}class Nm extends Mf{constructor(t,i,n,s,r,o){super(t,i,o),this.crossOrigin_=s,this.src_=n,this.key=n,this.image_,mi?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,s!==null&&(this.image_.crossOrigin=s)),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=nt.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}handleImageError_(){this.state=nt.ERROR,this.unlistenImage_(),this.image_=V4(),this.changed()}handleImageLoad_(){if(mi)this.state=nt.LOADED;else{const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=nt.LOADED:this.state=nt.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==nt.ERROR&&(this.state=nt.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==nt.IDLE&&(this.state=nt.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=XE(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 V4(){const e=ae(1,1);return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),e.canvas}let ic;const wr=[];function xg(e,t,i,n,s){e.beginPath(),e.moveTo(0,0),e.lineTo(t,i),e.lineTo(n,s),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,n)+1,Math.max(i,s)),e.restore()}function nc(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-.75*255)>2}function X4(){if(ic===void 0){const e=ae(6,6,wr);e.globalCompositeOperation="lighter",e.fillStyle="rgba(210, 0, 0, 0.75)",xg(e,4,5,4,0),xg(e,4,5,0,5);const t=e.getImageData(0,0,3,3).data;ic=nc(t,0)||nc(t,4)||nc(t,8),hh(e),wr.push(e.canvas)}return ic}function Ll(e,t,i,n){const s=Nu(i,t,e);let r=wd(t,n,i);const o=t.getMetersPerUnit();o!==void 0&&(r*=o);const a=e.getMetersPerUnit();a!==void 0&&(r/=a);const l=e.getExtent();if(!l||Ir(l,s)){const h=wd(e,r,s)/r;isFinite(h)&&h>0&&(r/=h)}return r}function $4(e,t,i,n){const s=Ki(i);let r=Ll(e,t,s,n);return(!isFinite(r)||r<=0)&&Pu(i,function(o){return r=Ll(e,t,o,n),isFinite(r)&&r>0}),r}function km(e,t,i,n,s,r,o,a,l,h,c,u,f,d){const g=ae(Math.round(i*e),Math.round(i*t),wr);if(u||(g.imageSmoothingEnabled=!1),l.length===0)return g.canvas;g.scale(i,i);function _(M){return Math.round(M*i)/i}g.globalCompositeOperation="lighter";const m=ti();l.forEach(function(M,C,P){i0(m,M.extent)});let p;const y=i/n,S=(u?1:1+Math.pow(2,-24))/y;(!f||l.length!==1||h!==0)&&(p=ae(Math.round(xt(m)*y),Math.round(ue(m)*y),wr),u||(p.imageSmoothingEnabled=!1),l.forEach(function(M,C,P){if(M.image.width>0&&M.image.height>0){if(M.clipExtent){p.save();const A=(M.clipExtent[0]-m[0])*y,L=-(M.clipExtent[3]-m[3])*y,V=xt(M.clipExtent)*y,tt=ue(M.clipExtent)*y;p.rect(u?A:Math.round(A),u?L:Math.round(L),u?V:Math.round(A+V)-Math.round(A),u?tt:Math.round(L+tt)-Math.round(L)),p.clip()}const b=(M.extent[0]-m[0])*y,T=-(M.extent[3]-m[3])*y,k=xt(M.extent)*y,U=ue(M.extent)*y;p.drawImage(M.image,h,h,M.image.width-2*h,M.image.height-2*h,u?b:Math.round(b),u?T:Math.round(T),u?k:Math.round(b+k)-Math.round(b),u?U:Math.round(T+U)-Math.round(T)),M.clipExtent&&p.restore()}}));const v=zs(o);return a.getTriangles().forEach(function(M,C,P){const b=M.source,T=M.target;let k=b[0][0],U=b[0][1],A=b[1][0],L=b[1][1],V=b[2][0],tt=b[2][1];const $=_((T[0][0]-v[0])/r),K=_(-(T[0][1]-v[1])/r),X=_((T[1][0]-v[0])/r),rt=_(-(T[1][1]-v[1])/r),ut=_((T[2][0]-v[0])/r),mt=_(-(T[2][1]-v[1])/r),B=k,Ht=U;k=0,U=0,A-=B,L-=Ht,V-=B,tt-=Ht;const se=[[A,L,0,0,X-$],[V,tt,0,0,ut-$],[0,0,A,L,rt-K],[0,0,V,tt,mt-K]],Gt=Jy(se);if(!Gt)return;if(g.save(),g.beginPath(),X4()||!u){g.moveTo(X,rt);const Kt=4,me=$-X,pe=K-rt;for(let Z=0;Z<Kt;Z++)g.lineTo(X+_((Z+1)*me/Kt),rt+_(Z*pe/(Kt-1))),Z!=Kt-1&&g.lineTo(X+_((Z+1)*me/Kt),rt+_((Z+1)*pe/(Kt-1)));g.lineTo(ut,mt)}else g.moveTo(X,rt),g.lineTo($,K),g.lineTo(ut,mt);g.clip(),g.transform(Gt[0],Gt[2],Gt[1],Gt[3],$,K),g.translate(m[0]-B,m[3]-Ht);let $t;if(p)$t=p.canvas,g.scale(S,-S);else{const Kt=l[0],me=Kt.extent;$t=Kt.image,g.scale(xt(me)/$t.width,-ue(me)/$t.height)}g.drawImage($t,0,0),g.restore()}),p&&(hh(p),wr.push(p.canvas)),c&&(g.save(),g.globalCompositeOperation="source-over",g.strokeStyle="black",g.lineWidth=1,a.getTriangles().forEach(function(M,C,P){const b=M.target,T=(b[0][0]-v[0])/r,k=-(b[0][1]-v[1])/r,U=(b[1][0]-v[0])/r,A=-(b[1][1]-v[1])/r,L=(b[2][0]-v[0])/r,V=-(b[2][1]-v[1])/r;g.beginPath(),g.moveTo(U,A),g.lineTo(T,k),g.lineTo(L,V),g.closePath(),g.stroke()}),g.restore()),g.canvas}const K4=10,Eg=.25;class jm{constructor(t,i,n,s,r,o,a){this.sourceProj_=t,this.targetProj_=i;let l={};const h=a?Gc(S=>he(a,Nu(S,this.targetProj_,this.sourceProj_))):Bo(this.targetProj_,this.sourceProj_);this.transformInv_=function(S){const v=S[0]+"/"+S[1];return l[v]||(l[v]=h(S)),l[v]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&xt(s)>=xt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?xt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?xt(this.targetProj_.getExtent()):null;const c=zs(n),u=th(n),f=Ql(n),d=Jl(n),g=this.transformInv_(c),_=this.transformInv_(u),m=this.transformInv_(f),p=this.transformInv_(d),y=K4+(o?Math.max(0,Math.ceil(Math.log2(bc(n)/(o*o*256*256)))):0);if(this.addQuad_(c,u,f,d,g,_,m,p,y),this.wrapsXInSource_){let S=1/0;this.triangles_.forEach(function(v,M,C){S=Math.min(S,v.source[0][0],v.source[1][0],v.source[2][0])}),this.triangles_.forEach(v=>{if(Math.max(v.source[0][0],v.source[1][0],v.source[2][0])-S>this.sourceWorldWidth_/2){const M=[[v.source[0][0],v.source[0][1]],[v.source[1][0],v.source[1][1]],[v.source[2][0],v.source[2][1]]];M[0][0]-S>this.sourceWorldWidth_/2&&(M[0][0]-=this.sourceWorldWidth_),M[1][0]-S>this.sourceWorldWidth_/2&&(M[1][0]-=this.sourceWorldWidth_),M[2][0]-S>this.sourceWorldWidth_/2&&(M[2][0]-=this.sourceWorldWidth_);const C=Math.min(M[0][0],M[1][0],M[2][0]);Math.max(M[0][0],M[1][0],M[2][0])-C<this.sourceWorldWidth_/2&&(v.source=M)}})}l={}}addTriangle_(t,i,n,s,r,o){this.triangles_.push({source:[s,r,o],target:[t,i,n]})}addQuad_(t,i,n,s,r,o,a,l,h){const c=Qt([r,o,a,l]),u=this.sourceWorldWidth_?xt(c)/this.sourceWorldWidth_:null,f=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&u>.5&&u<1;let g=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const m=Qt([t,i,n,s]);g=xt(m)/this.targetWorldWidth_>Eg||g}!d&&this.sourceProj_.isGlobal()&&u&&(g=u>Eg||g)}if(!g&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!Fe(c,this.maxSourceExtent_))return;let _=0;if(!g&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(h>0)g=!0;else if(_=(!isFinite(r[0])||!isFinite(r[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),_!=1&&_!=2&&_!=4&&_!=8)return}if(h>0){if(!g){const m=[(t[0]+n[0])/2,(t[1]+n[1])/2],p=this.transformInv_(m);let y;d?y=(ts(r[0],f)+ts(a[0],f))/2-ts(p[0],f):y=(r[0]+a[0])/2-p[0];const S=(r[1]+a[1])/2-p[1];g=y*y+S*S>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const m=[(i[0]+n[0])/2,(i[1]+n[1])/2],p=this.transformInv_(m),y=[(s[0]+t[0])/2,(s[1]+t[1])/2],S=this.transformInv_(y);this.addQuad_(t,i,m,y,r,o,p,S,h-1),this.addQuad_(y,m,n,s,S,p,a,l,h-1)}else{const m=[(t[0]+i[0])/2,(t[1]+i[1])/2],p=this.transformInv_(m),y=[(n[0]+s[0])/2,(n[1]+s[1])/2],S=this.transformInv_(y);this.addQuad_(t,m,y,s,r,p,S,l,h-1),this.addQuad_(m,i,n,y,p,o,a,S,h-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(_&11)==0&&this.addTriangle_(t,n,s,r,a,l),(_&14)==0&&this.addTriangle_(t,n,i,r,a,o),_&&((_&13)==0&&this.addTriangle_(i,s,t,o,l,r),(_&7)==0&&this.addTriangle_(i,s,n,o,l,a))}calculateSourceExtent(){const t=ti();return this.triangles_.forEach(function(i,n,s){const r=i.source;Eo(t,r[0]),Eo(t,r[1]),Eo(t,r[2])}),t}getTriangles(){return this.triangles_}}const Bm=.5;class zm extends Mf{constructor(t,i,n,s,r,o,a,l,h,c,u,f){super(r,nt.IDLE,f),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=i,this.targetTileGrid_=s,this.wrappedTileCoord_=o||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const d=s.getTileCoordExtent(this.wrappedTileCoord_),g=this.targetTileGrid_.getExtent();let _=this.sourceTileGrid_.getExtent();const m=g?Jn(d,g):d;if(bc(m)===0){this.state=nt.EMPTY;return}const p=t.getExtent();p&&(_?_=Jn(_,p):_=p);const y=s.getResolution(this.wrappedTileCoord_[0]),S=$4(t,n,m,y);if(!isFinite(S)||S<=0){this.state=nt.EMPTY;return}const v=c!==void 0?c:Bm;if(this.triangulation_=new jm(t,n,m,_,S*v,y),this.triangulation_.getTriangles().length===0){this.state=nt.EMPTY;return}this.sourceZ_=i.getZForResolution(S);let M=this.triangulation_.calculateSourceExtent();if(_&&(t.canWrapX()?(M[1]=Bt(M[1],_[1],_[3]),M[3]=Bt(M[3],_[1],_[3])):M=Jn(M,_)),!bc(M))this.state=nt.EMPTY;else{let C=0,P=0;t.canWrapX()&&(C=xt(p),P=Math.floor((M[0]-p[0])/C)),o0(M.slice(),t,!0).forEach(T=>{const k=i.getTileRangeForExtentAndZ(T,this.sourceZ_);for(let U=k.minX;U<=k.maxX;U++)for(let A=k.minY;A<=k.maxY;A++){const L=h(this.sourceZ_,U,A,a);if(L){const V=P*C;this.sourceTiles_.push({tile:L,offset:V})}}++P}),this.sourceTiles_.length===0&&(this.state=nt.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(i=>{const n=i.tile;if(n&&n.getState()==nt.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);s[0]+=i.offset,s[2]+=i.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=i.offset,r[2]+=i.offset),t.push({extent:s,clipExtent:r,image:n.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=nt.ERROR;else{const i=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(i),s=typeof n=="number"?n:n[0],r=typeof n=="number"?n:n[1],o=this.targetTileGrid_.getResolution(i),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=km(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=nt.LOADED}this.changed()}load(){if(this.state==nt.IDLE){this.state=nt.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:i})=>{const n=i.getState();if(n==nt.IDLE||n==nt.LOADING){t++;const s=_t(i,at.CHANGE,r=>{const o=i.getState();(o==nt.LOADED||o==nt.ERROR||o==nt.EMPTY)&&(Tt(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:i},n,s){i.getState()==nt.IDLE&&i.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(Tt),this.sourcesListenerKeys_=null}release(){this.canvas_&&(hh(this.canvas_.getContext("2d")),wr.push(this.canvas_),this.canvas_=null),super.release()}}class wf extends Di{constructor(t){super(),this.projection=Yt(t.projection),this.attributions_=Sg(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const i=this;this.viewPromise_=new Promise(function(n,s){i.viewResolver=n,i.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Sg(t),this.changed()}setState(t){this.state_=t,this.changed()}}function Sg(e){return e?typeof e=="function"?e:(Array.isArray(e)||(e=[e]),t=>e):null}class Wm extends wf{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,this.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;const i=[256,256];this.tileGrid&&Qe(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),i),this.tmpSize=[0,0],this.key_=t.key||ht(this),this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getResolutions(t){const i=t?this.getTileGridForProjection(t):this.tileGrid;return i?i.getResolutions():null}getTile(t,i,n,s,r,o){return St()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:Fm(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,i,n){const s=this.getTileGridForProjection(n),r=this.getTilePixelRatio(i),o=Qe(s.getTileSize(t),this.tmpSize);return r==1?o:xE(o,r,this.tmpSize)}getTileCoordForTileUrlFunction(t,i){const n=i!==void 0?i:this.getProjection(),s=i!==void 0?this.getTileGridForProjection(n):this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=O4(s,t,n)),b4(t,s)?t:null}clear(){}refresh(){this.clear(),super.refresh()}}class Y4 extends ii{constructor(t,i){super(t),this.tile=i}}const sc={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class Cf extends Wm{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===Cf.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const i=t.target,n=ht(i),s=i.getState();let r;s==nt.LOADING?(this.tileLoadingKeys_[n]=!0,r=sc.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],r=s==nt.ERROR?sc.TILELOADERROR:s==nt.LOADED?sc.TILELOADEND:void 0),r!=null&&this.dispatchEvent(new Y4(r,i))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,i){this.tileUrlFunction=t,typeof i<"u"?this.setKey(i):this.changed()}setUrl(t){const i=Dm(t);this.urls=i,this.setUrls(i)}setUrls(t){this.urls=t;const i=t.join(`
|
|
7
|
-
`);this.generateTileUrlFunction_?this.setTileUrlFunction(U4(t,this.tileGrid),i):this.setKey(i)}tileUrlFunction(t,i,n){}}class Um extends Cf{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:q4,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate!==void 0?t.interpolate:!0,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,this.tileClass=t.tileClass!==void 0?t.tileClass:Nm,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!pn(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const i=this.getProjection();if(this.tileGrid&&(!i||pn(i,t)))return this.tileGrid;const n=ht(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=Fm(t)),this.tileGridForProjection[n]}createTile_(t,i,n,s,r,o){const a=[t,i,n],l=this.getTileCoordForTileUrlFunction(a,r),h=l?this.tileUrlFunction(l,s,r):void 0,c=new this.tileClass(a,h!==void 0?nt.IDLE:nt.EMPTY,h!==void 0?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=o,c.addEventListener(at.CHANGE,this.handleTileChange.bind(this)),c}getTile(t,i,n,s,r,o){const a=this.getProjection();if(!a||!r||pn(a,r))return this.getTileInternal(t,i,n,s,a||r);const l=[t,i,n],h=this.getKey(),c=this.getTileGridForProjection(a),u=this.getTileGridForProjection(r),f=this.getTileCoordForTileUrlFunction(l,r),d=new zm(a,c,r,u,l,f,this.getTilePixelRatio(s),this.getGutter(),(g,_,m,p)=>this.getTileInternal(g,_,m,p,a,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=h,d}getTileInternal(t,i,n,s,r,o){const a=this.getKey(),l=Qa(this,a,t,i,n);if(o&&o.containsKey(l))return o.get(l);const h=this.createTile_(t,i,n,s,r,a);return o?.set(l,h),h}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,i){const n=Yt(t);if(n){const s=ht(n);s in this.tileGridForProjection||(this.tileGridForProjection[s]=i)}}}function q4(e,t){if(mi){const i=e.getCrossOrigin();let n="same-origin",s="same-origin";i==="anonymous"||i===""?(n="cors",s="omit"):i==="use-credentials"&&(n="cors",s="include"),fetch(t,{mode:n,credentials:s}).then(r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.blob()}).then(r=>createImageBitmap(r)).then(r=>{const o=e.getImage();o.width=r.width,o.height=r.height,o.getContext("2d").drawImage(r,0,0),r.close?.(),o.dispatchEvent(new Event("load"))}).catch(()=>{e.getImage().dispatchEvent(new Event("error"))});return}e.getImage().src=t}let H4=!1;function Z4(e,t,i,n,s,r,o){const a=new XMLHttpRequest;a.open("GET",typeof e=="function"?e(i,n,s):e,!0),t.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=H4,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const h=t.getType();try{let c;h=="text"||h=="json"?c=a.responseText:h=="xml"?c=a.responseXML||a.responseText:h=="arraybuffer"&&(c=a.response),c?r(t.readFeatures(c,{extent:i,featureProjection:s}),t.readProjection(c)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function Mg(e,t){return function(i,n,s,r,o){Z4(e,t,i,n,s,(a,l)=>{this.addFeatures(a),r!==void 0&&r(a)},()=>{this.changed(),o!==void 0&&o()})}}function J4(e,t){return[[-1/0,-1/0,1/0,1/0]]}function Vm(e,t,i,n){const s=[];let r=ti();for(let o=0,a=i.length;o<a;++o){const l=i[o];r=Iu(e,t,l[0],n),s.push((r[0]+r[2])/2,(r[1]+r[3])/2),t=l[l.length-1]}return s}function Ol(e,t,i,n,s,r,o){let a,l;const h=(i-t)/n;if(h===1)a=t;else if(h===2)a=t,l=s;else if(h!==0){let c=e[t],u=e[t+1],f=0;const d=[0];for(let m=t+n;m<i;m+=n){const p=e[m],y=e[m+1];f+=Math.sqrt((p-c)*(p-c)+(y-u)*(y-u)),d.push(f),c=p,u=y}const g=s*f,_=jy(d,g);_<0?(l=(g-d[-_-2])/(d[-_-1]-d[-_-2]),a=t+(-_-2)*n):a=t+_*n}o=o>1?o:2,r=r||new Array(o);for(let c=0;c<o;++c)r[c]=a===void 0?NaN:l===void 0?e[a+c]:oi(e[a+c],e[a+n+c],l);return r}function nu(e,t,i,n,s,r){if(i==t)return null;let o;if(s<e[t+n-1])return r?(o=e.slice(t,t+n),o[n-1]=s,o):null;if(e[i-1]<s)return r?(o=e.slice(i-n,i),o[n-1]=s,o):null;if(s==e[t+n-1])return e.slice(t,t+n);let a=t/n,l=i/n;for(;a<l;){const f=a+l>>1;s<e[(f+1)*n-1]?l=f:a=f+1}const h=e[a*n-1];if(s==h)return e.slice((a-1)*n,(a-1)*n+n);const c=e[(a+1)*n-1],u=(s-h)/(c-h);o=[];for(let f=0;f<n-1;++f)o.push(oi(e[(a-1)*n+f],e[a*n+f],u));return o.push(s),o}function Q4(e,t,i,n,s,r,o){if(o)return nu(e,t,i[i.length-1],n,s,r);let a;if(s<e[n-1])return r?(a=e.slice(0,n),a[n-1]=s,a):null;if(e[e.length-1]<s)return r?(a=e.slice(e.length-n),a[n-1]=s,a):null;for(let l=0,h=i.length;l<h;++l){const c=i[l];if(t!=c){if(s<e[t+n-1])return null;if(s<=e[c-1])return nu(e,t,c,n,s,!1);t=c}}return null}class ph extends hs{constructor(t,i,n){super(),n!==void 0&&i===void 0?this.setFlatCoordinates(n,t):(i=i||0,this.setCenterAndRadius(t,i,n))}clone(){const t=new ph(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(t,i,n,s){const r=this.flatCoordinates,o=t-r[0],a=i-r[1],l=o*o+a*a;if(l<s){if(l===0)for(let h=0;h<this.stride;++h)n[h]=r[h];else{const h=this.getRadius()/Math.sqrt(l);n[0]=r[0]+h*o,n[1]=r[1]+h*a;for(let c=2;c<this.stride;++c)n[c]=r[c]}return n.length=this.stride,l}return s}containsXY(t,i){const n=this.flatCoordinates,s=t-n[0],r=i-n[1];return s*s+r*r<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(t){const i=this.flatCoordinates,n=i[this.stride]-i[0];return $i(i[0]-n,i[1]-n,i[0]+n,i[1]+n,t)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],i=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+i*i}getType(){return"Circle"}intersectsExtent(t){const i=this.getExtent();if(Fe(t,i)){const n=this.getCenter();return t[0]<=n[0]&&t[2]>=n[0]||t[1]<=n[1]&&t[3]>=n[1]?!0:Pu(t,this.intersectsCoordinate.bind(this))}return!1}setCenter(t){const i=this.stride,n=this.flatCoordinates[i]-this.flatCoordinates[0],s=t.slice();s[i]=s[0]+n;for(let r=1;r<i;++r)s[i+r]=t[r];this.setFlatCoordinates(this.layout,s),this.changed()}setCenterAndRadius(t,i,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]);const s=this.flatCoordinates;let r=v0(s,0,t,this.stride);s[r++]=s[0]+i;for(let o=1,a=this.stride;o<a;++o)s[r++]=s[o];s.length=r,this.changed()}getCoordinates(){return null}setCoordinates(t,i){}setRadius(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()}rotate(t,i){const n=this.getCenter(),s=this.getStride();this.setCenter(ku(n,0,n.length,s,t,i,n)),this.changed()}}ph.prototype.transform;class Fl extends ju{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Tt),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let i=0,n=t.length;i<n;++i)this.changeEventsKeys_.push(_t(t[i],at.CHANGE,this.changed,this))}clone(){const t=new Fl(rc(this.geometries_));return t.applyProperties(this),t}closestPointXY(t,i,n,s){if(s<Bs(this.getExtent(),t,i))return s;const r=this.geometries_;for(let o=0,a=r.length;o<a;++o)s=r[o].closestPointXY(t,i,n,s);return s}containsXY(t,i){const n=this.geometries_;for(let s=0,r=n.length;s<r;++s)if(n[s].containsXY(t,i))return!0;return!1}computeExtent(t){Gr(t);const i=this.geometries_;for(let n=0,s=i.length;n<s;++n)i0(t,i[n].getExtent());return t}getGeometries(){return rc(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const i=this.geometries_;for(let n=0,s=i.length;n<s;++n)i[n].getType()===this.getType()?t=t.concat(i[n].getGeometriesArrayRecursive()):t.push(i[n]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const i=[],n=this.geometries_;let s=!1;for(let r=0,o=n.length;r<o;++r){const a=n[r],l=a.getSimplifiedGeometry(t);i.push(l),l!==a&&(s=!0)}return s?new Fl(i):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return"GeometryCollection"}intersectsExtent(t){const i=this.geometries_;for(let n=0,s=i.length;n<s;++n)if(i[n].intersectsExtent(t))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(t,i){const n=this.geometries_;for(let s=0,r=n.length;s<r;++s)n[s].rotate(t,i);this.changed()}scale(t,i,n){n||(n=Ki(this.getExtent()));const s=this.geometries_;for(let r=0,o=s.length;r<o;++r)s[r].scale(t,i,n);this.changed()}setGeometries(t){this.setGeometriesArray(rc(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const i=this.geometries_;for(let n=0,s=i.length;n<s;++n)i[n].applyTransform(t);this.changed()}translate(t,i){const n=this.geometries_;for(let s=0,r=n.length;s<r;++s)n[s].translate(t,i);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function rc(e){return e.map(t=>t.clone())}function Tf(e,t,i,n){let s=e[t],r=e[t+1],o=0;for(let a=t+n;a<i;a+=n){const l=e[a],h=e[a+1];o+=Math.sqrt((l-s)*(l-s)+(h-r)*(h-r)),s=l,r=h}return o}class En extends hs{constructor(t,i){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,i!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(i,t):this.setCoordinates(t,i)}appendCoordinate(t){xi(this.flatCoordinates,t),this.changed()}clone(){const t=new En(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,i,n,s){return s<Bs(this.getExtent(),t,i)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Bu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,i,n,s))}forEachSegment(t){return M0(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,i){return this.layout!="XYM"&&this.layout!="XYZM"?null:(i=i!==void 0?i:!1,nu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i))}getCoordinates(){return Xn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,i){return Ol(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,this.stride)}getLength(){return Tf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const i=[];return i.length=oh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new En(i,"XY")}getType(){return"LineString"}intersectsExtent(t){return ah(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,this.getExtent())}setCoordinates(t,i){this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=rh(this.flatCoordinates,0,t,this.stride),this.changed()}}class Qo extends hs{constructor(t,i,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,i);else if(i!==void 0&&n)this.setFlatCoordinates(i,t),this.ends_=n;else{const s=t,r=[],o=[];for(let l=0,h=s.length;l<h;++l){const c=s[l];xi(r,c.getFlatCoordinates()),o.push(r.length)}const a=s.length===0?this.getLayout():s[0].getLayout();this.setFlatCoordinates(a,r),this.ends_=o}}appendLineString(t){xi(this.flatCoordinates,t.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Qo(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,i,n,s){return s<Bs(this.getExtent(),t,i)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(zu(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Uu(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,i,n,s))}getCoordinateAtM(t,i,n){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(i=i!==void 0?i:!1,n=n!==void 0?n:!1,Q4(this.flatCoordinates,0,this.ends_,this.stride,t,i,n))}getCoordinates(){return zo(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new En(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,i=this.ends_,n=this.layout,s=[];let r=0;for(let o=0,a=i.length;o<a;++o){const l=i[o],h=new En(t.slice(r,l),n);s.push(h),r=l}return s}getLength(){const t=this.ends_;let i=0,n=0;for(let s=0,r=t.length;s<r;++s)n+=Tf(this.flatCoordinates,i,t[s],this.stride),i=t[s];return n}getFlatMidpoints(){const t=[],i=this.flatCoordinates;let n=0;const s=this.ends_,r=this.stride;for(let o=0,a=s.length;o<a;++o){const l=s[o],h=Ol(i,n,l,r,.5);xi(t,h),n=l}return t}getSimplifiedGeometryInternal(t){const i=[],n=[];return i.length=x0(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,n),new Qo(i,"XY",n)}getType(){return"MultiLineString"}intersectsExtent(t){return Jv(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,i){this.setLayout(i,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=Vu(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}}class yh extends hs{constructor(t,i){super(),i&&!Array.isArray(t[0])?this.setFlatCoordinates(i,t):this.setCoordinates(t,i)}appendPoint(t){xi(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new yh(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,i,n,s){if(s<Bs(this.getExtent(),t,i))return s;const r=this.flatCoordinates,o=this.stride;for(let a=0,l=r.length;a<l;a+=o){const h=_n(t,i,r[a],r[a+1]);if(h<s){s=h;for(let c=0;c<o;++c)n[c]=r[a+c];n.length=o}}return s}getCoordinates(){return Xn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const i=this.flatCoordinates.length/this.stride;return t<0||i<=t?null:new yn(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,i=this.layout,n=this.stride,s=[];for(let r=0,o=t.length;r<o;r+=n){const a=new yn(t.slice(r,r+n),i);s.push(a)}return s}getType(){return"MultiPoint"}intersectsExtent(t){const i=this.flatCoordinates,n=this.stride;for(let s=0,r=i.length;s<r;s+=n){const o=i[s],a=i[s+1];if(Ru(t,o,a))return!0}return!1}setCoordinates(t,i){this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=rh(this.flatCoordinates,0,t,this.stride),this.changed()}}class ta extends hs{constructor(t,i,n){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!n&&!Array.isArray(t[0])){const s=t,r=[],o=[];for(let a=0,l=s.length;a<l;++a){const h=s[a],c=r.length,u=h.getEnds();for(let f=0,d=u.length;f<d;++f)u[f]+=c;xi(r,h.getFlatCoordinates()),o.push(u)}i=s.length===0?this.getLayout():s[0].getLayout(),t=r,n=o}i!==void 0&&n?(this.setFlatCoordinates(i,t),this.endss_=n):this.setCoordinates(t,i)}appendPolygon(t){let i;if(!this.flatCoordinates)this.flatCoordinates=t.getFlatCoordinates().slice(),i=t.getEnds().slice(),this.endss_.push();else{const n=this.flatCoordinates.length;xi(this.flatCoordinates,t.getFlatCoordinates()),i=t.getEnds().slice();for(let s=0,r=i.length;s<r;++s)i[s]+=n}this.endss_.push(i),this.changed()}clone(){const t=this.endss_.length,i=new Array(t);for(let s=0;s<t;++s)i[s]=this.endss_[s].slice();const n=new ta(this.flatCoordinates.slice(),this.layout,i);return n.applyProperties(this),n}closestPointXY(t,i,n,s){return s<Bs(this.getExtent(),t,i)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Xv(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),$v(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,i,n,s))}containsXY(t,i){return Zv(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,i)}getArea(){return Vv(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let i;return t!==void 0?(i=this.getOrientedFlatCoordinates().slice(),Pd(i,0,this.endss_,this.stride,t)):i=this.flatCoordinates,Nc(i,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=Vm(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=S0(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new yh(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;ex(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Pd(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const i=[],n=[];return i.length=qv(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,n),new ta(i,"XY",n)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let i;if(t===0)i=0;else{const r=this.endss_[t-1];i=r[r.length-1]}const n=this.endss_[t].slice(),s=n[n.length-1];if(i!==0)for(let r=0,o=n.length;r<o;++r)n[r]-=i;return new Fi(this.flatCoordinates.slice(i,s),this.layout,n)}getPolygons(){const t=this.layout,i=this.flatCoordinates,n=this.endss_,s=[];let r=0;for(let o=0,a=n.length;o<a;++o){const l=n[o].slice(),h=l[l.length-1];if(r!==0)for(let u=0,f=l.length;u<f;++u)l[u]-=r;const c=new Fi(i.slice(r,h),t,l);s.push(c),r=h}return s}getType(){return"MultiPolygon"}intersectsExtent(t){return Qv(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,i){this.setLayout(i,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const n=Kv(this.flatCoordinates,0,t,this.stride,this.endss_);if(n.length===0)this.flatCoordinates.length=0;else{const s=n[n.length-1];this.flatCoordinates.length=s.length===0?0:s[s.length-1]}this.changed()}}const wg=bi();class Ri{constructor(t,i,n,s,r,o){this.styleFunction,this.extent_,this.id_=o,this.type_=t,this.flatCoordinates_=i,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=r,this.squaredTolerance_,this.stride_=s,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?xo(this.flatCoordinates_):Iu(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=Ki(this.getExtent());this.flatInteriorPoints_=Ku(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=ix(this.flatCoordinates_,this.ends_),i=Vm(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=S0(this.flatCoordinates_,0,t,2,i)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Ol(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let i=0;const n=this.ends_;for(let s=0,r=n.length;s<r;++s){const o=n[s],a=Ol(t,i,o,2,.5);xi(this.flatMidpoints_,a),i=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,i){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){t=Yt(t);const i=t.getExtent(),n=t.getWorldExtent();if(i&&n){const s=ue(n)/ue(i);Cn(wg,n[0],n[3],s,-s,0,0,0),es(this.flatCoordinates_,0,this.flatCoordinates_.length,2,wg,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new Ri(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=J_((t,i)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),i&&this.simplifiedGeometry_.applyTransform(i);const n=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":n.length=oh(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),s=[n.length];break;case"MultiLineString":s=[],n.length=x0(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,s);break;case"Polygon":s=[],n.length=Xu(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,s);break}return s&&(this.simplifiedGeometry_=new Ri(this.type_,n,s,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Ri.prototype.getFlatCoordinates=Ri.prototype.getOrientedFlatCoordinates;class Gl{constructor(t){this.rbush_=new z0(t),this.items_={}}insert(t,i){const n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};this.rbush_.insert(n),this.items_[ht(i)]=n}load(t,i){const n=new Array(i.length);for(let s=0,r=i.length;s<r;s++){const o=t[s],a=i[s],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};n[s]=l,this.items_[ht(a)]=l}this.rbush_.load(n)}remove(t){const i=ht(t),n=this.items_[i];return delete this.items_[i],this.rbush_.remove(n)!==null}update(t,i){const n=this.items_[ht(i)],s=[n.minX,n.minY,n.maxX,n.maxY];Pr(s,t)||(this.remove(i),this.insert(t,i))}getAll(){return this.rbush_.all().map(function(i){return i.value})}getInExtent(t){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(i).map(function(s){return s.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,i){return this.forEach_(this.getInExtent(t),i)}forEach_(t,i){let n;for(let s=0,r=t.length;s<r;s++)if(n=i(t[s]),n)return n;return n}isEmpty(){return Rr(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const i=this.rbush_.toJSON();return $i(i.minX,i.minY,i.maxX,i.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const i in t.items_)this.items_[i]=t.items_[i]}}const Pe={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class Dn extends ii{constructor(t,i,n){super(t),this.feature=i,this.features=n}}class vh extends wf{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=jo,this.format_=t.format||null,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(bt(this.format_,"`format` must be set when `url` is set"),this.loader_=Mg(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:J4;const i=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=i?new Gl:null,this.loadedExtentsRtree_=new Gl,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,s;Array.isArray(t.features)?s=t.features:t.features&&(n=t.features,s=n.getArray()),!i&&n===void 0&&(n=new Me(s)),s!==void 0&&this.addFeaturesInternal(s),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const i=ht(t);if(!this.addToIndex_(i,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(i,t);const n=t.getGeometry();if(n){const s=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[i]=t;this.dispatchEvent(new Dn(Pe.ADDFEATURE,t))}setupChangeEvents_(t,i){i instanceof Ri||(this.featureChangeKeys_[t]=[_t(i,at.CHANGE,this.handleFeatureChange_,this),_t(i,Tr.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,i){let n=!0;if(i.getId()!==void 0){const s=String(i.getId());if(!(s in this.idIndex_))this.idIndex_[s]=i;else if(i instanceof Ri){const r=this.idIndex_[s];r instanceof Ri?Array.isArray(r)?r.push(i):this.idIndex_[s]=[r,i]:n=!1}else n=!1}return n&&(bt(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=i),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const i=[],n=[],s=[];for(let r=0,o=t.length;r<o;r++){const a=t[r],l=ht(a);this.addToIndex_(l,a)&&n.push(a)}for(let r=0,o=n.length;r<o;r++){const a=n[r],l=ht(a);this.setupChangeEvents_(l,a);const h=a.getGeometry();if(h){const c=h.getExtent();i.push(c),s.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(i,s),this.hasListener(Pe.ADDFEATURE))for(let r=0,o=n.length;r<o;r++)this.dispatchEvent(new Dn(Pe.ADDFEATURE,n[r]))}bindFeaturesCollection_(t){let i=!1;this.addEventListener(Pe.ADDFEATURE,function(n){i||(i=!0,t.push(n.feature),i=!1)}),this.addEventListener(Pe.REMOVEFEATURE,function(n){i||(i=!0,t.remove(n.feature),i=!1)}),t.addEventListener(te.ADD,n=>{i||(i=!0,this.addFeature(n.element),i=!1)}),t.addEventListener(te.REMOVE,n=>{i||(i=!0,this.removeFeature(n.element),i=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach(Tt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(n=>{this.removeFeatureInternal(n)});for(const n in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const i=new Dn(Pe.CLEAR);this.dispatchEvent(i),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,i){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(s){const r=s.getGeometry();if(r instanceof Ri||r.intersectsCoordinate(t))return i(s)})}forEachFeatureInExtent(t,i){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,i);this.featuresCollection_&&this.featuresCollection_.forEach(i)}forEachFeatureIntersectingExtent(t,i){return this.forEachFeatureInExtent(t,function(n){const s=n.getGeometry();if(s instanceof Ri||s.intersectsExtent(t)){const r=i(n);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Rr(this.nullGeometryFeatures_)||xi(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const i=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){i.push(n)}),i}getFeaturesInExtent(t,i){if(this.featuresRtree_){if(!(i&&i.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=o0(t,i);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,i){const n=t[0],s=t[1];let r=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return i=i||wn,this.featuresRtree_.forEachInExtent(l,function(h){if(i(h)){const c=h.getGeometry(),u=a;if(a=c instanceof Ri?0:c.closestPointXY(n,s,o,a),a<u){r=h;const f=Math.sqrt(a);l[0]=n-f,l[1]=s-f,l[2]=n+f,l[3]=s+f}}}),r}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const i=this.idIndex_[t.toString()];return i!==void 0?i:null}getFeatureByUid(t){const i=this.uidIndex_[t];return i!==void 0?i:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const i=t.target,n=ht(i),s=i.getGeometry();if(!s)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(i),this.nullGeometryFeatures_[n]=i);else{const o=s.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(o,i)):this.featuresRtree_&&this.featuresRtree_.update(o,i)}const r=i.getId();if(r!==void 0){const o=r.toString();this.idIndex_[o]!==i&&(this.removeFromIdIndex_(i),this.idIndex_[o]=i)}else this.removeFromIdIndex_(i),this.uidIndex_[n]=i;this.changed(),this.dispatchEvent(new Dn(Pe.CHANGEFEATURE,i))}hasFeature(t){const i=t.getId();return i!==void 0?i in this.idIndex_:ht(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Rr(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,i,n){const s=this.loadedExtentsRtree_,r=this.strategy_(t,i,n);for(let o=0,a=r.length;o<a;++o){const l=r[o];s.forEachInExtent(l,function(c){return fn(c.extent,l)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Dn(Pe.FEATURESLOADSTART)),this.loader_.call(this,l,i,n,c=>{--this.loadingExtentsCount_,this.dispatchEvent(new Dn(Pe.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Dn(Pe.FEATURESLOADERROR))}),s.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const i=this.loadedExtentsRtree_,n=i.forEachInExtent(t,function(s){if(Pr(s.extent,t))return s});n&&i.remove(n)}removeFeatures(t){let i=!1;for(let n=0,s=t.length;n<s;++n)i=this.removeFeatureInternal(t[n])||i;i&&this.changed()}removeFeature(t){if(!t)return;this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const i=ht(t);if(!(i in this.uidIndex_))return!1;i in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[i]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.featureChangeKeys_[i]?.forEach(Tt),delete this.featureChangeKeys_[i];const s=t.getId();if(s!==void 0){const r=s.toString(),o=this.idIndex_[r];o===t?delete this.idIndex_[r]:Array.isArray(o)&&(o.splice(o.indexOf(t),1),o.length===1&&(this.idIndex_[r]=o[0]))}return delete this.uidIndex_[i],this.hasListener(Pe.REMOVEFEATURE)&&this.dispatchEvent(new Dn(Pe.REMOVEFEATURE,t)),!0}removeFromIdIndex_(t){for(const i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i];break}}setLoader(t){this.loader_=t}setUrl(t){bt(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(Mg(t,this.format_))}setOverlaps(t){this.overlaps_=t,this.changed()}}function su(e){return e instanceof Image||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageBitmap?e:null}const tT=new Error("disposed"),eT=[256,256];class Cg extends Mf{constructor(t){const i=nt.IDLE;super(t.tileCoord,i,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=su(this.data_);return t?[t.width,t.height]:eT}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==nt.IDLE&&this.state!==nt.ERROR)return;this.state=nt.LOADING,this.changed();const t=this;this.loader_().then(function(i){t.data_=i,t.state=nt.LOADED,t.changed()}).catch(function(i){t.error_=i,t.state=nt.ERROR,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(tT),this.controller_=null),super.disposeInternal()}}function ru(e){return Array.isArray(e)?Math.min(...e):e}class iT extends $0{constructor(t,i,n,s,r,o,a){let l=t.getExtent();l&&t.canWrapX()&&(l=l.slice(),l[0]=-1/0,l[2]=1/0);let h=i.getExtent();h&&i.canWrapX()&&(h=h.slice(),h[0]=-1/0,h[2]=1/0);const c=h?Jn(n,h):n,u=Ki(c),f=Ll(t,i,u,s),d=Bm,g=new jm(t,i,c,l,f*d,s),_=g.calculateSourceExtent(),m=Dr(_)?null:o(_,f,r),p=m?et.IDLE:et.EMPTY,y=m?m.getPixelRatio():1;super(n,s,y,p),this.targetProj_=i,this.maxSourceExtent_=l,this.triangulation_=g,this.targetResolution_=s,this.targetExtent_=n,this.sourceImage_=m,this.sourcePixelRatio_=y,this.interpolate_=a,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==et.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const t=this.sourceImage_.getState();if(t==et.LOADED){const i=xt(this.targetExtent_)/this.targetResolution_,n=ue(this.targetExtent_)/this.targetResolution_;this.canvas_=km(i,n,this.sourcePixelRatio_,ru(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=t,this.changed()}load(){if(this.state==et.IDLE){this.state=et.LOADING,this.changed();const t=this.sourceImage_.getState();t==et.LOADED||t==et.ERROR?this.reproject_():(this.sourceListenerKey_=_t(this.sourceImage_,at.CHANGE,i=>{const n=this.sourceImage_.getState();(n==et.LOADED||n==et.ERROR)&&(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){Tt(this.sourceListenerKey_),this.sourceListenerKey_=null}}const ur=4,oc={IMAGELOADSTART:"imageloadstart",IMAGELOADEND:"imageloadend",IMAGELOADERROR:"imageloaderror"};class nT extends ii{constructor(t,i){super(t),this.image=i}}class sT extends wf{constructor(t){super({attributions:t.attributions,projection:t.projection,state:t.state,interpolate:t.interpolate!==void 0?t.interpolate:!0}),this.on,this.once,this.un,this.loader=t.loader||null,this.resolutions_=t.resolutions!==void 0?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=t.loader?t.loader.length===0:!1,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(t){this.resolutions_=t}findNearestResolution(t){const i=this.getResolutions();if(i){const n=Zl(i,t,0);t=i[n]}return t}getImage(t,i,n,s){const r=this.getProjection();if(!r||!s||pn(r,s))return r&&(s=r),this.getImageInternal(t,i,n,s);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&pn(this.reprojectedImage_.getProjection(),s)&&this.reprojectedImage_.getResolution()==i&&Pr(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new iT(r,s,t,i,n,(o,a,l)=>this.getImageInternal(o,a,l,r),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,i,n,s){if(this.loader){const r=rT(t,i,n,1),o=this.findNearestResolution(i);if(this.image&&(this.static_||this.wantedProjection_===s&&(this.wantedExtent_&&fn(this.wantedExtent_,r)||fn(this.image.getExtent(),r))&&(this.wantedResolution_&&ru(this.wantedResolution_)===o||ru(this.image.getResolution())===o)))return this.image;this.wantedProjection_=s,this.wantedExtent_=r,this.wantedResolution_=o,this.image=new $0(r,o,n,this.loader),this.image.addEventListener(at.CHANGE,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const i=t.target;let n;switch(i.getState()){case et.LOADING:this.loading=!0,n=oc.IMAGELOADSTART;break;case et.LOADED:this.loading=!1,n=oc.IMAGELOADEND;break;case et.ERROR:this.loading=!1,n=oc.IMAGELOADERROR;break;default:return}this.hasListener(n)&&this.dispatchEvent(new nT(n,i))}}function rT(e,t,i,n){const s=t/i,r=Ki(e),o=Vn(xt(e)/s,ur),a=Vn(ue(e)/s,ur),l=Vn((n-1)*o/2,ur),h=o+2*l,c=Vn((n-1)*a/2,ur),u=a+2*c;return ul(r,s,0,[h,u])}const ou="1.3.0";function oT(e,t,i,n,s){s.WIDTH=i[0],s.HEIGHT=i[1];const r=n.getAxisOrientation(),o=l0(s.VERSION,"1.3")>=0;s[o?"CRS":"SRS"]=n.getCode();const a=o&&r.startsWith("ne")?[t[1],t[0],t[3],t[2]]:t;return s.BBOX=a.join(","),Al(e,s)}function aT(e,t,i,n,s,r,o){r=Object.assign({REQUEST:"GetMap"},r);const a=t/i,l=[_d(xt(e)/a,ur),_d(ue(e)/a,ur)];if(i!=1)switch(o){case"geoserver":const c=90*i+.5|0;"FORMAT_OPTIONS"in r?r.FORMAT_OPTIONS+=";dpi:"+c:r.FORMAT_OPTIONS="dpi:"+c;break;case"mapserver":r.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":r.DPI=90*i;break;default:throw new Error("Unknown `serverType` configured")}return oT(s,e,l,n,r)}function Tg(e,t){return Object.assign({REQUEST:t,SERVICE:"WMS",VERSION:ou,FORMAT:"image/png",STYLES:"",TRANSPARENT:"TRUE"},e)}class Xm{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(pl(),{get:(t,i)=>{if(typeof pl()[i]=="function")return this.push_(i),this.pushMethodArgs_},set:(t,i,n)=>(this.push_(i,n),!0)})}push_(...t){const i=this.instructions_,n=this.zIndex+this.offset_;i[n]||(i[n]=[]),i[n].push(...t)}pushMethodArgs_=(...t)=>(this.push_(t),this);pushFunction(t){this.push_(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(i=>{for(let n=0,s=i.length;n<s;++n){const r=i[n];if(typeof r=="function"){r(t);continue}const o=i[++n];if(typeof t[r]=="function")t[r](...o);else{if(typeof o=="function"){t[r]=o(t);continue}t[r]=o}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const lT=5;class hT extends oa{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=lT}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return St()}getData(t){return null}prepareFrame(t){return St()}renderFrame(t,i){return St()}forEachFeatureAtCoordinate(t,i,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const i=t.target;(i.getState()===et.LOADED||i.getState()===et.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let i=t.getState();return i!=et.LOADED&&i!=et.ERROR&&t.addEventListener(at.CHANGE,this.boundHandleImageChange_),i==et.IDLE&&(t.load(),i=t.getState()),i==et.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const Rg=[];let sr=null;function cT(){sr=ae(1,1,void 0,{willReadFrequently:!0})}class $m extends hT{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=bi(),this.pixelTransform=bi(),this.inversePixelTransform=bi(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,i,n){sr||cT(),sr.clearRect(0,0,1,1);let s;try{sr.drawImage(t,i,n,1,1,0,0,1,1),s=sr.getImageData(0,0,1,1).data}catch{return sr=null,null}return s}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,i,n){const s=this.getLayer().getClassName();let r,o;if(t&&t.className===s&&(!n||t&&t.style.backgroundColor&&In(Ar(t.style.backgroundColor),Ar(n)))){const a=t.firstElementChild;$n(a)&&(o=a.getContext("2d"))}if(o&&Nv(o.canvas.style.transform,i)?(this.container=t,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){r=mi?O0():document.createElement("div"),r.className=s;let a=r.style;a.position="absolute",a.width="100%",a.height="100%",o=ae();const l=o.canvas;r.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=r,this.context=o}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,i,n){const s=zs(n),r=th(n),o=Ql(n),a=Jl(n);he(i.coordinateToPixelTransform,s),he(i.coordinateToPixelTransform,r),he(i.coordinateToPixelTransform,o),he(i.coordinateToPixelTransform,a);const l=this.inversePixelTransform;he(l,s),he(l,r),he(l,o),he(l,a),t.save(),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()}prepareContainer(t,i){const n=t.extent,s=t.viewState.resolution,r=t.viewState.rotation,o=t.pixelRatio,a=Math.round(xt(n)/s*o),l=Math.round(ue(n)/s*o);Cn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/o,1/o,r,-a/2,-l/2),m0(this.inversePixelTransform,this.pixelTransform);const h=Dv(this.pixelTransform);if(this.useContainer(i,h,this.getBackground(t)),!this.containerReused){const c=this.context.canvas;c.width!=a||c.height!=l?(c.width=a,c.height=l):this.context.clearRect(0,0,a,l),h!==c.style.transform&&(c.style.transform=h)}}dispatchRenderEvent_(t,i,n){const s=this.getLayer();if(s.hasListener(t)){const r=new nm(t,this.inversePixelTransform,n,i);s.dispatchEvent(r)}}preRender(t,i){this.frameState=i,!i.declutter&&this.dispatchRenderEvent_(pi.PRERENDER,t,i)}postRender(t,i){i.declutter||this.dispatchRenderEvent_(pi.POSTRENDER,t,i)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new Xm),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(pi.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(pi.POSTRENDER,this.context,t))}getRenderTransform(t,i,n,s,r,o,a){const l=r/2,h=o/2,c=s/i,u=-c,f=-t[0]+a,d=-t[1];return Cn(this.tempTransform,l,h,c,u,-n,f,d)}disposeInternal(){delete this.frameState,super.disposeInternal()}}function ac(e,t,i){if(!(i in e))return e[i]=new Set([t]),!0;const n=e[i],s=n.has(t);return s||n.add(t),!s}function uT(e,t,i){const n=e[i];return n?n.delete(t):!1}function Ig(e,t){const i=e.layerStatesArray[e.layerIndex];i.extent&&(t=Jn(t,dn(i.extent,e.viewState.projection)));const n=i.layer.getRenderSource();if(!n.getWrapX()){const s=n.getTileGridForProjection(e.viewState.projection).getExtent();s&&(t=Jn(t,s))}return t}class fT extends $m{constructor(t,i){super(t),i=i||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=ti(),this.tempTileRange_=new Sf(0,0,0,0),this.tempTileCoord_=bl(0,0,0);const n=i.cacheSize!==void 0?i.cacheSize:512;this.tileCache_=new vg(n),this.sourceTileCache_=null,this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||(this.sourceTileCache_=new vg(512)),this.sourceTileCache_}getOrCreateTile(t,i,n,s){const r=this.tileCache_,a=this.getLayer().getSource(),l=Qa(a,a.getKey(),t,i,n);let h;if(r.containsKey(l))h=r.get(l);else{const c=s.viewState.projection,u=a.getProjection();if(h=a.getTile(t,i,n,s.pixelRatio,c,!u||pn(u,c)?void 0:this.getSourceTileCache()),!h)return null;r.set(l,h)}return h}getTile(t,i,n,s){const r=this.getOrCreateTile(t,i,n,s);return r||null}getData(t){const i=this.frameState;if(!i)return null;const n=this.getLayer(),s=he(i.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!Ir(r,s))return null;const o=i.viewState,a=n.getRenderSource(),l=a.getTileGridForProjection(o.projection),h=a.getTilePixelRatio(i.pixelRatio);for(let c=l.getZForResolution(o.resolution);c>=l.getMinZoom();--c){const u=l.getTileCoordForCoordAndZ(s,c),f=this.getTile(c,u[1],u[2],i);if(!f||f.getState()!==nt.LOADED)continue;const d=l.getOrigin(c),g=Qe(l.getTileSize(c)),_=l.getResolution(c);let m;if(f instanceof Nm||f instanceof zm)m=f.getImage();else if(f instanceof Cg){if(m=su(f.getData()),!m)continue}else continue;const p=Math.floor(h*((s[0]-d[0])/_-u[1]*g[0])),y=Math.floor(h*((d[1]-s[1])/_-u[2]*g[1])),S=Math.round(h*a.getGutterForProjection(o.projection));return this.getImageData(m,p+S,y+S)}return null}prepareFrame(t){this.renderedProjection?t.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=t.viewState.projection):this.renderedProjection=t.viewState.projection;const i=this.getLayer().getSource();if(!i)return!1;const n=i.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==n&&(this.renderedSourceRevision_=n,this.renderedSourceKey_===i.getKey()&&(this.tileCache_.clear(),this.sourceTileCache_?.clear())):this.renderedSourceRevision_=n,!0}enqueueTilesForNextExtent(){return!0}enqueueTiles(t,i,n,s,r){const o=t.viewState,a=this.getLayer(),l=a.getRenderSource(),h=l.getTileGridForProjection(o.projection),c=ht(l);c in t.wantedTiles||(t.wantedTiles[c]={});const u=t.wantedTiles[c],f=a.getMapInternal(),d=Math.max(n-r,h.getMinZoom(),h.getZForResolution(Math.min(a.getMaxResolution(),f?f.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):h.getResolution(0)),l.zDirection)),g=o.rotation,_=g?s0(o.center,o.resolution,g,t.size):void 0;for(let m=n;m>=d;--m){const p=h.getTileRangeForExtentAndZ(i,m,this.tempTileRange_),y=h.getResolution(m);for(let S=p.minX;S<=p.maxX;++S)for(let v=p.minY;v<=p.maxY;++v){if(g&&!h.tileCoordIntersectsViewport([m,S,v],_))continue;const M=this.getTile(m,S,v,t);if(!M||!ac(s,M,m))continue;const P=M.getKey();if(u[P]=!0,M.getState()===nt.IDLE&&!t.tileQueue.isKeyQueued(P)){const b=bl(m,S,v,this.tempTileCoord_);t.tileQueue.enqueue([M,c,h.getTileCoordCenter(b),y])}}}}findStaleTile_(t,i){const n=this.tileCache_,s=t[0],r=t[1],o=t[2],a=this.getStaleKeys();for(let l=0;l<a.length;++l){const h=Qa(this.getLayer().getSource(),a[l],s,r,o);if(n.containsKey(h)){const c=n.peek(h);if(c.getState()===nt.LOADED)return c.endTransition(ht(this)),ac(i,c,s),!0}}return!1}findAltTiles_(t,i,n,s){const r=t.getTileRangeForTileCoordAndZ(i,n,this.tempTileRange_);if(!r)return!1;let o=!0;const a=this.tileCache_,l=this.getLayer().getRenderSource(),h=l.getKey();for(let c=r.minX;c<=r.maxX;++c)for(let u=r.minY;u<=r.maxY;++u){const f=Qa(l,h,n,c,u);let d=!1;if(a.containsKey(f)){const g=a.peek(f);g.getState()===nt.LOADED&&(ac(s,g,n),d=!0)}d||(o=!1)}return o}renderFrame(t,i){this.renderComplete=!0;const n=t.layerStatesArray[t.layerIndex],s=t.viewState,r=s.projection,o=s.resolution,a=s.center,l=t.pixelRatio,h=this.getLayer(),c=h.getSource(),u=c.getTileGridForProjection(r),f=u.getZForResolution(o,c.zDirection),d=u.getResolution(f),g=c.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==g&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=g):this.renderedSourceKey_=g;let _=t.extent;const m=c.getTilePixelRatio(l);this.prepareContainer(t,i);const p=this.context.canvas.width,y=this.context.canvas.height,S=n.extent&&dn(n.extent);S&&(_=Jn(_,dn(n.extent)));const v=d*p/2/m,M=d*y/2/m,C=[a[0]-v,a[1]-M,a[0]+v,a[1]+M],P={};this.renderedTiles.length=0;const b=h.getPreload();if(t.nextExtent&&this.enqueueTilesForNextExtent()){const X=u.getZForResolution(s.nextResolution,c.zDirection),rt=Ig(t,t.nextExtent);this.enqueueTiles(t,rt,X,P,b)}const T=Ig(t,_);if(this.enqueueTiles(t,T,f,P,0),b>0&&setTimeout(()=>{this.enqueueTiles(t,T,f-1,P,b-1)},0),!(f in P))return this.container;const k=ht(this),U=t.time;for(const X of P[f]){const rt=X.getState();if(rt===nt.EMPTY)continue;const ut=X.tileCoord;if(rt===nt.LOADED&&X.getAlpha(k,U)===1){X.endTransition(k);continue}if(rt!==nt.ERROR&&(this.renderComplete=!1),this.findStaleTile_(ut,P)){uT(P,X,f),t.animate=!0;continue}if(this.findAltTiles_(u,ut,f+1,P))continue;const Ht=u.getMinZoom();for(let se=f-1;se>=Ht&&!this.findAltTiles_(u,ut,se,P);--se);}const A=d/o*l/m,L=this.getRenderContext(t);Cn(this.tempTransform,p/2,y/2,A,A,0,-p/2,-y/2),n.extent&&this.clipUnrotated(L,t,S),c.getInterpolate()||(L.imageSmoothingEnabled=!1),this.preRender(L,t);const V=Object.keys(P).map(Number);V.sort(gn);let tt;const $=[],K=[];for(let X=V.length-1;X>=0;--X){const rt=V[X],ut=c.getTilePixelSize(rt,l,r),B=u.getResolution(rt)/d,Ht=ut[0]*B*A,se=ut[1]*B*A,Gt=u.getTileCoordForCoordAndZ(zs(C),rt),$t=u.getTileCoordExtent(Gt),Kt=he(this.tempTransform,[m*($t[0]-C[0])/d,m*(C[3]-$t[3])/d]),me=m*c.getGutterForProjection(r);for(const pe of P[rt]){if(pe.getState()!==nt.LOADED)continue;const Z=pe.tileCoord,Zt=Gt[1]-Z[1],E=Math.round(Kt[0]-(Zt-1)*Ht),w=Gt[2]-Z[2],O=Math.round(Kt[1]-(w-1)*se),j=Math.round(Kt[0]-Zt*Ht),N=Math.round(Kt[1]-w*se),x=E-j,I=O-N,R=V.length===1;let F=!1;tt=[j,N,j+x,N,j+x,N+I,j,N+I];for(let G=0,q=$.length;G<q;++G)if(!R&&rt<K[G]){const z=$[G];Fe([j,N,j+x,N+I],[z[0],z[3],z[4],z[7]])&&(F||(L.save(),F=!0),L.beginPath(),L.moveTo(tt[0],tt[1]),L.lineTo(tt[2],tt[3]),L.lineTo(tt[4],tt[5]),L.lineTo(tt[6],tt[7]),L.moveTo(z[6],z[7]),L.lineTo(z[4],z[5]),L.lineTo(z[2],z[3]),L.lineTo(z[0],z[1]),L.clip())}$.push(tt),K.push(rt),this.drawTile(pe,t,j,N,x,I,me,R),F&&L.restore(),this.renderedTiles.unshift(pe),this.updateUsedTiles(t.usedTiles,c,pe)}}if(this.renderedResolution=d,this.extentChanged=!this.renderedExtent_||!Pr(this.renderedExtent_,C),this.renderedExtent_=C,this.renderedPixelRatio=l,this.postRender(this.context,t),n.extent&&L.restore(),L.imageSmoothingEnabled=!0,this.renderComplete){const X=(rt,ut)=>{const mt=ht(c),B=ut.wantedTiles[mt],Ht=B?Object.keys(B).length:0;this.updateCacheSize(Ht),this.tileCache_.expireCache(),this.sourceTileCache_?.expireCache()};t.postRenderFunctions.push(X)}return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,i,n,s,r,o,a,l){let h;if(t instanceof Cg){if(h=su(t.getData()),!h)throw new Error("Rendering array data is not yet supported")}else h=this.getTileImage(t);if(!h)return;const c=this.getRenderContext(i),u=ht(this),f=i.layerStatesArray[i.layerIndex],d=f.opacity*(l?t.getAlpha(u,i.time):1),g=d!==c.globalAlpha;g&&(c.save(),c.globalAlpha=d),c.drawImage(h,a,a,h.width-2*a,h.height-2*a,n,s,r,o),g&&c.restore(),d!==f.opacity?i.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,i,n){const s=ht(i);s in t||(t[s]={}),t[s][n.getKey()]=!0}}const Oa={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class dT extends ch{constructor(t){t=t||{};const i=Object.assign({},t),n=t.cacheSize;delete t.cacheSize,delete i.preload,delete i.useInterimTilesOnError,super(i),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Oa.PRELOAD)}setPreload(t){this.set(Oa.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(Oa.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(Oa.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}class gT extends dT{constructor(t){super(t)}createRenderer(){return new fT(this,{cacheSize:this.getCacheSize()})}}class _T extends Um{constructor(t){t=t||{};const i=Object.assign({},t.params);super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0,this.params_=i,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=t.hidpi!==void 0?t.hidpi:!0,this.tmpExtent_=ti(),this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(t,i,n,s){const r=Yt(n),o=this.getProjection()||r;let a=this.getTileGrid();a||(a=this.getTileGridForProjection(o));const l=Nu(t,r,o),h=Ll(o,r,t,i),c=a.getZForResolution(h,this.zDirection),u=a.getResolution(c),f=a.getTileCoordForCoordAndZ(l,c);if(a.getResolutions().length<=f[0])return;let d=a.getTileCoordExtent(f,this.tmpExtent_);const g=this.gutter_;g!==0&&(d=bs(d,u*g,d));const _={QUERY_LAYERS:this.params_.LAYERS};Object.assign(_,Tg(this.params_,"GetFeatureInfo"),s);const m=Math.floor((l[0]-d[0])/u),p=Math.floor((d[3]-l[1])/u);return _[this.v13_?"I":"X"]=m,_[this.v13_?"J":"Y"]=p,this.getRequestUrl_(f,d,1,o||r,_)}getLegendUrl(t,i){if(this.urls[0]===void 0)return;const n={SERVICE:"WMS",VERSION:ou,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(i===void 0||i.LAYER===void 0){const s=this.params_.LAYERS;if(!(!Array.isArray(s)||s.length===1))return;n.LAYER=s}if(t!==void 0){const s=this.getProjection()?this.getProjection().getMetersPerUnit():1,r=28e-5;n.SCALE=t*s/r}return Object.assign(n,i),Al(this.urls[0],n)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,i,n,s,r){const o=this.urls;if(!o)return;let a;if(o.length==1)a=o[0];else{const l=ts(Lm(t),o.length);a=o[l]}return aT(i,(this.tileGrid||this.getTileGridForProjection(s)).getResolution(t[0]),n,s,a,r,this.serverType_)}getTilePixelRatio(t){return!this.hidpi_||this.serverType_===void 0?1:t}getKeyForParams_(){let t=0;const i=[];for(const n in this.params_)i[t++]=n+"-"+this.params_[n];return i.join("/")}setParams_(t){this.params_=t,this.updateV13_(),this.setKey(this.getKeyForParams_())}setParams(t){this.setParams_(Object.assign({},t))}updateParams(t){this.setParams_(Object.assign(this.params_,t))}updateV13_(){const t=this.params_.VERSION||ou;this.v13_=l0(t,"1.3")>=0}tileUrlFunction(t,i,n){let s=this.getTileGrid();if(s||(s=this.getTileGridForProjection(n)),s.getResolutions().length<=t[0])return;i!=1&&(!this.hidpi_||this.serverType_===void 0)&&(i=1);const r=s.getResolution(t[0]);let o=s.getTileCoordExtent(t,this.tmpExtent_);const a=this.gutter_;a!==0&&(o=bs(o,r*a,o));const l=Object.assign({},Tg(this.params_,"GetMap"));return this.getRequestUrl_(t,o,i,n,l)}}class mT extends Um{constructor(t){const i=t.requestEncoding!==void 0?t.requestEncoding:"KVP",n=t.tileGrid;let s=t.urls;s===void 0&&t.url!==void 0&&(s=Dm(t.url)),super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:s,wrapX:t.wrapX!==void 0?t.wrapX:!1,transition:t.transition,zDirection:t.zDirection}),this.version_=t.version!==void 0?t.version:"1.0.0",this.format_=t.format!==void 0?t.format:"image/jpeg",this.dimensions_=t.dimensions!==void 0?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=i,this.setKey(this.getKeyForDimensions_()),s&&s.length>0&&(this.tileUrlFunction=iu(s.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const i=t.join(`
|
|
8
|
-
`);this.setTileUrlFunction(iu(t.map(this.createFromWMTSTemplate.bind(this))),i)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){const t=this.urls?this.urls.slice(0):[];for(const i in this.dimensions_)t.push(i+"-"+this.dimensions_[i]);return t.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const i=this.requestEncoding_,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};i=="KVP"&&Object.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=i=="KVP"?Al(t,n):t.replace(/\{(\w+?)\}/g,function(o,a){return a.toLowerCase()in n?n[a.toLowerCase()]:o});const s=this.tileGrid,r=this.dimensions_;return(function(o,a,l){if(!o)return;const h={TileMatrix:s.getMatrixId(o[0]),TileCol:o[1],TileRow:o[2]};Object.assign(h,r);let c=t;return i=="KVP"?c=Al(c,h):c=c.replace(/\{(\w+?)\}/g,function(u,f){return encodeURIComponent(h[f])}),c})}}function pT(e,t){const n=e.Contents.Layer?.find(function(L){return L.Identifier==t.layer});if(!n)return null;const s=e.Contents.TileMatrixSet;let r;n.TileMatrixSetLink.length>1?"projection"in t?r=n.TileMatrixSetLink.findIndex(function(L){const tt=s.find(function(X){return X.Identifier==L.TileMatrixSet}).SupportedCRS,$=Yt(tt),K=Yt(t.projection);return $&&K?pn($,K):tt==t.projection}):r=n.TileMatrixSetLink.findIndex(function(L){return L.TileMatrixSet==t.matrixSet}):r=0,r<0&&(r=0);const o=n.TileMatrixSetLink[r].TileMatrixSet,a=n.TileMatrixSetLink[r].TileMatrixSetLimits;let l=n.Format[0];"format"in t&&(l=t.format),r=n.Style.findIndex(function(L){return"style"in t?L.Title==t.style:L.isDefault}),r<0&&(r=0);const h=n.Style[r].Identifier,c={};"Dimension"in n&&n.Dimension.forEach(function(L,V,tt){const $=L.Identifier;let K=L.Default;K===void 0&&(K=L.Value[0]),c[$]=K});const f=e.Contents.TileMatrixSet.find(function(L){return L.Identifier==o});let d;const g=f.SupportedCRS;if(g&&(d=Yt(g)),"projection"in t){const L=Yt(t.projection);L&&(!d||pn(L,d))&&(d=L)}let _=!1;const m=d.getAxisOrientation().startsWith("ne");let p=f.TileMatrix[0],y={MinTileCol:0,MinTileRow:0,MaxTileCol:p.MatrixWidth-1,MaxTileRow:p.MatrixHeight-1};if(a){y=a[a.length-1];const L=f.TileMatrix.find(V=>V.Identifier===y.TileMatrix||f.Identifier+":"+V.Identifier===y.TileMatrix);L&&(p=L)}const S=n.BoundingBox?.find(L=>Yt(L.crs)&&pn(Yt(L.crs),d)),v=p.ScaleDenominator*28e-5/d.getMetersPerUnit(),M=m?[p.TopLeftCorner[1],p.TopLeftCorner[0]]:p.TopLeftCorner,C=p.TileWidth*v,P=p.TileHeight*v;let b=S?.extent??f.BoundingBox;b&&m&&(b=[b[1],b[0],b[3],b[2]]);let T=[M[0]+C*y.MinTileCol,M[1]-P*(1+y.MaxTileRow),M[0]+C*(1+y.MaxTileCol),M[1]-P*y.MinTileRow];if(b!==void 0&&!fn(b,T)){const L=n.WGS84BoundingBox,V=Yt("EPSG:4326").getExtent();if(T=b,L)_=L[0]===V[0]&&L[2]===V[2];else{const tt=Av(b,f.SupportedCRS,"EPSG:4326");_=tt[0]-1e-10<=V[0]&&tt[2]+1e-10>=V[2]}}const k=L4(f,T,a),U=[];let A=t.requestEncoding;if(A=A!==void 0?A:"","OperationsMetadata"in e&&"GetTile"in e.OperationsMetadata){const L=e.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let V=0,tt=L.length;V<tt;++V)if(L[V].Constraint){const K=L[V].Constraint.find(function(X){return X.name=="GetEncoding"}).AllowedValues.Value;if(A===""&&(A=K[0]),A==="KVP")K.includes("KVP")&&U.push(L[V].href);else break}else L[V].href&&(A="KVP",U.push(L[V].href))}return U.length===0&&(A="REST",n.ResourceURL.forEach(function(L){L.resourceType==="tile"&&(l=L.format,U.push(L.template))})),{urls:U,layer:t.layer,matrixSet:o,format:l,projection:d,requestEncoding:A,tileGrid:k,style:h,dimensions:c,wrapX:_,crossOrigin:t.crossOrigin}}class Km{drawCustom(t,i,n,s,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,i,n){}drawFeature(t,i,n){}drawGeometryCollection(t,i,n){}drawLineString(t,i,n){}drawMultiLineString(t,i,n){}drawMultiPoint(t,i,n){}drawMultiPolygon(t,i,n){}drawPoint(t,i,n){}drawPolygon(t,i,n){}drawText(t,i,n){}setFillStrokeStyle(t,i){}setImageStyle(t,i){}setTextStyle(t,i){}}const st={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},Fa=[st.FILL],Yn=[st.STROKE],Is=[st.BEGIN_PATH],Pg=[st.CLOSE_PATH];class _a extends Km{constructor(t,i,n,s){super(),this.tolerance=t,this.maxExtent=i,this.pixelRatio=s,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const i=this.pixelRatio;return i==1?t:t.map(function(n){return n*i})}appendFlatPointCoordinates(t,i){const n=this.getBufferedMaxExtent(),s=this.tmpCoordinate_,r=this.coordinates;let o=r.length;for(let a=0,l=t.length;a<l;a+=i)s[0]=t[a],s[1]=t[a+1],Ir(n,s)&&(r[o++]=s[0],r[o++]=s[1]);return o}appendFlatLineCoordinates(t,i,n,s,r,o){const a=this.coordinates;let l=a.length;const h=this.getBufferedMaxExtent();o&&(i+=s);let c=t[i],u=t[i+1];const f=this.tmpCoordinate_;let d=!0,g,_,m;for(g=i+s;g<n;g+=s)f[0]=t[g],f[1]=t[g+1],m=Pc(h,f),m!==_?(d&&(a[l++]=c,a[l++]=u,d=!1),a[l++]=f[0],a[l++]=f[1]):m===le.INTERSECTING?(a[l++]=f[0],a[l++]=f[1],d=!1):d=!0,c=f[0],u=f[1],_=m;return(r&&d||g===i+s)&&(a[l++]=c,a[l++]=u),l}drawCustomCoordinates_(t,i,n,s,r){for(let o=0,a=n.length;o<a;++o){const l=n[o],h=this.appendFlatLineCoordinates(t,i,l,s,!1,!1);r.push(h),i=l}return i}drawCustom(t,i,n,s,r){this.beginGeometry(t,i,r);const o=t.getType(),a=t.getStride(),l=this.coordinates.length;let h,c,u,f,d;switch(o){case"MultiPolygon":h=t.getOrientedFlatCoordinates(),f=[];const g=t.getEndss();d=0;for(let _=0,m=g.length;_<m;++_){const p=[];d=this.drawCustomCoordinates_(h,d,g[_],a,p),f.push(p)}this.instructions.push([st.CUSTOM,l,f,t,n,Nc,r]),this.hitDetectionInstructions.push([st.CUSTOM,l,f,t,s||n,Nc,r]);break;case"Polygon":case"MultiLineString":u=[],h=o=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),d=this.drawCustomCoordinates_(h,0,t.getEnds(),a,u),this.instructions.push([st.CUSTOM,l,u,t,n,zo,r]),this.hitDetectionInstructions.push([st.CUSTOM,l,u,t,s||n,zo,r]);break;case"LineString":case"Circle":h=t.getFlatCoordinates(),c=this.appendFlatLineCoordinates(h,0,h.length,a,!1,!1),this.instructions.push([st.CUSTOM,l,c,t,n,Xn,r]),this.hitDetectionInstructions.push([st.CUSTOM,l,c,t,s||n,Xn,r]);break;case"MultiPoint":h=t.getFlatCoordinates(),c=this.appendFlatPointCoordinates(h,a),c>l&&(this.instructions.push([st.CUSTOM,l,c,t,n,Xn,r]),this.hitDetectionInstructions.push([st.CUSTOM,l,c,t,s||n,Xn,r]));break;case"Point":h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),c=this.coordinates.length,this.instructions.push([st.CUSTOM,l,c,t,n,void 0,r]),this.hitDetectionInstructions.push([st.CUSTOM,l,c,t,s||n,void 0,r]);break}this.endGeometry(i)}beginGeometry(t,i,n){this.beginGeometryInstruction1_=[st.BEGIN_GEOMETRY,i,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[st.BEGIN_GEOMETRY,i,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let i;const n=t.length;let s,r,o=-1;for(i=0;i<n;++i)s=t[i],r=s[0],r==st.END_GEOMETRY?o=i:r==st.BEGIN_GEOMETRY&&(s[2]=i,zy(this.hitDetectionInstructions,o,i),o=-1)}fillStyleToState(t,i={}){if(t){const n=t.getColor();i.fillPatternScale=n&&typeof n=="object"&&"src"in n?this.pixelRatio:1,i.fillStyle=Ui(n||Ye)}else i.fillStyle=void 0;return i}strokeStyleToState(t,i={}){if(t){const n=t.getColor();i.strokeStyle=Ui(n||Vo);const s=t.getLineCap();i.lineCap=s!==void 0?s:Lr;const r=t.getLineDash();i.lineDash=r?r.slice():vn;const o=t.getLineDashOffset();i.lineDashOffset=o||xn;const a=t.getLineJoin();i.lineJoin=a!==void 0?a:Or;const l=t.getWidth();i.lineWidth=l!==void 0?l:$o;const h=t.getMiterLimit();i.miterLimit=h!==void 0?h:Uo,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0;return i}setFillStrokeStyle(t,i){const n=this.state;this.fillStyleToState(t,n),this.strokeStyleToState(i,n)}createFill(t){const i=t.fillStyle,n=[st.SET_FILL_STYLE,i];return typeof i!="string"&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[st.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,t.lineDash?this.applyPixelRatio(t.lineDash):null,t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,i){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(this.instructions.push(i.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,i){const n=t.strokeStyle,s=t.lineCap,r=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=s||r!=t.currentLineDash&&!In(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(i.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=s,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=h)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const i=[st.END_GEOMETRY,t];this.instructions.push(i),this.hitDetectionInstructions.push(i)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=e0(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;bs(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class yT extends _a{constructor(t,i,n,s){super(t,i,n,s),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,i,n){if(!this.image_||this.maxExtent&&!Ir(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,i,n);const s=t.getFlatCoordinates(),r=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,r);this.instructions.push([st.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([st.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(i)}drawMultiPoint(t,i,n){if(!this.image_)return;this.beginGeometry(t,i,n);const s=t.getFlatCoordinates(),r=[];for(let l=0,h=s.length;l<h;l+=t.getStride())(!this.maxExtent||Ir(this.maxExtent,s.slice(l,l+2)))&&r.push(s[l],s[l+1]);const o=this.coordinates.length,a=this.appendFlatPointCoordinates(r,2);this.instructions.push([st.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([st.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(i)}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(t,i){const n=t.getAnchor(),s=t.getSize(),r=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=s[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=s[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=i}}class vT extends _a{constructor(t,i,n,s){super(t,i,n,s)}drawFlatCoordinates_(t,i,n,s){const r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,i,n,s,!1,!1),a=[st.MOVE_TO_LINE_TO,r,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),n}drawLineString(t,i,n){const s=this.state,r=s.strokeStyle,o=s.lineWidth;if(r===void 0||o===void 0)return;this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,i,n),this.hitDetectionInstructions.push([st.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,vn,xn],Is);const a=t.getFlatCoordinates(),l=t.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(Yn),this.endGeometry(i)}drawMultiLineString(t,i,n){const s=this.state,r=s.strokeStyle,o=s.lineWidth;if(r===void 0||o===void 0)return;this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,i,n),this.hitDetectionInstructions.push([st.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,vn,xn],Is);const a=t.getEnds(),l=t.getFlatCoordinates(),h=t.getStride();let c=0;for(let u=0,f=a.length;u<f;++u)c=this.drawFlatCoordinates_(l,c,a[u],h);this.hitDetectionInstructions.push(Yn),this.endGeometry(i)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(Yn),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(Yn),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(Is)}}class bg extends _a{constructor(t,i,n,s){super(t,i,n,s)}drawFlatCoordinatess_(t,i,n,s){const r=this.state,o=r.fillStyle!==void 0,a=r.strokeStyle!==void 0,l=n.length;this.instructions.push(Is),this.hitDetectionInstructions.push(Is);for(let h=0;h<l;++h){const c=n[h],u=this.coordinates.length,f=this.appendFlatLineCoordinates(t,i,c,s,!0,!a),d=[st.MOVE_TO_LINE_TO,u,f];this.instructions.push(d),this.hitDetectionInstructions.push(d),a&&(this.instructions.push(Pg),this.hitDetectionInstructions.push(Pg)),i=c}return o&&(this.instructions.push(Fa),this.hitDetectionInstructions.push(Fa)),a&&(this.instructions.push(Yn),this.hitDetectionInstructions.push(Yn)),i}drawCircle(t,i,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,i,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([st.SET_FILL_STYLE,Ye]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([st.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,vn,xn]);const a=t.getFlatCoordinates(),l=t.getStride(),h=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,l,!1,!1);const c=[st.CIRCLE,h];this.instructions.push(Is,c),this.hitDetectionInstructions.push(Is,c),s.fillStyle!==void 0&&(this.instructions.push(Fa),this.hitDetectionInstructions.push(Fa)),s.strokeStyle!==void 0&&(this.instructions.push(Yn),this.hitDetectionInstructions.push(Yn)),this.endGeometry(i)}drawPolygon(t,i,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,i,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([st.SET_FILL_STYLE,Ye]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([st.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,vn,xn]);const a=t.getEnds(),l=t.getOrientedFlatCoordinates(),h=t.getStride();this.drawFlatCoordinatess_(l,0,a,h),this.endGeometry(i)}drawMultiPolygon(t,i,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,i,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([st.SET_FILL_STYLE,Ye]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([st.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,vn,xn]);const a=t.getEndss(),l=t.getOrientedFlatCoordinates(),h=t.getStride();let c=0;for(let u=0,f=a.length;u<f;++u)c=this.drawFlatCoordinatess_(l,c,a[u],h);this.endGeometry(i)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const i=this.coordinates;for(let n=0,s=i.length;n<s;++n)i[n]=Es(i[n],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;this.updateFillStyle(t,this.createFill),this.updateStrokeStyle(t,this.applyStroke)}}function xT(e,t,i,n,s){const r=[];let o=i,a=0,l=t.slice(i,2);for(;a<e&&o+s<n;){const[h,c]=l.slice(-2),u=t[o+s],f=t[o+s+1],d=Math.sqrt((u-h)*(u-h)+(f-c)*(f-c));if(a+=d,a>=e){const g=(e-a+d)/d,_=oi(h,u,g),m=oi(c,f,g);l.push(_,m),r.push(l),l=[_,m],a==e&&(o+=s),a=0}else if(a<e)l.push(t[o+s],t[o+s+1]),o+=s;else{const g=d-a,_=oi(h,u,g/d),m=oi(c,f,g/d);l.push(_,m),r.push(l),l=[_,m],a=0,o+=s}}return a>0&&r.push(l),r}function ET(e,t,i,n,s){let r=i,o=i,a=0,l=0,h=i,c,u,f,d,g,_,m,p,y,S;for(u=i;u<n;u+=s){const v=t[u],M=t[u+1];g!==void 0&&(y=v-g,S=M-_,d=Math.sqrt(y*y+S*S),m!==void 0&&(l+=f,c=Math.acos((m*y+p*S)/(f*d)),c>e&&(l>a&&(a=l,r=h,o=u),l=0,h=u-s)),f=d,m=y,p=S),g=v,_=M}return l+=d,l>a?[h,u]:[r,o]}const Dl={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class ST extends _a{constructor(t,i,n,s){super(t,i,n,s),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[Ye]={fillStyle:Ye},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,i,n){const s=this.textFillState_,r=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!s&&!r)return;const a=this.coordinates;let l=a.length;const h=t.getType();let c=null,u=t.getStride();if(o.placement==="line"&&(h=="LineString"||h=="MultiLineString"||h=="Polygon"||h=="MultiPolygon")){if(!Fe(this.maxExtent,t.getExtent()))return;let f;if(c=t.getFlatCoordinates(),h=="LineString")f=[c.length];else if(h=="MultiLineString")f=t.getEnds();else if(h=="Polygon")f=t.getEnds().slice(0,1);else if(h=="MultiPolygon"){const m=t.getEndss();f=[];for(let p=0,y=m.length;p<y;++p)f.push(m[p][0])}this.beginGeometry(t,i,n);const d=o.repeat,g=d?void 0:o.textAlign;let _=0;for(let m=0,p=f.length;m<p;++m){let y;d?y=xT(d*this.resolution,c,_,f[m],u):y=[c.slice(_,f[m])];for(let S=0,v=y.length;S<v;++S){const M=y[S];let C=0,P=M.length;if(g==null){const T=ET(o.maxAngle,M,0,M.length,2);C=T[0],P=T[1]}for(let T=C;T<P;T+=u)a.push(M[T],M[T+1]);const b=a.length;_=f[m],this.drawChars_(l,b),l=b}}this.endGeometry(i)}else{let f=o.overflow?null:[];switch(h){case"Point":case"MultiPoint":c=t.getFlatCoordinates();break;case"LineString":c=t.getFlatMidpoint();break;case"Circle":c=t.getCenter();break;case"MultiLineString":c=t.getFlatMidpoints(),u=2;break;case"Polygon":c=t.getFlatInteriorPoint(),o.overflow||f.push(c[2]/this.resolution),u=3;break;case"MultiPolygon":const v=t.getFlatInteriorPoints();c=[];for(let M=0,C=v.length;M<C;M+=3)o.overflow||f.push(v[M+2]/this.resolution),c.push(v[M],v[M+1]);if(c.length===0)return;u=2;break}const d=this.appendFlatPointCoordinates(c,u);if(d===l)return;if(f&&(d-l)/2!==c.length/u){let v=l/2;f=f.filter((M,C)=>{const P=a[(v+C)*2]===c[C*u]&&a[(v+C)*2+1]===c[C*u+1];return P||--v,P})}this.saveTextStates_();const g=o.backgroundFill?this.createFill(this.fillStyleToState(o.backgroundFill)):null,_=o.backgroundStroke?this.createStroke(this.strokeStyleToState(o.backgroundStroke)):null;this.beginGeometry(t,i,n);let m=o.padding;if(m!=Rs&&(o.scale[0]<0||o.scale[1]<0)){let v=o.padding[0],M=o.padding[1],C=o.padding[2],P=o.padding[3];o.scale[0]<0&&(M=-M,P=-P),o.scale[1]<0&&(v=-v,C=-C),m=[v,M,C,P]}const p=this.pixelRatio;this.instructions.push([st.DRAW_IMAGE,l,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,m==Rs?Rs:m.map(function(v){return v*p}),g,_,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]);const y=1/p,S=g?g.slice(0):null;S&&(S[1]=Ye),this.hitDetectionInstructions.push([st.DRAW_IMAGE,l,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[y,y],NaN,this.declutterMode_,this.declutterImageWithText_,m,S,_,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Ye:this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]),this.endGeometry(i)}}saveTextStates_(){const t=this.textStrokeState_,i=this.textState_,n=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:i.font,textAlign:i.textAlign||Xo,justify:i.justify,textBaseline:i.textBaseline||El,scale:i.scale});const o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))}drawChars_(t,i){const n=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,h=Dl[s.textBaseline],c=this.textOffsetY_*l,u=this.text_,f=n?n.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([st.DRAW_CHARS,t,i,h,s.overflow,a,s.maxAngle,l,c,r,f*l,u,o,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([st.DRAW_CHARS,t,i,h,s.overflow,a&&Ye,s.maxAngle,l,c,r,f*l,u,o,1/l,this.declutterMode_,this.textKeepUpright_])}setTextStyle(t,i){let n,s,r;if(!t)this.text_="";else{const o=t.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=Ui(o.getColor()||Ye)):(s=null,this.textFillState_=s);const a=t.getStroke();if(!a)r=null,this.textStrokeState_=r;else{r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const _=a.getLineDash(),m=a.getLineDashOffset(),p=a.getWidth(),y=a.getMiterLimit();r.lineCap=a.getLineCap()||Lr,r.lineDash=_?_.slice():vn,r.lineDashOffset=m===void 0?xn:m,r.lineJoin=a.getLineJoin()||Or,r.lineWidth=p===void 0?$o:p,r.miterLimit=y===void 0?Uo:y,r.strokeStyle=Ui(a.getColor()||Vo)}n=this.textState_;const l=t.getFont()||Y0;JE(l);const h=t.getScaleArray();n.overflow=t.getOverflow(),n.font=l,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||El,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Rs,n.scale=h===void 0?[1,1]:h;const c=t.getOffsetX(),u=t.getOffsetY(),f=t.getRotateWithView(),d=t.getKeepUpright(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=f===void 0?!1:f,this.textKeepUpright_=d===void 0?!0:d,this.textRotation_=g===void 0?0:g,this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:ht(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?typeof s.fillStyle=="string"?s.fillStyle:"|"+ht(s.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=i}}const MT={Circle:bg,Default:_a,Image:yT,LineString:vT,Polygon:bg,Text:ST};class wT{constructor(t,i,n,s){this.tolerance_=t,this.maxExtent_=i,this.pixelRatio_=s,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const i in this.buildersByZIndex_){t[i]=t[i]||{};const n=this.buildersByZIndex_[i];for(const s in n){const r=n[s].finish();t[i][s]=r}}return t}getBuilder(t,i){const n=t!==void 0?t.toString():"0";let s=this.buildersByZIndex_[n];s===void 0&&(s={},this.buildersByZIndex_[n]=s);let r=s[i];if(r===void 0){const o=MT[i];r=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[i]=r}return r}}function CT(e,t,i,n,s,r,o,a,l,h,c,u,f=!0){let d=e[t],g=e[t+1],_=0,m=0,p=0,y=0;function S(){_=d,m=g,t+=n,d=e[t],g=e[t+1],y+=p,p=Math.sqrt((d-_)*(d-_)+(g-m)*(g-m))}do S();while(t<i-n&&y+p<r);let v=p===0?0:(r-y)/p;const M=oi(_,d,v),C=oi(m,g,v),P=t-n,b=y,T=r+a*l(h,s,c);for(;t<i-n&&y+p<T;)S();v=p===0?0:(T-y)/p;const k=oi(_,d,v),U=oi(m,g,v);let A=!1;if(f)if(u){const K=[M,C,k,U];ku(K,0,4,2,u,K,K),A=K[0]>K[2]}else A=M>k;const L=Math.PI,V=[],tt=P+n===t;t=P,p=0,y=b,d=e[t],g=e[t+1];let $;if(tt){S(),$=Math.atan2(g-m,d-_),A&&($+=$>0?-L:L);const K=(k+M)/2,X=(U+C)/2;return V[0]=[K,X,(T-r)/2,$,s],V}s=s.replace(/\n/g," ");for(let K=0,X=s.length;K<X;){S();let rt=Math.atan2(g-m,d-_);if(A&&(rt+=rt>0?-L:L),$!==void 0){let Gt=rt-$;if(Gt+=Gt>L?-2*L:Gt<-L?2*L:0,Math.abs(Gt)>o)return null}$=rt;const ut=K;let mt=0;for(;K<X;++K){const Gt=A?X-K-1:K,$t=a*l(h,s[Gt],c);if(t+n<i&&y+p<r+mt+$t/2)break;mt+=$t}if(K===ut)continue;const B=A?s.substring(X-ut,X-K):s.substring(ut,K);v=p===0?0:(r+mt/2-y)/p;const Ht=oi(_,d,v),se=oi(m,g,v);V.push([Ht,se,mt/2,rt,B]),r+=mt}return V}const Zs=ti(),Nn=[],nn=[],sn=[],kn=[];function Ag(e){return e[3].declutterBox}const Lg=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ--]");function lc(e,t){return t==="start"?t=Lg.test(e)?"right":"left":t==="end"&&(t=Lg.test(e)?"left":"right"),Dl[t]}function TT(e,t,i){return i>0&&e.push(`
|
|
9
|
-
`,""),e.push(t,""),e}function RT(e,t,i){return i%2===0&&(e+=t),e}class IT{constructor(t,i,n,s,r){this.overlaps=n,this.pixelRatio=i,this.resolution=t,this.alignAndScaleFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=bi(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new Xm:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,i,n,s){const r=t+i+n+s;if(this.labels_[r])return this.labels_[r];const o=s?this.strokeStates[s]:null,a=n?this.fillStates[n]:null,l=this.textStates[i],h=this.pixelRatio,c=[l.scale[0]*h,l.scale[1]*h],u=l.justify?Dl[l.justify]:lc(Array.isArray(t)?t[0]:t,l.textAlign||Xo),f=s&&o.lineWidth?o.lineWidth:0,d=Array.isArray(t)?t:String(t).split(`
|
|
10
|
-
`).reduce(TT,[]),{width:g,height:_,widths:m,heights:p,lineWidths:y}=tS(l,d),S=g+f,v=[],M=(S+2)*c[0],C=(_+f)*c[1],P={width:M<0?Math.floor(M):Math.ceil(M),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:v};(c[0]!=1||c[1]!=1)&&v.push("scale",c),s&&(v.push("strokeStyle",o.strokeStyle),v.push("lineWidth",f),v.push("lineCap",o.lineCap),v.push("lineJoin",o.lineJoin),v.push("miterLimit",o.miterLimit),v.push("setLineDash",[o.lineDash]),v.push("lineDashOffset",o.lineDashOffset)),n&&v.push("fillStyle",a.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");const b=.5-u;let T=u*S+b*f;const k=[],U=[];let A=0,L=0,V=0,tt=0,$;for(let K=0,X=d.length;K<X;K+=2){const rt=d[K];if(rt===`
|
|
11
|
-
`){L+=A,A=0,T=u*S+b*f,++tt;continue}const ut=d[K+1]||l.font;ut!==$&&(s&&k.push("font",ut),n&&U.push("font",ut),$=ut),A=Math.max(A,p[V]);const mt=[rt,T+b*m[V]+u*(m[V]-y[tt]),.5*(f+A)+L];T+=m[V],s&&k.push("strokeText",mt),n&&U.push("fillText",mt),++V}return Array.prototype.push.apply(v,k),Array.prototype.push.apply(v,U),this.labels_[r]=P,P}replayTextBackground_(t,i,n,s,r,o,a){t.beginPath(),t.moveTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,s),t.lineTo.apply(t,r),t.lineTo.apply(t,i),o&&(this.alignAndScaleFill_=o[2],t.fillStyle=o[1],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())}calculateImageOrLabelDimensions_(t,i,n,s,r,o,a,l,h,c,u,f,d,g,_,m){a*=f[0],l*=f[1];let p=n-a,y=s-l;const S=r+h>t?t-h:r,v=o+c>i?i-c:o,M=g[3]+S*f[0]+g[1],C=g[0]+v*f[1]+g[2],P=p-g[3],b=y-g[0];(_||u!==0)&&(Nn[0]=P,kn[0]=P,Nn[1]=b,nn[1]=b,nn[0]=P+M,sn[0]=nn[0],sn[1]=b+C,kn[1]=sn[1]);let T;return u!==0?(T=Cn(bi(),n,s,1,1,u,-n,-s),he(T,Nn),he(T,nn),he(T,sn),he(T,kn),$i(Math.min(Nn[0],nn[0],sn[0],kn[0]),Math.min(Nn[1],nn[1],sn[1],kn[1]),Math.max(Nn[0],nn[0],sn[0],kn[0]),Math.max(Nn[1],nn[1],sn[1],kn[1]),Zs)):$i(Math.min(P,P+M),Math.min(b,b+C),Math.max(P,P+M),Math.max(b,b+C),Zs),d&&(p=Math.round(p),y=Math.round(y)),{drawImageX:p,drawImageY:y,drawImageW:S,drawImageH:v,originX:h,originY:c,declutterBox:{minX:Zs[0],minY:Zs[1],maxX:Zs[2],maxY:Zs[3],value:m},canvasTransform:T,scale:f}}replayImageOrLabel_(t,i,n,s,r,o,a){const l=!!(o||a),h=s.declutterBox,c=a?a[2]*s.scale[0]/2:0;return h.minX-c<=i[0]&&h.maxX+c>=0&&h.minY-c<=i[1]&&h.maxY+c>=0&&(l&&this.replayTextBackground_(t,Nn,nn,sn,kn,o,a),eS(t,s.canvasTransform,r,n,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){const i=this.alignAndScaleFill_;if(i){const n=he(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;t.save(),t.translate(n[0]%s,n[1]%s),i!==1&&t.scale(i,i),t.rotate(this.viewRotation_)}t.fill(),i&&t.restore()}setStrokeStyle_(t,i){t.strokeStyle=i[1],i[1]&&(t.lineWidth=i[2],t.lineCap=i[3],t.lineJoin=i[4],t.miterLimit=i[5],t.lineDashOffset=i[7],t.setLineDash(i[6]))}drawLabelWithPointPlacement_(t,i,n,s){const r=this.textStates[i],o=this.createLabel(t,i,s,n),a=this.strokeStates[n],l=this.pixelRatio,h=lc(Array.isArray(t)?t[0]:t,r.textAlign||Xo),c=Dl[r.textBaseline||El],u=a&&a.lineWidth?a.lineWidth:0,f=o.width/l-2*r.scale[0],d=h*f+2*(.5-h)*u,g=c*o.height/l+2*(.5-c)*u;return{label:o,anchorX:d,anchorY:g}}execute_(t,i,n,s,r,o,a,l){const h=this.zIndexContext_;let c;this.pixelCoordinates_&&In(n,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=es(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Ov(this.renderedTransform_,n));let u=0;const f=s.length;let d=0,g,_,m,p,y,S,v,M,C,P,b,T,k,U=0,A=0;const L=this.coordinateCache_,V=this.viewRotation_,tt=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,$={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:V},K=this.instructions!=s||this.overlaps?0:200;let X,rt,ut,mt;for(;u<f;){const B=s[u];switch(B[0]){case st.BEGIN_GEOMETRY:X=B[1],mt=B[3],X.getGeometry()?a!==void 0&&!Fe(a,mt.getExtent())?u=B[2]+1:++u:u=B[2],h&&(h.zIndex=B[4]);break;case st.BEGIN_PATH:U>K&&(this.fill_(t),U=0),A>K&&(t.stroke(),A=0),!U&&!A&&(t.beginPath(),y=NaN,S=NaN),++u;break;case st.CIRCLE:d=B[1];const se=c[d],Gt=c[d+1],$t=c[d+2],Kt=c[d+3],me=$t-se,pe=Kt-Gt,Z=Math.sqrt(me*me+pe*pe);t.moveTo(se+Z,Gt),t.arc(se,Gt,Z,0,2*Math.PI,!0),++u;break;case st.CLOSE_PATH:t.closePath(),++u;break;case st.CUSTOM:d=B[1],g=B[2];const Zt=B[3],E=B[4],w=B[5];$.geometry=Zt,$.feature=X,u in L||(L[u]=[]);const O=L[u];w?w(c,d,g,2,O):(O[0]=c[d],O[1]=c[d+1],O.length=2),h&&(h.zIndex=B[6]),E(O,$),++u;break;case st.DRAW_IMAGE:d=B[1],g=B[2],C=B[3],_=B[4],m=B[5];let j=B[6];const N=B[7],x=B[8],I=B[9],R=B[10];let F=B[11];const G=B[12];let q=B[13];p=B[14]||"declutter";const z=B[15];if(!C&&B.length>=20){P=B[19],b=B[20],T=B[21],k=B[22];const ci=this.drawLabelWithPointPlacement_(P,b,T,k);C=ci.label,B[3]=C;const ds=B[23];_=(ci.anchorX-ds)*this.pixelRatio,B[4]=_;const ui=B[24];m=(ci.anchorY-ui)*this.pixelRatio,B[5]=m,j=C.height,B[6]=j,q=C.width,B[13]=q}let J;B.length>25&&(J=B[25]);let Q,ot,pt;B.length>17?(Q=B[16],ot=B[17],pt=B[18]):(Q=Rs,ot=null,pt=null),R&&tt?F+=V:!R&&!tt&&(F-=V);let wt=0;for(;d<g;d+=2){if(J&&J[wt++]<q/this.pixelRatio)continue;const ci=this.calculateImageOrLabelDimensions_(C.width,C.height,c[d],c[d+1],q,j,_,m,x,I,F,G,r,Q,!!ot||!!pt,X),ds=[t,i,C,ci,N,ot,pt];if(l){let ui,Ni,fi;if(z){const Jt=g-d;if(!z[Jt]){z[Jt]={args:ds,declutterMode:p};continue}const Ge=z[Jt];ui=Ge.args,Ni=Ge.declutterMode,delete z[Jt],fi=Ag(ui)}let Zi,Ji;if(ui&&(Ni!=="declutter"||!l.collides(fi))&&(Zi=!0),(p!=="declutter"||!l.collides(ci.declutterBox))&&(Ji=!0),Ni==="declutter"&&p==="declutter"){const Jt=Zi&&Ji;Zi=Jt,Ji=Jt}Zi&&(Ni!=="none"&&l.insert(fi),this.replayImageOrLabel_.apply(this,ui)),Ji&&(p!=="none"&&l.insert(ci.declutterBox),this.replayImageOrLabel_.apply(this,ds))}else this.replayImageOrLabel_.apply(this,ds)}++u;break;case st.DRAW_CHARS:const ye=B[1],ve=B[2],Ue=B[3],hi=B[4];k=B[5];const fs=B[6],Vr=B[7],Ce=B[8];T=B[9];const Ve=B[10];P=B[11],Array.isArray(P)&&(P=P.reduce(RT,"")),b=B[12];const Xr=[B[13],B[13]];p=B[14]||"declutter";const ma=B[15],Eh=this.textStates[b],$r=Eh.font,Kr=[Eh.scale[0]*Vr,Eh.scale[1]*Vr];let Yr;$r in this.widths_?Yr=this.widths_[$r]:(Yr={},this.widths_[$r]=Yr);const Af=Tf(c,ye,ve,2),Lf=Math.abs(Kr[0])*Xd($r,P,Yr);if(hi||Lf<=Af){const ci=this.textStates[b].textAlign,ds=(Af-Lf)*lc(P,ci),ui=CT(c,ye,ve,2,P,ds,fs,Math.abs(Kr[0]),Xd,$r,Yr,tt?0:this.viewRotation_,ma);t:if(ui){const Ni=[];let fi,Zi,Ji,Jt,Ge;if(T)for(fi=0,Zi=ui.length;fi<Zi;++fi){Ge=ui[fi],Ji=Ge[4],Jt=this.createLabel(Ji,b,"",T),_=Ge[2]+(Kr[0]<0?-Ve:Ve),m=Ue*Jt.height+(.5-Ue)*2*Ve*Kr[1]/Kr[0]-Ce;const Qi=this.calculateImageOrLabelDimensions_(Jt.width,Jt.height,Ge[0],Ge[1],Jt.width,Jt.height,_,m,0,0,Ge[3],Xr,!1,Rs,!1,X);if(l&&p==="declutter"&&l.collides(Qi.declutterBox))break t;Ni.push([t,i,Jt,Qi,1,null,null])}if(k)for(fi=0,Zi=ui.length;fi<Zi;++fi){Ge=ui[fi],Ji=Ge[4],Jt=this.createLabel(Ji,b,k,""),_=Ge[2],m=Ue*Jt.height-Ce;const Qi=this.calculateImageOrLabelDimensions_(Jt.width,Jt.height,Ge[0],Ge[1],Jt.width,Jt.height,_,m,0,0,Ge[3],Xr,!1,Rs,!1,X);if(l&&p==="declutter"&&l.collides(Qi.declutterBox))break t;Ni.push([t,i,Jt,Qi,1,null,null])}l&&p!=="none"&&l.load(Ni.map(Ag));for(let Qi=0,c1=Ni.length;Qi<c1;++Qi)this.replayImageOrLabel_.apply(this,Ni[Qi])}}++u;break;case st.END_GEOMETRY:if(o!==void 0){X=B[1];const ci=o(X,mt,p);if(ci)return ci}++u;break;case st.FILL:K?U++:this.fill_(t),++u;break;case st.MOVE_TO_LINE_TO:for(d=B[1],g=B[2],rt=c[d],ut=c[d+1],t.moveTo(rt,ut),y=rt+.5|0,S=ut+.5|0,d+=2;d<g;d+=2)rt=c[d],ut=c[d+1],v=rt+.5|0,M=ut+.5|0,(d==g-2||v!==y||M!==S)&&(t.lineTo(rt,ut),y=v,S=M);++u;break;case st.SET_FILL_STYLE:this.alignAndScaleFill_=B[2],U&&(this.fill_(t),U=0,A&&(t.stroke(),A=0)),t.fillStyle=B[1],++u;break;case st.SET_STROKE_STYLE:A&&(t.stroke(),A=0),this.setStrokeStyle_(t,B),++u;break;case st.STROKE:K?A++:t.stroke(),++u;break;default:++u;break}}U&&this.fill_(t),A&&t.stroke()}execute(t,i,n,s,r,o){this.viewRotation_=s,this.execute_(t,i,n,this.instructions,r,void 0,void 0,o)}executeHitDetection(t,i,n,s,r){return this.viewRotation_=n,this.execute_(t,[t.canvas.width,t.canvas.height],i,this.hitDetectionInstructions,!0,s,r)}}const ws=["Polygon","Circle","LineString","Image","Text","Default"],Ym=["Image","Text"],PT=ws.filter(e=>!Ym.includes(e));class bT{constructor(t,i,n,s,r,o,a){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=n,this.resolution_=i,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=bi(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,a)}clip(t,i){const n=this.getClipCoords(i);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,i){for(const n in t){let s=this.executorsByZIndex_[n];s===void 0&&(s={},this.executorsByZIndex_[n]=s);const r=t[n];for(const o in r){const a=r[o];s[o]=new IT(this.resolution_,this.pixelRatio_,this.overlaps_,a,i)}}}hasExecutors(t){for(const i in this.executorsByZIndex_){const n=this.executorsByZIndex_[i];for(let s=0,r=t.length;s<r;++s)if(t[s]in n)return!0}return!1}forEachFeatureAtCoordinate(t,i,n,s,r,o){s=Math.round(s);const a=s*2+1,l=Cn(this.hitDetectionTransform_,s+.5,s+.5,1/i,-1/i,-n,-t[0],-t[1]),h=!this.hitDetectionContext_;h&&(this.hitDetectionContext_=ae(a,a));const c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):h||c.clearRect(0,0,a,a);let u;this.renderBuffer_!==void 0&&(u=ti(),Eo(u,t),bs(u,i*(this.renderBuffer_+s),u));const f=AT(s);let d;function g(M,C,P){const b=c.getImageData(0,0,a,a).data;for(let T=0,k=f.length;T<k;T++)if(b[f[T]]>0){if(!o||P==="none"||d!=="Image"&&d!=="Text"||o.includes(M)){const U=(f[T]-3)/4,A=s-U%a,L=s-(U/a|0),V=r(M,C,A*A+L*L);if(V)return V}c.clearRect(0,0,a,a);break}}const _=Object.keys(this.executorsByZIndex_).map(Number);_.sort(gn);let m,p,y,S,v;for(m=_.length-1;m>=0;--m){const M=_[m].toString();for(y=this.executorsByZIndex_[M],p=ws.length-1;p>=0;--p)if(d=ws[p],S=y[d],S!==void 0&&(v=S.executeHitDetection(c,l,n,g,u),v))return v}}getClipCoords(t){const i=this.maxExtent_;if(!i)return null;const n=i[0],s=i[1],r=i[2],o=i[3],a=[n,s,n,o,r,o,r,s];return es(a,0,8,2,t,a),a}isEmpty(){return Rr(this.executorsByZIndex_)}execute(t,i,n,s,r,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?By:gn),o=o||ws;const h=ws.length;for(let c=0,u=l.length;c<u;++c){const f=l[c].toString(),d=this.executorsByZIndex_[f];for(let g=0,_=o.length;g<_;++g){const m=o[g],p=d[m];if(p!==void 0){const y=a===null?void 0:p.getZIndexContext(),S=y?y.getContext():t,v=this.maxExtent_&&m!=="Image"&&m!=="Text";if(v&&(S.save(),this.clip(S,n)),!y||m==="Text"||m==="Image"?p.execute(S,i,n,s,r,a):y.pushFunction(M=>p.execute(M,i,n,s,r,a)),v&&S.restore(),y){y.offset();const M=l[c]*h+ws.indexOf(m);this.deferredZIndexContexts_[M]||(this.deferredZIndexContexts_[M]=[]),this.deferredZIndexContexts_[M].push(y)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,i=Object.keys(t).map(Number).sort(gn);for(let n=0,s=i.length;n<s;++n)t[i[n]].forEach(r=>{r.draw(this.renderedContext_),r.clear()}),t[i[n]].length=0}}const hc={};function AT(e){if(hc[e]!==void 0)return hc[e];const t=e*2+1,i=e*e,n=new Array(i+1);for(let r=0;r<=e;++r)for(let o=0;o<=e;++o){const a=r*r+o*o;if(a>i)break;let l=n[a];l||(l=[],n[a]=l),l.push(((e+r)*t+(e+o))*4+3),r>0&&l.push(((e-r)*t+(e+o))*4+3),o>0&&(l.push(((e+r)*t+(e-o))*4+3),r>0&&l.push(((e-r)*t+(e-o))*4+3))}const s=[];for(let r=0,o=n.length;r<o;++r)n[r]&&s.push(...n[r]);return hc[e]=s,s}class LT extends Km{constructor(t,i,n,s,r,o,a){super(),this.context_=t,this.pixelRatio_=i,this.extent_=n,this.transform_=s,this.transformRotation_=s?Nr(Math.atan2(s[1],s[0]),10):0,this.viewRotation_=r,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_=bi()}drawImages_(t,i,n,s){if(!this.image_)return;const r=es(t,i,n,s,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=l*this.imageOpacity_);let h=this.imageRotation_;this.transformRotation_===0&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let c=0,u=r.length;c<u;c+=2){const f=r[c]-this.imageAnchorX_,d=r[c+1]-this.imageAnchorY_;if(h!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const g=f+this.imageAnchorX_,_=d+this.imageAnchorY_;Cn(a,g,_,1,1,h,-g,-_),o.save(),o.transform.apply(o,a),o.translate(g,_),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_(t,i,n,s){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const r=es(t,i,n,s,this.transform_,this.pixelCoordinates_),o=this.context_;let a=this.textRotation_;for(this.transformRotation_===0&&(a-=this.viewRotation_),this.textRotateWithView_&&(a+=this.viewRotation_);i<n;i+=s){const l=r[i]+this.textOffsetX_,h=r[i+1]+this.textOffsetY_;a!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(o.save(),o.translate(l-this.textOffsetX_,h-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,h),this.textFillState_&&o.fillText(this.text_,l,h))}}moveToLineTo_(t,i,n,s,r){const o=this.context_,a=es(t,i,n,s,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);let l=a.length;r&&(l-=2);for(let h=2;h<l;h+=2)o.lineTo(a[h],a[h+1]);return r&&o.closePath(),n}drawRings_(t,i,n,s){for(let r=0,o=n.length;r<o;++r)i=this.moveToLineTo_(t,i,n[r],s,!0);return i}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Fe(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const i=Uv(t,this.transform_,this.pixelCoordinates_),n=i[2]-i[0],s=i[3]-i[1],r=Math.sqrt(n*n+s*s),o=this.context_;o.beginPath(),o.arc(i[0],i[1],r,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t);break}}drawFeature(t,i){const n=i.getGeometryFunction()(t);n&&(this.setStyle(i),this.drawGeometry(n))}drawGeometryCollection(t){const i=t.getGeometriesArray();for(let n=0,s=i.length;n<s;++n)this.drawGeometry(i[n])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const i=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(i,0,i.length,n),this.text_!==""&&this.drawText_(i,0,i.length,n)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const i=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(i,0,i.length,n),this.text_!==""&&this.drawText_(i,0,i.length,n)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Fe(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const i=this.context_,n=t.getFlatCoordinates();i.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),i.stroke()}if(this.text_!==""){const i=t.getFlatMidpoint();this.drawText_(i,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const i=t.getExtent();if(Fe(this.extent_,i)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const n=this.context_,s=t.getFlatCoordinates();let r=0;const o=t.getEnds(),a=t.getStride();n.beginPath();for(let l=0,h=o.length;l<h;++l)r=this.moveToLineTo_(s,r,o[l],a,!1);n.stroke()}if(this.text_!==""){const n=t.getFlatMidpoints();this.drawText_(n,0,n.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Fe(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const i=this.context_;i.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&i.fill(),this.strokeState_&&i.stroke()}if(this.text_!==""){const i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Fe(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const i=this.context_,n=t.getOrientedFlatCoordinates();let s=0;const r=t.getEndss(),o=t.getStride();i.beginPath();for(let a=0,l=r.length;a<l;++a){const h=r[a];s=this.drawRings_(n,s,h,o)}this.fillState_&&i.fill(),this.strokeState_&&i.stroke()}if(this.text_!==""){const i=t.getFlatInteriorPoints();this.drawText_(i,0,i.length,2)}}}setContextFillState_(t){const i=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,i.fillStyle=t.fillStyle):(i.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const i=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,i.lineCap=t.lineCap),In(n.lineDash,t.lineDash)||i.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,i.lineDashOffset=t.lineDashOffset),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,i.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,i.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,i.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,i.strokeStyle=t.strokeStyle)):(i.lineCap=t.lineCap,i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset,i.lineJoin=t.lineJoin,i.lineWidth=t.lineWidth,i.miterLimit=t.miterLimit,i.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const i=this.context_,n=this.contextTextState_,s=t.textAlign?t.textAlign:Xo;n?(n.font!=t.font&&(n.font=t.font,i.font=t.font),n.textAlign!=s&&(n.textAlign=s,i.textAlign=s),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,i.textBaseline=t.textBaseline)):(i.font=t.font,i.textAlign=s,i.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:s,textBaseline:t.textBaseline})}setFillStrokeStyle(t,i){if(!t)this.fillState_=null;else{const n=t.getColor();this.fillState_={fillStyle:Ui(n||Ye)}}if(!i)this.strokeState_=null;else{const n=i.getColor(),s=i.getLineCap(),r=i.getLineDash(),o=i.getLineDashOffset(),a=i.getLineJoin(),l=i.getWidth(),h=i.getMiterLimit(),c=r||vn;this.strokeState_={lineCap:s!==void 0?s:Lr,lineDash:this.pixelRatio_===1?c:c.map(u=>u*this.pixelRatio_),lineDashOffset:(o||xn)*this.pixelRatio_,lineJoin:a!==void 0?a:Or,lineWidth:(l!==void 0?l:$o)*this.pixelRatio_,miterLimit:h!==void 0?h:Uo,strokeStyle:Ui(n||Vo)}}}setImageStyle(t){let i;if(!t||!(i=t.getSize())){this.image_=null;return}const n=t.getPixelRatio(this.pixelRatio_),s=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*n,this.imageAnchorY_=s[1]*n,this.imageHeight_=i[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/n,o[1]*this.pixelRatio_/n],this.imageWidth_=i[0]*n}setTextStyle(t){if(!t)this.text_="";else{const i=t.getFill();if(!i)this.textFillState_=null;else{const d=i.getColor();this.textFillState_={fillStyle:Ui(d||Ye)}}const n=t.getStroke();if(!n)this.textStrokeState_=null;else{const d=n.getColor(),g=n.getLineCap(),_=n.getLineDash(),m=n.getLineDashOffset(),p=n.getLineJoin(),y=n.getWidth(),S=n.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:Lr,lineDash:_||vn,lineDashOffset:m||xn,lineJoin:p!==void 0?p:Or,lineWidth:y!==void 0?y:$o,miterLimit:S!==void 0?S:Uo,strokeStyle:Ui(d||Vo)}}const s=t.getFont(),r=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),h=t.getScaleArray(),c=t.getText(),u=t.getTextAlign(),f=t.getTextBaseline();this.textState_={font:s!==void 0?s:Y0,textAlign:u!==void 0?u:Xo,textBaseline:f!==void 0?f:El},this.text_=c!==void 0?Array.isArray(c)?c.reduce((d,g,_)=>d+=_%2?" ":g,""):c:"",this.textOffsetX_=r!==void 0?this.pixelRatio_*r:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}}}const Wi=.5;function OT(e,t,i,n,s,r,o,a,l){const h=s,c=e[0]*Wi,u=e[1]*Wi,f=ae(c,u);f.imageSmoothingEnabled=!1;const d=f.canvas,g=new LT(f,Wi,s,null,o,a,null),_=i.length,m=Math.floor((256*256*256-1)/_),p={};for(let S=1;S<=_;++S){const v=i[S-1],M=v.getStyleFunction()||n;if(!M)continue;let C=M(v,r);if(!C)continue;Array.isArray(C)||(C=[C]);const b=(S*m).toString(16).padStart(7,"#00000");for(let T=0,k=C.length;T<k;++T){const U=C[T],A=U.getGeometryFunction()(v);if(!A||!Fe(h,A.getExtent()))continue;const L=U.clone(),V=L.getFill();V&&V.setColor(b);const tt=L.getStroke();tt&&(tt.setColor(b),tt.setLineDash(null)),L.setText(void 0);const $=U.getImage();if($){const ut=$.getImageSize();if(!ut)continue;const mt=ae(ut[0],ut[1],void 0,{alpha:!1}),B=mt.canvas;mt.fillStyle=b,mt.fillRect(0,0,B.width,B.height),L.setImage(new dh({img:B,anchor:$.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:$.getOrigin(),opacity:1,size:$.getSize(),scale:$.getScale(),rotation:$.getRotation(),rotateWithView:$.getRotateWithView()}))}const K=L.getZIndex()||0;let X=p[K];X||(X={},p[K]=X,X.Polygon=[],X.Circle=[],X.LineString=[],X.Point=[]);const rt=A.getType();if(rt==="GeometryCollection"){const ut=A.getGeometriesArrayRecursive();for(let mt=0,B=ut.length;mt<B;++mt){const Ht=ut[mt];X[Ht.getType().replace("Multi","")].push(Ht,L)}}else X[rt.replace("Multi","")].push(A,L)}}const y=Object.keys(p).map(Number).sort(gn);for(let S=0,v=y.length;S<v;++S){const M=p[y[S]];for(const C in M){const P=M[C];for(let b=0,T=P.length;b<T;b+=2){g.setStyle(P[b+1]);for(let k=0,U=t.length;k<U;++k)g.setTransform(t[k]),g.drawGeometry(P[b])}}}return f.getImageData(0,0,d.width,d.height)}function FT(e,t,i){const n=[];if(i){const s=Math.floor(Math.round(e[0])*Wi),r=Math.floor(Math.round(e[1])*Wi),o=(Bt(s,0,i.width-1)+Bt(r,0,i.height-1)*i.width)*4,a=i.data[o],l=i.data[o+1],c=i.data[o+2]+256*(l+256*a),u=Math.floor((256*256*256-1)/t.length);c&&c%u===0&&n.push(t[c/u-1])}return n}const GT=.5,qm={Point:UT,LineString:BT,Polygon:XT,MultiPoint:VT,MultiLineString:zT,MultiPolygon:WT,GeometryCollection:jT,Circle:NT};function DT(e,t){return parseInt(ht(e),10)-parseInt(ht(t),10)}function Og(e,t){const i=Hm(e,t);return i*i}function Hm(e,t){return GT*e/t}function NT(e,t,i,n,s){const r=i.getFill(),o=i.getStroke();if(r||o){const l=e.getBuilder(i.getZIndex(),"Circle");l.setFillStrokeStyle(r,o),l.drawCircle(t,n,s)}const a=i.getText();if(a&&a.getText()){const l=e.getBuilder(i.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n)}}function Fg(e,t,i,n,s,r,o,a){const l=[],h=i.getImage();if(h){let f=!0;const d=h.getImageState();d==et.LOADED||d==et.ERROR?f=!1:d==et.IDLE&&h.load(),f&&l.push(h.ready())}const c=i.getFill();c&&c.loading()&&l.push(c.ready());const u=l.length>0;return u&&Promise.all(l).then(()=>s(null)),kT(e,t,i,n,r,o,a),u}function kT(e,t,i,n,s,r,o){const a=i.getGeometryFunction()(t);if(!a)return;const l=a.simplifyTransformed(n,s);if(i.getRenderer())Zm(e,l,i,t,o);else{const c=qm[l.getType()];c(e,l,i,t,o,r)}}function Zm(e,t,i,n,s){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let a=0,l=o.length;a<l;++a)Zm(e,o[a],i,n,s);return}e.getBuilder(i.getZIndex(),"Default").drawCustom(t,n,i.getRenderer(),i.getHitDetectionRenderer(),s)}function jT(e,t,i,n,s,r){const o=t.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a){const h=qm[o[a].getType()];h(e,o[a],i,n,s,r)}}function BT(e,t,i,n,s){const r=i.getStroke();if(r){const a=e.getBuilder(i.getZIndex(),"LineString");a.setFillStrokeStyle(null,r),a.drawLineString(t,n,s)}const o=i.getText();if(o&&o.getText()){const a=e.getBuilder(i.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,n,s)}}function zT(e,t,i,n,s){const r=i.getStroke();if(r){const a=e.getBuilder(i.getZIndex(),"LineString");a.setFillStrokeStyle(null,r),a.drawMultiLineString(t,n,s)}const o=i.getText();if(o&&o.getText()){const a=e.getBuilder(i.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,n,s)}}function WT(e,t,i,n,s){const r=i.getFill(),o=i.getStroke();if(o||r){const l=e.getBuilder(i.getZIndex(),"Polygon");l.setFillStrokeStyle(r,o),l.drawMultiPolygon(t,n,s)}const a=i.getText();if(a&&a.getText()){const l=e.getBuilder(i.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n,s)}}function UT(e,t,i,n,s,r){const o=i.getImage(),a=i.getText(),l=a&&a.getText(),h=r&&o&&l?{}:void 0;if(o){if(o.getImageState()!=et.LOADED)return;const c=e.getBuilder(i.getZIndex(),"Image");c.setImageStyle(o,h),c.drawPoint(t,n,s)}if(l){const c=e.getBuilder(i.getZIndex(),"Text");c.setTextStyle(a,h),c.drawText(t,n,s)}}function VT(e,t,i,n,s,r){const o=i.getImage(),a=o&&o.getOpacity()!==0,l=i.getText(),h=l&&l.getText(),c=r&&a&&h?{}:void 0;if(a){if(o.getImageState()!=et.LOADED)return;const u=e.getBuilder(i.getZIndex(),"Image");u.setImageStyle(o,c),u.drawMultiPoint(t,n,s)}if(h){const u=e.getBuilder(i.getZIndex(),"Text");u.setTextStyle(l,c),u.drawText(t,n,s)}}function XT(e,t,i,n,s){const r=i.getFill(),o=i.getStroke();if(r||o){const l=e.getBuilder(i.getZIndex(),"Polygon");l.setFillStrokeStyle(r,o),l.drawPolygon(t,n,s)}const a=i.getText();if(a&&a.getText()){const l=e.getBuilder(i.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n,s)}}class $T extends $m{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=ti(),this.wrappedRenderedExtent_=ti(),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(t,i,n){const s=i.extent,r=i.viewState,o=r.center,a=r.resolution,l=r.projection,h=r.rotation,c=l.getExtent(),u=this.getLayer().getSource(),f=this.getLayer().getDeclutter(),d=i.pixelRatio,g=i.viewHints,_=!(g[be.ANIMATING]||g[be.INTERACTING]),m=this.context,p=Math.round(xt(s)/a*d),y=Math.round(ue(s)/a*d),S=u.getWrapX()&&l.canWrapX(),v=S?xt(c):null,M=S?Math.ceil((s[2]-c[2])/v)+1:1;let C=S?Math.floor((s[0]-c[0])/v):0;do{let P=this.getRenderTransform(o,a,0,d,p,y,C*v);i.declutter&&(P=P.slice(0)),t.execute(m,[m.canvas.width,m.canvas.height],P,h,_,n===void 0?ws:n?Ym:PT,n?f&&i.declutter[f]:void 0)}while(++C<M)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=ae(this.context.canvas.width,this.context.canvas.height,Rg))}resetDrawContext_(){if(this.opacity_!==1&&this.targetContext_){const t=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=t,hh(this.context),Rg.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(t){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,t,!0)}renderDeferredInternal(t){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(t,i){const n=t.layerStatesArray[t.layerIndex];this.opacity_=n.opacity;const s=t.viewState;this.prepareContainer(t,i);const r=this.context,o=this.replayGroup_;let a=o&&!o.isEmpty();if(!a&&!(this.getLayer().hasListener(pi.PRERENDER)||this.getLayer().hasListener(pi.POSTRENDER)))return this.container;if(this.setDrawContext_(),this.preRender(r,t),s.projection,this.clipped_=!1,a&&n.extent&&this.clipping){const l=dn(n.extent);a=Fe(l,t.extent),this.clipped_=a&&!fn(l,t.extent),this.clipped_&&this.clipUnrotated(r,t,l)}return a&&this.renderWorlds(o,t,this.getLayer().getDeclutter()?!1:void 0),!t.declutter&&this.clipped_&&r.restore(),this.postRender(r,t),this.renderedRotation_!==s.rotation&&(this.renderedRotation_=s.rotation,this.hitDetectionImageData_=null),t.declutter||this.resetDrawContext_(),this.container}getFeatures(t){return new Promise(i=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const n=this.frameState.size.slice(),s=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,h=this.getLayer(),c=[],u=n[0]*Wi,f=n[1]*Wi;c.push(this.getRenderTransform(s,r,o,Wi,u,f,0).slice());const d=h.getSource(),g=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!fn(g,l)){let _=l[0];const m=xt(g);let p=0,y;for(;_<g[0];)--p,y=m*p,c.push(this.getRenderTransform(s,r,o,Wi,u,f,y).slice()),_+=m;for(p=0,_=l[2];_>g[2];)++p,y=m*p,c.push(this.getRenderTransform(s,r,o,Wi,u,f,y).slice()),_-=m}this.hitDetectionImageData_=OT(n,c,this.renderedFeatures_,h.getStyleFunction(),l,r,o,Og(r,this.renderedPixelRatio_))}i(FT(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,i,n,s,r){if(!this.replayGroup_)return;const o=i.viewState.resolution,a=i.viewState.rotation,l=this.getLayer(),h={},c=function(f,d,g){const _=ht(f),m=h[_];if(m){if(m!==!0&&g<m.distanceSq){if(g===0)return h[_]=!0,r.splice(r.lastIndexOf(m),1),s(f,l,d);m.geometry=d,m.distanceSq=g}}else{if(g===0)return h[_]=!0,s(f,l,d);r.push(h[_]={feature:f,layer:l,geometry:d,distanceSq:g,callback:s})}},u=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(t,o,a,n,c,u?i.declutter?.[u]?.all().map(f=>f.value):null)}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const i=this.getLayer(),n=i.getSource();if(!n)return!1;const s=t.viewHints[be.ANIMATING],r=t.viewHints[be.INTERACTING],o=i.getUpdateWhileAnimating(),a=i.getUpdateWhileInteracting();if(this.ready&&!o&&s||!a&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=t.extent,h=t.viewState,c=h.projection,u=h.resolution,f=t.pixelRatio,d=i.getRevision(),g=i.getRenderBuffer();let _=i.getRenderOrder();_===void 0&&(_=DT);const m=h.center.slice(),p=bs(l,g*u),y=p.slice(),S=[p.slice()],v=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!fn(v,t.extent)){const V=xt(v),tt=Math.max(xt(p)/2,V);p[0]=v[0]-tt,p[2]=v[2]+tt,h0(m,c);const $=r0(S[0],c);$[0]<v[0]&&$[2]<v[2]?S.push([$[0]+V,$[1],$[2]+V,$[3]]):$[0]>v[0]&&$[2]>v[2]&&S.push([$[0]-V,$[1],$[2]-V,$[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==d&&this.renderedRenderOrder_==_&&this.renderedFrameDeclutter_===!!t.declutter&&fn(this.wrappedRenderedExtent_,p))return In(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const M=new wT(Hm(u,f),p,u,f);let C;for(let V=0,tt=S.length;V<tt;++V)n.loadFeatures(S[V],u,c);const P=Og(u,f);let b=!0;const T=(V,tt)=>{let $;const K=V.getStyleFunction()||i.getStyleFunction();if(K&&($=K(V,u)),$){const X=this.renderFeature(V,P,$,M,C,this.getLayer().getDeclutter(),tt);b=b&&!X}},k=sh(p),U=n.getFeaturesInExtent(k);_&&U.sort(_);for(let V=0,tt=U.length;V<tt;++V)T(U[V],V);this.renderedFeatures_=U,this.ready=b;const A=M.finish(),L=new bT(p,u,f,n.getOverlaps(),A,i.getRenderBuffer(),!!t.declutter);return this.renderedResolution_=u,this.renderedRevision_=d,this.renderedRenderOrder_=_,this.renderedFrameDeclutter_=!!t.declutter,this.renderedExtent_=y,this.wrappedRenderedExtent_=p,this.renderedCenter_=m,this.renderedProjection_=c,this.renderedPixelRatio_=f,this.replayGroup_=L,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,i,n,s,r,o,a){if(!n)return!1;let l=!1;if(Array.isArray(n))for(let h=0,c=n.length;h<c;++h)l=Fg(s,t,n[h],i,this.boundHandleStyleImageChange_,r,o,a)||l;else l=Fg(s,t,n,i,this.boundHandleStyleImageChange_,r,o,a);return l}}class xh extends im{constructor(t){super(t)}createRenderer(){return new $T(this)}}function Jm(e,t,i=[]){const n=Pn(t),s=Lo(new e(n));kr(s,[...ox,...i]);const r=Xt("map"),o=Xt("layerGroup",null),a=Xt("overviewMap",null),l=Nt(!1);function h(){for(const u in n){const f=u;n[f]!==void 0&&s.value.set(u,n[f])}if(s.value.setOpacity(n.opacity??1),s.value.setVisible(n.visible??!0),!l.value){if(o){const u=o.getLayers();u.push(s.value),o.setLayers(u)}else a?.value?a.value?.getOverviewMap().addLayer(s.value):r?.addLayer(s.value);l.value=!0}}function c(){o?o.getLayers().remove(s.value):a?.value?(a.value?.getOverviewMap().removeLayer(s.value),a.value?.changed()):r?.removeLayer(s.value),l.value=!1}return wi(c),ie(()=>n,h,{deep:!0,immediate:!0}),a?.value&&ie(a,()=>{c(),h()}),{layer:s,map:r}}const Gg=_e({__name:"OlTileLayer",props:P_({className:{},opacity:{},visible:{type:Boolean},extent:{},zIndex:{},minResolution:{},maxResolution:{},minZoom:{},maxZoom:{},preload:{},source:{},map:{},background:{type:[String,Function]},useInterimTilesOnError:{type:Boolean},properties:{},cacheSize:{},openInLayerSwitcher:{type:Boolean},title:{},name:{},allwaysOnTop:{type:Boolean},baseLayer:{type:Boolean},displayInLayerSwitcher:{type:Boolean},preview:{}},Am({preload:1})),emits:["sourceready","change","error","propertychange","change:extent","change:maxResolution","change:maxZoom","change:minResolution","change:minZoom","change:opacity","change:source","change:visible","change:zIndex","postrender","prerender","change:useInterimTilesOnError","change:preload"],setup(e,{expose:t}){const i=e,{layer:n}=Jm(gT,Ul(i),["change:useInterimTilesOnError","change:preload"]);return Mi("tileLayer",n),t({tileLayer:n}),(s,r)=>(dt(),jt("div",null,[qi(s.$slots,"default")]))}}),KT=_e({__name:"OlVectorLayer",props:P_({className:{},opacity:{},visible:{type:Boolean},extent:{},zIndex:{},minResolution:{},maxResolution:{},minZoom:{},maxZoom:{},renderOrder:{type:Function},renderBuffer:{},source:{},map:{},declutter:{type:[String,Number,Boolean]},style:{type:[Object,Array,Function,null]},background:{type:[String,Function]},updateWhileAnimating:{type:Boolean},updateWhileInteracting:{type:Boolean},properties:{},openInLayerSwitcher:{type:Boolean},title:{},name:{},allwaysOnTop:{type:Boolean},baseLayer:{type:Boolean},displayInLayerSwitcher:{type:Boolean},preview:{}},Am()),emits:["sourceready","change","error","propertychange","change:extent","change:maxResolution","change:maxZoom","change:minResolution","change:minZoom","change:opacity","change:source","change:visible","change:zIndex","postrender","prerender"],setup(e,{expose:t}){const i=e,{layer:n}=Jm(xh,i);return Mi("vectorLayer",n),Mi("stylable",n),t({vectorLayer:n}),(s,r)=>(dt(),jt("div",null,[qi(s.$slots,"default")]))}});function YT(e,t,i,n=[],s){function r(){return Pn({...i,...i.projection?{projection:bm(i.projection)}:{}})}const o=Lo(new e(r()));a();function a(){t?.value?.setSource(null);const c=r();o.value.setProperties(c);for(const u in c){const f=u;c[f]!==void 0&&o.value.set(u,c[f])}return t?.value?.setSource(o.value),kr(o,[...R0,...l(),...n]),o}function l(){const c=o.value;return c instanceof vh?hx:c instanceof Wm?ax:c instanceof sT?lx:[]}function h(){t?.value?.setSource(null)}return wi(h),ie(o,a),ie(()=>t,a),ie(()=>i,a,{deep:!0}),{source:o,updateSource:a,removeSource:h}}const qT=_e({inheritAttrs:!1,__name:"OlSourceVector",props:{attributions:{},features:{},format:{},loader:{},overlaps:{type:Boolean,default:!0},strategy:{},url:{},useSpatialIndex:{type:Boolean,default:!0},wrapX:{type:Boolean,default:!0}},emits:["addfeature","changefeature","clear","featuresloadend","featuresloaderror","featuresloadstart","removefeature","change","error","propertychange"],setup(e,{expose:t}){const i=e,n=Xt("vectorLayer",null),s=Xt("heatmapLayer",null),r=Xt("webglVectorLayer",null),o=s||n||r,{source:a,updateSource:l}=YT(vh,o,i);return ie(()=>i.features,(h,c)=>{if(h!==c&&(a.value.clear(),h)){const u=h instanceof Me?h.getArray():h;a.value.addFeatures(u)}l()},{deep:!0}),ie(()=>i.url,(h,c)=>{h!==c&&(a.value.clear(),h&&(a.value.setUrl(h),a.value.refresh())),l()}),Mi("vectorSource",a),t({layer:o,source:a}),(h,c)=>(dt(),jt("div",null,[qi(h.$slots,"default")]))}});function Qm(e,t){const i=Xt("feature"),n=Pn(t),s=Ee(()=>{const r=Object.values(n);return new e(...r)});return ie(n,()=>{i?.value?.setGeometry(s.value),i?.value?.changed()}),ie(()=>i,()=>{i?.value?.setGeometry(s.value)}),ei(()=>{i?.value?.setGeometry(s.value)}),wi(()=>{i?.value?.setGeometry(void 0)}),s}const HT=_e({__name:"OlGeomPoint",props:{coordinates:{},layout:{default:"XY"}},setup(e,{expose:t}){const n=Qm(yn,e);return t({geometry:n}),(s,r)=>re("",!0)}}),ZT=_e({__name:"OlGeomPolygon",props:{coordinates:{},layout:{default:"XY"},ends:{}},setup(e,{expose:t}){const n=Qm(Fi,e);return t({geometry:n}),(s,r)=>re("",!0)}});function qn(e,t){const i=e.length;return t<0?e[t+i]:t>=i?e[t-i]:e[t]}function fr(e,t){const i=e.length;let n=Math.floor(t);const s=t-n;n>=i?n-=i:n<0&&(n+=i);let r=n+1;r>=i&&(r-=i);const o=e[n],a=o[0],l=o[1],h=e[r],c=h[0]-a,u=h[1]-l;return[a+c*s,l+u*s]}const Ga={index:-1,endIndex:NaN,closestTargetDistance:1/0};function t1(e,t,i,n){const s=e[0],r=e[1];let o=1/0,a=-1,l=NaN;for(let u=0;u<t.targets.length;++u){const f=t.targets[u],d=f.coordinates;let g=1/0,_;for(let m=0;m<d.length-1;++m){const p=d[m],y=d[m+1],S=n1(s,r,p,y);S.squaredDistance<g&&(g=S.squaredDistance,_=m+S.along)}g<o&&(o=g,f.ring&&t.targetIndex===u&&(f.endIndex>f.startIndex?_<f.startIndex&&(_+=d.length):f.endIndex<f.startIndex&&_>f.startIndex&&(_-=d.length)),l=_,a=u)}const h=t.targets[a];let c=h.ring;if(t.targetIndex===a&&c){const u=fr(h.coordinates,l),f=i.getPixelFromCoordinate(u),d=i.getPixelFromCoordinate(t.startCoord);rr(f,d)>n&&(c=!1)}if(c){const u=h.coordinates,f=u.length,d=h.startIndex,g=l;if(d<g){const _=ka(u,d,g);ka(u,d,g-f)<_&&(l-=f)}else{const _=ka(u,d,g);ka(u,d,g+f)<_&&(l+=f)}}return Ga.index=a,Ga.endIndex=l,Ga.closestTargetDistance=o,Ga}function e1(e,t){const i=[];for(let n=0;n<t.length;++n){const r=t[n].getGeometry();i1(e,r,i)}return i}function i1(e,t,i){if(t instanceof En){Da(e,t.getCoordinates(),!1,i);return}if(t instanceof Qo){const n=t.getCoordinates();for(let s=0,r=n.length;s<r;++s)Da(e,n[s],!1,i);return}if(t instanceof Fi){const n=t.getCoordinates();for(let s=0,r=n.length;s<r;++s)Da(e,n[s],!0,i);return}if(t instanceof ta){const n=t.getCoordinates();for(let s=0,r=n.length;s<r;++s){const o=n[s];for(let a=0,l=o.length;a<l;++a)Da(e,o[a],!0,i)}return}if(t instanceof Fl){const n=t.getGeometries();for(let s=0;s<n.length;++s)i1(e,n[s],i);return}}function Da(e,t,i,n){const s=e[0],r=e[1];for(let o=0,a=t.length-1;o<a;++o){const l=t[o],h=t[o+1],c=n1(s,r,l,h);if(c.squaredDistance===0){const u=o+c.along;n.push({coordinates:t,ring:i,startIndex:u,endIndex:u});return}}}function Na(e,t){return _n(e[0],e[1],t[0],t[1])}function ka(e,t,i){let n,s;t<i?(n=t,s=i):(n=i,s=t);const r=Math.ceil(n),o=Math.floor(s);if(r>o){const l=fr(e,n),h=fr(e,s);return Na(l,h)}let a=0;if(n<r){const l=fr(e,n),h=qn(e,r);a+=Na(l,h)}if(o<s){const l=qn(e,o),h=fr(e,s);a+=Na(l,h)}for(let l=r;l<o-1;++l){const h=qn(e,l),c=qn(e,l+1);a+=Na(h,c)}return a}const cc={along:0,squaredDistance:0};function n1(e,t,i,n){const s=i[0],r=i[1],o=n[0],a=n[1],l=o-s,h=a-r;let c=0,u=s,f=r;return(l!==0||h!==0)&&(c=Bt(((e-s)*l+(t-r)*h)/(l*l+h*h),0,1),u+=l*c,f+=h*c),cc.along=c,cc.squaredDistance=Nr(_n(e,t,u,f),10),cc}const ja={DRAWSTART:"drawstart",DRAWEND:"drawend",DRAWABORT:"drawabort"};class Ba extends ii{constructor(t,i){super(t),this.feature=i}}class JT extends cs{constructor(t){const i=t;i.stopDown||(i.stopDown=ks),super(i),this.on,this.once,this.un,this.options_=t,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=t.source?t.source:null,this.features_=t.features?t.features:null,this.snapTolerance_=t.snapTolerance?t.snapTolerance:12,this.type_=t.type,this.mode_=tR(this.type_),this.stopClick_=!!t.stopClick,this.ignoreNextUpEvent_=!1,this.minPoints_=t.minPoints?t.minPoints:this.mode_==="Polygon"?3:2,this.maxPoints_=this.mode_==="Circle"?2:t.maxPoints?t.maxPoints:1/0,this.finishCondition_=t.finishCondition?t.finishCondition:wn,this.geometryLayout_=t.geometryLayout?t.geometryLayout:"XY";let n=t.geometryFunction;if(!n){const s=this.mode_;if(s==="Circle")n=(r,o,a)=>{const l=o||new ph([NaN,NaN]),h=Ft(r[0]),c=mn(h,Ft(r[r.length-1]));return l.setCenterAndRadius(h,Math.sqrt(c),this.geometryLayout_),l};else{let r;s==="Point"?r=yn:s==="LineString"?r=En:s==="Polygon"&&(r=Fi),n=(o,a,l)=>(a?s==="Polygon"?o[0].length?a.setCoordinates([o[0].concat([o[0][0]])],this.geometryLayout_):a.setCoordinates([],this.geometryLayout_):a.setCoordinates(o,this.geometryLayout_):a=new r(o,this.geometryLayout_),a)}}this.geometryFunction_=n,this.dragVertexDelay_=t.dragVertexDelay!==void 0?t.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.overlay_=new xh({source:new vh({useSpatialIndex:!1,wrapX:t.wrapX?t.wrapX:!1}),style:t.style?t.style:QT(),updateWhileInteracting:!0}),this.geometryName_=t.geometryName,this.condition_=t.condition?t.condition:nf,this.freehandCondition_,t.freehand?this.freehandCondition_=xr:this.freehandCondition_=t.freehandCondition?t.freehandCondition:vl,this.traceCondition_,this.setTrace(t.trace||!1),this.traceState_={active:!1},this.traceSource_=t.traceSource||t.source||null,this.addChangeListener(Wc.ACTIVE,this.updateState_)}setTrace(t){let i;t?t===!0?i=xr:i=t:i=yl,this.traceCondition_=i}setMap(t){super.setMap(t),this.updateState_()}setFreehand(t){this.freehand_=t,this.freehand_?this.freehandCondition_=xr:this.freehandCondition_=this.options_&&this.options_.freehandCondition?this.options_.freehandCondition:vl}getOverlay(){return this.overlay_}getFreehand(){return this.freehand_}handleEvent(t){t.originalEvent.type===at.CONTEXTMENU&&t.originalEvent.preventDefault(),this.freehand_=this.mode_!=="Point"&&this.freehandCondition_(t);let i=t.type===vt.POINTERMOVE,n=!0;return!this.freehand_&&this.lastDragTime_&&t.type===vt.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&this.downTimeout_!==void 0&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)),this.freehand_&&t.type===vt.POINTERDRAG&&this.sketchFeature_!==null?(this.addToDrawing_(t.coordinate),n=!1):this.freehand_&&t.type===vt.POINTERDOWN?n=!1:i&&this.getPointerCount()<2?(n=t.type===vt.POINTERMOVE,n&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.originalEvent.preventDefault()):(t.originalEvent.pointerType==="mouse"||t.type===vt.POINTERDRAG&&this.downTimeout_===void 0)&&this.handlePointerMove_(t)):t.type===vt.DBLCLICK&&(n=!1),super.handleEvent(t)&&n}handleDownEvent(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(()=>{this.handlePointerMove_(new an(vt.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))},this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(t){if(!this.traceSource_||!this.traceCondition_(t))return;if(this.traceState_.active){this.deactivateTrace_();return}const i=this.getMap(),n=i.getCoordinateFromPixel([t.pixel[0]-this.snapTolerance_,t.pixel[1]+this.snapTolerance_]),s=i.getCoordinateFromPixel([t.pixel[0]+this.snapTolerance_,t.pixel[1]-this.snapTolerance_]),r=Qt([n,s]),o=this.traceSource_.getFeaturesInExtent(r);if(o.length===0)return;const a=e1(t.coordinate,o);a.length&&(this.traceState_={active:!0,startCoord:t.coordinate.slice(),targets:a,targetIndex:-1})}addOrRemoveTracedCoordinates_(t,i){const n=t.startIndex<=t.endIndex,s=t.startIndex<=i;n===s?n&&i>t.endIndex||!n&&i<t.endIndex?this.addTracedCoordinates_(t,t.endIndex,i):(n&&i<t.endIndex||!n&&i>t.endIndex)&&this.removeTracedCoordinates_(i,t.endIndex):(this.removeTracedCoordinates_(t.startIndex,t.endIndex),this.addTracedCoordinates_(t,t.startIndex,i))}removeTracedCoordinates_(t,i){if(t===i)return;let n=0;if(t<i){const s=Math.ceil(t);let r=Math.floor(i);r===i&&(r-=1),n=r-s+1}else{const s=Math.floor(t);let r=Math.ceil(i);r===i&&(r+=1),n=s-r+1}n>0&&this.removeLastPoints_(n)}addTracedCoordinates_(t,i,n){if(i===n)return;const s=[];if(i<n){const r=Math.ceil(i);let o=Math.floor(n);o===n&&(o-=1);for(let a=r;a<=o;++a)s.push(qn(t.coordinates,a))}else{const r=Math.floor(i);let o=Math.ceil(n);o===n&&(o+=1);for(let a=r;a>=o;--a)s.push(qn(t.coordinates,a))}s.length&&this.appendCoordinates(s)}updateTrace_(t){const i=this.traceState_;if(!i.active)return;if(i.targetIndex===-1){const a=t.map.getPixelFromCoordinate(i.startCoord);if(rr(a,t.pixel)<this.snapTolerance_)return}const n=t1(t.coordinate,i,this.getMap(),this.snapTolerance_);if(i.targetIndex!==n.index){if(i.targetIndex!==-1){const l=i.targets[i.targetIndex];this.removeTracedCoordinates_(l.startIndex,l.endIndex)}const a=i.targets[n.index];this.addTracedCoordinates_(a,a.startIndex,n.endIndex)}else{const a=i.targets[i.targetIndex];this.addOrRemoveTracedCoordinates_(a,n.endIndex)}i.targetIndex=n.index;const s=i.targets[i.targetIndex];s.endIndex=n.endIndex;const r=fr(s.coordinates,s.endIndex),o=this.getMap().getPixelFromCoordinate(r);t.coordinate=r,t.pixel=[Math.round(o[0]),Math.round(o[1])]}handleDragEvent(t){this.ignoreNextUpEvent_=!0,super.handleDragEvent(t)}handleUpEvent(t){let i=!0;if(this.getPointerCount()===0){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);const n=this.traceState_.active;if(this.ignoreNextUpEvent_||this.toggleTraceState_(t),this.shouldHandle_){const s=!this.finishCoordinate_;s&&this.startDrawing_(t.coordinate),!s&&this.freehand_?this.finishDrawing():!this.freehand_&&(!s||this.mode_==="Point")&&(this.atFinish_(t.pixel,n)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),i=!1}else this.freehand_&&this.abortDrawing()}return this.ignoreNextUpEvent_=!1,!i&&this.stopClick_&&t.preventDefault(),i}handlePointerMove_(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const i=this.downPx_,n=t.pixel,s=i[0]-n[0],r=i[1]-n[1],o=s*s+r*r;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}if(!this.finishCoordinate_){this.createOrUpdateSketchPoint_(t.coordinate.slice());return}this.updateTrace_(t),this.modifyDrawing_(t.coordinate)}atFinish_(t,i){let n=!1;if(this.sketchFeature_){let s=!1,r=[this.finishCoordinate_];const o=this.mode_;if(o==="Point")n=!0;else if(o==="Circle")n=this.sketchCoords_.length===2;else if(o==="LineString")s=!i&&this.sketchCoords_.length>this.minPoints_;else if(o==="Polygon"){const a=this.sketchCoords_;s=a[0].length>this.minPoints_,r=[a[0][0],a[0][a[0].length-2]],i?r=[a[0][0]]:r=[a[0][0],a[0][a[0].length-2]]}if(s){const a=this.getMap();for(let l=0,h=r.length;l<h;l++){const c=r[l],u=a.getPixelFromCoordinate(c),f=t[0]-u[0],d=t[1]-u[1],g=this.freehand_?1:this.snapTolerance_;if(n=Math.sqrt(f*f+d*d)<=g,n){this.finishCoordinate_=c;break}}}}return n}createOrUpdateSketchPoint_(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new _i(new yn(t)),this.updateSketchFeatures_())}createOrUpdateCustomSketchLine_(t){this.sketchLine_||(this.sketchLine_=new _i);const i=t.getLinearRing(0);let n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(i.getLayout(),i.getFlatCoordinates()),n.changed()):(n=new En(i.getFlatCoordinates(),i.getLayout()),this.sketchLine_.setGeometry(n))}startDrawing_(t){const i=this.getMap().getView().getProjection(),n=_l(this.geometryLayout_);for(;t.length<n;)t.push(0);this.finishCoordinate_=t,this.mode_==="Point"?this.sketchCoords_=t.slice():this.mode_==="Polygon"?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new _i(new En(this.sketchLineCoords_)));const s=this.geometryFunction_(this.sketchCoords_,void 0,i);this.sketchFeature_=new _i,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(s),this.updateSketchFeatures_(),this.dispatchEvent(new Ba(ja.DRAWSTART,this.sketchFeature_))}modifyDrawing_(t){const i=this.getMap(),n=this.sketchFeature_.getGeometry(),s=i.getView().getProjection(),r=_l(this.geometryLayout_);let o,a;for(;t.length<r;)t.push(0);this.mode_==="Point"?a=this.sketchCoords_:this.mode_==="Polygon"?(o=this.sketchCoords_[0],a=o[o.length-1],this.atFinish_(i.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):(o=this.sketchCoords_,a=o[o.length-1]),a[0]=t[0],a[1]=t[1],this.geometryFunction_(this.sketchCoords_,n,s),this.sketchPoint_&&this.sketchPoint_.getGeometry().setCoordinates(t),n.getType()==="Polygon"&&this.mode_!=="Polygon"?this.createOrUpdateCustomSketchLine_(n):this.sketchLineCoords_&&this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_),this.updateSketchFeatures_()}addToDrawing_(t){const i=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection();let s,r;const o=this.mode_;return o==="LineString"||o==="Circle"?(this.finishCoordinate_=t.slice(),r=this.sketchCoords_,r.length>=this.maxPoints_&&(this.freehand_?r.pop():s=!0),r.push(t.slice()),this.geometryFunction_(r,i,n)):o==="Polygon"&&(r=this.sketchCoords_[0],r.length>=this.maxPoints_&&(this.freehand_?r.pop():s=!0),r.push(t.slice()),s&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,i,n)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),s?this.finishDrawing():this.sketchFeature_}removeLastPoints_(t){if(!this.sketchFeature_)return;const i=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),s=this.mode_;for(let r=0;r<t;++r){let o;if(s==="LineString"||s==="Circle"){if(o=this.sketchCoords_,o.splice(-2,1),o.length>=2){this.finishCoordinate_=o[o.length-2].slice();const a=this.finishCoordinate_.slice();o[o.length-1]=a,this.createOrUpdateSketchPoint_(a)}this.geometryFunction_(o,i,n),i.getType()==="Polygon"&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(i)}else if(s==="Polygon"){o=this.sketchCoords_[0],o.splice(-2,1);const a=this.sketchLine_.getGeometry();if(o.length>=2){const l=o[o.length-2].slice();o[o.length-1]=l,this.createOrUpdateSketchPoint_(l)}a.setCoordinates(o),this.geometryFunction_(this.sketchCoords_,i,n)}if(o.length===1){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const t=this.abortDrawing_();if(!t)return null;let i=this.sketchCoords_;const n=t.getGeometry(),s=this.getMap().getView().getProjection();return this.mode_==="LineString"?(i.pop(),this.geometryFunction_(i,n,s)):this.mode_==="Polygon"&&(i[0].pop(),this.geometryFunction_(i,n,s),i=n.getCoordinates()),this.type_==="MultiPoint"?t.setGeometry(new yh([i])):this.type_==="MultiLineString"?t.setGeometry(new Qo([i])):this.type_==="MultiPolygon"&&t.setGeometry(new ta([i])),this.dispatchEvent(new Ba(ja.DRAWEND,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t),t}abortDrawing_(){this.finishCoordinate_=null;const t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),t}abortDrawing(){const t=this.abortDrawing_();t&&this.dispatchEvent(new Ba(ja.DRAWABORT,t))}appendCoordinates(t){const i=this.mode_,n=!this.sketchFeature_;n&&this.startDrawing_(t[0]);let s;if(i==="LineString"||i==="Circle")s=this.sketchCoords_;else if(i==="Polygon")s=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[];else return;n&&s.shift(),s.pop();for(let o=0;o<t.length;o++)this.addToDrawing_(t[o]);const r=t[t.length-1];this.sketchFeature_=this.addToDrawing_(r),this.modifyDrawing_(r)}extend(t){const n=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=n.getCoordinates();const s=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=s.slice(),this.sketchCoords_.push(s.slice()),this.sketchPoint_=new _i(new yn(s)),this.updateSketchFeatures_(),this.dispatchEvent(new Ba(ja.DRAWSTART,this.sketchFeature_))}updateSketchFeatures_(){const t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);const i=this.overlay_.getSource();i.clear(!0),i.addFeatures(t)}updateState_(){const t=this.getMap(),i=this.getActive();(!t||!i)&&this.abortDrawing(),this.overlay_.setMap(i?t:null)}}function QT(){const e=cf();return function(t,i){return e[t.getGeometry().getType()]}}function tR(e){switch(e){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+e)}}const Dg=0,Io=1,Ng=[0,0,0,0],Cr=[],uc={MODIFYSTART:"modifystart",MODIFYEND:"modifyend"};function fc(e,t,i){let n;switch(t){case"LineString":n=e;break;case"MultiLineString":case"Polygon":n=e[i[0]];break;case"MultiPolygon":n=e[i[1]][i[0]];break}return n}class dc extends ii{constructor(t,i,n){super(t),this.features=i,this.mapBrowserEvent=n}}class s1 extends cs{constructor(t){super(t),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=t.condition?t.condition:k0,this.defaultDeleteCondition_=function(n){return Wx(n)&&D0(n)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:xr,this.vertexFeature_=null,this.vertexSegments_=null,this.lastCoordinate_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new Gl,this.pixelTolerance_=t.pixelTolerance!==void 0?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new xh({source:new vh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:iR(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.traceSource_=t.traceSource||t.source||null,this.traceCondition_,this.setTrace(t.trace||!1),this.traceState_={active:!1},this.traceSegments_=null,this.hitDetection_=null;let i;if(t.features?i=t.features:t.source&&(this.source_=t.source,i=new Me(this.source_.getFeatures()),this.source_.addEventListener(Pe.ADDFEATURE,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Pe.REMOVEFEATURE,this.handleSourceRemove_.bind(this))),!i)throw new Error("The modify interaction requires features, a source or a layer");t.hitDetection&&(this.hitDetection_=t.hitDetection),this.features_=i,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(te.ADD,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(te.REMOVE,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=t.snapToPointer===void 0?!this.hitDetection_:t.snapToPointer}setTrace(t){let i;t?t===!0?i=xr:i=t:i=yl,this.traceCondition_=i}addFeature_(t){const i=t.getGeometry();if(i){const s=this.SEGMENT_WRITERS_[i.getType()];s&&s(t,i)}const n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastCoordinate_),t.addEventListener(at.CHANGE,this.boundHandleFeatureChange_)}willModifyFeatures_(t,i){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Me;const n=this.featuresBeingModified_.getArray();for(let s=0,r=i.length;s<r;++s){const o=i[s].feature;o&&!n.includes(o)&&this.featuresBeingModified_.push(o)}this.featuresBeingModified_.getLength()===0?this.featuresBeingModified_=null:this.dispatchEvent(new dc(uc.MODIFYSTART,this.featuresBeingModified_,t))}}removeFeature_(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&this.features_.getLength()===0&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(at.CHANGE,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(t){const i=this.rBush_,n=[];i.forEach(function(s){t===s.feature&&n.push(s)});for(let s=n.length-1;s>=0;--s){const r=n[s];for(let o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===r&&this.dragSegments_.splice(o,1);i.remove(r)}}setActive(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(t)}setMap(t){this.overlay_.setMap(t),super.setMap(t)}getOverlay(){return this.overlay_}handleSourceAdd_(t){t.feature&&this.features_.push(t.feature)}handleSourceRemove_(t){t.feature&&this.features_.remove(t.feature)}handleFeatureAdd_(t){this.addFeature_(t.element)}handleFeatureChange_(t){if(!this.changingFeature_){const i=t.target;this.removeFeature_(i),this.addFeature_(i)}}handleFeatureRemove_(t){this.removeFeature_(t.element)}writePointGeometry_(t,i){const n=i.getCoordinates(),s={feature:t,geometry:i,segment:[n,n]};this.rBush_.insert(i.getExtent(),s)}writeMultiPointGeometry_(t,i){const n=i.getCoordinates();for(let s=0,r=n.length;s<r;++s){const o=n[s],a={feature:t,geometry:i,depth:[s],index:s,segment:[o,o]};this.rBush_.insert(i.getExtent(),a)}}writeLineStringGeometry_(t,i){const n=i.getCoordinates();for(let s=0,r=n.length-1;s<r;++s){const o=n.slice(s,s+2),a={feature:t,geometry:i,index:s,segment:o};this.rBush_.insert(Qt(o),a)}}writeMultiLineStringGeometry_(t,i){const n=i.getCoordinates();for(let s=0,r=n.length;s<r;++s){const o=n[s];for(let a=0,l=o.length-1;a<l;++a){const h=o.slice(a,a+2),c={feature:t,geometry:i,depth:[s],index:a,segment:h};this.rBush_.insert(Qt(h),c)}}}writePolygonGeometry_(t,i){const n=i.getCoordinates();for(let s=0,r=n.length;s<r;++s){const o=n[s];for(let a=0,l=o.length-1;a<l;++a){const h=o.slice(a,a+2),c={feature:t,geometry:i,depth:[s],index:a,segment:h};this.rBush_.insert(Qt(h),c)}}}writeMultiPolygonGeometry_(t,i){const n=i.getCoordinates();for(let s=0,r=n.length;s<r;++s){const o=n[s];for(let a=0,l=o.length;a<l;++a){const h=o[a];for(let c=0,u=h.length-1;c<u;++c){const f=h.slice(c,c+2),d={feature:t,geometry:i,depth:[a,s],index:c,segment:f};this.rBush_.insert(Qt(f),d)}}}}writeCircleGeometry_(t,i){const n=i.getCenter(),s={feature:t,geometry:i,index:Dg,segment:[n,n]},r={feature:t,geometry:i,index:Io,segment:[n,n]},o=[s,r];s.featureSegments=o,r.featureSegments=o,this.rBush_.insert(xo(n),s);let a=i;this.rBush_.insert(a.getExtent(),r)}writeGeometryCollectionGeometry_(t,i){const n=i.getGeometriesArray();for(let s=0;s<n.length;++s){const r=n[s],o=this.SEGMENT_WRITERS_[r.getType()];o(t,r)}}createOrUpdateVertexFeature_(t,i,n,s){let r=this.vertexFeature_;return r?r.getGeometry().setCoordinates(t):(r=new _i(new yn(t)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r)),r.set("features",i),r.set("geometries",n),r.set("existing",s),r}handleEvent(t){if(!t.originalEvent)return!0;this.lastPointerEvent_=t;let i;return!t.map.getView().getInteracting()&&t.type==vt.POINTERMOVE&&!this.handlingDownUpSequence&&this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(t.type!=vt.SINGLECLICK||!this.ignoreNextSingleClick_?i=this.removePoint():i=!0),t.type==vt.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(t)&&!i}findInsertVerticesAndUpdateDragSegments_(t){if(this.handlePointerAtPixel_(t),this.dragSegments_.length=0,this.featuresBeingModified_=null,!this.vertexFeature_)return;this.getMap().getView().getProjection();const n=[],s=this.vertexFeature_.getGeometry().getCoordinates(),r=Qt([s]),o=this.rBush_.getInExtent(r),a={};o.sort(eR);for(let l=0,h=o.length;l<h;++l){const c=o[l],u=c.segment;let f=ht(c.geometry);const d=c.depth;if(d&&(f+="-"+d.join("-")),a[f]||(a[f]=new Array(2)),c.geometry.getType()==="Circle"&&c.index===Io){const g=jg(t,c);Ne(g,s)&&!a[f][0]&&(this.dragSegments_.push([c,0]),a[f][0]=c);continue}if(Ne(u[0],s)&&!a[f][0]){this.dragSegments_.push([c,0]),a[f][0]=c;continue}if(Ne(u[1],s)&&!a[f][1]){if(a[f][0]&&a[f][0].index===0){let g=c.geometry.getCoordinates();switch(c.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":g=g[d[1]];case"Polygon":if(c.index!==g[d[0]].length-2)continue;break}}this.dragSegments_.push([c,1]),a[f][1]=c;continue}ht(u)in this.vertexSegments_&&!a[f][0]&&!a[f][1]&&n.push(c)}return n}deactivateTrace_(){this.traceState_={active:!1}}updateTrace_(t){const i=this.traceState_;if(!i.active)return;if(i.targetIndex===-1){const r=t.map.getPixelFromCoordinate(i.startCoord);if(rr(r,t.pixel)<this.pixelTolerance_)return}const n=t1(t.coordinate,i,t.map,this.pixelTolerance_);if(i.targetIndex===-1&&Math.sqrt(n.closestTargetDistance)/t.map.getView().getResolution()>this.pixelTolerance_)return;if(i.targetIndex!==n.index){if(i.targetIndex!==-1){const o=i.targets[i.targetIndex];this.removeTracedCoordinates_(o.startIndex,o.endIndex)}else for(const o of this.traceSegments_){const a=o[0],l=a.geometry,h=o[1],c=l.getCoordinates();fc(c,l.getType(),a.depth).splice(a.index+h,1),l.setCoordinates(c),h===0&&(a.index-=1)}const r=i.targets[n.index];this.addTracedCoordinates_(r,r.startIndex,n.endIndex)}else{const r=i.targets[i.targetIndex];this.addOrRemoveTracedCoordinates_(r,n.endIndex)}i.targetIndex=n.index;const s=i.targets[i.targetIndex];s.endIndex=n.endIndex}getTraceCandidates_(t){const i=this.getMap(),n=this.pixelTolerance_,s=i.getCoordinateFromPixel([t.pixel[0]-n,t.pixel[1]+n]),r=i.getCoordinateFromPixel([t.pixel[0]+n,t.pixel[1]-n]),o=Qt([s,r]);return this.traceSource_.getFeaturesInExtent(o)}toggleTraceState_(t){if(!this.traceSource_||!this.traceCondition_(t))return;if(this.traceState_.active){this.deactivateTrace_(),this.traceSegments_=null;return}const i=this.getTraceCandidates_(t);if(i.length===0)return;const n=e1(t.coordinate,i);n.length&&(this.traceState_={active:!0,startCoord:t.coordinate.slice(),targets:n,targetIndex:-1})}addOrRemoveTracedCoordinates_(t,i){const n=t.startIndex<=t.endIndex,s=t.startIndex<=i;n===s?n&&i>t.endIndex||!n&&i<t.endIndex?this.addTracedCoordinates_(t,t.endIndex,i):(n&&i<t.endIndex||!n&&i>t.endIndex)&&this.removeTracedCoordinates_(i,t.endIndex):(this.removeTracedCoordinates_(t.startIndex,t.endIndex),this.addTracedCoordinates_(t,t.startIndex,i))}removeTracedCoordinates_(t,i){if(t===i)return;let n=0;if(t<i){const s=Math.ceil(t);let r=Math.floor(i);r===i&&(r-=1),n=r-s+1}else{const s=Math.floor(t);let r=Math.ceil(i);r===i&&(r+=1),n=s-r+1}if(n>0)for(const s of this.traceSegments_){const r=s[0],o=r.geometry,a=s[1];let l=s[0].index+1;a===1&&(l-=n);const h=o.getCoordinates();fc(h,o.getType(),r.depth).splice(l,n),o.setCoordinates(h),a===1&&(r.index-=n)}}addTracedCoordinates_(t,i,n){if(i===n)return;const s=[];if(i<n){const r=Math.ceil(i);let o=Math.floor(n);o===n&&(o-=1);for(let a=r;a<=o;++a)s.push(qn(t.coordinates,a))}else{const r=Math.floor(i);let o=Math.ceil(n);o===n&&(o+=1);for(let a=r;a>=o;--a)s.push(qn(t.coordinates,a))}if(s.length)for(const r of this.traceSegments_){const o=r[0],a=o.geometry,l=r[1],h=o.index+1;l===0&&s.reverse();const c=a.getCoordinates();fc(c,a.getType(),o.depth).splice(h,0,...s),a.setCoordinates(c),l===1&&(o.index+=s.length)}}updateGeometry_(t,i){const n=i[0],s=n.depth;let r;const o=n.segment,a=n.geometry,l=i[1];for(;t.length<a.getStride();)t.push(o[l][t.length]);switch(a.getType()){case"Point":r=t,o[0]=t,o[1]=t;break;case"MultiPoint":r=a.getCoordinates(),r[n.index]=t,o[0]=t,o[1]=t;break;case"LineString":r=a.getCoordinates(),r[n.index+l]=t,o[l]=t;break;case"MultiLineString":r=a.getCoordinates(),r[s[0]][n.index+l]=t,o[l]=t;break;case"Polygon":r=a.getCoordinates(),r[s[0]][n.index+l]=t,o[l]=t;break;case"MultiPolygon":r=a.getCoordinates(),r[s[1]][s[0]][n.index+l]=t,o[l]=t;break;case"Circle":const h=a;if(o[0]=t,o[1]=t,n.index===Dg)this.changingFeature_=!0,h.setCenter(t),this.changingFeature_=!1;else{this.changingFeature_=!0,this.getMap().getView().getProjection();let c=rr(Ft(h.getCenter()),Ft(t));h.setRadius(c),this.changingFeature_=!1}break}r&&this.setGeometryCoordinates_(a,r)}handleDragEvent(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_.map(([o])=>o));const i=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],n=[],s=[],r=this.traceState_.active&&!this.traceSegments_?this.traceState_.startCoord:null;if(r){this.traceSegments_=[];for(const o of this.dragSegments_){const a=o[0];rr(eh(r,a.segment),r)/t.map.getView().getResolution()<1&&this.traceSegments_.push(o)}}for(let o=0,a=this.dragSegments_.length;o<a;++o){const l=this.dragSegments_[o],h=l[0],c=h.feature;n.includes(c)||n.push(c);const u=h.geometry;s.includes(u)||s.push(u),this.updateGeometry_(i,l)}this.updateTrace_(t),this.createOrUpdateVertexFeature_(i,n,s,!0)}handleDownEvent(t){if(!this.condition_(t))return!1;const i=t.coordinate,n=this.findInsertVerticesAndUpdateDragSegments_(i);if(n?.length&&this.insertVertexCondition_(t)&&(this.willModifyFeatures_(t,n),this.vertexFeature_)){const s=this.vertexFeature_.getGeometry().getCoordinates();for(let r=n.length-1;r>=0;--r)this.insertVertex_(n[r],s);this.ignoreNextSingleClick_=!0}return!!this.vertexFeature_}handleUpEvent(t){for(let i=this.dragSegments_.length-1;i>=0;--i){const n=this.dragSegments_[i][0],s=n.geometry;if(s.getType()==="Circle"){const r=s,o=r.getCenter(),a=n.featureSegments[0],l=n.featureSegments[1];a.segment[0]=o,a.segment[1]=o,l.segment[0]=o,l.segment[1]=o,this.rBush_.update(xo(o),a);let h=r;this.rBush_.update(h.getExtent(),l)}else this.rBush_.update(Qt(n.segment),n)}return this.featuresBeingModified_&&(this.toggleTraceState_(t),this.dispatchEvent(new dc(uc.MODIFYEND,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1}handlePointerMove_(t){this.lastCoordinate_=t.coordinate,this.handlePointerAtPixel_(this.lastCoordinate_)}handlePointerAtPixel_(t){const i=this.getMap(),n=i.getPixelFromCoordinate(t);i.getView().getProjection();const s=function(a,l){return kg(t,a)-kg(t,l)};let r,o;if(this.hitDetection_){const a=typeof this.hitDetection_=="object"?l=>l===this.hitDetection_:void 0;i.forEachFeatureAtPixel(n,(l,h,c)=>{c&&c.getType()==="Point"&&(c=new yn(os(c.getCoordinates())));const u=c||l.getGeometry();if(u&&u.getType()==="Point"&&l instanceof _i&&this.features_.getArray().includes(l)){o=u;const f=l.getGeometry().getFlatCoordinates().slice(0,2);r=[{feature:l,geometry:o,segment:[f,f]}]}return!0},{layerFilter:a})}if(!r){const a=dn(xo(t,Ng)),l=i.getView().getResolution()*this.pixelTolerance_,h=sh(bs(a,l,Ng));r=this.rBush_.getInExtent(h)}if(r&&r.length>0){const a=r.sort(s)[0],l=a.segment;let h=jg(t,a);const c=i.getPixelFromCoordinate(h);let u=rr(n,c);if(o||u<=this.pixelTolerance_){const f={};if(f[ht(l)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-t[0],this.delta_[1]=h[1]-t[1]),a.geometry.getType()==="Circle"&&a.index===Io)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[a.feature],[a.geometry],this.snappedToVertex_);else{const d=i.getPixelFromCoordinate(l[0]),g=i.getPixelFromCoordinate(l[1]),_=mn(c,d),m=mn(c,g);if(u=Math.sqrt(Math.min(_,m)),this.snappedToVertex_=u<=this.pixelTolerance_,!this.snappedToVertex_&&!this.insertVertexCondition_(this.lastPointerEvent_)){this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null);return}this.snappedToVertex_&&(h=_>m?l[1]:l[0]),this.createOrUpdateVertexFeature_(h,[a.feature],[a.geometry],this.snappedToVertex_);const p={};p[ht(a.geometry)]=!0;for(let y=1,S=r.length;y<S;++y){const v=r[y].segment;if(Ne(l[0],v[0])&&Ne(l[1],v[1])||Ne(l[0],v[1])&&Ne(l[1],v[0])){const M=ht(r[y].geometry);M in p||(p[M]=!0,f[ht(v)]=!0)}else break}}this.vertexSegments_=f;return}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(t,i){const n=t.segment,s=t.feature,r=t.geometry,o=t.depth,a=t.index;let l;for(;i.length<r.getStride();)i.push(0);switch(r.getType()){case"MultiLineString":l=r.getCoordinates(),l[o[0]].splice(a+1,0,i);break;case"Polygon":l=r.getCoordinates(),l[o[0]].splice(a+1,0,i);break;case"MultiPolygon":l=r.getCoordinates(),l[o[1]][o[0]].splice(a+1,0,i);break;case"LineString":l=r.getCoordinates(),l.splice(a+1,0,i);break;default:return!1}this.setGeometryCoordinates_(r,l);const h=this.rBush_;h.remove(t),this.updateSegmentIndices_(r,a,o,1);const c={segment:[n[0],i],feature:s,geometry:r,depth:o,index:a};h.insert(Qt(c.segment),c),this.dragSegments_.push([c,1]);const u={segment:[i,n[1]],feature:s,geometry:r,depth:o,index:a+1};return h.insert(Qt(u.segment),u),this.dragSegments_.push([u,0]),!0}updatePointer_(t){return t&&this.findInsertVerticesAndUpdateDragSegments_(t),this.vertexFeature_?.getGeometry().getCoordinates()}getPoint(){const t=this.vertexFeature_?.getGeometry().getCoordinates();return t?os(t,this.getMap().getView().getProjection()):null}canRemovePoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(n=>n.getType()==="Circle"||n.getType().endsWith("Point")))return!1;const t=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(Qt([t])).some(({segment:n})=>Ne(n[0],t)||Ne(n[1],t))}removePoint(t){if(t&&(t=Ft(t,this.getMap().getView().getProjection()),this.updatePointer_(t)),!this.lastPointerEvent_||this.lastPointerEvent_&&this.lastPointerEvent_.type!=vt.POINTERDRAG){const i=this.lastPointerEvent_;this.willModifyFeatures_(i,this.dragSegments_.map(([s])=>s));const n=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new dc(uc.MODIFYEND,this.featuresBeingModified_,i)),this.featuresBeingModified_=null,n}return!1}removeVertex_(){const t=this.dragSegments_,i={};let n=!1,s,r,o,a,l,h,c,u,f,d,g;for(l=t.length-1;l>=0;--l)o=t[l],d=o[0],g=ht(d.feature),d.depth&&(g+="-"+d.depth.join("-")),g in i||(i[g]={}),o[1]===0?(i[g].right=d,i[g].index=d.index):o[1]==1&&(i[g].left=d,i[g].index=d.index+1);for(g in i){switch(f=i[g].right,c=i[g].left,h=i[g].index,u=h-1,c!==void 0?d=c:d=f,u<0&&(u=0),a=d.geometry,r=a.getCoordinates(),s=r,n=!1,a.getType()){case"MultiLineString":r[d.depth[0]].length>2&&(r[d.depth[0]].splice(h,1),n=!0);break;case"LineString":r.length>2&&(r.splice(h,1),n=!0);break;case"MultiPolygon":s=s[d.depth[1]];case"Polygon":s=s[d.depth[0]],s.length>4&&(h==s.length-1&&(h=0),s.splice(h,1),n=!0,h===0&&(s.pop(),s.push(s[0]),u=s.length-1));break}if(n){this.setGeometryCoordinates_(a,r);const _=[];if(c!==void 0&&(this.rBush_.remove(c),_.push(c.segment[0])),f!==void 0&&(this.rBush_.remove(f),_.push(f.segment[1])),c!==void 0&&f!==void 0){const m={depth:d.depth,feature:d.feature,geometry:d.geometry,index:u,segment:_};this.rBush_.insert(Qt(m.segment),m)}this.updateSegmentIndices_(a,h,d.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.length=0}}return n}canInsertPoint(){if(!this.vertexFeature_||this.vertexFeature_.get("geometries").every(n=>n.getType()==="Circle"||n.getType().endsWith("Point")))return!1;const t=this.vertexFeature_.getGeometry().getCoordinates();return this.rBush_.getInExtent(Qt([t])).some(({segment:n})=>!(Ne(n[0],t)||Ne(n[1],t)))}insertPoint(t){const i=t?Ft(t,this.getMap().getView().getProjection()):this.vertexFeature_?.getGeometry().getCoordinates();return i?this.findInsertVerticesAndUpdateDragSegments_(i).reduce((s,r)=>s||this.insertVertex_(r,i),!1):!1}setGeometryCoordinates_(t,i){this.changingFeature_=!0,t.setCoordinates(i),this.changingFeature_=!1}updateSegmentIndices_(t,i,n,s){this.rBush_.forEachInExtent(t.getExtent(),function(r){r.geometry===t&&(n===void 0||r.depth===void 0||In(r.depth,n))&&r.index>i&&(r.index+=s)})}}function eR(e,t){return e.index-t.index}function kg(e,t,i){const n=t.geometry;if(n.getType()==="Circle"){let r=n;if(t.index===Io){const o=mn(r.getCenter(),Ft(e)),a=Math.sqrt(o)-r.getRadius();return a*a}}const s=Ft(e);return Cr[0]=Ft(t.segment[0]),Cr[1]=Ft(t.segment[1]),iv(s,Cr)}function jg(e,t,i){const n=t.geometry;if(n.getType()==="Circle"&&t.index===Io)return os(n.getClosestPoint(Ft(e)));const s=Ft(e);return Cr[0]=Ft(t.segment[0]),Cr[1]=Ft(t.segment[1]),os(eh(s,Cr))}function iR(){const e=cf();return function(t,i){return e.Point}}const nR=_e({__name:"OlStyle",props:{zIndex:{},overrideStyleFunction:{}},setup(e,{expose:t}){const i=e,n=Xt("stylable",void 0),s=Pn(i),r=Ee(()=>new fe(s)),o=l=>{const h=n?.value;if(h)if(h instanceof JT||h instanceof s1)h.getOverlay().setStyle(l),h.changed(),h.dispatchEvent("styleChanged");else try{h.setStyle(l),h.changed(),h.dispatchEvent("styleChanged")}catch{h.style_=l,h.values_.style=l,h.changed(),h.dispatchEvent("styleChanged")}},a=Ee(()=>(l,h)=>s.overrideStyleFunction?s.overrideStyleFunction(l,r.value,h):r.value);return ie(s,()=>o(s.overrideStyleFunction?a.value:r.value)),ei(()=>o(s.overrideStyleFunction?a.value:r.value)),wi(()=>{o(new fe)}),Mi("style",r),Mi("styledObj",n),t({style:r}),(l,h)=>(dt(),jt("div",null,[qi(l.$slots,"default")]))}}),za={SELECT:"select"};class Wa extends ii{constructor(t,i,n,s){super(t),this.selected=i,this.deselected=n,this.mapBrowserEvent=s}}const Ua={};class Rf extends Br{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=t.condition?t.condition:D0,this.addCondition_=t.addCondition?t.addCondition:yl,this.removeCondition_=t.removeCondition?t.removeCondition:yl,this.toggleCondition_=t.toggleCondition?t.toggleCondition:vl,this.multi_=t.multi?t.multi:!1,this.filter_=t.filter?t.filter:wn,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.style_=t.style!==void 0?t.style:sR(),this.features_=t.features||new Me;let i;if(t.layers)if(typeof t.layers=="function")i=t.layers;else{const n=t.layers;i=function(s){return n.includes(s)}}else i=wn;this.layerFilter_=i,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(t,i){this.featureLayerAssociation_[ht(t)]=i}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(t){return this.featureLayerAssociation_[ht(t)]}setHitTolerance(t){this.hitTolerance_=t}setMap(t){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(t),t?(this.features_.addEventListener(te.ADD,this.boundAddFeature_),this.features_.addEventListener(te.REMOVE,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(te.ADD,this.boundAddFeature_),this.features_.removeEventListener(te.REMOVE,this.boundRemoveFeature_))}addFeature_(t){const i=t.element;if(this.style_&&this.applySelectedStyle_(i),!this.getLayer(i)){const n=this.findLayerOfFeature_(i);n&&this.addFeatureLayerAssociation_(i,n)}}removeFeature_(t){this.style_&&this.restorePreviousStyle_(t.element)}findLayerOfFeature_(t){return this.getMap().getAllLayers().find(function(n){if(n instanceof xh&&n.getSource()&&n.getSource().hasFeature(t))return n})}getStyle(){return this.style_}applySelectedStyle_(t){const i=ht(t);i in Ua||(Ua[i]=t.getStyle()),t.setStyle(this.style_)}restorePreviousStyle_(t){const i=this.getMap().getInteractions().getArray();for(let s=i.length-1;s>=0;--s){const r=i[s];if(r!==this&&r instanceof Rf&&r.getStyle()&&r.getFeatures().getArray().lastIndexOf(t)!==-1){t.setStyle(r.getStyle());return}}const n=ht(t);t.setStyle(Ua[n]),delete Ua[n]}removeFeatureLayerAssociation_(t){delete this.featureLayerAssociation_[ht(t)]}selectFeatureInternal_(t,i,n){if(!(t instanceof _i)||!this.filter_(t,i))return;const s=this.getFeatures();return s.getArray().includes(t)||(this.addFeatureLayerAssociation_(t,i),s.push(t),n?.push(t)),t}selectFeature(t){const i=this.findLayerOfFeature_(t);if(!this.layerFilter_(i))return!1;const n=this.selectFeatureInternal_(t,i);return n&&this.dispatchEvent(new Wa(za.SELECT,[n],[],void 0)),!!n}removeFeatureInternal_(t,i){const n=this.getFeatures();if(!(!(t instanceof _i)||!n.getArray().includes(t)))return n.remove(t),this.removeFeatureLayerAssociation_(t),i?.push(t),t}deselectFeature(t){const i=this.removeFeatureInternal_(t);return i&&this.dispatchEvent(new Wa(za.SELECT,[],[i],void 0)),!!i}toggleFeature(t){this.deselectFeature(t)||this.selectFeature(t)}clearSelection(){js(this.featureLayerAssociation_);const t=this.getFeatures(),i=t.getArray().slice();t.clear(),i.length!==0&&this.dispatchEvent(new Wa(za.SELECT,[],i,void 0))}handleEvent(t){if(!this.condition_(t))return!0;const i=this.addCondition_(t),n=this.removeCondition_(t),s=this.toggleCondition_(t),r=!i&&!n&&!s,o=t.map,a=this.getFeatures(),l=[],h=[];if(r){let c=!1;o.forEachFeatureAtPixel(t.pixel,(u,f)=>{if(c=!0,!!this.selectFeatureInternal_(u,f,h))return!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let u=a.getLength()-1;u>=0;--u){const f=a.item(u);(h.length>0&&!h.includes(f)||!c)&&this.removeFeatureInternal_(f,l)}}else o.forEachFeatureAtPixel(t.pixel,(c,u)=>{let f;if((n||s)&&(f=this.removeFeatureInternal_(c,l)),(i||s)&&!f&&(f=this.selectFeatureInternal_(c,u,h)),!!f)return!this.multi_},{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});return(h.length>0||l.length>0)&&this.dispatchEvent(new Wa(za.SELECT,h,l,t)),!0}}function sR(){const e=cf();return xi(e.Polygon,e.LineString),xi(e.GeometryCollection,e.LineString),function(t){return t.getGeometry()?e[t.getGeometry().getType()]:null}}const gc={SNAP:"snap",UNSNAP:"unsnap"};class _c extends ii{constructor(t,i){super(t),this.vertex=i.vertex,this.vertexPixel=i.vertexPixel,this.feature=i.feature,this.segment=i.segment}}const r1={Circle(e,t){const n=nx(e);return r1.Polygon(n)},GeometryCollection(e,t){const i=[],n=e.getGeometriesArray();for(let s=0;s<n.length;++s){const r=this[n[s].getType()];r&&i.push(r(n[s],t))}return i.flat()},LineString(e){const t=[],i=e.getFlatCoordinates(),n=e.getStride();for(let s=0,r=i.length-n;s<r;s+=n)t.push([i.slice(s,s+2),i.slice(s+n,s+n+2)]);return t},MultiLineString(e){const t=[],i=e.getFlatCoordinates(),n=e.getStride(),s=e.getEnds();let r=0;for(let o=0,a=s.length;o<a;++o){const l=s[o];for(let h=r,c=l-n;h<c;h+=n)t.push([i.slice(h,h+2),i.slice(h+n,h+n+2)]);r=l}return t},MultiPoint(e){const t=[],i=e.getFlatCoordinates(),n=e.getStride();for(let s=0,r=i.length;s<r;s+=n)t.push([i.slice(s,s+2)]);return t},MultiPolygon(e){const t=[],i=e.getFlatCoordinates(),n=e.getStride(),s=e.getEndss();let r=0;for(let o=0,a=s.length;o<a;++o){const l=s[o];for(let h=0,c=l.length;h<c;++h){const u=l[h];for(let f=r,d=u-n;f<d;f+=n)t.push([i.slice(f,f+2),i.slice(f+n,f+n+2)]);r=u}}return t},Point(e){return[[e.getFlatCoordinates().slice(0,2)]]},Polygon(e){const t=[],i=e.getFlatCoordinates(),n=e.getStride(),s=e.getEnds();let r=0;for(let o=0,a=s.length;o<a;++o){const l=s[o];for(let h=r,c=l-n;h<c;h+=n)t.push([i.slice(h,h+2),i.slice(h+n,h+n+2)]);r=l}return t}};function Bg(e){return e.feature?e.feature:e.element?e.element:null}const mc=[],rn=[],Js=[];class rR extends cs{constructor(t){t=t||{},super({handleDownEvent:wn,stopDown:ks}),this.on,this.once,this.un,this.source_=t.source?t.source:null,this.vertex_=t.vertex!==void 0?t.vertex:!0,this.edge_=t.edge!==void 0?t.edge:!0,this.intersection_=t.intersection!==void 0?t.intersection:!1,this.features_=t.features?t.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelTolerance_=t.pixelTolerance!==void 0?t.pixelTolerance:10,this.rBush_=new Gl,this.snapped_=null,this.segmenters_=Object.assign({},r1,t.segmenters)}addFeature(t,i){i=i!==void 0?i:!0;const n=ht(t),s=t.getGeometry();if(s){const r=this.segmenters_[s.getType()];if(r){this.indexedFeaturesExtents_[n]=s.getExtent(ti());const o=r.call(this.segmenters_,s,this.getMap().getView().getProjection());let a=o.length;for(let l=0;l<a;++l){const h=o[l];rn[l]=Qt(h),Js[l]={feature:t,segment:h}}if(this.intersection_)for(let l=0,h=o.length;l<h;++l){const c=o[l];if(c.length===1)continue;const u=rn[l];for(let d=0,g=l-1;d<g;++d){const _=o[d];if(!Fe(u,rn[d]))continue;const m=Id(c,_);if(!m)continue;const p=[m];rn[a]=Qt(p),Js[a++]={feature:t,intersectionFeature:t,segment:p}}const f=this.rBush_.getInExtent(rn[l]);for(let d=0,g=f.length;d<g;++d){const _=f[d].segment;if(_.length===1)continue;const m=Id(c,_);if(!m)continue;const p=[m];rn[a]=Qt(p),Js[a++]={feature:t,intersectionFeature:f[d].feature,segment:p}}}a===1?this.rBush_.insert(rn[0],Js[0]):(rn.length=a,Js.length=a,this.rBush_.load(rn,Js))}}i&&(this.featureChangeListenerKeys_[n]&&Tt(this.featureChangeListenerKeys_[n]),this.featureChangeListenerKeys_[n]=_t(t,at.CHANGE,this.handleFeatureChange_,this))}getFeatures_(){let t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t}areSnapDataEqual_(t,i){return t.segment===i.segment&&t.feature===i.feature}handleEvent(t){const i=this.snapTo(t.pixel,t.coordinate,t.map);return i?(t.coordinate=i.vertex.slice(0,2),t.pixel=i.vertexPixel,this.snapped_&&!this.areSnapDataEqual_(this.snapped_,i)&&this.dispatchEvent(new _c(gc.UNSNAP,this.snapped_)),this.snapped_={vertex:t.coordinate,vertexPixel:t.pixel,feature:i.feature,segment:i.segment},this.dispatchEvent(new _c(gc.SNAP,this.snapped_))):this.snapped_&&(this.dispatchEvent(new _c(gc.UNSNAP,this.snapped_)),this.snapped_=null),super.handleEvent(t)}handleFeatureAdd_(t){const i=Bg(t);i&&this.addFeature(i)}handleFeatureRemove_(t){const i=Bg(t);i&&(this.removeFeature(i),delete this.pendingFeatures_[ht(i)])}handleFeatureChange_(t){const i=t.target;this.handlingDownUpSequence?this.pendingFeatures_[ht(i)]=i:this.updateFeature_(i)}handleUpEvent(t){const i=Object.values(this.pendingFeatures_);if(i.length){for(const n of i)this.updateFeature_(n);js(this.pendingFeatures_)}return!1}removeFeature(t,i){const n=i!==void 0?i:!0,s=ht(t),r=this.indexedFeaturesExtents_[s];if(r){const o=this.rBush_;o.getInExtent(r).forEach(a=>{(t===a.feature||t===a.intersectionFeature)&&o.remove(a)})}n&&(Tt(this.featureChangeListenerKeys_[s]),delete this.featureChangeListenerKeys_[s])}setMap(t){const i=this.getMap(),n=this.featuresListenerKeys_;let s=this.getFeatures_();if(Array.isArray(s)||(s=s.getArray()),i&&(n.forEach(Tt),n.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(Tt),this.featureChangeListenerKeys_={}),super.setMap(t),t){this.features_?n.push(_t(this.features_,te.ADD,this.handleFeatureAdd_,this),_t(this.features_,te.REMOVE,this.handleFeatureRemove_,this)):this.source_&&n.push(_t(this.source_,Pe.ADDFEATURE,this.handleFeatureAdd_,this),_t(this.source_,Pe.REMOVEFEATURE,this.handleFeatureRemove_,this));for(const r of s)this.addFeature(r)}}snapTo(t,i,n){n.getView().getProjection();const s=Ft(i),r=sh(bs(Qt([s]),n.getView().getResolution()*this.pixelTolerance_)),o=this.rBush_.getInExtent(r),a=o.length;if(a===0)return null;let l,h=1/0,c,u=null;const f=this.pixelTolerance_*this.pixelTolerance_,d=()=>{if(!l)return null;const g=n.getPixelFromCoordinate(l);return mn(t,g)>f?null:{vertex:l,vertexPixel:[Math.round(g[0]),Math.round(g[1])],feature:c,segment:u}};if(this.vertex_||this.intersection_){for(let _=0;_<a;++_){const m=o[_];if(m.feature.getGeometry().getType()!=="Circle")for(const p of m.segment){const y=Ft(p),S=mn(s,y);S<h&&(this.intersection_&&m.intersectionFeature||this.vertex_&&!m.intersectionFeature)&&(l=p,h=S,c=m.feature)}}const g=d();if(g)return g}if(this.edge_){for(let _=0;_<a;++_){let m=null;const p=o[_];if(p.feature.getGeometry().getType()==="Circle"){let y=p.feature.getGeometry();m=tv(s,y)}else{const[y,S]=p.segment;S&&(mc[0]=Ft(y),mc[1]=Ft(S),m=eh(s,mc))}if(m){const y=mn(s,m);y<h&&(l=os(m),u=p.feature.getGeometry().getType()==="Circle"?null:p.segment,h=y,c=p.feature)}}const g=d();if(g)return g}return null}updateFeature_(t){this.removeFeature(t,!1),this.addFeature(t,!1)}}const oR=_e({inheritAttrs:!1,__name:"OlInteractionSelect",props:{addCondition:{type:Function},condition:{type:Function},layers:{type:[Array,Function]},style:{type:[Object,Array,Function,null]},removeCondition:{type:Function},toggleCondition:{type:Function},multi:{type:Boolean},features:{},filter:{type:Function},hitTolerance:{}},emits:["change","error","propertychange","select"],setup(e,{expose:t}){const i=e,n=Xt("map"),s=Pn(i),r=Ee(()=>new Rf({style:new fe,...s}));return kr(r,["select"]),ie(r,(o,a)=>{n?.removeInteraction(a),n?.addInteraction(o),n?.changed()}),ei(()=>{n?.addInteraction(r.value)}),wi(()=>{n?.removeInteraction(r.value)}),Mi("stylable",r),t({select:r}),(o,a)=>qi(o.$slots,"default")}}),aR=_e({inheritAttrs:!1,__name:"OlInteractionModify",props:{condition:{type:Function},deleteCondition:{type:Function},insertVertexCondition:{type:Function},pixelTolerance:{},style:{type:[Object,Array,Function]},source:{},hitDetection:{type:Boolean},features:{},wrapX:{type:Boolean},snapToPointer:{type:Boolean}},emits:["change","error","propertychange","modifystart","modifyend"],setup(e,{expose:t}){const i=e,n=Xt("map"),s=Xt("vectorSource",null),{source:r,features:o,condition:a,deleteCondition:l,insertVertexCondition:h,pixelTolerance:c,wrapX:u,hitDetection:f,snapToPointer:d}=Ul(i);function g(){return r?.value||o.value||console.error(`[Vue3-OpenLayers Error] OlInteractionModify: Modify interactions needs either a source or features to work.
|
|
12
|
-
Please provide either the props 'source' or 'feature' or use the component with an '<OlSourceVector>' component.`),new s1({source:r.value||s?.value,features:o.value,condition:a.value,deleteCondition:l.value,insertVertexCondition:h.value,pixelTolerance:c.value,wrapX:u.value,hitDetection:f.value,snapToPointer:d.value})}let _=g();return kr(_,["modifystart","modifyend"]),ie([a,l,h,c,u,f,d],()=>{_.dispose(),n?.removeInteraction(_),_=g(),n?.addInteraction(_),n?.changed()}),ei(()=>{n?.addInteraction(_)}),wi(()=>{n?.removeInteraction(_)}),Mi("stylable",Nt(_)),t({modify:_}),(m,p)=>qi(m.$slots,"default")}}),lR=_e({__name:"OlInteractionSnap",props:{features:{},source:{},edge:{type:Boolean,default:!0},vertex:{type:Boolean,default:!0},intersection:{type:Boolean},pixelTolerance:{},segmenters:{}},setup(e,{expose:t}){const i=e,n=Xt("map"),s=Xt("vectorSource"),r=Pn(i),o=()=>new rR({...r,source:i.source||s?.value});let a=o();return ie(r,()=>{n?.removeInteraction(a),a=o(),n?.addInteraction(a),n?.changed()}),ei(()=>{n?.addInteraction(a)}),wi(()=>{n?.removeInteraction(a)}),t({snap:a}),(l,h)=>qi(l.$slots,"default")}}),Va={name:"EPSG:28992",def:"+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs",extent:[-285401.92,22598.08,595401.92,903401.92]};function If(e,t){return o1(e,t,[]).join("")}function o1(e,t,i){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)i.push(e.nodeValue);else{let n;for(n=e.firstChild;n;n=n.nextSibling)o1(n,t,i)}return i}function hR(e){return"documentElement"in e}function cR(e){return new DOMParser().parseFromString(e,"application/xml")}function au(e,t){return(function(i,n){const s=e.call(this,i,n);s!==void 0&&n[n.length-1].push(s)})}function qe(e,t,i){return(function(n,s){const r=e.call(this,n,s);if(r!==void 0){const o=s[s.length-1],a=n.localName;let l;a in o?l=o[a]:(l=[],o[a]=l),l.push(r)}})}function it(e,t,i){return(function(n,s){const r=e.call(this,n,s);if(r!==void 0){const o=s[s.length-1],a=n.localName;o[a]=r}})}function At(e,t,i){i=i!==void 0?i:{};let n,s;for(n=0,s=e.length;n<s;++n)i[e[n]]=t;return i}function uR(e,t,i,n){let s;for(s=t.firstElementChild;s;s=s.nextElementSibling){const r=e[s.namespaceURI];if(r!==void 0){const o=r[s.localName];o!==void 0&&o.call(n,s,i)}}}function Wt(e,t,i,n,s){return n.push(e),uR(t,i,n,s),n.pop()}class a1{read(t){if(!t)return null;if(typeof t=="string"){const i=cR(t);return this.readFromDocument(i)}return hR(t)?this.readFromDocument(t):this.readFromNode(t)}readFromDocument(t){for(let i=t.firstChild;i;i=i.nextSibling)if(i.nodeType==Node.ELEMENT_NODE)return this.readFromNode(i);return null}readFromNode(t){St()}}const fR="http://www.w3.org/1999/xlink";function Pf(e){return e.getAttributeNS(fR,"href")}function dR(e){const t=If(e,!1);return gR(t)}function gR(e){const t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(e);if(t)return parseFloat(t[1])}function Hn(e){const t=If(e,!1);return _R(t)}function _R(e){const t=/^\s*(\d+)\s*$/.exec(e);if(t)return parseInt(t[1],10)}function Et(e){return If(e,!1).trim()}const si=[null,"http://www.opengis.net/ows/1.1"],mR=At(si,{ServiceIdentification:it(zR),ServiceProvider:it(UR),OperationsMetadata:it(jR)});class pR extends a1{constructor(){super()}readFromNode(t){const i=Wt({},mR,t,[]);return i||null}}const yR=At(si,{DeliveryPoint:it(Et),City:it(Et),AdministrativeArea:it(Et),PostalCode:it(Et),Country:it(Et),ElectronicMailAddress:it(Et)}),vR=At(si,{Value:qe(VR)}),xR=At(si,{AllowedValues:it(LR)}),ER=At(si,{Phone:it(BR),Address:it(AR)}),SR=At(si,{HTTP:it(NR)}),MR=At(si,{Get:qe(DR),Post:void 0}),wR=At(si,{DCP:it(GR)}),CR=At(si,{Operation:kR}),TR=At(si,{Voice:it(Et),Facsimile:it(Et)}),RR=At(si,{Constraint:qe(OR)}),IR=At(si,{IndividualName:it(Et),PositionName:it(Et),ContactInfo:it(FR)}),PR=At(si,{Abstract:it(Et),AccessConstraints:it(Et),Fees:it(Et),Title:it(Et),ServiceTypeVersion:it(Et),ServiceType:it(Et)}),bR=At(si,{ProviderName:it(Et),ProviderSite:it(Pf),ServiceContact:it(WR)});function AR(e,t){return Wt({},yR,e,t)}function LR(e,t){return Wt({},vR,e,t)}function OR(e,t){const i=e.getAttribute("name");if(i)return Wt({name:i},xR,e,t)}function FR(e,t){return Wt({},ER,e,t)}function GR(e,t){return Wt({},SR,e,t)}function DR(e,t){const i=Pf(e);if(i)return Wt({href:i},RR,e,t)}function NR(e,t){return Wt({},MR,e,t)}function kR(e,t){const i=e.getAttribute("name"),n=Wt({},wR,e,t);if(!n)return;const s=t[t.length-1];s[i]=n}function jR(e,t){return Wt({},CR,e,t)}function BR(e,t){return Wt({},TR,e,t)}function zR(e,t){return Wt({},PR,e,t)}function WR(e,t){return Wt({},IR,e,t)}function UR(e,t){return Wt({},bR,e,t)}function VR(e,t){return Et(e)}const Hi=[null,"http://www.opengis.net/wmts/1.0"],Ur=[null,"http://www.opengis.net/ows/1.1"],XR=At(Hi,{Contents:it(iI)});class $R extends a1{constructor(){super(),this.owsParser_=new pR}readFromNode(t){let i=t.getAttribute("version");i&&(i=i.trim());let n=this.owsParser_.readFromNode(t);return n?(n.version=i,n=Wt(n,XR,t,[]),n||null):null}}const KR=At(Hi,{Layer:qe(nI),TileMatrixSet:qe(sI)}),YR=At(Hi,{Style:qe(rI),Format:qe(Et),TileMatrixSetLink:qe(oI),Dimension:qe(aI),ResourceURL:qe(lI)},At(Ur,{Title:it(Et),Abstract:it(Et),WGS84BoundingBox:it(h1),BoundingBox:qe(hI),Identifier:it(Et)})),qR=At(Hi,{LegendURL:qe(cI)},At(Ur,{Title:it(Et),Identifier:it(Et)})),HR=At(Hi,{TileMatrixSet:it(Et),TileMatrixSetLimits:it(fI)}),ZR=At(Hi,{TileMatrixLimits:au(dI)}),JR=At(Hi,{TileMatrix:it(Et),MinTileRow:it(Hn),MaxTileRow:it(Hn),MinTileCol:it(Hn),MaxTileCol:it(Hn)}),QR=At(Hi,{Default:it(Et),Value:qe(Et)},At(Ur,{Identifier:it(Et)})),l1=At(Ur,{LowerCorner:au(lu),UpperCorner:au(lu)}),tI=At(Hi,{WellKnownScaleSet:it(Et),TileMatrix:qe(uI)},At(Ur,{SupportedCRS:it(Et),Identifier:it(Et),BoundingBox:it(h1)})),eI=At(Hi,{TopLeftCorner:it(lu),ScaleDenominator:it(dR),TileWidth:it(Hn),TileHeight:it(Hn),MatrixWidth:it(Hn),MatrixHeight:it(Hn)},At(Ur,{Identifier:it(Et)}));function iI(e,t){return Wt({},KR,e,t)}function nI(e,t){return Wt({},YR,e,t)}function sI(e,t){return Wt({},tI,e,t)}function rI(e,t){const i=Wt({},qR,e,t);if(!i)return;const n=e.getAttribute("isDefault")==="true";return i.isDefault=n,i}function oI(e,t){return Wt({},HR,e,t)}function aI(e,t){return Wt({},QR,e,t)}function lI(e,t){const i=e.getAttribute("format"),n=e.getAttribute("template"),s=e.getAttribute("resourceType"),r={};return i&&(r.format=i),n&&(r.template=n),s&&(r.resourceType=s),r}function h1(e,t){const i=Wt([],l1,e,t);if(i.length==2)return Qt(i)}function hI(e,t){const i=e.getAttribute("crs"),n=Wt([],l1,e,t);if(n.length==2)return{extent:Qt(n),crs:i}}function cI(e,t){const i={};return i.format=e.getAttribute("format"),i.href=Pf(e),i}function lu(e,t){const i=Et(e).split(/\s+/);if(!i||i.length!=2)return;const n=+i[0],s=+i[1];if(!(isNaN(n)||isNaN(s)))return[n,s]}function uI(e,t){return Wt({},eI,e,t)}function fI(e,t){return Wt([],ZR,e,t)}function dI(e,t){return Wt({},JR,e,t)}const gI={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor"};function _I(e,t){return dt(),jt("svg",gI,[...t[0]||(t[0]=[Ot("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),Ot("path",{d:"m20.5 3-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5M10 5.47l4 1.4v11.66l-4-1.4zm-5 .99 3-1.01v11.7l-3 1.16zm14 11.08-3 1.01V6.86l3-1.16z"},null,-1)])])}const mI={render:_I},pI={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"};function yI(e,t){return dt(),jt("svg",pI,[...t[0]||(t[0]=[Ot("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),Ot("path",{fill:"currentColor",d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27zm0-11.47L17.74 9 12 13.47 6.26 9z"},null,-1)])])}const vI={render:yI},xI={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"};function EI(e,t){return dt(),jt("svg",xI,[...t[0]||(t[0]=[Ot("path",{fill:"#000","fill-rule":"evenodd",d:"M4 10h2V6h4V4H6V0H4v4H0v2h4z"},null,-1)])])}const SI={render:EI},MI={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"2"};function wI(e,t){return dt(),jt("svg",MI,[...t[0]||(t[0]=[Ot("path",{fill:"#000","fill-rule":"evenodd",d:"M10 2V0H0v2z"},null,-1)])])}const CI={render:wI},TI={class:"wrapper"},RI=["id","checked","onClick"],II=["for"],PI={class:"layer"},bI=["checked"],AI=_e({__name:"BaseLayers",props:{baseLayers:{},selectedBaseLayerId:{}},emits:["selectBaseLayer"],setup(e,{emit:t}){const i=e,n=t,s=Ee(()=>i.selectedBaseLayerId===null),r=o=>{if(!o){n("selectBaseLayer",null);return}i.selectedBaseLayerId!==o.options.identifier&&n("selectBaseLayer",o.options.identifier)};return(o,a)=>(dt(),jt("div",TI,[Ot("ul",null,[(dt(!0),jt(ce,null,ol(e.baseLayers,l=>(dt(),jt("li",{key:l.options.identifier,class:"layer"},[Ot("input",{id:l.options.identifier,type:"radio",name:"baseLayer",checked:i.selectedBaseLayerId===l.options.identifier,onClick:()=>r(l)},null,8,RI),Ot("label",{for:l.options.identifier},ea(l.options.title),9,II)]))),128)),Ot("li",PI,[Ot("input",{id:"baseLayer_none",type:"radio",name:"baseLayer",checked:s.value,onClick:a[0]||(a[0]=()=>r(null))},null,8,bI),a[1]||(a[1]=Ot("label",{for:"baseLayer_none"},"Geen",-1))])])]))}}),bf=(e,t)=>{const i=e.__vccOpts||e;for(const[n,s]of t)i[n]=s;return i},LI=bf(AI,[["__scopeId","data-v-7a503b81"]]),OI={class:"wrapper"},FI={key:0},GI={class:"layer-control"},DI=["checked","onChange"],NI={class:"layer-title"},kI=_e({__name:"Layers",props:{toggleableLayers:{},visibleToggleableLayers:{}},emits:["toggleLayer"],setup(e,{emit:t}){const i=t,n=s=>{i("toggleLayer",s)};return(s,r)=>(dt(),jt("div",OI,[e.toggleableLayers.length>0?(dt(),jt("ul",FI,[(dt(!0),jt(ce,null,ol(e.toggleableLayers,o=>(dt(),jt("li",{key:"toggle-"+o.options.identifier,class:"layer"},[Ot("label",GI,[Ot("input",{type:"checkbox",checked:e.visibleToggleableLayers.has(o.options.identifier),onChange:a=>n(o.options.identifier),class:"layer-checkbox"},null,40,DI),Ot("span",NI,ea(o.options.title),1)])]))),128))])):re("",!0)]))}}),jI=bf(kI,[["__scopeId","data-v-16f7d1b3"]]),BI={class:"map-container"},zI={class:"modify-overlay"},WI={key:0,class:"modify-overlay-label"},UI={class:"bottom-left-panels"},VI={key:0,class:"layers-control"},XI=["aria-expanded"],$I={class:"bottom-right-panels"},KI={key:0,class:"base-layers-control"},YI=["aria-expanded"],qI={class:"zoom-panel"},HI=_e({__name:"Map",props:{layers:{default:()=>[]},baseLayers:{default:()=>[]},toggleableLayers:{default:()=>[]},interactions:{},zoom:{default:10},center:{default:()=>[12e4,487e3]}},emits:["featureSelected","featureDeselected","featureModified","mapClicked","modifyCancelled"],setup(e,{expose:t,emit:i}){const n=e,s=i,r=Nt(),o=Nt(),a=Nt(),l=Nt({}),h=Nt({}),c=Nt(!1),u=Nt(!1),f=Nt(null),d=Nt(new Set),g=Nt(!1),_=Nt(null),m=Nt(null),p=Nt(null),y=Nt(null),S=Nt(null),v=Lo(new Me([])),M=Ee(()=>v.value),C=Ee(()=>{const x=n.interactions?.modify?.labelProperty;if(!x||!p.value)return"";const I=p.value.get?.(x);return I==null?"":String(I)}),P=Lo(new globalThis.Map),b=new globalThis.Map,T=new WeakMap,k=(x,I)=>{if(!x||!I)return null;const R=`${x}|${I}`,F=b.get(R);if(F)return F;const G=new _T({url:x,params:{LAYERS:I,TILED:!0},serverType:"geoserver",crossOrigin:"anonymous"});return b.set(R,G),G},U=x=>{if(!x)return null;const I=T.get(x);if(I)return I;const R=new mT({...x,style:x.style||"default"});return T.set(x,R),R},A=(x,I)=>{const R=new globalThis.Map(P.value);R.set(x,I),P.value=R},L=(x,I,R,F)=>{if(!x)return;if(x instanceof fe||typeof x=="function")return x;const G={},q=z=>{if(Array.isArray(z)){const[J,...Q]=z;switch(J){case"get":return I?.getProperties()?.[Q[0]]??null;case"case":for(let ot=0;ot<Q.length-1;ot+=2)if(q(Q[ot]))return q(Q[ot+1]);return q(Q[Q.length-1]);case"==":return q(Q[0])===q(Q[1]);case"coalesce":for(const ot of Q){const pt=q(ot);if(pt!=null)return pt}return null;default:return z}}return z};if(x["fill-color"]&&(G.fill=new li({color:q(x["fill-color"])})),(x["stroke-color"]||x["stroke-width"])&&(G.stroke=new Si({color:q(x["stroke-color"])||"#3399CC",width:q(x["stroke-width"])||1.25})),x["circle-radius"]||x["circle-fill-color"]||x["circle-stroke-color"]){const z=q(x["circle-radius"])||5,J=q(x["circle-fill-color"]),Q=q(x["circle-stroke-color"])||"#3399CC",ot=q(x["circle-stroke-width"])||1.25;G.image=new Us({radius:z,fill:J?new li({color:J}):void 0,stroke:new Si({color:Q,width:ot})})}if(x["text-value"]){const z=q(x["text-value"]);z&&(G.text=new la({text:String(z),fill:new li({color:"#000"}),stroke:new Si({color:"#fff",width:2})}))}return new fe(G)},V=x=>typeof x=="function"?x:x instanceof fe?(I,R,F)=>[x]:(I,R,F)=>{const G=L(x,I);return G?[G]:void 0},tt=Ee(()=>n.layers.map(x=>{if(x.type==="wmts"){const I=P.value.get(x.options.identifier);return{type:"wmts",identifier:x.options.identifier,options:I||null,source:U(I)}}else return x.type==="wms"?{type:"wms",identifier:x.options.identifier,wmsUrl:x.options.url,layerName:x.options.layer,source:k(x.options.url,x.options.layer)}:{type:"vector",identifier:x.options.identifier,options:x.options,style:x.options.style,styleFunction:x.options.styleFunction}})),$=Ee(()=>{if(!f.value||!n.baseLayers)return null;const x=n.baseLayers.find(I=>I.options.identifier===f.value);return!x||x.type==="wmts"&&!P.value.get(x.options.identifier)?null:x}),K=Ee(()=>$.value&&P.value.get($.value.options.identifier)||null),X=Ee(()=>(n.toggleableLayers||[]).filter(x=>d.value.has(x.options.identifier)).map(x=>{if(x.type==="wms")return{type:"wms",identifier:x.options.identifier,wmsUrl:x.options.url,layerName:x.options.layer,source:k(x.options.url,x.options.layer)};if(x.type==="wmts"){const I=P.value.get(x.options.identifier);return{type:"wmts",identifier:x.options.identifier,wmtsOptions:I,source:U(I)}}else if(x.type==="vector")return{type:"vector",identifier:x.options.identifier,options:x.options,style:x.options.style,styleFunction:x.options.styleFunction};return{...x,identifier:x.options.identifier}})),rt=Ee(()=>{const x=[];if($.value){const F=$.value;F.type==="wmts"?x.push({type:"wmts",identifier:F.options.identifier,wmtsOptions:K.value,source:U(K.value),zIndex:0}):F.type==="wms"?x.push({type:"wms",identifier:F.options.identifier,wmsUrl:F.options.url,layerName:F.options.layer,source:k(F.options.url,F.options.layer),zIndex:0}):F.type==="vector"&&x.push({type:"vector",identifier:F.options.identifier,options:F.options,style:F.options.style,styleFunction:F.options.styleFunction,zIndex:0})}const I=X.value.map((F,G)=>({...F,zIndex:G+10})),R=tt.value.map((F,G)=>({...F,zIndex:I.length+G+20}));return[...x,...I,...R]}),ut=()=>{c.value=!c.value},mt=()=>{u.value=!u.value},B=x=>{d.value.has(x)?d.value.delete(x):d.value.add(x)},Ht=x=>{f.value=x},se=()=>{if(o.value?.view){const x=o.value.view,I=x.getZoom(),R=x.getMaxZoom();typeof I=="number"&&I<R&&x.animate({zoom:I+1,duration:250})}},Gt=()=>{if(o.value?.view){const x=o.value.view,I=x.getZoom(),R=x.getMinZoom();typeof I=="number"&&I>R&&x.animate({zoom:I-1,duration:250})}},$t=async(x,I,R)=>{try{const G=await(await fetch(x)).text(),q=new $R().read(G),z=R?[R,"image/jpeg","image/png"]:["image/png","image/jpeg"];let J=null;for(const Q of z)try{if(J=pT(q,{layer:I,matrixSet:"EPSG:28992",projection:"EPSG:28992",format:Q,crossOrigin:"anonymous",style:"default"}),J)break}catch(ot){console.warn(`Format ${Q} failed for layer ${I}:`,ot)}return J&&(J.style="default"),J}catch(F){return console.error("Failed to fetch WMTS capabilities:",F),null}},Kt=x=>{if(!x||x.length===0||!o.value?.view)return;const I=[];for(const R of x)if(R.type==="Point")I.push(R.coordinates);else if(R.type==="Polygon"){const F=R.coordinates;for(const G of F)for(const q of G)I.push(q)}if(I.length>0){const R=Qt(I);o.value.view.fit(R,{padding:[50,50,50,50]})}};ei(async()=>{if(!f.value&&n.baseLayers&&n.baseLayers.length>0){const x=n.baseLayers[0];x?.options.identifier&&(f.value=x.options.identifier)}await new Promise(x=>setTimeout(x,100)),r.value?.map&&r.value.map.on("singleclick",x=>{s("mapClicked",{coordinate:x.coordinate,pixel:x.pixel})});for(const x of n.layers.filter(I=>I.type==="wmts"))if(x.options.url){const I=await $t(x.options.url,x.options.identifier,x.options.format);A(x.options.identifier,I)}if(n.baseLayers){for(const x of n.baseLayers.filter(I=>I.type==="wmts"))if(x.options.url){const I=await $t(x.options.url,x.options.identifier,x.options.format);A(x.options.identifier,I)}}if(n.toggleableLayers){for(const x of n.toggleableLayers.filter(I=>I.type==="wmts"))if(x.options.url){const I=await $t(x.options.url,x.options.identifier,x.options.format);A(x.options.identifier,I)}}});const me=Ee(()=>{if(!n.interactions?.selectable?.layers||n.interactions.selectable.layers.length===0)return;const x=n.interactions.selectable.layers;return(I,R)=>{if(!R)return!1;const F=R.get("name");return x.includes(F)}}),pe=Ee(()=>L(n.interactions?.selectable?.style,void 0)),Z=x=>{v.value&&(v.value.clear(),x.selected&&x.selected.length>0&&v.value.push(x.selected[0])),s("featureSelected",x)},Zt=x=>{m.value=x;const I=x.features.getArray()[0];if(p.value=I||null,I){const R=I.getGeometry();y.value=R.clone();const F=R.getCoordinates();_.value=F,g.value=!0,S.value=R.on("change",()=>{const G=R.getCoordinates();_.value=G})}},E=x=>{m.value=x,p.value=x.features.getArray()[0]||p.value},w=()=>{v.value&&v.value.clear();const x=a.value?.select;(x?.value||x)?.getFeatures?.().clear()},O=()=>{if(m.value){const x=m.value.features.getArray();s("featureModified",{features:x})}w(),N()},j=()=>{if(m.value&&y.value){const x=m.value.features.getArray()[0];x&&x.setGeometry(y.value);const I=m.value.features.getArray();s("modifyCancelled",{features:I})}w(),N()},N=()=>{g.value=!1,_.value=null,m.value=null,p.value=null,y.value=null,S.value&&(t0(S.value),S.value=null)};return t({map:r,view:o,fitToFeatures:Kt}),(x,I)=>(dt(),jt("div",BI,[Vt(Ut(TS),{ref_key:"mapRef",ref:r,style:{width:"100%",height:"100%"},controls:[]},{default:jn(()=>[Vt(Ut(C4),{projectionName:Ut(Va).name,projectionDef:Ut(Va).def,extent:Ut(Va).extent},null,8,["projectionName","projectionDef","extent"]),Vt(Ut(T4),{ref_key:"viewRef",ref:o,center:e.center,zoom:e.zoom,projection:Ut(Va).name},null,8,["center","zoom","projection"]),n.interactions?.selectable?.enabled?(dt(),Re(Ut(oR),{key:0,ref_key:"selectInteractionRef",ref:a,multi:!1,features:M.value,filter:me.value,style:zl(pe.value),onSelect:Z},null,8,["features","filter","style"])):re("",!0),(dt(!0),jt(ce,null,ol(rt.value,R=>(dt(),jt(ce,{key:R.identifier},[R.type==="wms"&&R.source?(dt(),Re(Ut(Gg),{key:0,zIndex:R.zIndex,source:R.source},null,8,["zIndex","source"])):R.type==="wmts"&&R.source?(dt(),Re(Ut(Gg),{key:1,zIndex:R.zIndex,source:R.source},null,8,["zIndex","source"])):R.type==="vector"?(dt(),Re(Ut(KT),{key:2,zIndex:R.zIndex,properties:{name:R.identifier},ref_for:!0,ref:F=>{F&&(l.value[R.identifier]=F)}},{default:jn(()=>[R.styleFunction||R.options?.styleFunction||R.style||R.options?.style?(dt(),Re(Ut(nR),{key:0,overrideStyleFunction:R.styleFunction||R.options?.styleFunction||V(R.style||R.options?.style)},null,8,["overrideStyleFunction"])):re("",!0),Vt(Ut(qT),{ref_for:!0,ref:F=>{F&&(h.value[R.identifier]=F)}},{default:jn(()=>[(dt(!0),jt(ce,null,ol(R.options?.features,(F,G)=>(dt(),Re(Ut(zv),{key:`${R.identifier}-${G}`,properties:F.properties||{}},{default:jn(()=>[F.type==="Point"?(dt(),Re(Ut(HT),{key:0,coordinates:F.coordinates},null,8,["coordinates"])):re("",!0),F.type==="Polygon"?(dt(),Re(Ut(ZT),{key:1,coordinates:F.coordinates},null,8,["coordinates"])):re("",!0)]),_:2},1032,["properties"]))),128)),n.interactions?.modify?.enabled&&n.interactions.modify.layer===R.identifier&&M.value?(dt(),Re(Ut(aR),{key:0,features:M.value,onModifystart:Zt,onModifyend:E},null,8,["features"])):re("",!0),n.interactions?.snap?.enabled&&n.interactions?.modify?.enabled&&n.interactions?.modify?.layer===R.identifier&&h.value[n.interactions.snap.targetLayer]?.source?(dt(),Re(Ut(lR),{key:`snap-${R.identifier}-${n.interactions?.snap?.enabled}-${n.interactions?.modify?.enabled}`,source:h.value[n.interactions.snap.targetLayer]?.source,pixelTolerance:n.interactions?.snap?.pixelTolerance||8},null,8,["source","pixelTolerance"])):re("",!0)]),_:2},1536)]),_:2},1032,["zIndex","properties"])):re("",!0)],64))),128)),g.value&&_.value?(dt(),Re(Ut(IS),{key:1,position:_.value,positioning:"bottom-left",offset:[10,-10],stopEvent:!0},{default:jn(()=>[Ot("div",zI,[C.value?(dt(),jt("div",WI,ea(C.value),1)):re("",!0),Ot("div",{class:"modify-overlay-actions"},[Ot("button",{class:"modify-btn modify-btn-cancel",onClick:j}," Annuleer "),Ot("button",{class:"modify-btn modify-btn-ok",onClick:O}," Bevestig ")])])]),_:1},8,["position"])):re("",!0)]),_:1},512),Ot("div",UI,[e.toggleableLayers&&e.toggleableLayers.length>0?(dt(),jt("div",VI,[Ot("button",{class:Po(["iconbutton",{isActive:u.value}]),"aria-label":"Toon lagen","aria-expanded":u.value,onClick:mt},[Vt(Ut(vI))],10,XI),Vt(Hf,{name:"fade"},{default:jn(()=>[u.value?(dt(),Re(jI,{key:0,toggleableLayers:e.toggleableLayers||[],visibleToggleableLayers:d.value,onToggleLayer:B},null,8,["toggleableLayers","visibleToggleableLayers"])):re("",!0)]),_:1})])):re("",!0)]),Ot("div",$I,[n.baseLayers&&n.baseLayers.length>0?(dt(),jt("div",KI,[Ot("button",{class:Po(["iconbutton",{isActive:c.value}]),"aria-label":"Toon basislagen","aria-expanded":c.value,onClick:ut},[Vt(Ut(mI))],10,YI),Vt(Hf,{name:"fade"},{default:jn(()=>[c.value?(dt(),Re(LI,{key:0,baseLayers:n.baseLayers,selectedBaseLayerId:f.value,onSelectBaseLayer:Ht},null,8,["baseLayers","selectedBaseLayerId"])):re("",!0)]),_:1})])):re("",!0),Ot("div",qI,[Ot("button",{class:"iconbutton","aria-label":"Zoom in",onClick:se},[Vt(Ut(SI))]),Ot("button",{class:"iconbutton","aria-label":"Zoom out",onClick:Gt},[Vt(Ut(CI))])])])]))}}),ZI=bf(HI,[["__scopeId","data-v-00ea6e03"]]),zg=[{type:"Polygon",coordinates:[[[116044.06969709918,495387.60845237196],[116036.42889836353,495385.8300816352],[116041.44790271131,495365.34220878844],[116048.77752176934,495366.9938547696],[116044.06969709918,495387.60845237196]]],properties:{id:"1"}}],JI=[{type:"Point",coordinates:[116039.55578897425,495373.06592906645],properties:{id:"123482",geplaatst:!1}},{type:"Point",coordinates:[116039.55578897425,495373.06592906645],properties:{id:"123483",geplaatst:!1}},{type:"Point",coordinates:[116045.62957295871,495380.7780762627],properties:{id:"22272",geplaatst:!0}},{type:"Point",coordinates:[116040.36077535816,495369.7799269963],properties:{id:"12913",geplaatst:!1}}],QI={class:"example-container"},tP={class:"map-container"},eP={key:0,class:"message-display"},iP=_e({__name:"Example",setup(e){const t=Nt([]),i=Nt([]),n=Nt(!1),s=Nt(!1),r=Ee(()=>[{type:"vector",options:{identifier:"pand",title:"Panden",features:t.value,style:{"fill-color":"rgba(173, 216, 230, 0.6)","stroke-color":"blue","stroke-width":2}}},{type:"vector",options:{identifier:"meetbouten",title:"Meetbouten",features:i.value,styleFunction:(_,m,p)=>{if(p>.2)return[];const y=_.getProperties(),S=y.geplaatst===!0,v=y.id||"";return[new fe({image:new Us({radius:20,fill:new li({color:"white"}),stroke:new Si({color:S?"green":"red",width:2})}),text:v?new la({text:String(v),fill:new li({color:"#000"}),stroke:new Si({color:"#fff",width:2})}):void 0})]}}}]),o=[{type:"wmts",options:{identifier:"referentiekaart",title:"Referentiekaart",url:"https://tiles.zaanstad.nl/mapproxy/service?REQUEST=GetCapabilities&service=wmts"}},{type:"wmts",options:{identifier:"BGT_lijngericht",title:"BGT lijngericht",url:"https://tiles.zaanstad.nl/mapproxy/service?REQUEST=GetCapabilities&service=wmts"}},{type:"wmts",options:{identifier:"lufo-actueel",title:"Luchtfoto actueel",url:"https://tiles.zaanstad.nl/mapproxy/service?REQUEST=GetCapabilities&service=wmts",format:"image/jpeg"}}],a=[{type:"wms",options:{identifier:"bag-pand-bouwjaar",title:"BAG Pand Bouwjaar",url:"https://maps.zaanstad.nl/geoserver/wms",layer:"geo:bag_pand_bouwjaar"}}],l=Nt(null),h=Nt(""),c=Ee(()=>({selectable:{enabled:n.value,layers:["meetbouten"],style:{"circle-radius":20,"circle-fill-color":"rgba(173, 216, 230, 0.8)","circle-stroke-color":"blue","circle-stroke-width":2}},modify:{enabled:s.value,layer:"meetbouten",labelProperty:"id"},snap:{enabled:!0,layer:"meetbouten",targetLayer:"pand",pixelTolerance:15}})),u=_=>{h.value=`Feature geselecteerd: ${_.selected.length} feature(s)`,console.log("Feature geselecteerd:",_.selected,_.selected[0]?.getProperties())},f=_=>{h.value=`Feature gewijzigd: ${_.features.length} feature(s)`,console.log("Feature gewijzigd",_.features)},d=_=>{h.value=`Wijziging geannuleerd voor ${_.features.length} feature(s)`,console.log("Wijziging geannuleerd",_.features)},g=_=>{l.value?.map?.map&&l.value.map.map.getFeaturesAtPixel(_.pixel).length>0||(h.value=`Kaart geklikt op coördinaat: [${_.coordinate[0].toFixed(0)}, ${_.coordinate[1].toFixed(0)}]`,console.log("Kaart geklikt:",_))};return ei(()=>{setTimeout(()=>{n.value=!0,s.value=!0},100),setTimeout(()=>{t.value=[...zg],i.value=[...JI],l.value&&l.value.fitToFeatures(zg)},100)}),(_,m)=>(dt(),jt("div",QI,[Ot("div",tP,[Vt(Ut(ZI),{ref_key:"mapRef",ref:l,baseLayers:o,toggleableLayers:a,layers:r.value,interactions:c.value,onFeatureSelected:u,onFeatureModified:f,onModifyCancelled:d,onMapClicked:g},null,8,["layers","interactions"])]),h.value?(dt(),jt("div",eP,ea(h.value),1)):re("",!0)]))}});Dy(iP).mount("#app");
|